@yadsh/dsh-qa-integrations 0.5.0 → 0.6.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 (191) hide show
  1. package/README.md +431 -18
  2. package/compatibility.json +1 -1
  3. package/lib/broker.js +456 -9
  4. package/lib/broker.js.map +1 -1
  5. package/lib/client/bitrix24.js +2 -1
  6. package/lib/client/bitrix24.js.map +1 -1
  7. package/lib/client/card.js +8 -1
  8. package/lib/client/card.js.map +1 -1
  9. package/lib/client/confluence.js +3 -2
  10. package/lib/client/confluence.js.map +1 -1
  11. package/lib/client/gitlab.js +40 -4
  12. package/lib/client/gitlab.js.map +1 -1
  13. package/lib/client/index.js +13 -11
  14. package/lib/client/index.js.map +1 -1
  15. package/lib/client/integrations.js +39 -2
  16. package/lib/client/integrations.js.map +1 -1
  17. package/lib/client/jira.js +3 -2
  18. package/lib/client/jira.js.map +1 -1
  19. package/lib/client/provider-card.js +138 -4
  20. package/lib/client/provider-card.js.map +1 -1
  21. package/lib/client/styles.js +8 -5
  22. package/lib/client/styles.js.map +1 -1
  23. package/lib/client/teamcity.js +31 -4
  24. package/lib/client/teamcity.js.map +1 -1
  25. package/lib/client/testit.js +65 -0
  26. package/lib/client/testit.js.map +1 -0
  27. package/lib/client/weblate.js +70 -0
  28. package/lib/client/weblate.js.map +1 -0
  29. package/lib/client.js +2600 -480
  30. package/lib/client.js.map +1 -1
  31. package/lib/coerce.js +16 -7
  32. package/lib/coerce.js.map +1 -1
  33. package/lib/config.js +12 -0
  34. package/lib/config.js.map +1 -1
  35. package/lib/errors.js.map +1 -1
  36. package/lib/index.js +274 -28
  37. package/lib/index.js.map +1 -1
  38. package/lib/providers/bitrix24/catalog.js +13 -0
  39. package/lib/providers/bitrix24/catalog.js.map +1 -1
  40. package/lib/providers/bitrix24/config.js +3 -0
  41. package/lib/providers/bitrix24/config.js.map +1 -1
  42. package/lib/providers/bitrix24/credential-help.js +24 -0
  43. package/lib/providers/bitrix24/credential-help.js.map +1 -0
  44. package/lib/providers/bitrix24/index.js +9 -0
  45. package/lib/providers/bitrix24/index.js.map +1 -1
  46. package/lib/providers/bitrix24/operations.js +60 -1
  47. package/lib/providers/bitrix24/operations.js.map +1 -1
  48. package/lib/providers/bitrix24/tools.js +95 -3
  49. package/lib/providers/bitrix24/tools.js.map +1 -1
  50. package/lib/providers/confluence/credential-help.js +29 -0
  51. package/lib/providers/confluence/credential-help.js.map +1 -0
  52. package/lib/providers/confluence/index.js +9 -0
  53. package/lib/providers/confluence/index.js.map +1 -1
  54. package/lib/providers/gitlab/catalog.js +108 -15
  55. package/lib/providers/gitlab/catalog.js.map +1 -1
  56. package/lib/providers/gitlab/config.js +11 -3
  57. package/lib/providers/gitlab/config.js.map +1 -1
  58. package/lib/providers/gitlab/credential-help.js +33 -0
  59. package/lib/providers/gitlab/credential-help.js.map +1 -0
  60. package/lib/providers/gitlab/index.js +337 -6
  61. package/lib/providers/gitlab/index.js.map +1 -1
  62. package/lib/providers/jira/credential-help.js +31 -0
  63. package/lib/providers/jira/credential-help.js.map +1 -0
  64. package/lib/providers/jira/index.js +9 -0
  65. package/lib/providers/jira/index.js.map +1 -1
  66. package/lib/providers/registry.js +4 -0
  67. package/lib/providers/registry.js.map +1 -1
  68. package/lib/providers/shared/credential-help.js +29 -0
  69. package/lib/providers/shared/credential-help.js.map +1 -0
  70. package/lib/providers/shared/service-boundary.js +44 -0
  71. package/lib/providers/shared/service-boundary.js.map +1 -0
  72. package/lib/providers/teamcity/catalog.js +56 -2
  73. package/lib/providers/teamcity/catalog.js.map +1 -1
  74. package/lib/providers/teamcity/credential-help.js +25 -0
  75. package/lib/providers/teamcity/credential-help.js.map +1 -0
  76. package/lib/providers/teamcity/index.js +254 -2
  77. package/lib/providers/teamcity/index.js.map +1 -1
  78. package/lib/providers/testit/attachments.js +131 -0
  79. package/lib/providers/testit/attachments.js.map +1 -0
  80. package/lib/providers/testit/catalog.js +225 -0
  81. package/lib/providers/testit/catalog.js.map +1 -0
  82. package/lib/providers/testit/config.js +175 -0
  83. package/lib/providers/testit/config.js.map +1 -0
  84. package/lib/providers/testit/credential-help.js +29 -0
  85. package/lib/providers/testit/credential-help.js.map +1 -0
  86. package/lib/providers/testit/index.js +184 -0
  87. package/lib/providers/testit/index.js.map +1 -0
  88. package/lib/providers/testit/operations.js +1070 -0
  89. package/lib/providers/testit/operations.js.map +1 -0
  90. package/lib/providers/testit/tools.js +717 -0
  91. package/lib/providers/testit/tools.js.map +1 -0
  92. package/lib/providers/testit/transport.js +158 -0
  93. package/lib/providers/testit/transport.js.map +1 -0
  94. package/lib/providers/weblate/catalog.js +185 -0
  95. package/lib/providers/weblate/catalog.js.map +1 -0
  96. package/lib/providers/weblate/config.js +147 -0
  97. package/lib/providers/weblate/config.js.map +1 -0
  98. package/lib/providers/weblate/credential-help.js +26 -0
  99. package/lib/providers/weblate/credential-help.js.map +1 -0
  100. package/lib/providers/weblate/index.js +181 -0
  101. package/lib/providers/weblate/index.js.map +1 -0
  102. package/lib/providers/weblate/operations.js +703 -0
  103. package/lib/providers/weblate/operations.js.map +1 -0
  104. package/lib/providers/weblate/query.js +80 -0
  105. package/lib/providers/weblate/query.js.map +1 -0
  106. package/lib/providers/weblate/tools.js +408 -0
  107. package/lib/providers/weblate/tools.js.map +1 -0
  108. package/lib/providers/weblate/transport.js +179 -0
  109. package/lib/providers/weblate/transport.js.map +1 -0
  110. package/lib/repository.js +197 -13
  111. package/lib/repository.js.map +1 -1
  112. package/lib/service-credentials/config.js +179 -0
  113. package/lib/service-credentials/config.js.map +1 -0
  114. package/lib/service-credentials/policy.js +92 -0
  115. package/lib/service-credentials/policy.js.map +1 -0
  116. package/lib/service-credentials/registry.js +142 -0
  117. package/lib/service-credentials/registry.js.map +1 -0
  118. package/lib/service-credentials/state.js +30 -0
  119. package/lib/service-credentials/state.js.map +1 -0
  120. package/lib/service-credentials/types.js +20 -0
  121. package/lib/service-credentials/types.js.map +1 -0
  122. package/lib/tools.js +27 -2
  123. package/lib/tools.js.map +1 -1
  124. package/lib/typert.host.js +1187 -39
  125. package/lib/typert.remote-client.d.ts +37 -5
  126. package/lib/typert.remote-client.js +1057 -33
  127. package/lib/types/broker.d.ts +70 -4
  128. package/lib/types/client/bitrix24.d.ts +1 -1
  129. package/lib/types/client/card.d.ts +3 -1
  130. package/lib/types/client/confluence.d.ts +2 -2
  131. package/lib/types/client/gitlab.d.ts +15 -2
  132. package/lib/types/client/index.d.ts +3 -2
  133. package/lib/types/client/integrations.d.ts +11 -2
  134. package/lib/types/client/jira.d.ts +2 -2
  135. package/lib/types/client/provider-card.d.ts +50 -8
  136. package/lib/types/client/styles.d.ts +4 -3
  137. package/lib/types/client/teamcity.d.ts +15 -2
  138. package/lib/types/client/testit.d.ts +15 -0
  139. package/lib/types/client/weblate.d.ts +15 -0
  140. package/lib/types/coerce.d.ts +2 -2
  141. package/lib/types/config.d.ts +21 -0
  142. package/lib/types/errors.d.ts +9 -1
  143. package/lib/types/index.d.ts +108 -11
  144. package/lib/types/providers/bitrix24/catalog.d.ts +1 -1
  145. package/lib/types/providers/bitrix24/config.d.ts +11 -1
  146. package/lib/types/providers/bitrix24/credential-help.d.ts +8 -0
  147. package/lib/types/providers/bitrix24/index.d.ts +5 -0
  148. package/lib/types/providers/bitrix24/tools.d.ts +4 -0
  149. package/lib/types/providers/confluence/credential-help.d.ts +9 -0
  150. package/lib/types/providers/confluence/index.d.ts +5 -0
  151. package/lib/types/providers/contract.d.ts +62 -1
  152. package/lib/types/providers/gitlab/catalog.d.ts +20 -5
  153. package/lib/types/providers/gitlab/config.d.ts +14 -3
  154. package/lib/types/providers/gitlab/credential-help.d.ts +9 -0
  155. package/lib/types/providers/gitlab/index.d.ts +51 -1
  156. package/lib/types/providers/jira/credential-help.d.ts +8 -0
  157. package/lib/types/providers/jira/index.d.ts +5 -0
  158. package/lib/types/providers/registry.d.ts +2 -0
  159. package/lib/types/providers/shared/credential-help.d.ts +17 -0
  160. package/lib/types/providers/shared/service-boundary.d.ts +25 -0
  161. package/lib/types/providers/teamcity/catalog.d.ts +18 -2
  162. package/lib/types/providers/teamcity/credential-help.d.ts +8 -0
  163. package/lib/types/providers/teamcity/index.d.ts +53 -2
  164. package/lib/types/providers/testit/attachments.d.ts +20 -0
  165. package/lib/types/providers/testit/catalog.d.ts +75 -0
  166. package/lib/types/providers/testit/config.d.ts +61 -0
  167. package/lib/types/providers/testit/credential-help.d.ts +8 -0
  168. package/lib/types/providers/testit/index.d.ts +60 -0
  169. package/lib/types/providers/testit/operations.d.ts +95 -0
  170. package/lib/types/providers/testit/tools.d.ts +15 -0
  171. package/lib/types/providers/testit/transport.d.ts +67 -0
  172. package/lib/types/providers/weblate/catalog.d.ts +43 -0
  173. package/lib/types/providers/weblate/config.d.ts +57 -0
  174. package/lib/types/providers/weblate/credential-help.d.ts +9 -0
  175. package/lib/types/providers/weblate/index.d.ts +50 -0
  176. package/lib/types/providers/weblate/operations.d.ts +77 -0
  177. package/lib/types/providers/weblate/query.d.ts +37 -0
  178. package/lib/types/providers/weblate/tools.d.ts +15 -0
  179. package/lib/types/providers/weblate/transport.d.ts +60 -0
  180. package/lib/types/repository.d.ts +38 -3
  181. package/lib/types/service-credentials/config.d.ts +73 -0
  182. package/lib/types/service-credentials/policy.d.ts +44 -0
  183. package/lib/types/service-credentials/registry.d.ts +43 -0
  184. package/lib/types/service-credentials/state.d.ts +14 -0
  185. package/lib/types/service-credentials/types.d.ts +97 -0
  186. package/lib/types/tools.d.ts +10 -1
  187. package/lib/types/types.d.ts +114 -10
  188. package/package.json +7 -7
  189. package/lib/shared/settings.js +0 -19
  190. package/lib/shared/settings.js.map +0 -1
  191. package/lib/types/shared/settings.d.ts +0 -19
@@ -0,0 +1,17 @@
1
+ import z from "@deepseek-ai/schemastery";
2
+ import type { CredentialHelpOverride } from "@yadsh/dsh-plugin-kit";
3
+ /**
4
+ * Deployment replacement of one provider's credential help, as it appears under
5
+ * `credentialHelp.<provider>` in YAML. Every field is optional and replaces only
6
+ * itself: an internal gateway rewrites the obtain address, a corporate wiki
7
+ * replaces the documentation link, and a deployment that hides the help says
8
+ * `enabled: false`.
9
+ *
10
+ * The credential mechanism (`kind`) is the integration's own statement, so an
11
+ * override rarely names it; a value that is not a known mechanism degrades to
12
+ * `custom` with a startup warning rather than failing the provider.
13
+ */
14
+ export declare const credentialHelpOverrideSchema: z<CredentialHelpOverride>;
15
+ /** The overrides of every provider, keyed by provider id. */
16
+ export declare const credentialHelpOverridesSchema: z<Record<string, CredentialHelpOverride>>;
17
+ //# sourceMappingURL=credential-help.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { IntegrationError } from "../../errors.js";
2
+ import { type OperationSecurityMetadata, type ServiceResourceBoundary } from "../../service-credentials/types.js";
3
+ import type { ProviderContext } from "../contract.js";
4
+ /**
5
+ * The resource boundary of a call that runs on the deployment's managed
6
+ * credential, or undefined for a personal one.
7
+ *
8
+ * Reaching service mode without a boundary means the broker had nothing to hand
9
+ * over, and reading without a boundary is what the whole feature forbids — so a
10
+ * supporting provider fails closed here instead of falling back to "no
11
+ * boundary, no restriction".
12
+ */
13
+ export declare function serviceBoundaryOf(context: ProviderContext): ServiceResourceBoundary | undefined;
14
+ /** One refusal shape, so every service-mode denial reads the same. */
15
+ export declare function serviceResourceDenied(): IntegrationError;
16
+ /**
17
+ * Refuse an operation the provider's own catalog does not mark as service-safe.
18
+ * The broker decides this first and with the administrator's narrowing on top;
19
+ * this guard is the second lock, so a caller that reaches a provider directly —
20
+ * or a future bug in the broker — still cannot read a log through a shared
21
+ * credential. An operation the provider does not classify is denied, exactly as
22
+ * the broker's default is.
23
+ */
24
+ export declare function assertServiceOperationAllowed(metadata: OperationSecurityMetadata | undefined, message: string): void;
25
+ //# sourceMappingURL=service-boundary.d.ts.map
@@ -1,3 +1,4 @@
1
+ import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
1
2
  import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
2
3
  import type { TeamCityFlags } from "./config.js";
3
4
  /**
@@ -6,6 +7,10 @@ import type { TeamCityFlags } from "./config.js";
6
7
  * purpose: a TeamCity token grants whole areas (or is limited per project), while
7
8
  * the agent gets one switch per area, so a user who only needs "why did my build
8
9
  * fail" can hand over failures and logs without projects or agents.
10
+ *
11
+ * Logs and artifacts live under their own capability because a build log is the
12
+ * classic place an internal address or a secret leaks from: the deployment's
13
+ * managed credential reads build metadata, never the text a build printed.
9
14
  */
10
15
  export type TeamCityCapability = "identity.read" | "projects.read" | "buildConfigs.read" | "builds.read" | "failures.read" | "logs.read" | "queue.read" | "investigations.read" | "agents.read" | "artifacts.read";
11
16
  /** Boolean deployment switches of this provider, one per capability. */
@@ -37,11 +42,20 @@ export interface TeamCityOperationDefinition {
37
42
  * gate can assert that, instead of trusting the path names to look harmless.
38
43
  */
39
44
  readonly method: "GET";
45
+ /** What this operation does, how sensitive it is, who may reach it. */
46
+ readonly security: OperationSecurityMetadata;
40
47
  }
48
+ /** The resource kind every project-scoped operation of this provider is bounded by. */
49
+ export declare const TEAMCITY_RESOURCE_KIND = "projects";
50
+ /**
51
+ * This provider has one server per deployment, so deployment configuration names
52
+ * it by this instance id when it binds a managed credential to it.
53
+ */
54
+ export declare const TEAMCITY_INSTANCE_ID = "teamcity";
41
55
  /**
42
56
  * Every model-reachable operation. The provider refuses any operation that is
43
- * not listed here, so this table — together with `capability` — is the
44
- * permission surface. The catalog carries no operation that could change
57
+ * not listed here, so this table — together with `capability` and `security` —
58
+ * is the permission surface. The catalog carries no operation that could change
45
59
  * TeamCity state: trigger, retry, cancel, comment and tags wait for the
46
60
  * confirmation framework the specification requires for them.
47
61
  */
@@ -52,4 +66,6 @@ export declare function enabledCapabilities(flags: TeamCityFlags): readonly Team
52
66
  export declare const TEAMCITY_CAPABILITY_INFO: Readonly<Record<TeamCityCapability, IntegrationCapabilityInfo>>;
53
67
  /** Capability an operation needs, or undefined when the catalog has none. */
54
68
  export declare function teamcityOperationCapability(operation: string): IntegrationCapability | undefined;
69
+ /** Security classification of an operation, or undefined when it is unknown. */
70
+ export declare function teamcityOperationMetadata(operation: string): OperationSecurityMetadata | undefined;
55
71
  //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { CredentialHelp } from "@yadsh/dsh-plugin-kit";
2
+ /**
3
+ * TeamCity hands out access tokens in the user's own profile, and the value is
4
+ * shown exactly once — which is why the help says so rather than leaving a user
5
+ * to discover it after closing the page.
6
+ */
7
+ export declare const TEAMCITY_CREDENTIAL_HELP: CredentialHelp;
8
+ //# sourceMappingURL=credential-help.d.ts.map
@@ -1,10 +1,28 @@
1
+ import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
1
2
  import type { ResolvedQaIntegrationsConfig } from "../../config.js";
2
- import type { IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
3
+ import type { OperationSecurityMetadata, ServiceCredentialHealth, ServiceResourceBoundary } from "../../service-credentials/types.js";
4
+ import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
3
5
  import type { IntegrationProvider, ProviderContext } from "../contract.js";
4
6
  export { configuredServer, credentialFromPlaintext, type TeamCityCredential, } from "./transport.js";
7
+ /**
8
+ * Whether one caller-named TeamCity project stays inside the boundary. A listed
9
+ * project covers its own subprojects, because that is what the identifier means
10
+ * upstream; an ancestor of a listed project is not covered, because asking for
11
+ * it would return the siblings nobody listed.
12
+ */
13
+ export declare function projectAllowed(boundary: ServiceResourceBoundary, ref: string): boolean;
14
+ /**
15
+ * Whether one build configuration stays inside the boundary: it is either
16
+ * listed itself, or it hangs off a listed project. TeamCity names a build
17
+ * configuration `<projectId>_<configId>`, which is the prefix a listed project
18
+ * matches on; the authoritative `projectId` from the API is preferred wherever
19
+ * the call already fetches it.
20
+ */
21
+ export declare function buildTypeAllowed(boundary: ServiceResourceBoundary, ref: string, projectId?: string | undefined): boolean;
5
22
  /**
6
23
  * TeamCity provider: one TeamCity server per QA user, connected with that user's
7
- * own personal access token.
24
+ * own personal access token, or with the deployment's managed read-only
25
+ * credential when the user's binding asks for it.
8
26
  *
9
27
  * The server address is user input, so it is checked against the deployment's
10
28
  * address policy when the connection is stored and again on every call, and the
@@ -17,6 +35,10 @@ export declare class TeamcityProvider implements IntegrationProvider {
17
35
  /** What this deployment is willing to expose; TeamCity's own rights still apply. */
18
36
  readonly capabilities: readonly IntegrationCapability[];
19
37
  readonly capabilityInfo: Readonly<Record<IntegrationCapability, IntegrationCapabilityInfo>>;
38
+ /** Where the settings card says this provider's credential comes from. */
39
+ readonly credentialHelp: CredentialHelp | null;
40
+ /** Overrides the deployment got wrong; reported once at startup, never fatal. */
41
+ readonly credentialHelpProblems: readonly string[];
20
42
  private readonly transport;
21
43
  constructor(config: ResolvedQaIntegrationsConfig, fetcher?: typeof fetch);
22
44
  /**
@@ -32,8 +54,37 @@ export declare class TeamcityProvider implements IntegrationProvider {
32
54
  readonly portal: string;
33
55
  };
34
56
  operationCapability(operation: string): IntegrationCapability | undefined;
57
+ operationMetadata(operation: string): OperationSecurityMetadata | undefined;
58
+ resourceBoundaryKind(operation: string): string | undefined;
59
+ capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
60
+ /** An empty id means this deployment's single server, as in `parseCredential`. */
61
+ instancePortal(instanceId: string): string | undefined;
35
62
  validate(context: ProviderContext): Promise<ProviderValidation>;
63
+ /**
64
+ * Health of the deployment's managed token. TeamCity exposes no way to read a
65
+ * token's roles, so the probe answers what it can — whether the token is
66
+ * accepted and which identity it carries — and says so instead of implying a
67
+ * permission audit it did not perform.
68
+ */
69
+ validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
36
70
  execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
71
+ /**
72
+ * Hold one call inside the deployment's boundary. Every service-safe TeamCity
73
+ * operation either names a project, a build configuration or a build — and a
74
+ * build is resolved to its project upstream, so a direct read by build id
75
+ * passes the same policy a listing does.
76
+ */
77
+ private assertInsideBoundary;
78
+ /** Resolve a build id to the project it belongs to, then check the boundary. */
79
+ private assertBuildInBoundary;
80
+ /**
81
+ * The bounded project listing: a service profile names the projects it covers,
82
+ * so the answer is fetched from that list rather than from whatever the shared
83
+ * account can reach. A project the service token cannot see is reported as
84
+ * unavailable, which is what tells the operator their boundary and their token
85
+ * disagree.
86
+ */
87
+ private listBoundedProjects;
37
88
  /** Server identity: one answer out of the two documented discovery calls. */
38
89
  private readConnection;
39
90
  /**
@@ -0,0 +1,20 @@
1
+ import type { TestitFlags } from "./config.js";
2
+ /** A file name as Test IT reported it, trimmed and safe to echo back. */
3
+ export declare function attachmentName(value: unknown): string;
4
+ /** Extension of a file name, lowercased and without the dot. */
5
+ export declare function attachmentExtension(name: string): string;
6
+ /** Why this attachment may not be read as text at all. */
7
+ export declare function attachmentBinaryProblem(name: string): string | undefined;
8
+ /**
9
+ * Byte budget of one attachment read: the caller may ask for less than the
10
+ * deployment allows, never for more, and an unasked budget is the configured
11
+ * default rather than the hard ceiling.
12
+ */
13
+ export declare function attachmentByteLimit(requested: unknown, flags: TestitFlags): number;
14
+ /**
15
+ * Refuse a file Test IT already described as bigger than the budget, before a
16
+ * byte of it is requested. The declared size is the upstream's own answer, so
17
+ * this is a real bound and not a suggestion.
18
+ */
19
+ export declare function assertReadableSize(declaredBytes: number | undefined, limit: number): void;
20
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1,75 @@
1
+ import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
2
+ import type { TestitFlags } from "./config.js";
3
+ /**
4
+ * Capabilities this provider offers, one per kind of Test IT data a user may
5
+ * hand to the agent. They are narrower than Test IT's own permissions on
6
+ * purpose: a token grants areas (test library, test plans, runs), while the
7
+ * agent gets one switch per area, so a user who only needs "what failed in this
8
+ * run" can hand over runs and results without the test library.
9
+ */
10
+ export type TestitCapability = "projects.read" | "sections.read" | "workItems.read" | "history.read" | "comments.read" | "testPlans.read" | "testRuns.read" | "testResults.read" | "autoTests.read" | "attachments.read" | "configurations.read";
11
+ /** Boolean deployment switches of this provider, one per capability. */
12
+ export type TestitReadFlag = "projectsRead" | "sectionsRead" | "workItemsRead" | "historyRead" | "commentsRead" | "testPlansRead" | "testRunsRead" | "testResultsRead" | "autoTestsRead" | "attachmentsRead" | "configurationsRead";
13
+ export interface TestitCapabilityDefinition {
14
+ readonly capability: TestitCapability;
15
+ readonly flag: TestitReadFlag;
16
+ readonly label: string;
17
+ readonly hint: string;
18
+ }
19
+ export declare const TESTIT_CAPABILITIES: readonly TestitCapabilityDefinition[];
20
+ /**
21
+ * What a list operation answers with upstream:
22
+ *
23
+ * - `paged` — the endpoint pages itself: the provider passes `Skip`/`Take` on
24
+ * and reports `Pagination-*` headers back as `pagination`;
25
+ * - `capped` — the endpoint answers the whole collection at once, so the
26
+ * provider slices it to the limit and says `truncated` when it had to.
27
+ */
28
+ export type TestitListKind = "paged" | "capped";
29
+ export interface TestitOperationDefinition {
30
+ readonly capability: TestitCapability;
31
+ /**
32
+ * API path under `/api/v2`. `:placeholders` are filled by the handler built
33
+ * for that operation; the value is a fixed string, so the model can never
34
+ * pick an endpoint of its own.
35
+ *
36
+ * Where an operation needs a companion call, the provider makes it itself.
37
+ */
38
+ readonly path: string;
39
+ /**
40
+ * Every operation of this catalog is a read. The field exists so the package
41
+ * gate can assert that, instead of trusting the path names to look harmless.
42
+ */
43
+ readonly method: "GET";
44
+ readonly list?: TestitListKind;
45
+ /**
46
+ * True for the one operation whose answer is a byte stream rather than JSON:
47
+ * the provider reads it through its bounded text path instead.
48
+ */
49
+ readonly stream?: boolean;
50
+ }
51
+ /**
52
+ * Every model-reachable operation. The provider refuses any operation that is
53
+ * not listed here, so this table — together with `capability` — is the
54
+ * permission surface.
55
+ *
56
+ * The catalog holds GET endpoints only. Test IT offers richer filtering on
57
+ * `POST /api/v2/.../search` and reports statistics through
58
+ * `POST /api/v2/testRuns/{id}/statistics/filter`, but every search endpoint is a
59
+ * POST, and this package's read-only guarantee is written as "every catalog
60
+ * operation is a GET". The reads below cover the same ground through the GET
61
+ * surface Test IT serves; the tools that the POST-only endpoints would have
62
+ * backed are listed as missing in the README instead of being smuggled in.
63
+ * Three of them (`projects.list`, `workItems.list`, `autoTests.list`) are the
64
+ * endpoints Test IT marks deprecated: they are kept because they are the only
65
+ * GET reads of those collections, and a version that drops them answers
66
+ * `ResourceNotFound`, which the model sees as an honest "not available here".
67
+ */
68
+ export declare const TESTIT_OPERATIONS: Readonly<Record<string, TestitOperationDefinition>>;
69
+ /** Capabilities this deployment allows, in catalog order. */
70
+ export declare function enabledCapabilities(flags: TestitFlags): readonly TestitCapability[];
71
+ /** Label and hint per capability, for clients that render what we declare. */
72
+ export declare const TESTIT_CAPABILITY_INFO: Readonly<Record<TestitCapability, IntegrationCapabilityInfo>>;
73
+ /** Capability an operation needs, or undefined when the catalog has none. */
74
+ export declare function testitOperationCapability(operation: string): IntegrationCapability | undefined;
75
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1,61 @@
1
+ import z from "@deepseek-ai/schemastery";
2
+ /**
3
+ * One Test IT installation the operator allows. Test IT ships as Cloud
4
+ * (`<team>.testit.software`) and as an on-premise TMS behind any hostname, so
5
+ * the list is how a deployment says which installations its users may connect
6
+ * to. A user never types a host: the connect form only picks from this list,
7
+ * which is what keeps the broker from dialling an origin nobody declared (the
8
+ * specification's SSRF rule).
9
+ */
10
+ export interface TestitInstance {
11
+ readonly id: string;
12
+ readonly label: string;
13
+ /** Canonical `<origin><path>`, without a trailing slash. */
14
+ readonly baseUrl: string;
15
+ }
16
+ /**
17
+ * Deployment switches for the Test IT provider. Every read capability is on by
18
+ * default, and the switches bound what this deployment offers rather than grant
19
+ * it: Test IT authorizes each request against the permissions of the user the
20
+ * token belongs to, and a refusal is reported instead of being worked around.
21
+ */
22
+ export interface TestitFlags {
23
+ readonly enabled: boolean;
24
+ /** Development escape hatch; production installations must answer over HTTPS. */
25
+ readonly allowInsecureHttp: boolean;
26
+ readonly instances: readonly TestitInstance[];
27
+ readonly projectsRead: boolean;
28
+ readonly sectionsRead: boolean;
29
+ readonly workItemsRead: boolean;
30
+ readonly historyRead: boolean;
31
+ readonly commentsRead: boolean;
32
+ readonly testPlansRead: boolean;
33
+ readonly testRunsRead: boolean;
34
+ readonly testResultsRead: boolean;
35
+ readonly autoTestsRead: boolean;
36
+ readonly attachmentsRead: boolean;
37
+ readonly configurationsRead: boolean;
38
+ /** Rows one list answer holds when the caller names no limit. */
39
+ readonly defaultResults: number;
40
+ /** Hard ceiling for one list answer, whatever the caller asks for. */
41
+ readonly maxResults: number;
42
+ /** Byte budget of one text attachment when the caller names none. */
43
+ readonly defaultAttachmentBytes: number;
44
+ /** Hard ceiling of one text attachment, whatever the caller asks for. */
45
+ readonly maxAttachmentBytes: number;
46
+ /** Timeout for the attachment read; JSON reads use the shared one. */
47
+ readonly attachmentTimeoutMs: number;
48
+ /** Extra attempts for a throttled or transient read. */
49
+ readonly retries: number;
50
+ }
51
+ export declare const TESTIT_DEFAULTS: TestitFlags;
52
+ /**
53
+ * Config slice of this provider, as it appears under `testit:` in YAML. The
54
+ * instance list is canonicalized by `resolveTestitConfig`, which is where a
55
+ * deployment typo fails loudly.
56
+ */
57
+ export declare const testitConfigSchema: z<Partial<TestitFlags>>;
58
+ export declare function resolveTestitConfig(input?: Partial<TestitFlags>): TestitFlags;
59
+ /** The configured instance a stored credential names, or a fail-closed error. */
60
+ export declare function testitInstance(flags: TestitFlags, instanceId: string): TestitInstance | undefined;
61
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { CredentialHelp } from "@yadsh/dsh-plugin-kit";
2
+ /**
3
+ * Test IT calls the credential a private token and mints it in the user's own
4
+ * profile, where it is shown once and stays valid until it is deleted — the two
5
+ * facts a user needs before pasting it, plus where the API itself is documented.
6
+ */
7
+ export declare const TESTIT_CREDENTIAL_HELP: CredentialHelp;
8
+ //# sourceMappingURL=credential-help.d.ts.map
@@ -0,0 +1,60 @@
1
+ import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
2
+ import type { ResolvedQaIntegrationsConfig } from "../../config.js";
3
+ import type { IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
4
+ import type { IntegrationProvider, ProviderContext } from "../contract.js";
5
+ export { credentialFromPlaintext, credentialInstance, type TestitCredential, } from "./transport.js";
6
+ /**
7
+ * Test IT provider: one Test IT installation per QA user, connected with that
8
+ * user's own API token.
9
+ *
10
+ * The installation is operator configuration — the connect form only picks from
11
+ * the configured list — so the broker cannot be pointed at a host of the
12
+ * caller's choosing, and the address is re-resolved from config on every call,
13
+ * which makes removing or repointing an instance take effect at once.
14
+ */
15
+ export declare class TestitProvider implements IntegrationProvider {
16
+ private readonly config;
17
+ readonly id = "testit";
18
+ readonly displayName = "Test IT";
19
+ /** What this deployment is willing to expose; Test IT's own rights still apply. */
20
+ readonly capabilities: readonly IntegrationCapability[];
21
+ readonly capabilityInfo: Readonly<Record<IntegrationCapability, IntegrationCapabilityInfo>>;
22
+ /** Where the settings card says this provider's credential comes from. */
23
+ readonly credentialHelp: CredentialHelp | null;
24
+ /** Overrides the deployment got wrong; reported once at startup, never fatal. */
25
+ readonly credentialHelpProblems: readonly string[];
26
+ private readonly transport;
27
+ constructor(config: ResolvedQaIntegrationsConfig, fetcher?: typeof fetch);
28
+ /**
29
+ * Keep only the token, tagged with the installation it was minted for. The
30
+ * instance comes from the connect form and from operator config, never from a
31
+ * tool argument, which is what keeps the broker from dialling any host the
32
+ * caller names.
33
+ */
34
+ parseCredential(raw: string, options?: Readonly<Record<string, string>>): {
35
+ readonly credential: string;
36
+ readonly portal: string;
37
+ };
38
+ operationCapability(operation: string): IntegrationCapability | undefined;
39
+ /**
40
+ * The documented first validation call is the project list: an authorized
41
+ * answer proves the address and the token at once, and an empty project list
42
+ * is a valid authorization result rather than a failure. Test IT API v2 has no
43
+ * endpoint that names the token owner, so no identity is stored — the answer
44
+ * reports what the probe proved and nothing more.
45
+ */
46
+ validate(context: ProviderContext): Promise<ProviderValidation>;
47
+ execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
48
+ /**
49
+ * One attachment, read as text. Test IT describes the file — its name and its
50
+ * size — before a byte is requested, and this provider trusts that description
51
+ * over anything the caller said: an archive, a screenshot, a document or a key
52
+ * is refused by name, a file bigger than the budget is refused by size, and
53
+ * the body that does come back is bounded, redacted and marked as external
54
+ * content.
55
+ */
56
+ private readAttachment;
57
+ private resolveInstance;
58
+ }
59
+ export default TestitProvider;
60
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,95 @@
1
+ import type { TestitFlags } from "./config.js";
2
+ import type { TestitPage } from "./transport.js";
3
+ /**
4
+ * Request building and response shaping for the Test IT Open API v2.
5
+ *
6
+ * Every operation answers with a normalized object instead of Test IT's own
7
+ * DTO, and every list answers with the same `{ items, pagination }` envelope, so
8
+ * the model learns one shape rather than a dozen. Text a user typed into Test IT
9
+ * — descriptions, steps, comments, traces, names of configurations — is
10
+ * untrusted external content and reaches the model under `untrustedContent` or
11
+ * as a bounded block, never as a bare string that could read as an instruction.
12
+ */
13
+ /**
14
+ * Hard caps per collection, from the provider specification. They bound what one
15
+ * answer may carry; Test IT documents no ceiling of its own for `Take`.
16
+ */
17
+ export declare const TESTIT_LIMITS: Readonly<{
18
+ projects: 100;
19
+ sections: 100;
20
+ workItems: 100;
21
+ history: 100;
22
+ comments: 100;
23
+ testPlans: 100;
24
+ testRuns: 50;
25
+ testResults: 100;
26
+ attachments: 100;
27
+ autoTests: 100;
28
+ configurations: 100;
29
+ }>;
30
+ /**
31
+ * Values Test IT accepts for the fields this provider exposes. The vocabulary is
32
+ * closed on purpose: an enum the model cannot spell is a 400 from upstream, and
33
+ * a 400 costs an answer where a refused argument costs one line.
34
+ */
35
+ export declare const WORK_ITEM_STATES: readonly string[];
36
+ export declare const WORK_ITEM_PRIORITIES: readonly string[];
37
+ export declare const WORK_ITEM_ENTITY_TYPES: readonly string[];
38
+ export declare const TEST_RUN_STATES: readonly string[];
39
+ export declare const RESULT_OUTCOMES: readonly string[];
40
+ /**
41
+ * Rows one call may ask for: the caller's wish is clamped to the deployment cap
42
+ * rather than refused, because a model that asks for "the last 500 test cases"
43
+ * still gets a useful answer instead of an error.
44
+ */
45
+ export declare function listLimit(requested: unknown, cap: number, flags: TestitFlags): number;
46
+ /** Rows to skip; `offset` is the model's only pagination cursor here. */
47
+ export declare function listOffset(requested: unknown): number;
48
+ export interface OperationContext {
49
+ readonly flags: TestitFlags;
50
+ }
51
+ export interface TestitRequest {
52
+ readonly path: string;
53
+ readonly query: Readonly<Record<string, string | undefined>>;
54
+ }
55
+ export type TestitOperationHandler = (input: Readonly<Record<string, unknown>>, context: OperationContext) => TestitRequest;
56
+ export declare const TESTIT_HANDLERS: Readonly<Record<string, TestitOperationHandler>>;
57
+ /** One bounded string field: an unbounded answer would drown the tool result. */
58
+ export declare function bounded(value: string | undefined, max: number): string | undefined;
59
+ /**
60
+ * One block of external text. Test IT content is written by people and by
61
+ * test tooling, so it is handed over as data with its size and a truncation
62
+ * marker, never as a string the model could read as an instruction.
63
+ */
64
+ export declare function contentBlock(text: string | undefined, limit: number): Record<string, unknown> | undefined;
65
+ /**
66
+ * A page of a collection Test IT pages itself. The count comes from the
67
+ * `Pagination-Total-Items` header: the body is a bare array and the search
68
+ * endpoints that would report a total are POST-only, so without the header the
69
+ * model is told only whether the page looked full.
70
+ */
71
+ export declare function paged(items: readonly unknown[], page: TestitPage | undefined, limit: number, offset: number): Record<string, unknown>;
72
+ /**
73
+ * A collection Test IT answers whole. The provider slices it to the limit and
74
+ * says `truncated`, so the model can narrow the request instead of believing a
75
+ * cut list is the complete one.
76
+ */
77
+ export declare function capped(items: readonly unknown[], limit: number): Record<string, unknown>;
78
+ export interface TestitProjectionContext {
79
+ readonly flags: TestitFlags;
80
+ /** The validated tool arguments; filters the API cannot express live here. */
81
+ readonly input: Readonly<Record<string, unknown>>;
82
+ readonly page?: TestitPage | undefined;
83
+ /** Label of the configured instance, echoed so the model can name it. */
84
+ readonly instanceLabel?: string | undefined;
85
+ /** Canonical address of that instance, which is operator configuration. */
86
+ readonly baseUrl?: string | undefined;
87
+ }
88
+ export type TestitProjection = (data: unknown, context: TestitProjectionContext) => unknown;
89
+ /**
90
+ * Response shaping per operation. A projection never invents a field upstream
91
+ * did not send: Test IT tolerates version skew by adding properties, so a
92
+ * missing key is dropped rather than defaulted into a claim.
93
+ */
94
+ export declare const TESTIT_PROJECTIONS: Readonly<Record<string, TestitProjection>>;
95
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { ToolDefinition } from "@deepseek-ai/dsh-tools";
2
+ import type { IntegrationBroker } from "../../broker.js";
3
+ import type { IntegrationPrincipal } from "../../types.js";
4
+ export declare const TESTIT_TOOL_NAMES: readonly ["testit_connection_get", "testit_projects", "testit_project_get", "testit_sections", "testit_work_items", "testit_work_item_get", "testit_work_item_history", "testit_work_item_comments", "testit_work_item_test_results", "testit_test_plans", "testit_test_plan_get", "testit_test_plan_summary", "testit_test_runs", "testit_test_run_get", "testit_test_run_results", "testit_test_result_get", "testit_test_result_attachments", "testit_attachment_metadata", "testit_attachment_text", "testit_auto_tests", "testit_auto_test_get", "testit_configurations"];
5
+ /**
6
+ * Every tool reads what the *connected* Test IT token may read, never a
7
+ * caller-supplied identity: the connection comes from the stored integration of
8
+ * the QA user who owns the DSH session, and no tool schema carries a user,
9
+ * credential, token or installation selector.
10
+ */
11
+ export declare function createTestitTools(options: {
12
+ readonly broker: IntegrationBroker;
13
+ readonly principalForSession: (sessionId: string) => IntegrationPrincipal | undefined;
14
+ }): readonly ToolDefinition[];
15
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1,67 @@
1
+ import type { ResolvedQaIntegrationsConfig } from "../../config.js";
2
+ import { type BoundedText } from "../shared/http.js";
3
+ import { type TestitFlags, type TestitInstance } from "./config.js";
4
+ /**
5
+ * Encrypted credential payload of one Test IT connection: which configured
6
+ * installation the API token belongs to, and the token itself. The base URL is
7
+ * not stored — it is re-resolved from operator config on every call, so
8
+ * removing or repointing an instance takes effect at once instead of at the
9
+ * next connect.
10
+ */
11
+ export interface TestitCredential {
12
+ readonly instanceId: string;
13
+ readonly token: string;
14
+ }
15
+ export declare function credentialFromPlaintext(plaintext: string): TestitCredential;
16
+ /**
17
+ * The configured installation a credential belongs to. A token minted for an
18
+ * instance the operator has since removed fails closed: it never falls back to
19
+ * another instance, however permissive that one is.
20
+ */
21
+ export declare function credentialInstance(flags: TestitFlags, credential: TestitCredential): TestitInstance;
22
+ export interface TestitQuery {
23
+ readonly [key: string]: string | number | boolean | undefined;
24
+ }
25
+ /** What Test IT reports about the page it just answered with. */
26
+ export interface TestitPage {
27
+ readonly skip?: number | undefined;
28
+ readonly take?: number | undefined;
29
+ readonly total?: number | undefined;
30
+ readonly pages?: number | undefined;
31
+ }
32
+ export interface TestitJsonResponse<T> {
33
+ readonly data: T;
34
+ readonly page?: TestitPage | undefined;
35
+ }
36
+ export type TestitTextResponse = BoundedText;
37
+ /**
38
+ * HTTP boundary of the provider: one documented Test IT API call, bounded in
39
+ * time and size, with upstream failures folded into safe domain errors and
40
+ * bounded retries for the transient ones.
41
+ *
42
+ * The API token reaches Test IT as the `PrivateToken` authorization header and
43
+ * nowhere else: no query parameter, URL segment or body this provider builds
44
+ * ever carries it.
45
+ */
46
+ export declare class TestitTransport {
47
+ private readonly config;
48
+ private readonly flags;
49
+ private readonly fetcher;
50
+ constructor(config: ResolvedQaIntegrationsConfig, flags: TestitFlags, fetcher?: typeof fetch);
51
+ getJson<T>(instance: TestitInstance, token: string, path: string, query?: TestitQuery): Promise<TestitJsonResponse<T>>;
52
+ /**
53
+ * A bounded byte read: the one attachment download, which is not JSON and
54
+ * whose budget is the caller's, capped by the deployment.
55
+ */
56
+ getText(instance: TestitInstance, token: string, path: string, maxBytes: number, query?: TestitQuery): Promise<TestitTextResponse>;
57
+ private url;
58
+ private request;
59
+ /**
60
+ * The provider error model. Test IT answers a missing or hidden resource with
61
+ * 404 and a refused permission with 403; both stay distinct so the model can
62
+ * tell "you may not" from "it is not there", and neither ever carries an
63
+ * upstream body, which can name internal hosts or echo the request.
64
+ */
65
+ private failure;
66
+ }
67
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1,43 @@
1
+ import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
2
+ import type { WeblateFlags } from "./config.js";
3
+ /**
4
+ * Capabilities this provider offers, one per kind of data rather than one per
5
+ * endpoint: the operator decides what this deployment is willing to expose, and
6
+ * Weblate's own project, component and language permissions still decide what
7
+ * the connected token may read. There is no capability for a write, because the
8
+ * catalog carries no operation that could change Weblate state.
9
+ */
10
+ export type WeblateCapability = "identity.read" | "projects.read" | "components.read" | "translations.read" | "units.read" | "checks.read" | "comments.read" | "suggestions.read" | "changes.read" | "statistics.read" | "screenshots.read";
11
+ export interface WeblateCapabilityDefinition {
12
+ readonly capability: WeblateCapability;
13
+ readonly flag: Exclude<keyof WeblateFlags, "instances" | "retries" | "enabled" | "allowInsecureHttp">;
14
+ readonly label: string;
15
+ readonly hint: string;
16
+ }
17
+ export declare const WEBLATE_CAPABILITIES: readonly WeblateCapabilityDefinition[];
18
+ export interface WeblateOperationDefinition {
19
+ readonly capability: WeblateCapability;
20
+ /**
21
+ * REST path under the instance's `/api` root. `:placeholders` are filled by
22
+ * the handler; the value is a fixed string, so the model can never pick an
23
+ * endpoint of its own.
24
+ */
25
+ readonly path: string;
26
+ /** Set when the operation answers with one page of a collection. */
27
+ readonly list?: boolean;
28
+ }
29
+ /**
30
+ * Every model-reachable operation. The provider refuses any operation that is
31
+ * not listed here, so this table — together with `capability` — is the
32
+ * permission surface. Only GET: localization writes (suggestions, comments,
33
+ * translations, approvals) and the repository, file and autotranslate
34
+ * operations stay out until the confirmation framework exists.
35
+ */
36
+ export declare const WEBLATE_OPERATIONS: Readonly<Record<string, WeblateOperationDefinition>>;
37
+ /** Capabilities this deployment allows, in catalog order. */
38
+ export declare function enabledCapabilities(flags: WeblateFlags): readonly WeblateCapability[];
39
+ /** Label and hint per capability, for clients that render what we declare. */
40
+ export declare const WEBLATE_CAPABILITY_INFO: Readonly<Record<WeblateCapability, IntegrationCapabilityInfo>>;
41
+ /** Capability an operation needs, or undefined when the catalog has none. */
42
+ export declare function weblateOperationCapability(operation: string): IntegrationCapability | undefined;
43
+ //# sourceMappingURL=catalog.d.ts.map