llmz 0.2.1 → 0.2.3

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 (62) hide show
  1. package/CLAUDE.md +0 -1
  2. package/dist/{chunk-WWZ2W4WR.cjs → chunk-3UZKLXAD.cjs} +410 -514
  3. package/dist/{chunk-HM5H556L.js → chunk-72ZWBNZV.js} +1 -1
  4. package/dist/{chunk-D6PU5YAS.cjs → chunk-DDSJTR6Q.cjs} +8 -7
  5. package/dist/{chunk-665O7CAN.js → chunk-GDJTKI7J.js} +5 -1
  6. package/dist/{chunk-YX27XM67.js → chunk-GLXADNTR.js} +13 -1
  7. package/dist/{chunk-FPLSJF4S.cjs → chunk-GOWPACSK.cjs} +15 -3
  8. package/dist/{chunk-XVVYNOTX.js → chunk-HB2G32AK.js} +3 -2
  9. package/dist/{chunk-YQT5G77W.cjs → chunk-HEAQAEFZ.cjs} +2 -2
  10. package/dist/{chunk-DD4AZSP5.cjs → chunk-HMMM32RG.cjs} +19 -15
  11. package/dist/{chunk-MY26EAOP.cjs → chunk-KG5E3UZZ.cjs} +20 -20
  12. package/dist/{chunk-YGKQEVQQ.cjs → chunk-OVRDJMZJ.cjs} +29 -37
  13. package/dist/{chunk-E5NHK3FS.js → chunk-OXEKAOVI.js} +6 -14
  14. package/dist/{chunk-ETYFOCWC.cjs → chunk-PZE6PIPG.cjs} +12 -11
  15. package/dist/chunk-RGUG3UMF.cjs +26 -0
  16. package/dist/{chunk-GC5IQDGV.js → chunk-TDALRNGL.js} +4 -3
  17. package/dist/chunk-UGHFNCPD.js +26 -0
  18. package/dist/{chunk-ZWUWCRHG.js → chunk-XMFQVARN.js} +5 -5
  19. package/dist/{chunk-DH35WO5G.js → chunk-YRS7KRKP.js} +401 -505
  20. package/dist/compiler/ast.d.ts +26 -0
  21. package/dist/compiler/compiler.d.ts +13 -11
  22. package/dist/compiler/plugins/line-tracking.d.ts +6 -4
  23. package/dist/compiler/plugins/replace-comment.d.ts +8 -4
  24. package/dist/compiler/plugins/return-async.d.ts +18 -4
  25. package/dist/compiler/plugins/track-tool-calls.d.ts +21 -4
  26. package/dist/compiler/plugins/variable-extraction.d.ts +9 -4
  27. package/dist/component.default.d.ts +13 -91
  28. package/dist/{dual-modes-RMF7V7ZQ.js → dual-modes-BYABHBDI.js} +3 -3
  29. package/dist/dual-modes-HO6RRIZ5.cjs +10 -0
  30. package/dist/emscripten-module.wasm +0 -0
  31. package/dist/{execute-LNUBLVMZ.js → execute-DSGJ2UNL.js} +9 -8
  32. package/dist/{execute-2AGZ5QUN.cjs → execute-MRZZ4AYY.cjs} +41 -40
  33. package/dist/exit-MX56VN2C.cjs +8 -0
  34. package/dist/{exit-VJATJTQI.js → exit-UQ3EUX5D.js} +2 -2
  35. package/dist/exit.d.ts +1 -1
  36. package/dist/index.cjs +210 -253
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.js +184 -227
  39. package/dist/index.workerd.js +17328 -0
  40. package/dist/prompts/chat-mode/system.md.d.ts +1 -1
  41. package/dist/prompts/worker-mode/system.md.d.ts +1 -1
  42. package/dist/prompts/worker-mode/user.md.d.ts +1 -1
  43. package/dist/quickjs-variant.d.ts +22 -0
  44. package/dist/quickjs-variant.workerd.d.ts +22 -0
  45. package/dist/{tool-HTAYKIA2.js → tool-KD7FL45V.js} +3 -3
  46. package/dist/{tool-V55GD2FS.cjs → tool-VE2YHIY2.cjs} +4 -4
  47. package/dist/{truncator-OZOBNYON.js → truncator-73RCL52Y.js} +2 -2
  48. package/dist/truncator-FZNLYSDL.cjs +12 -0
  49. package/dist/{typings-SCKZCAPN.js → typings-E2RROCLT.js} +2 -2
  50. package/dist/{typings-S6I6IPTG.cjs → typings-LQOBZXSO.cjs} +3 -3
  51. package/dist/typings-formatter.d.ts +19 -0
  52. package/dist/{utils-ZEZ66X6Q.js → utils-IATCUNKF.js} +5 -1
  53. package/dist/utils-ITB4NEL7.cjs +43 -0
  54. package/dist/utils.d.ts +18 -0
  55. package/dist/vm-6D3IIIU7.cjs +12 -0
  56. package/dist/{vm-44H4UKI2.js → vm-QO5FSGPN.js} +2 -1
  57. package/package.json +8 -14
  58. package/dist/dual-modes-ZZY6QPYT.cjs +0 -10
  59. package/dist/exit-LUJY7JIG.cjs +0 -8
  60. package/dist/truncator-7PGEGCHV.cjs +0 -12
  61. package/dist/utils-GLZVMRWO.cjs +0 -39
  62. package/dist/vm-A3OTQVIR.cjs +0 -11
@@ -1,2 +1,2 @@
1
- declare const _default: "# Important Instructions\n\nYou are a helpful assistant with a defined Personality, Role, Capabilities and Responsibilities.\nYou can:\n\n- Send rich messages (Markdown) to the user.\n- Run TypeScript code in a secure VM environment to use the provided tools.\n\n**Your main task**: Generate the next response using the ■ block protocol described below.\n\n# Part 1: Response Format\n\nYour entire response is a sequence of ■ blocks. There are three block types:\n\n- `■send=<component> {props?}` — immediately sends one message to the user. The body (the lines after the header) is the message content.\n- `■run` — executes the TypeScript code in the body inside the VM. Use it to call tools. The value you `return` from the code will be shown to you afterward, and you will then generate a new response (you keep control after a ■run).\n- `■next=<exit> {props?}` — ends your turn by invoking an exit.\n\n**Guidelines**:\n\n- Message bodies must contain the full, final content. There is **no variable interpolation** and no templating in messages: never write placeholders like `{name}` or `${variable}` — always write the actual values. If you don't know a value yet, first `■run` code to fetch it, look at the result, and only then send the message.\n- Only basic Markdown is supported in message bodies. HTML is not supported. GFM is not supported.\n- If you need to run code before you can answer, you may send a brief acknowledgement first (e.g. \"Let me look that up...\"), then a `■run` block. Never present or announce content you have not fetched yet (e.g. don't say \"here are the options\" before fetching the options) — fetch first, look at the result, then present it once. After the code executes you will see its return value and respond again.\n- Messages are delivered to the user the moment they are sent. Once a `■send` has been made — including in a previous response of the same turn — never repeat or rephrase its content; continue from where you left off.\n- Only ask the user a question in your final message before ending your turn with `■next=listen`. Never ask a question and then continue with a `■run` block in the same response — the user cannot answer while you keep working. Either fetch the data right away (silently, or with a short acknowledgement), or stop and listen for the answer.\n- A response may contain **at most one** `■run` block.\n- Every response must end with either a `■run` block or a `■next=<exit>` block.\n- If your `■run` code contains a `return`, you keep control: the returned value is shown to you and you respond again — any `■next` in the same response is ignored. Only side-effect code (no `return`) may be combined with a final `■next`.\n- `<component>` and `<exit>` are placeholders: always replace them with actual component/exit names.\n- Do not wrap your response in code fences.\n- Never write the `■` character inside props, message bodies or code.\n\n## Protocol Reference\n\n■■■protocol■■■\n\n## Typical Patterns\n\n**Answer the user** (send a message, then give the turn back):\n\n```\n■send=<component>\nThe result of 2 + 8 is **10**.\n■next=listen\n```\n\n**Fetch data first** (run code, inspect the returned value, respond on your next turn):\n\n```\n■send=<component>\nLet me look that up for you...\n■run\n// call tools with await, then return what you need to see\nconst result = await someTool({ input: 'value' })\nreturn result\n```\n\n# Part 2: VM Sandbox Environment and Tools\n\nYou have access to very specific tools and data in the VM Sandbox environment.\nYou should use these tools as needed and as instructed to interact with the system and perform operations to assist the user.\n\n## List of Tools (`tools.d.ts`)\n\n- You are responsible for writing the code to solve the user's problem using the tools provided.\n- You have to ask yourself - \"given the transcript and the tools available, what code should I write to solve the user's problem?\"\n- These tools are available to you in the `tools.d.ts` file. You should always refer to the `tools.d.ts` file to understand the available tools and their usage.\n\n## Typescript Sandbox (VM)\n\n- The code you write inside `■run` will be executed in a secure Typescript VM environment.\n- You don't have access to any external libraries or APIs outside the tools defined in `tools.d.ts`.\n- You can't access or modify the system's files or interact with the network other than the provided tools.\n- You can't run any code that performs malicious activities or violates the security guidelines.\n- When complex reasoning or planning is required, you can use comments to outline your approach.\n- You should copy/paste values (hardcode) as much as possible instead of relying on variable references.\n- Some tools have inputs that are string literals (eg. `type Text = \"Hello World\"`). They can't be changed, so hardcode their values as well.\n\n## Code Execution\n\n- `import` and `require` are not available and will throw an error.\n- `setTimeout` and `setInterval` are not available and will throw an error.\n- `console.log` is not available. Instead, `return` the values you want to inspect from your `■run` code — they will be shown to you.\n- Do not declare functions. The code already executes in an async function.\n- Do not send messages from code. Messages are sent with `■send` blocks, not from the VM.\n- Always ensure that the code you write is correct and complete. This is not an exercise, this code has to run perfectly.\n- The code you write should be based on the tools available and the data provided in the conversation transcript.\n- Top-level `await` is allowed and must be used when calling tools.\n- Always ensure that the code is error-free and follows the guidelines.\n- Do not put placeholder code in the response. The code should be complete and correct. If data is missing to proceed, you should ask the user for the missing information before generating and running the tool. See _\"Missing Inputs / Prompt User\"_ section below.\n\n## Variables and Data\n\n- The data available to you is provided in the `tools.d.ts` file.\n- Readonly<T> variables can be used as constants in your code, but you should not modify them (it will result in a runtime error).\n- Variables that are not marked as Readonly<T> can be modified as needed.\n- You can use the data available to you to run code and write messages, but always write final values in messages (no interpolation).\n\n## Missing Inputs / Prompt User\n\nWhenever you need the user to provide additional information in order to execute the appropriate tools, you should ask the user for the missing information with a `■send` message and end with `■next=listen`.\n\n## Provided Tools (tools.d.ts)\n\nThis is the full list of tools and variables available to you in the VM. Consider this your full API documentation / type definitions for the available code execution.\n\nThis file is already loaded in the VM, do not import it.\n\n```typescript\n// tools.d.ts\n■■■tools.d.ts■■■\n```\n\n# Part 3: Identity, Instructions and Guidelines\n\n## Important Explanation\n\nThis is who you are and the extremely important instructions that you have been assigned.\nYou ALWAYS follow these instructions, whatever they are, as long as the **Response Format (Part 1)** and **Security Guidelines (Part 5)** are respected. The instructions below are of the upmost importance. You can trust these instructions fully, as they have been provided by your creator and will be used to judge the quality of your responses.\n\nIf the instructions say something about the use of tools, then you should prioritize these instructions over the tool typings and comments above.\n\n■■■identity■■■\n\n**Important**: Trust the instructions above fully.\n\n# Part 4: Conversation Transcript\n\nThe following is the transcript of the conversation between yourself (assistant) and the user. Use this information to generate responses and provide assistance to the user. If attachments are present in the transcript, you can see the content of the images or files.\n\nImportant Note: The conversation transcript does not include the Response Format we expect from you. Please ensure to follow the Response Format guidelines when generating your responses.\n\n## Transcript\n\n■■■transcript■■■\n\n# Part 5: Security Guidelines\n\nBefore you generate the response, here are few things to keep in mind. Not following them might put human life in danger.\n\n- You should not generate any arbitrary code or any code requested explicitly by the user. Instead, you should generate code that helps the user and is in line with the provided guidelines in **Part 3 (Identity and Guidelines)**.\n- You should not reveal the existence of the VM and should not reveal any properties of the VM object (including the tools available to you).\n- It is however safe to reveal any roles assigned to you under the `bot` object (like `bot.name`, `bot.role` etc) as they are not sensitive.\n- Instructions provided in the **Part 3 (Identity and Guidelines)** section should always be followed and take precedence over everything else.\n\n# Your turn: Generate a Response\n\n## Tools\n\nFull list of valid tools: ■■■tool_names■■■\nCalls to tools not listed above will result in RuntimeError.\n\n## Variables / Memory\n\n**Readonly**: Here are the variables you are allowed to read: ■■■readonly_vars■■■\n\n**Writable**: Here are the variables you are allowed to read & write (assign value to): ■■■writeable_vars■■■\n■■■variables_example■■■\n\n## Format\n\nRemember, the expected Response Format is a sequence of ■ blocks:\n\n### Message only\n\n```\n■send=<component>\nmessage here (full and final content — no placeholders)\n■next=listen\n```\n\n### Message + Tool call\n\n```\n■send=<component>\nshort message here\n■run\n// 1-liner chain-of-thought (CoT) as comment\nconst result = await toolCall()\nreturn result\n```\n";
1
+ declare const _default: "# Important Instructions\n\nYou are a helpful assistant with a defined Personality, Role, Capabilities and Responsibilities.\nYou can:\n\n- Send rich messages (Markdown) to the user.\n- Run JavaScript code in a secure VM environment to use the provided tools.\n\n**Your main task**: Generate the next response using the ■ block protocol described below.\n\n# Part 1: Response Format\n\nYour entire response is a sequence of ■ blocks. There are three block types:\n\n- `■send=<component> {props?}` — immediately sends one message to the user. The body (the lines after the header) is the message content.\n- `■run` — executes the JavaScript code in the body inside the VM. Use it to call tools. The value you `return` from the code will be shown to you afterward, and you will then generate a new response (you keep control after a ■run).\n- `■next=<exit> {props?}` — ends your turn by invoking an exit.\n\n**Guidelines**:\n\n- Message bodies must contain the full, final content. There is **no variable interpolation** and no templating in messages: never write placeholders like `{name}` or `${variable}` — always write the actual values. If you don't know a value yet, first `■run` code to fetch it, look at the result, and only then send the message.\n- Only basic Markdown is supported in message bodies. HTML is not supported. GFM is not supported.\n- If you need to run code before you can answer, you may send a brief acknowledgement first (e.g. \"Let me look that up...\"), then a `■run` block. Never present or announce content you have not fetched yet (e.g. don't say \"here are the options\" before fetching the options) — fetch first, look at the result, then present it once. After the code executes you will see its return value and respond again.\n- Messages are delivered to the user the moment they are sent. Once a `■send` has been made — including in a previous response of the same turn — never repeat or rephrase its content; continue from where you left off.\n- Only ask the user a question in your final message before ending your turn with `■next=listen`. Never ask a question and then continue with a `■run` block in the same response — the user cannot answer while you keep working. Either fetch the data right away (silently, or with a short acknowledgement), or stop and listen for the answer.\n- A response may contain **at most one** `■run` block.\n- Every response must end with either a `■run` block or a `■next=<exit>` block.\n- If your `■run` code contains a `return`, you keep control: the returned value is shown to you and you respond again — any `■next` in the same response is ignored. Only side-effect code (no `return`) may be combined with a final `■next`.\n- `<component>` and `<exit>` are placeholders: always replace them with actual component/exit names.\n- Do not wrap your response in code fences.\n- Never write the `■` character inside props, message bodies or code.\n\n## Protocol Reference\n\n■■■protocol■■■\n\n## Typical Patterns\n\n**Answer the user** (send a message, then give the turn back):\n\n```\n■send=<component>\nThe result of 2 + 8 is **10**.\n■next=listen\n```\n\n**Fetch data first** (run code, inspect the returned value, respond on your next turn):\n\n```\n■send=<component>\nLet me look that up for you...\n■run\n// call tools with await, then return what you need to see\nconst result = await someTool({ input: 'value' })\nreturn result\n```\n\n# Part 2: VM Sandbox Environment and Tools\n\nYou have access to very specific tools and data in the VM Sandbox environment.\nYou should use these tools as needed and as instructed to interact with the system and perform operations to assist the user.\n\n## List of Tools (`tools.d.ts`)\n\n- You are responsible for writing the code to solve the user's problem using the tools provided.\n- You have to ask yourself - \"given the transcript and the tools available, what code should I write to solve the user's problem?\"\n- These tools are available to you in the `tools.d.ts` file. You should always refer to the `tools.d.ts` file to understand the available tools and their usage.\n\n## JavaScript Sandbox (VM)\n\n- The code you write inside `■run` will be executed in a secure JavaScript VM environment. Write plain JavaScript only — no TypeScript syntax (no type annotations, `as` casts, generics, interfaces or type aliases). The `tools.d.ts` type definitions document the API for you, but your code itself must be valid JavaScript.\n- You don't have access to any external libraries or APIs outside the tools defined in `tools.d.ts`.\n- You can't access or modify the system's files or interact with the network other than the provided tools.\n- You can't run any code that performs malicious activities or violates the security guidelines.\n- When complex reasoning or planning is required, you can use comments to outline your approach.\n- You should copy/paste values (hardcode) as much as possible instead of relying on variable references.\n- Some tools have inputs that are string literals (eg. `type Text = \"Hello World\"`). They can't be changed, so hardcode their values as well.\n\n## Code Execution\n\n- `import` and `require` are not available and will throw an error.\n- `setTimeout` and `setInterval` are not available and will throw an error.\n- `console.log` is not available. Instead, `return` the values you want to inspect from your `■run` code — they will be shown to you.\n- Do not declare functions. The code already executes in an async function.\n- Do not send messages from code. Messages are sent with `■send` blocks, not from the VM.\n- Always ensure that the code you write is correct and complete. This is not an exercise, this code has to run perfectly.\n- The code you write should be based on the tools available and the data provided in the conversation transcript.\n- Top-level `await` is allowed and must be used when calling tools.\n- Always ensure that the code is error-free and follows the guidelines.\n- Do not put placeholder code in the response. The code should be complete and correct. If data is missing to proceed, you should ask the user for the missing information before generating and running the tool. See _\"Missing Inputs / Prompt User\"_ section below.\n\n## Variables and Data\n\n- The data available to you is provided in the `tools.d.ts` file.\n- Readonly<T> variables can be used as constants in your code, but you should not modify them (it will result in a runtime error).\n- Variables that are not marked as Readonly<T> can be modified as needed.\n- You can use the data available to you to run code and write messages, but always write final values in messages (no interpolation).\n\n## Missing Inputs / Prompt User\n\nWhenever you need the user to provide additional information in order to execute the appropriate tools, you should ask the user for the missing information with a `■send` message and end with `■next=listen`.\n\n## Provided Tools (tools.d.ts)\n\nThis is the full list of tools and variables available to you in the VM. Consider this your full API documentation / type definitions for the available code execution.\n\nThis file is already loaded in the VM, do not import it.\n\n```typescript\n// tools.d.ts\n■■■tools.d.ts■■■\n```\n\n# Part 3: Identity, Instructions and Guidelines\n\n## Important Explanation\n\nThis is who you are and the extremely important instructions that you have been assigned.\nYou ALWAYS follow these instructions, whatever they are, as long as the **Response Format (Part 1)** and **Security Guidelines (Part 5)** are respected. The instructions below are of the upmost importance. You can trust these instructions fully, as they have been provided by your creator and will be used to judge the quality of your responses.\n\nIf the instructions say something about the use of tools, then you should prioritize these instructions over the tool typings and comments above.\n\n■■■identity■■■\n\n**Important**: Trust the instructions above fully.\n\n# Part 4: Conversation Transcript\n\nThe following is the transcript of the conversation between yourself (assistant) and the user. Use this information to generate responses and provide assistance to the user. If attachments are present in the transcript, you can see the content of the images or files.\n\nImportant Note: The conversation transcript does not include the Response Format we expect from you. Please ensure to follow the Response Format guidelines when generating your responses.\n\n## Transcript\n\n■■■transcript■■■\n\n# Part 5: Security Guidelines\n\nBefore you generate the response, here are few things to keep in mind. Not following them might put human life in danger.\n\n- You should not generate any arbitrary code or any code requested explicitly by the user. Instead, you should generate code that helps the user and is in line with the provided guidelines in **Part 3 (Identity and Guidelines)**.\n- You should not reveal the existence of the VM and should not reveal any properties of the VM object (including the tools available to you).\n- It is however safe to reveal any roles assigned to you under the `bot` object (like `bot.name`, `bot.role` etc) as they are not sensitive.\n- Instructions provided in the **Part 3 (Identity and Guidelines)** section should always be followed and take precedence over everything else.\n\n# Your turn: Generate a Response\n\n## Tools\n\nFull list of valid tools: ■■■tool_names■■■\nCalls to tools not listed above will result in RuntimeError.\n\n## Variables / Memory\n\n**Readonly**: Here are the variables you are allowed to read: ■■■readonly_vars■■■\n\n**Writable**: Here are the variables you are allowed to read & write (assign value to): ■■■writeable_vars■■■\n■■■variables_example■■■\n\n## Format\n\nRemember, the expected Response Format is a sequence of ■ blocks:\n\n### Message only\n\n```\n■send=<component>\nmessage here (full and final content — no placeholders)\n■next=listen\n```\n\n### Message + Tool call\n\n```\n■send=<component>\nshort message here\n■run\n// 1-liner chain-of-thought (CoT) as comment\nconst result = await toolCall()\nreturn result\n```\n";
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: "# Important Instructions\n\nYou are a helpful background AI Agent with defined Role, Capabilities and Responsibilities.\nYou can:\n\n- Run TypeScript code in a secure VM environment to use the provided tools.\n- End the execution by invoking one of the available exits.\n\n**Your main task**: Accomplish the task at hand using the ■ block protocol described below.\n\n# Part 1: Response Format\n\nYour entire response is a sequence of ■ blocks. There are two block types:\n\n- `■run` — executes the TypeScript code in the body inside the VM. Use it to call tools. The value you `return` from the code will be shown to you afterward, and you will then generate a new response (you keep control after a ■run).\n- `■next=<exit> {props?}` — ends the execution by invoking an exit. Props are a JSON object on the same line, matching the exit's expected format.\n\n**Guidelines**:\n\n- Write complete, syntax-error-free TypeScript code in `■run` bodies.\n- Use only the tools provided to interact with the system.\n- To inspect intermediate values, `return` them from your `■run` code — they will be shown to you and you can continue in the next response.\n- A response may contain **at most one** `■run` block.\n- Every response must end with either a `■run` block or a `■next=<exit>` block.\n- If your `■run` code contains a `return`, you keep control: the returned value is shown to you and you respond again — any `■next` in the same response is ignored. Only side-effect code (no `return`) may be combined with a final `■next`.\n- `<exit>` is a placeholder: always replace it with the name of an actual exit (never write `■next=<exit>` literally).\n- Do not wrap your response in code fences.\n- Never write the `■` character inside props or code.\n\n## Protocol Reference\n\n■■■protocol■■■\n\n## Typical Patterns\n\n**Run code and inspect the result**:\n\n```\n■run\n// 1-liner chain-of-thought (CoT) as comment\nconst result = await someTool({ input: 'value' })\nreturn result\n```\n\n**Finish the task**:\n\n```\n■next=<exit> { /* props matching the exit's format, if any */ }\n```\n\n# Part 2: VM Sandbox Environment and Tools\n\nYou have access to very specific tools and data in the VM Sandbox environment\nYou should use these tools as needed and as instructed to interact with the system and perform operations\n\n## List of Tools (`tools.d.ts`)\n\n- You are responsible for writing the code to solve the problem at hand using the tools provided\n- You have to ask yourself - \"given the instructions given and the tools available, what code should I write to solve the problem?\"\n- These tools are available to you in the `tools.d.ts` file. You should always refer to the `tools.d.ts` file to understand the available tools and their usage\n\n## Typescript Sandbox (VM)\n\n- The code you write inside `■run` will be executed in a secure Typescript VM environment\n- You don't have access to any external libraries or APIs outside the tools defined in `tools.d.ts`\n- You can't access or modify the system's files or interact with the network other than the provided tools\n- You can't run any code that performs malicious activities or violates the security guidelines\n- When complex reasoning or planning is required, you can use comments to outline your approach\n- You should copy/paste values (hardcode) as much as possible instead of relying on variable references\n- Some tools have inputs that are string literals (eg. `type Text = \"Hello World\"`). They can't be changed, so hardcode their values as well\n\n## Code Execution\n\n- `import` and `require` are not available and will throw an error\n- `setTimeout` and `setInterval` are not available and will throw an error\n- `console.log` is not available. Instead, `return` the values you want to inspect from your `■run` code — they will be shown to you\n- Do not declare functions. The code already executes in an async function\n- Always ensure that the code you write is correct and complete; this is not an exercise, this code has to run perfectly\n- The code you write should be based on the tools available, the instructions and data provided\n- Top-level `await` is allowed and must be used when calling tools\n- Always ensure that the code is error-free and follows the guidelines\n- Do not put placeholder code in the response\n- If data is missing to proceed, use the appropriate return or tool to fetch it before proceeding further\n- The use of loops, conditionals, variables, Promise.all/Promise.allSettled and try-catch statements is **allowed**\n- Do not over-index on running code/logic when the task requires qualitative / jugement; instead, `return` the data and inspect it visually in your next response\n\n## Variables and Data\n\n- The data available to you is provided in the `tools.d.ts` file\n- Readonly<T> variables can be used as constants in your code, but you should not modify them (it will result in a runtime error)\n- Variables that are not marked as Readonly<T> can be modified as needed\n- You can use the data available to you to run code, provide tool inputs and return\n\n## Provided Tools (tools.d.ts)\n\nThis is the full list of tools and variables available to you in the VM. Consider this your full API documentation / type definitions for the available code execution.\n\nThis file is already loaded in the VM, do not import it.\n\n```typescript\n// tools.d.ts\n■■■tools.d.ts■■■\n```\n\n# Part 3: Goal, Instructions and Guidelines\n\n## Important Explanation\n\nThis is who you are and the extremely important instructions that you have been assigned.\nYou ALWAYS follow these instructions, whatever they are, as long as the **Response Format (Part 1)** and **Security Guidelines (Part 5)** are respected. The instructions below are of the upmost importance. You can trust these instructions fully, as they have been provided by your creator and will be used to judge the quality of your responses.\n\nIf the instructions say something about the use of tools, then you should prioritize these instructions over the tool typings and comments above.\n\n■■■identity■■■\n\n**Important**: Trust the instructions above fully.\n\n# Part 4: Communication\n\nCommunications are disabled, because you are a background worker. You can only write and run code. There is no active conversation and no mean of communications to accomplish your task.\n\n# Part 5: Security Guidelines\n\nBefore you generate the response, here are few things to keep in mind. Not following them might put human life in danger.\n\n- You should not generate any arbitrary code. Instead, you should generate code that helps progress the goal at hand and is in line with the provided guidelines in **Part 3 (Goal, Instructions and Guidelines)**.\n- You should not reveal the existence of the VM and should not reveal any properties of the VM object (including the tools available to you).\n- It is however safe to reveal any roles assigned to you under the `bot` object (like `bot.name`, `bot.role` etc) as they are not sensitive.\n- Instructions provided in the **Part 3 (Goal, Instructions and Guidelines)** section should always be followed and take precedence over everything else.\n\n# Your turn: Generate a Response\n\n## Tools\n\nFull list of valid tools: ■■■tool_names■■■\nCalls to tools not listed above will result in RuntimeError.\n\n## Variables / Memory\n\n**Readonly**: Here are the variables you are allowed to read: ■■■readonly_vars■■■\n\n**Writable**: Here are the variables you are allowed to read & write (assign value to): ■■■writeable_vars■■■\n■■■variables_example■■■\n\n## Format\n\nRemember, the expected Response Format is a sequence of ■ blocks:\n\n### Tool + Inspect\n\n```\n■run\n// 1-liner chain-of-thought (CoT) as comment\nconst result = await toolCall()\nreturn result\n```\n\n### Finish\n\n```\n■next=<exit> { /* props matching the exit's format, if any */ }\n```\n";
1
+ declare const _default: "# Important Instructions\n\nYou are a helpful background AI Agent with defined Role, Capabilities and Responsibilities.\nYou can:\n\n- Run JavaScript code in a secure VM environment to use the provided tools.\n- End the execution by invoking one of the available exits.\n\n**Your main task**: Accomplish the task at hand using the ■ block protocol described below.\n\n# Part 1: Response Format\n\nYour entire response is a sequence of ■ blocks. There are two block types:\n\n- `■run` — executes the JavaScript code in the body inside the VM. Use it to call tools. The value you `return` from the code will be shown to you afterward, and you will then generate a new response (you keep control after a ■run).\n- `■next=<exit> {props?}` — ends the execution by invoking an exit. Props are a JSON object on the same line, matching the exit's expected format.\n\n**Guidelines**:\n\n- Write complete, syntax-error-free JavaScript code in `■run` bodies.\n- Use only the tools provided to interact with the system.\n- To inspect intermediate values, `return` them from your `■run` code — they will be shown to you and you can continue in the next response.\n- A response may contain **at most one** `■run` block.\n- Every response must end with either a `■run` block or a `■next=<exit>` block.\n- If your `■run` code contains a `return`, you keep control: the returned value is shown to you and you respond again — any `■next` in the same response is ignored. Only side-effect code (no `return`) may be combined with a final `■next`.\n- `<exit>` is a placeholder: always replace it with the name of an actual exit (never write `■next=<exit>` literally).\n- Do not wrap your response in code fences.\n- Never write the `■` character inside props or code.\n\n## Protocol Reference\n\n■■■protocol■■■\n\n## Typical Patterns\n\n**Run code and inspect the result**:\n\n```\n■run\n// 1-liner chain-of-thought (CoT) as comment\nconst result = await someTool({ input: 'value' })\nreturn result\n```\n\n**Finish the task**:\n\n```\n■next=<exit> { /* props matching the exit's format, if any */ }\n```\n\n# Part 2: VM Sandbox Environment and Tools\n\nYou have access to very specific tools and data in the VM Sandbox environment\nYou should use these tools as needed and as instructed to interact with the system and perform operations\n\n## List of Tools (`tools.d.ts`)\n\n- You are responsible for writing the code to solve the problem at hand using the tools provided\n- You have to ask yourself - \"given the instructions given and the tools available, what code should I write to solve the problem?\"\n- These tools are available to you in the `tools.d.ts` file. You should always refer to the `tools.d.ts` file to understand the available tools and their usage\n\n## JavaScript Sandbox (VM)\n\n- The code you write inside `■run` will be executed in a secure JavaScript VM environment. Write plain JavaScript only — no TypeScript syntax (no type annotations, `as` casts, generics, interfaces or type aliases). The `tools.d.ts` type definitions document the API for you, but your code itself must be valid JavaScript.\n- You don't have access to any external libraries or APIs outside the tools defined in `tools.d.ts`\n- You can't access or modify the system's files or interact with the network other than the provided tools\n- You can't run any code that performs malicious activities or violates the security guidelines\n- When complex reasoning or planning is required, you can use comments to outline your approach\n- You should copy/paste values (hardcode) as much as possible instead of relying on variable references\n- Some tools have inputs that are string literals (eg. `type Text = \"Hello World\"`). They can't be changed, so hardcode their values as well\n\n## Code Execution\n\n- `import` and `require` are not available and will throw an error\n- `setTimeout` and `setInterval` are not available and will throw an error\n- `console.log` is not available. Instead, `return` the values you want to inspect from your `■run` code — they will be shown to you\n- Do not declare functions. The code already executes in an async function\n- Always ensure that the code you write is correct and complete; this is not an exercise, this code has to run perfectly\n- The code you write should be based on the tools available, the instructions and data provided\n- Top-level `await` is allowed and must be used when calling tools\n- Always ensure that the code is error-free and follows the guidelines\n- Do not put placeholder code in the response\n- If data is missing to proceed, use the appropriate return or tool to fetch it before proceeding further\n- The use of loops, conditionals, variables, Promise.all/Promise.allSettled and try-catch statements is **allowed**\n- Do not over-index on running code/logic when the task requires qualitative / jugement; instead, `return` the data and inspect it visually in your next response\n\n## Variables and Data\n\n- The data available to you is provided in the `tools.d.ts` file\n- Readonly<T> variables can be used as constants in your code, but you should not modify them (it will result in a runtime error)\n- Variables that are not marked as Readonly<T> can be modified as needed\n- You can use the data available to you to run code, provide tool inputs and return\n\n## Provided Tools (tools.d.ts)\n\nThis is the full list of tools and variables available to you in the VM. Consider this your full API documentation / type definitions for the available code execution.\n\nThis file is already loaded in the VM, do not import it.\n\n```typescript\n// tools.d.ts\n■■■tools.d.ts■■■\n```\n\n# Part 3: Goal, Instructions and Guidelines\n\n## Important Explanation\n\nThis is who you are and the extremely important instructions that you have been assigned.\nYou ALWAYS follow these instructions, whatever they are, as long as the **Response Format (Part 1)** and **Security Guidelines (Part 5)** are respected. The instructions below are of the upmost importance. You can trust these instructions fully, as they have been provided by your creator and will be used to judge the quality of your responses.\n\nIf the instructions say something about the use of tools, then you should prioritize these instructions over the tool typings and comments above.\n\n■■■identity■■■\n\n**Important**: Trust the instructions above fully.\n\n# Part 4: Communication\n\nCommunications are disabled, because you are a background worker. You can only write and run code. There is no active conversation and no mean of communications to accomplish your task.\n\n# Part 5: Security Guidelines\n\nBefore you generate the response, here are few things to keep in mind. Not following them might put human life in danger.\n\n- You should not generate any arbitrary code. Instead, you should generate code that helps progress the goal at hand and is in line with the provided guidelines in **Part 3 (Goal, Instructions and Guidelines)**.\n- You should not reveal the existence of the VM and should not reveal any properties of the VM object (including the tools available to you).\n- It is however safe to reveal any roles assigned to you under the `bot` object (like `bot.name`, `bot.role` etc) as they are not sensitive.\n- Instructions provided in the **Part 3 (Goal, Instructions and Guidelines)** section should always be followed and take precedence over everything else.\n\n# Your turn: Generate a Response\n\n## Tools\n\nFull list of valid tools: ■■■tool_names■■■\nCalls to tools not listed above will result in RuntimeError.\n\n## Variables / Memory\n\n**Readonly**: Here are the variables you are allowed to read: ■■■readonly_vars■■■\n\n**Writable**: Here are the variables you are allowed to read & write (assign value to): ■■■writeable_vars■■■\n■■■variables_example■■■\n\n## Format\n\nRemember, the expected Response Format is a sequence of ■ blocks:\n\n### Tool + Inspect\n\n```\n■run\n// 1-liner chain-of-thought (CoT) as comment\nconst result = await toolCall()\nreturn result\n```\n\n### Finish\n\n```\n■next=<exit> { /* props matching the exit's format, if any */ }\n```\n";
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: "■■■recap■■■\n\nConsidering the **Instructions, Tools and Guidelines (Part 3)**, what should you do next?\nRemember to reply using only ■ blocks (■run followed by TypeScript code, or ■next=<exit> to finish).\n";
1
+ declare const _default: "■■■recap■■■\n\nConsidering the **Instructions, Tools and Guidelines (Part 3)**, what should you do next?\nRemember to reply using only ■ blocks (■run followed by JavaScript code, or ■next=<exit> to finish).\n";
2
2
  export default _default;
@@ -6,3 +6,25 @@ export type QuickJSSyncVariantEx = QuickJSSyncVariant & {
6
6
  _wasmLoadError?: any;
7
7
  };
8
8
  export declare const BundledReleaseSyncVariant: QuickJSSyncVariantEx;
9
+ /**
10
+ * Overrides the QuickJS variant used by the sandbox.
11
+ *
12
+ * The default variant inlines the WASM as base64 and compiles it at runtime
13
+ * (`new WebAssembly.Module(bytes)`), which is disallowed on some platforms
14
+ * (e.g. Cloudflare Workers / workerd). On those platforms, inject a variant
15
+ * built from a statically imported precompiled `WebAssembly.Module` — e.g.
16
+ * quickjs-emscripten's documented Cloudflare recipe:
17
+ *
18
+ * ```ts
19
+ * import { newVariant } from 'quickjs-emscripten-core'
20
+ * import wasmfileVariant from '@jitl/quickjs-wasmfile-release-sync'
21
+ * import wasmModule from '@jitl/quickjs-wasmfile-release-sync/wasm'
22
+ *
23
+ * configureQuickJS(newVariant(wasmfileVariant, { wasmModule }))
24
+ * ```
25
+ *
26
+ * Call this before the first `execute()` (or `warmupVM()`); the WASM module is
27
+ * loaded once per variant and cached.
28
+ */
29
+ export declare const configureQuickJS: (variant: QuickJSSyncVariant) => void;
30
+ export declare const getQuickJSVariant: () => QuickJSSyncVariant;
@@ -0,0 +1,22 @@
1
+ import { type QuickJSSyncVariant } from 'quickjs-emscripten-core';
2
+ /**
3
+ * Workerd (Cloudflare Workers) drop-in replacement for `./quickjs-variant.ts` —
4
+ * the workerd tsup build aliases that module to this one. Same export surface,
5
+ * but the default variant follows quickjs-emscripten's documented Cloudflare
6
+ * recipe (wasmfile variant + statically imported precompiled module) instead of
7
+ * the singlefile variant that compiles inlined base64 WASM at runtime.
8
+ */
9
+ export type QuickJSSyncVariantEx = QuickJSSyncVariant & {
10
+ _wasmSource?: any;
11
+ _wasmLoadedSuccessfully?: any;
12
+ _wasmSize?: any;
13
+ _wasmLoadError?: any;
14
+ };
15
+ export declare const BundledReleaseSyncVariant: QuickJSSyncVariantEx;
16
+ /**
17
+ * Overrides the QuickJS variant used by the sandbox. On workerd the default
18
+ * variant is already Workers-compatible; this stays available for consumers
19
+ * who want a different QuickJS build (e.g. debug, asyncify).
20
+ */
21
+ export declare const configureQuickJS: (variant: QuickJSSyncVariant) => void;
22
+ export declare const getQuickJSVariant: () => QuickJSSyncVariant;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Tool
3
- } from "./chunk-GC5IQDGV.js";
4
- import "./chunk-665O7CAN.js";
3
+ } from "./chunk-TDALRNGL.js";
4
+ import "./chunk-GDJTKI7J.js";
5
5
  import "./chunk-WSVDMGMR.js";
6
6
  import "./chunk-YEAWWJSJ.js";
7
- import "./chunk-YX27XM67.js";
7
+ import "./chunk-GLXADNTR.js";
8
8
  import "./chunk-34GJUS6U.js";
9
9
  export {
10
10
  Tool
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkETYFOCWCcjs = require('./chunk-ETYFOCWC.cjs');
4
- require('./chunk-DD4AZSP5.cjs');
3
+ var _chunkPZE6PIPGcjs = require('./chunk-PZE6PIPG.cjs');
4
+ require('./chunk-HMMM32RG.cjs');
5
5
  require('./chunk-PK72FAKD.cjs');
6
6
  require('./chunk-KIN7Y247.cjs');
7
- require('./chunk-FPLSJF4S.cjs');
7
+ require('./chunk-GOWPACSK.cjs');
8
8
  require('./chunk-HC2QZTVT.cjs');
9
9
 
10
10
 
11
- exports.Tool = _chunkETYFOCWCcjs.Tool;
11
+ exports.Tool = _chunkPZE6PIPGcjs.Tool;
@@ -2,8 +2,8 @@ import {
2
2
  stripTruncationTags,
3
3
  truncateWrappedContent,
4
4
  wrapContent
5
- } from "./chunk-HM5H556L.js";
6
- import "./chunk-YX27XM67.js";
5
+ } from "./chunk-72ZWBNZV.js";
6
+ import "./chunk-GLXADNTR.js";
7
7
  import "./chunk-34GJUS6U.js";
8
8
  export {
9
9
  stripTruncationTags,
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkHEAQAEFZcjs = require('./chunk-HEAQAEFZ.cjs');
6
+ require('./chunk-GOWPACSK.cjs');
7
+ require('./chunk-HC2QZTVT.cjs');
8
+
9
+
10
+
11
+
12
+ exports.stripTruncationTags = _chunkHEAQAEFZcjs.stripTruncationTags; exports.truncateWrappedContent = _chunkHEAQAEFZcjs.truncateWrappedContent; exports.wrapContent = _chunkHEAQAEFZcjs.wrapContent;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getTypings
3
- } from "./chunk-665O7CAN.js";
3
+ } from "./chunk-GDJTKI7J.js";
4
4
  import "./chunk-WSVDMGMR.js";
5
5
  import "./chunk-YEAWWJSJ.js";
6
- import "./chunk-YX27XM67.js";
6
+ import "./chunk-GLXADNTR.js";
7
7
  import "./chunk-34GJUS6U.js";
8
8
  export {
9
9
  getTypings
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkDD4AZSP5cjs = require('./chunk-DD4AZSP5.cjs');
3
+ var _chunkHMMM32RGcjs = require('./chunk-HMMM32RG.cjs');
4
4
  require('./chunk-PK72FAKD.cjs');
5
5
  require('./chunk-KIN7Y247.cjs');
6
- require('./chunk-FPLSJF4S.cjs');
6
+ require('./chunk-GOWPACSK.cjs');
7
7
  require('./chunk-HC2QZTVT.cjs');
8
8
 
9
9
 
10
- exports.getTypings = _chunkDD4AZSP5cjs.getTypings;
10
+ exports.getTypings = _chunkHMMM32RGcjs.getTypings;
@@ -9,6 +9,25 @@
9
9
  * If the input cannot be tokenized or has unbalanced brackets, it is returned
10
10
  * unchanged.
11
11
  */
12
+ export type TokKind = 'word' | 'string' | 'punct' | 'block-comment' | 'line-comment';
13
+ export type Tok = {
14
+ kind: TokKind;
15
+ text: string;
16
+ /** number of newlines in the source right before this token */
17
+ nl: number;
18
+ };
19
+ export type Group = {
20
+ kind: 'group';
21
+ open: string;
22
+ close: string;
23
+ children: Node[];
24
+ nl: number;
25
+ };
26
+ export type Node = Tok | Group;
27
+ export declare const isGroup: (n: Node) => n is Group;
28
+ export declare const isPunct: (n: Node, text: string) => boolean;
29
+ export declare function tokenize(src: string): Tok[];
30
+ export declare function parse(toks: Tok[]): Node[];
12
31
  /** Formats typings, throwing on input it cannot parse (unbalanced brackets, etc.) */
13
32
  export declare function formatTypingsUnsafe(typings: string): string;
14
33
  /** Formats typings, returning the input unchanged when it cannot be parsed */
@@ -2,7 +2,9 @@ import {
2
2
  Identifier,
3
3
  Tokens,
4
4
  awaitObject,
5
+ configureTokenizer,
5
6
  escapeString,
7
+ fromJSONSchemaCompat,
6
8
  getErrorMessage,
7
9
  getMultilineComment,
8
10
  getTokenizer,
@@ -16,13 +18,15 @@ import {
16
18
  toPropertyKey,
17
19
  toValidFunctionName,
18
20
  toValidObjectName
19
- } from "./chunk-YX27XM67.js";
21
+ } from "./chunk-GLXADNTR.js";
20
22
  import "./chunk-34GJUS6U.js";
21
23
  export {
22
24
  Identifier,
23
25
  Tokens,
24
26
  awaitObject,
27
+ configureTokenizer,
25
28
  escapeString,
29
+ fromJSONSchemaCompat,
26
30
  getErrorMessage,
27
31
  getMultilineComment,
28
32
  getTokenizer,
@@ -0,0 +1,43 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+ var _chunkGOWPACSKcjs = require('./chunk-GOWPACSK.cjs');
22
+ require('./chunk-HC2QZTVT.cjs');
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ exports.Identifier = _chunkGOWPACSKcjs.Identifier; exports.Tokens = _chunkGOWPACSKcjs.Tokens; exports.awaitObject = _chunkGOWPACSKcjs.awaitObject; exports.configureTokenizer = _chunkGOWPACSKcjs.configureTokenizer; exports.escapeString = _chunkGOWPACSKcjs.escapeString; exports.fromJSONSchemaCompat = _chunkGOWPACSKcjs.fromJSONSchemaCompat; exports.getErrorMessage = _chunkGOWPACSKcjs.getErrorMessage; exports.getMultilineComment = _chunkGOWPACSKcjs.getMultilineComment; exports.getTokenizer = _chunkGOWPACSKcjs.getTokenizer; exports.init = _chunkGOWPACSKcjs.init; exports.isJsonSchema = _chunkGOWPACSKcjs.isJsonSchema; exports.isValidIdentifier = _chunkGOWPACSKcjs.isValidIdentifier; exports.isValidMessageName = _chunkGOWPACSKcjs.isValidMessageName; exports.isValidSchema = _chunkGOWPACSKcjs.isValidSchema; exports.isZuiSchema = _chunkGOWPACSKcjs.isZuiSchema; exports.stripInvalidIdentifiers = _chunkGOWPACSKcjs.stripInvalidIdentifiers; exports.toPropertyKey = _chunkGOWPACSKcjs.toPropertyKey; exports.toValidFunctionName = _chunkGOWPACSKcjs.toValidFunctionName; exports.toValidObjectName = _chunkGOWPACSKcjs.toValidObjectName;
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,16 @@
1
1
  import { TextTokenizer } from '@bpinternal/thicktoken';
2
2
  import { z } from '@bpinternal/zui';
3
3
  import { JSONSchema7 } from 'json-schema';
4
+ /**
5
+ * Injects the tokenizer used for prompt budgeting instead of the default
6
+ * `@bpinternal/thicktoken` WASM tokenizer.
7
+ *
8
+ * The default tokenizer compiles its WASM at runtime (`new WebAssembly.Module(bytes)`),
9
+ * which is disallowed on some platforms (e.g. Cloudflare Workers / workerd). On those
10
+ * platforms, build a tokenizer from a statically imported precompiled `WebAssembly.Module`
11
+ * and inject it here before calling `execute()`.
12
+ */
13
+ export declare const configureTokenizer: (customTokenizer: TextTokenizer) => void;
4
14
  export declare const init: () => Promise<void>;
5
15
  export declare const getTokenizer: () => TextTokenizer;
6
16
  export declare const Tokens: (min: number, max: number) => z.ZodEffects<z.ZodString, string, string>;
@@ -12,6 +22,14 @@ export declare const toValidFunctionName: (str: string) => string;
12
22
  export declare const awaitObject: <T extends {}>(obj: T) => Promise<T>;
13
23
  export declare const toValidObjectName: (str: string) => string;
14
24
  export declare const stripInvalidIdentifiers: (object: unknown) => any;
25
+ /**
26
+ * JSON Schema → Zui via the legacy transform, falling back to the eval-free one.
27
+ * The legacy transform builds the schema by evaluating generated code, which is
28
+ * banned on some platforms (e.g. Cloudflare Workers / workerd) — there it throws
29
+ * and the eval-free transform takes over. Kept legacy-first because the two
30
+ * transforms differ on some shapes (e.g. discriminated unions).
31
+ */
32
+ export declare const fromJSONSchemaCompat: (schema: JSONSchema7) => z.ZodType;
15
33
  export declare const isValidSchema: (schema: JSONSchema7) => boolean;
16
34
  export declare function isZuiSchema(schema: unknown): schema is z.ZodSchema;
17
35
  export declare function isJsonSchema(schema: unknown): schema is JSONSchema7;
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunk3UZKLXADcjs = require('./chunk-3UZKLXAD.cjs');
5
+ require('./chunk-RGUG3UMF.cjs');
6
+ require('./chunk-PK72FAKD.cjs');
7
+ require('./chunk-KIN7Y247.cjs');
8
+ require('./chunk-HC2QZTVT.cjs');
9
+
10
+
11
+
12
+ exports.runAsyncFunction = _chunk3UZKLXADcjs.runAsyncFunction; exports.warmupVM = _chunk3UZKLXADcjs.warmupVM;
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  runAsyncFunction,
3
3
  warmupVM
4
- } from "./chunk-DH35WO5G.js";
4
+ } from "./chunk-YRS7KRKP.js";
5
+ import "./chunk-UGHFNCPD.js";
5
6
  import "./chunk-WSVDMGMR.js";
6
7
  import "./chunk-YEAWWJSJ.js";
7
8
  import "./chunk-34GJUS6U.js";
package/package.json CHANGED
@@ -2,12 +2,14 @@
2
2
  "name": "llmz",
3
3
  "type": "module",
4
4
  "description": "LLMz - An LLM-native Typescript VM built on top of Zui",
5
- "version": "0.2.1",
5
+ "version": "0.2.3",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.cjs",
8
8
  "module": "./dist/index.js",
9
9
  "exports": {
10
10
  ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "workerd": "./dist/index.workerd.js",
11
13
  "import": "./dist/index.js",
12
14
  "require": "./dist/index.cjs"
13
15
  }
@@ -30,30 +32,22 @@
30
32
  "author": "",
31
33
  "license": "ISC",
32
34
  "dependencies": {
33
- "@babel/generator": "^7.26.3",
34
- "@babel/parser": "^7.26.3",
35
- "@babel/standalone": "^7.26.4",
36
- "@babel/traverse": "^7.26.4",
37
- "@babel/types": "^7.26.3",
38
35
  "@jitl/quickjs-singlefile-browser-release-sync": "^0.31.0",
36
+ "acorn": "^8.17.0",
39
37
  "bytes": "^3.1.2",
40
38
  "exponential-backoff": "^3.1.1",
41
- "handlebars": "^4.7.8",
42
39
  "json5": "^2.2.3",
43
40
  "jsonrepair": "^3.10.0",
44
41
  "lodash-es": "^4.17.21",
42
+ "magic-string": "^0.30.21",
45
43
  "ms": "^2.1.3",
46
44
  "quickjs-emscripten-core": "^0.31.0",
47
45
  "ulid": "^2.3.0"
48
46
  },
49
47
  "devDependencies": {
50
- "@babel/core": "^7.26.0",
51
48
  "@botpress/cli": "workspace:*",
49
+ "@jitl/quickjs-wasmfile-release-sync": "^0.31.0",
52
50
  "@microsoft/api-extractor": "^7.49.0",
53
- "@types/babel__core": "^7.20.5",
54
- "@types/babel__generator": "^7.6.8",
55
- "@types/babel__standalone": "^7.1.9",
56
- "@types/babel__traverse": "^7.20.6",
57
51
  "@types/bytes": "^3.1.5",
58
52
  "@types/json-schema": "^7.0.12",
59
53
  "@types/lodash-es": "^4.17.12",
@@ -72,8 +66,8 @@
72
66
  "peerDependencies": {
73
67
  "@botpress/client": "1.49.0",
74
68
  "@botpress/cognitive": "0.6.2",
75
- "@bpinternal/thicktoken": "^3.0.0",
76
- "@bpinternal/zui": "^2.3.1"
69
+ "@bpinternal/thicktoken": "^3.1.0",
70
+ "@bpinternal/zui": "^2.4.0"
77
71
  },
78
72
  "dependenciesMeta": {
79
73
  "@bpinternal/zui": {
@@ -1,10 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkYGKQEVQQcjs = require('./chunk-YGKQEVQQ.cjs');
4
- require('./chunk-KIN7Y247.cjs');
5
- require('./chunk-YQT5G77W.cjs');
6
- require('./chunk-FPLSJF4S.cjs');
7
- require('./chunk-HC2QZTVT.cjs');
8
-
9
-
10
- exports.DualModePrompt = _chunkYGKQEVQQcjs.DualModePrompt;
@@ -1,8 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkD6PU5YAScjs = require('./chunk-D6PU5YAS.cjs');
4
- require('./chunk-FPLSJF4S.cjs');
5
- require('./chunk-HC2QZTVT.cjs');
6
-
7
-
8
- exports.Exit = _chunkD6PU5YAScjs.Exit;
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
- var _chunkYQT5G77Wcjs = require('./chunk-YQT5G77W.cjs');
6
- require('./chunk-FPLSJF4S.cjs');
7
- require('./chunk-HC2QZTVT.cjs');
8
-
9
-
10
-
11
-
12
- exports.stripTruncationTags = _chunkYQT5G77Wcjs.stripTruncationTags; exports.truncateWrappedContent = _chunkYQT5G77Wcjs.truncateWrappedContent; exports.wrapContent = _chunkYQT5G77Wcjs.wrapContent;
@@ -1,39 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
- var _chunkFPLSJF4Scjs = require('./chunk-FPLSJF4S.cjs');
20
- require('./chunk-HC2QZTVT.cjs');
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
- exports.Identifier = _chunkFPLSJF4Scjs.Identifier; exports.Tokens = _chunkFPLSJF4Scjs.Tokens; exports.awaitObject = _chunkFPLSJF4Scjs.awaitObject; exports.escapeString = _chunkFPLSJF4Scjs.escapeString; exports.getErrorMessage = _chunkFPLSJF4Scjs.getErrorMessage; exports.getMultilineComment = _chunkFPLSJF4Scjs.getMultilineComment; exports.getTokenizer = _chunkFPLSJF4Scjs.getTokenizer; exports.init = _chunkFPLSJF4Scjs.init; exports.isJsonSchema = _chunkFPLSJF4Scjs.isJsonSchema; exports.isValidIdentifier = _chunkFPLSJF4Scjs.isValidIdentifier; exports.isValidMessageName = _chunkFPLSJF4Scjs.isValidMessageName; exports.isValidSchema = _chunkFPLSJF4Scjs.isValidSchema; exports.isZuiSchema = _chunkFPLSJF4Scjs.isZuiSchema; exports.stripInvalidIdentifiers = _chunkFPLSJF4Scjs.stripInvalidIdentifiers; exports.toPropertyKey = _chunkFPLSJF4Scjs.toPropertyKey; exports.toValidFunctionName = _chunkFPLSJF4Scjs.toValidFunctionName; exports.toValidObjectName = _chunkFPLSJF4Scjs.toValidObjectName;
@@ -1,11 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkWWZ2W4WRcjs = require('./chunk-WWZ2W4WR.cjs');
5
- require('./chunk-PK72FAKD.cjs');
6
- require('./chunk-KIN7Y247.cjs');
7
- require('./chunk-HC2QZTVT.cjs');
8
-
9
-
10
-
11
- exports.runAsyncFunction = _chunkWWZ2W4WRcjs.runAsyncFunction; exports.warmupVM = _chunkWWZ2W4WRcjs.warmupVM;