usebeeline 0.1.248-rc.2 → 0.1.249-rc.1

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.
@@ -60,11 +60,10 @@ var init_update_progress = __esm({
60
60
  });
61
61
 
62
62
  // apps/body/dist/self-update-manifest.js
63
- function resolveManifestUrl(env = process.env) {
63
+ function resolveManifestUrl(env = process.env, channel = env.BEELINE_RELEASE_CHANNEL?.trim() || "latest") {
64
64
  const override = env.BEELINE_UPDATE_MANIFEST_URL?.trim();
65
65
  if (override)
66
66
  return override;
67
- const channel = env.BEELINE_RELEASE_CHANNEL?.trim() || "latest";
68
67
  if (!["latest", "next"].includes(channel))
69
68
  throw new Error(`invalid helper release channel: ${channel}`);
70
69
  return channel === "next" ? "https://usebeeline.app/dl/next/manifest.json" : DEFAULT_UPDATE_MANIFEST_URL;
@@ -414,9 +413,9 @@ async function tryLock(key, about = {}) {
414
413
  return {
415
414
  held: true,
416
415
  release: () => new Promise((done) => {
416
+ server.close(() => done());
417
417
  for (const peer of peers)
418
418
  peer.destroy();
419
- server.close(() => done());
420
419
  })
421
420
  };
422
421
  return new Promise((resolve17, reject) => {
@@ -1125,6 +1124,7 @@ __export(self_update_exports, {
1125
1124
  forwarderScript: () => forwarderScript,
1126
1125
  fsyncDir: () => fsyncDir,
1127
1126
  hostPlatformKey: () => hostPlatformKey,
1127
+ installedReleaseChannel: () => installedReleaseChannel,
1128
1128
  nodeVersionAtLeast: () => nodeVersionAtLeast,
1129
1129
  normalizeLegacyBundleShape: () => normalizeLegacyBundleShape,
1130
1130
  pathKind: () => pathKind,
@@ -1142,6 +1142,7 @@ __export(self_update_exports, {
1142
1142
  runningReleaseId: () => runningReleaseId,
1143
1143
  sanitizeReleaseId: () => sanitizeReleaseId,
1144
1144
  stageRelease: () => stageRelease,
1145
+ updateCommandManifestUrl: () => updateCommandManifestUrl,
1145
1146
  updateStatePath: () => updateStatePath,
1146
1147
  writeUpdateState: () => writeUpdateState
1147
1148
  });
@@ -1270,6 +1271,25 @@ function nodeVersionAtLeast(version, minimum) {
1270
1271
  function updateStatePath(layout) {
1271
1272
  return join2(layout.releasesRoot, ".state", "update-state.json");
1272
1273
  }
1274
+ function releaseChannelPath(layout) {
1275
+ return join2(dirname3(updateStatePath(layout)), "release-channel");
1276
+ }
1277
+ async function installedReleaseChannel(layout, env = process.env) {
1278
+ const recorded = (await readFile2(releaseChannelPath(layout), "utf8").catch(() => "")).trim();
1279
+ if (recorded === "next" || recorded === "latest")
1280
+ return recorded;
1281
+ return env.BEELINE_RELEASE_CHANNEL?.trim() || "latest";
1282
+ }
1283
+ async function updateCommandManifestUrl(layout, override, rememberChannel) {
1284
+ const explicit = process.env.BEELINE_RELEASE_CHANNEL?.trim();
1285
+ if (rememberChannel && (explicit === "next" || explicit === "latest")) {
1286
+ const path = releaseChannelPath(layout);
1287
+ await mkdir2(dirname3(path), { recursive: true });
1288
+ await replaceFile(path, `${explicit}
1289
+ `, 384);
1290
+ }
1291
+ return override ?? resolveManifestUrl(process.env, explicit || await installedReleaseChannel(layout));
1292
+ }
1273
1293
  async function readUpdateState(layout) {
1274
1294
  try {
1275
1295
  return JSON.parse(await readFile2(updateStatePath(layout), "utf8"));
@@ -1519,7 +1539,8 @@ async function prepareLatestRelease(layout, options = {}) {
1519
1539
  ...options.signal ? { signal: options.signal } : {}
1520
1540
  });
1521
1541
  try {
1522
- const manifestUrl = options.manifest?.url ?? resolveManifestUrl(options.env ?? process.env);
1542
+ const env = options.env ?? process.env;
1543
+ const manifestUrl = options.manifest?.url ?? resolveManifestUrl(env, await installedReleaseChannel(layout, env));
1523
1544
  const bundle = options.manifest?.bundle ?? parseUpdateManifest(await fetchText(manifestUrl, fetchImpl), hostPlatformKey()).bundle;
1524
1545
  options.signal?.throwIfAborted();
1525
1546
  const installed = await readInstalledBundleIdentity(layout);
@@ -4759,7 +4780,7 @@ var reviewRule, EXTERNAL_AGENT_RULES;
4759
4780
  var init_external_agent_rules = __esm({
4760
4781
  "packages/api-contract/dist/external-agent-rules.js"() {
4761
4782
  "use strict";
4762
- reviewRule = "As reviewer, read facets brief, pr and checks. Start your verdict with PASS or FAIL and include your findings. Use post once with the review wake\u2019s address and commandId. After posting PASS, call approve_merge on the exact head SHA with the address and headSha. The server wakes the implementer with the result. During review, send addressed messages only with reply. The server requests review; never tag the reviewer. Never review work you implemented or authored.";
4783
+ reviewRule = "As reviewer, read facets brief, pr and checks and include your findings in the verdict. To approve, call approve_merge on the exact head SHA with the review wake\u2019s address, commandId and verdict text. To request changes, use post once with the review wake\u2019s address and commandId. The server wakes the implementer with the result. The server requests review; never tag the reviewer. Never review work you implemented or authored.";
4763
4784
  EXTERNAL_AGENT_RULES = [
4764
4785
  {
4765
4786
  id: "data",
@@ -27449,6 +27470,7 @@ async function main() {
27449
27470
  native: native2,
27450
27471
  installed: await readInstalledBundleIdentity(layout),
27451
27472
  activeRelease: await activeReleaseId(layout),
27473
+ releaseChannel: await installedReleaseChannel(layout),
27452
27474
  releaseSelection: await readUpdateState(layout),
27453
27475
  helper: helper ?? { state: "not responding" },
27454
27476
  agents
@@ -27456,8 +27478,9 @@ async function main() {
27456
27478
  return;
27457
27479
  }
27458
27480
  const index = args.indexOf("--manifest-url");
27459
- const url = index >= 0 ? args[index + 1] : resolveManifestUrl();
27460
- if (args.includes("--check")) {
27481
+ const checkOnly = args.includes("--check");
27482
+ const url = await updateCommandManifestUrl(layout, index >= 0 ? args[index + 1] : void 0, command2 === "update" && !checkOnly);
27483
+ if (checkOnly) {
27461
27484
  const bundle = parseUpdateManifest(await fetchText(url, fetch), hostPlatformKey()).bundle;
27462
27485
  console.log(compareBundleIdentity(await readInstalledBundleIdentity(layout), bundle));
27463
27486
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usebeeline",
3
- "version": "0.1.248-rc.2",
3
+ "version": "0.1.249-rc.1",
4
4
  "description": "Connect an AI coding agent to Beeline with one command.",
5
5
  "homepage": "https://usebeeline.app",
6
6
  "bugs": {