@swirls/deploy 0.5.0 → 0.7.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/dist/index.d.ts CHANGED
@@ -1,8 +1,87 @@
1
+ import { z } from 'zod';
1
2
  import * as json_schema from 'json-schema';
2
3
  import { JSONSchema7 } from 'json-schema';
3
- import { z } from 'zod';
4
4
  import fs from 'node:fs';
5
5
 
6
+ /**
7
+ * The query model of a stream read: the filter a `type: stream` node or a
8
+ * stream trigger applies to records, and the shapes of the node's ordering,
9
+ * time bounds and summaries as they appear in a deployment definition.
10
+ *
11
+ * A filter is the same object whether an author writes it as a literal or an
12
+ * `@ts` block returns it at run time, so a runtime checks a returned filter
13
+ * with `streamFilterSchema` before it reads anything.
14
+ */
15
+
16
+ /** A value a filter compares a field with. */
17
+ type StreamFilterScalar = string | number | boolean | null;
18
+ /** The conditions on one field, by operator. */
19
+ interface StreamFieldCondition {
20
+ eq?: StreamFilterScalar;
21
+ ne?: StreamFilterScalar;
22
+ gt?: StreamFilterScalar;
23
+ gte?: StreamFilterScalar;
24
+ lt?: StreamFilterScalar;
25
+ lte?: StreamFilterScalar;
26
+ /** The field equals one of these. */
27
+ in?: StreamFilterScalar[];
28
+ /** A text field holds this text, or a list field holds this value. */
29
+ contains?: StreamFilterScalar;
30
+ /** The field is present (`true`) or absent (`false`). */
31
+ exists?: boolean;
32
+ }
33
+ /**
34
+ * A filter on records. Each key other than `and`, `or` and `not` is a field,
35
+ * by dotted path into the record (`guest.email`), with its conditions. Keys
36
+ * at one level must all hold. `and` and `or` take a list of filters, and
37
+ * `not` one filter.
38
+ */
39
+ interface StreamFilter {
40
+ and?: StreamFilter[];
41
+ or?: StreamFilter[];
42
+ not?: StreamFilter;
43
+ [path: string]: StreamFieldCondition | StreamFilter | StreamFilter[] | undefined;
44
+ }
45
+ /** How records are ordered: newest first (the default), oldest first, or by a field. */
46
+ type StreamOrder = 'newest' | 'oldest' | {
47
+ field: string;
48
+ direction: StreamOrderDirection;
49
+ };
50
+ declare const streamOrderDirectionSchema: z.ZodEnum<{
51
+ asc: "asc";
52
+ desc: "desc";
53
+ }>;
54
+ type StreamOrderDirection = z.infer<typeof streamOrderDirectionSchema>;
55
+ /**
56
+ * A time bound on a read. `at` is an ISO 8601 time; `agoSeconds` is a span
57
+ * back from the moment the read runs. A bound written as `@ts` lowers to its
58
+ * code as a string, recorded as `ts` in the node's `configValueKinds`, and
59
+ * returns one of these two forms, or an ISO time string, at run time.
60
+ */
61
+ type StreamTimeBound = {
62
+ at: string;
63
+ } | {
64
+ agoSeconds: number;
65
+ } | string;
66
+ /** Calendar periods a summary can group by. */
67
+ declare const STREAM_GROUP_PERIODS: readonly ["hour", "day", "week", "month"];
68
+ type StreamGroupPeriod = (typeof STREAM_GROUP_PERIODS)[number];
69
+ /** What a summary groups by: a calendar period of the record's time, or a field. */
70
+ type StreamGroupBy = {
71
+ period: StreamGroupPeriod;
72
+ } | {
73
+ field: string;
74
+ };
75
+ /** Measures a summary computes. `count` takes no field. */
76
+ declare const STREAM_MEASURE_OPS: readonly ["count", "sum", "min", "max", "avg"];
77
+ type StreamMeasureOp = (typeof STREAM_MEASURE_OPS)[number];
78
+ type StreamMeasure = {
79
+ op: 'count';
80
+ } | {
81
+ op: Exclude<StreamMeasureOp, 'count'>;
82
+ field: string;
83
+ };
84
+
6
85
  declare const goalOnViolationSchema: z.ZodEnum<{
7
86
  review: "review";
8
87
  block: "block";
@@ -129,6 +208,135 @@ declare const channelPlatformSchema: z.ZodEnum<{
129
208
  swirls: "swirls";
130
209
  }>;
131
210
  type ChannelPlatform = z.infer<typeof channelPlatformSchema>;
211
+ /**
212
+ * One host a computer's machine may reach, and the secrets it may receive. A
213
+ * plain string, as definitions stored before secrets existed hold, reads as
214
+ * the host with no secrets.
215
+ */
216
+ declare const deploymentDefinitionComputerEgressSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<{
217
+ host: string;
218
+ secrets: {
219
+ block: string;
220
+ variable: string;
221
+ header: string;
222
+ format: "bearer" | "plain";
223
+ }[];
224
+ }, string>>, z.ZodObject<{
225
+ host: z.ZodString;
226
+ secrets: z.ZodArray<z.ZodObject<{
227
+ block: z.ZodString;
228
+ variable: z.ZodString;
229
+ header: z.ZodString;
230
+ format: z.ZodEnum<{
231
+ bearer: "bearer";
232
+ plain: "plain";
233
+ }>;
234
+ }, z.core.$strip>>;
235
+ }, z.core.$strip>]>;
236
+ /** One `repos:` entry: a working copy of a repository the computer starts each step with. */
237
+ declare const deploymentDefinitionComputerRepoSchema: z.ZodObject<{
238
+ repo: z.ZodDiscriminatedUnion<[z.ZodObject<{
239
+ kind: z.ZodLiteral<"self">;
240
+ }, z.core.$strip>, z.ZodObject<{
241
+ kind: z.ZodLiteral<"named">;
242
+ name: z.ZodString;
243
+ }, z.core.$strip>], "kind">;
244
+ path: z.ZodOptional<z.ZodString>;
245
+ ref: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
246
+ kind: z.ZodLiteral<"deployed">;
247
+ }, z.core.$strip>, z.ZodObject<{
248
+ kind: z.ZodLiteral<"head">;
249
+ }, z.core.$strip>, z.ZodObject<{
250
+ kind: z.ZodLiteral<"branch">;
251
+ name: z.ZodString;
252
+ }, z.core.$strip>, z.ZodObject<{
253
+ kind: z.ZodLiteral<"commit">;
254
+ sha: z.ZodString;
255
+ }, z.core.$strip>], "kind">>;
256
+ access: z.ZodEnum<{
257
+ read: "read";
258
+ change: "change";
259
+ }>;
260
+ title: z.ZodOptional<z.ZodString>;
261
+ depth: z.ZodEnum<{
262
+ shallow: "shallow";
263
+ full: "full";
264
+ }>;
265
+ submodules: z.ZodBoolean;
266
+ lfs: z.ZodBoolean;
267
+ }, z.core.$strip>;
268
+ declare const deploymentDefinitionComputerBlockSchema: z.ZodObject<{
269
+ id: z.ZodUUID;
270
+ name: z.ZodString;
271
+ label: z.ZodString;
272
+ description: z.ZodOptional<z.ZodString>;
273
+ software: z.ZodRecord<z.ZodString, z.ZodString>;
274
+ disks: z.ZodArray<z.ZodString>;
275
+ resources: z.ZodObject<{
276
+ cpus: z.ZodNumber;
277
+ memoryMiB: z.ZodNumber;
278
+ diskGiB: z.ZodOptional<z.ZodNumber>;
279
+ }, z.core.$strip>;
280
+ repos: z.ZodDefault<z.ZodArray<z.ZodObject<{
281
+ repo: z.ZodDiscriminatedUnion<[z.ZodObject<{
282
+ kind: z.ZodLiteral<"self">;
283
+ }, z.core.$strip>, z.ZodObject<{
284
+ kind: z.ZodLiteral<"named">;
285
+ name: z.ZodString;
286
+ }, z.core.$strip>], "kind">;
287
+ path: z.ZodOptional<z.ZodString>;
288
+ ref: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
289
+ kind: z.ZodLiteral<"deployed">;
290
+ }, z.core.$strip>, z.ZodObject<{
291
+ kind: z.ZodLiteral<"head">;
292
+ }, z.core.$strip>, z.ZodObject<{
293
+ kind: z.ZodLiteral<"branch">;
294
+ name: z.ZodString;
295
+ }, z.core.$strip>, z.ZodObject<{
296
+ kind: z.ZodLiteral<"commit">;
297
+ sha: z.ZodString;
298
+ }, z.core.$strip>], "kind">>;
299
+ access: z.ZodEnum<{
300
+ read: "read";
301
+ change: "change";
302
+ }>;
303
+ title: z.ZodOptional<z.ZodString>;
304
+ depth: z.ZodEnum<{
305
+ shallow: "shallow";
306
+ full: "full";
307
+ }>;
308
+ submodules: z.ZodBoolean;
309
+ lfs: z.ZodBoolean;
310
+ }, z.core.$strip>>>;
311
+ egress: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<{
312
+ host: string;
313
+ secrets: {
314
+ block: string;
315
+ variable: string;
316
+ header: string;
317
+ format: "bearer" | "plain";
318
+ }[];
319
+ }, string>>, z.ZodObject<{
320
+ host: z.ZodString;
321
+ secrets: z.ZodArray<z.ZodObject<{
322
+ block: z.ZodString;
323
+ variable: z.ZodString;
324
+ header: z.ZodString;
325
+ format: z.ZodEnum<{
326
+ bearer: "bearer";
327
+ plain: "plain";
328
+ }>;
329
+ }, z.core.$strip>>;
330
+ }, z.core.$strip>]>>>;
331
+ idleSeconds: z.ZodOptional<z.ZodNumber>;
332
+ keepSeconds: z.ZodOptional<z.ZodNumber>;
333
+ harness: z.ZodOptional<z.ZodObject<{
334
+ type: z.ZodString;
335
+ provider: z.ZodString;
336
+ runtime: z.ZodString;
337
+ }, z.core.$strip>>;
338
+ recipeHash: z.ZodString;
339
+ }, z.core.$strip>;
132
340
  /**
133
341
  * A script that runs on an enrolled device (`operation name { … }`).
134
342
  *
@@ -475,8 +683,15 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
475
683
  }, z.core.$strip>, z.ZodObject<{
476
684
  type: z.ZodLiteral<"stream">;
477
685
  stream: z.ZodString;
478
- version: z.ZodString;
479
- filter: z.ZodString;
686
+ version: z.ZodOptional<z.ZodString>;
687
+ filter: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodType<StreamFilter, unknown, z.core.$ZodTypeInternals<StreamFilter, unknown>>]>>;
688
+ since: z.ZodOptional<z.ZodType<StreamTimeBound, unknown, z.core.$ZodTypeInternals<StreamTimeBound, unknown>>>;
689
+ until: z.ZodOptional<z.ZodType<StreamTimeBound, unknown, z.core.$ZodTypeInternals<StreamTimeBound, unknown>>>;
690
+ order: z.ZodOptional<z.ZodType<StreamOrder, unknown, z.core.$ZodTypeInternals<StreamOrder, unknown>>>;
691
+ limit: z.ZodOptional<z.ZodNumber>;
692
+ after: z.ZodOptional<z.ZodString>;
693
+ groupBy: z.ZodOptional<z.ZodType<StreamGroupBy, unknown, z.core.$ZodTypeInternals<StreamGroupBy, unknown>>>;
694
+ measure: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<StreamMeasure, unknown, z.core.$ZodTypeInternals<StreamMeasure, unknown>>>>;
480
695
  }, z.core.$strip>, z.ZodObject<{
481
696
  type: z.ZodLiteral<"switch">;
482
697
  cases: z.ZodArray<z.ZodString>;
@@ -568,6 +783,7 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
568
783
  name: z.ZodString;
569
784
  resourceType: z.ZodEnum<{
570
785
  form: "form";
786
+ stream: "stream";
571
787
  webhook: "webhook";
572
788
  schedule: "schedule";
573
789
  }>;
@@ -575,6 +791,7 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
575
791
  workflowId: z.ZodOptional<z.ZodUUID>;
576
792
  goalId: z.ZodOptional<z.ZodUUID>;
577
793
  enabled: z.ZodOptional<z.ZodBoolean>;
794
+ filter: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodType<StreamFilter, unknown, z.core.$ZodTypeInternals<StreamFilter, unknown>>]>>;
578
795
  }, z.core.$strip>>>;
579
796
  secretBlocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
580
797
  id: z.ZodUUID;
@@ -644,7 +861,59 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
644
861
  memoryMiB: z.ZodNumber;
645
862
  diskGiB: z.ZodOptional<z.ZodNumber>;
646
863
  }, z.core.$strip>;
647
- needsMountTooling: z.ZodBoolean;
864
+ repos: z.ZodDefault<z.ZodArray<z.ZodObject<{
865
+ repo: z.ZodDiscriminatedUnion<[z.ZodObject<{
866
+ kind: z.ZodLiteral<"self">;
867
+ }, z.core.$strip>, z.ZodObject<{
868
+ kind: z.ZodLiteral<"named">;
869
+ name: z.ZodString;
870
+ }, z.core.$strip>], "kind">;
871
+ path: z.ZodOptional<z.ZodString>;
872
+ ref: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
873
+ kind: z.ZodLiteral<"deployed">;
874
+ }, z.core.$strip>, z.ZodObject<{
875
+ kind: z.ZodLiteral<"head">;
876
+ }, z.core.$strip>, z.ZodObject<{
877
+ kind: z.ZodLiteral<"branch">;
878
+ name: z.ZodString;
879
+ }, z.core.$strip>, z.ZodObject<{
880
+ kind: z.ZodLiteral<"commit">;
881
+ sha: z.ZodString;
882
+ }, z.core.$strip>], "kind">>;
883
+ access: z.ZodEnum<{
884
+ read: "read";
885
+ change: "change";
886
+ }>;
887
+ title: z.ZodOptional<z.ZodString>;
888
+ depth: z.ZodEnum<{
889
+ shallow: "shallow";
890
+ full: "full";
891
+ }>;
892
+ submodules: z.ZodBoolean;
893
+ lfs: z.ZodBoolean;
894
+ }, z.core.$strip>>>;
895
+ egress: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<{
896
+ host: string;
897
+ secrets: {
898
+ block: string;
899
+ variable: string;
900
+ header: string;
901
+ format: "bearer" | "plain";
902
+ }[];
903
+ }, string>>, z.ZodObject<{
904
+ host: z.ZodString;
905
+ secrets: z.ZodArray<z.ZodObject<{
906
+ block: z.ZodString;
907
+ variable: z.ZodString;
908
+ header: z.ZodString;
909
+ format: z.ZodEnum<{
910
+ bearer: "bearer";
911
+ plain: "plain";
912
+ }>;
913
+ }, z.core.$strip>>;
914
+ }, z.core.$strip>]>>>;
915
+ idleSeconds: z.ZodOptional<z.ZodNumber>;
916
+ keepSeconds: z.ZodOptional<z.ZodNumber>;
648
917
  harness: z.ZodOptional<z.ZodObject<{
649
918
  type: z.ZodString;
650
919
  provider: z.ZodString;
@@ -918,6 +1187,7 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
918
1187
  label: z.ZodString;
919
1188
  description: z.ZodOptional<z.ZodString>;
920
1189
  enabled: z.ZodOptional<z.ZodBoolean>;
1190
+ retentionSeconds: z.ZodOptional<z.ZodNumber>;
921
1191
  workflowName: z.ZodString;
922
1192
  version: z.ZodString;
923
1193
  versions: z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -1233,6 +1503,9 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
1233
1503
  }, z.core.$strip>;
1234
1504
 
1235
1505
  type DeploymentDefinition = z.infer<typeof deploymentDefinitionSchema>;
1506
+ type DeploymentDefinitionComputerBlock = z.infer<typeof deploymentDefinitionComputerBlockSchema>;
1507
+ type DeploymentDefinitionComputerRepo = z.infer<typeof deploymentDefinitionComputerRepoSchema>;
1508
+ type DeploymentDefinitionComputerEgress = z.infer<typeof deploymentDefinitionComputerEgressSchema>;
1236
1509
  type DeploymentDefinitionOperationBlock = z.infer<typeof deploymentDefinitionOperationBlockSchema>;
1237
1510
  declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<{
1238
1511
  version?: number | undefined;
@@ -1468,8 +1741,15 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
1468
1741
  } | {
1469
1742
  type: "stream";
1470
1743
  stream: string;
1471
- version: string;
1472
- filter: string;
1744
+ version?: string | undefined;
1745
+ filter?: string | StreamFilter | undefined;
1746
+ since?: StreamTimeBound | undefined;
1747
+ until?: StreamTimeBound | undefined;
1748
+ order?: StreamOrder | undefined;
1749
+ limit?: number | undefined;
1750
+ after?: string | undefined;
1751
+ groupBy?: StreamGroupBy | undefined;
1752
+ measure?: Record<string, StreamMeasure> | undefined;
1473
1753
  } | {
1474
1754
  type: "switch";
1475
1755
  cases: string[];
@@ -1538,11 +1818,12 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
1538
1818
  triggers?: {
1539
1819
  id: string;
1540
1820
  name: string;
1541
- resourceType: "form" | "webhook" | "schedule";
1821
+ resourceType: "form" | "stream" | "webhook" | "schedule";
1542
1822
  resourceId: string;
1543
1823
  workflowId?: string | undefined;
1544
1824
  goalId?: string | undefined;
1545
1825
  enabled?: boolean | undefined;
1826
+ filter?: string | StreamFilter | undefined;
1546
1827
  }[] | undefined;
1547
1828
  secretBlocks?: {
1548
1829
  id: string;
@@ -1611,9 +1892,44 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
1611
1892
  memoryMiB: number;
1612
1893
  diskGiB?: number | undefined;
1613
1894
  };
1614
- needsMountTooling: boolean;
1895
+ repos: {
1896
+ repo: {
1897
+ kind: "self";
1898
+ } | {
1899
+ kind: "named";
1900
+ name: string;
1901
+ };
1902
+ access: "read" | "change";
1903
+ depth: "shallow" | "full";
1904
+ submodules: boolean;
1905
+ lfs: boolean;
1906
+ path?: string | undefined;
1907
+ ref?: {
1908
+ kind: "deployed";
1909
+ } | {
1910
+ kind: "head";
1911
+ } | {
1912
+ kind: "branch";
1913
+ name: string;
1914
+ } | {
1915
+ kind: "commit";
1916
+ sha: string;
1917
+ } | undefined;
1918
+ title?: string | undefined;
1919
+ }[];
1920
+ egress: {
1921
+ host: string;
1922
+ secrets: {
1923
+ block: string;
1924
+ variable: string;
1925
+ header: string;
1926
+ format: "bearer" | "plain";
1927
+ }[];
1928
+ }[];
1615
1929
  recipeHash: string;
1616
1930
  description?: string | undefined;
1931
+ idleSeconds?: number | undefined;
1932
+ keepSeconds?: number | undefined;
1617
1933
  harness?: {
1618
1934
  type: string;
1619
1935
  provider: string;
@@ -1844,6 +2160,7 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
1844
2160
  }>;
1845
2161
  description?: string | undefined;
1846
2162
  enabled?: boolean | undefined;
2163
+ retentionSeconds?: number | undefined;
1847
2164
  }[] | undefined;
1848
2165
  views?: {
1849
2166
  id: string;
@@ -2367,17 +2684,25 @@ interface AgentDecl {
2367
2684
  /** Other agent block names this agent may delegate to as subagents. */
2368
2685
  team?: string[];
2369
2686
  teamRanges?: SourceRange[];
2370
- /** Top-level shared `disk` block names mounted into this agent's sandbox. */
2687
+ /**
2688
+ * Top-level shared `disk` block names the agent's file tools reach: mounted
2689
+ * on its computer with `computer:`, and read and written with no machine
2690
+ * otherwise.
2691
+ */
2371
2692
  disks?: string[];
2372
2693
  disksRanges?: SourceRange[];
2373
2694
  /** Source range of the `disks:` list, including an empty `[]`. */
2374
2695
  disksRange?: SourceRange;
2375
- /** Optional sandbox resource and lifecycle overrides. Cannot be combined with `computer:`. */
2696
+ /**
2697
+ * Deprecated sandbox resource and lifecycle overrides; the validator warns
2698
+ * and names where each field goes on a `computer`. Cannot be combined with
2699
+ * `computer:`.
2700
+ */
2376
2701
  sandbox?: AgentSandboxDecl;
2377
2702
  /**
2378
2703
  * Bare name of one top-level `computer` block whose guest runs this agent's
2379
2704
  * workspace tools. Empty string means the key was present without a usable
2380
- * name. Cannot be combined with `sandbox:` or `disks:`.
2705
+ * name. Cannot be combined with `sandbox:`.
2381
2706
  */
2382
2707
  computer?: string;
2383
2708
  /** Source range of the computer name (diagnostics and go-to-definition). */
@@ -2703,6 +3028,73 @@ interface ComputerHarnessDecl {
2703
3028
  /** From the `harness` key through the closing brace. */
2704
3029
  range: SourceRange;
2705
3030
  }
3031
+ /** A value written in a `repos:` entry, with where it was written. */
3032
+ interface ComputerRepoValue<T> {
3033
+ value: T;
3034
+ range: SourceRange;
3035
+ }
3036
+ /**
3037
+ * One `repos:` entry. The short form (`"granby-site"` or `self`) sets only
3038
+ * `repo`. Values are kept as written; the validator checks them and
3039
+ * `@swirls/deploy` applies the defaults.
3040
+ */
3041
+ interface ComputerRepoDecl {
3042
+ /** `self` is the repository this file is in; any other value is a repository name. */
3043
+ repo: ComputerRepoValue<{
3044
+ kind: 'self';
3045
+ } | {
3046
+ kind: 'named';
3047
+ name: string;
3048
+ }>;
3049
+ /** Written as a bare string or `self`, not as an object. */
3050
+ short: boolean;
3051
+ path?: ComputerRepoValue<string>;
3052
+ /** `bare` is true for `deployed` and `head` written without quotes. */
3053
+ ref?: ComputerRepoValue<{
3054
+ text: string;
3055
+ bare: boolean;
3056
+ }>;
3057
+ access?: ComputerRepoValue<string>;
3058
+ title?: ComputerRepoValue<string>;
3059
+ depth?: ComputerRepoValue<string>;
3060
+ submodules?: ComputerRepoValue<boolean>;
3061
+ lfs?: ComputerRepoValue<boolean>;
3062
+ range: SourceRange;
3063
+ }
3064
+ /**
3065
+ * One secret an egress host may receive, as written:
3066
+ * `{ secret: block.VAR, header: "authorization", format: bearer }`.
3067
+ */
3068
+ interface ComputerEgressSecretDecl {
3069
+ /** The `secret` block's name. */
3070
+ block: string;
3071
+ /** The variable in that block. */
3072
+ variable: string;
3073
+ secretRange: SourceRange;
3074
+ /** The request header the gateway writes the value into, as written. */
3075
+ header?: string;
3076
+ headerRange?: SourceRange;
3077
+ /** `bearer` or `plain`, as written. Absent means `plain`. */
3078
+ format?: string;
3079
+ formatRange?: SourceRange;
3080
+ range: SourceRange;
3081
+ }
3082
+ /**
3083
+ * One `egress:` entry as written: a quoted host, or `{ host: "...", secrets: [...] }`
3084
+ * naming the secrets the host may receive.
3085
+ */
3086
+ interface ComputerEgressHost {
3087
+ host: string;
3088
+ range: SourceRange;
3089
+ /** Present only for the object form, even when its list is empty. */
3090
+ secrets?: ComputerEgressSecretDecl[];
3091
+ }
3092
+ /** `idle:` or `keep:` as written, with the seconds it means (`null` when it does not parse). */
3093
+ interface ComputerDurationDecl {
3094
+ literal: string;
3095
+ seconds: number | null;
3096
+ range: SourceRange;
3097
+ }
2706
3098
  interface ComputerDecl {
2707
3099
  name: string;
2708
3100
  label?: string;
@@ -2712,6 +3104,19 @@ interface ComputerDecl {
2712
3104
  disksRanges?: SourceRange[];
2713
3105
  resources?: ComputerResourcesDecl;
2714
3106
  harness?: ComputerHarnessDecl;
3107
+ /** Working copies of repositories each step starts with. */
3108
+ repos?: ComputerRepoDecl[];
3109
+ /** Range of the `repos` key, for hover. */
3110
+ reposKeyRange?: SourceRange;
3111
+ /** Hosts the machine may reach. Absent means none. */
3112
+ egress?: ComputerEgressHost[];
3113
+ egressKeyRange?: SourceRange;
3114
+ /** How long a machine may sit with no step running before it stops. */
3115
+ idle?: ComputerDurationDecl;
3116
+ idleKeyRange?: SourceRange;
3117
+ /** Keep one machine for the business, deleted after this long unused. */
3118
+ keep?: ComputerDurationDecl;
3119
+ keepKeyRange?: SourceRange;
2715
3120
  docComment?: string;
2716
3121
  range: SourceRange;
2717
3122
  }
@@ -3487,6 +3892,12 @@ interface StreamVersionDecl {
3487
3892
  /** @ts block that maps execution output into the schema shape (required; validated after parse). */
3488
3893
  prepare?: ConfigValue;
3489
3894
  }
3895
+ /** `retention:` as written, with the seconds it means (`null` when it does not parse). */
3896
+ interface StreamRetentionDecl {
3897
+ literal: string;
3898
+ seconds: number | null;
3899
+ range: SourceRange;
3900
+ }
3490
3901
  /** Top-level `stream` block: persisted output mapping for a graph (name matches DSL identifier). */
3491
3902
  interface StreamDecl {
3492
3903
  /** Set by deploy bundle / tooling; not produced by the parser. */
@@ -3497,6 +3908,8 @@ interface StreamDecl {
3497
3908
  /** Doc comment (block-comment style) immediately above this declaration; shown on hover. */
3498
3909
  docComment?: string;
3499
3910
  enabled?: boolean;
3911
+ /** `retention: "90d"`: how long each record is kept. Absent: the runtime's default (90 days). */
3912
+ retention?: StreamRetentionDecl;
3500
3913
  /**
3501
3914
  * Active writer version (`v1`, `v2`, …). Rows are written using `versions[this]`.
3502
3915
  * Must match a key in {@link StreamDecl.versions}.
@@ -3830,13 +4243,22 @@ interface WorkflowDecl {
3830
4243
  flowRange?: SourceRange;
3831
4244
  range: SourceRange;
3832
4245
  }
3833
- type TriggerType = 'form' | 'webhook' | 'schedule';
4246
+ type TriggerType = 'form' | 'webhook' | 'schedule' | 'stream';
3834
4247
  interface TriggerDecl {
3835
4248
  id?: string;
3836
4249
  name: string;
3837
4250
  resourceType: TriggerType;
3838
4251
  resourceName: string;
4252
+ /** Range of the source's name (`orders` in `stream:orders -> w`). */
4253
+ resourceNameRange?: SourceRange;
3839
4254
  workflowName: string;
4255
+ /** Range of the workflow name, when the target is a workflow. */
4256
+ workflowNameRange?: SourceRange;
4257
+ /**
4258
+ * Stream triggers only: which records fire the trigger, as a literal filter
4259
+ * object or an `@ts` block that returns one for each record.
4260
+ */
4261
+ filter?: ConfigValue;
3840
4262
  /** Explicit or resolved goal target (`form: req -> goal generate_quote` or bare goal name). */
3841
4263
  goalName?: string;
3842
4264
  goalNameRange?: SourceRange;
@@ -4190,19 +4612,6 @@ declare function computerHarnessBake(harness: {
4190
4612
  * onto the standard certificate paths.
4191
4613
  */
4192
4614
  declare const COMPUTER_BASELINE_PACKAGES: readonly ["bash", "cacert", "coreutils", "findutils", "gawk", "gnugrep", "gnused", "gnutar", "gzip"];
4193
- /**
4194
- * Added to the Flox recipe when `disks:` is non-empty or any agent in the
4195
- * deployment binds this computer. The recipe hash covers the package set, so
4196
- * the binding itself is not hashed.
4197
- */
4198
- declare const COMPUTER_MOUNT_PACKAGES: readonly ["fuse", "sudo"];
4199
- /**
4200
- * Vendored mount tooling (Archil client and sudoers). Bump to re-bake those
4201
- * snapshots. Hashed only when mount tooling is baked, so a shell-only
4202
- * computer with no disks and no agent binding does not re-bake.
4203
- * `COMPUTER_BASELINE_KIT` and `COMPUTER_GUEST_IMAGE` re-bake every computer.
4204
- */
4205
- declare const COMPUTER_MOUNT_KIT = "v3";
4206
4615
  /**
4207
4616
  * Bump when the baseline package set or the guest CA bundle changes so
4208
4617
  * existing snapshots re-bake. `v2` adds `cacert` and the TLS env.
@@ -4241,12 +4650,6 @@ type ComputerRecipeInput = {
4241
4650
  diskGiB?: number;
4242
4651
  };
4243
4652
  harness?: ComputerHarnessInput;
4244
- /**
4245
- * True when any agent in this deployment names the computer. A second agent
4246
- * does not change the baked packages, and neither does this flag when
4247
- * `disks:` is already non-empty.
4248
- */
4249
- boundByAgent?: boolean;
4250
4653
  };
4251
4654
  type CompiledComputerResources = {
4252
4655
  cpus: number;
@@ -4261,7 +4664,6 @@ type CompiledComputer = {
4261
4664
  software: Record<string, string>;
4262
4665
  disks: string[];
4263
4666
  resources: CompiledComputerResources;
4264
- needsMountTooling: boolean;
4265
4667
  /** Present only when the computer declares a `harness` block. */
4266
4668
  harness?: CompiledComputerHarness;
4267
4669
  recipeHash: string;
@@ -4278,7 +4680,7 @@ declare function compileComputerRecipe(input: ComputerRecipeInput): CompiledComp
4278
4680
  * harness runtime. A pin replaces only the version; a runtime package keeps
4279
4681
  * its file-conflict priority.
4280
4682
  */
4281
- declare function recipePackages(software: Record<string, string>, needsMountTooling: boolean, harness?: Pick<CompiledComputerHarness, 'provider'>): PackagePin[];
4683
+ declare function recipePackages(software: Record<string, string>, harness?: Pick<CompiledComputerHarness, 'provider'>): PackagePin[];
4282
4684
  /**
4283
4685
  * Org-scoped Daytona snapshot name. Includes the project so two projects
4284
4686
  * cannot collide, and the recipe hash so a superseded snapshot can coexist
@@ -4302,6 +4704,24 @@ declare function daytonaSnapshotResources(resources: CompiledComputerResources):
4302
4704
  disk?: number;
4303
4705
  };
4304
4706
 
4707
+ /**
4708
+ * The parts of a `computer` block that shape a machine at run time but not
4709
+ * its software: the repositories it checks out, the hosts it may reach, and
4710
+ * how long it lives. None of them is part of the recipe hash, so changing one
4711
+ * never rebuilds the computer's software.
4712
+ */
4713
+
4714
+ /** One `repos:` entry with the language's defaults applied. */
4715
+ declare function lowerComputerRepo(entry: ComputerRepoDecl): DeploymentDefinitionComputerRepo;
4716
+ /**
4717
+ * One egress entry as the runtime reads it: the host, and each secret requests
4718
+ * to it may carry with the header it goes in (lower case) and its format
4719
+ * (`plain` when not written).
4720
+ */
4721
+ declare function lowerComputerEgress(entry: ComputerEgressHost): DeploymentDefinitionComputerEgress;
4722
+ /** The run-time fields of a computer block in the deployment definition. */
4723
+ declare function lowerComputerRuntime(computer: ComputerDecl): Pick<DeploymentDefinitionComputerBlock, 'repos' | 'egress' | 'idleSeconds' | 'keepSeconds'>;
4724
+
4305
4725
  /**
4306
4726
  * SHA-256 hex digest of the stripped Swirls AST (post-`stripEditorMetadata`),
4307
4727
  * before UUID assignment in `buildDeploymentDefinitionPayload`.
@@ -4899,8 +5319,15 @@ declare const workflowNodeConfigSchema: z.ZodIntersection<z.ZodDiscriminatedUnio
4899
5319
  }, z.core.$strip>, z.ZodObject<{
4900
5320
  type: z.ZodLiteral<"stream">;
4901
5321
  stream: z.ZodString;
4902
- version: z.ZodString;
4903
- filter: z.ZodString;
5322
+ version: z.ZodOptional<z.ZodString>;
5323
+ filter: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodType<StreamFilter, unknown, z.core.$ZodTypeInternals<StreamFilter, unknown>>]>>;
5324
+ since: z.ZodOptional<z.ZodType<StreamTimeBound, unknown, z.core.$ZodTypeInternals<StreamTimeBound, unknown>>>;
5325
+ until: z.ZodOptional<z.ZodType<StreamTimeBound, unknown, z.core.$ZodTypeInternals<StreamTimeBound, unknown>>>;
5326
+ order: z.ZodOptional<z.ZodType<StreamOrder, unknown, z.core.$ZodTypeInternals<StreamOrder, unknown>>>;
5327
+ limit: z.ZodOptional<z.ZodNumber>;
5328
+ after: z.ZodOptional<z.ZodString>;
5329
+ groupBy: z.ZodOptional<z.ZodType<StreamGroupBy, unknown, z.core.$ZodTypeInternals<StreamGroupBy, unknown>>>;
5330
+ measure: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<StreamMeasure, unknown, z.core.$ZodTypeInternals<StreamMeasure, unknown>>>>;
4904
5331
  }, z.core.$strip>, z.ZodObject<{
4905
5332
  type: z.ZodLiteral<"switch">;
4906
5333
  cases: z.ZodArray<z.ZodString>;
@@ -5077,4 +5504,4 @@ declare function buildDeploymentSourceManifest({ definition, ast, files, }: {
5077
5504
  */
5078
5505
  declare function stripEditorMetadata(value: unknown): unknown;
5079
5506
 
5080
- export { AGENTS_SKILLS_DIR, type BuildDefinitionOptions, COMPUTER_BASELINE_KIT, COMPUTER_BASELINE_PACKAGES, COMPUTER_HARNESS_RESOURCE_DEFAULTS, COMPUTER_HARNESS_RUNTIME, COMPUTER_MOUNT_KIT, COMPUTER_MOUNT_PACKAGES, COMPUTER_RESOURCE_DEFAULTS, type CompiledComputer, type CompiledComputerHarness, type ComputerHarnessBake, type ComputerHarnessInput, type ComputerRecipeInput, type DeployBundleDirent, type DeployBundleFs, type DeploymentDefinition, type DeploymentSkillFilePayload, type DeploymentSkillFilesBundle, type DeploymentSourceFileContent, type DeploymentSourceManifest, type DeploymentSourceManifestV2, type DeploymentSourceResourceKind, type DeploymentSourceResourceKindV2, type Diagnostic, HARNESS_DEBIAN_STAGE_DIR, HARNESS_PROVIDERS, HARNESS_ROOT_DIR, type HarnessCatalog, type HarnessDebianPackage, type HarnessProvider, type HarnessRuntimePackage, type LanguageHost, type LowerDiagnostic, type LowerMountsOptions, type LowerMountsResult, type LowerOptions, type LowerResult, type LowerStage, MAX_SKILL_FILES, MAX_SKILL_FILE_BYTES, MAX_SKILL_TREE_BYTES, MOUNT_SKILLS_ROOT, type MergeProjectOptions, type MountDiagnostic, type MountFingerprint, type MountSite, type MountSkillFiles, type MountSourceFile, type OpenUiSupport, type ProviderCatalog, SKILL_MD_FILENAME, type SkillBlockRef, type SkillBundle, type SkillClassificationResult, type SkillDeployFs, type SkillDeployStat, type SkillFileEntry, type SkillMdFrontmatter, type SourceRange, type SwirlsFile, type SwirlsMount, type SwirlsMountFiles, type SwirlsSources, buildConfigValueKindsFromNodeDecl, buildDeploymentDefinitionPayload, buildDeploymentSourceManifest, buildWorkflowNodeConfigFromNodeDecl, canonicalizeForStableJson, classifySkillBundle, collectDeploymentSkillFiles, collectDeploymentSourceFiles, collectReferencedSkillBlocksFromAst, collectSwirlsFiles, combineDeploymentAndSourceFingerprints, compileComputerRecipe, compileGoalBlock, compileOperationBlock, computeDefinitionHash, computeDeploymentDefinitionFingerprint, computeDeploymentSourceFingerprint, computeGoalContractHash, computeSkillChecksum, computerHarnessBake, computerSnapshotName, createMemoryRepoFs, createNodeDeployBundleFs, daytonaSnapshotResources, deployBundleToSkillDeployFs, deployBundleToWorkspaceFileSystem, deploymentSourceManifestV2Schema, flattenArchivePathMap, flattenInlineSubgraphsInGraph, floxManifestToml, harnessPrepScript, harnessRuntimePackages, isHarnessProvider, isKnownScriptExtension, isScriptsOrBinDirectory, lowerSwirlsMounts, lowerSwirlsSources, mergeProjectSwirlsFiles, normalizeDeploymentSourcePath, operationScriptSha256, parseDeploymentDefinition, parseDeploymentSourceManifestV2, parseSkillMdFrontmatter, platformComputerSnapshotName, recipePackages, resolveSkillTree, sha256Hex, sliceRepoFilesToRoot, stripEditorMetadata, swirlsHost, uuidv7, validateDeploymentSourceInput, virtualRepoCwd };
5507
+ export { AGENTS_SKILLS_DIR, type BuildDefinitionOptions, COMPUTER_BASELINE_KIT, COMPUTER_BASELINE_PACKAGES, COMPUTER_HARNESS_RESOURCE_DEFAULTS, COMPUTER_HARNESS_RUNTIME, COMPUTER_RESOURCE_DEFAULTS, type CompiledComputer, type CompiledComputerHarness, type ComputerHarnessBake, type ComputerHarnessInput, type ComputerRecipeInput, type DeployBundleDirent, type DeployBundleFs, type DeploymentDefinition, type DeploymentSkillFilePayload, type DeploymentSkillFilesBundle, type DeploymentSourceFileContent, type DeploymentSourceManifest, type DeploymentSourceManifestV2, type DeploymentSourceResourceKind, type DeploymentSourceResourceKindV2, type Diagnostic, HARNESS_DEBIAN_STAGE_DIR, HARNESS_PROVIDERS, HARNESS_ROOT_DIR, type HarnessCatalog, type HarnessDebianPackage, type HarnessProvider, type HarnessRuntimePackage, type LanguageHost, type LowerDiagnostic, type LowerMountsOptions, type LowerMountsResult, type LowerOptions, type LowerResult, type LowerStage, MAX_SKILL_FILES, MAX_SKILL_FILE_BYTES, MAX_SKILL_TREE_BYTES, MOUNT_SKILLS_ROOT, type MergeProjectOptions, type MountDiagnostic, type MountFingerprint, type MountSite, type MountSkillFiles, type MountSourceFile, type OpenUiSupport, type ProviderCatalog, SKILL_MD_FILENAME, type SkillBlockRef, type SkillBundle, type SkillClassificationResult, type SkillDeployFs, type SkillDeployStat, type SkillFileEntry, type SkillMdFrontmatter, type SourceRange, type SwirlsFile, type SwirlsMount, type SwirlsMountFiles, type SwirlsSources, buildConfigValueKindsFromNodeDecl, buildDeploymentDefinitionPayload, buildDeploymentSourceManifest, buildWorkflowNodeConfigFromNodeDecl, canonicalizeForStableJson, classifySkillBundle, collectDeploymentSkillFiles, collectDeploymentSourceFiles, collectReferencedSkillBlocksFromAst, collectSwirlsFiles, combineDeploymentAndSourceFingerprints, compileComputerRecipe, compileGoalBlock, compileOperationBlock, computeDefinitionHash, computeDeploymentDefinitionFingerprint, computeDeploymentSourceFingerprint, computeGoalContractHash, computeSkillChecksum, computerHarnessBake, computerSnapshotName, createMemoryRepoFs, createNodeDeployBundleFs, daytonaSnapshotResources, deployBundleToSkillDeployFs, deployBundleToWorkspaceFileSystem, deploymentSourceManifestV2Schema, flattenArchivePathMap, flattenInlineSubgraphsInGraph, floxManifestToml, harnessPrepScript, harnessRuntimePackages, isHarnessProvider, isKnownScriptExtension, isScriptsOrBinDirectory, lowerComputerEgress, lowerComputerRepo, lowerComputerRuntime, lowerSwirlsMounts, lowerSwirlsSources, mergeProjectSwirlsFiles, normalizeDeploymentSourcePath, operationScriptSha256, parseDeploymentDefinition, parseDeploymentSourceManifestV2, parseSkillMdFrontmatter, platformComputerSnapshotName, recipePackages, resolveSkillTree, sha256Hex, sliceRepoFilesToRoot, stripEditorMetadata, swirlsHost, uuidv7, validateDeploymentSourceInput, virtualRepoCwd };