@bendyline/gezel-cli 1.3.3 → 1.3.4

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/README.md CHANGED
@@ -51,7 +51,9 @@ for this device (recommended, and the smallest first download), an optional
51
51
  complete set of image, speech, reading, and video helpers that fit, or other
52
52
  compatible chat models. Downloads show live progress and take effect without a
53
53
  restart. A model you already have, in your own store or one the desktop app
54
- shares on this machine, is used without downloading another copy.
54
+ shares on this machine, is used without downloading another copy. Once chat
55
+ works, `gezel` opens straight into the app; the optional image and speech
56
+ engines stay one command away with `gezel native install`.
55
57
 
56
58
  Gezel is local-first. Everything you create lives on your disk under
57
59
  `~/.gezel/` as ordinary files you can `cat` and `grep`, and talks to whichever
@@ -26,7 +26,7 @@ import {
26
26
  stopOwnedDaemon as stopOwnedDaemon2,
27
27
  stopProcessByPid
28
28
  } from "@bendyline/gezel-client/node";
29
- import { resolveOnDeviceProvider as resolveOnDeviceProvider3 } from "@bendyline/gezel/native";
29
+ import { debugSignalLockArgs, resolveOnDeviceProvider as resolveOnDeviceProvider3 } from "@bendyline/gezel/native";
30
30
  import { Command, Option } from "commander";
31
31
 
32
32
  // src/account-command.ts
@@ -2889,6 +2889,9 @@ function findCraftbook(books, value) {
2889
2889
  (book) => book.id.toLowerCase() === query || book.command?.toLowerCase() === query || book.name.toLowerCase() === query
2890
2890
  );
2891
2891
  }
2892
+ function craftbookScriptsTrusted(sourceId) {
2893
+ return sourceId !== "local" && sourceId !== "project";
2894
+ }
2892
2895
  function craftbookStartRequest(book) {
2893
2896
  const summary = book.description?.trim();
2894
2897
  const description = summary ? `Start the "${book.name}" craftbook for this project. ${summary}` : `Start the "${book.name}" craftbook for this project. Follow every step in the recipe and verify its required outcomes before completing the task.`;
@@ -2899,7 +2902,7 @@ function craftbookStartRequest(book) {
2899
2902
  craftbookSourceId: book.sourceId,
2900
2903
  ...book.version ? { craftbookVersion: book.version } : {},
2901
2904
  dispatchEntry: true,
2902
- trustScripts: true
2905
+ trustScripts: craftbookScriptsTrusted(book.sourceId)
2903
2906
  };
2904
2907
  }
2905
2908
 
@@ -5230,7 +5233,7 @@ async function openInBrowser(url) {
5230
5233
  async function startForeground(env2) {
5231
5234
  const { spawn } = await import("child_process");
5232
5235
  const entry = resolveDaemonEntry2(import.meta.url);
5233
- const child = spawn(process.execPath, [entry], {
5236
+ const child = spawn(process.execPath, [...debugSignalLockArgs(), entry], {
5234
5237
  detached: false,
5235
5238
  stdio: ["pipe", "inherit", "inherit"],
5236
5239
  env: { ...env2, GEZEL_SHUTDOWN_ON_STDIN_EOF: "1" }
@@ -5633,7 +5636,10 @@ Examples:
5633
5636
  "let Gezel change files in this project's folder, when the craftbook saves into it"
5634
5637
  ).option(
5635
5638
  "--strict-sandbox",
5636
- "require OS network isolation for custom scripts (CLI launches otherwise trust this recipe snapshot)"
5639
+ "require OS network isolation for custom scripts (CLI launches otherwise trust a catalog recipe snapshot)"
5640
+ ).option(
5641
+ "--trust-scripts",
5642
+ "trust a local or project craftbook's scripts too; gezels can edit those books, so check them first"
5637
5643
  ).addOption(new Option(SHORTHAND_FLAG).hideHelp()).action(
5638
5644
  async (craftbookParts, opts) => {
5639
5645
  const timeoutMs = positiveSeconds(opts.timeout);
@@ -5722,7 +5728,7 @@ Examples:
5722
5728
  const created = await client.createTask(projectId, {
5723
5729
  ...craftbookStartRequest(book),
5724
5730
  ...craftbookDoLaunch(craftbook2, parsed),
5725
- trustScripts: !opts.strictSandbox,
5731
+ trustScripts: !opts.strictSandbox && (opts.trustScripts === true || craftbookScriptsTrusted(book.sourceId)),
5726
5732
  roleBasedNameOnlyMode: true
5727
5733
  }).catch(async (err) => {
5728
5734
  await undoEdits?.().catch(() => void 0);
package/dist/tui/index.js CHANGED
@@ -2322,6 +2322,9 @@ function findCraftbook(books, value) {
2322
2322
  (book) => book.id.toLowerCase() === query || book.command?.toLowerCase() === query || book.name.toLowerCase() === query
2323
2323
  );
2324
2324
  }
2325
+ function craftbookScriptsTrusted(sourceId) {
2326
+ return sourceId !== "local" && sourceId !== "project";
2327
+ }
2325
2328
  function craftbookStartRequest(book) {
2326
2329
  const summary = book.description?.trim();
2327
2330
  const description = summary ? `Start the "${book.name}" craftbook for this project. ${summary}` : `Start the "${book.name}" craftbook for this project. Follow every step in the recipe and verify its required outcomes before completing the task.`;
@@ -2332,7 +2335,7 @@ function craftbookStartRequest(book) {
2332
2335
  craftbookSourceId: book.sourceId,
2333
2336
  ...book.version ? { craftbookVersion: book.version } : {},
2334
2337
  dispatchEntry: true,
2335
- trustScripts: true
2338
+ trustScripts: craftbookScriptsTrusted(book.sourceId)
2336
2339
  };
2337
2340
  }
2338
2341
 
@@ -2553,8 +2556,14 @@ function nativeEngineUse(engine) {
2553
2556
  return "queries spreadsheets and data files";
2554
2557
  }
2555
2558
  }
2559
+ function chatEngineFor(provider) {
2560
+ return provider === "mlx" ? "uv" : "llama-server";
2561
+ }
2562
+ function shouldOfferNativeToolkit(missing, provider) {
2563
+ return missing.includes(chatEngineFor(provider));
2564
+ }
2556
2565
  function nativeToolkitTitle(missing, provider) {
2557
- return missing.includes(provider === "mlx" ? "uv" : "llama-server") ? "The engine Gezel needs to run chat models on this computer is not installed yet" : "Some optional Gezel engines are not installed yet";
2566
+ return missing.includes(chatEngineFor(provider)) ? "The engine Gezel needs to run chat models on this computer is not installed yet" : "Some optional Gezel engines are not installed yet";
2558
2567
  }
2559
2568
  function recoDevice(memory) {
2560
2569
  return {
@@ -4756,7 +4765,7 @@ function formatTaskDetails(task, gezels, boring) {
4756
4765
  // src/tui/components/BootstrapGate.tsx
4757
4766
  import { formatModelAttribution as formatModelAttribution3 } from "@bendyline/gezel";
4758
4767
  import { Box as Box7, Text as Text7, useApp as useApp2, useInput as useInput5 } from "ink";
4759
- import { useCallback as useCallback3, useEffect as useEffect5, useState as useState6 } from "react";
4768
+ import { useCallback as useCallback3, useEffect as useEffect5, useRef as useRef4, useState as useState6 } from "react";
4760
4769
 
4761
4770
  // src/run-readiness.ts
4762
4771
  import { resolveOnDeviceProvider as resolveOnDeviceProvider3 } from "@bendyline/gezel/native";
@@ -4958,7 +4967,7 @@ function BootstrapGate(props) {
4958
4967
  nativeStatus
4959
4968
  };
4960
4969
  const missing = missingToolkit(nativeStatus);
4961
- if (missing.length > 0) {
4970
+ if (shouldOfferNativeToolkit(missing, context.provider)) {
4962
4971
  setScreen({ kind: "native-choice", context, missing });
4963
4972
  } else {
4964
4973
  await prepareModels(context);
@@ -5252,25 +5261,43 @@ function BootstrapFrame(props) {
5252
5261
  }
5253
5262
  function BootstrapChoiceList(props) {
5254
5263
  const [index, setIndex] = useState6(0);
5264
+ const typedRef = useRef4(false);
5265
+ const [typed, setTypedState] = useState6(false);
5266
+ const setTyped = (value) => {
5267
+ typedRef.current = value;
5268
+ setTypedState(value);
5269
+ };
5255
5270
  const options = props.options;
5256
5271
  useInput5((input, key) => {
5257
5272
  if (key.upArrow) {
5273
+ setTyped(false);
5258
5274
  setIndex((current) => current <= 0 ? options.length - 1 : current - 1);
5259
5275
  return;
5260
5276
  }
5261
5277
  if (key.downArrow) {
5278
+ setTyped(false);
5262
5279
  setIndex((current) => current >= options.length - 1 ? 0 : current + 1);
5263
5280
  return;
5264
5281
  }
5265
- const numeric = Number.parseInt(input, 10);
5266
- if (/^[1-9]$/.test(input) && numeric <= options.length) {
5267
- props.onSelect(options[numeric - 1].value);
5282
+ if (key.escape) {
5283
+ setTyped(false);
5268
5284
  return;
5269
5285
  }
5270
5286
  if (key.return) {
5287
+ if (typedRef.current) {
5288
+ setTyped(false);
5289
+ return;
5290
+ }
5271
5291
  const selected = options[index];
5272
5292
  if (selected) props.onSelect(selected.value);
5293
+ return;
5294
+ }
5295
+ const numeric = Number.parseInt(input, 10);
5296
+ if (!typedRef.current && /^[1-9]$/.test(input) && numeric <= options.length) {
5297
+ props.onSelect(options[numeric - 1].value);
5298
+ return;
5273
5299
  }
5300
+ if (input && !key.ctrl && !key.meta && !key.tab) setTyped(true);
5274
5301
  });
5275
5302
  return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", marginTop: 1, children: [
5276
5303
  options.map((option, optionIndex) => /* @__PURE__ */ jsxs7(Text7, { color: optionIndex === index ? "green" : void 0, children: [
@@ -5283,6 +5310,7 @@ function BootstrapChoiceList(props) {
5283
5310
  option.hint
5284
5311
  ] }) : null
5285
5312
  ] }, option.value)),
5313
+ typed ? /* @__PURE__ */ jsx6(Text7, { color: "yellow", children: "Typing here doesn't send a message. Choose with \u2191/\u2193 or a number, then press Enter." }) : null,
5286
5314
  /* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
5287
5315
  "\u2191/\u2193 choose \xB7 1\u2013",
5288
5316
  Math.min(9, options.length),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/gezel-cli",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "The gezel command-line tool: chat with your gezels, run craftbooks, and manage local models from the terminal.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -44,15 +44,15 @@
44
44
  "!dist/**/*.map"
45
45
  ],
46
46
  "dependencies": {
47
- "@bendyline/gezel": "1.3.3",
48
- "@bendyline/gezel-app-sdk": "1.2.3",
49
- "@bendyline/gezel-catalog": "1.3.3",
50
- "@bendyline/gezel-client": "1.3.3",
51
- "@bendyline/gezel-knowledge": "1.2.11",
52
- "@bendyline/gezel-service": "1.3.3",
53
- "@bendyline/squisq": "2.13.16",
54
- "@bendyline/squisq-formats": "2.8.18",
55
- "@bendyline/squisq-react": "2.12.28",
47
+ "@bendyline/gezel": "1.3.4",
48
+ "@bendyline/gezel-app-sdk": "1.2.4",
49
+ "@bendyline/gezel-catalog": "1.3.4",
50
+ "@bendyline/gezel-client": "1.3.4",
51
+ "@bendyline/gezel-knowledge": "1.2.12",
52
+ "@bendyline/gezel-service": "1.3.4",
53
+ "@bendyline/squisq": "2.14.0",
54
+ "@bendyline/squisq-formats": "2.8.23",
55
+ "@bendyline/squisq-react": "2.12.34",
56
56
  "commander": "^15.0.0",
57
57
  "ink": "^7.1.1",
58
58
  "ink-text-input": "^6.0.0",