@gajae-code/coding-agent 0.17.4 → 0.17.6
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 +82 -0
- package/dist/types/config/autorouting-tier-map.d.ts +1031 -3
- package/dist/types/config/file-lock.d.ts +4 -2
- package/dist/types/config/model-registry.d.ts +3 -1
- package/dist/types/config/model-resolver.d.ts +1 -1
- package/dist/types/exec/bash-executor.d.ts +2 -0
- package/dist/types/extensibility/gjc-plugins/runtime-adapters.d.ts +11 -2
- package/dist/types/gjc-runtime/state-writer.d.ts +14 -1
- package/dist/types/harness-control-plane/control-endpoint.d.ts +4 -1
- package/dist/types/harness-control-plane/finalize.d.ts +14 -3
- package/dist/types/main.d.ts +1 -1
- package/dist/types/runtime-mcp/loader.d.ts +2 -0
- package/dist/types/runtime-mcp/manager.d.ts +13 -6
- package/dist/types/sdk/broker/broker.d.ts +4 -2
- package/dist/types/sdk/broker/ensure.d.ts +3 -0
- package/dist/types/sdk/broker/identity.d.ts +2 -0
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +11 -3
- package/dist/types/sdk/broker/managed-task-dag.d.ts +1335 -0
- package/dist/types/sdk/broker/managed-task-verification.d.ts +37 -0
- package/dist/types/sdk/broker/spawn-authority.d.ts +8 -0
- package/dist/types/sdk/broker/startup-failure.d.ts +4 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +5 -1
- package/dist/types/sdk/prompt-deadline-flush.d.ts +2 -0
- package/dist/types/sdk/session.d.ts +3 -3
- package/dist/types/session/agent-session.d.ts +7 -2
- package/dist/types/task/types.d.ts +2 -0
- package/dist/types/tools/bash-interactive.d.ts +1 -0
- package/dist/types/tools/fetch.d.ts +10 -1
- package/dist/types/tools/subagent.d.ts +8 -1
- package/package.json +7 -7
- package/src/cli/public-command-registry.ts +8 -2
- package/src/cli/setup-cli.ts +1 -0
- package/src/cli/stats-cli.ts +11 -1
- package/src/config/autorouting-tier-map.ts +529 -3
- package/src/config/file-lock.ts +59 -14
- package/src/config/model-discovery-manager.ts +4 -4
- package/src/config/model-profile-activation.ts +83 -23
- package/src/config/model-registry.ts +72 -12
- package/src/config/model-resolver.ts +6 -1
- package/src/coordinator-mcp/question-state.ts +4 -1
- package/src/coordinator-mcp/server.ts +14 -6
- package/src/exec/bash-executor.ts +3 -0
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +46 -8
- package/src/gjc-runtime/state-writer.ts +317 -6
- package/src/harness-control-plane/control-endpoint.ts +24 -6
- package/src/harness-control-plane/finalize.ts +312 -25
- package/src/harness-control-plane/owner.ts +323 -89
- package/src/internal-urls/docs-index.generated.ts +6 -4
- package/src/main.ts +69 -19
- package/src/modes/acp/acp-agent.ts +581 -37
- package/src/modes/components/gjc-bundle-settings.ts +21 -1
- package/src/modes/components/tool-status-header.ts +72 -6
- package/src/modes/controllers/runtime-mcp-command-controller.ts +1 -1
- package/src/runtime-mcp/loader.ts +6 -3
- package/src/runtime-mcp/manager.ts +177 -75
- package/src/sdk/broker/broker.ts +1058 -150
- package/src/sdk/broker/ensure.ts +65 -8
- package/src/sdk/broker/identity.ts +13 -0
- package/src/sdk/broker/lifecycle-ledger.ts +16 -4
- package/src/sdk/broker/managed-task-dag.ts +1927 -0
- package/src/sdk/broker/managed-task-verification.ts +642 -0
- package/src/sdk/broker/spawn-authority.ts +140 -7
- package/src/sdk/broker/startup-failure.ts +80 -1
- package/src/sdk/broker/transport.ts +1 -0
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/index.ts +22 -6
- package/src/sdk/bus/telegram-daemon-contract.ts +5 -1
- package/src/sdk/cli/session-cli.ts +18 -0
- package/src/sdk/host/session-runtime.test.ts +46 -0
- package/src/sdk/host/session-runtime.ts +13 -6
- package/src/sdk/lifecycle/service.ts +2 -0
- package/src/sdk/prompt-deadline-flush.ts +26 -4
- package/src/sdk/session.ts +587 -115
- package/src/session/agent-session.ts +60 -14
- package/src/session/internal/managed-session-scope.ts +10 -0
- package/src/session/internal/managed-session-storage.ts +30 -1
- package/src/setup/provider-presets.json +2 -1
- package/src/slash-commands/builtin-registry.ts +1 -1
- package/src/task/executor.ts +46 -17
- package/src/task/types.ts +2 -0
- package/src/tools/bash-interactive.ts +2 -0
- package/src/tools/bash.ts +20 -0
- package/src/tools/fetch.ts +21 -5
- package/src/tools/subagent-render.ts +24 -1
- package/src/tools/subagent.ts +27 -1
- package/src/utils/mupdf.ts +11 -4
|
@@ -21,12 +21,14 @@ export type FileLockAcquireReason = "acquire_timeout" | "orphan_transition";
|
|
|
21
21
|
* generation); this records the cause that exhaustion must report.
|
|
22
22
|
*/
|
|
23
23
|
export interface FileLockStaleRemovalFailure {
|
|
24
|
-
/** Guarded-removal outcome
|
|
25
|
-
outcome: "cleanup_failed" | "error";
|
|
24
|
+
/** Guarded-removal outcome; refusals are surfaced only after exhaustion revalidates the dead generation. */
|
|
25
|
+
outcome: "cleanup_failed" | "owner_changed" | "missing" | "error";
|
|
26
26
|
/** Native/errno code carried by the refusal, when one was present. */
|
|
27
27
|
code?: string;
|
|
28
28
|
/** Human-readable cause surfaced to the operator at exhaustion. */
|
|
29
29
|
message: string;
|
|
30
|
+
/** Platform-specific manual cleanup command, set only when the same dead owner persists at exhaustion. */
|
|
31
|
+
manualCleanupCommand?: string;
|
|
30
32
|
}
|
|
31
33
|
export declare class FileLockAcquireError extends Error {
|
|
32
34
|
readonly filePath: string;
|
|
@@ -9,7 +9,7 @@ import { ConfigError, ConfigFile } from "./config-file";
|
|
|
9
9
|
import { isAuthenticated, kNoAuth } from "./model-auth";
|
|
10
10
|
import { type ConfiguredModelBindings } from "./model-bindings-applier";
|
|
11
11
|
import { type ProviderDiscoveryState } from "./model-discovery-manager";
|
|
12
|
-
import { type ModelPresetRegistryDependencies } from "./model-preset-registry";
|
|
12
|
+
import { type ModelPresetRegistryDependencies, type ModelPresetRegistryRefreshResult } from "./model-preset-registry";
|
|
13
13
|
export type { ProviderDiscoveryState, ProviderDiscoveryStatus } from "./model-discovery-manager";
|
|
14
14
|
import { type CanonicalModelIndex, type CanonicalModelRecord, type CanonicalModelVariant, type ModelEquivalenceConfig } from "./model-equivalence";
|
|
15
15
|
import { type ModelProfileDefinition } from "./model-profiles";
|
|
@@ -376,6 +376,8 @@ export declare class ModelRegistry {
|
|
|
376
376
|
* Reload models from disk (embedded + accepted registry + custom from models.yml).
|
|
377
377
|
*/
|
|
378
378
|
refreshStatic(): Promise<void>;
|
|
379
|
+
/** Refresh the signed profile catalog online, then publish its accepted snapshot. */
|
|
380
|
+
refreshModelPresetProfilesFromRegistry(): Promise<ModelPresetRegistryRefreshResult>;
|
|
379
381
|
/**
|
|
380
382
|
* Reload models from disk and refresh runtime provider discovery state.
|
|
381
383
|
*/
|
|
@@ -41,7 +41,7 @@ export declare function resolveStartupModelRefreshSelectors(options: {
|
|
|
41
41
|
resume?: string | boolean;
|
|
42
42
|
hasStartupProfile: boolean;
|
|
43
43
|
}, settings: ModelRoleSettings): ModelSelectorValue | undefined;
|
|
44
|
-
export declare function refreshMissingQualifiedModelProviders(selectors: ModelSelectorValue | undefined, modelRegistry: Pick<ModelRegistry, "getAvailable" | "getRefreshableProviders" | "refreshProvider"
|
|
44
|
+
export declare function refreshMissingQualifiedModelProviders(selectors: ModelSelectorValue | undefined, modelRegistry: Pick<ModelRegistry, "getAvailable" | "getRefreshableProviders" | "refreshProvider">, credentialSessionId?: string): Promise<boolean>;
|
|
45
45
|
/**
|
|
46
46
|
* Format a model as "provider/modelId" string.
|
|
47
47
|
*/
|
|
@@ -68,6 +68,8 @@ export interface BashExecutorOptions {
|
|
|
68
68
|
sessionKey?: string;
|
|
69
69
|
/** Additional environment variables to inject */
|
|
70
70
|
env?: Record<string, string>;
|
|
71
|
+
/** Environment names to hide from this command's inherited environment. */
|
|
72
|
+
unsetEnv?: string[];
|
|
71
73
|
/** Artifact path/id for full output storage */
|
|
72
74
|
artifactPath?: string;
|
|
73
75
|
artifactId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CustomTool } from "../custom-tools/types";
|
|
2
2
|
import { type SessionQuarantine } from "./session-validation";
|
|
3
|
-
import type { GjcPluginScope, JsonSchema202012, NormalizedToolSurfaceV2 } from "./types";
|
|
3
|
+
import type { GjcBundleIdentity, GjcPluginScope, JsonSchema202012, NormalizedToolSurfaceV2 } from "./types";
|
|
4
4
|
export interface AlwaysOnPluginTools {
|
|
5
5
|
tools: CustomTool[];
|
|
6
6
|
quarantine: SessionQuarantine[];
|
|
@@ -9,6 +9,12 @@ export interface GjcPluginToolDeclaration extends NormalizedToolSurfaceV2 {
|
|
|
9
9
|
plugin: string;
|
|
10
10
|
scope: GjcPluginScope;
|
|
11
11
|
}
|
|
12
|
+
export interface GjcPluginMcpServerProvenance {
|
|
13
|
+
identity: GjcBundleIdentity;
|
|
14
|
+
surfaceId: string;
|
|
15
|
+
}
|
|
16
|
+
/** Bound and scrub plugin-controlled MCP causes before they enter logs or runtime findings. */
|
|
17
|
+
export declare function safePluginMcpDiagnostic(value: unknown): string;
|
|
12
18
|
/**
|
|
13
19
|
* Return v2 tool declarations without reading or importing implementation
|
|
14
20
|
* modules. This is the schema-serving path used by discovery and diagnostics.
|
|
@@ -69,11 +75,14 @@ export declare function renderSkillAdvertisement(input: {
|
|
|
69
75
|
* Convert active plugin-bundle MCP surfaces into runtime MCPServerConfig entries,
|
|
70
76
|
* applying install + runtime MCP policy (URL scheme/private-range deny, DNS
|
|
71
77
|
* re-resolution for http/sse, stdio root-confinement) before connection. Servers
|
|
72
|
-
* failing policy are quarantined and excluded.
|
|
78
|
+
* failing policy are quarantined and excluded. The provenance map contains
|
|
79
|
+
* only servers present in `configs`, so connection errors can be attributed to
|
|
80
|
+
* the authenticated bundle and stable surface that supplied each server.
|
|
73
81
|
*/
|
|
74
82
|
export declare function buildPluginMcpConfigs(input: {
|
|
75
83
|
cwd: string;
|
|
76
84
|
}): Promise<{
|
|
77
85
|
configs: Record<string, any>;
|
|
78
86
|
quarantine: SessionQuarantine[];
|
|
87
|
+
serverProvenance: ReadonlyMap<string, GjcPluginMcpServerProvenance>;
|
|
79
88
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Stats } from "node:fs";
|
|
2
2
|
import { type FileLockOptions } from "../config/file-lock";
|
|
3
3
|
import type { SkillActiveEntry } from "../skill-state/active-state";
|
|
4
4
|
import { type AuditEntry, type CanonicalGjcWorkflowSkill, type WorkflowStateMutationOwner } from "../skill-state/workflow-state-contract";
|
|
@@ -82,6 +82,14 @@ export interface GuardedStateWriteReceipt {
|
|
|
82
82
|
export declare function guardedStateWriteReceipt(result: GuardedWriteResult): GuardedStateWriteReceipt | undefined;
|
|
83
83
|
export interface StateWriterOptions {
|
|
84
84
|
cwd?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Linux-only private durable source publication. The supplied directory is
|
|
87
|
+
* the exact private subtree containing the target; existing paths are never
|
|
88
|
+
* chmodded or repaired.
|
|
89
|
+
*/
|
|
90
|
+
privateDurable?: {
|
|
91
|
+
directory: string;
|
|
92
|
+
};
|
|
85
93
|
receipt?: StateWriterReceiptContext;
|
|
86
94
|
audit?: StateWriterAuditContext;
|
|
87
95
|
sourceRevision?: number;
|
|
@@ -108,6 +116,11 @@ export declare class StateWriteConflictError extends Error {
|
|
|
108
116
|
export interface DeleteIfOwnedOptions extends StateWriterOptions {
|
|
109
117
|
predicate?: (current: unknown) => boolean | Promise<boolean>;
|
|
110
118
|
}
|
|
119
|
+
export declare class StatePublicationUncertainError extends Error {
|
|
120
|
+
readonly path: string;
|
|
121
|
+
readonly cause: unknown;
|
|
122
|
+
constructor(path: string, cause: unknown);
|
|
123
|
+
}
|
|
111
124
|
export interface DeleteResult {
|
|
112
125
|
path: string;
|
|
113
126
|
deleted: boolean;
|
|
@@ -13,7 +13,10 @@ export interface EndpointRequest {
|
|
|
13
13
|
verb: string;
|
|
14
14
|
input: Record<string, unknown>;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export interface EndpointHandlerRequest extends EndpointRequest {
|
|
17
|
+
signal: AbortSignal;
|
|
18
|
+
}
|
|
19
|
+
export type EndpointHandler = (req: EndpointHandlerRequest) => Promise<unknown>;
|
|
17
20
|
export declare class ControlServer {
|
|
18
21
|
#private;
|
|
19
22
|
readonly socketPath: string;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { type LinuxProcPidProbeResult } from "../gjc-runtime/linux-proc";
|
|
2
|
+
import { type ReceiptEnvelope } from "./receipts";
|
|
3
|
+
import { type ReceiptIndexEntry } from "./storage";
|
|
1
4
|
import { type ReviewVerdict } from "./types";
|
|
2
5
|
export interface ValidationCommandSpec {
|
|
3
6
|
name: string;
|
|
@@ -9,14 +12,21 @@ export interface ValidationRun {
|
|
|
9
12
|
exitStatus: number;
|
|
10
13
|
pass: boolean;
|
|
11
14
|
}
|
|
15
|
+
export declare class ValidationObservationUncertainError extends Error {
|
|
16
|
+
readonly exactCommand: string;
|
|
17
|
+
readonly cwd: string;
|
|
18
|
+
constructor(exactCommand: string, cwd: string, cause?: unknown);
|
|
19
|
+
}
|
|
12
20
|
export interface FinalizeChecks {
|
|
13
|
-
runValidation(spec: ValidationCommandSpec): Promise<ValidationRun>;
|
|
21
|
+
runValidation(spec: ValidationCommandSpec, signal?: AbortSignal): Promise<ValidationRun>;
|
|
14
22
|
resolveCommit(): Promise<string | null>;
|
|
15
23
|
commitOnBranch(commit: string, branch: string): Promise<boolean>;
|
|
16
24
|
prOrIssue(): Promise<{
|
|
17
25
|
prUrl: string | null;
|
|
18
26
|
issueArtifact: string | null;
|
|
19
27
|
}>;
|
|
28
|
+
/** Owner-scoped receipt commit hook; null means lifecycle authority was withdrawn. */
|
|
29
|
+
writeReceipt?(family: "validation" | "completion" | "review-failure" | "review-verdict", receipt: ReceiptEnvelope<unknown>): Promise<ReceiptIndexEntry | null>;
|
|
20
30
|
}
|
|
21
31
|
export interface FinalizeOptions {
|
|
22
32
|
root: string;
|
|
@@ -39,6 +49,8 @@ export interface FinalizeOptions {
|
|
|
39
49
|
prTarget?: string | null;
|
|
40
50
|
validationCommands?: ValidationCommandSpec[];
|
|
41
51
|
checks: FinalizeChecks;
|
|
52
|
+
/** Cancels an in-flight validation subprocess when its owning request is withdrawn. */
|
|
53
|
+
signal?: AbortSignal;
|
|
42
54
|
clock?: () => number;
|
|
43
55
|
}
|
|
44
56
|
export interface FinalizeResult {
|
|
@@ -56,5 +68,4 @@ export interface FinalizeResult {
|
|
|
56
68
|
blockers: string[];
|
|
57
69
|
}
|
|
58
70
|
export declare function runFinalize(opts: FinalizeOptions): Promise<FinalizeResult>;
|
|
59
|
-
|
|
60
|
-
export declare function defaultFinalizeChecks(workspace: string): FinalizeChecks;
|
|
71
|
+
export declare function defaultFinalizeChecks(workspace: string, probeProcess?: (pid: number) => LinuxProcPidProbeResult): FinalizeChecks;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ type StartupModelProfileArgs = {
|
|
|
58
58
|
session: AgentSession;
|
|
59
59
|
settings: Settings;
|
|
60
60
|
modelRegistry: ModelRegistry;
|
|
61
|
-
parsedArgs: Pick<Args, "default" | "model" | "mpreset" | "thinking">;
|
|
61
|
+
parsedArgs: Pick<Args, "continue" | "default" | "fork" | "model" | "mpreset" | "resume" | "thinking">;
|
|
62
62
|
startupModel?: CreateAgentSessionOptions["model"];
|
|
63
63
|
startupThinkingLevel?: CreateAgentSessionOptions["thinkingLevel"];
|
|
64
64
|
preferCachedModels?: boolean;
|
|
@@ -2,6 +2,7 @@ import type { LoadedCustomTool } from "../extensibility/custom-tools/types";
|
|
|
2
2
|
import { AgentStorage } from "../session/agent-storage";
|
|
3
3
|
import type { AuthStorage } from "../session/auth-storage";
|
|
4
4
|
import { MCPManager } from "./manager";
|
|
5
|
+
import { MCPToolCache } from "./tool-cache";
|
|
5
6
|
/** Result from loading MCP tools */
|
|
6
7
|
export interface MCPToolsLoadResult {
|
|
7
8
|
/** MCP manager (for lifecycle management) */
|
|
@@ -37,6 +38,7 @@ export interface MCPToolsLoadOptions {
|
|
|
37
38
|
/** Idle retention for shared MCP pool entries. */
|
|
38
39
|
sharedPoolIdleMs?: number;
|
|
39
40
|
}
|
|
41
|
+
export declare function resolveMCPToolCache(storage?: AgentStorage | null, dbPath?: string): Promise<MCPToolCache | null>;
|
|
40
42
|
/**
|
|
41
43
|
* Discover and load MCP tools from .mcp.json files.
|
|
42
44
|
*
|
|
@@ -98,10 +98,10 @@ export interface MCPManagerOptions {
|
|
|
98
98
|
/** Restrict this instance to tools from an explicit MCP config. */
|
|
99
99
|
toolsOnly?: boolean;
|
|
100
100
|
/**
|
|
101
|
-
* Ceiling for the startup wait, in milliseconds.
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
101
|
+
* Ceiling for the startup wait, in milliseconds. ACP lifecycle launches and
|
|
102
|
+
* plugin MCP startup use bounded caller-owned budgets; other consumers keep
|
|
103
|
+
* the short default. Non-positive or non-finite values are ignored and the
|
|
104
|
+
* default applies.
|
|
105
105
|
*/
|
|
106
106
|
maxStartupTimeoutMs?: number;
|
|
107
107
|
/** Connection pool used for every physical MCP open/close. */
|
|
@@ -110,6 +110,8 @@ export interface MCPManagerOptions {
|
|
|
110
110
|
sessionId?: string;
|
|
111
111
|
/** Idle retention for shared pool entries. */
|
|
112
112
|
sharedPoolIdleMs?: number;
|
|
113
|
+
/** Limit tool-cache reads and writes to this manager's conventional servers. */
|
|
114
|
+
toolCacheServerNames?: ReadonlySet<string>;
|
|
113
115
|
/** Test seam for deterministic reconnect backoff scheduling. */
|
|
114
116
|
sleep?: (milliseconds: number, signal?: AbortSignal) => Promise<void>;
|
|
115
117
|
/** Test seam for fencing the acquisition-to-registration replacement race. */
|
|
@@ -157,7 +159,10 @@ export declare class MCPManager {
|
|
|
157
159
|
static setInstance(value: MCPManager | undefined): void;
|
|
158
160
|
/** Reset the process-global instance. Test-only. */
|
|
159
161
|
static resetForTests(): void;
|
|
162
|
+
/** Block config mutations and reloads while keeping existing servers reconnectable. */
|
|
163
|
+
freezeConnectionSet(): void;
|
|
160
164
|
sealConnectionSet(): void;
|
|
165
|
+
isConnectionSetMutationBlocked(): boolean;
|
|
161
166
|
isConnectionSetSealed(): boolean;
|
|
162
167
|
constructor(cwd: string, toolCache?: MCPToolCache | null, options?: MCPManagerOptions);
|
|
163
168
|
isToolsOnly(): boolean;
|
|
@@ -166,9 +171,11 @@ export declare class MCPManager {
|
|
|
166
171
|
*/
|
|
167
172
|
setOnNotification(handler: (serverName: string, method: string, params: unknown) => void): void;
|
|
168
173
|
/**
|
|
169
|
-
* Set a callback to
|
|
174
|
+
* Set a callback to receive a read-only catalog snapshot when server tools change.
|
|
170
175
|
*/
|
|
171
|
-
setOnToolsChanged(handler: (tools: CustomTool<TSchema, MCPToolDetails
|
|
176
|
+
setOnToolsChanged(handler: (tools: readonly Readonly<CustomTool<TSchema, MCPToolDetails>>[]) => void): void;
|
|
177
|
+
/** Subscribe to readonly catalog snapshots without replacing the manager owner's callback. */
|
|
178
|
+
subscribeToToolsChanged(handler: (tools: readonly Readonly<CustomTool<TSchema, MCPToolDetails>>[]) => void): () => void;
|
|
172
179
|
/**
|
|
173
180
|
* Set a callback to fire when any server's resources change.
|
|
174
181
|
*/
|
|
@@ -94,7 +94,7 @@ export type BrokerCleanupEvidence = {
|
|
|
94
94
|
dev: string;
|
|
95
95
|
ino: string;
|
|
96
96
|
};
|
|
97
|
-
/** Identity-bound lifecycle
|
|
97
|
+
/** Identity-bound lifecycle metadataker retained when exact cleanup is deferred. */
|
|
98
98
|
metadataIdentity?: BrokerCleanupIdentity;
|
|
99
99
|
metadataPath?: string;
|
|
100
100
|
/** Monotonic append-only cleanup attempt. */
|
|
@@ -129,7 +129,7 @@ export type BrokerCleanupEvidence = {
|
|
|
129
129
|
dev: string;
|
|
130
130
|
ino: string;
|
|
131
131
|
};
|
|
132
|
-
/** Delete metadata receipts authorize only the
|
|
132
|
+
/** Delete metadata receipts authorize only the canonicalker/ready sibling pair. */
|
|
133
133
|
lifecycleDeleteMetadata?: true;
|
|
134
134
|
};
|
|
135
135
|
export type BrokerResponse = {
|
|
@@ -379,6 +379,8 @@ export declare function setAmbiguityGraceForTest(broker: Broker, graceMs: number
|
|
|
379
379
|
export declare function setLockArtifactGraceForTest(broker: Broker, graceMs: number | undefined): void;
|
|
380
380
|
/** Test-only hook for shortening the bounded liveness deadline. */
|
|
381
381
|
export declare function setLivenessGraceForTest(broker: Broker, graceMs: number | undefined): void;
|
|
382
|
+
/** Test-only hook for shortening the bounded wait before a deferred managed close is queued. */
|
|
383
|
+
export declare function setManagedCloseWaitForTest(broker: Broker, waitMs: number | undefined): void;
|
|
382
384
|
/**
|
|
383
385
|
* Test-only hook for stalling the heartbeat write, reproducing a publication tick
|
|
384
386
|
* whose awaited IO does not settle. Clearing it releases the stalled tick the way
|
|
@@ -3,6 +3,7 @@ import type { FileHandle } from "node:fs/promises";
|
|
|
3
3
|
import { type FileLockOptions } from "../../config/file-lock";
|
|
4
4
|
import { type BrokerDiscovery } from "./discovery";
|
|
5
5
|
import { type SdkInternalSpawnCommand } from "./runtime";
|
|
6
|
+
import { type BrokerStartupFailureMarker } from "./startup-failure";
|
|
6
7
|
export declare function isBrokerGenerationCompatible(discovery: BrokerDiscovery | null): boolean;
|
|
7
8
|
/**
|
|
8
9
|
* A live incumbent stops being reusable once the runtime image it launches
|
|
@@ -173,4 +174,6 @@ export declare function reapSpawnedBrokerForTest(child: ChildProcess, timing?: R
|
|
|
173
174
|
export declare function brokerSpawnEnvironmentForTest(command: SdkInternalSpawnCommand, override?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
174
175
|
/** Test hook: installs an exact controllable owner to exercise replacement fencing. */
|
|
175
176
|
export declare function registerBrokerOwnerForTest(agentDir: string, child: ChildProcess, timing?: ReapTiming): BrokerOwner;
|
|
177
|
+
/** Test hook: exercises the same trusted-marker reason reconstruction used by ensureBroker. */
|
|
178
|
+
export declare function brokerStartupFailureReasonForTest(marker: BrokerStartupFailureMarker | undefined): string;
|
|
176
179
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare function brokerIdentityPath(agentDir: string): string;
|
|
2
2
|
export declare function getBrokerIdentityKey(agentDir: string): Promise<string>;
|
|
3
3
|
export declare function deriveIdempotencyIdentity(agentDir: string, operation: string, callerKey: string, targetHash?: string): Promise<string>;
|
|
4
|
+
/** Native identity for an idempotency key reserved inside one managed control root. */
|
|
5
|
+
export declare function deriveScopedIdempotencyIdentity(agentDir: string, operation: string, callerKey: string, scope: string): Promise<string>;
|
|
4
6
|
/** Identity format used by lifecycle rows written before target binding. */
|
|
5
7
|
export declare function deriveLegacyIdentity(agentDir: string, operation: string, callerKey: string): Promise<string>;
|
|
6
8
|
export declare function deriveLegacyTargetIdentity(agentDir: string, operation: string, callerKey: string, canonicalTargetHash: string): Promise<string>;
|
|
@@ -142,11 +142,19 @@ export declare class LifecycleLedger {
|
|
|
142
142
|
findByOperationKey(operationKey: string, fingerprint?: string): LifecycleLedgerEntry | undefined;
|
|
143
143
|
findAnyByOperationKey(operationKey: string): LifecycleLedgerEntry | undefined;
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* Live or uncertain legacy rows predate the operation/key index. Their opaque
|
|
146
146
|
* identities cannot establish that a different target is safe, so callers
|
|
147
|
-
* must reject rather than create a second admission.
|
|
147
|
+
* must reject rather than create a second admission. A fresh session.create
|
|
148
|
+
* may ignore completed terminal legacy rows so old successful operations do
|
|
149
|
+
* not block coordinator startup. Other operations retain the legacy fence
|
|
150
|
+
* because target-bound legacy identities cannot prove key uniqueness. For
|
|
151
|
+
* target-bound terminal creates, the opaque legacy identity also cannot reveal
|
|
152
|
+
* the original caller key, so this exception retires that legacy key history;
|
|
153
|
+
* exact key-only legacy creates are still rejected by the earlier lookup.
|
|
148
154
|
*/
|
|
149
|
-
hasLegacyIdentity(excludedIdentities?: ReadonlySet<string
|
|
155
|
+
hasLegacyIdentity(excludedIdentities?: ReadonlySet<string>, options?: {
|
|
156
|
+
ignoreTerminalRows?: boolean;
|
|
157
|
+
}): boolean;
|
|
150
158
|
migrateIdentity(from: string, to: string, metadata: {
|
|
151
159
|
operationKey: string;
|
|
152
160
|
fingerprint: string;
|