@mnemom/mnemom 0.17.33 → 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-share-render.d.ts +1 -1
- package/dist/commands/agent-share-render.js +1 -1
- package/dist/commands/agent.d.ts +26 -0
- package/dist/commands/agent.js +228 -53
- 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/commands/protection.js +1 -1
- package/dist/commands/scan.d.ts +97 -0
- package/dist/commands/scan.js +238 -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 +232 -35
- package/dist/lib/agent.d.ts +8 -26
- package/dist/lib/agent.js +11 -26
- package/dist/lib/api.d.ts +13 -0
- package/dist/lib/api.js +8 -0
- 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/caps.d.ts +35 -0
- package/dist/lib/scan/caps.js +67 -0
- package/dist/lib/scan/credential.d.ts +37 -0
- package/dist/lib/scan/credential.js +104 -0
- package/dist/lib/scan/failure.d.ts +10 -0
- package/dist/lib/scan/failure.js +43 -0
- package/dist/lib/scan/pr-source.d.ts +57 -0
- package/dist/lib/scan/pr-source.js +130 -0
- package/dist/lib/scan/record.d.ts +49 -0
- package/dist/lib/scan/record.js +85 -0
- package/dist/lib/scan/report-email.d.ts +92 -0
- package/dist/lib/scan/report-email.js +144 -0
- package/dist/lib/scan/report.d.ts +13 -0
- package/dist/lib/scan/report.js +30 -0
- package/dist/lib/scan/scan.d.ts +64 -0
- package/dist/lib/scan/scan.js +182 -0
- package/dist/lib/scan/share.d.ts +38 -0
- package/dist/lib/scan/share.js +47 -0
- package/dist/lib/scan/spend/ai-tool-detect.d.ts +6 -0
- package/dist/lib/scan/spend/ai-tool-detect.js +18 -0
- package/dist/lib/scan/spend/anthropic-usage.d.ts +57 -0
- package/dist/lib/scan/spend/anthropic-usage.js +244 -0
- package/dist/lib/scan/spend/cost-corpus.v1.d.ts +56 -0
- package/dist/lib/scan/spend/cost-corpus.v1.js +64 -0
- package/dist/lib/scan/spend/prices.d.ts +33 -0
- package/dist/lib/scan/spend/prices.js +57 -0
- package/dist/lib/scan/spend/spend-estimate.d.ts +30 -0
- package/dist/lib/scan/spend/spend-estimate.js +70 -0
- package/dist/lib/scan/spend/spend-tiers.d.ts +25 -0
- package/dist/lib/scan/spend/spend-tiers.js +42 -0
- package/dist/lib/scan/spend/token-rate.d.ts +30 -0
- package/dist/lib/scan/spend/token-rate.js +54 -0
- package/dist/lib/session-key.d.ts +41 -0
- package/dist/lib/session-key.js +124 -0
- package/dist/lib/subscription-login.d.ts +15 -0
- package/dist/lib/subscription-login.js +28 -1
- package/dist/rc-key-401.mjs +75 -0
- package/dist/rc-proxy.mjs +221 -25
- 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 +4 -3
- 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,32 @@
|
|
|
1
|
+
// GENERATED from shared/durable-contract/src/executor-state.ts by cli/scripts/sync-durable-contract.mjs; do not edit.
|
|
2
|
+
/**
|
|
3
|
+
* The executor state file's shape (wave-0 fix ruling 24.14; C12-R05). EXECUTOR_STATE_FILE holds the
|
|
4
|
+
* executor key, the executor id, the nonce and the boot id the nonce is bound to, as one closed
|
|
5
|
+
* object. The host instance name is deliberately absent (C12-R04: read from config/env, so a copied
|
|
6
|
+
* file does not carry it). Internal: customers never read or edit this file; its location
|
|
7
|
+
* (paths.ts) is the customer-facing part.
|
|
8
|
+
*/
|
|
9
|
+
import { fieldOk } from "./admission.js";
|
|
10
|
+
export const EXECUTOR_STATE_VERSION = 1;
|
|
11
|
+
/** Field order is the file's key order. version is the integer EXECUTOR_STATE_VERSION. */
|
|
12
|
+
export const EXECUTOR_STATE_SCHEMA = Object.freeze({
|
|
13
|
+
version: { type: "integer", nullable: false },
|
|
14
|
+
executor_id: { type: "uuid", nullable: false },
|
|
15
|
+
/** The SECRET_KINDS executor_key spelling; this file is its only allowed home. */
|
|
16
|
+
executor_key: { type: "string", nullable: false },
|
|
17
|
+
nonce: { type: "string", nullable: false },
|
|
18
|
+
boot_id: { type: "string", nullable: false },
|
|
19
|
+
});
|
|
20
|
+
/** True for exactly the frozen shape: every key present and well typed, no other key, version 1. */
|
|
21
|
+
export function executorStateOk(v) {
|
|
22
|
+
if (v === null || typeof v !== "object" || Array.isArray(v))
|
|
23
|
+
return false;
|
|
24
|
+
const o = v;
|
|
25
|
+
const keys = Object.keys(EXECUTOR_STATE_SCHEMA);
|
|
26
|
+
if (Object.keys(o).some((k) => !keys.includes(k)))
|
|
27
|
+
return false;
|
|
28
|
+
for (const [k, spec] of Object.entries(EXECUTOR_STATE_SCHEMA))
|
|
29
|
+
if (!(k in o) || !fieldOk(spec, o[k]))
|
|
30
|
+
return false;
|
|
31
|
+
return o.version === EXECUTOR_STATE_VERSION;
|
|
32
|
+
}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fix-line catalogue, the fix-line rule and the catalogue lint (BACKBONE "Fix-line catalogue",
|
|
3
|
+
* "Fix-line rule"; C01-R16, C02-R05/R26, C11-R09/R27, C14-R11, C16-R29, final F04/F06/F11/F14).
|
|
4
|
+
*
|
|
5
|
+
* Every line is quoted ONCE here and rendered by `renderFixLine`; no other module restates one.
|
|
6
|
+
* An entry is `lead + [done clause] + body + [suffix]`:
|
|
7
|
+
* - `ruled` entries (their body contains `mnemom agent <name> --new`) obey the fix-line rule:
|
|
8
|
+
* (a) DONE_CLAUSE is inserted before the body whenever a non-terminal row holds the name
|
|
9
|
+
* (the caller says so: `nameHeld`); (b) LAUNCHER_SUFFIX is appended whenever the launcher
|
|
10
|
+
* key is not `always`.
|
|
11
|
+
* - every other entry renders lead + body verbatim.
|
|
12
|
+
* Placeholders are `<name>`-style; `renderFixLine` refuses a missing or unknown one.
|
|
13
|
+
*
|
|
14
|
+
* Text decisions recorded here (S1 owns them):
|
|
15
|
+
* - Every done clause is "`mnemom agent done <name>`, then " WITH the comma (the rule's own
|
|
16
|
+
* wording). Two backbone quotations of the `budget_at_limit` and `guard` lines omit the comma;
|
|
17
|
+
* the rule governs, so the catalogue carries the comma everywhere.
|
|
18
|
+
* - The unattended line puts the command in backticks like every other line (C08-R14 wording;
|
|
19
|
+
* the C06-R14 quotation without backticks is the same line).
|
|
20
|
+
*/
|
|
21
|
+
import { type CwdCheckCause, type CwdKind } from "./codes.js";
|
|
22
|
+
import type { EffectiveState, StateReason } from "./states.js";
|
|
23
|
+
export declare const LAUNCHER_KEYS: readonly ["off", "ask", "always"];
|
|
24
|
+
export type LauncherKey = (typeof LAUNCHER_KEYS)[number];
|
|
25
|
+
export declare const DONE_CLAUSE = "`mnemom agent done <name>`, then ";
|
|
26
|
+
export declare const LAUNCHER_SUFFIX = " (set `mnemom agent config set durable always` first)";
|
|
27
|
+
export declare const NEW_TOKEN = "mnemom agent <name> --new";
|
|
28
|
+
export type FixKind =
|
|
29
|
+
/** A line whose commands a person can run as written in M1 (C11-R27 lint executes it). */
|
|
30
|
+
"command"
|
|
31
|
+
/** An action that is not a shell command (enrol a factor, protect a branch); still M1-workable. */
|
|
32
|
+
| "action"
|
|
33
|
+
/** The single lint exemption: an informational refusal with no caller command (non-admin durable_not_owner). */
|
|
34
|
+
| "informational";
|
|
35
|
+
export interface FixEntry {
|
|
36
|
+
readonly kind: FixKind;
|
|
37
|
+
readonly lead: string;
|
|
38
|
+
readonly body: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const FIX_LINES: {
|
|
41
|
+
readonly budget_reached: FixEntry;
|
|
42
|
+
readonly above_limit_raise: FixEntry;
|
|
43
|
+
readonly budget_at_limit: FixEntry;
|
|
44
|
+
readonly agent_killed: FixEntry;
|
|
45
|
+
readonly session_ended: FixEntry;
|
|
46
|
+
readonly session_transcript_missing: FixEntry;
|
|
47
|
+
readonly paused_owner: FixEntry;
|
|
48
|
+
readonly agent_contained: FixEntry;
|
|
49
|
+
readonly respawn_failed: FixEntry;
|
|
50
|
+
readonly attestation_failed: FixEntry;
|
|
51
|
+
/** suspended(approval_expired|approval_denied) (ruling 34.22): the wait was left; the owner resumes by hand. */
|
|
52
|
+
readonly approval_expired: FixEntry;
|
|
53
|
+
readonly approval_denied: FixEntry;
|
|
54
|
+
readonly attestation_cwd_missing: FixEntry;
|
|
55
|
+
readonly attestation_cwd_not_toplevel: FixEntry;
|
|
56
|
+
readonly grant_expired: FixEntry;
|
|
57
|
+
readonly grant_warning: FixEntry;
|
|
58
|
+
readonly identity_mismatch: FixEntry;
|
|
59
|
+
/**
|
|
60
|
+
* Stopped reasons M1 has no remedy for (wave-0 fix ruling 4): suspended(card_drift,
|
|
61
|
+
* enforce_refused, charter_breach, owner_departed), paused(breakglass) and the fixture-only
|
|
62
|
+
* paused(null). done-then-new is the only exit that works in M1.
|
|
63
|
+
*/
|
|
64
|
+
readonly stopped_no_m1_remedy: FixEntry;
|
|
65
|
+
/** suspended(account_balance) (wave-0 fix ruling 4). */
|
|
66
|
+
readonly account_balance: FixEntry;
|
|
67
|
+
/** budget_raise (or amend --budget) on paused(owner) (wave-0 fix ruling 4). */
|
|
68
|
+
readonly budget_while_paused: FixEntry;
|
|
69
|
+
readonly guard: FixEntry;
|
|
70
|
+
readonly seat_wait_timeout: FixEntry;
|
|
71
|
+
readonly daemon_not_running: FixEntry;
|
|
72
|
+
readonly daemon_idle: FixEntry;
|
|
73
|
+
readonly unreachable_home: FixEntry;
|
|
74
|
+
readonly session_homed_elsewhere: FixEntry;
|
|
75
|
+
readonly session_homed_elsewhere_stale: FixEntry;
|
|
76
|
+
readonly resume_live: FixEntry;
|
|
77
|
+
readonly lock_not_entitled: FixEntry;
|
|
78
|
+
readonly lock_mfa_required: FixEntry;
|
|
79
|
+
readonly lock_branch_unprotected: FixEntry;
|
|
80
|
+
readonly lock_agent_shared: FixEntry;
|
|
81
|
+
readonly no_executor: FixEntry;
|
|
82
|
+
readonly tool_classes: FixEntry;
|
|
83
|
+
readonly remote_control: FixEntry;
|
|
84
|
+
readonly cwd_subdirectory: FixEntry;
|
|
85
|
+
readonly cwd_not_git: FixEntry;
|
|
86
|
+
readonly cwd_symlink_transcript: FixEntry;
|
|
87
|
+
readonly launch_spec_change: FixEntry;
|
|
88
|
+
/** C14-R11: offered beside launch_spec_change only when this is the agent's sole locked session. */
|
|
89
|
+
readonly launch_spec_change_sole_unlock: FixEntry;
|
|
90
|
+
readonly durable_only_agent: FixEntry;
|
|
91
|
+
readonly durable_only_held: FixEntry;
|
|
92
|
+
readonly not_owner_admin: FixEntry;
|
|
93
|
+
readonly not_owner_info: FixEntry;
|
|
94
|
+
readonly tracked_pause: FixEntry;
|
|
95
|
+
readonly tracked_resume: FixEntry;
|
|
96
|
+
readonly tracked_budget: FixEntry;
|
|
97
|
+
readonly device_step_login: FixEntry;
|
|
98
|
+
readonly containment_login: FixEntry;
|
|
99
|
+
readonly integrity: FixEntry;
|
|
100
|
+
readonly unattended: FixEntry;
|
|
101
|
+
};
|
|
102
|
+
export type FixKey = keyof typeof FIX_LINES;
|
|
103
|
+
/** The clause renderDurableOnly appends for launcher keys off and ask (C02-R24). */
|
|
104
|
+
export declare const DURABLE_ONLY_CONFIG_CLAUSE = ", or `mnemom agent config set durable always` and rerun";
|
|
105
|
+
export declare function isRuled(entry: FixEntry): boolean;
|
|
106
|
+
export interface FixRenderContext {
|
|
107
|
+
launcherKey: LauncherKey;
|
|
108
|
+
/** A non-terminal row holds the name (names are unique among non-terminal sessions, C11-R25). */
|
|
109
|
+
nameHeld: boolean;
|
|
110
|
+
params: Readonly<Record<string, string>>;
|
|
111
|
+
}
|
|
112
|
+
/** The placeholders an entry needs (lead, done clause when ruled, body). */
|
|
113
|
+
export declare function placeholdersOf(key: FixKey): string[];
|
|
114
|
+
/** Render one catalogue entry under the fix-line rule. Throws on an unknown or missing placeholder. */
|
|
115
|
+
export declare function renderFixLine(key: FixKey, ctx: FixRenderContext): string;
|
|
116
|
+
/** The durable_only_agent entry's trailing precondition clause (C02-R24, wave-0 fix ruling 16.1). */
|
|
117
|
+
export declare const DURABLE_ONLY_PRECONDITION_CLAUSE = ", or <precondition>";
|
|
118
|
+
/** The fix entries a lock refusal can pick (LOCK_REFUSAL_FIX values). */
|
|
119
|
+
export type LockRefusalFixKey = "lock_not_entitled" | "lock_mfa_required" | "lock_branch_unprotected" | "lock_agent_shared" | "no_executor" | "cwd_subdirectory" | "cwd_not_git" | "cwd_symlink_transcript";
|
|
120
|
+
/**
|
|
121
|
+
* The frozen <precondition> clause of each lock fix entry (wave-0 fix ruling 16.1), worded by the
|
|
122
|
+
* kind of fix so a whole fix entry is never wrapped in 'fix ... and rerun': a setup command run
|
|
123
|
+
* before relaunching ('run `<cmd>` and rerun'); a command that is itself the relaunch (the cwd
|
|
124
|
+
* entries: no rerun); an action, then a retry ('<action>, then rerun', rerun once); nothing the
|
|
125
|
+
* user can fix alone (not entitled: who can, no rerun). Every clause starts lowercase after ', or '.
|
|
126
|
+
*/
|
|
127
|
+
export declare const DURABLE_ONLY_PRECONDITION: Readonly<{
|
|
128
|
+
readonly lock_not_entitled: "ask support@mnemom.ai to enable durable sessions for this org";
|
|
129
|
+
readonly lock_mfa_required: "enrol a passkey or TOTP factor (check with `mnemom agent doctor`), then rerun";
|
|
130
|
+
readonly lock_branch_unprotected: "add a ruleset or branch protection to <repo>, then rerun";
|
|
131
|
+
readonly lock_agent_shared: "run `mnemom agent lock <name> --own-agent` and rerun";
|
|
132
|
+
readonly no_executor: "run `mnemom agent host install` and rerun";
|
|
133
|
+
readonly cwd_subdirectory: "start it at the repo root: `cd <toplevel> && mnemom agent <name> --new`";
|
|
134
|
+
readonly cwd_not_git: "start it in a git checkout: `cd <checkout> && mnemom agent <name> --new`";
|
|
135
|
+
readonly cwd_symlink_transcript: "start it from the real path: `cd <realpath> && mnemom agent <name> --new`";
|
|
136
|
+
}>;
|
|
137
|
+
/**
|
|
138
|
+
* The fix entry of each lock refusal code (wave-0 fix ruling 16): what fills durable_only_agent's
|
|
139
|
+
* <precondition>. durable_cwd_not_root picks its entry by cwd_kind; durable_precondition_unavailable
|
|
140
|
+
* is null: it means retry, so the durable-only line carries no precondition clause for it.
|
|
141
|
+
*/
|
|
142
|
+
export declare const LOCK_REFUSAL_FIX: Readonly<{
|
|
143
|
+
readonly durable_lock_not_entitled: "lock_not_entitled";
|
|
144
|
+
readonly durable_lock_mfa_required: "lock_mfa_required";
|
|
145
|
+
readonly durable_lock_branch_unprotected: "lock_branch_unprotected";
|
|
146
|
+
readonly durable_lock_agent_shared: "lock_agent_shared";
|
|
147
|
+
readonly durable_no_executor: "no_executor";
|
|
148
|
+
readonly durable_cwd_not_root: Readonly<{
|
|
149
|
+
subdirectory: "cwd_subdirectory";
|
|
150
|
+
not_git: "cwd_not_git";
|
|
151
|
+
symlink_transcript: "cwd_symlink_transcript";
|
|
152
|
+
}>;
|
|
153
|
+
readonly durable_precondition_unavailable: null;
|
|
154
|
+
}>;
|
|
155
|
+
export type LockRefusalCode = keyof typeof LOCK_REFUSAL_FIX;
|
|
156
|
+
/** The lock refusal a durable-only launch hit: its code, and cwd_kind for durable_cwd_not_root. */
|
|
157
|
+
export interface LockRefusal {
|
|
158
|
+
code: LockRefusalCode;
|
|
159
|
+
cwd_kind?: CwdKind;
|
|
160
|
+
}
|
|
161
|
+
/** The fix entry a lock refusal fills <precondition> with, or null (no clause). Throws when durable_cwd_not_root has no cwd_kind. */
|
|
162
|
+
export declare function lockRefusalFixKey(refusal: LockRefusal): LockRefusalFixKey | null;
|
|
163
|
+
/**
|
|
164
|
+
* The durable_only_agent entry (final F11; wave-0 fix rulings 6, Wassim option 1, and 16). The
|
|
165
|
+
* precondition clause appears only when a lock precondition really refused (`refusal` non-null and
|
|
166
|
+
* not durable_precondition_unavailable); its <precondition> is the clause DURABLE_ONLY_PRECONDITION
|
|
167
|
+
* holds for the refusing code's fix entry (LOCK_REFUSAL_FIX; ruling 16.1), rendered with `name`
|
|
168
|
+
* plus `fixParams` (<repo>, <toplevel>, <checkout>, <realpath>). The config clause appears only
|
|
169
|
+
* for launcher keys off and ask; never an unlock offer. So off, ask answered N and non-TTY ask (no
|
|
170
|
+
* lock attempted) print the other-agent and config options; always with a lock refusal prints the other-agent and precondition options; ask
|
|
171
|
+
* answered Y with a lock refusal prints all three, in that order.
|
|
172
|
+
*/
|
|
173
|
+
export declare function renderDurableOnly(launcherKey: LauncherKey, params: {
|
|
174
|
+
name: string;
|
|
175
|
+
refusal: LockRefusal | null;
|
|
176
|
+
fixParams?: Readonly<Record<string, string>>;
|
|
177
|
+
}): string;
|
|
178
|
+
/**
|
|
179
|
+
* The api's durable_only_agent answer to a create while another session (<holder>) is locked on the
|
|
180
|
+
* agent: the durable_only_held entry. Distinct from renderDurableOnly, which is the launcher's own
|
|
181
|
+
* line when THIS launch would not end locked.
|
|
182
|
+
*/
|
|
183
|
+
export declare function renderDurableOnlyHeld(params: {
|
|
184
|
+
name: string;
|
|
185
|
+
holder: string;
|
|
186
|
+
}): string;
|
|
187
|
+
/** The stopped effective states: the ones a row-8 owner-verb refusal and the CLI stopped line cover. */
|
|
188
|
+
export declare const STOPPED_EFFECTIVE_STATES: readonly ["paused", "suspended", "suspended_grant_expired"];
|
|
189
|
+
export type StoppedEffectiveState = (typeof STOPPED_EFFECTIVE_STATES)[number];
|
|
190
|
+
/** The key STOPPED_FIX uses for a NULL state_reason, and for "any reason" under suspended_grant_expired. */
|
|
191
|
+
export declare const STOPPED_FIX_NULL_REASON = "null";
|
|
192
|
+
export declare const STOPPED_FIX_ANY_REASON = "*";
|
|
193
|
+
/**
|
|
194
|
+
* One map for owner-verb row-8 refusals and the CLI's stopped-state line, so they cannot diverge:
|
|
195
|
+
* effective state -> state_reason -> fix key. Total over every stopped (state, reason) pair in
|
|
196
|
+
* STATE_REASONS; suspended_grant_expired takes grant_expired over any stored reason. Two entries
|
|
197
|
+
* are refined by stoppedFixKey: budget_reached becomes budget_at_limit at or above the per-session
|
|
198
|
+
* limit, and attestation_failed with a cwd cause takes its attestation_cwd_* line.
|
|
199
|
+
*/
|
|
200
|
+
export declare const STOPPED_FIX: Readonly<{
|
|
201
|
+
readonly paused: Readonly<{
|
|
202
|
+
null: "stopped_no_m1_remedy";
|
|
203
|
+
owner: "paused_owner";
|
|
204
|
+
agent_contained: "agent_contained";
|
|
205
|
+
breakglass: "stopped_no_m1_remedy";
|
|
206
|
+
}>;
|
|
207
|
+
readonly suspended: Readonly<{
|
|
208
|
+
budget_reached: "budget_reached";
|
|
209
|
+
enforce_refused: "stopped_no_m1_remedy";
|
|
210
|
+
charter_breach: "stopped_no_m1_remedy";
|
|
211
|
+
account_balance: "account_balance";
|
|
212
|
+
identity_mismatch: "identity_mismatch";
|
|
213
|
+
grant_expired: "grant_expired";
|
|
214
|
+
card_drift: "stopped_no_m1_remedy";
|
|
215
|
+
attestation_failed: "attestation_failed";
|
|
216
|
+
owner_departed: "stopped_no_m1_remedy";
|
|
217
|
+
respawn_failed: "respawn_failed";
|
|
218
|
+
approval_expired: "approval_expired";
|
|
219
|
+
approval_denied: "approval_denied";
|
|
220
|
+
}>;
|
|
221
|
+
readonly suspended_grant_expired: Readonly<{
|
|
222
|
+
"*": "grant_expired";
|
|
223
|
+
}>;
|
|
224
|
+
}>;
|
|
225
|
+
export interface StoppedFixOptions {
|
|
226
|
+
/** The committed budget (budget_reached only); at or above the limit the fix is budget_at_limit. */
|
|
227
|
+
committedBudgetUsd?: number;
|
|
228
|
+
/** The cause of the last attestation.failed when its check is `cwd` (attestation_failed only). */
|
|
229
|
+
cwdCause?: CwdCheckCause | null;
|
|
230
|
+
}
|
|
231
|
+
/** The STOPPED_FIX entry for an effective state and its stored reason. Throws on a non-stopped state or a reason the state cannot carry. */
|
|
232
|
+
export declare function stoppedFixKey(effective: EffectiveState, reason: StateReason | null, opts?: StoppedFixOptions): FixKey;
|
|
233
|
+
/**
|
|
234
|
+
* The check-specific sentence `mnemom agent <name>` prints next to the `mnemom agent resume <name>`
|
|
235
|
+
* fix for these two stopped reasons (wave-0 fix ruling 1.22; RULINGS-evals C11 U05 note). <n> is
|
|
236
|
+
* RESPAWN_FAILURES_SUSPEND_AT; <check> is the check of the session's last attestation.failed.
|
|
237
|
+
*/
|
|
238
|
+
export declare const STOPPED_REASON_TEXT: Readonly<{
|
|
239
|
+
respawn_failed: "the seat failed to start <n> times in a row";
|
|
240
|
+
attestation_failed: "the claim check <check> failed";
|
|
241
|
+
}>;
|
|
242
|
+
export declare function renderStoppedReasonText(reason: keyof typeof STOPPED_REASON_TEXT, check?: string): string;
|
|
243
|
+
/**
|
|
244
|
+
* The attestation check the C01 stopped-line fixtures seed in their last attestation.failed
|
|
245
|
+
* (check 12, branch protection: reachable in M1). The dataset seeds `$S1.U05_FIXTURE_CHECK`.
|
|
246
|
+
*/
|
|
247
|
+
export declare const U05_FIXTURE_CHECK = "12";
|
|
248
|
+
/** The rendered texts the C01-X-055/056 fixtures assert (n = 3; check = U05_FIXTURE_CHECK). */
|
|
249
|
+
export declare const U05_CHECK_TEXT_RESPAWN_FAILED: string;
|
|
250
|
+
export declare const U05_CHECK_TEXT_ATTESTATION_FAILED: string;
|
|
251
|
+
/** The budget refusal fix (429, 422 and stopped): amend while below the limit, budget_at_limit at or above it. */
|
|
252
|
+
export declare function budgetFixKey(committedBudgetUsd: number, limitUsd: number, surface: "reached" | "raise"): FixKey;
|
|
253
|
+
/** Commands that exist in M1. A backticked command must start with one of these. */
|
|
254
|
+
export declare const M1_COMMAND_PREFIXES: readonly ["mnemom agent ", "mnemom login", "mnemom experimental enable durable", "cd <", "git worktree add ", "npm i -g @mnemom/mnemom@"];
|
|
255
|
+
/** Tokens no fix line may contain (U12; C01-R16). */
|
|
256
|
+
export declare const FORBIDDEN_FIX_TOKENS: readonly ["--local", "host breakglass"];
|
|
257
|
+
export interface LintFinding {
|
|
258
|
+
key: string;
|
|
259
|
+
problem: string;
|
|
260
|
+
}
|
|
261
|
+
/** Shape lint over a catalogue (defaults to FIX_LINES). Empty result = clean. */
|
|
262
|
+
export declare function lintFixCatalogue(catalogue?: Readonly<Record<string, FixEntry>>): LintFinding[];
|
|
263
|
+
/** Wordings no rendered durable_only line may contain (wave-0 fix ruling 16.1). */
|
|
264
|
+
export declare const DURABLE_ONLY_FORBIDDEN: readonly ["rerun and rerun", ", then rerun, then", "or fix "];
|
|
265
|
+
/**
|
|
266
|
+
* Lint every durable_only line: each lock refusal (each cwd_kind) under each launcher key, rendered
|
|
267
|
+
* with sample params. Flags a forbidden wording, 'rerun' twice in one clause, and a clause that does
|
|
268
|
+
* not start lowercase.
|
|
269
|
+
*/
|
|
270
|
+
export declare function lintDurableOnly(clauses?: Readonly<Record<LockRefusalFixKey, string>>): LintFinding[];
|
|
271
|
+
export declare const NON_TTY_LOCKED_TEMPLATE = "`<name>` is locked; the host daemon runs it. Attach: `mnemom agent <name>`";
|
|
272
|
+
/** The single non-TTY stdout line (owner Q4, final F03), with the builder's dropped flags if any. */
|
|
273
|
+
export declare function renderNonTtyLocked(name: string, droppedFlags: readonly string[]): string;
|
|
274
|
+
/** The adopt Note grammar (C14-R12): '<with-you text>; flags dropped: <list>'. */
|
|
275
|
+
export declare const ADOPT_WITH_YOU_TEXT = "approvals with you";
|
|
276
|
+
export declare function renderAdoptNote(droppedFlags: readonly string[]): string;
|
|
277
|
+
/** `mnemom agent show` sections, in order; the --json keys are the same strings in the same order. */
|
|
278
|
+
export declare const SHOW_KEYS: readonly ["state", "machine", "sharing", "goal", "rules", "pins", "limits", "approvals", "outage", "storage", "seat", "journal"];
|
|
279
|
+
/** show keys that do not apply to a tracked session. */
|
|
280
|
+
export declare const SHOW_KEYS_LOCKED_ONLY: readonly ["machine", "pins", "limits", "approvals", "outage", "seat"];
|
|
281
|
+
/** The not-applicable value: human output prints NA_TEXT, --json carries null. */
|
|
282
|
+
export declare const NA_TEXT = "-";
|
|
283
|
+
export declare const APPROVALS_TEXT_M1 = "with you";
|
|
284
|
+
export declare const OUTAGE_TEXT_M1 = "if Mnemom is unavailable this session's model calls stop until it is back; nothing runs on its own in this release";
|
|
285
|
+
export declare const STORAGE_TEXT_M1 = "goal text: encrypted, erasable, purged 30 days after the session ends; charter, journal and session row: content-free; transcript: on this machine only";
|
|
286
|
+
export declare const SEAT_TEXT_M1 = "leave without stopping it: tmux detach (ctrl-b d); `/exit` restarts the seat";
|
|
287
|
+
export declare const JOURNAL_TAIL_N = 10;
|
|
288
|
+
/**
|
|
289
|
+
* The laptop risk line, version RISK_LINE_VERSION (constants.ts). Printed at host install, in the
|
|
290
|
+
* adopt summary and on lock, never recorded as seen (C02-R17). It is the design §2.2 sentence
|
|
291
|
+
* minus what M1 lacks (no Slack approvals, no org-limit raises in M1).
|
|
292
|
+
*/
|
|
293
|
+
export declare const RISK_LINE_TEXT = "Here the session acts with your account's access on this machine. Never-rules and holds are tripwires, not walls; a container is the recommended home for work on its own.";
|
|
294
|
+
/**
|
|
295
|
+
* The device verification page's harness markers (C04-R08; wave-0 fix 3d): HTML attributes, values
|
|
296
|
+
* from server state only (never from the submitted form). The visible text is RISK_LINE_TEXT.
|
|
297
|
+
* data-subject-kind the stored kind ('host' in M1)
|
|
298
|
+
* data-subject-runtime the stored runtime string
|
|
299
|
+
* data-runtime-self-declared 'true' | 'false'
|
|
300
|
+
* data-risk-sentence-id RISK_SENTENCE_ID_HOST for kind host
|
|
301
|
+
* data-risk-line-version String(RISK_LINE_VERSION)
|
|
302
|
+
*/
|
|
303
|
+
export declare const DEVICE_PAGE_MARKERS: readonly ["data-subject-kind", "data-subject-runtime", "data-runtime-self-declared", "data-risk-sentence-id", "data-risk-line-version"];
|
|
304
|
+
export type DevicePageMarker = (typeof DEVICE_PAGE_MARKERS)[number];
|
|
305
|
+
export declare const RISK_SENTENCE_ID_HOST = "laptop";
|
|
306
|
+
/** The marker values for one enrollment subject, from its stored row. M1 knows kind 'host' only. */
|
|
307
|
+
export declare function devicePageMarkerValues(subject: {
|
|
308
|
+
kind: string;
|
|
309
|
+
runtime: string;
|
|
310
|
+
runtimeSelfDeclared: boolean;
|
|
311
|
+
}): Readonly<Record<DevicePageMarker, string>>;
|
|
312
|
+
/** Spend column (C01-R25): guard_state.spend_usd to cents, two decimals, no currency sign; tracked rows print NA_TEXT. */
|
|
313
|
+
export declare function formatSpendCents(spendUsd: number | null): string;
|
|
314
|
+
/**
|
|
315
|
+
* Days shown in the grant warning: ceil(remaining / 1 day), so "6 days" at six days left and
|
|
316
|
+
* "1 days" in the last day. null (no warning) above GRANT_WARNING_S or when already expired.
|
|
317
|
+
*/
|
|
318
|
+
export declare function grantWarningDays(remainingSeconds: number, warningWindowSeconds: number): number | null;
|