@llmist/cli 15.2.0 → 15.2.2

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/cli.js CHANGED
@@ -98,7 +98,7 @@ import { Command, InvalidArgumentError as InvalidArgumentError2 } from "commande
98
98
  // package.json
99
99
  var package_default = {
100
100
  name: "@llmist/cli",
101
- version: "15.2.0",
101
+ version: "15.2.2",
102
102
  description: "CLI for llmist - run LLM agents from the command line",
103
103
  type: "module",
104
104
  main: "dist/cli.js",
@@ -154,7 +154,7 @@ var package_default = {
154
154
  node: ">=22.0.0"
155
155
  },
156
156
  dependencies: {
157
- llmist: "^15.2.0",
157
+ llmist: "^15.2.2",
158
158
  "@unblessed/node": "^1.0.0-alpha.23",
159
159
  chalk: "^5.6.2",
160
160
  commander: "^12.1.0",
@@ -168,7 +168,7 @@ var package_default = {
168
168
  zod: "^4.1.12"
169
169
  },
170
170
  devDependencies: {
171
- "@llmist/testing": "^15.2.0",
171
+ "@llmist/testing": "^15.2.2",
172
172
  "@types/diff": "^8.0.0",
173
173
  "@types/js-yaml": "^4.0.9",
174
174
  "@types/marked-terminal": "^6.1.1",
@@ -183,9 +183,8 @@ var package_default = {
183
183
  import { AgentBuilder, GadgetRegistry, isAbortError, text } from "llmist";
184
184
 
185
185
  // src/builtin-gadgets.ts
186
+ import { createGadget, HumanInputRequiredException, TaskCompletionSignal } from "llmist";
186
187
  import { z } from "zod";
187
- import { createGadget } from "llmist";
188
- import { TaskCompletionSignal, HumanInputRequiredException } from "llmist";
189
188
  var askUser = createGadget({
190
189
  name: "AskUser",
191
190
  description: "Ask the user a question when you need more information or clarification. The user's response will be provided back to you.",
@@ -276,9 +275,9 @@ function expandTildePath(path6) {
276
275
  }
277
276
 
278
277
  // src/templates.ts
279
- import { Eta } from "eta";
280
278
  import { existsSync, readFileSync, statSync } from "fs";
281
279
  import { dirname, resolve } from "path";
280
+ import { Eta } from "eta";
282
281
  var MAX_PROMPT_FILE_SIZE = 1024 * 1024;
283
282
  function resolvePromptFilePath(filePath, configDir) {
284
283
  const expanded = expandTildePath(filePath);
@@ -322,9 +321,7 @@ function createTemplateEngine(prompts, configPath) {
322
321
  const includeStack = [];
323
322
  eta.__includeFileImpl = (path6) => {
324
323
  if (includeStack.includes(path6)) {
325
- throw new Error(
326
- `Circular include detected: ${[...includeStack, path6].join(" -> ")}`
327
- );
324
+ throw new Error(`Circular include detected: ${[...includeStack, path6].join(" -> ")}`);
328
325
  }
329
326
  includeStack.push(path6);
330
327
  try {
@@ -1880,8 +1877,8 @@ ${newContent}
1880
1877
  // src/builtins/filesystem/list-directory.ts
1881
1878
  import fs2 from "fs";
1882
1879
  import path2 from "path";
1883
- import { z as z3 } from "zod";
1884
1880
  import { createGadget as createGadget3 } from "llmist";
1881
+ import { z as z3 } from "zod";
1885
1882
  function listFiles(dirPath, basePath = dirPath, maxDepth = 1, currentDepth = 1) {
1886
1883
  const entries = [];
1887
1884
  try {
@@ -2002,8 +1999,8 @@ ${formattedList}`;
2002
1999
 
2003
2000
  // src/builtins/filesystem/read-file.ts
2004
2001
  import fs3 from "fs";
2005
- import { z as z4 } from "zod";
2006
2002
  import { createGadget as createGadget4 } from "llmist";
2003
+ import { z as z4 } from "zod";
2007
2004
  var readFile2 = createGadget4({
2008
2005
  name: "ReadFile",
2009
2006
  description: "Read the entire content of a file and return it as text. The file path must be within the current working directory or its subdirectories.",
@@ -2034,8 +2031,8 @@ ${content}`;
2034
2031
  // src/builtins/filesystem/write-file.ts
2035
2032
  import fs4 from "fs";
2036
2033
  import path3 from "path";
2037
- import { z as z5 } from "zod";
2038
2034
  import { createGadget as createGadget5 } from "llmist";
2035
+ import { z as z5 } from "zod";
2039
2036
  var writeFile = createGadget5({
2040
2037
  name: "WriteFile",
2041
2038
  description: "Write content to a file. Creates parent directories if needed. Overwrites existing files. The file path must be within the current working directory or its subdirectories.",
@@ -2086,8 +2083,8 @@ Wrote ${bytesWritten} bytes${dirNote}`;
2086
2083
  });
2087
2084
 
2088
2085
  // src/builtins/run-command.ts
2089
- import { z as z6 } from "zod";
2090
2086
  import { createGadget as createGadget6 } from "llmist";
2087
+ import { z as z6 } from "zod";
2091
2088
 
2092
2089
  // src/spawn.ts
2093
2090
  import { spawn as nodeSpawn } from "child_process";
@@ -2273,8 +2270,8 @@ function isBuiltinGadgetName(name) {
2273
2270
  // src/external-gadgets.ts
2274
2271
  import { execSync } from "child_process";
2275
2272
  import fs5 from "fs";
2276
- import path4 from "path";
2277
2273
  import os from "os";
2274
+ import path4 from "path";
2278
2275
  import { pathToFileURL } from "url";
2279
2276
  function isCommandAvailable(cmd) {
2280
2277
  try {
@@ -2456,7 +2453,9 @@ Please install Node.js: https://nodejs.org/`
2456
2453
  execSync(installCmd, { cwd: cacheDir, stdio: "inherit", env: quietEnv });
2457
2454
  } catch (error) {
2458
2455
  const message = error instanceof Error ? error.message : String(error);
2459
- throw new Error(`Failed to install dependencies for '${spec.package}' using npm: ${message}`);
2456
+ throw new Error(
2457
+ `Failed to install dependencies for '${spec.package}' using npm: ${message}`
2458
+ );
2460
2459
  }
2461
2460
  const packageJson = JSON.parse(fs5.readFileSync(path4.join(cacheDir, "package.json"), "utf-8"));
2462
2461
  if (packageJson.scripts?.build) {
@@ -2557,15 +2556,11 @@ async function loadExternalGadgets(specifier, forceInstall = false) {
2557
2556
  if (manifest?.factory && !isSubagent) {
2558
2557
  const exportsObj = exports;
2559
2558
  if (spec.preset && typeof exportsObj.createGadgetsByPreset === "function") {
2560
- const result = await exportsObj.createGadgetsByPreset(
2561
- spec.preset
2562
- );
2559
+ const result = await exportsObj.createGadgetsByPreset(spec.preset);
2563
2560
  gadgets = extractGadgetsFromModule(result);
2564
2561
  gadgetNames = null;
2565
2562
  } else if (gadgetNames && typeof exportsObj.createGadgetsByName === "function") {
2566
- const result = await exportsObj.createGadgetsByName(
2567
- gadgetNames
2568
- );
2563
+ const result = await exportsObj.createGadgetsByName(gadgetNames);
2569
2564
  gadgets = extractGadgetsFromModule(result);
2570
2565
  gadgetNames = null;
2571
2566
  } else {
@@ -2825,8 +2820,7 @@ function formatCallNumber(n) {
2825
2820
  // src/utils.ts
2826
2821
  import chalk2 from "chalk";
2827
2822
  import { InvalidArgumentError } from "commander";
2828
- import { formatLLMError } from "llmist";
2829
- import { FALLBACK_CHARS_PER_TOKEN } from "llmist";
2823
+ import { FALLBACK_CHARS_PER_TOKEN, formatLLMError } from "llmist";
2830
2824
 
2831
2825
  // src/ui/formatters.ts
2832
2826
  import chalk from "chalk";
@@ -6937,7 +6931,7 @@ var ModalManager = class {
6937
6931
  };
6938
6932
 
6939
6933
  // src/tui/screen.ts
6940
- import { Screen, setRuntime, NodeRuntime } from "@unblessed/node";
6934
+ import { NodeRuntime, Screen, setRuntime } from "@unblessed/node";
6941
6935
  var runtimeInitialized = false;
6942
6936
  function ensureRuntimeInitialized() {
6943
6937
  if (!runtimeInitialized) {
@@ -8701,7 +8695,7 @@ System Prompt (${chars.toLocaleString()} chars, ${lines} lines):
8701
8695
  import { join as join3 } from "path";
8702
8696
  import readline from "readline";
8703
8697
  import chalk4 from "chalk";
8704
- import { LLMist, createLogger } from "llmist";
8698
+ import { createLogger, LLMist } from "llmist";
8705
8699
  var LOG_LEVEL_MAP = {
8706
8700
  silly: 0,
8707
8701
  trace: 1,
@@ -8835,8 +8829,7 @@ function registerCustomCommand(program, name, config, env, globalSubagents, glob
8835
8829
 
8836
8830
  // src/gadget-command.ts
8837
8831
  import chalk6 from "chalk";
8838
- import { schemaToJSONSchema as schemaToJSONSchema2 } from "llmist";
8839
- import { validateGadgetSchema } from "llmist";
8832
+ import { schemaToJSONSchema as schemaToJSONSchema2, validateGadgetSchema } from "llmist";
8840
8833
 
8841
8834
  // src/gadget-prompts.ts
8842
8835
  import { createInterface } from "readline/promises";