@maiaos/cli 0.1.0-canary.55 → 0.1.0-canary.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/bin/maia.cdx.json +19 -19
- package/dist/bin/maia.mjs +1 -1
- package/dist/cli/cli.js +10 -0
- package/dist/command-line/context.d.ts +2 -1
- package/dist/command-line/emit/index.d.ts +1 -1
- package/dist/command-line/emit/index.js +1 -1
- package/dist/command-line/emit/rows.d.ts +1 -0
- package/dist/command-line/emit/rows.js +5 -0
- package/dist/command-line/index.d.ts +3 -3
- package/dist/command-line/index.js +3 -3
- package/dist/command-line/input/index.d.ts +2 -1
- package/dist/command-line/input/index.js +1 -0
- package/dist/command-line/input/manager-options.d.ts +10 -0
- package/dist/command-line/input/manager-options.js +38 -0
- package/dist/command-line/two-phase/index.d.ts +2 -0
- package/dist/command-line/two-phase/index.js +2 -0
- package/dist/command-line/{two-phase.d.ts → two-phase/two-phase.d.ts} +12 -12
- package/dist/command-line/{two-phase.js → two-phase/two-phase.js} +2 -2
- package/dist/command-tree/tree.d.ts +1 -1
- package/dist/command-tree/tree.js +3 -0
- package/dist/events/commands.js +4 -3
- package/dist/import/batch.js +196 -0
- package/dist/import/client.d.ts +3 -3
- package/dist/import/client.js +1 -1
- package/dist/import/commands.d.ts +1 -0
- package/dist/import/commands.js +82 -8
- package/dist/import/index.d.ts +1 -1
- package/dist/import/index.js +1 -1
- package/dist/import/input.js +16 -2
- package/dist/import/manifest.js +107 -0
- package/dist/import/output.js +44 -2
- package/dist/session/agent-permission.d.ts +2 -2
- package/dist/session/approval/commands.d.ts +1 -0
- package/dist/session/approval/commands.js +75 -9
- package/dist/session/approval/index.d.ts +1 -1
- package/dist/session/approval/index.js +1 -1
- package/dist/session/client.d.ts +2 -2
- package/dist/session/coding-client.d.ts +2 -0
- package/dist/session/coding-client.js +1 -2
- package/dist/session/coding-commands.js +24 -7
- package/dist/session/commands.js +36 -39
- package/dist/session/output/human.js +14 -3
- package/dist/session/output/tasks.js +25 -11
- package/dist/session/tree/tree.js +31 -9
- package/dist/webhooks/client.d.ts +156 -0
- package/dist/webhooks/client.js +8 -0
- package/dist/webhooks/commands.d.ts +17 -0
- package/dist/webhooks/commands.js +76 -0
- package/dist/webhooks/index.d.ts +3 -0
- package/dist/webhooks/index.js +3 -0
- package/dist/webhooks/input.js +125 -0
- package/dist/webhooks/output/format.js +75 -0
- package/dist/webhooks/output/index.js +2 -0
- package/dist/webhooks/tree/index.js +2 -0
- package/dist/webhooks/tree/tree.js +49 -0
- package/package.json +5 -5
- package/dist/address-space/address-space.d.ts +0 -38
- package/dist/address-space/index.d.ts +0 -2
- package/dist/agents/input.d.ts +0 -132
- package/dist/agents/output/format.d.ts +0 -8
- package/dist/agents/output/index.d.ts +0 -2
- package/dist/agents/tree/index.d.ts +0 -2
- package/dist/agents/tree/tree.d.ts +0 -3
- package/dist/bootstrap/exit.d.ts +0 -14
- package/dist/bootstrap/exit.js +0 -42
- package/dist/bootstrap/index.d.ts +0 -3
- package/dist/bootstrap/index.js +0 -3
- package/dist/bootstrap/process.d.ts +0 -5
- package/dist/bootstrap/process.js +0 -23
- package/dist/bootstrap/run.d.ts +0 -25
- package/dist/bootstrap/run.js +0 -98
- package/dist/bootstrap/stdio.d.ts +0 -4
- package/dist/bootstrap/stdio.js +0 -9
- package/dist/cli/environment.d.ts +0 -8
- package/dist/cli/services.d.ts +0 -4
- package/dist/command-line/emit/json-decoder.d.ts +0 -3
- package/dist/command-line/input/stdin-stream.d.ts +0 -4
- package/dist/command-receipt/command.d.ts +0 -4
- package/dist/command-receipt/compact-list.d.ts +0 -20
- package/dist/command-receipt/index.d.ts +0 -3
- package/dist/command-tree/completion.d.ts +0 -6
- package/dist/command-tree/local.d.ts +0 -3
- package/dist/command-tree/row.js +0 -2
- package/dist/connection/access/format.d.ts +0 -8
- package/dist/connection/access/input.d.ts +0 -53
- package/dist/connection/input.d.ts +0 -50
- package/dist/connection/signin.d.ts +0 -4
- package/dist/connection/tree/index.d.ts +0 -2
- package/dist/connection/tree/tree.d.ts +0 -3
- package/dist/container/output/format.d.ts +0 -11
- package/dist/container/output/index.d.ts +0 -2
- package/dist/context/client.d.ts +0 -7
- package/dist/context/commands.d.ts +0 -3
- package/dist/context/index.d.ts +0 -3
- package/dist/dashboard/cockpit-client.d.ts +0 -6
- package/dist/dashboard/cockpit-client.js +0 -27
- package/dist/dashboard/cockpits.d.ts +0 -29
- package/dist/dashboard/cockpits.js +0 -65
- package/dist/dashboard/dashboard.d.ts +0 -7
- package/dist/dashboard/draw.d.ts +0 -15
- package/dist/dashboard/frame.d.ts +0 -4
- package/dist/dashboard/index.d.ts +0 -2
- package/dist/dashboard/modes.d.ts +0 -5
- package/dist/dashboard/node-connection.d.ts +0 -15
- package/dist/dashboard/node-connection.js +0 -51
- package/dist/dashboard/pi-tui.d.ts +0 -6
- package/dist/dashboard/status-bar.d.ts +0 -4
- package/dist/dashboard/terminal.d.ts +0 -53
- package/dist/dashboard/tree-model.d.ts +0 -28
- package/dist/dashboard/tree.d.ts +0 -10
- package/dist/development/cli.d.ts +0 -3
- package/dist/development/cli.js +0 -44
- package/dist/events/commands.d.ts +0 -11
- package/dist/events/index.d.ts +0 -2
- package/dist/events/tree/index.d.ts +0 -2
- package/dist/events/tree/tree.d.ts +0 -10
- package/dist/execution/tree/index.d.ts +0 -2
- package/dist/execution/tree/tree.d.ts +0 -3
- package/dist/hold/output/format.d.ts +0 -11
- package/dist/hold/output/index.d.ts +0 -2
- package/dist/hold/tree/index.d.ts +0 -2
- package/dist/hold/tree/tree.d.ts +0 -3
- package/dist/import/input.d.ts +0 -19
- package/dist/import/output.d.ts +0 -6
- package/dist/integration/output.d.ts +0 -22
- package/dist/login/failure.d.ts +0 -3
- package/dist/login/gateway.d.ts +0 -12
- package/dist/login/menu.d.ts +0 -4
- package/dist/login/output/format.d.ts +0 -16
- package/dist/login/output/index.d.ts +0 -2
- package/dist/login/vendor-account.d.ts +0 -95
- package/dist/login/vendor-input.d.ts +0 -14
- package/dist/mcp/calls.d.ts +0 -8
- package/dist/orchestration/output/compact-aggregate.d.ts +0 -121
- package/dist/orchestration/output/compact-run-list.d.ts +0 -20
- package/dist/orchestration/output/human.d.ts +0 -80
- package/dist/orchestration/output/index.d.ts +0 -4
- package/dist/orchestration/tree/index.d.ts +0 -2
- package/dist/orchestration/tree/tree.d.ts +0 -3
- package/dist/port-lease/input.d.ts +0 -65
- package/dist/port-lease/output/format.d.ts +0 -11
- package/dist/port-lease/output/index.d.ts +0 -2
- package/dist/presentation/output/format.d.ts +0 -11
- package/dist/presentation/output/index.d.ts +0 -3
- package/dist/project-guard/input.d.ts +0 -21
- package/dist/project-guard/output/format.d.ts +0 -11
- package/dist/project-guard/output/index.d.ts +0 -2
- package/dist/project-workspace/output/human.d.ts +0 -139
- package/dist/project-workspace/output/index.d.ts +0 -3
- package/dist/project-workspace/output/metadata.d.ts +0 -11
- package/dist/project-workspace/tree/index.d.ts +0 -2
- package/dist/project-workspace/tree/tree.d.ts +0 -3
- package/dist/provider/client.d.ts +0 -6
- package/dist/provider/commands.d.ts +0 -3
- package/dist/provider/index.d.ts +0 -3
- package/dist/reference/commands.d.ts +0 -3
- package/dist/reference/index.d.ts +0 -3
- package/dist/reference/resolve.d.ts +0 -31
- package/dist/reference/tree/index.d.ts +0 -2
- package/dist/reference/tree/tree.d.ts +0 -3
- package/dist/remote-node/reachability.d.ts +0 -64
- package/dist/remote-node/text.d.ts +0 -10
- package/dist/remote-node/tree/index.d.ts +0 -2
- package/dist/remote-node/tree/tree.d.ts +0 -3
- package/dist/routine/input.d.ts +0 -28
- package/dist/routine/output/format.d.ts +0 -23
- package/dist/routine/output/index.d.ts +0 -2
- package/dist/routine/tree/index.d.ts +0 -2
- package/dist/routine/tree/tree.d.ts +0 -3
- package/dist/run-ledger/input.d.ts +0 -42
- package/dist/run-ledger/output/format.d.ts +0 -11
- package/dist/run-ledger/output/index.d.ts +0 -2
- package/dist/session/approval/output/format.d.ts +0 -23
- package/dist/session/approval/output/index.d.ts +0 -2
- package/dist/session/attach-render.d.ts +0 -16
- package/dist/session/create-tasks.d.ts +0 -20
- package/dist/session/interaction/input.d.ts +0 -15
- package/dist/session/interaction/output/format.d.ts +0 -11
- package/dist/session/interaction/output/index.d.ts +0 -2
- package/dist/session/output/diff.d.ts +0 -3
- package/dist/session/output/failure.d.ts +0 -11
- package/dist/session/output/human.d.ts +0 -115
- package/dist/session/output/index.d.ts +0 -6
- package/dist/session/output/observe.d.ts +0 -4
- package/dist/session/output/tasks.d.ts +0 -36
- package/dist/session/task-file.d.ts +0 -5
- package/dist/session/tree/index.d.ts +0 -2
- package/dist/session/tree/tree.d.ts +0 -3
- package/dist/team-workspace/ceremony.d.ts +0 -19
- package/dist/team-workspace/confirmation.d.ts +0 -4
- package/dist/team-workspace/dependencies.js +0 -2
- package/dist/team-workspace/output.d.ts +0 -15
- package/dist/terminal/arguments.d.ts +0 -13
- package/dist/terminal/keys.d.ts +0 -12
- package/dist/terminal/output/compact-list.d.ts +0 -149
- package/dist/terminal/output/human.d.ts +0 -42
- package/dist/terminal/output/index.d.ts +0 -3
- package/dist/terminal/tree/index.d.ts +0 -2
- package/dist/terminal/tree/tree.d.ts +0 -3
package/dist/session/client.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
69
69
|
readonly commandId: string;
|
|
70
70
|
readonly grantedAt: string;
|
|
71
71
|
readonly inputDigest: string;
|
|
72
|
-
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "session.wait" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
72
|
+
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "session.wait" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "webhooks.change.confirm" | "webhooks.change.preview" | "webhooks.deliveries" | "webhooks.list" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
73
73
|
readonly revision: "1";
|
|
74
74
|
};
|
|
75
75
|
readonly method: "session.agent-permission.confirm";
|
|
@@ -106,7 +106,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
106
106
|
readonly inputDigest: string;
|
|
107
107
|
readonly issuedAt: string;
|
|
108
108
|
readonly method: "session.agent-permission.preview";
|
|
109
|
-
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "session.wait" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
109
|
+
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "session.wait" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "webhooks.change.confirm" | "webhooks.change.preview" | "webhooks.deliveries" | "webhooks.list" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
110
110
|
readonly proof: string;
|
|
111
111
|
}>;
|
|
112
112
|
attachSession: (input: import("./attach-client.js").AttachSessionInput) => CliNodeEffect<import("./attach-client.js").SessionAttachStream>;
|
|
@@ -8,6 +8,8 @@ export type ArchiveSessionInput = {
|
|
|
8
8
|
readonly commandId?: string;
|
|
9
9
|
readonly expectedRevision: string;
|
|
10
10
|
readonly sessionId: string;
|
|
11
|
+
readonly summary?: string;
|
|
12
|
+
readonly transcriptPath?: string;
|
|
11
13
|
};
|
|
12
14
|
export declare const makeCodingSessionClient: (node: CliNodeOperations) => {
|
|
13
15
|
archiveSession: (input: ArchiveSessionInput) => CliNodeEffect<SessionArchiveResult>;
|
|
@@ -3,9 +3,8 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import { commandIdentifier, } from "../local-node/index.js";
|
|
4
4
|
export const makeCodingSessionClient = (node) => ({
|
|
5
5
|
archiveSession: (input) => Effect.flatMap(commandIdentifier(input.commandId), (commandId) => node.runValidatedNodeOperation({
|
|
6
|
+
...input,
|
|
6
7
|
commandId,
|
|
7
|
-
expectedRevision: input.expectedRevision,
|
|
8
|
-
sessionId: input.sessionId,
|
|
9
8
|
}, sessionArchiveParametersSchema, (client, parameters, options) => client.archiveSession(parameters, options), { commandId })),
|
|
10
9
|
diffSession: (input) => node.runValidatedNodeOperation({
|
|
11
10
|
sessionId: input.sessionId,
|
|
@@ -29,19 +29,36 @@ const summarizeArchive = (result) => ({
|
|
|
29
29
|
revision: result.session.revision,
|
|
30
30
|
sessionId: result.session.id,
|
|
31
31
|
state: result.session.state,
|
|
32
|
+
...(result.summary === undefined ? {} : { summary: result.summary }),
|
|
33
|
+
...(result.transcriptPath === undefined
|
|
34
|
+
? {}
|
|
35
|
+
: { transcriptPath: result.transcriptPath }),
|
|
32
36
|
});
|
|
33
|
-
|
|
34
|
-
const parsed = parseOptions(tokens, new Set([
|
|
37
|
+
const readArchiveInput = (tokens) => {
|
|
38
|
+
const parsed = parseOptions(tokens, new Set([
|
|
39
|
+
"--command-id",
|
|
40
|
+
"--expected-revision",
|
|
41
|
+
"--summary",
|
|
42
|
+
"--transcript",
|
|
43
|
+
]));
|
|
35
44
|
requirePositionals(parsed.positionals, 1);
|
|
36
|
-
const { archiveSession } = context.dependencies;
|
|
37
|
-
if (archiveSession === undefined)
|
|
38
|
-
throw new CliArgumentError("Session archive is unavailable.");
|
|
39
45
|
const commandId = parsed.options.get("--command-id");
|
|
40
|
-
const
|
|
46
|
+
const summary = parsed.options.get("--summary");
|
|
47
|
+
const transcriptPath = parsed.options.get("--transcript");
|
|
48
|
+
return {
|
|
41
49
|
...(commandId === undefined ? {} : { commandId }),
|
|
42
50
|
expectedRevision: readExpectedRevision(parsed.options.get("--expected-revision")),
|
|
43
51
|
sessionId: requireSessionId(parsed.positionals),
|
|
44
|
-
|
|
52
|
+
...(summary === undefined ? {} : { summary }),
|
|
53
|
+
...(transcriptPath === undefined ? {} : { transcriptPath }),
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export const runSessionArchive = (tokens, context) => Effect.gen(function* () {
|
|
57
|
+
const input = readArchiveInput(tokens);
|
|
58
|
+
const { archiveSession } = context.dependencies;
|
|
59
|
+
if (archiveSession === undefined)
|
|
60
|
+
throw new CliArgumentError("Session archive is unavailable.");
|
|
61
|
+
const result = yield* archiveSession(input);
|
|
45
62
|
return writeSessionResult(result, context, (value) => ({
|
|
46
63
|
command: "session.archive",
|
|
47
64
|
result: summarizeArchive(value),
|
package/dist/session/commands.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MAX_SESSION_INBOX_CHECK_LIMIT, MAX_SESSION_MESSAGE_BODY_BYTES, MAX_SESSION_OBSERVE_IDS, MAX_SESSION_STALL_AFTER_SECONDS, MIN_SESSION_STALL_AFTER_SECONDS, SESSION_EFFORT_LEVELS, sessionBaseRefSchema, sessionCreateParametersSchema, } from "@maiaos/sdk";
|
|
1
|
+
import { MAX_SESSION_INBOX_CHECK_LIMIT, MAX_SESSION_MESSAGE_BODY_BYTES, MAX_SESSION_OBSERVE_IDS, MAX_SESSION_SETTLED_IDLE_SECONDS, MAX_SESSION_STALL_AFTER_SECONDS, MIN_SESSION_STALL_AFTER_SECONDS, SESSION_EFFORT_LEVELS, sessionBaseRefSchema, sessionCreateParametersSchema, } from "@maiaos/sdk";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { listEach, writeMerged } from "../address-space/index.js";
|
|
4
|
-
import { CliArgumentError, parseOptions, parseOptionsWith, readCursor, readDuration, readExpectedRevision, readPageSize, readPermission, readWaitTimeoutSeconds, requirePositionals, writeNodeResult, } from "../command-line/index.js";
|
|
4
|
+
import { CliArgumentError, LABEL_OPTION, parseOptions, parseOptionsWith, readCursor, readDuration, readExpectedRevision, readLabels, readPageSize, readPermission, readSessionRole, readSessionTitle, readWaitTimeoutSeconds, requireOneLabelPerOption, requirePositionals, writeNodeResult, } from "../command-line/index.js";
|
|
5
5
|
import { mergeLists } from "../fleet/index.js";
|
|
6
6
|
import { runSessionTasks, } from "./create-tasks.js";
|
|
7
7
|
import { formatMergedSessions, formatSessionShow, writeSessionResult, } from "./output/index.js";
|
|
@@ -106,13 +106,6 @@ const readEffort = (value) => {
|
|
|
106
106
|
return level;
|
|
107
107
|
throw new CliArgumentError(`Option '--effort' must be ${SESSION_EFFORT_LEVELS["codex-cli"].slice(0, -1).join(", ")} or ${SESSION_EFFORT_LEVELS["codex-cli"].at(-1) ?? "ultra"}.`);
|
|
108
108
|
};
|
|
109
|
-
const readSessionRole = (value) => {
|
|
110
|
-
if (value === undefined)
|
|
111
|
-
return {};
|
|
112
|
-
if (value === "worker" || value === "orchestrator")
|
|
113
|
-
return { role: value };
|
|
114
|
-
throw new CliArgumentError("Option '--role' must be worker or orchestrator.");
|
|
115
|
-
};
|
|
116
109
|
const AGENT_FIXED_OPTIONS = [
|
|
117
110
|
"--agent-definition",
|
|
118
111
|
"--agent-definition-digest",
|
|
@@ -131,35 +124,6 @@ const readAgentId = (options) => {
|
|
|
131
124
|
throw new CliArgumentError(`Option '--agent' fixes the harness, Connection, model and effort; drop '${clash}'.`);
|
|
132
125
|
return { agentId };
|
|
133
126
|
};
|
|
134
|
-
const LABEL_OPTION = new Set(["--label"]);
|
|
135
|
-
const requireOneLabelPerOption = (tokens) => {
|
|
136
|
-
const given = tokens.flatMap((token, index) => {
|
|
137
|
-
if (tokens[index - 1] === "--label")
|
|
138
|
-
return [token];
|
|
139
|
-
return token.startsWith("--label=") ? [token.slice("--label=".length)] : [];
|
|
140
|
-
});
|
|
141
|
-
if (given.some((value) => value.includes(",")))
|
|
142
|
-
throw new CliArgumentError("Option '--label' takes one key=value; repeat the option for more.");
|
|
143
|
-
};
|
|
144
|
-
const readLabels = (value) => {
|
|
145
|
-
if (value === undefined)
|
|
146
|
-
return {};
|
|
147
|
-
const pairs = value.split(",").map((pair) => {
|
|
148
|
-
const separator = pair.indexOf("=");
|
|
149
|
-
if (separator < 1)
|
|
150
|
-
throw new CliArgumentError("Option '--label' takes key=value.");
|
|
151
|
-
return [pair.slice(0, separator), pair.slice(separator + 1)];
|
|
152
|
-
});
|
|
153
|
-
const duplicate = pairs.find(([key], index) => pairs.findIndex(([other]) => other === key) !== index);
|
|
154
|
-
if (duplicate !== undefined)
|
|
155
|
-
throw new CliArgumentError(`Label '${duplicate[0]}' is given twice.`);
|
|
156
|
-
return { labels: Object.fromEntries(pairs) };
|
|
157
|
-
};
|
|
158
|
-
const readSessionTitle = (options) => {
|
|
159
|
-
if (options.has("--name") && options.has("--title"))
|
|
160
|
-
throw new CliArgumentError("Use one of '--name' or '--title'.");
|
|
161
|
-
return options.get("--title") ?? options.get("--name");
|
|
162
|
-
};
|
|
163
127
|
const readSessionSelection = ({ flags, options }, workspaceId) => {
|
|
164
128
|
const agent = readAgentId(options);
|
|
165
129
|
const commandId = options.get("--command-id");
|
|
@@ -315,8 +279,39 @@ export const runSessionCreate = (tokens, context) => {
|
|
|
315
279
|
result: summarizeSessionCreation(value),
|
|
316
280
|
})));
|
|
317
281
|
};
|
|
282
|
+
const readSettled = ({ flags, options, }) => {
|
|
283
|
+
const idleFor = options.get("--idle-for");
|
|
284
|
+
if (!flags.has("--settled")) {
|
|
285
|
+
if (idleFor !== undefined)
|
|
286
|
+
throw new CliArgumentError("Use '--idle-for' with '--settled'.");
|
|
287
|
+
return {};
|
|
288
|
+
}
|
|
289
|
+
return {
|
|
290
|
+
...(idleFor === undefined
|
|
291
|
+
? {}
|
|
292
|
+
: {
|
|
293
|
+
idleForSeconds: readDuration(idleFor, "--idle-for", {
|
|
294
|
+
max: MAX_SESSION_SETTLED_IDLE_SECONDS,
|
|
295
|
+
min: 1,
|
|
296
|
+
}),
|
|
297
|
+
}),
|
|
298
|
+
settled: true,
|
|
299
|
+
};
|
|
300
|
+
};
|
|
318
301
|
const readSessionList = (tokens) => {
|
|
319
|
-
|
|
302
|
+
requireOneLabelPerOption(tokens);
|
|
303
|
+
const parsed = parseOptionsWith(tokens, {
|
|
304
|
+
allowed: new Set([
|
|
305
|
+
"--after",
|
|
306
|
+
"--idle-for",
|
|
307
|
+
"--label",
|
|
308
|
+
"--limit",
|
|
309
|
+
"--project",
|
|
310
|
+
"--state",
|
|
311
|
+
]),
|
|
312
|
+
allowedFlags: new Set(["--all", "--attention", "--settled"]),
|
|
313
|
+
repeatable: LABEL_OPTION,
|
|
314
|
+
});
|
|
320
315
|
requirePositionals(parsed.positionals, 0);
|
|
321
316
|
const projectId = parsed.options.get("--project");
|
|
322
317
|
if ((projectId === undefined) === !parsed.flags.has("--all"))
|
|
@@ -324,7 +319,9 @@ const readSessionList = (tokens) => {
|
|
|
324
319
|
const states = parsed.options.get("--state")?.split(",");
|
|
325
320
|
return {
|
|
326
321
|
afterCursor: readCursor(parsed.options.get("--after")),
|
|
322
|
+
...readSettled(parsed),
|
|
327
323
|
limit: readPageSize(parsed.options.get("--limit")),
|
|
324
|
+
...readLabels(parsed.options.get("--label")),
|
|
328
325
|
...(projectId === undefined ? {} : { projectId }),
|
|
329
326
|
...(parsed.flags.has("--attention") ? { attention: true } : {}),
|
|
330
327
|
...(states === undefined ? {} : { states }),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { cell, fields, formatRows, tab, withPrunedHistory, writeNodeResult, } from "../../command-line/index.js";
|
|
1
|
+
import { cell, fields, formatRows, labelCells, tab, withPrunedHistory, writeNodeResult, } from "../../command-line/index.js";
|
|
2
2
|
import { formatSessionDiff } from "./diff.js";
|
|
3
3
|
import { formatFailure, formatSessionEvents } from "./failure.js";
|
|
4
4
|
import { formatSessionObservation } from "./observe.js";
|
|
5
|
-
import { activityLabel, formatSessionList, formatSessionTasks,
|
|
5
|
+
import { activityLabel, formatSessionList, formatSessionTasks, } from "./tasks.js";
|
|
6
6
|
const formatSessionInbox = (deliveries) => formatRows(deliveries, (delivery) => `${delivery.deliveryId}\t${delivery.sequence}\t${cell(delivery.message.senderSessionId)}\t${cell(delivery.message.subject)}\t${cell(delivery.message.body)}`);
|
|
7
7
|
const formatSessionCreation = (result) => `${fields([
|
|
8
8
|
["session", result.sessionId],
|
|
@@ -33,9 +33,20 @@ const formatCodingSession = (result) => {
|
|
|
33
33
|
const formatAgentPermission = (result) => result.command === "session.agent-permission.preview"
|
|
34
34
|
? `${result.result.sessionId}\t${result.result.expiresAt}\n`
|
|
35
35
|
: `${result.result.receipt.receiptId}\t${result.result.delivery}\n`;
|
|
36
|
+
const formatPrompt = (prompt) => prompt === undefined
|
|
37
|
+
? ""
|
|
38
|
+
: `prompt: ${prompt.approvalId}\t${prompt.kind}\texpires=${prompt.expiresAt}\n${(prompt.summary ?? "")
|
|
39
|
+
.split("\n")
|
|
40
|
+
.map((line) => ` ${line}`)
|
|
41
|
+
.join("\n")}\n${(prompt.options ?? [])
|
|
42
|
+
.map((option) => ` ${option.optionId}\t${option.label}\n`)
|
|
43
|
+
.join("")}`;
|
|
36
44
|
export const formatSessionShow = ({ session, }) => `${fields([
|
|
37
45
|
["session", session.id],
|
|
38
46
|
["state", session.state],
|
|
47
|
+
...(session.status === undefined
|
|
48
|
+
? []
|
|
49
|
+
: [["status", session.status]]),
|
|
39
50
|
...(session.activity === undefined
|
|
40
51
|
? []
|
|
41
52
|
: [["activity", activityLabel(session)]]),
|
|
@@ -51,7 +62,7 @@ export const formatSessionShow = ({ session, }) => `${fields([
|
|
|
51
62
|
session.labels === undefined ? undefined : labelCells(session.labels),
|
|
52
63
|
],
|
|
53
64
|
["updated", session.updatedAt],
|
|
54
|
-
])}${formatFailure(session.failure)}`;
|
|
65
|
+
])}${formatPrompt(session.prompt)}${formatFailure(session.failure)}`;
|
|
55
66
|
const formatLifecycle = ({ revision, sessionId, state, }) => `${fields([
|
|
56
67
|
["session", sessionId],
|
|
57
68
|
["state", state],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatMerged } from "../../address-space/index.js";
|
|
2
|
-
import { cell, fields, formatRows, tab, withNextPage, } from "../../command-line/index.js";
|
|
2
|
+
import { cell, fields, formatRows, labelCells, tab, withNextPage, } from "../../command-line/index.js";
|
|
3
3
|
import { formatFailureCell } from "./failure.js";
|
|
4
4
|
const failureDetail = ({ failure, message, }) => {
|
|
5
5
|
if (failure !== undefined)
|
|
@@ -37,6 +37,7 @@ const SESSION_HEADERS = [
|
|
|
37
37
|
"SESSION",
|
|
38
38
|
"STATE",
|
|
39
39
|
"ACTIVITY",
|
|
40
|
+
"STATUS",
|
|
40
41
|
"WORKSPACE",
|
|
41
42
|
"ATTENTION",
|
|
42
43
|
"CONTAINMENT",
|
|
@@ -44,18 +45,23 @@ const SESSION_HEADERS = [
|
|
|
44
45
|
"LABELS",
|
|
45
46
|
"LAST ACTIVE",
|
|
46
47
|
];
|
|
47
|
-
export const activityLabel = (session) =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.
|
|
54
|
-
|
|
48
|
+
export const activityLabel = (session) => {
|
|
49
|
+
const completed = session.status === undefined
|
|
50
|
+
? session.latestTurnState === "completed"
|
|
51
|
+
: session.status === "done";
|
|
52
|
+
return session.activity === "idle" && completed
|
|
53
|
+
? "done"
|
|
54
|
+
: (session.activity ?? "-");
|
|
55
|
+
};
|
|
56
|
+
const sessionHeaders = (items) => items.some((session) => session.settledReason !== undefined)
|
|
57
|
+
? [...SESSION_HEADERS, "SETTLED"]
|
|
58
|
+
: SESSION_HEADERS;
|
|
59
|
+
const settledCells = (session, headers) => headers.length > SESSION_HEADERS.length ? [session.settledReason ?? "-"] : [];
|
|
55
60
|
const sessionCells = (session, attention) => [
|
|
56
61
|
session.id,
|
|
57
62
|
session.state,
|
|
58
63
|
activityLabel(session),
|
|
64
|
+
session.status ?? "-",
|
|
59
65
|
session.workspaceId,
|
|
60
66
|
attention ?? "-",
|
|
61
67
|
session.containment ?? "-",
|
|
@@ -65,7 +71,11 @@ const sessionCells = (session, attention) => [
|
|
|
65
71
|
];
|
|
66
72
|
export const formatSessionList = (result) => {
|
|
67
73
|
const attention = new Map((result.attention ?? []).map((item) => [item.sessionId, item.attention]));
|
|
68
|
-
|
|
74
|
+
const headers = sessionHeaders(result.items);
|
|
75
|
+
return withNextPage(formatRows(result.items, (session) => tab([
|
|
76
|
+
...sessionCells(session, attention.get(session.id)),
|
|
77
|
+
...settledCells(session, headers),
|
|
78
|
+
]), { empty: "No Sessions.", headers }), result.nextCursor);
|
|
69
79
|
};
|
|
70
80
|
const sessionKey = (node, id) => `${node} ${id}`;
|
|
71
81
|
export const formatMergedSessions = ({ result, }) => {
|
|
@@ -73,6 +83,10 @@ export const formatMergedSessions = ({ result, }) => {
|
|
|
73
83
|
sessionKey(item.node, item.sessionId),
|
|
74
84
|
item.attention,
|
|
75
85
|
]));
|
|
76
|
-
|
|
86
|
+
const headers = sessionHeaders(result.items);
|
|
87
|
+
return formatMerged(result, (session) => tab([
|
|
88
|
+
...sessionCells(session, attention.get(sessionKey(session.node, session.id))),
|
|
89
|
+
...settledCells(session, headers),
|
|
90
|
+
]), { empty: "No Sessions.", headers });
|
|
77
91
|
};
|
|
78
92
|
//# sourceMappingURL=tasks.js.map
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.",
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { type WebhooksChangeConfirmParameters, type WebhooksChangePreviewParameters, type WebhooksDeliveriesParameters, type WebhooksListParameters } from "@maiaos/sdk";
|
|
2
|
+
import type { CliNodeOperations } from "../local-node/index.js";
|
|
3
|
+
export declare const makeWebhooksClient: (node: CliNodeOperations) => {
|
|
4
|
+
confirmWebhookChange: (input: WebhooksChangeConfirmParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
5
|
+
readonly actorId: string;
|
|
6
|
+
readonly commandId: string;
|
|
7
|
+
readonly delivery: "duplicate" | "new";
|
|
8
|
+
readonly deliveryId?: string | undefined;
|
|
9
|
+
readonly inputDigest: string;
|
|
10
|
+
readonly kind: "add" | "redeliver" | "remove" | "test";
|
|
11
|
+
readonly method: "webhooks.change.confirm";
|
|
12
|
+
readonly receipt: {
|
|
13
|
+
readonly actorId: string;
|
|
14
|
+
readonly aggregateRevision: string;
|
|
15
|
+
readonly commandId: string;
|
|
16
|
+
readonly createdAt: string;
|
|
17
|
+
readonly eventCursor: string;
|
|
18
|
+
readonly method: string;
|
|
19
|
+
readonly receiptId: string;
|
|
20
|
+
readonly schemaVersion: 1;
|
|
21
|
+
readonly state: "succeeded";
|
|
22
|
+
readonly target: {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly type: string;
|
|
25
|
+
};
|
|
26
|
+
readonly updatedAt: string;
|
|
27
|
+
};
|
|
28
|
+
readonly webhook: {
|
|
29
|
+
readonly actorId: string;
|
|
30
|
+
readonly createdAt: string;
|
|
31
|
+
readonly droppedParked: number;
|
|
32
|
+
readonly gapOldest?: string | undefined;
|
|
33
|
+
readonly gapResets: number;
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly lastErrorClass?: string | undefined;
|
|
36
|
+
readonly revision: string;
|
|
37
|
+
readonly schemaVersion: "maia.webhook/v1";
|
|
38
|
+
readonly spec: {
|
|
39
|
+
readonly allowPrivate: boolean;
|
|
40
|
+
readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
|
|
41
|
+
readonly filters: readonly {
|
|
42
|
+
readonly key: string;
|
|
43
|
+
readonly value: string;
|
|
44
|
+
}[];
|
|
45
|
+
readonly secretEnv: string;
|
|
46
|
+
readonly url: string;
|
|
47
|
+
};
|
|
48
|
+
readonly state: "active" | "removed";
|
|
49
|
+
readonly updatedAt: string;
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
52
|
+
listWebhookDeliveries: (input: WebhooksDeliveriesParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
53
|
+
readonly items: readonly {
|
|
54
|
+
readonly attempts: number;
|
|
55
|
+
readonly createdAt: string;
|
|
56
|
+
readonly errorClass?: string | undefined;
|
|
57
|
+
readonly eventId: string;
|
|
58
|
+
readonly id: string;
|
|
59
|
+
readonly kind: "admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test";
|
|
60
|
+
readonly nextAttemptAt?: string | undefined;
|
|
61
|
+
readonly state: "dead" | "delivered" | "denied" | "expired" | "in_flight" | "pending" | "retry";
|
|
62
|
+
readonly updatedAt: string;
|
|
63
|
+
readonly webhookId: string;
|
|
64
|
+
}[];
|
|
65
|
+
readonly method: "webhooks.deliveries";
|
|
66
|
+
readonly nextCursor?: string | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
listWebhooks: (input: WebhooksListParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
69
|
+
readonly items: readonly {
|
|
70
|
+
readonly actorId: string;
|
|
71
|
+
readonly createdAt: string;
|
|
72
|
+
readonly droppedParked: number;
|
|
73
|
+
readonly gapOldest?: string | undefined;
|
|
74
|
+
readonly gapResets: number;
|
|
75
|
+
readonly id: string;
|
|
76
|
+
readonly lastErrorClass?: string | undefined;
|
|
77
|
+
readonly revision: string;
|
|
78
|
+
readonly schemaVersion: "maia.webhook/v1";
|
|
79
|
+
readonly spec: {
|
|
80
|
+
readonly allowPrivate: boolean;
|
|
81
|
+
readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
|
|
82
|
+
readonly filters: readonly {
|
|
83
|
+
readonly key: string;
|
|
84
|
+
readonly value: string;
|
|
85
|
+
}[];
|
|
86
|
+
readonly secretEnv: string;
|
|
87
|
+
readonly url: string;
|
|
88
|
+
};
|
|
89
|
+
readonly state: "active" | "removed";
|
|
90
|
+
readonly updatedAt: string;
|
|
91
|
+
}[];
|
|
92
|
+
readonly method: "webhooks.list";
|
|
93
|
+
readonly nextCursor?: string | undefined;
|
|
94
|
+
}>;
|
|
95
|
+
previewWebhookChange: (input: WebhooksChangePreviewParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
96
|
+
readonly change: {
|
|
97
|
+
readonly kind: "add";
|
|
98
|
+
readonly spec: {
|
|
99
|
+
readonly allowPrivate: boolean;
|
|
100
|
+
readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
|
|
101
|
+
readonly filters: readonly {
|
|
102
|
+
readonly key: string;
|
|
103
|
+
readonly value: string;
|
|
104
|
+
}[];
|
|
105
|
+
readonly secretEnv: string;
|
|
106
|
+
readonly url: string;
|
|
107
|
+
};
|
|
108
|
+
} | {
|
|
109
|
+
readonly expectedRevision: string;
|
|
110
|
+
readonly webhookId: string;
|
|
111
|
+
readonly kind: "remove";
|
|
112
|
+
} | {
|
|
113
|
+
readonly expectedRevision: string;
|
|
114
|
+
readonly webhookId: string;
|
|
115
|
+
readonly kind: "test";
|
|
116
|
+
} | {
|
|
117
|
+
readonly deliveryId: string;
|
|
118
|
+
readonly expectedRevision: string;
|
|
119
|
+
readonly kind: "redeliver";
|
|
120
|
+
};
|
|
121
|
+
readonly commandId: string;
|
|
122
|
+
readonly inputDigest: string;
|
|
123
|
+
readonly proof: string;
|
|
124
|
+
readonly actorId: string;
|
|
125
|
+
readonly current?: {
|
|
126
|
+
readonly actorId: string;
|
|
127
|
+
readonly createdAt: string;
|
|
128
|
+
readonly droppedParked: number;
|
|
129
|
+
readonly gapOldest?: string | undefined;
|
|
130
|
+
readonly gapResets: number;
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly lastErrorClass?: string | undefined;
|
|
133
|
+
readonly revision: string;
|
|
134
|
+
readonly schemaVersion: "maia.webhook/v1";
|
|
135
|
+
readonly spec: {
|
|
136
|
+
readonly allowPrivate: boolean;
|
|
137
|
+
readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
|
|
138
|
+
readonly filters: readonly {
|
|
139
|
+
readonly key: string;
|
|
140
|
+
readonly value: string;
|
|
141
|
+
}[];
|
|
142
|
+
readonly secretEnv: string;
|
|
143
|
+
readonly url: string;
|
|
144
|
+
};
|
|
145
|
+
readonly state: "active" | "removed";
|
|
146
|
+
readonly updatedAt: string;
|
|
147
|
+
} | undefined;
|
|
148
|
+
readonly deletesDeliveries?: number | undefined;
|
|
149
|
+
readonly expiresAt: string;
|
|
150
|
+
readonly issuedAt: string;
|
|
151
|
+
readonly method: "webhooks.change.preview";
|
|
152
|
+
readonly webhookId: string;
|
|
153
|
+
}>;
|
|
154
|
+
};
|
|
155
|
+
export type WebhooksCliDependencies = ReturnType<typeof makeWebhooksClient>;
|
|
156
|
+
//# sourceMappingURL=client.d.ts.map
|