@shardworks/nexus-core 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.
Files changed (54) hide show
  1. package/dist/bundle.d.ts +111 -0
  2. package/dist/bundle.d.ts.map +1 -0
  3. package/dist/bundle.js +438 -0
  4. package/dist/bundle.js.map +1 -0
  5. package/dist/dispatch.d.ts +1 -1
  6. package/dist/dispatch.d.ts.map +1 -1
  7. package/dist/guild-config.d.ts +12 -6
  8. package/dist/guild-config.d.ts.map +1 -1
  9. package/dist/guild-config.js +6 -6
  10. package/dist/guild-config.js.map +1 -1
  11. package/dist/implement.d.ts +2 -2
  12. package/dist/implement.d.ts.map +1 -1
  13. package/dist/implement.js +1 -1
  14. package/dist/index.d.ts +6 -7
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +9 -7
  17. package/dist/index.js.map +1 -1
  18. package/dist/init-guild.d.ts +15 -11
  19. package/dist/init-guild.d.ts.map +1 -1
  20. package/dist/init-guild.js +33 -38
  21. package/dist/init-guild.js.map +1 -1
  22. package/dist/install-tool.d.ts +48 -11
  23. package/dist/install-tool.d.ts.map +1 -1
  24. package/dist/install-tool.js +304 -38
  25. package/dist/install-tool.js.map +1 -1
  26. package/dist/instantiate.d.ts +1 -1
  27. package/dist/instantiate.d.ts.map +1 -1
  28. package/dist/instantiate.js +6 -7
  29. package/dist/instantiate.js.map +1 -1
  30. package/dist/nexus-home.d.ts +15 -8
  31. package/dist/nexus-home.d.ts.map +1 -1
  32. package/dist/nexus-home.js +32 -17
  33. package/dist/nexus-home.js.map +1 -1
  34. package/dist/rehydrate.d.ts +15 -0
  35. package/dist/rehydrate.d.ts.map +1 -0
  36. package/dist/rehydrate.js +84 -0
  37. package/dist/rehydrate.js.map +1 -0
  38. package/dist/remove-tool.d.ts +2 -2
  39. package/dist/remove-tool.d.ts.map +1 -1
  40. package/dist/remove-tool.js +43 -11
  41. package/dist/remove-tool.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/base-tools.d.ts +0 -27
  44. package/dist/base-tools.d.ts.map +0 -1
  45. package/dist/base-tools.js +0 -30
  46. package/dist/base-tools.js.map +0 -1
  47. package/dist/bootstrap.d.ts +0 -14
  48. package/dist/bootstrap.d.ts.map +0 -1
  49. package/dist/bootstrap.js +0 -46
  50. package/dist/bootstrap.js.map +0 -1
  51. package/dist/publish.d.ts +0 -20
  52. package/dist/publish.d.ts.map +0 -1
  53. package/dist/publish.js +0 -41
  54. package/dist/publish.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
- import { guildhallWorktreePath } from "./nexus-home.js";
4
3
  /**
5
4
  * Create the default guild.json content for a new guild.
6
5
  * All registries (implements, engines, curricula, temperaments) start empty.
7
6
  */
8
- export function createInitialGuildConfig(nexusVersion, model) {
7
+ export function createInitialGuildConfig(name, nexusVersion, model) {
9
8
  return {
9
+ name,
10
10
  nexus: nexusVersion,
11
11
  model,
12
12
  workshops: [],
@@ -16,16 +16,16 @@ export function createInitialGuildConfig(nexusVersion, model) {
16
16
  temperaments: {},
17
17
  };
18
18
  }
19
- /** Resolve the path to guild.json in the standing worktree. */
19
+ /** Resolve the path to guild.json in the guild root. */
20
20
  export function guildConfigPath(home) {
21
- return path.join(guildhallWorktreePath(home), 'guild.json');
21
+ return path.join(home, 'guild.json');
22
22
  }
23
- /** Read and parse guild.json from the standing worktree. */
23
+ /** Read and parse guild.json from the guild root. */
24
24
  export function readGuildConfig(home) {
25
25
  const configFile = guildConfigPath(home);
26
26
  return JSON.parse(fs.readFileSync(configFile, 'utf-8'));
27
27
  }
28
- /** Write guild.json to the standing worktree. */
28
+ /** Write guild.json to the guild root. */
29
29
  export function writeGuildConfig(home, config) {
30
30
  const configFile = guildConfigPath(home);
31
31
  fs.writeFileSync(configFile, JSON.stringify(config, null, 2) + '\n');
@@ -1 +1 @@
1
- {"version":3,"file":"guild-config.js","sourceRoot":"","sources":["../src/gu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AAoB,EAAE,KAAa;IACxF,OAAO;QACL,IAAI;QACJ,KAAK,EAAE,YAAY;QACnB,KAAK;QACL,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,EAAE;QACd,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,EAAE;KACjB,CAAC;AACJ,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAgB,CAAC;AACzE,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,MAAmB;IAChE,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACzC,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACvE,CAAC"}
@@ -30,7 +30,7 @@ type ZodShape = Record<string, z.ZodType>;
30
30
  * or calling engine) provides it.
31
31
  */
32
32
  export interface ImplementContext {
33
- /** Absolute path to NEXUS_HOME. */
33
+ /** Absolute path to the guild root. */
34
34
  home: string;
35
35
  }
36
36
  /**
@@ -55,7 +55,7 @@ export interface ImplementDefinition<TShape extends ZodShape = ZodShape> {
55
55
  *
56
56
  * The handler receives two arguments:
57
57
  * - `params` — the validated input, typed from your Zod schemas
58
- * - `context` — framework-injected context (NEXUS_HOME path, etc.)
58
+ * - `context` — framework-injected context (guild root path, etc.)
59
59
  *
60
60
  * Return any JSON-serializable value. The MCP engine wraps it as tool output;
61
61
  * the CLI prints it; engines use it directly.
@@ -1 +1 @@
1
- {"version":3,"file":"implement.d.ts","sourceRoot":"","sources":["../src/implement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;AAE1C;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB,CAAC,MAAM,SAAS,QAAQ,GAAG,QAAQ;IACrE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,CAChB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EACpC,OAAO,EAAE,gBAAgB,KACtB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,MAAM,SAAS,QAAQ,EAAE,GAAG,EAAE;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CACP,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EACpC,OAAO,EAAE,gBAAgB,KACtB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAM9B"}
1
+ {"version":3,"file":"implement.d.ts","sourceRoot":"","sources":["../src/implement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;AAE1C;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB,CAAC,MAAM,SAAS,QAAQ,GAAG,QAAQ;IACrE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,CAChB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EACpC,OAAO,EAAE,gBAAgB,KACtB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,MAAM,SAAS,QAAQ,EAAE,GAAG,EAAE;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CACP,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EACpC,OAAO,EAAE,gBAAgB,KACtB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAM9B"}
package/dist/implement.js CHANGED
@@ -32,7 +32,7 @@ import { z } from 'zod';
32
32
  *
33
33
  * The handler receives two arguments:
34
34
  * - `params` — the validated input, typed from your Zod schemas
35
- * - `context` — framework-injected context (NEXUS_HOME path, etc.)
35
+ * - `context` — framework-injected context (guild root path, etc.)
36
36
  *
37
37
  * Return any JSON-serializable value. The MCP engine wraps it as tool output;
38
38
  * the CLI prints it; engines use it directly.
package/dist/index.d.ts CHANGED
@@ -1,14 +1,13 @@
1
- export declare const VERSION = "0.1.0";
1
+ export declare const VERSION: string;
2
2
  export { type ImplementContext, type ImplementDefinition, implement, } from './implement.ts';
3
- export { createLedger, INITIAL_SCHEMA } from './ledger.ts';
3
+ export { createLedger } from './ledger.ts';
4
4
  export { type GuildConfig, type ToolEntry, type TrainingEntry, createInitialGuildConfig, guildConfigPath, readGuildConfig, writeGuildConfig, } from './guild-config.ts';
5
- export { resolveNexusHome, guildhallBarePath, guildhallWorktreePath, ledgerPath, worktreesPath, } from './nexus-home.ts';
6
- export { type InstallToolOptions, type InstallResult, installTool, } from './install-tool.ts';
5
+ export { findGuildRoot, nexusDir, ledgerPath, worktreesPath, workshopsPath, workshopBarePath, } from './nexus-home.ts';
6
+ export { type InstallToolOptions, type InstallResult, type SourceKind, classifySource, installTool, } from './install-tool.ts';
7
7
  export { type RemoveToolOptions, type RemoveResult, removeTool, } from './remove-tool.ts';
8
8
  export { type DispatchOptions, type DispatchResult, dispatch, } from './dispatch.ts';
9
- export { type PublishOptions, type PublishResult, publish, } from './publish.ts';
10
9
  export { type InstantiateOptions, type InstantiateResult, instantiate, } from './instantiate.ts';
11
- export { type BaseToolRef, BASE_IMPLEMENTS, BASE_ENGINES, BASE_TOOLS, } from './base-tools.ts';
12
10
  export { initGuild } from './init-guild.ts';
13
- export { bootstrapBaseTools } from './bootstrap.ts';
11
+ export { type BundleManifest, type BundlePackageEntry, type BundleContentEntry, type BundleMigrationEntry, type InstallBundleOptions, type InstallBundleResult, readBundleManifest, installBundle, isBundleDir, } from './bundle.ts';
12
+ export { type RehydrateResult, rehydrate, } from './rehydrate.ts';
14
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,OAAO,EACL,KAAK,gBAAgB,EAC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AAC;AAC3C,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,cAAc,EACd,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,eAAe,EACpB,SAAS,GACV,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,15 +1,17 @@
1
1
  // @shardworks/nexus-core — shared infrastructure for the guild system
2
- export const VERSION = '0.1.0';
2
+ import { createRequire } from 'node:module';
3
+ const _require = createRequire(import.meta.url);
4
+ const _pkg = _require('../package.json');
5
+ export const VERSION = _pkg.version;
3
6
  export { implement, } from "./implement.js";
4
- export { createLedger, INITIAL_SCHEMA } from "./ledger.js";
7
+ export { createLedger } from "./ledger.js";
5
8
  export { createInitialGuildConfig, guildConfigPath, readGuildConfig, writeGuildConfig, } from "./guild-config.js";
6
- export { resolveNexusHome, guildhallBarePath, guildhallWorktreePath, ledgerPath, worktreesPath, } from "./nexus-home.js";
7
- export { installTool, } from "./install-tool.js";
9
+ export { findGuildRoot, nexusDir, ledgerPath, worktreesPath, workshopsPath, workshopBarePath, } from "./nexus-home.js";
10
+ export { classifySource, installTool, } from "./install-tool.js";
8
11
  export { removeTool, } from "./remove-tool.js";
9
12
  export { dispatch, } from "./dispatch.js";
10
- export { publish, } from "./publish.js";
11
13
  export { instantiate, } from "./instantiate.js";
12
- export { BASE_IMPLEMENTS, BASE_ENGINES, BASE_TOOLS, } from "./base-tools.js";
13
14
  export { initGuild } from "./init-guild.js";
14
- export { bootstrapBaseTools } from "./bootstrap.js";
15
+ export { readBundleManifest, installBundle, isBundleDir, } from "./bundle.js";
16
+ export { rehydrate, } from "./rehydrate.js";
15
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,OAAO,EAGL,SAAS,GACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAIL,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,OAA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,SAAS,GACV,MAAM,gBAAgB,CAAC"}
@@ -1,20 +1,24 @@
1
1
  /**
2
- * Create a new guild skeleton at the given path.
2
+ * Create a new guild at the given path.
3
3
  *
4
- * Sets up the NEXUS_HOME directory structure: bare guildhall repo,
5
- * standing worktree with scaffolded directories, empty guild.json,
6
- * the initial migration file, and an initial git commit.
4
+ * Sets up a regular git repo at `home` with the guild directory structure:
5
+ * guild.json, package.json, .gitignore, scaffolded directories, and an
6
+ * initial git commit.
7
7
  *
8
- * This is the first step of guild creation. After this, the caller
9
- * should bootstrap base tools and apply migrations:
8
+ * The .nexus/ directory (gitignored) holds framework-managed state: the Ledger,
9
+ * workshop bare clones, and commission worktrees.
10
10
  *
11
- * initGuild(home, model) // skeleton
12
- * bootstrapBaseTools(home, ...) // install framework tools via installTool
13
- * applyMigrations(home) // create ledger via migration engine
11
+ * This creates only the skeleton. After this, the caller should install a
12
+ * bundle (which delivers tools, training, and migrations) and apply migrations:
14
13
  *
15
- * @param home - Absolute path for the new NEXUS_HOME directory.
14
+ * initGuild(home, name, model) // skeleton
15
+ * installBundle({ home, bundleDir }) // tools, training, migrations
16
+ * applyMigrations(home) // create ledger
17
+ *
18
+ * @param home - Absolute path for the new guild directory.
19
+ * @param name - Guild name (used in guild.json and as the npm package name).
16
20
  * @param model - Default model identifier for anima sessions.
17
21
  * @throws If `home` exists and is not empty.
18
22
  */
19
- export declare function initGuild(home: string, model: string): void;
23
+ export declare function initGuild(home: string, name: string, model: string): void;
20
24
  //# sourceMappingURL=init-guild.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-guild.d.ts","sourceRoot":"","sources":["../src/init-guild.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CA8D3D"}
1
+ {"version":3,"file":"init-guild.d.ts","sourceRoot":"","sources":["../src/init-guild.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAsDzE"}
@@ -2,31 +2,33 @@ import path from 'node:path';
2
2
  import fs from 'node:fs';
3
3
  import { execFileSync } from 'node:child_process';
4
4
  import { VERSION } from "./index.js";
5
- import { guildhallBarePath, guildhallWorktreePath } from "./nexus-home.js";
6
5
  import { createInitialGuildConfig } from "./guild-config.js";
7
- import { INITIAL_SCHEMA } from "./ledger.js";
8
6
  function git(args, cwd) {
9
7
  execFileSync('git', args, { cwd, stdio: 'pipe' });
10
8
  }
11
9
  /**
12
- * Create a new guild skeleton at the given path.
10
+ * Create a new guild at the given path.
13
11
  *
14
- * Sets up the NEXUS_HOME directory structure: bare guildhall repo,
15
- * standing worktree with scaffolded directories, empty guild.json,
16
- * the initial migration file, and an initial git commit.
12
+ * Sets up a regular git repo at `home` with the guild directory structure:
13
+ * guild.json, package.json, .gitignore, scaffolded directories, and an
14
+ * initial git commit.
17
15
  *
18
- * This is the first step of guild creation. After this, the caller
19
- * should bootstrap base tools and apply migrations:
16
+ * The .nexus/ directory (gitignored) holds framework-managed state: the Ledger,
17
+ * workshop bare clones, and commission worktrees.
20
18
  *
21
- * initGuild(home, model) // skeleton
22
- * bootstrapBaseTools(home, ...) // install framework tools via installTool
23
- * applyMigrations(home) // create ledger via migration engine
19
+ * This creates only the skeleton. After this, the caller should install a
20
+ * bundle (which delivers tools, training, and migrations) and apply migrations:
24
21
  *
25
- * @param home - Absolute path for the new NEXUS_HOME directory.
22
+ * initGuild(home, name, model) // skeleton
23
+ * installBundle({ home, bundleDir }) // tools, training, migrations
24
+ * applyMigrations(home) // create ledger
25
+ *
26
+ * @param home - Absolute path for the new guild directory.
27
+ * @param name - Guild name (used in guild.json and as the npm package name).
26
28
  * @param model - Default model identifier for anima sessions.
27
29
  * @throws If `home` exists and is not empty.
28
30
  */
29
- export function initGuild(home, model) {
31
+ export function initGuild(home, name, model) {
30
32
  // Validate target
31
33
  if (fs.existsSync(home)) {
32
34
  const entries = fs.readdirSync(home);
@@ -34,18 +36,14 @@ export function initGuild(home, model) {
34
36
  throw new Error(`${home} exists and is not empty.`);
35
37
  }
36
38
  }
37
- // Create NEXUS_HOME skeleton
38
- const ghWorktree = guildhallWorktreePath(home);
39
- fs.mkdirSync(path.dirname(ghWorktree), { recursive: true });
40
- // Create guildhall bare repo
41
- const ghBare = guildhallBarePath(home);
42
- git(['init', '--bare', ghBare]);
43
- // Create standing worktree
44
- git(['-C', ghBare, 'worktree', 'add', '-b', 'main', ghWorktree]);
45
- // Scaffold guildhall directory structure
39
+ // Create guild root and initialize git repo
40
+ fs.mkdirSync(home, { recursive: true });
41
+ git(['init'], home);
42
+ // Create .nexus infrastructure directory
43
+ fs.mkdirSync(path.join(home, '.nexus', 'workshops'), { recursive: true });
44
+ fs.mkdirSync(path.join(home, '.nexus', 'worktrees'), { recursive: true });
45
+ // Scaffold guild directory structure
46
46
  const dirs = [
47
- 'nexus/implements',
48
- 'nexus/engines',
49
47
  'nexus/migrations',
50
48
  'implements',
51
49
  'engines',
@@ -54,24 +52,21 @@ export function initGuild(home, model) {
54
52
  'training/temperaments',
55
53
  ];
56
54
  for (const dir of dirs) {
57
- const full = path.join(ghWorktree, dir);
55
+ const full = path.join(home, dir);
58
56
  fs.mkdirSync(full, { recursive: true });
59
57
  fs.writeFileSync(path.join(full, '.gitkeep'), '');
60
58
  }
61
- // Write initial migration
62
- fs.writeFileSync(path.join(ghWorktree, 'nexus/migrations/001-initial-schema.sql'), INITIAL_SCHEMA.trimStart());
63
- // Remove .gitkeep from migrations since it now has a real file
64
- const migrationsGitkeep = path.join(ghWorktree, 'nexus/migrations/.gitkeep');
65
- if (fs.existsSync(migrationsGitkeep)) {
66
- fs.unlinkSync(migrationsGitkeep);
67
- }
68
59
  // Write codex placeholder
69
- fs.writeFileSync(path.join(ghWorktree, 'codex/all.md'), '');
70
- // Write guild.json — empty registries, tools will be installed via bootstrapBaseTools
71
- const config = createInitialGuildConfig(VERSION, model);
72
- fs.writeFileSync(path.join(ghWorktree, 'guild.json'), JSON.stringify(config, null, 2) + '\n');
60
+ fs.writeFileSync(path.join(home, 'codex/all.md'), '');
61
+ // Write guild.json — empty registries, tools installed via bundle
62
+ const config = createInitialGuildConfig(name, VERSION, model);
63
+ fs.writeFileSync(path.join(home, 'guild.json'), JSON.stringify(config, null, 2) + '\n');
64
+ // Make the guildhall an npm package so guild tools can be installed as
65
+ // npm dependencies with proper dependency resolution.
66
+ fs.writeFileSync(path.join(home, 'package.json'), JSON.stringify({ name: `guild-${name}`, private: true, version: '0.0.0' }, null, 2) + '\n');
67
+ fs.writeFileSync(path.join(home, '.gitignore'), 'node_modules/\n.nexus/\n');
73
68
  // Initial commit
74
- git(['add', '-A'], ghWorktree);
75
- git(['commit', '-m', 'Initialize guild'], ghWorktree);
69
+ git(['add', '-A'], home);
70
+ git(['commit', '-m', 'Initialize guild'], home);
76
71
  }
77
72
  //# sourceMappingURL=init-guild.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-guild.js","sourceRoot":"","sources":["../src/init-guild.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,SAAS,GAAG,CAAC,IAAc,EAAE,GAAY;IACvC,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAA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D,CAAC"}
@@ -1,34 +1,71 @@
1
+ /**
2
+ * How the source was classified for installation.
3
+ *
4
+ * - `registry` — npm package specifier (e.g. `foo@1.0`, `@scope/tool`)
5
+ * - `git-url` — git URL (e.g. `git+https://github.com/org/repo.git#v1.0`)
6
+ * - `workshop` — workshop ref (e.g. `workshop:forge#tool/fetch-jira@1.0`)
7
+ * - `tarball` — local .tgz/.tar.gz file
8
+ * - `link` — symlinked local directory (dev mode)
9
+ */
10
+ export type SourceKind = 'registry' | 'git-url' | 'workshop' | 'tarball' | 'link';
1
11
  export interface InstallToolOptions {
2
- /** Absolute path to the NEXUS_HOME directory. */
12
+ /** Absolute path to the guild root directory. */
3
13
  home: string;
4
- /** Source — currently only local directory paths. */
14
+ /**
15
+ * Source specifier:
16
+ *
17
+ * - npm package specifier: `some-tool@1.0`, `@scope/tool`
18
+ * - Git URL: `git+https://github.com/org/repo.git#v1.0`
19
+ * - Workshop ref: `workshop:forge#tool/fetch-jira@1.0`
20
+ * - Tarball: `./my-tool-1.0.0.tgz`
21
+ * - Local directory (with `--link`): `~/projects/my-tool`
22
+ */
5
23
  source: string;
6
- /** Override the tool name (defaults to source directory name). */
24
+ /** Override the tool name (defaults to package name or directory basename). */
7
25
  name?: string;
8
26
  /** Override the version slot. */
9
27
  slot?: string;
10
28
  /** Roles for implements (comma-separated or array). */
11
29
  roles?: string[];
12
- /**
13
- * Install as a framework tool (`source: 'nexus'`).
14
- * Installs to `nexus/implements/` or `nexus/engines/` instead of
15
- * guild-managed directories. Framework tools cannot be removed via remove-tool.
16
- */
17
- framework?: boolean;
18
30
  /** Whether to create a git commit after installing. Defaults to true. */
19
31
  commit?: boolean;
32
+ /**
33
+ * Symlink a local directory instead of copying (dev mode).
34
+ * Only valid for local directories with `package.json`.
35
+ * Changes to the source are reflected immediately at runtime.
36
+ * **Not durable** — will not survive a fresh clone.
37
+ */
38
+ link?: boolean;
39
+ /** Bundle provenance — which bundle delivered this artifact. */
40
+ bundle?: string;
20
41
  }
21
42
  export interface InstallResult {
22
43
  category: 'implements' | 'engines' | 'curricula' | 'temperaments';
23
44
  name: string;
24
45
  slot: string;
25
46
  installedTo: string;
47
+ sourceKind: SourceKind;
26
48
  }
49
+ /**
50
+ * Classify a source string to determine the installation method.
51
+ *
52
+ * @param source - The source specifier.
53
+ * @param link - Whether the --link flag was set.
54
+ */
55
+ export declare function classifySource(source: string, link?: boolean): SourceKind;
27
56
  /**
28
57
  * Install a tool (implement, engine, curriculum, or temperament) into the guild.
29
58
  *
30
- * Currently supports local directory sources only. Detects the descriptor type,
31
- * copies the directory to the correct slot, and registers in guild.json.
59
+ * Supports five source types:
60
+ * - **Registry** npm package specifier, fully durable via package.json
61
+ * - **Git URL** — `git+https://...`, fully durable via package.json
62
+ * - **Workshop** — `workshop:name#ref`, durable within the guild via full source in slot
63
+ * - **Tarball** — `.tgz` file, durable via full source in slot
64
+ * - **Link** — symlinked local dir (dev mode), NOT durable
65
+ *
66
+ * For npm-installed tools, runtime code lives in node_modules. Metadata
67
+ * (descriptor + instructions) is copied to the guild slot for git tracking.
68
+ * The `package` field in guild.json tells the manifest engine to resolve by package name.
32
69
  */
33
70
  export declare function installTool(opts: InstallToolOptions): InstallResult;
34
71
  //# sourceMappingURL=install-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"install-tool.d.ts","sourceRoot":"","sources":["../src/install-tool.ts"],"names":[],"mappings":"AAiCA,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,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