@swirls/deploy 0.0.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -2
- package/dist/index.d.ts +558 -40
- package/dist/index.js +3791 -1601
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,119 @@ import { JSONSchema7 } from 'json-schema';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import fs from 'node:fs';
|
|
5
5
|
|
|
6
|
+
declare const goalOnViolationSchema: z.ZodEnum<{
|
|
7
|
+
block: "block";
|
|
8
|
+
review: "review";
|
|
9
|
+
}>;
|
|
10
|
+
type GoalOnViolation = z.infer<typeof goalOnViolationSchema>;
|
|
11
|
+
declare const goalBuiltInOptimizeMetricSchema: z.ZodEnum<{
|
|
12
|
+
duration: "duration";
|
|
13
|
+
cost: "cost";
|
|
14
|
+
interventions: "interventions";
|
|
15
|
+
tokens: "tokens";
|
|
16
|
+
}>;
|
|
17
|
+
type GoalBuiltInOptimizeMetric = z.infer<typeof goalBuiltInOptimizeMetricSchema>;
|
|
18
|
+
declare const goalOptimizeDirectionSchema: z.ZodEnum<{
|
|
19
|
+
minimize: "minimize";
|
|
20
|
+
maximize: "maximize";
|
|
21
|
+
}>;
|
|
22
|
+
type GoalOptimizeDirection = z.infer<typeof goalOptimizeDirectionSchema>;
|
|
23
|
+
/** One named completion check inside `goal.ensure`. */
|
|
24
|
+
declare const goalCheckSchema: z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
query: z.ZodOptional<z.ZodString>;
|
|
27
|
+
checkCode: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
type GoalCheck = z.infer<typeof goalCheckSchema>;
|
|
30
|
+
/** One named hard guardrail inside `goal.invariant`. */
|
|
31
|
+
declare const goalInvariantSchema: z.ZodObject<{
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
before: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
query: z.ZodOptional<z.ZodString>;
|
|
35
|
+
onViolation: z.ZodOptional<z.ZodEnum<{
|
|
36
|
+
block: "block";
|
|
37
|
+
review: "review";
|
|
38
|
+
}>>;
|
|
39
|
+
checkCode: z.ZodString;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
type GoalInvariant = z.infer<typeof goalInvariantSchema>;
|
|
42
|
+
/** Execution budget envelope for a goal run. */
|
|
43
|
+
declare const goalBudgetSchema: z.ZodObject<{
|
|
44
|
+
cost: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
tokens: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
durationSeconds: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
type GoalBudget = z.infer<typeof goalBudgetSchema>;
|
|
50
|
+
/**
|
|
51
|
+
* A deployed operational goal contract (`goal <name> { … }`).
|
|
52
|
+
*
|
|
53
|
+
* `contractHash` is the SHA-256 hex digest of the canonical contract surface
|
|
54
|
+
* (input/output schemas, invariants, ensure checks, and budget), allowing
|
|
55
|
+
* runtimes and `deploy_protect` to detect any relaxation or alteration of
|
|
56
|
+
* success criteria across deployments.
|
|
57
|
+
*/
|
|
58
|
+
declare const deploymentDefinitionGoalSchema: z.ZodObject<{
|
|
59
|
+
id: z.ZodUUID;
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
label: z.ZodString;
|
|
62
|
+
description: z.ZodOptional<z.ZodString>;
|
|
63
|
+
objective: z.ZodOptional<z.ZodString>;
|
|
64
|
+
inputSchema: z.ZodOptional<z.ZodType<json_schema.JSONSchema7, json_schema.JSONSchema7, z.core.$ZodTypeInternals<json_schema.JSONSchema7, json_schema.JSONSchema7>>>;
|
|
65
|
+
outputSchema: z.ZodOptional<z.ZodType<json_schema.JSONSchema7, json_schema.JSONSchema7, z.core.$ZodTypeInternals<json_schema.JSONSchema7, json_schema.JSONSchema7>>>;
|
|
66
|
+
executorKind: z.ZodEnum<{
|
|
67
|
+
workflow: "workflow";
|
|
68
|
+
agent: "agent";
|
|
69
|
+
}>;
|
|
70
|
+
executorName: z.ZodString;
|
|
71
|
+
executorId: z.ZodUUID;
|
|
72
|
+
invariants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
before: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
query: z.ZodOptional<z.ZodString>;
|
|
76
|
+
onViolation: z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
block: "block";
|
|
78
|
+
review: "review";
|
|
79
|
+
}>>;
|
|
80
|
+
checkCode: z.ZodString;
|
|
81
|
+
}, z.core.$strip>>>;
|
|
82
|
+
ensure: z.ZodArray<z.ZodObject<{
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
query: z.ZodOptional<z.ZodString>;
|
|
85
|
+
checkCode: z.ZodString;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
optimize: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
88
|
+
direction: z.ZodEnum<{
|
|
89
|
+
minimize: "minimize";
|
|
90
|
+
maximize: "maximize";
|
|
91
|
+
}>;
|
|
92
|
+
metric: z.ZodEnum<{
|
|
93
|
+
duration: "duration";
|
|
94
|
+
cost: "cost";
|
|
95
|
+
interventions: "interventions";
|
|
96
|
+
tokens: "tokens";
|
|
97
|
+
}>;
|
|
98
|
+
name: z.ZodOptional<z.ZodNever>;
|
|
99
|
+
scoreCode: z.ZodOptional<z.ZodNever>;
|
|
100
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
101
|
+
direction: z.ZodEnum<{
|
|
102
|
+
minimize: "minimize";
|
|
103
|
+
maximize: "maximize";
|
|
104
|
+
}>;
|
|
105
|
+
name: z.ZodString;
|
|
106
|
+
scoreCode: z.ZodString;
|
|
107
|
+
metric: z.ZodOptional<z.ZodNever>;
|
|
108
|
+
}, z.core.$strip>]>>>;
|
|
109
|
+
budget: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
cost: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
tokens: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
durationSeconds: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
contractHash: z.ZodString;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
type DeploymentDefinitionGoal = z.infer<typeof deploymentDefinitionGoalSchema>;
|
|
118
|
+
|
|
6
119
|
/**
|
|
7
120
|
* Where a channel can be bound. Part of the definition, so the language reads
|
|
8
121
|
* its platform list from here instead of keeping a copy.
|
|
@@ -440,6 +553,7 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
|
|
|
440
553
|
label: z.ZodOptional<z.ZodString>;
|
|
441
554
|
}, z.core.$strip>>;
|
|
442
555
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
556
|
+
achieves: z.ZodOptional<z.ZodString>;
|
|
443
557
|
}, z.core.$strip>>>;
|
|
444
558
|
schemas: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
445
559
|
id: z.ZodUUID;
|
|
@@ -457,7 +571,8 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
|
|
|
457
571
|
schedule: "schedule";
|
|
458
572
|
}>;
|
|
459
573
|
resourceId: z.ZodUUID;
|
|
460
|
-
workflowId: z.ZodUUID
|
|
574
|
+
workflowId: z.ZodOptional<z.ZodUUID>;
|
|
575
|
+
goalId: z.ZodOptional<z.ZodUUID>;
|
|
461
576
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
462
577
|
}, z.core.$strip>>>;
|
|
463
578
|
secretBlocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -687,6 +802,7 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
|
|
|
687
802
|
label: z.ZodString;
|
|
688
803
|
message: z.ZodString;
|
|
689
804
|
}, z.core.$strip>>>;
|
|
805
|
+
achieves: z.ZodOptional<z.ZodString>;
|
|
690
806
|
}, z.core.$strip>>>;
|
|
691
807
|
channelBlocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
692
808
|
id: z.ZodUUID;
|
|
@@ -1011,6 +1127,7 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
|
|
|
1011
1127
|
role: z.ZodString;
|
|
1012
1128
|
agent: z.ZodString;
|
|
1013
1129
|
workflow: z.ZodOptional<z.ZodNever>;
|
|
1130
|
+
goal: z.ZodOptional<z.ZodNever>;
|
|
1014
1131
|
workflows: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1015
1132
|
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1016
1133
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1021,6 +1138,18 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
|
|
|
1021
1138
|
role: z.ZodString;
|
|
1022
1139
|
workflow: z.ZodString;
|
|
1023
1140
|
agent: z.ZodOptional<z.ZodNever>;
|
|
1141
|
+
goal: z.ZodOptional<z.ZodNever>;
|
|
1142
|
+
workflows: z.ZodOptional<z.ZodNever>;
|
|
1143
|
+
tools: z.ZodOptional<z.ZodNever>;
|
|
1144
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1145
|
+
effect: z.ZodEnum<{
|
|
1146
|
+
allow: "allow";
|
|
1147
|
+
deny: "deny";
|
|
1148
|
+
}>;
|
|
1149
|
+
role: z.ZodString;
|
|
1150
|
+
goal: z.ZodString;
|
|
1151
|
+
agent: z.ZodOptional<z.ZodNever>;
|
|
1152
|
+
workflow: z.ZodOptional<z.ZodNever>;
|
|
1024
1153
|
workflows: z.ZodOptional<z.ZodNever>;
|
|
1025
1154
|
tools: z.ZodOptional<z.ZodNever>;
|
|
1026
1155
|
}, z.core.$strip>]>>;
|
|
@@ -1033,6 +1162,65 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
|
|
|
1033
1162
|
}, z.core.$strip>], "mode">;
|
|
1034
1163
|
}, z.core.$strip>>;
|
|
1035
1164
|
}, z.core.$strip>>>;
|
|
1165
|
+
goals: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1166
|
+
id: z.ZodUUID;
|
|
1167
|
+
name: z.ZodString;
|
|
1168
|
+
label: z.ZodString;
|
|
1169
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1170
|
+
objective: z.ZodOptional<z.ZodString>;
|
|
1171
|
+
inputSchema: z.ZodOptional<z.ZodType<json_schema.JSONSchema7, json_schema.JSONSchema7, z.core.$ZodTypeInternals<json_schema.JSONSchema7, json_schema.JSONSchema7>>>;
|
|
1172
|
+
outputSchema: z.ZodOptional<z.ZodType<json_schema.JSONSchema7, json_schema.JSONSchema7, z.core.$ZodTypeInternals<json_schema.JSONSchema7, json_schema.JSONSchema7>>>;
|
|
1173
|
+
executorKind: z.ZodEnum<{
|
|
1174
|
+
workflow: "workflow";
|
|
1175
|
+
agent: "agent";
|
|
1176
|
+
}>;
|
|
1177
|
+
executorName: z.ZodString;
|
|
1178
|
+
executorId: z.ZodUUID;
|
|
1179
|
+
invariants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1180
|
+
name: z.ZodString;
|
|
1181
|
+
before: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1182
|
+
query: z.ZodOptional<z.ZodString>;
|
|
1183
|
+
onViolation: z.ZodOptional<z.ZodEnum<{
|
|
1184
|
+
block: "block";
|
|
1185
|
+
review: "review";
|
|
1186
|
+
}>>;
|
|
1187
|
+
checkCode: z.ZodString;
|
|
1188
|
+
}, z.core.$strip>>>;
|
|
1189
|
+
ensure: z.ZodArray<z.ZodObject<{
|
|
1190
|
+
name: z.ZodString;
|
|
1191
|
+
query: z.ZodOptional<z.ZodString>;
|
|
1192
|
+
checkCode: z.ZodString;
|
|
1193
|
+
}, z.core.$strip>>;
|
|
1194
|
+
optimize: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1195
|
+
direction: z.ZodEnum<{
|
|
1196
|
+
minimize: "minimize";
|
|
1197
|
+
maximize: "maximize";
|
|
1198
|
+
}>;
|
|
1199
|
+
metric: z.ZodEnum<{
|
|
1200
|
+
duration: "duration";
|
|
1201
|
+
cost: "cost";
|
|
1202
|
+
interventions: "interventions";
|
|
1203
|
+
tokens: "tokens";
|
|
1204
|
+
}>;
|
|
1205
|
+
name: z.ZodOptional<z.ZodNever>;
|
|
1206
|
+
scoreCode: z.ZodOptional<z.ZodNever>;
|
|
1207
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1208
|
+
direction: z.ZodEnum<{
|
|
1209
|
+
minimize: "minimize";
|
|
1210
|
+
maximize: "maximize";
|
|
1211
|
+
}>;
|
|
1212
|
+
name: z.ZodString;
|
|
1213
|
+
scoreCode: z.ZodString;
|
|
1214
|
+
metric: z.ZodOptional<z.ZodNever>;
|
|
1215
|
+
}, z.core.$strip>]>>>;
|
|
1216
|
+
budget: z.ZodOptional<z.ZodObject<{
|
|
1217
|
+
cost: z.ZodOptional<z.ZodNumber>;
|
|
1218
|
+
tokens: z.ZodOptional<z.ZodNumber>;
|
|
1219
|
+
durationSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1220
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
1221
|
+
}, z.core.$strip>>;
|
|
1222
|
+
contractHash: z.ZodString;
|
|
1223
|
+
}, z.core.$strip>>>;
|
|
1036
1224
|
mockBlocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1037
1225
|
id: z.ZodUUID;
|
|
1038
1226
|
name: z.ZodString;
|
|
@@ -1042,6 +1230,7 @@ declare const deploymentDefinitionSchema: z.ZodObject<{
|
|
|
1042
1230
|
name: z.ZodString;
|
|
1043
1231
|
}, z.core.$loose>>>;
|
|
1044
1232
|
}, z.core.$strip>;
|
|
1233
|
+
|
|
1045
1234
|
type DeploymentDefinition = z.infer<typeof deploymentDefinitionSchema>;
|
|
1046
1235
|
type DeploymentDefinitionOperationBlock = z.infer<typeof deploymentDefinitionOperationBlockSchema>;
|
|
1047
1236
|
declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<{
|
|
@@ -1336,6 +1525,7 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
|
|
|
1336
1525
|
concurrency?: number | undefined;
|
|
1337
1526
|
executionTokenTtlSeconds?: number | undefined;
|
|
1338
1527
|
synthetic?: boolean | undefined;
|
|
1528
|
+
achieves?: string | undefined;
|
|
1339
1529
|
}[] | undefined;
|
|
1340
1530
|
schemas?: {
|
|
1341
1531
|
id: string;
|
|
@@ -1349,7 +1539,8 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
|
|
|
1349
1539
|
name: string;
|
|
1350
1540
|
resourceType: "form" | "webhook" | "schedule";
|
|
1351
1541
|
resourceId: string;
|
|
1352
|
-
workflowId
|
|
1542
|
+
workflowId?: string | undefined;
|
|
1543
|
+
goalId?: string | undefined;
|
|
1353
1544
|
enabled?: boolean | undefined;
|
|
1354
1545
|
}[] | undefined;
|
|
1355
1546
|
secretBlocks?: {
|
|
@@ -1556,6 +1747,7 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
|
|
|
1556
1747
|
label: string;
|
|
1557
1748
|
message: string;
|
|
1558
1749
|
}[] | undefined;
|
|
1750
|
+
achieves?: string | undefined;
|
|
1559
1751
|
}[] | undefined;
|
|
1560
1752
|
channelBlocks?: {
|
|
1561
1753
|
id: string;
|
|
@@ -1804,6 +1996,7 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
|
|
|
1804
1996
|
role: string;
|
|
1805
1997
|
agent: string;
|
|
1806
1998
|
workflow?: undefined;
|
|
1999
|
+
goal?: undefined;
|
|
1807
2000
|
workflows?: string[] | undefined;
|
|
1808
2001
|
tools?: string[] | undefined;
|
|
1809
2002
|
} | {
|
|
@@ -1811,6 +2004,15 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
|
|
|
1811
2004
|
role: string;
|
|
1812
2005
|
workflow: string;
|
|
1813
2006
|
agent?: undefined;
|
|
2007
|
+
goal?: undefined;
|
|
2008
|
+
workflows?: undefined;
|
|
2009
|
+
tools?: undefined;
|
|
2010
|
+
} | {
|
|
2011
|
+
effect: "allow" | "deny";
|
|
2012
|
+
role: string;
|
|
2013
|
+
goal: string;
|
|
2014
|
+
agent?: undefined;
|
|
2015
|
+
workflow?: undefined;
|
|
1814
2016
|
workflows?: undefined;
|
|
1815
2017
|
tools?: undefined;
|
|
1816
2018
|
})[];
|
|
@@ -1823,6 +2025,48 @@ declare function parseDeploymentDefinition(data: unknown): z.ZodSafeParseResult<
|
|
|
1823
2025
|
};
|
|
1824
2026
|
} | undefined;
|
|
1825
2027
|
}[] | undefined;
|
|
2028
|
+
goals?: {
|
|
2029
|
+
id: string;
|
|
2030
|
+
name: string;
|
|
2031
|
+
label: string;
|
|
2032
|
+
executorKind: "workflow" | "agent";
|
|
2033
|
+
executorName: string;
|
|
2034
|
+
executorId: string;
|
|
2035
|
+
ensure: {
|
|
2036
|
+
name: string;
|
|
2037
|
+
checkCode: string;
|
|
2038
|
+
query?: string | undefined;
|
|
2039
|
+
}[];
|
|
2040
|
+
contractHash: string;
|
|
2041
|
+
description?: string | undefined;
|
|
2042
|
+
objective?: string | undefined;
|
|
2043
|
+
inputSchema?: json_schema.JSONSchema7 | undefined;
|
|
2044
|
+
outputSchema?: json_schema.JSONSchema7 | undefined;
|
|
2045
|
+
invariants?: {
|
|
2046
|
+
name: string;
|
|
2047
|
+
checkCode: string;
|
|
2048
|
+
before?: string[] | undefined;
|
|
2049
|
+
query?: string | undefined;
|
|
2050
|
+
onViolation?: "block" | "review" | undefined;
|
|
2051
|
+
}[] | undefined;
|
|
2052
|
+
optimize?: ({
|
|
2053
|
+
direction: "minimize" | "maximize";
|
|
2054
|
+
metric: "duration" | "cost" | "interventions" | "tokens";
|
|
2055
|
+
name?: undefined;
|
|
2056
|
+
scoreCode?: undefined;
|
|
2057
|
+
} | {
|
|
2058
|
+
direction: "minimize" | "maximize";
|
|
2059
|
+
name: string;
|
|
2060
|
+
scoreCode: string;
|
|
2061
|
+
metric?: undefined;
|
|
2062
|
+
})[] | undefined;
|
|
2063
|
+
budget?: {
|
|
2064
|
+
cost?: number | undefined;
|
|
2065
|
+
tokens?: number | undefined;
|
|
2066
|
+
durationSeconds?: number | undefined;
|
|
2067
|
+
attempts?: number | undefined;
|
|
2068
|
+
} | undefined;
|
|
2069
|
+
}[] | undefined;
|
|
1826
2070
|
mockBlocks?: {
|
|
1827
2071
|
[x: string]: unknown;
|
|
1828
2072
|
id: string;
|
|
@@ -1860,8 +2104,9 @@ declare const deploymentSourceResourceKindSchema: z.ZodEnum<{
|
|
|
1860
2104
|
schedule: "schedule";
|
|
1861
2105
|
mcp: "mcp";
|
|
1862
2106
|
channel: "channel";
|
|
1863
|
-
|
|
2107
|
+
goal: "goal";
|
|
1864
2108
|
trigger: "trigger";
|
|
2109
|
+
view: "view";
|
|
1865
2110
|
secret: "secret";
|
|
1866
2111
|
migration: "migration";
|
|
1867
2112
|
skill: "skill";
|
|
@@ -1895,8 +2140,9 @@ declare const deploymentSourceManifestSchema: z.ZodObject<{
|
|
|
1895
2140
|
schedule: "schedule";
|
|
1896
2141
|
mcp: "mcp";
|
|
1897
2142
|
channel: "channel";
|
|
1898
|
-
|
|
2143
|
+
goal: "goal";
|
|
1899
2144
|
trigger: "trigger";
|
|
2145
|
+
view: "view";
|
|
1900
2146
|
secret: "secret";
|
|
1901
2147
|
migration: "migration";
|
|
1902
2148
|
skill: "skill";
|
|
@@ -2141,6 +2387,9 @@ interface AgentDecl {
|
|
|
2141
2387
|
context?: AgentContextDecl;
|
|
2142
2388
|
/** Optional starter prompts shown in Cloud agent chat zero state. */
|
|
2143
2389
|
suggestions?: AgentSuggestionDecl[];
|
|
2390
|
+
/** Optional `goal` block name this agent conforms to (`achieves: <goal>`). */
|
|
2391
|
+
achieves?: string;
|
|
2392
|
+
achievesRange?: SourceRange;
|
|
2144
2393
|
profiles: AgentProfileDecl[];
|
|
2145
2394
|
docComment?: string;
|
|
2146
2395
|
range: SourceRange;
|
|
@@ -2630,6 +2879,93 @@ interface DiskDecl {
|
|
|
2630
2879
|
range: SourceRange;
|
|
2631
2880
|
}
|
|
2632
2881
|
|
|
2882
|
+
/**
|
|
2883
|
+
* AST types for top-level `goal <name> { … }` blocks.
|
|
2884
|
+
*/
|
|
2885
|
+
|
|
2886
|
+
/** One named completion check inside `goal.ensure { … }`. */
|
|
2887
|
+
interface GoalCheckDecl {
|
|
2888
|
+
name: string;
|
|
2889
|
+
nameRange: SourceRange;
|
|
2890
|
+
/** Optional `query` block reference whose rows are bound to `context.rows`. */
|
|
2891
|
+
query?: string;
|
|
2892
|
+
queryRange?: SourceRange;
|
|
2893
|
+
/** `@ts { … }` or `@ts "…"` predicate returning `boolean | { pass, reason?, evidence? }`. */
|
|
2894
|
+
check?: ConfigValue;
|
|
2895
|
+
range: SourceRange;
|
|
2896
|
+
}
|
|
2897
|
+
/** One named hard guardrail inside `goal.invariant { … }`. */
|
|
2898
|
+
interface GoalInvariantDecl {
|
|
2899
|
+
name: string;
|
|
2900
|
+
nameRange: SourceRange;
|
|
2901
|
+
/** Actions or tools guarded synchronously before side effects commit. */
|
|
2902
|
+
before?: string[];
|
|
2903
|
+
beforeRanges?: SourceRange[];
|
|
2904
|
+
/** Optional `query` block reference whose rows are bound to `context.rows`. */
|
|
2905
|
+
query?: string;
|
|
2906
|
+
queryRange?: SourceRange;
|
|
2907
|
+
/** Handling when violated synchronously (`block` | `review`). */
|
|
2908
|
+
onViolation?: GoalOnViolation;
|
|
2909
|
+
onViolationRange?: SourceRange;
|
|
2910
|
+
/** `@ts { … }` or `@ts "…"` predicate returning `boolean | { pass, reason?, evidence? }`. */
|
|
2911
|
+
check?: ConfigValue;
|
|
2912
|
+
range: SourceRange;
|
|
2913
|
+
}
|
|
2914
|
+
/** One optimization objective inside `goal.optimize { … }`. */
|
|
2915
|
+
type GoalOptimizeDecl = {
|
|
2916
|
+
kind: 'builtin';
|
|
2917
|
+
direction: GoalOptimizeDirection;
|
|
2918
|
+
metric: GoalBuiltInOptimizeMetric;
|
|
2919
|
+
metricRange: SourceRange;
|
|
2920
|
+
range: SourceRange;
|
|
2921
|
+
} | {
|
|
2922
|
+
kind: 'custom';
|
|
2923
|
+
direction: GoalOptimizeDirection;
|
|
2924
|
+
name: string;
|
|
2925
|
+
nameRange: SourceRange;
|
|
2926
|
+
score?: ConfigValue;
|
|
2927
|
+
range: SourceRange;
|
|
2928
|
+
};
|
|
2929
|
+
/** Execution budget envelope inside `goal.budget { … }`. */
|
|
2930
|
+
interface GoalBudgetDecl {
|
|
2931
|
+
cost?: number;
|
|
2932
|
+
costRange?: SourceRange;
|
|
2933
|
+
tokens?: number;
|
|
2934
|
+
tokensRange?: SourceRange;
|
|
2935
|
+
duration?: string;
|
|
2936
|
+
durationSeconds?: number;
|
|
2937
|
+
durationRange?: SourceRange;
|
|
2938
|
+
attempts?: number;
|
|
2939
|
+
attemptsRange?: SourceRange;
|
|
2940
|
+
range: SourceRange;
|
|
2941
|
+
}
|
|
2942
|
+
/** Top-level `goal <name> { … }` operational contract declaration. */
|
|
2943
|
+
interface GoalDecl {
|
|
2944
|
+
/** Set by deploy bundle / tooling; not produced by the parser. */
|
|
2945
|
+
id?: string;
|
|
2946
|
+
name: string;
|
|
2947
|
+
label: string;
|
|
2948
|
+
description?: string;
|
|
2949
|
+
objective?: string;
|
|
2950
|
+
inputSchema?: JsonSchemaLiteral;
|
|
2951
|
+
inputSchemaBlock?: JsonBlockInfo;
|
|
2952
|
+
inputSchemaRef?: string;
|
|
2953
|
+
inputSchemaRefRange?: SourceRange;
|
|
2954
|
+
outputSchema?: JsonSchemaLiteral;
|
|
2955
|
+
outputSchemaBlock?: JsonBlockInfo;
|
|
2956
|
+
outputSchemaRef?: string;
|
|
2957
|
+
outputSchemaRefRange?: SourceRange;
|
|
2958
|
+
/** Active executor: name of a top-level `workflow` or `agent` block. */
|
|
2959
|
+
by: string;
|
|
2960
|
+
byRange?: SourceRange;
|
|
2961
|
+
invariants: GoalInvariantDecl[];
|
|
2962
|
+
ensure: GoalCheckDecl[];
|
|
2963
|
+
optimize: GoalOptimizeDecl[];
|
|
2964
|
+
budget?: GoalBudgetDecl;
|
|
2965
|
+
docComment?: string;
|
|
2966
|
+
range: SourceRange;
|
|
2967
|
+
}
|
|
2968
|
+
|
|
2633
2969
|
/**
|
|
2634
2970
|
* AST types for top-level `mcp name { … }` blocks referenced by `agent.mcp:`.
|
|
2635
2971
|
*
|
|
@@ -2705,6 +3041,8 @@ interface MockDecl {
|
|
|
2705
3041
|
/** Static output (@json). */
|
|
2706
3042
|
output?: JsonBlockInfo;
|
|
2707
3043
|
outputLiteral?: Record<string, unknown>;
|
|
3044
|
+
/** Stateful handler (@ts { … } or @ts "…") receiving `{ args, state }`. */
|
|
3045
|
+
handler?: ConfigValue;
|
|
2708
3046
|
/** LLM-generated stub; true or inline ai config. */
|
|
2709
3047
|
generate?: boolean | MockAiConfig;
|
|
2710
3048
|
review?: MockReviewConfig;
|
|
@@ -2804,7 +3142,7 @@ interface OperationDecl {
|
|
|
2804
3142
|
}
|
|
2805
3143
|
|
|
2806
3144
|
/**
|
|
2807
|
-
* AST for top-level `playbook` blocks (hosted test suites).
|
|
3145
|
+
* AST for top-level `playbook` blocks (hosted test suites and benchmarks).
|
|
2808
3146
|
*/
|
|
2809
3147
|
|
|
2810
3148
|
type AssertionSeverity = 'soft' | 'gate';
|
|
@@ -2815,13 +3153,6 @@ type ExpectAssertion = {
|
|
|
2815
3153
|
severity?: AssertionSeverity;
|
|
2816
3154
|
label?: string;
|
|
2817
3155
|
range: SourceRange;
|
|
2818
|
-
} | {
|
|
2819
|
-
kind: 'duration';
|
|
2820
|
-
max: string;
|
|
2821
|
-
maxSeconds?: number;
|
|
2822
|
-
severity?: AssertionSeverity;
|
|
2823
|
-
label?: string;
|
|
2824
|
-
range: SourceRange;
|
|
2825
3156
|
} | {
|
|
2826
3157
|
kind: 'output';
|
|
2827
3158
|
value?: JsonBlockInfo;
|
|
@@ -2916,20 +3247,6 @@ interface ExpectDecl {
|
|
|
2916
3247
|
assertions: ExpectAssertion[];
|
|
2917
3248
|
range: SourceRange;
|
|
2918
3249
|
}
|
|
2919
|
-
interface PlaybookCaseDecl {
|
|
2920
|
-
name: string;
|
|
2921
|
-
workflow: string;
|
|
2922
|
-
workflowRange?: SourceRange;
|
|
2923
|
-
input?: JsonBlockInfo;
|
|
2924
|
-
inputLiteral?: Record<string, unknown>;
|
|
2925
|
-
dataset?: JsonBlockInfo;
|
|
2926
|
-
timeout?: string;
|
|
2927
|
-
timeoutSeconds?: number;
|
|
2928
|
-
tags?: string[];
|
|
2929
|
-
skip?: string;
|
|
2930
|
-
expect?: ExpectDecl;
|
|
2931
|
-
range: SourceRange;
|
|
2932
|
-
}
|
|
2933
3250
|
interface JudgeDecl {
|
|
2934
3251
|
rubric?: string;
|
|
2935
3252
|
criteria?: string;
|
|
@@ -2937,14 +3254,25 @@ interface JudgeDecl {
|
|
|
2937
3254
|
severity?: AssertionSeverity;
|
|
2938
3255
|
label?: string;
|
|
2939
3256
|
model?: string;
|
|
2940
|
-
/** Deterministic @ts scorer over execution outputs. */
|
|
3257
|
+
/** Deterministic @ts scorer (or @ts file ref) over execution outputs. */
|
|
2941
3258
|
ts?: ConfigValue;
|
|
2942
3259
|
range: SourceRange;
|
|
2943
3260
|
}
|
|
2944
|
-
|
|
3261
|
+
/**
|
|
3262
|
+
* One scenario inside a `playbook` block (authored as `case <name> { … }`;
|
|
3263
|
+
* `eval <name> { … }` is accepted as a parser alias). Targets either a
|
|
3264
|
+
* `workflow:` or a `goal:` (with optional `by:` executor override for
|
|
3265
|
+
* benchmarking competing strategies against the same goal).
|
|
3266
|
+
*/
|
|
3267
|
+
interface PlaybookCaseDecl {
|
|
2945
3268
|
name: string;
|
|
2946
|
-
workflow
|
|
3269
|
+
workflow?: string;
|
|
2947
3270
|
workflowRange?: SourceRange;
|
|
3271
|
+
goal?: string;
|
|
3272
|
+
goalRange?: SourceRange;
|
|
3273
|
+
/** Optional executor override (`workflow` or `agent`) when targeting a `goal:`. */
|
|
3274
|
+
by?: string;
|
|
3275
|
+
byRange?: SourceRange;
|
|
2948
3276
|
input?: JsonBlockInfo;
|
|
2949
3277
|
inputLiteral?: Record<string, unknown>;
|
|
2950
3278
|
dataset?: JsonBlockInfo;
|
|
@@ -2968,7 +3296,6 @@ interface PlaybookDecl {
|
|
|
2968
3296
|
mocksRange?: SourceRange;
|
|
2969
3297
|
tags?: string[];
|
|
2970
3298
|
cases: PlaybookCaseDecl[];
|
|
2971
|
-
evals: PlaybookEvalDecl[];
|
|
2972
3299
|
range: SourceRange;
|
|
2973
3300
|
}
|
|
2974
3301
|
|
|
@@ -3096,9 +3423,15 @@ interface PolicyGrantBase {
|
|
|
3096
3423
|
type PolicyGrant = PolicyGrantBase & ({
|
|
3097
3424
|
agent: string;
|
|
3098
3425
|
workflow?: never;
|
|
3426
|
+
goal?: never;
|
|
3099
3427
|
} | {
|
|
3100
3428
|
workflow: string;
|
|
3101
3429
|
agent?: never;
|
|
3430
|
+
goal?: never;
|
|
3431
|
+
} | {
|
|
3432
|
+
goal: string;
|
|
3433
|
+
agent?: never;
|
|
3434
|
+
workflow?: never;
|
|
3102
3435
|
});
|
|
3103
3436
|
/** File retention settings inside `policy { files { … } }`. */
|
|
3104
3437
|
interface FilePolicySettings {
|
|
@@ -3473,6 +3806,9 @@ interface WorkflowDecl {
|
|
|
3473
3806
|
concurrency?: number;
|
|
3474
3807
|
/** Lifetime of the execution authorization token (`executionTokenTtl:`). */
|
|
3475
3808
|
executionTokenTtl?: string;
|
|
3809
|
+
/** Optional `goal` block name this workflow conforms to (`achieves: <goal>`). */
|
|
3810
|
+
achieves?: string;
|
|
3811
|
+
achievesRange?: SourceRange;
|
|
3476
3812
|
/** Doc comment (block-comment style) immediately above this declaration; shown on hover. */
|
|
3477
3813
|
docComment?: string;
|
|
3478
3814
|
nodes: NodeDecl[];
|
|
@@ -3488,9 +3824,15 @@ interface TriggerDecl {
|
|
|
3488
3824
|
resourceType: TriggerType;
|
|
3489
3825
|
resourceName: string;
|
|
3490
3826
|
workflowName: string;
|
|
3827
|
+
/** Explicit or resolved goal target (`form: req -> goal generate_quote` or bare goal name). */
|
|
3828
|
+
goalName?: string;
|
|
3829
|
+
goalNameRange?: SourceRange;
|
|
3830
|
+
/** Explicitly written target kind when author wrote `-> goal <name>` or `-> workflow <name>`. */
|
|
3831
|
+
targetKind?: 'workflow' | 'goal';
|
|
3491
3832
|
/** Resolved UUIDs for deploy payloads; not produced by the parser. */
|
|
3492
3833
|
resourceId?: string;
|
|
3493
3834
|
workflowId?: string;
|
|
3835
|
+
goalId?: string;
|
|
3494
3836
|
/** Doc comment (block-comment style) immediately above this declaration; shown on hover. */
|
|
3495
3837
|
docComment?: string;
|
|
3496
3838
|
enabled?: boolean;
|
|
@@ -3575,6 +3917,8 @@ interface SwirlsFile {
|
|
|
3575
3917
|
/** Role-to-resource grants (`policy { allow <role> -> agent … }`). A policy
|
|
3576
3918
|
* with grants opts the deployment into deny-by-default enforcement. */
|
|
3577
3919
|
policies: PolicyDecl[];
|
|
3920
|
+
/** Operational goal contracts (`goal name { … }`). */
|
|
3921
|
+
goals?: GoalDecl[];
|
|
3578
3922
|
/** Bespoke OpenUI-backed interfaces (`app name { shell, nav, page … }`). */
|
|
3579
3923
|
apps: AppDecl[];
|
|
3580
3924
|
/** Side-effect stubs for playbook runs (`mock name { … }`). */
|
|
@@ -3736,7 +4080,8 @@ interface BuildDefinitionOptions {
|
|
|
3736
4080
|
}
|
|
3737
4081
|
/**
|
|
3738
4082
|
* Parse every `.swirls` file under `cwd` and merge into a single bundle.
|
|
3739
|
-
*
|
|
4083
|
+
* Throws on the first problem: a file that cannot be parsed, or a resource name
|
|
4084
|
+
* of one kind declared in two places (the message names both files).
|
|
3740
4085
|
*/
|
|
3741
4086
|
declare function mergeProjectSwirlsFiles(fs: DeployBundleFs, cwd: string, options?: MergeProjectOptions): SwirlsFile;
|
|
3742
4087
|
/**
|
|
@@ -3959,6 +4304,27 @@ declare function computeDefinitionHash(stripped: SwirlsFile): string;
|
|
|
3959
4304
|
*/
|
|
3960
4305
|
declare function computeDeploymentDefinitionFingerprint(def: DeploymentDefinition): string;
|
|
3961
4306
|
|
|
4307
|
+
/**
|
|
4308
|
+
* Deterministic SHA-256 hex digest of a goal's verification contract surface
|
|
4309
|
+
* (`inputSchema`, `outputSchema`, `invariants`, `ensure`, `budget`).
|
|
4310
|
+
*
|
|
4311
|
+
* Intentionally excludes executor binding (`by:`) and prose (`label`, `objective`)
|
|
4312
|
+
* so swapping implementations (e.g. agent -> workflow) keeps the same contract hash,
|
|
4313
|
+
* while any edit to invariants, ensure checks, schemas, or budgets changes it.
|
|
4314
|
+
*/
|
|
4315
|
+
declare function computeGoalContractHash(contract: {
|
|
4316
|
+
inputSchema?: DeploymentDefinitionGoal['inputSchema'];
|
|
4317
|
+
outputSchema?: DeploymentDefinitionGoal['outputSchema'];
|
|
4318
|
+
invariants?: GoalInvariant[];
|
|
4319
|
+
ensure: GoalCheck[];
|
|
4320
|
+
budget?: GoalBudget;
|
|
4321
|
+
}): string;
|
|
4322
|
+
declare function compileGoalBlock(goal: GoalDecl, deps: {
|
|
4323
|
+
id: string;
|
|
4324
|
+
workflowByName: Map<string, string>;
|
|
4325
|
+
agentByName: Map<string, string>;
|
|
4326
|
+
}): DeploymentDefinitionGoal;
|
|
4327
|
+
|
|
3962
4328
|
/**
|
|
3963
4329
|
* A UUIDv7 (RFC 9562): 48 bits of Unix time in milliseconds, then random bits.
|
|
3964
4330
|
* Ids made later sort later, which keeps stored definitions in creation order.
|
|
@@ -4002,6 +4368,8 @@ interface SkillBlockRef {
|
|
|
4002
4368
|
name: string;
|
|
4003
4369
|
/** On-disk slug under `.agents/skills/<skillName>/`. */
|
|
4004
4370
|
skillName: string;
|
|
4371
|
+
/** The mount that declares the block, when it was merged from several mounts. */
|
|
4372
|
+
sourceMount?: string;
|
|
4005
4373
|
}
|
|
4006
4374
|
|
|
4007
4375
|
/** Source files of one project: posix path relative to the project root, to text. */
|
|
@@ -4016,11 +4384,13 @@ interface LowerOptions {
|
|
|
4016
4384
|
newId?: () => string;
|
|
4017
4385
|
}
|
|
4018
4386
|
/**
|
|
4019
|
-
* Which step reported a diagnostic:
|
|
4020
|
-
*
|
|
4021
|
-
*
|
|
4387
|
+
* Which step reported a diagnostic: checking the inputs (`mount`: a path that
|
|
4388
|
+
* cannot be used), reading one file (`parse`, `validate`), combining the files
|
|
4389
|
+
* (`merge`: a name declared twice, versions that disagree), building the
|
|
4390
|
+
* definition (`lower`), or checking the built definition against its schema
|
|
4391
|
+
* (`definition`).
|
|
4022
4392
|
*/
|
|
4023
|
-
type LowerStage = 'parse' | 'validate' | 'merge' | 'lower' | 'definition';
|
|
4393
|
+
type LowerStage = 'mount' | 'parse' | 'validate' | 'merge' | 'lower' | 'definition';
|
|
4024
4394
|
interface LowerDiagnostic {
|
|
4025
4395
|
severity: 'error' | 'warning';
|
|
4026
4396
|
stage: LowerStage;
|
|
@@ -4029,6 +4399,11 @@ interface LowerDiagnostic {
|
|
|
4029
4399
|
path?: string;
|
|
4030
4400
|
/** Where in `path`; lines and columns as the language reports them. */
|
|
4031
4401
|
range?: SourceRange;
|
|
4402
|
+
/** Other places the same problem is at: every other declaration of a duplicate name. */
|
|
4403
|
+
related?: {
|
|
4404
|
+
path: string;
|
|
4405
|
+
range?: SourceRange;
|
|
4406
|
+
}[];
|
|
4032
4407
|
}
|
|
4033
4408
|
interface LowerResult {
|
|
4034
4409
|
/** True when a definition was built. Warnings do not make this false. */
|
|
@@ -4057,9 +4432,58 @@ interface LowerResult {
|
|
|
4057
4432
|
*
|
|
4058
4433
|
* Besides `.swirls` files, pass the `.ts.swirls` files they reference and the
|
|
4059
4434
|
* `.agents/skills/<name>/` files of any skill an agent uses.
|
|
4435
|
+
*
|
|
4436
|
+
* This is `lowerSwirlsMounts` over one mount.
|
|
4060
4437
|
*/
|
|
4061
4438
|
declare function lowerSwirlsSources(files: SwirlsSources, options?: LowerOptions): LowerResult;
|
|
4062
4439
|
|
|
4440
|
+
/**
|
|
4441
|
+
* Source manifest version 2: where every named block of a definition built
|
|
4442
|
+
* from several mounts is declared. Version 1 (`buildDeploymentSourceManifest`)
|
|
4443
|
+
* stays as it is for a single directory.
|
|
4444
|
+
*/
|
|
4445
|
+
|
|
4446
|
+
type DeploymentSourceResourceKindV2 = DeploymentSourceResourceKind | 'computer' | 'query' | 'operation' | 'role' | 'mock' | 'playbook';
|
|
4447
|
+
interface DeploymentSourceManifestV2 {
|
|
4448
|
+
version: 2;
|
|
4449
|
+
mounts: {
|
|
4450
|
+
id: string;
|
|
4451
|
+
sources: string;
|
|
4452
|
+
skills: string;
|
|
4453
|
+
}[];
|
|
4454
|
+
files: {
|
|
4455
|
+
mount: string;
|
|
4456
|
+
path: string;
|
|
4457
|
+
size: number;
|
|
4458
|
+
sha256: string;
|
|
4459
|
+
}[];
|
|
4460
|
+
/**
|
|
4461
|
+
* Every named block of the definition. `id` is absent for a role, which has
|
|
4462
|
+
* none. Policies have no name and are not listed.
|
|
4463
|
+
*/
|
|
4464
|
+
resources: {
|
|
4465
|
+
mount: string;
|
|
4466
|
+
kind: DeploymentSourceResourceKindV2;
|
|
4467
|
+
id?: string;
|
|
4468
|
+
name: string;
|
|
4469
|
+
path: string;
|
|
4470
|
+
range: SourceRange;
|
|
4471
|
+
}[];
|
|
4472
|
+
nodes: {
|
|
4473
|
+
mount: string;
|
|
4474
|
+
workflowId: string;
|
|
4475
|
+
workflowName: string;
|
|
4476
|
+
nodeId: string;
|
|
4477
|
+
nodeName: string;
|
|
4478
|
+
path: string;
|
|
4479
|
+
range: SourceRange;
|
|
4480
|
+
}[];
|
|
4481
|
+
fingerprint: string;
|
|
4482
|
+
}
|
|
4483
|
+
/** The schema of {@link DeploymentSourceManifestV2}. */
|
|
4484
|
+
declare const deploymentSourceManifestV2Schema: z.ZodType<DeploymentSourceManifestV2>;
|
|
4485
|
+
declare function parseDeploymentSourceManifestV2(input: unknown): z.ZodSafeParseResult<DeploymentSourceManifestV2>;
|
|
4486
|
+
|
|
4063
4487
|
/**
|
|
4064
4488
|
* Build a virtual FS from a flat map of **posix** paths relative to the repo root
|
|
4065
4489
|
* (e.g. `packages/app/graph.swirls` → file contents). Used with GitHub archive trees.
|
|
@@ -4081,6 +4505,98 @@ declare function virtualRepoCwd(virtualRoot: string): string;
|
|
|
4081
4505
|
*/
|
|
4082
4506
|
declare function sliceRepoFilesToRoot(files: Map<string, string>, rootPath: string): Map<string, string>;
|
|
4083
4507
|
|
|
4508
|
+
/** The default skills root of a mount: `<root>/<skill>/SKILL.md`. */
|
|
4509
|
+
declare const MOUNT_SKILLS_ROOT = ".agents/skills";
|
|
4510
|
+
/** A mount's files: posix path relative to the mount, to text or bytes. */
|
|
4511
|
+
type SwirlsMountFiles = ReadonlyMap<string, string | Uint8Array> | Readonly<Record<string, string | Uint8Array>>;
|
|
4512
|
+
interface SwirlsMount {
|
|
4513
|
+
/**
|
|
4514
|
+
* Chosen by the host, unique among the mounts of one call, at least one character.
|
|
4515
|
+
* It names the mount in every output and never appears in the definition.
|
|
4516
|
+
*/
|
|
4517
|
+
readonly id: string;
|
|
4518
|
+
/**
|
|
4519
|
+
* Every file of the mount the lowering may read: `.swirls` files, the `.ts.swirls`
|
|
4520
|
+
* files and operation scripts they reference, and the files under `skillsRoot`.
|
|
4521
|
+
* `.swirls`, `.ts.swirls` and operation scripts must be UTF-8 text; given as bytes
|
|
4522
|
+
* they are decoded strictly. Skill files are kept byte for byte.
|
|
4523
|
+
*/
|
|
4524
|
+
readonly files: SwirlsMountFiles;
|
|
4525
|
+
/** Mount-relative directory holding the mount's skills. Defaults to `MOUNT_SKILLS_ROOT`. */
|
|
4526
|
+
readonly skillsRoot?: string;
|
|
4527
|
+
}
|
|
4528
|
+
interface LowerMountsOptions {
|
|
4529
|
+
/** As `LowerOptions.host`. */
|
|
4530
|
+
readonly host?: LanguageHost;
|
|
4531
|
+
/**
|
|
4532
|
+
* Makes the id of every resource, node, edge and connection. `site` names what the id
|
|
4533
|
+
* is for and is unique within one call; `mount` is the mount that declares it.
|
|
4534
|
+
* Defaults to a UUIDv7 that ignores both. Every id must be a UUID.
|
|
4535
|
+
*/
|
|
4536
|
+
readonly newId?: (site: string, mount: string) => string;
|
|
4537
|
+
}
|
|
4538
|
+
/** A place in one mount. */
|
|
4539
|
+
interface MountSite {
|
|
4540
|
+
readonly mount: string;
|
|
4541
|
+
readonly path: string;
|
|
4542
|
+
readonly range?: SourceRange;
|
|
4543
|
+
}
|
|
4544
|
+
interface MountDiagnostic {
|
|
4545
|
+
readonly severity: 'error' | 'warning';
|
|
4546
|
+
readonly stage: LowerStage;
|
|
4547
|
+
readonly message: string;
|
|
4548
|
+
/** The mount, when the diagnostic belongs to one. */
|
|
4549
|
+
readonly mount?: string;
|
|
4550
|
+
/** Mount-relative. */
|
|
4551
|
+
readonly path?: string;
|
|
4552
|
+
readonly range?: SourceRange;
|
|
4553
|
+
/** Other places the same problem is at: every other declaration of a duplicate name. */
|
|
4554
|
+
readonly related?: readonly MountSite[];
|
|
4555
|
+
}
|
|
4556
|
+
interface MountSourceFile extends DeploymentSourceFileContent {
|
|
4557
|
+
readonly mount: string;
|
|
4558
|
+
}
|
|
4559
|
+
interface MountSkillFiles extends DeploymentSkillFilesBundle {
|
|
4560
|
+
/** The mount whose skills root the files were read from: the mount that declares the skill block. */
|
|
4561
|
+
readonly mount: string;
|
|
4562
|
+
}
|
|
4563
|
+
interface MountFingerprint {
|
|
4564
|
+
readonly mount: string;
|
|
4565
|
+
/** SHA-256 over the mount's `.swirls` and `.ts.swirls` files. */
|
|
4566
|
+
readonly sources: string;
|
|
4567
|
+
/** SHA-256 over every file under the mount's skills root. */
|
|
4568
|
+
readonly skills: string;
|
|
4569
|
+
}
|
|
4570
|
+
interface LowerMountsResult {
|
|
4571
|
+
readonly ok: boolean;
|
|
4572
|
+
/** As `LowerResult.definition`. Carries no mount id and no path. */
|
|
4573
|
+
readonly definition: Record<string, unknown> | null;
|
|
4574
|
+
readonly diagnostics: MountDiagnostic[];
|
|
4575
|
+
/** Every `.swirls` and `.ts.swirls` file of every mount, sorted by mount id then path. */
|
|
4576
|
+
readonly sourceFiles: MountSourceFile[];
|
|
4577
|
+
/** Files of each skill an agent uses, by skill block, sorted by block name. */
|
|
4578
|
+
readonly skillFiles: MountSkillFiles[];
|
|
4579
|
+
/** Null when `ok` is false. */
|
|
4580
|
+
readonly manifest: DeploymentSourceManifestV2 | null;
|
|
4581
|
+
/** SHA-256 over every mount's id, sources and skills. Filled when `ok` is false too. */
|
|
4582
|
+
readonly fingerprint: string;
|
|
4583
|
+
/** Sorted by mount id. */
|
|
4584
|
+
readonly mounts: MountFingerprint[];
|
|
4585
|
+
readonly ast: SwirlsFile | null;
|
|
4586
|
+
}
|
|
4587
|
+
/**
|
|
4588
|
+
* Lower several directories into one deployment definition.
|
|
4589
|
+
*
|
|
4590
|
+
* The mounts are one program: a name is unique per kind across every mount,
|
|
4591
|
+
* and a block may reference a block of another mount by name. A file may read
|
|
4592
|
+
* only files of its own mount (`@ts` files, operation scripts), and each skill
|
|
4593
|
+
* is read from the skills root of the mount that declares its `skill` block.
|
|
4594
|
+
*
|
|
4595
|
+
* Nothing is read from disk or from the environment, and nothing is thrown for
|
|
4596
|
+
* a problem in the inputs: every problem is a diagnostic that names its mount.
|
|
4597
|
+
*/
|
|
4598
|
+
declare function lowerSwirlsMounts(mounts: readonly SwirlsMount[], options?: LowerMountsOptions): LowerMountsResult;
|
|
4599
|
+
|
|
4084
4600
|
declare const nodeTypeMap: {
|
|
4085
4601
|
readonly ai: "ai";
|
|
4086
4602
|
readonly decision: "decision";
|
|
@@ -4514,10 +5030,11 @@ declare function isScriptsOrBinDirectory(relativePath: string): boolean;
|
|
|
4514
5030
|
declare function parseSkillMdFrontmatter(input: Uint8Array | string): SkillMdFrontmatter;
|
|
4515
5031
|
|
|
4516
5032
|
/**
|
|
4517
|
-
* Walk `.agents/skills
|
|
4518
|
-
* path escape, and enforce
|
|
5033
|
+
* Walk `<skillsRoot>/<skillName>/` under `projectRoot` (`.agents/skills` by
|
|
5034
|
+
* default), require `SKILL.md`, reject symlinks and path escape, and enforce
|
|
5035
|
+
* size/file-count caps. Files are read as bytes.
|
|
4519
5036
|
*/
|
|
4520
|
-
declare function resolveSkillTree(fs: SkillDeployFs, projectRoot: string, skillName: string): SkillFileEntry[];
|
|
5037
|
+
declare function resolveSkillTree(fs: SkillDeployFs, projectRoot: string, skillName: string, skillsRoot?: string): SkillFileEntry[];
|
|
4521
5038
|
|
|
4522
5039
|
declare function normalizeDeploymentSourcePath(path: string): string;
|
|
4523
5040
|
declare function collectDeploymentSourceFiles(fs: DeployBundleFs, cwd: string): DeploymentSourceFileContent[];
|
|
@@ -4536,9 +5053,10 @@ declare function buildDeploymentSourceManifest({ definition, ast, files, }: {
|
|
|
4536
5053
|
|
|
4537
5054
|
/**
|
|
4538
5055
|
* Recursively strip `range`, `innerRange`, `flowRange`, `inputSchemaBlock`,
|
|
4539
|
-
* `outputSchemaBlock`, `schemaBlock`, and `docComment` fields from an AST value
|
|
5056
|
+
* `outputSchemaBlock`, `schemaBlock`, and `docComment` fields from an AST value,
|
|
5057
|
+
* and the `sourcePath` and `sourceMount` marks merging adds to each declaration.
|
|
4540
5058
|
* These are editor/LSP-only metadata and not meaningful for deployment.
|
|
4541
5059
|
*/
|
|
4542
5060
|
declare function stripEditorMetadata(value: unknown): unknown;
|
|
4543
5061
|
|
|
4544
|
-
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 DeploymentSourceResourceKind, type Diagnostic, EXECUTABLE_STRING_FIELDS, HARNESS_DEBIAN_STAGE_DIR, HARNESS_PROVIDERS, HARNESS_ROOT_DIR, type HarnessCatalog, type HarnessDebianPackage, type HarnessProvider, type HarnessRuntimePackage, type LanguageHost, type LowerDiagnostic, type LowerOptions, type LowerResult, type LowerStage, MAX_SKILL_FILES, MAX_SKILL_FILE_BYTES, MAX_SKILL_TREE_BYTES, type MergeProjectOptions, 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 SwirlsSources, buildConfigValueKindsFromNodeDecl, buildDeploymentDefinitionPayload, buildDeploymentSourceManifest, buildWorkflowNodeConfigFromNodeDecl, canonicalizeForStableJson, classifySkillBundle, collectDeploymentSkillFiles, collectDeploymentSourceFiles, collectReferencedSkillBlocksFromAst, collectSwirlsFiles, combineDeploymentAndSourceFingerprints, compileComputerRecipe, compileOperationBlock, computeDefinitionHash, computeDeploymentDefinitionFingerprint, computeDeploymentSourceFingerprint, computeSkillChecksum, computerHarnessBake, computerSnapshotName, createMemoryRepoFs, createNodeDeployBundleFs, daytonaSnapshotResources, deployBundleToSkillDeployFs, deployBundleToWorkspaceFileSystem, flattenArchivePathMap, flattenInlineSubgraphsInGraph, floxManifestToml, harnessPrepScript, harnessRuntimePackages, isHarnessProvider, isKnownScriptExtension, isScriptsOrBinDirectory, lowerSwirlsSources, mergeProjectSwirlsFiles, normalizeDeploymentSourcePath, operationScriptSha256, parseDeploymentDefinition, parseSkillMdFrontmatter, platformComputerSnapshotName, recipePackages, resolveSkillTree, sha256Hex, sliceRepoFilesToRoot, stripEditorMetadata, swirlsHost, uuidv7, validateDeploymentSourceInput, virtualRepoCwd };
|
|
5062
|
+
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, EXECUTABLE_STRING_FIELDS, 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 };
|