@mnemom/mnemom 0.17.34-next.1 → 0.17.34-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-url-proxy.mjs +18 -4
- package/dist/commands/agent-config.js +5 -1
- package/dist/commands/agent-doctor.d.ts +9 -0
- package/dist/commands/agent-doctor.js +4 -0
- package/dist/commands/agent-session.d.ts +1 -2
- package/dist/commands/agent-session.js +1 -2
- package/dist/commands/agent-setup.d.ts +6 -0
- package/dist/commands/agent-setup.js +12 -1
- package/dist/commands/agent.d.ts +11 -0
- package/dist/commands/agent.js +145 -46
- package/dist/commands/durable-doctor.d.ts +50 -0
- package/dist/commands/durable-doctor.js +186 -0
- package/dist/commands/durable-lock.d.ts +254 -0
- package/dist/commands/durable-lock.js +595 -0
- package/dist/commands/durable-sessions.d.ts +87 -0
- package/dist/commands/durable-sessions.js +303 -0
- package/dist/commands/durable-verbs.d.ts +116 -0
- package/dist/commands/durable-verbs.js +393 -0
- package/dist/durable/flock.d.ts +26 -0
- package/dist/durable/flock.js +80 -0
- package/dist/durable/launch-spec.d.ts +7 -1
- package/dist/durable/launch-spec.js +10 -3
- package/dist/durable/seat-proxy-entry.d.ts +11 -0
- package/dist/durable/seat-proxy-entry.js +25 -0
- package/dist/durable/seat-proxy.d.ts +107 -0
- package/dist/durable/seat-proxy.js +599 -0
- package/dist/durable/seat-socket.d.ts +46 -0
- package/dist/durable/seat-socket.js +179 -0
- package/dist/durable/seat-spec-validator.d.ts +28 -0
- package/dist/durable/seat-spec-validator.js +59 -0
- package/dist/durable/test-mode.mjs +81 -0
- package/dist/durable/turn-chain.d.ts +55 -0
- package/dist/durable/turn-chain.js +178 -0
- package/dist/host/auto-continue.d.ts +67 -0
- package/dist/host/auto-continue.js +118 -0
- package/dist/host/bootid.d.ts +13 -0
- package/dist/host/bootid.js +41 -0
- package/dist/host/client.d.ts +123 -0
- package/dist/host/client.js +171 -0
- package/dist/host/commands.d.ts +2 -0
- package/dist/host/commands.js +122 -0
- package/dist/host/control.d.ts +33 -0
- package/dist/host/control.js +144 -0
- package/dist/host/daemon.d.ts +217 -0
- package/dist/host/daemon.js +606 -0
- package/dist/host/gate.d.ts +46 -0
- package/dist/host/gate.js +82 -0
- package/dist/host/grant.d.ts +24 -0
- package/dist/host/grant.js +24 -0
- package/dist/host/instance.d.ts +35 -0
- package/dist/host/instance.js +62 -0
- package/dist/host/integrity.d.ts +35 -0
- package/dist/host/integrity.js +115 -0
- package/dist/host/launchd.d.ts +16 -0
- package/dist/host/launchd.js +45 -0
- package/dist/host/lock.d.ts +20 -0
- package/dist/host/lock.js +63 -0
- package/dist/host/owner.d.ts +55 -0
- package/dist/host/owner.js +121 -0
- package/dist/host/plist.d.ts +16 -0
- package/dist/host/plist.js +85 -0
- package/dist/host/procs.d.ts +27 -0
- package/dist/host/procs.js +105 -0
- package/dist/host/run.d.ts +66 -0
- package/dist/host/run.js +314 -0
- package/dist/host/runtime.d.ts +8 -0
- package/dist/host/runtime.js +22 -0
- package/dist/host/s1-names.d.ts +22 -0
- package/dist/host/s1-names.js +21 -0
- package/dist/host/seat-credential.d.ts +27 -0
- package/dist/host/seat-credential.js +41 -0
- package/dist/host/seat-launch-main.d.ts +1 -0
- package/dist/host/seat-launch-main.js +59 -0
- package/dist/host/seat-launch.d.ts +116 -0
- package/dist/host/seat-launch.js +302 -0
- package/dist/host/seat.d.ts +48 -0
- package/dist/host/seat.js +149 -0
- package/dist/host/state.d.ts +33 -0
- package/dist/host/state.js +117 -0
- package/dist/host/status.d.ts +101 -0
- package/dist/host/status.js +307 -0
- package/dist/host/tmux.d.ts +56 -0
- package/dist/host/tmux.js +182 -0
- package/dist/host/transcript.d.ts +30 -0
- package/dist/host/transcript.js +130 -0
- package/dist/host/verbs.d.ts +50 -0
- package/dist/host/verbs.js +271 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +197 -35
- package/dist/lib/agent.d.ts +8 -26
- package/dist/lib/agent.js +11 -26
- package/dist/lib/claude-plugin.d.ts +11 -2
- package/dist/lib/claude-plugin.js +10 -1
- package/dist/lib/durable/api.d.ts +136 -0
- package/dist/lib/durable/api.js +220 -0
- package/dist/lib/durable/codes.d.ts +8 -0
- package/dist/lib/durable/codes.js +2 -0
- package/dist/lib/durable/first-turn.d.ts +50 -0
- package/dist/lib/durable/first-turn.js +102 -0
- package/dist/lib/durable/gate.d.ts +48 -0
- package/dist/lib/durable/gate.js +122 -0
- package/dist/lib/durable/handover.d.ts +101 -0
- package/dist/lib/durable/handover.js +175 -0
- package/dist/lib/durable/launch.d.ts +182 -0
- package/dist/lib/durable/launch.js +443 -0
- package/dist/lib/durable/launching.d.ts +15 -0
- package/dist/lib/durable/launching.js +70 -0
- package/dist/lib/durable/live.d.ts +194 -0
- package/dist/lib/durable/live.js +635 -0
- package/dist/lib/durable/refusal.d.ts +57 -0
- package/dist/lib/durable/refusal.js +78 -0
- package/dist/lib/durable/view.d.ts +83 -0
- package/dist/lib/durable/view.js +244 -0
- package/dist/lib/experimental.d.ts +0 -9
- package/dist/lib/experimental.js +18 -17
- package/dist/lib/launcher-config.d.ts +7 -0
- package/dist/lib/launcher-config.js +21 -0
- package/dist/lib/scan/report-email.d.ts +1 -1
- package/dist/lib/scan/report-email.js +9 -1
- package/dist/lib/subscription-login.d.ts +15 -0
- package/dist/lib/subscription-login.js +28 -1
- package/dist/vendor/durable-contract/index.js +240 -18
- package/dist/vendor/shared/durable-contract/admission.d.ts +240 -0
- package/dist/vendor/shared/durable-contract/admission.js +533 -0
- package/dist/vendor/shared/durable-contract/arm.d.ts +51 -0
- package/dist/vendor/shared/durable-contract/arm.js +133 -0
- package/dist/vendor/shared/durable-contract/canonical.d.ts +29 -0
- package/dist/vendor/shared/durable-contract/canonical.js +98 -0
- package/dist/vendor/shared/durable-contract/cell-id.d.ts +22 -0
- package/dist/vendor/shared/durable-contract/cell-id.js +38 -0
- package/dist/vendor/shared/durable-contract/cli-output.d.ts +342 -0
- package/dist/vendor/shared/durable-contract/cli-output.js +201 -0
- package/dist/vendor/shared/durable-contract/cli-surface.d.ts +119 -0
- package/dist/vendor/shared/durable-contract/cli-surface.js +270 -0
- package/dist/vendor/shared/durable-contract/codes.d.ts +537 -0
- package/dist/vendor/shared/durable-contract/codes.js +475 -0
- package/dist/vendor/shared/durable-contract/constants.d.ts +153 -0
- package/dist/vendor/shared/durable-contract/constants.js +179 -0
- package/dist/vendor/shared/durable-contract/doors.d.ts +119 -0
- package/dist/vendor/shared/durable-contract/doors.js +249 -0
- package/dist/vendor/shared/durable-contract/envelope.d.ts +103 -0
- package/dist/vendor/shared/durable-contract/envelope.js +317 -0
- package/dist/vendor/shared/durable-contract/events.d.ts +147 -0
- package/dist/vendor/shared/durable-contract/events.js +630 -0
- package/dist/vendor/shared/durable-contract/executor-state.d.ts +41 -0
- package/dist/vendor/shared/durable-contract/executor-state.js +32 -0
- package/dist/vendor/shared/durable-contract/fixlines.d.ts +318 -0
- package/dist/vendor/shared/durable-contract/fixlines.js +483 -0
- package/dist/vendor/shared/durable-contract/freeze-record.d.ts +787 -0
- package/dist/vendor/shared/durable-contract/freeze-record.js +361 -0
- package/dist/vendor/shared/durable-contract/index.d.ts +36 -0
- package/dist/vendor/shared/durable-contract/index.js +37 -0
- package/dist/vendor/shared/durable-contract/journal-approvals.d.ts +29 -0
- package/dist/vendor/shared/durable-contract/journal-approvals.js +60 -0
- package/dist/vendor/shared/durable-contract/keys.d.ts +24 -0
- package/dist/vendor/shared/durable-contract/keys.js +66 -0
- package/dist/vendor/shared/durable-contract/lock.d.ts +128 -0
- package/dist/vendor/shared/durable-contract/lock.js +151 -0
- package/dist/vendor/shared/durable-contract/names.d.ts +25 -0
- package/dist/vendor/shared/durable-contract/names.js +78 -0
- package/dist/vendor/shared/durable-contract/owner-verbs.d.ts +175 -0
- package/dist/vendor/shared/durable-contract/owner-verbs.js +403 -0
- package/dist/vendor/shared/durable-contract/paths.d.ts +23 -0
- package/dist/vendor/shared/durable-contract/paths.js +35 -0
- package/dist/vendor/shared/durable-contract/pure-fn.d.ts +48 -0
- package/dist/vendor/shared/durable-contract/pure-fn.js +89 -0
- package/dist/vendor/shared/durable-contract/routes.d.ts +205 -0
- package/dist/vendor/shared/durable-contract/routes.js +315 -0
- package/dist/vendor/shared/durable-contract/schema.d.ts +126 -0
- package/dist/vendor/shared/durable-contract/schema.js +441 -0
- package/dist/vendor/shared/durable-contract/seal.d.ts +54 -0
- package/dist/vendor/shared/durable-contract/seal.js +99 -0
- package/dist/vendor/shared/durable-contract/secret-scope.d.ts +28 -0
- package/dist/vendor/shared/durable-contract/secret-scope.js +76 -0
- package/dist/vendor/shared/durable-contract/session-id.d.ts +21 -0
- package/dist/vendor/shared/durable-contract/session-id.js +58 -0
- package/dist/vendor/shared/durable-contract/spec.d.ts +162 -0
- package/dist/vendor/shared/durable-contract/spec.js +286 -0
- package/dist/vendor/shared/durable-contract/states.d.ts +96 -0
- package/dist/vendor/shared/durable-contract/states.js +218 -0
- package/dist/vendor/shared/durable-contract/telemetry.d.ts +94 -0
- package/dist/vendor/shared/durable-contract/telemetry.js +180 -0
- package/dist/vendor/shared/durable-contract/test-mode.d.ts +62 -0
- package/dist/vendor/shared/durable-contract/test-mode.js +140 -0
- package/dist/vendor/shared/durable-contract/turn.d.ts +57 -0
- package/dist/vendor/shared/durable-contract/turn.js +81 -0
- package/dist/vendor/shared/durable-contract/vectors.d.ts +191 -0
- package/dist/vendor/shared/durable-contract/vectors.js +208 -0
- package/package.json +3 -2
- package/plugins/integrity-manifest.json +35 -0
- package/plugins/mnemom/hooks/hooks.json +15 -1
- package/plugins/mnemom/hooks/register.tsx +60 -2
- package/plugins/mnemom/hooks/seat-hello.mjs +116 -0
- package/dist/commands/agent-implicit-notice.d.ts +0 -31
- package/dist/commands/agent-implicit-notice.js +0 -73
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live wiring of the durable verbs: real fetch, the stored login (JWT) or the personal org
|
|
3
|
+
* MNEMOM_API_KEY, the active org, launcher.toml's `durable` key, the process table. Thin by design:
|
|
4
|
+
* every decision lives in the injected modules and is unit-tested there.
|
|
5
|
+
*/
|
|
6
|
+
import { type LauncherConfig } from "../launcher-config.js";
|
|
7
|
+
import { type ProcDeps } from "../../durable/proc.js";
|
|
8
|
+
import type { LauncherKey } from "../../vendor/shared/durable-contract/fixlines.js";
|
|
9
|
+
import type { DurableVerbDeps } from "../../commands/durable-verbs.js";
|
|
10
|
+
import type { SessionsReadDeps } from "../../commands/durable-sessions.js";
|
|
11
|
+
import { type DoctorLine } from "../../commands/durable-doctor.js";
|
|
12
|
+
import { type OriginalLaunch, type LockDeps, type LockOutcome } from "../../commands/durable-lock.js";
|
|
13
|
+
import { DurableApi, type RegistryRow } from "./api.js";
|
|
14
|
+
import { type DurableLaunchPlan, type PlanDeps, type RegistryReads, type SeatDeps } from "./launch.js";
|
|
15
|
+
import { type HandoverDeps } from "./handover.js";
|
|
16
|
+
import { type HostInstance } from "../../host/instance.js";
|
|
17
|
+
import { type OwnerHttp } from "../../host/owner.js";
|
|
18
|
+
import { type FirstTurnLock } from "./first-turn.js";
|
|
19
|
+
import type { HomeFacts } from "./view.js";
|
|
20
|
+
export declare function liveDurableApi(): DurableApi;
|
|
21
|
+
/** launcher.toml `durable`, defaulting to off (only read while the gate is on); unreadable is off. */
|
|
22
|
+
export declare function liveLauncherKey(load?: () => {
|
|
23
|
+
durable?: LauncherKey;
|
|
24
|
+
}): LauncherKey;
|
|
25
|
+
/** PIDs of local claude processes whose argv names `ccSessionId` (pure over a `ps` listing). */
|
|
26
|
+
export declare function claudePidsFor(psOutput: string, ccSessionId: string, selfPid: number): number[];
|
|
27
|
+
export declare function liveVerbDeps(): DurableVerbDeps;
|
|
28
|
+
export declare function liveSessionsReadDeps(): SessionsReadDeps;
|
|
29
|
+
export declare function liveLockDeps(): LockDeps;
|
|
30
|
+
/** The live original's exact argv, its parent launcher's passthrough and its shape (C14-R13). */
|
|
31
|
+
export declare function liveReadOriginal(pid: number, deps?: ProcDeps): OriginalLaunch | null;
|
|
32
|
+
/** What the idle source's RC naming reads (live: the launcher config, the entitlement, the probe). */
|
|
33
|
+
export interface RcNamingIo {
|
|
34
|
+
env: NodeJS.ProcessEnv;
|
|
35
|
+
loadConfig: () => LauncherConfig;
|
|
36
|
+
entitlement: () => Promise<{
|
|
37
|
+
remote_control?: boolean;
|
|
38
|
+
} | null>;
|
|
39
|
+
capable: (env: NodeJS.ProcessEnv) => boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare const liveRcNamingIo: () => RcNamingIo;
|
|
42
|
+
/** The idle source's RC naming, as `mnemom agent <name>` would resolve it (fail-closed: false). */
|
|
43
|
+
export declare function liveRcNamed(io?: RcNamingIo): Promise<boolean>;
|
|
44
|
+
/** `mnemom agent doctor`'s durable lines (C02-R19), read through the live registry client. */
|
|
45
|
+
export declare function liveDoctorDurableLines(): Promise<DoctorLine[]>;
|
|
46
|
+
/** This machine's launch-ledger records, or null when the ledger is missing or unreadable. */
|
|
47
|
+
export declare function readLedgerRecords<T>(exists: () => boolean, read: () => T): T | null;
|
|
48
|
+
/** The live C02-R26 handover: the process table, real signals, and the registry row. */
|
|
49
|
+
export declare function liveHandoverDeps(api: Pick<DurableApi, "getSession">): HandoverDeps;
|
|
50
|
+
/**
|
|
51
|
+
* The lock verb's deps: the handover on, and EPIPE on stdout ignored (under `/mnemom lock` the
|
|
52
|
+
* parent may be gone by the time the lock line prints; C02-R26 step 7).
|
|
53
|
+
*/
|
|
54
|
+
export declare function liveLockVerbDeps(): LockDeps;
|
|
55
|
+
/**
|
|
56
|
+
* C02-R26 step 7 for the launcher: its tracked child ended. When a handover locked the session,
|
|
57
|
+
* restore the terminal mode saved before the spawn (`stty -g`), print the lock line and attach;
|
|
58
|
+
* the exit status, or null to exit with the child's status as today.
|
|
59
|
+
*/
|
|
60
|
+
export declare function liveParentAfterChildEnded(row: RegistryRow, name: string, launcherKey: LauncherKey, savedTty: string | null): Promise<number | null>;
|
|
61
|
+
/** The terminal mode (`stty -g`) before claude starts, or null off a TTY. */
|
|
62
|
+
export declare function saveTtyMode(): string | null;
|
|
63
|
+
/** Run this CLI (`node <bin> ...args`) and capture its exit status and stdout. */
|
|
64
|
+
export type CliRunner = (bin: string, args: string[]) => {
|
|
65
|
+
status: number | null;
|
|
66
|
+
stdout: unknown;
|
|
67
|
+
};
|
|
68
|
+
/** `mnemom agent host status --json` (C2), or null when it is not available. */
|
|
69
|
+
export declare function readHostStatus(bin?: string | undefined, run?: CliRunner): Record<string, unknown> | null;
|
|
70
|
+
/**
|
|
71
|
+
* agents.agent_durable_only from an agent record (bare or under `agent`); null when the record
|
|
72
|
+
* carries no boolean flag. Absent is never read as false: the api once never served the field
|
|
73
|
+
* (a PostgREST computed field missed by `select=*`, mnemom-api #4263), and false skipped C02-R24.
|
|
74
|
+
*/
|
|
75
|
+
export declare function agentDurableOnlyOf(body: unknown): boolean | null;
|
|
76
|
+
/**
|
|
77
|
+
* agents.agent_durable_only of an agent (A2 serves it on the agent record). It fails closed
|
|
78
|
+
* (C02-R24): a record that cannot be read (transport, timeout, 5xx, any non-200) refuses with
|
|
79
|
+
* session_registry_unavailable before any spawn, so a durable-only agent never gets a tracked
|
|
80
|
+
* claude on an unreadable flag. A 200 without the field refuses the same way: absent is not false.
|
|
81
|
+
*/
|
|
82
|
+
export declare function readAgentDurableOnly(api: Pick<DurableApi, "getAgent">, agentId: string): Promise<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* This machine's label: the machine_label of its current executor in the owner executor list
|
|
85
|
+
* (exec_list), matched by the state file's executor id. Never the hostname: enrollment takes any
|
|
86
|
+
* --label. Null when not enrolled here, when the list can't be read, or when the row has no
|
|
87
|
+
* label; the unreachable-home rule then never applies (the home reads elsewhere).
|
|
88
|
+
*/
|
|
89
|
+
export declare function readLocalMachineLabel(localExecutorId: string | null, list: () => Promise<OwnerHttp>): Promise<string | null>;
|
|
90
|
+
/**
|
|
91
|
+
* The org this machine's executor is enrolled in (exec_list, matched by id), or null when the list
|
|
92
|
+
* can't be read or names no org for it. Read only to explain a durable_no_executor lock refusal.
|
|
93
|
+
*/
|
|
94
|
+
export declare function readExecutorOrg(executorId: string, list: () => Promise<OwnerHttp>): Promise<string | null>;
|
|
95
|
+
export declare function liveHomeFacts(): Promise<HomeFacts>;
|
|
96
|
+
/** The launcher's registry reads (entitlement, then the list by name) over one client. */
|
|
97
|
+
export declare function liveRegistryReads(api: DurableApi): RegistryReads;
|
|
98
|
+
export declare function livePlanDeps(servedAgentId: string, transcriptExists: (cc: string) => boolean, askYesNo: (q: string, d: boolean) => Promise<boolean>): PlanDeps;
|
|
99
|
+
/**
|
|
100
|
+
* A host daemon serves this machine when launchd has it loaded, or when one is running here
|
|
101
|
+
* outside launchd (`mnemom agent host run` in the foreground): status reports its pid only while
|
|
102
|
+
* that pid holds host.lock and wrote the runtime file.
|
|
103
|
+
*/
|
|
104
|
+
export declare function daemonPresent(status: Record<string, unknown> | null): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* The seat of a session from host status (C2). Status names its host by the launchd label
|
|
107
|
+
* (`instance`); a status for another host is never attached to. The socket is this host's tmux
|
|
108
|
+
* socket, resolved from the environment as the daemon resolves it (host/instance.ts), never the
|
|
109
|
+
* label: the two differ on every host. The target is the seat's tmux session, named as the daemon
|
|
110
|
+
* names it from the session and spawn ids (host/tmux.ts seatTmuxSession).
|
|
111
|
+
*/
|
|
112
|
+
export declare function seatOf(status: Record<string, unknown> | null, row: RegistryRow, instance: HostInstance): {
|
|
113
|
+
socket: string;
|
|
114
|
+
target: string;
|
|
115
|
+
} | null;
|
|
116
|
+
/** tmux's argv to attach a seat. */
|
|
117
|
+
export declare function seatAttachArgv(seat: {
|
|
118
|
+
socket: string;
|
|
119
|
+
target: string;
|
|
120
|
+
}): string[];
|
|
121
|
+
/** The host instance this CLI talks to, or null when its env names an invalid one. */
|
|
122
|
+
export declare function envInstance(env?: Readonly<Record<string, string | undefined>>): HostInstance | null;
|
|
123
|
+
/** The seat to attach to: none when the env names no valid instance (status is then never read). */
|
|
124
|
+
export declare function seatIn(row: RegistryRow, instance: HostInstance | null, status: () => Record<string, unknown> | null): {
|
|
125
|
+
socket: string;
|
|
126
|
+
target: string;
|
|
127
|
+
} | null;
|
|
128
|
+
/**
|
|
129
|
+
* Attach the terminal to a seat with tmux and return tmux's exit status; a tmux ended by a signal
|
|
130
|
+
* (no status) is a failed attach, 1.
|
|
131
|
+
*/
|
|
132
|
+
export declare function attachSeat(seat: {
|
|
133
|
+
socket: string;
|
|
134
|
+
target: string;
|
|
135
|
+
}, run: (cmd: string, argv: string[], opts: {
|
|
136
|
+
stdio: "inherit";
|
|
137
|
+
}) => {
|
|
138
|
+
status: number | null;
|
|
139
|
+
}): number;
|
|
140
|
+
export declare function liveSeatDeps(launcherKey: LauncherKey): SeatDeps;
|
|
141
|
+
export interface RegisterDeps {
|
|
142
|
+
api: Pick<DurableApi, "createSession">;
|
|
143
|
+
cwd: () => string;
|
|
144
|
+
}
|
|
145
|
+
/** Register a new session (POST create) or return the continued row; a refusal is thrown. */
|
|
146
|
+
export declare function registerDurableSession(plan: Extract<DurableLaunchPlan, {
|
|
147
|
+
kind: "spawn";
|
|
148
|
+
}>, name: string, agentId: string, deps?: RegisterDeps): Promise<RegistryRow>;
|
|
149
|
+
/**
|
|
150
|
+
* C02-R23 (c)/(e): lock instead of spawning. The exit status when locked (attach or the non-TTY
|
|
151
|
+
* line), or null when the lock refused (refusal and fix printed; the caller spawns tracked).
|
|
152
|
+
*/
|
|
153
|
+
export interface LockInsteadDeps {
|
|
154
|
+
/** The idle-source lock of the row (durable-lock.ts lockResolvedRow over `lockDeps`). */
|
|
155
|
+
lockRow: (row: RegistryRow, name: string, deps: LockDeps) => Promise<LockOutcome>;
|
|
156
|
+
lockDeps: LockDeps;
|
|
157
|
+
seat: SeatDeps;
|
|
158
|
+
}
|
|
159
|
+
export declare function lockInsteadOfSpawn(row: RegistryRow, name: string, launcherKey: LauncherKey, durableOnly: true, d?: LockInsteadDeps): Promise<number>;
|
|
160
|
+
export declare function lockInsteadOfSpawn(row: RegistryRow, name: string, launcherKey: LauncherKey, durableOnly: boolean, d?: LockInsteadDeps): Promise<number | null>;
|
|
161
|
+
/** The row a create-and-lock is about to make: what the idle-source lock reads (cwd, cc id). */
|
|
162
|
+
export declare function bornRow(plan: Extract<DurableLaunchPlan, {
|
|
163
|
+
kind: "spawn";
|
|
164
|
+
}>, name: string, agentId: string, cwd: string): RegistryRow;
|
|
165
|
+
/**
|
|
166
|
+
* B5a (as amended): `--new` under `always` on a durable-only agent creates the session locked in
|
|
167
|
+
* one request (the create route with the lock verb's body; the api commits both in one
|
|
168
|
+
* transaction), then attaches to the seat like any lock instead of spawning. No tracked row, no
|
|
169
|
+
* attended claude, so no turn ever runs on a plain key. The lock is the lock verb's own
|
|
170
|
+
* (lockResolvedRow: cwd rule, executor id, spec); only its POST goes to the create route. A
|
|
171
|
+
* refusal is the durable_only_agent refusal and exit 1 (C02-R24), never a tracked spawn.
|
|
172
|
+
*
|
|
173
|
+
* No claude runs before the lock, so the spec cannot be read from a live original as the lock after
|
|
174
|
+
* the first turn does: the launch's own `--model` / `--effort` stand in for it (a passthrough
|
|
175
|
+
* `-- --model` / `--effort` first, as it comes last on claude's argv; else the flag, else
|
|
176
|
+
* launcher.toml), with its `--trim-mcp`, so the seat runs as the launch chose, never the default.
|
|
177
|
+
*/
|
|
178
|
+
export declare function createLockedInsteadOfSpawn(plan: Extract<DurableLaunchPlan, {
|
|
179
|
+
kind: "spawn";
|
|
180
|
+
}>, name: string, agentId: string, launcherKey: LauncherKey, launch: {
|
|
181
|
+
model?: string;
|
|
182
|
+
effort?: string;
|
|
183
|
+
trimMcp?: boolean;
|
|
184
|
+
}, d?: LockInsteadDeps & {
|
|
185
|
+
api: Pick<DurableApi, "createSession">;
|
|
186
|
+
}): Promise<number>;
|
|
187
|
+
/**
|
|
188
|
+
* Dogfood B5: the live lock after the first turn of a new session (lib/durable/first-turn.ts). The
|
|
189
|
+
* transcript is read under `${CLAUDE_CONFIG_DIR:-~/.claude}/projects`; the lock is the lock verb's
|
|
190
|
+
* (cwd rule, transcript slug check, executor id) under the running-session handover, so a commit
|
|
191
|
+
* freezes the attended claude, waits for the seat's hello and ends it, and the launcher's exit path
|
|
192
|
+
* attaches to the seat (C02-R26 step 7). A refusal is printed with its fix line; claude goes on.
|
|
193
|
+
*/
|
|
194
|
+
export declare function liveLockAfterFirstTurn(row: RegistryRow, name: string, launcherKey: LauncherKey, childAlive: () => boolean): Promise<FirstTurnLock>;
|