@gajae-code/coding-agent 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/types/async/job-manager.d.ts +44 -1
  3. package/dist/types/cli/setup-cli.d.ts +14 -1
  4. package/dist/types/commands/coordinator.d.ts +19 -0
  5. package/dist/types/commands/mcp-serve.d.ts +24 -0
  6. package/dist/types/commands/setup.d.ts +41 -0
  7. package/dist/types/commit/model-selection.d.ts +1 -1
  8. package/dist/types/config/model-registry.d.ts +3 -1
  9. package/dist/types/config/model-resolver.d.ts +1 -19
  10. package/dist/types/config/models-config-schema.d.ts +12 -0
  11. package/dist/types/config/settings-schema.d.ts +15 -1
  12. package/dist/types/coordinator/contract.d.ts +4 -0
  13. package/dist/types/coordinator-mcp/policy.d.ts +24 -0
  14. package/dist/types/coordinator-mcp/safety.d.ts +26 -0
  15. package/dist/types/coordinator-mcp/server.d.ts +52 -0
  16. package/dist/types/extensibility/extensions/types.d.ts +13 -0
  17. package/dist/types/gjc-runtime/goal-mode-request.d.ts +8 -1
  18. package/dist/types/gjc-runtime/session-state-sidecar.d.ts +13 -0
  19. package/dist/types/harness-control-plane/types.d.ts +7 -2
  20. package/dist/types/modes/acp/acp-event-mapper.d.ts +2 -0
  21. package/dist/types/modes/components/custom-editor.d.ts +7 -0
  22. package/dist/types/modes/components/hook-selector.d.ts +11 -0
  23. package/dist/types/modes/shared/agent-wire/command-contract.d.ts +18 -0
  24. package/dist/types/modes/shared/agent-wire/event-contract.d.ts +84 -0
  25. package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +14 -7
  26. package/dist/types/modes/shared/agent-wire/event-observation.d.ts +37 -0
  27. package/dist/types/modes/shared/agent-wire/protocol.d.ts +13 -34
  28. package/dist/types/session/agent-session.d.ts +12 -1
  29. package/dist/types/session/session-manager.d.ts +1 -1
  30. package/dist/types/setup/hermes-setup.d.ts +71 -0
  31. package/dist/types/task/render.d.ts +7 -1
  32. package/dist/types/tools/bash.d.ts +2 -0
  33. package/dist/types/tools/browser/actions.d.ts +54 -0
  34. package/dist/types/tools/browser.d.ts +80 -0
  35. package/dist/types/tools/image-gen.d.ts +1 -0
  36. package/dist/types/tools/index.d.ts +3 -1
  37. package/dist/types/tools/job.d.ts +1 -1
  38. package/dist/types/tools/subagent-render.d.ts +25 -0
  39. package/dist/types/tools/subagent.d.ts +5 -1
  40. package/package.json +7 -7
  41. package/src/async/job-manager.ts +163 -2
  42. package/src/cli/setup-cli.ts +86 -2
  43. package/src/cli.ts +2 -0
  44. package/src/commands/coordinator.ts +70 -0
  45. package/src/commands/mcp-serve.ts +62 -0
  46. package/src/commands/setup.ts +30 -1
  47. package/src/commands/ultragoal.ts +7 -1
  48. package/src/commit/agentic/index.ts +2 -2
  49. package/src/commit/model-selection.ts +7 -22
  50. package/src/commit/pipeline.ts +2 -2
  51. package/src/config/model-registry.ts +17 -9
  52. package/src/config/model-resolver.ts +14 -84
  53. package/src/config/models-config-schema.ts +2 -0
  54. package/src/config/settings-schema.ts +14 -1
  55. package/src/coordinator/contract.ts +20 -0
  56. package/src/coordinator-mcp/policy.ts +160 -0
  57. package/src/coordinator-mcp/safety.ts +80 -0
  58. package/src/coordinator-mcp/server.ts +1316 -0
  59. package/src/extensibility/extensions/types.ts +13 -0
  60. package/src/gjc-runtime/goal-mode-request.ts +21 -1
  61. package/src/gjc-runtime/session-state-sidecar.ts +79 -0
  62. package/src/harness-control-plane/owner.ts +3 -3
  63. package/src/harness-control-plane/rpc-adapter.ts +7 -1
  64. package/src/harness-control-plane/types.ts +8 -11
  65. package/src/internal-urls/docs-index.generated.ts +6 -5
  66. package/src/memories/index.ts +1 -1
  67. package/src/modes/acp/acp-agent.ts +17 -9
  68. package/src/modes/acp/acp-event-mapper.ts +33 -1
  69. package/src/modes/components/custom-editor.ts +19 -3
  70. package/src/modes/components/hook-selector.ts +109 -5
  71. package/src/modes/controllers/extension-ui-controller.ts +16 -1
  72. package/src/modes/controllers/input-controller.ts +27 -7
  73. package/src/modes/controllers/selector-controller.ts +7 -1
  74. package/src/modes/interactive-mode.ts +3 -1
  75. package/src/modes/rpc/rpc-client.ts +16 -3
  76. package/src/modes/rpc/rpc-mode.ts +5 -2
  77. package/src/modes/shared/agent-wire/command-contract.ts +18 -0
  78. package/src/modes/shared/agent-wire/event-contract.ts +147 -0
  79. package/src/modes/shared/agent-wire/event-envelope.ts +35 -16
  80. package/src/modes/shared/agent-wire/event-observation.ts +397 -0
  81. package/src/modes/shared/agent-wire/protocol.ts +24 -81
  82. package/src/modes/utils/context-usage.ts +2 -2
  83. package/src/prompts/agents/architect.md +6 -0
  84. package/src/prompts/agents/critic.md +6 -0
  85. package/src/prompts/agents/explore.md +1 -1
  86. package/src/prompts/agents/plan.md +1 -1
  87. package/src/prompts/agents/planner.md +8 -1
  88. package/src/prompts/agents/reviewer.md +1 -1
  89. package/src/prompts/tools/browser.md +3 -2
  90. package/src/runtime-mcp/manager.ts +15 -2
  91. package/src/sdk.ts +3 -1
  92. package/src/session/agent-session.ts +66 -4
  93. package/src/session/session-manager.ts +1 -1
  94. package/src/setup/hermes/templates/operator-instructions.v1.md +29 -0
  95. package/src/setup/hermes-setup.ts +429 -0
  96. package/src/task/agents.ts +1 -1
  97. package/src/task/index.ts +2 -0
  98. package/src/task/render.ts +14 -0
  99. package/src/tools/ask.ts +30 -10
  100. package/src/tools/bash.ts +6 -1
  101. package/src/tools/browser/actions.ts +189 -0
  102. package/src/tools/browser.ts +91 -1
  103. package/src/tools/image-gen.ts +42 -15
  104. package/src/tools/index.ts +7 -1
  105. package/src/tools/inspect-image.ts +10 -8
  106. package/src/tools/job.ts +12 -2
  107. package/src/tools/monitor.ts +98 -17
  108. package/src/tools/renderers.ts +2 -0
  109. package/src/tools/subagent-render.ts +160 -0
  110. package/src/tools/subagent.ts +49 -7
  111. package/src/utils/commit-message-generator.ts +6 -13
  112. package/src/utils/title-generator.ts +1 -1
  113. package/dist/types/harness-control-plane/frame-mapper.d.ts +0 -29
  114. package/src/harness-control-plane/frame-mapper.ts +0 -286
  115. package/src/priority.json +0 -37
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Canonical agent-wire contract: the single transport-neutral source of truth
3
+ * for AgentSession events and bounded owner observations.
4
+ *
5
+ * Two distinct consumer-facing shapes, deliberately NOT collapsed into one:
6
+ * - `AgentWireEventPayload`: rich, full `AgentSessionEvent` for renderers
7
+ * (ACP SDK notifications, RPC/Bridge event frames).
8
+ * - `AgentWireOwnerObservation`: bounded/redacted owner evidence for control
9
+ * planes (Harness). Never carries assistant text, message deltas, raw tool
10
+ * args, raw command output, raw tool results, answers, or oversize strings.
11
+ *
12
+ * The exhaustive `AGENT_SESSION_EVENT_TYPE_REGISTRY` lives here so that adding
13
+ * an `AgentSessionEvent` variant fails typecheck until it is registered, and so
14
+ * conformance tests can assert fixture coverage equals the registry exactly.
15
+ */
16
+ import type { AgentSessionEvent } from "../../../session/agent-session";
17
+ /** Wire protocol version. Bump on breaking envelope/semantic changes. */
18
+ export declare const AGENT_WIRE_PROTOCOL_VERSION: 2;
19
+ export type AgentWireProtocolVersion = typeof AGENT_WIRE_PROTOCOL_VERSION;
20
+ /** The discriminant of every `AgentSessionEvent` the agent can emit. */
21
+ export type AgentWireEventType = AgentSessionEvent["type"];
22
+ /** Every agent-session event type, derived from the exhaustive registry. */
23
+ export declare const AGENT_WIRE_EVENT_TYPES: readonly AgentWireEventType[];
24
+ /**
25
+ * Rich event payload. Carries the full `AgentSessionEvent` so renderers (ACP,
26
+ * RPC, Bridge) can present message content, tool args/results, todo state, etc.
27
+ */
28
+ export interface AgentWireEventPayload {
29
+ event_type: AgentWireEventType;
30
+ event: AgentSessionEvent;
31
+ }
32
+ /**
33
+ * Bounded observed-signal vocabulary surfaced to owner control planes. Mirrors
34
+ * the Harness `ObservedSignal` set; the Harness type aliases this in a later
35
+ * step so there is a single source of truth.
36
+ */
37
+ export type AgentWireObservedSignal = "SessionStart" | "prompt-accepted" | "tool-call" | "test-running" | "commit-created" | "completed" | "error" | "streaming" | "idle";
38
+ export type AgentWireSeverity = "info" | "warn" | "critical";
39
+ /**
40
+ * Bounded, redacted owner observation. Evidence may include ids, names,
41
+ * categories, statuses, cursors, timestamps, short codes, and bounded short
42
+ * messages ONLY. It must never carry assistant text, message deltas, raw tool
43
+ * args, raw command output, raw tool result content, answers, or oversize
44
+ * strings.
45
+ */
46
+ export interface AgentWireOwnerObservation {
47
+ /** Set when this observation derives from an `AgentSessionEvent`. */
48
+ eventType?: AgentWireEventType;
49
+ /** Set when this observation derives from a non-event wire frame. */
50
+ frameType?: string;
51
+ /** Owner event kind (e.g. `rpc_tool_started`). */
52
+ kind: string;
53
+ /** Bounded observed signal, or null when the frame carries no signal. */
54
+ signal: AgentWireObservedSignal | null;
55
+ /** Bounded evidence — ids/names/statuses/cursors/timestamps/short codes only. */
56
+ evidence: Record<string, unknown>;
57
+ /** Severity for the emitted event. */
58
+ severity: AgentWireSeverity;
59
+ /** Never-drop observations: must be enqueued in order, never coalesced away. */
60
+ semantic: boolean;
61
+ /** Coalescing key for high-frequency non-semantic frames; null otherwise. */
62
+ coalesceKey: string | null;
63
+ }
64
+ /** Top-level frame categories carried over any agent-wire transport. */
65
+ export type AgentWireFrameType = "ready" | "event" | "response" | "ui_request" | "permission_request" | "host_tool_call" | "host_uri_request" | "reset" | "workflow_gate" | "error";
66
+ /**
67
+ * Universal frame envelope. Every frame on every transport carries these
68
+ * fields so clients can order (`seq`), resume (`seq` cursor), and correlate
69
+ * request/response pairs (`correlation_id`).
70
+ */
71
+ export interface AgentWireFrameEnvelope<TType extends AgentWireFrameType = AgentWireFrameType, TPayload = unknown> {
72
+ protocol_version: AgentWireProtocolVersion;
73
+ session_id: string;
74
+ /** Monotonic per-session sequence number, starting at 1. */
75
+ seq: number;
76
+ /** Unique id for this frame. */
77
+ frame_id: string;
78
+ /** Ties a request frame to its response frame, when applicable. */
79
+ correlation_id?: string;
80
+ type: TType;
81
+ payload: TPayload;
82
+ }
83
+ /** An `AgentSessionEvent` serialized into a versioned wire frame. */
84
+ export type AgentWireEventFrame = AgentWireFrameEnvelope<"event", AgentWireEventPayload>;
@@ -1,16 +1,16 @@
1
1
  import type { AgentSessionEvent } from "../../../session/agent-session";
2
- import { type AgentSessionEventType, type BridgeEventFrame, type BridgeFrameEnvelope, type BridgeFrameType } from "./protocol";
2
+ import { type AgentWireEventFrame, type AgentWireEventPayload, type AgentWireEventType, type AgentWireFrameEnvelope, type AgentWireFrameType } from "./event-contract";
3
3
  /**
4
4
  * Resolve the stable wire event-type for an `AgentSessionEvent`.
5
5
  *
6
6
  * Exhaustive over the union; adding a variant without a case is a type error.
7
7
  */
8
- export declare function agentSessionEventType(event: AgentSessionEvent): AgentSessionEventType;
8
+ export declare function agentSessionEventType(event: AgentSessionEvent): AgentWireEventType;
9
9
  /**
10
10
  * Per-session monotonic frame builder. One instance per active session; `seq`
11
11
  * starts at 1 and increments per frame so clients can order and resume.
12
12
  */
13
- export declare class BridgeFrameSequencer {
13
+ export declare class AgentWireFrameSequencer {
14
14
  #private;
15
15
  constructor(sessionId: string);
16
16
  /** The session id stamped onto every frame this sequencer produces. */
@@ -18,14 +18,21 @@ export declare class BridgeFrameSequencer {
18
18
  /** The seq assigned to the most recently produced frame (0 before any). */
19
19
  get lastSeq(): number;
20
20
  /** Build the next envelope of the given type with a fresh seq + frame id. */
21
- next<TType extends BridgeFrameType, TPayload>(type: TType, payload: TPayload, correlationId?: string): BridgeFrameEnvelope<TType, TPayload>;
21
+ next<TType extends AgentWireFrameType, TPayload>(type: TType, payload: TPayload, correlationId?: string): AgentWireFrameEnvelope<TType, TPayload>;
22
22
  }
23
- /** Serialize a single `AgentSessionEvent` into an `event` wire frame. */
24
- export declare function toBridgeEventFrame(event: AgentSessionEvent, sequencer: BridgeFrameSequencer): BridgeEventFrame;
23
+ /** Back-compat alias for {@link AgentWireFrameSequencer}. */
24
+ export declare const BridgeFrameSequencer: typeof AgentWireFrameSequencer;
25
+ export type BridgeFrameSequencer = AgentWireFrameSequencer;
26
+ /** Serialize a single `AgentSessionEvent` into a canonical `event` wire frame. */
27
+ export declare function toAgentWireEventFrame(event: AgentSessionEvent, sequencer: AgentWireFrameSequencer): AgentWireEventFrame;
28
+ /** Build the rich event payload (renderer-facing) for an `AgentSessionEvent`. */
29
+ export declare function toAgentWireEventPayload(event: AgentSessionEvent): AgentWireEventPayload;
30
+ /** Back-compat alias for {@link toAgentWireEventFrame}. */
31
+ export declare const toBridgeEventFrame: typeof toAgentWireEventFrame;
25
32
  /**
26
33
  * Serialize a `workflow_gate` event into a sequenced wire frame (#321). The
27
34
  * gate_id is stamped as the correlation id so the answer (posted to the
28
35
  * ui-responses endpoint) can be matched, and the monotonic `seq` gives replay
29
36
  * while `frame_id` + gate_id give idempotency.
30
37
  */
31
- export declare function toBridgeWorkflowGateFrame(gate: import("../../rpc/rpc-types").RpcWorkflowGate, sequencer: BridgeFrameSequencer): import("./protocol").BridgeWorkflowGateFrame;
38
+ export declare function toBridgeWorkflowGateFrame(gate: import("../../rpc/rpc-types").RpcWorkflowGate, sequencer: AgentWireFrameSequencer): import("./protocol").BridgeWorkflowGateFrame;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Canonical AgentSession event observation: the single semantic mapping from
3
+ * `AgentSessionEvent` (and non-event wire frames) to bounded owner observations.
4
+ *
5
+ * This is the one place that derives `AgentWireOwnerObservation`s. Harness (and
6
+ * any other owner control plane) consumes these instead of re-parsing the wire
7
+ * protocol with private knowledge.
8
+ *
9
+ * Hard rule: evidence is BOUNDED — only ids, names, categories, statuses,
10
+ * cursors, timestamps, and short codes/messages. Never assistant text, message
11
+ * deltas, command output, raw args, or raw tool results.
12
+ */
13
+ import type { AgentSessionEvent } from "../../../session/agent-session";
14
+ import type { AgentWireEventPayload, AgentWireOwnerObservation } from "./event-contract";
15
+ import { toAgentWireEventPayload } from "./event-envelope";
16
+ /** True when a tool name or command indicates a test-runner invocation. */
17
+ export declare function isTestRunnerTool(toolName?: unknown, command?: unknown): boolean;
18
+ /** Only accept a known closed-vocabulary tool status; reject arbitrary strings. */
19
+ export declare function boundedStatus(v: unknown): string | undefined;
20
+ /** Accept only identifier-shaped tokens (e.g. RPC command names); reject free text. */
21
+ export declare function boundedToken(v: unknown): string | undefined;
22
+ /**
23
+ * Map a single `AgentSessionEvent` to its bounded owner observation, or null
24
+ * when the event carries no owner-facing signal.
25
+ */
26
+ export declare function observeAgentSessionEvent(event: AgentSessionEvent): AgentWireOwnerObservation | null;
27
+ /** Build the rich event payload (renderer-facing) for an `AgentSessionEvent`. */
28
+ export { toAgentWireEventPayload };
29
+ /** Observe the bounded owner signal carried by a rich event payload. */
30
+ export declare function observeAgentWireEventPayload(payload: AgentWireEventPayload): AgentWireOwnerObservation | null;
31
+ /**
32
+ * Map a single outbound RPC wire frame (docs/rpc.md) to a bounded owner
33
+ * observation, or null when the frame carries no owner-facing signal. Event
34
+ * frames delegate to {@link observeAgentWireEventPayload}; non-event frames are
35
+ * mapped here so owners never re-parse protocol semantics privately.
36
+ */
37
+ export declare function observeRpcOutboundFrame(frame: Record<string, unknown>): AgentWireOwnerObservation | null;
@@ -1,46 +1,25 @@
1
1
  /**
2
2
  * Shared agent-wire protocol primitives for GJC bridge surfaces.
3
3
  *
4
- * This module is the transport-agnostic, versioned frame contract that the
5
- * RPC mode and the (in-progress) `--mode bridge` wiring site both build on.
6
- * It carries the SEMANTIC agent surface events, responses, and UI/permission
7
- * requests — never pixels. See `.gjc/specs/deep-interview-gjc-backend-bridge.md`
8
- * and `.gjc/plans/ralplan/gjc-backend-bridge/pending-approval.md`.
4
+ * The canonical event/frame contract now lives in `event-contract.ts`. This
5
+ * module re-exports it under the historical `Bridge*` names so existing RPC and
6
+ * Bridge code keeps compiling while the adapters migrate to the canonical
7
+ * `AgentWire*` names. See `.gjc/specs/deep-interview-reconcile-rpc-adapters.md`.
9
8
  */
10
- import type { AgentSessionEvent } from "../../../session/agent-session";
9
+ import type { AgentWireEventFrame, AgentWireEventPayload, AgentWireEventType, AgentWireFrameEnvelope, AgentWireFrameType } from "./event-contract";
11
10
  /** Wire protocol version. Bump on breaking envelope/semantic changes. */
12
- export declare const BRIDGE_PROTOCOL_VERSION: 1;
11
+ export declare const BRIDGE_PROTOCOL_VERSION: 2;
13
12
  /** The discriminant of every `AgentSessionEvent` the agent can emit. */
14
- export type AgentSessionEventType = AgentSessionEvent["type"];
13
+ export type AgentSessionEventType = AgentWireEventType;
15
14
  /** Every agent-session event type, derived from the exhaustive registry. */
16
15
  export declare const AGENT_SESSION_EVENT_TYPES: readonly AgentSessionEventType[];
17
16
  /** Top-level frame categories carried over any bridge transport. */
18
- export type BridgeFrameType = "ready" | "event" | "response" | "ui_request" | "permission_request" | "host_tool_call" | "host_uri_request" | "reset" | "workflow_gate" | "error";
19
- /**
20
- * Universal frame envelope. Every frame on every transport carries these
21
- * fields so clients can order (`seq`), resume (`seq` cursor), and correlate
22
- * request/response pairs (`correlation_id`). `session_id` is present from v1
23
- * even though v1 runs one session per process, so in-process multiplexing is
24
- * an additive, non-breaking change later.
25
- */
26
- export interface BridgeFrameEnvelope<TType extends BridgeFrameType = BridgeFrameType, TPayload = unknown> {
27
- protocol_version: typeof BRIDGE_PROTOCOL_VERSION;
28
- session_id: string;
29
- /** Monotonic per-session sequence number, starting at 1. */
30
- seq: number;
31
- /** Unique id for this frame. */
32
- frame_id: string;
33
- /** Ties a request frame to its response frame, when applicable. */
34
- correlation_id?: string;
35
- type: TType;
36
- payload: TPayload;
37
- }
38
- /** Payload carried by an `event` frame. */
39
- export interface BridgeEventPayload {
40
- event_type: AgentSessionEventType;
41
- event: AgentSessionEvent;
42
- }
17
+ export type BridgeFrameType = AgentWireFrameType;
18
+ /** Universal frame envelope. See {@link AgentWireFrameEnvelope}. */
19
+ export type BridgeFrameEnvelope<TType extends BridgeFrameType = BridgeFrameType, TPayload = unknown> = AgentWireFrameEnvelope<TType, TPayload>;
20
+ /** Payload carried by an `event` frame. See {@link AgentWireEventPayload}. */
21
+ export type BridgeEventPayload = AgentWireEventPayload;
43
22
  /** An `AgentSessionEvent` serialized into a versioned wire frame. */
44
- export type BridgeEventFrame = BridgeFrameEnvelope<"event", BridgeEventPayload>;
23
+ export type BridgeEventFrame = AgentWireEventFrame;
45
24
  /** A `workflow_gate` event serialized into a versioned wire frame (#321). */
46
25
  export type BridgeWorkflowGateFrame = BridgeFrameEnvelope<"workflow_gate", import("../../rpc/rpc-types").RpcWorkflowGate>;
@@ -25,6 +25,14 @@ export interface ForkContextSeedMetadata {
25
25
  maxTokens: number;
26
26
  skippedReasons: Record<string, number>;
27
27
  }
28
+ export interface PurgeQueuedCustomMessagesResult {
29
+ agentSteering: number;
30
+ agentFollowUp: number;
31
+ pendingNextTurn: number;
32
+ displaySteering: number;
33
+ displayFollowUp: number;
34
+ totalExecutable: number;
35
+ }
28
36
  export interface ForkContextSeed {
29
37
  messages: Message[];
30
38
  agentMessages: AgentMessage[];
@@ -568,6 +576,7 @@ export declare class AgentSession {
568
576
  */
569
577
  followUp(text: string, images?: ImageContent[]): Promise<void>;
570
578
  queueDeferredMessage(message: CustomMessage): void;
579
+ queueDeferredMessageForTests(message: CustomMessage, triggerTurn?: boolean): void;
571
580
  /**
572
581
  * Send a custom message to the session. Creates a CustomMessageEntry.
573
582
  *
@@ -580,6 +589,8 @@ export declare class AgentSession {
580
589
  triggerTurn?: boolean;
581
590
  deliverAs?: "steer" | "followUp" | "nextTurn";
582
591
  }): Promise<void>;
592
+ /** Remove undelivered queued custom messages matching `predicate` from executable queues and tagged display mirrors. */
593
+ purgeQueuedCustomMessages(predicate: (message: CustomMessage) => boolean): PurgeQueuedCustomMessagesResult;
583
594
  /**
584
595
  * Send a user message to the agent.
585
596
  * When deliverAs is set, queue the message instead of starting a new turn.
@@ -683,7 +694,7 @@ export declare class AgentSession {
683
694
  /**
684
695
  * Cycle through configured role models in a fixed order.
685
696
  * Skips missing roles.
686
- * @param roleOrder - Order of roles to cycle through (e.g., ["slow", "default", "smol"])
697
+ * @param roleOrder - Order of roles to cycle through (e.g., ["default"])
687
698
  * @param options - Optional settings: `temporary` to not persist to settings
688
699
  */
689
700
  cycleRoleModels(roleOrder: readonly string[], options?: {
@@ -38,7 +38,7 @@ export interface ModelChangeEntry extends SessionEntryBase {
38
38
  type: "model_change";
39
39
  /** Model in "provider/modelId" format */
40
40
  model: string;
41
- /** Role: "default", "smol", "slow", etc. Undefined treated as "default" */
41
+ /** Role: "default" or an agent role. Undefined treated as "default" */
42
42
  role?: string;
43
43
  }
44
44
  export interface ServiceTierChangeEntry extends SessionEntryBase {
@@ -0,0 +1,71 @@
1
+ import { COORDINATOR_MCP_PROTOCOL_VERSION, COORDINATOR_MCP_SERVER_NAME } from "../coordinator/contract";
2
+ export type HermesMutationClass = "sessions" | "questions" | "reports";
3
+ export type HermesSetupMode = "render" | "install" | "check" | "smoke";
4
+ export interface HermesSetupFlags {
5
+ json?: boolean;
6
+ check?: boolean;
7
+ smoke?: boolean;
8
+ install?: boolean;
9
+ force?: boolean;
10
+ root?: string[];
11
+ repo?: string;
12
+ profile?: string;
13
+ sessionCommand?: string;
14
+ stateRoot?: string;
15
+ mutation?: string[];
16
+ artifactByteCap?: string;
17
+ serverKey?: string;
18
+ gjcCommand?: string;
19
+ target?: string;
20
+ profileDir?: string;
21
+ }
22
+ export interface CoordinatorSetupSpec {
23
+ schemaVersion: 1;
24
+ coordinator: "hermes";
25
+ serverKey: string;
26
+ serverName: typeof COORDINATOR_MCP_SERVER_NAME;
27
+ protocolVersion: typeof COORDINATOR_MCP_PROTOCOL_VERSION;
28
+ gjcCommand: string;
29
+ args: ["mcp-serve", "coordinator"];
30
+ roots: string[];
31
+ namespace: {
32
+ profile?: string;
33
+ repo?: string;
34
+ };
35
+ sessionCommand?: string;
36
+ stateRoot?: string;
37
+ mutationPolicy: {
38
+ classes: HermesMutationClass[];
39
+ perCallConsentRequired: true;
40
+ };
41
+ artifactByteCap?: number;
42
+ installTarget?: {
43
+ kind: "profile-dir" | "config-file";
44
+ path: string;
45
+ };
46
+ operatorTemplateVersion: 1;
47
+ contractDocVersion: 1;
48
+ }
49
+ export interface HermesSetupResult {
50
+ ok: boolean;
51
+ mode: HermesSetupMode;
52
+ files_written: string[];
53
+ previews: Array<{
54
+ path: string;
55
+ content: string;
56
+ }>;
57
+ warnings: string[];
58
+ smoke: null | {
59
+ ok: boolean;
60
+ protocolVersion: string;
61
+ serverName: string;
62
+ requiredTools: string[];
63
+ missingTools: string[];
64
+ };
65
+ }
66
+ export declare function buildHermesSetupSpec(flags: HermesSetupFlags): CoordinatorSetupSpec;
67
+ export declare function computeHermesSetupSignature(spec: CoordinatorSetupSpec): string;
68
+ export declare function renderHermesServerBlock(spec: CoordinatorSetupSpec): Record<string, unknown>;
69
+ export declare function runHermesSetup(flags: HermesSetupFlags): Promise<HermesSetupResult>;
70
+ export declare function formatHermesSetupResult(result: HermesSetupResult): string;
71
+ export declare function hermesSetupExitCode(error: unknown): number;
@@ -1,11 +1,17 @@
1
1
  import type { Component } from "@gajae-code/tui";
2
2
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
3
3
  import type { Theme } from "../modes/theme/theme";
4
- import type { TaskParams, TaskToolDetails } from "./types";
4
+ import type { AgentProgress, TaskParams, TaskToolDetails } from "./types";
5
5
  /**
6
6
  * Render the tool call arguments.
7
7
  */
8
8
  export declare function renderCall(args: TaskParams, _options: RenderResultOptions, theme: Theme): Component;
9
+ /**
10
+ * Public wrapper to render a single subagent's live `AgentProgress` for the
11
+ * `subagent` await panel. Reuses the internal task-progress renderer so the
12
+ * await panel stays at parity with the inline task panel.
13
+ */
14
+ export declare function renderSubagentLiveProgress(progress: AgentProgress, expanded: boolean, theme: Theme, spinnerFrame?: number): string[];
9
15
  /**
10
16
  * Render the tool result.
11
17
  */
@@ -78,6 +78,8 @@ export declare class BashTool implements AgentTool<BashToolSchema, BashToolDetai
78
78
  label?: string;
79
79
  ctx?: AgentToolContext;
80
80
  onRawLine?: (line: string, jobId: string) => void;
81
+ shouldAcceptRawLine?: (jobId: string) => boolean;
82
+ lifecycle?: import("../async").AsyncJobLifecycleCleanup;
81
83
  }): Promise<{
82
84
  jobId: string;
83
85
  label: string;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Structured browser action space.
3
+ *
4
+ * Adapts the SOTA computer-use / browser-use pattern: instead of authoring raw
5
+ * JavaScript for every interaction, the model emits a list of structured verbs
6
+ * (navigate / click / type / …) that reference elements by the numeric `id`
7
+ * returned from {@link Observation}. Each verb is compiled onto the existing
8
+ * in-tab `tab.*` helpers and executed through the same worker `run` path, so the
9
+ * worker protocol is unchanged and the raw-JS `run` escape hatch still works.
10
+ */
11
+ export type BrowserActionVerb = "navigate" | "click" | "type" | "fill" | "select" | "press" | "scroll" | "back" | "wait" | "observe" | "extract" | "screenshot";
12
+ export interface BrowserActionStep {
13
+ verb: BrowserActionVerb;
14
+ /** Element id from a prior `observe` (preferred for click/type). */
15
+ id?: number;
16
+ /** CSS / puppeteer selector when not addressing by `id`. */
17
+ selector?: string;
18
+ /** Text to type. */
19
+ text?: string;
20
+ /** Value for `fill`. */
21
+ value?: string;
22
+ /** Option value(s) for `select`. */
23
+ values?: string[];
24
+ /** URL for `navigate`. */
25
+ url?: string;
26
+ /** Key for `press` (e.g. "Enter"). */
27
+ key?: string;
28
+ /** Horizontal scroll delta. */
29
+ dx?: number;
30
+ /** Vertical scroll delta. */
31
+ dy?: number;
32
+ /** Sleep duration for `wait` when no selector is given. */
33
+ ms?: number;
34
+ /** Extract format. */
35
+ format?: "markdown" | "text" | "html";
36
+ /** Navigation wait condition for `navigate`. */
37
+ wait_until?: "load" | "domcontentloaded" | "networkidle0" | "networkidle2";
38
+ /** Only return interactive/viewport elements for `observe`. */
39
+ viewport_only?: boolean;
40
+ include_all?: boolean;
41
+ }
42
+ /**
43
+ * Validate a single step's required fields. Returns an error string, or
44
+ * `undefined` when the step is well-formed.
45
+ */
46
+ export declare function validateActionStep(step: BrowserActionStep, index: number): string | undefined;
47
+ /** Validate the full step list. Throws on the first invalid step. */
48
+ export declare function validateActionSteps(steps: readonly BrowserActionStep[]): void;
49
+ /**
50
+ * Compile structured steps into a JS program for the in-tab `run` worker. Steps
51
+ * are embedded as parsed JSON (no string interpolation, so values cannot inject
52
+ * code) and dispatched by a fixed interpreter against the `tab` / `page` helpers.
53
+ */
54
+ export declare function compileActionSteps(steps: readonly BrowserActionStep[]): string;
@@ -8,6 +8,7 @@ export { extractReadableFromHtml, type ReadableFormat, type ReadableResult } fro
8
8
  export type { Observation, ObservationEntry } from "./browser/tab-protocol";
9
9
  declare const browserSchema: z.ZodObject<{
10
10
  action: z.ZodEnum<{
11
+ act: "act";
11
12
  close: "close";
12
13
  open: "open";
13
14
  run: "run";
@@ -36,6 +37,45 @@ declare const browserSchema: z.ZodObject<{
36
37
  dismiss: "dismiss";
37
38
  }>>;
38
39
  code: z.ZodOptional<z.ZodString>;
40
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
41
+ verb: z.ZodEnum<{
42
+ back: "back";
43
+ click: "click";
44
+ extract: "extract";
45
+ fill: "fill";
46
+ navigate: "navigate";
47
+ observe: "observe";
48
+ press: "press";
49
+ screenshot: "screenshot";
50
+ scroll: "scroll";
51
+ select: "select";
52
+ type: "type";
53
+ wait: "wait";
54
+ }>;
55
+ id: z.ZodOptional<z.ZodNumber>;
56
+ selector: z.ZodOptional<z.ZodString>;
57
+ text: z.ZodOptional<z.ZodString>;
58
+ value: z.ZodOptional<z.ZodString>;
59
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
+ url: z.ZodOptional<z.ZodString>;
61
+ key: z.ZodOptional<z.ZodString>;
62
+ dx: z.ZodOptional<z.ZodNumber>;
63
+ dy: z.ZodOptional<z.ZodNumber>;
64
+ ms: z.ZodOptional<z.ZodNumber>;
65
+ format: z.ZodOptional<z.ZodEnum<{
66
+ html: "html";
67
+ markdown: "markdown";
68
+ text: "text";
69
+ }>>;
70
+ wait_until: z.ZodOptional<z.ZodEnum<{
71
+ domcontentloaded: "domcontentloaded";
72
+ load: "load";
73
+ networkidle0: "networkidle0";
74
+ networkidle2: "networkidle2";
75
+ }>>;
76
+ viewport_only: z.ZodOptional<z.ZodBoolean>;
77
+ include_all: z.ZodOptional<z.ZodBoolean>;
78
+ }, z.core.$strip>>>;
39
79
  timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
40
80
  all: z.ZodOptional<z.ZodBoolean>;
41
81
  kill: z.ZodOptional<z.ZodBoolean>;
@@ -73,6 +113,7 @@ export declare class BrowserTool implements AgentTool<typeof browserSchema, Brow
73
113
  readonly summary = "Control a headless browser to navigate and interact with web pages";
74
114
  readonly parameters: z.ZodObject<{
75
115
  action: z.ZodEnum<{
116
+ act: "act";
76
117
  close: "close";
77
118
  open: "open";
78
119
  run: "run";
@@ -101,6 +142,45 @@ export declare class BrowserTool implements AgentTool<typeof browserSchema, Brow
101
142
  dismiss: "dismiss";
102
143
  }>>;
103
144
  code: z.ZodOptional<z.ZodString>;
145
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
146
+ verb: z.ZodEnum<{
147
+ back: "back";
148
+ click: "click";
149
+ extract: "extract";
150
+ fill: "fill";
151
+ navigate: "navigate";
152
+ observe: "observe";
153
+ press: "press";
154
+ screenshot: "screenshot";
155
+ scroll: "scroll";
156
+ select: "select";
157
+ type: "type";
158
+ wait: "wait";
159
+ }>;
160
+ id: z.ZodOptional<z.ZodNumber>;
161
+ selector: z.ZodOptional<z.ZodString>;
162
+ text: z.ZodOptional<z.ZodString>;
163
+ value: z.ZodOptional<z.ZodString>;
164
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
165
+ url: z.ZodOptional<z.ZodString>;
166
+ key: z.ZodOptional<z.ZodString>;
167
+ dx: z.ZodOptional<z.ZodNumber>;
168
+ dy: z.ZodOptional<z.ZodNumber>;
169
+ ms: z.ZodOptional<z.ZodNumber>;
170
+ format: z.ZodOptional<z.ZodEnum<{
171
+ html: "html";
172
+ markdown: "markdown";
173
+ text: "text";
174
+ }>>;
175
+ wait_until: z.ZodOptional<z.ZodEnum<{
176
+ domcontentloaded: "domcontentloaded";
177
+ load: "load";
178
+ networkidle0: "networkidle0";
179
+ networkidle2: "networkidle2";
180
+ }>>;
181
+ viewport_only: z.ZodOptional<z.ZodBoolean>;
182
+ include_all: z.ZodOptional<z.ZodBoolean>;
183
+ }, z.core.$strip>>>;
104
184
  timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
105
185
  all: z.ZodOptional<z.ZodBoolean>;
106
186
  kill: z.ZodOptional<z.ZodBoolean>;
@@ -72,6 +72,7 @@ interface InlineImageData {
72
72
  }
73
73
  /** Set the preferred image provider from settings */
74
74
  export declare function setPreferredImageProvider(provider: ImageProvider | "auto"): void;
75
+ export declare function isOpenAIHostedImageModel(model: Model | undefined): model is Model;
75
76
  export declare const imageGenTool: CustomTool<typeof imageGenSchema, ImageGenToolDetails>;
76
77
  export declare function getImageGenTools(modelRegistry?: ModelRegistry, activeModel?: Model): Promise<Array<CustomTool<typeof imageGenSchema, ImageGenToolDetails>>>;
77
78
  export declare function getImageGenToolsWithRegistry(modelRegistry: ModelRegistry, activeModel?: Model): Promise<Array<CustomTool<typeof imageGenSchema, ImageGenToolDetails>>>;
@@ -8,7 +8,7 @@ import type { HindsightSessionState } from "../hindsight/state";
8
8
  import type { WorkflowGateEmitter } from "../modes/shared/agent-wire/unattended-session";
9
9
  import type { PlanModeState } from "../plan-mode/state";
10
10
  import type { AgentRegistry } from "../registry/agent-registry";
11
- import type { ForkContextSeed, ForkContextSeedOptions } from "../session/agent-session";
11
+ import type { ForkContextSeed, ForkContextSeedOptions, PurgeQueuedCustomMessagesResult } from "../session/agent-session";
12
12
  import type { ArtifactManager } from "../session/artifacts";
13
13
  import type { ClientBridge } from "../session/client-bridge";
14
14
  import type { CustomMessage } from "../session/messages";
@@ -117,6 +117,8 @@ export interface ToolSession {
117
117
  /** Agent identity used for IRC routing. Returns the registry id (e.g. "0-Main", "0-AuthLoader"). */
118
118
  getAgentId?: () => string | null;
119
119
  /** Look up a registered tool by name (used by the eval js backend's tool bridge). */
120
+ /** Purge undelivered queued custom messages matching the predicate. Returns counts. */
121
+ purgeQueuedCustomMessages?: (predicate: (message: CustomMessage) => boolean) => PurgeQueuedCustomMessagesResult;
120
122
  getToolByName?: (name: string) => AgentTool | undefined;
121
123
  /** Agent registry for IRC routing across live sessions. */
122
124
  agentRegistry?: AgentRegistry;
@@ -19,7 +19,7 @@ interface JobSnapshot {
19
19
  resultText?: string;
20
20
  errorText?: string;
21
21
  }
22
- type CancelStatus = "cancelled" | "not_found" | "already_completed";
22
+ type CancelStatus = "cancelled" | "not_found" | "already_completed" | "already_cancelled";
23
23
  export interface JobToolDetails {
24
24
  jobs: JobSnapshot[];
25
25
  cancelled?: {
@@ -0,0 +1,25 @@
1
+ /**
2
+ * TUI renderer for the `subagent` tool.
3
+ *
4
+ * The await panel surfaces each awaited subagent's live streaming status at
5
+ * parity with the inline `task` panel by reusing `renderSubagentLiveProgress`.
6
+ * Falls back to a `running, no activity yet` placeholder when a live producer
7
+ * exists but has not emitted yet, and to a static status line when no live
8
+ * producer is available (resumed-from-disk or backward-compat records).
9
+ */
10
+ import type { Component } from "@gajae-code/tui";
11
+ import type { RenderResultOptions } from "../extensibility/custom-tools/types";
12
+ import type { Theme } from "../modes/theme/theme";
13
+ import type { SubagentToolDetails } from "./subagent";
14
+ export declare const subagentToolRenderer: {
15
+ inline: boolean;
16
+ renderCall(_args: unknown, _options: RenderResultOptions, theme: Theme): Component;
17
+ renderResult(result: {
18
+ content: Array<{
19
+ type: string;
20
+ text?: string;
21
+ }>;
22
+ details?: SubagentToolDetails;
23
+ }, options: RenderResultOptions, theme: Theme): Component;
24
+ mergeCallAndResult: boolean;
25
+ };
@@ -1,6 +1,6 @@
1
1
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@gajae-code/agent-core";
2
2
  import * as z from "zod/v4";
3
- import type { AgentSource } from "../task/types";
3
+ import type { AgentProgress, AgentSource } from "../task/types";
4
4
  import type { ToolSession } from "./index";
5
5
  declare const subagentSchema: z.ZodObject<{
6
6
  action: z.ZodEnum<{
@@ -42,6 +42,10 @@ export interface SubagentSnapshot {
42
42
  outputRef?: string;
43
43
  truncated?: boolean;
44
44
  guidance?: string;
45
+ /** Live streaming progress for the awaited subagent (await panel only; UI detail). */
46
+ progress?: AgentProgress;
47
+ /** True when a live in-session progress producer exists for this subagent. */
48
+ liveProgressAvailable?: boolean;
45
49
  }
46
50
  export interface SubagentToolDetails {
47
51
  subagents: SubagentSnapshot[];