@tangle-network/agent-app 0.45.26 → 0.45.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant/index.d.ts +1 -0
- package/dist/assistant/index.js +5 -5
- package/dist/chat-routes/index.js +21 -21
- package/dist/chat-store/index.js +2 -2
- package/dist/{chunk-B2UEW62O.js → chunk-5ZTFZBS6.js} +4 -4
- package/dist/{chunk-AGCRCOQH.js → chunk-AWPK7ZDS.js} +1 -1
- package/dist/chunk-C3CAYGGQ.js +18 -0
- package/dist/chunk-C3CAYGGQ.js.map +1 -0
- package/dist/chunk-EMLGWEHV.js +33 -0
- package/dist/chunk-EMLGWEHV.js.map +1 -0
- package/dist/{chunk-XEA5EG6P.js → chunk-EPZYYWCT.js} +8 -30
- package/dist/chunk-EPZYYWCT.js.map +1 -0
- package/dist/{chunk-WD2B6HGY.js → chunk-K4RA5T3A.js} +11 -32
- package/dist/chunk-K4RA5T3A.js.map +1 -0
- package/dist/chunk-NEJ7OMQS.js +351 -0
- package/dist/chunk-NEJ7OMQS.js.map +1 -0
- package/dist/{chunk-7V2I3JGZ.js → chunk-OTLEYHOG.js} +50 -12
- package/dist/chunk-OTLEYHOG.js.map +1 -0
- package/dist/{chunk-RT5RKAFX.js → chunk-QGSVF6DZ.js} +8 -18
- package/dist/chunk-QGSVF6DZ.js.map +1 -0
- package/dist/{chunk-KOMP6NDW.js → chunk-WC43OQMR.js} +45 -34
- package/dist/chunk-WC43OQMR.js.map +1 -0
- package/dist/{chunk-N3G3FSM4.js → chunk-YXA3U4JZ.js} +9 -47
- package/dist/chunk-YXA3U4JZ.js.map +1 -0
- package/dist/design-canvas-react/index.js +4 -4
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/legibility/cli.js +14 -8
- package/dist/legibility/cli.js.map +1 -1
- package/dist/legibility/index.js +2 -1
- package/dist/peer-floors/cli.js +14 -8
- package/dist/peer-floors/cli.js.map +1 -1
- package/dist/preflight/cli.js +4 -2
- package/dist/preflight/cli.js.map +1 -1
- package/dist/{run-tEsZUhAf.d.ts → run-D80hoLKh.d.ts} +1 -1
- package/dist/sandbox/index.d.ts +53 -1
- package/dist/sandbox/index.js +1 -1
- package/dist/signoff/cli.d.ts +2 -2
- package/dist/signoff/cli.js +6 -18
- package/dist/signoff/cli.js.map +1 -1
- package/dist/signoff/index.d.ts +4 -420
- package/dist/signoff/index.js +3 -55
- package/dist/signoff/proof-cli.js +11 -6
- package/dist/signoff/proof-cli.js.map +1 -1
- package/dist/signoff/proof.d.ts +70 -271
- package/dist/signoff/proof.js +3 -73
- package/dist/signoff/proof.js.map +1 -1
- package/dist/spend/cli.d.ts +1 -0
- package/dist/spend/cli.js +119 -0
- package/dist/spend/cli.js.map +1 -0
- package/dist/spend/index.d.ts +640 -0
- package/dist/spend/index.js +196 -0
- package/dist/spend/index.js.map +1 -0
- package/dist/stream/index.js +14 -14
- package/dist/teams/index.js +9 -9
- package/dist/teams/invitations-api.js +7 -7
- package/dist/theme-contract/cli.js +6 -2
- package/dist/theme-contract/cli.js.map +1 -1
- package/dist/theme-contract/index.js +2 -1
- package/dist/{types-U7Nz-txa.d.ts → types-Bd6uW9vQ.d.ts} +1 -1
- package/dist/web-react/index.d.ts +28 -40
- package/dist/web-react/index.js +11 -11
- package/package.json +7 -1
- package/dist/chunk-7V2I3JGZ.js.map +0 -1
- package/dist/chunk-KOMP6NDW.js.map +0 -1
- package/dist/chunk-N3G3FSM4.js.map +0 -1
- package/dist/chunk-RT5RKAFX.js.map +0 -1
- package/dist/chunk-WD2B6HGY.js.map +0 -1
- package/dist/chunk-XEA5EG6P.js.map +0 -1
- /package/dist/{chunk-B2UEW62O.js.map → chunk-5ZTFZBS6.js.map} +0 -0
- /package/dist/{chunk-AGCRCOQH.js.map → chunk-AWPK7ZDS.js.map} +0 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
walkSources
|
|
3
|
+
} from "./chunk-EMLGWEHV.js";
|
|
4
|
+
|
|
1
5
|
// src/theme-contract/index.ts
|
|
2
|
-
import { existsSync, readFileSync
|
|
3
|
-
import {
|
|
6
|
+
import { existsSync, readFileSync } from "fs";
|
|
7
|
+
import { relative } from "path";
|
|
4
8
|
import { fileURLToPath } from "url";
|
|
5
|
-
var SOURCE_RE = /\.(ts|tsx|js|jsx|mjs|cjs)$/;
|
|
6
|
-
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", "build", ".next", "coverage"]);
|
|
7
9
|
var DANGEROUS_UTILITIES = [
|
|
8
10
|
{ suffix: "surface-container-highest", varName: "--secondary" },
|
|
9
11
|
{ suffix: "surface-container-high", varName: "--popover" },
|
|
@@ -17,18 +19,6 @@ var UTILITY_PREFIXES = "bg|text|border|ring|fill|stroke";
|
|
|
17
19
|
function buildUtilityRe(suffix) {
|
|
18
20
|
return new RegExp(`(?<![\\w-])(?:${UTILITY_PREFIXES})-${suffix}(?![\\w-])`, "g");
|
|
19
21
|
}
|
|
20
|
-
function walkSources(dir) {
|
|
21
|
-
let entries;
|
|
22
|
-
try {
|
|
23
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
24
|
-
} catch {
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
|
-
return entries.flatMap((e) => {
|
|
28
|
-
if (e.isDirectory()) return SKIP_DIRS.has(e.name) ? [] : walkSources(join(dir, e.name));
|
|
29
|
-
return SOURCE_RE.test(e.name) && !e.name.endsWith(".d.ts") ? [join(dir, e.name)] : [];
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
22
|
function definedVars(cssFiles) {
|
|
33
23
|
const defs = /* @__PURE__ */ new Set();
|
|
34
24
|
for (const file of cssFiles) {
|
|
@@ -53,7 +43,7 @@ function checkThemeContract(opts) {
|
|
|
53
43
|
const defined = definedVars([tokensCss, ...opts.extraTokensCss ?? []]);
|
|
54
44
|
const allow = new Set(opts.allowlist ?? []);
|
|
55
45
|
const isDefined = (name) => defined.has(name) || allow.has(name);
|
|
56
|
-
const files = opts.srcDirs.flatMap(walkSources);
|
|
46
|
+
const files = opts.srcDirs.flatMap((dir) => walkSources(dir, [".d.ts"]));
|
|
57
47
|
const utilityMatchers = DANGEROUS_UTILITIES.map((u) => ({ ...u, re: buildUtilityRe(u.suffix) }));
|
|
58
48
|
const seenVar = /* @__PURE__ */ new Map();
|
|
59
49
|
const seenUtility = /* @__PURE__ */ new Map();
|
|
@@ -96,4 +86,4 @@ function displayPath(file) {
|
|
|
96
86
|
export {
|
|
97
87
|
checkThemeContract
|
|
98
88
|
};
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-QGSVF6DZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme-contract/index.ts"],"sourcesContent":["/**\n * Exportable theme-token contract checker — the incident guard for the\n * invisible-popover class of bugs.\n *\n * The failure mode (tax-agent's transparent model dropdown; the whole\n * `bg-surface-container-*` family): a consumer app ships a component that\n * references a theme token — either as `var(--popover)` or as a Tailwind class\n * like `bg-surface-container-high` that the agent-app preset maps to\n * `hsl(var(--popover))` — but the app's OWN build never emits that custom\n * property (it forgot `import '@tangle-network/agent-app/styles'`, or dropped a\n * token in its local tokens.css). CSS resolves the missing var to nothing, the\n * surface paints transparent, and NOTHING errors. It ships invisible.\n *\n * `tests/theme/tokens-contract.test.ts` guards agent-app's OWN components. This\n * module lifts that walking logic into a function every CONSUMER app can run\n * against ITS OWN source in CI, comparing references to the tokens.css agent-app\n * ships plus any extra CSS the app defines.\n *\n * ── What each check covers (scope is deliberately honest) ────────────────────\n *\n * 1. var(--…) check — COMPLETE. Every `var(--name)` literal in the scanned\n * source (inline styles, `bg-[var(--name)]` arbitrary Tailwind values, CSS\n * template strings) is matched and compared against the defined token set.\n * This is exact: a `var(--x)` reference is unambiguous. It is a raw-text\n * scan (no AST), so a `var(--x)` written inside a comment or string literal\n * counts too — deliberate: it keeps the single-source logic identical to the\n * agent-app self-test, and a dangling `var(--x)` in a comment is a smell\n * worth surfacing. Suppress a deliberate one with `allowlist`.\n *\n * 2. Tailwind-utility check — INTENTIONALLY PARTIAL. Bare classes like\n * `bg-card` carry no `var(--)` and so are invisible to check 1; Tailwind\n * resolves them to `hsl(var(--card))` at build via the preset. Fully\n * resolving arbitrary Tailwind config is out of scope (it would mean\n * re-implementing Tailwind). Instead we check the SPECIFIC known-dangerous\n * families that have actually shipped invisible: the MD3 surface ladder\n * (`surface-container` / `-high` / `-highest`) and the `card` / `popover`\n * elevation pairs — exactly the utilities the agent-app tailwind-preset\n * registers onto elevation tokens (see src/theme/tailwind-preset.ts, the\n * source of truth for this mapping). The canvas/sequence aliases\n * (`--bg-input`, `--text-primary`, …) are consumed as `bg-[var(--…)]`\n * arbitrary values and so are already covered fully by check 1 — they need\n * no entry here.\n *\n * Node-only (reads the filesystem) → this lives in the `./theme-contract`\n * subpath, NOT `./theme`, which must stay browser-clean (it's in the\n * browser-safe manifest test).\n */\n\nimport { existsSync, readFileSync } from 'node:fs'\nimport { relative } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { walkSources } from '../legibility/walk-sources'\n\n/** Define options for scanning source directories and CSS token files in a theme contract */\nexport interface ThemeContractOptions {\n /** Consumer source directories to scan for token references (recursively). */\n srcDirs: string[]\n /**\n * Path to the base tokens.css whose `--name:` definitions are the ground\n * truth. Defaults to the tokens.css agent-app ships (`./styles`) — the set a\n * consumer gets from `import '@tangle-network/agent-app/styles'`.\n */\n tokensCss?: string\n /**\n * Additional CSS files whose `--name:` definitions also count as defined —\n * the app's own overrides/extensions layered on top of the base tokens.\n */\n extraTokensCss?: string[]\n /**\n * Token names (e.g. `--my-app-accent`) to treat as always-defined, suppressing\n * them from the missing list. For app-specific vars defined outside any CSS\n * the checker can see (injected at runtime, from a third-party stylesheet, …).\n */\n allowlist?: string[]\n}\n\n/** Describe a missing theme contract variable and where it was referenced */\nexport interface ThemeContractMiss {\n /** The undefined custom property, e.g. `--popover`. */\n varName: string\n /**\n * Where it was referenced: `path/to/file.tsx`, or\n * `path/to/file.tsx (via bg-surface-container-high)` when the reference is a\n * Tailwind utility that resolves to the token rather than a literal var().\n */\n referencedIn: string\n}\n\n/** Describe the result of validating a theme contract including success status and missing items */\nexport interface ThemeContractResult {\n ok: boolean\n missing: ThemeContractMiss[]\n}\n\n/**\n * Known-dangerous Tailwind utility families and the elevation token each\n * resolves to, mirroring src/theme/tailwind-preset.ts. Ordered longest-suffix\n * first so `surface-container-highest` is matched before `surface-container`.\n * The negative look-around in {@link buildUtilityRe} makes ordering belt-and-\n * suspenders rather than load-bearing.\n */\nconst DANGEROUS_UTILITIES: ReadonlyArray<{ suffix: string; varName: string }> = [\n { suffix: 'surface-container-highest', varName: '--secondary' },\n { suffix: 'surface-container-high', varName: '--popover' },\n { suffix: 'surface-container', varName: '--card' },\n { suffix: 'card-foreground', varName: '--card-foreground' },\n { suffix: 'popover-foreground', varName: '--popover-foreground' },\n { suffix: 'card', varName: '--card' },\n { suffix: 'popover', varName: '--popover' },\n]\n\n/** Tailwind color-utility prefixes that can carry a background/text/border color. */\nconst UTILITY_PREFIXES = 'bg|text|border|ring|fill|stroke'\n\n/**\n * Match a whole utility class for `suffix`, tolerant of variants (`hover:`,\n * `dark:`) and opacity (`/95`) but not of longer siblings: the trailing\n * `(?![\\w-])` stops `bg-surface-container` from matching inside\n * `bg-surface-container-high`, and `bg-card` from matching inside\n * `bg-card-foreground`.\n */\nfunction buildUtilityRe(suffix: string): RegExp {\n return new RegExp(`(?<![\\\\w-])(?:${UTILITY_PREFIXES})-${suffix}(?![\\\\w-])`, 'g')\n}\n\n/**\n * Every `--name:` DEFINITION across the given CSS files. A definition is\n * `--name:` at the start of a (trimmed) line; RHS references like\n * `hsl(var(--card))` are mid-line and are never counted as definitions.\n */\nfunction definedVars(cssFiles: string[]): Set<string> {\n const defs = new Set<string>()\n for (const file of cssFiles) {\n let css: string\n try {\n css = readFileSync(file, 'utf8')\n } catch {\n continue\n }\n for (const m of css.matchAll(/^\\s*(--[a-z0-9-]+)\\s*:/gim)) if (m[1]) defs.add(m[1])\n }\n return defs\n}\n\n/**\n * Default tokens.css: the one agent-app ships as `./styles`. Resolved relative\n * to this module's URL, but tolerant of where the bundler lands the running\n * code — tsup code-splits shared logic into a chunk at the dist ROOT, so the\n * tokens.css sits one directory DIFFERENTLY depending on layout:\n * - source (src/theme-contract/index.ts) → ../theme/tokens.css (src/theme)\n * - split chunk (dist/contract-*.js) → ./theme/tokens.css (dist/theme)\n * - unsplit entry (dist/theme-contract/index.js) → ../theme/tokens.css\n * Probe both and return the one that exists; fall back to the first for a\n * sensible error path if neither is present.\n */\nfunction defaultTokensCss(): string {\n const candidates = ['../theme/tokens.css', './theme/tokens.css'].map((rel) =>\n fileURLToPath(new URL(rel, import.meta.url)),\n )\n return candidates.find((p) => existsSync(p)) ?? candidates[0]!\n}\n\n/**\n * Check that every theme token a consumer's source references is actually\n * defined in the CSS that consumer ships. Returns the full missing set; the\n * caller decides how to fail (the bin exits non-zero on any miss).\n */\nexport function checkThemeContract(opts: ThemeContractOptions): ThemeContractResult {\n const tokensCss = opts.tokensCss ?? defaultTokensCss()\n const defined = definedVars([tokensCss, ...(opts.extraTokensCss ?? [])])\n const allow = new Set(opts.allowlist ?? [])\n const isDefined = (name: string) => defined.has(name) || allow.has(name)\n\n const files = opts.srcDirs.flatMap((dir) => walkSources(dir, ['.d.ts']))\n const utilityMatchers = DANGEROUS_UTILITIES.map((u) => ({ ...u, re: buildUtilityRe(u.suffix) }))\n\n // Dedupe by varName (literal check) and by varName+utility (utility check),\n // keeping the FIRST referencing file — enough to locate the offender without\n // drowning the report when one token is referenced across many files.\n const seenVar = new Map<string, string>()\n const seenUtility = new Map<string, string>()\n\n for (const file of files) {\n let text: string\n try {\n text = readFileSync(file, 'utf8')\n } catch {\n continue\n }\n const where = displayPath(file)\n\n // Check 1 — literal var(--…) references.\n for (const m of text.matchAll(/var\\(\\s*(--[a-z0-9-]+)/gi)) {\n const name = m[1]\n if (!name || isDefined(name) || seenVar.has(name)) continue\n seenVar.set(name, where)\n }\n\n // Check 2 — known-dangerous Tailwind utility classes.\n for (const u of utilityMatchers) {\n if (isDefined(u.varName)) continue\n const key = `${u.varName}::${u.suffix}`\n if (seenUtility.has(key)) continue\n u.re.lastIndex = 0\n if (u.re.test(text)) seenUtility.set(key, `${where} (via ${firstUtilityHit(text, u.suffix)})`)\n }\n }\n\n const missing: ThemeContractMiss[] = [\n ...[...seenVar].map(([varName, referencedIn]) => ({ varName, referencedIn })),\n ...[...seenUtility].map(([key, referencedIn]) => ({ varName: key.split('::')[0]!, referencedIn })),\n ]\n return { ok: missing.length === 0, missing }\n}\n\n/** The literal utility class (with prefix) first seen in `text` for `suffix`, for the report. */\nfunction firstUtilityHit(text: string, suffix: string): string {\n const m = buildUtilityRe(suffix).exec(text)\n return m?.[0] ?? `<utility>-${suffix}`\n}\n\n/** Path relative to cwd when it stays inside it, else the path as given — for readable reports. */\nfunction displayPath(file: string): string {\n const rel = relative(process.cwd(), file)\n return rel && !rel.startsWith('..') ? rel : file\n}\n"],"mappings":";;;;;AAgDA,SAAS,YAAY,oBAAoB;AACzC,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAmD9B,IAAM,sBAA0E;AAAA,EAC9E,EAAE,QAAQ,6BAA6B,SAAS,cAAc;AAAA,EAC9D,EAAE,QAAQ,0BAA0B,SAAS,YAAY;AAAA,EACzD,EAAE,QAAQ,qBAAqB,SAAS,SAAS;AAAA,EACjD,EAAE,QAAQ,mBAAmB,SAAS,oBAAoB;AAAA,EAC1D,EAAE,QAAQ,sBAAsB,SAAS,uBAAuB;AAAA,EAChE,EAAE,QAAQ,QAAQ,SAAS,SAAS;AAAA,EACpC,EAAE,QAAQ,WAAW,SAAS,YAAY;AAC5C;AAGA,IAAM,mBAAmB;AASzB,SAAS,eAAe,QAAwB;AAC9C,SAAO,IAAI,OAAO,iBAAiB,gBAAgB,KAAK,MAAM,cAAc,GAAG;AACj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|
+
workProductPartsFromMessageParts
|
|
7
|
+
} from "./chunk-HZ4WCA37.js";
|
|
4
8
|
import {
|
|
5
9
|
UNTITLED_SESSION_LABEL,
|
|
6
10
|
mergeSessionPages,
|
|
7
11
|
sessionLabel
|
|
8
12
|
} from "./chunk-PC2WYTK7.js";
|
|
9
|
-
import {
|
|
10
|
-
WorkProductCard,
|
|
11
|
-
workProductPartsFromMessageParts
|
|
12
|
-
} from "./chunk-HZ4WCA37.js";
|
|
13
13
|
import {
|
|
14
14
|
attachmentPartsFromMessageParts
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5ZTFZBS6.js";
|
|
16
16
|
import {
|
|
17
17
|
formatBytes
|
|
18
18
|
} from "./chunk-KWXUBMXU.js";
|
|
@@ -307,7 +307,8 @@ function ModelPicker({ value, onChange, models, loading, renderProviderBadge, re
|
|
|
307
307
|
filtered.length === 0 && /* @__PURE__ */ jsx2("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No models match your search" }),
|
|
308
308
|
filtered.map((m) => /* @__PURE__ */ jsx2(ModelRow, { model: m, selected: m.id === value, onSelect: () => select(m.id), renderProviderBadge }, m.id))
|
|
309
309
|
] }),
|
|
310
|
-
!loading && !filtered && /* @__PURE__ */
|
|
310
|
+
!loading && !filtered && models.length === 0 && /* @__PURE__ */ jsx2("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No models available" }),
|
|
311
|
+
!loading && !filtered && models.length > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
311
312
|
priorityGroup && sections.priority.length > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
312
313
|
/* @__PURE__ */ jsx2(SectionHeader, { children: priorityGroup.label }),
|
|
313
314
|
sections.priority.map((m) => /* @__PURE__ */ jsx2(ModelRow, { model: m, selected: m.id === value, onSelect: () => select(m.id), renderProviderBadge }, m.id))
|
|
@@ -2773,20 +2774,20 @@ function ActivityRow({
|
|
|
2773
2774
|
function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent activity", emptyLabel = "No agent runs yet." }) {
|
|
2774
2775
|
const [rows, setRows] = useState11([]);
|
|
2775
2776
|
const [cursor, setCursor] = useState11(void 0);
|
|
2776
|
-
const [
|
|
2777
|
+
const [status, setStatus] = useState11("loading");
|
|
2777
2778
|
const [error, setError] = useState11(null);
|
|
2778
2779
|
const load = useCallback6(
|
|
2779
2780
|
async (from) => {
|
|
2780
|
-
|
|
2781
|
+
setStatus("loading");
|
|
2781
2782
|
setError(null);
|
|
2782
2783
|
try {
|
|
2783
2784
|
const page = await fetchActivity(from);
|
|
2784
2785
|
setRows((prev) => mergeActivityPages(from === void 0 ? [] : prev, page.items));
|
|
2785
2786
|
setCursor(page.nextCursor);
|
|
2787
|
+
setStatus("ready");
|
|
2786
2788
|
} catch (e) {
|
|
2787
2789
|
setError(e instanceof Error ? e.message : String(e));
|
|
2788
|
-
|
|
2789
|
-
setLoading(false);
|
|
2790
|
+
setStatus("error");
|
|
2790
2791
|
}
|
|
2791
2792
|
},
|
|
2792
2793
|
[fetchActivity]
|
|
@@ -2794,6 +2795,7 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
2794
2795
|
useEffect8(() => {
|
|
2795
2796
|
void load();
|
|
2796
2797
|
}, [load]);
|
|
2798
|
+
const loading = status === "loading";
|
|
2797
2799
|
return /* @__PURE__ */ jsxs8("div", { className: "space-y-2", children: [
|
|
2798
2800
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
|
|
2799
2801
|
/* @__PURE__ */ jsx10("h2", { className: "flex-1 text-sm font-semibold", children: title }),
|
|
@@ -2809,8 +2811,8 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
2809
2811
|
}
|
|
2810
2812
|
)
|
|
2811
2813
|
] }),
|
|
2812
|
-
error && /* @__PURE__ */ jsx10("p", { role: "alert", className: "rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: error }),
|
|
2813
|
-
|
|
2814
|
+
status === "error" && /* @__PURE__ */ jsx10("p", { role: "alert", className: "rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: error }),
|
|
2815
|
+
status === "ready" && rows.length === 0 && /* @__PURE__ */ jsx10("p", { className: "px-1 text-sm text-muted-foreground", children: emptyLabel }),
|
|
2814
2816
|
/* @__PURE__ */ jsx10("span", { role: "status", "aria-live": "polite", "aria-busy": loading, className: "sr-only", children: loading ? "Loading activity\u2026" : "" }),
|
|
2815
2817
|
/* @__PURE__ */ jsx10("div", { className: "space-y-1.5", "aria-busy": loading, children: rows.map((record) => /* @__PURE__ */ jsx10(ActivityRow, { record, renderMissionRef }, record.taskId)) }),
|
|
2816
2818
|
cursor && /* @__PURE__ */ jsx10(
|
|
@@ -4175,6 +4177,7 @@ function SessionRow({
|
|
|
4175
4177
|
// src/web-react/record-grid.tsx
|
|
4176
4178
|
import {
|
|
4177
4179
|
Fragment as Fragment7,
|
|
4180
|
+
isValidElement,
|
|
4178
4181
|
useCallback as useCallback9,
|
|
4179
4182
|
useEffect as useEffect11,
|
|
4180
4183
|
useId as useId2,
|
|
@@ -4511,6 +4514,7 @@ function pruneRecordGridOverlay(rows, overlay) {
|
|
|
4511
4514
|
|
|
4512
4515
|
// src/web-react/record-grid.tsx
|
|
4513
4516
|
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4517
|
+
var EMPTY_RECORD_GRID_ROWS = [];
|
|
4514
4518
|
var CELL_KEY_SEPARATOR = "\0";
|
|
4515
4519
|
function cellKey(rowId, columnId) {
|
|
4516
4520
|
return `${rowId}${CELL_KEY_SEPARATOR}${columnId}`;
|
|
@@ -4537,22 +4541,21 @@ function groupColumns(columns) {
|
|
|
4537
4541
|
}
|
|
4538
4542
|
var INPUT_CLASS = "w-full rounded-md border border-border bg-background px-2 py-1 text-sm text-foreground outline-none focus:border-primary/60 focus:ring-1 focus:ring-primary/40";
|
|
4539
4543
|
var BASIS_TONES2 = {
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4544
|
+
extracted: "border-primary/60 text-primary",
|
|
4545
|
+
entered: "border-success/60 text-success",
|
|
4546
|
+
computed: "border-border text-muted-foreground",
|
|
4547
|
+
asserted: "border-warning/60 text-warning"
|
|
4543
4548
|
};
|
|
4544
4549
|
var BASIS_TITLES = {
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4550
|
+
extracted: "Extracted from a source document",
|
|
4551
|
+
entered: "Confirmed by a person",
|
|
4552
|
+
computed: "Computed from other values",
|
|
4553
|
+
asserted: "Agent, unverified \u2014 no source recorded"
|
|
4548
4554
|
};
|
|
4549
4555
|
function RecordGrid({
|
|
4550
4556
|
columns,
|
|
4551
|
-
rows,
|
|
4552
4557
|
caption,
|
|
4553
|
-
state
|
|
4554
|
-
error,
|
|
4555
|
-
onRetry,
|
|
4558
|
+
state,
|
|
4556
4559
|
empty,
|
|
4557
4560
|
onCreate,
|
|
4558
4561
|
onUpdate,
|
|
@@ -4586,10 +4589,11 @@ function RecordGrid({
|
|
|
4586
4589
|
editingRef.current = next;
|
|
4587
4590
|
setEditingState(next);
|
|
4588
4591
|
}, []);
|
|
4592
|
+
const callerRows = state.status === "ready" || state.status === "empty" ? state.value : EMPTY_RECORD_GRID_ROWS;
|
|
4589
4593
|
useEffect11(() => {
|
|
4590
|
-
setOverlay((current) => pruneRecordGridOverlay(
|
|
4591
|
-
}, [
|
|
4592
|
-
const visibleRows = useMemo7(() => projectRecordGridRows(
|
|
4594
|
+
setOverlay((current) => pruneRecordGridOverlay(callerRows, current));
|
|
4595
|
+
}, [callerRows]);
|
|
4596
|
+
const visibleRows = useMemo7(() => projectRecordGridRows(callerRows, overlay), [callerRows, overlay]);
|
|
4593
4597
|
const activeFocus = useMemo7(() => {
|
|
4594
4598
|
if (focus === null) return null;
|
|
4595
4599
|
if (!visibleRows.some((row) => row.id === focus.rowId)) return null;
|
|
@@ -4798,8 +4802,7 @@ function RecordGrid({
|
|
|
4798
4802
|
},
|
|
4799
4803
|
[beginEdit, columns, editing, focusCell, onUpdate, visibleRows]
|
|
4800
4804
|
);
|
|
4801
|
-
|
|
4802
|
-
if (dataState === "loading") {
|
|
4805
|
+
if (state.status === "idle" || state.status === "loading") {
|
|
4803
4806
|
return /* @__PURE__ */ jsxs12("div", { className: `space-y-3 ${className ?? ""}`, children: [
|
|
4804
4807
|
toolbar,
|
|
4805
4808
|
/* @__PURE__ */ jsxs12(
|
|
@@ -4820,16 +4823,16 @@ function RecordGrid({
|
|
|
4820
4823
|
)
|
|
4821
4824
|
] });
|
|
4822
4825
|
}
|
|
4823
|
-
if (
|
|
4826
|
+
if (state.status === "error") {
|
|
4824
4827
|
return /* @__PURE__ */ jsxs12("div", { className: `space-y-3 ${className ?? ""}`, children: [
|
|
4825
4828
|
toolbar,
|
|
4826
4829
|
/* @__PURE__ */ jsxs12("div", { role: "alert", className: "rounded-xl border border-destructive/40 bg-destructive/10 px-4 py-4", children: [
|
|
4827
|
-
/* @__PURE__ */ jsx14("p", { className: "text-sm font-medium text-destructive", children:
|
|
4828
|
-
|
|
4830
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sm font-medium text-destructive", children: state.message }),
|
|
4831
|
+
/* @__PURE__ */ jsx14(
|
|
4829
4832
|
"button",
|
|
4830
4833
|
{
|
|
4831
4834
|
type: "button",
|
|
4832
|
-
onClick:
|
|
4835
|
+
onClick: state.retry,
|
|
4833
4836
|
className: "mt-3 rounded-md border border-destructive/40 px-3 py-1.5 text-xs font-medium text-destructive transition hover:bg-destructive/10",
|
|
4834
4837
|
children: "Try again"
|
|
4835
4838
|
}
|
|
@@ -4862,7 +4865,15 @@ function RecordGrid({
|
|
|
4862
4865
|
/* @__PURE__ */ jsx14("p", { className: "text-sm font-medium text-foreground", children: empty.title }),
|
|
4863
4866
|
empty.description && /* @__PURE__ */ jsx14("p", { className: "mx-auto mt-1 max-w-md text-sm text-muted-foreground", children: empty.description }),
|
|
4864
4867
|
/* @__PURE__ */ jsxs12("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-2", children: [
|
|
4865
|
-
empty.action
|
|
4868
|
+
empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */ jsx14(
|
|
4869
|
+
"button",
|
|
4870
|
+
{
|
|
4871
|
+
type: "button",
|
|
4872
|
+
onClick: empty.action.onClick,
|
|
4873
|
+
className: "rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent/30",
|
|
4874
|
+
children: empty.action.label
|
|
4875
|
+
}
|
|
4876
|
+
)),
|
|
4866
4877
|
onCreate && /* @__PURE__ */ jsx14(
|
|
4867
4878
|
"button",
|
|
4868
4879
|
{
|
|
@@ -5158,7 +5169,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
5158
5169
|
);
|
|
5159
5170
|
}
|
|
5160
5171
|
function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle }) {
|
|
5161
|
-
const basis = source.basis ?? "
|
|
5172
|
+
const basis = source.basis ?? "asserted";
|
|
5162
5173
|
return /* @__PURE__ */ jsxs12("span", { className: "relative inline-flex", children: [
|
|
5163
5174
|
/* @__PURE__ */ jsx14(
|
|
5164
5175
|
"button",
|
|
@@ -6364,4 +6375,4 @@ export {
|
|
|
6364
6375
|
useThinkingSeconds,
|
|
6365
6376
|
ChatMessages
|
|
6366
6377
|
};
|
|
6367
|
-
//# sourceMappingURL=chunk-
|
|
6378
|
+
//# sourceMappingURL=chunk-WC43OQMR.js.map
|