experimental-ash 0.24.2 → 0.25.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/CHANGELOG.md +12 -0
- package/dist/docs/public/typescript-api.md +0 -12
- package/dist/src/channel/adapter.d.ts +5 -18
- package/dist/src/channel/adapter.js +2 -8
- package/dist/src/channel/cross-channel-receive.d.ts +10 -1
- package/dist/src/channel/cross-channel-receive.js +21 -3
- package/dist/src/channel/routes.d.ts +2 -1
- package/dist/src/channel/routes.js +6 -3
- package/dist/src/channel/schedule.js +2 -2
- package/dist/src/channel/types.d.ts +1 -1
- package/dist/src/chunks/{client-DLHAGI2g.js → client-BShLWzR6.js} +3 -3
- package/dist/src/chunks/compile-agent-75wLLW-E.js +5 -0
- package/dist/src/chunks/dev-authored-source-watcher-DqoJsDup.js +1 -0
- package/dist/src/chunks/host-JVy7fewA.js +70 -0
- package/dist/src/chunks/paths-DNjq5JOy.js +85 -0
- package/dist/src/chunks/{token-D98SQdvs.js → token-BOkIxJeV.js} +1 -1
- package/dist/src/chunks/types-CjIyrcYo.js +1 -0
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +0 -5
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/repl.d.ts +1 -1
- package/dist/src/cli/dev/repl.js +3 -3
- package/dist/src/cli/run.d.ts +0 -1
- package/dist/src/cli/run.js +2 -2
- package/dist/src/client/message-reducer.js +13 -25
- package/dist/src/client/message-response.d.ts +2 -1
- package/dist/src/client/open-stream.d.ts +3 -3
- package/dist/src/client/open-stream.js +1 -2
- package/dist/src/client/session.d.ts +2 -1
- package/dist/src/client/session.js +0 -3
- package/dist/src/client/types.d.ts +3 -2
- package/dist/src/compiler/artifacts.d.ts +7 -10
- package/dist/src/compiler/artifacts.js +3 -3
- package/dist/src/compiler/manifest.d.ts +6 -15
- package/dist/src/compiler/manifest.js +3 -3
- package/dist/src/compiler/normalize-agent-config.js +12 -10
- package/dist/src/compiler/normalize-manifest.js +3 -2
- package/dist/src/context/container.d.ts +1 -16
- package/dist/src/context/container.js +1 -24
- package/dist/src/context/hook-lifecycle.d.ts +2 -7
- package/dist/src/context/hook-lifecycle.js +0 -6
- package/dist/src/context/provider.d.ts +1 -11
- package/dist/src/context/providers/sandbox.js +4 -1
- package/dist/src/context/run-step.d.ts +2 -4
- package/dist/src/context/run-step.js +4 -17
- package/dist/src/context/seed-keys.d.ts +1 -1
- package/dist/src/discover/connections.d.ts +2 -1
- package/dist/src/discover/diagnostics.d.ts +0 -8
- package/dist/src/discover/diagnostics.js +4 -16
- package/dist/src/discover/discover-agent.d.ts +3 -13
- package/dist/src/discover/discover-agent.js +1 -11
- package/dist/src/discover/discover-subagent.d.ts +3 -2
- package/dist/src/discover/discover-subagent.js +1 -1
- package/dist/src/discover/filesystem.d.ts +0 -37
- package/dist/src/discover/filesystem.js +0 -115
- package/dist/src/discover/grammar.d.ts +10 -20
- package/dist/src/discover/grammar.js +11 -33
- package/dist/src/discover/lib.d.ts +3 -2
- package/dist/src/discover/manifest.d.ts +3 -3
- package/dist/src/discover/markdown.d.ts +2 -1
- package/dist/src/discover/sandbox.d.ts +2 -1
- package/dist/src/discover/schedules.d.ts +3 -2
- package/dist/src/discover/schedules.js +1 -1
- package/dist/src/discover/skills.d.ts +3 -2
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/discover/slots.d.ts +3 -2
- package/dist/src/evals/cli/eval.d.ts +0 -6
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/loaders/index.d.ts +2 -22
- package/dist/src/evals/loaders/index.js +1 -1
- package/dist/src/evals/reporters/index.d.ts +2 -14
- package/dist/src/evals/reporters/index.js +1 -1
- package/dist/src/evals/runner/discover.d.ts +0 -6
- package/dist/src/evals/runner/discover.js +1 -1
- package/dist/src/evals/runner/execute-case.d.ts +2 -1
- package/dist/src/evals/runner/execute-suite.d.ts +2 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/resolve-git-metadata.d.ts +3 -3
- package/dist/src/evals/scorers/autoevals-client.d.ts +2 -2
- package/dist/src/execution/connection-auth-steps.d.ts +1 -5
- package/dist/src/execution/connection-auth-steps.js +4 -5
- package/dist/src/execution/node-step.d.ts +1 -1
- package/dist/src/execution/skills/instructions.d.ts +2 -1
- package/dist/src/execution/subagent-hitl-proxy.d.ts +1 -1
- package/dist/src/execution/subagent-tool.d.ts +0 -8
- package/dist/src/execution/subagent-tool.js +9 -16
- package/dist/src/execution/tool-compaction.js +0 -2
- package/dist/src/execution/turn-workflow.d.ts +1 -1
- package/dist/src/execution/turn-workflow.js +2 -2
- package/dist/src/execution/web-fetch/tool.js +1 -1
- package/dist/src/execution/workflow-steps.d.ts +17 -1
- package/dist/src/execution/workflow-steps.js +5 -6
- package/dist/src/harness/action-result-helpers.d.ts +0 -12
- package/dist/src/harness/action-result-helpers.js +1 -1
- package/dist/src/harness/emission.d.ts +2 -2
- package/dist/src/harness/execute-tool.d.ts +2 -1
- package/dist/src/harness/input-requests.d.ts +2 -1
- package/dist/src/harness/prompt-cache.d.ts +1 -9
- package/dist/src/harness/prompt-cache.js +0 -12
- package/dist/src/harness/runtime-actions.d.ts +2 -11
- package/dist/src/harness/runtime-actions.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +3 -2
- package/dist/src/harness/step-hooks.js +3 -7
- package/dist/src/harness/tool-loop.js +0 -2
- package/dist/src/harness/types.d.ts +1 -1
- package/dist/src/internal/application/package.js +2 -2
- package/dist/src/internal/application/runtime-compiled-artifacts-source.js +0 -1
- package/dist/src/internal/attachments/errors.d.ts +8 -2
- package/dist/src/internal/attachments/url-refs.d.ts +0 -1
- package/dist/src/internal/attachments/url-refs.js +1 -1
- package/dist/src/internal/authored-definition/channel.d.ts +0 -5
- package/dist/src/internal/authored-definition/channel.js +1 -10
- package/dist/src/internal/authored-definition/sandbox.d.ts +2 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +3 -2
- package/dist/src/internal/authored-module-loader.d.ts +0 -6
- package/dist/src/internal/authored-module-loader.js +0 -9
- package/dist/src/internal/authored-module.d.ts +0 -4
- package/dist/src/internal/authored-module.js +0 -10
- package/dist/src/internal/bundler/nitro-rolldown.d.ts +2 -10
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
- package/dist/src/{public → internal}/helpers/markdown.d.ts +2 -23
- package/dist/src/{public → internal}/helpers/markdown.js +1 -1
- package/dist/src/internal/logging.d.ts +2 -8
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.d.ts +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +2 -2
- package/dist/src/internal/nitro/routes/channel-dispatch.js +2 -2
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +0 -1
- package/dist/src/internal/node-esm-compat-banner.d.ts +1 -1
- package/dist/src/internal/runtime-registry.d.ts +2 -1
- package/dist/src/{protocol → internal}/vercel-agent-summary.d.ts +1 -1
- package/dist/src/protocol/message.d.ts +0 -34
- package/dist/src/protocol/message.js +0 -30
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/index.js +1 -1
- package/dist/src/public/channels/slack/api.d.ts +1 -7
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/connections.d.ts +2 -6
- package/dist/src/public/channels/slack/hitl.d.ts +3 -2
- package/dist/src/public/channels/slack/inbound.d.ts +0 -35
- package/dist/src/public/definitions/channel.d.ts +2 -2
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/defineChannel.d.ts +1 -1
- package/dist/src/public/definitions/defineChannel.js +1 -1
- package/dist/src/public/definitions/instructions.d.ts +0 -11
- package/dist/src/public/definitions/instructions.js +0 -5
- package/dist/src/public/definitions/tool.d.ts +3 -7
- package/dist/src/public/definitions/tool.js +1 -1
- package/dist/src/public/instructions/index.d.ts +1 -5
- package/dist/src/public/instructions/index.js +1 -3
- package/dist/src/public/tool-result-narrowing.d.ts +2 -1
- package/dist/src/react/use-ash-agent.d.ts +2 -1
- package/dist/src/react/use-ash-agent.js +1 -5
- package/dist/src/runtime/actions/types.d.ts +8 -50
- package/dist/src/runtime/actions/types.js +5 -21
- package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +2 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/channels/registry.js +3 -8
- package/dist/src/runtime/compiled-artifacts-source.d.ts +4 -11
- package/dist/src/runtime/compiled-artifacts-source.js +3 -7
- package/dist/src/runtime/connections/authorization-tokens.d.ts +1 -14
- package/dist/src/runtime/connections/authorization-tokens.js +2 -28
- package/dist/src/runtime/connections/principal-context.d.ts +3 -2
- package/dist/src/runtime/connections/validate-authorization.d.ts +0 -11
- package/dist/src/runtime/connections/validate-authorization.js +0 -16
- package/dist/src/runtime/framework-channels/index.d.ts +0 -1
- package/dist/src/runtime/framework-channels/index.js +1 -1
- package/dist/src/runtime/framework-tools/index.d.ts +2 -1
- package/dist/src/runtime/framework-tools/index.js +2 -1
- package/dist/src/runtime/framework-tools/skill.d.ts +0 -13
- package/dist/src/runtime/framework-tools/skill.js +1 -1
- package/dist/src/runtime/governance/auth/token-claims.d.ts +1 -16
- package/dist/src/runtime/governance/auth/token-claims.js +3 -3
- package/dist/src/runtime/governance/auth/types.d.ts +0 -4
- package/dist/src/runtime/governance/network/ip-allow-list.d.ts +0 -17
- package/dist/src/runtime/governance/network/ip-allow-list.js +0 -39
- package/dist/src/runtime/hooks/registry.d.ts +7 -4
- package/dist/src/runtime/hooks/registry.js +4 -2
- package/dist/src/runtime/loaders/bundled-artifacts.d.ts +0 -5
- package/dist/src/runtime/loaders/bundled-artifacts.js +0 -7
- package/dist/src/runtime/loaders/compile-metadata.d.ts +3 -10
- package/dist/src/runtime/loaders/compile-metadata.js +6 -8
- package/dist/src/runtime/loaders/manifest.d.ts +2 -2
- package/dist/src/runtime/loaders/manifest.js +4 -5
- package/dist/src/runtime/loaders/module-map.d.ts +2 -2
- package/dist/src/runtime/loaders/module-map.js +3 -4
- package/dist/src/runtime/prompt/compose.d.ts +2 -1
- package/dist/src/runtime/resolve-agent-graph.d.ts +2 -15
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/sandbox/keys.d.ts +2 -1
- package/dist/src/runtime/sandbox/registry.d.ts +3 -3
- package/dist/src/runtime/schedules/resolve-schedule.d.ts +3 -12
- package/dist/src/runtime/schedules/resolve-schedule.js +1 -1
- package/dist/src/runtime/sessions/auth.d.ts +2 -13
- package/dist/src/runtime/sessions/auth.js +1 -11
- package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
- package/dist/src/runtime/sessions/runtime-session.d.ts +0 -6
- package/dist/src/runtime/sessions/runtime-session.js +0 -13
- package/dist/src/runtime/sessions/turn.d.ts +2 -2
- package/dist/src/runtime/subagents/registry.d.ts +2 -5
- package/dist/src/runtime/subagents/registry.js +0 -6
- package/dist/src/runtime/tools/registry.d.ts +2 -1
- package/dist/src/runtime/tools/registry.js +1 -4
- package/dist/src/runtime/types.d.ts +4 -3
- package/dist/src/runtime/workspace/seed-files.d.ts +2 -1
- package/dist/src/services/dev-client/request-headers.d.ts +37 -8
- package/dist/src/services/dev-client/request-headers.js +71 -46
- package/dist/src/services/dev-client/stream.d.ts +0 -19
- package/dist/src/services/dev-client/stream.js +0 -37
- package/dist/src/services/dev-client/url.d.ts +3 -7
- package/dist/src/services/dev-client/url.js +4 -10
- package/dist/src/services/dev-client.d.ts +0 -12
- package/dist/src/services/dev-client.js +6 -92
- package/dist/src/shared/agent-definition.d.ts +1 -1
- package/dist/src/shared/json.d.ts +0 -4
- package/dist/src/shared/json.js +0 -38
- package/dist/src/shared/skill-definition.d.ts +0 -2
- package/package.json +1 -6
- package/dist/src/chunks/dev-authored-source-watcher-CBID_Dwh.js +0 -1
- package/dist/src/chunks/host-zBy9FyyX.js +0 -70
- package/dist/src/chunks/package-HUaeub_D.js +0 -1
- package/dist/src/chunks/paths-CebY5GCi.js +0 -89
- package/dist/src/chunks/types-DDA2QUED.js +0 -1
- package/dist/src/compiler/resource-files.d.ts +0 -19
- package/dist/src/compiler/resource-files.js +0 -28
- package/dist/src/execution/subagent-invocation.d.ts +0 -19
- package/dist/src/execution/subagent-invocation.js +0 -17
- package/dist/src/execution/task-mode.d.ts +0 -9
- package/dist/src/execution/task-mode.js +0 -12
- package/dist/src/execution/types.d.ts +0 -20
- package/dist/src/execution/types.js +0 -1
- package/dist/src/internal/logical-paths.d.ts +0 -13
- package/dist/src/internal/logical-paths.js +0 -25
- package/dist/src/runtime/sessions/messages.d.ts +0 -140
- package/dist/src/runtime/sessions/messages.js +0 -170
- package/dist/src/runtime/standard-schema.d.ts +0 -27
- package/dist/src/runtime/standard-schema.js +0 -64
- package/dist/src/services/dev-client/live-stream.d.ts +0 -35
- package/dist/src/services/dev-client/live-stream.js +0 -157
- package/dist/src/services/dev-client/send-message.d.ts +0 -24
- package/dist/src/services/dev-client/send-message.js +0 -185
- package/dist/src/services/dev-client/session.d.ts +0 -54
- package/dist/src/services/dev-client/session.js +0 -52
- package/dist/src/services/host.d.ts +0 -14
- package/dist/src/services/host.js +0 -13
- /package/dist/src/{package-name.d.ts → internal/package-name.d.ts} +0 -0
- /package/dist/src/{package-name.js → internal/package-name.js} +0 -0
- /package/dist/src/{protocol → internal}/vercel-agent-summary.js +0 -0
- /package/dist/src/{run-mode.d.ts → shared/run-mode.d.ts} +0 -0
- /package/dist/src/{run-mode.js → shared/run-mode.js} +0 -0
|
@@ -17,18 +17,12 @@ export interface RuntimeDiskCompiledArtifactsSource {
|
|
|
17
17
|
readonly kind: "disk";
|
|
18
18
|
/**
|
|
19
19
|
* Native filesystem path to the package-owned authored-source module map
|
|
20
|
-
* loader.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* loader. When set, the runtime loads modules directly from authored
|
|
21
|
+
* source instead of the bundled-compiled module map. Omitted in deployed
|
|
22
|
+
* runtimes, where the module map must come from the compiled artifact
|
|
23
|
+
* emitted by the build.
|
|
23
24
|
*/
|
|
24
25
|
readonly moduleMapLoaderPath?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Optional module-map loader override for package-internal dev/build flows.
|
|
27
|
-
*
|
|
28
|
-
* Omitted in deployed runtimes, where the module map must come from the
|
|
29
|
-
* compiled artifact emitted by the build.
|
|
30
|
-
*/
|
|
31
|
-
readonly moduleMapLoadMode?: "authored-source";
|
|
32
26
|
}
|
|
33
27
|
/**
|
|
34
28
|
* Creates the bundled compiled-artifact source.
|
|
@@ -38,7 +32,6 @@ export declare function createBundledRuntimeCompiledArtifactsSource(): RuntimeBu
|
|
|
38
32
|
* Creates the disk-backed compiled-artifact source for one authored app root.
|
|
39
33
|
*/
|
|
40
34
|
export declare function createDiskRuntimeCompiledArtifactsSource(appRoot: string, options?: {
|
|
41
|
-
readonly moduleMapLoadMode?: RuntimeDiskCompiledArtifactsSource["moduleMapLoadMode"];
|
|
42
35
|
readonly moduleMapLoaderPath?: string;
|
|
43
36
|
}): RuntimeDiskCompiledArtifactsSource;
|
|
44
37
|
/**
|
|
@@ -10,12 +10,11 @@ export function createBundledRuntimeCompiledArtifactsSource() {
|
|
|
10
10
|
* Creates the disk-backed compiled-artifact source for one authored app root.
|
|
11
11
|
*/
|
|
12
12
|
export function createDiskRuntimeCompiledArtifactsSource(appRoot, options = {}) {
|
|
13
|
-
if (options.
|
|
13
|
+
if (options.moduleMapLoaderPath !== undefined) {
|
|
14
14
|
return {
|
|
15
15
|
appRoot,
|
|
16
16
|
kind: "disk",
|
|
17
17
|
moduleMapLoaderPath: options.moduleMapLoaderPath,
|
|
18
|
-
moduleMapLoadMode: options.moduleMapLoadMode,
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
20
|
return {
|
|
@@ -36,11 +35,8 @@ export function getRuntimeCompiledArtifactsCacheKey(source) {
|
|
|
36
35
|
if (source.kind !== "disk") {
|
|
37
36
|
return "bundled";
|
|
38
37
|
}
|
|
39
|
-
if (source.
|
|
40
|
-
|
|
41
|
-
return `disk:${source.appRoot}:${source.moduleMapLoadMode}:${source.moduleMapLoaderPath}`;
|
|
42
|
-
}
|
|
43
|
-
return `disk:${source.appRoot}:${source.moduleMapLoadMode}`;
|
|
38
|
+
if (source.moduleMapLoaderPath !== undefined) {
|
|
39
|
+
return `disk:${source.appRoot}:authored-source:${source.moduleMapLoaderPath}`;
|
|
44
40
|
}
|
|
45
41
|
return `disk:${source.appRoot}`;
|
|
46
42
|
}
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
import type { AshContext } from "#context/container.js";
|
|
16
16
|
import { ContextKey } from "#context/key.js";
|
|
17
17
|
import type { TokenResult } from "#runtime/connections/types.js";
|
|
18
|
-
/**
|
|
19
|
-
* Inner map of `principalKey` → {@link TokenResult} for one connection.
|
|
20
|
-
*/
|
|
21
|
-
export type PrincipalTokenCache = Readonly<Record<string, TokenResult>>;
|
|
22
18
|
/**
|
|
23
19
|
* Virtual context key mapping connection name to a per-principal
|
|
24
20
|
* {@link TokenResult} cache.
|
|
@@ -35,7 +31,7 @@ export declare const ConnectionAuthorizationTokensKey: ContextKey<Readonly<Recor
|
|
|
35
31
|
* (not expired). Expired entries are treated as a cache miss so
|
|
36
32
|
* callers re-run the authorization flow.
|
|
37
33
|
*/
|
|
38
|
-
export declare function readCachedToken(ctx: AshContext, connectionName: string, principalKey: string
|
|
34
|
+
export declare function readCachedToken(ctx: AshContext, connectionName: string, principalKey: string): TokenResult | undefined;
|
|
39
35
|
/**
|
|
40
36
|
* Persists a freshly resolved {@link TokenResult} on the cache under
|
|
41
37
|
* `(connectionName, principalKey)`. Existing entries for other
|
|
@@ -45,12 +41,3 @@ export declare function readCachedToken(ctx: AshContext, connectionName: string,
|
|
|
45
41
|
* into the durable step payload. See the module docblock.
|
|
46
42
|
*/
|
|
47
43
|
export declare function writeCachedToken(ctx: AshContext, connectionName: string, principalKey: string, token: TokenResult): void;
|
|
48
|
-
/**
|
|
49
|
-
* Removes the cached token for `(connectionName, principalKey)`.
|
|
50
|
-
* Called when a connection's token is rejected downstream (for
|
|
51
|
-
* example the server returns 401 with the cached bearer) so the next
|
|
52
|
-
* `getToken` call runs fresh.
|
|
53
|
-
*
|
|
54
|
-
* Other principals' tokens on the same connection are preserved.
|
|
55
|
-
*/
|
|
56
|
-
export declare function clearCachedToken(ctx: AshContext, connectionName: string, principalKey: string): void;
|
|
@@ -29,11 +29,11 @@ export const ConnectionAuthorizationTokensKey = new ContextKey("ash.connectionAu
|
|
|
29
29
|
* (not expired). Expired entries are treated as a cache miss so
|
|
30
30
|
* callers re-run the authorization flow.
|
|
31
31
|
*/
|
|
32
|
-
export function readCachedToken(ctx, connectionName, principalKey
|
|
32
|
+
export function readCachedToken(ctx, connectionName, principalKey) {
|
|
33
33
|
const entry = ctx.get(ConnectionAuthorizationTokensKey)?.[connectionName]?.[principalKey];
|
|
34
34
|
if (entry === undefined)
|
|
35
35
|
return undefined;
|
|
36
|
-
if (entry.expiresAt !== undefined && entry.expiresAt <= now) {
|
|
36
|
+
if (entry.expiresAt !== undefined && entry.expiresAt <= Date.now()) {
|
|
37
37
|
return undefined;
|
|
38
38
|
}
|
|
39
39
|
return entry;
|
|
@@ -54,32 +54,6 @@ export function writeCachedToken(ctx, connectionName, principalKey, token) {
|
|
|
54
54
|
[connectionName]: { ...perConnection, [principalKey]: token },
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Removes the cached token for `(connectionName, principalKey)`.
|
|
59
|
-
* Called when a connection's token is rejected downstream (for
|
|
60
|
-
* example the server returns 401 with the cached bearer) so the next
|
|
61
|
-
* `getToken` call runs fresh.
|
|
62
|
-
*
|
|
63
|
-
* Other principals' tokens on the same connection are preserved.
|
|
64
|
-
*/
|
|
65
|
-
export function clearCachedToken(ctx, connectionName, principalKey) {
|
|
66
|
-
const existing = ctx.get(ConnectionAuthorizationTokensKey);
|
|
67
|
-
const perConnection = existing?.[connectionName];
|
|
68
|
-
if (existing === undefined || perConnection === undefined)
|
|
69
|
-
return;
|
|
70
|
-
if (perConnection[principalKey] === undefined)
|
|
71
|
-
return;
|
|
72
|
-
const nextPerConnection = { ...perConnection };
|
|
73
|
-
delete nextPerConnection[principalKey];
|
|
74
|
-
const next = { ...existing };
|
|
75
|
-
if (Object.keys(nextPerConnection).length === 0) {
|
|
76
|
-
delete next[connectionName];
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
next[connectionName] = nextPerConnection;
|
|
80
|
-
}
|
|
81
|
-
asContainer(ctx).setVirtualContext(ConnectionAuthorizationTokensKey, next);
|
|
82
|
-
}
|
|
83
57
|
/**
|
|
84
58
|
* Runtime installs `ContextContainer` as the concrete `AshContext`;
|
|
85
59
|
* we reach through the interface here because `setVirtualContext` is
|
|
@@ -42,13 +42,13 @@ import type { ConnectionPrincipal } from "#runtime/connections/types.js";
|
|
|
42
42
|
/**
|
|
43
43
|
* Per-connection principal overrides keyed by connection name.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
type ConnectionPrincipalOverrides = Readonly<Record<string, ConnectionPrincipal>>;
|
|
46
46
|
/**
|
|
47
47
|
* One frame on the principal-override stack. Frames are compared by
|
|
48
48
|
* object identity when popping so concurrent entries can
|
|
49
49
|
* deterministically remove the frame they pushed.
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
interface ConnectionPrincipalOverrideFrame {
|
|
52
52
|
readonly overrides: ConnectionPrincipalOverrides;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
@@ -98,3 +98,4 @@ export declare function lookupConnectionPrincipalOverride(ctx: {
|
|
|
98
98
|
* of the stack.
|
|
99
99
|
*/
|
|
100
100
|
export declare function withConnectionPrincipalOverride<T>(ctx: ContextContainer, overrides: ConnectionPrincipalOverrides, fn: () => Promise<T>): Promise<T>;
|
|
101
|
+
export {};
|
|
@@ -12,17 +12,6 @@ import type { AuthorizationDefinition } from "#runtime/connections/types.js";
|
|
|
12
12
|
* to prefix with its own context.
|
|
13
13
|
*/
|
|
14
14
|
export declare function validateAuthorizationSpec(authorization: unknown, fieldName?: string): string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Narrow convenience that asserts `auth` is structurally valid and mutates
|
|
17
|
-
* defaulted fields into place, otherwise throws an `Error` with the caller's
|
|
18
|
-
* `prefix` joined to the validation message.
|
|
19
|
-
*
|
|
20
|
-
* Most call sites want a richer error (e.g. `ResolveAgentError`
|
|
21
|
-
* with `logicalPath`/`sourceId`) and should call
|
|
22
|
-
* {@link validateAuthorizationSpec} directly and wrap themselves.
|
|
23
|
-
* This helper is for the simple prefix-and-throw case.
|
|
24
|
-
*/
|
|
25
|
-
export declare function assertAuthorizationSpec(authorization: unknown, prefix: string, fieldName?: string): asserts authorization is AuthorizationDefinition;
|
|
26
15
|
/**
|
|
27
16
|
* Validates and normalizes an authored auth definition into the runtime shape.
|
|
28
17
|
*
|
|
@@ -39,22 +39,6 @@ export function validateAuthorizationSpec(authorization, fieldName = "auth") {
|
|
|
39
39
|
}
|
|
40
40
|
return undefined;
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Narrow convenience that asserts `auth` is structurally valid and mutates
|
|
44
|
-
* defaulted fields into place, otherwise throws an `Error` with the caller's
|
|
45
|
-
* `prefix` joined to the validation message.
|
|
46
|
-
*
|
|
47
|
-
* Most call sites want a richer error (e.g. `ResolveAgentError`
|
|
48
|
-
* with `logicalPath`/`sourceId`) and should call
|
|
49
|
-
* {@link validateAuthorizationSpec} directly and wrap themselves.
|
|
50
|
-
* This helper is for the simple prefix-and-throw case.
|
|
51
|
-
*/
|
|
52
|
-
export function assertAuthorizationSpec(authorization, prefix, fieldName = "auth") {
|
|
53
|
-
const normalized = normalizeAuthorizationSpec(authorization, prefix, fieldName);
|
|
54
|
-
if (authorization !== null && typeof authorization === "object") {
|
|
55
|
-
Object.assign(authorization, normalized);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
42
|
/**
|
|
59
43
|
* Validates and normalizes an authored auth definition into the runtime shape.
|
|
60
44
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { ResolvedChannelDefinition } from "#runtime/types.js";
|
|
2
|
-
export declare const ASH_CHANNEL_NAME = "ash";
|
|
3
2
|
export declare function getFrameworkChannelDefinitions(): readonly ResolvedChannelDefinition[];
|
|
4
3
|
export declare function getAllFrameworkChannelNames(): ReadonlySet<string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { none, vercelOidc } from "#public/channels/auth.js";
|
|
2
2
|
import { ashChannel } from "#public/channels/ash.js";
|
|
3
3
|
import { getConnectionCallbackChannelDefinitions, getConnectionCallbackChannelNames, } from "#runtime/connections/callback-route.js";
|
|
4
|
-
|
|
4
|
+
const ASH_CHANNEL_NAME = "ash";
|
|
5
5
|
export function getFrameworkChannelDefinitions() {
|
|
6
6
|
const auth = resolveFrameworkAshAuth();
|
|
7
7
|
const compiled = ashChannel({ auth });
|
|
@@ -14,7 +14,8 @@ interface FrameworkToolConfig {
|
|
|
14
14
|
export declare function getFrameworkToolDefinitions(config: FrameworkToolConfig): readonly ResolvedToolDefinition[];
|
|
15
15
|
/**
|
|
16
16
|
* Returns the names of every framework-provided tool the framework knows
|
|
17
|
-
* about, regardless of whether the current agent
|
|
17
|
+
* about, regardless of whether the current agent gates any of them on
|
|
18
|
+
* runtime configuration.
|
|
18
19
|
*
|
|
19
20
|
* Used by the graph resolver to validate `disableTool(name)` arguments —
|
|
20
21
|
* disabling a name that does not match any known framework tool is treated
|
|
@@ -40,7 +40,8 @@ export function getFrameworkToolDefinitions(config) {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Returns the names of every framework-provided tool the framework knows
|
|
43
|
-
* about, regardless of whether the current agent
|
|
43
|
+
* about, regardless of whether the current agent gates any of them on
|
|
44
|
+
* runtime configuration.
|
|
44
45
|
*
|
|
45
46
|
* Used by the graph resolver to validate `disableTool(name)` arguments —
|
|
46
47
|
* disabling a name that does not match any known framework tool is treated
|
|
@@ -1,15 +1,2 @@
|
|
|
1
1
|
import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Typed input accepted by {@link executeLoadSkillTool}.
|
|
4
|
-
*/
|
|
5
|
-
export interface LoadSkillInput {
|
|
6
|
-
readonly skill: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Executes the `load_skill` tool.
|
|
10
|
-
*
|
|
11
|
-
* Reads the requested skill's `SKILL.md` from the active sandbox and
|
|
12
|
-
* returns it as the tool result.
|
|
13
|
-
*/
|
|
14
|
-
export declare function executeLoadSkillTool(args: LoadSkillInput): Promise<unknown>;
|
|
15
2
|
export declare const SKILL_TOOL_DEFINITION: ResolvedToolDefinition;
|
|
@@ -7,7 +7,7 @@ import { loadSkillFromSandbox } from "#runtime/skills/sandbox-access.js";
|
|
|
7
7
|
* Reads the requested skill's `SKILL.md` from the active sandbox and
|
|
8
8
|
* returns it as the tool result.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
async function executeLoadSkillTool(args) {
|
|
11
11
|
const ctx = loadContext();
|
|
12
12
|
const sandbox = ctx.get(SandboxKey);
|
|
13
13
|
if (sandbox === undefined) {
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import type { JWTPayload } from "#compiled/jose/index.js";
|
|
2
|
-
import type { AuthenticatedCallerPrincipal, ResolvedTokenClaimMatchers
|
|
3
|
-
/**
|
|
4
|
-
* Returns the normalized string-valued JWT claim projection used by Ash's
|
|
5
|
-
* runtime auth layer.
|
|
6
|
-
*/
|
|
7
|
-
export declare function normalizeJwtClaims(payload: JWTPayload): RouteAuthAttributes;
|
|
8
|
-
/**
|
|
9
|
-
* Returns the non-standard string-valued JWT claim projection exposed as public
|
|
10
|
-
* session auth attributes.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createJwtAttributeProjection(payload: JWTPayload): RouteAuthAttributes;
|
|
2
|
+
import type { AuthenticatedCallerPrincipal, ResolvedTokenClaimMatchers } from "#runtime/governance/auth/types.js";
|
|
13
3
|
/**
|
|
14
4
|
* Returns whether the verified JWT payload satisfies the authored subject and
|
|
15
5
|
* claim selectors.
|
|
@@ -23,8 +13,3 @@ export declare function createJwtAuthenticatedCallerPrincipal(input: {
|
|
|
23
13
|
readonly payload: JWTPayload;
|
|
24
14
|
readonly principalType: AuthenticatedCallerPrincipal["principalType"];
|
|
25
15
|
}): AuthenticatedCallerPrincipal;
|
|
26
|
-
/**
|
|
27
|
-
* Returns whether the value matches one AWS IAM-style whole-string wildcard
|
|
28
|
-
* pattern where `*` matches zero or more characters.
|
|
29
|
-
*/
|
|
30
|
-
export declare function matchesWildcardPattern(pattern: string, value: string): boolean;
|
|
@@ -3,7 +3,7 @@ const STANDARD_PROJECTED_CLAIM_KEYS = new Set(["aud", "exp", "iat", "iss", "jti"
|
|
|
3
3
|
* Returns the normalized string-valued JWT claim projection used by Ash's
|
|
4
4
|
* runtime auth layer.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
function normalizeJwtClaims(payload) {
|
|
7
7
|
const normalized = {};
|
|
8
8
|
for (const [key, value] of Object.entries(payload)) {
|
|
9
9
|
if (typeof value === "string") {
|
|
@@ -20,7 +20,7 @@ export function normalizeJwtClaims(payload) {
|
|
|
20
20
|
* Returns the non-standard string-valued JWT claim projection exposed as public
|
|
21
21
|
* session auth attributes.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
function createJwtAttributeProjection(payload) {
|
|
24
24
|
const claims = normalizeJwtClaims(payload);
|
|
25
25
|
return Object.freeze(Object.fromEntries(Object.entries(claims).filter(([key]) => !STANDARD_PROJECTED_CLAIM_KEYS.has(key))));
|
|
26
26
|
}
|
|
@@ -75,7 +75,7 @@ export function createJwtAuthenticatedCallerPrincipal(input) {
|
|
|
75
75
|
* Returns whether the value matches one AWS IAM-style whole-string wildcard
|
|
76
76
|
* pattern where `*` matches zero or more characters.
|
|
77
77
|
*/
|
|
78
|
-
|
|
78
|
+
function matchesWildcardPattern(pattern, value) {
|
|
79
79
|
if (!pattern.includes("*")) {
|
|
80
80
|
return pattern === value;
|
|
81
81
|
}
|
|
@@ -77,10 +77,6 @@ export interface ResolvedOidcAuthStrategy extends ResolvedTokenClaimMatchers {
|
|
|
77
77
|
readonly issuer: string;
|
|
78
78
|
readonly kind: "oidc";
|
|
79
79
|
}
|
|
80
|
-
/**
|
|
81
|
-
* One resolved route-auth strategy authored in `agent.ts`.
|
|
82
|
-
*/
|
|
83
|
-
export type ResolvedAuthStrategy = ResolvedHttpBasicAuthStrategy | ResolvedJwtEcdsaAuthStrategy | ResolvedJwtHmacAuthStrategy | ResolvedOidcAuthStrategy;
|
|
84
80
|
/**
|
|
85
81
|
* Internal strategy verification outcomes used by the route-auth orchestrator.
|
|
86
82
|
*/
|
|
@@ -15,20 +15,3 @@ export declare function createRuntimeIpAllowList(entries: readonly string[]): Ru
|
|
|
15
15
|
* entry.
|
|
16
16
|
*/
|
|
17
17
|
export declare function isRuntimeIpAllowed(address: string, allowList: RuntimeIpAllowList): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Resolves the first trusted request IP candidate from the request headers
|
|
20
|
-
* and the platform-supplied socket peer IP.
|
|
21
|
-
*
|
|
22
|
-
* On Vercel, the `x-vercel-forwarded-for` header carries the original
|
|
23
|
-
* caller's IP through the platform proxies and takes precedence over the
|
|
24
|
-
* socket-level address. Off Vercel, the socket address (passed in by the
|
|
25
|
-
* host plumbing) is the source of truth.
|
|
26
|
-
*
|
|
27
|
-
* `socketIp` is `null` when the host can't observe a peer IP (e.g. during
|
|
28
|
-
* unit tests). The function returns `null` when neither candidate yields a
|
|
29
|
-
* valid normalized IP.
|
|
30
|
-
*/
|
|
31
|
-
export declare function resolveTrustedRequestIp(input: {
|
|
32
|
-
readonly headers: Headers;
|
|
33
|
-
readonly socketIp: string | null;
|
|
34
|
-
}): string | null;
|
|
@@ -42,45 +42,6 @@ export function isRuntimeIpAllowed(address, allowList) {
|
|
|
42
42
|
const family = getIpFamily(normalizedAddress);
|
|
43
43
|
return allowList.blockList.check(normalizedAddress, family);
|
|
44
44
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Resolves the first trusted request IP candidate from the request headers
|
|
47
|
-
* and the platform-supplied socket peer IP.
|
|
48
|
-
*
|
|
49
|
-
* On Vercel, the `x-vercel-forwarded-for` header carries the original
|
|
50
|
-
* caller's IP through the platform proxies and takes precedence over the
|
|
51
|
-
* socket-level address. Off Vercel, the socket address (passed in by the
|
|
52
|
-
* host plumbing) is the source of truth.
|
|
53
|
-
*
|
|
54
|
-
* `socketIp` is `null` when the host can't observe a peer IP (e.g. during
|
|
55
|
-
* unit tests). The function returns `null` when neither candidate yields a
|
|
56
|
-
* valid normalized IP.
|
|
57
|
-
*/
|
|
58
|
-
export function resolveTrustedRequestIp(input) {
|
|
59
|
-
const headerCandidates = process.env.VERCEL === "1" ? [input.headers.get("x-vercel-forwarded-for")] : [];
|
|
60
|
-
for (const candidate of headerCandidates) {
|
|
61
|
-
const resolved = selectForwardedIpCandidate(candidate);
|
|
62
|
-
if (resolved !== null) {
|
|
63
|
-
return resolved;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return input.socketIp === null ? null : normalizeIfValidIp(input.socketIp);
|
|
67
|
-
}
|
|
68
|
-
function selectForwardedIpCandidate(value) {
|
|
69
|
-
if (value === null) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
for (const part of value.split(",")) {
|
|
73
|
-
const normalized = normalizeIfValidIp(part);
|
|
74
|
-
if (normalized !== null) {
|
|
75
|
-
return normalized;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
function normalizeIfValidIp(value) {
|
|
81
|
-
const normalized = normalizeIpAddress(value);
|
|
82
|
-
return isIP(normalized) === 0 ? null : normalized;
|
|
83
|
-
}
|
|
84
45
|
function normalizeIpAddress(value) {
|
|
85
46
|
const trimmed = value.trim().replace(/^\[(.*)\]$/, "$1");
|
|
86
47
|
const percentIndex = trimmed.indexOf("%");
|
|
@@ -4,7 +4,7 @@ import type { ResolvedHookDefinition } from "../types.js";
|
|
|
4
4
|
* One ordered lifecycle subscriber paired with the slug of its source.
|
|
5
5
|
* The slug is used for diagnostics.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
interface RuntimeLifecycleHookEntry {
|
|
8
8
|
readonly slug: string;
|
|
9
9
|
readonly handler: LifecycleHook;
|
|
10
10
|
}
|
|
@@ -14,7 +14,7 @@ export interface RuntimeLifecycleHookEntry {
|
|
|
14
14
|
* `eventType` is `"*"` for wildcard subscribers, otherwise the typed
|
|
15
15
|
* event name.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
interface RuntimeStreamEventHookEntry {
|
|
18
18
|
readonly slug: string;
|
|
19
19
|
readonly handler: StreamEventHook<unknown>;
|
|
20
20
|
readonly eventType: string;
|
|
@@ -37,8 +37,10 @@ export interface RuntimeHookRegistry {
|
|
|
37
37
|
readonly streamEventsWildcard: readonly RuntimeStreamEventHookEntry[];
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Returns an empty registry
|
|
41
|
-
*
|
|
40
|
+
* Returns an empty registry. Used by tests that build a runtime bundle
|
|
41
|
+
* stub without authored hooks — production registries are constructed
|
|
42
|
+
* via {@link createRuntimeHookRegistry} from the resolved authored
|
|
43
|
+
* graph.
|
|
42
44
|
*/
|
|
43
45
|
export declare function createEmptyHookRegistry(): RuntimeHookRegistry;
|
|
44
46
|
/**
|
|
@@ -50,3 +52,4 @@ export declare function createEmptyHookRegistry(): RuntimeHookRegistry;
|
|
|
50
52
|
* helper, so callers usually pass `resolvedHooks` directly.
|
|
51
53
|
*/
|
|
52
54
|
export declare function createRuntimeHookRegistry(resolvedHooks: readonly ResolvedHookDefinition[]): RuntimeHookRegistry;
|
|
55
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns an empty registry
|
|
3
|
-
*
|
|
2
|
+
* Returns an empty registry. Used by tests that build a runtime bundle
|
|
3
|
+
* stub without authored hooks — production registries are constructed
|
|
4
|
+
* via {@link createRuntimeHookRegistry} from the resolved authored
|
|
5
|
+
* graph.
|
|
4
6
|
*/
|
|
5
7
|
export function createEmptyHookRegistry() {
|
|
6
8
|
return {
|
|
@@ -17,11 +17,6 @@ export interface BundledCompiledArtifacts {
|
|
|
17
17
|
* scoped session so tests cannot leak installations across each other.
|
|
18
18
|
*/
|
|
19
19
|
export declare function installBundledCompiledArtifacts(input: BundledCompiledArtifacts): void;
|
|
20
|
-
/**
|
|
21
|
-
* Clears the installed bundled compiled-artifact snapshot on the active
|
|
22
|
-
* runtime session.
|
|
23
|
-
*/
|
|
24
|
-
export declare function resetBundledCompiledArtifacts(): void;
|
|
25
20
|
/**
|
|
26
21
|
* Reads the bundled compiled-artifact snapshot for the active runtime
|
|
27
22
|
* session, or `null` if none has been installed.
|
|
@@ -12,13 +12,6 @@ export function installBundledCompiledArtifacts(input) {
|
|
|
12
12
|
moduleMap: input.moduleMap,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Clears the installed bundled compiled-artifact snapshot on the active
|
|
17
|
-
* runtime session.
|
|
18
|
-
*/
|
|
19
|
-
export function resetBundledCompiledArtifacts() {
|
|
20
|
-
getActiveRuntimeSession().compiledArtifacts = null;
|
|
21
|
-
}
|
|
22
15
|
/**
|
|
23
16
|
* Reads the bundled compiled-artifact snapshot for the active runtime
|
|
24
17
|
* session, or `null` if none has been installed.
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CompileMetadata } from "#compiler/artifacts.js";
|
|
2
2
|
import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";
|
|
3
3
|
/**
|
|
4
4
|
* Input for loading compile metadata from disk or bundled artifacts.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
interface LoadCompileMetadataInput {
|
|
7
7
|
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
|
|
8
|
-
readonly metadataPath?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Error raised when compile metadata cannot be loaded or validated.
|
|
12
|
-
*/
|
|
13
|
-
export declare class LoadCompileMetadataError extends Error {
|
|
14
|
-
readonly metadataPath?: string;
|
|
15
|
-
constructor(message: string, metadataPath?: string);
|
|
16
8
|
}
|
|
17
9
|
/**
|
|
18
10
|
* Loads and validates compile metadata when it is available for the current
|
|
19
11
|
* artifact source.
|
|
20
12
|
*/
|
|
21
13
|
export declare function loadCompileMetadata(input: LoadCompileMetadataInput): Promise<CompileMetadata | null>;
|
|
14
|
+
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { z } from "#compiled/zod/index.js";
|
|
2
|
+
import { COMPILE_METADATA_KIND, COMPILE_METADATA_VERSION, } from "#compiler/artifacts.js";
|
|
2
3
|
import { formatValidationError } from "#runtime/validation.js";
|
|
3
4
|
import { resolveRuntimeCompilerArtifactPaths } from "#runtime/loaders/artifact-paths.js";
|
|
4
5
|
import { readBundledCompiledArtifacts } from "#runtime/loaders/bundled-artifacts.js";
|
|
5
|
-
const COMPILE_METADATA_KIND = "ash-compile-metadata";
|
|
6
|
-
const COMPILE_METADATA_VERSION = 5;
|
|
7
6
|
const compileArtifactDigestSchema = z
|
|
8
7
|
.object({
|
|
9
8
|
path: z.string(),
|
|
@@ -45,7 +44,7 @@ const BUNDLED_COMPILE_METADATA_SOURCE = "bundled compile metadata";
|
|
|
45
44
|
/**
|
|
46
45
|
* Error raised when compile metadata cannot be loaded or validated.
|
|
47
46
|
*/
|
|
48
|
-
|
|
47
|
+
class LoadCompileMetadataError extends Error {
|
|
49
48
|
metadataPath;
|
|
50
49
|
constructor(message, metadataPath) {
|
|
51
50
|
super(message);
|
|
@@ -60,11 +59,10 @@ export class LoadCompileMetadataError extends Error {
|
|
|
60
59
|
* artifact source.
|
|
61
60
|
*/
|
|
62
61
|
export async function loadCompileMetadata(input) {
|
|
63
|
-
const metadataPath = input.
|
|
64
|
-
(input.compiledArtifactsSource.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
: undefined);
|
|
62
|
+
const metadataPath = input.compiledArtifactsSource.kind === "disk"
|
|
63
|
+
? resolveRuntimeCompilerArtifactPaths(input.compiledArtifactsSource.appRoot)
|
|
64
|
+
.compileMetadataPath
|
|
65
|
+
: undefined;
|
|
68
66
|
if (metadataPath !== undefined) {
|
|
69
67
|
const { readFile } = await import("node:fs/promises");
|
|
70
68
|
let metadataJson;
|
|
@@ -4,9 +4,8 @@ import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts
|
|
|
4
4
|
* Input for loading the compiled source manifest from disk or the bundled
|
|
5
5
|
* runtime alias.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
interface LoadCompiledManifestInput {
|
|
8
8
|
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
|
|
9
|
-
manifestPath?: string;
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
11
|
* Error raised when the compiled manifest cannot be loaded or validated.
|
|
@@ -19,3 +18,4 @@ export declare class LoadCompiledManifestError extends Error {
|
|
|
19
18
|
* Loads and validates the compiler-owned source manifest.
|
|
20
19
|
*/
|
|
21
20
|
export declare function loadCompiledManifest(input: LoadCompiledManifestInput): Promise<CompiledAgentManifest>;
|
|
21
|
+
export {};
|
|
@@ -20,11 +20,10 @@ export class LoadCompiledManifestError extends Error {
|
|
|
20
20
|
* Loads and validates the compiler-owned source manifest.
|
|
21
21
|
*/
|
|
22
22
|
export async function loadCompiledManifest(input) {
|
|
23
|
-
const manifestPath = input.
|
|
24
|
-
(input.compiledArtifactsSource.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
: undefined);
|
|
23
|
+
const manifestPath = input.compiledArtifactsSource.kind === "disk"
|
|
24
|
+
? resolveRuntimeCompilerArtifactPaths(input.compiledArtifactsSource.appRoot)
|
|
25
|
+
.compiledManifestPath
|
|
26
|
+
: undefined;
|
|
28
27
|
if (manifestPath !== undefined) {
|
|
29
28
|
const { readFile } = await import("node:fs/promises");
|
|
30
29
|
let manifestJson;
|
|
@@ -4,9 +4,8 @@ import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts
|
|
|
4
4
|
* Input for loading the compiled module map from disk or the bundled runtime
|
|
5
5
|
* alias.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
interface LoadCompiledModuleMapInput {
|
|
8
8
|
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
|
|
9
|
-
moduleMapPath?: string;
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
11
|
* Error raised when the compiled module map cannot be loaded or validated.
|
|
@@ -19,3 +18,4 @@ export declare class LoadCompiledModuleMapError extends Error {
|
|
|
19
18
|
* Loads and validates the compiler-owned module map.
|
|
20
19
|
*/
|
|
21
20
|
export declare function loadCompiledModuleMap(input: LoadCompiledModuleMapInput): Promise<CompiledModuleMap>;
|
|
21
|
+
export {};
|
|
@@ -20,10 +20,9 @@ export class LoadCompiledModuleMapError extends Error {
|
|
|
20
20
|
* Loads and validates the compiler-owned module map.
|
|
21
21
|
*/
|
|
22
22
|
export async function loadCompiledModuleMap(input) {
|
|
23
|
-
const moduleMapPath = input.
|
|
24
|
-
(input.compiledArtifactsSource.
|
|
25
|
-
|
|
26
|
-
: undefined);
|
|
23
|
+
const moduleMapPath = input.compiledArtifactsSource.kind === "disk"
|
|
24
|
+
? resolveRuntimeCompilerArtifactPaths(input.compiledArtifactsSource.appRoot).moduleMapPath
|
|
25
|
+
: undefined;
|
|
27
26
|
if (moduleMapPath !== undefined) {
|
|
28
27
|
const moduleMapImportSpecifier = createFileImportSpecifier(moduleMapPath);
|
|
29
28
|
try {
|
|
@@ -4,7 +4,7 @@ import type { WorkspaceRuntimeSpec } from "#runtime/workspace/types.js";
|
|
|
4
4
|
* Input for composing the base authored instructions prompt for one
|
|
5
5
|
* resolved agent.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
interface ComposeRuntimeBasePromptInput {
|
|
8
8
|
connections?: readonly ResolvedConnectionDefinition[];
|
|
9
9
|
instructions?: ResolvedInstructions;
|
|
10
10
|
skills?: readonly ResolvedSkillDefinition[];
|
|
@@ -16,3 +16,4 @@ export interface ComposeRuntimeBasePromptInput {
|
|
|
16
16
|
* without flattening skills into always-on instructions.
|
|
17
17
|
*/
|
|
18
18
|
export declare function composeRuntimeBasePrompt(input: ComposeRuntimeBasePromptInput): readonly string[];
|
|
19
|
+
export {};
|