openworkgraph 0.2.12
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/README.md +64 -0
- package/dist/api-image-agent.d.ts +32 -0
- package/dist/api-image-agent.js +132 -0
- package/dist/api-image-output.d.ts +8 -0
- package/dist/api-image-output.js +41 -0
- package/dist/api.d.ts +35 -0
- package/dist/api.js +153 -0
- package/dist/auth.d.ts +58 -0
- package/dist/auth.js +273 -0
- package/dist/backend/adapter.d.ts +35 -0
- package/dist/backend/adapter.js +439 -0
- package/dist/backend/capabilities.d.ts +23 -0
- package/dist/backend/capabilities.js +75 -0
- package/dist/backend/diagnostics.d.ts +9 -0
- package/dist/backend/diagnostics.js +80 -0
- package/dist/backend/index.d.ts +6 -0
- package/dist/backend/index.js +7 -0
- package/dist/backend/models.d.ts +15 -0
- package/dist/backend/models.js +43 -0
- package/dist/backend/paths.d.ts +6 -0
- package/dist/backend/paths.js +69 -0
- package/dist/backend/stdio.d.ts +66 -0
- package/dist/backend/stdio.js +172 -0
- package/dist/backend/types.d.ts +90 -0
- package/dist/backend/types.js +11 -0
- package/dist/backup-api.d.ts +10 -0
- package/dist/backup-api.js +40 -0
- package/dist/blob-store.d.ts +40 -0
- package/dist/blob-store.js +218 -0
- package/dist/cli-help.d.ts +1 -0
- package/dist/cli-help.js +63 -0
- package/dist/cli-output.d.ts +4 -0
- package/dist/cli-output.js +130 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +284 -0
- package/dist/client-pairing.d.ts +8 -0
- package/dist/client-pairing.js +30 -0
- package/dist/directories.d.ts +14 -0
- package/dist/directories.js +34 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.js +7 -0
- package/dist/events.d.ts +22 -0
- package/dist/events.js +155 -0
- package/dist/execution-chains.d.ts +24 -0
- package/dist/execution-chains.js +231 -0
- package/dist/execution-settings.d.ts +10 -0
- package/dist/execution-settings.js +38 -0
- package/dist/graph-document-history.d.ts +43 -0
- package/dist/graph-document-history.js +275 -0
- package/dist/graph-files.d.ts +14 -0
- package/dist/graph-files.js +59 -0
- package/dist/graph-transfer.d.ts +53 -0
- package/dist/graph-transfer.js +501 -0
- package/dist/graphs.d.ts +68 -0
- package/dist/graphs.js +771 -0
- package/dist/history.d.ts +20 -0
- package/dist/history.js +61 -0
- package/dist/http.d.ts +2 -0
- package/dist/http.js +42 -0
- package/dist/image-credentials.d.ts +11 -0
- package/dist/image-credentials.js +130 -0
- package/dist/image-providers.d.ts +51 -0
- package/dist/image-providers.js +271 -0
- package/dist/input-materialization.d.ts +17 -0
- package/dist/input-materialization.js +95 -0
- package/dist/inputs.d.ts +74 -0
- package/dist/inputs.js +301 -0
- package/dist/local-control.d.ts +13 -0
- package/dist/local-control.js +37 -0
- package/dist/network.d.ts +11 -0
- package/dist/network.js +48 -0
- package/dist/openai-image-driver.d.ts +42 -0
- package/dist/openai-image-driver.js +368 -0
- package/dist/operations/backups.d.ts +40 -0
- package/dist/operations/backups.js +391 -0
- package/dist/operations/capacity.d.ts +7 -0
- package/dist/operations/capacity.js +35 -0
- package/dist/operations/cli-context.d.ts +7 -0
- package/dist/operations/cli-context.js +58 -0
- package/dist/operations/daemon.d.ts +36 -0
- package/dist/operations/daemon.js +159 -0
- package/dist/operations/files.d.ts +12 -0
- package/dist/operations/files.js +84 -0
- package/dist/operations/lifecycle.d.ts +28 -0
- package/dist/operations/lifecycle.js +155 -0
- package/dist/operations/local-admin.d.ts +6 -0
- package/dist/operations/local-admin.js +38 -0
- package/dist/operations/logs.d.ts +16 -0
- package/dist/operations/logs.js +37 -0
- package/dist/operations/plugins.d.ts +10 -0
- package/dist/operations/plugins.js +11 -0
- package/dist/operations/snapshot-worker.d.ts +1 -0
- package/dist/operations/snapshot-worker.js +18 -0
- package/dist/operations/snapshot.d.ts +1 -0
- package/dist/operations/snapshot.js +14 -0
- package/dist/operations/update.d.ts +26 -0
- package/dist/operations/update.js +216 -0
- package/dist/persistence/asset-business-schema.d.ts +2 -0
- package/dist/persistence/asset-business-schema.js +36 -0
- package/dist/persistence/database.d.ts +7 -0
- package/dist/persistence/database.js +91 -0
- package/dist/persistence/plugin-schema.d.ts +9 -0
- package/dist/persistence/plugin-schema.js +38 -0
- package/dist/persistence/repositories.d.ts +20 -0
- package/dist/persistence/repositories.js +106 -0
- package/dist/persistence/resource-schema.d.ts +2 -0
- package/dist/persistence/resource-schema.js +44 -0
- package/dist/persistence/schema.d.ts +6 -0
- package/dist/persistence/schema.js +236 -0
- package/dist/persistence/workflow-schema.d.ts +2 -0
- package/dist/persistence/workflow-schema.js +19 -0
- package/dist/plugin-api.d.ts +10 -0
- package/dist/plugin-api.js +40 -0
- package/dist/plugin-management.d.ts +36 -0
- package/dist/plugin-management.js +112 -0
- package/dist/plugins.d.ts +55 -0
- package/dist/plugins.js +239 -0
- package/dist/project-discovery.d.ts +3 -0
- package/dist/project-discovery.js +57 -0
- package/dist/project-files-api.d.ts +16 -0
- package/dist/project-files-api.js +243 -0
- package/dist/project-files.d.ts +97 -0
- package/dist/project-files.js +557 -0
- package/dist/project-lock.d.ts +4 -0
- package/dist/project-lock.js +35 -0
- package/dist/project-probe-worker.d.ts +1 -0
- package/dist/project-probe-worker.js +17 -0
- package/dist/project-probe.d.ts +22 -0
- package/dist/project-probe.js +67 -0
- package/dist/projects.d.ts +29 -0
- package/dist/projects.js +219 -0
- package/dist/publication.d.ts +31 -0
- package/dist/publication.js +642 -0
- package/dist/resource-api.d.ts +15 -0
- package/dist/resource-api.js +256 -0
- package/dist/resources-orphans.d.ts +41 -0
- package/dist/resources-orphans.js +235 -0
- package/dist/resources.d.ts +246 -0
- package/dist/resources.js +714 -0
- package/dist/run-api.d.ts +10 -0
- package/dist/run-api.js +308 -0
- package/dist/run-context.d.ts +54 -0
- package/dist/run-context.js +137 -0
- package/dist/runs.d.ts +82 -0
- package/dist/runs.js +506 -0
- package/dist/runtime-backend.d.ts +24 -0
- package/dist/runtime-backend.js +214 -0
- package/dist/runtime.d.ts +97 -0
- package/dist/runtime.js +553 -0
- package/dist/scheduler.d.ts +85 -0
- package/dist/scheduler.js +344 -0
- package/dist/service.d.ts +29 -0
- package/dist/service.js +515 -0
- package/dist/skills-api.d.ts +18 -0
- package/dist/skills-api.js +120 -0
- package/dist/storage-api.d.ts +21 -0
- package/dist/storage-api.js +92 -0
- package/dist/transfer-api.d.ts +10 -0
- package/dist/transfer-api.js +60 -0
- package/dist/vendor/protocol/contracts.typecheck.d.ts +1 -0
- package/dist/vendor/protocol/contracts.typecheck.js +35 -0
- package/dist/vendor/protocol/execution-chain.d.ts +6 -0
- package/dist/vendor/protocol/execution-chain.js +26 -0
- package/dist/vendor/protocol/graph-binary.d.ts +15 -0
- package/dist/vendor/protocol/graph-binary.js +121 -0
- package/dist/vendor/protocol/graph-title.d.ts +2 -0
- package/dist/vendor/protocol/graph-title.js +23 -0
- package/dist/vendor/protocol/index.d.ts +617 -0
- package/dist/vendor/protocol/index.js +20 -0
- package/dist/vendor/protocol/pairing.d.ts +29 -0
- package/dist/vendor/protocol/pairing.js +71 -0
- package/dist/vendor/protocol/preview.d.ts +2 -0
- package/dist/vendor/protocol/preview.js +9 -0
- package/dist/vendor/protocol/resource-mime.d.ts +2 -0
- package/dist/vendor/protocol/resource-mime.js +35 -0
- package/dist/video-thumbnail.d.ts +2 -0
- package/dist/video-thumbnail.js +34 -0
- package/package.json +9 -0
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
/** Public wire types. Never expose SQLite rows or backend-specific events here. */
|
|
2
|
+
export * from './pairing.js';
|
|
3
|
+
export * from './resource-mime.js';
|
|
4
|
+
export * from './execution-chain.js';
|
|
5
|
+
export * from './graph-title.js';
|
|
6
|
+
export * from './graph-binary.js';
|
|
7
|
+
export declare const PROTOCOL_VERSION: '1.0';
|
|
8
|
+
export declare const SERVICE_VERSION: '0.2.12';
|
|
9
|
+
/** Work Graph uploads use the UI's binary MB convention. */
|
|
10
|
+
export declare const WORKGRAPH_UPLOAD_MAX_BYTES: number;
|
|
11
|
+
export declare const WORKGRAPH_TRANSFER_TOTAL_BYTES: number;
|
|
12
|
+
export declare const WORKGRAPH_BUNDLE_MAX_BYTES: number;
|
|
13
|
+
export type Json = null | boolean | number | string | Json[] | {
|
|
14
|
+
[key: string]: Json;
|
|
15
|
+
};
|
|
16
|
+
export interface Scope {
|
|
17
|
+
serviceId: string;
|
|
18
|
+
projectId: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GraphScope extends Scope {
|
|
21
|
+
graphId: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const RUN_STATUSES: readonly ['accepted', 'queued', 'preparing', 'running', 'waiting_answer', 'waiting_approval', 'agent_completed', 'finalizing', 'cancelling', 'reconciling', 'paused_restore', 'succeeded', 'failed', 'cancelled', 'interrupted'];
|
|
24
|
+
export type RunStatus = typeof RUN_STATUSES[number];
|
|
25
|
+
export declare const TERMINAL_RUN_STATUSES: readonly RunStatus[];
|
|
26
|
+
/** Fail closed: unknown future states must retain locks until reconciled. */
|
|
27
|
+
export declare function isTerminalRunStatus(status: string): boolean;
|
|
28
|
+
export declare const ERROR_CODES: readonly ['INVALID_REQUEST', 'UNAUTHENTICATED', 'ORIGIN_DENIED', 'HOST_DENIED', 'PAIRING_CODE_INVALID', 'PAIRING_CODE_EXPIRED', 'PAIRING_CODE_USED', 'SESSION_EXPIRED', 'SESSION_REVOKED', 'PAYLOAD_TOO_LARGE', 'UNSUPPORTED_MEDIA_TYPE', 'SERVICE_NOT_RUNNING', 'SERVICE_MISMATCH', 'PROTOCOL_INCOMPATIBLE', 'NOT_FOUND', 'NOT_IMPLEMENTED', 'CONFLICT', 'IDEMPOTENCY_CONFLICT', 'PROJECT_INACTIVE', 'PROJECT_UNAVAILABLE', 'ACTIVE_RUN', 'REVISION_CONFLICT', 'NODE_LOCKED', 'INVALID_EDGE', 'INPUT_BLOCKED', 'INPUT_BUDGET_EXCEEDED', 'PLUGIN_UNAVAILABLE', 'MODEL_UNAVAILABLE', 'ALREADY_HANDLED', 'CURSOR_EXPIRED', 'MAINTENANCE', 'SCHEMA_UNSUPPORTED', 'MIGRATION_FAILED', 'INTERNAL_ERROR'];
|
|
29
|
+
export type ErrorCode = typeof ERROR_CODES[number];
|
|
30
|
+
export interface ErrorResponse {
|
|
31
|
+
error: {
|
|
32
|
+
code: ErrorCode;
|
|
33
|
+
message: string;
|
|
34
|
+
requestId: string;
|
|
35
|
+
retryable: boolean;
|
|
36
|
+
details?: Json;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface Capability {
|
|
40
|
+
status: 'available' | 'unavailable' | 'unknown';
|
|
41
|
+
reason: string;
|
|
42
|
+
verifiedAt: string | null;
|
|
43
|
+
}
|
|
44
|
+
export interface ImageRouteCapability {
|
|
45
|
+
route: {
|
|
46
|
+
type: 'codex';
|
|
47
|
+
} | {
|
|
48
|
+
type: 'api';
|
|
49
|
+
providerId: string;
|
|
50
|
+
modelId: string;
|
|
51
|
+
};
|
|
52
|
+
modes: Record<ImageInputMode, Capability>;
|
|
53
|
+
}
|
|
54
|
+
export type CoreCapabilityName = 'pairing' | 'projects' | 'graphs' | 'assets' | 'execution' | 'imageGeneration' | 'events' | 'backups';
|
|
55
|
+
export type ProjectFileCapabilityName = 'projectFiles' | 'projectFileReferences';
|
|
56
|
+
export interface ServiceInfo {
|
|
57
|
+
serviceId: string;
|
|
58
|
+
version: string;
|
|
59
|
+
protocolVersion: string;
|
|
60
|
+
installation?: 'npm-global' | 'other';
|
|
61
|
+
capabilities: Record<CoreCapabilityName, Capability> & Partial<Record<ProjectFileCapabilityName, Capability>>;
|
|
62
|
+
imageRoutes?: ImageRouteCapability[];
|
|
63
|
+
}
|
|
64
|
+
export interface Health {
|
|
65
|
+
status: 'ok';
|
|
66
|
+
version: string;
|
|
67
|
+
protocolVersion: string;
|
|
68
|
+
}
|
|
69
|
+
export declare function isProtocolCompatible(version: string): boolean;
|
|
70
|
+
export interface Session {
|
|
71
|
+
id: string;
|
|
72
|
+
browserName: string;
|
|
73
|
+
pairedAt: string;
|
|
74
|
+
lastUsedAt: string;
|
|
75
|
+
expiresAt: string;
|
|
76
|
+
current: boolean;
|
|
77
|
+
origin: string;
|
|
78
|
+
state: 'active' | 'expired';
|
|
79
|
+
}
|
|
80
|
+
export interface PairRequest {
|
|
81
|
+
code: string;
|
|
82
|
+
browserName: string;
|
|
83
|
+
expectedServiceId: string;
|
|
84
|
+
clientCode?: string;
|
|
85
|
+
proof?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface PairResponse {
|
|
88
|
+
serviceId: string;
|
|
89
|
+
session: Session;
|
|
90
|
+
token: string;
|
|
91
|
+
}
|
|
92
|
+
export interface ClientPairingRequest {
|
|
93
|
+
code: string;
|
|
94
|
+
expiresAt: string;
|
|
95
|
+
serviceId: string;
|
|
96
|
+
}
|
|
97
|
+
export type ClientPairingStatus = {
|
|
98
|
+
status: 'pending';
|
|
99
|
+
expiresAt: string;
|
|
100
|
+
serviceId: string;
|
|
101
|
+
} | ({
|
|
102
|
+
status: 'ready';
|
|
103
|
+
expiresAt: string;
|
|
104
|
+
} & PairResponse) | ({
|
|
105
|
+
status: 'paired';
|
|
106
|
+
} & PairResponse);
|
|
107
|
+
export interface Project extends Scope {
|
|
108
|
+
name: string;
|
|
109
|
+
canonicalPath: string;
|
|
110
|
+
state: 'active' | 'inactive';
|
|
111
|
+
availability: 'available' | 'unavailable' | 'unknown';
|
|
112
|
+
isGit: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface ProjectCandidate {
|
|
115
|
+
path: string;
|
|
116
|
+
availability: 'available' | 'unavailable';
|
|
117
|
+
}
|
|
118
|
+
export interface ProjectCandidates {
|
|
119
|
+
source: 'codex-desktop-saved-roots';
|
|
120
|
+
status: 'available' | 'unavailable';
|
|
121
|
+
reason: string;
|
|
122
|
+
candidates: ProjectCandidate[];
|
|
123
|
+
}
|
|
124
|
+
export interface ModelSelection {
|
|
125
|
+
model: string;
|
|
126
|
+
reasoningEffort: string | null;
|
|
127
|
+
}
|
|
128
|
+
export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
129
|
+
export interface ExecutionSettings {
|
|
130
|
+
revision: number;
|
|
131
|
+
sandboxMode: SandboxMode;
|
|
132
|
+
}
|
|
133
|
+
export interface ModelOption {
|
|
134
|
+
id: string;
|
|
135
|
+
reasoningEfforts: string[];
|
|
136
|
+
defaultReasoningEffort?: string | null;
|
|
137
|
+
}
|
|
138
|
+
export interface ModelDefaults {
|
|
139
|
+
revision: number;
|
|
140
|
+
selection: ModelSelection | null;
|
|
141
|
+
available: ModelOption[];
|
|
142
|
+
}
|
|
143
|
+
export interface Node {
|
|
144
|
+
id: string;
|
|
145
|
+
type: string;
|
|
146
|
+
schemaVersion: number;
|
|
147
|
+
contentVersion: number;
|
|
148
|
+
content: Json;
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
width?: number;
|
|
152
|
+
height?: number;
|
|
153
|
+
memberIds?: string[];
|
|
154
|
+
readOnly: boolean;
|
|
155
|
+
}
|
|
156
|
+
export interface ProjectFileSource {
|
|
157
|
+
kind: 'project-file';
|
|
158
|
+
serviceId: string;
|
|
159
|
+
projectId: string;
|
|
160
|
+
relativePath: string;
|
|
161
|
+
}
|
|
162
|
+
export interface EmptyProjectFileSource {
|
|
163
|
+
kind: 'project-file-empty';
|
|
164
|
+
relativePath: string;
|
|
165
|
+
}
|
|
166
|
+
export interface ProjectFileObservation {
|
|
167
|
+
state: 'available' | 'missing' | 'unavailable';
|
|
168
|
+
name: string;
|
|
169
|
+
mime: string | null;
|
|
170
|
+
bytes: number | null;
|
|
171
|
+
changeToken: string | null;
|
|
172
|
+
}
|
|
173
|
+
export interface Edge {
|
|
174
|
+
id: string;
|
|
175
|
+
sourceId: string;
|
|
176
|
+
targetId: string;
|
|
177
|
+
kind: 'reference' | 'execution' | 'delivery';
|
|
178
|
+
}
|
|
179
|
+
export interface GraphDocumentHistory {
|
|
180
|
+
cursor: string | null;
|
|
181
|
+
canUndo: boolean;
|
|
182
|
+
canRedo: boolean;
|
|
183
|
+
expiresAt: number | null;
|
|
184
|
+
undoRunIds?: string[];
|
|
185
|
+
}
|
|
186
|
+
export interface GraphHistoryTravel extends GraphScope {
|
|
187
|
+
idempotencyKey: string;
|
|
188
|
+
expectedExecutionRevision: number;
|
|
189
|
+
expectedLayoutRevision: number;
|
|
190
|
+
expectedCursor: string;
|
|
191
|
+
direction: 'undo' | 'redo';
|
|
192
|
+
}
|
|
193
|
+
export interface GraphSnapshot extends GraphScope {
|
|
194
|
+
updatedAt?: string;
|
|
195
|
+
history?: GraphDocumentHistory;
|
|
196
|
+
title: string;
|
|
197
|
+
archived: boolean;
|
|
198
|
+
trashed: boolean;
|
|
199
|
+
executionRevision: number;
|
|
200
|
+
layoutRevision: number;
|
|
201
|
+
eventCursor: string;
|
|
202
|
+
nodes: Node[];
|
|
203
|
+
edges: Edge[];
|
|
204
|
+
hiddenExecutionOutputs?: {
|
|
205
|
+
executionNodeId: string;
|
|
206
|
+
node: Node;
|
|
207
|
+
}[];
|
|
208
|
+
}
|
|
209
|
+
/** Portable data shared by browser canvases and service import/export. */
|
|
210
|
+
export interface BundleResource {
|
|
211
|
+
resourceId: string;
|
|
212
|
+
version: number;
|
|
213
|
+
name: string;
|
|
214
|
+
mime: string;
|
|
215
|
+
bytes: number;
|
|
216
|
+
sha256: string;
|
|
217
|
+
base64: string;
|
|
218
|
+
}
|
|
219
|
+
export interface BundlePluginRequirement {
|
|
220
|
+
typeId: string;
|
|
221
|
+
schemaVersion: number;
|
|
222
|
+
contract: Json | null;
|
|
223
|
+
}
|
|
224
|
+
export type CopiedProvenance = {
|
|
225
|
+
kind: 'copied-delivery';
|
|
226
|
+
sourceId: string;
|
|
227
|
+
targetId: string;
|
|
228
|
+
verified: false;
|
|
229
|
+
} | {
|
|
230
|
+
kind: 'copied-node';
|
|
231
|
+
nodeId: string;
|
|
232
|
+
metadata: Json;
|
|
233
|
+
verified: false;
|
|
234
|
+
};
|
|
235
|
+
export interface ImportedGraphSnapshot extends GraphSnapshot {
|
|
236
|
+
copiedProvenance: CopiedProvenance[];
|
|
237
|
+
}
|
|
238
|
+
export interface GraphBundle {
|
|
239
|
+
format: 'openworkgraph.graph';
|
|
240
|
+
version: 1;
|
|
241
|
+
graph: {
|
|
242
|
+
title: string;
|
|
243
|
+
nodes: Node[];
|
|
244
|
+
edges: Edge[];
|
|
245
|
+
};
|
|
246
|
+
resources: BundleResource[];
|
|
247
|
+
pluginRequirements: BundlePluginRequirement[];
|
|
248
|
+
copiedProvenance?: CopiedProvenance[];
|
|
249
|
+
}
|
|
250
|
+
export type GraphOperation = {
|
|
251
|
+
type: 'execution.output.restore';
|
|
252
|
+
executionNodeId: string;
|
|
253
|
+
nodeId: string;
|
|
254
|
+
x: number;
|
|
255
|
+
y: number;
|
|
256
|
+
} | {
|
|
257
|
+
type: 'node.create';
|
|
258
|
+
node: Node;
|
|
259
|
+
} | {
|
|
260
|
+
type: 'node.content';
|
|
261
|
+
nodeId: string;
|
|
262
|
+
expectedContentVersion: number;
|
|
263
|
+
content: Json;
|
|
264
|
+
} | {
|
|
265
|
+
type: 'node.project-file.associate';
|
|
266
|
+
nodeId: string;
|
|
267
|
+
expectedContentVersion: number;
|
|
268
|
+
nodeType: 'text' | 'image' | 'file';
|
|
269
|
+
content: Json;
|
|
270
|
+
} | {
|
|
271
|
+
type: 'node.delete';
|
|
272
|
+
nodeId: string;
|
|
273
|
+
retainResourcesForUndo?: boolean;
|
|
274
|
+
} | {
|
|
275
|
+
type: 'edge.create';
|
|
276
|
+
edge: Edge;
|
|
277
|
+
} | {
|
|
278
|
+
type: 'edge.delete';
|
|
279
|
+
edgeId: string;
|
|
280
|
+
} | {
|
|
281
|
+
type: 'layout.move';
|
|
282
|
+
positions: {
|
|
283
|
+
nodeId: string;
|
|
284
|
+
x: number;
|
|
285
|
+
y: number;
|
|
286
|
+
}[];
|
|
287
|
+
} | {
|
|
288
|
+
type: 'layout.resize';
|
|
289
|
+
sizes: {
|
|
290
|
+
nodeId: string;
|
|
291
|
+
width: number | null;
|
|
292
|
+
height: number | null;
|
|
293
|
+
x?: number;
|
|
294
|
+
y?: number;
|
|
295
|
+
}[];
|
|
296
|
+
} | {
|
|
297
|
+
type: 'group.members';
|
|
298
|
+
groupId: string;
|
|
299
|
+
memberIds: string[];
|
|
300
|
+
} | {
|
|
301
|
+
type: 'group.rename';
|
|
302
|
+
groupId: string;
|
|
303
|
+
title: string;
|
|
304
|
+
} | {
|
|
305
|
+
type: 'graph.rename';
|
|
306
|
+
title: string;
|
|
307
|
+
} | {
|
|
308
|
+
type: 'graph.archive';
|
|
309
|
+
archived: boolean;
|
|
310
|
+
} | {
|
|
311
|
+
type: 'graph.trash';
|
|
312
|
+
trashed: boolean;
|
|
313
|
+
};
|
|
314
|
+
export interface DeleteGraph extends GraphScope {
|
|
315
|
+
idempotencyKey: string;
|
|
316
|
+
expectedExecutionRevision: number;
|
|
317
|
+
expectedLayoutRevision: number;
|
|
318
|
+
confirmTitle: string;
|
|
319
|
+
}
|
|
320
|
+
export interface GraphLifecycleRequest extends GraphScope {
|
|
321
|
+
idempotencyKey: string;
|
|
322
|
+
expectedExecutionRevision: number;
|
|
323
|
+
}
|
|
324
|
+
export interface PurgeGraph extends GraphLifecycleRequest {
|
|
325
|
+
confirmationTitle: string;
|
|
326
|
+
}
|
|
327
|
+
export interface GraphCommand extends GraphScope {
|
|
328
|
+
idempotencyKey: string;
|
|
329
|
+
expectedExecutionRevision: number;
|
|
330
|
+
expectedLayoutRevision: number;
|
|
331
|
+
operations: GraphOperation[];
|
|
332
|
+
}
|
|
333
|
+
export interface AssetVersion {
|
|
334
|
+
assetId: string;
|
|
335
|
+
version: number;
|
|
336
|
+
mime: string;
|
|
337
|
+
bytes: number;
|
|
338
|
+
sha256: string;
|
|
339
|
+
state: 'processing' | 'ready' | 'failed';
|
|
340
|
+
representationVersion: number | null;
|
|
341
|
+
}
|
|
342
|
+
export interface CanvasResourceVersion {
|
|
343
|
+
resourceId: string;
|
|
344
|
+
version: number;
|
|
345
|
+
mime: string;
|
|
346
|
+
bytes: number;
|
|
347
|
+
sha256: string;
|
|
348
|
+
representationVersion: number | null;
|
|
349
|
+
}
|
|
350
|
+
export interface CanvasResource extends GraphScope {
|
|
351
|
+
id: string;
|
|
352
|
+
name: string;
|
|
353
|
+
current: CanvasResourceVersion;
|
|
354
|
+
}
|
|
355
|
+
export interface LibraryAsset extends Scope {
|
|
356
|
+
id: string;
|
|
357
|
+
name: string;
|
|
358
|
+
shared: boolean;
|
|
359
|
+
deleted: boolean;
|
|
360
|
+
current: AssetVersion;
|
|
361
|
+
}
|
|
362
|
+
export interface CanvasResourceCreated {
|
|
363
|
+
resource: CanvasResource;
|
|
364
|
+
referenceId: string;
|
|
365
|
+
}
|
|
366
|
+
export interface ResourceEnvelope {
|
|
367
|
+
kind: 'text' | 'image' | 'document' | 'video' | 'file';
|
|
368
|
+
sourceNodeIds: string[];
|
|
369
|
+
text: string | null;
|
|
370
|
+
resource: CanvasResourceVersion | null;
|
|
371
|
+
}
|
|
372
|
+
export interface ProjectFileInput {
|
|
373
|
+
kind: ResourceEnvelope['kind'];
|
|
374
|
+
relativePath: string;
|
|
375
|
+
sourceNodeIds: string[];
|
|
376
|
+
edgeIds: string[];
|
|
377
|
+
}
|
|
378
|
+
/** Resource copies have no source asset binding. Upload IDs come from a future validated upload pipeline. */
|
|
379
|
+
export interface CanvasUploadRequest extends GraphScope {
|
|
380
|
+
uploadId: string;
|
|
381
|
+
name: string;
|
|
382
|
+
idempotencyKey: string;
|
|
383
|
+
}
|
|
384
|
+
export type LibraryUploadRequest = Scope & {
|
|
385
|
+
uploadId: string;
|
|
386
|
+
name: string;
|
|
387
|
+
idempotencyKey: string;
|
|
388
|
+
} & ({
|
|
389
|
+
mode: 'new';
|
|
390
|
+
} | {
|
|
391
|
+
mode: 'update';
|
|
392
|
+
assetId: string;
|
|
393
|
+
expectedVersion: number;
|
|
394
|
+
});
|
|
395
|
+
export interface ResourceControl {
|
|
396
|
+
uploadToCanvas(request: CanvasUploadRequest): Promise<CanvasResourceCreated>;
|
|
397
|
+
copyAssetToCanvas(request: GraphScope & {
|
|
398
|
+
assetId: string;
|
|
399
|
+
expectedAssetVersion: number;
|
|
400
|
+
idempotencyKey: string;
|
|
401
|
+
}): Promise<CanvasResourceCreated>;
|
|
402
|
+
saveCanvasToLibrary(request: GraphScope & {
|
|
403
|
+
resourceId: string;
|
|
404
|
+
expectedResourceVersion: number;
|
|
405
|
+
name: string;
|
|
406
|
+
idempotencyKey: string;
|
|
407
|
+
}): Promise<LibraryAsset>;
|
|
408
|
+
uploadToLibrary(request: LibraryUploadRequest): Promise<LibraryAsset>;
|
|
409
|
+
listSameNameAssets(scope: Scope, name: string): Promise<LibraryAsset[]>;
|
|
410
|
+
readCanvasVersion(scope: GraphScope, resourceId: string, version: number): Promise<CanvasResourceVersion>;
|
|
411
|
+
}
|
|
412
|
+
export interface ImageGenerationOptions {
|
|
413
|
+
quality?: 'auto' | 'high' | 'medium' | 'low';
|
|
414
|
+
size?: string;
|
|
415
|
+
aspectRatio?: string;
|
|
416
|
+
outputFormat?: 'png' | 'jpeg' | 'webp';
|
|
417
|
+
}
|
|
418
|
+
export type ImageRoute = {
|
|
419
|
+
type: 'codex';
|
|
420
|
+
options?: ImageGenerationOptions;
|
|
421
|
+
} | {
|
|
422
|
+
type: 'api';
|
|
423
|
+
providerId: string;
|
|
424
|
+
modelId: string;
|
|
425
|
+
options?: ImageGenerationOptions;
|
|
426
|
+
};
|
|
427
|
+
export type ImageInputMode = 'text' | 'image' | 'text_image';
|
|
428
|
+
export type FrozenApiImageRoute = Extract<ImageRoute, {
|
|
429
|
+
type: 'api';
|
|
430
|
+
}> & {
|
|
431
|
+
configRevision: number;
|
|
432
|
+
credentialRevision: number;
|
|
433
|
+
};
|
|
434
|
+
export interface ImageProviderModel {
|
|
435
|
+
id: string;
|
|
436
|
+
name: string;
|
|
437
|
+
modes: ('text' | 'image' | 'text_image')[];
|
|
438
|
+
formats: ('png' | 'jpeg' | 'webp')[];
|
|
439
|
+
sizes: string[];
|
|
440
|
+
qualities: string[];
|
|
441
|
+
isDefault: boolean;
|
|
442
|
+
verifiedAt: string | null;
|
|
443
|
+
}
|
|
444
|
+
export interface ImageProvider {
|
|
445
|
+
id: string;
|
|
446
|
+
name: string;
|
|
447
|
+
driver: 'openai';
|
|
448
|
+
endpoint: string;
|
|
449
|
+
enabled: boolean;
|
|
450
|
+
revision: number;
|
|
451
|
+
credentialConfigured: boolean;
|
|
452
|
+
credentialRevision: number | null;
|
|
453
|
+
models: ImageProviderModel[];
|
|
454
|
+
}
|
|
455
|
+
export interface InputSnapshotBase {
|
|
456
|
+
inputDigest: string;
|
|
457
|
+
executionRevision: number;
|
|
458
|
+
prompt: string;
|
|
459
|
+
resources: ResourceEnvelope[];
|
|
460
|
+
projectFiles?: ProjectFileInput[];
|
|
461
|
+
}
|
|
462
|
+
export type InputSnapshot = InputSnapshotBase & ({
|
|
463
|
+
model: ModelSelection;
|
|
464
|
+
imageRoute?: Extract<ImageRoute, {
|
|
465
|
+
type: 'codex';
|
|
466
|
+
}>;
|
|
467
|
+
inputMode?: ImageInputMode;
|
|
468
|
+
} | {
|
|
469
|
+
imageRoute: FrozenApiImageRoute;
|
|
470
|
+
inputMode: ImageInputMode;
|
|
471
|
+
model?: never;
|
|
472
|
+
});
|
|
473
|
+
export type SubmitRun = GraphScope & {
|
|
474
|
+
nodeId: string;
|
|
475
|
+
idempotencyKey: string;
|
|
476
|
+
expectedExecutionRevision: number;
|
|
477
|
+
} & ({
|
|
478
|
+
kind: 'execution' | 'text_generation';
|
|
479
|
+
modelOverride?: ModelSelection;
|
|
480
|
+
imageRoute?: never;
|
|
481
|
+
} | {
|
|
482
|
+
kind: 'image_generation';
|
|
483
|
+
modelOverride?: ModelSelection;
|
|
484
|
+
imageRoute?: Extract<ImageRoute, {
|
|
485
|
+
type: 'codex';
|
|
486
|
+
}>;
|
|
487
|
+
} | {
|
|
488
|
+
kind: 'image_generation';
|
|
489
|
+
imageRoute: Extract<ImageRoute, {
|
|
490
|
+
type: 'api';
|
|
491
|
+
}>;
|
|
492
|
+
modelOverride?: never;
|
|
493
|
+
});
|
|
494
|
+
export interface Run extends GraphScope {
|
|
495
|
+
id: string;
|
|
496
|
+
nodeId: string;
|
|
497
|
+
status: RunStatus;
|
|
498
|
+
submissionSequence: string;
|
|
499
|
+
inputDigest: string;
|
|
500
|
+
createdAt: string;
|
|
501
|
+
historyState: 'retained' | 'cleared';
|
|
502
|
+
executionStart?: 'manual' | 'confirm' | 'dependencies';
|
|
503
|
+
chainBatch?: string;
|
|
504
|
+
chainControl?: 'active' | 'stopping' | 'stopped';
|
|
505
|
+
}
|
|
506
|
+
export interface RunNotification {
|
|
507
|
+
run: Run;
|
|
508
|
+
revision: number;
|
|
509
|
+
createdAt: string;
|
|
510
|
+
}
|
|
511
|
+
export interface ExecutionPlan {
|
|
512
|
+
targetId: string;
|
|
513
|
+
executionRevision: number;
|
|
514
|
+
nodes: {
|
|
515
|
+
id: string;
|
|
516
|
+
title: string;
|
|
517
|
+
required: boolean;
|
|
518
|
+
hasRun: boolean;
|
|
519
|
+
missingPrompt?: boolean;
|
|
520
|
+
}[];
|
|
521
|
+
edges: Edge[];
|
|
522
|
+
initialNodeIds: string[];
|
|
523
|
+
requiresConfirmation: boolean;
|
|
524
|
+
}
|
|
525
|
+
export interface Interaction {
|
|
526
|
+
id: string;
|
|
527
|
+
runId: string;
|
|
528
|
+
epoch: string;
|
|
529
|
+
version: number;
|
|
530
|
+
kind: 'question' | 'approval';
|
|
531
|
+
status: 'pending' | 'answered' | 'expired';
|
|
532
|
+
payload: Json;
|
|
533
|
+
}
|
|
534
|
+
export interface InteractionReply {
|
|
535
|
+
runId: string;
|
|
536
|
+
interactionId: string;
|
|
537
|
+
epoch: string;
|
|
538
|
+
expectedVersion: number;
|
|
539
|
+
idempotencyKey: string;
|
|
540
|
+
answer: Json;
|
|
541
|
+
}
|
|
542
|
+
export interface ServiceEvent {
|
|
543
|
+
serviceId: string;
|
|
544
|
+
cursor: string;
|
|
545
|
+
eventId: string;
|
|
546
|
+
type: 'project.changed' | 'project.files.changed' | 'graph.changed' | 'asset.changed' | 'canvas_resource.created' | 'canvas_resource.changed' | 'canvas_resource.collected' | 'run.changed' | 'interaction.changed' | 'notification.changed' | 'session.revoked' | 'backup.changed' | 'capacity.changed';
|
|
547
|
+
projectId: string | null;
|
|
548
|
+
graphId: string | null;
|
|
549
|
+
entityId: string;
|
|
550
|
+
revision: number;
|
|
551
|
+
occurredAt: string;
|
|
552
|
+
payload: Json;
|
|
553
|
+
}
|
|
554
|
+
export interface Backup {
|
|
555
|
+
id: string;
|
|
556
|
+
state: 'creating' | 'ready' | 'failed';
|
|
557
|
+
createdAt: string;
|
|
558
|
+
bytes: number | null;
|
|
559
|
+
sha256: string | null;
|
|
560
|
+
}
|
|
561
|
+
export interface HistoryCleanupPreview {
|
|
562
|
+
runIds: string[];
|
|
563
|
+
processRecordCount: number;
|
|
564
|
+
preserves: readonly ['runs', 'deliveries', 'assets', 'graphLinks'];
|
|
565
|
+
}
|
|
566
|
+
export interface RestorePreview {
|
|
567
|
+
backupId: string;
|
|
568
|
+
integrity: 'verified';
|
|
569
|
+
requiresMaintenance: true;
|
|
570
|
+
invalidatesAllSessions: true;
|
|
571
|
+
pausesQueuedRuns: true;
|
|
572
|
+
}
|
|
573
|
+
/** Contracts only; availability is negotiated through ServiceInfo, not inferred from types. */
|
|
574
|
+
export interface ServiceControl {
|
|
575
|
+
pair(request: PairRequest): Promise<PairResponse>;
|
|
576
|
+
getSession(): Promise<Session>;
|
|
577
|
+
listSessions(): Promise<Session[]>;
|
|
578
|
+
revokeSession(id: string): Promise<void>;
|
|
579
|
+
listProjects(state: 'active' | 'inactive' | 'all'): Promise<Project[]>;
|
|
580
|
+
listProjectCandidates(): Promise<ProjectCandidates>;
|
|
581
|
+
registerProject(path: string): Promise<Project>;
|
|
582
|
+
setProjectState(id: string, state: 'active' | 'inactive'): Promise<Project>;
|
|
583
|
+
repairProjectPath(id: string, path: string): Promise<Project>;
|
|
584
|
+
getModelDefaults(): Promise<ModelDefaults>;
|
|
585
|
+
setModelDefaults(selection: ModelSelection, expectedRevision: number): Promise<ModelDefaults>;
|
|
586
|
+
getGraph(scope: GraphScope): Promise<GraphSnapshot>;
|
|
587
|
+
commandGraph(command: GraphCommand): Promise<GraphSnapshot>;
|
|
588
|
+
deleteGraph(request: DeleteGraph): Promise<{
|
|
589
|
+
graphId: string;
|
|
590
|
+
deleted: true;
|
|
591
|
+
}>;
|
|
592
|
+
archiveGraph(request: GraphLifecycleRequest): Promise<GraphSnapshot>;
|
|
593
|
+
trashGraph(request: GraphLifecycleRequest): Promise<GraphSnapshot>;
|
|
594
|
+
restoreGraph(request: GraphLifecycleRequest): Promise<GraphSnapshot>;
|
|
595
|
+
purgeGraph(request: PurgeGraph): Promise<{
|
|
596
|
+
graphId: string;
|
|
597
|
+
deleted: true;
|
|
598
|
+
}>;
|
|
599
|
+
submitRun(request: SubmitRun): Promise<Run>;
|
|
600
|
+
cancelRun(id: string, idempotencyKey: string): Promise<Run>;
|
|
601
|
+
reply(request: InteractionReply): Promise<Interaction>;
|
|
602
|
+
previewHistoryCleanup(runIds: string[]): Promise<HistoryCleanupPreview>;
|
|
603
|
+
clearHistory(runIds: string[], idempotencyKey: string): Promise<HistoryCleanupPreview>;
|
|
604
|
+
createBackup(idempotencyKey: string): Promise<Backup>;
|
|
605
|
+
listBackups(): Promise<Backup[]>;
|
|
606
|
+
getRestoreGuidance(): Promise<{
|
|
607
|
+
localOnly: true;
|
|
608
|
+
command: string;
|
|
609
|
+
}>;
|
|
610
|
+
continueRestoredRun(id: string, idempotencyKey: string): Promise<Run>;
|
|
611
|
+
}
|
|
612
|
+
/** Deliberately excluded from browser ServiceControl. */
|
|
613
|
+
export interface LocalRestoreControl {
|
|
614
|
+
previewRestore(path: string): Promise<RestorePreview>;
|
|
615
|
+
restore(path: string, expectedSha256: string): Promise<void>;
|
|
616
|
+
}
|
|
617
|
+
export { previewEdgeError } from "./preview.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Public wire types. Never expose SQLite rows or backend-specific events here. */
|
|
2
|
+
export * from './pairing.js';
|
|
3
|
+
export * from './resource-mime.js';
|
|
4
|
+
export * from './execution-chain.js';
|
|
5
|
+
export * from './graph-title.js';
|
|
6
|
+
export * from './graph-binary.js';
|
|
7
|
+
export const PROTOCOL_VERSION = '1.0';
|
|
8
|
+
export const SERVICE_VERSION = '0.2.12';
|
|
9
|
+
/** Work Graph uploads use the UI's binary MB convention. */
|
|
10
|
+
export const WORKGRAPH_UPLOAD_MAX_BYTES = 300 * 1024 * 1024;
|
|
11
|
+
export const WORKGRAPH_TRANSFER_TOTAL_BYTES = 1024 * 1024 * 1024;
|
|
12
|
+
export const WORKGRAPH_BUNDLE_MAX_BYTES = 1536 * 1024 * 1024;
|
|
13
|
+
export const RUN_STATUSES = ['accepted', 'queued', 'preparing', 'running', 'waiting_answer', 'waiting_approval', 'agent_completed', 'finalizing', 'cancelling', 'reconciling', 'paused_restore', 'succeeded', 'failed', 'cancelled', 'interrupted'];
|
|
14
|
+
export const TERMINAL_RUN_STATUSES = ['succeeded', 'failed', 'cancelled', 'interrupted'];
|
|
15
|
+
/** Fail closed: unknown future states must retain locks until reconciled. */
|
|
16
|
+
export function isTerminalRunStatus(status) { return TERMINAL_RUN_STATUSES.includes(status); }
|
|
17
|
+
export const ERROR_CODES = ['INVALID_REQUEST', 'UNAUTHENTICATED', 'ORIGIN_DENIED', 'HOST_DENIED', 'PAIRING_CODE_INVALID', 'PAIRING_CODE_EXPIRED', 'PAIRING_CODE_USED', 'SESSION_EXPIRED', 'SESSION_REVOKED', 'PAYLOAD_TOO_LARGE', 'UNSUPPORTED_MEDIA_TYPE', 'SERVICE_NOT_RUNNING', 'SERVICE_MISMATCH', 'PROTOCOL_INCOMPATIBLE', 'NOT_FOUND', 'NOT_IMPLEMENTED', 'CONFLICT', 'IDEMPOTENCY_CONFLICT', 'PROJECT_INACTIVE', 'PROJECT_UNAVAILABLE', 'ACTIVE_RUN', 'REVISION_CONFLICT', 'NODE_LOCKED', 'INVALID_EDGE', 'INPUT_BLOCKED', 'INPUT_BUDGET_EXCEEDED', 'PLUGIN_UNAVAILABLE', 'MODEL_UNAVAILABLE', 'ALREADY_HANDLED', 'CURSOR_EXPIRED', 'MAINTENANCE', 'SCHEMA_UNSUPPORTED', 'MIGRATION_FAILED', 'INTERNAL_ERROR'];
|
|
18
|
+
export function isProtocolCompatible(version) { return /^1\.\d+$/.test(version); }
|
|
19
|
+
export { previewEdgeError } from "./preview.js";
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Versioned, bounded pairing envelopes. These are encodings, not encryption.
|
|
2
|
+
* Algorithms are fixed per version; never accept an algorithm from the caller. */
|
|
3
|
+
export declare const CLIENT_CODE_PREFIX = "wgpc1_";
|
|
4
|
+
export declare const PAIR_AUTHORIZATION_PREFIX = "wgpa1_";
|
|
5
|
+
/** Human-entered codes accept optional whitespace or a separator between groups. */
|
|
6
|
+
export declare function normalizeShortPairingCode(value: string): string | undefined;
|
|
7
|
+
/** Display/copy exactly eight digits; separators are accepted only on input. */
|
|
8
|
+
export declare function formatShortPairingCode(value: string): string;
|
|
9
|
+
export interface PairingClient {
|
|
10
|
+
version: 1;
|
|
11
|
+
origin: string;
|
|
12
|
+
publicKey: string;
|
|
13
|
+
nonce: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PairingAuthorization {
|
|
16
|
+
version: 1;
|
|
17
|
+
serviceId: string;
|
|
18
|
+
code: string;
|
|
19
|
+
clientHash: string;
|
|
20
|
+
expiresAt: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function encodeBase64Url(bytes: Uint8Array): string;
|
|
23
|
+
export declare function decodeBase64Url(value: string, maxBytes: number): Uint8Array<ArrayBuffer>;
|
|
24
|
+
export declare function encodeClientCode(value: PairingClient): string;
|
|
25
|
+
export declare function parseClientCode(code: string): PairingClient;
|
|
26
|
+
export declare function encodePairAuthorization(value: PairingAuthorization): string;
|
|
27
|
+
export declare function parsePairAuthorization(code: string): PairingAuthorization;
|
|
28
|
+
/** UTF-8 JSON array gives unambiguous domain-separated signing bytes. */
|
|
29
|
+
export declare function pairingProofMessage(serviceId: string, origin: string, authorization: string, clientCode: string, browserName: string): Uint8Array<ArrayBuffer>;
|