@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
package/watch.js
ADDED
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
// Who hears a task change. A task's watchers are the session that filed it,
|
|
2
|
+
// every session whose own words mention its id (what it said, or what it was
|
|
3
|
+
// told; a tool's result is what it read, not what it said), the writer of any
|
|
4
|
+
// task, comment or letter whose text mentions it, and each actor whose
|
|
5
|
+
// @yaks/notify `subscription` watches it; an actor muting it hears nothing.
|
|
6
|
+
// A person who commented on it watches it too: they spoke to that work.
|
|
7
|
+
// When the task is completed, cancelled or answered, or someone comments on
|
|
8
|
+
// it, `session_watch` knocks each of them once (./listen.ts says the knock).
|
|
9
|
+
//
|
|
10
|
+
// A knock goes to the watcher's session while it can hear, and once that
|
|
11
|
+
// session is over, to its project's operator: the session a person opened for
|
|
12
|
+
// that project (`session.operator`) that spoke last and is not over, else the
|
|
13
|
+
// project itself, held for whoever works for it next. A watcher that is a
|
|
14
|
+
// persona or a project is that project's from the start.
|
|
15
|
+
//
|
|
16
|
+
// A person hears through their assistant: the session standing here for the
|
|
17
|
+
// conversation they hold with it in another store (`session.person`,
|
|
18
|
+
// ./who.ts `standIn`), which whoever keeps that door passes on (@yaks/tunnel).
|
|
19
|
+
// Their comment carries no session, since a comment written through one is an
|
|
20
|
+
// agent's, so the watcher is the person and the session is found from them. A
|
|
21
|
+
// person with no such conversation is knocked nowhere, and nobody is told of
|
|
22
|
+
// their own act. A task assigned to a person knocks that same session, and
|
|
23
|
+
// nobody else: an assignment is news to the one it names.
|
|
24
|
+
//
|
|
25
|
+
// A person's assistant hears news, not traffic: work they spoke to finishing
|
|
26
|
+
// (completed, cancelled or answered), work newly assigned to them, and a
|
|
27
|
+
// comment that answers one of their own (`comment.reply_to`). Any other
|
|
28
|
+
// comment knocks no session standing for a person, however it watches.
|
|
29
|
+
//
|
|
30
|
+
// Each change knocks a target once, named for the target and the change, so
|
|
31
|
+
// two watchers routed to one session make one knock and a run that is tried
|
|
32
|
+
// again knocks nobody twice. A person's comment already reaches the session
|
|
33
|
+
// that filed the task and the one holding it (./listen.ts), so those two are
|
|
34
|
+
// not knocked for it.
|
|
35
|
+
//
|
|
36
|
+
// Nobody is knocked about their own write, and a session's subagents write
|
|
37
|
+
// for it: a subagent runs inside its parent's process and hands what it did
|
|
38
|
+
// back as the result of the parent's own call, so a knock about its comment
|
|
39
|
+
// would tell the parent what it just read (`writers`). A helper writes in its
|
|
40
|
+
// operator's place (./help.ts), so its operator, and the project it helps, are
|
|
41
|
+
// not knocked about what it wrote: that knock would be routine and start the
|
|
42
|
+
// next helper on the same work (`standing`).
|
|
43
|
+
//
|
|
44
|
+
// A mark that names nobody who made it, no `by` and no `via`, records an act in
|
|
45
|
+
// another store at that store's time, as @yaks/heal closes a bug's task when
|
|
46
|
+
// the tracker resolves or archives the bug. That store tells of the act, so the
|
|
47
|
+
// mark knocks nobody.
|
|
48
|
+
//
|
|
49
|
+
// One event is one knock. A managed run that ends leaves its whole report as
|
|
50
|
+
// a comment on its task that knocks whoever started it (`reported`, which
|
|
51
|
+
// @yaks/spawn's completion writes by). That receipt is the knock for
|
|
52
|
+
// the run's work on the task: the session it knocks is not knocked for the
|
|
53
|
+
// comment a second time, and nobody it reaches, that session or a watcher
|
|
54
|
+
// knocked about the comment, is knocked a little earlier for the run marking
|
|
55
|
+
// the task completed or cancelled. Each would be a second helper's batch for
|
|
56
|
+
// one report (./help.ts). Only a person's assistant, which hears no such
|
|
57
|
+
// comment, hears of the mark.
|
|
58
|
+
import { line, sub } from "@yaks/query";
|
|
59
|
+
import { addressed, argsOf } from "@yaks/graph/call";
|
|
60
|
+
import { Refused } from "@yaks/graph/errors";
|
|
61
|
+
import { derivedEid } from "@yaks/graph/identity";
|
|
62
|
+
import { HUMAN, human, mentions } from "@yaks/id";
|
|
63
|
+
import { CLAIM, SESSION } from "./comp.js";
|
|
64
|
+
import { ended, projects, taken } from "./listen.js";
|
|
65
|
+
import { HELPING } from "./routine.js";
|
|
66
|
+
let comp = (b, name)=>b?.[name] ?? {};
|
|
67
|
+
let str = (v)=>typeof v == 'string' ? v : '';
|
|
68
|
+
let fold = (text, max = 200)=>{
|
|
69
|
+
let line = text.replace(/\s+/g, ' ').trim();
|
|
70
|
+
return line.length > max ? `${line.slice(0, max - 1)}…` : line;
|
|
71
|
+
};
|
|
72
|
+
/** The sessions and actors that mention the task `id` names: the sessions
|
|
73
|
+
* whose own entries do, and the writer of each other entity whose `doc.body`
|
|
74
|
+
* does, by the session it came through or else the actor. An entry keeps the
|
|
75
|
+
* id as it was typed; a body stores the task's eid (@yaks/graph `prose`), or
|
|
76
|
+
* the id where it was written before, and a search for the id finds both. */ let mentioners = async (g, task, id)=>{
|
|
77
|
+
// A human id, a prefix and a number: a bare hash is not how anyone
|
|
78
|
+
// mentions a task.
|
|
79
|
+
if (!HUMAN.test(id)) return [];
|
|
80
|
+
let said = g.vocab.prop('content', 'body') && g.vocab.comp('entry') ? await g.read(line`.content.body~=${id}&.entry&!result&!notice&.fields=entry.session,content.body&.limit=500`) : [];
|
|
81
|
+
let written = g.vocab.prop('doc', 'body') ? await g.read(line`${id}&.doc&.fields=created.by,created.via,doc.body&.limit=200`) : [];
|
|
82
|
+
return [
|
|
83
|
+
...said.filter((b)=>mentions(str(comp(b, 'content').body), id)).map((b)=>str(comp(b, 'entry').session)),
|
|
84
|
+
...written.filter((b)=>{
|
|
85
|
+
let body = str(comp(b, 'doc').body);
|
|
86
|
+
return b.entity.eid != task && (mentions(body, task) || mentions(body, id));
|
|
87
|
+
}).map((b)=>str(comp(b, 'created').via) || str(comp(b, 'created').by))
|
|
88
|
+
].filter(Boolean);
|
|
89
|
+
};
|
|
90
|
+
/** The actors whose subscription to `task` is in `mode`. */ let subscribed = async (g, task, mode)=>g.vocab.prop('subscription', 'mode') ? (await g.read(line`.subscription.target=${task}&.subscription.mode=${mode}&.fields=subscription.actor`)).map((b)=>str(comp(b, 'subscription').actor)).filter(Boolean) : [];
|
|
91
|
+
// A person's own words: by a person and through no session, as
|
|
92
|
+
// `session_start` reads a person's comment.
|
|
93
|
+
let OWN = line`.created.by.person&!created.via.${SESSION}`;
|
|
94
|
+
/** The people who commented on `task` themselves. */ let spoke = async (g, task)=>g.vocab.comp('person') && g.vocab.comp('comment') ? (await g.read(line`.comment.target=${task}&${sub(OWN)}&.fields=created.by&.limit=500`)).map((b)=>str(comp(b, 'created').by)).filter(Boolean) : [];
|
|
95
|
+
/** The person whose own comment `row` answers, if it answers one. */ let answered = async (g, row)=>{
|
|
96
|
+
let to = str(comp(row, 'comment').reply_to);
|
|
97
|
+
if (!to || !g.vocab.comp('person')) return '';
|
|
98
|
+
let [own] = await g.read(line`.entity.eid=${to}&${sub(OWN)}&.fields=created.by`);
|
|
99
|
+
return str(comp(own, 'created').by);
|
|
100
|
+
};
|
|
101
|
+
/** The session standing here for the conversation `person` holds with their
|
|
102
|
+
* assistant in another store (./who.ts `standIn`): the newest one said to
|
|
103
|
+
* be theirs. */ export let standingFor = async (g, person)=>g.vocab.prop(SESSION, 'person') ? (await g.read(line`.${SESSION}.person=${person}&.${SESSION}.door&.order=-created.at&.limit=1&.fields=entity.eid`))[0]?.entity.eid : undefined;
|
|
104
|
+
/** Everyone watching `task`, as sessions or actors, and those muting it. */ export let watchers = async (g, task)=>{
|
|
105
|
+
let made = comp(task, 'created');
|
|
106
|
+
return {
|
|
107
|
+
watching: [
|
|
108
|
+
...new Set([
|
|
109
|
+
str(made.via) || str(made.by),
|
|
110
|
+
...await mentioners(g, task.entity.eid, human(g.vocab)(task)),
|
|
111
|
+
...await spoke(g, task.entity.eid),
|
|
112
|
+
...await subscribed(g, task.entity.eid, 'watch')
|
|
113
|
+
].filter(Boolean))
|
|
114
|
+
],
|
|
115
|
+
muting: new Set(await subscribed(g, task.entity.eid, 'mute'))
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
// The project a watcher answers to: a session's persona's home, a persona's
|
|
119
|
+
// home, or the project itself. None for anyone else.
|
|
120
|
+
let projectOf = (rows, eid)=>{
|
|
121
|
+
let b = rows.get(eid);
|
|
122
|
+
if (b?.project) return eid;
|
|
123
|
+
let persona = b?.[SESSION] ? str(comp(b, SESSION).persona) : eid;
|
|
124
|
+
return str(comp(rows.get(persona), 'persona').home);
|
|
125
|
+
};
|
|
126
|
+
// A project and every project it is filed under, nearest first.
|
|
127
|
+
let above = (tree, project)=>{
|
|
128
|
+
let found = [
|
|
129
|
+
project
|
|
130
|
+
];
|
|
131
|
+
for(let up = tree.get(project); up && !found.includes(up);){
|
|
132
|
+
found.push(up);
|
|
133
|
+
up = tree.get(up);
|
|
134
|
+
}
|
|
135
|
+
return found;
|
|
136
|
+
};
|
|
137
|
+
/** The operator of a project still able to hear: a session a person opened
|
|
138
|
+
* wearing a persona homed there or at a project it is filed under (the
|
|
139
|
+
* projects ./listen.ts gives such a session what is held for), not over, the
|
|
140
|
+
* one that spoke last. */ export let operatorOf = async (g, project)=>{
|
|
141
|
+
if (!g.vocab.prop(SESSION, 'operator')) return;
|
|
142
|
+
let homes = above(await projects(g), project);
|
|
143
|
+
if (!homes.length) return;
|
|
144
|
+
let open = await g.read(line`.${SESSION}.operator=true&.${SESSION}.persona.persona.home=${homes}&!${SESSION}.ended&.fields=${SESSION}.ended`);
|
|
145
|
+
let gone = await ended(g, open);
|
|
146
|
+
let live = open.filter((s)=>!gone.has(s.entity.eid));
|
|
147
|
+
let last = await Promise.all(live.map(async (s)=>{
|
|
148
|
+
let [entry] = await g.read(line`.entry.session=${s.entity.eid}&.order=-entry.seq&.limit=1&.fields=created.at`);
|
|
149
|
+
return {
|
|
150
|
+
eid: s.entity.eid,
|
|
151
|
+
at: str(comp(entry, 'created').at)
|
|
152
|
+
};
|
|
153
|
+
}));
|
|
154
|
+
return last.toSorted((a, b)=>b.at.localeCompare(a.at))[0]?.eid;
|
|
155
|
+
};
|
|
156
|
+
/** Where each watcher's knock goes: its session while that can hear, else
|
|
157
|
+
* its project's operator, else the project. A person's goes to the session
|
|
158
|
+
* standing for their conversation with their assistant ({@link standingFor}),
|
|
159
|
+
* unless the act is their own (`by`). Anyone muting the task is left out, and
|
|
160
|
+
* with `relay` false, so is a session that is over. */ export let targets = async (g, watching, muting, relay = true, by)=>{
|
|
161
|
+
let rows = new Map((watching.length ? await g.get(watching, [
|
|
162
|
+
SESSION,
|
|
163
|
+
'persona',
|
|
164
|
+
'project',
|
|
165
|
+
'person'
|
|
166
|
+
].filter((c)=>g.vocab.comp(c))) : []).map((b)=>[
|
|
167
|
+
b.entity.eid,
|
|
168
|
+
b
|
|
169
|
+
]));
|
|
170
|
+
let homes = [
|
|
171
|
+
...new Set([
|
|
172
|
+
...rows.values()
|
|
173
|
+
].map((b)=>str(comp(b, SESSION).persona)).filter(Boolean))
|
|
174
|
+
];
|
|
175
|
+
let personas = homes.length && g.vocab.comp('persona') ? await g.get(homes, [
|
|
176
|
+
'persona'
|
|
177
|
+
]) : [];
|
|
178
|
+
for (let b of personas){
|
|
179
|
+
rows.set(b.entity.eid, b);
|
|
180
|
+
}
|
|
181
|
+
let sessions = [
|
|
182
|
+
...rows.values()
|
|
183
|
+
].filter((b)=>b[SESSION]);
|
|
184
|
+
let gone = await ended(g, sessions);
|
|
185
|
+
let operators = new Map();
|
|
186
|
+
let out = new Set();
|
|
187
|
+
for (let w of watching){
|
|
188
|
+
let project = projectOf(rows, w);
|
|
189
|
+
if (muting.has(w) || project && muting.has(project)) continue;
|
|
190
|
+
if (rows.get(w)?.[SESSION]) {
|
|
191
|
+
if (!gone.has(w)) out.add(w);
|
|
192
|
+
if (!gone.has(w) || !relay) continue;
|
|
193
|
+
}
|
|
194
|
+
if (rows.get(w)?.person) {
|
|
195
|
+
let heard = w == by ? undefined : await standingFor(g, w);
|
|
196
|
+
if (heard) out.add(heard);
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (!project) continue;
|
|
200
|
+
if (!operators.has(project)) {
|
|
201
|
+
operators.set(project, await operatorOf(g, project));
|
|
202
|
+
}
|
|
203
|
+
out.add(operators.get(project) ?? project);
|
|
204
|
+
}
|
|
205
|
+
return [
|
|
206
|
+
...out
|
|
207
|
+
];
|
|
208
|
+
};
|
|
209
|
+
// How far a line of sessions is followed up before it stops: a longer one is
|
|
210
|
+
// a cycle someone wrote.
|
|
211
|
+
let DEPTH = 8;
|
|
212
|
+
// What places a session in its line, read alone: the rest of `session` (its
|
|
213
|
+
// computed status above all) is derived from its whole log.
|
|
214
|
+
let placed = async (g, eid)=>(await g.read(line`.entity.eid=${eid}&.${SESSION}&.fields=${[
|
|
215
|
+
`${SESSION}.source`,
|
|
216
|
+
`${SESSION}.ended`,
|
|
217
|
+
`${SESSION}.transcript`
|
|
218
|
+
].concat(g.vocab.comp('spawned') ? [
|
|
219
|
+
'spawned.parent'
|
|
220
|
+
] : []).concat(g.vocab.comp('helping') ? [
|
|
221
|
+
'helping.project'
|
|
222
|
+
] : [])}`))[0];
|
|
223
|
+
let managed = async (g, eid)=>g.vocab.comp('process') ? (await g.get([
|
|
224
|
+
eid
|
|
225
|
+
], [
|
|
226
|
+
'process',
|
|
227
|
+
'exit'
|
|
228
|
+
]))[0] : undefined;
|
|
229
|
+
/** The sessions a write through `via` is the own write of: that session, and
|
|
230
|
+
* while it is a subagent (a transcript its harness keeps in a file and runs
|
|
231
|
+
* inside its parent's process, as a Claude Code subagent is), each session up
|
|
232
|
+
* its line. A managed run or a native child is a line of work of its own. */ export let writers = async (g, via)=>{
|
|
233
|
+
let own = new Set();
|
|
234
|
+
for(let at = via; at && !own.has(at) && own.size < DEPTH;){
|
|
235
|
+
own.add(at);
|
|
236
|
+
let s = await placed(g, at);
|
|
237
|
+
let parent = str(comp(s, 'spawned').parent);
|
|
238
|
+
at = parent && comp(s, SESSION).transcript && !(await managed(g, at))?.process ? parent : '';
|
|
239
|
+
}
|
|
240
|
+
return own;
|
|
241
|
+
};
|
|
242
|
+
/** Whom a write through `via` is the own write of because `via` helps them
|
|
243
|
+
* (./help.ts): a helper takes its operator's routine in its place, so what it
|
|
244
|
+
* writes is that operator's own. The project it helps, each project filed
|
|
245
|
+
* under it, and that project's operator hear nothing of it; a knock to any of
|
|
246
|
+
* them would be routine, and start the next helper on the first one's work. */ let standing = async (g, via)=>{
|
|
247
|
+
let [s] = via && g.vocab.comp(HELPING) ? await g.get([
|
|
248
|
+
via
|
|
249
|
+
], [
|
|
250
|
+
HELPING
|
|
251
|
+
]) : [];
|
|
252
|
+
let helped = str(comp(s, HELPING).project);
|
|
253
|
+
if (!helped) return ()=>false;
|
|
254
|
+
let tree = await projects(g);
|
|
255
|
+
let operator = await operatorOf(g, helped);
|
|
256
|
+
return (t)=>t == operator || above(tree, t).includes(helped);
|
|
257
|
+
};
|
|
258
|
+
// The task an id a call was given names, or none where it names nothing now.
|
|
259
|
+
let named = async (g, id)=>{
|
|
260
|
+
if (!id) return '';
|
|
261
|
+
try {
|
|
262
|
+
return (await addressed(g, [
|
|
263
|
+
id
|
|
264
|
+
], 'task'))[0];
|
|
265
|
+
} catch (error) {
|
|
266
|
+
if (error instanceof Refused) return '';
|
|
267
|
+
throw error;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Where a managed run's ending is reported: the task its spawn call names,
|
|
272
|
+
* else the tasks it holds, and the session to knock, which is the one that
|
|
273
|
+
* started it or, that one being over, the nearest up its own line that can
|
|
274
|
+
* still hear. @yaks/spawn's completion writes its receipt by this, and
|
|
275
|
+
* {@link knocks} leaves that receipt to be the one knock. A helper's own
|
|
276
|
+
* ending (./help.ts) knocks nobody: what it did is in the graph, and what
|
|
277
|
+
* needs its operator it handed up itself.
|
|
278
|
+
*
|
|
279
|
+
* ```ts
|
|
280
|
+
* import { reported } from '@yaks/session'
|
|
281
|
+
*
|
|
282
|
+
* // let { tasks, to } = await reported(graph, run)
|
|
283
|
+
* ```
|
|
284
|
+
*/ export let reported = async (g, run)=>{
|
|
285
|
+
let row = await placed(g, run);
|
|
286
|
+
let source = str(comp(row, SESSION).source);
|
|
287
|
+
let [call] = source ? await g.get([
|
|
288
|
+
source
|
|
289
|
+
], [
|
|
290
|
+
'call',
|
|
291
|
+
'entry',
|
|
292
|
+
'created'
|
|
293
|
+
]) : [];
|
|
294
|
+
// Claims may already have been released by the terminal-entry effect, or
|
|
295
|
+
// by the agent itself. The originating spawn call still names its task, as
|
|
296
|
+
// its caller wrote it (`T-12`).
|
|
297
|
+
let task = call?.call ? await named(g, str(argsOf(call).task)) : '';
|
|
298
|
+
let tasks = task ? [
|
|
299
|
+
task
|
|
300
|
+
] : g.vocab.comp('task') ? (await g.read(line`.task&.${CLAIM}.session=${run}`)).map((b)=>b.entity.eid) : [];
|
|
301
|
+
if (row?.helping) return {
|
|
302
|
+
tasks
|
|
303
|
+
};
|
|
304
|
+
let seen = new Set([
|
|
305
|
+
run
|
|
306
|
+
]);
|
|
307
|
+
let at = str(comp(row, 'spawned').parent) || str(comp(call, 'entry').session) || str(comp(call, 'created').via);
|
|
308
|
+
while(at && !seen.has(at) && seen.size < DEPTH){
|
|
309
|
+
seen.add(at);
|
|
310
|
+
let s = await placed(g, at);
|
|
311
|
+
if (!s) break;
|
|
312
|
+
if (!(await ended(g, [
|
|
313
|
+
s
|
|
314
|
+
])).has(at)) return {
|
|
315
|
+
tasks,
|
|
316
|
+
to: at
|
|
317
|
+
};
|
|
318
|
+
at = str(comp(s, 'spawned').parent);
|
|
319
|
+
}
|
|
320
|
+
return {
|
|
321
|
+
tasks
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
// Who hears a change another way, so is not knocked for it. A comment: the
|
|
325
|
+
// session it knocks itself. A mark a managed run made while still at work on
|
|
326
|
+
// the task: everyone its receipt reaches, which is the session the receipt
|
|
327
|
+
// knocks and every watcher the receipt, a comment, knocks in turn. A person's
|
|
328
|
+
// assistant hears no comment that does not answer them, so for it the mark is
|
|
329
|
+
// the news.
|
|
330
|
+
let told = async (g, row, task, via)=>{
|
|
331
|
+
let none = ()=>false;
|
|
332
|
+
if (row.comment) {
|
|
333
|
+
let to = str(comp(row, 'knock').target);
|
|
334
|
+
return (t)=>t == to;
|
|
335
|
+
}
|
|
336
|
+
let run = via ? await managed(g, via) : undefined;
|
|
337
|
+
if (!run?.process || run.exit) return none;
|
|
338
|
+
let { tasks, to } = await reported(g, via);
|
|
339
|
+
if (!tasks.includes(task)) return none;
|
|
340
|
+
return (t, person)=>t == to || !person;
|
|
341
|
+
};
|
|
342
|
+
// A task's newest mark: answered, completed or cancelled.
|
|
343
|
+
let marked = (g, task)=>{
|
|
344
|
+
let id = human(g.vocab)(task);
|
|
345
|
+
let decided = comp(task, 'decided');
|
|
346
|
+
let mark = task.decided && task.completed ? {
|
|
347
|
+
name: 'decided',
|
|
348
|
+
what: `${id} answered "${str(decided.choice)}"`
|
|
349
|
+
} : task.cancelled ? {
|
|
350
|
+
name: 'cancelled',
|
|
351
|
+
what: `${id} cancelled`
|
|
352
|
+
} : task.completed ? {
|
|
353
|
+
name: 'completed',
|
|
354
|
+
what: `${id} completed`
|
|
355
|
+
} : undefined;
|
|
356
|
+
if (!mark) return;
|
|
357
|
+
let c = comp(task, mark.name);
|
|
358
|
+
// A mark naming nobody who made it records an act in another store, at that
|
|
359
|
+
// store's time: @yaks/heal closes a bug's task with the tracker's
|
|
360
|
+
// resolution or archival. That store tells it, so it knocks nobody here.
|
|
361
|
+
if (!str(c.by) && !str(c.via)) return;
|
|
362
|
+
let reason = mark.name == 'cancelled' && str(c.reason) ? ` (${fold(str(c.reason))})` : '';
|
|
363
|
+
return {
|
|
364
|
+
key: `${task.entity.eid} ${mark.name} ${str(c.at)}`,
|
|
365
|
+
what: `${mark.what}${reason}`,
|
|
366
|
+
text: str(comp(task, 'doc').title),
|
|
367
|
+
by: str(c.by),
|
|
368
|
+
via: str(c.via),
|
|
369
|
+
decision: mark.name == 'decided'
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
// An open task's assignment to a person, as it stands: to whom, and by its
|
|
373
|
+
// last writer. `at` is when the commit that assigned it owed its run, so each
|
|
374
|
+
// assignment is a change of its own and a run tried again is the same one.
|
|
375
|
+
let assigned = async (g, task, at = '')=>{
|
|
376
|
+
let to = str(comp(task, 'filed').assignee);
|
|
377
|
+
if (!to || task.completed || task.cancelled) return;
|
|
378
|
+
let [who] = await g.get([
|
|
379
|
+
to
|
|
380
|
+
], [
|
|
381
|
+
'doc',
|
|
382
|
+
'person'
|
|
383
|
+
].filter((c)=>g.vocab.comp(c)));
|
|
384
|
+
if (!who?.person) return;
|
|
385
|
+
let wrote = comp(task, 'updated').by ? 'updated' : 'created';
|
|
386
|
+
return {
|
|
387
|
+
to,
|
|
388
|
+
key: `${task.entity.eid} assigned ${to} ${at}`,
|
|
389
|
+
what: `${human(g.vocab)(task)} assigned to ${str(comp(who, 'doc').title) || human(g.vocab)(who)}`,
|
|
390
|
+
text: str(comp(task, 'doc').title),
|
|
391
|
+
by: str(comp(task, wrote).by),
|
|
392
|
+
via: str(comp(task, wrote).via)
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* The knocks a change to a task owes its watchers: the task itself (a mark)
|
|
397
|
+
* or a comment on it. None where `eid` is neither, the change is not one a
|
|
398
|
+
* watcher hears, or every watcher wrote it or was told already. Where what
|
|
399
|
+
* `moved` is the task's `filed`, the change is its assignment, owed to the
|
|
400
|
+
* person it names alone.
|
|
401
|
+
*
|
|
402
|
+
* ```ts
|
|
403
|
+
* import { knocks } from '@yaks/session'
|
|
404
|
+
*
|
|
405
|
+
* // await graph.apply(await knocks(graph, task), { trusted: true })
|
|
406
|
+
* ```
|
|
407
|
+
*/ export let knocks = async (g, eid, moved = {})=>{
|
|
408
|
+
if (!g.vocab.comp('knock')) return [];
|
|
409
|
+
let [row] = await g.get([
|
|
410
|
+
eid
|
|
411
|
+
]);
|
|
412
|
+
let on = row?.comment ? str(comp(row, 'comment').target) : eid;
|
|
413
|
+
let [task] = on != eid ? await g.get([
|
|
414
|
+
on
|
|
415
|
+
]) : [
|
|
416
|
+
row
|
|
417
|
+
];
|
|
418
|
+
if (!task?.task) return [];
|
|
419
|
+
let made = comp(row, 'created');
|
|
420
|
+
let given = moved.name == 'filed' ? await assigned(g, task, moved.at) : undefined;
|
|
421
|
+
let change = moved.name == 'filed' ? given : row.comment ? {
|
|
422
|
+
key: `${eid} comment`,
|
|
423
|
+
what: `${human(g.vocab)(row)} on ${human(g.vocab)(task)}`,
|
|
424
|
+
text: str(comp(row, 'doc').body),
|
|
425
|
+
by: str(made.by),
|
|
426
|
+
via: str(made.via)
|
|
427
|
+
} : marked(g, task);
|
|
428
|
+
if (!change) return [];
|
|
429
|
+
let { watching, muting } = await watchers(g, task);
|
|
430
|
+
if (given) watching = [
|
|
431
|
+
given.to
|
|
432
|
+
];
|
|
433
|
+
let replied = row.comment ? await answered(g, row) : '';
|
|
434
|
+
// A person's comment reaches the session that filed the task, and the one
|
|
435
|
+
// holding it, through ./listen.ts already.
|
|
436
|
+
let [writer] = change.via ? await g.get([
|
|
437
|
+
change.via
|
|
438
|
+
], [
|
|
439
|
+
SESSION
|
|
440
|
+
]) : [];
|
|
441
|
+
if (row.comment && !writer?.[SESSION]) {
|
|
442
|
+
let told = [
|
|
443
|
+
str(comp(task, 'created').via),
|
|
444
|
+
str(comp(task, CLAIM).session)
|
|
445
|
+
];
|
|
446
|
+
watching = watching.filter((w)=>!told.includes(w));
|
|
447
|
+
}
|
|
448
|
+
let own = change.via ? await writers(g, change.via) : new Set();
|
|
449
|
+
let knows = await told(g, row, task.entity.eid, change.via);
|
|
450
|
+
watching = watching.filter((w)=>!own.has(w));
|
|
451
|
+
let worked = !!row.comment && (await taken(g, [
|
|
452
|
+
eid
|
|
453
|
+
])).has(eid);
|
|
454
|
+
let stands = await standing(g, change.via);
|
|
455
|
+
let to = (await targets(g, watching, muting, !worked, change.by)).filter((t)=>!own.has(t) && !stands(t));
|
|
456
|
+
// The person each target stands for, if it stands for one.
|
|
457
|
+
let stood = new Map((to.length ? await g.get(to, [
|
|
458
|
+
SESSION
|
|
459
|
+
]) : []).map((b)=>[
|
|
460
|
+
b.entity.eid,
|
|
461
|
+
str(comp(b, SESSION).person)
|
|
462
|
+
]));
|
|
463
|
+
to = to.filter((t)=>!knows(t, stood.get(t) ?? ''));
|
|
464
|
+
// A comment reaches a person's assistant only when it answers them.
|
|
465
|
+
if (row.comment) {
|
|
466
|
+
to = to.filter((t)=>[
|
|
467
|
+
replied,
|
|
468
|
+
''
|
|
469
|
+
].includes(stood.get(t) ?? ''));
|
|
470
|
+
}
|
|
471
|
+
if (!to.length) return [];
|
|
472
|
+
let actorFields = change.decision ? [
|
|
473
|
+
'doc',
|
|
474
|
+
'persona',
|
|
475
|
+
'project'
|
|
476
|
+
].filter((c)=>g.vocab.comp(c)) : [
|
|
477
|
+
'doc'
|
|
478
|
+
];
|
|
479
|
+
let [who] = change.by ? await g.get([
|
|
480
|
+
change.by
|
|
481
|
+
], actorFields) : [];
|
|
482
|
+
let name = who ? str(comp(who, 'doc').title) || human(g.vocab)(who) : '';
|
|
483
|
+
let prefix = change.decision && (who?.persona || who?.project) ? 'Agent decision: ' : '';
|
|
484
|
+
// The words whole: a knock cut short costs its reader a second command,
|
|
485
|
+
// and with it a second read of its whole context.
|
|
486
|
+
let text = fold(change.text, Infinity);
|
|
487
|
+
let body = `${prefix}${change.what}${name ? ` by ${name}` : ''}` + (text ? `: ${text}` : '');
|
|
488
|
+
let named = to.map((target)=>({
|
|
489
|
+
target,
|
|
490
|
+
eid: derivedEid(`session watch ${target} ${change.key}`)
|
|
491
|
+
}));
|
|
492
|
+
let had = new Set((await g.get(named.map((n)=>n.eid), [
|
|
493
|
+
'knock'
|
|
494
|
+
])).filter((b)=>b.knock).map((b)=>b.entity.eid));
|
|
495
|
+
return named.filter((n)=>!had.has(n.eid)).map((n)=>({
|
|
496
|
+
entity: {
|
|
497
|
+
eid: n.eid
|
|
498
|
+
},
|
|
499
|
+
knock: {
|
|
500
|
+
target: n.target,
|
|
501
|
+
// What it tells of: the comment, or the task a mark or an assignment
|
|
502
|
+
// moved, so a reader tells a task's change from talk about it.
|
|
503
|
+
about: row.comment ? eid : task.entity.eid,
|
|
504
|
+
...change.by ? {
|
|
505
|
+
from: change.by
|
|
506
|
+
} : {}
|
|
507
|
+
},
|
|
508
|
+
doc: {
|
|
509
|
+
body
|
|
510
|
+
}
|
|
511
|
+
}));
|
|
512
|
+
};
|
|
513
|
+
/** The code behind `session_watch`: knock the watchers of the task `eid` is,
|
|
514
|
+
* or that the comment `eid` is on, for what `moved`. */ export let watch = async (g, eid, moved)=>{
|
|
515
|
+
let owed = await knocks(g, eid, moved);
|
|
516
|
+
if (owed.length) await g.apply(owed, {
|
|
517
|
+
trusted: true
|
|
518
|
+
});
|
|
519
|
+
};
|
|
520
|
+
//# sourceMappingURL=watch.js.map
|
package/watch.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.js","sources":["./watch.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,uEAAuE;AACvE,4EAA4E;AAC5E,wEAAwE;AACxE,4EAA4E;AAC5E,6EAA6E;AAC7E,EAAE;AACF,yEAAyE;AACzE,8EAA8E;AAC9E,8EAA8E;AAC9E,0EAA0E;AAC1E,yDAAyD;AACzD,EAAE;AACF,4EAA4E;AAC5E,qEAAqE;AACrE,+EAA+E;AAC/E,8EAA8E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