@dailephd/my-centcom 0.1.0 → 0.3.0

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.
Files changed (175) hide show
  1. package/README.md +10 -5
  2. package/apps/daemon/dist/artifacts/returnSnapshots.d.ts +12 -0
  3. package/apps/daemon/dist/artifacts/returnSnapshots.js +41 -0
  4. package/apps/daemon/dist/bootstrap/app.d.ts +21 -0
  5. package/apps/daemon/dist/bootstrap/app.js +27 -0
  6. package/apps/daemon/dist/bootstrap/installLayout.d.ts +81 -0
  7. package/apps/daemon/dist/bootstrap/installLayout.js +164 -0
  8. package/apps/daemon/dist/bootstrap/main.d.ts +14 -0
  9. package/apps/daemon/dist/bootstrap/main.js +141 -0
  10. package/apps/daemon/dist/bootstrap/operatorConsole.d.ts +75 -0
  11. package/apps/daemon/dist/bootstrap/operatorConsole.js +293 -0
  12. package/apps/daemon/dist/bootstrap/privateDataRoot.d.ts +38 -0
  13. package/apps/daemon/dist/bootstrap/privateDataRoot.js +204 -0
  14. package/apps/daemon/dist/bootstrap/secureMain.d.ts +118 -0
  15. package/apps/daemon/dist/bootstrap/secureMain.js +403 -0
  16. package/apps/daemon/dist/bootstrap/setup.d.ts +93 -0
  17. package/apps/daemon/dist/bootstrap/setup.js +738 -0
  18. package/apps/daemon/dist/context/changeProposal.d.ts +97 -0
  19. package/apps/daemon/dist/context/changeProposal.js +259 -0
  20. package/apps/daemon/dist/context/gitEvidence.d.ts +88 -0
  21. package/apps/daemon/dist/context/gitEvidence.js +332 -0
  22. package/apps/daemon/dist/context/gitObservation.d.ts +30 -0
  23. package/apps/daemon/dist/context/gitObservation.js +113 -0
  24. package/apps/daemon/dist/context/projectReadIssuer.d.ts +68 -0
  25. package/apps/daemon/dist/context/projectReadIssuer.js +158 -0
  26. package/apps/daemon/dist/context/projectReadService.d.ts +153 -0
  27. package/apps/daemon/dist/context/projectReadService.js +652 -0
  28. package/apps/daemon/dist/context/projectViewService.d.ts +85 -0
  29. package/apps/daemon/dist/context/projectViewService.js +332 -0
  30. package/apps/daemon/dist/context/proposalRecorder.d.ts +11 -0
  31. package/apps/daemon/dist/context/proposalRecorder.js +19 -0
  32. package/apps/daemon/dist/plugins/drivers/codexMcpConfig.d.ts +40 -0
  33. package/apps/daemon/dist/plugins/drivers/codexMcpConfig.js +73 -0
  34. package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.d.ts +49 -0
  35. package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.js +70 -0
  36. package/apps/daemon/dist/plugins/drivers/fakePluginDriver.d.ts +16 -0
  37. package/apps/daemon/dist/plugins/drivers/fakePluginDriver.js +115 -0
  38. package/apps/daemon/dist/plugins/drivers/finiteCliDriver.d.ts +153 -0
  39. package/apps/daemon/dist/plugins/drivers/finiteCliDriver.js +505 -0
  40. package/apps/daemon/dist/plugins/registry/operationCatalog.d.ts +23 -0
  41. package/apps/daemon/dist/plugins/registry/operationCatalog.js +41 -0
  42. package/apps/daemon/dist/plugins/registry/registryOperationCatalog.d.ts +14 -0
  43. package/apps/daemon/dist/plugins/registry/registryOperationCatalog.js +29 -0
  44. package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.d.ts +151 -0
  45. package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.js +579 -0
  46. package/apps/daemon/dist/projects/codingAuthority.d.ts +102 -0
  47. package/apps/daemon/dist/projects/codingAuthority.js +244 -0
  48. package/apps/daemon/dist/projects/fixtureAuthorization.d.ts +54 -0
  49. package/apps/daemon/dist/projects/fixtureAuthorization.js +172 -0
  50. package/apps/daemon/dist/projects/pairedAuthority.d.ts +158 -0
  51. package/apps/daemon/dist/projects/pairedAuthority.js +273 -0
  52. package/apps/daemon/dist/projects/trustedCliConsent.d.ts +47 -0
  53. package/apps/daemon/dist/projects/trustedCliConsent.js +84 -0
  54. package/apps/daemon/dist/runs/changeApplier.d.ts +59 -0
  55. package/apps/daemon/dist/runs/changeApplier.js +319 -0
  56. package/apps/daemon/dist/runs/codingWorkflowService.d.ts +283 -0
  57. package/apps/daemon/dist/runs/codingWorkflowService.js +785 -0
  58. package/apps/daemon/dist/runs/durableIntentCoordinator.d.ts +72 -0
  59. package/apps/daemon/dist/runs/durableIntentCoordinator.js +160 -0
  60. package/apps/daemon/dist/runs/inMemoryCoordinator.d.ts +55 -0
  61. package/apps/daemon/dist/runs/inMemoryCoordinator.js +375 -0
  62. package/apps/daemon/dist/runs/runExecutor.d.ts +154 -0
  63. package/apps/daemon/dist/runs/runExecutor.js +295 -0
  64. package/apps/daemon/dist/runs/workflowService.d.ts +185 -0
  65. package/apps/daemon/dist/runs/workflowService.js +300 -0
  66. package/apps/daemon/dist/runtime/boundedProcessHost.d.ts +111 -0
  67. package/apps/daemon/dist/runtime/boundedProcessHost.js +752 -0
  68. package/apps/daemon/dist/runtime/evidenceRedaction.d.ts +30 -0
  69. package/apps/daemon/dist/runtime/evidenceRedaction.js +79 -0
  70. package/apps/daemon/dist/runtime/executionDiagnostics.d.ts +134 -0
  71. package/apps/daemon/dist/runtime/executionDiagnostics.js +213 -0
  72. package/apps/daemon/dist/runtime/modelExecutionPolicy.d.ts +22 -0
  73. package/apps/daemon/dist/runtime/modelExecutionPolicy.js +19 -0
  74. package/apps/daemon/dist/runtime/mxcExecution.d.ts +12 -0
  75. package/apps/daemon/dist/runtime/mxcExecution.js +163 -0
  76. package/apps/daemon/dist/runtime/mxcIntegrity.d.ts +24 -0
  77. package/apps/daemon/dist/runtime/mxcIntegrity.js +81 -0
  78. package/apps/daemon/dist/runtime/mxcWorker.d.ts +2 -0
  79. package/apps/daemon/dist/runtime/mxcWorker.js +45 -0
  80. package/apps/daemon/dist/runtime/provisionedExecution.d.ts +150 -0
  81. package/apps/daemon/dist/runtime/provisionedExecution.js +653 -0
  82. package/apps/daemon/dist/runtime/testExecution.d.ts +76 -0
  83. package/apps/daemon/dist/runtime/testExecution.js +106 -0
  84. package/apps/daemon/dist/runtime/testProfiles.d.ts +10 -0
  85. package/apps/daemon/dist/runtime/testProfiles.js +4 -0
  86. package/apps/daemon/dist/runtime/trustedAgentStaging.d.ts +89 -0
  87. package/apps/daemon/dist/runtime/trustedAgentStaging.js +262 -0
  88. package/apps/daemon/dist/runtime/trustedCaBundle.d.ts +77 -0
  89. package/apps/daemon/dist/runtime/trustedCaBundle.js +125 -0
  90. package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.d.ts +166 -0
  91. package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.js +521 -0
  92. package/apps/daemon/dist/storage/diagnosticLog.d.ts +63 -0
  93. package/apps/daemon/dist/storage/diagnosticLog.js +136 -0
  94. package/apps/daemon/dist/storage/executionTelemetry.d.ts +63 -0
  95. package/apps/daemon/dist/storage/executionTelemetry.js +247 -0
  96. package/apps/daemon/dist/storage/protectedSecrets.d.ts +39 -0
  97. package/apps/daemon/dist/storage/protectedSecrets.js +106 -0
  98. package/apps/daemon/dist/storage/sqliteLedger.d.ts +786 -0
  99. package/apps/daemon/dist/storage/sqliteLedger.js +1303 -0
  100. package/apps/daemon/dist/transports/http/dispatch.d.ts +43 -0
  101. package/apps/daemon/dist/transports/http/dispatch.js +405 -0
  102. package/apps/daemon/dist/transports/http/secureRoutes.d.ts +40 -0
  103. package/apps/daemon/dist/transports/http/secureRoutes.js +332 -0
  104. package/apps/daemon/dist/transports/http/workflowRoutes.d.ts +41 -0
  105. package/apps/daemon/dist/transports/http/workflowRoutes.js +473 -0
  106. package/apps/daemon/dist/transports/mcp/localProjectReadServer.d.ts +182 -0
  107. package/apps/daemon/dist/transports/mcp/localProjectReadServer.js +221 -0
  108. package/apps/daemon/dist/transports/native/nativeHost.d.ts +24 -0
  109. package/apps/daemon/dist/transports/native/nativeHost.js +344 -0
  110. package/apps/daemon/package.json +24 -0
  111. package/apps/daemon/src/runtime/benign/referenceEcho.mjs +27 -0
  112. package/apps/daemon/src/runtime/windows/buildSupervisor.mjs +87 -0
  113. package/apps/daemon/src/runtime/windows/supervisorMain.cs +676 -0
  114. package/apps/extension/manifest.secure.json +25 -0
  115. package/apps/extension/scripts/build.mjs +173 -0
  116. package/apps/extension/src/background/secureWorker.ts +1595 -0
  117. package/apps/extension/src/background/serviceWorker.ts +892 -0
  118. package/apps/extension/src/content/captureSelection.ts +64 -0
  119. package/apps/extension/src/content/secureInsert.ts +207 -0
  120. package/apps/extension/src/probe/index.html +41 -0
  121. package/apps/extension/src/probe/main.ts +201 -0
  122. package/apps/extension/src/sidepanel/index.html +203 -0
  123. package/apps/extension/src/sidepanel/main.ts +903 -0
  124. package/package.json +19 -3
  125. package/packages/contracts/dist/artifacts.d.ts +66 -0
  126. package/packages/contracts/dist/artifacts.js +64 -0
  127. package/packages/contracts/dist/automation.d.ts +540 -0
  128. package/packages/contracts/dist/automation.js +191 -0
  129. package/packages/contracts/dist/browser.d.ts +251 -0
  130. package/packages/contracts/dist/browser.js +131 -0
  131. package/packages/contracts/dist/context.d.ts +71 -0
  132. package/packages/contracts/dist/context.js +73 -0
  133. package/packages/contracts/dist/diagnostics.d.ts +99 -0
  134. package/packages/contracts/dist/diagnostics.js +284 -0
  135. package/packages/contracts/dist/effects.d.ts +42 -0
  136. package/packages/contracts/dist/effects.js +42 -0
  137. package/packages/contracts/dist/errors.d.ts +75 -0
  138. package/packages/contracts/dist/errors.js +70 -0
  139. package/packages/contracts/dist/events.d.ts +50 -0
  140. package/packages/contracts/dist/events.js +34 -0
  141. package/packages/contracts/dist/executionDiagnostics.d.ts +212 -0
  142. package/packages/contracts/dist/executionDiagnostics.js +101 -0
  143. package/packages/contracts/dist/identity.d.ts +54 -0
  144. package/packages/contracts/dist/identity.js +40 -0
  145. package/packages/contracts/dist/index.d.ts +20 -0
  146. package/packages/contracts/dist/index.js +20 -0
  147. package/packages/contracts/dist/invocation.d.ts +90 -0
  148. package/packages/contracts/dist/invocation.js +77 -0
  149. package/packages/contracts/dist/lifecycle.d.ts +130 -0
  150. package/packages/contracts/dist/lifecycle.js +135 -0
  151. package/packages/contracts/dist/plugin.d.ts +214 -0
  152. package/packages/contracts/dist/plugin.js +117 -0
  153. package/packages/contracts/dist/projectRead.d.ts +205 -0
  154. package/packages/contracts/dist/projectRead.js +162 -0
  155. package/packages/contracts/dist/secure.d.ts +128 -0
  156. package/packages/contracts/dist/secure.js +99 -0
  157. package/packages/contracts/package.json +32 -0
  158. package/packages/contracts/src/artifacts.ts +83 -0
  159. package/packages/contracts/src/automation.ts +238 -0
  160. package/packages/contracts/src/browser.ts +164 -0
  161. package/packages/contracts/src/context.ts +91 -0
  162. package/packages/contracts/src/diagnostics.ts +318 -0
  163. package/packages/contracts/src/effects.ts +49 -0
  164. package/packages/contracts/src/errors.ts +83 -0
  165. package/packages/contracts/src/events.ts +46 -0
  166. package/packages/contracts/src/executionDiagnostics.ts +116 -0
  167. package/packages/contracts/src/identity.ts +68 -0
  168. package/packages/contracts/src/index.ts +20 -0
  169. package/packages/contracts/src/invocation.ts +96 -0
  170. package/packages/contracts/src/lifecycle.ts +169 -0
  171. package/packages/contracts/src/plugin.ts +174 -0
  172. package/packages/contracts/src/projectRead.ts +179 -0
  173. package/packages/contracts/src/secure.ts +136 -0
  174. package/provenance.json +179 -9
  175. package/source.zip +0 -0
@@ -0,0 +1,117 @@
1
+ import { z } from 'zod';
2
+ import { SchemaVersionV1Schema, PluginIdSchema, OperationIdSchema, RunIdSchema, } from './identity.js';
3
+ import { EffectClassSchema, ExecutablePolicyV1Schema, OutputBoundsV1Schema, } from './effects.js';
4
+ export const PluginKindSchema = z.enum(['command', 'agent']);
5
+ /**
6
+ * Distinct lifecycle states of a plugin registration.
7
+ * Invariant: Registered, verified, enabled, and authorized are distinct states.
8
+ * A registered plugin does NOT automatically receive execution permission.
9
+ */
10
+ export const PluginStateSchema = z.enum([
11
+ 'registered',
12
+ 'verified',
13
+ 'enabled',
14
+ 'authorized',
15
+ ]);
16
+ /**
17
+ * Hard ceiling (UTF-8 bytes) for a prompt delivered on a supervised process's stdin (SW-052).
18
+ */
19
+ export const STDIN_MAX_BYTES_V1 = 32768;
20
+ /**
21
+ * OPTIONAL, additive input transport for an operation (SW-052). Absent means V1 behaviour: the target's stdin is 'ignore' and
22
+ * ExecutablePolicyV1.stdio is unchanged. When present the trusted driver delivers the approved prompt (UTF-8 bytes, at most maxBytes,
23
+ * never more than STDIN_MAX_BYTES_V1) on a private pipe, written once and closed. It is a declaration inside the pinned manifest, so
24
+ * it is covered by the manifest fingerprint; it is never read from a run request.
25
+ */
26
+ export const InputTransportV1Schema = z.object({
27
+ kind: z.literal('stdin_utf8'),
28
+ maxBytes: z.number().int().positive().max(STDIN_MAX_BYTES_V1),
29
+ });
30
+ /**
31
+ * Declaration of a single plugin operation.
32
+ */
33
+ export const PluginOperationV1Schema = z.object({
34
+ id: OperationIdSchema,
35
+ name: z.string().min(1),
36
+ description: z.string().min(1),
37
+ effectClass: EffectClassSchema,
38
+ inputSchema: z.record(z.string(), z.unknown()),
39
+ executablePolicy: ExecutablePolicyV1Schema,
40
+ timeoutMs: z.number().int().positive(),
41
+ outputBounds: OutputBoundsV1Schema,
42
+ projectCwdRequired: z.boolean(),
43
+ inputTransport: InputTransportV1Schema.optional(),
44
+ });
45
+ /**
46
+ * Advanced agent driver capabilities.
47
+ * Invariant: Advertised only when empirically verified.
48
+ */
49
+ export const DriverCapabilitiesV1Schema = z.object({
50
+ supportsSession: z.boolean(),
51
+ supportsApproval: z.boolean(),
52
+ supportsResume: z.boolean(),
53
+ supportsStreaming: z.boolean(),
54
+ });
55
+ /**
56
+ * Manifest defining a registered plugin and its operations.
57
+ */
58
+ export const PluginManifestV1Schema = z.object({
59
+ schemaVersion: SchemaVersionV1Schema,
60
+ id: PluginIdSchema,
61
+ kind: PluginKindSchema,
62
+ name: z.string().min(1),
63
+ version: z.string().min(1),
64
+ description: z.string().min(1),
65
+ state: PluginStateSchema,
66
+ operations: z.record(OperationIdSchema, PluginOperationV1Schema),
67
+ capabilities: DriverCapabilitiesV1Schema.optional(),
68
+ });
69
+ /**
70
+ * Probe capability report emitted by a plugin driver.
71
+ */
72
+ export const CapabilityReportSchema = z.object({
73
+ pluginId: PluginIdSchema,
74
+ installed: z.boolean(),
75
+ installedVersion: z.string().optional(),
76
+ capabilities: DriverCapabilitiesV1Schema,
77
+ details: z.record(z.string(), z.unknown()).optional(),
78
+ });
79
+ /**
80
+ * Run receipt returned upon driver invocation.
81
+ */
82
+ export const RunReceiptSchema = z.object({
83
+ runId: RunIdSchema,
84
+ pluginId: PluginIdSchema,
85
+ operationId: OperationIdSchema,
86
+ startedAt: z.string().datetime(),
87
+ processId: z.number().int().positive().optional(),
88
+ });
89
+ /**
90
+ * Cancel receipt returned upon cancellation request.
91
+ */
92
+ export const CancelReceiptSchema = z.object({
93
+ runId: RunIdSchema,
94
+ cancelledAt: z.string().datetime(),
95
+ acknowledged: z.boolean(),
96
+ processTerminated: z.boolean(),
97
+ reason: z.string().min(1),
98
+ });
99
+ /**
100
+ * Normalized result collected after run completes or halts.
101
+ */
102
+ export const NormalizedResultSchema = z.object({
103
+ runId: RunIdSchema,
104
+ exitCode: z.number().int(),
105
+ durationMs: z.number().int().nonnegative(),
106
+ outputSummary: z.string(),
107
+ tokenUsage: z
108
+ .object({
109
+ inputTokens: z.number().int().nonnegative().optional(),
110
+ outputTokens: z.number().int().nonnegative().optional(),
111
+ cachedTokens: z.number().int().nonnegative().optional(),
112
+ costUsd: z.number().nonnegative().optional(),
113
+ })
114
+ .optional(),
115
+ completedAt: z.string().datetime(),
116
+ });
117
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1,205 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * SW-074 provider-neutral, read-only, run-scoped project access contract.
4
+ *
5
+ * Owner of the SCHEMAS (packages/contracts is the single cross-component schema authority). The reader lives in C07 (apps/daemon/src/context/projectReadService.ts), the
6
+ * capability issuer in C07 (projectReadIssuer.ts), the stdio MCP adapter in the MCP transport directory, and ONLY the Codex-specific configuration in the Codex driver.
7
+ * The server itself is dependency-free and validates by hand; tests pin it against these schemas so the two cannot drift.
8
+ */
9
+ export declare const PROJECT_READ_PROTOCOL: "my-centcom.project-read/1";
10
+ /** MCP revisions the adapter will speak (newest first). It answers with the client's revision when it is in this list, otherwise with the newest. */
11
+ export declare const PROJECT_READ_MCP_PROTOCOL_VERSIONS: readonly ["2025-06-18", "2025-03-26", "2024-11-05"];
12
+ export declare const PROJECT_READ_SERVER_NAME: "centcom-project-read";
13
+ /** The exact name Codex registers the server under (mcp_servers.<name>). */
14
+ export declare const PROJECT_READ_CODEX_SERVER_ID: "centcom_project";
15
+ export declare const PROJECT_READ_ENV_CAPABILITY: "CENTCOM_PROJECT_READ_CAPABILITY";
16
+ /** Optional test/override location of the audit directory. Production never sets it: the adapter appends to <TEMP>/mcp-audit, which the daemon creates before launch. */
17
+ export declare const PROJECT_READ_ENV_AUDIT_DIR: "CENTCOM_PROJECT_READ_AUDIT_DIR";
18
+ export declare const PROJECT_READ_AUDIT_SUBDIR: "mcp-audit";
19
+ export declare const PROJECT_READ_TOOLS: readonly ["list_project_entries", "read_project_text", "get_project_file_metadata"];
20
+ export type ProjectReadTool = (typeof PROJECT_READ_TOOLS)[number];
21
+ /** SW-080: the proposal tool is NOT a read tool and is never part of PROJECT_READ_TOOLS. A capability carries it only when a PROPOSE grant authorized it for that run. */
22
+ export declare const PROJECT_PROPOSE_TOOLS: readonly ["propose_change"];
23
+ export declare const PROJECT_CAPABILITY_TOOLS: readonly ["list_project_entries", "read_project_text", "get_project_file_metadata", "propose_change"];
24
+ /** Directory (under the run's TEMP) where the adapter records submitted proposals; the daemon ingests and re-validates them. */
25
+ export declare const PROJECT_PROPOSAL_SUBDIR: "mcp-proposals";
26
+ export declare const PROJECT_READ_LIMITS: Readonly<{
27
+ /** Longest relative path accepted (characters) and deepest nesting. */
28
+ maxPathChars: 260;
29
+ maxSegments: 32;
30
+ maxSegmentChars: 120;
31
+ /** A file larger than this is refused outright (it is hashed in full for the digest). */
32
+ maxFileBytes: 1048576;
33
+ /** One text response. */
34
+ maxReadBytes: 32768;
35
+ defaultReadBytes: 16384;
36
+ maxListEntries: 200;
37
+ defaultListEntries: 100;
38
+ /** Whole-capability budgets (per MCP server process). */
39
+ maxRequests: 200;
40
+ maxTotalResponseBytes: 524288;
41
+ maxLineBytes: 65536;
42
+ maxLifetimeMs: number;
43
+ /** How long a descriptor may be trusted without being re-read (0 = re-read on every request). */
44
+ recheckIntervalMs: 0;
45
+ }>;
46
+ export declare const PROJECT_READ_DENIAL_CODES: readonly ["CAPABILITY_INVALID", "CAPABILITY_EXPIRED", "CAPABILITY_REVOKED", "CAPABILITY_MISMATCH", "PROJECT_ROOT_INVALID", "ARGUMENTS_INVALID", "PATH_INVALID", "PATH_TRAVERSAL", "PATH_ABSOLUTE", "PATH_ALTERNATE_SYNTAX", "PATH_DEVICE", "PATH_STREAM", "PATH_DENIED_POLICY", "PATH_NOT_FOUND", "PATH_ESCAPES_ROOT", "PATH_LINK", "PATH_HARDLINK", "NOT_A_FILE", "NOT_A_DIRECTORY", "FILE_TOO_LARGE", "BINARY_CONTENT", "INVALID_ENCODING", "OFFSET_INVALID", "FILE_CHANGED_DURING_READ", "REQUEST_BUDGET_EXHAUSTED", "RESPONSE_BUDGET_EXHAUSTED", "AUDIT_UNAVAILABLE", "TOOL_UNKNOWN", "READ_FAILED", "PROPOSAL_BUDGET_EXHAUSTED", "PROPOSAL_DUPLICATE", "PROPOSAL_WRITE_FAILED"];
47
+ export type ProjectReadDenialCode = (typeof PROJECT_READ_DENIAL_CODES)[number];
48
+ /** The run-scoped capability descriptor. Written ONLY by the daemon after C03 authorization; read-only for the agent identity. */
49
+ export declare const ProjectReadCapabilitySchema: z.ZodObject<{
50
+ protocol: z.ZodLiteral<"my-centcom.project-read/1">;
51
+ capabilityId: z.ZodString;
52
+ projectId: z.ZodString;
53
+ runId: z.ZodString;
54
+ grantId: z.ZodString;
55
+ canonicalRoot: z.ZodString;
56
+ issuedAt: z.ZodString;
57
+ expiresAt: z.ZodString;
58
+ tools: z.ZodArray<z.ZodEnum<{
59
+ list_project_entries: "list_project_entries";
60
+ read_project_text: "read_project_text";
61
+ get_project_file_metadata: "get_project_file_metadata";
62
+ propose_change: "propose_change";
63
+ }>>;
64
+ auditRequired: z.ZodBoolean;
65
+ limits: z.ZodObject<{
66
+ maxFileBytes: z.ZodNumber;
67
+ maxReadBytes: z.ZodNumber;
68
+ maxListEntries: z.ZodNumber;
69
+ maxRequests: z.ZodNumber;
70
+ maxTotalResponseBytes: z.ZodNumber;
71
+ }, z.core.$strict>;
72
+ }, z.core.$strict>;
73
+ export type ProjectReadCapability = z.infer<typeof ProjectReadCapabilitySchema>;
74
+ export declare const ListProjectEntriesInputSchema: z.ZodObject<{
75
+ path: z.ZodOptional<z.ZodString>;
76
+ limit: z.ZodOptional<z.ZodNumber>;
77
+ }, z.core.$strict>;
78
+ export declare const ReadProjectTextInputSchema: z.ZodObject<{
79
+ path: z.ZodString;
80
+ offset: z.ZodOptional<z.ZodNumber>;
81
+ max_bytes: z.ZodOptional<z.ZodNumber>;
82
+ }, z.core.$strict>;
83
+ export declare const GetProjectFileMetadataInputSchema: z.ZodObject<{
84
+ path: z.ZodString;
85
+ }, z.core.$strict>;
86
+ export declare const PROJECT_READ_INPUT_SCHEMAS: Readonly<{
87
+ list_project_entries: z.ZodObject<{
88
+ path: z.ZodOptional<z.ZodString>;
89
+ limit: z.ZodOptional<z.ZodNumber>;
90
+ }, z.core.$strict>;
91
+ read_project_text: z.ZodObject<{
92
+ path: z.ZodString;
93
+ offset: z.ZodOptional<z.ZodNumber>;
94
+ max_bytes: z.ZodOptional<z.ZodNumber>;
95
+ }, z.core.$strict>;
96
+ get_project_file_metadata: z.ZodObject<{
97
+ path: z.ZodString;
98
+ }, z.core.$strict>;
99
+ }>;
100
+ export declare const ListProjectEntriesResultSchema: z.ZodObject<{
101
+ provenance: z.ZodObject<{
102
+ protocol: z.ZodLiteral<"my-centcom.project-read/1">;
103
+ projectId: z.ZodString;
104
+ runId: z.ZodString;
105
+ capabilityId: z.ZodString;
106
+ observedAt: z.ZodString;
107
+ }, z.core.$strict>;
108
+ path: z.ZodString;
109
+ entries: z.ZodArray<z.ZodObject<{
110
+ name: z.ZodString;
111
+ kind: z.ZodEnum<{
112
+ file: "file";
113
+ directory: "directory";
114
+ }>;
115
+ sizeBytes: z.ZodNullable<z.ZodNumber>;
116
+ }, z.core.$strict>>;
117
+ truncated: z.ZodBoolean;
118
+ omittedByPolicy: z.ZodNumber;
119
+ }, z.core.$strict>;
120
+ export declare const ReadProjectTextResultSchema: z.ZodObject<{
121
+ provenance: z.ZodObject<{
122
+ protocol: z.ZodLiteral<"my-centcom.project-read/1">;
123
+ projectId: z.ZodString;
124
+ runId: z.ZodString;
125
+ capabilityId: z.ZodString;
126
+ observedAt: z.ZodString;
127
+ }, z.core.$strict>;
128
+ path: z.ZodString;
129
+ encoding: z.ZodLiteral<"utf-8">;
130
+ offset: z.ZodNumber;
131
+ returnedBytes: z.ZodNumber;
132
+ nextOffset: z.ZodNullable<z.ZodNumber>;
133
+ fileSizeBytes: z.ZodNumber;
134
+ fileSha256: z.ZodString;
135
+ returnedSha256: z.ZodString;
136
+ fileIdentity: z.ZodString;
137
+ truncated: z.ZodBoolean;
138
+ text: z.ZodString;
139
+ }, z.core.$strict>;
140
+ export declare const GetProjectFileMetadataResultSchema: z.ZodObject<{
141
+ provenance: z.ZodObject<{
142
+ protocol: z.ZodLiteral<"my-centcom.project-read/1">;
143
+ projectId: z.ZodString;
144
+ runId: z.ZodString;
145
+ capabilityId: z.ZodString;
146
+ observedAt: z.ZodString;
147
+ }, z.core.$strict>;
148
+ path: z.ZodString;
149
+ sizeBytes: z.ZodNumber;
150
+ sha256: z.ZodString;
151
+ fileIdentity: z.ZodString;
152
+ modifiedAt: z.ZodString;
153
+ looksLikeText: z.ZodBoolean;
154
+ }, z.core.$strict>;
155
+ /**
156
+ * Durable, content-free audit record of one tool decision. Hash-chained (prev) so a deleted or reordered record is detectable. It NEVER carries file text, the
157
+ * agent-supplied path is reduced to a digest plus a bounded, redacted, display-safe form.
158
+ */
159
+ export declare const ProjectReadAuditRecordSchema: z.ZodObject<{
160
+ v: z.ZodLiteral<1>;
161
+ seq: z.ZodNumber;
162
+ at: z.ZodString;
163
+ runId: z.ZodString;
164
+ projectId: z.ZodString;
165
+ capabilityId: z.ZodString;
166
+ event: z.ZodEnum<{
167
+ SERVER_START: "SERVER_START";
168
+ TOOL_CALL: "TOOL_CALL";
169
+ SERVER_STOP: "SERVER_STOP";
170
+ }>;
171
+ tool: z.ZodOptional<z.ZodString>;
172
+ decision: z.ZodOptional<z.ZodEnum<{
173
+ DENIED: "DENIED";
174
+ ALLOWED: "ALLOWED";
175
+ }>>;
176
+ code: z.ZodOptional<z.ZodString>;
177
+ pathSha256: z.ZodOptional<z.ZodString>;
178
+ pathDisplay: z.ZodOptional<z.ZodString>;
179
+ fileSha256: z.ZodOptional<z.ZodString>;
180
+ returnedSha256: z.ZodOptional<z.ZodString>;
181
+ returnedBytes: z.ZodOptional<z.ZodNumber>;
182
+ offset: z.ZodOptional<z.ZodNumber>;
183
+ prev: z.ZodString;
184
+ }, z.core.$strict>;
185
+ export type ProjectReadAuditRecord = z.infer<typeof ProjectReadAuditRecordSchema>;
186
+ /** Result of independently verifying an audit log against ground truth. Never inferred from a model's answer text. */
187
+ export declare const ProjectReadProvenanceSchema: z.ZodObject<{
188
+ chainIntact: z.ZodBoolean;
189
+ records: z.ZodNumber;
190
+ allowedReads: z.ZodNumber;
191
+ refusals: z.ZodNumber;
192
+ refusalCodes: z.ZodArray<z.ZodString>;
193
+ verifiedRead: z.ZodBoolean;
194
+ tokenInToolResult: z.ZodBoolean;
195
+ tokenInPrompt: z.ZodBoolean;
196
+ verdict: z.ZodEnum<{
197
+ TOOL_PROVEN: "TOOL_PROVEN";
198
+ NOT_PROVEN_NO_TOOL_READ: "NOT_PROVEN_NO_TOOL_READ";
199
+ NOT_PROVEN_AUDIT_UNTRUSTED: "NOT_PROVEN_AUDIT_UNTRUSTED";
200
+ NOT_PROVEN_TOKEN_IN_PROMPT: "NOT_PROVEN_TOKEN_IN_PROMPT";
201
+ NOT_PROVEN_DIGEST_MISMATCH: "NOT_PROVEN_DIGEST_MISMATCH";
202
+ }>;
203
+ }, z.core.$strict>;
204
+ export type ProjectReadProvenance = z.infer<typeof ProjectReadProvenanceSchema>;
205
+ //# sourceMappingURL=projectRead.d.ts.map
@@ -0,0 +1,162 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * SW-074 provider-neutral, read-only, run-scoped project access contract.
4
+ *
5
+ * Owner of the SCHEMAS (packages/contracts is the single cross-component schema authority). The reader lives in C07 (apps/daemon/src/context/projectReadService.ts), the
6
+ * capability issuer in C07 (projectReadIssuer.ts), the stdio MCP adapter in the MCP transport directory, and ONLY the Codex-specific configuration in the Codex driver.
7
+ * The server itself is dependency-free and validates by hand; tests pin it against these schemas so the two cannot drift.
8
+ */
9
+ export const PROJECT_READ_PROTOCOL = 'my-centcom.project-read/1';
10
+ /** MCP revisions the adapter will speak (newest first). It answers with the client's revision when it is in this list, otherwise with the newest. */
11
+ export const PROJECT_READ_MCP_PROTOCOL_VERSIONS = ['2025-06-18', '2025-03-26', '2024-11-05'];
12
+ export const PROJECT_READ_SERVER_NAME = 'centcom-project-read';
13
+ /** The exact name Codex registers the server under (mcp_servers.<name>). */
14
+ export const PROJECT_READ_CODEX_SERVER_ID = 'centcom_project';
15
+ export const PROJECT_READ_ENV_CAPABILITY = 'CENTCOM_PROJECT_READ_CAPABILITY';
16
+ /** Optional test/override location of the audit directory. Production never sets it: the adapter appends to <TEMP>/mcp-audit, which the daemon creates before launch. */
17
+ export const PROJECT_READ_ENV_AUDIT_DIR = 'CENTCOM_PROJECT_READ_AUDIT_DIR';
18
+ export const PROJECT_READ_AUDIT_SUBDIR = 'mcp-audit';
19
+ export const PROJECT_READ_TOOLS = ['list_project_entries', 'read_project_text', 'get_project_file_metadata'];
20
+ /** SW-080: the proposal tool is NOT a read tool and is never part of PROJECT_READ_TOOLS. A capability carries it only when a PROPOSE grant authorized it for that run. */
21
+ export const PROJECT_PROPOSE_TOOLS = ['propose_change'];
22
+ export const PROJECT_CAPABILITY_TOOLS = [...PROJECT_READ_TOOLS, ...PROJECT_PROPOSE_TOOLS];
23
+ /** Directory (under the run's TEMP) where the adapter records submitted proposals; the daemon ingests and re-validates them. */
24
+ export const PROJECT_PROPOSAL_SUBDIR = 'mcp-proposals';
25
+ export const PROJECT_READ_LIMITS = Object.freeze({
26
+ /** Longest relative path accepted (characters) and deepest nesting. */
27
+ maxPathChars: 260,
28
+ maxSegments: 32,
29
+ maxSegmentChars: 120,
30
+ /** A file larger than this is refused outright (it is hashed in full for the digest). */
31
+ maxFileBytes: 1_048_576,
32
+ /** One text response. */
33
+ maxReadBytes: 32_768,
34
+ defaultReadBytes: 16_384,
35
+ maxListEntries: 200,
36
+ defaultListEntries: 100,
37
+ /** Whole-capability budgets (per MCP server process). */
38
+ maxRequests: 200,
39
+ maxTotalResponseBytes: 524_288,
40
+ maxLineBytes: 65_536,
41
+ maxLifetimeMs: 15 * 60 * 1000,
42
+ /** How long a descriptor may be trusted without being re-read (0 = re-read on every request). */
43
+ recheckIntervalMs: 0,
44
+ });
45
+ export const PROJECT_READ_DENIAL_CODES = [
46
+ 'CAPABILITY_INVALID', 'CAPABILITY_EXPIRED', 'CAPABILITY_REVOKED', 'CAPABILITY_MISMATCH', 'PROJECT_ROOT_INVALID',
47
+ 'ARGUMENTS_INVALID', 'PATH_INVALID', 'PATH_TRAVERSAL', 'PATH_ABSOLUTE', 'PATH_ALTERNATE_SYNTAX', 'PATH_DEVICE', 'PATH_STREAM',
48
+ 'PATH_DENIED_POLICY', 'PATH_NOT_FOUND', 'PATH_ESCAPES_ROOT', 'PATH_LINK', 'PATH_HARDLINK', 'NOT_A_FILE', 'NOT_A_DIRECTORY',
49
+ 'FILE_TOO_LARGE', 'BINARY_CONTENT', 'INVALID_ENCODING', 'OFFSET_INVALID', 'FILE_CHANGED_DURING_READ',
50
+ 'REQUEST_BUDGET_EXHAUSTED', 'RESPONSE_BUDGET_EXHAUSTED', 'AUDIT_UNAVAILABLE', 'TOOL_UNKNOWN', 'READ_FAILED',
51
+ 'PROPOSAL_BUDGET_EXHAUSTED', 'PROPOSAL_DUPLICATE', 'PROPOSAL_WRITE_FAILED',
52
+ ];
53
+ /** The run-scoped capability descriptor. Written ONLY by the daemon after C03 authorization; read-only for the agent identity. */
54
+ export const ProjectReadCapabilitySchema = z.strictObject({
55
+ protocol: z.literal(PROJECT_READ_PROTOCOL),
56
+ capabilityId: z.string().regex(/^cap\.[A-Za-z0-9_-]{16,64}$/),
57
+ projectId: z.string().min(1).max(200),
58
+ runId: z.string().min(1).max(200),
59
+ grantId: z.string().min(1).max(200),
60
+ /** Canonical, physical, absolute project root (already realpath-verified by the issuer; re-verified by the server on every request). */
61
+ canonicalRoot: z.string().min(3).max(1024),
62
+ issuedAt: z.string().datetime(),
63
+ expiresAt: z.string().datetime(),
64
+ tools: z.array(z.enum(PROJECT_CAPABILITY_TOOLS)).min(1).max(PROJECT_CAPABILITY_TOOLS.length),
65
+ /** When true the adapter refuses to start (and refuses every call) unless its hash-chained audit record can be written: evidence before disclosure. */
66
+ auditRequired: z.boolean(),
67
+ limits: z.strictObject({
68
+ maxFileBytes: z.number().int().positive().max(PROJECT_READ_LIMITS.maxFileBytes),
69
+ maxReadBytes: z.number().int().positive().max(PROJECT_READ_LIMITS.maxReadBytes),
70
+ maxListEntries: z.number().int().positive().max(PROJECT_READ_LIMITS.maxListEntries),
71
+ maxRequests: z.number().int().positive().max(PROJECT_READ_LIMITS.maxRequests),
72
+ maxTotalResponseBytes: z.number().int().positive().max(PROJECT_READ_LIMITS.maxTotalResponseBytes),
73
+ }),
74
+ });
75
+ const RelPath = z.string().min(1).max(PROJECT_READ_LIMITS.maxPathChars);
76
+ export const ListProjectEntriesInputSchema = z.strictObject({
77
+ path: RelPath.optional(),
78
+ limit: z.number().int().min(1).max(PROJECT_READ_LIMITS.maxListEntries).optional(),
79
+ });
80
+ export const ReadProjectTextInputSchema = z.strictObject({
81
+ path: RelPath,
82
+ offset: z.number().int().min(0).max(PROJECT_READ_LIMITS.maxFileBytes).optional(),
83
+ max_bytes: z.number().int().min(1).max(PROJECT_READ_LIMITS.maxReadBytes).optional(),
84
+ });
85
+ export const GetProjectFileMetadataInputSchema = z.strictObject({ path: RelPath });
86
+ export const PROJECT_READ_INPUT_SCHEMAS = Object.freeze({
87
+ list_project_entries: ListProjectEntriesInputSchema,
88
+ read_project_text: ReadProjectTextInputSchema,
89
+ get_project_file_metadata: GetProjectFileMetadataInputSchema,
90
+ });
91
+ const Sha = z.string().regex(/^[a-f0-9]{64}$/);
92
+ const Provenance = z.strictObject({
93
+ protocol: z.literal(PROJECT_READ_PROTOCOL),
94
+ projectId: z.string(), runId: z.string(), capabilityId: z.string(),
95
+ observedAt: z.string().datetime(),
96
+ });
97
+ export const ListProjectEntriesResultSchema = z.strictObject({
98
+ provenance: Provenance,
99
+ path: z.string(),
100
+ entries: z.array(z.strictObject({ name: z.string(), kind: z.enum(['file', 'directory']), sizeBytes: z.number().int().nonnegative().nullable() })),
101
+ truncated: z.boolean(),
102
+ omittedByPolicy: z.number().int().nonnegative(),
103
+ });
104
+ export const ReadProjectTextResultSchema = z.strictObject({
105
+ provenance: Provenance,
106
+ path: z.string(),
107
+ encoding: z.literal('utf-8'),
108
+ offset: z.number().int().nonnegative(),
109
+ returnedBytes: z.number().int().nonnegative(),
110
+ nextOffset: z.number().int().nonnegative().nullable(),
111
+ fileSizeBytes: z.number().int().nonnegative(),
112
+ fileSha256: Sha,
113
+ returnedSha256: Sha,
114
+ fileIdentity: z.string(),
115
+ truncated: z.boolean(),
116
+ text: z.string(),
117
+ });
118
+ export const GetProjectFileMetadataResultSchema = z.strictObject({
119
+ provenance: Provenance,
120
+ path: z.string(),
121
+ sizeBytes: z.number().int().nonnegative(),
122
+ sha256: Sha,
123
+ fileIdentity: z.string(),
124
+ modifiedAt: z.string().datetime(),
125
+ looksLikeText: z.boolean(),
126
+ });
127
+ /**
128
+ * Durable, content-free audit record of one tool decision. Hash-chained (prev) so a deleted or reordered record is detectable. It NEVER carries file text, the
129
+ * agent-supplied path is reduced to a digest plus a bounded, redacted, display-safe form.
130
+ */
131
+ export const ProjectReadAuditRecordSchema = z.strictObject({
132
+ v: z.literal(1),
133
+ seq: z.number().int().nonnegative(),
134
+ at: z.string().datetime(),
135
+ runId: z.string(),
136
+ projectId: z.string(),
137
+ capabilityId: z.string(),
138
+ event: z.enum(['SERVER_START', 'TOOL_CALL', 'SERVER_STOP']),
139
+ tool: z.string().max(64).optional(),
140
+ decision: z.enum(['ALLOWED', 'DENIED']).optional(),
141
+ code: z.string().max(40).optional(),
142
+ pathSha256: Sha.optional(),
143
+ pathDisplay: z.string().max(120).optional(),
144
+ fileSha256: Sha.optional(),
145
+ returnedSha256: Sha.optional(),
146
+ returnedBytes: z.number().int().nonnegative().optional(),
147
+ offset: z.number().int().nonnegative().optional(),
148
+ prev: z.string().regex(/^[a-f0-9]{64}$/),
149
+ });
150
+ /** Result of independently verifying an audit log against ground truth. Never inferred from a model's answer text. */
151
+ export const ProjectReadProvenanceSchema = z.strictObject({
152
+ chainIntact: z.boolean(),
153
+ records: z.number().int().nonnegative(),
154
+ allowedReads: z.number().int().nonnegative(),
155
+ refusals: z.number().int().nonnegative(),
156
+ refusalCodes: z.array(z.string()),
157
+ verifiedRead: z.boolean(),
158
+ tokenInToolResult: z.boolean(),
159
+ tokenInPrompt: z.boolean(),
160
+ verdict: z.enum(['TOOL_PROVEN', 'NOT_PROVEN_NO_TOOL_READ', 'NOT_PROVEN_AUDIT_UNTRUSTED', 'NOT_PROVEN_TOKEN_IN_PROMPT', 'NOT_PROVEN_DIGEST_MISMATCH']),
161
+ });
162
+ //# sourceMappingURL=projectRead.js.map
@@ -0,0 +1,128 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * B02-A secure pairing and durable-intent contracts (additive; schema version 1).
4
+ * These are used only by the secure daemon mode, which authenticates with an
5
+ * Authorization header; the legacy LoopbackHttpRequestV1 body-token contract is unchanged.
6
+ */
7
+ export declare const PROMPT_MAX_UTF8_BYTES = 16384;
8
+ /** chrome-extension:// followed by exactly 32 letters in [a-p]; no path, query, userinfo or fragment. */
9
+ export declare const EXTENSION_ORIGIN_PATTERN: RegExp;
10
+ export declare const ExtensionOriginSchema: z.ZodString;
11
+ export declare const PairCompleteRequestV1Schema: z.ZodObject<{
12
+ schemaVersion: z.ZodLiteral<1>;
13
+ challengeId: z.ZodString;
14
+ code: z.ZodString;
15
+ }, z.core.$strict>;
16
+ export type PairCompleteRequestV1 = z.infer<typeof PairCompleteRequestV1Schema>;
17
+ export declare const PairCompleteResponseV1Schema: z.ZodObject<{
18
+ schemaVersion: z.ZodLiteral<1>;
19
+ principalId: z.ZodString;
20
+ bearerToken: z.ZodString;
21
+ pairedOrigin: z.ZodString;
22
+ expiresAt: z.ZodString;
23
+ }, z.core.$strict>;
24
+ export type PairCompleteResponseV1 = z.infer<typeof PairCompleteResponseV1Schema>;
25
+ /**
26
+ * SW-053: the HTTP ceiling for an operation that declares the stdin_utf8 input transport (equals STDIN_MAX_BYTES_V1). The default
27
+ * ceiling above is unchanged; the route applies this larger one ONLY when trusted composition says the operation allows it.
28
+ */
29
+ export declare const PROMPT_MAX_UTF8_BYTES_STDIN_V1 = 32768;
30
+ export declare const PrepareIntentRequestV1Schema: z.ZodObject<{
31
+ schemaVersion: z.ZodLiteral<1>;
32
+ requestId: z.core.$ZodBranded<z.ZodString, "BrowserRequestId", "out">;
33
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
34
+ pluginId: z.core.$ZodBranded<z.ZodString, "PluginId", "out">;
35
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
36
+ idempotencyKey: z.core.$ZodBranded<z.ZodString, "IdempotencyKey", "out">;
37
+ params: z.ZodObject<{
38
+ prompt: z.ZodString;
39
+ }, z.core.$strict>;
40
+ requestedAt: z.ZodString;
41
+ requiresUserApproval: z.ZodLiteral<true>;
42
+ }, z.core.$strict>;
43
+ /** Same envelope with the larger stdin-operation prompt ceiling; the route still enforces the per-operation cap. */
44
+ export declare const PrepareIntentRequestStdinV1Schema: z.ZodObject<{
45
+ schemaVersion: z.ZodLiteral<1>;
46
+ requestId: z.core.$ZodBranded<z.ZodString, "BrowserRequestId", "out">;
47
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
48
+ pluginId: z.core.$ZodBranded<z.ZodString, "PluginId", "out">;
49
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
50
+ idempotencyKey: z.core.$ZodBranded<z.ZodString, "IdempotencyKey", "out">;
51
+ params: z.ZodObject<{
52
+ prompt: z.ZodString;
53
+ }, z.core.$strict>;
54
+ requestedAt: z.ZodString;
55
+ requiresUserApproval: z.ZodLiteral<true>;
56
+ }, z.core.$strict>;
57
+ export type PrepareIntentRequestV1 = z.infer<typeof PrepareIntentRequestV1Schema>;
58
+ export declare const PrepareIntentResponseV1Schema: z.ZodObject<{
59
+ schemaVersion: z.ZodLiteral<1>;
60
+ requestId: z.core.$ZodBranded<z.ZodString, "BrowserRequestId", "out">;
61
+ runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
62
+ lifecycleState: z.ZodLiteral<"AWAITING_USER_APPROVAL">;
63
+ duplicate: z.ZodBoolean;
64
+ createdAt: z.ZodString;
65
+ }, z.core.$strict>;
66
+ export type PrepareIntentResponseV1 = z.infer<typeof PrepareIntentResponseV1Schema>;
67
+ export declare const RunStatusResponseV1Schema: z.ZodObject<{
68
+ schemaVersion: z.ZodLiteral<1>;
69
+ runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
70
+ lifecycleState: z.ZodEnum<{
71
+ CREATED: "CREATED";
72
+ AWAITING_USER_APPROVAL: "AWAITING_USER_APPROVAL";
73
+ QUEUED: "QUEUED";
74
+ STARTING: "STARTING";
75
+ RUNNING: "RUNNING";
76
+ WAITING_AGENT_APPROVAL: "WAITING_AGENT_APPROVAL";
77
+ CANCEL_REQUESTED: "CANCEL_REQUESTED";
78
+ COMPLETED: "COMPLETED";
79
+ FAILED: "FAILED";
80
+ CANCELLED: "CANCELLED";
81
+ UNKNOWN: "UNKNOWN";
82
+ }>;
83
+ createdAt: z.ZodString;
84
+ updatedAt: z.ZodString;
85
+ }, z.core.$strict>;
86
+ export type RunStatusResponseV1 = z.infer<typeof RunStatusResponseV1Schema>;
87
+ /**
88
+ * B02-D: read-only status lookup by POST. Chromium sends no Origin header on a GET from an extension
89
+ * worker but does on a JSON POST, so POST /v1/runs/:runId/status carries the exact-Origin binding.
90
+ * The body is only the schema version; the run id is in the path. The response is RunStatusResponseV1.
91
+ */
92
+ export declare const RunStatusReadRequestV1Schema: z.ZodObject<{
93
+ schemaVersion: z.ZodLiteral<1>;
94
+ }, z.core.$strict>;
95
+ export type RunStatusReadRequestV1 = z.infer<typeof RunStatusReadRequestV1Schema>;
96
+ /** B02-B: one-time trusted-challenge approval (queues a run; never launches anything). */
97
+ export declare const ApproveRunRequestV1Schema: z.ZodObject<{
98
+ schemaVersion: z.ZodLiteral<1>;
99
+ approvalId: z.ZodString;
100
+ approvalCode: z.ZodString;
101
+ }, z.core.$strict>;
102
+ export type ApproveRunRequestV1 = z.infer<typeof ApproveRunRequestV1Schema>;
103
+ /** B02-B: cancellation of a pending or queued run. The reason is validated but never persisted or echoed. */
104
+ export declare const CancelPendingRunRequestV1Schema: z.ZodObject<{
105
+ schemaVersion: z.ZodLiteral<1>;
106
+ reason: z.ZodString;
107
+ }, z.core.$strict>;
108
+ export type CancelPendingRunRequestV1 = z.infer<typeof CancelPendingRunRequestV1Schema>;
109
+ export declare const RunDecisionResponseV1Schema: z.ZodObject<{
110
+ schemaVersion: z.ZodLiteral<1>;
111
+ runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
112
+ lifecycleState: z.ZodEnum<{
113
+ QUEUED: "QUEUED";
114
+ CANCELLED: "CANCELLED";
115
+ }>;
116
+ updatedAt: z.ZodString;
117
+ duplicate: z.ZodBoolean;
118
+ }, z.core.$strict>;
119
+ /** SW-053: cancel of a run that is already starting/running was accepted and persisted; the terminal state arrives via status. */
120
+ export declare const RunCancelAcceptedResponseV1Schema: z.ZodObject<{
121
+ schemaVersion: z.ZodLiteral<1>;
122
+ runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
123
+ lifecycleState: z.ZodLiteral<"CANCEL_REQUESTED">;
124
+ updatedAt: z.ZodString;
125
+ }, z.core.$strict>;
126
+ export type RunCancelAcceptedResponseV1 = z.infer<typeof RunCancelAcceptedResponseV1Schema>;
127
+ export type RunDecisionResponseV1 = z.infer<typeof RunDecisionResponseV1Schema>;
128
+ //# sourceMappingURL=secure.d.ts.map