@owlmeans/llm-common 0.2.0-alpha.1 → 0.2.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/README.md +2 -2
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/llm-common/SKILL.md +1 -1
- package/build/delegate/consts.d.ts +8 -1
- package/build/delegate/consts.d.ts.map +1 -1
- package/build/delegate/consts.js +7 -0
- package/build/delegate/consts.js.map +1 -1
- package/build/delegate/types.d.ts +24 -0
- package/build/delegate/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/delegate/consts.ts +7 -0
- package/src/delegate/types.ts +27 -0
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ extends these; `@owlmeans/llm` implements against them.
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
bun add @owlmeans/llm-common@^0.2.0
|
|
23
|
+
bun add @owlmeans/llm-common@^0.2.0
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
@@ -102,7 +102,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
102
102
|
your project's skill store (`.agents/skills/`):
|
|
103
103
|
|
|
104
104
|
```sh
|
|
105
|
-
npx @owlmeans/agent-skills@^0.2.0
|
|
105
|
+
npx @owlmeans/agent-skills@^0.2.0
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
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": 3,
|
|
3
3
|
"package": "@owlmeans/llm-common",
|
|
4
|
-
"version": "0.2.0
|
|
5
|
-
"generatedAt": "2026-11-
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"generatedAt": "2026-11-15T13:38:38.712Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/llm-common
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/llm-common": "^0.2.0
|
|
11
|
+
**Install:** `"@owlmeans/llm-common": "^0.2.0"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
The contracts half of the LLM stack. **No `@langchain/*` runtime dependency** — importable
|
|
14
14
|
from a browser bundle, a queue worker, or any package that must not pull an inference SDK.
|
|
@@ -5,7 +5,14 @@ export declare enum DelegatedMode {
|
|
|
5
5
|
/** Exactly one JSON object satisfying `outputSchema`. */
|
|
6
6
|
Json = "json",
|
|
7
7
|
/** A list of calls chosen from `tools`. */
|
|
8
|
-
Tools = "tools"
|
|
8
|
+
Tools = "tools",
|
|
9
|
+
/**
|
|
10
|
+
* A web search the performer runs with ITS OWN search tool — the one kind of task where it is asked
|
|
11
|
+
* to use a tool. The query and its limits are the conversation; the answer is ONE JSON object per
|
|
12
|
+
* `outputSchema`: a {@link DelegatedSearchAnswer}, or a {@link DelegatedSearchRefusal} from a
|
|
13
|
+
* performer that has no web search. Answered with a `Json` result.
|
|
14
|
+
*/
|
|
15
|
+
Search = "search"
|
|
9
16
|
}
|
|
10
17
|
/** Who a message came from. Deliberately the four roles every chat API agrees on. */
|
|
11
18
|
export declare enum DelegatedRole {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/delegate/consts.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oBAAY,aAAa;IACvB,qBAAqB;IACrB,IAAI,SAAS;IACb,yDAAyD;IACzD,IAAI,SAAS;IACb,2CAA2C;IAC3C,KAAK,UAAU;
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/delegate/consts.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oBAAY,aAAa;IACvB,qBAAqB;IACrB,IAAI,SAAS;IACb,yDAAyD;IACzD,IAAI,SAAS;IACb,2CAA2C;IAC3C,KAAK,UAAU;IACf;;;;;OAKG;IACH,MAAM,WAAW;CAClB;AAED,qFAAqF;AACrF,oBAAY,aAAa;IACvB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,IAAI,SAAS;CACd;AAED,yCAAyC;AACzC,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,SAAS,eAAe;IACxB,mGAAmG;IACnG,KAAK,UAAU;CAChB"}
|
package/build/delegate/consts.js
CHANGED
|
@@ -7,6 +7,13 @@ export var DelegatedMode;
|
|
|
7
7
|
DelegatedMode["Json"] = "json";
|
|
8
8
|
/** A list of calls chosen from `tools`. */
|
|
9
9
|
DelegatedMode["Tools"] = "tools";
|
|
10
|
+
/**
|
|
11
|
+
* A web search the performer runs with ITS OWN search tool — the one kind of task where it is asked
|
|
12
|
+
* to use a tool. The query and its limits are the conversation; the answer is ONE JSON object per
|
|
13
|
+
* `outputSchema`: a {@link DelegatedSearchAnswer}, or a {@link DelegatedSearchRefusal} from a
|
|
14
|
+
* performer that has no web search. Answered with a `Json` result.
|
|
15
|
+
*/
|
|
16
|
+
DelegatedMode["Search"] = "search";
|
|
10
17
|
})(DelegatedMode || (DelegatedMode = {}));
|
|
11
18
|
/** Who a message came from. Deliberately the four roles every chat API agrees on. */
|
|
12
19
|
export var DelegatedRole;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/delegate/consts.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/delegate/consts.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,CAAN,IAAY,aAcX;AAdD,WAAY,aAAa;IACvB,qBAAqB;IACrB,8BAAa,CAAA;IACb,yDAAyD;IACzD,8BAAa,CAAA;IACb,2CAA2C;IAC3C,gCAAe,CAAA;IACf;;;;;OAKG;IACH,kCAAiB,CAAA;AACnB,CAAC,EAdW,aAAa,KAAb,aAAa,QAcxB;AAED,qFAAqF;AACrF,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,8BAAa,CAAA;IACb,wCAAuB,CAAA;IACvB,8BAAa,CAAA;AACf,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED,yCAAyC;AACzC,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,oCAAa,CAAA;IACb,+CAAwB,CAAA;IACxB,mGAAmG;IACnG,sCAAe,CAAA;AACjB,CAAC,EANW,mBAAmB,KAAnB,mBAAmB,QAM9B"}
|
|
@@ -82,4 +82,28 @@ export interface DelegatedResult {
|
|
|
82
82
|
export interface DelegateTransport {
|
|
83
83
|
dispatch: (task: DelegatedTask, signal?: AbortSignal) => Promise<DelegatedResult>;
|
|
84
84
|
}
|
|
85
|
+
/** One page a delegated web search returned. */
|
|
86
|
+
export interface DelegatedSearchSource {
|
|
87
|
+
/** An absolute `http(s)` URL the performer's search actually returned. */
|
|
88
|
+
url: string;
|
|
89
|
+
title?: string;
|
|
90
|
+
/** A short excerpt of the page, as the search showed it. */
|
|
91
|
+
snippet?: string;
|
|
92
|
+
}
|
|
93
|
+
/** What a performer answers a {@link DelegatedMode.Search} task with when it searched. */
|
|
94
|
+
export interface DelegatedSearchAnswer {
|
|
95
|
+
/** The answer to the query, Markdown, written from the pages found. */
|
|
96
|
+
text: string;
|
|
97
|
+
sources: DelegatedSearchSource[];
|
|
98
|
+
/** What the performer searched for. */
|
|
99
|
+
queries?: string[];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* What a performer answers a {@link DelegatedMode.Search} task with when it has no web search of its
|
|
103
|
+
* own. Never a search from memory: the caller records the search as unavailable.
|
|
104
|
+
*/
|
|
105
|
+
export interface DelegatedSearchRefusal {
|
|
106
|
+
unavailable: true;
|
|
107
|
+
reason?: string;
|
|
108
|
+
}
|
|
85
109
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/delegate/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE/E,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,yCAAyC;IACzC,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC/B,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,CAAA;IAChB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,aA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
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://owlmeans.com/docs/",
|
|
6
6
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@langchain/core": "^1.3.1",
|
|
36
|
-
"@owlmeans/dep-config": "^0.2.0
|
|
36
|
+
"@owlmeans/dep-config": "^0.2.0",
|
|
37
37
|
"nodemon": "^3.1.14",
|
|
38
38
|
"typescript": "^7.0.2"
|
|
39
39
|
},
|
package/src/delegate/consts.ts
CHANGED
|
@@ -6,6 +6,13 @@ export enum DelegatedMode {
|
|
|
6
6
|
Json = 'json',
|
|
7
7
|
/** A list of calls chosen from `tools`. */
|
|
8
8
|
Tools = 'tools',
|
|
9
|
+
/**
|
|
10
|
+
* A web search the performer runs with ITS OWN search tool — the one kind of task where it is asked
|
|
11
|
+
* to use a tool. The query and its limits are the conversation; the answer is ONE JSON object per
|
|
12
|
+
* `outputSchema`: a {@link DelegatedSearchAnswer}, or a {@link DelegatedSearchRefusal} from a
|
|
13
|
+
* performer that has no web search. Answered with a `Json` result.
|
|
14
|
+
*/
|
|
15
|
+
Search = 'search',
|
|
9
16
|
}
|
|
10
17
|
|
|
11
18
|
/** Who a message came from. Deliberately the four roles every chat API agrees on. */
|
package/src/delegate/types.ts
CHANGED
|
@@ -89,3 +89,30 @@ export interface DelegatedResult {
|
|
|
89
89
|
export interface DelegateTransport {
|
|
90
90
|
dispatch: (task: DelegatedTask, signal?: AbortSignal) => Promise<DelegatedResult>
|
|
91
91
|
}
|
|
92
|
+
|
|
93
|
+
/** One page a delegated web search returned. */
|
|
94
|
+
export interface DelegatedSearchSource {
|
|
95
|
+
/** An absolute `http(s)` URL the performer's search actually returned. */
|
|
96
|
+
url: string
|
|
97
|
+
title?: string
|
|
98
|
+
/** A short excerpt of the page, as the search showed it. */
|
|
99
|
+
snippet?: string
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** What a performer answers a {@link DelegatedMode.Search} task with when it searched. */
|
|
103
|
+
export interface DelegatedSearchAnswer {
|
|
104
|
+
/** The answer to the query, Markdown, written from the pages found. */
|
|
105
|
+
text: string
|
|
106
|
+
sources: DelegatedSearchSource[]
|
|
107
|
+
/** What the performer searched for. */
|
|
108
|
+
queries?: string[]
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* What a performer answers a {@link DelegatedMode.Search} task with when it has no web search of its
|
|
113
|
+
* own. Never a search from memory: the caller records the search as unavailable.
|
|
114
|
+
*/
|
|
115
|
+
export interface DelegatedSearchRefusal {
|
|
116
|
+
unavailable: true
|
|
117
|
+
reason?: string
|
|
118
|
+
}
|