@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,151 @@
1
+ /**
2
+ * C04 nonexecuting plugin registration, executable identity pinning and capability DECLARATION catalog (B03-B).
3
+ *
4
+ * This module never starts a process, imports no process, worker, database, HTTP or authorization module, and
5
+ * grants nothing. It records facts and keeps them apart:
6
+ *
7
+ * REGISTERED the manifest was parsed strictly and stored in this process-local catalog.
8
+ * IDENTITY_PINNED the exact local executable FILE (canonical path, SHA-256 of its bytes, file id and size)
9
+ * and the manifest FINGERPRINT were recorded. This says nothing about behavior or safety.
10
+ * CAPABILITIES_DECLARED the manifest advertises operations / driver capabilities. Not empirical.
11
+ * CAPABILITIES_VERIFIED needs a behavioral probe of the installed CLI. UNREACHABLE here: always false.
12
+ * ENABLED / AUTHORIZED separate C03/C05 decisions. UNREACHABLE here: always false / never granted.
13
+ *
14
+ * The executable path comes ONLY from the trusted in-process caller (never from the manifest, HTTP or a browser).
15
+ * The manifest `state` field is never a trust input: anything other than 'registered' is refused. There is no
16
+ * unregister or replace operation; a changed manifest or executable under a registered id fails closed.
17
+ * Revalidation re-reads the file and re-hashes it; a previous success is never treated as a standing permission.
18
+ * The gap between a successful check and a later process start is TOCTOU_NOT_VERIFIED and belongs to the future
19
+ * launcher. Windows-injected child environment variables and all filesystem containment belong to C06 and the
20
+ * future OS containment gate; this module cannot claim to address them.
21
+ */
22
+ export type RegistryErrorCode = 'REGISTER_INPUT_INVALID' | 'MANIFEST_TOO_LARGE' | 'MANIFEST_INVALID' | 'MANIFEST_UNKNOWN_FIELD' | 'MANIFEST_TRUST_PROMOTION' | 'MANIFEST_UNSAFE_POLICY' | 'MANIFEST_DUPLICATE_OPERATION' | 'EXECUTABLE_PATH_INVALID' | 'EXECUTABLE_TOO_LARGE' | 'EXECUTABLE_UNSTABLE' | 'EXECUTABLE_POLICY_MISMATCH' | 'PLUGIN_CONFLICT' | 'EXECUTABLE_CONFLICT' | 'REGISTRY_FULL' | 'OPTIONS_INVALID';
23
+ /** Sanitized: a fixed code only, never a path, manifest text, digest or file content. */
24
+ export declare class CapabilityRegistryError extends Error {
25
+ readonly code: RegistryErrorCode;
26
+ constructor(code: RegistryErrorCode);
27
+ }
28
+ export type RevalidationReason = 'UNKNOWN_PLUGIN' | 'UNKNOWN_OPERATION' | 'EXECUTABLE_MISSING' | 'EXECUTABLE_CHANGED' | 'CODE_INPUT_MISSING' | 'CODE_INPUT_CHANGED' | 'MANIFEST_CHANGED' | 'INPUT_INVALID';
29
+ export interface DeclaredOperationSummary {
30
+ readonly operationId: string;
31
+ readonly name: string;
32
+ readonly effectClass: 'read' | 'write_project' | 'external_network' | 'destructive';
33
+ readonly timeoutMs: number;
34
+ readonly maxOutputBytes: number;
35
+ readonly projectCwdRequired: boolean;
36
+ readonly declaredExecutable: string;
37
+ readonly argumentCount: number;
38
+ /** SW-051: frozen copy of the manifest's fixed argument-vector template (part of the pinned fingerprint). Data only; never executed here. */
39
+ readonly argvTemplate: readonly string[];
40
+ /** SW-052: the operation's declared input transport (inside the pinned fingerprint), or null = V1 behaviour (stdin ignored). */
41
+ readonly inputTransport: Readonly<{
42
+ kind: 'stdin_utf8';
43
+ maxBytes: number;
44
+ }> | null;
45
+ /** Declared by the manifest only. */
46
+ readonly declared: true;
47
+ /** Never true in C04: no behavioral probe exists here. */
48
+ readonly verified: false;
49
+ }
50
+ export interface PluginTrustStatus {
51
+ readonly state: 'registered';
52
+ readonly identityPinned: true;
53
+ readonly capabilitiesDeclared: boolean;
54
+ readonly capabilitiesVerified: false;
55
+ readonly capabilityProbe: 'NOT_PERFORMED';
56
+ readonly selection: 'DISABLED';
57
+ readonly authorization: 'UNAUTHORIZED';
58
+ readonly execution: 'NOT_AVAILABLE_IN_C04';
59
+ readonly spawnRace: 'TOCTOU_NOT_VERIFIED';
60
+ readonly osContainment: 'NOT_VERIFIED';
61
+ }
62
+ export interface PinnedExecutableIdentity {
63
+ readonly canonicalPath: string;
64
+ readonly sha256: string;
65
+ readonly sizeBytes: number;
66
+ readonly fileId: string;
67
+ readonly pinnedAt: string;
68
+ }
69
+ /** SW-052: identity of one code-bearing input (for example the script an interpreter executes), supplied by trusted composition only. */
70
+ export interface PinnedCodeInput {
71
+ readonly canonicalPath: string;
72
+ readonly sha256: string;
73
+ readonly sizeBytes: number;
74
+ readonly fileId: string;
75
+ }
76
+ export interface PinnedPluginRecord {
77
+ readonly pluginId: string;
78
+ readonly kind: 'command' | 'agent';
79
+ readonly name: string;
80
+ readonly version: string;
81
+ readonly description: string;
82
+ /** SHA-256 over the documented canonical encoding of the validated manifest (see fingerprintManifest). */
83
+ readonly manifestFingerprint: string;
84
+ readonly executable: PinnedExecutableIdentity;
85
+ /** SW-052: pinned code-bearing inputs, sorted by canonical path (empty when none were supplied). */
86
+ readonly codeInputs: readonly PinnedCodeInput[];
87
+ /** SW-052: SHA-256 over the canonical encoding of codeInputs, or null when there are none. */
88
+ readonly codeInputsSha256: string | null;
89
+ /** Declaration order of the manifest. */
90
+ readonly operations: readonly DeclaredOperationSummary[];
91
+ /** Declared only; null when the manifest declared none. */
92
+ readonly declaredDriverCapabilities: Readonly<{
93
+ supportsSession: boolean;
94
+ supportsApproval: boolean;
95
+ supportsResume: boolean;
96
+ supportsStreaming: boolean;
97
+ }> | null;
98
+ readonly status: PluginTrustStatus;
99
+ }
100
+ export type RevalidationResult = {
101
+ readonly ok: true;
102
+ readonly record: PinnedPluginRecord;
103
+ } | {
104
+ readonly ok: false;
105
+ readonly reason: RevalidationReason;
106
+ };
107
+ export type OperationInspection = {
108
+ readonly ok: true;
109
+ readonly record: PinnedPluginRecord;
110
+ readonly operation: DeclaredOperationSummary;
111
+ } | {
112
+ readonly ok: false;
113
+ readonly reason: RevalidationReason;
114
+ };
115
+ export interface RegisterInput {
116
+ /** Bounded plain UTF-8 JSON text (or its bytes). */
117
+ readonly manifestJson: string | Uint8Array;
118
+ /** Absolute path of the installed executable, supplied by trusted local composition only. */
119
+ readonly executablePath: string;
120
+ /** SW-052: optional absolute paths of code-bearing files the operation executes through the interpreter (at most 8). Trusted composition only. */
121
+ readonly codeInputPaths?: readonly string[];
122
+ }
123
+ export interface VerifiedCapabilityRegistry {
124
+ register(input: RegisterInput): Promise<PinnedPluginRecord>;
125
+ list(): readonly PinnedPluginRecord[];
126
+ get(pluginId: string): PinnedPluginRecord | undefined;
127
+ /** Re-reads and re-hashes the executable; optionally re-checks the current manifest source against the pinned fingerprint. */
128
+ revalidate(pluginId: string, options?: {
129
+ currentManifestJson?: string | Uint8Array;
130
+ }): Promise<RevalidationResult>;
131
+ /** revalidate() plus an exact operation lookup. Returns a frozen snapshot, never a permission to run. */
132
+ inspectOperation(pluginId: string, operationId: string, options?: {
133
+ currentManifestJson?: string | Uint8Array;
134
+ }): Promise<OperationInspection>;
135
+ }
136
+ export declare const MAX_MANIFEST_BYTES = 262144;
137
+ export declare const MAX_EXECUTABLE_BYTES: number;
138
+ /**
139
+ * Manifest fingerprint = SHA-256 (hex) of the UTF-8 bytes of
140
+ * "my-centcom/c04/manifest-fingerprint/v1\n" + canonicalJson(parsedManifest)
141
+ * where canonicalJson writes object keys in code-unit sorted order with no whitespace. The input is the strictly
142
+ * parsed manifest (duplicate keys, prototype keys and unknown fields already refused), so JSON key order and
143
+ * whitespace in the source text do not change the fingerprint, and every semantic field does.
144
+ */
145
+ export declare function fingerprintManifest(parsed: unknown): string;
146
+ export declare function createVerifiedCapabilityRegistry(options?: {
147
+ maxManifestBytes?: number;
148
+ maxExecutableBytes?: number;
149
+ now?: () => number;
150
+ }): VerifiedCapabilityRegistry;
151
+ //# sourceMappingURL=verifiedCapabilityRegistry.d.ts.map