swarmkit 0.0.5 → 0.0.7

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 (38) hide show
  1. package/dist/cli.js +2 -0
  2. package/dist/commands/configure/configure.d.ts +5 -0
  3. package/dist/commands/configure/configure.js +354 -0
  4. package/dist/commands/configure/configure.test.d.ts +1 -0
  5. package/dist/commands/configure/configure.test.js +539 -0
  6. package/dist/commands/configure/read-config.d.ts +12 -0
  7. package/dist/commands/configure/read-config.js +81 -0
  8. package/dist/commands/configure.d.ts +2 -0
  9. package/dist/commands/configure.js +14 -0
  10. package/dist/commands/init/phases/configure.js +0 -21
  11. package/dist/commands/init/phases/global-setup.d.ts +1 -1
  12. package/dist/commands/init/phases/global-setup.js +22 -44
  13. package/dist/commands/init/phases/integrations.d.ts +16 -0
  14. package/dist/commands/init/phases/integrations.js +172 -0
  15. package/dist/commands/init/phases/package-config.d.ts +10 -0
  16. package/dist/commands/init/phases/package-config.js +117 -0
  17. package/dist/commands/init/phases/phases.test.d.ts +1 -0
  18. package/dist/commands/init/phases/phases.test.js +711 -0
  19. package/dist/commands/init/phases/project.js +17 -0
  20. package/dist/commands/init/phases/review.d.ts +8 -0
  21. package/dist/commands/init/phases/review.js +79 -0
  22. package/dist/commands/init/phases/use-case.js +41 -27
  23. package/dist/commands/init/phases/wizard-flow.test.d.ts +1 -0
  24. package/dist/commands/init/phases/wizard-flow.test.js +657 -0
  25. package/dist/commands/init/phases/wizard-modes.test.d.ts +1 -0
  26. package/dist/commands/init/phases/wizard-modes.test.js +270 -0
  27. package/dist/commands/init/state.d.ts +31 -1
  28. package/dist/commands/init/state.js +4 -0
  29. package/dist/commands/init/state.test.js +7 -0
  30. package/dist/commands/init/wizard.d.ts +1 -0
  31. package/dist/commands/init/wizard.js +31 -23
  32. package/dist/commands/init.js +2 -0
  33. package/dist/packages/registry.d.ts +66 -0
  34. package/dist/packages/registry.js +258 -0
  35. package/dist/packages/setup.d.ts +42 -0
  36. package/dist/packages/setup.js +311 -56
  37. package/dist/packages/setup.test.js +546 -42
  38. package/package.json +1 -1
@@ -3,6 +3,28 @@ export const PACKAGES = {
3
3
  name: "self-driving-repo",
4
4
  description: "Event-driven workflow engine for autonomous GitHub SDLC",
5
5
  category: "orchestration",
6
+ setup: {
7
+ cliWizard: {
8
+ command: "sdr",
9
+ args: ["init"],
10
+ nonInteractiveArgs: ["init", "-t", "triage-only"],
11
+ timeout: 180_000,
12
+ },
13
+ inlineOptions: [
14
+ {
15
+ key: "template",
16
+ label: "Workflow template:",
17
+ type: "select",
18
+ default: "triage-only",
19
+ choices: [
20
+ { name: "Triage only — issue triage and labeling", value: "triage-only" },
21
+ { name: "Full pipeline — end-to-end SDLC automation", value: "full-pipeline" },
22
+ { name: "PR review — automated code review", value: "pr-review" },
23
+ { name: "Empty — start from scratch", value: "empty" },
24
+ ],
25
+ },
26
+ ],
27
+ },
6
28
  },
7
29
  "multi-agent-protocol": {
8
30
  name: "multi-agent-protocol",
@@ -14,41 +36,203 @@ export const PACKAGES = {
14
36
  name: "opentasks",
15
37
  description: "Cross-system graph for tasks, specs, and relationships",
16
38
  category: "tasks",
39
+ setup: {
40
+ cliWizard: {
41
+ command: "opentasks",
42
+ args: ["init"],
43
+ },
44
+ },
17
45
  },
18
46
  "cognitive-core": {
19
47
  name: "cognitive-core",
20
48
  description: "Learning system — trajectories to playbooks to guidance",
21
49
  category: "learning",
50
+ // No setup config — auto-detects minimem at runtime
22
51
  },
23
52
  minimem: {
24
53
  name: "minimem",
25
54
  description: "File-based memory with hybrid vector + full-text search",
26
55
  category: "learning",
56
+ setup: {
57
+ cliWizard: {
58
+ command: "minimem",
59
+ args: ["init"],
60
+ },
61
+ inlineOptions: [
62
+ {
63
+ key: "hybrid.vectorWeight",
64
+ label: "Vector search weight (0-1):",
65
+ type: "input",
66
+ default: "0.7",
67
+ },
68
+ {
69
+ key: "hybrid.textWeight",
70
+ label: "Text search weight (0-1):",
71
+ type: "input",
72
+ default: "0.3",
73
+ },
74
+ {
75
+ key: "query.maxResults",
76
+ label: "Max search results:",
77
+ type: "input",
78
+ default: "10",
79
+ },
80
+ {
81
+ key: "query.minScore",
82
+ label: "Min relevance score (0-1):",
83
+ type: "input",
84
+ default: "0.3",
85
+ },
86
+ ],
87
+ },
27
88
  },
28
89
  "skill-tree": {
29
90
  name: "skill-tree",
30
91
  description: "Versioned skill extraction, evolution, and serving",
31
92
  category: "learning",
93
+ setup: {
94
+ cliWizard: {
95
+ command: "skill-tree",
96
+ args: ["config", "init"],
97
+ },
98
+ },
32
99
  },
33
100
  openhive: {
34
101
  name: "openhive",
35
102
  description: "Self-hostable social network and coordination hub for agents",
36
103
  category: "interface",
104
+ setup: {
105
+ cliWizard: {
106
+ command: "openhive",
107
+ args: ["init"],
108
+ nonInteractiveArgs: ["init", "--name", "OpenHive", "--port", "3000",
109
+ "--auth-mode", "local", "--verification", "open"],
110
+ timeout: 180_000,
111
+ },
112
+ inlineOptions: [
113
+ {
114
+ key: "name",
115
+ label: "OpenHive instance name:",
116
+ type: "input",
117
+ default: "OpenHive",
118
+ },
119
+ {
120
+ key: "port",
121
+ label: "OpenHive port:",
122
+ type: "input",
123
+ default: "3000",
124
+ },
125
+ {
126
+ key: "verification",
127
+ label: "Registration mode:",
128
+ type: "select",
129
+ choices: [
130
+ { name: "Open — anyone can register", value: "open" },
131
+ { name: "Invite — require an invite code", value: "invite" },
132
+ { name: "Manual — admin approves each", value: "manual" },
133
+ ],
134
+ },
135
+ {
136
+ key: "authMode",
137
+ label: "Auth mode:",
138
+ type: "select",
139
+ choices: [
140
+ { name: "Local — no login, single-user", value: "local" },
141
+ { name: "Token — email/password registration", value: "token" },
142
+ ],
143
+ },
144
+ ],
145
+ },
37
146
  },
38
147
  openteams: {
39
148
  name: "openteams",
40
149
  description: "Team topology definitions and agent role generation",
41
150
  category: "orchestration",
151
+ setup: {
152
+ cliWizard: {
153
+ command: "openteams",
154
+ args: ["template", "init"],
155
+ },
156
+ },
42
157
  },
43
158
  sessionlog: {
44
159
  name: "sessionlog",
45
160
  description: "Git-integrated session capture with rewind and search",
46
161
  category: "observability",
162
+ setup: {
163
+ inlineOptions: [
164
+ {
165
+ key: "enabled",
166
+ label: "Enable session logging by default?",
167
+ type: "confirm",
168
+ default: false,
169
+ },
170
+ {
171
+ key: "strategy",
172
+ label: "Commit strategy:",
173
+ type: "select",
174
+ default: "manual-commit",
175
+ choices: [
176
+ { name: "Manual commit — you decide when to save", value: "manual-commit" },
177
+ { name: "Auto commit — save after each session", value: "auto-commit" },
178
+ ],
179
+ },
180
+ {
181
+ key: "sessionRepo.remote",
182
+ label: "Session repo remote URL (e.g. git@github.com:org/sessions.git, blank to skip):",
183
+ type: "input",
184
+ default: "",
185
+ },
186
+ {
187
+ key: "sessionRepo.directory",
188
+ label: "Subdirectory in session repo for this project (blank for auto):",
189
+ type: "input",
190
+ default: "",
191
+ },
192
+ {
193
+ key: "summarizationEnabled",
194
+ label: "Enable session summarization?",
195
+ type: "confirm",
196
+ default: false,
197
+ },
198
+ ],
199
+ },
47
200
  },
48
201
  "claude-code-swarm": {
49
202
  name: "claude-code-swarm",
50
203
  description: "Claude Code plugin for agent team orchestration with openteams templates",
51
204
  category: "orchestration",
205
+ setup: {
206
+ inlineOptions: [
207
+ {
208
+ key: "map.enabled",
209
+ label: "Enable MAP (Multi-Agent Protocol) observability?",
210
+ type: "confirm",
211
+ default: false,
212
+ },
213
+ {
214
+ key: "map.server",
215
+ label: "MAP server URL:",
216
+ type: "input",
217
+ default: "ws://localhost:8080",
218
+ when: (packages) => packages.includes("multi-agent-protocol"),
219
+ },
220
+ {
221
+ key: "map.scope",
222
+ label: "MAP scope (project identifier):",
223
+ type: "input",
224
+ default: "",
225
+ when: (packages) => packages.includes("multi-agent-protocol"),
226
+ },
227
+ {
228
+ key: "sessionlog.enabled",
229
+ label: "Enable sessionlog bridging?",
230
+ type: "confirm",
231
+ default: false,
232
+ when: (packages) => packages.includes("sessionlog"),
233
+ },
234
+ ],
235
+ },
52
236
  },
53
237
  };
54
238
  export const BUNDLES = {
@@ -93,22 +277,78 @@ export const INTEGRATIONS = [
93
277
  {
94
278
  packages: ["cognitive-core", "minimem"],
95
279
  description: "cognitive-core uses minimem as search layer",
280
+ requiresWiring: false,
96
281
  },
97
282
  {
98
283
  packages: ["cognitive-core", "skill-tree"],
99
284
  description: "skill-tree delegates to cognitive-core for batch learning",
285
+ requiresWiring: false,
100
286
  },
101
287
  {
102
288
  packages: ["claude-code-swarm", "openteams"],
103
289
  description: "claude-code-swarm uses openteams for team topology definitions",
290
+ requiresWiring: true,
291
+ configOptions: [
292
+ {
293
+ key: "template",
294
+ label: "Default team template:",
295
+ type: "input",
296
+ default: "",
297
+ targetPackage: "claude-code-swarm",
298
+ configPath: "template",
299
+ },
300
+ ],
104
301
  },
105
302
  {
106
303
  packages: ["claude-code-swarm", "multi-agent-protocol"],
107
304
  description: "claude-code-swarm uses MAP for external agent observability",
305
+ requiresWiring: true,
306
+ configOptions: [
307
+ {
308
+ key: "mapEnabled",
309
+ label: "Enable MAP observability?",
310
+ type: "confirm",
311
+ default: false,
312
+ targetPackage: "claude-code-swarm",
313
+ configPath: "map.enabled",
314
+ },
315
+ {
316
+ key: "mapServer",
317
+ label: "MAP server URL:",
318
+ type: "input",
319
+ default: "ws://localhost:8080",
320
+ targetPackage: "claude-code-swarm",
321
+ configPath: "map.server",
322
+ },
323
+ ],
108
324
  },
109
325
  {
110
326
  packages: ["claude-code-swarm", "sessionlog"],
111
327
  description: "claude-code-swarm bridges sessionlog data to MAP via trajectory protocol",
328
+ requiresWiring: true,
329
+ configOptions: [
330
+ {
331
+ key: "sessionBridging",
332
+ label: "Enable session data bridging?",
333
+ type: "confirm",
334
+ default: false,
335
+ targetPackage: "claude-code-swarm",
336
+ configPath: "sessionlog.enabled",
337
+ },
338
+ {
339
+ key: "sessionSync",
340
+ label: "Session sync mode:",
341
+ type: "select",
342
+ default: "off",
343
+ choices: [
344
+ { name: "Off — no syncing", value: "off" },
345
+ { name: "On finish — sync when session ends", value: "on-finish" },
346
+ { name: "Live — real-time sync", value: "live" },
347
+ ],
348
+ targetPackage: "claude-code-swarm",
349
+ configPath: "sessionlog.sync",
350
+ },
351
+ ],
112
352
  },
113
353
  ];
114
354
  /** Get all package names in a bundle */
@@ -152,3 +392,21 @@ export function isKnownPackage(name) {
152
392
  export function getAllPackageNames() {
153
393
  return Object.keys(PACKAGES);
154
394
  }
395
+ /** Category display order for manual package selection */
396
+ export const CATEGORY_ORDER = [
397
+ "tasks",
398
+ "learning",
399
+ "orchestration",
400
+ "observability",
401
+ "interface",
402
+ "protocol",
403
+ ];
404
+ /** Human-readable category labels */
405
+ export const CATEGORY_LABELS = {
406
+ tasks: "Tasks & Planning",
407
+ learning: "Learning & Memory",
408
+ orchestration: "Orchestration",
409
+ observability: "Observability",
410
+ interface: "Interface",
411
+ protocol: "Protocol",
412
+ };
@@ -1,3 +1,5 @@
1
+ import type { PackageSetupConfig } from "./registry.js";
2
+ import type { PackageConfig, WizardState } from "../commands/init/state.js";
1
3
  export interface InitContext {
2
4
  /** Project root directory */
3
5
  cwd: string;
@@ -9,6 +11,8 @@ export interface InitContext {
9
11
  apiKeys: Record<string, string>;
10
12
  /** Whether to nest project configs under .swarm/ (default true) */
11
13
  usePrefix: boolean;
14
+ /** Per-package config overrides from the interactive config phase */
15
+ packageConfigs?: Record<string, PackageConfig>;
12
16
  }
13
17
  export interface GlobalContext {
14
18
  /** All selected packages */
@@ -17,6 +21,8 @@ export interface GlobalContext {
17
21
  embeddingProvider: "openai" | "gemini" | "local" | null;
18
22
  /** Stored API keys */
19
23
  apiKeys: Record<string, string>;
24
+ /** Per-package config overrides from the interactive config phase */
25
+ packageConfigs?: Record<string, PackageConfig>;
20
26
  }
21
27
  export interface OpenhiveOptions {
22
28
  name: string;
@@ -30,6 +36,37 @@ export interface SetupResult {
30
36
  success: boolean;
31
37
  message?: string;
32
38
  }
39
+ export interface WizardRunOptions {
40
+ /** Working directory for the spawned process */
41
+ cwd?: string;
42
+ /**
43
+ * When true (default), the wizard takes over the terminal with stdio: "inherit".
44
+ * When false, runs non-interactively with stdio: "pipe" and uses nonInteractiveArgs
45
+ * if available. Use false for --quick mode, CI, and testing.
46
+ */
47
+ interactive?: boolean;
48
+ }
49
+ /**
50
+ * Run a package's own setup wizard.
51
+ *
52
+ * In interactive mode (default): uses `stdio: 'inherit'` so the package's
53
+ * prompts take over the terminal.
54
+ *
55
+ * In non-interactive mode: uses `stdio: 'pipe'` with `nonInteractiveArgs`
56
+ * (falling back to `args`), suitable for --quick mode, CI, and testing.
57
+ */
58
+ export declare function runPackageWizard(pkg: string, wizardConfig: NonNullable<PackageSetupConfig["cliWizard"]>, state: WizardState, opts?: WizardRunOptions | string): Promise<SetupResult>;
59
+ /**
60
+ * Env var overrides that tell each package's CLI to create config in the
61
+ * .swarm/<pkg>/ prefix layout instead of the default flat location.
62
+ * Used by both initProjectPackage (via shellInit) and runPackageWizard.
63
+ */
64
+ export declare const PREFIX_ENV_VARS: Record<string, string>;
65
+ /**
66
+ * Flat dir name → prefixed dir name for relocation after CLI wizard runs.
67
+ * Packages that create at .<name>/ need relocation to .swarm/<name>/.
68
+ */
69
+ export declare const RELOCATE_MAP: Record<string, [string, string]>;
33
70
  /** Root directory for all swarmkit project-level config */
34
71
  export declare const PROJECT_ROOT = ".swarm";
35
72
  /** Config directories with .swarm/ prefix (default layout) */
@@ -38,6 +75,11 @@ export declare const PROJECT_CONFIG_DIRS: Record<string, string>;
38
75
  export declare const FLAT_PROJECT_CONFIG_DIRS: Record<string, string>;
39
76
  /** Get config dirs for the given mode */
40
77
  export declare function projectConfigDirs(usePrefix: boolean): Record<string, string>;
78
+ /**
79
+ * After a CLI wizard runs for a project-level package, relocate its output
80
+ * from the flat location to the .swarm/ prefix location if needed.
81
+ */
82
+ export declare function relocateAfterWizard(cwd: string, pkg: string, usePrefix: boolean): void;
41
83
  /**
42
84
  * Project-level packages in correct init order.
43
85
  * Order matters: minimem before cognitive-core (runtime detection).