@anyswarm/core 0.5.1 → 0.6.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/AGENTS.md +20 -5
- package/README.md +69 -55
- package/dist/examples/README.md +138 -77
- package/dist/examples/authoring/README.md +4 -4
- package/dist/examples/autoresearch/README.md +108 -16
- package/dist/examples/autoresearch/REQUIREMENTS.zh.md +13 -12
- package/dist/examples/autoresearch/config.d.ts +48 -5
- package/dist/examples/autoresearch/config.js +57 -23
- package/dist/examples/autoresearch/demo.d.ts +12 -4
- package/dist/examples/autoresearch/demo.js +65 -22
- package/dist/examples/autoresearch/eject.json +2 -0
- package/dist/examples/autoresearch/frontiercs2-config.d.ts +2 -0
- package/dist/examples/autoresearch/frontiercs2-config.js +14 -0
- package/dist/examples/autoresearch/frontiercs2.d.ts +18 -1
- package/dist/examples/autoresearch/frontiercs2.js +71 -14
- package/dist/examples/autoresearch/prepare-demo.d.ts +1 -0
- package/dist/examples/autoresearch/prepare-demo.js +46 -0
- package/dist/examples/autoresearch/prepare.d.ts +105 -53
- package/dist/examples/autoresearch/prepare.js +126 -57
- package/dist/examples/autoresearch/project.d.ts +6 -95
- package/dist/examples/autoresearch/project.js +131 -45
- package/dist/examples/autoresearch/research-service.d.ts +16 -1
- package/dist/examples/autoresearch/research-service.js +84 -44
- package/dist/examples/code/README.md +25 -17
- package/dist/examples/code/REQUIREMENTS.zh.md +3 -3
- package/dist/examples/code/config.d.ts +1 -0
- package/dist/examples/first-harness/AGENTS.md +25 -0
- package/dist/examples/first-harness/README.md +136 -0
- package/dist/examples/first-harness/config.d.ts +9 -8
- package/dist/examples/first-harness/config.js +33 -26
- package/dist/examples/first-harness/eject.json +14 -0
- package/dist/examples/first-harness/handoff.js +3 -3
- package/dist/examples/first-harness/harness.d.ts +14 -18
- package/dist/examples/first-harness/harness.js +102 -77
- package/dist/examples/first-harness/input/README.md +7 -0
- package/dist/examples/first-harness/session.js +2 -1
- package/dist/examples/first-harness/tsconfig.json +2 -1
- package/dist/examples/harness-session/README.md +4 -4
- package/dist/examples/lead-worker/README.md +1 -1
- package/dist/examples/lead-worker/project-config.d.ts +1 -0
- package/dist/examples/messages/README.md +2 -2
- package/dist/examples/notes/README.md +5 -5
- package/dist/examples/notes/config.d.ts +1 -0
- package/dist/examples/parallel-swarm/AGENTS.md +32 -0
- package/dist/examples/parallel-swarm/README.md +136 -0
- package/dist/examples/parallel-swarm/board-service.js +25 -8
- package/dist/examples/parallel-swarm/board.d.ts +31 -1
- package/dist/examples/parallel-swarm/board.js +98 -13
- package/dist/examples/parallel-swarm/config.d.ts +11 -0
- package/dist/examples/parallel-swarm/config.js +39 -0
- package/dist/examples/parallel-swarm/eject.json +5 -0
- package/dist/examples/parallel-swarm/harness.d.ts +26 -20
- package/dist/examples/parallel-swarm/harness.js +77 -76
- package/dist/examples/parallel-swarm/report.d.ts +12 -0
- package/dist/examples/parallel-swarm/report.js +30 -0
- package/dist/examples/peermesh/README.md +1 -1
- package/dist/examples/peermesh/project-config.d.ts +1 -0
- package/dist/examples/services/agent-control/README.md +1 -1
- package/dist/examples/services/mathlib-search/README.md +1 -1
- package/dist/examples/services/mcp-managed/README.md +1 -1
- package/dist/examples/services/persistent-board/README.md +6 -3
- package/dist/examples/subagents/AGENTS.md +35 -0
- package/dist/examples/subagents/README.md +129 -93
- package/dist/examples/subagents/config.d.ts +2 -10
- package/dist/examples/subagents/config.js +9 -16
- package/dist/examples/subagents/eject.json +17 -0
- package/dist/examples/subagents/handoff-config.d.ts +41 -0
- package/dist/examples/subagents/handoff-config.js +13 -0
- package/dist/examples/subagents/model.d.ts +3 -0
- package/dist/examples/subagents/model.js +19 -0
- package/dist/examples/substrate/README.md +12 -6
- package/dist/examples/substrate/config.d.ts +1 -0
- package/dist/examples/substrate/project-config.d.ts +1 -0
- package/dist/examples/super/README.md +34 -22
- package/dist/examples/super/actions.d.ts +1 -1
- package/dist/examples/super/actions.js +11 -11
- package/dist/examples/super/config.js +3 -3
- package/dist/examples/super/eject.json +1 -1
- package/dist/examples/super/location.js +1 -1
- package/dist/examples/super/operator.d.ts +1 -0
- package/dist/examples/super/operator.js +31 -0
- package/dist/examples/super/project.d.ts +0 -107
- package/dist/examples/super/project.js +1 -3
- package/dist/examples/taskpool/README.md +1 -1
- package/dist/examples/taskpool/config.d.ts +1 -0
- package/dist/examples/taskpool/deploy/service-hosts/service-authority-snapshot.d.ts +4 -4
- package/dist/scripts/anyswarm-arguments.d.ts +7 -25
- package/dist/scripts/anyswarm-arguments.js +69 -97
- package/dist/scripts/anyswarm-eject.js +1 -1
- package/dist/scripts/anyswarm-harnesses.d.ts +0 -1
- package/dist/scripts/anyswarm-harnesses.js +1 -22
- package/dist/scripts/anyswarm-installation.d.ts +7 -40
- package/dist/scripts/anyswarm-installation.js +17 -291
- package/dist/scripts/anyswarm-launch.d.ts +6 -36
- package/dist/scripts/anyswarm-launch.js +32 -81
- package/dist/scripts/anyswarm-progress.d.ts +6 -0
- package/dist/scripts/anyswarm-progress.js +133 -0
- package/dist/scripts/anyswarm-project.d.ts +1 -9
- package/dist/scripts/anyswarm-project.js +40 -127
- package/dist/scripts/anyswarm-source-runner.js +9 -41
- package/dist/scripts/anyswarm.js +6 -26
- package/dist/scripts/build-provenance.json +1 -1
- package/dist/scripts/generate-architecture-coverage.js +1 -1
- package/dist/scripts/generate-architecture-prompts.js +18 -10
- package/dist/scripts/local-environment.d.ts +13 -7
- package/dist/scripts/local-environment.js +73 -21
- package/dist/scripts/local-setup.d.ts +3 -0
- package/dist/scripts/local-setup.js +153 -118
- package/dist/scripts/pack-release.js +31 -4
- package/dist/src/core/index.js +1 -1
- package/dist/src/core/sandbox/opensandbox-backend.js +10 -4
- package/dist/src/core/sandbox/sandbox-connection.d.ts +9 -2
- package/dist/src/core/sandbox/sandbox-connection.js +22 -7
- package/dist/src/core/worker-image.js +1 -1
- package/dist/src/harness/project-harness.d.ts +1 -0
- package/dist/src/harness/project-harness.js +5 -4
- package/dist/src/harness/project-rpc-client.js +19 -0
- package/dist/src/harness/project-runtime.js +3 -1
- package/dist/src/harness/typescript-loader.d.ts +2 -0
- package/dist/src/harness/typescript-loader.js +26 -8
- package/dist/src/trace-viewer/command.mjs +6 -3
- package/dist/src/trace-viewer/public/app.js +239 -59
- package/dist/src/trace-viewer/public/index.html +5 -0
- package/dist/src/trace-viewer/public/style.css +22 -0
- package/dist/src/trace-viewer/reader.mjs +242 -26
- package/dist/src/trace-viewer/run-root.d.mts +1 -0
- package/dist/src/trace-viewer/run-root.mjs +7 -0
- package/dist/src/trace-viewer/server.mjs +3 -1
- package/docs/INDEX.md +11 -9
- package/docs/architecture/04-services.md +1 -1
- package/docs/architecture/06-observability-experiments.md +21 -7
- package/docs/architecture/07-run-configuration.md +118 -19
- package/docs/architecture/08-prompts.md +21 -2
- package/docs/architecture/10-service-api-reference.md +12 -5
- package/docs/architecture/12-code-coverage.md +157 -115
- package/docs/architecture/15-core-runtime.md +1 -1
- package/docs/architecture/16-pi-opensandbox-backend.md +2 -0
- package/docs/architecture/17-harness-reporting.md +79 -1
- package/docs/architecture/22-website.md +52 -20
- package/docs/architecture/23-project-harness.md +109 -37
- package/docs/architecture/26-code.md +20 -5
- package/docs/architecture/27-personal.md +23 -8
- package/docs/architecture/28-autoresearch.md +18 -12
- package/docs/architecture/INDEX.md +1 -2
- package/docs/architecture/prompts/11-first-sdk-harness.md +9 -9
- package/docs/architecture/prompts/16-parallel-swarm.md +46 -13
- package/docs/architecture/prompts/22-autoresearch.md +9 -2
- package/docs/architecture/prompts/source-manifest.json +76 -52
- package/docs/architecture/source-map.json +445 -105
- package/docs/designs/core-harness/01-core.md +2 -2
- package/docs/designs/core-harness/06-project-harness.md +3 -3
- package/docs/designs/core-harness/README.md +2 -2
- package/docs/en/agents.md +1 -1
- package/docs/en/autoresearch.md +41 -0
- package/docs/en/blog/100b-tokens.md +157 -0
- package/docs/en/build-your-harness.md +47 -22
- package/docs/en/changelog.md +29 -1
- package/docs/en/first-harness.md +40 -32
- package/docs/en/harnesses/index.md +23 -23
- package/docs/en/harnesses/lead-worker.md +1 -1
- package/docs/en/harnesses/peermesh.md +2 -2
- package/docs/en/harnesses/subagents.md +10 -31
- package/docs/en/harnesses/substrate.md +4 -4
- package/docs/en/harnesses/taskpool.md +2 -2
- package/docs/en/latest.md +30 -5
- package/docs/en/overview.md +22 -22
- package/docs/en/quickstart.md +69 -56
- package/docs/en/reference/api.md +1 -1
- package/docs/en/reference/cli.md +47 -85
- package/docs/en/sandbox.md +3 -3
- package/docs/en/trace-viewer.md +32 -12
- package/docs/operations/trace-viewer.md +26 -11
- package/docs/third-party-notices.md +0 -1
- package/docs/workflows/development.md +160 -118
- package/docs/workflows/release-and-docs-versioning.md +207 -54
- package/docs/workflows/release-cli-acceptance.md +162 -0
- package/docs/zh/agents.md +1 -1
- package/docs/zh/autoresearch.md +41 -0
- package/docs/zh/blog/100b-tokens.md +102 -0
- package/docs/zh/build-your-harness.md +48 -23
- package/docs/zh/changelog.md +29 -1
- package/docs/zh/first-harness.md +43 -35
- package/docs/zh/harnesses/index.md +23 -23
- package/docs/zh/harnesses/lead-worker.md +1 -1
- package/docs/zh/harnesses/peermesh.md +2 -2
- package/docs/zh/harnesses/subagents.md +10 -31
- package/docs/zh/harnesses/substrate.md +4 -4
- package/docs/zh/harnesses/taskpool.md +2 -2
- package/docs/zh/latest.md +30 -5
- package/docs/zh/overview.md +23 -23
- package/docs/zh/quickstart.md +66 -57
- package/docs/zh/reference/api.md +1 -1
- package/docs/zh/reference/cli.md +19 -79
- package/docs/zh/sandbox.md +3 -3
- package/docs/zh/trace-viewer.md +32 -12
- package/examples/README.md +138 -77
- package/examples/authoring/README.md +4 -4
- package/examples/autoresearch/README.md +108 -16
- package/examples/autoresearch/REQUIREMENTS.zh.md +13 -12
- package/examples/autoresearch/config.ts +64 -25
- package/examples/autoresearch/demo.ts +75 -22
- package/examples/autoresearch/eject.json +2 -0
- package/examples/autoresearch/frontiercs2-config.ts +15 -0
- package/examples/autoresearch/frontiercs2.ts +64 -11
- package/examples/autoresearch/prepare-demo.ts +44 -0
- package/examples/autoresearch/prepare.ts +134 -60
- package/examples/autoresearch/project.ts +120 -44
- package/examples/autoresearch/research-service.ts +91 -41
- package/examples/code/README.md +25 -17
- package/examples/code/REQUIREMENTS.zh.md +3 -3
- package/examples/first-harness/AGENTS.md +25 -0
- package/examples/first-harness/README.md +136 -0
- package/examples/first-harness/config.ts +41 -27
- package/examples/first-harness/eject.json +14 -0
- package/examples/first-harness/handoff.ts +3 -3
- package/examples/first-harness/harness.ts +104 -72
- package/examples/first-harness/input/README.md +7 -0
- package/examples/first-harness/session.ts +2 -1
- package/examples/first-harness/tsconfig.json +2 -1
- package/examples/harness-session/README.md +4 -4
- package/examples/lead-worker/README.md +1 -1
- package/examples/messages/README.md +2 -2
- package/examples/notes/README.md +5 -5
- package/examples/parallel-swarm/AGENTS.md +32 -0
- package/examples/parallel-swarm/README.md +136 -0
- package/examples/parallel-swarm/board-service.ts +28 -9
- package/examples/parallel-swarm/board.ts +107 -13
- package/examples/parallel-swarm/config.ts +47 -0
- package/examples/parallel-swarm/eject.json +5 -0
- package/examples/parallel-swarm/harness.ts +83 -71
- package/examples/parallel-swarm/report.ts +33 -0
- package/examples/peermesh/README.md +1 -1
- package/examples/services/agent-control/README.md +1 -1
- package/examples/services/mathlib-search/README.md +1 -1
- package/examples/services/mcp-managed/README.md +1 -1
- package/examples/services/persistent-board/README.md +6 -3
- package/examples/subagents/AGENTS.md +35 -0
- package/examples/subagents/README.md +129 -93
- package/examples/subagents/config.ts +9 -15
- package/examples/subagents/eject.json +17 -0
- package/examples/subagents/handoff-config.ts +14 -0
- package/examples/subagents/model.ts +20 -0
- package/examples/substrate/README.md +12 -6
- package/examples/super/README.md +34 -22
- package/examples/super/actions.ts +11 -11
- package/examples/super/config.ts +3 -3
- package/examples/super/eject.json +1 -1
- package/examples/super/location.ts +1 -1
- package/examples/super/operator.ts +28 -0
- package/examples/super/project.ts +1 -3
- package/examples/taskpool/README.md +1 -1
- package/npm-shrinkwrap.development.json +46 -1538
- package/npm-shrinkwrap.json +10 -43
- package/package.development.json +3 -6
- package/package.json +3 -5
- package/scripts/anyswarm-arguments.ts +67 -96
- package/scripts/anyswarm-eject.ts +1 -1
- package/scripts/anyswarm-harnesses.ts +1 -18
- package/scripts/anyswarm-installation.ts +18 -294
- package/scripts/anyswarm-launch.ts +30 -102
- package/scripts/anyswarm-progress.ts +125 -0
- package/scripts/anyswarm-project.ts +31 -123
- package/scripts/anyswarm-source-runner.ts +9 -36
- package/scripts/anyswarm.ts +4 -24
- package/scripts/generate-architecture-coverage.ts +1 -1
- package/scripts/generate-architecture-prompts.ts +21 -10
- package/scripts/local-environment.ts +79 -21
- package/scripts/local-setup.ts +150 -105
- package/scripts/pack-release.ts +28 -4
- package/src/core/index.ts +1 -1
- package/src/core/sandbox/opensandbox-backend.ts +10 -4
- package/src/core/sandbox/sandbox-connection.ts +22 -7
- package/src/core/worker-image.ts +1 -1
- package/src/harness/project-harness.ts +5 -4
- package/src/harness/project-rpc-client.ts +23 -0
- package/src/harness/project-runtime.ts +2 -1
- package/src/harness/typescript-loader.ts +28 -8
- package/src/trace-viewer/command.mjs +6 -3
- package/src/trace-viewer/public/app.js +239 -59
- package/src/trace-viewer/public/index.html +5 -0
- package/src/trace-viewer/public/style.css +22 -0
- package/src/trace-viewer/reader.mjs +242 -26
- package/src/trace-viewer/run-root.d.mts +1 -0
- package/src/trace-viewer/run-root.mjs +7 -0
- package/src/trace-viewer/server.mjs +3 -1
- package/dist/scripts/anyswarm-applications.d.ts +0 -19
- package/dist/scripts/anyswarm-applications.js +0 -19
- package/dist/scripts/anyswarm-tui-config.d.ts +0 -36
- package/dist/scripts/anyswarm-tui-config.js +0 -189
- package/dist/scripts/anyswarm-tui-session.d.ts +0 -66
- package/dist/scripts/anyswarm-tui-session.js +0 -304
- package/dist/scripts/anyswarm-tui-terminal.d.ts +0 -41
- package/dist/scripts/anyswarm-tui-terminal.js +0 -154
- package/dist/scripts/anyswarm-tui.d.ts +0 -2
- package/dist/scripts/anyswarm-tui.js +0 -1012
- package/docs/architecture/25-foreground-tui.md +0 -51
- package/scripts/anyswarm-applications.ts +0 -39
- package/scripts/anyswarm-tui-config.ts +0 -174
- package/scripts/anyswarm-tui-session.ts +0 -295
- package/scripts/anyswarm-tui-terminal.ts +0 -147
- package/scripts/anyswarm-tui.ts +0 -912
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { workerImageFor, resolveSandboxConnection } from '@anyswarm/core';
|
|
2
|
-
|
|
3
|
-
for (const name of names) {
|
|
4
|
-
const value = process.env[name];
|
|
5
|
-
if (value)
|
|
6
|
-
return value;
|
|
7
|
-
}
|
|
8
|
-
throw new Error(`Set ${names.join(' or ')} before running the Subagents Harness`);
|
|
9
|
-
}
|
|
1
|
+
import { workerImageFor, resolveSandboxConnection, ProjectPreflightError } from '@anyswarm/core';
|
|
2
|
+
import { readSubagentsModel } from './model.js';
|
|
10
3
|
const { image, advertiseHost, publicUrl, endpointSource: _endpointSource, executor: setupExecutor, ...sandbox } = resolveSandboxConnection({}, 'SUBAGENTS');
|
|
11
|
-
const upstream = required('ANYSWARM_MODEL_URL', 'ANYSWARM_SUBAGENTS_MODEL_URL');
|
|
12
|
-
const token = process.env.ANYSWARM_MODEL_TOKEN ?? process.env.ANYSWARM_SUBAGENTS_MODEL_TOKEN;
|
|
13
4
|
const executor = process.env.ANYSWARM_EXECUTOR ?? process.env.ANYSWARM_SUBAGENTS_EXECUTOR ?? setupExecutor ?? 'pi';
|
|
14
|
-
const
|
|
15
|
-
|
|
5
|
+
const route = readSubagentsModel(executor);
|
|
6
|
+
if (!route) {
|
|
7
|
+
throw new ProjectPreflightError('INVALID_RUN_CONFIGURATION', executor === 'codex'
|
|
8
|
+
? 'Set ANYSWARM_MODEL_URL and ANYSWARM_MODEL_ID (or their ANYSWARM_SUBAGENTS_ equivalents) before running the Subagents Harness with Codex.'
|
|
9
|
+
: 'Set ANYSWARM_MODEL_URL or ANYSWARM_SUBAGENTS_MODEL_URL before running the Subagents Harness.');
|
|
10
|
+
}
|
|
16
11
|
export default {
|
|
17
12
|
model: 'default',
|
|
18
13
|
maxAgents: Number(process.env.ANYSWARM_SUBAGENTS_MAX_AGENTS ?? 4),
|
|
@@ -30,7 +25,5 @@ export default {
|
|
|
30
25
|
connection: { publicUrl, advertiseHost,
|
|
31
26
|
modelGateway: { requestTimeoutMs: 25_000, maxOutputTokens: executor === 'codex' ? null : 2048 },
|
|
32
27
|
},
|
|
33
|
-
models: { default:
|
|
34
|
-
url: upstream, headers: token ? { authorization: `Bearer ${token}` } : {},
|
|
35
|
-
} } },
|
|
28
|
+
models: { default: route },
|
|
36
29
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiVersion": 1,
|
|
3
|
+
"entry": "project.ts",
|
|
4
|
+
"files": [
|
|
5
|
+
"project.ts",
|
|
6
|
+
"business.ts",
|
|
7
|
+
"config.ts",
|
|
8
|
+
"model.ts",
|
|
9
|
+
"handoff-config.ts",
|
|
10
|
+
"main.ts",
|
|
11
|
+
"harness/controller.ts",
|
|
12
|
+
"services/collaboration-service.ts",
|
|
13
|
+
"prompts/prompts.ts",
|
|
14
|
+
"README.md",
|
|
15
|
+
"AGENTS.md"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
model: string;
|
|
3
|
+
image: string;
|
|
4
|
+
outputDir: string;
|
|
5
|
+
executor: string;
|
|
6
|
+
sandbox: {
|
|
7
|
+
lifecycleBaseUrl: string;
|
|
8
|
+
apiKey: string | undefined;
|
|
9
|
+
useServerProxy: boolean | undefined;
|
|
10
|
+
egressMode: "dns+nft" | undefined;
|
|
11
|
+
endpointHost: undefined;
|
|
12
|
+
preparedImage?: string | undefined;
|
|
13
|
+
resourceLimits: {
|
|
14
|
+
cpu: string;
|
|
15
|
+
memory: string;
|
|
16
|
+
};
|
|
17
|
+
commandTimeoutMs: number;
|
|
18
|
+
};
|
|
19
|
+
models: {
|
|
20
|
+
default: import("@anyswarm/core").ModelConfig;
|
|
21
|
+
};
|
|
22
|
+
maxAgents: number;
|
|
23
|
+
maxDepth: number;
|
|
24
|
+
workTimeoutMs: number;
|
|
25
|
+
closeTimeoutMs: number;
|
|
26
|
+
connection: {
|
|
27
|
+
publicUrl: string | undefined;
|
|
28
|
+
advertiseHost: string | undefined;
|
|
29
|
+
modelGateway: {
|
|
30
|
+
maxOutputTokens: number | null;
|
|
31
|
+
requestTimeoutMs: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
collect: {
|
|
35
|
+
paths: string[];
|
|
36
|
+
includeGit: boolean;
|
|
37
|
+
maxBytes: number;
|
|
38
|
+
required: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import defaults from './config.js';
|
|
2
|
+
export default {
|
|
3
|
+
...defaults,
|
|
4
|
+
maxAgents: 3,
|
|
5
|
+
maxDepth: 1,
|
|
6
|
+
workTimeoutMs: 360_000,
|
|
7
|
+
closeTimeoutMs: 60_000,
|
|
8
|
+
connection: {
|
|
9
|
+
...defaults.connection,
|
|
10
|
+
modelGateway: { ...defaults.connection.modelGateway, requestTimeoutMs: 70_000 },
|
|
11
|
+
},
|
|
12
|
+
collect: { paths: ['report.md'], includeGit: false, maxBytes: 1024 * 1024, required: true },
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ProjectPreflightError } from '@anyswarm/core';
|
|
2
|
+
/** Read the built-in Subagents route without reading Sandbox state or contacting a provider. */
|
|
3
|
+
export function readSubagentsModel(executor) {
|
|
4
|
+
const env = process.env;
|
|
5
|
+
const setting = (name) => env[`ANYSWARM_${name}`] ?? env[`ANYSWARM_SUBAGENTS_${name}`];
|
|
6
|
+
const url = env.ANYSWARM_MODEL_URL || env.ANYSWARM_SUBAGENTS_MODEL_URL;
|
|
7
|
+
const model = env.ANYSWARM_MODEL_ID || env.ANYSWARM_SUBAGENTS_MODEL_ID || (executor === 'codex' ? undefined : 'gpt-5.4');
|
|
8
|
+
if (!url || !model)
|
|
9
|
+
return undefined;
|
|
10
|
+
const protocol = setting('MODEL_PROTOCOL') ?? 'responses';
|
|
11
|
+
if (protocol !== 'responses' && protocol !== 'chat-completions') {
|
|
12
|
+
throw new ProjectPreflightError('INVALID_RUN_CONFIGURATION', 'Set ANYSWARM_MODEL_PROTOCOL or ANYSWARM_SUBAGENTS_MODEL_PROTOCOL to responses or chat-completions.');
|
|
13
|
+
}
|
|
14
|
+
const token = setting('MODEL_TOKEN');
|
|
15
|
+
return {
|
|
16
|
+
provider: setting('MODEL_PROVIDER') ?? 'openai', model, protocol,
|
|
17
|
+
upstream: { url, headers: token ? { authorization: `Bearer ${token}` } : {} },
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -21,7 +21,7 @@ repository sources.
|
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
npm init -y
|
|
24
|
-
npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.
|
|
24
|
+
npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.2}"
|
|
25
25
|
npm install --save-dev typescript @types/node
|
|
26
26
|
sdk=node_modules/@anyswarm/core
|
|
27
27
|
cp -R "$sdk"/examples/substrate demo
|
|
@@ -62,15 +62,21 @@ substrate Service owns publication permissions, ranking and persistence. See the
|
|
|
62
62
|
`main.ts` remains the entry for fixed-question fixtures, saved-result inspection
|
|
63
63
|
for ordinary Substrate. `config.ts` is its fixed-question configuration and
|
|
64
64
|
requires `ANYSWARM_SUBSTRATE_RUN`; it is not the input to the normal project command.
|
|
65
|
-
From
|
|
65
|
+
From `examples/substrate` in the source checkout after building the root:
|
|
66
66
|
|
|
67
67
|
```sh
|
|
68
|
-
../../
|
|
69
|
-
../../
|
|
68
|
+
node ../../dist/scripts/anyswarm.js run ./main.ts --help
|
|
69
|
+
node ../../dist/scripts/anyswarm.js run ./main.ts ./config.ts
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
For an installed package, run its CLI from the consumer project and use the
|
|
73
|
+
matching source files in that package:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
node_modules/.bin/anyswarm run node_modules/@anyswarm/core/examples/substrate/main.ts \
|
|
77
|
+
node_modules/@anyswarm/core/examples/substrate/config.ts
|
|
70
78
|
```
|
|
71
79
|
|
|
72
|
-
For an installed package, replace `../../dist/examples/substrate` with
|
|
73
|
-
the `dist/examples/substrate` directory inside the SDK you installed.
|
|
74
80
|
Keep the shipped modules in their installed location because their relative
|
|
75
81
|
imports are part of the package. `--result <run-directory> --runtime-id <id>`
|
|
76
82
|
reads saved reports without loading model credentials.
|
|
@@ -4,37 +4,49 @@ Personal receives GitHub Issue and linked PR requests in the background. The use
|
|
|
4
4
|
|
|
5
5
|
## Connect and start
|
|
6
6
|
|
|
7
|
-
Use Node.js 22.19 or later, Git and an existing Pi/OpenSandbox connection. Run `
|
|
7
|
+
Use Node.js 22.19 or later, Git and an existing Pi/OpenSandbox connection. Run `anyswarm setup --backend pi` for host setup. This candidate's end-to-end acceptance uses Linux. Set `ANYSWARM_MODEL_URL` to the full Responses endpoint and `ANYSWARM_MODEL_ID` to the model ID. Optional `ANYSWARM_MODEL_PROVIDER`, `ANYSWARM_MODEL_TOKEN` and `ANYSWARM_MODEL_HEADERS_JSON` follow the model provider. For a reasoning model outside the built-in model catalog, set `ANYSWARM_MODEL_REASONING=true`. Keep credentials in the host environment or credential manager.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Export the SDK example and install its pinned dependencies. Run the operator
|
|
10
|
+
from the same launch directory for each command.
|
|
10
11
|
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
```sh
|
|
13
|
+
anyswarm eject super --dir ./personal-src
|
|
14
|
+
cd ./personal-src
|
|
15
|
+
npm install
|
|
16
|
+
npm exec -- anyswarm run ./operator.ts setup --repo owner/project --path README.md
|
|
17
|
+
npm exec -- anyswarm run ./operator.ts start
|
|
18
|
+
npm exec -- anyswarm run ./operator.ts jobs
|
|
15
19
|
```
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
Setup can infer the repository from a GitHub `origin`. It defaults to the
|
|
22
|
+
authenticated GitHub login and `README.md`. Use repeated `--user` or `--path` to
|
|
23
|
+
allow other logins or up to eight existing UTF-8 files. Set
|
|
24
|
+
`ANYSWARM_SUPER_GITHUB_TOKEN` or use an existing GitHub CLI login. Allow Issues
|
|
25
|
+
and Pull requests read/write and Contents read. Draft PR publication also
|
|
26
|
+
needs Contents and Pull requests write. Setup verifies identity, reads, Pi and
|
|
27
|
+
local model configuration. The first real work item verifies Worker and model
|
|
28
|
+
connectivity. `jobs` and `logs` show the last background failure and its repair hint.
|
|
20
29
|
|
|
21
30
|
## Work with the Router
|
|
22
31
|
|
|
23
|
-
Post `/super Update the installation instructions` on an Issue in scope
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
Post `/super Update the installation instructions` on an Issue in scope, or run
|
|
33
|
+
`npm exec -- anyswarm run ./operator.ts ask '#123' Update the installation instructions`.
|
|
34
|
+
GitHub follows the original Issue or its bound Draft PR. Use the same operator
|
|
35
|
+
with `jobs '#123'` to view status, artifacts and decisions, `answer '#123' <text>`
|
|
36
|
+
to respond, `approve '#123'` to publish, or `reject '#123' [reason]` to decline.
|
|
37
|
+
An unambiguous work ID prefix also works. Setup's `--publish` opts into automatic
|
|
38
|
+
publication.
|
|
26
39
|
|
|
27
|
-
|
|
40
|
+
Use `stop-work <work>` to stop one item, `logs` for the daemon log path, and
|
|
41
|
+
`npm exec -- anyswarm run ./operator.ts stop` to stop the daemon and wait for
|
|
42
|
+
its cleanup receipt. Use `anyswarm trace --root <state-directory>/runs` to
|
|
43
|
+
inspect Runtime records. The daemon keeps running between operator commands.
|
|
28
44
|
|
|
29
45
|
State is keyed by the launch directory and lives under `$XDG_STATE_HOME/anyswarm/personal` or `~/.local/state/anyswarm/personal`. To reuse state across launch directories, set `ANYSWARM_SUPER_STATE_DIR` to the same absolute, private path. Stop an older candidate before starting a new version against its state. A restart retains tasks, verified artifacts, decisions and pending replies. Unknown GitHub mutations are reconciled by identity. Personal reads a newly linked PR's comments even if it has already advanced the repository cursor during recovery. The original Sandbox can require cleanup after a crash. Same-host recovery uses the original Worker-reachable address and `ANYSWARM_SUPER_CALLBACK_PORT` when set.
|
|
30
46
|
|
|
31
|
-
##
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
anys eject super --dir ./personal-src
|
|
35
|
-
cd ./personal-src
|
|
36
|
-
npm install
|
|
37
|
-
npm run start
|
|
38
|
-
```
|
|
47
|
+
## SDK clients
|
|
39
48
|
|
|
40
|
-
|
|
49
|
+
Import the exported `project.ts` into an application or use `observe` from
|
|
50
|
+
`daemon.ts` to connect to a running Personal daemon via `HarnessRpcClient`.
|
|
51
|
+
The SDK client can receive live questions and send answers by ID. The
|
|
52
|
+
operator commands and SDK use the same persisted Inbox and ownership lock.
|
|
@@ -44,7 +44,7 @@ declare function jobs({ args, cwd, signal }: ActionContext): Promise<{
|
|
|
44
44
|
log: string;
|
|
45
45
|
}>;
|
|
46
46
|
export declare function personalActions(definition: Harness): {
|
|
47
|
-
setup: ({ args, cwd, signal }: ActionContext) => Promise<"Configure GitHub with
|
|
47
|
+
setup: ({ args, cwd, signal }: ActionContext) => Promise<"Configure GitHub with operator.ts setup --repo owner/repo [--path README.md] [--user login] [--publish]." | {
|
|
48
48
|
configured: boolean;
|
|
49
49
|
source: string;
|
|
50
50
|
account: string;
|
|
@@ -27,7 +27,7 @@ async function setup(args, cwd, directory, shutdown) {
|
|
|
27
27
|
catch { /* A local Git checkout is optional. */ }
|
|
28
28
|
const repository = values.repo ?? guessed;
|
|
29
29
|
if (!repository)
|
|
30
|
-
return 'Configure GitHub with
|
|
30
|
+
return 'Configure GitHub with operator.ts setup --repo owner/repo [--path README.md] [--user login] [--publish].';
|
|
31
31
|
const paths = values.path?.length ? [...new Set(values.path)] : ['README.md'];
|
|
32
32
|
const publish = values.publish ?? false;
|
|
33
33
|
if (paths.length > 8 || paths.some(path => !safePath(path) || path === 'personal-output.patch')) {
|
|
@@ -87,7 +87,7 @@ async function setup(args, cwd, directory, shutdown) {
|
|
|
87
87
|
publicationWrite: repo.permissions?.push === false ? 'repository-push-denied' : 'unverified' },
|
|
88
88
|
requiredPermissions: publish ? 'Issues and Pull requests: read/write; Contents: read/write'
|
|
89
89
|
: 'Issues and Pull requests: read/write; Contents: read',
|
|
90
|
-
verification: 'After the backend configuration is valid,
|
|
90
|
+
verification: 'After the backend configuration is valid, start initializes the Runtime. A real work item verifies Worker, model and reply connectivity. An approved publication verifies PR write access.' };
|
|
91
91
|
}
|
|
92
92
|
function directoryFor(cwd) {
|
|
93
93
|
const directory = stateDirectory(cwd);
|
|
@@ -121,9 +121,9 @@ async function start(cwd, directory, signal) {
|
|
|
121
121
|
let exited = false;
|
|
122
122
|
try {
|
|
123
123
|
const cli = fileURLToPath(new URL('../../scripts/anyswarm.js', import.meta.resolve('@anyswarm/core')));
|
|
124
|
-
const project = fileURLToPath(new URL('./
|
|
125
|
-
const entry = existsSync(project) ? project : fileURLToPath(new URL('./
|
|
126
|
-
const child = spawn(process.execPath, [cli, '
|
|
124
|
+
const project = fileURLToPath(new URL('./operator.js', import.meta.url));
|
|
125
|
+
const entry = existsSync(project) ? project : fileURLToPath(new URL('./operator.ts', import.meta.url));
|
|
126
|
+
const child = spawn(process.execPath, [cli, 'run', entry, 'serve'], {
|
|
127
127
|
cwd, detached: true, stdio: ['ignore', log, log],
|
|
128
128
|
env: { ...process.env, ANYSWARM_PERSONAL_DAEMON: '1', ANYSWARM_SUPER_STATE_DIR: directory, ANYSWARM_PERSONAL_LAUNCH: launchId },
|
|
129
129
|
});
|
|
@@ -159,8 +159,8 @@ async function start(cwd, directory, signal) {
|
|
|
159
159
|
if (diagnostic?.launchId === launchId)
|
|
160
160
|
throw new Error(`${diagnostic.phase}: ${diagnostic.hint}`);
|
|
161
161
|
if (failure)
|
|
162
|
-
throw new Error('Personal could not launch its background process. Check the Node installation and
|
|
163
|
-
throw new Error('Personal did not become ready. Use
|
|
162
|
+
throw new Error('Personal could not launch its background process. Check the Node installation and operator.ts logs.');
|
|
163
|
+
throw new Error('Personal did not become ready. Use operator.ts jobs and logs for diagnostics.');
|
|
164
164
|
}
|
|
165
165
|
async function jobs({ args, cwd, signal }) {
|
|
166
166
|
const directory = directoryFor(cwd);
|
|
@@ -190,14 +190,14 @@ async function send(command, { args, cwd, signal }) {
|
|
|
190
190
|
if (!client) {
|
|
191
191
|
signal.throwIfAborted();
|
|
192
192
|
if (command === 'stop')
|
|
193
|
-
return { state: 'stopped', verification: 'Use
|
|
194
|
-
throw new Error('Start Personal with
|
|
193
|
+
return { state: 'stopped', verification: 'Use operator.ts jobs for the last cleanup receipt.' };
|
|
194
|
+
throw new Error('Start Personal with operator.ts start first.');
|
|
195
195
|
}
|
|
196
196
|
try {
|
|
197
197
|
const request = { requestId: randomUUID() };
|
|
198
198
|
if (command === 'stop') {
|
|
199
199
|
if (args)
|
|
200
|
-
throw new Error('Use
|
|
200
|
+
throw new Error('Use stop to stop Personal or stop-work <work> to stop one work item.');
|
|
201
201
|
const completion = client.session.completion;
|
|
202
202
|
const receipt = await client.session.stop({ ...request, reason: 'owner_stop' });
|
|
203
203
|
const result = await completion;
|
|
@@ -216,7 +216,7 @@ export function personalActions(definition) {
|
|
|
216
216
|
setup: ({ args, cwd, signal }) => setup(args, cwd, directoryFor(cwd), signal),
|
|
217
217
|
start: ({ args, cwd, signal }) => {
|
|
218
218
|
if (args)
|
|
219
|
-
throw new Error('Use
|
|
219
|
+
throw new Error('Use start without arguments.');
|
|
220
220
|
return start(cwd, directoryFor(cwd), signal);
|
|
221
221
|
},
|
|
222
222
|
jobs,
|
|
@@ -10,16 +10,16 @@ export class PersonalConfigurationError extends Error {
|
|
|
10
10
|
export function backendDiagnostic(error) {
|
|
11
11
|
if (error instanceof PersonalConfigurationError)
|
|
12
12
|
return { code: error.code, hint: error.message };
|
|
13
|
-
return { code: 'PERSONAL_BACKEND_CONFIG_INVALID', hint: 'Review the Pi and OpenSandbox configuration with
|
|
13
|
+
return { code: 'PERSONAL_BACKEND_CONFIG_INVALID', hint: 'Review the Pi and OpenSandbox configuration with anyswarm doctor. Select Pi with anyswarm setup --backend pi.' };
|
|
14
14
|
}
|
|
15
15
|
export function runtimeOptions(outputDir) {
|
|
16
16
|
if (process.env.ANYSWARM_EXECUTOR && process.env.ANYSWARM_EXECUTOR !== 'pi') {
|
|
17
|
-
throw new PersonalConfigurationError('PERSONAL_PI_REQUIRED', 'Personal requires Pi. Run
|
|
17
|
+
throw new PersonalConfigurationError('PERSONAL_PI_REQUIRED', 'Personal requires Pi. Run anyswarm setup --backend pi and select Pi in ANYSWARM_EXECUTOR.');
|
|
18
18
|
}
|
|
19
19
|
const { image, executor: configured, advertiseHost, publicUrl, endpointSource: _source, ...sandbox } = resolveSandboxConnection({}, 'SUPER');
|
|
20
20
|
const executor = process.env.ANYSWARM_EXECUTOR ?? configured ?? 'pi';
|
|
21
21
|
if (executor !== 'pi')
|
|
22
|
-
throw new PersonalConfigurationError('PERSONAL_PI_REQUIRED', 'Personal requires Pi. Run
|
|
22
|
+
throw new PersonalConfigurationError('PERSONAL_PI_REQUIRED', 'Personal requires Pi. Run anyswarm setup --backend pi.');
|
|
23
23
|
const url = process.env.ANYSWARM_MODEL_URL;
|
|
24
24
|
const model = process.env.ANYSWARM_MODEL_ID;
|
|
25
25
|
if (!url || !model)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"apiVersion": 1,
|
|
3
3
|
"entry": "project.ts",
|
|
4
|
-
"files": ["project.ts", "config.ts", "prompts.ts", "inbox.ts", "outbox.ts", "github.ts", "artifact.ts", "coordinator.ts", "execution.ts", "location.ts", "actions.ts", "daemon.ts", "decisions.ts", "README.md"]
|
|
4
|
+
"files": ["project.ts", "config.ts", "prompts.ts", "inbox.ts", "outbox.ts", "github.ts", "artifact.ts", "coordinator.ts", "execution.ts", "location.ts", "actions.ts", "operator.ts", "daemon.ts", "decisions.ts", "README.md"]
|
|
5
5
|
}
|
|
@@ -35,7 +35,7 @@ export function loadSettings(root) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
catch {
|
|
38
|
-
throw new Error('Run
|
|
38
|
+
throw new Error('Run anyswarm run ./operator.ts setup --repo owner/repo.');
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
// Keep ownership in a separate rollback-journal database so Inbox readers and writes remain independent.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { personalActions } from './actions.js';
|
|
2
|
+
import personal from './project.js';
|
|
3
|
+
const actions = personalActions(personal);
|
|
4
|
+
const [command, ...args] = process.argv.slice(2);
|
|
5
|
+
if (!command || !Object.hasOwn(actions, command)) {
|
|
6
|
+
console.error('Usage: anyswarm run ./operator.ts setup|start|jobs|logs|ask|answer|approve|reject|stop-work|stop [arguments]');
|
|
7
|
+
process.exitCode = 2;
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
const controller = new AbortController();
|
|
11
|
+
const interrupt = (signal) => {
|
|
12
|
+
process.exitCode = signal === 'SIGINT' ? 130 : 143;
|
|
13
|
+
controller.abort();
|
|
14
|
+
};
|
|
15
|
+
process.on('SIGINT', interrupt).on('SIGTERM', interrupt);
|
|
16
|
+
try {
|
|
17
|
+
const action = actions[command];
|
|
18
|
+
const result = await action({ args: args.join(' '), cwd: process.cwd(), signal: controller.signal });
|
|
19
|
+
if (result !== undefined)
|
|
20
|
+
console.log(JSON.stringify(result));
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (!controller.signal.aborted) {
|
|
24
|
+
console.error(error instanceof Error ? error.message : 'Personal command failed.');
|
|
25
|
+
process.exitCode = 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
process.off('SIGINT', interrupt).off('SIGTERM', interrupt);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,111 +1,4 @@
|
|
|
1
1
|
import { type Harness } from '@anyswarm/core';
|
|
2
|
-
import { type PersonalStartupFailure } from './config.js';
|
|
3
2
|
export { observe } from './daemon.js';
|
|
4
3
|
declare const personal: Harness;
|
|
5
|
-
export declare const slashActions: {
|
|
6
|
-
setup: ({ args, cwd, signal }: {
|
|
7
|
-
args: string;
|
|
8
|
-
cwd: string;
|
|
9
|
-
signal: AbortSignal;
|
|
10
|
-
}) => Promise<"Configure GitHub with /setup --repo owner/repo [--path README.md] [--user login] [--publish]." | {
|
|
11
|
-
configured: boolean;
|
|
12
|
-
source: string;
|
|
13
|
-
account: string;
|
|
14
|
-
repository: string;
|
|
15
|
-
users: string[];
|
|
16
|
-
paths: string[];
|
|
17
|
-
publish: boolean;
|
|
18
|
-
backend: {
|
|
19
|
-
readonly configuration: 'valid';
|
|
20
|
-
readonly executor: 'pi';
|
|
21
|
-
readonly connectivity: 'unverified';
|
|
22
|
-
} | {
|
|
23
|
-
readonly code: string;
|
|
24
|
-
readonly hint: string;
|
|
25
|
-
readonly executor?: undefined;
|
|
26
|
-
readonly configuration: 'invalid';
|
|
27
|
-
readonly connectivity: 'unverified';
|
|
28
|
-
};
|
|
29
|
-
connection: string;
|
|
30
|
-
github: {
|
|
31
|
-
repositoryRead: string;
|
|
32
|
-
commentRead: string;
|
|
33
|
-
contentRead: string;
|
|
34
|
-
replyWrite: string;
|
|
35
|
-
publicationWrite: string;
|
|
36
|
-
};
|
|
37
|
-
requiredPermissions: string;
|
|
38
|
-
verification: string;
|
|
39
|
-
}>;
|
|
40
|
-
start: ({ args, cwd, signal }: {
|
|
41
|
-
args: string;
|
|
42
|
-
cwd: string;
|
|
43
|
-
signal: AbortSignal;
|
|
44
|
-
}) => Promise<{
|
|
45
|
-
state: string;
|
|
46
|
-
repository: string;
|
|
47
|
-
account?: undefined;
|
|
48
|
-
runId?: undefined;
|
|
49
|
-
} | {
|
|
50
|
-
state: string;
|
|
51
|
-
repository: string;
|
|
52
|
-
account: string;
|
|
53
|
-
runId: string | null;
|
|
54
|
-
}>;
|
|
55
|
-
jobs: ({ args, cwd, signal }: {
|
|
56
|
-
args: string;
|
|
57
|
-
cwd: string;
|
|
58
|
-
signal: AbortSignal;
|
|
59
|
-
}) => Promise<{
|
|
60
|
-
jobs?: {
|
|
61
|
-
id: string;
|
|
62
|
-
issue: number;
|
|
63
|
-
pull: number | undefined;
|
|
64
|
-
branch: string | undefined;
|
|
65
|
-
waiting: string | undefined;
|
|
66
|
-
artifact: {
|
|
67
|
-
patch: string;
|
|
68
|
-
sha256: string;
|
|
69
|
-
checks: string[];
|
|
70
|
-
summary: string | undefined;
|
|
71
|
-
review: string | undefined;
|
|
72
|
-
} | undefined;
|
|
73
|
-
}[] | undefined;
|
|
74
|
-
events?: {
|
|
75
|
-
id: string;
|
|
76
|
-
job: string;
|
|
77
|
-
thread: number;
|
|
78
|
-
state: "delivered" | "failed" | "prepared" | "queued" | "stopped" | "unknown" | "working";
|
|
79
|
-
problem: string | undefined;
|
|
80
|
-
result: "completed" | "failed" | "waiting" | undefined;
|
|
81
|
-
publish: "approval" | "confirmed" | "queued" | "rejected" | "sending" | "unknown" | undefined;
|
|
82
|
-
reply: "confirmed" | "queued" | "sending" | "unknown" | undefined;
|
|
83
|
-
comment: string | undefined;
|
|
84
|
-
originalComment: string | undefined;
|
|
85
|
-
url: string | undefined;
|
|
86
|
-
rejectionReason: string | undefined;
|
|
87
|
-
}[] | undefined;
|
|
88
|
-
conflicts?: Record<string, import("node:sqlite").SQLOutputValue>[] | undefined;
|
|
89
|
-
state: string;
|
|
90
|
-
settings: import("./config.js").PersonalSettings;
|
|
91
|
-
runId: string | null | undefined;
|
|
92
|
-
live: import("@anyswarm/core").HarnessJson | undefined;
|
|
93
|
-
cleanup: unknown;
|
|
94
|
-
startupFailure: {} | undefined;
|
|
95
|
-
log: string;
|
|
96
|
-
}>;
|
|
97
|
-
logs: ({ cwd }: {
|
|
98
|
-
args: string;
|
|
99
|
-
cwd: string;
|
|
100
|
-
signal: AbortSignal;
|
|
101
|
-
}) => {
|
|
102
|
-
log: string;
|
|
103
|
-
startupFailure: PersonalStartupFailure | undefined;
|
|
104
|
-
};
|
|
105
|
-
serve?: (({ cwd, signal }: {
|
|
106
|
-
args: string;
|
|
107
|
-
cwd: string;
|
|
108
|
-
signal: AbortSignal;
|
|
109
|
-
}) => Promise<void>) | undefined;
|
|
110
|
-
};
|
|
111
4
|
export default personal;
|
|
@@ -9,7 +9,6 @@ import { memberBackend, personalRuntime } from './execution.js';
|
|
|
9
9
|
import { GitHub, GitHubApiError, githubToken } from './github.js';
|
|
10
10
|
import { openInbox } from './inbox.js';
|
|
11
11
|
import { loadSettings, lockPersonalState, privateDirectory, stateDirectory } from './location.js';
|
|
12
|
-
import { personalActions } from './actions.js';
|
|
13
12
|
import { personalDecisions } from './decisions.js';
|
|
14
13
|
import { outbox } from './outbox.js';
|
|
15
14
|
const json = (value) => JSON.parse(JSON.stringify(value));
|
|
@@ -25,7 +24,7 @@ function diagnoseFailure(phase, error) {
|
|
|
25
24
|
}
|
|
26
25
|
if (phase === 'runtime-initialization')
|
|
27
26
|
return { code: 'PERSONAL_RUNTIME_INIT_FAILED',
|
|
28
|
-
hint: 'Run
|
|
27
|
+
hint: 'Run anyswarm doctor --smoke. Check the OpenSandbox endpoint and whether the configured callback port is available.' };
|
|
29
28
|
return { code: 'PERSONAL_PROCESSING_FAILED', hint: 'Check /jobs for work and cleanup receipts, then restart Personal with /start.' };
|
|
30
29
|
}
|
|
31
30
|
const personal = {
|
|
@@ -249,5 +248,4 @@ const personal = {
|
|
|
249
248
|
}
|
|
250
249
|
},
|
|
251
250
|
};
|
|
252
|
-
export const slashActions = personalActions(personal);
|
|
253
251
|
export default personal;
|
|
@@ -10,7 +10,7 @@ repository sources.
|
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
npm init -y
|
|
13
|
-
npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.
|
|
13
|
+
npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.2}"
|
|
14
14
|
npm install --save-dev typescript @types/node
|
|
15
15
|
sdk=node_modules/@anyswarm/core
|
|
16
16
|
cp -R "$sdk"/examples/taskpool demo
|
|
@@ -24,8 +24,8 @@ export declare function captureServiceAuthority(tasks: any, envelope?: any, { mi
|
|
|
24
24
|
};
|
|
25
25
|
links: any;
|
|
26
26
|
scope: {
|
|
27
|
-
error?: undefined;
|
|
28
27
|
value: any;
|
|
28
|
+
error?: undefined;
|
|
29
29
|
} | {
|
|
30
30
|
value?: undefined;
|
|
31
31
|
error: {
|
|
@@ -34,8 +34,8 @@ export declare function captureServiceAuthority(tasks: any, envelope?: any, { mi
|
|
|
34
34
|
};
|
|
35
35
|
} | null;
|
|
36
36
|
write_scope: {
|
|
37
|
-
error?: undefined;
|
|
38
37
|
value: any;
|
|
38
|
+
error?: undefined;
|
|
39
39
|
} | {
|
|
40
40
|
value?: undefined;
|
|
41
41
|
error: {
|
|
@@ -44,8 +44,8 @@ export declare function captureServiceAuthority(tasks: any, envelope?: any, { mi
|
|
|
44
44
|
};
|
|
45
45
|
} | null;
|
|
46
46
|
mission_open: {
|
|
47
|
-
error?: undefined;
|
|
48
47
|
value: any;
|
|
48
|
+
error?: undefined;
|
|
49
49
|
} | {
|
|
50
50
|
value?: undefined;
|
|
51
51
|
error: {
|
|
@@ -54,8 +54,8 @@ export declare function captureServiceAuthority(tasks: any, envelope?: any, { mi
|
|
|
54
54
|
};
|
|
55
55
|
} | null;
|
|
56
56
|
correction_scope: {
|
|
57
|
-
error?: undefined;
|
|
58
57
|
value: any;
|
|
58
|
+
error?: undefined;
|
|
59
59
|
} | {
|
|
60
60
|
value?: undefined;
|
|
61
61
|
error: {
|