plugin-agent-orchestrator 1.0.27 → 1.0.32
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 +9 -7
- package/dist/client/index.js +1 -1
- package/dist/client-v2/{214.723affb37c13bf7a.js → 214.79650a549273f163.js} +1 -1
- package/dist/client-v2/264.718a107e43fc163c.js +10 -0
- package/dist/client-v2/373.f5d5292e53c4e832.js +10 -0
- package/dist/client-v2/{41.1805b2edfaa4afe2.js → 41.ba6e080cc0488143.js} +1 -1
- package/dist/client-v2/418.29e713f79131eece.js +10 -0
- package/dist/client-v2/619.bd3c5698b40705c3.js +10 -0
- package/dist/client-v2/677.a991ce0250ff5c77.js +10 -0
- package/dist/client-v2/{70.a15d7fcec7c41768.js → 70.bda9518881c05360.js} +1 -1
- package/dist/client-v2/925.f5370de8f6632d65.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +7 -10
- package/dist/locale/en-US.json +94 -25
- package/dist/locale/vi-VN.json +94 -25
- package/dist/locale/zh-CN.json +94 -25
- package/dist/server/collections/agent-execution-spans.js +37 -0
- package/dist/server/collections/agent-harness-profiles.js +2 -2
- package/dist/server/collections/agent-memory-contexts.js +125 -0
- package/dist/server/collections/orchestrator-logs.js +2 -2
- package/dist/server/migrations/20260425000000-add-interaction-schema.js +3 -1
- package/dist/server/migrations/20260427000000-change-packages-to-text.js +3 -1
- package/dist/server/migrations/20260427000001-change-other-json-to-text.js +6 -2
- package/dist/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.js +21 -19
- package/dist/server/migrations/20260621000000-native-policy-profile-defaults.js +193 -0
- package/dist/server/plugin.js +128 -74
- package/dist/server/resources/agent-monitor.js +454 -0
- package/dist/server/services/AgentHarness.js +24 -499
- package/dist/server/services/AgentMemoryContextService.js +216 -0
- package/dist/server/services/ExecutionSpanService.js +2 -2
- package/dist/server/services/NativeSubAgentObserver.js +413 -0
- package/dist/server/skill-hub/mcp/McpController.js +16 -5
- package/dist/server/skill-hub/plugin.js +81 -5
- package/dist/server/skill-hub/tasks/SkillExecutionTask.js +9 -3
- package/dist/server/tools/delegate-task.js +11 -589
- package/dist/server/utils/skill-settings.js +18 -1
- package/package.json +47 -49
- package/src/client/AIEmployeesContext.tsx +5 -18
- package/src/client/AgentRunsTab.tsx +2 -771
- package/src/client/HarnessProfilesTab.tsx +2 -257
- package/src/client/OrchestratorSettings.tsx +97 -106
- package/src/client/RulesTab.tsx +2 -788
- package/src/client/plugin.tsx +0 -2
- package/src/client/skill-hub/components/ExecutionHistory.tsx +200 -202
- package/src/client/skill-hub/components/ExecutionProgress.tsx +51 -55
- package/src/client/skill-hub/components/LoopSettings.tsx +331 -331
- package/src/client/skill-hub/components/SkillEditor.tsx +43 -39
- package/src/client/skill-hub/components/SkillManager.tsx +194 -181
- package/src/client/skill-hub/components/SkillTestPanel.tsx +141 -145
- package/src/client/skill-hub/locale.ts +16 -16
- package/src/client/skill-hub/tools/SkillHubCard.tsx +104 -109
- package/src/client/skill-hub/tools/loopTemplates.ts +52 -52
- package/src/client/skill-hub/utils/jsonFields.ts +7 -3
- package/src/client-v2/components/AIEmployeesContext.tsx +3 -16
- package/src/client-v2/components/AgentRunsTab.tsx +182 -455
- package/src/client-v2/components/HarnessProfilesTab.tsx +34 -31
- package/src/client-v2/components/RulesTab.tsx +2 -782
- package/src/client-v2/components/TracingTab.tsx +1 -1
- package/src/client-v2/hooks/useApiRequest.ts +8 -1
- package/src/client-v2/pages/RulesPage.tsx +2 -2
- package/src/client-v2/plugin.tsx +3 -3
- package/src/locale/en-US.json +94 -25
- package/src/locale/vi-VN.json +94 -25
- package/src/locale/zh-CN.json +94 -25
- package/src/server/__tests__/native-sub-agent-observer.test.ts +246 -0
- package/src/server/__tests__/skill-settings.test.ts +6 -6
- package/src/server/__tests__/smoke.test.ts +1 -0
- package/src/server/collections/agent-execution-spans.ts +37 -0
- package/src/server/collections/agent-harness-profiles.ts +59 -59
- package/src/server/collections/agent-loop-events.ts +71 -71
- package/src/server/collections/agent-loop-steps.ts +144 -144
- package/src/server/collections/agent-memory-contexts.ts +95 -0
- package/src/server/collections/orchestrator-logs.ts +4 -4
- package/src/server/collections/skill-definitions.ts +111 -111
- package/src/server/collections/skill-executions.ts +106 -106
- package/src/server/collections/skill-loop-configs.ts +65 -65
- package/src/server/migrations/20260423000000-add-progress-fields.ts +14 -14
- package/src/server/migrations/20260425000000-add-interaction-schema.ts +3 -1
- package/src/server/migrations/20260427000000-change-packages-to-text.ts +4 -2
- package/src/server/migrations/20260427000001-change-other-json-to-text.ts +9 -5
- package/src/server/migrations/20260524000000-add-agent-loop-fields-to-skill-executions.ts +30 -30
- package/src/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.ts +145 -142
- package/src/server/migrations/20260615000000-normalize-ai-employee-tool-bindings.ts +2 -2
- package/src/server/migrations/20260621000000-native-policy-profile-defaults.ts +193 -0
- package/src/server/plugin.ts +151 -94
- package/src/server/resources/agent-monitor.ts +482 -0
- package/src/server/services/AgentHarness.ts +38 -623
- package/src/server/services/AgentMemoryContextService.ts +256 -0
- package/src/server/services/AgentPlanValidator.ts +73 -73
- package/src/server/services/ExecutionSpanService.ts +6 -2
- package/src/server/services/FileManager.ts +144 -144
- package/src/server/services/NativeSubAgentObserver.ts +507 -0
- package/src/server/services/SkillManager.ts +583 -583
- package/src/server/services/SkillRepositoryService.ts +5 -7
- package/src/server/services/TokenTracker.ts +3 -3
- package/src/server/services/WorkerEnvManager.ts +1 -2
- package/src/server/skill-hub/actions/git-import.ts +5 -7
- package/src/server/skill-hub/mcp/McpController.ts +41 -14
- package/src/server/skill-hub/plugin.ts +89 -6
- package/src/server/skill-hub/tasks/SkillExecutionTask.ts +470 -460
- package/src/server/skill-hub/utils/json-fields.ts +1 -1
- package/src/server/tools/delegate-task.ts +13 -847
- package/src/server/utils/skill-settings.ts +24 -6
- package/dist/client-v2/264.0533912e6c5ea2d7.js +0 -10
- package/dist/client-v2/418.5ae055abf141820e.js +0 -10
- package/dist/client-v2/619.d99d3c9e61c99064.js +0 -10
- package/dist/client-v2/892.72db4161511c8a16.js +0 -10
- package/dist/client-v2/926.87f660b670d85bcc.js +0 -10
- package/src/client/tools/PlanApprovalCard.tsx +0 -176
- package/src/client/tools/registerOrchestratorCards.ts +0 -17
|
@@ -55,6 +55,8 @@ var import_git_import = require("./actions/git-import");
|
|
|
55
55
|
var import_json_fields = require("./utils/json-fields");
|
|
56
56
|
var import_ExecutionSpanService = require("../services/ExecutionSpanService");
|
|
57
57
|
var import_ai_manager = require("../utils/ai-manager");
|
|
58
|
+
const SKILL_TASK_POLL_INTERVAL_MS = Number.parseInt(process.env.SKILL_HUB_TASK_POLL_INTERVAL_MS || "5000", 10);
|
|
59
|
+
const SKILL_TASK_POLL_LIMIT = Number.parseInt(process.env.SKILL_HUB_TASK_POLL_LIMIT || "3", 10);
|
|
58
60
|
function normalizeToolRuntime(runtime) {
|
|
59
61
|
if (!runtime) return void 0;
|
|
60
62
|
if (typeof runtime === "string") {
|
|
@@ -128,6 +130,10 @@ class SkillHubSubFeature {
|
|
|
128
130
|
cleanupInterval = null;
|
|
129
131
|
initEnvDoneCallback = null;
|
|
130
132
|
initEnvProgressCallback = null;
|
|
133
|
+
skillTaskCallback = null;
|
|
134
|
+
initEnvTaskCallback = null;
|
|
135
|
+
skillTaskPoller = null;
|
|
136
|
+
skillTaskPolling = false;
|
|
131
137
|
mcpController;
|
|
132
138
|
skillRepoService;
|
|
133
139
|
rateLimiter = new RateLimiter(
|
|
@@ -258,17 +264,20 @@ class SkillHubSubFeature {
|
|
|
258
264
|
}
|
|
259
265
|
}
|
|
260
266
|
});
|
|
261
|
-
this.
|
|
267
|
+
this.skillTaskCallback = async (payload) => {
|
|
262
268
|
if (process.env.SKILL_HUB_SANDBOX === "false") return;
|
|
263
269
|
await this.onQueueTask(payload);
|
|
264
|
-
}
|
|
265
|
-
this.app.pubSubManager.subscribe("skill-hub.
|
|
270
|
+
};
|
|
271
|
+
this.app.pubSubManager.subscribe("skill-hub.task", this.skillTaskCallback);
|
|
272
|
+
this.initEnvTaskCallback = async (payload) => {
|
|
266
273
|
if (process.env.SKILL_HUB_SANDBOX === "false") return;
|
|
267
274
|
await this.workerEnvManager.executeInit(payload);
|
|
268
|
-
}
|
|
275
|
+
};
|
|
276
|
+
this.app.pubSubManager.subscribe("skill-hub.init-env", this.initEnvTaskCallback);
|
|
269
277
|
this.app.on("afterStart", async () => {
|
|
270
278
|
this.registerAITools();
|
|
271
279
|
this.startCleanupInterval();
|
|
280
|
+
this.startSkillTaskPoller();
|
|
272
281
|
await this.subscribeInitEnvDone();
|
|
273
282
|
await this.skillManager.seedDefaults().catch((e) => {
|
|
274
283
|
this.app.logger.error(`[skill-hub] Failed to seed default skills: ${e.message}`);
|
|
@@ -277,6 +286,14 @@ class SkillHubSubFeature {
|
|
|
277
286
|
}
|
|
278
287
|
async onQueueTask(message) {
|
|
279
288
|
this.app.logger.info(`[skill-hub] Worker received queue task: ${message.id}`);
|
|
289
|
+
if (process.env.SKILL_HUB_SANDBOX === "false") {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const claimed = await this.claimSkillExecution(message.id);
|
|
293
|
+
if (!claimed) {
|
|
294
|
+
this.app.logger.debug(`[skill-hub] Task ${message.id} ignored: already claimed or not pending.`);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
280
297
|
const execution = await this.db.getRepository("skillExecutions").findOne({
|
|
281
298
|
filter: { id: message.id },
|
|
282
299
|
appends: ["skill"]
|
|
@@ -294,9 +311,52 @@ class SkillHubSubFeature {
|
|
|
294
311
|
);
|
|
295
312
|
await task.run();
|
|
296
313
|
}
|
|
314
|
+
async claimSkillExecution(id) {
|
|
315
|
+
const model = this.db.getModel("skillExecutions");
|
|
316
|
+
const [affected] = await model.update(
|
|
317
|
+
{ status: "running" },
|
|
318
|
+
{
|
|
319
|
+
where: {
|
|
320
|
+
id,
|
|
321
|
+
status: "pending"
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
return affected > 0;
|
|
326
|
+
}
|
|
327
|
+
startSkillTaskPoller() {
|
|
328
|
+
var _a, _b;
|
|
329
|
+
if (process.env.SKILL_HUB_SANDBOX === "false" || this.skillTaskPoller) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const tick = () => {
|
|
333
|
+
this.processPendingSkillExecutions().catch((error) => {
|
|
334
|
+
this.app.logger.warn(`[skill-hub] Pending task poll failed: ${(error == null ? void 0 : error.message) || error}`);
|
|
335
|
+
});
|
|
336
|
+
};
|
|
337
|
+
this.skillTaskPoller = setInterval(tick, SKILL_TASK_POLL_INTERVAL_MS);
|
|
338
|
+
(_b = (_a = this.skillTaskPoller).unref) == null ? void 0 : _b.call(_a);
|
|
339
|
+
setTimeout(tick, 1e3);
|
|
340
|
+
}
|
|
341
|
+
async processPendingSkillExecutions() {
|
|
342
|
+
if (this.skillTaskPolling) return;
|
|
343
|
+
this.skillTaskPolling = true;
|
|
344
|
+
try {
|
|
345
|
+
const records = await this.db.getRepository("skillExecutions").find({
|
|
346
|
+
filter: { status: "pending" },
|
|
347
|
+
sort: ["createdAt"],
|
|
348
|
+
limit: SKILL_TASK_POLL_LIMIT
|
|
349
|
+
});
|
|
350
|
+
for (const record of records) {
|
|
351
|
+
await this.onQueueTask({ id: String(record.get("id")) });
|
|
352
|
+
}
|
|
353
|
+
} finally {
|
|
354
|
+
this.skillTaskPolling = false;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
297
357
|
/**
|
|
298
358
|
* Execute skill — called by both AI tool and REST test endpoint.
|
|
299
|
-
* Dispatches to
|
|
359
|
+
* Dispatches to sandbox workers via PubSub, waits for result via PubSub.
|
|
300
360
|
* Pushes progress to SSE via runtime.writer (if within AI tool context).
|
|
301
361
|
* Includes rate limiting and graceful abort propagation.
|
|
302
362
|
*/
|
|
@@ -666,6 +726,18 @@ IMPORTANT: This skill is bound to a Skill Hub human-in-the-loop review template.
|
|
|
666
726
|
}, CLEANUP_INTERVAL);
|
|
667
727
|
}
|
|
668
728
|
async beforeStop() {
|
|
729
|
+
if (this.skillTaskCallback) {
|
|
730
|
+
try {
|
|
731
|
+
await this.app.pubSubManager.unsubscribe("skill-hub.task", this.skillTaskCallback);
|
|
732
|
+
} catch {
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
if (this.initEnvTaskCallback) {
|
|
736
|
+
try {
|
|
737
|
+
await this.app.pubSubManager.unsubscribe("skill-hub.init-env", this.initEnvTaskCallback);
|
|
738
|
+
} catch {
|
|
739
|
+
}
|
|
740
|
+
}
|
|
669
741
|
if (this.initEnvDoneCallback) {
|
|
670
742
|
try {
|
|
671
743
|
await this.app.pubSubManager.unsubscribe("skill-hub.init-env.done", this.initEnvDoneCallback);
|
|
@@ -682,6 +754,10 @@ IMPORTANT: This skill is bound to a Skill Hub human-in-the-loop review template.
|
|
|
682
754
|
clearInterval(this.cleanupInterval);
|
|
683
755
|
this.cleanupInterval = null;
|
|
684
756
|
}
|
|
757
|
+
if (this.skillTaskPoller) {
|
|
758
|
+
clearInterval(this.skillTaskPoller);
|
|
759
|
+
this.skillTaskPoller = null;
|
|
760
|
+
}
|
|
685
761
|
}
|
|
686
762
|
// --- Handlers ---
|
|
687
763
|
async handleClearStorage(ctx, next) {
|
|
@@ -74,7 +74,9 @@ class SkillExecutionTask {
|
|
|
74
74
|
var _a, _b, _c, _d, _e;
|
|
75
75
|
const skill = this.execution.get("skill") || this.execution.skill;
|
|
76
76
|
const execId = String(this.execution.get("id"));
|
|
77
|
-
|
|
77
|
+
if (this.execution.get("status") !== "running") {
|
|
78
|
+
await this.execution.update({ status: "running" });
|
|
79
|
+
}
|
|
78
80
|
const abortController = new TaskAbortController();
|
|
79
81
|
const abortChannel = `skill-hub.abort.${execId}`;
|
|
80
82
|
const abortCallback = async () => {
|
|
@@ -290,7 +292,9 @@ class SkillExecutionTask {
|
|
|
290
292
|
try {
|
|
291
293
|
manifest = JSON.parse((0, import_fs.readFileSync)(manifestPath, "utf8"));
|
|
292
294
|
} catch (error) {
|
|
293
|
-
throw new Error(
|
|
295
|
+
throw new Error(
|
|
296
|
+
`Generated skill install manifest is invalid JSON: ${error instanceof Error ? error.message : String(error)}`
|
|
297
|
+
);
|
|
294
298
|
}
|
|
295
299
|
if (!(manifest == null ? void 0 : manifest.autoInstall)) return null;
|
|
296
300
|
const skill = manifest.skill || {};
|
|
@@ -393,7 +397,9 @@ class SkillExecutionTask {
|
|
|
393
397
|
const missing = packages.map((pkg) => pkg.trim()).filter((pkg) => !allowedSet.has(pkg.toLowerCase()));
|
|
394
398
|
if (missing.length > 0) {
|
|
395
399
|
throw new Error(
|
|
396
|
-
`Generated skill "${name}" requires ${language} package(s) not available in the Skill Hub worker environment: ${missing.join(
|
|
400
|
+
`Generated skill "${name}" requires ${language} package(s) not available in the Skill Hub worker environment: ${missing.join(
|
|
401
|
+
", "
|
|
402
|
+
)}. Add them to the worker environment and refresh/init Skill Hub before installing this skill.`
|
|
397
403
|
);
|
|
398
404
|
}
|
|
399
405
|
}
|