@mondaydotcomorg/atp-runtime
Version:
Runtime SDK injected into sandbox for Agent Tool Protocol
38 lines (37 loc) • 1.17 kB
JavaScript
/**
* Decorator-based metadata system for runtime APIs
*
* These decorators are MARKERS ONLY - they don't extract types at runtime.
* All type extraction happens at BUILD TIME using ts-morph.
*
/**
* Class decorator to mark a runtime API
*
* This is just a marker - ts-morph extracts all metadata at build time
*/
export function RuntimeAPI(name, description) {
return function (constructor) {
constructor.API_NAME = name;
constructor.API_DESCRIPTION = description;
return constructor;
};
}
/**
* Method decorator to mark a runtime method
*
* This is just a marker - ts-morph extracts types/params at build time
* Only the description and optional param descriptions are stored
*/
export function RuntimeMethod(description, paramDescriptions) {
return function (target, propertyKey, descriptor) {
if (!target.constructor.__methods) {
target.constructor.__methods = {};
}
target.constructor.__methods[propertyKey] = {
description,
paramDescriptions: paramDescriptions || {},
};
return descriptor;
};
}
//# sourceMappingURL=decorators.js.map