@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
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/** The longest title a chat has. */
|
|
3
|
+
export declare const CHAT_TITLE_MAX = 200;
|
|
2
4
|
/**
|
|
3
5
|
* A tool call a `tool` message stands for: its name, whether it is `running` or ended `done` or
|
|
4
6
|
* `refused`, and its input (the call's JSON arguments) and output (its JSON result, or the
|
|
@@ -39,44 +41,60 @@ export declare const ChatMessage: z.ZodObject<{
|
|
|
39
41
|
output: z.ZodOptional<z.ZodString>;
|
|
40
42
|
}, z.core.$strip>>;
|
|
41
43
|
}, z.core.$strip>;
|
|
42
|
-
|
|
43
|
-
error: "error";
|
|
44
|
-
idle: "idle";
|
|
45
|
-
thinking: "thinking";
|
|
46
|
-
tool: "tool";
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* What the agent is doing. On `error`, `detail.code` is the refusal's code, such as the model's
|
|
50
|
-
* `usage_limit` or `not_signed_in`, so a view can offer the right action.
|
|
51
|
-
*/
|
|
44
|
+
/** What the agent is doing: `working` while it answers anything, in any chat. */
|
|
52
45
|
export declare const ChatStatus: z.ZodObject<{
|
|
53
46
|
state: z.ZodEnum<{
|
|
54
|
-
error: "error";
|
|
55
47
|
idle: "idle";
|
|
56
|
-
|
|
57
|
-
tool: "tool";
|
|
48
|
+
working: "working";
|
|
58
49
|
}>;
|
|
59
|
-
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
/**
|
|
52
|
+
* One of an agent's chats, as a list shows it. Its `title` is its first message's first line until
|
|
53
|
+
* it is renamed. `latest` is its newest reply, so a view can tell what is new without reading the
|
|
54
|
+
* chat. `problem` is there while a message in it got no answer, until its next reply.
|
|
55
|
+
*/
|
|
56
|
+
export declare const ChatEntry: z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
title: z.ZodString;
|
|
59
|
+
at: z.ZodString;
|
|
60
|
+
latest: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
at: z.ZodString;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
problem: z.ZodOptional<z.ZodObject<{
|
|
60
65
|
code: z.ZodString;
|
|
61
66
|
message: z.ZodString;
|
|
62
67
|
}, z.core.$strip>>;
|
|
68
|
+
archived: z.ZodBoolean;
|
|
63
69
|
}, z.core.$strip>;
|
|
64
70
|
/**
|
|
65
|
-
* `chat@1`:
|
|
66
|
-
*
|
|
67
|
-
*
|
|
71
|
+
* `chat@1`: an agent's chats. A chat is the messages sent in it and nothing more: `send` with no
|
|
72
|
+
* `chat` starts one, and with one, goes on in it. Messages and streaming text arrive as events,
|
|
73
|
+
* each naming its chat. What works is the agent, not a chat: `status` says when it starts and
|
|
74
|
+
* when it is done. Events are live only: `history` is a chat's record, `state` the agent's status
|
|
75
|
+
* now, and `list` the chats. A provider that can't take
|
|
76
|
+
* a message now refuses it `busy`. A call naming a chat the agent doesn't have is refused
|
|
77
|
+
* `unknown`.
|
|
68
78
|
*/
|
|
69
79
|
export declare const chat: import("@agentorg/sdk").RpcInterface<"chat", {
|
|
80
|
+
/**
|
|
81
|
+
* Send this message in `chat`, or in a new chat; the result says which. The agent answers it
|
|
82
|
+
* in that chat. An archived chat takes a message like any other, and stays archived. Refused
|
|
83
|
+
* `busy` when the provider can't take it now.
|
|
84
|
+
*/
|
|
70
85
|
send: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
86
|
+
chat: z.ZodOptional<z.ZodString>;
|
|
71
87
|
text: z.ZodString;
|
|
72
88
|
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
chat: z.ZodString;
|
|
73
90
|
messageId: z.ZodString;
|
|
74
91
|
}, z.core.$strip>>;
|
|
75
92
|
/**
|
|
76
|
-
*
|
|
77
|
-
* provider returns fewer than `limit` when a page would not fit one frame.
|
|
93
|
+
* A chat's messages before `before` (or the newest), oldest first; `more` when older ones
|
|
94
|
+
* remain. A provider returns fewer than `limit` when a page would not fit one frame.
|
|
78
95
|
*/
|
|
79
96
|
history: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
97
|
+
chat: z.ZodString;
|
|
80
98
|
before: z.ZodOptional<z.ZodString>;
|
|
81
99
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
82
100
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -102,43 +120,50 @@ export declare const chat: import("@agentorg/sdk").RpcInterface<"chat", {
|
|
|
102
120
|
}, z.core.$strip>>;
|
|
103
121
|
more: z.ZodBoolean;
|
|
104
122
|
}, z.core.$strip>>;
|
|
105
|
-
/**
|
|
106
|
-
cancel: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
107
|
-
/** The status now, as the latest `status` event said; for a view opened mid-turn. */
|
|
123
|
+
/** The agent's status now, as its latest `status` event said; for a view opened late. */
|
|
108
124
|
state: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
109
125
|
state: z.ZodEnum<{
|
|
110
|
-
error: "error";
|
|
111
126
|
idle: "idle";
|
|
112
|
-
|
|
113
|
-
tool: "tool";
|
|
127
|
+
working: "working";
|
|
114
128
|
}>;
|
|
115
|
-
detail: z.ZodOptional<z.ZodObject<{
|
|
116
|
-
code: z.ZodString;
|
|
117
|
-
message: z.ZodString;
|
|
118
|
-
}, z.core.$strip>>;
|
|
119
129
|
}, z.core.$strip>>;
|
|
120
130
|
/**
|
|
121
|
-
*
|
|
122
|
-
* `
|
|
123
|
-
* message
|
|
131
|
+
* The chats after `before` in the list (or from its start), newest first by their last
|
|
132
|
+
* message; `more` when others follow. Those not archived, or with `archived`, those that are.
|
|
133
|
+
* A message sent in a chat moves it to the front, so a later page may repeat a chat that
|
|
134
|
+
* moved, and never leaves out one that didn't: the `chat` event says each that did. A `before`
|
|
135
|
+
* the agent doesn't have gives an empty page.
|
|
124
136
|
*/
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
list: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
138
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
before: z.ZodOptional<z.ZodString>;
|
|
140
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
+
chats: z.ZodArray<z.ZodObject<{
|
|
131
143
|
id: z.ZodString;
|
|
132
|
-
|
|
144
|
+
title: z.ZodString;
|
|
145
|
+
at: z.ZodString;
|
|
146
|
+
latest: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
at: z.ZodString;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
problem: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
code: z.ZodString;
|
|
152
|
+
message: z.ZodString;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
archived: z.ZodBoolean;
|
|
133
155
|
}, z.core.$strip>>;
|
|
134
|
-
|
|
156
|
+
more: z.ZodBoolean;
|
|
135
157
|
}, z.core.$strip>>;
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
158
|
+
/** Give a chat another title: one line, so only the first line of `title` is kept. */
|
|
159
|
+
rename: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
160
|
+
chat: z.ZodString;
|
|
161
|
+
title: z.ZodString;
|
|
162
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
163
|
+
/** Put a chat among the archived ones, or back. It stays readable either way. */
|
|
164
|
+
archive: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
165
|
+
chat: z.ZodString;
|
|
166
|
+
archived: z.ZodBoolean;
|
|
142
167
|
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
143
168
|
}, {
|
|
144
169
|
message: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
@@ -160,22 +185,37 @@ export declare const chat: import("@agentorg/sdk").RpcInterface<"chat", {
|
|
|
160
185
|
input: z.ZodOptional<z.ZodString>;
|
|
161
186
|
output: z.ZodOptional<z.ZodString>;
|
|
162
187
|
}, z.core.$strip>>;
|
|
188
|
+
chat: z.ZodString;
|
|
163
189
|
}, z.core.$strip>>;
|
|
164
190
|
/** Text of the assistant message `id`, as it streams; its `message` event follows. */
|
|
165
191
|
delta: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
192
|
+
chat: z.ZodString;
|
|
166
193
|
id: z.ZodString;
|
|
167
194
|
text: z.ZodString;
|
|
168
195
|
}, z.core.$strip>>;
|
|
196
|
+
/** The agent's status, when it changes. */
|
|
169
197
|
status: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
170
198
|
state: z.ZodEnum<{
|
|
171
|
-
error: "error";
|
|
172
199
|
idle: "idle";
|
|
173
|
-
|
|
174
|
-
tool: "tool";
|
|
200
|
+
working: "working";
|
|
175
201
|
}>;
|
|
176
|
-
|
|
202
|
+
}, z.core.$strip>>;
|
|
203
|
+
/**
|
|
204
|
+
* A chat as it now is: it was started, renamed or archived, a message was sent in it, or one
|
|
205
|
+
* got no answer.
|
|
206
|
+
*/
|
|
207
|
+
chat: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
208
|
+
id: z.ZodString;
|
|
209
|
+
title: z.ZodString;
|
|
210
|
+
at: z.ZodString;
|
|
211
|
+
latest: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
id: z.ZodString;
|
|
213
|
+
at: z.ZodString;
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
problem: z.ZodOptional<z.ZodObject<{
|
|
177
216
|
code: z.ZodString;
|
|
178
217
|
message: z.ZodString;
|
|
179
218
|
}, z.core.$strip>>;
|
|
219
|
+
archived: z.ZodBoolean;
|
|
180
220
|
}, z.core.$strip>>;
|
|
181
221
|
}, 1>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { defineInterface, event, method } from "@agentorg/sdk";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
const MessageId = z.string().min(1).max(128);
|
|
4
|
-
const
|
|
4
|
+
const ChatId = z.string().min(1).max(128);
|
|
5
|
+
/** The longest title a chat has. */
|
|
6
|
+
export const CHAT_TITLE_MAX = 200;
|
|
7
|
+
/** One chat of an agent's, where a call names it. */
|
|
8
|
+
const OnChat = z.object({ chat: ChatId });
|
|
5
9
|
/**
|
|
6
10
|
* A tool call a `tool` message stands for: its name, whether it is `running` or ended `done` or
|
|
7
11
|
* `refused`, and its input (the call's JSON arguments) and output (its JSON result, or the
|
|
@@ -26,68 +30,99 @@ export const ChatMessage = z.object({
|
|
|
26
30
|
at: z.string().max(64),
|
|
27
31
|
tool: ChatTool.optional(),
|
|
28
32
|
});
|
|
29
|
-
|
|
33
|
+
/** What the agent is doing: `working` while it answers anything, in any chat. */
|
|
34
|
+
export const ChatStatus = z.object({ state: z.enum(["idle", "working"]) });
|
|
30
35
|
/**
|
|
31
|
-
*
|
|
36
|
+
* Why a message in a chat got no answer. `code` is the refusal's code, such as the model's
|
|
32
37
|
* `usage_limit` or `not_signed_in`, so a view can offer the right action.
|
|
33
38
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
const ChatProblem = z.object({ code: z.string().max(128), message: z.string().max(2000) });
|
|
40
|
+
/**
|
|
41
|
+
* One of an agent's chats, as a list shows it. Its `title` is its first message's first line until
|
|
42
|
+
* it is renamed. `latest` is its newest reply, so a view can tell what is new without reading the
|
|
43
|
+
* chat. `problem` is there while a message in it got no answer, until its next reply.
|
|
44
|
+
*/
|
|
45
|
+
export const ChatEntry = z.object({
|
|
46
|
+
id: ChatId,
|
|
47
|
+
title: z.string().max(CHAT_TITLE_MAX),
|
|
48
|
+
/** When it started: an ISO 8601 time. */
|
|
49
|
+
at: z.string().max(64),
|
|
50
|
+
latest: z.object({ id: MessageId, at: z.string().max(64) }).optional(),
|
|
51
|
+
problem: ChatProblem.optional(),
|
|
52
|
+
archived: z.boolean(),
|
|
37
53
|
});
|
|
38
54
|
/**
|
|
39
|
-
* `chat@1`:
|
|
40
|
-
*
|
|
41
|
-
*
|
|
55
|
+
* `chat@1`: an agent's chats. A chat is the messages sent in it and nothing more: `send` with no
|
|
56
|
+
* `chat` starts one, and with one, goes on in it. Messages and streaming text arrive as events,
|
|
57
|
+
* each naming its chat. What works is the agent, not a chat: `status` says when it starts and
|
|
58
|
+
* when it is done. Events are live only: `history` is a chat's record, `state` the agent's status
|
|
59
|
+
* now, and `list` the chats. A provider that can't take
|
|
60
|
+
* a message now refuses it `busy`. A call naming a chat the agent doesn't have is refused
|
|
61
|
+
* `unknown`.
|
|
42
62
|
*/
|
|
43
63
|
export const chat = defineInterface({
|
|
44
64
|
name: "chat",
|
|
45
65
|
major: 1,
|
|
46
66
|
kind: "rpc",
|
|
47
67
|
methods: {
|
|
68
|
+
/**
|
|
69
|
+
* Send this message in `chat`, or in a new chat; the result says which. The agent answers it
|
|
70
|
+
* in that chat. An archived chat takes a message like any other, and stays archived. Refused
|
|
71
|
+
* `busy` when the provider can't take it now.
|
|
72
|
+
*/
|
|
48
73
|
send: method({
|
|
49
|
-
input: z.object({
|
|
50
|
-
|
|
74
|
+
input: z.object({
|
|
75
|
+
chat: ChatId.optional(),
|
|
76
|
+
text: z.string().min(1).max(100_000).regex(/\S/),
|
|
77
|
+
}),
|
|
78
|
+
output: z.object({ chat: ChatId, messageId: MessageId }),
|
|
51
79
|
}),
|
|
52
80
|
/**
|
|
53
|
-
*
|
|
54
|
-
* provider returns fewer than `limit` when a page would not fit one frame.
|
|
81
|
+
* A chat's messages before `before` (or the newest), oldest first; `more` when older ones
|
|
82
|
+
* remain. A provider returns fewer than `limit` when a page would not fit one frame.
|
|
55
83
|
*/
|
|
56
84
|
history: method({
|
|
57
|
-
input:
|
|
85
|
+
input: OnChat.extend({
|
|
58
86
|
before: MessageId.optional(),
|
|
59
87
|
limit: z.number().int().min(1).max(200).optional(),
|
|
60
88
|
}),
|
|
61
89
|
output: z.object({ messages: z.array(ChatMessage), more: z.boolean() }),
|
|
62
90
|
}),
|
|
63
|
-
/**
|
|
64
|
-
cancel: method({ input: z.object({}), output: z.object({}) }),
|
|
65
|
-
/** The status now, as the latest `status` event said; for a view opened mid-turn. */
|
|
91
|
+
/** The agent's status now, as its latest `status` event said; for a view opened late. */
|
|
66
92
|
state: method({ input: z.object({}), output: ChatStatus }),
|
|
67
93
|
/**
|
|
68
|
-
*
|
|
69
|
-
* `
|
|
70
|
-
* message
|
|
94
|
+
* The chats after `before` in the list (or from its start), newest first by their last
|
|
95
|
+
* message; `more` when others follow. Those not archived, or with `archived`, those that are.
|
|
96
|
+
* A message sent in a chat moves it to the front, so a later page may repeat a chat that
|
|
97
|
+
* moved, and never leaves out one that didn't: the `chat` event says each that did. A `before`
|
|
98
|
+
* the agent doesn't have gives an empty page.
|
|
71
99
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
models: z.array(z.object({ id: ChatModelId, name: z.string().max(256) })),
|
|
78
|
-
current: ChatModelId.optional(),
|
|
100
|
+
list: method({
|
|
101
|
+
input: z.object({
|
|
102
|
+
archived: z.boolean().optional(),
|
|
103
|
+
before: ChatId.optional(),
|
|
104
|
+
limit: z.number().int().min(1).max(200).optional(),
|
|
79
105
|
}),
|
|
106
|
+
output: z.object({ chats: z.array(ChatEntry), more: z.boolean() }),
|
|
80
107
|
}),
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
108
|
+
/** Give a chat another title: one line, so only the first line of `title` is kept. */
|
|
109
|
+
rename: method({
|
|
110
|
+
input: OnChat.extend({ title: z.string().min(1).max(CHAT_TITLE_MAX).regex(/\S/) }),
|
|
111
|
+
output: z.object({}),
|
|
112
|
+
}),
|
|
113
|
+
/** Put a chat among the archived ones, or back. It stays readable either way. */
|
|
114
|
+
archive: method({ input: OnChat.extend({ archived: z.boolean() }), output: z.object({}) }),
|
|
86
115
|
},
|
|
87
116
|
events: {
|
|
88
|
-
message: event(ChatMessage),
|
|
117
|
+
message: event(ChatMessage.extend({ chat: ChatId })),
|
|
89
118
|
/** Text of the assistant message `id`, as it streams; its `message` event follows. */
|
|
90
|
-
delta: event(z.object({ id: MessageId, text: z.string() })),
|
|
119
|
+
delta: event(z.object({ chat: ChatId, id: MessageId, text: z.string() })),
|
|
120
|
+
/** The agent's status, when it changes. */
|
|
91
121
|
status: event(ChatStatus),
|
|
122
|
+
/**
|
|
123
|
+
* A chat as it now is: it was started, renamed or archived, a message was sent in it, or one
|
|
124
|
+
* got no answer.
|
|
125
|
+
*/
|
|
126
|
+
chat: event(ChatEntry),
|
|
92
127
|
},
|
|
93
128
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A way a provider makes connections, such as `url` or `command`. */
|
|
3
|
+
export declare const ConnectionKind: z.ZodString;
|
|
4
|
+
/** `connecting` before its first success, `connected`, or `down` and being tried again. */
|
|
5
|
+
export declare const ConnectionState: z.ZodEnum<{
|
|
6
|
+
connected: "connected";
|
|
7
|
+
connecting: "connecting";
|
|
8
|
+
down: "down";
|
|
9
|
+
}>;
|
|
10
|
+
/** A connection's tools, for people to read; a provider cuts a long description to fit. */
|
|
11
|
+
export declare const ConnectionTool: z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
description: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
/** How a connection stands now: `detail` says why it is down, and never holds a secret. */
|
|
16
|
+
export declare const ConnectionStatus: z.ZodObject<{
|
|
17
|
+
state: z.ZodEnum<{
|
|
18
|
+
connected: "connected";
|
|
19
|
+
connecting: "connecting";
|
|
20
|
+
down: "down";
|
|
21
|
+
}>;
|
|
22
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
23
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
description: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
/** The parameters of a connection, fitting its kind's `params` schema. */
|
|
29
|
+
export declare const ConnectionParams: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* What a server needs and shouldn't be seen, by name, such as a bearer token. Write-only: the values
|
|
32
|
+
* cross once, in `create`, and go only to the provider's own private file.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ConnectionSecrets: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
35
|
+
/** What a connection attaches to or runs, for people to read: never a secret. */
|
|
36
|
+
export declare const ConnectionTarget: z.ZodString;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A way a provider makes connections, such as `url` or `command`. */
|
|
3
|
+
export const ConnectionKind = z
|
|
4
|
+
.string()
|
|
5
|
+
.regex(/^[a-z][a-z0-9-]*$/)
|
|
6
|
+
.max(64);
|
|
7
|
+
/** `connecting` before its first success, `connected`, or `down` and being tried again. */
|
|
8
|
+
export const ConnectionState = z.enum(["connecting", "connected", "down"]);
|
|
9
|
+
/** A connection's tools, for people to read; a provider cuts a long description to fit. */
|
|
10
|
+
export const ConnectionTool = z.object({
|
|
11
|
+
name: z.string().min(1).max(128),
|
|
12
|
+
description: z.string().max(512).optional(),
|
|
13
|
+
});
|
|
14
|
+
/** How a connection stands now: `detail` says why it is down, and never holds a secret. */
|
|
15
|
+
export const ConnectionStatus = z.object({
|
|
16
|
+
state: ConnectionState,
|
|
17
|
+
detail: z.string().max(2000).optional(),
|
|
18
|
+
tools: z.array(ConnectionTool),
|
|
19
|
+
});
|
|
20
|
+
/** The parameters of a connection, fitting its kind's `params` schema. */
|
|
21
|
+
export const ConnectionParams = z.record(z.string(), z.json());
|
|
22
|
+
/**
|
|
23
|
+
* What a server needs and shouldn't be seen, by name, such as a bearer token. Write-only: the values
|
|
24
|
+
* cross once, in `create`, and go only to the provider's own private file.
|
|
25
|
+
*/
|
|
26
|
+
export const ConnectionSecrets = z.record(z
|
|
27
|
+
.string()
|
|
28
|
+
.regex(/^[A-Za-z_][A-Za-z0-9_]*$/)
|
|
29
|
+
.max(256), z.string().min(1).max(16_384));
|
|
30
|
+
/** What a connection attaches to or runs, for people to read: never a secret. */
|
|
31
|
+
export const ConnectionTarget = z.string().min(1).max(4096);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The most folders one answer names. */
|
|
3
|
+
export declare const FOLDERS_MAX = 2000;
|
|
4
|
+
/**
|
|
5
|
+
* `folders@1`: the folders on the machine the app runs on, for a person choosing one. It names
|
|
6
|
+
* folders and nothing else. `list` starts at the person's home folder; `parent` is absent at the
|
|
7
|
+
* top. Refused `unknown` when there's no such folder, `invalid` for a path that isn't absolute.
|
|
8
|
+
*/
|
|
9
|
+
export declare const folders: import("@agentorg/sdk").RpcInterface<"folders", {
|
|
10
|
+
list: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
11
|
+
path: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
path: z.ZodString;
|
|
14
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
15
|
+
folders: z.ZodArray<z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
}, {}, 1>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineInterface, method } from "@agentorg/sdk";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/** The most folders one answer names. */
|
|
4
|
+
export const FOLDERS_MAX = 2000;
|
|
5
|
+
const Path = z.string().min(1).max(4096);
|
|
6
|
+
/**
|
|
7
|
+
* `folders@1`: the folders on the machine the app runs on, for a person choosing one. It names
|
|
8
|
+
* folders and nothing else. `list` starts at the person's home folder; `parent` is absent at the
|
|
9
|
+
* top. Refused `unknown` when there's no such folder, `invalid` for a path that isn't absolute.
|
|
10
|
+
*/
|
|
11
|
+
export const folders = defineInterface({
|
|
12
|
+
name: "folders",
|
|
13
|
+
major: 1,
|
|
14
|
+
kind: "rpc",
|
|
15
|
+
methods: {
|
|
16
|
+
list: method({
|
|
17
|
+
input: z.object({ path: Path.optional() }),
|
|
18
|
+
output: z.object({
|
|
19
|
+
path: Path,
|
|
20
|
+
parent: Path.optional(),
|
|
21
|
+
folders: z.array(z.object({ name: z.string().max(4096) })).max(FOLDERS_MAX),
|
|
22
|
+
}),
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { Account, accountLogin, LoginState } from "./account-login.js";
|
|
2
2
|
export { AgentStatus, Answers, agentProvider, Creatable, CreatableId, } from "./agent-provider.js";
|
|
3
3
|
export { agentSettings, SKILL_FILE_MAX, SkillEntry, SkillName, SkillPath, } from "./agent-settings.js";
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { CHAT_TITLE_MAX, ChatEntry, ChatMessage, ChatStatus, ChatTool, chat, } from "./chat.js";
|
|
5
|
+
export { ConnectionKind, ConnectionParams, ConnectionSecrets, ConnectionState, ConnectionStatus, ConnectionTarget, ConnectionTool, } from "./connection.js";
|
|
6
|
+
export { FOLDERS_MAX, folders } from "./folders.js";
|
|
7
|
+
export { Actor, ActorState, AuditEntry, Binding, ExportEntry, hubActors, hubAudit, hubBindings, hubExports, hubGrants, SlotName, } from "./hub.js";
|
|
6
8
|
export { kv } from "./kv.js";
|
|
7
9
|
export { Item, llmSession, OutputItem, Tool } from "./llm-session.js";
|
|
8
|
-
export { agents, ConnectionOrigin, connections, skills } from "./manager.js";
|
|
9
|
-
export { ConnectionKind, ConnectionParams, ConnectionSecrets, ConnectionState, ConnectionStatus, ConnectionTarget, ConnectionTool, mcpProvider, } from "./mcp-provider.js";
|
|
10
|
+
export { agents, ConnectionOrigin, connections, Stack, StackBase, StackUnit, skills, Template, TemplateId, } from "./manager.js";
|
|
10
11
|
export { ToolEntry, tools } from "./tools.js";
|
|
12
|
+
export { Field, FieldId, FieldValue, FieldValues, Form, LiveMode, LiveSurface, LiveTicket, Problem, ResultKind, Unit, UnitId, UnitResult, unitProvider, } from "./units.js";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { Account, accountLogin, LoginState } from "./account-login.js";
|
|
2
2
|
export { AgentStatus, Answers, agentProvider, Creatable, CreatableId, } from "./agent-provider.js";
|
|
3
3
|
export { agentSettings, SKILL_FILE_MAX, SkillEntry, SkillName, SkillPath, } from "./agent-settings.js";
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { CHAT_TITLE_MAX, ChatEntry, ChatMessage, ChatStatus, ChatTool, chat, } from "./chat.js";
|
|
5
|
+
export { ConnectionKind, ConnectionParams, ConnectionSecrets, ConnectionState, ConnectionStatus, ConnectionTarget, ConnectionTool, } from "./connection.js";
|
|
6
|
+
export { FOLDERS_MAX, folders } from "./folders.js";
|
|
7
|
+
export { Actor, ActorState, AuditEntry, Binding, ExportEntry, hubActors, hubAudit, hubBindings, hubExports, hubGrants, SlotName, } from "./hub.js";
|
|
6
8
|
export { kv } from "./kv.js";
|
|
7
9
|
export { Item, llmSession, OutputItem, Tool } from "./llm-session.js";
|
|
8
|
-
export { agents, ConnectionOrigin, connections, skills } from "./manager.js";
|
|
9
|
-
export { ConnectionKind, ConnectionParams, ConnectionSecrets, ConnectionState, ConnectionStatus, ConnectionTarget, ConnectionTool, mcpProvider, } from "./mcp-provider.js";
|
|
10
|
+
export { agents, ConnectionOrigin, connections, Stack, StackBase, StackUnit, skills, Template, TemplateId, } from "./manager.js";
|
|
10
11
|
export { ToolEntry, tools } from "./tools.js";
|
|
12
|
+
export { Field, FieldId, FieldValue, FieldValues, Form, LiveMode, LiveSurface, LiveTicket, Problem, ResultKind, Unit, UnitId, UnitResult, unitProvider, } from "./units.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/** A model's id, as whoever offers the model names it. */
|
|
3
|
+
export declare const ModelId: z.ZodString;
|
|
2
4
|
/** One item of a conversation: what was said, a function the model called, and its output. */
|
|
3
5
|
export declare const Item: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
6
|
type: z.ZodLiteral<"message">;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineInterface, event, method } from "@agentorg/sdk";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
const RequestId = z.string().min(1).max(128);
|
|
4
|
-
|
|
4
|
+
/** A model's id, as whoever offers the model names it. */
|
|
5
|
+
export const ModelId = z.string().min(1).max(128);
|
|
5
6
|
const CallId = z.string().min(1).max(256);
|
|
6
7
|
/** A function tool's name, as the Responses API takes it. */
|
|
7
8
|
const ToolName = z.string().regex(/^[A-Za-z0-9_-]{1,64}$/);
|