@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
package/src/contact/PROMPT.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Source: src/contact/PROMPT.ts.txt
|
|
7
|
-
const TEXT_MODULE_CONTENT = "Contact
|
|
7
|
+
const TEXT_MODULE_CONTENT = "# Contact Plugin\n\nThe contact plugin manages ways to reach other agents. A contact represents an established remote-agent relationship and owns one long-lived conversation history. A contact may be one-way: as long as this agent can reach the other agent, it can `check`, `chat`, and `share`.\n\nAvailable actions:\n- `link`: create a one-time contact code for another agent.\n- `approve`: use a contact code from another agent to establish a contact.\n- `list`: view saved agent contacts.\n- `check`: check whether the other agent is online and reachable.\n- `chat`: talk with a contact.\n- `share`: share text, links, files, or directories.\n- `inbox`: view received shares.\n- `receive`: receive a share.\n\nBoundaries:\n- Use `chat` for conversation and `share` for handing over materials.\n- The notes returned by the `link` action explain whether a contact code is suitable for local-machine, LAN, or public agents. A localhost contact code must not be given to a server agent for `approve`.\n- A public-looking endpoint may still be blocked by firewall or NAT. Trust the returned notes, and do not promise that public access is guaranteed.\n- The Agent runtime writes `DOWNCITY_PUBLIC_HOST` when available for contact links. This is not a token or endpoint that the user must configure manually.\n- The `approve` action first establishes a one-way relationship. The other agent then pings back to this agent, and only a successful ping upgrades the relationship to bidirectional.\n- When a local/private agent connects to a public agent, the connection is usually outbound-only. Do not describe it as bidirectional.\n- Contact tokens are exchanged automatically by `link` and `approve`. Do not ask the user to manually configure token environment variables.\n- `Contact link not found` means the request reached an agent runtime that does not have this link record. First check whether the endpoint, port, and agent match. Expiration is reported explicitly as `Contact link expired`.\n- `receive` only receives content. It does not execute anything, install skills, or modify project business files automatically.\n- Do not automatically approve or receive unless the user explicitly asks.\n";
|
|
8
8
|
|
|
9
9
|
export default TEXT_MODULE_CONTENT;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
Contact
|
|
1
|
+
# Contact Plugin
|
|
2
2
|
|
|
3
|
-
contact plugin
|
|
3
|
+
The contact plugin manages ways to reach other agents. A contact represents an established remote-agent relationship and owns one long-lived conversation history. A contact may be one-way: as long as this agent can reach the other agent, it can `check`, `chat`, and `share`.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- `link
|
|
7
|
-
- `approve
|
|
8
|
-
- `list
|
|
9
|
-
- `check
|
|
10
|
-
- `chat
|
|
11
|
-
- `share
|
|
12
|
-
- `inbox
|
|
13
|
-
- `receive
|
|
5
|
+
Available actions:
|
|
6
|
+
- `link`: create a one-time contact code for another agent.
|
|
7
|
+
- `approve`: use a contact code from another agent to establish a contact.
|
|
8
|
+
- `list`: view saved agent contacts.
|
|
9
|
+
- `check`: check whether the other agent is online and reachable.
|
|
10
|
+
- `chat`: talk with a contact.
|
|
11
|
+
- `share`: share text, links, files, or directories.
|
|
12
|
+
- `inbox`: view received shares.
|
|
13
|
+
- `receive`: receive a share.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- chat
|
|
17
|
-
- `link` action
|
|
18
|
-
- public-looking endpoint
|
|
19
|
-
- Agent runtime
|
|
20
|
-
- `approve` action
|
|
21
|
-
- local/private agent
|
|
22
|
-
-
|
|
23
|
-
- `Contact link not found`
|
|
24
|
-
- receive
|
|
25
|
-
-
|
|
15
|
+
Boundaries:
|
|
16
|
+
- Use `chat` for conversation and `share` for handing over materials.
|
|
17
|
+
- The notes returned by the `link` action explain whether a contact code is suitable for local-machine, LAN, or public agents. A localhost contact code must not be given to a server agent for `approve`.
|
|
18
|
+
- A public-looking endpoint may still be blocked by firewall or NAT. Trust the returned notes, and do not promise that public access is guaranteed.
|
|
19
|
+
- The Agent runtime writes `DOWNCITY_PUBLIC_HOST` when available for contact links. This is not a token or endpoint that the user must configure manually.
|
|
20
|
+
- The `approve` action first establishes a one-way relationship. The other agent then pings back to this agent, and only a successful ping upgrades the relationship to bidirectional.
|
|
21
|
+
- When a local/private agent connects to a public agent, the connection is usually outbound-only. Do not describe it as bidirectional.
|
|
22
|
+
- Contact tokens are exchanged automatically by `link` and `approve`. Do not ask the user to manually configure token environment variables.
|
|
23
|
+
- `Contact link not found` means the request reached an agent runtime that does not have this link record. First check whether the endpoint, port, and agent match. Expiration is reported explicitly as `Contact link expired`.
|
|
24
|
+
- `receive` only receives content. It does not execute anything, install skills, or modify project business files automatically.
|
|
25
|
+
- Do not automatically approve or receive unless the user explicitly asks.
|
package/src/image/ImagePlugin.ts
CHANGED
|
@@ -535,31 +535,31 @@ export class ImagePlugin extends BasePlugin {
|
|
|
535
535
|
"",
|
|
536
536
|
"## Actions",
|
|
537
537
|
"",
|
|
538
|
-
"- `models
|
|
539
|
-
"
|
|
540
|
-
"- `image_create
|
|
541
|
-
" -
|
|
542
|
-
" -
|
|
543
|
-
" `[{ type: \"text\", text }, { type: \"image\", url }]
|
|
544
|
-
" -
|
|
545
|
-
" - `url`
|
|
546
|
-
"
|
|
547
|
-
" - `model`
|
|
548
|
-
"- `image_result
|
|
549
|
-
" -
|
|
550
|
-
" -
|
|
551
|
-
" - `succeeded
|
|
552
|
-
" -
|
|
553
|
-
" - `failed
|
|
538
|
+
"- `models`: list currently available image models and return `{ models }`.",
|
|
539
|
+
" Call this first when you do not know which model to use and the plugin has no default image model. Let the user or current task context specify the model ID.",
|
|
540
|
+
"- `image_create`: create an async image job after explicit user confirmation, returning `{ job_id, status }`.",
|
|
541
|
+
" - Text-only generation: pass `prompt` as a string.",
|
|
542
|
+
" - Edits or reference images: pass `content` in this shape:",
|
|
543
|
+
" `[{ type: \"text\", text }, { type: \"image\", url }]`. Multiple text parts and images may appear in any order.",
|
|
544
|
+
" - If both `content` and `prompt` are provided, `content` takes effect and `prompt` is ignored.",
|
|
545
|
+
" - `url` supports three forms: online URL, absolute local path, or a relative path from the Agent project root.",
|
|
546
|
+
" Do not pass base64/data URLs, and do not use the legacy `messages` field.",
|
|
547
|
+
" - `model` is optional. If omitted, the plugin-configured default image model is used. Optional parameters include `aspect_ratio` such as `16:9`, `size` such as `1024x1024`, `quality`, and `seed`.",
|
|
548
|
+
"- `image_result`: read job status by `job_id`.",
|
|
549
|
+
" - By default, read once. If the status is `queued` or `running`, save the `job_id` and check again in a later turn; do not repeatedly poll in the same turn.",
|
|
550
|
+
" - To wait for the image directly, pass `until_done: true` with optional `max_wait_ms` (default 60000, max 600000) and `poll_interval_ms` (default 1500). If the wait times out, the latest intermediate status is returned.",
|
|
551
|
+
" - `succeeded`: returned image file parts are automatically written to disk and attached to the next assistant message. You do not need to assemble the image manually.",
|
|
552
|
+
" - When replying to the user, you can render images with Markdown image syntax: ``.",
|
|
553
|
+
" - `failed`: report the `error` truthfully to the user. Do not invent image results.",
|
|
554
554
|
"",
|
|
555
555
|
"## Flow",
|
|
556
556
|
"",
|
|
557
|
-
"1.
|
|
558
|
-
"2.
|
|
559
|
-
"3.
|
|
560
|
-
"4. `image_result
|
|
557
|
+
"1. If the plugin has no default image model, confirm the model ID first; call `models` when model selection is needed.",
|
|
558
|
+
"2. Explain to the user that image generation will consume image quota, and wait for explicit confirmation.",
|
|
559
|
+
"3. After the user confirms, call `image_create` to get a `job_id`.",
|
|
560
|
+
"4. Query with `image_result`; short jobs may use `until_done: true` to get the result in one call, while long jobs should save the `job_id` and check again in a later turn.",
|
|
561
561
|
"",
|
|
562
|
-
"
|
|
562
|
+
"When unsure, use `plugin_read { plugin: \"image\", action: \"...\" }` to inspect each action's complete input schema and examples.",
|
|
563
563
|
].join("\n");
|
|
564
564
|
}
|
|
565
565
|
|
|
@@ -127,14 +127,14 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
127
127
|
*/
|
|
128
128
|
readonly actions: PluginActions = {
|
|
129
129
|
status: createAction({
|
|
130
|
-
description: "
|
|
130
|
+
description: "View memory wiki status (wiki/source/working).",
|
|
131
131
|
input_schema: {
|
|
132
132
|
zod: z.object({}).passthrough(),
|
|
133
133
|
json_schema: { type: "object", properties: {} },
|
|
134
134
|
},
|
|
135
|
-
examples: [{ title: "
|
|
135
|
+
examples: [{ title: "View status", payload: {} }],
|
|
136
136
|
command: {
|
|
137
|
-
description: "
|
|
137
|
+
description: "View memory wiki status (wiki/source/working).",
|
|
138
138
|
mapInput() {
|
|
139
139
|
return {};
|
|
140
140
|
},
|
|
@@ -145,7 +145,7 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
145
145
|
},
|
|
146
146
|
}),
|
|
147
147
|
search: createAction({
|
|
148
|
-
description: "
|
|
148
|
+
description: "Search memory wiki, optionally extending into the source layer.",
|
|
149
149
|
input_schema: {
|
|
150
150
|
zod: z.object({
|
|
151
151
|
query: z.string(),
|
|
@@ -157,24 +157,24 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
157
157
|
type: "object",
|
|
158
158
|
required: ["query"],
|
|
159
159
|
properties: {
|
|
160
|
-
query: { type: "string", description: "
|
|
161
|
-
maxResults: { type: "number", description: "
|
|
162
|
-
minScore: { type: "number", description: "
|
|
163
|
-
includeSources: { type: "boolean", description: "
|
|
160
|
+
query: { type: "string", description: "Search query." },
|
|
161
|
+
maxResults: { type: "number", description: "Maximum number of results." },
|
|
162
|
+
minScore: { type: "number", description: "Minimum relevance score." },
|
|
163
|
+
includeSources: { type: "boolean", description: "Whether to include the source layer." },
|
|
164
164
|
},
|
|
165
165
|
},
|
|
166
166
|
},
|
|
167
167
|
examples: [
|
|
168
|
-
{ title: "
|
|
168
|
+
{ title: "Search memory", payload: { query: "user preferences" } },
|
|
169
169
|
],
|
|
170
170
|
command: {
|
|
171
|
-
description: "
|
|
171
|
+
description: "Search memory wiki.",
|
|
172
172
|
configure(command: Command) {
|
|
173
173
|
command
|
|
174
174
|
.argument("<query>")
|
|
175
|
-
.option("--max-results <number>", "
|
|
176
|
-
.option("--min-score <number>", "
|
|
177
|
-
.option("--include-sources", "
|
|
175
|
+
.option("--max-results <number>", "Maximum number of results.", parsePositiveInteger)
|
|
176
|
+
.option("--min-score <number>", "Minimum relevance score.", parseNumber)
|
|
177
|
+
.option("--include-sources", "Also search the raw source layer.");
|
|
178
178
|
},
|
|
179
179
|
mapInput({ args, opts }) {
|
|
180
180
|
const payload: JsonObject = {
|
|
@@ -204,7 +204,7 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
204
204
|
},
|
|
205
205
|
}),
|
|
206
206
|
read: createAction({
|
|
207
|
-
description: "
|
|
207
|
+
description: "Read a memory wiki/source file excerpt.",
|
|
208
208
|
input_schema: {
|
|
209
209
|
zod: z.object({
|
|
210
210
|
path: z.string(),
|
|
@@ -215,22 +215,22 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
215
215
|
type: "object",
|
|
216
216
|
required: ["path"],
|
|
217
217
|
properties: {
|
|
218
|
-
path: { type: "string", description: "
|
|
219
|
-
from: { type: "number", description: "
|
|
220
|
-
lines: { type: "number", description: "
|
|
218
|
+
path: { type: "string", description: "Memory file path relative to the project root." },
|
|
219
|
+
from: { type: "number", description: "Starting line, 1-based." },
|
|
220
|
+
lines: { type: "number", description: "Number of lines to read." },
|
|
221
221
|
},
|
|
222
222
|
},
|
|
223
223
|
},
|
|
224
224
|
examples: [
|
|
225
|
-
{ title: "
|
|
225
|
+
{ title: "Read full page", payload: { path: ".downcity/memory/wiki/index.md" } },
|
|
226
226
|
],
|
|
227
227
|
command: {
|
|
228
|
-
description: "
|
|
228
|
+
description: "Read a memory wiki/source file excerpt.",
|
|
229
229
|
configure(command: Command) {
|
|
230
230
|
command
|
|
231
|
-
.argument("<memoryPath>", "
|
|
232
|
-
.option("--from <number>", "
|
|
233
|
-
.option("--lines <number>", "
|
|
231
|
+
.argument("<memoryPath>", "Memory file path relative to the project root.")
|
|
232
|
+
.option("--from <number>", "Starting line, 1-based.", parsePositiveInteger)
|
|
233
|
+
.option("--lines <number>", "Number of lines to read.", parsePositiveInteger);
|
|
234
234
|
},
|
|
235
235
|
mapInput({ args, opts }) {
|
|
236
236
|
const payload: JsonObject = {
|
|
@@ -255,7 +255,7 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
255
255
|
},
|
|
256
256
|
}),
|
|
257
257
|
remember: createAction({
|
|
258
|
-
description: "
|
|
258
|
+
description: "Record facts, preferences, or decisions into memory wiki.",
|
|
259
259
|
input_schema: {
|
|
260
260
|
zod: z.object({
|
|
261
261
|
content: z.string(),
|
|
@@ -267,24 +267,24 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
267
267
|
type: "object",
|
|
268
268
|
required: ["content"],
|
|
269
269
|
properties: {
|
|
270
|
-
content: { type: "string", description: "
|
|
271
|
-
topic: { type: "string", description: "
|
|
272
|
-
path: { type: "string", description: "
|
|
273
|
-
source: { type: "string", description: "
|
|
270
|
+
content: { type: "string", description: "Content to remember." },
|
|
271
|
+
topic: { type: "string", description: "Memory topic." },
|
|
272
|
+
path: { type: "string", description: "Target wiki page path." },
|
|
273
|
+
source: { type: "string", description: "Source note." },
|
|
274
274
|
},
|
|
275
275
|
},
|
|
276
276
|
},
|
|
277
277
|
examples: [
|
|
278
|
-
{ title: "
|
|
278
|
+
{ title: "Remember preference", payload: { content: "User prefers concise answers", topic: "user-prefs" } },
|
|
279
279
|
],
|
|
280
280
|
command: {
|
|
281
|
-
description: "
|
|
281
|
+
description: "Record facts, preferences, or decisions into memory wiki.",
|
|
282
282
|
configure(command: Command) {
|
|
283
283
|
command
|
|
284
|
-
.requiredOption("--content <text>", "
|
|
285
|
-
.option("--topic <topic>", "
|
|
286
|
-
.option("--wiki-path <path>", "
|
|
287
|
-
.option("--source <source>", "
|
|
284
|
+
.requiredOption("--content <text>", "Content to remember.")
|
|
285
|
+
.option("--topic <topic>", "Memory topic.")
|
|
286
|
+
.option("--wiki-path <path>", "Target wiki page path.")
|
|
287
|
+
.option("--source <source>", "Source note.");
|
|
288
288
|
},
|
|
289
289
|
mapInput({ opts }) {
|
|
290
290
|
const payload: JsonObject = {
|
|
@@ -313,7 +313,7 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
313
313
|
},
|
|
314
314
|
}),
|
|
315
315
|
digest: createAction({
|
|
316
|
-
description: "
|
|
316
|
+
description: "Digest a session into memory wiki.",
|
|
317
317
|
input_schema: {
|
|
318
318
|
zod: z.object({
|
|
319
319
|
sessionId: z.string(),
|
|
@@ -323,20 +323,20 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
323
323
|
type: "object",
|
|
324
324
|
required: ["sessionId"],
|
|
325
325
|
properties: {
|
|
326
|
-
sessionId: { type: "string", description: "
|
|
327
|
-
maxMessages: { type: "number", description: "
|
|
326
|
+
sessionId: { type: "string", description: "Session ID." },
|
|
327
|
+
maxMessages: { type: "number", description: "Message extraction window." },
|
|
328
328
|
},
|
|
329
329
|
},
|
|
330
330
|
},
|
|
331
331
|
examples: [
|
|
332
|
-
{ title: "
|
|
332
|
+
{ title: "Digest session", payload: { sessionId: "sess-1" } },
|
|
333
333
|
],
|
|
334
334
|
command: {
|
|
335
|
-
description: "
|
|
335
|
+
description: "Digest a session into memory wiki.",
|
|
336
336
|
configure(command: Command) {
|
|
337
337
|
command
|
|
338
|
-
.requiredOption("--session-id <sessionId>", "
|
|
339
|
-
.option("--max-messages <number>", "
|
|
338
|
+
.requiredOption("--session-id <sessionId>", "Session ID.")
|
|
339
|
+
.option("--max-messages <number>", "Message extraction window.", parsePositiveInteger);
|
|
340
340
|
},
|
|
341
341
|
mapInput({ opts }) {
|
|
342
342
|
const payload: JsonObject = {
|
|
@@ -357,7 +357,7 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
357
357
|
},
|
|
358
358
|
}),
|
|
359
359
|
revise: createAction({
|
|
360
|
-
description: "
|
|
360
|
+
description: "Revise a memory wiki page based on new evidence.",
|
|
361
361
|
input_schema: {
|
|
362
362
|
zod: z.object({
|
|
363
363
|
path: z.string(),
|
|
@@ -368,25 +368,25 @@ export class MemoryPlugin extends BasePlugin {
|
|
|
368
368
|
type: "object",
|
|
369
369
|
required: ["path", "instruction"],
|
|
370
370
|
properties: {
|
|
371
|
-
path: { type: "string", description: "
|
|
372
|
-
instruction: { type: "string", description: "
|
|
373
|
-
evidence: { type: "string", description: "
|
|
371
|
+
path: { type: "string", description: "Target wiki page path." },
|
|
372
|
+
instruction: { type: "string", description: "Revision instruction." },
|
|
373
|
+
evidence: { type: "string", description: "New evidence." },
|
|
374
374
|
},
|
|
375
375
|
},
|
|
376
376
|
},
|
|
377
377
|
examples: [
|
|
378
378
|
{
|
|
379
|
-
title: "
|
|
380
|
-
payload: { path: "wiki/preferences.md", instruction: "
|
|
379
|
+
title: "Revise entry",
|
|
380
|
+
payload: { path: "wiki/preferences.md", instruction: "Replace with latest preference." },
|
|
381
381
|
},
|
|
382
382
|
],
|
|
383
383
|
command: {
|
|
384
|
-
description: "
|
|
384
|
+
description: "Revise a memory wiki page based on new evidence.",
|
|
385
385
|
configure(command: Command) {
|
|
386
386
|
command
|
|
387
|
-
.argument("<memoryPath>", "
|
|
388
|
-
.requiredOption("--instruction <text>", "
|
|
389
|
-
.option("--evidence <text>", "
|
|
387
|
+
.argument("<memoryPath>", "Target wiki page path.")
|
|
388
|
+
.requiredOption("--instruction <text>", "Revision instruction.")
|
|
389
|
+
.option("--evidence <text>", "New evidence.");
|
|
390
390
|
},
|
|
391
391
|
mapInput({ args, opts }) {
|
|
392
392
|
const payload: JsonObject = {
|
package/src/skill/PROMPT.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Source: src/skill/PROMPT.ts.txt
|
|
7
|
-
const TEXT_MODULE_CONTENT = "# Skill Plugin\n\
|
|
7
|
+
const TEXT_MODULE_CONTENT = "# Skill Plugin\n\nSkills are capabilities available to you. For every user request or task, first consider whether a relevant skill can help you complete it with higher quality.\n\n## Usage\n\nBefore using a skill, load its content through the `skill` plugin's `lookup` action.\n\nIf `plugin_call` is available, use:\n\n```ts\nplugin_call({\n plugin: \"skill\",\n action: \"lookup\",\n payload: {\n name: \"<skill-name>\",\n },\n});\n```\n\nAvailable actions include `list`, `find`, `install`, and `lookup`.\n";
|
|
8
8
|
|
|
9
9
|
export default TEXT_MODULE_CONTENT;
|
package/src/skill/PROMPT.ts.txt
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# Skill Plugin
|
|
2
2
|
|
|
3
|
-
skill
|
|
3
|
+
Skills are capabilities available to you. For every user request or task, first consider whether a relevant skill can help you complete it with higher quality.
|
|
4
4
|
|
|
5
|
+
## Usage
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
Before using a skill, load its content through the `skill` plugin's `lookup` action.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
如果当前工具集中存在 `plugin_call`,使用:
|
|
9
|
+
If `plugin_call` is available, use:
|
|
11
10
|
|
|
12
11
|
```ts
|
|
13
12
|
plugin_call({
|
|
@@ -19,4 +18,4 @@ plugin_call({
|
|
|
19
18
|
});
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
Available actions include `list`, `find`, `install`, and `lookup`.
|
package/src/skill/Plugin.ts
CHANGED
|
@@ -108,7 +108,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
108
108
|
},
|
|
109
109
|
actions: {
|
|
110
110
|
[SKILL_PLUGIN_ACTIONS.find]: createAction({
|
|
111
|
-
description: "
|
|
111
|
+
description: "Find unlearned skills that are not in `list`; install only if missing.",
|
|
112
112
|
input_schema: {
|
|
113
113
|
zod: z.object({
|
|
114
114
|
query: z.string(),
|
|
@@ -117,18 +117,18 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
117
117
|
type: "object",
|
|
118
118
|
required: ["query"],
|
|
119
119
|
properties: {
|
|
120
|
-
query: { type: "string", description: "Skill
|
|
120
|
+
query: { type: "string", description: "Skill search query." },
|
|
121
121
|
},
|
|
122
122
|
},
|
|
123
123
|
},
|
|
124
124
|
examples: [
|
|
125
125
|
{
|
|
126
|
-
title: "
|
|
126
|
+
title: "Find skill",
|
|
127
127
|
payload: { query: "web-search" },
|
|
128
128
|
},
|
|
129
129
|
],
|
|
130
130
|
command: {
|
|
131
|
-
description: "
|
|
131
|
+
description: "Find unlearned skills that are not in `list`; install only if missing.",
|
|
132
132
|
configure(command) {
|
|
133
133
|
command.argument("<query>");
|
|
134
134
|
},
|
|
@@ -151,7 +151,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
151
151
|
success: true,
|
|
152
152
|
data: {
|
|
153
153
|
query: payload.query,
|
|
154
|
-
message: "
|
|
154
|
+
message: "This skill is already in list; installation is not needed. Run lookup before using it.",
|
|
155
155
|
workflow: ["list", "lookup"],
|
|
156
156
|
nextAction: "lookup",
|
|
157
157
|
learnedSkill: exactLearned,
|
|
@@ -171,7 +171,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
171
171
|
success: true,
|
|
172
172
|
data: {
|
|
173
173
|
query: payload.query,
|
|
174
|
-
message: "
|
|
174
|
+
message: "Missing-skill search completed. If the target is not in list, install it and then run lookup.",
|
|
175
175
|
workflow: ["find", "install", "lookup"],
|
|
176
176
|
nextAction: "install",
|
|
177
177
|
learnedSkill: null,
|
|
@@ -181,7 +181,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
181
181
|
},
|
|
182
182
|
}),
|
|
183
183
|
[SKILL_PLUGIN_ACTIONS.install]: createAction({
|
|
184
|
-
description: "
|
|
184
|
+
description: "Install a skill that is not in `list`; run lookup after installation.",
|
|
185
185
|
input_schema: {
|
|
186
186
|
zod: z.object({
|
|
187
187
|
spec: z.string(),
|
|
@@ -193,21 +193,21 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
193
193
|
type: "object",
|
|
194
194
|
required: ["spec"],
|
|
195
195
|
properties: {
|
|
196
|
-
spec: { type: "string", description: "Skill
|
|
197
|
-
global: { type: "boolean", description: "
|
|
198
|
-
yes: { type: "boolean", description: "
|
|
199
|
-
agent: { type: "string", description: "
|
|
196
|
+
spec: { type: "string", description: "Skill installation spec." },
|
|
197
|
+
global: { type: "boolean", description: "Whether to install globally." },
|
|
198
|
+
yes: { type: "boolean", description: "Skip confirmation." },
|
|
199
|
+
agent: { type: "string", description: "Target agent." },
|
|
200
200
|
},
|
|
201
201
|
},
|
|
202
202
|
},
|
|
203
203
|
examples: [
|
|
204
204
|
{
|
|
205
|
-
title: "
|
|
205
|
+
title: "Install skill",
|
|
206
206
|
payload: { spec: "web-search", global: true, yes: true },
|
|
207
207
|
},
|
|
208
208
|
],
|
|
209
209
|
command: {
|
|
210
|
-
description: "
|
|
210
|
+
description: "Install a skill that is not in `list`; run lookup after installation.",
|
|
211
211
|
configure(command) {
|
|
212
212
|
command
|
|
213
213
|
.argument("<spec>")
|
|
@@ -242,7 +242,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
242
242
|
data: {
|
|
243
243
|
spec: payload.spec,
|
|
244
244
|
skipped: true,
|
|
245
|
-
message: "
|
|
245
|
+
message: "The skill is already in list; installation is not needed. Run lookup before using it.",
|
|
246
246
|
workflow: ["list", "lookup"],
|
|
247
247
|
nextAction: "lookup",
|
|
248
248
|
queryFromSpec,
|
|
@@ -268,7 +268,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
268
268
|
success: true,
|
|
269
269
|
data: {
|
|
270
270
|
spec: payload.spec,
|
|
271
|
-
message: "
|
|
271
|
+
message: "Skill learning completed. Before using the skill, run lookup to read its SKILL.md content.",
|
|
272
272
|
workflow: ["find", "install", "lookup"],
|
|
273
273
|
nextAction: "lookup",
|
|
274
274
|
skipped: false,
|
|
@@ -280,7 +280,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
280
280
|
},
|
|
281
281
|
}),
|
|
282
282
|
[SKILL_PLUGIN_ACTIONS.list]: createAction({
|
|
283
|
-
description: "
|
|
283
|
+
description: "List currently learned skills discoverable locally.",
|
|
284
284
|
input_schema: {
|
|
285
285
|
zod: z.object({}).passthrough(),
|
|
286
286
|
json_schema: {
|
|
@@ -290,12 +290,12 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
290
290
|
},
|
|
291
291
|
examples: [
|
|
292
292
|
{
|
|
293
|
-
title: "
|
|
293
|
+
title: "List skills",
|
|
294
294
|
payload: {},
|
|
295
295
|
},
|
|
296
296
|
],
|
|
297
297
|
command: {
|
|
298
|
-
description: "
|
|
298
|
+
description: "List currently learned skills discoverable locally.",
|
|
299
299
|
mapInput() {
|
|
300
300
|
return {};
|
|
301
301
|
},
|
|
@@ -311,7 +311,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
311
311
|
},
|
|
312
312
|
}),
|
|
313
313
|
[SKILL_PLUGIN_ACTIONS.lookup]: createAction({
|
|
314
|
-
description: "
|
|
314
|
+
description: "Read learned skill content (SKILL.md).",
|
|
315
315
|
input_schema: {
|
|
316
316
|
zod: z.object({
|
|
317
317
|
name: z.string(),
|
|
@@ -320,18 +320,18 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
320
320
|
type: "object",
|
|
321
321
|
required: ["name"],
|
|
322
322
|
properties: {
|
|
323
|
-
name: { type: "string", description: "Skill
|
|
323
|
+
name: { type: "string", description: "Skill name." },
|
|
324
324
|
},
|
|
325
325
|
},
|
|
326
326
|
},
|
|
327
327
|
examples: [
|
|
328
328
|
{
|
|
329
|
-
title: "
|
|
329
|
+
title: "Read skill",
|
|
330
330
|
payload: { name: "web-search" },
|
|
331
331
|
},
|
|
332
332
|
],
|
|
333
333
|
command: {
|
|
334
|
-
description: "
|
|
334
|
+
description: "Read learned skill content (SKILL.md).",
|
|
335
335
|
configure(command) {
|
|
336
336
|
command.argument("<name>");
|
|
337
337
|
},
|
|
@@ -384,7 +384,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
384
384
|
data: {
|
|
385
385
|
success: true,
|
|
386
386
|
...(result.skill ? { skill: result.skill } : {}),
|
|
387
|
-
message: "
|
|
387
|
+
message: "Skill content is ready. Next it will be injected as a `<skill>...</skill>` user message.",
|
|
388
388
|
__ship: {
|
|
389
389
|
injectUserMessages: [
|
|
390
390
|
{
|
package/src/task/Action.ts
CHANGED
|
@@ -396,7 +396,7 @@ export async function runTaskDefinition(params: {
|
|
|
396
396
|
success: true,
|
|
397
397
|
accepted: true,
|
|
398
398
|
// 关键点(中文):这里直接返回给 agent 作为 tool result,提醒它这是异步任务,无需等待完成即可继续后续流程。
|
|
399
|
-
message: "
|
|
399
|
+
message: "The task has started. When it finishes, the task runtime will send the result to the user automatically. Continue the current flow without waiting for the task to complete.",
|
|
400
400
|
executionId,
|
|
401
401
|
title,
|
|
402
402
|
};
|