zidane-ui 9.1.4 → 9.1.5
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/ComposerEditor.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 +5 -3
- package/dist/chat/headless/index.js +16 -14
- 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/index.d.ts +2 -2
- 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-BI6RZc60.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.js +2 -2
- package/dist/keybindings/headless/index.js +2 -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/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 +412 -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/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/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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Readable } from "../../chat/headless/store.js";
|
|
2
2
|
import { ProviderResetOutcome, ProviderResetTarget, ProviderUsageSnapshot as ProviderUsageSnapshot$1, UsageRange, UsageSummary } from "./usage.js";
|
|
3
|
-
import { ExtensionArtifactRowFact, ExtensionBadgeIcon, ExtensionBadgeTone } from "zidane/chat/pure";
|
|
4
|
-
import { PromptAttachment, QueuedAttachment, TodoItem
|
|
3
|
+
import { ExtensionArtifactRowFact, ExtensionBadgeIcon, ExtensionBadgeTone, Schedule, ScheduleFire, ScheduleInput, SchedulePatch, SecretTtl } from "zidane/chat/pure";
|
|
4
|
+
import { ActivePlanSummary, PlanEditOp, PlanStep, PlanView, PlansSnapshot, PromptAttachment, QueuedAttachment, TodoItem } from "zidane/chat";
|
|
5
5
|
import { IpcResult, RunningWorkItem } from "zidane/ipc";
|
|
6
6
|
import { SessionArtifact } from "zidane";
|
|
7
7
|
import { SessionTurn } from "zidane/types";
|
|
@@ -82,15 +82,25 @@ interface SessionArtifactGroup {
|
|
|
82
82
|
/** The artifacts of this kind, newest first. */
|
|
83
83
|
rows: SessionArtifactRow[];
|
|
84
84
|
}
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/**
|
|
85
|
+
/** Stops or drops a plan. */
|
|
86
|
+
type PlanControlAction = 'stop' | 'drop';
|
|
87
|
+
/** A session's plans: the one the agent applies, the ones that stopped or closed. */
|
|
88
|
+
interface SessionPlans {
|
|
89
|
+
/** The session's snapshot: `null` until read, or for an unknown session. One store per session id. */
|
|
90
|
+
snapshot(sessionId: string): Readable<PlansSnapshot | null>;
|
|
91
|
+
/** Reads the session's plans (also the first read). Never rejects: the next push catches up. */
|
|
90
92
|
refresh(sessionId: string): Promise<void>;
|
|
91
|
-
/**
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Applies a user edit to a plan's steps (add, rename, cancel: a step is never deleted). The snapshot follows.
|
|
95
|
+
* Rejects with the backend's reason (a closed plan, another process running the session). Absent: read-only.
|
|
96
|
+
*/
|
|
97
|
+
edit?(sessionId: string, planId: string, op: PlanEditOp): Promise<void>;
|
|
98
|
+
/** Stops or drops a plan (and the run applying it). The snapshot follows. Rejects with the backend's reason. */
|
|
99
|
+
control?(sessionId: string, planId: string, action: PlanControlAction): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Sends a message into the session's run (it steers a live run, starts one when idle): a step's retry, a
|
|
102
|
+
* stopped plan's resume. Absent: no retry, no resume.
|
|
103
|
+
*/
|
|
94
104
|
retry?(sessionId: string, message: string): Promise<void>;
|
|
95
105
|
}
|
|
96
106
|
/** A session's type-ahead queue: messages sent while the agent works, delivered when the run ends. */
|
|
@@ -129,6 +139,64 @@ interface SessionArtifacts {
|
|
|
129
139
|
force?: boolean;
|
|
130
140
|
}): Promise<void>;
|
|
131
141
|
}
|
|
142
|
+
/** One saved secret of a session's project, without its value: name, save time, expiry, the session that saved it. */
|
|
143
|
+
type SessionSecretEntry = IpcResult<'secrets.list'>[number];
|
|
144
|
+
/** What a secret saved by hand takes: its name, its value, how long it stays. */
|
|
145
|
+
interface SessionSecretInput {
|
|
146
|
+
/** Env-style name (`API_TOKEN`): capital letters, digits and `_`, starting with a letter. */
|
|
147
|
+
name: string;
|
|
148
|
+
/** The value. Sent once, never read back. */
|
|
149
|
+
value: string;
|
|
150
|
+
/** How long it stays. */
|
|
151
|
+
ttl: SecretTtl;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The saved secrets of a session's project (`Settings.secrets`): the Secrets panel. Values go in, never out: the
|
|
155
|
+
* entries carry names and expiry times only. The backend lists none while the setting is off.
|
|
156
|
+
*/
|
|
157
|
+
interface SessionSecrets {
|
|
158
|
+
/** The project's valid secrets, as the session sees them: `null` until first read. One store per session id. */
|
|
159
|
+
entries(sessionId: string): Readable<readonly SessionSecretEntry[] | null>;
|
|
160
|
+
/** Reads the session's secrets (also the first read). Rejects when the read fails. */
|
|
161
|
+
refresh(sessionId: string): Promise<void>;
|
|
162
|
+
/** Adds or replaces a secret. Rejects with the backend's reason (the setting is off, a plain-text remote link). Absent: read-only. */
|
|
163
|
+
save?(sessionId: string, input: SessionSecretInput): Promise<SessionSecretEntry>;
|
|
164
|
+
/** Removes a secret. Resolves `false` when it did not exist. Absent: no Revoke. */
|
|
165
|
+
revoke?(sessionId: string, name: string): Promise<boolean>;
|
|
166
|
+
}
|
|
167
|
+
/** Whether reminders are on (`Settings.schedules`) and whether the backend's store keeps them (zidane's `schedules.status`). */
|
|
168
|
+
interface SchedulesStatus {
|
|
169
|
+
/** The setting is on and the store keeps schedules. Off: nothing about reminders shows. */
|
|
170
|
+
enabled: boolean;
|
|
171
|
+
/** The store keeps schedules at all. */
|
|
172
|
+
supported: boolean;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Reminders (zidane's schedules): prompts sent to a session at a set time, once or on a repeat. The Reminders panel
|
|
176
|
+
* and the composer badge. Every action rejects with the backend's reason (the feature is off, a refused input).
|
|
177
|
+
*/
|
|
178
|
+
interface SessionSchedules {
|
|
179
|
+
/** Whether the feature is on: `null` until read. While `enabled` is false nothing about reminders shows. */
|
|
180
|
+
status: Readable<SchedulesStatus | null>;
|
|
181
|
+
/** Every schedule of the backend: `null` until read, and while the feature is off. */
|
|
182
|
+
all: Readable<readonly Schedule[] | null>;
|
|
183
|
+
/** The schedules whose prompt goes to `sessionId` (`null` like `all`). One store per session id. */
|
|
184
|
+
forSession(sessionId: string): Readable<readonly Schedule[] | null>;
|
|
185
|
+
/** Reads the status, then the list while on. Rejects when a read fails. */
|
|
186
|
+
refresh(): Promise<void>;
|
|
187
|
+
/** Reads once, the first time something shows reminders. Never rejects. */
|
|
188
|
+
ensure(): void;
|
|
189
|
+
/** Creates a schedule (the trigger exact: the client reads the time words in its own time zone). Absent: no create form. */
|
|
190
|
+
create?(input: ScheduleInput): Promise<Schedule>;
|
|
191
|
+
/** Changes a schedule (pause, resume, keep for good with `expiresAt: null`). Absent: read-only rows. */
|
|
192
|
+
update?(id: string, patch: SchedulePatch): Promise<Schedule>;
|
|
193
|
+
/** Removes a schedule and its fires. Resolves `false` when it was gone. Absent: no Delete. */
|
|
194
|
+
remove?(id: string): Promise<boolean>;
|
|
195
|
+
/** Runs a schedule's action now; its next time does not move. Absent: no Run now. */
|
|
196
|
+
runNow?(id: string): Promise<ScheduleFire>;
|
|
197
|
+
/** A schedule's fires, newest first. Absent: no history. */
|
|
198
|
+
fires?(id: string, limit?: number): Promise<readonly ScheduleFire[]>;
|
|
199
|
+
}
|
|
132
200
|
/** A session's cancellable work: parent-level tool calls and background tasks. */
|
|
133
201
|
interface SessionRunningWork {
|
|
134
202
|
/** The session's work, live (empty for none). One store per session id. */
|
|
@@ -217,8 +285,8 @@ interface SessionSideChats {
|
|
|
217
285
|
}
|
|
218
286
|
/** The session panels' host. Every member is optional: what a host leaves out is not shown. */
|
|
219
287
|
interface SessionHost {
|
|
220
|
-
/** The
|
|
221
|
-
|
|
288
|
+
/** The plans. Absent: no Todos panel. */
|
|
289
|
+
plans?: SessionPlans;
|
|
222
290
|
/** The type-ahead queues. Absent: no queue. */
|
|
223
291
|
queue?: SessionQueue;
|
|
224
292
|
/** The recorded artifacts. Absent: no Artifacts panel. */
|
|
@@ -233,6 +301,10 @@ interface SessionHost {
|
|
|
233
301
|
usage?: SessionUsage;
|
|
234
302
|
/** `/side` chats about a session. Absent: no side chat. */
|
|
235
303
|
side?: SessionSideChats;
|
|
304
|
+
/** The saved secrets of a session's project. Absent: no Secrets panel. */
|
|
305
|
+
secrets?: SessionSecrets;
|
|
306
|
+
/** Reminders (zidane's schedules). Absent: no Reminders panel, no badge. */
|
|
307
|
+
schedules?: SessionSchedules;
|
|
236
308
|
}
|
|
237
309
|
//#endregion
|
|
238
|
-
export { type PromptAttachment, QueueAddDelivery, QueueAddOptions, QueuePushDelivery, type QueuedAttachment, QueuedMessage, type RunningWorkItem, type SessionArtifact, SessionArtifactGroup, SessionArtifactRow, SessionArtifactRowView, SessionArtifacts, SessionCacheReport, SessionDetailsActions, SessionExportFormat, SessionHost, SessionQueue, SessionRunningWork,
|
|
310
|
+
export { type ActivePlanSummary, PlanControlAction, type PlanEditOp, type PlanStep, type PlanView, type PlansSnapshot, type PromptAttachment, QueueAddDelivery, QueueAddOptions, QueuePushDelivery, type QueuedAttachment, QueuedMessage, type RunningWorkItem, type Schedule, type ScheduleFire, type ScheduleInput, type SchedulePatch, SchedulesStatus, type SessionArtifact, SessionArtifactGroup, SessionArtifactRow, SessionArtifactRowView, SessionArtifacts, SessionCacheReport, SessionDetailsActions, SessionExportFormat, SessionHost, SessionPlans, SessionQueue, SessionRunningWork, SessionSchedules, SessionSecretEntry, SessionSecretInput, SessionSecrets, SessionSideChats, type SessionTurn, SessionTurns, SessionUsage, SideChatLookup, SideChatSession, type TodoItem };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ProviderResetCredit, ProviderResetOutcome, ProviderResetTarget, ProviderUsageSnapshot, ProviderUsageSource, ProviderUsageState, ProviderUsageView, USAGE_RANGES, USAGE_SNAPSHOT_KEY, UsageHeatmapDay, UsageModelDayPoint, UsageModelRow, UsageProviderRow, UsageRange, UsageSummaries, UsageSummary, UsageSummaryState, UsageSummaryStateOptions, createProviderUsageState, createUsageSummaryState, isUsageSummary, pickUsageSummary } from "./usage.js";
|
|
2
|
-
import { PromptAttachment, QueueAddDelivery, QueueAddOptions, QueuePushDelivery, QueuedAttachment, QueuedMessage, RunningWorkItem, SessionArtifact, SessionArtifactGroup, SessionArtifactRow, SessionArtifactRowView, SessionArtifacts, SessionCacheReport, SessionDetailsActions, SessionExportFormat, SessionHost, SessionQueue, SessionRunningWork,
|
|
2
|
+
import { ActivePlanSummary, PlanControlAction, PlanEditOp, PlanStep, PlanView, PlansSnapshot, PromptAttachment, QueueAddDelivery, QueueAddOptions, QueuePushDelivery, QueuedAttachment, QueuedMessage, RunningWorkItem, Schedule, ScheduleFire, ScheduleInput, SchedulePatch, SchedulesStatus, SessionArtifact, SessionArtifactGroup, SessionArtifactRow, SessionArtifactRowView, SessionArtifacts, SessionCacheReport, SessionDetailsActions, SessionExportFormat, SessionHost, SessionPlans, SessionQueue, SessionRunningWork, SessionSchedules, SessionSecretEntry, SessionSecretInput, SessionSecrets, SessionSideChats, SessionTurn, SessionTurns, SessionUsage, SideChatLookup, SideChatSession, TodoItem } from "./host.js";
|
|
3
|
+
import { InboxPlans, PlansState, TodoTallyCounts, createPlansState, displayedPlan, inboxPlans, planTally } from "./plans.js";
|
|
4
|
+
import { ReminderWhen, RemindersSummary, SchedulesBackend, SchedulesState, canKeepSchedule, createSchedulesState, isScheduleFinished, readReminderWhen, remindersSummary, sortSchedules, upcomingSchedules } from "./schedules.js";
|
|
3
5
|
import { SessionDiffEntry, SessionEditEvent, collectSessionDiffs, fileDiffCounts, groupByPath } from "./session-diffs.js";
|
|
4
6
|
import { DiffListFile, DiffTreeDir, DiffTreeFile, DiffTreeNode, buildDiffTree, fileOrder, relativeTo, visibleRows } from "./diff-tree.js";
|
|
5
7
|
import { StagedAttachment, attachmentsKey, stagedToWire, wireToStaged } from "./queue-attachments.js";
|
|
@@ -9,8 +11,8 @@ import { SideRefusal, SideRequests, createSideRequests, parseSideCommand } from
|
|
|
9
11
|
import { ArtifactsState, countArtifacts, createArtifactsState, groupArtifactRows, plainArtifactRow } from "./artifacts.js";
|
|
10
12
|
import { EMPTY_HOME_PREFS, HomeBlock, HomeBlockSource, HomePrefs, HomeRow, arrangeHomeBlocks, hideHomeBlock, homeBlocksOf, homeRows, moveHomeBlock, parseHomePrefs, placeHomeBlock, setHomeBlockView, setHomeBlockWidth, showHomeBlock } from "./home-layout.js";
|
|
11
13
|
import { KeyedState, createKeyedState } from "./keyed.js";
|
|
12
|
-
import { TodosState, createTodosState } from "./todos.js";
|
|
13
14
|
import { QueueBackend, QueueState, createQueueState, toQueuedMessages } from "./queue.js";
|
|
15
|
+
import { SecretsState, createSecretsState, sortSecrets } from "./secrets.js";
|
|
14
16
|
import { formatTokens, localDayString } from "./usage-format.js";
|
|
15
17
|
import { SessionActionName, SessionActionTarget, SessionActions, SessionActionsDeps, SessionConfirmOptions, createSessionActions, sessionKeyCommands } from "./session-actions.js";
|
|
16
|
-
export { ArtifactsState, DEFAULT_SESSION_LABELS, DiffListFile, DiffTreeDir, DiffTreeFile, DiffTreeNode, EMPTY_HOME_PREFS, HomeBlock, HomeBlockSource, HomePrefs, HomeRow, KeyedState, type PromptAttachment, type ProviderResetCredit, type ProviderResetOutcome, ProviderResetTarget, type ProviderUsageSnapshot, ProviderUsageSource, ProviderUsageState, ProviderUsageView, QueueAddDelivery, QueueAddOptions, QueueBackend, QueuePushDelivery, QueueState, type QueuedAttachment, QueuedMessage, type RunningWorkItem, RunningWorkState, SessionActionName, SessionActionTarget, SessionActions, SessionActionsDeps, type SessionArtifact, SessionArtifactGroup, SessionArtifactRow, SessionArtifactRowView, SessionArtifacts, SessionCacheReport, SessionConfirmOptions, SessionDetailsActions, SessionDiffEntry, SessionEditEvent, SessionExportFormat, SessionHost, SessionLabels, SessionQueue, SessionRunningWork,
|
|
18
|
+
export { type ActivePlanSummary, ArtifactsState, DEFAULT_SESSION_LABELS, DiffListFile, DiffTreeDir, DiffTreeFile, DiffTreeNode, EMPTY_HOME_PREFS, HomeBlock, HomeBlockSource, HomePrefs, HomeRow, InboxPlans, KeyedState, PlanControlAction, type PlanEditOp, type PlanStep, type PlanView, type PlansSnapshot, PlansState, type PromptAttachment, type ProviderResetCredit, type ProviderResetOutcome, ProviderResetTarget, type ProviderUsageSnapshot, ProviderUsageSource, ProviderUsageState, ProviderUsageView, QueueAddDelivery, QueueAddOptions, QueueBackend, QueuePushDelivery, QueueState, type QueuedAttachment, QueuedMessage, ReminderWhen, RemindersSummary, type RunningWorkItem, RunningWorkState, type Schedule, type ScheduleFire, type ScheduleInput, type SchedulePatch, SchedulesBackend, SchedulesState, SchedulesStatus, SecretsState, SessionActionName, SessionActionTarget, SessionActions, SessionActionsDeps, type SessionArtifact, SessionArtifactGroup, SessionArtifactRow, SessionArtifactRowView, SessionArtifacts, SessionCacheReport, SessionConfirmOptions, SessionDetailsActions, SessionDiffEntry, SessionEditEvent, SessionExportFormat, SessionHost, SessionLabels, SessionPlans, SessionQueue, SessionRunningWork, SessionSchedules, SessionSecretEntry, SessionSecretInput, SessionSecrets, SessionSideChats, type SessionTurn, SessionTurns, SessionUsage, SideChatLookup, SideChatSession, SideRefusal, SideRequests, StagedAttachment, type TodoItem, TodoTallyCounts, USAGE_RANGES, USAGE_SNAPSHOT_KEY, UsageHeatmapDay, UsageModelDayPoint, UsageModelRow, UsageProviderRow, UsageRange, UsageSummaries, UsageSummary, UsageSummaryState, UsageSummaryStateOptions, arrangeHomeBlocks, attachmentsKey, buildDiffTree, canKeepSchedule, collectSessionDiffs, countArtifacts, createArtifactsState, createKeyedState, createPlansState, createProviderUsageState, createQueueState, createRunningWorkState, createSchedulesState, createSecretsState, createSessionActions, createSideRequests, createUsageSummaryState, displayedPlan, fileDiffCounts, fileOrder, formatTokens, groupArtifactRows, groupByPath, hideHomeBlock, homeBlocksOf, homeRows, inboxPlans, isScheduleFinished, isUsageSummary, localDayString, moveHomeBlock, parseHomePrefs, parseSideCommand, pickUsageSummary, placeHomeBlock, plainArtifactRow, planTally, readReminderWhen, relativeTo, remindersSummary, sameRunningWork, sessionKeyCommands, setHomeBlockView, setHomeBlockWidth, showHomeBlock, sortSchedules, sortSecrets, stagedToWire, toQueuedMessages, upcomingSchedules, visibleRows, wireToStaged };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { DEFAULT_SESSION_LABELS } from "./labels.js";
|
|
2
1
|
import { createKeyedState } from "./keyed.js";
|
|
3
2
|
import { countArtifacts, createArtifactsState, groupArtifactRows, plainArtifactRow } from "./artifacts.js";
|
|
4
3
|
import { createQueueState, toQueuedMessages } from "./queue.js";
|
|
5
4
|
import { createRunningWorkState, sameRunningWork } from "./running-work.js";
|
|
6
|
-
import {
|
|
5
|
+
import { canKeepSchedule, createSchedulesState, isScheduleFinished, readReminderWhen, remindersSummary, sortSchedules, upcomingSchedules } from "./schedules.js";
|
|
6
|
+
import { createPlansState, displayedPlan, inboxPlans, planTally } from "./plans.js";
|
|
7
|
+
import { createSecretsState, sortSecrets } from "./secrets.js";
|
|
8
|
+
import { DEFAULT_SESSION_LABELS } from "./labels.js";
|
|
7
9
|
import { createSideRequests, parseSideCommand } from "./side.js";
|
|
8
10
|
import { buildDiffTree, fileOrder, relativeTo, visibleRows } from "./diff-tree.js";
|
|
9
11
|
import { collectSessionDiffs, fileDiffCounts, groupByPath } from "./session-diffs.js";
|
|
@@ -12,4 +14,4 @@ import { EMPTY_HOME_PREFS, arrangeHomeBlocks, hideHomeBlock, homeBlocksOf, homeR
|
|
|
12
14
|
import { USAGE_RANGES, USAGE_SNAPSHOT_KEY, createProviderUsageState, createUsageSummaryState, isUsageSummary, pickUsageSummary } from "./usage.js";
|
|
13
15
|
import { attachmentsKey, stagedToWire, wireToStaged } from "./queue-attachments.js";
|
|
14
16
|
import { createSessionActions, sessionKeyCommands } from "./session-actions.js";
|
|
15
|
-
export { DEFAULT_SESSION_LABELS, EMPTY_HOME_PREFS, USAGE_RANGES, USAGE_SNAPSHOT_KEY, arrangeHomeBlocks, attachmentsKey, buildDiffTree, collectSessionDiffs, countArtifacts, createArtifactsState, createKeyedState, createProviderUsageState, createQueueState, createRunningWorkState, createSessionActions, createSideRequests,
|
|
17
|
+
export { DEFAULT_SESSION_LABELS, EMPTY_HOME_PREFS, USAGE_RANGES, USAGE_SNAPSHOT_KEY, arrangeHomeBlocks, attachmentsKey, buildDiffTree, canKeepSchedule, collectSessionDiffs, countArtifacts, createArtifactsState, createKeyedState, createPlansState, createProviderUsageState, createQueueState, createRunningWorkState, createSchedulesState, createSecretsState, createSessionActions, createSideRequests, createUsageSummaryState, displayedPlan, fileDiffCounts, fileOrder, formatTokens, groupArtifactRows, groupByPath, hideHomeBlock, homeBlocksOf, homeRows, inboxPlans, isScheduleFinished, isUsageSummary, localDayString, moveHomeBlock, parseHomePrefs, parseSideCommand, pickUsageSummary, placeHomeBlock, plainArtifactRow, planTally, readReminderWhen, relativeTo, remindersSummary, sameRunningWork, sessionKeyCommands, setHomeBlockView, setHomeBlockWidth, showHomeBlock, sortSchedules, sortSecrets, stagedToWire, toQueuedMessages, upcomingSchedules, visibleRows, wireToStaged };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ProviderResetOutcome } from "./usage.js";
|
|
2
|
+
import { SecretTimeLeft } from "../../chat/headless/secrets.js";
|
|
3
|
+
import { ReminderWhen } from "./schedules.js";
|
|
2
4
|
import { RunningWorkItem } from "./running-work.js";
|
|
3
|
-
import { TodoStatus } from "zidane/chat";
|
|
5
|
+
import { PlanState, PlanStopReason, TodoStatus } from "zidane/chat";
|
|
4
6
|
//#region src/session/headless/labels.d.ts
|
|
5
7
|
/** Where a session's folder is, as the details dialog words it. */
|
|
6
8
|
type FolderLocation = {
|
|
@@ -13,6 +15,57 @@ type FolderLocation = {
|
|
|
13
15
|
};
|
|
14
16
|
/** The default English strings of the session panels. Override any of them through `SessionProvider`. */
|
|
15
17
|
declare const DEFAULT_SESSION_LABELS: {
|
|
18
|
+
remindersLabel: string;
|
|
19
|
+
remindersOff: string;
|
|
20
|
+
remindersOffHint: string;
|
|
21
|
+
remindersUnsupported: string;
|
|
22
|
+
remindersScopeLabel: string;
|
|
23
|
+
remindersScopeSession: string;
|
|
24
|
+
remindersScopeAll: string;
|
|
25
|
+
remindersListLabel: string;
|
|
26
|
+
remindersEmpty: string;
|
|
27
|
+
remindersEmptyHint: string;
|
|
28
|
+
remindersEmptyAll: string;
|
|
29
|
+
remindersCount: (n: number) => string;
|
|
30
|
+
remindersFinished: string;
|
|
31
|
+
reminderNew: string;
|
|
32
|
+
reminderWhenLabel: string;
|
|
33
|
+
reminderWhenPlaceholder: string;
|
|
34
|
+
reminderWhenPicks: readonly string[];
|
|
35
|
+
reminderWhenPick: (words: string) => string;
|
|
36
|
+
reminderWhenError: (reason: Extract<ReminderWhen, {
|
|
37
|
+
ok: false;
|
|
38
|
+
}>["reason"]) => "Type when to send it." | "Only the time goes here. Put the message below." | "Try in 20m, at 9:00, tomorrow 9:00, every 2h, daily 9:00, weekdays 9:00 or cron \"0 9 * * 1-5\".";
|
|
39
|
+
reminderPreview: (when: string) => string;
|
|
40
|
+
reminderPromptLabel: string;
|
|
41
|
+
reminderPromptPlaceholder: string;
|
|
42
|
+
reminderCreate: string;
|
|
43
|
+
reminderCancel: string;
|
|
44
|
+
reminderCreator: (creator: import("zidane/chat").ScheduleCreator) => string;
|
|
45
|
+
reminderNext: (when: string) => string;
|
|
46
|
+
reminderCountdown: (ms: number) => string;
|
|
47
|
+
reminderOnce: string;
|
|
48
|
+
reminderLastSent: (when: string) => string;
|
|
49
|
+
reminderDone: string;
|
|
50
|
+
reminderOff: string;
|
|
51
|
+
reminderOffReason: (reason: string) => string;
|
|
52
|
+
reminderExpires: (when: string) => string;
|
|
53
|
+
reminderTargetOther: string;
|
|
54
|
+
reminderTargetUntitled: string;
|
|
55
|
+
reminderTargetOpen: (title: string) => string;
|
|
56
|
+
reminderTargetNew: (folder: string) => string;
|
|
57
|
+
reminderTargetExtension: (extension: string) => string;
|
|
58
|
+
reminderPause: (label: string) => string;
|
|
59
|
+
reminderResume: (label: string) => string;
|
|
60
|
+
reminderRunNow: (label: string) => string;
|
|
61
|
+
reminderDelete: (label: string) => string;
|
|
62
|
+
reminderKeep: (label: string) => string;
|
|
63
|
+
reminderHistoryShow: (label: string) => string;
|
|
64
|
+
reminderHistoryHide: (label: string) => string;
|
|
65
|
+
reminderHistoryLabel: (label: string) => string;
|
|
66
|
+
reminderNoFires: string;
|
|
67
|
+
reminderFireOutcome: (outcome: import("zidane/chat").ScheduleFireOutcome) => string;
|
|
68
|
+
reminderFireLate: string;
|
|
16
69
|
shellClose: string;
|
|
17
70
|
artifactsLabel: string;
|
|
18
71
|
artifactsEmpty: string;
|
|
@@ -31,6 +84,24 @@ declare const DEFAULT_SESSION_LABELS: {
|
|
|
31
84
|
artifactShowDetails: string;
|
|
32
85
|
artifactHideDetails: string;
|
|
33
86
|
diffFiles: (files: number) => string;
|
|
87
|
+
secretsLabel: string;
|
|
88
|
+
secretsListLabel: string;
|
|
89
|
+
secretsEmpty: string;
|
|
90
|
+
secretsEmptyHint: string;
|
|
91
|
+
secretsNote: string;
|
|
92
|
+
secretExpiry: (left: SecretTimeLeft) => string;
|
|
93
|
+
secretSavedHere: string;
|
|
94
|
+
secretSavedElsewhere: string;
|
|
95
|
+
secretRevoke: (name: string) => string;
|
|
96
|
+
secretReplace: (name: string) => string;
|
|
97
|
+
secretsAdd: string;
|
|
98
|
+
secretNameLabel: string;
|
|
99
|
+
secretNamePlaceholder: string;
|
|
100
|
+
secretNameInvalid: string;
|
|
101
|
+
secretValueLabel: string;
|
|
102
|
+
secretReplacesSaved: (name: string) => string;
|
|
103
|
+
secretSave: string;
|
|
104
|
+
secretCancel: string;
|
|
34
105
|
queueEmpty: string;
|
|
35
106
|
queueEmptyHint: string;
|
|
36
107
|
queueCount: (count: number) => string;
|
|
@@ -118,6 +189,7 @@ declare const DEFAULT_SESSION_LABELS: {
|
|
|
118
189
|
projectHomeMoveDown: string;
|
|
119
190
|
projectHomeHide: string;
|
|
120
191
|
projectHomeRefresh: string;
|
|
192
|
+
projectHomeDismiss: string;
|
|
121
193
|
projectHomeCustomize: string;
|
|
122
194
|
projectHomeSwitch: string;
|
|
123
195
|
projectHomeDone: string;
|
|
@@ -219,25 +291,36 @@ declare const DEFAULT_SESSION_LABELS: {
|
|
|
219
291
|
todoTally: Record<TodoStatus, string>;
|
|
220
292
|
todosEmpty: string;
|
|
221
293
|
todosEmptyHint: string;
|
|
222
|
-
todosLastList: string;
|
|
223
294
|
todosProgress: (done: number, total: number) => string;
|
|
224
295
|
todoStatus: (status: TodoStatus) => string;
|
|
225
|
-
|
|
226
|
-
|
|
296
|
+
planUntitled: string;
|
|
297
|
+
planState: Record<PlanState, string>;
|
|
298
|
+
planNoSteps: string;
|
|
299
|
+
planShowBody: string;
|
|
300
|
+
planHideBody: string;
|
|
301
|
+
stepAgentNote: (note: string) => string;
|
|
302
|
+
planStopped: (step: number | null, reason: PlanStopReason | undefined) => string;
|
|
303
|
+
planMaybeInterrupted: string;
|
|
304
|
+
stepCancelledByYou: string;
|
|
305
|
+
stepDroppedByAgent: string;
|
|
306
|
+
stepAdded: string;
|
|
227
307
|
todoEdit: string;
|
|
228
308
|
todoRetry: string;
|
|
229
309
|
todoRetryHint: string;
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
todosSaveFailed: string;
|
|
310
|
+
stepCancel: string;
|
|
311
|
+
stepCancelHint: string;
|
|
233
312
|
todoAddPlaceholder: string;
|
|
234
313
|
todoAddLabel: string;
|
|
235
314
|
todoAdd: string;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
315
|
+
planStop: string;
|
|
316
|
+
planStopHint: string;
|
|
317
|
+
planResume: string;
|
|
318
|
+
planResumeHint: string;
|
|
319
|
+
planDrop: string;
|
|
320
|
+
planDropHint: string;
|
|
321
|
+
planDropConfirm: (applying: boolean) => "Drop this plan and stop the run?" | "Drop this plan?";
|
|
322
|
+
planDropYes: string;
|
|
323
|
+
planDropCancel: string;
|
|
241
324
|
sideEmptyTitle: string;
|
|
242
325
|
sideEmptyHint: string;
|
|
243
326
|
sidePlaceholder: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { REMINDER_LABELS } from "./reminder-labels.js";
|
|
1
2
|
//#region src/session/headless/labels.ts
|
|
2
3
|
const plural = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
|
|
3
4
|
/** A kind label in the plural, lower case (`pull request` → `pull requests`, `branch` → `branches`). */
|
|
@@ -37,6 +38,24 @@ const SESSION_SURFACE_LABELS = {
|
|
|
37
38
|
artifactShowDetails: "Show details",
|
|
38
39
|
artifactHideDetails: "Hide details",
|
|
39
40
|
diffFiles: (files) => files === 1 ? "1 file" : `${files} files`,
|
|
41
|
+
secretsLabel: "Secrets",
|
|
42
|
+
secretsListLabel: "Saved secrets",
|
|
43
|
+
secretsEmpty: "No secrets saved",
|
|
44
|
+
secretsEmptyHint: "When the agent asks for an API key or a token, it is saved here for this project. You can add one by hand too.",
|
|
45
|
+
secretsNote: "Saved for this project, out of the chat. Only the agent's commands can read them.",
|
|
46
|
+
secretExpiry: (left) => left.kind === "never" ? "Until revoked" : left.kind === "expired" ? "Expired" : `Expires in ${left.count} ${left.unit}${left.count === 1 ? "" : "s"}`,
|
|
47
|
+
secretSavedHere: "Saved in this session",
|
|
48
|
+
secretSavedElsewhere: "Saved in another session",
|
|
49
|
+
secretRevoke: (name) => `Revoke ${name}`,
|
|
50
|
+
secretReplace: (name) => `Replace ${name}`,
|
|
51
|
+
secretsAdd: "Add a secret",
|
|
52
|
+
secretNameLabel: "Name",
|
|
53
|
+
secretNamePlaceholder: "API_TOKEN",
|
|
54
|
+
secretNameInvalid: "Use capital letters, digits and _, starting with a letter.",
|
|
55
|
+
secretValueLabel: "Value",
|
|
56
|
+
secretReplacesSaved: (name) => `Replaces the saved ${name}.`,
|
|
57
|
+
secretSave: "Save securely",
|
|
58
|
+
secretCancel: "Cancel",
|
|
40
59
|
queueEmpty: "Nothing queued",
|
|
41
60
|
queueEmptyHint: "A message you send while the agent works waits here, then goes out when the run ends.",
|
|
42
61
|
queueCount: (count) => `${count} queued`,
|
|
@@ -134,6 +153,7 @@ const SESSION_SURFACE_LABELS = {
|
|
|
134
153
|
projectHomeMoveDown: "Move down",
|
|
135
154
|
projectHomeHide: "Hide block",
|
|
136
155
|
projectHomeRefresh: "Refresh",
|
|
156
|
+
projectHomeDismiss: "Dismiss",
|
|
137
157
|
projectHomeCustomize: "Customize",
|
|
138
158
|
projectHomeSwitch: "Switch project",
|
|
139
159
|
projectHomeDone: "Done",
|
|
@@ -250,6 +270,23 @@ const STATUS = {
|
|
|
250
270
|
completed: "completed",
|
|
251
271
|
cancelled: "cancelled"
|
|
252
272
|
};
|
|
273
|
+
const PLAN_STATE = {
|
|
274
|
+
proposed: "proposed",
|
|
275
|
+
applying: "in progress",
|
|
276
|
+
done: "done",
|
|
277
|
+
dropped: "dropped",
|
|
278
|
+
stopped: "stopped",
|
|
279
|
+
superseded: "replaced",
|
|
280
|
+
rejected: "rejected"
|
|
281
|
+
};
|
|
282
|
+
const STOP_REASON = {
|
|
283
|
+
run_ended: "the run ended",
|
|
284
|
+
aborted: "the run was stopped",
|
|
285
|
+
error: "the run failed",
|
|
286
|
+
interrupted: "interrupted",
|
|
287
|
+
user: "stopped by you",
|
|
288
|
+
migrated: "from an earlier version"
|
|
289
|
+
};
|
|
253
290
|
/** The default English strings of the session panels. Override any of them through `SessionProvider`. */
|
|
254
291
|
const DEFAULT_SESSION_LABELS = {
|
|
255
292
|
diffChangedFiles: "Changed files",
|
|
@@ -260,27 +297,38 @@ const DEFAULT_SESSION_LABELS = {
|
|
|
260
297
|
pending: "pending",
|
|
261
298
|
cancelled: "cancelled"
|
|
262
299
|
},
|
|
263
|
-
todosEmpty: "No
|
|
264
|
-
todosEmptyHint: "
|
|
265
|
-
todosLastList: "Last list",
|
|
300
|
+
todosEmpty: "No plan yet",
|
|
301
|
+
todosEmptyHint: "The agent lists its steps here when it works through a task.",
|
|
266
302
|
todosProgress: (done, total) => `${done}/${total} done`,
|
|
267
303
|
todoStatus: (status) => STATUS[status],
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
304
|
+
planUntitled: "Task list",
|
|
305
|
+
planState: PLAN_STATE,
|
|
306
|
+
planNoSteps: "No steps yet.",
|
|
307
|
+
planShowBody: "Show the plan",
|
|
308
|
+
planHideBody: "Hide the plan",
|
|
309
|
+
stepAgentNote: (note) => `Agent: ${note}`,
|
|
310
|
+
planStopped: (step, reason) => `Stopped${step ? ` at step ${step}` : ""}: ${reason ? STOP_REASON[reason] : "stopped"}.`,
|
|
311
|
+
planMaybeInterrupted: "May have been interrupted: no run is applying it now.",
|
|
312
|
+
stepCancelledByYou: "cancelled by you",
|
|
313
|
+
stepDroppedByAgent: "dropped by the agent",
|
|
314
|
+
stepAdded: "added",
|
|
315
|
+
todoEdit: "Rename step",
|
|
271
316
|
todoRetry: "Retry",
|
|
272
|
-
todoRetryHint: "Ask the agent to retry
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
todoAddLabel: "Add a todo",
|
|
317
|
+
todoRetryHint: "Ask the agent to retry this step",
|
|
318
|
+
stepCancel: "Cancel step",
|
|
319
|
+
stepCancelHint: "Cancel this step. The agent is told.",
|
|
320
|
+
todoAddPlaceholder: "Add a step…",
|
|
321
|
+
todoAddLabel: "Add a step",
|
|
278
322
|
todoAdd: "Add",
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
323
|
+
planStop: "Stop",
|
|
324
|
+
planStopHint: "Stop the plan and the run applying it",
|
|
325
|
+
planResume: "Resume",
|
|
326
|
+
planResumeHint: "Ask the agent to continue this plan",
|
|
327
|
+
planDrop: "Drop",
|
|
328
|
+
planDropHint: "Drop this plan",
|
|
329
|
+
planDropConfirm: (applying) => applying ? "Drop this plan and stop the run?" : "Drop this plan?",
|
|
330
|
+
planDropYes: "Yes, drop",
|
|
331
|
+
planDropCancel: "Cancel",
|
|
284
332
|
sideEmptyTitle: "Ask about this conversation",
|
|
285
333
|
sideEmptyHint: "The side chat sees the agent's work and never interrupts it.",
|
|
286
334
|
sidePlaceholder: "Ask on the side…",
|
|
@@ -288,7 +336,8 @@ const DEFAULT_SESSION_LABELS = {
|
|
|
288
336
|
sideResetDescription: "Clear this side chat and start over",
|
|
289
337
|
sideResetFailed: (reason) => `Couldn't reset this side chat: ${reason}`,
|
|
290
338
|
sideRefusal: (reason) => reason === "no-conversation" ? "Send a message first. A side chat follows a conversation." : reason === "unavailable" ? "Side chats work only on this computer's conversations" : "This window has no side panel for side chats",
|
|
291
|
-
...SESSION_SURFACE_LABELS
|
|
339
|
+
...SESSION_SURFACE_LABELS,
|
|
340
|
+
...REMINDER_LABELS
|
|
292
341
|
};
|
|
293
342
|
//#endregion
|
|
294
343
|
export { DEFAULT_SESSION_LABELS };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Readable } from "../../chat/headless/store.js";
|
|
2
|
+
import { PlansSnapshot as PlansSnapshot$1 } from "./host.js";
|
|
3
|
+
import { PlanView, TodoStatus } from "zidane/chat";
|
|
4
|
+
//#region src/session/headless/plans.d.ts
|
|
5
|
+
/** The plan snapshots of every session a host has seen. */
|
|
6
|
+
interface PlansState {
|
|
7
|
+
/** The session's snapshot store (`null` until known). */
|
|
8
|
+
snapshot(sessionId: string): Readable<PlansSnapshot$1 | null>;
|
|
9
|
+
/** Reads the session from the backend: one request per session at a time, never rejects. */
|
|
10
|
+
refresh(sessionId: string): Promise<void>;
|
|
11
|
+
/** A snapshot the backend pushed (or answered to an edit). */
|
|
12
|
+
push(sessionId: string, snapshot: PlansSnapshot$1): void;
|
|
13
|
+
/** Forgets a deleted session. */
|
|
14
|
+
forget(sessionId: string): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a {@link PlansState}.
|
|
18
|
+
*
|
|
19
|
+
* @param read - Reads one session's snapshot from the backend (`null`: unknown session).
|
|
20
|
+
*/
|
|
21
|
+
declare function createPlansState(read: (sessionId: string) => Promise<PlansSnapshot$1 | null>): PlansState;
|
|
22
|
+
/**
|
|
23
|
+
* The plan a session shows: the session scope's applying plan, else its most
|
|
24
|
+
* recent stopped one, else the last that closed (read-only). Never a
|
|
25
|
+
* proposal: the Inbox shows those. Sub-agent plans are not shown here.
|
|
26
|
+
*
|
|
27
|
+
* @param plans - The snapshot's plans, oldest first.
|
|
28
|
+
*/
|
|
29
|
+
declare function displayedPlan(plans: readonly PlanView[]): PlanView | null;
|
|
30
|
+
/** A session's plans as the Inbox shows them. */
|
|
31
|
+
interface InboxPlans {
|
|
32
|
+
/** The plan in progress: the applying one, else the last stopped one (it can resume). */
|
|
33
|
+
current: PlanView | null;
|
|
34
|
+
/** Closed plans (and any other stopped one), newest first. Proposals are never here: they wait under "Needs you". */
|
|
35
|
+
recent: readonly PlanView[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Splits a session's plans into the Inbox's "In progress" and "Recent". Session scope only: sub-agent plans close with
|
|
39
|
+
* their run and are not listed.
|
|
40
|
+
*
|
|
41
|
+
* @param plans - The snapshot's plans, oldest first.
|
|
42
|
+
*/
|
|
43
|
+
declare function inboxPlans(plans: readonly PlanView[]): InboxPlans;
|
|
44
|
+
/** Steps per status. */
|
|
45
|
+
type TodoTallyCounts = Readonly<Record<TodoStatus, number>>;
|
|
46
|
+
/**
|
|
47
|
+
* A plan's steps per status, as the tally chips show them.
|
|
48
|
+
*
|
|
49
|
+
* @param plan - The plan.
|
|
50
|
+
*/
|
|
51
|
+
declare function planTally(plan: Pick<PlanView, 'steps'>): TodoTallyCounts;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { InboxPlans, PlansState, TodoTallyCounts, createPlansState, displayedPlan, inboxPlans, planTally };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createKeyedState } from "./keyed.js";
|
|
2
|
+
import { SESSION_SCOPE, planProgress } from "zidane/chat/pure";
|
|
3
|
+
//#region src/session/headless/plans.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a {@link PlansState}.
|
|
6
|
+
*
|
|
7
|
+
* @param read - Reads one session's snapshot from the backend (`null`: unknown session).
|
|
8
|
+
*/
|
|
9
|
+
function createPlansState(read) {
|
|
10
|
+
const state = createKeyedState(null);
|
|
11
|
+
const pushes = /* @__PURE__ */ new Map();
|
|
12
|
+
const inflight = /* @__PURE__ */ new Map();
|
|
13
|
+
return {
|
|
14
|
+
snapshot: (sessionId) => state.readable(sessionId),
|
|
15
|
+
refresh(sessionId) {
|
|
16
|
+
const running = inflight.get(sessionId);
|
|
17
|
+
if (running) return running;
|
|
18
|
+
const seenPushes = pushes.get(sessionId) ?? 0;
|
|
19
|
+
const p = read(sessionId).then((snap) => {
|
|
20
|
+
if (!snap || (pushes.get(sessionId) ?? 0) !== seenPushes) return;
|
|
21
|
+
state.set(sessionId, snap);
|
|
22
|
+
}).catch(() => void 0).finally(() => {
|
|
23
|
+
inflight.delete(sessionId);
|
|
24
|
+
});
|
|
25
|
+
inflight.set(sessionId, p);
|
|
26
|
+
return p;
|
|
27
|
+
},
|
|
28
|
+
push(sessionId, snapshot) {
|
|
29
|
+
pushes.set(sessionId, (pushes.get(sessionId) ?? 0) + 1);
|
|
30
|
+
state.set(sessionId, snapshot);
|
|
31
|
+
},
|
|
32
|
+
forget(sessionId) {
|
|
33
|
+
pushes.delete(sessionId);
|
|
34
|
+
state.delete(sessionId);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The plan a session shows: the session scope's applying plan, else its most
|
|
40
|
+
* recent stopped one, else the last that closed (read-only). Never a
|
|
41
|
+
* proposal: the Inbox shows those. Sub-agent plans are not shown here.
|
|
42
|
+
*
|
|
43
|
+
* @param plans - The snapshot's plans, oldest first.
|
|
44
|
+
*/
|
|
45
|
+
function displayedPlan(plans) {
|
|
46
|
+
const top = plans.filter((p) => p.scope === SESSION_SCOPE && p.state !== "proposed");
|
|
47
|
+
return top.find((p) => p.state === "applying") ?? [...top].reverse().find((p) => p.state === "stopped") ?? top.at(-1) ?? null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Splits a session's plans into the Inbox's "In progress" and "Recent". Session scope only: sub-agent plans close with
|
|
51
|
+
* their run and are not listed.
|
|
52
|
+
*
|
|
53
|
+
* @param plans - The snapshot's plans, oldest first.
|
|
54
|
+
*/
|
|
55
|
+
function inboxPlans(plans) {
|
|
56
|
+
const top = plans.filter((p) => p.scope === SESSION_SCOPE && p.state !== "proposed");
|
|
57
|
+
const current = top.find((p) => p.state === "applying") ?? [...top].reverse().find((p) => p.state === "stopped") ?? null;
|
|
58
|
+
return {
|
|
59
|
+
current,
|
|
60
|
+
recent: top.filter((p) => p !== current && p.state !== "applying").sort((a, b) => (b.closedAt ?? b.updatedAt) - (a.closedAt ?? a.updatedAt))
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A plan's steps per status, as the tally chips show them.
|
|
65
|
+
*
|
|
66
|
+
* @param plan - The plan.
|
|
67
|
+
*/
|
|
68
|
+
function planTally(plan) {
|
|
69
|
+
const p = planProgress(plan);
|
|
70
|
+
return {
|
|
71
|
+
pending: p.pending,
|
|
72
|
+
in_progress: p.inProgress,
|
|
73
|
+
completed: p.completed,
|
|
74
|
+
cancelled: p.cancelled
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { createPlansState, displayedPlan, inboxPlans, planTally };
|