@tokenrip/cli 1.3.11 → 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 +51 -12
- package/SKILL.md +90 -23
- package/dist/cjs/commands/mountedagent.js +47 -11
- package/dist/cjs/commands/mountedagent.js.map +1 -1
- package/dist/cjs/commands/publisher.js +57 -0
- package/dist/cjs/commands/publisher.js.map +1 -0
- package/dist/cjs/formatters.js +66 -1
- package/dist/cjs/formatters.js.map +1 -1
- package/dist/cli.js +90 -11
- package/dist/cli.js.map +1 -1
- package/dist/commands/mountedagent.d.ts +8 -0
- package/dist/commands/mountedagent.js +43 -11
- package/dist/commands/mountedagent.js.map +1 -1
- package/dist/commands/publisher.d.ts +8 -0
- package/dist/commands/publisher.js +53 -0
- package/dist/commands/publisher.js.map +1 -0
- package/dist/formatters.d.ts +4 -0
- package/dist/formatters.js +61 -0
- package/dist/formatters.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -180,19 +180,37 @@ rip asset delete <uuid> # permanently delete
|
|
|
180
180
|
rip asset delete-version <uuid> <versionId> # delete one version
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
##
|
|
183
|
+
## Agent Commands (Mounted Agents)
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
Agent imprints are reusable instructions + memory schemas that load into your own model harness. **Publishing is not admin-gated.** Two tiers:
|
|
186
186
|
|
|
187
|
-
|
|
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`).
|
|
189
|
+
|
|
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.
|
|
188
191
|
|
|
189
192
|
```bash
|
|
190
|
-
|
|
191
|
-
rip mountedagent publish <manifest.json>
|
|
192
|
-
rip mountedagent
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
rip mountedagent
|
|
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
|
|
196
214
|
```
|
|
197
215
|
|
|
198
216
|
Before publishing a manifest, publish every referenced brain asset alias:
|
|
@@ -204,12 +222,24 @@ rip asset publish mountedagents/office-hours/brain/office-hours-soul.md --type m
|
|
|
204
222
|
|
|
205
223
|
**Memory primitives in the manifest:**
|
|
206
224
|
|
|
207
|
-
- `memoryCollections[]` — schema-bound rows. Scopes: `shared`, `
|
|
225
|
+
- `memoryCollections[]` — schema-bound rows. Scopes: `shared`, `team`, `operator-private`.
|
|
208
226
|
- `memoryAssets[]` — versioned narrative documents the agent rewrites holistically (via `mountedagent_rewrite_asset` MCP tool). Bounded by `maxBytes` and `rewriteRateLimit.perSessionMax`. Same scopes.
|
|
209
227
|
|
|
210
|
-
`team` and `operator-private`
|
|
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"`.
|
|
233
|
+
|
|
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
|
+
```
|
|
211
241
|
|
|
212
|
-
|
|
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.
|
|
213
243
|
|
|
214
244
|
## Collection Commands
|
|
215
245
|
|
|
@@ -447,3 +477,12 @@ Use on asset commands to build lineage and traceability:
|
|
|
447
477
|
| `AUTH_FAILED` | Could not register or create key | Check if the server is running |
|
|
448
478
|
| `CONTACT_NOT_FOUND` | Contact name not in address book | Run `rip contacts list` |
|
|
449
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/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.
|
|
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
|
|
114
|
-
|
|
115
|
-
- Publish a manifest → `mountedagent publish <manifest.json>`
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
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
|
|
@@ -470,23 +484,44 @@ Options:
|
|
|
470
484
|
- `--archived` — search only archived assets
|
|
471
485
|
- `--include-archived` — include archived assets in results
|
|
472
486
|
|
|
473
|
-
##
|
|
487
|
+
## Agent Commands (Mounted Agents)
|
|
488
|
+
|
|
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.
|
|
474
490
|
|
|
475
|
-
|
|
491
|
+
Publishing is **not** admin-gated. Two tiers:
|
|
476
492
|
|
|
477
|
-
|
|
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.
|
|
478
495
|
|
|
479
|
-
|
|
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.
|
|
480
499
|
|
|
481
500
|
```bash
|
|
501
|
+
# Publish (Tier 1 — personal use, no admin gate)
|
|
482
502
|
rip mountedagent publish mountedagents/office-hours/manifest.json
|
|
483
|
-
|
|
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
|
|
484
511
|
rip mountedagent list
|
|
485
512
|
rip mountedagent show office-hours
|
|
486
513
|
|
|
487
|
-
# Fork
|
|
488
|
-
rip mountedagent fork chief-of-staff
|
|
489
|
-
rip mountedagent fork chief-of-staff --team
|
|
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
|
|
490
525
|
```
|
|
491
526
|
|
|
492
527
|
Typical publish order:
|
|
@@ -496,26 +531,49 @@ rip folder create office-hours
|
|
|
496
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
|
|
497
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
|
|
498
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
|
|
499
|
-
rip mountedagent publish mountedagents/office-hours/manifest.json --
|
|
534
|
+
rip mountedagent publish mountedagents/office-hours/manifest.json --publish
|
|
500
535
|
rip asset move office-hours-pitch-patterns --folder office-hours
|
|
501
536
|
```
|
|
502
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
|
+
|
|
503
549
|
### Memory primitives
|
|
504
550
|
|
|
505
|
-
|
|
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.
|
|
553
|
+
|
|
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.
|
|
506
555
|
|
|
507
|
-
|
|
508
|
-
- **`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.
|
|
556
|
+
### `teamContext` signaling
|
|
509
557
|
|
|
510
|
-
|
|
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."
|
|
511
563
|
|
|
512
564
|
### Cross-session references
|
|
513
565
|
|
|
514
|
-
|
|
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
|
|
515
569
|
|
|
516
|
-
|
|
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
|
+
```
|
|
517
575
|
|
|
518
|
-
|
|
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.
|
|
519
577
|
|
|
520
578
|
## Thread Commands
|
|
521
579
|
|
|
@@ -661,3 +719,12 @@ Use these flags on asset commands to build lineage and traceability:
|
|
|
661
719
|
| `CONTACT_NOT_FOUND` | Contact name not in address book | Run `rip contacts list` to see contacts |
|
|
662
720
|
| `TEAM_NOT_FOUND` | Team slug not in local cache | Run `rip team list` to sync |
|
|
663
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
|
-
|
|
19
|
-
|
|
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)) {
|
|
@@ -25,7 +38,7 @@ async function mountedAgentPublish(manifestPath, options) {
|
|
|
25
38
|
body.isFeatured = parsed;
|
|
26
39
|
}
|
|
27
40
|
if (options.team)
|
|
28
|
-
body.
|
|
41
|
+
body.teamSlug = options.team;
|
|
29
42
|
const { client } = (0, auth_client_js_1.requireAuthClient)();
|
|
30
43
|
const { data } = await client.post('/v0/mountedagents', body);
|
|
31
44
|
(0, output_js_1.outputSuccess)(data.data);
|
|
@@ -41,15 +54,13 @@ async function mountedAgentList() {
|
|
|
41
54
|
(0, output_js_1.outputSuccess)(data.data);
|
|
42
55
|
}
|
|
43
56
|
async function mountedAgentFork(templateSlug, options) {
|
|
44
|
-
if (!options.team) {
|
|
45
|
-
throw new errors_js_1.CliError('TEAM_REQUIRED', '--team is required for mounted agent forks');
|
|
46
|
-
}
|
|
47
57
|
const { client } = (0, auth_client_js_1.requireAuthClient)();
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
teamSlug
|
|
51
|
-
|
|
52
|
-
|
|
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);
|
|
53
64
|
const fork = data.data;
|
|
54
65
|
const root = options.outputDir ?? process.cwd();
|
|
55
66
|
const scaffoldRoot = node_path_1.default.join(root, 'mountedagents', fork.slug);
|
|
@@ -67,6 +78,31 @@ async function mountedAgentFork(templateSlug, options) {
|
|
|
67
78
|
nextStep: `/moa --iterate ${fork.slug}`,
|
|
68
79
|
});
|
|
69
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
|
+
}
|
|
70
106
|
function readManifest(path) {
|
|
71
107
|
try {
|
|
72
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":";;;;;
|
|
1
|
+
{"version":3,"file":"mountedagent.js","sourceRoot":"","sources":["../../../src/commands/mountedagent.ts"],"names":[],"mappings":";;;;;AAOA,kDA6BC;AAED,4CAIC;AAED,4CAIC;AAED,4CAiCC;AAED,8CAUC;AAED,gDAIC;AAED,0DAIC;AAED,kDAIC;AAjHD,qCAAiE;AACjE,0DAA6B;AAC7B,sDAAsD;AACtD,4CAAwC;AACxC,oDAAiF;AACjF,4CAA6C;AAEtC,KAAK,UAAU,mBAAmB,CACvC,YAAoB,EACpB,OAAqF;IAErF,MAAM,QAAQ,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAC5C,MAAM,IAAI,GAA4B,EAAE,QAAQ,EAAE,CAAC;IAEnD,+EAA+E;IAC/E,IAAI,YAAY,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC;IAC5C,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,oGAAoG,CAAC,CAAC;QACrH,CAAC;QACD,YAAY,GAAG,IAAI,CAAC;IACtB,CAAC;IACD,IAAI,YAAY;QAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IAEtC,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC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AAkB,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACpG,IAAA,yBAAa,EAAC,IAAI,CAAC,IAAI,EAAE,2BAAW,CAAC,CAAC;AACxC,CAAC;AAEM,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACvD,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kCAAiB,GAAE,CAAC;IACvC,MAAM,MAAM,CAAC,MAAM,CAAC,cAAc,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjE,IAAA,yBAAa,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,+BAAe,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAI,EAAE,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,OAAO,CAAC,GAAG,CAAC;IACxC,IAAI,OAAO,CAAC,OAAO;QAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAEvD,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kCAAiB,GAAE,CAAC;IACvC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IAC3D,IAAA,yBAAa,EAAC,IAAI,CAAC,IAAI,EAAE,+BAAe,CAAC,CAAC;AAC5C,CAAC;AAEM,KAAK,UAAU,aAAa;IACjC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kCAAiB,GAAE,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACvD,IAAA,yBAAa,EAAC,IAAI,CAAC,IAAI,EAAE,+BAAe,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,oEAAoE;QACpE,iEAAiE;QACjE,oEAAoE;QACpE,mEAAmE;QACnE,WAAW;QACX,IAAI,IAAI,GAAkB,IAAI,CAAC;QAC/B,IAAI,GAAG,YAAY,oBAAQ;YAAE,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;aACxC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,UAAU,IAAI,GAAG,EAAE,CAAC;YACtE,MAAM,MAAM,GAAI,GAA0C,CAAC,QAAQ,EAAE,MAAM,CAAC;YAC5E,IAAI,MAAM,KAAK,GAAG;gBAAE,IAAI,GAAG,WAAW,CAAC;QACzC,CAAC;QACD,IAAI,IAAI,KAAK,qBAAqB,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;YAC3D,IAAA,yBAAa,EAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,4DAA4D,EAAE,EAAE,+BAAe,CAAC,CAAC;YAC1H,OAAO;QACT,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/cjs/formatters.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatAgentList = exports.formatSelfUpdate = exports.formatTeamInvite = exports.formatTeamDetails = exports.formatTeamList = exports.formatTeamCreated = exports.formatSearchResults = exports.formatRowsDeleted = exports.formatRowUpdated = exports.formatRowsAppended = exports.formatCollectionRows = exports.formatProfileUpdated = exports.formatWhoami = exports.formatRefRemoved = exports.formatRefsAdded = exports.formatCollaboratorAdded = exports.formatThreadClosed = exports.formatThreadDetails = exports.formatVersionMetadata = exports.formatVersionList = exports.formatAssetMetadata = exports.formatAssetDownloaded = exports.formatThreadCreated = exports.formatShareLink = exports.formatMessages = exports.formatMessageSent = exports.formatConfigShow = exports.formatContactRemoved = exports.formatContactSaved = exports.formatContactResolved = exports.formatContacts = exports.formatThreadList = exports.formatInbox = exports.formatAuthKey = exports.formatConfigSaved = exports.formatVersionDeleted = exports.formatVersionCreated = exports.formatStats = exports.formatAssetList = exports.formatAssetDeleted = exports.formatAssetPatched = exports.formatAssetCreated = void 0;
|
|
3
|
+
exports.formatPublisher = exports.formatUnmounted = exports.formatMountList = exports.formatMount = exports.formatAgentList = exports.formatSelfUpdate = exports.formatTeamInvite = exports.formatTeamDetails = exports.formatTeamList = exports.formatTeamCreated = exports.formatSearchResults = exports.formatRowsDeleted = exports.formatRowUpdated = exports.formatRowsAppended = exports.formatCollectionRows = exports.formatProfileUpdated = exports.formatWhoami = exports.formatRefRemoved = exports.formatRefsAdded = exports.formatCollaboratorAdded = exports.formatThreadClosed = exports.formatThreadDetails = exports.formatVersionMetadata = exports.formatVersionList = exports.formatAssetMetadata = exports.formatAssetDownloaded = exports.formatThreadCreated = exports.formatShareLink = exports.formatMessages = exports.formatMessageSent = exports.formatConfigShow = exports.formatContactRemoved = exports.formatContactSaved = exports.formatContactResolved = exports.formatContacts = exports.formatThreadList = exports.formatInbox = exports.formatAuthKey = exports.formatConfigSaved = exports.formatVersionDeleted = exports.formatVersionCreated = exports.formatStats = exports.formatAssetList = exports.formatAssetDeleted = exports.formatAssetPatched = exports.formatAssetCreated = void 0;
|
|
4
4
|
const teams_js_1 = require("./teams.js");
|
|
5
5
|
const formatAssetCreated = (data) => {
|
|
6
6
|
const lines = [`Created: ${data.title || '(untitled)'}`];
|
|
@@ -636,6 +636,71 @@ function formatTimeAgo(date) {
|
|
|
636
636
|
return `${Math.floor(seconds / 3600)}h ago`;
|
|
637
637
|
return `${Math.floor(seconds / 86400)}d ago`;
|
|
638
638
|
}
|
|
639
|
+
// ── Mounted-agents v2 ────────────────────────────────────────────────
|
|
640
|
+
const formatMount = (data) => {
|
|
641
|
+
const lines = [`Mount: ${data.name || '(default)'}`];
|
|
642
|
+
if (data.id)
|
|
643
|
+
lines.push(` ID: ${data.id}`);
|
|
644
|
+
if (data.imprintSlug)
|
|
645
|
+
lines.push(` Imprint: ${data.imprintSlug}`);
|
|
646
|
+
if (data.ownerAgentId)
|
|
647
|
+
lines.push(` Owner agent: ${data.ownerAgentId}`);
|
|
648
|
+
if (data.teamId)
|
|
649
|
+
lines.push(` Team: ${data.teamId}`);
|
|
650
|
+
if (data.createdByAgentId)
|
|
651
|
+
lines.push(` Created by: ${data.createdByAgentId}`);
|
|
652
|
+
if (data.createdAt)
|
|
653
|
+
lines.push(` Created: ${data.createdAt}`);
|
|
654
|
+
return lines.join('\n');
|
|
655
|
+
};
|
|
656
|
+
exports.formatMount = formatMount;
|
|
657
|
+
const formatMountList = (data) => {
|
|
658
|
+
const mounts = data;
|
|
659
|
+
if (!Array.isArray(mounts) || mounts.length === 0)
|
|
660
|
+
return 'No mounts.';
|
|
661
|
+
const lines = [`${mounts.length} mount(s):\n`];
|
|
662
|
+
for (const m of mounts) {
|
|
663
|
+
const label = m.name || '(default)';
|
|
664
|
+
const scope = m.teamId ? `team:${m.teamId}` : 'personal';
|
|
665
|
+
lines.push(` ${String(label).padEnd(24)} ${scope}`);
|
|
666
|
+
if (m.id)
|
|
667
|
+
lines.push(` id: ${m.id}`);
|
|
668
|
+
if (m.imprintSlug)
|
|
669
|
+
lines.push(` imprint: ${m.imprintSlug}`);
|
|
670
|
+
}
|
|
671
|
+
return lines.join('\n');
|
|
672
|
+
};
|
|
673
|
+
exports.formatMountList = formatMountList;
|
|
674
|
+
const formatUnmounted = (data) => {
|
|
675
|
+
return `Unmounted: ${data.id}`;
|
|
676
|
+
};
|
|
677
|
+
exports.formatUnmounted = formatUnmounted;
|
|
678
|
+
const formatPublisher = (data) => {
|
|
679
|
+
const lines = [`Publisher: ${data.displayName || '(unnamed)'}`];
|
|
680
|
+
if (data.id)
|
|
681
|
+
lines.push(` ID: ${data.id}`);
|
|
682
|
+
if (data.status)
|
|
683
|
+
lines.push(` Status: ${data.status}`);
|
|
684
|
+
if (typeof data.isApproved === 'boolean')
|
|
685
|
+
lines.push(` Approved: ${data.isApproved ? 'yes' : 'no'}`);
|
|
686
|
+
if (data.contactEmail)
|
|
687
|
+
lines.push(` Contact: ${data.contactEmail}`);
|
|
688
|
+
if (data.websiteUrl)
|
|
689
|
+
lines.push(` Website: ${data.websiteUrl}`);
|
|
690
|
+
if (data.agentId)
|
|
691
|
+
lines.push(` Owner agent: ${data.agentId}`);
|
|
692
|
+
if (data.teamId)
|
|
693
|
+
lines.push(` Owner team: ${data.teamId}`);
|
|
694
|
+
if (data.bio)
|
|
695
|
+
lines.push(` Bio: ${data.bio}`);
|
|
696
|
+
if (data.rejectionReason)
|
|
697
|
+
lines.push(` Reject why: ${data.rejectionReason}`);
|
|
698
|
+
// Friendly "no publisher yet" shape from the CLI:
|
|
699
|
+
if (data.status === 'none' && data.message)
|
|
700
|
+
lines.push(` ${data.message}`);
|
|
701
|
+
return lines.join('\n');
|
|
702
|
+
};
|
|
703
|
+
exports.formatPublisher = formatPublisher;
|
|
639
704
|
function formatBytes(bytes) {
|
|
640
705
|
if (bytes === 0)
|
|
641
706
|
return '0 B';
|