eve 0.27.11 → 0.27.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/src/chunks/{use-eve-agent-CTJrwXM2.js → use-eve-agent-CWYe-vqE.js} +29 -18
- package/dist/src/chunks/{use-eve-agent-DaWxEtnE.js → use-eve-agent-CsSQOKnp.js} +29 -18
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/integration-setup.js +1 -1
- package/dist/src/cli/commands/register-registry-commands.js +1 -1
- package/dist/src/cli/commands/registry-setup-command.d.ts +5 -3
- package/dist/src/cli/commands/registry-setup-command.js +1 -1
- package/dist/src/cli/commands/registry.d.ts +9 -3
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/tui/remote-connection-probe.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/target.d.ts +3 -15
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/invoke/command.d.ts +32 -0
- package/dist/src/cli/invoke/command.js +1 -0
- package/dist/src/cli/invoke/invoke.d.ts +27 -0
- package/dist/src/cli/invoke/invoke.js +1 -0
- package/dist/src/cli/invoke/result.d.ts +313 -0
- package/dist/src/cli/invoke/result.js +1 -0
- package/dist/src/cli/run.d.ts +2 -0
- package/dist/src/cli/run.js +3 -3
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/message-response.js +1 -1
- package/dist/src/client/session-utils.d.ts +21 -15
- package/dist/src/client/session-utils.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +5 -5
- package/dist/src/compiled/@workflow/core/capabilities.d.ts +6 -0
- package/dist/src/compiled/@workflow/core/encryption.d.ts +15 -2
- package/dist/src/compiled/@workflow/core/flushable-stream.d.ts +26 -0
- package/dist/src/compiled/@workflow/core/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +76 -33
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/replay-payload-cache.d.ts +3 -2
- package/dist/src/compiled/@workflow/core/runtime/count-step-started-events.d.ts +52 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +41 -12
- package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +9 -8
- package/dist/src/compiled/@workflow/core/runtime/world.d.ts +2 -7
- package/dist/src/compiled/@workflow/core/runtime.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/sealed-box.d.ts +167 -0
- package/dist/src/compiled/@workflow/core/serialization/client.d.ts +3 -3
- package/dist/src/compiled/@workflow/core/serialization/codec.d.ts +6 -4
- package/dist/src/compiled/@workflow/core/serialization/encryption.d.ts +118 -17
- package/dist/src/compiled/@workflow/core/serialization/step.d.ts +4 -4
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +20 -0
- package/dist/src/compiled/@workflow/core/serialization-format.d.ts +44 -4
- package/dist/src/compiled/@workflow/core/serialization.d.ts +21 -21
- package/dist/src/compiled/@workflow/core/set-attributes.d.ts +2 -7
- package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/symbols.d.ts +23 -10
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +4 -4
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/abort-controller.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +0 -9
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/events.d.ts +5 -0
- package/dist/src/compiled/@workflow/world/hooks.d.ts +27 -0
- package/dist/src/compiled/@workflow/world/index.d.ts +2 -2
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +8 -6
- package/dist/src/compiled/@workflow/world/queue.d.ts +30 -26
- package/dist/src/compiled/@workflow/world/runs.d.ts +5 -0
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +3 -4
- package/dist/src/compiled/@workflow/world-local/index.js +4 -4
- package/dist/src/compiled/@workflow/world-vercel/index.js +5 -5
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-B6ltn-ph.js → attribute-changes-DeZc2RZz.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{dist-D7ANgxe0.js → dist-WjtNsOyf.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/private-Cre8uYkA.js +1 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-ip1hbn1b.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-CWytxfIp.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-BjrUxUcs.js +1 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-De9yESQN.js +15 -0
- package/dist/src/compiled/_chunks/workflow/{workflow-routes-Pd-WKcx_.js → workflow-routes-CwqB063q.js} +1 -1
- package/dist/src/evals/cli/eval-client.js +1 -1
- package/dist/src/evals/session.js +1 -1
- package/dist/src/execution/web-fetch/request.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/node-esm-compat-banner.js +1 -1
- package/dist/src/internal/workflow/builtins.d.ts +2 -2
- package/dist/src/internal/workflow/development-world-protocol.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-core-shim.d.ts +5 -5
- package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/world-target.js +1 -0
- package/dist/src/public/channels/linear/defaults.js +4 -2
- package/dist/src/runtime/attributes/emit.js +1 -1
- package/dist/src/services/dev-client/client-options.d.ts +2 -0
- package/dist/src/services/dev-client/client-options.js +1 -1
- package/dist/src/services/dev-client/target.d.ts +17 -0
- package/dist/src/services/dev-client/target.js +1 -0
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/verified-remote-client.d.ts +5 -1
- package/dist/src/setup/verified-remote-client.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/channels/linear.mdx +4 -0
- package/docs/extensions.md +3 -1
- package/docs/install-integrations.mdx +76 -1
- package/docs/reference/cli.md +28 -1
- package/package.json +8 -8
- package/dist/src/compiled/@workflow/core/runtime/step-handler.d.ts +0 -2
- package/dist/src/compiled/_chunks/workflow/private-DolBHKOQ.js +0 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-D2AqAGjq.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-BMRZ6pA-.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-CrgsokmG.js +0 -1
- package/dist/src/compiled/_chunks/workflow/wait-until-B-1TiJji.js +0 -15
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.6/node_modules/@workflow/utils/dist/world-target.js +0 -1
- /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/index.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/parse-name.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/pluralize.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/promise.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/time.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/workflow-routes.js +0 -0
- /package/dist/src/{cli/dev/tui → services/dev-client}/agent-info-probe.d.ts +0 -0
- /package/dist/src/{cli/dev/tui → services/dev-client}/agent-info-probe.js +0 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { z } from "#compiled/zod/index.js";
|
|
2
|
+
import { type InputRequest } from "#client/index.js";
|
|
3
|
+
import type { ConnectionAuthorizationChallenge } from "#public/connections/errors.js";
|
|
4
|
+
declare const invokeResumeSchema: z.ZodObject<{
|
|
5
|
+
session: z.ZodObject<{
|
|
6
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
7
|
+
sessionId: z.ZodString;
|
|
8
|
+
streamIndex: z.ZodNumber;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
kind: z.ZodLiteral<"local">;
|
|
12
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
13
|
+
kind: z.ZodLiteral<"remote">;
|
|
14
|
+
serverUrl: z.ZodURL;
|
|
15
|
+
}, z.core.$strict>], "kind">;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
declare const invocationInputRequestSchema: z.ZodObject<{
|
|
18
|
+
allowFreeform: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
prompt: z.ZodString;
|
|
20
|
+
requestId: z.ZodString;
|
|
21
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
22
|
+
description: z.ZodOptional<z.ZodString>;
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
label: z.ZodString;
|
|
25
|
+
}, z.core.$strict>>>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
declare const invokeResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
+
resume: z.ZodObject<{
|
|
29
|
+
session: z.ZodObject<{
|
|
30
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
31
|
+
sessionId: z.ZodString;
|
|
32
|
+
streamIndex: z.ZodNumber;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"local">;
|
|
36
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"remote">;
|
|
38
|
+
serverUrl: z.ZodURL;
|
|
39
|
+
}, z.core.$strict>], "kind">;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
status: z.ZodLiteral<"running">;
|
|
42
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
43
|
+
requests: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
44
|
+
allowFreeform: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
prompt: z.ZodString;
|
|
46
|
+
requestId: z.ZodString;
|
|
47
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
48
|
+
description: z.ZodOptional<z.ZodString>;
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
label: z.ZodString;
|
|
51
|
+
}, z.core.$strict>>>;
|
|
52
|
+
}, z.core.$strict>>>;
|
|
53
|
+
resume: z.ZodObject<{
|
|
54
|
+
session: z.ZodObject<{
|
|
55
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
56
|
+
sessionId: z.ZodString;
|
|
57
|
+
streamIndex: z.ZodNumber;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
60
|
+
kind: z.ZodLiteral<"local">;
|
|
61
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
62
|
+
kind: z.ZodLiteral<"remote">;
|
|
63
|
+
serverUrl: z.ZodURL;
|
|
64
|
+
}, z.core.$strict>], "kind">;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
status: z.ZodLiteral<"input-required">;
|
|
67
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
68
|
+
authorizations: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
69
|
+
authorization: z.ZodOptional<z.ZodType<ConnectionAuthorizationChallenge, unknown, z.core.$ZodTypeInternals<ConnectionAuthorizationChallenge, unknown>>>;
|
|
70
|
+
description: z.ZodString;
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strict>>>;
|
|
74
|
+
resume: z.ZodObject<{
|
|
75
|
+
session: z.ZodObject<{
|
|
76
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
77
|
+
sessionId: z.ZodString;
|
|
78
|
+
streamIndex: z.ZodNumber;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
81
|
+
kind: z.ZodLiteral<"local">;
|
|
82
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
83
|
+
kind: z.ZodLiteral<"remote">;
|
|
84
|
+
serverUrl: z.ZodURL;
|
|
85
|
+
}, z.core.$strict>], "kind">;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
status: z.ZodLiteral<"authorization-required">;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
+
message: z.ZodOptional<z.ZodString>;
|
|
91
|
+
status: z.ZodLiteral<"completed">;
|
|
92
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
93
|
+
message: z.ZodString;
|
|
94
|
+
status: z.ZodLiteral<"failed">;
|
|
95
|
+
}, z.core.$strict>], "status">;
|
|
96
|
+
resume: z.ZodObject<{
|
|
97
|
+
session: z.ZodObject<{
|
|
98
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
99
|
+
sessionId: z.ZodString;
|
|
100
|
+
streamIndex: z.ZodNumber;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
103
|
+
kind: z.ZodLiteral<"local">;
|
|
104
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
105
|
+
kind: z.ZodLiteral<"remote">;
|
|
106
|
+
serverUrl: z.ZodURL;
|
|
107
|
+
}, z.core.$strict>], "kind">;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
status: z.ZodLiteral<"ready">;
|
|
110
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
111
|
+
message: z.ZodString;
|
|
112
|
+
status: z.ZodLiteral<"failed">;
|
|
113
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
114
|
+
code: z.ZodOptional<z.ZodString>;
|
|
115
|
+
message: z.ZodString;
|
|
116
|
+
resume: z.ZodOptional<z.ZodObject<{
|
|
117
|
+
session: z.ZodObject<{
|
|
118
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
119
|
+
sessionId: z.ZodString;
|
|
120
|
+
streamIndex: z.ZodNumber;
|
|
121
|
+
}, z.core.$strict>;
|
|
122
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
123
|
+
kind: z.ZodLiteral<"local">;
|
|
124
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
125
|
+
kind: z.ZodLiteral<"remote">;
|
|
126
|
+
serverUrl: z.ZodURL;
|
|
127
|
+
}, z.core.$strict>], "kind">;
|
|
128
|
+
}, z.core.$strict>>;
|
|
129
|
+
status: z.ZodLiteral<"authentication-required">;
|
|
130
|
+
}, z.core.$strict>], "status">;
|
|
131
|
+
/** Durable session coordinates emitted by `eve invoke`. Credentials are deliberately excluded. */
|
|
132
|
+
export type InvokeResume = z.infer<typeof invokeResumeSchema>;
|
|
133
|
+
export type InvocationInputRequest = z.infer<typeof invocationInputRequestSchema>;
|
|
134
|
+
/** Result emitted by one non-interactive agent invocation. */
|
|
135
|
+
export type InvokeResult = z.infer<typeof invokeResultSchema>;
|
|
136
|
+
export type InvokeAuthenticationFailure = Extract<InvokeResult, {
|
|
137
|
+
status: "authentication-required";
|
|
138
|
+
}>;
|
|
139
|
+
/** Projects a runtime input request to the stable invocation-facing contract. */
|
|
140
|
+
export declare function projectInvocationInputRequest(request: InputRequest): InvocationInputRequest;
|
|
141
|
+
/** Parses a complete, resumable result from a previous `eve invoke` command. */
|
|
142
|
+
export declare function parseInvokeResumeInput(value: unknown): InvokeResult & {
|
|
143
|
+
resume: InvokeResume;
|
|
144
|
+
};
|
|
145
|
+
/** JSON Schema generated from the canonical invoke result runtime schema. */
|
|
146
|
+
export declare const invokeResultJsonSchema: {
|
|
147
|
+
$schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
|
|
148
|
+
$anchor?: string;
|
|
149
|
+
$ref?: string;
|
|
150
|
+
$dynamicRef?: string;
|
|
151
|
+
$dynamicAnchor?: string;
|
|
152
|
+
$vocabulary?: Record<string, boolean>;
|
|
153
|
+
$comment?: string;
|
|
154
|
+
$defs?: Record<string, z.core.JSONSchema.JSONSchema>;
|
|
155
|
+
type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
|
|
156
|
+
additionalItems?: z.core.JSONSchema._JSONSchema;
|
|
157
|
+
unevaluatedItems?: z.core.JSONSchema._JSONSchema;
|
|
158
|
+
prefixItems?: z.core.JSONSchema._JSONSchema[];
|
|
159
|
+
items?: z.core.JSONSchema._JSONSchema | z.core.JSONSchema._JSONSchema[];
|
|
160
|
+
contains?: z.core.JSONSchema._JSONSchema;
|
|
161
|
+
additionalProperties?: z.core.JSONSchema._JSONSchema;
|
|
162
|
+
unevaluatedProperties?: z.core.JSONSchema._JSONSchema;
|
|
163
|
+
properties?: Record<string, z.core.JSONSchema._JSONSchema>;
|
|
164
|
+
patternProperties?: Record<string, z.core.JSONSchema._JSONSchema>;
|
|
165
|
+
dependentSchemas?: Record<string, z.core.JSONSchema._JSONSchema>;
|
|
166
|
+
propertyNames?: z.core.JSONSchema._JSONSchema;
|
|
167
|
+
if?: z.core.JSONSchema._JSONSchema;
|
|
168
|
+
then?: z.core.JSONSchema._JSONSchema;
|
|
169
|
+
else?: z.core.JSONSchema._JSONSchema;
|
|
170
|
+
allOf?: z.core.JSONSchema.JSONSchema[];
|
|
171
|
+
anyOf?: z.core.JSONSchema.JSONSchema[];
|
|
172
|
+
oneOf?: z.core.JSONSchema.JSONSchema[];
|
|
173
|
+
not?: z.core.JSONSchema._JSONSchema;
|
|
174
|
+
multipleOf?: number;
|
|
175
|
+
maximum?: number;
|
|
176
|
+
exclusiveMaximum?: number | boolean;
|
|
177
|
+
minimum?: number;
|
|
178
|
+
exclusiveMinimum?: number | boolean;
|
|
179
|
+
maxLength?: number;
|
|
180
|
+
minLength?: number;
|
|
181
|
+
pattern?: string;
|
|
182
|
+
maxItems?: number;
|
|
183
|
+
minItems?: number;
|
|
184
|
+
uniqueItems?: boolean;
|
|
185
|
+
maxContains?: number;
|
|
186
|
+
minContains?: number;
|
|
187
|
+
maxProperties?: number;
|
|
188
|
+
minProperties?: number;
|
|
189
|
+
required?: string[];
|
|
190
|
+
dependentRequired?: Record<string, string[]>;
|
|
191
|
+
enum?: Array<string | number | boolean | null>;
|
|
192
|
+
const?: string | number | boolean | null;
|
|
193
|
+
id?: string;
|
|
194
|
+
description?: string;
|
|
195
|
+
default?: unknown;
|
|
196
|
+
deprecated?: boolean;
|
|
197
|
+
readOnly?: boolean;
|
|
198
|
+
writeOnly?: boolean;
|
|
199
|
+
nullable?: boolean;
|
|
200
|
+
examples?: unknown[];
|
|
201
|
+
format?: string;
|
|
202
|
+
contentMediaType?: string;
|
|
203
|
+
contentEncoding?: string;
|
|
204
|
+
contentSchema?: z.core.JSONSchema.JSONSchema;
|
|
205
|
+
_prefault?: unknown;
|
|
206
|
+
"~standard": z.core.ZodStandardSchemaWithJSON<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
207
|
+
resume: z.ZodObject<{
|
|
208
|
+
session: z.ZodObject<{
|
|
209
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
210
|
+
sessionId: z.ZodString;
|
|
211
|
+
streamIndex: z.ZodNumber;
|
|
212
|
+
}, z.core.$strict>;
|
|
213
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
214
|
+
kind: z.ZodLiteral<"local">;
|
|
215
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
216
|
+
kind: z.ZodLiteral<"remote">;
|
|
217
|
+
serverUrl: z.ZodURL;
|
|
218
|
+
}, z.core.$strict>], "kind">;
|
|
219
|
+
}, z.core.$strict>;
|
|
220
|
+
status: z.ZodLiteral<"running">;
|
|
221
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
222
|
+
requests: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
223
|
+
allowFreeform: z.ZodOptional<z.ZodBoolean>;
|
|
224
|
+
prompt: z.ZodString;
|
|
225
|
+
requestId: z.ZodString;
|
|
226
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
227
|
+
description: z.ZodOptional<z.ZodString>;
|
|
228
|
+
id: z.ZodString;
|
|
229
|
+
label: z.ZodString;
|
|
230
|
+
}, z.core.$strict>>>;
|
|
231
|
+
}, z.core.$strict>>>;
|
|
232
|
+
resume: z.ZodObject<{
|
|
233
|
+
session: z.ZodObject<{
|
|
234
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
235
|
+
sessionId: z.ZodString;
|
|
236
|
+
streamIndex: z.ZodNumber;
|
|
237
|
+
}, z.core.$strict>;
|
|
238
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
239
|
+
kind: z.ZodLiteral<"local">;
|
|
240
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
241
|
+
kind: z.ZodLiteral<"remote">;
|
|
242
|
+
serverUrl: z.ZodURL;
|
|
243
|
+
}, z.core.$strict>], "kind">;
|
|
244
|
+
}, z.core.$strict>;
|
|
245
|
+
status: z.ZodLiteral<"input-required">;
|
|
246
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
247
|
+
authorizations: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
248
|
+
authorization: z.ZodOptional<z.ZodType<ConnectionAuthorizationChallenge, unknown, z.core.$ZodTypeInternals<ConnectionAuthorizationChallenge, unknown>>>;
|
|
249
|
+
description: z.ZodString;
|
|
250
|
+
name: z.ZodString;
|
|
251
|
+
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
252
|
+
}, z.core.$strict>>>;
|
|
253
|
+
resume: z.ZodObject<{
|
|
254
|
+
session: z.ZodObject<{
|
|
255
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
256
|
+
sessionId: z.ZodString;
|
|
257
|
+
streamIndex: z.ZodNumber;
|
|
258
|
+
}, z.core.$strict>;
|
|
259
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
260
|
+
kind: z.ZodLiteral<"local">;
|
|
261
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
262
|
+
kind: z.ZodLiteral<"remote">;
|
|
263
|
+
serverUrl: z.ZodURL;
|
|
264
|
+
}, z.core.$strict>], "kind">;
|
|
265
|
+
}, z.core.$strict>;
|
|
266
|
+
status: z.ZodLiteral<"authorization-required">;
|
|
267
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
268
|
+
outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
269
|
+
message: z.ZodOptional<z.ZodString>;
|
|
270
|
+
status: z.ZodLiteral<"completed">;
|
|
271
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
272
|
+
message: z.ZodString;
|
|
273
|
+
status: z.ZodLiteral<"failed">;
|
|
274
|
+
}, z.core.$strict>], "status">;
|
|
275
|
+
resume: z.ZodObject<{
|
|
276
|
+
session: z.ZodObject<{
|
|
277
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
278
|
+
sessionId: z.ZodString;
|
|
279
|
+
streamIndex: z.ZodNumber;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
282
|
+
kind: z.ZodLiteral<"local">;
|
|
283
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
284
|
+
kind: z.ZodLiteral<"remote">;
|
|
285
|
+
serverUrl: z.ZodURL;
|
|
286
|
+
}, z.core.$strict>], "kind">;
|
|
287
|
+
}, z.core.$strict>;
|
|
288
|
+
status: z.ZodLiteral<"ready">;
|
|
289
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
290
|
+
message: z.ZodString;
|
|
291
|
+
status: z.ZodLiteral<"failed">;
|
|
292
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
293
|
+
code: z.ZodOptional<z.ZodString>;
|
|
294
|
+
message: z.ZodString;
|
|
295
|
+
resume: z.ZodOptional<z.ZodObject<{
|
|
296
|
+
session: z.ZodObject<{
|
|
297
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
298
|
+
sessionId: z.ZodString;
|
|
299
|
+
streamIndex: z.ZodNumber;
|
|
300
|
+
}, z.core.$strict>;
|
|
301
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
302
|
+
kind: z.ZodLiteral<"local">;
|
|
303
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
304
|
+
kind: z.ZodLiteral<"remote">;
|
|
305
|
+
serverUrl: z.ZodURL;
|
|
306
|
+
}, z.core.$strict>], "kind">;
|
|
307
|
+
}, z.core.$strict>>;
|
|
308
|
+
status: z.ZodLiteral<"authentication-required">;
|
|
309
|
+
}, z.core.$strict>], "status">>;
|
|
310
|
+
$id: string;
|
|
311
|
+
title: string;
|
|
312
|
+
};
|
|
313
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{inputOptionSchema,inputRequestSchema}from"#client/index.js";const sessionCursorSchema=z.object({continuationToken:z.string().optional(),sessionId:z.string().min(1),streamIndex:z.number().int().nonnegative()}).strict(),targetSchema=z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`local`)}).strict(),z.object({kind:z.literal(`remote`),serverUrl:z.url()}).strict()]),invokeResumeSchema=z.object({session:sessionCursorSchema,target:targetSchema}).strict(),invocationInputRequestSchema=inputRequestSchema.omit({action:!0,display:!0,options:!0}).extend({options:z.array(inputOptionSchema.omit({style:!0})).optional()}),authorizationChallengeSchema=z.object({displayName:z.string().optional(),expiresAt:z.string().optional(),instructions:z.string().optional(),url:z.string().optional(),userCode:z.string().optional()}).strict(),authorizationInterruptSchema=z.object({authorization:authorizationChallengeSchema.optional(),description:z.string(),name:z.string(),webhookUrl:z.string().optional()}).strict(),turnOutcomeSchema=z.discriminatedUnion(`status`,[z.object({message:z.string().optional(),status:z.literal(`completed`)}).strict(),z.object({message:z.string(),status:z.literal(`failed`)}).strict()]),invokeResultSchema=z.discriminatedUnion(`status`,[z.object({resume:invokeResumeSchema,status:z.literal(`running`)}).strict(),z.object({requests:z.array(invocationInputRequestSchema).readonly(),resume:invokeResumeSchema,status:z.literal(`input-required`)}).strict(),z.object({authorizations:z.array(authorizationInterruptSchema).min(1).readonly(),resume:invokeResumeSchema,status:z.literal(`authorization-required`)}).strict(),z.object({outcome:turnOutcomeSchema,resume:invokeResumeSchema,status:z.literal(`ready`)}).strict(),z.object({message:z.string(),status:z.literal(`failed`)}).strict(),z.object({code:z.string().optional(),message:z.string(),resume:invokeResumeSchema.optional(),status:z.literal(`authentication-required`)}).strict()]);function projectInvocationInputRequest(e){let{allowFreeform:t,options:n,prompt:r,requestId:i}=e;return{allowFreeform:t,options:n?.map(({description:e,id:t,label:n})=>({description:e,id:t,label:n})),prompt:r,requestId:i}}function parseInvokeResumeInput(e){let t=invokeResultSchema.safeParse(e);if(t.success&&`resume`in t.data&&t.data.resume!==void 0)return t.data;throw Error(`Resume JSON is not a valid resumable eve invoke result.`)}const invokeResultJsonSchema={...z.toJSONSchema(invokeResultSchema,{io:`input`,target:`draft-2020-12`,unrepresentable:`any`}),$id:`https://eve.dev/schemas/invoke-result.json`,title:`eve invoke result`};export{invokeResultJsonSchema,parseInvokeResumeInput,projectInvocationInputRequest};
|
package/dist/src/cli/run.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type BuildHost } from "#cli/commands/build.js";
|
|
2
2
|
import { resolveDevUiMode, resolveTuiDisplayOptions } from "#cli/dev/ui-options.js";
|
|
3
3
|
import type { RunDevelopmentTuiInput } from "#cli/dev/tui/tui.js";
|
|
4
|
+
import { type InvokeCliRuntimeDependencies } from "#cli/invoke/command.js";
|
|
4
5
|
import type { DevelopmentServer, DevelopmentServerOptions, ProductionServerHandle } from "#internal/nitro/host/types.js";
|
|
5
6
|
export { resolveDevUiMode, resolveTuiDisplayOptions };
|
|
6
7
|
interface CliLogger {
|
|
@@ -18,6 +19,7 @@ interface CliRuntimeDependencies {
|
|
|
18
19
|
json?: boolean;
|
|
19
20
|
}): Promise<void>;
|
|
20
21
|
runDevelopmentTui(input: RunDevelopmentTuiInput): Promise<void>;
|
|
22
|
+
runInvoke: InvokeCliRuntimeDependencies["runInvoke"];
|
|
21
23
|
runEvalCommand(evalIds: readonly string[], options: EvalCliOptions, logger: CliLogger): Promise<void>;
|
|
22
24
|
startHost(appRoot: string, options?: DevelopmentServerOptions): DevelopmentServer;
|
|
23
25
|
startProductionHost(appRoot: string, options?: {
|
package/dist/src/cli/run.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{eveCliBanner}from"#cli/banner.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{devBootPhase}from"#internal/dev-boot-progress.js";import{Command,CommanderError,InvalidArgumentError}from"#compiled/commander/index.js";import{registerBuildCommand}from"#cli/commands/build.js";import{resolveApplicationRoot}from"#internal/application/paths.js";import{registerIntegrationCommands}from"#cli/commands/register-integration-commands.js";import{registerProjectCommands}from"#cli/commands/register-project-commands.js";import{registerRegistryCommands}from"#cli/commands/register-registry-commands.js";import{resolveDevUiMode,resolveTuiDisplayOptions}from"#cli/dev/ui-options.js";import{FORCED_EXIT_BACKSTOP_MS,installShutdownSignal,waitForShutdownSignal}from"#cli/shutdown.js";import{waitForServerOrStop,waitForUiOrServer}from"#cli/dev/wait-for-ui.js";import{
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{eveCliBanner}from"#cli/banner.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{devBootPhase}from"#internal/dev-boot-progress.js";import{Command,CommanderError,InvalidArgumentError}from"#compiled/commander/index.js";import{parseDevelopmentHeaderOption,resolveDevelopmentUrlTarget}from"#cli/dev/url-target.js";import{parseDevelopmentServerUrl}from"#cli/dev/url.js";import{registerBuildCommand}from"#cli/commands/build.js";import{resolveApplicationRoot}from"#internal/application/paths.js";import{registerIntegrationCommands}from"#cli/commands/register-integration-commands.js";import{registerProjectCommands}from"#cli/commands/register-project-commands.js";import{registerRegistryCommands}from"#cli/commands/register-registry-commands.js";import{resolveDevUiMode,resolveTuiDisplayOptions}from"#cli/dev/ui-options.js";import{FORCED_EXIT_BACKSTOP_MS,installShutdownSignal,waitForShutdownSignal}from"#cli/shutdown.js";import{waitForServerOrStop,waitForUiOrServer}from"#cli/dev/wait-for-ui.js";import{registerRuntimeInvokeCommand}from"#cli/invoke/command.js";import{LOG_DISPLAY_MODES,parseLogDisplayMode}from"#cli/dev/tui/log-display-mode.js";import{resolveTuiTitle}from"#cli/dev/tui/target.js";const devBootLog=createLogger(`dev.boot`);function createDevBootProgressReporter(e){return t=>{switch(t.type){case`phase-started`:e?.update(`Building your agent`,t.phase),devBootLog.debug(t.phase);return;case`phase-finished`:devBootLog.debug(`${t.phase} finished`,{ms:t.elapsedMs});return;case`before-first-paint`:e?.stop();return;default:return t}}}async function loadPrintApplicationInfo(){return(await import(`#cli/commands/info.js`)).printApplicationInfo}async function loadRunDevelopmentTui(){return(await import(`#cli/dev/tui/tui.js`)).runDevelopmentTui}async function loadRunEvalCommand(){return(await import(`#evals/cli/eval.js`)).runEvalCommand}async function loadStartHost(){return(await import(`#cli/dev/local-server-process.js`)).createDevelopmentServer}const loadIsActiveDevelopmentServerForApp=async()=>(await import(`#internal/nitro/host.js`)).isActiveDevelopmentServerForApp;async function loadStartProductionHost(){return(await import(`#internal/nitro/host.js`)).startProductionServer}function parsePortOption(e){if(!/^-?\d+$/.test(e))throw new InvalidArgumentError(`Expected a numeric port, received "${e}".`);let t=Number(e);if(t<0||t>65535)throw new InvalidArgumentError(`Expected a port between 0 and 65535, received "${e}".`);return t}const DISPLAY_MODES=new Set([`full`,`collapsed`,`auto-collapsed`,`hidden`]),STATS_MODES=new Set([`tokens`,`tokensPerSecond`]);function parseDisplayMode(e){if(!DISPLAY_MODES.has(e))throw new InvalidArgumentError(`Expected one of ${[...DISPLAY_MODES].join(`, `)}, received "${e}".`);return e}function parseStatsMode(e){if(!STATS_MODES.has(e))throw new InvalidArgumentError(`Expected one of ${[...STATS_MODES].join(`, `)}, received "${e}".`);return e}function parseLogsMode(e){let t=parseLogDisplayMode(e);if(t===void 0)throw new InvalidArgumentError(`Expected one of ${LOG_DISPLAY_MODES.join(`, `)}, received "${e}".`);return t}function parseContextSizeOption(e){let t=Number(e);if(!Number.isFinite(t)||t<=0)throw new InvalidArgumentError(`Expected a positive number, received "${e}".`);return t}function hasInteractiveTerminal(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}function createCliProgram(e,i){let c=resolveApplicationRoot(),y=resolveInstalledPackageInfo().version,b=new Command,x=createCliTheme();b.name(`eve`).description(`Build and run an eve application.`).version(y).showHelpAfterError().exitOverride().hook(`preAction`,(t,n)=>{[`info`,`dev`,`init`].includes(n.name())&&e.log(eveCliBanner())}).configureOutput({writeErr:t=>{e.error(t.trimEnd())},writeOut:t=>{e.log(t.trimEnd())}});let S=b.command(`channels`).description(`Manage user-authored channels in the current project.`);S.command(`add [kind]`).description(`Add channels interactively, or scaffold a channel kind (slack | web).`).option(`-f, --force`,`Overwrite existing channel files`).option(`-y, --yes`,`Assume yes for confirmations; requires an explicit channel kind`).action(async(t,n)=>{let{runChannelsAddCompatibilityCommand:r}=await import(`#cli/commands/channels.js`);await r(e,c,{kind:t,options:n})}),S.command(`list`).description(`List user-authored channels in the current project.`).option(`--json`,`Output as JSON`).action(async t=>{let{runChannelsListCommand:n}=await import(`#cli/commands/channels.js`);await n(e,c,t)}),registerIntegrationCommands({program:b,logger:e,appRoot:c});let C=b.command(`extension`).description(`Create and build reusable eve extension packages.`);C.command(`init [target]`).description(`Create a new eve extension package.`).option(`-y, --yes`,`Accepted for compatibility; has no effect`).action(async(t,n)=>{n.yes&&e.error(`warning: --yes has no effect for eve extension init.`);let{runExtensionInitCommand:r}=await import(`#cli/commands/extension-init.js`);await r(e,c,t)}),C.command(`build`).description(`Build the current package as an eve extension.`).action(async()=>{let{loadDevelopmentEnvironmentFiles:t}=await import(`#cli/dev/environment.js`);t(c);let{runExtensionBuildCommand:n}=await import(`#cli/commands/extension-build.js`);await n(e,c)}),registerRegistryCommands({program:b,logger:e,appRoot:c}),b.command(`init [target]`).description(`Create a new eve agent, or add one to an existing project directory.`).option(`--channel-web-nextjs`,`Add the Web Chat application (Next.js)`).option(`-y, --yes`,`Accepted for compatibility; has no effect`).action(async(t,n)=>{n.yes&&e.error(`warning: --yes has no effect for eve init.`);let{runInitCommand:r}=await import(`#cli/commands/init.js`);await r(e,c,t,{channelWebNextjs:n.channelWebNextjs})}),registerProjectCommands({program:b,logger:e,appRoot:c}),registerBuildCommand({appRoot:c,buildHost:i.buildHost,logger:e,program:b}),b.command(`start`).description(`Start a built eve application.`).option(`--host <host>`,`Host interface to bind`).option(`--port <port>`,`Port to listen on (defaults to $PORT, then 3000)`,parsePortOption).action(async t=>{let{loadDevelopmentEnvironmentFiles:n}=await import(`#cli/dev/environment.js`);n(c);let a=await(i.startProductionHost??await loadStartProductionHost())(c,{host:t.host,port:t.port});e.log(renderCliTaggedLine(x,{message:`server listening at ${a.url}`,tag:`start`,tone:`success`})),await waitForShutdownSignal({close:()=>a.close(),wait:()=>a.wait()})}),registerRuntimeInvokeCommand({appRoot:c,logger:e,program:b,runtime:i}),b.command(`dev`).description(`Start the eve development server or connect to an existing URL.`).argument(`[url]`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`--host <host>`,`Host interface to bind`).option(`--port <port>`,`Port to listen on (defaults to $PORT, then 2000)`,parsePortOption).option(`-u, --url <url>`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`-H, --header <header>`,`Request header for a URL target, in "Name: value" form (repeatable)`,parseDevelopmentHeaderOption).option(`--no-ui`,`Start the server without an interactive UI`).option(`--name <name>`,`Title shown in the terminal UI (defaults to the app folder name)`).option(`--input <text>`,`Pre-fill the prompt input, or start onboarding with /model`).option(`--tools <mode>`,`How tool calls render: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--reasoning <mode>`,`How reasoning renders: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--subagents <mode>`,`How subagent sections render: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--connection-auth <mode>`,`How connection authorization renders: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--assistant-response-stats <mode>`,`Assistant header statistic: tokens | tokensPerSecond`,parseStatsMode).option(`--context-size <tokens>`,`Model context window size, shown as a usage percentage`,parseContextSizeOption).option(`--logs <mode>`,`Which server/agent logs to show: all | stderr | sandbox | none`,parseLogsMode).addHelpText(`after`,`
|
|
2
2
|
You can also pass a bare URL, for example: eve dev https://example.com
|
|
3
|
-
`).action(async(t,n)=>{let a=resolveDevelopmentUrlTarget(n,t),s=a?.serverUrl,u=hasInteractiveTerminal(),
|
|
4
|
-
eve trace ls [options]`).description("Show a local `eve dev` trace (the most recent when trace is omitted).").action(async t=>{let{runTraceShowCommand:n}=await import(`#cli/commands/trace.js`);await n(e,c,t)}).command(`ls`).description(`List local traces, most recent first.`).option(`--json`,`Output as JSON`).action(async t=>{let{runTraceListCommand:n}=await import(`#cli/commands/trace.js`);await n(e,c,t)}),
|
|
3
|
+
`).action(async(t,n)=>{let a=resolveDevelopmentUrlTarget(n,t),s=a?.serverUrl,u=hasInteractiveTerminal(),f=resolveDevUiMode({options:n,interactive:u});if(n.input!==void 0&&f===`headless`)throw new InvalidArgumentError(`--input requires the interactive UI.`);let p=!1;s!==void 0&&(p=await(i.isActiveDevelopmentServerForApp??await loadIsActiveDevelopmentServerForApp())({appRoot:c,serverUrl:s}));let runInteractiveUi=async(e,t,r)=>{let o=await devBootPhase(`loading interactive UI`,async()=>i.runDevelopmentTui??await loadRunDevelopmentTui(),t),l=resolveTuiDisplayOptions(n),u=s===void 0||p?{kind:`local`,serverUrl:e.serverUrl,workspaceRoot:e.appRoot??c}:{kind:`remote`,serverUrl:e.serverUrl,workspaceRoot:c},d=resolveTuiTitle({name:n.name,target:u});d!==void 0&&(l.name=d);let f={target:u,initialInput:n.input,onBootProgress:t,lifecycle:r,...l};a?.headers===void 0?await o(f):await o({...f,headers:a.headers})};if(s){let{loadDevelopmentEnvironmentFiles:t}=await import(`#cli/dev/environment.js`);if(t(c),e.log(`↗ ${p?`local`:`remote`} mode targeting ${x.info(new URL(s).host)}`),f===`headless`){e.log(renderCliTaggedLine(x,{message:`Interactive UI disabled because the current terminal is not a TTY.`,tag:`dev`,tone:`warning`}));return}e.log(``);let n=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS});try{await runInteractiveUi({serverUrl:s},void 0,n)}finally{n.dispose()}return}f===`tui`&&e.log(``);let m=f===`tui`?startCliLiveRow(e):void 0,h=createDevBootProgressReporter(m);m?.update(`Building your agent`);let g,_,closeServer=()=>g===void 0?Promise.resolve():(_??=g.close(),_.catch(()=>void 0),_),v=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS,onStop:()=>{closeServer()}});try{g=(i.startHost??await loadStartHost())(c,{existing:f===`tui`?`attach-if-unconfigured`:`reject`,host:n.host,onBootProgress:h,port:n.port});let t=(await Promise.race([g.start().then(e=>({handle:e})),v.stopped.then(()=>({handle:void 0}))])).handle;if(t===void 0)return;if(f!==`tui`&&e.log(renderCliTaggedLine(x,{message:`server listening at ${t.url}`,tag:`dev`,tone:`success`})),f===`headless`){n.ui!==!1&&!u&&e.log(renderCliTaggedLine(x,{message:`Interactive UI disabled because the current terminal is not a TTY.`,tag:`dev`,tone:`warning`})),await waitForServerOrStop(g,v);return}await waitForUiOrServer({handle:t,lifecycle:v,server:g,runUi:async()=>await runInteractiveUi({appRoot:t.appRoot,serverUrl:t.url},h,v)})}finally{m?.stop(),await closeServer(),v.dispose()}});let w=b.command(`logs`).description("Inspect local `eve dev` diagnostic logs (.eve/logs).");return w.command(`show [logid]`,{isDefault:!0}).description(`Print a diagnostic log (the most recent when logid is omitted).`).option(`--dump`,`Prepend the log's environment dump (.dump sibling)`).option(`--events`,`Interleave session events from the local workflow store`).action(async(t,n)=>{let{runLogsShowCommand:r}=await import(`#cli/commands/logs.js`);await r(e,c,t,n)}),w.command(`ls`).description(`List diagnostic logs, most recent first.`).option(`--json`,`Output as JSON`).action(async t=>{let{runLogsListCommand:n}=await import(`#cli/commands/logs.js`);await n(e,c,t)}),b.command(`trace [trace]`).usage(`[options] [trace]
|
|
4
|
+
eve trace ls [options]`).description("Show a local `eve dev` trace (the most recent when trace is omitted).").action(async t=>{let{runTraceShowCommand:n}=await import(`#cli/commands/trace.js`);await n(e,c,t)}).command(`ls`).description(`List local traces, most recent first.`).option(`--json`,`Output as JSON`).action(async t=>{let{runTraceListCommand:n}=await import(`#cli/commands/trace.js`);await n(e,c,t)}),b.command(`info`).description(`Print resolved application information.`).option(`--json`,`Output as JSON`).action(async t=>{await(i.printApplicationInfo??await loadPrintApplicationInfo())(e,c,t)}),b.command(`eval`).description(`Run evals against an eve agent.`).argument(`[evalIds...]`,`Eval ids (or directory prefixes) to run (all discovered evals when omitted)`).option(`--url <url>`,`Remote agent URL (skip local host startup)`,parseDevelopmentServerUrl).option(`--tag <tag...>`,`Run only evals carrying a tag`).option(`--strict`,`Fail the exit code when any score falls below its threshold`).option(`--list`,`Print discovered evals without running them`).option(`--timeout <ms>`,`Per-eval timeout in milliseconds`).option(`--max-concurrency <n>`,`Max concurrent eval executions`).option(`--json`,`Output results as JSON`).option(`--junit <path>`,`Write JUnit XML results to a file`).option(`--skip-report`,`Skip eval-defined reporters (e.g. Braintrust)`).option(`--verbose`,`Stream per-eval t.log lines to stdout`).action(async(t,n)=>{await(i.runEvalCommand??await loadRunEvalCommand())(t,n,e)}),b}async function runCli(e=process.argv.slice(2),t=console,n={}){let r=createCliProgram(t,n),a=e.length===0?[`dev`]:e;try{await r.parseAsync(a,{from:`user`})}catch(e){if(e instanceof CommanderError){if(e.exitCode===0)return;let r=await(n.isCodingAgentLaunch??isCodingAgentLaunch)();if(a[0]===`init`&&r){let{initAgentInstructions:e}=await import(`#cli/commands/agent-instructions.js`);t.log(e())}throw Error(e.message)}throw e}}export{resolveDevUiMode,resolveTuiDisplayOptions,runCli};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_HEALTH_ROUTE_PATH,EVE_INFO_ROUTE_PATH}from"#protocol/routes.js";import{encodeBasicCredentials}from"#internal/http/basic-auth.js";import{
|
|
1
|
+
import{EVE_HEALTH_ROUTE_PATH,EVE_INFO_ROUTE_PATH}from"#protocol/routes.js";import{encodeBasicCredentials}from"#internal/http/basic-auth.js";import{createInitialSessionState}from"#client/session-utils.js";import{AgentInfoResponseError}from"#client/agent-info-error.js";import{AgentInfoResultSchema}from"#client/agent-info-schema.js";import{ClientError}from"#client/client-error.js";import{ClientSession}from"#client/session.js";import{createClientUrl}from"#client/url.js";import{VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER}from"#client/types.js";var Client=class{#e;#t;#n;#r;#i;constructor(e){this.#n=e.host,this.#e=e.auth,this.#t=e.headers,this.#r=e.preserveCompletedSessions??!1,this.#i=e.redirect}async health(){let t=createClientUrl(this.#n,EVE_HEALTH_ROUTE_PATH),n=await this.#a(),r=await fetch(t,withRedirectPolicy({headers:n},this.#i));if(!r.ok){let e=await r.text();throw new ClientError(r.status,e,r.headers)}return await r.json()}async info(){let e=await this.fetch(EVE_INFO_ROUTE_PATH);if(!e.ok){let t=await e.text();throw new ClientError(e.status,t,e.headers)}let n;try{n=await e.json()}catch{throw new AgentInfoResponseError}let r=AgentInfoResultSchema.safeParse(n);if(!r.success)throw new AgentInfoResponseError(r.error.issues.slice(0,5).map(e=>{let t=e.path.join(`.`);return t.length===0?e.message:`${t}: ${e.message}`}));return r.data}async fetch(e,t={}){let n=createClientUrl(this.#n,e),r=await this.#a(headersInitToRecord(t.headers));return await fetch(n,withRedirectPolicy({...t,headers:r},this.#i))}session(e){let t;return t=typeof e==`string`?{continuationToken:e,streamIndex:0}:e||createInitialSessionState(),new ClientSession({host:this.#n,preserveCompletedSessions:this.#r,redirect:this.#i,resolveHeaders:e=>this.#a(e)},t)}async#a(e){let t=new Headers,[n,r]=await Promise.all([resolveHeadersValue(this.#t),this.#o()]);for(let[e,r]of Object.entries(n))t.set(e,r);for(let[e,n]of Object.entries(r))t.set(e,n);if(e)for(let[n,r]of Object.entries(e))t.set(n,r);return t}async#o(){let e=this.#e;if(!e)return{};if(`vercelOidc`in e){let t=(await resolveTokenValue(e.vercelOidc.token)).trim();return t.length===0?{}:{authorization:`Bearer ${t}`,[VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER]:t}}if(`bearer`in e){let t=(await resolveTokenValue(e.bearer)).trim();return t.length===0?{}:{authorization:`Bearer ${t}`}}if(`basic`in e){let t=await resolveTokenValue(e.basic.password);return{authorization:`Basic ${encodeBasicCredentials(e.basic.username,t)}`}}return{}}};async function resolveTokenValue(e){return typeof e==`function`?e():e}async function resolveHeadersValue(e){return e===void 0?{}:typeof e==`function`?await e():e}function headersInitToRecord(e){return e===void 0?{}:Object.fromEntries(new Headers(e).entries())}function withRedirectPolicy(e,t){return t===void 0?e:{...e,redirect:t}}export{Client};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{summarizeTurnEvents}from"#client/session-utils.js";import{extractCompletedResult}from"#client/output-schema.js";var MessageResponse=class{continuationToken;sessionId;#e=!1;#t;constructor(e){this.continuationToken=e.continuationToken,this.sessionId=e.sessionId,this.#t=e.createStream}async result(){let t=[];for await(let e of this)t.push(e);let n=summarizeTurnEvents(t);return{data:extractCompletedResult(t),events:t,inputRequests:n.inputRequests,message:n.message,sessionId:this.sessionId,status:n.status}}[Symbol.asyncIterator](){if(this.#e)throw Error(`MessageResponse has already been consumed.`);return this.#e=!0,this.#t()}};export{MessageResponse};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HandleMessageStreamEvent } from "#protocol/message.js";
|
|
1
|
+
import type { AuthorizationRequiredStreamEvent, HandleMessageStreamEvent, TurnFailureStreamEvent } from "#protocol/message.js";
|
|
2
2
|
import type { SessionState } from "#client/types.js";
|
|
3
3
|
import type { InputRequest } from "#runtime/input/types.js";
|
|
4
4
|
/**
|
|
@@ -20,17 +20,23 @@ export declare function advanceSession(input: {
|
|
|
20
20
|
readonly sessionId: string;
|
|
21
21
|
readonly session: SessionState;
|
|
22
22
|
}): SessionState;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
/** A connection authorization challenge that remains unresolved at a turn boundary. */
|
|
24
|
+
export interface PendingAuthorization {
|
|
25
|
+
readonly authorization?: AuthorizationRequiredStreamEvent["data"]["authorization"];
|
|
26
|
+
readonly description: string;
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly webhookUrl?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Canonical projection of the lifecycle state represented by one turn's events. */
|
|
31
|
+
export interface TurnEventSummary {
|
|
32
|
+
readonly boundary: HandleMessageStreamEvent | undefined;
|
|
33
|
+
readonly failure: TurnFailureStreamEvent | undefined;
|
|
34
|
+
readonly inputRequests: readonly InputRequest[];
|
|
35
|
+
readonly message: string | undefined;
|
|
36
|
+
readonly pendingAuthorizations: readonly PendingAuthorization[];
|
|
37
|
+
readonly status: "completed" | "failed" | "waiting";
|
|
38
|
+
}
|
|
39
|
+
/** Reduces one turn's protocol events into their client-facing lifecycle state. */
|
|
40
|
+
export declare function summarizeTurnEvents(events: readonly HandleMessageStreamEvent[]): TurnEventSummary;
|
|
41
|
+
/** Collects one segment of an event stream through its current-turn boundary. */
|
|
42
|
+
export declare function collectTurnEvents(stream: AsyncIterable<HandleMessageStreamEvent>): Promise<readonly HandleMessageStreamEvent[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";function createInitialSessionState(){return{streamIndex:0}}function advanceSession(e){let t=findBoundaryEvent(e.events),n=e.session.streamIndex+e.events.length;return t?.type===`session.waiting`||e.preserveCompletedSessions===!0&&t?.type===`session.completed`?{continuationToken:t?.type===`session.waiting`?t.data.continuationToken:e.continuationToken??e.session.continuationToken,sessionId:e.sessionId,streamIndex:n}:t===void 0?{continuationToken:e.continuationToken??e.session.continuationToken,sessionId:e.sessionId,streamIndex:n}:createInitialSessionState()}function
|
|
1
|
+
import{isCurrentTurnBoundaryEvent,isTurnFailureEvent}from"#protocol/message.js";function createInitialSessionState(){return{streamIndex:0}}function advanceSession(e){let t=findBoundaryEvent(e.events),n=e.session.streamIndex+e.events.length;return t?.type===`session.waiting`||e.preserveCompletedSessions===!0&&t?.type===`session.completed`?{continuationToken:t?.type===`session.waiting`?t.data.continuationToken:e.continuationToken??e.session.continuationToken,sessionId:e.sessionId,streamIndex:n}:t===void 0?{continuationToken:e.continuationToken??e.session.continuationToken,sessionId:e.sessionId,streamIndex:n}:createInitialSessionState()}function summarizeTurnEvents(n){let r,i,a,o=[],s=new Map;for(let c of n)isCurrentTurnBoundaryEvent(c)&&(r=c),isTurnFailureEvent(c)&&(i=c),isFinalMessageCompleted(c)&&(a=c.data.message??void 0),c.type===`input.requested`&&o.push(...c.data.requests),c.type===`authorization.required`&&s.set(c.data.name,c.data),c.type===`authorization.completed`&&s.delete(c.data.name);return{boundary:r,failure:i,inputRequests:o,message:a,pendingAuthorizations:[...s.values()],status:r?.type===`session.waiting`?`waiting`:r?.type===`session.failed`?`failed`:`completed`}}async function collectTurnEvents(t){let n=[];for await(let r of t)if(n.push(r),isCurrentTurnBoundaryEvent(r))break;return n}function findBoundaryEvent(t){for(let n=t.length-1;n>=0;n--){let r=t[n];if(r!==void 0&&isCurrentTurnBoundaryEvent(r))return r}}function isFinalMessageCompleted(e){return e.type===`message.completed`&&e.data.finishReason!==`tool-calls`}export{advanceSession,collectTurnEvents,createInitialSessionState,summarizeTurnEvents};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_CREATE_SESSION_ROUTE_PATH,EVE_RESET_SESSION_ROUTE_PATH,createEveCancelTurnRoutePath,createEveContinueSessionRoutePath}from"#protocol/routes.js";import{EVE_SESSION_ID_HEADER,isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{
|
|
1
|
+
import{EVE_CREATE_SESSION_ROUTE_PATH,EVE_RESET_SESSION_ROUTE_PATH,createEveCancelTurnRoutePath,createEveContinueSessionRoutePath}from"#protocol/routes.js";import{EVE_SESSION_ID_HEADER,isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{advanceSession,createInitialSessionState}from"#client/session-utils.js";import{ClientError}from"#client/client-error.js";import{createClientUrl}from"#client/url.js";import{MessageResponse}from"#client/message-response.js";import{CancelTurnResponseSchema}from"#protocol/cancel-turn.js";import{ResetResponseSchema}from"#protocol/reset-session.js";import{followStreamIterable}from"#client/open-stream.js";import{serializeOutputSchema}from"#shared/tool-schema.js";var ClientSession=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get state(){return this.#t}async send(e){let t=normalizeSendTurnInput(e),n=this.#t,{continuationToken:r,sessionId:i}=await this.#n(t,n);if(this.#t===n){let e={...n,sessionId:i};r!==void 0&&(e.continuationToken=r),this.#t=e}return new MessageResponse({continuationToken:r,createStream:()=>this.#r(i,r,n,t),sessionId:i})}async cancel(e){let t=this.#t.sessionId;if(!t)throw Error(`Session has no session ID. Send a message first.`);let r=createClientUrl(this.#e.host,createEveCancelTurnRoutePath(t)),i=await this.#e.resolveHeaders();i.set(`content-type`,`application/json`);let a=await fetch(r,withRedirectPolicy({headers:i,method:`POST`,body:e?JSON.stringify(e):void 0},this.#e.redirect)),o=await a.text();if(!a.ok)throw new ClientError(a.status,o,a.headers);let s;try{s=JSON.parse(o)}catch{throw Error(`Cancel route returned invalid JSON (${a.status}).`)}let l=CancelTurnResponseSchema.safeParse(s);if(!l.success||l.data.sessionId!==t)throw Error(`Cancel route returned an invalid response (${a.status}).`);return{sessionId:l.data.sessionId,status:l.data.status}}async reset(){let e=this.#t,n=e.continuationToken;if(n===void 0){if(e.sessionId!==void 0)throw Error(`Session has no continuation token. Consume its event stream before resetting.`);return this.#t=createInitialSessionState(),{status:`no_active_session`}}let r=createClientUrl(this.#e.host,EVE_RESET_SESSION_ROUTE_PATH),i=await this.#e.resolveHeaders();i.set(`content-type`,`application/json`);let a=await fetch(r,withRedirectPolicy({body:JSON.stringify({continuationToken:n}),headers:i,method:`POST`},this.#e.redirect)),o=await a.text();if(!a.ok)throw new ClientError(a.status,o,a.headers);let l;try{l=JSON.parse(o)}catch{throw Error(`Reset route returned invalid JSON (${a.status}).`)}let u=ResetResponseSchema.safeParse(l);if(!u.success||u.data.status===`reset`&&e.sessionId!==void 0&&u.data.previousSessionId!==e.sessionId)throw Error(`Reset route returned an invalid response (${a.status}).`);return this.#t===e&&(this.#t=createInitialSessionState()),u.data.status===`reset`?{previousSessionId:u.data.previousSessionId,status:`reset`}:{status:`no_active_session`}}stream(e){let t=this.#t.sessionId;if(!t)throw Error(`Session has no session ID. Send a message first.`);if(e?.follow===!1&&(e.startIndex??this.#t.streamIndex)<0)throw Error(`stream({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.`);return this.#i(t,e)}async#n(t,n){let a=n.sessionId?createEveContinueSessionRoutePath(n.sessionId):EVE_CREATE_SESSION_ROUTE_PATH,o=createClientUrl(this.#e.host,a),s=await this.#e.resolveHeaders(t.headers);s.set(`content-type`,`application/json`);let c=createHandleMessageBody({input:t,outputSchema:serializeOutputSchema(t.outputSchema),session:n});if(c===null)throw Error(`Session.send requires a non-empty message, inputResponses, or both.`);let l=await postTurnWithRetry({body:JSON.stringify(c),headers:s,mustDeliver:(t.inputResponses?.length??0)>0,redirect:this.#e.redirect,signal:t.signal,url:o}),u=await l.json(),d=(typeof u.sessionId==`string`?u.sessionId:void 0)??l.headers.get(EVE_SESSION_ID_HEADER)?.trim()??n.sessionId;if(!d)throw Error(`Message route did not return a session id.`);return{continuationToken:typeof u.continuationToken==`string`?u.continuationToken:void 0,sessionId:d}}async*#r(e,t,n,r){let i=[];try{for await(let t of followStreamIterable({host:this.#e.host,resolveHeaders:()=>this.#e.resolveHeaders(r.headers),redirect:this.#e.redirect,streamReconnectPolicy:r.streamReconnectPolicy,sessionId:e,signal:r.signal,startIndex:n.sessionId===e?n.streamIndex:0}))if(i.push(t),yield t,isCurrentTurnBoundaryEvent(t))break}finally{this.#t=advanceSession({continuationToken:t,events:i,preserveCompletedSessions:this.#e.preserveCompletedSessions,sessionId:e,session:n})}}async*#i(e,t){let n=this.#t,r=t?.startIndex??n.streamIndex,i=[];try{for await(let n of followStreamIterable({follow:t?.follow,host:this.#e.host,resolveHeaders:()=>this.#e.resolveHeaders(),redirect:this.#e.redirect,streamReconnectPolicy:t?.streamReconnectPolicy,sessionId:e,signal:t?.signal,startIndex:r}))i.push(n),yield n}finally{r>=0&&(this.#t=advanceSession({continuationToken:n.continuationToken,events:i,preserveCompletedSessions:this.#e.preserveCompletedSessions,session:{...n,sessionId:e,streamIndex:r},sessionId:e}))}}};async function postTurnWithRetry(e){let t=e.mustDeliver?10:1,n,r,i;for(let a=0;a<t;a+=1){let o=await fetch(e.url,{body:e.body,headers:e.headers,method:`POST`,redirect:e.redirect,signal:e.signal??null});if(o.ok)return o;if(n=o.status,r=await o.text(),i=o.headers,!isRetryableDeliveryFailure(o.status,r))throw new ClientError(o.status,r,o.headers);a<t-1&&await sleep(200)}throw new ClientError(n??0,r??`Failed to deliver session turn.`,i)}function isRetryableDeliveryFailure(e,t){return e===500&&/target session was not found/i.test(t)}async function sleep(e){await new Promise(t=>setTimeout(t,e))}function normalizeSendTurnInput(e){return typeof e==`string`?{message:e}:e}function createHandleMessageBody(e){let t={};return e.input.message!==void 0&&(t.message=e.input.message),e.input.inputResponses!==void 0&&e.input.inputResponses.length>0&&(t.inputResponses=e.input.inputResponses),e.input.clientContext!==void 0&&(t.clientContext=e.input.clientContext),e.outputSchema!==void 0&&(t.outputSchema=e.outputSchema),e.session.continuationToken!==void 0&&(t.continuationToken=e.session.continuationToken),Object.keys(t).length===0||e.session.continuationToken===void 0&&t.message===void 0||e.session.continuationToken!==void 0&&t.message===void 0&&t.inputResponses===void 0?null:t}function withRedirectPolicy(e,t){return t===void 0?e:{...e,redirect:t}}export{ClientSession};
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"@vercel/oidc": "3.8.0",
|
|
33
33
|
"@vercel/otel": "2.1.3",
|
|
34
34
|
"@vercel/sandbox": "2.8.0",
|
|
35
|
-
"@workflow/core": "5.0.0-beta.
|
|
36
|
-
"@workflow/errors": "5.0.0-beta.
|
|
35
|
+
"@workflow/core": "5.0.0-beta.37",
|
|
36
|
+
"@workflow/errors": "5.0.0-beta.13",
|
|
37
37
|
"@workflow/serde": "5.0.0-beta.2",
|
|
38
|
-
"@workflow/world": "5.0.0-beta.
|
|
39
|
-
"@workflow/world-local": "5.0.0-beta.
|
|
40
|
-
"@workflow/world-vercel": "5.0.0-beta.
|
|
38
|
+
"@workflow/world": "5.0.0-beta.23",
|
|
39
|
+
"@workflow/world-local": "5.0.0-beta.31",
|
|
40
|
+
"@workflow/world-vercel": "5.0.0-beta.33",
|
|
41
41
|
"zod": "4.4.3",
|
|
42
42
|
"zod-validation-error": "5.0.0"
|
|
43
43
|
},
|
|
@@ -31,6 +31,12 @@
|
|
|
31
31
|
* - `gzip` (gzip payload compression): added in `5.0.0-beta.18`
|
|
32
32
|
* - `zstd` (zstd payload compression, preferred codec): added in `5.0.0-beta.18`
|
|
33
33
|
* alongside gzip — they co-ship, so any run that can read one can read both.
|
|
34
|
+
* - `encp` (X25519 sealed-box encryption for cross-run writes): added in
|
|
35
|
+
* `5.0.0-beta.37`. Note that producers do **not** gate `encp` on this table:
|
|
36
|
+
* they gate on the presence of `encryptionPublicKey` on the target run,
|
|
37
|
+
* which a run only carries if the deployment that created it could also
|
|
38
|
+
* open `encp`. The entry exists so the capability set stays a complete,
|
|
39
|
+
* auditable description of a run's decoding ability.
|
|
34
40
|
*/
|
|
35
41
|
import { type SerializationFormatType } from './serialization.js';
|
|
36
42
|
/**
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
* by the serialization layer in `maybeEncrypt`/`maybeDecrypt`.
|
|
17
17
|
*/
|
|
18
18
|
export type CryptoKey = import('node:crypto').webcrypto.CryptoKey;
|
|
19
|
+
/** AES-GCM nonce length in bytes. */
|
|
20
|
+
export declare const NONCE_LENGTH = 12;
|
|
21
|
+
/** AES-GCM authentication tag length in bits. */
|
|
22
|
+
export declare const TAG_LENGTH = 128;
|
|
23
|
+
/** AES-GCM authentication tag length in bytes. */
|
|
24
|
+
export declare const TAG_BYTES: number;
|
|
19
25
|
/**
|
|
20
26
|
* Import a raw AES-256 key as a `CryptoKey` for use with `encrypt()`/`decrypt()`.
|
|
21
27
|
*
|
|
@@ -37,9 +43,13 @@ export declare function importKey(raw: Uint8Array, usages?: ReadonlyArray<'encry
|
|
|
37
43
|
*
|
|
38
44
|
* @param key - CryptoKey from `importKey()`
|
|
39
45
|
* @param data - Plaintext to encrypt
|
|
46
|
+
* @param aad - Optional additional authenticated data. Not encrypted, but
|
|
47
|
+
* covered by the GCM auth tag: decryption fails unless the exact same
|
|
48
|
+
* bytes are supplied. Used by the sealed-box layer to bind ciphertext to
|
|
49
|
+
* a `projectId|runId` context. Omit for no AAD (the legacy behavior).
|
|
40
50
|
* @returns `[nonce (12 bytes)][ciphertext + GCM auth tag]`
|
|
41
51
|
*/
|
|
42
|
-
export declare function encrypt(key: CryptoKey, data: Uint8Array): Promise<Uint8Array>;
|
|
52
|
+
export declare function encrypt(key: CryptoKey, data: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
43
53
|
/**
|
|
44
54
|
* Decrypt data using AES-256-GCM.
|
|
45
55
|
*
|
|
@@ -60,7 +70,10 @@ export declare function encrypt(key: CryptoKey, data: Uint8Array): Promise<Uint8
|
|
|
60
70
|
*
|
|
61
71
|
* @param key - CryptoKey from `importKey()`
|
|
62
72
|
* @param data - `[nonce (12 bytes)][ciphertext + GCM auth tag]`
|
|
73
|
+
* @param aad - Optional additional authenticated data. Must match the bytes
|
|
74
|
+
* passed to {@link encrypt} exactly, otherwise the GCM tag fails to verify
|
|
75
|
+
* and a {@link RuntimeDecryptionError} is thrown.
|
|
63
76
|
* @returns Decrypted plaintext
|
|
64
77
|
*/
|
|
65
|
-
export declare function decrypt(key: CryptoKey, data: Uint8Array): Promise<Uint8Array>;
|
|
78
|
+
export declare function decrypt(key: CryptoKey, data: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
66
79
|
//# sourceMappingURL=encryption.d.ts.map
|