@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.
- package/README.md +10 -5
- package/apps/daemon/dist/artifacts/returnSnapshots.d.ts +12 -0
- package/apps/daemon/dist/artifacts/returnSnapshots.js +41 -0
- package/apps/daemon/dist/bootstrap/app.d.ts +21 -0
- package/apps/daemon/dist/bootstrap/app.js +27 -0
- package/apps/daemon/dist/bootstrap/installLayout.d.ts +81 -0
- package/apps/daemon/dist/bootstrap/installLayout.js +164 -0
- package/apps/daemon/dist/bootstrap/main.d.ts +14 -0
- package/apps/daemon/dist/bootstrap/main.js +141 -0
- package/apps/daemon/dist/bootstrap/operatorConsole.d.ts +75 -0
- package/apps/daemon/dist/bootstrap/operatorConsole.js +293 -0
- package/apps/daemon/dist/bootstrap/privateDataRoot.d.ts +38 -0
- package/apps/daemon/dist/bootstrap/privateDataRoot.js +204 -0
- package/apps/daemon/dist/bootstrap/secureMain.d.ts +118 -0
- package/apps/daemon/dist/bootstrap/secureMain.js +403 -0
- package/apps/daemon/dist/bootstrap/setup.d.ts +93 -0
- package/apps/daemon/dist/bootstrap/setup.js +738 -0
- package/apps/daemon/dist/context/changeProposal.d.ts +97 -0
- package/apps/daemon/dist/context/changeProposal.js +259 -0
- package/apps/daemon/dist/context/gitEvidence.d.ts +88 -0
- package/apps/daemon/dist/context/gitEvidence.js +332 -0
- package/apps/daemon/dist/context/gitObservation.d.ts +30 -0
- package/apps/daemon/dist/context/gitObservation.js +113 -0
- package/apps/daemon/dist/context/projectReadIssuer.d.ts +68 -0
- package/apps/daemon/dist/context/projectReadIssuer.js +158 -0
- package/apps/daemon/dist/context/projectReadService.d.ts +153 -0
- package/apps/daemon/dist/context/projectReadService.js +652 -0
- package/apps/daemon/dist/context/projectViewService.d.ts +85 -0
- package/apps/daemon/dist/context/projectViewService.js +332 -0
- package/apps/daemon/dist/context/proposalRecorder.d.ts +11 -0
- package/apps/daemon/dist/context/proposalRecorder.js +19 -0
- package/apps/daemon/dist/plugins/drivers/codexMcpConfig.d.ts +40 -0
- package/apps/daemon/dist/plugins/drivers/codexMcpConfig.js +73 -0
- package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.d.ts +49 -0
- package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.js +70 -0
- package/apps/daemon/dist/plugins/drivers/fakePluginDriver.d.ts +16 -0
- package/apps/daemon/dist/plugins/drivers/fakePluginDriver.js +115 -0
- package/apps/daemon/dist/plugins/drivers/finiteCliDriver.d.ts +153 -0
- package/apps/daemon/dist/plugins/drivers/finiteCliDriver.js +505 -0
- package/apps/daemon/dist/plugins/registry/operationCatalog.d.ts +23 -0
- package/apps/daemon/dist/plugins/registry/operationCatalog.js +41 -0
- package/apps/daemon/dist/plugins/registry/registryOperationCatalog.d.ts +14 -0
- package/apps/daemon/dist/plugins/registry/registryOperationCatalog.js +29 -0
- package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.d.ts +151 -0
- package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.js +579 -0
- package/apps/daemon/dist/projects/codingAuthority.d.ts +102 -0
- package/apps/daemon/dist/projects/codingAuthority.js +244 -0
- package/apps/daemon/dist/projects/fixtureAuthorization.d.ts +54 -0
- package/apps/daemon/dist/projects/fixtureAuthorization.js +172 -0
- package/apps/daemon/dist/projects/pairedAuthority.d.ts +158 -0
- package/apps/daemon/dist/projects/pairedAuthority.js +273 -0
- package/apps/daemon/dist/projects/trustedCliConsent.d.ts +47 -0
- package/apps/daemon/dist/projects/trustedCliConsent.js +84 -0
- package/apps/daemon/dist/runs/changeApplier.d.ts +59 -0
- package/apps/daemon/dist/runs/changeApplier.js +319 -0
- package/apps/daemon/dist/runs/codingWorkflowService.d.ts +283 -0
- package/apps/daemon/dist/runs/codingWorkflowService.js +785 -0
- package/apps/daemon/dist/runs/durableIntentCoordinator.d.ts +72 -0
- package/apps/daemon/dist/runs/durableIntentCoordinator.js +160 -0
- package/apps/daemon/dist/runs/inMemoryCoordinator.d.ts +55 -0
- package/apps/daemon/dist/runs/inMemoryCoordinator.js +375 -0
- package/apps/daemon/dist/runs/runExecutor.d.ts +154 -0
- package/apps/daemon/dist/runs/runExecutor.js +295 -0
- package/apps/daemon/dist/runs/workflowService.d.ts +185 -0
- package/apps/daemon/dist/runs/workflowService.js +300 -0
- package/apps/daemon/dist/runtime/boundedProcessHost.d.ts +111 -0
- package/apps/daemon/dist/runtime/boundedProcessHost.js +752 -0
- package/apps/daemon/dist/runtime/evidenceRedaction.d.ts +30 -0
- package/apps/daemon/dist/runtime/evidenceRedaction.js +79 -0
- package/apps/daemon/dist/runtime/executionDiagnostics.d.ts +134 -0
- package/apps/daemon/dist/runtime/executionDiagnostics.js +213 -0
- package/apps/daemon/dist/runtime/modelExecutionPolicy.d.ts +22 -0
- package/apps/daemon/dist/runtime/modelExecutionPolicy.js +19 -0
- package/apps/daemon/dist/runtime/mxcExecution.d.ts +12 -0
- package/apps/daemon/dist/runtime/mxcExecution.js +163 -0
- package/apps/daemon/dist/runtime/mxcIntegrity.d.ts +24 -0
- package/apps/daemon/dist/runtime/mxcIntegrity.js +81 -0
- package/apps/daemon/dist/runtime/mxcWorker.d.ts +2 -0
- package/apps/daemon/dist/runtime/mxcWorker.js +45 -0
- package/apps/daemon/dist/runtime/provisionedExecution.d.ts +150 -0
- package/apps/daemon/dist/runtime/provisionedExecution.js +653 -0
- package/apps/daemon/dist/runtime/testExecution.d.ts +76 -0
- package/apps/daemon/dist/runtime/testExecution.js +106 -0
- package/apps/daemon/dist/runtime/testProfiles.d.ts +10 -0
- package/apps/daemon/dist/runtime/testProfiles.js +4 -0
- package/apps/daemon/dist/runtime/trustedAgentStaging.d.ts +89 -0
- package/apps/daemon/dist/runtime/trustedAgentStaging.js +262 -0
- package/apps/daemon/dist/runtime/trustedCaBundle.d.ts +77 -0
- package/apps/daemon/dist/runtime/trustedCaBundle.js +125 -0
- package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.d.ts +166 -0
- package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.js +521 -0
- package/apps/daemon/dist/storage/diagnosticLog.d.ts +63 -0
- package/apps/daemon/dist/storage/diagnosticLog.js +136 -0
- package/apps/daemon/dist/storage/executionTelemetry.d.ts +63 -0
- package/apps/daemon/dist/storage/executionTelemetry.js +247 -0
- package/apps/daemon/dist/storage/protectedSecrets.d.ts +39 -0
- package/apps/daemon/dist/storage/protectedSecrets.js +106 -0
- package/apps/daemon/dist/storage/sqliteLedger.d.ts +786 -0
- package/apps/daemon/dist/storage/sqliteLedger.js +1303 -0
- package/apps/daemon/dist/transports/http/dispatch.d.ts +43 -0
- package/apps/daemon/dist/transports/http/dispatch.js +405 -0
- package/apps/daemon/dist/transports/http/secureRoutes.d.ts +40 -0
- package/apps/daemon/dist/transports/http/secureRoutes.js +332 -0
- package/apps/daemon/dist/transports/http/workflowRoutes.d.ts +41 -0
- package/apps/daemon/dist/transports/http/workflowRoutes.js +473 -0
- package/apps/daemon/dist/transports/mcp/localProjectReadServer.d.ts +182 -0
- package/apps/daemon/dist/transports/mcp/localProjectReadServer.js +221 -0
- package/apps/daemon/dist/transports/native/nativeHost.d.ts +24 -0
- package/apps/daemon/dist/transports/native/nativeHost.js +344 -0
- package/apps/daemon/package.json +24 -0
- package/apps/daemon/src/runtime/benign/referenceEcho.mjs +27 -0
- package/apps/daemon/src/runtime/windows/buildSupervisor.mjs +87 -0
- package/apps/daemon/src/runtime/windows/supervisorMain.cs +676 -0
- package/apps/extension/manifest.secure.json +25 -0
- package/apps/extension/scripts/build.mjs +173 -0
- package/apps/extension/src/background/secureWorker.ts +1595 -0
- package/apps/extension/src/background/serviceWorker.ts +892 -0
- package/apps/extension/src/content/captureSelection.ts +64 -0
- package/apps/extension/src/content/secureInsert.ts +207 -0
- package/apps/extension/src/probe/index.html +41 -0
- package/apps/extension/src/probe/main.ts +201 -0
- package/apps/extension/src/sidepanel/index.html +203 -0
- package/apps/extension/src/sidepanel/main.ts +903 -0
- package/package.json +19 -3
- package/packages/contracts/dist/artifacts.d.ts +66 -0
- package/packages/contracts/dist/artifacts.js +64 -0
- package/packages/contracts/dist/automation.d.ts +540 -0
- package/packages/contracts/dist/automation.js +191 -0
- package/packages/contracts/dist/browser.d.ts +251 -0
- package/packages/contracts/dist/browser.js +131 -0
- package/packages/contracts/dist/context.d.ts +71 -0
- package/packages/contracts/dist/context.js +73 -0
- package/packages/contracts/dist/diagnostics.d.ts +99 -0
- package/packages/contracts/dist/diagnostics.js +284 -0
- package/packages/contracts/dist/effects.d.ts +42 -0
- package/packages/contracts/dist/effects.js +42 -0
- package/packages/contracts/dist/errors.d.ts +75 -0
- package/packages/contracts/dist/errors.js +70 -0
- package/packages/contracts/dist/events.d.ts +50 -0
- package/packages/contracts/dist/events.js +34 -0
- package/packages/contracts/dist/executionDiagnostics.d.ts +212 -0
- package/packages/contracts/dist/executionDiagnostics.js +101 -0
- package/packages/contracts/dist/identity.d.ts +54 -0
- package/packages/contracts/dist/identity.js +40 -0
- package/packages/contracts/dist/index.d.ts +20 -0
- package/packages/contracts/dist/index.js +20 -0
- package/packages/contracts/dist/invocation.d.ts +90 -0
- package/packages/contracts/dist/invocation.js +77 -0
- package/packages/contracts/dist/lifecycle.d.ts +130 -0
- package/packages/contracts/dist/lifecycle.js +135 -0
- package/packages/contracts/dist/plugin.d.ts +214 -0
- package/packages/contracts/dist/plugin.js +117 -0
- package/packages/contracts/dist/projectRead.d.ts +205 -0
- package/packages/contracts/dist/projectRead.js +162 -0
- package/packages/contracts/dist/secure.d.ts +128 -0
- package/packages/contracts/dist/secure.js +99 -0
- package/packages/contracts/package.json +32 -0
- package/packages/contracts/src/artifacts.ts +83 -0
- package/packages/contracts/src/automation.ts +238 -0
- package/packages/contracts/src/browser.ts +164 -0
- package/packages/contracts/src/context.ts +91 -0
- package/packages/contracts/src/diagnostics.ts +318 -0
- package/packages/contracts/src/effects.ts +49 -0
- package/packages/contracts/src/errors.ts +83 -0
- package/packages/contracts/src/events.ts +46 -0
- package/packages/contracts/src/executionDiagnostics.ts +116 -0
- package/packages/contracts/src/identity.ts +68 -0
- package/packages/contracts/src/index.ts +20 -0
- package/packages/contracts/src/invocation.ts +96 -0
- package/packages/contracts/src/lifecycle.ts +169 -0
- package/packages/contracts/src/plugin.ts +174 -0
- package/packages/contracts/src/projectRead.ts +179 -0
- package/packages/contracts/src/secure.ts +136 -0
- package/provenance.json +179 -9
- package/source.zip +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Unauthorized operation request submitted by user/browser.
|
|
4
|
+
* Invariant: Must not be treated as an authorized invocation without an explicit grant.
|
|
5
|
+
*/
|
|
6
|
+
export declare const OperationRequestV1Schema: z.ZodObject<{
|
|
7
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
8
|
+
requestId: z.core.$ZodBranded<z.ZodString, "BrowserRequestId", "out">;
|
|
9
|
+
projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
|
|
10
|
+
pluginId: z.core.$ZodBranded<z.ZodString, "PluginId", "out">;
|
|
11
|
+
operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
|
|
12
|
+
idempotencyKey: z.core.$ZodBranded<z.ZodString, "IdempotencyKey", "out">;
|
|
13
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
14
|
+
requestedAt: z.ZodString;
|
|
15
|
+
requiresUserApproval: z.ZodBoolean;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type OperationRequestV1 = z.infer<typeof OperationRequestV1Schema>;
|
|
18
|
+
/**
|
|
19
|
+
* Authorized invocation approved by the project authorization authority.
|
|
20
|
+
* Invariant: Contains an authentic AuthorizationGrantId and assigned RunId.
|
|
21
|
+
*/
|
|
22
|
+
export declare const AuthorizedInvocationSchema: z.ZodObject<{
|
|
23
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
24
|
+
runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
|
|
25
|
+
projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
|
|
26
|
+
pluginId: z.core.$ZodBranded<z.ZodString, "PluginId", "out">;
|
|
27
|
+
operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
|
|
28
|
+
authorizationGrantId: z.core.$ZodBranded<z.ZodString, "AuthorizationGrantId", "out">;
|
|
29
|
+
idempotencyKey: z.core.$ZodBranded<z.ZodString, "IdempotencyKey", "out">;
|
|
30
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
31
|
+
workingDirectory: z.ZodString;
|
|
32
|
+
securityTier: z.ZodEnum<{
|
|
33
|
+
PATH_CHECKS_ONLY: "PATH_CHECKS_ONLY";
|
|
34
|
+
OS_ENFORCED: "OS_ENFORCED";
|
|
35
|
+
}>;
|
|
36
|
+
timeoutMs: z.ZodNumber;
|
|
37
|
+
createdAt: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type AuthorizedInvocation = z.infer<typeof AuthorizedInvocationSchema>;
|
|
40
|
+
/**
|
|
41
|
+
* Validates whether an untrusted payload satisfies the AuthorizedInvocation contract.
|
|
42
|
+
*/
|
|
43
|
+
export declare const isAuthorizedInvocation: (payload: unknown) => payload is AuthorizedInvocation;
|
|
44
|
+
/**
|
|
45
|
+
* Security Principal Kind.
|
|
46
|
+
* Enforces boundary separation between browser extension, MCP client, and local CLI.
|
|
47
|
+
*/
|
|
48
|
+
export declare const SecurityPrincipalKindSchema: z.ZodEnum<{
|
|
49
|
+
browser_extension: "browser_extension";
|
|
50
|
+
mcp_client: "mcp_client";
|
|
51
|
+
local_cli: "local_cli";
|
|
52
|
+
}>;
|
|
53
|
+
export type SecurityPrincipalKind = z.infer<typeof SecurityPrincipalKindSchema>;
|
|
54
|
+
/**
|
|
55
|
+
* Security Principal Record.
|
|
56
|
+
*/
|
|
57
|
+
export declare const SecurityPrincipalV1Schema: z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
kind: z.ZodEnum<{
|
|
60
|
+
browser_extension: "browser_extension";
|
|
61
|
+
mcp_client: "mcp_client";
|
|
62
|
+
local_cli: "local_cli";
|
|
63
|
+
}>;
|
|
64
|
+
authenticated: z.ZodBoolean;
|
|
65
|
+
pairingTokenHash: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type SecurityPrincipalV1 = z.infer<typeof SecurityPrincipalV1Schema>;
|
|
68
|
+
/**
|
|
69
|
+
* Project Grant Contract.
|
|
70
|
+
* Invariant: Operations are authorized only when a specific principal and project grant permits an operation.
|
|
71
|
+
*/
|
|
72
|
+
export declare const ProjectGrantV1Schema: z.ZodObject<{
|
|
73
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
74
|
+
grantId: z.core.$ZodBranded<z.ZodString, "AuthorizationGrantId", "out">;
|
|
75
|
+
projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
|
|
76
|
+
principalId: z.ZodString;
|
|
77
|
+
pluginId: z.core.$ZodBranded<z.ZodString, "PluginId", "out">;
|
|
78
|
+
allowedOperations: z.ZodArray<z.core.$ZodBranded<z.ZodString, "OperationId", "out">>;
|
|
79
|
+
maxEffectClass: z.ZodEnum<{
|
|
80
|
+
read: "read";
|
|
81
|
+
write_project: "write_project";
|
|
82
|
+
external_network: "external_network";
|
|
83
|
+
destructive: "destructive";
|
|
84
|
+
}>;
|
|
85
|
+
grantedAt: z.ZodString;
|
|
86
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
87
|
+
requiresConfirmation: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
export type ProjectGrantV1 = z.infer<typeof ProjectGrantV1Schema>;
|
|
90
|
+
//# sourceMappingURL=invocation.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SchemaVersionV1Schema, ProjectIdSchema, PluginIdSchema, OperationIdSchema, AuthorizationGrantIdSchema, BrowserRequestIdSchema, IdempotencyKeySchema, RunIdSchema, } from './identity.js';
|
|
3
|
+
import { SecurityTierSchema, EffectClassSchema } from './effects.js';
|
|
4
|
+
/**
|
|
5
|
+
* Unauthorized operation request submitted by user/browser.
|
|
6
|
+
* Invariant: Must not be treated as an authorized invocation without an explicit grant.
|
|
7
|
+
*/
|
|
8
|
+
export const OperationRequestV1Schema = z.object({
|
|
9
|
+
schemaVersion: SchemaVersionV1Schema,
|
|
10
|
+
requestId: BrowserRequestIdSchema,
|
|
11
|
+
projectId: ProjectIdSchema,
|
|
12
|
+
pluginId: PluginIdSchema,
|
|
13
|
+
operationId: OperationIdSchema,
|
|
14
|
+
idempotencyKey: IdempotencyKeySchema,
|
|
15
|
+
params: z.record(z.string(), z.unknown()),
|
|
16
|
+
requestedAt: z.string().datetime(),
|
|
17
|
+
requiresUserApproval: z.boolean(),
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Authorized invocation approved by the project authorization authority.
|
|
21
|
+
* Invariant: Contains an authentic AuthorizationGrantId and assigned RunId.
|
|
22
|
+
*/
|
|
23
|
+
export const AuthorizedInvocationSchema = z.object({
|
|
24
|
+
schemaVersion: SchemaVersionV1Schema,
|
|
25
|
+
runId: RunIdSchema,
|
|
26
|
+
projectId: ProjectIdSchema,
|
|
27
|
+
pluginId: PluginIdSchema,
|
|
28
|
+
operationId: OperationIdSchema,
|
|
29
|
+
authorizationGrantId: AuthorizationGrantIdSchema,
|
|
30
|
+
idempotencyKey: IdempotencyKeySchema,
|
|
31
|
+
params: z.record(z.string(), z.unknown()),
|
|
32
|
+
workingDirectory: z.string().min(1),
|
|
33
|
+
securityTier: SecurityTierSchema,
|
|
34
|
+
timeoutMs: z.number().int().positive(),
|
|
35
|
+
createdAt: z.string().datetime(),
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Validates whether an untrusted payload satisfies the AuthorizedInvocation contract.
|
|
39
|
+
*/
|
|
40
|
+
export const isAuthorizedInvocation = (payload) => {
|
|
41
|
+
return AuthorizedInvocationSchema.safeParse(payload).success;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Security Principal Kind.
|
|
45
|
+
* Enforces boundary separation between browser extension, MCP client, and local CLI.
|
|
46
|
+
*/
|
|
47
|
+
export const SecurityPrincipalKindSchema = z.enum([
|
|
48
|
+
'browser_extension',
|
|
49
|
+
'mcp_client',
|
|
50
|
+
'local_cli',
|
|
51
|
+
]);
|
|
52
|
+
/**
|
|
53
|
+
* Security Principal Record.
|
|
54
|
+
*/
|
|
55
|
+
export const SecurityPrincipalV1Schema = z.object({
|
|
56
|
+
id: z.string().min(1),
|
|
57
|
+
kind: SecurityPrincipalKindSchema,
|
|
58
|
+
authenticated: z.boolean(),
|
|
59
|
+
pairingTokenHash: z.string().optional(),
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Project Grant Contract.
|
|
63
|
+
* Invariant: Operations are authorized only when a specific principal and project grant permits an operation.
|
|
64
|
+
*/
|
|
65
|
+
export const ProjectGrantV1Schema = z.object({
|
|
66
|
+
schemaVersion: SchemaVersionV1Schema,
|
|
67
|
+
grantId: AuthorizationGrantIdSchema,
|
|
68
|
+
projectId: ProjectIdSchema,
|
|
69
|
+
principalId: z.string().min(1),
|
|
70
|
+
pluginId: PluginIdSchema,
|
|
71
|
+
allowedOperations: z.array(OperationIdSchema),
|
|
72
|
+
maxEffectClass: EffectClassSchema,
|
|
73
|
+
grantedAt: z.string().datetime(),
|
|
74
|
+
expiresAt: z.string().datetime().optional(),
|
|
75
|
+
requiresConfirmation: z.boolean().default(true),
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=invocation.js.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The 11 canonical run lifecycle states.
|
|
4
|
+
*/
|
|
5
|
+
export declare const RunLifecycleStateSchema: z.ZodEnum<{
|
|
6
|
+
CREATED: "CREATED";
|
|
7
|
+
AWAITING_USER_APPROVAL: "AWAITING_USER_APPROVAL";
|
|
8
|
+
QUEUED: "QUEUED";
|
|
9
|
+
STARTING: "STARTING";
|
|
10
|
+
RUNNING: "RUNNING";
|
|
11
|
+
WAITING_AGENT_APPROVAL: "WAITING_AGENT_APPROVAL";
|
|
12
|
+
CANCEL_REQUESTED: "CANCEL_REQUESTED";
|
|
13
|
+
COMPLETED: "COMPLETED";
|
|
14
|
+
FAILED: "FAILED";
|
|
15
|
+
CANCELLED: "CANCELLED";
|
|
16
|
+
UNKNOWN: "UNKNOWN";
|
|
17
|
+
}>;
|
|
18
|
+
export type RunLifecycleState = z.infer<typeof RunLifecycleStateSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Valid lifecycle transitions frozen consistent with ARCHITECTURE.md.
|
|
21
|
+
*/
|
|
22
|
+
export declare const VALID_LIFECYCLE_TRANSITIONS: Readonly<Record<RunLifecycleState, ReadonlySet<RunLifecycleState>>>;
|
|
23
|
+
export declare const TERMINAL_LIFECYCLE_STATES: ReadonlySet<RunLifecycleState>;
|
|
24
|
+
/**
|
|
25
|
+
* Core Invariants:
|
|
26
|
+
* 1. UNKNOWN is not equivalent to failure or successful completion.
|
|
27
|
+
* 2. Successful process exit does NOT prove application validation PASS.
|
|
28
|
+
*/
|
|
29
|
+
export declare const isTerminalLifecycleState: (state: RunLifecycleState) => boolean;
|
|
30
|
+
export declare const isValidLifecycleTransition: (from: RunLifecycleState, to: RunLifecycleState) => boolean;
|
|
31
|
+
export declare class InvalidLifecycleTransitionError extends Error {
|
|
32
|
+
readonly fromState: RunLifecycleState;
|
|
33
|
+
readonly toState: RunLifecycleState;
|
|
34
|
+
constructor(from: RunLifecycleState, to: RunLifecycleState);
|
|
35
|
+
}
|
|
36
|
+
export declare const assertValidLifecycleTransition: (from: RunLifecycleState, to: RunLifecycleState) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Durable Run Record contract.
|
|
39
|
+
*/
|
|
40
|
+
export declare const RunLifecycleRecordV1Schema: z.ZodObject<{
|
|
41
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
42
|
+
runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
|
|
43
|
+
projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
|
|
44
|
+
pluginId: z.core.$ZodBranded<z.ZodString, "PluginId", "out">;
|
|
45
|
+
operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
|
|
46
|
+
idempotencyKey: z.core.$ZodBranded<z.ZodString, "IdempotencyKey", "out">;
|
|
47
|
+
currentState: z.ZodEnum<{
|
|
48
|
+
CREATED: "CREATED";
|
|
49
|
+
AWAITING_USER_APPROVAL: "AWAITING_USER_APPROVAL";
|
|
50
|
+
QUEUED: "QUEUED";
|
|
51
|
+
STARTING: "STARTING";
|
|
52
|
+
RUNNING: "RUNNING";
|
|
53
|
+
WAITING_AGENT_APPROVAL: "WAITING_AGENT_APPROVAL";
|
|
54
|
+
CANCEL_REQUESTED: "CANCEL_REQUESTED";
|
|
55
|
+
COMPLETED: "COMPLETED";
|
|
56
|
+
FAILED: "FAILED";
|
|
57
|
+
CANCELLED: "CANCELLED";
|
|
58
|
+
UNKNOWN: "UNKNOWN";
|
|
59
|
+
}>;
|
|
60
|
+
history: z.ZodArray<z.ZodObject<{
|
|
61
|
+
state: z.ZodEnum<{
|
|
62
|
+
CREATED: "CREATED";
|
|
63
|
+
AWAITING_USER_APPROVAL: "AWAITING_USER_APPROVAL";
|
|
64
|
+
QUEUED: "QUEUED";
|
|
65
|
+
STARTING: "STARTING";
|
|
66
|
+
RUNNING: "RUNNING";
|
|
67
|
+
WAITING_AGENT_APPROVAL: "WAITING_AGENT_APPROVAL";
|
|
68
|
+
CANCEL_REQUESTED: "CANCEL_REQUESTED";
|
|
69
|
+
COMPLETED: "COMPLETED";
|
|
70
|
+
FAILED: "FAILED";
|
|
71
|
+
CANCELLED: "CANCELLED";
|
|
72
|
+
UNKNOWN: "UNKNOWN";
|
|
73
|
+
}>;
|
|
74
|
+
timestamp: z.ZodString;
|
|
75
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
cancellationRacingWithCompletion: z.ZodDefault<z.ZodBoolean>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
export type RunLifecycleRecordV1 = z.infer<typeof RunLifecycleRecordV1Schema>;
|
|
80
|
+
/**
|
|
81
|
+
* Implementation validation statuses.
|
|
82
|
+
* Invariant: Process exit code 0 or driver completion does NOT prove implementation validation PASS.
|
|
83
|
+
* Grounded solely in actual tests, reports, and verifiable evidence.
|
|
84
|
+
*/
|
|
85
|
+
export declare const ImplementationValidationStatusSchema: z.ZodEnum<{
|
|
86
|
+
PASS: "PASS";
|
|
87
|
+
NEEDS_CORRECTION: "NEEDS_CORRECTION";
|
|
88
|
+
BLOCKED: "BLOCKED";
|
|
89
|
+
NOT_VERIFIED: "NOT_VERIFIED";
|
|
90
|
+
}>;
|
|
91
|
+
export type ImplementationValidationStatus = z.infer<typeof ImplementationValidationStatusSchema>;
|
|
92
|
+
/**
|
|
93
|
+
* Standard externally visible run outcome record separating:
|
|
94
|
+
* 1. Process outcome: whether CLI exited 0, failed, timed out, or was canceled.
|
|
95
|
+
* 2. Implementation validation: PASS, NEEDS_CORRECTION, BLOCKED, or NOT_VERIFIED.
|
|
96
|
+
* 3. Evidence: immutable artifact digests, Git baselines, and executed commands.
|
|
97
|
+
*/
|
|
98
|
+
export declare const RunOutcomeRecordV1Schema: z.ZodObject<{
|
|
99
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
100
|
+
runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
|
|
101
|
+
projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
|
|
102
|
+
processOutcome: z.ZodObject<{
|
|
103
|
+
runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
|
|
104
|
+
exitCode: z.ZodNumber;
|
|
105
|
+
durationMs: z.ZodNumber;
|
|
106
|
+
outputSummary: z.ZodString;
|
|
107
|
+
tokenUsage: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
completedAt: z.ZodString;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
validationStatus: z.ZodEnum<{
|
|
116
|
+
PASS: "PASS";
|
|
117
|
+
NEEDS_CORRECTION: "NEEDS_CORRECTION";
|
|
118
|
+
BLOCKED: "BLOCKED";
|
|
119
|
+
NOT_VERIFIED: "NOT_VERIFIED";
|
|
120
|
+
}>;
|
|
121
|
+
evidence: z.ZodObject<{
|
|
122
|
+
artifactIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ArtifactId", "out">>;
|
|
123
|
+
gitBaselineCommit: z.ZodOptional<z.ZodString>;
|
|
124
|
+
gitCurrentCommit: z.ZodOptional<z.ZodString>;
|
|
125
|
+
executedCommands: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
recordedAt: z.ZodString;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
export type RunOutcomeRecordV1 = z.infer<typeof RunOutcomeRecordV1Schema>;
|
|
130
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SchemaVersionV1Schema, RunIdSchema, ProjectIdSchema, PluginIdSchema, OperationIdSchema, IdempotencyKeySchema, ArtifactIdSchema, } from './identity.js';
|
|
3
|
+
import { NormalizedResultSchema } from './plugin.js';
|
|
4
|
+
/**
|
|
5
|
+
* The 11 canonical run lifecycle states.
|
|
6
|
+
*/
|
|
7
|
+
export const RunLifecycleStateSchema = z.enum([
|
|
8
|
+
'CREATED',
|
|
9
|
+
'AWAITING_USER_APPROVAL',
|
|
10
|
+
'QUEUED',
|
|
11
|
+
'STARTING',
|
|
12
|
+
'RUNNING',
|
|
13
|
+
'WAITING_AGENT_APPROVAL',
|
|
14
|
+
'CANCEL_REQUESTED',
|
|
15
|
+
'COMPLETED',
|
|
16
|
+
'FAILED',
|
|
17
|
+
'CANCELLED',
|
|
18
|
+
'UNKNOWN',
|
|
19
|
+
]);
|
|
20
|
+
/**
|
|
21
|
+
* Valid lifecycle transitions frozen consistent with ARCHITECTURE.md.
|
|
22
|
+
*/
|
|
23
|
+
export const VALID_LIFECYCLE_TRANSITIONS = {
|
|
24
|
+
CREATED: new Set(['AWAITING_USER_APPROVAL', 'QUEUED', 'CANCELLED']),
|
|
25
|
+
AWAITING_USER_APPROVAL: new Set(['QUEUED', 'CANCELLED', 'FAILED']),
|
|
26
|
+
QUEUED: new Set(['STARTING', 'CANCEL_REQUESTED', 'CANCELLED']),
|
|
27
|
+
STARTING: new Set(['RUNNING', 'CANCEL_REQUESTED', 'FAILED', 'UNKNOWN']),
|
|
28
|
+
RUNNING: new Set([
|
|
29
|
+
'WAITING_AGENT_APPROVAL',
|
|
30
|
+
'CANCEL_REQUESTED',
|
|
31
|
+
'COMPLETED',
|
|
32
|
+
'FAILED',
|
|
33
|
+
'UNKNOWN',
|
|
34
|
+
]),
|
|
35
|
+
WAITING_AGENT_APPROVAL: new Set([
|
|
36
|
+
'RUNNING',
|
|
37
|
+
'CANCEL_REQUESTED',
|
|
38
|
+
'CANCELLED',
|
|
39
|
+
'FAILED',
|
|
40
|
+
'UNKNOWN', // Planner-authorized additive edge (SW-032): uncertain execution lost across a restart
|
|
41
|
+
]),
|
|
42
|
+
CANCEL_REQUESTED: new Set([
|
|
43
|
+
'CANCELLED',
|
|
44
|
+
'COMPLETED', // Allowed when process completion races with cancellation intent
|
|
45
|
+
'FAILED',
|
|
46
|
+
'UNKNOWN',
|
|
47
|
+
]),
|
|
48
|
+
COMPLETED: new Set([]),
|
|
49
|
+
FAILED: new Set([]),
|
|
50
|
+
CANCELLED: new Set([]),
|
|
51
|
+
UNKNOWN: new Set([]),
|
|
52
|
+
};
|
|
53
|
+
export const TERMINAL_LIFECYCLE_STATES = new Set([
|
|
54
|
+
'COMPLETED',
|
|
55
|
+
'FAILED',
|
|
56
|
+
'CANCELLED',
|
|
57
|
+
'UNKNOWN',
|
|
58
|
+
]);
|
|
59
|
+
/**
|
|
60
|
+
* Core Invariants:
|
|
61
|
+
* 1. UNKNOWN is not equivalent to failure or successful completion.
|
|
62
|
+
* 2. Successful process exit does NOT prove application validation PASS.
|
|
63
|
+
*/
|
|
64
|
+
export const isTerminalLifecycleState = (state) => {
|
|
65
|
+
return TERMINAL_LIFECYCLE_STATES.has(state);
|
|
66
|
+
};
|
|
67
|
+
export const isValidLifecycleTransition = (from, to) => {
|
|
68
|
+
const allowed = VALID_LIFECYCLE_TRANSITIONS[from];
|
|
69
|
+
return allowed ? allowed.has(to) : false;
|
|
70
|
+
};
|
|
71
|
+
export class InvalidLifecycleTransitionError extends Error {
|
|
72
|
+
fromState;
|
|
73
|
+
toState;
|
|
74
|
+
constructor(from, to) {
|
|
75
|
+
super(`Invalid run lifecycle transition from ${from} to ${to}`);
|
|
76
|
+
this.name = 'InvalidLifecycleTransitionError';
|
|
77
|
+
this.fromState = from;
|
|
78
|
+
this.toState = to;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export const assertValidLifecycleTransition = (from, to) => {
|
|
82
|
+
if (!isValidLifecycleTransition(from, to)) {
|
|
83
|
+
throw new InvalidLifecycleTransitionError(from, to);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Durable Run Record contract.
|
|
88
|
+
*/
|
|
89
|
+
export const RunLifecycleRecordV1Schema = z.object({
|
|
90
|
+
schemaVersion: SchemaVersionV1Schema,
|
|
91
|
+
runId: RunIdSchema,
|
|
92
|
+
projectId: ProjectIdSchema,
|
|
93
|
+
pluginId: PluginIdSchema,
|
|
94
|
+
operationId: OperationIdSchema,
|
|
95
|
+
idempotencyKey: IdempotencyKeySchema,
|
|
96
|
+
currentState: RunLifecycleStateSchema,
|
|
97
|
+
history: z.array(z.object({
|
|
98
|
+
state: RunLifecycleStateSchema,
|
|
99
|
+
timestamp: z.string().datetime(),
|
|
100
|
+
reason: z.string().optional(),
|
|
101
|
+
})),
|
|
102
|
+
cancellationRacingWithCompletion: z.boolean().default(false),
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Implementation validation statuses.
|
|
106
|
+
* Invariant: Process exit code 0 or driver completion does NOT prove implementation validation PASS.
|
|
107
|
+
* Grounded solely in actual tests, reports, and verifiable evidence.
|
|
108
|
+
*/
|
|
109
|
+
export const ImplementationValidationStatusSchema = z.enum([
|
|
110
|
+
'PASS',
|
|
111
|
+
'NEEDS_CORRECTION',
|
|
112
|
+
'BLOCKED',
|
|
113
|
+
'NOT_VERIFIED',
|
|
114
|
+
]);
|
|
115
|
+
/**
|
|
116
|
+
* Standard externally visible run outcome record separating:
|
|
117
|
+
* 1. Process outcome: whether CLI exited 0, failed, timed out, or was canceled.
|
|
118
|
+
* 2. Implementation validation: PASS, NEEDS_CORRECTION, BLOCKED, or NOT_VERIFIED.
|
|
119
|
+
* 3. Evidence: immutable artifact digests, Git baselines, and executed commands.
|
|
120
|
+
*/
|
|
121
|
+
export const RunOutcomeRecordV1Schema = z.object({
|
|
122
|
+
schemaVersion: SchemaVersionV1Schema,
|
|
123
|
+
runId: RunIdSchema,
|
|
124
|
+
projectId: ProjectIdSchema,
|
|
125
|
+
processOutcome: NormalizedResultSchema,
|
|
126
|
+
validationStatus: ImplementationValidationStatusSchema,
|
|
127
|
+
evidence: z.object({
|
|
128
|
+
artifactIds: z.array(ArtifactIdSchema),
|
|
129
|
+
gitBaselineCommit: z.string().optional(),
|
|
130
|
+
gitCurrentCommit: z.string().optional(),
|
|
131
|
+
executedCommands: z.array(z.string()).optional(),
|
|
132
|
+
}),
|
|
133
|
+
recordedAt: z.string().datetime(),
|
|
134
|
+
});
|
|
135
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RunId, AgentSessionId } from './identity.js';
|
|
3
|
+
import { AuthorizedInvocation } from './invocation.js';
|
|
4
|
+
import { NormalizedEvent } from './events.js';
|
|
5
|
+
export declare const PluginKindSchema: z.ZodEnum<{
|
|
6
|
+
command: "command";
|
|
7
|
+
agent: "agent";
|
|
8
|
+
}>;
|
|
9
|
+
export type PluginKind = z.infer<typeof PluginKindSchema>;
|
|
10
|
+
/**
|
|
11
|
+
* Distinct lifecycle states of a plugin registration.
|
|
12
|
+
* Invariant: Registered, verified, enabled, and authorized are distinct states.
|
|
13
|
+
* A registered plugin does NOT automatically receive execution permission.
|
|
14
|
+
*/
|
|
15
|
+
export declare const PluginStateSchema: z.ZodEnum<{
|
|
16
|
+
registered: "registered";
|
|
17
|
+
verified: "verified";
|
|
18
|
+
enabled: "enabled";
|
|
19
|
+
authorized: "authorized";
|
|
20
|
+
}>;
|
|
21
|
+
export type PluginState = z.infer<typeof PluginStateSchema>;
|
|
22
|
+
/**
|
|
23
|
+
* Hard ceiling (UTF-8 bytes) for a prompt delivered on a supervised process's stdin (SW-052).
|
|
24
|
+
*/
|
|
25
|
+
export declare const STDIN_MAX_BYTES_V1 = 32768;
|
|
26
|
+
/**
|
|
27
|
+
* OPTIONAL, additive input transport for an operation (SW-052). Absent means V1 behaviour: the target's stdin is 'ignore' and
|
|
28
|
+
* ExecutablePolicyV1.stdio is unchanged. When present the trusted driver delivers the approved prompt (UTF-8 bytes, at most maxBytes,
|
|
29
|
+
* never more than STDIN_MAX_BYTES_V1) on a private pipe, written once and closed. It is a declaration inside the pinned manifest, so
|
|
30
|
+
* it is covered by the manifest fingerprint; it is never read from a run request.
|
|
31
|
+
*/
|
|
32
|
+
export declare const InputTransportV1Schema: z.ZodObject<{
|
|
33
|
+
kind: z.ZodLiteral<"stdin_utf8">;
|
|
34
|
+
maxBytes: z.ZodNumber;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type InputTransportV1 = z.infer<typeof InputTransportV1Schema>;
|
|
37
|
+
/**
|
|
38
|
+
* Declaration of a single plugin operation.
|
|
39
|
+
*/
|
|
40
|
+
export declare const PluginOperationV1Schema: z.ZodObject<{
|
|
41
|
+
id: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
description: z.ZodString;
|
|
44
|
+
effectClass: z.ZodEnum<{
|
|
45
|
+
read: "read";
|
|
46
|
+
write_project: "write_project";
|
|
47
|
+
external_network: "external_network";
|
|
48
|
+
destructive: "destructive";
|
|
49
|
+
}>;
|
|
50
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
51
|
+
executablePolicy: z.ZodObject<{
|
|
52
|
+
executable: z.ZodString;
|
|
53
|
+
args: z.ZodArray<z.ZodString>;
|
|
54
|
+
allowShell: z.ZodLiteral<false>;
|
|
55
|
+
windowsHide: z.ZodLiteral<true>;
|
|
56
|
+
stdio: z.ZodTuple<[z.ZodLiteral<"ignore">, z.ZodLiteral<"pipe">, z.ZodLiteral<"pipe">], null>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
timeoutMs: z.ZodNumber;
|
|
59
|
+
outputBounds: z.ZodObject<{
|
|
60
|
+
maxOutputBytes: z.ZodNumber;
|
|
61
|
+
maxLineCount: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
projectCwdRequired: z.ZodBoolean;
|
|
64
|
+
inputTransport: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
kind: z.ZodLiteral<"stdin_utf8">;
|
|
66
|
+
maxBytes: z.ZodNumber;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type PluginOperationV1 = z.infer<typeof PluginOperationV1Schema>;
|
|
70
|
+
/**
|
|
71
|
+
* Advanced agent driver capabilities.
|
|
72
|
+
* Invariant: Advertised only when empirically verified.
|
|
73
|
+
*/
|
|
74
|
+
export declare const DriverCapabilitiesV1Schema: z.ZodObject<{
|
|
75
|
+
supportsSession: z.ZodBoolean;
|
|
76
|
+
supportsApproval: z.ZodBoolean;
|
|
77
|
+
supportsResume: z.ZodBoolean;
|
|
78
|
+
supportsStreaming: z.ZodBoolean;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type DriverCapabilitiesV1 = z.infer<typeof DriverCapabilitiesV1Schema>;
|
|
81
|
+
/**
|
|
82
|
+
* Manifest defining a registered plugin and its operations.
|
|
83
|
+
*/
|
|
84
|
+
export declare const PluginManifestV1Schema: z.ZodObject<{
|
|
85
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
86
|
+
id: z.core.$ZodBranded<z.ZodString, "PluginId", "out">;
|
|
87
|
+
kind: z.ZodEnum<{
|
|
88
|
+
command: "command";
|
|
89
|
+
agent: "agent";
|
|
90
|
+
}>;
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
version: z.ZodString;
|
|
93
|
+
description: z.ZodString;
|
|
94
|
+
state: z.ZodEnum<{
|
|
95
|
+
registered: "registered";
|
|
96
|
+
verified: "verified";
|
|
97
|
+
enabled: "enabled";
|
|
98
|
+
authorized: "authorized";
|
|
99
|
+
}>;
|
|
100
|
+
operations: z.ZodRecord<z.core.$ZodBranded<z.ZodString, "OperationId", "out">, z.ZodObject<{
|
|
101
|
+
id: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
description: z.ZodString;
|
|
104
|
+
effectClass: z.ZodEnum<{
|
|
105
|
+
read: "read";
|
|
106
|
+
write_project: "write_project";
|
|
107
|
+
external_network: "external_network";
|
|
108
|
+
destructive: "destructive";
|
|
109
|
+
}>;
|
|
110
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
111
|
+
executablePolicy: z.ZodObject<{
|
|
112
|
+
executable: z.ZodString;
|
|
113
|
+
args: z.ZodArray<z.ZodString>;
|
|
114
|
+
allowShell: z.ZodLiteral<false>;
|
|
115
|
+
windowsHide: z.ZodLiteral<true>;
|
|
116
|
+
stdio: z.ZodTuple<[z.ZodLiteral<"ignore">, z.ZodLiteral<"pipe">, z.ZodLiteral<"pipe">], null>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
timeoutMs: z.ZodNumber;
|
|
119
|
+
outputBounds: z.ZodObject<{
|
|
120
|
+
maxOutputBytes: z.ZodNumber;
|
|
121
|
+
maxLineCount: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
projectCwdRequired: z.ZodBoolean;
|
|
124
|
+
inputTransport: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
kind: z.ZodLiteral<"stdin_utf8">;
|
|
126
|
+
maxBytes: z.ZodNumber;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
}, z.core.$strip>>;
|
|
129
|
+
capabilities: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
supportsSession: z.ZodBoolean;
|
|
131
|
+
supportsApproval: z.ZodBoolean;
|
|
132
|
+
supportsResume: z.ZodBoolean;
|
|
133
|
+
supportsStreaming: z.ZodBoolean;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
export type PluginManifestV1 = z.infer<typeof PluginManifestV1Schema>;
|
|
137
|
+
/**
|
|
138
|
+
* Probe capability report emitted by a plugin driver.
|
|
139
|
+
*/
|
|
140
|
+
export declare const CapabilityReportSchema: z.ZodObject<{
|
|
141
|
+
pluginId: z.core.$ZodBranded<z.ZodString, "PluginId", "out">;
|
|
142
|
+
installed: z.ZodBoolean;
|
|
143
|
+
installedVersion: z.ZodOptional<z.ZodString>;
|
|
144
|
+
capabilities: z.ZodObject<{
|
|
145
|
+
supportsSession: z.ZodBoolean;
|
|
146
|
+
supportsApproval: z.ZodBoolean;
|
|
147
|
+
supportsResume: z.ZodBoolean;
|
|
148
|
+
supportsStreaming: z.ZodBoolean;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
export type CapabilityReport = z.infer<typeof CapabilityReportSchema>;
|
|
153
|
+
/**
|
|
154
|
+
* Run receipt returned upon driver invocation.
|
|
155
|
+
*/
|
|
156
|
+
export declare const RunReceiptSchema: z.ZodObject<{
|
|
157
|
+
runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
|
|
158
|
+
pluginId: z.core.$ZodBranded<z.ZodString, "PluginId", "out">;
|
|
159
|
+
operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
|
|
160
|
+
startedAt: z.ZodString;
|
|
161
|
+
processId: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
export type RunReceipt = z.infer<typeof RunReceiptSchema>;
|
|
164
|
+
/**
|
|
165
|
+
* Cancel receipt returned upon cancellation request.
|
|
166
|
+
*/
|
|
167
|
+
export declare const CancelReceiptSchema: z.ZodObject<{
|
|
168
|
+
runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
|
|
169
|
+
cancelledAt: z.ZodString;
|
|
170
|
+
acknowledged: z.ZodBoolean;
|
|
171
|
+
processTerminated: z.ZodBoolean;
|
|
172
|
+
reason: z.ZodString;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
export type CancelReceipt = z.infer<typeof CancelReceiptSchema>;
|
|
175
|
+
/**
|
|
176
|
+
* Normalized result collected after run completes or halts.
|
|
177
|
+
*/
|
|
178
|
+
export declare const NormalizedResultSchema: z.ZodObject<{
|
|
179
|
+
runId: z.core.$ZodBranded<z.ZodString, "RunId", "out">;
|
|
180
|
+
exitCode: z.ZodNumber;
|
|
181
|
+
durationMs: z.ZodNumber;
|
|
182
|
+
outputSummary: z.ZodString;
|
|
183
|
+
tokenUsage: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
cachedTokens: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
completedAt: z.ZodString;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
export type NormalizedResult = z.infer<typeof NormalizedResultSchema>;
|
|
192
|
+
/**
|
|
193
|
+
* Required standard driver interface.
|
|
194
|
+
* Baseline invariant: Five methods, non-renegotiable responsibilities.
|
|
195
|
+
* The driver does NOT own project authorization, durable run truth, or artifact shipment policy.
|
|
196
|
+
*/
|
|
197
|
+
export interface PluginDriver {
|
|
198
|
+
probe(): Promise<CapabilityReport>;
|
|
199
|
+
invoke(request: AuthorizedInvocation): Promise<RunReceipt>;
|
|
200
|
+
observe(runId: RunId): AsyncIterable<NormalizedEvent>;
|
|
201
|
+
cancel(runId: RunId, reason: string): Promise<CancelReceipt>;
|
|
202
|
+
collect(runId: RunId): Promise<NormalizedResult>;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Advanced agent driver interface extending PluginDriver.
|
|
206
|
+
* Advertises conditional session, turn, and approval operations.
|
|
207
|
+
* Basic CLI drivers and command plugins implement only PluginDriver.
|
|
208
|
+
*/
|
|
209
|
+
export interface AgentDriver extends PluginDriver {
|
|
210
|
+
submitTurn?(sessionId: AgentSessionId, prompt: string): Promise<RunReceipt>;
|
|
211
|
+
respondToApproval?(runId: RunId, approved: boolean, reason?: string): Promise<void>;
|
|
212
|
+
resumeSession?(sessionId: AgentSessionId): Promise<RunReceipt>;
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=plugin.d.ts.map
|