codex-chatgpt-control 0.5.1-alpha.2 → 0.5.1-alpha.4
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 +42 -0
- package/README.md +43 -0
- package/contracts/v1/fixtures/backend-capabilities.json +40 -1
- package/contracts/v1/fixtures/backend-compatibility.json +21 -0
- package/contracts/v1/fixtures/backend-version.json +6 -1
- package/contracts/v1/fixtures/download-blocked-by-browser.json +22 -0
- package/contracts/v1/fixtures/download-receipt-failed.json +22 -0
- package/contracts/v1/fixtures/download-receipt-timeout.json +22 -0
- package/contracts/v1/fixtures/journal-rpc-indeterminate.json +32 -0
- package/contracts/v1/fixtures/journal-rpc-unsupported-platform.json +32 -0
- package/contracts/v1/fixtures/journal-runtime-unavailable.json +32 -0
- package/contracts/v1/fixtures/operation-action-prepared-event.json +42 -0
- package/contracts/v1/fixtures/operation-action.json +13 -0
- package/contracts/v1/fixtures/operation-artifact-receipt.json +14 -0
- package/contracts/v1/fixtures/operation-artifact-transfer-intent-event.json +24 -0
- package/contracts/v1/fixtures/operation-artifact-transfer-receipt-event.json +26 -0
- package/contracts/v1/fixtures/operation-artifact-transfer-state.json +178 -0
- package/contracts/v1/fixtures/operation-blocker.json +10 -0
- package/contracts/v1/fixtures/operation-collect-request.json +17 -0
- package/contracts/v1/fixtures/operation-collect-result.json +42 -0
- package/contracts/v1/fixtures/operation-control-receipt.json +13 -0
- package/contracts/v1/fixtures/operation-control-request.json +18 -0
- package/contracts/v1/fixtures/operation-control-result.json +31 -0
- package/contracts/v1/fixtures/operation-event.json +18 -0
- package/contracts/v1/fixtures/operation-handle.json +10 -0
- package/contracts/v1/fixtures/operation-inspect-request.json +13 -0
- package/contracts/v1/fixtures/operation-inspect-result.json +205 -0
- package/contracts/v1/fixtures/operation-ownership-baseline-event.json +34 -0
- package/contracts/v1/fixtures/operation-receipt.json +32 -0
- package/contracts/v1/fixtures/operation-recovery-decision.json +7 -0
- package/contracts/v1/fixtures/operation-recovery-observation.json +12 -0
- package/contracts/v1/fixtures/operation-request.json +33 -0
- package/contracts/v1/fixtures/operation-state.json +144 -0
- package/contracts/v1/fixtures/operation-submission-witness-event.json +20 -0
- package/contracts/v1/fixtures/operation-submission-witness.json +11 -0
- package/contracts/v1/fixtures/operation-submit-result.json +16 -0
- package/contracts/v1/fixtures/operation-target-established-event.json +21 -0
- package/contracts/v1/manifest.json +185 -1
- package/contracts/v1/parity-suite.json +106 -8
- package/contracts/v1/schemas/backend-compatibility.schema.json +65 -0
- package/contracts/v1/schemas/backend-request.schema.json +8 -2
- package/contracts/v1/schemas/capabilities.schema.json +81 -1
- package/contracts/v1/schemas/manifest.schema.json +57 -0
- package/contracts/v1/schemas/operation-action.schema.json +155 -0
- package/contracts/v1/schemas/operation-artifact-receipt.schema.json +89 -0
- package/contracts/v1/schemas/operation-blocker.schema.json +70 -0
- package/contracts/v1/schemas/operation-collect-request.schema.json +46 -0
- package/contracts/v1/schemas/operation-collect-result.schema.json +74 -0
- package/contracts/v1/schemas/operation-control-receipt.schema.json +108 -0
- package/contracts/v1/schemas/operation-control-request.schema.json +111 -0
- package/contracts/v1/schemas/operation-control-result.schema.json +112 -0
- package/contracts/v1/schemas/operation-event.schema.json +756 -0
- package/contracts/v1/schemas/operation-handle.schema.json +55 -0
- package/contracts/v1/schemas/operation-inspect-request.schema.json +42 -0
- package/contracts/v1/schemas/operation-inspect-result.schema.json +1662 -0
- package/contracts/v1/schemas/operation-receipt.schema.json +153 -0
- package/contracts/v1/schemas/operation-recovery.schema.json +314 -0
- package/contracts/v1/schemas/operation-request.schema.json +158 -0
- package/contracts/v1/schemas/operation-state.schema.json +691 -0
- package/contracts/v1/schemas/operation-submission-witness.schema.json +48 -0
- package/contracts/v1/schemas/operation-submit-result.schema.json +94 -0
- package/contracts/v1/surface-drift-policy.json +50 -0
- package/contracts/v1/vectors/operation-request-digest-v1.json +43 -0
- package/dist/codex-chatgpt-control-backend.mjs +45882 -9361
- package/dist/codex-chatgpt-control-journal.mjs +5547 -0
- package/dist/codex-chatgpt-control-live-smoke.bundle.mjs +51677 -0
- package/dist/codex-chatgpt-control-release-canary.bundle.mjs +52104 -0
- package/dist/codex-chatgpt-control.bundle.mjs +48392 -10260
- package/dist/src/backend/client.d.ts +103 -2
- package/dist/src/backend/client.js +1436 -97
- package/dist/src/backend/compatibility.d.ts +12 -0
- package/dist/src/backend/compatibility.js +208 -0
- package/dist/src/backend/protocol.d.ts +84 -1
- package/dist/src/backend/protocol.js +31 -5
- package/dist/src/backend/runtime-identity.d.ts +10 -0
- package/dist/src/backend/runtime-identity.js +141 -0
- package/dist/src/backend/session.d.ts +10 -2
- package/dist/src/backend/session.js +478 -7
- package/dist/src/backend/stdio-server.d.ts +4 -1
- package/dist/src/backend/stdio-server.js +240 -28
- package/dist/src/browser/active-composer-file-input.d.ts +9 -0
- package/dist/src/browser/active-composer-file-input.js +33 -0
- package/dist/src/browser/attach.d.ts +4 -1
- package/dist/src/browser/attach.js +136 -28
- package/dist/src/browser/chatgpt-url.d.ts +2 -0
- package/dist/src/browser/chatgpt-url.js +9 -0
- package/dist/src/browser/downloads.d.ts +17 -1
- package/dist/src/browser/downloads.js +150 -28
- package/dist/src/browser/page-state.js +6 -0
- package/dist/src/client.d.ts +43 -0
- package/dist/src/client.js +1279 -59
- package/dist/src/commands/artifacts.js +6 -4
- package/dist/src/commands/chat-popover.d.ts +37 -0
- package/dist/src/commands/chat-popover.js +537 -0
- package/dist/src/commands/configuration.d.ts +5 -0
- package/dist/src/commands/configuration.js +134 -21
- package/dist/src/commands/context.js +10 -3
- package/dist/src/commands/doctor.d.ts +1 -1
- package/dist/src/commands/doctor.js +27 -4
- package/dist/src/commands/experience.d.ts +5 -0
- package/dist/src/commands/experience.js +104 -21
- package/dist/src/commands/files.js +14 -33
- package/dist/src/commands/modes.js +85 -21
- package/dist/src/commands/power-discovery.d.ts +130 -0
- package/dist/src/commands/power-discovery.js +669 -0
- package/dist/src/commands/project-sources.js +325 -31
- package/dist/src/commands/sequence.js +59 -32
- package/dist/src/commands/session.js +19 -6
- package/dist/src/commands/work.js +31 -0
- package/dist/src/dom/composer-text.d.ts +6 -0
- package/dist/src/dom/composer-text.js +85 -0
- package/dist/src/errors.d.ts +9 -0
- package/dist/src/errors.js +22 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.js +9 -0
- package/dist/src/operations/artifact-output.d.ts +69 -0
- package/dist/src/operations/artifact-output.js +1748 -0
- package/dist/src/operations/artifact-stream.d.ts +19 -0
- package/dist/src/operations/artifact-stream.js +35 -0
- package/dist/src/operations/artifact-transfer.d.ts +149 -0
- package/dist/src/operations/artifact-transfer.js +1312 -0
- package/dist/src/operations/browser-adapter.d.ts +167 -0
- package/dist/src/operations/browser-adapter.js +2103 -0
- package/dist/src/operations/browser-observation.d.ts +110 -0
- package/dist/src/operations/browser-observation.js +1256 -0
- package/dist/src/operations/browser-target.d.ts +105 -0
- package/dist/src/operations/browser-target.js +531 -0
- package/dist/src/operations/canonical.d.ts +4 -0
- package/dist/src/operations/canonical.js +412 -0
- package/dist/src/operations/chatgpt-runtime.d.ts +72 -0
- package/dist/src/operations/chatgpt-runtime.js +1232 -0
- package/dist/src/operations/client.d.ts +138 -0
- package/dist/src/operations/client.js +1145 -0
- package/dist/src/operations/collector.d.ts +195 -0
- package/dist/src/operations/collector.js +1039 -0
- package/dist/src/operations/configuration-routing.d.ts +4 -0
- package/dist/src/operations/configuration-routing.js +14 -0
- package/dist/src/operations/control.d.ts +372 -0
- package/dist/src/operations/control.js +1498 -0
- package/dist/src/operations/file-identity.d.ts +33 -0
- package/dist/src/operations/file-identity.js +153 -0
- package/dist/src/operations/handle.d.ts +19 -0
- package/dist/src/operations/handle.js +727 -0
- package/dist/src/operations/index.d.ts +25 -0
- package/dist/src/operations/index.js +25 -0
- package/dist/src/operations/journal-authority.d.ts +12 -0
- package/dist/src/operations/journal-authority.js +1 -0
- package/dist/src/operations/journal-rpc-client.d.ts +12 -0
- package/dist/src/operations/journal-rpc-client.js +225 -0
- package/dist/src/operations/journal-rpc-protocol.d.ts +32 -0
- package/dist/src/operations/journal-rpc-protocol.js +214 -0
- package/dist/src/operations/journal-rpc-server.d.ts +15 -0
- package/dist/src/operations/journal-rpc-server.js +272 -0
- package/dist/src/operations/journal.d.ts +143 -0
- package/dist/src/operations/journal.js +1957 -0
- package/dist/src/operations/production-attachments.d.ts +118 -0
- package/dist/src/operations/production-attachments.js +1035 -0
- package/dist/src/operations/production-chatgpt-artifacts.d.ts +74 -0
- package/dist/src/operations/production-chatgpt-artifacts.js +1146 -0
- package/dist/src/operations/production-chatgpt-attachments.d.ts +80 -0
- package/dist/src/operations/production-chatgpt-attachments.js +1639 -0
- package/dist/src/operations/production-configuration.d.ts +42 -0
- package/dist/src/operations/production-configuration.js +1544 -0
- package/dist/src/operations/production-primitives.d.ts +53 -0
- package/dist/src/operations/production-primitives.js +856 -0
- package/dist/src/operations/production-work-steer.d.ts +203 -0
- package/dist/src/operations/production-work-steer.js +1218 -0
- package/dist/src/operations/recovery.d.ts +80 -0
- package/dist/src/operations/recovery.js +174 -0
- package/dist/src/operations/runtime-adapter.d.ts +126 -0
- package/dist/src/operations/runtime-adapter.js +802 -0
- package/dist/src/operations/send-once.d.ts +224 -0
- package/dist/src/operations/send-once.js +1081 -0
- package/dist/src/operations/service.d.ts +286 -0
- package/dist/src/operations/service.js +2831 -0
- package/dist/src/operations/staging.d.ts +136 -0
- package/dist/src/operations/staging.js +630 -0
- package/dist/src/operations/state-machine.d.ts +29 -0
- package/dist/src/operations/state-machine.js +2047 -0
- package/dist/src/operations/submission.d.ts +423 -0
- package/dist/src/operations/submission.js +1676 -0
- package/dist/src/operations/transactional-chat-power.d.ts +17 -0
- package/dist/src/operations/transactional-chat-power.js +212 -0
- package/dist/src/operations/turn-ownership.d.ts +202 -0
- package/dist/src/operations/turn-ownership.js +700 -0
- package/dist/src/operations/types.d.ts +454 -0
- package/dist/src/operations/types.js +20 -0
- package/dist/src/operations/wire-requests.d.ts +21 -0
- package/dist/src/operations/wire-requests.js +396 -0
- package/dist/src/operations/wire-results.d.ts +97 -0
- package/dist/src/operations/wire-results.js +818 -0
- package/dist/src/runner/responses.d.ts +3 -1
- package/dist/src/runner/responses.js +19 -1
- package/dist/src/runner/result.js +227 -55
- package/dist/src/runner/types.d.ts +12 -0
- package/dist/src/runtime/command-routing.d.ts +149 -0
- package/dist/src/runtime/command-routing.js +431 -0
- package/dist/src/runtime/coordinated-browser.d.ts +24 -0
- package/dist/src/runtime/coordinated-browser.js +315 -0
- package/dist/src/runtime/coordinated-page.d.ts +41 -0
- package/dist/src/runtime/coordinated-page.js +651 -0
- package/dist/src/runtime/operation-context.d.ts +142 -0
- package/dist/src/runtime/operation-context.js +410 -0
- package/dist/src/runtime/runtime-session.d.ts +95 -0
- package/dist/src/runtime/runtime-session.js +314 -0
- package/dist/src/runtime/tab-coordinator.d.ts +200 -0
- package/dist/src/runtime/tab-coordinator.js +1200 -0
- package/dist/src/runtime/value-boundaries.d.ts +18 -0
- package/dist/src/runtime/value-boundaries.js +49 -0
- package/dist/src/safety/blockers.js +8 -1
- package/dist/src/safety/untrusted-output.js +2 -1
- package/dist/src/scripts/backend-server.js +4 -1
- package/dist/src/scripts/capture-surface-profile.js +7 -2
- package/dist/src/scripts/journal-server.d.ts +2 -0
- package/dist/src/scripts/journal-server.js +37 -0
- package/dist/src/scripts/live-smoke/harness.js +79 -7
- package/dist/src/scripts/live-smoke/scenarios.d.ts +42 -1
- package/dist/src/scripts/live-smoke/scenarios.js +147 -30
- package/dist/src/scripts/live-smoke/transactional.d.ts +17 -0
- package/dist/src/scripts/live-smoke/transactional.js +254 -0
- package/dist/src/scripts/live-smoke/types.d.ts +3 -0
- package/dist/src/scripts/release-canary-module.js +17 -4
- package/dist/src/types.d.ts +38 -1
- package/package.json +8 -3
- package/references/2026-08-16-transactional-operations.md +459 -0
- package/references/2026-09-06-journal-service.md +140 -0
- package/references/agents-runner.md +34 -0
- package/references/backend-protocol.md +176 -0
- package/references/python-parity.md +137 -0
- package/references/responses-adapter.md +19 -0
- package/references/streaming.md +6 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal source-to-file streaming boundary.
|
|
3
|
+
*
|
|
4
|
+
* A provider owns the bytes it yields. The local output sink must therefore
|
|
5
|
+
* copy a chunk before its first asynchronous effect. The transfer wrapper
|
|
6
|
+
* already crosses that ownership boundary before it hands a source to the
|
|
7
|
+
* output sink; the weak set lets the sink use that defensive copy directly
|
|
8
|
+
* instead of allocating a second full-sized copy.
|
|
9
|
+
*
|
|
10
|
+
* This module is intentionally not re-exported from the public operations
|
|
11
|
+
* barrel. Its marker is an implementation detail, not a wire/API contract.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Keep one hostile provider allocation well below the 512 MiB artifact cap.
|
|
15
|
+
* Built-in download adapters yield 64 KiB chunks and are unaffected.
|
|
16
|
+
*/
|
|
17
|
+
export declare const MAX_PROVIDER_CHUNK_BYTES: number;
|
|
18
|
+
export declare function copyProviderChunk(value: unknown, maxBytes?: number): Uint8Array;
|
|
19
|
+
export declare function isOwnedProviderChunk(value: unknown): value is Uint8Array;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isByteArrayView } from "../runtime/value-boundaries.js";
|
|
2
|
+
/**
|
|
3
|
+
* Internal source-to-file streaming boundary.
|
|
4
|
+
*
|
|
5
|
+
* A provider owns the bytes it yields. The local output sink must therefore
|
|
6
|
+
* copy a chunk before its first asynchronous effect. The transfer wrapper
|
|
7
|
+
* already crosses that ownership boundary before it hands a source to the
|
|
8
|
+
* output sink; the weak set lets the sink use that defensive copy directly
|
|
9
|
+
* instead of allocating a second full-sized copy.
|
|
10
|
+
*
|
|
11
|
+
* This module is intentionally not re-exported from the public operations
|
|
12
|
+
* barrel. Its marker is an implementation detail, not a wire/API contract.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Keep one hostile provider allocation well below the 512 MiB artifact cap.
|
|
16
|
+
* Built-in download adapters yield 64 KiB chunks and are unaffected.
|
|
17
|
+
*/
|
|
18
|
+
export const MAX_PROVIDER_CHUNK_BYTES = 8 * 1024 * 1024;
|
|
19
|
+
const ownedChunks = new WeakSet();
|
|
20
|
+
export function copyProviderChunk(value, maxBytes = MAX_PROVIDER_CHUNK_BYTES) {
|
|
21
|
+
const allowedBytes = Number.isSafeInteger(maxBytes) && maxBytes >= 0
|
|
22
|
+
? Math.min(maxBytes, MAX_PROVIDER_CHUNK_BYTES)
|
|
23
|
+
: -1;
|
|
24
|
+
if (!isByteArrayView(value)
|
|
25
|
+
|| allowedBytes < 0
|
|
26
|
+
|| value.byteLength > allowedBytes) {
|
|
27
|
+
throw new Error("provider chunk is invalid or oversized");
|
|
28
|
+
}
|
|
29
|
+
const copy = new Uint8Array(value);
|
|
30
|
+
ownedChunks.add(copy);
|
|
31
|
+
return copy;
|
|
32
|
+
}
|
|
33
|
+
export function isOwnedProviderChunk(value) {
|
|
34
|
+
return isByteArrayView(value) && ownedChunks.has(value);
|
|
35
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transfer coordinator is deliberately provider agnostic. A provider
|
|
3
|
+
* supplies one already-authorized, exact artifact stream; this module owns
|
|
4
|
+
* the local effect, its durable intent, and its collision/recovery rules.
|
|
5
|
+
*
|
|
6
|
+
* The absolute destination is kept in the active call only. It is included
|
|
7
|
+
* in the keyed destination evidence supplied by the caller, but is never
|
|
8
|
+
* copied into an intent, receipt, lookup, or error.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ARTIFACT_TRANSFER_SCHEMA_VERSION: "chatgpt.browser_control.artifact_transfer.v1";
|
|
11
|
+
export declare const ARTIFACT_TRANSFER_INTENT_SCHEMA_VERSION: "chatgpt.browser_control.artifact_transfer_intent.v1";
|
|
12
|
+
export declare const ARTIFACT_TRANSFER_RECEIPT_SCHEMA_VERSION: "chatgpt.browser_control.artifact_transfer_receipt.v1";
|
|
13
|
+
declare const SCHEMA_VERSION: "chatgpt.browser_control.artifact_transfer.v1";
|
|
14
|
+
declare const INTENT_SCHEMA_VERSION: "chatgpt.browser_control.artifact_transfer_intent.v1";
|
|
15
|
+
declare const RECEIPT_SCHEMA_VERSION: "chatgpt.browser_control.artifact_transfer_receipt.v1";
|
|
16
|
+
export type ArtifactTransferKind = "file" | "image" | "other";
|
|
17
|
+
export type ArtifactTransferOutcome = "satisfied" | "not_satisfied" | "uncertain";
|
|
18
|
+
export type ArtifactTransferStatus = "transferred" | "partial" | "blocked";
|
|
19
|
+
export type ArtifactTransferPersistence = "not_attempted" | "durable" | "indeterminate";
|
|
20
|
+
export type ArtifactTransferLimits = Readonly<{
|
|
21
|
+
maxBytes?: number;
|
|
22
|
+
maxStringBytes?: number;
|
|
23
|
+
maxCount?: number;
|
|
24
|
+
maxDepth?: number;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* No provider labels, filenames, bytes, URLs, or paths cross this callback.
|
|
28
|
+
* The callback must return the one exact source selected by the operation's
|
|
29
|
+
* assistant-turn/artifact identity.
|
|
30
|
+
*/
|
|
31
|
+
export type ArtifactTransferSourceRequest = Readonly<{
|
|
32
|
+
operationId: string;
|
|
33
|
+
requestDigest: string;
|
|
34
|
+
targetBindingDigest: string;
|
|
35
|
+
assistantTurnId: string;
|
|
36
|
+
sourceIdentityDigest: string;
|
|
37
|
+
kind: ArtifactTransferKind;
|
|
38
|
+
ordinal: number;
|
|
39
|
+
transferActionId: string;
|
|
40
|
+
destinationIdentityDigest: string;
|
|
41
|
+
}>;
|
|
42
|
+
export type ArtifactTransferOpenSource = (request: ArtifactTransferSourceRequest) => Promise<AsyncIterable<Uint8Array>>;
|
|
43
|
+
export type ArtifactTransferLookup = Readonly<{
|
|
44
|
+
operationId: string;
|
|
45
|
+
requestDigest: string;
|
|
46
|
+
targetBindingDigest: string;
|
|
47
|
+
assistantTurnId: string;
|
|
48
|
+
sourceIdentityDigest: string;
|
|
49
|
+
kind: ArtifactTransferKind;
|
|
50
|
+
ordinal: number;
|
|
51
|
+
transferActionId: string;
|
|
52
|
+
destinationIdentityDigest: string;
|
|
53
|
+
}>;
|
|
54
|
+
export type ArtifactTransferIntentV1 = Readonly<{
|
|
55
|
+
schemaVersion: typeof INTENT_SCHEMA_VERSION;
|
|
56
|
+
operationId: string;
|
|
57
|
+
requestDigest: string;
|
|
58
|
+
targetBindingDigest: string;
|
|
59
|
+
assistantTurnId: string;
|
|
60
|
+
sourceIdentityDigest: string;
|
|
61
|
+
kind: ArtifactTransferKind;
|
|
62
|
+
ordinal: number;
|
|
63
|
+
transferActionId: string;
|
|
64
|
+
destinationIdentityDigest: string;
|
|
65
|
+
actionKind: "local_output_commit";
|
|
66
|
+
repeatPolicy: "reconcile_local_effect";
|
|
67
|
+
intentAt: string;
|
|
68
|
+
}>;
|
|
69
|
+
export type ArtifactTransferReceiptV1 = Readonly<{
|
|
70
|
+
schemaVersion: typeof RECEIPT_SCHEMA_VERSION;
|
|
71
|
+
operationId: string;
|
|
72
|
+
requestDigest: string;
|
|
73
|
+
targetBindingDigest: string;
|
|
74
|
+
assistantTurnId: string;
|
|
75
|
+
sourceIdentityDigest: string;
|
|
76
|
+
kind: ArtifactTransferKind;
|
|
77
|
+
ordinal: number;
|
|
78
|
+
transferActionId: string;
|
|
79
|
+
destinationIdentityDigest: string;
|
|
80
|
+
outputKey?: string;
|
|
81
|
+
bytes?: number;
|
|
82
|
+
sha256?: string;
|
|
83
|
+
status: ArtifactTransferStatus;
|
|
84
|
+
blockerCode?: string;
|
|
85
|
+
observedAt: string;
|
|
86
|
+
}>;
|
|
87
|
+
export type ArtifactTransferDurableState = Readonly<{
|
|
88
|
+
intent?: ArtifactTransferIntentV1;
|
|
89
|
+
receipt?: ArtifactTransferReceiptV1;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* Journal-like ports are intentionally narrower than OperationJournal. An
|
|
93
|
+
* adapter can translate these records into action_intent/action_receipt
|
|
94
|
+
* events while retaining the journal's expected-revision/CAS semantics.
|
|
95
|
+
* Every port argument is path-free and already identity-bound.
|
|
96
|
+
*/
|
|
97
|
+
export type ArtifactTransferJournalPort = Readonly<{
|
|
98
|
+
readActionState: (lookup: ArtifactTransferLookup) => Promise<unknown>;
|
|
99
|
+
persistIntent: (intent: ArtifactTransferIntentV1) => Promise<void>;
|
|
100
|
+
persistReceipt: (receipt: ArtifactTransferReceiptV1) => Promise<void>;
|
|
101
|
+
}>;
|
|
102
|
+
export type ArtifactTransferEvidenceDigest = (domain: string, material: unknown) => string | Promise<string>;
|
|
103
|
+
export type ArtifactTransferOptions = Readonly<{
|
|
104
|
+
operationId: string;
|
|
105
|
+
requestDigest: string;
|
|
106
|
+
targetBindingDigest: string;
|
|
107
|
+
assistantTurnId: string;
|
|
108
|
+
sourceIdentityDigest: string;
|
|
109
|
+
kind: ArtifactTransferKind;
|
|
110
|
+
ordinal: number;
|
|
111
|
+
transferActionId: string;
|
|
112
|
+
/** Request-only absolute destination. Never retained by durable records. */
|
|
113
|
+
outputDirectory: string;
|
|
114
|
+
evidenceDigest: ArtifactTransferEvidenceDigest;
|
|
115
|
+
openSource: ArtifactTransferOpenSource;
|
|
116
|
+
journal: ArtifactTransferJournalPort;
|
|
117
|
+
signal?: AbortSignal;
|
|
118
|
+
deadlineAt?: number;
|
|
119
|
+
/** Testable clock; its output is used only for deadline/timestamp checks. */
|
|
120
|
+
now?: () => number;
|
|
121
|
+
limits?: ArtifactTransferLimits;
|
|
122
|
+
extensionHint?: string;
|
|
123
|
+
mimeTypeHint?: string;
|
|
124
|
+
}>;
|
|
125
|
+
export type ArtifactTransferResult = Readonly<{
|
|
126
|
+
schemaVersion: typeof SCHEMA_VERSION;
|
|
127
|
+
outcome: ArtifactTransferOutcome;
|
|
128
|
+
replayed: boolean;
|
|
129
|
+
/** Whether the intent write is known to have reached durable journal state. */
|
|
130
|
+
intentPersistence: ArtifactTransferPersistence;
|
|
131
|
+
/** Whether the receipt write is known to have reached durable journal state. */
|
|
132
|
+
receiptPersistence: ArtifactTransferPersistence;
|
|
133
|
+
receipt?: ArtifactTransferReceiptV1;
|
|
134
|
+
blockerCode?: string;
|
|
135
|
+
}>;
|
|
136
|
+
export declare class ArtifactTransferError extends Error {
|
|
137
|
+
readonly code: string;
|
|
138
|
+
constructor(code: string, message: string);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Transfer one exact operation-owned artifact. This function is safe to
|
|
142
|
+
* invoke repeatedly with the same action identity: completed receipts are
|
|
143
|
+
* replayed without provider access, and concurrent identical calls share one
|
|
144
|
+
* source/commit attempt.
|
|
145
|
+
*/
|
|
146
|
+
export declare function transferOperationArtifact(options: ArtifactTransferOptions): Promise<ArtifactTransferResult>;
|
|
147
|
+
/** Short additive alias for callers that prefer the noun-first operation name. */
|
|
148
|
+
export declare const transferArtifact: typeof transferOperationArtifact;
|
|
149
|
+
export {};
|