@yaks/tools 0.0.0-stage → 0.2.36
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/LICENSE +202 -0
- package/README.md +870 -2
- package/_dist/access.d.ts +3 -0
- package/_dist/access.d.ts.map +1 -0
- package/_dist/app-view.d.ts +27 -0
- package/_dist/app-view.d.ts.map +1 -0
- package/_dist/args.d.ts +23 -0
- package/_dist/args.d.ts.map +1 -0
- package/_dist/check.d.ts +32 -0
- package/_dist/check.d.ts.map +1 -0
- package/_dist/declared.d.ts +66 -0
- package/_dist/declared.d.ts.map +1 -0
- package/_dist/display.d.ts +2 -0
- package/_dist/display.d.ts.map +1 -0
- package/_dist/errors.d.ts +46 -0
- package/_dist/errors.d.ts.map +1 -0
- package/_dist/fault.d.ts +4 -0
- package/_dist/fault.d.ts.map +1 -0
- package/_dist/invoke.d.ts +13 -0
- package/_dist/invoke.d.ts.map +1 -0
- package/_dist/mod.d.ts +31 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/outlast.d.ts +89 -0
- package/_dist/outlast.d.ts.map +1 -0
- package/_dist/persist.d.ts +5 -0
- package/_dist/persist.d.ts.map +1 -0
- package/_dist/read.d.ts +4 -0
- package/_dist/read.d.ts.map +1 -0
- package/_dist/readable.d.ts +59 -0
- package/_dist/readable.d.ts.map +1 -0
- package/_dist/registry.d.ts +53 -0
- package/_dist/registry.d.ts.map +1 -0
- package/_dist/result.d.ts +154 -0
- package/_dist/result.d.ts.map +1 -0
- package/_dist/routes.d.ts +11 -0
- package/_dist/routes.d.ts.map +1 -0
- package/_dist/runner.d.ts +161 -0
- package/_dist/runner.d.ts.map +1 -0
- package/_dist/said.d.ts +4 -0
- package/_dist/said.d.ts.map +1 -0
- package/_dist/schema.d.ts +76 -0
- package/_dist/schema.d.ts.map +1 -0
- package/_dist/state.d.ts +9 -0
- package/_dist/state.d.ts.map +1 -0
- package/_dist/title.d.ts +20 -0
- package/_dist/title.d.ts.map +1 -0
- package/_dist/value.d.ts +43 -0
- package/_dist/value.d.ts.map +1 -0
- package/_dist/views.d.ts +5 -0
- package/_dist/views.d.ts.map +1 -0
- package/_dist/vocab.d.ts +9 -0
- package/_dist/vocab.d.ts.map +1 -0
- package/_dist/watch.d.ts +28 -0
- package/_dist/watch.d.ts.map +1 -0
- package/access.js +3 -0
- package/access.js.map +1 -0
- package/access.ts +11 -0
- package/app-view.js +26 -0
- package/app-view.js.map +1 -0
- package/app-view.ts +41 -0
- package/args.js +136 -0
- package/args.js.map +1 -0
- package/args.ts +187 -0
- package/body.js +14 -0
- package/body.js.map +1 -0
- package/body.ts +15 -0
- package/check.js +67 -0
- package/check.js.map +1 -0
- package/check.ts +92 -0
- package/declared.js +529 -0
- package/declared.js.map +1 -0
- package/declared.ts +719 -0
- package/deno.json +1 -0
- package/display.js +21 -0
- package/display.js.map +1 -0
- package/display.ts +39 -0
- package/errors.js +99 -0
- package/errors.js.map +1 -0
- package/errors.ts +127 -0
- package/fault.js +17 -0
- package/fault.js.map +1 -0
- package/fault.ts +24 -0
- package/invoke.js +207 -0
- package/invoke.js.map +1 -0
- package/invoke.ts +210 -0
- package/mod.js +31 -0
- package/mod.js.map +1 -0
- package/mod.ts +78 -0
- package/outlast.js +416 -0
- package/outlast.js.map +1 -0
- package/outlast.ts +551 -0
- package/package.json +109 -4
- package/persist.js +18 -0
- package/persist.js.map +1 -0
- package/persist.ts +26 -0
- package/read.js +50 -0
- package/read.js.map +1 -0
- package/read.ts +58 -0
- package/readable.js +118 -0
- package/readable.js.map +1 -0
- package/readable.ts +134 -0
- package/registry.js +162 -0
- package/registry.js.map +1 -0
- package/registry.ts +207 -0
- package/result.js +497 -0
- package/result.js.map +1 -0
- package/result.ts +540 -0
- package/routes.js +46 -0
- package/routes.js.map +1 -0
- package/routes.ts +50 -0
- package/runner.js +748 -0
- package/runner.js.map +1 -0
- package/runner.ts +910 -0
- package/said.js +15 -0
- package/said.js.map +1 -0
- package/said.ts +12 -0
- package/schema.js +137 -0
- package/schema.js.map +1 -0
- package/schema.ts +134 -0
- package/state.js +69 -0
- package/state.js.map +1 -0
- package/state.ts +108 -0
- package/title.js +222 -0
- package/title.js.map +1 -0
- package/title.ts +257 -0
- package/value.js +57 -0
- package/value.js.map +1 -0
- package/value.ts +74 -0
- package/views.js +131 -0
- package/views.js.map +1 -0
- package/views.ts +125 -0
- package/vocab.js +22 -0
- package/vocab.js.map +1 -0
- package/vocab.json +268 -0
- package/vocab.ts +22 -0
- package/watch.js +64 -0
- package/watch.js.map +1 -0
- package/watch.ts +74 -0
package/views.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// How a tool reads, in every interface: a registered tool (`tool{name,
|
|
2
|
+
// description}`) by what callers call it and the first line of what it does,
|
|
3
|
+
// so a list holding one (a persona that contains it, to offer it) says which
|
|
4
|
+
// tool it is; and the `content{body}` a tool answers for a person, shown as it
|
|
5
|
+
// was written, line for line. A portable
|
|
6
|
+
// @yaks/render renderer, so `yak` prints it (@yaks/text) and a browser or a
|
|
7
|
+
// terminal app mounts it (@yaks/preact); which one draws it is the caller's
|
|
8
|
+
// `h`.
|
|
9
|
+
//
|
|
10
|
+
// The body goes out as preformatted lines with an explicit break between each,
|
|
11
|
+
// because a text backend drops the control bytes of every literal, newlines
|
|
12
|
+
// included: a break is structure, and structure is what survives.
|
|
13
|
+
//
|
|
14
|
+
// A text kept in the graph (it has a maker, `created`) is a record among
|
|
15
|
+
// others, so in a list it is a passage (@yaks/render's `passage`): who wrote
|
|
16
|
+
// it, when, its title where it has one, and the words around what was sought.
|
|
17
|
+
// Its `Page` is still the text whole. A tool's answer (`output`) is said whole
|
|
18
|
+
// however it was kept.
|
|
19
|
+
import { parse } from "@yaks/query/core";
|
|
20
|
+
import { define } from "@yaks/render";
|
|
21
|
+
import { passage } from "@yaks/render/views";
|
|
22
|
+
import { json } from "./value.js";
|
|
23
|
+
// A tool's words, or the value it answered without any (./value.ts `valued`).
|
|
24
|
+
let lines = (b, h)=>{
|
|
25
|
+
let body = b.content ? b.content.body : json(b.output.value);
|
|
26
|
+
return h('pre', null, String(body).split('\n').flatMap((line, i)=>i ? [
|
|
27
|
+
h('br', null),
|
|
28
|
+
line
|
|
29
|
+
] : [
|
|
30
|
+
line
|
|
31
|
+
]));
|
|
32
|
+
};
|
|
33
|
+
let said = parse('.content.body');
|
|
34
|
+
let valued = parse('.output.value !content');
|
|
35
|
+
let named = (b, prop)=>{
|
|
36
|
+
let v = b.tool?.[prop];
|
|
37
|
+
return typeof v == 'string' ? v : '';
|
|
38
|
+
};
|
|
39
|
+
// A tool in a list: what callers call it, what it does in a line, and where it
|
|
40
|
+
// opens, as the kit lays a tile out (packages/ui/Tile.ts).
|
|
41
|
+
let tile = (b, h, ctx)=>{
|
|
42
|
+
let link = ctx.link;
|
|
43
|
+
let does = named(b, 'description').split('\n').find((l)=>l.trim()) ?? '';
|
|
44
|
+
return h('a', {
|
|
45
|
+
class: 'Tile',
|
|
46
|
+
href: link?.(b.entity.eid),
|
|
47
|
+
'data-tool': named(b, 'name')
|
|
48
|
+
}, h('span', {
|
|
49
|
+
class: 'Tile_Text'
|
|
50
|
+
}, h('span', {
|
|
51
|
+
class: 'Tile_Line'
|
|
52
|
+
}, h('span', {
|
|
53
|
+
class: 'Tile_Kind'
|
|
54
|
+
}, 'tool'), ' ', h('span', {
|
|
55
|
+
class: 'Tile_Title'
|
|
56
|
+
}, named(b, 'name'))), does ? [
|
|
57
|
+
' ',
|
|
58
|
+
h('span', {
|
|
59
|
+
class: 'Tile_Sub'
|
|
60
|
+
}, does)
|
|
61
|
+
] : null));
|
|
62
|
+
};
|
|
63
|
+
let tool = parse('.tool.name');
|
|
64
|
+
let text = (b, comp, prop)=>b[comp]?.[prop];
|
|
65
|
+
// What a tool is, in a line under its name: a tool, and the first line of
|
|
66
|
+
// what it does.
|
|
67
|
+
let gist = (b, h)=>{
|
|
68
|
+
let does = named(b, 'description').split('\n').find((l)=>l.trim()) ?? '';
|
|
69
|
+
return h('span', null, 'tool', does ? ` · ${does.trim()}` : '');
|
|
70
|
+
};
|
|
71
|
+
/** `Title`, `Body`, `Gist`, `Tile` and `List.Tile` for a registered tool;
|
|
72
|
+
* `Tile` and `Page` for an entity that carries a tool's text, and `Tile` for
|
|
73
|
+
* one the graph keeps. */ export let views = define([
|
|
74
|
+
{
|
|
75
|
+
view: 'Title',
|
|
76
|
+
match: tool,
|
|
77
|
+
render: (b, h)=>h('span', null, named(b, 'name'))
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
view: 'Body',
|
|
81
|
+
match: tool,
|
|
82
|
+
load: ()=>import("./body.js").then((m)=>m.body)
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
view: 'Gist',
|
|
86
|
+
match: tool,
|
|
87
|
+
render: gist
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
view: 'Tile',
|
|
91
|
+
match: tool,
|
|
92
|
+
render: tile
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
view: 'List.Tile',
|
|
96
|
+
match: tool,
|
|
97
|
+
render: tile
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
view: 'Tile',
|
|
101
|
+
match: parse('.created .content.body !output'),
|
|
102
|
+
...passage({
|
|
103
|
+
texts: (b)=>[
|
|
104
|
+
text(b, 'content', 'body'),
|
|
105
|
+
text(b, 'doc', 'body')
|
|
106
|
+
],
|
|
107
|
+
title: (b)=>text(b, 'doc', 'title')
|
|
108
|
+
})
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
view: 'Tile',
|
|
112
|
+
match: said,
|
|
113
|
+
render: lines
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
view: 'Page',
|
|
117
|
+
match: said,
|
|
118
|
+
render: lines
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
view: 'Tile',
|
|
122
|
+
match: valued,
|
|
123
|
+
render: lines
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
view: 'Page',
|
|
127
|
+
match: valued,
|
|
128
|
+
render: lines
|
|
129
|
+
}
|
|
130
|
+
]);
|
|
131
|
+
//# sourceMappingURL=views.js.map
|
package/views.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.js","sources":["./views.ts"],"names":[],"mappings":"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"}
|
package/views.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// How a tool reads, in every interface: a registered tool (`tool{name,
|
|
2
|
+
// description}`) by what callers call it and the first line of what it does,
|
|
3
|
+
// so a list holding one (a persona that contains it, to offer it) says which
|
|
4
|
+
// tool it is; and the `content{body}` a tool answers for a person, shown as it
|
|
5
|
+
// was written, line for line. A portable
|
|
6
|
+
// @yaks/render renderer, so `yak` prints it (@yaks/text) and a browser or a
|
|
7
|
+
// terminal app mounts it (@yaks/preact); which one draws it is the caller's
|
|
8
|
+
// `h`.
|
|
9
|
+
//
|
|
10
|
+
// The body goes out as preformatted lines with an explicit break between each,
|
|
11
|
+
// because a text backend drops the control bytes of every literal, newlines
|
|
12
|
+
// included: a break is structure, and structure is what survives.
|
|
13
|
+
//
|
|
14
|
+
// A text kept in the graph (it has a maker, `created`) is a record among
|
|
15
|
+
// others, so in a list it is a passage (@yaks/render's `passage`): who wrote
|
|
16
|
+
// it, when, its title where it has one, and the words around what was sought.
|
|
17
|
+
// Its `Page` is still the text whole. A tool's answer (`output`) is said whole
|
|
18
|
+
// however it was kept.
|
|
19
|
+
|
|
20
|
+
import { parse } from '@yaks/query/core'
|
|
21
|
+
import {
|
|
22
|
+
define,
|
|
23
|
+
type H,
|
|
24
|
+
type Registry,
|
|
25
|
+
type RenderContext,
|
|
26
|
+
type Renderer,
|
|
27
|
+
} from '@yaks/render'
|
|
28
|
+
import { passage } from '@yaks/render/views'
|
|
29
|
+
import { json } from './value.js'
|
|
30
|
+
|
|
31
|
+
// A tool's words, or the value it answered without any (./value.ts `valued`).
|
|
32
|
+
let lines = <Node>(b: Record<string, unknown>, h: H<Node>): Node => {
|
|
33
|
+
let body = b.content
|
|
34
|
+
? (b.content as { body?: unknown }).body
|
|
35
|
+
: json((b.output as { value?: unknown }).value)
|
|
36
|
+
return h(
|
|
37
|
+
'pre',
|
|
38
|
+
null,
|
|
39
|
+
String(body).split('\n').flatMap((line, i) =>
|
|
40
|
+
i ? [h('br', null), line] : [line]
|
|
41
|
+
),
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let said = parse('.content.body')
|
|
46
|
+
let valued = parse('.output.value !content')
|
|
47
|
+
|
|
48
|
+
let named = (b: Record<string, unknown>, prop: string): string => {
|
|
49
|
+
let v = (b.tool as Record<string, unknown> | undefined)?.[prop]
|
|
50
|
+
return typeof v == 'string' ? v : ''
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// A tool in a list: what callers call it, what it does in a line, and where it
|
|
54
|
+
// opens, as the kit lays a tile out (packages/ui/Tile.ts).
|
|
55
|
+
let tile = <Node>(
|
|
56
|
+
b: Record<string, unknown> & { entity: { eid: string } },
|
|
57
|
+
h: H<Node>,
|
|
58
|
+
ctx: RenderContext<Node>,
|
|
59
|
+
): Node => {
|
|
60
|
+
let link = (ctx as { link?: (eid: string) => string | undefined }).link
|
|
61
|
+
let does = named(b, 'description').split('\n').find((l) => l.trim()) ?? ''
|
|
62
|
+
return h(
|
|
63
|
+
'a',
|
|
64
|
+
{
|
|
65
|
+
class: 'Tile',
|
|
66
|
+
href: link?.(b.entity.eid),
|
|
67
|
+
'data-tool': named(b, 'name'),
|
|
68
|
+
},
|
|
69
|
+
h(
|
|
70
|
+
'span',
|
|
71
|
+
{ class: 'Tile_Text' },
|
|
72
|
+
h(
|
|
73
|
+
'span',
|
|
74
|
+
{ class: 'Tile_Line' },
|
|
75
|
+
h('span', { class: 'Tile_Kind' }, 'tool'),
|
|
76
|
+
' ',
|
|
77
|
+
h('span', { class: 'Tile_Title' }, named(b, 'name')),
|
|
78
|
+
),
|
|
79
|
+
does ? [' ', h('span', { class: 'Tile_Sub' }, does)] : null,
|
|
80
|
+
),
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let tool = parse('.tool.name')
|
|
85
|
+
|
|
86
|
+
let text = (b: Record<string, unknown>, comp: string, prop: string) =>
|
|
87
|
+
(b[comp] as Record<string, unknown> | undefined)?.[prop]
|
|
88
|
+
|
|
89
|
+
// What a tool is, in a line under its name: a tool, and the first line of
|
|
90
|
+
// what it does.
|
|
91
|
+
let gist = <Node>(b: Record<string, unknown>, h: H<Node>): Node => {
|
|
92
|
+
let does = named(b, 'description').split('\n').find((l) => l.trim()) ?? ''
|
|
93
|
+
return h('span', null, 'tool', does ? ` · ${does.trim()}` : '')
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** `Title`, `Body`, `Gist`, `Tile` and `List.Tile` for a registered tool;
|
|
97
|
+
* `Tile` and `Page` for an entity that carries a tool's text, and `Tile` for
|
|
98
|
+
* one the graph keeps. */
|
|
99
|
+
export let views: Registry = define<Renderer>([
|
|
100
|
+
{
|
|
101
|
+
view: 'Title',
|
|
102
|
+
match: tool,
|
|
103
|
+
render: (b, h) => h('span', null, named(b, 'name')),
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
view: 'Body',
|
|
107
|
+
match: tool,
|
|
108
|
+
load: () => import('./body.js').then((m) => m.body),
|
|
109
|
+
},
|
|
110
|
+
{ view: 'Gist', match: tool, render: gist },
|
|
111
|
+
{ view: 'Tile', match: tool, render: tile },
|
|
112
|
+
{ view: 'List.Tile', match: tool, render: tile },
|
|
113
|
+
{
|
|
114
|
+
view: 'Tile',
|
|
115
|
+
match: parse('.created .content.body !output'),
|
|
116
|
+
...passage({
|
|
117
|
+
texts: (b) => [text(b, 'content', 'body'), text(b, 'doc', 'body')],
|
|
118
|
+
title: (b) => text(b, 'doc', 'title'),
|
|
119
|
+
}),
|
|
120
|
+
},
|
|
121
|
+
{ view: 'Tile', match: said, render: lines },
|
|
122
|
+
{ view: 'Page', match: said, render: lines },
|
|
123
|
+
{ view: 'Tile', match: valued, render: lines },
|
|
124
|
+
{ view: 'Page', match: valued, render: lines },
|
|
125
|
+
])
|
package/vocab.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// The component declarations alone, exported as `@yaks/tools/vocab`. Nothing
|
|
2
|
+
// here imports the runner, so a browser tab that only needs to read and write
|
|
3
|
+
// these components loads nothing else.
|
|
4
|
+
import { pick } from "@yaks/vocab/runtime";
|
|
5
|
+
import doc from './vocab.json' with {
|
|
6
|
+
type: 'json'
|
|
7
|
+
};
|
|
8
|
+
import manifest from './package.json' with {
|
|
9
|
+
type: 'json'
|
|
10
|
+
};
|
|
11
|
+
export const toolsDoc = doc;
|
|
12
|
+
/** Invocation records; compose with toolDoc or an existing tool declaration. */ export const callDoc = pick(doc, Object.keys(doc.$defs).filter((name)=>name != 'tool'));
|
|
13
|
+
export const toolDoc = pick(doc, [
|
|
14
|
+
'tool'
|
|
15
|
+
]);
|
|
16
|
+
/** What this package is: its manifest's description, the one place it is
|
|
17
|
+
* written, which a host stamps on each document here. */ export const description = manifest.description;
|
|
18
|
+
/** Every document this plugin declares. */ export const docs = [
|
|
19
|
+
toolsDoc
|
|
20
|
+
];
|
|
21
|
+
export { executionDerived as derived } from "./state.js";
|
|
22
|
+
//# sourceMappingURL=vocab.js.map
|
package/vocab.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab.js","sources":["./vocab.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,uCAAuC;AACvC,SAAS,IAAI,mCAAuD;AACpE,OAAO,SAAS,oBAAoB;EAAE,MAAM;AAAO,EAAC;AACpD,OAAO,cAAc,sBAAsB;EAAE,MAAM;AAAO,EAAC;AAC3D,OAAO,MAAM,WAAqB,IAAG;AACrC,8EAA8E,GAC9E,OAAO,MAAM,UAAoB,KAC/B,KACA,OAAO,IAAI,CAAC,IAAI,KAAK,EAAE,MAAM,CAAC,CAAC,OAAS,QAAQ,SACjD;AACD,OAAO,MAAM,UAAoB,KAAK,KAAK;EAAC;CAAO,EAAC;AAEpD;uDACuD,GACvD,OAAO,MAAM,cAAsB,SAAS,WAAW,CAAA;AAEvD,yCAAyC,GACzC,OAAO,MAAM,OAAmB;EAAC;CAAS,CAAA;AAE1C,SAAS,oBAAoB,OAAO,qBAAoB"}
|
package/vocab.json
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "urn:uuid:cbad80b6-19c8-4e01-a43b-9c31b59b9f71",
|
|
3
|
+
"title": "invocation",
|
|
4
|
+
"$defs": {
|
|
5
|
+
"call": {
|
|
6
|
+
"$id": "urn:uuid:bb13d2df-778c-4964-be30-0faffa877527",
|
|
7
|
+
"component": true,
|
|
8
|
+
"type": "object",
|
|
9
|
+
"description": "A recorded tool invocation. To find calls by the referenced tool’s name, query .call.to.tool.name=graph_query. To include the name on the referenced tool row, use .fields=call.to.tool.name. Use .call.name=graph_query to match the name the caller supplied, when recorded. The call’s execution{state} says whether it is running, done, failed or interrupted. The reply is a separate result{call, ms, value} row in the same store, with refusal{code} or exception{type, value} when applicable.",
|
|
10
|
+
"properties": {
|
|
11
|
+
"to": {
|
|
12
|
+
"$id": "urn:uuid:4cbacaf7-97d5-4c22-87df-d43d4be68da4",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"ref": "tool",
|
|
15
|
+
"death": "keep",
|
|
16
|
+
"description": "the graph tool or callable effect addressed by this invocation"
|
|
17
|
+
},
|
|
18
|
+
"name": {
|
|
19
|
+
"$id": "urn:uuid:224e92b0-fbe3-4ef7-9f4b-5f20c35754dd",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"index": true,
|
|
22
|
+
"contains": true,
|
|
23
|
+
"description": "optional: the tool's name as the caller wrote it, which says what was asked for where `to` names a tool nobody serves, as a model's call to a tool it invented does"
|
|
24
|
+
},
|
|
25
|
+
"id": {
|
|
26
|
+
"$id": "urn:uuid:2727bf95-0cfd-4eaf-a72b-4371f7e9cec8",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "the provider's id for it, echoed in the result"
|
|
29
|
+
},
|
|
30
|
+
"args": {
|
|
31
|
+
"$id": "urn:uuid:34b60be7-4269-4a35-9db5-18c75b206d4f",
|
|
32
|
+
"type": "object",
|
|
33
|
+
"description": "its arguments: the object the tool's input schema describes"
|
|
34
|
+
},
|
|
35
|
+
"source": {
|
|
36
|
+
"$id": "urn:uuid:16860fad-01fd-402d-863f-d9e1366463a9",
|
|
37
|
+
"type": "string",
|
|
38
|
+
"ref": "entity",
|
|
39
|
+
"death": "keep",
|
|
40
|
+
"description": "optional: the request or other entity this call came from"
|
|
41
|
+
},
|
|
42
|
+
"actor": {
|
|
43
|
+
"$id": "urn:uuid:f00d9797-9bbc-4f8a-b08e-816371368379",
|
|
44
|
+
"type": "object",
|
|
45
|
+
"stamped": true,
|
|
46
|
+
"description": "The by/via identity pair of whoever last changed the executable request. Server-owned; an empty pair means automation. When absent, the creation author still owns the request."
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"cut": {
|
|
51
|
+
"$id": "urn:uuid:ddef1925-2b8b-443b-be8f-caf00ed56ab2",
|
|
52
|
+
"component": true,
|
|
53
|
+
"journal": false,
|
|
54
|
+
"type": "object",
|
|
55
|
+
"description": "on a call: its writer stopped before its arguments were finished, as a model's reply cut at its output token limit does; it never runs, and its refusal (code cut) says why",
|
|
56
|
+
"properties": {}
|
|
57
|
+
},
|
|
58
|
+
"result": {
|
|
59
|
+
"$id": "urn:uuid:4b700c7a-d183-492c-865b-7df754b899d3",
|
|
60
|
+
"component": true,
|
|
61
|
+
"embed": false,
|
|
62
|
+
"type": "object",
|
|
63
|
+
"description": "What a tool returned, and how long the call took. To read a call’s result in the store that recorded it, query .result.call=<call-eid>&.fields=result with the call’s full eid. The reverse filter .results selects calls that have a result.",
|
|
64
|
+
"properties": {
|
|
65
|
+
"ms": {
|
|
66
|
+
"$id": "urn:uuid:96293bb8-f3a3-4d1a-9283-94713faecc64",
|
|
67
|
+
"type": "number",
|
|
68
|
+
"description": "how long the tool took, in milliseconds"
|
|
69
|
+
},
|
|
70
|
+
"call": {
|
|
71
|
+
"$id": "urn:uuid:40290495-9d34-442b-8ca7-4053945a316a",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"ref": "call",
|
|
74
|
+
"death": "keep",
|
|
75
|
+
"description": "the call it is the result of"
|
|
76
|
+
},
|
|
77
|
+
"value": {
|
|
78
|
+
"$id": "urn:uuid:647c8419-7c53-4cfc-b2d4-4c6f97080843",
|
|
79
|
+
"type": "object",
|
|
80
|
+
"description": "what the tool answered as data, the `output{value}` beside its words, kept on the result where a reader of the transcript finds it"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"content": {
|
|
85
|
+
"$id": "urn:uuid:72f04d9e-0a8a-4bf9-a179-e5ca64ab4819",
|
|
86
|
+
"component": true,
|
|
87
|
+
"type": "object",
|
|
88
|
+
"description": "Text content, retained with the call that asked for it.",
|
|
89
|
+
"properties": {
|
|
90
|
+
"body": {
|
|
91
|
+
"$id": "urn:uuid:9d7c5ee7-2547-46ca-bda5-9e90c8ef02d6",
|
|
92
|
+
"type": "string",
|
|
93
|
+
"store": "blob",
|
|
94
|
+
"contains": true,
|
|
95
|
+
"prose": ["topic"]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"output": {
|
|
100
|
+
"$id": "urn:uuid:f0c5043d-140f-4dd5-b4a0-0c40f6c10a81",
|
|
101
|
+
"component": true,
|
|
102
|
+
"type": "object",
|
|
103
|
+
"description": "What produced the text beside it: the request, for a model’s own output, or the call whose failure is being reported. Only output carries it — text a person or a system wrote has none.",
|
|
104
|
+
"properties": {
|
|
105
|
+
"source": {
|
|
106
|
+
"$id": "urn:uuid:150990e5-5275-4cfd-a10a-1deaeec40bfc",
|
|
107
|
+
"type": "string",
|
|
108
|
+
"ref": "entity",
|
|
109
|
+
"death": "keep",
|
|
110
|
+
"description": "the entry that produced it"
|
|
111
|
+
},
|
|
112
|
+
"id": {
|
|
113
|
+
"$id": "urn:uuid:5b70ffe7-ed93-4faf-a015-e3f3f922142c",
|
|
114
|
+
"type": "string",
|
|
115
|
+
"description": "the provider's id for this piece of output, as `call.id` is its id for the call — what a later revision of the same item is matched on"
|
|
116
|
+
},
|
|
117
|
+
"value": {
|
|
118
|
+
"$id": "urn:uuid:3a2db3a9-ff01-4959-9459-ff5fb958eb8d",
|
|
119
|
+
"type": "object",
|
|
120
|
+
"description": "the same output as data, for a reader that parses rather than reads: a tool that declares an outputSchema answers its structured content here, beside the text a person reads"
|
|
121
|
+
},
|
|
122
|
+
"images": {
|
|
123
|
+
"$id": "urn:uuid:7f24d529-e2be-43e3-9621-41925209d7a8",
|
|
124
|
+
"type": "array",
|
|
125
|
+
"description": "Images returned beside the text and structured value, each with base64 bytes and a media type; an MCP client displays these as image content blocks.",
|
|
126
|
+
"items": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"required": ["data", "mime_type"],
|
|
129
|
+
"properties": {
|
|
130
|
+
"data": { "type": "string" },
|
|
131
|
+
"mime_type": { "type": "string" }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"refusal": {
|
|
138
|
+
"$id": "urn:uuid:74d3b5e3-ecb0-43a7-96b5-30a86de3454a",
|
|
139
|
+
"component": true,
|
|
140
|
+
"type": "object",
|
|
141
|
+
"description": "A deliberate no: the tool or provider refused the request. Never tracked; its prose is on the content component beside it.",
|
|
142
|
+
"properties": {
|
|
143
|
+
"code": {
|
|
144
|
+
"$id": "urn:uuid:085bba21-9dfd-4503-9093-1e72f5289d6c",
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "the tool or provider's reason for refusing"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"exception": {
|
|
151
|
+
"$id": "urn:uuid:4ae23737-e785-44c0-8d2a-d9787f75fd61",
|
|
152
|
+
"component": true,
|
|
153
|
+
"journal": false,
|
|
154
|
+
"type": "object",
|
|
155
|
+
"description": "What was thrown, retained in an answer or transcript entry. The catcher reports the original failure to the tracker separately.",
|
|
156
|
+
"properties": {
|
|
157
|
+
"type": {
|
|
158
|
+
"$id": "urn:uuid:7687f404-6470-46d9-8d45-726402bc5b96",
|
|
159
|
+
"type": "string",
|
|
160
|
+
"stamped": true,
|
|
161
|
+
"description": "The thrown value’s class."
|
|
162
|
+
},
|
|
163
|
+
"value": {
|
|
164
|
+
"$id": "urn:uuid:ddb436d8-736d-4974-ae1b-8a94de995134",
|
|
165
|
+
"type": "string",
|
|
166
|
+
"stamped": true,
|
|
167
|
+
"description": "The thrown value’s message."
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"execution": {
|
|
172
|
+
"$id": "urn:uuid:ac8d8de3-6126-440e-a1b9-109506ef6579",
|
|
173
|
+
"component": true,
|
|
174
|
+
"type": "object",
|
|
175
|
+
"description": "Who holds a recorded tool invocation; its state is computed from the interruption mark and explicitly named answers.",
|
|
176
|
+
"properties": {
|
|
177
|
+
"state": {
|
|
178
|
+
"$id": "urn:uuid:0d436b78-3c23-4cdf-9359-49c11d118cd3",
|
|
179
|
+
"type": "string",
|
|
180
|
+
"enum": [
|
|
181
|
+
"running",
|
|
182
|
+
"done",
|
|
183
|
+
"failed",
|
|
184
|
+
"interrupted"
|
|
185
|
+
],
|
|
186
|
+
"description": "The lifecycle derived from its interruption mark, holder and recorded answers.",
|
|
187
|
+
"computed": true
|
|
188
|
+
},
|
|
189
|
+
"by": {
|
|
190
|
+
"$id": "urn:uuid:60a9981c-91ef-4094-a9b5-6060958f6f39",
|
|
191
|
+
"type": "string",
|
|
192
|
+
"ref": "entity",
|
|
193
|
+
"death": "keep",
|
|
194
|
+
"description": "the server or process running it"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"tool": {
|
|
199
|
+
"$id": "urn:uuid:05a09cbb-4bde-4e55-b4ff-ef684129f51f",
|
|
200
|
+
"component": true,
|
|
201
|
+
"journal": false,
|
|
202
|
+
"type": "object",
|
|
203
|
+
"description": "A registered tool that callers can invoke.",
|
|
204
|
+
"properties": {
|
|
205
|
+
"name": {
|
|
206
|
+
"$id": "urn:uuid:4d896271-9c38-4cc0-a5c5-f17aded47f51",
|
|
207
|
+
"type": "string",
|
|
208
|
+
"identity": true,
|
|
209
|
+
"description": "what callers call it; the entity id is derived from it"
|
|
210
|
+
},
|
|
211
|
+
"title": {
|
|
212
|
+
"$id": "urn:uuid:9ab3d73f-c550-45b4-9d60-4fbae24665e5",
|
|
213
|
+
"type": "string",
|
|
214
|
+
"description": "what a person reads in place of the name: an imperative phrase, such as Read or write app files"
|
|
215
|
+
},
|
|
216
|
+
"step": {
|
|
217
|
+
"$id": "urn:uuid:39e64fe0-fd32-4fe8-9bcc-c030a49878e3",
|
|
218
|
+
"type": "object",
|
|
219
|
+
"description": "how a call reads to a person, as locale strings: doing while it runs (Texting %{person}…) and done once it answered (Texted %{person}), each %{name} filled from the call's arguments and the person it works for; under by, by argument then its value ('' when left out), the step of each thing the arguments choose"
|
|
220
|
+
},
|
|
221
|
+
"description": {
|
|
222
|
+
"$id": "urn:uuid:061a138b-9a0b-4a2a-be50-83a5d8fef0e9",
|
|
223
|
+
"type": "string"
|
|
224
|
+
},
|
|
225
|
+
"revision": {
|
|
226
|
+
"$id": "urn:uuid:f1b4f742-4e7b-4eef-ae14-9484f7d97d80",
|
|
227
|
+
"type": "string",
|
|
228
|
+
"description": "implementation revision used by builders to detect changed code"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"call_ready": {
|
|
233
|
+
"effect": true,
|
|
234
|
+
"call": false,
|
|
235
|
+
"match": "$call .call, !execution, !results, !wake, !tool_async; +result.call=$call",
|
|
236
|
+
"description": "a call nobody has claimed and nobody scheduled: run the tool it names and attach the result. A call written already claimed (the caller runs it) owes nothing, and nor does one its writer runs by an effect of its own (`tool_async`, @yaks/session): that effect runs it with the tools its writer offered. In a graph that does not load the word, every unclaimed call is due"
|
|
237
|
+
},
|
|
238
|
+
"call_woken": {
|
|
239
|
+
"effect": true,
|
|
240
|
+
"call": false,
|
|
241
|
+
"match": "$call .call, .wake, *fired, !results; +result.call=$call",
|
|
242
|
+
"description": "Run a scheduled call when its wake writes fired, if the call has no result. In a graph without wake components, call_ready handles every unclaimed call."
|
|
243
|
+
},
|
|
244
|
+
"finding": {
|
|
245
|
+
"$id": "urn:uuid:ea4f2420-b960-4858-8084-dcc16b67c00c",
|
|
246
|
+
"component": true,
|
|
247
|
+
"journal": false,
|
|
248
|
+
"type": "object",
|
|
249
|
+
"description": "What a check measured: fail for a violated contract, warn for a leak or a verdict it could not establish.",
|
|
250
|
+
"properties": {
|
|
251
|
+
"level": {
|
|
252
|
+
"$id": "urn:uuid:8db9b998-722c-4745-a588-1995f73fab8c",
|
|
253
|
+
"type": "string",
|
|
254
|
+
"enum": [
|
|
255
|
+
"fail",
|
|
256
|
+
"warn"
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"kinds": {
|
|
263
|
+
"tool": {
|
|
264
|
+
"$id": "urn:uuid:05a09cbb-4bde-4e55-b4ff-ef684129f51f",
|
|
265
|
+
"description": "A registered tool that callers can invoke."
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
package/vocab.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// The component declarations alone, exported as `@yaks/tools/vocab`. Nothing
|
|
2
|
+
// here imports the runner, so a browser tab that only needs to read and write
|
|
3
|
+
// these components loads nothing else.
|
|
4
|
+
import { pick, type VocabDoc } from '@yaks/vocab/runtime'
|
|
5
|
+
import doc from './vocab.json' with { type: 'json' }
|
|
6
|
+
import manifest from './package.json' with { type: 'json' }
|
|
7
|
+
export const toolsDoc: VocabDoc = doc
|
|
8
|
+
/** Invocation records; compose with toolDoc or an existing tool declaration. */
|
|
9
|
+
export const callDoc: VocabDoc = pick(
|
|
10
|
+
doc,
|
|
11
|
+
Object.keys(doc.$defs).filter((name) => name != 'tool'),
|
|
12
|
+
)
|
|
13
|
+
export const toolDoc: VocabDoc = pick(doc, ['tool'])
|
|
14
|
+
|
|
15
|
+
/** What this package is: its manifest's description, the one place it is
|
|
16
|
+
* written, which a host stamps on each document here. */
|
|
17
|
+
export const description: string = manifest.description
|
|
18
|
+
|
|
19
|
+
/** Every document this plugin declares. */
|
|
20
|
+
export const docs: VocabDoc[] = [toolsDoc]
|
|
21
|
+
|
|
22
|
+
export { executionDerived as derived } from './state.js'
|
package/watch.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// A reading tool whose answer is a store query's rows declares that query as
|
|
2
|
+
// `watch` (@yaks/vocab `ToolDefinition`), and a subscription to the tool
|
|
3
|
+
// watches the query live (@yaks/wake `watch`) instead of calling the tool
|
|
4
|
+
// again on a clock. The declaration is data, one per tool: the query's parts,
|
|
5
|
+
// each with `%{name}` holes the call's arguments fill, joined with `&`.
|
|
6
|
+
//
|
|
7
|
+
// A part whose hole names an argument left out is dropped. A part given as a
|
|
8
|
+
// list is its alternatives, the first whose holes all fill, so a default is a
|
|
9
|
+
// last alternative with no hole. A hole filled by a list of strings is one copy
|
|
10
|
+
// of its part per string, as graph_query's `filters` each narrow the query.
|
|
11
|
+
import { conjoin } from "@yaks/query";
|
|
12
|
+
let HOLE = /%\{(\w+)\}/g;
|
|
13
|
+
// Each copy of `part` the arguments fill, or none when a hole is unfilled.
|
|
14
|
+
let fills = (part, args)=>{
|
|
15
|
+
let names = [
|
|
16
|
+
...part.matchAll(HOLE)
|
|
17
|
+
].map((m)=>m[1]);
|
|
18
|
+
let listed = names.find((n)=>Array.isArray(args[n]));
|
|
19
|
+
if (listed) {
|
|
20
|
+
return args[listed].flatMap((v)=>fills(part, {
|
|
21
|
+
...args,
|
|
22
|
+
[listed]: v
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
let said = (v)=>typeof v == 'string' || typeof v == 'number' ? String(v).trim() : '';
|
|
26
|
+
if (names.some((n)=>!said(args[n]))) return [];
|
|
27
|
+
return [
|
|
28
|
+
part.replace(HOLE, (_, n)=>said(args[n]))
|
|
29
|
+
];
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The query a tool that declares `watch` answers for `args`, or a sentence
|
|
33
|
+
* saying which argument it does not watch: one no part names would change the
|
|
34
|
+
* answer in a way the query cannot follow.
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { assertEquals } from '@std/assert'
|
|
38
|
+
* import { watched } from './watch.ts'
|
|
39
|
+
*
|
|
40
|
+
* let tasks = ['.task', ['%{query}', '.task.status=open'], '.limit=%{limit}']
|
|
41
|
+
* assertEquals(watched(tasks, {}), { query: '.task&.task.status=open' })
|
|
42
|
+
* assertEquals(watched(tasks, { query: '.task.status=done', limit: 5 }), {
|
|
43
|
+
* query: '.task&.task.status=done&.limit=5',
|
|
44
|
+
* })
|
|
45
|
+
* assertEquals(watched(['%{q}', '%{filters}'], { q: '.a', filters: ['.b', '.c'] }), {
|
|
46
|
+
* query: '.a&.b&.c',
|
|
47
|
+
* })
|
|
48
|
+
* assertEquals(watched(['%{q}'], { q: '.a', branch: 2 }), {
|
|
49
|
+
* refused: 'branch',
|
|
50
|
+
* })
|
|
51
|
+
* ```
|
|
52
|
+
*/ export let watched = (watch, args)=>{
|
|
53
|
+
let named = new Set(watch.flat().flatMap((p)=>[
|
|
54
|
+
...p.matchAll(HOLE)
|
|
55
|
+
].map((m)=>m[1])));
|
|
56
|
+
let refused = Object.keys(args).find((k)=>args[k] != null && !named.has(k));
|
|
57
|
+
if (refused) return {
|
|
58
|
+
refused
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
query: conjoin(...watch.flatMap((part)=>typeof part == 'string' ? fills(part, args) : part.map((p)=>fills(p, args)).find((f)=>f.length) ?? []))
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=watch.js.map
|
package/watch.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.js","sources":["./watch.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yEAAyE;AACzE,0EAA0E;AAC1E,8EAA8E;AAC9E,wEAAwE;AACxE,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,gFAAgF;AAChF,4EAA4E;AAE5E,SAAS,OAAO,2BAAgC;AAKhD,IAAI,OAAO;AAEX,2EAA2E;AAC3E,IAAI,QAAQ,CAAC,MAAc;EACzB,IAAI,QAAQ;OAAI,KAAK,QAAQ,CAAC;GAAM,CAAC,GAAG,CAAC,CAAC,IAAM,CAAC,CAAC,EAAE;EACpD,IAAI,SAAS,MAAM,IAAI,CAAC,CAAC,IAAM,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE;EACpD,IAAI,QAAQ;IACV,OAAO,AAAC,IAAI,CAAC,OAAO,CAAe,OAAO,CAAC,CAAC,IAC1C,MAAM,MAAM;QAAE,GAAG,IAAI;QAAE,CAAC,OAAO,EAAE;MAAE;EAEvC;EACA,IAAI,OAAO,CAAC,IACV,OAAO,KAAK,YAAY,OAAO,KAAK,WAAW,OAAO,GAAG,IAAI,KAAK;EACpE,IAAI,MAAM,IAAI,CAAC,CAAC,IAAM,CAAC,KAAK,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE;EAChD,OAAO;IAAC,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,IAAc,KAAK,IAAI,CAAC,EAAE;GAAG;AAC9D;AAEA;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,IAAI,UAAU,CACnB,OACA;EAEA,IAAI,QAAQ,IAAI,IACd,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,IAAM;SAAI,EAAE,QAAQ,CAAC;KAAM,CAAC,GAAG,CAAC,CAAC,IAAM,CAAC,CAAC,EAAE;EAEnE,IAAI,UAAU,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,IAAM,IAAI,CAAC,EAAE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;EAC1E,IAAI,SAAS,OAAO;IAAE;EAAQ;EAC9B,OAAO;IACL,OAAO,WACF,MAAM,OAAO,CAAC,CAAC,OAChB,OAAO,QAAQ,WACX,MAAM,MAAM,QACZ,KAAK,GAAG,CAAC,CAAC,IAAM,MAAM,GAAG,OAAO,IAAI,CAAC,CAAC,IAAM,EAAE,MAAM,KAAK,EAAE;EAGrE;AACF,EAAC"}
|