@bendyline/gezel-cli 1.2.11 → 1.2.13

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.
@@ -34,6 +34,7 @@ import { createHash, randomUUID } from "crypto";
34
34
  import { chmod, mkdir, readFile, realpath, rm, writeFile } from "fs/promises";
35
35
  import { homedir } from "os";
36
36
  import { basename, dirname, join, resolve } from "path";
37
+ import { fileURLToPath } from "url";
37
38
  import {
38
39
  evaluateApiCompat,
39
40
  getLogLevel,
@@ -51,6 +52,7 @@ import {
51
52
  authorizeLocalOwner
52
53
  } from "@bendyline/gezel-app-sdk";
53
54
  import {
55
+ DaemonInAnotherNamespaceError,
54
56
  GezelApiError,
55
57
  GezelClient,
56
58
  LiveDaemonUnhealthyError,
@@ -64,6 +66,7 @@ import {
64
66
  readSystemServiceEndpoint,
65
67
  resolveDaemonEntry,
66
68
  stopOwnedDaemon,
69
+ systemServiceRuntimeIsStale,
67
70
  systemSharedAssetsDir
68
71
  } from "@bendyline/gezel-client/node";
69
72
  import { gezelHome, gezelPaths, nativePayloadVerificationPath } from "@bendyline/gezel/paths";
package/dist/tui/index.js CHANGED
@@ -6,6 +6,7 @@ import { render } from "ink";
6
6
  // src/tui/App.tsx
7
7
  import {
8
8
  gezelNamesInUse as gezelNamesInUse2,
9
+ isTaskOrCraftbookSession,
9
10
  pickUnusedGezelName as pickUnusedGezelName2
10
11
  } from "@bendyline/gezel";
11
12
  import { Box as Box6, Text as Text6, useApp, useInput as useInput4, useStdout } from "ink";
@@ -16,6 +17,7 @@ import { createHash, randomUUID } from "crypto";
16
17
  import { chmod, mkdir, readFile, realpath, rm, writeFile } from "fs/promises";
17
18
  import { homedir } from "os";
18
19
  import { basename, dirname, join, resolve } from "path";
20
+ import { fileURLToPath } from "url";
19
21
  import {
20
22
  evaluateApiCompat,
21
23
  getLogLevel,
@@ -33,6 +35,7 @@ import {
33
35
  authorizeLocalOwner
34
36
  } from "@bendyline/gezel-app-sdk";
35
37
  import {
38
+ DaemonInAnotherNamespaceError,
36
39
  GezelApiError,
37
40
  GezelClient,
38
41
  LiveDaemonUnhealthyError,
@@ -46,6 +49,7 @@ import {
46
49
  readSystemServiceEndpoint,
47
50
  resolveDaemonEntry,
48
51
  stopOwnedDaemon,
52
+ systemServiceRuntimeIsStale,
49
53
  systemSharedAssetsDir
50
54
  } from "@bendyline/gezel-client/node";
51
55
  import { gezelHome, gezelPaths, nativePayloadVerificationPath } from "@bendyline/gezel/paths";
@@ -3408,7 +3412,11 @@ function App(props) {
3408
3412
  setThreadsLoading(true);
3409
3413
  try {
3410
3414
  const result = await client.listChatSessions({ gezelId: activeGezelId, projectId });
3411
- setThreads(result.sessions.filter((session) => !session.archived && !session.taskRef));
3415
+ setThreads(
3416
+ result.sessions.filter(
3417
+ (session) => !session.archived && !isTaskOrCraftbookSession(session)
3418
+ )
3419
+ );
3412
3420
  setOverlay("thread");
3413
3421
  } catch (err) {
3414
3422
  note(`could not load threads: ${errMsg(err)}`, "error");
@@ -4730,6 +4738,14 @@ import { useCallback as useCallback3, useEffect as useEffect5, useState as useSt
4730
4738
 
4731
4739
  // src/run-readiness.ts
4732
4740
  import { resolveOnDeviceProvider as resolveOnDeviceProvider2 } from "@bendyline/gezel/native";
4741
+
4742
+ // src/model-choice.ts
4743
+ import {
4744
+ measuredClaim,
4745
+ measuredResultFor
4746
+ } from "@bendyline/gezel";
4747
+
4748
+ // src/run-readiness.ts
4733
4749
  async function settledFirstRunConfig(client, options = {}) {
4734
4750
  const attempts = options.attempts ?? 12;
4735
4751
  const delayMs = options.delayMs ?? 250;
@@ -4745,8 +4761,17 @@ async function settledFirstRunConfig(client, options = {}) {
4745
4761
  // src/tui/components/BootstrapGate.tsx
4746
4762
  import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs7 } from "react/jsx-runtime";
4747
4763
  var MAX_ALTERNATIVE_MODELS = 6;
4764
+ var SKIP_HINTS = {
4765
+ tui: "open the TUI without a local model",
4766
+ run: "stop without running your request"
4767
+ };
4768
+ var CONTINUE_OPTIONS = {
4769
+ tui: { label: "Continue to Gezel", hint: "configure this later" },
4770
+ run: { label: "Stop here", hint: "set this up later" }
4771
+ };
4748
4772
  function BootstrapGate(props) {
4749
4773
  const { client, children } = props;
4774
+ const nextStep = props.nextStep ?? "tui";
4750
4775
  const { exit } = useApp2();
4751
4776
  const [screen, setScreen] = useState6({
4752
4777
  kind: "loading",
@@ -5099,7 +5124,7 @@ function BootstrapGate(props) {
5099
5124
  hint: `${formatDownloadSize(model.approxSizeBytes)} \xB7 ${fitLabel(model.fit)}`,
5100
5125
  value: `chat:${model.id}`
5101
5126
  })),
5102
- { label: "Not now", hint: "open the TUI without a local model", value: "skip" }
5127
+ { label: "Not now", hint: SKIP_HINTS[nextStep], value: "skip" }
5103
5128
  ];
5104
5129
  return /* @__PURE__ */ jsxs7(
5105
5130
  BootstrapFrame,
@@ -5140,7 +5165,7 @@ function BootstrapGate(props) {
5140
5165
  {
5141
5166
  options: [
5142
5167
  ...screen.retry ? [{ label: "Try again", hint: "resume setup", value: "retry" }] : [],
5143
- { label: "Continue to Gezel", hint: "configure this later", value: "continue" }
5168
+ { ...CONTINUE_OPTIONS[nextStep], value: "continue" }
5144
5169
  ],
5145
5170
  onSelect: (value) => {
5146
5171
  if (value === "retry") screen.retry?.();
@@ -5150,6 +5175,15 @@ function BootstrapGate(props) {
5150
5175
  )
5151
5176
  ] });
5152
5177
  }
5178
+ function ExitWhenReady(props) {
5179
+ const { onReady } = props;
5180
+ const { exit } = useApp2();
5181
+ useEffect5(() => {
5182
+ onReady();
5183
+ exit();
5184
+ }, [exit, onReady]);
5185
+ return null;
5186
+ }
5153
5187
  function BootstrapFrame(props) {
5154
5188
  return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 1, paddingY: 1, children: [
5155
5189
  /* @__PURE__ */ jsx6(Text7, { bold: true, color: "cyan", children: "gezel \xB7 first-time setup" }),
@@ -5525,6 +5559,23 @@ async function launchTui(opts) {
5525
5559
  await diagnostics.stop();
5526
5560
  }
5527
5561
  }
5562
+ async function launchRunSetup(opts) {
5563
+ let finished = false;
5564
+ const instance = render(
5565
+ /* @__PURE__ */ jsx7(BootstrapGate, { client: opts.client, nextStep: "run", children: /* @__PURE__ */ jsx7(
5566
+ ExitWhenReady,
5567
+ {
5568
+ onReady: () => {
5569
+ finished = true;
5570
+ }
5571
+ }
5572
+ ) }),
5573
+ { stdout: process.stderr, exitOnCtrlC: false }
5574
+ );
5575
+ await instance.waitUntilExit();
5576
+ return finished;
5577
+ }
5528
5578
  export {
5579
+ launchRunSetup,
5529
5580
  launchTui
5530
5581
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/gezel-cli",
3
- "version": "1.2.11",
3
+ "version": "1.2.13",
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.2.11",
48
- "@bendyline/gezel-app-sdk": "1.1.11",
49
- "@bendyline/gezel-catalog": "1.2.11",
50
- "@bendyline/gezel-client": "1.2.11",
51
- "@bendyline/gezel-knowledge": "1.2.9",
52
- "@bendyline/gezel-service": "1.2.11",
53
- "@bendyline/squisq": "2.13.6",
54
- "@bendyline/squisq-formats": "2.8.7",
55
- "@bendyline/squisq-react": "2.12.16",
47
+ "@bendyline/gezel": "1.2.13",
48
+ "@bendyline/gezel-app-sdk": "1.1.13",
49
+ "@bendyline/gezel-catalog": "1.2.13",
50
+ "@bendyline/gezel-client": "1.2.13",
51
+ "@bendyline/gezel-knowledge": "1.2.10",
52
+ "@bendyline/gezel-service": "1.2.13",
53
+ "@bendyline/squisq": "2.13.10",
54
+ "@bendyline/squisq-formats": "2.8.12",
55
+ "@bendyline/squisq-react": "2.12.22",
56
56
  "commander": "^15.0.0",
57
57
  "ink": "^7.1.1",
58
58
  "ink-text-input": "^6.0.0",