usebeeline 0.1.4 → 0.1.5

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 (2) hide show
  1. package/dist/usebeeline.mjs +57 -32
  2. package/package.json +1 -1
@@ -9554,11 +9554,11 @@ var init_squire_broker_link = __esm({
9554
9554
 
9555
9555
  // apps/body/dist/squire-host.js
9556
9556
  import { spawn as spawn3 } from "node:child_process";
9557
- import { accessSync, constants as fsConstants, existsSync as existsSync2, mkdirSync } from "node:fs";
9557
+ import { accessSync, constants as fsConstants, existsSync as existsSync2, mkdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
9558
9558
  import { createRequire as createRequire2 } from "node:module";
9559
9559
  import { createConnection as createConnection2 } from "node:net";
9560
9560
  import { homedir as homedir2 } from "node:os";
9561
- import { dirname as dirname2, join as join2, resolve as resolve2 } from "node:path";
9561
+ import { basename, dirname as dirname2, join as join2, resolve as resolve2 } from "node:path";
9562
9562
  import { fileURLToPath as fileURLToPath2 } from "node:url";
9563
9563
  function squireHostPaths(home) {
9564
9564
  const dir = join2(resolve2(home), ".trusty-squire");
@@ -9584,6 +9584,22 @@ function ensureSquireHostDir(home) {
9584
9584
  mkdirSync(paths.profileDir, { recursive: true, mode: 448 });
9585
9585
  return paths;
9586
9586
  }
9587
+ function writeSquireBrokerUnitMarker(home) {
9588
+ const paths = ensureSquireHostDir(home);
9589
+ const profile = realpathSync.native(paths.profileDir);
9590
+ const parent = dirname2(profile);
9591
+ const { dev, ino } = statSync(parent);
9592
+ const path = join2(parent, SQUIRE_BROKER_UNIT_MARKER_FILE);
9593
+ const marker = {
9594
+ version: 1,
9595
+ socket: paths.brokerSocket,
9596
+ profile: { dev, ino, name: basename(profile) },
9597
+ accountBinding: null
9598
+ };
9599
+ writeFileSync(path, `${JSON.stringify(marker, null, 2)}
9600
+ `, { mode: 384 });
9601
+ return path;
9602
+ }
9587
9603
  function squireHostDirWritable(socketPath) {
9588
9604
  try {
9589
9605
  accessSync(dirname2(socketPath), fsConstants.W_OK);
@@ -9678,7 +9694,14 @@ function spawnSquireServer(env, locateNpx, args) {
9678
9694
  function runSquireBroker(env = process.env) {
9679
9695
  const home = env.HOME?.trim() || homedir2();
9680
9696
  const paths = ensureSquireHostDir(home);
9681
- spawnSquireServer({ ...env, ...squireHostRewriteEnv(home), TRUSTY_SQUIRE_BROKER_SOCKET: paths.brokerSocket }, true, SQUIRE_BROKER_ARGS);
9697
+ spawnSquireServer({
9698
+ ...env,
9699
+ ...squireHostRewriteEnv(home),
9700
+ TRUSTY_SQUIRE_BROKER_SOCKET: paths.brokerSocket,
9701
+ // Squire's daemon refuses to start under the managed marker unless the
9702
+ // unit started it; launchd sets no INVOCATION_ID, so say so explicitly.
9703
+ TRUSTY_SQUIRE_BROKER_UNIT: "1"
9704
+ }, true, SQUIRE_BROKER_ARGS);
9682
9705
  }
9683
9706
  async function runSquireFacade(env = process.env) {
9684
9707
  const socket = env.TRUSTY_SQUIRE_BROKER_SOCKET ?? squireHostPaths(env.HOME?.trim() || homedir2()).brokerSocket;
@@ -9695,7 +9718,7 @@ async function runSquireFacade(env = process.env) {
9695
9718
  });
9696
9719
  process.exit(ok ? 0 : 1);
9697
9720
  }
9698
- var SQUIRE_BROKER_UNAVAILABLE, TRUSTY_SQUIRE_BROKER_UNIT_NAME, SQUIRE_FACADE_FLAG, SQUIRE_BROKER_FLAG, SQUIRE_SERVER_ARGS, SQUIRE_BROKER_ARGS;
9721
+ var SQUIRE_BROKER_UNAVAILABLE, TRUSTY_SQUIRE_BROKER_UNIT_NAME, SQUIRE_FACADE_FLAG, SQUIRE_BROKER_FLAG, SQUIRE_SERVER_ARGS, SQUIRE_BROKER_ARGS, SQUIRE_BROKER_UNIT_MARKER_FILE;
9699
9722
  var init_squire_host = __esm({
9700
9723
  "apps/body/dist/squire-host.js"() {
9701
9724
  "use strict";
@@ -9706,6 +9729,7 @@ var init_squire_host = __esm({
9706
9729
  SQUIRE_BROKER_FLAG = "--squire-broker";
9707
9730
  SQUIRE_SERVER_ARGS = ["-y", "@trusty-squire/mcp@latest", "server"];
9708
9731
  SQUIRE_BROKER_ARGS = ["-y", "@trusty-squire/mcp@latest", "broker"];
9732
+ SQUIRE_BROKER_UNIT_MARKER_FILE = ".trusty-squire-broker-unit.json";
9709
9733
  }
9710
9734
  });
9711
9735
 
@@ -9780,7 +9804,7 @@ async function installTrustySquireBrokerService(options = {}) {
9780
9804
  const env = options.env ?? process.env;
9781
9805
  assertCanonicalInstalledLauncher(env, options.invocationPath);
9782
9806
  const home = env.HOME?.trim() || homedir3();
9783
- ensureSquireHostDir(home);
9807
+ writeSquireBrokerUnitMarker(home);
9784
9808
  const path = systemdBrokerUnitPath(env);
9785
9809
  const content = trustySquireBrokerUnit();
9786
9810
  const existing = await readFile3(path, "utf8").catch(() => "");
@@ -10029,7 +10053,7 @@ var init_systemd = __esm({
10029
10053
 
10030
10054
  // apps/body/dist/launchd.js
10031
10055
  import { execFile as execFile3 } from "node:child_process";
10032
- import { realpathSync } from "node:fs";
10056
+ import { realpathSync as realpathSync2 } from "node:fs";
10033
10057
  import { chmod as chmod2, mkdir as mkdir3, readFile as readFile4, readdir as readdir2, rename as rename3, rm, stat as stat3, writeFile as writeFile3 } from "node:fs/promises";
10034
10058
  import { homedir as homedir4 } from "node:os";
10035
10059
  import { dirname as dirname4, resolve as resolve4 } from "node:path";
@@ -10043,7 +10067,7 @@ function launchdHome(env) {
10043
10067
  }
10044
10068
  function nodeBinDirectory() {
10045
10069
  try {
10046
- return dirname4(realpathSync(process.execPath));
10070
+ return dirname4(realpathSync2(process.execPath));
10047
10071
  } catch {
10048
10072
  return dirname4(process.execPath);
10049
10073
  }
@@ -10360,7 +10384,7 @@ async function installLaunchdTrustySquireBrokerService(options = {}) {
10360
10384
  const env = options.env ?? process.env;
10361
10385
  assertCanonicalInstalledLauncher2(env, options.invocationPath);
10362
10386
  const home = launchdHome(env);
10363
- ensureSquireHostDir(home);
10387
+ writeSquireBrokerUnitMarker(home);
10364
10388
  await mkdir3(resolve4(home, "Library", "Logs", "Beeline"), { recursive: true, mode: 448 });
10365
10389
  const plistPath = launchdBrokerPlistPath(env);
10366
10390
  const changed = await writeManagedFile(plistPath, launchdBrokerPlist(env), 384);
@@ -11284,7 +11308,7 @@ import { existsSync as existsSync3 } from "node:fs";
11284
11308
  import { chmod as chmod4, lstat as lstat2, mkdir as mkdir6, rename as rename5, unlink as unlink3, writeFile as writeFile5 } from "node:fs/promises";
11285
11309
  import { createRequire as createRequire3 } from "node:module";
11286
11310
  import { createInterface as createInterface3 } from "node:readline";
11287
- import { basename, dirname as dirname7, resolve as resolvePath } from "node:path";
11311
+ import { basename as basename2, dirname as dirname7, resolve as resolvePath } from "node:path";
11288
11312
  import { fileURLToPath as fileURLToPath3 } from "node:url";
11289
11313
  import { randomUUID as randomUUID2 } from "node:crypto";
11290
11314
  function harnessIdentityLabel(agent) {
@@ -11350,7 +11374,7 @@ async function writeIsolatedCursorFile(path, content) {
11350
11374
  if (!parentStats.isDirectory() || parentStats.isSymbolicLink()) {
11351
11375
  throw new Error(`isolated cursor parent is not a real directory: ${parent}`);
11352
11376
  }
11353
- const temporary = resolvePath(parent, `.${basename(path)}.${process.pid}.${randomUUID2()}.tmp`);
11377
+ const temporary = resolvePath(parent, `.${basename2(path)}.${process.pid}.${randomUUID2()}.tmp`);
11354
11378
  try {
11355
11379
  await writeFile5(temporary, content, { mode: 384, flag: "wx" });
11356
11380
  await chmod4(temporary, 384);
@@ -25249,7 +25273,7 @@ var import_picocolors3 = __toESM(require_picocolors(), 1);
25249
25273
  // apps/body/dist/config.js
25250
25274
  init_agent_command();
25251
25275
  import { accessSync as accessSync3, constants as constants2, existsSync as existsSync5, readFileSync as readFileSync2 } from "node:fs";
25252
- import { basename as basename2, dirname as dirname8, resolve as resolve8 } from "node:path";
25276
+ import { basename as basename3, dirname as dirname8, resolve as resolve8 } from "node:path";
25253
25277
  function firstExisting2(paths) {
25254
25278
  for (const p of paths) {
25255
25279
  if (p && existsSync5(p))
@@ -25259,7 +25283,7 @@ function firstExisting2(paths) {
25259
25283
  }
25260
25284
  function commandInRunningBundle(command) {
25261
25285
  const entrypoint = process.argv[1];
25262
- if (!entrypoint || basename2(entrypoint) !== "beeline-cli.mjs")
25286
+ if (!entrypoint || basename3(entrypoint) !== "beeline-cli.mjs")
25263
25287
  return void 0;
25264
25288
  const entrypointDir = dirname8(resolve8(entrypoint));
25265
25289
  const candidates = [
@@ -26660,7 +26684,7 @@ function isAllowedAgentModelConfigCategory(category, id) {
26660
26684
 
26661
26685
  // apps/body/dist/model-config.js
26662
26686
  import { lstatSync, readFileSync as readFileSync3 } from "node:fs";
26663
- import { basename as basename3, resolve as resolve9 } from "node:path";
26687
+ import { basename as basename4, resolve as resolve9 } from "node:path";
26664
26688
 
26665
26689
  // packages/api-contract/dist/daemon-operations.js
26666
26690
  function isAgentCommand(value) {
@@ -26703,6 +26727,7 @@ var ARTIFACT_EXTENSIONS_BY_MIME = {
26703
26727
  "video/webm": [".webm"],
26704
26728
  "audio/mpeg": [".mp3"],
26705
26729
  "audio/wav": [".wav"],
26730
+ "audio/mp4": [".m4a"],
26706
26731
  "application/octet-stream": []
26707
26732
  };
26708
26733
  var ARTIFACT_MIME_BY_EXTENSION = Object.fromEntries(Object.entries(ARTIFACT_EXTENSIONS_BY_MIME).flatMap(([mime, extensions]) => extensions.map((extension2) => [extension2, mime])));
@@ -27279,7 +27304,7 @@ function isGrokAgentCommand(agent) {
27279
27304
  return true;
27280
27305
  if (agent.kind && agent.kind !== "custom")
27281
27306
  return false;
27282
- return /^grok(?:\.[a-z0-9]+)?$/i.test(basename3(agent.command));
27307
+ return /^grok(?:\.[a-z0-9]+)?$/i.test(basename4(agent.command));
27283
27308
  }
27284
27309
  function agentArgsWithModelSelection(agent, selection) {
27285
27310
  const original = [...agent.args];
@@ -29243,7 +29268,7 @@ ${up.stderr}`;
29243
29268
  import { createHash as createHash4, randomBytes as randomBytes6 } from "node:crypto";
29244
29269
  import { lookup } from "node:dns/promises";
29245
29270
  import { createRequire as createRequire4 } from "node:module";
29246
- import { chmodSync, existsSync as existsSync6, mkdirSync as mkdirSync2, readFileSync as readFileSync4, rmSync, writeFileSync } from "node:fs";
29271
+ import { chmodSync, existsSync as existsSync6, mkdirSync as mkdirSync2, readFileSync as readFileSync4, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
29247
29272
  import { createConnection as createConnection3, createServer as createServer2, isIPv4, isIPv6 } from "node:net";
29248
29273
  import { homedir as homedir10 } from "node:os";
29249
29274
  import { dirname as dirname9, join as join7 } from "node:path";
@@ -29398,7 +29423,7 @@ function readState(path) {
29398
29423
  }
29399
29424
  function writeState(path, state) {
29400
29425
  mkdirSync2(dirname9(path), { recursive: true, mode: 448 });
29401
- writeFileSync(path, `${JSON.stringify(state)}
29426
+ writeFileSync2(path, `${JSON.stringify(state)}
29402
29427
  `, { mode: 384 });
29403
29428
  }
29404
29429
  function challengeParameter(header, key) {
@@ -30343,7 +30368,7 @@ import { join as join9, resolve as resolve12 } from "node:path";
30343
30368
 
30344
30369
  // apps/body/dist/attachment-delivery.js
30345
30370
  import { mkdir as mkdir7, writeFile as writeFile7 } from "node:fs/promises";
30346
- import { basename as basename4, extname, join as join8 } from "node:path";
30371
+ import { basename as basename5, extname, join as join8 } from "node:path";
30347
30372
  var MAX_ATTACHMENT_BYTES = 25 * 1024 * 1024;
30348
30373
  var EXPIRED_REASON = "expired: these attachment bytes are past their retention window";
30349
30374
  var FETCH_TIMEOUT_MS = 3e4;
@@ -30373,7 +30398,7 @@ async function fetchBoundedBytes(url, fetchImpl = fetch) {
30373
30398
  }
30374
30399
  var MAX_INLINE_IMAGE_BYTES = 5 * 1024 * 1024;
30375
30400
  function safeFileName(attachment, index, taken) {
30376
- const raw = basename4(attachment.name ?? "").replace(/[^\w.-]+/g, "_").replace(/^\.+/, "");
30401
+ const raw = basename5(attachment.name ?? "").replace(/[^\w.-]+/g, "_").replace(/^\.+/, "");
30377
30402
  let name = raw || `attachment-${index + 1}`;
30378
30403
  if (taken.has(name)) {
30379
30404
  const ext = extname(name);
@@ -31905,9 +31930,9 @@ function surfaceAllows(surface, capability) {
31905
31930
  init_agent_command();
31906
31931
  init_cursor_acp_bridge();
31907
31932
  import { execFile as execFile7, spawnSync } from "node:child_process";
31908
- import { lstatSync as lstatSync2, readdirSync as readdirSync2, readFileSync as readFileSync5, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
31933
+ import { lstatSync as lstatSync2, readdirSync as readdirSync2, readFileSync as readFileSync5, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "node:fs";
31909
31934
  import { homedir as homedir11 } from "node:os";
31910
- import { basename as basename5, dirname as dirname10, isAbsolute as isAbsolute2, relative, resolve as resolve14 } from "node:path";
31935
+ import { basename as basename6, dirname as dirname10, isAbsolute as isAbsolute2, relative, resolve as resolve14 } from "node:path";
31911
31936
  var DEFAULT_SANDBOX_POLICY = "bwrap";
31912
31937
  function isSandboxPolicy(value) {
31913
31938
  return value === "bwrap" || value === "off";
@@ -32002,7 +32027,7 @@ function siblingAgentMaskPaths(ownRuntimeDir, listAgentDirs = (agentsRoot) => {
32002
32027
  }) {
32003
32028
  const own = resolve14(ownRuntimeDir);
32004
32029
  const agentsRoot = dirname10(own);
32005
- const ownName = basename5(own).toLowerCase();
32030
+ const ownName = basename6(own).toLowerCase();
32006
32031
  return listAgentDirs(agentsRoot).filter((name) => name.toLowerCase() !== ownName).map((name) => ({ path: resolve14(agentsRoot, name), kind: "dir" })).sort((a2, b) => a2.path.localeCompare(b.path));
32007
32032
  }
32008
32033
  var DEFAULT_SANDBOX_DEVICES = ["/dev/kvm"];
@@ -32228,7 +32253,7 @@ function recordInstallFailure(stateDir, at) {
32228
32253
  if (!stateDir)
32229
32254
  return;
32230
32255
  try {
32231
- writeFileSync2(installFailureMarker(stateDir), `${at}
32256
+ writeFileSync3(installFailureMarker(stateDir), `${at}
32232
32257
  `, "utf8");
32233
32258
  } catch {
32234
32259
  }
@@ -33008,7 +33033,7 @@ async function readHarnessTurnUsage(input) {
33008
33033
  // apps/body/dist/server-command-intake.js
33009
33034
  import { randomUUID as randomUUID8 } from "node:crypto";
33010
33035
  import { mkdir as mkdir11, writeFile as writeFile11 } from "node:fs/promises";
33011
- import { writeFileSync as writeFileSync3 } from "node:fs";
33036
+ import { writeFileSync as writeFileSync4 } from "node:fs";
33012
33037
  import { tmpdir as tmpdir5 } from "node:os";
33013
33038
  import { dirname as dirname13, join as join11 } from "node:path";
33014
33039
  var CommandExecutionContext = class {
@@ -33037,7 +33062,7 @@ var CommandExecutionContext = class {
33037
33062
  const command = this.current;
33038
33063
  if (!command)
33039
33064
  return;
33040
- writeFileSync3(this.path, JSON.stringify({
33065
+ writeFileSync4(this.path, JSON.stringify({
33041
33066
  roomId: command.roomId,
33042
33067
  requestId: command.turnRequestId,
33043
33068
  taskId: command.rootCommandId,
@@ -34036,7 +34061,7 @@ function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
34036
34061
  import { createHash as createHash7, randomUUID as randomUUID9 } from "node:crypto";
34037
34062
  import { chmod as chmod7, copyFile, lstat as lstat3, mkdir as mkdir13, readFile as readFile18, readlink, readdir as readdir6, realpath, rename as rename7, rm as rm7, symlink as symlink2, unlink as unlink5, writeFile as writeFile13 } from "node:fs/promises";
34038
34063
  import { homedir as homedir13 } from "node:os";
34039
- import { basename as basename6, dirname as dirname14, join as join13, relative as relative2, resolve as resolve21, sep } from "node:path";
34064
+ import { basename as basename7, dirname as dirname14, join as join13, relative as relative2, resolve as resolve21, sep } from "node:path";
34040
34065
 
34041
34066
  // apps/body/dist/draw-avatar-skill.js
34042
34067
  var DRAW_AVATAR_SKILL_NAME = "draw-avatar";
@@ -36331,7 +36356,7 @@ async function walkSafeSkillTree(source, sourceRoot, visitor, rel = "") {
36331
36356
  const stats = await lstat3(resolvedSource);
36332
36357
  if (stats.isSymbolicLink())
36333
36358
  throw new Error(`shared skill contains a symlink: ${source}`);
36334
- if (BLOCKED_SHARED_FILENAMES.test(basename6(source))) {
36359
+ if (BLOCKED_SHARED_FILENAMES.test(basename7(source))) {
36335
36360
  throw new Error(`shared skill contains credential or configuration material: ${source}`);
36336
36361
  }
36337
36362
  if (stats.isDirectory()) {
@@ -36366,7 +36391,7 @@ async function writeIsolatedHarnessFile(path, content) {
36366
36391
  if (!parentStats.isDirectory() || parentStats.isSymbolicLink()) {
36367
36392
  throw new Error(`isolated harness parent is not a real directory: ${parent}`);
36368
36393
  }
36369
- const temporary = resolve21(parent, `.${basename6(path)}.${process.pid}.${randomUUID9()}.tmp`);
36394
+ const temporary = resolve21(parent, `.${basename7(path)}.${process.pid}.${randomUUID9()}.tmp`);
36370
36395
  try {
36371
36396
  await writeFile13(temporary, content, { mode: 384, flag: "wx" });
36372
36397
  await chmod7(temporary, 384);
@@ -37968,7 +37993,7 @@ var TURN_SECTIONS = [
37968
37993
  budgetBytes: 600,
37969
37994
  layer: "turn",
37970
37995
  surfaces: CORNERS,
37971
- render: ({ generatedTitle }) => generatedTitle ? `This corner still has its generated name, "${generatedTitle}". If the newest message states the work, call rename_corner once before you reply, with a name of at most three words taken from that message. A bare mention does not state the work; leave the name until a message does.` : ""
37996
+ render: ({ generatedTitle, brief }) => generatedTitle ? `This human-opened corner still has its generated name, "${generatedTitle}". If the newest human message states the work, call rename_corner once before you reply with a name of at most three words and a short objective${brief ? "" : ", plus a brief grounded in that message with brief.approval.sourceMessageId set to the human message id"}. A bare mention does not state the work; leave the name until a message does.` : ""
37972
37997
  },
37973
37998
  {
37974
37999
  id: "turn.brief",
@@ -43941,7 +43966,7 @@ async function retryBeforeReady(work, options) {
43941
43966
  }
43942
43967
 
43943
43968
  // apps/body/dist/force-update-journal.js
43944
- import { mkdirSync as mkdirSync4, readFileSync as readFileSync8, renameSync, writeFileSync as writeFileSync4 } from "node:fs";
43969
+ import { mkdirSync as mkdirSync4, readFileSync as readFileSync8, renameSync, writeFileSync as writeFileSync5 } from "node:fs";
43945
43970
  import { resolve as resolve30 } from "node:path";
43946
43971
  var NAME = "force-update-interruptions.json";
43947
43972
  function pathFor(runtimeDir) {
@@ -43970,7 +43995,7 @@ function write(runtimeDir, rows) {
43970
43995
  mkdirSync4(runtimeDir, { recursive: true, mode: 448 });
43971
43996
  const target = pathFor(runtimeDir);
43972
43997
  const temporary = `${target}.${process.pid}.tmp`;
43973
- writeFileSync4(temporary, `${JSON.stringify(rows)}
43998
+ writeFileSync5(temporary, `${JSON.stringify(rows)}
43974
43999
  `, { mode: 384 });
43975
44000
  renameSync(temporary, target);
43976
44001
  }
@@ -45106,7 +45131,7 @@ async function relocateAgentRuntime(runtime, target, options = {}) {
45106
45131
  }
45107
45132
 
45108
45133
  // apps/body/dist/start-command.js
45109
- import { basename as basename7, dirname as dirname23 } from "node:path";
45134
+ import { basename as basename8, dirname as dirname23 } from "node:path";
45110
45135
  var import_picocolors2 = __toESM(require_picocolors(), 1);
45111
45136
  init_agent_command();
45112
45137
  init_runtime();
@@ -45321,7 +45346,7 @@ async function startStoredRuntime(configPath, opts = {}, dependencyOverrides = {
45321
45346
  return { status: "started", pid };
45322
45347
  }
45323
45348
  function agentStartId(configPath) {
45324
- return basename7(dirname23(configPath));
45349
+ return basename8(dirname23(configPath));
45325
45350
  }
45326
45351
  async function startRuntime(configPath, spinnerHandle) {
45327
45352
  const report = (text2) => spinnerHandle ? spinnerHandle.message(text2) : console.log(text2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usebeeline",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Connect an AI coding agent to Beeline with one command.",
5
5
  "homepage": "https://usebeeline.app",
6
6
  "bugs": {