@stigmer/react 3.12.6 → 3.12.7
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 +19 -1
- package/composer/ComposerToolbar.d.ts.map +1 -1
- package/composer/ComposerToolbar.js +7 -2
- package/composer/ComposerToolbar.js.map +1 -1
- package/composer/SessionComposer.d.ts +10 -0
- 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 +1 -0
- package/composer/index.d.ts.map +1 -1
- package/composer/index.js.map +1 -1
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +8 -11
- package/execution/MessageThread.js.map +1 -1
- package/execution/useFileChangeContent.d.ts +2 -6
- package/execution/useFileChangeContent.d.ts.map +1 -1
- package/execution/useFileChangeContent.js +4 -12
- package/execution/useFileChangeContent.js.map +1 -1
- package/index.d.ts +6 -3
- package/index.d.ts.map +1 -1
- package/index.js +5 -1
- package/index.js.map +1 -1
- package/internal/download.d.ts +8 -0
- package/internal/download.d.ts.map +1 -0
- package/internal/download.js +25 -0
- package/internal/download.js.map +1 -0
- package/library/useExportResource.d.ts.map +1 -1
- package/library/useExportResource.js +3 -17
- package/library/useExportResource.js.map +1 -1
- package/memory/MemoryListPanel.d.ts +35 -0
- package/memory/MemoryListPanel.d.ts.map +1 -0
- package/memory/MemoryListPanel.js +141 -0
- package/memory/MemoryListPanel.js.map +1 -0
- package/memory/index.d.ts +8 -0
- package/memory/index.d.ts.map +1 -0
- package/memory/index.js +12 -0
- package/memory/index.js.map +1 -0
- package/memory/memoryGroups.d.ts +31 -0
- package/memory/memoryGroups.d.ts.map +1 -0
- package/memory/memoryGroups.js +52 -0
- package/memory/memoryGroups.js.map +1 -0
- package/memory/useConfirmMemory.d.ts +31 -0
- package/memory/useConfirmMemory.d.ts.map +1 -0
- package/memory/useConfirmMemory.js +43 -0
- package/memory/useConfirmMemory.js.map +1 -0
- package/memory/useDeleteMemory.d.ts +30 -0
- package/memory/useDeleteMemory.d.ts.map +1 -0
- package/memory/useDeleteMemory.js +42 -0
- package/memory/useDeleteMemory.js.map +1 -0
- package/memory/useMemories.d.ts +33 -0
- package/memory/useMemories.d.ts.map +1 -0
- package/memory/useMemories.js +42 -0
- package/memory/useMemories.js.map +1 -0
- package/memory/useRejectMemory.d.ts +34 -0
- package/memory/useRejectMemory.d.ts.map +1 -0
- package/memory/useRejectMemory.js +46 -0
- package/memory/useRejectMemory.js.map +1 -0
- package/memory/useUpdateMemoryContent.d.ts +32 -0
- package/memory/useUpdateMemoryContent.d.ts.map +1 -0
- package/memory/useUpdateMemoryContent.js +48 -0
- package/memory/useUpdateMemoryContent.js.map +1 -0
- package/package.json +4 -4
- package/session/NewSessionViewer.d.ts.map +1 -1
- package/session/NewSessionViewer.js +9 -1
- package/session/NewSessionViewer.js.map +1 -1
- package/session/SessionViewer.d.ts +14 -1
- package/session/SessionViewer.d.ts.map +1 -1
- package/session/SessionViewer.js +21 -25
- package/session/SessionViewer.js.map +1 -1
- package/session/TranscriptExportMenu.d.ts +24 -0
- package/session/TranscriptExportMenu.d.ts.map +1 -0
- package/session/TranscriptExportMenu.js +26 -0
- package/session/TranscriptExportMenu.js.map +1 -0
- package/session/index.d.ts +4 -0
- package/session/index.d.ts.map +1 -1
- package/session/index.js +2 -0
- package/session/index.js.map +1 -1
- package/session/useExportTranscript.d.ts +44 -0
- package/session/useExportTranscript.d.ts.map +1 -0
- package/session/useExportTranscript.js +109 -0
- package/session/useExportTranscript.js.map +1 -0
- package/session/useNewSessionFlow.d.ts +11 -0
- package/session/useNewSessionFlow.d.ts.map +1 -1
- package/session/useNewSessionFlow.js +14 -6
- package/session/useNewSessionFlow.js.map +1 -1
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js +7 -19
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionExecutions.d.ts +2 -14
- package/session/useSessionExecutions.d.ts.map +1 -1
- package/session/useSessionExecutions.js +4 -26
- package/session/useSessionExecutions.js.map +1 -1
- package/session/useSessionPageFlow.d.ts +23 -10
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +61 -9
- package/session/useSessionPageFlow.js.map +1 -1
- package/settings/MemorySection.d.ts +12 -0
- package/settings/MemorySection.d.ts.map +1 -0
- package/settings/MemorySection.js +21 -0
- package/settings/MemorySection.js.map +1 -0
- package/settings/index.d.ts +1 -0
- package/settings/index.d.ts.map +1 -1
- package/settings/index.js +1 -0
- package/settings/index.js.map +1 -1
- package/settings/settings-nav.d.ts.map +1 -1
- package/settings/settings-nav.js +2 -1
- package/settings/settings-nav.js.map +1 -1
- package/src/__tests__/public-api.test.ts +21 -0
- package/src/composer/ComposerToolbar.tsx +58 -0
- package/src/composer/SessionComposer.tsx +13 -1
- package/src/composer/__tests__/ComposerToolbar-autoApprove.test.tsx +80 -0
- package/src/composer/index.ts +1 -0
- package/src/execution/MessageThread.tsx +8 -11
- package/src/execution/useFileChangeContent.ts +5 -12
- package/src/index.ts +34 -0
- package/src/internal/download.ts +29 -0
- package/src/library/useExportResource.ts +3 -19
- package/src/memory/MemoryListPanel.tsx +532 -0
- package/src/memory/__tests__/MemoryListPanel.test.tsx +259 -0
- package/src/memory/__tests__/memoryHooks.test.tsx +220 -0
- package/src/memory/index.ts +19 -0
- package/src/memory/memoryGroups.ts +64 -0
- package/src/memory/useConfirmMemory.ts +62 -0
- package/src/memory/useDeleteMemory.ts +61 -0
- package/src/memory/useMemories.ts +66 -0
- package/src/memory/useRejectMemory.ts +65 -0
- package/src/memory/useUpdateMemoryContent.ts +67 -0
- package/src/session/NewSessionViewer.tsx +15 -1
- package/src/session/SessionViewer.tsx +48 -49
- package/src/session/TranscriptExportMenu.tsx +78 -0
- package/src/session/__tests__/SessionViewer-autoApproveToggle.test.tsx +178 -0
- package/src/session/__tests__/SessionViewer-transcriptExport.test.tsx +151 -0
- package/src/session/__tests__/TranscriptExportMenu.test.tsx +97 -0
- package/src/session/__tests__/useExportTranscript.test.tsx +187 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +33 -0
- package/src/session/__tests__/useSessionPageFlow.autoApprove.test.tsx +176 -2
- package/src/session/index.ts +9 -0
- package/src/session/useExportTranscript.ts +171 -0
- package/src/session/useNewSessionFlow.ts +28 -7
- package/src/session/useSessionConversation.ts +10 -16
- package/src/session/useSessionExecutions.ts +5 -26
- package/src/session/useSessionPageFlow.ts +84 -21
- package/src/settings/MemorySection.tsx +45 -0
- package/src/settings/index.ts +1 -0
- package/src/settings/settings-nav.ts +2 -0
- package/src/usage/useExportCSV.ts +2 -14
- package/usage/useExportCSV.d.ts.map +1 -1
- package/usage/useExportCSV.js +2 -13
- package/usage/useExportCSV.js.map +1 -1
|
@@ -5,9 +5,14 @@ import type {
|
|
|
5
5
|
FileChange,
|
|
6
6
|
FileContent,
|
|
7
7
|
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
|
|
8
|
+
import { execIdFromStorageKey } from "@stigmer/sdk";
|
|
8
9
|
import { useArtifactContent } from "./useArtifactContent.js";
|
|
9
10
|
import { useArtifactDownloadUrl } from "./useArtifactDownloadUrl.js";
|
|
10
11
|
|
|
12
|
+
// The key-parsing rule lives in @stigmer/sdk with the other shared
|
|
13
|
+
// conversation-assembly rules; re-exported here for existing consumers.
|
|
14
|
+
export { execIdFromStorageKey };
|
|
15
|
+
|
|
11
16
|
/** Return value of {@link useFileChangeContent}. */
|
|
12
17
|
export interface UseFileChangeContentReturn {
|
|
13
18
|
/**
|
|
@@ -135,15 +140,3 @@ function sideText(
|
|
|
135
140
|
return fetched;
|
|
136
141
|
}
|
|
137
142
|
|
|
138
|
-
/**
|
|
139
|
-
* Extracts the execution id from an artifact storage key of the form
|
|
140
|
-
* `artifacts/{executionId}/...`. Returns `null` for an unexpected shape so the
|
|
141
|
-
* caller skips the fetch rather than issuing a request the server would reject.
|
|
142
|
-
*/
|
|
143
|
-
export function execIdFromStorageKey(storageKey: string): string | null {
|
|
144
|
-
const parts = storageKey.split("/");
|
|
145
|
-
if (parts.length >= 3 && parts[0] === "artifacts" && parts[1]) {
|
|
146
|
-
return parts[1];
|
|
147
|
-
}
|
|
148
|
-
return null;
|
|
149
|
-
}
|
package/src/index.ts
CHANGED
|
@@ -139,6 +139,8 @@ export {
|
|
|
139
139
|
useSessionList,
|
|
140
140
|
useSessionExecutions,
|
|
141
141
|
useSessionConversation,
|
|
142
|
+
useExportTranscript,
|
|
143
|
+
TranscriptExportMenu,
|
|
142
144
|
useSessionArtifacts,
|
|
143
145
|
artifactKey,
|
|
144
146
|
useSessionWriteBacks,
|
|
@@ -189,6 +191,9 @@ export type {
|
|
|
189
191
|
UseSessionExecutionsReturn,
|
|
190
192
|
SendFollowUpOptions,
|
|
191
193
|
UseSessionConversationReturn,
|
|
194
|
+
UseExportTranscriptOptions,
|
|
195
|
+
UseExportTranscriptReturn,
|
|
196
|
+
TranscriptExportMenuProps,
|
|
192
197
|
SessionArtifactEntry,
|
|
193
198
|
UseSessionArtifactsReturn,
|
|
194
199
|
SessionWriteBackEntry,
|
|
@@ -222,6 +227,11 @@ export type {
|
|
|
222
227
|
RuntimeEnvProvider,
|
|
223
228
|
SessionAudience,
|
|
224
229
|
SessionPanelMode,
|
|
230
|
+
// The #664 pinning seam's contract type: SessionViewer/NewSessionViewer/
|
|
231
|
+
// useNewSessionFlow all accept it, and the docs name it — embedders must
|
|
232
|
+
// be able to import it from the root (oss#802; the exports map exposes no
|
|
233
|
+
// ./session subpath on purpose).
|
|
234
|
+
SessionRunConfig,
|
|
225
235
|
SetupTabProps,
|
|
226
236
|
SetupTabMutationCallbacks,
|
|
227
237
|
} from "./session/index.js";
|
|
@@ -541,6 +551,7 @@ export type {
|
|
|
541
551
|
SessionComposerHandle,
|
|
542
552
|
SessionComposerProps,
|
|
543
553
|
SessionComposerSubmitContext,
|
|
554
|
+
ComposerAutoApproveProps,
|
|
544
555
|
InteractionModePickerProps,
|
|
545
556
|
InteractionModeOption,
|
|
546
557
|
} from "./composer/index.js";
|
|
@@ -851,6 +862,28 @@ export type {
|
|
|
851
862
|
AccountPreferencesPanelProps,
|
|
852
863
|
} from "./identity-account/index.js";
|
|
853
864
|
|
|
865
|
+
// Memory — agent-proposed, user-confirmed facts: data hook, decision
|
|
866
|
+
// hooks (confirm/reject/delete/edit), grouping helpers, and the list panel
|
|
867
|
+
export {
|
|
868
|
+
useMemories,
|
|
869
|
+
useConfirmMemory,
|
|
870
|
+
useRejectMemory,
|
|
871
|
+
useDeleteMemory,
|
|
872
|
+
useUpdateMemoryContent,
|
|
873
|
+
groupMemoriesByLifecycle,
|
|
874
|
+
formatMemoryProvenance,
|
|
875
|
+
MemoryListPanel,
|
|
876
|
+
} from "./memory/index.js";
|
|
877
|
+
export type {
|
|
878
|
+
UseMemoriesReturn,
|
|
879
|
+
UseConfirmMemoryReturn,
|
|
880
|
+
UseRejectMemoryReturn,
|
|
881
|
+
UseDeleteMemoryReturn,
|
|
882
|
+
UseUpdateMemoryContentReturn,
|
|
883
|
+
MemoryGroups,
|
|
884
|
+
MemoryListPanelProps,
|
|
885
|
+
} from "./memory/index.js";
|
|
886
|
+
|
|
854
887
|
// IAM Policy — data hooks, behavior hooks, headless hook, and styled components for access management
|
|
855
888
|
export {
|
|
856
889
|
useGrantableRoles,
|
|
@@ -1078,6 +1111,7 @@ export { MembersSection } from "./settings/index.js";
|
|
|
1078
1111
|
export { OrgProfileSection } from "./settings/index.js";
|
|
1079
1112
|
export { OrgPreferencesSection } from "./settings/index.js";
|
|
1080
1113
|
export { AccountPreferencesSection } from "./settings/index.js";
|
|
1114
|
+
export { MemorySection } from "./settings/index.js";
|
|
1081
1115
|
export { EnvironmentsSection } from "./settings/index.js";
|
|
1082
1116
|
export { InvitationsSection } from "./settings/index.js";
|
|
1083
1117
|
export { IdentityProvidersSection } from "./settings/index.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Client-side file download via Blob + object URL + anchor click.
|
|
2
|
+
//
|
|
3
|
+
// The one home of this routine — useExportResource, useExportCSV, and
|
|
4
|
+
// useExportTranscript all download through it. The pattern is proven inside
|
|
5
|
+
// the desktop (Tauri) webview as well as browsers, so SDK components can rely
|
|
6
|
+
// on it without a per-host seam.
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Triggers a browser download of `content` as a UTF-8 text file.
|
|
10
|
+
*
|
|
11
|
+
* @param mimeType - Bare MIME type (e.g. `"text/markdown"`); the UTF-8
|
|
12
|
+
* charset is appended here so callers cannot drift on it.
|
|
13
|
+
*/
|
|
14
|
+
export function downloadTextFile(
|
|
15
|
+
content: string,
|
|
16
|
+
filename: string,
|
|
17
|
+
mimeType: string,
|
|
18
|
+
): void {
|
|
19
|
+
const blob = new Blob([content], { type: `${mimeType};charset=utf-8;` });
|
|
20
|
+
const url = URL.createObjectURL(blob);
|
|
21
|
+
const link = document.createElement("a");
|
|
22
|
+
link.href = url;
|
|
23
|
+
link.download = filename;
|
|
24
|
+
link.style.display = "none";
|
|
25
|
+
document.body.appendChild(link);
|
|
26
|
+
link.click();
|
|
27
|
+
document.body.removeChild(link);
|
|
28
|
+
URL.revokeObjectURL(url);
|
|
29
|
+
}
|
|
@@ -8,6 +8,7 @@ import type { Schedule } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/ap
|
|
|
8
8
|
import type { Workflow } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
|
|
9
9
|
import { serializeManifest } from "@stigmer/sdk";
|
|
10
10
|
import { toast } from "../feedback/toast.js";
|
|
11
|
+
import { downloadTextFile } from "../internal/download.js";
|
|
11
12
|
import { useCopyFeedback } from "../internal/useCopyFeedback.js";
|
|
12
13
|
import { serializeWorkflowYaml } from "../workflow/serialize-workflow-yaml.js";
|
|
13
14
|
|
|
@@ -121,12 +122,12 @@ export function useExportResource({
|
|
|
121
122
|
|
|
122
123
|
const downloadYaml = useCallback(() => {
|
|
123
124
|
if (!yaml) return;
|
|
124
|
-
|
|
125
|
+
downloadTextFile(yaml, `${slug}.yaml`, "text/yaml");
|
|
125
126
|
}, [yaml, slug]);
|
|
126
127
|
|
|
127
128
|
const downloadJson = useCallback(() => {
|
|
128
129
|
if (!json) return;
|
|
129
|
-
|
|
130
|
+
downloadTextFile(json, `${slug}.json`, "application/json");
|
|
130
131
|
}, [json, slug]);
|
|
131
132
|
|
|
132
133
|
return useMemo(
|
|
@@ -134,20 +135,3 @@ export function useExportResource({
|
|
|
134
135
|
[copyYaml, copyJson, downloadYaml, downloadJson, yaml, json],
|
|
135
136
|
);
|
|
136
137
|
}
|
|
137
|
-
|
|
138
|
-
// ---------------------------------------------------------------------------
|
|
139
|
-
// File download
|
|
140
|
-
// ---------------------------------------------------------------------------
|
|
141
|
-
|
|
142
|
-
function downloadFile(content: string, filename: string, mimeType: string): void {
|
|
143
|
-
const blob = new Blob([content], { type: `${mimeType};charset=utf-8;` });
|
|
144
|
-
const url = URL.createObjectURL(blob);
|
|
145
|
-
const link = document.createElement("a");
|
|
146
|
-
link.href = url;
|
|
147
|
-
link.download = filename;
|
|
148
|
-
link.style.display = "none";
|
|
149
|
-
document.body.appendChild(link);
|
|
150
|
-
link.click();
|
|
151
|
-
document.body.removeChild(link);
|
|
152
|
-
URL.revokeObjectURL(url);
|
|
153
|
-
}
|