@sentropic/artifacts 0.2.17 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +14 -0
- package/dist/adapters/github-forge.d.ts +4 -0
- package/dist/adapters/github-forge.js +88 -0
- package/dist/adapters/github-git-port.d.ts +5 -0
- package/dist/adapters/github-git-port.js +102 -0
- package/dist/adapters/github-http.d.ts +5 -0
- package/dist/adapters/github-http.js +57 -0
- package/dist/adapters/github-receive-pack.d.ts +4 -0
- package/dist/adapters/github-receive-pack.js +49 -0
- package/dist/adapters/postgres-git-bindings.d.ts +7 -0
- package/dist/adapters/postgres-git-bindings.js +131 -0
- package/dist/adapters/postgres-live.d.ts +4 -0
- package/dist/adapters/postgres-live.js +97 -0
- package/dist/adapters/postgres.d.ts +1 -0
- package/dist/adapters/postgres.js +1 -0
- package/dist/git-tool-definitions.d.ts +606 -0
- package/dist/git-tool-definitions.js +14 -0
- package/dist/http.d.ts +9 -0
- package/dist/http.js +31 -2
- package/dist/index.d.ts +14 -0
- package/dist/index.js +13 -0
- package/dist/live-host/accept.d.ts +30 -0
- package/dist/live-host/accept.js +43 -0
- package/dist/live-host/api.d.ts +67 -0
- package/dist/live-host/api.js +60 -0
- package/dist/live-host/candidate.d.ts +21 -0
- package/dist/live-host/candidate.js +41 -0
- package/dist/live-host/errors.d.ts +9 -0
- package/dist/live-host/errors.js +14 -0
- package/dist/live-host/handoff.d.ts +63 -0
- package/dist/live-host/handoff.js +66 -0
- package/dist/live-host/index.d.ts +10 -0
- package/dist/live-host/index.js +10 -0
- package/dist/live-host/keys.d.ts +14 -0
- package/dist/live-host/keys.js +8 -0
- package/dist/live-host/live-format.d.ts +70 -0
- package/dist/live-host/live-format.js +100 -0
- package/dist/live-host/recheck.d.ts +59 -0
- package/dist/live-host/recheck.js +45 -0
- package/dist/mcp-core.d.ts +3 -3
- package/dist/mcp-core.js +18 -2
- package/dist/profile/contracts.d.ts +1 -1
- package/dist/profile/contracts.js +4 -0
- package/dist/profile/index.js +8 -1
- package/dist/profile/schemas.js +19 -0
- package/dist/profile/validation.js +5 -1
- package/dist/server/build-contract.d.ts +64 -0
- package/dist/server/build-contract.js +58 -0
- package/dist/server/build-dependencies.d.ts +3 -0
- package/dist/server/build-dependencies.js +122 -0
- package/dist/server/consent-grant.d.ts +91 -0
- package/dist/server/consent-grant.js +89 -0
- package/dist/server/consent-screen.d.ts +21 -0
- package/dist/server/consent-screen.js +52 -0
- package/dist/server/failures.d.ts +3 -2
- package/dist/server/failures.js +30 -0
- package/dist/server/git-bindings.d.ts +10 -0
- package/dist/server/git-bindings.js +138 -0
- package/dist/server/git-contracts.d.ts +115 -0
- package/dist/server/git-contracts.js +1 -0
- package/dist/server/git-port-policy.d.ts +9 -0
- package/dist/server/git-port-policy.js +76 -0
- package/dist/server/git-port-read.d.ts +3 -0
- package/dist/server/git-port-read.js +95 -0
- package/dist/server/git-port-session.d.ts +38 -0
- package/dist/server/git-port-session.js +59 -0
- package/dist/server/git-port-tree.d.ts +8 -0
- package/dist/server/git-port-tree.js +92 -0
- package/dist/server/git-port-write.d.ts +6 -0
- package/dist/server/git-port-write.js +102 -0
- package/dist/server/git-port.d.ts +147 -0
- package/dist/server/git-port.js +8 -0
- package/dist/server/git-projection.d.ts +16 -0
- package/dist/server/git-projection.js +20 -0
- package/dist/server/git-registry.d.ts +37 -0
- package/dist/server/git-registry.js +39 -0
- package/dist/server/git-tools-attach.d.ts +8 -0
- package/dist/server/git-tools-attach.js +139 -0
- package/dist/server/git-tools-contracts.d.ts +59 -0
- package/dist/server/git-tools-contracts.js +1 -0
- package/dist/server/git-tools-fetch.d.ts +21 -0
- package/dist/server/git-tools-fetch.js +65 -0
- package/dist/server/git-tools-publish.d.ts +13 -0
- package/dist/server/git-tools-publish.js +66 -0
- package/dist/server/git-tools.d.ts +4 -0
- package/dist/server/git-tools.js +18 -0
- package/dist/server/live-body.d.ts +3 -0
- package/dist/server/live-body.js +28 -0
- package/dist/server/live-commit-outcome.d.ts +6 -0
- package/dist/server/live-commit-outcome.js +10 -0
- package/dist/server/live-commit.d.ts +11 -0
- package/dist/server/live-commit.js +133 -0
- package/dist/server/live-contracts.d.ts +62 -0
- package/dist/server/live-contracts.js +8 -0
- package/dist/server/live-crypto.d.ts +14 -0
- package/dist/server/live-crypto.js +50 -0
- package/dist/server/live-drafts.d.ts +61 -0
- package/dist/server/live-drafts.js +119 -0
- package/dist/server/live-errors.d.ts +23 -0
- package/dist/server/live-errors.js +9 -0
- package/dist/server/live-mutations.d.ts +18 -0
- package/dist/server/live-mutations.js +83 -0
- package/dist/server/live-read.d.ts +15 -0
- package/dist/server/live-read.js +95 -0
- package/dist/server/live-service.d.ts +3 -0
- package/dist/server/live-service.js +181 -0
- package/dist/server/live-store.d.ts +111 -0
- package/dist/server/live-store.js +80 -0
- package/dist/server/live-tree.d.ts +22 -0
- package/dist/server/live-tree.js +148 -0
- package/dist/server/live-worker.d.ts +10 -0
- package/dist/server/live-worker.js +55 -0
- package/dist/server/templates.js +26 -1
- package/migrations/0010_git_bindings.sql +82 -0
- package/migrations/0011_live_drafts.sql +42 -0
- package/migrations/0012_git_attach_intents.sql +19 -0
- package/package.json +17 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GIT_TOOL_DEFINITIONS } from '../git-tool-definitions.js';
|
|
2
|
+
import { matchesSchema } from '../profile/validation.js';
|
|
3
|
+
import { ArtifactOperationError } from './failures.js';
|
|
4
|
+
import { attachGit } from './git-tools-attach.js';
|
|
5
|
+
import { fetchAppSource } from './git-tools-fetch.js';
|
|
6
|
+
import { publishGit } from './git-tools-publish.js';
|
|
7
|
+
const OPERATIONS = { fetch_app_source: fetchAppSource, git_attach: attachGit, git_publish: publishGit };
|
|
8
|
+
/** SG3 executors for the three tools routed by createHttpArtifactApp; every port is injected by the host. */
|
|
9
|
+
export function createGitToolService(deps) {
|
|
10
|
+
return { async execute(operation, raw, invocation) {
|
|
11
|
+
const run = Object.hasOwn(OPERATIONS, operation) ? OPERATIONS[operation] : undefined;
|
|
12
|
+
const args = structuredClone(raw);
|
|
13
|
+
if (!run || !matchesSchema(args, GIT_TOOL_DEFINITIONS[`artifacts_${operation}`].inputSchema)) {
|
|
14
|
+
throw new ArtifactOperationError('invalid_request');
|
|
15
|
+
}
|
|
16
|
+
return run(deps, args, invocation);
|
|
17
|
+
} };
|
|
18
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function isLiveBodyStream(value: unknown): value is AsyncIterable<Uint8Array>;
|
|
2
|
+
/** Count decompressed wire bytes before allocation/parse; host adapters may pass the request stream. */
|
|
3
|
+
export declare function readBoundedLiveJson(body: AsyncIterable<Uint8Array>, operation: string): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ArtifactOperationError } from './failures.js';
|
|
2
|
+
export function isLiveBodyStream(value) {
|
|
3
|
+
return value !== null && typeof value === 'object' && Symbol.asyncIterator in value &&
|
|
4
|
+
typeof value[Symbol.asyncIterator] === 'function';
|
|
5
|
+
}
|
|
6
|
+
/** Count decompressed wire bytes before allocation/parse; host adapters may pass the request stream. */
|
|
7
|
+
export async function readBoundedLiveJson(body, operation) {
|
|
8
|
+
const maximum = (operation === 'git_commit' ? 64 : 16) * 1024 * 1024;
|
|
9
|
+
const chunks = [];
|
|
10
|
+
let size = 0;
|
|
11
|
+
for await (const chunk of body) {
|
|
12
|
+
if (!(chunk instanceof Uint8Array))
|
|
13
|
+
throw new ArtifactOperationError('invalid_request');
|
|
14
|
+
size += chunk.byteLength;
|
|
15
|
+
if (size > maximum)
|
|
16
|
+
throw new ArtifactOperationError('limit_exceeded');
|
|
17
|
+
chunks.push(chunk.slice());
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const value = JSON.parse(new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(Buffer.concat(chunks)));
|
|
21
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
22
|
+
throw new Error('object required');
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
throw new ArtifactOperationError('invalid_request');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ArtifactOperationError } from './failures.js';
|
|
2
|
+
/** Mint only after a forge side effect or while reconciling that invocation's durable intent. */
|
|
3
|
+
export declare class LiveCommitUnknownError extends ArtifactOperationError {
|
|
4
|
+
readonly commitState: "unknown";
|
|
5
|
+
constructor(cause: unknown);
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ArtifactOperationError } from './failures.js';
|
|
2
|
+
/** Mint only after a forge side effect or while reconciling that invocation's durable intent. */
|
|
3
|
+
export class LiveCommitUnknownError extends ArtifactOperationError {
|
|
4
|
+
commitState = 'unknown';
|
|
5
|
+
constructor(cause) {
|
|
6
|
+
const denied = cause instanceof ArtifactOperationError && cause.kind === 'access_denied';
|
|
7
|
+
super(denied ? 'access_denied' : 'git_live_conflict', { cause,
|
|
8
|
+
...(denied ? {} : { publicDetails: { reason: 'commit_indeterminate' } }) });
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type LiveAuthority, type LiveInvocation, type LiveServiceDeps } from './live-contracts.js';
|
|
2
|
+
import type { LiveCommand, LiveIdentity } from './live-store.js';
|
|
3
|
+
export declare function executeLiveCommit(input: {
|
|
4
|
+
deps: LiveServiceDeps;
|
|
5
|
+
identity: LiveIdentity;
|
|
6
|
+
authority: LiveAuthority;
|
|
7
|
+
invocation: LiveInvocation;
|
|
8
|
+
args: Record<string, any>;
|
|
9
|
+
command: LiveCommand;
|
|
10
|
+
now: number;
|
|
11
|
+
}): Promise<Record<string, any>>;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { ArtifactOperationError } from './failures.js';
|
|
3
|
+
import { readLiveOverlay } from './live-drafts.js';
|
|
4
|
+
import { applyLiveMutation, liveTreeSha, validateLiveMutation } from './live-tree.js';
|
|
5
|
+
import { orderedDigest } from '../profile/json.js';
|
|
6
|
+
import { liveBusy } from './live-mutations.js';
|
|
7
|
+
import { liveResponse } from './live-contracts.js';
|
|
8
|
+
import { LiveCommitUnknownError } from './live-commit-outcome.js';
|
|
9
|
+
import { isGitSha } from './git-port-policy.js';
|
|
10
|
+
import { settleLiveWorker } from './live-worker.js';
|
|
11
|
+
export async function executeLiveCommit(input) {
|
|
12
|
+
const { deps, identity, authority, invocation, args, command, now } = input;
|
|
13
|
+
if (!isGitSha(args.expectedHeadSha))
|
|
14
|
+
throw new ArtifactOperationError('invalid_request');
|
|
15
|
+
if (!args.message.trim() || args.message.length > (deps.gitMessageMaxUnits ?? 16384) ||
|
|
16
|
+
/^Artifacts-(?:Artifact|Invocation|Base):/mi.test(args.message))
|
|
17
|
+
throw new ArtifactOperationError('invalid_request');
|
|
18
|
+
const prepared = await deps.store.transaction(identity, async (tx) => {
|
|
19
|
+
const record = tx.record;
|
|
20
|
+
if (!record)
|
|
21
|
+
throw new ArtifactOperationError('git_live_no_changes');
|
|
22
|
+
const current = await deps.authorize(invocation, identity.artifactId);
|
|
23
|
+
if (!current.canReadCode || !current.canWrite || !current.humanLinked || current.ownerId !== invocation.actorId ||
|
|
24
|
+
current.binding.generation !== identity.bindingGeneration || current.binding.state !== 'attached')
|
|
25
|
+
throw new ArtifactOperationError('access_denied');
|
|
26
|
+
validateLiveMutation(current.repository, current.target, args, 255, 8 * 1024 * 1024);
|
|
27
|
+
const prior = await tx.receipt(command.actorId, command.key);
|
|
28
|
+
if (prior) {
|
|
29
|
+
if (prior.hash !== command.hash)
|
|
30
|
+
throw new ArtifactOperationError('command_conflict');
|
|
31
|
+
return { result: { ...prior.result, replayed: true } };
|
|
32
|
+
}
|
|
33
|
+
if (record.pendingCommit && (record.pendingCommit.hash !== command.hash || record.pendingCommit.key !== command.key ||
|
|
34
|
+
record.pendingCommit.actorId !== invocation.actorId))
|
|
35
|
+
liveBusy('commit_indeterminate');
|
|
36
|
+
if (!record.pendingCommit && !['DORMANT', 'LIVE', 'REVIVING'].includes(record.runtime?.phase ?? 'DORMANT'))
|
|
37
|
+
liveBusy('invalid_phase');
|
|
38
|
+
const overlay = await readLiveOverlay(tx, deps.keys);
|
|
39
|
+
if (record.pendingCommit)
|
|
40
|
+
return { intent: record.pendingCommit, overlay };
|
|
41
|
+
if (!record.changedPaths)
|
|
42
|
+
throw new ArtifactOperationError('git_live_no_changes');
|
|
43
|
+
await tx.reserveCommit(invocation.actorId, invocation.invocationId, new Date(now).toISOString());
|
|
44
|
+
const head = await deps.git.resolveRef(authority.target, authority.binding.branch);
|
|
45
|
+
if (!isGitSha(head) || head.length !== args.expectedHeadSha.length)
|
|
46
|
+
throw new ArtifactOperationError('invalid_request');
|
|
47
|
+
if (args.expectedHeadSha !== head)
|
|
48
|
+
throw new ArtifactOperationError('git_head_moved', { publicDetails: { expectedHeadSha: args.expectedHeadSha, actualHeadSha: head } });
|
|
49
|
+
if (record.baseHeadSha !== head)
|
|
50
|
+
throw new ArtifactOperationError('git_live_draft_conflict');
|
|
51
|
+
if (!deps.git.snapshot)
|
|
52
|
+
throw new ArtifactOperationError('capability_unselected');
|
|
53
|
+
const base = await deps.git.snapshot(authority.target, head);
|
|
54
|
+
const candidate = await applyLiveMutation(deps.git, authority.target, base, head, [], args);
|
|
55
|
+
if (liveTreeSha(base, candidate, authority.target) !== record.liveTreeSha || JSON.stringify(candidate) !== JSON.stringify(overlay)) {
|
|
56
|
+
throw new ArtifactOperationError('git_live_snapshot_mismatch');
|
|
57
|
+
}
|
|
58
|
+
record.pendingCommit = { actorId: command.actorId, key: command.key, hash: command.hash,
|
|
59
|
+
invocationId: invocation.invocationId, createdAt: new Date(now).toISOString(), message: args.message,
|
|
60
|
+
expectedHeadSha: head, revision: record.revision, liveTreeSha: record.liveTreeSha,
|
|
61
|
+
policyDigest: orderedDigest({ ownerId: current.ownerId, repoId: current.binding.repoId,
|
|
62
|
+
generation: identity.bindingGeneration, writablePaths: current.repository.writablePaths,
|
|
63
|
+
refusedWritePaths: current.repository.refusedWritePaths }) };
|
|
64
|
+
return { intent: record.pendingCommit, overlay };
|
|
65
|
+
});
|
|
66
|
+
if (prepared.result)
|
|
67
|
+
return prepared.result;
|
|
68
|
+
const { intent, overlay } = prepared;
|
|
69
|
+
let committed;
|
|
70
|
+
try {
|
|
71
|
+
const head = await deps.git.resolveRef(authority.target, authority.binding.branch);
|
|
72
|
+
if (head !== intent.expectedHeadSha) {
|
|
73
|
+
const observed = await deps.git.inspectCommit(authority.target, head);
|
|
74
|
+
if (observed.parents.length !== 1 || observed.parents[0] !== intent.expectedHeadSha ||
|
|
75
|
+
observed.treeSha !== intent.liveTreeSha || !observed.message.split('\n').includes(`Artifacts-Invocation: ${intent.invocationId}`)) {
|
|
76
|
+
liveBusy('commit_indeterminate');
|
|
77
|
+
}
|
|
78
|
+
committed = { commitSha: observed.sha, treeSha: observed.treeSha };
|
|
79
|
+
}
|
|
80
|
+
else
|
|
81
|
+
committed = await deps.git.commit({ target: authority.target, artifactId: identity.artifactId,
|
|
82
|
+
invocationId: intent.invocationId, createdAt: intent.createdAt, message: intent.message,
|
|
83
|
+
expectedHeadSha: intent.expectedHeadSha, files: overlay.map(({ path, text }) => ({ path, text })),
|
|
84
|
+
});
|
|
85
|
+
if (committed.treeSha !== intent.liveTreeSha)
|
|
86
|
+
liveBusy('commit_indeterminate');
|
|
87
|
+
}
|
|
88
|
+
catch (cause) {
|
|
89
|
+
if (cause instanceof ArtifactOperationError && !['provider_unavailable', 'git_head_moved', 'git_live_conflict'].includes(cause.kind)) {
|
|
90
|
+
await deps.store.transaction(identity, async (tx) => {
|
|
91
|
+
if (tx.record?.pendingCommit?.invocationId === intent.invocationId)
|
|
92
|
+
tx.record.pendingCommit = null;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// A concurrent execution of this intent may have won the forge CAS. Preserve it for reconciliation.
|
|
96
|
+
if (cause instanceof ArtifactOperationError && (cause.kind === 'provider_unavailable' || cause.kind === 'git_head_moved' ||
|
|
97
|
+
cause.kind === 'git_live_conflict' && cause.details.publicDetails?.reason === 'commit_indeterminate'))
|
|
98
|
+
throw new LiveCommitUnknownError(cause);
|
|
99
|
+
throw cause;
|
|
100
|
+
}
|
|
101
|
+
const result = await deps.store.transaction(identity, async (tx) => {
|
|
102
|
+
const prior = await tx.receipt(command.actorId, command.key);
|
|
103
|
+
if (prior)
|
|
104
|
+
return { ...prior.result, replayed: true };
|
|
105
|
+
const record = tx.record;
|
|
106
|
+
if (record.pendingCommit?.invocationId !== intent.invocationId || record.revision !== intent.revision)
|
|
107
|
+
liveBusy('stale_fence');
|
|
108
|
+
const current = await deps.authorize(invocation, identity.artifactId);
|
|
109
|
+
if (!current.canReadCode || !current.canWrite || !current.humanLinked || current.ownerId !== invocation.actorId)
|
|
110
|
+
throw new ArtifactOperationError('access_denied');
|
|
111
|
+
if (current.binding.generation !== identity.bindingGeneration || current.binding.state !== 'attached')
|
|
112
|
+
liveBusy('stale_fence');
|
|
113
|
+
await tx.advanceBinding?.({ expectedHeadSha: intent.expectedHeadSha, commitSha: committed.commitSha,
|
|
114
|
+
invocationId: intent.invocationId, actorId: invocation.actorId, now: new Date(now).toISOString() });
|
|
115
|
+
Object.assign(record, { revision: randomUUID(), baseHeadSha: committed.commitSha, baseTreeSha: committed.treeSha,
|
|
116
|
+
liveTreeSha: committed.treeSha, objectRef: null, keyVersion: null, digest: null, expiresAt: null,
|
|
117
|
+
changedPaths: 0, draftBytes: 0, tombstone: null, pendingCommit: null,
|
|
118
|
+
latestVerifiedHeadSha: committed.commitSha, progressSeq: record.progressSeq + (record.latestVerifiedHeadSha === committed.commitSha ? 0 : 1),
|
|
119
|
+
lastProgressEventId: 'commit:' + intent.invocationId, updatedAt: new Date(now).toISOString() });
|
|
120
|
+
if (record.runtime)
|
|
121
|
+
Object.assign(record.runtime, { sourceRevision: record.revision,
|
|
122
|
+
baseHeadSha: committed.commitSha, liveTreeSha: committed.treeSha });
|
|
123
|
+
const result = { ...liveResponse(record, committed.commitSha, now), revision: record.revision,
|
|
124
|
+
commitSha: committed.commitSha, treeSha: committed.treeSha, parentSha: intent.expectedHeadSha,
|
|
125
|
+
publicationIntent: authority.binding.autoPublish ? 'deferred' : null, replayed: false };
|
|
126
|
+
await tx.complete(command, result);
|
|
127
|
+
return result;
|
|
128
|
+
}).catch(cause => { throw new LiveCommitUnknownError(cause); });
|
|
129
|
+
if (!result.replayed && ['LIVE', 'REVIVING'].includes(String(result.runtimeState))) {
|
|
130
|
+
void settleLiveWorker({ deps, identity, action: 'project', result, now });
|
|
131
|
+
}
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { GitBinding } from './git-contracts.js';
|
|
2
|
+
import type { GitPort, GitPortRepository, GitPortTarget } from './git-port.js';
|
|
3
|
+
import type { LiveKeyPort } from './live-crypto.js';
|
|
4
|
+
import type { LiveDraftRecord, LiveIdentity, LiveStore, LiveTransaction } from './live-store.js';
|
|
5
|
+
export interface LiveInvocation {
|
|
6
|
+
actorId: string;
|
|
7
|
+
storageScopeId: string;
|
|
8
|
+
invocationId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LiveAuthority {
|
|
11
|
+
binding: GitBinding;
|
|
12
|
+
ownerId: string;
|
|
13
|
+
canReadCode: boolean;
|
|
14
|
+
canWrite: boolean;
|
|
15
|
+
humanLinked: boolean;
|
|
16
|
+
qualified: boolean;
|
|
17
|
+
invited?: boolean;
|
|
18
|
+
repository: GitPortRepository;
|
|
19
|
+
target: GitPortTarget;
|
|
20
|
+
}
|
|
21
|
+
export interface LiveWorkerPort {
|
|
22
|
+
/** Trusted controller reads the authoritative store; no draft key or store API enters the worker. */
|
|
23
|
+
reconcile(identity: LiveIdentity): Promise<void | {
|
|
24
|
+
liveSessionId: string;
|
|
25
|
+
leaseEpoch: number;
|
|
26
|
+
routeEpoch: number;
|
|
27
|
+
revision: string;
|
|
28
|
+
ready: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
/** Confirms quiescence, durable checkpoint and complete pod/volume decommissioning. */
|
|
31
|
+
stop(input: LiveIdentity & {
|
|
32
|
+
liveSessionId: string;
|
|
33
|
+
leaseEpoch: number;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
export interface LiveServiceDeps {
|
|
37
|
+
store: LiveStore;
|
|
38
|
+
keys: LiveKeyPort;
|
|
39
|
+
git: GitPort;
|
|
40
|
+
worker?: LiveWorkerPort;
|
|
41
|
+
authorize(invocation: LiveInvocation, artifactId: string): Promise<LiveAuthority>;
|
|
42
|
+
now?: () => number;
|
|
43
|
+
/** Narrower qualified git_commit limits; never above 255 paths / 8 MiB. */
|
|
44
|
+
commitPathsMax?: number;
|
|
45
|
+
commitBytesMax?: number;
|
|
46
|
+
gitMessageMaxUnits?: number;
|
|
47
|
+
idempotencyKeyMaxUnits?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface LiveService {
|
|
50
|
+
execute(operation: string, args: Record<string, unknown>, invocation: LiveInvocation): Promise<Record<string, any>>;
|
|
51
|
+
}
|
|
52
|
+
export declare function liveResponse(record: LiveDraftRecord, currentHeadSha: string, now?: number): Record<string, unknown>;
|
|
53
|
+
export type LiveSessionTransaction = LiveTransaction;
|
|
54
|
+
export type LiveSnapshot = {
|
|
55
|
+
actorId: string;
|
|
56
|
+
revision: string;
|
|
57
|
+
baseHeadSha: string;
|
|
58
|
+
paths?: string[];
|
|
59
|
+
offset: number;
|
|
60
|
+
kind: 'read' | 'diff';
|
|
61
|
+
expiresAt: number;
|
|
62
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function liveResponse(record, currentHeadSha, now = Date.now()) {
|
|
2
|
+
return { artifactId: record.artifactId, bindingGeneration: record.bindingGeneration,
|
|
3
|
+
liveRevision: record.revision, revision: record.revision, baseHeadSha: record.baseHeadSha, currentHeadSha,
|
|
4
|
+
liveTreeSha: record.liveTreeSha, durableRevision: record.revision,
|
|
5
|
+
appliedRevision: record.runtime?.appliedRevision ?? null, draftExpiresAt: record.expiresAt,
|
|
6
|
+
runtimeState: record.runtime?.phase ?? 'DORMANT', liveSessionId: record.runtime?.liveSessionId ?? null,
|
|
7
|
+
retentionWarning: record.expiresAt && Date.parse(record.expiresAt) - now < 86400000 ? 'expires_within_24_hours' : null };
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LiveDraftRecord, LiveEnvelope, LiveIdentity, LiveOverlayEntry } from './live-store.js';
|
|
2
|
+
export interface LiveKeyPort {
|
|
3
|
+
/** Host envelope custody returns a per-binding data key, never a worker credential. */
|
|
4
|
+
current(identity: LiveIdentity): Promise<{
|
|
5
|
+
version: string;
|
|
6
|
+
key: Uint8Array;
|
|
7
|
+
}>;
|
|
8
|
+
resolve(identity: LiveIdentity, version: string): Promise<Uint8Array>;
|
|
9
|
+
}
|
|
10
|
+
export declare const liveDigest: (bytes: string | Uint8Array) => string;
|
|
11
|
+
export declare const liveTextValid: (text: string) => boolean;
|
|
12
|
+
export declare function overlayBytes(overlay: LiveOverlayEntry[]): number;
|
|
13
|
+
export declare function encryptLiveDraft(record: LiveDraftRecord, text: string, keys: LiveKeyPort): Promise<LiveEnvelope>;
|
|
14
|
+
export declare function decryptLiveDraft(record: LiveDraftRecord, envelope: LiveEnvelope, keys: LiveKeyPort): Promise<LiveOverlayEntry[]>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createCipheriv, createDecipheriv, createHash, randomBytes } from 'node:crypto';
|
|
2
|
+
import { ArtifactOperationError } from './failures.js';
|
|
3
|
+
export const liveDigest = (bytes) => createHash('sha256').update(bytes).digest('hex');
|
|
4
|
+
export const liveTextValid = (text) => !/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]|\u0000/.test(text);
|
|
5
|
+
export function overlayBytes(overlay) {
|
|
6
|
+
const paths = new Set();
|
|
7
|
+
if (overlay.length > 255)
|
|
8
|
+
throw new ArtifactOperationError('limit_exceeded');
|
|
9
|
+
for (const entry of overlay) {
|
|
10
|
+
if (!entry.path || Buffer.byteLength(entry.path) > 1024 || paths.has(entry.path) ||
|
|
11
|
+
!['100644', '100755'].includes(entry.mode) || (entry.text !== null && !liveTextValid(entry.text))) {
|
|
12
|
+
throw new ArtifactOperationError('invalid_request');
|
|
13
|
+
}
|
|
14
|
+
paths.add(entry.path);
|
|
15
|
+
if (entry.text !== null && Buffer.byteLength(entry.text) > 1024 * 1024)
|
|
16
|
+
throw new ArtifactOperationError('limit_exceeded');
|
|
17
|
+
}
|
|
18
|
+
const bytes = Buffer.byteLength(JSON.stringify(overlay));
|
|
19
|
+
if (bytes > 8 * 1024 * 1024)
|
|
20
|
+
throw new ArtifactOperationError('limit_exceeded');
|
|
21
|
+
return bytes;
|
|
22
|
+
}
|
|
23
|
+
function aad(record) {
|
|
24
|
+
return Buffer.from(JSON.stringify([record.storageScopeId, record.artifactId, record.bindingGeneration,
|
|
25
|
+
record.revision, record.baseHeadSha, record.expiresAt, record.digest, record.keyVersion]));
|
|
26
|
+
}
|
|
27
|
+
export async function encryptLiveDraft(record, text, keys) {
|
|
28
|
+
const key = await keys.current(record);
|
|
29
|
+
if (key.key.byteLength !== 32 || !key.version)
|
|
30
|
+
throw new Error('invalid draft key');
|
|
31
|
+
record.keyVersion = key.version;
|
|
32
|
+
const nonce = randomBytes(12);
|
|
33
|
+
const cipher = createCipheriv('aes-256-gcm', key.key, nonce);
|
|
34
|
+
cipher.setAAD(aad(record));
|
|
35
|
+
const encrypted = Buffer.concat([cipher.update(text, 'utf8'), cipher.final()]);
|
|
36
|
+
return { nonce: nonce.toString('base64'), ciphertext: encrypted.toString('base64'), tag: cipher.getAuthTag().toString('base64') };
|
|
37
|
+
}
|
|
38
|
+
export async function decryptLiveDraft(record, envelope, keys) {
|
|
39
|
+
const key = await keys.resolve(record, record.keyVersion);
|
|
40
|
+
const decipher = createDecipheriv('aes-256-gcm', key, Buffer.from(envelope.nonce, 'base64'));
|
|
41
|
+
decipher.setAAD(aad(record));
|
|
42
|
+
decipher.setAuthTag(Buffer.from(envelope.tag, 'base64'));
|
|
43
|
+
const bytes = Buffer.concat([decipher.update(Buffer.from(envelope.ciphertext, 'base64')), decipher.final()]);
|
|
44
|
+
if (liveDigest(bytes) !== record.digest)
|
|
45
|
+
throw new Error('invalid draft digest');
|
|
46
|
+
const overlay = JSON.parse(bytes.toString('utf8'));
|
|
47
|
+
if (overlayBytes(overlay) !== record.draftBytes || overlay.length !== record.changedPaths)
|
|
48
|
+
throw new Error('invalid draft size');
|
|
49
|
+
return overlay;
|
|
50
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type LiveKeyPort } from './live-crypto.js';
|
|
2
|
+
import type { LiveCommand, LiveDraftRecord, LiveIdentity, LiveOverlayEntry, LiveStore, LiveTransaction } from './live-store.js';
|
|
3
|
+
export * from './live-store.js';
|
|
4
|
+
export type { LiveKeyPort } from './live-crypto.js';
|
|
5
|
+
export declare const LIVE_RETENTION_MS: number;
|
|
6
|
+
export interface LiveDraftWrite {
|
|
7
|
+
identity: LiveIdentity;
|
|
8
|
+
expectedRevision: string | null;
|
|
9
|
+
baseHeadSha: string;
|
|
10
|
+
baseTreeSha: string;
|
|
11
|
+
liveTreeSha: string;
|
|
12
|
+
overlay: LiveOverlayEntry[];
|
|
13
|
+
command?: LiveCommand;
|
|
14
|
+
}
|
|
15
|
+
export declare function cleanLiveRecord(identity: LiveIdentity, head: string, tree: string, now?: number): LiveDraftRecord;
|
|
16
|
+
/** Expiry is a serialized tombstone; stale renewal and command replay cannot reverse it. */
|
|
17
|
+
export declare function expireLiveDraft(tx: LiveTransaction, now: number): boolean;
|
|
18
|
+
export declare function readLiveOverlay(tx: LiveTransaction, keys: LiveKeyPort): Promise<LiveOverlayEntry[]>;
|
|
19
|
+
export declare function persistLiveOverlay(tx: LiveTransaction, keys: LiveKeyPort, input: LiveDraftWrite, now: number, renew?: boolean, preserveRevision?: boolean): Promise<LiveDraftRecord>;
|
|
20
|
+
/** All public methods commit objects, pointers and command receipts together. */
|
|
21
|
+
export declare function createLiveDraftVault(deps: {
|
|
22
|
+
store: LiveStore;
|
|
23
|
+
keys: LiveKeyPort;
|
|
24
|
+
now?: () => number;
|
|
25
|
+
}): {
|
|
26
|
+
read(identity: LiveIdentity): Promise<{
|
|
27
|
+
overlay: LiveOverlayEntry[];
|
|
28
|
+
revision: string;
|
|
29
|
+
baseHeadSha: string;
|
|
30
|
+
baseTreeSha: string;
|
|
31
|
+
liveTreeSha: string;
|
|
32
|
+
objectRef: string | null;
|
|
33
|
+
keyVersion: string | null;
|
|
34
|
+
digest: string | null;
|
|
35
|
+
expiresAt: string | null;
|
|
36
|
+
changedPaths: number;
|
|
37
|
+
draftBytes: number;
|
|
38
|
+
tombstone: "expired" | "reset" | null;
|
|
39
|
+
runtime: import("./live-store.js").LiveRuntimeState | null;
|
|
40
|
+
pendingCommit: import("./live-store.js").LiveCommitIntent | null;
|
|
41
|
+
progressSeq: number;
|
|
42
|
+
latestVerifiedHeadSha: string;
|
|
43
|
+
publicationBaselineSeq: number;
|
|
44
|
+
publicationBaselineHeadSha: string;
|
|
45
|
+
lastSuccessfulReleaseId: string | null;
|
|
46
|
+
initialUnpublishedBranchEligible: boolean;
|
|
47
|
+
rowVersion: number;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
updatedAt: string;
|
|
50
|
+
lastProgressEventId: string | null;
|
|
51
|
+
snapshots?: Record<string, import("./live-contracts.js").LiveSnapshot> | undefined;
|
|
52
|
+
storageScopeId: string;
|
|
53
|
+
artifactId: string;
|
|
54
|
+
bindingGeneration: number;
|
|
55
|
+
} | undefined>;
|
|
56
|
+
collect(identity: LiveIdentity): Promise<number>;
|
|
57
|
+
write(input: LiveDraftWrite): Promise<LiveDraftRecord & {
|
|
58
|
+
replayed: boolean;
|
|
59
|
+
}>;
|
|
60
|
+
renew(identity: LiveIdentity, expectedRevision: string): Promise<LiveDraftRecord>;
|
|
61
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { ArtifactOperationError } from './failures.js';
|
|
3
|
+
import { decryptLiveDraft, encryptLiveDraft, liveDigest, overlayBytes } from './live-crypto.js';
|
|
4
|
+
export * from './live-store.js';
|
|
5
|
+
export const LIVE_RETENTION_MS = 7 * 24 * 3600 * 1000;
|
|
6
|
+
export function cleanLiveRecord(identity, head, tree, now = Date.now()) {
|
|
7
|
+
return { ...identity, revision: randomUUID(), baseHeadSha: head, baseTreeSha: tree, liveTreeSha: tree,
|
|
8
|
+
objectRef: null, keyVersion: null, digest: null, expiresAt: null, changedPaths: 0, draftBytes: 0,
|
|
9
|
+
tombstone: null, runtime: null, pendingCommit: null, progressSeq: 0, latestVerifiedHeadSha: head,
|
|
10
|
+
publicationBaselineSeq: 0, publicationBaselineHeadSha: head, lastSuccessfulReleaseId: null,
|
|
11
|
+
initialUnpublishedBranchEligible: false, rowVersion: 0, createdAt: new Date(now).toISOString(),
|
|
12
|
+
updatedAt: new Date(now).toISOString(), lastProgressEventId: null };
|
|
13
|
+
}
|
|
14
|
+
/** Expiry is a serialized tombstone; stale renewal and command replay cannot reverse it. */
|
|
15
|
+
export function expireLiveDraft(tx, now) {
|
|
16
|
+
const record = tx.record;
|
|
17
|
+
if (record?.expiresAt && Date.parse(record.expiresAt) <= now && record.tombstone !== 'expired') {
|
|
18
|
+
tx.record = { ...record, objectRef: null, keyVersion: null, digest: null, tombstone: 'expired' };
|
|
19
|
+
}
|
|
20
|
+
return tx.record?.tombstone === 'expired';
|
|
21
|
+
}
|
|
22
|
+
export async function readLiveOverlay(tx, keys) {
|
|
23
|
+
const record = tx.record;
|
|
24
|
+
if (record?.tombstone === 'expired')
|
|
25
|
+
throw new ArtifactOperationError('git_live_draft_expired', { publicDetails: { draftExpiresAt: record.expiresAt } });
|
|
26
|
+
if (!record?.objectRef)
|
|
27
|
+
return [];
|
|
28
|
+
try {
|
|
29
|
+
const envelope = await tx.getObject(record.objectRef);
|
|
30
|
+
if (!envelope)
|
|
31
|
+
throw new Error('missing draft');
|
|
32
|
+
return await decryptLiveDraft(record, envelope, keys);
|
|
33
|
+
}
|
|
34
|
+
catch (cause) {
|
|
35
|
+
throw new ArtifactOperationError('git_live_draft_unavailable', { cause });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export async function persistLiveOverlay(tx, keys, input, now, renew = true, preserveRevision = false) {
|
|
39
|
+
const overlay = [...input.overlay].sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
40
|
+
const size = overlayBytes(overlay);
|
|
41
|
+
const record = { ...(tx.record ?? cleanLiveRecord(input.identity, input.baseHeadSha, input.baseTreeSha, now)),
|
|
42
|
+
updatedAt: new Date(now).toISOString(),
|
|
43
|
+
revision: preserveRevision ? tx.record.revision : randomUUID(), baseHeadSha: input.baseHeadSha, baseTreeSha: input.baseTreeSha,
|
|
44
|
+
liveTreeSha: input.liveTreeSha, objectRef: randomUUID(), digest: liveDigest(JSON.stringify(overlay)),
|
|
45
|
+
changedPaths: overlay.length, draftBytes: size, tombstone: null,
|
|
46
|
+
expiresAt: renew ? new Date(now + LIVE_RETENTION_MS).toISOString() : tx.record?.expiresAt ?? null };
|
|
47
|
+
if (!overlay.length) {
|
|
48
|
+
Object.assign(record, { objectRef: null, keyVersion: null, digest: null, expiresAt: null, draftBytes: 0 });
|
|
49
|
+
tx.record = record;
|
|
50
|
+
return record;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
await tx.putObject(record.objectRef, await encryptLiveDraft(record, JSON.stringify(overlay), keys));
|
|
54
|
+
}
|
|
55
|
+
catch (cause) {
|
|
56
|
+
throw new ArtifactOperationError('git_live_draft_unavailable', { cause });
|
|
57
|
+
}
|
|
58
|
+
tx.record = record;
|
|
59
|
+
return record;
|
|
60
|
+
}
|
|
61
|
+
/** All public methods commit objects, pointers and command receipts together. */
|
|
62
|
+
export function createLiveDraftVault(deps) {
|
|
63
|
+
const now = deps.now ?? Date.now;
|
|
64
|
+
async function expire(identity) {
|
|
65
|
+
return deps.store.transaction(identity, async (tx) => expireLiveDraft(tx, now()));
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
async read(identity) {
|
|
69
|
+
await expire(identity);
|
|
70
|
+
return deps.store.transaction(identity, async (tx) => tx.record
|
|
71
|
+
? { ...tx.record, overlay: await readLiveOverlay(tx, deps.keys) } : undefined);
|
|
72
|
+
},
|
|
73
|
+
async collect(identity) {
|
|
74
|
+
return deps.store.transaction(identity, async (tx) => {
|
|
75
|
+
expireLiveDraft(tx, now());
|
|
76
|
+
return tx.collectObjects();
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
async write(input) {
|
|
80
|
+
const snapshot = structuredClone(input);
|
|
81
|
+
await expire(snapshot.identity);
|
|
82
|
+
return deps.store.transaction(snapshot.identity, async (tx) => {
|
|
83
|
+
if (snapshot.command) {
|
|
84
|
+
const prior = await tx.receipt(snapshot.command.actorId, snapshot.command.key);
|
|
85
|
+
if (prior) {
|
|
86
|
+
if (prior.hash !== snapshot.command.hash)
|
|
87
|
+
throw new ArtifactOperationError('command_conflict');
|
|
88
|
+
return { ...prior.result, replayed: true };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (tx.record?.tombstone === 'expired' || tx.record?.expiresAt && Date.parse(tx.record.expiresAt) <= now())
|
|
92
|
+
throw new ArtifactOperationError('git_live_draft_expired');
|
|
93
|
+
if ((tx.record?.revision ?? null) !== snapshot.expectedRevision)
|
|
94
|
+
throw new ArtifactOperationError('git_live_revision_moved');
|
|
95
|
+
const record = await persistLiveOverlay(tx, deps.keys, snapshot, now());
|
|
96
|
+
if (snapshot.command)
|
|
97
|
+
await tx.complete(snapshot.command, { ...record });
|
|
98
|
+
return { ...record, replayed: false };
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
async renew(identity, expectedRevision) {
|
|
102
|
+
await expire(identity);
|
|
103
|
+
return deps.store.transaction(identity, async (tx) => {
|
|
104
|
+
const record = tx.record;
|
|
105
|
+
if (record?.tombstone === 'expired' || record?.expiresAt && Date.parse(record.expiresAt) <= now())
|
|
106
|
+
throw new ArtifactOperationError('git_live_draft_expired');
|
|
107
|
+
if (!record || record.revision !== expectedRevision)
|
|
108
|
+
throw new ArtifactOperationError('git_live_revision_moved');
|
|
109
|
+
const overlay = await readLiveOverlay(tx, deps.keys);
|
|
110
|
+
if (!record.changedPaths)
|
|
111
|
+
return record;
|
|
112
|
+
const renewed = await persistLiveOverlay(tx, deps.keys, { identity, expectedRevision,
|
|
113
|
+
baseHeadSha: record.baseHeadSha, baseTreeSha: record.baseTreeSha,
|
|
114
|
+
liveTreeSha: record.liveTreeSha, overlay }, now(), true, true);
|
|
115
|
+
return renewed;
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Closed G0/A-LIVE server errors; worker and driver text never crosses this registry. */
|
|
2
|
+
export declare const LIVE_FAILURE_STATUS: {
|
|
3
|
+
readonly git_live_revision_moved: 409;
|
|
4
|
+
readonly git_live_snapshot_mismatch: 409;
|
|
5
|
+
readonly git_live_no_changes: 422;
|
|
6
|
+
readonly git_live_conflict: 409;
|
|
7
|
+
readonly git_live_draft_conflict: 409;
|
|
8
|
+
readonly git_live_snapshot_expired: 409;
|
|
9
|
+
readonly git_live_draft_expired: 410;
|
|
10
|
+
readonly git_live_draft_unavailable: 503;
|
|
11
|
+
readonly dependency_integrity_missing: 422;
|
|
12
|
+
readonly dependency_integrity_mismatch: 422;
|
|
13
|
+
readonly dependency_cache_invalid: 422;
|
|
14
|
+
readonly git_not_attached: 422;
|
|
15
|
+
readonly git_binding_paused: 409;
|
|
16
|
+
readonly git_diverged: 409;
|
|
17
|
+
readonly builder_unavailable: 503;
|
|
18
|
+
readonly git_auto_publish_refused: 422;
|
|
19
|
+
readonly git_build_job_mismatch: 409;
|
|
20
|
+
readonly git_sha_not_on_branch: 422;
|
|
21
|
+
};
|
|
22
|
+
export type LiveErrorCode = keyof typeof LIVE_FAILURE_STATUS;
|
|
23
|
+
export type LiveConflictReason = 'invalid_phase' | 'active_session' | 'pending_publication' | 'commit_indeterminate' | 'stale_session' | 'stale_fence' | 'transition_busy';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Closed G0/A-LIVE server errors; worker and driver text never crosses this registry. */
|
|
2
|
+
export const LIVE_FAILURE_STATUS = {
|
|
3
|
+
git_live_revision_moved: 409, git_live_snapshot_mismatch: 409, git_live_no_changes: 422,
|
|
4
|
+
git_live_conflict: 409, git_live_draft_conflict: 409, git_live_snapshot_expired: 409,
|
|
5
|
+
git_live_draft_expired: 410, git_live_draft_unavailable: 503,
|
|
6
|
+
dependency_integrity_missing: 422, dependency_integrity_mismatch: 422, dependency_cache_invalid: 422,
|
|
7
|
+
git_not_attached: 422, git_binding_paused: 409, git_diverged: 409, builder_unavailable: 503,
|
|
8
|
+
git_auto_publish_refused: 422, git_build_job_mismatch: 409, git_sha_not_on_branch: 422,
|
|
9
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type LiveBaseTree } from './live-tree.js';
|
|
2
|
+
import { type LiveAuthority, type LiveServiceDeps } from './live-contracts.js';
|
|
3
|
+
import type { LiveOverlayEntry, LiveTransaction } from './live-store.js';
|
|
4
|
+
export declare const liveBusy: (reason: import('./live-errors.js').LiveConflictReason) => never;
|
|
5
|
+
export declare function mutateLive(input: {
|
|
6
|
+
deps: LiveServiceDeps;
|
|
7
|
+
tx: LiveTransaction;
|
|
8
|
+
authority: LiveAuthority;
|
|
9
|
+
operation: string;
|
|
10
|
+
args: Record<string, any>;
|
|
11
|
+
base: LiveBaseTree;
|
|
12
|
+
overlay: LiveOverlayEntry[];
|
|
13
|
+
currentHeadSha: string;
|
|
14
|
+
now: number;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
result: Record<string, any>;
|
|
17
|
+
action: 'project' | 'stop' | null;
|
|
18
|
+
}>;
|