@shardworks/nexus 0.1.99 → 0.1.101

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.
Files changed (150) hide show
  1. package/README.md +208 -0
  2. package/dist/cli.d.ts +4 -8
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +4 -8
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/index.d.ts +14 -0
  7. package/dist/commands/index.d.ts.map +1 -0
  8. package/dist/commands/index.js +27 -0
  9. package/dist/commands/index.js.map +1 -0
  10. package/dist/commands/init.d.ts +19 -0
  11. package/dist/commands/init.d.ts.map +1 -0
  12. package/dist/commands/init.js +90 -0
  13. package/dist/commands/init.js.map +1 -0
  14. package/dist/commands/plugin.d.ts +28 -0
  15. package/dist/commands/plugin.d.ts.map +1 -0
  16. package/dist/commands/plugin.js +174 -0
  17. package/dist/commands/plugin.js.map +1 -0
  18. package/dist/commands/status.d.ts +16 -0
  19. package/dist/commands/status.d.ts.map +1 -0
  20. package/dist/commands/status.js +54 -0
  21. package/dist/commands/status.js.map +1 -0
  22. package/dist/commands/test-helpers.d.ts +18 -0
  23. package/dist/commands/test-helpers.d.ts.map +1 -0
  24. package/dist/commands/test-helpers.js +56 -0
  25. package/dist/commands/test-helpers.js.map +1 -0
  26. package/dist/commands/upgrade.d.ts +13 -0
  27. package/dist/commands/upgrade.d.ts.map +1 -0
  28. package/dist/commands/upgrade.js +21 -0
  29. package/dist/commands/upgrade.js.map +1 -0
  30. package/dist/commands/version.d.ts +15 -0
  31. package/dist/commands/version.d.ts.map +1 -0
  32. package/dist/commands/version.js +52 -0
  33. package/dist/commands/version.js.map +1 -0
  34. package/dist/helpers.d.ts +27 -0
  35. package/dist/helpers.d.ts.map +1 -0
  36. package/dist/helpers.js +48 -0
  37. package/dist/helpers.js.map +1 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +2 -0
  41. package/dist/index.js.map +1 -1
  42. package/dist/program.d.ts +11 -26
  43. package/dist/program.d.ts.map +1 -1
  44. package/dist/program.js +45 -92
  45. package/dist/program.js.map +1 -1
  46. package/package.json +9 -20
  47. package/dist/v1/cli.d.ts +0 -3
  48. package/dist/v1/cli.d.ts.map +0 -1
  49. package/dist/v1/cli.js +0 -4
  50. package/dist/v1/cli.js.map +0 -1
  51. package/dist/v1/commands/anima.d.ts +0 -2
  52. package/dist/v1/commands/anima.d.ts.map +0 -1
  53. package/dist/v1/commands/anima.js +0 -176
  54. package/dist/v1/commands/anima.js.map +0 -1
  55. package/dist/v1/commands/audit.d.ts +0 -2
  56. package/dist/v1/commands/audit.d.ts.map +0 -1
  57. package/dist/v1/commands/audit.js +0 -42
  58. package/dist/v1/commands/audit.js.map +0 -1
  59. package/dist/v1/commands/clock.d.ts +0 -2
  60. package/dist/v1/commands/clock.d.ts.map +0 -1
  61. package/dist/v1/commands/clock.js +0 -185
  62. package/dist/v1/commands/clock.js.map +0 -1
  63. package/dist/v1/commands/consult.d.ts +0 -9
  64. package/dist/v1/commands/consult.d.ts.map +0 -1
  65. package/dist/v1/commands/consult.js +0 -105
  66. package/dist/v1/commands/consult.js.map +0 -1
  67. package/dist/v1/commands/convene.d.ts +0 -2
  68. package/dist/v1/commands/convene.d.ts.map +0 -1
  69. package/dist/v1/commands/convene.js +0 -78
  70. package/dist/v1/commands/convene.js.map +0 -1
  71. package/dist/v1/commands/conversation.d.ts +0 -2
  72. package/dist/v1/commands/conversation.d.ts.map +0 -1
  73. package/dist/v1/commands/conversation.js +0 -140
  74. package/dist/v1/commands/conversation.js.map +0 -1
  75. package/dist/v1/commands/dashboard.d.ts +0 -2
  76. package/dist/v1/commands/dashboard.d.ts.map +0 -1
  77. package/dist/v1/commands/dashboard.js +0 -36
  78. package/dist/v1/commands/dashboard.js.map +0 -1
  79. package/dist/v1/commands/dispatch.d.ts +0 -2
  80. package/dist/v1/commands/dispatch.d.ts.map +0 -1
  81. package/dist/v1/commands/dispatch.js +0 -41
  82. package/dist/v1/commands/dispatch.js.map +0 -1
  83. package/dist/v1/commands/event.d.ts +0 -2
  84. package/dist/v1/commands/event.d.ts.map +0 -1
  85. package/dist/v1/commands/event.js +0 -65
  86. package/dist/v1/commands/event.js.map +0 -1
  87. package/dist/v1/commands/init.d.ts +0 -2
  88. package/dist/v1/commands/init.d.ts.map +0 -1
  89. package/dist/v1/commands/init.js +0 -98
  90. package/dist/v1/commands/init.js.map +0 -1
  91. package/dist/v1/commands/install-tool.d.ts +0 -2
  92. package/dist/v1/commands/install-tool.d.ts.map +0 -1
  93. package/dist/v1/commands/install-tool.js +0 -74
  94. package/dist/v1/commands/install-tool.js.map +0 -1
  95. package/dist/v1/commands/rehydrate.d.ts +0 -2
  96. package/dist/v1/commands/rehydrate.d.ts.map +0 -1
  97. package/dist/v1/commands/rehydrate.js +0 -43
  98. package/dist/v1/commands/rehydrate.js.map +0 -1
  99. package/dist/v1/commands/remove-tool.d.ts +0 -2
  100. package/dist/v1/commands/remove-tool.d.ts.map +0 -1
  101. package/dist/v1/commands/remove-tool.js +0 -25
  102. package/dist/v1/commands/remove-tool.js.map +0 -1
  103. package/dist/v1/commands/session.d.ts +0 -2
  104. package/dist/v1/commands/session.d.ts.map +0 -1
  105. package/dist/v1/commands/session.js +0 -93
  106. package/dist/v1/commands/session.js.map +0 -1
  107. package/dist/v1/commands/signal.d.ts +0 -2
  108. package/dist/v1/commands/signal.d.ts.map +0 -1
  109. package/dist/v1/commands/signal.js +0 -36
  110. package/dist/v1/commands/signal.js.map +0 -1
  111. package/dist/v1/commands/status.d.ts +0 -2
  112. package/dist/v1/commands/status.d.ts.map +0 -1
  113. package/dist/v1/commands/status.js +0 -111
  114. package/dist/v1/commands/status.js.map +0 -1
  115. package/dist/v1/commands/tool.d.ts +0 -2
  116. package/dist/v1/commands/tool.d.ts.map +0 -1
  117. package/dist/v1/commands/tool.js +0 -47
  118. package/dist/v1/commands/tool.js.map +0 -1
  119. package/dist/v1/commands/upgrade-books.d.ts +0 -2
  120. package/dist/v1/commands/upgrade-books.d.ts.map +0 -1
  121. package/dist/v1/commands/upgrade-books.js +0 -33
  122. package/dist/v1/commands/upgrade-books.js.map +0 -1
  123. package/dist/v1/commands/upgrade.d.ts +0 -2
  124. package/dist/v1/commands/upgrade.d.ts.map +0 -1
  125. package/dist/v1/commands/upgrade.js +0 -222
  126. package/dist/v1/commands/upgrade.js.map +0 -1
  127. package/dist/v1/commands/version.d.ts +0 -2
  128. package/dist/v1/commands/version.d.ts.map +0 -1
  129. package/dist/v1/commands/version.js +0 -80
  130. package/dist/v1/commands/version.js.map +0 -1
  131. package/dist/v1/commands/workshop.d.ts +0 -2
  132. package/dist/v1/commands/workshop.d.ts.map +0 -1
  133. package/dist/v1/commands/workshop.js +0 -128
  134. package/dist/v1/commands/workshop.js.map +0 -1
  135. package/dist/v1/commands/writ.d.ts +0 -2
  136. package/dist/v1/commands/writ.d.ts.map +0 -1
  137. package/dist/v1/commands/writ.js +0 -202
  138. package/dist/v1/commands/writ.js.map +0 -1
  139. package/dist/v1/index.d.ts +0 -2
  140. package/dist/v1/index.d.ts.map +0 -1
  141. package/dist/v1/index.js +0 -2
  142. package/dist/v1/index.js.map +0 -1
  143. package/dist/v1/program.d.ts +0 -2
  144. package/dist/v1/program.d.ts.map +0 -1
  145. package/dist/v1/program.js +0 -70
  146. package/dist/v1/program.js.map +0 -1
  147. package/dist/v1/resolve-home.d.ts +0 -16
  148. package/dist/v1/resolve-home.d.ts.map +0 -1
  149. package/dist/v1/resolve-home.js +0 -18
  150. package/dist/v1/resolve-home.js.map +0 -1
package/README.md ADDED
@@ -0,0 +1,208 @@
1
+ # `@shardworks/nexus`
2
+
3
+ The `nsg` command-line interface for Nexus guilds. The CLI is the patron's and operator's primary entry point — it provides framework commands for guild lifecycle and plugin management, and dynamically discovers plugin-contributed tools via The Instrumentarium.
4
+
5
+ The CLI has two layers of commands:
6
+
7
+ 1. **Framework commands** — hardcoded in the CLI package. Always available, even without a guild. Guild lifecycle (`init`, `status`, `version`, `upgrade`) and plugin management (`plugin list/install/remove/upgrade`).
8
+ 2. **Plugin tools** — discovered at runtime from The Instrumentarium (`tools` apparatus). Only available when inside a guild that has the tools apparatus installed. Each tool is contributed by a kit or apparatus; the CLI auto-generates Commander commands from the tool's Zod param schema.
9
+
10
+ ---
11
+
12
+ ## Binary Names
13
+
14
+ | Binary | Description |
15
+ |---|---|
16
+ | `nsg` | The v2 CLI — framework commands + dynamic tool discovery via The Instrumentarium |
17
+
18
+ During development from the monorepo root:
19
+
20
+ ```sh
21
+ pnpm nsg <command>
22
+ ```
23
+
24
+ ---
25
+
26
+ ## How It Works
27
+
28
+ ### Command Discovery
29
+
30
+ At startup:
31
+
32
+ 1. Pre-parse `--guild-root` to locate the guild (or auto-detect by walking up from cwd)
33
+ 2. Register framework commands (always available — see [Framework Commands](#framework-commands))
34
+ 3. If inside a guild: call `createGuild()` to start the runtime, then query The Instrumentarium for all tools with `callableBy: 'cli'`
35
+ 4. Auto-generate Commander commands from each tool's Zod param schema
36
+
37
+ If the guild doesn't have the tools apparatus installed, only framework commands are available.
38
+
39
+ ### Auto-Grouping
40
+
41
+ Tool names are automatically grouped by hyphen prefix when two or more tools share a prefix:
42
+
43
+ ```
44
+ plugin-list + plugin-install → nsg plugin list / nsg plugin install
45
+ session-list + session-show → nsg session list / nsg session show
46
+ signal (no group) → nsg signal
47
+ ```
48
+
49
+ A tool like `show-writ` stays flat (`nsg show-writ`) if no other tool starts with `show-`.
50
+
51
+ ### Flag Generation
52
+
53
+ Zod param schemas are converted to Commander flags:
54
+
55
+ | Zod schema | Commander flag |
56
+ |---|---|
57
+ | `z.string()` (required) | `--param <value>` (required) |
58
+ | `z.string().optional()` | `--param <value>` (optional) |
59
+ | `z.boolean()` | `--param` (flag, no value) |
60
+ | camelCase key | `--kebab-case` flag |
61
+
62
+ ### Guild Root Resolution
63
+
64
+ The CLI finds the guild root the same way git finds `.git/` — walking up from cwd until it finds `guild.json`. Override with `--guild-root <path>`.
65
+
66
+ Plugin-contributed tools require a guild. Framework commands work without one.
67
+
68
+ ---
69
+
70
+ ## Framework Commands
71
+
72
+ Framework commands are defined in the CLI package itself (`src/commands/`). They handle guild lifecycle and plugin management — operations that need to work before any plugins are loaded, or without a guild at all.
73
+
74
+ ### Guild Lifecycle
75
+
76
+ | Command | Description |
77
+ |---|---|
78
+ | `nsg init <path>` | Create a new guild: directory structure, `guild.json`, `package.json`, `.gitignore` |
79
+ | `nsg status` | Show guild identity and installed plugins |
80
+ | `nsg version` | Show Nexus framework version and installed plugin versions |
81
+ | `nsg upgrade` | Upgrade framework and run pending plugin migrations *(stub)* |
82
+
83
+ ### Plugin Management
84
+
85
+ | Command | Description |
86
+ |---|---|
87
+ | `nsg plugin list` | List installed plugins |
88
+ | `nsg plugin install <source>` | Install a plugin from npm, a git URL, or a local directory |
89
+ | `nsg plugin remove <name>` | Remove a plugin |
90
+ | `nsg plugin upgrade <name>` | Upgrade a plugin to a newer version *(stub)* |
91
+
92
+ #### `nsg init`
93
+
94
+ Writes the minimum viable guild. Does not run `git init`, create the database, or instantiate animas — those are separate steps.
95
+
96
+ ```sh
97
+ nsg init ./my-guild --name my-guild
98
+ cd my-guild
99
+ nsg plugin install @shardworks/nexus-stdlib
100
+ ```
101
+
102
+ #### `nsg plugin install`
103
+
104
+ Accepts npm package specifiers, version pins, and git URLs:
105
+
106
+ ```sh
107
+ nsg plugin install @shardworks/nexus-stdlib
108
+ nsg plugin install nexus-stdlib@1.2.0
109
+ nsg plugin install git+https://github.com/acme/my-plugin.git
110
+
111
+ # Symlink a local directory (dev workflow)
112
+ nsg plugin install ./path/to/my-plugin --type link
113
+ ```
114
+
115
+ Plugin install is a pure npm + guild.json operation — it adds the package as a dependency and registers the plugin id. Tool access is controlled by the permission model: tools declare permission levels, and roles grant `plugin:level` permissions via the Loom's configuration. See [The Instrumentarium](../../docs/architecture/apparatus/instrumentarium.md) for the permission model.
116
+
117
+ ---
118
+
119
+ ## Standard Guild Commands
120
+
121
+ > **Note:** The standard kits are still being developed. This inventory reflects the target command set for a default `nsg init` guild. Some commands listed here are only available via `nsg1` (v1 legacy) until migration is complete. Update this section once the standard kit set is finalized.
122
+
123
+ ### Commissions and Writs
124
+
125
+ | Command | Source | Description |
126
+ |---|---|---|
127
+ | `nsg writ post` | nexus-stdlib | Post a new commission (creates a mandate writ) |
128
+ | `nsg writ list` | nexus-stdlib | List writs with optional filters |
129
+ | `nsg writ show` | nexus-stdlib | Show full detail for a writ |
130
+ | `nsg writ update` | nexus-stdlib | Update writ fields (status, spec, etc.) |
131
+
132
+ ### Animas
133
+
134
+ | Command | Source | Description |
135
+ |---|---|---|
136
+ | `nsg anima create` | nexus-stdlib | Create a new anima |
137
+ | `nsg anima list` | nexus-stdlib | List animas |
138
+ | `nsg anima show` | nexus-stdlib | Show anima detail (roles, curriculum, temperament) |
139
+ | `nsg anima update` | nexus-stdlib | Update anima configuration |
140
+ | `nsg anima remove` | nexus-stdlib | Retire an anima |
141
+ | `nsg anima manifest` | nexus-stdlib | Preview the manifest that would be assembled for an anima |
142
+
143
+ ### Sessions and Conversations
144
+
145
+ | Command | Source | Description |
146
+ |---|---|---|
147
+ | `nsg consult` | cli (v1) | Start an interactive conversation with an anima |
148
+ | `nsg convene` | cli (v1) | Start a multi-anima conversation |
149
+ | `nsg session list` | animator (supportKit) | List recent sessions |
150
+ | `nsg session show` | animator (supportKit) | Show session detail (tokens, cost, duration) |
151
+ | `nsg conversation list` | parlour (supportKit) | List conversations |
152
+ | `nsg conversation show` | parlour (supportKit) | Show conversation detail with turn history |
153
+ | `nsg conversation end` | parlour (supportKit) | End an active conversation |
154
+
155
+ ### Clockworks
156
+
157
+ | Command | Source | Description |
158
+ |---|---|---|
159
+ | `nsg signal` | nexus-stdlib | Signal a custom event |
160
+ | `nsg clock start` | cli (v1) | Start the Clockworks daemon |
161
+ | `nsg clock stop` | cli (v1) | Stop the Clockworks daemon |
162
+ | `nsg clock status` | cli (v1) | Show daemon status |
163
+ | `nsg clock tick` | cli (v1) | Process one pending event (manual mode) |
164
+ | `nsg clock run` | cli (v1) | Process all pending events (manual mode) |
165
+ | `nsg clock list` | cli (v1) | List standing orders |
166
+ | `nsg event list` | nexus-stdlib | List recent events |
167
+ | `nsg event show` | nexus-stdlib | Show event detail |
168
+
169
+ ### Codexes
170
+
171
+ | Command | Source | Description |
172
+ |---|---|---|
173
+ | `nsg codex add` | codexes-apparatus | Register an existing repo as a codex |
174
+ | `nsg codex list` | codexes-apparatus | List registered codexes |
175
+ | `nsg codex show` | codexes-apparatus | Show codex detail |
176
+ | `nsg codex remove` | codexes-apparatus | Unregister a codex |
177
+ | `nsg codex push` | codexes-apparatus | Push a branch to the codex remote |
178
+ | `nsg draft open` | codexes-apparatus | Open a draft binding (worktree) |
179
+ | `nsg draft list` | codexes-apparatus | List active draft bindings |
180
+ | `nsg draft abandon` | codexes-apparatus | Abandon a draft binding |
181
+ | `nsg draft seal` | codexes-apparatus | Seal a draft into the codex |
182
+
183
+ ### Operations
184
+
185
+ | Command | Source | Description |
186
+ |---|---|---|
187
+ | `nsg dispatch list` | nexus-stdlib | List recent dispatches |
188
+ | `nsg audit list` | nexus-stdlib | List audit entries |
189
+ | `nsg dashboard` | cli (v1) | Open the guild dashboard |
190
+
191
+ ---
192
+
193
+ ## Migration Status (v1 → v2)
194
+
195
+ The v2 CLI dynamically discovers plugin-contributed tools via The Instrumentarium. Commands that are still hardcoded in v1 need to be migrated to the plugin architecture (either as tools in a kit/apparatus supportKit, or as framework commands).
196
+
197
+ **Migrated to v2:**
198
+ - Framework commands: `init`, `status`, `version`, `upgrade`, `plugin list/install/remove/upgrade`
199
+ - All tool-based commands discovered via The Instrumentarium
200
+
201
+ **Remaining in v1 only:**
202
+ - `consult`, `convene` — interactive session launchers (need Animator/Parlour integration)
203
+ - `clock *` — Clockworks daemon management
204
+ - `codex *` / `draft *` — codex and draft lifecycle (migrated to codexes-apparatus)
205
+ - `dashboard` — guild dashboard
206
+ - `guild restore`, `guild upgrade-books` — guild maintenance
207
+
208
+ These will migrate as the corresponding apparatus are implemented and expose the necessary tools via their supportKits.
package/dist/cli.d.ts CHANGED
@@ -1,16 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * nsg — new entry point, built on the rig architecture.
3
+ * nsg — CLI entry point, built on the plugin architecture.
4
4
  *
5
- * Dynamically discovers installed tools via rig, registers them as Commander
5
+ * Dynamically discovers installed tools via plugins, registers them as Commander
6
6
  * commands, and delegates argument parsing and invocation to Commander.
7
7
  *
8
- * Tools are filtered to those with 'cli' in callableFrom (or no callableFrom
9
- * set, which defaults to all callers). Tools marked 'mcp'-only are invisible here.
10
- *
11
- * nsg1 is the legacy entry point (src/v1/cli.ts) — fully preserved and functional.
12
- * The guild continues to use nsg1 for anything not yet migrated. Over time, nsg1
13
- * is retired as commands migrate to nsg.
8
+ * Tools are filtered to those with 'cli' in callableBy (or no callableBy
9
+ * set, which defaults to all callers). Tools marked 'anima'-only are invisible here.
14
10
  */
15
11
  export {};
16
12
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;GAQG"}
package/dist/cli.js CHANGED
@@ -1,16 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * nsg — new entry point, built on the rig architecture.
3
+ * nsg — CLI entry point, built on the plugin architecture.
4
4
  *
5
- * Dynamically discovers installed tools via rig, registers them as Commander
5
+ * Dynamically discovers installed tools via plugins, registers them as Commander
6
6
  * commands, and delegates argument parsing and invocation to Commander.
7
7
  *
8
- * Tools are filtered to those with 'cli' in callableFrom (or no callableFrom
9
- * set, which defaults to all callers). Tools marked 'mcp'-only are invisible here.
10
- *
11
- * nsg1 is the legacy entry point (src/v1/cli.ts) — fully preserved and functional.
12
- * The guild continues to use nsg1 for anything not yet migrated. Over time, nsg1
13
- * is retired as commands migrate to nsg.
8
+ * Tools are filtered to those with 'cli' in callableBy (or no callableBy
9
+ * set, which defaults to all callers). Tools marked 'anima'-only are invisible here.
14
10
  */
15
11
  import { main } from "./program.js";
16
12
  main().catch((err) => {
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Framework commands — hardcoded CLI commands that work with or without a guild.
3
+ *
4
+ * These are guild lifecycle and plugin management commands that the CLI
5
+ * registers directly, bypassing plugin discovery. They are the CLI's own
6
+ * commands, not tools contributed by kits or apparatus.
7
+ *
8
+ * Plugin-contributed tools are discovered at runtime via The Instrumentarium
9
+ * when a guild is present and the tools apparatus is installed.
10
+ */
11
+ import type { ToolDefinition } from '@shardworks/tools-apparatus';
12
+ /** All framework commands, typed as the base ToolDefinition for uniform handling. */
13
+ export declare const frameworkCommands: ToolDefinition[];
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAOlE,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,EASzB,cAAc,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Framework commands — hardcoded CLI commands that work with or without a guild.
3
+ *
4
+ * These are guild lifecycle and plugin management commands that the CLI
5
+ * registers directly, bypassing plugin discovery. They are the CLI's own
6
+ * commands, not tools contributed by kits or apparatus.
7
+ *
8
+ * Plugin-contributed tools are discovered at runtime via The Instrumentarium
9
+ * when a guild is present and the tools apparatus is installed.
10
+ */
11
+ import init from "./init.js";
12
+ import version from "./version.js";
13
+ import status from "./status.js";
14
+ import upgrade from "./upgrade.js";
15
+ import { pluginList, pluginInstall, pluginRemove, pluginUpgrade } from "./plugin.js";
16
+ /** All framework commands, typed as the base ToolDefinition for uniform handling. */
17
+ export const frameworkCommands = [
18
+ init,
19
+ version,
20
+ status,
21
+ upgrade,
22
+ pluginList,
23
+ pluginInstall,
24
+ pluginRemove,
25
+ pluginUpgrade,
26
+ ];
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAErF,qFAAqF;AACrF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI;IACJ,OAAO;IACP,MAAM;IACN,OAAO;IACP,UAAU;IACV,aAAa;IACb,YAAY;IACZ,aAAa;CACM,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * nsg init — create a new guild.
3
+ *
4
+ * A framework command — hardcoded in the CLI, not discovered via plugins.
5
+ *
6
+ * Writes the minimum viable guild: directory structure, guild.json,
7
+ * package.json, .gitignore. Does NOT git init, install bundles, create
8
+ * the database, or instantiate animas — those are separate steps.
9
+ *
10
+ * After init, the user runs `nsg plugin install` to add capabilities.
11
+ */
12
+ import { z } from 'zod';
13
+ declare const _default: import("@shardworks/tools-apparatus").ToolDefinition<{
14
+ path: z.ZodString;
15
+ name: z.ZodOptional<z.ZodString>;
16
+ model: z.ZodOptional<z.ZodString>;
17
+ }>;
18
+ export default _default;
19
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;;;;;;AAIxB,wBAuFG"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * nsg init — create a new guild.
3
+ *
4
+ * A framework command — hardcoded in the CLI, not discovered via plugins.
5
+ *
6
+ * Writes the minimum viable guild: directory structure, guild.json,
7
+ * package.json, .gitignore. Does NOT git init, install bundles, create
8
+ * the database, or instantiate animas — those are separate steps.
9
+ *
10
+ * After init, the user runs `nsg plugin install` to add capabilities.
11
+ */
12
+ import fs from 'node:fs';
13
+ import path from 'node:path';
14
+ import { execFileSync } from 'node:child_process';
15
+ import { tool } from '@shardworks/tools-apparatus';
16
+ import { VERSION, createInitialGuildConfig, writeGuildConfig } from '@shardworks/nexus-core';
17
+ import { z } from 'zod';
18
+ const DEFAULT_MODEL = 'sonnet';
19
+ export default tool({
20
+ name: 'init',
21
+ description: 'Create a new guild — directory structure, guild.json, and package.json',
22
+ callableBy: ['cli'],
23
+ params: {
24
+ path: z.string().describe('Directory path for the new guild'),
25
+ name: z.string().optional().describe('Guild name (defaults to directory basename)'),
26
+ model: z.string().optional().describe('Default model for anima sessions (default: sonnet)'),
27
+ },
28
+ handler: async (params) => {
29
+ const home = path.resolve(params.path);
30
+ const name = params.name ?? path.basename(home);
31
+ const model = params.model ?? DEFAULT_MODEL;
32
+ // Validate target
33
+ if (fs.existsSync(home)) {
34
+ const entries = fs.readdirSync(home);
35
+ if (entries.length > 0) {
36
+ throw new Error(`${home} exists and is not empty.`);
37
+ }
38
+ }
39
+ // Create guild root
40
+ fs.mkdirSync(home, { recursive: true });
41
+ // .nexus infrastructure (gitignored)
42
+ fs.mkdirSync(path.join(home, '.nexus'), { recursive: true });
43
+ // Scaffold guild directories
44
+ const dirs = [
45
+ 'roles',
46
+ 'codex',
47
+ ];
48
+ for (const dir of dirs) {
49
+ const full = path.join(home, dir);
50
+ fs.mkdirSync(full, { recursive: true });
51
+ fs.writeFileSync(path.join(full, '.gitkeep'), '');
52
+ }
53
+ // guild.json — V2 format: plugin-centric, model in settings
54
+ const guildConfig = createInitialGuildConfig(name, VERSION, model);
55
+ writeGuildConfig(home, guildConfig);
56
+ // package.json — makes the guild an npm project so plugins install as deps.
57
+ // If running from a published version, pin @shardworks/nexus so nsg is
58
+ // available in the guild's node_modules/.bin without a global install.
59
+ const dependencies = {};
60
+ if (VERSION !== '0.0.0') {
61
+ dependencies['@shardworks/nexus'] = `^${VERSION}`;
62
+ }
63
+ const packageJson = {
64
+ name: `guild-${name}`,
65
+ private: true,
66
+ version: '0.0.0',
67
+ type: 'module',
68
+ dependencies,
69
+ };
70
+ fs.writeFileSync(path.join(home, 'package.json'), JSON.stringify(packageJson, null, 2) + '\n');
71
+ // .gitignore
72
+ fs.writeFileSync(path.join(home, '.gitignore'), ['node_modules/', '.nexus/', ''].join('\n'));
73
+ // codex placeholder
74
+ fs.writeFileSync(path.join(home, 'codex', 'all.md'), '');
75
+ // npm install to get dependencies into node_modules
76
+ if (Object.keys(dependencies).length > 0) {
77
+ execFileSync('npm', ['install'], { cwd: home, stdio: 'pipe' });
78
+ }
79
+ const lines = [
80
+ `Guild "${name}" created at ${home}`,
81
+ '',
82
+ ` cd ${params.path}`,
83
+ ' git init # if you want version control',
84
+ ' nsg plugin install @shardworks/nexus-stdlib # install standard tools',
85
+ '',
86
+ ];
87
+ return lines.join('\n');
88
+ },
89
+ });
90
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,aAAa,GAAG,QAAQ,CAAC;AAE/B,eAAe,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,wEAAwE;IACrF,UAAU,EAAE,CAAC,KAAK,CAAC;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,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,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,KAAK,GAAG;YACZ,UAAU,IAAI,gBAAgB,IAAI,EAAE;YACpC,EAAE;YACF,QAAQ,MAAM,CAAC,IAAI,EAAE;YACrB,iFAAiF;YACjF,4EAA4E;YAC5E,EAAE;SACH,CAAC;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * nsg plugin-* — manage guild plugins.
3
+ *
4
+ * Framework commands for plugin lifecycle. Available via CLI only (not MCP).
5
+ *
6
+ * Plugin install/remove are pure npm + guild.json operations. No tool
7
+ * discovery at install time — tools are resolved at runtime by the
8
+ * Instrumentarium via its permission-based model.
9
+ */
10
+ import { z } from 'zod';
11
+ export declare const pluginList: import("@shardworks/tools-apparatus").ToolDefinition<{
12
+ json: z.ZodOptional<z.ZodBoolean>;
13
+ }>;
14
+ export declare const pluginInstall: import("@shardworks/tools-apparatus").ToolDefinition<{
15
+ source: z.ZodString;
16
+ type: z.ZodOptional<z.ZodEnum<{
17
+ link: "link";
18
+ registry: "registry";
19
+ }>>;
20
+ }>;
21
+ export declare const pluginRemove: import("@shardworks/tools-apparatus").ToolDefinition<{
22
+ name: z.ZodString;
23
+ }>;
24
+ export declare const pluginUpgrade: import("@shardworks/tools-apparatus").ToolDefinition<{
25
+ name: z.ZodString;
26
+ version: z.ZodOptional<z.ZodString>;
27
+ }>;
28
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/commands/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwDxB,eAAO,MAAM,UAAU;;EAsBrB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;EAoDxB,CAAC;AAEH,eAAO,MAAM,YAAY;;EA8BvB,CAAC;AAEH,eAAO,MAAM,aAAa;;;EAWxB,CAAC"}
@@ -0,0 +1,174 @@
1
+ /**
2
+ * nsg plugin-* — manage guild plugins.
3
+ *
4
+ * Framework commands for plugin lifecycle. Available via CLI only (not MCP).
5
+ *
6
+ * Plugin install/remove are pure npm + guild.json operations. No tool
7
+ * discovery at install time — tools are resolved at runtime by the
8
+ * Instrumentarium via its permission-based model.
9
+ */
10
+ import fs from 'node:fs';
11
+ import path from 'node:path';
12
+ import { execFileSync } from 'node:child_process';
13
+ import { tool } from '@shardworks/tools-apparatus';
14
+ import { guild, readGuildConfig, writeGuildConfig, derivePluginId, readGuildPackageJson, resolvePackageNameForPluginId, } from '@shardworks/nexus-core';
15
+ import { z } from 'zod';
16
+ // ── Helpers ────────────────────────────────────────────────────────────
17
+ function npm(args, cwd) {
18
+ return execFileSync('npm', args, { cwd, stdio: 'pipe', encoding: 'utf-8' });
19
+ }
20
+ /**
21
+ * Parse a source specifier to extract the npm package name.
22
+ * e.g. "@shardworks/nexus-stdlib@1.0" → "@shardworks/nexus-stdlib"
23
+ * "nexus-stdlib" → "nexus-stdlib"
24
+ *
25
+ * Returns null for git URLs — the package name must be read from
26
+ * the guild's package.json after npm install.
27
+ *
28
+ * Known limitations: does not handle npm: alias specifiers, tarball URLs,
29
+ * or workspace: protocol. These are uncommon for plugin install and can
30
+ * be added if needed.
31
+ */
32
+ function parsePackageName(source) {
33
+ if (source.startsWith('git+') || source.startsWith('git://') || source.endsWith('.git')) {
34
+ return null;
35
+ }
36
+ if (source.startsWith('@')) {
37
+ const lastAt = source.lastIndexOf('@');
38
+ if (lastAt > 0)
39
+ return source.substring(0, lastAt);
40
+ return source;
41
+ }
42
+ if (source.includes('@')) {
43
+ return source.split('@')[0];
44
+ }
45
+ return source;
46
+ }
47
+ /**
48
+ * Find the most recently added dependency in the guild's package.json.
49
+ * Used after `npm install <git-url>` where we can't parse the name from the source.
50
+ *
51
+ * Relies on Object.keys() returning insertion-ordered string keys (guaranteed
52
+ * by the ES2015 spec for non-integer keys, and by V8/Node). A diff-based
53
+ * approach (snapshot deps before install, compare after) would be more robust
54
+ * but overkill for this edge case.
55
+ */
56
+ function detectInstalledPackage(guildRoot) {
57
+ const pkgPath = path.join(guildRoot, 'package.json');
58
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
59
+ const deps = pkg.dependencies ?? {};
60
+ const names = Object.keys(deps);
61
+ const last = names[names.length - 1];
62
+ if (!last)
63
+ throw new Error('Could not determine package name after npm install.');
64
+ return last;
65
+ }
66
+ // ── Commands ───────────────────────────────────────────────────────────
67
+ export const pluginList = tool({
68
+ name: 'plugin-list',
69
+ description: 'List installed plugins',
70
+ callableBy: ['cli'],
71
+ params: {
72
+ json: z.boolean().optional().describe('Output as JSON'),
73
+ },
74
+ handler: async (params) => {
75
+ const { home } = guild();
76
+ const config = readGuildConfig(home);
77
+ const pluginIds = config.plugins;
78
+ if (pluginIds.length === 0) {
79
+ if (params.json)
80
+ return [];
81
+ return 'No plugins installed.';
82
+ }
83
+ if (params.json) {
84
+ return [...pluginIds].sort().map((id) => ({ id }));
85
+ }
86
+ return [...pluginIds].sort().join('\n');
87
+ },
88
+ });
89
+ export const pluginInstall = tool({
90
+ name: 'plugin-install',
91
+ description: 'Install a plugin into the guild',
92
+ callableBy: ['cli'],
93
+ params: {
94
+ source: z.string().describe('Package name, git URL, or local folder path'),
95
+ type: z.enum(['registry', 'link']).optional().describe('Install type: "registry" (npm install) or "link" (local folder). Auto-detected when source is a folder path.'),
96
+ },
97
+ handler: async (params) => {
98
+ const { home } = guild();
99
+ const { source } = params;
100
+ // Auto-detect link mode when source looks like a filesystem path
101
+ const sourceDir = path.resolve(source);
102
+ const looksLikePath = source.startsWith('.') || source.startsWith('/');
103
+ const isDirectory = looksLikePath && fs.existsSync(sourceDir) && fs.statSync(sourceDir).isDirectory();
104
+ const installType = params.type ?? (isDirectory ? 'link' : 'registry');
105
+ // 1. Install the npm package into the guild
106
+ let packageName;
107
+ if (installType === 'link') {
108
+ const sourceDir = path.resolve(source);
109
+ if (!fs.existsSync(path.join(sourceDir, 'package.json'))) {
110
+ throw new Error(`No package.json found in ${sourceDir}. --link requires a directory with a package.json.`);
111
+ }
112
+ const pkgJson = JSON.parse(fs.readFileSync(path.join(sourceDir, 'package.json'), 'utf-8'));
113
+ packageName = pkgJson.name;
114
+ npm(['install', '--save', `file:${sourceDir}`], home);
115
+ }
116
+ else {
117
+ npm(['install', '--save', source], home);
118
+ packageName = parsePackageName(source) ?? detectInstalledPackage(home);
119
+ const { pkgJson } = readGuildPackageJson(home, packageName);
120
+ if (!pkgJson) {
121
+ throw new Error(`Package "${packageName}" not found in node_modules after install.`);
122
+ }
123
+ }
124
+ const pluginId = derivePluginId(packageName);
125
+ // 2. Update guild.json — add to plugins list
126
+ const config = readGuildConfig(home);
127
+ if (!config.plugins.includes(pluginId)) {
128
+ config.plugins.push(pluginId);
129
+ }
130
+ writeGuildConfig(home, config);
131
+ return `Installed plugin: ${pluginId} (${packageName})`;
132
+ },
133
+ });
134
+ export const pluginRemove = tool({
135
+ name: 'plugin-remove',
136
+ description: 'Remove a plugin from the guild',
137
+ callableBy: ['cli'],
138
+ params: {
139
+ name: z.string().describe('Plugin id or package name to remove'),
140
+ },
141
+ handler: async (params) => {
142
+ const { home } = guild();
143
+ const config = readGuildConfig(home);
144
+ const targetId = params.name.startsWith('@') ? derivePluginId(params.name) : params.name;
145
+ if (!config.plugins.includes(targetId)) {
146
+ throw new Error(`Plugin "${targetId}" is not installed.`);
147
+ }
148
+ config.plugins = config.plugins.filter((id) => id !== targetId);
149
+ writeGuildConfig(home, config);
150
+ const packageName = resolvePackageNameForPluginId(home, targetId);
151
+ if (packageName) {
152
+ try {
153
+ npm(['uninstall', packageName], home);
154
+ }
155
+ catch {
156
+ // Don't fail if npm uninstall fails — guild.json is already updated
157
+ }
158
+ }
159
+ return `Removed plugin: ${targetId}`;
160
+ },
161
+ });
162
+ export const pluginUpgrade = tool({
163
+ name: 'plugin-upgrade',
164
+ description: 'Upgrade a plugin to a newer version',
165
+ callableBy: ['cli'],
166
+ params: {
167
+ name: z.string().describe('Plugin id or package name to upgrade'),
168
+ version: z.string().optional().describe('Target version (default: latest)'),
169
+ },
170
+ handler: async () => {
171
+ return 'Not yet implemented.';
172
+ },
173
+ });
174
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/commands/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EACL,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0EAA0E;AAE1E,SAAS,GAAG,CAAC,IAAc,EAAE,GAAW;IACtC,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,gBAAgB,CAAC,MAAc;IACtC,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,G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