@kortix/ui 0.14.6 → 0.14.8

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.
Files changed (186) hide show
  1. package/dist/_vendor/kortix-shared.js +490 -382
  2. package/dist/_vendor/shared/runtime-versions.d.ts +4 -0
  3. package/dist/access/access/access-dialog-share.js +4 -7
  4. package/dist/access/access/access-dialog.js +2 -1
  5. package/dist/access/access/principal-picker.js +6 -5
  6. package/dist/customize/agents/agent-authority-card.js +1 -2
  7. package/dist/customize/agents/agent-cover-card.d.ts +17 -0
  8. package/dist/customize/agents/agent-cover-card.js +13 -0
  9. package/dist/customize/agents/agent-detail-aside.js +15 -14
  10. package/dist/customize/agents/agent-drives-section.js +5 -6
  11. package/dist/customize/agents/agent-grant-pages.js +68 -70
  12. package/dist/customize/agents/agent-page.js +27 -19
  13. package/dist/customize/agents/agent-people-section.js +18 -17
  14. package/dist/customize/agents/agent-triggers-section.js +6 -5
  15. package/dist/customize/agents/agents-page.js +43 -49
  16. package/dist/customize/connectors/catalog/catalog-entry.d.ts +14 -0
  17. package/dist/customize/connectors/catalog/catalog-entry.js +18 -1
  18. package/dist/customize/connectors/catalog/connector-browse.d.ts +28 -0
  19. package/dist/customize/connectors/catalog/connector-browse.js +18 -5
  20. package/dist/customize/connectors/detail/app-page.js +19 -5
  21. package/dist/customize/connectors/detail/connector-modal.d.ts +10 -13
  22. package/dist/customize/connectors/detail/connector-modal.js +18 -101
  23. package/dist/customize/connectors/detail/connector-notice.js +6 -2
  24. package/dist/customize/connectors/detail/connector-page.d.ts +30 -0
  25. package/dist/customize/connectors/detail/connector-page.js +26 -13
  26. package/dist/customize/migrate-to-v2/migration-prompt.d.ts +1 -0
  27. package/dist/customize/migrate-to-v2/migration-prompt.js +1 -0
  28. package/dist/customize/sections/llm-provider/custom-provider-form.js +24 -7
  29. package/dist/customize/sections/llm-provider/custom-provider-panel.js +44 -8
  30. package/dist/customize/sections/llm-provider/types.d.ts +3 -0
  31. package/dist/customize/sections/llm-provider/utils.js +2 -2
  32. package/dist/customize/sections/view/agent-editor-access-fields.d.ts +9 -16
  33. package/dist/customize/sections/view/agent-editor-access-fields.js +30 -30
  34. package/dist/customize/sections/view/agent-editor-basics-fields.js +3 -10
  35. package/dist/customize/sections/view/agent-editor-primitives.d.ts +28 -10
  36. package/dist/customize/sections/view/agent-editor-primitives.js +32 -19
  37. package/dist/customize/sections/view/agent-editor.js +3 -3
  38. package/dist/customize/sections/view/channels-view.js +2 -6
  39. package/dist/customize/sections/view/gateway/gateway-routing.js +3 -3
  40. package/dist/customize/sections/view/grant-mode-field.d.ts +2 -5
  41. package/dist/customize/sections/view/grant-mode-field.js +10 -18
  42. package/dist/customize/sections/view/permission-editor.js +11 -8
  43. package/dist/customize/sections/view/secrets-view.js +2 -1
  44. package/dist/customize/settings/tabs/general-tab.d.ts +9 -2
  45. package/dist/customize/settings/tabs/general-tab.js +33 -11
  46. package/dist/customize/settings/tabs/transfer-workspace-dialog.d.ts +4 -0
  47. package/dist/customize/settings/tabs/transfer-workspace-dialog.js +82 -0
  48. package/dist/customize/shared/new-entity-menu.js +4 -1
  49. package/dist/customize/skills/skills-page.js +4 -5
  50. package/dist/customize/triggers/schedule/then-fields.js +1 -5
  51. package/dist/customize/triggers/schedule-view.js +4 -2
  52. package/dist/files/project/api/runtime-files.js +3 -2
  53. package/dist/files/project/file-source.js +18 -1
  54. package/dist/files/project/hooks/use-file-content.js +2 -0
  55. package/dist/files/viewer/file-header.js +1 -1
  56. package/dist/files/viewer/file-preview-modal.d.ts +1 -1
  57. package/dist/files/viewer/file-preview-modal.js +12 -2
  58. package/dist/files/viewer/file-source.d.ts +3 -1
  59. package/dist/files/viewer/use-file-content-state.js +26 -7
  60. package/dist/files/viewer/viewer-actions.js +2 -2
  61. package/dist/i18n/en.d.ts +393 -12
  62. package/dist/i18n/en.js +400 -19
  63. package/dist/internal/components/agent-mark.d.ts +38 -0
  64. package/dist/internal/components/agent-mark.js +38 -0
  65. package/dist/internal/files/types.d.ts +2 -0
  66. package/dist/internal/goals/goal-meta.d.ts +30 -0
  67. package/dist/internal/goals/goal-meta.js +55 -0
  68. package/dist/internal/lib/pixel-mark.d.ts +33 -0
  69. package/dist/internal/lib/pixel-mark.js +152 -0
  70. package/dist/internal/lib/query-client-singleton.d.ts +9 -3
  71. package/dist/internal/lib/query-client-singleton.js +18 -12
  72. package/dist/internal/lib/use-project-feature-flags.js +3 -3
  73. package/dist/internal/share/session-shares-modal.js +3 -7
  74. package/dist/internal/stores/kortix-computer-store.js +14 -2
  75. package/dist/internal/stores/session-hover-store.d.ts +32 -0
  76. package/dist/internal/stores/session-hover-store.js +38 -0
  77. package/dist/internal/stores/sidebar-nav-store.d.ts +1 -1
  78. package/dist/internal/stores/sidebar-nav-store.js +3 -1
  79. package/dist/lib/routes.d.ts +2 -0
  80. package/dist/lib/routes.js +1 -0
  81. package/dist/markdown/genui/components/inline.d.ts +1 -1
  82. package/dist/markdown/setup-links/app-credentials-form.d.ts +12 -0
  83. package/dist/markdown/setup-links/app-credentials-form.js +115 -0
  84. package/dist/markdown/setup-links/secret-intake-form.d.ts +10 -0
  85. package/dist/markdown/setup-links/secret-intake-form.js +1 -1
  86. package/dist/primitives/entity-avatar.d.ts +4 -1
  87. package/dist/primitives/entity-avatar.js +4 -2
  88. package/dist/primitives/settings-section-header.d.ts +1 -1
  89. package/dist/primitives/user-avatar.d.ts +3 -1
  90. package/dist/primitives/user-avatar.js +4 -2
  91. package/dist/providers/ui-provider.d.ts +1 -1
  92. package/dist/session/composer/agent-selector.d.ts +7 -1
  93. package/dist/session/composer/agent-selector.js +20 -10
  94. package/dist/session/composer/attachment-tile.d.ts +0 -2
  95. package/dist/session/composer/attachment-tile.js +0 -8
  96. package/dist/session/composer/clipboard-files.d.ts +2 -1
  97. package/dist/session/composer/composer-draft-recovery.d.ts +1 -2
  98. package/dist/session/composer/composer-draft-recovery.js +0 -13
  99. package/dist/session/composer/context-ring.d.ts +1 -1
  100. package/dist/session/composer/context-ring.js +2 -2
  101. package/dist/session/composer/context-usage.d.ts +8 -6
  102. package/dist/session/composer/context-usage.js +9 -7
  103. package/dist/session/composer/inbox-row-claims.d.ts +2 -2
  104. package/dist/session/composer/inbox-row-claims.js +1 -1
  105. package/dist/session/composer/queue-projection.d.ts +3 -2
  106. package/dist/session/composer/queued-prompt-edit.d.ts +1 -1
  107. package/dist/session/composer/reasoning-effort-selector.d.ts +2 -1
  108. package/dist/session/composer/session-composer-readiness.d.ts +7 -22
  109. package/dist/session/composer/session-composer-readiness.js +12 -40
  110. package/dist/session/composer/token-progress.d.ts +1 -1
  111. package/dist/session/composer/token-progress.js +6 -6
  112. package/dist/session/header/export-transcript-modal.d.ts +3 -2
  113. package/dist/session/header/export-transcript-modal.js +6 -3
  114. package/dist/session/header/session-goal-indicator.d.ts +1 -0
  115. package/dist/session/header/session-goal-indicator.js +41 -0
  116. package/dist/session/header/session-site-header.js +2 -1
  117. package/dist/session/models/model-selector.d.ts +3 -1
  118. package/dist/session/models/model-selector.js +3 -2
  119. package/dist/session/panel/easy/plan-card.d.ts +2 -0
  120. package/dist/session/panel/easy/plan-card.js +2 -0
  121. package/dist/session/panel/session-action-panel-column.js +11 -1
  122. package/dist/session/panel/session-audit-shared.d.ts +0 -4
  123. package/dist/session/panel/session-audit-shared.js +1 -1
  124. package/dist/session/panel/session-changes-shared.d.ts +2 -1
  125. package/dist/session/prompts/session-permission-prompt.js +6 -3
  126. package/dist/session/status/provisioning-failure.d.ts +2 -1
  127. package/dist/session/status/session-error-banner.js +8 -6
  128. package/dist/session/status/session-starting-loader.d.ts +24 -31
  129. package/dist/session/status/session-starting-loader.js +32 -81
  130. package/dist/session/thread/chat-minimap-items.d.ts +4 -4
  131. package/dist/session/thread/first-prompt-handover.d.ts +3 -2
  132. package/dist/session/thread/message-parsing.d.ts +3 -3
  133. package/dist/session/thread/plan-surface.d.ts +1 -0
  134. package/dist/session/thread/plan-surface.js +1 -0
  135. package/dist/session/thread/session-chat.js +5 -12
  136. package/dist/session/thread/session-context-metrics.d.ts +15 -0
  137. package/dist/session/thread/session-context-metrics.js +10 -1
  138. package/dist/session/thread/session-context-modal.d.ts +4 -2
  139. package/dist/session/thread/session-context-modal.js +16 -9
  140. package/dist/session/thread/session-history-scroll.d.ts +2 -1
  141. package/dist/session/thread/session-thread.js +1 -1
  142. package/dist/session/thread/transcript.d.ts +4 -0
  143. package/dist/session/thread/transcript.js +18 -5
  144. package/dist/session/thread/turn-share.d.ts +16 -0
  145. package/dist/session/thread/turn-share.js +162 -0
  146. package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -0
  147. package/dist/session/tool/tools/apply-patch-tool.js +1 -0
  148. package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -0
  149. package/dist/session/tool/tools/pty-kill-tool.js +1 -0
  150. package/dist/session/tool/tools/pty-read-tool.d.ts +2 -0
  151. package/dist/session/tool/tools/pty-read-tool.js +2 -0
  152. package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -0
  153. package/dist/session/tool/tools/pty-spawn-tool.js +1 -0
  154. package/dist/session/tool/tools/pty-write-tool.d.ts +1 -0
  155. package/dist/session/tool/tools/pty-write-tool.js +1 -0
  156. package/dist/session/tool/tools/todo-write-tool.d.ts +1 -0
  157. package/dist/session/tool/tools/todo-write-tool.js +1 -0
  158. package/dist/session/turn/message-author-label.js +6 -2
  159. package/dist/session/turn/plan-anchor.d.ts +3 -0
  160. package/dist/session/turn/plan-anchor.js +3 -0
  161. package/dist/session/turn/plan-card.d.ts +7 -0
  162. package/dist/session/turn/plan-card.js +7 -0
  163. package/dist/styles.css +1 -1
  164. package/dist/terminal/pty-connection.d.ts +5 -4
  165. package/dist/terminal/session-terminal-connect-bar.js +2 -1
  166. package/dist/workspace/index.d.ts +1 -0
  167. package/dist/workspace/index.js +1 -0
  168. package/dist/workspace/saved-session-skeleton-shape.d.ts +4 -3
  169. package/dist/workspace/saved-session-skeleton.d.ts +5 -1
  170. package/dist/workspace/saved-session-skeleton.js +5 -4
  171. package/dist/workspace/session-workspace.js +4 -5
  172. package/dist/workspace/sidebar/footer/project-goals-nav.d.ts +6 -0
  173. package/dist/workspace/sidebar/footer/project-goals-nav.js +26 -0
  174. package/dist/workspace/sidebar/modal/session-embed-section.d.ts +25 -0
  175. package/dist/workspace/sidebar/modal/session-embed-section.js +71 -0
  176. package/dist/workspace/sidebar/modal/share-session-modal.js +2 -2
  177. package/dist/workspace/sidebar/nav-row-meta.js +14 -2
  178. package/dist/workspace/sidebar/project-nav-items.js +3 -0
  179. package/dist/workspace/sidebar/project-session-list.js +12 -3
  180. package/dist/workspace/sidebar/session-brief-hover-card.js +33 -9
  181. package/package.json +12 -4
  182. package/skills/kortix-ui/references/modules.md +2 -0
  183. package/dist/session/status/use-readiness-settling.d.ts +0 -18
  184. package/dist/session/status/use-readiness-settling.js +0 -43
  185. package/dist/workspace/sidebar/modal/session-public-link-section.d.ts +0 -13
  186. package/dist/workspace/sidebar/modal/session-public-link-section.js +0 -66
@@ -37,6 +37,7 @@ import { SessionRetryDisplay, TurnErrorDisplay } from '../status/session-error-b
37
37
  import { showTurnBusyIndicator } from '@kortix/sdk';
38
38
  import { SessionBusyIndicator } from '../status/session-busy-indicator.js';
39
39
  import { SessionTurnMeta } from './session-turn-meta.js';
40
+ import { TurnShareButton } from './turn-share.js';
40
41
  import { sessionTurnDurationMs, sessionTurnEndedAt, sessionTurnSpan, } from './session-turn-meta-rows.js';
41
42
  import { Button } from '../../primitives/button.js';
42
43
  import { Disclosure, DisclosureContent, DisclosureTrigger } from '../../primitives/disclosure.js';
@@ -898,7 +899,10 @@ function useTurnSegments({ blocks, answeredQuestionCallsById, shouldUseInlineCon
898
899
  // - While working: it renders INSIDE steps as a regular text part (hideResponsePart=false)
899
900
  // - When done: it's HIDDEN from steps (hideResponsePart=true) and shown below as Response
900
901
  // ============================================================================
901
- /** Shell mode — a live shell tool replaces the whole turn scaffold. */
902
+ /**
903
+ * Shell mode — a live shell tool replaces the whole turn scaffold.
904
+ * @deprecated Renders an OpenCode shell turn (session.shell; pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
905
+ */
902
906
  function TurnShellMode(props) {
903
907
  const { call, working, providers, errors, connectProviderOpen, onConnectProviderOpenChange, permissions, sessionId, disableToolNavigation, onPermissionReply, } = props;
904
908
  // Permission matching for this session (used for tool-level permission overlays)
@@ -1088,13 +1092,22 @@ function TurnAutoRetryNote({ count }) {
1088
1092
  /** The turn's footer: the working row, the error banner, the outcomes, the
1089
1093
  * action bar, the connect-provider dialog, and who stopped the turn. */
1090
1094
  function TurnFooter(props) {
1091
- const { turn, providers, model, errors, answered, status, retry, meta, tHardcodedUi, connectProviderOpen, onConnectProviderOpenChange, servedModel, stoppedBy, modelOptions, } = props;
1095
+ const { turn, providers, model, errors, answered, status, retry, meta, tHardcodedUi, connectProviderOpen, onConnectProviderOpenChange, servedModel, stoppedBy, modelOptions, projectId, projectSessionId, } = props;
1092
1096
  const { working, response } = model;
1093
1097
  const { turnError, turnErrorRow, turnErrorRowDetails, turnErrorRaw } = errors;
1094
1098
  const { statusPhrase, statusElapsedLabel } = status;
1095
1099
  const { retryInfo, retryMessage, retrySecondsLeft } = retry;
1096
1100
  const { turnEndedAt, turnDurationMs, costInfo } = meta;
1097
- return (_jsxs(_Fragment, { children: [_jsx(TurnBusyRow, { ...props, working: working, turnError: turnError, tHardcodedUi: tHardcodedUi }), turnErrorRow.text && !turn.autoRetry?.continued && (_jsx(TurnErrorDisplay, { errorText: turnErrorRow.text, errorDetails: turnErrorRowDetails, errorRaw: turnErrorRaw, isAbort: turnErrorRow.isAbort, modelOptions: modelOptions })), turnErrorRow.text && !turnErrorRow.isAbort && !turn.autoRetry?.continued && !!turn.autoRetry?.retries && (_jsx(TurnAutoRetryNote, { count: turn.autoRetry.retries })), !working && !turn.autoRetry?.continued && (stoppedBy || errors.turnErrorIsAbort) && _jsx(TurnStoppedBy, { name: stoppedBy ?? undefined }), !working && _jsx(TurnOutcomes, { turnKey: turn.id }), !working && (_jsx(TurnActionBar, { response: response, inlineContentParts: answered.inlineContentParts, turnEndedAt: turnEndedAt, turnDurationMs: turnDurationMs, costInfo: costInfo, servedModel: servedModel, tHardcodedUi: tHardcodedUi })), _jsx(ConnectProviderDialog, { open: connectProviderOpen, onOpenChange: onConnectProviderOpenChange, providers: providers })] }));
1101
+ return (_jsxs(_Fragment, { children: [_jsx(TurnBusyRow, { ...props, working: working, turnError: turnError, tHardcodedUi: tHardcodedUi }), turnErrorRow.text && !turn.autoRetry?.continued && (_jsx(TurnErrorDisplay, { errorText: turnErrorRow.text, errorDetails: turnErrorRowDetails, errorRaw: turnErrorRaw, isAbort: turnErrorRow.isAbort, modelOptions: modelOptions })), turnErrorRow.text && !turnErrorRow.isAbort && !turn.autoRetry?.continued && !!turn.autoRetry?.retries && (_jsx(TurnAutoRetryNote, { count: turn.autoRetry.retries })), !working && !turn.autoRetry?.continued && (stoppedBy || errors.turnErrorIsAbort) && _jsx(TurnStoppedBy, { name: stoppedBy ?? undefined }), !working && _jsx(TurnOutcomes, { turnKey: turn.id }), !working && (_jsx(TurnActionBar, { response: response, inlineContentParts: answered.inlineContentParts, turnEndedAt: turnEndedAt, turnDurationMs: turnDurationMs, costInfo: costInfo, servedModel: servedModel, tHardcodedUi: tHardcodedUi,
1102
+ // A continuation turn's id names a compaction marker, not a user
1103
+ // message, so it has no response of its own to share.
1104
+ share: turn.continues
1105
+ ? undefined
1106
+ : {
1107
+ projectId,
1108
+ sessionId: projectSessionId,
1109
+ turnId: turn.id,
1110
+ } })), _jsx(ConnectProviderDialog, { open: connectProviderOpen, onOpenChange: onConnectProviderOpenChange, providers: providers })] }));
1098
1111
  }
1099
1112
  /** The working turn's waiting row: the retry banner and the busy indicator. */
1100
1113
  function TurnBusyRow(props) {
@@ -1112,7 +1125,7 @@ function TurnBusyRow(props) {
1112
1125
  }
1113
1126
  /** Copy + the turn's settled meta row — the hover-revealed bar at the end of
1114
1127
  * a settled turn. Owns the copy state: it is the only consumer. */
1115
- function TurnActionBar({ response, inlineContentParts, turnEndedAt, turnDurationMs, costInfo, servedModel, tHardcodedUi, }) {
1128
+ function TurnActionBar({ response, inlineContentParts, turnEndedAt, turnDurationMs, costInfo, servedModel, tHardcodedUi, share, }) {
1116
1129
  const [copied, setCopied] = useState(false);
1117
1130
  // ---- Copy response ----
1118
1131
  const handleCopy = async () => {
@@ -1138,7 +1151,7 @@ function TurnActionBar({ response, inlineContentParts, turnEndedAt, turnDuration
1138
1151
  // The browser refused the write; `copied` stays false.
1139
1152
  }
1140
1153
  };
1141
- return (_jsxs("div", { className: "duration-normal flex items-center gap-0.5 opacity-0 transition-opacity group-hover/turn:opacity-100 focus-within:opacity-100 has-[[data-state=open]]:opacity-100 max-md:opacity-100", children: [response ? (_jsx(Button, { variant: "ghost", size: "icon-sm", onClick: handleCopy, "aria-label": copied ? 'Copied' : tHardcodedUi.raw('i18nComplete.textf0f755afea88'), className: "hit-area-3", children: _jsx("span", { className: "relative inline-flex shrink-0 items-center justify-center", children: _jsx(AnimatePresence, { initial: false, mode: "popLayout", children: _jsx(m.span, { initial: { scale: 0.25, opacity: 0, filter: 'blur(4px)' }, animate: { scale: 1, opacity: 1, filter: 'blur(0px)' }, exit: { scale: 0.25, opacity: 0, filter: 'blur(4px)' }, transition: { type: 'spring', duration: 0.3, bounce: 0 }, className: "absolute inset-0 inline-flex items-center justify-center", children: copied ? (_jsx(CheckIcon, { className: "text-muted-foreground size-[1.05rem]" })) : (_jsx(Copy, { className: "text-muted-foreground size-[1.05rem]" })) }, copied ? 'check' : 'copy') }) }) })) : null, _jsx(SessionTurnMeta, { endedAt: turnEndedAt, durationMs: turnDurationMs, cost: costInfo, served: servedModel, className: "flex items-center justify-center" })] }));
1154
+ return (_jsxs("div", { className: "duration-normal flex items-center gap-0.5 opacity-0 transition-opacity group-hover/turn:opacity-100 focus-within:opacity-100 has-[[data-state=open]]:opacity-100 max-md:opacity-100", children: [response ? (_jsx(Button, { variant: "ghost", size: "icon-sm", onClick: handleCopy, "aria-label": copied ? 'Copied' : tHardcodedUi.raw('i18nComplete.textf0f755afea88'), className: "hit-area-3", children: _jsx("span", { className: "relative inline-flex shrink-0 items-center justify-center", children: _jsx(AnimatePresence, { initial: false, mode: "popLayout", children: _jsx(m.span, { initial: { scale: 0.25, opacity: 0, filter: 'blur(4px)' }, animate: { scale: 1, opacity: 1, filter: 'blur(0px)' }, exit: { scale: 0.25, opacity: 0, filter: 'blur(4px)' }, transition: { type: 'spring', duration: 0.3, bounce: 0 }, className: "absolute inset-0 inline-flex items-center justify-center", children: copied ? (_jsx(CheckIcon, { className: "text-muted-foreground size-[1.05rem]" })) : (_jsx(Copy, { className: "text-muted-foreground size-[1.05rem]" })) }, copied ? 'check' : 'copy') }) }) })) : null, response && share ? (_jsx(TurnShareButton, { projectId: share.projectId, sessionId: share.sessionId, turnId: share.turnId })) : null, _jsx(SessionTurnMeta, { endedAt: turnEndedAt, durationMs: turnDurationMs, cost: costInfo, served: servedModel, className: "flex items-center justify-center" })] }));
1142
1155
  }
1143
1156
  function SessionTurnImpl(props) {
1144
1157
  const { turn, turnOutcome, sessionId, sessionStatus, permissions, questions, sessionWorking, isWorkingTurn, awaitingUser, pending, pendingPrompt, interruptedBeforeRun, isCompaction, providers, commandMessages, commands, } = props;
@@ -0,0 +1,16 @@
1
+ export interface TurnShareTarget {
2
+ projectId: string;
3
+ /** The Kortix project session id (`projectSessionId`), not the runtime id. */
4
+ sessionId: string;
5
+ /** The user message id that opens the turn (`SessionLogTurn.id`). */
6
+ turnId: string;
7
+ }
8
+ export declare function turnShareQueryKey({ projectId, sessionId, turnId }: TurnShareTarget): readonly ["turn-share", string, string, string];
9
+ /**
10
+ * The Share icon button of a settled turn's action bar, and the dialog it
11
+ * opens. Renders only where the API would accept the share: a host with public
12
+ * share pages, a turn inside a Kortix session, and a viewer the server says may
13
+ * publish (`can_publish_response === true`, the API's `mayPublishTurn`).
14
+ * Hidden while the session row loads: an unknown answer is not a yes.
15
+ */
16
+ export declare function TurnShareButton({ projectId, sessionId, turnId }: Partial<TurnShareTarget>): import("react").JSX.Element | null;
@@ -0,0 +1,162 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Share ONE assistant response through a public, read-only link.
5
+ *
6
+ * Private by default: the dialog reads the turn's live share
7
+ * (`getTurnShare`) and the "Public link" switch stays off until one exists.
8
+ * The server snapshots the text when it shares (`shareTurn`), with the prompt
9
+ * only when the person picks "Prompt and response". A re-share keeps the token
10
+ * and URL, so changing the scope or "Update link" (after `share.stale`) never
11
+ * breaks a link someone already holds. Turning the link off is destructive and
12
+ * takes a second, explicit click.
13
+ */
14
+ import { getTurnShare, shareTurn, unshareTurn } from '@kortix/sdk';
15
+ import { useProjectSession } from '@kortix/sdk/react';
16
+ import { CheckIcon, ShareNetworkIcon, WarningCircleIcon } from '@phosphor-icons/react';
17
+ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
18
+ import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
19
+ import { useEffect, useRef, useState } from 'react';
20
+ import { Copy } from '../../icons/copy.js';
21
+ import { useTranslations } from '../../i18n/index.js';
22
+ import { cn } from '../../lib/utils.js';
23
+ import { Button } from '../../primitives/button.js';
24
+ import Hint from '../../primitives/hint.js';
25
+ import { Input } from '../../primitives/input.js';
26
+ import { Label } from '../../primitives/label.js';
27
+ import { Modal, ModalContent, ModalTitle } from '../../primitives/modal.js';
28
+ import { RadioGroup } from '../../primitives/radio-group.js';
29
+ import { Separator } from '../../primitives/separator.js';
30
+ import { Switch } from '../../primitives/switch.js';
31
+ import { successToast } from '../../primitives/toast.js';
32
+ import { useUiHostConfig } from '../../providers/ui-provider.js';
33
+ export function turnShareQueryKey({ projectId, sessionId, turnId }) {
34
+ return ['turn-share', projectId, sessionId, turnId];
35
+ }
36
+ /**
37
+ * The server's own message for a failed call, or null. Only an error that
38
+ * carries an HTTP status (`ApiError.status`) came from the server; a network
39
+ * failure's message ("Failed to fetch") is not worth showing.
40
+ */
41
+ function serverMessage(error) {
42
+ const { status, message } = (error ?? {});
43
+ return typeof status === 'number' && typeof message === 'string' && message.trim()
44
+ ? message.trim()
45
+ : null;
46
+ }
47
+ /**
48
+ * The Share icon button of a settled turn's action bar, and the dialog it
49
+ * opens. Renders only where the API would accept the share: a host with public
50
+ * share pages, a turn inside a Kortix session, and a viewer the server says may
51
+ * publish (`can_publish_response === true`, the API's `mayPublishTurn`).
52
+ * Hidden while the session row loads: an unknown answer is not a yes.
53
+ */
54
+ export function TurnShareButton({ projectId, sessionId, turnId }) {
55
+ const t = useTranslations('turnShare');
56
+ const { publicSharesEnabled } = useUiHostConfig();
57
+ const { data: session } = useProjectSession(projectId, sessionId);
58
+ const [open, setOpen] = useState(false);
59
+ if (!publicSharesEnabled || !projectId || !sessionId || !turnId)
60
+ return null;
61
+ if (session?.can_publish_response !== true)
62
+ return null;
63
+ return (_jsxs(_Fragment, { children: [_jsx(Hint, { label: t('shareResponse'), side: "top", children: _jsx(Button, { variant: "ghost", size: "icon-sm", onClick: () => setOpen(true), "aria-label": t('shareResponse'), className: "hit-area-3", children: _jsx(ShareNetworkIcon, { className: "text-muted-foreground size-4" }) }) }), _jsx(Modal, { open: open, onOpenChange: setOpen, children: open ? _jsx(TurnShareDialogContent, { target: { projectId, sessionId, turnId } }) : null })] }));
64
+ }
65
+ function TurnShareDialogContent({ target }) {
66
+ const t = useTranslations('turnShare');
67
+ const queryClient = useQueryClient();
68
+ const key = turnShareQueryKey(target);
69
+ const [error, setError] = useState(null);
70
+ const [copied, setCopied] = useState(false);
71
+ // The scope the person picked; null = whatever the live share says.
72
+ const [pickedIncludePrompt, setPickedIncludePrompt] = useState(null);
73
+ // "Turn off link" waits for this second, explicit click.
74
+ const [confirmingOff, setConfirmingOff] = useState(false);
75
+ const copiedTimer = useRef(null);
76
+ useEffect(() => () => {
77
+ if (copiedTimer.current)
78
+ clearTimeout(copiedTimer.current);
79
+ }, []);
80
+ const query = useQuery({
81
+ queryKey: key,
82
+ queryFn: () => getTurnShare(target.projectId, target.sessionId, target.turnId),
83
+ // A 403 or 404 is a settled answer; retrying it only delays the error line.
84
+ retry: false,
85
+ staleTime: 30_000,
86
+ });
87
+ const share = query.data?.share ?? null;
88
+ const includePrompt = pickedIncludePrompt ?? share?.include_prompt ?? false;
89
+ const copyUrl = async (url) => {
90
+ try {
91
+ await navigator.clipboard.writeText(url);
92
+ setCopied(true);
93
+ if (copiedTimer.current)
94
+ clearTimeout(copiedTimer.current);
95
+ copiedTimer.current = setTimeout(() => setCopied(false), 2000);
96
+ return true;
97
+ }
98
+ catch {
99
+ return false;
100
+ }
101
+ };
102
+ const publish = useMutation({
103
+ mutationFn: ({ includePrompt: include_prompt }) => shareTurn(target.projectId, target.sessionId, target.turnId, { include_prompt }),
104
+ onMutate: () => setError(null),
105
+ onSuccess: async (data, { reason }) => {
106
+ queryClient.setQueryData(key, data);
107
+ setPickedIncludePrompt(null);
108
+ if (reason !== 'share') {
109
+ successToast(t('linkUpdated'));
110
+ return;
111
+ }
112
+ // Sharing is the moment the person wants the link: put it on the clipboard.
113
+ successToast((await copyUrl(data.share.url)) ? t('linkCopied') : t('responseShared'));
114
+ },
115
+ onError: (err, { reason }) => {
116
+ // A failed scope change leaves the live share as it was: show its scope.
117
+ if (reason === 'scope')
118
+ setPickedIncludePrompt(null);
119
+ setError(serverMessage(err) ?? t('shareError'));
120
+ },
121
+ });
122
+ const unpublish = useMutation({
123
+ mutationFn: () => unshareTurn(target.projectId, target.sessionId, target.turnId),
124
+ onMutate: () => setError(null),
125
+ onSuccess: (data) => {
126
+ queryClient.setQueryData(key, data);
127
+ setConfirmingOff(false);
128
+ },
129
+ onError: (err) => setError(serverMessage(err) ?? t('unshareError')),
130
+ });
131
+ const pending = query.isLoading || publish.isPending || unpublish.isPending;
132
+ const shownError = error ?? (query.isError ? (serverMessage(query.error) ?? t('loadError')) : null);
133
+ const pickScope = (value) => {
134
+ const next = value === 'prompt';
135
+ if (next === includePrompt)
136
+ return;
137
+ setPickedIncludePrompt(next);
138
+ // Private: the pick waits for the switch. Public: re-share under the same URL.
139
+ if (share)
140
+ publish.mutate({ includePrompt: next, reason: 'scope' });
141
+ };
142
+ return (_jsx(ModalContent, { className: "space-y-0 lg:max-w-lg", children: _jsxs("div", { className: "flex flex-col gap-5 p-5", children: [_jsx(ModalTitle, { className: "pr-10 text-lg font-medium", children: t('shareResponse') }), _jsxs("div", { className: "space-y-2.5", children: [_jsx(Label, { id: "turn-share-scope", children: t('whatToInclude') }), _jsxs(RadioGroup, { "aria-labelledby": "turn-share-scope", value: includePrompt ? 'prompt' : 'response', onValueChange: pickScope, disabled: pending, className: "grid grid-cols-1 gap-2.5 sm:grid-cols-2", children: [_jsx(ScopeTile, { value: "response", title: t('responseOnly'), hint: t('responseOnlyHint'), withPrompt: false }), _jsx(ScopeTile, { value: "prompt", title: t('promptAndResponse'), hint: t('promptAndResponseHint'), withPrompt: true })] })] }), _jsx(Separator, {}), _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(Label, { htmlFor: "turn-share-public", children: t('publicLink') }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('publicLinkHint') })] }), _jsx(Switch, { id: "turn-share-public", checked: !!share && !confirmingOff, disabled: pending, "aria-busy": pending || undefined, onCheckedChange: (on) => {
143
+ if (on && confirmingOff)
144
+ setConfirmingOff(false);
145
+ else if (on)
146
+ publish.mutate({ includePrompt, reason: 'share' });
147
+ else if (share)
148
+ setConfirmingOff(true);
149
+ } })] }), share && confirmingOff ? (_jsxs("div", { role: "group", "aria-label": t('turnOffLink'), className: "flex flex-wrap items-center justify-between gap-2", children: [_jsx("p", { className: "text-muted-foreground text-xs", children: t('stopNote') }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { variant: "outline-ghost", size: "xs", disabled: pending, onClick: () => setConfirmingOff(false), children: t('cancel') }), _jsx(Button, { variant: "destructive", size: "xs", disabled: pending, onClick: () => unpublish.mutate(), children: t('turnOffLink') })] })] })) : null, share && !confirmingOff ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex gap-2", children: [_jsx(Input, { readOnly: true, "aria-label": t('publicLink'), value: share.url, onFocus: (event) => event.currentTarget.select() }), _jsxs(Button, { className: "shrink-0", disabled: pending, onClick: () => void copyUrl(share.url).then((ok) => !ok && setError(t('copyError'))), children: [copied ? (_jsx(CheckIcon, { className: "size-4 shrink-0" })) : (_jsx(Copy, { className: "size-4 shrink-0" })), copied ? t('copied') : t('copyLink')] })] }), share.stale ? (_jsxs("p", { className: "text-muted-foreground flex flex-wrap items-center gap-1 text-xs", children: [t('stale'), " \u00B7", _jsx(Button, { variant: "link", size: "xs", className: "h-auto px-0 text-xs", disabled: pending, onClick: () => publish.mutate({ includePrompt, reason: 'update' }), children: t('updateLink') })] })) : null] })) : null, shownError ? (_jsxs("p", { role: "alert", className: "text-foreground flex items-start gap-2 text-xs text-pretty", children: [_jsx(WarningCircleIcon, { weight: "fill", className: "text-kortix-red mt-0.5 size-4 shrink-0" }), shownError] })) : null] })] }) }));
150
+ }
151
+ /** Widths of the skeleton text lines, longest first. */
152
+ const RESPONSE_LINES = ['w-full', 'w-11/12', 'w-2/3', 'w-5/6', 'w-1/2'];
153
+ const RESPONSE_LINES_UNDER_PROMPT = ['w-full', 'w-5/6', 'w-2/3'];
154
+ /**
155
+ * One scope choice: a skeleton of what the reader sees, a title and a hint.
156
+ * The prompt variant draws the prompt bubble top-right, where the transcript
157
+ * puts it. Outer `rounded-xl` minus the `p-2` inset gives the preview's
158
+ * `rounded-sm` (14 - 7.4 ≈ 6.6px), so the corners stay concentric.
159
+ */
160
+ function ScopeTile({ value, title, hint, withPrompt, }) {
161
+ return (_jsxs(RadioGroupPrimitive.Item, { value: value, className: cn('border-border flex flex-col gap-2.5 rounded-xl border p-2 text-left', 'hover:bg-hover transition-colors', 'data-[state=checked]:border-foreground', 'focus-visible:ring-ring outline-none focus-visible:ring-2', 'disabled:pointer-events-none disabled:opacity-50'), children: [_jsxs("span", { "aria-hidden": "true", className: "bg-background flex h-24 flex-col gap-1.5 rounded-sm p-3", children: [withPrompt ? _jsx("span", { className: "bg-muted ml-auto h-4 w-3/5 rounded-sm" }) : null, (withPrompt ? RESPONSE_LINES_UNDER_PROMPT : RESPONSE_LINES).map((width, index) => (_jsx("span", { className: cn('bg-border h-1.5 rounded-full', width) }, index)))] }), _jsxs("span", { className: "flex flex-col gap-0.5 px-1 pb-1", children: [_jsx("span", { className: "text-foreground text-sm font-medium", children: title }), _jsx("span", { className: "text-muted-foreground text-xs", children: hint })] })] }));
162
+ }
@@ -1,2 +1,3 @@
1
1
  import type { ToolProps } from '../shared/types.js';
2
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
2
3
  export declare function ApplyPatchTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
@@ -20,6 +20,7 @@ const PATCH_ICON = {
20
20
  delete: FileMinusIcon,
21
21
  edit: PencilSimpleIcon,
22
22
  };
23
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
23
24
  export function ApplyPatchTool({ call, defaultOpen, forceOpen, locked }) {
24
25
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
25
26
  const patchTypeStyle = useLocalizedUiCatalog(PATCH_TYPE_STYLE);
@@ -1,2 +1,3 @@
1
1
  import type { ToolProps } from '../shared/types.js';
2
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
2
3
  export declare function PtyKillTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
@@ -7,6 +7,7 @@ import { stripMarkupForToolOutput } from '../../../_vendor/kortix-shared.js';
7
7
  import { TerminalWindowIcon as Terminal } from '@phosphor-icons/react';
8
8
  import { useTranslations } from '../../../i18n/index.js';
9
9
  import { useMemo } from 'react';
10
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
10
11
  export function PtyKillTool({ call, defaultOpen, forceOpen, locked }) {
11
12
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
12
13
  const input = partInput(call);
@@ -12,10 +12,12 @@ import type { ToolProps } from '../shared/types.js';
12
12
  * actually appears, while re-creating inline the nested-scroll wheel trap the
13
13
  * comment further down records. Folding works on both surfaces: the tail stays
14
14
  * visible, the history is one click away, and no second scroller is created.
15
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
15
16
  */
16
17
  export declare function splitTerminalBuffer(content: string): {
17
18
  earlier: string;
18
19
  tail: string;
19
20
  earlierCount: number;
20
21
  };
22
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
21
23
  export declare function PtyReadTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
@@ -32,6 +32,7 @@ const VISIBLE_TAIL_LINES = 24;
32
32
  * actually appears, while re-creating inline the nested-scroll wheel trap the
33
33
  * comment further down records. Folding works on both surfaces: the tail stays
34
34
  * visible, the history is one click away, and no second scroller is created.
35
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
35
36
  */
36
37
  export function splitTerminalBuffer(content) {
37
38
  const lines = content ? content.split('\n') : [];
@@ -44,6 +45,7 @@ export function splitTerminalBuffer(content) {
44
45
  earlierCount: cut,
45
46
  };
46
47
  }
48
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
47
49
  export function PtyReadTool({ call, defaultOpen, forceOpen, locked }) {
48
50
  const tHardcodedUi = useTranslations('hardcodedUi');
49
51
  const input = partInput(call);
@@ -1,2 +1,3 @@
1
1
  import type { ToolProps } from '../shared/types.js';
2
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
2
3
  export declare function PtySpawnTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
@@ -10,6 +10,7 @@ import { ptySpawnedBody } from '../../../_vendor/kortix-shared.js';
10
10
  import { TerminalWindowIcon as Terminal } from '@phosphor-icons/react';
11
11
  import { useTranslations } from '../../../i18n/index.js';
12
12
  import { useMemo } from 'react';
13
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
13
14
  export function PtySpawnTool({ call, defaultOpen, forceOpen, locked }) {
14
15
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
15
16
  const input = partInput(call);
@@ -1,2 +1,3 @@
1
1
  import type { ToolProps } from '../shared/types.js';
2
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
2
3
  export declare function PtyWriteTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
@@ -5,6 +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 in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
8
9
  export function PtyWriteTool({ call, defaultOpen, forceOpen, locked }) {
9
10
  const tHardcodedUi = useTranslations('hardcodedUi');
10
11
  const input = partInput(call);
@@ -1,2 +1,3 @@
1
1
  import type { ToolProps } from '../shared/types.js';
2
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
2
3
  export declare function TodoWriteTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
@@ -9,6 +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 in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
12
13
  export function TodoWriteTool({ call, defaultOpen, forceOpen, locked }) {
13
14
  const tI18nHardcoded = useTranslations('hardcodedUi');
14
15
  const input = partInput(call);
@@ -9,6 +9,7 @@ import { useTranslations } from '../../i18n/index.js';
9
9
  import { useProjectSessionHref } from '../../internal/lib/navigation/session-href.js';
10
10
  import { CheckIcon } from '@phosphor-icons/react';
11
11
  import { KortixLogo } from '../../primitives/kortix-logo.js';
12
+ import { AgentMark } from '../../internal/components/agent-mark.js';
12
13
  import { SourceCard, SourcePill } from './source-pill.js';
13
14
  /** The sending session's name, as a link to it when the project route resolves. */
14
15
  function SenderName({ sessionId, name }) {
@@ -23,7 +24,7 @@ export function MessageAuthorLabel({ author }) {
23
24
  if (author.kind === 'session') {
24
25
  return _jsx(SessionAuthorLabel, { author: author });
25
26
  }
26
- return (_jsxs("span", { className: "text-muted-foreground flex items-center gap-1.5 text-xs font-medium", "data-testid": "message-author", children: [_jsx(UserAvatar, { email: author.email ?? '', name: author.name, size: "xs" }), author.name] }));
27
+ return (_jsxs("span", { className: "text-muted-foreground flex items-center gap-1.5 text-xs font-medium", "data-testid": "message-author", children: [_jsx(UserAvatar, { email: author.email ?? '', name: author.name, hint: author.name, size: "xs" }), author.name] }));
27
28
  }
28
29
  /**
29
30
  * A prompt another Kortix session sent (`kortix sessions new`, a coordinator,
@@ -43,7 +44,10 @@ function SessionAuthorLabel({ author }) {
43
44
  label: tI18nComplete('text6959b4159575'),
44
45
  value: _jsx(SenderName, { sessionId: author.session_id, name: sessionName }),
45
46
  },
46
- { label: tI18nComplete('text11b39c93777e'), value: author.agent },
47
+ {
48
+ label: tI18nComplete('text11b39c93777e'),
49
+ value: author.agent ? (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx(AgentMark, { slug: author.agent }), author.agent] })) : null,
50
+ },
47
51
  {
48
52
  label: tI18nComplete('textcb9ac5c561da'),
49
53
  value: author.session_id ? _jsx(CopySessionId, { sessionId: author.session_id }) : null,
@@ -27,6 +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 in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
30
31
  */
31
32
  export declare function isPlanWriteTool(tool: string): boolean;
32
33
  /**
@@ -80,6 +81,7 @@ export interface PlanSurfaceState {
80
81
  * whether the panel is OPEN deliberately does not enter into it. */
81
82
  isMobile: boolean;
82
83
  }
84
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
83
85
  export declare function planBelongsToChat(state: PlanSurfaceState): boolean;
84
86
  /**
85
87
  * The anchor the CHAT should use — which is "none" unless the chat is the
@@ -88,5 +90,6 @@ export declare function planBelongsToChat(state: PlanSurfaceState): boolean;
88
90
  * The gate wraps the lookup rather than sitting beside it: returning `null` (which matches no message id) means every `ownsPlan`
89
91
  * downstream, including the user bubble's own column cap, falls out of ONE
90
92
  * decision instead of two that can disagree.
93
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
91
94
  */
92
95
  export declare function chatPlanAnchorId(turns: ReadonlyArray<Pick<SessionLogTurn, 'id' | 'plan'>> | null | undefined, chatOwnsPlan: boolean): string | null;
@@ -27,6 +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 in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
30
31
  */
31
32
  export function isPlanWriteTool(tool) {
32
33
  return toolKind(tool) === 'todowrite' && shouldShowToolPart({ tool });
@@ -41,6 +42,7 @@ export function isPlanWriteTool(tool) {
41
42
  export function planAnchorMessageId(turns) {
42
43
  return turns.find((turn) => turn.plan)?.id ?? null;
43
44
  }
45
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
44
46
  export function planBelongsToChat(state) {
45
47
  return state.isMobile;
46
48
  }
@@ -51,6 +53,7 @@ export function planBelongsToChat(state) {
51
53
  * The gate wraps the lookup rather than sitting beside it: returning `null` (which matches no message id) means every `ownsPlan`
52
54
  * downstream, including the user bubble's own column cap, falls out of ONE
53
55
  * decision instead of two that can disagree.
56
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
54
57
  */
55
58
  export function chatPlanAnchorId(turns, chatOwnsPlan) {
56
59
  if (!chatOwnsPlan || !turns)
@@ -28,6 +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 in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
31
32
  */
32
33
  export declare function PlanRing({ done, total, running, className, }: {
33
34
  done: number;
@@ -43,8 +44,10 @@ export declare function PlanRing({ done, total, running, className, }: {
43
44
  * when a plan sits under it, and `ownsPlan` alone is not that answer: the anchor
44
45
  * falls back to the last turn when no turn ever wrote todos, so a session with
45
46
  * zero todos still nominates an owner.
47
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
46
48
  */
47
49
  export declare function useHasPlan(sessionId: string): boolean;
50
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
48
51
  export declare function planSummary(todos: ReadonlyArray<{
49
52
  status: string;
50
53
  content: string;
@@ -71,6 +74,7 @@ export declare function planSummary(todos: ReadonlyArray<{
71
74
  * Filtering AFTER `keyTodos` is deliberate. Keying first means the surviving
72
75
  * rows keep the keys they had while the running row was present, so React's
73
76
  * state stays attached to a row as the agent advances past it.
77
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
74
78
  */
75
79
  export declare function planListTodos(keyed: ReadonlyArray<{
76
80
  todo: TodoItem;
@@ -84,11 +88,13 @@ export declare function planListTodos(keyed: ReadonlyArray<{
84
88
  * repeats a line often enough ("Run the tests" twice) that keying on it alone
85
89
  * collides. An occurrence counter disambiguates the repeat, which keeps React's
86
90
  * state attached to the row rather than to its position.
91
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
87
92
  */
88
93
  export declare function keyTodos(todos: ReadonlyArray<TodoItem>): Array<{
89
94
  todo: TodoItem;
90
95
  key: string;
91
96
  }>;
97
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
92
98
  export declare function PlanCard({ sessionId }: {
93
99
  sessionId: string;
94
100
  }): import("react").JSX.Element | null;
@@ -103,6 +109,7 @@ export declare function PlanCard({ sessionId }: {
103
109
  *
104
110
  * Takes rows already keyed and filtered (`planListTodos(keyTodos(todos))`) —
105
111
  * the caller decides what the list is; this decides what it looks like.
112
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
106
113
  */
107
114
  export declare function PlanSteps({ rows, className, }: {
108
115
  rows: ReadonlyArray<{
@@ -200,6 +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 in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
203
204
  */
204
205
  export function PlanRing({ done, total, running, className, }) {
205
206
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
@@ -221,11 +222,13 @@ export function PlanRing({ done, total, running, className, }) {
221
222
  * when a plan sits under it, and `ownsPlan` alone is not that answer: the anchor
222
223
  * falls back to the last turn when no turn ever wrote todos, so a session with
223
224
  * zero todos still nominates an owner.
225
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
224
226
  */
225
227
  export function useHasPlan(sessionId) {
226
228
  const { data } = useRuntimeSessionTodo(sessionId);
227
229
  return parseTodos(data).length > 0;
228
230
  }
231
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
229
232
  export function planSummary(todos) {
230
233
  const total = todos.length;
231
234
  const done = todos.filter((todo) => todo.status === 'completed').length;
@@ -255,6 +258,7 @@ export function planSummary(todos) {
255
258
  * Filtering AFTER `keyTodos` is deliberate. Keying first means the surviving
256
259
  * rows keep the keys they had while the running row was present, so React's
257
260
  * state stays attached to a row as the agent advances past it.
261
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
258
262
  */
259
263
  export function planListTodos(keyed) {
260
264
  return keyed.filter(({ todo }) => todo.status !== 'in_progress');
@@ -264,6 +268,7 @@ export function planListTodos(keyed) {
264
268
  * repeats a line often enough ("Run the tests" twice) that keying on it alone
265
269
  * collides. An occurrence counter disambiguates the repeat, which keeps React's
266
270
  * state attached to the row rather than to its position.
271
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
267
272
  */
268
273
  export function keyTodos(todos) {
269
274
  const seen = new Map();
@@ -273,6 +278,7 @@ export function keyTodos(todos) {
273
278
  return { todo, key: n === 0 ? todo.content : `${todo.content}#${n}` };
274
279
  });
275
280
  }
281
+ /** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
276
282
  export function PlanCard({ sessionId }) {
277
283
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
278
284
  const { data } = useRuntimeSessionTodo(sessionId);
@@ -306,6 +312,7 @@ export function PlanCard({ sessionId }) {
306
312
  *
307
313
  * Takes rows already keyed and filtered (`planListTodos(keyTodos(todos))`) —
308
314
  * the caller decides what the list is; this decides what it looks like.
315
+ * @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
309
316
  */
310
317
  export function PlanSteps({ rows, className, }) {
311
318
  return (