codex-chatgpt-control 0.5.1-alpha.2 → 0.5.1-alpha.3
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 +15 -0
- package/README.md +27 -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/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 +155 -1
- package/contracts/v1/parity-suite.json +96 -1
- 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 +43897 -9094
- package/dist/codex-chatgpt-control.bundle.mjs +46360 -10262
- 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/downloads.d.ts +2 -0
- package/dist/src/client.d.ts +38 -0
- package/dist/src/client.js +1222 -59
- package/dist/src/commands/configuration.js +13 -7
- package/dist/src/commands/doctor.d.ts +1 -1
- package/dist/src/commands/doctor.js +26 -3
- package/dist/src/commands/experience.js +35 -0
- package/dist/src/commands/files.js +4 -27
- package/dist/src/commands/modes.js +49 -17
- package/dist/src/commands/power-discovery.d.ts +130 -0
- package/dist/src/commands/power-discovery.js +627 -0
- package/dist/src/commands/project-sources.js +325 -31
- package/dist/src/commands/sequence.js +59 -32
- package/dist/src/commands/session.js +7 -2
- package/dist/src/commands/work.js +31 -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 +161 -0
- package/dist/src/operations/browser-adapter.js +2023 -0
- package/dist/src/operations/browser-observation.d.ts +110 -0
- package/dist/src/operations/browser-observation.js +1208 -0
- package/dist/src/operations/browser-target.d.ts +103 -0
- package/dist/src/operations/browser-target.js +489 -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 +1150 -0
- package/dist/src/operations/client.d.ts +138 -0
- package/dist/src/operations/client.js +1143 -0
- package/dist/src/operations/collector.d.ts +195 -0
- package/dist/src/operations/collector.js +1039 -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 +22 -0
- package/dist/src/operations/index.js +22 -0
- package/dist/src/operations/journal.d.ts +142 -0
- package/dist/src/operations/journal.js +1931 -0
- package/dist/src/operations/production-attachments.d.ts +116 -0
- package/dist/src/operations/production-attachments.js +1018 -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 +71 -0
- package/dist/src/operations/production-chatgpt-attachments.js +1563 -0
- package/dist/src/operations/production-configuration.d.ts +42 -0
- package/dist/src/operations/production-configuration.js +1363 -0
- package/dist/src/operations/production-primitives.d.ts +53 -0
- package/dist/src/operations/production-primitives.js +1073 -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 +118 -0
- package/dist/src/operations/runtime-adapter.js +786 -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 +281 -0
- package/dist/src/operations/service.js +2810 -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/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 +39 -0
- package/dist/src/runtime/coordinated-page.js +634 -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/untrusted-output.js +2 -1
- package/dist/src/scripts/backend-server.js +4 -1
- package/dist/src/scripts/live-smoke/harness.js +79 -7
- package/dist/src/scripts/live-smoke/scenarios.d.ts +28 -0
- package/dist/src/scripts/live-smoke/scenarios.js +110 -18
- 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 +1 -1
- package/references/2026-08-16-transactional-operations.md +459 -0
- package/references/agents-runner.md +34 -0
- package/references/backend-protocol.md +73 -0
- package/references/python-parity.md +72 -0
- package/references/responses-adapter.md +19 -0
- package/references/streaming.md +6 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./canonical.js";
|
|
3
|
+
export * from "./state-machine.js";
|
|
4
|
+
export * from "./journal.js";
|
|
5
|
+
export * from "./recovery.js";
|
|
6
|
+
export * from "./file-identity.js";
|
|
7
|
+
export * from "./handle.js";
|
|
8
|
+
export * from "./submission.js";
|
|
9
|
+
export * from "./turn-ownership.js";
|
|
10
|
+
export * from "./collector.js";
|
|
11
|
+
export * from "./artifact-output.js";
|
|
12
|
+
export * from "./control.js";
|
|
13
|
+
export * from "./send-once.js";
|
|
14
|
+
export * from "./staging.js";
|
|
15
|
+
export * from "./browser-observation.js";
|
|
16
|
+
export * from "./browser-target.js";
|
|
17
|
+
export * from "./browser-adapter.js";
|
|
18
|
+
export * from "./runtime-adapter.js";
|
|
19
|
+
export * from "./chatgpt-runtime.js";
|
|
20
|
+
export * from "./production-primitives.js";
|
|
21
|
+
export * from "./service.js";
|
|
22
|
+
export * from "./client.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./canonical.js";
|
|
3
|
+
export * from "./state-machine.js";
|
|
4
|
+
export * from "./journal.js";
|
|
5
|
+
export * from "./recovery.js";
|
|
6
|
+
export * from "./file-identity.js";
|
|
7
|
+
export * from "./handle.js";
|
|
8
|
+
export * from "./submission.js";
|
|
9
|
+
export * from "./turn-ownership.js";
|
|
10
|
+
export * from "./collector.js";
|
|
11
|
+
export * from "./artifact-output.js";
|
|
12
|
+
export * from "./control.js";
|
|
13
|
+
export * from "./send-once.js";
|
|
14
|
+
export * from "./staging.js";
|
|
15
|
+
export * from "./browser-observation.js";
|
|
16
|
+
export * from "./browser-target.js";
|
|
17
|
+
export * from "./browser-adapter.js";
|
|
18
|
+
export * from "./runtime-adapter.js";
|
|
19
|
+
export * from "./chatgpt-runtime.js";
|
|
20
|
+
export * from "./production-primitives.js";
|
|
21
|
+
export * from "./service.js";
|
|
22
|
+
export * from "./client.js";
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { validateOperationHandle } from "./handle.js";
|
|
2
|
+
import type { OperationFileManifestEntryV1 } from "./file-identity.js";
|
|
3
|
+
import { type OperationJournalSnapshotV1, type OperationEventEnvelopeV1, type OperationEventV1, type OperationControlRequestV1, type OperationHandleV1, type OperationSubmitRequestV1, type OperationStateV1 } from "./types.js";
|
|
4
|
+
export type JournalFaultPoint = "after_lock_acquired" | "after_partial_tail_truncated" | "after_record_written" | "after_record_synced" | "after_snapshot_synced" | "after_terminal_synced" | "after_tombstone_synced" | "after_log_deleted";
|
|
5
|
+
/**
|
|
6
|
+
* Injectable wall-clock and wait boundary used by lock acquisition. The
|
|
7
|
+
* default implementation is backed by the host clock and timers; tests may
|
|
8
|
+
* provide a deterministic implementation without changing journal semantics.
|
|
9
|
+
*/
|
|
10
|
+
export type OperationJournalClock = Readonly<{
|
|
11
|
+
now: () => number;
|
|
12
|
+
sleep: (milliseconds: number) => void | Promise<void>;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Injectable entropy boundary for journal keys, lock tokens, and temporary
|
|
16
|
+
* filenames. Defaults always use the OS CSPRNG and crypto UUID generator.
|
|
17
|
+
*/
|
|
18
|
+
export type OperationJournalEntropy = Readonly<{
|
|
19
|
+
randomBytes: (size: number) => Uint8Array;
|
|
20
|
+
randomUUID: () => string;
|
|
21
|
+
}>;
|
|
22
|
+
export type OperationJournalOptions = {
|
|
23
|
+
stateRoot?: string;
|
|
24
|
+
maxStateBytes?: number;
|
|
25
|
+
lockTimeoutMs?: number;
|
|
26
|
+
faultInjector?: (point: JournalFaultPoint) => void | Promise<void>;
|
|
27
|
+
clock?: OperationJournalClock;
|
|
28
|
+
entropy?: OperationJournalEntropy;
|
|
29
|
+
};
|
|
30
|
+
export type LoadedOperationJournalV1 = {
|
|
31
|
+
state: OperationStateV1;
|
|
32
|
+
envelopes: OperationEventEnvelopeV1[];
|
|
33
|
+
committedBytes: number;
|
|
34
|
+
partialTailBytes: number;
|
|
35
|
+
/** The authenticated final event digest. Compacted records have no envelopes. */
|
|
36
|
+
lastEventDigest?: string;
|
|
37
|
+
};
|
|
38
|
+
export type OperationCompactionResultV1 = {
|
|
39
|
+
status: "compacted" | "already_compacted";
|
|
40
|
+
operationId: string;
|
|
41
|
+
requestDigest: string;
|
|
42
|
+
revision: number;
|
|
43
|
+
lastEventDigest: string;
|
|
44
|
+
deletedLogBytes: number;
|
|
45
|
+
};
|
|
46
|
+
export type OperationSnapshotResultV1 = OperationJournalSnapshotV1;
|
|
47
|
+
export type OperationReceiptPruneResultV1 = {
|
|
48
|
+
status: "pruned" | "already_pruned";
|
|
49
|
+
operationId: string;
|
|
50
|
+
requestDigest: string;
|
|
51
|
+
deletedTerminalBytes: number;
|
|
52
|
+
deletedSnapshotBytes: number;
|
|
53
|
+
};
|
|
54
|
+
export type OperationTombstonePurgeResultV1 = {
|
|
55
|
+
operationId: string;
|
|
56
|
+
requestDigest: string;
|
|
57
|
+
deleted: Array<"tombstone" | "terminal" | "snapshot" | "log">;
|
|
58
|
+
deletedBytes: number;
|
|
59
|
+
};
|
|
60
|
+
export declare class OperationJournalError extends Error {
|
|
61
|
+
readonly code: string;
|
|
62
|
+
constructor(code: string, message: string);
|
|
63
|
+
}
|
|
64
|
+
export declare class OperationJournal {
|
|
65
|
+
private readonly key;
|
|
66
|
+
private readonly clock;
|
|
67
|
+
private readonly entropy;
|
|
68
|
+
readonly stateRoot: string;
|
|
69
|
+
readonly maxStateBytes: number;
|
|
70
|
+
readonly lockTimeoutMs: number;
|
|
71
|
+
private constructor();
|
|
72
|
+
private readonly faultInjector;
|
|
73
|
+
/** Compute immutable request identity inside the journal key domain. */
|
|
74
|
+
submitRequestDigest(request: OperationSubmitRequestV1, files: readonly OperationFileManifestEntryV1[]): string;
|
|
75
|
+
/** Compute child control identity inside the same stable key domain. */
|
|
76
|
+
controlRequestDigest(request: OperationControlRequestV1): string;
|
|
77
|
+
/**
|
|
78
|
+
* Derive privacy-preserving evidence in the stable journal key domain.
|
|
79
|
+
* Callers receive only the HMAC, never the state-root key. The bounded,
|
|
80
|
+
* explicit domain keeps unrelated evidence classes cryptographically
|
|
81
|
+
* separated while allowing browser adapters to avoid bare hashes of user
|
|
82
|
+
* content.
|
|
83
|
+
*/
|
|
84
|
+
evidenceDigest(domain: string, material: unknown): string;
|
|
85
|
+
/** Issue a locator from durable state without exposing the journal key. */
|
|
86
|
+
handleFromState(state: OperationStateV1): OperationHandleV1;
|
|
87
|
+
/** Reconcile a caller locator with freshly loaded durable state. */
|
|
88
|
+
validateHandle(handle: OperationHandleV1, state: OperationStateV1): ReturnType<typeof validateOperationHandle>;
|
|
89
|
+
static open(options?: OperationJournalOptions): Promise<OperationJournal>;
|
|
90
|
+
create(event: Extract<OperationEventV1, {
|
|
91
|
+
type: "operation_created";
|
|
92
|
+
}>): Promise<LoadedOperationJournalV1>;
|
|
93
|
+
append(operationId: string, expectedRevision: number, event: OperationEventV1): Promise<LoadedOperationJournalV1>;
|
|
94
|
+
load(operationId: string, expectedRequestDigest?: string): Promise<LoadedOperationJournalV1>;
|
|
95
|
+
/**
|
|
96
|
+
* Rebuilds the materialized snapshot cache from authoritative journal state.
|
|
97
|
+
* A snapshot is never used as a substitute for the authenticated log or
|
|
98
|
+
* terminal record, so a damaged cache can always be safely overwritten.
|
|
99
|
+
*/
|
|
100
|
+
refreshSnapshot(operationId: string): Promise<OperationSnapshotResultV1>;
|
|
101
|
+
/** Reads and authenticates a snapshot cache without treating it as authority. */
|
|
102
|
+
readSnapshot(operationId: string): Promise<OperationSnapshotResultV1>;
|
|
103
|
+
/**
|
|
104
|
+
* Converts a completed, receipt-bearing log into a durable terminal record.
|
|
105
|
+
* The terminal is fsynced before the historical log is removed. If a crash
|
|
106
|
+
* occurs between those steps, load() authenticates and reconciles both.
|
|
107
|
+
*/
|
|
108
|
+
compactCompleted(operationId: string): Promise<OperationCompactionResultV1>;
|
|
109
|
+
/**
|
|
110
|
+
* Explicitly prunes a completed terminal into a minimal authenticated
|
|
111
|
+
* tombstone. Pruning is never automatic and leaves an unmistakable expiry
|
|
112
|
+
* result instead of turning the operation into operation_not_found.
|
|
113
|
+
*/
|
|
114
|
+
pruneReceipt(operationId: string): Promise<OperationReceiptPruneResultV1>;
|
|
115
|
+
/**
|
|
116
|
+
* Permanently removes a pruned tombstone and any crash-residue state. This
|
|
117
|
+
* is intentionally a separately named destructive operation and requires an
|
|
118
|
+
* explicit acknowledgement at the call site.
|
|
119
|
+
*/
|
|
120
|
+
purgeTombstone(operationId: string, options?: {
|
|
121
|
+
acknowledge?: boolean;
|
|
122
|
+
}): Promise<OperationTombstonePurgeResultV1>;
|
|
123
|
+
private operationLogPath;
|
|
124
|
+
private operationLockPath;
|
|
125
|
+
private quotaLockPath;
|
|
126
|
+
private quotaCounterPath;
|
|
127
|
+
private terminalPath;
|
|
128
|
+
private snapshotPath;
|
|
129
|
+
private tombstonePath;
|
|
130
|
+
private operationStem;
|
|
131
|
+
private loadLocked;
|
|
132
|
+
private assertNoTerminalOrTombstoneForAppend;
|
|
133
|
+
private compactCompletedLocked;
|
|
134
|
+
private ensureQuotaCounter;
|
|
135
|
+
private mutateQuotaTrackedState;
|
|
136
|
+
private removeQuotaTrackedFile;
|
|
137
|
+
private loadCurrentQuotaCounter;
|
|
138
|
+
private rebuildQuotaCounter;
|
|
139
|
+
private assertQuotaForNewOperation;
|
|
140
|
+
private inject;
|
|
141
|
+
}
|
|
142
|
+
export declare function defaultOperationStateRoot(): string;
|