@buildautomaton/cli 0.1.92 → 0.1.93

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/dist/index.js CHANGED
@@ -20762,7 +20762,6 @@ import os from "node:os";
20762
20762
  var INDEX_WORK_YIELD_EVERY, INDEX_DIR, INDEX_HASH_LEN;
20763
20763
  var init_constants = __esm({
20764
20764
  "../bridge/src/files/index/constants.ts"() {
20765
- "use strict";
20766
20765
  INDEX_WORK_YIELD_EVERY = 128;
20767
20766
  INDEX_DIR = path3.join(os.homedir(), ".buildautomaton");
20768
20767
  INDEX_HASH_LEN = 16;
@@ -21109,7 +21108,6 @@ var init_idle_yield = __esm({
21109
21108
  // ../bridge/src/files/browser/in-flight.ts
21110
21109
  var init_in_flight = __esm({
21111
21110
  "../bridge/src/files/browser/in-flight.ts"() {
21112
- "use strict";
21113
21111
  init_activity_shared();
21114
21112
  init_activity_types();
21115
21113
  init_activity_tracker();
@@ -21127,6 +21125,7 @@ function isCliSqliteLockError(e) {
21127
21125
  var CliSqliteInterrupted;
21128
21126
  var init_sqlite_errors = __esm({
21129
21127
  "../bridge/src/sqlite/sqlite-errors.ts"() {
21128
+ "use strict";
21130
21129
  CliSqliteInterrupted = class extends Error {
21131
21130
  name = "CliSqliteInterrupted";
21132
21131
  constructor() {
@@ -21924,6 +21923,7 @@ function withCodeNavCacheSqliteWorkLock(fn) {
21924
21923
  var chain, workLockDepth;
21925
21924
  var init_code_nav_cache_sqlite_work_lock = __esm({
21926
21925
  "../bridge/src/sqlite/code-nav-cache/code-nav-cache-sqlite-work-lock.ts"() {
21926
+ "use strict";
21927
21927
  init_code_nav_cache_paths();
21928
21928
  chain = Promise.resolve();
21929
21929
  workLockDepth = 0;
@@ -22065,6 +22065,7 @@ async function ensureCodeNavCacheSqliteInitialized() {
22065
22065
  var safeCloseCodeNavCacheSqliteDatabase, openCodeNavCacheSqliteConnection;
22066
22066
  var init_database = __esm({
22067
22067
  "../bridge/src/sqlite/code-nav-cache/database.ts"() {
22068
+ "use strict";
22068
22069
  init_code_nav_cache_availability();
22069
22070
  init_instance();
22070
22071
  init_sqlite_errors();
@@ -27708,7 +27709,7 @@ function formatSpawnError(err, command) {
27708
27709
  }
27709
27710
 
27710
27711
  // ../bridge/src/agents/acp/clients/kill-process-tree.ts
27711
- var import_tree_kill = __toESM(require_tree_kill(), 1);
27712
+ var import_tree_kill = __toESM(require_tree_kill());
27712
27713
  import { promisify } from "node:util";
27713
27714
  var treeKillAsync = promisify(import_tree_kill.default);
27714
27715
  var ACP_PROCESS_TREE_KILL_GRACE_MS = 2500;
@@ -32921,6 +32922,24 @@ var RoleLengthWireSchema = external_exports.discriminatedUnion("type", [
32921
32922
  external_exports.object({ type: external_exports.literal("session_count"), max_sessions: MaxSessionsSchema })
32922
32923
  ]);
32923
32924
 
32925
+ // ../types/src/role-access-restrictions.ts
32926
+ var EMPTY_ROLE_ACCESS_RESTRICTIONS = {
32927
+ sessionsOwnAndExplicitOnly: false,
32928
+ bridgesOwnAndExplicitOnly: false,
32929
+ sessionsReadOnlyExceptOwn: false,
32930
+ codeChangesAgentModifiedOnly: false,
32931
+ codeChangesHidden: false
32932
+ };
32933
+ function roleAccessRestrictionsToWire(restrictions) {
32934
+ return {
32935
+ sessions_own_and_explicit_only: restrictions.sessionsOwnAndExplicitOnly,
32936
+ bridges_own_and_explicit_only: restrictions.bridgesOwnAndExplicitOnly,
32937
+ sessions_read_only_except_own: restrictions.sessionsReadOnlyExceptOwn,
32938
+ code_changes_agent_modified_only: restrictions.codeChangesAgentModifiedOnly,
32939
+ code_changes_hidden: restrictions.codeChangesHidden
32940
+ };
32941
+ }
32942
+
32924
32943
  // ../types/src/role-details.ts
32925
32944
  var InitialPeriodDaysSchema = external_exports.number().int().min(ROLE_PERIOD_MIN_DAYS).max(ROLE_PERIOD_MAX_DAYS);
32926
32945
  var AgentSubscriptionIdsSchema = external_exports.array(external_exports.string().min(1)).default([]);
@@ -32930,15 +32949,33 @@ var RoleDetailsSchema = external_exports.object({
32930
32949
  length: RoleLengthSchema.nullable(),
32931
32950
  agentSubscriptionIds: AgentSubscriptionIdsSchema,
32932
32951
  sessionsOwnAndExplicitOnly: BoolFalseSchema,
32933
- bridgesOwnAndExplicitOnly: BoolFalseSchema
32952
+ bridgesOwnAndExplicitOnly: BoolFalseSchema,
32953
+ sessionsReadOnlyExceptOwn: BoolFalseSchema,
32954
+ codeChangesAgentModifiedOnly: BoolFalseSchema,
32955
+ codeChangesHidden: BoolFalseSchema
32934
32956
  });
32935
32957
  var RoleDetailsWireSchema = external_exports.object({
32936
32958
  payment: RolePaymentModelWireSchema.nullable(),
32937
32959
  length: RoleLengthWireSchema.nullable(),
32938
32960
  agent_subscription_ids: AgentSubscriptionIdsSchema,
32939
32961
  sessions_own_and_explicit_only: BoolFalseSchema,
32940
- bridges_own_and_explicit_only: BoolFalseSchema
32941
- });
32962
+ bridges_own_and_explicit_only: BoolFalseSchema,
32963
+ sessions_read_only_except_own: BoolFalseSchema,
32964
+ code_changes_agent_modified_only: BoolFalseSchema,
32965
+ code_changes_hidden: BoolFalseSchema
32966
+ });
32967
+ var EMPTY_ROLE_DETAILS = {
32968
+ payment: null,
32969
+ length: null,
32970
+ agentSubscriptionIds: [],
32971
+ ...EMPTY_ROLE_ACCESS_RESTRICTIONS
32972
+ };
32973
+ var EMPTY_ROLE_DETAILS_WIRE = {
32974
+ payment: null,
32975
+ length: null,
32976
+ agent_subscription_ids: [],
32977
+ ...roleAccessRestrictionsToWire(EMPTY_ROLE_ACCESS_RESTRICTIONS)
32978
+ };
32942
32979
 
32943
32980
  // ../bridge/src/agents/acp/safe-fs-path.ts
32944
32981
  import * as path2 from "node:path";
@@ -35792,15 +35829,31 @@ function queueCursorCreatePlanRequest(method, id, msg, deps) {
35792
35829
  }
35793
35830
 
35794
35831
  // ../bridge/src/agents/providers/cursor/cursor-incoming-cursor-task.ts
35795
- function buildCursorTaskToolCallUpdate(params) {
35832
+ function asRecord2(v) {
35833
+ return v != null && typeof v === "object" && !Array.isArray(v) ? v : null;
35834
+ }
35835
+ function flattenCursorTaskParams(params) {
35836
+ const nested = asRecord2(params.task) ?? asRecord2(params.data) ?? asRecord2(params.payload) ?? asRecord2(params.cursorTask);
35837
+ return nested ? { ...nested, ...params } : params;
35838
+ }
35839
+ function stringField(params, ...keys) {
35840
+ for (const key of keys) {
35841
+ const v = params[key];
35842
+ if (typeof v === "string" && v.trim()) return v.trim();
35843
+ }
35844
+ return void 0;
35845
+ }
35846
+ function buildCursorTaskToolCallUpdate(rawParams) {
35847
+ const params = flattenCursorTaskParams(rawParams);
35796
35848
  const toolCallId = params.toolCallId ?? params.tool_call_id;
35797
35849
  if (typeof toolCallId !== "string" || !toolCallId.trim()) return null;
35798
- const description = typeof params.description === "string" ? params.description.trim() : "";
35850
+ const description = stringField(params, "description");
35799
35851
  const prompt = typeof params.prompt === "string" ? params.prompt : void 0;
35800
35852
  const subagentType = params.subagentType ?? params.subagent_type;
35801
35853
  const model = typeof params.model === "string" ? params.model : void 0;
35802
- const agentId = typeof params.agentId === "string" ? params.agentId : typeof params.agent_id === "string" ? params.agent_id : void 0;
35803
- const durationMs = typeof params.durationMs === "number" ? params.durationMs : typeof params.duration_ms === "number" ? params.duration_ms : void 0;
35854
+ const agentId = stringField(params, "agentId", "agent_id");
35855
+ const rawDuration = params.durationMs ?? params.duration_ms;
35856
+ const durationMs = typeof rawDuration === "number" && Number.isFinite(rawDuration) && rawDuration > 0 ? rawDuration : void 0;
35804
35857
  const isBackground = typeof params.isBackground === "boolean" ? params.isBackground : typeof params.is_background === "boolean" ? params.is_background : typeof params.runInBackground === "boolean" ? params.runInBackground : typeof params.run_in_background === "boolean" ? params.run_in_background : void 0;
35805
35858
  return {
35806
35859
  sessionUpdate: "tool_call_update",
@@ -35969,7 +36022,7 @@ function writeCreatePlanFile(params) {
35969
36022
  }
35970
36023
 
35971
36024
  // ../bridge/src/agents/providers/cursor/enrich-create-plan-rpc-result.ts
35972
- function asRecord2(v) {
36025
+ function asRecord3(v) {
35973
36026
  return v != null && typeof v === "object" && !Array.isArray(v) ? v : null;
35974
36027
  }
35975
36028
  function resolveAcceptedPlanMarkdown(outcome, pendingParams) {
@@ -35978,8 +36031,8 @@ function resolveAcceptedPlanMarkdown(outcome, pendingParams) {
35978
36031
  return "";
35979
36032
  }
35980
36033
  function enrichCreatePlanRpcResult(result, pendingParams, cloudSessionId) {
35981
- const root = asRecord2(result);
35982
- const outcome = asRecord2(root?.outcome);
36034
+ const root = asRecord3(result);
36035
+ const outcome = asRecord3(root?.outcome);
35983
36036
  if (!outcome) return result;
35984
36037
  const kind = typeof outcome.outcome === "string" ? outcome.outcome : "";
35985
36038
  if (kind !== "accepted") {
@@ -40538,7 +40591,7 @@ function createBridgeHeartbeatController(params) {
40538
40591
  }
40539
40592
 
40540
40593
  // ../bridge/src/cli/cli-version.ts
40541
- var CLI_VERSION = "0.1.92".length > 0 ? "0.1.92" : "0.0.0-dev";
40594
+ var CLI_VERSION = "0.1.93".length > 0 ? "0.1.93" : "0.0.0-dev";
40542
40595
 
40543
40596
  // ../bridge/src/connection/identify/send-bridge-identify.ts
40544
40597
  function sendBridgeIdentify(ws, params) {
@@ -53463,7 +53516,7 @@ function createPendingAuthOnMessage(params) {
53463
53516
  }
53464
53517
 
53465
53518
  // src/cli-version.ts
53466
- var CLI_VERSION2 = "0.1.92".length > 0 ? "0.1.92" : "0.0.0-dev";
53519
+ var CLI_VERSION2 = "0.1.93".length > 0 ? "0.1.93" : "0.0.0-dev";
53467
53520
 
53468
53521
  // src/auth/pending/pending-auth-on-open.ts
53469
53522
  function createPendingAuthOnOpen(params) {