@kortix/ui 0.16.4 → 0.16.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/customize/sections/view/review-center-connected.js +64 -71
- package/dist/customize/sections/view/secret-delivery.d.ts +11 -20
- package/dist/customize/sections/view/secret-delivery.js +20 -29
- package/dist/customize/sections/view/secrets-view.js +9 -24
- package/dist/i18n/en.d.ts +116 -13
- package/dist/i18n/en.js +127 -24
- package/dist/i18n/ui-catalog/product-catalog-translation-keys.generated.js +2 -0
- package/dist/internal/auth/auth-card-shell.d.ts +24 -3
- package/dist/internal/auth/auth-card-shell.js +15 -8
- package/dist/internal/auth/auth-primitives.d.ts +15 -2
- package/dist/internal/auth/auth-primitives.js +22 -5
- package/dist/internal/components/agent-mark.d.ts +2 -1
- package/dist/internal/components/agent-mark.js +14 -3
- 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-nav-row.d.ts +3 -1
- package/dist/internal/layout/project-nav-row.js +2 -2
- package/dist/markdown/setup-links/secret-intake-form.d.ts +4 -1
- package/dist/markdown/setup-links/secret-intake-form.js +60 -16
- package/dist/markdown/setup-links/setup-link-button.js +6 -1
- package/dist/session/agents/agent-hover-card.d.ts +26 -0
- package/dist/session/agents/agent-hover-card.js +70 -0
- package/dist/session/agents/agent-strip.js +33 -7
- package/dist/session/agents/agent-surface.d.ts +26 -1
- package/dist/session/agents/agent-surface.js +57 -6
- package/dist/session/agents/held-messages.js +2 -2
- package/dist/session/agents/subagent-dialog-content.js +2 -2
- package/dist/session/composer/ComposerCard.js +4 -1
- package/dist/session/composer/composer-toolbar.d.ts +8 -1
- package/dist/session/composer/composer-toolbar.js +2 -2
- package/dist/session/composer/dictation/dictation-control.d.ts +10 -0
- package/dist/session/composer/dictation/dictation-control.js +28 -0
- package/dist/session/composer/dictation/dictation-state.d.ts +26 -0
- package/dist/session/composer/dictation/dictation-state.js +71 -0
- package/dist/session/composer/dictation/recorder.d.ts +30 -0
- package/dist/session/composer/dictation/recorder.js +129 -0
- package/dist/session/composer/dictation/use-composer-dictation.d.ts +25 -0
- package/dist/session/composer/dictation/use-composer-dictation.js +218 -0
- package/dist/session/composer/queued-prompt-list.js +5 -1
- package/dist/session/panel/easy/apps-card.js +3 -10
- package/dist/session/panel/easy/background-tasks-card.d.ts +23 -0
- package/dist/session/panel/easy/background-tasks-card.js +119 -0
- package/dist/session/panel/easy/change-requests-card.js +1 -1
- package/dist/session/panel/easy/changes-card.js +4 -6
- package/dist/session/panel/easy/context-card.js +8 -9
- package/dist/session/panel/easy/context-meter.d.ts +2 -0
- package/dist/session/panel/easy/context-meter.js +18 -4
- package/dist/session/panel/easy/detail-view.js +4 -2
- package/dist/session/panel/easy/easy-panel-logic.d.ts +4 -15
- package/dist/session/panel/easy/easy-panel-logic.js +4 -17
- package/dist/session/panel/easy/easy-panel.js +5 -4
- package/dist/session/panel/easy/outputs-card.d.ts +1 -13
- package/dist/session/panel/easy/outputs-card.js +14 -40
- package/dist/session/panel/easy/panel-card.d.ts +13 -40
- package/dist/session/panel/easy/panel-card.js +17 -55
- package/dist/session/panel/easy/plan-card.js +4 -7
- package/dist/session/panel/model-switch-event.d.ts +2 -2
- package/dist/session/panel/model-switch-event.js +13 -9
- package/dist/session/panel/session-panel-provider.d.ts +2 -1
- package/dist/session/panel/session-panel-provider.js +3 -3
- package/dist/session/panel/shared/derive-panels.js +14 -1
- package/dist/session/panel/shared/use-panel-handoffs.d.ts +0 -1
- package/dist/session/panel/shared/use-panel-handoffs.js +3 -15
- package/dist/session/thread/chat-minimap.js +7 -1
- package/dist/session/thread/session-chat.js +59 -15
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +2 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +2 -0
- package/dist/session/tool/shared/infrastructure-row-header.js +4 -1
- package/dist/session/tool/shared/infrastructure-rows.js +19 -19
- package/dist/session/tool/tool-part-renderer.js +23 -9
- package/dist/session/tool/tools/bash-tool.js +3 -2
- package/dist/session/tool/tools/codemode-tool.d.ts +15 -0
- package/dist/session/tool/tools/codemode-tool.js +54 -2
- package/dist/session/tool/tools/kortix-action-tool.d.ts +1 -0
- package/dist/session/tool/tools/kortix-action-tool.js +19 -8
- package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +8 -1
- package/dist/session/tool/tools/multi-agent-tool-bodies.js +76 -10
- package/dist/session/tool/tools/task-tool.js +17 -5
- package/dist/session/turn/peer-message-row.d.ts +3 -0
- package/dist/session/turn/peer-message-row.js +8 -2
- package/dist/session/turn/subagent-notice-row.js +5 -3
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +116 -13
- package/dist/workspace/projects/modal/project-icon-field.d.ts +3 -1
- package/dist/workspace/projects/modal/project-icon-field.js +3 -3
- package/dist/workspace/review/review-center.d.ts +9 -1
- package/dist/workspace/review/review-center.js +107 -14
- package/dist/workspace/review/review-detail.d.ts +19 -0
- package/dist/workspace/review/review-detail.js +18 -3
- package/dist/workspace/review/review-swipe-deck.d.ts +27 -0
- package/dist/workspace/review/review-swipe-deck.js +304 -0
- package/dist/workspace/review/review-swipe.d.ts +17 -0
- package/dist/workspace/review/review-swipe.js +10 -0
- package/dist/workspace/sidebar/footer/project-review-nav.d.ts +13 -0
- package/dist/workspace/sidebar/footer/project-review-nav.js +29 -0
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +24 -5
- package/dist/workspace/sidebar/project-spaces-nav.js +3 -10
- package/dist/workspace/sidebar/sidebar-more-group.js +1 -1
- package/package.json +3 -3
|
@@ -20,7 +20,7 @@ import { useCloseChangeRequest, useMergeChangeRequest, useRequestChangesOnChange
|
|
|
20
20
|
import { useProjectCans } from '../../../internal/lib/use-project-can.js';
|
|
21
21
|
import { useSettingsPanelStore } from '../../../internal/stores/settings-panel-store.js';
|
|
22
22
|
import { listProjectSessions, PROJECT_SESSION_NAME_LOOKUP_LIMIT, REVIEW_CONTROL_ACTIONS, reviewVerdictAllowed, } from '@kortix/sdk';
|
|
23
|
-
import { clearStartStash, contract, qk, reviewItemsOf, useSessionAsks } from '@kortix/sdk/react';
|
|
23
|
+
import { clearStartStash, contract, qk, reviewItemsOf, useFeatureFlag, useSessionAsks } from '@kortix/sdk/react';
|
|
24
24
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
25
25
|
import { useUiRouter, useUiSearchParams } from '../../../providers/ui-provider.js';
|
|
26
26
|
import { useEffect, useMemo, useState } from 'react';
|
|
@@ -49,6 +49,7 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
49
49
|
// role still sees the inbox, with no verdict control. The inbox stays live
|
|
50
50
|
// for every viewer: an unresolved probe offers no verdict.
|
|
51
51
|
const cans = useProjectCans(projectId, REVIEW_CONTROL_ACTIONS);
|
|
52
|
+
const deckEnabled = useFeatureFlag(projectId, 'review_swipe').enabled;
|
|
52
53
|
// The deck claims the inbox's empty pane only while an agent asks something
|
|
53
54
|
// (or the asks still load). With none, its own "Nothing waits on you" would
|
|
54
55
|
// sit beside rows that do wait, so the pane shows "Select an item" instead.
|
|
@@ -157,24 +158,26 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
157
158
|
});
|
|
158
159
|
}
|
|
159
160
|
function actOnItem(id, verdict, feedback, announced, accepted, refused) {
|
|
161
|
+
// Each call awaits its own promise: per-call `mutate` callbacks fire only
|
|
162
|
+
// for an observer's latest call, so two verdicts flushed together (the
|
|
163
|
+
// swipe deck's Undo windows) would drop the first one's result.
|
|
160
164
|
// The shared parameter-review component calls this for one exact action.
|
|
161
165
|
const executionId = connectorCallId(id);
|
|
162
166
|
if (executionId) {
|
|
163
|
-
resolve
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
},
|
|
167
|
+
resolve
|
|
168
|
+
.mutateAsync({ executionId, decision: verdict === 'approve' ? 'approve' : 'deny', note: feedback })
|
|
169
|
+
.then(() => {
|
|
170
|
+
if (verdict === 'approve')
|
|
171
|
+
successToast(tI18nComplete.raw('text2b2b0a697042'));
|
|
172
|
+
else
|
|
173
|
+
infoToast(tI18nComplete.raw('textda404deb110f'));
|
|
174
|
+
announced();
|
|
175
|
+
}, (e) => {
|
|
176
|
+
refused(e);
|
|
177
|
+
if (!isApprovalExpiredError(e))
|
|
178
|
+
return errorToast(e.message);
|
|
179
|
+
errorToast(tHardcodedUi('approvalPage.expiredHint'));
|
|
180
|
+
refreshInbox();
|
|
178
181
|
});
|
|
179
182
|
return;
|
|
180
183
|
}
|
|
@@ -183,47 +186,41 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
183
186
|
const crId = crChangeRequestId(id);
|
|
184
187
|
if (crId) {
|
|
185
188
|
if (verdict === 'approve') {
|
|
186
|
-
merge.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
+
merge.mutateAsync(crId).then(() => {
|
|
190
|
+
successToast(tI18nComplete.raw('text0cad31cba248'));
|
|
191
|
+
refreshInbox();
|
|
192
|
+
announced();
|
|
193
|
+
}, (e) => {
|
|
194
|
+
refused(e);
|
|
195
|
+
if (e.code === 'MERGE_CONFLICT') {
|
|
196
|
+
const item = items.find((candidate) => candidate.id === id);
|
|
197
|
+
const conflicts = e.data?.conflicts ?? [];
|
|
189
198
|
refreshInbox();
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
actions: [
|
|
203
|
-
{
|
|
204
|
-
label: tI18nComplete.raw('texte8a1fa10c8d2'),
|
|
205
|
-
onClick: () => recoverChange(item, conflicts),
|
|
206
|
-
},
|
|
207
|
-
],
|
|
208
|
-
});
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
199
|
+
if (item?.kind === 'change') {
|
|
200
|
+
errorToast(tI18nComplete.raw('text3923e8556e27'), {
|
|
201
|
+
description: tI18nComplete.raw('text3d33bdd92001'),
|
|
202
|
+
duration: CONFLICT_TOAST_MS,
|
|
203
|
+
actions: [
|
|
204
|
+
{
|
|
205
|
+
label: tI18nComplete.raw('texte8a1fa10c8d2'),
|
|
206
|
+
onClick: () => recoverChange(item, conflicts),
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
});
|
|
210
|
+
return;
|
|
211
211
|
}
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
}
|
|
213
|
+
errorToast(e.message);
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
216
|
else if (verdict === 'reject') {
|
|
217
|
-
close.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
refused(e);
|
|
225
|
-
errorToast(e.message);
|
|
226
|
-
},
|
|
217
|
+
close.mutateAsync(crId).then(() => {
|
|
218
|
+
infoToast(tI18nComplete.raw('text67382c89fdde'));
|
|
219
|
+
refreshInbox();
|
|
220
|
+
announced();
|
|
221
|
+
}, (e) => {
|
|
222
|
+
refused(e);
|
|
223
|
+
errorToast(e.message);
|
|
227
224
|
});
|
|
228
225
|
}
|
|
229
226
|
else {
|
|
@@ -236,28 +233,22 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
236
233
|
refused(new Error('A change request needs a note.'));
|
|
237
234
|
return;
|
|
238
235
|
}
|
|
239
|
-
requestChanges.
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
refused(e);
|
|
249
|
-
errorToast(e.message);
|
|
250
|
-
},
|
|
236
|
+
requestChanges.mutateAsync({ crId, feedback: note }).then((res) => {
|
|
237
|
+
successToast(res.delivering
|
|
238
|
+
? tI18nComplete.raw('text99764404a562')
|
|
239
|
+
: tI18nComplete.raw('text871f77182091'));
|
|
240
|
+
refreshInbox();
|
|
241
|
+
announced();
|
|
242
|
+
}, (e) => {
|
|
243
|
+
refused(e);
|
|
244
|
+
errorToast(e.message);
|
|
251
245
|
});
|
|
252
246
|
}
|
|
253
247
|
return;
|
|
254
248
|
}
|
|
255
|
-
act.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
refused(e);
|
|
259
|
-
errorToast(e.message);
|
|
260
|
-
},
|
|
249
|
+
act.mutateAsync({ id, verdict, feedback }).then(accepted, (e) => {
|
|
250
|
+
refused(e);
|
|
251
|
+
errorToast(e.message);
|
|
261
252
|
});
|
|
262
253
|
}
|
|
263
254
|
// Bulk verdicts send every id the inbox chose: native, and `call:` for
|
|
@@ -287,7 +278,9 @@ export function ReviewCenterConnected({ projectName }) {
|
|
|
287
278
|
// the deck draws nothing (the inbox shows its own empty state)
|
|
288
279
|
// rather than "Nothing waits on you" beside rows that do.
|
|
289
280
|
_jsx(AskDeck, { projectId: projectId, onOpenSession: openSession, empty: null, paused: paused, onCurrentAskChange: setCurrentAskId, onHiddenAskIdsChange: setHiddenAskIds, selectedAskId: selectedAskId, onClearSelection: () => setSelectedAskId(null) }))
|
|
290
|
-
: undefined, initialItems: items,
|
|
281
|
+
: undefined, initialItems: items,
|
|
282
|
+
// Behind `review_swipe`: the Review page opens on the swipe deck.
|
|
283
|
+
deckEnabled: deckEnabled, defaultView: deckEnabled ? 'cards' : 'list', segment: segment, onSegmentChange: setSegment, loadMore: hasNextPage
|
|
291
284
|
? {
|
|
292
285
|
onLoadMore: () => void fetchNextPage(),
|
|
293
286
|
isLoading: isFetchingNextPage,
|
|
@@ -39,12 +39,14 @@ export type SecretExposure = 'enforced' | 'environment' | 'disabled';
|
|
|
39
39
|
* - `llm_gateway` — the LLM providers screen (`provider-connect.tsx`).
|
|
40
40
|
* - `connector` — the connector binding, whose own control stays editable.
|
|
41
41
|
* - `git` — the git-connection flow (`apps/api/src/projects/lib/git.ts`).
|
|
42
|
+
* - `browser` — a website login link; the sandbox browser types it
|
|
43
|
+
* (`apps/api/src/projects/lib/browser-logins.ts`).
|
|
42
44
|
*
|
|
43
45
|
* Offering any of them in the exposure picker would offer a choice that does
|
|
44
46
|
* not exist, and saving would move the secret off the consumer the assigning
|
|
45
47
|
* flow reads.
|
|
46
48
|
*/
|
|
47
|
-
export type SecretUsage = 'agent' | 'llm_gateway' | 'connector' | 'git';
|
|
49
|
+
export type SecretUsage = 'agent' | 'llm_gateway' | 'connector' | 'git' | 'browser';
|
|
48
50
|
/** The stored `strategy` + `consumer` pair one exposure writes (spec §3). */
|
|
49
51
|
export declare function secretExposureTarget(exposure: SecretExposure): {
|
|
50
52
|
strategy: SecretDeliveryStrategy;
|
|
@@ -127,13 +129,8 @@ export type SecretDeliveryLegendEntry = SecretDeliveryPresentation & {
|
|
|
127
129
|
* The Secrets page renders this as its "What each Access value means" legend.
|
|
128
130
|
* It reads the same tables the picker and each row's badge read, which is the
|
|
129
131
|
* only reason the three can be trusted to agree.
|
|
130
|
-
*
|
|
131
|
-
* `showEnforced` drops the experimental "Enforce at the network" definition
|
|
132
|
-
* when no row uses it and the `secrets_egress` flag is off — the legend must
|
|
133
|
-
* not explain a value the picker never offers, or the page reintroduces exactly
|
|
134
|
-
* the network-boundary confusion the flag hides.
|
|
135
132
|
*/
|
|
136
|
-
export declare function secretDeliveryLegend(
|
|
133
|
+
export declare function secretDeliveryLegend(tI18nComplete?: UiTranslator): SecretDeliveryLegendEntry[];
|
|
137
134
|
/**
|
|
138
135
|
* The one badge a row shows.
|
|
139
136
|
*
|
|
@@ -182,15 +179,14 @@ export type SecretClassification = {
|
|
|
182
179
|
* 2. **A known model key.** `environment`, but the vendor's API host is still
|
|
183
180
|
* prefilled from the same catalog the LLM providers screen reads (or
|
|
184
181
|
* `WELL_KNOWN_API_HOSTS` when that provider's SDK hardcodes the URL). The
|
|
185
|
-
* host waits ready so that a
|
|
186
|
-
*
|
|
182
|
+
* host waits ready so that a person who switches to enforced does not
|
|
183
|
+
* have to type it.
|
|
187
184
|
* 3. **Everything else.** `environment` with an empty host list.
|
|
188
185
|
*
|
|
189
186
|
* The default is ALWAYS `environment`: the real value loads into the sandbox,
|
|
190
187
|
* the mode that needs no setup and works on every provider. Enforced (network
|
|
191
|
-
* substitution) is
|
|
192
|
-
*
|
|
193
|
-
* picker may not even show.
|
|
188
|
+
* substitution) is a per-secret choice; a new secret is never defaulted onto
|
|
189
|
+
* it, because an enforced secret needs its approved hosts first.
|
|
194
190
|
*/
|
|
195
191
|
export declare function classifyNewSecret(input: {
|
|
196
192
|
key: string;
|
|
@@ -215,15 +211,10 @@ export type SecretExposureOption = SecretDeliveryPresentation & {
|
|
|
215
211
|
/**
|
|
216
212
|
* The exposures the user may pick.
|
|
217
213
|
*
|
|
218
|
-
*
|
|
219
|
-
* substitution)
|
|
220
|
-
* project has turned on the `secrets_egress` flag, or the row being edited is
|
|
221
|
-
* already enforced (so a legacy/enforced secret stays readable and can be moved
|
|
222
|
-
* off enforcement even after the flag is switched back off). The default is
|
|
223
|
-
* always `environment`, so hiding `enforced` never leaves the picker pointing
|
|
224
|
-
* at an option that is not present.
|
|
214
|
+
* All three are always offered: `environment`, `enforced` (network
|
|
215
|
+
* substitution) and `disabled`. A new secret defaults to `environment`.
|
|
225
216
|
*/
|
|
226
|
-
export declare function secretExposureOptions(
|
|
217
|
+
export declare function secretExposureOptions(tI18nComplete?: UiTranslator): SecretExposureOption[];
|
|
227
218
|
export type SecretDeliveryBlockedReason = 'no_agent_grant';
|
|
228
219
|
/**
|
|
229
220
|
* Read the API's per-secret delivery verdict. The field is tri-state: absent or
|
|
@@ -41,6 +41,8 @@ export function secretUsage(strategy, consumer) {
|
|
|
41
41
|
return 'connector';
|
|
42
42
|
if (consumer === 'git_proxy')
|
|
43
43
|
return 'git';
|
|
44
|
+
if (consumer === 'browser')
|
|
45
|
+
return 'browser';
|
|
44
46
|
return 'agent';
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
@@ -59,7 +61,7 @@ export function secretUsageIsAssigned(consumer, opts) {
|
|
|
59
61
|
// disconnect: its owner picks its delivery.
|
|
60
62
|
if (consumer === 'connector')
|
|
61
63
|
return opts?.connectorBound ?? true;
|
|
62
|
-
return consumer === 'llm_gateway' || consumer === 'git_proxy';
|
|
64
|
+
return consumer === 'llm_gateway' || consumer === 'git_proxy' || consumer === 'browser';
|
|
63
65
|
}
|
|
64
66
|
/**
|
|
65
67
|
* The `(strategy, consumer)` pair a save writes, given the picked exposure and
|
|
@@ -136,9 +138,8 @@ export function connectorBindingChanges(connectors, secretIdentifier, selectedSl
|
|
|
136
138
|
* the mode that needs no setup and works the same on every provider. It is
|
|
137
139
|
* warning-toned everywhere it renders — it is the only value whose plaintext
|
|
138
140
|
* lands in a process the agent can read, an honest label, not an alarm.
|
|
139
|
-
* `enforced` sits second
|
|
140
|
-
*
|
|
141
|
-
* Kortix substitutes it outside on an approved host. `disabled` closes the list
|
|
141
|
+
* `enforced` sits second: the value never enters the sandbox, Kortix
|
|
142
|
+
* substitutes it outside on an approved host. `disabled` closes the list
|
|
142
143
|
* because it is an off switch, not a delivery mode.
|
|
143
144
|
*/
|
|
144
145
|
const EXPOSURE_PRESENTATIONS = {
|
|
@@ -188,6 +189,11 @@ const ASSIGNED_USAGE_PRESENTATIONS = {
|
|
|
188
189
|
description: 'Spent for repository access. It never enters the sandbox.',
|
|
189
190
|
tone: 'secondary',
|
|
190
191
|
},
|
|
192
|
+
browser: {
|
|
193
|
+
label: 'Website login',
|
|
194
|
+
description: 'Typed by the session browser on its sites only. It never enters the environment.',
|
|
195
|
+
tone: 'secondary',
|
|
196
|
+
},
|
|
191
197
|
};
|
|
192
198
|
/**
|
|
193
199
|
* Every Access value the page can show: the three exposures a user picks,
|
|
@@ -196,13 +202,8 @@ const ASSIGNED_USAGE_PRESENTATIONS = {
|
|
|
196
202
|
* The Secrets page renders this as its "What each Access value means" legend.
|
|
197
203
|
* It reads the same tables the picker and each row's badge read, which is the
|
|
198
204
|
* only reason the three can be trusted to agree.
|
|
199
|
-
*
|
|
200
|
-
* `showEnforced` drops the experimental "Enforce at the network" definition
|
|
201
|
-
* when no row uses it and the `secrets_egress` flag is off — the legend must
|
|
202
|
-
* not explain a value the picker never offers, or the page reintroduces exactly
|
|
203
|
-
* the network-boundary confusion the flag hides.
|
|
204
205
|
*/
|
|
205
|
-
export function secretDeliveryLegend(
|
|
206
|
+
export function secretDeliveryLegend(tI18nComplete) {
|
|
206
207
|
const exposurePresentations = tI18nComplete
|
|
207
208
|
? localizeUiCatalog(EXPOSURE_PRESENTATIONS, tI18nComplete, PRODUCT_CATALOG_TRANSLATION_KEYS)
|
|
208
209
|
: EXPOSURE_PRESENTATIONS;
|
|
@@ -210,9 +211,7 @@ export function secretDeliveryLegend(showEnforced = true, tI18nComplete) {
|
|
|
210
211
|
? localizeUiCatalog(ASSIGNED_USAGE_PRESENTATIONS, tI18nComplete, PRODUCT_CATALOG_TRANSLATION_KEYS)
|
|
211
212
|
: ASSIGNED_USAGE_PRESENTATIONS;
|
|
212
213
|
return [
|
|
213
|
-
...Object.keys(exposurePresentations)
|
|
214
|
-
.filter((key) => showEnforced || key !== 'enforced')
|
|
215
|
-
.map((key) => ({
|
|
214
|
+
...Object.keys(exposurePresentations).map((key) => ({
|
|
216
215
|
key,
|
|
217
216
|
kind: 'exposure',
|
|
218
217
|
...exposurePresentations[key],
|
|
@@ -330,15 +329,14 @@ function providerApiHost(provider) {
|
|
|
330
329
|
* 2. **A known model key.** `environment`, but the vendor's API host is still
|
|
331
330
|
* prefilled from the same catalog the LLM providers screen reads (or
|
|
332
331
|
* `WELL_KNOWN_API_HOSTS` when that provider's SDK hardcodes the URL). The
|
|
333
|
-
* host waits ready so that a
|
|
334
|
-
*
|
|
332
|
+
* host waits ready so that a person who switches to enforced does not
|
|
333
|
+
* have to type it.
|
|
335
334
|
* 3. **Everything else.** `environment` with an empty host list.
|
|
336
335
|
*
|
|
337
336
|
* The default is ALWAYS `environment`: the real value loads into the sandbox,
|
|
338
337
|
* the mode that needs no setup and works on every provider. Enforced (network
|
|
339
|
-
* substitution) is
|
|
340
|
-
*
|
|
341
|
-
* picker may not even show.
|
|
338
|
+
* substitution) is a per-secret choice; a new secret is never defaulted onto
|
|
339
|
+
* it, because an enforced secret needs its approved hosts first.
|
|
342
340
|
*/
|
|
343
341
|
export function classifyNewSecret(input) {
|
|
344
342
|
const key = input.key.trim().toUpperCase();
|
|
@@ -377,21 +375,14 @@ export function defaultSecretExposure(row, classification) {
|
|
|
377
375
|
/**
|
|
378
376
|
* The exposures the user may pick.
|
|
379
377
|
*
|
|
380
|
-
*
|
|
381
|
-
* substitution)
|
|
382
|
-
* project has turned on the `secrets_egress` flag, or the row being edited is
|
|
383
|
-
* already enforced (so a legacy/enforced secret stays readable and can be moved
|
|
384
|
-
* off enforcement even after the flag is switched back off). The default is
|
|
385
|
-
* always `environment`, so hiding `enforced` never leaves the picker pointing
|
|
386
|
-
* at an option that is not present.
|
|
378
|
+
* All three are always offered: `environment`, `enforced` (network
|
|
379
|
+
* substitution) and `disabled`. A new secret defaults to `environment`.
|
|
387
380
|
*/
|
|
388
|
-
export function secretExposureOptions(
|
|
381
|
+
export function secretExposureOptions(tI18nComplete) {
|
|
389
382
|
const presentations = tI18nComplete
|
|
390
383
|
? localizeUiCatalog(EXPOSURE_PRESENTATIONS, tI18nComplete, PRODUCT_CATALOG_TRANSLATION_KEYS)
|
|
391
384
|
: EXPOSURE_PRESENTATIONS;
|
|
392
|
-
return Object.keys(presentations)
|
|
393
|
-
.filter((exposure) => egressAvailable || exposure !== 'enforced')
|
|
394
|
-
.map((exposure) => ({
|
|
385
|
+
return Object.keys(presentations).map((exposure) => ({
|
|
395
386
|
exposure,
|
|
396
387
|
...presentations[exposure],
|
|
397
388
|
}));
|
|
@@ -40,9 +40,9 @@ import { PROJECT_ACTIONS } from '../../../internal/lib/project-actions.js';
|
|
|
40
40
|
import { useProjectCan } from '../../../internal/lib/use-project-can.js';
|
|
41
41
|
import { cn } from '../../../internal/lib/utils.js';
|
|
42
42
|
import { deletePersonalProjectSecret, deleteProjectSecret, getProjectDetail, grantSecretToAgent, listConnectors, listProjectSecrets, setConnectorSecretBinding, setProjectSecretStrategy, upsertProjectSecret, } from '@kortix/sdk';
|
|
43
|
-
import { contract, qk, refreshProjectProviderState,
|
|
43
|
+
import { contract, qk, refreshProjectProviderState, useProjectAccountId, useProjectConfig, } from '@kortix/sdk/react';
|
|
44
44
|
import { WarningIcon as DangerTriangleSolid, PencilSimpleIcon, MagnifyingGlassIcon as Search, TrashIcon, } from '@phosphor-icons/react';
|
|
45
|
-
import { agentGrantActionLabel, agentGrantCandidateHint, agentGrantConfirmation, agentGrantErrorMessage, agentGrantOutcome, agentGrantPlan, agentGrantSnippet, buildEnforcedPolicy, canSaveSecretDelivery, classifyNewSecret, connectorBindingChanges, connectorBindingOptions, defaultSecretExposure, enforcedEchoNotice, legacyInjectionDetail, missingAgentGrantNotice, secretDeliveryBlockedReason, secretDeliveryLegend, secretDeliveryPresentation, secretDeliverySyncWarning, secretDeliveryTarget,
|
|
45
|
+
import { agentGrantActionLabel, agentGrantCandidateHint, agentGrantConfirmation, agentGrantErrorMessage, agentGrantOutcome, agentGrantPlan, agentGrantSnippet, buildEnforcedPolicy, canSaveSecretDelivery, classifyNewSecret, connectorBindingChanges, connectorBindingOptions, defaultSecretExposure, enforcedEchoNotice, legacyInjectionDetail, missingAgentGrantNotice, secretDeliveryBlockedReason, secretDeliveryLegend, secretDeliveryPresentation, secretDeliverySyncWarning, secretDeliveryTarget, secretExposureOptions, secretUsageIsAssigned, shouldWarnMissingAgentGrant, } from './secret-delivery.js';
|
|
46
46
|
import { applyProjectSecretResponse, beginOptimisticProjectSecretSave, rollbackOptimisticProjectSecretSave, } from './secret-optimistic-cache.js';
|
|
47
47
|
import { AudienceBadge } from './audience-badge.js';
|
|
48
48
|
import { UndecryptableValue } from './undecryptable-value.js';
|
|
@@ -61,10 +61,6 @@ export function SecretsView({ projectId, surface = { kind: 'global' }, grant, })
|
|
|
61
61
|
const queryClient = useQueryClient();
|
|
62
62
|
const { navigate } = useSettingsNav();
|
|
63
63
|
const queryKey = useMemo(() => qk.project.secrets(projectId), [projectId]);
|
|
64
|
-
// Network-Enforced Secrets (`secrets_egress`) is experimental and off by
|
|
65
|
-
// default. When off, the picker offers only Environment variable and
|
|
66
|
-
// Disabled — a new secret loads its real value into the sandbox.
|
|
67
|
-
const egressEnabled = useFeatureFlag(projectId, 'secrets_egress').enabled;
|
|
68
64
|
const secretsQuery = useQuery({
|
|
69
65
|
queryKey,
|
|
70
66
|
queryFn: () => listProjectSecrets(projectId),
|
|
@@ -89,10 +85,6 @@ export function SecretsView({ projectId, surface = { kind: 'global' }, grant, })
|
|
|
89
85
|
const allRows = useMemo(() => (agentGrant ? projectRows.filter((r) => r.strategy === 'runtime' || r.strategy === 'egress') : projectRows), [agentGrant, projectRows]);
|
|
90
86
|
const viewerId = useUiViewerId() ?? null;
|
|
91
87
|
const tSharing = useI18nTranslations('accessSharing');
|
|
92
|
-
// A legacy/enforced row keeps its "Enforce at the network" badge even with the
|
|
93
|
-
// flag off, so the legend must still explain that value when one exists.
|
|
94
|
-
const hasEnforcedRow = allRows.some((r) => secretExposure(r.strategy, r.consumer) === 'enforced');
|
|
95
|
-
const showEnforced = egressEnabled || hasEnforcedRow;
|
|
96
88
|
const missingRequired = allRows.filter((r) => r.requirement === 'required' && !r.configured);
|
|
97
89
|
const [query, setQuery] = useState('');
|
|
98
90
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
@@ -159,7 +151,7 @@ export function SecretsView({ projectId, surface = { kind: 'global' }, grant, })
|
|
|
159
151
|
}, size: "lg", className: "flex-1", children: [_jsx(SplitSheetMain, { children: _jsxs(CapabilityPageShell, { title: tI18nComplete.raw('textd8707d411d99'), description: agentGrant ? tI18nComplete.raw('textbb74cc7dce98') : tI18nComplete.raw('texteca47e3afa10'), filters: agentGrant ? (_jsx(GrantModeTabs, { grant: withCatalog(agentGrant, allRows.map((r) => r.identifier)), label: tAgentScope('secretsAccess') })) : undefined, search:
|
|
160
152
|
/* Hidden until there is a list to search, the same rule Triggers
|
|
161
153
|
uses: a filter over nothing is a control that cannot do anything. */
|
|
162
|
-
showContent && allRows.length > 0 ? (_jsxs(InputGroupSearch, { children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { ref: searchRef, placeholder: tI18nComplete.raw('textb5814f05b923'), value: query, onChange: (e) => setQuery(e.target.value), variant: "popover", size: "sm" }), query ? _jsx(InputGroupSearchClear, { onClick: () => setQuery('') }) : null] })) : undefined, titleAddon: _jsx(SecretsAccessInfo, {
|
|
154
|
+
showContent && allRows.length > 0 ? (_jsxs(InputGroupSearch, { children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { ref: searchRef, placeholder: tI18nComplete.raw('textb5814f05b923'), value: query, onChange: (e) => setQuery(e.target.value), variant: "popover", size: "sm" }), query ? _jsx(InputGroupSearchClear, { onClick: () => setQuery('') }) : null] })) : undefined, titleAddon: _jsx(SecretsAccessInfo, {}), action: showContent && canManage ? (_jsx(NewEntityMenu, { label: tI18nComplete.raw('text18fdd549b2ed'), pending: configure.pending, onChat: () => configure.start(newConfigPrompt('secret')), manual: {
|
|
163
155
|
description: tI18nComplete.raw('textefd041115e9e'),
|
|
164
156
|
onSelect: openCreate,
|
|
165
157
|
} })) : undefined, children: [_jsx("div", { className: "space-y-4", children: secretsQuery.isLoading ? (_jsx("div", { className: "space-y-1", children: Array.from({ length: 5 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 rounded-md" }, i))) })) : secretsQuery.isError ? (_jsx(ErrorState, { size: "sm", title: tHardcodedUi.raw('appProjectsIdCustomizeSecretsPage.line773JsxAttrTitleFailedToLoadSecrets'), description: secretsQuery.error?.message ?? tI18nComplete.raw('text398e53499fed'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => secretsQuery.refetch(), children: tI18nComplete.raw('text942087cc2d41') }) })) : (_jsxs(_Fragment, { children: [missingRequired.length > 0 && (_jsxs(BannerAlert, { variant: "warning", children: [_jsx(BannerAlertMedia, { children: _jsx(DangerTriangleSolid, { weight: "fill" }) }), _jsx(BannerAlertTitle, { children: tI18nComplete('text10d33709a797', {
|
|
@@ -182,7 +174,7 @@ export function SecretsView({ projectId, surface = { kind: 'global' }, grant, })
|
|
|
182
174
|
},
|
|
183
175
|
onError: (e) => errorToast(e instanceof Error ? e.message : tI18nComplete.raw('text7673a45d3385')),
|
|
184
176
|
});
|
|
185
|
-
}, isPending: removeShared.isPending })] }) }), _jsx(SplitSheetContent, { children: _jsx(SecretDialog, { presentation: "sheet", onSavingChange: setEditorSaving, open: dialogOpen, onOpenChange: setDialogOpen, projectId: projectId, row: dialogRow, connectors: connectorsQuery.data?.connectors ?? [], connectorsLoading: connectorsQuery.isLoading,
|
|
177
|
+
}, isPending: removeShared.isPending })] }) }), _jsx(SplitSheetContent, { children: _jsx(SecretDialog, { presentation: "sheet", onSavingChange: setEditorSaving, open: dialogOpen, onOpenChange: setDialogOpen, projectId: projectId, row: dialogRow, connectors: connectorsQuery.data?.connectors ?? [], connectorsLoading: connectorsQuery.isLoading, onSaved: refreshSecretsAndProviders }, dialogRow?.identifier ?? 'new') })] }));
|
|
186
178
|
}
|
|
187
179
|
/**
|
|
188
180
|
* What the Access column means, behind the info button after the page title.
|
|
@@ -196,12 +188,10 @@ export function SecretsView({ projectId, surface = { kind: 'global' }, grant, })
|
|
|
196
188
|
* that render each row's badge and each option in the dialog's picker.
|
|
197
189
|
* Restating them here in JSX is how the legend and the badge start disagreeing.
|
|
198
190
|
*/
|
|
199
|
-
function SecretsAccessInfo(
|
|
191
|
+
function SecretsAccessInfo() {
|
|
200
192
|
const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
|
|
201
193
|
const heading = tI18nComplete.raw('text0d8c9f89b826');
|
|
202
|
-
return (_jsxs(HoverCard, { openDelay: 150, children: [_jsx(HoverCardTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", className: "text-muted-foreground", "aria-label": heading, children: _jsx(InfoIcon, { className: "size-4" }) }) }), _jsxs(HoverCardContent, { align: "start", className: "max-h-[min(36rem,var(--radix-hover-card-content-available-height))] w-[26rem] max-w-[calc(100vw-2rem)] space-y-3 overflow-y-auto p-4", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: heading }), _jsx("dl", { className: "space-y-2.5", children: secretDeliveryLegend(
|
|
203
|
-
? tI18nComplete.raw('text8aa824e472ff')
|
|
204
|
-
: tI18nComplete.raw('texte5a718af362a'), ' ', tI18nComplete.raw('texte1673f438808'), showEnforced ? (_jsxs(_Fragment, { children: [' ', _jsx("span", { className: "text-foreground", children: tI18nComplete.raw('text82ff5452a98d') }), ' ', tI18nComplete.raw('text49e63b9b35ec'), " ", _jsx("code", { className: "font-mono", children: "secrets" }), ' ', tI18nComplete.raw('text582967534d0f'), ' ', _jsx("code", { className: "font-mono", children: "kortix.yaml" }), ";", ' ', _jsx("code", { className: "font-mono", children: "secrets: \"*\"" }), ' ', tI18nComplete.raw('text17313fb7bf82')] })) : null, ' ', tI18nComplete.raw('text52c3509531f1'), ' ', _jsx("span", { className: "text-foreground", children: tI18nComplete.raw('textad26af1426b3') }), ' ', tI18nComplete.raw('textbbdce4215935'), ' ', _jsx("span", { className: "text-foreground", children: tI18nComplete.raw('text8f0d706fff25') }), ' ', tI18nComplete.raw('text41232780dc9c'), ' ', _jsx("span", { className: "text-foreground", children: tI18nComplete.raw('textb949c922b6ef') }), ' ', tI18nComplete.raw('text06a6228ef85f')] }), _jsxs(Link, { href: "/docs/guide#secrets-you-choose-who-uses-them-and-how", target: "_blank", rel: "noreferrer", className: "text-foreground inline-flex items-center gap-1.5 text-xs font-medium hover:underline", children: [_jsx(BookOpenIcon, { className: "size-3.5 shrink-0" }), tI18nComplete.raw('text7af023c43013')] })] })] }));
|
|
194
|
+
return (_jsxs(HoverCard, { openDelay: 150, children: [_jsx(HoverCardTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", className: "text-muted-foreground", "aria-label": heading, children: _jsx(InfoIcon, { className: "size-4" }) }) }), _jsxs(HoverCardContent, { align: "start", className: "max-h-[min(36rem,var(--radix-hover-card-content-available-height))] w-[26rem] max-w-[calc(100vw-2rem)] space-y-3 overflow-y-auto p-4", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: heading }), _jsx("dl", { className: "space-y-2.5", children: secretDeliveryLegend(tI18nComplete).map((mode) => (_jsxs("div", { className: "space-y-1", children: [_jsx("dt", { children: _jsx(Badge, { variant: mode.tone, size: "sm", className: "normal-case", children: mode.label }) }), _jsx("dd", { className: "text-muted-foreground text-xs text-pretty", children: mode.description })] }, mode.key))) }), _jsxs("p", { className: "text-muted-foreground border-border border-t pt-3 text-xs text-pretty", children: [tI18nComplete.raw('text8aa824e472ff'), ' ', tI18nComplete.raw('texte1673f438808'), ' ', _jsx("span", { className: "text-foreground", children: tI18nComplete.raw('text82ff5452a98d') }), ' ', tI18nComplete.raw('text49e63b9b35ec'), " ", _jsx("code", { className: "font-mono", children: "secrets" }), ' ', tI18nComplete.raw('text582967534d0f'), ' ', _jsx("code", { className: "font-mono", children: "kortix.yaml" }), ";", ' ', _jsx("code", { className: "font-mono", children: "secrets: \"*\"" }), ' ', tI18nComplete.raw('text17313fb7bf82'), ' ', tI18nComplete.raw('text52c3509531f1'), ' ', _jsx("span", { className: "text-foreground", children: tI18nComplete.raw('textad26af1426b3') }), ' ', tI18nComplete.raw('textbbdce4215935'), ' ', _jsx("span", { className: "text-foreground", children: tI18nComplete.raw('text8f0d706fff25') }), ' ', tI18nComplete.raw('text41232780dc9c'), ' ', _jsx("span", { className: "text-foreground", children: tI18nComplete.raw('textb949c922b6ef') }), ' ', tI18nComplete.raw('text06a6228ef85f')] }), _jsxs(Link, { href: "/docs/guide#secrets-you-choose-who-uses-them-and-how", target: "_blank", rel: "noreferrer", className: "text-foreground inline-flex items-center gap-1.5 text-xs font-medium hover:underline", children: [_jsx(BookOpenIcon, { className: "size-3.5 shrink-0" }), tI18nComplete.raw('text7af023c43013')] })] })] }));
|
|
205
195
|
}
|
|
206
196
|
/**
|
|
207
197
|
* Normalize whatever the API gave us into the shape we expect. We're defensive
|
|
@@ -365,14 +355,13 @@ export function ProjectSecretDialog({ projectId, row, open, onOpenChange, onSave
|
|
|
365
355
|
...contract('config'),
|
|
366
356
|
enabled: open,
|
|
367
357
|
});
|
|
368
|
-
|
|
369
|
-
return (_jsx(SecretDialog, { open: open, onOpenChange: onOpenChange, projectId: projectId, row: row, connectors: connectorsQuery.data?.connectors ?? [], connectorsLoading: connectorsQuery.isLoading, egressEnabled: egressEnabled, onSaved: () => {
|
|
358
|
+
return (_jsx(SecretDialog, { open: open, onOpenChange: onOpenChange, projectId: projectId, row: row, connectors: connectorsQuery.data?.connectors ?? [], connectorsLoading: connectorsQuery.isLoading, onSaved: () => {
|
|
370
359
|
queryClient.invalidateQueries({ queryKey: qk.project.secrets(projectId) });
|
|
371
360
|
refreshProjectProviderState(queryClient, projectId);
|
|
372
361
|
onSaved?.();
|
|
373
362
|
} }, row?.identifier ?? 'new'));
|
|
374
363
|
}
|
|
375
|
-
function SecretDialog({ open, onOpenChange, projectId, row, connectors, connectorsLoading,
|
|
364
|
+
function SecretDialog({ open, onOpenChange, projectId, row, connectors, connectorsLoading, onSaved, presentation = 'modal', onSavingChange, }) {
|
|
376
365
|
const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
|
|
377
366
|
const queryClient = useQueryClient();
|
|
378
367
|
const projectConfig = useProjectConfig(projectId);
|
|
@@ -673,11 +662,7 @@ function SecretDialog({ open, onOpenChange, projectId, row, connectors, connecto
|
|
|
673
662
|
const connectorOnlyDelivery = secretDeliveryPresentation('broker', 'connector', { tI18nComplete });
|
|
674
663
|
const bindingIdentifier = (row?.identifier ?? identifier).trim() || key.trim().toUpperCase();
|
|
675
664
|
const connectorOptions = connectorBindingOptions(connectors, bindingIdentifier, tI18nComplete);
|
|
676
|
-
|
|
677
|
-
// when this row is already enforced (so a legacy secret stays readable and
|
|
678
|
-
// can be moved off enforcement even after the flag is switched back off).
|
|
679
|
-
const rowIsEnforced = row ? secretExposure(row.strategy, row.consumer) === 'enforced' : false;
|
|
680
|
-
const exposureOptions = secretExposureOptions(egressEnabled || rowIsEnforced, tI18nComplete);
|
|
665
|
+
const exposureOptions = secretExposureOptions(tI18nComplete);
|
|
681
666
|
const echoNotice = enforcedEchoNotice(hosts, tI18nComplete);
|
|
682
667
|
const legacyDetail = legacyInjectionDetail(legacyInject ? currentPolicy : null, tI18nComplete);
|
|
683
668
|
// The dialog keeps the row it opened with, so a completed grant clears its own
|