@execbox/core 0.4.1 → 0.5.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.
Files changed (60) hide show
  1. package/README.md +5 -0
  2. package/dist/errors-B9ADBuDH.d.cts +29 -0
  3. package/dist/errors-B9ADBuDH.d.cts.map +1 -0
  4. package/dist/errors-DlbJQYs7.d.ts +29 -0
  5. package/dist/errors-DlbJQYs7.d.ts.map +1 -0
  6. package/dist/{errors-BXpyBhCI.js → errors-wS8yjQhS.js} +1 -1
  7. package/dist/{errors-BXpyBhCI.js.map → errors-wS8yjQhS.js.map} +1 -1
  8. package/dist/{errors-BGSgVV40.cjs → errors-xD8r6fCf.cjs} +1 -1
  9. package/dist/{errors-BGSgVV40.cjs.map → errors-xD8r6fCf.cjs.map} +1 -1
  10. package/dist/{executor-_CO7E1U7.d.ts → executor-B7q7K_27.d.ts} +2 -2
  11. package/dist/{executor-_CO7E1U7.d.ts.map → executor-B7q7K_27.d.ts.map} +1 -1
  12. package/dist/{executor-CEXp0gYP.d.cts → executor-BsE5nF-j.d.cts} +1 -1
  13. package/dist/{executor-CEXp0gYP.d.cts.map → executor-BsE5nF-j.d.cts.map} +1 -1
  14. package/dist/index.cjs +3 -16
  15. package/dist/index.d.cts +4 -4
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +3 -5
  18. package/dist/mcp/index.cjs +2 -2
  19. package/dist/mcp/index.d.cts +1 -1
  20. package/dist/mcp/index.d.cts.map +1 -1
  21. package/dist/mcp/index.d.ts +2 -2
  22. package/dist/mcp/index.js +2 -2
  23. package/dist/protocol/index.cjs +2 -2
  24. package/dist/protocol/index.d.ts +1 -1
  25. package/dist/protocol/index.js +2 -2
  26. package/dist/{resolveProvider-DfcSnwnp.cjs → resolveProvider-BZYSw8Qk.cjs} +2 -2
  27. package/dist/{resolveProvider-DfcSnwnp.cjs.map → resolveProvider-BZYSw8Qk.cjs.map} +1 -1
  28. package/dist/{resolveProvider-BHuwOGBm.js → resolveProvider-UqQxdF4j.js} +2 -2
  29. package/dist/{resolveProvider-BHuwOGBm.js.map → resolveProvider-UqQxdF4j.js.map} +1 -1
  30. package/dist/{runner-nUCF59Au.js → runner-6GMM-5ur.js} +2 -2
  31. package/dist/{runner-nUCF59Au.js.map → runner-6GMM-5ur.js.map} +1 -1
  32. package/dist/{runner-FSGSGEpx.d.ts → runner-ClFrFnz9.d.ts} +1 -1
  33. package/dist/{runner-FSGSGEpx.d.ts.map → runner-ClFrFnz9.d.ts.map} +1 -1
  34. package/dist/{runner-BxbJ5eWb.cjs → runner-CsrfDub-.cjs} +2 -2
  35. package/dist/{runner-BxbJ5eWb.cjs.map → runner-CsrfDub-.cjs.map} +1 -1
  36. package/dist/runtime.cjs +90 -0
  37. package/dist/runtime.cjs.map +1 -0
  38. package/dist/runtime.d.cts +65 -0
  39. package/dist/runtime.d.cts.map +1 -0
  40. package/dist/runtime.d.ts +65 -0
  41. package/dist/runtime.d.ts.map +1 -0
  42. package/dist/runtime.js +74 -0
  43. package/dist/runtime.js.map +1 -0
  44. package/package.json +7 -7
  45. package/dist/_internal/index.cjs +0 -45
  46. package/dist/_internal/index.cjs.map +0 -1
  47. package/dist/_internal/index.d.cts +0 -21
  48. package/dist/_internal/index.d.cts.map +0 -1
  49. package/dist/_internal/index.d.ts +0 -22
  50. package/dist/_internal/index.d.ts.map +0 -1
  51. package/dist/_internal/index.js +0 -30
  52. package/dist/_internal/index.js.map +0 -1
  53. package/dist/errors-B3IY3ID-.d.cts +0 -69
  54. package/dist/errors-B3IY3ID-.d.cts.map +0 -1
  55. package/dist/errors-BbUru7ko.d.ts +0 -69
  56. package/dist/errors-BbUru7ko.d.ts.map +0 -1
  57. package/dist/normalize-B80ZCnxe.cjs +0 -54
  58. package/dist/normalize-B80ZCnxe.cjs.map +0 -1
  59. package/dist/normalize-dfQC7HWx.js +0 -48
  60. package/dist/normalize-dfQC7HWx.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"runner-nUCF59Au.js","names":["truncated: string[]"],"sources":["../src/executor/shared.ts","../src/runner.ts"],"sourcesContent":["import type {\n ExecuteError,\n ExecuteErrorCode,\n ExecuteResult,\n ToolExecutionContext,\n} from \"../types\";\n\nconst EXECUTION_TIMEOUT_MESSAGE = \"Execution timed out\";\n\n/**\n * Canonical error codes that may safely cross trusted executor boundaries.\n */\nconst KNOWN_EXECUTE_ERROR_CODES = new Set<ExecuteErrorCode>([\n \"timeout\",\n \"memory_limit\",\n \"validation_error\",\n \"tool_error\",\n \"runtime_error\",\n \"serialization_error\",\n \"internal_error\",\n]);\n\n/**\n * Returns whether the value is one of execbox's stable execution error codes.\n */\nexport function isKnownExecuteErrorCode(\n value: unknown,\n): value is ExecuteErrorCode {\n return KNOWN_EXECUTE_ERROR_CODES.has(value as ExecuteErrorCode);\n}\n\n/**\n * Returns the stable timeout message used across executor implementations.\n */\nexport function getExecutionTimeoutMessage(): string {\n return EXECUTION_TIMEOUT_MESSAGE;\n}\n\n/**\n * Creates the canonical timeout failure result used for preflight cancellation.\n */\nexport function createTimeoutExecuteResult(durationMs = 0): ExecuteResult {\n return {\n durationMs,\n error: {\n code: \"timeout\",\n message: getExecutionTimeoutMessage(),\n } satisfies ExecuteError,\n logs: [],\n ok: false,\n };\n}\n\n/**\n * Normalizes an unknown thrown value into a human-readable message.\n */\nexport function normalizeThrownMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n\n if (typeof error === \"object\" && error !== null && \"message\" in error) {\n const message = (error as { message?: unknown }).message;\n if (typeof message === \"string\") {\n return message;\n }\n }\n\n return String(error);\n}\n\n/**\n * Returns the thrown error name when one is available.\n */\nexport function normalizeThrownName(error: unknown): string | undefined {\n if (error instanceof Error) {\n return error.name;\n }\n\n if (typeof error === \"object\" && error !== null && \"name\" in error) {\n const name = (error as { name?: unknown }).name;\n if (typeof name === \"string\") {\n return name;\n }\n }\n\n return undefined;\n}\n\n/**\n * Builds the standard tool execution context passed to resolved tool wrappers.\n */\nexport function createExecutionContext(\n signal: AbortSignal,\n providerName: string,\n safeToolName: string,\n originalToolName: string,\n): ToolExecutionContext {\n return {\n originalToolName,\n providerName,\n safeToolName,\n signal,\n };\n}\n\n/**\n * Truncates captured logs to the configured line and character limits.\n */\nexport function truncateLogs(\n logs: string[],\n maxLogLines: number,\n maxLogChars: number,\n): string[] {\n const limitedLines = logs.slice(0, maxLogLines);\n let remainingChars = maxLogChars;\n const truncated: string[] = [];\n\n for (const line of limitedLines) {\n if (remainingChars <= 0) {\n break;\n }\n\n if (line.length <= remainingChars) {\n truncated.push(line);\n remainingChars -= line.length;\n continue;\n }\n\n truncated.push(line.slice(0, remainingChars));\n break;\n }\n\n return truncated;\n}\n\nfunction formatLogValue(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n\n if (value === undefined) {\n return \"undefined\";\n }\n\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\n/**\n * Formats guest console arguments into a single host-side log line.\n */\nexport function formatConsoleLine(values: unknown[]): string {\n return values.map((value) => formatLogValue(value)).join(\" \");\n}\n","import {\n createExecutionContext,\n getExecutionTimeoutMessage,\n normalizeThrownMessage,\n} from \"./executor/shared.ts\";\nimport {\n ExecuteFailure,\n isExecuteFailure,\n isJsonSerializable,\n} from \"./errors.ts\";\nimport type { ExecuteError, ResolvedToolProvider } from \"./types.ts\";\n\n/**\n * Transport-safe metadata for one exposed tool.\n */\nexport interface ProviderToolManifest {\n description?: string;\n originalName: string;\n safeName: string;\n}\n\n/**\n * Namespace manifest shared with runner implementations.\n */\nexport interface ProviderManifest {\n name: string;\n tools: Record<string, ProviderToolManifest>;\n types: string;\n}\n\n/**\n * Execution limits forwarded to runner implementations.\n */\nexport interface ExecutorRuntimeOptions {\n maxLogChars?: number;\n maxLogLines?: number;\n memoryLimitBytes?: number;\n timeoutMs?: number;\n}\n\n/**\n * Public execution options accepted by executors per call.\n */\nexport interface ExecutionOptions extends ExecutorRuntimeOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Tool invocation request emitted from a runner.\n */\nexport interface ToolCall {\n input: unknown;\n providerName: string;\n safeToolName: string;\n}\n\n/**\n * Trusted host response to a tool invocation request.\n */\nexport type ToolCallResult =\n | {\n ok: true;\n result: unknown;\n }\n | {\n error: ExecuteError;\n ok: false;\n };\n\nfunction toTrustedExecuteError(error: unknown): ExecuteError {\n if (isExecuteFailure(error)) {\n return {\n code: error.code,\n message: error.message,\n };\n }\n\n return {\n code: \"tool_error\",\n message: normalizeThrownMessage(error),\n };\n}\n\n/**\n * Converts resolved providers into manifest metadata that reveals only namespace details.\n */\nexport function extractProviderManifests(\n providers: ResolvedToolProvider[],\n): ProviderManifest[] {\n return providers.map((provider) => ({\n name: provider.name,\n tools: Object.fromEntries(\n Object.entries(provider.tools).map(([safeToolName, descriptor]) => [\n safeToolName,\n {\n description: descriptor.description,\n originalName: descriptor.originalName,\n safeName: descriptor.safeName,\n },\n ]),\n ),\n types: provider.types,\n }));\n}\n\n/**\n * Creates a host-side dispatcher for runner-emitted tool calls.\n */\nexport function createToolCallDispatcher(\n providers: ResolvedToolProvider[],\n signal: AbortSignal,\n): (call: ToolCall) => Promise<ToolCallResult> {\n const providerMap = new Map(\n providers.map((provider) => [provider.name, provider] as const),\n );\n\n return async (call) => {\n const provider = providerMap.get(call.providerName);\n const descriptor = provider?.tools[call.safeToolName];\n\n if (!provider || !descriptor) {\n return {\n error: {\n code: \"internal_error\",\n message: `Unknown tool ${call.providerName}.${call.safeToolName}`,\n },\n ok: false,\n };\n }\n\n try {\n if (signal.aborted) {\n return {\n error: {\n code: \"timeout\",\n message: getExecutionTimeoutMessage(),\n },\n ok: false,\n };\n }\n\n const result = await descriptor.execute(\n call.input,\n createExecutionContext(\n signal,\n provider.name,\n descriptor.safeName,\n descriptor.originalName,\n ),\n );\n\n if (result !== undefined && !isJsonSerializable(result)) {\n throw new ExecuteFailure(\n \"serialization_error\",\n \"Host value is not JSON-serializable\",\n );\n }\n\n return {\n ok: true,\n result,\n };\n } catch (error) {\n return {\n error: toTrustedExecuteError(error),\n ok: false,\n };\n }\n };\n}\n"],"mappings":";;;AAOA,MAAM,4BAA4B;;;;AAKlC,MAAM,4BAA4B,IAAI,IAAsB;CAC1D;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;AAKF,SAAgB,wBACd,OAC2B;AAC3B,QAAO,0BAA0B,IAAI,MAA0B;;;;;AAMjE,SAAgB,6BAAqC;AACnD,QAAO;;;;;AAMT,SAAgB,2BAA2B,aAAa,GAAkB;AACxE,QAAO;EACL;EACA,OAAO;GACL,MAAM;GACN,SAAS,4BAA4B;GACtC;EACD,MAAM,EAAE;EACR,IAAI;EACL;;;;;AAMH,SAAgB,uBAAuB,OAAwB;AAC7D,KAAI,iBAAiB,MACnB,QAAO,MAAM;AAGf,KAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,OAAO;EACrE,MAAM,UAAW,MAAgC;AACjD,MAAI,OAAO,YAAY,SACrB,QAAO;;AAIX,QAAO,OAAO,MAAM;;;;;AAMtB,SAAgB,oBAAoB,OAAoC;AACtE,KAAI,iBAAiB,MACnB,QAAO,MAAM;AAGf,KAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU,OAAO;EAClE,MAAM,OAAQ,MAA6B;AAC3C,MAAI,OAAO,SAAS,SAClB,QAAO;;;;;;AAUb,SAAgB,uBACd,QACA,cACA,cACA,kBACsB;AACtB,QAAO;EACL;EACA;EACA;EACA;EACD;;;;;AAMH,SAAgB,aACd,MACA,aACA,aACU;CACV,MAAM,eAAe,KAAK,MAAM,GAAG,YAAY;CAC/C,IAAI,iBAAiB;CACrB,MAAMA,YAAsB,EAAE;AAE9B,MAAK,MAAM,QAAQ,cAAc;AAC/B,MAAI,kBAAkB,EACpB;AAGF,MAAI,KAAK,UAAU,gBAAgB;AACjC,aAAU,KAAK,KAAK;AACpB,qBAAkB,KAAK;AACvB;;AAGF,YAAU,KAAK,KAAK,MAAM,GAAG,eAAe,CAAC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uBACE,QACA,SAAS,MACT,WAAW,UACX,WAAW,aACZ,CACF;AAED,OAAI,WAAW,UAAa,CAAC,mBAAmB,OAAO,CACrD,OAAM,IAAI,eACR,uBACA,sCACD;AAGH,UAAO;IACL,IAAI;IACJ;IACD;WACM,OAAO;AACd,UAAO;IACL,OAAO,sBAAsB,MAAM;IACnC,IAAI;IACL"}
1
+ {"version":3,"file":"runner-6GMM-5ur.js","names":["truncated: string[]"],"sources":["../src/executor/shared.ts","../src/runner.ts"],"sourcesContent":["import type {\n ExecuteError,\n ExecuteErrorCode,\n ExecuteResult,\n ToolExecutionContext,\n} from \"../types\";\n\nconst EXECUTION_TIMEOUT_MESSAGE = \"Execution timed out\";\n\n/**\n * Canonical error codes that may safely cross trusted executor boundaries.\n */\nconst KNOWN_EXECUTE_ERROR_CODES = new Set<ExecuteErrorCode>([\n \"timeout\",\n \"memory_limit\",\n \"validation_error\",\n \"tool_error\",\n \"runtime_error\",\n \"serialization_error\",\n \"internal_error\",\n]);\n\n/**\n * Returns whether the value is one of execbox's stable execution error codes.\n */\nexport function isKnownExecuteErrorCode(\n value: unknown,\n): value is ExecuteErrorCode {\n return KNOWN_EXECUTE_ERROR_CODES.has(value as ExecuteErrorCode);\n}\n\n/**\n * Returns the stable timeout message used across executor implementations.\n */\nexport function getExecutionTimeoutMessage(): string {\n return EXECUTION_TIMEOUT_MESSAGE;\n}\n\n/**\n * Creates the canonical timeout failure result used for preflight cancellation.\n */\nexport function createTimeoutExecuteResult(durationMs = 0): ExecuteResult {\n return {\n durationMs,\n error: {\n code: \"timeout\",\n message: getExecutionTimeoutMessage(),\n } satisfies ExecuteError,\n logs: [],\n ok: false,\n };\n}\n\n/**\n * Normalizes an unknown thrown value into a human-readable message.\n */\nexport function normalizeThrownMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n\n if (typeof error === \"object\" && error !== null && \"message\" in error) {\n const message = (error as { message?: unknown }).message;\n if (typeof message === \"string\") {\n return message;\n }\n }\n\n return String(error);\n}\n\n/**\n * Returns the thrown error name when one is available.\n */\nexport function normalizeThrownName(error: unknown): string | undefined {\n if (error instanceof Error) {\n return error.name;\n }\n\n if (typeof error === \"object\" && error !== null && \"name\" in error) {\n const name = (error as { name?: unknown }).name;\n if (typeof name === \"string\") {\n return name;\n }\n }\n\n return undefined;\n}\n\n/**\n * Builds the standard tool execution context passed to resolved tool wrappers.\n */\nexport function createExecutionContext(\n signal: AbortSignal,\n providerName: string,\n safeToolName: string,\n originalToolName: string,\n): ToolExecutionContext {\n return {\n originalToolName,\n providerName,\n safeToolName,\n signal,\n };\n}\n\n/**\n * Truncates captured logs to the configured line and character limits.\n */\nexport function truncateLogs(\n logs: string[],\n maxLogLines: number,\n maxLogChars: number,\n): string[] {\n const limitedLines = logs.slice(0, maxLogLines);\n let remainingChars = maxLogChars;\n const truncated: string[] = [];\n\n for (const line of limitedLines) {\n if (remainingChars <= 0) {\n break;\n }\n\n if (line.length <= remainingChars) {\n truncated.push(line);\n remainingChars -= line.length;\n continue;\n }\n\n truncated.push(line.slice(0, remainingChars));\n break;\n }\n\n return truncated;\n}\n\nfunction formatLogValue(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n\n if (value === undefined) {\n return \"undefined\";\n }\n\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\n/**\n * Formats guest console arguments into a single host-side log line.\n */\nexport function formatConsoleLine(values: unknown[]): string {\n return values.map((value) => formatLogValue(value)).join(\" \");\n}\n","import {\n createExecutionContext,\n getExecutionTimeoutMessage,\n normalizeThrownMessage,\n} from \"./executor/shared.ts\";\nimport {\n ExecuteFailure,\n isExecuteFailure,\n isJsonSerializable,\n} from \"./errors.ts\";\nimport type { ExecuteError, ResolvedToolProvider } from \"./types.ts\";\n\n/**\n * Transport-safe metadata for one exposed tool.\n */\nexport interface ProviderToolManifest {\n description?: string;\n originalName: string;\n safeName: string;\n}\n\n/**\n * Namespace manifest shared with runner implementations.\n */\nexport interface ProviderManifest {\n name: string;\n tools: Record<string, ProviderToolManifest>;\n types: string;\n}\n\n/**\n * Execution limits forwarded to runner implementations.\n */\nexport interface ExecutorRuntimeOptions {\n maxLogChars?: number;\n maxLogLines?: number;\n memoryLimitBytes?: number;\n timeoutMs?: number;\n}\n\n/**\n * Public execution options accepted by executors per call.\n */\nexport interface ExecutionOptions extends ExecutorRuntimeOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Tool invocation request emitted from a runner.\n */\nexport interface ToolCall {\n input: unknown;\n providerName: string;\n safeToolName: string;\n}\n\n/**\n * Trusted host response to a tool invocation request.\n */\nexport type ToolCallResult =\n | {\n ok: true;\n result: unknown;\n }\n | {\n error: ExecuteError;\n ok: false;\n };\n\nfunction toTrustedExecuteError(error: unknown): ExecuteError {\n if (isExecuteFailure(error)) {\n return {\n code: error.code,\n message: error.message,\n };\n }\n\n return {\n code: \"tool_error\",\n message: normalizeThrownMessage(error),\n };\n}\n\n/**\n * Converts resolved providers into manifest metadata that reveals only namespace details.\n */\nexport function extractProviderManifests(\n providers: ResolvedToolProvider[],\n): ProviderManifest[] {\n return providers.map((provider) => ({\n name: provider.name,\n tools: Object.fromEntries(\n Object.entries(provider.tools).map(([safeToolName, descriptor]) => [\n safeToolName,\n {\n description: descriptor.description,\n originalName: descriptor.originalName,\n safeName: descriptor.safeName,\n },\n ]),\n ),\n types: provider.types,\n }));\n}\n\n/**\n * Creates a host-side dispatcher for runner-emitted tool calls.\n */\nexport function createToolCallDispatcher(\n providers: ResolvedToolProvider[],\n signal: AbortSignal,\n): (call: ToolCall) => Promise<ToolCallResult> {\n const providerMap = new Map(\n providers.map((provider) => [provider.name, provider] as const),\n );\n\n return async (call) => {\n const provider = providerMap.get(call.providerName);\n const descriptor = provider?.tools[call.safeToolName];\n\n if (!provider || !descriptor) {\n return {\n error: {\n code: \"internal_error\",\n message: `Unknown tool ${call.providerName}.${call.safeToolName}`,\n },\n ok: false,\n };\n }\n\n try {\n if (signal.aborted) {\n return {\n error: {\n code: \"timeout\",\n message: getExecutionTimeoutMessage(),\n },\n ok: false,\n };\n }\n\n const result = await descriptor.execute(\n call.input,\n createExecutionContext(\n signal,\n provider.name,\n descriptor.safeName,\n descriptor.originalName,\n ),\n );\n\n if (result !== undefined && !isJsonSerializable(result)) {\n throw new ExecuteFailure(\n \"serialization_error\",\n \"Host value is not JSON-serializable\",\n );\n }\n\n return {\n ok: true,\n result,\n };\n } catch (error) {\n return {\n error: toTrustedExecuteError(error),\n ok: false,\n };\n }\n };\n}\n"],"mappings":";;;AAOA,MAAM,4BAA4B;;;;AAKlC,MAAM,4BAA4B,IAAI,IAAsB;CAC1D;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;AAKF,SAAgB,wBACd,OAC2B;AAC3B,QAAO,0BAA0B,IAAI,MAA0B;;;;;AAMjE,SAAgB,6BAAqC;AACnD,QAAO;;;;;AAMT,SAAgB,2BAA2B,aAAa,GAAkB;AACxE,QAAO;EACL;EACA,OAAO;GACL,MAAM;GACN,SAAS,4BAA4B;GACtC;EACD,MAAM,EAAE;EACR,IAAI;EACL;;;;;AAMH,SAAgB,uBAAuB,OAAwB;AAC7D,KAAI,iBAAiB,MACnB,QAAO,MAAM;AAGf,KAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,OAAO;EACrE,MAAM,UAAW,MAAgC;AACjD,MAAI,OAAO,YAAY,SACrB,QAAO;;AAIX,QAAO,OAAO,MAAM;;;;;AAMtB,SAAgB,oBAAoB,OAAoC;AACtE,KAAI,iBAAiB,MACnB,QAAO,MAAM;AAGf,KAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU,OAAO;EAClE,MAAM,OAAQ,MAA6B;AAC3C,MAAI,OAAO,SAAS,SAClB,QAAO;;;;;;AAUb,SAAgB,uBACd,QACA,cACA,cACA,kBACsB;AACtB,QAAO;EACL;EACA;EACA;EACA;EACD;;;;;AAMH,SAAgB,aACd,MACA,aACA,aACU;CACV,MAAM,eAAe,KAAK,MAAM,GAAG,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B,QAAO;GACL,OAAO;IACL,MAAM;IACN,SAAS,gBAAgB,KAAK,aAAa,GAAG,KAAK;IACpD;GACD,IAAI;GACL;AAGH,MAAI;AACF,OAAI,OAAO,QACT,QAAO;IACL,OAAO;KACL,MAAM;KACN,SAAS,4BAA4B;KACtC;IACD,IAAI;IACL;GAGH,MAAM,SAAS,MAAM,WAAW,QAC9B,KAAK,OACL,uBACE,QACA,SAAS,MACT,WAAW,UACX,WAAW,aACZ,CACF;AAED,OAAI,WAAW,UAAa,CAAC,mBAAmB,OAAO,CACrD,OAAM,IAAI,eACR,uBACA,sCACD;AAGH,UAAO;IACL,IAAI;IACJ;IACD;WACM,OAAO;AACd,UAAO;IACL,OAAO,sBAAsB,MAAM;IACnC,IAAI;IACL"}
@@ -175,4 +175,4 @@ declare function extractProviderManifests(providers: ResolvedToolProvider[]): Pr
175
175
  declare function createToolCallDispatcher(providers: ResolvedToolProvider[], signal: AbortSignal): (call: ToolCall) => Promise<ToolCallResult>;
176
176
  //#endregion
177
177
  export { ToolProvider as _, ToolCall as a, extractProviderManifests as c, ExecuteResult as d, JsonSchema as f, ToolExecutionContext as g, ToolDescriptor as h, ProviderToolManifest as i, ExecuteError as l, ResolvedToolProvider as m, ExecutorRuntimeOptions as n, ToolCallResult as o, ResolvedToolDescriptor as p, ProviderManifest as r, createToolCallDispatcher as s, ExecutionOptions as t, ExecuteErrorCode as u, ToolSchema as v, TypegenToolDescriptor as y };
178
- //# sourceMappingURL=runner-FSGSGEpx.d.ts.map
178
+ //# sourceMappingURL=runner-ClFrFnz9.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runner-FSGSGEpx.d.ts","names":[],"sources":["../src/types.ts","../src/runner.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAKA,CAAA,CAAA;AAKY,IAAA,CALA,UAAA,CAAA,CAAA,CAAa,MAKH,CAAA,MAAA,CAAA,CAAA,OAAA,CAAA;;;;AAAwC,IAAA,CAAlD,UAAA,CAAA,CAAA,C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A,CAMC,YANa;EA2BV,EAAA,CAAA,CAAA,KAAA;AAsBhB,CAAA;;;;AAG+B,OAAA,CAAA,QAAA,CAzBf,wBAAA,CAyBe,SAAA,CAAA,CAxBlB,oBAwBkB,CAAA,CAAA,CAAA,CAAA,CAvB5B,gBAuB4B,CAAA,CAAA;;;;iBAHf,wBAAA,YACH,gCACH,qBACA,aAAa,QAAQ"}
@@ -1,4 +1,4 @@
1
- const require_errors = require('./errors-BGSgVV40.cjs');
1
+ const require_errors = require('./errors-xD8r6fCf.cjs');
2
2
 
3
3
  //#region src/executor/shared.ts
4
4
  const EXECUTION_TIMEOUT_MESSAGE = "Execution timed out";
@@ -232,4 +232,4 @@ Object.defineProperty(exports, 'truncateLogs', {
232
232
  return truncateLogs;
233
233
  }
234
234
  });
235
- //# sourceMappingURL=runner-BxbJ5eWb.cjs.map
235
+ //# sourceMappingURL=runner-CsrfDub-.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"runner-BxbJ5eWb.cjs","names":["truncated: string[]","isExecuteFailure","isJsonSerializable","ExecuteFailure"],"sources":["../src/executor/shared.ts","../src/runner.ts"],"sourcesContent":["import type {\n ExecuteError,\n ExecuteErrorCode,\n ExecuteResult,\n ToolExecutionContext,\n} from \"../types\";\n\nconst EXECUTION_TIMEOUT_MESSAGE = \"Execution timed out\";\n\n/**\n * Canonical error codes that may safely cross trusted executor boundaries.\n */\nconst KNOWN_EXECUTE_ERROR_CODES = new Set<ExecuteErrorCode>([\n \"timeout\",\n \"memory_limit\",\n \"validation_error\",\n \"tool_error\",\n \"runtime_error\",\n \"serialization_error\",\n \"internal_error\",\n]);\n\n/**\n * Returns whether the value is one of execbox's stable execution error codes.\n */\nexport function isKnownExecuteErrorCode(\n value: unknown,\n): value is ExecuteErrorCode {\n return KNOWN_EXECUTE_ERROR_CODES.has(value as ExecuteErrorCode);\n}\n\n/**\n * Returns the stable timeout message used across executor implementations.\n */\nexport function getExecutionTimeoutMessage(): string {\n return EXECUTION_TIMEOUT_MESSAGE;\n}\n\n/**\n * Creates the canonical timeout failure result used for preflight cancellation.\n */\nexport function createTimeoutExecuteResult(durationMs = 0): ExecuteResult {\n return {\n durationMs,\n error: {\n code: \"timeout\",\n message: getExecutionTimeoutMessage(),\n } satisfies ExecuteError,\n logs: [],\n ok: false,\n };\n}\n\n/**\n * Normalizes an unknown thrown value into a human-readable message.\n */\nexport function normalizeThrownMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n\n if (typeof error === \"object\" && error !== null && \"message\" in error) {\n const message = (error as { message?: unknown }).message;\n if (typeof message === \"string\") {\n return message;\n }\n }\n\n return String(error);\n}\n\n/**\n * Returns the thrown error name when one is available.\n */\nexport function normalizeThrownName(error: unknown): string | undefined {\n if (error instanceof Error) {\n return error.name;\n }\n\n if (typeof error === \"object\" && error !== null && \"name\" in error) {\n const name = (error as { name?: unknown }).name;\n if (typeof name === \"string\") {\n return name;\n }\n }\n\n return undefined;\n}\n\n/**\n * Builds the standard tool execution context passed to resolved tool wrappers.\n */\nexport function createExecutionContext(\n signal: AbortSignal,\n providerName: string,\n safeToolName: string,\n originalToolName: string,\n): ToolExecutionContext {\n return {\n originalToolName,\n providerName,\n safeToolName,\n signal,\n };\n}\n\n/**\n * Truncates captured logs to the configured line and character limits.\n */\nexport function truncateLogs(\n logs: string[],\n maxLogLines: number,\n maxLogChars: number,\n): string[] {\n const limitedLines = logs.slice(0, maxLogLines);\n let remainingChars = maxLogChars;\n const truncated: string[] = [];\n\n for (const line of limitedLines) {\n if (remainingChars <= 0) {\n break;\n }\n\n if (line.length <= remainingChars) {\n truncated.push(line);\n remainingChars -= line.length;\n continue;\n }\n\n truncated.push(line.slice(0, remainingChars));\n break;\n }\n\n return truncated;\n}\n\nfunction formatLogValue(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n\n if (value === undefined) {\n return \"undefined\";\n }\n\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\n/**\n * Formats guest console arguments into a single host-side log line.\n */\nexport function formatConsoleLine(values: unknown[]): string {\n return values.map((value) => formatLogValue(value)).join(\" \");\n}\n","import {\n createExecutionContext,\n getExecutionTimeoutMessage,\n normalizeThrownMessage,\n} from \"./executor/shared.ts\";\nimport {\n ExecuteFailure,\n isExecuteFailure,\n isJsonSerializable,\n} from \"./errors.ts\";\nimport type { ExecuteError, ResolvedToolProvider } from \"./types.ts\";\n\n/**\n * Transport-safe metadata for one exposed tool.\n */\nexport interface ProviderToolManifest {\n description?: string;\n originalName: string;\n safeName: string;\n}\n\n/**\n * Namespace manifest shared with runner implementations.\n */\nexport interface ProviderManifest {\n name: string;\n tools: Record<string, ProviderToolManifest>;\n types: string;\n}\n\n/**\n * Execution limits forwarded to runner implementations.\n */\nexport interface ExecutorRuntimeOptions {\n maxLogChars?: number;\n maxLogLines?: number;\n memoryLimitBytes?: number;\n timeoutMs?: number;\n}\n\n/**\n * Public execution options accepted by executors per call.\n */\nexport interface ExecutionOptions extends ExecutorRuntimeOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Tool invocation request emitted from a runner.\n */\nexport interface ToolCall {\n input: unknown;\n providerName: string;\n safeToolName: string;\n}\n\n/**\n * Trusted host response to a tool invocation request.\n */\nexport type ToolCallResult =\n | {\n ok: true;\n result: unknown;\n }\n | {\n error: ExecuteError;\n ok: false;\n };\n\nfunction toTrustedExecuteError(error: unknown): ExecuteError {\n if (isExecuteFailure(error)) {\n return {\n code: error.code,\n message: error.message,\n };\n }\n\n return {\n code: \"tool_error\",\n message: normalizeThrownMessage(error),\n };\n}\n\n/**\n * Converts resolved providers into manifest metadata that reveals only namespace details.\n */\nexport function extractProviderManifests(\n providers: ResolvedToolProvider[],\n): ProviderManifest[] {\n return providers.map((provider) => ({\n name: provider.name,\n tools: Object.fromEntries(\n Object.entries(provider.tools).map(([safeToolName, descriptor]) => [\n safeToolName,\n {\n description: descriptor.description,\n originalName: descriptor.originalName,\n safeName: descriptor.safeName,\n },\n ]),\n ),\n types: provider.types,\n }));\n}\n\n/**\n * Creates a host-side dispatcher for runner-emitted tool calls.\n */\nexport function createToolCallDispatcher(\n providers: ResolvedToolProvider[],\n signal: AbortSignal,\n): (call: ToolCall) => Promise<ToolCallResult> {\n const providerMap = new Map(\n providers.map((provider) => [provider.name, provider] as const),\n );\n\n return async (call) => {\n const provider = providerMap.get(call.providerName);\n const descriptor = provider?.tools[call.safeToolName];\n\n if (!provider || !descriptor) {\n return {\n error: {\n code: \"internal_error\",\n message: `Unknown tool ${call.providerName}.${call.safeToolName}`,\n },\n ok: false,\n };\n }\n\n try {\n if (signal.aborted) {\n return {\n error: {\n code: \"timeout\",\n message: getExecutionTimeoutMessage(),\n },\n ok: false,\n };\n }\n\n const result = await descriptor.execute(\n call.input,\n createExecutionContext(\n signal,\n provider.name,\n descriptor.safeName,\n descriptor.originalName,\n ),\n );\n\n if (result !== undefined && !isJsonSerializable(result)) {\n throw new ExecuteFailure(\n \"serialization_error\",\n \"Host value is not JSON-serializable\",\n );\n }\n\n return {\n ok: true,\n result,\n };\n } catch (error) {\n return {\n error: toTrustedExecuteError(error),\n ok: false,\n };\n }\n };\n}\n"],"mappings":";;;AAOA,MAAM,4BAA4B;;;;AAKlC,MAAM,4BAA4B,IAAI,IAAsB;CAC1D;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;AAKF,SAAgB,wBACd,OAC2B;AAC3B,QAAO,0BAA0B,IAAI,MAA0B;;;;;AAMjE,SAAgB,6BAAqC;AACnD,QAAO;;;;;AAMT,SAAgB,2BAA2B,aAAa,GAAkB;AACxE,QAAO;EACL;EACA,OAAO;GACL,MAAM;GACN,SAAS,4BAA4B;GACtC;EACD,MAAM,EAAE;EACR,IAAI;EACL;;;;;AAMH,SAAgB,uBAAuB,OAAwB;AAC7D,KAAI,iBAAiB,MACnB,QAAO,MAAM;AAGf,KAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,OAAO;EACrE,MAAM,UAAW,MAAgC;AACjD,MAAI,OAAO,YA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CAAC,cAAc,gBAAgB,CACjE,cACA;GACE,aAAa,WAAW;GACxB,cAAc,WAAW;GACzB,UAAU,WAAW;GACtB,CACF,CAAC,CACH;EACD,OAAO,SAAS;EACjB,EAAE;;;;;AAML,SAAgB,yBACd,WACA,QAC6C;CAC7C,MAAM,cAAc,IAAI,IACtB,UAAU,KAAK,aAAa,CAAC,SAAS,MAAM,SAAS,CAAU,CAChE;AAED,QAAO,OAAO,SAAS;EACrB,MAAM,WAAW,YAAY,IAAI,KAAK,aAAa;EACnD,MAAM,aAAa,UAAU,MAAM,KAAK;AAExC,MAAI,CAAC,YAAY,CAAC,WAChB,QAAO;GACL,OAAO;IACL,MAAM;IACN,SAAS,gBAAgB,KAAK,aAAa,GAAG,KAAK;IACpD;GACD,IAAI;GACL;AAGH,MAAI;AACF,OAAI,OAAO,QACT,QAAO;IACL,OAAO;KACL,MAAM;KACN,SAAS,4BAA4B;KACtC;IACD,IAAI;IACL;GAGH,MAAM,SAAS,MAAM,WAAW,QAC9B,KAAK,OACL,uBACE,QACA,SAAS,MACT,WAAW,UACX,WAAW,aACZ,CACF;AAED,OAAI,WAAW,UAAa,CAACC,kCAAmB,OAAO,CACrD,OAAM,IAAIC,8BACR,uBACA,sCACD;AAGH,UAAO;IACL,IAAI;IACJ;IACD;WACM,OAAO;AACd,UAAO;IACL,OAAO,sBAAsB,MAAM;IACnC,IAAI;IACL"}
1
+ {"version":3,"file":"runner-CsrfDub-.cjs","names":["truncated: string[]","isExecuteFailure","isJsonSerializable","ExecuteFailure"],"sources":["../src/executor/shared.ts","../src/runner.ts"],"sourcesContent":["import type {\n ExecuteError,\n ExecuteErrorCode,\n ExecuteResult,\n ToolExecutionContext,\n} from \"../types\";\n\nconst EXECUTION_TIMEOUT_MESSAGE = \"Execution timed out\";\n\n/**\n * Canonical error codes that may safely cross trusted executor boundaries.\n */\nconst KNOWN_EXECUTE_ERROR_CODES = new Set<ExecuteErrorCode>([\n \"timeout\",\n \"memory_limit\",\n \"validation_error\",\n \"tool_error\",\n \"runtime_error\",\n \"serialization_error\",\n \"internal_error\",\n]);\n\n/**\n * Returns whether the value is one of execbox's stable execution error codes.\n */\nexport function isKnownExecuteErrorCode(\n value: unknown,\n): value is ExecuteErrorCode {\n return KNOWN_EXECUTE_ERROR_CODES.has(value as ExecuteErrorCode);\n}\n\n/**\n * Returns the stable timeout message used across executor implementations.\n */\nexport function getExecutionTimeoutMessage(): string {\n return EXECUTION_TIMEOUT_MESSAGE;\n}\n\n/**\n * Creates the canonical timeout failure result used for preflight cancellation.\n */\nexport function createTimeoutExecuteResult(durationMs = 0): ExecuteResult {\n return {\n durationMs,\n error: {\n code: \"timeout\",\n message: getExecutionTimeoutMessage(),\n } satisfies ExecuteError,\n logs: [],\n ok: false,\n };\n}\n\n/**\n * Normalizes an unknown thrown value into a human-readable message.\n */\nexport function normalizeThrownMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n\n if (typeof error === \"object\" && error !== null && \"message\" in error) {\n const message = (error as { message?: unknown }).message;\n if (typeof message === \"string\") {\n return message;\n }\n }\n\n return String(error);\n}\n\n/**\n * Returns the thrown error name when one is available.\n */\nexport function normalizeThrownName(error: unknown): string | undefined {\n if (error instanceof Error) {\n return error.name;\n }\n\n if (typeof error === \"object\" && error !== null && \"name\" in error) {\n const name = (error as { name?: unknown }).name;\n if (typeof name === \"string\") {\n return name;\n }\n }\n\n return undefined;\n}\n\n/**\n * Builds the standard tool execution context passed to resolved tool wrappers.\n */\nexport function createExecutionContext(\n signal: AbortSignal,\n providerName: string,\n safeToolName: string,\n originalToolName: string,\n): ToolExecutionContext {\n return {\n originalToolName,\n providerName,\n safeToolName,\n signal,\n };\n}\n\n/**\n * Truncates captured logs to the configured line and character limits.\n */\nexport function truncateLogs(\n logs: string[],\n maxLogLines: number,\n maxLogChars: number,\n): string[] {\n const limitedLines = logs.slice(0, maxLogLines);\n let remainingChars = maxLogChars;\n const truncated: string[] = [];\n\n for (const line of limitedLines) {\n if (remainingChars <= 0) {\n break;\n }\n\n if (line.length <= remainingChars) {\n truncated.push(line);\n remainingChars -= line.length;\n continue;\n }\n\n truncated.push(line.slice(0, remainingChars));\n break;\n }\n\n return truncated;\n}\n\nfunction formatLogValue(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n\n if (value === undefined) {\n return \"undefined\";\n }\n\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\n/**\n * Formats guest console arguments into a single host-side log line.\n */\nexport function formatConsoleLine(values: unknown[]): string {\n return values.map((value) => formatLogValue(value)).join(\" \");\n}\n","import {\n createExecutionContext,\n getExecutionTimeoutMessage,\n normalizeThrownMessage,\n} from \"./executor/shared.ts\";\nimport {\n ExecuteFailure,\n isExecuteFailure,\n isJsonSerializable,\n} from \"./errors.ts\";\nimport type { ExecuteError, ResolvedToolProvider } from \"./types.ts\";\n\n/**\n * Transport-safe metadata for one exposed tool.\n */\nexport interface ProviderToolManifest {\n description?: string;\n originalName: string;\n safeName: string;\n}\n\n/**\n * Namespace manifest shared with runner implementations.\n */\nexport interface ProviderManifest {\n name: string;\n tools: Record<string, ProviderToolManifest>;\n types: string;\n}\n\n/**\n * Execution limits forwarded to runner implementations.\n */\nexport interface ExecutorRuntimeOptions {\n maxLogChars?: number;\n maxLogLines?: number;\n memoryLimitBytes?: number;\n timeoutMs?: number;\n}\n\n/**\n * Public execution options accepted by executors per call.\n */\nexport interface ExecutionOptions extends ExecutorRuntimeOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Tool invocation request emitted from a runner.\n */\nexport interface ToolCall {\n input: unknown;\n providerName: string;\n safeToolName: string;\n}\n\n/**\n * Trusted host response to a tool invocation request.\n */\nexport type ToolCallResult =\n | {\n ok: true;\n result: unknown;\n }\n | {\n error: ExecuteError;\n ok: false;\n };\n\nfunction toTrustedExecuteError(error: unknown): ExecuteError {\n if (isExecuteFailure(error)) {\n return {\n code: error.code,\n message: error.message,\n };\n }\n\n return {\n code: \"tool_error\",\n message: normalizeThrownMessage(error),\n };\n}\n\n/**\n * Converts resolved providers into manifest metadata that reveals only namespace details.\n */\nexport function extractProviderManifests(\n providers: ResolvedToolProvider[],\n): ProviderManifest[] {\n return providers.map((provider) => ({\n name: provider.name,\n tools: Object.fromEntries(\n Object.entries(provider.tools).map(([safeToolName, descriptor]) => [\n safeToolName,\n {\n description: descriptor.description,\n originalName: descriptor.originalName,\n safeName: descriptor.safeName,\n },\n ]),\n ),\n types: provider.types,\n }));\n}\n\n/**\n * Creates a host-side dispatcher for runner-emitted tool calls.\n */\nexport function createToolCallDispatcher(\n providers: ResolvedToolProvider[],\n signal: AbortSignal,\n): (call: ToolCall) => Promise<ToolCallResult> {\n const providerMap = new Map(\n providers.map((provider) => [provider.name, provider] as const),\n );\n\n return async (call) => {\n const provider = providerMap.get(call.providerName);\n const descriptor = provider?.tools[call.safeToolName];\n\n if (!provider || !descriptor) {\n return {\n error: {\n code: \"internal_error\",\n message: `Unknown tool ${call.providerName}.${call.safeToolName}`,\n },\n ok: false,\n };\n }\n\n try {\n if (signal.aborted) {\n return {\n error: {\n code: \"timeout\",\n message: getExecutionTimeoutMessage(),\n },\n ok: false,\n };\n }\n\n const result = await descriptor.execute(\n call.input,\n createExecutionContext(\n signal,\n provider.name,\n descriptor.safeName,\n descriptor.originalName,\n ),\n );\n\n if (result !== undefined && !isJsonSerializable(result)) {\n throw new ExecuteFailure(\n \"serialization_error\",\n \"Host value is not JSON-serializable\",\n );\n }\n\n return {\n ok: true,\n result,\n };\n } catch (error) {\n return {\n error: toTrustedExecuteError(error),\n ok: false,\n };\n }\n };\n}\n"],"mappings":";;;AAOA,MAAM,4BAA4B;;;;AAKlC,MAAM,4BAA4B,IAAI,IAAsB;CAC1D;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;AAKF,SAAgB,wBACd,OAC2B;AAC3B,QAAO,0BAA0B,IAAI,MAA0B;;;;;AAMjE,SAAgB,6BAAqC;AACnD,QAAO;;;;;AAMT,SAAgB,2BAA2B,a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,OAA8B;AAC3D,KAAIC,gCAAiB,MAAM,CACzB,QAAO;EACL,MAAM,MAAM;EACZ,SAAS,MAAM;EAChB;AAGH,QAAO;EACL,MAAM;EACN,SAAS,uBAAuB,MAAM;EACvC;;;;;AAMH,SAAgB,yBACd,WACoB;AACpB,QAAO,UAAU,KAAK,cAAc;EAClC,MAAM,SAAS;EACf,OAAO,OAAO,YACZ,OAAO,QAAQ,SAAS,MAAM,CAAC,KAAK,CAAC,cAAc,gBAAgB,CACjE,cACA;GACE,aAAa,WAAW;GACxB,cAAc,WAAW;GACzB,UAAU,WAAW;GACtB,CACF,CAAC,CACH;EACD,OAAO,SAAS;EACjB,EAAE;;;;;AAML,SAAgB,yBACd,WACA,QAC6C;CAC7C,MAAM,cAAc,IAAI,IACtB,UAAU,KAAK,aAAa,CAAC,SAAS,MAAM,SAAS,CAAU,CAChE;AAED,QAAO,OAAO,SAAS;EACrB,MAAM,WAAW,YAAY,IAAI,KAAK,aAAa;EACnD,MAAM,aAAa,UAAU,MAAM,KAAK;AAExC,MAAI,CAAC,YAAY,CAAC,WAChB,QAAO;GACL,OAAO;IACL,MAAM;IACN,SAAS,gBAAgB,KAAK,aAAa,GAAG,KAAK;IACpD;GACD,IAAI;GACL;AAGH,MAAI;AACF,OAAI,OAAO,QACT,QAAO;IACL,OAAO;KACL,MAAM;KACN,SAAS,4BAA4B;KACtC;IACD,IAAI;IACL;GAGH,MAAM,SAAS,MAAM,WAAW,QAC9B,KAAK,OACL,uBACE,QACA,SAAS,MACT,WAAW,UACX,WAAW,aACZ,CACF;AAED,OAAI,WAAW,UAAa,CAACC,kCAAmB,OAAO,CACrD,OAAM,IAAIC,8BACR,uBACA,sCACD;AAGH,UAAO;IACL,IAAI;IACJ;IACD;WACM,OAAO;AACd,UAAO;IACL,OAAO,sBAAsB,MAAM;IACnC,IAAI;IACL"}
@@ -0,0 +1,90 @@
1
+ const require_resolveProvider = require('./resolveProvider-BZYSw8Qk.cjs');
2
+ const require_errors = require('./errors-xD8r6fCf.cjs');
3
+ const require_runner = require('./runner-CsrfDub-.cjs');
4
+ let acorn = require("acorn");
5
+
6
+ //#region src/normalize.ts
7
+ function stripCodeFences(source) {
8
+ const match = source.match(/^\s*```[^\n]*\n([\s\S]*?)\n?```\s*$/);
9
+ return match ? match[1] : source;
10
+ }
11
+ function wrapAsync(body) {
12
+ if (body.trim().length === 0) return "async () => {}";
13
+ return `async () => {\n${body}\n}`;
14
+ }
15
+ /**
16
+ * Normalizes model-produced JavaScript into an executable async function body.
17
+ */
18
+ function normalizeCode(source) {
19
+ const normalizedSource = stripCodeFences(source).trim();
20
+ if (normalizedSource.length === 0) return "async () => {}";
21
+ try {
22
+ const program = (0, acorn.parse)(normalizedSource, {
23
+ ecmaVersion: "latest",
24
+ sourceType: "module"
25
+ });
26
+ if (program.body?.length === 1) {
27
+ const [statement] = program.body;
28
+ if (statement.type === "FunctionDeclaration" && statement.id?.name) return wrapAsync(`${normalizedSource}\nreturn ${statement.id.name}();`);
29
+ if (statement.type === "ExpressionStatement" && statement.expression) {
30
+ if (statement.expression.type === "ArrowFunctionExpression" && statement.expression.async) return normalizedSource;
31
+ return wrapAsync(`return (${normalizedSource});`);
32
+ }
33
+ }
34
+ const lastStatement = (program.body ?? []).at(-1);
35
+ if (lastStatement?.type === "ExpressionStatement" && lastStatement.expression) {
36
+ const bodyPrefix = normalizedSource.slice(0, lastStatement.start).trimEnd();
37
+ const expressionSource = normalizedSource.slice(lastStatement.expression.start, lastStatement.expression.end);
38
+ const lines = [];
39
+ if (bodyPrefix.length > 0) lines.push(bodyPrefix);
40
+ lines.push(`return (${expressionSource});`);
41
+ return wrapAsync(lines.join("\n"));
42
+ }
43
+ return wrapAsync(normalizedSource);
44
+ } catch {
45
+ return wrapAsync(normalizedSource);
46
+ }
47
+ }
48
+
49
+ //#endregion
50
+ //#region src/runtimeOptions.ts
51
+ /**
52
+ * Default runtime limits shared across the built-in executor implementations.
53
+ */
54
+ const DEFAULT_EXECUTOR_RUNTIME_OPTIONS = {
55
+ maxLogChars: 64e3,
56
+ maxLogLines: 100,
57
+ memoryLimitBytes: 64 * 1024 * 1024,
58
+ timeoutMs: 5e3
59
+ };
60
+ /**
61
+ * Resolves executor runtime limits by applying explicit overrides on top of a
62
+ * base options object and finally the shared defaults.
63
+ */
64
+ function resolveExecutorRuntimeOptions(options = {}, overrides = {}) {
65
+ return {
66
+ maxLogChars: overrides.maxLogChars ?? options.maxLogChars ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogChars,
67
+ maxLogLines: overrides.maxLogLines ?? options.maxLogLines ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogLines,
68
+ memoryLimitBytes: overrides.memoryLimitBytes ?? options.memoryLimitBytes ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.memoryLimitBytes,
69
+ timeoutMs: overrides.timeoutMs ?? options.timeoutMs ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.timeoutMs
70
+ };
71
+ }
72
+
73
+ //#endregion
74
+ exports.DEFAULT_EXECUTOR_RUNTIME_OPTIONS = DEFAULT_EXECUTOR_RUNTIME_OPTIONS;
75
+ exports.ExecuteFailure = require_errors.ExecuteFailure;
76
+ exports.createExecutionContext = require_runner.createExecutionContext;
77
+ exports.createTimeoutExecuteResult = require_runner.createTimeoutExecuteResult;
78
+ exports.createToolCallDispatcher = require_runner.createToolCallDispatcher;
79
+ exports.extractProviderManifests = require_runner.extractProviderManifests;
80
+ exports.formatConsoleLine = require_runner.formatConsoleLine;
81
+ exports.getExecutionTimeoutMessage = require_runner.getExecutionTimeoutMessage;
82
+ exports.isExecuteFailure = require_errors.isExecuteFailure;
83
+ exports.isJsonSerializable = require_errors.isJsonSerializable;
84
+ exports.isKnownExecuteErrorCode = require_runner.isKnownExecuteErrorCode;
85
+ exports.normalizeCode = normalizeCode;
86
+ exports.normalizeThrownMessage = require_runner.normalizeThrownMessage;
87
+ exports.normalizeThrownName = require_runner.normalizeThrownName;
88
+ exports.resolveExecutorRuntimeOptions = resolveExecutorRuntimeOptions;
89
+ exports.truncateLogs = require_runner.truncateLogs;
90
+ //# sourceMappingURL=runtime.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.cjs","names":["DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions"],"sources":["../src/normalize.ts","../src/runtimeOptions.ts"],"sourcesContent":["import { parse } from \"acorn\";\nimport type { Node } from \"acorn\";\n\ntype PositionedNode = Node & {\n end: number;\n start: number;\n body?: PositionedNode[];\n expression?: PositionedNode;\n async?: boolean;\n id?: {\n name: string;\n };\n};\n\nfunction stripCodeFences(source: string): string {\n const match = source.match(/^\\s*```[^\\n]*\\n([\\s\\S]*?)\\n?```\\s*$/);\n return match ? match[1] : source;\n}\n\nfunction wrapAsync(body: string): string {\n if (body.trim().length === 0) {\n return \"async () => {}\";\n }\n\n return `async () => {\\n${body}\\n}`;\n}\n\n/**\n * Normalizes model-produced JavaScript into an executable async function body.\n */\nexport function normalizeCode(source: string): string {\n const normalizedSource = stripCodeFences(source).trim();\n\n if (normalizedSource.length === 0) {\n return \"async () => {}\";\n }\n\n try {\n const program = parse(normalizedSource, {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n }) as PositionedNode;\n\n if (program.body?.length === 1) {\n const [statement] = program.body;\n\n if (statement.type === \"FunctionDeclaration\" && statement.id?.name) {\n return wrapAsync(`${normalizedSource}\\nreturn ${statement.id.name}();`);\n }\n\n if (statement.type === \"ExpressionStatement\" && statement.expression) {\n if (\n statement.expression.type === \"ArrowFunctionExpression\" &&\n statement.expression.async\n ) {\n return normalizedSource;\n }\n\n return wrapAsync(`return (${normalizedSource});`);\n }\n }\n\n const body = program.body ?? [];\n const lastStatement = body.at(-1);\n\n if (\n lastStatement?.type === \"ExpressionStatement\" &&\n lastStatement.expression\n ) {\n const bodyPrefix = normalizedSource\n .slice(0, lastStatement.start)\n .trimEnd();\n const expressionSource = normalizedSource.slice(\n lastStatement.expression.start,\n lastStatement.expression.end,\n );\n\n const lines = [];\n\n if (bodyPrefix.length > 0) {\n lines.push(bodyPrefix);\n }\n\n lines.push(`return (${expressionSource});`);\n\n return wrapAsync(lines.join(\"\\n\"));\n }\n\n return wrapAsync(normalizedSource);\n } catch {\n return wrapAsync(normalizedSource);\n }\n}\n","import type { ExecutorRuntimeOptions } from \"./runner.ts\";\n\n/**\n * Fully resolved executor runtime limits after defaults and overrides apply.\n */\nexport type ResolvedExecutorRuntimeOptions = Readonly<\n Required<ExecutorRuntimeOptions>\n>;\n\n/**\n * Default runtime limits shared across the built-in executor implementations.\n */\nconst DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions = {\n maxLogChars: 64_000,\n maxLogLines: 100,\n memoryLimitBytes: 64 * 1024 * 1024,\n timeoutMs: 5000,\n};\n\nexport { DEFAULT_EXECUTOR_RUNTIME_OPTIONS };\n\n/**\n * Resolves executor runtime limits by applying explicit overrides on top of a\n * base options object and finally the shared defaults.\n */\nexport function resolveExecutorRuntimeOptions(\n options: ExecutorRuntimeOptions = {},\n overrides: ExecutorRuntimeOptions = {},\n): Required<ExecutorRuntimeOptions> {\n return {\n maxLogChars:\n overrides.maxLogChars ??\n options.maxLogChars ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogChars,\n maxLogLines:\n overrides.maxLogLines ??\n options.maxLogLines ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogLines,\n memoryLimitBytes:\n overrides.memoryLimitBytes ??\n options.memoryLimitBytes ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.memoryLimitBytes,\n timeoutMs:\n overrides.timeoutMs ??\n options.timeoutMs ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.timeoutMs,\n };\n}\n"],"mappings":";;;;;;AAcA,SAAS,gBAAgB,QAAwB;CAC/C,MAAM,QAAQ,OAAO,MAAM,sCAAsC;AACjE,QAAO,QAAQ,MAAM,KAAK;;AAG5B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AClC,QAAO;EACL,aACE,UAAU,eACV,QAAQ,eACR,iCAAiC;EACnC,aACE,UAAU,eACV,QAAQ,eACR,iCAAiC;EACnC,kBACE,UAAU,oBACV,QAAQ,oBACR,iCAAiC;EACnC,WACE,UAAU,aACV,QAAQ,aACR,iCAAiC;EACpC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Public TypeScript declarations for this package entrypoint.
4
+ */
5
+ import { _ as ToolProvider, a as ToolCall, c as extractProviderManifests, d as ExecuteResult, f as JsonSchema, g as ToolExecutionContext, h as ToolDescriptor, i as ProviderToolManifest, l as ExecuteError, m as ResolvedToolProvider, n as ExecutorRuntimeOptions, o as ToolCallResult, p as ResolvedToolDescriptor, r as ProviderManifest, s as createToolCallDispatcher, t as ExecutionOptions, u as ExecuteErrorCode, v as ToolSchema, y as TypegenToolDescriptor } from "./runner-DSgvu6Ad.cjs";
6
+ import { t as Executor } from "./executor-BsE5nF-j.cjs";
7
+ import { n as isExecuteFailure, r as isJsonSerializable, t as ExecuteFailure } from "./errors-B9ADBuDH.cjs";
8
+
9
+ //#region src/executor/shared.d.ts
10
+ /**
11
+ * Returns whether the value is one of execbox's stable execution error codes.
12
+ */
13
+ declare function isKnownExecuteErrorCode(value: unknown): value is ExecuteErrorCode;
14
+ /**
15
+ * Returns the stable timeout message used across executor implementations.
16
+ */
17
+ declare function getExecutionTimeoutMessage(): string;
18
+ /**
19
+ * Creates the canonical timeout failure result used for preflight cancellation.
20
+ */
21
+ declare function createTimeoutExecuteResult(durationMs?: number): ExecuteResult;
22
+ /**
23
+ * Normalizes an unknown thrown value into a human-readable message.
24
+ */
25
+ declare function normalizeThrownMessage(error: unknown): string;
26
+ /**
27
+ * Returns the thrown error name when one is available.
28
+ */
29
+ declare function normalizeThrownName(error: unknown): string | undefined;
30
+ /**
31
+ * Builds the standard tool execution context passed to resolved tool wrappers.
32
+ */
33
+ declare function createExecutionContext(signal: AbortSignal, providerName: string, safeToolName: string, originalToolName: string): ToolExecutionContext;
34
+ /**
35
+ * Truncates captured logs to the configured line and character limits.
36
+ */
37
+ declare function truncateLogs(logs: string[], maxLogLines: number, maxLogChars: number): string[];
38
+ /**
39
+ * Formats guest console arguments into a single host-side log line.
40
+ */
41
+ declare function formatConsoleLine(values: unknown[]): string;
42
+ //#endregion
43
+ //#region src/normalize.d.ts
44
+ /**
45
+ * Normalizes model-produced JavaScript into an executable async function body.
46
+ */
47
+ declare function normalizeCode(source: string): string;
48
+ //#endregion
49
+ //#region src/runtimeOptions.d.ts
50
+ /**
51
+ * Fully resolved executor runtime limits after defaults and overrides apply.
52
+ */
53
+ type ResolvedExecutorRuntimeOptions = Readonly<Required<ExecutorRuntimeOptions>>;
54
+ /**
55
+ * Default runtime limits shared across the built-in executor implementations.
56
+ */
57
+ declare const DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions;
58
+ /**
59
+ * Resolves executor runtime limits by applying explicit overrides on top of a
60
+ * base options object and finally the shared defaults.
61
+ */
62
+ declare function resolveExecutorRuntimeOptions(options?: ExecutorRuntimeOptions, overrides?: ExecutorRuntimeOptions): Required<ExecutorRuntimeOptions>;
63
+ //#endregion
64
+ export { DEFAULT_EXECUTOR_RUNTIME_OPTIONS, type ExecuteError, type ExecuteErrorCode, ExecuteFailure, type ExecuteResult, type ExecutionOptions, type Executor, type ExecutorRuntimeOptions, type JsonSchema, type ProviderManifest, type ProviderToolManifest, type ResolvedExecutorRuntimeOptions, type ResolvedToolDescriptor, type ResolvedToolProvider, type ToolCall, type ToolCallResult, type ToolDescriptor, type ToolExecutionContext, type ToolProvider, type ToolSchema, type TypegenToolDescriptor, createExecutionContext, createTimeoutExecuteResult, createToolCallDispatcher, extractProviderManifests, formatConsoleLine, getExecutionTimeoutMessage, isExecuteFailure, isJsonSerializable, isKnownExecuteErrorCode, normalizeCode, normalizeThrownMessage, normalizeThrownName, resolveExecutorRuntimeOptions, truncateLogs };
65
+ //# sourceMappingURL=runtime.d.c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UAAA,CAAA,IAAA,CAAA,GAAA,CAAA,SAAA,CAAA,MAAA;;AAEa,OAAA,CAAA,QAAA,CFkFG,YAAA,CElFH,IAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,CAAA,MAAA,CAAA,CAAA,WAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA;;;;iBFgIG,iBAAA;;;;;;iBC7HA,aAAA;;;;;;KCzBJ,8BAAA,CAAA,CAAA,CAAiC,SAC3C,SAAS;AFmBX,CAAA,CAAA;AASA,CAAA,CAAA,CAAA,OAAA,CAAA,OAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,GAAA,CAAA,KAAA,CAAA,EAAA,CAAA,QAAA,CAAA,eAAA;AAOA,CAAA,CAAA;AAeA,OAAA,CAAA,KAAA,CE5CM,gCF4CgC,CAAA,CE5CE,8BF4CF;AAoCtC,CAAA,CAAA;AAiBA,CAAA,CAAA,CAAA,QAAA,CAAA,QAAA,CAAA,OAAA,CAAA,MAAA,CAAA,EAAA,CAAA,QAAA,CAAA,QAAA,CAAA,SAAA,CAAA,EAAA,CAAA,GAAA,CAAA,EAAA,CAAA;AA8CA,CAAA,CAAA,CAAA,IAAA,CAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA,GAAA,CAAA,MAAA,CAAA,QAAA;;iBElIgB,6BAAA,WACL,oCACE,yBACV,SAAS"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Public TypeScript declarations for this package entrypoint.
4
+ */
5
+ import { _ as ToolProvider, a as ToolCall, c as extractProviderManifests, d as ExecuteResult, f as JsonSchema, g as ToolExecutionContext, h as ToolDescriptor, i as ProviderToolManifest, l as ExecuteError, m as ResolvedToolProvider, n as ExecutorRuntimeOptions, o as ToolCallResult, p as ResolvedToolDescriptor, r as ProviderManifest, s as createToolCallDispatcher, t as ExecutionOptions, u as ExecuteErrorCode, v as ToolSchema, y as TypegenToolDescriptor } from "./runner-ClFrFnz9.js";
6
+ import { t as Executor } from "./executor-B7q7K_27.js";
7
+ import { n as isExecuteFailure, r as isJsonSerializable, t as ExecuteFailure } from "./errors-DlbJQYs7.js";
8
+
9
+ //#region src/executor/shared.d.ts
10
+ /**
11
+ * Returns whether the value is one of execbox's stable execution error codes.
12
+ */
13
+ declare function isKnownExecuteErrorCode(value: unknown): value is ExecuteErrorCode;
14
+ /**
15
+ * Returns the stable timeout message used across executor implementations.
16
+ */
17
+ declare function getExecutionTimeoutMessage(): string;
18
+ /**
19
+ * Creates the canonical timeout failure result used for preflight cancellation.
20
+ */
21
+ declare function createTimeoutExecuteResult(durationMs?: number): ExecuteResult;
22
+ /**
23
+ * Normalizes an unknown thrown value into a human-readable message.
24
+ */
25
+ declare function normalizeThrownMessage(error: unknown): string;
26
+ /**
27
+ * Returns the thrown error name when one is available.
28
+ */
29
+ declare function normalizeThrownName(error: unknown): string | undefined;
30
+ /**
31
+ * Builds the standard tool execution context passed to resolved tool wrappers.
32
+ */
33
+ declare function createExecutionContext(signal: AbortSignal, providerName: string, safeToolName: string, originalToolName: string): ToolExecutionContext;
34
+ /**
35
+ * Truncates captured logs to the configured line and character limits.
36
+ */
37
+ declare function truncateLogs(logs: string[], maxLogLines: number, maxLogChars: number): string[];
38
+ /**
39
+ * Formats guest console arguments into a single host-side log line.
40
+ */
41
+ declare function formatConsoleLine(values: unknown[]): string;
42
+ //#endregion
43
+ //#region src/normalize.d.ts
44
+ /**
45
+ * Normalizes model-produced JavaScript into an executable async function body.
46
+ */
47
+ declare function normalizeCode(source: string): string;
48
+ //#endregion
49
+ //#region src/runtimeOptions.d.ts
50
+ /**
51
+ * Fully resolved executor runtime limits after defaults and overrides apply.
52
+ */
53
+ type ResolvedExecutorRuntimeOptions = Readonly<Required<ExecutorRuntimeOptions>>;
54
+ /**
55
+ * Default runtime limits shared across the built-in executor implementations.
56
+ */
57
+ declare const DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions;
58
+ /**
59
+ * Resolves executor runtime limits by applying explicit overrides on top of a
60
+ * base options object and finally the shared defaults.
61
+ */
62
+ declare function resolveExecutorRuntimeOptions(options?: ExecutorRuntimeOptions, overrides?: ExecutorRuntimeOptions): Required<ExecutorRuntimeOptions>;
63
+ //#endregion
64
+ export { DEFAULT_EXECUTOR_RUNTIME_OPTIONS, type ExecuteError, type ExecuteErrorCode, ExecuteFailure, type ExecuteResult, type ExecutionOptions, type Executor, type ExecutorRuntimeOptions, type JsonSchema, type ProviderManifest, type ProviderToolManifest, type ResolvedExecutorRuntimeOptions, type ResolvedToolDescriptor, type ResolvedToolProvider, type ToolCall, type ToolCallResult, type ToolDescriptor, type ToolExecutionContext, type ToolProvider, type ToolSchema, type TypegenToolDescriptor, createExecutionContext, createTimeoutExecuteResult, createToolCallDispatcher, extractProviderManifests, formatConsoleLine, getExecutionTimeoutMessage, isExecuteFailure, isJsonSerializable, isKnownExecuteErrorCode, normalizeCode, normalizeThrownMessage, normalizeThrownName, resolveExecutorRuntimeOptions, truncateLogs };
65
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","names":[],"sources":["../src/executor/shared.ts","../src/normalize.ts","../src/runtimeOptions.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;iBAyBgB,uBAAA,2BAEJ;AAFZ,CAAA,CAAA;AASA,CAAA,CAAA,CAAA,OAAA,CAAA,GAAA,CAAA,MAAA,CAAA,OAAA,CAAA,OAAA,CAAA,IAAA,CAAA,MAAA,CAAA,QAAA,CAAA,eAAA;AAOA,CAAA,CAAA;AAegB,OAAA,CAAA,QAAA,CAtBA,0BAAA,CAAA,CAsBsB,CAAA,CAAA,MAAA;AAkBtC,CAAA,CAAA;AAkBA,CAAA,CAAA,CAAA,OAAA,CAAA,GAAA,CAAA,SAAA,CAAA,OAAA,CAAA,OAAA,CAAA,MAAA,CAAA,IAAA,CA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,CAAA,KAAA,CE5CM,gCF4CgC,CAAA,CE5CE,8BF4CF;AAoCtC,CAAA,CAAA;AAiBA,CAAA,CAAA,CAAA,QAAA,CAAA,QAAA,CAAA,OAAA,CAAA,MAAA,CAAA,EAAA,CAAA,QAAA,CAAA,QAAA,CAAA,SAAA,CAAA,EAAA,CAAA,GAAA,CAAA,EAAA,CAAA;AA8CA,CAAA,CAAA,CAAA,IAAA,CAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA,GAAA,CAAA,MAAA,CAAA,QAAA;;iBElIgB,6BAAA,WACL,oCACE,yBACV,SAAS"}
@@ -0,0 +1,74 @@
1
+ import { n as isExecuteFailure, r as isJsonSerializable, t as ExecuteFailure } from "./errors-wS8yjQhS.js";
2
+ import { a as formatConsoleLine, c as normalizeThrownMessage, i as createTimeoutExecuteResult, l as normalizeThrownName, n as extractProviderManifests, o as getExecutionTimeoutMessage, r as createExecutionContext, s as isKnownExecuteErrorCode, t as createToolCallDispatcher, u as truncateLogs } from "./runner-6GMM-5ur.js";
3
+ import { parse } from "acorn";
4
+
5
+ //#region src/normalize.ts
6
+ function stripCodeFences(source) {
7
+ const match = source.match(/^\s*```[^\n]*\n([\s\S]*?)\n?```\s*$/);
8
+ return match ? match[1] : source;
9
+ }
10
+ function wrapAsync(body) {
11
+ if (body.trim().length === 0) return "async () => {}";
12
+ return `async () => {\n${body}\n}`;
13
+ }
14
+ /**
15
+ * Normalizes model-produced JavaScript into an executable async function body.
16
+ */
17
+ function normalizeCode(source) {
18
+ const normalizedSource = stripCodeFences(source).trim();
19
+ if (normalizedSource.length === 0) return "async () => {}";
20
+ try {
21
+ const program = parse(normalizedSource, {
22
+ ecmaVersion: "latest",
23
+ sourceType: "module"
24
+ });
25
+ if (program.body?.length === 1) {
26
+ const [statement] = program.body;
27
+ if (statement.type === "FunctionDeclaration" && statement.id?.name) return wrapAsync(`${normalizedSource}\nreturn ${statement.id.name}();`);
28
+ if (statement.type === "ExpressionStatement" && statement.expression) {
29
+ if (statement.expression.type === "ArrowFunctionExpression" && statement.expression.async) return normalizedSource;
30
+ return wrapAsync(`return (${normalizedSource});`);
31
+ }
32
+ }
33
+ const lastStatement = (program.body ?? []).at(-1);
34
+ if (lastStatement?.type === "ExpressionStatement" && lastStatement.expression) {
35
+ const bodyPrefix = normalizedSource.slice(0, lastStatement.start).trimEnd();
36
+ const expressionSource = normalizedSource.slice(lastStatement.expression.start, lastStatement.expression.end);
37
+ const lines = [];
38
+ if (bodyPrefix.length > 0) lines.push(bodyPrefix);
39
+ lines.push(`return (${expressionSource});`);
40
+ return wrapAsync(lines.join("\n"));
41
+ }
42
+ return wrapAsync(normalizedSource);
43
+ } catch {
44
+ return wrapAsync(normalizedSource);
45
+ }
46
+ }
47
+
48
+ //#endregion
49
+ //#region src/runtimeOptions.ts
50
+ /**
51
+ * Default runtime limits shared across the built-in executor implementations.
52
+ */
53
+ const DEFAULT_EXECUTOR_RUNTIME_OPTIONS = {
54
+ maxLogChars: 64e3,
55
+ maxLogLines: 100,
56
+ memoryLimitBytes: 64 * 1024 * 1024,
57
+ timeoutMs: 5e3
58
+ };
59
+ /**
60
+ * Resolves executor runtime limits by applying explicit overrides on top of a
61
+ * base options object and finally the shared defaults.
62
+ */
63
+ function resolveExecutorRuntimeOptions(options = {}, overrides = {}) {
64
+ return {
65
+ maxLogChars: overrides.maxLogChars ?? options.maxLogChars ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogChars,
66
+ maxLogLines: overrides.maxLogLines ?? options.maxLogLines ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogLines,
67
+ memoryLimitBytes: overrides.memoryLimitBytes ?? options.memoryLimitBytes ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.memoryLimitBytes,
68
+ timeoutMs: overrides.timeoutMs ?? options.timeoutMs ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.timeoutMs
69
+ };
70
+ }
71
+
72
+ //#endregion
73
+ export { DEFAULT_EXECUTOR_RUNTIME_OPTIONS, ExecuteFailure, createExecutionContext, createTimeoutExecuteResult, createToolCallDispatcher, extractProviderManifests, formatConsoleLine, getExecutionTimeoutMessage, isExecuteFailure, isJsonSerializable, isKnownExecuteErrorCode, normalizeCode, normalizeThrownMessage, normalizeThrownName, resolveExecutorRuntimeOptions, truncateLogs };
74
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","names":["DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions"],"sources":["../src/normalize.ts","../src/runtimeOptions.ts"],"sourcesContent":["import { parse } from \"acorn\";\nimport type { Node } from \"acorn\";\n\ntype PositionedNode = Node & {\n end: number;\n start: number;\n body?: PositionedNode[];\n expression?: PositionedNode;\n async?: boolean;\n id?: {\n name: string;\n };\n};\n\nfunction stripCodeFences(source: string): string {\n const match = source.match(/^\\s*```[^\\n]*\\n([\\s\\S]*?)\\n?```\\s*$/);\n return match ? match[1] : source;\n}\n\nfunction wrapAsync(body: string): string {\n if (body.trim().length === 0) {\n return \"async () => {}\";\n }\n\n return `async () => {\\n${body}\\n}`;\n}\n\n/**\n * Normalizes model-produced JavaScript into an executable async function body.\n */\nexport function normalizeCode(source: string): string {\n const normalizedSource = stripCodeFences(source).trim();\n\n if (normalizedSource.length === 0) {\n return \"async () => {}\";\n }\n\n try {\n const program = parse(normalizedSource, {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n }) as PositionedNode;\n\n if (program.body?.length === 1) {\n const [statement] = program.body;\n\n if (statement.type === \"FunctionDeclaration\" && statement.id?.name) {\n return wrapAsync(`${normalizedSource}\\nreturn ${statement.id.name}();`);\n }\n\n if (statement.type === \"ExpressionStatement\" && statement.expression) {\n if (\n statement.expression.type === \"ArrowFunctionExpression\" &&\n statement.expression.async\n ) {\n return normalizedSource;\n }\n\n return wrapAsync(`return (${normalizedSource});`);\n }\n }\n\n const body = program.body ?? [];\n const lastStatement = body.at(-1);\n\n if (\n lastStatement?.type === \"ExpressionStatement\" &&\n lastStatement.expression\n ) {\n const bodyPrefix = normalizedSource\n .slice(0, lastStatement.start)\n .trimEnd();\n const expressionSource = normalizedSource.slice(\n lastStatement.expression.start,\n lastStatement.expression.end,\n );\n\n const lines = [];\n\n if (bodyPrefix.length > 0) {\n lines.push(bodyPrefix);\n }\n\n lines.push(`return (${expressionSource});`);\n\n return wrapAsync(lines.join(\"\\n\"));\n }\n\n return wrapAsync(normalizedSource);\n } catch {\n return wrapAsync(normalizedSource);\n }\n}\n","import type { ExecutorRuntimeOptions } from \"./runner.ts\";\n\n/**\n * Fully resolved executor runtime limits after defaults and overrides apply.\n */\nexport type ResolvedExecutorRuntimeOptions = Readonly<\n Required<ExecutorRuntimeOptions>\n>;\n\n/**\n * Default runtime limits shared across the built-in executor implementations.\n */\nconst DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions = {\n maxLogChars: 64_000,\n maxLogLines: 100,\n memoryLimitBytes: 64 * 1024 * 1024,\n timeoutMs: 5000,\n};\n\nexport { DEFAULT_EXECUTOR_RUNTIME_OPTIONS };\n\n/**\n * Resolves executor runtime limits by applying explicit overrides on top of a\n * base options object and finally the shared defaults.\n */\nexport function resolveExecutorRuntimeOptions(\n options: ExecutorRuntimeOptions = {},\n overrides: ExecutorRuntimeOptions = {},\n): Required<ExecutorRuntimeOptions> {\n return {\n maxLogChars:\n overrides.maxLogChars ??\n options.maxLogChars ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogChars,\n maxLogLines:\n overrides.maxLogLines ??\n options.maxLogLines ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogLines,\n memoryLimitBytes:\n overrides.memoryLimitBytes ??\n options.memoryLimitBytes ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.memoryLimitBytes,\n timeoutMs:\n overrides.timeoutMs ??\n options.timeoutMs ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS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AMA,mCAAmE;CACvE,aAAa;CACb,aAAa;CACb,kBAAkB,KAAK,OAAO;CAC9B,WAAW;CACZ;;;;;AAQD,SAAgB,8BACd,UAAkC,EAAE,EACpC,YAAoC,EAAE,EACJ;AAClC,QAAO;EACL,aACE,UAAU,eACV,QAAQ,eACR,iCAAiC;EACnC,aACE,UAAU,eACV,QAAQ,eACR,iCAAiC;EACnC,kBACE,UAAU,oBACV,QAAQ,oBACR,iCAAiC;EACnC,WACE,UAAU,aACV,QAAQ,aACR,iCAAiC;EACpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@execbox/core",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Core execution contract, provider resolution, and MCP adapters.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,14 +38,14 @@
38
38
  "import": "./dist/protocol/index.js",
39
39
  "require": "./dist/protocol/index.cjs"
40
40
  },
41
- "./_internal": {
42
- "source": "./src/_internal/index.ts",
41
+ "./runtime": {
42
+ "source": "./src/runtime.ts",
43
43
  "types": {
44
- "import": "./dist/_internal/index.d.ts",
45
- "require": "./dist/_internal/index.d.cts"
44
+ "import": "./dist/runtime.d.ts",
45
+ "require": "./dist/runtime.d.cts"
46
46
  },
47
- "import": "./dist/_internal/index.js",
48
- "require": "./dist/_internal/index.cjs"
47
+ "import": "./dist/runtime.js",
48
+ "require": "./dist/runtime.cjs"
49
49
  }
50
50
  },
51
51
  "sideEffects": false,
@@ -1,45 +0,0 @@
1
- const require_runner = require('../runner-BxbJ5eWb.cjs');
2
- const require_normalize = require('../normalize-B80ZCnxe.cjs');
3
- const require_errors = require('../errors-BGSgVV40.cjs');
4
-
5
- //#region src/runtimeOptions.ts
6
- /**
7
- * Default runtime limits shared across the built-in executor implementations.
8
- */
9
- const DEFAULT_EXECUTOR_RUNTIME_OPTIONS = {
10
- maxLogChars: 64e3,
11
- maxLogLines: 100,
12
- memoryLimitBytes: 64 * 1024 * 1024,
13
- timeoutMs: 5e3
14
- };
15
- /**
16
- * Resolves executor runtime limits by applying explicit overrides on top of a
17
- * base options object and finally the shared defaults.
18
- */
19
- function resolveExecutorRuntimeOptions(options = {}, overrides = {}) {
20
- return {
21
- maxLogChars: overrides.maxLogChars ?? options.maxLogChars ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogChars,
22
- maxLogLines: overrides.maxLogLines ?? options.maxLogLines ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogLines,
23
- memoryLimitBytes: overrides.memoryLimitBytes ?? options.memoryLimitBytes ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.memoryLimitBytes,
24
- timeoutMs: overrides.timeoutMs ?? options.timeoutMs ?? DEFAULT_EXECUTOR_RUNTIME_OPTIONS.timeoutMs
25
- };
26
- }
27
-
28
- //#endregion
29
- exports.DEFAULT_EXECUTOR_RUNTIME_OPTIONS = DEFAULT_EXECUTOR_RUNTIME_OPTIONS;
30
- exports.ExecuteFailure = require_errors.ExecuteFailure;
31
- exports.createExecutionContext = require_runner.createExecutionContext;
32
- exports.createTimeoutExecuteResult = require_runner.createTimeoutExecuteResult;
33
- exports.createToolCallDispatcher = require_runner.createToolCallDispatcher;
34
- exports.extractProviderManifests = require_runner.extractProviderManifests;
35
- exports.formatConsoleLine = require_runner.formatConsoleLine;
36
- exports.getExecutionTimeoutMessage = require_runner.getExecutionTimeoutMessage;
37
- exports.isExecuteFailure = require_errors.isExecuteFailure;
38
- exports.isJsonSerializable = require_errors.isJsonSerializable;
39
- exports.isKnownExecuteErrorCode = require_runner.isKnownExecuteErrorCode;
40
- exports.normalizeCode = require_normalize.normalizeCode;
41
- exports.normalizeThrownMessage = require_runner.normalizeThrownMessage;
42
- exports.normalizeThrownName = require_runner.normalizeThrownName;
43
- exports.resolveExecutorRuntimeOptions = resolveExecutorRuntimeOptions;
44
- exports.truncateLogs = require_runner.truncateLogs;
45
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","names":["DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions"],"sources":["../../src/runtimeOptions.ts"],"sourcesContent":["import type { ExecutorRuntimeOptions } from \"./runner.ts\";\n\ntype ResolvedExecutorRuntimeOptions = Readonly<\n Required<ExecutorRuntimeOptions>\n>;\n\n/**\n * Default runtime limits shared across the built-in executor implementations.\n */\nconst DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions = {\n maxLogChars: 64_000,\n maxLogLines: 100,\n memoryLimitBytes: 64 * 1024 * 1024,\n timeoutMs: 5000,\n};\n\nexport { DEFAULT_EXECUTOR_RUNTIME_OPTIONS };\n\n/**\n * Resolves executor runtime limits by applying explicit overrides on top of a\n * base options object and finally the shared defaults.\n */\nexport function resolveExecutorRuntimeOptions(\n options: ExecutorRuntimeOptions = {},\n overrides: ExecutorRuntimeOptions = {},\n): Required<ExecutorRuntimeOptions> {\n return {\n maxLogChars:\n overrides.maxLogChars ??\n options.maxLogChars ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogChars,\n maxLogLines:\n overrides.maxLogLines ??\n options.maxLogLines ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.maxLogLines,\n memoryLimitBytes:\n overrides.memoryLimitBytes ??\n options.memoryLimitBytes ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.memoryLimitBytes,\n timeoutMs:\n overrides.timeoutMs ??\n options.timeoutMs ??\n DEFAULT_EXECUTOR_RUNTIME_OPTIONS.timeoutMs,\n };\n}\n"],"mappings":";;;;;;;;AASA,MAAMA,mCAAmE;CACvE,aAAa;CACb,aAAa;CACb,kBAAkB,KAAK,OAAO;CAC9B,WAAW;CACZ;;;;;AAQD,SAAgB,8BACd,UAAkC,EAAE,EACpC,YAAoC,EAAE,EACJ;AAClC,QAAO;EACL,aACE,UAAU,eACV,QAAQ,eACR,iCAAiC;EACnC,aACE,UAAU,eACV,QAAQ,eACR,iCAAiC;EACnC,kBACE,UAAU,oBACV,QAAQ,oBACR,iCAAiC;EACnC,WACE,UAAU,aACV,QAAQ,aACR,iCAAiC;EACpC"}
@@ -1,21 +0,0 @@
1
- /**
2
- * @packageDocumentation
3
- * Public TypeScript declarations for this package entrypoint.
4
- */
5
- import { c as extractProviderManifests, n as ExecutorRuntimeOptions, s as createToolCallDispatcher } from "../runner-DSgvu6Ad.cjs";
6
- import { a as createExecutionContext, c as getExecutionTimeoutMessage, d as normalizeThrownName, f as truncateLogs, i as normalizeCode, l as isKnownExecuteErrorCode, n as isExecuteFailure, o as createTimeoutExecuteResult, r as isJsonSerializable, s as formatConsoleLine, t as ExecuteFailure, u as normalizeThrownMessage } from "../errors-B3IY3ID-.cjs";
7
-
8
- //#region src/runtimeOptions.d.ts
9
- type ResolvedExecutorRuntimeOptions = Readonly<Required<ExecutorRuntimeOptions>>;
10
- /**
11
- * Default runtime limits shared across the built-in executor implementations.
12
- */
13
- declare const DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions;
14
- /**
15
- * Resolves executor runtime limits by applying explicit overrides on top of a
16
- * base options object and finally the shared defaults.
17
- */
18
- declare function resolveExecutorRuntimeOptions(options?: ExecutorRuntimeOptions, overrides?: ExecutorRuntimeOptions): Required<ExecutorRuntimeOptions>;
19
- //#endregion
20
- export { DEFAULT_EXECUTOR_RUNTIME_OPTIONS, ExecuteFailure, createExecutionContext, createTimeoutExecuteResult, createToolCallDispatcher, extractProviderManifests, formatConsoleLine, getExecutionTimeoutMessage, isExecuteFailure, isJsonSerializable, isKnownExecuteErrorCode, normalizeCode, normalizeThrownMessage, normalizeThrownName, resolveExecutorRuntimeOptions, truncateLogs };
21
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/runtimeOptions.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAEK,8BAAA,CAAA,CAAA,CAAiC,SACpC,SAAS;;;AAH+C,CAAA,CAAA;cASpD,gCANK,CAAA,CAM6B,8BAN7B;;;AADmC,CAAA,CAAA,CAAA,IAAA,CAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA,GAAA,CAAA,MAAA,CAAA,QAAA;AAoB9C,CAAA,CAAA;AACW,OAAA,CAAA,QAAA,CADK,6BAAA,CACL,OAAA,CAAA,CAAA,CAAA,sBAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CACE,sBADF,CAAA,CAAA,CAER,QAFQ,CAEC,sBAFD,CAAA"}
@@ -1,22 +0,0 @@
1
- /**
2
- * @packageDocumentation
3
- * Public TypeScript declarations for this package entrypoint.
4
- */
5
- import { c as extractProviderManifests, n as ExecutorRuntimeOptions, s as createToolCallDispatcher } from "../runner-FSGSGEpx.js";
6
- import { a as createExecutionContext, c as getExecutionTimeoutMessage, d as normalizeThrownName, f as truncateLogs, i as normalizeCode, l as isKnownExecuteErrorCode, n as isExecuteFailure, o as createTimeoutExecuteResult, r as isJsonSerializable, s as formatConsoleLine, t as ExecuteFailure, u as normalizeThrownMessage } from "../errors-BbUru7ko.js";
7
- import "../executor-_CO7E1U7.js";
8
-
9
- //#region src/runtimeOptions.d.ts
10
- type ResolvedExecutorRuntimeOptions = Readonly<Required<ExecutorRuntimeOptions>>;
11
- /**
12
- * Default runtime limits shared across the built-in executor implementations.
13
- */
14
- declare const DEFAULT_EXECUTOR_RUNTIME_OPTIONS: ResolvedExecutorRuntimeOptions;
15
- /**
16
- * Resolves executor runtime limits by applying explicit overrides on top of a
17
- * base options object and finally the shared defaults.
18
- */
19
- declare function resolveExecutorRuntimeOptions(options?: ExecutorRuntimeOptions, overrides?: ExecutorRuntimeOptions): Required<ExecutorRuntimeOptions>;
20
- //#endregion
21
- export { DEFAULT_EXECUTOR_RUNTIME_OPTIONS, ExecuteFailure, createExecutionContext, createTimeoutExecuteResult, createToolCallDispatcher, extractProviderManifests, formatConsoleLine, getExecutionTimeoutMessage, isExecuteFailure, isJsonSerializable, isKnownExecuteErrorCode, normalizeCode, normalizeThrownMessage, normalizeThrownName, resolveExecutorRuntimeOptions, truncateLogs };
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/runtimeOptions.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAEK,8BAAA,CAAA,CAAA,CAAiC,SACpC,SAAS;;;;AAH+C,OAAA,CAAA,KAAA,CASpD,gCAP6B,CAAA,CAOK,8BAPL;;;;AAAW,CAAA,CAAA;AAoB9B,OAAA,CAAA,QAAA,CAAA,6BAAA,CAA6B,OAAA,CAAA,CAAA,CAClC,sBADkC,CAAA,CAAA,SAAA,CAAA,CAAA,CAEhC,sBAFgC,CAAA,CAAA,CAG1C,QAH0C,CAGjC,sBAHiC,CAAA"}