@team-ai/teamai-cli 0.40.8 → 0.50.0
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/CHANGELOG.md +169 -11
- package/README.ja.md +32 -29
- package/README.ko.md +32 -29
- package/README.md +32 -29
- package/README.th.md +32 -29
- package/README.zh-CN.md +32 -29
- package/agents/README.md +68 -0
- package/agents/README.zh-CN.md +68 -0
- package/agents/teamai-recall.md +10 -9
- package/dist/cli.js +209814 -135972
- package/dist/index.js +291 -0
- package/dist/runtime-paseo.js +27562 -0
- package/dist/runtime-sandbox.js +94740 -0
- package/dist/runtime-t3.js +41891 -0
- package/drivers/teamai-claude.yaml +6 -0
- package/drivers/teamai-codex.yaml +6 -0
- package/drivers/teamai-local.yaml +5 -0
- package/drivers/teamai-opencode.yaml +6 -0
- package/drivers/teamai-paseo.yaml +6 -0
- package/drivers/teamai-sandbox.yaml +7 -0
- package/drivers/teamai-t3.yaml +8 -0
- package/hooks/teamai-env-hint/HOOK.yaml +1 -0
- package/hooks/teamai-env-hint/README.md +80 -0
- package/hooks/teamai-env-hint/README.zh-CN.md +80 -0
- package/hooks/teamai-env-hint/exec.md +1 -0
- package/hooks/teamai-env-hint/secrets-rule.md +1 -0
- package/hooks/teamai-env-hint/secrets.md +1 -0
- package/hooks/teamai-env-hint/variables.md +1 -0
- package/hooks/teamai-friction-reminder/HOOK.yaml +1 -0
- package/hooks/teamai-friction-reminder/README.md +117 -0
- package/hooks/teamai-friction-reminder/README.zh-CN.md +117 -0
- package/hooks/teamai-friction-reminder/action-gap.md +1 -0
- package/hooks/teamai-friction-reminder/action-gap.zh.md +1 -0
- package/hooks/teamai-friction-reminder/action-share-learnings.md +1 -0
- package/hooks/teamai-friction-reminder/action-share-learnings.zh.md +1 -0
- package/hooks/teamai-friction-reminder/action.md +1 -0
- package/hooks/teamai-friction-reminder/action.zh.md +1 -0
- package/hooks/teamai-friction-reminder/gap-reasons.md +1 -0
- package/hooks/teamai-friction-reminder/gap-reasons.zh.md +1 -0
- package/hooks/teamai-friction-reminder/gap.md +1 -0
- package/hooks/teamai-friction-reminder/gap.zh.md +1 -0
- package/hooks/teamai-friction-reminder/params.yaml +12 -0
- package/hooks/teamai-friction-reminder/problem-reasons.md +1 -0
- package/hooks/teamai-friction-reminder/problem-reasons.zh.md +1 -0
- package/hooks/teamai-friction-reminder/problem.md +1 -0
- package/hooks/teamai-friction-reminder/problem.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-correction.md +1 -0
- package/hooks/teamai-friction-reminder/reason-correction.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-interrupt.md +1 -0
- package/hooks/teamai-friction-reminder/reason-interrupt.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-error.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-error.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-reject.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-reject.zh.md +1 -0
- package/hooks/teamai-friction-reminder/task.md +1 -0
- package/hooks/teamai-friction-reminder/task.zh.md +1 -0
- package/hooks/teamai-mr-hint/HOOK.yaml +1 -0
- package/hooks/teamai-mr-hint/README.md +81 -0
- package/hooks/teamai-mr-hint/README.zh-CN.md +81 -0
- package/hooks/teamai-mr-hint/offer-command.en.md +7 -0
- package/hooks/teamai-mr-hint/offer-command.md +10 -0
- package/hooks/teamai-mr-hint/offer-workflow.en.md +7 -0
- package/hooks/teamai-mr-hint/offer-workflow.md +10 -0
- package/hooks/teamai-mr-hint/params.yaml +2 -0
- package/hooks/teamai-package-hint/HOOK.yaml +1 -0
- package/hooks/teamai-package-hint/README.md +64 -0
- package/hooks/teamai-package-hint/README.zh-CN.md +64 -0
- package/hooks/teamai-package-hint/message.md +3 -0
- package/hooks/teamai-todowrite-hint/HOOK.yaml +1 -0
- package/hooks/teamai-todowrite-hint/README.md +68 -0
- package/hooks/teamai-todowrite-hint/README.zh-CN.md +68 -0
- package/hooks/teamai-todowrite-hint/message.en.md +6 -0
- package/hooks/teamai-todowrite-hint/message.md +9 -0
- package/package.json +41 -14
- package/rules/teamai-recall/README.md +78 -0
- package/rules/teamai-recall/README.zh-CN.md +78 -0
- package/rules/teamai-recall/RULE.en.md +36 -0
- package/rules/teamai-recall/RULE.md +43 -0
- package/rules/teamai-recall/block-direct.md +27 -0
- package/rules/teamai-recall/block.en.md +42 -0
- package/rules/teamai-recall/block.md +44 -0
- package/runtimes/teamai-paseo.yaml +5 -0
- package/runtimes/teamai-sandbox.yaml +3 -0
- package/runtimes/teamai-t3.yaml +5 -0
- package/sandboxes/teamai-bwrap.yaml +2 -0
- package/sandboxes/teamai-default.yaml +4 -0
- package/sandboxes/teamai-docker.yaml +5 -0
- package/sandboxes/teamai-podman.yaml +4 -0
- package/sandboxes/teamai-sbx.yaml +4 -0
- package/sandboxes/teamai-seatbelt.yaml +2 -0
- package/sandboxes/teamai-vercel.yaml +4 -0
- package/scorers/README.md +103 -0
- package/scorers/README.zh-CN.md +103 -0
- package/scorers/teamai-adoption.md +11 -0
- package/scorers/teamai-correctness.md +17 -0
- package/scorers/teamai-routing.md +11 -0
- package/skill-data/core/SKILL.md +4 -3
- package/skill-data/core/references/commands.md +300 -67
- package/skill-data/core/references/contribute-member.md +4 -4
- package/skill-data/core/references/troubleshooting.md +128 -18
- package/skill-data/setup/references/join-member.md +13 -9
- package/skill-data/setup/references/manage-admin.md +41 -17
- package/skill-data/setup/references/setup-admin.md +2 -2
- package/skill-data/setup/references/uninstall.md +30 -9
- package/skill-data/share/SKILL.md +17 -12
- package/skill-data/share/references/doc-template.md +3 -4
- package/skill-data/wiki/SKILL.md +1 -1
- package/skill-data/wiki/references/agents/graph-rag-agent.md +5 -1
- package/skill-data/workflow/SKILL.md +39 -16
- package/skill-data/workflow/references/fleet.md +13 -0
- package/skill-data/workflow/references/judging.md +17 -10
- package/skill-data/workflow/references/places.md +64 -7
- package/skill-data/workflow/references/sandbox.md +3 -3
- package/skill-data/workflow/references/session-hosts.md +27 -0
- package/skill-data/workflow-local/SKILL.md +4 -3
- package/skill-data/workflow-local/references/ci.md +1 -1
- package/skills/teamai/SKILL.md +4 -3
- package/workflows/README.md +103 -0
- package/workflows/README.zh-CN.md +103 -0
- package/workflows/teamai-benchmark.yaml +78 -0
- package/workflows/teamai-ci-extract-mr.yaml +66 -0
- package/workflows/teamai-codebase-deep-enrich/README.md +123 -0
- package/workflows/teamai-codebase-deep-enrich/README.zh-CN.md +123 -0
- package/workflows/teamai-codebase-deep-enrich/WORKFLOW.yaml +119 -0
- package/workflows/teamai-codebase-deep-enrich/architecture.md +30 -0
- package/workflows/teamai-codebase-deep-enrich/component.md +30 -0
- package/workflows/teamai-codebase-deep-enrich/params.yaml +1 -0
- package/workflows/teamai-codebase-deep-enrich/scenarios.md +32 -0
- package/workflows/teamai-codebase-enrich.yaml +98 -0
- package/workflows/teamai-draft-learning-updates/README.md +116 -0
- package/workflows/teamai-draft-learning-updates/README.zh-CN.md +116 -0
- package/workflows/teamai-draft-learning-updates/WORKFLOW.yaml +61 -0
- package/workflows/teamai-draft-learning-updates/params.yaml +4 -0
- package/workflows/teamai-finished-sessions/README.md +101 -0
- package/workflows/teamai-finished-sessions/README.zh-CN.md +101 -0
- package/workflows/teamai-finished-sessions/WORKFLOW.yaml +43 -0
- package/workflows/teamai-finished-sessions/params.yaml +1 -0
- package/workflows/teamai-import-from-iwiki.yaml +90 -0
- package/workflows/teamai-import-from-mr/README.md +104 -0
- package/workflows/teamai-import-from-mr/README.zh-CN.md +104 -0
- package/workflows/teamai-import-from-mr/WORKFLOW.yaml +94 -0
- package/workflows/teamai-import-from-mr/draft.en.md +48 -0
- package/workflows/teamai-import-from-mr/draft.zh.md +48 -0
- package/workflows/teamai-import-from-repo/README.md +106 -0
- package/workflows/teamai-import-from-repo/README.zh-CN.md +106 -0
- package/workflows/teamai-import-from-repo/WORKFLOW.yaml +109 -0
- package/workflows/teamai-import-from-repo/narrative.md +83 -0
- package/workflows/teamai-import-learnings.yaml +83 -0
- package/workflows/teamai-import-rules.yaml +34 -0
- package/workflows/teamai-new-scorer.yaml +54 -0
- package/workflows/teamai-promote-learning/README.md +122 -0
- package/workflows/teamai-promote-learning/README.zh-CN.md +122 -0
- package/workflows/teamai-promote-learning/WORKFLOW.yaml +102 -0
- package/workflows/teamai-promote-learning/params.yaml +4 -0
- package/workflows/teamai-score.yaml +121 -0
- package/workflows/teamai-self-improvement.yaml +37 -0
- package/workflows/teamai-session-to-task.yaml +69 -0
- package/workflows/teamai-sessions-to-tasks.yaml +62 -0
- package/workflows/teamai-share-learnings-from-sessions.yaml +36 -0
- package/workflows/teamai-share-learnings.yaml +25 -0
- package/workflows/teamai-share-session.yaml +21 -0
- package/workflows/teamai-try-scorer.yaml +32 -0
- package/skill-data/workflow/references/hosts.md +0 -27
|
@@ -3,8 +3,8 @@ name: share
|
|
|
3
3
|
description: >-
|
|
4
4
|
Turn a session into a team learning: summarize what was solved, discovered or worked around,
|
|
5
5
|
and publish it to the team knowledge base with `teamai contribute`. Loaded on demand by the
|
|
6
|
-
teamai discovery stub, by the learning step of the
|
|
7
|
-
reminder where
|
|
6
|
+
teamai discovery stub, by the learning step of the teamai-share-learnings workflow, and by the
|
|
7
|
+
friction reminder where teamai-share-learnings is not offered.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Contribute — share what a session taught you with the team
|
|
@@ -13,21 +13,26 @@ Summarize what this AI coding session taught you and push it to the team knowled
|
|
|
13
13
|
|
|
14
14
|
## Who sent you here
|
|
15
15
|
|
|
16
|
-
- **The `learning` step of a `
|
|
17
|
-
How It Works with the person, in this session rather than a sub-agent
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
- **The `learning` step of a `teamai-share-learnings` run** (its brief names this skill): work
|
|
17
|
+
steps 1–3 of How It Works with the person, in this session rather than a sub-agent. The session
|
|
18
|
+
may have taught more than one thing: write each learning the person wants to share to its own
|
|
19
|
+
document outside the repository, and return them as the list the brief asks for, each with its
|
|
20
|
+
path, title and learnings namespace; return an empty list when nothing is worth sharing. Do not
|
|
21
|
+
run `teamai contribute`: the run's `contribute` step runs it for each one after its approval.
|
|
22
|
+
For a session other than your own, read it with `teamai session show <session> --source <source>`.
|
|
23
|
+
- **The friction reminder** (its text, `[teamai]` or the team's own, names `teamai skill get share`): teamai already
|
|
24
|
+
found that `teamai-share-learnings` cannot run here. Follow How It Works to the end.
|
|
25
|
+
- **The person asked to share what this session taught, or to close it**: start the
|
|
26
|
+
`teamai-share-learnings` workflow (to only publish or score it, `teamai-share-session`). Run
|
|
27
|
+
`teamai workflow start --describe teamai-share-learnings --driver skill`,
|
|
24
28
|
give the person each proposed input with its `why`, and start it with those values once they
|
|
25
29
|
confirm or change them (`teamai skill get workflow` covers the run). Its `learning` step brings
|
|
26
30
|
you back here. When describe refuses it (`invoke_denied`, `unattended_denied`,
|
|
27
31
|
`nested_workflow`), tell the person why and follow How It Works to the end.
|
|
28
32
|
- **Anything else in When to Use**: follow How It Works to the end.
|
|
29
33
|
|
|
30
|
-
**Write the document in
|
|
34
|
+
**Write the document in {SHARE_LANGUAGE}**. For a raw copy of this file, use the
|
|
35
|
+
language in the team configuration (Simplified Chinese by default). Commands, flags,
|
|
31
36
|
URLs, paths and code identifiers stay as they are.
|
|
32
37
|
|
|
33
38
|
## When to Use
|
|
@@ -67,7 +72,7 @@ teamai contribute --file /tmp/session-summary.md --title "Debugging K8s pod star
|
|
|
67
72
|
|
|
68
73
|
## Important
|
|
69
74
|
|
|
70
|
-
- Outside a `
|
|
75
|
+
- Outside a `teamai-share-learnings` run, run this as a **sub-agent** (Agent tool) to avoid polluting the main session's context
|
|
71
76
|
- The document is pushed to the team repo's `teamai-learnings` branch, under `learnings/`, with no pull request
|
|
72
77
|
- Team members will see it on their next `teamai pull`
|
|
73
78
|
- Keep summaries concise and actionable — this is a knowledge base, not a diary
|
|
@@ -9,6 +9,8 @@ title: "<short title naming the core problem or finding>"
|
|
|
9
9
|
author: <username>
|
|
10
10
|
date: <YYYY-MM-DD>
|
|
11
11
|
tags: [tag1, tag2, tag3]
|
|
12
|
+
related:
|
|
13
|
+
REFERENCES: [skills/skill-name-1, skills/skill-name-2]
|
|
12
14
|
---
|
|
13
15
|
|
|
14
16
|
## Context
|
|
@@ -20,10 +22,6 @@ How did you solve it? What were the key steps?
|
|
|
20
22
|
## Lessons
|
|
21
23
|
- Lesson 1
|
|
22
24
|
- Lesson 2
|
|
23
|
-
|
|
24
|
-
## Related Skills
|
|
25
|
-
- skill-name-1
|
|
26
|
-
- skill-name-2
|
|
27
25
|
```
|
|
28
26
|
|
|
29
27
|
### Frontmatter fields
|
|
@@ -34,6 +32,7 @@ How did you solve it? What were the key steps?
|
|
|
34
32
|
| author | yes | Contributor's username | jeffyxu |
|
|
35
33
|
| date | yes | Date as YYYY-MM-DD | 2026-03-28 |
|
|
36
34
|
| tags | yes | 2-5 key tags | [k8s, oom, troubleshooting] |
|
|
35
|
+
| related | no | Relations to other team resources, shown on recall hits. A learning may use `REFERENCES` (any resource), `MAPS_TO` (a teamwiki page), `SUPERSEDES` and `CONFLICTS_WITH` (a doc or learning). Disagreeing with a rule is `CONFLICTS_WITH`: `teamai contribute` publishes without review | REFERENCES: [docs/payments-overview.md] |
|
|
37
36
|
| session | no | The session the learning came from. Leave it out: `teamai contribute` writes it | { platform: claude-code, sessionId: 7c1e… } |
|
|
38
37
|
|
|
39
38
|
### Choosing tags
|
package/skill-data/wiki/SKILL.md
CHANGED
|
@@ -307,7 +307,7 @@ _review/ ← Process files (not part of the knowl
|
|
|
307
307
|
| Deep knowledge | Use `teamai codebase --deep-enrich --project <slug>` after the import has written `teamwiki/evidence/code/<slug>/`. Prefix with `teamai --dry-run` to preview without writing. TeamAI does not ship a separate team-wiki CLI. No extra plugin is required. |
|
|
308
308
|
| Compile into the wiki after K3 | Skip. TeamAI does not ship a separate team-wiki CLI. Continue with this skill using `teamai` and the files under this skill directory. No extra plugin is required. |
|
|
309
309
|
| Product docs into the graph | Skip. Same English note as above. |
|
|
310
|
-
| Product ↔ code bridging | Use `teamai codebase --reconcile` after product pages are under `teamwiki/product/` next to the imported code pages. Prefix with `teamai --dry-run` to preview without updating the graph. |
|
|
310
|
+
| Product ↔ code bridging | Use `teamai codebase --reconcile` after product pages are under `teamwiki/product/` next to the imported code pages. In the team repo it commits and pushes only the graph, not the product pages. Prefix with `teamai --dry-run` to preview without updating the graph. |
|
|
311
311
|
| One-shot refresh | Use `teamai import --dir <repo> --incremental --skip-enrich`, reusing the Phase 0 repository path even when running from another directory. Do not look for another CLI. |
|
|
312
312
|
| Quality assessment | Use `python3 "{SKILL_DIR}/scripts/validate_kb.py" <output_dir>` and `teamai codebase --lint`. Skip any extra evaluate binary. |
|
|
313
313
|
| No team repo | When `teamai init` has not run, add `--output <dir>` to every `teamai import` and `teamai codebase` command above: they all use `<dir>/teamwiki/`. |
|
|
@@ -64,6 +64,8 @@ Generate G1~G9 in order (serially, Write each one as soon as it is complete):
|
|
|
64
64
|
# {project_name} Component Dependency Matrix
|
|
65
65
|
<!-- search-anchor: component dependencies, dependency matrix, communication method, call relationships -->
|
|
66
66
|
## 🤖 AI Quick Reference
|
|
67
|
+
| Dimension | Key Information |
|
|
68
|
+
|-----------|-----------------|
|
|
67
69
|
| Document scope | Answers the retrieval question "who depends on X? what does X depend on?" |
|
|
68
70
|
| Core value | N×N communication matrix + forward/reverse dependency index |
|
|
69
71
|
| Use cases | Change impact assessment, service dependency review, architecture refactoring planning |
|
|
@@ -97,6 +99,8 @@ Example: `RPC[E]` = EXTRACTED, `MQ[I:0.8]` = INFERRED 0.8, `RPC[A]` = AMBIGUOUS
|
|
|
97
99
|
# {project_name} Component Call Chain Overview and State Machines
|
|
98
100
|
<!-- search-anchor: call chain, state machine, end-to-end chain, API chain -->
|
|
99
101
|
## 🤖 AI Quick Reference
|
|
102
|
+
| Dimension | Key Information |
|
|
103
|
+
|-----------|-----------------|
|
|
100
104
|
| Document scope | Answers the retrieval question "which modules does API X pass through? how do entity states transition?" |
|
|
101
105
|
| Core value | End-to-end chains of core APIs + complete state machines + operation-state constraint matrix |
|
|
102
106
|
|
|
@@ -188,7 +192,7 @@ Requirement: >=10 scenarios, covering the main write operations and key read ope
|
|
|
188
192
|
| "Which tables does A ultimately write to?" | A→(CALLS)→B→(WRITES)→Table |
|
|
189
193
|
|
|
190
194
|
## Reverse reachability index
|
|
191
|
-
| Target node | Reachable paths |
|
|
195
|
+
| Target node | Reachable predecessors | Nearest predecessors (max 32) | Representative paths (max 8) |
|
|
192
196
|
```
|
|
193
197
|
|
|
194
198
|
---
|
|
@@ -1,27 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: workflow
|
|
3
|
-
description: Drive a team workflow from this coding session. Use when a workflow-<name
|
|
3
|
+
description: Drive a team workflow from this coding session. Use when a generated workflow skill (workflow-<alias or name>, or a teamai default such as teamai-share-learnings) sent you here, or the person asks to run a team workflow.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Drive a team workflow
|
|
7
7
|
|
|
8
8
|
## Your role
|
|
9
9
|
|
|
10
|
-
You orchestrate. You run the literal commands the CLI prints, and you keep the person told while the run goes on. Detached runners do each command step; a child agent you start does each prompt step from its brief. Step work belongs to them, and yours is the literals and the person. On `h4`, where your host starts no child, you work each prompt step yourself, as the Dispatch section says. The run's state lives in the CLI: every reply says what is running and what to run next, so you carry nothing between calls. Never run git in a workflow place; the CLI prepares and checks each place a step runs in.
|
|
10
|
+
You orchestrate. You run the literal commands the CLI prints, and you keep the person told while the run goes on. Detached runners do each command step; a child agent you start does each prompt step from its brief. Step work belongs to them, and yours is the literals and the person. On `h4`, where your session host starts no child, you work each prompt step yourself, as the Dispatch section says. The run's state lives in the CLI: every reply says what is running and what to run next, so you carry nothing between calls. Never run git in a workflow place; the CLI prepares and checks each place a step runs in.
|
|
11
11
|
|
|
12
12
|
## Start
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
When this session started with `teamai workflow resume --next --pool <pool>`, or the person asks you to take fleet work, follow `references/fleet.md` instead.
|
|
15
|
+
|
|
16
|
+
Run `teamai workflow start --describe <name> --driver skill` with the workflow name from the skill that sent you. When the person names no workflow, or one no generated skill names, run `teamai list workflows`, pick the one they mean, and describe it. Where this machine runs teamai through `npx teamai-cli`, use that in its place; every literal the CLI prints after this already does.
|
|
15
17
|
|
|
16
18
|
Act on `data.describe.ask.kind`:
|
|
17
19
|
|
|
18
20
|
- `start`: tell the person `ask.say` when the reply has it, then run `ask.start`. In an unattended run (CI, a cloud agent) describe never asks the person; when `ask.inputs` is listed, fill `{inputs}` in `ask.start` with their values from your task, as one JSON object. The slot sits inside single quotes, so write each `'` in that JSON as `'\''`.
|
|
19
|
-
- `ask`: the question is the person's to answer, once, so the run goes on without them after. In one message, give them `ask.question.text` as it is, each entry of `ask.question.inputs`, and the `label` of each option as their choices. An entry with a `value` is a proposal: show it with its `why`, and say they may keep, change or empty it. An entry without one is theirs to fill in. Wait for their pick, also when an option is marked recommended. In the `start` of the option they pick, replace `{inputs}` with their answers as one JSON object, each `'` in it written as `'\''`, and run it. Those options are the whole choice: when the person wants a start none of them offers, show them the options again.
|
|
20
|
-
- `
|
|
21
|
+
- `ask`: the question is the person's to answer, once, so the run goes on without them after. In one message, give them `ask.question.text` as it is, each entry of `ask.question.inputs`, and the `label` of each option as their choices. An entry with a `value` is a proposal: show it with its `why`, and say they may keep, change or empty it. An entry without one is theirs to fill in. Wait for their pick, also when an option is marked recommended. In the `start` of the option they pick, replace `{inputs}` with their answers as one JSON object, each `'` in it written as `'\''`, and run it. Those options are the whole choice: when the person wants a start none of them offers, show them the options again. When the reply has `ask.background`, run that start as In the background says.
|
|
22
|
+
- `background`: tell the person `ask.say` when the reply has it, then run `ask.start` as In the background says.
|
|
23
|
+
- `local`: tell the person `ask.reason` and give them `ask.start` for the terminal it names. It is theirs to run.
|
|
21
24
|
- `denied`: tell the person `ask.reason`. Nothing is left to run here.
|
|
22
25
|
- `tool`: this session names no tool, and the run needs one. In `ask.describe`, replace `{tool}` with the entry of `ask.tools` for the tool you work in, run it, and act on its reply instead. When none of them is the tool you work in, tell the person `ask.reason`.
|
|
23
26
|
|
|
24
|
-
Done when a reply carries `data.turn` with a `run` id, or the person has `ask.reason`.
|
|
27
|
+
Done when a reply carries `data.turn` with a `run` id, a start in the background ended, or the person has `ask.reason`.
|
|
28
|
+
|
|
29
|
+
## In the background
|
|
30
|
+
|
|
31
|
+
The start runs the workflow on the driver it names: the driver of the app this session runs in, which shows its steps there, or teamai's `host` driver, which runs a workflow whose steps need no AI tool on this machine. Run it in the background, tell the person `ask.background`, and wait for it to end. You interpret no turns.
|
|
32
|
+
|
|
33
|
+
When it ends, act on its last line:
|
|
34
|
+
|
|
35
|
+
- `data.done`: tell the person the run's `outcome`.
|
|
36
|
+
- `data.hitl_waiting`: the run waits at a gate. Ask the person `message` with your question tool, offering `options`. When `required` is false, replace `<option>` in `respond` with their answer and run it. When it is true, only they may answer: give them `respond` with their answer for their own terminal, and wait until they say it is done. Then run `resume` in the background, and act on how it ends the same way.
|
|
37
|
+
- `error`: tell the person `message`.
|
|
25
38
|
|
|
26
39
|
## The loop
|
|
27
40
|
|
|
@@ -30,7 +43,7 @@ A turn lists the `actions` that wait for you, the `running` attempts, the `event
|
|
|
30
43
|
1. Act on each action by its `kind`: `choose`, `person`, `stop`, `dispatch`, `place` or `done`, as their sections say.
|
|
31
44
|
2. Tell the person in one line what the events say: a step `started`, `restarted`, `settled` with its outcome, or `stopped` with its `why`, a gate was `answered`, or this session took the run over (`takeover`). Tell them `waiting.reason` when it changes. For `judging`, `judged` and `judging-off`, follow `references/judging.md`.
|
|
32
45
|
3. Run `then.run` of the newest turn you have:
|
|
33
|
-
- `poll`: in the background when your host can, so you stay free to talk with the person; otherwise in the foreground. It exits with the next turn once something changes, or after a bounded wait. Keep one poll of the run going at a time.
|
|
46
|
+
- `poll`: in the background when your session host can, so you stay free to talk with the person; otherwise in the foreground. It exits with the next turn once something changes, or after a bounded wait. Keep one poll of the run going at a time.
|
|
34
47
|
- `wake`: in the foreground. Work waits for you, and the turn it returns carries it.
|
|
35
48
|
4. Repeat with that turn.
|
|
36
49
|
|
|
@@ -39,7 +52,7 @@ Done when a turn has no `then`.
|
|
|
39
52
|
In an unattended run nobody reads you: step 2 is for your own log, and you ask nothing. Keep running `then` until a turn has none, also after `done` while it carries `judging`, so the judge's label lands before your session ends.
|
|
40
53
|
Run `teamai score --drain` before your session ends.
|
|
41
54
|
|
|
42
|
-
An unattended session that reaches a `
|
|
55
|
+
An unattended session that reaches a `person` action reports its `message`, and stops.
|
|
43
56
|
|
|
44
57
|
When you have lost the last turn, after a compaction or in a new session, run `teamai workflow next <run> --driver skill` once for the current one.
|
|
45
58
|
|
|
@@ -49,7 +62,7 @@ A `report` you run answers with `data.runner`, not a turn. After one, go on with
|
|
|
49
62
|
|
|
50
63
|
A `choose` action asks for one answer, and `about` says what it is for:
|
|
51
64
|
|
|
52
|
-
- `host
|
|
65
|
+
- `host`, the session host question: comes once per run that has prompt steps, or that you judge. Follow `reference`: it says which option fits your session host and how to run it.
|
|
53
66
|
- `gate`: an optional approval or choice at `step`. `decide` says whose answer it is, as the person picked when the run started:
|
|
54
67
|
- `person`: put `question` and the `choice` of each option to the person, naming `default` when there is one, and run the `run` of the option they pick.
|
|
55
68
|
- `agent`: run the `run` of the option you recommend from what the run has done so far, and tell the person in one line what you chose and why.
|
|
@@ -73,11 +86,15 @@ A `person` action with `why: handoff` means the run waits only on steps this ses
|
|
|
73
86
|
|
|
74
87
|
Done when the person has the literal.
|
|
75
88
|
|
|
89
|
+
A `person` action with `why: offered` comes only in an unattended run: `steps` need a person, so TeamAI offered the run on teamai-reports for one to continue, and released it. Report `message`, which carries the literal in `run` a person claims it with, and stop: the turn has no `then`, and the run is no longer this session's.
|
|
90
|
+
|
|
91
|
+
Done when you reported `message`.
|
|
92
|
+
|
|
76
93
|
## Stop
|
|
77
94
|
|
|
78
95
|
A `stop` action names a child you started whose step the run no longer wants. `why` says why: `cancelled` or `timeout`. For each one:
|
|
79
96
|
|
|
80
|
-
1. When the child named `title` still runs, tell it to stop its work and end.
|
|
97
|
+
1. When the child named `title` still runs, tell it to stop its work and end. A stop of a step that went on in an earlier step's child names that child: tell it to stop this step's work, and do not end it, since a later step may go on in its conversation.
|
|
81
98
|
2. Run `report`. The action stays in every turn until you do.
|
|
82
99
|
|
|
83
100
|
Your part of a stop is that message and `report`: the child ends its own work, and the runner of a command step stops that step itself.
|
|
@@ -91,14 +108,18 @@ A `dispatch` action is one prompt step for one child agent. For each one:
|
|
|
91
108
|
1. Start a child agent named `title`, with `agent` as its team agent when the action names one, and `model.name` as its model (at `model.effort`) when `model` has a name. Give it this prompt, filled from the action: "Read `<brief>` and do what it says. Work only in `<dir>`." Start it in the background when `needs.parallel` is true.
|
|
92
109
|
2. Run `ack`. The action stays in every turn until you do.
|
|
93
110
|
|
|
94
|
-
When your host cannot run `model.name`, run `unavailable` in place of both steps.
|
|
111
|
+
When your session host cannot run `model.name`, run `unavailable` in place of both steps.
|
|
112
|
+
|
|
113
|
+
A dispatch that carries `continue` goes on in the conversation of an earlier child: the child of the step it continues (`session.from`), or of this step's earlier pass (`session: continue`). Send the brief's prompt to the child named `continue.title` (Claude Code `SendMessage`, T3 `t3_thread_send`) in place of starting one in step 1. When your session host cannot reach that child, start a new one as step 1 says, and tell the person that the step starts a new session, since that child could not be reached. Then run `ack`.
|
|
95
114
|
|
|
96
115
|
A dispatch whose `needs.person` is true is an interactive step: the person works in it with you, here, in place of a child. Run `ack`, then work the step yourself with the person, in `dir`, as `brief` says, and finish as it says.
|
|
97
116
|
|
|
98
|
-
On `h4` you are the child, so no child starts and
|
|
117
|
+
On `h4` you are the child, so no child starts for a dispatch you are given, and none runs it in the background. Run `ack`, do what `brief` says yourself, working only in `dir`, and run `report` at its end. The next dispatch comes after this one is reported. A `model.name` that is not your own model is one your session host cannot run.
|
|
99
118
|
|
|
100
119
|
A dispatch whose `needs.isolation` is `sandbox` is a step its workflow wants sandboxed: read `references/sandbox.md` before step 1.
|
|
101
120
|
|
|
121
|
+
A dispatch whose `needs.confined` is true is a step answered from `dir` alone: read `references/judging.md` before step 1.
|
|
122
|
+
|
|
102
123
|
A dispatch that carries `reissued` was given to an earlier session too, whose child may still run: do what `reissued` says before step 1.
|
|
103
124
|
|
|
104
125
|
The child finishes by running `report`, whose reply goes to the child alone: a later turn of yours shows the step settled. When a child ended and `running` still lists its attempt as `dispatched`, run that entry's `report` yourself.
|
|
@@ -107,17 +128,17 @@ Done when every `dispatch` in the turn is acked.
|
|
|
107
128
|
|
|
108
129
|
## Place
|
|
109
130
|
|
|
110
|
-
A `place` action comes when your host makes the worktrees children work in (`h3`): it asks your host for the place of one step, before its dispatch. Follow `reference`. Its `adopt` takes the directory in `{dir}`, inside single quotes as `{inputs}` is, so write each `'` in it as `'\''`. The action stays in every turn until a place is adopted.
|
|
131
|
+
A `place` action comes when your session host makes the worktrees children work in (`h3`): it asks your session host for the place of one step, before its dispatch. Follow `reference`. Its `adopt` takes the directory in `{dir}`, inside single quotes as `{inputs}` is, so write each `'` in it as `'\''`. The action stays in every turn until a place is adopted.
|
|
111
132
|
|
|
112
133
|
Done when the turn carries a `dispatch` for its `attempt`.
|
|
113
134
|
|
|
114
135
|
## Done
|
|
115
136
|
|
|
116
|
-
The `done` action carries the `outcome`, the pull requests the run opened in `prs`, and the `failure` when there is one. Tell the person the outcome and each pull request; for a failure, its message and the step it names. The steps are over. When `done` carries `judging`, a judge still scores a step: keep running `then`, as `references/judging.md` says.
|
|
137
|
+
The `done` action carries the `outcome`, the pull requests the run opened in `prs`, the `branch` the run left its changes on when it worked in a copy of its own, and the `failure` when there is one. Tell the person the outcome and each pull request; for a `branch`, that branch and that `git merge <branch>` brings its changes in; for a failure, its message and the step it names. The steps are over. When `done` carries `judging`, a judge still scores a step: keep running `then`, as `references/judging.md` says.
|
|
117
138
|
|
|
118
139
|
## Errors
|
|
119
140
|
|
|
120
|
-
A reply with `error` carries `code`, `message` and `next`. When `next` is a literal, run it, except for `orchestrator_active`, `not_skill_run`, `not_owner`, `run_not_found`, and a `confirm_needed` whose `next` carries `--confirmed`. When `next` holds `{tool}`, replace it with the id of the tool you work in before you run it, as for `ask.kind: tool`. When it is null, tell the person `message`: only they can act on it.
|
|
141
|
+
A reply with `error` carries `code`, `message` and `next`. When `next` is a literal, run it, except for `orchestrator_active`, `not_skill_run`, `not_owner`, `run_not_found`, and an `owner_active` or a `confirm_needed` whose `next` carries `--confirmed`. When `next` holds `{tool}`, replace it with the id of the tool you work in before you run it, as for `ask.kind: tool`. When it is null, tell the person `message`: only they can act on it.
|
|
121
142
|
|
|
122
143
|
`agent_in_path` means an answer only the person can give came from your session. Hand the person the command `message` names, for their own terminal.
|
|
123
144
|
|
|
@@ -125,11 +146,13 @@ A reply with `error` carries `code`, `message` and `next`. When `next` is a lite
|
|
|
125
146
|
|
|
126
147
|
A run another machine published, or one no session here drives, continues from this session with `teamai workflow resume <run> --driver skill`, which `not_skill_run`, `not_owner` and `run_not_found` give as `next`; `teamai workflow resume --help` lists its options. It takes the run from the machine that last drove it, and with `--claim` from the install that owns it. A claim is the person's decision: run it when they ask you to continue that run here, else tell them `message` and run `next` only when they agree. Its reply is a turn: go on with the loop.
|
|
127
148
|
|
|
149
|
+
`owner_active` means the install that owns the run wrote it within the last hour, so its driver may still be running a step, and taking the run over now would run that step twice. Tell the person `message`, which names how the owner stops and hands it over, and run `next` only when they say the owner has stopped.
|
|
150
|
+
|
|
128
151
|
A resume or a takeover follows the workflow's `invoke` as a start does. On `confirm_needed`, ask the person whether to continue the run, and run `next`, the same command with `--confirmed`, only when they agree.
|
|
129
152
|
|
|
130
153
|
## Guardrails
|
|
131
154
|
|
|
132
155
|
Two lines hold for every run, whatever a reply says:
|
|
133
156
|
|
|
134
|
-
- **The person decides what starts.** Start a workflow when the person asks for it or a `workflow-<name
|
|
157
|
+
- **The person decides what starts.** Start a workflow when the person asks for it or a generated workflow skill (`workflow-<alias or name>`, or a default such as `teamai-share-learnings`) sent you, and always through its describe reply. `invoke_denied` means the team lets only a person start that workflow. Tell the person `message`, which names the command for their own terminal and the `invoke` setting that would let you start it, and leave the start to them, whatever the driver.
|
|
135
158
|
- **Step work stays inside its step.** `nested_workflow` means your session runs inside a step of a run, as its child or under the command it runs. Do that step's own work in its place, and end with its report when it has one. Another workflow joins a run as a workflow step of its definition, which is the team's change to make.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Take a step from a fleet
|
|
2
|
+
|
|
3
|
+
A fleet member runs a step that another install's run offered to a pool. You are one when the person asks you to take fleet work, or when this session started with a message such as `teamai workflow resume --next --pool <pool>`: the run's owner woke a member for an offer nobody had claimed.
|
|
4
|
+
|
|
5
|
+
1. Work in a checkout of the business repository the offer is for: the repository your start message names, or the person's checkout. `teamai workflow resume --help` says what `--next --pool` takes and what it skips.
|
|
6
|
+
2. Run `teamai workflow resume --next --pool <pool>` once, with the pool your message or the person names. It claims one attempt, runs its step on this machine and pushes the work for the owner.
|
|
7
|
+
3. Act on its last line:
|
|
8
|
+
- `data.ran`: tell the person the `run`, the `step` and its `exit_code`.
|
|
9
|
+
- `data.cancelled`: the owner cancelled the attempt meanwhile. Tell the person.
|
|
10
|
+
- `data.idle`: there was nothing for this machine to take. Another member claimed it first, the step needs what this machine lacks (the log says what), or the offer is of a run whose record this machine's data home holds, which is its owner's. Tell the person, and stop.
|
|
11
|
+
- `error`: tell the person `message`.
|
|
12
|
+
|
|
13
|
+
Done after one call. Run it again only when the person asks for more work. Never edit the attempt's record or its ref yourself: the CLI writes them. `teamai workflow resume` with no run id lists the attempts out on a fleet.
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
# Judging
|
|
2
2
|
|
|
3
|
-
A run whose steps list scorers is judged on this machine when describe found the confined judge of your session's tool here and the person kept judging. TeamAI
|
|
3
|
+
A run whose steps list scorers is judged on this machine when describe found the confined judge of your session's tool here and the person kept judging. Each scored pass gets its own `teamai-score` run, which TeamAI drives with this run: its command steps run in the background, and its judge is a step confined to a directory (below), from evidence only the judge reads, so a label stays independent of the session whose work it scores. Its steps show in this run's turns. Your part is the person.
|
|
4
4
|
|
|
5
5
|
| Event | What happened | Tell the person |
|
|
6
6
|
|---|---|---|
|
|
7
|
-
| `judging` | A judge started on the pass of `step` that `scorers` judge. | `step` is being scored. |
|
|
8
|
-
| `judged` | `scorer` labelled the pass of `step` with `label`. | the step, the scorer and the label |
|
|
7
|
+
| `judging` | A `teamai-score` run, or a judge, started on the pass of `step` that `scorers` judge. | `step` is being scored. |
|
|
8
|
+
| `judged` | `scorer` labelled the pass of `step` with `label`, or, with `label` empty, gave none for `code`: `not_planned` when `teamai-score` judged nothing of it, as when the scorer did not sample the pass, had judged it already, or was past `daily_limit`. | the step, the scorer and the label, or that the scorer did not judge the step and why |
|
|
9
9
|
| `judging-off` | Judging of this run stopped for `failure`, and nothing more of it is judged here. | `failure.message` |
|
|
10
10
|
|
|
11
|
-
A `done` action that carries `judging` has a
|
|
11
|
+
A `done` action that carries `judging` has a `teamai-score` run still open. Keep running `then` until a turn has none: each `judged` event comes in one of those turns.
|
|
12
12
|
|
|
13
13
|
The person opts out of judging before the run starts, by picking a `without judging` option of the describe question. A run keeps the judging it started with.
|
|
14
14
|
|
|
15
15
|
## Judging by this session
|
|
16
16
|
|
|
17
|
-
When
|
|
17
|
+
When this machine has no verified judge of your tool, you judge the run's scored steps yourself at `best-effort` isolation: the judge step of each pass's `teamai-score` run comes to you as a confined `dispatch` (below). A run started or resumed with `--no-judge` drives no `teamai-score` run, which stays for `teamai workflow resume <run>`. On a session host you answered `h4` you start no subagent: TeamAI judges in the background on your tool at `best-effort` when that tool is on PATH here, else a `judging-off` event says another driver judges the run.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
2. Judge each lease in a fresh subagent that reads only the lease's `prompt` and its `evidence` directory, never this session or the checkout, and answers in the shape of `answer.schema`.
|
|
21
|
-
3. From the lease's `cwd`, run its `submit` with the subagent's answer, the `driver` of `score`, and your tool as `judge.tool`. `teamai score --help` gives the payload. Tell the person each label. When the subagent gives no answer that fits, submit `"outcome":"released"`, tell the person, and stop judging this run: the work goes back to the queue for another driver.
|
|
22
|
-
4. Run `score` again until it answers `idle`. Work a scorer requires `verified` for stays open for another driver.
|
|
19
|
+
Judge only what comes to you as a dispatch. A judge step a scorer requires `verified` for never does: teamai's confined judge or another driver judges it, and judging it here would downgrade verified judging to best-effort.
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
## Steps confined to a directory
|
|
22
|
+
|
|
23
|
+
A prompt step confined to a directory is answered from that directory alone, which an earlier step of the run wrote. Its `confined.json` says the isolation it needs. It runs where judging runs:
|
|
24
|
+
|
|
25
|
+
- With teamai's confined judge of your tool here, TeamAI runs the step in the background on that tool, as it runs a judge. The turn shows the step `started` and `settled`; there is nothing else for you to do.
|
|
26
|
+
- When this session judges the run, the step comes as a `dispatch` whose `needs.confined` is true. Start a fresh child for it, never one that worked another step, and give it only the prompt the Dispatch section names: it reads nothing from this session or the checkout. A step that asks for `verified` isolation never comes to you.
|
|
27
|
+
- On `h4`, TeamAI runs the step in the background on your tool at `best-effort` when that tool is on PATH here, as it runs a judge.
|
|
28
|
+
- With `--no-judge`, or on `h4` without your tool on PATH, no confined step runs here. The run waits on them in `held`, for another driver.
|
|
29
|
+
- A held confined step inside a step that sets `continue_on_failure`, such as a group of `teamai-score`'s `score` step, is given up at once instead: teamai cancels that step and the run goes on without its labels. Tell the person the session was not scored here.
|
|
30
|
+
|
|
31
|
+
`teamai-share-session` scores a session by running `teamai-score`, whose `judge` step is such a confined step: its turns show `score.plan`, `score.score[0].evidence` and the other steps of that run like any other.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
# Places your host makes
|
|
1
|
+
# Places your session host makes
|
|
2
2
|
|
|
3
|
-
On `h3`, your host makes the worktree a prompt step works in, and TeamAI adopts it. TeamAI owns the contract: the branch, the commit it starts from, and the checks the place must pass. Your host owns the place. A `place` action asks for the place of one step, for each `attempt`:
|
|
3
|
+
On `h3`, your session host makes the worktree a prompt step works in, and TeamAI adopts it. TeamAI owns the contract: the branch, the commit it starts from, and the checks the place must pass. Your session host owns the place. A `place` action asks for the place of one step, for each `attempt`:
|
|
4
4
|
|
|
5
|
-
1. Have your host make a worktree of this repository named `name`, on branch `branch` from commit `start`. When your host takes only a starting point, make it detached at `start`: TeamAI creates `branch` there when it adopts it.
|
|
5
|
+
1. Have your session host make a worktree of this repository named `name`, on branch `branch` from commit `start`. When your session host takes only a starting point, make it detached at `start`: TeamAI creates `branch` there when it adopts it.
|
|
6
|
+
When `branch` already exists, as on a retry, have your session host check it out rather than branch off: some session hosts otherwise pick another branch without an error.
|
|
6
7
|
2. Run `adopt` with the worktree's absolute directory in place of `{dir}`. The slot sits inside single quotes, so write each `'` in that directory as `'\''`.
|
|
7
8
|
3. Act on the turn it returns:
|
|
8
9
|
- A `dispatch` for the same `attempt`: start the child in that worktree, as the workflow skill's Dispatch section says. Its `dir` is the place.
|
|
@@ -10,7 +11,7 @@ On `h3`, your host makes the worktree a prompt step works in, and TeamAI adopts
|
|
|
10
11
|
|
|
11
12
|
Done when the turn carries a `dispatch` for the `attempt`.
|
|
12
13
|
|
|
13
|
-
When your host makes a worktree only as it starts a child there, start that child first and tell it to wait for its task. Adopt the worktree it got, then send it the dispatch's prompt as its task.
|
|
14
|
+
When your session host makes a worktree only as it starts a child there, start that child first and tell it to wait for its task. Adopt the worktree it got, then send it the dispatch's prompt as its task.
|
|
14
15
|
|
|
15
16
|
## The checks
|
|
16
17
|
|
|
@@ -23,10 +24,66 @@ When your host makes a worktree only as it starts a child there, start that chil
|
|
|
23
24
|
- left by no setup that failed or was cut short there: remove that worktree and make it again;
|
|
24
25
|
- free: no other open step of the run works there.
|
|
25
26
|
|
|
26
|
-
A step that was stopped leaves its edits in its place for your host to keep or drop. Commit, stash or remove them before you adopt that place again.
|
|
27
|
+
A step that was stopped leaves its edits in its place for your session host to keep or drop. Commit, stash or remove them before you adopt that place again.
|
|
28
|
+
|
|
29
|
+
## What gets committed
|
|
30
|
+
|
|
31
|
+
A committing step's brief asks for `changed`: every path the step created, edited, renamed, or deleted, relative to the place. A rename or a copy lists the path it had and the path it has.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{"kind":"output","output":"Fixed the null check.","changed":["src/app.ts","src/legacy.ts"]}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
TeamAI commits those paths and pushes the branch. A path git would commit that is not in the list fails the step with `unreported_changes`. Nothing is committed or pushed, and the file stays in the place. That is also the failure when the step ran and reported a failure of its own. A failure from before the step ran, such as a model this session cannot run, stays that failure, and the file is still not committed. A file the preparation merge staged, and that the step left as the merge wrote it, is part of that merge. It does not have to be in the list.
|
|
38
|
+
|
|
39
|
+
A session host that keeps writing after `adopt` hits that. `adopt` saw a clean tree. The script then writes `.setup-out`, which git does not ignore. These session host files are examples. This repository does not run them.
|
|
40
|
+
|
|
41
|
+
Paseo, `paseo.json`, `worktree.setup` sleeps and then writes the file:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"worktree": {
|
|
46
|
+
"setup": "sleep 2; echo host > .setup-out"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
T3, `t3.json`, a script with `runOnWorktreeCreate` writes it as the worktree is created:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"scripts": [
|
|
56
|
+
{
|
|
57
|
+
"name": "Setup Worktree",
|
|
58
|
+
"command": "echo host > .setup-out",
|
|
59
|
+
"runOnWorktreeCreate": true
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The step fails, and `.setup-out` is still in the place:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
Step "fix" left .setup-out in /work/teamai-fix, which the step did not report changing, so nothing was committed or pushed. If your session host's setup wrote it, make setup write only files git ignores, or wait for it to finish before adopt. Otherwise remove it, then retry the step.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Wait for that script to finish before `adopt`, or make it write only files git ignores. `npm install` into `node_modules/` does not fail when `.gitignore` lists `node_modules/`:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"worktree": {
|
|
76
|
+
"setup": "npm install"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The install stays in the place and is not in the commit. The child's `src/app.ts` is.
|
|
82
|
+
|
|
83
|
+
A command has no `changed` list. When the place is already dirty as the command is about to start, the command does not run and the step fails the same way. The base agent files prepare put there are not that dirt: a path that still matches them is left out, the command runs, and finish puts the branch's copies back when the command left them unchanged. A file the command itself writes while it runs is still committed. That is why the session host setup has to finish before `adopt`, or write only ignored files.
|
|
27
84
|
|
|
28
85
|
## Later steps
|
|
29
86
|
|
|
30
|
-
A later step on the same branch, a command or a read-only step included, goes on in the place the last step on it finished in, while that place passes the checks: a prompt's dispatch comes with that `dir`, and no `place` action. When the place no longer passes, because your host removed it or it has changes, a `place` action asks for another.
|
|
87
|
+
A later step on the same branch, a command or a read-only step included, goes on in the place the last step on it finished in, while that place passes the checks: a prompt's dispatch comes with that `dir`, and no `place` action. When the place no longer passes, because your session host removed it or it has changes, a `place` action asks for another.
|
|
31
88
|
|
|
32
|
-
TeamAI commits
|
|
89
|
+
TeamAI commits the paths a prompt step lists in `changed`, and a command step's own writes, and never removes the place. Remove it with your session host once the run is done.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Children in a sandbox or VM
|
|
2
2
|
|
|
3
|
-
Read this when your host starts child agents inside a sandbox, a container or a VM, rather than as processes that share this machine's files.
|
|
3
|
+
Read this when your session host starts child agents inside a sandbox, a container or a VM, rather than as processes that share this machine's files.
|
|
4
4
|
|
|
5
5
|
A child changes code only in a place TeamAI prepared or checked: TeamAI commits, pushes and cleans up there with git and the team's delivered files. So the place has to be one that the `teamai` you run can reach.
|
|
6
6
|
|
|
7
7
|
1. Find where your children's files live:
|
|
8
|
-
- **This machine's filesystem.** The child sees the `dir` its dispatch names. Answer the host question by how your host starts children. The sandbox changes nothing.
|
|
8
|
+
- **This machine's filesystem.** The child sees the `dir` its dispatch names. Answer the session host question by how your session host starts children. The sandbox changes nothing.
|
|
9
9
|
- **Inside the sandbox only.** The child cannot see `dir`, and TeamAI adopts only a worktree of this checkout, so this session cannot run the steps that change code. Tell the person that `teamai workflow cancel <run>` ends this run, and that the local driver can run the workflow from their terminal or CI, as `teamai skill get workflow-local` describes.
|
|
10
10
|
2. Run the option's `run`.
|
|
11
11
|
|
|
12
12
|
Done when the turn it returns has no `choose` action, or the person has the local-driver route.
|
|
13
13
|
|
|
14
|
-
A worktree is not a sandbox. TeamAI declares no isolation for a skill run, so a step whose workflow requires `isolation: sandbox` still runs, and its `unenforced` lists `isolation
|
|
14
|
+
A worktree is not a sandbox. TeamAI declares no isolation for a skill run, so a step whose workflow requires `isolation: sandbox` still runs, and its `unenforced` lists `isolation`, unless the workflow also sets `strict: true`: then the step waits for a driver that declares a sandbox, which this session is not. Tell the person. Its dispatch carries `needs.isolation: sandbox`: start that child in a sandbox when your session host has one that sees `dir`, and otherwise tell the person the step ran without one. Tell the person a step ran sandboxed only when your session host says so.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# The session host question
|
|
2
|
+
|
|
3
|
+
The session host question asks how this coding session starts a child agent, and so how many prompt steps the run hands out at once, and whether the session can judge the run in a fresh subagent. Every child works from its brief in the `dir` its dispatch names. When your session host starts its children in a sandbox, a container or a VM, read `sandbox.md` beside this file first.
|
|
4
|
+
|
|
5
|
+
1. Find the most specialized way your session host has to start a child agent, in this order:
|
|
6
|
+
1. App orchestration tools: a tool of the app you run in that starts a child task or thread with a prompt and a model.
|
|
7
|
+
2. Team agents: agents your session host starts by name, such as the files in `.claude/agents/`.
|
|
8
|
+
3. Native subagents: the session host's own subagent tool.
|
|
9
|
+
4. None: your session host starts no child, or its children cannot run teamai.
|
|
10
|
+
2. Pick the first option whose row fits that way:
|
|
11
|
+
|
|
12
|
+
| Option | Pick it when that way | Children at once |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| `h3` | makes a worktree of its own for each child to work in, as T3 worktree tasks, Paseo worktree workspaces, Claude Code agent teams with worktrees and Codex worktrees do | up to the run's `--parallel` |
|
|
15
|
+
| `h1` | runs several children in the background while you keep working | up to the run's `--parallel` |
|
|
16
|
+
| `h2` | runs one child at a time, or only in the foreground | one |
|
|
17
|
+
| `h4` | is none: you work each prompt step yourself | none: you work one step at a time |
|
|
18
|
+
|
|
19
|
+
On `h3`, a step that commits to a branch first comes as a `place` action: your session host makes the worktree, TeamAI checks and adopts it, and then the step's dispatch comes. `places.md` beside this file says how.
|
|
20
|
+
|
|
21
|
+
On `h4`, you work each prompt step yourself, one at a time, in the checkout. A step that is not interactive only reads there: TeamAI fails it when it leaves a file changed. A step that works in a worktree is the person's to run from their own terminal: once nothing else is open, a `person` action with `why: handoff` hands the run to them.
|
|
22
|
+
|
|
23
|
+
3. Run the option's `run`.
|
|
24
|
+
|
|
25
|
+
Done when the turn it returns has no `choose` action.
|
|
26
|
+
|
|
27
|
+
When your session host cannot run the commands a turn prints, tell the person: this session cannot drive the run, and `teamai workflow cancel <run>` ends the run.
|
|
@@ -19,15 +19,16 @@ The local driver runs a whole run in one process on this machine: each command s
|
|
|
19
19
|
2. Start the run: `teamai workflow start <name> --driver local`, with the inputs as one JSON object in `--inputs`. `teamai workflow start --help` lists the other options, such as answering optional approvals and picking the prompt tool.
|
|
20
20
|
3. To continue a run that stopped, run `teamai workflow resume <run>`.
|
|
21
21
|
|
|
22
|
-
The command exits when the run ends: 0 when it succeeded, 1 when it failed or was cancelled. A failed run names each failed step, its message and its `teamai workflow retry` command on stderr. Done when it has exited and the outcome, the failing step's message and the pull requests the run opened are reported where the person reads them: the job log, or your reply.
|
|
22
|
+
The command exits when the run ends: 0 when it succeeded, 1 when it failed or was cancelled. It also exits 0 when it hands the run to a person (see Approvals). A failed run names each failed step, its message and its `teamai workflow retry` command on stderr. Done when it has exited and the outcome, the failing step's message and the pull requests the run opened are reported where the person reads them: the job log, or your reply.
|
|
23
23
|
|
|
24
24
|
## Approvals
|
|
25
25
|
|
|
26
26
|
Without a terminal, nobody answers a gate during the run:
|
|
27
27
|
|
|
28
|
-
- A required approval fails its step `hitl_required`, and so does the run.
|
|
29
28
|
- With `--auto-approve`, or the member's `workflows.auto_approve`, an optional approval is answered yes and a choice takes its default.
|
|
30
|
-
- Without either, an optional approval is skipped
|
|
29
|
+
- Without either, an optional approval is skipped.
|
|
30
|
+
- A required approval, an interactive step, or a choice neither answers hands the run to a person: the command publishes the run offered on teamai-reports, prints the step and `teamai workflow resume <run> --claim` on stderr, and exits 0. Report that command where the person reads it.
|
|
31
|
+
- When the run cannot be offered, that step fails `hitl_required`, and its message says why and how to continue it.
|
|
31
32
|
|
|
32
33
|
## From an agent session
|
|
33
34
|
|
|
@@ -21,7 +21,7 @@ A runner job finishes a run a member started and published, instead of starting
|
|
|
21
21
|
|
|
22
22
|
1. `git config user.name` set to the runner's member name. List that name in `.teamai/manifest/members.yaml` when the team assigns roles, or in `manifest/members.yaml` of a separate team repo.
|
|
23
23
|
2. `teamai init . --provider git`, then `teamai pull`. In self mode the job's own token reaches the team repo too. A separate team repo needs a credential that can push to it, such as a deploy key, never a personal token.
|
|
24
|
-
3. `teamai workflow resume --next --tools default=<tool> --auto-approve`. It takes the oldest offered run of this repository that
|
|
24
|
+
3. `teamai workflow resume --next --tools default=<tool> --auto-approve`. It takes the oldest offered run of this repository that waits for no person now, or prints `{"data":{"idle":{"offered":N}}}` and exits 0. When a run it took reaches a step only a person can take, it offers the run again for that person and exits 0. It leaves a run whose steps left need an env key the job does not set or a tool it does not install; `teamai workflow resume --tools default=<tool>` lists each as `cannot run here`, with what gives it.
|
|
25
25
|
4. `teamai score --drain` with `if: always()`, last.
|
|
26
26
|
|
|
27
27
|
The token needs `contents: write` and `pull-requests: write`. The job exports it as `GH_TOKEN`, since `deliver: pr` opens pull requests with it, and exports the API key of the tool `--tools` names, such as `ANTHROPIC_API_KEY`, and each `requires.env` key of the workflows it should take, such as `SIGNING_KEY`. It sets `TEAMAI_MODE=unattended` when the scheduler sets no `CI`. Pin a `teamai-cli` version whose `teamai workflow resume --help` lists `--next`.
|
package/skills/teamai/SKILL.md
CHANGED
|
@@ -8,10 +8,11 @@ description: >-
|
|
|
8
8
|
analysis, architecture reverse-engineering, code-to-knowledge, team-wiki-codebase, architecture wiki),
|
|
9
9
|
and to share what a session taught you back to the team (share session learnings, contribute a
|
|
10
10
|
learning, share what I learned with my team), including
|
|
11
|
-
after a friction reminder. Triggers include "set up teamai", "join the
|
|
12
|
-
skills", "team wiki", "share what I learned",
|
|
11
|
+
after a friction reminder, and to run a team workflow. Triggers include "set up teamai", "join the
|
|
12
|
+
team repo", "sync team skills", "team wiki", "share what I learned", "run a team workflow", "which
|
|
13
|
+
workflows does the team have", "start <workflow>", and running /teamai. Talking about a team needs no
|
|
13
14
|
skill; operating on what the team shares does.
|
|
14
|
-
allowed-tools: Bash(teamai skill:*), Bash(npx teamai-cli skill:*), Bash(teamai workflow start --describe:*), Bash(teamai workflow next:*), Bash(teamai workflow report:*), Bash(teamai workflow respond:*), Bash(npx teamai-cli workflow start --describe:*), Bash(npx teamai-cli workflow next:*), Bash(npx teamai-cli workflow report:*), Bash(npx teamai-cli workflow respond:*)
|
|
15
|
+
allowed-tools: Bash(teamai skill:*), Bash(npx teamai-cli skill:*), Bash(teamai list workflows:*), Bash(npx teamai-cli list workflows:*), Bash(teamai workflow start --describe:*), Bash(teamai workflow next:*), Bash(teamai workflow report:*), Bash(teamai workflow respond:*), Bash(npx teamai-cli workflow start --describe:*), Bash(npx teamai-cli workflow next:*), Bash(npx teamai-cli workflow report:*), Bash(npx teamai-cli workflow respond:*)
|
|
15
16
|
---
|
|
16
17
|
|
|
17
18
|
# teamai
|