@graview/tools 0.1.66 → 0.1.67
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 +26 -0
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js.map +1 -1
- package/dist/design-agent.d.ts +62 -12
- package/dist/design-agent.d.ts.map +1 -1
- package/dist/design-agent.js +258 -58
- package/dist/design-agent.js.map +1 -1
- package/dist/draft-check.d.ts +61 -3
- package/dist/draft-check.d.ts.map +1 -1
- package/dist/draft-check.js +163 -16
- package/dist/draft-check.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inline-ai.d.ts.map +1 -1
- package/dist/inline-ai.js +10 -1
- package/dist/inline-ai.js.map +1 -1
- package/dist/section.d.ts +4 -4
- package/dist/section.d.ts.map +1 -1
- package/dist/section.js +2 -2
- package/dist/section.js.map +1 -1
- package/dist/tidy/blocking.d.ts +1 -1
- package/dist/tidy/blocking.d.ts.map +1 -1
- package/dist/tidy/blocking.js +10 -5
- package/dist/tidy/blocking.js.map +1 -1
- package/dist/tidy/dream.d.ts.map +1 -1
- package/dist/tidy/dream.js +5 -1
- package/dist/tidy/dream.js.map +1 -1
- package/dist/workflows/far.d.ts +17 -0
- package/dist/workflows/far.d.ts.map +1 -0
- package/dist/workflows/far.js +63 -0
- package/dist/workflows/far.js.map +1 -0
- package/dist/workflows/run-act.d.ts.map +1 -1
- package/dist/workflows/run-act.js +35 -1
- package/dist/workflows/run-act.js.map +1 -1
- package/dist/workflows/run-agent.d.ts.map +1 -1
- package/dist/workflows/run-agent.js +80 -14
- package/dist/workflows/run-agent.js.map +1 -1
- package/dist/workflows/run.d.ts.map +1 -1
- package/dist/workflows/run.js +84 -2
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/seat.d.ts +3 -1
- package/dist/workflows/seat.d.ts.map +1 -1
- package/dist/workflows/seat.js +1 -0
- package/dist/workflows/seat.js.map +1 -1
- package/dist/workflows/types.d.ts +126 -2
- package/dist/workflows/types.d.ts.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 +3 -3
package/dist/ai.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { ToldStore } from "@graview/core/told";
|
|
|
4
4
|
import type { ToolDefinition } from "./agent/tool-definition.js";
|
|
5
5
|
import type { Completion } from "./intelligence.js";
|
|
6
6
|
import type { Decide } from "./fast.js";
|
|
7
|
+
import type { DraftChecked } from "./draft-check.js";
|
|
7
8
|
/**
|
|
8
9
|
* THE AI A SEAT MAY USE, AS THE HOST DECIDED IT — once, in code.
|
|
9
10
|
*
|
|
@@ -121,6 +122,15 @@ export interface HostAi {
|
|
|
121
122
|
* Unsaid, the Thinking slot serves it.
|
|
122
123
|
*/
|
|
123
124
|
readonly design?: ThinkingProvider;
|
|
125
|
+
/**
|
|
126
|
+
* TOLD OF EACH DRAFT BETTER UI'S CHECKS JUDGED (Roadmap
|
|
127
|
+
* f-better-ui-draws-first-time): the part, which draft of the turn it
|
|
128
|
+
* was, whether it passed, and every finding whole with its kind
|
|
129
|
+
* (`record-lost`, `fact-lost`, `section-lost`, `did-not-draw` …) — what
|
|
130
|
+
* the agent was handed, for a host that logs why a draft failed. Never
|
|
131
|
+
* shown to a reader; a throw here is ignored.
|
|
132
|
+
*/
|
|
133
|
+
readonly onDraftChecked?: (checked: DraftChecked) => void;
|
|
124
134
|
/**
|
|
125
135
|
* WHETHER A CONTEXT MENU ASKS FOR SUGGESTIONS AS IT OPENS (FR-185). Only
|
|
126
136
|
* ever the Fast slot's: with no Fast slot a menu never asks on its own,
|
|
@@ -256,12 +266,28 @@ export interface AnswerRequest {
|
|
|
256
266
|
readonly said: string;
|
|
257
267
|
readonly answer: string;
|
|
258
268
|
};
|
|
269
|
+
/**
|
|
270
|
+
* Where the host asked to hear what a quick ask could not find
|
|
271
|
+
* (`HostAi.couldNotFind`): the framework's instruction, in words a model
|
|
272
|
+
* reads, to answer what this app does not keep as `lacks` (and `need`)
|
|
273
|
+
* rather than only that nothing was found. Unsaid otherwise.
|
|
274
|
+
*/
|
|
275
|
+
readonly couldNotFind?: string;
|
|
259
276
|
}
|
|
260
277
|
/** What the answer provider says: the answer in words, and the catalog's candidates that act on it, best first. */
|
|
261
278
|
export interface AnswerReply {
|
|
262
279
|
readonly text: string;
|
|
263
280
|
/** Candidate ids from the request's catalog; any other id is dropped. A change among them waits as a ghost. */
|
|
264
281
|
readonly pick?: readonly string[];
|
|
282
|
+
/**
|
|
283
|
+
* What the app does not keep for these words, in one whole sentence to the
|
|
284
|
+
* person ("This app keeps no budgets."): said on the card in place of
|
|
285
|
+
* `text`, and — with `HostAi.couldNotFind` — kept in the friction log
|
|
286
|
+
* (`unanswered`, with `lacks`) and told to the host's callback.
|
|
287
|
+
*/
|
|
288
|
+
readonly lacks?: string;
|
|
289
|
+
/** The field or link that would hold it, where the answer can say. */
|
|
290
|
+
readonly need?: PlanNeed;
|
|
265
291
|
readonly usage?: {
|
|
266
292
|
readonly inputTokens?: number;
|
|
267
293
|
readonly outputTokens?: number;
|
package/dist/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACnH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,O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AAI,MAAM,GAAG,SAAS,KAAG,OAA+F,CAAC;AAEnJ;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,GAAG,SAAS,KAAG,OAAuD,CAAC;AAEhH,iGAAiG;AACjG,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,GAAG,SAAS,KAAG,OAAmD,CAAC;AAE1G,yFAAyF;AACzF,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,sCAAsC;AACtC,eAAO,MAAM,KAAK,EAAE,MAAW,CAAC;AAEhC,2DAA2D;AAC3D,eAAO,MAAM,OAAO,GAAI,IAAI,MAAM,KAAG,OAAqG,CAAC;AAE3I,oEAAoE;AACpE,eAAO,MAAM,UAAU,wFAAwF,CAAC;AAEhH,6FAA6F;AAC7F,eAAO,MAAM,gBAAgB,qBAAqB,CAAC"}
|
package/dist/ai.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAmUA,gEAAgE;AAChE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAsB,EAAW,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;AAE3E,qJAAqJ;AACrJ,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAsB,EAAW,EAAE,CAC5D,EAAE,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;AAErM,kFAAkF;AAClF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAsB,EAAW,EAAE,CAAC,EAAE,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AAEnJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAsB,EAAW,EAAE,CAAC,EAAE,EAAE,aAAa,KAAK,KAAK,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC;AAEhH,iGAAiG;AACjG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAsB,EAAW,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,IAAI,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC;AAE1G,yFAAyF;AACzF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,sCAAsC;AACtC,MAAM,CAAC,MAAM,KAAK,GAAW,EAAE,CAAC;AAEhC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAU,EAAW,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AAE3I,oEAAoE;AACpE,MAAM,CAAC,MAAM,UAAU,GAAG,qFAAqF,CAAC;AAEhH,6FAA6F;AAC7F,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC"}
|
package/dist/design-agent.d.ts
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
import type { HostAi } from "./ai.js";
|
|
2
|
-
import { type DrawnRead } from "./draft-check.js";
|
|
2
|
+
import { type DraftFinding, type DrawnRead } from "./draft-check.js";
|
|
3
3
|
import { type ForkManifest, type PagePartSaid, type PageViewKeeps } from "./page-better.js";
|
|
4
4
|
import type { SectionStage } from "./section.js";
|
|
5
|
+
/**
|
|
6
|
+
* WHAT THE AGENT MAY DO IN ONE STEP, the whole set: look at the page
|
|
7
|
+
* again, read its records again, edit the script in place (exact find and
|
|
8
|
+
* replace pairs the code applies — a small change), draft the whole script
|
|
9
|
+
* (a redesign), say it is done, or ask the person.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DESIGN_AGENT_MOVES: readonly ["look", "read", "edit", "draft", "done", "ask"];
|
|
5
12
|
/** What the agent may do in one step. */
|
|
6
|
-
export type DesignAgentMove =
|
|
13
|
+
export type DesignAgentMove = (typeof DESIGN_AGENT_MOVES)[number];
|
|
14
|
+
/** One change of an edit: text found exactly once in the script, and what stands there instead. */
|
|
15
|
+
export interface ScriptEdit {
|
|
16
|
+
readonly find: string;
|
|
17
|
+
readonly replace: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* AN EDIT APPLIED BY THE CODE, NEVER BY THE MODEL (Roadmap
|
|
21
|
+
* f-better-ui-small-edits): each find looked for in the script as it stands
|
|
22
|
+
* after the edits before it, and replaced where it is there exactly once.
|
|
23
|
+
* One that is not there, or is there more than once, is said back in words
|
|
24
|
+
* the agent can act on ("appears 3 times …: quote more of the text around
|
|
25
|
+
* the place you mean") and nothing is applied. `where` names the script
|
|
26
|
+
* in those words ("the script on the page", "your last draft").
|
|
27
|
+
*/
|
|
28
|
+
export declare function applyEdits(source: string, edits: readonly ScriptEdit[], where: string): {
|
|
29
|
+
readonly source: string;
|
|
30
|
+
} | {
|
|
31
|
+
readonly findings: readonly string[];
|
|
32
|
+
};
|
|
7
33
|
/** An act a press may ask for on the records drawn. */
|
|
8
34
|
export interface ActToBind {
|
|
9
35
|
readonly act: string;
|
|
@@ -17,7 +43,9 @@ export interface ActToBind {
|
|
|
17
43
|
export interface DesignAgentStep {
|
|
18
44
|
readonly said: string;
|
|
19
45
|
readonly did: DesignAgentMove;
|
|
20
|
-
/**
|
|
46
|
+
/** With an edit: the changes it asked for, as it gave them. */
|
|
47
|
+
readonly edits?: readonly ScriptEdit[];
|
|
48
|
+
/** What came of it: what the page shows (look), the records (read), the checks' findings and what the draft drew (draft, edit). */
|
|
21
49
|
readonly result?: unknown;
|
|
22
50
|
}
|
|
23
51
|
/** A line of the conversation: the person's words or the agent's. */
|
|
@@ -44,9 +72,11 @@ export interface DesignAgentHost {
|
|
|
44
72
|
/** Told as the agent works: a step to show in the panel. */
|
|
45
73
|
export interface DesignAgentEvent {
|
|
46
74
|
/** `streaming`: the agent's words so far, as the model writes them — replaced by the next, and gone when the step is said. */
|
|
47
|
-
readonly kind: "look" | "read" | "draft" | "check" | "passed" | "said" | "streaming";
|
|
75
|
+
readonly kind: "look" | "read" | "edit" | "draft" | "check" | "passed" | "said" | "streaming" | "stuck";
|
|
48
76
|
/** In plain words, for the panel: "Looking at Tasks", "Check: dates lost on 3 tasks — fixing". */
|
|
49
77
|
readonly text: string;
|
|
78
|
+
/** With a check, and where it is stuck: what the checks found, each whole with its kind, as the agent was handed them. */
|
|
79
|
+
readonly findings?: readonly DraftFinding[];
|
|
50
80
|
}
|
|
51
81
|
export interface DesignAgentOptions {
|
|
52
82
|
readonly ai: HostAi;
|
|
@@ -72,6 +102,8 @@ export interface DesignAgentOptions {
|
|
|
72
102
|
readonly noun?: string;
|
|
73
103
|
/** A part of a view the person is changing: only it changes, every other part of the script kept as it is. */
|
|
74
104
|
readonly section?: string;
|
|
105
|
+
/** The headings of the part being changed: where the person asks for a heading's words to change, these may change, in their place. */
|
|
106
|
+
readonly rewordable?: readonly string[];
|
|
75
107
|
/** What the person is talking about, by its name ("Someday"), and what they pointed at, a line each: said beside their words, never in them. */
|
|
76
108
|
readonly about?: {
|
|
77
109
|
readonly name: string;
|
|
@@ -83,8 +115,10 @@ export interface DesignAgentOptions {
|
|
|
83
115
|
readonly pressed?: readonly string[];
|
|
84
116
|
}
|
|
85
117
|
export type DesignAgentResult = {
|
|
86
|
-
/** How the turn ended: the agent said it was done, asked the person something, ran out of steps, or
|
|
87
|
-
readonly ended: "done" | "ask" | "steps" | "stopped" | "no-model";
|
|
118
|
+
/** How the turn ended: the agent said it was done, asked the person something, ran out of steps, was stopped — or two drafts in a row failed the same way (`stuck`, said plainly in `said`). */
|
|
119
|
+
readonly ended: "done" | "ask" | "steps" | "stopped" | "no-model" | "stuck";
|
|
120
|
+
/** Stuck: whether the last draft drew, so a person may keep it anyway. */
|
|
121
|
+
readonly keepable?: boolean;
|
|
88
122
|
/** Its last words to the person. */
|
|
89
123
|
readonly said: string;
|
|
90
124
|
/** The last draft that passed this turn, shown on the page: none where nothing passed. */
|
|
@@ -103,24 +137,40 @@ export type DesignAgentResult = {
|
|
|
103
137
|
export declare const DESIGN_AGENT_STEPS = 12;
|
|
104
138
|
export declare const DESIGN_AGENT_SYSTEM: string;
|
|
105
139
|
/** What one request tells the agent: the page, the conversation, the steps it took this turn and what came of each. */
|
|
106
|
-
export declare function designAgentPrompt(options: Pick<DesignAgentOptions, "part" | "manifest" | "talk" | "keep" | "markup" | "current" | "section" | "about" | "acts" | "pressed"> & {
|
|
140
|
+
export declare function designAgentPrompt(options: Pick<DesignAgentOptions, "part" | "manifest" | "talk" | "keep" | "markup" | "current" | "section" | "about" | "acts" | "pressed" | "rewordable"> & {
|
|
107
141
|
readonly seen?: {
|
|
108
142
|
readonly look: unknown;
|
|
109
143
|
readonly read: unknown;
|
|
110
144
|
};
|
|
145
|
+
readonly lastDraft?: string;
|
|
111
146
|
}, steps: readonly DesignAgentStep[]): string;
|
|
112
|
-
/** One answer of the agent read
|
|
113
|
-
export
|
|
147
|
+
/** One answer of the agent, read. */
|
|
148
|
+
export interface AgentReply {
|
|
114
149
|
readonly say: string;
|
|
115
150
|
readonly do: DesignAgentMove;
|
|
151
|
+
/** With a draft: the whole script. */
|
|
116
152
|
readonly source?: string;
|
|
117
|
-
|
|
153
|
+
/** With an edit: its changes, in order. */
|
|
154
|
+
readonly edits?: readonly ScriptEdit[];
|
|
155
|
+
/** With an edit: the script it changes — the one on the page (the default) or its own last draft. */
|
|
156
|
+
readonly in?: "page" | "draft";
|
|
157
|
+
}
|
|
158
|
+
/** One answer of the agent read: what it said and did, with its script for a draft and its changes for an edit; undefined where it is not one. */
|
|
159
|
+
export declare function readAgentReply(text: string): AgentReply | undefined;
|
|
118
160
|
/**
|
|
119
161
|
* WHAT THE CHECKS FOUND, IN A FEW WORDS for the panel: "dates lost on 3
|
|
120
|
-
* tasks", "2 tasks missing", "
|
|
121
|
-
* is
|
|
162
|
+
* tasks", "2 tasks missing", "the part “This week” missing" — each by what
|
|
163
|
+
* it is (`findingKind`), and one with no name of its own in its own words,
|
|
164
|
+
* never a generic "it didn't draw". The agent is told the findings whole.
|
|
122
165
|
*/
|
|
123
166
|
export declare function checkSaid(findings: readonly string[], noun?: string): string;
|
|
167
|
+
/**
|
|
168
|
+
* WHERE A TURN IS STUCK, SAID PLAINLY: two drafts in a row failed the same
|
|
169
|
+
* way. "I tried twice, and the new design still loses details on 3 tasks.
|
|
170
|
+
* Keep it anyway, or stop?" — and, where the draft never drew, not offered
|
|
171
|
+
* to keep.
|
|
172
|
+
*/
|
|
173
|
+
export declare function stuckSaid(finding: string, keepable: boolean, noun?: string): string;
|
|
124
174
|
/**
|
|
125
175
|
* ONE TURN OF THE AGENT: from the person's last words, step by step — it
|
|
126
176
|
* looks, reads, drafts, is told what the checks found and what it drew,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-agent.d.ts","sourceRoot":"","sources":["../src/design-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,SAAS,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"design-agent.d.ts","sourceRoot":"","sources":["../src/design-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,SAAS,CAAC;AACxD,OAAO,EAAsD,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE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