@agentorg/cli 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -7
- package/dist/node_modules/@agentorg/computer/LICENSE +201 -0
- package/dist/node_modules/@agentorg/computer/NOTICE +2 -0
- package/dist/node_modules/@agentorg/computer/dist/THIRD_PARTY_LICENSES.txt +1321 -0
- package/dist/node_modules/@agentorg/computer/dist/sdk.js +24909 -0
- package/dist/node_modules/@agentorg/computer/dist/types/generated/schema.d.ts +860 -0
- package/dist/node_modules/@agentorg/computer/dist/types/sdk.d.ts +242 -0
- package/dist/node_modules/@agentorg/computer/package.json +12 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/index.d.ts +1 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/index.js +1 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/provider.d.ts +24 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/provider.js +482 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/unit.d.ts +19 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/unit.js +149 -0
- package/dist/node_modules/@agentorg/computer-connector/package.json +33 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/browser/SKILL.md +31 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/computer/SKILL.md +30 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/files/SKILL.md +28 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/terminal/SKILL.md +39 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/web-research/SKILL.md +29 -0
- package/dist/node_modules/@agentorg/hub/dist/src/router.d.ts +4 -2
- package/dist/node_modules/@agentorg/hub/dist/src/router.js +3 -1
- package/dist/node_modules/@agentorg/hub/dist/src/validate.js +16 -2
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-provider.d.ts +34 -47
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-provider.js +25 -34
- package/dist/node_modules/@agentorg/interfaces/dist/src/chat.d.ts +90 -50
- package/dist/node_modules/@agentorg/interfaces/dist/src/chat.js +69 -34
- package/dist/node_modules/@agentorg/interfaces/dist/src/connection.d.ts +36 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/connection.js +31 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/folders.d.ts +19 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/folders.js +25 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/index.d.ts +6 -4
- package/dist/node_modules/@agentorg/interfaces/dist/src/index.js +6 -4
- package/dist/node_modules/@agentorg/interfaces/dist/src/llm-session.d.ts +2 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/llm-session.js +2 -1
- package/dist/node_modules/@agentorg/interfaces/dist/src/manager.d.ts +381 -27
- package/dist/node_modules/@agentorg/interfaces/dist/src/manager.js +179 -15
- package/dist/node_modules/@agentorg/interfaces/dist/src/units.d.ts +460 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/units.js +204 -0
- package/dist/node_modules/@agentorg/looper/dist/src/index.d.ts +5 -0
- package/dist/node_modules/@agentorg/looper/dist/src/index.js +5 -0
- package/dist/node_modules/@agentorg/looper/dist/src/loop.d.ts +89 -0
- package/dist/node_modules/@agentorg/looper/dist/src/loop.js +366 -0
- package/dist/node_modules/@agentorg/looper/dist/src/looper.d.ts +81 -0
- package/dist/node_modules/@agentorg/looper/dist/src/looper.js +574 -0
- package/dist/node_modules/@agentorg/looper/dist/src/main.d.ts +34 -0
- package/dist/node_modules/@agentorg/looper/dist/src/main.js +116 -0
- package/dist/node_modules/@agentorg/looper/dist/src/record.d.ts +181 -0
- package/dist/node_modules/@agentorg/looper/dist/src/record.js +433 -0
- package/dist/node_modules/@agentorg/looper/dist/src/tools.d.ts +11 -0
- package/dist/node_modules/@agentorg/looper/dist/src/tools.js +42 -0
- package/dist/node_modules/@agentorg/looper/dist/src/types.d.ts +147 -0
- package/dist/node_modules/@agentorg/looper/dist/src/types.js +32 -0
- package/dist/node_modules/@agentorg/looper/package.json +24 -0
- package/dist/node_modules/@agentorg/manager/dist/src/activity.d.ts +18 -0
- package/dist/node_modules/@agentorg/manager/dist/src/activity.js +65 -0
- package/dist/node_modules/@agentorg/manager/dist/src/control.d.ts +134 -0
- package/dist/node_modules/@agentorg/manager/dist/src/control.js +1115 -0
- package/dist/node_modules/@agentorg/manager/dist/src/form.d.ts +40 -0
- package/dist/node_modules/@agentorg/manager/dist/src/form.js +191 -0
- package/dist/node_modules/@agentorg/manager/dist/src/manager.d.ts +4 -0
- package/dist/node_modules/@agentorg/manager/dist/src/manager.js +341 -189
- package/dist/node_modules/@agentorg/manager/dist/src/skills.d.ts +2 -0
- package/dist/node_modules/@agentorg/manager/dist/src/skills.js +7 -0
- package/dist/node_modules/@agentorg/manager/dist/src/stack.d.ts +454 -0
- package/dist/node_modules/@agentorg/manager/dist/src/stack.js +917 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/connection.d.ts +2 -1
- package/dist/node_modules/@agentorg/mcp/dist/src/connection.js +8 -2
- package/dist/node_modules/@agentorg/mcp/dist/src/index.d.ts +3 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/index.js +3 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/kinds.d.ts +108 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/kinds.js +95 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/provider.d.ts +2 -2
- package/dist/node_modules/@agentorg/mcp/dist/src/provider.js +48 -18
- package/dist/node_modules/@agentorg/mcp/dist/src/public.d.ts +6 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/public.js +72 -0
- package/dist/node_modules/@agentorg/sdk/dist/src/filled.d.ts +21 -0
- package/dist/node_modules/@agentorg/sdk/dist/src/filled.js +24 -0
- package/dist/node_modules/@agentorg/sdk/dist/src/index.d.ts +1 -0
- package/dist/node_modules/@agentorg/sdk/dist/src/index.js +1 -0
- package/dist/node_modules/@agentorg/shell/dist/app.css +1306 -181
- package/dist/node_modules/@agentorg/shell/dist/app.js +207 -166
- package/dist/node_modules/@agentorg/shell/package.json +6 -1
- package/dist/node_modules/assistant/dist/src/chats.d.ts +94 -0
- package/dist/node_modules/assistant/dist/src/chats.js +355 -0
- package/dist/node_modules/assistant/dist/src/engine.d.ts +26 -7
- package/dist/node_modules/assistant/dist/src/engine.js +107 -35
- package/dist/node_modules/assistant/dist/src/local-store.js +1 -1
- package/dist/node_modules/assistant/dist/src/provider.d.ts +1 -1
- package/dist/node_modules/assistant/dist/src/provider.js +47 -19
- package/dist/node_modules/assistant/dist/src/tools.d.ts +11 -28
- package/dist/node_modules/assistant/dist/src/tools.js +19 -40
- package/dist/node_modules/assistant/package.json +1 -0
- package/dist/src/api.js +4 -0
- package/dist/src/folders.d.ts +2 -0
- package/dist/src/folders.js +45 -0
- package/dist/src/gateway.d.ts +7 -1
- package/dist/src/gateway.js +81 -12
- package/dist/src/live.d.ts +17 -0
- package/dist/src/live.js +109 -0
- package/dist/src/programs.d.ts +7 -0
- package/dist/src/programs.js +29 -2
- package/dist/src/signin.d.ts +12 -3
- package/dist/src/signin.js +30 -6
- package/package.json +2 -1
- package/dist/node_modules/@agentorg/interfaces/dist/src/mcp-provider.d.ts +0 -88
- package/dist/node_modules/@agentorg/interfaces/dist/src/mcp-provider.js +0 -78
- package/dist/node_modules/assistant/dist/src/agent.d.ts +0 -62
- package/dist/node_modules/assistant/dist/src/agent.js +0 -226
- package/dist/node_modules/assistant/dist/src/history.d.ts +0 -97
- package/dist/node_modules/assistant/dist/src/history.js +0 -235
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A unit's id, unique within its provider. */
|
|
3
|
+
export declare const UnitId: z.ZodString;
|
|
4
|
+
/** A field's id: the key of its value. */
|
|
5
|
+
export declare const FieldId: z.ZodString;
|
|
6
|
+
/** What a result is, such as `computer`. Only a unit of the same provider can take one for now. */
|
|
7
|
+
export declare const ResultKind: z.ZodString;
|
|
8
|
+
/** A field's value. */
|
|
9
|
+
export declare const FieldValue: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>;
|
|
10
|
+
/** What was filled in, by field id. A field with no value isn't here. */
|
|
11
|
+
export declare const FieldValues: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
12
|
+
/**
|
|
13
|
+
* One field of a unit's form, as data. `type` names a control in the host's catalogue (`text`,
|
|
14
|
+
* `number`, `toggle`, `choice`, `choices`, `directory`, `secret`, `connection`) and is open: a host
|
|
15
|
+
* that doesn't know a type draws the plain control for `value`, the kind of value it holds.
|
|
16
|
+
*
|
|
17
|
+
* `value: "secret"` is what makes a field secret, whatever its type: it has no `default`, is read
|
|
18
|
+
* apart, is never saved in a template and is never read back; management refuses a value for one
|
|
19
|
+
* anywhere but a stack's `secrets`.
|
|
20
|
+
*
|
|
21
|
+
* `visible` shows it only when another field has one of the given values, or, for a field holding
|
|
22
|
+
* a list, includes one. A field that isn't shown has no value. `description` is written once, for a
|
|
23
|
+
* person and an agent alike.
|
|
24
|
+
*
|
|
25
|
+
* `adds`, on a choice's option or on a toggle (when on), is what that adds to what the unit gives.
|
|
26
|
+
* What a unit will give is worked out from this and the values, with no call to its logic. Field ids are unique in a form, and management refuses a form that isn't
|
|
27
|
+
* well made: a default of the wrong kind, a `visible` naming no field.
|
|
28
|
+
*/
|
|
29
|
+
export declare const Field: z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
type: z.ZodString;
|
|
32
|
+
value: z.ZodEnum<{
|
|
33
|
+
boolean: "boolean";
|
|
34
|
+
number: "number";
|
|
35
|
+
secret: "secret";
|
|
36
|
+
string: "string";
|
|
37
|
+
strings: "strings";
|
|
38
|
+
}>;
|
|
39
|
+
title: z.ZodString;
|
|
40
|
+
description: z.ZodOptional<z.ZodString>;
|
|
41
|
+
required: z.ZodOptional<z.ZodLiteral<true>>;
|
|
42
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
43
|
+
authority: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
contacts: "contacts";
|
|
45
|
+
holds: "holds";
|
|
46
|
+
instructs: "instructs";
|
|
47
|
+
runs: "runs";
|
|
48
|
+
setting: "setting";
|
|
49
|
+
}>>;
|
|
50
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
51
|
+
visible: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
field: z.ZodString;
|
|
53
|
+
in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
56
|
+
value: z.ZodString;
|
|
57
|
+
title: z.ZodString;
|
|
58
|
+
description: z.ZodOptional<z.ZodString>;
|
|
59
|
+
adds: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
63
|
+
field: z.ZodString;
|
|
64
|
+
}, z.core.$strict>]>>;
|
|
65
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
files: z.ZodArray<z.ZodString>;
|
|
68
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
69
|
+
field: z.ZodString;
|
|
70
|
+
}, z.core.$strict>]>>;
|
|
71
|
+
}, z.core.$strip>>;
|
|
72
|
+
}, z.core.$strip>>>;
|
|
73
|
+
adds: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
75
|
+
name: z.ZodString;
|
|
76
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
77
|
+
field: z.ZodString;
|
|
78
|
+
}, z.core.$strict>]>>;
|
|
79
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
80
|
+
name: z.ZodString;
|
|
81
|
+
files: z.ZodArray<z.ZodString>;
|
|
82
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
83
|
+
field: z.ZodString;
|
|
84
|
+
}, z.core.$strict>]>>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export declare const Form: z.ZodArray<z.ZodObject<{
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
type: z.ZodString;
|
|
94
|
+
value: z.ZodEnum<{
|
|
95
|
+
boolean: "boolean";
|
|
96
|
+
number: "number";
|
|
97
|
+
secret: "secret";
|
|
98
|
+
string: "string";
|
|
99
|
+
strings: "strings";
|
|
100
|
+
}>;
|
|
101
|
+
title: z.ZodString;
|
|
102
|
+
description: z.ZodOptional<z.ZodString>;
|
|
103
|
+
required: z.ZodOptional<z.ZodLiteral<true>>;
|
|
104
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
105
|
+
authority: z.ZodOptional<z.ZodEnum<{
|
|
106
|
+
contacts: "contacts";
|
|
107
|
+
holds: "holds";
|
|
108
|
+
instructs: "instructs";
|
|
109
|
+
runs: "runs";
|
|
110
|
+
setting: "setting";
|
|
111
|
+
}>>;
|
|
112
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
113
|
+
visible: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
field: z.ZodString;
|
|
115
|
+
in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
118
|
+
value: z.ZodString;
|
|
119
|
+
title: z.ZodString;
|
|
120
|
+
description: z.ZodOptional<z.ZodString>;
|
|
121
|
+
adds: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
123
|
+
name: z.ZodString;
|
|
124
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
125
|
+
field: z.ZodString;
|
|
126
|
+
}, z.core.$strict>]>>;
|
|
127
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
128
|
+
name: z.ZodString;
|
|
129
|
+
files: z.ZodArray<z.ZodString>;
|
|
130
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
131
|
+
field: z.ZodString;
|
|
132
|
+
}, z.core.$strict>]>>;
|
|
133
|
+
}, z.core.$strip>>;
|
|
134
|
+
}, z.core.$strip>>>;
|
|
135
|
+
adds: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
137
|
+
name: z.ZodString;
|
|
138
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
139
|
+
field: z.ZodString;
|
|
140
|
+
}, z.core.$strict>]>>;
|
|
141
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
142
|
+
name: z.ZodString;
|
|
143
|
+
files: z.ZodArray<z.ZodString>;
|
|
144
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
145
|
+
field: z.ZodString;
|
|
146
|
+
}, z.core.$strict>]>>;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strip>>;
|
|
153
|
+
/**
|
|
154
|
+
* A unit of an agent's stack: its form, what it needs from units above it, and what it gives
|
|
155
|
+
* whatever is filled in; a field's `adds` says what its answer gives on top.
|
|
156
|
+
*/
|
|
157
|
+
export declare const Unit: z.ZodObject<{
|
|
158
|
+
id: z.ZodString;
|
|
159
|
+
title: z.ZodString;
|
|
160
|
+
description: z.ZodString;
|
|
161
|
+
form: z.ZodArray<z.ZodObject<{
|
|
162
|
+
id: z.ZodString;
|
|
163
|
+
type: z.ZodString;
|
|
164
|
+
value: z.ZodEnum<{
|
|
165
|
+
boolean: "boolean";
|
|
166
|
+
number: "number";
|
|
167
|
+
secret: "secret";
|
|
168
|
+
string: "string";
|
|
169
|
+
strings: "strings";
|
|
170
|
+
}>;
|
|
171
|
+
title: z.ZodString;
|
|
172
|
+
description: z.ZodOptional<z.ZodString>;
|
|
173
|
+
required: z.ZodOptional<z.ZodLiteral<true>>;
|
|
174
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
175
|
+
authority: z.ZodOptional<z.ZodEnum<{
|
|
176
|
+
contacts: "contacts";
|
|
177
|
+
holds: "holds";
|
|
178
|
+
instructs: "instructs";
|
|
179
|
+
runs: "runs";
|
|
180
|
+
setting: "setting";
|
|
181
|
+
}>>;
|
|
182
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
183
|
+
visible: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
field: z.ZodString;
|
|
185
|
+
in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
188
|
+
value: z.ZodString;
|
|
189
|
+
title: z.ZodString;
|
|
190
|
+
description: z.ZodOptional<z.ZodString>;
|
|
191
|
+
adds: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
193
|
+
name: z.ZodString;
|
|
194
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
195
|
+
field: z.ZodString;
|
|
196
|
+
}, z.core.$strict>]>>;
|
|
197
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
198
|
+
name: z.ZodString;
|
|
199
|
+
files: z.ZodArray<z.ZodString>;
|
|
200
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
201
|
+
field: z.ZodString;
|
|
202
|
+
}, z.core.$strict>]>>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
204
|
+
}, z.core.$strip>>>;
|
|
205
|
+
adds: z.ZodOptional<z.ZodObject<{
|
|
206
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
207
|
+
name: z.ZodString;
|
|
208
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
209
|
+
field: z.ZodString;
|
|
210
|
+
}, z.core.$strict>]>>;
|
|
211
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
212
|
+
name: z.ZodString;
|
|
213
|
+
files: z.ZodArray<z.ZodString>;
|
|
214
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
215
|
+
field: z.ZodString;
|
|
216
|
+
}, z.core.$strict>]>>;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
219
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
needs: z.ZodArray<z.ZodString>;
|
|
224
|
+
gives: z.ZodObject<{
|
|
225
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
226
|
+
name: z.ZodString;
|
|
227
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
228
|
+
field: z.ZodString;
|
|
229
|
+
}, z.core.$strict>]>>;
|
|
230
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
231
|
+
name: z.ZodString;
|
|
232
|
+
files: z.ZodArray<z.ZodString>;
|
|
233
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
234
|
+
field: z.ZodString;
|
|
235
|
+
}, z.core.$strict>]>>;
|
|
236
|
+
results: z.ZodArray<z.ZodString>;
|
|
237
|
+
}, z.core.$strip>;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
|
+
/** A result of an applied unit, for units below it: an opaque handle. */
|
|
240
|
+
export declare const UnitResult: z.ZodObject<{
|
|
241
|
+
kind: z.ZodString;
|
|
242
|
+
handle: z.ZodString;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
/** A problem with what was filled in: on one field, or, with no `field`, on the whole. */
|
|
245
|
+
export declare const Problem: z.ZodObject<{
|
|
246
|
+
field: z.ZodOptional<z.ZodString>;
|
|
247
|
+
message: z.ZodString;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
/** Something of an instance that can be watched or operated live, in a protocol the page knows. */
|
|
250
|
+
export declare const LiveSurface: z.ZodObject<{
|
|
251
|
+
surface: z.ZodString;
|
|
252
|
+
protocol: z.ZodString;
|
|
253
|
+
operate: z.ZodBoolean;
|
|
254
|
+
unavailable: z.ZodOptional<z.ZodString>;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
export declare const LiveMode: z.ZodEnum<{
|
|
257
|
+
operate: "operate";
|
|
258
|
+
watch: "watch";
|
|
259
|
+
}>;
|
|
260
|
+
/** A one-time ticket to open a surface: a socket address that is its own authority, briefly. */
|
|
261
|
+
export declare const LiveTicket: z.ZodObject<{
|
|
262
|
+
url: z.ZodString;
|
|
263
|
+
protocol: z.ZodString;
|
|
264
|
+
expiresAt: z.ZodString;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
/**
|
|
267
|
+
* `unit.provider@1`: a program that offers units. Running one yields connections and the skills
|
|
268
|
+
* it declared; management exposes them and records the instance, and removes instances last first.
|
|
269
|
+
*
|
|
270
|
+
* Management checks `values` against the form before `check` or `apply` see them: defaults are
|
|
271
|
+
* applied and a field that isn't shown has no value. `secrets` reach `apply` only, once, and are
|
|
272
|
+
* never saved or read back. `status` and `remove` are refused `unknown` for an instance this
|
|
273
|
+
* provider doesn't hold. A unit removes only what it created.
|
|
274
|
+
*/
|
|
275
|
+
export declare const unitProvider: import("@agentorg/sdk").RpcInterface<"unit.provider", {
|
|
276
|
+
units: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
277
|
+
units: z.ZodArray<z.ZodObject<{
|
|
278
|
+
id: z.ZodString;
|
|
279
|
+
title: z.ZodString;
|
|
280
|
+
description: z.ZodString;
|
|
281
|
+
form: z.ZodArray<z.ZodObject<{
|
|
282
|
+
id: z.ZodString;
|
|
283
|
+
type: z.ZodString;
|
|
284
|
+
value: z.ZodEnum<{
|
|
285
|
+
boolean: "boolean";
|
|
286
|
+
number: "number";
|
|
287
|
+
secret: "secret";
|
|
288
|
+
string: "string";
|
|
289
|
+
strings: "strings";
|
|
290
|
+
}>;
|
|
291
|
+
title: z.ZodString;
|
|
292
|
+
description: z.ZodOptional<z.ZodString>;
|
|
293
|
+
required: z.ZodOptional<z.ZodLiteral<true>>;
|
|
294
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
295
|
+
authority: z.ZodOptional<z.ZodEnum<{
|
|
296
|
+
contacts: "contacts";
|
|
297
|
+
holds: "holds";
|
|
298
|
+
instructs: "instructs";
|
|
299
|
+
runs: "runs";
|
|
300
|
+
setting: "setting";
|
|
301
|
+
}>>;
|
|
302
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
303
|
+
visible: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
field: z.ZodString;
|
|
305
|
+
in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
306
|
+
}, z.core.$strip>>;
|
|
307
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
308
|
+
value: z.ZodString;
|
|
309
|
+
title: z.ZodString;
|
|
310
|
+
description: z.ZodOptional<z.ZodString>;
|
|
311
|
+
adds: z.ZodOptional<z.ZodObject<{
|
|
312
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
313
|
+
name: z.ZodString;
|
|
314
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
315
|
+
field: z.ZodString;
|
|
316
|
+
}, z.core.$strict>]>>;
|
|
317
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
318
|
+
name: z.ZodString;
|
|
319
|
+
files: z.ZodArray<z.ZodString>;
|
|
320
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
321
|
+
field: z.ZodString;
|
|
322
|
+
}, z.core.$strict>]>>;
|
|
323
|
+
}, z.core.$strip>>;
|
|
324
|
+
}, z.core.$strip>>>;
|
|
325
|
+
adds: z.ZodOptional<z.ZodObject<{
|
|
326
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
327
|
+
name: z.ZodString;
|
|
328
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
329
|
+
field: z.ZodString;
|
|
330
|
+
}, z.core.$strict>]>>;
|
|
331
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
332
|
+
name: z.ZodString;
|
|
333
|
+
files: z.ZodArray<z.ZodString>;
|
|
334
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
335
|
+
field: z.ZodString;
|
|
336
|
+
}, z.core.$strict>]>>;
|
|
337
|
+
}, z.core.$strip>>;
|
|
338
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
339
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
340
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
341
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
342
|
+
}, z.core.$strip>>;
|
|
343
|
+
needs: z.ZodArray<z.ZodString>;
|
|
344
|
+
gives: z.ZodObject<{
|
|
345
|
+
slots: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
346
|
+
name: z.ZodString;
|
|
347
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
348
|
+
field: z.ZodString;
|
|
349
|
+
}, z.core.$strict>]>>;
|
|
350
|
+
skills: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
351
|
+
name: z.ZodString;
|
|
352
|
+
files: z.ZodArray<z.ZodString>;
|
|
353
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
354
|
+
field: z.ZodString;
|
|
355
|
+
}, z.core.$strict>]>>;
|
|
356
|
+
results: z.ZodArray<z.ZodString>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
}, z.core.$strip>>;
|
|
359
|
+
}, z.core.$strip>>;
|
|
360
|
+
/** A file of a skill a unit comes with. Refused `unknown` when there is no such file. */
|
|
361
|
+
skill: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
362
|
+
unit: z.ZodString;
|
|
363
|
+
name: z.ZodString;
|
|
364
|
+
path: z.ZodString;
|
|
365
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
366
|
+
text: z.ZodString;
|
|
367
|
+
}, z.core.$strip>>;
|
|
368
|
+
/**
|
|
369
|
+
* The unit's own validation of what was filled in. It changes nothing. `secrets` names the
|
|
370
|
+
* secret fields filled in, never their values.
|
|
371
|
+
*/
|
|
372
|
+
check: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
373
|
+
unit: z.ZodString;
|
|
374
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
375
|
+
secrets: z.ZodArray<z.ZodString>;
|
|
376
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
377
|
+
problems: z.ZodArray<z.ZodObject<{
|
|
378
|
+
field: z.ZodOptional<z.ZodString>;
|
|
379
|
+
message: z.ZodString;
|
|
380
|
+
}, z.core.$strip>>;
|
|
381
|
+
}, z.core.$strip>>;
|
|
382
|
+
/**
|
|
383
|
+
* Run a unit for an agent. `needs` holds the handle of each result it needs, by kind. `name` is
|
|
384
|
+
* for what it makes to show: an Actor's name. Each connection is an Actor exporting `tools@1`
|
|
385
|
+
* as `tools`, for management to expose under `slot`. The slots must be those the description
|
|
386
|
+
* and the values work out to, or management undoes the creation. `agent` is `person` for a
|
|
387
|
+
* connection the person makes for no agent yet.
|
|
388
|
+
*/
|
|
389
|
+
apply: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
390
|
+
unit: z.ZodString;
|
|
391
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
392
|
+
secrets: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
393
|
+
needs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
394
|
+
agent: z.ZodString;
|
|
395
|
+
name: z.ZodString;
|
|
396
|
+
agentName: z.ZodOptional<z.ZodString>;
|
|
397
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
398
|
+
instance: z.ZodString;
|
|
399
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
400
|
+
slot: z.ZodString;
|
|
401
|
+
connection: z.ZodString;
|
|
402
|
+
target: z.ZodString;
|
|
403
|
+
}, z.core.$strip>>;
|
|
404
|
+
results: z.ZodArray<z.ZodObject<{
|
|
405
|
+
kind: z.ZodString;
|
|
406
|
+
handle: z.ZodString;
|
|
407
|
+
}, z.core.$strip>>;
|
|
408
|
+
}, z.core.$strip>>;
|
|
409
|
+
/** How the instance stands now, with each of its connections' own. */
|
|
410
|
+
status: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
411
|
+
instance: z.ZodString;
|
|
412
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
413
|
+
state: z.ZodEnum<{
|
|
414
|
+
connected: "connected";
|
|
415
|
+
connecting: "connecting";
|
|
416
|
+
down: "down";
|
|
417
|
+
}>;
|
|
418
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
419
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
420
|
+
state: z.ZodEnum<{
|
|
421
|
+
connected: "connected";
|
|
422
|
+
connecting: "connecting";
|
|
423
|
+
down: "down";
|
|
424
|
+
}>;
|
|
425
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
426
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
427
|
+
name: z.ZodString;
|
|
428
|
+
description: z.ZodOptional<z.ZodString>;
|
|
429
|
+
}, z.core.$strip>>;
|
|
430
|
+
connection: z.ZodString;
|
|
431
|
+
}, z.core.$strip>>;
|
|
432
|
+
surfaces: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
433
|
+
surface: z.ZodString;
|
|
434
|
+
protocol: z.ZodString;
|
|
435
|
+
operate: z.ZodBoolean;
|
|
436
|
+
unavailable: z.ZodOptional<z.ZodString>;
|
|
437
|
+
}, z.core.$strip>>>;
|
|
438
|
+
}, z.core.$strip>>;
|
|
439
|
+
/**
|
|
440
|
+
* A one-time ticket to open one of its surfaces live. Only the person's gateway asks for one,
|
|
441
|
+
* and it dials the url itself: no ticket reaches a page. Refused `unknown` for a surface the
|
|
442
|
+
* instance doesn't have.
|
|
443
|
+
*/
|
|
444
|
+
live: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
445
|
+
instance: z.ZodString;
|
|
446
|
+
surface: z.ZodString;
|
|
447
|
+
mode: z.ZodEnum<{
|
|
448
|
+
operate: "operate";
|
|
449
|
+
watch: "watch";
|
|
450
|
+
}>;
|
|
451
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
452
|
+
url: z.ZodString;
|
|
453
|
+
protocol: z.ZodString;
|
|
454
|
+
expiresAt: z.ZodString;
|
|
455
|
+
}, z.core.$strip>>;
|
|
456
|
+
/** Final: it undoes what this instance made, and nothing the person pointed it at. */
|
|
457
|
+
remove: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
458
|
+
instance: z.ZodString;
|
|
459
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
460
|
+
}, {}, 1>;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { defineInterface, method } from "@agentorg/sdk";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { SKILL_FILE_MAX, SkillName, SkillPath } from "./agent-settings.js";
|
|
4
|
+
import { ConnectionSecrets, ConnectionStatus, ConnectionTarget } from "./connection.js";
|
|
5
|
+
import { Id, SlotName } from "./hub.js";
|
|
6
|
+
const Slug = z
|
|
7
|
+
.string()
|
|
8
|
+
.regex(/^[a-z][a-z0-9-]*$/)
|
|
9
|
+
.max(64);
|
|
10
|
+
const Title = z.string().min(1).max(128);
|
|
11
|
+
const Description = z.string().max(2000);
|
|
12
|
+
/** A unit's id, unique within its provider. */
|
|
13
|
+
export const UnitId = Slug;
|
|
14
|
+
/** A field's id: the key of its value. */
|
|
15
|
+
export const FieldId = z
|
|
16
|
+
.string()
|
|
17
|
+
.regex(/^[a-z][A-Za-z0-9_]*$/)
|
|
18
|
+
.max(64);
|
|
19
|
+
/** What a result is, such as `computer`. Only a unit of the same provider can take one for now. */
|
|
20
|
+
export const ResultKind = Slug;
|
|
21
|
+
/** A field's value. */
|
|
22
|
+
export const FieldValue = z.union([
|
|
23
|
+
z.string().max(4096),
|
|
24
|
+
z.number(),
|
|
25
|
+
z.boolean(),
|
|
26
|
+
z.array(z.string().max(4096)).max(256),
|
|
27
|
+
]);
|
|
28
|
+
/** What was filled in, by field id. A field with no value isn't here. */
|
|
29
|
+
export const FieldValues = z.record(FieldId, FieldValue);
|
|
30
|
+
/** Slots and skills. A slot's or a skill's name is fixed, or, with `field`, that field's value. */
|
|
31
|
+
const Gives = z.object({
|
|
32
|
+
slots: z
|
|
33
|
+
.array(z.union([z.strictObject({ name: SlotName }), z.strictObject({ field: FieldId })]))
|
|
34
|
+
.max(32),
|
|
35
|
+
skills: z
|
|
36
|
+
.array(z.union([
|
|
37
|
+
z.strictObject({ name: SkillName, files: z.array(SkillPath).min(1).max(256) }),
|
|
38
|
+
z.strictObject({ field: FieldId }),
|
|
39
|
+
]))
|
|
40
|
+
.max(64),
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* One field of a unit's form, as data. `type` names a control in the host's catalogue (`text`,
|
|
44
|
+
* `number`, `toggle`, `choice`, `choices`, `directory`, `secret`, `connection`) and is open: a host
|
|
45
|
+
* that doesn't know a type draws the plain control for `value`, the kind of value it holds.
|
|
46
|
+
*
|
|
47
|
+
* `value: "secret"` is what makes a field secret, whatever its type: it has no `default`, is read
|
|
48
|
+
* apart, is never saved in a template and is never read back; management refuses a value for one
|
|
49
|
+
* anywhere but a stack's `secrets`.
|
|
50
|
+
*
|
|
51
|
+
* `visible` shows it only when another field has one of the given values, or, for a field holding
|
|
52
|
+
* a list, includes one. A field that isn't shown has no value. `description` is written once, for a
|
|
53
|
+
* person and an agent alike.
|
|
54
|
+
*
|
|
55
|
+
* `adds`, on a choice's option or on a toggle (when on), is what that adds to what the unit gives.
|
|
56
|
+
* What a unit will give is worked out from this and the values, with no call to its logic. Field ids are unique in a form, and management refuses a form that isn't
|
|
57
|
+
* well made: a default of the wrong kind, a `visible` naming no field.
|
|
58
|
+
*/
|
|
59
|
+
export const Field = z.object({
|
|
60
|
+
id: FieldId,
|
|
61
|
+
type: Slug,
|
|
62
|
+
value: z.enum(["string", "number", "boolean", "strings", "secret"]),
|
|
63
|
+
title: Title,
|
|
64
|
+
description: Description.optional(),
|
|
65
|
+
required: z.literal(true).optional(),
|
|
66
|
+
default: FieldValue.optional(),
|
|
67
|
+
/**
|
|
68
|
+
* What an agent may do with this field, by what it says. `setting`: how the unit works, within
|
|
69
|
+
* bounds. `holds`: something the person already has. `contacts`: an address to reach. `instructs`:
|
|
70
|
+
* text that will steer an agent. `runs`: a program to start with someone's rights, which an
|
|
71
|
+
* agent may never set. With none, no agent may set it.
|
|
72
|
+
*/
|
|
73
|
+
authority: z.enum(["setting", "holds", "contacts", "instructs", "runs"]).optional(),
|
|
74
|
+
/** Greyed text of an empty field, saying what leaving it empty does. `{name}` is the agent's name. */
|
|
75
|
+
placeholder: z.string().max(256).optional(),
|
|
76
|
+
visible: z.object({ field: FieldId, in: z.array(FieldValue).min(1).max(64) }).optional(),
|
|
77
|
+
options: z
|
|
78
|
+
.array(z.object({
|
|
79
|
+
value: z.string().max(256),
|
|
80
|
+
title: Title,
|
|
81
|
+
description: Description.optional(),
|
|
82
|
+
adds: Gives.optional(),
|
|
83
|
+
}))
|
|
84
|
+
.max(256)
|
|
85
|
+
.optional(),
|
|
86
|
+
adds: Gives.optional(),
|
|
87
|
+
min: z.number().optional(),
|
|
88
|
+
max: z.number().optional(),
|
|
89
|
+
step: z.number().optional(),
|
|
90
|
+
unit: z.string().max(32).optional(),
|
|
91
|
+
});
|
|
92
|
+
export const Form = z.array(Field).max(64);
|
|
93
|
+
/**
|
|
94
|
+
* A unit of an agent's stack: its form, what it needs from units above it, and what it gives
|
|
95
|
+
* whatever is filled in; a field's `adds` says what its answer gives on top.
|
|
96
|
+
*/
|
|
97
|
+
export const Unit = z.object({
|
|
98
|
+
id: UnitId,
|
|
99
|
+
title: Title,
|
|
100
|
+
description: Description,
|
|
101
|
+
form: Form,
|
|
102
|
+
needs: z.array(ResultKind).max(16),
|
|
103
|
+
gives: Gives.extend({ results: z.array(ResultKind).max(16) }),
|
|
104
|
+
});
|
|
105
|
+
/** A result of an applied unit, for units below it: an opaque handle. */
|
|
106
|
+
export const UnitResult = z.object({ kind: ResultKind, handle: z.string().min(1).max(4096) });
|
|
107
|
+
/** A problem with what was filled in: on one field, or, with no `field`, on the whole. */
|
|
108
|
+
export const Problem = z.object({ field: FieldId.optional(), message: z.string().max(2000) });
|
|
109
|
+
const OnInstance = z.object({ instance: Id });
|
|
110
|
+
/** Something of an instance that can be watched or operated live, in a protocol the page knows. */
|
|
111
|
+
export const LiveSurface = z.object({
|
|
112
|
+
surface: Slug,
|
|
113
|
+
/** The frames it speaks, such as `terminal@1`, `files@1` or `screencast@1`. */
|
|
114
|
+
protocol: z.string().min(1).max(64),
|
|
115
|
+
/** Whether it can be operated, not only watched. */
|
|
116
|
+
operate: z.boolean(),
|
|
117
|
+
/** Why it can't be opened here, if it can't. */
|
|
118
|
+
unavailable: z.string().max(2000).optional(),
|
|
119
|
+
});
|
|
120
|
+
export const LiveMode = z.enum(["watch", "operate"]);
|
|
121
|
+
/** A one-time ticket to open a surface: a socket address that is its own authority, briefly. */
|
|
122
|
+
export const LiveTicket = z.object({
|
|
123
|
+
url: z.string().min(1).max(4096),
|
|
124
|
+
protocol: z.string().min(1).max(64),
|
|
125
|
+
expiresAt: z.string().max(64),
|
|
126
|
+
});
|
|
127
|
+
/**
|
|
128
|
+
* `unit.provider@1`: a program that offers units. Running one yields connections and the skills
|
|
129
|
+
* it declared; management exposes them and records the instance, and removes instances last first.
|
|
130
|
+
*
|
|
131
|
+
* Management checks `values` against the form before `check` or `apply` see them: defaults are
|
|
132
|
+
* applied and a field that isn't shown has no value. `secrets` reach `apply` only, once, and are
|
|
133
|
+
* never saved or read back. `status` and `remove` are refused `unknown` for an instance this
|
|
134
|
+
* provider doesn't hold. A unit removes only what it created.
|
|
135
|
+
*/
|
|
136
|
+
export const unitProvider = defineInterface({
|
|
137
|
+
name: "unit.provider",
|
|
138
|
+
major: 1,
|
|
139
|
+
kind: "rpc",
|
|
140
|
+
methods: {
|
|
141
|
+
units: method({ input: z.object({}), output: z.object({ units: z.array(Unit) }) }),
|
|
142
|
+
/** A file of a skill a unit comes with. Refused `unknown` when there is no such file. */
|
|
143
|
+
skill: method({
|
|
144
|
+
input: z.object({ unit: UnitId, name: SkillName, path: SkillPath }),
|
|
145
|
+
output: z.object({ text: z.string().max(SKILL_FILE_MAX) }),
|
|
146
|
+
}),
|
|
147
|
+
/**
|
|
148
|
+
* The unit's own validation of what was filled in. It changes nothing. `secrets` names the
|
|
149
|
+
* secret fields filled in, never their values.
|
|
150
|
+
*/
|
|
151
|
+
check: method({
|
|
152
|
+
input: z.object({ unit: UnitId, values: FieldValues, secrets: z.array(FieldId).max(64) }),
|
|
153
|
+
output: z.object({ problems: z.array(Problem).max(64) }),
|
|
154
|
+
}),
|
|
155
|
+
/**
|
|
156
|
+
* Run a unit for an agent. `needs` holds the handle of each result it needs, by kind. `name` is
|
|
157
|
+
* for what it makes to show: an Actor's name. Each connection is an Actor exporting `tools@1`
|
|
158
|
+
* as `tools`, for management to expose under `slot`. The slots must be those the description
|
|
159
|
+
* and the values work out to, or management undoes the creation. `agent` is `person` for a
|
|
160
|
+
* connection the person makes for no agent yet.
|
|
161
|
+
*/
|
|
162
|
+
apply: method({
|
|
163
|
+
input: z.object({
|
|
164
|
+
unit: UnitId,
|
|
165
|
+
values: FieldValues,
|
|
166
|
+
secrets: ConnectionSecrets,
|
|
167
|
+
needs: z.record(ResultKind, z.string().min(1).max(4096)),
|
|
168
|
+
agent: Id,
|
|
169
|
+
name: Title,
|
|
170
|
+
/** The name the person gave the agent. None for an agent an agent made, or for no agent. */
|
|
171
|
+
agentName: Title.optional(),
|
|
172
|
+
}),
|
|
173
|
+
output: z.object({
|
|
174
|
+
instance: Id,
|
|
175
|
+
connections: z
|
|
176
|
+
.array(z.object({ slot: SlotName, connection: Id, target: ConnectionTarget }))
|
|
177
|
+
.max(32),
|
|
178
|
+
results: z.array(UnitResult).max(16),
|
|
179
|
+
}),
|
|
180
|
+
}),
|
|
181
|
+
/** How the instance stands now, with each of its connections' own. */
|
|
182
|
+
status: method({
|
|
183
|
+
input: OnInstance,
|
|
184
|
+
output: z.object({
|
|
185
|
+
state: ConnectionStatus.shape.state,
|
|
186
|
+
detail: z.string().max(2000).optional(),
|
|
187
|
+
connections: z.array(ConnectionStatus.extend({ connection: Id })).max(32),
|
|
188
|
+
/** What of it can be opened live now. */
|
|
189
|
+
surfaces: z.array(LiveSurface).max(16).optional(),
|
|
190
|
+
}),
|
|
191
|
+
}),
|
|
192
|
+
/**
|
|
193
|
+
* A one-time ticket to open one of its surfaces live. Only the person's gateway asks for one,
|
|
194
|
+
* and it dials the url itself: no ticket reaches a page. Refused `unknown` for a surface the
|
|
195
|
+
* instance doesn't have.
|
|
196
|
+
*/
|
|
197
|
+
live: method({
|
|
198
|
+
input: OnInstance.extend({ surface: Slug, mode: LiveMode }),
|
|
199
|
+
output: LiveTicket,
|
|
200
|
+
}),
|
|
201
|
+
/** Final: it undoes what this instance made, and nothing the person pointed it at. */
|
|
202
|
+
remove: method({ input: OnInstance, output: z.object({}) }),
|
|
203
|
+
},
|
|
204
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { MAX_CALLS } from "./loop.js";
|
|
2
|
+
export { createLooper, type Looper, type LooperOut, PLACES, WAITING } from "./looper.js";
|
|
3
|
+
export { Entry, INPUT_BUDGET, textOf } from "./record.js";
|
|
4
|
+
export { capped, MAX_OUTPUT } from "./tools.js";
|
|
5
|
+
export { Item, type Json, type Log, type Model, type Outcome, type OutputItem, Refusal, type Shown, type Status, type Store, type Tool, type ToolSpec, } from "./types.js";
|