@kortix/ui 0.15.0 → 0.15.2
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/_vendor/kortix-shared.js +233 -130
- package/dist/_vendor/shared/code-language.d.ts +2 -2
- package/dist/_vendor/shared/html.d.ts +7 -0
- package/dist/_vendor/shared/index.d.ts +1 -2
- package/dist/_vendor/shared/pixel-mark.d.ts +28 -0
- package/dist/_vendor/shared/runtime-versions.d.ts +2 -6
- package/dist/_vendor/shared/tool-output/media-path.d.ts +1 -6
- package/dist/_vendor/shared/tool-output/scan.d.ts +2 -0
- package/dist/_vendor/shared/utils/string.d.ts +6 -0
- package/dist/artifacts/artifact-frame.d.ts +0 -1
- package/dist/artifacts/artifact-frame.js +4 -10
- package/dist/artifacts/artifact-session.js +4 -7
- package/dist/artifacts/frame-policy.d.ts +1 -1
- package/dist/artifacts/frame-policy.js +2 -2
- package/dist/customize/agents/agent-page.js +5 -5
- package/dist/customize/agents/agent-status.js +1 -1
- package/dist/customize/agents/agents-page.js +3 -3
- package/dist/customize/connectors/use-agent-access.d.ts +3 -3
- package/dist/customize/sections/connectors-view.js +50 -37
- package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +21 -18
- package/dist/customize/sections/llm-provider/device-grant.d.ts +15 -0
- package/dist/customize/sections/llm-provider/device-grant.js +27 -0
- package/dist/customize/sections/view/agent-editor-catalog.js +0 -5
- package/dist/customize/sections/view/agent-editor.d.ts +2 -2
- package/dist/customize/sections/view/agent-editor.js +2 -2
- package/dist/customize/sections/view/review-center-connected.js +37 -6
- package/dist/customize/sections/view/secret-delivery.d.ts +4 -5
- package/dist/customize/sections/view/secret-delivery.js +5 -4
- package/dist/customize/triggers/schedule/trigger-list.d.ts +2 -2
- package/dist/customize/triggers/schedule/trigger-list.js +12 -18
- package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +6 -0
- package/dist/customize/triggers/schedule/trigger-runs-logic.js +13 -0
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +9 -2
- package/dist/files/project/api/runtime-files.d.ts +2 -2
- package/dist/files/project/api/runtime-files.js +2 -2
- package/dist/files/project/components/drive-explorer.js +1 -1
- package/dist/files/project/components/drive-grid-view.js +0 -1
- package/dist/files/project/components/drive-list-view.js +0 -1
- package/dist/files/project/components/file-explorer-page.js +1 -1
- package/dist/files/project/hooks/index.d.ts +1 -1
- package/dist/files/project/hooks/index.js +1 -1
- package/dist/files/project/hooks/use-server-health.d.ts +1 -1
- package/dist/files/project/hooks/use-server-health.js +1 -1
- package/dist/files/project/search/workspace-search-service.d.ts +1 -1
- package/dist/files/project/search/workspace-search-service.js +1 -1
- package/dist/files/runtime/hooks/index.d.ts +1 -1
- package/dist/files/runtime/hooks/index.js +1 -1
- package/dist/files/runtime/hooks/server-health-state.d.ts +2 -2
- package/dist/files/runtime/hooks/server-health-state.js +2 -2
- package/dist/files/runtime/hooks/system-dir.js +2 -2
- package/dist/files/runtime/hooks/use-file-content.d.ts +1 -1
- package/dist/files/runtime/hooks/use-file-content.js +1 -1
- package/dist/files/runtime/hooks/use-file-list.d.ts +1 -1
- package/dist/files/runtime/hooks/use-file-list.js +3 -3
- package/dist/files/runtime/hooks/use-server-health.d.ts +2 -2
- package/dist/files/runtime/hooks/use-server-health.js +3 -3
- package/dist/files/runtime/hooks/use-workspace-search.d.ts +1 -2
- package/dist/files/runtime/hooks/use-workspace-search.js +0 -1
- package/dist/files/runtime/index.d.ts +2 -2
- package/dist/files/runtime/index.js +2 -2
- package/dist/files/runtime/path-utils.d.ts +1 -1
- package/dist/files/runtime/path-utils.js +1 -1
- package/dist/files/runtime/sandbox-explorer-source.d.ts +1 -1
- package/dist/files/runtime/sandbox-explorer-source.js +1 -1
- package/dist/files/runtime/sandbox-file-explorer.d.ts +1 -1
- package/dist/files/runtime/sandbox-file-explorer.js +2 -2
- package/dist/files/tree/components/file-tree-item.js +0 -1
- package/dist/files/tree/hooks/use-file-events.d.ts +1 -1
- package/dist/files/tree/hooks/use-file-events.js +1 -1
- package/dist/i18n/en.d.ts +60 -175
- package/dist/i18n/en.js +71 -186
- package/dist/internal/components/agent-mark.js +6 -0
- package/dist/internal/components/clickable-path.d.ts +3 -0
- package/dist/internal/components/clickable-path.js +4 -1
- package/dist/internal/files/file-read-retry.js +1 -1
- package/dist/internal/files/types.d.ts +2 -2
- package/dist/internal/files/types.js +2 -2
- package/dist/internal/goals/goal-meta.d.ts +33 -14
- package/dist/internal/goals/goal-meta.js +55 -13
- package/dist/internal/layout/nav-hover-card.d.ts +1 -1
- package/dist/internal/layout/nav-hover-card.js +1 -1
- package/dist/internal/layout/project-capability-nav.d.ts +1 -1
- package/dist/internal/layout/project-capability-nav.js +1 -1
- package/dist/internal/lib/browser-error-noise.d.ts +1 -1
- package/dist/internal/lib/browser-error-noise.js +1 -1
- package/dist/internal/lib/browser-noise/rules/expected-states.js +1 -1
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +29 -0
- package/dist/internal/lib/browser-noise/rules/old-browsers.d.ts +1 -0
- package/dist/internal/lib/browser-noise/rules/old-browsers.js +1 -1
- package/dist/internal/lib/browser-noise/rules/rejections.d.ts +0 -9
- package/dist/internal/lib/browser-noise/rules/rejections.js +0 -14
- package/dist/internal/lib/delivered-but-disconnected.js +3 -5
- package/dist/internal/lib/error-handler.js +8 -3
- package/dist/internal/lib/pixel-mark.d.ts +4 -17
- package/dist/internal/lib/pixel-mark.js +5 -148
- package/dist/internal/lib/sounds.d.ts +4 -4
- package/dist/internal/lib/sounds.js +4 -4
- package/dist/internal/lib/trigger-clock.d.ts +5 -0
- package/dist/internal/lib/trigger-clock.js +15 -0
- package/dist/internal/lib/turn-broadcast.d.ts +0 -3
- package/dist/internal/lib/use-project-feature-flags.d.ts +2 -0
- package/dist/internal/lib/use-project-feature-flags.js +5 -5
- package/dist/internal/lib/web-notifications.d.ts +1 -8
- package/dist/internal/lib/web-notifications.js +12 -53
- package/dist/internal/notifications/notification-bell.d.ts +13 -33
- package/dist/internal/notifications/notification-bell.js +14 -117
- package/dist/internal/notifications/notification-inbox.d.ts +45 -0
- package/dist/internal/notifications/notification-inbox.js +119 -0
- package/dist/internal/notifications/notification-rows.d.ts +3 -4
- package/dist/internal/notifications/notification-rows.js +1 -4
- package/dist/internal/notifications/use-inbox-summary.d.ts +13 -0
- package/dist/internal/notifications/use-inbox-summary.js +22 -0
- package/dist/internal/notifications/web-push.d.ts +9 -10
- package/dist/internal/notifications/web-push.js +9 -10
- package/dist/internal/stores/composer-prefill-store.js +4 -1
- package/dist/internal/stores/sound-store.d.ts +4 -4
- package/dist/internal/stores/sound-store.js +10 -0
- package/dist/internal/stores/web-notification-store.d.ts +6 -9
- package/dist/internal/stores/web-notification-store.js +0 -4
- package/dist/lib/routes.d.ts +8 -0
- package/dist/lib/routes.js +4 -1
- package/dist/markdown/code/shiki-highlighter.js +14 -5
- package/dist/markdown/doc-editor/doc-menus.d.ts +1 -10
- package/dist/markdown/doc-editor/doc-menus.js +6 -69
- package/dist/markdown/file-links.js +33 -3
- package/dist/markdown/markdown-frontmatter.d.ts +6 -6
- package/dist/markdown/markdown-frontmatter.js +3 -3
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.js +2 -1
- package/dist/session/agents/held-messages.d.ts +1 -5
- package/dist/session/agents/held-messages.js +1 -21
- package/dist/session/composer/ComposerAboveCard.d.ts +4 -1
- package/dist/session/composer/ComposerAboveCard.js +2 -2
- package/dist/session/composer/composer-chat-input.d.ts +1 -1
- package/dist/session/composer/composer-chat-input.js +2 -2
- package/dist/session/composer/composer.js +16 -1
- package/dist/session/composer/hooks/use-file-search.d.ts +15 -15
- package/dist/session/composer/hooks/use-file-search.js +16 -16
- package/dist/session/composer/menus/mention-controller.js +1 -3
- package/dist/session/composer/menus/space-mentions.d.ts +14 -4
- package/dist/session/composer/menus/space-mentions.js +17 -1
- package/dist/session/composer/use-instant-session-send.js +2 -2
- package/dist/session/header/reminder-parts.d.ts +1 -1
- package/dist/session/header/session-goal-indicator.js +4 -4
- package/dist/session/header/session-site-header.js +2 -6
- package/dist/session/panel/easy/plan-card.d.ts +2 -2
- package/dist/session/panel/easy/plan-card.js +2 -2
- package/dist/session/panel/session-desktop.js +6 -0
- package/dist/session/panel/session-reminders-panel.js +4 -15
- package/dist/session/panel/use-session-panel-state.js +2 -2
- package/dist/session/status/sandbox-loading-boundary.js +2 -2
- package/dist/session/status/session-terminal-state.d.ts +47 -0
- package/dist/session/status/session-terminal-state.js +56 -0
- package/dist/session/thread/plan-surface.d.ts +1 -1
- package/dist/session/thread/plan-surface.js +1 -1
- package/dist/session/thread/session-chat.d.ts +1 -1
- package/dist/session/thread/session-chat.js +88 -99
- package/dist/session/thread/stop-sequence.d.ts +51 -0
- package/dist/session/thread/stop-sequence.js +55 -0
- package/dist/session/thread/transcript.d.ts +2 -2
- package/dist/session/thread/transcript.js +2 -2
- package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -1
- package/dist/session/tool/tools/apply-patch-tool.js +1 -1
- package/dist/session/tool/tools/kortix-action-tool.js +1 -1
- package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +1 -1
- package/dist/session/tool/tools/multi-agent-tool-bodies.js +1 -1
- package/dist/session/tool/tools/multi-agent-tools.js +1 -1
- package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -1
- package/dist/session/tool/tools/pty-kill-tool.js +1 -1
- package/dist/session/tool/tools/pty-read-tool.d.ts +2 -2
- package/dist/session/tool/tools/pty-read-tool.js +2 -2
- package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -1
- package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
- package/dist/session/tool/tools/pty-write-tool.d.ts +1 -1
- package/dist/session/tool/tools/pty-write-tool.js +1 -1
- package/dist/session/tool/tools/session-spawn-tool.js +7 -4
- package/dist/session/tool/tools/task-tool.js +18 -4
- package/dist/session/tool/tools/todo-write-tool.d.ts +1 -1
- package/dist/session/tool/tools/todo-write-tool.js +1 -1
- package/dist/session/turn/peer-message-row.d.ts +1 -10
- package/dist/session/turn/peer-message-row.js +1 -18
- package/dist/session/turn/plan-anchor.d.ts +3 -3
- package/dist/session/turn/plan-anchor.js +3 -3
- package/dist/session/turn/plan-card.d.ts +7 -7
- package/dist/session/turn/plan-card.js +7 -7
- package/dist/styles.css +1 -1
- package/dist/terminal/terminal-card-gate.d.ts +6 -3
- package/dist/terminal/terminal-card-gate.js +21 -4
- package/dist/workspace/home/access-requests-bell.d.ts +6 -9
- package/dist/workspace/home/access-requests-bell.js +8 -10
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/layout/project-home.js +1 -2
- package/dist/workspace/review/review-center.d.ts +8 -2
- package/dist/workspace/review/review-center.js +44 -13
- package/dist/workspace/review/review-reducer.d.ts +7 -0
- package/dist/workspace/review/review-reducer.js +11 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -1
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +47 -4
- package/dist/workspace/sidebar/project-nav-items.js +11 -12
- package/dist/workspace/sidebar/project-sidebar.js +2 -6
- package/dist/workspace/spaces/principal-card.d.ts +3 -1
- package/dist/workspace/spaces/principal-card.js +3 -3
- package/dist/workspace/spaces/space-agent-ask.d.ts +14 -0
- package/dist/workspace/spaces/space-agent-ask.js +36 -0
- package/dist/workspace/spaces/space-details-dialog.js +1 -1
- package/dist/workspace/spaces/space-details-panel.d.ts +2 -1
- package/dist/workspace/spaces/space-details-panel.js +62 -8
- package/dist/workspace/spaces/space-mention-source.d.ts +3 -2
- package/dist/workspace/spaces/space-mention-source.js +12 -19
- package/dist/workspace/spaces/space-view.js +3 -2
- package/package.json +11 -7
- package/skills/kortix-ui/references/custom-dashboard.md +1 -1
- package/skills/kortix-ui/references/modules.md +1 -1
- package/dist/_vendor/shared/artifact-annotations.d.ts +0 -311
- package/dist/_vendor/shared/artifact-comments.d.ts +0 -155
- package/dist/internal/hooks/use-notification-center.d.ts +0 -50
- package/dist/internal/hooks/use-notification-center.js +0 -151
- package/dist/session/tool/tools/multi-agent-tool-data.d.ts +0 -63
- package/dist/session/tool/tools/multi-agent-tool-data.js +0 -118
|
@@ -29,6 +29,7 @@ import { mapApiReviewItem } from '../../../workspace/review/map.js';
|
|
|
29
29
|
import { connectorCallId, crChangeRequestId, isApprovalExpiredError, itemDeepLink, } from '../../../workspace/review/review-actions.js';
|
|
30
30
|
import { AskDeck } from '../../../session/prompts/ask-deck.js';
|
|
31
31
|
import { ReviewCenter } from '../../../workspace/review/review-center.js';
|
|
32
|
+
import { REVIEW_VERDICT_ANNOUNCED } from '../../../workspace/review/review-reducer.js';
|
|
32
33
|
/**
|
|
33
34
|
* How many session deep links the inbox warms up front. A page holds up to 50
|
|
34
35
|
* items, and each prefetch is a real dynamic RSC render. Eight covers the rows
|
|
@@ -137,15 +138,28 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
137
138
|
conflicts,
|
|
138
139
|
}, closeCustomize);
|
|
139
140
|
}
|
|
141
|
+
// Each branch resolves when the server accepted the verdict and rejects when
|
|
142
|
+
// it refused, so the inbox can roll its optimistic status back. A branch
|
|
143
|
+
// that shows its own success toast resolves `REVIEW_VERDICT_ANNOUNCED`.
|
|
140
144
|
function handleAct(id, verdict, feedback) {
|
|
145
|
+
return new Promise((settle, refuse) => {
|
|
146
|
+
actOnItem(id, verdict, feedback, () => settle(REVIEW_VERDICT_ANNOUNCED), () => settle(undefined), refuse);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function actOnItem(id, verdict, feedback, announced, accepted, refused) {
|
|
141
150
|
// The shared parameter-review component calls this for one exact action.
|
|
142
151
|
const executionId = connectorCallId(id);
|
|
143
152
|
if (executionId) {
|
|
144
153
|
resolve.mutate({ executionId, decision: verdict === 'approve' ? 'approve' : 'deny', note: feedback }, {
|
|
145
|
-
onSuccess: () =>
|
|
146
|
-
|
|
147
|
-
|
|
154
|
+
onSuccess: () => {
|
|
155
|
+
if (verdict === 'approve')
|
|
156
|
+
successToast(tI18nComplete.raw('text2b2b0a697042'));
|
|
157
|
+
else
|
|
158
|
+
infoToast(tI18nComplete.raw('textda404deb110f'));
|
|
159
|
+
announced();
|
|
160
|
+
},
|
|
148
161
|
onError: (e) => {
|
|
162
|
+
refused(e);
|
|
149
163
|
if (!isApprovalExpiredError(e))
|
|
150
164
|
return errorToast(e.message);
|
|
151
165
|
errorToast(tHardcodedUi('approvalPage.expiredHint'));
|
|
@@ -163,8 +177,10 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
163
177
|
onSuccess: () => {
|
|
164
178
|
successToast(tI18nComplete.raw('text0cad31cba248'));
|
|
165
179
|
refreshInbox();
|
|
180
|
+
announced();
|
|
166
181
|
},
|
|
167
182
|
onError: (e) => {
|
|
183
|
+
refused(e);
|
|
168
184
|
if (e.code === 'MERGE_CONFLICT') {
|
|
169
185
|
const item = items.find((candidate) => candidate.id === id);
|
|
170
186
|
const conflicts = e.data?.conflicts ?? [];
|
|
@@ -192,8 +208,12 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
192
208
|
onSuccess: () => {
|
|
193
209
|
infoToast(tI18nComplete.raw('text67382c89fdde'));
|
|
194
210
|
refreshInbox();
|
|
211
|
+
announced();
|
|
212
|
+
},
|
|
213
|
+
onError: (e) => {
|
|
214
|
+
refused(e);
|
|
215
|
+
errorToast(e.message);
|
|
195
216
|
},
|
|
196
|
-
onError: (e) => errorToast(e.message),
|
|
197
217
|
});
|
|
198
218
|
}
|
|
199
219
|
else {
|
|
@@ -203,6 +223,7 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
203
223
|
const note = (feedback ?? '').trim();
|
|
204
224
|
if (!note) {
|
|
205
225
|
infoToast(tI18nComplete.raw('text8918eace1b87'));
|
|
226
|
+
refused(new Error('A change request needs a note.'));
|
|
206
227
|
return;
|
|
207
228
|
}
|
|
208
229
|
requestChanges.mutate({ crId, feedback: note }, {
|
|
@@ -211,13 +232,23 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
211
232
|
? tI18nComplete.raw('text99764404a562')
|
|
212
233
|
: tI18nComplete.raw('text871f77182091'));
|
|
213
234
|
refreshInbox();
|
|
235
|
+
announced();
|
|
236
|
+
},
|
|
237
|
+
onError: (e) => {
|
|
238
|
+
refused(e);
|
|
239
|
+
errorToast(e.message);
|
|
214
240
|
},
|
|
215
|
-
onError: (e) => errorToast(e.message),
|
|
216
241
|
});
|
|
217
242
|
}
|
|
218
243
|
return;
|
|
219
244
|
}
|
|
220
|
-
act.mutate({ id, verdict, feedback }, {
|
|
245
|
+
act.mutate({ id, verdict, feedback }, {
|
|
246
|
+
onSuccess: accepted,
|
|
247
|
+
onError: (e) => {
|
|
248
|
+
refused(e);
|
|
249
|
+
errorToast(e.message);
|
|
250
|
+
},
|
|
251
|
+
});
|
|
221
252
|
}
|
|
222
253
|
// Bulk verdicts send every id the inbox chose: native, and `call:` for
|
|
223
254
|
// Approve and Deny. The server decides each one and answers one result per
|
|
@@ -250,8 +250,6 @@ export declare function missingAgentGrantNotice(identifier: string, tI18nComplet
|
|
|
250
250
|
export type AgentGrantConfig = {
|
|
251
251
|
agent_discovery?: string | null;
|
|
252
252
|
default_agent?: string | null;
|
|
253
|
-
/** @deprecated Server alias for `default_agent`. */
|
|
254
|
-
open_code_default_agent?: string | null;
|
|
255
253
|
agents?: readonly {
|
|
256
254
|
name: string;
|
|
257
255
|
scope?: {
|
|
@@ -285,9 +283,10 @@ export type AgentGrantPlan = {
|
|
|
285
283
|
*
|
|
286
284
|
* `agent_discovery` is the server's own verdict on whether the manifest
|
|
287
285
|
* declares any agent (apps/api/src/projects/git/config.ts `resolveConfigAgents`)
|
|
288
|
-
* — `declarative` means it does
|
|
289
|
-
*
|
|
290
|
-
* guesses: a missed confirmation silently revokes working
|
|
286
|
+
* — `declarative` means it does. Anything else (`null` in a response filtered
|
|
287
|
+
* by the caller's access) is a config we cannot read, and an unread config
|
|
288
|
+
* confirms rather than guesses: a missed confirmation silently revokes working
|
|
289
|
+
* runtime secrets.
|
|
291
290
|
*/
|
|
292
291
|
export declare function agentGrantPlan(config: AgentGrantConfig | null | undefined, identifier: string): AgentGrantPlan;
|
|
293
292
|
/**
|
|
@@ -425,9 +425,10 @@ function admitsIdentifier(list, identifier) {
|
|
|
425
425
|
*
|
|
426
426
|
* `agent_discovery` is the server's own verdict on whether the manifest
|
|
427
427
|
* declares any agent (apps/api/src/projects/git/config.ts `resolveConfigAgents`)
|
|
428
|
-
* — `declarative` means it does
|
|
429
|
-
*
|
|
430
|
-
* guesses: a missed confirmation silently revokes working
|
|
428
|
+
* — `declarative` means it does. Anything else (`null` in a response filtered
|
|
429
|
+
* by the caller's access) is a config we cannot read, and an unread config
|
|
430
|
+
* confirms rather than guesses: a missed confirmation silently revokes working
|
|
431
|
+
* runtime secrets.
|
|
431
432
|
*/
|
|
432
433
|
export function agentGrantPlan(config, identifier) {
|
|
433
434
|
const declared = [];
|
|
@@ -442,7 +443,7 @@ export function agentGrantPlan(config, identifier) {
|
|
|
442
443
|
currentSecrets: env === 'all' ? 'all' : Array.isArray(env) ? env : null,
|
|
443
444
|
});
|
|
444
445
|
}
|
|
445
|
-
const defaultAgent = (config?.default_agent ??
|
|
446
|
+
const defaultAgent = (config?.default_agent ?? '').trim();
|
|
446
447
|
// A project can carry a default agent that no manifest entry declares — the
|
|
447
448
|
// endpoint upserts the entry, so it is still a valid target.
|
|
448
449
|
const candidates = declared.length > 0 || !defaultAgent
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { UiTranslator } from '../../../i18n/index.js';
|
|
2
2
|
import type { ProjectTrigger } from '@kortix/sdk';
|
|
3
3
|
import { type ReactNode } from 'react';
|
|
4
|
-
/** "next
|
|
5
|
-
export declare function nextRunLabel(trigger: Pick<ProjectTrigger, 'type' | 'enabled' | 'next_fire_at' | 'next_cron_at' | 'auto_paused_at'>, t: UiTranslator, locale: string, now
|
|
4
|
+
/** "next in 5 minutes", "next in 3 hours", "next in 2 days"; "On event" for webhooks and app events; "Paused" while paused. */
|
|
5
|
+
export declare function nextRunLabel(trigger: Pick<ProjectTrigger, 'type' | 'enabled' | 'next_fire_at' | 'next_cron_at' | 'auto_paused_at'>, t: UiTranslator, locale: string, now: number): string;
|
|
6
6
|
export declare function TriggerList({ triggers, groups, eventNames, selectedSlug, runningSlug, onOpen, selection, projectPaused, }: {
|
|
7
7
|
triggers: ProjectTrigger[];
|
|
8
8
|
/** The trigger whose Run now is in flight: its row shows the session busy mark. */
|
|
@@ -9,35 +9,29 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
9
9
|
import { Checkbox } from '../../../primitives/checkbox.js';
|
|
10
10
|
import { SessionDotMatrix } from '../../../primitives/dot-matrix/session-dot-matrix.js';
|
|
11
11
|
import { useLocale, useTranslations } from '../../../i18n/index.js';
|
|
12
|
-
import { lastRunLabel } from '../../../internal/lib/trigger-clock.js';
|
|
12
|
+
import { lastRunLabel, nextRunIn } from '../../../internal/lib/trigger-clock.js';
|
|
13
|
+
import { useNow } from '../../../internal/reminders/use-refetch-after-fire.js';
|
|
13
14
|
import { cn } from '../../../internal/lib/utils.js';
|
|
14
15
|
import { Fragment } from 'react';
|
|
15
16
|
import { describeNextRun, describeWhen, triggerName, triggerSubtitle } from './schedule-copy.js';
|
|
16
17
|
import { TriggerTile } from './trigger-tile.js';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export function nextRunLabel(trigger, t, locale, now = Date.now()) {
|
|
18
|
+
/** "next in 5 minutes", "next in 3 hours", "next in 2 days"; "On event" for webhooks and app events; "Paused" while paused. */
|
|
19
|
+
export function nextRunLabel(trigger, t, locale, now) {
|
|
20
20
|
// An auto-pause (KRTX-1721) is runtime state: the manifest still says enabled.
|
|
21
21
|
if (!trigger.enabled || trigger.auto_paused_at)
|
|
22
22
|
return t.raw('texte159b06187d3');
|
|
23
23
|
if (trigger.type !== 'cron')
|
|
24
24
|
return t.raw('text84b05fbb7f76');
|
|
25
25
|
const iso = trigger.next_cron_at ?? trigger.next_fire_at;
|
|
26
|
-
|
|
27
|
-
if (!Number.isFinite(at))
|
|
26
|
+
if (!iso || Number.isNaN(Date.parse(iso)))
|
|
28
27
|
return '—';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const today = new Date(now).toDateString() === date.toDateString();
|
|
32
|
-
const day = today
|
|
33
|
-
? null
|
|
34
|
-
: at - now < 6 * DAY
|
|
35
|
-
? date.toLocaleDateString(locale, { weekday: 'short' })
|
|
36
|
-
: date.toLocaleDateString(locale, { month: 'short', day: 'numeric' });
|
|
37
|
-
return t('text27a2c8b3a0d2', { value0: day ? `${day} ${time}` : time });
|
|
28
|
+
// `always`: "in 1 day", never "tomorrow", so the label always reads "next in <n> <unit>".
|
|
29
|
+
return t('text27a2c8b3a0d2', { value0: nextRunIn(iso, new Intl.RelativeTimeFormat(locale, { numeric: 'always' }), now) });
|
|
38
30
|
}
|
|
39
31
|
export function TriggerList({ triggers, groups, eventNames, selectedSlug, runningSlug = null, onOpen, selection = null, projectPaused = false, }) {
|
|
40
|
-
|
|
32
|
+
// A 30 s tick: the list's poll keeps unchanged data, so nothing else re-renders the countdown.
|
|
33
|
+
const now = useNow();
|
|
34
|
+
const row = (trigger) => (_jsx(TriggerRow, { trigger: trigger, now: now, eventNames: eventNames, selected: !selection && trigger.slug === selectedSlug, running: trigger.slug === runningSlug, onOpen: () => onOpen(trigger), checked: selection ? selection.selected.has(trigger.slug) : null, projectPaused: projectPaused, onToggle: (range) => selection?.onToggle(trigger, range) }, trigger.slug));
|
|
41
35
|
return (
|
|
42
36
|
// A resting panel (`bg-card`, border, `rounded-lg`), so the rows sit on a
|
|
43
37
|
// surface in both themes; hover is one step up, the open row one more.
|
|
@@ -45,7 +39,7 @@ export function TriggerList({ triggers, groups, eventNames, selectedSlug, runnin
|
|
|
45
39
|
? groups.map((group) => (_jsxs(Fragment, { children: [_jsx("li", { role: selection ? 'presentation' : undefined, className: "px-3 pt-3.5 pb-1.5", children: group.heading }), group.triggers.map(row)] }, group.key)))
|
|
46
40
|
: triggers.map(row) }));
|
|
47
41
|
}
|
|
48
|
-
function TriggerRow({ trigger, eventNames, selected, running, onOpen, checked, onToggle, projectPaused, }) {
|
|
42
|
+
function TriggerRow({ trigger, now, eventNames, selected, running, onOpen, checked, onToggle, projectPaused, }) {
|
|
49
43
|
const t = useTranslations('hardcodedUi.i18nComplete');
|
|
50
44
|
const locale = useLocale();
|
|
51
45
|
const name = triggerName(trigger);
|
|
@@ -57,7 +51,7 @@ function TriggerRow({ trigger, eventNames, selected, running, onOpen, checked, o
|
|
|
57
51
|
'bg-(--row-surface) [--row-surface:var(--card)]', selected || checked
|
|
58
52
|
? '[--row-surface:var(--muted)]'
|
|
59
53
|
: 'hover:[--row-surface:color-mix(in_oklab,var(--muted)_60%,var(--card))] focus-visible:[--row-surface:color-mix(in_oklab,var(--muted)_60%,var(--card))]');
|
|
60
|
-
const cells = (_jsxs(_Fragment, { children: [_jsx("span", { className: "flex size-5 shrink-0 items-center justify-center", children: selecting ? (_jsx(Checkbox, { checked: checked, tabIndex: -1, "aria-hidden": true, className: "pointer-events-none" })) : (_jsx(TriggerTile, { trigger: trigger, projectPaused: projectPaused, running: running, surface: "row" })) }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "text-foreground truncate text-sm leading-tight font-medium", children: name }), subtitle ? (_jsx("span", { className: "text-muted-foreground truncate text-xs leading-tight", children: subtitle })) : null] }), _jsxs("span", { className: "flex w-24 shrink-0 flex-col items-end text-xs tabular-nums", children: [_jsx("span", { title: projectPaused ? undefined : describeNextRun(trigger) ?? undefined, className: cn('whitespace-nowrap', trigger.enabled && !trigger.auto_paused_at && !projectPaused ? 'text-foreground' : 'text-muted-foreground'), children: nextRunLabel(projectPaused ? { ...trigger, enabled: false } : trigger, t, locale) }), running ? (_jsx("span", { className: "flex h-4 items-center", children: _jsx(SessionDotMatrix, { sessionId: trigger.slug, size: 14, className: "shrink-0" }) })) : (_jsx("span", { className: "text-muted-foreground whitespace-nowrap", children: lastRunLabel(trigger, t, locale) }))] })] }));
|
|
54
|
+
const cells = (_jsxs(_Fragment, { children: [_jsx("span", { className: "flex size-5 shrink-0 items-center justify-center", children: selecting ? (_jsx(Checkbox, { checked: checked, tabIndex: -1, "aria-hidden": true, className: "pointer-events-none" })) : (_jsx(TriggerTile, { trigger: trigger, projectPaused: projectPaused, running: running, surface: "row" })) }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { title: name, className: "text-foreground truncate text-sm leading-tight font-medium", children: name }), subtitle ? (_jsx("span", { className: "text-muted-foreground truncate text-xs leading-tight", children: subtitle })) : null] }), _jsxs("span", { className: "flex min-w-24 shrink-0 flex-col items-end text-xs tabular-nums", children: [_jsx("span", { title: projectPaused ? undefined : describeNextRun(trigger) ?? undefined, className: cn('whitespace-nowrap', trigger.enabled && !trigger.auto_paused_at && !projectPaused ? 'text-foreground' : 'text-muted-foreground'), children: nextRunLabel(projectPaused ? { ...trigger, enabled: false } : trigger, t, locale, now) }), running ? (_jsx("span", { className: "flex h-4 items-center", children: _jsx(SessionDotMatrix, { sessionId: trigger.slug, size: 14, className: "shrink-0" }) })) : (_jsx("span", { className: "text-muted-foreground whitespace-nowrap", children: lastRunLabel(trigger, t, locale, now) }))] })] }));
|
|
61
55
|
if (selecting) {
|
|
62
56
|
return (_jsx("li", { role: "option", "aria-selected": checked, tabIndex: 0, onClick: (e) => onToggle(e.shiftKey), onKeyDown: (e) => {
|
|
63
57
|
if (e.key === ' ' || e.key === 'Enter') {
|
|
@@ -46,4 +46,10 @@ export declare function inRunRange(run: Pick<ProjectTriggerRun, 'started_at'>, r
|
|
|
46
46
|
} | null): boolean;
|
|
47
47
|
/** The source a trigger's own runs come from; a row names any other one (manual, replay, reminder). */
|
|
48
48
|
export declare function isDefaultSource(triggerType: ProjectTriggerType, source: ProjectTriggerRun['source']): boolean;
|
|
49
|
+
/** The App event a run fired on (an App event trigger), from its payload: name, the App's own id, the App. Null for any other run. */
|
|
50
|
+
export declare function appEventOf(payload: Record<string, unknown>): {
|
|
51
|
+
name: string;
|
|
52
|
+
id: string | null;
|
|
53
|
+
app: string;
|
|
54
|
+
} | null;
|
|
49
55
|
export {};
|
|
@@ -88,3 +88,16 @@ export function inRunRange(run, range) {
|
|
|
88
88
|
export function isDefaultSource(triggerType, source) {
|
|
89
89
|
return source === triggerType;
|
|
90
90
|
}
|
|
91
|
+
/** The App event a run fired on (an App event trigger), from its payload: name, the App's own id, the App. Null for any other run. */
|
|
92
|
+
export function appEventOf(payload) {
|
|
93
|
+
const event = payload.event;
|
|
94
|
+
const app = payload.app;
|
|
95
|
+
if (!event || typeof event !== 'object' || !app || typeof app !== 'object')
|
|
96
|
+
return null;
|
|
97
|
+
const name = event.name;
|
|
98
|
+
const slug = app.slug;
|
|
99
|
+
if (typeof name !== 'string' || !name || typeof slug !== 'string' || !slug)
|
|
100
|
+
return null;
|
|
101
|
+
const id = event.id;
|
|
102
|
+
return { name, id: typeof id === 'string' && id ? id : null, app: slug };
|
|
103
|
+
}
|
|
@@ -19,6 +19,7 @@ import { EmptyState } from '../../../primitives/empty-state.js';
|
|
|
19
19
|
import { ErrorState } from '../../../primitives/error-state.js';
|
|
20
20
|
import { useLocale, useTranslations } from '../../../i18n/index.js';
|
|
21
21
|
import { projectSessionHref } from '../../../internal/lib/navigation/session-href.js';
|
|
22
|
+
import { uiRoutes } from '../../../lib/routes.js';
|
|
22
23
|
import { cn } from '../../../internal/lib/utils.js';
|
|
23
24
|
import { copyToClipboard } from '../../../internal/lib/utils/clipboard.js';
|
|
24
25
|
import { ApiError, } from '@kortix/sdk';
|
|
@@ -27,7 +28,7 @@ import { ArrowCounterClockwiseIcon, ArrowSquareOutIcon, PlayIcon, WarningIcon, X
|
|
|
27
28
|
import { UiLink as Link, useUiRouter } from '../../../providers/ui-provider.js';
|
|
28
29
|
import { useMemo, useState } from 'react';
|
|
29
30
|
import { RunHistogram, fmtRange } from './trigger-runs-histogram.js';
|
|
30
|
-
import { RUNS_POLL_MS, canReplay, inRunRange, isDefaultSource, runState, runsInFlight, } from './trigger-runs-logic.js';
|
|
31
|
+
import { appEventOf, RUNS_POLL_MS, canReplay, inRunRange, isDefaultSource, runState, runsInFlight, } from './trigger-runs-logic.js';
|
|
31
32
|
import { fireResultToast } from './trigger-toast.js';
|
|
32
33
|
const absoluteFormatter = new Intl.DateTimeFormat(undefined, {
|
|
33
34
|
year: 'numeric',
|
|
@@ -199,6 +200,12 @@ export function RunRow({ projectId, trigger, run, newDay, replay, initialOpen =
|
|
|
199
200
|
const error = run.error ?? run.run_error;
|
|
200
201
|
const failed = state === 'failed' || state === 'rejected';
|
|
201
202
|
const source = t.raw(SOURCE_LABEL_KEY[run.source]);
|
|
203
|
+
// An App event run: its event, and the App's log of that event (one row per trigger it reached).
|
|
204
|
+
const appEvent = appEventOf(run.payload);
|
|
205
|
+
const appsHref = appEvent ? uiRoutes().apps(projectId) : null;
|
|
206
|
+
const eventHref = appEvent && appsHref
|
|
207
|
+
? `${appsHref}?app=${encodeURIComponent(appEvent.app)}${appEvent.id ? `&event=${encodeURIComponent(appEvent.id)}` : ''}`
|
|
208
|
+
: null;
|
|
202
209
|
const replayButton = (className) => replay ? (_jsxs(Button, { variant: "outline", size: "xs", className: cn('gap-1.5 text-xs', className), disabled: replay.disabled, onClick: replay.onReplay, children: [replay.pending ? (_jsx(Loading, { className: "size-3 shrink-0" })) : (_jsx(ArrowCounterClockwiseIcon, { className: "size-3 shrink-0" })), t.raw('textc8dae6371b33')] })) : null;
|
|
203
210
|
return (_jsxs(_Fragment, { children: [newDay ? (_jsx("li", { className: "text-muted-foreground px-3 pt-3.5 pb-1.5 text-xs font-medium", children: fmtDay(run.started_at, locale, (key) => t.raw(key)) })) : null, _jsxs("li", { className: cn('group relative rounded-md', open && 'bg-muted'), children: [_jsxs("button", { type: "button", "aria-expanded": open, onClick: () => setOpen((v) => !v), onKeyDown: (e) => {
|
|
204
211
|
if (e.key === 'Escape' && open)
|
|
@@ -214,5 +221,5 @@ export function RunRow({ projectId, trigger, run, newDay, replay, initialOpen =
|
|
|
214
221
|
else {
|
|
215
222
|
errorToast(t.raw('text4cb23f3c3b90'));
|
|
216
223
|
}
|
|
217
|
-
}, className: "text-foreground focus-visible:ring-ring min-w-0 cursor-pointer truncate rounded-sm text-left font-mono outline-none focus-visible:ring-2", children: run.session_id })] })) : null, error ? (_jsxs("div", { className: "flex gap-3 text-xs", children: [_jsx("span", { className: "text-muted-foreground w-22 shrink-0", children: t.raw('text54a0e8c17ebb') }), _jsx("span", { className: "text-foreground min-w-0 break-words", children: error })] })) : null, replay || run.session_id ? (_jsxs("div", { className: "flex gap-1 pt-1", children: [replayButton(), run.session_id ? (_jsx(Button, { variant: "ghost", size: "xs", className: "text-muted-foreground gap-1.5 text-xs", asChild: true, children: _jsxs(Link, { href: projectSessionHref(projectId, run.session_id), children: [_jsx(ArrowSquareOutIcon, { className: "size-3 shrink-0" }), t.raw('textb205bb47f81a')] }) })) : null] })) : null] }), _jsx("pre", { className: "bg-surface text-foreground min-w-0 flex-1 overflow-auto rounded-md px-3.5 py-3 font-mono text-xs leading-normal whitespace-pre", children: JSON.stringify(run.payload, null, 2) })] })) : null] })] }));
|
|
224
|
+
}, className: "text-foreground focus-visible:ring-ring min-w-0 cursor-pointer truncate rounded-sm text-left font-mono outline-none focus-visible:ring-2", children: run.session_id })] })) : null, appEvent ? (_jsxs("div", { className: "flex gap-3 text-xs", children: [_jsx("span", { className: "text-muted-foreground w-22 shrink-0", children: t.raw('text4e1f49a9c8ae') }), _jsx("span", { className: "text-foreground min-w-0 truncate font-mono", children: appEvent.id ? `${appEvent.name} · ${appEvent.id}` : appEvent.name })] })) : null, error ? (_jsxs("div", { className: "flex gap-3 text-xs", children: [_jsx("span", { className: "text-muted-foreground w-22 shrink-0", children: t.raw('text54a0e8c17ebb') }), _jsx("span", { className: "text-foreground min-w-0 break-words", children: error })] })) : null, replay || run.session_id || eventHref ? (_jsxs("div", { className: "flex gap-1 pt-1", children: [replayButton(), run.session_id ? (_jsx(Button, { variant: "ghost", size: "xs", className: "text-muted-foreground gap-1.5 text-xs", asChild: true, children: _jsxs(Link, { href: projectSessionHref(projectId, run.session_id), children: [_jsx(ArrowSquareOutIcon, { className: "size-3 shrink-0" }), t.raw('textb205bb47f81a')] }) })) : null, eventHref ? (_jsx(Button, { variant: "ghost", size: "xs", className: "text-muted-foreground gap-1.5 text-xs", asChild: true, children: _jsxs(Link, { href: eventHref, children: [_jsx(ArrowSquareOutIcon, { className: "size-3 shrink-0" }), t.raw('text648f297b3b79')] }) })) : null] })) : null] }), _jsx("pre", { className: "bg-surface text-foreground min-w-0 flex-1 overflow-auto rounded-md px-3.5 py-3 font-mono text-xs leading-normal whitespace-pre", children: JSON.stringify(run.payload, null, 2) })] })) : null] })] }));
|
|
218
225
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Mirrors the public surface of the sandbox `packages/ui/src/internal/files/runtime-files.ts`
|
|
5
5
|
* (so the copy of all UI components/hooks needs no signature changes), but
|
|
6
6
|
* every function dispatches against `/v1/projects/:projectId/files` instead
|
|
7
|
-
* of the
|
|
7
|
+
* of the sandbox daemon.
|
|
8
8
|
*
|
|
9
9
|
* Write operations (`writeFile`, `uploadFile`, `deleteFile`, `mkdirFile`,
|
|
10
10
|
* `renameFile`, `createFile`, `copyFile`) throw — project files are
|
|
@@ -15,7 +15,7 @@ import type { FileContentMatch } from '../explorer-source.js';
|
|
|
15
15
|
/**
|
|
16
16
|
* Strip the legacy `/workspace` prefix and any leading slashes so the path
|
|
17
17
|
* matches what `git ls-tree` returns. The copied UI was built against the
|
|
18
|
-
*
|
|
18
|
+
* sandbox "absolute under /workspace" convention; the project API uses
|
|
19
19
|
* repo-relative paths.
|
|
20
20
|
*/
|
|
21
21
|
declare function toRepoRelative(p: string): string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Mirrors the public surface of the sandbox `packages/ui/src/internal/files/runtime-files.ts`
|
|
5
5
|
* (so the copy of all UI components/hooks needs no signature changes), but
|
|
6
6
|
* every function dispatches against `/v1/projects/:projectId/files` instead
|
|
7
|
-
* of the
|
|
7
|
+
* of the sandbox daemon.
|
|
8
8
|
*
|
|
9
9
|
* Write operations (`writeFile`, `uploadFile`, `deleteFile`, `mkdirFile`,
|
|
10
10
|
* `renameFile`, `createFile`, `copyFile`) throw — project files are
|
|
@@ -19,7 +19,7 @@ const READ_ONLY = 'Read-only — project files come from Git';
|
|
|
19
19
|
/**
|
|
20
20
|
* Strip the legacy `/workspace` prefix and any leading slashes so the path
|
|
21
21
|
* matches what `git ls-tree` returns. The copied UI was built against the
|
|
22
|
-
*
|
|
22
|
+
* sandbox "absolute under /workspace" convention; the project API uses
|
|
23
23
|
* repo-relative paths.
|
|
24
24
|
*/
|
|
25
25
|
function toRepoRelative(p) {
|
|
@@ -35,7 +35,7 @@ import { ExplorerFilePreview } from './file-preview-modal.js';
|
|
|
35
35
|
import { FileSearch } from './file-search.js';
|
|
36
36
|
import { isPartialListing, LoadMoreRow } from './load-more-row.js';
|
|
37
37
|
/** System directories always pinned at the top of the listing. */
|
|
38
|
-
const ELEVATED_DIRS = new Set(['.kortix'
|
|
38
|
+
const ELEVATED_DIRS = new Set(['.kortix']);
|
|
39
39
|
/**
|
|
40
40
|
* Google Drive-style file explorer — the ONE explorer implementation, shared
|
|
41
41
|
* by every surface. Data access comes from the injected FileExplorerSource
|
|
@@ -113,7 +113,6 @@ const FileCard = memo(function FileCard({ node, onClick, onDoubleClick, onDownlo
|
|
|
113
113
|
/** Descriptions for elevated system directories */
|
|
114
114
|
const ELEVATED_DIR_META = {
|
|
115
115
|
'.kortix': { description: 'Project config, tasks, context' },
|
|
116
|
-
'.opencode': { description: 'Agents, skills, commands' },
|
|
117
116
|
};
|
|
118
117
|
export function DriveGridView({ elevatedDirs, dirs, files, onNavigateToDir, onOpenFile, onPreviewFile, onDownload, onDownloadDir, onRename: rawOnRename, onDelete: rawOnDelete, onHistory: rawOnHistory, onCopy: rawOnCopy, onCut: rawOnCut, onDropMove: rawOnDropMove, onDropUpload: rawOnDropUpload, gitStatusMap, clipboardPath, clipboardOperation, isDirDownloading, readOnly = false, isFixed, uploadingPaths, }) {
|
|
119
118
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
@@ -19,7 +19,6 @@ import { getFileIcon } from './file-icon.js';
|
|
|
19
19
|
import { ownClicks } from './own-clicks.js';
|
|
20
20
|
const ELEVATED_DIR_META = {
|
|
21
21
|
'.kortix': 'Project config, tasks, context',
|
|
22
|
-
'.opencode': 'Agents, skills, commands',
|
|
23
22
|
};
|
|
24
23
|
function ChalkBadge({ label }) {
|
|
25
24
|
const chalk = chalkColors(label);
|
|
@@ -29,7 +29,7 @@ import { ExplorerFilePreview } from './file-preview-modal.js';
|
|
|
29
29
|
import { FileSearch } from './file-search.js';
|
|
30
30
|
import { isPartialListing, LoadMoreRow } from './load-more-row.js';
|
|
31
31
|
import { requestedFilesRightPanel } from './file-route-state.js';
|
|
32
|
-
const ELEVATED_DIRS = new Set(['.kortix'
|
|
32
|
+
const ELEVATED_DIRS = new Set(['.kortix']);
|
|
33
33
|
/**
|
|
34
34
|
* The project-level file explorer. It has no session context — sharing is
|
|
35
35
|
* scoped to a session's sandbox — so it renders no share control, matching
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Files feature hooks — all backed by the
|
|
2
|
+
* Files feature hooks — all backed by the project files API.
|
|
3
3
|
*/
|
|
4
4
|
export { fileListKeys, useFileList, useInvalidateFileList } from './use-file-list.js';
|
|
5
5
|
export { fileContentKeys, useFileContent, useInvalidateFileContent } from './use-file-content.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RuntimeProjectInfo, ServerHealth } from '../../../internal/files/types.js';
|
|
2
2
|
/**
|
|
3
3
|
* In the project-files view, "the server" is always the backend API — there
|
|
4
|
-
* is no per-sandbox
|
|
4
|
+
* is no per-sandbox runtime to health-check. Treat as healthy.
|
|
5
5
|
*/
|
|
6
6
|
export declare function useServerHealth(_options?: {
|
|
7
7
|
enabled?: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* In the project-files view, "the server" is always the backend API — there
|
|
5
|
-
* is no per-sandbox
|
|
5
|
+
* is no per-sandbox runtime to health-check. Treat as healthy.
|
|
6
6
|
*/
|
|
7
7
|
export function useServerHealth(_options) {
|
|
8
8
|
return useMemo(() => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Workspace search service — stubbed for project-files (read-only).
|
|
3
3
|
*
|
|
4
|
-
* The instance feature pre-indexes the workspace via
|
|
4
|
+
* The instance feature pre-indexes the workspace via the sandbox PTY +
|
|
5
5
|
* SDK; project view has no such index, and the project files API does
|
|
6
6
|
* not yet expose search. Returning empty results preserves the
|
|
7
7
|
* call-shape callers expect.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Workspace search service — stubbed for project-files (read-only).
|
|
3
3
|
*
|
|
4
|
-
* The instance feature pre-indexes the workspace via
|
|
4
|
+
* The instance feature pre-indexes the workspace via the sandbox PTY +
|
|
5
5
|
* SDK; project view has no such index, and the project files API does
|
|
6
6
|
* not yet expose search. Returning empty results preserves the
|
|
7
7
|
* call-shape callers expect.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Files feature hooks — all backed by the
|
|
2
|
+
* Files feature hooks — all backed by the sandbox daemon's file API.
|
|
3
3
|
*/
|
|
4
4
|
export { fileListKeys, useFileList, useInvalidateFileList } from './use-file-list.js';
|
|
5
5
|
export { fileContentKeys, useFileContent, useInvalidateFileContent } from './use-file-content.js';
|
|
@@ -4,8 +4,8 @@ import type { SandboxConnectionStatus } from '@kortix/sdk/react';
|
|
|
4
4
|
* `status` is about the socket, `parked` is about the box.
|
|
5
5
|
*
|
|
6
6
|
* A `connected` status with `runtimeHealthy: false` stays HEALTHY on purpose:
|
|
7
|
-
* the file daemon answers while
|
|
8
|
-
* Files on
|
|
7
|
+
* the file daemon answers while the runtime is merely not ready yet, and gating
|
|
8
|
+
* Files on runtime readiness would blank the panel through every boot.
|
|
9
9
|
*
|
|
10
10
|
* `parked` is the opposite situation and needs the opposite answer. Nothing is
|
|
11
11
|
* running, so nothing can serve a listing — and `status` will not tell you,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* `status` is about the socket, `parked` is about the box.
|
|
3
3
|
*
|
|
4
4
|
* A `connected` status with `runtimeHealthy: false` stays HEALTHY on purpose:
|
|
5
|
-
* the file daemon answers while
|
|
6
|
-
* Files on
|
|
5
|
+
* the file daemon answers while the runtime is merely not ready yet, and gating
|
|
6
|
+
* Files on runtime readiness would blank the panel through every boot.
|
|
7
7
|
*
|
|
8
8
|
* `parked` is the opposite situation and needs the opposite answer. Nothing is
|
|
9
9
|
* running, so nothing can serve a listing — and `status` will not tell you,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { stripTrailingSlashes } from '@kortix/sdk';
|
|
2
2
|
/**
|
|
3
3
|
* Elevated system directories that appear in the file tree but are directories,
|
|
4
|
-
* not files. GET /file/content?path=.
|
|
4
|
+
* not files. GET /file/content?path=.kortix always returns 400 "Path is a
|
|
5
5
|
* directory"; issuing that read as content is never correct, so callers must
|
|
6
6
|
* never enable a content query for them (it was a recurring source of 400s in
|
|
7
7
|
* the session page). Kept as a standalone pure module so it can be unit-tested
|
|
8
8
|
* without importing the 'use client' hook and its React/store dependencies.
|
|
9
9
|
*/
|
|
10
|
-
const SYSTEM_DIRECTORIES = new Set(['.
|
|
10
|
+
const SYSTEM_DIRECTORIES = new Set(['.kortix', '.git']);
|
|
11
11
|
export function isSystemDirectoryPath(filePath) {
|
|
12
12
|
if (!filePath)
|
|
13
13
|
return false;
|
|
@@ -2,7 +2,7 @@ import type { FileContent } from '../../../internal/files/types.js';
|
|
|
2
2
|
import { fileContentKeys } from '@kortix/sdk/react';
|
|
3
3
|
export { fileContentKeys };
|
|
4
4
|
/**
|
|
5
|
-
* Fetch the content of a single file from the active
|
|
5
|
+
* Fetch the content of a single file from the active sandbox daemon.
|
|
6
6
|
*
|
|
7
7
|
* Uses GET /file/content?path=<path> which returns FileContent.
|
|
8
8
|
* Text files return plain content; images/binaries return base64-encoded content.
|
|
@@ -10,7 +10,7 @@ import { isSystemDirectoryPath } from './system-dir.js';
|
|
|
10
10
|
// `file.edited` and at turn end, so an open viewer shows the agent's edit.
|
|
11
11
|
export { fileContentKeys };
|
|
12
12
|
/**
|
|
13
|
-
* Fetch the content of a single file from the active
|
|
13
|
+
* Fetch the content of a single file from the active sandbox daemon.
|
|
14
14
|
*
|
|
15
15
|
* Uses GET /file/content?path=<path> which returns FileContent.
|
|
16
16
|
* Text files return plain content; images/binaries return base64-encoded content.
|
|
@@ -2,7 +2,7 @@ import type { FileNode } from '../../../internal/files/types.js';
|
|
|
2
2
|
import { fileListKeys } from '@kortix/sdk/react';
|
|
3
3
|
export { fileListKeys };
|
|
4
4
|
/**
|
|
5
|
-
* Fetch the directory listing for a path on the active
|
|
5
|
+
* Fetch the directory listing for a path on the active sandbox daemon.
|
|
6
6
|
*
|
|
7
7
|
* Uses GET /file?path=<path> which returns FileNode[].
|
|
8
8
|
* Hidden (dot) files are filtered out unless showHidden is enabled in the store.
|
|
@@ -7,7 +7,7 @@ import { listFiles } from '../../../internal/files/runtime-files.js';
|
|
|
7
7
|
// Keyed by the SDK factory, which the live event stream invalidates.
|
|
8
8
|
export { fileListKeys };
|
|
9
9
|
/**
|
|
10
|
-
* Fetch the directory listing for a path on the active
|
|
10
|
+
* Fetch the directory listing for a path on the active sandbox daemon.
|
|
11
11
|
*
|
|
12
12
|
* Uses GET /file?path=<path> which returns FileNode[].
|
|
13
13
|
* Hidden (dot) files are filtered out unless showHidden is enabled in the store.
|
|
@@ -36,13 +36,13 @@ export function useFileList(dirPath, options) {
|
|
|
36
36
|
retryDelay: (attempt) => Math.min(1000 * Math.pow(2, attempt), 5000),
|
|
37
37
|
});
|
|
38
38
|
// Filter hidden files client-side so the cache stays complete.
|
|
39
|
-
// .kortix
|
|
39
|
+
// .kortix is always shown — it is the elevated system dir.
|
|
40
40
|
const data = useMemo(() => {
|
|
41
41
|
if (!query.data)
|
|
42
42
|
return query.data;
|
|
43
43
|
if (showHidden)
|
|
44
44
|
return query.data;
|
|
45
|
-
return query.data.filter((node) => !node.name.startsWith('.') || node.name === '.kortix'
|
|
45
|
+
return query.data.filter((node) => !node.name.startsWith('.') || node.name === '.kortix');
|
|
46
46
|
}, [query.data, showHidden]);
|
|
47
47
|
return { ...query, data };
|
|
48
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ServerHealth } from '../../../internal/files/types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Check if the active
|
|
3
|
+
* Check if the active sandbox runtime is reachable and healthy.
|
|
4
4
|
*
|
|
5
5
|
* CONSOLIDATED: This now reads from the sandbox-connection-store (Zustand)
|
|
6
6
|
* which is populated by the single health-check polling loop in
|
|
@@ -21,7 +21,7 @@ export declare function useServerHealth(options?: {
|
|
|
21
21
|
refetch: () => Promise<any>;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Get current project info from the active
|
|
24
|
+
* Get current project info from the active sandbox runtime.
|
|
25
25
|
*
|
|
26
26
|
* CONSOLIDATED: Now uses the same React Query key as useRuntimeCurrentProject
|
|
27
27
|
* (runtimeKeys.currentProject()) to share cache and prevent duplicate fetches.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { requestRuntimeReconnect, useRuntimeConnectionStore, useRuntimeProjectInfo, } from '@kortix/sdk/react';
|
|
3
3
|
import { fileServerHealthState } from './server-health-state.js';
|
|
4
4
|
/**
|
|
5
|
-
* Check if the active
|
|
5
|
+
* Check if the active sandbox runtime is reachable and healthy.
|
|
6
6
|
*
|
|
7
7
|
* CONSOLIDATED: This now reads from the sandbox-connection-store (Zustand)
|
|
8
8
|
* which is populated by the single health-check polling loop in
|
|
@@ -15,7 +15,7 @@ import { fileServerHealthState } from './server-health-state.js';
|
|
|
15
15
|
export function useServerHealth(options) {
|
|
16
16
|
const status = useRuntimeConnectionStore((s) => s.status);
|
|
17
17
|
const runtimeHealthy = useRuntimeConnectionStore((s) => s.healthy);
|
|
18
|
-
const version = useRuntimeConnectionStore((s) => s.
|
|
18
|
+
const version = useRuntimeConnectionStore((s) => s.harnessVersion);
|
|
19
19
|
// The control plane answered the probe from the session row: the box is
|
|
20
20
|
// asleep, not merely un-ready. `status` does not carry this — nothing clears
|
|
21
21
|
// it when a box parks — so without reading it here the gate opens over a box
|
|
@@ -37,7 +37,7 @@ export function useServerHealth(options) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Get current project info from the active
|
|
40
|
+
* Get current project info from the active sandbox runtime.
|
|
41
41
|
*
|
|
42
42
|
* CONSOLIDATED: Now uses the same React Query key as useRuntimeCurrentProject
|
|
43
43
|
* (runtimeKeys.currentProject()) to share cache and prevent duplicate fetches.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* useWorkspaceSearch — Standalone file/folder/content search hook.
|
|
3
3
|
*
|
|
4
4
|
* Reusable across CMD+K palette, @-mention input, file browser, etc.
|
|
5
|
-
* Uses the
|
|
5
|
+
* Uses the runtime's find.files + find.text APIs.
|
|
6
6
|
*
|
|
7
7
|
* Features:
|
|
8
8
|
* - Debounced async search (configurable delay)
|
|
@@ -48,7 +48,6 @@ export interface UseWorkspaceSearchOptions {
|
|
|
48
48
|
/**
|
|
49
49
|
* One-shot async file+folder search with ranking.
|
|
50
50
|
* Returns plain `string[]` paths (dirs have trailing `/`).
|
|
51
|
-
* Drop-in replacement for `findOpenCodeFiles`.
|
|
52
51
|
*/
|
|
53
52
|
export declare function searchWorkspaceFiles(query: string, limit?: number): Promise<string[]>;
|
|
54
53
|
export declare function useWorkspaceSearch(query: string, options?: UseWorkspaceSearchOptions): WorkspaceSearchState;
|