@sentropic/h2a-runtime 0.98.6 → 0.98.7-rc.10
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/agent-launch-args.d.ts.map +1 -1
- package/dist/agent-launch-args.js +5 -5
- package/dist/agent-launch-args.js.map +1 -1
- package/dist/agy-claude.d.ts +42 -0
- package/dist/agy-claude.d.ts.map +1 -0
- package/dist/agy-claude.js +148 -0
- package/dist/agy-claude.js.map +1 -0
- package/dist/agy-headless.d.ts +11 -0
- package/dist/agy-headless.d.ts.map +1 -0
- package/dist/agy-headless.js +104 -0
- package/dist/agy-headless.js.map +1 -0
- package/dist/attach.d.ts +5 -0
- package/dist/attach.d.ts.map +1 -1
- package/dist/attach.js +75 -6
- package/dist/attach.js.map +1 -1
- package/dist/auth-login.d.ts +24 -1
- package/dist/auth-login.d.ts.map +1 -1
- package/dist/auth-login.js +132 -4
- package/dist/auth-login.js.map +1 -1
- package/dist/central-mcp.d.ts +34 -0
- package/dist/central-mcp.d.ts.map +1 -1
- package/dist/central-mcp.js +275 -71
- package/dist/central-mcp.js.map +1 -1
- package/dist/claude-code-cli-isolation.d.ts +53 -0
- package/dist/claude-code-cli-isolation.d.ts.map +1 -0
- package/dist/claude-code-cli-isolation.js +277 -0
- package/dist/claude-code-cli-isolation.js.map +1 -0
- package/dist/claude-code-cli-lifecycle.d.ts +80 -0
- package/dist/claude-code-cli-lifecycle.d.ts.map +1 -0
- package/dist/claude-code-cli-lifecycle.js +402 -0
- package/dist/claude-code-cli-lifecycle.js.map +1 -0
- package/dist/claude-code-cli-runner.d.ts +89 -0
- package/dist/claude-code-cli-runner.d.ts.map +1 -0
- package/dist/claude-code-cli-runner.js +659 -0
- package/dist/claude-code-cli-runner.js.map +1 -0
- package/dist/claude-seat-input.d.ts +47 -0
- package/dist/claude-seat-input.d.ts.map +1 -0
- package/dist/claude-seat-input.js +272 -0
- package/dist/claude-seat-input.js.map +1 -0
- package/dist/claude-seat-mesh-contract.d.ts +88 -0
- package/dist/claude-seat-mesh-contract.d.ts.map +1 -0
- package/dist/claude-seat-mesh-contract.js +13 -0
- package/dist/claude-seat-mesh-contract.js.map +1 -0
- package/dist/cli-help-groups.js +1 -1
- package/dist/cli-help-groups.js.map +1 -1
- package/dist/cli-seat-codecs.d.ts +86 -0
- package/dist/cli-seat-codecs.d.ts.map +1 -0
- package/dist/cli-seat-codecs.js +255 -0
- package/dist/cli-seat-codecs.js.map +1 -0
- package/dist/cli-seat-fixtures.d.ts +86 -0
- package/dist/cli-seat-fixtures.d.ts.map +1 -0
- package/dist/cli-seat-fixtures.js +114 -0
- package/dist/cli-seat-fixtures.js.map +1 -0
- package/dist/cli-seat-materialization.d.ts +245 -0
- package/dist/cli-seat-materialization.d.ts.map +1 -0
- package/dist/cli-seat-materialization.js +646 -0
- package/dist/cli-seat-materialization.js.map +1 -0
- package/dist/conv-guard.d.ts.map +1 -1
- package/dist/conv-guard.js +6 -2
- package/dist/conv-guard.js.map +1 -1
- package/dist/crash-log.d.ts +112 -0
- package/dist/crash-log.d.ts.map +1 -0
- package/dist/crash-log.js +560 -0
- package/dist/crash-log.js.map +1 -0
- package/dist/delegate.d.ts +10 -0
- package/dist/delegate.d.ts.map +1 -1
- package/dist/delegate.js +29 -0
- package/dist/delegate.js.map +1 -1
- package/dist/file-lock.d.ts +4 -2
- package/dist/file-lock.d.ts.map +1 -1
- package/dist/file-lock.js +24 -10
- package/dist/file-lock.js.map +1 -1
- package/dist/gateway-host/claude-seat-client.d.ts +32 -0
- package/dist/gateway-host/claude-seat-client.d.ts.map +1 -0
- package/dist/gateway-host/claude-seat-client.js +38 -0
- package/dist/gateway-host/claude-seat-client.js.map +1 -0
- package/dist/gateway-host/config-file.d.ts +2 -0
- package/dist/gateway-host/config-file.d.ts.map +1 -1
- package/dist/gateway-host/config-file.js +5 -1
- package/dist/gateway-host/config-file.js.map +1 -1
- package/dist/gateway-host/daemon.d.ts.map +1 -1
- package/dist/gateway-host/daemon.js +1 -2
- package/dist/gateway-host/daemon.js.map +1 -1
- package/dist/gateway-host/host.d.ts +6 -0
- package/dist/gateway-host/host.d.ts.map +1 -1
- package/dist/gateway-host/host.js +24 -3
- package/dist/gateway-host/host.js.map +1 -1
- package/dist/gateway-host/live-auth.d.ts +62 -0
- package/dist/gateway-host/live-auth.d.ts.map +1 -0
- package/dist/gateway-host/live-auth.js +87 -0
- package/dist/gateway-host/live-auth.js.map +1 -0
- package/dist/gateway-host/live-declarations.d.ts +58 -0
- package/dist/gateway-host/live-declarations.d.ts.map +1 -0
- package/dist/gateway-host/live-declarations.js +429 -0
- package/dist/gateway-host/live-declarations.js.map +1 -0
- package/dist/gateway-host/live-disclosure.d.ts +124 -0
- package/dist/gateway-host/live-disclosure.d.ts.map +1 -0
- package/dist/gateway-host/live-disclosure.js +347 -0
- package/dist/gateway-host/live-disclosure.js.map +1 -0
- package/dist/gateway-host/live-github.d.ts +11 -0
- package/dist/gateway-host/live-github.d.ts.map +1 -0
- package/dist/gateway-host/live-github.js +374 -0
- package/dist/gateway-host/live-github.js.map +1 -0
- package/dist/gateway-host/live-host.d.ts +20 -0
- package/dist/gateway-host/live-host.d.ts.map +1 -0
- package/dist/gateway-host/live-host.js +14 -0
- package/dist/gateway-host/live-host.js.map +1 -0
- package/dist/gateway-host/live-object-store.d.ts +35 -0
- package/dist/gateway-host/live-object-store.d.ts.map +1 -0
- package/dist/gateway-host/live-object-store.js +447 -0
- package/dist/gateway-host/live-object-store.js.map +1 -0
- package/dist/gateway-host/live-registration.d.ts +162 -0
- package/dist/gateway-host/live-registration.d.ts.map +1 -0
- package/dist/gateway-host/live-registration.js +455 -0
- package/dist/gateway-host/live-registration.js.map +1 -0
- package/dist/gateway-model-catalog/model-catalog.d.ts +38 -0
- package/dist/gateway-model-catalog/model-catalog.d.ts.map +1 -0
- package/dist/gateway-model-catalog/model-catalog.js +167 -0
- package/dist/gateway-model-catalog/model-catalog.js.map +1 -0
- package/dist/identity-cull/cull.js +1 -1
- package/dist/identity-cull/cull.js.map +1 -1
- package/dist/identity-cull/identity-fence.d.ts +48 -0
- package/dist/identity-cull/identity-fence.d.ts.map +1 -0
- package/dist/identity-cull/identity-fence.js +221 -0
- package/dist/identity-cull/identity-fence.js.map +1 -0
- package/dist/identity-operator-break.d.ts +43 -0
- package/dist/identity-operator-break.d.ts.map +1 -0
- package/dist/identity-operator-break.js +85 -0
- package/dist/identity-operator-break.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +525 -132
- package/dist/index.js.map +1 -1
- package/dist/launch-layout.d.ts.map +1 -1
- package/dist/launch-layout.js +10 -2
- package/dist/launch-layout.js.map +1 -1
- package/dist/llm-mesh-accounts.d.ts +128 -6
- package/dist/llm-mesh-accounts.d.ts.map +1 -1
- package/dist/llm-mesh-accounts.js +370 -14
- package/dist/llm-mesh-accounts.js.map +1 -1
- package/dist/native-host.d.ts +25 -1
- package/dist/native-host.d.ts.map +1 -1
- package/dist/native-host.js +211 -28
- package/dist/native-host.js.map +1 -1
- package/dist/native-restart.d.ts +2 -0
- package/dist/native-restart.d.ts.map +1 -1
- package/dist/native-restart.js +7 -0
- package/dist/native-restart.js.map +1 -1
- package/dist/native-terminal/fleet.d.ts +11 -0
- package/dist/native-terminal/fleet.d.ts.map +1 -1
- package/dist/native-terminal/fleet.js +58 -1
- package/dist/native-terminal/fleet.js.map +1 -1
- package/dist/native-terminal/host-scope.d.ts +18 -0
- package/dist/native-terminal/host-scope.d.ts.map +1 -0
- package/dist/native-terminal/host-scope.js +65 -0
- package/dist/native-terminal/host-scope.js.map +1 -0
- package/dist/native-terminal/host.d.ts +7 -1
- package/dist/native-terminal/host.d.ts.map +1 -1
- package/dist/native-terminal/host.js +10 -26
- package/dist/native-terminal/host.js.map +1 -1
- package/dist/native-terminal/journal.d.ts +5 -0
- package/dist/native-terminal/journal.d.ts.map +1 -1
- package/dist/native-terminal/journal.js +28 -16
- package/dist/native-terminal/journal.js.map +1 -1
- package/dist/native-terminal/op.d.ts +49 -1
- package/dist/native-terminal/op.d.ts.map +1 -1
- package/dist/native-terminal/op.js +254 -38
- package/dist/native-terminal/op.js.map +1 -1
- package/dist/native-terminal/process.d.ts.map +1 -1
- package/dist/native-terminal/process.js +10 -1
- package/dist/native-terminal/process.js.map +1 -1
- package/dist/native-terminal/screen.d.ts.map +1 -1
- package/dist/native-terminal/screen.js +1 -1
- package/dist/native-terminal/screen.js.map +1 -1
- package/dist/native-terminal/server.d.ts +12 -2
- package/dist/native-terminal/server.d.ts.map +1 -1
- package/dist/native-terminal/server.js +143 -42
- package/dist/native-terminal/server.js.map +1 -1
- package/dist/native-terminal/session-scope.d.ts +2 -0
- package/dist/native-terminal/session-scope.d.ts.map +1 -0
- package/dist/native-terminal/session-scope.js +32 -0
- package/dist/native-terminal/session-scope.js.map +1 -0
- package/dist/proc-identity.d.ts +31 -0
- package/dist/proc-identity.d.ts.map +1 -1
- package/dist/proc-identity.js +54 -0
- package/dist/proc-identity.js.map +1 -1
- package/dist/prompt-delivery.d.ts +3 -0
- package/dist/prompt-delivery.d.ts.map +1 -1
- package/dist/prompt-delivery.js +8 -3
- package/dist/prompt-delivery.js.map +1 -1
- package/dist/protocol-local.d.ts +16 -0
- package/dist/protocol-local.d.ts.map +1 -1
- package/dist/protocol-local.js +14 -0
- package/dist/protocol-local.js.map +1 -1
- package/dist/registry.d.ts +16 -12
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +39 -5
- package/dist/registry.js.map +1 -1
- package/dist/relaunch.d.ts +16 -0
- package/dist/relaunch.d.ts.map +1 -1
- package/dist/relaunch.js +42 -1
- package/dist/relaunch.js.map +1 -1
- package/dist/restore.d.ts +4 -0
- package/dist/restore.d.ts.map +1 -1
- package/dist/restore.js +9 -37
- package/dist/restore.js.map +1 -1
- package/dist/resume-launch-options.d.ts +3 -3
- package/dist/resume-launch-options.d.ts.map +1 -1
- package/dist/resume-launch-options.js +7 -4
- package/dist/resume-launch-options.js.map +1 -1
- package/dist/run.d.ts +2 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +88 -20
- package/dist/run.js.map +1 -1
- package/dist/soft-refresh.d.ts.map +1 -1
- package/dist/soft-refresh.js +6 -0
- package/dist/soft-refresh.js.map +1 -1
- package/dist/terminal-reset.d.ts +104 -0
- package/dist/terminal-reset.d.ts.map +1 -0
- package/dist/terminal-reset.js +229 -0
- package/dist/terminal-reset.js.map +1 -0
- package/dist/tmux.d.ts +54 -8
- package/dist/tmux.d.ts.map +1 -1
- package/dist/tmux.js +143 -36
- package/dist/tmux.js.map +1 -1
- package/dist/vendor/engram-live/contracts.d.ts +825 -0
- package/dist/vendor/engram-live/contracts.js +1734 -0
- package/dist/vendor/engram-live/integration.d.ts +113 -0
- package/dist/vendor/engram-live/integration.js +254 -0
- package/dist/vendor/engram-live/pr-sync.d.ts +144 -0
- package/dist/vendor/engram-live/pr-sync.js +411 -0
- package/dist/vendor/engram-live/registration.d.ts +138 -0
- package/dist/vendor/engram-live/registration.js +358 -0
- package/dist/vendor/engram-live/retention.d.ts +56 -0
- package/dist/vendor/engram-live/retention.js +179 -0
- package/package.json +6 -6
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* L6a (H) — explicit live workspace registration (composition seam).
|
|
3
|
+
*
|
|
4
|
+
* DESIGN (LIVE §2–3, §10, §12; owner decision Q4 = A):
|
|
5
|
+
* - Activation is EXPLICIT and once per worktree: bind, transcript upload,
|
|
6
|
+
* code-workspace creation and agent sessions are never inputs here, and
|
|
7
|
+
* nothing in this module observes sessions at all. Session end never
|
|
8
|
+
* unregisters; host restart replays durable declarations.
|
|
9
|
+
* - The durable declaration store is LOCAL h2a state (see
|
|
10
|
+
* ./live-declarations.ts); it is never the product workspace router and
|
|
11
|
+
* never projection-owned.
|
|
12
|
+
* - Identities are minted ONLY through the three canonical public
|
|
13
|
+
* derivations from the vendored neutral integration entry
|
|
14
|
+
* (../vendor/engram-live, see the core live/contracts.ts header), so
|
|
15
|
+
* H ids are byte-identical to the engram (E) side for identical inputs:
|
|
16
|
+
* equal fingerprints under different realpaths derive distinct clones,
|
|
17
|
+
* while linked worktrees sharing one common-dir derive the same clone.
|
|
18
|
+
* Missing/shallow history is explicit uncertainty, never a
|
|
19
|
+
* URL/fingerprint-only merge.
|
|
20
|
+
* - The public `ws:` worktree/project fingerprint is H's own preserved
|
|
21
|
+
* fingerprint (spec §12: keep the existing derivation byte-identical);
|
|
22
|
+
* the two helpers below are its only copy, forced by the core/runtime
|
|
23
|
+
* boundary (no static runtime→core import), and pinned byte-identical
|
|
24
|
+
* to core by live-registration.test.ts. They compute fingerprints, never
|
|
25
|
+
* opaque ids: every cloneId/worktreeId/declarationId comes from the
|
|
26
|
+
* package.
|
|
27
|
+
* - Local authority is a seam with NO fallback: a positive authorization
|
|
28
|
+
* without a verified principal is refused explicitly
|
|
29
|
+
* (`verified_principal_required`) before any neutral DTO is built — for
|
|
30
|
+
* reads as well as activation (spec §12). The default authority DENIES
|
|
31
|
+
* every operation explicitly (`local_authority_unavailable`) until L7a
|
|
32
|
+
* supplies verified local principals and the stable owner scope.
|
|
33
|
+
* Refusal is an error, never a successful empty result.
|
|
34
|
+
* - Removal and clone withdrawal stop work first (cancellation seam),
|
|
35
|
+
* then return the contract revocation (exact declarationId, tenant,
|
|
36
|
+
* clone/worktree attachment, declarationRevision, reason, full private
|
|
37
|
+
* purge request); committed history is never touched.
|
|
38
|
+
*/
|
|
39
|
+
import { execFileSync } from "node:child_process";
|
|
40
|
+
import { createHash } from "node:crypto";
|
|
41
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
42
|
+
import { userInfo } from "node:os";
|
|
43
|
+
import { basename, isAbsolute, resolve } from "node:path";
|
|
44
|
+
import { EXPLICIT_LIVE_CAPABILITY, INITIAL_DECLARATION_REVISION, NON_ACTIVATING_LIFECYCLE_KINDS, POLICY_VERSION, isIdentityUncertaintyState, isNonActivatingLifecycleKind, validateDeclarationRevocation, validateWorkspaceDeclaration, } from "../vendor/engram-live/contracts.js";
|
|
45
|
+
import { deriveCloneIdentity, deriveDeclarationIdentity, deriveWorktreeIdentity, } from "../vendor/engram-live/integration.js";
|
|
46
|
+
import { LIVE_DECLARATION_KIND, LIVE_DECLARATION_SCHEMA_VERSION, createLiveDeclarationStore, } from "./live-declarations.js";
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// H-public `ws:` fingerprint (LIVE §12: preserved byte-identical).
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
//
|
|
51
|
+
// The ONLY runtime copy of the core derivation (core/runtime boundary
|
|
52
|
+
// forbids a static runtime→core import). Fingerprints only: opaque ids are
|
|
53
|
+
// minted exclusively through the canonical package derivations above.
|
|
54
|
+
export function normalizeRootCommits(shas) {
|
|
55
|
+
return [...new Set(shas.map((s) => s.trim()).filter((s) => s.length > 0))]
|
|
56
|
+
.sort()
|
|
57
|
+
.join(",");
|
|
58
|
+
}
|
|
59
|
+
export function computeDurableWorkspaceId(rootCommitSHA, worktreeRelPath) {
|
|
60
|
+
const hex = createHash("sha256")
|
|
61
|
+
.update(`${rootCommitSHA}\n${worktreeRelPath}`, "utf8")
|
|
62
|
+
.digest("hex");
|
|
63
|
+
return `ws:${hex}`;
|
|
64
|
+
}
|
|
65
|
+
const resolveWithin = (base, path) => {
|
|
66
|
+
if (isAbsolute(path))
|
|
67
|
+
return path;
|
|
68
|
+
return resolve(base, path);
|
|
69
|
+
};
|
|
70
|
+
const realpathOr = (path, fallback) => {
|
|
71
|
+
try {
|
|
72
|
+
return realpathSync(path);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return fallback;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Probe a worktree's live identity with read-only Git plumbing. Every
|
|
80
|
+
* invocation disables optional locks (`--no-optional-locks`, LIVE §7) and
|
|
81
|
+
* never writes to the observed worktree, its index or its refs. Returns
|
|
82
|
+
* undefined when the path is not a Git worktree; missing (unborn HEAD) or
|
|
83
|
+
* shallow history is a successful probe with explicit uncertainty.
|
|
84
|
+
*/
|
|
85
|
+
export function probeLiveWorkspace(cwd) {
|
|
86
|
+
const worktreeRealpath = realpathOr(cwd, resolve(cwd));
|
|
87
|
+
const spawnOpts = {
|
|
88
|
+
cwd: worktreeRealpath,
|
|
89
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
90
|
+
timeout: 5000,
|
|
91
|
+
windowsHide: true,
|
|
92
|
+
};
|
|
93
|
+
const run = (args) => {
|
|
94
|
+
try {
|
|
95
|
+
const out = execFileSync("git", ["--no-optional-locks", "-C", worktreeRealpath, ...args], spawnOpts)
|
|
96
|
+
.toString("utf8")
|
|
97
|
+
.trim();
|
|
98
|
+
return out.length > 0 ? out : undefined;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
// --- git-dir / common-dir (resolve relative outputs against the root) ---
|
|
105
|
+
const gitDirRaw = run(["rev-parse", "--git-dir"]);
|
|
106
|
+
const commonDirRaw = run(["rev-parse", "--git-common-dir"]);
|
|
107
|
+
if (gitDirRaw === undefined || commonDirRaw === undefined)
|
|
108
|
+
return undefined;
|
|
109
|
+
const gitDir = realpathOr(resolveWithin(worktreeRealpath, gitDirRaw), gitDirRaw);
|
|
110
|
+
const commonDirRealpath = realpathOr(resolveWithin(worktreeRealpath, commonDirRaw), commonDirRaw);
|
|
111
|
+
const worktreeName = gitDir === commonDirRealpath ? "" : basename(gitDir);
|
|
112
|
+
// --- object format (required to mint a contract-valid clone identity) ---
|
|
113
|
+
const objectFormat = run(["rev-parse", "--show-object-format"]);
|
|
114
|
+
const oidAlgorithm = objectFormat === "sha1" || objectFormat === "sha256" ? objectFormat : undefined;
|
|
115
|
+
// --- root commits of this worktree's HEAD (absent on unborn HEAD) ---
|
|
116
|
+
// HEAD-bound by design: this feeds the public per-worktree `ws:`
|
|
117
|
+
// fingerprint only, never the clone key.
|
|
118
|
+
const rootCommitLines = run(["rev-list", "--max-parents=0", "HEAD"]);
|
|
119
|
+
const rootCommits = rootCommitLines === undefined ? undefined : normalizeRootCommits(rootCommitLines.split(/\r?\n/));
|
|
120
|
+
// --- common-dir history roots (HEAD-independent clone key, spec §12) ---
|
|
121
|
+
// The union of root commits over every ref in the shared common-dir,
|
|
122
|
+
// identical from every worktree of the clone whatever its HEAD (an
|
|
123
|
+
// orphan branch checked out in one worktree must not fork the clone).
|
|
124
|
+
// HEAD itself is deliberately excluded: it is per-worktree state.
|
|
125
|
+
const refTipLines = run(["for-each-ref", "--format=%(objectname)"]);
|
|
126
|
+
const refTips = refTipLines === undefined
|
|
127
|
+
? []
|
|
128
|
+
: refTipLines
|
|
129
|
+
.split(/\r?\n/)
|
|
130
|
+
.map((tip) => tip.trim())
|
|
131
|
+
.filter((tip) => tip.length > 0);
|
|
132
|
+
let cloneRootCommits;
|
|
133
|
+
if (refTips.length > 0) {
|
|
134
|
+
const cloneRootLines = run(["rev-list", "--max-parents=0", ...refTips]);
|
|
135
|
+
cloneRootCommits =
|
|
136
|
+
cloneRootLines === undefined
|
|
137
|
+
? undefined
|
|
138
|
+
: normalizeRootCommits(cloneRootLines.split(/\r?\n/));
|
|
139
|
+
}
|
|
140
|
+
const shallow = existsSync(resolve(commonDirRealpath.startsWith("/") ? commonDirRealpath : resolveWithin(worktreeRealpath, commonDirRealpath), "shallow"));
|
|
141
|
+
const identityUncertainty = [];
|
|
142
|
+
if (rootCommits === undefined) {
|
|
143
|
+
identityUncertainty.push("missing_history");
|
|
144
|
+
}
|
|
145
|
+
// The clone fingerprint may be absent only under explicit
|
|
146
|
+
// missing_history uncertainty (engram contract): when the common-dir
|
|
147
|
+
// holds no ref history at all, say so even if this worktree's HEAD
|
|
148
|
+
// somehow resolves.
|
|
149
|
+
if (cloneRootCommits === undefined && !identityUncertainty.includes("missing_history")) {
|
|
150
|
+
identityUncertainty.push("missing_history");
|
|
151
|
+
}
|
|
152
|
+
if (shallow) {
|
|
153
|
+
identityUncertainty.push("shallow_history");
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
worktreeRealpath,
|
|
157
|
+
gitDir,
|
|
158
|
+
commonDirRealpath,
|
|
159
|
+
worktreeName,
|
|
160
|
+
...(oidAlgorithm !== undefined ? { oidAlgorithm } : {}),
|
|
161
|
+
...(rootCommits !== undefined ? { rootCommits } : {}),
|
|
162
|
+
...(rootCommits !== undefined
|
|
163
|
+
? { workspaceFingerprint: computeDurableWorkspaceId(rootCommits, worktreeName) }
|
|
164
|
+
: {}),
|
|
165
|
+
...(cloneRootCommits !== undefined
|
|
166
|
+
? { projectFingerprint: computeDurableWorkspaceId(cloneRootCommits, "") }
|
|
167
|
+
: {}),
|
|
168
|
+
shallow,
|
|
169
|
+
identityUncertainty,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
// Lifecycle classification (spec §12: these kinds never activate/remove)
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
175
|
+
/**
|
|
176
|
+
* Classify a host lifecycle event against live declarations. Bind, upload,
|
|
177
|
+
* code-workspace creation and session open/end never activate or remove a
|
|
178
|
+
* declaration: the only outcome is "no-activation-change". Unknown kinds
|
|
179
|
+
* are refused. Pinned to NON_ACTIVATING_LIFECYCLE_KINDS, never a copy.
|
|
180
|
+
*/
|
|
181
|
+
export function classifyLifecycleEvent(kind) {
|
|
182
|
+
if (!isNonActivatingLifecycleKind(kind)) {
|
|
183
|
+
throw new Error(`unknown lifecycle kind: ${String(kind)}`);
|
|
184
|
+
}
|
|
185
|
+
return "no-activation-change";
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Default authority until L7a: deny everything explicitly. Local identity
|
|
189
|
+
* verification is L7a work; until it exists, no declaration API is usable,
|
|
190
|
+
* and denial is an error — never a successful empty result (A01).
|
|
191
|
+
*/
|
|
192
|
+
export const unverifiedLocalLiveAuthority = {
|
|
193
|
+
authorize: () => ({ ok: false, reason: "local_authority_unavailable" }),
|
|
194
|
+
};
|
|
195
|
+
export const inertLiveWorkController = {
|
|
196
|
+
cancelScheduledWork: () => false,
|
|
197
|
+
requestPrivatePurge: () => false,
|
|
198
|
+
hasInFlightWork: () => false,
|
|
199
|
+
};
|
|
200
|
+
export class LiveAccessRefused extends Error {
|
|
201
|
+
operation;
|
|
202
|
+
reason;
|
|
203
|
+
constructor(operation, reason) {
|
|
204
|
+
super(`live ${operation} refused: ${reason}`);
|
|
205
|
+
this.operation = operation;
|
|
206
|
+
this.reason = reason;
|
|
207
|
+
this.name = "LiveAccessRefused";
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const defaultTenant = () => {
|
|
211
|
+
const username = userInfo().username;
|
|
212
|
+
return `local:${username && username.length > 0 ? username : "unknown"}`;
|
|
213
|
+
};
|
|
214
|
+
export function createLiveRegistration(options) {
|
|
215
|
+
const root = options.root;
|
|
216
|
+
const tenant = options.tenant ?? defaultTenant();
|
|
217
|
+
const authority = options.authority ?? unverifiedLocalLiveAuthority;
|
|
218
|
+
const workController = options.workController ?? inertLiveWorkController;
|
|
219
|
+
const now = options.now ?? (() => new Date().toISOString());
|
|
220
|
+
const store = createLiveDeclarationStore(root);
|
|
221
|
+
const authorize = (operation, detail = {}) => {
|
|
222
|
+
const decision = authority.authorize({
|
|
223
|
+
operation,
|
|
224
|
+
tenant,
|
|
225
|
+
...(detail.path !== undefined ? { path: detail.path } : {}),
|
|
226
|
+
...(detail.declarationId !== undefined ? { declarationId: detail.declarationId } : {}),
|
|
227
|
+
...(detail.hostFingerprint !== undefined
|
|
228
|
+
? { hostFingerprint: detail.hostFingerprint }
|
|
229
|
+
: {}),
|
|
230
|
+
});
|
|
231
|
+
if (!decision.ok) {
|
|
232
|
+
throw new LiveAccessRefused(operation, decision.reason ?? "denied");
|
|
233
|
+
}
|
|
234
|
+
// No fabricated fallback: a positive authorization without a verified
|
|
235
|
+
// principal is refused before any neutral DTO is built. The stable
|
|
236
|
+
// owner scope and principal proof are L7a work — say so, don't invent.
|
|
237
|
+
if (decision.principal === undefined || decision.principal.trim().length === 0) {
|
|
238
|
+
throw new LiveAccessRefused(operation, "verified_principal_required");
|
|
239
|
+
}
|
|
240
|
+
return { ...decision, principal: decision.principal };
|
|
241
|
+
};
|
|
242
|
+
const resolveInputPath = (path) => realpathOr(resolve(path), resolve(path));
|
|
243
|
+
const findByAuthorizedRoot = (path) => {
|
|
244
|
+
const resolved = resolveInputPath(path);
|
|
245
|
+
return store
|
|
246
|
+
.list()
|
|
247
|
+
.find((record) => record.declaration.authorizedRoots.includes(resolved) ||
|
|
248
|
+
record.declaration.authorizedRoots.includes(realpathOr(resolved, resolved)));
|
|
249
|
+
};
|
|
250
|
+
const buildRevocation = (record, reason) => {
|
|
251
|
+
const revocation = {
|
|
252
|
+
declarationId: record.declaration.declarationId,
|
|
253
|
+
tenant: record.declaration.tenant,
|
|
254
|
+
cloneId: record.declaration.cloneId,
|
|
255
|
+
worktreeId: record.declaration.worktreeId,
|
|
256
|
+
declarationRevision: record.declaration.declarationRevision,
|
|
257
|
+
reason,
|
|
258
|
+
requestPrivatePurge: {
|
|
259
|
+
purgePrivateSnapshots: true,
|
|
260
|
+
purgeDerivedIndexes: true,
|
|
261
|
+
revokeDecryptability: true,
|
|
262
|
+
preserveCommittedHistory: true,
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
const checked = validateDeclarationRevocation(revocation);
|
|
266
|
+
if (!checked.ok) {
|
|
267
|
+
throw new Error(`invalid live declaration revocation: ${checked.errors.join("; ")}`);
|
|
268
|
+
}
|
|
269
|
+
return revocation;
|
|
270
|
+
};
|
|
271
|
+
return {
|
|
272
|
+
authority,
|
|
273
|
+
probe: probeLiveWorkspace,
|
|
274
|
+
activate(request) {
|
|
275
|
+
const decision = authorize("activate", { path: request.path });
|
|
276
|
+
const probe = probeLiveWorkspace(request.path);
|
|
277
|
+
if (probe === undefined) {
|
|
278
|
+
throw new Error(`not a git worktree: ${request.path}`);
|
|
279
|
+
}
|
|
280
|
+
for (const state of probe.identityUncertainty) {
|
|
281
|
+
if (!isIdentityUncertaintyState(state)) {
|
|
282
|
+
throw new Error(`unknown identity uncertainty state: ${String(state)}`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (probe.oidAlgorithm !== "sha1" && probe.oidAlgorithm !== "sha256") {
|
|
286
|
+
throw new Error(`cannot mint a live clone identity for ${request.path}: repository object format is undetectable`);
|
|
287
|
+
}
|
|
288
|
+
// Canonical identities: byte-identical to the engram side for
|
|
289
|
+
// identical inputs (hostScope carries the local tenant scope, which
|
|
290
|
+
// bounds the clone to one host).
|
|
291
|
+
const clone = deriveCloneIdentity({
|
|
292
|
+
hostScope: tenant,
|
|
293
|
+
commonDirRealpath: probe.commonDirRealpath,
|
|
294
|
+
...(probe.projectFingerprint !== undefined
|
|
295
|
+
? { commonDirProjectFingerprint: probe.projectFingerprint }
|
|
296
|
+
: {}),
|
|
297
|
+
identityUncertainty: [...probe.identityUncertainty],
|
|
298
|
+
oidAlgorithm: probe.oidAlgorithm,
|
|
299
|
+
});
|
|
300
|
+
const worktree = deriveWorktreeIdentity({
|
|
301
|
+
hostScope: tenant,
|
|
302
|
+
clone: { cloneId: clone.cloneId },
|
|
303
|
+
worktreePath: probe.worktreeRealpath,
|
|
304
|
+
gitDir: probe.gitDir,
|
|
305
|
+
...(probe.workspaceFingerprint !== undefined
|
|
306
|
+
? { worktreeFingerprint: probe.workspaceFingerprint }
|
|
307
|
+
: {}),
|
|
308
|
+
identityUncertainty: [...probe.identityUncertainty],
|
|
309
|
+
});
|
|
310
|
+
const identity = deriveDeclarationIdentity({
|
|
311
|
+
hostScope: tenant,
|
|
312
|
+
clone: { cloneId: clone.cloneId },
|
|
313
|
+
worktree: { worktreeId: worktree.worktreeId },
|
|
314
|
+
});
|
|
315
|
+
const declaration = {
|
|
316
|
+
tenant,
|
|
317
|
+
principal: decision.principal,
|
|
318
|
+
...(probe.workspaceFingerprint !== undefined
|
|
319
|
+
? { hostFingerprint: probe.workspaceFingerprint }
|
|
320
|
+
: {}),
|
|
321
|
+
identityUncertainty: [...probe.identityUncertainty],
|
|
322
|
+
declarationId: identity.declarationId,
|
|
323
|
+
cloneId: identity.cloneId,
|
|
324
|
+
worktreeId: identity.worktreeId,
|
|
325
|
+
authorizedRoots: [probe.worktreeRealpath],
|
|
326
|
+
liveCapability: EXPLICIT_LIVE_CAPABILITY,
|
|
327
|
+
policyVersion: POLICY_VERSION,
|
|
328
|
+
declarationRevision: INITIAL_DECLARATION_REVISION,
|
|
329
|
+
};
|
|
330
|
+
const checked = validateWorkspaceDeclaration(declaration);
|
|
331
|
+
if (!checked.ok) {
|
|
332
|
+
throw new Error(`invalid live workspace declaration: ${checked.errors.join("; ")}`);
|
|
333
|
+
}
|
|
334
|
+
const existing = store.get(declaration.declarationId);
|
|
335
|
+
if (existing !== undefined) {
|
|
336
|
+
// Once per worktree: replay the existing declaration, no revision bump.
|
|
337
|
+
return { declaration: existing, created: false };
|
|
338
|
+
}
|
|
339
|
+
const timestamp = now();
|
|
340
|
+
const record = {
|
|
341
|
+
kind: LIVE_DECLARATION_KIND,
|
|
342
|
+
schemaVersion: LIVE_DECLARATION_SCHEMA_VERSION,
|
|
343
|
+
declaration,
|
|
344
|
+
clone,
|
|
345
|
+
worktree,
|
|
346
|
+
createdAt: timestamp,
|
|
347
|
+
activatedAt: timestamp,
|
|
348
|
+
updatedAt: timestamp,
|
|
349
|
+
};
|
|
350
|
+
store.insert(record);
|
|
351
|
+
return { declaration: record, created: true };
|
|
352
|
+
},
|
|
353
|
+
list() {
|
|
354
|
+
authorize("list");
|
|
355
|
+
return store.list();
|
|
356
|
+
},
|
|
357
|
+
status(path) {
|
|
358
|
+
authorize("status", { path });
|
|
359
|
+
return findByAuthorizedRoot(path);
|
|
360
|
+
},
|
|
361
|
+
resolvePath(path) {
|
|
362
|
+
authorize("resolve", { path });
|
|
363
|
+
const resolved = resolveInputPath(path);
|
|
364
|
+
let best;
|
|
365
|
+
let bestMatchedLength = -1;
|
|
366
|
+
for (const record of store.list()) {
|
|
367
|
+
for (const rootPath of record.declaration.authorizedRoots) {
|
|
368
|
+
if (resolved !== rootPath && !resolved.startsWith(rootPath + "/"))
|
|
369
|
+
continue;
|
|
370
|
+
const relativePath = resolved === rootPath ? "" : resolved.slice(rootPath.length + 1);
|
|
371
|
+
if (best === undefined || rootPath.length > bestMatchedLength) {
|
|
372
|
+
best = { declaration: record, relativePath };
|
|
373
|
+
bestMatchedLength = rootPath.length;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return best;
|
|
378
|
+
},
|
|
379
|
+
remove(request) {
|
|
380
|
+
authorize("remove", { path: request.path });
|
|
381
|
+
const record = findByAuthorizedRoot(request.path);
|
|
382
|
+
if (record === undefined) {
|
|
383
|
+
return { removed: false, canceledWork: false, purgeRequested: false };
|
|
384
|
+
}
|
|
385
|
+
const scope = {
|
|
386
|
+
declarationId: record.declaration.declarationId,
|
|
387
|
+
cloneId: record.declaration.cloneId,
|
|
388
|
+
};
|
|
389
|
+
// Stop work and reject delayed jobs BEFORE unregistering; then purge
|
|
390
|
+
// private local snapshots. Committed history is never touched here.
|
|
391
|
+
const canceledWork = workController.cancelScheduledWork(scope);
|
|
392
|
+
const purgeRequested = workController.requestPrivatePurge(scope);
|
|
393
|
+
const revocation = buildRevocation(record, request.reason);
|
|
394
|
+
store.remove(record.declaration.declarationId);
|
|
395
|
+
return { removed: true, canceledWork, purgeRequested, revocation };
|
|
396
|
+
},
|
|
397
|
+
removeClone(request) {
|
|
398
|
+
authorize("remove-clone");
|
|
399
|
+
// Withdrawing a whole clone revokes EACH of its declarations, one
|
|
400
|
+
// unambiguous revocation per declaration (contract §L6a).
|
|
401
|
+
const targets = store
|
|
402
|
+
.list()
|
|
403
|
+
.filter((record) => record.declaration.cloneId === request.cloneId);
|
|
404
|
+
const revocations = [];
|
|
405
|
+
let canceledWork = false;
|
|
406
|
+
let purgeRequested = false;
|
|
407
|
+
for (const record of targets) {
|
|
408
|
+
const scope = {
|
|
409
|
+
declarationId: record.declaration.declarationId,
|
|
410
|
+
cloneId: record.declaration.cloneId,
|
|
411
|
+
};
|
|
412
|
+
canceledWork = workController.cancelScheduledWork(scope) || canceledWork;
|
|
413
|
+
purgeRequested = workController.requestPrivatePurge(scope) || purgeRequested;
|
|
414
|
+
revocations.push(buildRevocation(record, request.reason));
|
|
415
|
+
store.remove(record.declaration.declarationId);
|
|
416
|
+
}
|
|
417
|
+
return { removed: revocations.length, revocations, canceledWork, purgeRequested };
|
|
418
|
+
},
|
|
419
|
+
rebind(request) {
|
|
420
|
+
authorize("rebind", { path: request.path });
|
|
421
|
+
const record = findByAuthorizedRoot(request.path);
|
|
422
|
+
if (record === undefined) {
|
|
423
|
+
throw new Error(`no live declaration for path: ${request.path}`);
|
|
424
|
+
}
|
|
425
|
+
const scope = {
|
|
426
|
+
declarationId: record.declaration.declarationId,
|
|
427
|
+
cloneId: record.declaration.cloneId,
|
|
428
|
+
};
|
|
429
|
+
// In-flight collection/publication cannot be redirected by a rebind.
|
|
430
|
+
if (workController.hasInFlightWork(scope)) {
|
|
431
|
+
throw new LiveAccessRefused("rebind", "in_flight_work_cannot_be_redirected");
|
|
432
|
+
}
|
|
433
|
+
const nextBindingRevision = (record.declaration.bindingRevision ?? 0) + 1;
|
|
434
|
+
return store.update(record.declaration.declarationId, record.declaration.declarationRevision, (current) => ({
|
|
435
|
+
...current,
|
|
436
|
+
declaration: {
|
|
437
|
+
...current.declaration,
|
|
438
|
+
serverWorkspaceId: request.sentropicWorkspaceId,
|
|
439
|
+
serverIssuer: request.issuer,
|
|
440
|
+
bindingRevision: nextBindingRevision,
|
|
441
|
+
declarationRevision: current.declaration.declarationRevision + 1,
|
|
442
|
+
},
|
|
443
|
+
updatedAt: now(),
|
|
444
|
+
}));
|
|
445
|
+
},
|
|
446
|
+
replay() {
|
|
447
|
+
authorize("replay");
|
|
448
|
+
return store.list();
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
// Re-export the consumed lifecycle vocabulary for host compositors that
|
|
453
|
+
// classify events without importing the neutral package directly.
|
|
454
|
+
export { NON_ACTIVATING_LIFECYCLE_KINDS };
|
|
455
|
+
//# sourceMappingURL=live-registration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-registration.js","sourceRoot":"","sources":["../../src/gateway-host/live-registration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,8BAA8B,EAC9B,cAAc,EACd,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,oCAAoC,CAAC;AAW5C,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,0BAA0B,GAG3B,MAAM,wBAAwB,CAAC;AAEhC,8EAA8E;AAC9E,mEAAmE;AACnE,8EAA8E;AAC9E,EAAE;AACF,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AAEtE,MAAM,UAAU,oBAAoB,CAAC,IAA2B;IAC9D,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CA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AAS,EAAE,GAAG,EAAE;aACjB,CAAC,CACH,CAAC;QACJ,CAAC;QACD,MAAM;YACJ,SAAS,CAAC,QAAQ,CAAC,CAAC;YACpB,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,wEAAwE;AACxE,kEAAkE;AAClE,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* h2a embedded gateway model catalog — H0 mirror of the published #662
|
|
3
|
+
* surface (llm-mesh 0.26.0 / llm-gateway 0.20.0).
|
|
4
|
+
*
|
|
5
|
+
* Canonical routing knowledge stays in llm-mesh; this module only names the
|
|
6
|
+
* model ids `h2a run --model` accepts and normalizes readable aliases to
|
|
7
|
+
* their exact canonical id (identity-only normalization, no cross-model
|
|
8
|
+
* mapping). Unknown names resolve to undefined so the exact-model default
|
|
9
|
+
* never silently maps them.
|
|
10
|
+
*/
|
|
11
|
+
export declare const GEMINI_4_ARGON = "gemini-4-argon";
|
|
12
|
+
export declare const GEMINI_3_8_FLASH = "gemini-3.8-flash";
|
|
13
|
+
export declare const MUSE_SPARK_1_3 = "muse-spark-1.3";
|
|
14
|
+
export declare const MUSE_SPARK_1_3_CONTRIBUTOR = "muse-spark-1.3-contributor";
|
|
15
|
+
export declare const MUSE_WONDER_1_0 = "muse-wonder-1.0";
|
|
16
|
+
export declare const MUSE_WONDER_FULL_1_0 = "muse-wonder-full-1.0";
|
|
17
|
+
export declare const GATEWAY_MODEL_IDS: readonly ["gemini-4-argon", "gemini-3.8-flash", "muse-spark-1.3", "muse-spark-1.3-contributor", "muse-wonder-1.0", "muse-wonder-full-1.0"];
|
|
18
|
+
export type GatewayModelId = (typeof GATEWAY_MODEL_IDS)[number];
|
|
19
|
+
/** Readable aliases accepted by `h2a run --model` (spec §6.6). */
|
|
20
|
+
export declare const GATEWAY_MODEL_ALIASES: Readonly<Record<string, GatewayModelId>>;
|
|
21
|
+
export declare function isKnownGatewayModel(value: string): value is GatewayModelId;
|
|
22
|
+
/** Identity-only normalization: alias → canonical id, else undefined. */
|
|
23
|
+
export declare function resolveGatewayModelAlias(value: string): GatewayModelId | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Claude-family gateway mapping (spec §6.6): requested alias family →
|
|
26
|
+
* cloud slot (Gemini) and Muse slot. Effort is advisory; the mesh validates
|
|
27
|
+
* it against transport capability. Unmentioned legacy families keep llm-mesh's
|
|
28
|
+
* own table and are absent here by design.
|
|
29
|
+
*/
|
|
30
|
+
export type ClaudeGatewaySlot = {
|
|
31
|
+
readonly cloud: GatewayModelId;
|
|
32
|
+
readonly cloudEffort: string;
|
|
33
|
+
readonly muse: GatewayModelId;
|
|
34
|
+
readonly museEffort: string;
|
|
35
|
+
};
|
|
36
|
+
export declare const CLAUDE_GATEWAY_MODEL_MAP: Readonly<Record<string, ClaudeGatewaySlot>>;
|
|
37
|
+
export declare function claudeGatewaySlot(family: string): ClaudeGatewaySlot | undefined;
|
|
38
|
+
//# sourceMappingURL=model-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../src/gateway-model-catalog/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AACvE,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,eAAO,MAAM,iBAAiB,4IAOpB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,EAAE,QAA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