acpus 0.0.2 → 0.1.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.
Files changed (47) hide show
  1. package/README.md +6 -103
  2. package/dist/catalog.d.ts +27 -0
  3. package/dist/catalog.d.ts.map +1 -0
  4. package/dist/catalog.js +189 -0
  5. package/dist/catalog.js.map +1 -0
  6. package/dist/follow.d.ts +23 -0
  7. package/dist/follow.d.ts.map +1 -0
  8. package/dist/follow.js +109 -0
  9. package/dist/follow.js.map +1 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +414 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/io.d.ts +4 -0
  15. package/dist/io.d.ts.map +1 -0
  16. package/dist/io.js +38 -0
  17. package/dist/io.js.map +1 -0
  18. package/dist/observations.d.ts +26 -0
  19. package/dist/observations.d.ts.map +1 -0
  20. package/dist/observations.js +60 -0
  21. package/dist/observations.js.map +1 -0
  22. package/dist/output.d.ts +9 -0
  23. package/dist/output.d.ts.map +1 -0
  24. package/dist/output.js +51 -0
  25. package/dist/output.js.map +1 -0
  26. package/dist/runs-show.d.ts +5 -0
  27. package/dist/runs-show.d.ts.map +1 -0
  28. package/dist/runs-show.js +83 -0
  29. package/dist/runs-show.js.map +1 -0
  30. package/dist/supervisor-client.d.ts +9 -0
  31. package/dist/supervisor-client.d.ts.map +1 -0
  32. package/dist/supervisor-client.js +8 -0
  33. package/dist/supervisor-client.js.map +1 -0
  34. package/dist/supervisor.d.ts +18 -0
  35. package/dist/supervisor.d.ts.map +1 -0
  36. package/dist/supervisor.js +24 -0
  37. package/dist/supervisor.js.map +1 -0
  38. package/package.json +30 -44
  39. package/dist/cli.d.mts +0 -1
  40. package/dist/cli.mjs +0 -4017
  41. package/dist/index.d.mts +0 -2194
  42. package/dist/index.mjs +0 -243
  43. package/dist/monitor-app-CPlEcyHR.mjs +0 -369
  44. package/dist/monitor-rendering-LGr9Ebd_.mjs +0 -78
  45. package/dist/run-picker-app-utJ2f5CU.mjs +0 -104
  46. package/dist/run-workflow-DdIAC8Zu.mjs +0 -12922
  47. package/schemas/workflow-spec.schema.json +0 -2649
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,SAAS,CAAC,MAAkB,EAAE,OAAsB;IAClE,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO;IACT,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,aAAa,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAClE,OAAO;IACT,CAAC;IACD,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACrC,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAChC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAqB,EAAE,OAAsB;IACxE,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,aAAa,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9G,CAAC;QACD,OAAO;IACT,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,aAAa,CAAC;YACZ,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC,CAAC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export declare function formatRunShow(run: RunState, client?: ArtifactPathResolver, nowMs?: number): Promise<string>;
4
+ export {};
5
+ //# sourceMappingURL=runs-show.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs-show.d.ts","sourceRoot":"","sources":["../src/runs-show.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,QAAQ,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAOxF,KAAK,oBAAoB,GAAG,IAAI,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;AAEzE,wBAAsB,aAAa,CACjC,GAAG,EAAE,QAAQ,EACb,MAAM,CAAC,EAAE,oBAAoB,EAC7B,KAAK,SAAa,GACjB,OAAO,CAAC,MAAM,CAAC,CAqBjB"}
@@ -0,0 +1,83 @@
1
+ import { createReadStream } from "node:fs";
2
+ import { stat } from "node:fs/promises";
3
+ import { AgentTranscriptAccumulator, mergeAgentExecutionSummaries } from "@acpus/tui/agent-transcript";
4
+ export async function formatRunShow(run, client, nowMs = Date.now()) {
5
+ const lines = [];
6
+ lines.push(`Run: ${run.runId}`);
7
+ lines.push(`Workflow: ${run.workflowName}`);
8
+ if (run.workflowRef)
9
+ lines.push(`Workflow Ref: ${run.workflowRef}`);
10
+ if (run.workflowSourcePath)
11
+ lines.push(`Workflow Source: ${run.workflowSourcePath}`);
12
+ lines.push(`Status: ${run.status}`);
13
+ lines.push(`Created: ${run.createdAt}`);
14
+ lines.push(`Updated: ${run.updatedAt}`);
15
+ lines.push("");
16
+ lines.push("Nodes:");
17
+ for (const node of run.nodes ?? []) {
18
+ lines.push(` ${node.nodeKey} [${node.kind}] ${node.state} attempt=${node.attempt}`);
19
+ if (node.error)
20
+ lines.push(` Error: ${node.error}`);
21
+ if (node.artifactRefs?.length)
22
+ lines.push(` Artifacts: ${node.artifactRefs.join(", ")}`);
23
+ const activity = client ? await summarizeRunningAgentActivity(run.runId, node, client, nowMs) : undefined;
24
+ if (activity)
25
+ lines.push(` Activity: ${activity}`);
26
+ }
27
+ return lines.join("\n");
28
+ }
29
+ async function summarizeRunningAgentActivity(runId, node, client, nowMs) {
30
+ if (node.kind !== "run.agent" || node.state !== "running")
31
+ return undefined;
32
+ const transcriptRefs = (node.artifactRefs ?? []).filter((ref) => ref.endsWith(".transcript.jsonl"));
33
+ if (transcriptRefs.length === 0)
34
+ return undefined;
35
+ const parsed = await Promise.all(transcriptRefs.map((ref) => readTranscriptSummary(runId, ref, client)));
36
+ const available = parsed.filter((item) => item !== undefined);
37
+ if (available.length === 0)
38
+ return undefined;
39
+ const summary = mergeAgentExecutionSummaries(available.map((item) => item.summary));
40
+ const updatedMs = Math.max(...available.map((item) => item.updatedMs));
41
+ const parts = [`updated=${formatAge(nowMs - updatedMs)} ago`, `tool_calls=${summary.toolCallCount}`];
42
+ const recent = summary.recentToolCalls.map(formatToolName).filter(Boolean);
43
+ if (recent.length > 0)
44
+ parts.push(`recent=${recent.join(", ")}`);
45
+ if (summary.outputTokens !== undefined) {
46
+ const prefix = summary.outputTokenSource === "estimated" ? "~" : "";
47
+ parts.push(`output_tokens=${prefix}${summary.outputTokens}`);
48
+ }
49
+ return parts.join("; ");
50
+ }
51
+ async function readTranscriptSummary(runId, ref, client) {
52
+ try {
53
+ const absPath = await client.getArtifactPath(runId, ref);
54
+ const fileStat = await stat(absPath);
55
+ const accumulator = new AgentTranscriptAccumulator();
56
+ for await (const chunk of createReadStream(absPath, { encoding: "utf8" })) {
57
+ accumulator.append(chunk);
58
+ }
59
+ accumulator.flush();
60
+ return { summary: accumulator.summary(), updatedMs: fileStat.mtimeMs };
61
+ }
62
+ catch {
63
+ return undefined;
64
+ }
65
+ }
66
+ function formatToolName(tool) {
67
+ const raw = tool.title ?? tool.toolName ?? tool.kind ?? tool.toolCallId;
68
+ return raw.replace(/\s+/g, " ").trim();
69
+ }
70
+ function formatAge(deltaMs) {
71
+ const safeMs = Math.max(0, deltaMs);
72
+ const seconds = Math.floor(safeMs / 1000);
73
+ if (seconds < 60)
74
+ return `${seconds}s`;
75
+ const minutes = Math.floor(seconds / 60);
76
+ if (minutes < 60)
77
+ return `${minutes}m`;
78
+ const hours = Math.floor(minutes / 60);
79
+ if (hours < 48)
80
+ return `${hours}h`;
81
+ return `${Math.floor(hours / 24)}d`;
82
+ }
83
+ //# sourceMappingURL=runs-show.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs-show.js","sourceRoot":"","sources":["../src/runs-show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAE7B,MAAM,6BAA6B,CAAC;AAIrC,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAa,EACb,MAA6B,EAC7B,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE;IAElB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;IAChC,KAAK,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;IAC5C,IAAI,GAAG,CAAC,WAAW;QAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACpE,IAAI,GAAG,CAAC,kBAAkB;QAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,GAAG,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACrF,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACpC,KAAK,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;IACxC,KAAK,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;IACxC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,K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G,EAAE;QAAE,OAAO,GAAG,OAAO,GAAG,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACzC,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,GAAG,CAAC;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,GAAG,KAAK,GAAG,CAAC;IACnC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC;AACtC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * RunSupervisorClient — re-exported from @acpus/runtime.
3
+ *
4
+ * The implementation lives in the runtime package so the CLI and the TUI
5
+ * can share one client without a package cycle.
6
+ */
7
+ export { RunSupervisorClient } from "@acpus/runtime";
8
+ export type { RunCleanResult, RunState, NodeExecutionState, RunSummary, ReplayResult, SupervisorMetadata, SupervisorHealth } from "@acpus/runtime";
9
+ //# sourceMappingURL=supervisor-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor-client.d.ts","sourceRoot":"","sources":["../src/supervisor-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,UAAU,EAAE,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * RunSupervisorClient — re-exported from @acpus/runtime.
3
+ *
4
+ * The implementation lives in the runtime package so the CLI and the TUI
5
+ * can share one client without a package cycle.
6
+ */
7
+ export { RunSupervisorClient } from "@acpus/runtime";
8
+ //# sourceMappingURL=supervisor-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor-client.js","sourceRoot":"","sources":["../src/supervisor-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * CLI helper: ensure a workspace supervisor is running and return a client.
3
+ *
4
+ * All Run-facing CLI commands call `ensureSupervisor()` to lazily start
5
+ * the supervisor and construct an `RunSupervisorClient`.
6
+ */
7
+ import { RunSupervisorClient } from "@acpus/runtime";
8
+ export declare const EXIT_SUPERVISOR_ERROR = 40;
9
+ /**
10
+ * Ensure a Run Supervisor is running for the current workspace and
11
+ * return a connected client. Maps discovery errors to exit code 40.
12
+ */
13
+ export declare function ensureSupervisor(): Promise<RunSupervisorClient>;
14
+ /**
15
+ * Check if an error is a supervisor connection error.
16
+ */
17
+ export declare function isSupervisorConnectionError(error: unknown): boolean;
18
+ //# sourceMappingURL=supervisor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA6B,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEhF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAGrE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGnE"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * CLI helper: ensure a workspace supervisor is running and return a client.
3
+ *
4
+ * All Run-facing CLI commands call `ensureSupervisor()` to lazily start
5
+ * the supervisor and construct an `RunSupervisorClient`.
6
+ */
7
+ import { ensureWorkspaceSupervisor, RunSupervisorClient } from "@acpus/runtime";
8
+ export const EXIT_SUPERVISOR_ERROR = 40;
9
+ /**
10
+ * Ensure a Run Supervisor is running for the current workspace and
11
+ * return a connected client. Maps discovery errors to exit code 40.
12
+ */
13
+ export async function ensureSupervisor() {
14
+ const metadata = await ensureWorkspaceSupervisor(process.cwd());
15
+ return new RunSupervisorClient(metadata.endpoint);
16
+ }
17
+ /**
18
+ * Check if an error is a supervisor connection error.
19
+ */
20
+ export function isSupervisorConnectionError(error) {
21
+ const msg = error instanceof Error ? error.message : String(error);
22
+ return /ECONNREFUSED|fetch failed|connect|supervisor|ENOENT|spawn|timed out|failed to start/i.test(msg);
23
+ }
24
+ //# sourceMappingURL=supervisor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor.js","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAChE,OAAO,IAAI,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAc;IACxD,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnE,OAAO,sFAAsF,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1G,CAAC"}
package/package.json CHANGED
@@ -1,76 +1,62 @@
1
1
  {
2
2
  "name": "acpus",
3
- "version": "0.0.2",
4
- "private": false,
5
- "description": "Runtime-driven workflow orchestrator for ACP agents",
3
+ "version": "0.1.0",
4
+ "description": "Local durable workflow runner for ACP agents",
6
5
  "keywords": [
6
+ "acp",
7
7
  "acpx",
8
+ "agent",
8
9
  "workflow",
9
10
  "orchestrator",
10
- "agent",
11
11
  "cli"
12
12
  ],
13
13
  "license": "MIT",
14
14
  "author": "kkkyran",
15
+ "homepage": "https://github.com/kelvinschen/acpus#readme",
15
16
  "repository": {
16
17
  "type": "git",
17
- "url": "git+https://github.com/kelvinschen/acpus.git"
18
+ "url": "git+https://github.com/kelvinschen/acpus.git",
19
+ "directory": "packages/cli"
18
20
  },
19
- "homepage": "https://github.com/kelvinschen/acpus#readme",
20
21
  "bugs": {
21
22
  "url": "https://github.com/kelvinschen/acpus/issues"
22
23
  },
23
24
  "type": "module",
25
+ "engines": {
26
+ "node": ">=22"
27
+ },
24
28
  "bin": {
25
- "acpus": "dist/cli.mjs"
29
+ "acpus": "./dist/index.js"
26
30
  },
27
- "main": "dist/index.mjs",
28
- "types": "dist/index.d.mts",
29
31
  "exports": {
30
32
  ".": {
31
- "import": "./dist/index.mjs",
32
- "types": "./dist/index.d.mts"
33
+ "types": "./dist/index.d.ts",
34
+ "default": "./dist/index.js"
33
35
  }
34
36
  },
37
+ "main": "./dist/index.js",
38
+ "types": "./dist/index.d.ts",
35
39
  "files": [
36
40
  "dist",
37
- "schemas",
38
- "LICENSE",
39
- "README.md"
41
+ "README.md",
42
+ "LICENSE"
40
43
  ],
41
- "engines": {
42
- "node": ">=22.13.0"
43
- },
44
- "scripts": {
45
- "build": "tsdown",
46
- "typecheck": "tsc --noEmit",
47
- "test": "vitest run",
48
- "test:unit": "vitest run test/unit",
49
- "test:integration": "vitest run test/integration",
50
- "test:e2e:fake": "vitest run test/e2e/fake",
51
- "test:e2e:real": "RUN_REAL_ACPX_E2E=1 vitest run test/e2e/real",
52
- "generate:schema": "tsx src/schema/generate-json-schema.ts",
53
- "validate": "npm run typecheck && npm run test && npm run generate:schema && npm run build"
44
+ "publishConfig": {
45
+ "access": "public"
54
46
  },
55
47
  "dependencies": {
56
- "acpx": "^0.10.0",
57
- "commander": "^14.0.3",
58
- "execa": "^9.6.1",
59
- "fast-glob": "^3.3.3",
60
- "ink": "^7.0.5",
61
- "kleur": "^4.1.5",
62
- "proper-lockfile": "^4.1.2",
63
- "react": "^19.2.7",
48
+ "commander": "^15.0.0",
64
49
  "yaml": "^2.9.0",
65
- "zod": "^4.4.3"
50
+ "@acpus/core": "0.1.0",
51
+ "@acpus/tui": "0.1.0",
52
+ "@acpus/runtime": "0.1.0"
66
53
  },
67
54
  "devDependencies": {
68
- "@types/node": "^20.19.39",
69
- "@types/react": "^19.2.16",
70
- "ink-testing-library": "^4.0.0",
71
- "tsdown": "^0.22.1",
72
- "tsx": "^4.22.3",
73
- "typescript": "^6.0.3",
74
- "vitest": "^4.1.7"
55
+ "@types/node": "^22.15.30"
56
+ },
57
+ "scripts": {
58
+ "build": "tsc -p tsconfig.json && node -e \"require('node:fs').chmodSync('dist/index.js', 0o755)\"",
59
+ "typecheck": "tsc -p tsconfig.json --noEmit",
60
+ "clean": "rm -rf dist"
75
61
  }
76
- }
62
+ }
package/dist/cli.d.mts DELETED
@@ -1 +0,0 @@
1
- export { };