@graview/tools 0.1.63 → 0.1.65
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/dist/ai.d.ts +19 -0
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js.map +1 -1
- package/dist/dev-ai.d.ts +4 -0
- package/dist/dev-ai.d.ts.map +1 -1
- package/dist/dev-ai.js +104 -8
- package/dist/dev-ai.js.map +1 -1
- package/dist/draft.d.ts +1 -0
- package/dist/draft.d.ts.map +1 -1
- package/dist/draft.js +2 -0
- package/dist/draft.js.map +1 -1
- package/dist/facts.d.ts +24 -0
- package/dist/facts.d.ts.map +1 -0
- package/dist/facts.js +48 -0
- package/dist/facts.js.map +1 -0
- package/dist/graph-plan.d.ts +178 -0
- package/dist/graph-plan.d.ts.map +1 -0
- package/dist/graph-plan.js +570 -0
- package/dist/graph-plan.js.map +1 -0
- package/dist/inline-ai.d.ts +41 -2
- package/dist/inline-ai.d.ts.map +1 -1
- package/dist/inline-ai.js +423 -12
- package/dist/inline-ai.js.map +1 -1
- package/dist/reshape.d.ts +55 -2
- package/dist/reshape.d.ts.map +1 -1
- package/dist/reshape.js +2 -0
- package/dist/reshape.js.map +1 -1
- package/dist/say-change.d.ts +59 -0
- package/dist/say-change.d.ts.map +1 -0
- package/dist/say-change.js +156 -0
- package/dist/say-change.js.map +1 -0
- package/dist/section.d.ts +120 -0
- package/dist/section.d.ts.map +1 -0
- package/dist/section.js +351 -0
- package/dist/section.js.map +1 -0
- package/dist/sentences.d.ts +13 -0
- package/dist/sentences.d.ts.map +1 -0
- package/dist/sentences.js +30 -0
- package/dist/sentences.js.map +1 -0
- package/dist/suggest.js +2 -2
- package/dist/suggest.js.map +1 -1
- package/dist/workflows/run-agent.d.ts.map +1 -1
- package/dist/workflows/run-agent.js +8 -4
- package/dist/workflows/run-agent.js.map +1 -1
- package/dist/workflows/run-classify.d.ts.map +1 -1
- package/dist/workflows/run-classify.js +22 -9
- package/dist/workflows/run-classify.js.map +1 -1
- package/dist/workflows/run.d.ts +1 -1
- package/dist/workflows/run.d.ts.map +1 -1
- package/dist/workflows/run.js +40 -2
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +51 -2
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/types.js +2 -1
- package/dist/workflows/types.js.map +1 -1
- package/dist/workflows.d.ts +2 -1
- package/dist/workflows.d.ts.map +1 -1
- package/dist/workflows.js +1 -0
- package/dist/workflows.js.map +1 -1
- package/package.json +7 -3
package/dist/facts.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type AnySchema, type Principal, type Store } from "@graview/core";
|
|
2
|
+
/**
|
|
3
|
+
* WHAT IS TRUE OF THE RECORDS, AS THE SEAT SEES THEM (Roadmap
|
|
4
|
+
* f-menu-type-anything). An open answer is only as true as what the model
|
|
5
|
+
* was told: "who is on this?" said nobody covered Monday open up while Ada
|
|
6
|
+
* did, because the model was told the shift's name and nothing it links.
|
|
7
|
+
* Each record the words are about is told with its fields and its links,
|
|
8
|
+
* each said as "covered by Ada Nowak" or "held by This week" — read from
|
|
9
|
+
* the store as this person sees it, so nothing they may not see is said.
|
|
10
|
+
*/
|
|
11
|
+
export interface RecordFacts {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly kind: string;
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly fields: Readonly<Record<string, unknown>>;
|
|
16
|
+
readonly links: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
/** The records' fields and links, as the person sees them, at most `limit` records and 12 links each. */
|
|
19
|
+
export declare function factsOf<S extends AnySchema>(store: Store<S>, principal: Principal, ids: readonly string[], today?: string, limit?: number): readonly RecordFacts[];
|
|
20
|
+
/** "2026-08-28" → "2026-08-28, Friday, 4 days ago, already past"; anything not a day, as it was. */
|
|
21
|
+
export declare function relativeDay(value: string, today: string): string;
|
|
22
|
+
/** Today as a model is told it: the day, its name. */
|
|
23
|
+
export declare function todayWords(today: string): string;
|
|
24
|
+
//# sourceMappingURL=facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facts.d.ts","sourceRoot":"","sources":["../src/facts.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAEnG;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,yGAAyG;AACzG,wBAAgB,OAAO,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,SAAS,WAAW,EAAE,CA4B9J;AAID,oGAAoG;AACpG,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAShE;AAED,sDAAsD;AACtD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
package/dist/facts.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { humanizeField, labelOf } from "@graview/core";
|
|
2
|
+
/** The records' fields and links, as the person sees them, at most `limit` records and 12 links each. */
|
|
3
|
+
export function factsOf(store, principal, ids, today, limit = 40) {
|
|
4
|
+
const seen = store.seenBy(principal).graph;
|
|
5
|
+
const schema = store.schema;
|
|
6
|
+
const name = (id) => {
|
|
7
|
+
const node = seen.getNode(id);
|
|
8
|
+
return node ? labelOf(schema.tryDefinition(node.kind), node) : undefined;
|
|
9
|
+
};
|
|
10
|
+
return ids.slice(0, limit).flatMap((id) => {
|
|
11
|
+
const node = seen.getNode(id);
|
|
12
|
+
if (!node)
|
|
13
|
+
return [];
|
|
14
|
+
const fields = Object.fromEntries(Object.entries(node)
|
|
15
|
+
.filter(([key, value]) => !["id", "kind", "label"].includes(key) && !key.startsWith("_") && value !== undefined && value !== null && (typeof value !== "object" || Array.isArray(value)) && JSON.stringify(value).length <= 200)
|
|
16
|
+
// A day said against today, as code reckons it: a light model's date arithmetic is not to be trusted.
|
|
17
|
+
.map(([key, value]) => [key, typeof value === "string" && today ? relativeDay(value, today) : value]));
|
|
18
|
+
const links = [
|
|
19
|
+
...seen.outEdges(id).flatMap((edge) => {
|
|
20
|
+
const other = name(edge.to);
|
|
21
|
+
return other ? [`${humanizeField(edge.kind).toLowerCase()} ${other}`] : [];
|
|
22
|
+
}),
|
|
23
|
+
...seen.inEdges(id).flatMap((edge) => {
|
|
24
|
+
const other = name(edge.from);
|
|
25
|
+
return other ? [`${humanizeField(edge.kind).toLowerCase()} it: ${other}`] : [];
|
|
26
|
+
}),
|
|
27
|
+
].slice(0, 12);
|
|
28
|
+
return [{ id, kind: node.kind, label: name(id) ?? id, fields, links }];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const DAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
32
|
+
/** "2026-08-28" → "2026-08-28, Friday, 4 days ago, already past"; anything not a day, as it was. */
|
|
33
|
+
export function relativeDay(value, today) {
|
|
34
|
+
const day = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value.slice(0, 10));
|
|
35
|
+
const now = /^(\d{4})-(\d{2})-(\d{2})$/.exec(today.slice(0, 10));
|
|
36
|
+
if (!day || !now || value.length !== 10)
|
|
37
|
+
return value;
|
|
38
|
+
const at = Date.UTC(Number(day[1]), Number(day[2]) - 1, Number(day[3]));
|
|
39
|
+
const from = Date.UTC(Number(now[1]), Number(now[2]) - 1, Number(now[3]));
|
|
40
|
+
const apart = Math.round((at - from) / 86_400_000);
|
|
41
|
+
const said = apart === 0 ? "today" : apart === 1 ? "tomorrow" : apart === -1 ? "yesterday, already past" : apart > 0 ? `in ${apart} days` : `${-apart} days ago, already past`;
|
|
42
|
+
return `${value}, ${DAYS[new Date(at).getUTCDay()]}, ${said}`;
|
|
43
|
+
}
|
|
44
|
+
/** Today as a model is told it: the day, its name. */
|
|
45
|
+
export function todayWords(today) {
|
|
46
|
+
return relativeDay(today, today).replace(/, today$/, "");
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=facts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facts.js","sourceRoot":"","sources":["../src/facts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAA8C,MAAM,eAAe,CAAC;AAmBnG,yGAAyG;AACzG,MAAM,UAAU,OAAO,CAAsB,KAAe,EAAE,SAAoB,EAAE,GAAsB,EAAE,KAAc,EAAE,KAAK,GAAG,EAAE;IACpI,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC;IAC3C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAmB,CAAC;IACzC,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAE;QAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACpF,CAAC,CAAC;IACF,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC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AC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,yBAAyB,CAAC;IAC/K,OAAO,GAAG,KAAK,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC;AAChE,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { type AnySchema, type Store } from "@graview/core";
|
|
2
|
+
import type { AiTarget, PlanNeed } from "@graview/core/catalog";
|
|
3
|
+
import type { TellingExample } from "@graview/core/told";
|
|
4
|
+
import type { FastProvider } from "./ai.js";
|
|
5
|
+
/**
|
|
6
|
+
* A PLAN OVER THE GRAPH, DECIDED BY THE FAST SLOT (Roadmap
|
|
7
|
+
* f-menu-type-anything). "Assign all these to Sam" is not an open question:
|
|
8
|
+
* with a typed graph its parts are typed decisions Jev answers in one call —
|
|
9
|
+
* which records (the list itself, or the records it holds), which act (or
|
|
10
|
+
* none of them), which person (one the app has, or someone new), and what
|
|
11
|
+
* the app would need where no act can do it — and code composes the plan
|
|
12
|
+
* from the answers. The Thinking slot is not called when Jev is sure.
|
|
13
|
+
*
|
|
14
|
+
* THE READING IS EXPLICIT. On a record that holds others — a list, a
|
|
15
|
+
* column, a group — "these", "all", "them", "each", "everything" mean the
|
|
16
|
+
* records it holds, and "this" or its name the record itself. Code offers
|
|
17
|
+
* both readings and the Fast slot picks; where the pick is close, the card
|
|
18
|
+
* says which it took in a line a reply can flip.
|
|
19
|
+
*/
|
|
20
|
+
/** Which records the words are about: the target itself, or what it holds. */
|
|
21
|
+
export interface Reading {
|
|
22
|
+
readonly which: "itself" | "held";
|
|
23
|
+
/** Which of the held records, where code can name a part of them: the done ones, the open ones, the late ones. */
|
|
24
|
+
readonly part?: "done" | "open" | "late";
|
|
25
|
+
readonly records: readonly string[];
|
|
26
|
+
readonly kind: string;
|
|
27
|
+
/** "the 6 tasks in This week", "This week itself". */
|
|
28
|
+
readonly words: string;
|
|
29
|
+
/** Whether the pick was close: the card then says the reading it took. */
|
|
30
|
+
readonly close: boolean;
|
|
31
|
+
/** How sure Jev was of it, where it chose among several. */
|
|
32
|
+
readonly chance?: number;
|
|
33
|
+
}
|
|
34
|
+
/** What the Fast slot decided, read by code: an act over the records, or what the app lacks — or not sure. */
|
|
35
|
+
export interface GraphDecision {
|
|
36
|
+
readonly sure: boolean;
|
|
37
|
+
readonly reading?: Reading;
|
|
38
|
+
readonly each?: {
|
|
39
|
+
readonly act: string;
|
|
40
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
41
|
+
};
|
|
42
|
+
readonly missing?: {
|
|
43
|
+
readonly said: string;
|
|
44
|
+
readonly need: PlanNeed;
|
|
45
|
+
readonly who?: string;
|
|
46
|
+
};
|
|
47
|
+
readonly text?: string;
|
|
48
|
+
/** Something to be done outside the app, said plainly: "I can't send email from here." */
|
|
49
|
+
readonly outside?: string;
|
|
50
|
+
/** Whether Jev read the words as asking (an answer in words) rather than telling (a change). */
|
|
51
|
+
readonly asks?: boolean;
|
|
52
|
+
/** A question back to the person before anything is offered: which records a destructive act was meant for. */
|
|
53
|
+
readonly clarify?: string;
|
|
54
|
+
/** The act Jev leaned to where code could not fill its values: the light model is told it first. */
|
|
55
|
+
readonly act?: string;
|
|
56
|
+
/** A person said as a pronoun, and whom it was taken as: "her" as Nora — said on the card so a reply can correct it. */
|
|
57
|
+
readonly taken?: {
|
|
58
|
+
readonly said: string;
|
|
59
|
+
readonly as: string;
|
|
60
|
+
};
|
|
61
|
+
readonly usage: {
|
|
62
|
+
readonly inputTokens: number;
|
|
63
|
+
readonly outputTokens: number;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** How sure the Fast slot must be to stand without the Thinking slot, and how sure before a reading goes unsaid. */
|
|
67
|
+
export declare const GRAPH_SURE = 0.6;
|
|
68
|
+
export declare const READING_SURE = 0.75;
|
|
69
|
+
/** The record a target holds others of: the biggest group of records linked to it, of one kind other than its own. */
|
|
70
|
+
export declare function heldBy<S extends AnySchema>(store: Store<S>, id: string): {
|
|
71
|
+
readonly kind: string;
|
|
72
|
+
readonly ids: readonly string[];
|
|
73
|
+
} | undefined;
|
|
74
|
+
/** The kinds that are the app's people: declared so, else by their words. */
|
|
75
|
+
export declare function peopleKinds<S extends AnySchema>(store: Store<S>): readonly string[];
|
|
76
|
+
/** The giving the words say, and to whom: "assign … to Sam" → "assigned to", "Sam". */
|
|
77
|
+
export declare function givingOf(words: string): {
|
|
78
|
+
readonly called: string;
|
|
79
|
+
readonly who?: string;
|
|
80
|
+
readonly owned?: boolean;
|
|
81
|
+
} | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* WORDS THE READING DOES NOT ACCOUNT FOR: a restrictive clause ("that's
|
|
84
|
+
* already ticked off", "which are late", "the ones I've done", "except…")
|
|
85
|
+
* or a narrowing adjective ("the old ones"), read against a reading of
|
|
86
|
+
* everything held. A part (done, open, late) accounts for its clause; all
|
|
87
|
+
* of them accounts for none.
|
|
88
|
+
*/
|
|
89
|
+
export declare function unaccounted(said: string, reading: {
|
|
90
|
+
readonly part?: string;
|
|
91
|
+
readonly which: string;
|
|
92
|
+
}): boolean;
|
|
93
|
+
export declare function decideOverTheGraph<S extends AnySchema>(fast: FastProvider, options: {
|
|
94
|
+
readonly store: Store<S>;
|
|
95
|
+
readonly target: AiTarget;
|
|
96
|
+
readonly said: string;
|
|
97
|
+
readonly members?: readonly string[];
|
|
98
|
+
readonly follows?: {
|
|
99
|
+
readonly said: string;
|
|
100
|
+
readonly reading?: "itself" | "held";
|
|
101
|
+
};
|
|
102
|
+
readonly where?: string;
|
|
103
|
+
readonly principal?: {
|
|
104
|
+
readonly id: string;
|
|
105
|
+
};
|
|
106
|
+
readonly examples?: readonly TellingExample[];
|
|
107
|
+
}): Promise<GraphDecision>;
|
|
108
|
+
/**
|
|
109
|
+
* TWO ASKS IN ONE SENTENCE: "archive the done ones, then close the rest" is
|
|
110
|
+
* two parts, each an instruction of its own. Split at "and", "then", ", then"
|
|
111
|
+
* or "; " only where each side begins with a verb-like word and says more
|
|
112
|
+
* than a word — so "assign these to Sam and Nora" and "rename it to Pack and
|
|
113
|
+
* Go" stay one.
|
|
114
|
+
*/
|
|
115
|
+
export declare function askedParts(said: string): readonly string[];
|
|
116
|
+
/**
|
|
117
|
+
* WORDS THAT NARROW TO DONE OR OPEN RECORDS, however they are said:
|
|
118
|
+
* "finished", "completed", "the done stuff", "ones I've done", "outstanding",
|
|
119
|
+
* "remaining", "unfinished", "still to do". A bare "open" ("open this") is a
|
|
120
|
+
* verb unless a reply narrows with it.
|
|
121
|
+
*/
|
|
122
|
+
export declare function narrowingOf(said: string, replying?: boolean): {
|
|
123
|
+
readonly open: boolean;
|
|
124
|
+
readonly finished: boolean;
|
|
125
|
+
};
|
|
126
|
+
/** Whether the words say which records: all of them, or the done or open ones. */
|
|
127
|
+
export declare function explicitReading(said: string): boolean;
|
|
128
|
+
/** "The old ones", "the urgent tasks": a word narrowing the records that is neither done nor open — code cannot say which those are. */
|
|
129
|
+
export declare function unreadNarrowing(said: string): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* HOW SURE JEV MUST BE of the records before an act that takes some away
|
|
132
|
+
* runs over several. Setting aside (archive, brought back by unarchive)
|
|
133
|
+
* runs at 0.75 where the words name every record ("these", "all",
|
|
134
|
+
* "everything"); removing — gone, not set aside — at 0.9, always.
|
|
135
|
+
*/
|
|
136
|
+
export declare function barFor(mutation: {
|
|
137
|
+
readonly destructive?: boolean;
|
|
138
|
+
readonly derived?: {
|
|
139
|
+
readonly act?: string;
|
|
140
|
+
};
|
|
141
|
+
}, said: string): number;
|
|
142
|
+
/** An act that removes or sets aside: one that must be meant for exactly the records it takes. */
|
|
143
|
+
export declare function removing(mutation: {
|
|
144
|
+
readonly destructive?: boolean;
|
|
145
|
+
readonly derived?: {
|
|
146
|
+
readonly act?: string;
|
|
147
|
+
};
|
|
148
|
+
}): boolean;
|
|
149
|
+
/** The words begin with an act done outside the app ("email the landlord", "text Bo", "call the van company") — not "call it X", a rename. */
|
|
150
|
+
export declare function outsideVerb(said: string): boolean;
|
|
151
|
+
/** "I can't send email from here." — and, where the record holds an email or a link, that it is there to open. */
|
|
152
|
+
export declare function outsideWords<S extends AnySchema>(store: Store<S>, said: string, id?: string): string;
|
|
153
|
+
/** Words that ask rather than tell: a question to answer, not an act to propose. */
|
|
154
|
+
export declare function asking(said: string): boolean;
|
|
155
|
+
/** An instruction said politely or indirectly: a request, not a question to answer in words. */
|
|
156
|
+
export declare function politely(said: string): boolean;
|
|
157
|
+
/** A rename said as a statement: "name should be X", "call it X", "X is a better name", "rename it to X" → "X". */
|
|
158
|
+
export declare function renameOf(said: string): string | undefined;
|
|
159
|
+
/** "Undo that": the app's own undo takes back the last change; no act here does. */
|
|
160
|
+
export declare const UNDOING: RegExp;
|
|
161
|
+
/** What an act does, said from what it declares: the fields it writes, the links it makes and breaks, what it makes or removes. */
|
|
162
|
+
export declare function effectOf(mutation: {
|
|
163
|
+
readonly name: string;
|
|
164
|
+
readonly writes?: readonly string[];
|
|
165
|
+
readonly sets?: Readonly<Record<string, unknown>>;
|
|
166
|
+
readonly connects?: readonly string[];
|
|
167
|
+
readonly severs?: readonly string[];
|
|
168
|
+
readonly creates?: readonly string[];
|
|
169
|
+
readonly destructive?: boolean;
|
|
170
|
+
readonly derived?: {
|
|
171
|
+
readonly act?: string;
|
|
172
|
+
};
|
|
173
|
+
readonly input?: unknown;
|
|
174
|
+
readonly subject?: {
|
|
175
|
+
readonly arg: string;
|
|
176
|
+
};
|
|
177
|
+
}, schema: AnySchema, kind: string): string;
|
|
178
|
+
//# sourceMappingURL=graph-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-plan.d.ts","sourceRoot":"","sources":["../src/graph-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+D,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AACxH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C;;;;;;;;;;;;;;GAcG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAAC;IAClC,kHAAkH;IAClH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CA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