@tonbo/cli 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,32 +7,44 @@ npm install --global @tonbo/cli
7
7
  tonbo --version
8
8
  ```
9
9
 
10
- The V1 CLI deploys a PI-based Agent directly from a local directory without requiring Git or Tonbo calls in the Agent source. Initialize the current directory interactively:
10
+ The CLI deploys an Agent directly from a local directory without requiring Git or Tonbo calls in the Agent source. Initialize the current directory interactively:
11
11
 
12
12
  ```console
13
13
  tonbo init
14
- ? Inference model [claude-sonnet-4-5]:
14
+ ? How should Tonbo run this project?
15
+ ❯ PI CLI (`pi`) Run pi directly with AGENTS.md and optional project-local .pi resources.
16
+ PI SDK app Run a custom Node.js entrypoint built on the PI SDK.
15
17
  Created .tonbo.
18
+ Harness: PI
19
+ Mode: PI CLI
16
20
  Next: tonbo project create <slug>
17
21
  ```
18
22
 
23
+ Use the arrow keys to select an available execution target and Enter to confirm. `AGENTS.md` is Harness-neutral and never identifies PI by itself. When `.pi/settings.json` exists, the shared source inspector identifies the PI Harness, reports its project-local packages, and narrows the prompt to the native PI or PI SDK execution modes. Unsupported and planned Harnesses are not shown.
24
+
19
25
  The generated `.tonbo` is TOML:
20
26
 
21
27
  ```toml
22
28
  version = 1
23
29
 
24
- [execution]
25
- mode = "managed"
30
+ [agent]
26
31
  runtime = "pi"
27
32
 
33
+ [agent.driver]
34
+ kind = "native"
35
+
28
36
  [inference]
29
37
  model = "claude-sonnet-4-5"
38
+ ```
30
39
 
31
- [session_capture]
32
- adapter = "pi-jsonl-v3"
40
+ The default inference model is written without prompting. Override it explicitly with `--model`. Automation must make ambiguous choices explicit; an existing declaration requires interactive confirmation or `--force`:
41
+
42
+ ```console
43
+ tonbo init --harness pi --driver native
44
+ tonbo init --harness pi --driver command --agent-entry dist/agent.mjs
33
45
  ```
34
46
 
35
- For automation, use `tonbo init --model <model>`; an existing declaration requires interactive confirmation or `--force`. Then authenticate, bind the directory and deploy its current contents:
47
+ Then authenticate, bind the directory and deploy its current contents:
36
48
 
37
49
  ```console
38
50
  tonbo login
@@ -63,9 +75,61 @@ ssh my-project@tonbo.sh
63
75
 
64
76
  The SSH username selects the globally unique Project; the signed public key identifies the Tonbo user and is checked against Project membership and IAM at connection time. The shell and HTTP turns may coexist on the singleton runtime, allowing the shell to observe the Agent while it works. Session writer fencing protects durable conversation history; ordinary workspace files retain Linux process concurrency semantics.
65
77
 
66
- The platform injects scoped inference access and the managed PI runtime writes the declared session format through the session-aware filesystem. Do not put a model-provider API key or a Tonbo credential in `.tonbo`.
78
+ The platform injects scoped inference access and owns PI Session capture. Do not put a model-provider API key or a Tonbo credential in `.tonbo`.
79
+
80
+ Deploy snapshots regular files under `.tonbo`, excluding `.git`, `node_modules`, PI package caches, local environment files and patterns in `.tonboignore`. Equal contents produce the same revision. Coding tools start in the persistent Artifacts workspace, while `AGENTS.md` and trusted `.pi` extensions, skills, prompts and settings load from the uploaded revision.
81
+
82
+ ## Supported PI project shapes
83
+
84
+ ### 1. Project-local Agent
85
+
86
+ Keep the normal PI project layout. Tonbo runs the same `AGENTS.md`, `.pi/APPEND_SYSTEM.md`, `.pi/settings.json`, `.pi/extensions`, `.pi/skills` and `.pi/prompts` that local `pi` loads:
87
+
88
+ ```console
89
+ pi
90
+ tonbo init
91
+ tonbo project create my-agent
92
+ tonbo deploy
93
+ tonbo run "Start the task."
94
+ ```
95
+
96
+ ### 2. PI Package project
97
+
98
+ Use PI's project-local package declaration as the single source of truth. A package is a PI resource, not another Tonbo execution mode: `tonbo init` recognizes `.pi/settings.json`, then the native PI driver loads the packages. Install an immutable package reference locally, verify it with PI, and deploy the project; Tonbo excludes `.pi/npm` and `.pi/git` caches and restores packages inside the isolated runtime:
99
+
100
+ ```console
101
+ pi install -l npm:@acme/my-pi-agent@1.2.3
102
+ pi
103
+ tonbo init
104
+ tonbo deploy
105
+ ```
106
+
107
+ Remote npm packages must use an exact version. Git packages must use a full 40-character commit, for example `git:github.com/acme/my-pi-agent@0123456789abcdef0123456789abcdef01234567`. Movable tags, branches, ranges and `latest` fail deployment.
108
+
109
+ ### 3. PI SDK app
110
+
111
+ Choose `PI SDK app` with the arrow selector, use `--driver command --agent-entry <file>` in automation, or declare a command driver directly:
112
+
113
+ ```toml
114
+ version = 1
115
+
116
+ [agent]
117
+ runtime = "pi"
118
+ secrets = ["GITHUB_TOKEN"]
119
+
120
+ [agent.driver]
121
+ kind = "command"
122
+ protocol = "pi-rpc-v1"
123
+ command = ["node", "dist/agent.mjs"]
124
+
125
+ [build]
126
+ command = ["npm", "run", "build"]
127
+
128
+ [inference]
129
+ model = "claude-sonnet-4-5"
130
+ ```
67
131
 
68
- Deploy snapshots regular files under `.tonbo`, excluding `.git`, `node_modules`, local environment files and patterns in `.tonboignore`. Equal contents produce the same revision. Coding tools start in the persistent Artifacts workspace, while `.pi` extensions, skills and prompts load from the uploaded revision.
132
+ `tonbo deploy` runs the build command before creating the source snapshot. The entrypoint must keep stdout exclusively for PI RPC and send logs to stderr. It receives `PI_CODING_AGENT_MODULE`, `PI_CODING_AGENT_DIR`, `PI_CODING_AGENT_SESSION_DIR`, `TONBO_PI_SESSION_FILE`, `TONBO_PI_SESSION_ID`, `TONBO_PI_PROVIDER`, `TONBO_PI_MODEL` and `TONBO_PI_RPC_PROTOCOL`. Load the platform PI SDK from `PI_CODING_AGENT_MODULE`, open `TONBO_PI_SESSION_FILE`, create an `AgentSessionRuntime`, and pass it to `runRpcMode()`. This lets the app customize tools and runtime services without forking PI while preserving Tonbo's durable Session and Turn protocol.
69
133
 
70
134
  For a non-interactive invocation, provide a current Tonbo CLI OAuth access token and an explicit Project:
71
135
 
@@ -79,6 +143,8 @@ Node.js 22 or newer is required. Human OAuth tokens are stored at `${XDG_CONFIG_
79
143
  ## Related design
80
144
 
81
145
  - [Design documentation map](../../docs/design/README.md)
146
+ - [Agent source inspection and onboarding](../../docs/design/agent-source-onboarding.md)
147
+ - [Shared source inspector](../../packages/agent-source-inspector/README.md)
82
148
  - [Project resource model](../../docs/design/project-resource-model.md)
83
149
  - [ADR-0008: Tonbo CLI onboarding and credential boundaries](../../apps/user-center/docs/decisions/adr-0008-tonbo-cli-onboarding.md)
84
150
  - [Management API v1](../../contracts/management/openapi-v1.yaml)