@assemblyline-agents/runtime 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/a2a-client.d.ts +22 -0
- package/dist/a2a-client.d.ts.map +1 -0
- package/dist/a2a-client.js +211 -0
- package/dist/a2a-client.js.map +1 -0
- package/dist/agent-hook-context.d.ts +6 -1
- package/dist/agent-hook-context.d.ts.map +1 -1
- package/dist/agent-hook-context.js +24 -11
- package/dist/agent-hook-context.js.map +1 -1
- package/dist/agent-hook-evaluation.d.ts +6 -1
- package/dist/agent-hook-evaluation.d.ts.map +1 -1
- package/dist/agent-hook-evaluation.js +16 -5
- package/dist/agent-hook-evaluation.js.map +1 -1
- package/dist/agent-hook-run-lifecycle.d.ts +5 -1
- package/dist/agent-hook-run-lifecycle.d.ts.map +1 -1
- package/dist/agent-hook-run-lifecycle.js +11 -13
- package/dist/agent-hook-run-lifecycle.js.map +1 -1
- package/dist/agent-surface.d.ts +32 -0
- package/dist/agent-surface.d.ts.map +1 -0
- package/dist/agent-surface.js +85 -0
- package/dist/agent-surface.js.map +1 -0
- package/dist/attachments.d.ts +5 -1
- package/dist/attachments.d.ts.map +1 -1
- package/dist/attachments.js +58 -32
- package/dist/attachments.js.map +1 -1
- package/dist/audience.d.ts +30 -0
- package/dist/audience.d.ts.map +1 -0
- package/dist/audience.js +68 -0
- package/dist/audience.js.map +1 -0
- package/dist/automation-event-match.d.ts +8 -0
- package/dist/automation-event-match.d.ts.map +1 -0
- package/dist/automation-event-match.js +25 -0
- package/dist/automation-event-match.js.map +1 -0
- package/dist/background-review-trigger.d.ts.map +1 -1
- package/dist/background-review-trigger.js +14 -16
- package/dist/background-review-trigger.js.map +1 -1
- package/dist/background-review-types.d.ts +9 -2
- package/dist/background-review-types.d.ts.map +1 -1
- package/dist/background-review-worker.js +2 -2
- package/dist/background-review-worker.js.map +1 -1
- package/dist/background-review.d.ts.map +1 -1
- package/dist/background-review.js +27 -10
- package/dist/background-review.js.map +1 -1
- package/dist/builtin-tool-executors.d.ts +47 -21
- package/dist/builtin-tool-executors.d.ts.map +1 -1
- package/dist/builtin-tool-executors.js +293 -121
- package/dist/builtin-tool-executors.js.map +1 -1
- package/dist/builtin-tools.d.ts +16 -8
- package/dist/builtin-tools.d.ts.map +1 -1
- package/dist/builtin-tools.js +309 -70
- package/dist/builtin-tools.js.map +1 -1
- package/dist/capability-catalog.d.ts +3 -2
- package/dist/capability-catalog.d.ts.map +1 -1
- package/dist/capability-catalog.js +10 -6
- package/dist/capability-catalog.js.map +1 -1
- package/dist/capability-inspection.d.ts +31 -0
- package/dist/capability-inspection.d.ts.map +1 -0
- package/dist/capability-inspection.js +58 -0
- package/dist/capability-inspection.js.map +1 -0
- package/dist/channel-http-util.d.ts.map +1 -1
- package/dist/channel-http-util.js +6 -2
- package/dist/channel-http-util.js.map +1 -1
- package/dist/channel-ingress.d.ts +16 -1
- package/dist/channel-ingress.d.ts.map +1 -1
- package/dist/channel-ingress.js +117 -7
- package/dist/channel-ingress.js.map +1 -1
- package/dist/channel.d.ts +58 -2
- package/dist/channel.d.ts.map +1 -1
- package/dist/checkpoints.d.ts +1 -1
- package/dist/checkpoints.d.ts.map +1 -1
- package/dist/checkpoints.js +6 -6
- package/dist/checkpoints.js.map +1 -1
- package/dist/child-process-env.d.ts +7 -0
- package/dist/child-process-env.d.ts.map +1 -0
- package/dist/child-process-env.js +41 -0
- package/dist/child-process-env.js.map +1 -0
- package/dist/computer-relay-protocol.d.ts.map +1 -1
- package/dist/computer-relay-protocol.js +4 -4
- package/dist/computer-relay-protocol.js.map +1 -1
- package/dist/concurrency.d.ts +1 -1
- package/dist/concurrency.js +1 -1
- package/dist/connection-auth-util.d.ts +1 -0
- package/dist/connection-auth-util.d.ts.map +1 -1
- package/dist/connection-auth-util.js +1 -1
- package/dist/connection-auth-util.js.map +1 -1
- package/dist/connection-clients.d.ts +11 -3
- package/dist/connection-clients.d.ts.map +1 -1
- package/dist/connection-clients.js +71 -8
- package/dist/connection-clients.js.map +1 -1
- package/dist/connection-event-store.d.ts +98 -0
- package/dist/connection-event-store.d.ts.map +1 -0
- package/dist/connection-event-store.js +162 -0
- package/dist/connection-event-store.js.map +1 -0
- package/dist/connection-events.d.ts +51 -0
- package/dist/connection-events.d.ts.map +1 -0
- package/dist/connection-events.js +343 -0
- package/dist/connection-events.js.map +1 -0
- package/dist/connection-stores.d.ts +3 -0
- package/dist/connection-stores.d.ts.map +1 -1
- package/dist/connection-stores.js +4 -1
- package/dist/connection-stores.js.map +1 -1
- package/dist/connection-util.d.ts +3 -2
- package/dist/connection-util.d.ts.map +1 -1
- package/dist/connection-util.js +18 -1
- package/dist/connection-util.js.map +1 -1
- package/dist/connections.d.ts +54 -5
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +342 -53
- package/dist/connections.js.map +1 -1
- package/dist/context-policy-util.d.ts.map +1 -1
- package/dist/context-policy-util.js +1 -3
- package/dist/context-policy-util.js.map +1 -1
- package/dist/conversation-context.d.ts +6 -2
- package/dist/conversation-context.d.ts.map +1 -1
- package/dist/conversation-context.js +45 -12
- package/dist/conversation-context.js.map +1 -1
- package/dist/conversation-transcript.d.ts +8 -5
- package/dist/conversation-transcript.d.ts.map +1 -1
- package/dist/conversation-transcript.js +24 -5
- package/dist/conversation-transcript.js.map +1 -1
- package/dist/conversation-turn-coalescing.d.ts +22 -0
- package/dist/conversation-turn-coalescing.d.ts.map +1 -0
- package/dist/conversation-turn-coalescing.js +121 -0
- package/dist/conversation-turn-coalescing.js.map +1 -0
- package/dist/conversation-turn-dispatch.d.ts +5 -2
- package/dist/conversation-turn-dispatch.d.ts.map +1 -1
- package/dist/conversation-turn-dispatch.js +59 -22
- package/dist/conversation-turn-dispatch.js.map +1 -1
- package/dist/default-outbound-route.d.ts +29 -0
- package/dist/default-outbound-route.d.ts.map +1 -0
- package/dist/default-outbound-route.js +105 -0
- package/dist/default-outbound-route.js.map +1 -0
- package/dist/delivery-artifacts.d.ts +2 -0
- package/dist/delivery-artifacts.d.ts.map +1 -0
- package/dist/delivery-artifacts.js +34 -0
- package/dist/delivery-artifacts.js.map +1 -0
- package/dist/delivery-files.d.ts +5 -0
- package/dist/delivery-files.d.ts.map +1 -0
- package/dist/delivery-files.js +33 -0
- package/dist/delivery-files.js.map +1 -0
- package/dist/delivery-queue.d.ts +21 -1
- package/dist/delivery-queue.d.ts.map +1 -1
- package/dist/delivery-queue.js +144 -1
- package/dist/delivery-queue.js.map +1 -1
- package/dist/delivery-send.d.ts +2 -2
- package/dist/delivery-send.d.ts.map +1 -1
- package/dist/delivery-send.js +256 -100
- package/dist/delivery-send.js.map +1 -1
- package/dist/durable-files.d.ts +37 -0
- package/dist/durable-files.d.ts.map +1 -0
- package/dist/durable-files.js +63 -0
- package/dist/durable-files.js.map +1 -0
- package/dist/harness-loop.d.ts +6 -1
- package/dist/harness-loop.d.ts.map +1 -1
- package/dist/harness-loop.js +110 -25
- package/dist/harness-loop.js.map +1 -1
- package/dist/heic-transcode-worker.d.ts +2 -0
- package/dist/heic-transcode-worker.d.ts.map +1 -0
- package/dist/heic-transcode-worker.js +59 -0
- package/dist/heic-transcode-worker.js.map +1 -0
- package/dist/heic-transcode.d.ts +18 -0
- package/dist/heic-transcode.d.ts.map +1 -0
- package/dist/heic-transcode.js +99 -0
- package/dist/heic-transcode.js.map +1 -0
- package/dist/human-input-routing.d.ts +22 -0
- package/dist/human-input-routing.d.ts.map +1 -0
- package/dist/human-input-routing.js +26 -0
- package/dist/human-input-routing.js.map +1 -0
- package/dist/in-memory-conversation-turn-store.d.ts +3 -1
- package/dist/in-memory-conversation-turn-store.d.ts.map +1 -1
- package/dist/in-memory-conversation-turn-store.js +41 -2
- package/dist/in-memory-conversation-turn-store.js.map +1 -1
- package/dist/in-memory-run-store.d.ts +8 -0
- package/dist/in-memory-run-store.d.ts.map +1 -1
- package/dist/in-memory-run-store.js +28 -5
- package/dist/in-memory-run-store.js.map +1 -1
- package/dist/in-memory-sandbox-session-store.d.ts +2 -1
- package/dist/in-memory-sandbox-session-store.d.ts.map +1 -1
- package/dist/in-memory-sandbox-session-store.js +65 -1
- package/dist/in-memory-sandbox-session-store.js.map +1 -1
- package/dist/in-memory-small-stores.d.ts +18 -1
- package/dist/in-memory-small-stores.d.ts.map +1 -1
- package/dist/in-memory-small-stores.js +107 -1
- package/dist/in-memory-small-stores.js.map +1 -1
- package/dist/in-memory-workspace-store.d.ts +40 -0
- package/dist/in-memory-workspace-store.d.ts.map +1 -0
- package/dist/in-memory-workspace-store.js +370 -0
- package/dist/in-memory-workspace-store.js.map +1 -0
- package/dist/index.d.ts +73 -36
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +390 -258
- package/dist/index.js.map +1 -1
- package/dist/json-util.d.ts +8 -0
- package/dist/json-util.d.ts.map +1 -1
- package/dist/json-util.js +8 -0
- package/dist/json-util.js.map +1 -1
- package/dist/local-sandbox.d.ts +3 -2
- package/dist/local-sandbox.d.ts.map +1 -1
- package/dist/local-sandbox.js +69 -25
- package/dist/local-sandbox.js.map +1 -1
- package/dist/mcp-client.d.ts.map +1 -1
- package/dist/mcp-client.js +3 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/media-processor.d.ts +42 -0
- package/dist/media-processor.d.ts.map +1 -0
- package/dist/media-processor.js +2 -0
- package/dist/media-processor.js.map +1 -0
- package/dist/model-media.d.ts +13 -1
- package/dist/model-media.d.ts.map +1 -1
- package/dist/model-media.js +81 -18
- package/dist/model-media.js.map +1 -1
- package/dist/model-visible-interrupts.d.ts +10 -0
- package/dist/model-visible-interrupts.d.ts.map +1 -0
- package/dist/model-visible-interrupts.js +41 -0
- package/dist/model-visible-interrupts.js.map +1 -0
- package/dist/operator-controls.d.ts.map +1 -1
- package/dist/operator-controls.js +16 -3
- package/dist/operator-controls.js.map +1 -1
- package/dist/outbound-http-policy.d.ts +7 -0
- package/dist/outbound-http-policy.d.ts.map +1 -0
- package/dist/outbound-http-policy.js +155 -0
- package/dist/outbound-http-policy.js.map +1 -0
- package/dist/public-api.d.ts +21 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +19 -0
- package/dist/public-api.js.map +1 -0
- package/dist/replay-resume.d.ts +8 -0
- package/dist/replay-resume.d.ts.map +1 -1
- package/dist/replay-resume.js +141 -11
- package/dist/replay-resume.js.map +1 -1
- package/dist/resource-projection-util.d.ts +1 -1
- package/dist/resource-projection-util.d.ts.map +1 -1
- package/dist/resource-projection-util.js +21 -10
- package/dist/resource-projection-util.js.map +1 -1
- package/dist/resource-projection.d.ts +8 -1
- package/dist/resource-projection.d.ts.map +1 -1
- package/dist/resource-projection.js +229 -29
- package/dist/resource-projection.js.map +1 -1
- package/dist/run-heartbeat.d.ts +12 -2
- package/dist/run-heartbeat.d.ts.map +1 -1
- package/dist/run-heartbeat.js +31 -4
- package/dist/run-heartbeat.js.map +1 -1
- package/dist/run-outcome.d.ts +9 -5
- package/dist/run-outcome.d.ts.map +1 -1
- package/dist/run-outcome.js +14 -5
- package/dist/run-outcome.js.map +1 -1
- package/dist/run-recovery.d.ts +19 -3
- package/dist/run-recovery.d.ts.map +1 -1
- package/dist/run-recovery.js +205 -34
- package/dist/run-recovery.js.map +1 -1
- package/dist/run-replay.d.ts +35 -0
- package/dist/run-replay.d.ts.map +1 -0
- package/dist/run-replay.js +193 -0
- package/dist/run-replay.js.map +1 -0
- package/dist/run-result.d.ts +4 -0
- package/dist/run-result.d.ts.map +1 -0
- package/dist/run-result.js +18 -0
- package/dist/run-result.js.map +1 -0
- package/dist/run-timeline-query.d.ts +38 -0
- package/dist/run-timeline-query.d.ts.map +1 -0
- package/dist/run-timeline-query.js +99 -0
- package/dist/run-timeline-query.js.map +1 -0
- package/dist/runs-query.d.ts.map +1 -1
- package/dist/runs-query.js +11 -3
- package/dist/runs-query.js.map +1 -1
- package/dist/runtime-bundle.d.ts.map +1 -1
- package/dist/runtime-bundle.js +2 -0
- package/dist/runtime-bundle.js.map +1 -1
- package/dist/runtime-learning.d.ts +15 -13
- package/dist/runtime-learning.d.ts.map +1 -1
- package/dist/runtime-learning.js +79 -58
- package/dist/runtime-learning.js.map +1 -1
- package/dist/runtime-types.d.ts +68 -9
- package/dist/runtime-types.d.ts.map +1 -1
- package/dist/sandbox-fs.d.ts +8 -5
- package/dist/sandbox-fs.d.ts.map +1 -1
- package/dist/sandbox-fs.js +30 -31
- package/dist/sandbox-fs.js.map +1 -1
- package/dist/sandbox-handle.d.ts +25 -0
- package/dist/sandbox-handle.d.ts.map +1 -0
- package/dist/sandbox-handle.js +120 -0
- package/dist/sandbox-handle.js.map +1 -0
- package/dist/sandbox-session-identity.d.ts +14 -0
- package/dist/sandbox-session-identity.d.ts.map +1 -0
- package/dist/sandbox-session-identity.js +33 -0
- package/dist/sandbox-session-identity.js.map +1 -0
- package/dist/sandbox-session-key.d.ts.map +1 -1
- package/dist/sandbox-session-key.js +12 -9
- package/dist/sandbox-session-key.js.map +1 -1
- package/dist/sandbox-session-lifecycle.d.ts.map +1 -1
- package/dist/sandbox-session-lifecycle.js +187 -44
- package/dist/sandbox-session-lifecycle.js.map +1 -1
- package/dist/sandbox-snapshot-policy.js +3 -3
- package/dist/sandbox-snapshot-policy.js.map +1 -1
- package/dist/sandbox-state-sync.d.ts +4 -2
- package/dist/sandbox-state-sync.d.ts.map +1 -1
- package/dist/sandbox-state-sync.js +47 -15
- package/dist/sandbox-state-sync.js.map +1 -1
- package/dist/sandbox-sync-worker.d.ts +11 -2
- package/dist/sandbox-sync-worker.d.ts.map +1 -1
- package/dist/sandbox-sync-worker.js +143 -31
- package/dist/sandbox-sync-worker.js.map +1 -1
- package/dist/schedule-execution.d.ts.map +1 -1
- package/dist/schedule-execution.js +127 -23
- package/dist/schedule-execution.js.map +1 -1
- package/dist/sdk-api-client.d.ts +17 -0
- package/dist/sdk-api-client.d.ts.map +1 -0
- package/dist/sdk-api-client.js +55 -0
- package/dist/sdk-api-client.js.map +1 -0
- package/dist/security.js +2 -2
- package/dist/security.js.map +1 -1
- package/dist/self-improvement.d.ts +5 -1
- package/dist/self-improvement.d.ts.map +1 -1
- package/dist/self-improvement.js +28 -14
- package/dist/self-improvement.js.map +1 -1
- package/dist/skill-bundles.d.ts +55 -0
- package/dist/skill-bundles.d.ts.map +1 -0
- package/dist/skill-bundles.js +134 -0
- package/dist/skill-bundles.js.map +1 -0
- package/dist/source-loader.js +7 -7
- package/dist/source-loader.js.map +1 -1
- package/dist/state-store-helpers.d.ts +2 -0
- package/dist/state-store-helpers.d.ts.map +1 -1
- package/dist/state-store-helpers.js +11 -1
- package/dist/state-store-helpers.js.map +1 -1
- package/dist/state-stores.d.ts +1 -0
- package/dist/state-stores.d.ts.map +1 -1
- package/dist/state-stores.js +26 -7
- package/dist/state-stores.js.map +1 -1
- package/dist/state.d.ts +305 -5
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +41 -2
- package/dist/state.js.map +1 -1
- package/dist/storage.d.ts +47 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +158 -6
- package/dist/storage.js.map +1 -1
- package/dist/subagent-execution.d.ts +1 -1
- package/dist/subagent-execution.d.ts.map +1 -1
- package/dist/subagent-execution.js +10 -12
- package/dist/subagent-execution.js.map +1 -1
- package/dist/target-instructions.js +1 -1
- package/dist/target-instructions.js.map +1 -1
- package/dist/tool-apis.d.ts.map +1 -1
- package/dist/tool-apis.js +33 -9
- package/dist/tool-apis.js.map +1 -1
- package/dist/tool-execution.d.ts +22 -12
- package/dist/tool-execution.d.ts.map +1 -1
- package/dist/tool-execution.js +368 -238
- package/dist/tool-execution.js.map +1 -1
- package/dist/turn-media.d.ts +29 -0
- package/dist/turn-media.d.ts.map +1 -0
- package/dist/turn-media.js +233 -0
- package/dist/turn-media.js.map +1 -0
- package/dist/usage-reconciliation.d.ts +1 -1
- package/dist/usage-reconciliation.js +1 -1
- package/dist/workspace-id.d.ts +10 -0
- package/dist/workspace-id.d.ts.map +1 -0
- package/dist/workspace-id.js +55 -0
- package/dist/workspace-id.js.map +1 -0
- package/dist/workspace-manifest.d.ts +24 -0
- package/dist/workspace-manifest.d.ts.map +1 -0
- package/dist/workspace-manifest.js +111 -0
- package/dist/workspace-manifest.js.map +1 -0
- package/dist/workspace-operation-limiter.d.ts +16 -0
- package/dist/workspace-operation-limiter.d.ts.map +1 -0
- package/dist/workspace-operation-limiter.js +31 -0
- package/dist/workspace-operation-limiter.js.map +1 -0
- package/dist/workspace-operations.d.ts +145 -0
- package/dist/workspace-operations.d.ts.map +1 -0
- package/dist/workspace-operations.js +420 -0
- package/dist/workspace-operations.js.map +1 -0
- package/dist/workspace-runtime.d.ts +110 -0
- package/dist/workspace-runtime.d.ts.map +1 -0
- package/dist/workspace-runtime.js +240 -0
- package/dist/workspace-runtime.js.map +1 -0
- package/dist/workspace-search.d.ts +55 -0
- package/dist/workspace-search.d.ts.map +1 -0
- package/dist/workspace-search.js +262 -0
- package/dist/workspace-search.js.map +1 -0
- package/dist/workspace-service.d.ts +173 -0
- package/dist/workspace-service.d.ts.map +1 -0
- package/dist/workspace-service.js +619 -0
- package/dist/workspace-service.js.map +1 -0
- package/dist/workspace.d.ts +7 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +7 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +7 -4
package/dist/builtin-tools.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { approvalNever, approvalRequired, normalizeSandboxPath as normalizeCoreSandboxPath } from "@assemblyline-agents/core";
|
|
3
|
+
import { DEFAULT_DELIVERY_FILE_MAX_BYTES, deliveryFileContentType } from "./delivery-queue.js";
|
|
4
|
+
import { internalDeliveryArtifactReason } from "./delivery-artifacts.js";
|
|
5
|
+
import { boundedPositiveIntEnv } from "./env-config.js";
|
|
6
|
+
import { workspaceContentBlobKey } from "./workspace-service.js";
|
|
2
7
|
export const READ_TOOL_NAME = "read";
|
|
3
8
|
export const WRITE_TOOL_NAME = "write";
|
|
4
9
|
export const EDIT_TOOL_NAME = "edit";
|
|
@@ -6,11 +11,19 @@ export const DELETE_TOOL_NAME = "delete";
|
|
|
6
11
|
export const LIST_TOOL_NAME = "list";
|
|
7
12
|
export const GREP_TOOL_NAME = "grep";
|
|
8
13
|
export const BASH_TOOL_NAME = "bash";
|
|
9
|
-
export const
|
|
14
|
+
export const DELIVER_ARTIFACT_TOOL_NAME = "deliver_artifact";
|
|
10
15
|
export const LOAD_SKILL_TOOL_NAME = "load_skill";
|
|
11
16
|
export const TOOL_SEARCH_TOOL_NAME = "tool_search";
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
17
|
+
export const PAIR_TOOL_NAME = "pair";
|
|
18
|
+
export const HISTORY_SEARCH_TOOL_NAME = "history_search";
|
|
19
|
+
export const FILES_SEARCH_TOOL_NAME = "files_search";
|
|
20
|
+
export const FILES_MOUNT_TOOL_NAME = "files_mount";
|
|
21
|
+
export const WORKSPACE_SEARCH_TOOL_NAME = "workspace_search";
|
|
22
|
+
export const WORKSPACE_STATUS_TOOL_NAME = "workspace_status";
|
|
23
|
+
export const WORKSPACE_CHECKPOINT_CREATE_TOOL_NAME = "workspace_checkpoint_create";
|
|
24
|
+
export const WORKSPACE_CHECKPOINT_LIST_TOOL_NAME = "workspace_checkpoint_list";
|
|
25
|
+
export const WORKSPACE_CHECKPOINT_RESTORE_TOOL_NAME = "workspace_checkpoint_restore";
|
|
26
|
+
export const WORKSPACE_FORK_TOOL_NAME = "workspace_fork";
|
|
14
27
|
export const CORE_HARNESS_TOOL_NAMES = [
|
|
15
28
|
READ_TOOL_NAME,
|
|
16
29
|
WRITE_TOOL_NAME,
|
|
@@ -19,11 +32,19 @@ export const CORE_HARNESS_TOOL_NAMES = [
|
|
|
19
32
|
LIST_TOOL_NAME,
|
|
20
33
|
GREP_TOOL_NAME,
|
|
21
34
|
BASH_TOOL_NAME,
|
|
22
|
-
|
|
35
|
+
DELIVER_ARTIFACT_TOOL_NAME,
|
|
23
36
|
LOAD_SKILL_TOOL_NAME,
|
|
24
37
|
TOOL_SEARCH_TOOL_NAME,
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
PAIR_TOOL_NAME,
|
|
39
|
+
HISTORY_SEARCH_TOOL_NAME,
|
|
40
|
+
FILES_SEARCH_TOOL_NAME,
|
|
41
|
+
FILES_MOUNT_TOOL_NAME,
|
|
42
|
+
WORKSPACE_SEARCH_TOOL_NAME,
|
|
43
|
+
WORKSPACE_STATUS_TOOL_NAME,
|
|
44
|
+
WORKSPACE_CHECKPOINT_CREATE_TOOL_NAME,
|
|
45
|
+
WORKSPACE_CHECKPOINT_LIST_TOOL_NAME,
|
|
46
|
+
WORKSPACE_CHECKPOINT_RESTORE_TOOL_NAME,
|
|
47
|
+
WORKSPACE_FORK_TOOL_NAME
|
|
27
48
|
];
|
|
28
49
|
const CORE_HARNESS_TOOL_NAME_SET = new Set(CORE_HARNESS_TOOL_NAMES);
|
|
29
50
|
const BUILTIN_SOURCE = {
|
|
@@ -36,7 +57,7 @@ const PATH_SCHEMA = {
|
|
|
36
57
|
};
|
|
37
58
|
const READ_COMPILED_TOOL = {
|
|
38
59
|
name: READ_TOOL_NAME,
|
|
39
|
-
description: "Read a file from the sandbox filesystem. Lazily hydrates logical
|
|
60
|
+
description: "Read a file from the sandbox filesystem. Lazily hydrates logical Assembly Line paths before reading.",
|
|
40
61
|
inputSchema: {
|
|
41
62
|
type: "object",
|
|
42
63
|
additionalProperties: false,
|
|
@@ -80,7 +101,7 @@ const WRITE_COMPILED_TOOL = {
|
|
|
80
101
|
};
|
|
81
102
|
const EDIT_COMPILED_TOOL = {
|
|
82
103
|
name: EDIT_TOOL_NAME,
|
|
83
|
-
description: "Edit a sandbox file by replacing exact text. Hydrates the path first when it is a logical
|
|
104
|
+
description: "Edit a sandbox file by replacing exact text. Hydrates the path first when it is a logical Assembly Line resource.",
|
|
84
105
|
inputSchema: {
|
|
85
106
|
type: "object",
|
|
86
107
|
additionalProperties: false,
|
|
@@ -125,7 +146,7 @@ const DELETE_COMPILED_TOOL = {
|
|
|
125
146
|
};
|
|
126
147
|
const LIST_COMPILED_TOOL = {
|
|
127
148
|
name: LIST_TOOL_NAME,
|
|
128
|
-
description: "List files under a sandbox path. Lazily hydrates bounded logical
|
|
149
|
+
description: "List files under a sandbox path. Lazily hydrates bounded logical Assembly Line roots before listing.",
|
|
129
150
|
inputSchema: {
|
|
130
151
|
type: "object",
|
|
131
152
|
additionalProperties: false,
|
|
@@ -189,26 +210,26 @@ const BASH_COMPILED_TOOL = {
|
|
|
189
210
|
hasToModelOutput: true,
|
|
190
211
|
source: BUILTIN_SOURCE
|
|
191
212
|
};
|
|
192
|
-
const
|
|
193
|
-
name:
|
|
194
|
-
description: "
|
|
213
|
+
const DELIVER_ARTIFACT_COMPILED_TOOL = {
|
|
214
|
+
name: DELIVER_ARTIFACT_TOOL_NAME,
|
|
215
|
+
description: "Required for file delivery: select one completed /workspace file for exact attachment to the user. Call once for each file the final answer should attach; a link in the final answer does not attach a file.",
|
|
195
216
|
inputSchema: {
|
|
196
217
|
type: "object",
|
|
197
218
|
additionalProperties: false,
|
|
198
219
|
properties: {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
220
|
+
path: {
|
|
221
|
+
type: "string",
|
|
222
|
+
description: "Exact non-reserved /workspace file path to deliver, such as /workspace/Investment_Memo.xlsx."
|
|
223
|
+
}
|
|
203
224
|
},
|
|
204
|
-
required: ["
|
|
225
|
+
required: ["path"]
|
|
205
226
|
},
|
|
206
227
|
needsApproval: approvalNever(),
|
|
207
228
|
defaultEnabled: true,
|
|
208
229
|
visibility: "always",
|
|
209
230
|
execution: "direct",
|
|
210
|
-
tags: ["
|
|
211
|
-
aliases: ["
|
|
231
|
+
tags: ["artifact", "delivery", "workspace", "file"],
|
|
232
|
+
aliases: ["send_file", "attach_file"],
|
|
212
233
|
hasToModelOutput: true,
|
|
213
234
|
source: BUILTIN_SOURCE
|
|
214
235
|
};
|
|
@@ -234,7 +255,7 @@ const LOAD_SKILL_COMPILED_TOOL = {
|
|
|
234
255
|
};
|
|
235
256
|
const TOOL_SEARCH_COMPILED_TOOL = {
|
|
236
257
|
name: TOOL_SEARCH_TOOL_NAME,
|
|
237
|
-
description: "
|
|
258
|
+
description: "Find and activate deferred framework, authored, and connection tools. Matching tools become directly callable.",
|
|
238
259
|
inputSchema: {
|
|
239
260
|
type: "object",
|
|
240
261
|
additionalProperties: false,
|
|
@@ -255,45 +276,209 @@ const TOOL_SEARCH_COMPILED_TOOL = {
|
|
|
255
276
|
hasToModelOutput: true,
|
|
256
277
|
source: BUILTIN_SOURCE
|
|
257
278
|
};
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
279
|
+
// The universal connection-pairing entry point. Deliberately a default-enabled
|
|
280
|
+
// core tool rather than a discovered connection tool: a pasted binding packet
|
|
281
|
+
// is often the FIRST interaction with a connection, so its landing spot must
|
|
282
|
+
// not depend on the discovery chain (tool_search → connection metadata) that
|
|
283
|
+
// breaks precisely when a connection is misconfigured. It remains visible even
|
|
284
|
+
// when no connection is configured so the model can explain that state.
|
|
285
|
+
const PAIR_COMPILED_TOOL = {
|
|
286
|
+
name: PAIR_TOOL_NAME,
|
|
287
|
+
description: "Pair a connection by redeeming a one-time pairing packet or claim code. When the user pastes binding or pairing instructions for a connection, call this with the FULL pasted text as `secret`; the host exchanges the code and stores the credential durably. Only call this for a supplied packet; the tool's presence does not mean an existing grant is missing. Omit `connection` when only one connection supports pairing.",
|
|
261
288
|
inputSchema: {
|
|
262
289
|
type: "object",
|
|
263
290
|
additionalProperties: false,
|
|
264
291
|
properties: {
|
|
265
|
-
|
|
292
|
+
connection: {
|
|
293
|
+
type: "string",
|
|
294
|
+
description: "Connection name to pair. Optional when exactly one live connection supports pairing."
|
|
295
|
+
},
|
|
296
|
+
secret: {
|
|
297
|
+
type: "string",
|
|
298
|
+
description: "The full pasted pairing packet, binding instructions, or one-time claim code."
|
|
299
|
+
}
|
|
266
300
|
},
|
|
267
|
-
required: ["
|
|
301
|
+
required: ["secret"]
|
|
268
302
|
},
|
|
269
303
|
needsApproval: approvalNever(),
|
|
270
304
|
defaultEnabled: true,
|
|
271
305
|
visibility: "always",
|
|
272
306
|
execution: "direct",
|
|
273
|
-
tags: ["
|
|
274
|
-
aliases: ["
|
|
307
|
+
tags: ["connections", "pairing", "credentials"],
|
|
308
|
+
aliases: ["bind", "pair_connection"],
|
|
275
309
|
hasToModelOutput: true,
|
|
276
310
|
source: BUILTIN_SOURCE
|
|
277
311
|
};
|
|
278
|
-
const
|
|
279
|
-
name:
|
|
280
|
-
description: "
|
|
312
|
+
const HISTORY_SEARCH_COMPILED_TOOL = {
|
|
313
|
+
name: HISTORY_SEARCH_TOOL_NAME,
|
|
314
|
+
description: "Search attributed conversation and channel history without loading the full history into the prompt. Access scope is enforced by the runtime.",
|
|
281
315
|
inputSchema: {
|
|
282
316
|
type: "object",
|
|
283
317
|
additionalProperties: false,
|
|
284
318
|
properties: {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
319
|
+
query: { type: "string", description: "Words or concepts to find." },
|
|
320
|
+
scope: {
|
|
321
|
+
type: "string",
|
|
322
|
+
enum: ["current_conversation", "current_channel", "my_conversations"],
|
|
323
|
+
description: "History boundary. Defaults to the current conversation."
|
|
324
|
+
},
|
|
325
|
+
limit: { type: "number", description: "Maximum results. Defaults to 8 and is capped at 50." }
|
|
288
326
|
},
|
|
289
|
-
required: ["
|
|
327
|
+
required: ["query"]
|
|
328
|
+
},
|
|
329
|
+
needsApproval: approvalNever(),
|
|
330
|
+
defaultEnabled: false,
|
|
331
|
+
visibility: "deferred",
|
|
332
|
+
execution: "direct",
|
|
333
|
+
tags: ["history", "search", "conversations", "channels"],
|
|
334
|
+
aliases: ["conversation_search", "search_history"],
|
|
335
|
+
hasToModelOutput: true,
|
|
336
|
+
source: BUILTIN_SOURCE
|
|
337
|
+
};
|
|
338
|
+
const FILES_SEARCH_COMPILED_TOOL = {
|
|
339
|
+
name: FILES_SEARCH_TOOL_NAME,
|
|
340
|
+
description: "Find files previously shared or created in the current durable workspace. Omit query to list the most recent files.",
|
|
341
|
+
inputSchema: {
|
|
342
|
+
type: "object",
|
|
343
|
+
additionalProperties: false,
|
|
344
|
+
properties: {
|
|
345
|
+
query: { type: "string", description: "Optional filename, path, or file id fragment." },
|
|
346
|
+
limit: { type: "number", description: "Maximum results. Defaults to 50 and is capped at 200." }
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
needsApproval: approvalNever(),
|
|
350
|
+
defaultEnabled: true,
|
|
351
|
+
visibility: "always",
|
|
352
|
+
execution: "direct",
|
|
353
|
+
tags: ["files", "search", "workspace", "durability"],
|
|
354
|
+
aliases: ["files_list", "attachments_search"],
|
|
355
|
+
hasToModelOutput: true,
|
|
356
|
+
source: BUILTIN_SOURCE
|
|
357
|
+
};
|
|
358
|
+
const FILES_MOUNT_COMPILED_TOOL = {
|
|
359
|
+
name: FILES_MOUNT_TOOL_NAME,
|
|
360
|
+
description: "Mount one durable workspace file into the current sandbox at the returned read-only /files/library path.",
|
|
361
|
+
inputSchema: {
|
|
362
|
+
type: "object",
|
|
363
|
+
additionalProperties: false,
|
|
364
|
+
properties: {
|
|
365
|
+
fileId: { type: "string", description: "Exact file id returned by files_search." }
|
|
366
|
+
},
|
|
367
|
+
required: ["fileId"]
|
|
290
368
|
},
|
|
291
369
|
needsApproval: approvalNever(),
|
|
292
370
|
defaultEnabled: true,
|
|
293
371
|
visibility: "always",
|
|
372
|
+
execution: "sandbox",
|
|
373
|
+
tags: ["files", "sandbox", "workspace", "durability"],
|
|
374
|
+
aliases: ["mount_file", "attachment_mount"],
|
|
375
|
+
hasToModelOutput: true,
|
|
376
|
+
source: BUILTIN_SOURCE
|
|
377
|
+
};
|
|
378
|
+
const WORKSPACE_STATUS_COMPILED_TOOL = {
|
|
379
|
+
name: WORKSPACE_STATUS_TOOL_NAME,
|
|
380
|
+
description: "Show the current durable workspace head, size, version count, and named checkpoints.",
|
|
381
|
+
inputSchema: { type: "object", additionalProperties: false, properties: {} },
|
|
382
|
+
needsApproval: approvalNever(),
|
|
383
|
+
defaultEnabled: false,
|
|
384
|
+
visibility: "deferred",
|
|
385
|
+
execution: "direct",
|
|
386
|
+
tags: ["workspace", "versions", "status"],
|
|
387
|
+
aliases: ["workspace_info"],
|
|
388
|
+
hasToModelOutput: true,
|
|
389
|
+
source: BUILTIN_SOURCE
|
|
390
|
+
};
|
|
391
|
+
const WORKSPACE_SEARCH_COMPILED_TOOL = {
|
|
392
|
+
name: WORKSPACE_SEARCH_TOOL_NAME,
|
|
393
|
+
description: "Search a committed durable workspace without hydrating it. Results identify the exact version and ranking source.",
|
|
394
|
+
inputSchema: {
|
|
395
|
+
type: "object",
|
|
396
|
+
additionalProperties: false,
|
|
397
|
+
properties: {
|
|
398
|
+
query: { type: "string", description: "Words or concepts to find." },
|
|
399
|
+
versionId: { type: "string", description: "Optional committed version. Defaults to the current head." },
|
|
400
|
+
limit: { type: "number", description: "Maximum results. Defaults to 8 and is capped at 100." }
|
|
401
|
+
},
|
|
402
|
+
required: ["query"]
|
|
403
|
+
},
|
|
404
|
+
needsApproval: approvalNever(),
|
|
405
|
+
defaultEnabled: false,
|
|
406
|
+
visibility: "deferred",
|
|
294
407
|
execution: "direct",
|
|
295
|
-
tags: ["
|
|
296
|
-
aliases: ["
|
|
408
|
+
tags: ["workspace", "search", "versions"],
|
|
409
|
+
aliases: ["search_workspace"],
|
|
410
|
+
hasToModelOutput: true,
|
|
411
|
+
source: BUILTIN_SOURCE
|
|
412
|
+
};
|
|
413
|
+
const WORKSPACE_CHECKPOINT_CREATE_COMPILED_TOOL = {
|
|
414
|
+
name: WORKSPACE_CHECKPOINT_CREATE_TOOL_NAME,
|
|
415
|
+
description: "Name the current committed workspace version without copying its files.",
|
|
416
|
+
inputSchema: {
|
|
417
|
+
type: "object",
|
|
418
|
+
additionalProperties: false,
|
|
419
|
+
properties: {
|
|
420
|
+
name: { type: "string", description: "Workspace-local checkpoint name." },
|
|
421
|
+
replace: { type: "boolean", description: "Replace an existing name. Defaults to false." }
|
|
422
|
+
},
|
|
423
|
+
required: ["name"]
|
|
424
|
+
},
|
|
425
|
+
needsApproval: approvalNever(),
|
|
426
|
+
defaultEnabled: false,
|
|
427
|
+
visibility: "deferred",
|
|
428
|
+
execution: "direct",
|
|
429
|
+
tags: ["workspace", "checkpoint", "versions"],
|
|
430
|
+
aliases: ["workspace_savepoint"],
|
|
431
|
+
hasToModelOutput: true,
|
|
432
|
+
source: BUILTIN_SOURCE
|
|
433
|
+
};
|
|
434
|
+
const WORKSPACE_CHECKPOINT_LIST_COMPILED_TOOL = {
|
|
435
|
+
name: WORKSPACE_CHECKPOINT_LIST_TOOL_NAME,
|
|
436
|
+
description: "List named checkpoints for the current durable workspace.",
|
|
437
|
+
inputSchema: { type: "object", additionalProperties: false, properties: {} },
|
|
438
|
+
needsApproval: approvalNever(),
|
|
439
|
+
defaultEnabled: false,
|
|
440
|
+
visibility: "deferred",
|
|
441
|
+
execution: "direct",
|
|
442
|
+
tags: ["workspace", "checkpoint", "list"],
|
|
443
|
+
aliases: ["workspace_savepoints"],
|
|
444
|
+
hasToModelOutput: true,
|
|
445
|
+
source: BUILTIN_SOURCE
|
|
446
|
+
};
|
|
447
|
+
const WORKSPACE_CHECKPOINT_RESTORE_COMPILED_TOOL = {
|
|
448
|
+
name: WORKSPACE_CHECKPOINT_RESTORE_TOOL_NAME,
|
|
449
|
+
description: "Restore a named checkpoint as a new workspace head while preserving all later versions.",
|
|
450
|
+
inputSchema: {
|
|
451
|
+
type: "object",
|
|
452
|
+
additionalProperties: false,
|
|
453
|
+
properties: { name: { type: "string", description: "Checkpoint name to restore." } },
|
|
454
|
+
required: ["name"]
|
|
455
|
+
},
|
|
456
|
+
needsApproval: approvalRequired("Restoring replaces the current workspace tree with a prior committed version."),
|
|
457
|
+
defaultEnabled: false,
|
|
458
|
+
visibility: "deferred",
|
|
459
|
+
execution: "direct",
|
|
460
|
+
tags: ["workspace", "checkpoint", "restore"],
|
|
461
|
+
aliases: ["workspace_rollback"],
|
|
462
|
+
hasToModelOutput: true,
|
|
463
|
+
source: BUILTIN_SOURCE
|
|
464
|
+
};
|
|
465
|
+
const WORKSPACE_FORK_COMPILED_TOOL = {
|
|
466
|
+
name: WORKSPACE_FORK_TOOL_NAME,
|
|
467
|
+
description: "Create an independent copy-on-write workspace from the current head or a named checkpoint.",
|
|
468
|
+
inputSchema: {
|
|
469
|
+
type: "object",
|
|
470
|
+
additionalProperties: false,
|
|
471
|
+
properties: {
|
|
472
|
+
name: { type: "string", description: "Optional display name for the new workspace." },
|
|
473
|
+
checkpoint: { type: "string", description: "Optional checkpoint to fork instead of the current head." }
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
needsApproval: approvalNever(),
|
|
477
|
+
defaultEnabled: false,
|
|
478
|
+
visibility: "deferred",
|
|
479
|
+
execution: "direct",
|
|
480
|
+
tags: ["workspace", "fork", "branch"],
|
|
481
|
+
aliases: ["workspace_branch"],
|
|
297
482
|
hasToModelOutput: true,
|
|
298
483
|
source: BUILTIN_SOURCE
|
|
299
484
|
};
|
|
@@ -305,16 +490,24 @@ const BUILT_IN_COMPILED_TOOLS = [
|
|
|
305
490
|
LIST_COMPILED_TOOL,
|
|
306
491
|
GREP_COMPILED_TOOL,
|
|
307
492
|
BASH_COMPILED_TOOL,
|
|
308
|
-
|
|
493
|
+
DELIVER_ARTIFACT_COMPILED_TOOL,
|
|
309
494
|
LOAD_SKILL_COMPILED_TOOL,
|
|
310
495
|
TOOL_SEARCH_COMPILED_TOOL,
|
|
311
|
-
|
|
312
|
-
|
|
496
|
+
PAIR_COMPILED_TOOL,
|
|
497
|
+
HISTORY_SEARCH_COMPILED_TOOL,
|
|
498
|
+
FILES_SEARCH_COMPILED_TOOL,
|
|
499
|
+
FILES_MOUNT_COMPILED_TOOL,
|
|
500
|
+
WORKSPACE_SEARCH_COMPILED_TOOL,
|
|
501
|
+
WORKSPACE_STATUS_COMPILED_TOOL,
|
|
502
|
+
WORKSPACE_CHECKPOINT_CREATE_COMPILED_TOOL,
|
|
503
|
+
WORKSPACE_CHECKPOINT_LIST_COMPILED_TOOL,
|
|
504
|
+
WORKSPACE_CHECKPOINT_RESTORE_COMPILED_TOOL,
|
|
505
|
+
WORKSPACE_FORK_COMPILED_TOOL
|
|
313
506
|
];
|
|
314
|
-
export function
|
|
315
|
-
const builtInNamed = new Map(
|
|
507
|
+
export function runtimeToolsForSurface(authoredTools) {
|
|
508
|
+
const builtInNamed = new Map(authoredTools.filter((tool) => CORE_HARNESS_TOOL_NAME_SET.has(tool.name)).map((tool) => [tool.name, tool]));
|
|
316
509
|
return [
|
|
317
|
-
...
|
|
510
|
+
...authoredTools.filter((tool) => !CORE_HARNESS_TOOL_NAME_SET.has(tool.name) && !tool.disabled),
|
|
318
511
|
...BUILT_IN_COMPILED_TOOLS.flatMap((builtin) => {
|
|
319
512
|
const authored = builtInNamed.get(builtin.name);
|
|
320
513
|
if (!authored)
|
|
@@ -342,16 +535,32 @@ export function builtInToolDefinition(name) {
|
|
|
342
535
|
return grepToolDefinition;
|
|
343
536
|
if (name === BASH_TOOL_NAME)
|
|
344
537
|
return bashToolDefinition;
|
|
345
|
-
if (name ===
|
|
346
|
-
return
|
|
538
|
+
if (name === DELIVER_ARTIFACT_TOOL_NAME)
|
|
539
|
+
return deliverArtifactToolDefinition;
|
|
347
540
|
if (name === LOAD_SKILL_TOOL_NAME)
|
|
348
541
|
return runtimeHandledToolDefinition(LOAD_SKILL_COMPILED_TOOL);
|
|
349
542
|
if (name === TOOL_SEARCH_TOOL_NAME)
|
|
350
543
|
return runtimeHandledToolDefinition(TOOL_SEARCH_COMPILED_TOOL);
|
|
351
|
-
if (name ===
|
|
352
|
-
return runtimeHandledToolDefinition(
|
|
353
|
-
if (name ===
|
|
354
|
-
return runtimeHandledToolDefinition(
|
|
544
|
+
if (name === PAIR_TOOL_NAME)
|
|
545
|
+
return runtimeHandledToolDefinition(PAIR_COMPILED_TOOL);
|
|
546
|
+
if (name === HISTORY_SEARCH_TOOL_NAME)
|
|
547
|
+
return runtimeHandledToolDefinition(HISTORY_SEARCH_COMPILED_TOOL);
|
|
548
|
+
if (name === FILES_SEARCH_TOOL_NAME)
|
|
549
|
+
return runtimeHandledToolDefinition(FILES_SEARCH_COMPILED_TOOL);
|
|
550
|
+
if (name === FILES_MOUNT_TOOL_NAME)
|
|
551
|
+
return runtimeHandledToolDefinition(FILES_MOUNT_COMPILED_TOOL);
|
|
552
|
+
if (name === WORKSPACE_SEARCH_TOOL_NAME)
|
|
553
|
+
return runtimeHandledToolDefinition(WORKSPACE_SEARCH_COMPILED_TOOL);
|
|
554
|
+
if (name === WORKSPACE_STATUS_TOOL_NAME)
|
|
555
|
+
return runtimeHandledToolDefinition(WORKSPACE_STATUS_COMPILED_TOOL);
|
|
556
|
+
if (name === WORKSPACE_CHECKPOINT_CREATE_TOOL_NAME)
|
|
557
|
+
return runtimeHandledToolDefinition(WORKSPACE_CHECKPOINT_CREATE_COMPILED_TOOL);
|
|
558
|
+
if (name === WORKSPACE_CHECKPOINT_LIST_TOOL_NAME)
|
|
559
|
+
return runtimeHandledToolDefinition(WORKSPACE_CHECKPOINT_LIST_COMPILED_TOOL);
|
|
560
|
+
if (name === WORKSPACE_CHECKPOINT_RESTORE_TOOL_NAME)
|
|
561
|
+
return runtimeHandledToolDefinition(WORKSPACE_CHECKPOINT_RESTORE_COMPILED_TOOL);
|
|
562
|
+
if (name === WORKSPACE_FORK_TOOL_NAME)
|
|
563
|
+
return runtimeHandledToolDefinition(WORKSPACE_FORK_COMPILED_TOOL);
|
|
355
564
|
return undefined;
|
|
356
565
|
}
|
|
357
566
|
export function isBuiltInToolName(name) {
|
|
@@ -485,22 +694,53 @@ const bashToolDefinition = {
|
|
|
485
694
|
return sandbox.shell(command, options);
|
|
486
695
|
}
|
|
487
696
|
};
|
|
488
|
-
const
|
|
489
|
-
...toolDefinitionBase(
|
|
697
|
+
const deliverArtifactToolDefinition = {
|
|
698
|
+
...toolDefinitionBase(DELIVER_ARTIFACT_COMPILED_TOOL),
|
|
490
699
|
async execute(input, ctx) {
|
|
491
700
|
const raw = recordInput(input);
|
|
492
|
-
const
|
|
493
|
-
if (!
|
|
494
|
-
throw new Error("
|
|
495
|
-
const options = {};
|
|
496
|
-
if (Array.isArray(raw.choices))
|
|
497
|
-
options.choices = raw.choices.map(String).filter(Boolean);
|
|
498
|
-
if (typeof raw.allowFreeform === "boolean")
|
|
499
|
-
options.allowFreeform = raw.allowFreeform;
|
|
500
|
-
if (raw.metadata && typeof raw.metadata === "object" && !Array.isArray(raw.metadata)) {
|
|
501
|
-
options.metadata = raw.metadata;
|
|
701
|
+
const path = requiredPath(raw.path);
|
|
702
|
+
if (!path.startsWith("/workspace/") || path === "/workspace/") {
|
|
703
|
+
throw new Error("deliver_artifact requires an exact file path below /workspace.");
|
|
502
704
|
}
|
|
503
|
-
|
|
705
|
+
const relativePath = path.slice("/workspace/".length);
|
|
706
|
+
const topLevel = relativePath.split("/", 1)[0] ?? "";
|
|
707
|
+
if (["memory", "skills", "history", "files", ".agents", ".assembly-line"].includes(topLevel)) {
|
|
708
|
+
throw new Error(`deliver_artifact cannot deliver reserved workspace path ${path}.`);
|
|
709
|
+
}
|
|
710
|
+
if (internalDeliveryArtifactReason(relativePath)) {
|
|
711
|
+
throw new Error(`deliver_artifact cannot deliver internal or cache path ${path}.`);
|
|
712
|
+
}
|
|
713
|
+
await ctx.hydrateSandboxPath?.(path);
|
|
714
|
+
const sandbox = await ctx.getSandbox();
|
|
715
|
+
if (!sandbox.readFileBytes) {
|
|
716
|
+
throw new Error("deliver_artifact requires a sandbox adapter with byte-preserving exact file reads.");
|
|
717
|
+
}
|
|
718
|
+
const contents = await sandbox.readFileBytes(path);
|
|
719
|
+
const bytes = Buffer.from(contents);
|
|
720
|
+
const sizeBytes = bytes.byteLength;
|
|
721
|
+
const maxBytes = boundedPositiveIntEnv(ctx.channel?.env.ASSEMBLY_LINE_DELIVERY_FILE_MAX_BYTES, DEFAULT_DELIVERY_FILE_MAX_BYTES, 1, 1024 * 1024 * 1024);
|
|
722
|
+
if (sizeBytes > maxBytes) {
|
|
723
|
+
throw new Error(`Selected delivery artifact ${path} is ${sizeBytes} bytes, exceeding the configured limit of ${maxBytes}.`);
|
|
724
|
+
}
|
|
725
|
+
if (!ctx.blob)
|
|
726
|
+
throw new Error("deliver_artifact requires blob storage.");
|
|
727
|
+
const contentType = deliveryFileContentType(relativePath);
|
|
728
|
+
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
729
|
+
const blob = await ctx.blob.put(workspaceContentBlobKey(sha256), bytes, { contentType, visibility: "private" });
|
|
730
|
+
await ctx.emit("artifact.delivery_selected", {
|
|
731
|
+
path,
|
|
732
|
+
relativePath,
|
|
733
|
+
sizeBytes: blob.size,
|
|
734
|
+
contentType,
|
|
735
|
+
sha256: blob.sha256,
|
|
736
|
+
blobKey: blob.key
|
|
737
|
+
});
|
|
738
|
+
return {
|
|
739
|
+
path,
|
|
740
|
+
sizeBytes,
|
|
741
|
+
downloadUrl: `sandbox:${path}`,
|
|
742
|
+
selectedForDelivery: true
|
|
743
|
+
};
|
|
504
744
|
}
|
|
505
745
|
};
|
|
506
746
|
function toolDefinitionBase(tool) {
|
|
@@ -508,7 +748,6 @@ function toolDefinitionBase(tool) {
|
|
|
508
748
|
description: tool.description,
|
|
509
749
|
inputSchema: tool.inputSchema,
|
|
510
750
|
needsApproval: false,
|
|
511
|
-
defaultEnabled: tool.defaultEnabled,
|
|
512
751
|
capability: {
|
|
513
752
|
visibility: tool.visibility,
|
|
514
753
|
execution: tool.execution,
|
|
@@ -527,7 +766,7 @@ function runtimeHandledToolDefinition(tool) {
|
|
|
527
766
|
return {
|
|
528
767
|
...toolDefinitionBase(tool),
|
|
529
768
|
async execute() {
|
|
530
|
-
throw new Error(`${tool.name} is handled by the
|
|
769
|
+
throw new Error(`${tool.name} is handled by the Assembly Line runtime dispatcher.`);
|
|
531
770
|
}
|
|
532
771
|
};
|
|
533
772
|
}
|
|
@@ -559,8 +798,8 @@ function boundedNumber(value, fallback, min, max) {
|
|
|
559
798
|
async function listSandboxEntries(sandbox, path, limit) {
|
|
560
799
|
if (!sandbox.listFiles)
|
|
561
800
|
throw new Error("This sandbox adapter does not support file listing.");
|
|
562
|
-
const entries = await sandbox.listFiles(path);
|
|
563
|
-
return entries.
|
|
801
|
+
const entries = await sandbox.listFiles(path, { limit, includeContents: false });
|
|
802
|
+
return entries.map((entry) => {
|
|
564
803
|
const out = { path: entry.path };
|
|
565
804
|
if (entry.size !== undefined)
|
|
566
805
|
out.size = entry.size;
|
|
@@ -570,7 +809,7 @@ async function listSandboxEntries(sandbox, path, limit) {
|
|
|
570
809
|
async function grepSandbox(sandbox, path, pattern, literal, limit) {
|
|
571
810
|
if (!sandbox.listFiles)
|
|
572
811
|
throw new Error("This sandbox adapter does not support grep without file listing.");
|
|
573
|
-
const entries = await sandbox.listFiles(path);
|
|
812
|
+
const entries = await sandbox.listFiles(path, { includeContents: true });
|
|
574
813
|
const matches = [];
|
|
575
814
|
const regexp = literal ? undefined : new RegExp(pattern, "u");
|
|
576
815
|
for (const entry of entries) {
|
|
@@ -627,8 +866,8 @@ export function builtInToolContext(tool) {
|
|
|
627
866
|
*
|
|
628
867
|
* export default defineTool({ ...builtInToolDefaults.write, execute: guarded });
|
|
629
868
|
*
|
|
630
|
-
* The
|
|
631
|
-
*
|
|
869
|
+
* The discovery tools (load_skill and tool_search) are runtime-handled and have
|
|
870
|
+
* no wrappable executor, so they are not listed.
|
|
632
871
|
*/
|
|
633
872
|
export const builtInToolDefaults = Object.freeze({
|
|
634
873
|
read: readToolDefinition,
|
|
@@ -638,6 +877,6 @@ export const builtInToolDefaults = Object.freeze({
|
|
|
638
877
|
list: listToolDefinition,
|
|
639
878
|
grep: grepToolDefinition,
|
|
640
879
|
bash: bashToolDefinition,
|
|
641
|
-
|
|
880
|
+
deliver_artifact: deliverArtifactToolDefinition
|
|
642
881
|
});
|
|
643
882
|
//# sourceMappingURL=builtin-tools.js.map
|