@gajae-code/coding-agent 0.3.2 → 0.4.1
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/CHANGELOG.md +39 -0
- package/dist/types/config/model-registry.d.ts +17 -10
- package/dist/types/config/models-config-schema.d.ts +37 -0
- package/dist/types/config/settings-schema.d.ts +5 -0
- package/dist/types/edit/diff.d.ts +16 -0
- package/dist/types/edit/modes/replace.d.ts +7 -0
- package/dist/types/extensibility/gjc-plugins/activation.d.ts +14 -0
- package/dist/types/extensibility/gjc-plugins/index.d.ts +9 -0
- package/dist/types/extensibility/gjc-plugins/injection.d.ts +31 -0
- package/dist/types/extensibility/gjc-plugins/loader.d.ts +3 -0
- package/dist/types/extensibility/gjc-plugins/paths.d.ts +8 -0
- package/dist/types/extensibility/gjc-plugins/schema.d.ts +3 -0
- package/dist/types/extensibility/gjc-plugins/state.d.ts +9 -0
- package/dist/types/extensibility/gjc-plugins/tools.d.ts +8 -0
- package/dist/types/extensibility/gjc-plugins/types.d.ts +64 -0
- package/dist/types/extensibility/gjc-plugins/validation.d.ts +4 -0
- package/dist/types/extensibility/skills.d.ts +9 -1
- package/dist/types/gjc-runtime/state-runtime.d.ts +22 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +1 -2
- package/dist/types/harness-control-plane/storage.d.ts +7 -0
- package/dist/types/lsp/client.d.ts +1 -0
- package/dist/types/modes/bridge/bridge-mode.d.ts +2 -0
- package/dist/types/modes/prompt-action-autocomplete.d.ts +2 -2
- package/dist/types/modes/rpc/rpc-client.d.ts +19 -1
- package/dist/types/modes/rpc/rpc-types.d.ts +179 -2
- package/dist/types/modes/shared/agent-wire/approval-gate.d.ts +57 -0
- package/dist/types/modes/shared/agent-wire/command-dispatch.d.ts +16 -1
- package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +47 -0
- package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +7 -0
- package/dist/types/modes/shared/agent-wire/handshake.d.ts +11 -1
- package/dist/types/modes/shared/agent-wire/protocol.d.ts +3 -1
- package/dist/types/modes/shared/agent-wire/responses.d.ts +1 -1
- package/dist/types/modes/shared/agent-wire/unattended-action-policy.d.ts +27 -0
- package/dist/types/modes/shared/agent-wire/unattended-audit.d.ts +68 -0
- package/dist/types/modes/shared/agent-wire/unattended-run-controller.d.ts +161 -0
- package/dist/types/modes/shared/agent-wire/unattended-session.d.ts +61 -0
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +114 -0
- package/dist/types/modes/shared/agent-wire/workflow-gate-schema.d.ts +39 -0
- package/dist/types/modes/theme/theme.d.ts +2 -1
- package/dist/types/runtime-mcp/transports/stdio.d.ts +0 -4
- package/dist/types/sdk.d.ts +7 -0
- package/dist/types/session/agent-session.d.ts +10 -0
- package/dist/types/session/blob-store.d.ts +17 -0
- package/dist/types/session/messages.d.ts +3 -0
- package/dist/types/session/session-storage.d.ts +6 -0
- package/dist/types/skill-state/active-state.d.ts +13 -0
- package/dist/types/thinking.d.ts +3 -2
- package/dist/types/tools/index.d.ts +3 -0
- package/package.json +9 -7
- package/src/cli.ts +14 -0
- package/src/commands/harness.ts +192 -7
- package/src/commands/ultragoal.ts +1 -21
- package/src/config/model-equivalence.ts +1 -1
- package/src/config/model-registry.ts +32 -5
- package/src/config/models-config-schema.ts +7 -2
- package/src/config/settings-schema.ts +4 -1
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +19 -23
- package/src/defaults/gjc/skills/ralplan/SKILL.md +7 -7
- package/src/discovery/claude-plugins.ts +25 -5
- package/src/edit/diff.ts +64 -1
- package/src/edit/modes/replace.ts +60 -2
- package/src/extensibility/gjc-plugins/activation.ts +87 -0
- package/src/extensibility/gjc-plugins/index.ts +9 -0
- package/src/extensibility/gjc-plugins/injection.ts +114 -0
- package/src/extensibility/gjc-plugins/loader.ts +131 -0
- package/src/extensibility/gjc-plugins/paths.ts +66 -0
- package/src/extensibility/gjc-plugins/schema.ts +79 -0
- package/src/extensibility/gjc-plugins/state.ts +29 -0
- package/src/extensibility/gjc-plugins/tools.ts +47 -0
- package/src/extensibility/gjc-plugins/types.ts +97 -0
- package/src/extensibility/gjc-plugins/validation.ts +76 -0
- package/src/extensibility/skills.ts +39 -7
- package/src/gjc-runtime/state-runtime.ts +93 -2
- package/src/gjc-runtime/state-writer.ts +17 -1
- package/src/gjc-runtime/ultragoal-runtime.ts +76 -121
- package/src/gjc-runtime/workflow-manifest.generated.json +5 -0
- package/src/gjc-runtime/workflow-manifest.ts +2 -2
- package/src/harness-control-plane/storage.ts +144 -2
- package/src/hashline/hash.ts +23 -0
- package/src/hooks/skill-state.ts +2 -0
- package/src/internal-urls/docs-index.generated.ts +5 -5
- package/src/lsp/client.ts +7 -0
- package/src/modes/acp/acp-agent.ts +25 -2
- package/src/modes/bridge/bridge-mode.ts +124 -2
- package/src/modes/controllers/input-controller.ts +14 -2
- package/src/modes/prompt-action-autocomplete.ts +49 -10
- package/src/modes/rpc/rpc-client.ts +79 -3
- package/src/modes/rpc/rpc-mode.ts +67 -0
- package/src/modes/rpc/rpc-types.ts +224 -2
- package/src/modes/shared/agent-wire/approval-gate.ts +151 -0
- package/src/modes/shared/agent-wire/command-dispatch.ts +97 -4
- package/src/modes/shared/agent-wire/command-validation.ts +25 -1
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +222 -0
- package/src/modes/shared/agent-wire/event-envelope.ts +13 -0
- package/src/modes/shared/agent-wire/handshake.ts +43 -3
- package/src/modes/shared/agent-wire/protocol.ts +7 -0
- package/src/modes/shared/agent-wire/responses.ts +2 -2
- package/src/modes/shared/agent-wire/scopes.ts +2 -0
- package/src/modes/shared/agent-wire/unattended-action-policy.ts +341 -0
- package/src/modes/shared/agent-wire/unattended-audit.ts +175 -0
- package/src/modes/shared/agent-wire/unattended-run-controller.ts +406 -0
- package/src/modes/shared/agent-wire/unattended-session.ts +180 -0
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +324 -0
- package/src/modes/shared/agent-wire/workflow-gate-schema.ts +331 -0
- package/src/modes/theme/theme.ts +6 -0
- package/src/prompts/system/system-prompt.md +9 -0
- package/src/runtime-mcp/client.ts +7 -4
- package/src/runtime-mcp/manager.ts +45 -13
- package/src/runtime-mcp/transports/http.ts +40 -14
- package/src/runtime-mcp/transports/stdio.ts +11 -10
- package/src/sdk.ts +47 -0
- package/src/session/agent-session.ts +211 -2
- package/src/session/blob-store.ts +84 -0
- package/src/session/messages.ts +3 -0
- package/src/session/session-manager.ts +390 -33
- package/src/session/session-storage.ts +26 -0
- package/src/setup/provider-onboarding.ts +2 -2
- package/src/skill-state/active-state.ts +89 -1
- package/src/task/discovery.ts +7 -1
- package/src/task/executor.ts +16 -2
- package/src/thinking.ts +8 -2
- package/src/tools/ask.ts +39 -9
- package/src/tools/index.ts +3 -0
- package/src/tools/skill.ts +15 -3
- package/src/utils/edit-mode.ts +1 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unattended run controller (#318).
|
|
3
|
+
*
|
|
4
|
+
* The single required owner of negotiated unattended state. Entering unattended
|
|
5
|
+
* mode is fail-closed: a controller can only be created via {@link
|
|
6
|
+
* UnattendedRunController.negotiate}, which rejects a missing/partial budget, an
|
|
7
|
+
* invalid declaration, or a provider that cannot account for tokens/cost.
|
|
8
|
+
*
|
|
9
|
+
* The controller owns budget accounting across metrics and phases. Scope/action
|
|
10
|
+
* authorization (#319) and the durable audit trail (#320) layer onto the same
|
|
11
|
+
* controller; this slice wires the budget floor and abort coordination.
|
|
12
|
+
*
|
|
13
|
+
* Attended mode never constructs a controller, so by construction the attended
|
|
14
|
+
* path is unaffected by everything here.
|
|
15
|
+
*/
|
|
16
|
+
import type { RpcActionDenied, RpcBudgetExceeded, RpcBudgetMetric, RpcScopeDenied, RpcUnattendedActionClass, RpcUnattendedBudget, RpcUnattendedRefusalCode } from "../../rpc/rpc-types";
|
|
17
|
+
import type { BridgeCommandScope } from "./scopes";
|
|
18
|
+
import { actionClassForScope } from "./unattended-action-policy";
|
|
19
|
+
/** Coordinated abort surfaces invoked exactly once on a budget breach / abort. */
|
|
20
|
+
export interface UnattendedAbortHooks {
|
|
21
|
+
abortModelStream?(): void | Promise<void>;
|
|
22
|
+
abortBash?(): void | Promise<void>;
|
|
23
|
+
cancelHostTools?(reason: string): void | Promise<void>;
|
|
24
|
+
cancelHostUris?(reason: string): void | Promise<void>;
|
|
25
|
+
stopWorkflow?(reason: string): void | Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export type UnattendedAuditEvent = {
|
|
28
|
+
event: "unattended_negotiated";
|
|
29
|
+
run_id: string;
|
|
30
|
+
actor: string;
|
|
31
|
+
} | {
|
|
32
|
+
event: "budget_exceeded";
|
|
33
|
+
payload: RpcBudgetExceeded;
|
|
34
|
+
} | {
|
|
35
|
+
event: "unattended_aborted";
|
|
36
|
+
run_id: string;
|
|
37
|
+
reason: string;
|
|
38
|
+
} | {
|
|
39
|
+
event: "unattended_abort_settled";
|
|
40
|
+
run_id: string;
|
|
41
|
+
status: "aborted" | "abort_failed";
|
|
42
|
+
failures: number;
|
|
43
|
+
} | {
|
|
44
|
+
event: "scope_denied";
|
|
45
|
+
payload: RpcScopeDenied;
|
|
46
|
+
} | {
|
|
47
|
+
event: "action_denied";
|
|
48
|
+
payload: RpcActionDenied;
|
|
49
|
+
};
|
|
50
|
+
export interface NegotiateContext {
|
|
51
|
+
runId: string;
|
|
52
|
+
sessionId?: string;
|
|
53
|
+
audit?(event: UnattendedAuditEvent): void;
|
|
54
|
+
abortHooks?: UnattendedAbortHooks;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the active provider can report token usage and cost. Unattended
|
|
57
|
+
* mode rejects providers without this accounting up front (fail-closed).
|
|
58
|
+
*/
|
|
59
|
+
providerSupportsTokenCostMetrics?: boolean;
|
|
60
|
+
/** Injectable clock for deterministic tests. Defaults to Date.now. */
|
|
61
|
+
now?(): number;
|
|
62
|
+
}
|
|
63
|
+
export declare class UnattendedNegotiationError extends Error {
|
|
64
|
+
readonly code: RpcUnattendedRefusalCode;
|
|
65
|
+
constructor(code: RpcUnattendedRefusalCode, message: string);
|
|
66
|
+
}
|
|
67
|
+
export declare class UnattendedBudgetExceededError extends Error {
|
|
68
|
+
readonly payload: RpcBudgetExceeded;
|
|
69
|
+
constructor(payload: RpcBudgetExceeded);
|
|
70
|
+
}
|
|
71
|
+
/** Thrown when a provider/tool reports a non-finite usage value (fail-closed). */
|
|
72
|
+
export declare class UnattendedAccountingError extends Error {
|
|
73
|
+
readonly metric: RpcBudgetMetric;
|
|
74
|
+
readonly phase: string;
|
|
75
|
+
constructor(metric: RpcBudgetMetric, phase: string, value: unknown);
|
|
76
|
+
}
|
|
77
|
+
/** Thrown when a command's coarse scope is outside the declared allowlist (#319). */
|
|
78
|
+
export declare class ScopeDeniedError extends Error {
|
|
79
|
+
readonly payload: RpcScopeDenied;
|
|
80
|
+
constructor(payload: RpcScopeDenied);
|
|
81
|
+
}
|
|
82
|
+
/** Thrown when an action class is outside the declared allowlist (default-deny, #319). */
|
|
83
|
+
export declare class ActionDeniedError extends Error {
|
|
84
|
+
readonly payload: RpcActionDenied;
|
|
85
|
+
constructor(payload: RpcActionDenied);
|
|
86
|
+
}
|
|
87
|
+
interface Usage {
|
|
88
|
+
tokens: number;
|
|
89
|
+
toolCalls: number;
|
|
90
|
+
costUsd: number;
|
|
91
|
+
}
|
|
92
|
+
export declare class UnattendedRunController {
|
|
93
|
+
readonly runId: string;
|
|
94
|
+
readonly sessionId?: string;
|
|
95
|
+
readonly actor: string;
|
|
96
|
+
readonly budget: RpcUnattendedBudget;
|
|
97
|
+
readonly scopes: ReadonlySet<string>;
|
|
98
|
+
readonly actionAllowlist: ReadonlySet<string>;
|
|
99
|
+
private readonly usage;
|
|
100
|
+
private readonly startedAt;
|
|
101
|
+
private readonly now;
|
|
102
|
+
private readonly audit?;
|
|
103
|
+
private readonly abortHooks;
|
|
104
|
+
private aborted;
|
|
105
|
+
private abortPromise?;
|
|
106
|
+
private constructor();
|
|
107
|
+
/** Fail-closed entry: validate the declaration + budget, or throw. */
|
|
108
|
+
static negotiate(declaration: unknown, ctx: NegotiateContext): UnattendedRunController;
|
|
109
|
+
get isAborted(): boolean;
|
|
110
|
+
usageSnapshot(): Readonly<Usage> & {
|
|
111
|
+
wallTimeMs: number;
|
|
112
|
+
};
|
|
113
|
+
remainingWallTimeMs(): number;
|
|
114
|
+
/**
|
|
115
|
+
* Authorize a command's coarse scope against the declared allowlist. Throws
|
|
116
|
+
* ScopeDeniedError (pre-side-effect) when the scope was not declared.
|
|
117
|
+
*/
|
|
118
|
+
authorizeScope(scope: BridgeCommandScope, command?: string): void;
|
|
119
|
+
/**
|
|
120
|
+
* Authorize an action class against the declared allowlist. Default-deny: any
|
|
121
|
+
* class not explicitly declared is rejected with ActionDeniedError before the
|
|
122
|
+
* side effect runs.
|
|
123
|
+
*/
|
|
124
|
+
authorizeAction(action: RpcUnattendedActionClass, command?: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Classify a bash command and authorize the resulting action class BEFORE the
|
|
127
|
+
* command is executed. Returns the classified action class on success.
|
|
128
|
+
*/
|
|
129
|
+
authorizeBash(command: string): RpcUnattendedActionClass;
|
|
130
|
+
/** Convenience: map a coarse scope to its `command.<scope>` action class. */
|
|
131
|
+
static actionClassForScope: typeof actionClassForScope;
|
|
132
|
+
/** Pre-turn estimate: refuse to start a turn that would obviously breach. */
|
|
133
|
+
preTurnEstimate(estimate: {
|
|
134
|
+
tokens?: number;
|
|
135
|
+
costUsd?: number;
|
|
136
|
+
}): void;
|
|
137
|
+
/** Reserve one tool-call unit BEFORE any side effect; breach if it would exceed. */
|
|
138
|
+
preflightToolCall(phase?: string): void;
|
|
139
|
+
/** Post-turn reconciliation of actual token usage. Fails closed on non-finite. */
|
|
140
|
+
recordTokens(tokens: number, phase?: string): void;
|
|
141
|
+
recordCost(costUsd: number, phase?: string): void;
|
|
142
|
+
/** Combined post-turn reconciliation. */
|
|
143
|
+
reconcile(actual: {
|
|
144
|
+
tokens?: number;
|
|
145
|
+
costUsd?: number;
|
|
146
|
+
}, phase?: string): void;
|
|
147
|
+
/** Wall-time check; call before/inside long operations. */
|
|
148
|
+
checkWallTime(phase?: string): void;
|
|
149
|
+
private breach;
|
|
150
|
+
/**
|
|
151
|
+
* Idempotent abort: runs every abort hook at most once. Safe to call from the
|
|
152
|
+
* synchronous breach path (which does not await) and from callers that do; both
|
|
153
|
+
* share a single abort promise so hook completion can be awaited deterministically.
|
|
154
|
+
*/
|
|
155
|
+
abort(reason: string): Promise<void>;
|
|
156
|
+
/** Returns the in-flight/settled abort completion once aborting has begun. */
|
|
157
|
+
get abortCompletion(): Promise<void> | undefined;
|
|
158
|
+
private fireAbort;
|
|
159
|
+
private runAbortHooks;
|
|
160
|
+
}
|
|
161
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-level unattended control plane (#323 / G011 emission side).
|
|
3
|
+
*
|
|
4
|
+
* Bridges the gate EMISSION side (skill runtimes / ask tool emitting gates) to
|
|
5
|
+
* the gate ANSWER side (the external agent's `workflow_gate_response` over RPC):
|
|
6
|
+
*
|
|
7
|
+
* - `emitGate(input)` opens a gate on the durable broker, emits the gate frame
|
|
8
|
+
* to the transport, and returns a promise that resolves with the agent's
|
|
9
|
+
* answer once it arrives.
|
|
10
|
+
* - `resolveGate(response)` (called from RPC dispatch) validates + resolves the
|
|
11
|
+
* gate on the broker; the broker's `advance` hook resolves the pending
|
|
12
|
+
* `emitGate` promise with the answer.
|
|
13
|
+
*
|
|
14
|
+
* Also implements the dispatch-facing {@link RpcUnattendedControlPlane} so the
|
|
15
|
+
* RPC server can route `negotiate_unattended` + `workflow_gate_response` here.
|
|
16
|
+
*/
|
|
17
|
+
import type { RpcCommand, RpcUnattendedAccepted, RpcUnattendedDeclaration, RpcWorkflowGate, RpcWorkflowGateResolution, RpcWorkflowGateResponse } from "../../rpc/rpc-types";
|
|
18
|
+
import type { RpcUnattendedControlPlane } from "./command-dispatch";
|
|
19
|
+
import { type UnattendedAbortHooks, type UnattendedAuditEvent, UnattendedRunController } from "./unattended-run-controller";
|
|
20
|
+
import { type GateStore, type OpenGateInput } from "./workflow-gate-broker";
|
|
21
|
+
/** Minimal surface a skill runtime / ask tool uses to emit a gate and await its answer. */
|
|
22
|
+
export interface WorkflowGateEmitter {
|
|
23
|
+
/** True only when unattended mode has been negotiated. */
|
|
24
|
+
isUnattended(): boolean;
|
|
25
|
+
/** Open + emit a gate; resolves with the agent's answer (from workflow_gate_response). */
|
|
26
|
+
emitGate(input: OpenGateInput): Promise<unknown>;
|
|
27
|
+
}
|
|
28
|
+
export interface UnattendedSessionOptions {
|
|
29
|
+
runId: string;
|
|
30
|
+
sessionId?: string;
|
|
31
|
+
/** Emit a workflow_gate frame to the transport so the agent receives it. */
|
|
32
|
+
emitFrame: (gate: RpcWorkflowGate) => void;
|
|
33
|
+
/** Durable gate store; defaults to in-memory. */
|
|
34
|
+
store?: GateStore;
|
|
35
|
+
/** Audit sink for controller + gate events. */
|
|
36
|
+
audit?: (event: UnattendedAuditEvent | {
|
|
37
|
+
event: string;
|
|
38
|
+
[k: string]: unknown;
|
|
39
|
+
}) => void;
|
|
40
|
+
abortHooks?: UnattendedAbortHooks;
|
|
41
|
+
/** Whether the active provider reports token/cost usage (fail-closed when false/omitted). */
|
|
42
|
+
providerSupportsTokenCostMetrics?: boolean;
|
|
43
|
+
/** Snapshot live cumulative usage after a dispatch or turn, for budget reconciliation. */
|
|
44
|
+
getUsageSnapshot?: () => {
|
|
45
|
+
tokens?: number;
|
|
46
|
+
costUsd?: number;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export declare class UnattendedSessionControlPlane implements RpcUnattendedControlPlane, WorkflowGateEmitter {
|
|
50
|
+
#private;
|
|
51
|
+
private readonly opts;
|
|
52
|
+
constructor(opts: UnattendedSessionOptions);
|
|
53
|
+
isUnattended(): boolean;
|
|
54
|
+
get controller(): UnattendedRunController | undefined;
|
|
55
|
+
negotiate(declaration: RpcUnattendedDeclaration): RpcUnattendedAccepted;
|
|
56
|
+
preflightCommand(command: RpcCommand): void;
|
|
57
|
+
reconcileUsage(phase?: string): void;
|
|
58
|
+
resolveGate(response: RpcWorkflowGateResponse): Promise<RpcWorkflowGateResolution>;
|
|
59
|
+
emitGate(input: OpenGateInput): Promise<unknown>;
|
|
60
|
+
recover(): Promise<void>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { RpcWorkflowGate, RpcWorkflowGateContext, RpcWorkflowGateKind, RpcWorkflowGateOption, RpcWorkflowGateResolution, RpcWorkflowGateResponse, RpcWorkflowStage } from "../../rpc/rpc-types";
|
|
2
|
+
export interface PersistedGate {
|
|
3
|
+
gate: RpcWorkflowGate;
|
|
4
|
+
status: "pending" | "accepted";
|
|
5
|
+
idempotencyKey?: string;
|
|
6
|
+
responseHash?: string;
|
|
7
|
+
/** Raw accepted answer, retained so a crashed advance can be replayed. */
|
|
8
|
+
answer?: unknown;
|
|
9
|
+
resolution?: RpcWorkflowGateResolution;
|
|
10
|
+
advanced: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface GateStore {
|
|
13
|
+
nextSeq(stage: RpcWorkflowStage): number;
|
|
14
|
+
put(record: PersistedGate): void;
|
|
15
|
+
get(gateId: string): PersistedGate | undefined;
|
|
16
|
+
/** All persisted gate records (used for crash recovery). */
|
|
17
|
+
list(): PersistedGate[];
|
|
18
|
+
}
|
|
19
|
+
export declare class MemoryGateStore implements GateStore {
|
|
20
|
+
private counters;
|
|
21
|
+
private gates;
|
|
22
|
+
nextSeq(stage: RpcWorkflowStage): number;
|
|
23
|
+
put(record: PersistedGate): void;
|
|
24
|
+
get(gateId: string): PersistedGate | undefined;
|
|
25
|
+
list(): PersistedGate[];
|
|
26
|
+
}
|
|
27
|
+
/** Crash-durable JSON-file backed store. Writes the full state on every mutation. */
|
|
28
|
+
export declare class FileGateStore implements GateStore {
|
|
29
|
+
private readonly filePath;
|
|
30
|
+
private state;
|
|
31
|
+
constructor(filePath: string);
|
|
32
|
+
private load;
|
|
33
|
+
private flush;
|
|
34
|
+
nextSeq(stage: RpcWorkflowStage): number;
|
|
35
|
+
put(record: PersistedGate): void;
|
|
36
|
+
get(gateId: string): PersistedGate | undefined;
|
|
37
|
+
list(): PersistedGate[];
|
|
38
|
+
}
|
|
39
|
+
export type GateAuditEvent = {
|
|
40
|
+
event: "gate_emitted";
|
|
41
|
+
gate_id: string;
|
|
42
|
+
stage: RpcWorkflowStage;
|
|
43
|
+
kind: RpcWorkflowGateKind;
|
|
44
|
+
} | {
|
|
45
|
+
event: "gate_response_accepted";
|
|
46
|
+
gate_id: string;
|
|
47
|
+
answer_hash: string;
|
|
48
|
+
} | {
|
|
49
|
+
event: "gate_response_rejected";
|
|
50
|
+
gate_id: string;
|
|
51
|
+
answer_hash: string;
|
|
52
|
+
} | {
|
|
53
|
+
event: "gate_response_idempotent_replay";
|
|
54
|
+
gate_id: string;
|
|
55
|
+
} | {
|
|
56
|
+
event: "gate_response_idempotency_conflict";
|
|
57
|
+
gate_id: string;
|
|
58
|
+
} | {
|
|
59
|
+
event: "gate_response_already_resolved";
|
|
60
|
+
gate_id: string;
|
|
61
|
+
} | {
|
|
62
|
+
event: "gate_response_unknown_gate";
|
|
63
|
+
gate_id: string;
|
|
64
|
+
} | {
|
|
65
|
+
event: "gate_advance_recovered";
|
|
66
|
+
gate_id: string;
|
|
67
|
+
};
|
|
68
|
+
export interface BrokerHooks {
|
|
69
|
+
/** Called once when a pending gate has been persisted and should be emitted. */
|
|
70
|
+
emit?(gate: RpcWorkflowGate): void;
|
|
71
|
+
/**
|
|
72
|
+
* Invoked to advance the workflow after an accepted resolution is durably
|
|
73
|
+
* committed. MUST be idempotent keyed by `gate.gate_id`: `recover()` replays
|
|
74
|
+
* it for any gate left `accepted` but not `advanced` by a crash.
|
|
75
|
+
*/
|
|
76
|
+
advance?(gate: RpcWorkflowGate, answer: unknown): void | Promise<void>;
|
|
77
|
+
/** Append-only audit sink. */
|
|
78
|
+
audit?(event: GateAuditEvent): void;
|
|
79
|
+
}
|
|
80
|
+
export interface OpenGateInput {
|
|
81
|
+
stage: RpcWorkflowStage;
|
|
82
|
+
kind: RpcWorkflowGateKind;
|
|
83
|
+
schema: RpcWorkflowGate["schema"];
|
|
84
|
+
options?: RpcWorkflowGateOption[];
|
|
85
|
+
context?: RpcWorkflowGateContext;
|
|
86
|
+
}
|
|
87
|
+
export declare class WorkflowGateBrokerError extends Error {
|
|
88
|
+
readonly code: "unknown_gate" | "already_resolved" | "idempotency_conflict" | "invalid_workflow_stage";
|
|
89
|
+
constructor(code: "unknown_gate" | "already_resolved" | "idempotency_conflict" | "invalid_workflow_stage", message: string);
|
|
90
|
+
}
|
|
91
|
+
export declare class WorkflowGateBroker {
|
|
92
|
+
private readonly runId;
|
|
93
|
+
private readonly store;
|
|
94
|
+
private readonly hooks;
|
|
95
|
+
constructor(runId: string, store: GateStore, hooks?: BrokerHooks);
|
|
96
|
+
private runShort;
|
|
97
|
+
/** Open and emit a gate. The pending record is persisted BEFORE emission. */
|
|
98
|
+
openGate(input: OpenGateInput): RpcWorkflowGate;
|
|
99
|
+
/**
|
|
100
|
+
* Resolve a gate with an answer. Validates against the advertised schema.
|
|
101
|
+
* On success the resolution is persisted BEFORE `advance` is invoked exactly
|
|
102
|
+
* once. Invalid answers leave the gate pending (per #315 acceptance).
|
|
103
|
+
*/
|
|
104
|
+
resolve(response: RpcWorkflowGateResponse): Promise<RpcWorkflowGateResolution>;
|
|
105
|
+
/**
|
|
106
|
+
* Recover any gate left `accepted` but not `advanced` by a crash between the
|
|
107
|
+
* durable accept and the advanced commit. Replays `advance` (which must be
|
|
108
|
+
* idempotent) exactly once per gate and marks it advanced. Returns the ids
|
|
109
|
+
* that were recovered.
|
|
110
|
+
*/
|
|
111
|
+
recover(): Promise<string[]>;
|
|
112
|
+
/** Canonical serialization helper (exposed for callers/tests). */
|
|
113
|
+
static canonical(value: unknown): string;
|
|
114
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { RpcJsonSchema, RpcWorkflowGateValidationError } from "../../rpc/rpc-types";
|
|
2
|
+
export declare const GATE_SCHEMA_LIMITS: {
|
|
3
|
+
readonly maxSchemaBytes: number;
|
|
4
|
+
readonly maxDepth: 16;
|
|
5
|
+
readonly maxProperties: 256;
|
|
6
|
+
readonly maxEnumValues: 512;
|
|
7
|
+
readonly maxAnswerBytes: number;
|
|
8
|
+
};
|
|
9
|
+
/** Thrown at gate construction when a schema is unsupported or too large. */
|
|
10
|
+
export declare class WorkflowGateSchemaError extends Error {
|
|
11
|
+
readonly code = "invalid_workflow_gate_schema";
|
|
12
|
+
constructor(message: string);
|
|
13
|
+
}
|
|
14
|
+
/** Canonical (stable-key-ordered) JSON serialization used for hashing. */
|
|
15
|
+
export declare function canonicalJson(value: unknown): string;
|
|
16
|
+
export declare function schemaHash(schema: RpcJsonSchema): string;
|
|
17
|
+
declare function answerHashOf(answer: unknown): string;
|
|
18
|
+
/** Validate the schema *shape*. Throws WorkflowGateSchemaError on any problem. */
|
|
19
|
+
export declare function assertSupportedGateSchema(schema: RpcJsonSchema): void;
|
|
20
|
+
type SchemaError = {
|
|
21
|
+
path: string;
|
|
22
|
+
keyword: string;
|
|
23
|
+
message: string;
|
|
24
|
+
expected?: unknown;
|
|
25
|
+
};
|
|
26
|
+
/** A compiled, cached validator for one schema. */
|
|
27
|
+
export interface CompiledGateSchema {
|
|
28
|
+
readonly schema: RpcJsonSchema;
|
|
29
|
+
readonly hash: string;
|
|
30
|
+
validate(answer: unknown): SchemaError[];
|
|
31
|
+
}
|
|
32
|
+
/** Compile (and cache) a validator for a schema. Asserts shape on first compile. */
|
|
33
|
+
export declare function compileGateSchema(schema: RpcJsonSchema): CompiledGateSchema;
|
|
34
|
+
/**
|
|
35
|
+
* Validate an answer against a compiled gate schema. Returns `null` on success
|
|
36
|
+
* or a typed {@link RpcWorkflowGateValidationError} on mismatch.
|
|
37
|
+
*/
|
|
38
|
+
export declare function validateGateAnswer(compiled: CompiledGateSchema, gateId: string, answer: unknown): RpcWorkflowGateValidationError | null;
|
|
39
|
+
export { answerHashOf };
|
|
@@ -6,7 +6,7 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
|
|
|
6
6
|
/**
|
|
7
7
|
* All available symbol keys organized by category.
|
|
8
8
|
*/
|
|
9
|
-
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.folder" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.agents" | "icon.cache" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "checkbox.checked" | "checkbox.unchecked" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.editing" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers";
|
|
9
|
+
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.folder" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.agents" | "icon.cache" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.max" | "checkbox.checked" | "checkbox.unchecked" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.editing" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers";
|
|
10
10
|
export type SpinnerType = "status" | "activity";
|
|
11
11
|
export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "bashMode" | "pythonMode" | "statusLineSep" | "statusLineModel" | "statusLinePath" | "statusLineGitClean" | "statusLineGitDirty" | "statusLineContext" | "statusLineSpend" | "statusLineStaged" | "statusLineDirty" | "statusLineUntracked" | "statusLineOutput" | "statusLineCost" | "statusLineSubagents";
|
|
12
12
|
/** Check if a string is a valid ThemeColor value */
|
|
@@ -149,6 +149,7 @@ export declare class Theme {
|
|
|
149
149
|
medium: string;
|
|
150
150
|
high: string;
|
|
151
151
|
xhigh: string;
|
|
152
|
+
max: string;
|
|
152
153
|
};
|
|
153
154
|
get checkbox(): {
|
|
154
155
|
checked: string;
|
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
* Messages are newline-delimited JSON.
|
|
6
6
|
*/
|
|
7
7
|
import type { MCPRequestOptions, MCPStdioServerConfig, MCPTransport } from "../../runtime-mcp/types";
|
|
8
|
-
/**
|
|
9
|
-
* Stdio transport for MCP servers.
|
|
10
|
-
* Spawns a subprocess and communicates via stdin/stdout.
|
|
11
|
-
*/
|
|
12
8
|
export declare class StdioTransport implements MCPTransport {
|
|
13
9
|
#private;
|
|
14
10
|
private config;
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -49,6 +49,13 @@ export interface CreateAgentSessionOptions {
|
|
|
49
49
|
providerSessionId?: string;
|
|
50
50
|
/** Custom tools to register (in addition to built-in tools). Accepts both CustomTool and ToolDefinition. */
|
|
51
51
|
customTools?: (CustomTool | ToolDefinition)[];
|
|
52
|
+
/** Explicit parent/phase used to load active GJC sub-skill tools for this session. */
|
|
53
|
+
gjcSubskillToolContext?: {
|
|
54
|
+
parent: string;
|
|
55
|
+
phase: string;
|
|
56
|
+
sessionId?: string;
|
|
57
|
+
cwd?: string;
|
|
58
|
+
};
|
|
52
59
|
/** Inline extensions (merged with discovery). */
|
|
53
60
|
extensions?: ExtensionFactory[];
|
|
54
61
|
/** Additional extension paths to load (merged with discovery). */
|
|
@@ -57,11 +57,13 @@ import { type FileSlashCommand } from "../extensibility/slash-commands";
|
|
|
57
57
|
import { GoalRuntime } from "../goals/runtime";
|
|
58
58
|
import type { Goal, GoalModeState } from "../goals/state";
|
|
59
59
|
import type { HindsightSessionState } from "../hindsight/state";
|
|
60
|
+
import type { WorkflowGateEmitter } from "../modes/shared/agent-wire/unattended-session";
|
|
60
61
|
import type { PlanModeState } from "../plan-mode/state";
|
|
61
62
|
import { type AgentRegistry } from "../registry/agent-registry";
|
|
62
63
|
import { type DiscoverableMCPSearchIndex, type DiscoverableMCPTool } from "../runtime-mcp/discoverable-tool-metadata";
|
|
63
64
|
import { type SecretObfuscator } from "../secrets/obfuscator";
|
|
64
65
|
import { type DiscoverableTool, type DiscoverableToolSearchIndex } from "../tool-discovery/tool-index";
|
|
66
|
+
import type { ToolSession } from "../tools";
|
|
65
67
|
import type { CheckpointState } from "../tools/checkpoint";
|
|
66
68
|
import { type TodoItem, type TodoPhase } from "../tools/todo-write";
|
|
67
69
|
import type { ClientBridge } from "./client-bridge";
|
|
@@ -166,6 +168,8 @@ export interface AgentSessionConfig {
|
|
|
166
168
|
taskDepth?: number;
|
|
167
169
|
/** Tool registry for LSP and settings */
|
|
168
170
|
toolRegistry?: Map<string, AgentTool>;
|
|
171
|
+
/** Tool-session factory context used to lazily attach workflow-gate-only tools. */
|
|
172
|
+
workflowGateToolSession?: ToolSession;
|
|
169
173
|
/** Current session pre-LLM message transform pipeline */
|
|
170
174
|
transformContext?: (messages: AgentMessage[], signal?: AbortSignal) => AgentMessage[] | Promise<AgentMessage[]>;
|
|
171
175
|
/** Provider payload hook used by the active session request path */
|
|
@@ -459,6 +463,10 @@ export declare class AgentSession {
|
|
|
459
463
|
* Replace RPC host-owned tools and refresh the active tool set before the next model call.
|
|
460
464
|
*/
|
|
461
465
|
refreshRpcHostTools(rpcTools: AgentTool[]): Promise<void>;
|
|
466
|
+
/**
|
|
467
|
+
* Refresh plugin sub-skill tools after workflow/sub-skill activation or phase changes.
|
|
468
|
+
*/
|
|
469
|
+
refreshGjcSubskillTools(): Promise<void>;
|
|
462
470
|
/** Whether auto-compaction is currently running */
|
|
463
471
|
get isCompacting(): boolean;
|
|
464
472
|
/**
|
|
@@ -496,6 +504,8 @@ export declare class AgentSession {
|
|
|
496
504
|
setPlanModeState(state: PlanModeState | undefined): void;
|
|
497
505
|
getGoalModeState(): GoalModeState | undefined;
|
|
498
506
|
setGoalModeState(state: GoalModeState | undefined): void;
|
|
507
|
+
getWorkflowGateEmitter(): WorkflowGateEmitter | undefined;
|
|
508
|
+
setWorkflowGateEmitter(emitter: WorkflowGateEmitter | undefined): void;
|
|
499
509
|
get goalRuntime(): GoalRuntime;
|
|
500
510
|
markPlanReferenceSent(): void;
|
|
501
511
|
setPlanReferencePath(path: string): void;
|
|
@@ -26,9 +26,20 @@ export declare class BlobStore {
|
|
|
26
26
|
putSync(data: Buffer): BlobPutResult;
|
|
27
27
|
/** Read blob by hash, returns Buffer or null if not found. */
|
|
28
28
|
get(hash: string): Promise<Buffer | null>;
|
|
29
|
+
/** Synchronously read blob by hash, returns Buffer or null if not found. */
|
|
30
|
+
getSync(hash: string): Buffer | null;
|
|
29
31
|
/** Check if a blob exists. */
|
|
30
32
|
has(hash: string): Promise<boolean>;
|
|
31
33
|
}
|
|
34
|
+
export declare class MemoryBlobStore extends BlobStore {
|
|
35
|
+
#private;
|
|
36
|
+
constructor();
|
|
37
|
+
put(data: Buffer): Promise<BlobPutResult>;
|
|
38
|
+
putSync(data: Buffer): BlobPutResult;
|
|
39
|
+
get(hash: string): Promise<Buffer | null>;
|
|
40
|
+
getSync(hash: string): Buffer | null;
|
|
41
|
+
has(hash: string): Promise<boolean>;
|
|
42
|
+
}
|
|
32
43
|
/** Check if a data string is a blob reference. */
|
|
33
44
|
export declare function isBlobRef(data: string): boolean;
|
|
34
45
|
/** Extract the SHA-256 hash from a blob reference string. */
|
|
@@ -61,3 +72,9 @@ export declare function resolveImageDataUrl(blobStore: BlobStore, data: string):
|
|
|
61
72
|
* If the blob is missing, logs a warning and returns a placeholder.
|
|
62
73
|
*/
|
|
63
74
|
export declare function resolveImageData(blobStore: BlobStore, data: string): Promise<string>;
|
|
75
|
+
/** Synchronously resolve an externalized provider image data URL back to its original string. */
|
|
76
|
+
export declare function resolveImageDataUrlSync(blobStore: BlobStore, data: string): string;
|
|
77
|
+
/** Synchronously resolve a blob reference back to base64 data. */
|
|
78
|
+
export declare function resolveImageDataSync(blobStore: BlobStore, data: string): string;
|
|
79
|
+
/** Synchronously resolve a blob reference back to utf8 text. */
|
|
80
|
+
export declare function resolveTextBlobSync(blobStore: BlobStore, data: string): string;
|
|
@@ -8,6 +8,7 @@ import type { AgentMessage } from "@gajae-code/agent-core";
|
|
|
8
8
|
import { type BranchSummaryMessage, type CompactionSummaryMessage } from "@gajae-code/agent-core/compaction/messages";
|
|
9
9
|
import type { AssistantMessage, ImageContent, Message, MessageAttribution, TextContent } from "@gajae-code/ai";
|
|
10
10
|
export { type BranchSummaryMessage, type CompactionSummaryMessage, createBranchSummaryMessage, createCompactionSummaryMessage, } from "@gajae-code/agent-core/compaction/messages";
|
|
11
|
+
import type { LoadedSubskillActivation } from "../extensibility/gjc-plugins";
|
|
11
12
|
import type { OutputMeta } from "../tools/output-meta";
|
|
12
13
|
export declare const SKILL_PROMPT_MESSAGE_TYPE = "skill-prompt";
|
|
13
14
|
export interface SkillPromptDetails {
|
|
@@ -15,6 +16,8 @@ export interface SkillPromptDetails {
|
|
|
15
16
|
path: string;
|
|
16
17
|
args?: string;
|
|
17
18
|
lineCount: number;
|
|
19
|
+
subskillActivation?: LoadedSubskillActivation;
|
|
20
|
+
subskillActivationSet?: LoadedSubskillActivation[];
|
|
18
21
|
/** Internal: tag used by AgentSession to remove the pending-display chip
|
|
19
22
|
* from `#steeringMessages` / `#followUpMessages` when the agent consumes
|
|
20
23
|
* this message. Not surfaced to renderers; the `__` prefix signals
|
|
@@ -30,7 +30,9 @@ export interface SessionStorage {
|
|
|
30
30
|
readTextPrefix(path: string, maxBytes: number): Promise<string>;
|
|
31
31
|
writeText(path: string, content: string): Promise<void>;
|
|
32
32
|
rename(path: string, nextPath: string): Promise<void>;
|
|
33
|
+
renameSync(path: string, nextPath: string): void;
|
|
33
34
|
unlink(path: string): Promise<void>;
|
|
35
|
+
unlinkSync(path: string): void;
|
|
34
36
|
deleteSessionWithArtifacts(sessionPath: string): Promise<void>;
|
|
35
37
|
openWriter(path: string, options?: {
|
|
36
38
|
flags?: "a" | "w";
|
|
@@ -49,7 +51,9 @@ export declare class FileSessionStorage implements SessionStorage {
|
|
|
49
51
|
readTextPrefix(path: string, maxBytes: number): Promise<string>;
|
|
50
52
|
writeText(path: string, content: string): Promise<void>;
|
|
51
53
|
rename(path: string, nextPath: string): Promise<void>;
|
|
54
|
+
renameSync(path: string, nextPath: string): void;
|
|
52
55
|
unlink(path: string): Promise<void>;
|
|
56
|
+
unlinkSync(path: string): void;
|
|
53
57
|
openWriter(path: string, options?: {
|
|
54
58
|
flags?: "a" | "w";
|
|
55
59
|
onError?: (err: Error) => void;
|
|
@@ -73,7 +77,9 @@ export declare class MemorySessionStorage implements SessionStorage {
|
|
|
73
77
|
readTextPrefix(path: string, maxBytes: number): Promise<string>;
|
|
74
78
|
writeText(path: string, content: string): Promise<void>;
|
|
75
79
|
rename(path: string, nextPath: string): Promise<void>;
|
|
80
|
+
renameSync(path: string, nextPath: string): void;
|
|
76
81
|
unlink(path: string): Promise<void>;
|
|
82
|
+
unlinkSync(path: string): void;
|
|
77
83
|
deleteSessionWithArtifacts(_sessionPath: string): Promise<void>;
|
|
78
84
|
openWriter(path: string, options?: {
|
|
79
85
|
flags?: "a" | "w";
|
|
@@ -18,6 +18,16 @@ export interface WorkflowHudSummary {
|
|
|
18
18
|
updated_at?: string;
|
|
19
19
|
}
|
|
20
20
|
export type { WorkflowStateReceipt } from "./workflow-state-contract";
|
|
21
|
+
export interface ActiveSubskillEntry {
|
|
22
|
+
plugin: string;
|
|
23
|
+
subskillName: string;
|
|
24
|
+
parent: string;
|
|
25
|
+
bindsTo: string;
|
|
26
|
+
phase: string;
|
|
27
|
+
activationArg: string;
|
|
28
|
+
filePath: string;
|
|
29
|
+
toolPaths: string[];
|
|
30
|
+
}
|
|
21
31
|
export interface SkillActiveEntry {
|
|
22
32
|
skill: string;
|
|
23
33
|
phase?: string;
|
|
@@ -33,6 +43,7 @@ export interface SkillActiveEntry {
|
|
|
33
43
|
handoff_from?: string;
|
|
34
44
|
handoff_to?: string;
|
|
35
45
|
handoff_at?: string;
|
|
46
|
+
active_subskills?: ActiveSubskillEntry[];
|
|
36
47
|
}
|
|
37
48
|
export interface SkillActiveState {
|
|
38
49
|
version?: number;
|
|
@@ -49,6 +60,7 @@ export interface SkillActiveState {
|
|
|
49
60
|
initialized_mode?: CanonicalGjcWorkflowSkill;
|
|
50
61
|
initialized_state_path?: string;
|
|
51
62
|
active_skills?: SkillActiveEntry[];
|
|
63
|
+
active_subskills?: ActiveSubskillEntry[];
|
|
52
64
|
[key: string]: unknown;
|
|
53
65
|
}
|
|
54
66
|
export interface SkillActiveStatePaths {
|
|
@@ -70,6 +82,7 @@ export interface SyncSkillActiveStateOptions {
|
|
|
70
82
|
handoff_from?: string;
|
|
71
83
|
handoff_to?: string;
|
|
72
84
|
handoff_at?: string;
|
|
85
|
+
active_subskills?: ActiveSubskillEntry[];
|
|
73
86
|
}
|
|
74
87
|
export declare function normalizeWorkflowHudSummary(raw: unknown): WorkflowHudSummary | undefined;
|
|
75
88
|
export declare function isCanonicalGjcWorkflowSkill(skill: string): skill is CanonicalGjcWorkflowSkill;
|
package/dist/types/thinking.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type ResolvedThinkingLevel, ThinkingLevel } from "@gajae-code/agent-core";
|
|
2
|
-
import { type Effort
|
|
1
|
+
import { type ResolvedThinkingLevel, ThinkingLevel } from "@gajae-code/agent-core/thinking";
|
|
2
|
+
import { type Effort } from "@gajae-code/ai/model-thinking";
|
|
3
|
+
import type { Model } from "@gajae-code/ai/types";
|
|
3
4
|
/**
|
|
4
5
|
* Metadata used to render thinking selector values in the coding-agent UI.
|
|
5
6
|
*/
|
|
@@ -5,6 +5,7 @@ import type { Settings } from "../config/settings";
|
|
|
5
5
|
import type { Skill } from "../extensibility/skills";
|
|
6
6
|
import type { GoalModeState, GoalRuntime } from "../goals";
|
|
7
7
|
import type { HindsightSessionState } from "../hindsight/state";
|
|
8
|
+
import type { WorkflowGateEmitter } from "../modes/shared/agent-wire/unattended-session";
|
|
8
9
|
import type { PlanModeState } from "../plan-mode/state";
|
|
9
10
|
import type { AgentRegistry } from "../registry/agent-registry";
|
|
10
11
|
import type { ForkContextSeed, ForkContextSeedOptions } from "../session/agent-session";
|
|
@@ -150,6 +151,8 @@ export interface ToolSession {
|
|
|
150
151
|
getPlanModeState?: () => PlanModeState | undefined;
|
|
151
152
|
/** Goal mode state (if active or paused) */
|
|
152
153
|
getGoalModeState?: () => GoalModeState | undefined;
|
|
154
|
+
/** Unattended workflow-gate emitter (present only when unattended mode is negotiated). */
|
|
155
|
+
getWorkflowGateEmitter?: () => WorkflowGateEmitter | undefined;
|
|
153
156
|
/** Goal runtime for the active agent session. */
|
|
154
157
|
getGoalRuntime?: () => GoalRuntime | undefined;
|
|
155
158
|
/** Bridge to the connected client (e.g. ACP editor host). Tools should route fs/terminal/permission requests through this when available. */
|