@team-ai/teamai-cli 0.40.9 → 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.
Files changed (163) hide show
  1. package/CHANGELOG.md +167 -11
  2. package/README.ja.md +32 -29
  3. package/README.ko.md +32 -29
  4. package/README.md +32 -29
  5. package/README.th.md +32 -29
  6. package/README.zh-CN.md +32 -29
  7. package/agents/README.md +68 -0
  8. package/agents/README.zh-CN.md +68 -0
  9. package/agents/teamai-recall.md +10 -9
  10. package/dist/cli.js +210551 -136899
  11. package/dist/index.js +291 -0
  12. package/dist/runtime-paseo.js +27562 -0
  13. package/dist/runtime-sandbox.js +94740 -0
  14. package/dist/runtime-t3.js +41891 -0
  15. package/drivers/teamai-claude.yaml +6 -0
  16. package/drivers/teamai-codex.yaml +6 -0
  17. package/drivers/teamai-local.yaml +5 -0
  18. package/drivers/teamai-opencode.yaml +6 -0
  19. package/drivers/teamai-paseo.yaml +6 -0
  20. package/drivers/teamai-sandbox.yaml +7 -0
  21. package/drivers/teamai-t3.yaml +8 -0
  22. package/hooks/teamai-env-hint/HOOK.yaml +1 -0
  23. package/hooks/teamai-env-hint/README.md +80 -0
  24. package/hooks/teamai-env-hint/README.zh-CN.md +80 -0
  25. package/hooks/teamai-env-hint/exec.md +1 -0
  26. package/hooks/teamai-env-hint/secrets-rule.md +1 -0
  27. package/hooks/teamai-env-hint/secrets.md +1 -0
  28. package/hooks/teamai-env-hint/variables.md +1 -0
  29. package/hooks/teamai-friction-reminder/HOOK.yaml +1 -0
  30. package/hooks/teamai-friction-reminder/README.md +117 -0
  31. package/hooks/teamai-friction-reminder/README.zh-CN.md +117 -0
  32. package/hooks/teamai-friction-reminder/action-gap.md +1 -0
  33. package/hooks/teamai-friction-reminder/action-gap.zh.md +1 -0
  34. package/hooks/teamai-friction-reminder/action-share-learnings.md +1 -0
  35. package/hooks/teamai-friction-reminder/action-share-learnings.zh.md +1 -0
  36. package/hooks/teamai-friction-reminder/action.md +1 -0
  37. package/hooks/teamai-friction-reminder/action.zh.md +1 -0
  38. package/hooks/teamai-friction-reminder/gap-reasons.md +1 -0
  39. package/hooks/teamai-friction-reminder/gap-reasons.zh.md +1 -0
  40. package/hooks/teamai-friction-reminder/gap.md +1 -0
  41. package/hooks/teamai-friction-reminder/gap.zh.md +1 -0
  42. package/hooks/teamai-friction-reminder/params.yaml +12 -0
  43. package/hooks/teamai-friction-reminder/problem-reasons.md +1 -0
  44. package/hooks/teamai-friction-reminder/problem-reasons.zh.md +1 -0
  45. package/hooks/teamai-friction-reminder/problem.md +1 -0
  46. package/hooks/teamai-friction-reminder/problem.zh.md +1 -0
  47. package/hooks/teamai-friction-reminder/reason-correction.md +1 -0
  48. package/hooks/teamai-friction-reminder/reason-correction.zh.md +1 -0
  49. package/hooks/teamai-friction-reminder/reason-interrupt.md +1 -0
  50. package/hooks/teamai-friction-reminder/reason-interrupt.zh.md +1 -0
  51. package/hooks/teamai-friction-reminder/reason-tool-error.md +1 -0
  52. package/hooks/teamai-friction-reminder/reason-tool-error.zh.md +1 -0
  53. package/hooks/teamai-friction-reminder/reason-tool-reject.md +1 -0
  54. package/hooks/teamai-friction-reminder/reason-tool-reject.zh.md +1 -0
  55. package/hooks/teamai-friction-reminder/task.md +1 -0
  56. package/hooks/teamai-friction-reminder/task.zh.md +1 -0
  57. package/hooks/teamai-mr-hint/HOOK.yaml +1 -0
  58. package/hooks/teamai-mr-hint/README.md +81 -0
  59. package/hooks/teamai-mr-hint/README.zh-CN.md +81 -0
  60. package/hooks/teamai-mr-hint/offer-command.en.md +7 -0
  61. package/hooks/teamai-mr-hint/offer-command.md +10 -0
  62. package/hooks/teamai-mr-hint/offer-workflow.en.md +7 -0
  63. package/hooks/teamai-mr-hint/offer-workflow.md +10 -0
  64. package/hooks/teamai-mr-hint/params.yaml +2 -0
  65. package/hooks/teamai-package-hint/HOOK.yaml +1 -0
  66. package/hooks/teamai-package-hint/README.md +64 -0
  67. package/hooks/teamai-package-hint/README.zh-CN.md +64 -0
  68. package/hooks/teamai-package-hint/message.md +3 -0
  69. package/hooks/teamai-todowrite-hint/HOOK.yaml +1 -0
  70. package/hooks/teamai-todowrite-hint/README.md +68 -0
  71. package/hooks/teamai-todowrite-hint/README.zh-CN.md +68 -0
  72. package/hooks/teamai-todowrite-hint/message.en.md +6 -0
  73. package/hooks/teamai-todowrite-hint/message.md +9 -0
  74. package/package.json +41 -14
  75. package/rules/teamai-recall/README.md +78 -0
  76. package/rules/teamai-recall/README.zh-CN.md +78 -0
  77. package/rules/teamai-recall/RULE.en.md +36 -0
  78. package/rules/teamai-recall/RULE.md +43 -0
  79. package/rules/teamai-recall/block-direct.md +27 -0
  80. package/rules/teamai-recall/block.en.md +42 -0
  81. package/rules/teamai-recall/block.md +44 -0
  82. package/runtimes/teamai-paseo.yaml +5 -0
  83. package/runtimes/teamai-sandbox.yaml +3 -0
  84. package/runtimes/teamai-t3.yaml +5 -0
  85. package/sandboxes/teamai-bwrap.yaml +2 -0
  86. package/sandboxes/teamai-default.yaml +4 -0
  87. package/sandboxes/teamai-docker.yaml +5 -0
  88. package/sandboxes/teamai-podman.yaml +4 -0
  89. package/sandboxes/teamai-sbx.yaml +4 -0
  90. package/sandboxes/teamai-seatbelt.yaml +2 -0
  91. package/sandboxes/teamai-vercel.yaml +4 -0
  92. package/scorers/README.md +103 -0
  93. package/scorers/README.zh-CN.md +103 -0
  94. package/scorers/teamai-adoption.md +11 -0
  95. package/scorers/teamai-correctness.md +17 -0
  96. package/scorers/teamai-routing.md +11 -0
  97. package/skill-data/core/SKILL.md +4 -3
  98. package/skill-data/core/references/commands.md +300 -67
  99. package/skill-data/core/references/contribute-member.md +4 -4
  100. package/skill-data/core/references/troubleshooting.md +128 -18
  101. package/skill-data/setup/references/join-member.md +13 -9
  102. package/skill-data/setup/references/manage-admin.md +41 -17
  103. package/skill-data/setup/references/setup-admin.md +2 -2
  104. package/skill-data/setup/references/uninstall.md +30 -9
  105. package/skill-data/share/SKILL.md +17 -12
  106. package/skill-data/share/references/doc-template.md +3 -4
  107. package/skill-data/wiki/SKILL.md +1 -1
  108. package/skill-data/wiki/references/agents/graph-rag-agent.md +5 -1
  109. package/skill-data/workflow/SKILL.md +39 -16
  110. package/skill-data/workflow/references/fleet.md +13 -0
  111. package/skill-data/workflow/references/judging.md +17 -10
  112. package/skill-data/workflow/references/places.md +64 -7
  113. package/skill-data/workflow/references/sandbox.md +3 -3
  114. package/skill-data/workflow/references/session-hosts.md +27 -0
  115. package/skill-data/workflow-local/SKILL.md +4 -3
  116. package/skill-data/workflow-local/references/ci.md +1 -1
  117. package/skills/teamai/SKILL.md +4 -3
  118. package/workflows/README.md +103 -0
  119. package/workflows/README.zh-CN.md +103 -0
  120. package/workflows/teamai-benchmark.yaml +78 -0
  121. package/workflows/teamai-ci-extract-mr.yaml +66 -0
  122. package/workflows/teamai-codebase-deep-enrich/README.md +123 -0
  123. package/workflows/teamai-codebase-deep-enrich/README.zh-CN.md +123 -0
  124. package/workflows/teamai-codebase-deep-enrich/WORKFLOW.yaml +119 -0
  125. package/workflows/teamai-codebase-deep-enrich/architecture.md +30 -0
  126. package/workflows/teamai-codebase-deep-enrich/component.md +30 -0
  127. package/workflows/teamai-codebase-deep-enrich/params.yaml +1 -0
  128. package/workflows/teamai-codebase-deep-enrich/scenarios.md +32 -0
  129. package/workflows/teamai-codebase-enrich.yaml +98 -0
  130. package/workflows/teamai-draft-learning-updates/README.md +116 -0
  131. package/workflows/teamai-draft-learning-updates/README.zh-CN.md +116 -0
  132. package/workflows/teamai-draft-learning-updates/WORKFLOW.yaml +61 -0
  133. package/workflows/teamai-draft-learning-updates/params.yaml +4 -0
  134. package/workflows/teamai-finished-sessions/README.md +101 -0
  135. package/workflows/teamai-finished-sessions/README.zh-CN.md +101 -0
  136. package/workflows/teamai-finished-sessions/WORKFLOW.yaml +43 -0
  137. package/workflows/teamai-finished-sessions/params.yaml +1 -0
  138. package/workflows/teamai-import-from-iwiki.yaml +90 -0
  139. package/workflows/teamai-import-from-mr/README.md +104 -0
  140. package/workflows/teamai-import-from-mr/README.zh-CN.md +104 -0
  141. package/workflows/teamai-import-from-mr/WORKFLOW.yaml +94 -0
  142. package/workflows/teamai-import-from-mr/draft.en.md +48 -0
  143. package/workflows/teamai-import-from-mr/draft.zh.md +48 -0
  144. package/workflows/teamai-import-from-repo/README.md +106 -0
  145. package/workflows/teamai-import-from-repo/README.zh-CN.md +106 -0
  146. package/workflows/teamai-import-from-repo/WORKFLOW.yaml +109 -0
  147. package/workflows/teamai-import-from-repo/narrative.md +83 -0
  148. package/workflows/teamai-import-learnings.yaml +83 -0
  149. package/workflows/teamai-import-rules.yaml +34 -0
  150. package/workflows/teamai-new-scorer.yaml +54 -0
  151. package/workflows/teamai-promote-learning/README.md +122 -0
  152. package/workflows/teamai-promote-learning/README.zh-CN.md +122 -0
  153. package/workflows/teamai-promote-learning/WORKFLOW.yaml +102 -0
  154. package/workflows/teamai-promote-learning/params.yaml +4 -0
  155. package/workflows/teamai-score.yaml +121 -0
  156. package/workflows/teamai-self-improvement.yaml +37 -0
  157. package/workflows/teamai-session-to-task.yaml +69 -0
  158. package/workflows/teamai-sessions-to-tasks.yaml +62 -0
  159. package/workflows/teamai-share-learnings-from-sessions.yaml +36 -0
  160. package/workflows/teamai-share-learnings.yaml +25 -0
  161. package/workflows/teamai-share-session.yaml +21 -0
  162. package/workflows/teamai-try-scorer.yaml +32 -0
  163. package/skill-data/workflow/references/hosts.md +0 -27
@@ -0,0 +1,62 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-sessions-to-tasks
3
+ description: Build a benchmark suite from past sessions - list the finished sessions, this machine's and the team's pushed ones, the suite could take a task from, pick representative ones per size, and draft each as a task with teamai-session-to-task. Use when asked to build or grow a benchmark suite from past sessions.
4
+ invoke: ask
5
+ inputs:
6
+ # The suite's directory, such as benchmarks/fix-auth.
7
+ suite: string
8
+ # How many tasks to draft at most.
9
+ count: number
10
+ # The largest S, M and L solution diffs, as lines,files; anything larger is XL.
11
+ sizes: string
12
+ defaults:
13
+ inputs: { sizes: "S=40,3 M=200,10 L=800,30" }
14
+ steps:
15
+ - id: local
16
+ # This machine's finished sessions with a recorded end, a clean start and end, both commits in the suite's repo,
17
+ # and no task of the suite coming from them; left_out counts the others by reason. --within 30d: Claude Code keeps
18
+ # a transcript 30 days by default; widen it when your agents keep them longer.
19
+ requires: { host: true }
20
+ command: teamai session list --finished --all --within 30d --suite "$SUITE" --sizes "$SIZES" --json
21
+ env: { SUITE: "{{ inputs.suite }}", SIZES: "{{ inputs.sizes }}" }
22
+ output:
23
+ list: [{ session: string, source: string, ended: string, prompt: string, start: string, solution: string, files: number, lines: number, size: string }]
24
+ leftOut: [{ reason: string, sessions: number }]
25
+ - id: pushed
26
+ needs: []
27
+ # The sessions the team pushed for the suite's repository, weighed the same way.
28
+ requires: { host: true }
29
+ command: teamai session list --all --suite "$SUITE" --sizes "$SIZES" --json
30
+ env: { SUITE: "{{ inputs.suite }}", SIZES: "{{ inputs.sizes }}" }
31
+ output:
32
+ list: [{ session: string, source: string, ended: string, title: string, teamSession: string, author: string, start: string, solution: string, files: number, lines: number, size: string }]
33
+ leftOut: [{ reason: string, sessions: number }]
34
+ - id: pick
35
+ needs: [local, pushed]
36
+ if: length(steps.local.outputs.list) > 0 || length(steps.pushed.outputs.list) > 0
37
+ answer: |-
38
+ Pick the past sessions to turn into tasks of the benchmark suite in {{ inputs.suite }}: at most {{ inputs.count }},
39
+ spread over the sizes S, M, L and XL as evenly as the candidates allow, and within a size the ones whose work
40
+ differs most from each other. Prefer a bug fix or a feature over exploration. Pick only from these candidates.
41
+
42
+ Sessions of this machine: {{ steps.local.outputs.list }}
43
+ Sessions the team pushed: {{ steps.pushed.outputs.list }}
44
+
45
+ Reply with {"picks": [...]}, one entry per picked session, copying its session, source, start and solution as they are;
46
+ for a pushed session also its teamSession and author, and "" for both for a session of this machine.
47
+ output: { picks: [{ session: string, source: string, start: string, solution: string, teamSession: string, author: string }] }
48
+ - id: draft
49
+ needs: [pick]
50
+ if: length(steps.pick.outputs.picks) > 0
51
+ # One at a time: the person accepts, edits or skips each draft, and each accepted task is a pull request of its own.
52
+ for_each: { items: steps.pick.outputs.picks, max_parallel: 1 }
53
+ workflow: teamai-session-to-task
54
+ with:
55
+ session: "{{ item.session }}"
56
+ source: "{{ item.source }}"
57
+ suite: "{{ inputs.suite }}"
58
+ start: "{{ item.start }}"
59
+ solution: "{{ item.solution }}"
60
+ team_session: "{{ item.teamSession }}"
61
+ author: "{{ item.author }}"
62
+ continue_on_failure: true
@@ -0,0 +1,36 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-share-learnings-from-sessions
3
+ description: Share what earlier sessions taught as team learnings - list this machine's finished sessions of every tool from the last week, ask which to share, then run teamai-share-learnings on each picked one without publishing it. Use when the person asks to share learnings from past sessions.
4
+ invoke: ask
5
+ inputs:
6
+ # How far back to look, such as 7d or 30d: a session last active longer ago is not offered.
7
+ within: string
8
+ defaults:
9
+ inputs: { within: 7d }
10
+ steps:
11
+ - id: sessions
12
+ requires: { host: true }
13
+ # Every finished session last active within inputs.within that no learning was contributed from, whatever the session policies say.
14
+ command: teamai session list --finished --all --within "$WITHIN" --json
15
+ env: { WITHIN: "{{ inputs.within }}" }
16
+ output: { list: [{ session: string, source: string, ended: string, prompt: string }] }
17
+ - id: pick
18
+ needs: [sessions]
19
+ if: length(steps.sessions.outputs.list) > 0
20
+ for_each: steps.sessions.outputs.list
21
+ workflow:
22
+ outputs: { choice: steps.ask.choice }
23
+ steps:
24
+ - id: ask
25
+ choose:
26
+ message: |-
27
+ {{ item.source }} session {{ item.session }}, last active {{ item.ended }}
28
+ First prompt: {{ item.prompt }}
29
+ share goes through what it taught with you; skip leaves it.
30
+ options: [share, skip]
31
+ - id: share
32
+ needs: [pick]
33
+ # One at a time: each one is a conversation with the person.
34
+ for_each: { items: "filter(steps.pick.results, .outputs.choice == 'share')", max_parallel: 1 }
35
+ workflow: teamai-share-learnings
36
+ with: { session: "{{ item.item.session }}", source: "{{ item.item.source }}", publish: false, scorers: [] }
@@ -0,0 +1,25 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-share-learnings
3
+ description: Close out this session with the person - share what it taught as team learnings, one or several, then publish and score it with teamai-share-session. Use when the person asks to close the session, or to share what it taught.
4
+ invoke: ask
5
+ inputs: { session: string, source: string, publish: boolean, scorers: [string] }
6
+ steps:
7
+ - id: learning
8
+ interactive: true
9
+ prompt: "Run `teamai skill get share` and follow it with the person for the {{ inputs.source }} session {{ inputs.session }}. Write each learning the person wants to share to its own file outside the repository, and return them as learnings, each with its path, its title, and its learnings namespace (an empty string for the shared root). If the person finds nothing worth sharing, return an empty list."
10
+ output: { learnings: [{ title: string, file: string, namespace: string }] }
11
+ - id: approve
12
+ needs: [learning]
13
+ if: length(steps.learning.outputs.learnings) > 0
14
+ approve: "Share these {{ length(steps.learning.outputs.learnings) }} learnings with the team? {{ steps.learning.outputs.learnings }}"
15
+ - id: contribute
16
+ needs: [learning, approve]
17
+ if: steps.approve.outcome == 'success'
18
+ for_each: steps.learning.outputs.learnings
19
+ requires: { host: true }
20
+ command: teamai contribute --file "$FILE" --title "$TITLE" --namespace "$NS" --session-id "$SESSION"
21
+ env: { FILE: "{{ item.file }}", TITLE: "{{ item.title }}", NS: "{{ item.namespace }}", SESSION: "{{ inputs.session }}" }
22
+ - id: share-session
23
+ needs: []
24
+ workflow: teamai-share-session
25
+ with: { session: "{{ inputs.session }}", source: "{{ inputs.source }}", publish: "{{ inputs.publish }}", scorers: "{{ inputs.scorers }}", demand: named }
@@ -0,0 +1,21 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-share-session
3
+ description: Share this session with the team - publish its transcript, scrubbed, and score it with the team's scorers. Use when the person asks to publish or archive the session, or to score or judge it.
4
+ invoke: ask
5
+ # demand: named when a person or an agent asks for this session, auto from a background pass, which samples it.
6
+ inputs: { session: string, source: string, publish: boolean, scorers: [string], demand: auto | named }
7
+ steps:
8
+ - id: publish
9
+ if: inputs.publish
10
+ requires: { host: true }
11
+ command: teamai session push --scrub --session "$SESSION" --source "$SOURCE"
12
+ env: { SESSION: "{{ inputs.session }}", SOURCE: "{{ inputs.source }}" }
13
+ - id: score
14
+ needs: []
15
+ if: length(inputs.scorers) > 0
16
+ workflow: teamai-score
17
+ with: { subject: "session:{{ inputs.source }}:{{ inputs.session }}", scorers: "{{ inputs.scorers }}", label: "", batch: false, demand: "{{ inputs.demand }}" }
18
+ # A judge no driver here can take holds the step this long; the session stays published, and --drain starts the
19
+ # lapse again as a teamai-score run of its own.
20
+ timeout: 30m
21
+ continue_on_failure: true
@@ -0,0 +1,32 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-try-scorer
3
+ description: Try scorer files on a finished session before they are pushed, and on its control, storing no label.
4
+ invoke: deny
5
+ private: true
6
+ inputs:
7
+ # session:<source>:<sessionId> or team-session:<author>:<archive name>
8
+ subject: string
9
+ # Scorer files, as teamai pull reads them.
10
+ files: [string]
11
+ batch: boolean
12
+ defaults:
13
+ inputs: { batch: false }
14
+ steps:
15
+ - id: session
16
+ workflow: teamai-score
17
+ with: { subject: "{{ inputs.subject }}", scorers: [], label: "", batch: "{{ inputs.batch }}", demand: named, files: "{{ inputs.files }}", store: false }
18
+ timeout: 10m
19
+ # The same files on the session's first prompt alone: a rubric that passes it may not judge the work.
20
+ - id: control
21
+ needs: [session]
22
+ workflow: teamai-score
23
+ with: { subject: "{{ inputs.subject }}", scorers: [], label: "", batch: "{{ inputs.batch }}", demand: named, files: "{{ inputs.files }}", store: false, control: true }
24
+ timeout: 10m
25
+ continue_on_failure: true
26
+ - id: report
27
+ needs: [session, control]
28
+ requires: { host: true }
29
+ command: teamai score report --labels "$LABELS" --control "$CONTROL"
30
+ env: { LABELS: "{{ steps.session.outputs.labels }}", CONTROL: "{{ steps.control.outputs.labels }}" }
31
+ output: { answer: json, text: string, warnings: string }
32
+ outputs: { answer: steps.report.outputs.answer, text: steps.report.outputs.text, warnings: steps.report.outputs.warnings }
@@ -1,27 +0,0 @@
1
- # The host question
2
-
3
- The 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 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 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 host starts by name, such as the files in `.claude/agents/`.
8
- 3. Native subagents: the host's own subagent tool.
9
- 4. None: your 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, 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 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 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.