@anyswarm/core 0.5.0 → 0.5.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/AGENTS.md +1 -1
- package/README.md +21 -13
- package/deploy/worker/Dockerfile +12 -4
- package/dist/deploy/worker/Dockerfile +12 -4
- package/dist/examples/README.md +35 -12
- package/dist/examples/authoring/README.md +24 -0
- package/dist/examples/authoring/business.d.ts +2 -0
- package/dist/examples/authoring/business.js +4 -0
- package/dist/examples/authoring/config.d.ts +5 -0
- package/dist/examples/authoring/config.js +2 -0
- package/dist/examples/authoring/eject.json +5 -0
- package/dist/examples/authoring/harness.d.ts +4 -0
- package/dist/examples/authoring/harness.js +19 -0
- package/dist/examples/autoresearch/README.md +40 -0
- package/dist/examples/autoresearch/REQUIREMENTS.zh.md +11 -0
- package/dist/examples/autoresearch/config.d.ts +51 -0
- package/dist/examples/autoresearch/config.js +57 -0
- package/dist/examples/autoresearch/demo.d.ts +11 -0
- package/dist/examples/autoresearch/demo.js +52 -0
- package/dist/examples/autoresearch/eject.json +17 -0
- package/dist/examples/autoresearch/frontiercs2-config.d.ts +2 -0
- package/dist/examples/autoresearch/frontiercs2-config.js +3 -0
- package/dist/examples/autoresearch/frontiercs2.d.ts +87 -0
- package/dist/examples/autoresearch/frontiercs2.js +211 -0
- package/dist/examples/autoresearch/prepare-demo.d.ts +1 -0
- package/dist/examples/autoresearch/prepare-demo.js +15 -0
- package/dist/examples/autoresearch/prepare.d.ts +95 -0
- package/dist/examples/autoresearch/prepare.js +257 -0
- package/dist/examples/autoresearch/process.d.ts +13 -0
- package/dist/examples/autoresearch/process.js +48 -0
- package/dist/examples/autoresearch/project.d.ts +21 -0
- package/dist/examples/autoresearch/project.js +392 -0
- package/dist/examples/autoresearch/research-service.d.ts +106 -0
- package/dist/examples/autoresearch/research-service.js +255 -0
- package/dist/examples/code/README.md +33 -0
- package/dist/examples/code/REQUIREMENTS.zh.md +11 -0
- package/dist/examples/code/candidate.d.ts +19 -0
- package/dist/examples/code/candidate.js +80 -0
- package/dist/examples/code/config.d.ts +32 -0
- package/dist/examples/code/config.js +18 -0
- package/dist/examples/code/eject.json +5 -0
- package/dist/examples/code/project.d.ts +3 -0
- package/dist/examples/code/project.js +605 -0
- package/dist/examples/code/prompts.d.ts +5 -0
- package/dist/examples/code/prompts.js +12 -0
- package/dist/examples/code/verification.d.ts +19 -0
- package/dist/examples/code/verification.js +268 -0
- package/dist/examples/code/worktree.d.ts +17 -0
- package/dist/examples/code/worktree.js +233 -0
- package/dist/examples/harness-session/README.md +3 -6
- package/dist/examples/lead-worker/harness/dynamic-scheduler.d.ts +2 -1
- package/dist/examples/lead-worker/harness/dynamic-scheduler.js +5 -2
- package/dist/examples/lead-worker/harness/index.d.ts +60 -0
- package/dist/examples/lead-worker/harness/index.js +77 -6
- package/dist/examples/lead-worker/project.js +2 -2
- package/dist/examples/lead-worker/services/board.d.ts +5 -0
- package/dist/examples/lead-worker/services/board.js +19 -1
- package/dist/examples/messages/README.md +5 -5
- package/dist/examples/messages/handoff.d.ts +2 -0
- package/dist/examples/messages/handoff.js +5 -1
- package/dist/examples/messages/project.js +52 -2
- package/dist/examples/notes/README.md +13 -18
- package/dist/examples/notes/project.js +67 -6
- package/dist/examples/peermesh/harness/router.js +3 -1
- package/dist/examples/peermesh/harness/team.d.ts +8 -0
- package/dist/examples/peermesh/harness/team.js +13 -0
- package/dist/examples/peermesh/project.js +22 -4
- package/dist/examples/services/agent-control/README.md +3 -3
- package/dist/examples/services/mathlib-search/Dockerfile +4 -2
- package/dist/examples/services/mathlib-search/README.md +1 -1
- package/dist/examples/services/mcp-managed/README.md +2 -2
- package/dist/examples/services/persistent-board/README.md +16 -3
- package/dist/examples/services/persistent-board/business.d.ts +7 -0
- package/dist/examples/services/persistent-board/business.js +7 -0
- package/dist/examples/services/persistent-board/index.js +10 -0
- package/dist/examples/services/persistent-board/live.d.ts +3 -0
- package/dist/examples/services/persistent-board/live.js +58 -0
- package/dist/examples/subagents/README.md +5 -5
- package/dist/examples/subagents/business.js +3 -1
- package/dist/examples/subagents/config.js +3 -3
- package/dist/examples/subagents/harness/controller.d.ts +15 -0
- package/dist/examples/subagents/harness/controller.js +181 -32
- package/dist/examples/subagents/project.d.ts +2 -0
- package/dist/examples/subagents/project.js +43 -34
- package/dist/examples/subagents/prompts/prompts.d.ts +1 -0
- package/dist/examples/subagents/prompts/prompts.js +3 -0
- package/dist/examples/subagents/services/collaboration-service.d.ts +3 -2
- package/dist/examples/subagents/services/collaboration-service.js +14 -2
- package/dist/examples/substrate/README.md +2 -2
- package/dist/examples/substrate/harness/index.d.ts +1 -1
- package/dist/examples/substrate/harness/index.js +77 -12
- package/dist/examples/substrate/project.js +4 -1
- package/dist/examples/super/README.md +52 -0
- package/dist/examples/super/actions.d.ts +95 -0
- package/dist/examples/super/actions.js +230 -0
- package/dist/examples/super/artifact.d.ts +4 -0
- package/dist/examples/super/artifact.js +51 -0
- package/dist/examples/super/config.d.ts +80 -0
- package/dist/examples/super/config.js +83 -0
- package/dist/examples/super/coordinator.d.ts +33 -0
- package/dist/examples/super/coordinator.js +151 -0
- package/dist/examples/super/daemon.d.ts +11 -0
- package/dist/examples/super/daemon.js +109 -0
- package/dist/examples/super/decisions.d.ts +8 -0
- package/dist/examples/super/decisions.js +52 -0
- package/dist/examples/super/eject.json +5 -0
- package/dist/examples/super/execution.d.ts +11 -0
- package/dist/examples/super/execution.js +136 -0
- package/dist/examples/super/github.d.ts +62 -0
- package/dist/examples/super/github.js +269 -0
- package/dist/examples/super/inbox.d.ts +162 -0
- package/dist/examples/super/inbox.js +284 -0
- package/dist/examples/super/location.d.ts +5 -0
- package/dist/examples/super/location.js +64 -0
- package/dist/examples/super/operator.d.ts +1 -0
- package/dist/examples/super/operator.js +31 -0
- package/dist/examples/super/outbox.d.ts +5 -0
- package/dist/examples/super/outbox.js +103 -0
- package/dist/examples/super/project.d.ts +4 -0
- package/dist/examples/super/project.js +251 -0
- package/dist/examples/super/prompts.d.ts +3 -0
- package/dist/examples/super/prompts.js +25 -0
- package/dist/examples/taskpool/deploy/service-hosts/Dockerfile +4 -2
- package/dist/examples/taskpool/harness/controller.d.ts +35 -6
- package/dist/examples/taskpool/harness/controller.js +73 -7
- package/dist/examples/taskpool/project.js +18 -2
- package/dist/scripts/anyswarm-arguments.d.ts +18 -6
- package/dist/scripts/anyswarm-arguments.js +88 -52
- package/dist/scripts/anyswarm-author.d.ts +5 -0
- package/dist/scripts/anyswarm-author.js +24 -0
- package/dist/scripts/anyswarm-eject.d.ts +11 -0
- package/dist/scripts/anyswarm-eject.js +164 -0
- package/dist/scripts/anyswarm-harnesses.d.ts +1 -0
- package/dist/scripts/anyswarm-harnesses.js +10 -0
- package/dist/scripts/anyswarm-installation.d.ts +7 -40
- package/dist/scripts/anyswarm-installation.js +17 -285
- package/dist/scripts/anyswarm-launch.d.ts +7 -0
- package/dist/scripts/anyswarm-launch.js +37 -0
- package/dist/scripts/anyswarm-progress.d.ts +6 -0
- package/dist/scripts/anyswarm-progress.js +102 -0
- package/dist/scripts/anyswarm-project.d.ts +3 -1
- package/dist/scripts/anyswarm-project.js +49 -35
- package/dist/scripts/anyswarm-source-runner.d.ts +1 -0
- package/dist/scripts/anyswarm-source-runner.js +200 -0
- package/dist/scripts/anyswarm.js +28 -3
- package/dist/scripts/build-provenance.json +1 -0
- package/dist/scripts/build.js +7 -1
- package/dist/scripts/generate-architecture-api.js +2 -0
- package/dist/scripts/generate-architecture-prompts.js +24 -2
- package/dist/scripts/local-environment.d.ts +13 -2
- package/dist/scripts/local-environment.js +111 -28
- package/dist/scripts/local-setup-smoke.js +3 -2
- package/dist/scripts/local-setup-worker.d.ts +1 -1
- package/dist/scripts/local-setup-worker.js +15 -6
- package/dist/scripts/local-setup.d.ts +5 -2
- package/dist/scripts/local-setup.js +167 -79
- package/dist/scripts/opensandbox-agent-worker.js +2 -2
- package/dist/scripts/pack-release.d.ts +1 -0
- package/dist/scripts/pack-release.js +66 -0
- package/dist/scripts/pi-session-bridge.js +11 -3
- package/dist/scripts/run-harness.js +3 -1
- package/dist/scripts/setup-bootstrap.js +43 -6
- package/dist/src/core/allocation-ledger.js +4 -3
- package/dist/src/core/host-identity.d.ts +2 -0
- package/dist/src/core/host-identity.js +11 -0
- package/dist/src/core/index.d.ts +4 -2
- package/dist/src/core/index.js +12 -4
- package/dist/src/core/mcp-service.js +2 -2
- package/dist/src/core/runtime-management.d.ts +6 -0
- package/dist/src/core/runtime-management.js +24 -0
- package/dist/src/core/sandbox/executor-driver.d.ts +4 -2
- package/dist/src/core/sandbox/executor-driver.js +12 -14
- package/dist/src/core/sandbox/local-executor.d.ts +13 -1
- package/dist/src/core/sandbox/local-executor.js +69 -19
- package/dist/src/core/sandbox/local-worker.js +32 -21
- package/dist/src/core/sandbox/opensandbox-backend.d.ts +2 -0
- package/dist/src/core/sandbox/opensandbox-backend.js +36 -11
- package/dist/src/core/sandbox/sandbox-connection.d.ts +2 -0
- package/dist/src/core/sandbox/sandbox-connection.js +14 -6
- package/dist/src/core/service-live-state.d.ts +14 -0
- package/dist/src/core/service-live-state.js +161 -0
- package/dist/src/core/service-observation-types.d.ts +21 -1
- package/dist/src/core/service-process.d.ts +1 -1
- package/dist/src/core/service-process.js +45 -4
- package/dist/src/core/service-types.d.ts +5 -1
- package/dist/src/core/services.d.ts +1 -1
- package/dist/src/core/services.js +8 -3
- package/dist/src/core/types.d.ts +3 -0
- package/dist/src/core/worker-image.js +3 -3
- package/dist/src/harness/harness-session-types.d.ts +10 -0
- package/dist/src/harness/harness-session.js +42 -5
- package/dist/src/harness/project-harness.d.ts +14 -1
- package/dist/src/harness/project-harness.js +38 -12
- package/dist/src/harness/project-input.js +81 -15
- package/dist/src/harness/project-rpc-client.d.ts +1 -0
- package/dist/src/harness/project-rpc-client.js +5 -0
- package/dist/src/harness/project-rpc.d.ts +8 -2
- package/dist/src/harness/project-rpc.js +31 -7
- package/dist/src/harness/project-runtime.js +6 -2
- package/dist/src/harness/typescript-loader.d.ts +2 -0
- package/dist/src/harness/typescript-loader.js +41 -0
- package/dist/src/trace-viewer/public/app.js +6 -5
- package/dist/src/trace-viewer/reader.mjs +42 -2
- package/docs/INDEX.md +5 -2
- package/docs/architecture/00-overview.md +1 -1
- package/docs/architecture/01-agent-core.md +1 -1
- package/docs/architecture/04-services.md +1 -1
- package/docs/architecture/06-observability-experiments.md +1 -1
- package/docs/architecture/07-run-configuration.md +38 -18
- package/docs/architecture/08-prompts.md +22 -0
- package/docs/architecture/10-service-api-reference.md +53 -18
- package/docs/architecture/11-storage-reference.md +18 -1
- package/docs/architecture/12-code-coverage.md +152 -89
- package/docs/architecture/15-core-runtime.md +8 -0
- package/docs/architecture/16-pi-opensandbox-backend.md +5 -5
- package/docs/architecture/17-harness-reporting.md +1 -1
- package/docs/architecture/19-substrate-harness.md +28 -1
- package/docs/architecture/20-lead-worker-harness.md +34 -1
- package/docs/architecture/22-website.md +5 -6
- package/docs/architecture/23-project-harness.md +152 -8
- package/docs/architecture/24-runtime-recovery.md +10 -3
- package/docs/architecture/26-code.md +54 -0
- package/docs/architecture/27-personal.md +58 -0
- package/docs/architecture/28-autoresearch.md +43 -0
- package/docs/architecture/INDEX.md +3 -0
- package/docs/architecture/prompts/08-lead-worker-harness.md +4 -2
- package/docs/architecture/prompts/08-subagents-harness.md +21 -0
- package/docs/architecture/prompts/21-personal.md +44 -0
- package/docs/architecture/prompts/22-autoresearch.md +63 -0
- package/docs/architecture/prompts/26-code.md +55 -0
- package/docs/architecture/prompts/source-manifest.json +152 -33
- package/docs/architecture/source-map.json +473 -25
- package/docs/designs/core-harness/01-core.md +2 -2
- package/docs/designs/core-harness/06-project-harness.md +13 -2
- package/docs/designs/core-harness/README.md +7 -2
- package/docs/en/agents.md +1 -1
- package/docs/en/build-your-harness.md +3 -5
- package/docs/en/changelog.md +20 -4
- package/docs/en/first-harness.md +9 -12
- package/docs/en/harnesses/lead-worker.md +1 -1
- package/docs/en/harnesses/peermesh.md +2 -2
- package/docs/en/harnesses/subagents.md +2 -2
- package/docs/en/harnesses/substrate.md +4 -4
- package/docs/en/harnesses/taskpool.md +2 -2
- package/docs/en/latest.md +14 -121
- package/docs/en/overview.md +1 -1
- package/docs/en/quickstart.md +42 -39
- package/docs/en/reference/api.md +14 -4
- package/docs/en/reference/cli.md +53 -47
- package/docs/en/runtime.md +2 -2
- package/docs/en/sandbox.md +3 -3
- package/docs/en/services.md +4 -0
- package/docs/operations/trace-viewer.md +1 -1
- package/docs/workflows/development.md +28 -21
- package/docs/workflows/release-and-docs-versioning.md +77 -0
- package/docs/workflows/release-cli-acceptance.md +85 -0
- package/docs/zh/agents.md +1 -1
- package/docs/zh/build-your-harness.md +3 -5
- package/docs/zh/changelog.md +20 -4
- package/docs/zh/first-harness.md +9 -12
- package/docs/zh/harnesses/lead-worker.md +1 -1
- package/docs/zh/harnesses/peermesh.md +2 -2
- package/docs/zh/harnesses/subagents.md +2 -2
- package/docs/zh/harnesses/substrate.md +4 -4
- package/docs/zh/harnesses/taskpool.md +2 -2
- package/docs/zh/latest.md +15 -122
- package/docs/zh/overview.md +1 -1
- package/docs/zh/quickstart.md +42 -39
- package/docs/zh/reference/api.md +14 -4
- package/docs/zh/reference/cli.md +24 -40
- package/docs/zh/runtime.md +2 -2
- package/docs/zh/sandbox.md +3 -3
- package/docs/zh/services.md +4 -0
- package/examples/README.md +35 -12
- package/examples/authoring/README.md +24 -0
- package/examples/authoring/business.ts +4 -0
- package/examples/authoring/config.ts +2 -0
- package/examples/authoring/eject.json +5 -0
- package/examples/authoring/harness.ts +21 -0
- package/examples/autoresearch/README.md +40 -0
- package/examples/autoresearch/REQUIREMENTS.zh.md +11 -0
- package/examples/autoresearch/config.ts +90 -0
- package/examples/autoresearch/demo.ts +55 -0
- package/examples/autoresearch/eject.json +17 -0
- package/examples/autoresearch/frontiercs2-config.ts +4 -0
- package/examples/autoresearch/frontiercs2.ts +237 -0
- package/examples/autoresearch/prepare-demo.ts +15 -0
- package/examples/autoresearch/prepare.ts +267 -0
- package/examples/autoresearch/process.ts +50 -0
- package/examples/autoresearch/project.ts +380 -0
- package/examples/autoresearch/research-service.ts +302 -0
- package/examples/code/README.md +33 -0
- package/examples/code/REQUIREMENTS.zh.md +11 -0
- package/examples/code/candidate.ts +89 -0
- package/examples/code/config.ts +19 -0
- package/examples/code/eject.json +5 -0
- package/examples/code/project.ts +581 -0
- package/examples/code/prompts.ts +16 -0
- package/examples/code/verification.ts +239 -0
- package/examples/code/worktree.ts +188 -0
- package/examples/harness-session/README.md +3 -6
- package/examples/lead-worker/harness/dynamic-scheduler.ts +6 -3
- package/examples/lead-worker/harness/index.ts +61 -6
- package/examples/lead-worker/project.ts +2 -2
- package/examples/lead-worker/services/board.ts +14 -1
- package/examples/messages/README.md +5 -5
- package/examples/messages/handoff.ts +6 -2
- package/examples/messages/project.ts +47 -2
- package/examples/notes/README.md +13 -18
- package/examples/notes/project.ts +57 -9
- package/examples/peermesh/harness/router.ts +2 -2
- package/examples/peermesh/harness/team.ts +11 -0
- package/examples/peermesh/project.ts +19 -4
- package/examples/services/agent-control/README.md +3 -3
- package/examples/services/mathlib-search/Dockerfile +4 -2
- package/examples/services/mathlib-search/README.md +1 -1
- package/examples/services/mcp-managed/README.md +2 -2
- package/examples/services/persistent-board/README.md +16 -3
- package/examples/services/persistent-board/business.ts +10 -0
- package/examples/services/persistent-board/index.ts +10 -0
- package/examples/services/persistent-board/live.ts +54 -0
- package/examples/subagents/README.md +5 -5
- package/examples/subagents/business.ts +3 -1
- package/examples/subagents/config.ts +4 -3
- package/examples/subagents/harness/controller.ts +161 -29
- package/examples/subagents/project.ts +47 -33
- package/examples/subagents/prompts/prompts.ts +4 -0
- package/examples/subagents/services/collaboration-service.ts +14 -2
- package/examples/substrate/README.md +2 -2
- package/examples/substrate/harness/index.ts +67 -11
- package/examples/substrate/project.ts +5 -1
- package/examples/super/README.md +52 -0
- package/examples/super/actions.ts +196 -0
- package/examples/super/artifact.ts +56 -0
- package/examples/super/config.ts +95 -0
- package/examples/super/coordinator.ts +158 -0
- package/examples/super/daemon.ts +84 -0
- package/examples/super/decisions.ts +46 -0
- package/examples/super/eject.json +5 -0
- package/examples/super/execution.ts +131 -0
- package/examples/super/github.ts +242 -0
- package/examples/super/inbox.ts +306 -0
- package/examples/super/location.ts +54 -0
- package/examples/super/operator.ts +28 -0
- package/examples/super/outbox.ts +97 -0
- package/examples/super/project.ts +225 -0
- package/examples/super/prompts.ts +27 -0
- package/examples/taskpool/deploy/service-hosts/Dockerfile +4 -2
- package/examples/taskpool/harness/controller.ts +59 -7
- package/examples/taskpool/project.ts +18 -2
- package/npm-shrinkwrap.development.json +700 -0
- package/npm-shrinkwrap.json +95 -1969
- package/package.development.json +88 -0
- package/package.json +11 -8
- package/scripts/anyswarm-arguments.ts +91 -54
- package/scripts/anyswarm-author.ts +25 -0
- package/scripts/anyswarm-eject.ts +145 -0
- package/scripts/anyswarm-harnesses.ts +10 -0
- package/scripts/anyswarm-installation.ts +18 -288
- package/scripts/anyswarm-launch.ts +36 -0
- package/scripts/anyswarm-progress.ts +95 -0
- package/scripts/anyswarm-project.ts +35 -34
- package/scripts/anyswarm-source-runner.ts +176 -0
- package/scripts/anyswarm.ts +24 -3
- package/scripts/build.ts +8 -1
- package/scripts/generate-architecture-api.ts +2 -0
- package/scripts/generate-architecture-prompts.ts +35 -2
- package/scripts/local-environment.ts +117 -28
- package/scripts/local-setup-smoke.ts +3 -2
- package/scripts/local-setup-worker.ts +17 -7
- package/scripts/local-setup.ts +166 -73
- package/scripts/opensandbox-agent-worker.ts +2 -2
- package/scripts/pack-release.ts +70 -0
- package/scripts/pi-session-bridge.ts +10 -2
- package/scripts/run-harness.ts +3 -1
- package/scripts/setup-bootstrap.ts +41 -6
- package/src/core/allocation-ledger.ts +5 -3
- package/src/core/host-identity.ts +11 -0
- package/src/core/index.ts +12 -6
- package/src/core/mcp-service.ts +2 -2
- package/src/core/runtime-management.ts +22 -0
- package/src/core/sandbox/executor-driver.ts +15 -18
- package/src/core/sandbox/local-executor.ts +65 -19
- package/src/core/sandbox/local-worker.ts +29 -21
- package/src/core/sandbox/opensandbox-backend.ts +36 -11
- package/src/core/sandbox/sandbox-connection.ts +14 -5
- package/src/core/service-live-state.ts +156 -0
- package/src/core/service-observation-types.ts +23 -1
- package/src/core/service-process.ts +36 -3
- package/src/core/service-types.ts +3 -1
- package/src/core/services.ts +8 -3
- package/src/core/types.ts +3 -0
- package/src/core/worker-image.ts +3 -3
- package/src/harness/harness-session-types.ts +13 -1
- package/src/harness/harness-session.ts +40 -7
- package/src/harness/project-harness.ts +38 -12
- package/src/harness/project-input.ts +73 -15
- package/src/harness/project-rpc-client.ts +5 -0
- package/src/harness/project-rpc.ts +29 -8
- package/src/harness/project-runtime.ts +4 -2
- package/src/harness/typescript-loader.ts +37 -0
- package/src/trace-viewer/public/app.js +6 -5
- package/src/trace-viewer/reader.mjs +42 -2
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { join, resolve } from 'node:path';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
3
|
+
import { registerHooks } from 'node:module';
|
|
4
|
+
import { closeSync, mkdtempSync, openSync, readSync, rmdirSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { verifyExportedSdk } from './anyswarm-eject.js';
|
|
7
|
+
import { installSourceLoader } from '../src/harness/typescript-loader.js';
|
|
8
|
+
import { parseSourceHarnessCommand } from './anyswarm-arguments.js';
|
|
9
|
+
const [, , entry, ...args] = process.argv;
|
|
10
|
+
if (!entry)
|
|
11
|
+
throw new TypeError('A TypeScript or JavaScript entry file is required');
|
|
12
|
+
const filename = resolve(entry);
|
|
13
|
+
const entryUrl = pathToFileURL(filename).href;
|
|
14
|
+
process.argv = [process.execPath, filename, ...args];
|
|
15
|
+
installSourceLoader();
|
|
16
|
+
const hasPrompt = args.some(arg => /^--prompt(?:=|$)/.test(arg));
|
|
17
|
+
const hasMode = args.some(arg => /^--mode(?:=|$)/.test(arg));
|
|
18
|
+
const isHarness = (source) => source.default?.apiVersion === 1 && typeof source.default.run === 'function';
|
|
19
|
+
async function importWithDiagnostics(load, useStderr = true) {
|
|
20
|
+
if (!useStderr)
|
|
21
|
+
return load();
|
|
22
|
+
const stdout = process.stdout.write;
|
|
23
|
+
process.stdout.write = process.stderr.write.bind(process.stderr);
|
|
24
|
+
try {
|
|
25
|
+
return await load();
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
process.stdout.write = stdout;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function importImplicitSource(load) {
|
|
32
|
+
const { init, parse } = await import('es-module-lexer');
|
|
33
|
+
await init;
|
|
34
|
+
const stdout = process.stdout.write;
|
|
35
|
+
let pending;
|
|
36
|
+
let position = 0;
|
|
37
|
+
let streaming = false;
|
|
38
|
+
let interactiveOutput = false;
|
|
39
|
+
let inputReplay;
|
|
40
|
+
const hook = registerHooks({ load(url, context, nextLoad) {
|
|
41
|
+
const loaded = nextLoad(url, context);
|
|
42
|
+
if (url === entryUrl && loaded.format === 'module' && loaded.source !== undefined) {
|
|
43
|
+
try {
|
|
44
|
+
const code = typeof loaded.source === 'string' ? loaded.source : new TextDecoder().decode(loaded.source);
|
|
45
|
+
const hasDefault = parse(code)[1].some(entry => 'name' in entry && entry.name === 'default' && !entry.typeOnly);
|
|
46
|
+
if (!hasDefault) {
|
|
47
|
+
streaming = true;
|
|
48
|
+
process.stdout.write = stdout;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch { /* Let Node diagnose the source if the lexer cannot classify it. */ }
|
|
52
|
+
}
|
|
53
|
+
return loaded;
|
|
54
|
+
} });
|
|
55
|
+
process.stdout.write = (chunk, encoding, callback) => {
|
|
56
|
+
const charset = typeof encoding === 'string' ? encoding : undefined;
|
|
57
|
+
const done = typeof encoding === 'function' ? encoding : callback;
|
|
58
|
+
if (streaming && pending === undefined) {
|
|
59
|
+
interactiveOutput = true;
|
|
60
|
+
return stdout.call(process.stdout, chunk, charset, done);
|
|
61
|
+
}
|
|
62
|
+
if (pending === undefined) {
|
|
63
|
+
const directory = mkdtempSync(join(tmpdir(), 'anys-source-output-'));
|
|
64
|
+
const path = join(directory, 'stdout');
|
|
65
|
+
try {
|
|
66
|
+
pending = openSync(path, 'wx+', 0o600);
|
|
67
|
+
unlinkSync(path);
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
rmdirSync(directory);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
writeFileSync(pending, chunk, charset);
|
|
74
|
+
if (done)
|
|
75
|
+
process.nextTick(done);
|
|
76
|
+
return true;
|
|
77
|
+
};
|
|
78
|
+
async function replay(destination) {
|
|
79
|
+
const fd = pending;
|
|
80
|
+
const write = destination === process.stdout ? stdout : destination.write;
|
|
81
|
+
try {
|
|
82
|
+
if (fd === undefined)
|
|
83
|
+
return;
|
|
84
|
+
const chunk = Buffer.alloc(64 * 1024);
|
|
85
|
+
for (;;) {
|
|
86
|
+
const size = readSync(fd, chunk, 0, chunk.length, position);
|
|
87
|
+
if (!size)
|
|
88
|
+
break;
|
|
89
|
+
position += size;
|
|
90
|
+
await new Promise((done, reject) => write.call(destination, chunk.subarray(0, size), undefined, error => error ? reject(error) : done()));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
pending = undefined;
|
|
95
|
+
if (fd !== undefined)
|
|
96
|
+
closeSync(fd);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const streamForInput = () => {
|
|
100
|
+
if (streaming)
|
|
101
|
+
return;
|
|
102
|
+
streaming = true;
|
|
103
|
+
interactiveOutput = pending !== undefined;
|
|
104
|
+
inputReplay = replay(process.stdout);
|
|
105
|
+
void inputReplay.catch(() => { });
|
|
106
|
+
};
|
|
107
|
+
const stdin = process.stdin;
|
|
108
|
+
const read = stdin.read;
|
|
109
|
+
const ownRead = Object.getOwnPropertyDescriptor(stdin, 'read');
|
|
110
|
+
function readForInput(size) {
|
|
111
|
+
// Readable also calls read(0) internally to prepare its buffer.
|
|
112
|
+
if (size !== 0)
|
|
113
|
+
streamForInput();
|
|
114
|
+
return read.call(this, size);
|
|
115
|
+
}
|
|
116
|
+
const watchInput = (event) => {
|
|
117
|
+
if (event === 'data' || event === 'readable' || event === 'keypress')
|
|
118
|
+
streamForInput();
|
|
119
|
+
};
|
|
120
|
+
stdin.read = readForInput;
|
|
121
|
+
stdin.on('newListener', watchInput).on('resume', streamForInput);
|
|
122
|
+
// Explicit exit cannot wait on queued pipe writes. Keep stdout's normal
|
|
123
|
+
// backpressure and leave any queued replay writes in their original order.
|
|
124
|
+
const flushOnExit = () => {
|
|
125
|
+
if (pending === undefined || position > 0)
|
|
126
|
+
return;
|
|
127
|
+
try {
|
|
128
|
+
for (;;) {
|
|
129
|
+
const chunk = Buffer.alloc(64 * 1024);
|
|
130
|
+
const size = readSync(pending, chunk, 0, chunk.length, position);
|
|
131
|
+
if (!size || !stdout.call(process.stdout, chunk.subarray(0, size)))
|
|
132
|
+
return;
|
|
133
|
+
position += size;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch { /* Preserve the explicit exit code if output can no longer be written. */ }
|
|
137
|
+
};
|
|
138
|
+
process.once('exit', flushOnExit);
|
|
139
|
+
let destination = process.stderr;
|
|
140
|
+
try {
|
|
141
|
+
const source = await load();
|
|
142
|
+
if (!isHarness(source))
|
|
143
|
+
destination = process.stdout;
|
|
144
|
+
else if (interactiveOutput) {
|
|
145
|
+
throw new Error('Use an explicit --prompt for a task Harness that writes to stdout while reading stdin during import.');
|
|
146
|
+
}
|
|
147
|
+
return source;
|
|
148
|
+
}
|
|
149
|
+
finally {
|
|
150
|
+
hook.deregister();
|
|
151
|
+
stdin.off('newListener', watchInput).off('resume', streamForInput);
|
|
152
|
+
if (stdin.read === readForInput) {
|
|
153
|
+
if (ownRead)
|
|
154
|
+
Object.defineProperty(stdin, 'read', ownRead);
|
|
155
|
+
else
|
|
156
|
+
Reflect.deleteProperty(stdin, 'read');
|
|
157
|
+
}
|
|
158
|
+
try {
|
|
159
|
+
await (inputReplay ?? replay(destination));
|
|
160
|
+
}
|
|
161
|
+
finally {
|
|
162
|
+
process.stdout.write = stdout;
|
|
163
|
+
process.off('exit', flushOnExit);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const verifySdk = await verifyExportedSdk(filename);
|
|
169
|
+
if (verifySdk) {
|
|
170
|
+
const sdk = '@anyswarm/core';
|
|
171
|
+
let checkingEntry = true;
|
|
172
|
+
registerHooks({ resolve(specifier, context, nextResolve) {
|
|
173
|
+
if (specifier !== sdk)
|
|
174
|
+
return nextResolve(specifier, context);
|
|
175
|
+
const resolved = nextResolve(specifier, checkingEntry ? { ...context, parentURL: entryUrl } : context);
|
|
176
|
+
verifySdk(resolved.url);
|
|
177
|
+
return resolved;
|
|
178
|
+
} });
|
|
179
|
+
// Use Node's ESM conditions with the same parent and fallback as the entry.
|
|
180
|
+
try {
|
|
181
|
+
import.meta.resolve(sdk);
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
checkingEntry = false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const load = () => import(entryUrl);
|
|
188
|
+
const source = await (hasPrompt || hasMode ? importWithDiagnostics(load) : importImplicitSource(load));
|
|
189
|
+
if (isHarness(source)) {
|
|
190
|
+
const command = parseSourceHarnessCommand(args, filename);
|
|
191
|
+
const diagnostics = { onSourceError(error) { console.error(error instanceof Error ? error.stack : String(error)); } };
|
|
192
|
+
const { runProjectCommand } = await import('./anyswarm-project.js');
|
|
193
|
+
const code = await runProjectCommand(command, process.cwd(), diagnostics);
|
|
194
|
+
process.stdout.write('', () => process.exit(code));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
console.error(error instanceof Error ? error.stack : String(error));
|
|
199
|
+
process.exitCode = 1;
|
|
200
|
+
}
|
package/dist/scripts/anyswarm.js
CHANGED
|
@@ -35,6 +35,26 @@ else {
|
|
|
35
35
|
}
|
|
36
36
|
if (command && 'help' in command)
|
|
37
37
|
console.log(command.help);
|
|
38
|
+
if (command && 'command' in command && command.command === 'run') {
|
|
39
|
+
try {
|
|
40
|
+
const { runSourceCommand } = await import('./anyswarm-author.js');
|
|
41
|
+
process.exitCode = await runSourceCommand(command, process.cwd());
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error(error instanceof Error ? error.message : 'Could not run the TypeScript Harness.');
|
|
45
|
+
process.exitCode = 1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (command && 'command' in command && command.command === 'eject') {
|
|
49
|
+
try {
|
|
50
|
+
const { ejectSourceCommand } = await import('./anyswarm-author.js');
|
|
51
|
+
console.log(JSON.stringify(await ejectSourceCommand(command, process.cwd())));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error(error instanceof Error ? error.message : 'Could not export the application.');
|
|
55
|
+
process.exitCode = 1;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
38
58
|
if (command && 'command' in command && command.command === 'harness') {
|
|
39
59
|
const { runProjectCommand } = await import('./anyswarm-project.js');
|
|
40
60
|
process.exit(await runProjectCommand(command, process.cwd()));
|
|
@@ -44,6 +64,8 @@ else {
|
|
|
44
64
|
let report;
|
|
45
65
|
try {
|
|
46
66
|
const { recoverRuntime } = await import('../src/core/index.js');
|
|
67
|
+
const { installSourceLoader } = await import('../src/harness/typescript-loader.js');
|
|
68
|
+
installSourceLoader();
|
|
47
69
|
const module = await import(pathToFileURL(await realpath(resolve(command.configPath))).href);
|
|
48
70
|
const config = typeof module.default === 'function' ? await module.default() : module.default;
|
|
49
71
|
const runtime = await recoverRuntime({ ...config, runDirectory: command.directory, cleanupOnly: true });
|
|
@@ -61,7 +83,7 @@ else {
|
|
|
61
83
|
// one-shot command hands those back to the durable record on process exit.
|
|
62
84
|
process.stdout.write(JSON.stringify(report, null, 2) + '\n', () => process.exit(exitCode));
|
|
63
85
|
}
|
|
64
|
-
else if (command && 'command' in command) {
|
|
86
|
+
else if (command && 'command' in command && (command.command === 'setup' || command.command === 'doctor' || command.command === 'update')) {
|
|
65
87
|
const controller = new AbortController();
|
|
66
88
|
let signalCode;
|
|
67
89
|
const interrupt = (signal) => {
|
|
@@ -72,9 +94,12 @@ else {
|
|
|
72
94
|
process.on('SIGTERM', interrupt);
|
|
73
95
|
try {
|
|
74
96
|
const report = command.command === 'update'
|
|
75
|
-
? await (await import('./anyswarm-installation.js')).updateAnySwarm(
|
|
97
|
+
? await (await import('./anyswarm-installation.js')).updateAnySwarm(controller.signal)
|
|
76
98
|
: await (await import('./local-setup.js')).runLocalCommand(command, controller.signal, command.command === 'setup' || process.stderr.isTTY ? message => console.error(message) : undefined);
|
|
77
|
-
|
|
99
|
+
if (command.command === 'update' && process.stdout.isTTY)
|
|
100
|
+
console.log(report.detail);
|
|
101
|
+
else
|
|
102
|
+
console.log(JSON.stringify(report, null, 2));
|
|
78
103
|
process.exitCode = signalCode ?? (report.ok ? 0 : 1);
|
|
79
104
|
}
|
|
80
105
|
catch {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"commit":"070b025305af5dcb96a9df11b74e91ff5f786964","dirty":false}
|
package/dist/scripts/build.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import { chmod, cp, readdir, rm, stat } from 'node:fs/promises';
|
|
2
|
+
import { chmod, cp, readdir, rm, stat, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
const root = fileURLToPath(new URL('..', import.meta.url));
|
|
@@ -54,3 +54,9 @@ if (await stat(traceViewerSource).catch(error => {
|
|
|
54
54
|
for (const name of ['anyswarm', 'swarm']) {
|
|
55
55
|
await chmod(resolve(dist, `scripts/${name}.js`), 0o755);
|
|
56
56
|
}
|
|
57
|
+
const revision = spawnSync('git', ['rev-parse', 'HEAD'], { cwd: root, encoding: 'utf8' });
|
|
58
|
+
const status = spawnSync('git', ['status', '--porcelain'], { cwd: root, encoding: 'utf8' });
|
|
59
|
+
await writeFile(resolve(dist, 'scripts/build-provenance.json'), JSON.stringify({
|
|
60
|
+
commit: revision.status === 0 ? revision.stdout.trim() : null,
|
|
61
|
+
dirty: status.status === 0 ? Boolean(status.stdout.trim()) : null,
|
|
62
|
+
}) + '\n');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { PERSONAL_SCHEMA_SQL } from '../examples/super/inbox.js';
|
|
2
3
|
import { SERVICE_COMMIT_SCHEMA_SQL, CONTEXT_PEER_SCHEMA_SQL, JUDGE_PEER_SCHEMA_SQL } from '../examples/taskpool/persistence/service-peer-schema.js';
|
|
3
4
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
4
5
|
import { createHash } from 'node:crypto';
|
|
@@ -65,6 +66,7 @@ for (const source of sourcePaths.filter((path) => path.startsWith('src/core/')))
|
|
|
65
66
|
}
|
|
66
67
|
const { ALLOCATION_SCHEMA_SQL } = await import('../src/core/allocation-ledger.js');
|
|
67
68
|
const schemas = [
|
|
69
|
+
['Personal inbox, work and delivery', 'examples/super/inbox.ts', PERSONAL_SCHEMA_SQL],
|
|
68
70
|
['Core Runtime allocation ownership', 'src/core/allocation-ledger.ts', ALLOCATION_SCHEMA_SQL],
|
|
69
71
|
['Automatic service history', 'examples/taskpool/persistence/service-history.ts', SERVICE_HISTORY_SCHEMA_SQL],
|
|
70
72
|
['Task-owned independent service commit gates', 'examples/taskpool/persistence/service-peer-schema.ts', SERVICE_COMMIT_SCHEMA_SQL],
|
|
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
9
9
|
import vm from 'node:vm';
|
|
10
10
|
import { SETUP_PROFILE_PROMPT, SETUP_FOLLOW_UP } from './local-setup-smoke.js';
|
|
11
11
|
import { SETUP_BASH, SETUP_READ, SETUP_RESULT } from './local-setup-upstream.js';
|
|
12
|
-
import { rootPrompt, childPrompt } from '../examples/subagents/prompts/prompts.js';
|
|
12
|
+
import { rootPrompt, childPrompt, ownerInterventionText } from '../examples/subagents/prompts/prompts.js';
|
|
13
13
|
import { parentPromptFor, initialGoalFor } from '../test-support/subagents/communication-fixture-prompts.js';
|
|
14
14
|
import { AGENT_ROLES, buildCapabilityProfile } from '../test-support/taskpool-legacy/capability-profile.js';
|
|
15
15
|
import { AGENT_CONTINUATION_MESSAGE, AGENT_SOFT_CLOSEOUT_MESSAGE, AGENT_MATERIAL_CONTINUATION_MESSAGE, AGENT_MATERIAL_SOFT_CLOSEOUT_MESSAGE, buildAgentSoftCloseoutNotice, buildAgentNotification, agentServiceDirectory } from '../examples/taskpool/prompts/agent-contract.js';
|
|
@@ -30,7 +30,9 @@ assert.ok(args.length === 0 || (args.length === 1 && args[0] === '--check'), 'Us
|
|
|
30
30
|
const check = args[0] === '--check';
|
|
31
31
|
const sha256 = (text) => createHash('sha256').update(text).digest('hex');
|
|
32
32
|
const sourcePaths = [
|
|
33
|
+
'examples/super/prompts.ts', 'examples/super/execution.ts', 'examples/super/coordinator.ts',
|
|
33
34
|
'examples/taskpool/prompts/agent-contract.ts',
|
|
35
|
+
'examples/autoresearch/project.ts', 'examples/autoresearch/config.ts',
|
|
34
36
|
'examples/services/agent-control/run.ts', 'examples/services/agent-control/flow.sh', 'examples/services/persistent-board/run.ts',
|
|
35
37
|
'examples/services/mcp-managed/run.ts', 'examples/first-harness/harness.ts', 'examples/first-harness/handoff.ts',
|
|
36
38
|
'examples/parallel-swarm/harness.ts', 'examples/parallel-swarm/board-service.ts',
|
|
@@ -41,6 +43,7 @@ const sourcePaths = [
|
|
|
41
43
|
'scripts/local-setup-smoke.ts', 'scripts/local-setup-upstream.ts',
|
|
42
44
|
'examples/messages/handoff.ts',
|
|
43
45
|
'examples/notes/main.ts', 'examples/notes/notes.ts', 'examples/notes/project.ts', 'examples/taskpool/project.ts', 'src/harness/project-git.ts', 'src/harness/run-input.ts', 'examples/substrate/harness/index.ts', 'examples/substrate/services/substrate.ts',
|
|
46
|
+
'examples/code/prompts.ts',
|
|
44
47
|
'examples/taskpool/harness/controller.ts', 'examples/taskpool/harness/harness.ts',
|
|
45
48
|
'benchmarks/fate/fate-run.ts', 'benchmarks/fate/fate-service.ts', 'benchmarks/fate/paper-substrate.ts',
|
|
46
49
|
'benchmarks/putnambench-taskpool/run.ts',
|
|
@@ -90,6 +93,14 @@ function header(title, description) {
|
|
|
90
93
|
}
|
|
91
94
|
const outputs = new Map();
|
|
92
95
|
function output(file, text) { outputs.set(`${outputDir}/${file}`, `${text.trimEnd()}\n`); }
|
|
96
|
+
const researchSource = 'examples/autoresearch/project.ts';
|
|
97
|
+
let researchDoc = header('AutoResearch peer instructions', 'All peers receive the same Profile instructions. Their first native input uses the peer label, trusted configuration goal and the Run input. Each later turn uses a fixed nudge. An immutable patch can trigger a review notice by active steer or in the next regular input. The demo objective is also the default Run input.');
|
|
98
|
+
researchDoc += block('Shared Profile instruction', evaluate('`' + between(researchSource, 'const instructions = `', '`;') + '`', { candidatePath: '.anyswarm-candidate.patch' }));
|
|
99
|
+
researchDoc += block('Initial peer input', evaluate('`' + between(researchSource, '? `', '`\n', 'const prompt = turn === 0') + '`', { label: '<PEER_LABEL>', config: { goal: '<RESEARCH_GOAL>' }, context: { input: { prompt: '<RUN_INPUT>' } } }));
|
|
100
|
+
researchDoc += block('Follow-up peer input', between(researchSource, ": '", "';", "? `You are "));
|
|
101
|
+
researchDoc += block('Candidate review notice', evaluate('`' + between(researchSource, 'return `', '`;', 'function reviewNotice') + '`', { candidate: '<CANDIDATE_ID>', sha256: '<CANDIDATE_SHA256>' }));
|
|
102
|
+
researchDoc += block('FrontierCS-2 demo objective', between('examples/autoresearch/config.ts', "export const demoGoal = '", "';"));
|
|
103
|
+
output('22-autoresearch.md', researchDoc);
|
|
93
104
|
const registry = createBuiltinServiceRegistry();
|
|
94
105
|
const profile = buildCapabilityProfile({ registry, role: AGENT_ROLES.BOUND });
|
|
95
106
|
const mathlibBundle = await loadServiceBundle(resolve(root, 'examples/services/mathlib-search'));
|
|
@@ -175,6 +186,13 @@ output('10-local-setup-probe.md', header('Complete local setup probe texts', 'Se
|
|
|
175
186
|
+ block('Controlled read arguments', JSON.stringify({ path: SETUP_READ }, null, 2))
|
|
176
187
|
+ block('Controlled final text', SETUP_RESULT));
|
|
177
188
|
const notesPath = 'examples/notes/main.ts';
|
|
189
|
+
const codePrompts = 'examples/code/prompts.ts';
|
|
190
|
+
output('26-code.md', header('Code application prompts', 'The installed Code Harness stages a role prompt for the writable Root and each delegated editor. User inputs go to Root via runInput. The task property in the authenticated spawn_agent request supplies the child input. Starting with the second task, both receive the previous turn envelope. Root receives child results through wait_agent. The host sends the verification question only for a suggested command and an interactive owner client.')
|
|
191
|
+
+ block('Code Root Profile prompt', between(codePrompts, 'export const codeRootPrompt = `', '`;'))
|
|
192
|
+
+ block('Code editor Profile prompt', between(codePrompts, 'export const codeEditorPrompt = `', '`;'))
|
|
193
|
+
+ block('CLI Service hint', between(codePrompts, 'export const codeCliHint = `', '`;'), 'Appended to the role prompt when Service tools use the CLI, including Codex.')
|
|
194
|
+
+ block('Later Root and editor input', between(codePrompts, 'task: string) => `', '`;'), 'The host builds summary from the last recorded outcome, reason, affected paths and verification evidence, with limits on paths, command and output. The user task or delegate assignment supplies task.')
|
|
195
|
+
+ block('Verification confirmation', 'Run ' + between(codePrompts, '=> `Run ', '`;'), 'The interpolation is the suggested argv from the pre-edit local package.json or Makefile, joined for display.'));
|
|
178
196
|
const notesKey = between(notesPath, "const key = '", "';\n");
|
|
179
197
|
const notesInput = evaluate(between(notesPath, 'const inputText = Object.freeze(', ');\n'), { key: notesKey });
|
|
180
198
|
output('07-notes-harness.md', header('Installed Notes Harness prompts', 'The Writer and Reader use the default Core system prompt with their own Notes grants and an empty Added System Prompt. The host supplies three fixed user inputs through its exclusive input helper. The seeded fact enters the model transcript when a Agent reads its file or receives it in a Service result.')
|
|
@@ -197,6 +215,7 @@ const subagentsPath = 'test-support/subagents/communication-fixture-prompts.ts';
|
|
|
197
215
|
output('08-subagents-harness.md', header('Subagents Harness prompts', 'The ordinary Harness stages the Root and Child Profile prompts verbatim and sends user or model-authored task text through the collaboration controller. The separate communication fixture stages its own Profile prompts. It sends the default goal or configured goal and supplements through explicit followUp. Child round results are JSON snapshots composed in communication-fixture-controller.ts with childId, eventSeq, outcome, optional output/error and a terminal failure source. These variable fields originate in the accepted Core event, never latestOutput. Parent-created child and followup inputs are model-authored through Bash Agent Service requests.')
|
|
198
216
|
+ block('Root Profile prompt', rootPrompt)
|
|
199
217
|
+ block('Recursive Child Profile prompt', childPrompt)
|
|
218
|
+
+ ['steer', 'interrupt', 'stop'].map(operation => block(`Owner ${operation} notification`, ownerInterventionText(operation))).join('')
|
|
200
219
|
+ block('Pastel example initial task', evaluate(between('benchmarks/programbench-pastel/subagents-example.ts', 'const initial = ', ';\nconst supplement')))
|
|
201
220
|
+ block('Pastel example HSL supplement', evaluate(between('benchmarks/programbench-pastel/subagents-example.ts', 'const supplement = ', ';\nconst probes')))
|
|
202
221
|
+ block('Fixture Parent Profile prompt', evaluate(between(subagentsPath, 'export const parentPrompt = ', ';\n')))
|
|
@@ -346,7 +365,10 @@ output('18-agent-control.md', header('Built-in Agent control example prompt', 'T
|
|
|
346
365
|
const managedMcp = 'examples/services/mcp-managed/run.ts';
|
|
347
366
|
output('19-managed-mcp.md', header('Managed MCP and process example prompt', 'The Host creates the reader and sends one task through runInput. The reader receives only the two granted direct Service tools and no local tools.')
|
|
348
367
|
+ block('Reader task', between(managedMcp, "runInput(runtime, reader.id,\n '", "',")));
|
|
349
|
-
|
|
368
|
+
const personalPrompts = 'examples/super/prompts.ts';
|
|
369
|
+
output('21-personal.md', header('Personal Router and worker prompts', 'Personal uses a per-work Router Session. The Host sends the validated inbound request or a member result to the Router. Each member turn carries the assignment selected by the Router and the authorized paths.')
|
|
370
|
+
+ ['router', 'worker', 'reviewer'].map(role => block(role + ' Profile system prompt', evaluate(between(personalPrompts, `export const ${role}Prompt = `, ';\n')))).join(''));
|
|
371
|
+
for (const path of [candidateFirstHarnessPath, parallelHost, durableBoardPath, agentControl, managedMcp, 'examples/super/execution.ts']) {
|
|
350
372
|
for (const [index, line] of sources.get(path).split('\n').entries()) {
|
|
351
373
|
if (line.includes('runInput(runtime,'))
|
|
352
374
|
sendSites.push({ path, line: index + 1, expression: line.trim() });
|
|
@@ -40,6 +40,7 @@ export declare function resolveLocalEnvironment(partial?: Partial<LocalEnvironme
|
|
|
40
40
|
lifecycleBaseUrl: string;
|
|
41
41
|
apiKey: string | undefined;
|
|
42
42
|
advertiseHost: string | undefined;
|
|
43
|
+
advertiseHostDiscovery: "docker-network" | undefined;
|
|
43
44
|
publicUrl: string | undefined;
|
|
44
45
|
image: string | undefined;
|
|
45
46
|
useServerProxy: boolean | undefined;
|
|
@@ -61,6 +62,7 @@ export declare function resolveSubagentsEnvironment(config?: Partial<LocalEnviro
|
|
|
61
62
|
lifecycleBaseUrl: string;
|
|
62
63
|
apiKey: string | undefined;
|
|
63
64
|
advertiseHost: string | undefined;
|
|
65
|
+
advertiseHostDiscovery: "docker-network" | undefined;
|
|
64
66
|
publicUrl: string | undefined;
|
|
65
67
|
image: string | undefined;
|
|
66
68
|
useServerProxy: boolean | undefined;
|
|
@@ -78,24 +80,33 @@ export declare function resolveSubagentsEnvironment(config?: Partial<LocalEnviro
|
|
|
78
80
|
};
|
|
79
81
|
mode: "existing" | "local";
|
|
80
82
|
}>;
|
|
81
|
-
export declare function
|
|
83
|
+
export declare function checkSetupHost(): DiagnosticCheck[];
|
|
84
|
+
export declare function checkHostTools(signal: AbortSignal): Promise<DiagnosticCheck[]>;
|
|
82
85
|
export declare function resolveLocalDocker(): Promise<{
|
|
83
86
|
socket: string;
|
|
84
87
|
advertiseHost: string | undefined;
|
|
85
88
|
rootless: boolean;
|
|
89
|
+
clientVersion: string | undefined;
|
|
90
|
+
context: string | undefined;
|
|
91
|
+
engineVersion: string | undefined;
|
|
86
92
|
}>;
|
|
87
93
|
export declare function checkLocalDocker(): Promise<{
|
|
88
94
|
docker: {
|
|
89
95
|
socket: string;
|
|
90
96
|
advertiseHost: string | undefined;
|
|
91
97
|
rootless: boolean;
|
|
98
|
+
clientVersion: string | undefined;
|
|
99
|
+
context: string | undefined;
|
|
100
|
+
engineVersion: string | undefined;
|
|
92
101
|
};
|
|
93
102
|
diagnostic: DiagnosticCheck;
|
|
94
103
|
} | {
|
|
95
104
|
docker?: undefined;
|
|
96
105
|
diagnostic: DiagnosticCheck;
|
|
97
106
|
}>;
|
|
98
|
-
export declare function
|
|
107
|
+
export declare function discoverMacCallback(image: string, signal?: AbortSignal): Promise<string>;
|
|
108
|
+
export declare function checkLocalProvider(config: LocalEnvironmentConfig, { requireAuth, managed }?: {
|
|
109
|
+
managed?: boolean | undefined;
|
|
99
110
|
requireAuth?: boolean | undefined;
|
|
100
111
|
}): Promise<DiagnosticCheck[]>;
|
|
101
112
|
export declare function ensureLocalProvider(config: LocalEnvironmentConfig, { signal }?: {
|