@kortix/ui 0.15.9 → 0.15.11
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 +467 -2
- package/dist/_vendor/shared/app-config.d.ts +6 -30
- package/dist/_vendor/shared/channel-descriptors.d.ts +0 -34
- package/dist/_vendor/shared/channel-header.d.ts +2 -1
- package/dist/_vendor/shared/connector-sections.d.ts +0 -25
- package/dist/_vendor/shared/file-tags.d.ts +2 -1
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/pasted-content.d.ts +0 -4
- package/dist/_vendor/shared/pixel-mark.d.ts +0 -17
- package/dist/_vendor/shared/project-glyphs.d.ts +0 -1
- package/dist/_vendor/shared/session/attachment-tile.d.ts +32 -0
- package/dist/_vendor/shared/session/stop-refusal.d.ts +15 -0
- package/dist/_vendor/shared/session/tool-row-text.d.ts +58 -0
- package/dist/_vendor/shared/session-delivery.d.ts +2 -0
- package/dist/customize/agents/agent-model-view.d.ts +11 -1
- package/dist/customize/agents/agent-model-view.js +12 -1
- package/dist/customize/agents/agent-page.js +19 -6
- package/dist/customize/agents/agent-tabs.d.ts +2 -0
- package/dist/customize/agents/agent-tabs.js +2 -0
- package/dist/customize/connectors/connectors-page.js +1 -1
- package/dist/customize/connectors/detail/connector-page.js +9 -4
- package/dist/customize/connectors/detail/connector-triggers.js +1 -1
- package/dist/customize/connectors/install/use-install.js +1 -1
- package/dist/customize/connectors/use-agent-access.d.ts +1 -0
- package/dist/customize/providers/provider-accordion.js +5 -5
- package/dist/customize/providers/provider-connect.d.ts +3 -3
- package/dist/customize/providers/provider-connect.js +8 -16
- package/dist/customize/providers/provider-sheet.js +4 -4
- package/dist/customize/sections/component/teams-byo-wizard.js +4 -1
- package/dist/customize/sections/connector-connection-form.d.ts +0 -1
- package/dist/customize/sections/connector-connection-form.js +0 -9
- package/dist/customize/sections/view/review-center-connected.js +7 -3
- package/dist/customize/settings/tabs/workspace-keys.js +53 -11
- package/dist/customize/shared/feature-gate-screen.js +1 -1
- package/dist/customize/triggers/runtime-triggers.js +13 -2
- package/dist/customize/triggers/schedule/event-account-picker.js +1 -1
- package/dist/customize/triggers/schedule/event-trigger-copy.js +1 -1
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +5 -4
- package/dist/customize/triggers/schedule/then-fields.d.ts +5 -1
- package/dist/customize/triggers/schedule/then-fields.js +23 -3
- package/dist/customize/triggers/schedule/trigger-callouts.js +1 -1
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +27 -0
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +51 -5
- package/dist/customize/triggers/schedule/trigger-composer.js +19 -13
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +25 -5
- package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -3
- package/dist/customize/triggers/schedule/trigger-filter.js +7 -6
- package/dist/customize/triggers/schedule/trigger-readonly.js +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -1
- package/dist/customize/triggers/schedule/use-event-app-connect.js +2 -1
- package/dist/customize/triggers/schedule/when-event.js +1 -1
- package/dist/customize/triggers/schedule/when-schedule.d.ts +5 -1
- package/dist/customize/triggers/schedule/when-schedule.js +16 -1
- package/dist/customize/triggers/schedule-view.js +4 -2
- package/dist/i18n/en.d.ts +56 -7
- package/dist/i18n/en.js +65 -16
- package/dist/internal/billing/compute-pricing.d.ts +7 -1
- package/dist/internal/billing/compute-pricing.js +7 -1
- package/dist/internal/hooks/connectors/invalidate-connections.d.ts +10 -0
- package/dist/internal/hooks/connectors/invalidate-connections.js +18 -0
- package/dist/internal/hooks/connectors/use-finish-sign-in.js +1 -1
- package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +1 -1
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +1 -1
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +2 -0
- package/dist/internal/hooks/projects/use-new-project-session.js +4 -1
- package/dist/internal/hooks/use-review-session-summary.d.ts +1 -1
- package/dist/internal/hooks/use-review-session-summary.js +1 -1
- package/dist/internal/layout/project-settings-nav.d.ts +17 -0
- package/dist/internal/layout/project-settings-nav.js +24 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +2 -2
- package/dist/internal/lib/capability-tab-routes.d.ts +8 -0
- package/dist/internal/lib/capability-tab-routes.js +11 -0
- package/dist/internal/notifications/notification-inbox.d.ts +4 -10
- package/dist/internal/notifications/notification-inbox.js +8 -9
- package/dist/internal/stores/composer-prefill-store.d.ts +7 -0
- package/dist/internal/stores/composer-prefill-store.js +1 -0
- package/dist/internal/stores/connector-gate-store.d.ts +3 -1
- package/dist/internal/stores/connector-gate-store.js +13 -3
- package/dist/internal/stores/upgrade-dialog-store.d.ts +4 -0
- package/dist/internal/stores/upgrade-dialog-store.js +2 -0
- package/dist/lib/routes.d.ts +4 -11
- package/dist/lib/routes.js +3 -5
- package/dist/markdown/unified-markdown-utils.d.ts +7 -0
- package/dist/markdown/unified-markdown-utils.js +19 -0
- package/dist/markdown/unified-markdown.js +16 -3
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/dialog.js +3 -1
- package/dist/primitives/drawer.js +1 -1
- package/dist/primitives/modal.js +1 -1
- package/dist/primitives/preview-image.js +1 -1
- package/dist/primitives/sheet.js +1 -1
- package/dist/session/actions/session-label.js +2 -2
- package/dist/session/agents/agent-strip.d.ts +10 -5
- package/dist/session/agents/agent-strip.js +40 -12
- package/dist/session/agents/held-messages.d.ts +6 -2
- package/dist/session/agents/held-messages.js +6 -3
- package/dist/session/composer/ComposerCard.js +8 -3
- package/dist/session/composer/agent-selector.d.ts +2 -0
- package/dist/session/composer/agent-selector.js +5 -0
- package/dist/session/composer/attachment-tile.d.ts +2 -26
- package/dist/session/composer/attachment-tile.js +3 -47
- package/dist/session/composer/composer-chat-input.d.ts +3 -1
- package/dist/session/composer/composer-chat-input.js +2 -2
- package/dist/session/composer/composer-logic.d.ts +7 -0
- package/dist/session/composer/composer-logic.js +18 -0
- package/dist/session/composer/composer-reset.d.ts +8 -14
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer.d.ts +9 -0
- package/dist/session/composer/composer.js +22 -11
- package/dist/session/composer/draft/home-composer-focus-handoff.d.ts +7 -0
- package/dist/session/composer/draft/home-composer-focus-handoff.js +94 -0
- package/dist/session/composer/draft/use-composer-draft.d.ts +3 -1
- package/dist/session/composer/draft/use-composer-draft.js +22 -2
- package/dist/session/composer/editor/composer-editor.d.ts +4 -2
- package/dist/session/composer/editor/composer-editor.js +13 -7
- package/dist/session/composer/hooks/use-composer-focus.js +4 -2
- package/dist/session/header/session-site-header.d.ts +3 -1
- package/dist/session/header/session-site-header.js +3 -2
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.js +1 -0
- package/dist/session/models/chatgpt-connection-button.js +5 -9
- package/dist/session/models/connect-model-step.d.ts +29 -0
- package/dist/session/models/connect-model-step.js +50 -0
- package/dist/session/models/model-connection-gate.d.ts +2 -1
- package/dist/session/models/model-connection-gate.js +6 -3
- package/dist/session/models/model-connection-layout.d.ts +2 -0
- package/dist/session/models/model-connection-layout.js +4 -0
- package/dist/session/models/model-selector.d.ts +1 -1
- package/dist/session/models/model-selector.js +9 -6
- package/dist/session/models/subscription-offer.d.ts +4 -0
- package/dist/session/models/subscription-offer.js +11 -3
- package/dist/session/models/use-workspace-model-gate.d.ts +11 -0
- package/dist/session/models/use-workspace-model-gate.js +62 -0
- package/dist/session/models/workspace-model-gate.d.ts +46 -0
- package/dist/session/models/workspace-model-gate.js +66 -0
- package/dist/session/overrides/session-overrides-toolbar.js +2 -4
- package/dist/session/prompts/ask-deck.d.ts +5 -1
- package/dist/session/prompts/ask-deck.js +15 -3
- package/dist/session/prompts/question-labels.d.ts +16 -0
- package/dist/session/prompts/question-labels.js +34 -0
- package/dist/session/prompts/question-prompt.js +6 -6
- package/dist/session/prompts/session-connect-card.d.ts +63 -0
- package/dist/session/prompts/{session-connect-prompt.js → session-connect-card.js} +53 -42
- package/dist/session/status/provisioning-failure.d.ts +23 -2
- package/dist/session/status/provisioning-failure.js +53 -3
- package/dist/session/status/stop-refusal.d.ts +6 -12
- package/dist/session/status/stop-refusal.js +6 -19
- package/dist/session/thread/agent-run-props.d.ts +19 -0
- package/dist/session/thread/agent-run-props.js +54 -0
- package/dist/session/thread/session-chat.js +317 -298
- package/dist/session/thread/transcript.d.ts +19 -2
- package/dist/session/thread/transcript.js +93 -25
- package/dist/session/tool/tool-part-renderer.js +7 -2
- package/dist/session/tool/tools/bash-tool.d.ts +3 -52
- package/dist/session/tool/tools/bash-tool.js +3 -86
- package/dist/session/tool/tools/kortix-action-tool.js +10 -2
- package/dist/session/turn/answer-streaming.d.ts +21 -0
- package/dist/session/turn/answer-streaming.js +34 -0
- package/dist/session/turn/queued-prompt-bubbles.d.ts +5 -0
- package/dist/session/turn/queued-prompt-bubbles.js +12 -0
- package/dist/session/turn/turn-viewport.d.ts +66 -10
- package/dist/session/turn/turn-viewport.js +92 -12
- package/dist/session/turn/turn-work-accordion.d.ts +3 -1
- package/dist/session/turn/turn-work-accordion.js +2 -2
- package/dist/session/turn/user-message.js +7 -5
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +56 -7
- package/dist/workspace/admin/project-admin-dashboard.js +2 -4
- package/dist/workspace/home/existing-repo-setup-prompt.d.ts +5 -8
- package/dist/workspace/home/existing-repo-setup-prompt.js +16 -42
- package/dist/workspace/home/first-chat.d.ts +7 -1
- package/dist/workspace/home/first-chat.js +12 -5
- package/dist/workspace/home/no-agent-home.d.ts +3 -1
- package/dist/workspace/home/no-agent-home.js +2 -2
- package/dist/workspace/inbox/workspace-inbox.d.ts +6 -16
- package/dist/workspace/inbox/workspace-inbox.js +9 -51
- package/dist/workspace/layout/project-home.js +17 -16
- package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
- package/dist/workspace/layout/use-project-home-send.js +29 -15
- package/dist/workspace/new/advanced-fields.d.ts +4 -1
- package/dist/workspace/new/advanced-fields.js +2 -2
- package/dist/workspace/new/workspace-name.d.ts +9 -0
- package/dist/workspace/new/workspace-name.js +20 -0
- package/dist/workspace/projects/session-starter.d.ts +6 -4
- package/dist/workspace/projects/session-starter.js +8 -14
- package/dist/workspace/review/review-center.d.ts +6 -2
- package/dist/workspace/review/review-center.js +45 -25
- package/dist/workspace/sidebar/session-grouping.d.ts +1 -1
- package/dist/workspace/sidebar/session-grouping.js +1 -1
- package/dist/workspace/sidebar/workspace-menu-model.d.ts +3 -5
- package/dist/workspace/sidebar/workspace-menu-model.js +1 -1
- package/dist/workspace/spaces/space-details-panel.js +2 -2
- package/dist/workspace/spaces/space-triggers.js +2 -2
- package/dist/workspace/spaces/space-view.js +11 -5
- package/package.json +15 -7
- package/skills/kortix-ui/references/modules.md +1 -1
- package/dist/customize/connectors/invalidate-connections.d.ts +0 -2
- package/dist/customize/connectors/invalidate-connections.js +0 -4
- package/dist/internal/notifications/use-inbox-summary.d.ts +0 -17
- package/dist/internal/notifications/use-inbox-summary.js +0 -28
- package/dist/session/prompts/session-connect-prompt.d.ts +0 -40
|
@@ -124,31 +124,6 @@ export declare function groupIntoSections<T>(items: readonly T[], getCategories:
|
|
|
124
124
|
* Reached through `sectionTitle` for anything no curated section claimed.
|
|
125
125
|
*/
|
|
126
126
|
export declare function humanizeCategory(raw: string): string;
|
|
127
|
-
/**
|
|
128
|
-
* The tools a person browsing a category should meet first, in the order they
|
|
129
|
-
* should meet them.
|
|
130
|
-
*
|
|
131
|
-
* **Why a hand-written list.** The catalogue is ~5,758 apps and the feed's own
|
|
132
|
-
* order is not an editorial judgement — it is whatever the provider returns.
|
|
133
|
-
* Left alone, a category's first six cards are arbitrary, and someone who does
|
|
134
|
-
* not already know the space cannot tell a household name from a long-tail
|
|
135
|
-
* entry. These lists put the recognisable ones in front.
|
|
136
|
-
*
|
|
137
|
-
* **Keys are `CURATED_SECTIONS` keys**, not a second vocabulary — a key that
|
|
138
|
-
* is not a real section is a test failure, so this cannot drift into naming
|
|
139
|
-
* sections that no longer exist.
|
|
140
|
-
*
|
|
141
|
-
* **Entries are matched against an app's folded slug OR its folded name**, so
|
|
142
|
-
* one token covers both catalogues. An entry that matches nothing is inert: it
|
|
143
|
-
* pins nothing, hides nothing, and cannot duplicate a card. That is the whole
|
|
144
|
-
* safety story for a list written from product knowledge rather than from a
|
|
145
|
-
* catalogue dump — being wrong costs a pin, never a render.
|
|
146
|
-
*
|
|
147
|
-
* An app only reaches a section if the FEED puts it in that category, so
|
|
148
|
-
* pinning `slack` under both communication and productivity is not a conflict;
|
|
149
|
-
* whichever section Slack actually lands in is the one where its pin applies.
|
|
150
|
-
*/
|
|
151
|
-
export declare const CATEGORY_PICKS: Record<string, readonly string[]>;
|
|
152
127
|
/** Sorts after every pinned entry. `Number.MAX_SAFE_INTEGER` rather than
|
|
153
128
|
* `Infinity` so the subtraction in the comparator stays a real number —
|
|
154
129
|
* `Infinity - Infinity` is `NaN`, and a `NaN` comparator silently leaves the
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* non-overlapping, in order. `attrs` is the attribute text without its leading
|
|
18
18
|
* whitespace, as the regex's first group was.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
interface FileTagBlock {
|
|
21
21
|
/** Index of `<file`. */
|
|
22
22
|
index: number;
|
|
23
23
|
/** Index just past `</file>`. */
|
|
@@ -26,3 +26,4 @@ export interface FileTagBlock {
|
|
|
26
26
|
attrs: string;
|
|
27
27
|
}
|
|
28
28
|
export declare function fileTagBlocks(text: string): FileTagBlock[];
|
|
29
|
+
export {};
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/** Chat pastes at or above this length become a "Pasted text" tile. */
|
|
2
|
-
export declare const PASTE_TILE_MIN_CHARS = 1000;
|
|
3
|
-
/** Chat pastes with more lines than this become a tile. */
|
|
4
|
-
export declare const PASTE_TILE_MIN_LINES = 10;
|
|
5
1
|
/** Inline tiles may add at most this many UTF-8 bytes to a prompt; larger pastes go out as a file. */
|
|
6
2
|
export declare const PASTED_INLINE_MAX_BYTES = 100000;
|
|
7
3
|
export type PastedContent = {
|
|
@@ -9,24 +9,7 @@
|
|
|
9
9
|
* are plain text, the same width, and symmetric on both axes.
|
|
10
10
|
*/
|
|
11
11
|
export declare const PIXEL_KORTIX_ROWS: readonly ["## ## ##", "## ## ##", "+#+ ## +#+", " ##+ ## +## ", " ######## ", " ######## ", " ##+ ## +## ", "+#+ ## +#+", "## ## ##", "## ## ##"];
|
|
12
|
-
/**
|
|
13
|
-
* An agent's pixel mark: a 7×7 mirrored pixel figure derived from its slug.
|
|
14
|
-
*
|
|
15
|
-
* Same slug, same mark, on every surface and every device. Nothing is stored:
|
|
16
|
-
* the slug is hashed (FNV-1a), the hash seeds a PRNG (mulberry32), the PRNG
|
|
17
|
-
* fills the left half of the grid against a density mask, and the half is
|
|
18
|
-
* mirrored. A draw that fails the quality gate is redrawn from a salted seed,
|
|
19
|
-
* so retries stay deterministic. The tone comes from a second hash.
|
|
20
|
-
*
|
|
21
|
-
* This is the shape, one copy for every host: web (`@kortix/ui` `pixelMark`,
|
|
22
|
-
* which adds the tile tone) and mobile (`AgentPixelMark`, theme ink).
|
|
23
|
-
*
|
|
24
|
-
* Changing SIZE, MASK, the gate or PALETTES changes every agent's mark — the
|
|
25
|
-
* golden test in `pixel-mark.test.ts` exists to make that a deliberate act.
|
|
26
|
-
*/
|
|
27
|
-
export declare const PIXEL_MARK_SIZE = 7;
|
|
28
12
|
type Grid = boolean[][];
|
|
29
|
-
export declare function fnv1a(input: string): number;
|
|
30
13
|
/** Readable at 14px, fills the frame, one connected body. */
|
|
31
14
|
export declare function passesPixelMarkGate(grid: Grid): boolean;
|
|
32
15
|
export declare function pixelMarkShape(slug: string): {
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
* `KortixDither` the vector symbol through an 8 x 8 Bayer dither. The web
|
|
32
32
|
* registry draws them with its own components.
|
|
33
33
|
*/
|
|
34
|
-
export declare const KORTIX_GLYPH_NAMES: readonly ["KortixMark", "KortixPixel", "KortixDither"];
|
|
35
34
|
export declare const PROJECT_GLYPH_GROUPS: readonly [{
|
|
36
35
|
readonly label: "Kortix";
|
|
37
36
|
readonly names: readonly ["KortixMark", "KortixPixel", "KortixDither"];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure rules of an attachment tile. Both hosts
|
|
3
|
+
* (`packages/ui/src/session/composer/attachment-tile.tsx`,
|
|
4
|
+
* `apps/mobile/lib/session/attachment-tile.ts`) re-export these, so every
|
|
5
|
+
* fix lands once.
|
|
6
|
+
*/
|
|
7
|
+
/** What the tile prints in the file's corner. Lowercase, from the name first
|
|
8
|
+
* and the MIME subtype second; empty when neither says anything. */
|
|
9
|
+
export declare function attachmentExtension(filename: string, mime?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Which files the tile shows AS A PICTURE. Raster images only. An SVG is text
|
|
12
|
+
* that happens to draw — a logo file on a tile is a black blob at 100px, and
|
|
13
|
+
* its name is what tells it from the next logo file (Jay, 2026-09-06). It
|
|
14
|
+
* gets the named treatment, badge and all.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isPreviewableImage(filename: string, mime?: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* How a name is laid out on the tile.
|
|
19
|
+
*
|
|
20
|
+
* A short name wraps over two lines as the browser sees fit. A long one is
|
|
21
|
+
* split: the first line is the head, ellipsized by CSS at the tile's edge, and
|
|
22
|
+
* the second line is the last ten characters verbatim — the part that carries
|
|
23
|
+
* the extension and tells `…-chatux.md` from `…-ux.md`. A single middle
|
|
24
|
+
* ellipsis in one string wrapped wherever the browser chose, and left a
|
|
25
|
+
* dangling hyphen at the end of line one (2026-09-06).
|
|
26
|
+
*/
|
|
27
|
+
export declare const LONG_NAME_THRESHOLD = 24;
|
|
28
|
+
export declare const NAME_TAIL_CHARS = 10;
|
|
29
|
+
export declare function splitFilenameForTile(name: string): {
|
|
30
|
+
head: string;
|
|
31
|
+
tail: string;
|
|
32
|
+
} | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The stop-refusal guard. Both hosts (`packages/ui/src/session/status/stop-refusal.ts`,
|
|
3
|
+
* `apps/mobile/lib/session/turn-stop.ts`) re-export these, so every fix
|
|
4
|
+
* lands once.
|
|
5
|
+
*/
|
|
6
|
+
/** The 403 `code` of a stop the server refused. */
|
|
7
|
+
export declare const NOT_TURN_PROMPTER = "not_turn_prompter";
|
|
8
|
+
/**
|
|
9
|
+
* The server's message when it refused a stop, else `fallback`; null for any
|
|
10
|
+
* other failure, so the caller keeps its "Couldn't stop" toast. A REST stop
|
|
11
|
+
* (the hold, "Stop and send") is an `ApiError` carrying the code. The runtime
|
|
12
|
+
* abort answers through the sandbox proxy, whose error keeps the status and
|
|
13
|
+
* the message but drops the body's `code`, so a 403 alone also counts.
|
|
14
|
+
*/
|
|
15
|
+
export declare function stopRefusalMessage(error: unknown, fallback?: string): string | null;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure text rules of the `bash` tool row. Both hosts
|
|
3
|
+
* (`packages/ui/src/session/tool/tools/bash-tool.tsx`,
|
|
4
|
+
* `apps/mobile/lib/session/tools/files-bash.ts`) re-export these, so every
|
|
5
|
+
* fix lands once.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The words a settled row leads with.
|
|
9
|
+
*
|
|
10
|
+
* The bash tool's input carries a `description` — the one-line summary the
|
|
11
|
+
* model writes for its own call ("Install the workspace dependencies"). The
|
|
12
|
+
* SDK already reads it as this tool's subtitle (`core/turns/parts.ts`, case
|
|
13
|
+
* `'bash'`), so the row promotes a source it had been dropping rather than
|
|
14
|
+
* inventing one. A reader scanning a turn wants to know what a command was
|
|
15
|
+
* FOR, and `pnpm -w install --frozen-lockfile` answers that only if they read
|
|
16
|
+
* shell.
|
|
17
|
+
*
|
|
18
|
+
* Three rules, in order:
|
|
19
|
+
* - A failure keeps its verdict. "Command failed" is the one thing a friendly
|
|
20
|
+
* summary must never soften, so it outranks any description.
|
|
21
|
+
* - No description → exactly today's "Ran command". Nothing is ever derived
|
|
22
|
+
* from the command text: a classifier answering "Installed dependencies" to
|
|
23
|
+
* `npm i` would put a claim in the model's mouth that it never made.
|
|
24
|
+
* - Sentence case only lifts a lower-case opener. Lowering the rest would turn
|
|
25
|
+
* "Run CI on the release branch" into "Run ci on the release branch".
|
|
26
|
+
*/
|
|
27
|
+
export declare function bashRowTitle(description: unknown, failed: boolean): string;
|
|
28
|
+
/**
|
|
29
|
+
* The command as the reader should see it: leading indent stripped, blank
|
|
30
|
+
* edges dropped.
|
|
31
|
+
*
|
|
32
|
+
* Commands arrive with incidental leading whitespace — a model quoting a
|
|
33
|
+
* command out of indented YAML/JSON sends ` agent-browser open …`. The
|
|
34
|
+
* trigger row hides it (a `truncate` span collapses spaces under normal
|
|
35
|
+
* white-space), but the card's `whitespace-pre-wrap` pane renders it verbatim,
|
|
36
|
+
* so the first line sits two characters deeper than its own wrapped
|
|
37
|
+
* continuation and the output below — an inverse hanging indent that reads as
|
|
38
|
+
* broken padding.
|
|
39
|
+
*
|
|
40
|
+
* Two rules, because a one-line command and a script are different documents:
|
|
41
|
+
*
|
|
42
|
+
* - **One line has no structure to protect**, so every leading blank is noise
|
|
43
|
+
* and all of it goes. This is the case a common-indent rule cannot be
|
|
44
|
+
* trusted with alone: it only strips what it can MEASURE, and the measure
|
|
45
|
+
* used to be `[ \t]` — so a command indented with a non-breaking space (or
|
|
46
|
+
* any other Unicode space; agents paste these out of rendered docs and
|
|
47
|
+
* spreadsheets) kept its indent and drew exactly the misalignment above.
|
|
48
|
+
* - **A script keeps its shape**: the COMMON indent goes, never a per-line
|
|
49
|
+
* trim, so nesting survives. Heredocs survive by construction — a non-`<<-`
|
|
50
|
+
* heredoc needs its terminator at column 0, which pins the common indent to
|
|
51
|
+
* 0 and makes this a no-op exactly where indentation is load-bearing.
|
|
52
|
+
*
|
|
53
|
+
* `[^\S\r\n]` is "whitespace that is not a line break", so both rules count
|
|
54
|
+
* every horizontal space character the Unicode table has, not just the two on
|
|
55
|
+
* a US keyboard. The trailing trim also stops a final `\n` from counting as a
|
|
56
|
+
* phantom `+1` line in the trigger.
|
|
57
|
+
*/
|
|
58
|
+
export declare function dedentCommand(raw: string): string;
|
|
@@ -9,9 +9,19 @@
|
|
|
9
9
|
import { type RuntimeAgentConfig } from '@kortix/sdk';
|
|
10
10
|
import { type ReactNode } from 'react';
|
|
11
11
|
type SetRuntime = <K extends keyof RuntimeAgentConfig>(key: K, value: RuntimeAgentConfig[K]) => void;
|
|
12
|
-
|
|
12
|
+
/** A program agent's command (`run`): what each turn runs in place of a model. */
|
|
13
|
+
export interface AgentProgram {
|
|
14
|
+
command: string;
|
|
15
|
+
onChange: (command: string) => void;
|
|
16
|
+
/** `timeout`, a duration (`30m`); undefined follows the default. */
|
|
17
|
+
timeout: string | undefined;
|
|
18
|
+
onTimeoutChange: (timeout: string | undefined) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function AgentModelView({ oc, setOc, footer, program, }: {
|
|
13
21
|
oc: RuntimeAgentConfig;
|
|
14
22
|
setOc: SetRuntime;
|
|
15
23
|
footer?: ReactNode;
|
|
24
|
+
/** Set for a program agent: the view shows its command instead of the model. */
|
|
25
|
+
program?: AgentProgram;
|
|
16
26
|
}): import("react").JSX.Element;
|
|
17
27
|
export {};
|
|
@@ -21,6 +21,8 @@ import { isSliderAtDefault } from '../sections/view/agent-editor-basics-fields.j
|
|
|
21
21
|
import { EditorSection, EditorSectionStyleProvider, SettingBlock, SettingRow, } from '../sections/view/agent-editor-primitives.js';
|
|
22
22
|
/** The select's value for "no variant": the model decides. */
|
|
23
23
|
const AUTO = '__auto__';
|
|
24
|
+
/** Duration syntax the program timeout field parses (`parseDurationSeconds`), not copy. */
|
|
25
|
+
const TIMEOUT_EXAMPLE = '30m';
|
|
24
26
|
/** A slider that can be unset: `—` and no Reset while it follows the default. */
|
|
25
27
|
function SliderField({ label, help, value, fallback, min, max, step, onChange, }) {
|
|
26
28
|
const t = useI18nTranslations('agentEditor.modelView');
|
|
@@ -52,7 +54,16 @@ function ProviderOptions({ value, onChange, }) {
|
|
|
52
54
|
// The section title names it; the row holds the rule and the field.
|
|
53
55
|
_jsxs("div", { className: "space-y-2.5 px-4 py-3", children: [_jsx("p", { className: "text-muted-foreground text-xs leading-normal text-pretty", children: tTabs('providerOptionsHelp') }), _jsx(Textarea, { "aria-label": tTabs('providerOptions'), value: text, placeholder: JSON.stringify({ reasoning: 'high' }), className: "min-h-20 font-mono text-xs", "aria-invalid": invalid || undefined, onChange: (e) => commit(e.target.value) }), invalid ? _jsx("p", { className: "text-destructive text-xs", children: tTabs('providerOptionsInvalid') }) : null] }));
|
|
54
56
|
}
|
|
55
|
-
|
|
57
|
+
function ProgramView({ program, footer }) {
|
|
58
|
+
const t = useI18nTranslations('agentEditor.modelView');
|
|
59
|
+
return (_jsx(EditorSectionStyleProvider, { value: "panel", children: _jsxs("div", { className: "mx-auto flex w-full max-w-3xl flex-col gap-8", children: [_jsxs(EditorSection, { title: t('programTitle'), lead: true, children: [_jsx(SettingBlock, { label: t('programCommand'), help: t('programHelp'), children: _jsx(Input, { "aria-label": t('programCommand'), value: program.command, spellCheck: false, className: "h-8 font-mono text-xs", onChange: (e) => program.onChange(e.target.value) }) }), _jsx(SettingRow, { label: t('programTimeout'), help: t('programTimeoutHelp'), children: _jsx(Input, { "aria-label": t('programTimeout'), value: program.timeout ?? '', placeholder: TIMEOUT_EXAMPLE, spellCheck: false, className: "h-8 font-mono text-xs", onChange: (e) => program.onTimeoutChange(e.target.value.trim() || undefined) }) })] }), footer] }) }));
|
|
60
|
+
}
|
|
61
|
+
export function AgentModelView({ oc, setOc, footer, program, }) {
|
|
62
|
+
if (program)
|
|
63
|
+
return _jsx(ProgramView, { program: program });
|
|
64
|
+
return _jsx(ModelView, { oc: oc, setOc: setOc, footer: footer });
|
|
65
|
+
}
|
|
66
|
+
function ModelView({ oc, setOc, footer }) {
|
|
56
67
|
const t = useI18nTranslations('agentEditor.modelView');
|
|
57
68
|
const tTabs = useI18nTranslations('agentEditor.tabs');
|
|
58
69
|
const { data: providers } = useRuntimeProviders();
|
|
@@ -278,13 +278,18 @@ function useSaveShortcut(dirty, onSave) {
|
|
|
278
278
|
* can be sent to. People opens the Share dialog, and only for a caller who
|
|
279
279
|
* may manage members (`onPeople`).
|
|
280
280
|
*/
|
|
281
|
-
function useRailGroups(pathname, views, counts, onPeople
|
|
281
|
+
function useRailGroups(pathname, views, counts, onPeople,
|
|
282
|
+
/** A program agent (`run`): its Model row is its Program. */
|
|
283
|
+
program = false) {
|
|
282
284
|
const t = useI18nTranslations('agentEditor.tabs');
|
|
285
|
+
const tModel = useI18nTranslations('agentEditor.modelView');
|
|
283
286
|
const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
|
|
284
287
|
const catalog = useLocalizedAgentConfigCatalog();
|
|
285
|
-
const labelOf = (key) => key === '
|
|
286
|
-
?
|
|
287
|
-
:
|
|
288
|
+
const labelOf = (key) => key === 'model' && program
|
|
289
|
+
? tModel('programTitle')
|
|
290
|
+
: key === 'subagents'
|
|
291
|
+
? tI18nComplete.raw('agentsListSubagentsTitle')
|
|
292
|
+
: (catalog.sections.find((s) => s.key === key)?.label ?? key);
|
|
288
293
|
const viewRows = (keys) => keys
|
|
289
294
|
.filter((key) => views.includes(key))
|
|
290
295
|
.map((key) => ({ key, label: labelOf(key), href: sectionLocationHref(pathname, key) }));
|
|
@@ -397,6 +402,7 @@ function EditableAgentPage({ projectId, agent, config, initial, renderApps, }) {
|
|
|
397
402
|
const [confirmDiscard, setConfirmDiscard] = useState(false);
|
|
398
403
|
const pathname = useUiPathname();
|
|
399
404
|
const drivesOn = useFeatureFlag(projectId, 'drives').enabled;
|
|
405
|
+
const programAgentsOn = useFeatureFlag(projectId, 'program_agents').enabled;
|
|
400
406
|
const views = useMemo(() => AGENT_CONFIG_SECTIONS.map((s) => s.key).filter((k) => drivesOn || k !== 'drives'), [drivesOn]);
|
|
401
407
|
const location = useAgentLocation(AGENT_TABS, views);
|
|
402
408
|
const share = useShareDialog(location.open === 'share');
|
|
@@ -444,7 +450,7 @@ function EditableAgentPage({ projectId, agent, config, initial, renderApps, }) {
|
|
|
444
450
|
const leaveGuard = useUnsavedChangesGuard(editor.isDirty, pathname);
|
|
445
451
|
useSaveShortcut(editor.isDirty, saveNow);
|
|
446
452
|
const canManageMembers = useCanManageMembers(projectId);
|
|
447
|
-
const railGroups = useRailGroups(pathname, views, facts, canManageMembers ? () => share.setOpen(true) : undefined);
|
|
453
|
+
const railGroups = useRailGroups(pathname, views, facts, canManageMembers ? () => share.setOpen(true) : undefined, programAgentsOn && typeof editor.draft.run === 'string');
|
|
448
454
|
const railItems = railGroups.flatMap((group) => group.items);
|
|
449
455
|
const dirtyItems = useMemo(() => changedItems(editor.draft, editor.baseline), [editor.draft, editor.baseline]);
|
|
450
456
|
const changed = new Intl.ListFormat(locale, { type: 'conjunction' }).format(dirtyItems.map((key) => railItems.find((item) => item.key === key)?.label ?? key));
|
|
@@ -478,7 +484,14 @@ function EditableAgentPage({ projectId, agent, config, initial, renderApps, }) {
|
|
|
478
484
|
// Model is this agent's model only. The project-wide gateway screens
|
|
479
485
|
// (providers, routing, costs, logs) live once, in Project admin.
|
|
480
486
|
if (view === 'model')
|
|
481
|
-
return (_jsx(AgentTabBody, { children: _jsx(AgentModelView, { oc: editor.oc, setOc: editor.setOc, footer: _jsx(ProjectModelsLink, { projectId: projectId })
|
|
487
|
+
return (_jsx(AgentTabBody, { children: _jsx(AgentModelView, { oc: editor.oc, setOc: editor.setOc, footer: _jsx(ProjectModelsLink, { projectId: projectId }), program: programAgentsOn && typeof editor.draft.run === 'string'
|
|
488
|
+
? {
|
|
489
|
+
command: editor.draft.run,
|
|
490
|
+
onChange: (next) => editor.set('run', next),
|
|
491
|
+
timeout: editor.draft.timeout,
|
|
492
|
+
onTimeoutChange: (next) => editor.set('timeout', next),
|
|
493
|
+
}
|
|
494
|
+
: undefined }) }));
|
|
482
495
|
return (_jsx(AgentTabBody, { className: `${view === 'workspace' ? CENTER_COLUMN : RAIL_COLUMN} space-y-5`, children: _jsx(CapabilityShellEmbedProvider, { value: { agentName: agent.name }, children: editorSection(view) }) }));
|
|
483
496
|
}
|
|
484
497
|
case 'triggers':
|
|
@@ -65,6 +65,8 @@ export declare const YAML_KEY_ROW: {
|
|
|
65
65
|
readonly top_p: "model";
|
|
66
66
|
readonly steps: "model";
|
|
67
67
|
readonly options: "model";
|
|
68
|
+
readonly run: "model";
|
|
69
|
+
readonly timeout: "model";
|
|
68
70
|
readonly tools: "tools";
|
|
69
71
|
readonly codemode: "tools";
|
|
70
72
|
readonly context: "tools";
|
|
@@ -23,7 +23,7 @@ import { Skeleton } from '../../primitives/skeleton.js';
|
|
|
23
23
|
import { SplitSheet, SplitSheetBody, SplitSheetContent, SplitSheetDescription, SplitSheetHeader, SplitSheetMain, SplitSheetTitle, } from '../../primitives/split-sheet.js';
|
|
24
24
|
import { Tabs, TabsList, TabsTrigger } from '../../primitives/tabs.js';
|
|
25
25
|
import { EmptyState } from '../../primitives/empty-state.js';
|
|
26
|
-
import { connectorConnectionQueryKeys
|
|
26
|
+
import { connectorConnectionQueryKeys } from '../../internal/hooks/connectors/invalidate-connections.js';
|
|
27
27
|
import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
|
|
28
28
|
import { useProjectCan } from '../../internal/lib/use-project-can.js';
|
|
29
29
|
import { ConnectorStatusBadge, ConnectorStatusLogo } from './connector-identity.js';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { connectorConnectionQueryKeys } from '
|
|
4
|
-
import { invalidateConnections } from '../invalidate-connections.js';
|
|
3
|
+
import { connectorConnectionQueryKeys, invalidateConnections } from '../../../internal/hooks/connectors/invalidate-connections.js';
|
|
5
4
|
import { ConnectorNoticeRow, NOTICE_BODY, NOTICE_TITLE, NoticeLogLine, } from './connector-notice-view.js';
|
|
6
5
|
import { DetailPageShell, DETAIL_PAGE_COLUMN as PAGE_COLUMN } from './detail-page-shell.js';
|
|
7
|
-
import { connectorAccountSignInStarted, getProjectDetail, listConnectors, syncConnectors, } from '@kortix/sdk';
|
|
6
|
+
import { connectorAccountNeedsSignIn, connectorAccountSignInStarted, getProjectDetail, listConnectors, syncConnectors, } from '@kortix/sdk';
|
|
8
7
|
import { contract, FRESHNESS, qk, useProjectAccountId } from '@kortix/sdk/react';
|
|
9
8
|
import { CaretLeftIcon, PlugIcon, PlusIcon } from '@phosphor-icons/react';
|
|
10
9
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
@@ -323,8 +322,14 @@ export function ConnectorDetailView({ projectId, connector, canWrite, onChanged,
|
|
|
323
322
|
: [{ key: 'runs', label: t('infoRunsOver'), value: connectorRunsOver(connector.provider) }]),
|
|
324
323
|
];
|
|
325
324
|
// The Accounts tab's own query; a channel has none, and the cell waits for it.
|
|
325
|
+
// It counts accounts an agent can use: a row whose sign-in never finished is
|
|
326
|
+
// listed in the tab, not counted here.
|
|
326
327
|
if (!isChannel && connectionsQuery.isSuccess)
|
|
327
|
-
stripCells.push({
|
|
328
|
+
stripCells.push({
|
|
329
|
+
key: 'accounts',
|
|
330
|
+
label: t('stripAccounts'),
|
|
331
|
+
value: String(accounts.filter((account) => !connectorAccountNeedsSignIn(account, connector)).length),
|
|
332
|
+
});
|
|
328
333
|
stripCells.push({
|
|
329
334
|
key: 'tools',
|
|
330
335
|
label: t('stripTools'),
|
|
@@ -50,7 +50,7 @@ export function ConnectorTriggers({ projectId, connector, displayName, }) {
|
|
|
50
50
|
const [creating, setCreating] = useState(false);
|
|
51
51
|
if (isError)
|
|
52
52
|
return null;
|
|
53
|
-
return (_jsxs("section", { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx(Label, { children: tI18nComplete.raw('
|
|
53
|
+
return (_jsxs("section", { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx(Label, { children: tI18nComplete.raw('text458ceb31019b') }), controls.canCreate ? (_jsxs(Button, { size: "sm", variant: "secondary", className: "gap-1.5", onClick: () => setCreating(true), children: [_jsx(PlusIcon, { className: "size-4 shrink-0" }), tI18nComplete.raw('text85a6c98e5584')] })) : null] }), isLoading ? (_jsx(Skeleton, { className: "h-14 rounded-md" })) : rows.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: tI18nComplete('text974e43358191', {
|
|
54
54
|
name: displayName,
|
|
55
55
|
}) })) : (_jsx("ul", { className: "space-y-2", children: rows.map((trigger) => (_jsxs("li", { className: "bg-popover flex items-center gap-3 rounded-md border px-4 py-2", children: [_jsx(TriggerTile, { trigger: trigger, surface: "bg-popover" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx(Link, { href: adminPath(projectId, `triggers?id=${encodeURIComponent(trigger.slug)}`), className: "min-w-0 truncate text-sm font-medium hover:underline", children: triggerName(trigger) }), _jsx(TriggerStatusBadge, { trigger: trigger })] }), _jsx("span", { className: "text-muted-foreground block truncate text-xs", children: describeWhen(trigger, eventNames) }), trigger.event ? (_jsx("span", { className: "text-muted-foreground block truncate text-xs", children: describeEventSource(trigger.event, tI18nComplete, appIndex) })) : null] })] }, trigger.slug))) })), _jsx(TriggerComposer, { projectId: projectId, open: creating, onOpenChange: setCreating, onCreated: () => setCreating(false), initialKind: "event", initialConnector: { slug: connector.slug, name: displayName } })] }));
|
|
56
56
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { invalidateConnections } from '
|
|
2
|
+
import { invalidateConnections } from '../../../internal/hooks/connectors/invalidate-connections.js';
|
|
3
3
|
import { checkMcpServerSignIn, createConnector, getDiscoverConnector, } from '@kortix/sdk';
|
|
4
4
|
import { useQueryClient } from '@tanstack/react-query';
|
|
5
5
|
import { useUiRouter } from '../../../providers/ui-provider.js';
|
|
@@ -179,14 +179,14 @@ function ExpandedBody({ projectId, entry, status, keyConnected, canWrite, enable
|
|
|
179
179
|
if (method === 'included' || (entry.envVars.length === 0 && !SUBSCRIPTION_BY_PROVIDER[entry.id])) {
|
|
180
180
|
content = (_jsx(AccordionSubRow, { children: entry.hint }));
|
|
181
181
|
}
|
|
182
|
-
else if (pooled.
|
|
182
|
+
else if (pooled.accountId && entry.id === 'openai') {
|
|
183
183
|
content = (_jsxs("div", { className: "border-border space-y-3 border-t py-3", children: [_jsx(SubscriptionUsageSection, { accountId: pooled.accountId, projectId: projectId, providerId: "codex", compact: true }), _jsx("p", { className: "text-foreground text-xs font-medium", children: tPooled('chatGptAccounts') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "codex", providerName: "ChatGPT Plus/Pro", envVar: "CODEX_AUTH_JSON", canWrite: true, oauth: { projectId, onConnected: () => undefined } }), _jsx(ChatGptSubscriptionConnect, { projectId: projectId, onConnected: () => undefined, legacyOnly: true, usageSlot: _jsx(LegacyChatGptUsage, { accountId: pooled.accountId, projectId: projectId }) }), _jsx("p", { className: "text-foreground pt-3 text-xs font-medium", children: tPooled('providerKeysFor', { provider: entry.label }) }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true })] }));
|
|
184
184
|
}
|
|
185
|
-
else if (pooled.
|
|
185
|
+
else if (pooled.accountId && entry.id === 'anthropic') {
|
|
186
186
|
// Claude accounts, exactly as OpenAI lists ChatGPT accounts; Anthropic API keys below them.
|
|
187
187
|
content = (_jsxs(_Fragment, { children: [_jsxs("div", { className: "border-border space-y-3 border-t py-3", children: [_jsx(SubscriptionUsageSection, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent", compact: true }), _jsx("p", { className: "text-foreground text-xs font-medium", children: tPooled('claudeAccounts') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent", providerName: "Claude Pro/Max", envVar: "CLAUDE_CODE_OAUTH_TOKEN", canWrite: true, oauth: { projectId, onConnected: () => undefined, kind: 'claude' } })] }), _jsx("div", { className: "border-border border-t py-3", children: _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true }) })] }));
|
|
188
188
|
}
|
|
189
|
-
else if (pooled.
|
|
189
|
+
else if (pooled.accountId && supportsPooledProviderKey(entry)) {
|
|
190
190
|
content = (_jsxs(_Fragment, { children: [SUBSCRIPTION_BY_PROVIDER[entry.id] ? _jsx(SignInSubRows, { projectId: projectId, entry: entry, canWrite: canWrite }) : null, _jsx("div", { className: "border-border border-t py-3", children: _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true }) })] }));
|
|
191
191
|
}
|
|
192
192
|
else if (SUBSCRIPTION_BY_PROVIDER[entry.id]) {
|
|
@@ -281,7 +281,7 @@ export function ProviderAccordion({ projectId, canWrite = false, enabled = true,
|
|
|
281
281
|
return null;
|
|
282
282
|
const singleKey = entry.envVars.length === 1 &&
|
|
283
283
|
!SUBSCRIPTION_BY_PROVIDER[entry.id] &&
|
|
284
|
-
!
|
|
284
|
+
!supportsPooledProviderKey(entry);
|
|
285
285
|
// A key saved through the form lands in the named store ("Workspace key").
|
|
286
286
|
const keyConnected = connectedIds.has(entry.id) || pooled.pooledProviderIds.has(entry.id);
|
|
287
287
|
if (addingId === row.id && singleKey && canWrite) {
|
|
@@ -319,7 +319,7 @@ export function ProviderAccordion({ projectId, canWrite = false, enabled = true,
|
|
|
319
319
|
event.stopPropagation();
|
|
320
320
|
setSearchOpen(false);
|
|
321
321
|
}
|
|
322
|
-
} }), _jsx(InputGroupSearchClear, { onClick: () => setSearch('') })] }) })) : null,
|
|
322
|
+
} }), _jsx(InputGroupSearchClear, { onClick: () => setSearch('') })] }) })) : null, _jsx(PooledProvidersNote, { projectId: projectId, className: "text-muted-foreground px-1 pb-2 text-xs text-pretty" }), empty ? (_jsx(EmptyState, { size: "sm", title: t('noMatch', { query: search.trim() }) })) : (_jsxs(_Fragment, { children: [inUse.length > 0 ? (_jsx(AccordionGroupLabel, { label: `${t('inUse')} · ${inUse.length}`, action: searchOpen ? null : searchButton })) : null, inUse.map(renderRow), visibleAvailable.length > 0 ? (_jsx(AccordionGroupLabel, { label: t('available'), className: inUse.length > 0 ? 'pt-3.5' : undefined, action: inUse.length === 0 && !searchOpen ? searchButton : null })) : null, visibleAvailable.map(renderRow)] })), hiddenCount > 0 ? (_jsxs("div", { className: "flex items-center gap-2 px-1 pt-1", "data-provider-load-more": "", children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: () => setVisibleCount((shown) => shown + PROVIDER_PAGE_SIZE), children: t('showMore') }), _jsx("span", { className: "text-muted-foreground text-xs tabular-nums", children: t('shownOf', {
|
|
323
323
|
shown: inUse.length + visibleAvailable.length,
|
|
324
324
|
total: inUse.length + available.length,
|
|
325
325
|
}) })] })) : null] }));
|
|
@@ -69,7 +69,7 @@ export interface ProviderConnectViewProps {
|
|
|
69
69
|
/** The provider open in the host's sheet, if any. */
|
|
70
70
|
selectedId?: string | null;
|
|
71
71
|
onSelect: (providerId: string) => void;
|
|
72
|
-
/** One line above the list:
|
|
72
|
+
/** One line above the list: who the keys added here are shared with. */
|
|
73
73
|
note?: string;
|
|
74
74
|
className?: string;
|
|
75
75
|
}
|
|
@@ -84,7 +84,6 @@ export declare function ProviderConnectView({ inUse, available, totalCount, hidd
|
|
|
84
84
|
export declare function useManagedProvider(projectId: string | null): LlmProviderEntry;
|
|
85
85
|
/** Provider ids that hold a usable pooled (account-level) key for this project. */
|
|
86
86
|
export declare function usePooledProviderIds(projectId: string, enabled: boolean): {
|
|
87
|
-
pooledSecretsEnabled: boolean;
|
|
88
87
|
accountId: string | undefined;
|
|
89
88
|
pooledProviderIds: Set<string | null>;
|
|
90
89
|
isLoading: boolean;
|
|
@@ -94,6 +93,7 @@ export declare function usePooledProviderIds(projectId: string, enabled: boolean
|
|
|
94
93
|
};
|
|
95
94
|
export interface ProviderConnectProps {
|
|
96
95
|
projectId: string;
|
|
96
|
+
/** @deprecated Unused: every member sees who the keys added here are shared with. */
|
|
97
97
|
canWrite?: boolean;
|
|
98
98
|
/** Set while this surface is visible; drives the underlying queries. */
|
|
99
99
|
enabled?: boolean;
|
|
@@ -101,4 +101,4 @@ export interface ProviderConnectProps {
|
|
|
101
101
|
onSelect: (providerId: string) => void;
|
|
102
102
|
className?: string;
|
|
103
103
|
}
|
|
104
|
-
export declare function ProviderConnect({ projectId,
|
|
104
|
+
export declare function ProviderConnect({ projectId, enabled, selectedId, onSelect, className, }: ProviderConnectProps): import("react").JSX.Element;
|
|
@@ -35,7 +35,7 @@ import { LLM_PROVIDERS } from '../../internal/lib/llm-providers.js';
|
|
|
35
35
|
import { cn } from '../../internal/lib/utils.js';
|
|
36
36
|
import { PLATFORM_FEE_PERCENT } from '../../internal/billing/compute-pricing.js';
|
|
37
37
|
import { FIRST_CLASS_PROVIDER_IDS, PROVIDER_SUBSCRIPTIONS, getProjectDetail, providerConnectMethod, providerConnectedVia, } from '@kortix/sdk';
|
|
38
|
-
import { qk, useAccountSecretResources,
|
|
38
|
+
import { qk, useAccountSecretResources, useModelAccess, useProjectModelPickerCatalog, } from '@kortix/sdk/react';
|
|
39
39
|
import { useQuery } from '@tanstack/react-query';
|
|
40
40
|
import { useCanShareProviderAccounts } from '../sections/view/account-secret-resources-panel.js';
|
|
41
41
|
import { SUBSCRIPTION_ROW, SubscriptionRowMeter, summarizeSubscriptions, useLiveSubscriptionUsages, useSubscriptionLogins, useSubscriptionRowSummary, } from '../sections/view/subscription-usage.js';
|
|
@@ -152,24 +152,21 @@ export function useManagedProvider(projectId) {
|
|
|
152
152
|
}
|
|
153
153
|
/** Provider ids that hold a usable pooled (account-level) key for this project. */
|
|
154
154
|
export function usePooledProviderIds(projectId, enabled) {
|
|
155
|
-
const pooledFlag = useFeatureFlag(enabled ? projectId : null, 'pooled_provider_secrets');
|
|
156
|
-
const pooledSecretsEnabled = pooledFlag.enabled;
|
|
157
155
|
const project = useQuery({
|
|
158
156
|
queryKey: qk.project.detail(projectId),
|
|
159
157
|
queryFn: () => getProjectDetail(projectId),
|
|
160
|
-
enabled
|
|
158
|
+
enabled,
|
|
161
159
|
});
|
|
162
160
|
const accountId = project.data?.project?.account_id;
|
|
163
|
-
const pooledResources = useAccountSecretResources(enabled
|
|
161
|
+
const pooledResources = useAccountSecretResources(enabled ? accountId : null, projectId);
|
|
164
162
|
const pooledProviderIds = useMemo(() => new Set((pooledResources.data?.secrets ?? [])
|
|
165
163
|
.filter((secret) => secret.can_use && secret.active)
|
|
166
164
|
.map((secret) => secret.provider_id)), [pooledResources.data]);
|
|
167
165
|
return {
|
|
168
|
-
pooledSecretsEnabled,
|
|
169
166
|
accountId,
|
|
170
167
|
pooledProviderIds,
|
|
171
|
-
isLoading:
|
|
172
|
-
isError:
|
|
168
|
+
isLoading: project.isLoading || pooledResources.isLoading,
|
|
169
|
+
isError: project.isError || pooledResources.isError,
|
|
173
170
|
isFetching: project.isFetching || pooledResources.isFetching,
|
|
174
171
|
refetch: () => {
|
|
175
172
|
void project.refetch();
|
|
@@ -177,8 +174,7 @@ export function usePooledProviderIds(projectId, enabled) {
|
|
|
177
174
|
},
|
|
178
175
|
};
|
|
179
176
|
}
|
|
180
|
-
export function ProviderConnect({ projectId,
|
|
181
|
-
const t = useTranslations('providerSheet');
|
|
177
|
+
export function ProviderConnect({ projectId, enabled = true, selectedId, onSelect, className, }) {
|
|
182
178
|
const common = useTranslations('common');
|
|
183
179
|
const tPooled = useTranslations('pooledSecrets');
|
|
184
180
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
@@ -189,7 +185,7 @@ export function ProviderConnect({ projectId, canWrite = false, enabled = true, s
|
|
|
189
185
|
useLiveLlmProviderCatalog(projectId, enabled);
|
|
190
186
|
const catalogRevision = useLlmProviderCatalogRevision();
|
|
191
187
|
const { connectedProviders, providerStateLoading } = useConnectedProviders(projectId, enabled);
|
|
192
|
-
const subscriptionAccountId = enabled
|
|
188
|
+
const subscriptionAccountId = enabled ? pooled.accountId : null;
|
|
193
189
|
const subscriptions = useSubscriptionLogins(subscriptionAccountId, projectId);
|
|
194
190
|
const liveUsage = useLiveSubscriptionUsages(subscriptionAccountId, projectId, subscriptions.logins);
|
|
195
191
|
const rowSummary = useSubscriptionRowSummary();
|
|
@@ -260,9 +256,5 @@ export function ProviderConnect({ projectId, canWrite = false, enabled = true, s
|
|
|
260
256
|
if (pooled.isError) {
|
|
261
257
|
return (_jsx(ErrorState, { size: "sm", title: tPooled('loadError'), action: _jsx(Button, { size: "sm", variant: "secondary", disabled: pooled.isFetching, onClick: pooled.refetch, children: common('retry') }) }));
|
|
262
258
|
}
|
|
263
|
-
return (_jsx(ProviderConnectView, { inUse: inUse, available: visibleAvailable, totalCount: searchable.length, hiddenCount: available.length - visibleAvailable.length, onLoadMore: () => setVisibleCount((shown) => shown + PROVIDER_PAGE_SIZE), search: search, onSearchChange: setSearch, selectedId: selectedId, onSelect: onSelect, note:
|
|
264
|
-
? tPooled(canShare ? 'sharedDescription' : 'sharedOnlyYouDescription')
|
|
265
|
-
: canWrite
|
|
266
|
-
? undefined
|
|
267
|
-
: t('readOnly'), className: className }));
|
|
259
|
+
return (_jsx(ProviderConnectView, { inUse: inUse, available: visibleAvailable, totalCount: searchable.length, hiddenCount: available.length - visibleAvailable.length, onLoadMore: () => setVisibleCount((shown) => shown + PROVIDER_PAGE_SIZE), search: search, onSearchChange: setSearch, selectedId: selectedId, onSelect: onSelect, note: tPooled(canShare ? 'sharedDescription' : 'sharedOnlyYouDescription'), className: className }));
|
|
268
260
|
}
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
14
14
|
* - **OpenAI and OpenCode Go** — two ways in. With nothing connected the sheet
|
|
15
15
|
* asks which: a subscription sign-in (device code) or an API key. With
|
|
16
16
|
* either connected it lists the connections and offers the other.
|
|
17
|
-
* - **Pooled keys**
|
|
17
|
+
* - **Pooled keys** — the account-level key
|
|
18
18
|
* manager, as before.
|
|
19
19
|
*
|
|
20
20
|
* Saving is a button, not a blur. The old list saved a field when focus left
|
|
@@ -294,14 +294,14 @@ export function ProviderSheet({ projectId, providerId, canWrite, enabled = true,
|
|
|
294
294
|
if (method === 'included') {
|
|
295
295
|
content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: entry.hint }), models] }));
|
|
296
296
|
}
|
|
297
|
-
else if (pooled.
|
|
297
|
+
else if (pooled.accountId && entry.id === 'openai') {
|
|
298
298
|
content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsx(SubscriptionUsageSection, { accountId: pooled.accountId, projectId: projectId, providerId: "codex" }), _jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('chatGptAccounts') }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: tPooled(canShare ? 'oauthPrivateDescription' : 'oauthOnlyYouDescription') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "codex", providerName: "ChatGPT Plus/Pro", envVar: "CODEX_AUTH_JSON", canWrite: true, oauth: { projectId, onConnected: () => undefined } }), _jsx(ChatGptSubscriptionConnect, { projectId: projectId, onConnected: () => undefined, legacyOnly: true, usageSlot: _jsx(LegacyChatGptUsage, { accountId: pooled.accountId, projectId: projectId }) })] }), _jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('providerKeysFor', { provider: entry.label }) }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true })] }), models] }));
|
|
299
299
|
}
|
|
300
|
-
else if (pooled.
|
|
300
|
+
else if (pooled.accountId && entry.id === 'anthropic') {
|
|
301
301
|
// Claude accounts, exactly as OpenAI lists ChatGPT accounts; Anthropic API keys below them.
|
|
302
302
|
content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsx(SubscriptionUsageSection, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent" }), _jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('claudeAccounts') }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: tPooled(canShare ? 'claudeOauthPrivateDescription' : 'claudeOauthOnlyYouDescription') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent", providerName: "Claude Pro/Max", envVar: "CLAUDE_CODE_OAUTH_TOKEN", canWrite: true, oauth: { projectId, onConnected: () => undefined, kind: 'claude' } })] }), _jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('providerKeysFor', { provider: entry.label }) }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true })] }), models] }));
|
|
303
303
|
}
|
|
304
|
-
else if (pooled.
|
|
304
|
+
else if (pooled.accountId && supportsPooledProviderKey(entry)) {
|
|
305
305
|
content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true }), models] }));
|
|
306
306
|
}
|
|
307
307
|
else if (SUBSCRIPTION_BY_PROVIDER[entry.id]) {
|
|
@@ -79,7 +79,10 @@ export function TeamsByoWizard({ projectId, mode, open, onOpenChange, }) {
|
|
|
79
79
|
const [tenantId, setTenantId] = useState('');
|
|
80
80
|
const [error, setError] = useState(null);
|
|
81
81
|
const connect = useConnectTeams();
|
|
82
|
-
|
|
82
|
+
// The wizard stays mounted while closed. Fetch the manifest only on step 3:
|
|
83
|
+
// before connect stores the app id the route answers 409, and an eager
|
|
84
|
+
// fetch put that 409 (plus its retries) on every channels page load.
|
|
85
|
+
const manifest = useTeamsManifest(open && step === 3 ? projectId : null);
|
|
83
86
|
const endpoint = byoMessagingEndpoint(mode?.messagingEndpoint, projectId);
|
|
84
87
|
const steps = [
|
|
85
88
|
{ step: 1, title: tI18nComplete.raw('text7f1b55a356b0') },
|
|
@@ -16,7 +16,6 @@ export interface EasyConnectConnectionInput {
|
|
|
16
16
|
}
|
|
17
17
|
/** A connector's setup status. The rules live in `@kortix/sdk`. */
|
|
18
18
|
export { connectorSetupStatus, isConnectorAuthChallenge as isAuthChallenge, type ConnectorSetupStatus, } from '@kortix/sdk';
|
|
19
|
-
export declare function connectorConnectionQueryKeys(projectId: string): readonly [readonly ["kx", "project", string, "connectors"], readonly ["connections", string], readonly ["connections-all", string], readonly ["session-scope-catalog", string]];
|
|
20
19
|
export declare function createOnlyConnectorDraft(draft: ConnectorDraftInput): ConnectorDraftInput;
|
|
21
20
|
export declare function connectorSyncErrorForSlug(result: {
|
|
22
21
|
sync?: ConnectorSyncResult;
|