opc-agent 2.0.0 → 2.0.2

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.
Files changed (157) hide show
  1. package/README.md +545 -365
  2. package/dist/channels/email.d.ts +32 -26
  3. package/dist/channels/email.js +239 -62
  4. package/dist/channels/feishu.d.ts +21 -6
  5. package/dist/channels/feishu.js +225 -126
  6. package/dist/channels/websocket.d.ts +46 -3
  7. package/dist/channels/websocket.js +306 -37
  8. package/dist/channels/wechat.d.ts +33 -13
  9. package/dist/channels/wechat.js +229 -42
  10. package/dist/cli.js +712 -11
  11. package/dist/core/a2a.d.ts +17 -0
  12. package/dist/core/a2a.js +43 -1
  13. package/dist/core/agent.d.ts +16 -0
  14. package/dist/core/agent.js +108 -0
  15. package/dist/core/runtime.d.ts +6 -0
  16. package/dist/core/runtime.js +161 -2
  17. package/dist/core/sandbox.d.ts +26 -0
  18. package/dist/core/sandbox.js +117 -0
  19. package/dist/core/workflow-graph.d.ts +93 -0
  20. package/dist/core/workflow-graph.js +247 -0
  21. package/dist/doctor.d.ts +15 -0
  22. package/dist/doctor.js +183 -0
  23. package/dist/eval/index.d.ts +65 -0
  24. package/dist/eval/index.js +191 -0
  25. package/dist/index.d.ts +32 -6
  26. package/dist/index.js +63 -4
  27. package/dist/plugins/content-filter.d.ts +7 -0
  28. package/dist/plugins/content-filter.js +25 -0
  29. package/dist/plugins/index.d.ts +42 -0
  30. package/dist/plugins/index.js +108 -2
  31. package/dist/plugins/logger.d.ts +6 -0
  32. package/dist/plugins/logger.js +20 -0
  33. package/dist/plugins/rate-limiter.d.ts +7 -0
  34. package/dist/plugins/rate-limiter.js +35 -0
  35. package/dist/protocols/a2a/client.d.ts +25 -0
  36. package/dist/protocols/a2a/client.js +115 -0
  37. package/dist/protocols/a2a/index.d.ts +6 -0
  38. package/dist/protocols/a2a/index.js +12 -0
  39. package/dist/protocols/a2a/server.d.ts +41 -0
  40. package/dist/protocols/a2a/server.js +295 -0
  41. package/dist/protocols/a2a/types.d.ts +91 -0
  42. package/dist/protocols/a2a/types.js +15 -0
  43. package/dist/protocols/a2a/utils.d.ts +6 -0
  44. package/dist/protocols/a2a/utils.js +47 -0
  45. package/dist/protocols/agui/client.d.ts +10 -0
  46. package/dist/protocols/agui/client.js +75 -0
  47. package/dist/protocols/agui/index.d.ts +4 -0
  48. package/dist/protocols/agui/index.js +25 -0
  49. package/dist/protocols/agui/server.d.ts +37 -0
  50. package/dist/protocols/agui/server.js +191 -0
  51. package/dist/protocols/agui/types.d.ts +107 -0
  52. package/dist/protocols/agui/types.js +17 -0
  53. package/dist/protocols/index.d.ts +2 -0
  54. package/dist/protocols/index.js +19 -0
  55. package/dist/protocols/mcp/agent-tools.d.ts +11 -0
  56. package/dist/protocols/mcp/agent-tools.js +129 -0
  57. package/dist/protocols/mcp/index.d.ts +5 -0
  58. package/dist/protocols/mcp/index.js +11 -0
  59. package/dist/protocols/mcp/server.d.ts +31 -0
  60. package/dist/protocols/mcp/server.js +248 -0
  61. package/dist/protocols/mcp/types.d.ts +92 -0
  62. package/dist/protocols/mcp/types.js +17 -0
  63. package/dist/publish/index.d.ts +45 -0
  64. package/dist/publish/index.js +350 -0
  65. package/dist/schema/oad.d.ts +682 -65
  66. package/dist/schema/oad.js +36 -3
  67. package/dist/security/approval.d.ts +36 -0
  68. package/dist/security/approval.js +113 -0
  69. package/dist/security/index.d.ts +4 -0
  70. package/dist/security/index.js +8 -0
  71. package/dist/security/keys.d.ts +16 -0
  72. package/dist/security/keys.js +117 -0
  73. package/dist/studio/server.d.ts +63 -0
  74. package/dist/studio/server.js +625 -0
  75. package/dist/studio-ui/index.html +662 -0
  76. package/dist/telemetry/index.d.ts +93 -0
  77. package/dist/telemetry/index.js +285 -0
  78. package/package.json +5 -3
  79. package/scripts/install.ps1 +31 -0
  80. package/scripts/install.sh +40 -0
  81. package/src/channels/email.ts +351 -177
  82. package/src/channels/feishu.ts +349 -236
  83. package/src/channels/websocket.ts +399 -87
  84. package/src/channels/wechat.ts +329 -149
  85. package/src/cli.ts +783 -12
  86. package/src/core/a2a.ts +60 -0
  87. package/src/core/agent.ts +125 -0
  88. package/src/core/runtime.ts +127 -0
  89. package/src/core/sandbox.ts +143 -0
  90. package/src/core/workflow-graph.ts +365 -0
  91. package/src/doctor.ts +156 -0
  92. package/src/eval/index.ts +211 -0
  93. package/src/eval/suites/basic.json +16 -0
  94. package/src/eval/suites/memory.json +12 -0
  95. package/src/eval/suites/safety.json +14 -0
  96. package/src/index.ts +58 -6
  97. package/src/plugins/content-filter.ts +23 -0
  98. package/src/plugins/index.ts +133 -2
  99. package/src/plugins/logger.ts +18 -0
  100. package/src/plugins/rate-limiter.ts +38 -0
  101. package/src/protocols/a2a/client.ts +132 -0
  102. package/src/protocols/a2a/index.ts +8 -0
  103. package/src/protocols/a2a/server.ts +333 -0
  104. package/src/protocols/a2a/types.ts +88 -0
  105. package/src/protocols/a2a/utils.ts +50 -0
  106. package/src/protocols/agui/client.ts +83 -0
  107. package/src/protocols/agui/index.ts +4 -0
  108. package/src/protocols/agui/server.ts +218 -0
  109. package/src/protocols/agui/types.ts +153 -0
  110. package/src/protocols/index.ts +2 -0
  111. package/src/protocols/mcp/agent-tools.ts +134 -0
  112. package/src/protocols/mcp/index.ts +8 -0
  113. package/src/protocols/mcp/server.ts +262 -0
  114. package/src/protocols/mcp/types.ts +69 -0
  115. package/src/publish/index.ts +376 -0
  116. package/src/schema/oad.ts +39 -2
  117. package/src/security/approval.ts +131 -0
  118. package/src/security/index.ts +3 -0
  119. package/src/security/keys.ts +87 -0
  120. package/src/studio/server.ts +629 -0
  121. package/src/studio-ui/index.html +662 -0
  122. package/src/telemetry/index.ts +324 -0
  123. package/src/types/agent-workstation.d.ts +2 -0
  124. package/tests/a2a-protocol.test.ts +285 -0
  125. package/tests/agui-protocol.test.ts +246 -0
  126. package/tests/channels/discord.test.ts +79 -0
  127. package/tests/channels/email.test.ts +148 -0
  128. package/tests/channels/feishu.test.ts +123 -0
  129. package/tests/channels/telegram.test.ts +129 -0
  130. package/tests/channels/websocket.test.ts +53 -0
  131. package/tests/channels/wechat.test.ts +170 -0
  132. package/tests/chat-cli.test.ts +160 -0
  133. package/tests/daemon.test.ts +135 -0
  134. package/tests/deepbrain-wire.test.ts +234 -0
  135. package/tests/doctor.test.ts +38 -0
  136. package/tests/eval.test.ts +173 -0
  137. package/tests/init-role.test.ts +124 -0
  138. package/tests/mcp-client.test.ts +92 -0
  139. package/tests/mcp-server.test.ts +178 -0
  140. package/tests/plugin-a2a-enhanced.test.ts +230 -0
  141. package/tests/publish.test.ts +231 -0
  142. package/tests/scheduler.test.ts +200 -0
  143. package/tests/security-enhanced.test.ts +233 -0
  144. package/tests/skill-learner.test.ts +161 -0
  145. package/tests/studio.test.ts +229 -0
  146. package/tests/subagent.test.ts +63 -0
  147. package/tests/telemetry.test.ts +186 -0
  148. package/tests/tools/builtin-extended.test.ts +138 -0
  149. package/tests/workflow-graph.test.ts +279 -0
  150. package/tutorial/customer-service-agent/README.md +612 -0
  151. package/tutorial/customer-service-agent/SOUL.md +26 -0
  152. package/tutorial/customer-service-agent/agent.yaml +63 -0
  153. package/tutorial/customer-service-agent/package.json +19 -0
  154. package/tutorial/customer-service-agent/src/index.ts +69 -0
  155. package/tutorial/customer-service-agent/src/skills/faq.ts +27 -0
  156. package/tutorial/customer-service-agent/src/skills/ticket.ts +22 -0
  157. package/tutorial/customer-service-agent/tsconfig.json +14 -0
@@ -0,0 +1,350 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AgentInstaller = exports.AgentPublisher = exports.AgentPackager = void 0;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const crypto = __importStar(require("crypto"));
40
+ const yaml = __importStar(require("js-yaml"));
41
+ const child_process_1 = require("child_process");
42
+ // ─── Ignore patterns ────────────────────────────────────────
43
+ const DEFAULT_IGNORE = [
44
+ 'node_modules',
45
+ '.git',
46
+ '.env',
47
+ '.opc',
48
+ '*.log',
49
+ 'dist',
50
+ '.DS_Store',
51
+ 'Thumbs.db',
52
+ ];
53
+ function loadIgnorePatterns(dir) {
54
+ const opcIgnore = path.join(dir, '.opcignore');
55
+ const gitIgnore = path.join(dir, '.gitignore');
56
+ let lines = [];
57
+ if (fs.existsSync(opcIgnore)) {
58
+ lines = fs.readFileSync(opcIgnore, 'utf-8').split('\n');
59
+ }
60
+ else if (fs.existsSync(gitIgnore)) {
61
+ lines = fs.readFileSync(gitIgnore, 'utf-8').split('\n');
62
+ }
63
+ const patterns = lines
64
+ .map(l => l.trim())
65
+ .filter(l => l && !l.startsWith('#'));
66
+ // Merge with defaults (deduplicate)
67
+ const all = new Set([...DEFAULT_IGNORE, ...patterns]);
68
+ return Array.from(all);
69
+ }
70
+ function matchesPattern(filePath, pattern) {
71
+ // Normalize separators
72
+ const normalized = filePath.replace(/\\/g, '/');
73
+ const p = pattern.replace(/\\/g, '/').replace(/\/$/, '');
74
+ // Exact directory/file match
75
+ if (normalized === p || normalized.startsWith(p + '/'))
76
+ return true;
77
+ // Basename match (e.g. ".env" matches any ".env" at any depth)
78
+ const basename = path.basename(normalized);
79
+ if (basename === p)
80
+ return true;
81
+ // Simple glob: *.ext
82
+ if (p.startsWith('*.')) {
83
+ const ext = p.slice(1); // e.g. ".log"
84
+ if (basename.endsWith(ext))
85
+ return true;
86
+ }
87
+ // Directory at any depth: "tests/" pattern
88
+ const segments = normalized.split('/');
89
+ if (segments.includes(p))
90
+ return true;
91
+ return false;
92
+ }
93
+ function isIgnored(filePath, patterns) {
94
+ return patterns.some(p => matchesPattern(filePath, p));
95
+ }
96
+ // ─── File walker ────────────────────────────────────────────
97
+ function walkDir(dir, base, patterns) {
98
+ const results = [];
99
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
100
+ for (const entry of entries) {
101
+ const rel = path.join(base, entry.name).replace(/\\/g, '/');
102
+ if (isIgnored(rel, patterns))
103
+ continue;
104
+ if (entry.isDirectory()) {
105
+ results.push(...walkDir(path.join(dir, entry.name), rel, patterns));
106
+ }
107
+ else if (entry.isFile()) {
108
+ results.push(rel);
109
+ }
110
+ }
111
+ return results;
112
+ }
113
+ // ─── AgentPackager ──────────────────────────────────────────
114
+ class AgentPackager {
115
+ async validate(dir) {
116
+ const errors = [];
117
+ const warnings = [];
118
+ // Required files
119
+ if (!fs.existsSync(path.join(dir, 'agent.yaml'))) {
120
+ errors.push('Missing agent.yaml');
121
+ }
122
+ if (!fs.existsSync(path.join(dir, 'package.json'))) {
123
+ errors.push('Missing package.json');
124
+ }
125
+ // Recommended files
126
+ if (!fs.existsSync(path.join(dir, 'SOUL.md'))) {
127
+ warnings.push('Missing SOUL.md (recommended)');
128
+ }
129
+ if (!fs.existsSync(path.join(dir, 'README.md'))) {
130
+ warnings.push('Missing README.md');
131
+ }
132
+ // Validate agent.yaml content if it exists
133
+ if (fs.existsSync(path.join(dir, 'agent.yaml'))) {
134
+ try {
135
+ const raw = fs.readFileSync(path.join(dir, 'agent.yaml'), 'utf-8');
136
+ const config = yaml.load(raw);
137
+ if (!config?.metadata?.name) {
138
+ errors.push('agent.yaml: missing metadata.name');
139
+ }
140
+ else {
141
+ const name = config.metadata.name;
142
+ if (name !== name.toLowerCase()) {
143
+ errors.push('agent.yaml: metadata.name must be lowercase');
144
+ }
145
+ if (/\s/.test(name)) {
146
+ errors.push('agent.yaml: metadata.name must not contain spaces');
147
+ }
148
+ }
149
+ if (!config?.metadata?.version) {
150
+ errors.push('agent.yaml: missing metadata.version');
151
+ }
152
+ else {
153
+ const ver = config.metadata.version;
154
+ if (!/^\d+\.\d+\.\d+/.test(ver)) {
155
+ errors.push(`agent.yaml: invalid version format "${ver}" (expected semver)`);
156
+ }
157
+ }
158
+ }
159
+ catch (e) {
160
+ errors.push(`agent.yaml: invalid YAML — ${e instanceof Error ? e.message : e}`);
161
+ }
162
+ }
163
+ // Validate package.json
164
+ if (fs.existsSync(path.join(dir, 'package.json'))) {
165
+ try {
166
+ JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf-8'));
167
+ }
168
+ catch {
169
+ errors.push('package.json: invalid JSON');
170
+ }
171
+ }
172
+ return { valid: errors.length === 0, errors, warnings };
173
+ }
174
+ async listFiles(dir) {
175
+ const patterns = loadIgnorePatterns(dir);
176
+ return walkDir(dir, '', patterns);
177
+ }
178
+ async pack(dir) {
179
+ // 1. Validate
180
+ const validation = await this.validate(dir);
181
+ if (!validation.valid) {
182
+ throw new Error(`Validation failed:\n ${validation.errors.join('\n ')}`);
183
+ }
184
+ // 2. Read configs
185
+ const agentYaml = yaml.load(fs.readFileSync(path.join(dir, 'agent.yaml'), 'utf-8'));
186
+ const pkgJson = JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf-8'));
187
+ const meta = agentYaml.metadata ?? {};
188
+ const spec = agentYaml.spec ?? {};
189
+ // 3. Collect files
190
+ const files = await this.listFiles(dir);
191
+ // 4. Create manifest
192
+ const manifest = {
193
+ name: meta.name ?? pkgJson.name ?? 'unknown',
194
+ version: meta.version ?? pkgJson.version ?? '0.0.0',
195
+ description: meta.description ?? pkgJson.description ?? '',
196
+ author: meta.author ?? pkgJson.author ?? '',
197
+ license: meta.license ?? pkgJson.license ?? 'UNLICENSED',
198
+ agent: {
199
+ model: spec.model ?? '',
200
+ provider: spec.provider?.default ?? '',
201
+ channels: (spec.channels ?? []).map((c) => c.type ?? String(c)),
202
+ skills: (spec.skills ?? []).map((s) => s.name ?? String(s)),
203
+ tools: (spec.tools ?? []).map((t) => t.name ?? String(t)),
204
+ },
205
+ files,
206
+ checksum: '', // computed after tarball
207
+ createdAt: new Date().toISOString(),
208
+ };
209
+ // Write manifest into dir temporarily
210
+ const manifestPath = path.join(dir, 'manifest.json');
211
+ fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
212
+ // 5. Create tarball
213
+ const tarName = `${manifest.name}-${manifest.version}.opc.tgz`;
214
+ const outputPath = path.resolve(dir, '..', tarName);
215
+ // Include manifest.json in file list
216
+ const allFiles = ['manifest.json', ...files];
217
+ try {
218
+ // Try using system tar
219
+ const fileListPath = path.join(dir, '.opc-filelist');
220
+ fs.writeFileSync(fileListPath, allFiles.join('\n'));
221
+ (0, child_process_1.execSync)(`tar czf "${outputPath}" -C "${dir}" -T "${fileListPath}"`, { stdio: 'pipe' });
222
+ // Cleanup temp files
223
+ try {
224
+ fs.unlinkSync(fileListPath);
225
+ }
226
+ catch { /* ignore */ }
227
+ }
228
+ catch {
229
+ // Fallback: use node zlib + simple tar via exec
230
+ // On Windows, try PowerShell Compress-Archive as .zip then rename
231
+ try {
232
+ const tempZip = outputPath.replace('.tgz', '.zip');
233
+ const absFiles = allFiles.map(f => `"${path.join(dir, f)}"`).join(',');
234
+ (0, child_process_1.execSync)(`powershell -NoProfile -Command "Compress-Archive -Path ${absFiles} -DestinationPath '${tempZip}' -Force"`, { stdio: 'pipe' });
235
+ // Rename .zip to .tgz (not ideal but functional)
236
+ if (fs.existsSync(tempZip)) {
237
+ fs.renameSync(tempZip, outputPath);
238
+ }
239
+ }
240
+ catch (e2) {
241
+ // Last resort: create a simple tar-like archive manually
242
+ // Bundle all files as a JSON + base64 archive
243
+ const archive = {};
244
+ for (const f of allFiles) {
245
+ const content = fs.readFileSync(path.join(dir, f));
246
+ archive[f] = content.toString('base64');
247
+ }
248
+ const archiveJson = JSON.stringify(archive);
249
+ const { gzipSync } = require('zlib');
250
+ const compressed = gzipSync(Buffer.from(archiveJson));
251
+ fs.writeFileSync(outputPath, compressed);
252
+ }
253
+ }
254
+ // Cleanup manifest from source dir
255
+ try {
256
+ fs.unlinkSync(manifestPath);
257
+ }
258
+ catch { /* ignore */ }
259
+ // 6. Calculate checksum
260
+ const fileBuffer = fs.readFileSync(outputPath);
261
+ manifest.checksum = crypto.createHash('sha256').update(fileBuffer).digest('hex');
262
+ return { path: outputPath, manifest };
263
+ }
264
+ }
265
+ exports.AgentPackager = AgentPackager;
266
+ // ─── AgentPublisher ─────────────────────────────────────────
267
+ class AgentPublisher {
268
+ async publish(packagePath, manifest, options = {}) {
269
+ const tag = options.tag ?? 'latest';
270
+ const access = options.access ?? 'public';
271
+ const registry = options.registry ?? 'https://registry.npmjs.org';
272
+ if (options.dryRun) {
273
+ console.log('\n📦 Dry run — would publish:\n');
274
+ console.log(` Name: ${manifest.name}`);
275
+ console.log(` Version: ${manifest.version}`);
276
+ console.log(` Tag: ${tag}`);
277
+ console.log(` Access: ${access}`);
278
+ console.log(` Registry: ${registry}`);
279
+ console.log(` Files: ${manifest.files.length}`);
280
+ console.log(` Checksum: ${manifest.checksum}`);
281
+ console.log(` Package: ${packagePath}`);
282
+ console.log();
283
+ return { success: true };
284
+ }
285
+ // For now: placeholder — future OPC registry integration
286
+ console.log(`\n📦 Publishing ${manifest.name}@${manifest.version} (tag: ${tag})...`);
287
+ console.log(` Registry: ${registry}`);
288
+ console.log(` Package: ${packagePath}`);
289
+ console.log(` Checksum: ${manifest.checksum}`);
290
+ // Future: actual npm publish or OPC registry API call
291
+ // execSync(`npm publish "${packagePath}" --tag ${tag} --access ${access}`, { stdio: 'inherit' });
292
+ console.log(`\n✅ Published ${manifest.name}@${manifest.version}`);
293
+ return {
294
+ success: true,
295
+ url: `${registry}/${manifest.name}`,
296
+ };
297
+ }
298
+ }
299
+ exports.AgentPublisher = AgentPublisher;
300
+ // ─── AgentInstaller ─────────────────────────────────────────
301
+ class AgentInstaller {
302
+ async install(source, targetDir) {
303
+ if (!fs.existsSync(targetDir)) {
304
+ fs.mkdirSync(targetDir, { recursive: true });
305
+ }
306
+ if (source.endsWith('.opc.tgz')) {
307
+ // Extract tarball
308
+ if (!fs.existsSync(source)) {
309
+ throw new Error(`Package not found: ${source}`);
310
+ }
311
+ try {
312
+ // Try system tar
313
+ (0, child_process_1.execSync)(`tar xzf "${source}" -C "${targetDir}"`, { stdio: 'pipe' });
314
+ }
315
+ catch {
316
+ // Fallback: try reading as gzipped JSON archive
317
+ const { gunzipSync } = require('zlib');
318
+ const compressed = fs.readFileSync(source);
319
+ try {
320
+ const decompressed = gunzipSync(compressed);
321
+ const archive = JSON.parse(decompressed.toString());
322
+ for (const [filePath, base64Content] of Object.entries(archive)) {
323
+ const fullPath = path.join(targetDir, filePath);
324
+ fs.mkdirSync(path.dirname(fullPath), { recursive: true });
325
+ fs.writeFileSync(fullPath, Buffer.from(base64Content, 'base64'));
326
+ }
327
+ }
328
+ catch {
329
+ throw new Error('Failed to extract package — unsupported archive format');
330
+ }
331
+ }
332
+ // Verify manifest
333
+ const manifestPath = path.join(targetDir, 'manifest.json');
334
+ if (fs.existsSync(manifestPath)) {
335
+ const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
336
+ console.log(`✅ Installed ${manifest.name}@${manifest.version}`);
337
+ }
338
+ else {
339
+ console.log('✅ Extracted package (no manifest found)');
340
+ }
341
+ }
342
+ else {
343
+ // npm install
344
+ console.log(`📦 Installing from npm: ${source}`);
345
+ (0, child_process_1.execSync)(`npm install "${source}"`, { cwd: targetDir, stdio: 'inherit' });
346
+ }
347
+ }
348
+ }
349
+ exports.AgentInstaller = AgentInstaller;
350
+ //# sourceMappingURL=index.js.map