@downcity/plugins 1.0.145 → 1.0.148
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/chat/runtime/ChatSessionContextComposer.d.ts +2 -2
- package/bin/chat/runtime/ChatSessionContextComposer.d.ts.map +1 -1
- package/bin/chat/runtime/ChatSessionTypes.d.ts +1 -1
- package/bin/chat/runtime/ChatSessionTypes.d.ts.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/contact/runtime/ChatRuntime.js.map +1 -1
- package/bin/image/ImagePlugin.js +21 -21
- package/bin/image/ImagePlugin.js.map +1 -1
- package/bin/memory/Action.js +2 -2
- package/bin/memory/Action.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/task/runtime/TaskRunnerSession.js +3 -3
- package/bin/task/runtime/TaskRunnerSession.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/chat/runtime/ChatSessionContextComposer.ts +2 -2
- package/src/chat/runtime/ChatSessionTypes.ts +1 -1
- package/src/contact/Action.ts +48 -48
- package/src/contact/PROMPT.ts +1 -1
- package/src/contact/PROMPT.ts.txt +22 -22
- package/src/contact/runtime/ChatRuntime.ts +2 -2
- package/src/image/ImagePlugin.ts +21 -21
- package/src/memory/Action.ts +2 -2
- 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/task/runtime/TaskRunnerSession.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/task/PROMPT.ts.txt
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
# Task Plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
You can use the `task` plugin to manage task definitions, execution, scheduling, and status control.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Task Model
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- frontmatter
|
|
9
|
-
- body
|
|
7
|
+
Each task is defined in `./.downcity/task/<title>/task.md` and contains:
|
|
8
|
+
- frontmatter for structured fields
|
|
9
|
+
- body for the task instructions
|
|
10
10
|
|
|
11
|
-
frontmatter
|
|
12
|
-
- `title
|
|
13
|
-
- `description
|
|
14
|
-
- `when
|
|
15
|
-
- `sessionId
|
|
16
|
-
- `status
|
|
17
|
-
- `kind
|
|
11
|
+
Core frontmatter fields:
|
|
12
|
+
- `title`: unique task identifier
|
|
13
|
+
- `description`: task description
|
|
14
|
+
- `when`: trigger condition, supporting `@manual`, cron, or `time:<ISO8601-with-timezone>`
|
|
15
|
+
- `sessionId`: task execution session
|
|
16
|
+
- `status`: `enabled|paused|disabled`
|
|
17
|
+
- `kind`: `agent|script`, defaulting to `agent`
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Each execution creates a run directory:
|
|
20
20
|
- `./.downcity/task/<title>/<timestamp>/`
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Common artifacts:
|
|
23
23
|
- `input.md`
|
|
24
|
-
- `output.md
|
|
25
|
-
- `result.md
|
|
24
|
+
- `output.md`: final output body for this run
|
|
25
|
+
- `result.md`: execution summary
|
|
26
26
|
- `run.json`
|
|
27
27
|
- `run-progress.json`
|
|
28
|
-
- `dialogue.md` / `dialogue.json
|
|
29
|
-
- `error.md
|
|
28
|
+
- `dialogue.md` / `dialogue.json`: multi-turn agent dialogue
|
|
29
|
+
- `error.md`: failure details
|
|
30
30
|
|
|
31
|
-
##
|
|
31
|
+
## Execution Kinds
|
|
32
32
|
|
|
33
33
|
1. `kind=agent`
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
34
|
+
- Sends the task body to an agent for execution.
|
|
35
|
+
- Completes in a single turn by default. Simulated multi-turn review is enabled only when frontmatter explicitly sets `review: true`.
|
|
36
|
+
- Suitable for research, analysis, and report generation.
|
|
37
37
|
|
|
38
38
|
2. `kind=script`
|
|
39
|
-
-
|
|
40
|
-
-
|
|
39
|
+
- Treats the body as a shell script.
|
|
40
|
+
- The body must be non-empty and executable as a script.
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Available Actions
|
|
43
43
|
|
|
44
44
|
- `list`
|
|
45
45
|
- `create`
|
|
@@ -50,7 +50,7 @@ frontmatter 核心字段:
|
|
|
50
50
|
- `enable`
|
|
51
51
|
- `disable`
|
|
52
52
|
|
|
53
|
-
## Action
|
|
53
|
+
## Action Examples
|
|
54
54
|
|
|
55
55
|
- `plugin_call({ plugin: "task", action: "list", payload: { status } })`
|
|
56
56
|
- `plugin_call({ plugin: "task", action: "create", payload: { title, description, sessionId, when, kind, status } })`
|
|
@@ -58,180 +58,180 @@ frontmatter 核心字段:
|
|
|
58
58
|
- `plugin_call({ plugin: "task", action: "update", payload: { title, description, when, status, sessionId } })`
|
|
59
59
|
- `plugin_call({ plugin: "task", action: "delete", payload: { title } })`
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Key Constraints
|
|
62
62
|
|
|
63
|
-
- `title`
|
|
64
|
-
- `when=time:...`
|
|
65
|
-
- `run`
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
63
|
+
- `title` is unique. `create` deduplicates only by exact `title`.
|
|
64
|
+
- After `when=time:...` triggers, the task is automatically set to `paused` and falls back to `when=@manual`.
|
|
65
|
+
- `run` is accepted asynchronously. It returns `accepted=true`, `message`, and `executionId` immediately. Treat this as "the task has entered background execution; the result will be sent automatically through the chat plugin runtime, and the current flow does not need to block."
|
|
66
|
+
- If `run` returns `accepted=true`:
|
|
67
|
+
- Do not manually forward task output to the user again.
|
|
68
|
+
- Do not actively poll the run directory, `run-progress.json`, or `output.md`.
|
|
69
|
+
- Inspect the run directory only when the user explicitly asks to debug, view artifacts, or confirm execution details.
|
|
70
|
+
- Agent tasks only need to produce valid output by default. They should send to an external channel only when the task body explicitly requires it.
|
|
71
71
|
|
|
72
|
-
##
|
|
72
|
+
## Designing The Task Body
|
|
73
73
|
|
|
74
|
-
###
|
|
74
|
+
### Recommended Agent Task Structure
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
The body should include at least these headings:
|
|
77
77
|
|
|
78
78
|
```md
|
|
79
|
-
#
|
|
79
|
+
# Task Goal
|
|
80
80
|
|
|
81
|
-
-
|
|
81
|
+
- What final result this task must deliver.
|
|
82
82
|
|
|
83
|
-
#
|
|
83
|
+
# Background And Input
|
|
84
84
|
|
|
85
|
-
-
|
|
85
|
+
- Data sources, scope, constraints, and reference materials.
|
|
86
86
|
|
|
87
|
-
#
|
|
87
|
+
# Execution Steps
|
|
88
88
|
|
|
89
|
-
1.
|
|
90
|
-
2.
|
|
91
|
-
3.
|
|
89
|
+
1. What to do first.
|
|
90
|
+
2. What to do next.
|
|
91
|
+
3. Where key intermediate artifacts should be written.
|
|
92
92
|
|
|
93
|
-
#
|
|
93
|
+
# Output Requirements
|
|
94
94
|
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
95
|
+
- What format the final result must use.
|
|
96
|
+
- Whether a table, JSON, or Markdown is required.
|
|
97
|
+
- What content must not be included.
|
|
98
98
|
|
|
99
|
-
#
|
|
99
|
+
# Trigger And Status Recommendation
|
|
100
100
|
|
|
101
|
-
-
|
|
102
|
-
-
|
|
101
|
+
- Why this task is suitable for `@manual`, cron, or `time:...`.
|
|
102
|
+
- Whether it should currently be `paused` or `enabled`.
|
|
103
103
|
|
|
104
|
-
#
|
|
104
|
+
# Notes
|
|
105
105
|
|
|
106
|
-
-
|
|
106
|
+
- Risks, boundaries, and things not to do.
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
###
|
|
110
|
-
|
|
111
|
-
- task
|
|
112
|
-
- `#
|
|
113
|
-
- `#
|
|
114
|
-
- `#
|
|
115
|
-
- `#
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
|
|
123
|
-
###
|
|
124
|
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
|
|
147
|
-
###
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
|
|
154
|
-
###
|
|
155
|
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
###
|
|
162
|
-
|
|
163
|
-
- task
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
|
|
171
|
-
### `when`
|
|
172
|
-
|
|
173
|
-
- task
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
|
|
178
|
-
##
|
|
179
|
-
|
|
180
|
-
###
|
|
109
|
+
### Agent Task Body Writing Constraints
|
|
110
|
+
|
|
111
|
+
- The task body must read like a delivery contract, so another executor can run it directly without relying on the current chat context.
|
|
112
|
+
- `# Task Goal` must clearly state the final deliverable. Do not write vague goals such as "take a look", "research this", or "handle this".
|
|
113
|
+
- `# Background And Input` must specify sources, scope, objects, time range, and constraints. Do not assume the executor can see the original chat context.
|
|
114
|
+
- `# Execution Steps` should describe the task workflow, not task-management actions. Do not write "first check whether a task with the same name exists", "then create a task", or "then trigger the task".
|
|
115
|
+
- `# Output Requirements` must clearly specify the final artifact's format, structure, tone, length, and excluded content.
|
|
116
|
+
- Explicitly state that the final assistant message will be written directly to `output.md` and sent to the user. Therefore, the final answer must be exactly the deliverable content.
|
|
117
|
+
- Content-generation tasks such as daily reports, reminders, morning briefings, summaries, and reports must explicitly require "the final output is the deliverable body itself". Do not let the executor output process notes.
|
|
118
|
+
- If the task result should be sent to the user, the body should require "output send-ready message content" instead of asking the executor to explain what it has sent.
|
|
119
|
+
- Unless truly needed, do not ask the executor to repeat the task title, sessionId, execution time, status, or other metadata in the body.
|
|
120
|
+
- Constraints in the body must be executable and checkable. Avoid weak phrases such as "appropriately", "as much as possible", or "depending on the situation".
|
|
121
|
+
- Do not put task creation, task update, task status lookup, or same-title existence checks into the body. Those belong to the task plugin, not to the task deliverable.
|
|
122
|
+
|
|
123
|
+
### Forbidden Agent Task Body Patterns
|
|
124
|
+
|
|
125
|
+
- Do not write the body in chat-reply style, for example:
|
|
126
|
+
- "I will help you..."
|
|
127
|
+
- "First, let me..."
|
|
128
|
+
- "I will check first..."
|
|
129
|
+
- "I see there is already a task with the same name..."
|
|
130
|
+
- Do not write the body as task-management instructions, for example:
|
|
131
|
+
- "If the task exists, update it; otherwise create it."
|
|
132
|
+
- "First list, then run."
|
|
133
|
+
- "Tell the user that the task has started when done."
|
|
134
|
+
- Do not write the body as a status-report template, for example:
|
|
135
|
+
- "Task status summary"
|
|
136
|
+
- "Sent / completed / updated"
|
|
137
|
+
- "Current task configuration"
|
|
138
|
+
- Do not describe only actions without describing the deliverable, for example:
|
|
139
|
+
- "Go collect some materials."
|
|
140
|
+
- "Generate some content and see."
|
|
141
|
+
- "Report back after finishing."
|
|
142
|
+
- Do not use references that depend on the current context, for example:
|
|
143
|
+
- "Do what was said above."
|
|
144
|
+
- "Continue the previous one."
|
|
145
|
+
- "Send this out."
|
|
146
|
+
|
|
147
|
+
### How To Judge Whether The Body Is Good
|
|
148
|
+
|
|
149
|
+
- If you can copy the task body alone to another agent and it can still understand the goal, input, steps, and deliverable, the body is valid.
|
|
150
|
+
- If deleting the output section leaves only "go do something" style instructions, the body is invalid.
|
|
151
|
+
- If the body looks more like instructions for creating or updating a task than instructions for executing the task, the layering is wrong and the body must be rewritten.
|
|
152
|
+
- If the body naturally encourages the executor to output process notes instead of the final artifact, the `# Output Requirements` section is not strong enough and must add explicit prohibitions.
|
|
153
|
+
|
|
154
|
+
### Recommended Script Task Structure
|
|
155
|
+
|
|
156
|
+
- The body must be a pure shell script. Do not mix in explanatory natural language.
|
|
157
|
+
- Start with comments that describe the script's purpose, input dependencies, and failure conditions when possible.
|
|
158
|
+
- Keep output stable so it can be sent directly as the final result.
|
|
159
|
+
- If files need to be generated, write them to the run directory or to an explicit project path.
|
|
160
|
+
|
|
161
|
+
### Output Design Principles
|
|
162
|
+
|
|
163
|
+
- When a task completes, the system automatically sends the final result body back to the chat bound to `sessionId` through the chat plugin runtime's `send`.
|
|
164
|
+
- The current implementation uses the simplest rule: the final assistant message is treated directly as the final result body and written to `output.md`.
|
|
165
|
+
- Therefore, the "Output Requirements" section must be written for the final user, not only for developers.
|
|
166
|
+
- For user-facing agent tasks, the body should require "the final assistant message directly outputs the deliverable itself". Do not let the executor explain how it created, checked, updated, triggered, or sent the task.
|
|
167
|
+
- For content-generation tasks such as daily reports, reminders, morning briefings, and summaries, the final output should be exactly that content. It should not include process language such as "I will handle this", "task sent", or "task status summary".
|
|
168
|
+
- By default, do not ask the executor to call chat plugin send actions again. The system handles final-result delivery.
|
|
169
|
+
- Explicitly require chat plugin actions only for cross-conversation sending, additional CCs, multi-channel notifications, or similar cases.
|
|
170
|
+
|
|
171
|
+
### Choosing `when` And `status`
|
|
172
|
+
|
|
173
|
+
- A task is created as `status=enabled` by default. Set `paused` explicitly only when it is still a draft, likely to fail, or needs human confirmation.
|
|
174
|
+
- For verified stable tasks that need automatic execution, use cron with `status=enabled`.
|
|
175
|
+
- For a clear one-time execution, use `time:<ISO time with timezone>`. After execution, the system automatically falls back to `@manual` and `paused`.
|
|
176
|
+
- If the user only wants to save it for later, do not enable scheduling directly.
|
|
177
|
+
|
|
178
|
+
## Body Templates
|
|
179
|
+
|
|
180
|
+
### Agent Template
|
|
181
181
|
|
|
182
182
|
```md
|
|
183
|
-
#
|
|
183
|
+
# Task Goal
|
|
184
184
|
|
|
185
|
-
-
|
|
185
|
+
- Produce a final result that can be sent directly to the user.
|
|
186
186
|
|
|
187
|
-
#
|
|
187
|
+
# Background And Input
|
|
188
188
|
|
|
189
|
-
-
|
|
189
|
+
- Add context, files, links, scope, and assumptions here.
|
|
190
190
|
|
|
191
|
-
#
|
|
191
|
+
# Execution Steps
|
|
192
192
|
|
|
193
|
-
1.
|
|
194
|
-
2.
|
|
195
|
-
3.
|
|
196
|
-
4.
|
|
193
|
+
1. Understand the task goal and completion criteria.
|
|
194
|
+
2. Collect necessary information and execute the task.
|
|
195
|
+
3. Write key intermediate artifacts to the run directory.
|
|
196
|
+
4. Output the final result body.
|
|
197
197
|
|
|
198
|
-
#
|
|
198
|
+
# Output Requirements
|
|
199
199
|
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
200
|
+
- The final assistant message is the final result. Do not include long logs.
|
|
201
|
+
- The final assistant message must output the deliverable itself. Do not output task-management process, sending process, or status reports.
|
|
202
|
+
- Do not use meta language such as "I will help you...", "First, let me...", or "sent".
|
|
203
|
+
- By default, do not call the chat plugin send action again.
|
|
204
204
|
|
|
205
|
-
#
|
|
205
|
+
# Trigger And Status Recommendation
|
|
206
206
|
|
|
207
|
-
-
|
|
207
|
+
- Enable by default after creation. If this is only a draft or waiting for human confirmation, set it to `paused`.
|
|
208
208
|
|
|
209
|
-
#
|
|
209
|
+
# Notes
|
|
210
210
|
|
|
211
|
-
-
|
|
211
|
+
- Call chat plugin send actions only when cross-conversation or additional notifications are explicitly needed.
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
###
|
|
214
|
+
### Script Template
|
|
215
215
|
|
|
216
216
|
```bash
|
|
217
|
-
#
|
|
218
|
-
#
|
|
219
|
-
#
|
|
217
|
+
# Task goal: state in one sentence what the script should do
|
|
218
|
+
# Input dependencies: list environment variables, files, and command dependencies
|
|
219
|
+
# Failure conditions: list cases that should exit 1
|
|
220
220
|
|
|
221
221
|
set -euo pipefail
|
|
222
222
|
|
|
223
|
-
# 1.
|
|
223
|
+
# 1. Prepare input
|
|
224
224
|
|
|
225
|
-
# 2.
|
|
225
|
+
# 2. Execute main logic
|
|
226
226
|
|
|
227
|
-
# 3.
|
|
227
|
+
# 3. Output final result. This output will be sent directly to the user.
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
-
##
|
|
230
|
+
## Recommendations
|
|
231
231
|
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
- script
|
|
235
|
-
-
|
|
236
|
-
- task
|
|
237
|
-
-
|
|
232
|
+
- Run `list` before `create` or `update`.
|
|
233
|
+
- Keep simple content-generation tasks single-turn by default. Set `review: true` only when you truly need "draft, review, revise".
|
|
234
|
+
- Keep script task bodies as pure scripts, without redundant natural-language explanation.
|
|
235
|
+
- If the user only wants to save something for later, create it as `paused`; otherwise keep the default enabled state.
|
|
236
|
+
- The task body must describe what the final result should look like, not only say "go do this and see".
|
|
237
|
+
- For content-generation tasks, explicitly require "the final assistant message can only be the finished content body" so the executor does not mistake process notes for the final result.
|
|
@@ -142,7 +142,7 @@ export async function runTaskNow(params: {
|
|
|
142
142
|
await runProgress.update({
|
|
143
143
|
status: "running",
|
|
144
144
|
phase: "preparing",
|
|
145
|
-
message: "
|
|
145
|
+
message: "Execution input has been written; preparing to start task execution.",
|
|
146
146
|
...(taskKind === "agent" ? { maxRounds: maxDialogueRounds } : {}),
|
|
147
147
|
});
|
|
148
148
|
|
|
@@ -444,7 +444,7 @@ export async function runTaskNow(params: {
|
|
|
444
444
|
await runProgress.update({
|
|
445
445
|
status: "running",
|
|
446
446
|
phase: "writing_artifacts",
|
|
447
|
-
message: "
|
|
447
|
+
message: "Writing output/result/run metadata.",
|
|
448
448
|
...(taskKind === "agent" ? { maxRounds: maxDialogueRounds } : { maxRounds: 1 }),
|
|
449
449
|
...(dialogueRounds > 0 ? { round: dialogueRounds } : {}),
|
|
450
450
|
});
|