swarmkit 0.0.6 → 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 +244 -15
  37. package/dist/packages/setup.test.js +520 -13
  38. package/package.json +1 -1
@@ -41,13 +41,30 @@ export async function initProject(state) {
41
41
  embeddingProvider: state.embeddingProvider,
42
42
  apiKeys: state.apiKeys,
43
43
  usePrefix: state.usePrefix,
44
+ packageConfigs: state.packageConfigs,
44
45
  };
45
46
  ui.blank();
46
47
  for (const pkg of uninitialized) {
48
+ // Skip packages whose CLI wizard already ran in the config phase
49
+ if (state.packageConfigs[pkg]?.usedCliWizard) {
50
+ const configDir = configDirs[pkg] ?? "";
51
+ ui.success(`${pkg} ${chalk.dim("→")} ${configDir}/ ${chalk.dim("(configured via wizard)")}`);
52
+ state.configsWritten.push({
53
+ package: pkg,
54
+ path: configDir + "/",
55
+ description: `Project ${pkg} config`,
56
+ });
57
+ continue;
58
+ }
47
59
  const result = await initProjectPackage(pkg, ctx);
48
60
  const configDir = configDirs[pkg] ?? "";
49
61
  if (result.success) {
50
62
  ui.success(`${pkg} ${chalk.dim("→")} ${configDir}/`);
63
+ state.configsWritten.push({
64
+ package: pkg,
65
+ path: configDir + "/",
66
+ description: `Project ${pkg} config`,
67
+ });
51
68
  }
52
69
  else {
53
70
  ui.fail(`${pkg}: ${result.message ?? "initialization failed"}`);
@@ -0,0 +1,8 @@
1
+ import type { WizardState } from "../state.js";
2
+ /**
3
+ * Phase: Review & next steps.
4
+ *
5
+ * Shows a summary of everything that was set up and provides
6
+ * context-aware suggestions for what to do next.
7
+ */
8
+ export declare function showReview(state: WizardState): Promise<void>;
@@ -0,0 +1,79 @@
1
+ import chalk from "chalk";
2
+ import { getActiveIntegrations } from "../../../packages/registry.js";
3
+ import * as ui from "../../../utils/ui.js";
4
+ /**
5
+ * Phase: Review & next steps.
6
+ *
7
+ * Shows a summary of everything that was set up and provides
8
+ * context-aware suggestions for what to do next.
9
+ */
10
+ export async function showReview(state) {
11
+ console.log();
12
+ console.log(chalk.bold(" Setup complete"));
13
+ console.log();
14
+ // ─── Packages installed ──────────────────────────────────────────
15
+ ui.heading(" Packages");
16
+ for (const pkg of state.selectedPackages) {
17
+ const config = state.packageConfigs[pkg];
18
+ const suffix = config?.usedCliWizard
19
+ ? chalk.dim(" (configured via wizard)")
20
+ : config && Object.keys(config.values).length > 0
21
+ ? chalk.dim(" (custom config)")
22
+ : chalk.dim(" (defaults)");
23
+ ui.success(`${pkg}${suffix}`);
24
+ }
25
+ // ─── Config files written ────────────────────────────────────────
26
+ if (state.configsWritten.length > 0) {
27
+ console.log();
28
+ ui.heading(" Config files");
29
+ for (const entry of state.configsWritten) {
30
+ ui.bullet(` ${chalk.dim(entry.path)} ${chalk.dim("—")} ${entry.description}`);
31
+ }
32
+ }
33
+ // ─── Active integrations ─────────────────────────────────────────
34
+ const integrations = getActiveIntegrations(state.selectedPackages);
35
+ if (integrations.length > 0) {
36
+ console.log();
37
+ ui.heading(" Integrations");
38
+ for (const integration of integrations) {
39
+ const [a, b] = integration.packages;
40
+ const wiring = state.integrationWiring.find((w) => w.key === `${a}:${b}`);
41
+ const status = !integration.requiresWiring
42
+ ? chalk.dim("(auto-detected)")
43
+ : wiring?.enabled
44
+ ? chalk.green("(configured)")
45
+ : chalk.dim("(not configured)");
46
+ ui.bullet(` ${a} ${chalk.dim("↔")} ${b} ${status}`);
47
+ }
48
+ }
49
+ // ─── Next steps ──────────────────────────────────────────────────
50
+ console.log();
51
+ ui.heading(" Next steps");
52
+ const nextSteps = getNextSteps(state.selectedPackages);
53
+ for (const step of nextSteps) {
54
+ ui.bullet(` ${step}`);
55
+ }
56
+ ui.blank();
57
+ }
58
+ function getNextSteps(packages) {
59
+ const steps = [];
60
+ const installed = new Set(packages);
61
+ if (installed.has("self-driving-repo")) {
62
+ steps.push(`Run ${chalk.bold("`sdr compile`")} to generate GitHub Actions workflows`);
63
+ }
64
+ if (installed.has("openhive")) {
65
+ steps.push(`Start OpenHive with ${chalk.bold("`openhive start`")}`);
66
+ }
67
+ if (installed.has("claude-code-swarm")) {
68
+ steps.push(`Launch an agent team with ${chalk.bold("`/swarm`")} in Claude Code`);
69
+ }
70
+ if (installed.has("skill-tree")) {
71
+ steps.push(`Extract skills with ${chalk.bold("`skill-tree extract`")}`);
72
+ }
73
+ if (installed.has("opentasks")) {
74
+ steps.push(`View task graph with ${chalk.bold("`opentasks status`")}`);
75
+ }
76
+ steps.push(`Check your setup with ${chalk.bold("`swarmkit status`")}`);
77
+ steps.push(`Diagnose issues with ${chalk.bold("`swarmkit doctor`")}`);
78
+ return steps;
79
+ }
@@ -1,41 +1,55 @@
1
- import { select, checkbox } from "@inquirer/prompts";
2
- import { BUNDLES, PACKAGES, getAllPackageNames } from "../../../packages/registry.js";
1
+ import { select, confirm } from "@inquirer/prompts";
2
+ import chalk from "chalk";
3
+ import { PACKAGES, CATEGORY_ORDER, CATEGORY_LABELS, getAllPackageNames, } from "../../../packages/registry.js";
4
+ import * as ui from "../../../utils/ui.js";
3
5
  export async function selectUseCase(state) {
4
- const bundleChoice = await select({
5
- message: "What are you building?",
6
+ const choice = await select({
7
+ message: "Package selection:",
6
8
  choices: [
7
- ...Object.values(BUNDLES).map((b) => ({
8
- name: `${b.label} (${b.name} bundle — ${b.packages.length} packages)`,
9
- value: b.name,
10
- })),
11
9
  {
12
- name: "Let me pick individually",
13
- value: "custom",
10
+ name: "All packages (recommended)",
11
+ value: "all",
12
+ },
13
+ {
14
+ name: "Choose manually",
15
+ value: "manual",
14
16
  },
15
17
  ],
16
18
  });
17
- if (bundleChoice === "custom") {
18
- const selected = await checkbox({
19
- message: "Select packages to install:",
20
- choices: getAllPackageNames().map((name) => ({
21
- name: `${name} ${PACKAGES[name].description}`,
22
- value: name,
23
- })),
24
- });
25
- if (selected.length === 0) {
26
- console.log("\n No packages selected.\n");
27
- process.exit(0);
28
- }
19
+ if (choice === "all") {
29
20
  return {
30
21
  ...state,
31
- bundle: "custom",
32
- selectedPackages: selected,
22
+ bundle: "all",
23
+ selectedPackages: getAllPackageNames(),
33
24
  };
34
25
  }
35
- const bundle = BUNDLES[bundleChoice];
26
+ // Walk through packages grouped by category
27
+ const selected = [];
28
+ const allNames = getAllPackageNames();
29
+ for (const category of CATEGORY_ORDER) {
30
+ const packagesInCategory = allNames.filter((name) => PACKAGES[name].category === category);
31
+ if (packagesInCategory.length === 0)
32
+ continue;
33
+ console.log();
34
+ ui.heading(` ${CATEGORY_LABELS[category]}`);
35
+ for (const name of packagesInCategory) {
36
+ const pkg = PACKAGES[name];
37
+ const include = await confirm({
38
+ message: `${chalk.bold(name)} ${chalk.dim(pkg.description)}`,
39
+ default: true,
40
+ });
41
+ if (include) {
42
+ selected.push(name);
43
+ }
44
+ }
45
+ }
46
+ if (selected.length === 0) {
47
+ console.log("\n No packages selected.\n");
48
+ process.exit(0);
49
+ }
36
50
  return {
37
51
  ...state,
38
- bundle: bundleChoice,
39
- selectedPackages: [...bundle.packages],
52
+ bundle: "manual",
53
+ selectedPackages: selected,
40
54
  };
41
55
  }
@@ -0,0 +1 @@
1
+ export {};