@jini-ai/integrations 0.7.3-next.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -0
  3. package/dist/api-connections/bundled-client-namespace.d.ts +24 -0
  4. package/dist/api-connections/bundled-client-namespace.js +22 -0
  5. package/dist/api-connections/connect.d.ts +2 -10
  6. package/dist/api-connections/connect.js +1 -1
  7. package/dist/api-connections/contribution.d.ts +71 -0
  8. package/dist/api-connections/contribution.js +69 -0
  9. package/dist/api-connections/form-delivery-connection.d.ts +68 -0
  10. package/dist/api-connections/form-delivery-connection.js +73 -0
  11. package/dist/api-connections/hosted-mcp/contracts.d.ts +4 -171
  12. package/dist/api-connections/hosted-mcp/index.d.ts +2 -0
  13. package/dist/api-connections/hosted-mcp/oauth-row-writes.d.ts +3 -1
  14. package/dist/api-connections/hosted-mcp/oauth-row-writes.js +6 -3
  15. package/dist/api-connections/hosted-mcp/shared-sign-in.d.ts +2 -1
  16. package/dist/api-connections/hosted-mcp/sign-in-configuration.js +1 -1
  17. package/dist/api-connections/hosted-mcp/sign-in-discovery.js +1 -1
  18. package/dist/api-connections/hosted-mcp/sign-in-flow.d.ts +9 -3
  19. package/dist/api-connections/hosted-mcp/sign-in-flow.js +6 -6
  20. package/dist/api-connections/hosted-mcp/sign-in-provider.d.ts +16 -4
  21. package/dist/api-connections/hosted-mcp/sign-in-provider.js +3 -3
  22. package/dist/api-connections/hosted-mcp/sign-in-status.d.ts +13 -2
  23. package/dist/api-connections/hosted-mcp/sign-in-status.js +17 -4
  24. package/dist/api-connections/hosted-mcp/sign-in.d.ts +1 -1
  25. package/dist/api-connections/hosted-mcp/sign-in.js +28 -30
  26. package/dist/api-connections/shared-api.d.ts +87 -0
  27. package/dist/api-connections/shared-api.js +135 -0
  28. package/dist/api-connections/shared-oauth-disconnect.d.ts +73 -0
  29. package/dist/api-connections/shared-oauth-disconnect.js +41 -0
  30. package/dist/api-connections/shared-owner.d.ts +107 -0
  31. package/dist/api-connections/shared-owner.js +79 -0
  32. package/dist/api-connections/vault-stores.d.ts +110 -0
  33. package/dist/api-connections/vault-stores.js +202 -0
  34. package/dist/credentialed-http/auth-schemes.d.ts +2 -9
  35. package/dist/credentialed-http/tools/index.d.ts +30 -0
  36. package/dist/credentialed-http/tools/index.js +19 -0
  37. package/dist/credentialed-http/tools/tool-registrations.js +0 -1
  38. package/dist/custom-credentials/agent-tools.d.ts +79 -0
  39. package/dist/custom-credentials/agent-tools.js +98 -0
  40. package/dist/custom-credentials/card-token.d.ts +15 -0
  41. package/dist/custom-credentials/card-token.js +35 -0
  42. package/dist/custom-credentials/credential-ports.d.ts +70 -0
  43. package/dist/custom-credentials/credential-ports.js +41 -0
  44. package/dist/custom-credentials/credential-recovery.d.ts +20 -0
  45. package/dist/custom-credentials/credential-recovery.js +22 -0
  46. package/dist/custom-credentials/credentialed-request.d.ts +83 -0
  47. package/dist/custom-credentials/credentialed-request.js +93 -0
  48. package/dist/custom-credentials/custom-credential-create-ui.d.ts +106 -0
  49. package/dist/custom-credentials/custom-credential-create-ui.js +136 -0
  50. package/dist/custom-credentials/custom-credential-set-token-ui.d.ts +84 -0
  51. package/dist/custom-credentials/custom-credential-set-token-ui.js +104 -0
  52. package/dist/custom-credentials/delete-request-confirmation-ui.d.ts +33 -0
  53. package/dist/custom-credentials/delete-request-confirmation-ui.js +35 -0
  54. package/dist/custom-credentials/provider-settings-card.d.ts +109 -0
  55. package/dist/custom-credentials/provider-settings-card.js +166 -0
  56. package/dist/custom-credentials/write-files-validation.d.ts +102 -0
  57. package/dist/custom-credentials/write-files-validation.js +202 -0
  58. package/dist/media-providers/catalog-projection.d.ts +29 -0
  59. package/dist/media-providers/catalog-projection.js +45 -0
  60. package/dist/media-providers/catalog.d.ts +6 -3
  61. package/dist/media-providers/catalog.js +4 -3
  62. package/dist/media-providers/configurable-catalog.d.ts +9 -0
  63. package/dist/media-providers/configurable-catalog.js +70 -0
  64. package/dist/media-providers/dispatch/builtin-vendors.js +0 -2
  65. package/dist/media-providers/dispatch/credentials.d.ts +4 -1
  66. package/dist/media-providers/dispatch/credentials.js +3 -2
  67. package/dist/media-providers/dispatch/engine.d.ts +1 -1
  68. package/dist/media-providers/dispatch/engine.js +17 -5
  69. package/dist/media-providers/dispatch/index.d.ts +3 -2
  70. package/dist/media-providers/dispatch/index.js +2 -2
  71. package/dist/media-providers/dispatch/media-provider-registry.d.ts +23 -4
  72. package/dist/media-providers/dispatch/media-provider-registry.js +26 -11
  73. package/dist/media-providers/dispatch/media-wire.d.ts +14 -0
  74. package/dist/media-providers/dispatch/media-wire.js +22 -0
  75. package/dist/media-providers/dispatch/node.d.ts +5 -0
  76. package/dist/media-providers/dispatch/node.js +5 -1
  77. package/dist/media-providers/dispatch/openai-compatible.d.ts +3 -1
  78. package/dist/media-providers/dispatch/openai-compatible.js +1 -1
  79. package/dist/media-providers/dispatch/operation-runtime.js +5 -4
  80. package/dist/media-providers/dispatch/outbound.d.ts +28 -3
  81. package/dist/media-providers/dispatch/outbound.js +10 -3
  82. package/dist/media-providers/dispatch/providers/custom-image.js +1 -1
  83. package/dist/media-providers/dispatch/providers/imagerouter.js +1 -1
  84. package/dist/media-providers/dispatch/providers/nanobanana.js +1 -1
  85. package/dist/media-providers/dispatch/providers/openrouter.js +1 -1
  86. package/dist/media-providers/dispatch/ssrf-guard.js +2 -2
  87. package/dist/media-providers/dispatch/types.d.ts +13 -4
  88. package/dist/media-providers/dispatch/vendor-adapter.js +2 -2
  89. package/dist/media-providers/index.d.ts +2 -0
  90. package/dist/media-providers/providers.d.ts +9 -5
  91. package/dist/media-providers/providers.js +9 -12
  92. package/dist/media-providers/sqlite-task-store.d.ts +4 -4
  93. package/dist/media-providers/task-store.d.ts +1 -1
  94. package/dist/media-providers/task-store.js +1 -1
  95. package/dist/media-providers/types.d.ts +0 -36
  96. package/dist/media-providers/ui-defaults.js +0 -4
  97. package/dist/react/admin-credentials/AdminByokKeyPanel.d.ts +130 -0
  98. package/dist/react/admin-credentials/AdminByokKeyPanel.js +115 -0
  99. package/dist/react/admin-credentials/byok-footer-status.d.ts +37 -0
  100. package/dist/react/admin-credentials/byok-footer-status.js +25 -0
  101. package/dist/react/credentials/OtherCredentialsSection.d.ts +36 -0
  102. package/dist/react/credentials/OtherCredentialsSection.hooks.d.ts +55 -0
  103. package/dist/react/credentials/OtherCredentialsSection.hooks.js +26 -0
  104. package/dist/react/credentials/OtherCredentialsSection.js +120 -0
  105. package/dist/react/credentials/access-token-forms.d.ts +219 -0
  106. package/dist/react/credentials/access-token-forms.js +114 -0
  107. package/dist/react/credentials/credential-copy.d.ts +17 -0
  108. package/dist/react/credentials/credential-copy.js +7 -0
  109. package/dist/react/credentials/other-credential-stores.d.ts +115 -0
  110. package/dist/react/credentials/other-credential-stores.js +76 -0
  111. package/dist/react/site-key/SiteKeyRecoveryCard.d.ts +16 -0
  112. package/dist/react/site-key/SiteKeyRecoveryCard.js +36 -0
  113. package/dist/react/site-key/SiteKeyTab.d.ts +100 -0
  114. package/dist/react/site-key/SiteKeyTab.js +127 -0
  115. package/dist/react/site-key/hooks/use-site-key-recovery.hooks.d.ts +77 -0
  116. package/dist/react/site-key/hooks/use-site-key-recovery.hooks.js +126 -0
  117. package/dist/react/site-key/hooks/use-site-key.hooks.d.ts +120 -0
  118. package/dist/react/site-key/hooks/use-site-key.hooks.js +95 -0
  119. package/dist/react/webhooks/IntegrationDeliveries.d.ts +41 -0
  120. package/dist/react/webhooks/IntegrationDeliveries.js +24 -0
  121. package/dist/react/webhooks/Integrations.d.ts +73 -0
  122. package/dist/react/webhooks/Integrations.js +97 -0
  123. package/dist/react/webhooks/hooks/use-integration-deliveries.hooks.d.ts +59 -0
  124. package/dist/react/webhooks/hooks/use-integration-deliveries.hooks.js +11 -0
  125. package/dist/react/webhooks/hooks/use-integrations.hooks.d.ts +119 -0
  126. package/dist/react/webhooks/hooks/use-integrations.hooks.js +129 -0
  127. package/dist/react/webhooks/rules.d.ts +118 -0
  128. package/dist/react/webhooks/rules.js +103 -0
  129. package/dist/saved-requests/execute.js +2 -3
  130. package/dist/saved-requests/types.d.ts +4 -1
  131. package/dist/secrets/index.d.ts +3 -0
  132. package/dist/secrets/index.js +3 -0
  133. package/dist/secrets/ports.d.ts +25 -0
  134. package/dist/secrets/ports.js +2 -0
  135. package/dist/secrets/types.d.ts +10 -0
  136. package/dist/secrets/types.js +2 -0
  137. package/dist/vendor-credentials/abort-guarded-repo.d.ts +14 -0
  138. package/dist/vendor-credentials/abort-guarded-repo.js +41 -0
  139. package/dist/vendor-credentials/project-scope.d.ts +43 -0
  140. package/dist/vendor-credentials/project-scope.js +32 -0
  141. package/dist/vendor-credentials/vault-adapter.d.ts +157 -0
  142. package/dist/vendor-credentials/vault-adapter.js +220 -0
  143. package/dist/web-screenshot/capture-files.d.ts +44 -0
  144. package/dist/web-screenshot/capture-files.js +62 -0
  145. package/dist/web-screenshot/capture-retention.d.ts +157 -0
  146. package/dist/web-screenshot/capture-retention.js +134 -0
  147. package/dist/web-screenshot/capture-root-file-lock.d.ts +20 -0
  148. package/dist/web-screenshot/capture-root-file-lock.js +15 -0
  149. package/dist/web-screenshot/desktop-page-capture.d.ts +37 -0
  150. package/dist/web-screenshot/desktop-page-capture.js +62 -0
  151. package/dist/web-screenshot/own-site-opener.d.ts +40 -0
  152. package/dist/web-screenshot/own-site-opener.js +27 -0
  153. package/dist/web-screenshot/screenshot-image.d.ts +11 -0
  154. package/dist/web-screenshot/screenshot-image.js +12 -0
  155. package/dist/web-screenshot/web-screenshot.d.ts +188 -0
  156. package/dist/web-screenshot/web-screenshot.js +329 -0
  157. package/dist/webhooks/delivery.d.ts +16 -0
  158. package/dist/webhooks/delivery.js +41 -1
  159. package/dist/webhooks/ports.d.ts +1 -29
  160. package/dist/webhooks/signing.keyring.d.ts +1 -1
  161. package/dist/webhooks/site/delivery.d.ts +60 -0
  162. package/dist/webhooks/site/delivery.js +45 -0
  163. package/dist/webhooks/site/http.memory.d.ts +51 -0
  164. package/dist/webhooks/site/http.memory.js +28 -0
  165. package/dist/webhooks/site/repo.memory.d.ts +136 -0
  166. package/dist/webhooks/site/repo.memory.js +215 -0
  167. package/dist/webhooks/site/seal-aad-invariant.d.ts +26 -0
  168. package/dist/webhooks/site/seal-aad-invariant.js +61 -0
  169. package/dist/webhooks/site/seal-aad-invariant.node.d.ts +42 -0
  170. package/dist/webhooks/site/seal-aad-invariant.node.js +52 -0
  171. package/dist/webhooks/site/signing.d.ts +28 -0
  172. package/dist/webhooks/site/signing.js +27 -0
  173. package/dist/webhooks/site/signing.keyring.d.ts +29 -0
  174. package/dist/webhooks/site/signing.keyring.js +30 -0
  175. package/dist/webhooks/site/subscriptions.d.ts +118 -0
  176. package/dist/webhooks/site/subscriptions.js +98 -0
  177. package/dist/webhooks/sql/index.d.ts +4 -0
  178. package/dist/webhooks/sql/index.js +2 -0
  179. package/dist/webhooks/sql/repo.rows.d.ts +47 -0
  180. package/dist/webhooks/sql/repo.rows.js +2 -0
  181. package/dist/webhooks/sql/webhook-repo.d.ts +152 -0
  182. package/dist/webhooks/sql/webhook-repo.js +308 -0
  183. package/dist/webhooks/subscriptions.d.ts +3 -1
  184. package/dist/webhooks/subscriptions.js +4 -1
  185. package/dist/webhooks/tools/tool-handlers.js +2 -1
  186. package/dist/webhooks/types.d.ts +6 -10
  187. package/package.json +517 -12
  188. package/dist/media-providers/dispatch/providers/grok.d.ts +0 -55
  189. package/dist/media-providers/dispatch/providers/grok.js +0 -116
@@ -0,0 +1,115 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { agentHandle } from "@jini-ai/core/agent-handles";
3
+ /**
4
+ * @file The three small pieces `SettingsUi.tsx`'s Execution tab and `AiAssistant.tsx`'s
5
+ * `AdminExecutionMode` both mount around `ExecutionTab` for the admin's own BYOK credential — the
6
+ * migration banner, the "Save key" footer, and the "Save settings" footer. Presentational only; all
7
+ * state and API calls live in the host credential hook, shared by both callers
8
+ * so the two mounts render (and behave) identically rather than drifting — see that hook's own file
9
+ * doc for why one shared implementation matters here specifically.
10
+ *
11
+ * `AdminByokKeyFooter`'s output is meant for `ExecutionTab`'s `apiKeyFooter` prop (directly under the
12
+ * key field) and `AdminByokSettingsFooter`'s for its `formFooter` prop (the foot of the same card,
13
+ * under Base URL / Max tokens / Model). Two slots because they are two buttons with two disjoint
14
+ * jobs, and each belongs beside the fields it writes — see the hook's "One button per patch" doc.
15
+ * `AdminByokMigrationPrompt` is a sibling of `<ExecutionTab>`, not a child of it — it has to render
16
+ * regardless of whether BYOK mode is even selected, since an admin might be sitting in Local CLI mode
17
+ * with a legacy key still inert in this browser's `localStorage`.
18
+ *
19
+ * All three take an optional pass-through `agentHandle` — the caller names the one thing
20
+ * (`AdminByokMigrationPrompt`'s prompt, each footer's button), and the prompt derives its own
21
+ * sub-handles from it via {@link byokAgentProps}. Omit and none renders any `data-agent-*` markup at
22
+ * all.
23
+ */
24
+ /** Builds one of these two components' own `data-agent-*` sub-element props, or nothing when the
25
+ * caller published no base handle — same local-helper shape `RowMenu.tsx` uses for its own
26
+ * `rowMenuAgentProps`, kept local here since only these two components need it.
27
+ *
28
+ * @param input.base - The component's own handle from the caller, or `undefined` when none was published.
29
+ * @param input.action - The sub-element's name, appended to `base`.
30
+ * @param input.options - Role and stable label for this sub-element.
31
+ * @returns Spreadable attribute props, or `{}` when `base` is `undefined`.
32
+ * @complexity O(1). */
33
+ function byokAgentProps({ base, action, options }, _options = {}) {
34
+ return base === undefined ? {} : agentHandle({ handle: `${base}-${action}` }, options);
35
+ }
36
+ /**
37
+ * The one-time "we found a saved key in this browser — save it to your account?" prompt (owner-
38
+ * approved rollout, design doc §6). Renders nothing once `controller.legacyKey` is `null` —
39
+ * migrated, declined this session, or there was never a local key to find.
40
+ *
41
+ * @complexity Time/space: O(1) — fixed markup, no iteration.
42
+ * @overallScore 100
43
+ */
44
+ export function AdminByokMigrationPrompt({ controller, agentHandle: base, useAdminLocaleHook, createTranslator }) {
45
+ const locale = useAdminLocaleHook();
46
+ const t = createTranslator({ locale }, {});
47
+ if (!controller.legacyKey)
48
+ return null;
49
+ const saving = controller.saveState.status === "saving";
50
+ return (_jsxs("div", { className: "notice admin-byok-migration", role: "status", children: [_jsx("p", { children: t({ key: "We found a saved key in this browser — save it to your account? It will be encrypted and stored on the server, and this browser's copy will be cleared once that succeeds. Declining leaves it exactly as it is; nothing is sent or cleared unless you confirm." }) }), _jsxs("div", { className: "admin-byok-migration-actions", children: [_jsx("button", { type: "button", className: "btn-primary", onClick: () => void controller.migrateLegacyKey(), disabled: saving, ...byokAgentProps({ base, action: "save", options: { role: "button", label: "Save this browser's key to your account" } }), children: saving ? t({ key: "Saving…" }) : t({ key: "Save to my account" }) }), _jsx("button", { type: "button", className: "btn-secondary", onClick: controller.dismissLegacyPrompt, disabled: saving, ...byokAgentProps({ base, action: "dismiss", options: { role: "button", label: "Dismiss this prompt without saving" } }), children: t({ key: "Not now" }) })] }), controller.saveState.status === "error" ? _jsx("div", { className: "save-error", children: controller.saveState.message }) : null] }));
51
+ }
52
+ /**
53
+ * The explicit "Save key" control and its status line — the ONLY control on either screen that
54
+ * writes the admin's KEY. Meant for `ExecutionTab`'s `apiKeyFooter` slot, directly under the
55
+ * API-key field. Its sibling {@link AdminByokSettingsFooter} writes the non-secret fields and
56
+ * nothing else.
57
+ *
58
+ * While idle with a key stored for another endpoint (a provider switch), the line asks for this
59
+ * provider's key rather than reporting a stored key this provider cannot use.
60
+ *
61
+ * @complexity Time/space: O(1).
62
+ */
63
+ export function AdminByokKeyFooter({ controller, agentHandle: handle, t, useAdminLocaleHook, createTranslator, resolveByokFooterStatusLine }) {
64
+ const locale = useAdminLocaleHook();
65
+ const sharedT = createTranslator({ locale }, {});
66
+ const { saveState, canSaveKey, stored, storedKeyIsForOtherEndpoint } = controller;
67
+ const saving = saveState.status === "saving";
68
+ const statusLine = resolveByokFooterStatusLine({ status: saveState.status, isStored: stored?.isSet ?? false }, { storedKeyIsForOtherEndpoint, t: t ?? ((key) => sharedT({ key })) });
69
+ return (_jsxs("div", { className: "assistant-key-footer", children: [_jsx("div", { className: "assistant-key-actions", children: _jsx("button", { type: "button", className: "btn-primary", onClick: () => void controller.saveKey(), disabled: !canSaveKey || saving, ...(handle ? agentHandle({ handle }, { role: "button", label: "Save this API key" }) : {}), children: saving ? sharedT({ key: "Saving…" }) : sharedT({ key: "Save key" }) }) }), _jsx("p", { className: "assistant-save-line", children: statusLine }), saveState.status === "error" ? _jsx("div", { className: "save-error", children: saveState.message }) : null] }));
70
+ }
71
+ /**
72
+ * {@link AdminByokSettingsFooter}'s status line, as a single string (or `null`) — the sibling of
73
+ * {@link resolveByokFooterStatusLine}, kept as its own pure function for the same reason.
74
+ *
75
+ * Deliberately says "Settings saved." and never anything about encryption or the server holding a
76
+ * key. This button sends no `apiKey`, so borrowing the key footer's "Saved to the server,
77
+ * encrypted." would recreate — under a new button — the exact false confirmation the split exists to
78
+ * remove.
79
+ *
80
+ * `error` returns `null` because the message itself is rendered separately, same division of labour
81
+ * as the key footer.
82
+ *
83
+ * @param input.status - The `settingsSaveState` status this footer reports on.
84
+ * @param options.t - The host screen's translator. Defaults to English passthrough.
85
+ * @returns The line to render, or `null` when there is nothing to say.
86
+ * @complexity O(1).
87
+ */
88
+ export function resolveByokSettingsStatusLine({ status }, { t = (key) => key } = {}) {
89
+ if (status === "saving")
90
+ return t("Saving…");
91
+ if (status === "saved")
92
+ return t("Settings saved.");
93
+ return null;
94
+ }
95
+ /**
96
+ * The explicit "Save settings" control and its status line — the ONLY control on either screen that
97
+ * writes the credential row's protocol/providerId/base URL/model/max-tokens snapshot. Meant for
98
+ * `ExecutionTab`'s `formFooter` slot, at the foot of the BYOK card under the fields it writes.
99
+ *
100
+ * Never disabled by the key field's state, only by its own in-flight save: settings are not the key,
101
+ * and a blank key field is no reason to refuse a model change. That independence is the point of the
102
+ * split — see the controller's `saveSettings` doc for why this button, not `saveKey`, is what keeps
103
+ * the server-side turn-execution fallback current.
104
+ *
105
+ * @complexity Time/space: O(1).
106
+ */
107
+ export function AdminByokSettingsFooter({ controller, agentHandle: handle, t, useAdminLocaleHook, createTranslator }) {
108
+ const locale = useAdminLocaleHook();
109
+ const sharedT = createTranslator({ locale }, {});
110
+ const { settingsSaveState } = controller;
111
+ const saving = settingsSaveState.status === "saving";
112
+ const statusLine = resolveByokSettingsStatusLine({ status: settingsSaveState.status }, { t: t ?? ((key) => sharedT({ key })) });
113
+ return (_jsxs("div", { className: "assistant-settings-footer", children: [_jsx("div", { className: "assistant-key-actions", children: _jsx("button", { type: "button", className: "btn-primary", onClick: () => void controller.saveSettings(), disabled: saving, ...(handle ? agentHandle({ handle }, { role: "button", label: "Save these execution settings" }) : {}), children: saving ? sharedT({ key: "Saving…" }) : sharedT({ key: "Save settings" }) }) }), statusLine ? _jsx("p", { className: "assistant-save-line", children: statusLine }) : null, settingsSaveState.status === "error" ? _jsx("div", { className: "save-error", children: settingsSaveState.message }) : null] }));
114
+ }
115
+ //# sourceMappingURL=AdminByokKeyPanel.js.map
@@ -0,0 +1,37 @@
1
+ export type AdminByokSaveState = {
2
+ status: "idle";
3
+ } | {
4
+ status: "saving";
5
+ } | {
6
+ status: "saved";
7
+ } | {
8
+ status: "error";
9
+ message: string;
10
+ };
11
+ /**
12
+ * {@link AdminByokKeyFooter}'s status line, as a single string (or `null` to render nothing) — the
13
+ * four mutually-exclusive `saveState.status` checks that used to sit directly in
14
+ * `AdminByokKeyFooter`'s JSX (`components/AdminByokKeyPanel.tsx`), pulled out as a top-level pure
15
+ * function per the complexity-ceiling brief. `isStored` takes the already-narrowed boolean rather
16
+ * than the full `stored` record, so this function has no dependency on
17
+ * `AdminExecutionCredentialController`'s shape beyond the one field it reads.
18
+ *
19
+ * @param optional.storedKeyIsForOtherEndpoint - The controller's flag of the same name. While idle, the line
20
+ * then asks for this provider's key instead of reporting a stored key this provider cannot use —
21
+ * the same ask, and the same dictionary key, as the visitor screen's key line.
22
+ * @complexity O(1).
23
+ */
24
+ export declare function resolveByokFooterStatusLine({ status, isStored, copy }: {
25
+ status: AdminByokSaveState["status"];
26
+ isStored: boolean;
27
+ copy: {
28
+ saving: string;
29
+ saved: string;
30
+ otherEndpoint: string;
31
+ stored: string;
32
+ enterKey: string;
33
+ };
34
+ }, { storedKeyIsForOtherEndpoint }?: {
35
+ storedKeyIsForOtherEndpoint?: boolean;
36
+ }): string | null;
37
+ //# sourceMappingURL=byok-footer-status.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * {@link AdminByokKeyFooter}'s status line, as a single string (or `null` to render nothing) — the
3
+ * four mutually-exclusive `saveState.status` checks that used to sit directly in
4
+ * `AdminByokKeyFooter`'s JSX (`components/AdminByokKeyPanel.tsx`), pulled out as a top-level pure
5
+ * function per the complexity-ceiling brief. `isStored` takes the already-narrowed boolean rather
6
+ * than the full `stored` record, so this function has no dependency on
7
+ * `AdminExecutionCredentialController`'s shape beyond the one field it reads.
8
+ *
9
+ * @param optional.storedKeyIsForOtherEndpoint - The controller's flag of the same name. While idle, the line
10
+ * then asks for this provider's key instead of reporting a stored key this provider cannot use —
11
+ * the same ask, and the same dictionary key, as the visitor screen's key line.
12
+ * @complexity O(1).
13
+ */
14
+ export function resolveByokFooterStatusLine({ status, isStored, copy }, { storedKeyIsForOtherEndpoint = false } = {}) {
15
+ if (status === "saving")
16
+ return copy.saving;
17
+ if (status === "saved")
18
+ return copy.saved;
19
+ if (status !== "idle")
20
+ return null;
21
+ if (storedKeyIsForOtherEndpoint)
22
+ return copy.otherEndpoint;
23
+ return isStored ? copy.stored : copy.enterKey;
24
+ }
25
+ //# sourceMappingURL=byok-footer-status.js.map
@@ -0,0 +1,36 @@
1
+ import type { OtherCredentialStoreInfo } from "./other-credential-stores.js";
2
+ import type { OtherCredentialRowState, useOtherCredentialRemoveDialog } from "./OtherCredentialsSection.hooks.js";
3
+ import { type Translate } from '@jini-ai/core/text';
4
+ type OtherCredentialsController = {
5
+ t: Translate;
6
+ remove: (row: OtherCredentialRowState) => Promise<void>;
7
+ };
8
+ /** One top-level Tier-2 entry — see this file's header for why this has no separate parent heading
9
+ * the way a Tier-1 `ProviderGroup` does. `row` is `undefined` for the not-configured placeholder.
10
+ * Exported (2026-09-21 round 2): `AccessTokensTab.tsx` now mounts this directly, one call per
11
+ * `useMergedSecretsOrder` entry, in place of the deleted `OtherCredentialsSection` wrapper. */
12
+ export declare function OtherCredentialEntry({ store, row, controller, deps }: {
13
+ store: OtherCredentialStoreInfo;
14
+ row: OtherCredentialRowState | undefined;
15
+ controller: OtherCredentialsController;
16
+ deps: {
17
+ useAdminLocaleHook: () => string;
18
+ useOtherCredentialRemoveDialogHook: typeof useOtherCredentialRemoveDialog;
19
+ removeDialogTitle: (required: {
20
+ locale: string;
21
+ name: string;
22
+ }) => string;
23
+ otherCredentialRemoveDialogBody: (required: {
24
+ locale: string;
25
+ store: OtherCredentialStoreInfo;
26
+ }) => string;
27
+ VIEWER_TIME_ZONE: string | undefined;
28
+ /** "Remove from the host," never "Revoke": removal forgets the stored copy, the provider keeps the key. */
29
+ REMOVE_FROM_HOST: string;
30
+ removeHandleLabel: (required: {
31
+ name: string;
32
+ }) => string;
33
+ };
34
+ }, _optional?: {}): import("react").JSX.Element;
35
+ export {};
36
+ //# sourceMappingURL=OtherCredentialsSection.d.ts.map
@@ -0,0 +1,55 @@
1
+ import type { ForwardedRef } from "react";
2
+ import type { OtherCredentialStoreInfo } from "./other-credential-stores.js";
3
+ export interface OtherCredentialRowState {
4
+ /** `${storeId}:${itemId}` — stable across re-renders, and unique even though `media-provider`/
5
+ * `external-mcp` can each hold more than one item. */
6
+ readonly key: string;
7
+ readonly store: OtherCredentialStoreInfo;
8
+ /** The specific item within a multi-item store (a provider id or server id) — equal
9
+ * to `store.id` itself for the three single-scope stores, which only ever have one possible item. */
10
+ readonly itemId: string;
11
+ /** This row's own display name — the store's generic label for a single-scope store, or the
12
+ * item's own name (a media provider's catalog label, an MCP server's own label) for a multi-item one. */
13
+ readonly name: string;
14
+ /** What `§10`'s "never a reveal control" ceiling actually allows showing — a masked tail or an
15
+ * environment-variable-name count. See `rules.ts`'s `maskedTailFact`/`envNamesFact`. */
16
+ readonly valueFact: string;
17
+ readonly updatedAt: string | null;
18
+ readonly token: string;
19
+ readonly saving: boolean;
20
+ readonly error: string | null;
21
+ }
22
+ /**
23
+ * @file `OtherCredentialsSection.tsx`'s `forwardRef` `<dialog>` sub-component's own handlers —
24
+ * `OtherCredentialRemoveDialog`'s close/confirm — split out per the
25
+ * `<Name>.tsx`/`<Name>.hooks.tsx` extraction pattern (admin TSX-logic-sweep: deferred 2026-09-03,
26
+ * fixed 2026-09-05). Mirrors `AccessTokensTab.hooks.tsx`'s `useRemoveConfirmDialog` exactly, for
27
+ * Tier 2's own row shape — see that file's header for why this takes the forwarded ref as a
28
+ * parameter rather than restructuring the dialog into a controlled `open`-prop shape.
29
+ */
30
+ export interface OtherCredentialRemoveDialogActions {
31
+ close: () => void;
32
+ confirm: () => void;
33
+ }
34
+ /**
35
+ * `OtherCredentialRemoveDialog`'s close/confirm — extracted verbatim, same two calls, same order.
36
+ *
37
+ * @param required - The dialog and controller inputs.
38
+ * @param required.ref - The forwarded ref `OtherCredentialRemoveDialog` receives from its caller.
39
+ * @param required.row - The credential row this confirm dialog is for.
40
+ * @param required.controller - `OtherCredentialsController.remove` is the one call this hook makes.
41
+ * @returns `close`/`confirm`, wired directly to the dialog's Cancel/"Remove from the host" buttons.
42
+ * @complexity O(1).
43
+ */
44
+ export declare function useOtherCredentialRemoveDialog({ ref, row, controller }: {
45
+ ref: ForwardedRef<HTMLDialogElement>;
46
+ row: OtherCredentialRowState;
47
+ controller: {
48
+ remove: (row: OtherCredentialRowState) => Promise<void>;
49
+ };
50
+ }, _optional?: Record<string, never>): OtherCredentialRemoveDialogActions;
51
+ /** Display-only ids for Tier 2 controls; raw item ids remain storage/draft keys. O(n) in id characters. */
52
+ export declare function rowHandleBase({ row }: {
53
+ row: OtherCredentialRowState;
54
+ }, _optional?: Record<string, never>): string;
55
+ //# sourceMappingURL=OtherCredentialsSection.hooks.d.ts.map
@@ -0,0 +1,26 @@
1
+ import { agentHandleSegment } from "@jini-ai/core/agent-handles";
2
+ /**
3
+ * `OtherCredentialRemoveDialog`'s close/confirm — extracted verbatim, same two calls, same order.
4
+ *
5
+ * @param required - The dialog and controller inputs.
6
+ * @param required.ref - The forwarded ref `OtherCredentialRemoveDialog` receives from its caller.
7
+ * @param required.row - The credential row this confirm dialog is for.
8
+ * @param required.controller - `OtherCredentialsController.remove` is the one call this hook makes.
9
+ * @returns `close`/`confirm`, wired directly to the dialog's Cancel/"Remove from the host" buttons.
10
+ * @complexity O(1).
11
+ */
12
+ export function useOtherCredentialRemoveDialog({ ref, row, controller }, _optional = {}) {
13
+ function close() {
14
+ ref.current?.close();
15
+ }
16
+ function confirm() {
17
+ close();
18
+ void controller.remove(row);
19
+ }
20
+ return { close, confirm };
21
+ }
22
+ /** Display-only ids for Tier 2 controls; raw item ids remain storage/draft keys. O(n) in id characters. */
23
+ export function rowHandleBase({ row }, _optional = {}) {
24
+ return `${row.store.id}-${agentHandleSegment({ value: row.itemId })}`;
25
+ }
26
+ //# sourceMappingURL=OtherCredentialsSection.hooks.js.map
@@ -0,0 +1,120 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, useRef } from "react";
3
+ import { agentHandle, agentHandleSegment } from "@jini-ai/core/agent-handles";
4
+ import { rowHandleBase } from "./OtherCredentialsSection.hooks.js";
5
+ import { formatTimestamp } from '@jini-ai/core/text';
6
+ /**
7
+ * @file Tier 2 of the Access Tokens list — {@link OtherCredentialEntry}, the one top-level entry
8
+ * component for the six single-row/per-item credential stores (`rules.ts`'s
9
+ * `OTHER_CREDENTIAL_STORES`), rendered inline in the SAME merged, sorted list Tier 1's provider
10
+ * groups render in, per the 2026-08-16 owner ruling ("one list, not two surfaces") and the
11
+ * 2026-09-21 round-2 ruling that made it one TRUE ordered list rather than "Tier 1 sorted, Tier 2
12
+ * always appended after". `AccessTokensTab.hooks.tsx`'s `useMergedSecretsOrder` owns the visibility
13
+ * check and the per-store explosion into individual entries that this file used to own itself
14
+ * (`OtherCredentialsSection`/`MaybeOtherCredentialGroup`/`OtherCredentialGroup`, deleted this pass —
15
+ * see that hook's own doc for where the identical logic now lives); `AccessTokensTab.tsx` renders
16
+ * this component directly, one call per merged entry.
17
+ *
18
+ * ## Why a Tier-2 "entry" has no separate parent heading the way a Tier-1 provider group does
19
+ *
20
+ * Tier 1's `ProviderGroup` shows one `<h3>` (the PROVIDER's name, e.g. "GitHub") with multiple named
21
+ * `TokenRow`s underneath it, because one provider can hold several operator-named tokens. Nothing on
22
+ * Tier 2 is named that way — `media-provider`/`external-mcp` can each hold more
23
+ * than one ITEM (a provider, a server), but never more than one CREDENTIAL per item, so
24
+ * there is nothing to nest. The owner's own mock reflects this directly: "Cloudinary (media)" reads
25
+ * at the SAME indentation as the hosting/source-control providers, not nested under a "Media provider keys" parent —
26
+ * each configured item (or, when a store has none configured, the store itself) gets its own
27
+ * top-level entry, heading and all. {@link OtherCredentialEntry} is that entry; it structurally
28
+ * mirrors `ProviderGroup` (one heading, one row) with exactly zero or one row inside, never more.
29
+ */
30
+ function entryHandleLabel({ name, purposeLabel, configured }, _optional = {}) {
31
+ return configured ? `${name} — ${purposeLabel}, configured` : `${name} — ${purposeLabel}, not configured`;
32
+ }
33
+ /** One top-level Tier-2 entry — see this file's header for why this has no separate parent heading
34
+ * the way a Tier-1 `ProviderGroup` does. `row` is `undefined` for the not-configured placeholder.
35
+ * Exported (2026-09-21 round 2): `AccessTokensTab.tsx` now mounts this directly, one call per
36
+ * `useMergedSecretsOrder` entry, in place of the deleted `OtherCredentialsSection` wrapper. */
37
+ export function OtherCredentialEntry({ store, row, controller, deps }, _optional = {}) {
38
+ const translate = controller.t;
39
+ const name = row?.name ?? translate(store.label);
40
+ return (_jsxs("section", { className: "access-tokens-provider-group", ...agentHandle({ handle: `security-other-credentials-${store.id}-${agentHandleSegment({ value: row?.itemId ?? "none" })}` }, {
41
+ role: "region",
42
+ label: entryHandleLabel({ name, purposeLabel: store.purposeLabel, configured: row !== undefined }),
43
+ }), children: [_jsxs("h3", { className: "access-tokens-provider-heading", children: [_jsx("span", { translate: "no", children: name }), _jsxs("span", { className: "access-tokens-provider-purpose", children: [" \u00B7 ", translate(store.purposeLabel)] })] }), _jsx(OtherCredentialEntryBody, { store: store, row: row, controller: controller, deps: deps })] }));
44
+ }
45
+ /** The entry's body — placeholder / static-configured / replaceable-configured, split out purely for
46
+ * the complexity gate (this repo's hard 9/9 cyclomatic/cognitive ceiling — `eslint.config.mjs`'s
47
+ * `F06 option B`). */
48
+ function OtherCredentialEntryBody({ store, row, controller, deps }) {
49
+ if (row === undefined)
50
+ return _jsx(OtherCredentialPlaceholderRow, { store: store, t: controller.t });
51
+ if (store.supportsReplace)
52
+ return _jsx(OtherCredentialReplaceableRow, { row: row, controller: controller, deps: deps });
53
+ return _jsx(OtherCredentialStaticRow, { row: row, controller: controller, deps: deps });
54
+ }
55
+ /** @param handleSuffix - Distinguishes this deep link from every other row's — a bare store id for
56
+ * the unconfigured placeholder (only one ever renders per store) or {@link rowHandleBase} for a
57
+ * real row, since a store like `media-provider` can hold more than one configured item. */
58
+ function DeepLink({ store, handleSuffix, t: translate }) {
59
+ return (_jsxs("a", { className: "btn-secondary", href: `/admin${store.screenPath}`, ...agentHandle({ handle: `security-other-credentials-manage-${handleSuffix}` }, {
60
+ role: "link",
61
+ label: `Open ${store.screenLabel} to manage this credential`,
62
+ }), children: [translate("Manage on"), " ", translate(store.screenLabel), " \u2197"] }));
63
+ }
64
+ /** Nothing configured yet — same "always show it, invite the reader to go set it up" role Tier 1's
65
+ * `NotConnectedRow` plays, minus a `[Connect]` affordance: Tier 2 owns no Create flow (`rules.ts`'s
66
+ * own header on why), so the deep link IS this row's only action. */
67
+ function OtherCredentialPlaceholderRow({ store, t: translate }) {
68
+ return (_jsxs("div", { className: "access-tokens-row", children: [_jsxs("div", { className: "access-tokens-row-summary", children: [_jsx("span", { className: "access-tokens-row-marker", "aria-hidden": "true" }), _jsx("span", { className: "access-tokens-row-name", children: translate("Not configured") })] }), _jsx("div", { className: "access-tokens-row-actions", children: _jsx(DeepLink, { store: store, handleSuffix: store.id, t: translate }) })] }));
69
+ }
70
+ function OtherCredentialRemoveButton({ row, translate, dialogRef, deps }) {
71
+ return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "btn-danger", onClick: () => dialogRef.current?.showModal(), "aria-label": `${translate(deps.REMOVE_FROM_HOST)} — ${row.name}`, ...agentHandle({ handle: `security-other-credentials-remove-${rowHandleBase({ row })}` }, { role: "button", label: deps.removeHandleLabel({ name: row.name }) }), children: translate(deps.REMOVE_FROM_HOST) }), row.error ? (_jsx("p", { className: "save-error", role: "alert", children: row.error })) : null] }));
72
+ }
73
+ /** Configured, but this store does not support inline Replace (`external-mcp`
74
+ * — see `rules.ts`'s `OtherCredentialStoreInfo.supportsReplace` doc for why) — just the value fact,
75
+ * Remove, and the deep link, no disclosure to expand. Remove asks first, through the same
76
+ * {@link OtherCredentialRemoveDialog} the replaceable row uses: this store is the most
77
+ * destructive on the page (an External MCP delete loses a sealed OAuth secret for good), and this button used to fire on the first click. */
78
+ function OtherCredentialStaticRow({ row, controller, deps }) {
79
+ const translate = controller.t;
80
+ const dialogRef = useRef(null);
81
+ return (_jsxs("div", { className: "access-tokens-row access-tokens-row-done access-tokens-row-static", children: [_jsxs("div", { className: "access-tokens-row-summary", children: [_jsx("span", { className: "access-tokens-row-marker access-tokens-row-marker-done", "aria-hidden": "true", children: _jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: _jsx("path", { d: "m5 12 4 4L19 6" }) }) }), _jsx("span", { className: "access-tokens-row-fact", children: row.valueFact }), row.updatedAt ? (_jsxs("span", { className: "access-tokens-row-summary-meta", children: [translate("saved"), " ", formatTimestamp({ iso: row.updatedAt }, { viewerTimeZone: deps.VIEWER_TIME_ZONE })] })) : null] }), _jsxs("div", { className: "access-tokens-row-actions", children: [_jsx(DeepLink, { store: row.store, handleSuffix: rowHandleBase({ row }), t: translate }), _jsx(OtherCredentialRemoveButton, { row: row, translate: translate, dialogRef: dialogRef, deps: deps })] }), _jsx(OtherCredentialRemoveDialog, { ref: dialogRef, row: row, controller: controller, t: translate, deps: deps })] }));
82
+ }
83
+ /** Configured, and this store supports retyping the key on its own dedicated screen (`DeepLink`) —
84
+ * always rendered open, no accordion: unlike Tier 1's `TokenRow`, there is no inline form here worth
85
+ * hiding behind a click. The Access token field shown below is the same masked `row.valueFact` the
86
+ * summary line already carries, rendered `disabled` — a natural, familiar "this is set, go elsewhere
87
+ * to change it" cue, not an editable draft. Deliberately carries no `agentHandle()` — a disabled
88
+ * field tagged as fillable would have an assistant try to type into it, find it inert, and get stuck;
89
+ * the `DeepLink` below is the one actionable path to actually change this value, same as a person
90
+ * reading this row would use. */
91
+ function OtherCredentialReplaceableRow({ row, controller, deps }) {
92
+ const translate = controller.t;
93
+ const dialogRef = useRef(null);
94
+ return (_jsxs("div", { className: "access-tokens-row", children: [_jsxs("div", { className: "access-tokens-row-block", children: [_jsx("div", { className: "access-tokens-row-fields access-tokens-row-fields-top", children: _jsxs("div", { className: "field", children: [_jsxs("label", { className: "field-label", htmlFor: `security-other-credential-${rowHandleBase({ row })}`, children: [translate("Access token"), row.updatedAt ? (_jsxs("span", { className: "access-tokens-row-summary-meta access-tokens-field-label-meta", children: [translate("saved"), " ", formatTimestamp({ iso: row.updatedAt }, { viewerTimeZone: deps.VIEWER_TIME_ZONE })] })) : null] }), _jsx("input", { id: `security-other-credential-${rowHandleBase({ row })}`, className: "access-tokens-row-field-disabled", type: "text", autoComplete: "off", value: row.valueFact, disabled: true })] }) }), _jsxs("div", { className: "access-tokens-row-actions access-tokens-row-actions-top", children: [_jsx(DeepLink, { store: row.store, handleSuffix: rowHandleBase({ row }), t: translate }), _jsx(OtherCredentialRemoveButton, { row: row, translate: translate, dialogRef: dialogRef, deps: deps })] })] }), _jsx(OtherCredentialRemoveDialog, { ref: dialogRef, row: row, controller: controller, t: translate, deps: deps })] }));
95
+ }
96
+ /**
97
+ * Native `<dialog>` confirm, mirroring Tier 1's `RemoveConfirmDialog` — same "Remove from the host,
98
+ * never Revoke" load-bearing copy constraint (`rules.ts`'s own header) for the four replaceable
99
+ * stores: deleting the host's row does not revoke the credential at the provider, and this dialog is the
100
+ * one place that fact gets stated in words. The two static-row stores state their own, different
101
+ * fact instead (`otherCredentialRemoveDialogBody`). No equivalent "this is the last row for this provider" note: every Tier-2 store
102
+ * already caps at one row per item, so removing it is always the only-row case — the sentence would
103
+ * be true on every single Remove and therefore say nothing new.
104
+ *
105
+ * Confirm button carries no `agentHandle`, same destructive-action boundary Tier 1's own confirm
106
+ * dialog draws.
107
+ */
108
+ const OtherCredentialRemoveDialog = forwardRef(function OtherCredentialRemoveDialog({ row, controller, t: translate, deps }, ref) {
109
+ const locale = deps.useAdminLocaleHook();
110
+ const { close, confirm } = deps.useOtherCredentialRemoveDialogHook({ ref, row, controller });
111
+ // `aria-labelledby`, not left implicit — same fix, same reasoning, as Tier 1's own
112
+ // `RemoveConfirmDialog` (`AccessTokensTab.tsx`): a native `<dialog>` gets no accessible name
113
+ // for free from an `<h2>` inside it, and this doc comment's own header already promises this
114
+ // dialog "mirrors Tier 1's `RemoveConfirmDialog` exactly" — this brings that true for the title
115
+ // link too. `rowHandleBase({ row })` (already this row's DOM-id-safe base, used below by its own
116
+ // input/deep-link ids) keeps this id unique across every Tier-2 row's own dialog.
117
+ const titleId = `security-other-credentials-remove-title-${rowHandleBase({ row })}`;
118
+ return (_jsxs("dialog", { ref: ref, className: "confirm-dialog", "aria-labelledby": titleId, children: [_jsx("h2", { id: titleId, children: deps.removeDialogTitle({ locale, name: row.name }) }), _jsx("p", { className: "confirm-dialog-body", children: deps.otherCredentialRemoveDialogBody({ locale, store: row.store }) }), _jsxs("div", { className: "confirm-dialog-actions", children: [_jsx("button", { type: "button", onClick: close, ...agentHandle({ handle: `security-other-credentials-remove-cancel-${rowHandleBase({ row })}` }, { role: "button", label: "Close this dialog without removing the credential" }), children: translate("Cancel") }), _jsx("button", { type: "button", className: "btn-danger", onClick: confirm, children: translate(deps.REMOVE_FROM_HOST) })] })] }));
119
+ });
120
+ //# sourceMappingURL=OtherCredentialsSection.js.map
@@ -0,0 +1,219 @@
1
+ import type { AdminPublishConnectionInput, AdminCustomCredentialCategoryId } from "@jini-ai/core/contracts/site/api-security-api-types";
2
+ import type { SourceControlConnectionInput as AdminSourceControlConnectionInput } from "@jini-ai/core/contracts/site/source-control-credentials";
3
+ import type { AdminHttpError } from "@jini-ai/core/admin-runtime";
4
+ import type { trimChars } from "@jini-ai/core/primitives";
5
+ type AccessTokenFormFields = {
6
+ readonly worksFor?: string[];
7
+ readonly ref: {
8
+ readonly kind: "publish" | "source-control" | "custom";
9
+ readonly providerId: string;
10
+ };
11
+ readonly name: string;
12
+ readonly token: string;
13
+ readonly values: Readonly<Record<string, string>>;
14
+ readonly username: string;
15
+ };
16
+ type AccessTokenProviderInfo = {
17
+ readonly kind: "publish" | "source-control" | "custom";
18
+ readonly providerId: string;
19
+ readonly label: string;
20
+ readonly vendorLabel: string;
21
+ readonly purposeLabel: string;
22
+ readonly category: AdminCustomCredentialCategoryId;
23
+ readonly tokenPageUrl: string;
24
+ readonly scopeGuidanceKey: string;
25
+ readonly tokenLabel?: string;
26
+ readonly username?: "optional";
27
+ readonly unlisted?: true;
28
+ readonly publishCredential?: {
29
+ help?: string;
30
+ userHelp?: string;
31
+ vendorLabel?: string;
32
+ tokenField: string;
33
+ tokenPageUrl?: string;
34
+ fields: {
35
+ name: string;
36
+ label: string;
37
+ required?: boolean;
38
+ help?: string;
39
+ userHelp?: string;
40
+ secret?: true;
41
+ }[];
42
+ };
43
+ readonly extraFields: readonly {
44
+ name: string;
45
+ label: string;
46
+ required?: boolean;
47
+ help?: string;
48
+ userHelp?: string;
49
+ secret?: true;
50
+ }[];
51
+ };
52
+ type AccessTokenRow = {
53
+ readonly kind: "publish" | "source-control" | "custom";
54
+ readonly name: string;
55
+ readonly username?: string;
56
+ readonly worksFor?: string[];
57
+ };
58
+ /** Whether a token form has enough typed to save — a non-empty Name (new here; neither origin store's
59
+ * own form ever asked for one) PLUS whatever `info` says this provider cannot function without
60
+ * (`token`, always; a host descriptor's required fields). Does not check name uniqueness — that is {@link accessTokenNameTaken}'s job, surfaced
61
+ * as its own inline error rather than folded into the Save button's disabled state, so a collision
62
+ * reads as a specific, fixable reason rather than an unexplained disabled button.
63
+ * @complexity O(k) in this provider's own required-field count (at most one). */
64
+ export declare function accessTokenRowReadyToSave({ fields, info, deps }: {
65
+ fields: AccessTokenFormFields;
66
+ info: AccessTokenProviderInfo;
67
+ deps: {
68
+ requiredFieldsFilled: (required: {
69
+ fields: AccessTokenProviderInfo["extraFields"];
70
+ values: Readonly<Record<string, string>>;
71
+ }) => boolean;
72
+ };
73
+ }, _optional?: Record<string, never>): boolean;
74
+ /**
75
+ * The Replace-flow variant of {@link accessTokenRowReadyToSave} — an EXISTING row's Save button,
76
+ * which this page can enable in one more case neither `StaticSiteTab.tsx` nor `ProvidersTab.tsx`
77
+ * supports today: a rename with no new token typed. Both origin pages require a fresh token on every
78
+ * save regardless of connected state (`credentialFormReadyToSave`/
79
+ * `sourceControlCredentialRowReadyToSave` both unconditionally check `token.trim() !== ""`) — this
80
+ * page's own new Name field makes "I just want to rename this, not rotate it" a real, common action
81
+ * (the brief's own "give it whatever name you want" framing), so gating it behind a mandatory token
82
+ * retype would make the rename feature it introduces effectively unusable for that case.
83
+ *
84
+ * Three cases: nothing typed at all → not ready (there is no diff to send). A new name only (token
85
+ * blank) → ready, sent as a label-only `PUT` (no `connection` field, so the stored secret is
86
+ * untouched — same "omitting `connection` keeps the secret" contract `updatePublishCredential`'s own
87
+ * doc states). A new token (rename or not) → ready only once this provider's required extra fields
88
+ * are ALSO filled, same as create — a token replace still needs its extra fields/`username` alongside it
89
+ * because a fresh `connection` object is a full replacement, not a per-field patch.
90
+ * @complexity O(k) in this provider's own required-field count (at most one).
91
+ */
92
+ export declare function accessTokenReplaceReadyToSave({ fields, currentName, info, deps }: {
93
+ fields: AccessTokenFormFields;
94
+ currentName: string;
95
+ deps: Parameters<typeof accessTokenRowReadyToSave>[0]["deps"];
96
+ info: AccessTokenProviderInfo;
97
+ }, _options?: {}): boolean;
98
+ /**
99
+ * Builds the wire connection input for a create/update call — dispatches to
100
+ * `buildCredentialConnectionInput` (a host's descriptor fields, the typed token under its
101
+ * `tokenField`) / `buildSourceControlConnectionInput` by `fields.ref.kind` rather than re-deriving
102
+ * either provider's shape (this file's own header). A publish provider without a credential spec
103
+ * (only the bare fallback entry {@link accessTokenProviderInfo} makes) sends the token as `token`.
104
+ * @complexity O(f).
105
+ */
106
+ export declare function buildAccessTokenConnectionInput({ fields, info, deps }: {
107
+ fields: AccessTokenFormFields;
108
+ info: AccessTokenProviderInfo;
109
+ deps: {
110
+ buildCredentialConnectionInput: (required: {
111
+ providerId: string;
112
+ spec: NonNullable<AccessTokenProviderInfo["publishCredential"]>;
113
+ values: Readonly<Record<string, string>>;
114
+ }) => AdminPublishConnectionInput;
115
+ buildSourceControlConnectionInput: (required: {
116
+ fields: {
117
+ providerId: string;
118
+ token: string;
119
+ values: Readonly<Record<string, string>>;
120
+ };
121
+ declaredFields: AccessTokenProviderInfo["extraFields"];
122
+ }) => AdminSourceControlConnectionInput;
123
+ };
124
+ }, _optional?: Record<string, never>): AdminPublishConnectionInput | AdminSourceControlConnectionInput;
125
+ /** The DOM/agent id suffix of one extra field's input. `accountId` keeps its old `account` suffix
126
+ * (pinned by agent tooling); every other field uses its own name, hyphenated. @complexity O(n). */
127
+ export declare function accessTokenExtraFieldIdSuffix({ fieldName, deps }: {
128
+ fieldName: string;
129
+ deps: {
130
+ asciiSlug: (required: {
131
+ text: string;
132
+ trimChars: typeof trimChars;
133
+ }) => string;
134
+ fieldNameHandleSegment: (required: {
135
+ fieldName: string;
136
+ asciiSlug: (required: {
137
+ text: string;
138
+ trimChars: typeof trimChars;
139
+ }) => string;
140
+ }) => string;
141
+ };
142
+ }, _options?: {}): string;
143
+ /** Builds an update patch's non-secret/secret halves independently — split out of the hook's own
144
+ * `replaceToken` purely so that function's own branch count (readiness guard, uniqueness guard,
145
+ * try/catch, kind dispatch) stays under this repo's complexity gate. `label` is included only when
146
+ * the operator actually changed the name (a same-value PUT is a no-op write neither store needs to
147
+ * see); `connection` is included only when a new token was typed — see
148
+ * {@link accessTokenReplaceReadyToSave}'s own doc for why either can be true alone.
149
+ * @complexity O(1). */
150
+ export declare function buildAccessTokenUpdatePatch({ fields, nameChanged, hasToken, info, deps }: {
151
+ fields: AccessTokenFormFields;
152
+ deps: Parameters<typeof buildAccessTokenConnectionInput>[0]["deps"] & {
153
+ accessTokenWorksForChanged: (required: {
154
+ draft: string[] | undefined;
155
+ saved: readonly string[] | undefined;
156
+ }) => boolean;
157
+ };
158
+ nameChanged: boolean;
159
+ hasToken: boolean;
160
+ info: AccessTokenProviderInfo;
161
+ }, { currentWorksFor }?: {
162
+ currentWorksFor?: readonly string[];
163
+ }): {
164
+ label?: string;
165
+ connection?: AdminPublishConnectionInput | AdminSourceControlConnectionInput;
166
+ worksFor?: string[];
167
+ };
168
+ /** What a rejected credential create/update means for the FORM — a dictionary-key-shaped result to
169
+ * translate and apply. Mirrors `PublishCredentialSubmitFailure`/`SourceControlCredentialSubmitFailure`
170
+ * exactly (both stores' routes share the identical `409 -> DUPLICATE_LABEL` / `400 -> VALIDATION`
171
+ * wire shape — `publish-credentials.ts`'s own header says the source-control route "mirrors" it
172
+ * verbatim), reimplemented here rather than imported from either feature so this page owns no code
173
+ * dependency on `deployment/`/`source-control/` beyond their shared, provider-agnostic `rules.ts`
174
+ * data tables — same boundary `ProvidersTab.tsx`'s own header draws for the identical reason (two
175
+ * different agents building two different features in the same session). */
176
+ export type AccessTokenSubmitFailure = {
177
+ kind: "duplicate-label";
178
+ } | {
179
+ kind: "validation";
180
+ detail: string;
181
+ } | {
182
+ kind: "generic";
183
+ };
184
+ /**
185
+ * Classifies a rejected create/update/delete call. Reads `e.code`, falling back to `e.message`, for
186
+ * the two known markers, same reasoning `classifyCredentialSubmitError` in
187
+ * `@jini-ai/admin/shell/lib/credential-submit-error` documents.
188
+ * @complexity O(1).
189
+ */
190
+ export declare function classifyAccessTokenSubmitError({ e, isApiError }: {
191
+ e: unknown;
192
+ isApiError: (error: unknown) => error is AdminHttpError;
193
+ }, _options?: {}): AccessTokenSubmitFailure;
194
+ /** The Save-readiness gate for a SAVED row's Replace form, picked by row kind — the same split
195
+ * `use-access-tokens.hooks.ts`'s `replaceToken` makes before writing: a custom row uses
196
+ * {@link customCredentialReplaceReadyToSave} (a username-only change is a real edit), every catalog
197
+ * row keeps {@link accessTokenReplaceReadyToSave}. `ExistingTokenFields` used to call the catalog
198
+ * gate for every row, so a custom row's username-only fix left Save disabled even though the
199
+ * controller would have sent it. Works-for-only edits also enable Save without a token.
200
+ * @complexity O(draft + saved) time/space for compatibility membership. */
201
+ export declare function accessTokenExistingRowReadyToSave({ fields, row, info, SOURCE_CONTROL, deps }: {
202
+ SOURCE_CONTROL: "source-control";
203
+ deps: Parameters<typeof accessTokenRowReadyToSave>[0]["deps"] & {
204
+ accessTokenWorksForChanged: (required: {
205
+ draft: string[] | undefined;
206
+ saved: readonly string[] | undefined;
207
+ }) => boolean;
208
+ customCredentialReplaceReadyToSave: (required: {
209
+ fields: AccessTokenFormFields;
210
+ currentName: string;
211
+ currentUsername: string | undefined;
212
+ }) => boolean;
213
+ };
214
+ fields: AccessTokenFormFields;
215
+ row: Pick<AccessTokenRow, "kind" | "name" | "username" | "worksFor">;
216
+ info: AccessTokenProviderInfo;
217
+ }, _options?: {}): boolean;
218
+ export {};
219
+ //# sourceMappingURL=access-token-forms.d.ts.map