@autonome-research/thread-phase 3.4.0 → 4.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/dist/agents/authoring/index.d.ts +49 -0
- package/dist/agents/authoring/index.d.ts.map +1 -0
- package/dist/agents/authoring/index.js +56 -0
- package/dist/agents/authoring/index.js.map +1 -0
- package/dist/agents/event-bus.d.ts +0 -2
- package/dist/agents/event-bus.d.ts.map +1 -1
- package/dist/agents/event-bus.js +0 -2
- package/dist/agents/event-bus.js.map +1 -1
- package/dist/agents/index.d.ts +19 -9
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +25 -15
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/inference-adapter.d.ts +0 -3
- package/dist/agents/inference-adapter.d.ts.map +1 -1
- package/dist/agents/inference-adapter.js +0 -2
- package/dist/agents/inference-adapter.js.map +1 -1
- package/dist/agents/job-store-bridge.d.ts +0 -3
- package/dist/agents/job-store-bridge.d.ts.map +1 -1
- package/dist/agents/job-store-bridge.js +0 -2
- package/dist/agents/job-store-bridge.js.map +1 -1
- package/dist/agents/memory.d.ts +0 -3
- package/dist/agents/memory.d.ts.map +1 -1
- package/dist/agents/memory.js +0 -1
- package/dist/agents/memory.js.map +1 -1
- package/dist/agents/protocol.d.ts +0 -15
- package/dist/agents/protocol.d.ts.map +1 -1
- package/dist/agents/protocol.js +0 -3
- package/dist/agents/protocol.js.map +1 -1
- package/dist/agents/structured-output.d.ts +16 -5
- package/dist/agents/structured-output.d.ts.map +1 -1
- package/dist/agents/structured-output.js +16 -3
- package/dist/agents/structured-output.js.map +1 -1
- package/dist/agents/thread.d.ts +0 -7
- package/dist/agents/thread.d.ts.map +1 -1
- package/dist/agents/thread.js +0 -6
- package/dist/agents/thread.js.map +1 -1
- package/dist/agents/with-memory.d.ts +0 -3
- package/dist/agents/with-memory.d.ts.map +1 -1
- package/dist/agents/with-memory.js +0 -2
- package/dist/agents/with-memory.js.map +1 -1
- package/dist/agents/with-thread.d.ts +0 -3
- package/dist/agents/with-thread.d.ts.map +1 -1
- package/dist/agents/with-thread.js +0 -2
- package/dist/agents/with-thread.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter-author helpers — Tier B, UNSTABLE surface.
|
|
3
|
+
*
|
|
4
|
+
* # Stability policy
|
|
5
|
+
*
|
|
6
|
+
* Everything exported from this subpath is for AUTHORS writing new
|
|
7
|
+
* AgentAdapter implementations — not for consumers using pre-built
|
|
8
|
+
* adapters. These helpers may change shape in any minor release.
|
|
9
|
+
*
|
|
10
|
+
* If you are writing application code that USES an adapter (e.g.
|
|
11
|
+
* `claudeCodeAgent`, `codexAgent`), you want `thread-phase/agents`
|
|
12
|
+
* (Tier A, stable) — not this subpath.
|
|
13
|
+
*
|
|
14
|
+
* If you are writing a new adapter from scratch, this is the right
|
|
15
|
+
* place. Treat every import from here as a churn risk and pin to the
|
|
16
|
+
* exact version of `@autonome-research/thread-phase` you tested
|
|
17
|
+
* against.
|
|
18
|
+
*
|
|
19
|
+
* See STABILITY.md at the repo root for the full tier policy.
|
|
20
|
+
*
|
|
21
|
+
* # What lives here
|
|
22
|
+
*
|
|
23
|
+
* - run-helpers: composeAbort, createEventQueue, lazyEvents — the
|
|
24
|
+
* three implementation primitives every concrete adapter in
|
|
25
|
+
* `thread-phase-agents` consumes.
|
|
26
|
+
* - TurnAccumulator: helper for runtimes whose wire-format emits
|
|
27
|
+
* turn boundaries before tool calls (used by codex, anthropic).
|
|
28
|
+
* - serializeError: cross-process-safe error normalization. Used by
|
|
29
|
+
* adapters when emitting AgentEvent error frames.
|
|
30
|
+
* - parseStructuredFromText / extractResponseBlock /
|
|
31
|
+
* applyStructuredOutputPrompt / parseStructured: prompted
|
|
32
|
+
* structured-output helpers. The TYPE exports
|
|
33
|
+
* (StructuredOutputConfig, StructuredOutputParseError) live in
|
|
34
|
+
* the consumer barrel — only the runtime helpers are author-only.
|
|
35
|
+
* - capability: AgentCapabilityError + requireCapability for static
|
|
36
|
+
* adapter-capability validation. Zero importers in the bundled
|
|
37
|
+
* adapters today; kept here for protocol completeness.
|
|
38
|
+
* TODO(v5): re-evaluate for removal if still unused.
|
|
39
|
+
* - parseStructuredFromText is the closest to a Tier A candidate —
|
|
40
|
+
* six bundled adapters consume it. If consumer-facing re-parse
|
|
41
|
+
* ever becomes a documented use case, promote with a stable
|
|
42
|
+
* wrapper.
|
|
43
|
+
*/
|
|
44
|
+
export { composeAbort, createEventQueue, lazyEvents, type CompositeAbort, type EventQueue, } from '../run-helpers.js';
|
|
45
|
+
export { TurnAccumulator } from '../turn-accumulator.js';
|
|
46
|
+
export { serializeError } from '../serialize-error.js';
|
|
47
|
+
export { applyStructuredOutputPrompt, extractResponseBlock, parseStructured, parseStructuredFromText, } from '../structured-output.js';
|
|
48
|
+
export { AgentCapabilityError, requireCapability } from '../capability.js';
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/authoring/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAKvD,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,eAAe,EACf,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter-author helpers — Tier B, UNSTABLE surface.
|
|
3
|
+
*
|
|
4
|
+
* # Stability policy
|
|
5
|
+
*
|
|
6
|
+
* Everything exported from this subpath is for AUTHORS writing new
|
|
7
|
+
* AgentAdapter implementations — not for consumers using pre-built
|
|
8
|
+
* adapters. These helpers may change shape in any minor release.
|
|
9
|
+
*
|
|
10
|
+
* If you are writing application code that USES an adapter (e.g.
|
|
11
|
+
* `claudeCodeAgent`, `codexAgent`), you want `thread-phase/agents`
|
|
12
|
+
* (Tier A, stable) — not this subpath.
|
|
13
|
+
*
|
|
14
|
+
* If you are writing a new adapter from scratch, this is the right
|
|
15
|
+
* place. Treat every import from here as a churn risk and pin to the
|
|
16
|
+
* exact version of `@autonome-research/thread-phase` you tested
|
|
17
|
+
* against.
|
|
18
|
+
*
|
|
19
|
+
* See STABILITY.md at the repo root for the full tier policy.
|
|
20
|
+
*
|
|
21
|
+
* # What lives here
|
|
22
|
+
*
|
|
23
|
+
* - run-helpers: composeAbort, createEventQueue, lazyEvents — the
|
|
24
|
+
* three implementation primitives every concrete adapter in
|
|
25
|
+
* `thread-phase-agents` consumes.
|
|
26
|
+
* - TurnAccumulator: helper for runtimes whose wire-format emits
|
|
27
|
+
* turn boundaries before tool calls (used by codex, anthropic).
|
|
28
|
+
* - serializeError: cross-process-safe error normalization. Used by
|
|
29
|
+
* adapters when emitting AgentEvent error frames.
|
|
30
|
+
* - parseStructuredFromText / extractResponseBlock /
|
|
31
|
+
* applyStructuredOutputPrompt / parseStructured: prompted
|
|
32
|
+
* structured-output helpers. The TYPE exports
|
|
33
|
+
* (StructuredOutputConfig, StructuredOutputParseError) live in
|
|
34
|
+
* the consumer barrel — only the runtime helpers are author-only.
|
|
35
|
+
* - capability: AgentCapabilityError + requireCapability for static
|
|
36
|
+
* adapter-capability validation. Zero importers in the bundled
|
|
37
|
+
* adapters today; kept here for protocol completeness.
|
|
38
|
+
* TODO(v5): re-evaluate for removal if still unused.
|
|
39
|
+
* - parseStructuredFromText is the closest to a Tier A candidate —
|
|
40
|
+
* six bundled adapters consume it. If consumer-facing re-parse
|
|
41
|
+
* ever becomes a documented use case, promote with a stable
|
|
42
|
+
* wrapper.
|
|
43
|
+
*/
|
|
44
|
+
// run-helpers — composition primitives for adapter implementations.
|
|
45
|
+
export { composeAbort, createEventQueue, lazyEvents, } from '../run-helpers.js';
|
|
46
|
+
// Turn boundaries for runtimes that emit turn frames before tool calls.
|
|
47
|
+
export { TurnAccumulator } from '../turn-accumulator.js';
|
|
48
|
+
// Error normalization for adapters emitting error AgentEvents.
|
|
49
|
+
export { serializeError } from '../serialize-error.js';
|
|
50
|
+
// Prompted structured-output runtime helpers. The TYPES
|
|
51
|
+
// (StructuredOutputConfig, StructuredOutputParseError) live in the
|
|
52
|
+
// Tier A barrel and are not re-exported here to avoid double-naming.
|
|
53
|
+
export { applyStructuredOutputPrompt, extractResponseBlock, parseStructured, parseStructuredFromText, } from '../structured-output.js';
|
|
54
|
+
// Capability assertions for adapter authors.
|
|
55
|
+
export { AgentCapabilityError, requireCapability } from '../capability.js';
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/authoring/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,oEAAoE;AACpE,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,GAGX,MAAM,mBAAmB,CAAC;AAE3B,wEAAwE;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,+DAA+D;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,wDAAwD;AACxD,mEAAmE;AACnE,qEAAqE;AACrE,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,eAAe,EACf,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAEjC,6CAA6C;AAC7C,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -7,14 +7,12 @@
|
|
|
7
7
|
* are fire-and-forget (no awaiting); use the bus for observation, not for
|
|
8
8
|
* sequencing.
|
|
9
9
|
*
|
|
10
|
-
* @internal
|
|
11
10
|
*/
|
|
12
11
|
import type { AgentEventBus } from './protocol.js';
|
|
13
12
|
/**
|
|
14
13
|
* Construct a new event bus. Each adapter that receives one via
|
|
15
14
|
* `AgentRunOptions.eventBus` mirrors its event stream into it.
|
|
16
15
|
*
|
|
17
|
-
* @internal
|
|
18
16
|
*/
|
|
19
17
|
export declare function createEventBus(): AgentEventBus;
|
|
20
18
|
//# sourceMappingURL=event-bus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../src/agents/event-bus.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../src/agents/event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,eAAe,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,aAAa,CAoB9C"}
|
package/dist/agents/event-bus.js
CHANGED
|
@@ -7,13 +7,11 @@
|
|
|
7
7
|
* are fire-and-forget (no awaiting); use the bus for observation, not for
|
|
8
8
|
* sequencing.
|
|
9
9
|
*
|
|
10
|
-
* @internal
|
|
11
10
|
*/
|
|
12
11
|
/**
|
|
13
12
|
* Construct a new event bus. Each adapter that receives one via
|
|
14
13
|
* `AgentRunOptions.eventBus` mirrors its event stream into it.
|
|
15
14
|
*
|
|
16
|
-
* @internal
|
|
17
15
|
*/
|
|
18
16
|
export function createEventBus() {
|
|
19
17
|
const handlers = new Set();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../src/agents/event-bus.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../src/agents/event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA+C,CAAC;IACxE,OAAO;QACL,IAAI,CAAC,KAAK;YACR,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;gBACzB,IAAI,CAAC;oBACH,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC;gBAAC,MAAM,CAAC;oBACP,mEAAmE;oBACnE,qEAAqE;gBACvE,CAAC;YACH,CAAC;QACH,CAAC;QACD,EAAE,CAAC,OAAO;YACR,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO,GAAG,EAAE;gBACV,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Public entry point for the AgentAdapter protocol.
|
|
2
|
+
* Public entry point for the AgentAdapter protocol — Tier A, STABLE surface.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* # Stability commitment (from v4.0.0)
|
|
5
|
+
*
|
|
6
|
+
* Every export from this subpath is covered by semver:
|
|
7
|
+
* - patch (4.0.x): bug fixes, no API changes
|
|
8
|
+
* - minor (4.x.0): additive — new exports, new optional fields
|
|
9
|
+
* - major (x.0.0): breaking changes (always with a migration note)
|
|
10
|
+
*
|
|
11
|
+
* Anyone building application code that uses or composes pre-built
|
|
12
|
+
* adapters (`claudeCodeAgent`, `codexAgent`, `hermesAgent`, …) imports
|
|
13
|
+
* from here.
|
|
14
|
+
*
|
|
15
|
+
* Helpers for AUTHORING new adapters — `composeAbort`, `createEventQueue`,
|
|
16
|
+
* `lazyEvents`, `TurnAccumulator`, `serializeError`, the prompted
|
|
17
|
+
* structured-output helpers, `requireCapability` — live in
|
|
18
|
+
* `thread-phase/agents/authoring` and remain unstable.
|
|
19
|
+
*
|
|
20
|
+
* See STABILITY.md at the repo root for the full tier policy.
|
|
7
21
|
*
|
|
8
22
|
* Subpath: `thread-phase/agents`.
|
|
9
23
|
*/
|
|
10
24
|
export { defineAgentAdapter, isSteerable, type AgentAdapter, type AgentAdapterMeta, type AgentCapabilities, type AgentEvent, type AgentEventBus, type AgentFinishReason, type AgentRun, type AgentRunOptions, type AgentRunResult, type ResumeToken, type SerializableError, type SteerableAgentRun, } from './protocol.js';
|
|
11
25
|
export { createEventBus } from './event-bus.js';
|
|
12
|
-
export { AgentCapabilityError, requireCapability } from './capability.js';
|
|
13
|
-
export { serializeError } from './serialize-error.js';
|
|
14
26
|
export { appendEvent, createThread, resumeTokenFor, setResumeToken, threadToMessages, type Thread, } from './thread.js';
|
|
15
27
|
export type { MemoryProvider, MemoryScope } from './memory.js';
|
|
16
|
-
export {
|
|
28
|
+
export { StructuredOutputParseError, type StructuredOutputConfig, } from './structured-output.js';
|
|
17
29
|
export { inferenceAgent, type InferenceAgentConfig, } from './inference-adapter.js';
|
|
18
|
-
export { TurnAccumulator } from './turn-accumulator.js';
|
|
19
|
-
export { composeAbort, createEventQueue, lazyEvents, type CompositeAbort, type EventQueue, } from './run-helpers.js';
|
|
20
30
|
export { withMemory, type WithMemoryOptions } from './with-memory.js';
|
|
21
31
|
export { withThread, type WithThreadOptions } from './with-thread.js';
|
|
22
32
|
export { pipeAgentEventsToJobStore, type PipeAgentEventsOptions, } from './job-store-bridge.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,KAAK,MAAM,GACZ,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM/D,OAAO,EACL,0BAA0B,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGtE,OAAO,EACL,yBAAyB,EACzB,KAAK,sBAAsB,GAC5B,MAAM,uBAAuB,CAAC"}
|
package/dist/agents/index.js
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Public entry point for the AgentAdapter protocol.
|
|
2
|
+
* Public entry point for the AgentAdapter protocol — Tier A, STABLE surface.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* # Stability commitment (from v4.0.0)
|
|
5
|
+
*
|
|
6
|
+
* Every export from this subpath is covered by semver:
|
|
7
|
+
* - patch (4.0.x): bug fixes, no API changes
|
|
8
|
+
* - minor (4.x.0): additive — new exports, new optional fields
|
|
9
|
+
* - major (x.0.0): breaking changes (always with a migration note)
|
|
10
|
+
*
|
|
11
|
+
* Anyone building application code that uses or composes pre-built
|
|
12
|
+
* adapters (`claudeCodeAgent`, `codexAgent`, `hermesAgent`, …) imports
|
|
13
|
+
* from here.
|
|
14
|
+
*
|
|
15
|
+
* Helpers for AUTHORING new adapters — `composeAbort`, `createEventQueue`,
|
|
16
|
+
* `lazyEvents`, `TurnAccumulator`, `serializeError`, the prompted
|
|
17
|
+
* structured-output helpers, `requireCapability` — live in
|
|
18
|
+
* `thread-phase/agents/authoring` and remain unstable.
|
|
19
|
+
*
|
|
20
|
+
* See STABILITY.md at the repo root for the full tier policy.
|
|
7
21
|
*
|
|
8
22
|
* Subpath: `thread-phase/agents`.
|
|
9
23
|
*/
|
|
@@ -11,20 +25,16 @@
|
|
|
11
25
|
export { defineAgentAdapter, isSteerable, } from './protocol.js';
|
|
12
26
|
// Event bus.
|
|
13
27
|
export { createEventBus } from './event-bus.js';
|
|
14
|
-
// Capability assertions.
|
|
15
|
-
export { AgentCapabilityError, requireCapability } from './capability.js';
|
|
16
|
-
// Error serialization helper.
|
|
17
|
-
export { serializeError } from './serialize-error.js';
|
|
18
28
|
// Thread primitive.
|
|
19
29
|
export { appendEvent, createThread, resumeTokenFor, setResumeToken, threadToMessages, } from './thread.js';
|
|
20
|
-
// Structured-output
|
|
21
|
-
|
|
22
|
-
//
|
|
30
|
+
// Structured-output TYPES live in the stable barrel. The corresponding
|
|
31
|
+
// runtime helpers (parseStructuredFromText, extractResponseBlock,
|
|
32
|
+
// applyStructuredOutputPrompt, parseStructured) are author-only and
|
|
33
|
+
// live in `thread-phase/agents/authoring`.
|
|
34
|
+
export { StructuredOutputParseError, } from './structured-output.js';
|
|
35
|
+
// Reference adapter — wraps runAgentWithTools. inferenceAgent is shipped
|
|
36
|
+
// as both a working adapter and the canonical example for adapter authors.
|
|
23
37
|
export { inferenceAgent, } from './inference-adapter.js';
|
|
24
|
-
// Helper for adapters whose runtime emits turn boundaries before tool calls.
|
|
25
|
-
export { TurnAccumulator } from './turn-accumulator.js';
|
|
26
|
-
// Helpers for adapter authors: composite abort, single-consumer event queue, lazy-start wrapper.
|
|
27
|
-
export { composeAbort, createEventQueue, lazyEvents, } from './run-helpers.js';
|
|
28
38
|
// Adapter decorators: auto-handle memory and Thread wiring.
|
|
29
39
|
export { withMemory } from './with-memory.js';
|
|
30
40
|
export { withThread } from './with-thread.js';
|
package/dist/agents/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,kBAAkB;AAClB,OAAO,EACL,kBAAkB,EAClB,WAAW,GAaZ,MAAM,eAAe,CAAC;AAEvB,aAAa;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,oBAAoB;AACpB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc,EACd,gBAAgB,GAEjB,MAAM,aAAa,CAAC;AAKrB,uEAAuE;AACvE,kEAAkE;AAClE,oEAAoE;AACpE,2CAA2C;AAC3C,OAAO,EACL,0BAA0B,GAE3B,MAAM,wBAAwB,CAAC;AAEhC,yEAAyE;AACzE,2EAA2E;AAC3E,OAAO,EACL,cAAc,GAEf,MAAM,wBAAwB,CAAC;AAEhC,4DAA4D;AAC5D,OAAO,EAAE,UAAU,EAA0B,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,UAAU,EAA0B,MAAM,kBAAkB,CAAC;AAEtE,iDAAiD;AACjD,OAAO,EACL,yBAAyB,GAE1B,MAAM,uBAAuB,CAAC"}
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
* first. Translation rules from runner stream events → canonical
|
|
17
17
|
* `AgentEvent`s are documented inline on the `onStreamEvent` callback.
|
|
18
18
|
*
|
|
19
|
-
* @internal
|
|
20
19
|
*/
|
|
21
20
|
import { type AgentConfig, type AgentRunnerOptions } from '../agent/index.js';
|
|
22
21
|
import type { Message } from '../messages.js';
|
|
@@ -26,7 +25,6 @@ import { type StructuredOutputConfig } from './structured-output.js';
|
|
|
26
25
|
* Configuration for the in-tree inference adapter. Wraps the same inputs
|
|
27
26
|
* `runAgentWithTools` already takes plus an optional structured-output spec.
|
|
28
27
|
*
|
|
29
|
-
* @internal
|
|
30
28
|
*/
|
|
31
29
|
export interface InferenceAgentConfig {
|
|
32
30
|
/** Agent config passed to `runAgentWithTools`. */
|
|
@@ -45,7 +43,6 @@ export interface InferenceAgentConfig {
|
|
|
45
43
|
/**
|
|
46
44
|
* The adapter metadata, suitable for registration alongside future siblings.
|
|
47
45
|
*
|
|
48
|
-
* @internal
|
|
49
46
|
*/
|
|
50
47
|
export declare const inferenceAgent: AgentAdapterMeta<InferenceAgentConfig>;
|
|
51
48
|
export type { AgentEventBus };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference-adapter.d.ts","sourceRoot":"","sources":["../../src/agents/inference-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inference-adapter.d.ts","sourceRoot":"","sources":["../../src/agents/inference-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,kBAAkB,EAExB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAInB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAKhC;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,MAAM,EAAE,WAAW,CAAC;IACpB,kEAAkE;IAClE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB;;;;OAIG;IACH,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC;IACpE,uDAAuD;IACvD,YAAY,CAAC,EAAE,sBAAsB,CAAC;CACvC;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,gBAAgB,CAAC,oBAAoB,CAShE,CAAC;AA6LH,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
* first. Translation rules from runner stream events → canonical
|
|
17
17
|
* `AgentEvent`s are documented inline on the `onStreamEvent` callback.
|
|
18
18
|
*
|
|
19
|
-
* @internal
|
|
20
19
|
*/
|
|
21
20
|
import { runAgentWithTools, } from '../agent/index.js';
|
|
22
21
|
import { defineAgentAdapter, } from './protocol.js';
|
|
@@ -28,7 +27,6 @@ const ADAPTER_ID = 'inference';
|
|
|
28
27
|
/**
|
|
29
28
|
* The adapter metadata, suitable for registration alongside future siblings.
|
|
30
29
|
*
|
|
31
|
-
* @internal
|
|
32
30
|
*/
|
|
33
31
|
export const inferenceAgent = defineAgentAdapter({
|
|
34
32
|
id: ADAPTER_ID,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference-adapter.js","sourceRoot":"","sources":["../../src/agents/inference-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inference-adapter.js","sourceRoot":"","sources":["../../src/agents/inference-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,iBAAiB,GAKlB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,kBAAkB,GAMnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAA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K,CAAC,MAAM,CAAC,CAAC;YACzB,+DAA+D;YAC/D,+DAA+D;YAC/D,IAAI,CAAC,OAAO;gBAAE,aAAa,EAAE,CAAC;QAChC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,sBAAsB,CAAC,IAAY;IAC1C,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,IACE,MAAM,KAAK,IAAI;YACf,OAAO,MAAM,KAAK,QAAQ;YAC1B,QAAQ,IAAI,MAAM;YAClB,OAAQ,MAAgC,CAAC,OAAO,KAAK,QAAQ,EAC7D,CAAC;YACD,OAAQ,MAAgC,CAAC,OAAiB,CAAC;QAC7D,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,WAAW;IACb,CAAC;IACD,OAAO,IAAI,IAAI,aAAa,CAAC;AAC/B,CAAC"}
|
|
@@ -9,11 +9,9 @@
|
|
|
9
9
|
* by hand would reach for `bus.on((event) => store.appendEvent(...))`;
|
|
10
10
|
* this helper ships the canonical version with a clean unsubscribe.
|
|
11
11
|
*
|
|
12
|
-
* @internal
|
|
13
12
|
*/
|
|
14
13
|
import type { JobStore } from '../session/index.js';
|
|
15
14
|
import type { AgentEvent, AgentEventBus } from './protocol.js';
|
|
16
|
-
/** @internal */
|
|
17
15
|
export interface PipeAgentEventsOptions {
|
|
18
16
|
/**
|
|
19
17
|
* Event types to drop rather than persist. Useful for high-volume
|
|
@@ -38,7 +36,6 @@ export interface PipeAgentEventsOptions {
|
|
|
38
36
|
* (the JobStore's escape hatch for arbitrary payloads); the canonical
|
|
39
37
|
* `AgentEvent` is the `value`.
|
|
40
38
|
*
|
|
41
|
-
* @internal
|
|
42
39
|
*/
|
|
43
40
|
export declare function pipeAgentEventsToJobStore(bus: AgentEventBus, store: JobStore, jobId: string, options?: PipeAgentEventsOptions): () => void;
|
|
44
41
|
//# sourceMappingURL=job-store-bridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-store-bridge.d.ts","sourceRoot":"","sources":["../../src/agents/job-store-bridge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"job-store-bridge.d.ts","sourceRoot":"","sources":["../../src/agents/job-store-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/D,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC;CAChD;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,sBAA2B,GACnC,MAAM,IAAI,CA+BZ"}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* by hand would reach for `bus.on((event) => store.appendEvent(...))`;
|
|
10
10
|
* this helper ships the canonical version with a clean unsubscribe.
|
|
11
11
|
*
|
|
12
|
-
* @internal
|
|
13
12
|
*/
|
|
14
13
|
/**
|
|
15
14
|
* Subscribe to a bus and append every agent event to the JobStore
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
* (the JobStore's escape hatch for arbitrary payloads); the canonical
|
|
21
20
|
* `AgentEvent` is the `value`.
|
|
22
21
|
*
|
|
23
|
-
* @internal
|
|
24
22
|
*/
|
|
25
23
|
export function pipeAgentEventsToJobStore(bus, store, jobId, options = {}) {
|
|
26
24
|
const dropTypes = new Set(options.dropTypes ?? []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-store-bridge.js","sourceRoot":"","sources":["../../src/agents/job-store-bridge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"job-store-bridge.js","sourceRoot":"","sources":["../../src/agents/job-store-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqBH;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACvC,GAAkB,EAClB,KAAe,EACf,KAAa,EACb,UAAkC,EAAE;IAEpC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,OAAO,OAAO,CAAC,GAAG,KAAK,UAAU;QAC7C,CAAC,CAAC,OAAO,CAAC,GAAG;QACb,CAAC,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS;YACzB,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAa;YAC7B,CAAC,CAAC,CAAC,KAAiB,EAAU,EAAE,CAAC,SAAS,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;IAE3E,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE;QACtB,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO;QACtC,MAAM,aAAa,GAAkB;YACnC,IAAI,EAAE,MAAM;YACZ,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC;YACjB,KAAK,EAAE,KAAK;SACb,CAAC;QACF,qEAAqE;QACrE,+DAA+D;QAC/D,4DAA4D;QAC5D,iEAAiE;QACjE,8BAA8B;QAC9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;YACvD,IAAI,MAAM,IAAI,OAAQ,MAA0B,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBACpE,MAA0B,CAAC,KAAK,CAAC,GAAG,EAAE;oBACrC,iCAAiC;gBACnC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,+DAA+D;QACjE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/agents/memory.d.ts
CHANGED
|
@@ -8,14 +8,12 @@
|
|
|
8
8
|
* raw recall blob), and `remember` ingests an event window from the run
|
|
9
9
|
* that just completed.
|
|
10
10
|
*
|
|
11
|
-
* @internal
|
|
12
11
|
*/
|
|
13
12
|
import type { AgentEvent } from './protocol.js';
|
|
14
13
|
/**
|
|
15
14
|
* Scope key for a memory provider. `userId` is the partition every
|
|
16
15
|
* backend expects; `appId` and `sessionId` narrow further when supported.
|
|
17
16
|
*
|
|
18
|
-
* @internal
|
|
19
17
|
*/
|
|
20
18
|
export interface MemoryScope {
|
|
21
19
|
userId: string;
|
|
@@ -31,7 +29,6 @@ export interface MemoryScope {
|
|
|
31
29
|
* derivers, for example). Callers that need strict ordering should
|
|
32
30
|
* persist their own representation alongside the provider.
|
|
33
31
|
*
|
|
34
|
-
* @internal
|
|
35
32
|
*/
|
|
36
33
|
export interface MemoryProvider {
|
|
37
34
|
recall(scope: MemoryScope, query?: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/agents/memory.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/agents/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5D,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF"}
|
package/dist/agents/memory.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/agents/memory.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/agents/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* thread-phase patterns can compose them uniformly. The protocol is types
|
|
7
7
|
* and pure utilities; runtime adapters live in sibling packages.
|
|
8
8
|
*
|
|
9
|
-
* @internal — surface is in development and not covered by semver until
|
|
10
9
|
* AgentAdapter v1 ships. See `potential_feature.md` for the design spec.
|
|
11
10
|
*/
|
|
12
11
|
import type { ActivityEntry, FinishReason, UsageInfo } from '../agent/types.js';
|
|
@@ -20,7 +19,6 @@ export type { MemoryProvider, MemoryScope } from './memory.js';
|
|
|
20
19
|
* - `session-file` is the on-disk transcript used by pi and Claude Code.
|
|
21
20
|
* - `opaque` is the fallback for adapters with proprietary continuation state.
|
|
22
21
|
*
|
|
23
|
-
* @internal
|
|
24
22
|
*/
|
|
25
23
|
export type ResumeToken = {
|
|
26
24
|
kind: 'response-id';
|
|
@@ -39,7 +37,6 @@ export type ResumeToken = {
|
|
|
39
37
|
* serialized errors anyway, so making it uniform avoids a footgun where
|
|
40
38
|
* callers conditionally have raw `Error` instances vs. plain objects.
|
|
41
39
|
*
|
|
42
|
-
* @internal
|
|
43
40
|
*/
|
|
44
41
|
export interface SerializableError {
|
|
45
42
|
name: string;
|
|
@@ -66,7 +63,6 @@ export interface SerializableError {
|
|
|
66
63
|
* malformed request, schema violation). Adapter authors set `true` only when
|
|
67
64
|
* a sensible retry policy could succeed without user intervention.
|
|
68
65
|
*
|
|
69
|
-
* @internal
|
|
70
66
|
*/
|
|
71
67
|
export type AgentEvent = {
|
|
72
68
|
type: 'agent_start';
|
|
@@ -129,7 +125,6 @@ export type AgentEvent = {
|
|
|
129
125
|
* `'aborted'` so cancellation has a first-class encoding instead of being
|
|
130
126
|
* folded into `'error'`.
|
|
131
127
|
*
|
|
132
|
-
* @internal
|
|
133
128
|
*/
|
|
134
129
|
export type AgentFinishReason = FinishReason | 'aborted';
|
|
135
130
|
/**
|
|
@@ -142,7 +137,6 @@ export type AgentFinishReason = FinishReason | 'aborted';
|
|
|
142
137
|
* (required → optional is widening); adapters that don't emit activity entries
|
|
143
138
|
* simply leave the field undefined.
|
|
144
139
|
*
|
|
145
|
-
* @internal
|
|
146
140
|
*/
|
|
147
141
|
export interface AgentRunResult {
|
|
148
142
|
/** Final text output. May be JSON; callers parseJSON or parseStructured. */
|
|
@@ -181,7 +175,6 @@ export interface AgentRunResult {
|
|
|
181
175
|
* call `requireCapability` against this at construction time so pipelines
|
|
182
176
|
* fail fast before any LLM tokens are spent.
|
|
183
177
|
*
|
|
184
|
-
* @internal
|
|
185
178
|
*/
|
|
186
179
|
export interface AgentCapabilities {
|
|
187
180
|
streaming: 'text' | 'turns' | 'final-only';
|
|
@@ -198,7 +191,6 @@ export interface AgentCapabilities {
|
|
|
198
191
|
* by the caller of an individual adapter run. The bus is the multi-subscriber
|
|
199
192
|
* fan-out; the run's events iterable is consumed once.
|
|
200
193
|
*
|
|
201
|
-
* @internal
|
|
202
194
|
*/
|
|
203
195
|
export interface AgentEventBus {
|
|
204
196
|
emit(event: AgentEvent): void;
|
|
@@ -209,7 +201,6 @@ export interface AgentEventBus {
|
|
|
209
201
|
* adapters ignore the ones they can't honor (after declaring so via
|
|
210
202
|
* `AgentCapabilities`).
|
|
211
203
|
*
|
|
212
|
-
* @internal
|
|
213
204
|
*/
|
|
214
205
|
export interface AgentRunOptions {
|
|
215
206
|
signal?: AbortSignal;
|
|
@@ -228,7 +219,6 @@ export interface AgentRunOptions {
|
|
|
228
219
|
* `finishReason: 'error'` with a prior `error` event.
|
|
229
220
|
* - `abort()` is idempotent.
|
|
230
221
|
*
|
|
231
|
-
* @internal
|
|
232
222
|
*/
|
|
233
223
|
export interface AgentRun<TResult extends AgentRunResult = AgentRunResult> {
|
|
234
224
|
readonly events: AsyncIterable<AgentEvent>;
|
|
@@ -246,7 +236,6 @@ export interface AgentRun<TResult extends AgentRunResult = AgentRunResult> {
|
|
|
246
236
|
* (SteerableAgentRun is a subtype). Consumers narrow at the call site
|
|
247
237
|
* via `isSteerable(run)`.
|
|
248
238
|
*
|
|
249
|
-
* @internal
|
|
250
239
|
*/
|
|
251
240
|
export interface SteerableAgentRun<TResult extends AgentRunResult = AgentRunResult> extends AgentRun<TResult> {
|
|
252
241
|
/**
|
|
@@ -270,14 +259,12 @@ export interface SteerableAgentRun<TResult extends AgentRunResult = AgentRunResu
|
|
|
270
259
|
* const run = hermesAgent.adapter(...);
|
|
271
260
|
* if (isSteerable(run)) await run.followUp('also do X');
|
|
272
261
|
*
|
|
273
|
-
* @internal
|
|
274
262
|
*/
|
|
275
263
|
export declare function isSteerable<TResult extends AgentRunResult>(run: AgentRun<TResult>): run is SteerableAgentRun<TResult>;
|
|
276
264
|
/**
|
|
277
265
|
* The adapter signature. Must return synchronously — the run starts lazily
|
|
278
266
|
* when either `events` is iterated or `result` is awaited.
|
|
279
267
|
*
|
|
280
|
-
* @internal
|
|
281
268
|
*/
|
|
282
269
|
export type AgentAdapter<TConfig, TResult extends AgentRunResult = AgentRunResult> = (config: TConfig, options?: AgentRunOptions) => AgentRun<TResult>;
|
|
283
270
|
/**
|
|
@@ -285,7 +272,6 @@ export type AgentAdapter<TConfig, TResult extends AgentRunResult = AgentRunResul
|
|
|
285
272
|
* every emitted event), a declared `capabilities` descriptor, and the
|
|
286
273
|
* adapter function itself.
|
|
287
274
|
*
|
|
288
|
-
* @internal
|
|
289
275
|
*/
|
|
290
276
|
export interface AgentAdapterMeta<TConfig, TResult extends AgentRunResult = AgentRunResult> {
|
|
291
277
|
readonly id: string;
|
|
@@ -296,7 +282,6 @@ export interface AgentAdapterMeta<TConfig, TResult extends AgentRunResult = Agen
|
|
|
296
282
|
* Identity at runtime; exists for inference and as a hook for future
|
|
297
283
|
* telemetry. Modeled on Vitest's `defineConfig`.
|
|
298
284
|
*
|
|
299
|
-
* @internal
|
|
300
285
|
*/
|
|
301
286
|
export declare function defineAgentAdapter<TConfig, TResult extends AgentRunResult = AgentRunResult>(meta: AgentAdapterMeta<TConfig, TResult>): AgentAdapterMeta<TConfig, TResult>;
|
|
302
287
|
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/agents/protocol.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/agents/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/D,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM/D;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,IAAI,EAA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O,CAAC,IAAI,CAAC,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,SAAS,cAAc,EACxD,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,GACrB,GAAG,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAMnC;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,OAAO,EAAE,OAAO,SAAS,cAAc,GAAG,cAAc,IAAI,CACnF,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,eAAe,KACtB,QAAQ,CAAC,OAAO,CAAC,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,EAAE,OAAO,SAAS,cAAc,GAAG,cAAc;IACxF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;CAClD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,SAAS,cAAc,GAAG,cAAc,EACzF,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,GACvC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAEpC"}
|
package/dist/agents/protocol.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* thread-phase patterns can compose them uniformly. The protocol is types
|
|
7
7
|
* and pure utilities; runtime adapters live in sibling packages.
|
|
8
8
|
*
|
|
9
|
-
* @internal — surface is in development and not covered by semver until
|
|
10
9
|
* AgentAdapter v1 ships. See `potential_feature.md` for the design spec.
|
|
11
10
|
*/
|
|
12
11
|
/**
|
|
@@ -17,7 +16,6 @@
|
|
|
17
16
|
* const run = hermesAgent.adapter(...);
|
|
18
17
|
* if (isSteerable(run)) await run.followUp('also do X');
|
|
19
18
|
*
|
|
20
|
-
* @internal
|
|
21
19
|
*/
|
|
22
20
|
export function isSteerable(run) {
|
|
23
21
|
const candidate = run;
|
|
@@ -28,7 +26,6 @@ export function isSteerable(run) {
|
|
|
28
26
|
* Identity at runtime; exists for inference and as a hook for future
|
|
29
27
|
* telemetry. Modeled on Vitest's `defineConfig`.
|
|
30
28
|
*
|
|
31
|
-
* @internal
|
|
32
29
|
*/
|
|
33
30
|
export function defineAgentAdapter(meta) {
|
|
34
31
|
return meta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/agents/protocol.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/agents/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA4OH;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CACzB,GAAsB;IAEtB,MAAM,SAAS,GAAG,GAA0C,CAAC;IAC7D,OAAO,CACL,OAAO,SAAS,CAAC,QAAQ,KAAK,UAAU;QACxC,OAAO,SAAS,CAAC,KAAK,KAAK,UAAU,CACtC,CAAC;AACJ,CAAC;AAwBD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAwC;IAExC,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -13,13 +13,26 @@
|
|
|
13
13
|
* Retries on parse failure are not executed here — that is an adapter-level
|
|
14
14
|
* concern (the adapter calls `followUp()` with the parse error and retries).
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* # Stability — this file straddles the tier boundary
|
|
17
|
+
*
|
|
18
|
+
* - `StructuredOutputConfig` and `StructuredOutputParseError` are
|
|
19
|
+
* Tier A (stable from v4.0.0). Consumers declare the config shape in
|
|
20
|
+
* adapter options; they must handle the error type from
|
|
21
|
+
* `AgentRunResult.parseError`. Re-exported from `thread-phase/agents`.
|
|
22
|
+
*
|
|
23
|
+
* - `applyStructuredOutputPrompt`, `extractResponseBlock`,
|
|
24
|
+
* `parseStructuredFromText`, `parseStructured` are Tier B (author-
|
|
25
|
+
* unstable). They are implementation helpers for adapters wiring the
|
|
26
|
+
* prompted-output path. Re-exported from `thread-phase/agents/authoring`.
|
|
27
|
+
*
|
|
28
|
+
* NOTE: `parseStructuredFromText` is the closest Tier B export to a
|
|
29
|
+
* Tier A candidate — six bundled adapters use it. If consumer-facing
|
|
30
|
+
* re-parse of a raw response ever becomes a documented use case
|
|
31
|
+
* (e.g. retry-from-cached-text flows), promote it via a stable wrapper.
|
|
17
32
|
*/
|
|
18
33
|
import type { AgentRunResult } from './protocol.js';
|
|
19
34
|
/**
|
|
20
35
|
* Configuration for the prompted structured-output path.
|
|
21
|
-
*
|
|
22
|
-
* @internal
|
|
23
36
|
*/
|
|
24
37
|
export interface StructuredOutputConfig {
|
|
25
38
|
/**
|
|
@@ -44,8 +57,6 @@ export interface StructuredOutputConfig {
|
|
|
44
57
|
/**
|
|
45
58
|
* Distinct error for the prompted-output path. Carries the offending text
|
|
46
59
|
* window so callers can decide whether to retry.
|
|
47
|
-
*
|
|
48
|
-
* @internal
|
|
49
60
|
*/
|
|
50
61
|
export declare class StructuredOutputParseError extends Error {
|
|
51
62
|
window: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-output.d.ts","sourceRoot":"","sources":["../../src/agents/structured-output.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"structured-output.d.ts","sourceRoot":"","sources":["../../src/agents/structured-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IACtC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACf,MAAM,EAAE,MAAM;gBAAtC,OAAO,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM;CAInD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,sBAAsB,GAC3B,MAAM,CAUR;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOhE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAeT;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAET"}
|
|
@@ -13,13 +13,26 @@
|
|
|
13
13
|
* Retries on parse failure are not executed here — that is an adapter-level
|
|
14
14
|
* concern (the adapter calls `followUp()` with the parse error and retries).
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* # Stability — this file straddles the tier boundary
|
|
17
|
+
*
|
|
18
|
+
* - `StructuredOutputConfig` and `StructuredOutputParseError` are
|
|
19
|
+
* Tier A (stable from v4.0.0). Consumers declare the config shape in
|
|
20
|
+
* adapter options; they must handle the error type from
|
|
21
|
+
* `AgentRunResult.parseError`. Re-exported from `thread-phase/agents`.
|
|
22
|
+
*
|
|
23
|
+
* - `applyStructuredOutputPrompt`, `extractResponseBlock`,
|
|
24
|
+
* `parseStructuredFromText`, `parseStructured` are Tier B (author-
|
|
25
|
+
* unstable). They are implementation helpers for adapters wiring the
|
|
26
|
+
* prompted-output path. Re-exported from `thread-phase/agents/authoring`.
|
|
27
|
+
*
|
|
28
|
+
* NOTE: `parseStructuredFromText` is the closest Tier B export to a
|
|
29
|
+
* Tier A candidate — six bundled adapters use it. If consumer-facing
|
|
30
|
+
* re-parse of a raw response ever becomes a documented use case
|
|
31
|
+
* (e.g. retry-from-cached-text flows), promote it via a stable wrapper.
|
|
17
32
|
*/
|
|
18
33
|
/**
|
|
19
34
|
* Distinct error for the prompted-output path. Carries the offending text
|
|
20
35
|
* window so callers can decide whether to retry.
|
|
21
|
-
*
|
|
22
|
-
* @internal
|
|
23
36
|
*/
|
|
24
37
|
export class StructuredOutputParseError extends Error {
|
|
25
38
|
window;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-output.js","sourceRoot":"","sources":["../../src/agents/structured-output.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"structured-output.js","sourceRoot":"","sources":["../../src/agents/structured-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AA4BH;;;GAGG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACf;IAApC,YAAY,OAAe,EAAS,MAAc;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QADmB,WAAM,GAAN,MAAM,CAAQ;QAEhD,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAoB,EACpB,IAA4B;IAE5B,MAAM,UAAU,GACd,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvF,MAAM,WAAW,GACf,mFAAmF;QACnF,gDAAgD;QAChD,UAAU;QACV,kDAAkD,CAAC;IACrD,M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E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAsB,EACtB,IAA4B;IAE5B,OAAO,uBAAuB,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC"}
|
package/dist/agents/thread.d.ts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* adapter, it renders the canonical events into a permissive message log
|
|
10
10
|
* via `threadToMessages` and starts a fresh session.
|
|
11
11
|
*
|
|
12
|
-
* @internal
|
|
13
12
|
*/
|
|
14
13
|
import type { AgentEvent, ResumeToken } from './protocol.js';
|
|
15
14
|
import type { Message } from '../messages.js';
|
|
@@ -21,19 +20,14 @@ import type { Message } from '../messages.js';
|
|
|
21
20
|
* to adapter-native state. Adapters set their own token, never another
|
|
22
21
|
* adapter's.
|
|
23
22
|
*
|
|
24
|
-
* @internal
|
|
25
23
|
*/
|
|
26
24
|
export interface Thread {
|
|
27
25
|
events: AgentEvent[];
|
|
28
26
|
resumeTokens: Record<string, ResumeToken>;
|
|
29
27
|
}
|
|
30
|
-
/** @internal */
|
|
31
28
|
export declare function createThread(): Thread;
|
|
32
|
-
/** @internal */
|
|
33
29
|
export declare function appendEvent(thread: Thread, event: AgentEvent): void;
|
|
34
|
-
/** @internal */
|
|
35
30
|
export declare function resumeTokenFor(thread: Thread, adapterId: string): ResumeToken | undefined;
|
|
36
|
-
/** @internal */
|
|
37
31
|
export declare function setResumeToken(thread: Thread, adapterId: string, token: ResumeToken): void;
|
|
38
32
|
/**
|
|
39
33
|
* Render canonical events into thread-phase's internal `Message[]` for
|
|
@@ -51,7 +45,6 @@ export declare function setResumeToken(thread: Thread, adapterId: string, token:
|
|
|
51
45
|
*
|
|
52
46
|
* Treat the output as conversation history, not as an authoritative log.
|
|
53
47
|
*
|
|
54
|
-
* @internal
|
|
55
48
|
*/
|
|
56
49
|
export declare function threadToMessages(thread: Thread): Message[];
|
|
57
50
|
//# sourceMappingURL=thread.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/agents/thread.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/agents/thread.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CAC3C;AACD,wBAAgB,YAAY,IAAI,MAAM,CAErC;AACD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAEnE;AACD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEzF;AACD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAE1F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,EAAE,CAmE1D"}
|
package/dist/agents/thread.js
CHANGED
|
@@ -9,21 +9,16 @@
|
|
|
9
9
|
* adapter, it renders the canonical events into a permissive message log
|
|
10
10
|
* via `threadToMessages` and starts a fresh session.
|
|
11
11
|
*
|
|
12
|
-
* @internal
|
|
13
12
|
*/
|
|
14
|
-
/** @internal */
|
|
15
13
|
export function createThread() {
|
|
16
14
|
return { events: [], resumeTokens: {} };
|
|
17
15
|
}
|
|
18
|
-
/** @internal */
|
|
19
16
|
export function appendEvent(thread, event) {
|
|
20
17
|
thread.events.push(event);
|
|
21
18
|
}
|
|
22
|
-
/** @internal */
|
|
23
19
|
export function resumeTokenFor(thread, adapterId) {
|
|
24
20
|
return thread.resumeTokens[adapterId];
|
|
25
21
|
}
|
|
26
|
-
/** @internal */
|
|
27
22
|
export function setResumeToken(thread, adapterId, token) {
|
|
28
23
|
thread.resumeTokens[adapterId] = token;
|
|
29
24
|
}
|
|
@@ -43,7 +38,6 @@ export function setResumeToken(thread, adapterId, token) {
|
|
|
43
38
|
*
|
|
44
39
|
* Treat the output as conversation history, not as an authoritative log.
|
|
45
40
|
*
|
|
46
|
-
* @internal
|
|
47
41
|
*/
|
|
48
42
|
export function threadToMessages(thread) {
|
|
49
43
|
const out = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread.js","sourceRoot":"","sources":["../../src/agents/thread.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"thread.js","sourceRoot":"","sources":["../../src/agents/thread.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH,MAAM,UAAU,YAAY;IAC1B,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;AAC1C,CAAC;AACD,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,KAAiB;IAC3D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,MAAc,EAAE,SAAiB;IAC9D,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,MAAc,EAAE,SAAiB,EAAE,KAAkB;IAClF,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IA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BACP,IAAI,EAAE,MAAM;oBACZ,UAAU,EAAE,KAAK,CAAC,EAAE;oBACpB,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC;iBACxC,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,WAAW;gBACd,cAAc,EAAE,CAAC;gBACjB,MAAM;YACR,KAAK,aAAa,CAAC;YACnB,KAAK,OAAO,CAAC;YACb,KAAK,QAAQ,CAAC;YACd,KAAK,UAAU;gBACb,oEAAoE;gBACpE,wEAAwE;gBACxE,MAAM;QACV,CAAC;IACH,CAAC;IAED,uEAAuE;IACvE,cAAc,EAAE,CAAC;IAEjB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzE,OAAO,KAAgC,CAAC;IAC1C,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAe;IACvC,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC9C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -22,10 +22,8 @@
|
|
|
22
22
|
* (`memory:recall_failed` / `memory:remember_failed`); the run
|
|
23
23
|
* itself never fails because of memory.
|
|
24
24
|
*
|
|
25
|
-
* @internal
|
|
26
25
|
*/
|
|
27
26
|
import type { AgentAdapterMeta, MemoryScope } from './protocol.js';
|
|
28
|
-
/** @internal */
|
|
29
27
|
export interface WithMemoryOptions<TConfig> {
|
|
30
28
|
/** Identity scope (`userId` required; `appId` / `sessionId` optional). */
|
|
31
29
|
scope: MemoryScope;
|
|
@@ -49,7 +47,6 @@ export interface WithMemoryOptions<TConfig> {
|
|
|
49
47
|
* of `options.memoryProvider` at call time — no provider, no memory
|
|
50
48
|
* activity.
|
|
51
49
|
*
|
|
52
|
-
* @internal
|
|
53
50
|
*/
|
|
54
51
|
export declare function withMemory<TConfig>(meta: AgentAdapterMeta<TConfig>, opts: WithMemoryOptions<TConfig>): AgentAdapterMeta<TConfig>;
|
|
55
52
|
//# sourceMappingURL=with-memory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-memory.d.ts","sourceRoot":"","sources":["../../src/agents/with-memory.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"with-memory.d.ts","sourceRoot":"","sources":["../../src/agents/with-memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAKhB,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,iBAAiB,CAAC,OAAO;IACxC,0EAA0E;IAC1E,KAAK,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IACrD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAChC,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAC/B,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAC/B,gBAAgB,CAAC,OAAO,CAAC,CAyH3B"}
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
* (`memory:recall_failed` / `memory:remember_failed`); the run
|
|
23
23
|
* itself never fails because of memory.
|
|
24
24
|
*
|
|
25
|
-
* @internal
|
|
26
25
|
*/
|
|
27
26
|
import { createEventBus } from './event-bus.js';
|
|
28
27
|
import { serializeError } from './serialize-error.js';
|
|
@@ -32,7 +31,6 @@ import { serializeError } from './serialize-error.js';
|
|
|
32
31
|
* of `options.memoryProvider` at call time — no provider, no memory
|
|
33
32
|
* activity.
|
|
34
33
|
*
|
|
35
|
-
* @internal
|
|
36
34
|
*/
|
|
37
35
|
export function withMemory(meta, opts) {
|
|
38
36
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-memory.js","sourceRoot":"","sources":["../../src/agents/with-memory.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"with-memory.js","sourceRoot":"","sources":["../../src/agents/with-memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAShD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAmBtD;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CACxB,IAA+B,EAC/B,IAAgC;IAEhC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,EAAY,EAAE;YACxC,MAAM,QAAQ,GAAG,UAAU,EAAE,cAAc,CAAC;YAC5C,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,kDAAkD;gBAClD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YAC1C,CAAC;YAED,kEAAkE;YAClE,kEAAkE;YAClE,iBAAiB;YACjB,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;YAClC,MAAM,QAAQ,GAAiB,EAAE,CAAC;YAClC,MAAM,OAAO,GAAG,UAAU,EAAE,QAAQ,CAAC;YACrC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE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I,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAChD,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,QAAQ,CAAC,IAAI,CAAC;wBACZ,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE,IAAI,CAAC,EAAE;wBACf,IAAI,EAAE,wBAAwB;wBAC9B,OAAO,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE;qBACxC,CAAC,CAAC;gBACL,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,EAAE,CAAC;YAEL,OAAO;gBACL,MAAM;gBACN,MAAM;gBACN,KAAK,CAAC,MAAe;oBACnB,gEAAgE;oBAChE,iEAAiE;oBACjE,KAAK,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;gBAClD,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -17,11 +17,9 @@
|
|
|
17
17
|
* a cross-pipeline backend. Thread mutation happens through the same
|
|
18
18
|
* `appendEvent` / `setResumeToken` helpers callers would use manually.
|
|
19
19
|
*
|
|
20
|
-
* @internal
|
|
21
20
|
*/
|
|
22
21
|
import type { AgentAdapterMeta, ResumeToken } from './protocol.js';
|
|
23
22
|
import { type Thread } from './thread.js';
|
|
24
|
-
/** @internal */
|
|
25
23
|
export interface WithThreadOptions<TConfig> {
|
|
26
24
|
/**
|
|
27
25
|
* Splice the thread's per-adapter resume token into the inner config.
|
|
@@ -39,7 +37,6 @@ export interface WithThreadOptions<TConfig> {
|
|
|
39
37
|
* Mutation is in-place on the supplied thread. The wrapper does not
|
|
40
38
|
* defensively clone — caller controls the thread's lifetime.
|
|
41
39
|
*
|
|
42
|
-
* @internal
|
|
43
40
|
*/
|
|
44
41
|
export declare function withThread<TConfig>(meta: AgentAdapterMeta<TConfig>, thread: Thread, opts?: WithThreadOptions<TConfig>): AgentAdapterMeta<TConfig>;
|
|
45
42
|
//# sourceMappingURL=with-thread.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-thread.d.ts","sourceRoot":"","sources":["../../src/agents/with-thread.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"with-thread.d.ts","sourceRoot":"","sources":["../../src/agents/with-thread.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAGhB,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,KAAK,MAAM,EACZ,MAAM,aAAa,CAAC;AACrB,MAAM,WAAW,iBAAiB,CAAC,OAAO;IACxC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC;CACtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAChC,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAC/B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,iBAAiB,CAAC,OAAO,CAAM,GACpC,gBAAgB,CAAC,OAAO,CAAC,CAuC3B"}
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* a cross-pipeline backend. Thread mutation happens through the same
|
|
18
18
|
* `appendEvent` / `setResumeToken` helpers callers would use manually.
|
|
19
19
|
*
|
|
20
|
-
* @internal
|
|
21
20
|
*/
|
|
22
21
|
import { createEventBus } from './event-bus.js';
|
|
23
22
|
import { appendEvent, resumeTokenFor, setResumeToken, } from './thread.js';
|
|
@@ -29,7 +28,6 @@ import { appendEvent, resumeTokenFor, setResumeToken, } from './thread.js';
|
|
|
29
28
|
* Mutation is in-place on the supplied thread. The wrapper does not
|
|
30
29
|
* defensively clone — caller controls the thread's lifetime.
|
|
31
30
|
*
|
|
32
|
-
* @internal
|
|
33
31
|
*/
|
|
34
32
|
export function withThread(meta, thread, opts = {}) {
|
|
35
33
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-thread.js","sourceRoot":"","sources":["../../src/agents/with-thread.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"with-thread.js","sourceRoot":"","sources":["../../src/agents/with-thread.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAOhD,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,GAEf,MAAM,aAAa,CAAC;AAWrB;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CACxB,IAA+B,EAC/B,MAAc,EACd,OAAmC,EAAE;IAErC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,EAAY,EAAE;YACxC,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;YACjD,MAAM,SAAS,GAAG,QAAQ,IAAI,IAAI,CAAC,WAAW;gBAC5C,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;gBACpC,CAAC,CAAC,MAAM,CAAC;YAEX,iEAAiE;YACjE,uDAAuD;YACvD,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;YAClC,MAAM,OAAO,GAAG,UAAU,EAAE,QAAQ,CAAC;YACrC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE;gBACpB,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;gBAC3B,IACE,CAAC,KAAK,CAAC,IAAI,KAAK,aAAa,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC;oBAC5D,KAAK,CAAC,WAAW,EACjB,CAAC;oBACD,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;gBACrD,CAAC;gBACD,IAAI,OAAO,EAAE,CAAC;oBACZ,IAAI,CAAC;wBACH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBACtB,CAAC;oBAAC,MAAM,CAAC;wBACP,uDAAuD;oBACzD,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAoB;gBACpC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;gBACrB,QAAQ,EAAE,QAAQ;aACnB,CAAC;YAEF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autonome-research/thread-phase",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "TypeScript substrate for building automation workflows that coordinate AI agents. Phase ordering, typed shared state, persistence, fanout, event flow.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"./session": "./dist/session/index.js",
|
|
14
14
|
"./tools": "./dist/tools/index.js",
|
|
15
15
|
"./agents": "./dist/agents/index.js",
|
|
16
|
+
"./agents/authoring": "./dist/agents/authoring/index.js",
|
|
16
17
|
"./agents/test-utils": "./dist/agents/test-utils/index.js",
|
|
17
18
|
"./triggers": "./dist/triggers/index.js"
|
|
18
19
|
},
|