@maiaos/cli 0.1.0-canary.54 → 0.1.0-canary.56

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 (179) hide show
  1. package/README.md +4 -3
  2. package/dist/bin/maia.cdx.json +19 -19
  3. package/dist/bin/maia.mjs +1 -1
  4. package/dist/command-line/emit/index.d.ts +1 -1
  5. package/dist/command-line/emit/index.js +1 -1
  6. package/dist/command-line/emit/rows.d.ts +1 -0
  7. package/dist/command-line/emit/rows.js +5 -0
  8. package/dist/command-line/index.d.ts +2 -2
  9. package/dist/command-line/index.js +2 -2
  10. package/dist/command-line/input/index.d.ts +1 -0
  11. package/dist/command-line/input/index.js +1 -0
  12. package/dist/command-line/input/manager-options.d.ts +10 -0
  13. package/dist/command-line/input/manager-options.js +38 -0
  14. package/dist/events/commands.js +4 -3
  15. package/dist/import/batch.js +196 -0
  16. package/dist/import/client.d.ts +3 -3
  17. package/dist/import/client.js +1 -1
  18. package/dist/import/commands.d.ts +1 -0
  19. package/dist/import/commands.js +82 -8
  20. package/dist/import/index.d.ts +1 -1
  21. package/dist/import/index.js +1 -1
  22. package/dist/import/input.js +16 -2
  23. package/dist/import/manifest.js +107 -0
  24. package/dist/import/output.js +44 -2
  25. package/dist/session/approval/commands.d.ts +1 -0
  26. package/dist/session/approval/commands.js +75 -9
  27. package/dist/session/approval/index.d.ts +1 -1
  28. package/dist/session/approval/index.js +1 -1
  29. package/dist/session/coding-client.d.ts +2 -0
  30. package/dist/session/coding-client.js +1 -2
  31. package/dist/session/coding-commands.js +24 -7
  32. package/dist/session/commands.js +36 -39
  33. package/dist/session/output/human.js +14 -3
  34. package/dist/session/output/tasks.js +25 -11
  35. package/dist/session/tree/tree.js +31 -9
  36. package/package.json +5 -5
  37. package/dist/address-space/address-space.d.ts +0 -38
  38. package/dist/address-space/index.d.ts +0 -2
  39. package/dist/agents/input.d.ts +0 -132
  40. package/dist/agents/output/format.d.ts +0 -8
  41. package/dist/agents/output/index.d.ts +0 -2
  42. package/dist/agents/tree/index.d.ts +0 -2
  43. package/dist/agents/tree/tree.d.ts +0 -3
  44. package/dist/bootstrap/exit.d.ts +0 -14
  45. package/dist/bootstrap/exit.js +0 -42
  46. package/dist/bootstrap/index.d.ts +0 -3
  47. package/dist/bootstrap/index.js +0 -3
  48. package/dist/bootstrap/process.d.ts +0 -5
  49. package/dist/bootstrap/process.js +0 -23
  50. package/dist/bootstrap/run.d.ts +0 -25
  51. package/dist/bootstrap/run.js +0 -98
  52. package/dist/bootstrap/stdio.d.ts +0 -4
  53. package/dist/bootstrap/stdio.js +0 -9
  54. package/dist/cli/environment.d.ts +0 -8
  55. package/dist/cli/services.d.ts +0 -4
  56. package/dist/command-line/emit/json-decoder.d.ts +0 -3
  57. package/dist/command-line/input/stdin-stream.d.ts +0 -4
  58. package/dist/command-receipt/command.d.ts +0 -4
  59. package/dist/command-receipt/compact-list.d.ts +0 -20
  60. package/dist/command-receipt/index.d.ts +0 -3
  61. package/dist/command-tree/completion.d.ts +0 -6
  62. package/dist/command-tree/local.d.ts +0 -3
  63. package/dist/command-tree/row.js +0 -2
  64. package/dist/connection/access/format.d.ts +0 -8
  65. package/dist/connection/access/input.d.ts +0 -53
  66. package/dist/connection/input.d.ts +0 -50
  67. package/dist/connection/signin.d.ts +0 -4
  68. package/dist/connection/tree/index.d.ts +0 -2
  69. package/dist/connection/tree/tree.d.ts +0 -3
  70. package/dist/container/output/format.d.ts +0 -11
  71. package/dist/container/output/index.d.ts +0 -2
  72. package/dist/context/client.d.ts +0 -7
  73. package/dist/context/commands.d.ts +0 -3
  74. package/dist/context/index.d.ts +0 -3
  75. package/dist/dashboard/cockpit-client.d.ts +0 -6
  76. package/dist/dashboard/cockpit-client.js +0 -27
  77. package/dist/dashboard/cockpits.d.ts +0 -29
  78. package/dist/dashboard/cockpits.js +0 -65
  79. package/dist/dashboard/dashboard.d.ts +0 -7
  80. package/dist/dashboard/draw.d.ts +0 -15
  81. package/dist/dashboard/frame.d.ts +0 -4
  82. package/dist/dashboard/index.d.ts +0 -2
  83. package/dist/dashboard/modes.d.ts +0 -5
  84. package/dist/dashboard/node-connection.d.ts +0 -15
  85. package/dist/dashboard/node-connection.js +0 -51
  86. package/dist/dashboard/pi-tui.d.ts +0 -6
  87. package/dist/dashboard/status-bar.d.ts +0 -4
  88. package/dist/dashboard/terminal.d.ts +0 -53
  89. package/dist/dashboard/tree-model.d.ts +0 -28
  90. package/dist/dashboard/tree.d.ts +0 -10
  91. package/dist/development/cli.d.ts +0 -3
  92. package/dist/development/cli.js +0 -44
  93. package/dist/events/commands.d.ts +0 -11
  94. package/dist/events/index.d.ts +0 -2
  95. package/dist/events/tree/index.d.ts +0 -2
  96. package/dist/events/tree/tree.d.ts +0 -10
  97. package/dist/execution/tree/index.d.ts +0 -2
  98. package/dist/execution/tree/tree.d.ts +0 -3
  99. package/dist/hold/output/format.d.ts +0 -11
  100. package/dist/hold/output/index.d.ts +0 -2
  101. package/dist/hold/tree/index.d.ts +0 -2
  102. package/dist/hold/tree/tree.d.ts +0 -3
  103. package/dist/import/input.d.ts +0 -19
  104. package/dist/import/output.d.ts +0 -6
  105. package/dist/integration/output.d.ts +0 -22
  106. package/dist/login/failure.d.ts +0 -3
  107. package/dist/login/gateway.d.ts +0 -12
  108. package/dist/login/menu.d.ts +0 -4
  109. package/dist/login/output/format.d.ts +0 -16
  110. package/dist/login/output/index.d.ts +0 -2
  111. package/dist/login/vendor-account.d.ts +0 -95
  112. package/dist/login/vendor-input.d.ts +0 -14
  113. package/dist/mcp/calls.d.ts +0 -8
  114. package/dist/orchestration/output/compact-aggregate.d.ts +0 -121
  115. package/dist/orchestration/output/compact-run-list.d.ts +0 -20
  116. package/dist/orchestration/output/human.d.ts +0 -80
  117. package/dist/orchestration/output/index.d.ts +0 -4
  118. package/dist/orchestration/tree/index.d.ts +0 -2
  119. package/dist/orchestration/tree/tree.d.ts +0 -3
  120. package/dist/port-lease/input.d.ts +0 -65
  121. package/dist/port-lease/output/format.d.ts +0 -11
  122. package/dist/port-lease/output/index.d.ts +0 -2
  123. package/dist/presentation/output/format.d.ts +0 -11
  124. package/dist/presentation/output/index.d.ts +0 -3
  125. package/dist/project-guard/input.d.ts +0 -21
  126. package/dist/project-guard/output/format.d.ts +0 -11
  127. package/dist/project-guard/output/index.d.ts +0 -2
  128. package/dist/project-workspace/output/human.d.ts +0 -139
  129. package/dist/project-workspace/output/index.d.ts +0 -3
  130. package/dist/project-workspace/output/metadata.d.ts +0 -11
  131. package/dist/project-workspace/tree/index.d.ts +0 -2
  132. package/dist/project-workspace/tree/tree.d.ts +0 -3
  133. package/dist/provider/client.d.ts +0 -6
  134. package/dist/provider/commands.d.ts +0 -3
  135. package/dist/provider/index.d.ts +0 -3
  136. package/dist/reference/commands.d.ts +0 -3
  137. package/dist/reference/index.d.ts +0 -3
  138. package/dist/reference/resolve.d.ts +0 -31
  139. package/dist/reference/tree/index.d.ts +0 -2
  140. package/dist/reference/tree/tree.d.ts +0 -3
  141. package/dist/remote-node/reachability.d.ts +0 -64
  142. package/dist/remote-node/text.d.ts +0 -10
  143. package/dist/remote-node/tree/index.d.ts +0 -2
  144. package/dist/remote-node/tree/tree.d.ts +0 -3
  145. package/dist/routine/input.d.ts +0 -28
  146. package/dist/routine/output/format.d.ts +0 -23
  147. package/dist/routine/output/index.d.ts +0 -2
  148. package/dist/routine/tree/index.d.ts +0 -2
  149. package/dist/routine/tree/tree.d.ts +0 -3
  150. package/dist/run-ledger/input.d.ts +0 -42
  151. package/dist/run-ledger/output/format.d.ts +0 -11
  152. package/dist/run-ledger/output/index.d.ts +0 -2
  153. package/dist/session/approval/output/format.d.ts +0 -23
  154. package/dist/session/approval/output/index.d.ts +0 -2
  155. package/dist/session/attach-render.d.ts +0 -16
  156. package/dist/session/create-tasks.d.ts +0 -20
  157. package/dist/session/interaction/input.d.ts +0 -15
  158. package/dist/session/interaction/output/format.d.ts +0 -11
  159. package/dist/session/interaction/output/index.d.ts +0 -2
  160. package/dist/session/output/diff.d.ts +0 -3
  161. package/dist/session/output/failure.d.ts +0 -11
  162. package/dist/session/output/human.d.ts +0 -115
  163. package/dist/session/output/index.d.ts +0 -6
  164. package/dist/session/output/observe.d.ts +0 -4
  165. package/dist/session/output/tasks.d.ts +0 -36
  166. package/dist/session/task-file.d.ts +0 -5
  167. package/dist/session/tree/index.d.ts +0 -2
  168. package/dist/session/tree/tree.d.ts +0 -3
  169. package/dist/team-workspace/ceremony.d.ts +0 -19
  170. package/dist/team-workspace/confirmation.d.ts +0 -4
  171. package/dist/team-workspace/dependencies.js +0 -2
  172. package/dist/team-workspace/output.d.ts +0 -15
  173. package/dist/terminal/arguments.d.ts +0 -13
  174. package/dist/terminal/keys.d.ts +0 -12
  175. package/dist/terminal/output/compact-list.d.ts +0 -149
  176. package/dist/terminal/output/human.d.ts +0 -42
  177. package/dist/terminal/output/index.d.ts +0 -3
  178. package/dist/terminal/tree/index.d.ts +0 -2
  179. package/dist/terminal/tree/tree.d.ts +0 -3
@@ -29,7 +29,7 @@ export const SESSION_TREE = {
29
29
  },
30
30
  ],
31
31
  [
32
- "session list (--project <project-id> | --all) [--state <state>[,<state>...]] [--attention] [--limit <1..100>] [--after <cursor>]",
32
+ "session list (--project <project-id> | --all) [--state <state>[,<state>...]] [--label <key=value>...] [--attention] [--settled [--idle-for <duration>]] [--limit <1..100>] [--after <cursor>]",
33
33
  0,
34
34
  "session.list",
35
35
  "List Sessions of a Project, or all of them.",
@@ -54,7 +54,7 @@ export const SESSION_TREE = {
54
54
  "session wait <session-id> [--until <state>[,<state>...]] [--activity <activity>[,<activity>...]] [--timeout <duration>]",
55
55
  1,
56
56
  "session.wait",
57
- "Wait until a Session reaches a state or activity; exits 74 on timeout.",
57
+ "Wait for a state or activity; exits 74 on timeout.",
58
58
  {
59
59
  example: "maia --json session wait session_1 --activity idle,waiting_approval,stopped --timeout 10m",
60
60
  route: "<session-id>",
@@ -65,7 +65,7 @@ export const SESSION_TREE = {
65
65
  "session rename <session-id> --title <text> --expected-revision <revision> [--command-id <id>]",
66
66
  1,
67
67
  "session.rename",
68
- "Rename a Session at its current revision.",
68
+ "Rename a Session.",
69
69
  {
70
70
  example: "maia --json session rename session_1 --title 'Fix the build' --expected-revision 2",
71
71
  route: "<session-id>",
@@ -102,7 +102,7 @@ export const SESSION_TREE = {
102
102
  { route: "<session-id>", run: [session, "runSessionResume"] },
103
103
  ],
104
104
  [
105
- "session archive <session-id> --expected-revision <revision> [--command-id <id>]",
105
+ "session archive <session-id> --expected-revision <revision> [--summary <text>] [--transcript <path>] [--command-id <id>]",
106
106
  1,
107
107
  "session.archive",
108
108
  "Archive a Session and retire its worktree.",
@@ -116,7 +116,7 @@ export const SESSION_TREE = {
116
116
  "session diff <session-id> [--stat]",
117
117
  1,
118
118
  "session.diff",
119
- "Show the changes a coding Session made.",
119
+ "Show a coding Session's changes.",
120
120
  {
121
121
  example: "maia session diff session_1 --stat",
122
122
  route: "<session-id>",
@@ -137,7 +137,7 @@ export const SESSION_TREE = {
137
137
  "session attach <session-id> [--after <epoch>:<sequence>] [--no-follow]",
138
138
  1,
139
139
  "session.attach",
140
- "Follow a Session's live items.",
140
+ "Follow its live items.",
141
141
  {
142
142
  example: "maia session attach session_1",
143
143
  route: "<session-id>",
@@ -162,16 +162,27 @@ export const SESSION_TREE = {
162
162
  },
163
163
  ],
164
164
  [
165
- "session adopt (<claude|codex>:<native-id> --workspace <workspace-id> [--attest-ended] [--host-authority [--permission <mode>]] [--command-id <id>] [--dry-run] | --confirm-stdin)",
165
+ "session adopt (<claude|codex>:<native-id> --workspace <workspace-id> [--attest-ended] [--host-authority [--permission <mode>]] [--role <worker|orchestrator>] [--label <key=value>...] [--title <title>] [--command-id <id>] [--dry-run] | --confirm-stdin)",
166
166
  1,
167
167
  ["session.adopt.preview", "session.adopt.confirm"],
168
- "Adopt a Claude Code or Codex session after a preview.",
168
+ "Adopt a Claude or Codex session after a preview.",
169
169
  {
170
170
  example: "maia --json session adopt codex:019a --workspace workspace_1 --dry-run",
171
171
  kind: "two-phase",
172
172
  run: [discovery, "runAdopt"],
173
173
  },
174
174
  ],
175
+ [
176
+ "session import (--from <file> [--dry-run] | --confirm-stdin)",
177
+ 1,
178
+ ["session.adopt.preview", "session.adopt.confirm"],
179
+ "Adopt the sessions a file lists after one preview.",
180
+ {
181
+ example: "maia --json session import --from sessions.json --dry-run",
182
+ kind: "composite",
183
+ run: [discovery, "runImport"],
184
+ },
185
+ ],
175
186
  [
176
187
  "session agent-permission set (--input-stdin --dry-run | --confirm-stdin)",
177
188
  1,
@@ -318,6 +329,17 @@ export const SESSION_TREE = {
318
329
  run: [approval, "runApprovalAnswer"],
319
330
  },
320
331
  ],
332
+ [
333
+ "session answer <session-id> <answer> --prompt <approval-id> [--as-coordinator] [--command-id <id>]",
334
+ 1,
335
+ "approval.respond",
336
+ "Answer a Session's prompt.",
337
+ {
338
+ kind: "discriminant",
339
+ route: "<session-id>",
340
+ run: [approval, "runSessionAnswer"],
341
+ },
342
+ ],
321
343
  [
322
344
  "session interaction create --input-stdin",
323
345
  1,
@@ -354,7 +376,7 @@ export const SESSION_TREE = {
354
376
  { run: [interaction, "runInteractionCancel"] },
355
377
  ],
356
378
  [
357
- "import scan [--source claude,codex] [--since <days>d] [--root <path>] [--include-content] [--limit <1..100>] [--after <cursor>]",
379
+ "import scan [--source claude,codex] [--since <days>d] [--root <path>] [--running] [--adopted | --not-adopted] [--include-content] [--limit <1..100>] [--after <cursor>]",
358
380
  1,
359
381
  "discovery.sessions.list",
360
382
  "Find Claude Code and Codex sessions to adopt.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiaos/cli",
3
- "version": "0.1.0-canary.54",
3
+ "version": "0.1.0-canary.56",
4
4
  "description": "The maia CLI and MCP server: start, drive, observe and stop swarms of Claude Code and Codex agents from a terminal, a script or another agent.",
5
5
  "keywords": [
6
6
  "maia",
@@ -64,13 +64,13 @@
64
64
  "dependencies": {
65
65
  "@earendil-works/pi-tui": "1.0.0",
66
66
  "@effect/platform-node-shared": "4.0.0",
67
- "@maiaos/agent": "0.1.0-canary.54",
68
- "@maiaos/client-core": "0.1.0-canary.54",
69
- "@maiaos/sdk": "0.1.0-canary.54",
67
+ "@maiaos/agent": "0.1.0-canary.56",
68
+ "@maiaos/client-core": "0.1.0-canary.56",
69
+ "@maiaos/sdk": "0.1.0-canary.56",
70
70
  "effect": "4.0.0"
71
71
  },
72
72
  "scripts": {
73
- "build": "node -e \"require('node:fs').rmSync('dist',{force:true,recursive:true})\" && tsc --project tsconfig.build.json && node scripts/build-executable.mjs",
73
+ "build": "node -e \"require('node:fs').rmSync('dist',{force:true,recursive:true})\" && tsc --project tsconfig.build.json && node scripts/build-executable.mjs && node scripts/prune-library.mjs",
74
74
  "lint": "eslint src scripts --max-warnings 0 --cache --cache-location node_modules/.cache/eslint/ --cache-strategy content",
75
75
  "test": "node -e \"require('node:fs').rmSync('.test-dist',{force:true,recursive:true})\" && tsc --project tsconfig.test.json && node --import ../../scripts/lib/test-environment.mjs --test --test-concurrency=2 --enable-source-maps \".test-dist/**/*.test.js\"",
76
76
  "typecheck": "tsc --project tsconfig.json --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsc/typecheck.tsbuildinfo && tsc --project scripts/tsconfig.json --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsc/scripts.tsbuildinfo"
@@ -1,38 +0,0 @@
1
- import type { RouteKind } from "@maiaos/client-core/cockpit";
2
- import { type CliCommandOutput, type CliDependencies, type CliTable, type CommandContext, type CommandEffect } from "../command-line/index.js";
3
- import { type LeafRoute } from "../command-tree/index.js";
4
- import { type HeldId, type ListedNode, type NodeAnswer } from "../fleet/index.js";
5
- import type { CliNodeEffect, CliNodeResult } from "../local-node/index.js";
6
- export declare const onHolder: (context: CommandContext, held: HeldId, run: (bound: CommandContext) => CommandEffect) => CommandEffect;
7
- type InputRoute = {
8
- readonly idOf: (input: object) => unknown;
9
- readonly kind: RouteKind;
10
- };
11
- export declare const onInputHolder: (context: CommandContext, { idOf, kind }: InputRoute, run: (bound: CommandContext) => CommandEffect) => CommandEffect;
12
- export type RoutedLeaf = {
13
- readonly argument: LeafRoute;
14
- readonly tokens: readonly string[];
15
- readonly usage: string;
16
- };
17
- export declare const routeLeaf: (context: CommandContext, { argument, tokens, usage }: RoutedLeaf, run: (bound: CommandContext) => CommandEffect) => CommandEffect;
18
- export declare const nodeLines: (nodes: readonly ListedNode[]) => string;
19
- export declare const formatMerged: <TItem extends {
20
- readonly node: string;
21
- }>({ items, nodes, }: {
22
- readonly items: readonly TItem[];
23
- readonly nodes: readonly ListedNode[];
24
- }, row: (item: TItem) => string, { empty, headers }: CliTable) => string;
25
- export declare const writeMerged: <TResult extends CliCommandOutput & {
26
- readonly result: {
27
- readonly nodes: readonly ListedNode[];
28
- };
29
- }>(context: CommandContext, output: TResult, text: (output: TResult) => string) => number;
30
- type ListSpec<TList> = {
31
- readonly merged: (answers: readonly NodeAnswer<TList>[]) => number;
32
- readonly paged: boolean;
33
- readonly read: (dependencies: CliDependencies) => CliNodeEffect<TList>;
34
- readonly sole: (result: CliNodeResult<TList>) => number;
35
- };
36
- export declare const listEach: <TList>(context: CommandContext, { merged, paged, read, sole }: ListSpec<TList>) => CommandEffect;
37
- export {};
38
- //# sourceMappingURL=address-space.d.ts.map
@@ -1,2 +0,0 @@
1
- export { formatMerged, listEach, nodeLines, onHolder, onInputHolder, type RoutedLeaf, routeLeaf, writeMerged, } from "./address-space.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,132 +0,0 @@
1
- import { type AgentsDetectParameters, type AgentsListParameters, type AgentsShowParameters } from "@maiaos/sdk";
2
- import * as Effect from "effect/Effect";
3
- import { type ParsedOptions } from "../command-line/index.js";
4
- export declare const AGENT_OPTIONS: {
5
- readonly create: Set<string>;
6
- readonly detect: Set<string>;
7
- readonly disable: Set<string>;
8
- readonly list: Set<string>;
9
- readonly revise: Set<string>;
10
- readonly show: Set<string>;
11
- };
12
- export declare const readAgentsList: (tokens: readonly string[]) => AgentsListParameters;
13
- export declare const readAgentsDetect: (tokens: readonly string[]) => AgentsDetectParameters;
14
- export declare const readAgentsShow: (tokens: readonly string[]) => AgentsShowParameters;
15
- export declare const readCreateChange: (parsed: ParsedOptions) => Effect.Effect<{
16
- change: {
17
- readonly kind: "create";
18
- readonly projectId: string;
19
- readonly spec: {
20
- readonly accountableActorId: string;
21
- readonly connectionId?: string | undefined;
22
- readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
23
- readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
24
- readonly homeSessionId?: string | undefined;
25
- readonly instruction: string;
26
- readonly managerAgentId?: string | undefined;
27
- readonly model?: string | undefined;
28
- readonly name: string;
29
- readonly placement: "local";
30
- };
31
- } | {
32
- readonly agentId: string;
33
- readonly expectedRevision: string;
34
- readonly kind: "revise";
35
- readonly spec: {
36
- readonly accountableActorId: string;
37
- readonly connectionId?: string | undefined;
38
- readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
39
- readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
40
- readonly homeSessionId?: string | undefined;
41
- readonly instruction: string;
42
- readonly managerAgentId?: string | undefined;
43
- readonly model?: string | undefined;
44
- readonly name: string;
45
- readonly placement: "local";
46
- };
47
- } | {
48
- readonly agentId: string;
49
- readonly expectedRevision: string;
50
- readonly kind: "disable";
51
- };
52
- commandId: string;
53
- }, never, import("effect/Crypto").Crypto>;
54
- export declare const readReviseChange: (parsed: ParsedOptions) => Effect.Effect<{
55
- change: {
56
- readonly kind: "create";
57
- readonly projectId: string;
58
- readonly spec: {
59
- readonly accountableActorId: string;
60
- readonly connectionId?: string | undefined;
61
- readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
62
- readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
63
- readonly homeSessionId?: string | undefined;
64
- readonly instruction: string;
65
- readonly managerAgentId?: string | undefined;
66
- readonly model?: string | undefined;
67
- readonly name: string;
68
- readonly placement: "local";
69
- };
70
- } | {
71
- readonly agentId: string;
72
- readonly expectedRevision: string;
73
- readonly kind: "revise";
74
- readonly spec: {
75
- readonly accountableActorId: string;
76
- readonly connectionId?: string | undefined;
77
- readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
78
- readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
79
- readonly homeSessionId?: string | undefined;
80
- readonly instruction: string;
81
- readonly managerAgentId?: string | undefined;
82
- readonly model?: string | undefined;
83
- readonly name: string;
84
- readonly placement: "local";
85
- };
86
- } | {
87
- readonly agentId: string;
88
- readonly expectedRevision: string;
89
- readonly kind: "disable";
90
- };
91
- commandId: string;
92
- }, never, import("effect/Crypto").Crypto>;
93
- export declare const readDisableChange: (parsed: ParsedOptions) => Effect.Effect<{
94
- change: {
95
- readonly kind: "create";
96
- readonly projectId: string;
97
- readonly spec: {
98
- readonly accountableActorId: string;
99
- readonly connectionId?: string | undefined;
100
- readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
101
- readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
102
- readonly homeSessionId?: string | undefined;
103
- readonly instruction: string;
104
- readonly managerAgentId?: string | undefined;
105
- readonly model?: string | undefined;
106
- readonly name: string;
107
- readonly placement: "local";
108
- };
109
- } | {
110
- readonly agentId: string;
111
- readonly expectedRevision: string;
112
- readonly kind: "revise";
113
- readonly spec: {
114
- readonly accountableActorId: string;
115
- readonly connectionId?: string | undefined;
116
- readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
117
- readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
118
- readonly homeSessionId?: string | undefined;
119
- readonly instruction: string;
120
- readonly managerAgentId?: string | undefined;
121
- readonly model?: string | undefined;
122
- readonly name: string;
123
- readonly placement: "local";
124
- };
125
- } | {
126
- readonly agentId: string;
127
- readonly expectedRevision: string;
128
- readonly kind: "disable";
129
- };
130
- commandId: string;
131
- }, never, import("effect/Crypto").Crypto>;
132
- //# sourceMappingURL=input.d.ts.map
@@ -1,8 +0,0 @@
1
- import type { AgentsChangeConfirmResult, AgentsChangePreviewResult, AgentsDetectResult, AgentsListResult, AgentsShowResult } from "@maiaos/sdk";
2
- export type AgentsResult = AgentsChangeConfirmResult | AgentsChangePreviewResult | AgentsDetectResult | AgentsListResult | AgentsShowResult;
3
- export type CliAgentsResult = {
4
- readonly command: AgentsResult["method"];
5
- readonly result: AgentsResult;
6
- };
7
- export declare const formatAgentsResult: ({ result }: CliAgentsResult) => string;
8
- //# sourceMappingURL=format.d.ts.map
@@ -1,2 +0,0 @@
1
- export { type AgentsResult, type CliAgentsResult, formatAgentsResult, } from "./format.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export { AGENTS_TREE } from "./tree.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +0,0 @@
1
- import type { TreeFragment } from "../../command-tree/index.js";
2
- export declare const AGENTS_TREE: TreeFragment;
3
- //# sourceMappingURL=tree.d.ts.map
@@ -1,14 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- type Output = {
3
- readonly on: (event: "close" | "error", listener: () => void) => unknown;
4
- readonly writableLength: number;
5
- readonly write: (chunk: string, callback?: () => void) => unknown;
6
- };
7
- type ExitingProcess = {
8
- readonly exit: (code: number) => void;
9
- readonly stderr: Output;
10
- readonly stdout: Output;
11
- };
12
- export declare const exitAfterOutput: (program: Effect.Effect<number>, host: ExitingProcess) => Effect.Effect<void>;
13
- export {};
14
- //# sourceMappingURL=exit.d.ts.map
@@ -1,42 +0,0 @@
1
- import * as Cause from "effect/Cause";
2
- import * as Deferred from "effect/Deferred";
3
- import * as Effect from "effect/Effect";
4
- import * as Exit from "effect/Exit";
5
- import * as Fiber from "effect/Fiber";
6
- const EXIT_INTERRUPTED = 130;
7
- const watch = (output) => Effect.gen(function* () {
8
- const ended = yield* Deferred.make();
9
- const end = () => {
10
- Deferred.doneUnsafe(ended, Effect.succeed(true));
11
- };
12
- output.on("error", end);
13
- output.on("close", end);
14
- const flushed = Effect.callback((resume) => {
15
- if (output.writableLength === 0) {
16
- resume(Effect.succeed(true));
17
- return;
18
- }
19
- output.write("", () => {
20
- resume(Effect.succeed(true));
21
- });
22
- });
23
- return Effect.raceFirst(Deferred.await(ended), flushed);
24
- });
25
- const exitCode = (exit, stderr) => {
26
- if (Exit.isSuccess(exit))
27
- return exit.value;
28
- if (Cause.hasInterruptsOnly(exit.cause))
29
- return EXIT_INTERRUPTED;
30
- stderr.write(`${Cause.pretty(exit.cause)}\n`);
31
- return 1;
32
- };
33
- export const exitAfterOutput = (program, host) => Effect.gen(function* () {
34
- const drains = [yield* watch(host.stdout), yield* watch(host.stderr)];
35
- const running = yield* Effect.forkChild(program, {
36
- startImmediately: true,
37
- });
38
- const code = exitCode(yield* Fiber.await(running), host.stderr);
39
- yield* Effect.all(drains, { concurrency: "unbounded", discard: true });
40
- host.exit(code);
41
- });
42
- //# sourceMappingURL=exit.js.map
@@ -1,3 +0,0 @@
1
- export { processIo, runProcessMain } from "./process.js";
2
- export { runMaiaBootstrap } from "./run.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +0,0 @@
1
- export { processIo, runProcessMain } from "./process.js";
2
- export { runMaiaBootstrap } from "./run.js";
3
- //# sourceMappingURL=index.js.map
@@ -1,5 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import type { CliIo } from "../command-line/index.js";
3
- export declare const processIo: () => CliIo;
4
- export declare const runProcessMain: (program: Effect.Effect<number>) => void;
5
- //# sourceMappingURL=process.d.ts.map
@@ -1,23 +0,0 @@
1
- import process from "node:process";
2
- import * as Effect from "effect/Effect";
3
- import { constVoid } from "effect/Function";
4
- import * as Runtime from "effect/Runtime";
5
- import { promptLine, terminalIsInteractive, } from "../command-line/input/index.js";
6
- import { exitAfterOutput } from "./exit.js";
7
- const readProcessStdin = (request) => Effect.promise(() => import("./stdio.js")).pipe(Effect.flatMap((stdio) => stdio.readStdin(request)));
8
- export const processIo = () => ({
9
- interactive: terminalIsInteractive(),
10
- prompt: promptLine,
11
- stderr(text) {
12
- process.stderr.write(text);
13
- },
14
- stdin: readProcessStdin,
15
- stdout(text) {
16
- process.stdout.write(text);
17
- },
18
- });
19
- const runMain = Runtime.makeRunMain(constVoid);
20
- export const runProcessMain = (program) => {
21
- runMain(exitAfterOutput(program, process), { disableErrorReporting: true });
22
- };
23
- //# sourceMappingURL=process.js.map
@@ -1,25 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import type { CliIo } from "../command-line/index.js";
3
- type AgentModule = {
4
- readonly runMaiaAgent?: (arguments_: readonly string[], options: {
5
- readonly io: Pick<CliIo, "stderr" | "stdout">;
6
- }) => Promise<number>;
7
- };
8
- type ProductCliModule = {
9
- readonly runCli?: (arguments_: readonly string[], version: string, io: CliIo) => Effect.Effect<number>;
10
- };
11
- export type MaiaBootstrapDependencies = {
12
- readonly loadAgent: () => Promise<AgentModule>;
13
- readonly loadProductCli: () => Promise<ProductCliModule>;
14
- };
15
- type MaiaBootstrapInput = {
16
- readonly arguments_: readonly string[];
17
- readonly currentNodeVersion: string;
18
- readonly expectedNodeVersion: string;
19
- readonly io: CliIo;
20
- readonly version: string;
21
- };
22
- export declare const isAgentInvocation: (arguments_: readonly string[]) => boolean;
23
- export declare const runMaiaBootstrap: (input: MaiaBootstrapInput, dependencies: MaiaBootstrapDependencies) => Effect.Effect<number>;
24
- export {};
25
- //# sourceMappingURL=run.d.ts.map
@@ -1,98 +0,0 @@
1
- import * as Cause from "effect/Cause";
2
- import * as Effect from "effect/Effect";
3
- const EXIT_SOFTWARE = 70;
4
- const EXIT_UNAVAILABLE = 69;
5
- const isDoctor = (arguments_) => !arguments_.includes("-h") &&
6
- !arguments_.includes("--help") &&
7
- arguments_.find((token) => !token.startsWith("-")) === "doctor";
8
- export const isAgentInvocation = (arguments_) => arguments_[0] === "agent";
9
- const reportBootstrapFailure = (subject, io) => {
10
- io.stderr(`Maia ${subject} could not start; run 'maia doctor'.\n`);
11
- return EXIT_SOFTWARE;
12
- };
13
- const load = (loader) => Effect.tryPromise({ catch: (error) => error, try: loader });
14
- const probe = (loader, passes) => load(loader).pipe(Effect.map(passes), Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause) ? Effect.interrupt : Effect.succeed(false)));
15
- const probePayloads = (dependencies) => Effect.all([
16
- probe(dependencies.loadProductCli, (module) => typeof module.runCli === "function"),
17
- probe(dependencies.loadAgent, (module) => typeof module.runMaiaAgent === "function"),
18
- ]).pipe(Effect.map(([cliPayload, agent]) => ({ agent, cliPayload })));
19
- const formatInstallation = (checks) => `Maia doctor failed\n${checks
20
- .map((check) => ` ${check.code} (this machine): ${check.ok ? "ok" : "failed; next: reinstall Maia"}`)
21
- .join("\n")}\n`;
22
- const writeInstallationFailure = (output) => {
23
- const { arguments_, checks, input } = output;
24
- const result = {
25
- checks: checks.map((check) => ({
26
- ...(check.ok ? check : { ...check, next: "reinstall Maia" }),
27
- scope: "machine",
28
- })),
29
- command: "doctor",
30
- ok: false,
31
- version: input.version,
32
- };
33
- input.io.stdout(arguments_.includes("--json")
34
- ? `${JSON.stringify({ ok: true, result })}\n`
35
- : formatInstallation(checks));
36
- return EXIT_SOFTWARE;
37
- };
38
- const runDoctor = (input, dependencies) => Effect.flatMap(probePayloads(dependencies), (payloads) => {
39
- const checks = [
40
- { code: "bootstrap", ok: true },
41
- {
42
- code: "node_runtime",
43
- ok: input.currentNodeVersion === input.expectedNodeVersion,
44
- },
45
- { code: "cli_payload", ok: payloads.cliPayload },
46
- { code: "agent", ok: payloads.agent },
47
- ];
48
- return checks.every((check) => check.ok)
49
- ? runProductCli(input, dependencies)
50
- : Effect.succeed(writeInstallationFailure({
51
- arguments_: input.arguments_,
52
- checks,
53
- input,
54
- }));
55
- });
56
- const requireSupportedNode = (input) => {
57
- if (input.currentNodeVersion === input.expectedNodeVersion)
58
- return undefined;
59
- input.io.stderr(`Maia CLI requires Node ${input.expectedNodeVersion}; received ${input.currentNodeVersion}.\n`);
60
- return EXIT_UNAVAILABLE;
61
- };
62
- const missingEntry = Effect.fail(new Error("The payload lacks its entry."));
63
- const runPayload = ({ input, loader, run, subject, }) => load(loader).pipe(Effect.flatMap(run), Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause)
64
- ? Effect.interrupt
65
- : Effect.sync(() => reportBootstrapFailure(subject, input.io))));
66
- const runAgent = (input, dependencies) => runPayload({
67
- input,
68
- loader: dependencies.loadAgent,
69
- run: (module) => {
70
- const runMaiaAgent = module.runMaiaAgent;
71
- return typeof runMaiaAgent === "function"
72
- ? Effect.tryPromise({
73
- catch: (error) => error,
74
- try: () => runMaiaAgent(input.arguments_.slice(1), { io: input.io }),
75
- })
76
- : missingEntry;
77
- },
78
- subject: "Agent",
79
- });
80
- const runProductCli = (input, dependencies) => runPayload({
81
- input,
82
- loader: dependencies.loadProductCli,
83
- run: (module) => typeof module.runCli === "function"
84
- ? module.runCli(input.arguments_, input.version, input.io)
85
- : missingEntry,
86
- subject: "CLI",
87
- });
88
- export const runMaiaBootstrap = (input, dependencies) => Effect.suspend(() => {
89
- if (isDoctor(input.arguments_))
90
- return runDoctor(input, dependencies);
91
- const unsupportedNode = requireSupportedNode(input);
92
- if (unsupportedNode !== undefined)
93
- return Effect.succeed(unsupportedNode);
94
- return isAgentInvocation(input.arguments_)
95
- ? runAgent(input, dependencies)
96
- : runProductCli(input, dependencies);
97
- });
98
- //# sourceMappingURL=run.js.map
@@ -1,4 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import { type BoundedStdinRequest } from "../command-line/input/index.js";
3
- export declare const readStdin: (request: BoundedStdinRequest) => Effect.Effect<string, import("../command-line/input/arguments.js").CliArgumentError, never>;
4
- //# sourceMappingURL=stdio.d.ts.map
@@ -1,9 +0,0 @@
1
- import * as NodeStdio from "@effect/platform-node-shared/NodeStdio";
2
- import * as Effect from "effect/Effect";
3
- import * as Stdio from "effect/Stdio";
4
- import { readBoundedStdin, } from "../command-line/input/index.js";
5
- export const readStdin = (request) => Effect.gen(function* () {
6
- const stdio = yield* Stdio.Stdio;
7
- return yield* readBoundedStdin(stdio.stdin, request);
8
- }).pipe(Effect.provide(NodeStdio.layer));
9
- //# sourceMappingURL=stdio.js.map
@@ -1,8 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- export type EnvironmentOptions = {
3
- readonly node?: string;
4
- readonly noInput?: string;
5
- readonly profile?: string;
6
- };
7
- export declare const environmentOptions: Effect.Effect<EnvironmentOptions>;
8
- //# sourceMappingURL=environment.d.ts.map
@@ -1,4 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import type { CliServices } from "../command-line/index.js";
3
- export declare const provideCliServices: <TValue, TError>(command: Effect.Effect<TValue, TError, CliServices>) => Effect.Effect<TValue, TError>;
4
- //# sourceMappingURL=services.d.ts.map
@@ -1,3 +0,0 @@
1
- import * as Schema from "effect/Schema";
2
- export declare const decodeJson: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<unknown, Schema.SchemaError, never>;
3
- //# sourceMappingURL=json-decoder.d.ts.map
@@ -1,4 +0,0 @@
1
- import type * as Effect from "effect/Effect";
2
- import * as Stream from "effect/Stream";
3
- export declare const foldStream: <TChunk, TState, TError>(input: Stream.Stream<TChunk, unknown>, initial: () => TState, step: (state: TState, chunk: TChunk) => Effect.Effect<TState, TError>) => Effect.Effect<TState, TError>;
4
- //# sourceMappingURL=stdin-stream.d.ts.map
@@ -1,4 +0,0 @@
1
- import { type CommandContext, type CommandEffect } from "../command-line/index.js";
2
- export declare const runReceiptList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
3
- export declare const runReceiptShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
4
- //# sourceMappingURL=command.d.ts.map
@@ -1,20 +0,0 @@
1
- import type { ReceiptListResult } from "@maiaos/sdk";
2
- type CliReceiptListItem = {
3
- readonly commandId: ReceiptListResult["items"][number]["commandId"];
4
- readonly createdAt: ReceiptListResult["items"][number]["createdAt"];
5
- readonly method: ReceiptListResult["items"][number]["method"];
6
- readonly receiptId: ReceiptListResult["items"][number]["receiptId"];
7
- readonly state: ReceiptListResult["items"][number]["state"];
8
- readonly target: ReceiptListResult["items"][number]["target"];
9
- };
10
- export type CliReceiptListResult = {
11
- readonly command: "receipt.list";
12
- readonly count: number;
13
- readonly items: readonly CliReceiptListItem[];
14
- readonly nextCursor?: ReceiptListResult["nextCursor"];
15
- };
16
- export declare const projectReceiptListItem: (item: ReceiptListResult["items"][number]) => CliReceiptListItem;
17
- export declare const projectReceiptListResult: (value: ReceiptListResult) => CliReceiptListResult;
18
- export declare const formatReceiptList: (result: CliReceiptListResult) => string;
19
- export {};
20
- //# sourceMappingURL=compact-list.d.ts.map
@@ -1,3 +0,0 @@
1
- export { runReceiptList, runReceiptShow } from "./command.js";
2
- export { type CliReceiptListResult, formatReceiptList, } from "./compact-list.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +0,0 @@
1
- declare const SHELLS: readonly ["bash", "zsh", "fish"];
2
- export type CompletionShell = (typeof SHELLS)[number];
3
- export declare const isCompletionShell: (value: string | undefined) => value is CompletionShell;
4
- export declare const completionScript: (shell: CompletionShell) => string;
5
- export {};
6
- //# sourceMappingURL=completion.d.ts.map