@openagents-org/agent-launcher 0.2.131 → 0.2.133
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/package.json +1 -1
- package/src/adapters/base.js +113 -0
- package/src/adapters/claude.js +334 -274
- package/src/adapters/codex.js +37 -2
- package/src/adapters/workspace-prompt.js +54 -4
- package/src/cli.js +118 -2
- package/src/daemon.js +12 -3
- package/src/index.js +11 -0
- package/src/installer.js +43 -3
- package/src/mcp-server.js +255 -88
- package/src/paths.js +15 -0
- package/src/skill-catalog.js +125 -0
- package/src/skill-installer.js +382 -0
- package/src/update-check.js +5 -25
- package/src/workspace-client.js +93 -0
package/package.json
CHANGED
package/src/adapters/base.js
CHANGED
|
@@ -90,6 +90,19 @@ class BaseAdapter {
|
|
|
90
90
|
this._log(`Warning: join failed: ${e.message} \nStack: ${e.stack}`);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
// Sync workspace-managed skills into disabledModules
|
|
94
|
+
try {
|
|
95
|
+
const agents = await this.client.getAgents(this.workspaceId, this.token);
|
|
96
|
+
const self = agents.find((a) => a.agentName === this.agentName);
|
|
97
|
+
if (self && self.enabledSkills) {
|
|
98
|
+
const { skillsToDisabledModules } = require('../skill-catalog');
|
|
99
|
+
this.disabledModules = skillsToDisabledModules(self.enabledSkills);
|
|
100
|
+
this._log(`Synced skills from workspace: disabled=[${[...this.disabledModules].join(',')}]`);
|
|
101
|
+
}
|
|
102
|
+
} catch (e) {
|
|
103
|
+
this._log(`Warning: skill sync failed (non-fatal): ${e.message}`);
|
|
104
|
+
}
|
|
105
|
+
|
|
93
106
|
// Fast-path operations (control-event cursor + heartbeat + control poll)
|
|
94
107
|
// run BEFORE the message-cursor advance. Even though _skipExistingEvents
|
|
95
108
|
// is fast on a healthy backend, we don't want slash commands gated on
|
|
@@ -217,9 +230,109 @@ class BaseAdapter {
|
|
|
217
230
|
await this._postStatusReport(payload);
|
|
218
231
|
} else if (action === 'routines') {
|
|
219
232
|
await this._postRoutinesReport(payload);
|
|
233
|
+
} else if (action === 'skill.install') {
|
|
234
|
+
await this._handleSkillInstall(payload);
|
|
235
|
+
} else if (action === 'skill.uninstall') {
|
|
236
|
+
await this._handleSkillUninstall(payload);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Install a Skill Hub catalog skill into this agent's local skills
|
|
242
|
+
* directory, then report the result back to the workspace so the UI can
|
|
243
|
+
* show installing → installed / failed. Errors are logged loudly and
|
|
244
|
+
* surfaced as a `failed` status — never swallowed.
|
|
245
|
+
*
|
|
246
|
+
* payload: { action: "skill.install", skill: { id, name, source_repo, source_path } }
|
|
247
|
+
*/
|
|
248
|
+
async _handleSkillInstall(payload) {
|
|
249
|
+
const installer = require('../skill-installer');
|
|
250
|
+
const skill = (payload && payload.skill) || null;
|
|
251
|
+
const skillId = skill && (skill.id || skill.skill_id);
|
|
252
|
+
if (!skillId) {
|
|
253
|
+
this._log('skill.install: missing skill metadata in payload — ignoring');
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
this._log(`skill.install: starting install of "${skillId}" (type=${this.agentType}, dir=${this.workingDir || process.cwd()})`);
|
|
257
|
+
|
|
258
|
+
// Best-effort "installing" ping so the UI flips immediately even if the
|
|
259
|
+
// initial DB write from the request hasn't propagated to this client.
|
|
260
|
+
try {
|
|
261
|
+
await this.client.reportSkillStatus(this.workspaceId, this.agentName, this.token, {
|
|
262
|
+
skillId, state: 'installing',
|
|
263
|
+
});
|
|
264
|
+
} catch (e) {
|
|
265
|
+
this._log(`skill.install: could not report 'installing' (non-fatal): ${e && e.message ? e.message : e}`);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
try {
|
|
269
|
+
const result = installer.installSkill({
|
|
270
|
+
skill,
|
|
271
|
+
agentType: this.agentType,
|
|
272
|
+
workingDir: this.workingDir,
|
|
273
|
+
log: (m) => this._log(`skill.install: ${m}`),
|
|
274
|
+
});
|
|
275
|
+
try {
|
|
276
|
+
await this.client.reportSkillStatus(this.workspaceId, this.agentName, this.token, {
|
|
277
|
+
skillId, state: 'installed', path: result.path, partial: result.partial === true,
|
|
278
|
+
});
|
|
279
|
+
} catch (e) {
|
|
280
|
+
this._log(`skill.install: installed on disk but failed to report 'installed': ${e && e.message ? e.message : e}`);
|
|
281
|
+
}
|
|
282
|
+
this._log(`skill.install: SUCCESS "${skillId}" → ${result.path}${result.partial ? ' (partial)' : ''}`);
|
|
283
|
+
await this._onSkillsChanged();
|
|
284
|
+
} catch (e) {
|
|
285
|
+
const msg = e && e.message ? e.message : String(e);
|
|
286
|
+
this._log(`skill.install: FAILED "${skillId}": ${msg}`);
|
|
287
|
+
try {
|
|
288
|
+
await this.client.reportSkillStatus(this.workspaceId, this.agentName, this.token, {
|
|
289
|
+
skillId, state: 'failed', error: msg,
|
|
290
|
+
});
|
|
291
|
+
} catch (e2) {
|
|
292
|
+
this._log(`skill.install: also failed to report 'failed': ${e2 && e2.message ? e2.message : e2}`);
|
|
293
|
+
}
|
|
220
294
|
}
|
|
221
295
|
}
|
|
222
296
|
|
|
297
|
+
/**
|
|
298
|
+
* Remove a previously-installed skill from disk and report `uninstalled`.
|
|
299
|
+
*/
|
|
300
|
+
async _handleSkillUninstall(payload) {
|
|
301
|
+
const installer = require('../skill-installer');
|
|
302
|
+
const skill = (payload && payload.skill) || null;
|
|
303
|
+
const skillId = skill && (skill.id || skill.skill_id);
|
|
304
|
+
if (!skillId) {
|
|
305
|
+
this._log('skill.uninstall: missing skill metadata in payload — ignoring');
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
try {
|
|
309
|
+
const result = installer.uninstallSkill({
|
|
310
|
+
skill,
|
|
311
|
+
agentType: this.agentType,
|
|
312
|
+
workingDir: this.workingDir,
|
|
313
|
+
log: (m) => this._log(`skill.uninstall: ${m}`),
|
|
314
|
+
});
|
|
315
|
+
this._log(`skill.uninstall: "${skillId}" removed=${result.removed}`);
|
|
316
|
+
try {
|
|
317
|
+
await this.client.reportSkillStatus(this.workspaceId, this.agentName, this.token, {
|
|
318
|
+
skillId, state: 'uninstalled',
|
|
319
|
+
});
|
|
320
|
+
} catch (e) {
|
|
321
|
+
this._log(`skill.uninstall: failed to report status: ${e && e.message ? e.message : e}`);
|
|
322
|
+
}
|
|
323
|
+
await this._onSkillsChanged();
|
|
324
|
+
} catch (e) {
|
|
325
|
+
const msg = e && e.message ? e.message : String(e);
|
|
326
|
+
this._log(`skill.uninstall: FAILED "${skillId}": ${msg}`);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Hook for subclasses to react to a change in the installed-skills set
|
|
332
|
+
* (e.g. rebuild prompt context). Default: no-op.
|
|
333
|
+
*/
|
|
334
|
+
async _onSkillsChanged() {}
|
|
335
|
+
|
|
223
336
|
/**
|
|
224
337
|
* Post a chat message back to the requesting channel summarizing agent
|
|
225
338
|
* name, type, agent-launcher version, uptime, and network. Used by the
|