@desplega.ai/agent-swarm 1.145.0 → 1.147.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/{acp-adapter-580t41c0.js → acp-adapter-9n319wqc.js} +61 -6
- package/dist/{actions-m662tjng.js → actions-2vxqvpr9.js} +9 -8
- package/dist/{app-zb3rndm8.js → app-w066xfy0.js} +6 -5
- package/dist/assistant-kt31dj2h.js +236 -0
- package/dist/{boot-reembed-072x00vn.js → boot-reembed-az5rassp.js} +7 -6
- package/dist/{boot-reembed-65zz2smt.js → boot-reembed-j3mm3rfz.js} +8 -7
- package/dist/{boot-scrub-logs-yz0ams04.js → boot-scrub-logs-b6h54817.js} +4 -4
- package/dist/{claude-adapter-paj270y2.js → claude-adapter-w1z04ann.js} +8 -6
- package/dist/{claude-managed-setup-w619jncn.js → claude-managed-setup-f5pmsyrp.js} +24 -3
- package/dist/{claude-sdk-session-swt80j9z.js → claude-sdk-session-f0cc1kec.js} +8 -6
- package/dist/{cli-dt553ktb.js → cli-0b6y7kxm.js} +1 -1
- package/dist/{cli-bxdhw615.js → cli-12fz972k.js} +4 -4
- package/dist/{cli-s2f20r5w.js → cli-1th1728g.js} +2 -2
- package/dist/{cli-rs6ec3b9.js → cli-3tgwnf43.js} +3 -3
- package/dist/{cli-gxnzc6wh.js → cli-4nr988h6.js} +1 -1
- package/dist/{cli-axs8e6d4.js → cli-53s590z8.js} +1 -1
- package/dist/{cli-ygbjp3z8.js → cli-54wwve05.js} +5 -4
- package/dist/{cli-v0asr5yv.js → cli-719k9j2c.js} +2 -2
- package/dist/{cli-anktweqr.js → cli-89xfd7f9.js} +21 -47
- package/dist/{cli-q34a0e10.js → cli-8v0g1yc8.js} +1 -1
- package/dist/cli-9d8ntetj.js +42 -0
- package/dist/{cli-z9fprcrf.js → cli-atcve9y8.js} +881 -738
- package/dist/{cli-jmb7g47h.js → cli-b5bq9crk.js} +14 -31
- package/dist/cli-d8brzxjb.js +190 -0
- package/dist/{cli-gzky0gkr.js → cli-de14znh8.js} +2 -2
- package/dist/{cli-xytwff7f.js → cli-dttph1bw.js} +2 -2
- package/dist/cli-ep19k3mb.js +19 -0
- package/dist/{cli-m1xa8be7.js → cli-f146mn5s.js} +7 -50
- package/dist/{cli-1fj0chdk.js → cli-f7dsy61y.js} +5 -3
- package/dist/{cli-f567d5c1.js → cli-ftht3zzj.js} +2782 -2589
- package/dist/{cli-a0g1gbt5.js → cli-hbv0kq6w.js} +2 -2
- package/dist/{cli-fhsz3twr.js → cli-jsp14b6c.js} +171 -1
- package/dist/{cli-7fnkj1hj.js → cli-kpv03zhj.js} +21 -17
- package/dist/{cli-m4j6trn4.js → cli-m8yrsg97.js} +2 -2
- package/dist/cli-m9sxbkhm.js +779 -0
- package/dist/cli-mmemxxdc.js +823 -0
- package/dist/{cli-tqtvj5pt.js → cli-n8508nre.js} +1 -1
- package/dist/{cli-z96t0thj.js → cli-p1d5b073.js} +37 -2
- package/dist/{cli-gh8y8f36.js → cli-rw51bq3j.js} +13 -10
- package/dist/{cli-59ej1c07.js → cli-smby5m17.js} +7 -6
- package/dist/{cli-65vqzz3v.js → cli-tzvk9haz.js} +94 -372
- package/dist/{cli-dc9k2ba9.js → cli-w9kb3bk1.js} +1 -1
- package/dist/{cli-kpev657q.js → cli-y6b6fb76.js} +25 -3
- package/dist/{cli-123q2get.js → cli-yz3djrm0.js} +9 -9
- package/dist/{cli-wvp6bvy4.js → cli-zhjmqxzh.js} +1 -1
- package/dist/cli.js +13 -13
- package/dist/{codex-adapter-k98vaw2r.js → codex-adapter-zw4dwsx7.js} +2 -2
- package/dist/{codex-hook-9pf19cks.js → codex-hook-bw8p5nh4.js} +2 -2
- package/dist/{codex-session-runner-tngtphx7.js → codex-session-runner-k981s65v.js} +2 -2
- package/dist/{commands-y8nbr3fv.js → commands-sykrxx7e.js} +4 -4
- package/dist/{db-30p4h2t1.js → db-sfbsc8wt.js} +6 -4
- package/dist/handlers-0aspcejm.js +603 -0
- package/dist/{hook-dcw4jfbj.js → hook-4nvqj2sb.js} +7 -5
- package/dist/{hook-21jexvfx.js → hook-hxccs7m5.js} +24 -49
- package/dist/{http-r4kq5g8d.js → http-y06z517d.js} +230 -94
- package/dist/{index-q3qja6ta.js → index-hssww7kj.js} +15 -14
- package/dist/{index-gay66b9w.js → index-k8znfx0z.js} +13 -12
- package/dist/{index-53zyht4z.js → index-tce1rss4.js} +371 -110
- package/dist/{index-nqvf26za.js → index-x5j894zf.js} +14 -13
- package/dist/{keepalive-xs8fa55y.js → keepalive-w733ax66.js} +6 -6
- package/dist/{lead-d9m2t4s0.js → lead-75bjqa9d.js} +29 -27
- package/dist/{maintenance-3zh82g6z.js → maintenance-w4f1zjck.js} +8 -7
- package/dist/{oauth-refresh-sweep-03snsye5.js → oauth-refresh-sweep-wdetky26.js} +5 -5
- package/dist/{onboard-0cg1925x.js → onboard-bb5net8s.js} +2 -2
- package/dist/{otel-impl-0ab95z27.js → otel-impl-0w7c14ap.js} +1 -1
- package/dist/{pi-mono-adapter-dtkz4e7j.js → pi-mono-adapter-2has4gnp.js} +12 -2
- package/dist/{pricing-refresh-e5jhzz4j.js → pricing-refresh-9nzsrgcq.js} +6 -6
- package/dist/{rbac-roles-p1mf40z3.js → rbac-roles-r3hqjp09.js} +5 -5
- package/dist/{rbac-roles-2w3cmrkc.js → rbac-roles-z1jrffbt.js} +4 -4
- package/dist/{registry-9kdck5ye.js → registry-v5wytg0s.js} +1 -2
- package/dist/{render-v2-xhawry3k.js → render-v2-vbr89fnb.js} +6 -5
- package/dist/{seed-pricing-t223sw91.js → seed-pricing-g62hy1pk.js} +7 -5
- package/dist/{setup-zcs0rce7.js → setup-gnfqnptp.js} +2 -2
- package/dist/{worker-qnp2ka62.js → worker-kznxp4qm.js} +29 -27
- package/openapi.json +263 -12
- package/package.json +1 -1
- package/plugin/commands/start-worker.md +4 -9
- package/plugin/pi-skills/start-worker/SKILL.md +4 -9
- package/src/be/db/agents.ts +556 -0
- package/src/be/db/context-versions.ts +117 -0
- package/src/be/db/runtime.ts +406 -0
- package/src/be/db/tasks/read.ts +1167 -0
- package/src/be/db/tasks/write.ts +953 -0
- package/src/be/db.ts +584 -3429
- package/src/be/migrations/147_scheduled_tasks_parent_task.sql +7 -0
- package/src/be/migrations/148_pages_svg.sql +123 -0
- package/src/be/migrations/149_session_tokens.sql +24 -0
- package/src/be/scripts/typecheck.ts +1 -0
- package/src/be/seed-pricing.ts +13 -8
- package/src/be/seed-scripts/catalog/ops-catalog-audit.inline.ts +1 -1
- package/src/be/seed-scripts/catalog/ops-catalog-audit.ts +1 -1
- package/src/be/seed-scripts/catalog/star-history-refresh.ts +101 -0
- package/src/be/seed-scripts/catalog/star-history-renderer.ts +119 -0
- package/src/be/seed-scripts/index.ts +17 -0
- package/src/be/seed-skills/index.ts +14 -0
- package/src/be/swarm-config-guard.ts +5 -2
- package/src/be/task-attachment-store.ts +70 -0
- package/src/be/users.ts +77 -0
- package/src/commands/attachments-section.ts +37 -0
- package/src/commands/claude-managed-setup.ts +45 -3
- package/src/commands/claude-md-session.ts +408 -0
- package/src/commands/context-preamble.ts +15 -3
- package/src/commands/profile-sync.ts +205 -5
- package/src/commands/provider-credentials.ts +60 -27
- package/src/commands/runner.ts +63 -58
- package/src/commands/templates.ts +25 -2
- package/src/hooks/hook.ts +26 -67
- package/src/http/agents.ts +40 -1
- package/src/http/auth.ts +13 -1
- package/src/http/fs.ts +21 -51
- package/src/http/index.ts +2 -0
- package/src/http/mcp.ts +32 -0
- package/src/http/pages-public.ts +20 -4
- package/src/http/pages.ts +11 -3
- package/src/http/poll.ts +4 -0
- package/src/http/repos.ts +3 -3
- package/src/http/sessions.ts +82 -0
- package/src/http/tasks.ts +10 -2
- package/src/http/utils.ts +79 -1
- package/src/prompts/session-templates.ts +12 -8
- package/src/providers/acp-adapter.ts +62 -8
- package/src/providers/pi-mono-adapter.ts +23 -6
- package/src/providers/pricing-sources.md +11 -0
- package/src/scheduler/scheduler.test.ts +49 -2
- package/src/scheduler/scheduler.ts +4 -0
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/types/stdlib.d.ts +8 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +8 -0
- package/src/server.ts +2 -0
- package/src/slack/assistant.ts +87 -46
- package/src/slack/handlers.test.ts +1 -3
- package/src/slack/handlers.ts +102 -87
- package/src/slack/inbound-files.ts +466 -0
- package/src/slack/templates.ts +14 -0
- package/src/tasks/task-terminal-effects.ts +158 -0
- package/src/tests/acp-adapter.test.ts +369 -117
- package/src/tests/budget-claim-gate.test.ts +1 -0
- package/src/tests/build-pi-skills.test.ts +5 -7
- package/src/tests/claude-managed-setup.test.ts +52 -4
- package/src/tests/claude-md-session.test.ts +603 -0
- package/src/tests/codex-skill-resolver.test.ts +19 -0
- package/src/tests/context-versioning.test.ts +107 -0
- package/src/tests/cors-allowlist.test.ts +309 -0
- package/src/tests/credential-check.test.ts +157 -14
- package/src/tests/db-agents.test.ts +91 -0
- package/src/tests/db-context-versions.test.ts +37 -0
- package/src/tests/db-extraction-contract.test.ts +45 -0
- package/src/tests/db-runtime.test.ts +70 -0
- package/src/tests/db-task-read-contract.test.ts +624 -0
- package/src/tests/db-task-write-contract.test.ts +653 -0
- package/src/tests/db-tasks-read.test.ts +183 -0
- package/src/tests/db-tasks-write.test.ts +230 -0
- package/src/tests/defer-task.test.ts +389 -0
- package/src/tests/docs-index-footprint.test.js +2 -2
- package/src/tests/e2e-visuals-stage.test.ts +151 -0
- package/src/tests/file-lock.test.ts +144 -0
- package/src/tests/fixtures/file-lock-holder.ts +13 -0
- package/src/tests/fixtures/hold-file-lock.ts +25 -0
- package/src/tests/heartbeat-expiry.test.ts +188 -0
- package/src/tests/http-api-integration.test.ts +78 -1
- package/src/tests/pages-public-html.test.ts +43 -0
- package/src/tests/pages-svg-migration.test.ts +42 -0
- package/src/tests/preload.ts +4 -1
- package/src/tests/profile-sync-warning.test.ts +16 -0
- package/src/tests/profile-sync.test.ts +126 -0
- package/src/tests/prompt-template-session.test.ts +20 -4
- package/src/tests/provider-registration.test.ts +93 -0
- package/src/tests/rbac-e2e-helpers.test.ts +53 -0
- package/src/tests/rbac-e2e-helpers.ts +19 -2
- package/src/tests/reload-config.test.ts +26 -0
- package/src/tests/routing-affinity-inventory.test.ts +1 -1
- package/src/tests/runner-attachments-section.test.ts +22 -2
- package/src/tests/runner-context-preamble.test.ts +30 -0
- package/src/tests/runner-deployment-resume.test.ts +107 -0
- package/src/tests/runner-repo-autostash.test.ts +12 -0
- package/src/tests/script-connections.test.ts +4 -0
- package/src/tests/seed-scripts.test.ts +2 -2
- package/src/tests/session-tokens.test.ts +279 -0
- package/src/tests/slack-file-tools-attachments.test.ts +408 -0
- package/src/tests/slack-inbound-files.test.ts +847 -0
- package/src/tests/star-history-refresh.test.ts +102 -0
- package/src/tests/swarm-config-reserved-keys.test.ts +21 -0
- package/src/tests/swarm-repos.test.ts +20 -0
- package/src/tests/tool-annotations.test.ts +4 -3
- package/src/tests/ui-logs-parser.test.ts +176 -0
- package/src/tools/create-page.ts +4 -2
- package/src/tools/defer-task.ts +239 -0
- package/src/tools/repos/update-repo.ts +2 -2
- package/src/tools/schedules/create-schedule.ts +1 -0
- package/src/tools/schedules/list-schedules.ts +1 -0
- package/src/tools/schedules/patch-schedule.ts +1 -0
- package/src/tools/schedules/update-schedule.ts +1 -0
- package/src/tools/slack-download-file.ts +60 -29
- package/src/tools/slack-read.ts +73 -32
- package/src/tools/store-progress.ts +16 -146
- package/src/tools/tool-config.ts +1 -0
- package/src/tools/utils.ts +21 -0
- package/src/types.ts +37 -4
- package/src/utils/acp-session-token.ts +56 -0
- package/src/utils/file-lock.ts +111 -0
- package/src/utils/heartbeat-expiry.ts +78 -0
- package/src/utils/request-auth-context.ts +2 -0
- package/src/utils/task-attachment-links.ts +22 -0
- package/templates/skills/code-quality/content.md +8 -5
- package/templates/skills/download-task-attachment/content.md +2 -1
- package/{plugin/pi-skills → templates/skills}/review-offered-task/SKILL.md +5 -5
- package/templates/skills/review-offered-task/config.json +14 -0
- package/{plugin/commands/review-offered-task.md → templates/skills/review-offered-task/content.md} +3 -8
- package/templates/skills/scheduling/content.md +4 -0
- package/templates/skills/slack-interaction/content.md +2 -2
- package/templates/skills/work-on-task/SKILL.md +16 -0
- package/templates/skills/work-on-task/config.json +14 -0
- package/templates/skills/work-on-task/content.md +11 -0
- package/dist/assistant-0qt42nzg.js +0 -212
- package/dist/cli-fs1kkqgr.js +0 -317
- package/dist/cli-jnf5zghe.js +0 -269
- package/dist/cli-n1q8q14d.js +0 -177
- package/dist/handlers-yfp1qn81.js +0 -592
- package/plugin/commands/work-on-task.md +0 -39
- package/plugin/pi-skills/work-on-task/SKILL.md +0 -39
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getEmbeddingProvider,
|
|
5
5
|
init_embedding,
|
|
6
6
|
serializeEmbedding
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-1th1728g.js";
|
|
8
8
|
import {
|
|
9
9
|
getDbClient,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-ftht3zzj.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|
|
@@ -310,4 +310,174 @@ function stripTrailingSlash(value) {
|
|
|
310
310
|
return value.replace(/\/+$/, "");
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
|
|
313
|
+
// src/fs/local-fs-provider.ts
|
|
314
|
+
import { mkdir, readdir, rm, stat } from "node:fs/promises";
|
|
315
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
316
|
+
var DEFAULT_ROOT_DIR = "./data/fs";
|
|
317
|
+
|
|
318
|
+
class LocalFsProvider {
|
|
319
|
+
id = "local-fs";
|
|
320
|
+
capabilities = {
|
|
321
|
+
signedUrl: { supported: false }
|
|
322
|
+
};
|
|
323
|
+
rootDir;
|
|
324
|
+
constructor(options = {}) {
|
|
325
|
+
this.rootDir = options.rootDir ?? process.env.AGENT_FS_LOCAL_DIR ?? DEFAULT_ROOT_DIR;
|
|
326
|
+
}
|
|
327
|
+
async upload(scope, body, options = {}) {
|
|
328
|
+
const target = this.localPath(scope);
|
|
329
|
+
await mkdir(dirname(target), { recursive: true });
|
|
330
|
+
if (options.ifNoneMatch === "*" && await this.exists(scope)) {
|
|
331
|
+
throw new FilesError("Conflict", "File already exists");
|
|
332
|
+
}
|
|
333
|
+
await Bun.write(target, await new Response(body).arrayBuffer());
|
|
334
|
+
if (options.contentType) {
|
|
335
|
+
await Bun.write(this.metaPath(target), JSON.stringify({ contentType: options.contentType }));
|
|
336
|
+
}
|
|
337
|
+
return this.head(scope);
|
|
338
|
+
}
|
|
339
|
+
async download(scope) {
|
|
340
|
+
const target = this.localPath(scope);
|
|
341
|
+
if (!await this.exists(scope)) {
|
|
342
|
+
throw new FilesError("NotFound", "File not found");
|
|
343
|
+
}
|
|
344
|
+
return new Response(Bun.file(target));
|
|
345
|
+
}
|
|
346
|
+
async head(scope) {
|
|
347
|
+
const target = this.localPath(scope);
|
|
348
|
+
try {
|
|
349
|
+
const info = await stat(target);
|
|
350
|
+
const storedContentType = await this.readStoredContentType(target);
|
|
351
|
+
return {
|
|
352
|
+
providerId: this.id,
|
|
353
|
+
key: providerPath(scope),
|
|
354
|
+
taskId: scope.taskId,
|
|
355
|
+
name: scope.name,
|
|
356
|
+
contentType: storedContentType ?? Bun.file(target).type ?? undefined,
|
|
357
|
+
sizeBytes: info.size,
|
|
358
|
+
updatedAt: info.mtime.toISOString()
|
|
359
|
+
};
|
|
360
|
+
} catch (error) {
|
|
361
|
+
if (error.code === "ENOENT") {
|
|
362
|
+
throw new FilesError("NotFound", "File not found", { cause: error });
|
|
363
|
+
}
|
|
364
|
+
throw new FilesError("Provider", "Unable to read file metadata", { cause: error });
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
async exists(scope) {
|
|
368
|
+
try {
|
|
369
|
+
await stat(this.localPath(scope));
|
|
370
|
+
return true;
|
|
371
|
+
} catch (error) {
|
|
372
|
+
if (error.code === "ENOENT") {
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
throw new FilesError("Provider", "Unable to check file existence", { cause: error });
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
async delete(scope) {
|
|
379
|
+
const target = this.localPath(scope);
|
|
380
|
+
await rm(target, { force: true });
|
|
381
|
+
await rm(this.metaPath(target), { force: true });
|
|
382
|
+
}
|
|
383
|
+
async copy(source, destination) {
|
|
384
|
+
const sourceHead = await this.head(source);
|
|
385
|
+
const response = await this.download(source);
|
|
386
|
+
await this.upload(destination, await response.arrayBuffer(), {
|
|
387
|
+
contentType: sourceHead.contentType
|
|
388
|
+
});
|
|
389
|
+
return this.head(destination);
|
|
390
|
+
}
|
|
391
|
+
async move(source, destination) {
|
|
392
|
+
const copied = await this.copy(source, destination);
|
|
393
|
+
await this.delete(source);
|
|
394
|
+
return copied;
|
|
395
|
+
}
|
|
396
|
+
async list(options) {
|
|
397
|
+
const taskRoot = join(this.rootDir, "tasks", encodeURIComponent(options.taskId));
|
|
398
|
+
const files = [];
|
|
399
|
+
await this.walk(taskRoot, async (path) => {
|
|
400
|
+
const rel = relative(taskRoot, path).split(sep).join("/");
|
|
401
|
+
const name = decodePath(rel);
|
|
402
|
+
if (options.prefix && !name.startsWith(options.prefix)) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
files.push(await this.head({ taskId: options.taskId, name }));
|
|
406
|
+
});
|
|
407
|
+
return typeof options.limit === "number" ? files.slice(0, options.limit) : files;
|
|
408
|
+
}
|
|
409
|
+
async* listAll(options) {
|
|
410
|
+
for (const item of await this.list(options)) {
|
|
411
|
+
yield item;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
async url(scope) {
|
|
415
|
+
return `/api/fs/tasks/${encodeURIComponent(scope.taskId)}/files/${encodeURIComponent(scope.name)}/raw`;
|
|
416
|
+
}
|
|
417
|
+
async signedUploadUrl() {
|
|
418
|
+
throw new FilesError("ReadOnly", "local-fs does not support signed upload URLs");
|
|
419
|
+
}
|
|
420
|
+
localPath(scope) {
|
|
421
|
+
return join(this.rootDir, providerPath(scope));
|
|
422
|
+
}
|
|
423
|
+
metaPath(target) {
|
|
424
|
+
return `${target}.meta.json`;
|
|
425
|
+
}
|
|
426
|
+
async readStoredContentType(target) {
|
|
427
|
+
try {
|
|
428
|
+
const metaFile = Bun.file(this.metaPath(target));
|
|
429
|
+
if (!await metaFile.exists()) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
const meta = await metaFile.json();
|
|
433
|
+
return typeof meta?.contentType === "string" ? meta.contentType : undefined;
|
|
434
|
+
} catch {
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
async walk(dir, visit) {
|
|
439
|
+
let entries;
|
|
440
|
+
try {
|
|
441
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
442
|
+
} catch (error) {
|
|
443
|
+
if (error.code === "ENOENT") {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
throw new FilesError("Provider", "Unable to list files", { cause: error });
|
|
447
|
+
}
|
|
448
|
+
for (const entry of entries) {
|
|
449
|
+
const path = join(dir, entry.name);
|
|
450
|
+
if (entry.isDirectory()) {
|
|
451
|
+
await this.walk(path, visit);
|
|
452
|
+
} else if (entry.isFile() && !entry.name.endsWith(".meta.json")) {
|
|
453
|
+
await visit(path);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function decodePath(path) {
|
|
459
|
+
return path.split("/").map((part) => decodeURIComponent(part)).join("/");
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// src/fs/registry.ts
|
|
463
|
+
var memoizedProvider = null;
|
|
464
|
+
function getFileStorageProvider() {
|
|
465
|
+
if (!memoizedProvider) {
|
|
466
|
+
memoizedProvider = selectProvider();
|
|
467
|
+
}
|
|
468
|
+
return memoizedProvider;
|
|
469
|
+
}
|
|
470
|
+
function selectProvider() {
|
|
471
|
+
if (process.env.AGENT_FS_API_URL && (process.env.API_AGENT_FS_API_KEY || process.env.AGENT_FS_API_KEY)) {
|
|
472
|
+
return new AgentFsProvider;
|
|
473
|
+
}
|
|
474
|
+
return new LocalFsProvider;
|
|
475
|
+
}
|
|
476
|
+
function resetFileStorageProvider() {
|
|
477
|
+
memoizedProvider = null;
|
|
478
|
+
}
|
|
479
|
+
function resetFileStorageProviderForTests() {
|
|
480
|
+
resetFileStorageProvider();
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export { FilesError, providerPath, normalizeFilesError, AgentFsProvider, getFileStorageProvider, selectProvider, resetFileStorageProvider, resetFileStorageProviderForTests };
|
|
@@ -6,6 +6,14 @@ import {
|
|
|
6
6
|
__esm
|
|
7
7
|
} from "./cli-bc05qbss.js";
|
|
8
8
|
|
|
9
|
+
// src/utils/steering-enabled.ts
|
|
10
|
+
function isSteeringEnabled(env = process.env) {
|
|
11
|
+
return parseEnvFlag(env.STEERING_ENABLED, false);
|
|
12
|
+
}
|
|
13
|
+
var init_steering_enabled = __esm(() => {
|
|
14
|
+
init_env_flag();
|
|
15
|
+
});
|
|
16
|
+
|
|
9
17
|
// src/utils/template.ts
|
|
10
18
|
function findInterpolationTokens(template) {
|
|
11
19
|
return Array.from(template.matchAll(INTERPOLATION_TOKEN_RE), (match) => match[1].trim());
|
|
@@ -223,14 +231,6 @@ var init_resolver = __esm(() => {
|
|
|
223
231
|
TEMPLATE_REF_REGEX = /\{\{@template\[([^\]]+)\]\}\}/g;
|
|
224
232
|
});
|
|
225
233
|
|
|
226
|
-
// src/utils/steering-enabled.ts
|
|
227
|
-
function isSteeringEnabled(env = process.env) {
|
|
228
|
-
return parseEnvFlag(env.STEERING_ENABLED, false);
|
|
229
|
-
}
|
|
230
|
-
var init_steering_enabled = __esm(() => {
|
|
231
|
-
init_env_flag();
|
|
232
|
-
});
|
|
233
|
-
|
|
234
234
|
// src/prompts/session-templates.ts
|
|
235
235
|
var compositeVariables;
|
|
236
236
|
var init_session_templates = __esm(() => {
|
|
@@ -270,7 +270,8 @@ Choose the path by the shape of the work:
|
|
|
270
270
|
Store progress with \`store-progress\` at each milestone. A milestone is a result the lead could act on.
|
|
271
271
|
The task is done when \`store-progress\` carries status \`completed\` and an \`output\` that names the result and every artifact link. On failure, status \`failed\` and a \`failureReason\` that names what you tried.
|
|
272
272
|
When the task carries an \`outputSchema\`, \`output\` is JSON that matches it.
|
|
273
|
-
When you are blocked after real effort, store the blocker with \`store-progress\` and keep working on what you can.
|
|
273
|
+
When you are blocked after real effort, store the blocker with \`store-progress\` and keep working on what you can.
|
|
274
|
+
The task has four endings. When you are done: \`completed\`. When the answer needs time (a build, a deploy, a reply): \`defer-task\` with a summary of what you did, when to wake up, and what to check. It completes the task now; the wake-up task continues it. When a person must decide: \`request-human-input\`. When nothing else is possible: \`failed\` with the blocker.
|
|
274
275
|
`,
|
|
275
276
|
variables: [],
|
|
276
277
|
category: "system"
|
|
@@ -284,9 +285,10 @@ When you are blocked after real effort, store the blocker with \`store-progress\
|
|
|
284
285
|
Your output is delegation and review. Workers implement, research, analyze, and write. Data gathering, even a quick query, goes to a worker. You answer simple factual questions yourself.
|
|
285
286
|
|
|
286
287
|
\`get-swarm\` is the roster. Route by capability and load.
|
|
288
|
+
Delegate with \`send-task\`. Read a child's result with \`get-task-details\`.
|
|
287
289
|
A task states the goal, the repo URL when there is one, and the constraints. Workers know git, the skills, and \`store-progress\`.
|
|
288
290
|
Delegate by the shape of the work: a workflow for multi-step or fan-out work, a schedule for recurring work, a script for bulk data, an inline \`script-run\` for a one-off bulk job you can run yourself. The \`workflow-iterate\`, \`scheduling\`, and \`swarm-scripts\` skills build them.
|
|
289
|
-
Research or exploration: tell the worker to use
|
|
291
|
+
Research or exploration: tell the worker to use the \`researching\` skill. A large feature: a task for the \`planning\` skill first, then a task for the \`implementing\` skill with \`parentTaskId\`. A small fix: direct implementation.
|
|
290
292
|
A follow-up that continues earlier work carries \`parentTaskId\`. The worker receives the prior context.
|
|
291
293
|
A task whose result depends on the workers' output: wait for the children with the \`wait-for-task\` script, then merge and complete the task yourself. A turn that ends with children still running leaves the task unfinished.
|
|
292
294
|
|
|
@@ -366,10 +368,11 @@ Memories from past sessions are in your task message. Read them before you start
|
|
|
366
368
|
defaultBody: `
|
|
367
369
|
## Outputs
|
|
368
370
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
+
Short answers: inline in the task output.
|
|
372
|
+
agent-fs is the shared drive between agents and people. Documents (reports, digests, summaries, specs, research, drafts): Markdown files via its CLI; see \`agent-fs\` skill.
|
|
373
|
+
Pages: only for polished artifacts shared with a wider audience or explicitly requested; see \`pages\` skill.
|
|
371
374
|
A tool a person will use, with data and actions: build an app. See the \`apps\` skill.
|
|
372
|
-
|
|
375
|
+
Link env: \`APP_URL\` for pages, \`MCP_BASE_URL\` for the API, \`AGENT_FS_LIVE_URL\` for files. Report missing variables.
|
|
373
376
|
`,
|
|
374
377
|
variables: [],
|
|
375
378
|
category: "system"
|
|
@@ -380,10 +383,11 @@ Share links come from env: \`APP_URL\` for pages, \`MCP_BASE_URL\` for the API,
|
|
|
380
383
|
defaultBody: `
|
|
381
384
|
## Outputs
|
|
382
385
|
|
|
383
|
-
|
|
384
|
-
|
|
386
|
+
Short answers: inline in the task output.
|
|
387
|
+
Documents: Markdown task attachments; agent-fs is not configured here.
|
|
388
|
+
Pages: only for polished artifacts shared with a wider audience or explicitly requested; see \`pages\` skill.
|
|
385
389
|
A tool a person will use, with data and actions: build an app. See the \`apps\` skill.
|
|
386
|
-
|
|
390
|
+
Link env: \`APP_URL\` for pages, \`MCP_BASE_URL\` for the API. Report missing variables.
|
|
387
391
|
`,
|
|
388
392
|
variables: [],
|
|
389
393
|
category: "system"
|
|
@@ -655,4 +659,4 @@ If this task reveals new stable communication preferences for this requester, pe
|
|
|
655
659
|
});
|
|
656
660
|
});
|
|
657
661
|
|
|
658
|
-
export { findInterpolationTokens, interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureDbResolver, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver,
|
|
662
|
+
export { isSteeringEnabled, init_steering_enabled, findInterpolationTokens, interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureDbResolver, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, init_session_templates };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildModelsDevSeedRows,
|
|
3
3
|
loadModelsDevCache
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-rw51bq3j.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogEntry,
|
|
7
7
|
getActivePricingRow,
|
|
8
8
|
getDbClient,
|
|
9
9
|
init_db,
|
|
10
10
|
insertPricingRow
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-ftht3zzj.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|