@downcity/plugins 1.0.147 → 1.0.149
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/bin/asr/Plugin.js +8 -8
- package/bin/asr/Plugin.js.map +1 -1
- package/bin/auth/types/AuthPlugin.js +3 -3
- package/bin/auth/types/AuthPlugin.js.map +1 -1
- package/bin/chat/PROMPT.direct.d.ts +1 -1
- package/bin/chat/PROMPT.direct.d.ts.map +1 -1
- package/bin/chat/PROMPT.direct.js +1 -1
- package/bin/chat/PROMPT.direct.js.map +1 -1
- package/bin/chat/channels/feishu/PROMPT.direct.d.ts +1 -1
- package/bin/chat/channels/feishu/PROMPT.direct.d.ts.map +1 -1
- package/bin/chat/channels/feishu/PROMPT.direct.js +1 -1
- package/bin/chat/channels/feishu/PROMPT.direct.js.map +1 -1
- package/bin/chat/channels/qq/PROMPT.direct.d.ts +1 -1
- package/bin/chat/channels/qq/PROMPT.direct.d.ts.map +1 -1
- package/bin/chat/channels/qq/PROMPT.direct.js +1 -1
- package/bin/chat/channels/qq/PROMPT.direct.js.map +1 -1
- package/bin/chat/runtime/ChatAuthorizationRuntime.js +5 -5
- package/bin/chat/runtime/ChatAuthorizationRuntime.js.map +1 -1
- package/bin/chat/runtime/ChatPluginActionRegistry.js +61 -61
- package/bin/chat/runtime/ChatPluginActionRegistry.js.map +1 -1
- package/bin/contact/Action.js +48 -48
- package/bin/contact/Action.js.map +1 -1
- package/bin/contact/PROMPT.d.ts +1 -1
- package/bin/contact/PROMPT.d.ts.map +1 -1
- package/bin/contact/PROMPT.js +1 -1
- package/bin/contact/PROMPT.js.map +1 -1
- package/bin/image/ImagePlugin.js +21 -21
- package/bin/image/ImagePlugin.js.map +1 -1
- package/bin/memory/MemoryPlugin.js +50 -50
- package/bin/memory/MemoryPlugin.js.map +1 -1
- package/bin/skill/PROMPT.d.ts +1 -1
- package/bin/skill/PROMPT.d.ts.map +1 -1
- package/bin/skill/PROMPT.js +1 -1
- package/bin/skill/PROMPT.js.map +1 -1
- package/bin/skill/Plugin.js +23 -23
- package/bin/skill/Plugin.js.map +1 -1
- package/bin/task/Action.js +1 -1
- package/bin/task/Action.js.map +1 -1
- package/bin/task/PROMPT.d.ts +1 -1
- package/bin/task/PROMPT.d.ts.map +1 -1
- package/bin/task/PROMPT.js +1 -1
- package/bin/task/PROMPT.js.map +1 -1
- package/bin/task/runtime/Runner.js +2 -2
- package/bin/task/runtime/Runner.js.map +1 -1
- package/bin/task/runtime/TaskPluginActionRegistry.js +73 -73
- package/bin/task/runtime/TaskPluginActionRegistry.js.map +1 -1
- package/bin/task/runtime/TaskRunnerProgress.js +1 -1
- package/bin/task/runtime/TaskRunnerProgress.js.map +1 -1
- package/bin/task/runtime/TaskRunnerScript.js +3 -3
- package/bin/task/runtime/TaskRunnerScript.js.map +1 -1
- package/bin/tts/Plugin.js +7 -7
- package/bin/tts/Plugin.js.map +1 -1
- package/bin/web/PROMPT.d.ts +1 -1
- package/bin/web/PROMPT.d.ts.map +1 -1
- package/bin/web/PROMPT.js +1 -1
- package/bin/web/PROMPT.js.map +1 -1
- package/bin/web/Plugin.js +8 -8
- package/bin/web/Plugin.js.map +1 -1
- package/bin/workboard/Plugin.js +2 -2
- package/bin/workboard/Plugin.js.map +1 -1
- package/bin/workboard/runtime/Normalizer.js +1 -1
- package/bin/workboard/runtime/Normalizer.js.map +1 -1
- package/package.json +3 -3
- package/src/asr/Plugin.ts +8 -8
- package/src/auth/types/AuthPlugin.ts +3 -3
- package/src/chat/PROMPT.direct.ts +1 -1
- package/src/chat/PROMPT.direct.ts.txt +32 -32
- package/src/chat/channels/feishu/PROMPT.direct.ts +1 -1
- package/src/chat/channels/feishu/PROMPT.direct.ts.txt +2 -2
- package/src/chat/channels/qq/PROMPT.direct.ts +1 -1
- package/src/chat/channels/qq/PROMPT.direct.ts.txt +11 -9
- package/src/chat/runtime/ChatAuthorizationRuntime.ts +5 -5
- package/src/chat/runtime/ChatPluginActionRegistry.ts +61 -61
- package/src/contact/Action.ts +48 -48
- package/src/contact/PROMPT.ts +1 -1
- package/src/contact/PROMPT.ts.txt +22 -22
- package/src/image/ImagePlugin.ts +21 -21
- package/src/memory/MemoryPlugin.ts +50 -50
- package/src/skill/PROMPT.ts +1 -1
- package/src/skill/PROMPT.ts.txt +5 -6
- package/src/skill/Plugin.ts +23 -23
- package/src/task/Action.ts +1 -1
- package/src/task/PROMPT.ts +1 -1
- package/src/task/PROMPT.ts.txt +159 -159
- package/src/task/runtime/Runner.ts +2 -2
- package/src/task/runtime/TaskPluginActionRegistry.ts +73 -73
- package/src/task/runtime/TaskRunnerProgress.ts +1 -1
- package/src/task/runtime/TaskRunnerScript.ts +3 -3
- package/src/tts/Plugin.ts +7 -7
- package/src/web/PROMPT.ts +1 -1
- package/src/web/PROMPT.ts.txt +31 -31
- package/src/web/Plugin.ts +8 -8
- package/src/workboard/Plugin.ts +2 -2
- package/src/workboard/runtime/Normalizer.ts +1 -1
|
@@ -165,7 +165,7 @@ export function createChatAuthorizationResolves(): PluginResolves {
|
|
|
165
165
|
export function createChatAuthorizationActions(): PluginActions {
|
|
166
166
|
return {
|
|
167
167
|
[CHAT_AUTHORIZATION_ACTIONS.snapshot]: createAction({
|
|
168
|
-
description: "
|
|
168
|
+
description: "Read chat authorization snapshot (catalog/config/users/chats).",
|
|
169
169
|
input_schema: {
|
|
170
170
|
zod: z.object({}).passthrough(),
|
|
171
171
|
json_schema: { type: "object", properties: {} },
|
|
@@ -181,7 +181,7 @@ export function createChatAuthorizationActions(): PluginActions {
|
|
|
181
181
|
},
|
|
182
182
|
}),
|
|
183
183
|
[CHAT_AUTHORIZATION_ACTIONS.readConfig]: createAction({
|
|
184
|
-
description: "
|
|
184
|
+
description: "Read current chat authorization config.",
|
|
185
185
|
input_schema: {
|
|
186
186
|
zod: z.object({}).passthrough(),
|
|
187
187
|
json_schema: { type: "object", properties: {} },
|
|
@@ -194,7 +194,7 @@ export function createChatAuthorizationActions(): PluginActions {
|
|
|
194
194
|
},
|
|
195
195
|
}),
|
|
196
196
|
[CHAT_AUTHORIZATION_ACTIONS.writeConfig]: createAction({
|
|
197
|
-
description: "
|
|
197
|
+
description: "Write chat authorization config as a full replacement.",
|
|
198
198
|
input_schema: {
|
|
199
199
|
zod: z.object({
|
|
200
200
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
@@ -202,7 +202,7 @@ export function createChatAuthorizationActions(): PluginActions {
|
|
|
202
202
|
json_schema: {
|
|
203
203
|
type: "object",
|
|
204
204
|
properties: {
|
|
205
|
-
config: { type: "object", description: "
|
|
205
|
+
config: { type: "object", description: "Authorization config." },
|
|
206
206
|
},
|
|
207
207
|
},
|
|
208
208
|
},
|
|
@@ -225,7 +225,7 @@ export function createChatAuthorizationActions(): PluginActions {
|
|
|
225
225
|
},
|
|
226
226
|
}),
|
|
227
227
|
[CHAT_AUTHORIZATION_ACTIONS.setUserRole]: createAction({
|
|
228
|
-
description: "
|
|
228
|
+
description: "Set the role for a channel user.",
|
|
229
229
|
input_schema: {
|
|
230
230
|
zod: z.object({
|
|
231
231
|
channel: z.enum(["telegram", "feishu", "qq"]),
|
|
@@ -104,15 +104,15 @@ export function createChatPluginActions(params: {
|
|
|
104
104
|
}): PluginActions {
|
|
105
105
|
return {
|
|
106
106
|
status: createAction({
|
|
107
|
-
description: "
|
|
107
|
+
description: "View chat channel connection status.",
|
|
108
108
|
input_schema: {
|
|
109
109
|
zod: z.object({}).passthrough(),
|
|
110
110
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
111
111
|
},
|
|
112
112
|
command: {
|
|
113
|
-
description: "
|
|
113
|
+
description: "View chat channel connection status.",
|
|
114
114
|
configure(command: Command) {
|
|
115
|
-
command.option("--channel <name>", "
|
|
115
|
+
command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
|
|
116
116
|
},
|
|
117
117
|
mapInput: mapChatChannelCommandInput,
|
|
118
118
|
},
|
|
@@ -125,15 +125,15 @@ export function createChatPluginActions(params: {
|
|
|
125
125
|
},
|
|
126
126
|
}),
|
|
127
127
|
test: createAction({
|
|
128
|
-
description: "
|
|
128
|
+
description: "Test chat channel connectivity.",
|
|
129
129
|
input_schema: {
|
|
130
130
|
zod: z.object({}).passthrough(),
|
|
131
131
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
132
132
|
},
|
|
133
133
|
command: {
|
|
134
|
-
description: "
|
|
134
|
+
description: "Test chat channel connectivity.",
|
|
135
135
|
configure(command: Command) {
|
|
136
|
-
command.option("--channel <name>", "
|
|
136
|
+
command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
|
|
137
137
|
},
|
|
138
138
|
mapInput: mapChatChannelCommandInput,
|
|
139
139
|
},
|
|
@@ -146,15 +146,15 @@ export function createChatPluginActions(params: {
|
|
|
146
146
|
},
|
|
147
147
|
}),
|
|
148
148
|
reconnect: createAction({
|
|
149
|
-
description: "
|
|
149
|
+
description: "Reconnect chat channels, all by default.",
|
|
150
150
|
input_schema: {
|
|
151
151
|
zod: z.object({}).passthrough(),
|
|
152
152
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
153
153
|
},
|
|
154
154
|
command: {
|
|
155
|
-
description: "
|
|
155
|
+
description: "Reconnect chat channels, all by default.",
|
|
156
156
|
configure(command: Command) {
|
|
157
|
-
command.option("--channel <name>", "
|
|
157
|
+
command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
|
|
158
158
|
},
|
|
159
159
|
mapInput: mapChatChannelCommandInput,
|
|
160
160
|
},
|
|
@@ -167,15 +167,15 @@ export function createChatPluginActions(params: {
|
|
|
167
167
|
},
|
|
168
168
|
}),
|
|
169
169
|
open: createAction({
|
|
170
|
-
description: "
|
|
170
|
+
description: "Open and enable the specified chat channel.",
|
|
171
171
|
input_schema: {
|
|
172
172
|
zod: z.object({}).passthrough(),
|
|
173
173
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
174
174
|
},
|
|
175
175
|
command: {
|
|
176
|
-
description: "
|
|
176
|
+
description: "Open chat channel (enabled=true, and start it if configured).",
|
|
177
177
|
configure(command: Command) {
|
|
178
|
-
command.option("--channel <name>", "
|
|
178
|
+
command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
|
|
179
179
|
},
|
|
180
180
|
mapInput: mapChatChannelCommandInput,
|
|
181
181
|
},
|
|
@@ -188,15 +188,15 @@ export function createChatPluginActions(params: {
|
|
|
188
188
|
},
|
|
189
189
|
}),
|
|
190
190
|
close: createAction({
|
|
191
|
-
description: "
|
|
191
|
+
description: "Close and disable the specified chat channel.",
|
|
192
192
|
input_schema: {
|
|
193
193
|
zod: z.object({}).passthrough(),
|
|
194
194
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
195
195
|
},
|
|
196
196
|
command: {
|
|
197
|
-
description: "
|
|
197
|
+
description: "Close chat channel (enabled=false and stop runtime).",
|
|
198
198
|
configure(command: Command) {
|
|
199
|
-
command.option("--channel <name>", "
|
|
199
|
+
command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
|
|
200
200
|
},
|
|
201
201
|
mapInput: mapChatChannelCommandInput,
|
|
202
202
|
},
|
|
@@ -209,15 +209,15 @@ export function createChatPluginActions(params: {
|
|
|
209
209
|
},
|
|
210
210
|
}),
|
|
211
211
|
configuration: createAction({
|
|
212
|
-
description: "
|
|
212
|
+
description: "View chat channel configuration metadata.",
|
|
213
213
|
input_schema: {
|
|
214
214
|
zod: z.object({}).passthrough(),
|
|
215
215
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
216
216
|
},
|
|
217
217
|
command: {
|
|
218
|
-
description: "
|
|
218
|
+
description: "View chat channel configuration metadata (fields, types, descriptions).",
|
|
219
219
|
configure(command: Command) {
|
|
220
|
-
command.option("--channel <name>", "
|
|
220
|
+
command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
|
|
221
221
|
},
|
|
222
222
|
mapInput: mapChatChannelCommandInput,
|
|
223
223
|
},
|
|
@@ -229,21 +229,21 @@ export function createChatPluginActions(params: {
|
|
|
229
229
|
},
|
|
230
230
|
}),
|
|
231
231
|
configure: createAction({
|
|
232
|
-
description: "
|
|
232
|
+
description: "Update runtime parameters for a chat channel.",
|
|
233
233
|
input_schema: {
|
|
234
234
|
zod: z.object({}).passthrough(),
|
|
235
235
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
236
236
|
},
|
|
237
237
|
command: {
|
|
238
|
-
description: "
|
|
238
|
+
description: "Update runtime parameters for a chat channel, optionally restarting it immediately.",
|
|
239
239
|
configure(command: Command) {
|
|
240
240
|
command
|
|
241
|
-
.requiredOption("--channel <name>", "
|
|
241
|
+
.requiredOption("--channel <name>", "Specify channel (telegram|feishu|qq).")
|
|
242
242
|
.requiredOption(
|
|
243
243
|
"--config-json <json>",
|
|
244
|
-
"
|
|
244
|
+
"Configuration patch JSON, for example '{\"channelAccountId\":\"qq-main\",\"enabled\":true}'.",
|
|
245
245
|
)
|
|
246
|
-
.option("--restart", "
|
|
246
|
+
.option("--restart", "Restart the channel immediately after configuration.", false);
|
|
247
247
|
},
|
|
248
248
|
mapInput: mapChatConfigureCommandInput,
|
|
249
249
|
},
|
|
@@ -256,18 +256,18 @@ export function createChatPluginActions(params: {
|
|
|
256
256
|
},
|
|
257
257
|
}),
|
|
258
258
|
list: createAction({
|
|
259
|
-
description: "
|
|
259
|
+
description: "List chat conversations recorded by the current agent.",
|
|
260
260
|
input_schema: {
|
|
261
261
|
zod: z.object({}).passthrough(),
|
|
262
262
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
263
263
|
},
|
|
264
264
|
command: {
|
|
265
|
-
description: "
|
|
265
|
+
description: "List chat conversations recorded by the current agent (chatTitle/chatKey).",
|
|
266
266
|
configure(command: Command) {
|
|
267
267
|
command
|
|
268
|
-
.option("--channel <name>", "
|
|
269
|
-
.option("--limit <n>", "
|
|
270
|
-
.option("--q <text>", "
|
|
268
|
+
.option("--channel <name>", "Filter by channel (telegram|feishu|qq).")
|
|
269
|
+
.option("--limit <n>", "Return the latest N records, default 50.")
|
|
270
|
+
.option("--q <text>", "Keyword filter (title/chatId/sessionId/actor).");
|
|
271
271
|
},
|
|
272
272
|
mapInput: mapChatListCommandInput,
|
|
273
273
|
},
|
|
@@ -279,17 +279,17 @@ export function createChatPluginActions(params: {
|
|
|
279
279
|
},
|
|
280
280
|
}),
|
|
281
281
|
info: createAction({
|
|
282
|
-
description: "
|
|
282
|
+
description: "View route, paths, and context snapshot for a specified chat conversation.",
|
|
283
283
|
input_schema: {
|
|
284
284
|
zod: z.object({}).passthrough(),
|
|
285
285
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
286
286
|
},
|
|
287
287
|
command: {
|
|
288
|
-
description: "
|
|
288
|
+
description: "View specified chat conversation info (route/local paths/context snapshot).",
|
|
289
289
|
configure(command: Command) {
|
|
290
290
|
command
|
|
291
|
-
.option("--chat-key <chatKey>", "
|
|
292
|
-
.option("--session-id <sessionId>", "
|
|
291
|
+
.option("--chat-key <chatKey>", "Target chatKey; reads DC_CTX_CHAT_KEY if omitted.")
|
|
292
|
+
.option("--session-id <sessionId>", "Explicit sessionId, with higher priority.");
|
|
293
293
|
},
|
|
294
294
|
mapInput: mapChatInfoCommandInput,
|
|
295
295
|
},
|
|
@@ -301,23 +301,23 @@ export function createChatPluginActions(params: {
|
|
|
301
301
|
},
|
|
302
302
|
}),
|
|
303
303
|
send: createAction({
|
|
304
|
-
description: "
|
|
304
|
+
description: "Send a message to the target chatKey, supporting text, attachments, and delay.",
|
|
305
305
|
input_schema: {
|
|
306
306
|
zod: z.object({}).passthrough(),
|
|
307
307
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
308
308
|
},
|
|
309
309
|
command: {
|
|
310
|
-
description: "
|
|
310
|
+
description: "Send a message to the target chatKey.",
|
|
311
311
|
configure(command: Command) {
|
|
312
312
|
command
|
|
313
|
-
.option("--text <text>", "
|
|
314
|
-
.option("--stdin", "
|
|
315
|
-
.option("--text-file <file>", "
|
|
316
|
-
.option("--reply", "
|
|
317
|
-
.option("--message-id <id>", "
|
|
313
|
+
.option("--text <text>", "Message body.")
|
|
314
|
+
.option("--stdin", "Read message body from stdin.", false)
|
|
315
|
+
.option("--text-file <file>", "Read message body from a file relative to the current directory.")
|
|
316
|
+
.option("--reply", "Explicitly reply to the target message with reply_to_message.", false)
|
|
317
|
+
.option("--message-id <id>", "Explicit reply target message ID.")
|
|
318
318
|
.option(
|
|
319
319
|
"--chat-key <chatKey>",
|
|
320
|
-
"
|
|
320
|
+
"Target chatKey; reads DC_CTX_CHAT_KEY if omitted.",
|
|
321
321
|
);
|
|
322
322
|
attachCommandHelpText(command, CHAT_SEND_HELP_TEXT);
|
|
323
323
|
},
|
|
@@ -331,21 +331,21 @@ export function createChatPluginActions(params: {
|
|
|
331
331
|
},
|
|
332
332
|
}),
|
|
333
333
|
react: createAction({
|
|
334
|
-
description: "
|
|
334
|
+
description: "React to a target message, currently supported only by Telegram.",
|
|
335
335
|
input_schema: {
|
|
336
336
|
zod: z.object({}).passthrough(),
|
|
337
337
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
338
338
|
},
|
|
339
339
|
command: {
|
|
340
|
-
description: "
|
|
340
|
+
description: "React to a target message, currently supported only by Telegram.",
|
|
341
341
|
configure(command: Command) {
|
|
342
342
|
command
|
|
343
|
-
.option("--emoji <emoji>", "
|
|
344
|
-
.option("--big", "
|
|
345
|
-
.option("--message-id <id>", "
|
|
343
|
+
.option("--emoji <emoji>", "Emoji character, default thumbs-up.")
|
|
344
|
+
.option("--big", "Use large reaction effect (Telegram is_big).", false)
|
|
345
|
+
.option("--message-id <id>", "Target message ID; defaults to chat meta when available.")
|
|
346
346
|
.option(
|
|
347
347
|
"--chat-key <chatKey>",
|
|
348
|
-
"
|
|
348
|
+
"Target chatKey; reads DC_CTX_CHAT_KEY if omitted.",
|
|
349
349
|
);
|
|
350
350
|
attachCommandHelpText(command, CHAT_REACT_HELP_TEXT);
|
|
351
351
|
},
|
|
@@ -359,15 +359,15 @@ export function createChatPluginActions(params: {
|
|
|
359
359
|
},
|
|
360
360
|
}),
|
|
361
361
|
context: createAction({
|
|
362
|
-
description: "
|
|
362
|
+
description: "View current conversation context snapshot.",
|
|
363
363
|
input_schema: {
|
|
364
364
|
zod: z.object({}).passthrough(),
|
|
365
365
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
366
366
|
},
|
|
367
367
|
command: {
|
|
368
|
-
description: "
|
|
368
|
+
description: "View current conversation context snapshot.",
|
|
369
369
|
configure(command: Command) {
|
|
370
|
-
command.option("--chat-key <chatKey>", "
|
|
370
|
+
command.option("--chat-key <chatKey>", "Explicitly override chatKey.");
|
|
371
371
|
},
|
|
372
372
|
mapInput(input) {
|
|
373
373
|
const chatKey =
|
|
@@ -385,17 +385,17 @@ export function createChatPluginActions(params: {
|
|
|
385
385
|
},
|
|
386
386
|
}),
|
|
387
387
|
delete: createAction({
|
|
388
|
-
description: "
|
|
388
|
+
description: "Permanently delete a specified chat conversation, including mapping, history, and context.",
|
|
389
389
|
input_schema: {
|
|
390
390
|
zod: z.object({}).passthrough(),
|
|
391
391
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
392
392
|
},
|
|
393
393
|
command: {
|
|
394
|
-
description: "
|
|
394
|
+
description: "Permanently delete a specified chat conversation, including mapping, history, and context.",
|
|
395
395
|
configure(command: Command) {
|
|
396
396
|
command
|
|
397
|
-
.option("--chat-key <chatKey>", "
|
|
398
|
-
.option("--session-id <sessionId>", "
|
|
397
|
+
.option("--chat-key <chatKey>", "Explicit chatKey.")
|
|
398
|
+
.option("--session-id <sessionId>", "Explicit sessionId.");
|
|
399
399
|
},
|
|
400
400
|
mapInput: mapChatDeleteCommandInput,
|
|
401
401
|
},
|
|
@@ -407,24 +407,24 @@ export function createChatPluginActions(params: {
|
|
|
407
407
|
},
|
|
408
408
|
}),
|
|
409
409
|
history: createAction({
|
|
410
|
-
description: "
|
|
410
|
+
description: "Read chat history messages.",
|
|
411
411
|
input_schema: {
|
|
412
412
|
zod: z.object({}).passthrough(),
|
|
413
413
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
414
414
|
},
|
|
415
415
|
command: {
|
|
416
|
-
description: "
|
|
416
|
+
description: "Read chat history messages, defaulting to the latest 30.",
|
|
417
417
|
configure(command: Command) {
|
|
418
418
|
command
|
|
419
|
-
.option("--chat-key <chatKey>", "
|
|
420
|
-
.option("--session-id <sessionId>", "
|
|
421
|
-
.option("--limit <n>", "
|
|
419
|
+
.option("--chat-key <chatKey>", "Explicitly override chatKey.")
|
|
420
|
+
.option("--session-id <sessionId>", "Explicitly override sessionId.")
|
|
421
|
+
.option("--limit <n>", "Return the latest N records, default 30.")
|
|
422
422
|
.option(
|
|
423
423
|
"--direction <direction>",
|
|
424
|
-
"
|
|
424
|
+
"Direction filter (all|inbound|outbound).",
|
|
425
425
|
)
|
|
426
|
-
.option("--before-ts <ts>", "
|
|
427
|
-
.option("--after-ts <ts>", "
|
|
426
|
+
.option("--before-ts <ts>", "Return only records with ts lower than this value, in milliseconds.")
|
|
427
|
+
.option("--after-ts <ts>", "Return only records with ts greater than this value, in milliseconds.");
|
|
428
428
|
},
|
|
429
429
|
mapInput: mapChatHistoryCommandInput,
|
|
430
430
|
},
|
package/src/contact/Action.ts
CHANGED
|
@@ -97,21 +97,21 @@ export type ContactActionHandlers = {
|
|
|
97
97
|
export function createContactActions(handlers: ContactActionHandlers): PluginActions {
|
|
98
98
|
return {
|
|
99
99
|
link: createAction({
|
|
100
|
-
description: "
|
|
100
|
+
description: "Create a one-time contact link code for another agent to approve.",
|
|
101
101
|
input_schema: {
|
|
102
102
|
zod: z.object({ ttlSeconds: z.number().optional() }),
|
|
103
103
|
json_schema: {
|
|
104
104
|
type: "object",
|
|
105
105
|
properties: {
|
|
106
|
-
ttlSeconds: { type: "number", description: "
|
|
106
|
+
ttlSeconds: { type: "number", description: "Link expiration in seconds, defaulting to 600." },
|
|
107
107
|
},
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
|
-
examples: [{ title: "
|
|
110
|
+
examples: [{ title: "Create default link", payload: {} }],
|
|
111
111
|
command: {
|
|
112
|
-
description: "
|
|
112
|
+
description: "Create a one-time contact link code for another agent to approve.",
|
|
113
113
|
configure(command) {
|
|
114
|
-
command.option("--ttl-seconds <seconds>", "
|
|
114
|
+
command.option("--ttl-seconds <seconds>", "Link expiration in seconds, defaulting to 600.", Number);
|
|
115
115
|
},
|
|
116
116
|
mapInput({ opts }) {
|
|
117
117
|
const payload: JsonObject = {};
|
|
@@ -128,7 +128,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
128
128
|
}),
|
|
129
129
|
}),
|
|
130
130
|
approve: createAction({
|
|
131
|
-
description: "
|
|
131
|
+
description: "Use a contact link code to establish a peer-to-peer contact.",
|
|
132
132
|
input_schema: {
|
|
133
133
|
zod: z.object({
|
|
134
134
|
code: z.string(),
|
|
@@ -139,7 +139,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
139
139
|
required: ["code"],
|
|
140
140
|
properties: {
|
|
141
141
|
code: { type: "string", description: "link code" },
|
|
142
|
-
name: { type: "string", description: "
|
|
142
|
+
name: { type: "string", description: "Local contact alias." },
|
|
143
143
|
},
|
|
144
144
|
},
|
|
145
145
|
},
|
|
@@ -147,11 +147,11 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
147
147
|
{ title: "approve link", payload: { code: "abc123", name: "alice" } },
|
|
148
148
|
],
|
|
149
149
|
command: {
|
|
150
|
-
description: "
|
|
150
|
+
description: "Use a contact link code to establish a peer-to-peer contact.",
|
|
151
151
|
configure(command) {
|
|
152
152
|
command
|
|
153
153
|
.argument("<code>")
|
|
154
|
-
.option("--name <alias>", "
|
|
154
|
+
.option("--name <alias>", "Local contact alias.");
|
|
155
155
|
},
|
|
156
156
|
mapInput({ args, opts }) {
|
|
157
157
|
const code = String(args[0] || "").trim();
|
|
@@ -170,14 +170,14 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
170
170
|
}),
|
|
171
171
|
}),
|
|
172
172
|
list: createAction({
|
|
173
|
-
description: "
|
|
173
|
+
description: "List established contacts.",
|
|
174
174
|
input_schema: {
|
|
175
175
|
zod: z.object({}).passthrough(),
|
|
176
176
|
json_schema: { type: "object", properties: {} },
|
|
177
177
|
},
|
|
178
|
-
examples: [{ title: "
|
|
178
|
+
examples: [{ title: "List contacts", payload: {} }],
|
|
179
179
|
command: {
|
|
180
|
-
description: "
|
|
180
|
+
description: "List established contacts.",
|
|
181
181
|
mapInput() {
|
|
182
182
|
return {};
|
|
183
183
|
},
|
|
@@ -190,7 +190,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
190
190
|
}),
|
|
191
191
|
}),
|
|
192
192
|
check: createAction({
|
|
193
|
-
description: "
|
|
193
|
+
description: "Check whether a contact or endpoint is currently online and reachable.",
|
|
194
194
|
input_schema: {
|
|
195
195
|
zod: z.object({
|
|
196
196
|
target: z.string().optional(),
|
|
@@ -199,21 +199,21 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
199
199
|
json_schema: {
|
|
200
200
|
type: "object",
|
|
201
201
|
properties: {
|
|
202
|
-
target: { type: "string", description: "
|
|
203
|
-
endpoint: { type: "string", description: "
|
|
202
|
+
target: { type: "string", description: "Saved contact name." },
|
|
203
|
+
endpoint: { type: "string", description: "Endpoint to check directly." },
|
|
204
204
|
},
|
|
205
205
|
},
|
|
206
206
|
},
|
|
207
207
|
examples: [
|
|
208
|
-
{ title: "
|
|
209
|
-
{ title: "
|
|
208
|
+
{ title: "Check contact", payload: { target: "alice" } },
|
|
209
|
+
{ title: "Check endpoint", payload: { endpoint: "https://example.com" } },
|
|
210
210
|
],
|
|
211
211
|
command: {
|
|
212
|
-
description: "
|
|
212
|
+
description: "Check whether a contact or endpoint is currently online and reachable.",
|
|
213
213
|
configure(command) {
|
|
214
214
|
command
|
|
215
215
|
.argument("[target]")
|
|
216
|
-
.option("--to <endpoint>", "
|
|
216
|
+
.option("--to <endpoint>", "Directly check an unsaved endpoint.");
|
|
217
217
|
},
|
|
218
218
|
mapInput({ args, opts }) {
|
|
219
219
|
const payload: JsonObject = {};
|
|
@@ -232,7 +232,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
232
232
|
}),
|
|
233
233
|
}),
|
|
234
234
|
chat: createAction({
|
|
235
|
-
description: "
|
|
235
|
+
description: "Chat with a contact in its long-lived conversation thread, or read conversation history.",
|
|
236
236
|
input_schema: {
|
|
237
237
|
zod: z.object({
|
|
238
238
|
to: z.string(),
|
|
@@ -242,19 +242,19 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
242
242
|
type: "object",
|
|
243
243
|
required: ["to"],
|
|
244
244
|
properties: {
|
|
245
|
-
to: { type: "string", description: "
|
|
246
|
-
message: { type: "string", description: "
|
|
245
|
+
to: { type: "string", description: "Target contact." },
|
|
246
|
+
message: { type: "string", description: "Message to send." },
|
|
247
247
|
},
|
|
248
248
|
},
|
|
249
249
|
},
|
|
250
250
|
examples: [
|
|
251
|
-
{ title: "
|
|
252
|
-
{ title: "
|
|
251
|
+
{ title: "Send message", payload: { to: "alice", message: "hello" } },
|
|
252
|
+
{ title: "Read history", payload: { to: "alice" } },
|
|
253
253
|
],
|
|
254
254
|
command: {
|
|
255
|
-
description: "
|
|
255
|
+
description: "Chat with a contact in its long-lived conversation thread.",
|
|
256
256
|
configure(command) {
|
|
257
|
-
command.requiredOption("--to <contact>", "
|
|
257
|
+
command.requiredOption("--to <contact>", "Target contact.").argument("[message...]");
|
|
258
258
|
},
|
|
259
259
|
mapInput({ args, opts }) {
|
|
260
260
|
const payload: JsonObject = {
|
|
@@ -274,7 +274,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
274
274
|
}),
|
|
275
275
|
}),
|
|
276
276
|
share: createAction({
|
|
277
|
-
description: "
|
|
277
|
+
description: "Share text, links, files, or directories with a contact.",
|
|
278
278
|
input_schema: {
|
|
279
279
|
zod: z.object({
|
|
280
280
|
to: z.string(),
|
|
@@ -286,26 +286,26 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
286
286
|
type: "object",
|
|
287
287
|
required: ["to"],
|
|
288
288
|
properties: {
|
|
289
|
-
to: { type: "string", description: "
|
|
290
|
-
text: { type: "string", description: "
|
|
291
|
-
links: { type: "array", items: { type: "string" }, description: "
|
|
292
|
-
paths: { type: "array", items: { type: "string" }, description: "
|
|
289
|
+
to: { type: "string", description: "Target contact." },
|
|
290
|
+
text: { type: "string", description: "Text to share." },
|
|
291
|
+
links: { type: "array", items: { type: "string" }, description: "Links to share." },
|
|
292
|
+
paths: { type: "array", items: { type: "string" }, description: "File or directory paths to share." },
|
|
293
293
|
},
|
|
294
294
|
},
|
|
295
295
|
},
|
|
296
296
|
examples: [
|
|
297
297
|
{
|
|
298
|
-
title: "
|
|
298
|
+
title: "Share text",
|
|
299
299
|
payload: { to: "alice", text: "看看这个" },
|
|
300
300
|
},
|
|
301
301
|
],
|
|
302
302
|
command: {
|
|
303
|
-
description: "
|
|
303
|
+
description: "Share text, links, files, or directories with a contact.",
|
|
304
304
|
configure(command) {
|
|
305
305
|
command
|
|
306
|
-
.requiredOption("--to <contact>", "
|
|
307
|
-
.option("--text <text>", "
|
|
308
|
-
.option("--link <url...>", "
|
|
306
|
+
.requiredOption("--to <contact>", "Target contact.")
|
|
307
|
+
.option("--text <text>", "Text to share.")
|
|
308
|
+
.option("--link <url...>", "Links to share.")
|
|
309
309
|
.argument("[paths...]");
|
|
310
310
|
},
|
|
311
311
|
mapInput({ args, opts }) {
|
|
@@ -331,14 +331,14 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
331
331
|
}),
|
|
332
332
|
}),
|
|
333
333
|
inbox: createAction({
|
|
334
|
-
description: "
|
|
334
|
+
description: "View the contact inbox.",
|
|
335
335
|
input_schema: {
|
|
336
336
|
zod: z.object({}).passthrough(),
|
|
337
337
|
json_schema: { type: "object", properties: {} },
|
|
338
338
|
},
|
|
339
|
-
examples: [{ title: "
|
|
339
|
+
examples: [{ title: "View inbox", payload: {} }],
|
|
340
340
|
command: {
|
|
341
|
-
description: "
|
|
341
|
+
description: "View the contact inbox.",
|
|
342
342
|
mapInput() {
|
|
343
343
|
return {};
|
|
344
344
|
},
|
|
@@ -351,20 +351,20 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
351
351
|
}),
|
|
352
352
|
}),
|
|
353
353
|
receive: createAction({
|
|
354
|
-
description: "
|
|
354
|
+
description: "Receive a share from the inbox.",
|
|
355
355
|
input_schema: {
|
|
356
356
|
zod: z.object({ shareId: z.string() }),
|
|
357
357
|
json_schema: {
|
|
358
358
|
type: "object",
|
|
359
359
|
required: ["shareId"],
|
|
360
360
|
properties: {
|
|
361
|
-
shareId: { type: "string", description: "
|
|
361
|
+
shareId: { type: "string", description: "Share ID from the inbox." },
|
|
362
362
|
},
|
|
363
363
|
},
|
|
364
364
|
},
|
|
365
|
-
examples: [{ title: "
|
|
365
|
+
examples: [{ title: "Receive share", payload: { shareId: "share_1" } }],
|
|
366
366
|
command: {
|
|
367
|
-
description: "
|
|
367
|
+
description: "Receive a share from the inbox.",
|
|
368
368
|
configure(command) {
|
|
369
369
|
command.argument("<shareId>");
|
|
370
370
|
},
|
|
@@ -383,7 +383,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
383
383
|
}),
|
|
384
384
|
}),
|
|
385
385
|
remoteping: createAction({
|
|
386
|
-
description: "
|
|
386
|
+
description: "Handle a remote ping request (internal endpoint).",
|
|
387
387
|
execute: async (params) => ({
|
|
388
388
|
success: true,
|
|
389
389
|
data: (await handlers.remotePing(
|
|
@@ -393,7 +393,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
393
393
|
}),
|
|
394
394
|
}),
|
|
395
395
|
remoteapprove: createAction({
|
|
396
|
-
description: "
|
|
396
|
+
description: "Handle a remote approve request (internal endpoint).",
|
|
397
397
|
execute: async (params) => ({
|
|
398
398
|
success: true,
|
|
399
399
|
data: (await handlers.remoteApprove(
|
|
@@ -403,7 +403,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
403
403
|
}),
|
|
404
404
|
}),
|
|
405
405
|
remoteconfirm: createAction({
|
|
406
|
-
description: "
|
|
406
|
+
description: "Handle a remote confirm request (internal endpoint).",
|
|
407
407
|
execute: async (params) => ({
|
|
408
408
|
success: true,
|
|
409
409
|
data: (await handlers.remoteConfirm(
|
|
@@ -413,7 +413,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
413
413
|
}),
|
|
414
414
|
}),
|
|
415
415
|
remotechat: createAction({
|
|
416
|
-
description: "
|
|
416
|
+
description: "Handle a remote chat request (internal endpoint).",
|
|
417
417
|
execute: async (params) => {
|
|
418
418
|
const payload = readContactObject(params.input);
|
|
419
419
|
const body = readContactObject(payload.body);
|
|
@@ -428,7 +428,7 @@ export function createContactActions(handlers: ContactActionHandlers): PluginAct
|
|
|
428
428
|
},
|
|
429
429
|
}),
|
|
430
430
|
remoteshare: createAction({
|
|
431
|
-
description: "
|
|
431
|
+
description: "Handle a remote share request (internal endpoint).",
|
|
432
432
|
execute: async (params) => ({
|
|
433
433
|
success: true,
|
|
434
434
|
data: (await handlers.remoteShare(params.context, params.input)) as unknown as JsonValue,
|