@yaks/persona 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 +401 -2
- package/_dist/comp.d.ts +13 -0
- package/_dist/comp.d.ts.map +1 -0
- package/_dist/effects.d.ts +22 -0
- package/_dist/effects.d.ts.map +1 -0
- package/_dist/mod.d.ts +40 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/name.d.ts +49 -0
- package/_dist/name.d.ts.map +1 -0
- package/_dist/owed.d.ts +56 -0
- package/_dist/owed.d.ts.map +1 -0
- package/_dist/part.d.ts +4 -0
- package/_dist/part.d.ts.map +1 -0
- package/_dist/shipped.d.ts +30 -0
- package/_dist/shipped.d.ts.map +1 -0
- package/_dist/skill-checkout.d.ts +6 -0
- package/_dist/skill-checkout.d.ts.map +1 -0
- package/_dist/skill-effects.d.ts +25 -0
- package/_dist/skill-effects.d.ts.map +1 -0
- package/_dist/skill-mirror-io.d.ts +7 -0
- package/_dist/skill-mirror-io.d.ts.map +1 -0
- package/_dist/skill-mirror.d.ts +15 -0
- package/_dist/skill-mirror.d.ts.map +1 -0
- package/_dist/skill-text.d.ts +28 -0
- package/_dist/skill-text.d.ts.map +1 -0
- package/_dist/skills.d.ts +22 -0
- package/_dist/skills.d.ts.map +1 -0
- package/_dist/tools.d.ts +9 -0
- package/_dist/tools.d.ts.map +1 -0
- package/_dist/ui.d.ts +6 -0
- package/_dist/ui.d.ts.map +1 -0
- package/_dist/views.d.ts +19 -0
- package/_dist/views.d.ts.map +1 -0
- package/_dist/vocab.d.ts +7 -0
- package/_dist/vocab.d.ts.map +1 -0
- package/_dist/voice.d.ts +47 -0
- package/_dist/voice.d.ts.map +1 -0
- package/_dist/worn.d.ts +55 -0
- package/_dist/worn.d.ts.map +1 -0
- package/carried.js +201 -0
- package/carried.js.map +1 -0
- package/carried.ts +269 -0
- package/comp.js +31 -0
- package/comp.js.map +1 -0
- package/comp.ts +38 -0
- package/deno.json +1 -0
- package/desk.js +201 -0
- package/desk.js.map +1 -0
- package/desk.ts +301 -0
- package/effects.js +106 -0
- package/effects.js.map +1 -0
- package/effects.ts +120 -0
- package/files.js +305 -0
- package/files.js.map +1 -0
- package/files.ts +319 -0
- package/inspect.js +66 -0
- package/inspect.js.map +1 -0
- package/inspect.ts +30 -0
- package/mod.js +40 -0
- package/mod.js.map +1 -0
- package/mod.ts +61 -0
- package/name.js +161 -0
- package/name.js.map +1 -0
- package/name.ts +184 -0
- package/owed.js +196 -0
- package/owed.js.map +1 -0
- package/owed.ts +256 -0
- package/package.json +83 -4
- package/part.js +4 -0
- package/part.js.map +1 -0
- package/part.ts +4 -0
- package/shipped.js +130 -0
- package/shipped.js.map +1 -0
- package/shipped.ts +131 -0
- package/skill-checkout.js +92 -0
- package/skill-checkout.js.map +1 -0
- package/skill-checkout.ts +121 -0
- package/skill-effects.js +244 -0
- package/skill-effects.js.map +1 -0
- package/skill-effects.ts +274 -0
- package/skill-mirror-io.js +193 -0
- package/skill-mirror-io.js.map +1 -0
- package/skill-mirror-io.ts +212 -0
- package/skill-mirror.js +659 -0
- package/skill-mirror.js.map +1 -0
- package/skill-mirror.ts +640 -0
- package/skill-text.js +158 -0
- package/skill-text.js.map +1 -0
- package/skill-text.ts +183 -0
- package/skills.js +238 -0
- package/skills.js.map +1 -0
- package/skills.ts +383 -0
- package/text.js +59 -0
- package/text.js.map +1 -0
- package/text.ts +60 -0
- package/tools.js +76 -0
- package/tools.js.map +1 -0
- package/tools.ts +91 -0
- package/ui.js +19 -0
- package/ui.js.map +1 -0
- package/ui.ts +34 -0
- package/views.js +27 -0
- package/views.js.map +1 -0
- package/views.ts +29 -0
- package/vocab.js +14 -0
- package/vocab.js.map +1 -0
- package/vocab.json +270 -0
- package/vocab.ts +16 -0
- package/voice.js +105 -0
- package/voice.js.map +1 -0
- package/voice.ts +133 -0
- package/worn.js +328 -0
- package/worn.js.map +1 -0
- package/worn.ts +336 -0
package/_dist/mod.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who is acting, what they are responsible for, and the instructions they run
|
|
3
|
+
* with. A `person` is a human being the graph knows by name; a `persona` is a
|
|
4
|
+
* set of instructions an agent runs with, held in the `doc` body on the same
|
|
5
|
+
* entity; and a `role` is what an agent running one is responsible for, and
|
|
6
|
+
* whether it runs in this process or another. When a role next runs is a
|
|
7
|
+
* `@yaks/wake` wake pointing at it, where it works is a `@yaks/git` worktree,
|
|
8
|
+
* and what it last decided is `@yaks/kernel`'s `decided` — the role keeps no
|
|
9
|
+
* second copy of any of them.
|
|
10
|
+
*
|
|
11
|
+
* Besides those components, this package renders one document. A persona has
|
|
12
|
+
* edges to the documents it includes in full (`contains`) and the documents it
|
|
13
|
+
* only mentions by id (`reads`); {@link wear} reads them out of a storage and
|
|
14
|
+
* {@link voice} renders the set as markdown — the text an agent is given at
|
|
15
|
+
* the top of its context.
|
|
16
|
+
*
|
|
17
|
+
* ```ts ignore
|
|
18
|
+
* import { voice, wear } from '@yaks/persona'
|
|
19
|
+
*
|
|
20
|
+
* let worn = await wear(storage, vocab)('N-1')
|
|
21
|
+
* if (worn) console.log(voice(vocab)(worn))
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* It returns text. Where that text goes — a file, a repo, the system prompt
|
|
25
|
+
* of a spawned agent — is the caller's decision. {@link owed} is what a
|
|
26
|
+
* harness asks before it starts an agent: the persona the agent's checkout
|
|
27
|
+
* carries, or the one {@link common} to the work it is on, unless an
|
|
28
|
+
* instruction file its provider reads there already says it. One caller ships beside it
|
|
29
|
+
* and stays out of this entry point, because it writes files: each project's
|
|
30
|
+
* personas in its checkout, `persona_sync` in `./tools` and kept current by
|
|
31
|
+
* `./effects`.
|
|
32
|
+
*
|
|
33
|
+
* @module
|
|
34
|
+
*/ export { PERSON, PERSONA, personaDoc, SKILL } from "./comp.js";
|
|
35
|
+
export { NAMED, PART, voice, type Worn } from "./voice.js";
|
|
36
|
+
export { beside, CONTAINS, fold, offer, QUERY, READS, type Reads, served, TOOL, wear, wearLayers } from "./worn.js";
|
|
37
|
+
export { christened, given, LONGEST, named, NAMES, pick } from "./name.js";
|
|
38
|
+
export { type As, carried, common, type Owed, owed, unsaid, wearing } from "./owed.js";
|
|
39
|
+
export { kept, shipped } from "./shipped.js";
|
|
40
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sources":["../mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GAED,SAAS,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,oBAAmB;AAC9D,SAAS,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,qBAAoB;AAC1D,SACE,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,KAAK,EACV,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,UAAU,oBACM;AAClB,SAAS,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,oBAAmB;AAC1E,SACE,KAAK,EAAE,EACP,OAAO,EACP,MAAM,EACN,KAAK,IAAI,EACT,IAAI,EACJ,MAAM,EACN,OAAO,oBACS;AAClB,SAAS,IAAI,EAAE,OAAO,uBAAsB"}
|
package/_dist/name.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** The names a new persona is given: short, plain to say aloud, mostly trees
|
|
2
|
+
* and creatures. */ export declare let NAMES: readonly [string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string];
|
|
3
|
+
/** The first name from `eid`'s place in {@link NAMES} that `taken` does not
|
|
4
|
+
* hold; the place's own name when every one is taken. */ export declare let pick: (eid: string, taken?: Set<string>) => string;
|
|
5
|
+
/** A new name for `eid`, clear of the names `others` go by: those its people
|
|
6
|
+
* already reach. An unnamed one among them that sorts first picks first, so
|
|
7
|
+
* names given in one pass, which cannot read each other, still choose apart.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { equal } from '@yaks/testing'
|
|
11
|
+
* import { christened, pick } from './name.ts'
|
|
12
|
+
* let mine = pick('b')
|
|
13
|
+
* equal(christened('b', []), mine)
|
|
14
|
+
* equal(christened('b', [{ eid: 'z', name: mine }]) != mine, true)
|
|
15
|
+
* equal(christened('b', [{ eid: 'a' }]) != pick('a'), true)
|
|
16
|
+
* ```
|
|
17
|
+
*/ export declare let christened: (eid: string, others: {
|
|
18
|
+
eid: string;
|
|
19
|
+
name?: string | null;
|
|
20
|
+
}[]) => string;
|
|
21
|
+
/** The most characters a name is. */ export declare let LONGEST: number;
|
|
22
|
+
/** A name a person gave: its spaces closed up, up to {@link LONGEST}
|
|
23
|
+
* characters.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { equal } from '@yaks/testing'
|
|
27
|
+
* import { assertThrows } from '@std/assert'
|
|
28
|
+
* import { given } from './name.ts'
|
|
29
|
+
* equal(given(' Ada Lovelace '), 'Ada Lovelace')
|
|
30
|
+
* assertThrows(() => given(' '), Error, 'Give it a name.')
|
|
31
|
+
* assertThrows(() => given('a'.repeat(41)), Error, 'up to 40 characters')
|
|
32
|
+
* ```
|
|
33
|
+
*/ export declare let given: (said: string) => string;
|
|
34
|
+
/** A name `said` for a new persona, as {@link given} takes it, refused when
|
|
35
|
+
* one of `others` (those its people already reach) goes by it, in any case.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { equal } from '@yaks/testing'
|
|
39
|
+
* import { assertThrows } from '@std/assert'
|
|
40
|
+
* import { named, pick } from './name.ts'
|
|
41
|
+
* equal(named(' Menno ', [{ eid: 'a', name: 'Cedar' }]), 'Menno')
|
|
42
|
+
* assertThrows(() => named('cedar', [{ eid: 'a', name: 'Cedar' }]), Error)
|
|
43
|
+
* assertThrows(() => named(pick('a'), [{ eid: 'a' }]), Error)
|
|
44
|
+
* ```
|
|
45
|
+
*/ export declare let named: (said: string, others: {
|
|
46
|
+
eid: string;
|
|
47
|
+
name?: string | null;
|
|
48
|
+
}[]) => string;
|
|
49
|
+
//# sourceMappingURL=name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name.d.ts","sources":["../name.ts"],"names":[],"mappings":"AAMA;kBACkB,GAClB,OAAO,YAAI,ynBA8EV;AAWD;uDACuD,GACvD,OAAO,YAAI,OAAQ,KAAK,MAAM,EAAE,QAAO,IAAI,MAAM,MAAgB,MAAM,CAOtE;AAED;;;;;;;;;;;;CAYC,GACD,OAAO,YAAI,aACT,KAAK,MAAM,EACX;EAAU,KAAK,MAAM;EAAE,OAAO,MAAM,GAAG,IAAI;QAC1C,MAAM,CAOR;AAED,mCAAmC,GACnC,OAAO,YAAI,gBAAY;AAEvB;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,QAAS,MAAM,MAAM,KAAG,MAAM,CAOxC;AAED;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,QACT,MAAM,MAAM,EACZ;EAAU,KAAK,MAAM;EAAE,OAAO,MAAM,GAAG,IAAI;QAC1C,MAAM,CAWR"}
|
package/_dist/owed.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Eid, Graph } from "@yaks/graph";
|
|
2
|
+
import { type Worn } from "./voice.js";
|
|
3
|
+
/** The common persona an agent working on `eid` (a task, or a project) hears:
|
|
4
|
+
* each common persona along its lineage, nearest first, folded into one. A
|
|
5
|
+
* sub-project without one of its own hears its parent's. */ export declare let common: (g: Graph, eid: Eid) => Promise<Worn | undefined>;
|
|
6
|
+
/** What an agent is owed: the persona's id, and its text. */ export type Owed = {
|
|
7
|
+
source: string;
|
|
8
|
+
text: string;
|
|
9
|
+
};
|
|
10
|
+
/** Who an agent is: a persona chosen for it, or the work it is on (a task, or
|
|
11
|
+
* a project), whose lineage's common persona it hears. */ export type As = {
|
|
12
|
+
persona?: string;
|
|
13
|
+
work?: Eid;
|
|
14
|
+
};
|
|
15
|
+
/** The common persona the checkout holding `path` carries: the nearest
|
|
16
|
+
* directory at or above `path` that the graph knows as a worktree, then the
|
|
17
|
+
* first project filed with its repository, by eid, that has one along its
|
|
18
|
+
* lineage. A session started anywhere in a checkout wears this. */ export declare let carried: (g: Graph, path: string) => Promise<Worn | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* The persona an agent working in the checkout at `path` wears, whole,
|
|
21
|
+
* whatever its instruction files already say of it: the one `as.persona`
|
|
22
|
+
* chooses, else the common persona of `as.work`'s lineage, else the one the
|
|
23
|
+
* checkout carries. Nothing when none of them has one. {@link offer} reads the
|
|
24
|
+
* tools it offers from it.
|
|
25
|
+
*
|
|
26
|
+
* ```ts ignore
|
|
27
|
+
* let tools = offer(await wearing(g, '', { persona: 'N-7' }))
|
|
28
|
+
* ```
|
|
29
|
+
*/ export declare let wearing: (g: Graph, path: string, as?: As) => Promise<Worn | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* What an agent working in the checkout at `path` is owed of its persona,
|
|
32
|
+
* given the text of each instruction file its provider reads there. By
|
|
33
|
+
* default that is the common persona the checkout's repository carries;
|
|
34
|
+
* `as.work` makes it the common persona of the work's lineage, less whatever a
|
|
35
|
+
* file there already says of the checkout's. Nothing when a file already says
|
|
36
|
+
* it all, when the graph knows no checkout holding `path` and no work, or when
|
|
37
|
+
* nothing along the way has a common persona. `as.persona` selects a graph
|
|
38
|
+
* persona instead, even when the checkout is not known to the graph.
|
|
39
|
+
*
|
|
40
|
+
* ```ts ignore
|
|
41
|
+
* let owes = await owed(g, '/srv/runs/S-1', [agentsMd], { work: 'T-7' })
|
|
42
|
+
* if (owes) args.push('--append-system-prompt', owes.text)
|
|
43
|
+
* ```
|
|
44
|
+
*/ export declare let owed: (g: Graph, path: string, files: string[], as?: As) => Promise<Owed | undefined>;
|
|
45
|
+
/**
|
|
46
|
+
* The instruction files an agent still reads when its host says its persona
|
|
47
|
+
* whole, afresh on every ask ({@link wearing}): each of `files` but one that
|
|
48
|
+
* is exactly the projection of the persona it wears, or of the checkout's
|
|
49
|
+
* where the worn one says all of it, which would say the same twice and go
|
|
50
|
+
* stale beside it.
|
|
51
|
+
*
|
|
52
|
+
* ```ts ignore
|
|
53
|
+
* let kept = await unsaid(g, '/srv/runs/S-1', [agentsMd], { work: 'T-7' })
|
|
54
|
+
* ```
|
|
55
|
+
*/ export declare let unsaid: (g: Graph, path: string, files: string[], as?: As) => Promise<string[]>;
|
|
56
|
+
//# sourceMappingURL=owed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owed.d.ts","sources":["../owed.ts"],"names":[],"mappings":"AAyBA,cAA4B,GAAG,EAAE,KAAK,2BAAgC;AAStE,SAAgB,KAAK,IAAI,qBAAoB;AAyC7C;;0DAE0D,GAC1D,OAAO,YAAI,SACT,GAAG,OACH,KAAK,QACJ,QAAQ,OAAO,SAAS,EAW1B;AAmBD,2DAA2D,GAC3D,YAAY;EAAS,QAAQ,MAAM;EAAE,MAAM,MAAM;;AAEjD;wDACwD,GACxD,YAAY;EAAO,UAAU,MAAM;EAAE,OAAO;;AAe5C;;;iEAGiE,GACjE,OAAO,YAAI,UACT,GAAG,OACH,MAAM,MAAM,KACX,QAAQ,OAAO,SAAS,EAsB1B;AAsBD;;;;;;;;;;CAUC,GACD,OAAO,YAAI,UACT,GAAG,OACH,MAAM,MAAM,EACZ,KAAI,OACH,QAAQ,OAAO,SAAS,EAAuC;AAElE;;;;;;;;;;;;;;CAcC,GACD,OAAO,YAAI,OACT,GAAG,OACH,MAAM,MAAM,EACZ,OAAO,MAAM,IACb,KAAI,OACH,QAAQ,OAAO,SAAS,EAM1B;AAQD;;;;;;;;;;CAUC,GACD,OAAO,YAAI,SACT,GAAG,OACH,MAAM,MAAM,EACZ,OAAO,MAAM,IACb,KAAI,OACH,QAAQ,MAAM,IAMhB"}
|
package/_dist/part.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** What stands between two parts of what an agent is told: each document
|
|
2
|
+
* worn, and what its host adds after them. Its own module, so a reader that
|
|
3
|
+
* splits what an agent was told (a browser's) imports nothing else. */ export declare let PART: string;
|
|
4
|
+
//# sourceMappingURL=part.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"part.d.ts","sources":["../part.ts"],"names":[],"mappings":"AAAA;;qEAEqE,GACrE,OAAO,YAAI,aAAoB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Bundle, type Eid } from "@yaks/graph";
|
|
2
|
+
import { type Reads } from "./worn.js";
|
|
3
|
+
/**
|
|
4
|
+
* The rows a persona's files say, by file name: the persona, each document it
|
|
5
|
+
* contains or reads, and the `contains` or `reads` edge to each in its order.
|
|
6
|
+
* `eid` gives the row a name stands for. A set with no persona, or two, a
|
|
7
|
+
* document the persona neither contains nor reads, or a name it lists that no
|
|
8
|
+
* file holds is refused.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { derivedEid } from '@yaks/graph/identity'
|
|
12
|
+
* import { shipped } from '@yaks/persona'
|
|
13
|
+
*
|
|
14
|
+
* let rows = shipped({
|
|
15
|
+
* 'base.md': '---\npersona: {}\ndoc:\n title: Helper\ncontains: [tone]\nreads: [calls]\n---\n\nHelp.\n',
|
|
16
|
+
* 'tone.md': '---\ndoc:\n title: Tone\n---\n\nBe brief.\n',
|
|
17
|
+
* 'calls.md': '---\ndoc:\n title: Calls\n---\n\nSpeak slowly.\n',
|
|
18
|
+
* }, (name) => derivedEid('helper|' + name))
|
|
19
|
+
* // the persona, `tone` and the edge containing it, `calls` and the edge
|
|
20
|
+
* // that reads it
|
|
21
|
+
* ```
|
|
22
|
+
*/ export declare let shipped: (files: Record<string, string>, eid: (name: string) => Eid) => Bundle[];
|
|
23
|
+
/**
|
|
24
|
+
* What a store whose entities `storage` reads still needs written to keep a
|
|
25
|
+
* persona as `rows` ({@link shipped}) say: each row it does not already hold
|
|
26
|
+
* as they say it, and the removal of each `contains` or `reads` edge the
|
|
27
|
+
* persona has there that `rows` does not. Nothing, where the store already
|
|
28
|
+
* keeps it.
|
|
29
|
+
*/ export declare let kept: (storage: Reads, rows: Bundle[]) => Promise<Bundle[]>;
|
|
30
|
+
//# sourceMappingURL=shipped.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shipped.d.ts","sources":["../shipped.ts"],"names":[],"mappings":"AAiBA,SAAS,KAAK,MAAM,EAAa,KAAK,GAAG,2BAAwC;AAKjF,SAA0B,KAAK,KAAK,oBAAmB;AAEvD;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,YAAI,UACT,OAAO,OAAO,MAAM,EAAE,MAAM,GAC5B,MAAM,MAAM,MAAM,KAAK,QACtB,SAyDF;AAED;;;;;;CAMC,GACD,OAAO,YAAI,OAAc,SAAS,OAAO,MAAM,aAAW,QAAQ,UAiBjE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Bundle, Graph } from "@yaks/graph";
|
|
2
|
+
/** Without a cwd, read the graph. With one, the checkout's actual directories
|
|
3
|
+
* replace its graph skills, including untracked additions and deletions. */ export declare let skillsAt: (g: Graph, cwd?: string) => Promise<Bundle[]>;
|
|
4
|
+
/** Select an exact folder name. Without a checkout, duplicate names across
|
|
5
|
+
* repositories are ambiguous rather than silently choosing one. */ export declare let loadSkill: (g: Graph, title: string, cwd?: string) => Promise<Bundle>;
|
|
6
|
+
//# sourceMappingURL=skill-checkout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-checkout.d.ts","sources":["../skill-checkout.ts"],"names":[],"mappings":"AAIA,cAAc,MAAM,EAAQ,KAAK,2BAAgC;AAkFjE;0EAC0E,GAC1E,OAAO,YAAI,WAAkB,GAAG,OAAO,MAAM,MAAM,KAAG,QAAQ,UAY7D;AAED;iEACiE,GACjE,OAAO,YAAI,YACT,GAAG,OACH,OAAO,MAAM,EACb,MAAM,MAAM,KACX,QAAQ,QAYV"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as fs from "@yaks/file/io";
|
|
2
|
+
import { sleep } from "@yaks/effects";
|
|
3
|
+
import type { Eid, Graph } from "@yaks/graph";
|
|
4
|
+
import type { Context } from "@yaks/tracker/report";
|
|
5
|
+
import { skillRoots, syncSkills } from "./skill-mirror.js";
|
|
6
|
+
import { stamp as stampOf } from "./skill-mirror-io.js";
|
|
7
|
+
/** Only the host capabilities this facet uses; fixtures need no server. */ export type SkillHost = {
|
|
8
|
+
graph: Graph;
|
|
9
|
+
config?: {
|
|
10
|
+
db?: string;
|
|
11
|
+
};
|
|
12
|
+
stopping?: AbortSignal;
|
|
13
|
+
me?: Eid;
|
|
14
|
+
gone?: (holder: Eid) => Promise<boolean>;
|
|
15
|
+
report?: (error: unknown, context?: Partial<Context>) => void | Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
/** Injectable boundaries for tests; production uses the mirror and timers. */ export type SkillRuntime = {
|
|
18
|
+
roots?: typeof skillRoots;
|
|
19
|
+
sync?: typeof syncSkills;
|
|
20
|
+
stamp?: typeof stampOf;
|
|
21
|
+
pause?: typeof sleep;
|
|
22
|
+
poll?: number;
|
|
23
|
+
files?: Pick<typeof fs, 'makeTempDir' | 'readTextFile' | 'writeTextFile' | 'remove'>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=skill-effects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-effects.d.ts","sources":["../skill-effects.ts"],"names":[],"mappings":"AAQA,YAAY,6BAAkC;AAE9C,SAAiC,KAAK,6BAAkC;AACxE,cAAc,GAAG,EAAE,KAAK,2BAAgC;AACxD,cAAc,OAAO,oCAAyC;AAG9D,SAAS,UAAU,EAAE,UAAU,4BAA2B;AAC1D,SAAS,SAAS,OAAO,+BAA8B;AAKvD,yEAAyE,GACzE,YAAY;EACV,OAAO;EACP;IAAW,KAAK,MAAM;;EACtB,WAAW;EACX,KAAK;EACL,QAAQ,QAAQ,QAAQ,QAAQ,OAAO;EACvC,UAAU,OAAO,OAAO,EAAE,UAAU,QAAQ,aAAa,IAAI,GAAG,QAAQ,IAAI;;AAG9E,4EAA4E,GAC5E,YAAY;EACV,eAAe;EACf,cAAc;EACd,eAAe;EACf,eAAe;EACf,OAAO,MAAM;EACb,QAAQ,YACC,IACP,gBAAgB,iBAAiB,kBAAkB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** What a sync of `root` reads from disk, as stats: the checkout's index and
|
|
2
|
+
* HEAD (the tracked set, staged blobs and branch) and every path under
|
|
3
|
+
* .claude/skills. Equal stamps mean a sync would read the same files, so a
|
|
4
|
+
* watcher compares these instead of syncing; a racy path keeps it syncing
|
|
5
|
+
* until its change is RACY old. No Git process runs, and no stat or listing
|
|
6
|
+
* holds the thread: a box under load can take seconds over one. */ export declare let stamp: (root: string, now?: number) => Promise<string>;
|
|
7
|
+
//# sourceMappingURL=skill-mirror-io.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-mirror-io.d.ts","sources":["../skill-mirror-io.ts"],"names":[],"mappings":"AAgMA;;;;;iEAKiE,GACjE,OAAO,YAAI,QACT,MAAM,MAAM,EACZ,MAAK,MAAM,KACV,QAAQ,MAAM,EAUhB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Graph } from "@yaks/graph";
|
|
2
|
+
import { type Run } from "@yaks/git/land";
|
|
3
|
+
import { primary as primaryRoots } from "@yaks/git/host";
|
|
4
|
+
import { type Report } from "@yaks/mirror";
|
|
5
|
+
export type SkillSync = Report & {
|
|
6
|
+
landed?: string;
|
|
7
|
+
worktree?: string;
|
|
8
|
+
};
|
|
9
|
+
export type SkillSyncOpts = {
|
|
10
|
+
worktree?: string;
|
|
11
|
+
run?: Run;
|
|
12
|
+
};
|
|
13
|
+
/** Current local primary checkouts, including repositories using master. */ export declare let skillRoots: any;
|
|
14
|
+
export declare let syncSkills: (g: Graph, root: string, memory: string, opts?: SkillSyncOpts) => Promise<SkillSync>;
|
|
15
|
+
//# sourceMappingURL=skill-mirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-mirror.d.ts","sources":["../skill-mirror.ts"],"names":[],"mappings":"AAIA,cAA4B,KAAK,2BAAgC;AAKjE,SAA0B,KAAK,GAAG,8BAAwC;AAC1E,SAEE,WAAW,YAAY,8BAES;AAClC,SAKE,KAAK,MAAM,4BACmB;AAKhC,YAAY,YAAY;EAAW,SAAS,MAAM;EAAE,WAAW,MAAM;;AACrE,YAAY;EAAkB,WAAW,MAAM;EAAE,MAAM;;AAqCvD,0EAA0E,GAC1E,OAAO,YAAI,gBAAyB;AAiiBpC,OAAO,YAAI,aACT,GAAG,OACH,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,OAAM,kBACL,QAAQ,WAwBV"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** The normalized parts of a skill, without an entity id or graph effects. */ export type SkillText = {
|
|
2
|
+
doc: {
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
};
|
|
6
|
+
content: {
|
|
7
|
+
body: string;
|
|
8
|
+
};
|
|
9
|
+
skill: {
|
|
10
|
+
invoke: 'user' | 'model' | 'both';
|
|
11
|
+
arguments: string[];
|
|
12
|
+
paths: string[];
|
|
13
|
+
fork: boolean;
|
|
14
|
+
options: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
type SkillBundle = {
|
|
18
|
+
doc?: unknown;
|
|
19
|
+
content?: unknown;
|
|
20
|
+
skill?: unknown;
|
|
21
|
+
};
|
|
22
|
+
/** Decode frontmatter, retaining every byte after the closing delimiter's
|
|
23
|
+
* line ending. An omitted name uses the folder; an explicit one must agree. */ export declare let parseSkill: (text: string, title: string) => SkillText;
|
|
24
|
+
/** Claude frontmatter from the entity's canonical fields. Unknown options
|
|
25
|
+
* survive, but cannot override the name, description or invocation policy. */ export declare let frontmatter: (bundle: SkillBundle) => Record<string, unknown>;
|
|
26
|
+
/** Serialize only the header; append the instructions without normalizing
|
|
27
|
+
* whitespace, line endings, placeholders or a missing final newline. */ export declare let renderSkill: (bundle: SkillBundle) => string;
|
|
28
|
+
//# sourceMappingURL=skill-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-text.d.ts","sources":["../skill-text.ts"],"names":[],"mappings":"AAQA,4EAA4E,GAC5E,YAAY;EACV;IAAO,OAAO,MAAM;IAAE,MAAM,MAAM;;EAClC;IAAW,MAAM,MAAM;;EACvB;IACE,QAAQ,SAAS,UAAU;IAC3B,WAAW,MAAM;IACjB,OAAO,MAAM;IACb,MAAM,OAAO;IACb,SAAS,OAAO,MAAM,EAAE,OAAO;;;KAI9B;EAAgB,MAAM,OAAO;EAAE,UAAU,OAAO;EAAE,QAAQ,OAAO;;AAyDtE;6EAC6E,GAC7E,OAAO,YAAI,aAAc,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,UAiDtD;AAED;4EAC4E,GAC5E,OAAO,YAAI,cAAe,QAAQ,gBAAc,OAAO,MAAM,EAAE,OAAO,EAmCrE;AAED;sEACsE,GACtE,OAAO,YAAI,cAAe,QAAQ,gBAAc,MAAM,CAUrD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Bundle, Graph } from "@yaks/graph";
|
|
2
|
+
/** Whether a title can name a skill's folder. */ export declare let folder: (title: string) => boolean;
|
|
3
|
+
/** Where a skill titled `title` lives in a repository. */ export declare let pathOf: (title: string) => string;
|
|
4
|
+
/** Skills in title order. */ export declare let sorted: (skills: Bundle[]) => Bundle[];
|
|
5
|
+
export declare let skillLocations: (g: Graph, skills: (Bundle | string)[]) => Promise<Map<string, Bundle>>;
|
|
6
|
+
export declare let skillLocation: (g: Graph, skill: Bundle | string) => Promise<Bundle | undefined>;
|
|
7
|
+
/** Discover descriptions without reading instruction bodies. */ export declare let skillCatalog: (g: Graph, repository?: string) => Promise<Bundle[]>;
|
|
8
|
+
/** Exact graph instructions, optionally limited to one repository. */ export declare let graphSkill: (g: Graph, title: string, repository?: string) => Promise<Bundle>;
|
|
9
|
+
/** Complete skills and their locators for one repository. Other repositories
|
|
10
|
+
* supply no bodies; every selected skill still has its full locator checked.
|
|
11
|
+
* Companions include file contents in the same repository read for a mirror. */ export declare let skillScope: (g: Graph, repository: string, companions?: boolean) => Promise<{
|
|
12
|
+
skills: Bundle[];
|
|
13
|
+
places: Map<string, Bundle>;
|
|
14
|
+
edges: Bundle[];
|
|
15
|
+
files: Bundle[];
|
|
16
|
+
}>;
|
|
17
|
+
/** Complete graph skills. Unlinked skills are visible without a repository,
|
|
18
|
+
* but cannot be exported or attributed to a repository until linked. */ export declare let repoSkills: (g: Graph, repository?: string) => Promise<Bundle[]>;
|
|
19
|
+
/** Render one read's skills and locators together, including pending renames. */ export declare let renderFiles: (skills: Bundle[], locations: Map<string, Bundle>, supports: Bundle[]) => Map<string, string>;
|
|
20
|
+
/** The skill documents and text supporting files the graph owns. */ export declare let skillFiles: (g: Graph, repository: string) => Promise<Map<string, string>>;
|
|
21
|
+
export { frontmatter, parseSkill, renderSkill } from "./skill-text.js";
|
|
22
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sources":["../skills.ts"],"names":[],"mappings":"AAGA,cAAc,MAAM,EAAQ,KAAK,2BAAgC;AAkBjE,+CAA+C,GAC/C,OAAO,YAAI,SAAU,OAAO,MAAM,KAAG,OAAO,CACN;AACtC,wDAAwD,GACxD,OAAO,YAAI,SAAU,OAAO,MAAM,KAAG,MAAM,CACP;AAGpC,2BAA2B,GAC3B,OAAO,YAAI,SAAU,QAAQ,aAAW,SAGrC;AAsFH,OAAO,YAAI,iBACT,GAAG,OACH,SAAS,SAAS,MAAM,QACvB,QAAQ,IAAI,MAAM,EAAE,SAAgD;AAEvE,OAAO,YAAI,gBACT,GAAG,OACH,OAAO,SAAS,MAAM,KACrB,QAAQ,SAAS,SAAS,EAG1B;AAoCH,8DAA8D,GAC9D,OAAO,YAAI,eACT,GAAG,OACH,aAAa,MAAM,KAClB,QAAQ,UAkBV;AAED,oEAAoE,GACpE,OAAO,YAAI,aACT,GAAG,OACH,OAAO,MAAM,EACb,aAAa,MAAM,KAClB,QAAQ,QAeV;AAED;;8EAE8E,GAC9E,OAAO,YAAI,aACT,GAAG,OACH,YAAY,MAAM,EAClB,yBACC;EACD,QAAQ;EACR,QAAQ,IAAI,MAAM,EAAE;EACpB,OAAO;EACP,OAAO;GAuER;AAED;sEACsE,GACtE,OAAO,YAAI,aACT,GAAG,OACH,aAAa,MAAM,KAClB,QAAQ,UAIV;AAYD,+EAA+E,GAC/E,OAAO,YAAI,cACT,QAAQ,UACR,WAAW,IAAI,MAAM,EAAE,SACvB,UAAU,aACT,IAAI,MAAM,EAAE,MAAM,EAgDpB;AAED,kEAAkE,GAClE,OAAO,YAAI,aACT,GAAG,OACH,YAAY,MAAM,KACjB,QAAQ,IAAI,MAAM,EAAE,MAAM,GAG5B;AAGD,SAAS,WAAW,EAAE,UAAU,EAAE,WAAW,0BAAyB"}
|
package/_dist/tools.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Runs } from "@yaks/graph/tools";
|
|
2
|
+
/** The implementations behind the tools ./vocab.json declares. The host's
|
|
3
|
+
* config names the database, beside which `persona_sync` remembers what each
|
|
4
|
+
* file last agreed on. */ export declare let runs: (host?: {
|
|
5
|
+
config?: {
|
|
6
|
+
db?: string;
|
|
7
|
+
};
|
|
8
|
+
}) => Runs;
|
|
9
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sources":["../tools.ts"],"names":[],"mappings":"AAcA,cAAc,IAAI,iCAAsC;AAkDxD;;wBAEwB,GACxB,OAAO,YAAI,OAAQ;EAAS;IAAW,KAAK,MAAM;;MAAO,KAuBxD"}
|
package/_dist/ui.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type JSX } from "@types/react";
|
|
2
|
+
/** Where a persona's people change what it is called (`doc{title}`): one
|
|
3
|
+
* field, `name`, holding `name` now, as long as `given` (./name.ts) takes. */ export declare let NameCard: ({}: {
|
|
4
|
+
name: string;
|
|
5
|
+
}) => JSX.Element;
|
|
6
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sources":["../ui.ts"],"names":[],"mappings":"AAG0C,SAA6B,KAAK,GAAG,uBAA0B;AAIzG;4EAC4E,GAC5E,OAAO,YAAI,WAAY;EAAY,MAAM,MAAM;CAAE,KAAG,IAAI,QAwBrD"}
|
package/_dist/views.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { View } from "@yaks/inspect";
|
|
2
|
+
// @ts-types="@yaks/ui/lucide"
|
|
3
|
+
import NotebookPen from "lucide/dist/esm/icons/notebook-pen.mjs";
|
|
4
|
+
/** The desk, the workshop and the bodies, as the inspector draws them. */ export declare let inspectViews: () => Promise<View[]>;
|
|
5
|
+
/** The tab a persona or a skill wears first, so it opens at the desk. */ export declare let tabs: readonly [{
|
|
6
|
+
readonly view: string;
|
|
7
|
+
readonly icon: string;
|
|
8
|
+
}];
|
|
9
|
+
/** The page the sidebar offers: every persona and skill, and the field that
|
|
10
|
+
* finds one. */ export declare let destinations: readonly [{
|
|
11
|
+
readonly key: string;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly icon: string;
|
|
14
|
+
readonly view: string;
|
|
15
|
+
}];
|
|
16
|
+
/** The glyph it wears there. */ export declare let icons: {
|
|
17
|
+
readonly 'notebook-pen': any;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.d.ts","sources":["../views.ts"],"names":[],"mappings":"AAKA,cAAc,IAAI,6BAAkC;AACpD,8BAA8B;AAC9B,OAAO,0DAAoE;AAE3E,wEAAwE,GACxE,OAAO,YAAI,oBAAmB,QAAQ,QACc;AAEpD,uEAAuE,GACvE,OAAO,YAAI;aAAU;aAAiB;KAAuB;AAE7D;cACc,GACd,OAAO,YAAI;aAEP;aACA;aACA;aACA;KAEH;AAED,8BAA8B,GAC9B,OAAO,YAAI;WAAU;EAA6B"}
|
package/_dist/vocab.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VocabDoc } from "@yaks/vocab";
|
|
2
|
+
import { personaDoc } from "./comp.js";
|
|
3
|
+
export { personaDoc };
|
|
4
|
+
/** What this package is: its manifest's description, the one place it is
|
|
5
|
+
* written, which a host stamps on each document here. */ export declare let description: string;
|
|
6
|
+
/** Every document this plugin declares. */ export declare let docs: VocabDoc[];
|
|
7
|
+
//# sourceMappingURL=vocab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab.d.ts","sources":["../vocab.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,2BAAgC;AACtD,SAAS,UAAU,oBAAmB;AAGtC,SAAS,UAAU,GAAE;AAErB;uDACuD,GACvD,OAAO,YAAI,aAAa,MAAM,CAAuB;AAErD,yCAAyC,GACzC,OAAO,YAAI,MAAM,WAAyB"}
|
package/_dist/voice.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Bundle } from "@yaks/graph";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
import { PART } from "./part.js";
|
|
4
|
+
export { PART };
|
|
5
|
+
/** A persona and the documents it is built from: both sets, already resolved
|
|
6
|
+
* and ordered, and the tools it offers. */ export type Worn = {
|
|
7
|
+
/** the persona itself — its `doc` body is the instruction text */ persona: Bundle;
|
|
8
|
+
/** the documents it includes: each body in full */ contains: Bundle[];
|
|
9
|
+
/** the documents it only mentions: one line apiece */ names: Bundle[];
|
|
10
|
+
/** the tools a session wearing it is offered: each registered tool
|
|
11
|
+
* (@yaks/tools' `tool{name}`) it or a persona it includes contains. Never
|
|
12
|
+
* part of its text. */ tools: Bundle[];
|
|
13
|
+
/** the saved queries a session wearing it is told the rows of when it
|
|
14
|
+
* starts and after each compaction: each `board{query}` (@yaks/project) it
|
|
15
|
+
* or a persona it includes contains. Resolved at delivery, never part of
|
|
16
|
+
* its text. */ queries: Bundle[];
|
|
17
|
+
};
|
|
18
|
+
/** The heading over the documents a persona only mentions by id. */ export declare let NAMED: string;
|
|
19
|
+
/**
|
|
20
|
+
* A persona as one markdown document. Takes the loaded vocabulary the bundles
|
|
21
|
+
* came from first — `let render = voice(vocab)`, then `render(worn)`.
|
|
22
|
+
*
|
|
23
|
+
* ```md
|
|
24
|
+
* # N-1 TaskMaster
|
|
25
|
+
*
|
|
26
|
+
* the instruction text itself
|
|
27
|
+
*
|
|
28
|
+
* ---
|
|
29
|
+
*
|
|
30
|
+
* # M-3 delegation discipline
|
|
31
|
+
*
|
|
32
|
+
* an included document, in full
|
|
33
|
+
*
|
|
34
|
+
* ---
|
|
35
|
+
*
|
|
36
|
+
* ## Reads
|
|
37
|
+
*
|
|
38
|
+
* Named here, not carried — ask the graph for one by id.
|
|
39
|
+
*
|
|
40
|
+
* - M-9 tickets carry signal
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* A pure function: give it bundles and it returns text. Where that text goes
|
|
44
|
+
* — a file, a repo, the system prompt of a spawned agent — is the caller's
|
|
45
|
+
* decision, which is why nothing here writes a file.
|
|
46
|
+
*/ export declare let voice: (vocab: Vocab) => (worn: Worn) => string;
|
|
47
|
+
//# sourceMappingURL=voice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice.d.ts","sources":["../voice.ts"],"names":[],"mappings":"AAkCA,cAAc,MAAM,2BAAsC;AAK1D,cAAc,KAAK,2BAAgC;AACnD,SAAS,IAAI,oBAAmB;AAChC,SAAS,IAAI,GAAE;AAEf;yCACyC,GACzC,YAAY;EACV,gEAAgE,GAChE,SAAS;EACT,iDAAiD,GACjD,UAAU;EACV,oDAAoD,GACpD,OAAO;EACP;;uBAEqB,GACrB,OAAO;EACP;;;eAGa,GACb,SAAS;;AAGX,kEAAkE,GAClE,OAAO,YAAI,cAAkB;AAe7B;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GACD,OAAO,YAAI,QAAS,OAAO,WAAS,MAAM,SAAS,MAAM,CAyBxD"}
|
package/_dist/worn.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Bundle, Eid, Storage } from "@yaks/graph";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
import type { Worn } from "./voice.js";
|
|
4
|
+
/** The relation whose far end is included in full. */ export declare let CONTAINS: string;
|
|
5
|
+
/** The relation whose far end is only listed by id. */ export declare let READS: string;
|
|
6
|
+
/** A registered tool (@yaks/tools): contained, it is offered, not said. */ export declare let TOOL: string;
|
|
7
|
+
/** A saved query (@yaks/project): contained, its rows are delivered, not its
|
|
8
|
+
* text. */ export declare let QUERY: string;
|
|
9
|
+
/** What composing a persona reads of a storage: queries, and entities by
|
|
10
|
+
* eid. A page hands it a storage over what it holds (@yaks/inspect's
|
|
11
|
+
* `useReading`), so the page composes with this very code. */ export type Reads = Pick<Storage, 'read' | 'get'>;
|
|
12
|
+
/**
|
|
13
|
+
* The order links are read in, the order an agent is given what they lead
|
|
14
|
+
* to: an edge's own `ord` where its author set one, then the entity it points
|
|
15
|
+
* at, so two unordered siblings never swap places between reads. A sort's
|
|
16
|
+
* comparator, for anything drawing them in that order.
|
|
17
|
+
*/ export declare let served: (a: Bundle, b: Bundle) => number;
|
|
18
|
+
/**
|
|
19
|
+
* The documents one persona is built from, read out of a storage. Returns
|
|
20
|
+
* `undefined` when the eid does not exist, or is not a persona — what to do
|
|
21
|
+
* about that is the caller's decision, since a tool call refuses while a
|
|
22
|
+
* report might not.
|
|
23
|
+
*
|
|
24
|
+
* ```ts ignore
|
|
25
|
+
* let worn = await wear(storage, vocab)('N-1')
|
|
26
|
+
* if (worn) console.log(voice(vocab)(worn))
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* A persona worn on a base (`persona.base`) is said base first, the base read
|
|
30
|
+
* from `bases` (by default the same storage): a platform's persona, say, under
|
|
31
|
+
* each space's own.
|
|
32
|
+
*
|
|
33
|
+
* Synchronous in, synchronous out: over an embedded database this returns a
|
|
34
|
+
* value directly, and over a storage that returns promises it returns a
|
|
35
|
+
* promise.
|
|
36
|
+
*/ export declare let wear: (storage: Reads, vocab: Vocab, bases?: Reads) => (eid: Eid) => Worn | undefined | Promise<Worn | undefined>;
|
|
37
|
+
/** The same persona in base-first order, preserving the boundary between
|
|
38
|
+
* layers for consumers that send them at different cache lifetimes. */ export declare let wearLayers: (storage: Reads, vocab: Vocab, bases?: Reads) => (eid: Eid) => Worn[] | Promise<Worn[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Several personas said as one: the first leads, and each after it is
|
|
41
|
+
* included the way a persona it contained would be — its text as a document,
|
|
42
|
+
* then the documents it includes, its tools offered with the rest — with
|
|
43
|
+
* nothing said twice. How a sub-project's agents hear the common persona of
|
|
44
|
+
* every project above theirs.
|
|
45
|
+
*/ export declare let fold: (head: Worn, ...more: Worn[]) => Worn;
|
|
46
|
+
/**
|
|
47
|
+
* What `w` says that `said` does not: a document `said` includes is dropped in
|
|
48
|
+
* both forms, and one it only names loses only its name, since including it in
|
|
49
|
+
* full still earns its place. `w` keeps its own lead and its tools, which are
|
|
50
|
+
* offered, not said, and its queries, whose rows are delivered. How a file
|
|
51
|
+
* read beside another avoids saying anything twice.
|
|
52
|
+
*/ export declare let beside: (w: Worn, said: Worn) => Worn;
|
|
53
|
+
/** The names of the tools a session wearing `w` is offered: nothing where it
|
|
54
|
+
* contains none, which leaves its runner's own set. */ export declare let offer: (w: Worn | undefined) => string[] | undefined;
|
|
55
|
+
//# sourceMappingURL=worn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worn.d.ts","sources":["../worn.ts"],"names":[],"mappings":"AA4CA,cAAc,MAAM,EAAE,GAAG,EAAE,OAAO,2BAAgC;AAGlE,cAAc,KAAK,2BAAgC;AAEnD,cAAc,IAAI,qBAAoB;AAEtC,oDAAoD,GACpD,OAAO,YAAI,iBAAqB;AAEhC,qDAAqD,GACrD,OAAO,YAAI,cAAe;AAE1B,yEAAyE,GACzE,OAAO,YAAI,aAAa;AAExB;SACS,GACT,OAAO,YAAI,cAAe;AAO1B;;4DAE4D,GAC5D,YAAY,QAAQ,KAAK,SAAS,SAAS;AAsB3C;;;;;CAKC,GAGD,OAAO,YAAI,SAAU,GAAG,QAAQ,GAAG,WAAS,MAAM,CACG;AAiBrD;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,YAAI,OACT,SAAS,OACT,OAAO,OACP,QAAO,WACL,KAAK,QAAQ,OAAO,SAAS,GAAG,QAAQ,OAAO,SAAS,EAI3D;AAED;qEACqE,GACrE,OAAO,YAAI,aACT,SAAS,OACT,OAAO,OACP,QAAO,WACL,KAAK,QAAQ,SAAS,QAAQ,QAmBjC;AAmGD;;;;;;CAMC,GACD,OAAO,YAAI,OAAQ,MAAM,MAAM,GAAG,MAAM,WAAS,KA0BhD;AAED;;;;;;CAMC,GACD,OAAO,YAAI,SAAU,GAAG,MAAM,MAAM,SAAO,KAU1C;AAED;qDACqD,GACrD,OAAO,YAAI,QAAS,GAAG,OAAO,SAAS,KAAG,MAAM,KAAK,SAAS,CAM7D"}
|