experimental-ash 0.58.0 → 0.59.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 (67) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/docs/public/advanced/execution-model-and-security.md +319 -0
  3. package/dist/docs/public/advanced/meta.json +1 -0
  4. package/dist/docs/public/tools.mdx +51 -0
  5. package/dist/skills/v0-ash-onboarding/SKILL.md +308 -0
  6. package/dist/src/cli/dev/tui/markdown.js +1 -1
  7. package/dist/src/compiled/.vendor-stamp.json +2 -2
  8. package/dist/src/compiled/experimental-ai-sdk-code-mode/approval-continuation.d.ts +71 -0
  9. package/dist/src/compiled/experimental-ai-sdk-code-mode/approval.d.ts +32 -0
  10. package/dist/src/compiled/experimental-ai-sdk-code-mode/code-mode-tool.d.ts +16 -0
  11. package/dist/src/compiled/experimental-ai-sdk-code-mode/continuation-capability.d.ts +33 -0
  12. package/dist/src/compiled/experimental-ai-sdk-code-mode/errors.d.ts +114 -0
  13. package/dist/src/compiled/experimental-ai-sdk-code-mode/fetch-policy.d.ts +21 -0
  14. package/dist/src/compiled/experimental-ai-sdk-code-mode/host-interrupt.d.ts +25 -0
  15. package/dist/src/compiled/experimental-ai-sdk-code-mode/index.d.ts +11 -144
  16. package/dist/src/compiled/experimental-ai-sdk-code-mode/index.js +10 -73
  17. package/dist/src/compiled/experimental-ai-sdk-code-mode/interrupt-continuation.d.ts +32 -0
  18. package/dist/src/compiled/experimental-ai-sdk-code-mode/options.d.ts +3 -0
  19. package/dist/src/compiled/experimental-ai-sdk-code-mode/run-code-mode.d.ts +12 -0
  20. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/guest-sources.d.ts +3 -0
  21. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/manager.d.ts +22 -0
  22. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/max-workers.d.ts +20 -0
  23. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/protocol.d.ts +49 -0
  24. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/worker-source.d.ts +11 -0
  25. package/dist/src/compiled/experimental-ai-sdk-code-mode/serialization.d.ts +5 -0
  26. package/dist/src/compiled/experimental-ai-sdk-code-mode/source-cache.d.ts +11 -0
  27. package/dist/src/compiled/experimental-ai-sdk-code-mode/telemetry.d.ts +20 -0
  28. package/dist/src/compiled/experimental-ai-sdk-code-mode/tool-invocation.d.ts +24 -0
  29. package/dist/src/compiled/experimental-ai-sdk-code-mode/tool-prompt.d.ts +3 -0
  30. package/dist/src/compiled/experimental-ai-sdk-code-mode/types.d.ts +802 -0
  31. package/dist/src/execution/node-step.js +1 -1
  32. package/dist/src/execution/tool-auth.d.ts +42 -0
  33. package/dist/src/execution/tool-auth.js +1 -0
  34. package/dist/src/harness/action-result-helpers.d.ts +17 -0
  35. package/dist/src/harness/action-result-helpers.js +1 -1
  36. package/dist/src/harness/code-mode-interrupt-state.d.ts +26 -0
  37. package/dist/src/harness/code-mode-interrupt-state.js +1 -0
  38. package/dist/src/harness/code-mode-lifecycle.js +1 -1
  39. package/dist/src/harness/code-mode.js +1 -1
  40. package/dist/src/harness/emission.js +1 -1
  41. package/dist/src/harness/tool-loop.js +1 -1
  42. package/dist/src/internal/application/package.js +1 -1
  43. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  44. package/dist/src/internal/node-esm-compat-banner.d.ts +11 -1
  45. package/dist/src/internal/node-esm-compat-banner.js +3 -1
  46. package/dist/src/packages/ash-scaffold/src/channels.js +2 -2
  47. package/dist/src/packages/ash-scaffold/src/steps/run-add-to-agent.js +1 -1
  48. package/dist/src/packages/ash-scaffold/src/web-template.js +2 -14
  49. package/dist/src/public/channels/slack/inbound.d.ts +2 -0
  50. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  51. package/dist/src/public/channels/slack/utils.d.ts +1 -0
  52. package/dist/src/public/channels/slack/utils.js +1 -0
  53. package/dist/src/public/connections/index.js +1 -1
  54. package/dist/src/public/definitions/tool.d.ts +61 -1
  55. package/dist/src/public/definitions/tool.js +1 -1
  56. package/dist/src/public/next/server.js +1 -1
  57. package/dist/src/runtime/connections/mcp-client.js +1 -1
  58. package/dist/src/runtime/connections/scoped-authorization.d.ts +61 -0
  59. package/dist/src/runtime/connections/scoped-authorization.js +1 -0
  60. package/dist/src/runtime/framework-tools/connection-search-dynamic.js +1 -1
  61. package/dist/src/runtime/resolve-tool.js +1 -1
  62. package/dist/src/runtime/types.d.ts +10 -0
  63. package/package.json +2 -2
  64. package/dist/src/harness/code-mode-approval.d.ts +0 -22
  65. package/dist/src/harness/code-mode-approval.js +0 -1
  66. package/dist/src/harness/code-mode-connection-auth-state.d.ts +0 -15
  67. package/dist/src/harness/code-mode-connection-auth-state.js +0 -1
@@ -0,0 +1,32 @@
1
+ import type { ModelMessage } from "ai";
2
+ import type { CodeModeInterrupt, CodeModeInterruptPayload, CodeModeOptions, CodeModeToolExecutionOptions, CodeModeToolSet, CodeModeUnwrappedResult } from "./types.js";
3
+ /**
4
+ * Returns true when a value is a generic code-mode host interruption.
5
+ */
6
+ export declare function isCodeModeInterrupt(value: unknown): value is CodeModeInterrupt;
7
+ /**
8
+ * Continues a code-mode invocation that previously returned a generic
9
+ * interruption.
10
+ */
11
+ export declare function continueCodeModeInterrupt<TPayload extends CodeModeInterruptPayload = CodeModeInterruptPayload, TResolution = unknown>({ interrupt, resolution, tools, options, toolExecutionOptions, }: {
12
+ interrupt: CodeModeInterrupt<TPayload>;
13
+ resolution: TResolution;
14
+ tools: CodeModeToolSet;
15
+ options?: CodeModeOptions;
16
+ toolExecutionOptions?: Partial<CodeModeToolExecutionOptions>;
17
+ }): Promise<unknown>;
18
+ /**
19
+ * Finds a code-mode interruption in a result-like object.
20
+ */
21
+ export declare function getCodeModeInterrupt(result: unknown): CodeModeInterrupt | undefined;
22
+ /**
23
+ * Normalizes a direct or AI SDK result-like value into completed/interrupted
24
+ * status.
25
+ */
26
+ export declare function unwrapCodeModeResult(result: unknown): CodeModeUnwrappedResult;
27
+ /**
28
+ * Replaces a stored outer `code_mode` interruption result in model history with
29
+ * the final continuation output.
30
+ */
31
+ export declare function replaceCodeModeInterruptResult(messages: ModelMessage[], interrupt: CodeModeInterrupt, finalOutput: unknown): ModelMessage[];
32
+ //# sourceMappingURL=interrupt-continuation.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { CodeModeOptions, NormalizedCodeModeOptions } from "./types.js";
2
+ export declare function normalizeOptions(options?: CodeModeOptions): NormalizedCodeModeOptions;
3
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1,12 @@
1
+ import type { RunCodeModeInput } from "./types.js";
2
+ /**
3
+ * Runs one code-mode invocation directly without wrapping it as an AI SDK tool.
4
+ *
5
+ * The source is executed in a fresh QuickJS context with the provided host tools,
6
+ * execution limits, fetch policy, and approval policy.
7
+ *
8
+ * @param input - Source code, host tools, forwarded tool execution options, and code-mode options.
9
+ * @returns The JSON-serializable value returned by the sandboxed program.
10
+ */
11
+ export declare function runCodeMode(input: RunCodeModeInput): Promise<unknown>;
12
+ //# sourceMappingURL=run-code-mode.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare function buildGuestRuntimeSetupSource(fetchEnabled: boolean): string;
2
+ export declare function wrapUserCode(js: string): string;
3
+ //# sourceMappingURL=guest-sources.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { CodeModeWorkerUrl, RunCodeModeInput } from "../types.js";
2
+ /**
3
+ * Sets the process-global worker script URL used for new code-mode workers.
4
+ *
5
+ * This is intended for advanced integrations that provide a custom,
6
+ * self-contained worker. Call this before starting invocations.
7
+ * Active workers keep running; idle workers are retired so future invocations
8
+ * use the new location.
9
+ *
10
+ * @param workerUrl - Node.js worker path or URL, or `undefined` to reset.
11
+ */
12
+ export declare function setCodeModeWorkerUrl(workerUrl?: CodeModeWorkerUrl): void;
13
+ /**
14
+ * Returns the worker script URL currently used for new code-mode workers.
15
+ */
16
+ export declare function getCodeModeWorkerUrl(): CodeModeWorkerUrl;
17
+ /**
18
+ * Returns the package default worker script URL.
19
+ */
20
+ export declare function getDefaultCodeModeWorkerUrl(): URL;
21
+ export declare function runManagedCodeMode(input: RunCodeModeInput): Promise<unknown>;
22
+ //# sourceMappingURL=manager.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Sets the process-global maximum number of active code-mode workers.
3
+ *
4
+ * Pass `undefined` or call without an argument to restore the dynamic
5
+ * memory-based default. The default admits at least one invocation and admits
6
+ * additional workers only when available memory can cover another worker.
7
+ *
8
+ * @param maxWorkers - Positive integer worker cap, or `undefined` to reset.
9
+ */
10
+ export declare function setMaxWorkers(maxWorkers?: number): void;
11
+ /**
12
+ * Returns the currently effective worker cap.
13
+ *
14
+ * @internal
15
+ */
16
+ export declare function getMaxWorkers({ memoryLimitBytes, activeWorkers, }: {
17
+ memoryLimitBytes: number;
18
+ activeWorkers: number;
19
+ }): number;
20
+ //# sourceMappingURL=max-workers.d.ts.map
@@ -0,0 +1,49 @@
1
+ import type { CodeModeDeterminismState, NormalizedCodeModeOptions, SerializableError } from "../types.js";
2
+ export interface WorkerRunMessage {
3
+ type: "run";
4
+ invocationId: string;
5
+ js: string;
6
+ determinism: CodeModeDeterminismState;
7
+ options: Pick<NormalizedCodeModeOptions, "timeoutMs" | "memoryLimitBytes" | "maxStackSizeBytes" | "maxResultBytes" | "fetchEnabled">;
8
+ }
9
+ export interface WorkerToolRequest {
10
+ type: "tool-request";
11
+ invocationId: string;
12
+ requestId: string;
13
+ toolName: string;
14
+ inputJson: string;
15
+ }
16
+ export interface WorkerFetchRequest {
17
+ type: "fetch-request";
18
+ invocationId: string;
19
+ requestId: string;
20
+ request: {
21
+ url: string;
22
+ method?: string;
23
+ headers?: Record<string, string>;
24
+ body?: string;
25
+ };
26
+ }
27
+ export interface WorkerBridgeResponse {
28
+ type: "bridge-response";
29
+ invocationId: string;
30
+ requestId: string;
31
+ success: boolean;
32
+ dateNowMs: number;
33
+ valueJson?: string;
34
+ error?: SerializableError;
35
+ }
36
+ export interface WorkerResultMessage {
37
+ type: "result";
38
+ invocationId: string;
39
+ success: boolean;
40
+ valueJson?: string;
41
+ error?: SerializableError;
42
+ }
43
+ export interface WorkerReadyMessage {
44
+ type: "ready";
45
+ invocationId: string;
46
+ }
47
+ export type WorkerToMainMessage = WorkerToolRequest | WorkerFetchRequest | WorkerResultMessage | WorkerReadyMessage;
48
+ export type MainToWorkerMessage = WorkerRunMessage | WorkerBridgeResponse;
49
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Inline worker source generated into `dist/runtime/worker-source.js` during
3
+ * package builds.
4
+ *
5
+ * The source placeholder is intentionally unusable before the build step so a
6
+ * broken package build fails loudly instead of trying to run an empty worker.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare const INLINE_CODE_MODE_WORKER_SOURCE = "throw new Error(\"Code mode inline worker source was not generated.\");";
11
+ //# sourceMappingURL=worker-source.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare function assertJsonSerializable(value: unknown, maxBytes: number, label: string): void;
2
+ export declare function toJsonPayload(value: unknown, maxBytes: number, label: string): string;
3
+ export declare function toStrictJsonPayload(value: unknown, maxBytes: number, label: string): string;
4
+ export declare function assertJsonPayloadSize(valueJson: string, maxBytes: number, label: string): void;
5
+ //# sourceMappingURL=serialization.d.ts.map
@@ -0,0 +1,11 @@
1
+ export declare function assertSourceSize(source: string, maxSourceBytes: number): void;
2
+ export declare function transformSource(source: string): string;
3
+ export declare function getTransformedSourceCacheStats(): {
4
+ entries: number;
5
+ bytes: number;
6
+ maxEntries: number;
7
+ maxBytes: number;
8
+ maxEntryBytes: number;
9
+ };
10
+ export declare function clearTransformedSourceCache(): void;
11
+ //# sourceMappingURL=source-cache.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { CodeModeTelemetryOptions } from "./types.js";
2
+ type AttributeValue = string | number | boolean | Array<string | number | boolean>;
3
+ type Attributes = Record<string, AttributeValue>;
4
+ interface TelemetrySpan {
5
+ setAttribute?: (key: string, value: AttributeValue) => void;
6
+ setAttributes?: (attributes: Attributes) => void;
7
+ addEvent?: (name: string, attributes?: Attributes) => void;
8
+ recordException?: (exception: Error | string | unknown) => void;
9
+ setStatus?: (status: {
10
+ code: number;
11
+ message?: string;
12
+ }) => void;
13
+ end?: () => void;
14
+ }
15
+ export declare function startTelemetrySpan(telemetry: CodeModeTelemetryOptions | undefined, name: string, attributes: Record<string, unknown>): TelemetrySpan | undefined;
16
+ export declare function addTelemetryEvent(span: TelemetrySpan | undefined, name: string, attributes?: Record<string, unknown>): void;
17
+ export declare function recordTelemetryError(span: TelemetrySpan | undefined, error: unknown): void;
18
+ export declare function endTelemetrySpan(span: TelemetrySpan | undefined): void;
19
+ export {};
20
+ //# sourceMappingURL=telemetry.d.ts.map
@@ -0,0 +1,24 @@
1
+ import type { CodeModeInterruptExecutionContext, CodeModeInterruptPayload, CodeModeOptions, CodeModeToolExecutionOptions, CodeModeToolSet } from "./types.js";
2
+ export type HostToolInvocationResult = {
3
+ type: "success";
4
+ valueJson: string;
5
+ } | {
6
+ type: "interrupted";
7
+ toolName: string;
8
+ input: unknown;
9
+ toolCallId: string;
10
+ payload: CodeModeInterruptPayload;
11
+ };
12
+ export declare function invokeHostTool({ toolName, inputJson, tools, baseExecutionOptions, codeModeOptions, maxToolInputBytes, maxToolOutputBytes, toolCallId, codeModeInterrupt, skipApproval, }: {
13
+ toolName: string;
14
+ inputJson: string;
15
+ tools: CodeModeToolSet;
16
+ baseExecutionOptions: CodeModeToolExecutionOptions;
17
+ codeModeOptions: CodeModeOptions;
18
+ maxToolInputBytes: number;
19
+ maxToolOutputBytes: number;
20
+ toolCallId: string;
21
+ codeModeInterrupt?: CodeModeInterruptExecutionContext;
22
+ skipApproval?: boolean;
23
+ }): Promise<HostToolInvocationResult>;
24
+ //# sourceMappingURL=tool-invocation.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { CodeModeOptions, CodeModeToolSet } from "./types.js";
2
+ export declare function buildCodeModeToolDescription(tools: CodeModeToolSet, options?: CodeModeOptions): string;
3
+ //# sourceMappingURL=tool-prompt.d.ts.map