synabun 2.4.1 → 2.4.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.
- package/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/browser-extension/content.js +56 -14
- package/browser-extension/engine.js +158 -8
- package/browser-extension/manifest.json +3 -1
- package/browser-extension/protocol.js +91 -6
- package/browser-extension/service-worker.js +13 -5
- package/browser-extension/tokens.css +1 -1
- package/docs/browser-extension-bridge.md +24 -4
- package/lib/data-home-files.js +4 -2
- package/lib/first-launch-protection.js +8 -2
- package/lib/update-snapshot.js +11 -4
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +25 -2
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +62 -17
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/services/browser-bench.d.ts +22 -22
- package/mcp-server/dist/services/memory-maintenance.d.ts +1 -0
- package/mcp-server/dist/services/memory-maintenance.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-maintenance.js +34 -45
- package/mcp-server/dist/services/memory-maintenance.js.map +1 -1
- package/mcp-server/dist/services/memory-migration-copy.d.ts +144 -0
- package/mcp-server/dist/services/memory-migration-copy.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-migration-copy.js +467 -0
- package/mcp-server/dist/services/memory-migration-copy.js.map +1 -0
- package/mcp-server/dist/services/memory-migration-worker.d.ts +2 -0
- package/mcp-server/dist/services/memory-migration-worker.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-migration-worker.js +60 -0
- package/mcp-server/dist/services/memory-migration-worker.js.map +1 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts +4 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-retrieval.js +188 -40
- package/mcp-server/dist/services/memory-retrieval.js.map +1 -1
- package/mcp-server/dist/services/memory-schema.d.ts +58 -2
- package/mcp-server/dist/services/memory-schema.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-schema.js +190 -13
- package/mcp-server/dist/services/memory-schema.js.map +1 -1
- package/mcp-server/dist/services/memory-sessions.d.ts +19 -1
- package/mcp-server/dist/services/memory-sessions.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-sessions.js +56 -20
- package/mcp-server/dist/services/memory-sessions.js.map +1 -1
- package/mcp-server/dist/services/memory-verification.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-verification.js +8 -5
- package/mcp-server/dist/services/memory-verification.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +5 -0
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +19 -2
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/retrieval-reader-worker.d.ts +2 -0
- package/mcp-server/dist/services/retrieval-reader-worker.d.ts.map +1 -0
- package/mcp-server/dist/services/retrieval-reader-worker.js +76 -0
- package/mcp-server/dist/services/retrieval-reader-worker.js.map +1 -0
- package/mcp-server/dist/services/retrieval-reader.d.ts +38 -0
- package/mcp-server/dist/services/retrieval-reader.d.ts.map +1 -0
- package/mcp-server/dist/services/retrieval-reader.js +145 -0
- package/mcp-server/dist/services/retrieval-reader.js.map +1 -0
- package/mcp-server/dist/services/sqlite-write.d.ts +14 -0
- package/mcp-server/dist/services/sqlite-write.d.ts.map +1 -0
- package/mcp-server/dist/services/sqlite-write.js +94 -0
- package/mcp-server/dist/services/sqlite-write.js.map +1 -0
- package/mcp-server/dist/services/sqlite.d.ts +39 -0
- package/mcp-server/dist/services/sqlite.d.ts.map +1 -1
- package/mcp-server/dist/services/sqlite.js +249 -8
- package/mcp-server/dist/services/sqlite.js.map +1 -1
- package/mcp-server/dist/services/tool-catalog.d.ts +1 -1
- package/mcp-server/dist/services/typesafe-config.d.ts +7 -1
- package/mcp-server/dist/services/typesafe-config.d.ts.map +1 -1
- package/mcp-server/dist/services/typesafe-config.js +32 -10
- package/mcp-server/dist/services/typesafe-config.js.map +1 -1
- package/mcp-server/dist/services/typesafe.d.ts.map +1 -1
- package/mcp-server/dist/services/typesafe.js +9 -7
- package/mcp-server/dist/services/typesafe.js.map +1 -1
- package/mcp-server/dist/services/vector-cache.d.ts +32 -0
- package/mcp-server/dist/services/vector-cache.d.ts.map +1 -1
- package/mcp-server/dist/services/vector-cache.js +161 -8
- package/mcp-server/dist/services/vector-cache.js.map +1 -1
- package/mcp-server/dist/tools/agent-definition.d.ts +2 -2
- package/mcp-server/dist/tools/agents.d.ts +11 -7
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +27 -9
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.js +10 -3
- package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
- package/mcp-server/dist/tools/browser-extension-setup.d.ts +5 -0
- package/mcp-server/dist/tools/browser-extension-setup.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-extension-setup.js +23 -0
- package/mcp-server/dist/tools/browser-extension-setup.js.map +1 -0
- package/mcp-server/dist/tools/browser-interact.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-interact.js +6 -1
- package/mcp-server/dist/tools/browser-interact.js.map +1 -1
- package/mcp-server/dist/tools/fb-groups.d.ts +2 -2
- package/mcp-server/dist/tools/skill-tools.d.ts +4 -4
- package/mcp-server/dist/tools/tool-groups.d.ts +1 -1
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +1 -1
- package/mcp-server/src/http.ts +20 -2
- package/mcp-server/src/index.ts +59 -17
- package/mcp-server/src/services/memory-maintenance.ts +31 -28
- package/mcp-server/src/services/memory-migration-copy.ts +419 -0
- package/mcp-server/src/services/memory-migration-worker.ts +55 -0
- package/mcp-server/src/services/memory-retrieval.ts +173 -32
- package/mcp-server/src/services/memory-schema.ts +194 -12
- package/mcp-server/src/services/memory-sessions.ts +54 -21
- package/mcp-server/src/services/memory-verification.ts +7 -4
- package/mcp-server/src/services/neural-interface.ts +22 -2
- package/mcp-server/src/services/retrieval-reader-worker.ts +67 -0
- package/mcp-server/src/services/retrieval-reader.ts +131 -0
- package/mcp-server/src/services/sqlite-write.ts +60 -0
- package/mcp-server/src/services/sqlite.ts +246 -8
- package/mcp-server/src/services/typesafe-config.ts +25 -6
- package/mcp-server/src/services/typesafe.ts +9 -7
- package/mcp-server/src/services/vector-cache.ts +154 -9
- package/mcp-server/src/tools/agents.ts +26 -9
- package/mcp-server/src/tools/browser-advanced.ts +10 -3
- package/mcp-server/src/tools/browser-extension-setup.ts +30 -0
- package/mcp-server/src/tools/browser-interact.ts +5 -1
- package/neural-interface/i18n/en.json +263 -1
- package/neural-interface/i18n/pt-BR.json +264 -2
- package/neural-interface/lib/agents/split.js +32 -4
- package/neural-interface/lib/assistant-api.js +19 -8
- package/neural-interface/lib/assistant-brains/claude.js +2 -0
- package/neural-interface/lib/assistant-catalog.js +2 -2
- package/neural-interface/lib/assistant-config.js +0 -7
- package/neural-interface/lib/assistant-dispatch.js +257 -95
- package/neural-interface/lib/assistant-persona.js +16 -4
- package/neural-interface/lib/assistant-pricing.js +65 -14
- package/neural-interface/lib/assistant-router.js +131 -47
- package/neural-interface/lib/assistant-run-wait.js +45 -28
- package/neural-interface/lib/assistant-runtime.js +39 -33
- package/neural-interface/lib/backup-contents.js +158 -0
- package/neural-interface/lib/backup-crypto-io.js +330 -0
- package/neural-interface/lib/backup-crypto-worker.js +130 -0
- package/neural-interface/lib/backup-crypto.js +525 -0
- package/neural-interface/lib/backup-download.js +268 -0
- package/neural-interface/lib/backup-encryption.js +318 -0
- package/neural-interface/lib/backup-groups.js +287 -0
- package/neural-interface/lib/backup-restore-session.js +176 -0
- package/neural-interface/lib/backup-restore-stage.js +60 -0
- package/neural-interface/lib/backup-service.js +788 -233
- package/neural-interface/lib/backup-zip-reader.js +30 -18
- package/neural-interface/lib/backup-zip-writer.js +34 -10
- package/neural-interface/lib/browser-extension-adapter.js +89 -13
- package/neural-interface/lib/browser-extension-bridge.js +18 -7
- package/neural-interface/lib/claude-agent-bridge.js +1 -0
- package/neural-interface/lib/claude-session-cleanup.js +5 -1
- package/neural-interface/lib/cli-update-planner.js +105 -6
- package/neural-interface/lib/client-diagnostics.js +42 -0
- package/neural-interface/lib/confined-fs.js +7 -2
- package/neural-interface/lib/coordination/README.md +8 -2
- package/neural-interface/lib/coordination/contract.js +161 -0
- package/neural-interface/lib/coordination/database.js +999 -0
- package/neural-interface/lib/coordination/operations.js +436 -0
- package/neural-interface/lib/coordination/service.js +68 -537
- package/neural-interface/lib/coordination/storage-worker.js +101 -0
- package/neural-interface/lib/coordination/store.js +219 -1111
- package/neural-interface/lib/db.js +70 -32
- package/neural-interface/lib/health-count.js +37 -0
- package/neural-interface/lib/loop-stall.js +139 -0
- package/neural-interface/lib/maritaca/client.js +2 -2
- package/neural-interface/lib/maritaca/models.js +12 -17
- package/neural-interface/lib/maritaca/opencode.js +4 -2
- package/neural-interface/lib/memory-api.js +9 -1
- package/neural-interface/lib/memory-session-capture.js +42 -10
- package/neural-interface/lib/memory-store-gate.js +313 -0
- package/neural-interface/lib/memory-store-migrate.js +65 -0
- package/neural-interface/lib/memory-timers.js +7 -7
- package/neural-interface/lib/native-loop-providers.js +13 -16
- package/neural-interface/lib/native-loop-runtime.js +28 -7
- package/neural-interface/lib/opencode-build-preflight.js +18 -1
- package/neural-interface/lib/opencode-native-boundary.js +69 -8
- package/neural-interface/lib/opencode-provider-view.js +14 -3
- package/neural-interface/lib/opencode-v2-ws-requests.js +31 -1
- package/neural-interface/lib/opencode2-client.js +2 -1
- package/neural-interface/lib/recall-impact.js +122 -0
- package/neural-interface/lib/scratch-evidence.js +420 -0
- package/neural-interface/lib/scratch-process-guard.js +139 -0
- package/neural-interface/lib/scratch-references.js +279 -0
- package/neural-interface/lib/scratch-retention-core.js +385 -0
- package/neural-interface/lib/scratch-retention-worker.js +37 -0
- package/neural-interface/lib/scratch-retention.js +151 -0
- package/neural-interface/lib/session-cache-builder.js +31 -43
- package/neural-interface/lib/session-cache-worker.js +157 -0
- package/neural-interface/lib/session-indexer.js +28 -21
- package/neural-interface/lib/session-search-index.js +85 -0
- package/neural-interface/lib/skills/creation.js +1 -1
- package/neural-interface/lib/sqlite-integrity-worker.js +3 -1
- package/neural-interface/lib/style-guide/store.js +43 -3
- package/neural-interface/lib/system-restore.js +50 -0
- package/neural-interface/lib/teams/api.js +15 -6
- package/neural-interface/lib/teams/claims.js +67 -31
- package/neural-interface/lib/teams/index.js +7 -7
- package/neural-interface/lib/teams/integration.js +40 -40
- package/neural-interface/lib/teams/landing.js +6 -6
- package/neural-interface/lib/teams/recovery.js +24 -23
- package/neural-interface/lib/teams/scheduler.js +194 -95
- package/neural-interface/lib/teams/state.js +14 -14
- package/neural-interface/lib/teams/worktrees.js +27 -27
- package/neural-interface/lib/whatsapp/bridge.js +2 -1
- package/neural-interface/lib/worker-confinement.js +47 -2
- package/neural-interface/lib/worker-mcp-channel.js +2 -0
- package/neural-interface/lib/worker-resume.js +5 -0
- package/neural-interface/lib/worker-stop.js +86 -0
- package/neural-interface/package-lock.json +2 -2
- package/neural-interface/package.json +1 -1
- package/neural-interface/public/index.html +233 -24
- package/neural-interface/public/onboarding.html +259 -34
- package/neural-interface/public/shared/agents/studio/ax-library.js +0 -6
- package/neural-interface/public/shared/agents/studio/ax-main.js +14 -7
- package/neural-interface/public/shared/agy/agy-options.js +11 -0
- package/neural-interface/public/shared/agy/agy-panel.js +29 -10
- package/neural-interface/public/shared/agy/agy-styles.js +14 -12
- package/neural-interface/public/shared/agy/agy-tabs-logic.js +4 -1
- package/neural-interface/public/shared/api.js +1 -1
- package/neural-interface/public/shared/assistant/asst-api.js +3 -3
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +13 -6
- package/neural-interface/public/shared/assistant/asst-control.js +2 -0
- package/neural-interface/public/shared/assistant/asst-motion-gate.js +78 -4
- package/neural-interface/public/shared/assistant/asst-panel.js +18 -2
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +4 -0
- package/neural-interface/public/shared/assistant/asst-render.js +105 -38
- package/neural-interface/public/shared/assistant/asst-route.js +100 -21
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +1 -1
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +4 -2
- package/neural-interface/public/shared/assistant/asst-state.js +11 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +10 -23
- package/neural-interface/public/shared/assistant/route-identity.js +2 -1
- package/neural-interface/public/shared/cdx/cdx-render.js +9 -0
- package/neural-interface/public/shared/cdx/cdx-settings.js +3 -1
- package/neural-interface/public/shared/cdx/cdx-styles.js +6 -0
- package/neural-interface/public/shared/cdx/cdx-tabs.js +29 -9
- package/neural-interface/public/shared/client-diagnostics.js +94 -0
- package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
- package/neural-interface/public/shared/cp/cp-styles.js +1 -1
- package/neural-interface/public/shared/effort-i18n.js +118 -0
- package/neural-interface/public/shared/html-shell.js +4 -52
- package/neural-interface/public/shared/loading-diagnostic-entry.js +64 -0
- package/neural-interface/public/shared/memory-store-wait.js +52 -0
- package/neural-interface/public/shared/morelogin-profile-field.js +1 -1
- package/neural-interface/public/shared/mtc/mtc-logic.js +2 -1
- package/neural-interface/public/shared/mtc/mtc-panel.js +8 -1
- package/neural-interface/public/shared/mtc/mtc-styles.js +13 -12
- package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +7 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-location-logic.js +109 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +8 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +118 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +27 -3
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +13 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +2 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -93
- package/neural-interface/public/shared/ocp-v2/ocp-v2-variantpicker.js +17 -6
- package/neural-interface/public/shared/output-format.js +294 -0
- package/neural-interface/public/shared/provider-icons.js +6 -0
- package/neural-interface/public/shared/schedules-view.js +2 -1
- package/neural-interface/public/shared/server-presence.js +77 -0
- package/neural-interface/public/shared/settings/settings-backup-contents.js +241 -0
- package/neural-interface/public/shared/settings/settings-backup-download.js +298 -0
- package/neural-interface/public/shared/settings/settings-backup-encryption-pane.js +335 -0
- package/neural-interface/public/shared/settings/settings-backup-encryption.js +545 -0
- package/neural-interface/public/shared/settings/settings-ia.js +1 -1
- package/neural-interface/public/shared/skills/studio/sx-geometry.js +12 -3
- package/neural-interface/public/shared/skills/studio/sx-main.js +14 -7
- package/neural-interface/public/shared/studio-attention.js +6 -0
- package/neural-interface/public/shared/styles.css +341 -437
- package/neural-interface/public/shared/transcript-rows.js +28 -3
- package/neural-interface/public/shared/tray-auto-close.js +18 -5
- package/neural-interface/public/shared/ui-agents.js +1 -2
- package/neural-interface/public/shared/ui-automation-studio.js +168 -108
- package/neural-interface/public/shared/ui-claude-panel.js +42 -65
- package/neural-interface/public/shared/ui-loading.js +124 -17
- package/neural-interface/public/shared/ui-native-loop-router.js +10 -0
- package/neural-interface/public/shared/ui-navbar.js +2 -1
- package/neural-interface/public/shared/ui-output.js +533 -0
- package/neural-interface/public/shared/ui-schedules-studio.js +165 -128
- package/neural-interface/public/shared/ui-scroll-follow.js +97 -6
- package/neural-interface/public/shared/ui-sessions.js +2 -2
- package/neural-interface/public/shared/ui-settings-entry.js +18 -0
- package/neural-interface/public/shared/ui-settings.js +224 -65
- package/neural-interface/public/shared/ui-sidepanel-tray.js +3 -2
- package/neural-interface/public/shared/ui-tooltip.js +16 -0
- package/neural-interface/public/shared/ui-tutorial.js +5 -6
- package/neural-interface/public/shared/ui-worker-end.js +27 -8
- package/neural-interface/public/shared/worker-end.js +9 -4
- package/neural-interface/public/variant/2d/main.js +5 -0
- package/neural-interface/public/variant/3d/app.js +10 -0
- package/neural-interface/public/variant/3d/main.js +5 -1
- package/neural-interface/scripts/scratch-retention.mjs +20 -0
- package/neural-interface/server.js +477 -139
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/scripts/restore-data-home-from-backup.mjs +175 -8
- package/setup.js +18 -4
|
@@ -39,6 +39,7 @@ export class VectorCache {
|
|
|
39
39
|
}
|
|
40
40
|
/** Drop everything; next query reloads from the database. */
|
|
41
41
|
invalidate() {
|
|
42
|
+
this.version++;
|
|
42
43
|
this.loaded = false;
|
|
43
44
|
this.ids = [];
|
|
44
45
|
this.rowIndexById.clear();
|
|
@@ -92,6 +93,7 @@ export class VectorCache {
|
|
|
92
93
|
this.reload();
|
|
93
94
|
}
|
|
94
95
|
reload() {
|
|
96
|
+
this.version++;
|
|
95
97
|
this.reloadCount++;
|
|
96
98
|
// Read the watermark BEFORE the rows. A concurrent commit will then be
|
|
97
99
|
// replayed on the next call instead of accidentally marked as observed.
|
|
@@ -193,6 +195,7 @@ export class VectorCache {
|
|
|
193
195
|
const idx = this.rowIndexById.get(id);
|
|
194
196
|
if (idx === undefined)
|
|
195
197
|
return;
|
|
198
|
+
this.version++;
|
|
196
199
|
const last = this.count - 1;
|
|
197
200
|
if (idx !== last) {
|
|
198
201
|
this.matrix.copyWithin(idx * this.dim, last * this.dim, (last + 1) * this.dim);
|
|
@@ -212,17 +215,67 @@ export class VectorCache {
|
|
|
212
215
|
*/
|
|
213
216
|
topK(query, k, threshold, allowedIds) {
|
|
214
217
|
this.ensureFresh();
|
|
215
|
-
|
|
218
|
+
const scan = this.startScan(query, k, allowedIds, threshold);
|
|
219
|
+
if (!scan)
|
|
216
220
|
return [];
|
|
221
|
+
this.scanRows(scan, 0, scan.total);
|
|
222
|
+
return this.finishScan(scan);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* topK() in slices of ~8 ms that yield to the event loop (149k session
|
|
226
|
+
* chunks: ~60 ms of scoring in one piece). Brings the cache up to date first,
|
|
227
|
+
* as ready() does. A cache changed during a yield is scanned again from the
|
|
228
|
+
* start; after three such restarts the last scan runs without yielding.
|
|
229
|
+
*/
|
|
230
|
+
async topKAsync(query, k, threshold, allowedIds) {
|
|
231
|
+
await this.ready();
|
|
232
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
233
|
+
this.ensureFresh();
|
|
234
|
+
const scan = this.startScan(query, k, allowedIds, threshold);
|
|
235
|
+
if (!scan)
|
|
236
|
+
return [];
|
|
237
|
+
const version = this.version;
|
|
238
|
+
let from = 0;
|
|
239
|
+
let slice = performance.now();
|
|
240
|
+
while (from < scan.total) {
|
|
241
|
+
const to = Math.min(scan.total, from + 2048);
|
|
242
|
+
this.scanRows(scan, from, to);
|
|
243
|
+
from = to;
|
|
244
|
+
if (from < scan.total && performance.now() - slice >= 8) {
|
|
245
|
+
await new Promise(done => setImmediate(done));
|
|
246
|
+
if (this.version !== version)
|
|
247
|
+
break;
|
|
248
|
+
slice = performance.now();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (from >= scan.total)
|
|
252
|
+
return this.finishScan(scan);
|
|
253
|
+
}
|
|
254
|
+
return this.topK(query, k, threshold, allowedIds);
|
|
255
|
+
}
|
|
256
|
+
/** Bumped by every change to the rows, their order or the matrix. */
|
|
257
|
+
version = 0;
|
|
258
|
+
startScan(query, k, allowedIds, threshold) {
|
|
259
|
+
if (this.count === 0 || this.dim === 0)
|
|
260
|
+
return null;
|
|
217
261
|
const q = query instanceof Float32Array ? query : new Float32Array(query);
|
|
218
262
|
if (q.length !== this.dim || !q.every(Number.isFinite) || k < 1)
|
|
219
|
-
return
|
|
220
|
-
const dim = this.dim;
|
|
221
|
-
const m = this.matrix;
|
|
222
|
-
const hits = [];
|
|
263
|
+
return null;
|
|
223
264
|
const selected = allowedIds && allowedIds.size < this.count / 2
|
|
224
265
|
? [...allowedIds].map(id => this.rowIndexById.get(id)).filter((r) => r !== undefined) : undefined;
|
|
225
|
-
|
|
266
|
+
return { q, k, threshold, allowedIds, selected, total: selected?.length ?? this.count, hits: [] };
|
|
267
|
+
}
|
|
268
|
+
finishScan(scan) {
|
|
269
|
+
const { hits, k } = scan;
|
|
270
|
+
hits.sort((a, b) => b.score - a.score);
|
|
271
|
+
return hits.length > k ? hits.slice(0, k) : hits;
|
|
272
|
+
}
|
|
273
|
+
scanRows(scan, from, to) {
|
|
274
|
+
const { q, k, allowedIds, selected, hits } = scan;
|
|
275
|
+
const threshold = scan.threshold;
|
|
276
|
+
const dim = this.dim;
|
|
277
|
+
const m = this.matrix;
|
|
278
|
+
for (let index = from; index < to; index++) {
|
|
226
279
|
const r = selected ? selected[index] : index;
|
|
227
280
|
if (allowedIds && !allowedIds.has(this.ids[r]))
|
|
228
281
|
continue;
|
|
@@ -260,8 +313,108 @@ export class VectorCache {
|
|
|
260
313
|
}
|
|
261
314
|
}
|
|
262
315
|
}
|
|
263
|
-
|
|
264
|
-
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Bring a journalled cache up to date without a synchronous full load, for
|
|
319
|
+
* async callers (recall). A cold cache, or one opened on another connection,
|
|
320
|
+
* is built in slices; a journal backlog of any size replays in slices. The
|
|
321
|
+
* topK() that follows in the same turn then has (almost) nothing to replay.
|
|
322
|
+
* A synchronous reload of 149k session chunks blocked the Neural Interface's
|
|
323
|
+
* event loop for 0.5-1.8 s per recall (docs/startup-freeze-and-agents-audit.md).
|
|
324
|
+
*/
|
|
325
|
+
async ready() {
|
|
326
|
+
if (!this.entity)
|
|
327
|
+
return;
|
|
328
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
329
|
+
const db = this.getDb();
|
|
330
|
+
if (!this.loaded || this.connection !== db) {
|
|
331
|
+
await this.warm();
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
if (await this.replay(db))
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/** Replay the journal after lastSequence in pages, yielding every ~8 ms. false: the cache changed under it. */
|
|
339
|
+
async replay(db) {
|
|
340
|
+
const page = db.prepare('SELECT seq,id FROM memory_changes WHERE entity=? AND seq>? ORDER BY seq LIMIT 512');
|
|
341
|
+
const generation = this.ids;
|
|
342
|
+
let slice = performance.now();
|
|
343
|
+
for (;;) {
|
|
344
|
+
const rows = page.all(this.entity, this.lastSequence);
|
|
345
|
+
if (!rows.length)
|
|
346
|
+
return true;
|
|
347
|
+
for (const id of new Set(rows.map(r => r.id))) {
|
|
348
|
+
this.remove(id);
|
|
349
|
+
this.setFromDb(id);
|
|
350
|
+
if (performance.now() - slice >= 8) {
|
|
351
|
+
await new Promise(done => setImmediate(done));
|
|
352
|
+
if (generation !== this.ids || !this.loaded || db !== this.getDb())
|
|
353
|
+
return false;
|
|
354
|
+
slice = performance.now();
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (generation !== this.ids || !this.loaded)
|
|
358
|
+
return false;
|
|
359
|
+
// A synchronous topK() may have replayed further meanwhile: never move back.
|
|
360
|
+
this.lastSequence = Math.max(this.lastSequence, Number(rows[rows.length - 1].seq));
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
warming = null;
|
|
364
|
+
/**
|
|
365
|
+
* Page the journalled table by rowid and read each eligible vector by its
|
|
366
|
+
* indexed id. No cursor or WAL read transaction crosses a yield. Changes to
|
|
367
|
+
* earlier pages replay from the starting watermark before the first search.
|
|
368
|
+
* Concurrent callers share one build.
|
|
369
|
+
*/
|
|
370
|
+
warm() {
|
|
371
|
+
if (!this.warming)
|
|
372
|
+
this.warming = this.warmOnce().finally(() => { this.warming = null; });
|
|
373
|
+
return this.warming;
|
|
374
|
+
}
|
|
375
|
+
async warmOnce() {
|
|
376
|
+
const db = this.getDb();
|
|
377
|
+
if (!this.entity || (this.loaded && this.connection === db))
|
|
378
|
+
return;
|
|
379
|
+
const generation = this.ids;
|
|
380
|
+
const watermark = db.prepare('SELECT COALESCE(MAX(seq),0) AS seq FROM memory_changes WHERE entity=?').get(this.entity);
|
|
381
|
+
const table = '"' + this.entity.replaceAll('"', '""') + '"';
|
|
382
|
+
const first = db.prepare(`SELECT rowid,id FROM ${table} ORDER BY rowid LIMIT 64`);
|
|
383
|
+
const next = db.prepare(`SELECT rowid,id FROM ${table} WHERE rowid>? ORDER BY rowid LIMIT 64`);
|
|
384
|
+
first.setReadBigInts(true);
|
|
385
|
+
next.setReadBigInts(true);
|
|
386
|
+
const byId = db.prepare(this.getVectorSql);
|
|
387
|
+
const staged = new VectorCache(this.getDb, this.loadSql, this.getVectorSql);
|
|
388
|
+
staged.loaded = true;
|
|
389
|
+
staged.capacity = 64;
|
|
390
|
+
let slice = performance.now();
|
|
391
|
+
let rows = first.all();
|
|
392
|
+
while (rows.length) {
|
|
393
|
+
for (const row of rows) {
|
|
394
|
+
const vector = byId.get(row.id)?.vector;
|
|
395
|
+
if (vector?.byteLength && !(vector.byteLength % 4) && (!staged.dim || vector.byteLength === staged.dim * 4)) {
|
|
396
|
+
staged.set(String(row.id), new Float32Array(vector.buffer, vector.byteOffset, vector.byteLength / 4));
|
|
397
|
+
}
|
|
398
|
+
if (performance.now() - slice >= 8) {
|
|
399
|
+
await new Promise(done => setImmediate(done));
|
|
400
|
+
if (generation !== this.ids || db !== this.getDb())
|
|
401
|
+
return;
|
|
402
|
+
slice = performance.now();
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
rows = next.all(rows[rows.length - 1].rowid);
|
|
406
|
+
}
|
|
407
|
+
this.connection = db;
|
|
408
|
+
this.lastSequence = Number(watermark?.seq ?? 0);
|
|
409
|
+
this.ids = staged.ids;
|
|
410
|
+
this.rowIndexById = staged.rowIndexById;
|
|
411
|
+
this.matrix = staged.matrix;
|
|
412
|
+
this.capacity = staged.capacity;
|
|
413
|
+
this.count = staged.count;
|
|
414
|
+
this.dim = staged.dim;
|
|
415
|
+
this.loaded = true;
|
|
416
|
+
this.version++;
|
|
417
|
+
this.reloadCount++;
|
|
265
418
|
}
|
|
266
419
|
size() {
|
|
267
420
|
this.ensureFresh();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-cache.js","sourceRoot":"","sources":["../../src/services/vector-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,MAAM,OAAO,WAAW;IAeZ;IACA;IACA;IACA;IAjBF,GAAG,GAAa,EAAE,CAAC;IACnB,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,MAAM,GAAiB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IAC3C,GAAG,GAAG,CAAC,CAAC;IACR,KAAK,GAAG,CAAC,CAAC;IACV,QAAQ,GAAG,CAAC,CAAC;IACb,MAAM,GAAG,KAAK,CAAC;IACf,eAAe,GAAG,CAAC,CAAC,CAAC;IACrB,YAAY,GAAG,CAAC,CAAC,CAAC;IAClB,UAAU,GAAG,KAAK,CAAC;IACpB,WAAW,GAAG,CAAC,CAAC;IACf,UAAU,GAAwB,IAAI,CAAC;IAE/C,YACU,KAAyB,EACzB,OAAe,EAAE,2BAA2B;IAC5C,YAAoB,EAAE,iCAAiC;IACvD,MAAe;QAHf,UAAK,GAAL,KAAK,CAAoB;QACzB,YAAO,GAAP,OAAO,CAAQ;QACf,iBAAY,GAAZ,YAAY,CAAQ;QACpB,WAAM,GAAN,MAAM,CAAS;IACtB,CAAC;IAEJ,6DAA6D;IAC7D,UAAU;QACR,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;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;QACtB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -85,17 +85,17 @@ export declare const agentDefinitionSchema: {
|
|
|
85
85
|
kind: "opencode" | "claude-code" | "agent";
|
|
86
86
|
project?: string | undefined;
|
|
87
87
|
id?: string | undefined;
|
|
88
|
+
path?: string | undefined;
|
|
88
89
|
name?: string | undefined;
|
|
89
90
|
text?: string | undefined;
|
|
90
|
-
path?: string | undefined;
|
|
91
91
|
scope?: "project" | "global" | undefined;
|
|
92
92
|
}, {
|
|
93
93
|
kind: "opencode" | "claude-code" | "agent";
|
|
94
94
|
project?: string | undefined;
|
|
95
95
|
id?: string | undefined;
|
|
96
|
+
path?: string | undefined;
|
|
96
97
|
name?: string | undefined;
|
|
97
98
|
text?: string | undefined;
|
|
98
|
-
path?: string | undefined;
|
|
99
99
|
scope?: "project" | "global" | undefined;
|
|
100
100
|
}>>;
|
|
101
101
|
expected_etag: z.ZodOptional<z.ZodString>;
|
|
@@ -5,6 +5,8 @@ export declare const AGENT_ROLE_DENIED = "agent_* tools are only available to th
|
|
|
5
5
|
export declare const AGENT_TOOL_NAMES: readonly ["agent_catalog", "agent_list", "agent_route", "agent_clarify", "agent_dispatch", "agent_status", "agent_read", "agent_send", "agent_wait", "agent_stop", "agent_focus", "agent_usage", "agent_team"];
|
|
6
6
|
export declare const TASK_CLASSES: readonly ["chat", "quick", "code", "complex", "review", "research", "browser", "computer", "automation", "design", "image_gen", "video_gen"];
|
|
7
7
|
export declare const RUN_EVENT_KINDS: readonly ["run.result", "run.needs_input", "run.permission", "run.failed", "run.stalled", "run.stopped", "run.interrupted", "run.completed", "run.budget", "run.notice", "run.message", "run.progress"];
|
|
8
|
+
/** One title limit for agent_route planned_split.slices and agent_team slices[].title (= TEAM_LIMITS.title in neural-interface/lib/teams/schema.js). */
|
|
9
|
+
export declare const SLICE_TITLE_MAX = 80;
|
|
8
10
|
export declare const agentCatalogSchema: {
|
|
9
11
|
provider: z.ZodOptional<z.ZodEnum<["claude-code", "codex", "opencode", "antigravity"]>>;
|
|
10
12
|
search: z.ZodOptional<z.ZodString>;
|
|
@@ -29,6 +31,7 @@ export declare const agentRouteSchema: {
|
|
|
29
31
|
slices: string[];
|
|
30
32
|
reason?: string | undefined;
|
|
31
33
|
}>>;
|
|
34
|
+
needs_host: z.ZodOptional<z.ZodBoolean>;
|
|
32
35
|
needs_vision: z.ZodOptional<z.ZodBoolean>;
|
|
33
36
|
proposals: z.ZodArray<z.ZodObject<{
|
|
34
37
|
kind: z.ZodEnum<["direct", "dispatch"]>;
|
|
@@ -40,16 +43,16 @@ export declare const agentRouteSchema: {
|
|
|
40
43
|
reason: z.ZodOptional<z.ZodString>;
|
|
41
44
|
}, "strip", z.ZodTypeAny, {
|
|
42
45
|
kind: "direct" | "dispatch";
|
|
43
|
-
model?: string | undefined;
|
|
44
46
|
reason?: string | undefined;
|
|
47
|
+
model?: string | undefined;
|
|
45
48
|
provider?: "opencode" | "antigravity" | "claude-code" | "codex" | undefined;
|
|
46
49
|
effort?: string | undefined;
|
|
47
50
|
account_id?: string | undefined;
|
|
48
51
|
agent_ref?: string | undefined;
|
|
49
52
|
}, {
|
|
50
53
|
kind: "direct" | "dispatch";
|
|
51
|
-
model?: string | undefined;
|
|
52
54
|
reason?: string | undefined;
|
|
55
|
+
model?: string | undefined;
|
|
53
56
|
provider?: "opencode" | "antigravity" | "claude-code" | "codex" | undefined;
|
|
54
57
|
effort?: string | undefined;
|
|
55
58
|
account_id?: string | undefined;
|
|
@@ -157,13 +160,13 @@ export declare const agentSendSchema: {
|
|
|
157
160
|
}, "strip", z.ZodTypeAny, {
|
|
158
161
|
decision: "allow" | "deny" | "answer";
|
|
159
162
|
request_id: string;
|
|
160
|
-
answers?: Record<string, unknown> | undefined;
|
|
161
163
|
note?: string | undefined;
|
|
164
|
+
answers?: Record<string, unknown> | undefined;
|
|
162
165
|
}, {
|
|
163
166
|
decision: "allow" | "deny" | "answer";
|
|
164
167
|
request_id: string;
|
|
165
|
-
answers?: Record<string, unknown> | undefined;
|
|
166
168
|
note?: string | undefined;
|
|
169
|
+
answers?: Record<string, unknown> | undefined;
|
|
167
170
|
}>>;
|
|
168
171
|
queue: z.ZodOptional<z.ZodBoolean>;
|
|
169
172
|
};
|
|
@@ -194,7 +197,7 @@ export declare const agentUsageSchema: {
|
|
|
194
197
|
run_id: z.ZodOptional<z.ZodString>;
|
|
195
198
|
};
|
|
196
199
|
export declare const agentCatalogDescription = "Discover what you can route to: providers (claude-code, codex, opencode, antigravity) with models (tier, price per 1M tokens, vision, context, efforts), plus `chat` (chat-only providers such as maritaca: a side panel the user talks to, prices in BRL, never a dispatch target), accounts with subscription usage remaining (or usage unknown; API keys are n/a), registered projects (cwd candidates), SynaBun tool groups and each host's effect, rails/limits, active runs, and `agents`: the SynaBun agents the owner approved, which a dispatch names with agent_ref (ref, name, description, provider/model, task classes, scope global or project, revision; provider and search filter them too). Without arguments it returns a compact routing view (OpenCode sampled); pass provider and/or search to list more models. Call it when the routing sheet in your instructions lacks a model, or after a MODEL_UNKNOWN rejection. Returns JSON.";
|
|
197
|
-
export declare const agentRouteDescription = "The runtime taskId owns one card: retries return it even with different wording or proposals. Only a genuinely separate subtask uses its own stable task_key. Plan the whole task before routing it once. At Pair/Team/Swarm, code/complex/research/review target 2/4/6 workers: pass planned_split with that many distinct titles or fewer with a reason. All four require cwd; a non-git project falls back to one worker with a reason. The card shows this split and one approval covers all workers. Follow next: agent_team plan \u2192 start for all splits. Research/review pass task_class and empty owned_paths: separate worktrees, no integration or landing; wait and synthesize. Never route individual slices. Other classes and Solo stay single. Route an actionable task BEFORE starting it (you are the planner). Give task_class, a one-line summary, your honest confidence (0-1) and 1-3 proposals (direct = here on your model; dispatch = a worker provider/model). proposals.account_id accepts an account id or \"auto\" (most subscription usage left); limited pinned/default accounts fall back within the provider. The returned target.account includes usage and corrections explain the choice. The server applies the session's route mode (always ask / ask when unsure / never ask): it approves at once, or shows the user a route card and waits briefly. A planned split uses workers; on a single-task route card the user can pick here or a worker: follow the returned target.kind and next, never your proposal. Follow the returned status and next: approved+dispatch \u2192 follow next with the approved route_id; approved+direct \u2192 do it yourself (a route the user kept here is never dispatched: agent_dispatch refuses it with ROUTE_IS_DIRECT); continuation \u2192 end your turn (SynaBun continues on the chosen model); pending \u2192 end your turn, the choice arrives as a [SynaBun Mailbox] route_decided event; declined \u2192 do not start (reason no_capable_model: no model can make the image or video, or see for design; tell the user which Model routes row needs one); clarifying \u2192 end your turn, the user has not answered your agent_clarify questions yet (independent:true for a task that does not depend on them). image_gen / video_gen always route to a worker whose model generates the medium, design to a worker whose model can see. With a session budget, a provider whose share is used up cannot take the task: SynaBun first divides the unspent budget again, then moves the task to the next capable provider with money left (your next proposal, the same tier on another provider, then a free model) and says so in corrections (reason budget_share, \"budget: codex share used up -> claude-code/sonnet\"); the saved routes yield to this. When no provider can pay it declines with reason budget_exhausted and names the dry providers (dry). The result carries budget: each provider's share, spent and left. Routed workers inherit the approved agent for their task class; agent_ref \"none\" opts out. A proposal may name an agent (agent_ref, with cwd for a project's own): it is a dispatch on what the agent runs on, unless the proposal names its own. Never use it for conversation or bookkeeping. Returns JSON.";
|
|
200
|
+
export declare const agentRouteDescription = "The runtime taskId owns one card: retries return it even with different wording or proposals. Only a genuinely separate subtask uses its own stable task_key. Plan the whole task before routing it once. At Pair/Team/Swarm, code/complex/research/review target 2/4/6 workers: pass planned_split with that many distinct titles or fewer with a reason. All four require cwd; a non-git project falls back to one worker with a reason. The card shows this split and one approval covers all workers. Follow next: agent_team plan \u2192 start for all splits. Research/review pass task_class and empty owned_paths: separate worktrees, no integration or landing; wait and synthesize. Never route individual slices. Other classes and Solo stay single. For work that requires access outside the worker sandbox, set needs_host:true. Only Here is available. The worker-only classes design, image_gen, and video_gen refuse needs_host:true with ROUTE_INVALID. Route an actionable task BEFORE starting it (you are the planner). Give task_class, a one-line summary, your honest confidence (0-1) and 1-3 proposals (direct = here on your model; dispatch = a worker provider/model). proposals.account_id accepts an account id or \"auto\" (most subscription usage left); limited pinned/default accounts fall back within the provider. The returned target.account includes usage and corrections explain the choice. The server applies the session's route mode (always ask / ask when unsure / never ask): it approves at once, or shows the user a route card and waits briefly. A planned split uses workers; on a single-task route card the user can pick here or a worker: follow the returned target.kind and next, never your proposal. Follow the returned status and next: approved+dispatch \u2192 follow next with the approved route_id; approved+direct \u2192 do it yourself (a route the user kept here is never dispatched: agent_dispatch refuses it with ROUTE_IS_DIRECT); continuation \u2192 end your turn (SynaBun continues on the chosen model); pending \u2192 end your turn, the choice arrives as a [SynaBun Mailbox] route_decided event; declined \u2192 do not start (reason no_capable_model: no model can make the image or video, or see for design; tell the user which Model routes row needs one); clarifying \u2192 end your turn, the user has not answered your agent_clarify questions yet (independent:true for a task that does not depend on them). image_gen / video_gen always route to a worker whose model generates the medium, design to a worker whose model can see. With a session budget, a provider whose share is used up cannot take the task: SynaBun first divides the unspent budget again, then moves the task to the next capable provider with money left (your next proposal, the same tier on another provider, then a free model) and says so in corrections (reason budget_share, \"budget: codex share used up -> claude-code/sonnet\"); the saved routes yield to this. When no provider can pay it declines with reason budget_exhausted and names the dry providers (dry). A host-only route on an unpriced provider declines with reason budget_unpriced (BUDGET_UNPRICED). The result carries budget: each provider's share, spent and left. Routed workers inherit the approved agent for their task class; agent_ref \"none\" opts out. A proposal may name an agent (agent_ref, with cwd for a project's own): it is a dispatch on what the agent runs on, unless the proposal names its own. Never use it for conversation or bookkeeping. Returns JSON.";
|
|
198
201
|
export declare const agentClarifyDescription = "Ask the user 1-3 targeted questions BEFORE routing a new request that is materially ambiguous: two plausible readings with different results, an unclear target (project, feature, files, audience), destructive or irreversible scope, spend, or memories that conflict with it. Not for clear requests, details a sensible default covers, anything the request, memory or the project answers, or the model (agent_route asks that). Each question gets 2-4 options (recommended first; the user can always type their own); add constraints (what the request fixes) and assumptions (what you will assume for the rest). The card waits briefly. Follow the returned status and next: answered \u2192 route, then agent_dispatch with the brief_id (SynaBun adds the user's original words, their answers, the constraints and assumptions to the worker's context); declined \u2192 proceed on your assumptions; pending \u2192 end your turn, the answers arrive as a [SynaBun Mailbox] clarify_answered event or as the user's next message, and dependent routes and dispatches wait until then. Returns JSON.";
|
|
199
202
|
export declare const agentListDescription = "List dispatched worker runs with status, state, provider/model, the agent a run runs as (agentRef, agentRevision; absent for a plain worker), title, elapsed time, work time left (workLeftMs), cost and resumes (how often a server restart cut the run off and it was resumed). Use it before dispatching more work, to recover run ids, or after a mailbox event. Filter with active_only, assistant_session_id (your own session) or workflow_id. Returns JSON.";
|
|
200
203
|
export declare const agentDispatchDescription = "Dispatch a task to a worker agent (Claude Code, Codex or OpenCode). Route it first with agent_route and pass the approved route_id (the server applies that provider/model/effort); without one, the dispatch may be held until the user picks a model (awaitingRoute:true \u2014 do not dispatch it again; if the user picks \"here\" instead, the run never starts and a route_decided mailbox event asks you to do the task yourself). A route_id the user decided to keep here is refused (ROUTE_IS_DIRECT): do that task yourself. After agent_clarify, pass its brief_id: the worker gets the user's own words and answers; while its questions are open a dependent dispatch is refused (CLARIFICATION_PENDING). The run attaches as a live automation tab in the matching sidepanel without stealing focus. Write a self-contained task that ends with a ## Result block, pass the absolute cwd and your assistant_session_id. Defaults: permission_policy \"auto\", capability \"full\", 45 minutes of work time (max_minutes, at least 20), no per-run dollar ceiling (with a budget the run draws from its provider's share; a provider whose share is used up and cannot get more is refused with BUDGET_SHARE_EXHAUSTED: route again). Use \"ask\" only for sensitive scopes (Codex cannot ask: use \"restricted\"). uses_computer:true for desktop work (one at a time, vision model). uses_browser:true with morelogin_profile (a profile id or name) opens the worker's browser tab in that MoreLogin profile for this run only, next to runs in the default or other profiles (only a profile the owner allowed agents to choose; MORELOGIN_PROFILE_NOT_ALLOWED otherwise: tell the user to switch it on in Settings). An image_gen / video_gen run makes the asset with its model's own generation tool; SynaBun collects the files into the run's result (media: path + url); with no model that generates the medium an un-routed dispatch is refused (NO_CAPABLE_MODEL), and a route_id approved for other work is refused for image_gen / video_gen / design (and the other way round: ROUTE_CLASS_MISMATCH; route the task again with its own class). A design run gets SynaBun's design rules and the project's style guide, defaults to capability \"workspace\", uses_browser true, browser, styleguide and image groups, and 60 minutes of work time (explicit values win), runs only on a model confirmed to see (MODEL_CANNOT_SEE otherwise), and its screenshots land in the result's media. The class agent applies automatically; agent_ref \"none\" opts out. An explicit agent_ref runs the worker as one of the owner's approved agents (agent_catalog agents): its definition fills what you leave out and its instructions become the worker's role, the run carries agentRef and agentRevision, and corrections list what the definition was held to. Group fan-outs with workflow_id, chain with parent_run_id, retry safely with idempotency_key. Over-limit dispatches are queued (queued:true, position). After dispatching, block with agent_wait rather than polling. Returns JSON.";
|
|
@@ -205,11 +208,11 @@ export declare const agentWaitDescription = "Blocking barrier for orchestration.
|
|
|
205
208
|
export declare const agentStopDescription = "Stop work. run_id stops one run; all:true with your assistant_session_id stops every run of this assistant session, workflow_id every run of a workflow (kill-all). Use when the user cancels, a worker misbehaves, or a time/budget rail is at risk. Returns JSON.";
|
|
206
209
|
export declare const agentFocusDescription = "Bring a run's sidepanel automation tab to the front (focus:false releases it). Use when the user asks to watch a worker; dispatches never steal focus by themselves. Returns JSON.";
|
|
207
210
|
export declare const agentUsageDescription = "Get token usage for a task, run, or entire Assistant session. Returns compact JSON. `session` is the headline the panel shows: every task of this session added up (it only grows, and survives a restart), with a per-model breakdown (models: inputTotal, outputTotal, total, costUsd, costBasis). Below it the task asked for: tokens, USD cost, fidelity, unsynced (rows not on disk yet, normally 0), and each agent's key, title, provider, model, total, sub-agents total, fidelity and state (partialReason when a count is partial; calls on the Jev judgments row). `budget` is the session budget: mode (limited / unlimited: the user chose No limit), the amount, spent and left, warned / exceeded, how the split was made (source jev | fallback, updatedAt) and each provider's share, spent and left (brain marks your own provider; leftUsd is what its workers may still spend), and dry: the providers whose share is used up. Every tokens object has the five additive classes (input = uncached input, cacheWrite, cacheRead, output = visible output, reasoning), total, inputTotal (input + cacheWrite + cacheRead: everything sent to the model) and outputTotal (output + reasoning): the same meaning for every provider, nothing counted twice. costUsd is at API list prices; costBasis says how it is known: reported (the provider reported it), estimated (tokens at list price: Codex and other plan-billed work, where it is the list-price equivalent, not a charge), free, or unpriced (no list price: tokens counted, no dollars). Counts are exact provider counts when fidelity is exact; live marks provisional counts and partial marks incomplete counts. metered:false means this server keeps no usage ledger. No routing is needed.";
|
|
208
|
-
export declare const AGENT_TEAM_ACTIONS: readonly ["plan", "start", "status", "integrate", "land", "cleanup", "discard", "list"];
|
|
211
|
+
export declare const AGENT_TEAM_ACTIONS: readonly ["plan", "start", "status", "assign", "set_test_command", "integrate", "land", "cleanup", "discard", "list"];
|
|
209
212
|
/** The most slices any Agent density allows (Swarm). */
|
|
210
213
|
export declare const AGENT_TEAM_MAX_SLICES = 6;
|
|
211
214
|
export declare const agentTeamSchema: {
|
|
212
|
-
action: z.ZodEnum<["plan", "start", "status", "integrate", "land", "cleanup", "discard", "list"]>;
|
|
215
|
+
action: z.ZodEnum<["plan", "start", "status", "assign", "set_test_command", "integrate", "land", "cleanup", "discard", "list"]>;
|
|
213
216
|
assistant_session_id: z.ZodOptional<z.ZodString>;
|
|
214
217
|
team_id: z.ZodOptional<z.ZodString>;
|
|
215
218
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -255,6 +258,7 @@ export declare const agentTeamSchema: {
|
|
|
255
258
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
256
259
|
brief_id: z.ZodOptional<z.ZodString>;
|
|
257
260
|
slice_id: z.ZodOptional<z.ZodString>;
|
|
261
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
258
262
|
target_branch: z.ZodOptional<z.ZodString>;
|
|
259
263
|
mode: z.ZodOptional<z.ZodEnum<["ff", "merge"]>>;
|
|
260
264
|
user_confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/tools/agents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAarC,eAAO,MAAM,iBAAiB,uEAAuE,CAAC;AAEtG,eAAO,MAAM,gBAAgB,gNAInB,CAAC;AAIX,eAAO,MAAM,YAAY,8IAA+I,CAAC;AAOzK,eAAO,MAAM,eAAe,yMAGlB,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/tools/agents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAarC,eAAO,MAAM,iBAAiB,uEAAuE,CAAC;AAEtG,eAAO,MAAM,gBAAgB,gNAInB,CAAC;AAIX,eAAO,MAAM,YAAY,8IAA+I,CAAC;AAOzK,eAAO,MAAM,eAAe,yMAGlB,CAAC;AAEX,wJAAwJ;AACxJ,eAAO,MAAM,eAAe,KAAK,CAAC;AAOlC,eAAO,MAAM,kBAAkB;;;CAG9B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B5B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB9B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;CAM3B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;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AE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CA2CxE;AAKD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,sEAsBnD"}
|
|
@@ -32,6 +32,8 @@ export const RUN_EVENT_KINDS = [
|
|
|
32
32
|
'run.result', 'run.needs_input', 'run.permission', 'run.failed', 'run.stalled', 'run.stopped', 'run.interrupted',
|
|
33
33
|
'run.completed', 'run.budget', 'run.notice', 'run.message', 'run.progress',
|
|
34
34
|
];
|
|
35
|
+
/** One title limit for agent_route planned_split.slices and agent_team slices[].title (= TEAM_LIMITS.title in neural-interface/lib/teams/schema.js). */
|
|
36
|
+
export const SLICE_TITLE_MAX = 80;
|
|
35
37
|
const runIdField = (purpose) => z.string().min(1).max(200).describe(purpose);
|
|
36
38
|
const optionalId = (purpose) => z.string().min(1).max(200).optional().describe(purpose);
|
|
37
39
|
// ── Schemas ──
|
|
@@ -48,9 +50,10 @@ export const agentRouteSchema = {
|
|
|
48
50
|
confidence: z.number().min(0).max(1).describe('How sure you are (0-1) that your FIRST proposal is the right model for this task. Be honest: low confidence asks the user in "ask when unsure" mode.'),
|
|
49
51
|
planned_split: z.object({
|
|
50
52
|
workers: z.number().int().min(1).max(6),
|
|
51
|
-
slices: z.array(z.string().min(1).max(
|
|
53
|
+
slices: z.array(z.string().min(1).max(SLICE_TITLE_MAX).describe(`Slice title, at most ${SLICE_TITLE_MAX} characters: agent_team start must give exactly these titles.`)).min(1).max(6),
|
|
52
54
|
reason: z.string().min(1).max(400).optional(),
|
|
53
55
|
}).optional().describe('At Pair/Team/Swarm, plan code/complex/research/review before routing. Give the target 2/4/6 workers and distinct slice titles; fewer requires a reason why it cannot sensibly split further. One approval covers the whole plan.'),
|
|
56
|
+
needs_host: z.boolean().optional().describe('Set true when this task requires host access unavailable to workers, such as writing outside the workspace. Computer use alone does not require it. The worker-only classes design, image_gen, and video_gen refuse needs_host:true.'),
|
|
54
57
|
needs_vision: z.boolean().optional().describe('true when the task needs to see images or the screen (always true for computer).'),
|
|
55
58
|
proposals: z.array(z.object({
|
|
56
59
|
kind: z.enum(['direct', 'dispatch']).describe('"direct" = do it here on your own model (or another model of your own provider); "dispatch" = hand it to a worker.'),
|
|
@@ -167,7 +170,7 @@ export const agentUsageSchema = {
|
|
|
167
170
|
};
|
|
168
171
|
// ── Descriptions (routing instructions) ──
|
|
169
172
|
export const agentCatalogDescription = 'Discover what you can route to: providers (claude-code, codex, opencode, antigravity) with models (tier, price per 1M tokens, vision, context, efforts), plus `chat` (chat-only providers such as maritaca: a side panel the user talks to, prices in BRL, never a dispatch target), accounts with subscription usage remaining (or usage unknown; API keys are n/a), registered projects (cwd candidates), SynaBun tool groups and each host\'s effect, rails/limits, active runs, and `agents`: the SynaBun agents the owner approved, which a dispatch names with agent_ref (ref, name, description, provider/model, task classes, scope global or project, revision; provider and search filter them too). Without arguments it returns a compact routing view (OpenCode sampled); pass provider and/or search to list more models. Call it when the routing sheet in your instructions lacks a model, or after a MODEL_UNKNOWN rejection. Returns JSON.';
|
|
170
|
-
export const agentRouteDescription = 'The runtime taskId owns one card: retries return it even with different wording or proposals. Only a genuinely separate subtask uses its own stable task_key. Plan the whole task before routing it once. At Pair/Team/Swarm, code/complex/research/review target 2/4/6 workers: pass planned_split with that many distinct titles or fewer with a reason. All four require cwd; a non-git project falls back to one worker with a reason. The card shows this split and one approval covers all workers. Follow next: agent_team plan → start for all splits. Research/review pass task_class and empty owned_paths: separate worktrees, no integration or landing; wait and synthesize. Never route individual slices. Other classes and Solo stay single. Route an actionable task BEFORE starting it (you are the planner). Give task_class, a one-line summary, your honest confidence (0-1) and 1-3 proposals (direct = here on your model; dispatch = a worker provider/model). proposals.account_id accepts an account id or "auto" (most subscription usage left); limited pinned/default accounts fall back within the provider. The returned target.account includes usage and corrections explain the choice. The server applies the session\'s route mode (always ask / ask when unsure / never ask): it approves at once, or shows the user a route card and waits briefly. A planned split uses workers; on a single-task route card the user can pick here or a worker: follow the returned target.kind and next, never your proposal. Follow the returned status and next: approved+dispatch → follow next with the approved route_id; approved+direct → do it yourself (a route the user kept here is never dispatched: agent_dispatch refuses it with ROUTE_IS_DIRECT); continuation → end your turn (SynaBun continues on the chosen model); pending → end your turn, the choice arrives as a [SynaBun Mailbox] route_decided event; declined → do not start (reason no_capable_model: no model can make the image or video, or see for design; tell the user which Model routes row needs one); clarifying → end your turn, the user has not answered your agent_clarify questions yet (independent:true for a task that does not depend on them). image_gen / video_gen always route to a worker whose model generates the medium, design to a worker whose model can see. With a session budget, a provider whose share is used up cannot take the task: SynaBun first divides the unspent budget again, then moves the task to the next capable provider with money left (your next proposal, the same tier on another provider, then a free model) and says so in corrections (reason budget_share, "budget: codex share used up -> claude-code/sonnet"); the saved routes yield to this. When no provider can pay it declines with reason budget_exhausted and names the dry providers (dry). The result carries budget: each provider\'s share, spent and left. Routed workers inherit the approved agent for their task class; agent_ref "none" opts out. A proposal may name an agent (agent_ref, with cwd for a project\'s own): it is a dispatch on what the agent runs on, unless the proposal names its own. Never use it for conversation or bookkeeping. Returns JSON.';
|
|
173
|
+
export const agentRouteDescription = 'The runtime taskId owns one card: retries return it even with different wording or proposals. Only a genuinely separate subtask uses its own stable task_key. Plan the whole task before routing it once. At Pair/Team/Swarm, code/complex/research/review target 2/4/6 workers: pass planned_split with that many distinct titles or fewer with a reason. All four require cwd; a non-git project falls back to one worker with a reason. The card shows this split and one approval covers all workers. Follow next: agent_team plan → start for all splits. Research/review pass task_class and empty owned_paths: separate worktrees, no integration or landing; wait and synthesize. Never route individual slices. Other classes and Solo stay single. For work that requires access outside the worker sandbox, set needs_host:true. Only Here is available. The worker-only classes design, image_gen, and video_gen refuse needs_host:true with ROUTE_INVALID. Route an actionable task BEFORE starting it (you are the planner). Give task_class, a one-line summary, your honest confidence (0-1) and 1-3 proposals (direct = here on your model; dispatch = a worker provider/model). proposals.account_id accepts an account id or "auto" (most subscription usage left); limited pinned/default accounts fall back within the provider. The returned target.account includes usage and corrections explain the choice. The server applies the session\'s route mode (always ask / ask when unsure / never ask): it approves at once, or shows the user a route card and waits briefly. A planned split uses workers; on a single-task route card the user can pick here or a worker: follow the returned target.kind and next, never your proposal. Follow the returned status and next: approved+dispatch → follow next with the approved route_id; approved+direct → do it yourself (a route the user kept here is never dispatched: agent_dispatch refuses it with ROUTE_IS_DIRECT); continuation → end your turn (SynaBun continues on the chosen model); pending → end your turn, the choice arrives as a [SynaBun Mailbox] route_decided event; declined → do not start (reason no_capable_model: no model can make the image or video, or see for design; tell the user which Model routes row needs one); clarifying → end your turn, the user has not answered your agent_clarify questions yet (independent:true for a task that does not depend on them). image_gen / video_gen always route to a worker whose model generates the medium, design to a worker whose model can see. With a session budget, a provider whose share is used up cannot take the task: SynaBun first divides the unspent budget again, then moves the task to the next capable provider with money left (your next proposal, the same tier on another provider, then a free model) and says so in corrections (reason budget_share, "budget: codex share used up -> claude-code/sonnet"); the saved routes yield to this. When no provider can pay it declines with reason budget_exhausted and names the dry providers (dry). A host-only route on an unpriced provider declines with reason budget_unpriced (BUDGET_UNPRICED). The result carries budget: each provider\'s share, spent and left. Routed workers inherit the approved agent for their task class; agent_ref "none" opts out. A proposal may name an agent (agent_ref, with cwd for a project\'s own): it is a dispatch on what the agent runs on, unless the proposal names its own. Never use it for conversation or bookkeeping. Returns JSON.';
|
|
171
174
|
export const agentClarifyDescription = 'Ask the user 1-3 targeted questions BEFORE routing a new request that is materially ambiguous: two plausible readings with different results, an unclear target (project, feature, files, audience), destructive or irreversible scope, spend, or memories that conflict with it. Not for clear requests, details a sensible default covers, anything the request, memory or the project answers, or the model (agent_route asks that). Each question gets 2-4 options (recommended first; the user can always type their own); add constraints (what the request fixes) and assumptions (what you will assume for the rest). The card waits briefly. Follow the returned status and next: answered → route, then agent_dispatch with the brief_id (SynaBun adds the user\'s original words, their answers, the constraints and assumptions to the worker\'s context); declined → proceed on your assumptions; pending → end your turn, the answers arrive as a [SynaBun Mailbox] clarify_answered event or as the user\'s next message, and dependent routes and dispatches wait until then. Returns JSON.';
|
|
172
175
|
export const agentListDescription = 'List dispatched worker runs with status, state, provider/model, the agent a run runs as (agentRef, agentRevision; absent for a plain worker), title, elapsed time, work time left (workLeftMs), cost and resumes (how often a server restart cut the run off and it was resumed). Use it before dispatching more work, to recover run ids, or after a mailbox event. Filter with active_only, assistant_session_id (your own session) or workflow_id. Returns JSON.';
|
|
173
176
|
export const agentDispatchDescription = 'Dispatch a task to a worker agent (Claude Code, Codex or OpenCode). Route it first with agent_route and pass the approved route_id (the server applies that provider/model/effort); without one, the dispatch may be held until the user picks a model (awaitingRoute:true — do not dispatch it again; if the user picks "here" instead, the run never starts and a route_decided mailbox event asks you to do the task yourself). A route_id the user decided to keep here is refused (ROUTE_IS_DIRECT): do that task yourself. After agent_clarify, pass its brief_id: the worker gets the user\'s own words and answers; while its questions are open a dependent dispatch is refused (CLARIFICATION_PENDING). The run attaches as a live automation tab in the matching sidepanel without stealing focus. Write a self-contained task that ends with a ## Result block, pass the absolute cwd and your assistant_session_id. Defaults: permission_policy "auto", capability "full", 45 minutes of work time (max_minutes, at least 20), no per-run dollar ceiling (with a budget the run draws from its provider\'s share; a provider whose share is used up and cannot get more is refused with BUDGET_SHARE_EXHAUSTED: route again). Use "ask" only for sensitive scopes (Codex cannot ask: use "restricted"). uses_computer:true for desktop work (one at a time, vision model). uses_browser:true with morelogin_profile (a profile id or name) opens the worker\'s browser tab in that MoreLogin profile for this run only, next to runs in the default or other profiles (only a profile the owner allowed agents to choose; MORELOGIN_PROFILE_NOT_ALLOWED otherwise: tell the user to switch it on in Settings). An image_gen / video_gen run makes the asset with its model\'s own generation tool; SynaBun collects the files into the run\'s result (media: path + url); with no model that generates the medium an un-routed dispatch is refused (NO_CAPABLE_MODEL), and a route_id approved for other work is refused for image_gen / video_gen / design (and the other way round: ROUTE_CLASS_MISMATCH; route the task again with its own class). A design run gets SynaBun\'s design rules and the project\'s style guide, defaults to capability "workspace", uses_browser true, browser, styleguide and image groups, and 60 minutes of work time (explicit values win), runs only on a model confirmed to see (MODEL_CANNOT_SEE otherwise), and its screenshots land in the result\'s media. The class agent applies automatically; agent_ref "none" opts out. An explicit agent_ref runs the worker as one of the owner\'s approved agents (agent_catalog agents): its definition fills what you leave out and its instructions become the worker\'s role, the run carries agentRef and agentRevision, and corrections list what the definition was held to. Group fan-outs with workflow_id, chain with parent_run_id, retry safely with idempotency_key. Over-limit dispatches are queued (queued:true, position). After dispatching, block with agent_wait rather than polling. Returns JSON.';
|
|
@@ -181,12 +184,12 @@ export const agentUsageDescription = 'Get token usage for a task, run, or entire
|
|
|
181
184
|
// ════ agents-p4 BEGIN: agent_team ════
|
|
182
185
|
// One task given to several workers (neural-interface/lib/teams/scheduler.js). The same role gate as every agent_*
|
|
183
186
|
// tool; the Neural Interface enforces the session's Agent density, the plan's rules and the landing rule.
|
|
184
|
-
export const AGENT_TEAM_ACTIONS = ['plan', 'start', 'status', 'integrate', 'land', 'cleanup', 'discard', 'list'];
|
|
187
|
+
export const AGENT_TEAM_ACTIONS = ['plan', 'start', 'status', 'assign', 'set_test_command', 'integrate', 'land', 'cleanup', 'discard', 'list'];
|
|
185
188
|
/** The most slices any Agent density allows (Swarm). */
|
|
186
189
|
export const AGENT_TEAM_MAX_SLICES = 6;
|
|
187
190
|
const teamSliceSchema = z.object({
|
|
188
191
|
id: z.string().min(1).max(40).describe('Short lower-case name of the slice, e.g. "api" ("integration" is reserved).'),
|
|
189
|
-
title: z.string().min(1).max(
|
|
192
|
+
title: z.string().min(1).max(SLICE_TITLE_MAX).describe(`What this part is, in a few words; exactly the approved route's planned_split title (an older route's longer title: its first ${SLICE_TITLE_MAX} characters).`),
|
|
190
193
|
task: z.string().min(1).max(16000).describe('Self-contained instructions for this slice\'s worker: goal, constraints, acceptance. It sees only its own slice, plus which files the other slices own.'),
|
|
191
194
|
owned_paths: z.array(z.string().min(1).max(300)).max(64).optional().describe('The files this slice may write, as patterns relative to the project ("src/api/**", "docs/guide.md"). No file may be owned by two slices. Research/review omit this or pass [] (read-only).'),
|
|
192
195
|
depends_on: z.array(z.string().min(1).max(40)).max(5).optional().describe('Slices that must be joined before this one starts (it then starts from their finished work).'),
|
|
@@ -194,15 +197,15 @@ const teamSliceSchema = z.object({
|
|
|
194
197
|
agent_ref: z.string().min(1).max(140).optional().describe('Run this slice\'s worker as one of the owner\'s agents (an id from agent_catalog agents).'),
|
|
195
198
|
});
|
|
196
199
|
export const agentTeamSchema = {
|
|
197
|
-
action: z.enum(AGENT_TEAM_ACTIONS).describe('plan: check a plan (density, overlapping files, dependency cycles) and return it normalized; creates nothing. start: create the worktrees and dispatch the workers. status: slices, runs, claims, the integration branch, the last events. integrate: try again after a needs_attention. land: the integration branch into the user\'s branch. cleanup: after successful land and the user\'s yes, delete finished team worktrees/branches. discard: give the team up. list: this session\'s teams.'),
|
|
200
|
+
action: z.enum(AGENT_TEAM_ACTIONS).describe('plan: check a plan (density, overlapping files, dependency cycles) and return it normalized; creates nothing. start: create the worktrees and dispatch the workers. status: slices, runs, claims, the integration branch, the last events. assign: give unowned paths to a slice. set_test_command: correct the test command before the first join attempt. integrate: try again after a needs_attention. land: the integration branch into the user\'s branch. cleanup: after successful land and the user\'s yes, delete finished team worktrees/branches. discard: give the team up. list: this session\'s teams.'),
|
|
198
201
|
assistant_session_id: optionalId('Your ASSISTANT_SESSION_ID (plan, start, list).'),
|
|
199
|
-
team_id: z.string().min(1).max(40).optional().describe('status
|
|
202
|
+
team_id: z.string().min(1).max(40).optional().describe('Required for status, assign, set_test_command, integrate, land, cleanup and discard. For start, use the team_id from plan or let the server generate one.'),
|
|
200
203
|
title: z.string().min(1).max(80).optional().describe('plan / start: the team\'s task in a few words.'),
|
|
201
204
|
project_path: z.string().min(1).max(1024).optional().describe('plan / start: absolute path of the project (a git repository with at least one commit; pick from agent_catalog projects).'),
|
|
202
205
|
base_commit: z.string().min(40).max(64).optional().describe('start: the full commit id the plan action pinned (omitted: the project\'s current commit).'),
|
|
203
206
|
fewer_reason: z.string().min(1).max(400).optional().describe('Required when slices are fewer than density. Must match planned_split.reason on the approved route.'),
|
|
204
207
|
slices: z.array(teamSliceSchema).min(1).max(AGENT_TEAM_MAX_SLICES).optional().describe('plan / start: the parts of the task, one worker each. At most what the session\'s Agent density allows (Pair 2, Team 4, Swarm 6; Solo: no team).'),
|
|
205
|
-
test_command: z.string().min(1).max(600).optional().describe('start: what proves the joined work, run on the integration branch after every join (e.g. "npm test"). Without one nothing is tested and you cannot land.'),
|
|
208
|
+
test_command: z.string().min(1).max(600).optional().describe('start / set_test_command: what proves the joined work, run on the integration branch after every join (e.g. "npm test"). The first join attempt locks this command. Without one nothing is tested and you cannot land.'),
|
|
206
209
|
route_id: optionalId('start: the route_id agent_route returned with status "approved" for this task. One route covers every slice.'),
|
|
207
210
|
task_class: z.enum(TASK_CLASSES).optional().describe('plan/start: code (default), complex, research or review. Research/review have read-only worktrees, no integration branch, tests or landing; the approved route must match.'),
|
|
208
211
|
provider: z.enum(PROVIDERS).optional().describe('start: the worker runtime, when there is no route_id and a slice names no agent_ref.'),
|
|
@@ -215,7 +218,8 @@ export const agentTeamSchema = {
|
|
|
215
218
|
context: z.string().max(8000).optional().describe('start: background every worker of the team gets (decisions already taken, conventions).'),
|
|
216
219
|
tags: z.array(z.string().min(1).max(40)).max(6).optional().describe('start: tags for the runs.'),
|
|
217
220
|
brief_id: optionalId('start: the brief_id of a clarification, so every worker gets the user\'s own words and answers.'),
|
|
218
|
-
slice_id: z.string().min(1).max(40).optional().describe('integrate: only this slice (omitted: every slice that is not joined).'),
|
|
221
|
+
slice_id: z.string().min(1).max(40).optional().describe('assign: the slice receiving the paths. integrate: retry only this slice (omitted: every slice that is not joined).'),
|
|
222
|
+
paths: z.array(z.string().min(1).max(300)).min(1).max(64).optional().describe('assign: unowned project-relative paths or patterns to add to this slice, using the plan’s ownership rules.'),
|
|
219
223
|
target_branch: z.string().min(1).max(200).optional().describe('land: the branch that receives the work (default: the branch checked out in the project).'),
|
|
220
224
|
mode: z.enum(['ff', 'merge']).optional().describe('land: "ff" (default) moves the branch forward to the integration branch; "merge" makes a merge commit.'),
|
|
221
225
|
user_confirmed: z.boolean().optional().describe('cleanup: true only after the user says yes to deleting the landed team worktrees and branches; otherwise refused locally.'),
|
|
@@ -223,6 +227,7 @@ export const agentTeamSchema = {
|
|
|
223
227
|
};
|
|
224
228
|
export const agentTeamDescription = 'Code/complex/research/review: plan the task first, then target the session density (Pair 2, Team 4, Swarm 6). Fewer slices require fewer_reason matching the approved route. agent_route planned_split must match the project, count and titles. One approved route covers all slices, including replacements; never route a slice. Research/review use task_class and empty owned_paths: every worker gets its own worktree from one pinned commit, removed when it ends. Changes or commits are kept and reported. No integration branch, test_command or landing; wait and synthesize their results. Give ONE task to several workers at once, each in its own git worktree and branch (never the user\'s checkout or branch). Code/complex tasks need file-disjoint parts; research/review need distinct read-only scopes, within the user\'s Agent density (Solo 1: no team; Pair 2; Team 4; Swarm 6): SynaBun refuses a team at Solo (TEAM_DENSITY_SOLO) and a plan with more slices than the level allows (TEAM_TOO_MANY_SLICES), with overlapping files or a dependency cycle. ' +
|
|
225
229
|
'Flow: agent_route the task once → action "plan" (returns the normalized plan with its team_id and base_commit, the density check and any errors; creates nothing) → action "start" with that plan and the approved route_id (returns workflow_id) → agent_wait on the workflow_id → a team_ready mailbox event → action "status" → action "land", or ask the user. ' +
|
|
230
|
+
'For a request_change on an unowned path, use "assign" with team_id, slice_id and paths. The worker receives the new scope. Use "set_test_command" to correct the verification command before the first join attempt. ' +
|
|
226
231
|
'SynaBun commits each finished slice\'s own files, joins them on synabun/<team>/integration in dependency order and runs test_command on that exact commit; a conflict or failed tests go back to the slice\'s worker with the report (twice), then a needs_attention event reaches you: read "status", help with agent_send, then "integrate", or "discard". ' +
|
|
227
232
|
'Landing rule: land yourself only when you judge the work ready, the integration tests passed, the user\'s branch has not moved and no file with local changes is touched; land returns SynaBun\'s refusal report unchanged (TESTS_NOT_PASSED, NOT_FAST_FORWARD, OWNER_BRANCH_MOVED, DIRTY_FILES_AFFECTED, TEAM_NOT_READY…). On a refusal do not retry or work around it: ask the user. ' +
|
|
228
233
|
'Cleanup: successful land returns cleanup (worktrees, branches). When the task is fully finished, suggest deleting them with a synabun-followups confirm card. Only after the user says yes call cleanup with team_id and user_confirmed:true. The server requires a landed team, every run ended done, every branch merged into the target and every worktree clean. Refusals CLEANUP_NOT_CONFIRMED, TEAM_NOT_LANDED, TEAM_RUNS_ACTIVE, BRANCH_NOT_MERGED, BRANCH_MOVED (a branch moved after the check), WORKTREE_DIRTY remove nothing: keep them and tell the user which check failed. Never delete team worktrees or branches with git directly. Returns JSON.';
|
|
@@ -254,6 +259,7 @@ export function handleAgentRoute(args) {
|
|
|
254
259
|
task_key: args.task_key,
|
|
255
260
|
summary: args.summary,
|
|
256
261
|
confidence: args.confidence,
|
|
262
|
+
needs_host: args.needs_host,
|
|
257
263
|
needs_vision: args.needs_vision,
|
|
258
264
|
planned_split: args.planned_split,
|
|
259
265
|
proposals: args.proposals,
|
|
@@ -540,6 +546,14 @@ export function handleAgentTeam(args) {
|
|
|
540
546
|
}
|
|
541
547
|
case 'status':
|
|
542
548
|
return needTeam() ?? json(await ni.assistantTeamStatus(args.team_id));
|
|
549
|
+
case 'assign':
|
|
550
|
+
if (!args.team_id || !args.slice_id || !args.paths?.length)
|
|
551
|
+
return invalid('assign needs team_id, slice_id and paths.');
|
|
552
|
+
return json(await ni.assistantTeamAssign(args.team_id, args.slice_id, args.paths));
|
|
553
|
+
case 'set_test_command':
|
|
554
|
+
if (!args.team_id || !args.test_command?.trim())
|
|
555
|
+
return invalid('set_test_command needs team_id and test_command.');
|
|
556
|
+
return json(await ni.assistantTeamSetTestCommand(args.team_id, args.test_command));
|
|
543
557
|
case 'integrate':
|
|
544
558
|
return needTeam() ?? json(await ni.assistantTeamIntegrate(args.team_id, { sliceId: args.slice_id }));
|
|
545
559
|
case 'land':
|
|
@@ -565,7 +579,11 @@ export function registerAgentTools(server) {
|
|
|
565
579
|
return [
|
|
566
580
|
server.tool('agent_catalog', agentCatalogDescription, agentCatalogSchema, (args) => handleAgentCatalog(args)),
|
|
567
581
|
server.tool('agent_list', agentListDescription, agentListSchema, (args) => handleAgentList(args)),
|
|
568
|
-
|
|
582
|
+
// Claude resumes conversations with their deferred tools. Keep this first-step tool in the
|
|
583
|
+
// current prompt so routing uses the schema advertised by the live MCP connection.
|
|
584
|
+
server.registerTool('agent_route', {
|
|
585
|
+
description: agentRouteDescription, inputSchema: agentRouteSchema, _meta: { 'anthropic/alwaysLoad': true },
|
|
586
|
+
}, (args) => handleAgentRoute(args)),
|
|
569
587
|
server.tool('agent_clarify', agentClarifyDescription, agentClarifySchema, (args) => handleAgentClarify(args)),
|
|
570
588
|
// Preserve unknown input until the handler can reject retired fields from cached client schemas.
|
|
571
589
|
// Neither retired spelling is advertised or accepted as a working dispatch field.
|