@thinkingai/ae-cli 1.0.22 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -1
- package/README.zh.md +40 -1
- package/dist/{auth-YM7OI23X.js → auth-TXFJHPXU.js} +3 -2
- package/dist/{auth-5S7SPPEJ.js → auth-W2JZ3DKA.js} +11 -4
- package/dist/{chunk-MPFTXJFG.js → chunk-2NGWYMLB.js} +14 -2
- package/dist/chunk-6T7245YE.js +478 -0
- package/dist/{chunk-KM57HI5B.js → chunk-B4UL2VIJ.js} +7 -1
- package/dist/{chunk-TMMUBSKW.js → chunk-BI5ZVD6T.js} +8 -1
- package/dist/chunk-MNHE6SSI.js +79 -0
- package/dist/chunk-MWWYGZ76.js +130 -0
- package/dist/{chunk-24ZKQWG2.js → chunk-SRRUNQIM.js} +51 -4
- package/dist/chunk-TG64AQV4.js +262 -0
- package/dist/{chunk-NBFTPIAH.js → chunk-VT6VC4PA.js} +15 -4
- package/dist/{client-7S23DVHH.js → client-IU2E5IOL.js} +6 -3
- package/dist/{config-RVUESJRF.js → config-WH3R3IRY.js} +3 -2
- package/dist/index.js +195 -20
- package/dist/model-CC7U5XOJ.js +131 -0
- package/dist/{raw-5SYAUCJQ.js → raw-TUHZQ4UB.js} +5 -4
- package/dist/sync-EVEDS7YE.js +383 -0
- package/dist/te-agent-FLTDYV3L.js +522 -0
- package/dist/{te-analysis-RQST6AT3.js → te-analysis-CMXADIJM.js} +101 -12
- package/dist/{te-audience-TJ74UJI3.js → te-audience-LPZFFSXM.js} +4 -3
- package/dist/{te-common-W5URM2SH.js → te-common-BXQFKTB3.js} +4 -3
- package/dist/{te-community-YRV2VAD4.js → te-community-K5S3VOZY.js} +4 -3
- package/dist/{te-dataops-ZPH72BCK.js → te-dataops-567IMCQG.js} +4 -3
- package/dist/{te-engage-57UKFV74.js → te-engage-TBUTGW5F.js} +105 -49
- package/dist/{te-kb-GD7SJRYB.js → te-kb-XHVBWP5E.js} +227 -38
- package/dist/{te-meta-25SLZFXJ.js → te-meta-NQ4U3VJW.js} +25 -4
- package/dist/te-team-556APRIU.js +529 -0
- package/package.json +6 -1
- package/skills/ae-agent/SKILL.md +133 -0
- package/skills/ae-analysis/references/create_entity.md +39 -0
- package/skills/ae-analysis/references/create_space.md +34 -0
- package/skills/ae-analysis/references/drilldown_user_events.md +1 -1
- package/skills/ae-analysis/references/drilldown_users.md +2 -2
- package/skills/ae-analysis/references/query_adhoc.md +3 -2
- package/skills/ae-analysis/references/query_entity_details.md +1 -1
- package/skills/ae-engage/SKILL.md +25 -2
- package/skills/ae-engage/references/build-task-save-guide.md +283 -0
- package/skills/ae-engage/references/save-task.md +304 -0
- package/skills/ae-kb/SKILL.md +283 -0
- package/skills/ae-team/SKILL.md +164 -0
- package/skills/ae-team/references/ai-generate.md +39 -0
- package/skills/ae-team/references/create.md +94 -0
- package/skills/ae-team/references/delete.md +39 -0
- package/skills/ae-team/references/list-projects.md +45 -0
- package/skills/ae-team/references/list-templates.md +38 -0
- package/skills/ae-team/references/list.md +39 -0
- package/skills/ae-team/references/run-artifacts.md +51 -0
- package/skills/ae-team/references/run-cancel.md +38 -0
- package/skills/ae-team/references/run-chat.md +57 -0
- package/skills/ae-team/references/run-reply.md +41 -0
- package/skills/ae-team/references/run-result.md +75 -0
- package/skills/ae-team/references/run-start.md +73 -0
- package/skills/ae-team/references/run-watch.md +82 -0
- package/skills/ae-team/references/update.md +47 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# team +run-result (Get TeamRun Result)
|
|
2
|
+
|
|
3
|
+
> **Prerequisite:** Follow the Global AE CLI Rules in [`../SKILL.md`](../SKILL.md).
|
|
4
|
+
|
|
5
|
+
Domain: **TeamRun execution / read**
|
|
6
|
+
|
|
7
|
+
## Use Cases
|
|
8
|
+
- Retrieve the full result of a TeamRun, including all steps, events, status, and output.
|
|
9
|
+
- The primary command for polling run progress after `+run-start` or `+run-chat`.
|
|
10
|
+
- Returns the run object with `status`, `output`, `steps`, and `error` (if failed).
|
|
11
|
+
|
|
12
|
+
## Mandatory Rules (MUST)
|
|
13
|
+
- `--id` is required. Obtain the real run ID from a previous `+run-start` or `+run-chat` response — do not guess.
|
|
14
|
+
- Poll this command repeatedly until `status` reaches a terminal value: `completed`, `failed`, or `cancelled`.
|
|
15
|
+
- Do not call `+run-artifacts` until status is `completed`.
|
|
16
|
+
|
|
17
|
+
## Command
|
|
18
|
+
```bash
|
|
19
|
+
ae-cli team +run-result --id <run_id>
|
|
20
|
+
ae-cli team +run-result --id <run_id> --jq '.status'
|
|
21
|
+
ae-cli team +run-result --dry-run --id <run_id>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Parameters
|
|
25
|
+
| Parameter | Required | Description |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `--id` | Yes | TeamRun ID |
|
|
28
|
+
|
|
29
|
+
## Key Response Fields
|
|
30
|
+
|
|
31
|
+
| Field | Type | Description |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `status` | string | Current run status |
|
|
34
|
+
| `output` | string \| null | Final output (populated when `completed`) |
|
|
35
|
+
| `pendingQuestion` | string \| null | The question the team is asking the user; only populated when `status = waiting_user` |
|
|
36
|
+
| `error` | object \| null | Error details when `status = failed` |
|
|
37
|
+
| `steps` | array | All execution steps and events |
|
|
38
|
+
|
|
39
|
+
## Status Transitions
|
|
40
|
+
```
|
|
41
|
+
pending → running → completed
|
|
42
|
+
→ waiting_user → (reply) → running → completed
|
|
43
|
+
→ failed
|
|
44
|
+
→ cancelled
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Terminal statuses (stop polling): `completed`, `failed`, `cancelled`
|
|
48
|
+
|
|
49
|
+
Non-terminal statuses (keep polling): `pending`, `running`, `waiting_approval`, `paused`
|
|
50
|
+
|
|
51
|
+
Interrupt statuses (stop polling, get user input): `waiting_user`
|
|
52
|
+
|
|
53
|
+
## Decision Rules
|
|
54
|
+
- Check `status` field on each poll. Continue until terminal.
|
|
55
|
+
- If `status = waiting_user`: read `pendingQuestion`, present it to the user, collect the answer, then call `+run-reply --id <run_id> --input "<user_answer>"`. Resume polling after reply.
|
|
56
|
+
- If `status = failed`, inspect the `error` field to diagnose the issue.
|
|
57
|
+
- If `status = completed`, proceed to `+run-artifacts` to retrieve produced files/outputs.
|
|
58
|
+
- Use `--jq '{status,pendingQuestion}'` when polling to get both status and the pending question in one call.
|
|
59
|
+
|
|
60
|
+
## Polling Best Practice
|
|
61
|
+
```bash
|
|
62
|
+
# Lightweight status + pendingQuestion check
|
|
63
|
+
ae-cli team +run-result --id <run_id> --jq '{status,pendingQuestion}'
|
|
64
|
+
|
|
65
|
+
# Full result when completed
|
|
66
|
+
ae-cli team +run-result --id <run_id>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Next Steps on Failure
|
|
70
|
+
- `404`: run ID not found — verify from the original start response.
|
|
71
|
+
- `status = failed`: report the `error.message` to the user and ask whether to retry with `+run-start`.
|
|
72
|
+
|
|
73
|
+
## Recommended Chaining
|
|
74
|
+
- `+run-start` or `+run-chat` → poll `+run-result` → terminal → `+run-artifacts`
|
|
75
|
+
- `+run-result` → `waiting_user` → `+run-reply` → continue polling `+run-result`
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# team +run-start (Start TeamRun)
|
|
2
|
+
|
|
3
|
+
> **Prerequisite:** Follow the Global AE CLI Rules in [`../SKILL.md`](../SKILL.md).
|
|
4
|
+
|
|
5
|
+
Domain: **TeamRun execution / write**
|
|
6
|
+
|
|
7
|
+
## Use Cases
|
|
8
|
+
- Start a new TeamRun for a given team with a task input.
|
|
9
|
+
- Returns the newly created run object including its `id` and initial `status`.
|
|
10
|
+
- Used for one-shot task execution. For multi-turn interactive sessions, use `+run-chat` instead.
|
|
11
|
+
|
|
12
|
+
## Mandatory Rules (MUST)
|
|
13
|
+
- `--team-id` is required. Obtain the real team ID via `+list` — do not guess.
|
|
14
|
+
- `--input` is required (1–50000 chars). Pass the user's task description verbatim; do not truncate.
|
|
15
|
+
- JSON array flags (`--project-ids`, `--project-names`, `--space-ids`, etc.) must be valid JSON arrays, e.g. `'["id1","id2"]'`.
|
|
16
|
+
- `--notification` must be valid JSON if provided, e.g. `'{"channels":["feishu"],"feishuChatId":"..."}'`.
|
|
17
|
+
- Write operation: keep the confirmation prompt unless `--yes` is explicitly requested.
|
|
18
|
+
- After starting, capture the returned `id` (run ID) and use it to poll `+run-result`.
|
|
19
|
+
|
|
20
|
+
## Command
|
|
21
|
+
```bash
|
|
22
|
+
ae-cli team +run-start --team-id <team_id> --input "分析上周用户留存情况,生成报告" --yes
|
|
23
|
+
|
|
24
|
+
ae-cli team +run-start \
|
|
25
|
+
--team-id <team_id> \
|
|
26
|
+
--input "分析本月DAU趋势" \
|
|
27
|
+
--notification '{"channels":["feishu"],"feishuChatId":"oc_xxx"}' \
|
|
28
|
+
--save-to-kb-id <kb_id> \
|
|
29
|
+
--yes
|
|
30
|
+
|
|
31
|
+
ae-cli team +run-start --dry-run --team-id <team_id> --input "test"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Parameters
|
|
35
|
+
| Parameter | Required | Description |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `--team-id` | Yes | Team ID |
|
|
38
|
+
| `--input` | Yes | Task input text (1–50000 chars) |
|
|
39
|
+
| `--conversation-id` | No | Associated conversation ID |
|
|
40
|
+
| `--notification` | No | Notification config JSON `{"channels":["feishu"\|"lark"\|"slack"],...}` |
|
|
41
|
+
| `--save-to-kb-id` | No | Knowledge base ID to save result to on completion |
|
|
42
|
+
| `--project-ids` | No | Associated project ID list JSON, e.g. `["id1"]` |
|
|
43
|
+
| `--project-names` | No | Associated project name list JSON |
|
|
44
|
+
| `--space-ids` | No | Associated space ID list JSON |
|
|
45
|
+
| `--space-names` | No | Associated space name list JSON |
|
|
46
|
+
| `--dw-space-codes` | No | Associated DW space code list JSON |
|
|
47
|
+
| `--dw-space-names` | No | Associated DW space name list JSON |
|
|
48
|
+
|
|
49
|
+
## Decision Rules
|
|
50
|
+
- Use `+run-start` for single-shot automation tasks where no interactive back-and-forth is needed.
|
|
51
|
+
- Use `+run-chat` instead when the user wants multi-turn conversation with the team.
|
|
52
|
+
- After receiving the run `id`, immediately start polling `+run-result` until status is `completed`, `failed`, or `cancelled`.
|
|
53
|
+
- If the run reaches `waiting_user`, use `+run-reply` to continue.
|
|
54
|
+
|
|
55
|
+
## Watching for Completion
|
|
56
|
+
```bash
|
|
57
|
+
# Preferred: stream via SSE (blocks until done, no polling needed)
|
|
58
|
+
ae-cli team +run-watch --id <run_id>
|
|
59
|
+
# exit 0 → completed/partial_success
|
|
60
|
+
# exit 1 → failed/cancelled/stale
|
|
61
|
+
# exit 2 → waiting_user: read pendingQuestion from stdout, reply, re-watch
|
|
62
|
+
ae-cli team +run-reply --id <run_id> --input "<user_answer>" --yes
|
|
63
|
+
ae-cli team +run-watch --id <run_id>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Next Steps on Failure
|
|
67
|
+
- `404` team not found: re-run `+list` to verify the team ID.
|
|
68
|
+
- `400` validation: check `--input` length and JSON flag formats.
|
|
69
|
+
- Run reaches `failed` status: inspect the `error` field in `+run-result` output.
|
|
70
|
+
|
|
71
|
+
## Recommended Chaining
|
|
72
|
+
- `+list` → `+run-start` → poll `+run-result` → `+run-artifacts`
|
|
73
|
+
- `+run-start` → status `waiting_user` → `+run-reply` → poll `+run-result`
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# team +run-watch (Stream TeamRun via SSE)
|
|
2
|
+
|
|
3
|
+
> **Prerequisite:** Follow the Global AE CLI Rules in [`../SKILL.md`](../SKILL.md).
|
|
4
|
+
|
|
5
|
+
Domain: **TeamRun execution / read**
|
|
6
|
+
|
|
7
|
+
## Use Cases
|
|
8
|
+
- Stream real-time progress of a TeamRun without polling.
|
|
9
|
+
- Blocks until the run reaches a terminal state or `waiting_user`.
|
|
10
|
+
- Preferred over `+run-result` polling for all automated workflows.
|
|
11
|
+
|
|
12
|
+
## Mandatory Rules (MUST)
|
|
13
|
+
- `--id` is required. Obtain the real run ID from a previous `+run-start` or `+run-chat` response.
|
|
14
|
+
- Check the **exit code** to determine what happened — do not guess from output alone.
|
|
15
|
+
- When exit code is `2` (`waiting_user`): read `pendingQuestion` from stdout, present it to the user, collect their answer, call `+run-reply`, then re-run `+run-watch`.
|
|
16
|
+
- Network drops are handled automatically (up to 10 reconnects with 2s delay). Do NOT retry `+run-watch` on exit 1 unless you have confirmed the run itself failed via `+run-result`.
|
|
17
|
+
|
|
18
|
+
## Command
|
|
19
|
+
```bash
|
|
20
|
+
ae-cli team +run-watch --id <run_id>
|
|
21
|
+
|
|
22
|
+
# Suppress stderr log/status noise (stdout JSON is unaffected)
|
|
23
|
+
ae-cli team +run-watch --id <run_id> --quiet
|
|
24
|
+
|
|
25
|
+
# Reconnect after drop, skip logs already seen
|
|
26
|
+
ae-cli team +run-watch --id <run_id> --after-log <lastTimestamp>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Parameters
|
|
30
|
+
| Parameter | Required | Description |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| `--id` | Yes | TeamRun ID |
|
|
33
|
+
| `--after-log` | No | Reconnect: skip log events at or before this timestamp |
|
|
34
|
+
| `--quiet` | No | Suppress log and status lines on stderr; stdout JSON is always emitted |
|
|
35
|
+
|
|
36
|
+
## Exit Codes
|
|
37
|
+
| Code | Meaning | Action |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| `0` | `completed` or `partial_success` | Proceed to `+run-artifacts` |
|
|
40
|
+
| `1` | `failed`, `cancelled`, `stale`, or connection error | Inspect `errorMessage` in stdout JSON; report to user |
|
|
41
|
+
| `2` | `waiting_user` | Read `pendingQuestion` from stdout JSON, present to user, then `+run-reply` → re-run `+run-watch` |
|
|
42
|
+
|
|
43
|
+
## Output
|
|
44
|
+
stdout always receives the final `TeamRunEntity` as a standard JSON envelope:
|
|
45
|
+
```json
|
|
46
|
+
{ "ok": true, "data": { "id": "...", "status": "...", "pendingQuestion": "...", ... } }
|
|
47
|
+
```
|
|
48
|
+
- Exit 0/1: the entity from the `final` SSE event (terminal state)
|
|
49
|
+
- Exit 2: the entity from the `update` SSE event at the moment `waiting_user` was detected
|
|
50
|
+
|
|
51
|
+
stderr receives real-time log lines and status changes (suppressed with `--quiet`).
|
|
52
|
+
|
|
53
|
+
## Handling waiting_user
|
|
54
|
+
```bash
|
|
55
|
+
# 1. Watch the run
|
|
56
|
+
ae-cli team +run-watch --id <run_id>
|
|
57
|
+
# exit code 2 → waiting_user
|
|
58
|
+
|
|
59
|
+
# 2. Read pendingQuestion from stdout, present to user, collect answer
|
|
60
|
+
# 3. Submit the reply
|
|
61
|
+
ae-cli team +run-reply --id <run_id> --input "<user_answer>" --yes
|
|
62
|
+
|
|
63
|
+
# 4. Resume watching
|
|
64
|
+
ae-cli team +run-watch --id <run_id>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## SSE Events (reference)
|
|
68
|
+
| Event | Frequency | Payload |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| `snapshot` | Once on connect | `TeamRunEntity` |
|
|
71
|
+
| `update` | Every 500ms when changed | `TeamRunEntity` |
|
|
72
|
+
| `final` | On terminal state, then closes | `TeamRunEntity` |
|
|
73
|
+
| `log` | Real-time (with history replay) | `{ timestamp, stepId, type, content }` |
|
|
74
|
+
| `error` | On auth/read failure | `{ error: string }` |
|
|
75
|
+
|
|
76
|
+
## Next Steps on Failure
|
|
77
|
+
- Exit 1 + `status = failed`: read `errorMessage` in the JSON output; ask user whether to retry with `+run-start`.
|
|
78
|
+
- Connection drop before `final`: re-run `+run-watch --id <run_id> --after-log <lastTimestamp>`.
|
|
79
|
+
|
|
80
|
+
## Recommended Chaining
|
|
81
|
+
- `+run-start` → `+run-watch` → exit 0 → `+run-artifacts`
|
|
82
|
+
- `+run-watch` → exit 2 → `+run-reply` → `+run-watch`
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# team +update (Update Team)
|
|
2
|
+
|
|
3
|
+
> **Prerequisite:** Follow the Global AE CLI Rules in [`../SKILL.md`](../SKILL.md).
|
|
4
|
+
|
|
5
|
+
Domain: **Team management / write**
|
|
6
|
+
|
|
7
|
+
## Use Cases
|
|
8
|
+
- Partially update an existing team (PATCH semantics — only the fields you pass are changed).
|
|
9
|
+
- Common uses: rename a team, update its config, disable/enable it, change scope.
|
|
10
|
+
|
|
11
|
+
## Mandatory Rules (MUST)
|
|
12
|
+
- `--id` is required. Obtain the real team ID via `+list` — do not guess.
|
|
13
|
+
- At least one optional field must be provided in addition to `--id`.
|
|
14
|
+
- `--config` replaces the entire TeamConfig; provide the complete new config, not a partial patch.
|
|
15
|
+
- `--scope` must be `personal` or `company` if provided.
|
|
16
|
+
- Write operation: keep the confirmation prompt unless `--yes` is explicitly requested.
|
|
17
|
+
|
|
18
|
+
## Command
|
|
19
|
+
```bash
|
|
20
|
+
ae-cli team +update --id <team_id> --name "新名称"
|
|
21
|
+
ae-cli team +update --id <team_id> --enabled false
|
|
22
|
+
ae-cli team +update --id <team_id> --config '<full_new_config_json>' --yes
|
|
23
|
+
ae-cli team +update --dry-run --id <team_id> --name "Test"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Parameters
|
|
27
|
+
| Parameter | Required | Description |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| `--id` | Yes | Team ID |
|
|
30
|
+
| `--name` | No | New team name |
|
|
31
|
+
| `--config` | No | New complete TeamConfig JSON |
|
|
32
|
+
| `--description` | No | New description |
|
|
33
|
+
| `--scope` | No | `personal` \| `company` |
|
|
34
|
+
| `--enabled` | No | `true` \| `false` |
|
|
35
|
+
|
|
36
|
+
## Decision Rules
|
|
37
|
+
- If the user wants to modify only the name or description, pass only those flags — the server keeps all other fields unchanged.
|
|
38
|
+
- If the user wants to update the config, first call `+list` with `--jq` to extract the current config, modify it, then pass the updated config to `+update`.
|
|
39
|
+
- `--enabled false` disables the team without deleting it.
|
|
40
|
+
|
|
41
|
+
## Next Steps on Failure
|
|
42
|
+
- `404`: team ID not found — re-run `+list` to verify.
|
|
43
|
+
- `409`: there may be active runs; wait for them to complete or cancel them with `+run-cancel` first.
|
|
44
|
+
|
|
45
|
+
## Recommended Chaining
|
|
46
|
+
- `+list` → confirm `id` → `+update`
|
|
47
|
+
- `+update --enabled false` → `+delete` (when ready to delete)
|