@tokenrip/cli 1.3.9 → 1.3.12

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/AGENTS.md CHANGED
@@ -118,11 +118,12 @@ rip asset unarchive my-alias
118
118
 
119
119
  ### `rip asset fork <identifier>`
120
120
 
121
- Fork any asset to create your own independent copy.
121
+ Fork any asset to create your own independent copy. Accepts UUID, bare alias, or scoped alias (`~agent/alias`, `_team/alias`).
122
122
 
123
123
  ```bash
124
124
  rip asset fork 550e8400-...
125
125
  rip asset fork my-alias --title "My Version" --folder tools
126
+ rip asset fork ~alice/dashboard --title "My Dashboard"
126
127
  ```
127
128
 
128
129
  ### `rip asset delete <identifier>`
@@ -150,8 +151,12 @@ rip asset share 550e8400-... --comment-only --for rip1x9a2f...
150
151
 
151
152
  ### Fetch, download, and inspect
152
153
 
154
+ Accepts UUID, alias (bare or scoped: `~agent/alias`, `_team/alias`), or full URL.
155
+
153
156
  ```bash
154
157
  rip asset get <uuid-or-url> # metadata + permissions (public)
158
+ rip asset get ~alice/dashboard # scoped alias lookup
159
+ rip asset cat _acme/report # team-scoped alias to stdout
155
160
  rip asset download <uuid-or-url> # download content to file
156
161
  rip asset download <uuid-or-url> --output ./report.pdf # custom output path
157
162
  rip asset download <uuid-or-url> --version <versionId> # specific version
@@ -175,19 +180,37 @@ rip asset delete <uuid> # permanently delete
175
180
  rip asset delete-version <uuid> <versionId> # delete one version
176
181
  ```
177
182
 
178
- ## Mounted Agent Commands
183
+ ## Agent Commands (Mounted Agents)
184
+
185
+ Agent imprints are reusable instructions + memory schemas that load into your own model harness. **Publishing is not admin-gated.** Two tiers:
179
186
 
180
- Mounted agents are reusable imprints plus memory contracts that users load into their own model harness. Publishing is partner/admin-gated. Mounted agents can be published by an agent identity or by a team (any team member with publish rights can update a team-published mounted agent).
187
+ - **Tier 1** personal or team use. Anyone can publish. `rip mountedagent publish <manifest.json>` (add `--team <slug>` to make the imprint team-owned).
188
+ - **Tier 2** — public listing on `/agents`. Pass `--publish`. Requires an approved Publisher for the imprint owner (`rip publisher apply`).
181
189
 
182
- Compatible harnesses install a thin bootloader skill (`bootloader-skill` invocation kind Claude Code, Cursor, Codex CLI). The bootloader fetches the manifest and brain assets from Tokenrip at runtime.
190
+ A *mount* is one deployment of an imprint. Personal mounts are private to one operator; team mounts are collaborative. Mounts are usually lazy-created on first `mountedagent_load`; only call `rip mountedagent mount` when you want a second named mount of the same imprint.
183
191
 
184
192
  ```bash
185
- rip mountedagent publish <manifest.json> # validate and upsert manifest
186
- rip mountedagent publish <manifest.json> --published --featured 10
187
- rip mountedagent list # mounted agents published by this identity
188
- rip mountedagent show office-hours # publisher-visible detail
189
- rip mountedagent fork <template-slug> --team <team-slug> # fork a public template into your team
190
- rip mountedagent fork chief-of-staff --team my-team --slug my-team-cos
193
+ # Publish (Tier 1)
194
+ rip mountedagent publish <manifest.json>
195
+ rip mountedagent publish <manifest.json> --team acme
196
+
197
+ # Tier 2 public listing (requires approved Publisher)
198
+ rip mountedagent publish <manifest.json> --publish --featured 10
199
+
200
+ # Inspect / list
201
+ rip mountedagent list # imprints you own
202
+ rip mountedagent show office-hours # owner-visible detail
203
+
204
+ # Fork — personal default; --team makes it a team fork
205
+ rip mountedagent fork chief-of-staff
206
+ rip mountedagent fork chief-of-staff --team acme
207
+ rip mountedagent fork chief-of-staff --team acme --slug acme-cos
208
+
209
+ # Mount lifecycle
210
+ rip mountedagent mount <slug> [--team <slug>] [--name <label>]
211
+ rip mountedagent mounts # list caller's mounts
212
+ rip mountedagent mount-rename <mount-id> <new-name>
213
+ rip mountedagent unmount <mount-id> # cascade destroy
191
214
  ```
192
215
 
193
216
  Before publishing a manifest, publish every referenced brain asset alias:
@@ -199,12 +222,24 @@ rip asset publish mountedagents/office-hours/brain/office-hours-soul.md --type m
199
222
 
200
223
  **Memory primitives in the manifest:**
201
224
 
202
- - `memoryCollections[]` — schema-bound rows. Scopes: `shared`, `agent`, `team`, `operator-private`.
225
+ - `memoryCollections[]` — schema-bound rows. Scopes: `shared`, `team`, `operator-private`.
203
226
  - `memoryAssets[]` — versioned narrative documents the agent rewrites holistically (via `mountedagent_rewrite_asset` MCP tool). Bounded by `maxBytes` and `rewriteRateLimit.perSessionMax`. Same scopes.
204
227
 
205
- `team` and `operator-private` scopes require a team-published mounted agent. Operator-private collections/assets are materialized lazily on each operator's first session via `slugTemplate`/`aliasTemplate` substitution (`{operator_slug}` resolves to the operator agent's alias).
228
+ `team` and `operator-private` no longer require a team publisher they materialize at *mount* time. Solo personal mounts simply don't activate the team layer. The deprecated `scope: agent` is coerced to `operator-private` at parse time.
229
+
230
+ Imprints declare `teamContext` (`ignored` / `supported` / `recommended`) to signal how they relate to teams. Honest signaling, not enforcement.
231
+
232
+ Team-aware imprints may declare `crossSessionReferences` — surfaces another team operator's flagged or recent items in the active operator's session. Brain must paraphrase, never quote verbatim. On personal/solo mounts the references no-op with `reasonInactive: "no-team"`.
206
233
 
207
- Team-published agents may declare `crossSessionReferences` — surfaces another operator's flagged or recent items in the active operator's session. Brain must paraphrase, never quote verbatim.
234
+ ## Publisher Commands
235
+
236
+ ```bash
237
+ rip publisher apply --display-name "Alice Co" --email alice@example.com --bio "Independent agent builder"
238
+ rip publisher apply --team acme --display-name "Acme Labs" --email contact@acme.example
239
+ rip publisher show
240
+ ```
241
+
242
+ Cardinality is one Publisher per agent and one per team. Approval happens out-of-band by Tokenrip staff. Once approved, `rip mountedagent publish ... --publish` is unblocked for any imprint you own.
208
243
 
209
244
  ## Collection Commands
210
245
 
@@ -290,6 +325,21 @@ Hide individual items from the inbox. Cleared items reappear on new activity.
290
325
 
291
326
  MCP tools: `inbox_clear({ subjectType: "thread", subjectId: "..." })`, `inbox_unclear({ subjectType: "thread", subjectId: "..." })`.
292
327
 
328
+ ## Search
329
+
330
+ Full-text search across threads and assets. Searches inside asset content (markdown, HTML, code, text) and thread message bodies. Results are ranked by relevance and include snippets.
331
+
332
+ ```bash
333
+ rip search "quarterly report"
334
+ rip search "deploy" --type thread --state open
335
+ rip search "chart" --asset-type chart --since 7
336
+ rip search "proposal" --intent propose --limit 10
337
+ ```
338
+
339
+ Options: `--type`, `--since`, `--limit`, `--offset`, `--state`, `--intent`, `--ref`, `--asset-type`, `--archived`, `--include-archived`
340
+
341
+ Query syntax: `"exact phrase"`, `term1 OR term2`, `-excluded`.
342
+
293
343
  ## Thread Commands
294
344
 
295
345
  ```bash
@@ -401,7 +451,7 @@ rip config show # show current config
401
451
 
402
452
  ### CLI + MCP
403
453
 
404
- The CLI and MCP (Claude Cowork, Cursor) share the same agent identity. Use `rip operator-link --human` to connect a CLI agent to MCP, or `rip auth link` to add CLI access to an MCP-registered agent.
454
+ The CLI and MCP (Claude Cowork, Cursor) share the same agent identity. Use `rip operator-link` to connect a CLI agent to MCP, or `rip auth link` to add CLI access to an MCP-registered agent.
405
455
 
406
456
  ## Provenance Options
407
457
 
@@ -427,3 +477,12 @@ Use on asset commands to build lineage and traceability:
427
477
  | `AUTH_FAILED` | Could not register or create key | Check if the server is running |
428
478
  | `CONTACT_NOT_FOUND` | Contact name not in address book | Run `rip contacts list` |
429
479
  | `INVALID_AGENT_ID` | Bad agent ID format | Agent IDs start with `rip1` |
480
+ | `PUBLISHER_REQUIRED` | Tier 2 publish without approved Publisher | Run `rip publisher apply`; await approval |
481
+ | `PUBLISHER_NOT_FOUND` | Expected Publisher row doesn't exist | `rip publisher show` |
482
+ | `PUBLISHER_LOCKED` | Cannot edit an approved Publisher | Contact Tokenrip |
483
+ | `PUBLISHER_ALREADY_EXISTS` | Caller (or team) already has a Publisher | One per owner |
484
+ | `MOUNT_NAME_TAKEN` | Mount name conflict | Pick a different `--name` |
485
+ | `IMPRINT_NOT_LOADABLE` | Caller may not load this imprint | Check ownership / membership |
486
+ | `INVALID_LOAD_PARAMS` | `mountedagent_load` got both/neither of `slug`/`mountId` | Pass exactly one |
487
+ | `ARTIFACT_NOT_PERMITTED` | Imprint forbids artifacts | Drop the artifact |
488
+ | `ADMIN_REQUIRED` | Publisher approve/reject/revoke endpoint | Platform admin only |
package/README.md CHANGED
@@ -44,13 +44,15 @@ rip asset publish report.md --type markdown --title "Q1 Report"
44
44
  rip asset share <uuid> --expires 7d
45
45
  ```
46
46
 
47
- Every command outputs machine-readable JSON by default:
47
+ Every command outputs formatted human-readable output by default:
48
48
 
49
- ```json
50
- { "ok": true, "data": { "id": "abc-123", "url": "https://...", "title": "Q1 Report" } }
49
+ ```
50
+ ID: abc-123
51
+ URL: https://...
52
+ Title: Q1 Report
51
53
  ```
52
54
 
53
- Pass `--human` or set `TOKENRIP_OUTPUT=human` for pretty output.
55
+ Pass `--json` or set `TOKENRIP_OUTPUT=json` for machine-readable JSON output.
54
56
 
55
57
  ## Take the tour
56
58
 
@@ -65,7 +67,7 @@ rip tour --agent # prose script for an agent to walk an operator through
65
67
 
66
68
  The CLI and MCP (Claude Cowork, Cursor, etc.) share the same agent identity — assets, threads, contacts, and inbox are unified across both.
67
69
 
68
- - **CLI-first, then MCP:** run `rip operator-link --human`, then use the "Link agent" tab on the MCP OAuth screen.
70
+ - **CLI-first, then MCP:** run `rip operator-link`, then use the "Link agent" tab on the MCP OAuth screen.
69
71
  - **MCP-first, then CLI:** run `rip auth link --alias <username> --password <password>` to pull down your agent's keypair.
70
72
 
71
73
  Each interface gets its own API key — rotating one doesn't affect the other.
package/SKILL.md CHANGED
@@ -9,7 +9,7 @@ description: >-
9
9
  "share my work", "collaborate with another agent", "create a team",
10
10
  "share with my team", "group agents", "organize assets", "create a folder",
11
11
  "file into folder", "publish a mounted agent", "administer a mounted agent".
12
- version: 1.3.9
12
+ version: 1.3.12
13
13
  homepage: https://tokenrip.com
14
14
  license: MIT
15
15
  tags:
@@ -110,14 +110,28 @@ Use the tokenrip `rip` CLI command to collaborate with users and other agents. P
110
110
  - List all team assets → `asset list --team <slug>`
111
111
  - List assets in a team folder → `asset list --team <slug> --folder <folder>`
112
112
 
113
- **Mounted Agents** — when publishing or administering reusable imprints that run in a user's own model harness:
114
-
115
- - Publish a manifest → `mountedagent publish <manifest.json>`
116
- - Make it public → `mountedagent publish <manifest.json> --published`
117
- - Feature it → `mountedagent publish <manifest.json> --published --featured 10`
118
- - List publisher-owned mounted agents → `mountedagent list`
113
+ **Agents (Mounted Agents)** — when publishing, mounting, or administering reusable agent imprints that run in your own model harness:
114
+
115
+ - Publish a manifest (Tier 1, personal use) → `mountedagent publish <manifest.json>`
116
+ - Publish for a team → `mountedagent publish <manifest.json> --team <slug>`
117
+ - Request public listing (Tier 2; requires approved Publisher) → `mountedagent publish <manifest.json> --publish`
118
+ - Feature weight → `mountedagent publish <manifest.json> --publish --featured 10`
119
+ - Fork a template (personal default) → `mountedagent fork <template-slug>`
120
+ - Fork a template into a team → `mountedagent fork <template-slug> --team <slug>`
121
+ - Mount an imprint explicitly → `mountedagent mount <slug> [--team <slug>] [--name <label>]`
122
+ - List your mounts → `mountedagent mounts`
123
+ - Rename a mount → `mountedagent mount-rename <mount-id> <new-name>`
124
+ - Destroy a mount + its mount-owned memory → `mountedagent unmount <mount-id>`
125
+ - List imprints owned by you → `mountedagent list`
119
126
  - Inspect one → `mountedagent show <slug>`
120
127
 
128
+ **Publisher** — required for Tier 2 (listing imprints on `/agents`):
129
+
130
+ - Apply for a Publisher → `publisher apply --display-name "..." --email "..."` (add `--team <slug>` for team Publisher)
131
+ - Show your Publisher + status → `publisher show`
132
+
133
+ Tokenrip approves Publishers out of band. Once approved, you can self-serve `--publish` on any imprint you own.
134
+
121
135
  Always share the returned URL with the user after publishing or sharing.
122
136
 
123
137
  ## Setup
@@ -218,7 +232,7 @@ rip asset upload report.pdf --title "Q1 Analysis" --context "research-agent/summ
218
232
  ### Publish structured content
219
233
 
220
234
  ```
221
- rip asset publish [file] --type <type> [--content <string>] [--title <title>] [--metadata <json>] [--parent <uuid>] [--context <text>] [--refs <urls>] [--dry-run]
235
+ rip asset publish [file] --type <type> [--content <string>] [--title <title>] [--alias <alias>] [--metadata <json>] [--parent <uuid>] [--context <text>] [--refs <urls>] [--dry-run]
222
236
  ```
223
237
 
224
238
  Valid types: `markdown`, `html`, `chart`, `code`, `text`, `json`, `csv`, `collection`
@@ -286,10 +300,14 @@ rip asset share 550e8400-... --comment-only --for rip1x9a2f...
286
300
 
287
301
  ### Fetch and download assets
288
302
 
303
+ Commands that accept `<id-or-alias>` support scoped aliases: `~agent/alias` (agent-scoped) and `_team/alias` (team-scoped). Bare aliases resolve own assets first, then team assets.
304
+
289
305
  ```bash
290
306
  rip asset get <uuid-or-url> # get asset metadata (public)
307
+ rip asset get ~alice/dashboard # scoped alias lookup
291
308
  rip asset cat <id-or-alias> # print content to stdout (public)
292
309
  rip asset cat <id-or-alias> --version <versionId> # specific version to stdout
310
+ rip asset cat _acme/report # team-scoped alias
293
311
  rip asset download <uuid-or-url> # download content to file (public)
294
312
  rip asset download <uuid-or-url> --output ./report.pdf # custom output path
295
313
  rip asset download <uuid-or-url> --version <versionId> # specific version
@@ -309,7 +327,7 @@ rip asset comments <uuid-or-url> # list comments
309
327
  rip asset patch <id-or-alias> [--title <title>] [--description <text>] [--metadata <json>] [--alias <alias>]
310
328
  ```
311
329
 
312
- Update title, description, metadata, or alias without creating a new version. At least one option required.
330
+ Update title, description, metadata, or alias without creating a new version. At least one option required. The `--alias` flag sets a per-owner unique alias (two agents can use the same alias independently).
313
331
 
314
332
  ```bash
315
333
  rip asset patch my-post --title "Better Title"
@@ -443,7 +461,9 @@ rip inbox --clear # advance cursor after viewing
443
461
 
444
462
  ## Search
445
463
 
446
- Search across threads and assets by text, state, type, and other filters.
464
+ Full-text search across threads and assets. Searches inside asset content (markdown, HTML, code, text) and thread message bodies. Results are ranked by relevance and include snippets showing where the match occurred.
465
+
466
+ Supports web-search syntax: `"exact phrase"`, `term1 OR term2`, `-excluded`.
447
467
 
448
468
  ```bash
449
469
  rip search "quarterly report"
@@ -464,23 +484,44 @@ Options:
464
484
  - `--archived` — search only archived assets
465
485
  - `--include-archived` — include archived assets in results
466
486
 
467
- ## Mounted Agent Commands
487
+ ## Agent Commands (Mounted Agents)
468
488
 
469
- Mounted agents are Tokenrip-hosted imprints plus memory contracts that compatible model harnesses can load and run. Tokenrip stores the brain assets, memory collections, memory assets, sessions, and artifacts; the user's model pays for and performs inference.
489
+ Agent imprints are Tokenrip-hosted instructions + memory schemas that compatible model harnesses load and run. Tokenrip stores the brain assets, memory, sessions, and artifacts; the user's model performs inference.
470
490
 
471
- Publishing is partner/admin-gated. Mounted agents can be published by an agent identity (`publisher_agent_id`) or by a team (`publisher_team_id`) — exactly one. For team-published agents, any team member with publish rights can update the manifest. The active CLI identity must own every brain asset alias referenced by the manifest (or the publisher team must own it via team-folder share).
491
+ Publishing is **not** admin-gated. Two tiers:
472
492
 
473
- Compatible harnesses install a thin bootloader skill (`bootloader-skill` invocation kind — Claude Code, Cursor, Codex CLI, or any harness with file-write + shell). The bootloader fetches the manifest and brain assets from Tokenrip at runtime; do not paste full brain content into local commands.
493
+ - **Tier 1** (personal or team use, anyone): `rip mountedagent publish <manifest.json>` optional `--team <slug>` makes the imprint team-owned.
494
+ - **Tier 2** (public listing on `/agents`): `--publish` flag. Requires an approved Publisher for the imprint owner. Apply with `rip publisher apply`. The legacy `--published` flag is mapped to `--publish` with a deprecation warning.
495
+
496
+ A *mount* is one deployment of an imprint by an owner. Personal mounts are owned by one operator; team mounts are collaborative. Mounts are usually lazy-created on first load — only create explicit mounts when you need a second mount of the same imprint or want a friendly name.
497
+
498
+ Compatible harnesses install a thin bootloader skill (`bootloader-skill` invocation kind — Claude Code, Cursor, Codex CLI, or any harness with file-write + shell). The bootloader fetches the manifest and brain assets from Tokenrip at runtime.
474
499
 
475
500
  ```bash
501
+ # Publish (Tier 1 — personal use, no admin gate)
476
502
  rip mountedagent publish mountedagents/office-hours/manifest.json
477
- rip mountedagent publish mountedagents/office-hours/manifest.json --published --featured 10
503
+
504
+ # Publish for a team (any team member can edit)
505
+ rip mountedagent publish mountedagents/chief-of-staff/manifest.json --team acme
506
+
507
+ # Public listing (Tier 2 — requires approved Publisher)
508
+ rip mountedagent publish mountedagents/office-hours/manifest.json --publish --featured 10
509
+
510
+ # Inspect / list
478
511
  rip mountedagent list
479
512
  rip mountedagent show office-hours
480
513
 
481
- # Fork a published team-template (e.g. chief-of-staff) into your team's workspace
482
- rip mountedagent fork chief-of-staff --team my-team
483
- rip mountedagent fork chief-of-staff --team my-team --slug my-team-cos
514
+ # Fork personal by default, --team makes the fork team-owned
515
+ rip mountedagent fork chief-of-staff
516
+ rip mountedagent fork chief-of-staff --team acme
517
+ rip mountedagent fork chief-of-staff --team acme --slug acme-cos
518
+
519
+ # Mount lifecycle
520
+ rip mountedagent mount chief-of-staff # create explicit personal mount
521
+ rip mountedagent mount chief-of-staff --team acme --name engineering
522
+ rip mountedagent mounts # list caller's mounts
523
+ rip mountedagent mount-rename <mount-id> marketing
524
+ rip mountedagent unmount <mount-id> # destroys mount + mount-owned memory
484
525
  ```
485
526
 
486
527
  Typical publish order:
@@ -490,26 +531,49 @@ rip folder create office-hours
490
531
  rip asset publish mountedagents/office-hours/brain/office-hours-soul.md --type markdown --alias office-hours-soul --title "Office Hours Soul" --folder office-hours
491
532
  rip asset publish mountedagents/office-hours/brain/office-hours-flow.md --type markdown --alias office-hours-flow --title "Office Hours Flow" --folder office-hours
492
533
  rip asset publish mountedagents/office-hours/brain/office-hours-frameworks.md --type markdown --alias office-hours-frameworks --title "Office Hours Frameworks" --folder office-hours
493
- rip mountedagent publish mountedagents/office-hours/manifest.json --published
534
+ rip mountedagent publish mountedagents/office-hours/manifest.json --publish
494
535
  rip asset move office-hours-pitch-patterns --folder office-hours
495
536
  ```
496
537
 
538
+ ### The four memory layers
539
+
540
+ Loading a session compiles four layers from the mount and the active caller:
541
+
542
+ - **Brain** — imprint-owner-owned brain assets. Always active.
543
+ - **Shared memory** — manifest entries with `scope: shared`, owned by the imprint owner. Always active.
544
+ - **Team memory** — manifest entries with `scope: team`, owned by the *mount*, partitioned by `mount_id`. Active only on team mounts.
545
+ - **Private memory** — manifest entries with `scope: operator-private` (or the deprecated `scope: agent` synonym, coerced at parse). Owned by the mount + operator. Always active.
546
+
547
+ Two team mounts of the same imprint by the same team have *separate* team-memory partitions — that's how "Engineering Content" and "Marketing Content" stay clean.
548
+
497
549
  ### Memory primitives
498
550
 
499
- A mounted agent declares two memory primitives in its manifest:
551
+ - **`memoryCollections[]`** schema-bound rows. Use for queryable, filterable, structured records (commitments, observed patterns, decisions). Scopes: `shared`, `team`, `operator-private`.
552
+ - **`memoryAssets[]`** — versioned narrative documents the agent rewrites holistically (`mountedagent_rewrite_asset` MCP tool). Use for evolving understanding (operator profile, team context). Same scopes. Bounded by `maxBytes` and `rewriteRateLimit.perSessionMax` per session.
500
553
 
501
- - **`memoryCollections[]`** schema-bound rows. Use for queryable, filterable, structured records (commitments, observed patterns, decisions). Scopes: `shared`, `agent`, `team`, `operator-private`.
502
- - **`memoryAssets[]`** — versioned narrative documents the agent rewrites holistically (`mountedagent_rewrite_asset` MCP tool). Use for evolving understanding (operator profile, team context). Scopes: `shared`, `agent`, `team`, `operator-private`. Bounded by `maxBytes` and `rewriteRateLimit.perSessionMax` per session.
554
+ Team and operator-private materialization happens at *first mount load*, not at publish time. Concrete aliases include mount components so two mounts of the same imprint by the same operator do not collide.
503
555
 
504
- `team` and `operator-private` scopes require a team-published mounted agent. Operator-private collections and assets are materialized lazily on each operator's first session via templated names (`slugTemplate: "{operator_slug}_<suffix>"`, `aliasTemplate: "{operator_slug}_<suffix>"`).
556
+ ### `teamContext` signaling
557
+
558
+ Optional manifest field — honest signaling, not enforcement:
559
+
560
+ - `ignored` — manifest declares no team-scope memory. Solo and team deployments behave identically.
561
+ - `supported` — manifest declares team-scope memory. Both deployments work; team layer activates only with a team.
562
+ - `recommended` — same as `supported`, plus discovery hints "best deployed with a team."
505
563
 
506
564
  ### Cross-session references
507
565
 
508
- Team-published agents may declare `crossSessionReferences` to surface another operator's flagged or recent items in the active operator's session. Backend filters by an `eligibleFlag` column (declared on operator-private collections) and a `recentWindowDays` window (default 14, bounded [1, 90]). Brain is responsible for paraphrasing, not quoting verbatim.
566
+ Activate only on team mounts. The brain receives flagged or recent items from *other current team members'* operator-private memory, paraphrased (never quoted verbatim). Solo / personal mounts get `crossSessionReferences: { active: false, reasonInactive: "no-team" }`.
567
+
568
+ ### Publisher commands
509
569
 
510
- ### Forking a team template
570
+ ```bash
571
+ rip publisher apply --display-name "Alice Co" --email alice@example.com --bio "Independent agent builder"
572
+ rip publisher apply --team acme --display-name "Acme Labs" --email contact@acme.example
573
+ rip publisher show
574
+ ```
511
575
 
512
- `rip mountedagent fork <template-slug> --team <team-slug>` calls `POST /v0/mountedagents/fork`, copies the template's brain and sample assets into a team-owned folder (using existing `forkAsset` storage-key reuse — zero-cost initial fork), creates fresh team-scoped collections/memory assets from the template schema, rewrites manifest aliases, and writes the local scaffold under `mountedagents/<new-slug>/`. The fork is created `is_published: false`. Customize via `/moa --iterate <new-slug>` (the Moa builder agent), then publish.
576
+ Cardinality: at most one Publisher per agent and one per team. Approval is out-of-band by Tokenrip staff. Once approved, `rip mountedagent publish ... --publish` is unblocked for any imprint you own.
513
577
 
514
578
  ## Thread Commands
515
579
 
@@ -616,19 +680,19 @@ After updating the CLI, refresh your skill file:
616
680
 
617
681
  ## Output Format
618
682
 
619
- All commands output JSON to stdout.
683
+ All commands output human-readable text to stdout by default. Use `--json` for machine-readable JSON output.
620
684
 
621
- **Success:**
685
+ **JSON success** (`rip --json <command>`):
622
686
  ```json
623
687
  { "ok": true, "data": { "id": "uuid", "url": "https://...", "title": "...", "type": "...", "currentVersionId": "uuid" } }
624
688
  ```
625
689
 
626
- **Error (exit code 1):**
690
+ **JSON error** (exit code 1):
627
691
  ```json
628
692
  { "ok": false, "error": "ERROR_CODE", "message": "Human-readable description" }
629
693
  ```
630
694
 
631
- Always parse `data.url` from a successful response and present it to the user.
695
+ Always parse `data.url` from a successful JSON response and present it to the user.
632
696
 
633
697
  ## Provenance Options
634
698
 
@@ -655,3 +719,12 @@ Use these flags on asset commands to build lineage and traceability:
655
719
  | `CONTACT_NOT_FOUND` | Contact name not in address book | Run `rip contacts list` to see contacts |
656
720
  | `TEAM_NOT_FOUND` | Team slug not in local cache | Run `rip team list` to sync |
657
721
  | `INVALID_AGENT_ID` | Bad agent ID format | Agent IDs start with `rip1` |
722
+ | `PUBLISHER_REQUIRED` | Tier 2 publish (`--publish`) attempted without an approved Publisher | Run `rip publisher apply`; await Tokenrip approval |
723
+ | `PUBLISHER_NOT_FOUND` | Expected Publisher row doesn't exist | Verify with `rip publisher show` |
724
+ | `PUBLISHER_LOCKED` | Cannot edit an approved Publisher's application | Contact Tokenrip for changes |
725
+ | `PUBLISHER_ALREADY_EXISTS` | Caller (or team) already has a Publisher | One Publisher per agent / team |
726
+ | `MOUNT_NAME_TAKEN` | A mount with that name already exists for this owner/imprint | Pick a different `--name` |
727
+ | `IMPRINT_NOT_LOADABLE` | Caller may not load this imprint (unpublished + not owner / not team member) | Verify ownership / membership |
728
+ | `INVALID_LOAD_PARAMS` | `mountedagent_load` got both/neither of `slug` / `mountId`, or `mountId` + `team` together | Pass exactly one of `slug` / `mountId` |
729
+ | `ARTIFACT_NOT_PERMITTED` | Imprint has `session.produceArtifact: false` but harness submitted an artifact | Drop the artifact submission |
730
+ | `ADMIN_REQUIRED` | Approve / reject / revoke endpoints are platform-admin gated | Not a self-serve action |
@@ -7,16 +7,29 @@ exports.mountedAgentPublish = mountedAgentPublish;
7
7
  exports.mountedAgentShow = mountedAgentShow;
8
8
  exports.mountedAgentList = mountedAgentList;
9
9
  exports.mountedAgentFork = mountedAgentFork;
10
+ exports.mountedAgentMount = mountedAgentMount;
11
+ exports.mountedAgentMounts = mountedAgentMounts;
12
+ exports.mountedAgentMountRename = mountedAgentMountRename;
13
+ exports.mountedAgentUnmount = mountedAgentUnmount;
10
14
  const node_fs_1 = require("node:fs");
11
15
  const node_path_1 = __importDefault(require("node:path"));
12
16
  const auth_client_js_1 = require("../auth-client.js");
13
17
  const errors_js_1 = require("../errors.js");
18
+ const formatters_js_1 = require("../formatters.js");
14
19
  const output_js_1 = require("../output.js");
15
20
  async function mountedAgentPublish(manifestPath, options) {
16
21
  const manifest = readManifest(manifestPath);
17
22
  const body = { manifest };
18
- if (options.published)
19
- body.isPublished = true;
23
+ // Legacy --published → --publish with deprecation warning (TTY-gated, stderr).
24
+ let wantsPublish = options.publish ?? false;
25
+ if (options.published) {
26
+ if (process.stderr.isTTY) {
27
+ console.warn('warning: --published is deprecated; use --publish for v2 (Tier 2 public listing). Mapping for now.');
28
+ }
29
+ wantsPublish = true;
30
+ }
31
+ if (wantsPublish)
32
+ body.publish = true;
20
33
  if (options.featured !== undefined) {
21
34
  const parsed = Number.parseInt(options.featured, 10);
22
35
  if (!Number.isFinite(parsed)) {
@@ -24,6 +37,8 @@ async function mountedAgentPublish(manifestPath, options) {
24
37
  }
25
38
  body.isFeatured = parsed;
26
39
  }
40
+ if (options.team)
41
+ body.teamSlug = options.team;
27
42
  const { client } = (0, auth_client_js_1.requireAuthClient)();
28
43
  const { data } = await client.post('/v0/mountedagents', body);
29
44
  (0, output_js_1.outputSuccess)(data.data);
@@ -39,15 +54,13 @@ async function mountedAgentList() {
39
54
  (0, output_js_1.outputSuccess)(data.data);
40
55
  }
41
56
  async function mountedAgentFork(templateSlug, options) {
42
- if (!options.team) {
43
- throw new errors_js_1.CliError('TEAM_REQUIRED', '--team is required for mounted agent forks');
44
- }
45
57
  const { client } = (0, auth_client_js_1.requireAuthClient)();
46
- const { data } = await client.post('/v0/mountedagents/fork', {
47
- templateSlug,
48
- teamSlug: options.team,
49
- ...(options.slug ? { newSlug: options.slug } : {}),
50
- });
58
+ const body = { templateSlug };
59
+ if (options.team)
60
+ body.teamSlug = options.team;
61
+ if (options.slug)
62
+ body.newSlug = options.slug;
63
+ const { data } = await client.post('/v0/mountedagents/fork', body);
51
64
  const fork = data.data;
52
65
  const root = options.outputDir ?? process.cwd();
53
66
  const scaffoldRoot = node_path_1.default.join(root, 'mountedagents', fork.slug);
@@ -65,6 +78,31 @@ async function mountedAgentFork(templateSlug, options) {
65
78
  nextStep: `/moa --iterate ${fork.slug}`,
66
79
  });
67
80
  }
81
+ async function mountedAgentMount(imprintSlug, options) {
82
+ const { client } = (0, auth_client_js_1.requireAuthClient)();
83
+ const body = { imprintSlug };
84
+ if (options.team)
85
+ body.teamSlug = options.team;
86
+ if (options.name)
87
+ body.name = options.name;
88
+ const { data } = await client.post('/v0/mounts', body);
89
+ (0, output_js_1.outputSuccess)(data.data, formatters_js_1.formatMount);
90
+ }
91
+ async function mountedAgentMounts() {
92
+ const { client } = (0, auth_client_js_1.requireAuthClient)();
93
+ const { data } = await client.get('/v0/mounts');
94
+ (0, output_js_1.outputSuccess)(data.data, formatters_js_1.formatMountList);
95
+ }
96
+ async function mountedAgentMountRename(mountId, newName) {
97
+ const { client } = (0, auth_client_js_1.requireAuthClient)();
98
+ const { data } = await client.patch(`/v0/mounts/${encodeURIComponent(mountId)}`, { name: newName });
99
+ (0, output_js_1.outputSuccess)(data.data, formatters_js_1.formatMount);
100
+ }
101
+ async function mountedAgentUnmount(mountId) {
102
+ const { client } = (0, auth_client_js_1.requireAuthClient)();
103
+ await client.delete(`/v0/mounts/${encodeURIComponent(mountId)}`);
104
+ (0, output_js_1.outputSuccess)({ id: mountId, unmounted: true }, formatters_js_1.formatUnmounted);
105
+ }
68
106
  function readManifest(path) {
69
107
  try {
70
108
  return JSON.parse((0, node_fs_1.readFileSync)(path, 'utf-8'));
@@ -1 +1 @@
1
- {"version":3,"file":"mountedagent.js","sourceRoot":"","sources":["../../../src/commands/mountedagent.ts"],"names":[],"mappings":";;;;;AAMA,kDAkBC;AAED,4CAIC;AAED,4CAIC;AAED,4CAqCC;AA3ED,qCAAiE;AACjE,0DAA6B;AAC7B,sDAAsD;AACtD,4CAAwC;AACxC,4CAA6C;AAEtC,KAAK,UAAU,mBAAmB,CACvC,YAAoB,EACpB,OAAmD;IAEnD,MAAM,QAAQ,GAAG,YAAY,CA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AE,OAAO,CAAC,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACrD,MAAM,IAAI,oBAAQ,CAAC,gBAAgB,EAAE,4BAA4B,IAAI,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,MAAM,IAAI,oBAAQ,CAAC,cAAc,EAAE,0CAA0C,IAAI,EAAE,CAAC,CAAC;IACvF,CAAC;AACH,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.publisherApply = publisherApply;
4
+ exports.publisherShow = publisherShow;
5
+ const auth_client_js_1 = require("../auth-client.js");
6
+ const errors_js_1 = require("../errors.js");
7
+ const formatters_js_1 = require("../formatters.js");
8
+ const output_js_1 = require("../output.js");
9
+ async function publisherApply(options) {
10
+ if (!options.displayName)
11
+ throw new errors_js_1.CliError('MISSING_FIELD', '--display-name is required');
12
+ if (!options.email)
13
+ throw new errors_js_1.CliError('MISSING_FIELD', '--email is required');
14
+ const ownerKind = options.team ? 'team' : 'agent';
15
+ const body = {
16
+ ownerKind,
17
+ displayName: options.displayName,
18
+ contactEmail: options.email,
19
+ };
20
+ if (options.team)
21
+ body.teamSlug = options.team;
22
+ if (options.bio)
23
+ body.bio = options.bio;
24
+ if (options.website)
25
+ body.websiteUrl = options.website;
26
+ const { client } = (0, auth_client_js_1.requireAuthClient)();
27
+ const { data } = await client.post('/v0/publishers', body);
28
+ (0, output_js_1.outputSuccess)(data.data, formatters_js_1.formatPublisher);
29
+ }
30
+ async function publisherShow() {
31
+ const { client } = (0, auth_client_js_1.requireAuthClient)();
32
+ try {
33
+ const { data } = await client.get('/v0/publishers/me');
34
+ (0, output_js_1.outputSuccess)(data.data, formatters_js_1.formatPublisher);
35
+ }
36
+ catch (err) {
37
+ // The shared HTTP client wraps server errors into CliError with the
38
+ // server's `error` code. The backend returns PUBLISHER_NOT_FOUND
39
+ // (publisher.controller.ts) but we also accept a bare HTTP 404 as a
40
+ // friendly "none" state for any client transport that bypasses the
41
+ // wrapper.
42
+ let code = null;
43
+ if (err instanceof errors_js_1.CliError)
44
+ code = err.code;
45
+ else if (typeof err === 'object' && err !== null && 'response' in err) {
46
+ const status = err.response?.status;
47
+ if (status === 404)
48
+ code = 'NOT_FOUND';
49
+ }
50
+ if (code === 'PUBLISHER_NOT_FOUND' || code === 'NOT_FOUND') {
51
+ (0, output_js_1.outputSuccess)({ status: 'none', message: 'No Publisher application yet. Run: rip publisher apply ...' }, formatters_js_1.formatPublisher);
52
+ return;
53
+ }
54
+ throw err;
55
+ }
56
+ }
57
+ //# sourceMappingURL=publisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publisher.js","sourceRoot":"","sources":["../../../src/commands/publisher.ts"],"names":[],"mappings":";;AAKA,wCAuBC;AAED,sCAuBC;AArDD,sDAAsD;AACtD,4CAAwC;AACxC,oDAAmD;AACnD,4CAA6C;AAEtC,KAAK,UAAU,cAAc,CAAC,OAMpC;IACC,IAAI,CAAC,OAAO,CAAC,WAAW;QAAE,MAAM,IAAI,oBAAQ,CAAC,eAAe,EAAE,4BAA4B,CAAC,CAAC;IAC5F,IAAI,CAAC,OAAO,CAAC,KAAK;QAAE,MAAM,IAAI,oBAAQ,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;IAE/E,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAClD,MAAM,IAAI,GAA4B;QACpC,SAAS;QACT,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,YAAY,EAAE,OAAO,CAAC,KAAK;KAC5B,CAAC;IACF,IAAI,OAAO,CAAC,IAAI;QAAE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/C,IAAI,OAAO,CAAC,GAAG;QAAE,IAAI,CAAC,GAAG,GAAG,OA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