@shardworks/nexus-core 0.1.5 → 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/bundle.d.ts +111 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +438 -0
- package/dist/bundle.js.map +1 -0
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.d.ts.map +1 -1
- package/dist/guild-config.d.ts +9 -5
- package/dist/guild-config.d.ts.map +1 -1
- package/dist/guild-config.js +4 -5
- package/dist/guild-config.js.map +1 -1
- package/dist/implement.d.ts +2 -2
- package/dist/implement.d.ts.map +1 -1
- package/dist/implement.js +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/init-guild.d.ts +14 -11
- package/dist/init-guild.d.ts.map +1 -1
- package/dist/init-guild.js +29 -39
- package/dist/init-guild.js.map +1 -1
- package/dist/install-tool.d.ts +29 -26
- package/dist/install-tool.d.ts.map +1 -1
- package/dist/install-tool.js +185 -142
- package/dist/install-tool.js.map +1 -1
- package/dist/instantiate.d.ts +1 -1
- package/dist/instantiate.d.ts.map +1 -1
- package/dist/instantiate.js +6 -7
- package/dist/instantiate.js.map +1 -1
- package/dist/nexus-home.d.ts +15 -8
- package/dist/nexus-home.d.ts.map +1 -1
- package/dist/nexus-home.js +32 -17
- package/dist/nexus-home.js.map +1 -1
- package/dist/rehydrate.d.ts +15 -0
- package/dist/rehydrate.d.ts.map +1 -0
- package/dist/rehydrate.js +84 -0
- package/dist/rehydrate.js.map +1 -0
- package/dist/remove-tool.d.ts +0 -3
- package/dist/remove-tool.d.ts.map +1 -1
- package/dist/remove-tool.js +21 -40
- package/dist/remove-tool.js.map +1 -1
- package/package.json +1 -1
- package/dist/base-tools.d.ts +0 -27
- package/dist/base-tools.d.ts.map +0 -1
- package/dist/base-tools.js +0 -30
- package/dist/base-tools.js.map +0 -1
- package/dist/bootstrap.d.ts +0 -14
- package/dist/bootstrap.d.ts.map +0 -1
- package/dist/bootstrap.js +0 -46
- package/dist/bootstrap.js.map +0 -1
- package/dist/publish.d.ts +0 -20
- package/dist/publish.d.ts.map +0 -1
- package/dist/publish.js +0 -41
- package/dist/publish.js.map +0 -1
package/dist/nexus-home.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexus-home.d.ts","sourceRoot":"","sources":["../src/nexus-home.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nexus-home.d.ts","sourceRoot":"","sources":["../src/nexus-home.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAYvD;AAED,sDAAsD;AACtD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,gDAAgD;AAChD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnE"}
|
package/dist/nexus-home.js
CHANGED
|
@@ -1,29 +1,44 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
4
|
+
* Find the guild root by walking up from a starting directory looking for guild.json.
|
|
5
|
+
*
|
|
6
|
+
* This replaces the old NEXUS_HOME env var approach. The guild root IS the
|
|
7
|
+
* guildhall — a regular git clone with guild.json at the root.
|
|
8
|
+
*
|
|
9
|
+
* @param startDir - Directory to start searching from (defaults to cwd).
|
|
10
|
+
* @throws If no guild.json is found before reaching the filesystem root.
|
|
5
11
|
*/
|
|
6
|
-
export function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
export function findGuildRoot(startDir) {
|
|
13
|
+
let dir = path.resolve(startDir ?? process.cwd());
|
|
14
|
+
while (true) {
|
|
15
|
+
if (fs.existsSync(path.join(dir, 'guild.json')))
|
|
16
|
+
return dir;
|
|
17
|
+
const parent = path.dirname(dir);
|
|
18
|
+
if (parent === dir) {
|
|
19
|
+
throw new Error('Not inside a guild. Run `nexus init` to create one, or use --guild-root.');
|
|
20
|
+
}
|
|
21
|
+
dir = parent;
|
|
10
22
|
}
|
|
11
|
-
return path.resolve(home);
|
|
12
23
|
}
|
|
13
|
-
/** Path to the
|
|
14
|
-
export function
|
|
15
|
-
return path.join(home, '
|
|
16
|
-
}
|
|
17
|
-
/** Path to the guildhall's standing worktree (`worktrees/guildhall/main`). */
|
|
18
|
-
export function guildhallWorktreePath(home) {
|
|
19
|
-
return path.join(home, 'worktrees', 'guildhall', 'main');
|
|
24
|
+
/** Path to the .nexus framework-managed directory. */
|
|
25
|
+
export function nexusDir(home) {
|
|
26
|
+
return path.join(home, '.nexus');
|
|
20
27
|
}
|
|
21
28
|
/** Path to the Ledger SQLite database. */
|
|
22
29
|
export function ledgerPath(home) {
|
|
23
|
-
return path.join(home, 'nexus.db');
|
|
30
|
+
return path.join(home, '.nexus', 'nexus.db');
|
|
24
31
|
}
|
|
25
|
-
/** Path to the top-level worktrees directory. */
|
|
32
|
+
/** Path to the top-level worktrees directory (for commission worktrees). */
|
|
26
33
|
export function worktreesPath(home) {
|
|
27
|
-
return path.join(home, 'worktrees');
|
|
34
|
+
return path.join(home, '.nexus', 'worktrees');
|
|
35
|
+
}
|
|
36
|
+
/** Path to the workshops directory (contains bare clones). */
|
|
37
|
+
export function workshopsPath(home) {
|
|
38
|
+
return path.join(home, '.nexus', 'workshops');
|
|
39
|
+
}
|
|
40
|
+
/** Path to a specific workshop's bare clone. */
|
|
41
|
+
export function workshopBarePath(home, name) {
|
|
42
|
+
return path.join(home, '.nexus', 'workshops', `${name}.git`);
|
|
28
43
|
}
|
|
29
44
|
//# sourceMappingURL=nexus-home.js.map
|
package/dist/nexus-home.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexus-home.js","sourceRoot":"","sources":["../src/nexus-home.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B
|
|
1
|
+
{"version":3,"file":"nexus-home.js","sourceRoot":"","sources":["../src/nexus-home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,QAAiB;IAC7C,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAClD,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAC;QACJ,CAAC;QACD,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAC/C,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAChD,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAChD,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,IAAY;IACzD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface RehydrateResult {
|
|
2
|
+
/** Tools restored from package.json (registry/git-url). */
|
|
3
|
+
fromPackageJson: number;
|
|
4
|
+
/** Tools restored from slot source (workshop/tarball). */
|
|
5
|
+
fromSlotSource: string[];
|
|
6
|
+
/** Tools that need manual re-linking. */
|
|
7
|
+
needsRelink: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Rehydrate a guild's node_modules from tracked state.
|
|
11
|
+
*
|
|
12
|
+
* Idempotent and safe to run at any time.
|
|
13
|
+
*/
|
|
14
|
+
export declare function rehydrate(home: string): RehydrateResult;
|
|
15
|
+
//# sourceMappingURL=rehydrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rehydrate.d.ts","sourceRoot":"","sources":["../src/rehydrate.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,yCAAyC;IACzC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CA8DvD"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rehydrate — reconstruct node_modules from git-tracked guild state.
|
|
3
|
+
*
|
|
4
|
+
* After a fresh clone, the guild's node_modules is empty. This function:
|
|
5
|
+
* 1. Runs `npm install` to resolve registry/git-url deps from package.json
|
|
6
|
+
* 2. For each tool with full source in its slot (workshop/tarball), runs
|
|
7
|
+
* `npm install --no-save <slot-path>` to install from the tracked source
|
|
8
|
+
* 3. Reports any linked tools that need to be re-linked manually
|
|
9
|
+
*/
|
|
10
|
+
import fs from 'node:fs';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
import { execFileSync } from 'node:child_process';
|
|
13
|
+
import { readGuildConfig } from "./guild-config.js";
|
|
14
|
+
/** Map category -> on-disk parent directory (relative to guild root). */
|
|
15
|
+
const DIR_MAP = {
|
|
16
|
+
implements: 'implements',
|
|
17
|
+
engines: 'engines',
|
|
18
|
+
curricula: 'training/curricula',
|
|
19
|
+
temperaments: 'training/temperaments',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Rehydrate a guild's node_modules from tracked state.
|
|
23
|
+
*
|
|
24
|
+
* Idempotent and safe to run at any time.
|
|
25
|
+
*/
|
|
26
|
+
export function rehydrate(home) {
|
|
27
|
+
const result = {
|
|
28
|
+
fromPackageJson: 0,
|
|
29
|
+
fromSlotSource: [],
|
|
30
|
+
needsRelink: [],
|
|
31
|
+
};
|
|
32
|
+
// 1. Run npm install to resolve registry/git-url deps from package.json
|
|
33
|
+
const pkgPath = path.join(home, 'package.json');
|
|
34
|
+
if (fs.existsSync(pkgPath)) {
|
|
35
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
36
|
+
const depCount = Object.keys(pkg.dependencies ?? {}).length;
|
|
37
|
+
if (depCount > 0) {
|
|
38
|
+
execFileSync('npm', ['install'], { cwd: home, stdio: 'pipe' });
|
|
39
|
+
result.fromPackageJson = depCount;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// 2. Scan guild.json for tools that have full source in their slot
|
|
43
|
+
const config = readGuildConfig(home);
|
|
44
|
+
for (const [category, registry] of Object.entries({
|
|
45
|
+
implements: config.implements,
|
|
46
|
+
engines: config.engines,
|
|
47
|
+
})) {
|
|
48
|
+
for (const [name, entry] of Object.entries(registry)) {
|
|
49
|
+
const toolEntry = entry;
|
|
50
|
+
const upstream = toolEntry.upstream;
|
|
51
|
+
const parentDir = DIR_MAP[category];
|
|
52
|
+
const slotDir = path.join(home, parentDir, name, toolEntry.slot);
|
|
53
|
+
// Check if this is a workshop/tarball tool with full source in slot
|
|
54
|
+
if (upstream === null || (upstream && upstream.startsWith('workshop:'))) {
|
|
55
|
+
// Check if slot has a package.json (indicating full source)
|
|
56
|
+
const slotPkgPath = path.join(slotDir, 'package.json');
|
|
57
|
+
if (fs.existsSync(slotPkgPath)) {
|
|
58
|
+
// Install from slot source
|
|
59
|
+
try {
|
|
60
|
+
execFileSync('npm', ['install', '--no-save', slotDir], {
|
|
61
|
+
cwd: home,
|
|
62
|
+
stdio: 'pipe',
|
|
63
|
+
});
|
|
64
|
+
result.fromSlotSource.push(name);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// If install fails, the tool may need manual intervention
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Check if this was a linked tool (no upstream, no full source in slot,
|
|
72
|
+
// but has a package field in the descriptor)
|
|
73
|
+
if (upstream === null) {
|
|
74
|
+
const hasFullSource = fs.existsSync(path.join(slotDir, 'package.json'));
|
|
75
|
+
if (!hasFullSource) {
|
|
76
|
+
// This was likely a linked tool — needs manual re-linking
|
|
77
|
+
result.needsRelink.push(name);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return result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H,CAAC;YACH,CAAC;YAED,wEAAwE;YACxE,6CAA6C;YAC7C,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtB,MAAM,aAAa,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;gBACxE,IAAI,CAAC,aAAa,EAAE,CAAC;oBACnB,0DAA0D;oBAC1D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/remove-tool.d.ts
CHANGED
|
@@ -15,9 +15,6 @@ export interface RemoveResult {
|
|
|
15
15
|
*
|
|
16
16
|
* For npm-installed tools, also runs `npm uninstall` to clean up node_modules.
|
|
17
17
|
* For linked tools, removes the symlink from node_modules.
|
|
18
|
-
*
|
|
19
|
-
* Only guild-managed tools can be removed. Framework (nexus) tools are managed
|
|
20
|
-
* by `nexus repair` / `nexus install`.
|
|
21
18
|
*/
|
|
22
19
|
export declare function removeTool(opts: RemoveToolOptions): RemoveResult;
|
|
23
20
|
//# sourceMappingURL=remove-tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tool.d.ts","sourceRoot":"","sources":["../src/remove-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-tool.d.ts","sourceRoot":"","sources":["../src/remove-tool.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,CAAC;CACpE;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,CAAC;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAcD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,YAAY,CA0EhE"}
|
package/dist/remove-tool.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { execFileSync } from 'node:child_process';
|
|
4
|
-
import { guildhallWorktreePath } from "./nexus-home.js";
|
|
5
4
|
import { readGuildConfig, writeGuildConfig } from "./guild-config.js";
|
|
6
5
|
const DIR_MAP = {
|
|
7
6
|
implements: 'implements',
|
|
@@ -15,41 +14,20 @@ function git(args, cwd) {
|
|
|
15
14
|
execFileSync('git', args, { cwd, stdio: 'pipe' });
|
|
16
15
|
}
|
|
17
16
|
/**
|
|
18
|
-
* Read a
|
|
17
|
+
* Read the npm package name from a tool's guild.json entry.
|
|
18
|
+
* Returns null if the tool has no package field (e.g. script-only tools).
|
|
19
19
|
*/
|
|
20
|
-
function
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Determine the npm package name for a tool from its slot descriptor's `package` field.
|
|
25
|
-
* Returns null if the tool was not npm-installed.
|
|
26
|
-
*/
|
|
27
|
-
function getPackageName(worktree, category, name, slot) {
|
|
28
|
-
const parentDir = DIR_MAP[category];
|
|
29
|
-
const slotDir = path.join(worktree, parentDir, name, slot);
|
|
30
|
-
// Check all possible descriptor files
|
|
31
|
-
const descriptorFiles = ['nexus-implement.json', 'nexus-engine.json', 'nexus-curriculum.json', 'nexus-temperament.json'];
|
|
32
|
-
for (const descriptorFile of descriptorFiles) {
|
|
33
|
-
const descriptorPath = path.join(slotDir, descriptorFile);
|
|
34
|
-
if (fs.existsSync(descriptorPath)) {
|
|
35
|
-
const descriptor = readJson(descriptorPath);
|
|
36
|
-
return descriptor['package'] ?? null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
20
|
+
function getPackageName(entry) {
|
|
21
|
+
return entry['package'] ?? null;
|
|
40
22
|
}
|
|
41
23
|
/**
|
|
42
24
|
* Remove a tool from the guild — deregister from guild.json and delete from disk.
|
|
43
25
|
*
|
|
44
26
|
* For npm-installed tools, also runs `npm uninstall` to clean up node_modules.
|
|
45
27
|
* For linked tools, removes the symlink from node_modules.
|
|
46
|
-
*
|
|
47
|
-
* Only guild-managed tools can be removed. Framework (nexus) tools are managed
|
|
48
|
-
* by `nexus repair` / `nexus install`.
|
|
49
28
|
*/
|
|
50
29
|
export function removeTool(opts) {
|
|
51
30
|
const { home, name } = opts;
|
|
52
|
-
const worktree = guildhallWorktreePath(home);
|
|
53
31
|
const config = readGuildConfig(home);
|
|
54
32
|
// Find the tool in guild.json
|
|
55
33
|
const searchIn = opts.category ? [opts.category] : REGISTRIES;
|
|
@@ -65,38 +43,41 @@ export function removeTool(opts) {
|
|
|
65
43
|
}
|
|
66
44
|
const entry = config[foundCategory][name];
|
|
67
45
|
const slot = 'slot' in entry ? entry.slot : '';
|
|
68
|
-
// Prevent removal of framework tools
|
|
69
|
-
if ('source' in entry && entry.source === 'nexus') {
|
|
70
|
-
throw new Error(`"${name}" is a framework tool (source: nexus). Use "nexus repair" to manage framework tools.`);
|
|
71
|
-
}
|
|
72
46
|
// Clean up npm-installed packages from node_modules
|
|
73
|
-
const packageName = getPackageName(
|
|
47
|
+
const packageName = getPackageName(entry);
|
|
48
|
+
const upstream = 'upstream' in entry ? entry.upstream : null;
|
|
74
49
|
if (packageName) {
|
|
75
|
-
const linkPath = path.join(
|
|
50
|
+
const linkPath = path.join(home, 'node_modules', packageName);
|
|
76
51
|
if (fs.existsSync(linkPath) && fs.lstatSync(linkPath).isSymbolicLink()) {
|
|
77
52
|
// Linked tool: just remove the symlink
|
|
78
53
|
fs.unlinkSync(linkPath);
|
|
79
54
|
// Clean up empty scoped directory if needed
|
|
80
55
|
const scopeDir = path.dirname(linkPath);
|
|
81
|
-
if (scopeDir !== path.join(
|
|
56
|
+
if (scopeDir !== path.join(home, 'node_modules') &&
|
|
82
57
|
fs.existsSync(scopeDir) && fs.readdirSync(scopeDir).length === 0) {
|
|
83
58
|
fs.rmdirSync(scopeDir);
|
|
84
59
|
}
|
|
85
60
|
}
|
|
86
|
-
else {
|
|
87
|
-
//
|
|
61
|
+
else if (upstream && !upstream.startsWith('workshop:')) {
|
|
62
|
+
// Registry/git-url tool saved to package.json: use npm uninstall
|
|
88
63
|
try {
|
|
89
|
-
execFileSync('npm', ['uninstall', packageName], { cwd:
|
|
64
|
+
execFileSync('npm', ['uninstall', packageName], { cwd: home, stdio: 'pipe' });
|
|
90
65
|
}
|
|
91
66
|
catch {
|
|
92
67
|
// If npm uninstall fails (e.g. package already gone), continue with cleanup
|
|
93
68
|
}
|
|
94
69
|
}
|
|
70
|
+
else {
|
|
71
|
+
// Workshop/tarball tool (not in package.json): remove from node_modules manually
|
|
72
|
+
if (fs.existsSync(linkPath)) {
|
|
73
|
+
fs.rmSync(linkPath, { recursive: true });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
95
76
|
}
|
|
96
77
|
// Remove on-disk directory (the specific slot)
|
|
97
78
|
const parentDir = DIR_MAP[foundCategory];
|
|
98
|
-
const toolDir = path.join(
|
|
99
|
-
const toolParent = path.join(
|
|
79
|
+
const toolDir = path.join(home, parentDir, name, slot);
|
|
80
|
+
const toolParent = path.join(home, parentDir, name);
|
|
100
81
|
if (fs.existsSync(toolDir)) {
|
|
101
82
|
fs.rmSync(toolDir, { recursive: true });
|
|
102
83
|
}
|
|
@@ -108,8 +89,8 @@ export function removeTool(opts) {
|
|
|
108
89
|
delete config[foundCategory][name];
|
|
109
90
|
writeGuildConfig(home, config);
|
|
110
91
|
// Commit
|
|
111
|
-
git(['add', '-A'],
|
|
112
|
-
git(['commit', '-m', `Remove ${foundCategory.slice(0, -1)} ${name}`],
|
|
92
|
+
git(['add', '-A'], home);
|
|
93
|
+
git(['commit', '-m', `Remove ${foundCategory.slice(0, -1)} ${name}`], home);
|
|
113
94
|
return { category: foundCategory, name, slot, removedFrom: toolDir };
|
|
114
95
|
}
|
|
115
96
|
//# sourceMappingURL=remove-tool.js.map
|
package/dist/remove-tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tool.js","sourceRoot":"","sources":["../src/remove-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"remove-tool.js","sourceRoot":"","sources":["../src/remove-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,MAAM,OAAO,GAA2B;IACtC,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,oBAAoB;IAC/B,YAAY,EAAE,uBAAuB;CACtC,CAAC;AAEF,4EAA4E;AAC5E,MAAM,UAAU,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,CAAU,CAAC;AAgBnF,SAAS,GAAG,CAAC,IAAc,EAAE,GAAW;IACtC,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,KAA8B;IACpD,OAAQ,KAAK,CAAC,SAAS,CAAY,IAAI,IAAI,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAA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,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,gDAAgD;IAChD,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,6BAA6B;IAC7B,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC;IACnC,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE/B,SAAS;IACT,GAAG,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACzB,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAE5E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AACvE,CAAC"}
|
package/package.json
CHANGED
package/dist/base-tools.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base tools — the framework implements and engines that ship with Nexus.
|
|
3
|
-
*
|
|
4
|
-
* Each entry maps a tool name to the workspace package that contains it.
|
|
5
|
-
* The actual descriptors and instructions live in the packages themselves
|
|
6
|
-
* (nexus-implement.json / nexus-engine.json / instructions.md).
|
|
7
|
-
*
|
|
8
|
-
* During `nexus init`, these are installed into the guildhall via
|
|
9
|
-
* `installTool({ framework: true })` — the same code path used for all
|
|
10
|
-
* tool installation.
|
|
11
|
-
*/
|
|
12
|
-
/** Reference to a framework tool package. */
|
|
13
|
-
export interface BaseToolRef {
|
|
14
|
-
/** Tool name — becomes the directory name in nexus/{implements,engines}/. */
|
|
15
|
-
name: string;
|
|
16
|
-
/** Workspace package that contains the tool. */
|
|
17
|
-
packageName: string;
|
|
18
|
-
/** Roles for implements (omit for engines or all-role implements). */
|
|
19
|
-
roles?: string[];
|
|
20
|
-
}
|
|
21
|
-
/** Base implements that ship with the framework. */
|
|
22
|
-
export declare const BASE_IMPLEMENTS: BaseToolRef[];
|
|
23
|
-
/** Base engines that ship with the framework. */
|
|
24
|
-
export declare const BASE_ENGINES: BaseToolRef[];
|
|
25
|
-
/** All base tools (implements + engines). */
|
|
26
|
-
export declare const BASE_TOOLS: BaseToolRef[];
|
|
27
|
-
//# sourceMappingURL=base-tools.d.ts.map
|
package/dist/base-tools.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-tools.d.ts","sourceRoot":"","sources":["../src/base-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,6CAA6C;AAC7C,MAAM,WAAW,WAAW;IAC1B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,oDAAoD;AACpD,eAAO,MAAM,eAAe,EAAE,WAAW,EAOxC,CAAC;AAEF,iDAAiD;AACjD,eAAO,MAAM,YAAY,EAAE,WAAW,EAKrC,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,UAAU,EAAE,WAAW,EAA0C,CAAC"}
|
package/dist/base-tools.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base tools — the framework implements and engines that ship with Nexus.
|
|
3
|
-
*
|
|
4
|
-
* Each entry maps a tool name to the workspace package that contains it.
|
|
5
|
-
* The actual descriptors and instructions live in the packages themselves
|
|
6
|
-
* (nexus-implement.json / nexus-engine.json / instructions.md).
|
|
7
|
-
*
|
|
8
|
-
* During `nexus init`, these are installed into the guildhall via
|
|
9
|
-
* `installTool({ framework: true })` — the same code path used for all
|
|
10
|
-
* tool installation.
|
|
11
|
-
*/
|
|
12
|
-
/** Base implements that ship with the framework. */
|
|
13
|
-
export const BASE_IMPLEMENTS = [
|
|
14
|
-
{ name: 'install-tool', packageName: '@shardworks/implement-install-tool' },
|
|
15
|
-
{ name: 'remove-tool', packageName: '@shardworks/implement-remove-tool' },
|
|
16
|
-
{ name: 'dispatch', packageName: '@shardworks/implement-dispatch' },
|
|
17
|
-
{ name: 'instantiate', packageName: '@shardworks/implement-instantiate' },
|
|
18
|
-
{ name: 'publish', packageName: '@shardworks/implement-publish' },
|
|
19
|
-
{ name: 'nexus-version', packageName: '@shardworks/implement-nexus-version' },
|
|
20
|
-
];
|
|
21
|
-
/** Base engines that ship with the framework. */
|
|
22
|
-
export const BASE_ENGINES = [
|
|
23
|
-
{ name: 'manifest', packageName: '@shardworks/engine-manifest' },
|
|
24
|
-
{ name: 'mcp-server', packageName: '@shardworks/engine-mcp-server' },
|
|
25
|
-
{ name: 'worktree-setup', packageName: '@shardworks/engine-worktree-setup' },
|
|
26
|
-
{ name: 'ledger-migrate', packageName: '@shardworks/engine-ledger-migrate' },
|
|
27
|
-
];
|
|
28
|
-
/** All base tools (implements + engines). */
|
|
29
|
-
export const BASE_TOOLS = [...BASE_IMPLEMENTS, ...BASE_ENGINES];
|
|
30
|
-
//# sourceMappingURL=base-tools.js.map
|
package/dist/base-tools.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-tools.js","sourceRoot":"","sources":["../src/base-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,oDAAoD;AACpD,MAAM,CAAC,MAAM,eAAe,GAAkB;IAC5C,EAAE,IAAI,EAAE,cAAc,EAAK,WAAW,EAAE,oCAAoC,EAAE;IAC9E,EAAE,IAAI,EAAE,aAAa,EAAM,WAAW,EAAE,mCAAmC,EAAE;IAC7E,EAAE,IAAI,EAAE,UAAU,EAAS,WAAW,EAAE,gCAAgC,EAAE;IAC1E,EAAE,IAAI,EAAE,aAAa,EAAM,WAAW,EAAE,mCAAmC,EAAE;IAC7E,EAAE,IAAI,EAAE,SAAS,EAAU,WAAW,EAAE,+BAA+B,EAAE;IACzE,EAAE,IAAI,EAAE,eAAe,EAAI,WAAW,EAAE,qCAAqC,EAAE;CAChF,CAAC;AAEF,iDAAiD;AACjD,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC,EAAE,IAAI,EAAE,UAAU,EAAS,WAAW,EAAE,6BAA6B,EAAE;IACvE,EAAE,IAAI,EAAE,YAAY,EAAO,WAAW,EAAE,+BAA+B,EAAE;IACzE,EAAE,IAAI,EAAE,gBAAgB,EAAG,WAAW,EAAE,mCAAmC,EAAE;IAC7E,EAAE,IAAI,EAAE,gBAAgB,EAAG,WAAW,EAAE,mCAAmC,EAAE;CAC9E,CAAC;AAEF,6CAA6C;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAkB,CAAC,GAAG,eAAe,EAAE,GAAG,YAAY,CAAC,CAAC"}
|
package/dist/bootstrap.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Install all framework base tools into a freshly-initialized guild.
|
|
3
|
-
*
|
|
4
|
-
* Uses `installTool({ framework: true })` for every base implement and engine —
|
|
5
|
-
* the same code path used for all tool installation. Individual installs do not
|
|
6
|
-
* commit; a single "Bootstrap base tools" commit is created at the end.
|
|
7
|
-
*
|
|
8
|
-
* @param home - Absolute path to NEXUS_HOME.
|
|
9
|
-
* @param resolvePackage - Resolves a package name to its root directory on disk.
|
|
10
|
-
* The caller owns resolution because it depends on the runtime module system
|
|
11
|
-
* (workspace links, node_modules layout, etc.) which varies by context.
|
|
12
|
-
*/
|
|
13
|
-
export declare function bootstrapBaseTools(home: string, resolvePackage: (packageName: string) => string): void;
|
|
14
|
-
//# sourceMappingURL=bootstrap.d.ts.map
|
package/dist/bootstrap.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,GAC9C,IAAI,CA8BN"}
|
package/dist/bootstrap.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { execFileSync } from 'node:child_process';
|
|
2
|
-
import { guildhallWorktreePath } from "./nexus-home.js";
|
|
3
|
-
import { installTool } from "./install-tool.js";
|
|
4
|
-
import { BASE_IMPLEMENTS, BASE_ENGINES } from "./base-tools.js";
|
|
5
|
-
/**
|
|
6
|
-
* Install all framework base tools into a freshly-initialized guild.
|
|
7
|
-
*
|
|
8
|
-
* Uses `installTool({ framework: true })` for every base implement and engine —
|
|
9
|
-
* the same code path used for all tool installation. Individual installs do not
|
|
10
|
-
* commit; a single "Bootstrap base tools" commit is created at the end.
|
|
11
|
-
*
|
|
12
|
-
* @param home - Absolute path to NEXUS_HOME.
|
|
13
|
-
* @param resolvePackage - Resolves a package name to its root directory on disk.
|
|
14
|
-
* The caller owns resolution because it depends on the runtime module system
|
|
15
|
-
* (workspace links, node_modules layout, etc.) which varies by context.
|
|
16
|
-
*/
|
|
17
|
-
export function bootstrapBaseTools(home, resolvePackage) {
|
|
18
|
-
// Install base implements
|
|
19
|
-
for (const ref of BASE_IMPLEMENTS) {
|
|
20
|
-
const sourceDir = resolvePackage(ref.packageName);
|
|
21
|
-
installTool({
|
|
22
|
-
home,
|
|
23
|
-
source: sourceDir,
|
|
24
|
-
name: ref.name,
|
|
25
|
-
roles: ref.roles ?? ['*'],
|
|
26
|
-
framework: true,
|
|
27
|
-
commit: false,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
// Install base engines
|
|
31
|
-
for (const ref of BASE_ENGINES) {
|
|
32
|
-
const sourceDir = resolvePackage(ref.packageName);
|
|
33
|
-
installTool({
|
|
34
|
-
home,
|
|
35
|
-
source: sourceDir,
|
|
36
|
-
name: ref.name,
|
|
37
|
-
framework: true,
|
|
38
|
-
commit: false,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
// Single commit for all bootstrap installs
|
|
42
|
-
const worktree = guildhallWorktreePath(home);
|
|
43
|
-
execFileSync('git', ['add', '-A'], { cwd: worktree, stdio: 'pipe' });
|
|
44
|
-
execFileSync('git', ['commit', '-m', 'Bootstrap base tools'], { cwd: worktree, stdio: 'pipe' });
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=bootstrap.js.map
|
package/dist/bootstrap.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAY,EACZ,cAA+C;IAE/C,0BAA0B;IAC1B,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QAClC,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAClD,WAAW,CAAC;YACV,IAAI;YACJ,MAAM,EAAE,SAAS;YACjB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC;YACzB,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAED,uBAAuB;IACvB,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAClD,WAAW,CAAC;YACV,IAAI;YACJ,MAAM,EAAE,SAAS;YACjB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAED,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC7C,YAAY,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACrE,YAAY,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,sBAAsB,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AAClG,CAAC"}
|
package/dist/publish.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface PublishOptions {
|
|
2
|
-
/** Absolute path to NEXUS_HOME. */
|
|
3
|
-
home: string;
|
|
4
|
-
/** Commission ID to publish. */
|
|
5
|
-
commissionId: number;
|
|
6
|
-
/** Brief summary of what was accomplished. */
|
|
7
|
-
summary?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface PublishResult {
|
|
10
|
-
commissionId: number;
|
|
11
|
-
previousStatus: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Publish a completed commission.
|
|
15
|
-
*
|
|
16
|
-
* Validates the commission exists and is in an assignable state (assigned or
|
|
17
|
-
* in_progress), then marks it as completed. Records the event in the audit log.
|
|
18
|
-
*/
|
|
19
|
-
export declare function publish(opts: PublishOptions): PublishResult;
|
|
20
|
-
//# sourceMappingURL=publish.d.ts.map
|
package/dist/publish.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,aAAa,CA8C3D"}
|
package/dist/publish.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* publish — core logic for completing commissions.
|
|
3
|
-
*
|
|
4
|
-
* Marks a commission as completed in the Ledger. The publish implement
|
|
5
|
-
* and CLI both call this function.
|
|
6
|
-
*/
|
|
7
|
-
import Database from 'better-sqlite3';
|
|
8
|
-
import { ledgerPath } from "./nexus-home.js";
|
|
9
|
-
/**
|
|
10
|
-
* Publish a completed commission.
|
|
11
|
-
*
|
|
12
|
-
* Validates the commission exists and is in an assignable state (assigned or
|
|
13
|
-
* in_progress), then marks it as completed. Records the event in the audit log.
|
|
14
|
-
*/
|
|
15
|
-
export function publish(opts) {
|
|
16
|
-
const { home, commissionId, summary } = opts;
|
|
17
|
-
const db = new Database(ledgerPath(home));
|
|
18
|
-
db.pragma('foreign_keys = ON');
|
|
19
|
-
try {
|
|
20
|
-
// Read current commission state
|
|
21
|
-
const commission = db.prepare(`SELECT id, status FROM commissions WHERE id = ?`).get(commissionId);
|
|
22
|
-
if (!commission) {
|
|
23
|
-
throw new Error(`Commission ${commissionId} not found in the Ledger.`);
|
|
24
|
-
}
|
|
25
|
-
const completableStatuses = ['assigned', 'in_progress'];
|
|
26
|
-
if (!completableStatuses.includes(commission.status)) {
|
|
27
|
-
throw new Error(`Commission ${commissionId} cannot be published — current status is "${commission.status}". ` +
|
|
28
|
-
`Must be one of: ${completableStatuses.join(', ')}.`);
|
|
29
|
-
}
|
|
30
|
-
const previousStatus = commission.status;
|
|
31
|
-
// Mark as completed
|
|
32
|
-
db.prepare(`UPDATE commissions SET status = 'completed', updated_at = datetime('now') WHERE id = ?`).run(commissionId);
|
|
33
|
-
// Audit log
|
|
34
|
-
db.prepare(`INSERT INTO audit_log (actor, action, target_type, target_id, detail) VALUES (?, ?, ?, ?, ?)`).run('publish', 'commission_published', 'commission', commissionId, JSON.stringify({ previousStatus, summary: summary ?? null }));
|
|
35
|
-
return { commissionId, previousStatus };
|
|
36
|
-
}
|
|
37
|
-
finally {
|
|
38
|
-
db.close();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=publish.js.map
|
package/dist/publish.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAgB7C;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,IAAoB;IAC1C,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAE7C,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAE/B,IAAI,CAAC;QACH,gCAAgC;QAChC,MAAM,UAAU,GAAG,EAAE,CAAC,OAAO,CAC3B,iDAAiD,CAClD,CAAC,GAAG,CAAC,YAAY,CAA+C,CAAC;QAElE,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,cAAc,YAAY,2BAA2B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