@stackbone/cli 0.2.1 → 0.2.3

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/CHANGELOG.md CHANGED
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.3] - 2026-07-06
11
+
12
+ ### Fixed
13
+
14
+ - **`stackbone init` (and every other command) could crash with `ERR_MODULE_NOT_FOUND: Cannot find package 'drizzle-orm'`** on some `pnpm dlx`/global-install layouts. The CLI carried a dead "marker import" of `drizzle-kit/api` purely so the bundler would register `drizzle-kit` as a dependency — but that import is loaded eagerly on every CLI boot, and `drizzle-kit/api` itself requires `drizzle-orm` without declaring it as a dependency. On pnpm setups with an isolated `node_modules` layout, `drizzle-kit` can't see `drizzle-orm` even when it's installed right next to it, so the CLI crashed before running any command. Removed the marker import; `drizzle-kit` is now declared explicitly in the build config instead, and the CLI only touches `drizzle-kit` at all when a migration is genuinely being generated (`db migrate create`, or `stackbone dev`'s auto-migrate).
15
+
16
+ ## [0.2.2] - 2026-07-06
17
+
18
+ ### Fixed
19
+
20
+ - **The Studio "Logs" panel showed nothing in `stackbone dev`.** That panel
21
+ (live SSE tail) expected the agent to run as a separate child process, whose
22
+ stdout/stderr `startAgentProcess` captures and republishes — that's how
23
+ cloud and self-host work today. But locally, deep agents and workflow steps
24
+ run IN-PROCESS inside the CLI/emulator (no child to pipe), so a bare
25
+ `console.log` in agent or workflow code only ever reached the terminal
26
+ running `stackbone dev`, never the bus the panel reads from. The
27
+ orchestrator now bridges the process's own `console.log`/`info`/`debug`/
28
+ `warn`/`error` calls onto the same `agent.log` event the panel already
29
+ consumes (`bridgeProcessStdioToBus` in `@stackbone/agent-runner`), wired
30
+ right after the emulator boots. It patches `console.*` rather than the raw
31
+ `process.stdout`/`stderr` streams on purpose — `@clack/prompts` spinners
32
+ write their redraw frames straight to those streams, bypassing `console`,
33
+ so this leaves the boot/reload UI untouched.
34
+
10
35
  ## [0.2.1] - 2026-07-06
11
36
 
12
37
  ### Added
package/main.js CHANGED
@@ -21,6 +21,7 @@ import addFormats from "ajv-formats";
21
21
  import PgQueryFactory from "pg-query-emscripten";
22
22
  import { createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
23
23
  import { exec, execFile, spawn } from "node:child_process";
24
+ import { format, promisify } from "node:util";
24
25
  import { parse } from "yaml";
25
26
  import { build } from "esbuild";
26
27
  import { Queue, Worker } from "bullmq";
@@ -29,7 +30,6 @@ import postgres from "postgres";
29
30
  import OpenAI from "openai";
30
31
  import { DeleteObjectCommand, GetObjectCommand, ListObjectsV2Command, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
31
32
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
32
- import { promisify } from "node:util";
33
33
  import { and, asc, count, countDistinct, desc, eq, gt, max, sql } from "drizzle-orm";
34
34
  import { check, customType, index, integer, jsonb, pgSchema, pgTable, text, timestamp, uniqueIndex, uuid, vector } from "drizzle-orm/pg-core";
35
35
  import Ajv$1 from "ajv";
@@ -38,7 +38,6 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
38
38
  import { cancel, intro, isCancel, log, note, outro, select, spinner, text as text$1 } from "@clack/prompts";
39
39
  import open$1 from "open";
40
40
  import { readMigrationFiles } from "drizzle-orm/migrator";
41
- import "drizzle-kit/api";
42
41
  import { createServer } from "node:net";
43
42
  import { create } from "tar";
44
43
  import { Readable } from "node:stream";
@@ -2989,7 +2988,7 @@ var DEV_HMAC_SECRET = "dev-stackbone-local-emulator-hmac-secret";
2989
2988
  //#endregion
2990
2989
  //#region ../../libs/runtime/agent-emulator/src/lib/server/contract.ts
2991
2990
  init_src$14();
2992
- var STACKBONE_CLI_BUILD_VERSION = "0.2.1";
2991
+ var STACKBONE_CLI_BUILD_VERSION = "0.2.3";
2993
2992
  /**
2994
2993
  * Capabilities the local emulator advertises on `GET /api/contract`, derived
2995
2994
  * from the route registry above so the advertised set and the mounted routes
@@ -3020,7 +3019,11 @@ var buildContractResponse = () => contractResponseSchema.parse({
3020
3019
  });
3021
3020
  //#endregion
3022
3021
  //#region ../../libs/runtime/agent-emulator/src/lib/server/cors.ts
3023
- var DEFAULT_ALLOWED_ORIGINS = ["https://app.stackbone.ai", "http://localhost:*"];
3022
+ var DEFAULT_ALLOWED_ORIGINS = [
3023
+ "https://app.stackbone.ai",
3024
+ "https://chat.stackbone.ai",
3025
+ "http://localhost:*"
3026
+ ];
3024
3027
  var escapeRegex = (input) => input.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
3025
3028
  var compilePattern = (pattern) => {
3026
3029
  const escaped = escapeRegex(pattern.trim()).replace(/\*/g, "[^/.]+");
@@ -3975,6 +3978,44 @@ var createFixturesStore = (opts) => {
3975
3978
  };
3976
3979
  };
3977
3980
  //#endregion
3981
+ //#region ../../libs/runtime/agent-runner/src/lib/live-stdio-bridge.ts
3982
+ var CONSOLE_METHODS, STREAM_FOR_METHOD, bridgeProcessStdioToBus;
3983
+ var init_live_stdio_bridge = __esmMin((() => {
3984
+ CONSOLE_METHODS = [
3985
+ "log",
3986
+ "info",
3987
+ "debug",
3988
+ "warn",
3989
+ "error"
3990
+ ];
3991
+ STREAM_FOR_METHOD = {
3992
+ log: "stdout",
3993
+ info: "stdout",
3994
+ debug: "stdout",
3995
+ warn: "stderr",
3996
+ error: "stderr"
3997
+ };
3998
+ bridgeProcessStdioToBus = (sink) => {
3999
+ const originals = {};
4000
+ for (const method of CONSOLE_METHODS) {
4001
+ const original = console[method];
4002
+ originals[method] = original;
4003
+ console[method] = (...args) => {
4004
+ original.call(console, ...args);
4005
+ sink.publish({
4006
+ type: "agent.log",
4007
+ ts: Date.now(),
4008
+ stream: STREAM_FOR_METHOD[method],
4009
+ line: format(...args)
4010
+ });
4011
+ };
4012
+ }
4013
+ return { stop() {
4014
+ for (const method of CONSOLE_METHODS) console[method] = originals[method];
4015
+ } };
4016
+ };
4017
+ }));
4018
+ //#endregion
3978
4019
  //#region ../../libs/runtime/agent-runner/src/lib/connections.ts
3979
4020
  var STACKBONE_ENV_KEYS, buildAgentEnv;
3980
4021
  var init_connections = __esmMin((() => {
@@ -4405,6 +4446,7 @@ var init_log_tail = __esmMin((() => {
4405
4446
  //#endregion
4406
4447
  //#region ../../libs/runtime/agent-runner/src/index.ts
4407
4448
  var init_src$10 = __esmMin((() => {
4449
+ init_live_stdio_bridge();
4408
4450
  init_src$14();
4409
4451
  init_connections();
4410
4452
  init_agent_runtime_deps();
@@ -32237,6 +32279,7 @@ var startDevSession = async (input) => {
32237
32279
  let workflowWatcher = null;
32238
32280
  let deepAgentsWatcher = null;
32239
32281
  let configSchemaWatcher = null;
32282
+ let liveStdioBridge = null;
32240
32283
  let stopping = false;
32241
32284
  let shutdownResolve = () => void 0;
32242
32285
  const shutdown = new Promise((resolve) => {
@@ -32245,6 +32288,7 @@ var startDevSession = async (input) => {
32245
32288
  const stop = async () => {
32246
32289
  if (stopping) return shutdown;
32247
32290
  stopping = true;
32291
+ if (liveStdioBridge) liveStdioBridge.stop();
32248
32292
  if (configSchemaWatcher) await configSchemaWatcher.close().catch(() => void 0);
32249
32293
  if (deepAgentsWatcher) await deepAgentsWatcher.close().catch(() => void 0);
32250
32294
  if (workflowWatcher) await workflowWatcher.close().catch(() => void 0);
@@ -32495,6 +32539,7 @@ var startDevSession = async (input) => {
32495
32539
  status: "success",
32496
32540
  detail: armed > 0 ? `${emulator.url} · ${armed} trigger${armed === 1 ? "" : "s"} armed` : emulator.url
32497
32541
  });
32542
+ liveStdioBridge = bridgeProcessStdioToBus(bus);
32498
32543
  const das = emulator.deepAgents;
32499
32544
  if (das.length > 0) {
32500
32545
  const models = [...new Set(das.map((a) => a.model))];
@@ -35132,6 +35177,7 @@ is for offline work or when the relay handshake fails.
35132
35177
  The emulator enforces an explicit CORS allowlist (no \`*\`). Default origins:
35133
35178
 
35134
35179
  - \`https://app.stackbone.ai\`
35180
+ - \`https://chat.stackbone.ai\`
35135
35181
  - \`http://localhost:*\` (any port; covers any local dev server you run)
35136
35182
 
35137
35183
  Add origins **per-repo** via \`stackbone.config.json\` at the project root
@@ -35143,6 +35189,7 @@ Add origins **per-repo** via \`stackbone.config.json\` at the project root
35143
35189
  "studio": {
35144
35190
  "corsOrigins": [
35145
35191
  "https://app.stackbone.ai",
35192
+ "https://chat.stackbone.ai",
35146
35193
  "https://staging.stackbone.ai",
35147
35194
  "http://localhost:*",
35148
35195
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackbone/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "bin": {
Binary file
Binary file