@shardworks/nexus 0.1.4 → 0.1.6
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/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/commands/dispatch.js +4 -3
- package/dist/commands/dispatch.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +43 -25
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install-tool.d.ts +1 -0
- package/dist/commands/install-tool.d.ts.map +1 -1
- package/dist/commands/install-tool.js +62 -15
- package/dist/commands/install-tool.js.map +1 -1
- package/dist/commands/instantiate.d.ts.map +1 -1
- package/dist/commands/instantiate.js +5 -4
- package/dist/commands/instantiate.js.map +1 -1
- package/dist/commands/manifest.js +4 -4
- package/dist/commands/manifest.js.map +1 -1
- package/dist/commands/rehydrate.d.ts +2 -0
- package/dist/commands/rehydrate.d.ts.map +1 -0
- package/dist/commands/rehydrate.js +33 -0
- package/dist/commands/rehydrate.js.map +1 -0
- package/dist/commands/remove-tool.d.ts.map +1 -1
- package/dist/commands/remove-tool.js +5 -4
- package/dist/commands/remove-tool.js.map +1 -1
- package/dist/program.d.ts +3 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +18 -8
- package/dist/program.js.map +1 -1
- package/dist/resolve-home.d.ts +13 -0
- package/dist/resolve-home.d.ts.map +1 -0
- package/dist/resolve-home.js +15 -0
- package/dist/resolve-home.js.map +1 -0
- package/package.json +13 -13
- package/dist/commands/publish.d.ts +0 -4
- package/dist/commands/publish.d.ts.map +0 -1
- package/dist/commands/publish.js +0 -26
- package/dist/commands/publish.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB;;;OA0BlC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { createCommand } from 'commander';
|
|
2
|
-
import {
|
|
2
|
+
import { dispatch } from '@shardworks/nexus-core';
|
|
3
|
+
import { resolveHome } from "../resolve-home.js";
|
|
3
4
|
export function makeDispatchCommand() {
|
|
4
5
|
return createCommand('dispatch')
|
|
5
6
|
.description('Post a commission to the guild')
|
|
6
7
|
.argument('<spec>', 'Commission specification — what needs to be done')
|
|
7
8
|
.requiredOption('--workshop <workshop>', 'Target workshop')
|
|
8
9
|
.option('--anima <anima>', 'Target anima name')
|
|
9
|
-
.action((spec, options) => {
|
|
10
|
-
const home =
|
|
10
|
+
.action((spec, options, cmd) => {
|
|
11
|
+
const home = resolveHome(cmd);
|
|
11
12
|
try {
|
|
12
13
|
const result = dispatch({
|
|
13
14
|
home,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,mBAAmB;IACjC,OAAO,aAAa,CAAC,UAAU,CAAC;SAC7B,WAAW,CAAC,gCAAgC,CAAC;SAC7C,QAAQ,CAAC,QAAQ,EAAE,kDAAkD,CAAC;SACtE,cAAc,CAAC,uBAAuB,EAAE,iBAAiB,CAAC;SAC1D,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;SAC9C,MAAM,CAAC,CAAC,IAAY,EAAE,OAA6C,EAAE,GAAG,EAAE,EAAE;QAC3E,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAE9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,QAAQ,CAAC;gBACtB,IAAI;gBACJ,IAAI;gBACJ,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,YAAY,wBAAwB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YAC3F,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAwCA,wBAAgB,eAAe;;;OA4D9B"}
|
package/dist/commands/init.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import { createCommand } from 'commander';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
2
|
import path from 'node:path';
|
|
4
|
-
import {
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
5
4
|
import readline from 'node:readline/promises';
|
|
6
|
-
import { initGuild,
|
|
5
|
+
import { initGuild, installBundle, instantiate } from '@shardworks/nexus-core';
|
|
7
6
|
import { applyMigrations } from '@shardworks/engine-ledger-migrate';
|
|
8
7
|
const DEFAULT_MODEL = 'sonnet';
|
|
9
|
-
|
|
10
|
-
function makePackageResolver() {
|
|
11
|
-
const require = createRequire(import.meta.url);
|
|
12
|
-
return (packageName) => {
|
|
13
|
-
// Resolve the package's main entry, then walk up to find package.json
|
|
14
|
-
const entry = require.resolve(packageName);
|
|
15
|
-
let dir = path.dirname(entry);
|
|
16
|
-
while (dir !== path.dirname(dir)) {
|
|
17
|
-
if (fs.existsSync(path.join(dir, 'package.json')))
|
|
18
|
-
return dir;
|
|
19
|
-
dir = path.dirname(dir);
|
|
20
|
-
}
|
|
21
|
-
throw new Error(`Could not find package root for ${packageName}`);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
8
|
+
const DEFAULT_BUNDLE = '@shardworks/guild-starter-kit';
|
|
24
9
|
async function prompt(question, defaultValue) {
|
|
25
10
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
26
11
|
try {
|
|
@@ -32,15 +17,35 @@ async function prompt(question, defaultValue) {
|
|
|
32
17
|
rl.close();
|
|
33
18
|
}
|
|
34
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Fetch a bundle package into the guild's node_modules (without saving to package.json),
|
|
22
|
+
* and return the path to the installed bundle directory.
|
|
23
|
+
*/
|
|
24
|
+
function fetchBundle(home, bundleSpec) {
|
|
25
|
+
execFileSync('npm', ['install', '--no-save', bundleSpec], { cwd: home, stdio: 'pipe' });
|
|
26
|
+
// Resolve the installed package name from the specifier
|
|
27
|
+
// Strip version range: "@scope/name@^1.0" → "@scope/name"
|
|
28
|
+
let packageName = bundleSpec;
|
|
29
|
+
if (packageName.startsWith('@') && packageName.lastIndexOf('@') > 0) {
|
|
30
|
+
packageName = packageName.substring(0, packageName.lastIndexOf('@'));
|
|
31
|
+
}
|
|
32
|
+
else if (packageName.includes('@') && !packageName.startsWith('@')) {
|
|
33
|
+
packageName = packageName.split('@')[0];
|
|
34
|
+
}
|
|
35
|
+
return path.join(home, 'node_modules', packageName);
|
|
36
|
+
}
|
|
35
37
|
export function makeInitCommand() {
|
|
36
38
|
return createCommand('init')
|
|
37
39
|
.description('Create a new guild — guildhall, directory structure, guild.json, and Ledger')
|
|
38
40
|
.argument('[path]', 'Path for the new guild (interactive prompt if omitted)')
|
|
39
41
|
.option('--model <model>', 'Default model for anima sessions', DEFAULT_MODEL)
|
|
42
|
+
.option('--bundle <spec>', 'Bundle to install (npm specifier or local path)', DEFAULT_BUNDLE)
|
|
40
43
|
.action(async (pathArg, options) => {
|
|
41
44
|
let guildPath;
|
|
45
|
+
let guildName;
|
|
42
46
|
if (pathArg) {
|
|
43
47
|
guildPath = pathArg;
|
|
48
|
+
guildName = path.basename(path.resolve(pathArg));
|
|
44
49
|
}
|
|
45
50
|
else {
|
|
46
51
|
const name = await prompt('Guild name');
|
|
@@ -50,25 +55,38 @@ export function makeInitCommand() {
|
|
|
50
55
|
return;
|
|
51
56
|
}
|
|
52
57
|
guildPath = name;
|
|
58
|
+
guildName = name;
|
|
53
59
|
}
|
|
54
60
|
const model = options.model;
|
|
55
61
|
const home = path.resolve(guildPath);
|
|
56
62
|
try {
|
|
57
|
-
// 1. Create guild skeleton (
|
|
58
|
-
initGuild(home, model);
|
|
59
|
-
// 2.
|
|
60
|
-
const
|
|
61
|
-
|
|
63
|
+
// 1. Create guild skeleton (git repo, dirs, guild.json)
|
|
64
|
+
initGuild(home, guildName, model);
|
|
65
|
+
// 2. Fetch and install the starter kit bundle
|
|
66
|
+
const bundleDir = fetchBundle(home, options.bundle);
|
|
67
|
+
installBundle({ home, bundleDir, commit: false });
|
|
62
68
|
// 3. Create ledger via migration engine
|
|
63
69
|
applyMigrations(home);
|
|
70
|
+
// 4. Instantiate the advisor anima
|
|
71
|
+
instantiate({
|
|
72
|
+
home,
|
|
73
|
+
name: 'advisor',
|
|
74
|
+
roles: ['advisor'],
|
|
75
|
+
curriculum: 'guild-operations',
|
|
76
|
+
temperament: 'guide',
|
|
77
|
+
});
|
|
78
|
+
// 5. Commit everything from the bundle install + advisor
|
|
79
|
+
execFileSync('git', ['add', '-A'], { cwd: home, stdio: 'pipe' });
|
|
80
|
+
execFileSync('git', ['commit', '-m', 'Install starter kit'], { cwd: home, stdio: 'pipe' });
|
|
64
81
|
}
|
|
65
82
|
catch (err) {
|
|
66
83
|
console.error(`Error: ${err.message}`);
|
|
67
84
|
process.exitCode = 1;
|
|
68
85
|
return;
|
|
69
86
|
}
|
|
70
|
-
console.log(`Guild created at ${home}`);
|
|
71
|
-
console.log(`\n
|
|
87
|
+
console.log(`Guild "${guildName}" created at ${home}`);
|
|
88
|
+
console.log(`\n cd ${guildPath}`);
|
|
89
|
+
console.log(` nsg consult advisor # ask your guild advisor for help\n`);
|
|
72
90
|
});
|
|
73
91
|
}
|
|
74
92
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,MAAM,cAAc,GAAG,+BAA+B,CAAC;AAEvD,KAAK,UAAU,MAAM,CAAC,QAAgB,EAAE,YAAqB;IAC3D,MAAM,EAAE,GAAG,QAAQ,CAAC,eA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AC;YAElD,wCAAwC;YACxC,eAAe,CAAC,IAAI,CAAC,CAAC;YAEtB,mCAAmC;YACnC,WAAW,CAAC;gBACV,IAAI;gBACJ,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,CAAC,SAAS,CAAC;gBAClB,UAAU,EAAE,kBAAkB;gBAC9B,WAAW,EAAE,OAAO;aACrB,CAAC,CAAC;YAEH,yDAAyD;YACzD,YAAY,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YACjE,YAAY,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,qBAAqB,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7F,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,UAAU,SAAS,gBAAgB,IAAI,EAAE,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,UAAU,SAAS,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-tool.d.ts","sourceRoot":"","sources":["../../src/commands/install-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install-tool.d.ts","sourceRoot":"","sources":["../../src/commands/install-tool.ts"],"names":[],"mappings":"AA6BA,wBAAgB,sBAAsB;;;;;OA4CrC"}
|
|
@@ -1,23 +1,70 @@
|
|
|
1
1
|
import { createCommand } from 'commander';
|
|
2
|
-
import
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { execFileSync } from 'node:child_process';
|
|
5
|
+
import { installTool, installBundle, classifySource, isBundleDir } from '@shardworks/nexus-core';
|
|
6
|
+
import { resolveHome } from "../resolve-home.js";
|
|
7
|
+
/**
|
|
8
|
+
* For registry/git-url sources, npm-install the package (no-save) and check
|
|
9
|
+
* if it contains a bundle manifest. Returns the package dir if bundle, null otherwise.
|
|
10
|
+
*/
|
|
11
|
+
function detectBundle(home, source) {
|
|
12
|
+
const sourceKind = classifySource(source, false);
|
|
13
|
+
if (sourceKind !== 'registry' && sourceKind !== 'git-url')
|
|
14
|
+
return null;
|
|
15
|
+
execFileSync('npm', ['install', '--no-save', source], { cwd: home, stdio: 'pipe' });
|
|
16
|
+
// Resolve package name from specifier
|
|
17
|
+
let packageName = source;
|
|
18
|
+
if (packageName.startsWith('@') && packageName.lastIndexOf('@') > 0) {
|
|
19
|
+
packageName = packageName.substring(0, packageName.lastIndexOf('@'));
|
|
20
|
+
}
|
|
21
|
+
else if (packageName.includes('@') && !packageName.startsWith('@')) {
|
|
22
|
+
packageName = packageName.split('@')[0];
|
|
23
|
+
}
|
|
24
|
+
const packageDir = path.join(home, 'node_modules', packageName);
|
|
25
|
+
return isBundleDir(packageDir) ? packageDir : null;
|
|
26
|
+
}
|
|
3
27
|
export function makeInstallToolCommand() {
|
|
4
|
-
return createCommand('install
|
|
5
|
-
.description('Install an implement, engine, curriculum, or
|
|
6
|
-
.argument('<source>', 'Local directory
|
|
7
|
-
.option('--name <name>', 'Override the tool name (defaults to directory name)')
|
|
28
|
+
return createCommand('install')
|
|
29
|
+
.description('Install an implement, engine, curriculum, temperament, or bundle into the guild')
|
|
30
|
+
.argument('<source>', 'Local directory, npm package specifier, tarball path, or bundle')
|
|
31
|
+
.option('--name <name>', 'Override the tool name (defaults to package name or directory name)')
|
|
8
32
|
.option('--slot <slot>', 'Override the version slot (defaults to version from descriptor)')
|
|
9
33
|
.option('--roles <roles>', 'Comma-separated roles for implement access gating')
|
|
10
|
-
.
|
|
11
|
-
|
|
34
|
+
.option('--link', 'Symlink local directory instead of copying (for active development)')
|
|
35
|
+
.action((source, options, cmd) => {
|
|
36
|
+
const home = resolveHome(cmd);
|
|
12
37
|
const roles = options.roles?.split(',').map(r => r.trim()).filter(Boolean);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
38
|
+
try {
|
|
39
|
+
// Check if the source is a bundle (registry/git-url packages only)
|
|
40
|
+
if (!options.link) {
|
|
41
|
+
const bundleDir = detectBundle(home, source);
|
|
42
|
+
if (bundleDir) {
|
|
43
|
+
const result = installBundle({ home, bundleDir, bundleSource: source });
|
|
44
|
+
console.log(`Installed bundle "${source}" (${result.installed} artifacts)`);
|
|
45
|
+
for (const [category, names] of Object.entries(result.artifacts)) {
|
|
46
|
+
if (names.length > 0) {
|
|
47
|
+
console.log(` ${category}: ${names.join(', ')}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Not a bundle — install as a single tool
|
|
54
|
+
const result = installTool({
|
|
55
|
+
home,
|
|
56
|
+
source,
|
|
57
|
+
name: options.name,
|
|
58
|
+
slot: options.slot,
|
|
59
|
+
roles,
|
|
60
|
+
link: options.link,
|
|
61
|
+
});
|
|
62
|
+
console.log(`Installed ${result.category.slice(0, -1)} "${result.name}" at slot ${result.slot}`);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
console.error(`Error: ${err.message}`);
|
|
66
|
+
process.exitCode = 1;
|
|
67
|
+
}
|
|
21
68
|
});
|
|
22
69
|
}
|
|
23
70
|
//# sourceMappingURL=install-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-tool.js","sourceRoot":"","sources":["../../src/commands/install-tool.ts"],"names":[],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AAS,aAAa,CAAC,CAAC;oBAC5E,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;wBACjE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;4BACrB,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBACpD,CAAC;oBACH,CAAC;oBACD,OAAO;gBACT,CAAC;YACH,CAAC;YAED,0CAA0C;YAC1C,MAAM,MAAM,GAAG,WAAW,CAAC;gBACzB,IAAI;gBACJ,MAAM;gBACN,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK;gBACL,IAAI,EAAE,OAAO,CAAC,IAAI;aACnB,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,aAAa,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACnG,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instantiate.d.ts","sourceRoot":"","sources":["../../src/commands/instantiate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instantiate.d.ts","sourceRoot":"","sources":["../../src/commands/instantiate.ts"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB;;;;OAuCrC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { createCommand } from 'commander';
|
|
2
|
-
import {
|
|
2
|
+
import { instantiate } from '@shardworks/nexus-core';
|
|
3
|
+
import { resolveHome } from "../resolve-home.js";
|
|
3
4
|
export function makeInstantiateCommand() {
|
|
4
|
-
return createCommand('
|
|
5
|
+
return createCommand('create')
|
|
5
6
|
.description('Create a new anima in the guild')
|
|
6
7
|
.argument('<name>', 'Name for the new anima')
|
|
7
8
|
.requiredOption('--roles <roles>', 'Comma-separated roles (e.g. artificer,sage)')
|
|
8
9
|
.option('--curriculum <curriculum>', 'Curriculum to assign')
|
|
9
10
|
.option('--temperament <temperament>', 'Temperament to assign')
|
|
10
|
-
.action((name, options) => {
|
|
11
|
-
const home =
|
|
11
|
+
.action((name, options, cmd) => {
|
|
12
|
+
const home = resolveHome(cmd);
|
|
12
13
|
const roles = options.roles.split(',').map(r => r.trim()).filter(Boolean);
|
|
13
14
|
if (roles.length === 0) {
|
|
14
15
|
console.error('Error: at least one role is required');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instantiate.js","sourceRoot":"","sources":["../../src/commands/instantiate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"instantiate.js","sourceRoot":"","sources":["../../src/commands/instantiate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,sBAAsB;IACpC,OAAO,aAAa,CAAC,QAAQ,CAAC;SAC3B,WAAW,CAAC,iCAAiC,CAAC;SAC9C,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;SAC5C,cAAc,CAAC,iBAAiB,EAAE,6CAA6C,CAAC;SAChF,MAAM,CAAC,2BAA2B,EAAE,sBAAsB,CAAC;SAC3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C,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createCommand } from 'commander';
|
|
2
|
-
import { resolveNexusHome } from '@shardworks/nexus-core';
|
|
3
2
|
import { manifest } from '@shardworks/engine-manifest';
|
|
3
|
+
import { resolveHome } from "../resolve-home.js";
|
|
4
4
|
export function makeManifestCommand() {
|
|
5
5
|
return createCommand('manifest')
|
|
6
|
-
.description('
|
|
6
|
+
.description('Resolve an anima\'s composition and show session config')
|
|
7
7
|
.argument('<anima>', 'Anima name to manifest')
|
|
8
8
|
.option('--json', 'Output full session config as JSON')
|
|
9
|
-
.action(async (animaName, options) => {
|
|
10
|
-
const home =
|
|
9
|
+
.action(async (animaName, options, cmd) => {
|
|
10
|
+
const home = resolveHome(cmd);
|
|
11
11
|
try {
|
|
12
12
|
const result = await manifest(home, animaName);
|
|
13
13
|
if (options.json) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/commands/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/commands/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,mBAAmB;IACjC,OAAO,aAAa,CAAC,UAAU,CAAC;SAC7B,WAAW,CAAC,yDAAyD,CAAC;SACtE,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;SAC7C,MAAM,CAAC,QAAQ,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
+
import { createCommand } from 'commander';
|
|
2
|
+
import { rehydrate } from '@shardworks/nexus-core';
|
|
3
|
+
import { resolveHome } from "../resolve-home.js";
|
|
4
|
+
export function makeRehydrateCommand() {
|
|
5
|
+
return createCommand('rehydrate')
|
|
6
|
+
.description('Restore node_modules from git-tracked guild state (after fresh clone)')
|
|
7
|
+
.action((_options, cmd) => {
|
|
8
|
+
const home = resolveHome(cmd);
|
|
9
|
+
try {
|
|
10
|
+
const result = rehydrate(home);
|
|
11
|
+
if (result.fromPackageJson > 0) {
|
|
12
|
+
console.log(`Restored ${result.fromPackageJson} package(s) from package.json`);
|
|
13
|
+
}
|
|
14
|
+
for (const name of result.fromSlotSource) {
|
|
15
|
+
console.log(`Restored "${name}" from slot source`);
|
|
16
|
+
}
|
|
17
|
+
if (result.needsRelink.length > 0) {
|
|
18
|
+
console.log('\nThe following linked tools need manual re-linking:');
|
|
19
|
+
for (const name of result.needsRelink) {
|
|
20
|
+
console.log(` - ${name}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (result.fromPackageJson === 0 && result.fromSlotSource.length === 0 && result.needsRelink.length === 0) {
|
|
24
|
+
console.log('Nothing to rehydrate.');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
console.error(`Error: ${err.message}`);
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=rehydrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rehydrate.js","sourceRoot":"","sources":["../../src/commands/rehydrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,oBAAoB;IAClC,OAAO,aAAa,CA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,"file":"remove-tool.d.ts","sourceRoot":"","sources":["../../src/commands/remove-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-tool.d.ts","sourceRoot":"","sources":["../../src/commands/remove-tool.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB;;OAsBpC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { createCommand } from 'commander';
|
|
2
|
-
import {
|
|
2
|
+
import { removeTool } from '@shardworks/nexus-core';
|
|
3
|
+
import { resolveHome } from "../resolve-home.js";
|
|
3
4
|
export function makeRemoveToolCommand() {
|
|
4
|
-
return createCommand('remove
|
|
5
|
+
return createCommand('remove')
|
|
5
6
|
.description('Remove an implement, engine, curriculum, or temperament from the guild')
|
|
6
7
|
.argument('<name>', 'Name of the tool to remove')
|
|
7
8
|
.option('--type <type>', 'Restrict to a specific category (implements, engines, curricula, temperaments)')
|
|
8
|
-
.action((name, options) => {
|
|
9
|
-
const home =
|
|
9
|
+
.action((name, options, cmd) => {
|
|
10
|
+
const home = resolveHome(cmd);
|
|
10
11
|
const validTypes = ['implements', 'engines', 'curricula', 'temperaments'];
|
|
11
12
|
let category;
|
|
12
13
|
if (options.type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tool.js","sourceRoot":"","sources":["../../src/commands/remove-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"remove-tool.js","sourceRoot":"","sources":["../../src/commands/remove-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,qBAAqB;IACnC,OAAO,aAAa,CAAC,QAAQ,CAAC;SAC3B,WAAW,CAAC,wEAAwE,CAAC;SACrF,QAAQ,CAAC,QAAQ,EAAE,4BAA4B,CAAC;SAChD,MAAM,CAAC,eAAe,EAAE,gFAAgF,CAAC;SACzG,MAAM,CAAC,CAAC,IAAY,EAAE,OAA0B,EAAE,GAAG,EAAE,EAAE;QACxD,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,UAAU,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,CAAU,CAAC;QACnF,IAAI,QAA+C,CAAC;QAEpD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAiC,CAAC,EAAE,CAAC;gBACpE,OAAO,CAAC,KAAK,CAAC,iCAAiC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACxE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;gBACrB,OAAO;YACT,CAAC;YACD,QAAQ,GAAG,OAAO,CAAC,IAAiC,CAAC;QACvD,CAAC;QAED,MAAM,MAAM,GAAG,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,kBAAkB,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;IACvG,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/program.d.ts
CHANGED
package/dist/program.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,OAAO;;MAGkE,CAAC"}
|
package/dist/program.js
CHANGED
|
@@ -3,20 +3,30 @@ import { VERSION } from '@shardworks/nexus-core';
|
|
|
3
3
|
import { makeInitCommand } from "./commands/init.js";
|
|
4
4
|
import { makeInstallToolCommand } from "./commands/install-tool.js";
|
|
5
5
|
import { makeRemoveToolCommand } from "./commands/remove-tool.js";
|
|
6
|
+
import { makeRehydrateCommand } from "./commands/rehydrate.js";
|
|
6
7
|
import { makeDispatchCommand } from "./commands/dispatch.js";
|
|
7
|
-
import { makePublishCommand } from "./commands/publish.js";
|
|
8
8
|
import { makeInstantiateCommand } from "./commands/instantiate.js";
|
|
9
9
|
import { makeManifestCommand } from "./commands/manifest.js";
|
|
10
10
|
import { makeStatusCommand } from "./commands/status.js";
|
|
11
|
-
export const program = createCommand('
|
|
11
|
+
export const program = createCommand('nsg')
|
|
12
12
|
.description('Nexus Mk 2.1 — experimental multi-agent AI system')
|
|
13
|
-
.version(VERSION)
|
|
13
|
+
.version(VERSION)
|
|
14
|
+
.option('--guild-root <path>', 'Path to guild root (default: auto-detect from cwd)');
|
|
15
|
+
// ── Top-level commands ──────────────────────────────────────────────────
|
|
14
16
|
program.addCommand(makeInitCommand());
|
|
15
|
-
program.addCommand(makeInstallToolCommand());
|
|
16
|
-
program.addCommand(makeRemoveToolCommand());
|
|
17
17
|
program.addCommand(makeDispatchCommand());
|
|
18
|
-
program.addCommand(makePublishCommand());
|
|
19
|
-
program.addCommand(makeInstantiateCommand());
|
|
20
|
-
program.addCommand(makeManifestCommand());
|
|
21
18
|
program.addCommand(makeStatusCommand());
|
|
19
|
+
// ── nsg tool [install|remove|rehydrate] ─────────────────────────────────
|
|
20
|
+
const toolGroup = createCommand('tool')
|
|
21
|
+
.description('Manage guild tools (implements, engines, curricula, temperaments)');
|
|
22
|
+
toolGroup.addCommand(makeInstallToolCommand());
|
|
23
|
+
toolGroup.addCommand(makeRemoveToolCommand());
|
|
24
|
+
toolGroup.addCommand(makeRehydrateCommand());
|
|
25
|
+
program.addCommand(toolGroup);
|
|
26
|
+
// ── nsg anima [create|manifest] ─────────────────────────────────────────
|
|
27
|
+
const animaGroup = createCommand('anima')
|
|
28
|
+
.description('Manage animas');
|
|
29
|
+
animaGroup.addCommand(makeInstantiateCommand());
|
|
30
|
+
animaGroup.addCommand(makeManifestCommand());
|
|
31
|
+
program.addCommand(animaGroup);
|
|
22
32
|
//# sourceMappingURL=program.js.map
|
package/dist/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC;KACxC,WAAW,CAAC,mDAAmD,CAAC;KAChE,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CAAC,qBAAqB,EAAE,oDAAoD,CAAC,CAAC;AAEvF,2EAA2E;AAC3E,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;AACtC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAC1C,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAExC,2EAA2E;AAC3E,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC;KACpC,WAAW,CAAC,mEAAmE,CAAC,CAAC;AACpF,SAAS,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC;AAC/C,SAAS,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC;AAC9C,SAAS,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;AAC7C,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAE9B,2EAA2E;AAC3E,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC;KACtC,WAAW,CAAC,eAAe,CAAC,CAAC;AAChC,UAAU,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC;AAChD,UAAU,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAC7C,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Minimal interface for reading global options from any Commander command. */
|
|
2
|
+
interface CommandLike {
|
|
3
|
+
optsWithGlobals(): Record<string, unknown>;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the guild root from a command's parent options or auto-detection.
|
|
7
|
+
*
|
|
8
|
+
* Reads `--guild-root` from the root program's options. If not set, walks
|
|
9
|
+
* up from cwd looking for guild.json.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveHome(cmd: CommandLike): string;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=resolve-home.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-home.d.ts","sourceRoot":"","sources":["../src/resolve-home.ts"],"names":[],"mappings":"AAGA,+EAA+E;AAC/E,UAAU,WAAW;IACnB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAIpD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { findGuildRoot } from '@shardworks/nexus-core';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the guild root from a command's parent options or auto-detection.
|
|
5
|
+
*
|
|
6
|
+
* Reads `--guild-root` from the root program's options. If not set, walks
|
|
7
|
+
* up from cwd looking for guild.json.
|
|
8
|
+
*/
|
|
9
|
+
export function resolveHome(cmd) {
|
|
10
|
+
const rootOpts = cmd.optsWithGlobals();
|
|
11
|
+
if (rootOpts.guildRoot)
|
|
12
|
+
return path.resolve(rootOpts.guildRoot);
|
|
13
|
+
return findGuildRoot();
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=resolve-home.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-home.js","sourceRoot":"","sources":["../src/resolve-home.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAOvD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,GAAgB;IAC1C,MAAM,QAAQ,GAAG,GAAG,CAAC,eAAe,EAA4B,CAAC;IACjE,IAAI,QAAQ,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAChE,OAAO,aAAa,EAAE,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shardworks/nexus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"description": "Nexus Mk 2.1 — CLI for the guild system",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"bin": {
|
|
13
|
-
"nexus": "./dist/cli.js"
|
|
13
|
+
"nexus": "./dist/cli.js",
|
|
14
|
+
"nsg": "./dist/cli.js"
|
|
14
15
|
},
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
@@ -25,17 +26,16 @@
|
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"better-sqlite3": "12.8.0",
|
|
27
28
|
"commander": "14.0.3",
|
|
28
|
-
"@shardworks/nexus-core": "0.1.
|
|
29
|
-
"@shardworks/engine-ledger-migrate": "0.1.
|
|
30
|
-
"@shardworks/engine-manifest": "0.1.
|
|
31
|
-
"@shardworks/implement-install-tool": "0.1.
|
|
32
|
-
"@shardworks/implement-dispatch": "0.1.
|
|
33
|
-
"@shardworks/implement-
|
|
34
|
-
"@shardworks/implement-
|
|
35
|
-
"@shardworks/
|
|
36
|
-
"@shardworks/
|
|
37
|
-
"@shardworks/
|
|
38
|
-
"@shardworks/engine-worktree-setup": "0.1.4"
|
|
29
|
+
"@shardworks/nexus-core": "0.1.6",
|
|
30
|
+
"@shardworks/engine-ledger-migrate": "0.1.6",
|
|
31
|
+
"@shardworks/engine-manifest": "0.1.6",
|
|
32
|
+
"@shardworks/implement-install-tool": "0.1.6",
|
|
33
|
+
"@shardworks/implement-dispatch": "0.1.6",
|
|
34
|
+
"@shardworks/implement-instantiate": "0.1.6",
|
|
35
|
+
"@shardworks/implement-nexus-version": "0.1.6",
|
|
36
|
+
"@shardworks/engine-worktree-setup": "0.1.6",
|
|
37
|
+
"@shardworks/implement-remove-tool": "0.1.6",
|
|
38
|
+
"@shardworks/engine-mcp-server": "0.1.6"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@commander-js/extra-typings": "14.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB;;OAuBjC"}
|
package/dist/commands/publish.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createCommand } from 'commander';
|
|
2
|
-
import { resolveNexusHome, publish } from '@shardworks/nexus-core';
|
|
3
|
-
export function makePublishCommand() {
|
|
4
|
-
return createCommand('publish')
|
|
5
|
-
.description('Publish a completed commission')
|
|
6
|
-
.argument('<commissionId>', 'Commission ID to publish')
|
|
7
|
-
.option('--summary <summary>', 'Brief summary of what was accomplished')
|
|
8
|
-
.action((commissionIdStr, options) => {
|
|
9
|
-
const home = resolveNexusHome();
|
|
10
|
-
const commissionId = parseInt(commissionIdStr, 10);
|
|
11
|
-
if (isNaN(commissionId)) {
|
|
12
|
-
console.error('Error: commission ID must be a number');
|
|
13
|
-
process.exitCode = 1;
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
try {
|
|
17
|
-
const result = publish({ home, commissionId, summary: options.summary });
|
|
18
|
-
console.log(`Commission #${result.commissionId} published (was: ${result.previousStatus})`);
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
console.error(`Error: ${err.message}`);
|
|
22
|
-
process.exitCode = 1;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=publish.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src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