llmz 0.0.6 → 0.0.7

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.
Files changed (94) hide show
  1. package/README.md +0 -4
  2. package/package.json +5 -3
  3. package/dist/chat.d.ts +0 -17
  4. package/dist/chunk-4I7UPBLN.cjs +0 -104
  5. package/dist/chunk-4QTK5ALH.cjs +0 -211
  6. package/dist/chunk-5TRUJES5.js +0 -220
  7. package/dist/chunk-6WT5VZBG.cjs +0 -755
  8. package/dist/chunk-7WRN4E42.js +0 -3087
  9. package/dist/chunk-BEPRLBPK.cjs +0 -3123
  10. package/dist/chunk-CH5T6SPC.cjs +0 -694
  11. package/dist/chunk-D3ESDRLH.js +0 -3123
  12. package/dist/chunk-EJRCDWBA.cjs +0 -153
  13. package/dist/chunk-FIVFS4HG.cjs +0 -152
  14. package/dist/chunk-HP7RKM25.js +0 -153
  15. package/dist/chunk-HYVKY3W6.cjs +0 -283
  16. package/dist/chunk-IKSIOIIP.cjs +0 -28
  17. package/dist/chunk-JDABP4SD.cjs +0 -161
  18. package/dist/chunk-JKVVQN2P.js +0 -161
  19. package/dist/chunk-JQBT7UWN.js +0 -28
  20. package/dist/chunk-KMZDFWYZ.cjs +0 -33
  21. package/dist/chunk-ORQP26SZ.js +0 -33
  22. package/dist/chunk-P7J2WCBB.cjs +0 -220
  23. package/dist/chunk-QBXIE6EY.js +0 -211
  24. package/dist/chunk-QT4QF3YA.js +0 -152
  25. package/dist/chunk-S6FOL2HY.js +0 -104
  26. package/dist/chunk-UNMKB2DA.js +0 -283
  27. package/dist/chunk-UQOBUJIQ.cjs +0 -3087
  28. package/dist/chunk-WLUVY5QU.js +0 -755
  29. package/dist/chunk-XJNRORSK.js +0 -694
  30. package/dist/citations.d.ts +0 -63
  31. package/dist/compiler/compiler.d.ts +0 -28
  32. package/dist/compiler/index.d.ts +0 -2
  33. package/dist/compiler/plugins/async-iterator.d.ts +0 -4
  34. package/dist/compiler/plugins/braces-tsx.d.ts +0 -3
  35. package/dist/compiler/plugins/jsx-preserve-newlines.d.ts +0 -5
  36. package/dist/compiler/plugins/line-tracking.d.ts +0 -5
  37. package/dist/compiler/plugins/replace-comment.d.ts +0 -5
  38. package/dist/compiler/plugins/return-async.d.ts +0 -4
  39. package/dist/compiler/plugins/track-tool-calls.d.ts +0 -16
  40. package/dist/compiler/plugins/variable-extraction.d.ts +0 -5
  41. package/dist/component-R2Y74VUI.js +0 -16
  42. package/dist/component-TSNW3SC7.cjs +0 -16
  43. package/dist/component.d.ts +0 -60
  44. package/dist/component.default.d.ts +0 -316
  45. package/dist/context.d.ts +0 -177
  46. package/dist/dual-modes-UHNDHNIF.cjs +0 -12
  47. package/dist/dual-modes-ZUQKPJFH.js +0 -12
  48. package/dist/errors.d.ts +0 -64
  49. package/dist/exit-KJ4COC5N.cjs +0 -8
  50. package/dist/exit-OIYZLBVJ.js +0 -8
  51. package/dist/exit.d.ts +0 -26
  52. package/dist/formatting.d.ts +0 -5
  53. package/dist/getter.d.ts +0 -2
  54. package/dist/handlers.d.ts +0 -10
  55. package/dist/hoist.d.ts +0 -2
  56. package/dist/index.cjs +0 -919
  57. package/dist/index.d.ts +0 -22
  58. package/dist/index.js +0 -919
  59. package/dist/inspect.d.ts +0 -6
  60. package/dist/jsx-AEHVFB3L.js +0 -13
  61. package/dist/jsx-AJAXBWFE.cjs +0 -13
  62. package/dist/jsx.d.ts +0 -11
  63. package/dist/llmz-CPMVYIOJ.cjs +0 -581
  64. package/dist/llmz-LAN4WDFW.js +0 -581
  65. package/dist/llmz.d.ts +0 -40
  66. package/dist/objects.d.ts +0 -24
  67. package/dist/openai.d.ts +0 -8
  68. package/dist/prompts/chat-mode/system.md.d.ts +0 -2
  69. package/dist/prompts/chat-mode/user.md.d.ts +0 -2
  70. package/dist/prompts/common.d.ts +0 -6
  71. package/dist/prompts/dual-modes.d.ts +0 -2
  72. package/dist/prompts/prompt.d.ts +0 -50
  73. package/dist/prompts/worker-mode/system.md.d.ts +0 -2
  74. package/dist/prompts/worker-mode/user.md.d.ts +0 -2
  75. package/dist/result.d.ts +0 -33
  76. package/dist/snapshots.d.ts +0 -69
  77. package/dist/stack-traces.d.ts +0 -1
  78. package/dist/tool-LY77IWV2.js +0 -11
  79. package/dist/tool-SWJYOR2Z.cjs +0 -11
  80. package/dist/tool.d.ts +0 -55
  81. package/dist/transcript.d.ts +0 -9
  82. package/dist/truncator-NYN7BGKJ.cjs +0 -10
  83. package/dist/truncator-WAL2GCUY.js +0 -10
  84. package/dist/truncator.d.ts +0 -21
  85. package/dist/types.d.ts +0 -105
  86. package/dist/typings-AIV2OASX.js +0 -10
  87. package/dist/typings-XR6CYHW4.cjs +0 -10
  88. package/dist/typings.d.ts +0 -5
  89. package/dist/utils-L5GLCS3C.js +0 -37
  90. package/dist/utils-QC4I2L6R.cjs +0 -37
  91. package/dist/utils.d.ts +0 -21
  92. package/dist/vm-2DLG7V4G.cjs +0 -12
  93. package/dist/vm-FLBMZUA2.js +0 -12
  94. package/dist/vm.d.ts +0 -3
package/dist/context.d.ts DELETED
@@ -1,177 +0,0 @@
1
- import { type Cognitive } from '@botpress/cognitive';
2
- import { Chat } from './chat.js';
3
- import { Component } from './component.js';
4
- import { SnapshotSignal } from './errors.js';
5
- import { Exit } from './exit.js';
6
- import { ValueOrGetter } from './getter.js';
7
- import { HookedArray } from './handlers.js';
8
- import { ObjectInstance } from './objects.js';
9
- import type { OAI } from './openai.js';
10
- import { Prompt } from './prompts/prompt.js';
11
- import { Snapshot } from './snapshots.js';
12
- import { Tool } from './tool.js';
13
- import { TranscriptArray } from './transcript.js';
14
- import { ObjectMutation, Trace } from './types.js';
15
- type Model = Parameters<InstanceType<typeof Cognitive>['generateContent']>[0]['model'];
16
- export type IterationParameters = {
17
- transcript: TranscriptArray;
18
- tools: Tool[];
19
- objects: ObjectInstance[];
20
- exits: Exit[];
21
- instructions?: string;
22
- components: Component[];
23
- };
24
- export type IterationStatus = IterationStatuses.Pending | IterationStatuses.GenerationError | IterationStatuses.ExecutionError | IterationStatuses.InvalidCodeError | IterationStatuses.Thinking | IterationStatuses.Callback | IterationStatuses.ExitSuccess | IterationStatuses.ExitError | IterationStatuses.Aborted;
25
- export declare namespace IterationStatuses {
26
- type Pending = {
27
- type: 'pending';
28
- };
29
- type GenerationError = {
30
- type: 'generation_error';
31
- generation_error: {
32
- message: string;
33
- };
34
- };
35
- type InvalidCodeError = {
36
- type: 'invalid_code_error';
37
- invalid_code_error: {
38
- message: string;
39
- };
40
- };
41
- type ExecutionError = {
42
- type: 'execution_error';
43
- execution_error: {
44
- message: string;
45
- stack: string;
46
- };
47
- };
48
- type Thinking = {
49
- type: 'thinking_requested';
50
- thinking_requested: {
51
- reason?: string;
52
- variables: Record<string, unknown>;
53
- };
54
- };
55
- type Callback = {
56
- type: 'callback_requested';
57
- callback_requested: {
58
- signal: SnapshotSignal;
59
- };
60
- };
61
- type ExitSuccess<T = unknown> = {
62
- type: 'exit_success';
63
- exit_success: {
64
- exit_name: string;
65
- return_value: T;
66
- };
67
- };
68
- type ExitError = {
69
- type: 'exit_error';
70
- exit_error: {
71
- exit: string;
72
- return_value: unknown;
73
- message: string;
74
- };
75
- };
76
- type Aborted = {
77
- type: 'aborted';
78
- aborted: {
79
- reason: string;
80
- };
81
- };
82
- }
83
- export declare const ThinkExit: Exit<unknown>;
84
- export declare const ListenExit: Exit<unknown>;
85
- export declare const DefaultExit: Exit<{
86
- success: true;
87
- result?: any;
88
- } | {
89
- error: string;
90
- success: false;
91
- }>;
92
- export declare class Iteration {
93
- id: string;
94
- messages: OAI.Message[];
95
- code?: string;
96
- traces: HookedArray<Trace>;
97
- variables: Record<string, any>;
98
- started_ts: number;
99
- ended_ts?: number;
100
- status: IterationStatus;
101
- private _mutations;
102
- get mutations(): ObjectMutation[];
103
- trackMutation(mutation: ObjectMutation): void;
104
- private _parameters;
105
- get transcript(): TranscriptArray;
106
- get tools(): Tool<import("./types.js").ZuiType, import("./types.js").ZuiType>[];
107
- get objects(): ObjectInstance[];
108
- get exits(): Exit<unknown>[];
109
- get instructions(): string | undefined;
110
- llm?: {
111
- started_at: number;
112
- ended_at: number;
113
- status: 'success' | 'error';
114
- cached: boolean;
115
- tokens: number;
116
- spend: number;
117
- output: string;
118
- model: string;
119
- };
120
- hasExited(this: this): this is this & {
121
- status: IterationStatuses.ExitSuccess;
122
- };
123
- hasExitedWith<R>(this: this, exit: Exit<R>): this is {
124
- status: IterationStatuses.ExitSuccess<R>;
125
- } & this;
126
- isSuccessful(this: this): this is this & {
127
- status: IterationStatuses.ExitSuccess | IterationStatuses.Callback | IterationStatuses.Thinking;
128
- };
129
- isFailed(this: this): this is this & {
130
- status: IterationStatuses.GenerationError | IterationStatuses.ExecutionError | IterationStatuses.InvalidCodeError | IterationStatuses.ExitError | IterationStatuses.Aborted;
131
- };
132
- get duration(): string;
133
- get error(): string | null;
134
- get isChatEnabled(): boolean;
135
- constructor(props: {
136
- id: string;
137
- parameters: IterationParameters;
138
- messages: OAI.Message[];
139
- variables: Record<string, any>;
140
- });
141
- end(status: IterationStatus): void;
142
- }
143
- export declare class Context {
144
- id: string;
145
- chat?: Chat;
146
- instructions?: ValueOrGetter<string, Context>;
147
- objects?: ValueOrGetter<ObjectInstance[], Context>;
148
- tools?: ValueOrGetter<Tool[], Context>;
149
- exits?: ValueOrGetter<Exit[], Context>;
150
- version: Prompt;
151
- timeout: number;
152
- loop: number;
153
- temperature: number;
154
- model?: Model;
155
- metadata: Record<string, any>;
156
- snapshot?: Snapshot;
157
- iteration: number;
158
- iterations: Iteration[];
159
- nextIteration(): Promise<Iteration>;
160
- private _getIterationVariables;
161
- private _getIterationMessages;
162
- private _refreshIterationParameters;
163
- constructor(props: {
164
- chat?: Chat;
165
- instructions?: ValueOrGetter<string, Context>;
166
- objects?: ValueOrGetter<ObjectInstance[], Context>;
167
- tools?: ValueOrGetter<Tool[], Context>;
168
- exits?: ValueOrGetter<Exit[], Context>;
169
- loop?: number;
170
- temperature?: number;
171
- model?: Model;
172
- metadata?: Record<string, any>;
173
- snapshot?: Snapshot;
174
- timeout?: number;
175
- });
176
- }
177
- export {};
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunk6WT5VZBGcjs = require('./chunk-6WT5VZBG.cjs');
4
- require('./chunk-IKSIOIIP.cjs');
5
- require('./chunk-EJRCDWBA.cjs');
6
- require('./chunk-KMZDFWYZ.cjs');
7
- require('./chunk-FIVFS4HG.cjs');
8
- require('./chunk-P7J2WCBB.cjs');
9
- require('./chunk-UQOBUJIQ.cjs');
10
-
11
-
12
- exports.DualModePrompt = _chunk6WT5VZBGcjs.DualModePrompt;
@@ -1,12 +0,0 @@
1
- import {
2
- DualModePrompt
3
- } from "./chunk-WLUVY5QU.js";
4
- import "./chunk-JQBT7UWN.js";
5
- import "./chunk-HP7RKM25.js";
6
- import "./chunk-ORQP26SZ.js";
7
- import "./chunk-QT4QF3YA.js";
8
- import "./chunk-5TRUJES5.js";
9
- import "./chunk-7WRN4E42.js";
10
- export {
11
- DualModePrompt
12
- };
package/dist/errors.d.ts DELETED
@@ -1,64 +0,0 @@
1
- import { JSONSchema } from '@bpinternal/zui';
2
- import { type Assignment } from './compiler/plugins/track-tool-calls.js';
3
- export type ToolCall = {
4
- name: string;
5
- inputSchema?: JSONSchema;
6
- outputSchema?: JSONSchema;
7
- input?: unknown;
8
- assignment?: Assignment;
9
- };
10
- export declare namespace Signals {
11
- function isWrappedError(error: Error): boolean;
12
- function serializeError(error: Error): string;
13
- function maybeDeserializeError(error: unknown): any;
14
- }
15
- export declare class VMSignal extends Error {
16
- message: string;
17
- /**
18
- * The code that was executed by the VM up to the point of the signal
19
- */
20
- truncatedCode: string;
21
- /** The current tool call, if any */
22
- toolCall?: ToolCall;
23
- /**
24
- * Contains all the declared and executed variables during the VM execution
25
- * See file plugins/variable-extraction.ts for more details
26
- */
27
- variables: {
28
- [key: string]: any;
29
- };
30
- constructor(message: string);
31
- }
32
- /** Request a snapshot from inside a tool call */
33
- export declare class SnapshotSignal extends VMSignal {
34
- constructor(message: string);
35
- }
36
- /** Loop means LLMz will continue the execution (unless it exhausted its iterations) */
37
- export declare class VMLoopSignal extends VMSignal {
38
- constructor(message: string);
39
- }
40
- export declare class ThinkSignal extends VMLoopSignal {
41
- reason: string;
42
- context?: any | undefined;
43
- constructor(reason: string, context?: any | undefined);
44
- toString(): string;
45
- }
46
- export declare class CodeExecutionError extends Error {
47
- code: string;
48
- stacktrace: string;
49
- constructor(message: string, code: string, stacktrace: string);
50
- }
51
- export declare class InvalidCodeError extends Error {
52
- code: string;
53
- constructor(message: string, code: string);
54
- }
55
- export declare class LoopExceededError extends Error {
56
- constructor();
57
- }
58
- export declare class CodeFormattingError extends Error {
59
- code: string;
60
- constructor(message: string, code: string);
61
- }
62
- export declare class AssignmentError extends Error {
63
- constructor(message: string);
64
- }
@@ -1,8 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunk4I7UPBLNcjs = require('./chunk-4I7UPBLN.cjs');
4
- require('./chunk-P7J2WCBB.cjs');
5
- require('./chunk-UQOBUJIQ.cjs');
6
-
7
-
8
- exports.Exit = _chunk4I7UPBLNcjs.Exit;
@@ -1,8 +0,0 @@
1
- import {
2
- Exit
3
- } from "./chunk-S6FOL2HY.js";
4
- import "./chunk-5TRUJES5.js";
5
- import "./chunk-7WRN4E42.js";
6
- export {
7
- Exit
8
- };
package/dist/exit.d.ts DELETED
@@ -1,26 +0,0 @@
1
- import { type JSONSchema } from '@bpinternal/zui';
2
- import { ZuiType } from './types.js';
3
- export type ExitResult<T = unknown> = {
4
- exit: Exit<T>;
5
- result: T;
6
- };
7
- export declare class Exit<T = unknown> {
8
- name: string;
9
- aliases: string[];
10
- description: string;
11
- metadata: Record<string, unknown>;
12
- schema?: JSONSchema;
13
- get zSchema(): import("@bpinternal/zui").ZodTypeAny | undefined;
14
- rename(name: string): this;
15
- clone(): Exit<any>;
16
- is<T>(exit: Exit<T>): this is Exit<T>;
17
- match(result: ExitResult): result is ExitResult<T>;
18
- constructor(props: {
19
- name: string;
20
- aliases?: string[];
21
- description: string;
22
- metadata?: Record<string, unknown>;
23
- schema?: ZuiType<T>;
24
- });
25
- static withUniqueNames: (exits: Exit[]) => Exit<unknown>[];
26
- }
@@ -1,5 +0,0 @@
1
- import { format } from 'prettier/standalone';
2
- export type CodeFormatOptions = Parameters<typeof format>[1] & {
3
- throwOnError?: boolean;
4
- };
5
- export declare function formatTypings(typings: string, options?: CodeFormatOptions): Promise<string>;
package/dist/getter.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export type ValueOrGetter<T, I> = T | ((ctx: I) => T) | ((ctx: I) => Promise<T>);
2
- export declare const getValue: <T, I>(valueOrGetter: ValueOrGetter<T, I>, ctx?: I) => Promise<T>;
@@ -1,10 +0,0 @@
1
- type UnsubscribeFn = () => void;
2
- type EventHandler<T> = (event: T) => void;
3
- export type SubscribeFn<T> = (fn: EventHandler<T>) => UnsubscribeFn;
4
- export declare class HookedArray<T> extends Array<T> {
5
- #private;
6
- constructor(...items: T[]);
7
- push(...items: T[]): number;
8
- onPush(fn: EventHandler<T[]>): UnsubscribeFn;
9
- }
10
- export {};
package/dist/hoist.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { CodeFormatOptions } from './formatting.js';
2
- export declare function hoistTypings(code: string, formatOptions?: CodeFormatOptions): Promise<string>;