@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
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ToolProps } from '../shared/types.js';
|
|
2
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
2
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
3
3
|
export declare function PtyWriteTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { ToolRegistry } from '../shared/registry.js';
|
|
|
5
5
|
import { ToolResultCard } from '../shared/result-card.js';
|
|
6
6
|
import { TerminalWindowIcon as Terminal } from '@phosphor-icons/react';
|
|
7
7
|
import { useTranslations } from '../../../i18n/index.js';
|
|
8
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
8
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
9
9
|
export function PtyWriteTool({ call, defaultOpen, forceOpen, locked }) {
|
|
10
10
|
const tHardcodedUi = useTranslations('hardcodedUi');
|
|
11
11
|
const input = partInput(call);
|
|
@@ -21,10 +21,13 @@ export function SessionSpawnTool({ call, forceOpen }) {
|
|
|
21
21
|
const status = partStatus(call);
|
|
22
22
|
const { projectId, sessionId } = useSessionIds();
|
|
23
23
|
const Link = useUiLink();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
24
|
+
// Tool input is the model's JSON (`unknown` at runtime): read each field by
|
|
25
|
+
// type, so a non-string takes the absent-field fallback instead of throwing
|
|
26
|
+
// in `capitalizeWords` or `split` (KRTX-4511).
|
|
27
|
+
const agentName = capitalizeWords((typeof input.agent === 'string' && input.agent) || 'kortix');
|
|
28
|
+
const description = typeof input.description === 'string' ? input.description : '';
|
|
29
|
+
const projectName = typeof input.project === 'string' ? input.project : '';
|
|
30
|
+
const fullPrompt = typeof input.prompt === 'string' ? input.prompt : '';
|
|
28
31
|
const childSessionId = useMemo(() => getChildSessionId(call), [call]);
|
|
29
32
|
const childThread = useSubAgentThread(childSessionId);
|
|
30
33
|
const childCalls = useMemo(() => subAgentCalls(childThread), [childThread]);
|
|
@@ -40,8 +40,20 @@ export function TaskTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
40
40
|
const tNotice = useTranslations('multiAgent.notice');
|
|
41
41
|
const input = partInput(call);
|
|
42
42
|
const status = partStatus(call);
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
// Tool input is the model's JSON: every field is `unknown` at runtime, and a
|
|
44
|
+
// truthy non-string used to crash the render tree (`e.replace is not a
|
|
45
|
+
// function`, KRTX-4511). Read each field by type, never by cast — an empty
|
|
46
|
+
// or junk value falls through to the same fallback as an absent one.
|
|
47
|
+
// pi's `agent` field is an object by schema: an inline agent spec
|
|
48
|
+
// (`{ instructions, model?, tools?, description? }`). Its child runs as the
|
|
49
|
+
// `inline` agent (`INLINE_AGENT` in the pi subagents extension), so the row
|
|
50
|
+
// names it that way, never as `general`.
|
|
51
|
+
const subagentType = (typeof input.subagent_type === 'string' && input.subagent_type) ||
|
|
52
|
+
(typeof input.agent === 'string' && input.agent) ||
|
|
53
|
+
(typeof input.agent === 'object' && input.agent !== null ? INLINE_AGENT : '') ||
|
|
54
|
+
'general';
|
|
55
|
+
const name = typeof input.name === 'string' ? input.name : '';
|
|
56
|
+
const description = useMemo(() => (typeof input.description === 'string' && input.description) ||
|
|
45
57
|
firstMeaningfulLine(input.prompt) ||
|
|
46
58
|
// Codex `spawn_agent`.
|
|
47
59
|
firstMeaningfulLine(input.message) ||
|
|
@@ -64,8 +76,8 @@ export function TaskTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
64
76
|
? 'failed'
|
|
65
77
|
: (child?.state ?? (isRunning || (background && backgroundWorking) ? 'working' : status === 'completed' ? 'completed' : 'idle'));
|
|
66
78
|
// The name its parent gave it (`agent({ name })`) reads best; else the kind of agent.
|
|
67
|
-
const handle =
|
|
68
|
-
const title =
|
|
79
|
+
const handle = name || (child?.named ? child.handle : '') || subagentType;
|
|
80
|
+
const title = name || (child?.named ? child.handle : '') || agentDisplayName(subagentType);
|
|
69
81
|
// A row with a session opens it: beside the chat in the side panel, or as the agent
|
|
70
82
|
// dialog where there is no panel. Its prompt, steps and answer are that session's
|
|
71
83
|
// conversation, so the row carries no copy of them. A call that never got a
|
|
@@ -76,6 +88,8 @@ export function TaskTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
76
88
|
const hasBody = !opensAgent && (!!prompt || !!errorText || !!childSessionId);
|
|
77
89
|
return (_jsxs(AgentRowScope, { children: [_jsx(BasicTool, { icon: _jsx(AgentFace, { handle: handle }), trigger: _jsx(AgentTrigger, { title: title, subtitle: description }), triggerAction: _jsx(AgentStatus, { status: STATE_GLYPH[state], label: t(`state.${state}`), opens: opensAgent || hasBody }), onClick: opensAgent ? () => setModalOpen(true) : undefined, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: hasBody ? (_jsxs(AgentRowBody, { children: [prompt && prompt !== description && (_jsx("p", { className: "text-muted-foreground line-clamp-4 whitespace-pre-wrap wrap-break-word", children: prompt })), errorText && _jsx(AgentFailure, { sentence: tNotice('failedSentence'), raw: errorText }), childSessionId && _jsx(OpenAgentButton, { label: t('openAgent', { name: description || title }), onClick: () => setModalOpen(true) })] })) : undefined }), _jsx(SubAgentStatusBanner, { childSessionId: childSessionId, childThread: childThread }), childSessionId && (_jsx(SubagentDialog, { open: modalOpen, onOpenChange: setModalOpen, sessionId: childSessionId, title: title, handle: handle, task: description || undefined, failure: errorText || undefined }))] }));
|
|
78
90
|
}
|
|
91
|
+
/** The agent name an inline agent spec's child runs under (pi `INLINE_AGENT`). */
|
|
92
|
+
const INLINE_AGENT = 'inline';
|
|
79
93
|
/** The session-list glyph an agent's state draws. */
|
|
80
94
|
const STATE_GLYPH = {
|
|
81
95
|
working: 'running',
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ToolProps } from '../shared/types.js';
|
|
2
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
2
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
3
3
|
export declare function TodoWriteTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
|
|
@@ -9,7 +9,7 @@ import { cn } from '../../../lib/utils.js';
|
|
|
9
9
|
import { ListChecksIcon as ListTodo } from '@phosphor-icons/react';
|
|
10
10
|
import { useTranslations } from '../../../i18n/index.js';
|
|
11
11
|
import { useMemo } from 'react';
|
|
12
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
12
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
13
13
|
export function TodoWriteTool({ call, defaultOpen, forceOpen, locked }) {
|
|
14
14
|
const tI18nHardcoded = useTranslations('hardcodedUi');
|
|
15
15
|
const input = partInput(call);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PeerMessagePromptInfo } from '../../_vendor/shared/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* A message another Kortix session sent this one (`send_message`). Nobody here
|
|
4
4
|
* typed it, so it is never a bubble: it is an agent row, the sender's face and
|
|
@@ -12,15 +12,6 @@ import type { PeerMessageKind, PeerMessagePromptInfo } from '../../_vendor/share
|
|
|
12
12
|
* An idle notice says only that a teammate finished: one row like an agent's
|
|
13
13
|
* finish, that opens to the rest. A shutdown request and its answer say so on the right.
|
|
14
14
|
*/
|
|
15
|
-
/**
|
|
16
|
-
* The preview after the sender: the summary, else the first line of the text. CSS cuts it with `…`.
|
|
17
|
-
* An idle notice (`firePeerIdleNotices` in the API) previews its "Its last answer:" line; its
|
|
18
|
-
* first line ("reviewer finished its turn and is idle.") repeats the headline, so it shows only
|
|
19
|
-
* when it says something else (an error).
|
|
20
|
-
*/
|
|
21
|
-
export declare function peerMessagePreview(info: Pick<PeerMessagePromptInfo, 'summary' | 'text'> & {
|
|
22
|
-
kind?: PeerMessageKind;
|
|
23
|
-
}): string;
|
|
24
15
|
/** An idle notice's text without the line that repeats the state, and its answer without the "Its last answer:" label. */
|
|
25
16
|
export declare function idleNoticeBody(text: string): string;
|
|
26
17
|
export declare function PeerMessageRow({ info, actions }: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { peerMessagePreview } from '@kortix/sdk';
|
|
3
4
|
import { peerHandleLabel } from '../../_vendor/kortix-shared.js';
|
|
4
5
|
import { useTranslations } from '../../i18n/index.js';
|
|
5
6
|
import { UnifiedMarkdown } from '../../markdown/unified-markdown.js';
|
|
@@ -18,24 +19,6 @@ import { BasicTool } from '../tool/shared/infrastructure.js';
|
|
|
18
19
|
* An idle notice says only that a teammate finished: one row like an agent's
|
|
19
20
|
* finish, that opens to the rest. A shutdown request and its answer say so on the right.
|
|
20
21
|
*/
|
|
21
|
-
/**
|
|
22
|
-
* The preview after the sender: the summary, else the first line of the text. CSS cuts it with `…`.
|
|
23
|
-
* An idle notice (`firePeerIdleNotices` in the API) previews its "Its last answer:" line; its
|
|
24
|
-
* first line ("reviewer finished its turn and is idle.") repeats the headline, so it shows only
|
|
25
|
-
* when it says something else (an error).
|
|
26
|
-
*/
|
|
27
|
-
export function peerMessagePreview(info) {
|
|
28
|
-
if (info.summary?.trim())
|
|
29
|
-
return info.summary.trim();
|
|
30
|
-
const lines = info.text.split('\n').map((line) => line.trim()).filter(Boolean);
|
|
31
|
-
if (info.kind === 'idle_notice') {
|
|
32
|
-
const answer = lines.find((line) => line.startsWith('Its last answer:'));
|
|
33
|
-
if (answer)
|
|
34
|
-
return answer.slice('Its last answer:'.length).trim();
|
|
35
|
-
return lines[0] && !/finished its turn and is idle\.?$/.test(lines[0]) ? lines[0] : '';
|
|
36
|
-
}
|
|
37
|
-
return lines[0] ?? '';
|
|
38
|
-
}
|
|
39
22
|
/** An idle notice's text without the line that repeats the state, and its answer without the "Its last answer:" label. */
|
|
40
23
|
export function idleNoticeBody(text) {
|
|
41
24
|
// Only the platform's two lines change; the answer itself keeps its Markdown (indents, blank lines).
|
|
@@ -27,7 +27,7 @@ import { type SessionLogTurn } from '@kortix/sdk';
|
|
|
27
27
|
* A tool call that writes the plan. The runtime emits more than one spelling
|
|
28
28
|
* (`todowrite`, `todo_write`); `toolKind` owns them. The todo READ shares the
|
|
29
29
|
* kind and never renders (`shouldShowToolPart`), so it is not a plan write.
|
|
30
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
30
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
31
31
|
*/
|
|
32
32
|
export declare function isPlanWriteTool(tool: string): boolean;
|
|
33
33
|
/**
|
|
@@ -81,7 +81,7 @@ export interface PlanSurfaceState {
|
|
|
81
81
|
* whether the panel is OPEN deliberately does not enter into it. */
|
|
82
82
|
isMobile: boolean;
|
|
83
83
|
}
|
|
84
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
84
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
85
85
|
export declare function planBelongsToChat(state: PlanSurfaceState): boolean;
|
|
86
86
|
/**
|
|
87
87
|
* The anchor the CHAT should use — which is "none" unless the chat is the
|
|
@@ -90,6 +90,6 @@ export declare function planBelongsToChat(state: PlanSurfaceState): boolean;
|
|
|
90
90
|
* The gate wraps the lookup rather than sitting beside it: returning `null` (which matches no message id) means every `ownsPlan`
|
|
91
91
|
* downstream, including the user bubble's own column cap, falls out of ONE
|
|
92
92
|
* decision instead of two that can disagree.
|
|
93
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
93
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
94
94
|
*/
|
|
95
95
|
export declare function chatPlanAnchorId(turns: ReadonlyArray<Pick<SessionLogTurn, 'id' | 'plan'>> | null | undefined, chatOwnsPlan: boolean): string | null;
|
|
@@ -27,7 +27,7 @@ import { shouldShowToolPart, toolKind } from '@kortix/sdk';
|
|
|
27
27
|
* A tool call that writes the plan. The runtime emits more than one spelling
|
|
28
28
|
* (`todowrite`, `todo_write`); `toolKind` owns them. The todo READ shares the
|
|
29
29
|
* kind and never renders (`shouldShowToolPart`), so it is not a plan write.
|
|
30
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
30
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
31
31
|
*/
|
|
32
32
|
export function isPlanWriteTool(tool) {
|
|
33
33
|
return toolKind(tool) === 'todowrite' && shouldShowToolPart({ tool });
|
|
@@ -42,7 +42,7 @@ export function isPlanWriteTool(tool) {
|
|
|
42
42
|
export function planAnchorMessageId(turns) {
|
|
43
43
|
return turns.find((turn) => turn.plan)?.id ?? null;
|
|
44
44
|
}
|
|
45
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
45
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
46
46
|
export function planBelongsToChat(state) {
|
|
47
47
|
return state.isMobile;
|
|
48
48
|
}
|
|
@@ -53,7 +53,7 @@ export function planBelongsToChat(state) {
|
|
|
53
53
|
* The gate wraps the lookup rather than sitting beside it: returning `null` (which matches no message id) means every `ownsPlan`
|
|
54
54
|
* downstream, including the user bubble's own column cap, falls out of ONE
|
|
55
55
|
* decision instead of two that can disagree.
|
|
56
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
56
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
57
57
|
*/
|
|
58
58
|
export function chatPlanAnchorId(turns, chatOwnsPlan) {
|
|
59
59
|
if (!chatOwnsPlan || !turns)
|
|
@@ -28,7 +28,7 @@ export declare function planRingState(done: number, total: number, running: bool
|
|
|
28
28
|
* ticks are precise but need counting, a pie is instant but coarse. Together
|
|
29
29
|
* the glyph answers "roughly how far?" at a glance and "exactly how far?" on a
|
|
30
30
|
* second look — at 18px, where a single encoding would have to pick one.
|
|
31
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
31
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
32
32
|
*/
|
|
33
33
|
export declare function PlanRing({ done, total, running, className, }: {
|
|
34
34
|
done: number;
|
|
@@ -44,10 +44,10 @@ export declare function PlanRing({ done, total, running, className, }: {
|
|
|
44
44
|
* when a plan sits under it, and `ownsPlan` alone is not that answer: the anchor
|
|
45
45
|
* falls back to the last turn when no turn ever wrote todos, so a session with
|
|
46
46
|
* zero todos still nominates an owner.
|
|
47
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
47
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
48
48
|
*/
|
|
49
49
|
export declare function useHasPlan(sessionId: string): boolean;
|
|
50
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
50
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
51
51
|
export declare function planSummary(todos: ReadonlyArray<{
|
|
52
52
|
status: string;
|
|
53
53
|
content: string;
|
|
@@ -74,7 +74,7 @@ export declare function planSummary(todos: ReadonlyArray<{
|
|
|
74
74
|
* Filtering AFTER `keyTodos` is deliberate. Keying first means the surviving
|
|
75
75
|
* rows keep the keys they had while the running row was present, so React's
|
|
76
76
|
* state stays attached to a row as the agent advances past it.
|
|
77
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
77
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
78
78
|
*/
|
|
79
79
|
export declare function planListTodos(keyed: ReadonlyArray<{
|
|
80
80
|
todo: TodoItem;
|
|
@@ -88,13 +88,13 @@ export declare function planListTodos(keyed: ReadonlyArray<{
|
|
|
88
88
|
* repeats a line often enough ("Run the tests" twice) that keying on it alone
|
|
89
89
|
* collides. An occurrence counter disambiguates the repeat, which keeps React's
|
|
90
90
|
* state attached to the row rather than to its position.
|
|
91
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
91
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
92
92
|
*/
|
|
93
93
|
export declare function keyTodos(todos: ReadonlyArray<TodoItem>): Array<{
|
|
94
94
|
todo: TodoItem;
|
|
95
95
|
key: string;
|
|
96
96
|
}>;
|
|
97
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
97
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
98
98
|
export declare function PlanCard({ sessionId }: {
|
|
99
99
|
sessionId: string;
|
|
100
100
|
}): import("react").JSX.Element | null;
|
|
@@ -109,7 +109,7 @@ export declare function PlanCard({ sessionId }: {
|
|
|
109
109
|
*
|
|
110
110
|
* Takes rows already keyed and filtered (`planListTodos(keyTodos(todos))`) —
|
|
111
111
|
* the caller decides what the list is; this decides what it looks like.
|
|
112
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
112
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
113
113
|
*/
|
|
114
114
|
export declare function PlanSteps({ rows, className, }: {
|
|
115
115
|
rows: ReadonlyArray<{
|
|
@@ -200,7 +200,7 @@ const RING_TONE = {
|
|
|
200
200
|
* ticks are precise but need counting, a pie is instant but coarse. Together
|
|
201
201
|
* the glyph answers "roughly how far?" at a glance and "exactly how far?" on a
|
|
202
202
|
* second look — at 18px, where a single encoding would have to pick one.
|
|
203
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
203
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
204
204
|
*/
|
|
205
205
|
export function PlanRing({ done, total, running, className, }) {
|
|
206
206
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
@@ -222,13 +222,13 @@ export function PlanRing({ done, total, running, className, }) {
|
|
|
222
222
|
* when a plan sits under it, and `ownsPlan` alone is not that answer: the anchor
|
|
223
223
|
* falls back to the last turn when no turn ever wrote todos, so a session with
|
|
224
224
|
* zero todos still nominates an owner.
|
|
225
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
225
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
226
226
|
*/
|
|
227
227
|
export function useHasPlan(sessionId) {
|
|
228
228
|
const { data } = useRuntimeSessionTodo(sessionId);
|
|
229
229
|
return parseTodos(data).length > 0;
|
|
230
230
|
}
|
|
231
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
231
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
232
232
|
export function planSummary(todos) {
|
|
233
233
|
const total = todos.length;
|
|
234
234
|
const done = todos.filter((todo) => todo.status === 'completed').length;
|
|
@@ -258,7 +258,7 @@ export function planSummary(todos) {
|
|
|
258
258
|
* Filtering AFTER `keyTodos` is deliberate. Keying first means the surviving
|
|
259
259
|
* rows keep the keys they had while the running row was present, so React's
|
|
260
260
|
* state stays attached to a row as the agent advances past it.
|
|
261
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
261
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
262
262
|
*/
|
|
263
263
|
export function planListTodos(keyed) {
|
|
264
264
|
return keyed.filter(({ todo }) => todo.status !== 'in_progress');
|
|
@@ -268,7 +268,7 @@ export function planListTodos(keyed) {
|
|
|
268
268
|
* repeats a line often enough ("Run the tests" twice) that keying on it alone
|
|
269
269
|
* collides. An occurrence counter disambiguates the repeat, which keeps React's
|
|
270
270
|
* state attached to the row rather than to its position.
|
|
271
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
271
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
272
272
|
*/
|
|
273
273
|
export function keyTodos(todos) {
|
|
274
274
|
const seen = new Map();
|
|
@@ -278,7 +278,7 @@ export function keyTodos(todos) {
|
|
|
278
278
|
return { todo, key: n === 0 ? todo.content : `${todo.content}#${n}` };
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
/** @deprecated Renders an OpenCode-only tool or todo list
|
|
281
|
+
/** @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code. */
|
|
282
282
|
export function PlanCard({ sessionId }) {
|
|
283
283
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
284
284
|
const { data } = useRuntimeSessionTodo(sessionId);
|
|
@@ -312,7 +312,7 @@ export function PlanCard({ sessionId }) {
|
|
|
312
312
|
*
|
|
313
313
|
* Takes rows already keyed and filtered (`planListTodos(keyTodos(todos))`) —
|
|
314
314
|
* the caller decides what the list is; this decides what it looks like.
|
|
315
|
-
* @deprecated Renders an OpenCode-only tool or todo list
|
|
315
|
+
* @deprecated Renders an OpenCode-only tool or todo list (pi has none). Only a transcript OpenCode wrote holds one; this keeps it readable. No new code.
|
|
316
316
|
*/
|
|
317
317
|
export function PlanSteps({ rows, className, }) {
|
|
318
318
|
return (
|