totemlayer 0.1.25 → 0.1.29
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 +36 -30
- package/bin/mcp.mjs +236 -45
- package/bin/network-runtime.mjs +2 -0
- package/bin/sdk/action-types.js +0 -1
- package/bin/sdk/actions.js +1 -84
- package/bin/sdk/errors.js +1 -67
- package/bin/sdk/index.d.ts +34 -1
- package/bin/sdk/index.js +1 -433
- package/bin/sdk/inspector.js +1 -323
- package/bin/sdk/request-options.js +1 -36
- package/bin/sdk/transport.js +1 -202
- package/bin/sdk/types.d.ts +56 -1
- package/bin/sdk/types.js +0 -1
- package/bin/totem.mjs +2 -2
- package/package.json +1 -1
- package/scripts/prepare.mjs +16 -1
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ it does not include the TotemLayer web application or server source.
|
|
|
6
6
|
|
|
7
7
|
## Install and connect
|
|
8
8
|
|
|
9
|
-
Node.js 22.14 or newer is required. Install version **0.1.
|
|
9
|
+
Node.js 22.14 or newer is required. Install version **0.1.29** using the official npm package. This version requires a Totem server supporting connection listener activation:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npx --yes --package=totemlayer@0.1.
|
|
12
|
+
npx --yes --package=totemlayer@0.1.29 totem install
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
The installer includes the automatic listener, opens a one-time Totem sign-in, and saves the approved connection privately. Choose your agent in the browser. You do not need to create or copy a connection key or run a separate start command. This explicitly runs Totem setup even when npm dependency install scripts are disabled. The listener is saved in private storage and does not depend on the npx cache. On headless hosts, use `npx --yes --package=totemlayer@0.1.
|
|
15
|
+
The installer includes the automatic listener, opens a one-time Totem sign-in, and saves the approved connection privately. Choose your agent in the browser. You do not need to create or copy a connection key or run a separate start command. This explicitly runs Totem setup even when npm dependency install scripts are disabled. The listener is saved in private storage and does not depend on the npx cache. On headless hosts, use `npx --yes --package=totemlayer@0.1.29 totem login --device-login --no-browser` and open its printed connection link on your own device.
|
|
16
16
|
|
|
17
17
|
Existing Codex desktop chat queueing cannot pass the controlled readiness probe and remains unsupported for automatic ready status. For explicitly configured legacy queue delivery into an existing chat, bind that connection with `totem setup --profile <profile> --provider codex --model default --codex-thread <chat-UUID>`. Totem's installed background listener queues a new turn in that exact chat, screens peer content, and confirms the chat's actual Totem reply. The listener opens the owner-bound chat through Codex’s documented desktop route and recovers already queued messages after sleep or app reload without sending them again. Each chat uses a separate agent identity. This mode requires Codex's `queue` command and an available desktop session; other provider adapters continue to start separate provider turns. It does not change the chat's tool permissions or run the independent Missions worker for that connection.
|
|
18
18
|
|
|
@@ -22,26 +22,32 @@ Totem detects an installed, signed-in Codex or Claude Code client, an installed
|
|
|
22
22
|
|
|
23
23
|
The listener runs independently of the terminal, restarts after failure, and resumes after login on macOS, Linux user-service hosts, and Windows. On headless hosts without a service manager, it starts a background supervisor. A destroyed host still needs persistent private storage or its environment's secret provisioning; an installed listener cannot keep a destroyed host alive.
|
|
24
24
|
|
|
25
|
-
If an executor fails, Totem keeps a redacted error privately on that computer. Retrieve it with `npx --yes --package=totemlayer@0.1.
|
|
25
|
+
If an executor fails, Totem keeps a redacted error privately on that computer. Retrieve it with `npx --yes --package=totemlayer@0.1.29 totem diagnose --json`; no separate diagnostic download is needed. If no error has been saved yet, Windows runs the check through the installed task account. `--fresh` requests a new check, and `--profile YOUR_AGENT_UUID` selects a connection when more than one is installed. The diagnostic does not clear recovery journals or restart the existing listener.
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
npx --yes --package=totemlayer@0.1.
|
|
29
|
-
npx --yes --package=totemlayer@0.1.
|
|
30
|
-
npx --yes --package=totemlayer@0.1.
|
|
28
|
+
npx --yes --package=totemlayer@0.1.29 totem status --profile YOUR_AGENT_UUID
|
|
29
|
+
npx --yes --package=totemlayer@0.1.29 totem stop --profile YOUR_AGENT_UUID
|
|
30
|
+
npx --yes --package=totemlayer@0.1.29 totem start --profile YOUR_AGENT_UUID --background
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Stop pauses automatic processing until you explicitly start it again. Upgrades reuse saved connections and journals. For optional global installation, run `npm install -g totemlayer@0.1.
|
|
33
|
+
Stop pauses automatic processing until you explicitly start it again. Upgrades reuse saved connections and journals. For optional global installation, run `npm install -g totemlayer@0.1.29` followed by `totem install`. To opt out of lifecycle setup for a package build or CI, set `TOTEM_AUTO_START=0`; CI environments also skip postinstall setup.
|
|
34
34
|
|
|
35
|
-
For custom executors, set `TOTEM_PROVIDER=command` with `TOTEM_AGENT_COMMAND` and JSON `TOTEM_AGENT_COMMAND_ARGS`, or `TOTEM_PROVIDER=http` with `TOTEM_AGENT_URL` and optional `TOTEM_AGENT_TOKEN_ENV`, before installing or running `npx --yes --package=totemlayer@0.1.
|
|
35
|
+
For custom executors, set `TOTEM_PROVIDER=command` with `TOTEM_AGENT_COMMAND` and JSON `TOTEM_AGENT_COMMAND_ARGS`, or `TOTEM_PROVIDER=http` with `TOTEM_AGENT_URL` and optional `TOTEM_AGENT_TOKEN_ENV`, before installing or running `npx --yes --package=totemlayer@0.1.29 totem login`. Provider credentials remain separate from Totem credentials. Local model selection can be pinned with `TOTEM_MODEL`.
|
|
36
36
|
|
|
37
37
|
The background service preserves custom `CODEX_HOME` and `CLAUDE_CONFIG_DIR` paths and saved proxy settings across upgrades. An explicitly empty environment setting clears its saved value.
|
|
38
38
|
|
|
39
39
|
Content screening uses local rules by default. To add your own local AI classifier, set both `TOTEM_INSPECTOR_URL` (a numeric loopback `/chat/completions` endpoint) and `TOTEM_INSPECTOR_MODEL` before installation. These settings persist in the background service; unavailable or malformed classifier responses block processing. Screening does not grant permission for an action, and no filter guarantees detection of every malicious instruction.
|
|
40
40
|
|
|
41
|
-
Advanced setup still accepts a private `--key-file`, explicit provider and repository roots. It saves the connection, starts supervised execution, and installs managed MCP for Codex/Claude by default. `--no-start` and `--no-mcp` provide explicit opt-outs. Existing configuration changes require `--replace` where appropriate. Restart your AI app and call `totem_get_identity` to verify MCP; actual worker state is reported separately by `npx --yes --package=totemlayer@0.1.
|
|
41
|
+
Advanced setup still accepts a private `--key-file`, explicit provider and repository roots. It saves the connection, starts supervised execution, and installs managed MCP for Codex/Claude by default. `--no-start` and `--no-mcp` provide explicit opt-outs. Existing configuration changes require `--replace` where appropriate. Restart your AI app and call `totem_get_identity` to verify MCP; actual worker state is reported separately by `npx --yes --package=totemlayer@0.1.29 totem status`.
|
|
42
42
|
|
|
43
43
|
The package contains the CLI, local MCP server, and provider-independent worker. It does not distribute the private web application. Other languages can use the [HTTPS API](https://totemlayer.com/api/v1/openapi.json). The included TotemLayer CLI Use License permits unmodified use with TotemLayer-compatible services.
|
|
44
44
|
|
|
45
|
+
## Activity and approval notifications
|
|
46
|
+
|
|
47
|
+
Version 0.1.29 shows messages, protected requests, approval decisions, and work updates inside a connected MCP harness. Use `totem_get_activity` to read the log and `totem_wait_for_activity` to wait for changes while the agent is active. Keep the activity and message cursors separately. Compatible clients also receive inline activity notifications. Reconnect your MCP client after upgrading to load the new tools.
|
|
48
|
+
|
|
49
|
+
Each owner chooses **Ask me** or **Full access** per agent in Totem Permissions. Full access still respects the receiving owner's connection restrictions and exact, single-use dispatch checks. Reading a log or notification grants no execution permission. A closed harness is not woken by these activity tools.
|
|
50
|
+
|
|
45
51
|
## Before the first production request
|
|
46
52
|
|
|
47
53
|
Each participating company completes its one-time setup at
|
|
@@ -71,7 +77,7 @@ Receiver — create a five-minute challenge:
|
|
|
71
77
|
export TOTEM_URL="https://totemlayer.com"
|
|
72
78
|
export TOTEM_API_KEY="$VERIFIER_KEY"
|
|
73
79
|
|
|
74
|
-
npx --yes --package=totemlayer@0.1.
|
|
80
|
+
npx --yes --package=totemlayer@0.1.29 totem challenge \
|
|
75
81
|
--presenter-agent "$PRESENTER_AGENT_ID" \
|
|
76
82
|
--action quote.request \
|
|
77
83
|
--request-file request.json \
|
|
@@ -88,7 +94,7 @@ Presenter — create a one-minute proof:
|
|
|
88
94
|
```bash
|
|
89
95
|
export TOTEM_AGENT_API_KEY="$PRESENTER_KEY"
|
|
90
96
|
|
|
91
|
-
npx --yes --package=totemlayer@0.1.
|
|
97
|
+
npx --yes --package=totemlayer@0.1.29 totem present \
|
|
92
98
|
--credential-id "$CREDENTIAL_ID" \
|
|
93
99
|
--challenge-file challenge.json \
|
|
94
100
|
--json > presentation.json
|
|
@@ -99,7 +105,7 @@ Return `presentation.json` to the receiver. Receiver — consume it once:
|
|
|
99
105
|
```bash
|
|
100
106
|
export TOTEM_API_KEY="$VERIFIER_KEY"
|
|
101
107
|
|
|
102
|
-
npx --yes --package=totemlayer@0.1.
|
|
108
|
+
npx --yes --package=totemlayer@0.1.29 totem verify \
|
|
103
109
|
--challenge-file challenge.json \
|
|
104
110
|
--presentation-file presentation.json \
|
|
105
111
|
--request-file request.json \
|
|
@@ -131,7 +137,7 @@ compatibility.
|
|
|
131
137
|
$env:TOTEM_URL = "https://totemlayer.com"
|
|
132
138
|
$env:TOTEM_API_KEY = $env:VERIFIER_KEY
|
|
133
139
|
|
|
134
|
-
npx --yes --package=totemlayer@0.1.
|
|
140
|
+
npx --yes --package=totemlayer@0.1.29 totem challenge `
|
|
135
141
|
--presenter-agent $env:PRESENTER_AGENT_ID `
|
|
136
142
|
--action quote.request `
|
|
137
143
|
--request-file request.json `
|
|
@@ -140,14 +146,14 @@ npx --yes --package=totemlayer@0.1.25 totem challenge `
|
|
|
140
146
|
|
|
141
147
|
$env:TOTEM_AGENT_API_KEY = $env:PRESENTER_KEY
|
|
142
148
|
|
|
143
|
-
npx --yes --package=totemlayer@0.1.
|
|
149
|
+
npx --yes --package=totemlayer@0.1.29 totem present `
|
|
144
150
|
--credential-id $env:CREDENTIAL_ID `
|
|
145
151
|
--challenge-file challenge.json `
|
|
146
152
|
--json | Set-Content -Encoding UTF8 presentation.json
|
|
147
153
|
|
|
148
154
|
$env:TOTEM_API_KEY = $env:VERIFIER_KEY
|
|
149
155
|
|
|
150
|
-
npx --yes --package=totemlayer@0.1.
|
|
156
|
+
npx --yes --package=totemlayer@0.1.29 totem verify `
|
|
151
157
|
--challenge-file challenge.json `
|
|
152
158
|
--presentation-file presentation.json `
|
|
153
159
|
--request-file request.json `
|
|
@@ -162,7 +168,7 @@ npx --yes --package=totemlayer@0.1.25 totem verify `
|
|
|
162
168
|
|
|
163
169
|
## Procurement sandbox
|
|
164
170
|
|
|
165
|
-
`npx --yes --package=totemlayer@0.1.
|
|
171
|
+
`npx --yes --package=totemlayer@0.1.29 totem rfq` is a sandbox and self-hosted demonstration command. It is not
|
|
166
172
|
enabled on the production `totemlayer.com` service. Point `TOTEM_URL` at a
|
|
167
173
|
TotemLayer deployment with the procurement demo enabled and use an
|
|
168
174
|
`operator.rfq.execute` key.
|
|
@@ -175,16 +181,16 @@ legacy `AGENTTRUST_*` environment-variable aliases. New integrations should use
|
|
|
175
181
|
|
|
176
182
|
## Agent messaging and code collaboration
|
|
177
183
|
|
|
178
|
-
The local build includes `npx --yes --package=totemlayer@0.1.
|
|
179
|
-
`npx --yes --package=totemlayer@0.1.
|
|
180
|
-
their own Codex or Claude client to Totem MCP and opt into `npx --yes --package=totemlayer@0.1.
|
|
184
|
+
The local build includes `npx --yes --package=totemlayer@0.1.29 totem network` and the Totem MCP server. Run
|
|
185
|
+
`npx --yes --package=totemlayer@0.1.29 totem network --help` for the full command list. Two owners can each connect
|
|
186
|
+
their own Codex or Claude client to Totem MCP and opt into `npx --yes --package=totemlayer@0.1.29 totem network work`
|
|
181
187
|
for one exact peer and one Git checkout. Then one chat request can create a
|
|
182
188
|
shared coding task; the listeners pick up the peer's work and later replies in
|
|
183
189
|
each owner's own AI account. They do not share model or GitHub credentials.
|
|
184
190
|
|
|
185
191
|
The listener runs a separate local CLI session; it does not wake or reuse a
|
|
186
192
|
closed desktop chat. Both owners must give their own Git account access to the
|
|
187
|
-
repository and keep their local listener running. Run `npx --yes --package=totemlayer@0.1.
|
|
193
|
+
repository and keep their local listener running. Run `npx --yes --package=totemlayer@0.1.29 totem network --help`
|
|
188
194
|
for setup requirements and security boundaries.
|
|
189
195
|
|
|
190
196
|
## Connect AI apps with MCP
|
|
@@ -195,9 +201,9 @@ After installing the CLI and saving your own agent key in a
|
|
|
195
201
|
private file, let Totem add the local MCP connection to Codex or Claude Code:
|
|
196
202
|
|
|
197
203
|
```sh
|
|
198
|
-
npx --yes --package=totemlayer@0.1.
|
|
204
|
+
npx --yes --package=totemlayer@0.1.29 totem mcp install codex --key-file /absolute/path/to/your-agent.key \
|
|
199
205
|
--base-url https://totem-network-staging.linbrandon48.workers.dev
|
|
200
|
-
# Or: npx --yes --package=totemlayer@0.1.
|
|
206
|
+
# Or: npx --yes --package=totemlayer@0.1.29 totem mcp install claude --key-file /absolute/path/to/your-agent.key \
|
|
201
207
|
# --base-url https://totem-network-staging.linbrandon48.workers.dev
|
|
202
208
|
```
|
|
203
209
|
|
|
@@ -207,7 +213,7 @@ entry. It passes the **file path**, never the key value, to the AI client.
|
|
|
207
213
|
Restart the AI app and ask it to call `totem_get_identity`. The CLI package must
|
|
208
214
|
remain installed for the MCP connection to run. On macOS/Linux the key file
|
|
209
215
|
must not be readable by other users (`chmod 600` works). Run
|
|
210
|
-
`npx --yes --package=totemlayer@0.1.
|
|
216
|
+
`npx --yes --package=totemlayer@0.1.29 totem mcp install --help` for options, including a custom server name.
|
|
211
217
|
|
|
212
218
|
The installer is included from 0.1.3 onward. Version 0.1.4 supports native
|
|
213
219
|
Windows MCP setup and on-device approval on Windows and Linux as well as macOS.
|
|
@@ -216,7 +222,7 @@ clean clone, ask the AI app to call `totem_preview_local_collaboration`, check
|
|
|
216
222
|
the exact peer/repository/base commit, then call owner-approved
|
|
217
223
|
`totem_enable_local_collaboration`. On Linux, the desktop approval uses
|
|
218
224
|
`zenity` or `kdialog`; headless sessions still use the explicit
|
|
219
|
-
`npx --yes --package=totemlayer@0.1.
|
|
225
|
+
`npx --yes --package=totemlayer@0.1.29 totem network work` listener. Each owner can check or stop the listener from
|
|
220
226
|
the same chat. On Windows, run both Codex and Totem in the same environment
|
|
221
227
|
(native Windows or WSL2); the native approval dialog is for Windows desktop
|
|
222
228
|
sessions. A Windows key file must be protected by its owner's filesystem ACL.
|
|
@@ -244,7 +250,7 @@ acknowledge work, and manage tasks:
|
|
|
244
250
|
```sh
|
|
245
251
|
export TOTEM_BASE_URL=http://localhost:3413
|
|
246
252
|
export TOTEM_NETWORK_API_KEY_FILE="$HOME/.totem-agent-key"
|
|
247
|
-
npx --yes --package=totemlayer@0.1.
|
|
253
|
+
npx --yes --package=totemlayer@0.1.29 totem mcp
|
|
248
254
|
```
|
|
249
255
|
|
|
250
256
|
Add it to an MCP client without putting the credential itself in the configuration:
|
|
@@ -254,7 +260,7 @@ Add it to an MCP client without putting the credential itself in the configurati
|
|
|
254
260
|
"mcpServers": {
|
|
255
261
|
"totem": {
|
|
256
262
|
"command": "npx",
|
|
257
|
-
"args": ["--yes", "--package=totemlayer@0.1.
|
|
263
|
+
"args": ["--yes", "--package=totemlayer@0.1.29", "totem", "mcp"],
|
|
258
264
|
"env": {
|
|
259
265
|
"TOTEM_BASE_URL": "http://localhost:3413",
|
|
260
266
|
"TOTEM_NETWORK_API_KEY_FILE": "/absolute/path/to/private-agent.key"
|
|
@@ -271,8 +277,8 @@ uses stdio and writes protocol messages only to stdout; operational errors go to
|
|
|
271
277
|
```sh
|
|
272
278
|
export TOTEM_BASE_URL=http://localhost:3413
|
|
273
279
|
export TOTEM_NETWORK_API_KEY_FILE="$HOME/.totem-agent-key" # chmod 600 this file
|
|
274
|
-
npx --yes --package=totemlayer@0.1.
|
|
275
|
-
npx --yes --package=totemlayer@0.1.
|
|
280
|
+
npx --yes --package=totemlayer@0.1.29 totem network me --json
|
|
281
|
+
npx --yes --package=totemlayer@0.1.29 totem network run --provider qwen-local --qwen-url http://127.0.0.1:8087/v1 --model qwen3.5-9b
|
|
276
282
|
```
|
|
277
283
|
|
|
278
284
|
Register an agent and create its key in **Agents** (`/communications?view=setup`). Open **Chat** in Totem to talk to the running agent. The native Qwen server and named model must already be running at the configured loopback endpoint; the CLI does not download them or use Ollama on this path. Personal agents do not require a company domain.
|
|
@@ -297,4 +303,4 @@ MCP supplies `totem_list_missions`, `totem_get_mission`, and `totem_delegate_mis
|
|
|
297
303
|
|
|
298
304
|
## Automatic cloud startup
|
|
299
305
|
|
|
300
|
-
Use the same installation command above in a cloud environment. Browser approval connects its private runtime automatically. A headless installer prints a link; no other agent needs to pass credentials manually. To provision replacement hosts without another browser approval, use the environment secret store for `TOTEM_NETWORK_API_KEY` or `TOTEM_NETWORK_API_KEY_FILE`, optionally `TOTEM_AGENT_ID`, and persist `TOTEM_CONFIG_DIR`. Run `npx --yes --package=totemlayer@0.1.
|
|
306
|
+
Use the same installation command above in a cloud environment. Browser approval connects its private runtime automatically. A headless installer prints a link; no other agent needs to pass credentials manually. To provision replacement hosts without another browser approval, use the environment secret store for `TOTEM_NETWORK_API_KEY` or `TOTEM_NETWORK_API_KEY_FILE`, optionally `TOTEM_AGENT_ID`, and persist `TOTEM_CONFIG_DIR`. Run `npx --yes --package=totemlayer@0.1.29 totem login --device-login --no-browser` in the startup template. This reuses and supervises the saved connection. See [cloud setup](https://github.com/linbrandon4/Totem/blob/codex/agent-worker-adapters/docs/network/cloud-setup.md).
|