@owlmeans/agent 0.1.18-rc.46 → 0.1.18-rc.47
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/README.md +1 -1
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/agent/SKILL.md +1 -1
- package/build/helpers/compaction.d.ts +1 -22
- package/build/helpers/compaction.d.ts.map +1 -1
- package/build/helpers/compaction.js +1 -10
- package/build/helpers/compaction.js.map +1 -1
- package/build/helpers/consts.local.d.ts +7 -0
- package/build/helpers/consts.local.d.ts.map +1 -0
- package/build/helpers/consts.local.js +11 -0
- package/build/helpers/consts.local.js.map +1 -0
- package/build/helpers/index.d.ts +1 -0
- package/build/helpers/index.d.ts.map +1 -1
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/rolling.d.ts +1 -15
- package/build/helpers/rolling.d.ts.map +1 -1
- package/build/helpers/rolling.js.map +1 -1
- package/build/helpers/tools.d.ts +1 -4
- package/build/helpers/tools.d.ts.map +1 -1
- package/build/helpers/tools.js.map +1 -1
- package/build/helpers/types.d.ts +42 -0
- package/build/helpers/types.d.ts.map +1 -0
- package/build/helpers/types.js +2 -0
- package/build/helpers/types.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/pipeline/consts.d.ts +5 -0
- package/build/pipeline/consts.d.ts.map +1 -0
- package/build/pipeline/consts.js +10 -0
- package/build/pipeline/consts.js.map +1 -0
- package/build/pipeline/consts.local.d.ts +12 -0
- package/build/pipeline/consts.local.d.ts.map +1 -0
- package/build/pipeline/consts.local.js +12 -0
- package/build/pipeline/consts.local.js.map +1 -0
- package/build/pipeline/index.d.ts +1 -0
- package/build/pipeline/index.d.ts.map +1 -1
- package/build/pipeline/index.js +1 -0
- package/build/pipeline/index.js.map +1 -1
- package/build/pipeline/results.d.ts +2 -98
- package/build/pipeline/results.d.ts.map +1 -1
- package/build/pipeline/results.js +3 -11
- package/build/pipeline/results.js.map +1 -1
- package/build/pipeline/runner.d.ts +1 -1
- package/build/pipeline/runner.d.ts.map +1 -1
- package/build/pipeline/runner.js +2 -11
- package/build/pipeline/runner.js.map +1 -1
- package/build/pipeline/types.d.ts +93 -2
- package/build/pipeline/types.d.ts.map +1 -1
- package/build/pipeline/types.local.d.ts +55 -0
- package/build/pipeline/types.local.d.ts.map +1 -0
- package/build/pipeline/types.local.js +2 -0
- package/build/pipeline/types.local.js.map +1 -0
- package/build/plugins/consts.d.ts +10 -0
- package/build/plugins/consts.d.ts.map +1 -0
- package/build/plugins/consts.js +10 -0
- package/build/plugins/consts.js.map +1 -0
- package/build/plugins/consts.local.d.ts +3 -0
- package/build/plugins/consts.local.d.ts.map +1 -0
- package/build/plugins/consts.local.js +3 -0
- package/build/plugins/consts.local.js.map +1 -0
- package/build/plugins/export.d.ts +12 -8
- package/build/plugins/export.d.ts.map +1 -1
- package/build/plugins/export.js +8 -4
- package/build/plugins/export.js.map +1 -1
- package/build/plugins/inquiry.d.ts +2 -21
- package/build/plugins/inquiry.d.ts.map +1 -1
- package/build/plugins/inquiry.js +1 -2
- package/build/plugins/inquiry.js.map +1 -1
- package/build/plugins/memory-events.d.ts +2 -21
- package/build/plugins/memory-events.d.ts.map +1 -1
- package/build/plugins/memory-events.js +1 -3
- package/build/plugins/memory-events.js.map +1 -1
- package/build/plugins/memory-graph.d.ts +1 -26
- package/build/plugins/memory-graph.d.ts.map +1 -1
- package/build/plugins/memory-graph.js +1 -3
- package/build/plugins/memory-graph.js.map +1 -1
- package/build/plugins/summarize.d.ts +2 -30
- package/build/plugins/summarize.d.ts.map +1 -1
- package/build/plugins/summarize.js +2 -3
- package/build/plugins/summarize.js.map +1 -1
- package/build/plugins/types.d.ts +85 -0
- package/build/plugins/types.d.ts.map +1 -0
- package/build/plugins/types.js +2 -0
- package/build/plugins/types.js.map +1 -0
- package/build/plugins/types.local.d.ts +11 -0
- package/build/plugins/types.local.d.ts.map +1 -0
- package/build/plugins/types.local.js +2 -0
- package/build/plugins/types.local.js.map +1 -0
- package/build/runtime/transport.d.ts +1 -18
- package/build/runtime/transport.d.ts.map +1 -1
- package/build/runtime/transport.js.map +1 -1
- package/build/runtime/types.d.ts +19 -0
- package/build/runtime/types.d.ts.map +1 -0
- package/build/runtime/types.js +2 -0
- package/build/runtime/types.js.map +1 -0
- package/build/service.d.ts +2 -3
- package/build/service.d.ts.map +1 -1
- package/build/service.js +1 -2
- package/build/service.js.map +1 -1
- package/build/types.d.ts +3 -3
- package/build/types.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/helpers/compaction.ts +2 -36
- package/src/helpers/consts.local.ts +13 -0
- package/src/helpers/index.ts +1 -0
- package/src/helpers/rolling.ts +1 -16
- package/src/helpers/tools.ts +1 -3
- package/src/helpers/types.ts +43 -0
- package/src/index.ts +1 -0
- package/src/pipeline/consts.local.ts +13 -0
- package/src/pipeline/consts.ts +10 -0
- package/src/pipeline/index.ts +1 -0
- package/src/pipeline/results.ts +5 -180
- package/src/pipeline/runner.ts +4 -44
- package/src/pipeline/types.local.ts +61 -0
- package/src/pipeline/types.ts +116 -5
- package/src/plugins/consts.local.ts +3 -0
- package/src/plugins/consts.ts +15 -0
- package/src/plugins/export.ts +12 -10
- package/src/plugins/inquiry.ts +5 -33
- package/src/plugins/memory-events.ts +2 -24
- package/src/plugins/memory-graph.ts +3 -30
- package/src/plugins/summarize.ts +4 -34
- package/src/plugins/types.local.ts +11 -0
- package/src/plugins/types.ts +90 -0
- package/src/runtime/transport.ts +1 -18
- package/src/runtime/types.ts +19 -0
- package/src/service.ts +3 -12
- package/src/types.ts +6 -3
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
84
84
|
your project's skill store (`.agents/skills/`):
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
87
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.48
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/agent",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.47",
|
|
5
|
+
"generatedAt": "2026-10-05T08:32:19.123Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/agent
|
|
9
9
|
|
|
10
10
|
**Layer:** Cross-cutting domain
|
|
11
|
-
**Install:** `"@owlmeans/agent": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/agent": "^0.1.18-rc.47"` in `dependencies`, plus the `@langchain/core` and
|
|
12
12
|
`@langchain/langgraph` **peers**
|
|
13
13
|
|
|
14
14
|
The agent runtime. Contracts live in `@owlmeans/agent-common`.
|
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
import type { BaseMessage } from '@langchain/core/messages';
|
|
2
|
-
import type {
|
|
3
|
-
import { AgentRunStatus } from '@owlmeans/agent-common';
|
|
4
|
-
export interface Compaction {
|
|
5
|
-
summary: string;
|
|
6
|
-
advice?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface CompactionInput {
|
|
9
|
-
/** Omit to skip the model entirely and take the deterministic path. */
|
|
10
|
-
model?: LlmModel;
|
|
11
|
-
/** The ask that opened the run. */
|
|
12
|
-
prompt: string;
|
|
13
|
-
messages: readonly BaseMessage[];
|
|
14
|
-
status: AgentRunStatus;
|
|
15
|
-
/** What happened after the loop — a validation verdict, a build result. */
|
|
16
|
-
note?: string;
|
|
17
|
-
maxSummaryChars?: number;
|
|
18
|
-
maxAdviceChars?: number;
|
|
19
|
-
/** LangChain `runName`. Give it a value the application filters, or the summary of a run streams into the user's view of that run. */
|
|
20
|
-
action?: string;
|
|
21
|
-
/** How much of the transcript to show the model. */
|
|
22
|
-
maxTranscriptChars?: number;
|
|
23
|
-
}
|
|
2
|
+
import type { Compaction, CompactionInput } from './types.js';
|
|
24
3
|
/** The text of a message, whatever content shape it arrived in. */
|
|
25
4
|
export declare const messageText: (message: BaseMessage) => string;
|
|
26
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../src/helpers/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../src/helpers/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAI3D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAI7D,mEAAmE;AACnE,eAAO,MAAM,WAAW,YAAa,WAAW,KAAG,MAalD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aACjB,SAAS,WAAW,EAAE,wBAC/B,MA0BF,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,UAAiB,eAAe,KAAG,OAAO,CAAC,UAAU,CAoElF,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AgentRunStatus, DEFAULT_ADVICE_CHARS, DEFAULT_SUMMARY_CHARS, truncateAt } from '@owlmeans/agent-common';
|
|
2
2
|
import { logger } from '@owlmeans/log';
|
|
3
|
+
import { COMPACTION_SCHEMA, DEFAULT_TRANSCRIPT_CHARS } from './consts.local.js';
|
|
3
4
|
const log = logger('agent');
|
|
4
|
-
const DEFAULT_TRANSCRIPT_CHARS = 24_000;
|
|
5
5
|
/** The text of a message, whatever content shape it arrived in. */
|
|
6
6
|
export const messageText = (message) => {
|
|
7
7
|
const content = message.content;
|
|
@@ -46,15 +46,6 @@ export const renderTranscript = (messages, maxChars = DEFAULT_TRANSCRIPT_CHARS)
|
|
|
46
46
|
}
|
|
47
47
|
return lines.join('\n\n');
|
|
48
48
|
};
|
|
49
|
-
const COMPACTION_SCHEMA = {
|
|
50
|
-
type: 'object',
|
|
51
|
-
properties: {
|
|
52
|
-
summary: { type: 'string' },
|
|
53
|
-
advice: { type: 'string' },
|
|
54
|
-
},
|
|
55
|
-
required: ['summary', 'advice'],
|
|
56
|
-
additionalProperties: false,
|
|
57
|
-
};
|
|
58
49
|
/**
|
|
59
50
|
* Compact a finished run into what the next one needs.
|
|
60
51
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction.js","sourceRoot":"","sources":["../../src/helpers/compaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compaction.js","sourceRoot":"","sources":["../../src/helpers/compaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAChH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAG/E,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAE3B,mEAAmE;AACnE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAoB,EAAU,EAAE;IAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IAC/B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO;aACX,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IA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["../../src/helpers/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,eAAO,MAAM,wBAAwB,QAAS,CAAA;AAE9C,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQjF,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const DEFAULT_TRANSCRIPT_CHARS = 24_000;
|
|
2
|
+
export const COMPACTION_SCHEMA = {
|
|
3
|
+
type: 'object',
|
|
4
|
+
properties: {
|
|
5
|
+
summary: { type: 'string' },
|
|
6
|
+
advice: { type: 'string' },
|
|
7
|
+
},
|
|
8
|
+
required: ['summary', 'advice'],
|
|
9
|
+
additionalProperties: false,
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/helpers/consts.local.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAA;AAE9C,MAAM,CAAC,MAAM,iBAAiB,GAAwD;IACpF,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC3B;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC/B,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
|
package/build/helpers/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAE1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface RollingSummaryInput {
|
|
3
|
-
/** Omit to skip the model and take the deterministic path. */
|
|
4
|
-
model?: LlmModel;
|
|
5
|
-
/** The prose account so far. Empty on the first fold. */
|
|
6
|
-
previous: string;
|
|
7
|
-
/** What just happened, as one line. */
|
|
8
|
-
event: string;
|
|
9
|
-
/** Anything the fold may use but that need not survive into the summary. */
|
|
10
|
-
details?: string;
|
|
11
|
-
/** Hard ceiling on the returned prose, in characters. */
|
|
12
|
-
maxChars: number;
|
|
13
|
-
/** LangChain `runName`. Give it a value the application filters out of its user-facing stream. */
|
|
14
|
-
action?: string;
|
|
15
|
-
}
|
|
1
|
+
import type { RollingSummaryInput } from './types.js';
|
|
16
2
|
/**
|
|
17
3
|
* Fold one event into a running account of a subject, under a hard character ceiling.
|
|
18
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rolling.d.ts","sourceRoot":"","sources":["../../src/helpers/rolling.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rolling.d.ts","sourceRoot":"","sources":["../../src/helpers/rolling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAIrD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,UAAiB,mBAAmB,KAAG,OAAO,CAAC,MAAM,CAyCtF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rolling.js","sourceRoot":"","sources":["../../src/helpers/rolling.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rolling.js","sourceRoot":"","sources":["../../src/helpers/rolling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAE3B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EAAE,KAA0B,EAAmB,EAAE;IACzF,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,uBAAuB,EAAE,GAAG,KAAK,CAAA;IAE7F,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAA;IACvC,MAAM,QAAQ,GAAG,GAAW,EAAE,CAAC,eAAe,KAAK,EAAE;QACnD,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC;QAC7B,CAAC,CAAC,UAAU,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;IAEzC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,QAAQ,EAAE,CAAA;IACnB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,CAC5B;;;yEAGmE,QAAQ;;;;;;;;;EAS/E,eAAe,KAAK,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,eAAe;;;EAGnE,KAAK,GAAG,OAAO,IAAI,IAAI,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE;OACtE,EACD,EAAE,MAAM,EAAE,CACX,CAAA;QAED,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAA;QAElD,OAAO,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAA;IAC9C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,GAAG,CAAC,IAAI,CAAC,2DAA2D,EAAE,CAAC,CAAC,CAAA;QACxE,OAAO,QAAQ,EAAE,CAAA;IACnB,CAAC;AACH,CAAC,CAAA"}
|
package/build/helpers/tools.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { ToolCall } from '@langchain/core/messages';
|
|
2
2
|
import type { AgentToolSet } from '../types.js';
|
|
3
|
-
|
|
4
|
-
export interface ToolErrorResponse {
|
|
5
|
-
error: string;
|
|
6
|
-
}
|
|
3
|
+
import type { ToolErrorResponse } from './types.js';
|
|
7
4
|
export declare const toErrorResponse: (e: unknown) => ToolErrorResponse;
|
|
8
5
|
export declare const isToolError: (result: unknown) => result is ToolErrorResponse;
|
|
9
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/helpers/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/helpers/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAInD,eAAO,MAAM,eAAe,MAAO,OAAO,KAAG,iBAC2C,CAAA;AAExF,eAAO,MAAM,WAAW,WAAY,OAAO,KAAG,MAAM,IAAI,iBACW,CAAA;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,cAAc,UAClB,YAAY,YAAY,QAAQ,UAAU,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,KACvE,OAAO,CAAC,OAAO,CAiBjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/helpers/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/helpers/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAItC,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AAEjC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAU,EAAqB,EAAE,CAC/D,CAAC,EAAE,KAAK,EAAE,2BAA2B,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAExF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAe,EAA+B,EAAE,CAC1E,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,MAAM,CAAA;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,KAAmB,EAAE,QAAkB,EAAE,KAA+B,EACtD,EAAE;IACpB,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;WAC5B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAA;IAErE,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,OAAO,eAAe,CAAC,IAAI,KAAK,CAAC,QAAQ,QAAQ,CAAC,IAAI,YAAY,CAAC,CAAC,CAAA;IACtE,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACxB,MAAM,CAAC,CAAA;QACT,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;QAC/D,OAAO,eAAe,CAAC,CAAC,CAAC,CAAA;IAC3B,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { LlmModel } from '@owlmeans/llm';
|
|
2
|
+
import type { BaseMessage } from '@langchain/core/messages';
|
|
3
|
+
import { AgentRunStatus } from '@owlmeans/agent-common';
|
|
4
|
+
export interface Compaction {
|
|
5
|
+
summary: string;
|
|
6
|
+
advice?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CompactionInput {
|
|
9
|
+
/** Omit to skip the model entirely and take the deterministic path. */
|
|
10
|
+
model?: LlmModel;
|
|
11
|
+
/** The ask that opened the run. */
|
|
12
|
+
prompt: string;
|
|
13
|
+
messages: readonly BaseMessage[];
|
|
14
|
+
status: AgentRunStatus;
|
|
15
|
+
/** What happened after the loop — a validation verdict, a build result. */
|
|
16
|
+
note?: string;
|
|
17
|
+
maxSummaryChars?: number;
|
|
18
|
+
maxAdviceChars?: number;
|
|
19
|
+
/** LangChain `runName`. Give it a value the application filters, or the summary of a run streams into the user's view of that run. */
|
|
20
|
+
action?: string;
|
|
21
|
+
/** How much of the transcript to show the model. */
|
|
22
|
+
maxTranscriptChars?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface RollingSummaryInput {
|
|
25
|
+
/** Omit to skip the model and take the deterministic path. */
|
|
26
|
+
model?: LlmModel;
|
|
27
|
+
/** The prose account so far. Empty on the first fold. */
|
|
28
|
+
previous: string;
|
|
29
|
+
/** What just happened, as one line. */
|
|
30
|
+
event: string;
|
|
31
|
+
/** Anything the fold may use but that need not survive into the summary. */
|
|
32
|
+
details?: string;
|
|
33
|
+
/** Hard ceiling on the returned prose, in characters. */
|
|
34
|
+
maxChars: number;
|
|
35
|
+
/** LangChain `runName`. Give it a value the application filters out of its user-facing stream. */
|
|
36
|
+
action?: string;
|
|
37
|
+
}
|
|
38
|
+
/** The shape a contained tool failure comes back as. Matches what tool bodies return themselves. */
|
|
39
|
+
export interface ToolErrorResponse {
|
|
40
|
+
error: string;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/helpers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAA;IAChC,MAAM,EAAE,cAAc,CAAA;IACtB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sIAAsI;IACtI,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAA;IAChB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;IACb,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAA;IAChB,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,oGAAoG;AACpG,MAAM,WAAW,iBAAiB;IAAG,KAAK,EAAE,MAAM,CAAA;CAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/helpers/types.ts"],"names":[],"mappings":""}
|
package/build/index.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export * from './pipeline/index.js';
|
|
|
9
9
|
export * from './checkpoint/index.js';
|
|
10
10
|
export * from './runtime/provider.js';
|
|
11
11
|
export * from './runtime/transport.js';
|
|
12
|
+
export type * from './runtime/types.js';
|
|
12
13
|
export * from './plugins/export.js';
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,mBAAmB,oBAAoB,CAAA;AACvC,cAAc,qBAAqB,CAAA"}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAE3B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAE3B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AAEtC,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The plugin's alias. Seated under it, so wiring it twice replaces rather than doubles. */
|
|
2
|
+
export declare const CUMULATIVE_RESULTS_PLUGIN = "cumulative-results";
|
|
3
|
+
/** The answer shape a summary is asked for when its declaration names none. */
|
|
4
|
+
export declare const DEFAULT_RESULT_SUMMARY_SCHEMA: Record<string, unknown>;
|
|
5
|
+
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/pipeline/consts.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,eAAO,MAAM,yBAAyB,uBAAuB,CAAA;AAE7D,+EAA+E;AAC/E,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAKjE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The plugin's alias. Seated under it, so wiring it twice replaces rather than doubles. */
|
|
2
|
+
export const CUMULATIVE_RESULTS_PLUGIN = 'cumulative-results';
|
|
3
|
+
/** The answer shape a summary is asked for when its declaration names none. */
|
|
4
|
+
export const DEFAULT_RESULT_SUMMARY_SCHEMA = {
|
|
5
|
+
type: 'object',
|
|
6
|
+
properties: { summary: { type: 'string' } },
|
|
7
|
+
required: ['summary'],
|
|
8
|
+
additionalProperties: false,
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/pipeline/consts.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,MAAM,CAAC,MAAM,yBAAyB,GAAG,oBAAoB,CAAA;AAE7D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,6BAA6B,GAA4B;IACpE,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC3C,QAAQ,EAAE,CAAC,SAAS,CAAC;IACrB,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const SEPARATOR = "\n\n";
|
|
2
|
+
/** Ordering weight of a pipeline plugin that declares none. */
|
|
3
|
+
export declare const DEFAULT_PIPELINE_PLUGIN_ORDER = 50;
|
|
4
|
+
/**
|
|
5
|
+
* How many questions ONE composing step may relay for its child before it gives up.
|
|
6
|
+
*
|
|
7
|
+
* A composed pipeline that keeps asking is a pipeline that will never finish, and the parent is the
|
|
8
|
+
* only place with a count to bound it: each round is a fresh child invocation, so nothing else in
|
|
9
|
+
* the stack can see that it is the same step asking again.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MAX_INQUIRY_ROUNDS = 8;
|
|
12
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/pipeline/consts.local.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,SAAS,CAAA;AAE/B,+DAA+D;AAC/D,eAAO,MAAM,6BAA6B,KAAK,CAAA;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const SEPARATOR = '\n\n';
|
|
2
|
+
/** Ordering weight of a pipeline plugin that declares none. */
|
|
3
|
+
export const DEFAULT_PIPELINE_PLUGIN_ORDER = 50;
|
|
4
|
+
/**
|
|
5
|
+
* How many questions ONE composing step may relay for its child before it gives up.
|
|
6
|
+
*
|
|
7
|
+
* A composed pipeline that keeps asking is a pipeline that will never finish, and the parent is the
|
|
8
|
+
* only place with a count to bound it: each round is a fresh child invocation, so nothing else in
|
|
9
|
+
* the stack can see that it is the same step asking again.
|
|
10
|
+
*/
|
|
11
|
+
export const MAX_INQUIRY_ROUNDS = 8;
|
|
12
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/pipeline/consts.local.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAA;AAE/B,+DAA+D;AAC/D,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,mBAAmB,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA"}
|
package/build/pipeline/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
|
|
@@ -1,101 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import type { PipelineEnterMode, PipelineParentRef, PipelinePlugin } from './types.js';
|
|
4
|
-
/** The plugin's alias. Seated under it, so wiring it twice replaces rather than doubles. */
|
|
5
|
-
export declare const CUMULATIVE_RESULTS_PLUGIN = "cumulative-results";
|
|
6
|
-
/** The answer shape a summary is asked for when its declaration names none. */
|
|
7
|
-
export declare const DEFAULT_RESULT_SUMMARY_SCHEMA: Record<string, unknown>;
|
|
8
|
-
/** What a declaration resolver, a seed and a ledger resolver are told about the run. */
|
|
9
|
-
export interface ResultsRunInfo<S extends PipelineState, C> {
|
|
10
|
-
pipeline: string;
|
|
11
|
-
spec: PipelineSpec;
|
|
12
|
-
runId: string;
|
|
13
|
-
scope: string;
|
|
14
|
-
entityId?: string;
|
|
15
|
-
deps: C;
|
|
16
|
-
state: Readonly<S>;
|
|
17
|
-
mode: PipelineEnterMode;
|
|
18
|
-
parent?: PipelineParentRef;
|
|
19
|
-
}
|
|
20
|
-
/** What an extractor reads facts from. */
|
|
21
|
-
export interface ResultExtractInput<S extends PipelineState, C> {
|
|
22
|
-
pipeline: string;
|
|
23
|
-
runId: string;
|
|
24
|
-
step: string;
|
|
25
|
-
/** Durable: the run's state, restored from its row on a resume. */
|
|
26
|
-
state: Readonly<S>;
|
|
27
|
-
deps: C;
|
|
28
|
-
/** Every file the entry answers for — its durable scope and whatever its step recorded. */
|
|
29
|
-
files: readonly string[];
|
|
30
|
-
/** What was recorded as touched on THIS pass — empty on a rebuild. */
|
|
31
|
-
changed: readonly string[];
|
|
32
|
-
}
|
|
33
|
-
export type ResultScopeInput<S extends PipelineState, C> = Omit<ResultExtractInput<S, C>, 'files' | 'changed'>;
|
|
34
|
-
/**
|
|
35
|
-
* Facts from files. DETERMINISTIC — the same inputs give the same facts — and never a model
|
|
36
|
-
* call: an extractor is what makes a fact a fact, and a rebuild after a crash must find exactly
|
|
37
|
-
* what the first pass found.
|
|
38
|
-
*/
|
|
39
|
-
export type ResultExtractFn<S extends PipelineState, C> = (input: ResultExtractInput<S, C>) => Promise<CumulativeResultFact[]> | CumulativeResultFact[];
|
|
40
|
-
export interface ResultExtractorSpec<S extends PipelineState, C> {
|
|
41
|
-
/**
|
|
42
|
-
* The files this extractor answers for, recomputed from DURABLE inputs — the state's keys, the
|
|
43
|
-
* file tree — and never from what a step happened to report. It is what a rebuild reads when
|
|
44
|
-
* nothing was recorded, so a step's facts can be found again after the process that ran it died.
|
|
45
|
-
*/
|
|
46
|
-
scope?: (input: ResultScopeInput<S, C>) => Promise<string[]> | string[];
|
|
47
|
-
extract: ResultExtractFn<S, C>;
|
|
48
|
-
}
|
|
49
|
-
export type ResultExtractor<S extends PipelineState, C> = ResultExtractFn<S, C> | ResultExtractorSpec<S, C>;
|
|
50
|
-
/** Facts known before any step of the run ran. Called on every entry of the run; deterministic. */
|
|
51
|
-
export type ResultSeed<S extends PipelineState, C> = (run: ResultsRunInfo<S, C>) => Promise<CumulativeResultFact[]> | CumulativeResultFact[];
|
|
52
|
-
/** Everything a summarize callback needs, including a ready prompt. */
|
|
53
|
-
export interface ResultSummaryRequest<S extends PipelineState, C> extends ResultSummarySpec {
|
|
54
|
-
schema: Record<string, unknown>;
|
|
55
|
-
maxChars: number;
|
|
56
|
-
pipeline: string;
|
|
57
|
-
runId: string;
|
|
58
|
-
step: string;
|
|
59
|
-
label: string;
|
|
60
|
-
facts: readonly CumulativeResultFact[];
|
|
61
|
-
files: readonly string[];
|
|
62
|
-
state: Readonly<S>;
|
|
63
|
-
deps: C;
|
|
64
|
-
signal: AbortSignal;
|
|
65
|
-
/** The instructions, the step's facts and its files, as one deterministic prompt. */
|
|
66
|
-
prompt: string;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Ask a model for a step's summary; return its schema-shaped answer.
|
|
70
|
-
*
|
|
71
|
-
* Typically `request => model.invoke(request.prompt, request.schema, { action })` on a model
|
|
72
|
-
* resolved for `request.role`. A throw is a warning and the entry goes without a summary.
|
|
73
|
-
*/
|
|
74
|
-
export type ResultSummarizer<S extends PipelineState, C> = (request: ResultSummaryRequest<S, C>) => Promise<unknown>;
|
|
75
|
-
export interface CumulativeResultsPluginOptions<S extends PipelineState, C> {
|
|
76
|
-
alias?: string;
|
|
77
|
-
order?: number;
|
|
78
|
-
/**
|
|
79
|
-
* The declaration, or a function of the run that returns one — or `null`/`false` to leave THIS
|
|
80
|
-
* run without results. Resolved once, on `enter`.
|
|
81
|
-
*/
|
|
82
|
-
spec: CumulativeResultsSpec | ((run: ResultsRunInfo<S, C>) => CumulativeResultsSpec | null | false | undefined | Promise<CumulativeResultsSpec | null | false | undefined>);
|
|
83
|
-
/** Named deterministic extractors, referenced by name from `StepResultsSpec.extractors`. */
|
|
84
|
-
extractors?: Record<string, ResultExtractor<S, C>>;
|
|
85
|
-
/** Named facts available before any step ran. Visible to every step, in name order. */
|
|
86
|
-
seeds?: Record<string, ResultSeed<S, C>>;
|
|
87
|
-
/**
|
|
88
|
-
* Where entries live. A composed pipeline must be given the SAME store as the pipeline it is a
|
|
89
|
-
* step of, or neither sees what the other produced. Default: an in-process memory store of this
|
|
90
|
-
* plugin instance.
|
|
91
|
-
*/
|
|
92
|
-
store?: CumulativeResultStore;
|
|
93
|
-
/** Called only for a step whose declaration has a `summary`. */
|
|
94
|
-
summarize?: ResultSummarizer<S, C>;
|
|
95
|
-
/** The ledger a run's entries belong to. Default: the parent's, else the root run's id. */
|
|
96
|
-
ledger?: (run: ResultsRunInfo<S, C>) => string;
|
|
97
|
-
trace?: (line: string) => void;
|
|
98
|
-
}
|
|
1
|
+
import { type PipelineState } from '@owlmeans/agent-common';
|
|
2
|
+
import type { PipelinePlugin, CumulativeResultsPluginOptions } from './types.js';
|
|
99
3
|
/**
|
|
100
4
|
* CUMULATIVE PIPELINE RESULTS: every step is told, in its prompt and through a typed query, what
|
|
101
5
|
* the steps before it produced — read from the files by code, not recalled by a model.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../src/pipeline/results.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../src/pipeline/results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsW,KAAK,aAAa,EAAgD,MAAM,wBAAwB,CAAA;AAK7c,OAAO,KAAK,EAAE,cAAc,EAAuD,8BAA8B,EAAoD,MAAM,YAAY,CAAA;AAwEvL;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,aAAa,EAAE,CAAC,WACvD,8BAA8B,CAAC,CAAC,EAAE,CAAC,CAAC,KAC5C,cAAc,CAAC,CAAC,EAAE,CAAC,CA0iBrB,CAAA"}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import { CumulativeResultSource, DEFAULT_RESULT_SUMMARY_CHARS, DEFAULT_RESULTS_MAX_CHARS, DEFAULT_RESULTS_WINDOW, RESULTS_EVERY_STEP, ResultViewMode, compareResultOrder, factKey, orderPipelineSteps, pipelineAncestry, renderResultEntry, renderResultFact, renderResultSummary, resultLabel, rootRunOf, sortFacts
|
|
1
|
+
import { CumulativeResultSource, DEFAULT_RESULT_SUMMARY_CHARS, DEFAULT_RESULTS_MAX_CHARS, DEFAULT_RESULTS_WINDOW, RESULTS_EVERY_STEP, ResultViewMode, compareResultOrder, factKey, orderPipelineSteps, pipelineAncestry, renderResultEntry, renderResultFact, renderResultSummary, resultLabel, rootRunOf, sortFacts } from '@owlmeans/agent-common';
|
|
2
2
|
import { prefixHash } from '@owlmeans/llm';
|
|
3
3
|
import { logger } from '@owlmeans/log';
|
|
4
4
|
import { createMemoryCumulativeResultStore } from '../stores/memory.js';
|
|
5
|
+
import { SEPARATOR } from './consts.local.js';
|
|
6
|
+
import { CUMULATIVE_RESULTS_PLUGIN, DEFAULT_RESULT_SUMMARY_SCHEMA } from './consts.js';
|
|
5
7
|
const log = logger('agent:pipeline:results');
|
|
6
|
-
/** The plugin's alias. Seated under it, so wiring it twice replaces rather than doubles. */
|
|
7
|
-
export const CUMULATIVE_RESULTS_PLUGIN = 'cumulative-results';
|
|
8
|
-
/** The answer shape a summary is asked for when its declaration names none. */
|
|
9
|
-
export const DEFAULT_RESULT_SUMMARY_SCHEMA = {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: { summary: { type: 'string' } },
|
|
12
|
-
required: ['summary'],
|
|
13
|
-
additionalProperties: false,
|
|
14
|
-
};
|
|
15
|
-
const SEPARATOR = '\n\n';
|
|
16
8
|
const compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
17
9
|
const keyOf = (runId, step) => `${runId}\u0000${step}`;
|
|
18
10
|
const normalizePath = (path) => path.trim().replace(/\\/g, '/').replace(/^(\.\/)+/, '').replace(/\/{2,}/g, '/');
|