@stigmer/react 3.12.7 → 3.12.8
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/composer/ComposerToolbar.d.ts +1 -19
- package/composer/ComposerToolbar.d.ts.map +1 -1
- package/composer/ComposerToolbar.js +2 -7
- package/composer/ComposerToolbar.js.map +1 -1
- package/composer/SessionComposer.d.ts +0 -10
- package/composer/SessionComposer.d.ts.map +1 -1
- package/composer/SessionComposer.js +2 -2
- package/composer/SessionComposer.js.map +1 -1
- package/composer/index.d.ts +0 -1
- package/composer/index.d.ts.map +1 -1
- package/composer/index.js.map +1 -1
- package/execution/ResultView.d.ts.map +1 -1
- package/execution/ResultView.js +6 -0
- package/execution/ResultView.js.map +1 -1
- package/execution/ToolCallItem.d.ts.map +1 -1
- package/execution/ToolCallItem.js +13 -2
- package/execution/ToolCallItem.js.map +1 -1
- package/execution/tool-categories.d.ts +1 -1
- package/execution/tool-categories.d.ts.map +1 -1
- package/execution/tool-categories.js +6 -0
- package/execution/tool-categories.js.map +1 -1
- package/identity-account/AccountPreferencesPanel.d.ts +2 -1
- package/identity-account/AccountPreferencesPanel.d.ts.map +1 -1
- package/identity-account/AccountPreferencesPanel.js +41 -3
- package/identity-account/AccountPreferencesPanel.js.map +1 -1
- package/identity-account/useAccountExecutionDefaults.d.ts +7 -0
- package/identity-account/useAccountExecutionDefaults.d.ts.map +1 -1
- package/identity-account/useAccountExecutionDefaults.js +5 -2
- package/identity-account/useAccountExecutionDefaults.js.map +1 -1
- package/index.d.ts +4 -4
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/internal/MemoryEnabledRow.d.ts +37 -0
- package/internal/MemoryEnabledRow.d.ts.map +1 -0
- package/internal/MemoryEnabledRow.js +25 -0
- package/internal/MemoryEnabledRow.js.map +1 -0
- package/memory/MemoryProposalCard.d.ts +35 -0
- package/memory/MemoryProposalCard.d.ts.map +1 -0
- package/memory/MemoryProposalCard.js +73 -0
- package/memory/MemoryProposalCard.js.map +1 -0
- package/memory/index.d.ts +2 -0
- package/memory/index.d.ts.map +1 -1
- package/memory/index.js +2 -0
- package/memory/index.js.map +1 -1
- package/memory/useMemory.d.ts +39 -0
- package/memory/useMemory.d.ts.map +1 -0
- package/memory/useMemory.js +43 -0
- package/memory/useMemory.js.map +1 -0
- package/organization/OrgPreferencesPanel.d.ts.map +1 -1
- package/organization/OrgPreferencesPanel.js +36 -4
- package/organization/OrgPreferencesPanel.js.map +1 -1
- package/package.json +4 -4
- package/session/AutoApproveIndicator.d.ts +18 -0
- package/session/AutoApproveIndicator.d.ts.map +1 -0
- package/session/AutoApproveIndicator.js +23 -0
- package/session/AutoApproveIndicator.js.map +1 -0
- package/session/NewSessionViewer.d.ts.map +1 -1
- package/session/NewSessionViewer.js +10 -9
- package/session/NewSessionViewer.js.map +1 -1
- package/session/SessionViewer.d.ts +21 -9
- package/session/SessionViewer.d.ts.map +1 -1
- package/session/SessionViewer.js +31 -21
- package/session/SessionViewer.js.map +1 -1
- package/session/facets/SetupTab.d.ts +43 -6
- package/session/facets/SetupTab.d.ts.map +1 -1
- package/session/facets/SetupTab.js +32 -36
- package/session/facets/SetupTab.js.map +1 -1
- package/session/facets/UsageTab.d.ts +2 -1
- package/session/facets/UsageTab.d.ts.map +1 -1
- package/session/facets/UsageTab.js +11 -5
- package/session/facets/UsageTab.js.map +1 -1
- package/session/facets/index.d.ts +1 -1
- package/session/facets/index.d.ts.map +1 -1
- package/session/facets/primitives.d.ts +58 -0
- package/session/facets/primitives.d.ts.map +1 -0
- package/session/facets/primitives.js +59 -0
- package/session/facets/primitives.js.map +1 -0
- package/session/index.d.ts +1 -1
- package/session/index.d.ts.map +1 -1
- package/session/index.js.map +1 -1
- package/session/useNewSessionFlow.d.ts +9 -4
- package/session/useNewSessionFlow.d.ts.map +1 -1
- package/session/useNewSessionFlow.js +20 -9
- package/session/useNewSessionFlow.js.map +1 -1
- package/session/useSessionPageFlow.d.ts +28 -10
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +16 -10
- package/session/useSessionPageFlow.js.map +1 -1
- package/src/attachment/__tests__/prepare-image.test.ts +12 -6
- package/src/composer/ComposerToolbar.tsx +0 -57
- package/src/composer/SessionComposer.tsx +1 -13
- package/src/composer/index.ts +0 -1
- package/src/execution/ResultView.tsx +6 -0
- package/src/execution/ToolCallItem.tsx +18 -1
- package/src/execution/tool-categories.ts +7 -0
- package/src/identity-account/AccountPreferencesPanel.tsx +89 -2
- package/src/identity-account/__tests__/AccountPreferencesPanel.test.tsx +112 -0
- package/src/identity-account/__tests__/useAccountExecutionDefaults.test.tsx +34 -1
- package/src/identity-account/useAccountExecutionDefaults.ts +12 -2
- package/src/index.ts +5 -1
- package/src/internal/MemoryEnabledRow.tsx +92 -0
- package/src/memory/MemoryProposalCard.tsx +181 -0
- package/src/memory/__tests__/MemoryProposalCard.test.tsx +236 -0
- package/src/memory/__tests__/memoryHooks.test.tsx +63 -0
- package/src/memory/index.ts +5 -0
- package/src/memory/useMemory.ts +80 -0
- package/src/organization/OrgPreferencesPanel.tsx +52 -3
- package/src/organization/__tests__/OrgPreferencesPanel.test.tsx +65 -0
- package/src/session/AutoApproveIndicator.tsx +45 -0
- package/src/session/NewSessionViewer.tsx +18 -15
- package/src/session/SessionViewer.tsx +70 -32
- package/src/session/__tests__/NewSessionViewer.test.tsx +32 -0
- package/src/session/__tests__/SessionViewer-autoApprove.test.tsx +244 -0
- package/src/session/__tests__/SessionViewer-transcriptExport.test.tsx +60 -22
- package/src/session/__tests__/useNewSessionFlow.test.tsx +56 -0
- package/src/session/__tests__/useSessionPageFlow.autoApprove.test.tsx +87 -0
- package/src/session/facets/SetupTab.tsx +193 -157
- package/src/session/facets/UsageTab.tsx +38 -38
- package/src/session/facets/index.ts +1 -0
- package/src/session/facets/primitives.tsx +169 -0
- package/src/session/index.ts +1 -0
- package/src/session/useNewSessionFlow.ts +30 -15
- package/src/session/useSessionPageFlow.ts +44 -20
- package/src/switch/Switch.tsx +4 -0
- package/src/workflow/__tests__/useWorkflowCanvas.dirty.test.tsx +7 -2
- package/src/workflow/__tests__/useWorkflowCanvas.drag.test.tsx +7 -2
- package/src/workspace/WorkspaceSurface.tsx +26 -3
- package/styles.css +1 -1
- package/switch/Switch.d.ts +3 -1
- package/switch/Switch.d.ts.map +1 -1
- package/switch/Switch.js +2 -2
- package/switch/Switch.js.map +1 -1
- package/workspace/WorkspaceSurface.js +11 -2
- package/workspace/WorkspaceSurface.js.map +1 -1
- package/src/composer/__tests__/ComposerToolbar-autoApprove.test.tsx +0 -80
- package/src/session/__tests__/SessionViewer-autoApproveToggle.test.tsx +0 -178
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Props for {@link MemoryEnabledRow}. */
|
|
2
|
+
export interface MemoryEnabledRowProps {
|
|
3
|
+
/** Id for the switch control (aria-labelledby wiring). */
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/** The stored flag value (server state, or an optimistic pending value). */
|
|
6
|
+
readonly checked: boolean;
|
|
7
|
+
/** Fired with the next value when the user flips the switch. */
|
|
8
|
+
readonly onToggle: (next: boolean) => void;
|
|
9
|
+
/** `true` while the flip is being saved (switch disabled, spinner shown). */
|
|
10
|
+
readonly saving: boolean;
|
|
11
|
+
/** `true` when the caller may not edit the flag (read-only rendering). */
|
|
12
|
+
readonly readOnly?: boolean;
|
|
13
|
+
/** Error from the last failed flip, or `null`. */
|
|
14
|
+
readonly error: Error | null;
|
|
15
|
+
/**
|
|
16
|
+
* The scope-specific helper copy (DD-006 D6's transparency statement
|
|
17
|
+
* belongs here). Rendered under the title, wired as the switch's
|
|
18
|
+
* accessible description.
|
|
19
|
+
*/
|
|
20
|
+
readonly helperText: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The `memory_enabled` consent toggle — one row, shared verbatim by
|
|
24
|
+
* {@link OrgPreferencesPanel} and {@link AccountPreferencesPanel} so the
|
|
25
|
+
* two scopes of the double opt-in (DD-006 D1) present identically.
|
|
26
|
+
*
|
|
27
|
+
* INSTANT-APPLY by deliberate exception (UX checkpoint, owner-approved
|
|
28
|
+
* 2026-08-22): both host panels are save-button forms, but a consent bit
|
|
29
|
+
* flipped-and-unsaved that silently reverts on navigation is exactly the
|
|
30
|
+
* failure consent UX must not have — so this row saves the moment it is
|
|
31
|
+
* flipped, matching the Switch primitive's own contract ("instant binary
|
|
32
|
+
* changes") and every peer product's memory toggle. The helper copy
|
|
33
|
+
* states it. Hosts wire `onToggle` to their own full-spec-replace update
|
|
34
|
+
* and pass the in-flight/error state back down.
|
|
35
|
+
*/
|
|
36
|
+
export declare function MemoryEnabledRow({ id, checked, onToggle, saving, readOnly, error, helperText, }: MemoryEnabledRowProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=MemoryEnabledRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryEnabledRow.d.ts","sourceRoot":"","sources":["../../src/internal/MemoryEnabledRow.tsx"],"names":[],"mappings":"AAOA,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAgB,EAChB,KAAK,EACL,UAAU,GACX,EAAE,qBAAqB,2CAwCvB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { getUserMessage } from "@stigmer/sdk";
|
|
4
|
+
import { Switch } from "../switch/Switch.js";
|
|
5
|
+
import { SpinnerIcon } from "./SpinnerIcon.js";
|
|
6
|
+
/**
|
|
7
|
+
* The `memory_enabled` consent toggle — one row, shared verbatim by
|
|
8
|
+
* {@link OrgPreferencesPanel} and {@link AccountPreferencesPanel} so the
|
|
9
|
+
* two scopes of the double opt-in (DD-006 D1) present identically.
|
|
10
|
+
*
|
|
11
|
+
* INSTANT-APPLY by deliberate exception (UX checkpoint, owner-approved
|
|
12
|
+
* 2026-08-22): both host panels are save-button forms, but a consent bit
|
|
13
|
+
* flipped-and-unsaved that silently reverts on navigation is exactly the
|
|
14
|
+
* failure consent UX must not have — so this row saves the moment it is
|
|
15
|
+
* flipped, matching the Switch primitive's own contract ("instant binary
|
|
16
|
+
* changes") and every peer product's memory toggle. The helper copy
|
|
17
|
+
* states it. Hosts wire `onToggle` to their own full-spec-replace update
|
|
18
|
+
* and pass the in-flight/error state back down.
|
|
19
|
+
*/
|
|
20
|
+
export function MemoryEnabledRow({ id, checked, onToggle, saving, readOnly = false, error, helperText, }) {
|
|
21
|
+
const titleId = `${id}-title`;
|
|
22
|
+
const descriptionId = `${id}-description`;
|
|
23
|
+
return (_jsxs("div", { className: "stg:space-y-1", children: [_jsxs("div", { className: "stg:flex stg:items-start stg:justify-between stg:gap-3", children: [_jsxs("div", { className: "stg:min-w-0 stg:flex-1", children: [_jsx("span", { id: titleId, className: "stg:block stg:text-xs stg:font-medium stg:text-foreground", children: "Memory" }), _jsx("p", { id: descriptionId, className: "stg:text-[0.65rem] stg:leading-snug stg:text-muted-foreground", children: helperText })] }), _jsxs("span", { className: "stg:flex stg:shrink-0 stg:items-center stg:gap-1.5", children: [saving && _jsx(SpinnerIcon, { size: 12 }), _jsx(Switch, { id: id, checked: checked, onCheckedChange: onToggle, disabled: saving || readOnly, "aria-labelledby": titleId, "aria-describedby": descriptionId })] })] }), error && (_jsx("p", { className: "stg:text-[0.65rem] stg:text-destructive", role: "alert", children: getUserMessage(error) }))] }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=MemoryEnabledRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryEnabledRow.js","sourceRoot":"","sources":["../../src/internal/MemoryEnabledRow.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAwB/C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,EAAE,EACF,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,UAAU,GACY;IACtB,MAAM,OAAO,GAAG,GAAG,EAAE,QAAQ,CAAC;IAC9B,MAAM,aAAa,GAAG,GAAG,EAAE,cAAc,CAAC;IAE1C,OAAO,CACL,eAAK,SAAS,EAAC,eAAe,aAC5B,eAAK,SAAS,EAAC,wDAAwD,aACrE,eAAK,SAAS,EAAC,wBAAwB,aACrC,eACE,EAAE,EAAE,OAAO,EACX,SAAS,EAAC,2DAA2D,uBAGhE,EACP,YACE,EAAE,EAAE,aAAa,EACjB,SAAS,EAAC,+DAA+D,YAExE,UAAU,GACT,IACA,EACN,gBAAM,SAAS,EAAC,oDAAoD,aACjE,MAAM,IAAI,KAAC,WAAW,IAAC,IAAI,EAAE,EAAE,GAAI,EACpC,KAAC,MAAM,IACL,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,QAAQ,EACzB,QAAQ,EAAE,MAAM,IAAI,QAAQ,qBACX,OAAO,sBACN,aAAa,GAC/B,IACG,IACH,EACL,KAAK,IAAI,CACR,YAAG,SAAS,EAAC,yCAAyC,EAAC,IAAI,EAAC,OAAO,YAChE,cAAc,CAAC,KAAK,CAAC,GACpB,CACL,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Props for {@link MemoryProposalCardBody}. */
|
|
2
|
+
export interface MemoryProposalCardBodyProps {
|
|
3
|
+
/** The proposed memory's resource id (from the remember tool's answer). */
|
|
4
|
+
readonly memoryId: string;
|
|
5
|
+
/**
|
|
6
|
+
* The proposed fact as frozen in the tool result — shown VERBATIM
|
|
7
|
+
* (DD-005 D6: what you confirm is what future prompts inject, byte for
|
|
8
|
+
* byte). The live record's text supersedes it once fetched, so an edit
|
|
9
|
+
* made on the memory page is reflected here too.
|
|
10
|
+
*/
|
|
11
|
+
readonly fact: string;
|
|
12
|
+
/** Additional CSS class names for the root container. */
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The in-session consent surface for a memory proposal (DD-005 D4): the
|
|
17
|
+
* body of a `remember` tool call's row in the message thread, rendering
|
|
18
|
+
* the proposed fact verbatim with one-click Confirm / Reject actions.
|
|
19
|
+
*
|
|
20
|
+
* Lifecycle honesty across surfaces and reloads: the tool result this
|
|
21
|
+
* renders from is FROZEN at capture time, so the card fetches the
|
|
22
|
+
* record's current state ({@link useMemory}) — a proposal decided from
|
|
23
|
+
* the memory settings page (or another device) shows its decided state
|
|
24
|
+
* here instead of stale action buttons, and a deleted record reads
|
|
25
|
+
* "no longer stored" rather than failing. Rejection is one click, no
|
|
26
|
+
* confirmation dialog (the T04 Cursor lesson: expensive review teaches
|
|
27
|
+
* users to ignore the queue); deletion-with-confirmation lives on the
|
|
28
|
+
* memory page, the catch-up surface.
|
|
29
|
+
*
|
|
30
|
+
* Borderless by design (the {@link ApprovalCardBody} posture): the tool
|
|
31
|
+
* row's card owns the chrome, this component owns only the body. All
|
|
32
|
+
* visual properties flow through `--stgm-*` design tokens.
|
|
33
|
+
*/
|
|
34
|
+
export declare function MemoryProposalCardBody({ memoryId, fact, className, }: MemoryProposalCardBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=MemoryProposalCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryProposalCard.d.ts","sourceRoot":"","sources":["../../src/memory/MemoryProposalCard.tsx"],"names":[],"mappings":"AAaA,gDAAgD;AAChD,MAAM,WAAW,2BAA2B;IAC1C,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,IAAI,EACJ,SAAS,GACV,EAAE,2BAA2B,2CAgG7B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { getUserMessage } from "@stigmer/sdk";
|
|
6
|
+
import { MemoryLifecycleState } from "@stigmer/protos/ai/stigmer/agentic/memory/v1/enum_pb";
|
|
7
|
+
import { SpinnerIcon } from "../internal/SpinnerIcon.js";
|
|
8
|
+
import { formatMemoryProvenance } from "./memoryGroups.js";
|
|
9
|
+
import { useConfirmMemory } from "./useConfirmMemory.js";
|
|
10
|
+
import { useMemory } from "./useMemory.js";
|
|
11
|
+
import { useRejectMemory } from "./useRejectMemory.js";
|
|
12
|
+
/**
|
|
13
|
+
* The in-session consent surface for a memory proposal (DD-005 D4): the
|
|
14
|
+
* body of a `remember` tool call's row in the message thread, rendering
|
|
15
|
+
* the proposed fact verbatim with one-click Confirm / Reject actions.
|
|
16
|
+
*
|
|
17
|
+
* Lifecycle honesty across surfaces and reloads: the tool result this
|
|
18
|
+
* renders from is FROZEN at capture time, so the card fetches the
|
|
19
|
+
* record's current state ({@link useMemory}) — a proposal decided from
|
|
20
|
+
* the memory settings page (or another device) shows its decided state
|
|
21
|
+
* here instead of stale action buttons, and a deleted record reads
|
|
22
|
+
* "no longer stored" rather than failing. Rejection is one click, no
|
|
23
|
+
* confirmation dialog (the T04 Cursor lesson: expensive review teaches
|
|
24
|
+
* users to ignore the queue); deletion-with-confirmation lives on the
|
|
25
|
+
* memory page, the catch-up surface.
|
|
26
|
+
*
|
|
27
|
+
* Borderless by design (the {@link ApprovalCardBody} posture): the tool
|
|
28
|
+
* row's card owns the chrome, this component owns only the body. All
|
|
29
|
+
* visual properties flow through `--stgm-*` design tokens.
|
|
30
|
+
*/
|
|
31
|
+
export function MemoryProposalCardBody({ memoryId, fact, className, }) {
|
|
32
|
+
const { memory, isLoading, notFound, error: fetchError } = useMemory(memoryId);
|
|
33
|
+
const { confirmMemory, isConfirming, error: confirmError } = useConfirmMemory();
|
|
34
|
+
const { rejectMemory, isRejecting, error: rejectError } = useRejectMemory();
|
|
35
|
+
// The card's own decision lands here so the settled state renders
|
|
36
|
+
// immediately — the fetch stays the authority for every OTHER writer
|
|
37
|
+
// (the memory page, another device), read once on mount.
|
|
38
|
+
const [decided, setDecided] = useState(null);
|
|
39
|
+
const act = useCallback(async (action) => {
|
|
40
|
+
try {
|
|
41
|
+
setDecided(await action(memoryId));
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Error state is surfaced via the hooks.
|
|
45
|
+
}
|
|
46
|
+
}, [memoryId]);
|
|
47
|
+
const record = decided ?? memory;
|
|
48
|
+
const state = record?.status?.lifecycleState;
|
|
49
|
+
// The live record's text supersedes the frozen tool result (the subject
|
|
50
|
+
// may have edited the fact on the memory page before deciding).
|
|
51
|
+
const displayFact = record?.spec?.content || fact;
|
|
52
|
+
const provenance = record ? formatMemoryProvenance(record) : null;
|
|
53
|
+
const actionError = confirmError ?? rejectError;
|
|
54
|
+
const isBusy = isConfirming || isRejecting;
|
|
55
|
+
const showActions = !notFound &&
|
|
56
|
+
fetchError == null &&
|
|
57
|
+
(state === undefined ||
|
|
58
|
+
state === MemoryLifecycleState.lifecycle_state_unspecified ||
|
|
59
|
+
state === MemoryLifecycleState.lifecycle_state_proposed);
|
|
60
|
+
return (_jsxs("div", { className: cn("stg:space-y-2", className), "data-cursor-target": "memory-proposal", children: [_jsx("p", { className: "stg:text-sm stg:text-foreground stg:whitespace-pre-wrap", children: displayFact }), _jsxs("p", { className: "stg:text-xs stg:text-muted-foreground", children: [provenance ? `${provenance} · ` : "", "Proposed to remember \u2014 nothing is stored in your sessions until you confirm it."] }), notFound ? (_jsx("p", { className: "stg:text-xs stg:text-muted-foreground", role: "status", children: "No longer stored." })) : fetchError ? (
|
|
61
|
+
// The fact stays visible (it is frozen in the tool result); only
|
|
62
|
+
// the actionable state is unavailable. Decide from the memory
|
|
63
|
+
// page instead — the catch-up surface.
|
|
64
|
+
_jsx("p", { className: "stg:text-xs stg:text-muted-foreground", role: "status", children: "Couldn't load this proposal's current state \u2014 review it in Settings \u2192 Memory." })) : showActions ? (_jsxs("div", { className: "stg:flex stg:items-center stg:gap-1.5", children: [_jsxs(ChipButton, { label: `Confirm memory: ${displayFact}`, onClick: () => void act(confirmMemory), disabled: isBusy || isLoading, emphasis: "primary", children: [isConfirming && _jsx(SpinnerIcon, { size: 12 }), "Confirm"] }), _jsxs(ChipButton, { label: `Reject memory: ${displayFact}`, onClick: () => void act(rejectMemory), disabled: isBusy || isLoading, children: [isRejecting && _jsx(SpinnerIcon, { size: 12 }), "Reject"] })] })) : (_jsx("p", { className: "stg:text-xs stg:text-muted-foreground", role: "status", children: state === MemoryLifecycleState.lifecycle_state_confirmed
|
|
65
|
+
? "Confirmed — recalled in your future sessions."
|
|
66
|
+
: "Rejected — not stored." })), actionError && (_jsx("p", { className: "stg:text-[0.65rem] stg:text-destructive", role: "alert", children: getUserMessage(actionError) }))] }));
|
|
67
|
+
}
|
|
68
|
+
function ChipButton({ label, onClick, disabled, emphasis, children, }) {
|
|
69
|
+
return (_jsx("button", { type: "button", "aria-label": label, onClick: onClick, disabled: disabled, className: cn("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium", emphasis === "primary"
|
|
70
|
+
? "stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover"
|
|
71
|
+
: "stg:border stg:border-input stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground", "stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring", "stg:disabled:pointer-events-none stg:disabled:opacity-50"), children: children }));
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=MemoryProposalCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryProposalCard.js","sourceRoot":"","sources":["../../src/memory/MemoryProposalCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD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IAAI,SAAS,aAE5B,WAAW,IAAI,KAAC,WAAW,IAAC,IAAI,EAAE,EAAE,GAAI,cAE9B,IACT,CACP,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAC,uCAAuC,EAAC,IAAI,EAAC,QAAQ,YAC/D,KAAK,KAAK,oBAAoB,CAAC,yBAAyB;oBACvD,CAAC,CAAC,+CAA+C;oBACjD,CAAC,CAAC,wBAAwB,GAC1B,CACL,EAEA,WAAW,IAAI,CACd,YAAG,SAAS,EAAC,yCAAyC,EAAC,IAAI,EAAC,OAAO,YAChE,cAAc,CAAC,WAAW,CAAC,GAC1B,CACL,IACG,CACP,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAClB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,GAOT;IACC,OAAO,CACL,iBACE,IAAI,EAAC,QAAQ,gBACD,KAAK,EACjB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,2GAA2G,EAC3G,QAAQ,KAAK,SAAS;YACpB,CAAC,CAAC,uEAAuE;YACzE,CAAC,CAAC,wHAAwH,EAC5H,qFAAqF,EACrF,0DAA0D,CAC3D,YAEA,QAAQ,GACF,CACV,CAAC;AACJ,CAAC"}
|
package/memory/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { MemoryListPanel, type MemoryListPanelProps } from "./MemoryListPanel.js";
|
|
2
|
+
export { MemoryProposalCardBody, type MemoryProposalCardBodyProps, } from "./MemoryProposalCard.js";
|
|
2
3
|
export { groupMemoriesByLifecycle, formatMemoryProvenance, type MemoryGroups, } from "./memoryGroups.js";
|
|
3
4
|
export { useMemories, type UseMemoriesReturn } from "./useMemories.js";
|
|
5
|
+
export { useMemory, type UseMemoryReturn } from "./useMemory.js";
|
|
4
6
|
export { useConfirmMemory, type UseConfirmMemoryReturn } from "./useConfirmMemory.js";
|
|
5
7
|
export { useRejectMemory, type UseRejectMemoryReturn } from "./useRejectMemory.js";
|
|
6
8
|
export { useDeleteMemory, type UseDeleteMemoryReturn } from "./useDeleteMemory.js";
|
package/memory/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,KAAK,YAAY,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,GAClC,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,KAAK,YAAY,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,GAClC,MAAM,6BAA6B,CAAC"}
|
package/memory/index.js
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
// fact is individually reviewable, editable, and deletable, and nothing
|
|
4
4
|
// is recalled until its subject confirms it.
|
|
5
5
|
export { MemoryListPanel } from "./MemoryListPanel.js";
|
|
6
|
+
export { MemoryProposalCardBody, } from "./MemoryProposalCard.js";
|
|
6
7
|
export { groupMemoriesByLifecycle, formatMemoryProvenance, } from "./memoryGroups.js";
|
|
7
8
|
export { useMemories } from "./useMemories.js";
|
|
9
|
+
export { useMemory } from "./useMemory.js";
|
|
8
10
|
export { useConfirmMemory } from "./useConfirmMemory.js";
|
|
9
11
|
export { useRejectMemory } from "./useRejectMemory.js";
|
|
10
12
|
export { useDeleteMemory } from "./useDeleteMemory.js";
|
package/memory/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,wEAAwE;AACxE,wEAAwE;AACxE,6CAA6C;AAE7C,OAAO,EAAE,eAAe,EAA6B,MAAM,sBAAsB,CAAC;AAClF,OAAO,EACL,wBAAwB,EACxB,sBAAsB,GAEvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAA0B,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAA+B,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,eAAe,EAA8B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,eAAe,EAA8B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,sBAAsB,GAEvB,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,wEAAwE;AACxE,wEAAwE;AACxE,6CAA6C;AAE7C,OAAO,EAAE,eAAe,EAA6B,MAAM,sBAAsB,CAAC;AAClF,OAAO,EACL,sBAAsB,GAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,sBAAsB,GAEvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAA0B,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAwB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAA+B,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,eAAe,EAA8B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,eAAe,EAA8B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,sBAAsB,GAEvB,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Memory } from "@stigmer/protos/ai/stigmer/agentic/memory/v1/api_pb";
|
|
2
|
+
/** Return value of {@link useMemory}. */
|
|
3
|
+
export interface UseMemoryReturn {
|
|
4
|
+
/** The memory record, or `null` while loading / not found / on error. */
|
|
5
|
+
readonly memory: Memory | null;
|
|
6
|
+
/** `true` while the initial fetch is in flight. */
|
|
7
|
+
readonly isLoading: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* `true` when the record no longer exists. A first-class STATE, not an
|
|
10
|
+
* error: deletion is the platform's consent-revocation mechanism, so a
|
|
11
|
+
* consumer (the proposal chip, a deep link) must render "no longer
|
|
12
|
+
* stored" honestly rather than a failure.
|
|
13
|
+
*/
|
|
14
|
+
readonly notFound: boolean;
|
|
15
|
+
/** Error from the last failed request (never not-found), or `null`. */
|
|
16
|
+
readonly error: Error | null;
|
|
17
|
+
/** Discard cached data and re-fetch the record from the server. */
|
|
18
|
+
readonly refetch: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Data hook that fetches one memory record by id.
|
|
22
|
+
*
|
|
23
|
+
* Built for surfaces that hold a memory's identity but not its CURRENT
|
|
24
|
+
* lifecycle state — the in-thread proposal chip is the primary consumer:
|
|
25
|
+
* the tool result it renders from is frozen at capture time, while the
|
|
26
|
+
* record may have been confirmed, rejected, or deleted since (from the
|
|
27
|
+
* chip itself, the memory settings page, or another device). Content
|
|
28
|
+
* visibility is subject-only, so the fetch answers only for the person
|
|
29
|
+
* the memory is about.
|
|
30
|
+
*
|
|
31
|
+
* Pass `null` as `id` to skip fetching (stable no-op).
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* const { memory, isLoading, notFound } = useMemory(memoryId);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function useMemory(id: string | null): UseMemoryReturn;
|
|
39
|
+
//# sourceMappingURL=useMemory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMemory.d.ts","sourceRoot":"","sources":["../../src/memory/useMemory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qDAAqD,CAAC;AAKlF,yCAAyC;AACzC,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAUD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,eAAe,CA2B5D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { isNotFound } from "@stigmer/sdk";
|
|
3
|
+
import { useStigmer } from "../hooks.js";
|
|
4
|
+
import { useFetch } from "../internal/useFetch.js";
|
|
5
|
+
const PENDING_LOOKUP = { memory: null, notFound: false };
|
|
6
|
+
/**
|
|
7
|
+
* Data hook that fetches one memory record by id.
|
|
8
|
+
*
|
|
9
|
+
* Built for surfaces that hold a memory's identity but not its CURRENT
|
|
10
|
+
* lifecycle state — the in-thread proposal chip is the primary consumer:
|
|
11
|
+
* the tool result it renders from is frozen at capture time, while the
|
|
12
|
+
* record may have been confirmed, rejected, or deleted since (from the
|
|
13
|
+
* chip itself, the memory settings page, or another device). Content
|
|
14
|
+
* visibility is subject-only, so the fetch answers only for the person
|
|
15
|
+
* the memory is about.
|
|
16
|
+
*
|
|
17
|
+
* Pass `null` as `id` to skip fetching (stable no-op).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const { memory, isLoading, notFound } = useMemory(memoryId);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function useMemory(id) {
|
|
25
|
+
const stigmer = useStigmer();
|
|
26
|
+
const { data, isLoading, error, refetch } = useFetch(id
|
|
27
|
+
? () => stigmer.memory.get(id).then((memory) => ({ memory, notFound: false }), (err) => {
|
|
28
|
+
// Deletion is a state this hook reports, never an error it
|
|
29
|
+
// throws — every other failure propagates.
|
|
30
|
+
if (isNotFound(err))
|
|
31
|
+
return { memory: null, notFound: true };
|
|
32
|
+
throw err;
|
|
33
|
+
})
|
|
34
|
+
: null, [stigmer, id], PENDING_LOOKUP);
|
|
35
|
+
return {
|
|
36
|
+
memory: data.memory,
|
|
37
|
+
isLoading,
|
|
38
|
+
notFound: data.notFound,
|
|
39
|
+
error,
|
|
40
|
+
refetch,
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ACR,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgPreferencesPanel.d.ts","sourceRoot":"","sources":["../../src/organization/OrgPreferencesPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"OrgPreferencesPanel.d.ts","sourceRoot":"","sources":["../../src/organization/OrgPreferencesPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AAQ9F,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,CAAC;IACjD,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,SAAS,EACT,SAAS,GACV,EAAE,wBAAwB,kDA8N1B"}
|
|
@@ -6,6 +6,7 @@ import { getUserMessage, toOrganizationUpdateInput } from "@stigmer/sdk";
|
|
|
6
6
|
import { useOrganization } from "./useOrganization.js";
|
|
7
7
|
import { useUpdateOrganization } from "./useUpdateOrganization.js";
|
|
8
8
|
import { useCheckPermission } from "../iam-policy/useCheckPermission.js";
|
|
9
|
+
import { MemoryEnabledRow } from "../internal/MemoryEnabledRow.js";
|
|
9
10
|
import { StandingContextField } from "../internal/StandingContextField.js";
|
|
10
11
|
import { SpinnerIcon } from "../internal/SpinnerIcon.js";
|
|
11
12
|
/**
|
|
@@ -32,6 +33,9 @@ export function OrgPreferencesPanel({ orgId, onUpdated, className, }) {
|
|
|
32
33
|
const baseId = useId();
|
|
33
34
|
const { organization, isLoading: isFetching, error: fetchError, refetch, } = useOrganization(orgId || null);
|
|
34
35
|
const { update, isUpdating, error: updateError, clearError, } = useUpdateOrganization();
|
|
36
|
+
// The memory toggle saves instantly (its own hook instance, so a flip's
|
|
37
|
+
// in-flight/error state never bleeds into the form's Save button).
|
|
38
|
+
const { update: updateMemoryFlag, isUpdating: isSavingMemoryFlag, error: memoryFlagError, } = useUpdateOrganization();
|
|
35
39
|
// Fail-open: OSS local mode has no IAM service, so editing stays
|
|
36
40
|
// available there; cloud gets a genuine server verdict.
|
|
37
41
|
const { allowed: canEdit } = useCheckPermission(orgId ? { kind: "organization", id: orgId } : null, "can_edit");
|
|
@@ -56,10 +60,16 @@ export function OrgPreferencesPanel({ orgId, onUpdated, className, }) {
|
|
|
56
60
|
clearError();
|
|
57
61
|
try {
|
|
58
62
|
// update() is a full-spec replace: spread the complete mapped input
|
|
59
|
-
// so unedited spec fields survive
|
|
63
|
+
// so unedited spec fields survive. `preferences` is a nested message,
|
|
64
|
+
// so the override spreads the mapper's COMPLETE preferences too —
|
|
65
|
+
// fields this form does not own (memory_enabled) survive the save.
|
|
66
|
+
const mapped = toOrganizationUpdateInput(organization);
|
|
60
67
|
const updated = await update({
|
|
61
|
-
...
|
|
62
|
-
preferences: {
|
|
68
|
+
...mapped,
|
|
69
|
+
preferences: {
|
|
70
|
+
...mapped.preferences,
|
|
71
|
+
standingContext: standingContext.trim() || undefined,
|
|
72
|
+
},
|
|
63
73
|
});
|
|
64
74
|
refetch();
|
|
65
75
|
onUpdated?.(updated);
|
|
@@ -68,6 +78,28 @@ export function OrgPreferencesPanel({ orgId, onUpdated, className, }) {
|
|
|
68
78
|
// error state is managed by useUpdateOrganization
|
|
69
79
|
}
|
|
70
80
|
}, [canSubmit, organization, standingContext, update, clearError, refetch, onUpdated]);
|
|
81
|
+
// The memory consent flag applies instantly (the UX-checkpoint decision):
|
|
82
|
+
// a consent bit flipped-but-unsaved that silently reverts on navigation is
|
|
83
|
+
// the failure consent UX must not have. Same wipe-safe double spread.
|
|
84
|
+
const handleMemoryToggle = useCallback(async (next) => {
|
|
85
|
+
if (!organization)
|
|
86
|
+
return;
|
|
87
|
+
try {
|
|
88
|
+
const mapped = toOrganizationUpdateInput(organization);
|
|
89
|
+
const updated = await updateMemoryFlag({
|
|
90
|
+
...mapped,
|
|
91
|
+
preferences: {
|
|
92
|
+
...mapped.preferences,
|
|
93
|
+
memoryEnabled: next || undefined,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
refetch();
|
|
97
|
+
onUpdated?.(updated);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// error state is managed by the toggle's own hook instance
|
|
101
|
+
}
|
|
102
|
+
}, [organization, updateMemoryFlag, refetch, onUpdated]);
|
|
71
103
|
// -----------------------------------------------------------------------
|
|
72
104
|
// Loading state
|
|
73
105
|
// -----------------------------------------------------------------------
|
|
@@ -85,6 +117,6 @@ export function OrgPreferencesPanel({ orgId, onUpdated, className, }) {
|
|
|
85
117
|
// -----------------------------------------------------------------------
|
|
86
118
|
// Render
|
|
87
119
|
// -----------------------------------------------------------------------
|
|
88
|
-
return (_jsxs("form", { onSubmit: handleSubmit, className: cn("stg:space-y-4", className), children: [_jsx(StandingContextField, { id: `${baseId}-standing-context`, value: standingContext, onChange: setStandingContext, disabled: isUpdating, readOnly: !canEdit, placeholder: "e.g. We deploy to us-east-1. Our stack is Go and TypeScript. Prefer concise answers.", helperText: "Shared with agents as background context \u2014 not instructions. Applies to executions started by signed-in members of this organization and is visible on their execution records." }), !canEdit && (_jsx("p", { className: "stg:text-[0.65rem] stg:text-muted-foreground", children: "Only organization admins can edit these preferences." })), updateError && (_jsx("p", { className: "stg:text-destructive stg:text-[0.65rem]", role: "alert", children: getUserMessage(updateError) })), canEdit && (_jsxs("div", { className: "stg:flex stg:items-center stg:gap-2", children: [_jsxs("button", { type: "submit", disabled: !canSubmit, className: cn("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium", "stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover", "stg:disabled:pointer-events-none stg:disabled:opacity-40"), children: [isUpdating && _jsx(SpinnerIcon, { size: 12 }), "Save changes"] }), hasChanges && !isUpdating && (_jsx("button", { type: "button", onClick: handleDiscard, className: cn("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs", "stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover"), children: "Discard" }))] }))] }));
|
|
120
|
+
return (_jsxs("form", { onSubmit: handleSubmit, className: cn("stg:space-y-4", className), children: [_jsx(StandingContextField, { id: `${baseId}-standing-context`, value: standingContext, onChange: setStandingContext, disabled: isUpdating, readOnly: !canEdit, placeholder: "e.g. We deploy to us-east-1. Our stack is Go and TypeScript. Prefer concise answers.", helperText: "Shared with agents as background context \u2014 not instructions. Applies to executions started by signed-in members of this organization and is visible on their execution records." }), _jsx(MemoryEnabledRow, { id: `${baseId}-memory-enabled`, checked: organization.spec?.preferences?.memoryEnabled ?? false, onToggle: (next) => void handleMemoryToggle(next), saving: isSavingMemoryFlag, readOnly: !canEdit, error: memoryFlagError, helperText: "Allow agents to remember confirmed facts about members of this organization. Each member must also turn memory on in their own account preferences. Changes apply immediately." }), !canEdit && (_jsx("p", { className: "stg:text-[0.65rem] stg:text-muted-foreground", children: "Only organization admins can edit these preferences." })), updateError && (_jsx("p", { className: "stg:text-destructive stg:text-[0.65rem]", role: "alert", children: getUserMessage(updateError) })), canEdit && (_jsxs("div", { className: "stg:flex stg:items-center stg:gap-2", children: [_jsxs("button", { type: "submit", disabled: !canSubmit, className: cn("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium", "stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover", "stg:disabled:pointer-events-none stg:disabled:opacity-40"), children: [isUpdating && _jsx(SpinnerIcon, { size: 12 }), "Save changes"] }), hasChanges && !isUpdating && (_jsx("button", { type: "button", onClick: handleDiscard, className: cn("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs", "stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover"), children: "Discard" }))] }))] }));
|
|
89
121
|
}
|
|
90
122
|
//# sourceMappingURL=OrgPreferencesPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgPreferencesPanel.js","sourceRoot":"","sources":["../../src/organization/OrgPreferencesPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAkB,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAYzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,KAAK,EACL,SAAS,EACT,SAAS,GACgB;IACzB,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IACvB,MAAM,EACJ,YAAY,EACZ,SAAS,EAAE,UAAU,EACrB,KAAK,EAAE,UAAU,EACjB,OAAO,GACR,GAAG,eAAe,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;IAEnC,MAAM,EACJ,MAAM,EACN,UAAU,EACV,KAAK,EAAE,WAAW,EAClB,UAAU,GACX,GAAG,qBAAqB,EAAE,CAAC;IAE5B,iEAAiE;IACjE,wDAAwD;IACxD,MAAM,EAAE,OAAO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AgL,GAC3L,EAED,CAAC,OAAO,IAAI,CACX,YAAG,SAAS,EAAC,8CAA8C,qEAEvD,CACL,EAEA,WAAW,IAAI,CACd,YAAG,SAAS,EAAC,yCAAyC,EAAC,IAAI,EAAC,OAAO,YAChE,cAAc,CAAC,WAAW,CAAC,GAC1B,CACL,EAEA,OAAO,IAAI,CACV,eAAK,SAAS,EAAC,qCAAqC,aAClD,kBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,SAAS,EACpB,SAAS,EAAE,EAAE,CACX,6GAA6G,EAC7G,uEAAuE,EACvE,0DAA0D,CAC3D,aAEA,UAAU,IAAI,KAAC,WAAW,IAAC,IAAI,EAAE,EAAE,GAAI,oBAEjC,EAER,UAAU,IAAI,CAAC,UAAU,IAAI,CAC5B,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,EAAE,CACX,gDAAgD,EAChD,+EAA+E,CAChF,wBAGM,CACV,IACG,CACP,IACI,CACR,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/react",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.8",
|
|
4
4
|
"description": "React provider and client hook for the Stigmer platform SDK",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@bufbuild/protovalidate": "^1.1.1",
|
|
39
39
|
"@dagrejs/dagre": "^1.1.4",
|
|
40
|
-
"@stigmer/theme": "3.12.
|
|
40
|
+
"@stigmer/theme": "3.12.8",
|
|
41
41
|
"diff": "^8.0.3",
|
|
42
42
|
"fflate": "^0.8.2",
|
|
43
43
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@codemirror/state": "^6.0.0",
|
|
61
61
|
"@codemirror/view": "^6.0.0",
|
|
62
62
|
"@lezer/highlight": "^1.0.0",
|
|
63
|
-
"@stigmer/protos": "3.12.
|
|
64
|
-
"@stigmer/sdk": "3.12.
|
|
63
|
+
"@stigmer/protos": "3.12.8",
|
|
64
|
+
"@stigmer/sdk": "3.12.8",
|
|
65
65
|
"@tanstack/react-table": "^8.20.0",
|
|
66
66
|
"@xyflow/react": "^12.0.0",
|
|
67
67
|
"elkjs": "^0.9.0",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Armed-only indicator for the session-scoped auto-approve state, docked
|
|
3
|
+
* above the composer. Renders nothing about approvals until auto-approve is
|
|
4
|
+
* actually ON — the composer stays clean by default — and while ON it is the
|
|
5
|
+
* always-visible safety surface: the user can never be silently
|
|
6
|
+
* auto-approving without seeing this strip and its one-click "Turn off".
|
|
7
|
+
*
|
|
8
|
+
* The way ON lives elsewhere (the Config facet's Run Config switch, the
|
|
9
|
+
* gate-time "Approve & don't ask again", the account's `default_auto_approve`
|
|
10
|
+
* preference, the host's `approvalDefaults`); this strip is deliberately only
|
|
11
|
+
* the way OFF plus the disclosure. Shared by `SessionViewer` and
|
|
12
|
+
* `NewSessionViewer` (DD-016) — a persisted account preference can arm the
|
|
13
|
+
* launcher before the first message, so both surfaces need the disclosure.
|
|
14
|
+
*/
|
|
15
|
+
export declare function AutoApproveIndicator({ onTurnOff }: {
|
|
16
|
+
readonly onTurnOff: () => void;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=AutoApproveIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoApproveIndicator.d.ts","sourceRoot":"","sources":["../../src/session/AutoApproveIndicator.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,IAAI,CAAA;CAAE,2CAmBrF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Armed-only indicator for the session-scoped auto-approve state, docked
|
|
5
|
+
* above the composer. Renders nothing about approvals until auto-approve is
|
|
6
|
+
* actually ON — the composer stays clean by default — and while ON it is the
|
|
7
|
+
* always-visible safety surface: the user can never be silently
|
|
8
|
+
* auto-approving without seeing this strip and its one-click "Turn off".
|
|
9
|
+
*
|
|
10
|
+
* The way ON lives elsewhere (the Config facet's Run Config switch, the
|
|
11
|
+
* gate-time "Approve & don't ask again", the account's `default_auto_approve`
|
|
12
|
+
* preference, the host's `approvalDefaults`); this strip is deliberately only
|
|
13
|
+
* the way OFF plus the disclosure. Shared by `SessionViewer` and
|
|
14
|
+
* `NewSessionViewer` (DD-016) — a persisted account preference can arm the
|
|
15
|
+
* launcher before the first message, so both surfaces need the disclosure.
|
|
16
|
+
*/
|
|
17
|
+
export function AutoApproveIndicator({ onTurnOff }) {
|
|
18
|
+
return (_jsxs("div", { role: "status", className: "stg:flex stg:items-center stg:gap-2 stg:border-t stg:border-border-muted stg:px-4 stg:py-1.5 stg:text-xs stg:text-muted-foreground", children: [_jsx(ShieldCheckIcon, {}), _jsx("span", { className: "stg:min-w-0 stg:flex-1 stg:truncate", children: "Auto-approving tool calls for this session" }), _jsx("button", { type: "button", onClick: onTurnOff, className: "stg:shrink-0 stg:rounded stg:font-medium stg:text-foreground stg:underline-offset-2 stg:hover:underline stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring", children: "Turn off" })] }));
|
|
19
|
+
}
|
|
20
|
+
function ShieldCheckIcon() {
|
|
21
|
+
return (_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "stg:shrink-0 stg:text-success", "aria-hidden": "true", children: [_jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }), _jsx("path", { d: "m9 12 2 2 4-4" })] }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=AutoApproveIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoApproveIndicator.js","sourceRoot":"","sources":["../../src/session/AutoApproveIndicator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAE,SAAS,EAAsC;IACpF,OAAO,CACL,eACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,oIAAoI,aAE9I,KAAC,eAAe,KAAG,EACnB,eAAM,SAAS,EAAC,qCAAqC,2DAE9C,EACP,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,SAAS,EAClB,SAAS,EAAC,6LAA6L,yBAGhM,IACL,CACP,CAAC;AACJ,CAAC;AAED,SAAS,eAAe;IACtB,OAAO,CACL,eAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAC,SAAS,EAAC,+BAA+B,iBAAa,MAAM,aACzM,eAAM,CAAC,EAAC,6CAA6C,GAAG,EACxD,eAAM,CAAC,EAAC,eAAe,GAAG,IACtB,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewSessionViewer.d.ts","sourceRoot":"","sources":["../../src/session/NewSessionViewer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;A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,EACb,SAAS,GACV,EAAE,qBAAqB,2CA2QvB"}
|
|
@@ -9,6 +9,7 @@ import { useNewSessionFlow } from "./useNewSessionFlow.js";
|
|
|
9
9
|
import { useSessionPanel } from "./useSessionPanel.js";
|
|
10
10
|
import { useSessionRailViews } from "./useSessionRailViews.js";
|
|
11
11
|
import { SessionPanelChip } from "./SessionPanelChip.js";
|
|
12
|
+
import { AutoApproveIndicator } from "./AutoApproveIndicator.js";
|
|
12
13
|
/**
|
|
13
14
|
* Full-featured new-session launcher organism — the pre-session analog
|
|
14
15
|
* of `SessionViewer`.
|
|
@@ -69,14 +70,6 @@ export function NewSessionViewer({ org, onSessionCreated, onError, gitHubConnect
|
|
|
69
70
|
// Host opt-out or audience restriction — the same single flag
|
|
70
71
|
// SessionViewer derives (DD-016), gating the chip and the region together.
|
|
71
72
|
const panelEnabled = panelMode !== "none" && !isGuest;
|
|
72
|
-
// Always-visible auto-approve toggle (#816), present before the first
|
|
73
|
-
// message is ever typed — the walk-away user arms it here and the create
|
|
74
|
-
// carries spec.auto_approve_all server-side. Guests never get it (the
|
|
75
|
-
// operator-consent reasoning as the #302 host default). Memoized per
|
|
76
|
-
// DD-010 — the composer is memo'd and an inline object would defeat it.
|
|
77
|
-
const autoApprove = useMemo(() => isGuest
|
|
78
|
-
? undefined
|
|
79
|
-
: { armed: flow.autoApproveAll, onChange: flow.setAutoApproveAll }, [isGuest, flow.autoApproveAll, flow.setAutoApproveAll]);
|
|
80
73
|
// Guest agent binding is host configuration, not a picker interaction:
|
|
81
74
|
// the composer's agent machinery (picker, env-collection, personal
|
|
82
75
|
// environments — all org reads a guest token cannot make) stays fully
|
|
@@ -129,6 +122,13 @@ export function NewSessionViewer({ org, onSessionCreated, onError, gitHubConnect
|
|
|
129
122
|
harness: flow.harness,
|
|
130
123
|
executionTarget: undefined,
|
|
131
124
|
modelId: flow.modelId,
|
|
125
|
+
// Pre-session arming (#816): the switch covers the session this
|
|
126
|
+
// surface will create — the bootstrap execution carries
|
|
127
|
+
// spec.auto_approve_all. Guests never get it (they never render the
|
|
128
|
+
// panel either — belt and braces for the operator-consent withhold).
|
|
129
|
+
autoApprove: isGuest
|
|
130
|
+
? undefined
|
|
131
|
+
: { armed: flow.autoApproveAll, onChange: flow.setAutoApproveAll },
|
|
132
132
|
// Curated audiences see the configuration but cannot strip it — the
|
|
133
133
|
// Setup tab renders read-only without mutation callbacks (DD-011).
|
|
134
134
|
mutations: isCurated
|
|
@@ -141,6 +141,7 @@ export function NewSessionViewer({ org, onSessionCreated, onError, gitHubConnect
|
|
|
141
141
|
}), [
|
|
142
142
|
flow.agentRef, flow.mcpServerUsages, flow.skillRefs,
|
|
143
143
|
flow.sessionVariables, flow.harness, flow.modelId,
|
|
144
|
+
flow.autoApproveAll, flow.setAutoApproveAll, isGuest,
|
|
144
145
|
isCurated, handleRemoveAgent, handleRemoveMcp, handleRemoveSkill,
|
|
145
146
|
]);
|
|
146
147
|
// Launcher facets: Config only — no executions exist yet, so the
|
|
@@ -170,7 +171,7 @@ export function NewSessionViewer({ org, onSessionCreated, onError, gitHubConnect
|
|
|
170
171
|
_jsx("div", { className: "stg:flex stg:h-full stg:flex-col stg:items-center stg:overflow-y-auto stg:px-4 stg:py-6", children: _jsxs("div", { className: "stg:my-auto stg:w-full stg:max-w-2xl stg:space-y-6", children: [_jsx("h1", { className: "stg:text-center stg:text-lg stg:font-medium stg:text-foreground", children: heading }), _jsx(SessionComposer, { onSubmit: flow.submit, isSubmitting: flow.isSubmitting, org: org, workspace: isGuest ? undefined : flow.workspace, gitHubConnection: enableGitHub && !isGuest ? gitHubConnection : undefined, enableGitHub: enableGitHub && !isGuest, enableLocal: enableLocal && !isGuest, onBrowseLocalFolder: onBrowseLocalFolder, agentRef: flow.agentRef,
|
|
171
172
|
// Guests get no agent machinery at all — the binding is applied
|
|
172
173
|
// by the launcher's pin effect above, not by picker resolution.
|
|
173
|
-
onAgentRefChange: isGuest ? undefined : flow.setAgentRef, onAgentResolutionChange: isGuest ? undefined : flow.setResolution, initialAgentRef: isGuest ? undefined : initialAgentRef, initialInstanceId: isGuest ? undefined : initialInstanceId, initialAttachments: isGuest ? undefined : initialAttachments, lockAgent: isCurated && initialAgentRef != null, mcpServerUsages: isCurated ? undefined : flow.mcpServerUsages, onMcpServerUsagesChange: isCurated ? undefined : flow.setMcpServerUsages, skillRefs: isCurated ? undefined : flow.skillRefs, onSkillRefsChange: isCurated ? undefined : flow.setSkillRefs, sessionVariables: isCurated ? undefined : flow.sessionVariables, showHarnessSelector: !isGuest, harness: flow.harness, onHarnessChange: flow.setHarness, interactionMode: interactionMode, onInteractionModeChange: setInteractionMode, showInteractionModePicker: !isGuest, showModelSelector: modelSelectorVisible,
|
|
174
|
+
onAgentRefChange: isGuest ? undefined : flow.setAgentRef, onAgentResolutionChange: isGuest ? undefined : flow.setResolution, initialAgentRef: isGuest ? undefined : initialAgentRef, initialInstanceId: isGuest ? undefined : initialInstanceId, initialAttachments: isGuest ? undefined : initialAttachments, lockAgent: isCurated && initialAgentRef != null, mcpServerUsages: isCurated ? undefined : flow.mcpServerUsages, onMcpServerUsagesChange: isCurated ? undefined : flow.setMcpServerUsages, skillRefs: isCurated ? undefined : flow.skillRefs, onSkillRefsChange: isCurated ? undefined : flow.setSkillRefs, sessionVariables: isCurated ? undefined : flow.sessionVariables, showHarnessSelector: !isGuest, harness: flow.harness, onHarnessChange: flow.setHarness, interactionMode: interactionMode, onInteractionModeChange: setInteractionMode, showInteractionModePicker: !isGuest, showModelSelector: modelSelectorVisible, enableAttachments: !isGuest, defaultModelId: flow.modelId, onModelChange: flow.setModelId, placeholder: placeholder, initialRows: initialRows, autoFocus: autoFocus, ariaLabel: "Start a new session" }), !isGuest && flow.autoApproveAll && (_jsx(AutoApproveIndicator, { onTurnOff: () => flow.setAutoApproveAll(false) })), footerContent, _jsx("p", { className: "stg:text-center stg:text-[0.65rem] stg:text-muted-foreground", children: "Press Enter to send, Shift+Enter for a new line" })] }) }));
|
|
174
175
|
return (
|
|
175
176
|
// The launcher renders the same SessionViewerLayout as SessionViewer
|
|
176
177
|
// (DD-016) — the shared frame is what makes "the two viewers behave
|