@shardworks/nexus-core 0.1.99 → 0.1.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +95 -166
  2. package/dist/guild-config.d.ts +14 -52
  3. package/dist/guild-config.d.ts.map +1 -1
  4. package/dist/guild-config.js +7 -10
  5. package/dist/guild-config.js.map +1 -1
  6. package/dist/guild.d.ts +83 -0
  7. package/dist/guild.d.ts.map +1 -0
  8. package/dist/guild.js +45 -0
  9. package/dist/guild.js.map +1 -0
  10. package/dist/id.d.ts +14 -0
  11. package/dist/id.d.ts.map +1 -0
  12. package/dist/id.js +19 -0
  13. package/dist/id.js.map +1 -0
  14. package/dist/index.d.ts +6 -30
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +7 -32
  17. package/dist/index.js.map +1 -1
  18. package/dist/nexus-home.d.ts +0 -4
  19. package/dist/nexus-home.d.ts.map +1 -1
  20. package/dist/nexus-home.js +1 -9
  21. package/dist/nexus-home.js.map +1 -1
  22. package/dist/plugin.d.ts +115 -0
  23. package/dist/plugin.d.ts.map +1 -0
  24. package/dist/plugin.js +39 -0
  25. package/dist/plugin.js.map +1 -0
  26. package/dist/resolve-package.d.ts +58 -0
  27. package/dist/resolve-package.d.ts.map +1 -0
  28. package/dist/resolve-package.js +123 -0
  29. package/dist/resolve-package.js.map +1 -0
  30. package/package.json +5 -14
  31. package/dist/book.d.ts +0 -110
  32. package/dist/book.d.ts.map +0 -1
  33. package/dist/book.js +0 -16
  34. package/dist/book.js.map +0 -1
  35. package/dist/legacy/1/anima.d.ts +0 -79
  36. package/dist/legacy/1/anima.d.ts.map +0 -1
  37. package/dist/legacy/1/anima.js +0 -285
  38. package/dist/legacy/1/anima.js.map +0 -1
  39. package/dist/legacy/1/audit.d.ts +0 -23
  40. package/dist/legacy/1/audit.d.ts.map +0 -1
  41. package/dist/legacy/1/audit.js +0 -61
  42. package/dist/legacy/1/audit.js.map +0 -1
  43. package/dist/legacy/1/bundle.d.ts +0 -111
  44. package/dist/legacy/1/bundle.d.ts.map +0 -1
  45. package/dist/legacy/1/bundle.js +0 -452
  46. package/dist/legacy/1/bundle.js.map +0 -1
  47. package/dist/legacy/1/clock-daemon.d.ts +0 -2
  48. package/dist/legacy/1/clock-daemon.d.ts.map +0 -1
  49. package/dist/legacy/1/clock-daemon.js +0 -72
  50. package/dist/legacy/1/clock-daemon.js.map +0 -1
  51. package/dist/legacy/1/clockworks.d.ts +0 -98
  52. package/dist/legacy/1/clockworks.d.ts.map +0 -1
  53. package/dist/legacy/1/clockworks.js +0 -359
  54. package/dist/legacy/1/clockworks.js.map +0 -1
  55. package/dist/legacy/1/conversation.d.ts +0 -165
  56. package/dist/legacy/1/conversation.d.ts.map +0 -1
  57. package/dist/legacy/1/conversation.js +0 -457
  58. package/dist/legacy/1/conversation.js.map +0 -1
  59. package/dist/legacy/1/engine.d.ts +0 -90
  60. package/dist/legacy/1/engine.d.ts.map +0 -1
  61. package/dist/legacy/1/engine.js +0 -89
  62. package/dist/legacy/1/engine.js.map +0 -1
  63. package/dist/legacy/1/events.d.ts +0 -88
  64. package/dist/legacy/1/events.d.ts.map +0 -1
  65. package/dist/legacy/1/events.js +0 -239
  66. package/dist/legacy/1/events.js.map +0 -1
  67. package/dist/legacy/1/guild-config.d.ts +0 -74
  68. package/dist/legacy/1/guild-config.d.ts.map +0 -1
  69. package/dist/legacy/1/guild-config.js +0 -51
  70. package/dist/legacy/1/guild-config.js.map +0 -1
  71. package/dist/legacy/1/id.d.ts +0 -8
  72. package/dist/legacy/1/id.d.ts.map +0 -1
  73. package/dist/legacy/1/id.js +0 -27
  74. package/dist/legacy/1/id.js.map +0 -1
  75. package/dist/legacy/1/index.d.ts +0 -28
  76. package/dist/legacy/1/index.d.ts.map +0 -1
  77. package/dist/legacy/1/index.js +0 -32
  78. package/dist/legacy/1/index.js.map +0 -1
  79. package/dist/legacy/1/init-guild.d.ts +0 -24
  80. package/dist/legacy/1/init-guild.d.ts.map +0 -1
  81. package/dist/legacy/1/init-guild.js +0 -230
  82. package/dist/legacy/1/init-guild.js.map +0 -1
  83. package/dist/legacy/1/install-tool.d.ts +0 -73
  84. package/dist/legacy/1/install-tool.d.ts.map +0 -1
  85. package/dist/legacy/1/install-tool.js +0 -436
  86. package/dist/legacy/1/install-tool.js.map +0 -1
  87. package/dist/legacy/1/instantiate.d.ts +0 -33
  88. package/dist/legacy/1/instantiate.d.ts.map +0 -1
  89. package/dist/legacy/1/instantiate.js +0 -137
  90. package/dist/legacy/1/instantiate.js.map +0 -1
  91. package/dist/legacy/1/manifest.d.ts +0 -132
  92. package/dist/legacy/1/manifest.d.ts.map +0 -1
  93. package/dist/legacy/1/manifest.js +0 -321
  94. package/dist/legacy/1/manifest.js.map +0 -1
  95. package/dist/legacy/1/migrate.d.ts +0 -84
  96. package/dist/legacy/1/migrate.d.ts.map +0 -1
  97. package/dist/legacy/1/migrate.js +0 -228
  98. package/dist/legacy/1/migrate.js.map +0 -1
  99. package/dist/legacy/1/nexus-home.d.ts +0 -11
  100. package/dist/legacy/1/nexus-home.d.ts.map +0 -1
  101. package/dist/legacy/1/nexus-home.js +0 -16
  102. package/dist/legacy/1/nexus-home.js.map +0 -1
  103. package/dist/legacy/1/plugin-descriptor.d.ts +0 -3
  104. package/dist/legacy/1/plugin-descriptor.d.ts.map +0 -1
  105. package/dist/legacy/1/plugin-descriptor.js +0 -2
  106. package/dist/legacy/1/plugin-descriptor.js.map +0 -1
  107. package/dist/legacy/1/preconditions.d.ts +0 -100
  108. package/dist/legacy/1/preconditions.d.ts.map +0 -1
  109. package/dist/legacy/1/preconditions.js +0 -189
  110. package/dist/legacy/1/preconditions.js.map +0 -1
  111. package/dist/legacy/1/rehydrate.d.ts +0 -22
  112. package/dist/legacy/1/rehydrate.d.ts.map +0 -1
  113. package/dist/legacy/1/rehydrate.js +0 -109
  114. package/dist/legacy/1/rehydrate.js.map +0 -1
  115. package/dist/legacy/1/remove-tool.d.ts +0 -19
  116. package/dist/legacy/1/remove-tool.d.ts.map +0 -1
  117. package/dist/legacy/1/remove-tool.js +0 -105
  118. package/dist/legacy/1/remove-tool.js.map +0 -1
  119. package/dist/legacy/1/session.d.ts +0 -343
  120. package/dist/legacy/1/session.d.ts.map +0 -1
  121. package/dist/legacy/1/session.js +0 -499
  122. package/dist/legacy/1/session.js.map +0 -1
  123. package/dist/legacy/1/tool-registry.d.ts +0 -12
  124. package/dist/legacy/1/tool-registry.d.ts.map +0 -1
  125. package/dist/legacy/1/tool-registry.js +0 -28
  126. package/dist/legacy/1/tool-registry.js.map +0 -1
  127. package/dist/legacy/1/tool.d.ts +0 -10
  128. package/dist/legacy/1/tool.d.ts.map +0 -1
  129. package/dist/legacy/1/tool.js +0 -2
  130. package/dist/legacy/1/tool.js.map +0 -1
  131. package/dist/legacy/1/upgrade.d.ts +0 -129
  132. package/dist/legacy/1/upgrade.d.ts.map +0 -1
  133. package/dist/legacy/1/upgrade.js +0 -355
  134. package/dist/legacy/1/upgrade.js.map +0 -1
  135. package/dist/legacy/1/workshop.d.ts +0 -95
  136. package/dist/legacy/1/workshop.d.ts.map +0 -1
  137. package/dist/legacy/1/workshop.js +0 -229
  138. package/dist/legacy/1/workshop.js.map +0 -1
  139. package/dist/legacy/1/worktree.d.ts +0 -67
  140. package/dist/legacy/1/worktree.d.ts.map +0 -1
  141. package/dist/legacy/1/worktree.js +0 -117
  142. package/dist/legacy/1/worktree.js.map +0 -1
  143. package/dist/legacy/1/writ.d.ts +0 -130
  144. package/dist/legacy/1/writ.d.ts.map +0 -1
  145. package/dist/legacy/1/writ.js +0 -599
  146. package/dist/legacy/1/writ.js.map +0 -1
  147. package/dist/rig-context.d.ts +0 -47
  148. package/dist/rig-context.d.ts.map +0 -1
  149. package/dist/rig-context.js +0 -11
  150. package/dist/rig-context.js.map +0 -1
  151. package/dist/rig-descriptor.d.ts +0 -39
  152. package/dist/rig-descriptor.d.ts.map +0 -1
  153. package/dist/rig-descriptor.js +0 -12
  154. package/dist/rig-descriptor.js.map +0 -1
  155. package/dist/rig.d.ts +0 -70
  156. package/dist/rig.d.ts.map +0 -1
  157. package/dist/rig.js +0 -14
  158. package/dist/rig.js.map +0 -1
  159. package/dist/tool.d.ts +0 -136
  160. package/dist/tool.d.ts.map +0 -1
  161. package/dist/tool.js +0 -135
  162. package/dist/tool.js.map +0 -1
  163. package/migrations/001-schema.sql +0 -177
  164. package/migrations/002-writs.sql +0 -44
  165. package/migrations/003-conversations.sql +0 -43
  166. package/migrations/004-remove-commissions.sql +0 -24
@@ -1,8 +0,0 @@
1
- /**
2
- * Generate a prefixed hex ID for a guild entity.
3
- *
4
- * @param prefix - Entity type prefix (e.g. 'c', 'a', 'evt', 'ses', 'w', 'p', 'j', 's')
5
- * @returns A string like `c-a3f7b2c1`
6
- */
7
- export declare function generateId(prefix: string): string;
8
- //# sourceMappingURL=id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../src/legacy/1/id.ts"],"names":[],"mappings":"AAkBA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjD"}
@@ -1,27 +0,0 @@
1
- /**
2
- * ID generation — prefixed random hex identifiers for all guild entities.
3
- *
4
- * Format: `<prefix>-<8 hex chars>` (e.g. `c-a3f7b2c1`, `a-5e6f7a8b`).
5
- * 8 hex characters = 4 random bytes = ~4.3 billion possibilities per prefix,
6
- * more than sufficient for a local single-guild system.
7
- *
8
- * Prefixes by entity type:
9
- * a- anima
10
- * wrt- writ
11
- * conv- conversation
12
- * cpart- conversation participant
13
- * evt- event
14
- * ses- session
15
- * aud- audit log entry
16
- */
17
- import { randomBytes } from 'node:crypto';
18
- /**
19
- * Generate a prefixed hex ID for a guild entity.
20
- *
21
- * @param prefix - Entity type prefix (e.g. 'c', 'a', 'evt', 'ses', 'w', 'p', 'j', 's')
22
- * @returns A string like `c-a3f7b2c1`
23
- */
24
- export function generateId(prefix) {
25
- return `${prefix}-${randomBytes(4).toString('hex')}`;
26
- }
27
- //# sourceMappingURL=id.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"id.js","sourceRoot":"","sources":["../../../src/legacy/1/id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,OAAO,GAAG,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;AACvD,CAAC"}
@@ -1,28 +0,0 @@
1
- export declare const VERSION: string;
2
- export { type PluginDescriptor, type PluginDependency, } from './plugin-descriptor.ts';
3
- export { type ToolCaller, type ToolContext, type ToolDefinition, tool, isToolDefinition, resolveToolFromExport, resolveAllToolsFromExport, } from './tool.ts';
4
- export { type GuildEvent, type EngineContext, type EngineDefinition, engine, isClockworkEngine, resolveEngineFromExport, } from './engine.ts';
5
- export { signalEvent, validateCustomEvent, isFrameworkEvent, readPendingEvents, readEvent, markEventProcessed, recordDispatch, type ListEventsOptions, type DispatchRecord, type ListDispatchesOptions, listEvents, listDispatches, } from './events.ts';
6
- export { type TickResult, type DispatchSummary, type ClockRunResult, type ClockStartOptions, type ClockStartResult, type ClockStopResult, type ClockStatus, clockTick, clockRun, clockStart, clockStop, clockStatus, desugarOrder, extractParams, } from './clockworks.ts';
7
- export { type GuildConfig, type RoleDefinition, type ToolEntry, type TrainingEntry, type WorkshopEntry, type EventDeclaration, type StandingOrder, type ClockworksConfig, type WritTypeDeclaration, type GuildSettings, createInitialGuildConfig, guildConfigPath, readGuildConfig, writeGuildConfig, } from './guild-config.ts';
8
- export { findGuildRoot, nexusDir, booksPath, ledgerPath, worktreesPath, workshopsPath, workshopBarePath, clockPidPath, clockLogPath, } from './nexus-home.ts';
9
- export { type InstallToolOptions, type InstallResult, type SourceKind, classifySource, installTool, } from './install-tool.ts';
10
- export { type RemoveToolOptions, type RemoveResult, removeTool, } from './remove-tool.ts';
11
- export { type InstantiateOptions, type InstantiateResult, instantiate, } from './instantiate.ts';
12
- export { initGuild } from './init-guild.ts';
13
- export { type BundleManifest, type BundlePackageEntry, type BundleContentEntry, type BundleMigrationEntry, type InstallBundleOptions, type InstallBundleResult, readBundleManifest, installBundle, isBundleDir, } from './bundle.ts';
14
- export { type RehydrateResult, rehydrate, } from './rehydrate.ts';
15
- export { type AddWorkshopOptions, type AddWorkshopResult, type RemoveWorkshopOptions, type WorkshopInfo, type WorkshopDetail, type CreateWorkshopOptions, addWorkshop, removeWorkshop, listWorkshops, showWorkshop, createWorkshop, checkGhAuth, deriveWorkshopName, } from './workshop.ts';
16
- export { type Precondition, type CommandPrecondition, type CommandOutputPrecondition, type EnvPrecondition, type PreconditionCheckResult, type ToolPreconditionResult, readPreconditions, checkOne, checkPreconditions, checkAllPreconditions, checkToolPreconditions, } from './preconditions.ts';
17
- export { type WorktreeConfig, type WorktreeResult, setupWorktree, teardownWorktree, listWorktrees, } from './worktree.ts';
18
- export { type MigrationFile, type MigrationProvenance, type MigrateResult, discoverMigrations, applyMigrations, applyCoreMigrations, ensureBooks, } from './migrate.ts';
19
- export { type AnimaRecord, type ResolvedTool, type UnavailableTool, type ManifestResult, readAnima, resolveTools, readCodex, readRoleInstructions, assembleSystemPrompt, manifest, } from './manifest.ts';
20
- export { type SessionProvider, type SessionProviderLaunchOptions, type SessionProviderResult, type SessionLaunchOptions, type SessionResult, type SessionChunk, type WorkspaceContext, type ResolvedWorkspace, type SessionRecord, type SessionSummary, type SessionDetail, type ListSessionsOptions, registerSessionProvider, getSessionProvider, resolveWorkspace, createTempWorktree, removeTempWorktree, launchSession, listSessions, countSessionsForWrit, showSession, } from './session.ts';
21
- export { type ConversationChunk, type CreateConversationOptions, type CreateConversationResult, type ConversationSummary, type ConversationDetail, type ListConversationsOptions, createConversation, takeTurn, endConversation, nextParticipant, listConversations, showConversation, formatConveneMessage, } from './conversation.ts';
22
- export { type UpgradePlan, type UpgradeResult, type ApplyUpgradeOptions, type MigrationPlanEntry, type ContentUpdateEntry, type ToolPlanEntry, type StaleAnimaEntry, planUpgrade, applyUpgrade, } from './upgrade.ts';
23
- export { generateId } from './id.ts';
24
- export { type AnimaSummary, type AnimaDetail, type ListAnimasOptions, type UpdateAnimaOptions, type AnimaStaleness, type StalenessInfo, resolveAnimaByRole, listAnimas, showAnima, updateAnima, removeAnima, checkAnimaStaleness, checkAllAnimaStaleness, } from './anima.ts';
25
- export { type ToolSummary, listTools, } from './tool-registry.ts';
26
- export { type WritRecord, type WritStatus, type CreateWritOptions, type ListWritsOptions, type WritChildSummary, BUILTIN_WRIT_TYPES, validateWritType, createWrit, readWrit, listWrits, activateWrit, completeWrit, adminCompleteWrit, failWrit, cancelWrit, interruptWrit, reopenFailedWrit, rollupParent, getWritChildren, buildProgressAppendix, hydratePromptTemplate, } from './writ.ts';
27
- export { type AuditEntry, type ListAuditLogOptions, listAuditLog, } from './audit.ts';
28
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/1/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,EAAE,MAAqB,CAAC;AAE5C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,IAAI,EACJ,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,MAAM,EACN,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EAC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B,EACjB,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,YAAY,GACb,MAAM,YAAY,CAAC"}
@@ -1,32 +0,0 @@
1
- // @shardworks/nexus-core — shared infrastructure for the guild system
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;
6
- export {} from "./plugin-descriptor.js";
7
- export { tool, isToolDefinition, resolveToolFromExport, resolveAllToolsFromExport, } from "./tool.js";
8
- export { engine, isClockworkEngine, resolveEngineFromExport, } from "./engine.js";
9
- export { signalEvent, validateCustomEvent, isFrameworkEvent, readPendingEvents, readEvent, markEventProcessed, recordDispatch, listEvents, listDispatches, } from "./events.js";
10
- export { clockTick, clockRun, clockStart, clockStop, clockStatus, desugarOrder, extractParams, } from "./clockworks.js";
11
- export { createInitialGuildConfig, guildConfigPath, readGuildConfig, writeGuildConfig, } from "./guild-config.js";
12
- export { findGuildRoot, nexusDir, booksPath, ledgerPath, worktreesPath, workshopsPath, workshopBarePath, clockPidPath, clockLogPath, } from "./nexus-home.js";
13
- export { classifySource, installTool, } from "./install-tool.js";
14
- export { removeTool, } from "./remove-tool.js";
15
- export { instantiate, } from "./instantiate.js";
16
- export { initGuild } from "./init-guild.js";
17
- export { readBundleManifest, installBundle, isBundleDir, } from "./bundle.js";
18
- export { rehydrate, } from "./rehydrate.js";
19
- export { addWorkshop, removeWorkshop, listWorkshops, showWorkshop, createWorkshop, checkGhAuth, deriveWorkshopName, } from "./workshop.js";
20
- export { readPreconditions, checkOne, checkPreconditions, checkAllPreconditions, checkToolPreconditions, } from "./preconditions.js";
21
- export { setupWorktree, teardownWorktree, listWorktrees, } from "./worktree.js";
22
- export { discoverMigrations, applyMigrations, applyCoreMigrations, ensureBooks, } from "./migrate.js";
23
- export { readAnima, resolveTools, readCodex, readRoleInstructions, assembleSystemPrompt, manifest, } from "./manifest.js";
24
- export { registerSessionProvider, getSessionProvider, resolveWorkspace, createTempWorktree, removeTempWorktree, launchSession, listSessions, countSessionsForWrit, showSession, } from "./session.js";
25
- export { createConversation, takeTurn, endConversation, nextParticipant, listConversations, showConversation, formatConveneMessage, } from "./conversation.js";
26
- export { planUpgrade, applyUpgrade, } from "./upgrade.js";
27
- export { generateId } from "./id.js";
28
- export { resolveAnimaByRole, listAnimas, showAnima, updateAnima, removeAnima, checkAnimaStaleness, checkAllAnimaStaleness, } from "./anima.js";
29
- export { listTools, } from "./tool-registry.js";
30
- export { BUILTIN_WRIT_TYPES, validateWritType, createWrit, readWrit, listWrits, activateWrit, completeWrit, adminCompleteWrit, failWrit, cancelWrit, interruptWrit, reopenFailedWrit, rollupParent, getWritChildren, buildProgressAppendix, hydratePromptTemplate, } from "./writ.js";
31
- export { listAuditLog, } from "./audit.js";
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/legacy/1/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChD,MAAM,IAAI,GAAG,QAAQ,CAAC,uBAAuB,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,OAAO,GAAW,IAAI,CAAC,OAAO,CAAC;AAE5C,OAAO,EAGN,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAIL,IAAI,EACJ,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAIL,MAAM,EACN,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,EACX,mBAA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AS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAaL,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAOL,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAQL,WAAW,EACX,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAOL,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAML,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,YAAY,GACb,MAAM,YAAY,CAAC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Create a new guild at the given path.
3
- *
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
- *
8
- * The .nexus/ directory (gitignored) holds framework-managed state: the Books database,
9
- * workshop bare clones, and writ worktrees.
10
- *
11
- * This creates only the skeleton. After this, the caller should install a
12
- * bundle (which delivers tools, training, and migrations) and apply migrations:
13
- *
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).
20
- * @param model - Default model identifier for anima sessions.
21
- * @throws If `home` exists and is not empty.
22
- */
23
- export declare function initGuild(home: string, name: string, model: string): void;
24
- //# sourceMappingURL=init-guild.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init-guild.d.ts","sourceRoot":"","sources":["../../../src/legacy/1/init-guild.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CA0NzE"}
@@ -1,230 +0,0 @@
1
- import path from 'node:path';
2
- import fs from 'node:fs';
3
- import { execFileSync } from 'node:child_process';
4
- import { VERSION } from "./index.js";
5
- import { createInitialGuildConfig } from "./guild-config.js";
6
- function git(args, cwd) {
7
- execFileSync('git', args, { cwd, stdio: 'pipe' });
8
- }
9
- /**
10
- * Create a new guild at the given path.
11
- *
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.
15
- *
16
- * The .nexus/ directory (gitignored) holds framework-managed state: the Books database,
17
- * workshop bare clones, and writ worktrees.
18
- *
19
- * This creates only the skeleton. After this, the caller should install a
20
- * bundle (which delivers tools, training, and migrations) and apply migrations:
21
- *
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).
28
- * @param model - Default model identifier for anima sessions.
29
- * @throws If `home` exists and is not empty.
30
- */
31
- export function initGuild(home, name, model) {
32
- // Validate target
33
- if (fs.existsSync(home)) {
34
- const entries = fs.readdirSync(home);
35
- if (entries.length > 0) {
36
- throw new Error(`${home} exists and is not empty.`);
37
- }
38
- }
39
- // Create guild root and initialize git repo
40
- fs.mkdirSync(home, { recursive: true });
41
- git(['init', '-b', 'main'], 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
- const dirs = [
47
- 'nexus/migrations',
48
- 'tools',
49
- 'engines',
50
- 'roles',
51
- 'codex',
52
- 'training/curricula',
53
- 'training/temperaments',
54
- ];
55
- for (const dir of dirs) {
56
- const full = path.join(home, dir);
57
- fs.mkdirSync(full, { recursive: true });
58
- fs.writeFileSync(path.join(full, '.gitkeep'), '');
59
- }
60
- // Write codex placeholder
61
- fs.writeFileSync(path.join(home, 'codex/all.md'), '');
62
- // Write default role instruction files
63
- fs.writeFileSync(path.join(home, 'roles/steward.md'), [
64
- '# Steward',
65
- '',
66
- 'You are the guild steward — the patron\'s right hand, responsible for both advising and administering the guild.',
67
- '',
68
- '## Purpose',
69
- '',
70
- 'You are the patron\'s primary point of contact with the guild. You explain how things work, report on guild state, and suggest next steps. But unlike a pure advisor, you also *act* — managing the roster, workshops, standing orders, codex, and guild configuration on the patron\'s behalf.',
71
- '',
72
- '## What You Do',
73
- '',
74
- '### Advisory',
75
- '',
76
- '- **Answer questions** about guild structure, capabilities, and current state.',
77
- '- **Report status** — animas on the roster, active writs, work progress, tool inventory, pending events.',
78
- '- **Help frame writs** — when the patron has a vague idea, help them refine it into a clear brief.',
79
- '- **Explain outcomes** — when a writ completes or fails, help the patron understand what happened and what to do next.',
80
- '- **Suggest actions** — if you see something that needs attention (a failed writ, a missing tool, an empty roster), proactively surface it.',
81
- '',
82
- '### Administration',
83
- '',
84
- '- **Manage the roster** — create, update, and retire animas as directed by the patron.',
85
- '- **Manage workshops** — register, create, and remove workshops.',
86
- '- **Post writs** — translate the patron\'s intent into writs and post them using `create-writ`.',
87
- '- **Operate the Clockworks** — list pending events, tick and run the clock to process the event queue.',
88
- '- **Manage tools** — install and remove tools and bundles.',
89
- '- **Monitor writs** — use `list-writs` and `show-writ` to track work progress. Cancel stuck writs when needed.',
90
- '- **Signal events** — signal custom guild events when meaningful things happen.',
91
- '',
92
- '### Understanding Writs',
93
- '',
94
- 'Writs are the system\'s tracked work items. Every summoned session is bound to a writ. The writ lifecycle:',
95
- '',
96
- '- **ready** → dispatched to an anima',
97
- '- **active** → anima is working on it',
98
- '- **pending** → anima called `complete-session` but child writs are still incomplete',
99
- '- **completed** → all work finished',
100
- '- **failed** → unrecoverable failure',
101
- '- **cancelled** → cancelled by the system or cascade',
102
- '',
103
- 'When a writ is posted (via `nsg writ post` or `create-writ`), the Clockworks processes it through standing orders. Workspace-bound writs get a worktree prepared, then an artificer is summoned. The writ completes when the anima calls `complete-session`. If the anima created child writs, the parent waits for them to complete first.',
104
- '',
105
- '### Upgrades & Staleness',
106
- '',
107
- 'When the Nexus framework is upgraded, the guild receives new database migrations, updated curricula, and updated temperaments. The patron runs `nsg upgrade` from the CLI to apply these changes. **You cannot trigger an upgrade** — that is the patron\'s responsibility.',
108
- '',
109
- 'However, you **can and should** manage stale animas. An anima is "stale" when its composition was created with an older version of its curriculum or temperament than what is currently installed in the guild. Stale animas continue using their original training content and will not benefit from updated instructions, procedures, or tool lists until they are recomposed.',
110
- '',
111
- '**Detecting staleness:** The `anima-list` and `anima-show` tools report staleness. When you see `stale: true` on an anima, check the `staleness` field for details on which curriculum or temperament version is outdated.',
112
- '',
113
- '**Fixing stale animas:** To recompose a stale anima, note its name, roles, curriculum, and temperament from `anima-show`, then:',
114
- '1. Remove the stale anima (`anima-remove`)',
115
- '2. Create a fresh anima with the same name, roles, curriculum, and temperament (`anima-create`)',
116
- '',
117
- 'The new anima will pick up the latest training content. The old anima\'s history (writs, sessions) remains in the Books under its original ID.',
118
- '',
119
- 'When you notice stale animas during routine status checks, proactively inform the patron and offer to recompose them.',
120
- '',
121
- '## What You Don\'t Do',
122
- '',
123
- '- **You do not build works.** You don\'t write code, implement features, or work in workshop worktrees. That\'s the artificer\'s job.',
124
- '- **You do not plan work decomposition.** You don\'t create writs for sub-tasks — that\'s sage territory or the artificer\'s call during execution.',
125
- '- **You do not trigger upgrades.** The patron runs `nsg upgrade` from the CLI. You manage the aftermath (stale animas, status checks).',
126
- '- **You do not act unilaterally.** Administrative actions require the patron\'s direction. You advise, then execute on instruction. The exception is when the patron has already directed you to fix stale animas — you may proceed without re-asking.',
127
- '- **You do not speak for other animas.** Report what the Books say, not what you imagine another anima would think.',
128
- '',
129
- ].join('\n'));
130
- fs.writeFileSync(path.join(home, 'roles/artificer.md'), [
131
- '# Artificer',
132
- '',
133
- 'You are a guild artificer — you execute tasks and build the works the patron has asked for.',
134
- '',
135
- '## Purpose',
136
- '',
137
- 'You are the guild\'s hands. When work is dispatched, you receive the brief (and sage advice, if a sage is active), and you build the thing. Your output is the guild\'s works — running software, usable tools, solved problems.',
138
- '',
139
- '## What You Do',
140
- '',
141
- '- **Execute writs** — receive a writ (tracked work item), understand the requirements, and deliver working results.',
142
- '- **Work in workshops** — your work happens in writ worktrees. Each workspace-bound writ gives you an isolated workspace branched from main.',
143
- '- **Decompose when needed** — use `create-writ` to break large tasks into trackable sub-items. Each child writ tracks progress and provides continuity if your session is interrupted.',
144
- '- **Signal completion** — call `complete-session` when you have finished your work. This is mandatory. If you created child writs, the system will wait for them to complete automatically.',
145
- '- **Signal failure** — call `fail-writ` if the work cannot be completed. This is terminal — incomplete child writs will be cancelled.',
146
- '- **Write clear code** with useful comments and commit messages. Your primary audience is the next anima who continues the work.',
147
- '- **Test your work** before calling `complete-session`. Verify that what you built actually works.',
148
- '- **Signal events** when notable things happen during your work — use `craft.question` for design decisions outside your scope, and `craft.debt` for tech debt or code smells you observe but intentionally leave alone.',
149
- '',
150
- '## Session Protocol',
151
- '',
152
- 'Every session you receive is bound to a writ. You **must** signal completion before your session ends:',
153
- '',
154
- '- Call `complete-session` when done.',
155
- '- Call `fail-writ` if the work cannot be completed.',
156
- '- If your session ends without calling either, the system treats it as an interruption and re-dispatches the work.',
157
- '',
158
- '## What You Don\'t Do',
159
- '',
160
- '- **You do not plan work decomposition at scale.** That\'s the sage\'s job. You may create child writs for your own sub-tasks, but if the writ scope is unclear, signal `craft.question` rather than inventing requirements.',
161
- '- **You do not modify guild infrastructure.** You work in workshops, not in the guildhall. Tools, roles, and configuration are not your concern.',
162
- '- **You do not contradict sage advice.** If a sage has provided a plan, follow it. If you believe the plan has a flaw, record your concern in a commit message or signal `craft.question`, but execute the plan as given.',
163
- '',
164
- ].join('\n'));
165
- // Write guild.json — with default roles, clockworks events, empty registries
166
- const config = createInitialGuildConfig(name, VERSION, model);
167
- config.roles = {
168
- steward: {
169
- seats: 1,
170
- tools: [
171
- 'create-writ', 'list-writs', 'show-writ', 'update-writ',
172
- 'anima-create', 'anima-list', 'anima-show', 'anima-update', 'anima-remove',
173
- 'workshop-create', 'workshop-register', 'workshop-list', 'workshop-show', 'workshop-remove',
174
- 'tool-install', 'tool-remove', 'tool-list',
175
- 'clock-list', 'clock-tick', 'clock-run', 'clock-start', 'clock-stop', 'clock-status',
176
- 'session-list', 'session-show',
177
- 'event-list', 'event-show',
178
- 'nexus-version', 'signal',
179
- ],
180
- instructions: 'roles/steward.md',
181
- },
182
- artificer: {
183
- seats: null,
184
- tools: [
185
- 'complete-session', 'fail-writ', 'create-writ', 'list-writs', 'show-writ',
186
- 'signal',
187
- ],
188
- instructions: 'roles/artificer.md',
189
- },
190
- };
191
- config.clockworks = {
192
- events: {
193
- 'craft.question': {
194
- description: 'An artificer encountered a design decision outside the writ scope that needs attention.',
195
- schema: { summary: 'string', workshop: 'string?', writ: 'string?', context: 'string?' },
196
- },
197
- 'craft.debt': {
198
- description: 'An artificer observed tech debt or a code smell but intentionally did not address it.',
199
- schema: { summary: 'string', workshop: 'string?', writ: 'string?', location: 'string?' },
200
- },
201
- },
202
- standingOrders: [
203
- { on: 'writ.ready', run: 'workshop-prepare' },
204
- { on: 'writ.workspace-ready', summon: 'artificer', prompt: 'You have been assigned a writ.\n\n{{writ.title}}\n\n{{writ.description}}' },
205
- { on: 'writ.completed', run: 'workshop-merge' },
206
- ],
207
- };
208
- config.writTypes = {};
209
- fs.writeFileSync(path.join(home, 'guild.json'), JSON.stringify(config, null, 2) + '\n');
210
- // Make the guildhall an npm package so guild tools can be installed as
211
- // npm dependencies with proper dependency resolution.
212
- // @shardworks/nexus is pinned here so `nsg` is available in package scripts
213
- // even when the CLI is not globally installed.
214
- fs.writeFileSync(path.join(home, 'package.json'), JSON.stringify({
215
- name: `guild-${name}`,
216
- private: true,
217
- version: '0.0.0',
218
- scripts: {
219
- help: 'nsg consult steward',
220
- },
221
- dependencies: {
222
- '@shardworks/nexus': `^${VERSION}`,
223
- },
224
- }, null, 2) + '\n');
225
- fs.writeFileSync(path.join(home, '.gitignore'), 'node_modules/\n.nexus/\n');
226
- // Initial commit
227
- git(['add', '-A'], home);
228
- git(['commit', '-m', 'Initialize guild'], home);
229
- }
230
- //# sourceMappingURL=init-guild.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init-guild.js","sourceRoot":"","sources":["../../../src/legacy/1/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,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,SAAS,GAAG,CAAC,IAAc,EAAE,GAAY;IACvC,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,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I,OAAO,EAAE;SACnC;KACF,EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI,CACT,CAAC;IACF,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,0BAA0B,CAAC,CAAC;IAE5E,iBAAiB;IACjB,GAAG,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACzB,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,kBAAkB,CAAC,EAAE,IAAI,CAAC,CAAC;AAClD,CAAC"}
@@ -1,73 +0,0 @@
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';
11
- export interface InstallToolOptions {
12
- /** Absolute path to the guild root directory. */
13
- home: string;
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
- */
23
- source: string;
24
- /** Override the tool name (defaults to package name or directory basename). */
25
- name?: string;
26
- /**
27
- * For tools: which roles should have access. If specified, adds the
28
- * tool to these roles' tool lists. If omitted, adds to baseTools.
29
- */
30
- roles?: string[];
31
- /** Whether to create a git commit after installing. Defaults to true. */
32
- commit?: boolean;
33
- /**
34
- * Symlink a local directory instead of copying (dev mode).
35
- * Only valid for local directories with `package.json`.
36
- * Changes to the source are reflected immediately at runtime.
37
- * **Not durable** — will not survive a fresh clone.
38
- */
39
- link?: boolean;
40
- /** Bundle provenance — which bundle delivered this artifact. */
41
- bundle?: string;
42
- }
43
- export interface InstallResult {
44
- category: 'tools' | 'engines' | 'curricula' | 'temperaments';
45
- name: string;
46
- installedTo: string;
47
- sourceKind: SourceKind;
48
- /** Precondition warnings — unmet environment requirements. Tool is still installed. */
49
- warnings: string[];
50
- }
51
- /**
52
- * Classify a source string to determine the installation method.
53
- *
54
- * @param source - The source specifier.
55
- * @param link - Whether the --link flag was set.
56
- */
57
- export declare function classifySource(source: string, link?: boolean): SourceKind;
58
- /**
59
- * Install a tool (implement, engine, curriculum, or temperament) into the guild.
60
- *
61
- * Supports five source types:
62
- * - **Registry** — npm package specifier, fully durable via package.json
63
- * - **Git URL** — `git+https://...`, fully durable via package.json
64
- * - **Workshop** — `workshop:name#ref`, durable within the guild via full source on disk
65
- * - **Tarball** — `.tgz` file, durable via full source on disk
66
- * - **Link** — symlinked local dir (dev mode), NOT durable
67
- *
68
- * For npm-installed tools, runtime code lives in node_modules. Metadata
69
- * (descriptor + instructions) is copied to the tool directory for git tracking.
70
- * The `package` field in guild.json tells the manifest engine to resolve by package name.
71
- */
72
- export declare function installTool(opts: InstallToolOptions): InstallResult;
73
- //# sourceMappingURL=install-tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install-tool.d.ts","sourceRoot":"","sources":["../../../src/legacy/1/install-tool.ts"],"names":[],"mappings":"AAkCA;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAElF,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;OAQG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,CAAC;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,uFAAuF;IACvF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAgFD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,OAAe,GAAG,UAAU,CAMhF;AA2KD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,aAAa,CAmKnE"}