@graview/primitives 0.1.0
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 +96 -0
- package/README.md +25 -0
- package/dist/arrange-bar.d.ts +49 -0
- package/dist/arrange-bar.d.ts.map +1 -0
- package/dist/arrange-bar.js +264 -0
- package/dist/arrange-bar.js.map +1 -0
- package/dist/chat.d.ts +46 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +343 -0
- package/dist/chat.js.map +1 -0
- package/dist/companion.d.ts +58 -0
- package/dist/companion.d.ts.map +1 -0
- package/dist/companion.js +433 -0
- package/dist/companion.js.map +1 -0
- package/dist/connections.d.ts +23 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +100 -0
- package/dist/connections.js.map +1 -0
- package/dist/default-views.d.ts +35 -0
- package/dist/default-views.d.ts.map +1 -0
- package/dist/default-views.js +605 -0
- package/dist/default-views.js.map +1 -0
- package/dist/editable.d.ts +71 -0
- package/dist/editable.d.ts.map +1 -0
- package/dist/editable.js +225 -0
- package/dist/editable.js.map +1 -0
- package/dist/figure.d.ts +30 -0
- package/dist/figure.d.ts.map +1 -0
- package/dist/figure.js +66 -0
- package/dist/figure.js.map +1 -0
- package/dist/find.d.ts +5 -0
- package/dist/find.d.ts.map +1 -0
- package/dist/find.js +252 -0
- package/dist/find.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/installation.d.ts +17 -0
- package/dist/installation.d.ts.map +1 -0
- package/dist/installation.js +37 -0
- package/dist/installation.js.map +1 -0
- package/dist/ladder.d.ts +2 -0
- package/dist/ladder.d.ts.map +1 -0
- package/dist/ladder.js +53 -0
- package/dist/ladder.js.map +1 -0
- package/dist/lens/arranging.d.ts +41 -0
- package/dist/lens/arranging.d.ts.map +1 -0
- package/dist/lens/arranging.js +38 -0
- package/dist/lens/arranging.js.map +1 -0
- package/dist/lens/board.d.ts +146 -0
- package/dist/lens/board.d.ts.map +1 -0
- package/dist/lens/board.js +658 -0
- package/dist/lens/board.js.map +1 -0
- package/dist/lens/calendar-dates.d.ts +19 -0
- package/dist/lens/calendar-dates.d.ts.map +1 -0
- package/dist/lens/calendar-dates.js +55 -0
- package/dist/lens/calendar-dates.js.map +1 -0
- package/dist/lens/calendar-drawing.d.ts +59 -0
- package/dist/lens/calendar-drawing.d.ts.map +1 -0
- package/dist/lens/calendar-drawing.js +229 -0
- package/dist/lens/calendar-drawing.js.map +1 -0
- package/dist/lens/calendar-options.d.ts +107 -0
- package/dist/lens/calendar-options.d.ts.map +1 -0
- package/dist/lens/calendar-options.js +19 -0
- package/dist/lens/calendar-options.js.map +1 -0
- package/dist/lens/calendar-placing.d.ts +35 -0
- package/dist/lens/calendar-placing.d.ts.map +1 -0
- package/dist/lens/calendar-placing.js +113 -0
- package/dist/lens/calendar-placing.js.map +1 -0
- package/dist/lens/calendar-spans.d.ts +48 -0
- package/dist/lens/calendar-spans.d.ts.map +1 -0
- package/dist/lens/calendar-spans.js +146 -0
- package/dist/lens/calendar-spans.js.map +1 -0
- package/dist/lens/calendar-view.d.ts +34 -0
- package/dist/lens/calendar-view.d.ts.map +1 -0
- package/dist/lens/calendar-view.js +228 -0
- package/dist/lens/calendar-view.js.map +1 -0
- package/dist/lens/calendar.d.ts +43 -0
- package/dist/lens/calendar.d.ts.map +1 -0
- package/dist/lens/calendar.js +43 -0
- package/dist/lens/calendar.js.map +1 -0
- package/dist/lens/coverage.d.ts +183 -0
- package/dist/lens/coverage.d.ts.map +1 -0
- package/dist/lens/coverage.js +732 -0
- package/dist/lens/coverage.js.map +1 -0
- package/dist/lens/horizon.d.ts +14 -0
- package/dist/lens/horizon.d.ts.map +1 -0
- package/dist/lens/horizon.js +20 -0
- package/dist/lens/horizon.js.map +1 -0
- package/dist/lens/more.d.ts +16 -0
- package/dist/lens/more.d.ts.map +1 -0
- package/dist/lens/more.js +17 -0
- package/dist/lens/more.js.map +1 -0
- package/dist/lens/plan-lens.d.ts +17 -0
- package/dist/lens/plan-lens.d.ts.map +1 -0
- package/dist/lens/plan-lens.js +24 -0
- package/dist/lens/plan-lens.js.map +1 -0
- package/dist/lens/plan-state.d.ts +122 -0
- package/dist/lens/plan-state.d.ts.map +1 -0
- package/dist/lens/plan-state.js +152 -0
- package/dist/lens/plan-state.js.map +1 -0
- package/dist/lens/plan-view.d.ts +10 -0
- package/dist/lens/plan-view.d.ts.map +1 -0
- package/dist/lens/plan-view.js +576 -0
- package/dist/lens/plan-view.js.map +1 -0
- package/dist/lens/plan.d.ts +25 -0
- package/dist/lens/plan.d.ts.map +1 -0
- package/dist/lens/plan.js +25 -0
- package/dist/lens/plan.js.map +1 -0
- package/dist/lens/reach.d.ts +47 -0
- package/dist/lens/reach.d.ts.map +1 -0
- package/dist/lens/reach.js +67 -0
- package/dist/lens/reach.js.map +1 -0
- package/dist/lens/timeline.d.ts +137 -0
- package/dist/lens/timeline.d.ts.map +1 -0
- package/dist/lens/timeline.js +426 -0
- package/dist/lens/timeline.js.map +1 -0
- package/dist/markup.d.ts +23 -0
- package/dist/markup.d.ts.map +1 -0
- package/dist/markup.js +24 -0
- package/dist/markup.js.map +1 -0
- package/dist/places.d.ts +24 -0
- package/dist/places.d.ts.map +1 -0
- package/dist/places.js +227 -0
- package/dist/places.js.map +1 -0
- package/dist/popover.d.ts +28 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +59 -0
- package/dist/popover.js.map +1 -0
- package/dist/primitives/index.d.ts +214 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +381 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/profile.d.ts +65 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +233 -0
- package/dist/profile.js.map +1 -0
- package/dist/quick-relations.d.ts +16 -0
- package/dist/quick-relations.d.ts.map +1 -0
- package/dist/quick-relations.js +183 -0
- package/dist/quick-relations.js.map +1 -0
- package/dist/relation-key.d.ts +44 -0
- package/dist/relation-key.d.ts.map +1 -0
- package/dist/relation-key.js +196 -0
- package/dist/relation-key.js.map +1 -0
- package/dist/seat.d.ts +137 -0
- package/dist/seat.d.ts.map +1 -0
- package/dist/seat.js +162 -0
- package/dist/seat.js.map +1 -0
- package/dist/seats.d.ts +21 -0
- package/dist/seats.d.ts.map +1 -0
- package/dist/seats.js +62 -0
- package/dist/seats.js.map +1 -0
- package/dist/seeding.d.ts +150 -0
- package/dist/seeding.d.ts.map +1 -0
- package/dist/seeding.js +538 -0
- package/dist/seeding.js.map +1 -0
- package/dist/shell.d.ts +74 -0
- package/dist/shell.d.ts.map +1 -0
- package/dist/shell.js +86 -0
- package/dist/shell.js.map +1 -0
- package/dist/theme.d.ts +50 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +1692 -0
- package/dist/theme.js.map +1 -0
- package/dist/wordmark.d.ts +15 -0
- package/dist/wordmark.d.ts.map +1 -0
- package/dist/wordmark.js +55 -0
- package/dist/wordmark.js.map +1 -0
- package/dist/workbench/activity.d.ts +75 -0
- package/dist/workbench/activity.d.ts.map +1 -0
- package/dist/workbench/activity.js +259 -0
- package/dist/workbench/activity.js.map +1 -0
- package/dist/workbench/agent-seat.d.ts +51 -0
- package/dist/workbench/agent-seat.d.ts.map +1 -0
- package/dist/workbench/agent-seat.js +112 -0
- package/dist/workbench/agent-seat.js.map +1 -0
- package/dist/workbench/answer-args.d.ts +31 -0
- package/dist/workbench/answer-args.d.ts.map +1 -0
- package/dist/workbench/answer-args.js +257 -0
- package/dist/workbench/answer-args.js.map +1 -0
- package/dist/workbench/back-out.d.ts +71 -0
- package/dist/workbench/back-out.d.ts.map +1 -0
- package/dist/workbench/back-out.js +238 -0
- package/dist/workbench/back-out.js.map +1 -0
- package/dist/workbench/following.d.ts +7 -0
- package/dist/workbench/following.d.ts.map +1 -0
- package/dist/workbench/following.js +26 -0
- package/dist/workbench/following.js.map +1 -0
- package/dist/workbench/index.d.ts +23 -0
- package/dist/workbench/index.d.ts.map +1 -0
- package/dist/workbench/index.js +23 -0
- package/dist/workbench/index.js.map +1 -0
- package/dist/workbench/inspector.d.ts +27 -0
- package/dist/workbench/inspector.d.ts.map +1 -0
- package/dist/workbench/inspector.js +745 -0
- package/dist/workbench/inspector.js.map +1 -0
- package/dist/workbench/standing.d.ts +16 -0
- package/dist/workbench/standing.d.ts.map +1 -0
- package/dist/workbench/standing.js +102 -0
- package/dist/workbench/standing.js.map +1 -0
- package/dist/workbench/trail.d.ts +35 -0
- package/dist/workbench/trail.d.ts.map +1 -0
- package/dist/workbench/trail.js +150 -0
- package/dist/workbench/trail.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAeH;;;;;;;GAOG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGlE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,IAAI,EAAE,SAAS;IACf,UAAU,EAAE;QACV,IAAI,EAAE,iEAAiE;QACvE,IAAI,EAAE,2DAA2D;KAClE;IACD,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,QAAQ,GAAsC;IAClD,MAAM,EAAE,kBAAkB;IAC1B,UAAU,EAAE,uBAAuB;IACnC,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;IACxB,UAAU,EAAE,uBAAuB;IACnC,YAAY,EAAE,yBAAyB;IACvC,IAAI,EAAE,gBAAgB;IACtB,UAAU,EAAE,uBAAuB;IACnC,GAAG,EAAE,eAAe;IACpB,QAAQ,EAAE,qBAAqB;IAC/B,QAAQ,EAAE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAiM1D,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;iDAoBN,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;;;;;;;;;;;;;;gBAclE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,MAAM;;;;;;gBAOzE,MAAM,KAAK,OAAO;QAChB,CAAC,CAAC,oEAAoE;QACtE,CAAC,CAAC,0EACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiNA,SAAS,CAAC,GAAG,UAAU,oCAAoC,EAAE,IAAI,CAAC;;EAElE,SAAS,CAAC,GAAG,UAAU,gCAAgC,EAAE,IAAI,CAAC;CAC/D,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AnySchema } from "@graview/core";
|
|
2
|
+
/**
|
|
3
|
+
* Whose product this is.
|
|
4
|
+
*
|
|
5
|
+
* The name and the logo come from the declared brand, alongside the palette
|
|
6
|
+
* and the typography, because they are one decision — a brand handing over a
|
|
7
|
+
* hex code has not given you a theme, and one handing over a logo without a
|
|
8
|
+
* colour has not either. An app that declares nothing gets the framework's
|
|
9
|
+
* own, which is an ordinary declared brand like any other.
|
|
10
|
+
*
|
|
11
|
+
* The logo is inline SVG using `currentColor` by convention, so one file
|
|
12
|
+
* works in both schemes.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Wordmark<S extends AnySchema>(): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=wordmark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wordmark.d.ts","sourceRoot":"","sources":["../src/wordmark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK/C;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,iCAqD3C"}
|
package/dist/wordmark.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useGraview } from "@graview/react";
|
|
3
|
+
import { useMarkup } from "./markup.js";
|
|
4
|
+
import { GRAVIEW_BRAND } from "./theme.js";
|
|
5
|
+
/**
|
|
6
|
+
* Whose product this is.
|
|
7
|
+
*
|
|
8
|
+
* The name and the logo come from the declared brand, alongside the palette
|
|
9
|
+
* and the typography, because they are one decision — a brand handing over a
|
|
10
|
+
* hex code has not given you a theme, and one handing over a logo without a
|
|
11
|
+
* colour has not either. An app that declares nothing gets the framework's
|
|
12
|
+
* own, which is an ordinary declared brand like any other.
|
|
13
|
+
*
|
|
14
|
+
* The logo is inline SVG using `currentColor` by convention, so one file
|
|
15
|
+
* works in both schemes.
|
|
16
|
+
*/
|
|
17
|
+
export function Wordmark() {
|
|
18
|
+
const { brand: declared, homeView, setView, setSelection, setMenuAt } = useGraview();
|
|
19
|
+
const brand = declared ?? GRAVIEW_BRAND;
|
|
20
|
+
const logo = useMarkup(brand.logo);
|
|
21
|
+
return (_jsxs("button", { type: "button", className: "graview-wordmark", "data-testid": "wordmark",
|
|
22
|
+
/*
|
|
23
|
+
* The logo is the way HOME, the way it is on every site. It returns to
|
|
24
|
+
* the view the app opened on — focus, relation, zoom and camera reset,
|
|
25
|
+
* selection cleared. The cards someone deliberately pinned stay
|
|
26
|
+
* pinned: going home is not tidying their desk.
|
|
27
|
+
*/
|
|
28
|
+
title: `${brand.name} — back to the start`, onClick: () => {
|
|
29
|
+
setView((current) => ({ ...homeView, pins: current.pins }));
|
|
30
|
+
setSelection([]);
|
|
31
|
+
setMenuAt(null);
|
|
32
|
+
}, style: {
|
|
33
|
+
display: "inline-flex",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
gap: 7,
|
|
36
|
+
fontSize: "0.75rem",
|
|
37
|
+
letterSpacing: "0.3em",
|
|
38
|
+
textTransform: "uppercase",
|
|
39
|
+
color: "var(--graview-ink-muted)",
|
|
40
|
+
whiteSpace: "nowrap",
|
|
41
|
+
// A control now, so it is at least a fingertip tall — the letters
|
|
42
|
+
// stay exactly where they were.
|
|
43
|
+
minHeight: 24,
|
|
44
|
+
border: "none",
|
|
45
|
+
background: "none",
|
|
46
|
+
padding: 0,
|
|
47
|
+
boxShadow: "none",
|
|
48
|
+
cursor: "pointer",
|
|
49
|
+
}, children: [brand.logo ? (_jsx("span", { "aria-hidden": "true", style: { display: "inline-flex", color: "var(--graview-accent)" },
|
|
50
|
+
// The logo is the brand's own markup. It is declared by the
|
|
51
|
+
// installation, not supplied by a user, which is the difference
|
|
52
|
+
// between this and rendering arbitrary HTML.
|
|
53
|
+
dangerouslySetInnerHTML: logo })) : null, brand.name] }));
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=wordmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wordmark.js","sourceRoot":"","sources":["../src/wordmark.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,QAAQ;IACtB,MAAM,EAAE,KAAK,EAAE,QAA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,EACP,KAAK,CAAC,IAAI,IACJ,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ToolCall } from "@graview/tools";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export interface Change {
|
|
4
|
+
readonly intent: string;
|
|
5
|
+
readonly author: string;
|
|
6
|
+
/** The author's own id, for seats that are not the person at the keyboard. */
|
|
7
|
+
readonly authorId?: string;
|
|
8
|
+
readonly touched: readonly string[];
|
|
9
|
+
readonly batch: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The last few changes, with who made them — READ FROM THE LOG, not
|
|
13
|
+
* accumulated from a subscription.
|
|
14
|
+
*
|
|
15
|
+
* The difference showed up the moment the desk started recording its own
|
|
16
|
+
* navigation: opening an app unmounts the rail, so the subscription version
|
|
17
|
+
* lost exactly the change it had just made, and anything that happened before
|
|
18
|
+
* the rail first mounted had never been there at all. The op log is the
|
|
19
|
+
* state; deriving from it means nothing is lost by a component coming and
|
|
20
|
+
* going, which is the whole reason history is a fold rather than a stack.
|
|
21
|
+
*
|
|
22
|
+
* A human edit and an agent edit render the same way, because the log cannot
|
|
23
|
+
* tell them apart.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useRecentChanges(limit?: number): readonly Change[];
|
|
26
|
+
/**
|
|
27
|
+
* Drop one turn, keeping everything since.
|
|
28
|
+
*
|
|
29
|
+
* Undoing out of order is legal exactly when no later live op read something
|
|
30
|
+
* it wrote — a checkable condition rather than a policy — so when it fails
|
|
31
|
+
* the button says how many other turns would have to come along, which is
|
|
32
|
+
* what the check already returns.
|
|
33
|
+
*/
|
|
34
|
+
export declare function UndoTurn({ batch }: {
|
|
35
|
+
readonly batch: string;
|
|
36
|
+
}): import("react").JSX.Element | null;
|
|
37
|
+
/**
|
|
38
|
+
* What has happened, and what is happening: the agent's tool calls and every
|
|
39
|
+
* applied change, in one list.
|
|
40
|
+
*
|
|
41
|
+
* A diff says what CHANGED and never what was considered, so an agent turn
|
|
42
|
+
* without this is a spinner and a toast. Reads are the interesting half.
|
|
43
|
+
* Every node named here is a target, so checking the work is one click.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* The way back to the example.
|
|
47
|
+
*
|
|
48
|
+
* An app that remembers its edits in the browser needs a visible way OUT of
|
|
49
|
+
* them: a demo that can be edited into a corner with no exit teaches
|
|
50
|
+
* distrust, and "clear your site data" is not an affordance. The control
|
|
51
|
+
* goes to the same address with `fresh=1` — the framework's own convention,
|
|
52
|
+
* read by `browserStartsFresh` in `@graview/ship` — so it is a navigation
|
|
53
|
+
* like any other stop: the seed loads, the flag is dropped from the address,
|
|
54
|
+
* and what you do next is remembered again.
|
|
55
|
+
*/
|
|
56
|
+
export declare function StartFresh(): import("react").JSX.Element;
|
|
57
|
+
export declare function ActivityRail({ calls, seat, remembers, }: {
|
|
58
|
+
readonly calls: readonly ToolCall[];
|
|
59
|
+
/**
|
|
60
|
+
* Whether this browser is remembering the edits. When it is, the popover
|
|
61
|
+
* says so and carries the way back to the example — history is where you
|
|
62
|
+
* would look for the way out of it.
|
|
63
|
+
*/
|
|
64
|
+
readonly remembers?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The agent seat, if the app gives one. It lives HERE, not in the bar:
|
|
67
|
+
* Activity is "what has happened, and what is happening", which is the
|
|
68
|
+
* agent's own surface and where you would be looking to watch a turn —
|
|
69
|
+
* and a run-a-turn control that is disabled most of the time was a
|
|
70
|
+
* permanently-visible ghost in prime bar space. See the recorded
|
|
71
|
+
* decision on the PRD task "Decide where the agent seat lives".
|
|
72
|
+
*/
|
|
73
|
+
readonly seat?: ReactNode;
|
|
74
|
+
}): import("react").JSX.Element | null;
|
|
75
|
+
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/workbench/activity.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM7E,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,SAAI,GAAG,SAAS,MAAM,EAAE,CAiB7D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,sCAgF7D;AAED;;;;;;;GAOG;AACH;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,gCAmCzB;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,SAAiB,GAClB,EAAE;IACD,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;CAC3B,sCAsQA"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { humaniseField, nameOfAuthor } from "@graview/core";
|
|
3
|
+
import { useGraph, useGraview } from "@graview/react";
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { Chip } from "../primitives/index.js";
|
|
6
|
+
import { nameOf } from "./answer-args.js";
|
|
7
|
+
import { closeToTrigger } from "../popover.js";
|
|
8
|
+
/**
|
|
9
|
+
* The last few changes, with who made them — READ FROM THE LOG, not
|
|
10
|
+
* accumulated from a subscription.
|
|
11
|
+
*
|
|
12
|
+
* The difference showed up the moment the desk started recording its own
|
|
13
|
+
* navigation: opening an app unmounts the rail, so the subscription version
|
|
14
|
+
* lost exactly the change it had just made, and anything that happened before
|
|
15
|
+
* the rail first mounted had never been there at all. The op log is the
|
|
16
|
+
* state; deriving from it means nothing is lost by a component coming and
|
|
17
|
+
* going, which is the whole reason history is a fold rather than a stack.
|
|
18
|
+
*
|
|
19
|
+
* A human edit and an agent edit render the same way, because the log cannot
|
|
20
|
+
* tell them apart.
|
|
21
|
+
*/
|
|
22
|
+
export function useRecentChanges(limit = 4) {
|
|
23
|
+
const { store } = useGraview();
|
|
24
|
+
const nodes = useGraph();
|
|
25
|
+
return useMemo(() => [...store.batches()]
|
|
26
|
+
.reverse()
|
|
27
|
+
.slice(0, limit)
|
|
28
|
+
.map((batch) => ({
|
|
29
|
+
intent: batch.intent,
|
|
30
|
+
author: batch.author.kind,
|
|
31
|
+
...(batch.author.id ? { authorId: batch.author.id } : {}),
|
|
32
|
+
touched: [...new Set(batch.ops.flatMap((op) => op.writes))],
|
|
33
|
+
batch: batch.id,
|
|
34
|
+
})), [store, nodes, limit]);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Drop one turn, keeping everything since.
|
|
38
|
+
*
|
|
39
|
+
* Undoing out of order is legal exactly when no later live op read something
|
|
40
|
+
* it wrote — a checkable condition rather than a policy — so when it fails
|
|
41
|
+
* the button says how many other turns would have to come along, which is
|
|
42
|
+
* what the check already returns.
|
|
43
|
+
*/
|
|
44
|
+
export function UndoTurn({ batch }) {
|
|
45
|
+
/*
|
|
46
|
+
* WHO IS UNDOING. Undo is a change and the store judges it like one —
|
|
47
|
+
* "what you may undo is what you may have done" — so it has to be told
|
|
48
|
+
* who is asking, exactly as every act taken from the strip is. It was not:
|
|
49
|
+
* the control called `store.undo(batch)` with no author, so the store
|
|
50
|
+
* judged an anonymous principal, who may do nothing once a policy exists.
|
|
51
|
+
* In any app with one, a person could not take back the edit they had
|
|
52
|
+
* just made, and the row they made it on said "you".
|
|
53
|
+
*/
|
|
54
|
+
const { store, principal, noteSeat } = useGraview();
|
|
55
|
+
const nodes = useGraph();
|
|
56
|
+
const [refused, setRefused] = useState(null);
|
|
57
|
+
const check = useMemo(() => store.canUndo(batch), [store, batch, nodes]);
|
|
58
|
+
if (!check.ok && check.ops.length === 0)
|
|
59
|
+
return null;
|
|
60
|
+
const blocked = !check.ok;
|
|
61
|
+
const alsoNeeded = blocked ? check.includeBatches : [];
|
|
62
|
+
return (_jsxs("span", { style: { marginLeft: "auto", flex: "0 0 auto", display: "grid", justifyItems: "end", gap: 2 }, children: [_jsx("button", { type: "button", "data-testid": "undo-turn", title: blocked ? `${check.message} — undo those too` : "Take this back, keeping everything since",
|
|
63
|
+
/*
|
|
64
|
+
* A REFUSAL IS A RESULT, said on the control that asked for it.
|
|
65
|
+
*
|
|
66
|
+
* `store.canUndo` answers the questions the LOG can answer — a later
|
|
67
|
+
* op read what this one wrote — and not the one the SCHEMA answers:
|
|
68
|
+
* taking back a migration that added a required field leaves a node
|
|
69
|
+
* the declaration refuses. That threw out of the click handler, which
|
|
70
|
+
* is an unhandled error in a console nobody is reading and a button
|
|
71
|
+
* that looked like it did nothing.
|
|
72
|
+
*/
|
|
73
|
+
onClick: () => {
|
|
74
|
+
setRefused(null);
|
|
75
|
+
try {
|
|
76
|
+
/* Taking an agent's turn back walks its body home: the log and the body agree. */
|
|
77
|
+
const turned = store.log.all().find((op) => op.batch === batch && op.author.kind === "agent");
|
|
78
|
+
store.undo(blocked ? [batch, ...alsoNeeded] : batch, { author: principal });
|
|
79
|
+
if (turned)
|
|
80
|
+
noteSeat({ type: "home", author: turned.author });
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
setRefused(error instanceof Error ? error.message : String(error));
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
/*
|
|
87
|
+
* A TARGET, not just a word. At 11px in a 1px-tall padding this was a
|
|
88
|
+
* 38x18 control — the only way to take a turn back, and under the 24
|
|
89
|
+
* WCAG 2.2 asks for on both counts. The rail row grows by six pixels;
|
|
90
|
+
* the alternative is an undo you have to aim at.
|
|
91
|
+
*/
|
|
92
|
+
style: {
|
|
93
|
+
display: "inline-flex",
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
minHeight: 24,
|
|
96
|
+
minWidth: 24,
|
|
97
|
+
padding: "1px 8px",
|
|
98
|
+
fontSize: "0.75rem",
|
|
99
|
+
...(blocked ? { borderColor: "var(--graview-warn)", color: "var(--graview-warn)" } : {}),
|
|
100
|
+
}, children: blocked ? `undo +${alsoNeeded.length}` : "undo" }), refused ? (_jsx("span", { "data-testid": "undo-refused", role: "alert", style: { fontSize: "0.75rem", lineHeight: 1.4, color: "var(--graview-warn)", maxWidth: 260, textAlign: "right" }, children: refused })) : null] }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* What has happened, and what is happening: the agent's tool calls and every
|
|
104
|
+
* applied change, in one list.
|
|
105
|
+
*
|
|
106
|
+
* A diff says what CHANGED and never what was considered, so an agent turn
|
|
107
|
+
* without this is a spinner and a toast. Reads are the interesting half.
|
|
108
|
+
* Every node named here is a target, so checking the work is one click.
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* The way back to the example.
|
|
112
|
+
*
|
|
113
|
+
* An app that remembers its edits in the browser needs a visible way OUT of
|
|
114
|
+
* them: a demo that can be edited into a corner with no exit teaches
|
|
115
|
+
* distrust, and "clear your site data" is not an affordance. The control
|
|
116
|
+
* goes to the same address with `fresh=1` — the framework's own convention,
|
|
117
|
+
* read by `browserStartsFresh` in `@graview/ship` — so it is a navigation
|
|
118
|
+
* like any other stop: the seed loads, the flag is dropped from the address,
|
|
119
|
+
* and what you do next is remembered again.
|
|
120
|
+
*/
|
|
121
|
+
export function StartFresh() {
|
|
122
|
+
const href = () => {
|
|
123
|
+
const url = new URL(window.location.href);
|
|
124
|
+
url.searchParams.set("fresh", "1");
|
|
125
|
+
return url.toString();
|
|
126
|
+
};
|
|
127
|
+
return (_jsx("a", { href: "#fresh", "data-testid": "start-fresh", title: "Forget every edit made in this browser and return to the example", onClick: (event) => {
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
window.location.assign(href());
|
|
130
|
+
},
|
|
131
|
+
/*
|
|
132
|
+
* The same target the routed face's copy of this link already is
|
|
133
|
+
* (`StartFreshLink` in @graview/pages): inline text at 12px is a
|
|
134
|
+
* 50x16 control, and the fix landed on one face only.
|
|
135
|
+
*/
|
|
136
|
+
style: {
|
|
137
|
+
display: "inline-flex",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
minHeight: 24,
|
|
140
|
+
minWidth: 24,
|
|
141
|
+
fontSize: "0.8125rem",
|
|
142
|
+
color: "var(--graview-ink-muted)",
|
|
143
|
+
textDecoration: "underline",
|
|
144
|
+
textDecorationColor: "var(--graview-edge-bright)",
|
|
145
|
+
textUnderlineOffset: 3,
|
|
146
|
+
}, children: "Start fresh" }));
|
|
147
|
+
}
|
|
148
|
+
export function ActivityRail({ calls, seat, remembers = false, }) {
|
|
149
|
+
const changes = useRecentChanges();
|
|
150
|
+
const { store, principal, seats } = useGraview();
|
|
151
|
+
const [open, setOpen] = useState(false);
|
|
152
|
+
const anchor = useRef(null);
|
|
153
|
+
const running = calls.some((call) => call.phase === "running");
|
|
154
|
+
/*
|
|
155
|
+
* A POPOVER FROM THE BAR, not a rail pinned over the scene.
|
|
156
|
+
*
|
|
157
|
+
* It was in the way because it was always there, and moving it around the
|
|
158
|
+
* corners did not change that. What happened is chrome — it belongs with
|
|
159
|
+
* the other chrome, opening on demand, in the same language as the problems
|
|
160
|
+
* list. The one thing that must stay visible without opening anything is
|
|
161
|
+
* that an agent is mid-turn, and that is a dot on the button.
|
|
162
|
+
*/
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
if (!open)
|
|
165
|
+
return;
|
|
166
|
+
const away = (event) => {
|
|
167
|
+
if (!anchor.current?.contains(event.target))
|
|
168
|
+
setOpen(false);
|
|
169
|
+
};
|
|
170
|
+
const key = (event) => {
|
|
171
|
+
if (event.key === "Escape")
|
|
172
|
+
closeToTrigger(anchor.current, () => setOpen(false));
|
|
173
|
+
};
|
|
174
|
+
document.addEventListener("mousedown", away);
|
|
175
|
+
document.addEventListener("keydown", key);
|
|
176
|
+
return () => {
|
|
177
|
+
document.removeEventListener("mousedown", away);
|
|
178
|
+
document.removeEventListener("keydown", key);
|
|
179
|
+
};
|
|
180
|
+
}, [open]);
|
|
181
|
+
if (seat === undefined && calls.length === 0 && changes.length === 0 && !remembers)
|
|
182
|
+
return null;
|
|
183
|
+
return (_jsxs("div", { ref: anchor, style: { position: "relative" }, children: [_jsxs("button", { type: "button", "data-testid": "activity-button", "aria-expanded": open, onClick: () => setOpen((value) => !value), title: running ? "An agent is working" : "What has happened", style: {
|
|
184
|
+
display: "inline-flex",
|
|
185
|
+
alignItems: "center",
|
|
186
|
+
gap: 6,
|
|
187
|
+
padding: "4px 11px",
|
|
188
|
+
borderRadius: 999,
|
|
189
|
+
fontSize: "0.875rem",
|
|
190
|
+
whiteSpace: "nowrap",
|
|
191
|
+
...(running ? { borderColor: "var(--graview-accent)", color: "var(--graview-accent)" } : {}),
|
|
192
|
+
}, children: [_jsx("span", { "aria-hidden": "true", style: {
|
|
193
|
+
width: 6,
|
|
194
|
+
height: 6,
|
|
195
|
+
borderRadius: 999,
|
|
196
|
+
background: running ? "var(--graview-accent)" : "var(--graview-edge-bright)",
|
|
197
|
+
} }), changes.length > 0 ? changes.length : "", " Activity"] }), !open && seat !== undefined ? (_jsx("div", { hidden: true, "data-testid": "agent-seat-seated", children: seat })) : null, open ? (_jsxs("aside", { "aria-label": "Activity", "data-testid": "activity", "data-graview-offstage": "", "data-graview-overlay": "", style: {
|
|
198
|
+
position: "absolute",
|
|
199
|
+
top: "calc(100% + 6px)",
|
|
200
|
+
right: 0,
|
|
201
|
+
zIndex: 20,
|
|
202
|
+
width: 300,
|
|
203
|
+
maxHeight: "min(52cqh, 460px)",
|
|
204
|
+
overflow: "auto",
|
|
205
|
+
display: "flex",
|
|
206
|
+
flexDirection: "column",
|
|
207
|
+
gap: 9,
|
|
208
|
+
padding: 12,
|
|
209
|
+
borderRadius: 10,
|
|
210
|
+
border: "1px solid var(--graview-edge)",
|
|
211
|
+
background: "var(--graview-float)",
|
|
212
|
+
boxShadow: "var(--graview-lift-high)",
|
|
213
|
+
}, children: [seat !== undefined ? (_jsxs("div", { "data-testid": "agent-seat-row", style: {
|
|
214
|
+
display: "grid",
|
|
215
|
+
gap: 5,
|
|
216
|
+
paddingBottom: calls.length > 0 || changes.length > 0 ? 9 : 0,
|
|
217
|
+
...(calls.length > 0 || changes.length > 0
|
|
218
|
+
? { borderBottom: "1px solid var(--graview-edge)" }
|
|
219
|
+
: {}),
|
|
220
|
+
}, children: [_jsx("span", { style: {
|
|
221
|
+
fontSize: "0.75rem",
|
|
222
|
+
letterSpacing: "0.14em",
|
|
223
|
+
textTransform: "uppercase",
|
|
224
|
+
color: "var(--graview-ink-faint)",
|
|
225
|
+
}, children: "The agent's seat" }), seat] })) : null, calls.length > 0 ? (_jsx("ol", { style: { margin: 0, padding: 0, listStyle: "none", display: "grid", gap: 7 }, children: calls.slice(0, 6).map((call, index) => (_jsxs("li", { style: { display: "grid", gap: 2, fontSize: "0.8125rem", lineHeight: 1.45 }, children: [_jsxs("div", { style: { display: "flex", alignItems: "baseline", gap: 6 }, children: [_jsx("span", { "aria-hidden": "true", style: {
|
|
226
|
+
width: 6,
|
|
227
|
+
height: 6,
|
|
228
|
+
borderRadius: 999,
|
|
229
|
+
flex: "0 0 auto",
|
|
230
|
+
background: call.phase === "running"
|
|
231
|
+
? "var(--graview-accent)"
|
|
232
|
+
: call.phase === "failed"
|
|
233
|
+
? "var(--graview-warn)"
|
|
234
|
+
: "var(--graview-edge-bright)",
|
|
235
|
+
} }), _jsxs("span", { style: { color: "var(--graview-ink)" }, children: [call.mutating ? "changed" : "read", " \u00B7", " ", store.allMutations().find((mutation) => mutation.name === call.name)?.title ??
|
|
236
|
+
humaniseField(call.name)] })] }), !call.mutating && call.reads && call.reads.length > 0 ? (_jsxs("div", { "data-testid": "activity-reads", style: { display: "flex", flexWrap: "wrap", gap: 4, paddingLeft: 12 }, children: [call.reads.slice(0, 3).map((id) => (_jsx(Chip, { label: nameOf(store, id), pickId: id }, id))), call.reads.length > 3 ? _jsxs("span", { style: { color: "var(--graview-ink-muted)" }, children: ["+", call.reads.length - 3] }) : null] })) : Object.values(call.args).some((value) => typeof value === "string") ? (_jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, paddingLeft: 12 }, children: Object.values(call.args)
|
|
237
|
+
.filter((value) => typeof value === "string")
|
|
238
|
+
.slice(0, 3)
|
|
239
|
+
.map((value) => (_jsx(Chip, { label: nameOf(store, value), pickId: value }, value))) })) : null, call.error ? (_jsx("div", { style: { paddingLeft: 12, color: "var(--graview-warn)" }, children: call.error })) : null] }, `${call.at}:${index}`))) })) : null, changes.length > 0 ? (_jsx("ol", { "data-testid": "diff-log", style: {
|
|
240
|
+
margin: 0,
|
|
241
|
+
padding: 0,
|
|
242
|
+
listStyle: "none",
|
|
243
|
+
display: "grid",
|
|
244
|
+
gap: 6,
|
|
245
|
+
fontSize: "0.8125rem",
|
|
246
|
+
}, children: changes.map((change, index) => (_jsxs("li", { style: { display: "grid", gap: 3, lineHeight: 1.45 }, children: [_jsxs("div", { style: { display: "flex", alignItems: "baseline", gap: 6 }, children: [_jsxs("span", { style: { minWidth: 0 }, children: [_jsx("strong", { style: { fontWeight: 600 }, children: change.author === "human" && (change.authorId === undefined || principal.id === undefined || change.authorId === principal.id)
|
|
247
|
+
? "you"
|
|
248
|
+
: nameOfAuthor({ kind: change.author, id: change.authorId }, { graph: store.graph, schema: store.schema, seats }) }), " ", _jsx("span", { style: { color: "var(--graview-ink-muted)" }, children: change.intent })] }), change.batch ? _jsx(UndoTurn, { batch: change.batch }) : null] }), _jsx("div", { "data-touched": change.touched.join(" "), style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: change.touched.slice(0, 4).map((id) => (_jsx(Chip, { label: nameOf(store, id), pickId: id }, id))) })] }, `change:${index}`))) })) : null, remembers ? (_jsxs("div", { "data-testid": "remembered", style: {
|
|
249
|
+
display: "flex",
|
|
250
|
+
alignItems: "baseline",
|
|
251
|
+
justifyContent: "space-between",
|
|
252
|
+
gap: 10,
|
|
253
|
+
paddingTop: 8,
|
|
254
|
+
borderTop: "1px solid var(--graview-edge)",
|
|
255
|
+
fontSize: "0.8125rem",
|
|
256
|
+
color: "var(--graview-ink-faint)",
|
|
257
|
+
}, children: [_jsx("span", { children: "Remembered in this browser" }), _jsx(StartFresh, {})] })) : null] })) : null] }));
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/workbench/activity.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAkB,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAY/C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAK,GAAG,CAAC;IACxC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,EAAa,CAAC;IAC1C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,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AAC,GACE,KA5BC,UAAU,KAAK,EAAE,CA6BrB,CACN,CAAC,GACC,CACN,CAAC,CAAC,CAAC,IAAI,EACP,SAAS,CAAC,CAAC,CAAC,CACX,8BACc,YAAY,EACxB,KAAK,EAAE;4BACL,OAAO,EAAE,MAAM;4BACf,UAAU,EAAE,UAAU;4BACtB,cAAc,EAAE,eAAe;4BAC/B,GAAG,EAAE,EAAE;4BACP,UAAU,EAAE,CAAC;4BACb,SAAS,EAAE,+BAA+B;4BAC1C,QAAQ,EAAE,WAAW;4BACrB,KAAK,EAAE,0BAA0B;yBAClC,aAED,wDAAuC,EACvC,KAAC,UAAU,KAAG,IACV,CACP,CAAC,CAAC,CAAC,IAAI,IACF,CACT,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { AnySchema } from "@graview/core";
|
|
2
|
+
import { type InAppAgent, type ToolCall, type ToolRuntime } from "@graview/tools";
|
|
3
|
+
export interface AgentSeatProps<S extends AnySchema> {
|
|
4
|
+
/** What the seat would do right now, given how much there is to do. */
|
|
5
|
+
label(count: number): string;
|
|
6
|
+
/** Shown while the turn is running. */
|
|
7
|
+
readonly busyLabel: string;
|
|
8
|
+
/** How many things it would touch. Zero means there is nothing to do. */
|
|
9
|
+
readonly count: number;
|
|
10
|
+
/** Said in the tooltip when there is nothing to do. */
|
|
11
|
+
readonly idle: string;
|
|
12
|
+
/**
|
|
13
|
+
* The mutation this seat is really asking for.
|
|
14
|
+
*
|
|
15
|
+
* Named so the seat can be refused BEFORE it is pressed rather than after:
|
|
16
|
+
* the store already knows what this principal may run, and a button that
|
|
17
|
+
* looks live and throws is the worst of both.
|
|
18
|
+
*/
|
|
19
|
+
readonly gate?: string;
|
|
20
|
+
/**
|
|
21
|
+
* WHO IS SITTING IN IT. The author every op this seat writes is signed
|
|
22
|
+
* with, and the name Activity reads back.
|
|
23
|
+
*
|
|
24
|
+
* Required, because the default was "claude" for every seat in every app —
|
|
25
|
+
* so two seats on one embed were indistinguishable in the history, and a
|
|
26
|
+
* seat that is a scheduled job, a rules mender or somebody else's model
|
|
27
|
+
* wore a vendor's name. The chat seat has always signed "chat"; this is the
|
|
28
|
+
* same contract, said out loud.
|
|
29
|
+
*/
|
|
30
|
+
readonly who: string;
|
|
31
|
+
readonly testId: string;
|
|
32
|
+
onCall(call: ToolCall): void;
|
|
33
|
+
/** The turn itself. Everything the app knows and the framework does not. */
|
|
34
|
+
run(agent: InAppAgent<S>, runtime: ToolRuntime<S>): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A seat an agent sits in, with the chrome that is not about the domain.
|
|
38
|
+
*
|
|
39
|
+
* Four apps had the same forty lines around four different scripts, and the
|
|
40
|
+
* same three faults in all of them: the button never said how much there was
|
|
41
|
+
* to do, it stayed live and silently did nothing when there was none, and a
|
|
42
|
+
* refusal from the store surfaced as an unhandled rejection in the console.
|
|
43
|
+
* The turn is the app's; the rest of this is not.
|
|
44
|
+
*
|
|
45
|
+
* The seat runs as an AGENT ACTING FOR the person sitting in it — same roles,
|
|
46
|
+
* different author. That is what makes "one policy narrows the interface and
|
|
47
|
+
* the agent seat alike" a thing you can watch happen: change seat, and the
|
|
48
|
+
* button is refused in the same breath the actions strip is.
|
|
49
|
+
*/
|
|
50
|
+
export declare function AgentSeat<S extends AnySchema>({ label, busyLabel, count, idle, gate, who, testId, onCall, run, }: AgentSeatProps<S>): import("react").JSX.Element;
|
|
51
|
+
//# sourceMappingURL=agent-seat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-seat.d.ts","sourceRoot":"","sources":["../../src/workbench/agent-seat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,SAAS;IACjD,uEAAuE;IACvE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;OASG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC7B,4EAA4E;IAC5E,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,EAC7C,KAAK,EACL,SAAS,EACT,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,MAAM,EACN,MAAM,EACN,GAAG,GACJ,EAAE,cAAc,CAAC,CAAC,CAAC,+BAkInB"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { kindCardId } from "@graview/layout";
|
|
3
|
+
import { useAttention, useGraview } from "@graview/react";
|
|
4
|
+
import { createInAppAdapter, createToolRuntime, loadPins, } from "@graview/tools";
|
|
5
|
+
import { useEffect, useMemo, useState } from "react";
|
|
6
|
+
/**
|
|
7
|
+
* A seat an agent sits in, with the chrome that is not about the domain.
|
|
8
|
+
*
|
|
9
|
+
* Four apps had the same forty lines around four different scripts, and the
|
|
10
|
+
* same three faults in all of them: the button never said how much there was
|
|
11
|
+
* to do, it stayed live and silently did nothing when there was none, and a
|
|
12
|
+
* refusal from the store surfaced as an unhandled rejection in the console.
|
|
13
|
+
* The turn is the app's; the rest of this is not.
|
|
14
|
+
*
|
|
15
|
+
* The seat runs as an AGENT ACTING FOR the person sitting in it — same roles,
|
|
16
|
+
* different author. That is what makes "one policy narrows the interface and
|
|
17
|
+
* the agent seat alike" a thing you can watch happen: change seat, and the
|
|
18
|
+
* button is refused in the same breath the actions strip is.
|
|
19
|
+
*/
|
|
20
|
+
export function AgentSeat({ label, busyLabel, count, idle, gate, who, testId, onCall, run, }) {
|
|
21
|
+
const { store, views, principal, registerSeatWho, noteSeat, session } = useGraview();
|
|
22
|
+
/*
|
|
23
|
+
* ONE ROBOT for the tab's seat and its chat: the seat registers its name
|
|
24
|
+
* and the chat writes as it, so the two surfaces are one body in the city.
|
|
25
|
+
*/
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
registerSeatWho(who);
|
|
28
|
+
return () => registerSeatWho(null);
|
|
29
|
+
}, [who, registerSeatWho]);
|
|
30
|
+
const runtime = useMemo(() => createToolRuntime(store, {
|
|
31
|
+
// This tab's own session, so the robot and the log agree about which tab it was.
|
|
32
|
+
author: {
|
|
33
|
+
kind: "agent",
|
|
34
|
+
id: who,
|
|
35
|
+
session,
|
|
36
|
+
...(principal.roles ? { roles: principal.roles } : {}),
|
|
37
|
+
},
|
|
38
|
+
// Read per call: a pin toggled in the menu after this runtime was
|
|
39
|
+
// built must still reach the seat's tool list — the strip, the
|
|
40
|
+
// pointer menu and the agent must never disagree about the acts.
|
|
41
|
+
derive: () => ({ pins: loadPins() }),
|
|
42
|
+
places: () => views.places(),
|
|
43
|
+
}), [store, principal, who, session, views]);
|
|
44
|
+
const agent = useMemo(() => createInAppAdapter(runtime), [runtime]);
|
|
45
|
+
const [busy, setBusy] = useState(false);
|
|
46
|
+
const [refused, setRefused] = useState(null);
|
|
47
|
+
useEffect(() => runtime.onCall(onCall), [runtime, onCall]);
|
|
48
|
+
// What it LOOKED AT, into the picture. A read leaves no diff, so the
|
|
49
|
+
// runtime is the only thing that can say it happened.
|
|
50
|
+
useAttention(runtime);
|
|
51
|
+
useEffect(() => setRefused(null), [principal]);
|
|
52
|
+
const permitted = gate === undefined || runtime.definitions.some((tool) => tool.name === gate);
|
|
53
|
+
const nothing = count === 0;
|
|
54
|
+
const off = busy || nothing || !permitted;
|
|
55
|
+
/*
|
|
56
|
+
* THE REFUSAL IN THE STORE'S OWN WORDS. "The store refuses add-vehicle"
|
|
57
|
+
* named the act by its identifier on the seat people read first; the
|
|
58
|
+
* store's sentence says the act's title and who may.
|
|
59
|
+
*/
|
|
60
|
+
const verdict = !permitted && gate !== undefined ? store.permits({ name: gate, args: {} }, principal) : undefined;
|
|
61
|
+
const why = !permitted
|
|
62
|
+
? `Not yours to do from this seat. ${verdict && !verdict.ok
|
|
63
|
+
? verdict.refusal.message
|
|
64
|
+
: `“${store.allMutations().find((mutation) => mutation.name === gate)?.title ?? gate}” is not offered to it.`} The actions strip says the same.`
|
|
65
|
+
: nothing
|
|
66
|
+
? idle
|
|
67
|
+
: `${runtime.definitions.length} tools, generated from the schema. Its edits produce the diffs yours do, and Activity can take the turn back.`;
|
|
68
|
+
/*
|
|
69
|
+
* A REFUSAL IS SAID AT THE GATE. The seat that may not act stands at the
|
|
70
|
+
* plot of the kind its gate acts on and says the policy's own words from
|
|
71
|
+
* there — the same sentence this control renders, spoken by the body.
|
|
72
|
+
*/
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const said = refused ?? (!permitted ? why : null);
|
|
75
|
+
if (!said)
|
|
76
|
+
return;
|
|
77
|
+
const gateKind = gate ? store.allMutations().find((m) => m.name === gate)?.subject?.kinds : undefined;
|
|
78
|
+
const where = Array.isArray(gateKind) && gateKind[0] ? kindCardId(gateKind[0]) : null;
|
|
79
|
+
noteSeat({ type: "refused", author: { kind: "agent", id: who, session }, where, say: said });
|
|
80
|
+
}, [refused, permitted, why, gate, store, who, noteSeat]);
|
|
81
|
+
/*
|
|
82
|
+
* A SEAT THAT MAY NOT SIT DOWN SAYS SO, in the open.
|
|
83
|
+
*
|
|
84
|
+
* The reason was a `title` on a DISABLED button — unreachable by keyboard,
|
|
85
|
+
* and needing a hover over a dead control otherwise — and the label
|
|
86
|
+
* underneath it said something else entirely ("There is something here
|
|
87
|
+
* already" when the real answer was "not from this seat"). The strip
|
|
88
|
+
* strikes a withheld act through and says why beside it; a seat is the
|
|
89
|
+
* same claim about the same policy.
|
|
90
|
+
*/
|
|
91
|
+
return (_jsxs("span", { style: { display: "inline-flex", flexDirection: "column", gap: 2, minWidth: 0 }, children: [_jsx("button", { type: "button", "data-testid": testId, "data-agent-permitted": permitted || undefined, disabled: off, title: refused ?? why, onClick: () => {
|
|
92
|
+
setBusy(true);
|
|
93
|
+
setRefused(null);
|
|
94
|
+
void (async () => {
|
|
95
|
+
try {
|
|
96
|
+
await run(agent, runtime);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
/*
|
|
100
|
+
* A refusal is a RESULT, said on the control that asked for it.
|
|
101
|
+
* Unhandled, it was a console error nobody sees and a button that
|
|
102
|
+
* appeared to do nothing at all.
|
|
103
|
+
*/
|
|
104
|
+
setRefused(error instanceof Error ? error.message : String(error));
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
setBusy(false);
|
|
108
|
+
}
|
|
109
|
+
})();
|
|
110
|
+
}, style: { whiteSpace: "nowrap" }, children: busy ? (busyLabel) : !permitted ? (_jsx("s", { children: label(count) })) : nothing ? (idle) : (label(count)) }), !permitted || refused ? (_jsx("span", { "data-testid": `${testId}-why`, style: { fontSize: "0.8125rem", lineHeight: 1.4, color: "var(--graview-ink-muted)", maxWidth: 260 }, children: refused ?? why })) : null] }));
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=agent-seat.js.map
|