@team-ai/teamai-cli 0.22.10 → 0.30.1

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.
@@ -0,0 +1,13 @@
1
+ # Judging
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 runs that judge in the background on each scored step's work, from evidence only the judge reads, so a label stays independent of the session whose work it scores. Your part is the person.
4
+
5
+ | Event | What happened | Tell the person |
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 |
9
+ | `judging-off` | Judging of this run stopped for `failure`, and nothing more of it is judged here. | `failure.message` |
10
+
11
+ A `done` action that carries `judging` has a judge still open. Keep running `then` until a turn has none: each `judged` event comes in one of those turns.
12
+
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.
@@ -0,0 +1,32 @@
1
+ # Places your host makes
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`:
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.
6
+ 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
+ 3. Act on the turn it returns:
8
+ - 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.
9
+ - The `place` action again, with `refused`: the place was not adopted, and `refused` says why and what to fix. Fix that place or make another, then run `adopt` again. The step keeps waiting, and a refusal costs it nothing.
10
+
11
+ Done when the turn carries a `dispatch` for the `attempt`.
12
+
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
+
15
+ ## The checks
16
+
17
+ `adopt` checks the place before it changes anything there. The place must be:
18
+
19
+ - the top directory of a worktree of the run's repository, as `git worktree add` in this checkout makes; a separate clone does not count;
20
+ - clean: no uncommitted or untracked changes;
21
+ - on `branch`, or detached at `start` while `branch` does not exist yet;
22
+ - holding `start` in its history;
23
+ - left by no setup that failed or was cut short there: remove that worktree and make it again;
24
+ - free: no other open step of the run works there.
25
+
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
+
28
+ ## Later steps
29
+
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.
31
+
32
+ TeamAI commits each step's work in the place and never removes it. Remove it with your host once the run is done.
@@ -0,0 +1,14 @@
1
+ # Children in a sandbox or VM
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.
4
+
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
+
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.
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
+ 2. Run the option's `run`.
11
+
12
+ Done when the turn it returns has no `choose` action, or the person has the local-driver route.
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`. Its dispatch carries `needs.isolation: sandbox`: start that child in a sandbox when your 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 host says so.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: workflow-local
3
+ description: Run a team workflow unattended with the local driver. Use in CI or a cloud agent, when a describe reply routed the run to the local driver, or to continue a run on this machine without a coding session.
4
+ ---
5
+
6
+ # Run a team workflow unattended
7
+
8
+ The local driver runs a whole run in one process on this machine: each command step as a process, each prompt step through a headless tool. Nobody is asked anything while it runs, so every answer the run needs is decided before it starts.
9
+
10
+ ## When
11
+
12
+ - A CI job or a cloud agent runs the workflow.
13
+ - `teamai workflow start --describe <name> --driver skill` answered `ask.kind: local`: a coding session cannot run some step, and `ask.reason` says which.
14
+ - A run continues on this machine without a coding session: after a retry, an answer, a stopped driver, or a session that handed it over.
15
+
16
+ ## Run it
17
+
18
+ 1. Run `teamai workflow start <name> --describe` and read the inputs it lists.
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
+ 3. To continue a run that stopped, run `teamai workflow resume <run>`.
21
+
22
+ The command exits when the run ends: 0 when it succeeded, 1 when it failed or was cancelled. 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
+
24
+ ## Approvals
25
+
26
+ Without a terminal, nobody answers a gate during the run:
27
+
28
+ - A required approval fails its step `hitl_required`, and so does the run.
29
+ - 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, and a choice fails `hitl_required`.
31
+
32
+ ## From an agent session
33
+
34
+ A coding agent's session may start or continue only a workflow whose `invoke` allows it, with `start` or `resume`. `invoke: allow` goes on. `invoke: ask` goes on once the person agreed, with `--confirmed`, and never in an unattended run (CI or a cloud agent), where it answers `unattended_denied`. `invoke: deny`, the default, answers `invoke_denied`. Tell the person the `message`, which names the command for their own terminal.
35
+
36
+ Inside a workflow step, every `teamai workflow` command that changes a run answers `nested_workflow`. Do the step's own work there instead.
37
+
38
+ ## Env and secrets
39
+
40
+ A step gets the team env keys its `requires.env` lists, and no other team key. A key with no value on this machine fails the step `missing_env` before it runs, and the message names the `teamai env set` command. A CI job exports each secret under its key name instead. TeamAI masks the value of every key in `env/secrets.yaml` in run files and output.
41
+
42
+ ## CI
43
+
44
+ When you set up a CI job that starts a run, read `references/ci.md`.
@@ -0,0 +1,16 @@
1
+ # Start a run from CI
2
+
3
+ The guide has the GitHub Actions job to copy: [Start from CI](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/workflow.md#start-from-ci). It checks out a named branch, runs `teamai init` and `teamai pull`, then `teamai workflow start <name> --driver local`.
4
+
5
+ Two settings in that job decide whether the run works:
6
+
7
+ 1. **The teamai version.** teamai before 0.28.0 drops a workflow that sets `invoke` or `alias`, so the job finds nothing to run. Pin `teamai-cli` at 0.28.0 or later.
8
+ 2. **The token.** It reads the team repo, pushes branches to the product repo, and opens pull requests there, which a `deliver: pr` step needs. The default GitHub Actions token cannot read another repository.
9
+
10
+ A CI job sets `CI`, which makes the run unattended, and every process of its steps gets `TEAMAI_MODE=unattended`. A scheduler that sets no `CI`, such as cron, makes the run unattended itself:
11
+
12
+ ```yaml
13
+ env: { TEAMAI_MODE: unattended }
14
+ ```
15
+
16
+ Done when the job pins that version and its token has those three permissions.
@@ -11,7 +11,7 @@ description: >-
11
11
  after a friction reminder. Triggers include "set up teamai", "join the team repo", "sync team
12
12
  skills", "team wiki", "share what I learned", and running /teamai. Talking about a team needs no
13
13
  skill; operating on what the team shares does.
14
- allowed-tools: Bash(teamai skill:*), Bash(npx teamai-cli skill:*)
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
15
  ---
16
16
 
17
17
  # teamai
@@ -37,6 +37,8 @@ The CLI serves skill content that always matches the installed version, so instr
37
37
  teamai skill get setup # day 0: create a team repo (admin) or join one (member), manage, uninstall
38
38
  teamai skill get wiki # large multi-repo codebase: architecture reverse-engineering and knowledge base
39
39
  teamai skill get share # turn what this session taught you into a team learning (needs recall on)
40
+ teamai skill get workflow # drive a requested team workflow from this coding session
41
+ teamai skill get workflow-local # run a workflow unattended: CI, cloud agents, a handed-off run
40
42
  ```
41
43
 
42
44
  Publishing a skill, rule or doc the user already has is in `core`; it needs no recall.