zidane-ui 9.1.4 → 9.1.6
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/adapters/server-extensions-host.js +1 -1
- package/dist/adapters/server-host.js +2 -1
- package/dist/adapters/server-machines-host.js +1 -1
- package/dist/adapters/server-session-host.js +87 -13
- package/dist/adapters/server-settings-host.js +1 -1
- package/dist/appearance/AppearanceProvider.js +2 -2
- package/dist/appearance/headless/index.js +1 -1
- package/dist/approvals/headless/index.js +2 -2
- package/dist/chat/HostTranscript.d.ts +5 -1
- package/dist/chat/HostTranscript.js +16 -4
- package/dist/chat/RunEstimateChip.d.ts +5 -3
- package/dist/chat/RunEstimateChip.js +33 -3
- package/dist/chat/Transcript.js +1 -1
- package/dist/chat/composer/ConversationBadges.js +16 -10
- package/dist/chat/composer/composer-bus.d.ts +2 -2
- package/dist/chat/composer/composer-bus.js +2 -2
- package/dist/chat/composer/use-composer-stores.js +1 -1
- package/dist/chat/composer/use-run-meter.js +1 -1
- package/dist/chat/headless/composer/conversation-badges.d.ts +8 -3
- package/dist/chat/headless/composer/conversation-badges.js +26 -11
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/composer/labels-chrome.d.ts +3 -1
- package/dist/chat/headless/composer/labels-chrome.js +3 -1
- package/dist/chat/headless/index.d.ts +6 -3
- package/dist/chat/headless/index.js +16 -13
- package/dist/chat/headless/labels.d.ts +54 -1
- package/dist/chat/headless/labels.js +62 -2
- package/dist/chat/headless/secrets.d.ts +32 -0
- package/dist/chat/headless/secrets.js +43 -0
- package/dist/chat/headless/session-list.d.ts +45 -0
- package/dist/chat/headless/sidebar/estimates.js +13 -1
- package/dist/chat/headless/sidebar/history.d.ts +71 -0
- package/dist/chat/headless/sidebar/history.js +174 -0
- package/dist/chat/headless/sidebar/index.d.ts +3 -2
- package/dist/chat/headless/sidebar/index.js +2 -1
- package/dist/chat/headless/sidebar/labels.d.ts +50 -0
- package/dist/chat/headless/sidebar/labels.js +1 -0
- package/dist/chat/headless/sidebar/query.d.ts +2 -2
- package/dist/chat/headless/sidebar/query.js +6 -3
- package/dist/chat/headless/sidebar/types.d.ts +7 -1
- package/dist/chat/headless/sidebar/view.js +2 -0
- package/dist/chat/headless/transcript/auth-failure.d.ts +67 -0
- package/dist/chat/headless/transcript/auth-failure.js +87 -0
- package/dist/chat/headless/transcript/index.d.ts +2 -1
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/nesting.d.ts +3 -3
- package/dist/chat/headless/transcript/nesting.js +12 -4
- package/dist/chat/index.d.ts +4 -2
- package/dist/chat/index.js +3 -1
- package/dist/chat/interactions/InboxPanel.d.ts +6 -2
- package/dist/chat/interactions/InboxPanel.js +82 -44
- package/dist/chat/interactions/PlanCard.d.ts +2 -2
- package/dist/chat/interactions/PlanCard.js +1 -1
- package/dist/chat/interactions/QuestionField.d.ts +8 -3
- package/dist/chat/interactions/QuestionField.js +89 -8
- package/dist/chat/interactions/QuestionForm.d.ts +3 -1
- package/dist/chat/interactions/QuestionForm.js +48 -10
- package/dist/chat/interactions/SecretInput.d.ts +32 -0
- package/dist/chat/interactions/SecretInput.js +72 -0
- package/dist/chat/interactions/card-ui.d.ts +5 -3
- package/dist/chat/interactions/card-ui.js +5 -3
- package/dist/chat/interactions/index.d.ts +2 -1
- package/dist/chat/interactions/index.js +2 -1
- package/dist/chat/sidebar/SessionSidebar.js +2 -0
- package/dist/chat/sidebar/SidebarFilterMenu.d.ts +7 -2
- package/dist/chat/sidebar/SidebarFilterMenu.js +26 -2
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +3 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +8 -3
- package/dist/chat/sidebar/sidebar-live.js +8 -4
- package/dist/chat/transcript/AuthFailureCard.d.ts +34 -0
- package/dist/chat/transcript/AuthFailureCard.js +358 -0
- package/dist/chat/transcript/InteractionToolBody.js +12 -2
- package/dist/chat/transcript/actions.d.ts +24 -1
- package/dist/chat/transcript/index.d.ts +3 -2
- package/dist/chat/transcript/index.js +2 -1
- package/dist/chat/transcript/notices.d.ts +2 -1
- package/dist/chat/transcript/notices.js +13 -1
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +1 -1
- package/dist/components/HowItWorks.d.ts +8 -1
- package/dist/components/HowItWorks.js +2 -2
- package/dist/components/RowActionsMenu.d.ts +6 -1
- package/dist/components/RowActionsMenu.js +4 -0
- package/dist/core.css +24 -0
- package/dist/dist/{index-WlE93Q6d.d.ts → index-DqCio7Nd.d.ts} +36 -3
- package/dist/dist/index-f-XWIoYo.d.ts +1 -0
- package/dist/dist/index.d.ts +6 -0
- package/dist/dist/sandbox-B4OW6oNx.d.ts +2 -0
- package/dist/dist/timeout-B5pO5I5a.d.ts +30 -0
- package/dist/extensions/ExtensionSettingsPage.js +1 -1
- package/dist/extensions/ExtensionSettingsSidebar.js +1 -1
- package/dist/extensions/headless/fixture-host.js +1 -1
- package/dist/extensions/headless/index.js +4 -4
- package/dist/extensions/hooks.js +1 -1
- package/dist/files/DiffsTab.js +1 -1
- package/dist/files/EditorColumn.js +1 -1
- package/dist/files/MediaDiff.js +1 -1
- package/dist/files/SearchPanel.js +121 -53
- package/dist/files/headless/name-match.js +29 -14
- package/dist/files/useEntryActions.js +1 -1
- package/dist/files/useOpenFiles.js +1 -1
- package/dist/git/WherePicker.js +2 -2
- package/dist/git/headless/environment.d.ts +6 -1
- package/dist/git/headless/environment.js +5 -2
- package/dist/git/headless/labels.d.ts +2 -0
- package/dist/git/headless/labels.js +2 -0
- package/dist/git/index.d.ts +2 -1
- package/dist/git/index.js +2 -1
- package/dist/git/useStartFromPanel.d.ts +22 -0
- package/dist/git/useStartFromPanel.js +91 -0
- package/dist/keybindings/KeyCommands.js +1 -1
- package/dist/keybindings/KeybindingsProvider.js +1 -1
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +14 -2
- package/dist/keybindings/headless/index.js +2 -2
- package/dist/keybindings/headless/key-scope.d.ts +4 -2
- package/dist/keybindings/headless/key-scope.js +17 -2
- package/dist/keybindings/headless/overrides.js +1 -1
- package/dist/machines/HostSyncPanel.js +1 -1
- package/dist/machines/SyncOutcomeBadge.js +1 -1
- package/dist/machines/headless/index.js +1 -1
- package/dist/onboarding/demos/features.d.ts +9 -1
- package/dist/onboarding/demos/features.js +107 -2
- package/dist/onboarding/demos/how-it-works.d.ts +5 -1
- package/dist/onboarding/demos/how-it-works.js +120 -2
- package/dist/onboarding/demos/index.js +1 -1
- package/dist/onboarding/headless/labels.d.ts +17 -0
- package/dist/onboarding/headless/labels.js +17 -0
- package/dist/onboarding/index.js +4 -4
- package/dist/onboarding/marks.d.ts +1 -2
- package/dist/onboarding/marks.js +4 -12
- package/dist/onboarding/steps/ConnectorsStep.js +1 -1
- package/dist/onboarding/steps/ReadyStep.js +1 -1
- package/dist/onboarding/steps/SkillsStep.js +1 -1
- package/dist/onboarding/steps/connect/ProviderPanel.js +1 -1
- package/dist/onboarding/tutorials.d.ts +3 -1
- package/dist/onboarding/tutorials.js +2 -1
- package/dist/palette/app-sources.js +1 -1
- package/dist/palette/headless/app-sources.js +10 -0
- package/dist/palette/headless/labels.js +2 -0
- package/dist/session/ArtifactsPanel.js +1 -1
- package/dist/session/PanelAttention.d.ts +14 -6
- package/dist/session/PanelAttention.js +35 -24
- package/dist/session/PlanTracker.d.ts +54 -0
- package/dist/session/PlanTracker.js +413 -0
- package/dist/session/ProjectHome.d.ts +15 -2
- package/dist/session/ProjectHome.js +158 -85
- package/dist/session/RemindersPanel.d.ts +25 -0
- package/dist/session/RemindersPanel.js +526 -0
- package/dist/session/SecretsPanel.d.ts +19 -0
- package/dist/session/SecretsPanel.js +241 -0
- package/dist/session/SessionProvider.d.ts +26 -5
- package/dist/session/SessionProvider.js +51 -6
- package/dist/session/StepStatusIcon.d.ts +24 -0
- package/dist/session/StepStatusIcon.js +50 -0
- package/dist/session/TodoList.d.ts +4 -3
- package/dist/session/TodoList.js +6 -5
- package/dist/session/headless/fixture-host.d.ts +32 -22
- package/dist/session/headless/fixture-host.js +86 -51
- package/dist/session/headless/fixture-plans.d.ts +57 -0
- package/dist/session/headless/fixture-plans.js +141 -0
- package/dist/session/headless/fixture-schedules.d.ts +49 -0
- package/dist/session/headless/fixture-schedules.js +133 -0
- package/dist/session/headless/home-layout.d.ts +10 -2
- package/dist/session/headless/home-layout.js +7 -2
- package/dist/session/headless/host.d.ts +85 -13
- package/dist/session/headless/index.d.ts +5 -3
- package/dist/session/headless/index.js +5 -3
- package/dist/session/headless/labels.d.ts +95 -12
- package/dist/session/headless/labels.js +67 -18
- package/dist/session/headless/plans.d.ts +53 -0
- package/dist/session/headless/plans.js +78 -0
- package/dist/session/headless/reminder-labels.d.ts +63 -0
- package/dist/session/headless/reminder-labels.js +84 -0
- package/dist/session/headless/schedules.d.ts +93 -0
- package/dist/session/headless/schedules.js +190 -0
- package/dist/session/headless/secrets.d.ts +28 -0
- package/dist/session/headless/secrets.js +48 -0
- package/dist/session/index.d.ts +7 -5
- package/dist/session/index.js +6 -4
- package/dist/session/testing/contract.d.ts +18 -5
- package/dist/session/testing/contract.js +351 -43
- package/dist/session/testing/index.d.ts +4 -2
- package/dist/session/testing/index.js +4 -2
- package/dist/settings/headless/catalog.js +17 -1
- package/dist/settings/headless/index.d.ts +2 -2
- package/dist/settings/headless/index.js +3 -3
- package/dist/settings/headless/labels.d.ts +0 -2
- package/dist/settings/headless/labels.js +0 -2
- package/dist/settings/headless/layout.js +7 -1
- package/dist/settings/headless/providers.d.ts +17 -1
- package/dist/settings/headless/providers.js +19 -1
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/rows.d.ts +1 -1
- package/dist/settings/rows.js +2 -2
- package/dist/settings/sections/appearance/AppearanceSection.js +2 -2
- package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
- package/dist/settings/sections/editor/EditorSection.js +1 -1
- package/dist/settings/sections/environments/EnvironmentsSection.js +1 -1
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/CreateExtensionDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionsSection.js +1 -1
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +1 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +1 -1
- package/dist/settings/sections/keybindings/labels.d.ts +2 -0
- package/dist/settings/sections/keybindings/labels.js +2 -0
- package/dist/settings/sections/keybindings/rows.js +8 -0
- package/dist/settings/sections/mcp/McpSection.js +1 -1
- package/dist/settings/sections/mcp/McpServerRow.js +1 -1
- package/dist/settings/sections/models/ModelRows.js +2 -2
- package/dist/settings/sections/providers/ProvidersSection.js +209 -201
- package/dist/settings/sections/providers/ServerProvidersSection.js +1 -1
- package/dist/settings/sections/shared/catalog.js +1 -1
- package/dist/settings/sections/skills/SkillList.js +1 -1
- package/dist/settings/sections/skills/SkillsSection.js +2 -2
- package/dist/styles.css +59 -1
- package/dist/terminal/HostTerminalSurface.js +2 -2
- package/dist/workspace/PanelContentView.d.ts +22 -4
- package/dist/workspace/PanelContentView.js +112 -16
- package/dist/workspace/PanelGlyph.d.ts +21 -0
- package/dist/workspace/PanelGlyph.js +33 -0
- package/dist/workspace/PanelHome.js +5 -3
- package/dist/workspace/PanelStrip.js +11 -4
- package/dist/workspace/PanelToolbar.d.ts +32 -0
- package/dist/workspace/PanelToolbar.js +194 -0
- package/dist/workspace/WorkspaceProvider.d.ts +3 -1
- package/dist/workspace/WorkspaceProvider.js +6 -2
- package/dist/workspace/extension-tabs.js +5 -2
- package/dist/workspace/headless/host.d.ts +4 -0
- package/dist/workspace/headless/index.d.ts +3 -1
- package/dist/workspace/headless/index.js +4 -2
- package/dist/workspace/headless/labels.d.ts +10 -0
- package/dist/workspace/headless/labels.js +11 -1
- package/dist/workspace/headless/pages.d.ts +15 -0
- package/dist/workspace/headless/pages.js +49 -0
- package/dist/workspace/headless/tab-mark.d.ts +14 -0
- package/dist/workspace/headless/tab-mark.js +27 -0
- package/dist/workspace/headless/view.d.ts +7 -1
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.js +3 -2
- package/dist/workspace/testing/index.js +6 -0
- package/dist/workspace/workspace-key-commands.js +3 -3
- package/package.json +2 -2
- package/src/styles/motion.css +13 -0
- package/src/styles/onboarding.css +0 -1
- package/src/styles/primitives.css +10 -0
- package/src/styles/workspace.css +17 -0
- package/dist/session/TodosPanel.d.ts +0 -19
- package/dist/session/TodosPanel.js +0 -251
- package/dist/session/headless/todos.d.ts +0 -22
- package/dist/session/headless/todos.js +0 -38
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { writable } from "../store.js";
|
|
2
|
+
//#region src/chat/headless/sidebar/history.ts
|
|
3
|
+
/**
|
|
4
|
+
* A window's page history: the conversations it showed, and the new-chat
|
|
5
|
+
* draft (`null`), in order, with a cursor, like a browser tab's back and
|
|
6
|
+
* forward list.
|
|
7
|
+
*
|
|
8
|
+
* - `visit`: a page shown any way but back / forward. The current page again
|
|
9
|
+
* does nothing; another drops the entries ahead of the cursor and is
|
|
10
|
+
* appended (past the cap, the oldest go).
|
|
11
|
+
* - `back` / `forward`: the nearest entry that opens now (`canOpen`) and is
|
|
12
|
+
* not the page on show. The cursor moves there and the page comes back for
|
|
13
|
+
* the caller to show; the entries passed over stay (a session not listed
|
|
14
|
+
* yet, or open in its own window, may open later).
|
|
15
|
+
* - `replace`: the current entry becomes another page (a draft that became a
|
|
16
|
+
* session is the same page, not a new one).
|
|
17
|
+
* - `forget`: a deleted session leaves; neighbours left equal merge.
|
|
18
|
+
* - Persistence (`store`): `load` reads the saved list once. The pages
|
|
19
|
+
* visited before it answered go after the saved cursor, replacing what was
|
|
20
|
+
* ahead of it; with none, the saved list is taken as it was. Every change
|
|
21
|
+
* after that is saved.
|
|
22
|
+
*
|
|
23
|
+
* Generic over the app's session key.
|
|
24
|
+
*/
|
|
25
|
+
/** The most entries a history keeps by default. */
|
|
26
|
+
const SESSION_HISTORY_LIMIT = 200;
|
|
27
|
+
const EMPTY = {
|
|
28
|
+
entries: [],
|
|
29
|
+
index: -1
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Merges neighbours that are the same page, keeping the cursor on the entry it was on.
|
|
33
|
+
*
|
|
34
|
+
* @param entries - The pages.
|
|
35
|
+
* @param index - The cursor.
|
|
36
|
+
*/
|
|
37
|
+
function collapse(entries, index) {
|
|
38
|
+
const out = [];
|
|
39
|
+
let at = -1;
|
|
40
|
+
entries.forEach((page, i) => {
|
|
41
|
+
if (out.length === 0 || out[out.length - 1] !== page) out.push(page);
|
|
42
|
+
if (i === index) at = out.length - 1;
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
entries: out,
|
|
46
|
+
index: out.length === 0 ? -1 : at === -1 ? out.length - 1 : at
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Drops the oldest entries past `limit`.
|
|
51
|
+
*
|
|
52
|
+
* @param state - The history.
|
|
53
|
+
* @param limit - The most entries kept.
|
|
54
|
+
*/
|
|
55
|
+
function trim(state, limit) {
|
|
56
|
+
const over = state.entries.length - limit;
|
|
57
|
+
if (over <= 0) return state;
|
|
58
|
+
return {
|
|
59
|
+
entries: state.entries.slice(over),
|
|
60
|
+
index: Math.max(0, state.index - over)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A stored history, checked: entries are session keys (non-empty strings) or `null`, the cursor one of them.
|
|
65
|
+
* Anything malformed reads as no history.
|
|
66
|
+
*
|
|
67
|
+
* @param raw - The stored value.
|
|
68
|
+
* @param limit - The most entries kept.
|
|
69
|
+
*/
|
|
70
|
+
function parseSessionHistory(raw, limit = 200) {
|
|
71
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return EMPTY;
|
|
72
|
+
const { entries, index } = raw;
|
|
73
|
+
if (!Array.isArray(entries) || entries.length === 0) return EMPTY;
|
|
74
|
+
if (!entries.every((page) => page === null || typeof page === "string" && page.length > 0)) return EMPTY;
|
|
75
|
+
return trim(collapse(entries, typeof index === "number" && Number.isInteger(index) ? Math.min(Math.max(index, 0), entries.length - 1) : entries.length - 1), limit);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The history store: in memory, persisted through `store` once {@link SessionHistory.load} has read it.
|
|
79
|
+
*
|
|
80
|
+
* @param options - The store, the cap and the error report.
|
|
81
|
+
*/
|
|
82
|
+
function createSessionHistory(options = {}) {
|
|
83
|
+
const { store, onError } = options;
|
|
84
|
+
const limit = Math.max(1, options.limit ?? 200);
|
|
85
|
+
const state = writable(EMPTY);
|
|
86
|
+
let loaded = !store;
|
|
87
|
+
let loading = null;
|
|
88
|
+
const commit = (next) => {
|
|
89
|
+
const prev = state.get();
|
|
90
|
+
if (prev.index === next.index && prev.entries.length === next.entries.length && prev.entries.every((p, i) => p === next.entries[i])) return;
|
|
91
|
+
state.set(next);
|
|
92
|
+
if (loaded && store) store.save(next).catch((err) => onError?.("save", err));
|
|
93
|
+
};
|
|
94
|
+
const peekIndex = (direction, canOpen) => {
|
|
95
|
+
const { entries, index } = state.get();
|
|
96
|
+
const current = entries[index];
|
|
97
|
+
const step = direction === "back" ? -1 : 1;
|
|
98
|
+
for (let i = index + step; i >= 0 && i < entries.length; i += step) {
|
|
99
|
+
const page = entries[i];
|
|
100
|
+
if (page === current) continue;
|
|
101
|
+
if (page === null || !canOpen || canOpen(page)) return i;
|
|
102
|
+
}
|
|
103
|
+
return -1;
|
|
104
|
+
};
|
|
105
|
+
const go = (direction, canOpen) => {
|
|
106
|
+
const at = peekIndex(direction, canOpen);
|
|
107
|
+
if (at === -1) return void 0;
|
|
108
|
+
const { entries } = state.get();
|
|
109
|
+
commit({
|
|
110
|
+
entries,
|
|
111
|
+
index: at
|
|
112
|
+
});
|
|
113
|
+
return entries[at];
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
state,
|
|
117
|
+
visit(page) {
|
|
118
|
+
const { entries, index } = state.get();
|
|
119
|
+
if (index !== -1 && entries[index] === page) return;
|
|
120
|
+
commit(trim({
|
|
121
|
+
entries: [...entries.slice(0, index + 1), page],
|
|
122
|
+
index: index + 1
|
|
123
|
+
}, limit));
|
|
124
|
+
},
|
|
125
|
+
replace(page) {
|
|
126
|
+
const { entries, index } = state.get();
|
|
127
|
+
if (index === -1 || entries[index] === page) return;
|
|
128
|
+
const next = [...entries];
|
|
129
|
+
next[index] = page;
|
|
130
|
+
commit(collapse(next, index));
|
|
131
|
+
},
|
|
132
|
+
peek(direction, canOpen) {
|
|
133
|
+
const at = peekIndex(direction, canOpen);
|
|
134
|
+
return at === -1 ? void 0 : state.get().entries[at];
|
|
135
|
+
},
|
|
136
|
+
back: (canOpen) => go("back", canOpen),
|
|
137
|
+
forward: (canOpen) => go("forward", canOpen),
|
|
138
|
+
forget(id) {
|
|
139
|
+
const { entries, index } = state.get();
|
|
140
|
+
if (!entries.includes(id)) return;
|
|
141
|
+
let at = index;
|
|
142
|
+
const kept = [];
|
|
143
|
+
entries.forEach((page, i) => {
|
|
144
|
+
if (page === id) {
|
|
145
|
+
if (i <= index) at -= 1;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
kept.push(page);
|
|
149
|
+
});
|
|
150
|
+
commit(collapse(kept, Math.max(0, Math.min(at, kept.length - 1))));
|
|
151
|
+
},
|
|
152
|
+
load() {
|
|
153
|
+
if (!store) return Promise.resolve();
|
|
154
|
+
loading ??= store.load().then((raw) => {
|
|
155
|
+
const saved = parseSessionHistory(raw, limit);
|
|
156
|
+
const own = state.get();
|
|
157
|
+
if (own.entries.length === 0) return saved;
|
|
158
|
+
const base = saved.entries.slice(0, saved.index + 1);
|
|
159
|
+
return trim(collapse([...base, ...own.entries], base.length + own.index), limit);
|
|
160
|
+
}).catch((err) => {
|
|
161
|
+
onError?.("load", err);
|
|
162
|
+
return null;
|
|
163
|
+
}).then((merged) => {
|
|
164
|
+
loaded = true;
|
|
165
|
+
if (merged) state.set(merged);
|
|
166
|
+
const now = state.get();
|
|
167
|
+
if (now.entries.length > 0) store.save(now).catch((err) => onError?.("save", err));
|
|
168
|
+
});
|
|
169
|
+
return loading;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
174
|
+
export { SESSION_HISTORY_LIMIT, createSessionHistory, parseSessionHistory };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SessionNotification, SessionNotificationStore, createNotificationStore } from "./notifications.js";
|
|
2
|
-
import { SessionActivityFilter, SessionArchiveFilter, SidebarExtensionView, SidebarGroupBy, SidebarListSession, SidebarSortBy, SidebarView, VIEW_CHOICE } from "./types.js";
|
|
2
|
+
import { SessionActivityFilter, SessionArchiveFilter, SidebarExtensionView, SidebarGroupBy, SidebarListSession, SidebarOrigin, SidebarSortBy, SidebarView, VIEW_CHOICE } from "./types.js";
|
|
3
3
|
import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SWITCHER_PREFS, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SidebarLastSessions, SidebarViewMap, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, createSidebarViews, parseSidebarView, parseSwitcherPrefs, readSidebarViews } from "./view.js";
|
|
4
4
|
import { AGENT_GROUPING, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, SidebarContributionStores, SidebarContributions, SidebarGrouping, SidebarItemEntry, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSpace, claimChildSessions, clearedViewFilters, createDecorator, extensionSpaceOf, filterQueryOf, filtersForSpace, itemsForSpace, mergeSidebarSpaces, nextSavedViewName, resolveGrouping, resolveSort, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn } from "./query.js";
|
|
5
5
|
import { DirectoryServer, DirectorySettings, ProjectInSpace, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, SessionRef, SessionRemoval, availableProjectsOf, createSessionDirectory, filterDirectorySessions, projectKeyOf, sessionRefsOf } from "./directory.js";
|
|
@@ -13,6 +13,7 @@ import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, ProjectIcon, Pr
|
|
|
13
13
|
import { SessionActivity, SessionActivitySignal, SessionActivityStore, activityLabel, createSessionActivity, reduceActivity } from "./activity.js";
|
|
14
14
|
import { RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, createRunEstimates, pickRunEstimate } from "./estimates.js";
|
|
15
15
|
import { CompactionProgress, CompactionProgressStore, CompactionSignal, createCompactionProgress, reduceCompaction } from "./compaction.js";
|
|
16
|
+
import { SESSION_HISTORY_LIMIT, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, createSessionHistory, parseSessionHistory } from "./history.js";
|
|
16
17
|
import { DotStateInput, SidebarDotState, deriveDotState } from "./dot-state.js";
|
|
17
18
|
import { deleteSessionPrompt, environmentKindLabel, environmentSummaryText, runsInRemoteSandbox } from "./environment.js";
|
|
18
|
-
export { AGENT_GROUPING, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, COMMON_EMOJI, CompactionProgress, CompactionProgressStore, CompactionSignal, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SWITCHER_PREFS, DirectoryServer, DirectorySettings, DotStateInput, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, SessionNotification, SessionNotificationStore, SessionRef, SessionRemoval, SessionWindowMode, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarItemEntry, SidebarLabels, SidebarLastSessions, SidebarListRow, SidebarListSession, SidebarNode, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewMap, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, VIEW_CHOICE, activityLabel, availableProjectsOf, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSidebarViews, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, isProjectIcon, isProjectMember, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextSavedViewName, parsePinnedProjects, parseProjectIcons, parseSidebarView, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSort, runsInRemoteSandbox, sessionRefsOf, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
|
|
19
|
+
export { AGENT_GROUPING, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, COMMON_EMOJI, CompactionProgress, CompactionProgressStore, CompactionSignal, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SWITCHER_PREFS, DirectoryServer, DirectorySettings, DotStateInput, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, SessionNotification, SessionNotificationStore, SessionRef, SessionRemoval, SessionWindowMode, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarItemEntry, SidebarLabels, SidebarLastSessions, SidebarListRow, SidebarListSession, SidebarNode, SidebarOrigin, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewMap, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, VIEW_CHOICE, activityLabel, availableProjectsOf, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSidebarViews, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, isProjectIcon, isProjectMember, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextSavedViewName, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSort, runsInRemoteSandbox, sessionRefsOf, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
|
|
@@ -9,9 +9,10 @@ import { activityLabel, createSessionActivity, reduceActivity } from "./activity
|
|
|
9
9
|
import { createCompactionProgress, reduceCompaction } from "./compaction.js";
|
|
10
10
|
import { createSessionBadges } from "./badges.js";
|
|
11
11
|
import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SWITCHER_PREFS, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, createSidebarViews, parseSidebarView, parseSwitcherPrefs, readSidebarViews } from "./view.js";
|
|
12
|
+
import { SESSION_HISTORY_LIMIT, createSessionHistory, parseSessionHistory } from "./history.js";
|
|
12
13
|
import { createNotificationStore } from "./notifications.js";
|
|
13
14
|
import { AGENT_GROUPING, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, claimChildSessions, clearedViewFilters, createDecorator, extensionSpaceOf, filterQueryOf, filtersForSpace, itemsForSpace, mergeSidebarSpaces, nextSavedViewName, resolveGrouping, resolveSort, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn } from "./query.js";
|
|
14
15
|
import { availableProjectsOf, createSessionDirectory, filterDirectorySessions, projectKeyOf, sessionRefsOf } from "./directory.js";
|
|
15
16
|
import { deriveDotState } from "./dot-state.js";
|
|
16
17
|
import { deleteSessionPrompt, environmentKindLabel, environmentSummaryText, runsInRemoteSandbox } from "./environment.js";
|
|
17
|
-
export { AGENT_GROUPING, CHATS_BUCKET, COMMON_EMOJI, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SWITCHER_PREFS, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, VIEW_CHOICE, activityLabel, availableProjectsOf, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSidebarViews, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, isProjectIcon, isProjectMember, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextSavedViewName, parsePinnedProjects, parseProjectIcons, parseSidebarView, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSort, runsInRemoteSandbox, sessionRefsOf, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
|
|
18
|
+
export { AGENT_GROUPING, CHATS_BUCKET, COMMON_EMOJI, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SWITCHER_PREFS, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, VIEW_CHOICE, activityLabel, availableProjectsOf, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSidebarViews, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, isProjectIcon, isProjectMember, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextSavedViewName, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSort, runsInRemoteSandbox, sessionRefsOf, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { SecretTimeLeft } from "../secrets.js";
|
|
2
|
+
import { u as AuthFailure } from "../../../dist/timeout-B5pO5I5a.js";
|
|
3
|
+
import { WC as SecretTtl } from "../../../dist/index-DqCio7Nd.js";
|
|
4
|
+
import "../../../dist/index.js";
|
|
5
|
+
import "../index.js";
|
|
1
6
|
//#region src/chat/headless/sidebar/labels.d.ts
|
|
2
7
|
/** The default English strings of the session sidebar, merged over the chat layer's. */
|
|
3
8
|
declare const DEFAULT_SIDEBAR_LABELS: {
|
|
4
9
|
mainSession: string;
|
|
5
10
|
changeMainIcon: string;
|
|
11
|
+
rowScheduled: string;
|
|
6
12
|
activityCompacting: string;
|
|
7
13
|
activityRetrying: string;
|
|
8
14
|
activityWriting: string;
|
|
@@ -154,6 +160,7 @@ declare const DEFAULT_SIDEBAR_LABELS: {
|
|
|
154
160
|
estimateDueTitle: string;
|
|
155
161
|
estimateOver: string;
|
|
156
162
|
estimateOverTitle: string;
|
|
163
|
+
estimateProblemTitle: (reason: string, message?: string) => string;
|
|
157
164
|
runningFor: (elapsed: string) => string;
|
|
158
165
|
agent: string;
|
|
159
166
|
stepRunning: string;
|
|
@@ -182,6 +189,27 @@ declare const DEFAULT_SIDEBAR_LABELS: {
|
|
|
182
189
|
continueRun: string;
|
|
183
190
|
continueHint: string;
|
|
184
191
|
resetsAt: (time: string) => string;
|
|
192
|
+
authCard: string;
|
|
193
|
+
authHeadline: (auth: AuthFailure, label: string) => string;
|
|
194
|
+
authSignInAgain: string;
|
|
195
|
+
authUseAccount: (account: string) => string;
|
|
196
|
+
authSwitching: (account: string) => string;
|
|
197
|
+
authSettings: string;
|
|
198
|
+
authSettingsHint: string;
|
|
199
|
+
authCopyDetails: string;
|
|
200
|
+
authCopied: string;
|
|
201
|
+
authOpeningBrowser: string;
|
|
202
|
+
authWaiting: string;
|
|
203
|
+
authOpenPage: string;
|
|
204
|
+
authEnterCode: (code: string) => string;
|
|
205
|
+
authPaste: string;
|
|
206
|
+
authPasteSend: string;
|
|
207
|
+
authCancel: string;
|
|
208
|
+
authSignedIn: string;
|
|
209
|
+
authSignedInRetrying: string;
|
|
210
|
+
authFixed: string;
|
|
211
|
+
authTryAgain: string;
|
|
212
|
+
authFailed: (message: string) => string;
|
|
185
213
|
sessionEventLabel: (title: string, verb: string, needsAttention: boolean) => string;
|
|
186
214
|
clickToAnswer: string;
|
|
187
215
|
openSession: string;
|
|
@@ -363,6 +391,9 @@ declare const DEFAULT_SIDEBAR_LABELS: {
|
|
|
363
391
|
questionCount: (count: number) => string;
|
|
364
392
|
interactionsLabel: string;
|
|
365
393
|
inboxEmpty: string;
|
|
394
|
+
inboxNeedsYou: string;
|
|
395
|
+
inboxInProgress: string;
|
|
396
|
+
inboxRecent: string;
|
|
366
397
|
inboxPreviousSession: string;
|
|
367
398
|
unsupportedInteraction: (tool: string) => string;
|
|
368
399
|
planRejectNote: string;
|
|
@@ -387,6 +418,19 @@ declare const DEFAULT_SIDEBAR_LABELS: {
|
|
|
387
418
|
noAnswer: string;
|
|
388
419
|
confirmYes: string;
|
|
389
420
|
confirmNo: string;
|
|
421
|
+
secretValueLabel: string;
|
|
422
|
+
secretValuePlaceholder: string;
|
|
423
|
+
secretTtlLabel: string;
|
|
424
|
+
secretTtlName: (ttl: SecretTtl) => string;
|
|
425
|
+
saveSecurely: string;
|
|
426
|
+
declineSecret: string;
|
|
427
|
+
declineSecretHint: string;
|
|
428
|
+
secretNote: (ttl: SecretTtl) => string;
|
|
429
|
+
secretSaved: (name: string, left: SecretTimeLeft) => string;
|
|
430
|
+
secretSent: (name: string) => string;
|
|
431
|
+
secretDeclined: (name: string) => string;
|
|
432
|
+
secretReused: (name: string) => string;
|
|
433
|
+
openSecrets: string;
|
|
390
434
|
filterSessions: string;
|
|
391
435
|
filterView: string;
|
|
392
436
|
filterStatus: string;
|
|
@@ -429,6 +473,12 @@ declare const DEFAULT_SIDEBAR_LABELS: {
|
|
|
429
473
|
filterPicked: (count: number) => string;
|
|
430
474
|
filterSpaceDefault: string;
|
|
431
475
|
filterSaveView: string;
|
|
476
|
+
filterOrigin: string;
|
|
477
|
+
filterOrigins: {
|
|
478
|
+
all: string;
|
|
479
|
+
scheduled: string;
|
|
480
|
+
unscheduled: string;
|
|
481
|
+
};
|
|
432
482
|
hostStatuses: {
|
|
433
483
|
local: string;
|
|
434
484
|
connected: string;
|
|
@@ -10,6 +10,7 @@ const DEFAULT_SIDEBAR_LABELS = {
|
|
|
10
10
|
...DEFAULT_CHAT_LABELS,
|
|
11
11
|
mainSession: "Main",
|
|
12
12
|
changeMainIcon: "Change Main icon",
|
|
13
|
+
rowScheduled: "Started by a reminder",
|
|
13
14
|
activityCompacting: "Compacting",
|
|
14
15
|
activityRetrying: "Retrying",
|
|
15
16
|
activityWriting: "Writing",
|
|
@@ -112,7 +112,7 @@ declare function filtersForSpace(filters: readonly ExtensionItem<'sidebar-filter
|
|
|
112
112
|
*/
|
|
113
113
|
declare function filterQueryOf(filter: ExtensionItem<'sidebar-filter'>['item'], value: boolean | string | readonly string[] | undefined): SessionQuery | null;
|
|
114
114
|
/**
|
|
115
|
-
* The view layer's own narrowing: the agent and the contributed filters the space offers. `null`
|
|
115
|
+
* The view layer's own narrowing: the agent, the origin and the contributed filters the space offers. `null`
|
|
116
116
|
* when none applies.
|
|
117
117
|
*
|
|
118
118
|
* @param view - The space's view.
|
|
@@ -251,7 +251,7 @@ declare function claimChildSessions<S extends SidebarListSession>(items: readonl
|
|
|
251
251
|
};
|
|
252
252
|
/**
|
|
253
253
|
* Whether the view narrows the space's sessions: an archive axis other than `active`, a project,
|
|
254
|
-
* an activity window, an agent, or a contributed filter the space offers turned on. Grouping and
|
|
254
|
+
* an activity window, an agent, an origin, or a contributed filter the space offers turned on. Grouping and
|
|
255
255
|
* sort don't count.
|
|
256
256
|
*
|
|
257
257
|
* @param view - The space's view.
|
|
@@ -216,7 +216,7 @@ function filterQueryOf(filter, value) {
|
|
|
216
216
|
return picked.length > 0 ? { any: picked.map((o) => o.query) } : null;
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
* The view layer's own narrowing: the agent and the contributed filters the space offers. `null`
|
|
219
|
+
* The view layer's own narrowing: the agent, the origin and the contributed filters the space offers. `null`
|
|
220
220
|
* when none applies.
|
|
221
221
|
*
|
|
222
222
|
* @param view - The space's view.
|
|
@@ -227,6 +227,8 @@ function viewFilterOf(view, filters, now) {
|
|
|
227
227
|
const tests = [];
|
|
228
228
|
const agent = view.agent ?? null;
|
|
229
229
|
if (agent !== null) tests.push((row) => row.agentId === agent);
|
|
230
|
+
if (view.origin === "scheduled") tests.push((row) => Boolean(row.scheduleId));
|
|
231
|
+
else if (view.origin === "unscheduled") tests.push((row) => !row.scheduleId);
|
|
230
232
|
const values = view.extension?.filters ?? {};
|
|
231
233
|
for (const { item } of filters) {
|
|
232
234
|
const query = filterQueryOf(item, values[item.id]);
|
|
@@ -404,7 +406,7 @@ function claimChildSessions(items, sessions, now) {
|
|
|
404
406
|
const filterValueOn = (value) => value !== void 0 && value !== false && value !== "" && !(Array.isArray(value) && value.length === 0);
|
|
405
407
|
/**
|
|
406
408
|
* Whether the view narrows the space's sessions: an archive axis other than `active`, a project,
|
|
407
|
-
* an activity window, an agent, or a contributed filter the space offers turned on. Grouping and
|
|
409
|
+
* an activity window, an agent, an origin, or a contributed filter the space offers turned on. Grouping and
|
|
408
410
|
* sort don't count.
|
|
409
411
|
*
|
|
410
412
|
* @param view - The space's view.
|
|
@@ -412,7 +414,7 @@ const filterValueOn = (value) => value !== void 0 && value !== false && value !=
|
|
|
412
414
|
*/
|
|
413
415
|
function viewFiltersOn(view, filters) {
|
|
414
416
|
if (view.archive !== "active" || view.project !== null || view.activity !== "all") return true;
|
|
415
|
-
if (view.agent) return true;
|
|
417
|
+
if (view.agent || view.origin) return true;
|
|
416
418
|
const values = view.extension?.filters ?? {};
|
|
417
419
|
return filters.some(({ item }) => filterValueOn(values[item.id]));
|
|
418
420
|
}
|
|
@@ -428,6 +430,7 @@ function clearedViewFilters(view) {
|
|
|
428
430
|
project: null,
|
|
429
431
|
activity: "all",
|
|
430
432
|
agent: null,
|
|
433
|
+
origin: null,
|
|
431
434
|
extension: {
|
|
432
435
|
...view.extension,
|
|
433
436
|
filters: {}
|
|
@@ -38,6 +38,8 @@ interface SidebarListSession {
|
|
|
38
38
|
archived?: boolean;
|
|
39
39
|
/** The agent profile it runs (`AgentProfile.id`): the agent grouping and filter read it. */
|
|
40
40
|
agentId?: string;
|
|
41
|
+
/** The reminder that started it (zidane's `SessionMeta.scheduleId`): the clock mark and the Origin filter read it. */
|
|
42
|
+
scheduleId?: string;
|
|
41
43
|
/**
|
|
42
44
|
* What extensions computed for it, keyed `<extensionId>.<key>` (a query reads one as
|
|
43
45
|
* `facet.<extensionId>.<key>`). Absent: none, or a host that sends none.
|
|
@@ -67,6 +69,8 @@ interface SidebarExtensionView {
|
|
|
67
69
|
/** A contributed grouping, or {@link VIEW_CHOICE}. Absent: the space's grouping when it has one, else `groupBy`. */
|
|
68
70
|
group?: string;
|
|
69
71
|
}
|
|
72
|
+
/** The Origin filter: the sessions a reminder started (`scheduleId` set), or the others. */
|
|
73
|
+
type SidebarOrigin = 'scheduled' | 'unscheduled';
|
|
70
74
|
/** How the sidebar orders sessions inside a group. */
|
|
71
75
|
type SidebarSortBy = 'recency' | 'createdTime' | 'alphabetical';
|
|
72
76
|
/** The filter axes, kept per space. */
|
|
@@ -83,8 +87,10 @@ interface SidebarView {
|
|
|
83
87
|
sortBy: SidebarSortBy;
|
|
84
88
|
/** Only this agent's sessions (`AgentProfile.id`), or null for every agent. */
|
|
85
89
|
agent?: string | null;
|
|
90
|
+
/** Only the sessions a reminder started, or only the others. Absent or null: every session. */
|
|
91
|
+
origin?: SidebarOrigin | null;
|
|
86
92
|
/** What the user picked of the extensions' filters, sorts and groupings. Absent: nothing. */
|
|
87
93
|
extension?: SidebarExtensionView;
|
|
88
94
|
}
|
|
89
95
|
//#endregion
|
|
90
|
-
export { SessionActivityFilter, SessionArchiveFilter, SidebarExtensionView, SidebarGroupBy, SidebarListSession, SidebarSortBy, SidebarView, VIEW_CHOICE };
|
|
96
|
+
export { SessionActivityFilter, SessionArchiveFilter, SidebarExtensionView, SidebarGroupBy, SidebarListSession, SidebarOrigin, SidebarSortBy, SidebarView, VIEW_CHOICE };
|
|
@@ -80,6 +80,7 @@ function parseSidebarView(raw) {
|
|
|
80
80
|
const str = (v) => typeof v === "string" ? v : "";
|
|
81
81
|
const d = DEFAULT_SIDEBAR_VIEW;
|
|
82
82
|
const agent = typeof o.agent === "string" && o.agent.length > 0 ? o.agent : null;
|
|
83
|
+
const origin = o.origin === "scheduled" || o.origin === "unscheduled" ? o.origin : null;
|
|
83
84
|
const extension = parseExtensionView(o.extension);
|
|
84
85
|
return {
|
|
85
86
|
archive: parseArchive(str(o.archive)) ?? d.archive,
|
|
@@ -88,6 +89,7 @@ function parseSidebarView(raw) {
|
|
|
88
89
|
groupBy: parseGroupBy(str(o.groupBy)) ?? d.groupBy,
|
|
89
90
|
sortBy: parseSortBy(str(o.sortBy)) ?? d.sortBy,
|
|
90
91
|
...agent ? { agent } : {},
|
|
92
|
+
...origin ? { origin } : {},
|
|
91
93
|
...extension ? { extension } : {}
|
|
92
94
|
};
|
|
93
95
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Readable } from "../store.js";
|
|
2
|
+
import { SettingsCredential, SettingsProvider } from "../../../settings/headless/providers.js";
|
|
3
|
+
import { AuthFailure } from "zidane/chat/pure";
|
|
4
|
+
//#region src/chat/headless/transcript/auth-failure.d.ts
|
|
5
|
+
/** Where the card's Settings button lands: the provider (or MCP server, integration) and the stored credential that failed. */
|
|
6
|
+
interface AuthSettingsTarget {
|
|
7
|
+
/** What signs in. */
|
|
8
|
+
source: AuthFailure['source'];
|
|
9
|
+
/** The provider's key as the host lists it (or the MCP server's, the integration's name). */
|
|
10
|
+
provider: string;
|
|
11
|
+
/** The stored credential that failed (`SettingsCredential.key`), when it is known. */
|
|
12
|
+
credential?: string;
|
|
13
|
+
/** `apikey`: the credentials were an API key the provider refused; land on its key field. */
|
|
14
|
+
field?: 'apikey';
|
|
15
|
+
}
|
|
16
|
+
/** What the card offers for one failure, given the host's providers. */
|
|
17
|
+
interface AuthCardPlan {
|
|
18
|
+
/** The provider as the user knows it (`Anthropic`): the host's label, else `auth.provider`. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** The host's provider the failure is about, when the list names it. */
|
|
21
|
+
provider?: SettingsProvider;
|
|
22
|
+
/** The stored credential that failed, when it can be told. */
|
|
23
|
+
failed?: SettingsCredential;
|
|
24
|
+
/** The stored OAuth account to sign in again (`SettingsSignInOptions.replaceKey`). */
|
|
25
|
+
replaceKey?: string;
|
|
26
|
+
/** Another stored OAuth account of the provider to switch to. */
|
|
27
|
+
otherAccount?: SettingsCredential;
|
|
28
|
+
/** Where Settings opens for it. */
|
|
29
|
+
settings: AuthSettingsTarget;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Plans the card of a failed sign-in: the provider's label, the stored
|
|
33
|
+
* credential that failed (by its id, else its account name, else the one in
|
|
34
|
+
* use when the failure names none), another OAuth account to switch to, and
|
|
35
|
+
* the Settings target.
|
|
36
|
+
*
|
|
37
|
+
* @param auth - The failed sign-in.
|
|
38
|
+
* @param providers - The providers of the host that holds the credentials; absent while unknown.
|
|
39
|
+
*/
|
|
40
|
+
declare function planAuthCard(auth: AuthFailure, providers?: readonly SettingsProvider[]): AuthCardPlan;
|
|
41
|
+
/**
|
|
42
|
+
* What the card's Copy details writes: the headline, the reason, and the
|
|
43
|
+
* provider's own words when the reason rephrased them.
|
|
44
|
+
*
|
|
45
|
+
* @param headline - The card's headline.
|
|
46
|
+
* @param reason - The run's stop reason.
|
|
47
|
+
* @param raw - The provider's own words (`RunErrorDetail.raw`).
|
|
48
|
+
*/
|
|
49
|
+
declare function authFailureDetails(headline: string, reason: string, raw?: string): string;
|
|
50
|
+
/** The sign-ins fixed from a card, per session: every card for the same sign-in says so. */
|
|
51
|
+
interface AuthFixes {
|
|
52
|
+
/** The sign-ins fixed in a session (`null`: a session without an id). */
|
|
53
|
+
fixed(sessionId: string | null): Readable<readonly AuthFailure[]>;
|
|
54
|
+
/** Records that a sign-in of a session was fixed. */
|
|
55
|
+
add(sessionId: string | null, auth: AuthFailure): void;
|
|
56
|
+
}
|
|
57
|
+
/** Creates an empty {@link AuthFixes}. */
|
|
58
|
+
declare function createAuthFixes(): AuthFixes;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a failure's sign-in was fixed since.
|
|
61
|
+
*
|
|
62
|
+
* @param fixes - The session's fixed sign-ins.
|
|
63
|
+
* @param auth - The failure.
|
|
64
|
+
*/
|
|
65
|
+
declare function isAuthFixed(fixes: readonly AuthFailure[], auth: AuthFailure): boolean;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { AuthCardPlan, AuthFixes, AuthSettingsTarget, authFailureDetails, createAuthFixes, isAuthFixed, planAuthCard };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { writable } from "../store.js";
|
|
2
|
+
import { authProviderKeys, sameAuthTarget } from "zidane/chat/pure";
|
|
3
|
+
//#region src/chat/headless/transcript/auth-failure.ts
|
|
4
|
+
/**
|
|
5
|
+
* The model behind a sign-in failure's card (`AuthFailureCard`): which
|
|
6
|
+
* provider and stored account failed, what the card can offer for it (sign
|
|
7
|
+
* that account in again, switch to another stored account, open Settings
|
|
8
|
+
* there), its copyable details, and the sign-ins fixed in this page's life.
|
|
9
|
+
* The rules of what to offer are core's (`zidane/chat/pure`'s
|
|
10
|
+
* `authPrimaryAction` …), shared with the TUI. React-free.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Plans the card of a failed sign-in: the provider's label, the stored
|
|
14
|
+
* credential that failed (by its id, else its account name, else the one in
|
|
15
|
+
* use when the failure names none), another OAuth account to switch to, and
|
|
16
|
+
* the Settings target.
|
|
17
|
+
*
|
|
18
|
+
* @param auth - The failed sign-in.
|
|
19
|
+
* @param providers - The providers of the host that holds the credentials; absent while unknown.
|
|
20
|
+
*/
|
|
21
|
+
function planAuthCard(auth, providers) {
|
|
22
|
+
const keys = authProviderKeys(auth);
|
|
23
|
+
const provider = auth.source === "provider" ? providers?.find((p) => keys.includes(p.key)) : void 0;
|
|
24
|
+
const stored = provider?.methods.filter((m) => m.key && m.source !== "env") ?? [];
|
|
25
|
+
const named = auth.accountId !== void 0 || auth.accountLabel !== void 0;
|
|
26
|
+
const failed = (auth.accountId ? stored.find((m) => m.id === auth.accountId) : void 0) ?? (auth.accountLabel ? stored.find((m) => m.source === "oauth" && m.label === auth.accountLabel) : void 0) ?? (named ? void 0 : stored.find((m) => m.active));
|
|
27
|
+
const otherAccount = stored.find((m) => m.source === "oauth" && m.key !== failed?.key);
|
|
28
|
+
const apiKey = auth.kind === "rejected" && (failed ? failed.source === "apikey" : provider !== void 0 && provider.hasApiKey && !provider.hasOAuth);
|
|
29
|
+
return {
|
|
30
|
+
label: provider?.label ?? auth.provider,
|
|
31
|
+
...provider ? { provider } : {},
|
|
32
|
+
...failed ? { failed } : {},
|
|
33
|
+
...failed?.source === "oauth" && failed.key ? { replaceKey: failed.key } : {},
|
|
34
|
+
...otherAccount ? { otherAccount } : {},
|
|
35
|
+
settings: {
|
|
36
|
+
source: auth.source,
|
|
37
|
+
provider: provider?.key ?? auth.providerId ?? auth.provider,
|
|
38
|
+
...failed?.key ? { credential: failed.key } : {},
|
|
39
|
+
...apiKey ? { field: "apikey" } : {}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* What the card's Copy details writes: the headline, the reason, and the
|
|
45
|
+
* provider's own words when the reason rephrased them.
|
|
46
|
+
*
|
|
47
|
+
* @param headline - The card's headline.
|
|
48
|
+
* @param reason - The run's stop reason.
|
|
49
|
+
* @param raw - The provider's own words (`RunErrorDetail.raw`).
|
|
50
|
+
*/
|
|
51
|
+
function authFailureDetails(headline, reason, raw) {
|
|
52
|
+
return [
|
|
53
|
+
headline,
|
|
54
|
+
reason,
|
|
55
|
+
raw && raw !== reason ? raw : ""
|
|
56
|
+
].filter(Boolean).join("\n\n");
|
|
57
|
+
}
|
|
58
|
+
/** Creates an empty {@link AuthFixes}. */
|
|
59
|
+
function createAuthFixes() {
|
|
60
|
+
const stores = /* @__PURE__ */ new Map();
|
|
61
|
+
const of = (sessionId) => {
|
|
62
|
+
let store = stores.get(sessionId);
|
|
63
|
+
if (!store) {
|
|
64
|
+
store = writable([]);
|
|
65
|
+
stores.set(sessionId, store);
|
|
66
|
+
}
|
|
67
|
+
return store;
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
fixed: of,
|
|
71
|
+
add: (sessionId, auth) => {
|
|
72
|
+
const store = of(sessionId);
|
|
73
|
+
if (!store.get().some((fix) => sameAuthTarget(fix, auth))) store.set([...store.get(), auth]);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Whether a failure's sign-in was fixed since.
|
|
79
|
+
*
|
|
80
|
+
* @param fixes - The session's fixed sign-ins.
|
|
81
|
+
* @param auth - The failure.
|
|
82
|
+
*/
|
|
83
|
+
function isAuthFixed(fixes, auth) {
|
|
84
|
+
return fixes.some((fix) => sameAuthTarget(fix, auth));
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { authFailureDetails, createAuthFixes, isAuthFixed, planAuthCard };
|
|
@@ -6,5 +6,6 @@ import { nestToolCalls, nestedCallVisible } from "./nesting.js";
|
|
|
6
6
|
import { PairingResult, ToolPairing, pairToolEvents } from "./pairing.js";
|
|
7
7
|
import { FoldActionItem, FoldActionState, foldActionItems, toolAction } from "./fold-actions.js";
|
|
8
8
|
import { RunFailure, failureTooltip, markRunFailures } from "./run-failures.js";
|
|
9
|
+
import { AuthCardPlan, AuthFixes, AuthSettingsTarget, authFailureDetails, createAuthFixes, isAuthFixed, planAuthCard } from "./auth-failure.js";
|
|
9
10
|
import { SelectStops, computeSelectStops, rowTurnIds, stopForRow } from "./select-stops.js";
|
|
10
|
-
export { type BashExitMeta, type Cluster, type DotVariant, type ExchangeFoldStats, type FoldActionItem, type FoldActionState, type GroupCluster, type Owned, type PairingResult, type Row, type RunFailure, type SelectStops, type SpawnMeta, type ToolPairing, type ToolRowModel, batchThinkingRuns, batchToolRuns, clusterByOwner, collapseEvents, computeSelectStops, dockRunReceipts, dotVariantFor, failureTooltip, findLastStreamingRow, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, inheritRowIdentity, markRunFailures, nestToolCalls, nestedCallVisible, pairToolEvents, parseBashExitMeta, refusedSpawn, rowTurnIds, stopForRow, toolAction, toolFailed };
|
|
11
|
+
export { type AuthCardPlan, type AuthFixes, type AuthSettingsTarget, type BashExitMeta, type Cluster, type DotVariant, type ExchangeFoldStats, type FoldActionItem, type FoldActionState, type GroupCluster, type Owned, type PairingResult, type Row, type RunFailure, type SelectStops, type SpawnMeta, type ToolPairing, type ToolRowModel, authFailureDetails, batchThinkingRuns, batchToolRuns, clusterByOwner, collapseEvents, computeSelectStops, createAuthFixes, dockRunReceipts, dotVariantFor, failureTooltip, findLastStreamingRow, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, inheritRowIdentity, isAuthFixed, markRunFailures, nestToolCalls, nestedCallVisible, pairToolEvents, parseBashExitMeta, planAuthCard, refusedSpawn, rowTurnIds, stopForRow, toolAction, toolFailed };
|
|
@@ -6,5 +6,6 @@ import { foldActionItems, toolAction } from "./fold-actions.js";
|
|
|
6
6
|
import { dockRunReceipts, dotVariantFor, findLastStreamingRow, foldExchanges, foldWorkerRows } from "./fold.js";
|
|
7
7
|
import { nestToolCalls, nestedCallVisible } from "./nesting.js";
|
|
8
8
|
import { failureTooltip, markRunFailures } from "./run-failures.js";
|
|
9
|
+
import { authFailureDetails, createAuthFixes, isAuthFixed, planAuthCard } from "./auth-failure.js";
|
|
9
10
|
import { computeSelectStops, rowTurnIds, stopForRow } from "./select-stops.js";
|
|
10
|
-
export { batchThinkingRuns, batchToolRuns, clusterByOwner, collapseEvents, computeSelectStops, dockRunReceipts, dotVariantFor, failureTooltip, findLastStreamingRow, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, inheritRowIdentity, markRunFailures, nestToolCalls, nestedCallVisible, pairToolEvents, parseBashExitMeta, refusedSpawn, rowTurnIds, stopForRow, toolAction, toolFailed };
|
|
11
|
+
export { authFailureDetails, batchThinkingRuns, batchToolRuns, clusterByOwner, collapseEvents, computeSelectStops, createAuthFixes, dockRunReceipts, dotVariantFor, failureTooltip, findLastStreamingRow, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, inheritRowIdentity, isAuthFixed, markRunFailures, nestToolCalls, nestedCallVisible, pairToolEvents, parseBashExitMeta, planAuthCard, refusedSpawn, rowTurnIds, stopForRow, toolAction, toolFailed };
|
|
@@ -2,9 +2,9 @@ import { ChatEvent } from "../host.js";
|
|
|
2
2
|
import { Row } from "./rows.js";
|
|
3
3
|
//#region src/chat/headless/transcript/nesting.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Whether a nested call's events show:
|
|
6
|
-
*
|
|
7
|
-
* `Settings.codemodeShowCalls
|
|
5
|
+
* Whether a nested call's events show: core's `nestedCallShown` (a subagent,
|
|
6
|
+
* a plan or a question always; the rest only with
|
|
7
|
+
* `Settings.codemodeShowCalls`), the rule `isVisible` applies too.
|
|
8
8
|
*
|
|
9
9
|
* @param event - The transcript event.
|
|
10
10
|
* @param codemodeShowCalls - The user's `codemodeShowCalls` setting.
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { sameMembers } from "./batch.js";
|
|
2
|
+
import { nestedCallShown } from "zidane/chat/pure";
|
|
2
3
|
//#region src/chat/headless/transcript/nesting.ts
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Calls a tool made (a codemode script's `tools.*`, recorded with
|
|
6
|
+
* `parentToolCallId`) as children of the calling row: one grouping step
|
|
7
|
+
* keyed on the parent's call id, never on position, so a live run (nested
|
|
8
|
+
* events between the parent's call and result) and a reload (nested pairs
|
|
9
|
+
* right before the parent's result) give the same rows.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Whether a nested call's events show: core's `nestedCallShown` (a subagent,
|
|
13
|
+
* a plan or a question always; the rest only with
|
|
14
|
+
* `Settings.codemodeShowCalls`), the rule `isVisible` applies too.
|
|
7
15
|
*
|
|
8
16
|
* @param event - The transcript event.
|
|
9
17
|
* @param codemodeShowCalls - The user's `codemodeShowCalls` setting.
|
|
10
18
|
*/
|
|
11
19
|
function nestedCallVisible(event, codemodeShowCalls) {
|
|
12
|
-
return event.parentToolCallId === void 0 || event
|
|
20
|
+
return event.parentToolCallId === void 0 || nestedCallShown(event, codemodeShowCalls);
|
|
13
21
|
}
|
|
14
22
|
/** The row with children, per source row: kept while the children are the same rows. */
|
|
15
23
|
const NESTED_CACHE = /* @__PURE__ */ new WeakMap();
|