@yaks/session 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 +1392 -2
- package/_dist/admission.d.ts +15 -0
- package/_dist/admission.d.ts.map +1 -0
- package/_dist/announce.d.ts +17 -0
- package/_dist/announce.d.ts.map +1 -0
- package/_dist/answer.d.ts +200 -0
- package/_dist/answer.d.ts.map +1 -0
- package/_dist/append.d.ts +10 -0
- package/_dist/append.d.ts.map +1 -0
- package/_dist/archive.d.ts +6 -0
- package/_dist/archive.d.ts.map +1 -0
- package/_dist/asks.d.ts +11 -0
- package/_dist/asks.d.ts.map +1 -0
- package/_dist/audit.d.ts +15 -0
- package/_dist/audit.d.ts.map +1 -0
- package/_dist/bounce.d.ts +19 -0
- package/_dist/bounce.d.ts.map +1 -0
- package/_dist/bus.d.ts +8 -0
- package/_dist/bus.d.ts.map +1 -0
- package/_dist/cache.d.ts +45 -0
- package/_dist/cache.d.ts.map +1 -0
- package/_dist/child-notice.d.ts +6 -0
- package/_dist/child-notice.d.ts.map +1 -0
- package/_dist/children.d.ts +59 -0
- package/_dist/children.d.ts.map +1 -0
- package/_dist/cli.d.ts +8 -0
- package/_dist/cli.d.ts.map +1 -0
- package/_dist/comp.d.ts +9 -0
- package/_dist/comp.d.ts.map +1 -0
- package/_dist/compact.d.ts +19 -0
- package/_dist/compact.d.ts.map +1 -0
- package/_dist/conversation.d.ts +158 -0
- package/_dist/conversation.d.ts.map +1 -0
- package/_dist/cost.d.ts +13 -0
- package/_dist/cost.d.ts.map +1 -0
- package/_dist/deferred.d.ts +79 -0
- package/_dist/deferred.d.ts.map +1 -0
- package/_dist/ended.d.ts +27 -0
- package/_dist/ended.d.ts.map +1 -0
- package/_dist/files.d.ts +73 -0
- package/_dist/files.d.ts.map +1 -0
- package/_dist/fork.d.ts +23 -0
- package/_dist/fork.d.ts.map +1 -0
- package/_dist/graft.d.ts +33 -0
- package/_dist/graft.d.ts.map +1 -0
- package/_dist/graph.d.ts +14 -0
- package/_dist/graph.d.ts.map +1 -0
- package/_dist/handoff.d.ts +29 -0
- package/_dist/handoff.d.ts.map +1 -0
- package/_dist/imported.d.ts +63 -0
- package/_dist/imported.d.ts.map +1 -0
- package/_dist/intake.d.ts +43 -0
- package/_dist/intake.d.ts.map +1 -0
- package/_dist/joined.d.ts +35 -0
- package/_dist/joined.d.ts.map +1 -0
- package/_dist/lease.d.ts +21 -0
- package/_dist/lease.d.ts.map +1 -0
- package/_dist/lines.d.ts +13 -0
- package/_dist/lines.d.ts.map +1 -0
- package/_dist/mod.d.ts +107 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/naming.d.ts +10 -0
- package/_dist/naming.d.ts.map +1 -0
- package/_dist/native.d.ts +13 -0
- package/_dist/native.d.ts.map +1 -0
- package/_dist/parts.d.ts +145 -0
- package/_dist/parts.d.ts.map +1 -0
- package/_dist/plugin.d.ts +33 -0
- package/_dist/plugin.d.ts.map +1 -0
- package/_dist/project.d.ts +67 -0
- package/_dist/project.d.ts.map +1 -0
- package/_dist/prose.d.ts +7 -0
- package/_dist/prose.d.ts.map +1 -0
- package/_dist/providers.d.ts +36 -0
- package/_dist/providers.d.ts.map +1 -0
- package/_dist/reach.d.ts +39 -0
- package/_dist/reach.d.ts.map +1 -0
- package/_dist/react.d.ts +236 -0
- package/_dist/react.d.ts.map +1 -0
- package/_dist/readers.d.ts +221 -0
- package/_dist/readers.d.ts.map +1 -0
- package/_dist/reap.d.ts +21 -0
- package/_dist/reap.d.ts.map +1 -0
- package/_dist/recall.d.ts +32 -0
- package/_dist/recall.d.ts.map +1 -0
- package/_dist/routes.d.ts +15 -0
- package/_dist/routes.d.ts.map +1 -0
- package/_dist/run.d.ts +81 -0
- package/_dist/run.d.ts.map +1 -0
- package/_dist/service.d.ts +131 -0
- package/_dist/service.d.ts.map +1 -0
- package/_dist/source.d.ts +9 -0
- package/_dist/source.d.ts.map +1 -0
- package/_dist/start.d.ts +29 -0
- package/_dist/start.d.ts.map +1 -0
- package/_dist/state.d.ts +75 -0
- package/_dist/state.d.ts.map +1 -0
- package/_dist/status.d.ts +38 -0
- package/_dist/status.d.ts.map +1 -0
- package/_dist/tail.d.ts +121 -0
- package/_dist/tail.d.ts.map +1 -0
- package/_dist/timing.d.ts +9 -0
- package/_dist/timing.d.ts.map +1 -0
- package/_dist/told.d.ts +17 -0
- package/_dist/told.d.ts.map +1 -0
- package/_dist/tools.d.ts +41 -0
- package/_dist/tools.d.ts.map +1 -0
- package/_dist/transcript.d.ts +5 -0
- package/_dist/transcript.d.ts.map +1 -0
- package/_dist/turn.d.ts +49 -0
- package/_dist/turn.d.ts.map +1 -0
- package/_dist/unknown.d.ts +6 -0
- package/_dist/unknown.d.ts.map +1 -0
- package/_dist/views.d.ts +9 -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/wait.d.ts +15 -0
- package/_dist/wait.d.ts.map +1 -0
- package/_dist/wake.d.ts +116 -0
- package/_dist/wake.d.ts.map +1 -0
- package/_dist/watch.d.ts +52 -0
- package/_dist/watch.d.ts.map +1 -0
- package/_dist/who.d.ts +84 -0
- package/_dist/who.d.ts.map +1 -0
- package/_dist/window.d.ts +43 -0
- package/_dist/window.d.ts.map +1 -0
- package/admission.js +137 -0
- package/admission.js.map +1 -0
- package/admission.ts +164 -0
- package/announce.js +123 -0
- package/announce.js.map +1 -0
- package/announce.ts +126 -0
- package/answer.js +372 -0
- package/answer.js.map +1 -0
- package/answer.ts +426 -0
- package/append.js +125 -0
- package/append.js.map +1 -0
- package/append.ts +205 -0
- package/archive.js +62 -0
- package/archive.js.map +1 -0
- package/archive.ts +62 -0
- package/asks.js +80 -0
- package/asks.js.map +1 -0
- package/asks.ts +106 -0
- package/attempt.js +46 -0
- package/attempt.js.map +1 -0
- package/attempt.ts +60 -0
- package/audit.js +57 -0
- package/audit.js.map +1 -0
- package/audit.ts +65 -0
- package/bounce.js +29 -0
- package/bounce.js.map +1 -0
- package/bounce.ts +34 -0
- package/bus.js +568 -0
- package/bus.js.map +1 -0
- package/bus.ts +683 -0
- package/cache.js +169 -0
- package/cache.js.map +1 -0
- package/cache.ts +230 -0
- package/child-notice.js +128 -0
- package/child-notice.js.map +1 -0
- package/child-notice.ts +136 -0
- package/children.js +937 -0
- package/children.js.map +1 -0
- package/children.ts +925 -0
- package/claude-control.js +8 -0
- package/claude-control.js.map +1 -0
- package/claude-control.ts +12 -0
- package/cli.js +23 -0
- package/cli.js.map +1 -0
- package/cli.ts +28 -0
- package/comp.js +76 -0
- package/comp.js.map +1 -0
- package/comp.ts +78 -0
- package/compact.js +157 -0
- package/compact.js.map +1 -0
- package/compact.ts +209 -0
- package/compact_ask.js +280 -0
- package/compact_ask.js.map +1 -0
- package/compact_ask.ts +199 -0
- package/continue.js +131 -0
- package/continue.js.map +1 -0
- package/continue.ts +143 -0
- package/conversation.js +337 -0
- package/conversation.js.map +1 -0
- package/conversation.ts +593 -0
- package/cost.js +111 -0
- package/cost.js.map +1 -0
- package/cost.ts +93 -0
- package/deferred.js +207 -0
- package/deferred.js.map +1 -0
- package/deferred.ts +219 -0
- package/deno.json +1 -0
- package/dependencies.js +114 -0
- package/dependencies.js.map +1 -0
- package/dependencies.ts +110 -0
- package/draining.js +20 -0
- package/draining.js.map +1 -0
- package/draining.ts +26 -0
- package/ended.js +210 -0
- package/ended.js.map +1 -0
- package/ended.ts +225 -0
- package/files.js +285 -0
- package/files.js.map +1 -0
- package/files.ts +318 -0
- package/fork.js +96 -0
- package/fork.js.map +1 -0
- package/fork.ts +124 -0
- package/graft.js +97 -0
- package/graft.js.map +1 -0
- package/graft.ts +88 -0
- package/graph.js +49 -0
- package/graph.js.map +1 -0
- package/graph.ts +61 -0
- package/handoff.js +111 -0
- package/handoff.js.map +1 -0
- package/handoff.ts +147 -0
- package/help.js +432 -0
- package/help.js.map +1 -0
- package/help.ts +431 -0
- package/hooks.js +253 -0
- package/hooks.js.map +1 -0
- package/hooks.ts +333 -0
- package/imported.js +259 -0
- package/imported.js.map +1 -0
- package/imported.ts +201 -0
- package/inspect.js +353 -0
- package/inspect.js.map +1 -0
- package/inspect.ts +378 -0
- package/intake.js +115 -0
- package/intake.js.map +1 -0
- package/intake.ts +124 -0
- package/joined.js +67 -0
- package/joined.js.map +1 -0
- package/joined.ts +69 -0
- package/lease.js +146 -0
- package/lease.js.map +1 -0
- package/lease.ts +151 -0
- package/lifecycle.js +49 -0
- package/lifecycle.js.map +1 -0
- package/lifecycle.ts +46 -0
- package/lines.js +171 -0
- package/lines.js.map +1 -0
- package/lines.ts +177 -0
- package/listen.js +604 -0
- package/listen.js.map +1 -0
- package/listen.ts +976 -0
- package/log.js +78 -0
- package/log.js.map +1 -0
- package/log.ts +88 -0
- package/mod.js +107 -0
- package/mod.js.map +1 -0
- package/mod.ts +113 -0
- package/name.js +51 -0
- package/name.js.map +1 -0
- package/name.ts +84 -0
- package/naming.js +96 -0
- package/naming.js.map +1 -0
- package/naming.ts +102 -0
- package/native.js +17 -0
- package/native.js.map +1 -0
- package/native.ts +17 -0
- package/package.json +133 -4
- package/parts.js +334 -0
- package/parts.js.map +1 -0
- package/parts.ts +383 -0
- package/plugin.js +77 -0
- package/plugin.js.map +1 -0
- package/plugin.ts +98 -0
- package/project.js +354 -0
- package/project.js.map +1 -0
- package/project.ts +407 -0
- package/prompt.js +57 -0
- package/prompt.js.map +1 -0
- package/prompt.ts +92 -0
- package/prose.js +43 -0
- package/prose.js.map +1 -0
- package/prose.ts +63 -0
- package/providers.js +279 -0
- package/providers.js.map +1 -0
- package/providers.ts +306 -0
- package/pruning.js +80 -0
- package/pruning.js.map +1 -0
- package/pruning.ts +147 -0
- package/reach.js +923 -0
- package/reach.js.map +1 -0
- package/reach.ts +1107 -0
- package/react.js +2259 -0
- package/react.js.map +1 -0
- package/react.ts +2864 -0
- package/readers.js +956 -0
- package/readers.js.map +1 -0
- package/readers.ts +1017 -0
- package/reap.js +60 -0
- package/reap.js.map +1 -0
- package/reap.ts +65 -0
- package/recall.js +67 -0
- package/recall.js.map +1 -0
- package/recall.ts +114 -0
- package/reopen.js +45 -0
- package/reopen.js.map +1 -0
- package/reopen.ts +44 -0
- package/result-entry.js +32 -0
- package/result-entry.js.map +1 -0
- package/result-entry.ts +34 -0
- package/resume.js +266 -0
- package/resume.js.map +1 -0
- package/resume.ts +283 -0
- package/routes.js +129 -0
- package/routes.js.map +1 -0
- package/routes.ts +147 -0
- package/routine.js +179 -0
- package/routine.js.map +1 -0
- package/routine.ts +191 -0
- package/run.js +932 -0
- package/run.js.map +1 -0
- package/run.ts +999 -0
- package/service.js +806 -0
- package/service.js.map +1 -0
- package/service.ts +911 -0
- package/source.js +26 -0
- package/source.js.map +1 -0
- package/source.ts +40 -0
- package/start.js +197 -0
- package/start.js.map +1 -0
- package/start.ts +214 -0
- package/state.js +247 -0
- package/state.js.map +1 -0
- package/state.ts +404 -0
- package/status.js +1222 -0
- package/status.js.map +1 -0
- package/status.ts +1555 -0
- package/status_bench.ts +50 -0
- package/statusline.js +187 -0
- package/statusline.js.map +1 -0
- package/statusline.ts +232 -0
- package/tail.js +748 -0
- package/tail.js.map +1 -0
- package/tail.ts +815 -0
- package/talk.js +58 -0
- package/talk.js.map +1 -0
- package/talk.ts +51 -0
- package/task-context.js +41 -0
- package/task-context.js.map +1 -0
- package/task-context.ts +53 -0
- package/texted.js +65 -0
- package/texted.js.map +1 -0
- package/texted.ts +65 -0
- package/timing.js +37 -0
- package/timing.js.map +1 -0
- package/timing.ts +52 -0
- package/told.js +56 -0
- package/told.js.map +1 -0
- package/told.ts +54 -0
- package/tools.js +595 -0
- package/tools.js.map +1 -0
- package/tools.ts +633 -0
- package/transcript.js +34 -0
- package/transcript.js.map +1 -0
- package/transcript.ts +41 -0
- package/turn.js +47 -0
- package/turn.js.map +1 -0
- package/turn.ts +68 -0
- package/unknown.js +8 -0
- package/unknown.js.map +1 -0
- package/unknown.ts +9 -0
- package/views.js +15 -0
- package/views.js.map +1 -0
- package/views.ts +21 -0
- package/vocab.js +24 -0
- package/vocab.js.map +1 -0
- package/vocab.json +1573 -0
- package/vocab.ts +30 -0
- package/wait.js +30 -0
- package/wait.js.map +1 -0
- package/wait.ts +45 -0
- package/wake.js +552 -0
- package/wake.js.map +1 -0
- package/wake.ts +597 -0
- package/watch.js +520 -0
- package/watch.js.map +1 -0
- package/watch.ts +596 -0
- package/who.js +309 -0
- package/who.js.map +1 -0
- package/who.ts +347 -0
- package/window.js +179 -0
- package/window.js.map +1 -0
- package/window.ts +268 -0
- package/woken.js +129 -0
- package/woken.js.map +1 -0
- package/woken.ts +127 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a conversation draws its lines, wherever one is shown: a person's words
|
|
3
|
+
* as a bubble on their side, a reply as formatted text, each tool call as one
|
|
4
|
+
* short line in plain words that opens on what it asked for and what came
|
|
5
|
+
* back, a failure said in words with what went wrong inside a closed
|
|
6
|
+
* "Details", a stop, and the files that came with a line ({@link files}).
|
|
7
|
+
* Drawn with @yaks/ui's `Transcript`, `More`, `Pairs`, `Notice` and
|
|
8
|
+
* `Attachments`, so it bundles for a server, a browser and the iOS shell
|
|
9
|
+
* alike.
|
|
10
|
+
*
|
|
11
|
+
* Each kind of line is a {@link Kind}: a `Conversation.Line` registration
|
|
12
|
+
* (@yaks/render) that matches on the components an entry wears, and draws it.
|
|
13
|
+
* A host with words of its own (a channel's mark, a helper) puts its kinds
|
|
14
|
+
* ahead of {@link kinds} in its own registry; the most specific match draws
|
|
15
|
+
* the entry, and {@link draw} gives it to the next best when a kind passes.
|
|
16
|
+
* What a view draws beside a line, outside its reading column, is a kind
|
|
17
|
+
* registered under `Conversation.Margin` ({@link margin}): a view that loads
|
|
18
|
+
* none draws its lines without one. Which renderers a view loads is the list
|
|
19
|
+
* its registry is defined from. Which entries make a line is `joined`
|
|
20
|
+
* (./lines.ts), which reads no kit.
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/ import { type ReactElement, type ReactNode as Node } from "@types/react";
|
|
24
|
+
import { type Options } from "@yaks/markdown";
|
|
25
|
+
import { type Bundle, type Registration, type Registry } from "@yaks/render";
|
|
26
|
+
import { type Step, type Steps } from "@yaks/tools/title";
|
|
27
|
+
export { type Joined, joined } from "./joined.js";
|
|
28
|
+
export { markdown } from "./prose.js";
|
|
29
|
+
/** A line as it is drawn: its parts, the words it says when copied where they
|
|
30
|
+
* are not its entries' own (`text`), the kind of row and a step's tone. */ export type Said = {
|
|
31
|
+
node: Node;
|
|
32
|
+
text?: string;
|
|
33
|
+
is?: 'step' | 'notice' | 'theirs';
|
|
34
|
+
tone?: Tone;
|
|
35
|
+
};
|
|
36
|
+
/** A step's tone: under way (`on`) or failed (`no`). */ export type Tone = 'on' | 'no';
|
|
37
|
+
/** How a call reads to the person, by its tool's eid (`call.to`) and its
|
|
38
|
+
* arguments: what it is doing while it runs and what it did once it answered
|
|
39
|
+
* (@yaks/tools `stepOf`). */ export type Names = (tool: string, args?: Record<string, unknown>) => Called;
|
|
40
|
+
/** How a call reads, and where the logo of the integration it names is drawn
|
|
41
|
+
* from (@yaks/ui `Logo`): `null` for one with none, which wears the plug, and
|
|
42
|
+
* absent where it names none. */ export type Called = Step & {
|
|
43
|
+
logo?: string | null;
|
|
44
|
+
};
|
|
45
|
+
/** What a call's arguments name an integration by: its `integration`, or the
|
|
46
|
+
* `connection` it attaches. */ export declare let integrationNamed: (args?: Record<string, unknown> | null) => string | undefined;
|
|
47
|
+
/** What a tool is called, of its `tool` component: its name, title and
|
|
48
|
+
* steps (@yaks/tools `stepOf`). */ export type Named = {
|
|
49
|
+
name?: string;
|
|
50
|
+
title?: string;
|
|
51
|
+
step?: Steps;
|
|
52
|
+
};
|
|
53
|
+
/** What the calls' steps are said from: each tool a call points at
|
|
54
|
+
* (`call.to`) by its eid, as its `tool` component names it, and whom the
|
|
55
|
+
* calls work for; and what the entities the lines' prose names are called,
|
|
56
|
+
* by eid (`ids`, an entity's id such as `T-2`), drawn by {@link called}. */ export type Naming = {
|
|
57
|
+
tools?: Record<string, Named>;
|
|
58
|
+
person?: string | null;
|
|
59
|
+
ids?: Record<string, string>;
|
|
60
|
+
/** where the logo of each integration a call names is drawn from, by what
|
|
61
|
+
* it names it by ({@link integrationNamed}); `null` for one with none */ logos?: Record<string, string | null>;
|
|
62
|
+
};
|
|
63
|
+
/** How the calls read, from what names them. */ export declare let namer: ({}: Naming) => Names;
|
|
64
|
+
/** What a line is drawn with beside its entry: the result that answered it
|
|
65
|
+
* when it is a call (`joined`), how calls read, what a call's step holds
|
|
66
|
+
* after what it asked for (`under`), what came back of it drawn in place of
|
|
67
|
+
* its result's own words (`came`: the helper a call started, not its id),
|
|
68
|
+
* who works the conversation, as a sentence names them partway through
|
|
69
|
+
* (`who`, "the Operator"), and whether the conversation is `stalled`: a
|
|
70
|
+
* failure the host files to fix and then takes it up again on its own. */ export type Beside = {
|
|
71
|
+
result?: Bundle;
|
|
72
|
+
names: Names;
|
|
73
|
+
under?: Node[];
|
|
74
|
+
came?: Node[];
|
|
75
|
+
who?: string;
|
|
76
|
+
stalled?: boolean;
|
|
77
|
+
};
|
|
78
|
+
/** A kind of line: a `Conversation.Line` registration and what it draws of an
|
|
79
|
+
* entry; `null` where the entry draws nothing, and `undefined` where this kind
|
|
80
|
+
* passes it to the next best match. */ export type Kind<B extends Beside = Beside> = Registration & {
|
|
81
|
+
draw: (b: Bundle, beside: B) => Said | null | undefined;
|
|
82
|
+
};
|
|
83
|
+
/** The view every kind of line is registered under. */ export declare let LINE: string;
|
|
84
|
+
/** The view what a line has beside it is registered under: drawn outside
|
|
85
|
+
* its reading column, of the entry the line is put by (an admin's sequence
|
|
86
|
+
* and cost). */ export declare let MARGIN: string;
|
|
87
|
+
/** An entry drawn as its line, by the most specific kind that draws it. */ export declare let draw: <B extends Beside>(registry: Registry<Kind<B>>, b: Bundle, beside: B) => Said | null;
|
|
88
|
+
/** What the line an entry is put by has beside it, by the most specific
|
|
89
|
+
* margin kind that draws it; nothing where the registry loads none. */ export declare let margin: <B extends Beside>(registry: Registry<Kind<B>>, b: Bundle, beside: B) => Node;
|
|
90
|
+
/** Where the ids in a reader's Markdown open (@yaks/markdown `Host`): `url`,
|
|
91
|
+
* with `{id}` where the id goes, as the reader's own server says; none, and
|
|
92
|
+
* ids stay words. */ export declare let opening: (url?: string | null) => Options;
|
|
93
|
+
/** Lines drawn with each eid their prose holds called as `ids` calls it,
|
|
94
|
+
* else as the page's own Host does, else as its short handle; where the page
|
|
95
|
+
* opens an id is the page's. */ export declare let called: (ids: Record<string, string> | undefined, node: Node) => Node;
|
|
96
|
+
/** A reply as it was written, in Markdown. */ export declare let reply: (text: string) => ReactElement;
|
|
97
|
+
/** A person's words, on their side, in Markdown as a reply is. `mark` sits
|
|
98
|
+
* before them: how they came. */ export declare let yours: (text: string, mark?: Node) => ReactElement;
|
|
99
|
+
/** A file as a line names it: its name, and its media type where known. */ export type Sent = {
|
|
100
|
+
name: string;
|
|
101
|
+
mime?: string;
|
|
102
|
+
};
|
|
103
|
+
/** What a person said who sent files and no words. */ export declare let unsaid: (files: Sent[]) => string;
|
|
104
|
+
/** The kinds a browser draws as a picture, never a drawing that runs (SVG). */ export declare let PICTURES: readonly [string, string, string, string];
|
|
105
|
+
/** Whether a file is words a browser shows as they are: text, and JSON,
|
|
106
|
+
* XML and YAML. */ export declare let textual: (mime?: string) => boolean;
|
|
107
|
+
/** A file's kind as a person names it: its extension, else "File". */ export declare let fileKind: (name: string) => string;
|
|
108
|
+
/** A size in bytes as a person reads it. */ export declare let fileSize: (n: number) => string;
|
|
109
|
+
/** A file as a conversation draws it, sent or held in a box to send: a
|
|
110
|
+
* picture as itself, any other file as its kind and name. What differs is
|
|
111
|
+
* given: where its original opens (`href`), a picture's source where that is
|
|
112
|
+
* not it (`src`), and for one held, its `size`, a `note` and how to take it
|
|
113
|
+
* back (`remove`, what its button carries). */ export type Filed = Sent & {
|
|
114
|
+
href?: string;
|
|
115
|
+
src?: string;
|
|
116
|
+
/** a picture's size, which its place keeps before it loads */ width?: number;
|
|
117
|
+
height?: number;
|
|
118
|
+
size?: number;
|
|
119
|
+
note?: string;
|
|
120
|
+
remove?: Record<string, unknown>;
|
|
121
|
+
};
|
|
122
|
+
/** One file, as `Filed` says. */ export declare let Filed: ({}: Filed) => ReactElement;
|
|
123
|
+
/** A file opened where it is named, showing what it holds: a picture as
|
|
124
|
+
* itself, words in a frame of their own that loads once it is seen (from its
|
|
125
|
+
* `src`, a page of them, else its `href`), and any
|
|
126
|
+
* other file as itself, which opens it. */ export declare let Shown: (file: Filed) => ReactElement;
|
|
127
|
+
/** A file a step read or made, named in a quiet line that opens to what it
|
|
128
|
+
* holds (`Shown`): "Read notes.txt". */ export declare let opened: (doing: string, file: Filed) => ReactElement;
|
|
129
|
+
/** The files that came with a line, under it as a chat app shows them: a
|
|
130
|
+
* person's sit at the `end`, on their side. None draws nothing. */ export declare let files: (sent: Filed[], mod?: 'end') => ReactElement | null;
|
|
131
|
+
/** The one way a conversation draws anything that opens: a step, by what it
|
|
132
|
+
* did, opening on what it holds; `on` while it runs, `no` once it did not
|
|
133
|
+
* work. A fold in a fold is the same fold. Whether it is open is its line's
|
|
134
|
+
* fold state (@yaks/ux `Fold`), which a redrawn line keeps. */ export declare let step: (name: Node, mod: '' | Tone, ...inside: Node[]) => ReactElement;
|
|
135
|
+
/** A {@link step} whose inside is drawn only once it is opened (@yaks/ux
|
|
136
|
+
* `Disclosure` `lazy`): what a model was told, say, which runs to tens of
|
|
137
|
+
* kilobytes a step and is rarely opened. */ export declare let lazyStep: (name: Node, mod: '' | Tone, ...inside: Node[]) => ReactElement;
|
|
138
|
+
/** A value a tool was given or gave back, the way a person reads it: a list
|
|
139
|
+
* of what it holds under names in words, never its JSON. Bounded in depth,
|
|
140
|
+
* length and count, since a tool can answer with a whole file. */ export declare let readable: (value: unknown, depth?: number) => Node;
|
|
141
|
+
/** The one way a conversation draws an error: what happened and what to do,
|
|
142
|
+
* in words, with what the error said only inside a closed "Details". */ export declare let trouble: (said: string, detail?: unknown) => ReactElement;
|
|
143
|
+
/** What a model said of its reasoning: a quiet step among its tool calls,
|
|
144
|
+
* opening on its words, so an answer never appears from nowhere. */ export declare let thought: (b: Bundle) => Said | undefined;
|
|
145
|
+
/** What a transcript's kinds are that are none of the person's words. */ export declare let NOT_INPUT: readonly [string, string, string, string, string, string, string, string, string, string, string, string, string, string, string];
|
|
146
|
+
/** A person's own words: an entry with words that is none of the other
|
|
147
|
+
* kinds. */ export declare let theirs: (b: Bundle) => boolean;
|
|
148
|
+
/** What a person wrote. A task's first input is the task itself as JSON (its
|
|
149
|
+
* row, and on older sessions its comments): its body is what they wrote. */ export declare let words: (said: string) => string;
|
|
150
|
+
/** A kind drawn by `draw`, matching `match` (a query of which components
|
|
151
|
+
* an entry wears), or any entry where it is empty: a kind of line, or under
|
|
152
|
+
* `view` another place a line is drawn ({@link MARGIN}). */ export declare let kind: <B extends Beside = Beside>(match: string, draw: Kind<B>['draw']) => Kind<B>;
|
|
153
|
+
/** The kinds of line any transcript has: a tool call, a thought, a refusal,
|
|
154
|
+
* a reply, a failure, a stop, and a person's words, which is any entry no
|
|
155
|
+
* other kind draws. A model call cut off on the way (`interrupted`) draws no
|
|
156
|
+
* line of its own: the turn goes on from it, or a line after it says why it
|
|
157
|
+
* ended. */ export declare let kinds: Registry<Kind>;
|
|
158
|
+
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sources":["../conversation.ts"],"names":[],"mappings":"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"}
|
package/_dist/cost.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Hook } from "@yaks/graph";
|
|
2
|
+
import type { DerivedProp } from "@yaks/sql";
|
|
3
|
+
/**
|
|
4
|
+
* The precondition that weighs a request its provider named no price for: a
|
|
5
|
+
* bundle carrying `usage` and no `cost` gains `cost{dollars, reported: false}`
|
|
6
|
+
* when the model that answered it has a `price`, the batch's or else the
|
|
7
|
+
* stored one. The model and the counts are the bundle's over the entry as
|
|
8
|
+
* stored, so a patch that only adds the usage is weighed whole; a cost the
|
|
9
|
+
* entry already records stands.
|
|
10
|
+
*/ export declare let weighing: Hook;
|
|
11
|
+
/** `session.cost` as SQL, for @yaks/sqlite's derived-property registry: the
|
|
12
|
+
* dollars its entries record, or nothing where none records any. */ export declare let sessionCost: DerivedProp;
|
|
13
|
+
//# sourceMappingURL=cost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost.d.ts","sources":["../cost.ts"],"names":[],"mappings":"AAaA,cAA4B,IAAI,2BAAgC;AAUhE,cAAc,WAAW,yBAA8B;AAavD;;;;;;;CAOC,GACD,OAAO,YAAI,UAAU,KA+BpB;AAED;kEACkE,GAClE,OAAO,YAAI,aAAa,YAavB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Bundle } from "@yaks/graph";
|
|
2
|
+
import type { Tool } from "./react.js";
|
|
3
|
+
/** The name of the tool that loads deferred ones. */ export declare let LOAD: string;
|
|
4
|
+
/** What the loader says of itself wherever it is offered: its name, title,
|
|
5
|
+
* how a call to it reads to the person (@yaks/tools `stepOf`), and the first
|
|
6
|
+
* of its description, which a turn follows with the tools it can load. */ export declare let LOADER: Pick<Tool, 'name' | 'title' | 'step' | 'description'>;
|
|
7
|
+
/** The turn's available deferred tools, independent of the loader schema. */ export declare let catalog: (tools: Tool[]) => string;
|
|
8
|
+
/**
|
|
9
|
+
* The tool among `known` a loaded name means: the name itself, or the name
|
|
10
|
+
* without the `<server>__` prefixes a caller wrote before it.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* let known = new Set(['task_list'])
|
|
14
|
+
* named('tasks__task_list', known) // 'task_list'
|
|
15
|
+
* named('mcp__tasks__task_list', known) // 'task_list'
|
|
16
|
+
* named('task_lists', known) // undefined
|
|
17
|
+
* ```
|
|
18
|
+
*/ export declare let named: (name: string, known: Set<string>) => string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* The refusal of names a turn cannot load: a withheld tool with why it is
|
|
21
|
+
* withheld, and a name no tool has with the tools whose name, title or
|
|
22
|
+
* description say what its words do (@yaks/tools/registry `found`), so the
|
|
23
|
+
* next call names one that is there.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* let tool = (name: string, description: string) => ({ name, description })
|
|
27
|
+
* let tools = [
|
|
28
|
+
* tool('mail_send', 'Send a letter.'),
|
|
29
|
+
* tool('attachment_read', 'Read a file the person sent.'),
|
|
30
|
+
* ]
|
|
31
|
+
* unknown(['file_attach'], tools)
|
|
32
|
+
* // 'There is no tool called file_attach; nearest: attachment_read. Load one by a name tool_load lists.'
|
|
33
|
+
* unknown(['code_mode'], tools, new Map([['code_mode', 'it writes']]))
|
|
34
|
+
* // 'code_mode is not held in this turn: it writes. Load one by a name tool_load lists.'
|
|
35
|
+
* ```
|
|
36
|
+
*/ export declare let unknown: (missing: string[], tools: Pick<Tool, 'name' | 'title' | 'description'>[], withheld?: Map<string, string>) => string;
|
|
37
|
+
/**
|
|
38
|
+
* The tools a runner offers, with `tool_load` beside them when any is
|
|
39
|
+
* deferred: its description lists each deferred one, and its call names
|
|
40
|
+
* those to send from then on. A withheld tool is left out, and named in
|
|
41
|
+
* `tool_load`'s refusal with why.
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* let tool = (name: string, deferred = false) =>
|
|
45
|
+
* ({ name, description: `${name}.`, parameters: {}, deferred, run: () => name })
|
|
46
|
+
* loading([tool('search'), tool('buy', true)]).map((t) => t.name)
|
|
47
|
+
* // ['search', 'buy', 'tool_load']
|
|
48
|
+
* let sell = { ...tool('sell'), withheld: 'it spends' }
|
|
49
|
+
* loading([tool('search'), tool('buy', true), sell]).map((t) => t.name)
|
|
50
|
+
* // ['search', 'buy', 'tool_load']
|
|
51
|
+
* ```
|
|
52
|
+
*/ export declare let loading: (offered: Tool[], separate?: boolean) => Tool[];
|
|
53
|
+
/**
|
|
54
|
+
* The tools a request sends: every one not deferred, and the deferred ones
|
|
55
|
+
* `sent` names (what the newest ask sent), a `tool_load` call among `entries`
|
|
56
|
+
* named or a call among them called.
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { found } from '@yaks/tools/registry'
|
|
60
|
+
import { toolEid } from '@yaks/tools/result'
|
|
61
|
+
*
|
|
62
|
+
* let tool = (name: string, deferred = false) =>
|
|
63
|
+
* ({ name, description: name, parameters: {}, deferred, run: () => name })
|
|
64
|
+
* let load = {
|
|
65
|
+
* entity: { eid: 'c' },
|
|
66
|
+
* call: { to: toolEid('tool_load'), args: { names: ['shop__buy'] } },
|
|
67
|
+
* }
|
|
68
|
+
* let sold = { entity: { eid: 'd' }, call: { to: toolEid('sell') } }
|
|
69
|
+
* let tools = [tool('search'), tool('buy', true), tool('sell', true)]
|
|
70
|
+
* schemas(tools, [load]).map((t) => t.name) // ['search', 'buy']
|
|
71
|
+
* schemas(tools, [sold]).map((t) => t.name) // ['search', 'sell']
|
|
72
|
+
* let quoted = { ...load, call: { ...load.call, args: { names: '["buy"]' } } }
|
|
73
|
+
* schemas(tools, [quoted]).map((t) => t.name) // ['search', 'buy']
|
|
74
|
+
* let wrong = { ...load, call: { ...load.call, args: { names: 7 } } }
|
|
75
|
+
* schemas(tools, [wrong]).map((t) => t.name) // ['search']
|
|
76
|
+
* schemas(tools, [], ['sell', 'search']).map((t) => t.name) // ['search', 'sell']
|
|
77
|
+
* ```
|
|
78
|
+
*/ export declare let schemas: (tools: Tool[], entries: Bundle[], sent?: string[]) => Tool[];
|
|
79
|
+
//# sourceMappingURL=deferred.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferred.d.ts","sources":["../deferred.ts"],"names":[],"mappings":"AAaA,cAAc,MAAM,2BAAgC;AAOpD,cAAc,IAAI,qBAAoB;AAEtC,mDAAmD,GACnD,OAAO,YAAI,aAAkB;AAE7B;;wEAEwE,GACxE,OAAO,YAAI,QAAQ,KAAK,MAAM,SAAS,UAAU,SAAS,eAMzD;AAOD,2EAA2E,GAC3E,OAAO,YAAI,UAAW,OAAO,WAAS,MAAM,CACgC;AAE5E;;;;;;;;;;CAUC,GACD,OAAO,YAAI,QAAS,MAAM,MAAM,EAAE,OAAO,IAAI,MAAM,MAAI,MAAM,GAAG,SAAS,CAKxE;AAED;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,YAAI,UACT,SAAS,MAAM,IACf,OAAO,KAAK,MAAM,SAAS,UAAU,kBACrC,WAAU,IAAI,MAAM,EAAE,MAAM,MAC3B,MAAM,CAUR;AA2BD;;;;;;;;;;;;;;;CAeC,GACD,OAAO,YAAI,UAAW,SAAS,QAAQ,uBAAmB,OAmCzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,YAAI,UACT,OAAO,QACP,SAAS,UACT,OAAM,MAAM,OACX,OAaF"}
|
package/_dist/ended.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Eid, Graph } from "@yaks/graph";
|
|
2
|
+
/** The session ids Claude's processes run now, from the files in `dir`, one per
|
|
3
|
+
* process. A file outlives a crash, so its pid is asked too. Nothing where
|
|
4
|
+
* there is no such directory, so a computer without one ends nothing. */ export declare let runningSessions: (dir: string, alive?: (pid: number) => Promise<boolean>) => Promise<Set<string> | undefined>;
|
|
5
|
+
type Sweep = {
|
|
6
|
+
/** each Claude Code account: where its transcripts are, and where it lists
|
|
7
|
+
* its processes */ claude?: {
|
|
8
|
+
projects: string;
|
|
9
|
+
running: string;
|
|
10
|
+
}[];
|
|
11
|
+
alive?: (pid: number) => Promise<boolean>;
|
|
12
|
+
now?: number;
|
|
13
|
+
};
|
|
14
|
+
/** The sessions {@link endGone} would mark, without marking them. */ export declare let goneSessions: (g: Graph, o?: Sweep) => Promise<Eid[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Write `session.ended` on every session whose process is gone or, with no
|
|
17
|
+
* process to ask about, that has come to rest, and answer with their eids.
|
|
18
|
+
* `claude` names each Claude Code account's transcripts and the directory where
|
|
19
|
+
* it lists its processes. It is an observation, not an edit, so `updated` stays as it was.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { endGone } from '@yaks/session/ended'
|
|
23
|
+
*
|
|
24
|
+
* // await endGone(graph, { claude: [{ projects, running }] })
|
|
25
|
+
* ```
|
|
26
|
+
*/ export declare let endGone: (g: Graph, o?: Sweep) => Promise<Eid[]>;
|
|
27
|
+
//# sourceMappingURL=ended.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ended.d.ts","sources":["../ended.ts"],"names":[],"mappings":"AAsBA,cAA4B,GAAG,EAAE,KAAK,2BAAgC;AAoBtE;;uEAEuE,GACvE,OAAO,YAAI,kBACT,KAAK,MAAM,EACX,SAAQ,KAAK,MAAM,KAAK,QAAQ,OAAO,MACtC,QAAQ,IAAI,MAAM,IAAI,SAAS,EAsBjC;KA6CI;EACH;mBACiB,GACjB;IAAW,UAAU,MAAM;IAAE,SAAS,MAAM;;EAC5C,SAAS,KAAK,MAAM,KAAK,QAAQ,OAAO;EACxC,MAAM,MAAM;;AAGd,mEAAmE,GACnE,OAAO,YAAI,eAAsB,GAAG,OAAO,IAAG,UAAa,QAAQ,OA0ElE;AAED;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,UAAiB,GAAG,OAAO,IAAG,UAAa,QAAQ,OAY7D"}
|
package/_dist/files.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as systemProcess from "@yaks/process/system";
|
|
2
|
+
import type { Bundle } from "@yaks/graph";
|
|
3
|
+
import { type Runner } from "@yaks/model";
|
|
4
|
+
/** An account a CLI keeps on this machine: its config directory, the one
|
|
5
|
+
* `CLAUDE_CONFIG_DIR`, `CODEX_HOME` or `GROK_HOME` names, which holds its
|
|
6
|
+
* transcripts (@yaks/model `ACCOUNTS`). */ export type Home = {
|
|
7
|
+
runner: Runner;
|
|
8
|
+
dir: string;
|
|
9
|
+
};
|
|
10
|
+
type Env = Pick<systemProcess.Env, 'get'>;
|
|
11
|
+
/** The account a CLI signs in with in an environment, this process's by
|
|
12
|
+
* default: the directory its variable names, else its own under the home
|
|
13
|
+
* directory (`~/.claude`, `~/.codex`, `~/.grok`,
|
|
14
|
+
* `~/.gemini/antigravity-cli`). */ export declare let home: (runner: Home['runner'], env?: Env) => string | undefined;
|
|
15
|
+
/** Where an account keeps its transcripts: Claude Code's `projects`, Codex's
|
|
16
|
+
* and Grok's `sessions`, Antigravity's `brain`. */ export declare let transcriptsOf: (h: Home) => string;
|
|
17
|
+
/** Where a Claude Code account keeps one file per running process, naming
|
|
18
|
+
* its session. */ export declare let runningOf: (h: Home) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Every account on this machine that holds transcripts: the directories
|
|
21
|
+
* `listed` names and, unless `find` is false, the ones the environment (this
|
|
22
|
+
* process's by default) signs in with and each `~/.claude*`, `~/.codex*` and
|
|
23
|
+
* `~/.grok*` directory. Someone
|
|
24
|
+
* with several accounts keeps each in a directory of its own
|
|
25
|
+
* (`CLAUDE_CONFIG_DIR=~/.claude-work`), so each is found on its own.
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { homes } from './files.ts'
|
|
29
|
+
*
|
|
30
|
+
* // await homes(['/Volumes/work/claude']) — [{ runner: 'claude', dir }, …]
|
|
31
|
+
* ```
|
|
32
|
+
*/ export declare let homes: (listed?: string[], find?: boolean, env?: Env) => Promise<Home[]>;
|
|
33
|
+
/** The rows that name accounts: each one's `account`, and its provider's. */ export declare let accountRows: (from: Home[]) => Bundle[];
|
|
34
|
+
/** Every transcript the accounts keep, each with its account: Claude Code's
|
|
35
|
+
* by {@link transcripts}, Codex's by {@link rollouts}, Grok's by
|
|
36
|
+
* {@link grokSessions} and Antigravity's by {@link conversations}. */ export declare let held: (from: Home[]) => Promise<Found[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Move a thread's transcript from one account of a CLI to another, at the
|
|
39
|
+
* same place under the other's transcripts, so the CLI signed in there
|
|
40
|
+
* carries the thread on (`claude --resume`, `codex resume`). Its subagents'
|
|
41
|
+
* transcripts stay where they were read from. Whether it was found to move.
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { moveThread } from './files.ts'
|
|
45
|
+
*
|
|
46
|
+
* // await moveThread({ runner: 'claude', dir: '~/.claude-a' }, '~/.claude-b', id)
|
|
47
|
+
* ```
|
|
48
|
+
*/ export declare let moveThread: (from: Home, to: string, thread: string) => Promise<boolean>;
|
|
49
|
+
/** What a compressed transcript is at a moment: its size and when it was
|
|
50
|
+
* written. A read that reached its end records this as `transcript.finished`. */ export declare let versionOf: (file: {
|
|
51
|
+
size: number;
|
|
52
|
+
mtime: Date | null;
|
|
53
|
+
} | undefined) => string;
|
|
54
|
+
/** One transcript on disk: the harness's id for the session, and the file. */ export type Found = {
|
|
55
|
+
id: string;
|
|
56
|
+
path: string;
|
|
57
|
+
/** the CLI that keeps it, where it is not Claude Code */ runner?: Exclude<Runner, 'claude'>;
|
|
58
|
+
/** a subagent's: the harness's id for the session that started it */ parent?: string;
|
|
59
|
+
/** the account whose transcript it is (@yaks/model `account`) */ account?: string;
|
|
60
|
+
};
|
|
61
|
+
/** Every transcript under a Claude projects directory: the sessions', then
|
|
62
|
+
* their subagents'. Listed a directory at a time, so the thread runs its
|
|
63
|
+
* timers between them: a box keeps thousands. */ export declare let transcripts: (dir: string) => Promise<Found[]>;
|
|
64
|
+
export declare let rollouts: (dir: string, depth?: number) => Promise<Found[]>;
|
|
65
|
+
export declare let header: (path: string) => Record<string, unknown>;
|
|
66
|
+
/** Every Grok Build session under its `sessions` directory: one directory
|
|
67
|
+
* per working directory (percent-encoded), and in it one per session, named
|
|
68
|
+
* by its id, holding the model's history, `chat_history.jsonl`. */ export declare let grokSessions: (dir: string) => Promise<Found[]>;
|
|
69
|
+
/** Every Antigravity CLI conversation under its `brain` directory: one
|
|
70
|
+
* directory per conversation, named by its id, whose steps are logged in
|
|
71
|
+
* `.system_generated/logs/transcript_full.jsonl`, or, where an older version
|
|
72
|
+
* kept only the shortened log, `transcript.jsonl`. */ export declare let conversations: (dir: string) => Promise<Found[]>;
|
|
73
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sources":["../files.ts"],"names":[],"mappings":"AAIA,YAAY,+CAAoD;AAChE,cAAc,MAAM,2BAAgC;AAEpD,SAA4C,KAAK,MAAM,2BAAgC;AAEvF;;yCAEyC,GACzC,YAAY;EAAS,QAAQ;EAAQ,KAAK,MAAM;;KAU3C,MAAM,KAAK,cAAc,KAAK;AAEnC;;;iCAGiC,GACjC,OAAO,YAAI,OACT,QAAQ,KAAK,WACb,MAAK,QACJ,MAAM,GAAG,SAAS,CAAgD;AAErE;iDACiD,GACjD,OAAO,YAAI,gBAAiB,GAAG,SAAO,MAAM,CAAiC;AAE7E;gBACgB,GAChB,OAAO,YAAI,YAAa,GAAG,SAAO,MAAM,CAAuB;AA+B/D;;;;;;;;;;;;;CAaC,GACD,OAAO,YAAI,QACT,SAAQ,MAAM,IACd,gBACA,MAAK,QACJ,QAAQ,QAuBV;AAED,2EAA2E,GAC3E,OAAO,YAAI,cAAe,MAAM,WAAS,SAYxC;AAED;;oEAEoE,GACpE,OAAO,YAAI,OAAc,MAAM,WAAS,QAAQ,SAKnC;AAEb;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,aACT,MAAM,MACN,IAAI,MAAM,EACV,QAAQ,MAAM,KACb,QAAQ,OAAO,EAOjB;AAED;+EAC+E,GAC/E,OAAO,YAAI,YACT;EAAQ,MAAM,MAAM;EAAE,OAAO,OAAO,IAAI;IAAK,SAAS,KACrD,MAAM,CAA4D;AAErE,4EAA4E,GAC5E,YAAY;EACV,IAAI,MAAM;EACV,MAAM,MAAM;EACZ,uDAAuD,GACvD,SAAS,QAAQ,QAAQ;EACzB,mEAAmE,GACnE,SAAS,MAAM;EACf,+DAA+D,GAC/D,UAAU,MAAM;;AAGlB;;+CAE+C,GAC/C,OAAO,YAAI,cAAqB,KAAK,MAAM,KAAG,QAAQ,SAuBrD;AAaD,OAAO,YAAI,WAAkB,KAAK,MAAM,EAAE,mBAAY,QAAQ,SAqB7D;AAID,OAAO,YAAI,SAAU,MAAM,MAAM,KAAG,OAAO,MAAM,EAAE,OAAO,EAmBzD;AAKD;;iEAEiE,GACjE,OAAO,YAAI,eAAsB,KAAK,MAAM,KAAG,QAAQ,SAWtD;AAED;;;oDAGoD,GACpD,OAAO,YAAI,gBAAuB,KAAK,MAAM,KAAG,QAAQ,SAYvD"}
|
package/_dist/fork.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Bundle, Eid, Graph } from "@yaks/graph";
|
|
2
|
+
import type { Step } from "./react.js";
|
|
3
|
+
/** Prose a model gave while its fork still has work. A tool step can carry
|
|
4
|
+
* an output with prose alongside its result, so only a model step speaks.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { equal } from '@yaks/testing'
|
|
8
|
+
* import { forkProgress } from './fork.ts'
|
|
9
|
+
* let words = { entity: { eid: 'draft' }, output: {}, content: { body: 'On it.' } }
|
|
10
|
+
* equal(forkProgress({ did: 'asked', status: 'running', added: [words] }), words)
|
|
11
|
+
* equal(forkProgress({ did: 'ran', status: 'running', added: [words] }), undefined)
|
|
12
|
+
* ```
|
|
13
|
+
*/ export declare let forkProgress: (step: Step) => Bundle | undefined;
|
|
14
|
+
/** Where a fork's answer goes: the parent session, the request it answers,
|
|
15
|
+
* the child's last entry, and whether the parent has spoken since. */ export type ForkAnswer = {
|
|
16
|
+
parent: Eid;
|
|
17
|
+
input: Bundle;
|
|
18
|
+
mark: Bundle;
|
|
19
|
+
earlier: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** A fork's answer is a passive receipt in the same conversation as its request. */ export declare let forkAnswer: (g: Graph, child: Bundle, output?: Bundle) => Promise<ForkAnswer | undefined>;
|
|
22
|
+
/** Record the answer as the child's delivery. The parent can read it without waking. */ export declare let forkReceipt: (g: Graph, child: Eid, {}: ForkAnswer, text: string, by: Eid, outcome?: 'settled' | 'failed' | 'stopped') => Promise<Bundle>;
|
|
23
|
+
//# sourceMappingURL=fork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fork.d.ts","sources":["../fork.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,EAAQ,GAAG,EAAE,KAAK,2BAAgC;AAOtE,cAAc,IAAI,qBAAoB;AAMtC;;;;;;;;;;CAUC,GACD,OAAO,YAAI,eAAgB,MAAM,SAAO,SAAS,SAAS,CAG3C;AA6Cf;oEACoE,GACpE,YAAY;EACV,QAAQ;EACR,OAAO;EACP,MAAM;EACN,SAAS,OAAO;;AAGlB,kFAAkF,GAClF,OAAO,YAAI,aACT,GAAG,OACH,OAAO,QACP,SAAS,WACR,QAAQ,aAAa,SAAS,EAkBhC;AAED,sFAAsF,GACtF,OAAO,YAAI,cACT,GAAG,OACH,OAAO,KACP,IAAkB,UAAU,EAC5B,MAAM,MAAM,EACZ,IAAI,KACJ,UAAU,YAAY,WAAW,cAChC,QAAQ,QAST"}
|
package/_dist/graft.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Bundle, Eid } from "@yaks/graph";
|
|
2
|
+
/**
|
|
3
|
+
* The rows that begin `session` with `lines`, another transcript's entries:
|
|
4
|
+
* each line it carries (`CARRIED`) as a new entry of `session`, in transcript
|
|
5
|
+
* order and appended after whatever the session holds, with the components
|
|
6
|
+
* that say what it is (`KEPT`). A reference from one line to another names
|
|
7
|
+
* the other's copy. Each copy's eid is derived from the session and the
|
|
8
|
+
* original's, so giving the same lines again writes the same rows.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { grafted } from './graft.ts'
|
|
12
|
+
* import { assertEquals } from '@std/assert'
|
|
13
|
+
* let at = (eid: string, seq: number, rest: object) => ({
|
|
14
|
+
* entity: { eid }, entry: { session: 'demo', seq }, ...rest,
|
|
15
|
+
* })
|
|
16
|
+
* let rows = grafted([
|
|
17
|
+
* at('said', 1, { content: { body: 'A guestbook' }, using: { model: 'm' } }),
|
|
18
|
+
* at('asked', 2, { ask: { to: 'm', through: 'said' }, anthropic: {} }),
|
|
19
|
+
* at('call', 3, { call: { name: 'app_deploy', source: 'asked' } }),
|
|
20
|
+
* at('done', 4, { result: { call: 'call', value: 1 } }),
|
|
21
|
+
* at('rule', 5, { prompt: { scope: 'local' }, content: { body: 'Be kind' } }),
|
|
22
|
+
* ], 'mine')
|
|
23
|
+
* assertEquals(rows.map((r) => Object.keys(r)), [
|
|
24
|
+
* ['entity', 'entry', 'content'],
|
|
25
|
+
* ['entity', 'entry', 'ask'],
|
|
26
|
+
* ['entity', 'entry', 'call'],
|
|
27
|
+
* ['entity', 'entry', 'result'],
|
|
28
|
+
* ])
|
|
29
|
+
* assertEquals((rows[3].result as { call: string }).call, rows[2].entity.eid)
|
|
30
|
+
* assertEquals(rows[1].entry, { session: 'mine' })
|
|
31
|
+
* ```
|
|
32
|
+
*/ export declare let grafted: (lines: Bundle[], session: Eid) => Bundle[];
|
|
33
|
+
//# sourceMappingURL=graft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graft.d.ts","sources":["../graft.ts"],"names":[],"mappings":"AAIA,cAAc,MAAM,EAAQ,GAAG,2BAAgC;AA0B/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,YAAI,UAAW,OAAO,UAAU,SAAS,QAAM,SA0BrD"}
|
package/_dist/graph.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Authenticate, VIA } from "@yaks/api";
|
|
2
|
+
import type { Bundle, Graph, Plugin } from "@yaks/graph";
|
|
3
|
+
import { type Door } from "./bus.js";
|
|
4
|
+
export { callIn } from "./announce.js";
|
|
5
|
+
/** Transcripts, leases and the audit of a bounced claim. */ export declare let plugins: () => Plugin[];
|
|
6
|
+
/** What a direct tool call owes the session speaking through it. */ export declare let reply: (host: Door) => any;
|
|
7
|
+
export { VIA };
|
|
8
|
+
/** What `authenticate` is given: the graph, once it is open. */ export type Host = {
|
|
9
|
+
graph: Graph;
|
|
10
|
+
};
|
|
11
|
+
/** Who a request is from: the run the hook door said makes the harness call
|
|
12
|
+
* its message names, else the run its `x-via` header names, as the actor
|
|
13
|
+
* behind what it writes. */ export declare let authenticate: (host: Host) => Authenticate;
|
|
14
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sources":["../graph.ts"],"names":[],"mappings":"AA2BA,SAAS,KAAK,YAAY,EAAE,GAAG,yBAA8B;AAC7D,cAAqB,MAAM,EAAE,KAAK,EAAE,MAAM,2BAAgC;AAE1E,SAAS,KAAK,IAAI,mBAAiC;AAInD,SAAS,MAAM,wBAAuB;AAEtC,0DAA0D,GAC1D,OAAO,YAAI,eAAc,SAAwB;AAEjD,kEAAkE,GAClE,OAAO,YAAI,QAAS,MAAM,aACR;AAElB,SAAS,GAAG,GAAE;AAEd,8DAA8D,GAC9D,YAAY;EAAS,OAAO;;AAE5B;;0BAE0B,GAC1B,OAAO,YAAI,eACR,MAAM,SAAO,aAQb"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Bundle, Eid, Graph } from "@yaks/graph";
|
|
2
|
+
/** The files a transcript's calls named, newest first, each once. */ export declare let touched: (entries: Bundle[]) => string[];
|
|
3
|
+
/**
|
|
4
|
+
* The note a session gets when another model takes over its conversation
|
|
5
|
+
* from another harness: what the conversation ran on so far, by the names
|
|
6
|
+
* `names` gives the provider and model rows its newest `using` or ask names,
|
|
7
|
+
* and the files its calls named, at most `limit`.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { handoff } from './handoff.ts'
|
|
11
|
+
* import { assertEquals } from '@std/assert'
|
|
12
|
+
*
|
|
13
|
+
* let entries = [
|
|
14
|
+
* { entity: { eid: 'u' }, entry: { session: 's', seq: 1 }, using: { provider: 'p' } },
|
|
15
|
+
* { entity: { eid: 'c' }, entry: { session: 's', seq: 2 },
|
|
16
|
+
* call: { name: 'Edit', args: { file_path: '/w/a.ts' } } },
|
|
17
|
+
* ]
|
|
18
|
+
* assertEquals(handoff(entries, new Map([['p', 'claude']])),
|
|
19
|
+
* 'Until here this conversation ran on claude, and another model takes ' +
|
|
20
|
+
* 'it over now. The tool calls above were made with that harness\'s own ' +
|
|
21
|
+
* 'tools, and their results are as it saw them; call your own tools from ' +
|
|
22
|
+
* 'here on.\n\nFiles it worked on, newest first:\n- /w/a.ts')
|
|
23
|
+
* ```
|
|
24
|
+
*/ export declare let handoff: (entries: Bundle[], names: Map<Eid, string>, limit?: number) => string;
|
|
25
|
+
/** The note for `session` ({@link handoff}) where another harness ran its
|
|
26
|
+
* conversation so far: its newest model selection or request was read from
|
|
27
|
+
* that harness's file (`lines{file, start}`), not asked here. Nothing where
|
|
28
|
+
* this harness asked it last, or nothing asked it yet. */ export declare let handoffOf: (g: Graph, session: Eid) => Promise<string | undefined>;
|
|
29
|
+
//# sourceMappingURL=handoff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handoff.d.ts","sources":["../handoff.ts"],"names":[],"mappings":"AAMA,cAAc,MAAM,EAAQ,GAAG,EAAE,KAAK,2BAAgC;AAyBtE,mEAAmE,GACnE,OAAO,YAAI,UAAW,SAAS,aAAW,MAAM,GAc/C;AAED;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,YAAI,UACT,SAAS,UACT,OAAO,IAAI,KAAK,MAAM,GACtB,mBACC,MAAM,CAsBR;AAED;;;wDAGwD,GACxD,OAAO,YAAI,YACT,GAAG,OACH,SAAS,QACR,QAAQ,MAAM,GAAG,SAAS,EAiB5B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Bundle, Eid } from "@yaks/graph";
|
|
2
|
+
import type { Comps, Said } from "./readers.js";
|
|
3
|
+
/** The entity a harness's call becomes, named by the harness's own id for it,
|
|
4
|
+
* which is also what its result names. */ export declare let callOf: (session: Eid, id: string) => Eid;
|
|
5
|
+
/** The entry a model request becomes, named by the harness's own id for it,
|
|
6
|
+
* which every line of its reply names again. */ export declare let askOf: (session: Eid, id: string) => Eid;
|
|
7
|
+
/**
|
|
8
|
+
* Whether an entry is prose: what a person typed (content alone), or what the
|
|
9
|
+
* model said (content and the output that marks it).
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { prose } from '@yaks/session/tail'
|
|
13
|
+
* import { assertEquals } from '@std/assert'
|
|
14
|
+
*
|
|
15
|
+
* assertEquals(prose({ content: { body: 'hi' } }), true)
|
|
16
|
+
* assertEquals(prose({ content: { body: 'hmm' }, reasoning: {}, output: {} }), false)
|
|
17
|
+
* ```
|
|
18
|
+
*/ export declare let prose: (c: Comps) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* One line, as the bundles it becomes: an entry for each thing it says, each
|
|
21
|
+
* sitting at the line of the file it was read from, a row for each tool it
|
|
22
|
+
* names, the answered call's state, and what it says about the session. A
|
|
23
|
+
* prompt a person typed is signed by `person`.
|
|
24
|
+
*/ export declare let imported: (said: Said, o: {
|
|
25
|
+
session: Eid;
|
|
26
|
+
/** the file the line is read from; a line handed over without its file
|
|
27
|
+
* (@yaks/spawn ./machines.ts) sits at no file */ file?: Eid;
|
|
28
|
+
/** the path it was opened at, which names the entries of a file other
|
|
29
|
+
* than the session's first */ path?: string;
|
|
30
|
+
line: number;
|
|
31
|
+
person?: Eid;
|
|
32
|
+
prose?: boolean;
|
|
33
|
+
own?: boolean;
|
|
34
|
+
}) => Bundle[];
|
|
35
|
+
/** A run of parts being joined: its key, the line of its first, and the
|
|
36
|
+
* entry they make so far. */ export type Open = {
|
|
37
|
+
key: string;
|
|
38
|
+
line: number;
|
|
39
|
+
entry: Comps;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* What a line says once the run of parts before it is joined, each with the
|
|
43
|
+
* line its entries sit at: the run's entry at its first line, where this line
|
|
44
|
+
* ends the run, then the line's own. A part of the run's key carries the run
|
|
45
|
+
* on, and a part of another key starts one.
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { pieced } from '@yaks/session/tail'
|
|
49
|
+
* import { assertEquals } from '@std/assert'
|
|
50
|
+
*
|
|
51
|
+
* let h = {}
|
|
52
|
+
* let piece = (body: string) => ({ entries: [], part: { key: 'r', entry: { content: { body } } } })
|
|
53
|
+
* pieced(h, piece('Hel'), 3)
|
|
54
|
+
* pieced(h, piece('lo'), 4)
|
|
55
|
+
* assertEquals(pieced(h, { entries: [{ stop: {} }] }, 5), [
|
|
56
|
+
* [{ entries: [{ content: { body: 'Hello' } }] }, 3],
|
|
57
|
+
* [{ entries: [{ stop: {} }] }, 5],
|
|
58
|
+
* ])
|
|
59
|
+
* ```
|
|
60
|
+
*/ export declare let pieced: (h: {
|
|
61
|
+
part?: Open;
|
|
62
|
+
}, said: Said, line: number) => [Said, number][];
|
|
63
|
+
//# sourceMappingURL=imported.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imported.d.ts","sources":["../imported.ts"],"names":[],"mappings":"AAKA,cAAc,MAAM,EAAQ,GAAG,2BAAgC;AAI/D,cAAc,KAAK,EAAE,IAAI,uBAAsB;AAE/C;wCACwC,GACxC,OAAO,YAAI,SAAU,SAAS,KAAK,IAAI,MAAM,KAAG,IACX;AAErC;8CAC8C,GAC9C,OAAO,YAAI,QAAS,SAAS,KAAK,IAAI,MAAM,KAAG,IACX;AAEpC;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,QAAS,GAAG,UAAQ,OAAO,CAInC;AAmBH;;;;;CAKC,GACD,OAAO,YAAI,WACT,MAAM,MACN;EACE,SAAS;EACT;mDAC+C,GAC/C,OAAO;EACP;gCAC4B,GAC5B,OAAO,MAAM;EACb,MAAM,MAAM;EACZ,SAAS;EACT,QAAQ,OAAO;EACf,MAAM,OAAO;MAEd,SA8EF;AAED;2BAC2B,GAC3B,YAAY;EAAS,KAAK,MAAM;EAAE,MAAM,MAAM;EAAE,OAAO;;AAEvD;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,YAAI,SACT;EAAK,OAAO;GACZ,MAAM,MACN,MAAM,MAAM,MACV,MAAM,MAAM,IAef"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ApplyOpts, Bundle, Comp, Eid, Graph } from "@yaks/graph";
|
|
2
|
+
import { type Attached } from "@yaks/blob/attachment";
|
|
3
|
+
/** Words given a session from outside it, as its next input ({@link take}):
|
|
4
|
+
* whose they are (`by`) and, when someone else wrote them for that person,
|
|
5
|
+
* who did (`from`); what names them wherever they are given again (`id`),
|
|
6
|
+
* which is the item they came in (`item`, such as a request) unless the
|
|
7
|
+
* caller names them itself; the channel they came by and the framing said
|
|
8
|
+
* before them; the files that came with them and the address of the original
|
|
9
|
+
* text among those files (`source`); the model chosen to answer them (`using`); and what
|
|
10
|
+
* the host keeps beside them (`with`). Words the platform wrote, never a person's, are `system`. */ export type Intake = {
|
|
11
|
+
session: Eid;
|
|
12
|
+
body: string;
|
|
13
|
+
by: Eid;
|
|
14
|
+
id?: string;
|
|
15
|
+
item?: Eid;
|
|
16
|
+
from?: string;
|
|
17
|
+
channel?: {
|
|
18
|
+
name: string;
|
|
19
|
+
framing?: string;
|
|
20
|
+
};
|
|
21
|
+
files?: Attached[];
|
|
22
|
+
source?: string;
|
|
23
|
+
using?: Comp;
|
|
24
|
+
system?: boolean;
|
|
25
|
+
with?: Record<string, Comp>;
|
|
26
|
+
};
|
|
27
|
+
/** The input the words named `id` become in the session that takes them
|
|
28
|
+
* in: one id, so a request and its line are one, and giving them again
|
|
29
|
+
* writes nothing. The words it is derived from are the ones its first rows
|
|
30
|
+
* were named by. */ export declare let inputOf: (id: string) => Eid;
|
|
31
|
+
/** The rows that give a session these words: its input, linked back to the
|
|
32
|
+
* item it came in (`intake{item}`), and each file's attachment to that item, or
|
|
33
|
+
* to the input where no item names them (@yaks/blob/attachment). */ export declare let intake: (words: Intake) => Bundle[];
|
|
34
|
+
/** Give a session words ({@link intake}), with what the host writes `beside`
|
|
35
|
+
* them in the same batch: the input's id, and whether this wrote it. Named
|
|
36
|
+
* words already taken in write nothing, `beside` included, however many
|
|
37
|
+
* times or at once they are given again. */ export declare let take: (g: Pick<Graph, 'get' | 'apply'>, words: Intake, beside?: Bundle[], options?: ApplyOpts) => Promise<{
|
|
38
|
+
input: Eid;
|
|
39
|
+
fresh: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
/** The session a task's next words go to: the newest it holds
|
|
42
|
+
* (`contains`), if any. */ export declare let taskSession: (g: Pick<Graph, 'read' | 'get'>, task: Eid) => Promise<Eid | undefined>;
|
|
43
|
+
//# sourceMappingURL=intake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intake.d.ts","sources":["../intake.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,2BAAgC;AAIjF,SAAS,KAAK,QAAQ,qCAA0D;AAKhF;;;;;;;kGAOkG,GAClG,YAAY;EACV,SAAS;EACT,MAAM,MAAM;EACZ,IAAI;EACJ,KAAK,MAAM;EACX,OAAO;EACP,OAAO,MAAM;EACb;IAAY,MAAM,MAAM;IAAE,UAAU,MAAM;;EAC1C,QAAQ;EACR,SAAS,MAAM;EACf,QAAQ;EACR,SAAS,OAAO;EAChB,OAAO,OAAO,MAAM,EAAE;;AAGxB;;;kBAGkB,GAClB,OAAO,YAAI,UAAW,IAAI,MAAM,KAAG,IAAyC;AAE5E;;kEAEkE,GAClE,OAAO,YAAI,SAAU,OAAO,WAAS,SAyBpC;AAED;;;0CAG0C,GAC1C,OAAO,YAAI,OACT,GAAG,KAAK,OAAO,QAAQ,UACvB,OAAO,QACP,SAAQ,UACR,UAAS,cACR;EAAU,OAAO;EAAK,OAAO,OAAO;GAqBtC;AAED;yBACyB,GACzB,OAAO,YAAI,cACT,GAAG,KAAK,OAAO,SAAS,QACxB,MAAM,QACL,QAAQ,MAAM,SAAS,EAczB"}
|