@smithers-orchestrator/cli 0.16.5 → 0.16.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithers-orchestrator/cli",
3
- "version": "0.16.5",
3
+ "version": "0.16.7",
4
4
  "description": "Smithers command-line interface, TUI, MCP server, and local workflow tools",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -32,16 +32,16 @@
32
32
  "picocolors": "^1.1.1",
33
33
  "react": "^19.2.5",
34
34
  "zod": "^4.3.6",
35
- "@smithers-orchestrator/components": "0.16.5",
36
- "@smithers-orchestrator/agents": "0.16.5",
37
- "@smithers-orchestrator/observability": "0.16.5",
38
- "@smithers-orchestrator/driver": "0.16.5",
39
- "@smithers-orchestrator/db": "0.16.5",
40
- "@smithers-orchestrator/errors": "0.16.5",
41
- "@smithers-orchestrator/scheduler": "0.16.5",
42
- "@smithers-orchestrator/server": "0.16.5",
43
- "@smithers-orchestrator/time-travel": "0.16.5",
44
- "smithers-orchestrator": "0.16.5"
35
+ "@smithers-orchestrator/agents": "0.16.7",
36
+ "@smithers-orchestrator/components": "0.16.7",
37
+ "@smithers-orchestrator/db": "0.16.7",
38
+ "@smithers-orchestrator/driver": "0.16.7",
39
+ "smithers-orchestrator": "0.16.7",
40
+ "@smithers-orchestrator/time-travel": "0.16.7",
41
+ "@smithers-orchestrator/errors": "0.16.7",
42
+ "@smithers-orchestrator/server": "0.16.7",
43
+ "@smithers-orchestrator/observability": "0.16.7",
44
+ "@smithers-orchestrator/scheduler": "0.16.7"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/bun": "latest",
package/src/index.js CHANGED
@@ -1320,6 +1320,7 @@ const revertOptions = z.object({
1320
1320
  });
1321
1321
  const initOptions = z.object({
1322
1322
  force: z.boolean().default(false).describe("Overwrite existing scaffold files"),
1323
+ install: z.boolean().default(true).describe("Run `bun install` inside .smithers/ after scaffolding (--no-install to skip)"),
1323
1324
  });
1324
1325
  const workflowPathArgs = z.object({
1325
1326
  name: z.string().describe("Workflow ID"),
@@ -2248,7 +2249,10 @@ const cli = Cli.create({
2248
2249
  return c.error(opts);
2249
2250
  };
2250
2251
  try {
2251
- const result = initWorkflowPack({ force: c.options.force });
2252
+ const result = initWorkflowPack({
2253
+ force: c.options.force,
2254
+ skipInstall: !c.options.install,
2255
+ });
2252
2256
  return c.ok(result, {
2253
2257
  cta: {
2254
2258
  description: "Next steps:",
@@ -1,12 +1,16 @@
1
+ import { spawnSync } from "node:child_process";
1
2
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
3
  import { dirname, resolve } from "node:path";
3
4
  import { fileURLToPath } from "node:url";
4
5
  import { generateAgentsTs } from "./agent-detection.js";
5
6
  /**
6
- * @typedef {{ force?: boolean; rootDir?: string; }} InitOptions
7
+ * @typedef {{ force?: boolean; rootDir?: string; skipInstall?: boolean; }} InitOptions
7
8
  */
8
9
  /**
9
- * @typedef {{ rootDir: string; writtenFiles: string[]; skippedFiles: string[]; preservedPaths: string[]; }} InitResult
10
+ * @typedef {{ status: "ok" | "skipped" | "failed"; reason?: string; }} InitInstallResult
11
+ */
12
+ /**
13
+ * @typedef {{ rootDir: string; writtenFiles: string[]; skippedFiles: string[]; preservedPaths: string[]; install: InitInstallResult; }} InitResult
10
14
  */
11
15
  /**
12
16
  * @typedef {{ command: string; description: string; }} WorkflowCta
@@ -103,6 +107,7 @@ function renderPackageJson(versions) {
103
107
  "workflow:implement": "smithers workflow implement",
104
108
  },
105
109
  dependencies: {
110
+ skills: "github:mattpocock/skills",
106
111
  "smithers-orchestrator": "latest",
107
112
  zod: versions.zodVersion,
108
113
  },
@@ -2108,13 +2113,45 @@ export function initWorkflowPack(options = {}) {
2108
2113
  writeFileSync(absolutePath, file.contents, "utf8");
2109
2114
  writtenFiles.push(absolutePath);
2110
2115
  }
2116
+ const install = runBunInstall(rootDir, options.skipInstall ?? false);
2111
2117
  return {
2112
2118
  rootDir,
2113
2119
  writtenFiles,
2114
2120
  skippedFiles,
2115
2121
  preservedPaths,
2122
+ install,
2116
2123
  };
2117
2124
  }
2125
+ /**
2126
+ * Install `.smithers/` workspace deps so git-specifier packages like
2127
+ * `github:mattpocock/skills` — which Bun's runtime auto-install doesn't fetch —
2128
+ * are available the first time a workflow runs. Failures here don't fail init:
2129
+ * the scaffold is on disk, the user can always re-run `bun install` by hand.
2130
+ *
2131
+ * @param {string} rootDir
2132
+ * @param {boolean} skip
2133
+ * @returns {InitInstallResult}
2134
+ */
2135
+ function runBunInstall(rootDir, skip) {
2136
+ if (skip) return { status: "skipped", reason: "skip-install" };
2137
+ const result = spawnSync("bun", ["install"], {
2138
+ cwd: rootDir,
2139
+ stdio: "inherit",
2140
+ });
2141
+ if (result.error && /** @type {NodeJS.ErrnoException} */ (result.error).code === "ENOENT") {
2142
+ return {
2143
+ status: "failed",
2144
+ reason: "`bun` not found on PATH; run `bun install` inside .smithers/ manually",
2145
+ };
2146
+ }
2147
+ if (result.status !== 0) {
2148
+ return {
2149
+ status: "failed",
2150
+ reason: `bun install exited with status ${result.status ?? "unknown"}; run it manually inside .smithers/`,
2151
+ };
2152
+ }
2153
+ return { status: "ok" };
2154
+ }
2118
2155
  const WORKFLOW_FOLLOW_UPS = {
2119
2156
  "research": [
2120
2157
  { command: "workflow run write-a-prd", description: "Formalize findings into a PRD" },