@yadsh/dsh-qa-integrations 0.8.3 → 0.10.0

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 (188) hide show
  1. package/README.md +44 -27
  2. package/compatibility.json +7 -3
  3. package/lib/broker.js +225 -18
  4. package/lib/broker.js.map +1 -1
  5. package/lib/client/bitrix24.js +8 -6
  6. package/lib/client/bitrix24.js.map +1 -1
  7. package/lib/client/card.js +14 -13
  8. package/lib/client/card.js.map +1 -1
  9. package/lib/client/confluence.js +11 -7
  10. package/lib/client/confluence.js.map +1 -1
  11. package/lib/client/credential-help-note.js +51 -0
  12. package/lib/client/credential-help-note.js.map +1 -0
  13. package/lib/client/gitlab.js +8 -6
  14. package/lib/client/gitlab.js.map +1 -1
  15. package/lib/client/index.js +38 -32
  16. package/lib/client/index.js.map +1 -1
  17. package/lib/client/integrations.js +31 -18
  18. package/lib/client/integrations.js.map +1 -1
  19. package/lib/client/jira.js +10 -8
  20. package/lib/client/jira.js.map +1 -1
  21. package/lib/client/operator-card.js +93 -534
  22. package/lib/client/operator-card.js.map +1 -1
  23. package/lib/client/operator-controls.js +72 -23
  24. package/lib/client/operator-controls.js.map +1 -1
  25. package/lib/client/operator-sections/bitrix24.js +22 -0
  26. package/lib/client/operator-sections/bitrix24.js.map +1 -0
  27. package/lib/client/operator-sections/confluence.js +27 -0
  28. package/lib/client/operator-sections/confluence.js.map +1 -0
  29. package/lib/client/operator-sections/credential-help.js +15 -0
  30. package/lib/client/operator-sections/credential-help.js.map +1 -0
  31. package/lib/client/operator-sections/general.js +8 -0
  32. package/lib/client/operator-sections/general.js.map +1 -0
  33. package/lib/client/operator-sections/gitlab.js +41 -0
  34. package/lib/client/operator-sections/gitlab.js.map +1 -0
  35. package/lib/client/operator-sections/jira.js +25 -0
  36. package/lib/client/operator-sections/jira.js.map +1 -0
  37. package/lib/client/operator-sections/provider-section.js +21 -0
  38. package/lib/client/operator-sections/provider-section.js.map +1 -0
  39. package/lib/client/operator-sections/service-profiles.js +178 -0
  40. package/lib/client/operator-sections/service-profiles.js.map +1 -0
  41. package/lib/client/operator-sections/shared.js +192 -0
  42. package/lib/client/operator-sections/shared.js.map +1 -0
  43. package/lib/client/operator-sections/teamcity.js +42 -0
  44. package/lib/client/operator-sections/teamcity.js.map +1 -0
  45. package/lib/client/operator-sections/testit.js +35 -0
  46. package/lib/client/operator-sections/testit.js.map +1 -0
  47. package/lib/client/operator-sections/weblate.js +32 -0
  48. package/lib/client/operator-sections/weblate.js.map +1 -0
  49. package/lib/client/operator-service-reach.js +98 -0
  50. package/lib/client/operator-service-reach.js.map +1 -0
  51. package/lib/client/provider-card.js +32 -19
  52. package/lib/client/provider-card.js.map +1 -1
  53. package/lib/client/styles.js +52 -15
  54. package/lib/client/styles.js.map +1 -1
  55. package/lib/client/teamcity.js +7 -5
  56. package/lib/client/teamcity.js.map +1 -1
  57. package/lib/client/testit.js +8 -6
  58. package/lib/client/testit.js.map +1 -1
  59. package/lib/client/weblate.js +8 -6
  60. package/lib/client/weblate.js.map +1 -1
  61. package/lib/client.js +2838 -1923
  62. package/lib/client.js.map +1 -1
  63. package/lib/config.js +64 -17
  64. package/lib/config.js.map +1 -1
  65. package/lib/index.js +177 -223
  66. package/lib/index.js.map +1 -1
  67. package/lib/providers/bitrix24/tools.js +7 -2
  68. package/lib/providers/bitrix24/tools.js.map +1 -1
  69. package/lib/providers/bitrix24/transport.js +16 -6
  70. package/lib/providers/bitrix24/transport.js.map +1 -1
  71. package/lib/providers/confluence/config.js +14 -55
  72. package/lib/providers/confluence/config.js.map +1 -1
  73. package/lib/providers/confluence/tools.js +7 -2
  74. package/lib/providers/confluence/tools.js.map +1 -1
  75. package/lib/providers/confluence/transport.js +42 -78
  76. package/lib/providers/confluence/transport.js.map +1 -1
  77. package/lib/providers/gitlab/config.js +11 -55
  78. package/lib/providers/gitlab/config.js.map +1 -1
  79. package/lib/providers/gitlab/operations.js +3 -3
  80. package/lib/providers/gitlab/operations.js.map +1 -1
  81. package/lib/providers/gitlab/tools.js +7 -2
  82. package/lib/providers/gitlab/tools.js.map +1 -1
  83. package/lib/providers/gitlab/transport.js +33 -65
  84. package/lib/providers/gitlab/transport.js.map +1 -1
  85. package/lib/providers/jira/config.js +18 -58
  86. package/lib/providers/jira/config.js.map +1 -1
  87. package/lib/providers/jira/jql.js +105 -1
  88. package/lib/providers/jira/jql.js.map +1 -1
  89. package/lib/providers/jira/tools.js +68 -2
  90. package/lib/providers/jira/tools.js.map +1 -1
  91. package/lib/providers/jira/transport.js +44 -110
  92. package/lib/providers/jira/transport.js.map +1 -1
  93. package/lib/providers/kernel/address.js +90 -0
  94. package/lib/providers/kernel/address.js.map +1 -0
  95. package/lib/providers/kernel/errors.js +42 -0
  96. package/lib/providers/kernel/errors.js.map +1 -0
  97. package/lib/providers/kernel/read-policy.js +250 -0
  98. package/lib/providers/kernel/read-policy.js.map +1 -0
  99. package/lib/providers/kernel/token.js +45 -0
  100. package/lib/providers/kernel/token.js.map +1 -0
  101. package/lib/providers/shared/service-boundary.js +31 -3
  102. package/lib/providers/shared/service-boundary.js.map +1 -1
  103. package/lib/providers/teamcity/tools.js +8 -3
  104. package/lib/providers/teamcity/tools.js.map +1 -1
  105. package/lib/providers/teamcity/transport.js +6 -8
  106. package/lib/providers/teamcity/transport.js.map +1 -1
  107. package/lib/providers/testit/config.js +12 -57
  108. package/lib/providers/testit/config.js.map +1 -1
  109. package/lib/providers/testit/tools.js +7 -2
  110. package/lib/providers/testit/tools.js.map +1 -1
  111. package/lib/providers/testit/transport.js +12 -12
  112. package/lib/providers/testit/transport.js.map +1 -1
  113. package/lib/providers/weblate/config.js +12 -55
  114. package/lib/providers/weblate/config.js.map +1 -1
  115. package/lib/providers/weblate/tools.js +7 -2
  116. package/lib/providers/weblate/tools.js.map +1 -1
  117. package/lib/providers/weblate/transport.js +21 -20
  118. package/lib/providers/weblate/transport.js.map +1 -1
  119. package/lib/public-api.js +79 -0
  120. package/lib/public-api.js.map +1 -0
  121. package/lib/repository.js +96 -16
  122. package/lib/repository.js.map +1 -1
  123. package/lib/service-credentials/config.js +61 -0
  124. package/lib/service-credentials/config.js.map +1 -1
  125. package/lib/service-credentials/policy.js +14 -1
  126. package/lib/service-credentials/policy.js.map +1 -1
  127. package/lib/service-credentials/rate-limit.js +136 -0
  128. package/lib/service-credentials/rate-limit.js.map +1 -0
  129. package/lib/tool-kit.js +15 -7
  130. package/lib/tool-kit.js.map +1 -1
  131. package/lib/tools.js +49 -24
  132. package/lib/tools.js.map +1 -1
  133. package/lib/typert.host.js +460 -352
  134. package/lib/typert.remote-client.js +450 -336
  135. package/lib/types/broker.d.ts +77 -3
  136. package/lib/types/client/card.d.ts +13 -4
  137. package/lib/types/client/credential-help-note.d.ts +26 -0
  138. package/lib/types/client/index.d.ts +15 -7
  139. package/lib/types/client/integrations.d.ts +5 -4
  140. package/lib/types/client/operator-card.d.ts +56 -4
  141. package/lib/types/client/operator-controls.d.ts +31 -0
  142. package/lib/types/client/operator-sections/bitrix24.d.ts +12 -0
  143. package/lib/types/client/operator-sections/confluence.d.ts +10 -0
  144. package/lib/types/client/operator-sections/credential-help.d.ts +17 -0
  145. package/lib/types/client/operator-sections/general.d.ts +11 -0
  146. package/lib/types/client/operator-sections/gitlab.d.ts +13 -0
  147. package/lib/types/client/operator-sections/jira.d.ts +11 -0
  148. package/lib/types/client/operator-sections/provider-section.d.ts +58 -0
  149. package/lib/types/client/operator-sections/service-profiles.d.ts +13 -0
  150. package/lib/types/client/operator-sections/shared.d.ts +123 -0
  151. package/lib/types/client/operator-sections/teamcity.d.ts +11 -0
  152. package/lib/types/client/operator-sections/testit.d.ts +10 -0
  153. package/lib/types/client/operator-sections/weblate.d.ts +10 -0
  154. package/lib/types/client/operator-service-reach.d.ts +76 -0
  155. package/lib/types/client/provider-card.d.ts +14 -3
  156. package/lib/types/client/styles.d.ts +28 -4
  157. package/lib/types/config.d.ts +49 -2
  158. package/lib/types/index.d.ts +54 -117
  159. package/lib/types/providers/bitrix24/tools.d.ts +2 -5
  160. package/lib/types/providers/confluence/tools.d.ts +2 -6
  161. package/lib/types/providers/confluence/transport.d.ts +0 -6
  162. package/lib/types/providers/gitlab/config.d.ts +1 -1
  163. package/lib/types/providers/gitlab/tools.d.ts +2 -6
  164. package/lib/types/providers/gitlab/transport.d.ts +3 -5
  165. package/lib/types/providers/jira/tools.d.ts +2 -6
  166. package/lib/types/providers/jira/transport.d.ts +2 -11
  167. package/lib/types/providers/kernel/address.d.ts +57 -0
  168. package/lib/types/providers/kernel/errors.d.ts +34 -0
  169. package/lib/types/providers/kernel/read-policy.d.ts +107 -0
  170. package/lib/types/providers/kernel/token.d.ts +25 -0
  171. package/lib/types/providers/shared/service-boundary.d.ts +15 -0
  172. package/lib/types/providers/teamcity/tools.d.ts +2 -6
  173. package/lib/types/providers/teamcity/transport.d.ts +1 -1
  174. package/lib/types/providers/testit/tools.d.ts +2 -6
  175. package/lib/types/providers/testit/transport.d.ts +1 -1
  176. package/lib/types/providers/weblate/tools.d.ts +2 -6
  177. package/lib/types/public-api.d.ts +80 -0
  178. package/lib/types/repository.d.ts +64 -2
  179. package/lib/types/service-credentials/config.d.ts +22 -0
  180. package/lib/types/service-credentials/rate-limit.d.ts +66 -0
  181. package/lib/types/service-credentials/types.d.ts +18 -0
  182. package/lib/types/tool-kit.d.ts +27 -1
  183. package/lib/types/tools.d.ts +26 -9
  184. package/lib/types/types.d.ts +17 -3
  185. package/package.json +23 -21
  186. package/lib/providers/shared/http.js +0 -168
  187. package/lib/providers/shared/http.js.map +0 -1
  188. package/lib/types/providers/shared/http.d.ts +0 -60
@@ -2,14 +2,20 @@ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
2
2
  import type { IntegrationProviderRegistry } from "./providers/registry.js";
3
3
  import type { IntegrationRepository } from "./repository.js";
4
4
  import type { SecretStore } from "./secrets/secret-store.js";
5
+ import { ServiceRateLimiter } from "./service-credentials/rate-limit.js";
5
6
  import type { ServiceCredentialRegistry } from "./service-credentials/registry.js";
6
- import { type ServiceCredentialHealth, type ServiceResourceBoundary } from "./service-credentials/types.js";
7
+ import { type ServiceCredentialHealth, type ServiceRateLimitConfig, type ServiceResourceBoundary } from "./service-credentials/types.js";
7
8
  import type { CredentialInput, CredentialSource, IntegrationPrincipal, IntegrationProviderId, IntegrationProviderSummary, IntegrationSummary, IntegrationToolResult, PolicyPatch } from "./types.js";
8
9
  export interface BrokerOptions {
9
10
  /** Absent in deployments that configure no managed credential at all. */
10
11
  readonly serviceCredentials?: ServiceCredentialRegistry | undefined;
11
12
  /** Whether a new connection starts in service mode when a profile exists. */
12
13
  readonly defaultForNewConnections?: boolean | undefined;
14
+ /**
15
+ * Ceiling of service-mode calls. Injectable for the same reason the registry
16
+ * takes its environment: the tests need a clock that is not the wall clock.
17
+ */
18
+ readonly rateLimits?: ServiceRateLimiter | undefined;
13
19
  }
14
20
  /** In-process broker boundary; no caller outside it receives decrypted secrets. */
15
21
  export declare class IntegrationBroker {
@@ -19,6 +25,7 @@ export declare class IntegrationBroker {
19
25
  private readonly logger;
20
26
  private serviceCredentials;
21
27
  private defaultForNewConnections;
28
+ private readonly rateLimits;
22
29
  constructor(repository: IntegrationRepository, secrets: SecretStore, providers: IntegrationProviderRegistry, logger: PluginLogger, options?: BrokerOptions);
23
30
  /**
24
31
  * Re-point the broker at the provider set and service-credential registry a
@@ -27,10 +34,21 @@ export declare class IntegrationBroker {
27
34
  * the configuration move here. An in-flight call keeps the captures it
28
35
  * already made and finishes against them.
29
36
  */
30
- swap(providers: IntegrationProviderRegistry, serviceCredentials: ServiceCredentialRegistry | undefined, defaultForNewConnections: boolean): void;
37
+ swap(providers: IntegrationProviderRegistry, serviceCredentials: ServiceCredentialRegistry | undefined, defaultForNewConnections: boolean, rateLimit: ServiceRateLimitConfig): void;
31
38
  listProviders(): readonly IntegrationProviderSummary[];
32
39
  list(principal: IntegrationPrincipal): readonly IntegrationSummary[];
33
40
  summary(principal: IntegrationPrincipal, providerId: IntegrationProviderId): IntegrationSummary;
41
+ /**
42
+ * The capabilities a connection may use as it stands: the stored grant, with
43
+ * anything this deployment has since withdrawn from the provider removed.
44
+ * Everything that decides or displays the reach of a connection reads through
45
+ * here — the call gate, the operator card, and the policy editor — so a
46
+ * capability the deployment has taken away is neither served, nor offered as a
47
+ * switch, nor able to collect a fresh allowance. A grant that survives only in
48
+ * the database stops being served, rather than running until the connection is
49
+ * next established.
50
+ */
51
+ private grantedCapabilities;
34
52
  /**
35
53
  * Connect one provider for one principal. The credential source is decided
36
54
  * here, server-side: the client may ask for service mode, and gets it only
@@ -43,6 +61,22 @@ export declare class IntegrationBroker {
43
61
  readonly useServiceCredential?: boolean | undefined;
44
62
  }): Promise<IntegrationSummary>;
45
63
  validate(principal: IntegrationPrincipal, providerId: IntegrationProviderId): Promise<IntegrationSummary>;
64
+ /**
65
+ * The identity a write-back has to compare against: the row, its revision and
66
+ * the credential of the binding this operation started from. Every field is
67
+ * needed — the revision alone cannot tell a replaced connection from a newly
68
+ * created one, because a disconnect erases the row and the next connect starts
69
+ * its revision over at the first number.
70
+ */
71
+ private bindingGeneration;
72
+ /**
73
+ * Store one validation verdict against the binding it was produced from. A
74
+ * probe outlives its binding whenever the account reconnects or switches
75
+ * credential mode while the provider is being reached: what it found describes
76
+ * a credential no longer in use, so that verdict is dropped and logged instead
77
+ * of overwriting the live binding's account and capabilities.
78
+ */
79
+ private recordValidation;
46
80
  /**
47
81
  * Probe the deployment's managed credential for one instance and report what
48
82
  * state it is in. The probe never changes upstream state, and the answer is a
@@ -53,9 +87,22 @@ export declare class IntegrationBroker {
53
87
  /**
54
88
  * Move one binding between credential sources. Both directions invalidate
55
89
  * everything derived from the previous identity by bumping the binding
56
- * revision, and neither direction ever falls back on its own.
90
+ * revision, and neither direction ever falls back on its own. A switch that
91
+ * reaches upstream first (the personal direction validates the stored token)
92
+ * only lands on the binding it started from, so a reconnect during that probe
93
+ * costs the switch rather than rewriting the new connection.
57
94
  */
58
95
  setCredentialSource(principal: IntegrationPrincipal, providerId: IntegrationProviderId, source: CredentialSource): Promise<IntegrationSummary>;
96
+ /**
97
+ * Refuse a switch the store would not apply: the account reconnected while the
98
+ * request was on its way, so the binding it was asked against is gone and the
99
+ * identity it carries is a token that has already been replaced. Nothing was
100
+ * written, so the answer names the lost generation rather than claiming a
101
+ * change of mode the store never made. The log separates the two ways the
102
+ * guard can refuse — a binding that moved to another generation from a binding
103
+ * that was disconnected outright — because they are different races to chase.
104
+ */
105
+ private refuseStaleSwitch;
59
106
  /**
60
107
  * Narrow what this binding may read inside the profile's allowlist. A user may
61
108
  * only remove entries: anything outside the administrator's list is dropped
@@ -70,6 +117,17 @@ export declare class IntegrationBroker {
70
117
  readonly input: Readonly<Record<string, unknown>>;
71
118
  readonly sourceSessionId: string;
72
119
  }): Promise<IntegrationToolResult>;
120
+ /**
121
+ * Spend one unit of the service-mode ceiling before the call leaves for
122
+ * upstream. Both sides of the limit are consulted together: one principal may
123
+ * not exhaust the quota the whole deployment shares, and the shared quota is
124
+ * not a per-user budget the operator never granted.
125
+ *
126
+ * A refusal is audited the way every other service-mode denial is, with the
127
+ * real principal — the limit is decided here, so upstream never learns the
128
+ * request existed.
129
+ */
130
+ private acquireServiceCallSlot;
73
131
  /**
74
132
  * Decide one operation against the service ceiling. Every refusal is audited
75
133
  * with the real principal: upstream will only ever show the service account,
@@ -82,6 +140,13 @@ export declare class IntegrationBroker {
82
140
  * is why a caller cannot point a session at somebody else's credential.
83
141
  */
84
142
  private profileFor;
143
+ /**
144
+ * Provision the one unambiguous managed profile for an account that has
145
+ * never made a choice for this provider. This is deliberately synchronous:
146
+ * it stores only the server-owned binding and policy; the secret remains
147
+ * lazy and the first real call still exercises the authenticated provider.
148
+ */
149
+ private ensureDefaultServiceBinding;
85
150
  private resolveService;
86
151
  /**
87
152
  * Turn the deployment's secret into the credential shape of this provider.
@@ -99,6 +164,15 @@ export declare class IntegrationBroker {
99
164
  */
100
165
  private serviceSummary;
101
166
  private requireConnected;
167
+ /**
168
+ * Unlock the credential of one captured binding. The lookup starts from the
169
+ * principal that asked and the provider being reached, as every lookup in the
170
+ * store does, and the binding's own reference selects the generation of that
171
+ * connection: an operation that read the live row instead would spend the
172
+ * credential of whoever holds it now while filing its verdict against the
173
+ * generation it started from, and those two are only the same object when the
174
+ * reference is still the one the row carries.
175
+ */
102
176
  private decrypt;
103
177
  }
104
178
  //# sourceMappingURL=broker.d.ts.map
@@ -2,14 +2,23 @@ import type { QaUserSession } from "@yadsh/dsh-qa-surface/client/settings";
2
2
  import { type ReactElement } from "react";
3
3
  import { type IntegrationsClientRemote } from "./integrations.js";
4
4
  /**
5
- * The Integrations card shown inside the plugin-owned host settings tab.
5
+ * The Integrations section shown on this bundle's page on the Plugins surface.
6
6
  *
7
7
  * A connection belongs to a QA account, and the token of that account is the
8
- * only credential the principal-scoped remotes accept, so the card renders the
8
+ * only credential the principal-scoped remotes accept, so the section renders the
9
9
  * provider cards only once the QA session service reports a signed-in account —
10
10
  * and says so instead of showing forms that could only fail.
11
+ *
12
+ * The body is all this draws. The page supplies the card surface, the package
13
+ * title and the `data-plugin-config` section this lands in, so the frame, the
14
+ * expand control and the shell classes are the Host's (AGENTS.md, "Two kinds of
15
+ * card: who owns the chrome"). The one heading is the section's own name, and it
16
+ * is not a second heading: the Host's bundle page wraps this seat in a section
17
+ * that carries no title element, while the rows section beside it titles itself —
18
+ * `tests/client/host-seat-contract.test.ts` reads both halves out of the installed
19
+ * page and fails if the untitled section ever gains one. It is an `<h4>` for the
20
+ * same reason: on that page the package name is an `<h3>` and the section beside
21
+ * this one is an `<h4>`, so a section heading of ours takes the section level.
11
22
  */
12
23
  export declare function createIntegrationsCard(remote: IntegrationsClientRemote, providers: readonly string[], session: QaUserSession): () => ReactElement;
13
- /** Host tab wrapper that preserves the card shell's direct ul > li contract. */
14
- export declare function createIntegrationsHostTab(remote: IntegrationsClientRemote, providers: readonly string[], session: QaUserSession): () => ReactElement;
15
24
  //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The credential-help note as this bundle renders it.
3
+ *
4
+ * `@yadsh/dsh-plugin-kit` ships this note and every provider card here reuses
5
+ * it, which this bundle can no longer do: the kit's trigger draws the card
6
+ * shell's inline chevron (`ChevronDown`, whose path is the shell's), and a bundle
7
+ * seated on the Plugins panel may not carry that path anywhere in itself — the
8
+ * card-contract gate reads the built bytes, so importing the kit's note would take
9
+ * this bundle red rather than restyling it. What the note *says* still comes from
10
+ * the kit: `credentialHelpView` shapes the metadata and re-sanitizes each address
11
+ * on this side of the wire, so only the markup is repeated here — with a
12
+ * disclosure drawn the way this plugin draws its own collapsibles (a border
13
+ * triangle, no glyph, no shell path) and under this bundle's own class names, so
14
+ * the copy cannot fight the kit's sheet for the same selectors.
15
+ *
16
+ * The two are kept equal in content by
17
+ * `tests/client/credential-help-note.test.tsx`, which renders this component and
18
+ * the kit's side by side over one fixture and compares the text. That test, not a
19
+ * promise about the kit, is what stops the copies drifting; the kit's note would
20
+ * have to stop carrying the shell's chevron before this file could go away, and no
21
+ * card owns that change yet.
22
+ */
23
+ import { type CredentialHelpNoteProps } from "@yadsh/dsh-plugin-kit/client";
24
+ import { type ReactElement } from "react";
25
+ export declare function CredentialHelpNote({ help, translate, className, }: CredentialHelpNoteProps): ReactElement | null;
26
+ //# sourceMappingURL=credential-help-note.d.ts.map
@@ -1,14 +1,22 @@
1
1
  import type { Context } from "@deepseek-ai/cordis";
2
2
  import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
3
3
  import type { IntegrationSummary, PolicyPatch } from "../types.js";
4
- export declare const inject: readonly ["remote", "qaUserSettingsSections", "qaUserSession", "settingsScope", "slots"];
4
+ export declare const inject: readonly ["remote", "qaUserSettingsSections", "qaUserSession", "configForms", "slots"];
5
5
  /**
6
- * All three mounts of this one bundle: the operator card in the Host's
7
- * "Plugin configuration" tab, which edits the plugin's settings namespace, the
8
- * page of the signed-in user's QA settings dialog, where the account gate
9
- * lives, and the feature-owned tab in the host's Plugins settings, which
10
- * reaches the same account through the `qaUserSession` service without
11
- * depending on the Host settings directory.
6
+ * All three mounts of this one bundle: the operator card, which edits the
7
+ * plugin's own profile entry through the settings form the Host serves for it,
8
+ * the page of the signed-in user's QA settings dialog, where the account gate
9
+ * lives, and the account card the Plugins page shows on this bundle's own page,
10
+ * which reaches the same account through the `qaUserSession` service.
11
+ *
12
+ * The two panel cards draw the body only — the page supplies their frame, title
13
+ * and expand control. What they leave behind is the Settings *surface*: neither
14
+ * needs the settings directory (loopback-only, and the card keeps answering from
15
+ * a browser on the LAN) nor a tab of the Settings dialog. What neither can drop
16
+ * is the settings *service*: `configForms` is
17
+ * `@deepseek-ai/dsh-client-ui-settings`, which stays a peer, an injection and a
18
+ * documented dependency (`docs/COMPATIBILITY.md`) — a seat decides where the card
19
+ * renders, not which module hands it a form.
12
20
  */
13
21
  export declare function apply(ctx: Context): Promise<() => Promise<void>>;
14
22
  export type { IntegrationSummary, PolicyPatch, RemoteResult };
@@ -23,10 +23,11 @@ export interface ProviderCardsProps {
23
23
  /** The disclosure that has to stand next to the credentials. */
24
24
  export declare const INTEGRATIONS_DISCLOSURE = "\u0414\u0430\u043D\u043D\u044B\u0435, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0430\u0433\u0435\u043D\u0442 \u0447\u0438\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044E, \u043C\u043E\u0433\u0443\u0442 \u043F\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u043E\u043C\u0443 \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u0447\u0430\u0442\u0430 LLM-\u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u0443 \u0434\u043B\u044F \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u0437\u0430\u043F\u0440\u043E\u0441\u0430. \u0421\u0435\u043A\u0440\u0435\u0442 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u0432 \u043C\u043E\u0434\u0435\u043B\u044C \u043D\u0435 \u043F\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044F.";
25
25
  /**
26
- * One card per provider the deployment mounted. The list comes from the host
27
- * (`describe`), so a provider the operator switched off simply never renders and
28
- * the client carries no knowledge of which exist. The credential help each card
29
- * shows comes from the same host, per provider.
26
+ * One card per provider the deployment mounted. The starting list comes from the
27
+ * host (`describe`), and each mount re-reads what the service offers, so a
28
+ * provider the operator switched off stops rendering and the client carries no
29
+ * knowledge of which exist. The credential help each card shows comes from the
30
+ * same host, per provider.
30
31
  *
31
32
  * Both mounts share this component: the page of the QA settings dialog, where
32
33
  * the account gate lives, and the host's plugin-configuration card.
@@ -7,16 +7,68 @@
7
7
  * Every deployment knob the resolvers accept is reachable from this card; the
8
8
  * connection store and its key are the exception, because connections and
9
9
  * wrapped secrets belong to the boot path and re-open on a Host restart.
10
+ *
11
+ * What this file owns is the namespace plumbing and the order of the sections;
12
+ * the sections themselves are provider files under `operator-sections/`, and
13
+ * a new provider adds one of those instead of copying this card's form.
10
14
  */
11
- import type { SettingsScope } from "@deepseek-ai/dsh-client-ui-settings/client";
15
+ import type { ConfigForm } from "@deepseek-ai/dsh-client-ui-settings/client";
12
16
  import type { InjectFace, PropsRuntime } from "@deepseek-ai/dsh-client-ui-slots";
13
17
  import { type ReactElement } from "react";
14
18
  import type { QaIntegrationsConfig } from "../config.js";
15
19
  /** The face the slot entry injects into this card. */
16
20
  export interface OperatorCardFace {
17
- readonly scope: SettingsScope<QaIntegrationsConfig>;
21
+ /**
22
+ * The live Config of this plugin's namespace.
23
+ *
24
+ * Named `settingsForm`, not `form`: the row seat hands its registrant a `form`
25
+ * of its own — the Plugins page's `ConfigPageForm`, which is only
26
+ * `{ state, mutate }` and so can neither be subscribed to nor written field by
27
+ * field. This card's `ConfigForm` therefore arrives through the injected face,
28
+ * where the owner prop cannot shadow it.
29
+ */
30
+ readonly settingsForm: ConfigForm<QaIntegrationsConfig>;
18
31
  }
19
- type CardProps = PropsRuntime<"settings.plugin.item"> & InjectFace<OperatorCardFace>;
20
- export declare function OperatorCard({ scope }: CardProps): ReactElement | null;
32
+ type CardProps = PropsRuntime<"plugins.row.config"> & InjectFace<OperatorCardFace>;
33
+ /**
34
+ * The one-liner the Plugins page asks this row's entry for.
35
+ *
36
+ * The seat is keyed `@yadsh/dsh-qa-integrations#qa-integrations` and the page
37
+ * dispatches that one entry under two views: `view: 'page'` is the form with its
38
+ * own save control, `view: 'summary'` is the row's description line. The
39
+ * contract the installed `@deepseek-ai/dsh-client-ui-plugin-manager` ships makes
40
+ * the second a fallback — `lib/types/client/slot-contract.d.ts` admits `summary`
41
+ * "for an official card's one-liner or a row's missing-description fallback" and
42
+ * closes the `plugins.row.config` entry with "An absent description falls back to
43
+ * the entry's `view: 'summary'`".
44
+ *
45
+ * Whether a live page reaches that fallback is not this bundle's to know, and it
46
+ * is not `cordis.patch.yml` that decides it: the row's detail renders
47
+ * `description ?? renderSlot("plugins.row.config", { view: "summary" })`, and
48
+ * that `description` comes from `rowText(row)` over the Host-supplied `row.meta`
49
+ * localized text — measured on the installed `rc.2` client, where the patch's own
50
+ * rows carry no description field at all. A published bundle normally does
51
+ * resolve to package text, so this sentence is what the entry answers with when
52
+ * it does not, and it has to stay a sentence in that case either way: the page
53
+ * mounts whatever it returns inside its own description paragraph, where a body
54
+ * would be a page of controls inside a line of text.
55
+ *
56
+ * It is therefore kept equal to the `description` field of `package.json`, which
57
+ * is what the Host reads the row's sentence from (`docs/DSH-0.1.7-MIGRATION.md`
58
+ * §4.2, and `dsh-plugin-log-ui` #651 does the same): the same row then reads one
59
+ * way whether the line comes from the manifest or from this entry. A test derives
60
+ * the value from the manifest rather than restating it, so an edit to either side
61
+ * that breaks the equality fails the suite.
62
+ * `scripts/verify-package.mjs` pins what this artifact can prove — the branch and
63
+ * the sentence ship — and not the reachability the Host decides.
64
+ */
65
+ export declare const QA_INTEGRATIONS_ROW_SUMMARY = "Principal-scoped, encrypted user integrations for DSH QA Surface";
66
+ /**
67
+ * The card as the Plugins page renders this bundle's row: `view: 'page'` mounts
68
+ * the body below, and the `summary` fallback is answered with the sentence rather
69
+ * than with a second render of it.
70
+ */
71
+ export declare function OperatorCardEntry(props: CardProps): ReactElement | string;
72
+ export declare function OperatorCard({ settingsForm }: CardProps): ReactElement;
21
73
  export {};
22
74
  //# sourceMappingURL=operator-card.d.ts.map
@@ -29,11 +29,30 @@ export interface ValueProps<T> {
29
29
  }
30
30
  /** The control's DOM id, derived from its settings path: one per field. */
31
31
  export declare function fieldId(path: readonly string[]): string;
32
+ /**
33
+ * The test id of the control that writes `path`: the settings key is what the
34
+ * Host stores the value under and what the card mutates by, so a reworded
35
+ * caption or a switched interface language cannot move a knob away from the
36
+ * check that reaches it. The parts of a field hang off this id with a suffix
37
+ * (`-field`, `-row`, `-add`).
38
+ *
39
+ * What a field repeats keeps the id of its template — the rows of a list editor
40
+ * read alike, and one of them is the node whose `data-dsh-row-key` carries its
41
+ * value, never a number baked into a name (epic #453).
42
+ *
43
+ * A section that mounts two fields on one path — the service-profile row keeps
44
+ * a resource map and a deny map under `managedServiceCredentials.profiles` —
45
+ * names the second one through the `testId` prop, so an id never answers twice
46
+ * and `getByTestId` never trips over a field it shares its path with.
47
+ */
48
+ export declare function testIdOf(path: readonly string[]): string;
32
49
  /** Two-state control with a label and an explanatory hint. */
33
50
  export declare function Toggle(props: {
34
51
  label: string;
35
52
  hint?: string;
36
53
  path: readonly string[];
54
+ /** Names the control where its settings path alone would answer twice. */
55
+ testId?: string;
37
56
  value: boolean;
38
57
  disabled: boolean;
39
58
  write: ConfigWrite;
@@ -44,6 +63,8 @@ export declare function NumberField(props: {
44
63
  label: string;
45
64
  hint?: string;
46
65
  path: readonly string[];
66
+ /** Names the control where its settings path alone would answer twice. */
67
+ testId?: string;
47
68
  value: number | undefined;
48
69
  disabled: boolean;
49
70
  write: ConfigWrite;
@@ -56,6 +77,8 @@ export declare function TextField(props: {
56
77
  hint?: string;
57
78
  placeholder?: string;
58
79
  path: readonly string[];
80
+ /** Names the control where its settings path alone would answer twice. */
81
+ testId?: string;
59
82
  value: string | undefined;
60
83
  disabled: boolean;
61
84
  write: ConfigWrite;
@@ -67,6 +90,8 @@ export declare function SelectField(props: {
67
90
  label: string;
68
91
  hint?: string;
69
92
  path: readonly string[];
93
+ /** Names the control where its settings path alone would answer twice. */
94
+ testId?: string;
70
95
  value: string;
71
96
  options: ReadonlyArray<{
72
97
  value: string;
@@ -85,6 +110,8 @@ export declare function StringListField(props: {
85
110
  hint?: string;
86
111
  placeholder?: string;
87
112
  path: readonly string[];
113
+ /** Names the control where its settings path alone would answer twice. */
114
+ testId?: string;
88
115
  values: readonly string[];
89
116
  disabled: boolean;
90
117
  write: ConfigWrite;
@@ -118,6 +145,8 @@ export declare function InstanceListField(props: {
118
145
  label: string;
119
146
  hint?: string;
120
147
  path: readonly string[];
148
+ /** Names the control where its settings path alone would answer twice. */
149
+ testId?: string;
121
150
  instances: readonly InstanceDraft[];
122
151
  /**
123
152
  * Products a row may declare, first one being what the Host reads when the
@@ -142,6 +171,8 @@ export declare function RecordField(props: {
142
171
  label: string;
143
172
  hint?: string;
144
173
  path: readonly string[];
174
+ /** Names the control where its settings path alone would answer twice. */
175
+ testId?: string;
145
176
  entries: ReadonlyArray<readonly [string, string]>;
146
177
  keyPlaceholder: string;
147
178
  valuePlaceholder: string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The Bitrix24 section of the operator card: portals are addressed by the
3
+ * webhook's own host, checked against `allowedPortalSuffixes` in the general
4
+ * section, so this provider has no address list and no tuning knobs of its
5
+ * own — a switch and the surface it opens to the agent.
6
+ */
7
+ import type { ReactElement } from "react";
8
+ import type { OperatorForm } from "./shared.js";
9
+ export declare function Bitrix24Section({ form, }: {
10
+ readonly form: OperatorForm;
11
+ }): ReactElement;
12
+ //# sourceMappingURL=bitrix24.d.ts.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The Confluence section of the operator card: the sites the deployment reads,
3
+ * the spaces the allowlist admits, and the page surface the agent may touch.
4
+ */
5
+ import type { ReactElement } from "react";
6
+ import { type OperatorForm } from "./shared.js";
7
+ export declare function ConfluenceSection({ form, }: {
8
+ readonly form: OperatorForm;
9
+ }): ReactElement;
10
+ //# sourceMappingURL=confluence.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The credential-help section of the operator card: where a deployment
3
+ * replaces a provider's built-in "where do I get this token" hints with its
4
+ * own. One provider override is the same field list for every provider — the
5
+ * provider name is the only variable.
6
+ */
7
+ import type { ReactElement } from "react";
8
+ /** One provider's credential-help override: every field optional, every miss keeps the built-in help. */
9
+ export declare function CredentialHelpSection(props: {
10
+ provider: string;
11
+ override: Record<string, unknown>;
12
+ disabled: boolean;
13
+ write: (path: readonly string[], value: unknown) => void;
14
+ unset: (path: readonly string[]) => void;
15
+ overridden: (path: readonly string[]) => boolean;
16
+ }): ReactElement;
17
+ //# sourceMappingURL=credential-help.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The general section of the operator card: the plugin switch, the storage
3
+ * files the host re-opens on restart, the portal domains Bitrix24 webhooks
4
+ * may name, and the deployment-wide budgets every provider reads through.
5
+ */
6
+ import type { ReactElement } from "react";
7
+ import { type OperatorForm } from "./shared.js";
8
+ export declare function GeneralSection({ form, }: {
9
+ readonly form: OperatorForm;
10
+ }): ReactElement;
11
+ //# sourceMappingURL=general.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The GitLab section of the operator card: the instances the deployment reads,
3
+ * the surface the agent may touch, and the byte budgets of file and job-log
4
+ * reads. CI is the two switches the Host resolver answers with — `ciMetadataRead`
5
+ * and `ciLogsRead` — and each of them reads through the single `ciRead` of an
6
+ * earlier release, exactly as the resolver folds it.
7
+ */
8
+ import type { ReactElement } from "react";
9
+ import { type OperatorForm } from "./shared.js";
10
+ export declare function GitlabSection({ form, }: {
11
+ readonly form: OperatorForm;
12
+ }): ReactElement;
13
+ //# sourceMappingURL=gitlab.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The Jira section of the operator card: the sites the deployment reads, the
3
+ * field aliases this instance names its custom fields by, and the budgets of
4
+ * one search or comment page.
5
+ */
6
+ import type { ReactElement } from "react";
7
+ import { type OperatorForm } from "./shared.js";
8
+ export declare function JiraSection({ form, }: {
9
+ readonly form: OperatorForm;
10
+ }): ReactElement;
11
+ //# sourceMappingURL=jira.d.ts.map
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The provider section form, rendered once. Every provider section is the same
3
+ * shape — a switch for the provider, the optional plain-HTTP exception, the
4
+ * connections it reads through, the checklist of what the agent may touch, and
5
+ * the tuning knobs folded away — and only the data differs. A new provider
6
+ * declares its spec here; it does not copy this form.
7
+ */
8
+ import type { ReactElement, ReactNode } from "react";
9
+ import { type OperatorForm } from "./shared.js";
10
+ /** One capability: its config key, its label, and how its switch defaults. */
11
+ export interface CapabilitySpec {
12
+ readonly key: string;
13
+ readonly label: string;
14
+ /** Whether the switch reads on when the layer names nothing; default on. */
15
+ readonly on?: boolean;
16
+ readonly hint?: string;
17
+ /**
18
+ * The raw value this switch stands for, when the resolver folds another key
19
+ * into it. Absent means the resolver's input for `key` alone.
20
+ */
21
+ readonly read?: (record: Record<string, unknown>) => unknown;
22
+ }
23
+ /** One numeric tuning knob under `[provider, key]`. */
24
+ export interface LimitFieldSpec {
25
+ readonly key: string;
26
+ readonly label: string;
27
+ }
28
+ export interface ProviderSectionProps {
29
+ readonly form: OperatorForm;
30
+ /** The section heading, as the operator reads it. */
31
+ readonly title: string;
32
+ /** The provider's key in the config namespace. */
33
+ readonly provider: string;
34
+ readonly capabilities: readonly CapabilitySpec[];
35
+ /**
36
+ * The plain-HTTP exception the provider offers, with its path when the
37
+ * switch does not live at `<provider>.allowInsecureHttp`. Absent for a
38
+ * provider whose address the operator declares in one place.
39
+ */
40
+ readonly http?: {
41
+ readonly path?: readonly string[];
42
+ readonly hint?: string;
43
+ };
44
+ /** List-valued connection fields the collapsed line counts. */
45
+ readonly counts?: readonly {
46
+ readonly path: string;
47
+ readonly forms: readonly [string, string, string];
48
+ }[];
49
+ /** The connection editors, mounted in a wide group when present. */
50
+ readonly connection?: ReactNode;
51
+ /** The numeric knobs, folded into the limits drawer; absent when none. */
52
+ readonly limits?: {
53
+ readonly hint?: string;
54
+ readonly fields: readonly LimitFieldSpec[];
55
+ };
56
+ }
57
+ export declare function ProviderSection(props: ProviderSectionProps): ReactElement;
58
+ //# sourceMappingURL=provider-section.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The managed service credentials section of the operator card: the deployment
3
+ * profile and the profiles of read-only service accounts it can connect with
4
+ * instead of a guest. A profile list commits as a whole at its parent path, so
5
+ * a row can never be half-stored; the drafts reset from the stored list when
6
+ * the Host accepts or refuels it.
7
+ */
8
+ import { type ReactElement } from "react";
9
+ import { type OperatorForm } from "./shared.js";
10
+ export declare function ServiceAccessSection({ form, }: {
11
+ readonly form: OperatorForm;
12
+ }): ReactElement;
13
+ //# sourceMappingURL=service-profiles.d.ts.map