experimental-ash 0.2.0-alpha.22 → 0.2.0-alpha.23
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/dist/src/context/key.d.ts +1 -1
- package/dist/src/context/key.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/public/context/index.d.ts +17 -0
- package/dist/src/public/context/index.d.ts.map +1 -0
- package/dist/src/public/context/index.js +15 -0
- package/dist/src/public/context/index.js.map +1 -0
- package/dist/src/public/index.d.ts +1 -7
- package/dist/src/public/index.d.ts.map +1 -1
- package/dist/src/public/index.js +0 -3
- package/dist/src/public/index.js.map +1 -1
- package/dist/src/public/sandboxes/index.d.ts +1 -0
- package/dist/src/public/sandboxes/index.d.ts.map +1 -1
- package/dist/src/public/sandboxes/index.js +1 -0
- package/dist/src/public/sandboxes/index.js.map +1 -1
- package/dist/src/public/skills/index.d.ts +24 -0
- package/dist/src/public/skills/index.d.ts.map +1 -0
- package/dist/src/public/skills/index.js +23 -0
- package/dist/src/public/skills/index.js.map +1 -0
- package/docs/public/sandboxes.md +1 -1
- package/docs/public/session-context.md +4 -4
- package/docs/public/skills.md +2 -2
- package/docs/public/tools.md +4 -4
- package/docs/public/typescript-api.md +34 -25
- package/package.json +11 -1
|
@@ -47,7 +47,7 @@ export interface ContextKeyOptions<T> {
|
|
|
47
47
|
*
|
|
48
48
|
* @example Declare a durable context key and use it from a tool
|
|
49
49
|
* ```ts
|
|
50
|
-
* import { ContextKey, getContext, setContext } from "experimental-ash";
|
|
50
|
+
* import { ContextKey, getContext, setContext } from "experimental-ash/context";
|
|
51
51
|
* import { defineTool } from "experimental-ash/tools";
|
|
52
52
|
* import { z } from "zod";
|
|
53
53
|
*
|
package/dist/src/context/key.js
CHANGED
|
@@ -18,7 +18,7 @@ const keyRegistry = new Map();
|
|
|
18
18
|
*
|
|
19
19
|
* @example Declare a durable context key and use it from a tool
|
|
20
20
|
* ```ts
|
|
21
|
-
* import { ContextKey, getContext, setContext } from "experimental-ash";
|
|
21
|
+
* import { ContextKey, getContext, setContext } from "experimental-ash/context";
|
|
22
22
|
* import { defineTool } from "experimental-ash/tools";
|
|
23
23
|
* import { z } from "zod";
|
|
24
24
|
*
|
|
@@ -6,7 +6,7 @@ import { ASH_PACKAGE_NAME } from "../../package-name.js";
|
|
|
6
6
|
let cachedPackageInfo;
|
|
7
7
|
// The package build stamps the published version into `dist` so bundled
|
|
8
8
|
// deployments can still report package metadata without resolving package.json.
|
|
9
|
-
const BUNDLED_FALLBACK_PACKAGE_VERSION = "0.2.0-alpha.
|
|
9
|
+
const BUNDLED_FALLBACK_PACKAGE_VERSION = "0.2.0-alpha.23";
|
|
10
10
|
const BUNDLED_FALLBACK_PACKAGE_VERSION_PLACEHOLDER = "__ASH_PACKAGE_VERSION_PLACEHOLDER__";
|
|
11
11
|
function resolveFallbackPackageVersion() {
|
|
12
12
|
return BUNDLED_FALLBACK_PACKAGE_VERSION === BUNDLED_FALLBACK_PACKAGE_VERSION_PLACEHOLDER
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime context helpers for authored code.
|
|
3
|
+
*
|
|
4
|
+
* These APIs work only inside active authored runtime execution such as
|
|
5
|
+
* tools and other Ash-invoked callbacks. They read from a single
|
|
6
|
+
* `AshContext` container bound via `AsyncLocalStorage`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { ContextKey, getContext, setContext } from "experimental-ash/context";
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export { ensureContext, getContext, getSession, hasContext, requireContext, type Session, type SessionAuth, type SessionAuthContext, type SessionParent, type SessionTurn, setContext, } from "../../context/accessors.js";
|
|
14
|
+
export type { AshContext } from "../../context/container.js";
|
|
15
|
+
export { type ContextAccessor, ContextKey, type ContextKeyOptions, } from "../../context/key.js";
|
|
16
|
+
export type { ContextProvider, ContextReader } from "../../context/provider.js";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/public/context/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,UAAU,GACX,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EACL,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,iBAAiB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime context helpers for authored code.
|
|
3
|
+
*
|
|
4
|
+
* These APIs work only inside active authored runtime execution such as
|
|
5
|
+
* tools and other Ash-invoked callbacks. They read from a single
|
|
6
|
+
* `AshContext` container bound via `AsyncLocalStorage`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { ContextKey, getContext, setContext } from "experimental-ash/context";
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export { ensureContext, getContext, getSession, hasContext, requireContext, setContext, } from "../../context/accessors.js";
|
|
14
|
+
export { ContextKey, } from "../../context/key.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/public/context/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EAMd,UAAU,GACX,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEL,UAAU,GAEX,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
export { HttpChannel } from "../channel/http-channel.js";
|
|
2
2
|
export { ScheduleChannel, ScheduleDispatcher, type ScheduleTriggerInput, } from "../channel/schedule.js";
|
|
3
3
|
export { SlackChannel } from "../channel/slack-channel.js";
|
|
4
|
-
export { Channel, type ChannelClass, type
|
|
5
|
-
export { ensureContext, getContext, getSandbox, getSession, getSkill, hasContext, requireContext, type Session, type SessionAuth, type SessionAuthContext, type SessionParent, type SessionTurn, setContext, } from "../context/accessors.js";
|
|
6
|
-
export type { AshContext } from "../context/container.js";
|
|
7
|
-
export { ContextKey, type ContextKeyOptions } from "../context/key.js";
|
|
8
|
-
export type { ContextProvider, ContextReader } from "../context/provider.js";
|
|
4
|
+
export { Channel, type ChannelClass, type DeliverInput, type EventEmitFn, type RunHandle, type RunInput, type RunResult, type Runtime, } from "../channel/types.js";
|
|
9
5
|
export { createContinuousLoopRuntime } from "../execution/continuous-runtime.js";
|
|
10
|
-
export type { SkillHandle, SkillResource } from "../execution/skills/types.js";
|
|
11
6
|
export { createWorkflowRuntime } from "../execution/workflow-runtime.js";
|
|
12
7
|
export type { HarnessToolDefinition, ToolExecutionResult } from "../harness/execute-tool.js";
|
|
13
8
|
export { createToolLoopHarness } from "../harness/tool-loop.js";
|
|
@@ -18,7 +13,6 @@ export { inputOptionSchema, inputRequestSchema, inputResponseSchema, isInputRequ
|
|
|
18
13
|
export { type AgentCompactionDefinition, type AgentDefinition, type AgentModelDefinition, type AgentModelOptionsDefinition, defineAgent, } from "./definitions/agent.js";
|
|
19
14
|
export { type Agent, type ChannelMethod, type DisabledRouteSentinel, defineRoute, disableRoute, isDisabledRouteSentinel, isRouteDefinition, type Route, type RouteContext, } from "./definitions/channel.js";
|
|
20
15
|
export { defineSchedule, type ScheduleDefinition } from "./definitions/schedule.js";
|
|
21
|
-
export { defineSkill, type SkillDefinition } from "./definitions/skill.js";
|
|
22
16
|
export type { ModuleDefinitionExport } from "./definitions/source.js";
|
|
23
17
|
export { defineSubagent, type SubagentDefinition, } from "./definitions/subagent.js";
|
|
24
18
|
export { defineSystem, type SystemDefinition } from "./definitions/system.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,oBAAoB,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,oBAAoB,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,OAAO,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EACV,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,aAAa,GACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,KAAK,EACV,KAAK,YAAY,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpF,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACL,cAAc,EACd,KAAK,kBAAkB,GACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EACL,KAAK,uBAAuB,EAC5B,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,qBAAqB,GACtB,MAAM,uBAAuB,CAAC"}
|
package/dist/src/public/index.js
CHANGED
|
@@ -2,8 +2,6 @@ export { HttpChannel } from "../channel/http-channel.js";
|
|
|
2
2
|
export { ScheduleChannel, ScheduleDispatcher, } from "../channel/schedule.js";
|
|
3
3
|
export { SlackChannel } from "../channel/slack-channel.js";
|
|
4
4
|
export { Channel, } from "../channel/types.js";
|
|
5
|
-
export { ensureContext, getContext, getSandbox, getSession, getSkill, hasContext, requireContext, setContext, } from "../context/accessors.js";
|
|
6
|
-
export { ContextKey } from "../context/key.js";
|
|
7
5
|
export { createContinuousLoopRuntime } from "../execution/continuous-runtime.js";
|
|
8
6
|
export { createWorkflowRuntime } from "../execution/workflow-runtime.js";
|
|
9
7
|
export { createToolLoopHarness } from "../harness/tool-loop.js";
|
|
@@ -11,7 +9,6 @@ export { inputOptionSchema, inputRequestSchema, inputResponseSchema, isInputRequ
|
|
|
11
9
|
export { defineAgent, } from "./definitions/agent.js";
|
|
12
10
|
export { defineRoute, disableRoute, isDisabledRouteSentinel, isRouteDefinition, } from "./definitions/channel.js";
|
|
13
11
|
export { defineSchedule } from "./definitions/schedule.js";
|
|
14
|
-
export { defineSkill } from "./definitions/skill.js";
|
|
15
12
|
export { defineSubagent, } from "./definitions/subagent.js";
|
|
16
13
|
export { defineSystem } from "./definitions/system.js";
|
|
17
14
|
export { lowerScheduleMarkdown, lowerSkillMarkdown, lowerSystemMarkdown, parseMarkdownDocument, } from "./helpers/markdown.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,eAAe,EACf,kBAAkB,GAEnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,eAAe,EACf,kBAAkB,GAEnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,OAAO,GAQR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAsBhE,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAKL,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,GAGlB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,cAAc,EAA2B,MAAM,2BAA2B,CAAC;AAEpF,OAAO,EACL,cAAc,GAEf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAyB,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAEL,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EAEnB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC"}
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* });
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
+
export { getSandbox } from "../../context/accessors.js";
|
|
29
30
|
export { type AshRuntimeSandboxMap, defineSandbox, type SandboxCommandResult, type SandboxDefinition, type SandboxLifecycleContext, type SandboxName, type SandboxReadFileOptions, type SandboxSession, } from "../definitions/sandbox.js";
|
|
30
31
|
export type { SandboxBackend, SandboxBackendCreateInput, SandboxBackendHandle, SandboxBackendPrewarmInput, SandboxBackendRuntimeContext, SandboxBackendSessionState, SandboxSeedFile, SandboxSeedFilesProvider, } from "../definitions/sandbox-backend.js";
|
|
31
32
|
export { defaultBackend } from "./backends/default.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/public/sandboxes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,KAAK,oBAAoB,EACzB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,GACpB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,GACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/public/sandboxes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EACL,KAAK,oBAAoB,EACzB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,GACpB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,GACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/public/sandboxes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAEL,aAAa,GAOd,MAAM,2BAA2B,CAAC;AAWnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/public/sandboxes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAEL,aAAa,GAOd,MAAM,2BAA2B,CAAC;AAWnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill authoring helpers and runtime accessors.
|
|
3
|
+
*
|
|
4
|
+
* Use {@link defineSkill} to author a skill in TypeScript with the same
|
|
5
|
+
* shape that discovery produces from markdown. Use {@link getSkill} at
|
|
6
|
+
* runtime inside authored code to read skill metadata and packaged files.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { defineSkill } from "experimental-ash/skills";
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { getSkill } from "experimental-ash/skills";
|
|
16
|
+
*
|
|
17
|
+
* const research = getSkill("research");
|
|
18
|
+
* const notes = await research.reference("checklist.md").text();
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export { getSkill } from "../../context/accessors.js";
|
|
22
|
+
export type { SkillHandle, SkillResource } from "../../execution/skills/types.js";
|
|
23
|
+
export { defineSkill, type SkillDefinition } from "../definitions/skill.js";
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/public/skills/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill authoring helpers and runtime accessors.
|
|
3
|
+
*
|
|
4
|
+
* Use {@link defineSkill} to author a skill in TypeScript with the same
|
|
5
|
+
* shape that discovery produces from markdown. Use {@link getSkill} at
|
|
6
|
+
* runtime inside authored code to read skill metadata and packaged files.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { defineSkill } from "experimental-ash/skills";
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { getSkill } from "experimental-ash/skills";
|
|
16
|
+
*
|
|
17
|
+
* const research = getSkill("research");
|
|
18
|
+
* const notes = await research.reference("checklist.md").text();
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export { getSkill } from "../../context/accessors.js";
|
|
22
|
+
export { defineSkill } from "../definitions/skill.js";
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/public/skills/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAwB,MAAM,yBAAyB,CAAC"}
|
package/docs/public/sandboxes.md
CHANGED
|
@@ -160,7 +160,7 @@ You can also bind a live sandbox directly from any authored runtime function (to
|
|
|
160
160
|
callback) via `getSandbox`:
|
|
161
161
|
|
|
162
162
|
```ts
|
|
163
|
-
import { getSandbox } from "experimental-ash";
|
|
163
|
+
import { getSandbox } from "experimental-ash/sandboxes";
|
|
164
164
|
import { defineTool } from "experimental-ash/tools";
|
|
165
165
|
import { z } from "zod";
|
|
166
166
|
|
|
@@ -22,7 +22,7 @@ Use `getSession()` when you need durable runtime metadata about the current exec
|
|
|
22
22
|
`agent/tools/who_called_me.ts`
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
|
-
import { getSession } from "experimental-ash";
|
|
25
|
+
import { getSession } from "experimental-ash/context";
|
|
26
26
|
import { defineTool } from "experimental-ash/tools";
|
|
27
27
|
|
|
28
28
|
export default defineTool({
|
|
@@ -112,7 +112,7 @@ read it.
|
|
|
112
112
|
`agent/channels/keys.ts`
|
|
113
113
|
|
|
114
114
|
```ts
|
|
115
|
-
import { ContextKey } from "experimental-ash";
|
|
115
|
+
import { ContextKey } from "experimental-ash/context";
|
|
116
116
|
|
|
117
117
|
export const TenantKey = new ContextKey<string>("myapp.tenant");
|
|
118
118
|
```
|
|
@@ -164,7 +164,7 @@ Auth lives on `RunInput.auth` and `DeliverInput.auth`, not on the channel object
|
|
|
164
164
|
### Reading context from a tool
|
|
165
165
|
|
|
166
166
|
```ts
|
|
167
|
-
import { requireContext } from "experimental-ash";
|
|
167
|
+
import { requireContext } from "experimental-ash/context";
|
|
168
168
|
import { defineTool } from "experimental-ash/tools";
|
|
169
169
|
import { TenantKey } from "../channels/keys.js";
|
|
170
170
|
|
|
@@ -200,7 +200,7 @@ Providers run after `onDeliver()` and rebuild virtual values for the current ste
|
|
|
200
200
|
import {
|
|
201
201
|
ContextKey,
|
|
202
202
|
type ContextProvider,
|
|
203
|
-
} from "experimental-ash";
|
|
203
|
+
} from "experimental-ash/context";
|
|
204
204
|
import {
|
|
205
205
|
slackRoute,
|
|
206
206
|
SlackChannel,
|
package/docs/public/skills.md
CHANGED
|
@@ -78,7 +78,7 @@ Packaged skills are useful when you want files like:
|
|
|
78
78
|
Inside authored runtime code, you can read those packaged files through `getSkill(identifier)`.
|
|
79
79
|
|
|
80
80
|
```ts
|
|
81
|
-
import { getSkill } from "experimental-ash";
|
|
81
|
+
import { getSkill } from "experimental-ash/skills";
|
|
82
82
|
import { defineTool } from "experimental-ash/tools";
|
|
83
83
|
|
|
84
84
|
export default defineTool({
|
|
@@ -138,7 +138,7 @@ Do not use a skill for:
|
|
|
138
138
|
If markdown is not enough, you can author a skill in TypeScript with `defineSkill(...)`.
|
|
139
139
|
|
|
140
140
|
```ts
|
|
141
|
-
import { defineSkill } from "experimental-ash";
|
|
141
|
+
import { defineSkill } from "experimental-ash/skills";
|
|
142
142
|
|
|
143
143
|
export default defineSkill({
|
|
144
144
|
name: "research",
|
package/docs/public/tools.md
CHANGED
|
@@ -10,7 +10,7 @@ back.
|
|
|
10
10
|
`agent/tools/get_weather.ts`
|
|
11
11
|
|
|
12
12
|
```ts
|
|
13
|
-
import { getSession } from "experimental-ash";
|
|
13
|
+
import { getSession } from "experimental-ash/context";
|
|
14
14
|
import { defineTool } from "experimental-ash/tools";
|
|
15
15
|
import { z } from "zod";
|
|
16
16
|
|
|
@@ -36,8 +36,8 @@ exposed to the model as `get_weather`; a file at `agent/tools/get-weather.ts` is
|
|
|
36
36
|
`get-weather`. You can override that by setting `name` in the tool definition.
|
|
37
37
|
|
|
38
38
|
`defineTool`, `disableTool`, `defineBashTool`, `defineReadFileTool`, and `defineWriteFileTool` live on the `experimental-ash/tools` subpath.
|
|
39
|
-
Runtime helpers
|
|
40
|
-
|
|
39
|
+
Runtime context helpers (`getSession`, `getContext`, `requireContext`, `hasContext`, `setContext`, `ensureContext`) live on `experimental-ash/context`.
|
|
40
|
+
`getSandbox` lives on `experimental-ash/sandboxes` and `getSkill` lives on `experimental-ash/skills`.
|
|
41
41
|
|
|
42
42
|
## What A Tool Definition Needs
|
|
43
43
|
|
|
@@ -239,7 +239,7 @@ import {
|
|
|
239
239
|
ensureContext,
|
|
240
240
|
requireContext,
|
|
241
241
|
setContext,
|
|
242
|
-
} from "experimental-ash";
|
|
242
|
+
} from "experimental-ash/context";
|
|
243
243
|
import { defineTool } from "experimental-ash/tools";
|
|
244
244
|
import { z } from "zod";
|
|
245
245
|
|
|
@@ -5,6 +5,8 @@ This page is the quick reference for Ash's public TypeScript surface.
|
|
|
5
5
|
Source of truth:
|
|
6
6
|
|
|
7
7
|
- main barrel: [`../../packages/ash/src/public/index.ts`](../../packages/ash/src/public/index.ts)
|
|
8
|
+
- context subpath: [`../../packages/ash/src/public/context/index.ts`](../../packages/ash/src/public/context/index.ts)
|
|
9
|
+
- skills subpath: [`../../packages/ash/src/public/skills/index.ts`](../../packages/ash/src/public/skills/index.ts)
|
|
8
10
|
- tools subpath: [`../../packages/ash/src/public/tools/index.ts`](../../packages/ash/src/public/tools/index.ts)
|
|
9
11
|
- sandboxes subpath: [`../../packages/ash/src/public/sandboxes/index.ts`](../../packages/ash/src/public/sandboxes/index.ts)
|
|
10
12
|
- channel subpaths: [`../../packages/ash/src/public/channels/index.ts`](../../packages/ash/src/public/channels/index.ts)
|
|
@@ -12,24 +14,25 @@ Source of truth:
|
|
|
12
14
|
|
|
13
15
|
## Definition Helpers
|
|
14
16
|
|
|
15
|
-
Use these to author the filesystem-backed surface.
|
|
16
|
-
`experimental-ash/tools
|
|
17
|
-
|
|
17
|
+
Use these to author the filesystem-backed surface. Each concern has its own subpath:
|
|
18
|
+
`experimental-ash/tools` for tools, `experimental-ash/sandboxes` for sandboxes,
|
|
19
|
+
`experimental-ash/skills` for skills, `experimental-ash/context` for context helpers,
|
|
20
|
+
and the main `experimental-ash` barrel for agent config, routes, schedules, and systems.
|
|
18
21
|
|
|
19
22
|
- `defineAgent(...)` - additive runtime config for `agent.ts`
|
|
20
23
|
- `defineRoute(...)` - messaging-platform or HTTP route entrypoints in `channels/`
|
|
21
|
-
- `defineSandbox(...)` - isolated bash-style environments in `sandboxes/`
|
|
24
|
+
- `defineSandbox(...)` - isolated bash-style environments in `sandboxes/` (`experimental-ash/sandboxes`)
|
|
22
25
|
- `defineSchedule(...)` - recurring jobs in `schedules/`
|
|
23
|
-
- `defineSkill(...)` - module-authored skills
|
|
26
|
+
- `defineSkill(...)` - module-authored skills (`experimental-ash/skills`)
|
|
24
27
|
- `defineSubagent(...)` - local subagent entrypoint in `subagents/<id>/subagent.ts`
|
|
25
28
|
- `defineSystem(...)` - module-authored system prompt
|
|
26
|
-
- `defineTool(...)` - typed executable integration in `tools/<name>.ts`
|
|
27
|
-
- `defineBashTool(...)` - model-visible shell tool targeting a named sandbox
|
|
28
|
-
- `defineReadFileTool(...)` - model-visible file reader targeting a named sandbox
|
|
29
|
-
- `defineWriteFileTool(...)` - model-visible file writer targeting a named sandbox
|
|
30
|
-
- `disableTool()` - disable the framework default whose name matches `tools/<name>.ts`
|
|
29
|
+
- `defineTool(...)` - typed executable integration in `tools/<name>.ts` (`experimental-ash/tools`)
|
|
30
|
+
- `defineBashTool(...)` - model-visible shell tool targeting a named sandbox (`experimental-ash/tools`)
|
|
31
|
+
- `defineReadFileTool(...)` - model-visible file reader targeting a named sandbox (`experimental-ash/tools`)
|
|
32
|
+
- `defineWriteFileTool(...)` - model-visible file writer targeting a named sandbox (`experimental-ash/tools`)
|
|
33
|
+
- `disableTool()` - disable the framework default whose name matches `tools/<name>.ts` (`experimental-ash/tools`)
|
|
31
34
|
- `disableRoute()` - disable a framework-owned route that matches the file path
|
|
32
|
-
- `defineEvalSuite(...)` - repeatable eval suite under `evals/*.eval.ts`
|
|
35
|
+
- `defineEvalSuite(...)` - repeatable eval suite under `evals/*.eval.ts` (`experimental-ash/evals`)
|
|
33
36
|
|
|
34
37
|
Framework defaults reachable for spread/wrap composition:
|
|
35
38
|
|
|
@@ -40,18 +43,19 @@ Most apps use `defineAgent`, `defineTool`, and `defineSandbox` the most.
|
|
|
40
43
|
|
|
41
44
|
## Runtime Helpers
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
- `getSandbox(name)` - live named sandbox session
|
|
45
|
-
- `getSkill(identifier)` - handle for a named skill visible to the current agent
|
|
46
|
-
- `getContext(key)` / `requireContext(key)` / `hasContext(key)` / `setContext(key)` / `ensureContext(key, factory)` - unified context helpers
|
|
46
|
+
Each runtime accessor lives on the subpath that owns its concern:
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
- `getSession()` - current session, turn, auth, and optional parent lineage (`experimental-ash/context`)
|
|
49
|
+
- `getSandbox(name)` - live named sandbox session (`experimental-ash/sandboxes`)
|
|
50
|
+
- `getSkill(identifier)` - handle for a named skill visible to the current agent (`experimental-ash/skills`)
|
|
51
|
+
- `getContext(key)` / `requireContext(key)` / `hasContext(key)` / `setContext(key)` / `ensureContext(key, factory)` - unified context helpers (`experimental-ash/context`)
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- `
|
|
53
|
-
- `
|
|
54
|
-
-
|
|
53
|
+
Related exported types by subpath:
|
|
54
|
+
|
|
55
|
+
- `experimental-ash/context`: `Session`, `SessionAuth`, `SessionAuthContext`, `SessionParent`, `SessionTurn`, `ContextKey`, `ContextKeyOptions`, `ContextProvider`, `ContextReader`, `ContextAccessor`, `AshContext`
|
|
56
|
+
- `experimental-ash/skills`: `SkillHandle`, `SkillResource`, `SkillDefinition`
|
|
57
|
+
- `experimental-ash`: `RunMode`
|
|
58
|
+
- `experimental-ash/evals`: eval types
|
|
55
59
|
|
|
56
60
|
Ash also exports lower-level runtime primitives such as `createToolLoopHarness(...)`,
|
|
57
61
|
`createContinuousLoopRuntime(...)`, and `createWorkflowRuntime(...)`.
|
|
@@ -92,18 +96,24 @@ import { vercelOidc } from "experimental-ash/channels/auth";
|
|
|
92
96
|
### Typed Tool
|
|
93
97
|
|
|
94
98
|
```ts
|
|
95
|
-
import { getSession } from "experimental-ash";
|
|
99
|
+
import { getSession } from "experimental-ash/context";
|
|
96
100
|
import { defineTool } from "experimental-ash/tools";
|
|
97
101
|
```
|
|
98
102
|
|
|
99
103
|
### Sandbox Access
|
|
100
104
|
|
|
101
105
|
```ts
|
|
102
|
-
import { getSandbox } from "experimental-ash";
|
|
106
|
+
import { getSandbox } from "experimental-ash/sandboxes";
|
|
103
107
|
import { defineTool } from "experimental-ash/tools";
|
|
104
108
|
import { defineBashTool } from "experimental-ash/tools";
|
|
105
109
|
```
|
|
106
110
|
|
|
111
|
+
### Skill Access
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
import { defineSkill, getSkill } from "experimental-ash/skills";
|
|
115
|
+
```
|
|
116
|
+
|
|
107
117
|
### Wrapping Or Disabling A Framework Default
|
|
108
118
|
|
|
109
119
|
```ts
|
|
@@ -134,11 +144,10 @@ import { Braintrust } from "experimental-ash/evals/reporters";
|
|
|
134
144
|
- `defineRoute` and route/channel factories -> [`channels/README.md`](./channels/README.md)
|
|
135
145
|
- `defineTool`, `disableTool`, `defineBashTool`, `defineReadFileTool`, `defineWriteFileTool`, and `experimental-ash/tools/defaults` -> [`tools.md`](./tools.md)
|
|
136
146
|
- `defineSandbox` and `getSandbox` -> [`sandboxes.md`](./sandboxes.md)
|
|
147
|
+
- `defineSkill` and `getSkill` -> [`skills.md`](./skills.md)
|
|
137
148
|
- `getSession` -> [`session-context.md`](./session-context.md)
|
|
138
|
-
- `getSkill` -> [`session-context.md`](./session-context.md)
|
|
139
149
|
- `defineSubagent` -> [`subagents.md`](./subagents.md)
|
|
140
150
|
- `defineSchedule` -> [`schedules.md`](./schedules.md)
|
|
141
|
-
- `defineSkill` -> [`skills.md`](./skills.md)
|
|
142
151
|
- `defineEvalSuite`, loaders, reporters, and scorers -> [`evals.md`](./evals.md)
|
|
143
152
|
|
|
144
153
|
## Practical Advice
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "experimental-ash",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/src/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -82,6 +82,16 @@
|
|
|
82
82
|
"import": "./dist/src/evals/scores/index.js",
|
|
83
83
|
"default": "./dist/src/evals/scores/index.js"
|
|
84
84
|
},
|
|
85
|
+
"./skills": {
|
|
86
|
+
"types": "./dist/src/public/skills/index.d.ts",
|
|
87
|
+
"import": "./dist/src/public/skills/index.js",
|
|
88
|
+
"default": "./dist/src/public/skills/index.js"
|
|
89
|
+
},
|
|
90
|
+
"./context": {
|
|
91
|
+
"types": "./dist/src/public/context/index.d.ts",
|
|
92
|
+
"import": "./dist/src/public/context/index.js",
|
|
93
|
+
"default": "./dist/src/public/context/index.js"
|
|
94
|
+
},
|
|
85
95
|
"./channels": {
|
|
86
96
|
"types": "./dist/src/public/channels/index.d.ts",
|
|
87
97
|
"import": "./dist/src/public/channels/index.js",
|