@coze/cli 0.3.5-alpha.b70902 → 0.3.5-alpha.d65c38
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/lib/cli.js +2 -2
- package/lib/session-task-refresh.worker.js +1 -1
- package/lib/task-worker-D4355vX_.js +1 -0
- package/package.json +3 -3
- package/skills/manifest.json +6 -10
- package/skills/using-coze-cli/SKILL.md +1 -1
- package/skills/using-coze-cli/coze-claw/MODULE.md +1 -1
- package/skills/using-coze-cli/coze-code/MODULE.md +1 -1
- package/skills/using-coze-cli/coze-file/MODULE.md +1 -1
- package/skills/using-coze-cli/coze-generate/MODULE.md +1 -1
- package/lib/task-worker-DNJ6Zcpk.js +0 -1
- package/skills/coze-agent-collaboration/SKILL.md +0 -62
- package/skills/coze-agent-collaboration/agents/openai.yaml +0 -4
- package/skills/coze-agent-collaboration/references/at-agent-contract.md +0 -70
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: coze-agent-collaboration
|
|
3
|
-
version: 0.3.5-alpha.b70902
|
|
4
|
-
description: "CRITICAL @Agent dispatch rule: when asked to @ or delegate to a peer Coze project Agent, MUST execute `coze agent at`; rendering an `at://agent:<claw_id>` link or visible @mention is display only and never dispatches. Also use this skill to discover project Agent members, choose where results return, or retry an unchanged request after an unknown transport outcome."
|
|
5
|
-
metadata:
|
|
6
|
-
requires:
|
|
7
|
-
bins: ["coze"]
|
|
8
|
-
cliHelp: "coze agent at --help"
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Coze Agent Collaboration
|
|
12
|
-
|
|
13
|
-
Use `coze agent at` to send a project-group `@Agent` collaboration request. An `at://agent:<claw_id>` link or visible `@name` mention only controls display; it does not send a request or wake the target Agent. Never say the request was sent unless `coze agent at` returned an accepted response.
|
|
14
|
-
|
|
15
|
-
Treat the command as asynchronous dispatch: an accepted response means delivery was queued, not that the delegated work has finished.
|
|
16
|
-
|
|
17
|
-
## Preconditions
|
|
18
|
-
|
|
19
|
-
- Run only inside a current Coze project Agent turn.
|
|
20
|
-
- Obtain `group_id`, `agent_id`, and `reply_to_message_id` from the trusted current-turn context. Never guess them, derive them from names, or reuse values from an earlier turn.
|
|
21
|
-
- Map context fields exactly: `group_id` -> `--project-id`, `agent_id` -> `--source-claw-id`, and `reply_to_message_id` -> `--reply-to-message-id`.
|
|
22
|
-
- Keep `group_id`, `agent_id`, and every `target_claw_id` as decimal strings. Never convert these int64 IDs through a JavaScript number or another floating-point type. Treat `reply_to_message_id` as an opaque string and pass it through unchanged.
|
|
23
|
-
- Keep `reply_to_message_id` within 256 UTF-8 bytes, each target message within 4,000 Unicode code points, and all target messages together within 32 KiB.
|
|
24
|
-
- Check authentication with `coze auth status --format json` when the CLI reports an authentication error.
|
|
25
|
-
- Do not apply Coze App version checks. CLI availability is independent of the App UI version gate.
|
|
26
|
-
|
|
27
|
-
## Workflow
|
|
28
|
-
|
|
29
|
-
1. Refresh current project members before each dispatch:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
coze agent member list --project-id "<group_id>" --format json
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
2. Select only members with `user_type=2` and a non-empty `claw_id`. Exclude the current `agent_id` (the `source_claw_id`). Delegate to at most three Agents per request.
|
|
36
|
-
3. Give every target a concrete, self-contained task. Do not forward secrets or unrelated conversation text.
|
|
37
|
-
4. Call `coze agent at` with the exact current-turn identifiers and a JSON array:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
coze agent at \
|
|
41
|
-
--project-id "<group_id>" \
|
|
42
|
-
--source-claw-id "<agent_id>" \
|
|
43
|
-
--reply-to-message-id "<reply_to_message_id>" \
|
|
44
|
-
--targets '[{"target_claw_id":"<target_claw_id>","message":"Review the API contract and return concrete issues.","response_target_type":"agent"}]' \
|
|
45
|
-
--format json
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
5. Require `code=0`, `data.status="accepted"`, and a non-empty `data.message_id` before treating dispatch as accepted. An `at://agent:<claw_id>` mention without this command result is not a dispatch. Preserve `logid` for diagnostics.
|
|
49
|
-
6. Continue according to `response_target_type`:
|
|
50
|
-
- `agent` (default): the target reports back in a later collaboration turn. Do not block or poll after `accepted`, and do not dispatch a duplicate; incorporate the later response before final synthesis when the task depends on it.
|
|
51
|
-
- `user`: the target delivers directly to the user; use only when direct independent delivery was explicitly intended.
|
|
52
|
-
|
|
53
|
-
## Safety and retry rules
|
|
54
|
-
|
|
55
|
-
- Never target the source Agent itself.
|
|
56
|
-
- Do not invent an `idempotency_key`; the service derives idempotency from trusted request context.
|
|
57
|
-
- On a transport timeout with no response, retry the exact same request. Keep identifiers, target order, messages, and response targets unchanged.
|
|
58
|
-
- Do not retry validation, permission, or membership errors until the underlying input or authorization is corrected.
|
|
59
|
-
- Do not report delegated work as complete from the `accepted` response alone.
|
|
60
|
-
- Prefer one focused request containing all independent targets over several duplicate calls.
|
|
61
|
-
|
|
62
|
-
Read [references/at-agent-contract.md](references/at-agent-contract.md) for the full input/output contract and failure handling.
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# `coze agent at` contract
|
|
2
|
-
|
|
3
|
-
## Command input
|
|
4
|
-
|
|
5
|
-
| Option | Required | Meaning |
|
|
6
|
-
|---|---:|---|
|
|
7
|
-
| `--project-id` | yes | Current context's `group_id`, passed as a decimal string. |
|
|
8
|
-
| `--source-claw-id` | yes | Current context's `agent_id` (the initiating Agent's `claw_id`), passed as a decimal string. |
|
|
9
|
-
| `--reply-to-message-id` | yes | Current context's `reply_to_message_id`; the outgoing AtAgent message replies to this message. It must be 1 to 256 UTF-8 bytes. |
|
|
10
|
-
| `--targets` | yes | JSON array with 1 to 3 target objects. |
|
|
11
|
-
|
|
12
|
-
Each target object has:
|
|
13
|
-
|
|
14
|
-
| Field | Required | Meaning |
|
|
15
|
-
|---|---:|---|
|
|
16
|
-
| `target_claw_id` | yes | Target project Agent's `claw_id`, encoded as a string. |
|
|
17
|
-
| `message` | yes | Non-empty delegated task, at most 4,000 Unicode code points. All target messages together must be at most 32 KiB in UTF-8. |
|
|
18
|
-
| `response_target_type` | no | `agent` (default) or `user`. |
|
|
19
|
-
|
|
20
|
-
Example with parallel targets:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
coze agent at \
|
|
24
|
-
--project-id "7600000000000000001" \
|
|
25
|
-
--source-claw-id "7600000000000000002" \
|
|
26
|
-
--reply-to-message-id "msg_current_turn" \
|
|
27
|
-
--targets '[{"target_claw_id":"7600000000000000003","message":"Audit the API for security risks.","response_target_type":"agent"},{"target_claw_id":"7600000000000000004","message":"Check the user-facing copy and report edits.","response_target_type":"agent"}]' \
|
|
28
|
-
--format json
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Success output
|
|
32
|
-
|
|
33
|
-
The command emits one JSON envelope:
|
|
34
|
-
|
|
35
|
-
```json
|
|
36
|
-
{
|
|
37
|
-
"code": 0,
|
|
38
|
-
"msg": "success",
|
|
39
|
-
"data": {
|
|
40
|
-
"message_id": "generated_dispatch_message_id",
|
|
41
|
-
"status": "accepted",
|
|
42
|
-
"idempotency_replayed": false
|
|
43
|
-
},
|
|
44
|
-
"logid": "request_log_id"
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
- `message_id` identifies the visible project collaboration message.
|
|
49
|
-
- `status=accepted` means asynchronous dispatch was accepted.
|
|
50
|
-
- `idempotency_replayed=true` means the same logical request was already accepted; do not send a new variant merely to force another execution.
|
|
51
|
-
- `logid` is the primary diagnostic key.
|
|
52
|
-
|
|
53
|
-
## Failure handling
|
|
54
|
-
|
|
55
|
-
| Failure | Action |
|
|
56
|
-
|---|---|
|
|
57
|
-
| Invalid JSON or malformed target | Fix locally; do not call again unchanged. |
|
|
58
|
-
| Target is not an Agent project member | Refresh `coze agent member list`; choose an active Agent member. |
|
|
59
|
-
| Target equals source | Choose a different Agent. |
|
|
60
|
-
| Permission/authentication failure | Refresh authentication or trusted runtime context; do not broaden credentials. |
|
|
61
|
-
| Transport timeout, response unknown | Retry the byte-equivalent logical request. |
|
|
62
|
-
| Service error with a `logid` | Preserve the full JSON envelope and diagnose using the `logid`. |
|
|
63
|
-
|
|
64
|
-
## Context discipline
|
|
65
|
-
|
|
66
|
-
Map trusted current-turn context fields exactly: `group_id` -> `--project-id`, `agent_id` -> `--source-claw-id`, and `reply_to_message_id` -> `--reply-to-message-id`.
|
|
67
|
-
|
|
68
|
-
`reply_to_message_id` is an opaque identifier and must refer to the message currently being processed. The outgoing AtAgent message uses it as its reply anchor. Pass it through unchanged. It is not the dispatch result `message_id`, a previous message, a session ID, or a generated random value.
|
|
69
|
-
|
|
70
|
-
Rendering an `at://agent:<claw_id>` link or a visible `@name` mention does not call this contract and does not dispatch work. A real dispatch requires executing `coze agent at` and receiving `code=0`, `data.status="accepted"`, and a non-empty `data.message_id`.
|