@inupedia/spotlight-client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -0
- package/dist/agentCapability.d.ts +43 -0
- package/dist/agentCapability.d.ts.map +1 -0
- package/dist/agentCapability.js +84 -0
- package/dist/agentDecoratorTypes.d.ts +26 -0
- package/dist/agentDecoratorTypes.d.ts.map +1 -0
- package/dist/agentDecoratorTypes.js +1 -0
- package/dist/agentExecutor.d.ts +35 -0
- package/dist/agentExecutor.d.ts.map +1 -0
- package/dist/agentExecutor.js +224 -0
- package/dist/agentRegistry.d.ts +110 -0
- package/dist/agentRegistry.d.ts.map +1 -0
- package/dist/agentRegistry.js +171 -0
- package/dist/contextualAction.d.ts +8 -0
- package/dist/contextualAction.d.ts.map +1 -0
- package/dist/contextualAction.js +9 -0
- package/dist/defineAgentService.d.ts +13 -0
- package/dist/defineAgentService.d.ts.map +1 -0
- package/dist/defineAgentService.js +14 -0
- package/dist/defineAgentTool.d.ts +37 -0
- package/dist/defineAgentTool.d.ts.map +1 -0
- package/dist/defineAgentTool.js +48 -0
- package/dist/defineToolsFromRegistry.d.ts +20 -0
- package/dist/defineToolsFromRegistry.d.ts.map +1 -0
- package/dist/defineToolsFromRegistry.js +19 -0
- package/dist/host.d.ts +40 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +160 -0
- package/dist/http.d.ts +20 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +58 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/registryBridge.d.ts +27 -0
- package/dist/registryBridge.d.ts.map +1 -0
- package/dist/registryBridge.js +18 -0
- package/dist/skillPrompt.d.ts +20 -0
- package/dist/skillPrompt.d.ts.map +1 -0
- package/dist/skillPrompt.js +59 -0
- package/dist/skillScriptRunner.d.ts +19 -0
- package/dist/skillScriptRunner.d.ts.map +1 -0
- package/dist/skillScriptRunner.js +39 -0
- package/dist/skillScriptTool.d.ts +18 -0
- package/dist/skillScriptTool.d.ts.map +1 -0
- package/dist/skillScriptTool.js +53 -0
- package/dist/skillServiceStandard.d.ts +20 -0
- package/dist/skillServiceStandard.d.ts.map +1 -0
- package/dist/skillServiceStandard.js +82 -0
- package/dist/vite/index.d.ts +4 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +1 -0
- package/dist/vite/spotlightAgentIoc.d.ts +11 -0
- package/dist/vite/spotlightAgentIoc.d.ts.map +1 -0
- package/dist/vite/spotlightAgentIoc.js +331 -0
- package/package.json +58 -0
- package/src/agentDecorator.d.ts +17 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile-time IoC: strip @agent and inject resolveAgentMeta registration (AST-based).
|
|
3
|
+
*/
|
|
4
|
+
import { parse } from "@babel/parser";
|
|
5
|
+
import traverse from "@babel/traverse";
|
|
6
|
+
import * as t from "@babel/types";
|
|
7
|
+
import MagicString from "magic-string";
|
|
8
|
+
function getDecorators(node) {
|
|
9
|
+
const decorators = node.decorators;
|
|
10
|
+
return decorators ?? [];
|
|
11
|
+
}
|
|
12
|
+
const REGISTER_IMPORT = 'import { registerAgentCapability } from "@inupedia/spotlight-client";\n';
|
|
13
|
+
function parseModule(source, sourceFilename) {
|
|
14
|
+
return parse(source, {
|
|
15
|
+
sourceType: "module",
|
|
16
|
+
plugins: ["typescript", "decorators-legacy"],
|
|
17
|
+
sourceFilename,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function collectAgentMatches(source, sourceFilename) {
|
|
21
|
+
const ast = parseModule(source, sourceFilename);
|
|
22
|
+
const matches = [];
|
|
23
|
+
function pushMatch(decorator, identifier, insertAfter) {
|
|
24
|
+
const expr = decorator.expression;
|
|
25
|
+
if (!t.isCallExpression(expr))
|
|
26
|
+
return;
|
|
27
|
+
if (!t.isIdentifier(expr.callee, { name: "agent" }))
|
|
28
|
+
return;
|
|
29
|
+
if (expr.arguments.length !== 1)
|
|
30
|
+
return;
|
|
31
|
+
const metaArg = expr.arguments[0];
|
|
32
|
+
const metaSource = source.slice(metaArg.start, metaArg.end);
|
|
33
|
+
const decoratorStart = decorator.start;
|
|
34
|
+
let removeEnd = decorator.end;
|
|
35
|
+
if (source[removeEnd] === "\n")
|
|
36
|
+
removeEnd += 1;
|
|
37
|
+
matches.push({
|
|
38
|
+
metaSource,
|
|
39
|
+
identifier,
|
|
40
|
+
insertAfter,
|
|
41
|
+
removeStart: decoratorStart,
|
|
42
|
+
removeEnd,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
traverse(ast, {
|
|
46
|
+
ExportNamedDeclaration(path) {
|
|
47
|
+
const decl = path.node.declaration;
|
|
48
|
+
if (!t.isFunctionDeclaration(decl) || !decl.id?.name)
|
|
49
|
+
return;
|
|
50
|
+
for (const decorator of getDecorators(decl)) {
|
|
51
|
+
pushMatch(decorator, decl.id.name, path.node.end);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
ExportDefaultDeclaration(path) {
|
|
55
|
+
const decl = path.node.declaration;
|
|
56
|
+
if (!t.isFunctionDeclaration(decl) || !decl.id?.name)
|
|
57
|
+
return;
|
|
58
|
+
for (const decorator of getDecorators(decl)) {
|
|
59
|
+
pushMatch(decorator, decl.id.name, path.node.end);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
FunctionDeclaration(path) {
|
|
63
|
+
for (const decorator of getDecorators(path.node)) {
|
|
64
|
+
if (!path.node.id?.name)
|
|
65
|
+
continue;
|
|
66
|
+
const exportPath = path.parentPath?.isExportNamedDeclaration()
|
|
67
|
+
? path.parentPath
|
|
68
|
+
: path;
|
|
69
|
+
pushMatch(decorator, path.node.id.name, exportPath.node.end ?? path.node.end);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
VariableDeclarator(path) {
|
|
73
|
+
if (!t.isIdentifier(path.node.id) || !path.node.init)
|
|
74
|
+
return;
|
|
75
|
+
if (!t.isFunctionExpression(path.node.init))
|
|
76
|
+
return;
|
|
77
|
+
for (const decorator of getDecorators(path.node.init)) {
|
|
78
|
+
const stmt = path.parentPath?.parentPath;
|
|
79
|
+
pushMatch(decorator, path.node.id.name, stmt?.node.end ?? path.node.end);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
ClassMethod(path) {
|
|
83
|
+
if (!t.isIdentifier(path.node.key))
|
|
84
|
+
return;
|
|
85
|
+
for (const decorator of getDecorators(path.node)) {
|
|
86
|
+
pushMatch(decorator, path.node.key.name, path.node.end);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
return matches.sort((a, b) => b.removeStart - a.removeStart);
|
|
91
|
+
}
|
|
92
|
+
function findMatchingParen(source, openIndex) {
|
|
93
|
+
let depth = 0;
|
|
94
|
+
for (let i = openIndex; i < source.length; i += 1) {
|
|
95
|
+
const ch = source[i];
|
|
96
|
+
if (ch === "(")
|
|
97
|
+
depth += 1;
|
|
98
|
+
else if (ch === ")") {
|
|
99
|
+
depth -= 1;
|
|
100
|
+
if (depth === 0)
|
|
101
|
+
return i;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return -1;
|
|
105
|
+
}
|
|
106
|
+
function skipLeadingWhitespaceAndComments(source, fromIndex) {
|
|
107
|
+
let i = fromIndex;
|
|
108
|
+
while (i < source.length) {
|
|
109
|
+
const ch = source[i] ?? "";
|
|
110
|
+
if (/\s/.test(ch)) {
|
|
111
|
+
i += 1;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (source.slice(i, i + 2) === "//") {
|
|
115
|
+
const nl = source.indexOf("\n", i);
|
|
116
|
+
i = nl === -1 ? source.length : nl + 1;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (source.slice(i, i + 2) === "/*") {
|
|
120
|
+
const end = source.indexOf("*/", i + 2);
|
|
121
|
+
i = end === -1 ? source.length : end + 2;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
return i;
|
|
127
|
+
}
|
|
128
|
+
function findFunctionBodyEnd(source, bodyStart) {
|
|
129
|
+
if (source[bodyStart] !== "{")
|
|
130
|
+
return null;
|
|
131
|
+
let depth = 0;
|
|
132
|
+
for (let i = bodyStart; i < source.length; i += 1) {
|
|
133
|
+
if (source[i] === "{")
|
|
134
|
+
depth += 1;
|
|
135
|
+
else if (source[i] === "}") {
|
|
136
|
+
depth -= 1;
|
|
137
|
+
if (depth === 0)
|
|
138
|
+
return i + 1;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
function findDeclarationAfter(source, fromIndex) {
|
|
144
|
+
const start = skipLeadingWhitespaceAndComments(source, fromIndex);
|
|
145
|
+
const slice = source.slice(start);
|
|
146
|
+
const defaultFnMatch = /^export\s+default\s+(?:async\s+)?function\s+(\w+)/.exec(slice);
|
|
147
|
+
if (defaultFnMatch) {
|
|
148
|
+
const identifier = defaultFnMatch[1];
|
|
149
|
+
const paramOpen = source.indexOf("(", start + defaultFnMatch.index + defaultFnMatch[0].length);
|
|
150
|
+
if (paramOpen === -1)
|
|
151
|
+
return null;
|
|
152
|
+
const paramClose = findMatchingParen(source, paramOpen);
|
|
153
|
+
if (paramClose === -1)
|
|
154
|
+
return null;
|
|
155
|
+
const bodyStart = source.indexOf("{", paramClose);
|
|
156
|
+
if (bodyStart === -1)
|
|
157
|
+
return null;
|
|
158
|
+
const bodyEnd = findFunctionBodyEnd(source, bodyStart);
|
|
159
|
+
return bodyEnd ? { identifier, insertAfter: bodyEnd } : null;
|
|
160
|
+
}
|
|
161
|
+
const fnMatch = /^(export\s+async\s+function\s+(\w+)|export\s+function\s+(\w+)|async\s+function\s+(\w+)|function\s+(\w+))/.exec(slice);
|
|
162
|
+
if (fnMatch) {
|
|
163
|
+
const identifier = fnMatch[2] ?? fnMatch[3] ?? fnMatch[4] ?? fnMatch[5];
|
|
164
|
+
const declStart = start + (fnMatch.index ?? 0);
|
|
165
|
+
const paramOpen = source.indexOf("(", declStart);
|
|
166
|
+
if (paramOpen === -1)
|
|
167
|
+
return null;
|
|
168
|
+
const paramClose = findMatchingParen(source, paramOpen);
|
|
169
|
+
if (paramClose === -1)
|
|
170
|
+
return null;
|
|
171
|
+
const bodyStart = source.indexOf("{", paramClose);
|
|
172
|
+
if (bodyStart === -1)
|
|
173
|
+
return null;
|
|
174
|
+
const bodyEnd = findFunctionBodyEnd(source, bodyStart);
|
|
175
|
+
return bodyEnd ? { identifier, insertAfter: bodyEnd } : null;
|
|
176
|
+
}
|
|
177
|
+
const constMatch = /^export\s+const\s+(\w+)\s*=/.exec(slice);
|
|
178
|
+
if (constMatch) {
|
|
179
|
+
const identifier = constMatch[1];
|
|
180
|
+
let i = start + constMatch.index + constMatch[0].length;
|
|
181
|
+
i = skipLeadingWhitespaceAndComments(source, i);
|
|
182
|
+
if (source[i] === "(") {
|
|
183
|
+
const close = findMatchingParen(source, i);
|
|
184
|
+
if (close === -1)
|
|
185
|
+
return null;
|
|
186
|
+
let end = close + 1;
|
|
187
|
+
while (end < source.length && source[end] !== ";" && source[end] !== "\n") {
|
|
188
|
+
end += 1;
|
|
189
|
+
}
|
|
190
|
+
if (source[end] === ";")
|
|
191
|
+
end += 1;
|
|
192
|
+
return { identifier, insertAfter: end };
|
|
193
|
+
}
|
|
194
|
+
const asyncFnMatch = /^async\s+function\s+(\w+)/.exec(source.slice(i));
|
|
195
|
+
if (asyncFnMatch) {
|
|
196
|
+
const fnStart = i + asyncFnMatch.index + asyncFnMatch[0].length;
|
|
197
|
+
const paramOpen = source.indexOf("(", fnStart - 1);
|
|
198
|
+
if (paramOpen === -1)
|
|
199
|
+
return null;
|
|
200
|
+
const paramClose = findMatchingParen(source, paramOpen);
|
|
201
|
+
if (paramClose === -1)
|
|
202
|
+
return null;
|
|
203
|
+
const bodyStart = source.indexOf("{", paramClose);
|
|
204
|
+
if (bodyStart === -1)
|
|
205
|
+
return null;
|
|
206
|
+
const bodyEnd = findFunctionBodyEnd(source, bodyStart);
|
|
207
|
+
if (!bodyEnd)
|
|
208
|
+
return null;
|
|
209
|
+
let end = bodyEnd;
|
|
210
|
+
while (end < source.length && source[end] !== ";" && source[end] !== "\n") {
|
|
211
|
+
end += 1;
|
|
212
|
+
}
|
|
213
|
+
if (source[end] === ";")
|
|
214
|
+
end += 1;
|
|
215
|
+
return { identifier, insertAfter: end };
|
|
216
|
+
}
|
|
217
|
+
if (source.slice(i, i + 6) === "async ") {
|
|
218
|
+
i += 6;
|
|
219
|
+
i = skipLeadingWhitespaceAndComments(source, i);
|
|
220
|
+
}
|
|
221
|
+
if (source[i] === "(") {
|
|
222
|
+
const close = findMatchingParen(source, i);
|
|
223
|
+
if (close === -1)
|
|
224
|
+
return null;
|
|
225
|
+
let end = close + 1;
|
|
226
|
+
if (source[end] === ";")
|
|
227
|
+
end += 1;
|
|
228
|
+
return { identifier, insertAfter: end };
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
/** Legacy string scanner when Babel cannot parse decorated exports. */
|
|
234
|
+
function collectAgentMatchesLegacy(source) {
|
|
235
|
+
const matches = [];
|
|
236
|
+
const kind = "@agent";
|
|
237
|
+
let searchFrom = 0;
|
|
238
|
+
while (searchFrom < source.length) {
|
|
239
|
+
const at = source.indexOf(kind + "(", searchFrom);
|
|
240
|
+
if (at === -1)
|
|
241
|
+
break;
|
|
242
|
+
const metaOpen = at + kind.length;
|
|
243
|
+
const metaClose = findMatchingParen(source, metaOpen);
|
|
244
|
+
if (metaClose === -1)
|
|
245
|
+
break;
|
|
246
|
+
const metaSource = source.slice(metaOpen + 1, metaClose).trim();
|
|
247
|
+
let removeTo = metaClose + 1;
|
|
248
|
+
while (removeTo < source.length && /\s/.test(source[removeTo] ?? "")) {
|
|
249
|
+
removeTo += 1;
|
|
250
|
+
}
|
|
251
|
+
const decl = findDeclarationAfter(source, removeTo);
|
|
252
|
+
if (decl) {
|
|
253
|
+
matches.push({
|
|
254
|
+
metaSource,
|
|
255
|
+
identifier: decl.identifier,
|
|
256
|
+
removeStart: at,
|
|
257
|
+
removeEnd: removeTo,
|
|
258
|
+
insertAfter: decl.insertAfter,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
searchFrom = metaClose + 1;
|
|
262
|
+
}
|
|
263
|
+
return matches.sort((a, b) => b.removeStart - a.removeStart);
|
|
264
|
+
}
|
|
265
|
+
function applyAgentMatches(code, id, matches, agentPreset) {
|
|
266
|
+
const s = new MagicString(code);
|
|
267
|
+
for (const match of matches) {
|
|
268
|
+
s.remove(match.removeStart, match.removeEnd);
|
|
269
|
+
s.appendLeft(match.insertAfter, `\n${registrationLine(match.metaSource, match.identifier, id)}\n`);
|
|
270
|
+
}
|
|
271
|
+
let output = s.toString();
|
|
272
|
+
const presetImport = `import { resolveAgentMeta } from "${agentPreset}";\n`;
|
|
273
|
+
if (!/import\s+{[^}]*\bregisterAgentCapability\b/.test(output)) {
|
|
274
|
+
output = REGISTER_IMPORT + output;
|
|
275
|
+
}
|
|
276
|
+
if (!/import\s+{[^}]*\bresolveAgentMeta\b/.test(output)) {
|
|
277
|
+
output = presetImport + output;
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
code: output,
|
|
281
|
+
map: s.generateMap({ hires: true, source: id, includeContent: true }),
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function registrationLine(metaSource, identifier, fileId) {
|
|
285
|
+
const fileLiteral = JSON.stringify(fileId);
|
|
286
|
+
return `registerAgentCapability(resolveAgentMeta(${metaSource}, ${fileLiteral}), ${identifier});`;
|
|
287
|
+
}
|
|
288
|
+
export function transformSpotlightAgentIoc(code, id, options = {}) {
|
|
289
|
+
const agentPreset = options.agentPreset ?? "@/service/agent/presets/resolveAgentMeta";
|
|
290
|
+
if (!code.includes("@agent") && !code.includes("@Agent"))
|
|
291
|
+
return null;
|
|
292
|
+
let matches = [];
|
|
293
|
+
try {
|
|
294
|
+
matches = collectAgentMatches(code, id);
|
|
295
|
+
}
|
|
296
|
+
catch {
|
|
297
|
+
matches = [];
|
|
298
|
+
}
|
|
299
|
+
if (matches.length === 0) {
|
|
300
|
+
matches = collectAgentMatchesLegacy(code);
|
|
301
|
+
}
|
|
302
|
+
if (matches.length === 0)
|
|
303
|
+
return null;
|
|
304
|
+
return applyAgentMatches(code, id, matches, agentPreset);
|
|
305
|
+
}
|
|
306
|
+
function shouldTransform(id, includePath) {
|
|
307
|
+
if (id.includes(".test."))
|
|
308
|
+
return false;
|
|
309
|
+
if (id.includes("/_shared/"))
|
|
310
|
+
return false;
|
|
311
|
+
if (typeof includePath === "string")
|
|
312
|
+
return id.includes(includePath);
|
|
313
|
+
return includePath.test(id);
|
|
314
|
+
}
|
|
315
|
+
export default function spotlightAgentIoc(options = {}) {
|
|
316
|
+
const includePath = options.includePath ?? "/capabilities/";
|
|
317
|
+
return {
|
|
318
|
+
name: "spotlight-agent-ioc",
|
|
319
|
+
enforce: "pre",
|
|
320
|
+
transform(code, id) {
|
|
321
|
+
if (!shouldTransform(id, includePath))
|
|
322
|
+
return null;
|
|
323
|
+
const result = transformSpotlightAgentIoc(code, id, {
|
|
324
|
+
agentPreset: options.agentPreset,
|
|
325
|
+
});
|
|
326
|
+
if (!result)
|
|
327
|
+
return null;
|
|
328
|
+
return result;
|
|
329
|
+
},
|
|
330
|
+
};
|
|
331
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inupedia/spotlight-client",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "HTTP/SSE helpers and host tool bridge for Inupedia Spotlight (monorepo workspace package)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "inupedia",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./vite": {
|
|
14
|
+
"types": "./dist/vite/spotlightAgentIoc.d.ts",
|
|
15
|
+
"import": "./dist/vite/spotlightAgentIoc.js"
|
|
16
|
+
},
|
|
17
|
+
"./agent-decorator": {
|
|
18
|
+
"types": "./src/agentDecorator.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./agent-decorator-types": {
|
|
21
|
+
"types": "./dist/agentDecoratorTypes.d.ts",
|
|
22
|
+
"import": "./dist/agentDecoratorTypes.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"src/agentDecorator.d.ts"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@babel/parser": "^7.28.5",
|
|
33
|
+
"@babel/traverse": "^7.28.5",
|
|
34
|
+
"@babel/types": "^7.28.5",
|
|
35
|
+
"magic-string": "^0.30.21",
|
|
36
|
+
"@inupedia/spotlight-protocol": "0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"vite": {
|
|
43
|
+
"optional": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/babel__traverse": "^7.28.0",
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"vitest": "^4.0.18",
|
|
50
|
+
"vite": "^7.3.1"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"clean": "rm -rf dist",
|
|
54
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
55
|
+
"build": "pnpm run clean && tsc -p tsconfig.json",
|
|
56
|
+
"test": "vitest run"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile-time decorator shim (registration injected by @inupedia/spotlight-client/vite).
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentDef } from "./agentDecoratorTypes.js";
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
// eslint-disable-next-line no-var
|
|
8
|
+
var agent: <TInput extends Record<string, unknown> = Record<string, unknown>>(
|
|
9
|
+
meta: AgentDef<TInput>,
|
|
10
|
+
) => (
|
|
11
|
+
target: unknown,
|
|
12
|
+
propertyKey?: string | symbol,
|
|
13
|
+
descriptor?: PropertyDescriptor,
|
|
14
|
+
) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type { AgentDef };
|