@maiaos/cli 0.1.0-canary.80 → 0.1.0-canary.82
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/dist/bin/maia.cdx.json +24 -24
- package/dist/bin/maia.mjs +1 -1
- package/dist/cli/cli.js +4 -0
- package/dist/command-line/context.d.ts +6 -2
- package/dist/local-node/client.d.ts +1 -0
- package/dist/local-node/client.js +4 -2
- package/dist/local-node/index.d.ts +1 -1
- package/dist/local-node/index.js +1 -1
- package/dist/local-node/launch/index.d.ts +2 -0
- package/dist/local-node/launch/index.js +2 -0
- package/dist/local-node/launch/launch.d.ts +19 -0
- package/dist/local-node/launch/launch.js +49 -0
- package/dist/mcp/routing.js +1 -0
- package/dist/reference/resolve.js +2 -1
- package/dist/remote-node/commands.d.ts +1 -0
- package/dist/remote-node/commands.js +29 -2
- package/dist/remote-node/index.d.ts +1 -1
- package/dist/remote-node/index.js +1 -1
- package/dist/remote-node/lifecycle.js +66 -0
- package/dist/remote-node/tree/tree.js +12 -0
- package/dist/session/agent-permission.d.ts +2 -2
- package/dist/session/attach-render.js +6 -0
- package/dist/session/client.d.ts +3 -2
- package/dist/session/commands.d.ts +1 -0
- package/dist/session/commands.js +55 -10
- package/dist/session/create-tasks.js +15 -5
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/tree/tree.js +60 -4
- package/dist/session/turn/client.d.ts +7 -1
- package/dist/session/turn/client.js +15 -1
- package/dist/session/turn/commands.d.ts +3 -0
- package/dist/session/turn/commands.js +52 -8
- package/dist/session/turn/index.d.ts +2 -2
- package/dist/session/turn/index.js +1 -1
- package/dist/session/turn/output.d.ts +6 -4
- package/dist/session/turn/output.js +7 -0
- package/guidance/maia-sessions/SKILL.md +7 -0
- package/package.json +4 -4
package/dist/session/client.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export type CreateSessionInput = {
|
|
|
22
22
|
readonly permission?: SessionCreateParameters["permission"];
|
|
23
23
|
readonly role?: SessionCreateParameters["role"];
|
|
24
24
|
readonly title?: string;
|
|
25
|
+
readonly wakeOnChildSettle?: SessionCreateParameters["wakeOnChildSettle"];
|
|
25
26
|
readonly workspaceId: string;
|
|
26
27
|
};
|
|
27
28
|
export type ListSessionsInput = Omit<SessionListParameters, "states"> & {
|
|
@@ -67,7 +68,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
67
68
|
readonly commandId: string;
|
|
68
69
|
readonly grantedAt: string;
|
|
69
70
|
readonly inputDigest: string;
|
|
70
|
-
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "board.message.post" | "board.message.reply" | "board.path.read" | "board.task.assign" | "board.task.cancel" | "board.task.claim" | "board.task.complete" | "board.task.create" | "board.task.fail" | "board.task.list" | "board.task.needs.replace" | "board.task.plan" | "board.task.promote" | "board.task.release" | "board.task.renew" | "board.task.reopen" | "board.task.show" | "board.thread.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.executors.list" | "connection.executors.show" | "connection.gateway.create" | "connection.github.create" | "connection.github.revoke" | "connection.github.show" | "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" | "goal.clear" | "goal.mark" | "goal.set" | "goal.show" | "goal.transition" | "goal.update" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "inbox.list" | "inbox.respond" | "inbox.settle" | "inbox.show" | "inbox.snooze" | "integration.apply.antigravity" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.grok-cli" | "integration.apply.maia-agent" | "integration.apply.pi" | "integration.apply.pi-rpc" | "integration.plan.antigravity" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.grok-cli" | "integration.plan.maia-agent" | "integration.plan.pi" | "integration.plan.pi-rpc" | "integration.remove.antigravity" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.grok-cli" | "integration.remove.maia-agent" | "integration.remove.pi" | "integration.remove.pi-rpc" | "integration.status.antigravity" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.grok-cli" | "integration.status.maia-agent" | "integration.status.pi" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.pairing.confirm" | "node.pairing.preview" | "node.pairing.redeem" | "node.pairing.show" | "node.principal.confirm" | "node.principal.preview" | "node.principal.show" | "node.reach.confirm" | "node.reach.preview" | "node.reach.show" | "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" | "node.update.apply.confirm" | "node.update.apply.preview" | "node.update.check" | "node.update.pause" | "node.update.policy.get" | "node.update.policy.set" | "node.update.resume" | "node.update.rollback.confirm" | "node.update.rollback.preview" | "node.update.show" | "node.update.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "pr.link" | "pr.status" | "pr.watch" | "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.instructions.change.confirm" | "project.instructions.change.preview" | "project.instructions.show" | "project.knowledge.add.chunk" | "project.knowledge.add.commit" | "project.knowledge.add.confirm" | "project.knowledge.add.preview" | "project.knowledge.list" | "project.knowledge.remove.confirm" | "project.knowledge.remove.preview" | "project.knowledge.search" | "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.move.confirm" | "routine.move.preview" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.runs" | "routine.show" | "routine.trigger.create.confirm" | "routine.trigger.create.preview" | "routine.trigger.disable" | "routine.trigger.list" | "routine.update.confirm" | "routine.update.preview" | "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" | "secret.request" | "secret.set.confirm" | "secret.set.preview" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.command.confirm" | "session.command.list" | "session.command.preview" | "session.command.send" | "session.create" | "session.detach.confirm" | "session.detach.preview" | "session.diff" | "session.events.list" | "session.fork.confirm" | "session.fork.preview" | "session.git.status" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.pause.confirm" | "session.pause.preview" | "session.placement.show" | "session.rename" | "session.resume" | "session.setup.confirm" | "session.setup.preview" | "session.show" | "session.spawn-caps.confirm" | "session.spawn-caps.preview" | "session.spawn-caps.show" | "session.spawn.confirm" | "session.spawn.preview" | "session.spawn.record" | "session.start" | "session.stop" | "session.switch.confirm" | "session.switch.preview" | "session.wait" | "skills.sync.confirm" | "skills.sync.preview" | "skills.sync.show" | "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.attachment.policy" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.steer.confirm" | "turn.steer.preview" | "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.branches.list" | "workspace.code-host.show" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
71
|
+
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "board.message.post" | "board.message.reply" | "board.path.read" | "board.task.assign" | "board.task.cancel" | "board.task.claim" | "board.task.complete" | "board.task.create" | "board.task.fail" | "board.task.list" | "board.task.needs.replace" | "board.task.plan" | "board.task.promote" | "board.task.release" | "board.task.renew" | "board.task.reopen" | "board.task.show" | "board.thread.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.executors.list" | "connection.executors.show" | "connection.gateway.create" | "connection.github.create" | "connection.github.revoke" | "connection.github.show" | "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" | "goal.clear" | "goal.mark" | "goal.set" | "goal.show" | "goal.transition" | "goal.update" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "inbox.list" | "inbox.respond" | "inbox.settle" | "inbox.show" | "inbox.snooze" | "integration.apply.antigravity" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.grok-cli" | "integration.apply.maia-agent" | "integration.apply.pi" | "integration.apply.pi-rpc" | "integration.plan.antigravity" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.grok-cli" | "integration.plan.maia-agent" | "integration.plan.pi" | "integration.plan.pi-rpc" | "integration.remove.antigravity" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.grok-cli" | "integration.remove.maia-agent" | "integration.remove.pi" | "integration.remove.pi-rpc" | "integration.status.antigravity" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.grok-cli" | "integration.status.maia-agent" | "integration.status.pi" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.pairing.confirm" | "node.pairing.preview" | "node.pairing.redeem" | "node.pairing.show" | "node.principal.confirm" | "node.principal.preview" | "node.principal.show" | "node.reach.confirm" | "node.reach.preview" | "node.reach.show" | "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" | "node.update.apply.confirm" | "node.update.apply.preview" | "node.update.check" | "node.update.pause" | "node.update.policy.get" | "node.update.policy.set" | "node.update.resume" | "node.update.rollback.confirm" | "node.update.rollback.preview" | "node.update.show" | "node.update.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "pr.link" | "pr.status" | "pr.watch" | "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.instructions.change.confirm" | "project.instructions.change.preview" | "project.instructions.show" | "project.knowledge.add.chunk" | "project.knowledge.add.commit" | "project.knowledge.add.confirm" | "project.knowledge.add.preview" | "project.knowledge.list" | "project.knowledge.remove.confirm" | "project.knowledge.remove.preview" | "project.knowledge.search" | "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.move.confirm" | "routine.move.preview" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.runs" | "routine.show" | "routine.trigger.create.confirm" | "routine.trigger.create.preview" | "routine.trigger.disable" | "routine.trigger.list" | "routine.update.confirm" | "routine.update.preview" | "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" | "secret.request" | "secret.set.confirm" | "secret.set.preview" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.command.confirm" | "session.command.list" | "session.command.preview" | "session.command.send" | "session.create" | "session.defaults.show" | "session.detach.confirm" | "session.detach.preview" | "session.diff" | "session.events.list" | "session.fork.confirm" | "session.fork.preview" | "session.git.status" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.pause.confirm" | "session.pause.preview" | "session.placement.show" | "session.rename" | "session.resume" | "session.setup.confirm" | "session.setup.preview" | "session.show" | "session.spawn-caps.confirm" | "session.spawn-caps.preview" | "session.spawn-caps.show" | "session.spawn.confirm" | "session.spawn.preview" | "session.spawn.record" | "session.start" | "session.stop" | "session.switch.confirm" | "session.switch.preview" | "session.wait" | "skills.sync.confirm" | "skills.sync.preview" | "skills.sync.show" | "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.attachment.policy" | "turn.cancel" | "turn.interrupt" | "turn.queue.edit" | "turn.queue.list" | "turn.queue.promote" | "turn.send" | "turn.show" | "turn.steer.confirm" | "turn.steer.preview" | "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.branches.list" | "workspace.code-host.show" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
71
72
|
readonly revision: "1";
|
|
72
73
|
};
|
|
73
74
|
readonly method: "session.agent-permission.confirm";
|
|
@@ -105,7 +106,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
105
106
|
readonly inputDigest: string;
|
|
106
107
|
readonly issuedAt: string;
|
|
107
108
|
readonly method: "session.agent-permission.preview";
|
|
108
|
-
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "board.message.post" | "board.message.reply" | "board.path.read" | "board.task.assign" | "board.task.cancel" | "board.task.claim" | "board.task.complete" | "board.task.create" | "board.task.fail" | "board.task.list" | "board.task.needs.replace" | "board.task.plan" | "board.task.promote" | "board.task.release" | "board.task.renew" | "board.task.reopen" | "board.task.show" | "board.thread.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.executors.list" | "connection.executors.show" | "connection.gateway.create" | "connection.github.create" | "connection.github.revoke" | "connection.github.show" | "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" | "goal.clear" | "goal.mark" | "goal.set" | "goal.show" | "goal.transition" | "goal.update" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "inbox.list" | "inbox.respond" | "inbox.settle" | "inbox.show" | "inbox.snooze" | "integration.apply.antigravity" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.grok-cli" | "integration.apply.maia-agent" | "integration.apply.pi" | "integration.apply.pi-rpc" | "integration.plan.antigravity" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.grok-cli" | "integration.plan.maia-agent" | "integration.plan.pi" | "integration.plan.pi-rpc" | "integration.remove.antigravity" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.grok-cli" | "integration.remove.maia-agent" | "integration.remove.pi" | "integration.remove.pi-rpc" | "integration.status.antigravity" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.grok-cli" | "integration.status.maia-agent" | "integration.status.pi" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.pairing.confirm" | "node.pairing.preview" | "node.pairing.redeem" | "node.pairing.show" | "node.principal.confirm" | "node.principal.preview" | "node.principal.show" | "node.reach.confirm" | "node.reach.preview" | "node.reach.show" | "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" | "node.update.apply.confirm" | "node.update.apply.preview" | "node.update.check" | "node.update.pause" | "node.update.policy.get" | "node.update.policy.set" | "node.update.resume" | "node.update.rollback.confirm" | "node.update.rollback.preview" | "node.update.show" | "node.update.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "pr.link" | "pr.status" | "pr.watch" | "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.instructions.change.confirm" | "project.instructions.change.preview" | "project.instructions.show" | "project.knowledge.add.chunk" | "project.knowledge.add.commit" | "project.knowledge.add.confirm" | "project.knowledge.add.preview" | "project.knowledge.list" | "project.knowledge.remove.confirm" | "project.knowledge.remove.preview" | "project.knowledge.search" | "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.move.confirm" | "routine.move.preview" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.runs" | "routine.show" | "routine.trigger.create.confirm" | "routine.trigger.create.preview" | "routine.trigger.disable" | "routine.trigger.list" | "routine.update.confirm" | "routine.update.preview" | "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" | "secret.request" | "secret.set.confirm" | "secret.set.preview" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.command.confirm" | "session.command.list" | "session.command.preview" | "session.command.send" | "session.create" | "session.detach.confirm" | "session.detach.preview" | "session.diff" | "session.events.list" | "session.fork.confirm" | "session.fork.preview" | "session.git.status" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.pause.confirm" | "session.pause.preview" | "session.placement.show" | "session.rename" | "session.resume" | "session.setup.confirm" | "session.setup.preview" | "session.show" | "session.spawn-caps.confirm" | "session.spawn-caps.preview" | "session.spawn-caps.show" | "session.spawn.confirm" | "session.spawn.preview" | "session.spawn.record" | "session.start" | "session.stop" | "session.switch.confirm" | "session.switch.preview" | "session.wait" | "skills.sync.confirm" | "skills.sync.preview" | "skills.sync.show" | "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.attachment.policy" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.steer.confirm" | "turn.steer.preview" | "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.branches.list" | "workspace.code-host.show" | "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" | "board.message.post" | "board.message.reply" | "board.path.read" | "board.task.assign" | "board.task.cancel" | "board.task.claim" | "board.task.complete" | "board.task.create" | "board.task.fail" | "board.task.list" | "board.task.needs.replace" | "board.task.plan" | "board.task.promote" | "board.task.release" | "board.task.renew" | "board.task.reopen" | "board.task.show" | "board.thread.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.executors.list" | "connection.executors.show" | "connection.gateway.create" | "connection.github.create" | "connection.github.revoke" | "connection.github.show" | "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" | "goal.clear" | "goal.mark" | "goal.set" | "goal.show" | "goal.transition" | "goal.update" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "inbox.list" | "inbox.respond" | "inbox.settle" | "inbox.show" | "inbox.snooze" | "integration.apply.antigravity" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.grok-cli" | "integration.apply.maia-agent" | "integration.apply.pi" | "integration.apply.pi-rpc" | "integration.plan.antigravity" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.grok-cli" | "integration.plan.maia-agent" | "integration.plan.pi" | "integration.plan.pi-rpc" | "integration.remove.antigravity" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.grok-cli" | "integration.remove.maia-agent" | "integration.remove.pi" | "integration.remove.pi-rpc" | "integration.status.antigravity" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.grok-cli" | "integration.status.maia-agent" | "integration.status.pi" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.pairing.confirm" | "node.pairing.preview" | "node.pairing.redeem" | "node.pairing.show" | "node.principal.confirm" | "node.principal.preview" | "node.principal.show" | "node.reach.confirm" | "node.reach.preview" | "node.reach.show" | "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" | "node.update.apply.confirm" | "node.update.apply.preview" | "node.update.check" | "node.update.pause" | "node.update.policy.get" | "node.update.policy.set" | "node.update.resume" | "node.update.rollback.confirm" | "node.update.rollback.preview" | "node.update.show" | "node.update.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "pr.link" | "pr.status" | "pr.watch" | "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.instructions.change.confirm" | "project.instructions.change.preview" | "project.instructions.show" | "project.knowledge.add.chunk" | "project.knowledge.add.commit" | "project.knowledge.add.confirm" | "project.knowledge.add.preview" | "project.knowledge.list" | "project.knowledge.remove.confirm" | "project.knowledge.remove.preview" | "project.knowledge.search" | "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.move.confirm" | "routine.move.preview" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.runs" | "routine.show" | "routine.trigger.create.confirm" | "routine.trigger.create.preview" | "routine.trigger.disable" | "routine.trigger.list" | "routine.update.confirm" | "routine.update.preview" | "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" | "secret.request" | "secret.set.confirm" | "secret.set.preview" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.command.confirm" | "session.command.list" | "session.command.preview" | "session.command.send" | "session.create" | "session.defaults.show" | "session.detach.confirm" | "session.detach.preview" | "session.diff" | "session.events.list" | "session.fork.confirm" | "session.fork.preview" | "session.git.status" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.pause.confirm" | "session.pause.preview" | "session.placement.show" | "session.rename" | "session.resume" | "session.setup.confirm" | "session.setup.preview" | "session.show" | "session.spawn-caps.confirm" | "session.spawn-caps.preview" | "session.spawn-caps.show" | "session.spawn.confirm" | "session.spawn.preview" | "session.spawn.record" | "session.start" | "session.stop" | "session.switch.confirm" | "session.switch.preview" | "session.wait" | "skills.sync.confirm" | "skills.sync.preview" | "skills.sync.show" | "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.attachment.policy" | "turn.cancel" | "turn.interrupt" | "turn.queue.edit" | "turn.queue.list" | "turn.queue.promote" | "turn.send" | "turn.show" | "turn.steer.confirm" | "turn.steer.preview" | "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.branches.list" | "workspace.code-host.show" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
109
110
|
readonly proof: string;
|
|
110
111
|
}>;
|
|
111
112
|
attachSession: (input: import("./attach-client.js").AttachSessionInput) => CliNodeEffect<import("./attach-client.js").SessionAttachStream>;
|
|
@@ -3,6 +3,7 @@ import { CliArgumentError, type CommandContext, type CommandEffect } from "../co
|
|
|
3
3
|
export declare const runSessionCreate: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
4
|
export declare const runSessionList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
5
|
export declare const runSessionPlacementShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
|
+
export declare const runSessionDefaultsShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
7
|
export declare const runSessionShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
8
|
export declare const runSessionWait: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
8
9
|
export declare const runSessionStart: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
package/dist/session/commands.js
CHANGED
|
@@ -4,7 +4,7 @@ import { everyNode, everyNodeName, formatMerged, listEach, writeMerged, } from "
|
|
|
4
4
|
import { cell, CliArgumentError, exitCodeOf, formatRows, LABEL_OPTION, LOCAL_NODE, parseOptions, parseOptionsWith, readCursor, readDuration, readExpectedRevision, readLabels, readOptionalRevision, readPageSize, readPermission, readSessionRole, readSessionTitle, readWaitTimeoutSeconds, requireOneLabelPerOption, requirePositionals, writeNodeResult, writeSuccess, } from "../command-line/index.js";
|
|
5
5
|
import { freshnessOf, mergeLists } from "../fleet/index.js";
|
|
6
6
|
import { changeAtRevision, } from "../local-node/index.js";
|
|
7
|
-
import { runSessionTasks, } from "./create-tasks.js";
|
|
7
|
+
import { defaultsHint, runSessionTasks, } from "./create-tasks.js";
|
|
8
8
|
import { formatMergedSessions, formatSessionResult, formatSessionShow, writeSessionResult, } from "./output/index.js";
|
|
9
9
|
import { cancelChildren, readResumeParent, reconcileChildren, resumeSupervised, runSessionSpawn as runSpawn, } from "./spawn/index.js";
|
|
10
10
|
const EXIT_DEADLINE = 74;
|
|
@@ -84,29 +84,36 @@ const readSessionCreateOptions = (parsed) => {
|
|
|
84
84
|
requireOneSelection({ ...input, ...definition });
|
|
85
85
|
return { ...input, ...definition };
|
|
86
86
|
};
|
|
87
|
-
const requireOneSelection = (input) => {
|
|
87
|
+
const requireOneSelection = (input, defaulted = false) => {
|
|
88
88
|
if (input.definitionRef !== undefined &&
|
|
89
89
|
(input.connectionId !== undefined || input.executor !== undefined))
|
|
90
90
|
throw new CliArgumentError("Use one of '--connection', '--harness' or '--agent-definition'.");
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
const fromDefault = defaulted &&
|
|
92
|
+
input.agentId === undefined &&
|
|
93
|
+
input.connectionId === undefined &&
|
|
94
|
+
input.definitionRef === undefined &&
|
|
95
|
+
input.executor === undefined;
|
|
96
|
+
requireModelSelection(input, fromDefault);
|
|
97
|
+
requireSupportedEffort(input, fromDefault);
|
|
98
|
+
};
|
|
99
|
+
const requireModelSelection = ({ connectionId, executor, model }, defaulted) => {
|
|
95
100
|
if (model === undefined)
|
|
96
101
|
return;
|
|
97
102
|
if (!connectionModelIdSchema.safeParse(model).success)
|
|
98
103
|
throw new CliArgumentError("Option '--model' must be a model id of up to 256 letters, digits and '._:/@-', starting with a letter or digit.");
|
|
99
104
|
if (connectionId !== undefined)
|
|
100
105
|
return;
|
|
106
|
+
if (executor === undefined && defaulted)
|
|
107
|
+
return;
|
|
101
108
|
if (executor === undefined)
|
|
102
109
|
throw new CliArgumentError("Option '--model' needs '--connection' or '--harness'.");
|
|
103
110
|
if (!sessionAcceptsModel(executor))
|
|
104
111
|
throw new CliArgumentError(`The ${executor} executor takes no model.`);
|
|
105
112
|
};
|
|
106
|
-
const requireSupportedEffort = ({ connectionId, effort, executor,
|
|
113
|
+
const requireSupportedEffort = ({ connectionId, effort, executor }, defaulted) => {
|
|
107
114
|
if (effort === undefined)
|
|
108
115
|
return;
|
|
109
|
-
if (connectionId === undefined && executor === undefined)
|
|
116
|
+
if (connectionId === undefined && executor === undefined && !defaulted)
|
|
110
117
|
throw new CliArgumentError("Option '--effort' needs '--connection' or '--harness'.");
|
|
111
118
|
const levels = executor === undefined ? [] : sessionEffortLevels(executor);
|
|
112
119
|
if (executor !== undefined && !levels.includes(effort))
|
|
@@ -140,6 +147,7 @@ const readAgentId = (options) => {
|
|
|
140
147
|
throw new CliArgumentError(`Option '--agent' fixes the harness, Connection, model and effort; drop '${clash}'.`);
|
|
141
148
|
return { agentId };
|
|
142
149
|
};
|
|
150
|
+
const readWakeOnChildSettle = (flags) => flags.has("--wake-on-child-settle") ? { wakeOnChildSettle: true } : {};
|
|
143
151
|
const readSessionSelection = ({ flags, options }, workspaceId) => {
|
|
144
152
|
const agent = readAgentId(options);
|
|
145
153
|
const commandId = options.get("--command-id");
|
|
@@ -161,6 +169,7 @@ const readSessionSelection = ({ flags, options }, workspaceId) => {
|
|
|
161
169
|
...readSessionRole(options.get("--role")),
|
|
162
170
|
...(title === undefined ? {} : { title }),
|
|
163
171
|
...readHostAuthority({ flags, options }),
|
|
172
|
+
...readWakeOnChildSettle(flags),
|
|
164
173
|
workspaceId,
|
|
165
174
|
};
|
|
166
175
|
return { ...selection, ...readWorktreeOptions(options, selection) };
|
|
@@ -295,9 +304,10 @@ const readSessionTasks = (parsed, source) => {
|
|
|
295
304
|
const projectId = parsed.options.get("--project");
|
|
296
305
|
const commandId = parsed.options.get("--command-id");
|
|
297
306
|
const { workspaceId: _placeholder, ...selection } = readSessionSelection(parsed, workspaceId ?? "workspace_default");
|
|
298
|
-
requireOneSelection({ ...selection, workspaceId: _placeholder });
|
|
307
|
+
requireOneSelection({ ...selection, workspaceId: _placeholder }, true);
|
|
299
308
|
return {
|
|
300
309
|
...(commandId === undefined ? {} : { commandId }),
|
|
310
|
+
defaults: true,
|
|
301
311
|
...(projectId === undefined ? {} : { projectId }),
|
|
302
312
|
selection,
|
|
303
313
|
source,
|
|
@@ -308,7 +318,11 @@ export const runSessionCreate = (tokens, context) => {
|
|
|
308
318
|
requireOneLabelPerOption(tokens);
|
|
309
319
|
const parsed = parseOptionsWith(tokens, {
|
|
310
320
|
allowed: TASK_OPTIONS,
|
|
311
|
-
allowedFlags: new Set([
|
|
321
|
+
allowedFlags: new Set([
|
|
322
|
+
"--host-authority",
|
|
323
|
+
"--prompt-stdin",
|
|
324
|
+
"--wake-on-child-settle",
|
|
325
|
+
]),
|
|
312
326
|
repeatable: LABEL_OPTION,
|
|
313
327
|
});
|
|
314
328
|
const source = taskSource(parsed);
|
|
@@ -497,6 +511,37 @@ export const runSessionPlacementShow = (tokens, context) => {
|
|
|
497
511
|
}),
|
|
498
512
|
});
|
|
499
513
|
};
|
|
514
|
+
const defaultsScope = (projectId, workspaceId) => {
|
|
515
|
+
if (projectId !== undefined)
|
|
516
|
+
return workspaceId === undefined ? { projectId } : undefined;
|
|
517
|
+
return workspaceId === undefined ? undefined : { workspaceId };
|
|
518
|
+
};
|
|
519
|
+
const describeDefaults = ({ executor, projectId, }) => executor === undefined
|
|
520
|
+
? `${projectId}: no last-used harness yet; name one with '--harness' or '--connection'.`
|
|
521
|
+
: [
|
|
522
|
+
`${projectId}: ${executor.kind} on ${executor.connectionId}`,
|
|
523
|
+
...(executor.model === undefined ? [] : [`model ${executor.model}`]),
|
|
524
|
+
...(executor.effort === undefined ? [] : [`effort ${executor.effort}`]),
|
|
525
|
+
].join(", ");
|
|
526
|
+
export const runSessionDefaultsShow = (tokens, context) => Effect.gen(function* () {
|
|
527
|
+
const parsed = parseOptions(tokens, new Set(["--project", "--workspace"]));
|
|
528
|
+
requirePositionals(parsed.positionals, 0);
|
|
529
|
+
const { call } = context.dependencies;
|
|
530
|
+
if (call === undefined)
|
|
531
|
+
return yield* new CliArgumentError("Session defaults are unavailable.");
|
|
532
|
+
const target = defaultsScope(parsed.options.get("--project"), parsed.options.get("--workspace"));
|
|
533
|
+
if (target === undefined)
|
|
534
|
+
return yield* new CliArgumentError("Name one Workspace with '--workspace', or a Project with '--project'.");
|
|
535
|
+
const result = yield* call("session.defaults.show", target);
|
|
536
|
+
return writeNodeResult(result, context, {
|
|
537
|
+
refusalHint: defaultsHint,
|
|
538
|
+
toResult: (value) => ({
|
|
539
|
+
command: "session.defaults.show",
|
|
540
|
+
result: value,
|
|
541
|
+
}),
|
|
542
|
+
toText: ({ result: value }) => describeDefaults(value),
|
|
543
|
+
});
|
|
544
|
+
});
|
|
500
545
|
export const runSessionShow = (tokens, context) => Effect.gen(function* () {
|
|
501
546
|
const parsed = parseOptions(tokens, new Set());
|
|
502
547
|
requirePositionals(parsed.positionals, 1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MAX_SESSION_CREATION_TASKS, MAX_TURN_INPUT_BYTES, } from "@maiaos/sdk";
|
|
1
|
+
import { MAX_SESSION_CREATION_TASKS, MAX_TURN_INPUT_BYTES, SESSION_DEFAULT_STALE_ERROR_CODE, } from "@maiaos/sdk";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { CliArgumentError, reportError, writeSuccess, } from "../command-line/index.js";
|
|
4
4
|
import { batchError, reportItem, toWorktreeRequest, withCommandId, } from "./creation/index.js";
|
|
@@ -22,10 +22,11 @@ const readText = (source, context) => {
|
|
|
22
22
|
const refusalMessage = (refusal) => refusal.reason === "too_long"
|
|
23
23
|
? `Task line ${String(refusal.line)} exceeds ${String(MAX_TURN_INPUT_BYTES)} bytes.`
|
|
24
24
|
: `A batch holds at most ${String(MAX_SESSION_CREATION_TASKS)} tasks; line ${String(refusal.line)} is beyond it.`;
|
|
25
|
-
const toStartFields = ({ cwd, hostAuthority, permission, }) => ({
|
|
25
|
+
const toStartFields = ({ cwd, hostAuthority, permission, wakeOnChildSettle, }) => ({
|
|
26
26
|
...(cwd === undefined ? {} : { cwd }),
|
|
27
27
|
...(hostAuthority === undefined ? {} : { hostAuthority }),
|
|
28
28
|
...(permission === undefined ? {} : { permission }),
|
|
29
|
+
...(wakeOnChildSettle === undefined ? {} : { wakeOnChildSettle }),
|
|
29
30
|
});
|
|
30
31
|
const toTemplate = (selection) => {
|
|
31
32
|
const { agentId, connectionId, effort, executor, labels, model, role, title, } = selection;
|
|
@@ -43,8 +44,9 @@ const toTemplate = (selection) => {
|
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
46
|
const toInput = (request, text) => {
|
|
46
|
-
const { projectId, selection, source, workspaceId } = request;
|
|
47
|
+
const { defaults, projectId, selection, source, workspaceId } = request;
|
|
47
48
|
return {
|
|
49
|
+
...(defaults === undefined ? {} : { defaults }),
|
|
48
50
|
...(projectId === undefined ? {} : { projectId }),
|
|
49
51
|
session: toTemplate(selection),
|
|
50
52
|
split: source.kind === "file" ? "lines" : "whole",
|
|
@@ -52,6 +54,9 @@ const toInput = (request, text) => {
|
|
|
52
54
|
...(workspaceId === undefined ? {} : { workspaceId }),
|
|
53
55
|
};
|
|
54
56
|
};
|
|
57
|
+
export const defaultsHint = (error) => error.code === SESSION_DEFAULT_STALE_ERROR_CODE
|
|
58
|
+
? "Name '--harness' or '--connection' to pick the account."
|
|
59
|
+
: undefined;
|
|
55
60
|
const exitCode = (items) => {
|
|
56
61
|
if (items.some((item) => item.stage === "unknown"))
|
|
57
62
|
return EXIT_OUTCOME_UNKNOWN;
|
|
@@ -77,8 +82,13 @@ export const runSessionTasks = (request, context) => Effect.gen(function* () {
|
|
|
77
82
|
if (text.trim() === "")
|
|
78
83
|
return yield* new CliArgumentError("The task text is empty.");
|
|
79
84
|
const planned = yield* planSessions(toInput(request, text));
|
|
80
|
-
if (!planned.ok)
|
|
81
|
-
|
|
85
|
+
if (!planned.ok) {
|
|
86
|
+
const hint = defaultsHint(planned.error);
|
|
87
|
+
return reportError(planned.error, {
|
|
88
|
+
...context,
|
|
89
|
+
...(hint === undefined ? {} : { hint }),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
82
92
|
const plan = withCommandId(planned.value, request.commandId);
|
|
83
93
|
const [refusal] = plan.refusals;
|
|
84
94
|
if (refusal !== undefined)
|
package/dist/session/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { type AttachSessionInput, makeAttachClient, type SessionAttachStream, }
|
|
|
4
4
|
export { type CreateSessionInput, type ListSessionsInput, makeSessionClient, type ResumeSessionInput, type StartSessionInput, } from "./client.js";
|
|
5
5
|
export { type ArchiveSessionInput, type DiffSessionInput, } from "./coding-client.js";
|
|
6
6
|
export { runSessionArchive, runSessionDiff } from "./coding-commands.js";
|
|
7
|
-
export { runSessionCreate, runSessionEventsList, runSessionInboxAck, runSessionInboxCheck, runSessionList, runSessionMessageSend, runSessionObserve, runSessionPlacementShow, runSessionReconcile, runSessionResume, runSessionShow, runSessionSpawn, runSessionStart, runSessionStop, runSessionWait, } from "./commands.js";
|
|
7
|
+
export { runSessionCreate, runSessionDefaultsShow, runSessionEventsList, runSessionInboxAck, runSessionInboxCheck, runSessionList, runSessionMessageSend, runSessionObserve, runSessionPlacementShow, runSessionReconcile, runSessionResume, runSessionShow, runSessionSpawn, runSessionStart, runSessionStop, runSessionWait, } from "./commands.js";
|
|
8
8
|
export { runSessionGitStatus } from "./git-status.js";
|
|
9
9
|
export { runSessionRename } from "./rename.js";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/session/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { sessionAttachRunner } from "./attach.js";
|
|
|
3
3
|
export { makeAttachClient, } from "./attach-client.js";
|
|
4
4
|
export { makeSessionClient, } from "./client.js";
|
|
5
5
|
export { runSessionArchive, runSessionDiff } from "./coding-commands.js";
|
|
6
|
-
export { runSessionCreate, runSessionEventsList, runSessionInboxAck, runSessionInboxCheck, runSessionList, runSessionMessageSend, runSessionObserve, runSessionPlacementShow, runSessionReconcile, runSessionResume, runSessionShow, runSessionSpawn, runSessionStart, runSessionStop, runSessionWait, } from "./commands.js";
|
|
6
|
+
export { runSessionCreate, runSessionDefaultsShow, runSessionEventsList, runSessionInboxAck, runSessionInboxCheck, runSessionList, runSessionMessageSend, runSessionObserve, runSessionPlacementShow, runSessionReconcile, runSessionResume, runSessionShow, runSessionSpawn, runSessionStart, runSessionStop, runSessionWait, } from "./commands.js";
|
|
7
7
|
export { runSessionGitStatus } from "./git-status.js";
|
|
8
8
|
export { runSessionRename } from "./rename.js";
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -20,6 +20,7 @@ export const SESSION_TREE = {
|
|
|
20
20
|
["session git", "A coding Session's Git state."],
|
|
21
21
|
["session history", "Session transcripts."],
|
|
22
22
|
["session placement", "Where a Session can run."],
|
|
23
|
+
["session defaults", "What a Session create takes when it names none."],
|
|
23
24
|
["session inbox", "This Session's inbox."],
|
|
24
25
|
["session message", "Messages between Sessions."],
|
|
25
26
|
["session agent-permission", "Agent permission grants."],
|
|
@@ -34,12 +35,12 @@ export const SESSION_TREE = {
|
|
|
34
35
|
],
|
|
35
36
|
leaves: [
|
|
36
37
|
[
|
|
37
|
-
"session create (--workspace <workspace-id> | --project <project-id>) [--command-id <id>] [--role <worker|orchestrator>] [--connection <connection-id> [--harness <executor-id>] | --harness <executor-id> | --agent <agent-id> | --agent-definition <key> --agent-definition-version <version> --agent-definition-digest <sha256>] [--model <id>] [--effort <low|medium|high|xhigh|max|ultra>] [--base <branch-tag-or-commit> [--branch <maia/name>] | --host-authority [--permission <mode>]] [--cwd <path>] [--title <text> | --name <text>] [--label <key=value>...] [--text <text> | --prompt-stdin | --from-file <path>]",
|
|
38
|
+
"session create (--workspace <workspace-id> | --project <project-id>) [--command-id <id>] [--role <worker|orchestrator>] [--connection <connection-id> [--harness <executor-id>] | --harness <executor-id> | --agent <agent-id> | --agent-definition <key> --agent-definition-version <version> --agent-definition-digest <sha256>] [--model <id>] [--effort <low|medium|high|xhigh|max|ultra>] [--base <branch-tag-or-commit> [--branch <maia/name>] | --host-authority [--permission <mode>]] [--cwd <path>] [--title <text> | --name <text>] [--label <key=value>...] [--wake-on-child-settle] [--text <text> | --prompt-stdin | --from-file <path>]",
|
|
38
39
|
0,
|
|
39
40
|
"session.create",
|
|
40
41
|
"Create a Session, optionally starting it with a first message.",
|
|
41
42
|
{
|
|
42
|
-
example: "maia --json session create --
|
|
43
|
+
example: "maia --json session create --text 'Fix the build'",
|
|
43
44
|
route: ["--project", "--workspace"],
|
|
44
45
|
run: [session, "runSessionCreate"],
|
|
45
46
|
},
|
|
@@ -134,6 +135,17 @@ export const SESSION_TREE = {
|
|
|
134
135
|
run: [session, "runSessionPlacementShow"],
|
|
135
136
|
},
|
|
136
137
|
],
|
|
138
|
+
[
|
|
139
|
+
"session defaults show (--workspace <workspace-id> | --project <project-id>)",
|
|
140
|
+
1,
|
|
141
|
+
"session.defaults.show",
|
|
142
|
+
"Show the harness and account a Session create here takes by default.",
|
|
143
|
+
{
|
|
144
|
+
example: "maia --json session defaults show",
|
|
145
|
+
route: ["--project", "--workspace"],
|
|
146
|
+
run: [session, "runSessionDefaultsShow"],
|
|
147
|
+
},
|
|
148
|
+
],
|
|
137
149
|
[
|
|
138
150
|
"session switch (<session-id> [--harness <executor-id>] [--connection <connection-id>] [--model <id>] [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
|
|
139
151
|
1,
|
|
@@ -389,10 +401,10 @@ export const SESSION_TREE = {
|
|
|
389
401
|
{ run: [session, "runSessionInboxAck"] },
|
|
390
402
|
],
|
|
391
403
|
[
|
|
392
|
-
"session turn send --session <session-id> --prompt-stdin [--expected-revision <revision>] [--attach <path>...] [--wait] [--command-id <id>]",
|
|
404
|
+
"session turn send --session <session-id> --prompt-stdin [--now | --queue] [--expected-revision <revision>] [--attach <path>...] [--wait] [--command-id <id>]",
|
|
393
405
|
1,
|
|
394
406
|
"turn.send",
|
|
395
|
-
"Send a turn from stdin; it queues. --attach adds images.
|
|
407
|
+
"Send a turn from stdin; it queues unless --now. --attach adds images.",
|
|
396
408
|
{
|
|
397
409
|
example: "printf %s 'Explain this chart' | maia --json session turn send --session session_1 --prompt-stdin --attach chart.png",
|
|
398
410
|
route: "--session",
|
|
@@ -421,6 +433,50 @@ export const SESSION_TREE = {
|
|
|
421
433
|
run: [turn, "runTurnQueue"],
|
|
422
434
|
},
|
|
423
435
|
],
|
|
436
|
+
[
|
|
437
|
+
"session turn queue list --session <session-id>",
|
|
438
|
+
1,
|
|
439
|
+
"turn.queue.list",
|
|
440
|
+
"List a Session's running and queued turns.",
|
|
441
|
+
{
|
|
442
|
+
kind: "shortcut",
|
|
443
|
+
route: "--session",
|
|
444
|
+
run: [turn, "runTurnQueueList"],
|
|
445
|
+
},
|
|
446
|
+
],
|
|
447
|
+
[
|
|
448
|
+
"session turn queue promote <turn-id> --expected-turn-revision <revision> [--command-id <id>]",
|
|
449
|
+
1,
|
|
450
|
+
"turn.queue.promote",
|
|
451
|
+
"Run a queued turn next; interrupts a running turn.",
|
|
452
|
+
{
|
|
453
|
+
example: "maia --json session turn queue promote turn_2 --expected-turn-revision 1",
|
|
454
|
+
route: "<turn-id>",
|
|
455
|
+
run: [turn, "runTurnQueuePromote"],
|
|
456
|
+
},
|
|
457
|
+
],
|
|
458
|
+
[
|
|
459
|
+
"session turn queue edit <turn-id> --expected-turn-revision <revision> --prompt-stdin [--command-id <id>]",
|
|
460
|
+
1,
|
|
461
|
+
"turn.queue.edit",
|
|
462
|
+
"Replace a queued turn's text from stdin.",
|
|
463
|
+
{
|
|
464
|
+
example: "printf %s 'New text' | maia --json session turn queue edit turn_2 --expected-turn-revision 1 --prompt-stdin",
|
|
465
|
+
route: "<turn-id>",
|
|
466
|
+
run: [turn, "runTurnQueueEdit"],
|
|
467
|
+
},
|
|
468
|
+
],
|
|
469
|
+
[
|
|
470
|
+
"session turn queue cancel <turn-id> --expected-turn-revision <revision> [--command-id <id>]",
|
|
471
|
+
1,
|
|
472
|
+
"turn.cancel",
|
|
473
|
+
"Cancel a queued turn, as session turn cancel does.",
|
|
474
|
+
{
|
|
475
|
+
kind: "shortcut",
|
|
476
|
+
route: "<turn-id>",
|
|
477
|
+
run: [turn, "runTurnCancel"],
|
|
478
|
+
},
|
|
479
|
+
],
|
|
424
480
|
[
|
|
425
481
|
"session turn cancel <turn-id> --expected-turn-revision <revision> [--command-id <id>]",
|
|
426
482
|
1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TurnAttachmentPolicyResult, TurnAttachmentUpload, TurnCancelResult, TurnInterruptResult, TurnQueueListResult, TurnSendResult, TurnShowResult, TurnWaitParameters, TurnWaitResult } from "@maiaos/sdk";
|
|
1
|
+
import type { TurnAttachmentPolicyResult, TurnAttachmentUpload, TurnCancelResult, TurnInterruptResult, TurnQueueEditResult, TurnQueueListResult, TurnQueuePromoteResult, TurnSendResult, TurnShowResult, TurnWaitParameters, TurnWaitResult } from "@maiaos/sdk";
|
|
2
2
|
import { type CliNodeEffect, type CliNodeOperations } from "../../local-node/index.js";
|
|
3
3
|
export type InterruptTurnInput = {
|
|
4
4
|
readonly commandId?: string;
|
|
@@ -6,9 +6,13 @@ export type InterruptTurnInput = {
|
|
|
6
6
|
readonly turnId: string;
|
|
7
7
|
};
|
|
8
8
|
export type CancelTurnInput = InterruptTurnInput;
|
|
9
|
+
export type EditTurnInput = CancelTurnInput & {
|
|
10
|
+
readonly prompt: string;
|
|
11
|
+
};
|
|
9
12
|
export type SendTurnInput = {
|
|
10
13
|
readonly attachments?: readonly TurnAttachmentUpload[];
|
|
11
14
|
readonly commandId?: string;
|
|
15
|
+
readonly delivery?: "now";
|
|
12
16
|
readonly expectedRevision: string;
|
|
13
17
|
readonly prompt: string;
|
|
14
18
|
readonly sessionId: string;
|
|
@@ -20,8 +24,10 @@ export type WaitTurnsInput = {
|
|
|
20
24
|
};
|
|
21
25
|
export declare const makeTurnClient: (node: CliNodeOperations) => {
|
|
22
26
|
cancelTurn: (input: CancelTurnInput) => CliNodeEffect<TurnCancelResult>;
|
|
27
|
+
editQueuedTurn: (input: EditTurnInput) => CliNodeEffect<TurnQueueEditResult>;
|
|
23
28
|
interruptTurn: (input: InterruptTurnInput) => CliNodeEffect<TurnInterruptResult>;
|
|
24
29
|
listTurnQueue: (sessionId: string) => CliNodeEffect<TurnQueueListResult>;
|
|
30
|
+
promoteQueuedTurn: (input: CancelTurnInput) => CliNodeEffect<TurnQueuePromoteResult>;
|
|
25
31
|
sendTurn: (input: SendTurnInput) => CliNodeEffect<TurnSendResult>;
|
|
26
32
|
showTurn: (turnId: string) => CliNodeEffect<TurnShowResult>;
|
|
27
33
|
showTurnAttachmentPolicy: (sessionId: string) => CliNodeEffect<TurnAttachmentPolicyResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MAX_TURN_WAIT_MILLISECONDS, turnAttachmentPolicyParametersSchema, turnCancelParametersSchema, turnInterruptParametersSchema, turnQueueListParametersSchema, turnSendParametersSchema, turnShowParametersSchema, turnWaitParametersSchema, } from "@maiaos/sdk";
|
|
1
|
+
import { MAX_TURN_WAIT_MILLISECONDS, turnAttachmentPolicyParametersSchema, turnCancelParametersSchema, turnInterruptParametersSchema, turnQueueEditParametersSchema, turnQueueListParametersSchema, turnQueuePromoteParametersSchema, turnSendParametersSchema, turnShowParametersSchema, turnWaitParametersSchema, } from "@maiaos/sdk";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { commandIdentifier, repeatBoundedWait, } from "../../local-node/index.js";
|
|
4
4
|
export const makeTurnClient = (node) => {
|
|
@@ -16,6 +16,17 @@ export const makeTurnClient = (node) => {
|
|
|
16
16
|
expectedRevision: input.expectedRevision,
|
|
17
17
|
turnId: input.turnId,
|
|
18
18
|
}, turnCancelParametersSchema, (client, parameters, options) => client.cancelTurn(parameters, options), { commandId }));
|
|
19
|
+
const promoteQueuedTurn = (input) => Effect.flatMap(commandIdentifier(input.commandId), (commandId) => node.runValidatedNodeOperation({
|
|
20
|
+
commandId,
|
|
21
|
+
expectedRevision: input.expectedRevision,
|
|
22
|
+
turnId: input.turnId,
|
|
23
|
+
}, turnQueuePromoteParametersSchema, (client, parameters, options) => client.promoteQueuedTurn(parameters, options), { commandId }));
|
|
24
|
+
const editQueuedTurn = (input) => Effect.flatMap(commandIdentifier(input.commandId), (commandId) => node.runValidatedNodeOperation({
|
|
25
|
+
commandId,
|
|
26
|
+
expectedRevision: input.expectedRevision,
|
|
27
|
+
input: { text: input.prompt, type: "text" },
|
|
28
|
+
turnId: input.turnId,
|
|
29
|
+
}, turnQueueEditParametersSchema, (client, parameters, options) => client.editQueuedTurn(parameters, options), { commandId }));
|
|
19
30
|
const listTurnQueue = (sessionId) => node.runValidatedNodeOperation({ sessionId }, turnQueueListParametersSchema, (client, parameters, options) => client.listTurnQueue(parameters, options));
|
|
20
31
|
const sendTurn = (input) => {
|
|
21
32
|
return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
|
|
@@ -27,6 +38,7 @@ export const makeTurnClient = (node) => {
|
|
|
27
38
|
...(input.attachments === undefined
|
|
28
39
|
? {}
|
|
29
40
|
: { attachments: input.attachments }),
|
|
41
|
+
...(input.delivery === undefined ? {} : { delivery: input.delivery }),
|
|
30
42
|
}, turnSendParametersSchema, (client, parameters, options) => client.sendTurn(parameters, options), { commandId });
|
|
31
43
|
});
|
|
32
44
|
};
|
|
@@ -45,8 +57,10 @@ export const makeTurnClient = (node) => {
|
|
|
45
57
|
});
|
|
46
58
|
return {
|
|
47
59
|
cancelTurn,
|
|
60
|
+
editQueuedTurn,
|
|
48
61
|
interruptTurn,
|
|
49
62
|
listTurnQueue,
|
|
63
|
+
promoteQueuedTurn,
|
|
50
64
|
sendTurn,
|
|
51
65
|
showTurn,
|
|
52
66
|
showTurnAttachmentPolicy,
|
|
@@ -4,7 +4,10 @@ export declare const readTurnPrompt: (context: CommandContext) => Effect.Effect<
|
|
|
4
4
|
export declare const runTurnSend: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
5
|
export declare const runTurnInterrupt: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
6
|
export declare const runTurnCancel: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
|
+
export declare const runTurnQueuePromote: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
8
|
+
export declare const runTurnQueueEdit: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
9
|
export declare const runTurnQueue: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
10
|
+
export declare const runTurnQueueList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
8
11
|
export declare const runTurnAttachments: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
9
12
|
export declare const runTurnShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
10
13
|
export declare const runTurnWait: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|