@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 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sources":["../run.ts"],"names":[],"mappings":"AAQA,cAA8B,QAAQ,6BAAkC;AAExE,cAAc,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,2BAAwC;AAoB9E,SAAS,KAAK,WAAW,wBAAqC;AAI9D,SAEE,KAAK,IAAI,EAKT,KAAK,IAAI,qBACQ;AAsBnB;6CAC6C,GAC7C,YAAY,SAAS,OAAO;EAC1B;0CACwC,GACxC,QAAQ;EACR;yEACuE,GACvE,WACE,OAAO,OAAO,SAAS,EACvB,UAAU,QACP,OAAO,GAAG,QAAQ,OAAO;EAC9B;0DACwD,GACxD,UAAU,MAAM;EAChB,2BAA2B,GAC3B,QAAQ,MAAM,MAAM,UAAU,MAAM,KAAK,IAAI,GAAG,QAAQ,IAAI;EAC5D;iEAC+D,GAC/D,kBAAkB,SAAS,QAAQ,QAAQ,OAAO;EAClD;;;mCAGiC,GACjC,SAAS,SAAS,QAAQ,QAAQ,IAAI;EACtC;;2DAEyD,GACzD,WAAW,SAAS,QAAQ,QAAQ,IAAI;EACxC,oEAAoE,GACpE,QAAQ,SAAS,QAAQ,QAAQ,IAAI;EACrC,+DAA+D,GAC/D,OAAO,MAAM;EACb;uEACqE,GACrE,QAAQ,QAAQ,QAAQ,OAAO,GAAG,QAAQ,OAAO;EACjD,wEAAwE,GACxE,OAAO,MAAM;;AAGf,yEAAyE,GACzE,OAAO,YAAI,YAAyB;AA+XpC;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,SAAU,GAAG,OAAO,SAAS,KAAK,GAAG,WAAS,QAAQ,IAAI,EAmCpE;AAED,iEAAiE,GACjE,OAAO,YAAI,cAAe,GAAG,OAAO,SAAS,QAAM,OAAO,CACN;AAEpD,uEAAuE,GACvE,OAAO,YAAI,YAAmB,GAAG,OAAO,SAAS,QAAM,QAAQ,OAAO,EAIrE;AAED,4EAA4E,GAC5E,OAAO,YAAI,UAAW,GAAG,OAAO,SAAS,QAAM,QAAQ,IAAI,IAAI,SAAS,CACR;AA8JhE;;yBAEyB,GACzB,OAAO,YAAI,YACT,GAAG,OACH,SAAS,KACT,GAAG,WACF,QAAQ,OAAO,EAA0D;AAE5E;;;4EAG4E,GAC5E,OAAO,YAAI,SACT,GAAG,OACH,SAAS,KACT,GAAG,WACF,QAAQ,IAAI,EAWd;AA4DD;;;;;;;;;;;;;CAaC,GACD,OAAO,YAAI,QACT,GAAG,OACH,SAAS,KACT,MAAM,WACL,QAAQ,IAAI,EAad;AAED;;;;;;;;;;;;;;CAcC,GACD,OAAO,YAAI,UACT,GAAG,OACH,QAAQ,SAAS,QAAQ,SACzB,SAAQ,SAAS,KAAK,QAAQ,WAAW,SAAS,QAAQ,YAIzD,SAoIF"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { Eid, Graph } from "@yaks/graph";
|
|
2
|
+
import type { Feed } from "@yaks/host";
|
|
3
|
+
import { type Reader } from "./readers.js";
|
|
4
|
+
import { type Tail } from "./tail.js";
|
|
5
|
+
import { type Found, type Home } from "./files.js";
|
|
6
|
+
export { type Found, held, type Home, homes, rollouts, transcripts } from "./files.js";
|
|
7
|
+
/** What a config file can set for this plugin's duty. */ export type Options = {
|
|
8
|
+
/** how often transcripts are looked at, in milliseconds (default one
|
|
9
|
+
* second) */ every?: number;
|
|
10
|
+
/** how long what a native session is owed waits for more before it is
|
|
11
|
+
* given, in milliseconds (default ./listen.ts `QUIET`) */ quiet?: number;
|
|
12
|
+
/** more accounts to read, beside the ones found on their own: each a
|
|
13
|
+
* Claude Code `CLAUDE_CONFIG_DIR` or a Codex `CODEX_HOME` (./files.ts
|
|
14
|
+
* `homes`) */ homes?: string[];
|
|
15
|
+
/** whether the `~/.claude*` and `~/.codex*` accounts, and the ones the
|
|
16
|
+
* environment names, are found on their own (default true) */ find?: boolean;
|
|
17
|
+
/** how long a session keeps its full depth after it was last written, in
|
|
18
|
+
* milliseconds (default 14 days) */ full?: number;
|
|
19
|
+
/** how often every transcript is listed again, in milliseconds (default
|
|
20
|
+
* {@link SCAN}) */ scan?: number;
|
|
21
|
+
};
|
|
22
|
+
/** How long a session keeps its full depth once it stops being written. */ export declare let FULL: any;
|
|
23
|
+
/** What one process knows about the files it reads: the tail on each one it
|
|
24
|
+
* follows (`null` for a managed run's), and the older ones read to the end. */ export type Seen = {
|
|
25
|
+
tails: Map<string, Tail | null>;
|
|
26
|
+
done: Set<string>;
|
|
27
|
+
versions?: Map<string, string>;
|
|
28
|
+
retry?: Map<string, number>;
|
|
29
|
+
turns?: Map<string, number>;
|
|
30
|
+
turn?: number;
|
|
31
|
+
/** every transcript, as the last listing found them */ listed?: {
|
|
32
|
+
at: number;
|
|
33
|
+
files: Found[];
|
|
34
|
+
};
|
|
35
|
+
/** when each transcript was last seen written */ written?: Map<string, number>;
|
|
36
|
+
};
|
|
37
|
+
/** Whether a session is a managed run: one @yaks/spawn launches, claiming
|
|
38
|
+
* its `process` before the launch, and reads from the run's own stream, so
|
|
39
|
+
* the transcript file the run also keeps is not read a second time. A model
|
|
40
|
+
* taking a conversation over here (@yaks/harness `session_send`) makes none:
|
|
41
|
+
* the harness that ran it may write to its file again. */ export declare let managed: (g: Graph, session: Eid) => Promise<boolean>;
|
|
42
|
+
/** How long a look reads one transcript before it turns to the next, in
|
|
43
|
+
* milliseconds. */ export declare let SLICE: number;
|
|
44
|
+
/** How long a transcript is unwritten before a look marks the lines it read
|
|
45
|
+
* that made no entry (./tail.ts `rest`), in milliseconds. */ export declare let QUIET: number;
|
|
46
|
+
/** How long one look reads in all, in milliseconds. */ export declare let BUDGET: number;
|
|
47
|
+
/** How often a look lists every transcript again, in milliseconds. Listing
|
|
48
|
+
* and asking after each of the thousands a box keeps is a look's dearest
|
|
49
|
+
* part, so the looks between listings ask only after the transcripts open or
|
|
50
|
+
* written in the last {@link HOT}, and the next one to read in. A new
|
|
51
|
+
* transcript, or an old one written again, is found by the next listing. */ export declare let SCAN: number;
|
|
52
|
+
/** How lately a transcript was written for the looks between listings to ask
|
|
53
|
+
* after it, in milliseconds. */ export declare let HOT: any;
|
|
54
|
+
/**
|
|
55
|
+
* One look at every transcript the accounts `from` keep: each written to in the last
|
|
56
|
+
* `full` milliseconds is read on at full depth, and one older transcript not
|
|
57
|
+
* yet read to its end is read in, its prose only. The one least behind is read
|
|
58
|
+
* first, each for a `slice` (and at least a line), until the look has read for
|
|
59
|
+
* its `budget`: a long backlog is read over many looks, and what a live
|
|
60
|
+
* session says next never waits behind it. A look whose `signal` aborts stops
|
|
61
|
+
* between lines, and the next process reads on from there. Every transcript is
|
|
62
|
+
* listed again only each `scan` ({@link SCAN}).
|
|
63
|
+
*/ export declare let look: (g: Graph, from: Home[], seen: Seen, o?: {
|
|
64
|
+
person?: Eid;
|
|
65
|
+
full?: number;
|
|
66
|
+
scan?: number;
|
|
67
|
+
now?: number;
|
|
68
|
+
signal?: AbortSignal;
|
|
69
|
+
slice?: number;
|
|
70
|
+
budget?: number;
|
|
71
|
+
report?: (error: unknown) => void;
|
|
72
|
+
}) => Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* One bounded page of imported entries to strip from a quiet session. Empty
|
|
75
|
+
* pages give the duty its turn back after a recent or already stripped session.
|
|
76
|
+
* The newest entry is checked before every page, so a session that speaks again
|
|
77
|
+
* keeps its remaining depth. Identity cursors survive the entries' deletion.
|
|
78
|
+
*/ export declare let stale: (g: Graph, o?: {
|
|
79
|
+
full?: number;
|
|
80
|
+
now?: number;
|
|
81
|
+
signal?: AbortSignal;
|
|
82
|
+
}) => AsyncGenerator<Eid[]>;
|
|
83
|
+
/** How many entries one step of a strip deletes. */ export declare let BATCH: number;
|
|
84
|
+
/** One step of a strip: these entries, deleted. */ export declare let strip: (g: Graph, eids: Eid[]) => Promise<void>;
|
|
85
|
+
/** Free the locks whose holder is gone, then read transcripts in, end the
|
|
86
|
+
* sessions whose process is gone and strip the stale sessions until `signal`
|
|
87
|
+
* aborts. A pass that fails is logged and
|
|
88
|
+
* made again on the next, where the transcript stands. What the config's
|
|
89
|
+
* `person` typed is signed with them. */ export declare let service: (host: {
|
|
90
|
+
graph: Graph;
|
|
91
|
+
config?: {
|
|
92
|
+
person?: string;
|
|
93
|
+
};
|
|
94
|
+
feed?: Feed;
|
|
95
|
+
report?: (error: unknown) => void | Promise<void>;
|
|
96
|
+
}, options?: Options, signal?: AbortSignal) => Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Read every transcript written since `since` to its end, as the duty would
|
|
99
|
+
* but at once, then again for its model requests (./tail.ts `recount`), and
|
|
100
|
+
* walk the graph's own sessions for theirs: what was written before requests
|
|
101
|
+
* were read and measured; and title each subagent read before sessions were
|
|
102
|
+
* titled. What `person` typed is signed with them. A managed run's
|
|
103
|
+
* transcript is @yaks/spawn's (`recounted` there). Answers how many requests
|
|
104
|
+
* it measured.
|
|
105
|
+
*
|
|
106
|
+
* ```ts
|
|
107
|
+
* import { recounted } from '@yaks/session/service'
|
|
108
|
+
*
|
|
109
|
+
* // await recounted(graph, '2026-10-13')
|
|
110
|
+
* ```
|
|
111
|
+
*/ export declare let recounted: (g: Graph, since: string, o?: Options & {
|
|
112
|
+
person?: Eid;
|
|
113
|
+
now?: number;
|
|
114
|
+
signal?: AbortSignal;
|
|
115
|
+
}) => Promise<number>;
|
|
116
|
+
/**
|
|
117
|
+
* The copy each provider keeps of its threads on this machine (Claude Code's
|
|
118
|
+
* transcripts, Codex's rollouts), by the provider's id for the thread: where
|
|
119
|
+
* it is and how its lines read. A managed run's own log can be tidied away
|
|
120
|
+
* while its provider's copy stays (@yaks/spawn `recounted`).
|
|
121
|
+
*
|
|
122
|
+
* ```ts
|
|
123
|
+
* import { kept } from '@yaks/session/service'
|
|
124
|
+
*
|
|
125
|
+
* // let copy = (await kept()).get(thread)
|
|
126
|
+
* ```
|
|
127
|
+
*/ export declare let kept: (o?: Options) => Promise<Map<string, {
|
|
128
|
+
path: string;
|
|
129
|
+
read: Reader;
|
|
130
|
+
}>>;
|
|
131
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sources":["../service.ts"],"names":[],"mappings":"AA6CA,cAA4B,GAAG,EAAE,KAAK,2BAAgC;AACtE,cAAc,IAAI,0BAA+B;AAIjD,SAME,KAAK,MAAM,uBAEQ;AAGrB,SAME,KAAK,IAAI,oBAGO;AAIlB,SAEE,KAAK,KAAK,EAGV,KAAK,IAAI,qBAKQ;AACnB,SACE,KAAK,KAAK,EACV,IAAI,EACJ,KAAK,IAAI,EACT,KAAK,EACL,QAAQ,EACR,WAAW,qBACM;AAInB,uDAAuD,GACvD,YAAY;EACV;aACW,GACX,QAAQ,MAAM;EACd;0DACwD,GACxD,QAAQ,MAAM;EACd;;cAEY,GACZ,QAAQ,MAAM;EACd;8DAC4D,GAC5D,OAAO,OAAO;EACd;oCACkC,GAClC,OAAO,MAAM;EACb;mBACiB,GACjB,OAAO,MAAM;;AAGf,yEAAyE,GACzE,OAAO,YAAI,UAA+B;AAE1C;6EAC6E,GAC7E,YAAY;EACV,OAAO,IAAI,MAAM,EAAE,OAAO,IAAI;EAC9B,MAAM,IAAI,MAAM;EAChB,WAAW,IAAI,MAAM,EAAE,MAAM;EAC7B,QAAQ,IAAI,MAAM,EAAE,MAAM;EAC1B,QAAQ,IAAI,MAAM,EAAE,MAAM;EAC1B,OAAO,MAAM;EACb,qDAAqD,GACrD;IAAW,IAAI,MAAM;IAAE,OAAO;;EAC9B,+CAA+C,GAC/C,UAAU,IAAI,MAAM,EAAE,MAAM;;AAG9B;;;;wDAIwD,GACxD,OAAO,YAAI,UAAiB,GAAG,OAAO,SAAS,QAAM,QAAQ,OAAO,EAInE;AAmOD;iBACiB,GACjB,OAAO,YAAI,cAAW;AAEtB;2DAC2D,GAC3D,OAAO,YAAI,cAAY;AAEvB,qDAAqD,GACrD,OAAO,YAAI,eAAa;AAExB;;;;0EAI0E,GAC1E,OAAO,YAAI,aAAa;AAExB;8BAC8B,GAC9B,OAAO,YAAI,SAAiB;AAiB5B;;;;;;;;;CASC,GACD,OAAO,YAAI,OACT,GAAG,OACH,MAAM,QACN,MAAM,MACN;EACE,SAAS;EACT,OAAO,MAAM;EACb,OAAO,MAAM;EACb,MAAM,MAAM;EACZ,SAAS;EACT,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,UAAU,OAAO,OAAO,KAAK,IAAI;MAElC,QAAQ,IAAI,EAuId;AAwBD;;;;;CAKC,GACD,OAAO,YAAI,QACT,GAAG,OACH;EAAK,OAAO,MAAM;EAAE,MAAM,MAAM;EAAE,SAAS;MAC1C,eAAe,OA+BjB;AAED,kDAAkD,GAClD,OAAO,YAAI,cAAU;AAErB,iDAAiD,GACjD,OAAO,YAAI,QAAe,GAAG,OAAO,MAAM,UAAQ,QAAQ,IAAI,EAI7D;AAKD;;;;uCAIuC,GACvC,OAAO,YAAI,UACT;EACE,OAAO;EACP;IAAW,SAAS,MAAM;;EAC1B,OAAO;EACP,UAAU,OAAO,OAAO,KAAK,IAAI,GAAG,QAAQ,IAAI;GAElD,UAAS,SACT,SAAQ,gBACP,QAAQ,IAAI,EA0Ed;AA2CD;;;;;;;;;;;;;;CAcC,GACD,OAAO,YAAI,YACT,GAAG,OACH,OAAO,MAAM,EACb,IAAG;EAAY,SAAS;EAAK,MAAM,MAAM;EAAE,SAAS;MACnD,QAAQ,MAAM,EA+ChB;AAED;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,OACT,IAAG,YACF,QAAQ,IAAI,MAAM;EAAI,MAAM,MAAM;EAAE,MAAM;IAK1C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Bundle, Eid } from "@yaks/graph";
|
|
2
|
+
/** A source stored on the message takes precedence over writer stamps.
|
|
3
|
+
* Older transcripts retain their source through their structural components;
|
|
4
|
+
* `created.by` records an actor, not necessarily the writer of the prose. */ export declare let source: (entry: Bundle, names?: Map<Eid, string>) => string | undefined;
|
|
5
|
+
/** Host-rendered input prose and its writer, kept separate until assembly. */ export type InputText = string | {
|
|
6
|
+
text: string;
|
|
7
|
+
from?: string;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sources":["../source.ts"],"names":[],"mappings":"AACA,cAAc,MAAM,EAAQ,GAAG,2BAAgC;AAI/D;;2EAE2E,GAC3E,OAAO,YAAI,SACT,OAAO,QACP,QAAO,IAAI,KAAK,MAAM,MACrB,MAAM,GAAG,SAAS,CAyBpB;AAED,4EAA4E,GAC5E,YAAY,YAAY,MAAM;EAAK,MAAM,MAAM;EAAE,OAAO,MAAM"}
|
package/_dist/start.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Comp, Eid, Graph } from "@yaks/graph";
|
|
2
|
+
import type { Handlers } from "@yaks/effects";
|
|
3
|
+
import type { Beside } from "./recall.js";
|
|
4
|
+
/** What a host opens a session on a piece of work with. */ export type Opening = {
|
|
5
|
+
/** the persona the session wears, where the work's project has one */ persona?: Eid;
|
|
6
|
+
/** the model its first input asks: `using{provider, model}` */ using: Comp;
|
|
7
|
+
};
|
|
8
|
+
/** How sessions are started on comments. */ export type Starting = {
|
|
9
|
+
/** what this host opens a session on a task with */ opening: (task: Eid) => Opening | Promise<Opening>;
|
|
10
|
+
/** the most sessions started on comments at work at once (default 2) */ limit?: number;
|
|
11
|
+
/** how long a start past the limit waits before it asks again, in
|
|
12
|
+
* milliseconds (default ten seconds) */ wait?: number;
|
|
13
|
+
/** sets under a comment its person wrote what they said before
|
|
14
|
+
* (./recall.ts) */ beside?: Beside;
|
|
15
|
+
};
|
|
16
|
+
/** Start a session on the task `comment` is on, as its holder, with the
|
|
17
|
+
* comment as its first input. Answers the session, or nothing where the
|
|
18
|
+
* comment or its task has moved since the commit that owed the start. */ export declare let start: (g: Pick<Graph, 'vocab' | 'read' | 'get' | 'apply'>, comment: Eid, opening: Starting['opening'], beside?: Beside) => Promise<Eid | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* The `session_start` handler, for a host that can open a session: none where
|
|
21
|
+
* the vocabulary declares no such effect.
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { starting } from '@yaks/session'
|
|
25
|
+
*
|
|
26
|
+
* // fx.handle(starting(graph, { opening: (task) => ({ using }) }))
|
|
27
|
+
* ```
|
|
28
|
+
*/ export declare let starting: (g: Graph, options: Starting) => Handlers;
|
|
29
|
+
//# sourceMappingURL=start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sources":["../start.ts"],"names":[],"mappings":"AAyBA,cAAsB,IAAI,EAAE,GAAG,EAAE,KAAK,2BAAgC;AAItE,cAAc,QAAQ,6BAAkC;AAOxD,cAAc,MAAM,sBAAqB;AAMzC,yDAAyD,GACzD,YAAY;EACV,oEAAoE,GACpE,UAAU;EACV,6DAA6D,GAC7D,OAAO;;AAGT,0CAA0C,GAC1C,YAAY;EACV,kDAAkD,GAClD,UAAU,MAAM,QAAQ,UAAU,QAAQ;EAC1C,sEAAsE,GACtE,QAAQ,MAAM;EACd;wCACsC,GACtC,OAAO,MAAM;EACb;mBACiB,GACjB,SAAS;;AAqCX;;uEAEuE,GACvE,OAAO,YAAI,QACT,GAAG,KAAK,OAAO,UAAU,SAAS,QAAQ,UAC1C,SAAS,KACT,SAAS,SAAS,YAClB,SAAQ,WACP,QAAQ,MAAM,SAAS,EAiEzB;AAYD;;;;;;;;;CASC,GACD,OAAO,YAAI,WAAY,GAAG,OAAO,SAAS,aAAW,SAoBpD"}
|
package/_dist/state.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type Built } from "@yaks/query";
|
|
2
|
+
import type { Bundle, Comp } from "@yaks/graph";
|
|
3
|
+
import type { Computed } from "@yaks/match";
|
|
4
|
+
/** A request is in flight while a holder owns its attempt. */ export declare let attemptState: (ask: Bundle) => 'interrupted' | 'inflight' | 'completed';
|
|
5
|
+
/** The kinds of entry: the component stored beside `entry`, or for prose,
|
|
6
|
+
* `output` when an `output` is stored beside it and `input` when none is.
|
|
7
|
+
* `reasoning` is what a model said of its reasoning beside a reply: neither
|
|
8
|
+
* the reply nor anyone's words. */ export type Kind = 'input' | 'reasoning' | 'ask' | 'call' | 'output' | 'result' | 'stop' | 'refusal' | 'interrupted' | 'exception';
|
|
9
|
+
/** What a transcript is doing. */ export type TranscriptStatus = 'empty' | 'pending' | 'running' | 'settled' | 'stopped' | 'failed';
|
|
10
|
+
/** How many consecutive interrupted requests the runner retries through before it leaves a
|
|
11
|
+
* transcript `failed`. */ export declare let RETRIES: number;
|
|
12
|
+
/** The error code of a request refused at a ceiling (a spending allowance, a
|
|
13
|
+
* quota): final rather than retried, since the next ask meets the same
|
|
14
|
+
* ceiling. The transcript is `failed` until something new is said to it. */ export declare let LIMIT: string;
|
|
15
|
+
/** The components that make an entry a kind ({@link kindOf}): a line
|
|
16
|
+
* carrying none of them, with prose and no `output`, is an input. */ export declare let kinded: () => string[];
|
|
17
|
+
/** The components that make an entry a kind ranked before `kind`
|
|
18
|
+
* ({@link kindOf}), whatever else it carries: a stop naming the request it
|
|
19
|
+
* answers (`ask.through`) is a stop, not an ask. */ export declare let outranking: (kind: Kind) => string[];
|
|
20
|
+
/** The ask an entry's prose came from, when a model returned it. */ export declare let sourceOf: (b: Bundle) => string | undefined;
|
|
21
|
+
/** Which kind of entry a bundle is, or `undefined` for one carrying none of
|
|
22
|
+
* the kind components and no prose. */ export declare let kindOf: (b: Bundle) => Kind | undefined;
|
|
23
|
+
/** The seq of an entry bundle. */ export declare let seqOf: (b: Bundle) => number;
|
|
24
|
+
/** The prose of an entry: its `content.body`, or nothing. */ export declare let textOf: (b: Bundle) => string;
|
|
25
|
+
/** Entries in transcript order. */ export declare let ordered: (entries: Bundle[]) => Bundle[];
|
|
26
|
+
/** The newest `ask` of a transcript: the model turn in force. */ export declare let newestAsk: (entries: Bundle[]) => Bundle | undefined;
|
|
27
|
+
/** What a session's newest ask sent (its `sending`, which names its
|
|
28
|
+
* instructions), while the prefix it cached is still in the provider's prompt
|
|
29
|
+
* cache. An ask whose expiry is unknown keeps none. */ export declare let cachedSending: (entries: Bundle[], session: string, now?: number) => Comp | undefined;
|
|
30
|
+
/** Whether the prefix a session's newest ask cached is known to have expired,
|
|
31
|
+
* so the next request pays for its whole context whatever it sends. An
|
|
32
|
+
* unknown expiry is not cold: nothing says the cache is gone. */ export declare let cold: (entries: Bundle[], session: string, now?: number) => boolean;
|
|
33
|
+
export declare let pastCache: (entries: Bundle[], session: string, now?: number) => boolean;
|
|
34
|
+
/** The calls that no result answers — what the runner runs next, and what
|
|
35
|
+
* keeps a transcript running past the prose the model returned beside them. */ export declare let openCalls: (entries: Bundle[]) => Bundle[];
|
|
36
|
+
/** Whether something new has arrived beyond the newest request's context
|
|
37
|
+
* boundary for the model to take a turn on. An input asks at once. A result,
|
|
38
|
+
* or the Pending entry a call of the newest reply is given when it outlasts
|
|
39
|
+
* its patience (./react.ts `PATIENCE`), asks once each background call of that
|
|
40
|
+
* reply has answered or outlasted it: the model asked for them together. A
|
|
41
|
+
* background call alone asks nothing more of the model, and the Pending of an
|
|
42
|
+
* older reply's call never asks again: a later request already sent it as
|
|
43
|
+
* pending. This says the model owes work independently of tools running. */ export declare let modelReady: (entries: Bundle[]) => boolean;
|
|
44
|
+
/** A transcript the runner answers: one that asked it, by a request or a turn
|
|
45
|
+
* it took. A turn read from a harness's file (`lines`) is that harness's, which
|
|
46
|
+
* answers its own transcript. */ export declare let served: (entries: Bundle[]) => boolean;
|
|
47
|
+
/** The transcripts a runner is working on: the ones the session cap counts
|
|
48
|
+
* and a restart wakes. That is a transcript the runner answers ({@link served})
|
|
49
|
+
* with something outstanding. An empty session has nothing to run, and one run
|
|
50
|
+
* outside the graph reads `running` while its own runner owes the answer; a
|
|
51
|
+
* graph holds thousands of both (every session a harness's hooks recorded).
|
|
52
|
+
* Unlike `served`, a model chosen by a notice counts as asking. */ export declare let live: Built;
|
|
53
|
+
/** What the entries leave owing. `session.ended` turns only these into `stopped`:
|
|
54
|
+
* a transcript that settled, failed or never began keeps reading that way. */ export declare let UNFINISHED: readonly [string, string, string];
|
|
55
|
+
/** What a session's own row says beside its entries: `ended`, its
|
|
56
|
+
* `session.ended` mark, and `process`, a process of its own running it (a
|
|
57
|
+
* @yaks/process `process` with no `exit` yet, as a spawned CLI run wears). */ export type Marks = {
|
|
58
|
+
ended?: boolean;
|
|
59
|
+
process?: boolean;
|
|
60
|
+
};
|
|
61
|
+
/** The {@link Marks} a session row wears. */ export declare let marksOf: (row: Bundle | undefined) => Marks;
|
|
62
|
+
/** The status of a transcript, from its entries in any order and the marks
|
|
63
|
+
* its row wears. A process of its own owes whatever the entries leave owing,
|
|
64
|
+
* so it reads `running` where they say `pending`, never the runner's to
|
|
65
|
+
* answer; once it exits, its ending (@yaks/spawn) is an entry like any. */ export declare let statusOf: (entries: Bundle[], _dts_1: never) => TranscriptStatus;
|
|
66
|
+
/** `session.status` for an in-memory store (@yaks/ram's `computed`): the rule
|
|
67
|
+
* above over the session's entries, as @yaks/sqlite derives it (./status.ts),
|
|
68
|
+
* so a query filtering on it answers alike in both. */ export declare let statusComputed: Computed;
|
|
69
|
+
/** What a transcript's lines selected to send, apart from what its asks
|
|
70
|
+
* recorded as sent: the `sending` of its newest line that is no ask. */ export declare let sendingSelected: (entries: Bundle[]) => Comp | undefined;
|
|
71
|
+
/** The model selection in force at an entry: provider, model and effort. Why
|
|
72
|
+
* a router chose it (`using.why`) stays on the input it answered, so no ask,
|
|
73
|
+
* later input or child repeats a reason the plans have since outgrown. */ export declare let usingBefore: (entries: Bundle[], seq: number) => Comp | undefined;
|
|
74
|
+
/** What is sent, selected independently of who answers. */ export declare let sendingBefore: (entries: Bundle[], seq: number) => Comp | undefined;
|
|
75
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sources":["../state.ts"],"names":[],"mappings":"AAEA,SAAS,KAAK,KAAK,2BAAsC;AACzD,cAAc,MAAM,EAAE,IAAI,2BAAgC;AAC1D,cAAc,QAAQ,2BAAgC;AAetD,4DAA4D,GAC5D,OAAO,YAAI,eACT,KAAK,WACJ,gBAAgB,aAAa,YAKf;AAEjB;;;iCAGiC,GACjC,YAAY,OACR,UACA,cACA,QACA,SACA,WACA,WACA,SACA,YACA,gBACA;AAEJ,gCAAgC,GAChC,YAAY,mBACR,UACA,YACA,YACA,YACA,YACA;AAEJ;wBACwB,GACxB,OAAO,YAAI,gBAAW;AAEtB;;0EAE0E,GAC1E,OAAO,YAAI,cAAe;AAgB1B;mEACmE,GACnE,OAAO,YAAI,cAAa,MAAM,GAA2B;AAEzD;;kDAEkD,GAClD,OAAO,YAAI,aAAc,MAAM,SAAO,MAAM,GAC2B;AAIvE,kEAAkE,GAClE,OAAO,YAAI,WAAY,GAAG,WAAS,MAAM,GAAG,SAAS,CAGpD;AAED;qCACqC,GACrC,OAAO,YAAI,SAAU,GAAG,WAAS,OAAO,SAAS,CAEc;AAE/D,gCAAgC,GAChC,OAAO,YAAI,QAAS,GAAG,WAAS,MAAM,CAAuC;AAE7E,2DAA2D,GAC3D,OAAO,YAAI,SAAU,GAAG,WAAS,MAAM,CAAkC;AAEzE,iCAAiC,GACjC,OAAO,YAAI,UAAW,SAAS,aAAW,SACO;AAEjD,+DAA+D,GAC/D,OAAO,YAAI,YAAa,SAAS,aAAW,SAAS,SAAS,CACR;AAatD;;qDAEqD,GACrD,OAAO,YAAI,gBACT,SAAS,UACT,SAAS,MAAM,EACf,MAAK,MAAM,KACV,OAAO,SAAS,CAGJ;AAEf;;+DAE+D,GAC/D,OAAO,YAAI,OACT,SAAS,UACT,SAAS,MAAM,EACf,MAAK,MAAM,KACV,OAAO,CAAiD;AAI3D,OAAO,YAAI,YACT,SAAS,UACT,SAAS,MAAM,EACf,MAAK,MAAM,KACV,OAAO,CAAwC;AAoBlD;6EAC6E,GAC7E,OAAO,YAAI,YAAa,SAAS,aAAW,SACjB;AAE3B;;;;;;;0EAO0E,GAC1E,OAAO,YAAI,aAAc,SAAS,aAAW,OAAO,CA0BnD;AAUD;;+BAE+B,GAC/B,OAAO,YAAI,SAAU,SAAS,aAAW,OAAO,CACkB;AAElE;;;;;iEAKiE,GACjE,OAAO,YAAI,MAAM,MAC2D;AAE5E;4EAC4E,GAC5E,OAAO,YAAI,8CAA6C;AAExD;;4EAE4E,GAC5E,YAAY;EAAU,QAAQ,OAAO;EAAE,UAAU,OAAO;;AAExD,2CAA2C,GAC3C,OAAO,YAAI,UAAW,KAAK,SAAS,SAAS,KAAG,MAG9C;AAEF;;;yEAGyE,GACzE,OAAO,YAAI,WACT,SAAS,UACT,kBACC,iBAIF;AAoFD;;qDAEqD,GACrD,OAAO,YAAI,gBAAgB,SAQ1B;AAqBD;sEACsE,GACtE,OAAO,YAAI,kBAAmB,SAAS,aAAW,OAAO,SAAS,CAGnD;AAEf;;wEAEwE,GACxE,OAAO,YAAI,cACT,SAAS,UACT,gBACC,OAAO,SAAS,CAKlB;AAED,yDAAyD,GACzD,OAAO,YAAI,gBACT,SAAS,UACT,gBACC,OAAO,SAAS,CAAyC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Expr, type Select } from "@yaks/sql/core";
|
|
2
|
+
import type { Derived } from "@yaks/sql/core";
|
|
3
|
+
import type { Vocab } from "@yaks/vocab";
|
|
4
|
+
export * from "./state.js";
|
|
5
|
+
export declare let dispatchStatus: {
|
|
6
|
+
readonly stable: boolean;
|
|
7
|
+
readonly tag: 'text';
|
|
8
|
+
readonly values: readonly [string, string, string, string];
|
|
9
|
+
readonly deps: readonly [string, string, string];
|
|
10
|
+
readonly expr: (owner: Expr, marks: [string, string]) => Expr;
|
|
11
|
+
};
|
|
12
|
+
/** What the rule asks of a store's words: whether one is declared, and how
|
|
13
|
+
* an archetype's stored descriptor, `tables`, says it holds one (@yaks/sql
|
|
14
|
+
* `descriptorHolds`). */ export type Words = {
|
|
15
|
+
declared: (name: string) => boolean;
|
|
16
|
+
holds: (tables: Expr, comp: string) => Expr;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The same rule as SQL, for @yaks/sqlite's derived-property registry
|
|
20
|
+
* (`storage(driver, vocab, { derived: sessionDerived(vocab) })`), so
|
|
21
|
+
* `.session.status=running` compiles through the index. `owner` is the SQL
|
|
22
|
+
* naming the session's integer id; a reference column stores the referent's
|
|
23
|
+
* integer id, which is what `entry.session` is compared against.
|
|
24
|
+
*/ export declare let sessionStatus: {
|
|
25
|
+
readonly tag: 'text';
|
|
26
|
+
readonly values: readonly [string, string, string, string, string, string, string];
|
|
27
|
+
readonly deps: readonly [string];
|
|
28
|
+
readonly few: readonly [string, string, string];
|
|
29
|
+
readonly select: (values: Expr[], words?: Words, text?: (stored: Expr) => Expr, one?: Expr) => Select | undefined;
|
|
30
|
+
readonly expr: (owner: Expr, words?: Words, text?: (stored: Expr) => Expr, terminal?: boolean) => Expr;
|
|
31
|
+
};
|
|
32
|
+
/** The derived-property registry a SQLite store loads to read
|
|
33
|
+
* `session.status`, compatible `dispatch.status`, and `session.cost` (./cost.ts)
|
|
34
|
+
* where the vocabulary declares the `cost.dollars` it sums: a store may hold an app's own `cost`
|
|
35
|
+
* in place of @yaks/model's. The configured `reading` registry resolves content
|
|
36
|
+
* before interpreting historical controls; without an override, content is
|
|
37
|
+
* text in its component. */ export declare let sessionDerived: (vocab: Vocab, reading?: Derived) => Derived;
|
|
38
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sources":["../status.ts"],"names":[],"mappings":"AAqCA,SAWE,KAAK,IAAI,EAiBT,KAAK,MAAM,8BAQqB;AAMlC,cAAc,OAAO,8BAAiD;AACtE,cAAc,KAAK,2BAAgC;AAEnD,2BAA0B;AAM1B,OAAO,YAAI;WACT;WACA,KAAK;WACL;WACA;WACA,OAAO,OAAO,MAAM,4BAAkC;EAkBvD;AAyBD;;uBAEuB,GACvB,YAAY;EACV,WAAW,MAAM,MAAM,KAAK,OAAO;EACnC,QAAQ,QAAQ,MAAM,MAAM,MAAM,KAAK;;AAQzC;;;;;;CAMC,GACD,OAAO,YAAI;WACT,KAAK;WACL;WASA;WAGA;WACA,SACE,QAAQ,QAER,QAAO,OACP,QAAO,QAAQ,SAAS,MACxB,MAAM,SACL,SAAS,SAAS;WA6ZrB,OACE,OAAO,MAEP,QAAO,OACP,QAAO,QAAQ,SAAS,MACxB,uBACC;EA+1BJ;AAED;;;;;0BAK0B,GAC1B,OAAO,YAAI,iBAAkB,OAAO,OAAO,UAAS,YAAe,QAuFlE"}
|
package/_dist/tail.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { Bundle, Comp, Eid, Graph } from "@yaks/graph";
|
|
2
|
+
import type { Reader } from "./readers.js";
|
|
3
|
+
import type { Chunks } from "./archive.js";
|
|
4
|
+
import { type Walk } from "./parts.js";
|
|
5
|
+
import { type Open } from "./imported.js";
|
|
6
|
+
export { askOf, callOf, imported, pieced, prose } from "./imported.js";
|
|
7
|
+
/** A log being read, and the session it is read into. */ export type Tail = {
|
|
8
|
+
/** the file */ path: string;
|
|
9
|
+
/** an immutable source read in bounded asynchronous chunks */ stream?: Chunks;
|
|
10
|
+
version?: string;
|
|
11
|
+
skip?: number;
|
|
12
|
+
/** the session; a transcript file can name one the graph has not met yet,
|
|
13
|
+
* and it is created with the first line that says something, or once the
|
|
14
|
+
* lines read say nothing */ session?: Eid;
|
|
15
|
+
/** the harness's own id for the session, which a created one carries */ id?: string;
|
|
16
|
+
/** the file, as the bundle that makes it one; its entity keeps how far it
|
|
17
|
+
* has been read */ file: Bundle;
|
|
18
|
+
/** whether this is the file the session was first read from, whose entries
|
|
19
|
+
* are named by session and line alone */ own: boolean;
|
|
20
|
+
/** whether the file's transcript is written yet: its first write says whose
|
|
21
|
+
* transcript it is */ known: boolean;
|
|
22
|
+
/** whether a person drives it; false preserves an automatic opening */ operator?: boolean;
|
|
23
|
+
/** the operator mark already stored on the session */ operatorStored?: boolean;
|
|
24
|
+
/** the lines read so far */ line: number;
|
|
25
|
+
/** the line the file's `consumed` stands at */ marked: number;
|
|
26
|
+
/** the byte the next read starts at */ at: number;
|
|
27
|
+
/** when the newest line that says so was written */ time?: string;
|
|
28
|
+
/** the model the newest line that says so named as answering */ model?: string;
|
|
29
|
+
rest: string;
|
|
30
|
+
dec: TextDecoder;
|
|
31
|
+
/** what the requests read so far carried (./parts.ts), followed from the
|
|
32
|
+
* log's first line */ walk?: Walk;
|
|
33
|
+
/** a resumed walk, followed in slices before any new entries are read */ replay?: {
|
|
34
|
+
line: number;
|
|
35
|
+
lines: AsyncGenerator<string>;
|
|
36
|
+
part?: Open;
|
|
37
|
+
};
|
|
38
|
+
/** the run of parts read so far and not yet ended (./readers.ts
|
|
39
|
+
* `Said.part`), which no `consumed` passes */ part?: Open;
|
|
40
|
+
};
|
|
41
|
+
/** How a line is read in. */ export type Pull = {
|
|
42
|
+
/** who a prompt typed into this transcript is signed by */ person?: Eid;
|
|
43
|
+
/** whether the line is of the session's first file; an entry of any other
|
|
44
|
+
* file names its path in its eid too (default true) */ own?: boolean;
|
|
45
|
+
/** keep only the prose: what was typed and what the model said */ prose?: boolean;
|
|
46
|
+
/** flush a last line the harness never ended with a newline */ final?: boolean;
|
|
47
|
+
/** where a line the graph refuses is reported (default the console) */ report?: (err: unknown) => void;
|
|
48
|
+
/** stop between lines once this aborts: what is left stays with the tail,
|
|
49
|
+
* for the next pull, and the session's `consumed` says where the read
|
|
50
|
+
* stood */ signal?: AbortSignal;
|
|
51
|
+
/** stop between lines past this moment (`performance.now()`), the way an
|
|
52
|
+
* abort stops it, once a line is read: a long log is read over several
|
|
53
|
+
* pulls */ until?: number;
|
|
54
|
+
};
|
|
55
|
+
/** Whether a tail is behind its file: a pull stopped before its end, and
|
|
56
|
+
* holds lines it has not read into the graph yet. */ export declare let behind: (t: Tail) => boolean;
|
|
57
|
+
/** How far the file at `path` has been read, and into which session: its
|
|
58
|
+
* `transcript`, if it has one. */ export declare let transcriptOf: (g: Graph, path: string) => Promise<Comp | undefined>;
|
|
59
|
+
/**
|
|
60
|
+
* A tail on `path`, placed after the lines its transcript says were read.
|
|
61
|
+
*
|
|
62
|
+
* ```ts
|
|
63
|
+
* import { tail } from '@yaks/session/tail'
|
|
64
|
+
*
|
|
65
|
+
* // let t = await tail(graph, '/logs/run.out', { session })
|
|
66
|
+
* ```
|
|
67
|
+
*/ export declare let tail: (g: Graph, path: string, o?: {
|
|
68
|
+
session?: Eid;
|
|
69
|
+
id?: string;
|
|
70
|
+
stream?: Chunks;
|
|
71
|
+
prefix?: string;
|
|
72
|
+
version?: string;
|
|
73
|
+
}) => Promise<Tail>;
|
|
74
|
+
/**
|
|
75
|
+
* Read what the log holds past the tail into its session, a run of lines to a
|
|
76
|
+
* transaction, each entity dated when the harness wrote the line that wrote it
|
|
77
|
+
* where the line says. A line the reader does not recognize, or one that is not
|
|
78
|
+
* JSON at all, becomes nothing: the file keeps it. Answers how many lines were
|
|
79
|
+
* read.
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* import { claude } from '@yaks/session'
|
|
83
|
+
* import { pull, tail } from '@yaks/session/tail'
|
|
84
|
+
*
|
|
85
|
+
* // let t = await tail(graph, path, { id })
|
|
86
|
+
* // await pull(graph, t, claude, { person })
|
|
87
|
+
* ```
|
|
88
|
+
*/ export declare let pull: (g: Graph, t: Tail, read: Reader, o?: Pull) => Promise<number>;
|
|
89
|
+
/**
|
|
90
|
+
* Mark a tail's file read to the line the tail stands at, so a resume starts
|
|
91
|
+
* after it and a quiet file reads as imported to its end: what lines that made
|
|
92
|
+
* no entry leave unwritten while the file is still being written (`pull`).
|
|
93
|
+
*
|
|
94
|
+
* ```ts
|
|
95
|
+
* import { rest } from '@yaks/session/tail'
|
|
96
|
+
*
|
|
97
|
+
* // await rest(graph, t) // once its file has gone quiet
|
|
98
|
+
* ```
|
|
99
|
+
*/ export declare let rest: (g: Graph, t: Tail) => Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Read a log already imported again from its start, for its model requests
|
|
102
|
+
* alone: each request's entry (`ask`, `usage`, `context_parts`) where the
|
|
103
|
+
* session lacks it, the session's `fixed`, and plan limits, each dated when
|
|
104
|
+
* the line was written. What an earlier reading counted elsewhere (on the
|
|
105
|
+
* line's other entries, or as the whole run's usage on its ending) comes off,
|
|
106
|
+
* so each request is counted once. The log can be a copy of the session's
|
|
107
|
+
* own, such as the transcript a provider keeps of a managed run. The
|
|
108
|
+
* transcript's other entries are followed, never written. A run of lines is
|
|
109
|
+
* read and written at once. Answers how many requests it wrote.
|
|
110
|
+
*
|
|
111
|
+
* ```ts
|
|
112
|
+
* import { claude } from '@yaks/session'
|
|
113
|
+
* import { recount } from '@yaks/session/tail'
|
|
114
|
+
*
|
|
115
|
+
* // await recount(graph, path, claude, { session })
|
|
116
|
+
* ```
|
|
117
|
+
*/ export declare let recount: (g: Graph, path: string, read: Reader, o: {
|
|
118
|
+
session: Eid;
|
|
119
|
+
signal?: AbortSignal;
|
|
120
|
+
}) => Promise<number>;
|
|
121
|
+
//# sourceMappingURL=tail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tail.d.ts","sources":["../tail.ts"],"names":[],"mappings":"AAyCA,cAAc,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,2BAAgC;AAOtE,cAAc,MAAM,uBAA4B;AAEhD,cAAc,MAAM,uBAAsB;AAC1C,SAAoB,KAAK,IAAI,qBAA4B;AACzD,SAGE,KAAK,IAAI,wBAIW;AAEtB,SAAS,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,wBAAuB;AAEtE,uDAAuD,GACvD,YAAY;EACV,aAAa,GACb,MAAM,MAAM;EACZ,4DAA4D,GAC5D,SAAS;EACT,UAAU,MAAM;EAChB,OAAO,MAAM;EACb;;4BAE0B,GAC1B,UAAU;EACV,sEAAsE,GACtE,KAAK,MAAM;EACX;mBACiB,GACjB,MAAM;EACN;yCACuC,GACvC,KAAK,OAAO;EACZ;sBACoB,GACpB,OAAO,OAAO;EACd,qEAAqE,GACrE,WAAW,OAAO;EAClB,oDAAoD,GACpD,iBAAiB,OAAO;EACxB,0BAA0B,GAC1B,MAAM,MAAM;EACZ,6CAA6C,GAC7C,QAAQ,MAAM;EACd,qCAAqC,GACrC,IAAI,MAAM;EACV,kDAAkD,GAClD,OAAO,MAAM;EACb,8DAA8D,GAC9D,QAAQ,MAAM;EACd,MAAM,MAAM;EACZ,KAAK;EACL;sBACoB,GACpB,OAAO;EACP,uEAAuE,GACvE;IAAW,MAAM,MAAM;IAAE,OAAO,eAAe,MAAM;IAAG,OAAO;;EAC/D;8CAC4C,GAC5C,OAAO;;AAGT,2BAA2B,GAC3B,YAAY;EACV,yDAAyD,GACzD,SAAS;EACT;uDACqD,GACrD,MAAM,OAAO;EACb,gEAAgE,GAChE,QAAQ,OAAO;EACf,6DAA6D,GAC7D,QAAQ,OAAO;EACf,qEAAqE,GACrE,UAAU,KAAK,OAAO,KAAK,IAAI;EAC/B;;WAES,GACT,SAAS;EACT;;WAES,GACT,QAAQ,MAAM;;AAGhB;mDACmD,GACnD,OAAO,YAAI,SAAU,GAAG,SAAO,OAAO,CAAyB;AA4F/D;gCACgC,GAChC,OAAO,YAAI,eACT,GAAG,OACH,MAAM,MAAM,KACX,QAAQ,OAAO,SAAS,EAI1B;AAkDD;;;;;;;;CAQC,GACD,OAAO,YAAI,OACT,GAAG,OACH,MAAM,MAAM,EACZ;EACE,UAAU;EACV,KAAK,MAAM;EACX,SAAS;EACT,SAAS,MAAM;EACf,UAAU,MAAM;MAEjB,QAAQ,MAsDV;AAoHD;;;;;;;;;;;;;;CAcC,GACD,OAAO,YAAI,OACT,GAAG,OACH,GAAG,MACH,MAAM,QACN,IAAG,SACF,QAAQ,MAAM,EAuHhB;AAED;;;;;;;;;;CAUC,GACD,OAAO,YAAI,OAAc,GAAG,OAAO,GAAG,SAAO,QAAQ,IAAI,EASxD;AAkDD;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,YAAI,UACT,GAAG,OACH,MAAM,MAAM,EACZ,MAAM,QACN;EAAK,SAAS;EAAK,SAAS;MAC3B,QAAQ,MAAM,EAmFhB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Human-readable wall-clock duration, retaining sub-second precision. */ export declare let duration: (ms: number) => string;
|
|
2
|
+
/** Timing is appended after bounded output, never inside a truncation window. */ export declare let took: (text: string, ms: number) => string;
|
|
3
|
+
type TimingRow = {
|
|
4
|
+
eid: string;
|
|
5
|
+
comps: Record<string, Record<string, unknown> | undefined>;
|
|
6
|
+
};
|
|
7
|
+
/** Sum of measured tool waits (parallel calls add, not session age). Older
|
|
8
|
+
* unmeasured results are omitted rather than invented from queue timestamps. */ export declare let toolTiming: (rows: TimingRow[]) => string;
|
|
9
|
+
//# sourceMappingURL=timing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.d.ts","sources":["../timing.ts"],"names":[],"mappings":"AAAA,wEAAwE,GACxE,OAAO,YAAI,WAAY,IAAI,MAAM,KAAG,MAAM,CAOzC;AAED,+EAA+E,GAC/E,OAAO,YAAI,OAAQ,MAAM,MAAM,EAAE,IAAI,MAAM,KAAG,MAAM,CAEU;KAEzD;EACH,KAAK,MAAM;EACX,OAAO,OAAO,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,IAAI,SAAS;;AAG3D;8EAC8E,GAC9E,OAAO,YAAI,aAAc,MAAM,gBAAc,MAAM,CA6BlD"}
|
package/_dist/told.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Bundle, Comp, Graph } from "@yaks/graph";
|
|
2
|
+
/** The `told` row holding `instructions`, named by their sha256.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { assertEquals } from '@std/assert'
|
|
6
|
+
* import { sha256 } from '@yaks/graph/sha256'
|
|
7
|
+
* assertEquals(toldRow('Be brief.'), {
|
|
8
|
+
* entity: { eid: sha256('Be brief.') },
|
|
9
|
+
* told: { instructions: 'Be brief.' },
|
|
10
|
+
* })
|
|
11
|
+
* ```
|
|
12
|
+
*/ export declare let toldRow: (instructions: string) => Bundle;
|
|
13
|
+
/** The instructions a `sending` says: the text an input selected, or the
|
|
14
|
+
* text of the `told` row an ask names. Undefined where it says none. */ export declare let instructionsOf: (g: Pick<Graph, 'get'>, sending: Comp | undefined) => Promise<string | undefined>;
|
|
15
|
+
/** The texts of the `told` rows named, by their eid; a name with no row is
|
|
16
|
+
* left out. */ export declare let toldOf: (g: Pick<Graph, 'get'>, names: Iterable<string>) => Promise<Map<string, string>>;
|
|
17
|
+
//# sourceMappingURL=told.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told.d.ts","sources":["../told.ts"],"names":[],"mappings":"AASA,cAAc,MAAM,EAAE,IAAI,EAAE,KAAK,2BAAgC;AAGjE;;;;;;;;;;CAUC,GACD,OAAO,YAAI,UAAW,cAAc,MAAM,KAAG,OAG3C;AAEF;sEACsE,GACtE,OAAO,YAAI,iBACT,GAAG,KAAK,OAAO,QACf,SAAS,OAAO,SAAS,KACxB,QAAQ,MAAM,GAAG,SAAS,EAK5B;AAED;aACa,GACb,OAAO,YAAI,SACT,GAAG,KAAK,OAAO,QACf,OAAO,SAAS,MAAM,MACrB,QAAQ,IAAI,MAAM,EAAE,MAAM,GAQ5B"}
|
package/_dist/tools.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Bundle, Graph } from "@yaks/graph";
|
|
2
|
+
import type { Runs } from "@yaks/graph/tools";
|
|
3
|
+
import type { Vocab } from "@yaks/vocab";
|
|
4
|
+
import type { Options as Reading } from "./service.js";
|
|
5
|
+
/** What a config file can set for this package: the checks' patience, and how
|
|
6
|
+
* the duty reads transcripts (./service.ts). */ export type Options = Reading & {
|
|
7
|
+
/** how long a transcript may be waiting on a turn or an answer before that
|
|
8
|
+
* counts as a stall rather than work in progress (default 2 hours) */ hours?: number;
|
|
9
|
+
};
|
|
10
|
+
/** What a hook payload says, where the command line did not: the session's
|
|
11
|
+
* own id, the directory it started in, and the subagent the event is about,
|
|
12
|
+
* when it is about one (Claude Code's `agent_id`). A payload that will not
|
|
13
|
+
* parse says nothing, and does so quietly. */ export declare let hooked: (hook: unknown) => {
|
|
14
|
+
session: string;
|
|
15
|
+
cwd: string;
|
|
16
|
+
agent: string;
|
|
17
|
+
};
|
|
18
|
+
/** What an operator session is told so its owner's mail and knocks wake it. */ export declare let wakes: (id: string) => string;
|
|
19
|
+
/** One entity as a person reads it: its id, its title where it has one, and
|
|
20
|
+
* the answer where it is a decided question (@yaks/kernel `decided.choice`,
|
|
21
|
+
* the chosen label or the words of a custom answer). */ export declare let line: (vocab: Vocab, b: Bundle) => string;
|
|
22
|
+
/**
|
|
23
|
+
* The saved queries a session is told the rows of, each as its title and its
|
|
24
|
+
* rows: those its persona contains (@yaks/persona `queries`) and, for an
|
|
25
|
+
* operator, those of the persona its project's operator wears
|
|
26
|
+
* (`helper{persona}`, ./routine.ts), since an operator session wears its
|
|
27
|
+
* checkout's common persona. Each query is run now, at delivery (M-4063), so
|
|
28
|
+
* a compaction summary that kept an id as open is answered by what is.
|
|
29
|
+
*/ export declare let asked: (graph: Graph, persona: string | undefined, operator: boolean) => Promise<[string, Bundle[]][]>;
|
|
30
|
+
/** The implementations behind the tools ./vocab.json declares. The calling
|
|
31
|
+
* application's vocabulary is what the checks name an entity with, and its
|
|
32
|
+
* options are what they judge a stall by. */ export declare let runs: (host: {
|
|
33
|
+
vocab: Vocab;
|
|
34
|
+
stopping?: AbortSignal;
|
|
35
|
+
config?: {
|
|
36
|
+
db?: string;
|
|
37
|
+
port?: number;
|
|
38
|
+
hostname?: string;
|
|
39
|
+
};
|
|
40
|
+
}, options?: Options) => Runs;
|
|
41
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sources":["../tools.ts"],"names":[],"mappings":"AAkDA,cAAc,MAAM,EAAQ,KAAK,2BAAgC;AAOjE,cAAc,IAAI,iCAAsC;AAMxD,cAAc,KAAK,2BAAgC;AAMnD,cAAc,WAAW,OAAO,uBAAsB;AAItD;8CAC8C,GAC9C,YAAY,UAAU;EACpB;sEACoE,GACpE,QAAQ,MAAM;;AAyBhB;;;4CAG4C,GAC5C,OAAO,YAAI,SACT,MAAM,OAAO;EACV,SAAS,MAAM;EAAE,KAAK,MAAM;EAAE,OAAO,MAAM;EAe/C;AAYD,6EAA6E,GAC7E,OAAO,YAAI,QAAS,IAAI,MAAM,KAAG,MAAM,CAKQ;AAE/C;;sDAEsD,GACtD,OAAO,YAAI,OAAQ,OAAO,OAAO,GAAG,WAAS,MAAM,CAMlD;AAmCD;;;;;;;CAOC,GACD,OAAO,YAAI,QACT,OAAO,OACP,SAAS,MAAM,GAAG,SAAS,EAC3B,UAAU,OAAO,KAChB,SAAS,MAAM,EAAE,aAwBnB;AAsCD;;2CAE2C,GAC3C,OAAO,YAAI,OACT;EACE,OAAO;EACP,WAAW;EACX;IAAW,KAAK,MAAM;IAAE,OAAO,MAAM;IAAE,WAAW,MAAM;;GAE1D,UAAS,YACR,KAwWD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Bundle, Eid, Graph } from "@yaks/graph";
|
|
2
|
+
/** A transcript's entries: a fork's prefix from its parent up to the anchor,
|
|
3
|
+
* then its own, in order. With `since`, read entries created at or after that
|
|
4
|
+
* instant. */ export declare let transcript: (g: Graph, session: Eid, since?: string) => Promise<Bundle[]>;
|
|
5
|
+
//# sourceMappingURL=transcript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.d.ts","sources":["../transcript.ts"],"names":[],"mappings":"AAGA,cAAc,MAAM,EAAQ,GAAG,EAAE,KAAK,2BAAgC;AAOtE;;YAEY,GACZ,OAAO,YAAI,aACT,GAAG,OACH,SAAS,KACT,QAAQ,MAAM,KACb,QAAQ,UAuBV"}
|
package/_dist/turn.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a turn is the listener's: the conversation logic every channel
|
|
3
|
+
* shares, a group text, a chat room or a call alike (D-465). A channel says
|
|
4
|
+
* only whether words were said where others hear them (`group`) and whether
|
|
5
|
+
* they were said to the listener (`to`: naming it, replying to it, or to it
|
|
6
|
+
* alone). The listener reads everything it hears; in a group it answers only
|
|
7
|
+
* when the words are for it and their speaker is done, and otherwise answers
|
|
8
|
+
* {@link PASS}, which says nothing anywhere. A pause is not a turn.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/ /** What the listener answers to stay quiet: a turn answered with it alone is
|
|
12
|
+
* kept in its transcript and sent nowhere ({@link passes}). */ export declare let PASS: string;
|
|
13
|
+
/** Whether an answer is {@link PASS}, which no channel sends.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { equal } from '@yaks/testing'
|
|
17
|
+
* import { passes } from '@yaks/session/turn'
|
|
18
|
+
* equal(passes(' (listening)\n'), true)
|
|
19
|
+
* equal(passes('Sure, (listening) to you.'), false)
|
|
20
|
+
* ```
|
|
21
|
+
*/ export declare let passes: (text: string) => boolean;
|
|
22
|
+
/** Whether `text` names the listener by one of `names`, as words of their
|
|
23
|
+
* own, in any case: how a channel without mentions (a group text) knows the
|
|
24
|
+
* words were said to it.
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { equal } from '@yaks/testing'
|
|
28
|
+
* import { named } from '@yaks/session/turn'
|
|
29
|
+
* equal(named('Hey Mabel, what time is it?', ['Mabel', 'operator']), true)
|
|
30
|
+
* equal(named('ask the operator', ['Mabel', 'operator']), true)
|
|
31
|
+
* equal(named('Mabelle said so', ['Mabel']), false)
|
|
32
|
+
* ```
|
|
33
|
+
*/ export declare let named: (text: string, names: string[]) => boolean;
|
|
34
|
+
/** What the listener is told before words, about whose turn it is: nothing
|
|
35
|
+
* where they were said to it alone; in a group, that everyone in it reads the
|
|
36
|
+
* answer, whether the words were said to it, and when to answer {@link PASS}.
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { equal } from '@yaks/testing'
|
|
40
|
+
* import { cue } from '@yaks/session/turn'
|
|
41
|
+
* equal(cue({ group: false, to: true }), '')
|
|
42
|
+
* equal(cue({ group: true, to: false }).includes('not said to you'), true)
|
|
43
|
+
* equal(cue({ group: true, to: true }).includes('not said to you'), false)
|
|
44
|
+
* ```
|
|
45
|
+
*/ export declare let cue: (said: {
|
|
46
|
+
group: boolean;
|
|
47
|
+
to: boolean;
|
|
48
|
+
}) => string;
|
|
49
|
+
//# sourceMappingURL=turn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn.d.ts","sources":["../turn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;CAUC,GAED;6DAC6D,GAC7D,OAAO,YAAI,aAAoB;AAE/B;;;;;;;;CAQC,GACD,OAAO,YAAI,SAAU,MAAM,MAAM,KAAG,OAAO,CAAuB;AAElE;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,QAAS,MAAM,MAAM,EAAE,OAAO,MAAM,OAAK,OAAO,CAOxD;AAIH;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,MAAO;EAAQ,OAAO,OAAO;EAAE,IAAI,OAAO;MAAK,MAAM,CAKxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unknown.d.ts","sources":["../unknown.ts"],"names":[],"mappings":"AAAA,cAAc,GAAG,2BAAgC;AAEjD,oEAAoE,GACpE,OAAO,cAAM,uBAAuB;EACf,SAAS;EAA5B,YAAY,AAAO,SAAS,GAAG;AAIjC"}
|
package/_dist/views.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { View } from "@yaks/inspect";
|
|
2
|
+
import type { Kind } from "./conversation.js";
|
|
3
|
+
import type { Registry } from "@yaks/render";
|
|
4
|
+
export { sessionViews as views } from "./lines.js";
|
|
5
|
+
export { type Joined, joined } from "./joined.js";
|
|
6
|
+
export declare let conversationKinds: () => Promise<Registry<Kind>>;
|
|
7
|
+
export declare let conversationViews: () => Promise<View[]>;
|
|
8
|
+
export declare let inspectViews: () => Promise<View[]>;
|
|
9
|
+
//# sourceMappingURL=views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.d.ts","sources":["../views.ts"],"names":[],"mappings":"AASA,cAAc,IAAI,6BAAkC;AACpD,cAAc,IAAI,4BAA2B;AAC7C,cAAc,QAAQ,4BAAiC;AAEvD,SAAS,gBAAgB,KAAK,qBAAoB;AAClD,SAAS,KAAK,MAAM,EAAE,MAAM,sBAAqB;AACjD,OAAO,YAAI,yBAAwB,QAAQ,SAAS,OACF;AAClD,OAAO,YAAI,yBAAwB,QAAQ,QACW;AACtD,OAAO,YAAI,oBAAmB,QAAQ,QACc"}
|