llmist 1.0.0 → 1.2.0

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/index.d.cts CHANGED
@@ -1269,18 +1269,34 @@ declare class HumanInputException extends Error {
1269
1269
  constructor(question: string);
1270
1270
  }
1271
1271
 
1272
+ interface ErrorFormatterOptions {
1273
+ /** Custom argument prefix for block format examples. Default: "!!!ARG:" */
1274
+ argPrefix?: string;
1275
+ /** Custom start prefix for block format examples. Default: "!!!GADGET_START:" */
1276
+ startPrefix?: string;
1277
+ /** Custom end prefix for block format examples. Default: "!!!GADGET_END" */
1278
+ endPrefix?: string;
1279
+ }
1280
+
1272
1281
  declare class GadgetExecutor {
1273
1282
  private readonly registry;
1274
1283
  private readonly onHumanInputRequired?;
1275
1284
  private readonly defaultGadgetTimeoutMs?;
1276
1285
  private readonly logger;
1277
- constructor(registry: GadgetRegistry, onHumanInputRequired?: ((question: string) => Promise<string>) | undefined, logger?: Logger<ILogObj>, defaultGadgetTimeoutMs?: number | undefined);
1286
+ private readonly errorFormatter;
1287
+ private readonly argPrefix;
1288
+ constructor(registry: GadgetRegistry, onHumanInputRequired?: ((question: string) => Promise<string>) | undefined, logger?: Logger<ILogObj>, defaultGadgetTimeoutMs?: number | undefined, errorFormatterOptions?: ErrorFormatterOptions);
1278
1289
  /**
1279
1290
  * Creates a promise that rejects with a TimeoutException after the specified timeout.
1280
1291
  */
1281
1292
  private createTimeoutPromise;
1282
1293
  execute(call: ParsedGadgetCall): Promise<GadgetExecutionResult>;
1283
1294
  executeAll(calls: ParsedGadgetCall[]): Promise<GadgetExecutionResult[]>;
1295
+ /**
1296
+ * Deep equality check for objects/arrays.
1297
+ * Used to detect if parameters were modified by an interceptor.
1298
+ */
1299
+ private deepEquals;
1284
1300
  }
1285
1301
 
1286
1302
  interface StreamParserOptions {
@@ -1303,10 +1319,11 @@ declare class StreamParser {
1303
1319
  */
1304
1320
  private parseGadgetName;
1305
1321
  /**
1306
- * Truncate verbose parse errors to avoid context overflow.
1307
- * Keeps first meaningful line and limits total length.
1322
+ * Extract the error message from a parse error.
1323
+ * Preserves full message since the error formatter adds contextual help
1324
+ * that benefits from precise, detailed error information.
1308
1325
  */
1309
- private truncateParseError;
1326
+ private extractParseError;
1310
1327
  /**
1311
1328
  * Parse parameter string using block format
1312
1329
  */
package/dist/index.d.ts CHANGED
@@ -1269,18 +1269,34 @@ declare class HumanInputException extends Error {
1269
1269
  constructor(question: string);
1270
1270
  }
1271
1271
 
1272
+ interface ErrorFormatterOptions {
1273
+ /** Custom argument prefix for block format examples. Default: "!!!ARG:" */
1274
+ argPrefix?: string;
1275
+ /** Custom start prefix for block format examples. Default: "!!!GADGET_START:" */
1276
+ startPrefix?: string;
1277
+ /** Custom end prefix for block format examples. Default: "!!!GADGET_END" */
1278
+ endPrefix?: string;
1279
+ }
1280
+
1272
1281
  declare class GadgetExecutor {
1273
1282
  private readonly registry;
1274
1283
  private readonly onHumanInputRequired?;
1275
1284
  private readonly defaultGadgetTimeoutMs?;
1276
1285
  private readonly logger;
1277
- constructor(registry: GadgetRegistry, onHumanInputRequired?: ((question: string) => Promise<string>) | undefined, logger?: Logger<ILogObj>, defaultGadgetTimeoutMs?: number | undefined);
1286
+ private readonly errorFormatter;
1287
+ private readonly argPrefix;
1288
+ constructor(registry: GadgetRegistry, onHumanInputRequired?: ((question: string) => Promise<string>) | undefined, logger?: Logger<ILogObj>, defaultGadgetTimeoutMs?: number | undefined, errorFormatterOptions?: ErrorFormatterOptions);
1278
1289
  /**
1279
1290
  * Creates a promise that rejects with a TimeoutException after the specified timeout.
1280
1291
  */
1281
1292
  private createTimeoutPromise;
1282
1293
  execute(call: ParsedGadgetCall): Promise<GadgetExecutionResult>;
1283
1294
  executeAll(calls: ParsedGadgetCall[]): Promise<GadgetExecutionResult[]>;
1295
+ /**
1296
+ * Deep equality check for objects/arrays.
1297
+ * Used to detect if parameters were modified by an interceptor.
1298
+ */
1299
+ private deepEquals;
1284
1300
  }
1285
1301
 
1286
1302
  interface StreamParserOptions {
@@ -1303,10 +1319,11 @@ declare class StreamParser {
1303
1319
  */
1304
1320
  private parseGadgetName;
1305
1321
  /**
1306
- * Truncate verbose parse errors to avoid context overflow.
1307
- * Keeps first meaningful line and limits total length.
1322
+ * Extract the error message from a parse error.
1323
+ * Preserves full message since the error formatter adds contextual help
1324
+ * that benefits from precise, detailed error information.
1308
1325
  */
1309
- private truncateParseError;
1326
+ private extractParseError;
1310
1327
  /**
1311
1328
  * Parse parameter string using block format
1312
1329
  */
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  mockLLM,
11
11
  validateAndApplyDefaults,
12
12
  validateGadgetParams
13
- } from "./chunk-53MM55JS.js";
13
+ } from "./chunk-LELPPETT.js";
14
14
  import {
15
15
  AgentBuilder,
16
16
  AnthropicMessagesProvider,
@@ -74,7 +74,7 @@ import {
74
74
  resolveRulesTemplate,
75
75
  runWithHandlers,
76
76
  stream
77
- } from "./chunk-T24KLXY4.js";
77
+ } from "./chunk-KORMY3CD.js";
78
78
 
79
79
  // src/index.ts
80
80
  init_builder();