@buoy-gg/shared-ui 7.0.35 → 7.0.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/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/icons/index.js +7 -0
- package/lib/commonjs/index.js +48 -0
- package/lib/commonjs/sync/keyedArrays.js +209 -0
- package/lib/commonjs/sync/toolAttention.test.js +51 -0
- package/lib/commonjs/sync/toolUiBridge.js +58 -0
- package/lib/commonjs/sync/typedEdit.js +228 -0
- package/lib/commonjs/sync/valuePath.js +337 -0
- package/lib/commonjs/sync/valueShape.js +161 -0
- package/lib/commonjs/ui/components/ExpandablePopover.js +38 -6
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/icons/index.js +3 -1
- package/lib/module/index.js +4 -0
- package/lib/module/sync/keyedArrays.js +204 -0
- package/lib/module/sync/toolAttention.test.js +50 -0
- package/lib/module/sync/toolUiBridge.js +55 -0
- package/lib/module/sync/typedEdit.js +220 -0
- package/lib/module/sync/valuePath.js +330 -0
- package/lib/module/sync/valueShape.js +153 -0
- package/lib/module/ui/components/ExpandablePopover.js +38 -6
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/sync/keyedArrays.d.ts +35 -0
- package/lib/typescript/commonjs/sync/keyedArrays.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/toolAttention.test.d.ts +2 -0
- package/lib/typescript/commonjs/sync/toolAttention.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/toolUiBridge.d.ts +25 -0
- package/lib/typescript/commonjs/sync/toolUiBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/sync/typedEdit.d.ts +70 -0
- package/lib/typescript/commonjs/sync/typedEdit.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/valuePath.d.ts +52 -0
- package/lib/typescript/commonjs/sync/valuePath.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/valueShape.d.ts +77 -0
- package/lib/typescript/commonjs/sync/valueShape.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ExpandablePopover.d.ts +14 -1
- package/lib/typescript/commonjs/ui/components/ExpandablePopover.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/icons/index.d.ts +1 -1
- package/lib/typescript/module/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +4 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/sync/keyedArrays.d.ts +35 -0
- package/lib/typescript/module/sync/keyedArrays.d.ts.map +1 -0
- package/lib/typescript/module/sync/toolAttention.test.d.ts +2 -0
- package/lib/typescript/module/sync/toolAttention.test.d.ts.map +1 -0
- package/lib/typescript/module/sync/toolUiBridge.d.ts +25 -0
- package/lib/typescript/module/sync/toolUiBridge.d.ts.map +1 -1
- package/lib/typescript/module/sync/typedEdit.d.ts +70 -0
- package/lib/typescript/module/sync/typedEdit.d.ts.map +1 -0
- package/lib/typescript/module/sync/valuePath.d.ts +52 -0
- package/lib/typescript/module/sync/valuePath.d.ts.map +1 -0
- package/lib/typescript/module/sync/valueShape.d.ts +77 -0
- package/lib/typescript/module/sync/valueShape.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ExpandablePopover.d.ts +14 -1
- package/lib/typescript/module/ui/components/ExpandablePopover.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The field that identifies items in this list, or undefined if there isn't one.
|
|
3
|
+
*
|
|
4
|
+
* Every item must carry it, and every value must be a distinct string/number —
|
|
5
|
+
* a duplicated id would make an addressed edit ambiguous, and silently picking
|
|
6
|
+
* the first match is exactly the kind of "helpful" guess that loses data.
|
|
7
|
+
*/
|
|
8
|
+
export declare function identityField(items: unknown[]): string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Let a caller address list items by their own id instead of resending the list.
|
|
11
|
+
*
|
|
12
|
+
* { lines: { "seed-1": { qty: 5 } } } change one field of one item
|
|
13
|
+
* { lines: { "seed-2": null } } remove that item
|
|
14
|
+
* { lines: { "new-1": { …all fields… } } } append (id not already present)
|
|
15
|
+
*
|
|
16
|
+
* WHY THIS EXISTS. Resending the whole array is correct only when the caller has
|
|
17
|
+
* SEEN the whole array, and reads are capped — so on a long list the honest
|
|
18
|
+
* agents refuse and the careless ones send back only the items they were shown,
|
|
19
|
+
* silently destroying the rest. Measured: with a 20-item bag truncated to 5, the
|
|
20
|
+
* whole-array form scored 0/9 across three models and one of them deleted 15
|
|
21
|
+
* lines without a word. Addressed edits scored 9/9. (`pnpm ai:array`.)
|
|
22
|
+
*
|
|
23
|
+
* It also makes mass deletion impossible BY OMISSION: `lines: []` empties a bag,
|
|
24
|
+
* but a keyed edit can only remove ids it names.
|
|
25
|
+
*
|
|
26
|
+
* Returns the patch with keyed objects expanded into real arrays, so everything
|
|
27
|
+
* downstream — the typed-edit guard, the receipt, the store write — is unchanged
|
|
28
|
+
* and keeps all of its protections.
|
|
29
|
+
*/
|
|
30
|
+
export declare function expandKeyedArrays(current: unknown, patch: unknown, path?: string, notes?: string[]): {
|
|
31
|
+
patch: unknown;
|
|
32
|
+
notes: string[];
|
|
33
|
+
error?: string;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=keyedArrays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyedArrays.d.ts","sourceRoot":"","sources":["../../../../src/sync/keyedArrays.ts"],"names":[],"mappings":"AAwBA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,SAAS,CAYlE;AA6CD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,IAAI,SAAK,EACT,KAAK,GAAE,MAAM,EAAO,GACnB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAyDrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolAttention.test.d.ts","sourceRoot":"","sources":["../../../../src/sync/toolAttention.test.ts"],"names":[],"mappings":""}
|
|
@@ -36,4 +36,29 @@ export declare function registerToolOpener(opener: ToolOpener): () => void;
|
|
|
36
36
|
export declare function openBuoyTool(toolId: string): boolean;
|
|
37
37
|
/** True when some host is listening — for deciding whether to offer the button. */
|
|
38
38
|
export declare function canOpenBuoyTools(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* "This tool needs you" — shown as a badge on its chip in the minimized rail.
|
|
41
|
+
*
|
|
42
|
+
* The case: Ask Buoy is minimized so a tester can watch the app, and the
|
|
43
|
+
* agent hits a step that needs a tap. Nobody can see the card. The sheet used
|
|
44
|
+
* to fail safe by DECLINING the change and ending the turn — which made
|
|
45
|
+
* minimize mean "stop", the opposite of what it is for. Now the approval
|
|
46
|
+
* holds, the chip gets a badge, and tapping the chip (the existing restore
|
|
47
|
+
* path) brings the card back. Same seam shape as the opener above: the rail
|
|
48
|
+
* lives inside the host, the tool cannot import the host, so it publishes
|
|
49
|
+
* through a global.
|
|
50
|
+
*
|
|
51
|
+
* `done` and `failed` cover the other thing a hidden tool cannot say — that
|
|
52
|
+
* the work you minimized it to wait for has finished.
|
|
53
|
+
*/
|
|
54
|
+
export type ToolAttention = {
|
|
55
|
+
kind: "needsInput" | "done" | "failed";
|
|
56
|
+
/** Read by screen readers and shown as the chip's accessibility label. */
|
|
57
|
+
label: string;
|
|
58
|
+
};
|
|
59
|
+
/** Set, replace or (with null) clear a tool's badge. No-op when nothing changed. */
|
|
60
|
+
export declare function setToolAttention(toolId: string, next: ToolAttention | null): void;
|
|
61
|
+
export declare function getToolAttention(toolId: string): ToolAttention | null;
|
|
62
|
+
/** For `useSyncExternalStore` in the rail. */
|
|
63
|
+
export declare function subscribeToolAttention(fn: () => void): () => void;
|
|
39
64
|
//# sourceMappingURL=toolUiBridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolUiBridge.d.ts","sourceRoot":"","sources":["../../../../src/sync/toolUiBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,sEAAsE;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AAUrD,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,IAAI,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CASpD;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}
|
|
1
|
+
{"version":3,"file":"toolUiBridge.d.ts","sourceRoot":"","sources":["../../../../src/sync/toolUiBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,sEAAsE;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AAUrD,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,IAAI,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CASpD;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAID;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;IACvC,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAcF,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAajF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAErE;AAED,8CAA8C;AAC9C,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAMjE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The typed-edit guard — ONE implementation, for every surface that takes a
|
|
3
|
+
* merge patch from a remote caller.
|
|
4
|
+
*
|
|
5
|
+
* The rule, which is the React Query devtools value-editor rule: you may change
|
|
6
|
+
* the VALUE of a field that already exists, to the same kind of thing. You may
|
|
7
|
+
* not add a field, change a field's type, or null a list or object the screen
|
|
8
|
+
* renders. A list may grow or shrink — carts are lists you add to — but every
|
|
9
|
+
* item in it must have the same fields as the items already there, because an
|
|
10
|
+
* item missing a field the others have is what crashes the list on render.
|
|
11
|
+
*
|
|
12
|
+
* WHY IT LIVES HERE. This existed twice, once in the zustand adapter and once in
|
|
13
|
+
* react-query, drifting slightly (one said "the ones already in the list", the
|
|
14
|
+
* other "the items"; only one had the did-you-mean hint). Jotai had NO copy at
|
|
15
|
+
* all, so `setAtom` accepted a string over a number or a one-item array over a
|
|
16
|
+
* fifty-item one with nothing to stop it. Three copies of a data-destroying
|
|
17
|
+
* safety rule is two more than anyone can keep in step — the same argument
|
|
18
|
+
* `keyedArrays.ts` makes about the expansion it owns.
|
|
19
|
+
*
|
|
20
|
+
* The one behavioural knob is `noun`: what to call the thing being edited in a
|
|
21
|
+
* refusal ("this store", "this data", "this atom"). Everything else is shared,
|
|
22
|
+
* deliberately — a rule that differs per surface is a rule nobody can state.
|
|
23
|
+
*/
|
|
24
|
+
/** The shape category the screen depends on: array vs object vs the rest. */
|
|
25
|
+
export declare function shapeKind(v: unknown): string;
|
|
26
|
+
export interface EditViolation {
|
|
27
|
+
path: string;
|
|
28
|
+
kind: "add-key" | "type-change" | "missing-key";
|
|
29
|
+
detail: string;
|
|
30
|
+
/** For an `add-key`: where a field of that name DOES live, if anywhere. */
|
|
31
|
+
movedTo?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Where a key actually lives in a nested value, as a dotted path — first match,
|
|
35
|
+
* breadth-first, capped so a huge payload cannot stall the walk.
|
|
36
|
+
*
|
|
37
|
+
* This is what turns "you put `name` at the top" into "`name` lives at
|
|
38
|
+
* `item.name`", which is the difference between a caller that gives up and one
|
|
39
|
+
* that fixes it. Ten of eleven measured `query` write failures were this exact
|
|
40
|
+
* mistake.
|
|
41
|
+
*/
|
|
42
|
+
export declare function findKeyPath(obj: unknown, key: string, maxNodes?: number): string | undefined;
|
|
43
|
+
export interface TypedEditOptions {
|
|
44
|
+
/** What a refusal calls the thing being edited: "store", "data", "atom". */
|
|
45
|
+
noun?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Every way this patch would break the value it is merged into. Empty means the
|
|
49
|
+
* edit is safe to apply.
|
|
50
|
+
*/
|
|
51
|
+
export declare function typedEditViolations(current: unknown, patch: unknown, opts?: TypedEditOptions, root?: unknown, path?: string, out?: EditViolation[]): EditViolation[];
|
|
52
|
+
/**
|
|
53
|
+
* The patch the caller should have sent, when every problem was a field written
|
|
54
|
+
* at the wrong DEPTH.
|
|
55
|
+
*
|
|
56
|
+
* The guard already worked out where each field really lives in order to say
|
|
57
|
+
* "did you mean `item.name`?", so it can rebuild the patch instead of leaving
|
|
58
|
+
* the caller to re-derive it from prose. Returns undefined unless EVERY
|
|
59
|
+
* violation is a relocatable add-key: a partial suggestion that silently drops
|
|
60
|
+
* the parts we could not fix would be worse than none, because the caller would
|
|
61
|
+
* send it, be refused again, and learn nothing.
|
|
62
|
+
*/
|
|
63
|
+
export declare function suggestedPatch(patch: unknown, violations: EditViolation[]): Record<string, unknown> | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* The sentence a refusal ends with. Shared so every surface refuses in the same
|
|
66
|
+
* words — a caller that learns the rule on one tool should recognise it on the
|
|
67
|
+
* next.
|
|
68
|
+
*/
|
|
69
|
+
export declare function refusalText(violations: EditViolation[], noun: string, suggestion?: Record<string, unknown>): string;
|
|
70
|
+
//# sourceMappingURL=typedEdit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typedEdit.d.ts","sourceRoot":"","sources":["../../../../src/sync/typedEdit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAK5C;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,GAAG,aAAa,GAAG,aAAa,CAAC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,SAAO,GAAG,MAAM,GAAG,SAAS,CAiB1F;AAED,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,IAAI,GAAE,gBAAqB,EAC3B,IAAI,GAAE,OAAiB,EACvB,IAAI,SAAK,EACT,GAAG,GAAE,aAAa,EAAO,GACxB,aAAa,EAAE,CA6EjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAoB/G;AAWD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAanH"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type PathSegment = {
|
|
2
|
+
kind: "key";
|
|
3
|
+
key: string;
|
|
4
|
+
} | {
|
|
5
|
+
kind: "index";
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* `[field=value]`. `field` may itself be dotted — `[stat.name=hp]` — because
|
|
10
|
+
* that is what models actually write when the thing identifying a row is
|
|
11
|
+
* nested inside it, and a list of `{stat: {name}, base_stat}` is an ordinary
|
|
12
|
+
* shape. Measured: grok reached for `stats[stat.name=hp].base_stat`
|
|
13
|
+
* unprompted on `edit-on-screen/edit-nested-field`.
|
|
14
|
+
*/
|
|
15
|
+
| {
|
|
16
|
+
kind: "match";
|
|
17
|
+
field: string;
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* `lines[0].addonIds`, `item.name`, `results[name=pikachu].url` → segments.
|
|
22
|
+
*
|
|
23
|
+
* Returns undefined for syntax it does not understand rather than doing
|
|
24
|
+
* something approximate with it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parsePath(path: string): PathSegment[] | undefined;
|
|
27
|
+
/** Read the value at `path`, or undefined if any step of it does not exist. */
|
|
28
|
+
export declare function readPath(value: unknown, path: string): {
|
|
29
|
+
ok: true;
|
|
30
|
+
value: unknown;
|
|
31
|
+
} | {
|
|
32
|
+
ok: false;
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Build the merge patch that sets `path` to `value`, against the data as it is
|
|
37
|
+
* now.
|
|
38
|
+
*
|
|
39
|
+
* The result is an ordinary merge patch, so it goes through the SAME typed-edit
|
|
40
|
+
* guard as a hand-written one and gains no new powers — `path` is a way to say
|
|
41
|
+
* the same thing without being able to get the depth wrong, not a way around
|
|
42
|
+
* the rules. A list step becomes the id-addressed form, so the write stays
|
|
43
|
+
* proof against a truncated read.
|
|
44
|
+
*/
|
|
45
|
+
export declare function patchFromPath(current: unknown, path: string, value: unknown): {
|
|
46
|
+
ok: true;
|
|
47
|
+
patch: Record<string, unknown>;
|
|
48
|
+
} | {
|
|
49
|
+
ok: false;
|
|
50
|
+
error: string;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=valuePath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valuePath.d.ts","sourceRoot":"","sources":["../../../../src/sync/valuePath.ts"],"names":[],"mappings":"AA6BA,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAClC;;;;;;GAMG;GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAuDpD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,SAAS,CAgCjE;AAED,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAiClH;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CA8F7E"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A compact type sketch of a runtime value — one implementation, shared by every
|
|
3
|
+
* adapter that hands data to a model.
|
|
4
|
+
*
|
|
5
|
+
* WHY. A model cannot write a well-formed item into a list it has never seen the
|
|
6
|
+
* shape of, and we were not showing it. Measured on `cart/bag-still-zustand`: the
|
|
7
|
+
* rendered prompt is 83,000 characters and the words `lineId`, `itemId`,
|
|
8
|
+
* `sizeId`, `addonIds` and `unitPrice` appear in it ZERO times. Every model
|
|
9
|
+
* "failing" that case invented a line shape because inventing was the only move
|
|
10
|
+
* available. The zustand typed-edit guard would have caught the invention — but
|
|
11
|
+
* only on a list that already holds an item, since it builds its template from
|
|
12
|
+
* `list[0]`. On an EMPTY list there is no template, the guard has nothing to
|
|
13
|
+
* compare against, and the invented shape is written silently.
|
|
14
|
+
*
|
|
15
|
+
* So the sketch has two jobs, and the second is the one that pays:
|
|
16
|
+
*
|
|
17
|
+
* 1. Say what the items in a list look like, so an addition can match.
|
|
18
|
+
* 2. Say when NOTHING knows — an empty list's item shape is not merely
|
|
19
|
+
* unread, it is unknowable from runtime state, and the honest answer is to
|
|
20
|
+
* admit that rather than let a guess through unremarked.
|
|
21
|
+
*
|
|
22
|
+
* It is deliberately tiny. A sketch of a 120-line bag is the same size as a
|
|
23
|
+
* sketch of a 2-line one, so unlike the data it survives the engine's 24,000-
|
|
24
|
+
* character result cap — which is the whole point, because the cases where the
|
|
25
|
+
* model most needs the shape are exactly the ones where the data got cut off.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* `{lineId: string, qty: number, addonIds: string[]}` — a one-line type for a
|
|
29
|
+
* value, built from the value itself.
|
|
30
|
+
*
|
|
31
|
+
* An array is described by its FIRST item, because a list whose items disagree
|
|
32
|
+
* is a list nothing can safely add to and the guard will say so anyway. An empty
|
|
33
|
+
* array is `unknown[]`, which is the true answer and the one that matters: it
|
|
34
|
+
* tells a reader that adding to this list is unchecked.
|
|
35
|
+
*/
|
|
36
|
+
export declare function shapeOf(value: unknown, depth?: number): string;
|
|
37
|
+
export interface ListShape {
|
|
38
|
+
/** Dotted path from the value's root: `lines`, `user.addresses`. */
|
|
39
|
+
path: string;
|
|
40
|
+
/** How many items are in it right now. */
|
|
41
|
+
length: number;
|
|
42
|
+
/** The item type, or undefined when the list is empty and nothing can know it. */
|
|
43
|
+
item?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Every list inside a value, with the shape of what goes in it.
|
|
47
|
+
*
|
|
48
|
+
* This is what a caller needs before adding to a list, and it is the part that
|
|
49
|
+
* cannot be recovered from a truncated read of the data itself.
|
|
50
|
+
*
|
|
51
|
+
* A list with `item: undefined` is the warning case: it is empty, so its item
|
|
52
|
+
* shape exists nowhere in the running app — not in the store, not in the
|
|
53
|
+
* persisted copy, not in this sketch. Anything added to it goes in unchecked.
|
|
54
|
+
*/
|
|
55
|
+
export declare function listShapes(value: unknown, path?: string, out?: ListShape[], depth?: number, budget?: {
|
|
56
|
+
visited: number;
|
|
57
|
+
}): ListShape[];
|
|
58
|
+
/** True when a sketch stopped early, so a caller can say so rather than imply completeness. */
|
|
59
|
+
export declare function shapesWereTruncated(value: unknown): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The lists in a value that a caller could add to WITHOUT any way to know the
|
|
62
|
+
* item shape. Empty by definition on a healthy value; non-empty means a write
|
|
63
|
+
* into one of these paths cannot be checked by anything.
|
|
64
|
+
*/
|
|
65
|
+
export declare function unshapedLists(value: unknown): string[];
|
|
66
|
+
/**
|
|
67
|
+
* The sketch an adapter attaches to a read: the value's own type, plus the item
|
|
68
|
+
* type of every list in it.
|
|
69
|
+
*
|
|
70
|
+
* Returns undefined when there is nothing worth saying (a scalar, or an object
|
|
71
|
+
* holding no lists) so adapters can spread it and add no noise.
|
|
72
|
+
*/
|
|
73
|
+
export declare function shapeSummary(value: unknown): {
|
|
74
|
+
shape: string;
|
|
75
|
+
lists?: ListShape[];
|
|
76
|
+
} | undefined;
|
|
77
|
+
//# sourceMappingURL=valueShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueShape.d.ts","sourceRoot":"","sources":["../../../../src/sync/valueShape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAkBH;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,SAAI,GAAG,MAAM,CAkBzD;AAED,MAAM,WAAW,SAAS;IACxB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,IAAI,SAAK,EACT,GAAG,GAAE,SAAS,EAAO,EACrB,KAAK,SAAI,EACT,MAAM,GAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAmB,GAC3C,SAAS,EAAE,CAwBb;AAED,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI3D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAItD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG,SAAS,CAM/F"}
|
|
@@ -33,6 +33,19 @@ export interface ExpandablePopoverProps {
|
|
|
33
33
|
testID?: string;
|
|
34
34
|
/** Handle for the collapse button at the bottom of the expanded panel. */
|
|
35
35
|
collapseTestID?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Something inside needs the user — drawn on the COLLAPSED peek too.
|
|
38
|
+
*
|
|
39
|
+
* A badge on a chip nobody can see is no badge: the dock folds to a
|
|
40
|
+
* peek tab, and a minimized tool's "needs your approval" was invisible
|
|
41
|
+
* until someone happened to expand it. `color` paints the dot; `glyph`
|
|
42
|
+
* (e.g. "!") sits inside it for the case that needs a tap.
|
|
43
|
+
*/
|
|
44
|
+
attention?: {
|
|
45
|
+
color: string;
|
|
46
|
+
glyph?: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
} | null;
|
|
36
49
|
}
|
|
37
|
-
export declare function ExpandablePopover({ hasItems, itemCount, showCount, width, children, expandedHeight, onExpandedChange, defaultExpanded, collapsedContent, collapsedLabel, expandedStyle, persistState, storageKey, peekHeight, testID, collapseTestID, }: ExpandablePopoverProps): React.JSX.Element | null;
|
|
50
|
+
export declare function ExpandablePopover({ hasItems, itemCount, showCount, width, children, expandedHeight, onExpandedChange, defaultExpanded, collapsedContent, collapsedLabel, attention, expandedStyle, persistState, storageKey, peekHeight, testID, collapseTestID, }: ExpandablePopoverProps): React.JSX.Element | null;
|
|
38
51
|
//# sourceMappingURL=ExpandablePopover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandablePopover.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ExpandablePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAML,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAQtB,MAAM,WAAW,sBAAsB;IACrC,mFAAmF;IACnF,QAAQ,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,8DAA8D;IAC9D,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,6BAA6B;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uCAAuC;IACvC,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpandablePopover.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ExpandablePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAML,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAQtB,MAAM,WAAW,sBAAsB;IACrC,mFAAmF;IACnF,QAAQ,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,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on";
|
|
21
21
|
export { IconBackground } from "./IconBackground";
|
|
22
22
|
export * from "./lucide-icons";
|
|
23
|
-
export { ActivityGlyph as Activity, AlertCircleGlyph as AlertCircle, AlertTriangleGlyph as AlertTriangle, BookmarkGlyph as Bookmark, BoxGlyph as Box, BugGlyph as Bug, CheckCircleGlyph as CheckCircle, CheckGlyph as Check, ChevronDownGlyph as ChevronDown, ChevronLeftGlyph as ChevronLeft, ChevronRightGlyph as ChevronRight, ChevronUpGlyph as ChevronUp, ClockGlyph as Clock, CopyGlyph as Copy, DatabaseGlyph as Database, DockBottomGlyph as DockBottom, DownloadGlyph as Download, Edit3Glyph as Edit3, EyeOffGlyph as EyeOff, EyeGlyph as Eye, FileJsonGlyph as FileJson, FileTextGlyph as FileText, FilmGlyph as Film, FilterGlyph as Filter, FlaskConicalGlyph as FlaskConical, FloatWindowGlyph as FloatWindow, GitBranchGlyph as GitBranch, GlobeGlyph as Globe, HashGlyph as Hash, HomeGlyph as Home, ImageGlyph as Image, InfoGlyph as Info, KeyGlyph as Key, LayersGlyph as Layers, LinkGlyph as Link, LockGlyph as Lock, MinusGlyph as Minus, MusicGlyph as Music, NavigationGlyph as Navigation, PaletteGlyph as Palette, PauseGlyph as Pause, PlayGlyph as Play, PlusGlyph as Plus, PowerGlyph as Power, RefreshCwGlyph as RefreshCw, SearchGlyph as Search, ServerGlyph as Server, SettingsGlyph as Settings, ShieldGlyph as Shield, Trash2Glyph as Trash2, Trash2Glyph as Trash, UnlockGlyph as Unlock, UploadGlyph as Upload, UserGlyph as User, WifiGlyph as Wifi, XCircleGlyph as XCircle, XGlyph as X, ZapGlyph as Zap, } from "@buoy-gg/floating-tools-core";
|
|
23
|
+
export { ActivityGlyph as Activity, AlertCircleGlyph as AlertCircle, AlertTriangleGlyph as AlertTriangle, BookmarkGlyph as Bookmark, BoxGlyph as Box, BugGlyph as Bug, CheckCircleGlyph as CheckCircle, CheckGlyph as Check, ChevronDownGlyph as ChevronDown, ChevronLeftGlyph as ChevronLeft, ChevronRightGlyph as ChevronRight, ChevronUpGlyph as ChevronUp, ClockGlyph as Clock, CopyGlyph as Copy, DatabaseGlyph as Database, DockBottomGlyph as DockBottom, DownloadGlyph as Download, Edit3Glyph as Edit3, EyeOffGlyph as EyeOff, EyeGlyph as Eye, FileJsonGlyph as FileJson, FileTextGlyph as FileText, FilmGlyph as Film, FilterGlyph as Filter, FlaskConicalGlyph as FlaskConical, FloatWindowGlyph as FloatWindow, GitBranchGlyph as GitBranch, GlobeGlyph as Globe, HashGlyph as Hash, HomeGlyph as Home, ImageGlyph as Image, InfoGlyph as Info, KeyGlyph as Key, LayersGlyph as Layers, LinkGlyph as Link, LockGlyph as Lock, MinusGlyph as Minus, MusicGlyph as Music, NavigationGlyph as Navigation, PaletteGlyph as Palette, PauseGlyph as Pause, PlayGlyph as Play, PlusGlyph as Plus, PowerGlyph as Power, RefreshCwGlyph as RefreshCw, SearchGlyph as Search, ServerGlyph as Server, SettingsGlyph as Settings, SettingsSolidIcon as SettingsSolid, ShieldGlyph as Shield, Trash2Glyph as Trash2, Trash2Glyph as Trash, UnlockGlyph as Unlock, UploadGlyph as Upload, UserGlyph as User, WifiGlyph as Wifi, XCircleGlyph as XCircle, XGlyph as X, ZapGlyph as Zap, } from "@buoy-gg/floating-tools-core";
|
|
24
24
|
export { SentryIcon, EventsIcon, RoutesIcon, RoutePinIcon, RoutePathIcon, RouteDotIcon, RouteTwoPinsIcon, CameraIcon, HighlightIcon, ReduxIcon, StorageIcon, AskBuoyIcon, HighlighterIcon, QueryIcon, ScenariosIcon } from "@buoy-gg/floating-tools-core";
|
|
25
25
|
export { WifiIcon as WifiBifIcon, BenchmarkIcon, BENCHMARK_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/icons/index.tsx"],"names":[],"mappings":"AACA,cAAc,cAA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jB,SAAS,IAAI,IAAI,EACjB,UAAU,IAAI,KAAK,EACnB,cAAc,IAAI,SAAS,EAC3B,WAAW,IAAI,MAAM,EACrB,WAAW,IAAI,MAAM,EACrB,aAAa,IAAI,QAAQ,EAEzB,iBAAiB,IAAI,aAAa,EAClC,WAAW,IAAI,MAAM,EACrB,WAAW,IAAI,MAAM,EAErB,WAAW,IAAI,KAAK,EACpB,WAAW,IAAI,MAAM,EACrB,WAAW,IAAI,MAAM,EACrB,SAAS,IAAI,IAAI,EACjB,SAAS,IAAI,IAAI,EACjB,YAAY,IAAI,OAAO,EACvB,MAAM,IAAI,CAAC,EACX,QAAQ,IAAI,GAAG,GAChB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG1P,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from "./ui";
|
|
2
2
|
export * from "./stores";
|
|
3
|
+
export * from "./sync/keyedArrays";
|
|
4
|
+
export * from "./sync/valueShape";
|
|
5
|
+
export * from "./sync/valuePath";
|
|
6
|
+
export * from "./sync/typedEdit";
|
|
3
7
|
export * from "./sync/wireBudget";
|
|
4
8
|
export * from "./sync/wireForm";
|
|
5
9
|
export * from "./sync/toolSyncAdapter";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,MAAM,CAAC;AAGrB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,C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AM,eAAe,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG7E,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC3R,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The field that identifies items in this list, or undefined if there isn't one.
|
|
3
|
+
*
|
|
4
|
+
* Every item must carry it, and every value must be a distinct string/number —
|
|
5
|
+
* a duplicated id would make an addressed edit ambiguous, and silently picking
|
|
6
|
+
* the first match is exactly the kind of "helpful" guess that loses data.
|
|
7
|
+
*/
|
|
8
|
+
export declare function identityField(items: unknown[]): string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Let a caller address list items by their own id instead of resending the list.
|
|
11
|
+
*
|
|
12
|
+
* { lines: { "seed-1": { qty: 5 } } } change one field of one item
|
|
13
|
+
* { lines: { "seed-2": null } } remove that item
|
|
14
|
+
* { lines: { "new-1": { …all fields… } } } append (id not already present)
|
|
15
|
+
*
|
|
16
|
+
* WHY THIS EXISTS. Resending the whole array is correct only when the caller has
|
|
17
|
+
* SEEN the whole array, and reads are capped — so on a long list the honest
|
|
18
|
+
* agents refuse and the careless ones send back only the items they were shown,
|
|
19
|
+
* silently destroying the rest. Measured: with a 20-item bag truncated to 5, the
|
|
20
|
+
* whole-array form scored 0/9 across three models and one of them deleted 15
|
|
21
|
+
* lines without a word. Addressed edits scored 9/9. (`pnpm ai:array`.)
|
|
22
|
+
*
|
|
23
|
+
* It also makes mass deletion impossible BY OMISSION: `lines: []` empties a bag,
|
|
24
|
+
* but a keyed edit can only remove ids it names.
|
|
25
|
+
*
|
|
26
|
+
* Returns the patch with keyed objects expanded into real arrays, so everything
|
|
27
|
+
* downstream — the typed-edit guard, the receipt, the store write — is unchanged
|
|
28
|
+
* and keeps all of its protections.
|
|
29
|
+
*/
|
|
30
|
+
export declare function expandKeyedArrays(current: unknown, patch: unknown, path?: string, notes?: string[]): {
|
|
31
|
+
patch: unknown;
|
|
32
|
+
notes: string[];
|
|
33
|
+
error?: string;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=keyedArrays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyedArrays.d.ts","sourceRoot":"","sources":["../../../../src/sync/keyedArrays.ts"],"names":[],"mappings":"AAwBA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,SAAS,CAYlE;AA6CD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,IAAI,SAAK,EACT,KAAK,GAAE,MAAM,EAAO,GACnB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAyDrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolAttention.test.d.ts","sourceRoot":"","sources":["../../../../src/sync/toolAttention.test.ts"],"names":[],"mappings":""}
|
|
@@ -36,4 +36,29 @@ export declare function registerToolOpener(opener: ToolOpener): () => void;
|
|
|
36
36
|
export declare function openBuoyTool(toolId: string): boolean;
|
|
37
37
|
/** True when some host is listening — for deciding whether to offer the button. */
|
|
38
38
|
export declare function canOpenBuoyTools(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* "This tool needs you" — shown as a badge on its chip in the minimized rail.
|
|
41
|
+
*
|
|
42
|
+
* The case: Ask Buoy is minimized so a tester can watch the app, and the
|
|
43
|
+
* agent hits a step that needs a tap. Nobody can see the card. The sheet used
|
|
44
|
+
* to fail safe by DECLINING the change and ending the turn — which made
|
|
45
|
+
* minimize mean "stop", the opposite of what it is for. Now the approval
|
|
46
|
+
* holds, the chip gets a badge, and tapping the chip (the existing restore
|
|
47
|
+
* path) brings the card back. Same seam shape as the opener above: the rail
|
|
48
|
+
* lives inside the host, the tool cannot import the host, so it publishes
|
|
49
|
+
* through a global.
|
|
50
|
+
*
|
|
51
|
+
* `done` and `failed` cover the other thing a hidden tool cannot say — that
|
|
52
|
+
* the work you minimized it to wait for has finished.
|
|
53
|
+
*/
|
|
54
|
+
export type ToolAttention = {
|
|
55
|
+
kind: "needsInput" | "done" | "failed";
|
|
56
|
+
/** Read by screen readers and shown as the chip's accessibility label. */
|
|
57
|
+
label: string;
|
|
58
|
+
};
|
|
59
|
+
/** Set, replace or (with null) clear a tool's badge. No-op when nothing changed. */
|
|
60
|
+
export declare function setToolAttention(toolId: string, next: ToolAttention | null): void;
|
|
61
|
+
export declare function getToolAttention(toolId: string): ToolAttention | null;
|
|
62
|
+
/** For `useSyncExternalStore` in the rail. */
|
|
63
|
+
export declare function subscribeToolAttention(fn: () => void): () => void;
|
|
39
64
|
//# sourceMappingURL=toolUiBridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolUiBridge.d.ts","sourceRoot":"","sources":["../../../../src/sync/toolUiBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,sEAAsE;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AAUrD,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,IAAI,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CASpD;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}
|
|
1
|
+
{"version":3,"file":"toolUiBridge.d.ts","sourceRoot":"","sources":["../../../../src/sync/toolUiBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,sEAAsE;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AAUrD,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,IAAI,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CASpD;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAID;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;IACvC,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAcF,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAajF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAErE;AAED,8CAA8C;AAC9C,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAMjE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The typed-edit guard — ONE implementation, for every surface that takes a
|
|
3
|
+
* merge patch from a remote caller.
|
|
4
|
+
*
|
|
5
|
+
* The rule, which is the React Query devtools value-editor rule: you may change
|
|
6
|
+
* the VALUE of a field that already exists, to the same kind of thing. You may
|
|
7
|
+
* not add a field, change a field's type, or null a list or object the screen
|
|
8
|
+
* renders. A list may grow or shrink — carts are lists you add to — but every
|
|
9
|
+
* item in it must have the same fields as the items already there, because an
|
|
10
|
+
* item missing a field the others have is what crashes the list on render.
|
|
11
|
+
*
|
|
12
|
+
* WHY IT LIVES HERE. This existed twice, once in the zustand adapter and once in
|
|
13
|
+
* react-query, drifting slightly (one said "the ones already in the list", the
|
|
14
|
+
* other "the items"; only one had the did-you-mean hint). Jotai had NO copy at
|
|
15
|
+
* all, so `setAtom` accepted a string over a number or a one-item array over a
|
|
16
|
+
* fifty-item one with nothing to stop it. Three copies of a data-destroying
|
|
17
|
+
* safety rule is two more than anyone can keep in step — the same argument
|
|
18
|
+
* `keyedArrays.ts` makes about the expansion it owns.
|
|
19
|
+
*
|
|
20
|
+
* The one behavioural knob is `noun`: what to call the thing being edited in a
|
|
21
|
+
* refusal ("this store", "this data", "this atom"). Everything else is shared,
|
|
22
|
+
* deliberately — a rule that differs per surface is a rule nobody can state.
|
|
23
|
+
*/
|
|
24
|
+
/** The shape category the screen depends on: array vs object vs the rest. */
|
|
25
|
+
export declare function shapeKind(v: unknown): string;
|
|
26
|
+
export interface EditViolation {
|
|
27
|
+
path: string;
|
|
28
|
+
kind: "add-key" | "type-change" | "missing-key";
|
|
29
|
+
detail: string;
|
|
30
|
+
/** For an `add-key`: where a field of that name DOES live, if anywhere. */
|
|
31
|
+
movedTo?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Where a key actually lives in a nested value, as a dotted path — first match,
|
|
35
|
+
* breadth-first, capped so a huge payload cannot stall the walk.
|
|
36
|
+
*
|
|
37
|
+
* This is what turns "you put `name` at the top" into "`name` lives at
|
|
38
|
+
* `item.name`", which is the difference between a caller that gives up and one
|
|
39
|
+
* that fixes it. Ten of eleven measured `query` write failures were this exact
|
|
40
|
+
* mistake.
|
|
41
|
+
*/
|
|
42
|
+
export declare function findKeyPath(obj: unknown, key: string, maxNodes?: number): string | undefined;
|
|
43
|
+
export interface TypedEditOptions {
|
|
44
|
+
/** What a refusal calls the thing being edited: "store", "data", "atom". */
|
|
45
|
+
noun?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Every way this patch would break the value it is merged into. Empty means the
|
|
49
|
+
* edit is safe to apply.
|
|
50
|
+
*/
|
|
51
|
+
export declare function typedEditViolations(current: unknown, patch: unknown, opts?: TypedEditOptions, root?: unknown, path?: string, out?: EditViolation[]): EditViolation[];
|
|
52
|
+
/**
|
|
53
|
+
* The patch the caller should have sent, when every problem was a field written
|
|
54
|
+
* at the wrong DEPTH.
|
|
55
|
+
*
|
|
56
|
+
* The guard already worked out where each field really lives in order to say
|
|
57
|
+
* "did you mean `item.name`?", so it can rebuild the patch instead of leaving
|
|
58
|
+
* the caller to re-derive it from prose. Returns undefined unless EVERY
|
|
59
|
+
* violation is a relocatable add-key: a partial suggestion that silently drops
|
|
60
|
+
* the parts we could not fix would be worse than none, because the caller would
|
|
61
|
+
* send it, be refused again, and learn nothing.
|
|
62
|
+
*/
|
|
63
|
+
export declare function suggestedPatch(patch: unknown, violations: EditViolation[]): Record<string, unknown> | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* The sentence a refusal ends with. Shared so every surface refuses in the same
|
|
66
|
+
* words — a caller that learns the rule on one tool should recognise it on the
|
|
67
|
+
* next.
|
|
68
|
+
*/
|
|
69
|
+
export declare function refusalText(violations: EditViolation[], noun: string, suggestion?: Record<string, unknown>): string;
|
|
70
|
+
//# sourceMappingURL=typedEdit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typedEdit.d.ts","sourceRoot":"","sources":["../../../../src/sync/typedEdit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GA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`field` may itself be dotted — `[stat.name=hp]` — because
|
|
10
|
+
* that is what models actually write when the thing identifying a row is
|
|
11
|
+
* nested inside it, and a list of `{stat: {name}, base_stat}` is an ordinary
|
|
12
|
+
* shape. Measured: grok reached for `stats[stat.name=hp].base_stat`
|
|
13
|
+
* unprompted on `edit-on-screen/edit-nested-field`.
|
|
14
|
+
*/
|
|
15
|
+
| {
|
|
16
|
+
kind: "match";
|
|
17
|
+
field: string;
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* `lines[0].addonIds`, `item.name`, `results[name=pikachu].url` → segments.
|
|
22
|
+
*
|
|
23
|
+
* Returns undefined for syntax it does not understand rather than doing
|
|
24
|
+
* something approximate with it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parsePath(path: string): PathSegment[] | undefined;
|
|
27
|
+
/** Read the value at `path`, or undefined if any step of it does not exist. */
|
|
28
|
+
export declare function readPath(value: unknown, path: string): {
|
|
29
|
+
ok: true;
|
|
30
|
+
value: unknown;
|
|
31
|
+
} | {
|
|
32
|
+
ok: false;
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Build the merge patch that sets `path` to `value`, against the data as it is
|
|
37
|
+
* now.
|
|
38
|
+
*
|
|
39
|
+
* The result is an ordinary merge patch, so it goes through the SAME typed-edit
|
|
40
|
+
* guard as a hand-written one and gains no new powers — `path` is a way to say
|
|
41
|
+
* the same thing without being able to get the depth wrong, not a way around
|
|
42
|
+
* the rules. A list step becomes the id-addressed form, so the write stays
|
|
43
|
+
* proof against a truncated read.
|
|
44
|
+
*/
|
|
45
|
+
export declare function patchFromPath(current: unknown, path: string, value: unknown): {
|
|
46
|
+
ok: true;
|
|
47
|
+
patch: Record<string, unknown>;
|
|
48
|
+
} | {
|
|
49
|
+
ok: false;
|
|
50
|
+
error: string;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=valuePath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valuePath.d.ts","sourceRoot":"","sources":["../../../../src/sync/valuePath.ts"],"names":[],"mappings":"AA6BA,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAClC;;;;;;GAMG;GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAuDpD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,SAAS,CAgCjE;AAED,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAiClH;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CA8F7E"}
|