@yadsh/dsh-qa-integrations 0.10.4 → 0.11.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 (92) hide show
  1. package/README.md +7 -2
  2. package/compatibility.json +1 -1
  3. package/lib/broker/outcomes.js +92 -0
  4. package/lib/broker/outcomes.js.map +1 -0
  5. package/lib/broker/service-view.js +93 -0
  6. package/lib/broker/service-view.js.map +1 -0
  7. package/lib/broker.js +37 -209
  8. package/lib/broker.js.map +1 -1
  9. package/lib/client/index.js +7 -0
  10. package/lib/client/index.js.map +1 -1
  11. package/lib/client/integrations.js.map +1 -1
  12. package/lib/client/operator-card.js +27 -6
  13. package/lib/client/operator-card.js.map +1 -1
  14. package/lib/client/operator-controls.js +84 -13
  15. package/lib/client/operator-controls.js.map +1 -1
  16. package/lib/client/operator-sections/service-operation-policy.js +30 -0
  17. package/lib/client/operator-sections/service-operation-policy.js.map +1 -0
  18. package/lib/client/operator-sections/service-profiles.js +35 -27
  19. package/lib/client/operator-sections/service-profiles.js.map +1 -1
  20. package/lib/client/operator-sections/shared.js.map +1 -1
  21. package/lib/client/operator-service-reach.js +6 -2
  22. package/lib/client/operator-service-reach.js.map +1 -1
  23. package/lib/client/provider-card.js +3 -1
  24. package/lib/client/provider-card.js.map +1 -1
  25. package/lib/client/styles.js +18 -15
  26. package/lib/client/styles.js.map +1 -1
  27. package/lib/client.js +17435 -1909
  28. package/lib/client.js.map +1 -1
  29. package/lib/index.js +8 -0
  30. package/lib/index.js.map +1 -1
  31. package/lib/providers/bitrix24/index.js +11 -3
  32. package/lib/providers/bitrix24/index.js.map +1 -1
  33. package/lib/providers/confluence/index.js +11 -3
  34. package/lib/providers/confluence/index.js.map +1 -1
  35. package/lib/providers/gitlab/index.js +11 -3
  36. package/lib/providers/gitlab/index.js.map +1 -1
  37. package/lib/providers/jira/index.js +11 -3
  38. package/lib/providers/jira/index.js.map +1 -1
  39. package/lib/providers/shared/service-boundary.js +14 -15
  40. package/lib/providers/shared/service-boundary.js.map +1 -1
  41. package/lib/providers/teamcity/index.js +13 -3
  42. package/lib/providers/teamcity/index.js.map +1 -1
  43. package/lib/providers/testit/catalog.js +2 -0
  44. package/lib/providers/testit/catalog.js.map +1 -1
  45. package/lib/providers/testit/index.js +11 -3
  46. package/lib/providers/testit/index.js.map +1 -1
  47. package/lib/providers/weblate/index.js +11 -3
  48. package/lib/providers/weblate/index.js.map +1 -1
  49. package/lib/repository.js +2 -2
  50. package/lib/repository.js.map +1 -1
  51. package/lib/service-credentials/catalog.js +26 -0
  52. package/lib/service-credentials/catalog.js.map +1 -0
  53. package/lib/service-credentials/config.js +4 -9
  54. package/lib/service-credentials/config.js.map +1 -1
  55. package/lib/service-credentials/operation-policy.js +28 -0
  56. package/lib/service-credentials/operation-policy.js.map +1 -0
  57. package/lib/service-credentials/policy.js +14 -22
  58. package/lib/service-credentials/policy.js.map +1 -1
  59. package/lib/service-credentials/state.js +18 -16
  60. package/lib/service-credentials/state.js.map +1 -1
  61. package/lib/service-credentials/types.js.map +1 -1
  62. package/lib/typert.host.js +1235 -702
  63. package/lib/typert.remote-client.d.ts +57 -3
  64. package/lib/typert.remote-client.js +1213 -696
  65. package/lib/types/broker/outcomes.d.ts +35 -0
  66. package/lib/types/broker/service-view.d.ts +24 -0
  67. package/lib/types/broker.d.ts +1 -48
  68. package/lib/types/client/integrations.d.ts +6 -2
  69. package/lib/types/client/operator-card.d.ts +3 -1
  70. package/lib/types/client/operator-controls.d.ts +8 -0
  71. package/lib/types/client/operator-sections/service-operation-policy.d.ts +12 -0
  72. package/lib/types/client/operator-sections/shared.d.ts +2 -0
  73. package/lib/types/client/operator-service-reach.d.ts +4 -0
  74. package/lib/types/index.d.ts +3 -0
  75. package/lib/types/providers/bitrix24/index.d.ts +1 -1
  76. package/lib/types/providers/confluence/index.d.ts +1 -1
  77. package/lib/types/providers/contract.d.ts +3 -1
  78. package/lib/types/providers/gitlab/index.d.ts +1 -1
  79. package/lib/types/providers/jira/index.d.ts +1 -1
  80. package/lib/types/providers/shared/service-boundary.d.ts +8 -9
  81. package/lib/types/providers/teamcity/index.d.ts +1 -1
  82. package/lib/types/providers/testit/index.d.ts +1 -1
  83. package/lib/types/providers/weblate/index.d.ts +1 -1
  84. package/lib/types/repository.d.ts +1 -1
  85. package/lib/types/service-credentials/catalog.d.ts +4 -0
  86. package/lib/types/service-credentials/config.d.ts +2 -2
  87. package/lib/types/service-credentials/operation-policy.d.ts +15 -0
  88. package/lib/types/service-credentials/policy.d.ts +3 -1
  89. package/lib/types/service-credentials/state.d.ts +2 -1
  90. package/lib/types/service-credentials/types.d.ts +5 -3
  91. package/lib/types/types.d.ts +15 -0
  92. package/package.json +20 -20
@@ -0,0 +1,35 @@
1
+ import { type IntegrationErrorCode } from "../errors.js";
2
+ import type { ServiceCredentialHealth } from "../service-credentials/types.js";
3
+ import type { IntegrationProviderId, StoredIntegration } from "../types.js";
4
+ /** What a probe verdict means for the stored binding, if anything. */
5
+ export declare function healthCode(health: ServiceCredentialHealth | undefined): IntegrationErrorCode | undefined;
6
+ export declare function refusedCredentialCode(error: unknown): IntegrationErrorCode | undefined;
7
+ export declare function isPolicyDenial(error: unknown): boolean;
8
+ /**
9
+ * A deadline report reads only the budget the transport actually spent.
10
+ * No upstream address, query, body or credential enters these log fields.
11
+ */
12
+ export declare function transportTimeoutFields(provider: IntegrationProviderId, operation: string, error: unknown, serviceProfileId?: string | undefined): {
13
+ provider: string;
14
+ operation: string;
15
+ timeoutMs?: number | undefined;
16
+ retries?: number | undefined;
17
+ attempts?: number | undefined;
18
+ serviceProfile?: string | undefined;
19
+ } | undefined;
20
+ /**
21
+ * Describe the shape of the upstream refusal, never its content. A timeout
22
+ * has its own report; an admission refusal has no upstream diagnostics.
23
+ */
24
+ export declare function callFailureFields(provider: IntegrationProviderId, integration: Pick<StoredIntegration, "id" | "credentialSource">, operation: string, error: unknown, serviceProfileId?: string | undefined): {
25
+ provider: string;
26
+ operation: string;
27
+ reason: "CredentialExpired" | "CredentialRevoked" | "IntegrationNotConnected" | "InvalidCredential" | "InvalidRequest" | "OperationDeniedByPolicy" | "OperationNotAllowedWithServiceCredential" | "PersonalCredentialRequired" | "PrincipalNotResolved" | "ProviderPermissionDenied" | "ProviderUnavailable" | "RateLimited" | "ResourceNotFound" | "ResultTooLarge" | "SensitiveReadRequiresPersonalCredential" | "ServiceCredentialDisabled" | "ServiceCredentialInvalid" | "ServiceCredentialUnavailable" | "ServiceCredentialUnsafeScope" | "ServiceResourceNotAllowed" | "TlsFailure";
28
+ integrationId: string;
29
+ credentialSource: import("../types.js").CredentialSource;
30
+ status?: number | undefined;
31
+ contentType?: string | undefined;
32
+ errorClass?: string | undefined;
33
+ serviceProfile?: string | undefined;
34
+ } | undefined;
35
+ //# sourceMappingURL=outcomes.d.ts.map
@@ -0,0 +1,24 @@
1
+ import type { IntegrationProvider } from "../providers/contract.js";
2
+ import type { ServiceCredentialProfile, ServiceResourceBoundary } from "../service-credentials/types.js";
3
+ import type { CapabilityServiceState, EncryptedSecretRecord, IntegrationCapability, IntegrationServiceSummary, IntegrationSummary, IntegrationProviderId, IntegrationProviderSummary, StoredIntegration } from "../types.js";
4
+ /** Provider discovery exposes descriptive metadata, with no credential. */
5
+ export declare function providerSummary(provider: IntegrationProvider): IntegrationProviderSummary;
6
+ /**
7
+ * The live grant is the stored grant with withdrawn capabilities removed.
8
+ * Call admission, policy edits and operator views use the same intersection.
9
+ */
10
+ export declare function grantedCapabilities(integration: Pick<StoredIntegration, "capabilities" | "credentialSource">, provider: IntegrationProvider, profile?: ServiceCredentialProfile): readonly IntegrationCapability[];
11
+ /** Capabilities the managed credential can reach through this provider. */
12
+ export declare function serviceCapabilities(provider: IntegrationProvider, policy?: ServiceCredentialProfile["policy"]): readonly IntegrationCapability[];
13
+ /** Managed capability states as the operator can see them, without a secret. */
14
+ export declare function serviceCapabilityStates(provider: IntegrationProvider, policy?: ServiceCredentialProfile["policy"]): Readonly<Record<string, CapabilityServiceState>> | null;
15
+ /**
16
+ * The caller resolves the profile; this projection reads no registry or secret
17
+ * and changes no binding. A provider without service support displays no view.
18
+ */
19
+ export declare function serviceSummary(capabilities: Readonly<Record<string, CapabilityServiceState>> | null, profile: ServiceCredentialProfile | undefined, selection: ServiceResourceBoundary | null): IntegrationServiceSummary | null;
20
+ /** A provider with no binding exposes metadata but grants no policy. */
21
+ export declare function disconnectedSummary(providerId: IntegrationProviderId, provider: IntegrationProvider, service: IntegrationServiceSummary | null): IntegrationSummary;
22
+ /** Display one captured binding with its live grant and stored policy. */
23
+ export declare function connectedSummary(providerId: IntegrationProviderId, provider: IntegrationProvider, integration: StoredIntegration, granted: readonly IntegrationCapability[], policy: IntegrationSummary["policy"], secret: Pick<EncryptedSecretRecord, "updatedAt"> | undefined, service: IntegrationServiceSummary | null): IntegrationSummary;
24
+ //# sourceMappingURL=service-view.d.ts.map
@@ -38,17 +38,8 @@ export declare class IntegrationBroker {
38
38
  listProviders(): readonly IntegrationProviderSummary[];
39
39
  list(principal: IntegrationPrincipal): readonly IntegrationSummary[];
40
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
41
  private grantedCapabilities;
42
+ private serviceCapabilities;
52
43
  /**
53
44
  * Connect one provider for one principal. The credential source is decided
54
45
  * here, server-side: the client may ask for service mode, and gets it only
@@ -117,21 +108,6 @@ export declare class IntegrationBroker {
117
108
  readonly input: Readonly<Record<string, unknown>>;
118
109
  readonly sourceSessionId: string;
119
110
  }): Promise<IntegrationToolResult>;
120
- /**
121
- * Record a call this deployment's own deadline ended.
122
- *
123
- * Without it the failure is invisible where an operator looks for it: the
124
- * audit row says `error`, the trail of the reason code is the chat, and the
125
- * log — the one surface that outlives both — carried nothing about a provider
126
- * that stopped answering. The provider and the operation are this call's; the
127
- * deadline and the attempts come written on the error by the transport loop
128
- * that spent them, which is the only party that ever knew them.
129
- *
130
- * Nothing upstream is named here: no address, no query, no body, no
131
- * credential. Numbers, a provider id and an operation are enough to find the
132
- * call again in the trail.
133
- */
134
- private logTransportTimeout;
135
111
  /**
136
112
  * Write what one live call learned about its binding back onto that binding.
137
113
  *
@@ -157,21 +133,6 @@ export declare class IntegrationBroker {
157
133
  * stay red until somebody thought to press a button that answers nothing new.
158
134
  */
159
135
  private healAfterCall;
160
- /**
161
- * Say in this plugin's own log what a refused live call met.
162
- *
163
- * The chat carries the sentence the model was shown, the audit trail carries
164
- * the result, and neither is where an operator looks; before this a live
165
- * refusal left no line behind at all. The fields describe the shape of the
166
- * answer — its status, its media type, the class of the transport failure —
167
- * never its body, and never a credential.
168
- *
169
- * Two refusals are left to their own records: a call this deployment's
170
- * deadline ended is `transport.timeout`, budget and all, and a refusal decided
171
- * without any answer — a policy switch, a connection that is not there — has
172
- * no upstream to report on, which is what the absence of diagnostics says.
173
- */
174
- private logCallFailure;
175
136
  /**
176
137
  * Spend one unit of the service-mode ceiling before the call leaves for
177
138
  * upstream. Both sides of the limit are consulted together: one principal may
@@ -210,14 +171,6 @@ export declare class IntegrationBroker {
210
171
  */
211
172
  private buildServiceCredential;
212
173
  private probeService;
213
- /** Capabilities the managed credential can reach through this provider. */
214
- private serviceCapabilities;
215
- /**
216
- * Managed-credential state of one provider, as a client renders it. Null for a
217
- * provider that supports no managed credential at all, so nothing about the
218
- * feature appears where it does not apply.
219
- */
220
- private serviceSummary;
221
174
  private requireConnected;
222
175
  /**
223
176
  * Unlock the credential of one captured binding. The lookup starts from the
@@ -1,6 +1,6 @@
1
1
  import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
2
  import type { QaUserSettingsSectionProps } from "@yadsh/dsh-qa-surface/client/settings";
3
- import type { IntegrationProviderSummary } from "../types.js";
3
+ import type { IntegrationProviderSummary, ServicePolicyOperation } from "../types.js";
4
4
  import { type Bitrix24Remote, type IntegrationsRemote } from "./bitrix24.js";
5
5
  import { type ConfluenceRemote } from "./confluence.js";
6
6
  import { type GitlabRemote } from "./gitlab.js";
@@ -12,7 +12,11 @@ import { type WeblateRemote } from "./weblate.js";
12
12
  export interface CredentialHelpRemote {
13
13
  providers(token: string): Promise<RemoteResult<readonly IntegrationProviderSummary[]>>;
14
14
  }
15
- export type IntegrationsClientRemote = CredentialHelpRemote & IntegrationsRemote & Bitrix24Remote & ConfluenceRemote & GitlabRemote & TeamcityRemote & JiraRemote & TestitRemote & WeblateRemote;
15
+ /** The operator card reads the current service operation catalog. */
16
+ export interface ServiceOperationCatalogRemote {
17
+ serviceOperationCatalog(): Promise<RemoteResult<Readonly<Record<string, readonly ServicePolicyOperation[]>>>>;
18
+ }
19
+ export type IntegrationsClientRemote = CredentialHelpRemote & ServiceOperationCatalogRemote & IntegrationsRemote & Bitrix24Remote & ConfluenceRemote & GitlabRemote & TeamcityRemote & JiraRemote & TestitRemote & WeblateRemote;
16
20
  /** What every mount of the provider cards needs. */
17
21
  export interface ProviderCardsProps {
18
22
  /** Current QA account token; transport authentication for the remotes. */
@@ -16,8 +16,10 @@ import type { ConfigForm } from "@deepseek-ai/dsh-client-ui-settings/client";
16
16
  import type { InjectFace, PropsRuntime } from "@deepseek-ai/dsh-client-ui-slots";
17
17
  import { type ReactElement } from "react";
18
18
  import type { QaIntegrationsConfig } from "../config.js";
19
+ import type { ServicePolicyOperation } from "../types.js";
19
20
  /** The face the slot entry injects into this card. */
20
21
  export interface OperatorCardFace {
22
+ readonly loadServiceOperations?: () => Promise<Readonly<Record<string, readonly ServicePolicyOperation[]>>>;
21
23
  /**
22
24
  * The live Config of this plugin's namespace.
23
25
  *
@@ -69,6 +71,6 @@ export declare const QA_INTEGRATIONS_ROW_SUMMARY = "Principal-scoped, encrypted
69
71
  * than with a second render of it.
70
72
  */
71
73
  export declare function OperatorCardEntry(props: CardProps): ReactElement | string;
72
- export declare function OperatorCard({ settingsForm }: CardProps): ReactElement;
74
+ export declare function OperatorCard({ settingsForm, loadServiceOperations, }: CardProps): ReactElement;
73
75
  export {};
74
76
  //# sourceMappingURL=operator-card.d.ts.map
@@ -27,6 +27,14 @@ export interface ValueProps<T> {
27
27
  readonly path: readonly string[];
28
28
  readonly value: T;
29
29
  }
30
+ /** A row's React identity is local and survives edits to its configured id. */
31
+ export declare function useDraftRowIdentity<T extends {
32
+ readonly id: string;
33
+ }>(): {
34
+ key: (row: T) => number;
35
+ patch: (row: T, patch: Partial<T>) => T;
36
+ reconcile: (stored: readonly T[], current: readonly T[], pendingStart: number) => readonly T[];
37
+ };
30
38
  /** The control's DOM id, derived from its settings path: one per field. */
31
39
  export declare function fieldId(path: readonly string[]): string;
32
40
  /**
@@ -0,0 +1,12 @@
1
+ import type { ReactElement } from "react";
2
+ import type { ServicePolicyOperation } from "../../types.js";
3
+ /** One profile's decisions, stored together with its credential and boundary. */
4
+ export declare function ServiceOperationPolicyField(props: {
5
+ readonly provider: string;
6
+ readonly operations: readonly ServicePolicyOperation[];
7
+ readonly entries: ReadonlyArray<readonly [string, string]>;
8
+ readonly disabled: boolean;
9
+ readonly testId: string;
10
+ readonly onChange: (entries: ReadonlyArray<readonly [string, string]>) => void;
11
+ }): ReactElement;
12
+ //# sourceMappingURL=service-operation-policy.d.ts.map
@@ -7,8 +7,10 @@
7
7
  */
8
8
  import type { ReactElement, ReactNode } from "react";
9
9
  import type { ControlProps } from "../operator-controls.js";
10
+ import type { ServicePolicyOperation } from "../../types.js";
10
11
  /** The plumbing one section uses to reach the settings namespace. */
11
12
  export interface OperatorForm {
13
+ readonly serviceOperations?: Readonly<Record<string, readonly ServicePolicyOperation[]>>;
12
14
  /** The raw user layer of the namespace; absent means the schema default. */
13
15
  readonly config: Record<string, unknown>;
14
16
  readonly control: ControlProps;
@@ -2,6 +2,10 @@
2
2
  * How far the deployment's managed service credential reaches each capability
3
3
  * switch of the operator card.
4
4
  *
5
+ * Default reach of each integration area. The profile operation editor can
6
+ * explicitly open supported sensitive reads; the live account summary carries
7
+ * those decisions. This table describes defaults only.
8
+ *
5
9
  * A switch answers "does the agent see this area of the integration", and the
6
10
  * managed credential honours it only for the areas whose answer is not text a
7
11
  * build or another person produced. Those readings stay personal while the
@@ -3,6 +3,7 @@ import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
3
3
  import type { QaSurface } from "@yadsh/dsh-qa-surface";
4
4
  import { IntegrationBroker } from "./broker.js";
5
5
  import { type LiveQaIntegrationsConfig } from "./config.js";
6
+ import type { ServicePolicyOperation } from "./types.js";
6
7
  import type { CredentialSource, IntegrationInstanceSummary, ServiceCredentialHealth, IntegrationProviderId, IntegrationProviderSummary, IntegrationServiceBoundary, IntegrationSummary, PolicyPatch } from "./types.js";
7
8
  export declare const name = "dsh-qa-integrations";
8
9
  export declare const inject: readonly ["qaSurface", "tools"];
@@ -103,6 +104,8 @@ export declare class QaIntegrations extends TypertRemoteService {
103
104
  readonly enabled: boolean;
104
105
  readonly providers: readonly IntegrationProviderId[];
105
106
  };
107
+ /** Non-secret operation metadata for the operator's profile editor. */
108
+ serviceOperationCatalog(): Readonly<Record<string, readonly ServicePolicyOperation[]>>;
106
109
  providers(token: string): readonly IntegrationProviderSummary[];
107
110
  list(token: string): readonly IntegrationSummary[];
108
111
  getBitrix24(token: string): IntegrationSummary;
@@ -36,7 +36,7 @@ export declare class Bitrix24Provider implements IntegrationProvider {
36
36
  * the duplicate lookup stay personal) reports `sensitive`, so the card says
37
37
  * what the connection loses in service mode.
38
38
  */
39
- capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
39
+ capabilityServiceState(capability: IntegrationCapability, policy?: Readonly<Record<string, "allow" | "deny">>): CapabilityServiceState | undefined;
40
40
  /**
41
41
  * Bitrix24 scopes by portal, not by project, so `"portals"` is the one
42
42
  * boundary kind: the profile names the portal hosts a service account may
@@ -67,7 +67,7 @@ export declare class ConfluenceProvider implements IntegrationProvider {
67
67
  * connect form name sites alike.
68
68
  */
69
69
  instancePortal(instanceId: string): string | undefined;
70
- capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
70
+ capabilityServiceState(capability: IntegrationCapability, policy?: Readonly<Record<string, "allow" | "deny">>): CapabilityServiceState | undefined;
71
71
  validate(context: ProviderContext): Promise<ProviderValidation>;
72
72
  /**
73
73
  * Health of a deployment-managed token. The probe reads only the identity
@@ -22,6 +22,8 @@ export interface ProviderContext {
22
22
  * mapped to a resource first.
23
23
  */
24
24
  readonly resourceBoundary?: ServiceResourceBoundary | undefined;
25
+ /** Policy supplied by the broker, never by model input. */
26
+ readonly serviceOperationPolicy?: Readonly<Record<string, "allow" | "deny">> | undefined;
25
27
  }
26
28
  export interface IntegrationProvider {
27
29
  readonly id: IntegrationProviderId;
@@ -71,7 +73,7 @@ export interface IntegrationProvider {
71
73
  * managed credential. A provider that omits this supports no managed
72
74
  * credential at all, and nothing about the feature appears for it.
73
75
  */
74
- capabilityServiceState?(capability: IntegrationCapability): CapabilityServiceState | undefined;
76
+ capabilityServiceState?(capability: IntegrationCapability, policy?: Readonly<Record<string, "allow" | "deny">>): CapabilityServiceState | undefined;
75
77
  /**
76
78
  * Which kind of resource an operation reads, in the profile's vocabulary
77
79
  * (`projects`, `groups`, …). Used to prove a boundary exists for the operation
@@ -48,7 +48,7 @@ export declare class GitlabProvider implements IntegrationProvider {
48
48
  * connect form name instances alike.
49
49
  */
50
50
  instancePortal(instanceId: string): string | undefined;
51
- capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
51
+ capabilityServiceState(capability: IntegrationCapability, policy?: Readonly<Record<string, "allow" | "deny">>): CapabilityServiceState | undefined;
52
52
  validate(context: ProviderContext): Promise<ProviderValidation>;
53
53
  /**
54
54
  * Health of a deployment-managed token. The probe reads only the two
@@ -56,7 +56,7 @@ export declare class JiraProvider implements IntegrationProvider {
56
56
  * form name sites alike.
57
57
  */
58
58
  instancePortal(instanceId: string): string | undefined;
59
- capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
59
+ capabilityServiceState(capability: IntegrationCapability, policy?: Readonly<Record<string, "allow" | "deny">>): CapabilityServiceState | undefined;
60
60
  /**
61
61
  * Health of a deployment-managed token. The probe reads only the identity
62
62
  * endpoint the personal validation reads, so it never changes upstream state;
@@ -1,3 +1,4 @@
1
+ import { type ServiceOperationSelection } from "../../service-credentials/operation-policy.js";
1
2
  import { IntegrationError } from "../../errors.js";
2
3
  import { type OperationSecurityMetadata, type ServiceResourceBoundary } from "../../service-credentials/types.js";
3
4
  import type { ProviderContext } from "../contract.js";
@@ -14,12 +15,12 @@ export declare function serviceBoundaryOf(context: ProviderContext): ServiceReso
14
15
  /** One refusal shape, so every service-mode denial reads the same. */
15
16
  export declare function serviceResourceDenied(): IntegrationError;
16
17
  /**
17
- * What the managed credential never answers, in the words a tool says before it
18
+ * What the managed credential refuses by default, in the words a tool says before it
18
19
  * is called. The model reads this instead of discovering it in a refusal, so it
19
20
  * neither promises a user a log it cannot fetch nor goes looking for a fault in
20
21
  * the stand's own integration.
21
22
  */
22
- export declare const SERVICE_CEILING_NOTICE = "Needs a personal connection: under the deployment's managed service token the service ceiling refuses this reading, and the user switches this integration to their own account to get it.";
23
+ export declare const SERVICE_CEILING_NOTICE = "By default this reading needs a personal connection. The administrator can permit it for a managed service profile; resource boundaries still apply.";
23
24
  /**
24
25
  * Whether the ceiling refuses one operation *as a reading* — the case worth
25
26
  * warning about, because the deployment's capability switch stays on while the
@@ -29,12 +30,10 @@ export declare const SERVICE_CEILING_NOTICE = "Needs a personal connection: unde
29
30
  */
30
31
  export declare function serviceCeilingRefusedReading(security: OperationSecurityMetadata | undefined): boolean;
31
32
  /**
32
- * Refuse an operation the provider's own catalog does not mark as service-safe.
33
- * The broker decides this first and with the administrator's narrowing on top;
34
- * this guard is the second lock, so a caller that reaches a provider directly —
35
- * or a future bug in the broker — still cannot read a log through a shared
36
- * credential. An operation the provider does not classify is denied, exactly as
37
- * the broker's default is.
33
+ * Apply the catalog defaults and the trusted service profile's allow/deny rules.
34
+ * The broker decides this first; this guard repeats the decision for callers
35
+ * that reach a provider directly. An operation the provider does not classify
36
+ * is denied, exactly as the broker's default is.
38
37
  */
39
- export declare function assertServiceOperationAllowed(metadata: OperationSecurityMetadata | undefined, message: string): void;
38
+ export declare function assertServiceOperationAllowed(metadata: OperationSecurityMetadata | undefined, message: string, selection?: ServiceOperationSelection): void;
40
39
  //# sourceMappingURL=service-boundary.d.ts.map
@@ -56,7 +56,7 @@ export declare class TeamcityProvider implements IntegrationProvider {
56
56
  operationCapability(operation: string): IntegrationCapability | undefined;
57
57
  operationMetadata(operation: string): OperationSecurityMetadata | undefined;
58
58
  resourceBoundaryKind(operation: string): string | undefined;
59
- capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
59
+ capabilityServiceState(capability: IntegrationCapability, policy?: Readonly<Record<string, "allow" | "deny">>): CapabilityServiceState | undefined;
60
60
  /** An empty id means this deployment's single server, as in `parseCredential`. */
61
61
  instancePortal(instanceId: string): string | undefined;
62
62
  validate(context: ProviderContext): Promise<ProviderValidation>;
@@ -53,7 +53,7 @@ export declare class TestitProvider implements IntegrationProvider {
53
53
  * configuration and the connect form name installations alike.
54
54
  */
55
55
  instancePortal(instanceId: string): string | undefined;
56
- capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
56
+ capabilityServiceState(capability: IntegrationCapability, policy?: Readonly<Record<string, "allow" | "deny">>): CapabilityServiceState | undefined;
57
57
  /**
58
58
  * The documented first validation call is the project list: an authorized
59
59
  * answer proves the address and the token at once, and an empty project list
@@ -52,7 +52,7 @@ export declare class WeblateProvider implements IntegrationProvider {
52
52
  * connect form name instances alike.
53
53
  */
54
54
  instancePortal(instanceId: string): string | undefined;
55
- capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
55
+ capabilityServiceState(capability: IntegrationCapability, policy?: Readonly<Record<string, "allow" | "deny">>): CapabilityServiceState | undefined;
56
56
  validate(context: ProviderContext): Promise<ProviderValidation>;
57
57
  /**
58
58
  * Health of a deployment-managed token. The probe is the one read personal
@@ -63,7 +63,7 @@ export declare class IntegrationRepository {
63
63
  * generation guard has no reason to accept.
64
64
  */
65
65
  secretByRef(principal: IntegrationPrincipal, provider: IntegrationProviderId, secretRef: string | null): EncryptedSecretRecord | undefined;
66
- policy(integration: StoredIntegration, operation: IntegrationCapability): IntegrationPolicyMode;
66
+ policy(integration: StoredIntegration, operation: IntegrationCapability, fallback?: IntegrationPolicyMode): IntegrationPolicyMode;
67
67
  connect(options: {
68
68
  principal: IntegrationPrincipal;
69
69
  provider: IntegrationProviderId;
@@ -0,0 +1,4 @@
1
+ import type { ServicePolicyOperation } from "../types.js";
2
+ /** The editor and execution gates use the same provider operation catalogs. */
3
+ export declare const SERVICE_POLICY_OPERATIONS: Readonly<Record<string, readonly ServicePolicyOperation[]>>;
4
+ //# sourceMappingURL=catalog.d.ts.map
@@ -26,7 +26,7 @@ export interface ManagedServiceCredentialProfileInput {
26
26
  };
27
27
  /** Administrator-defined resource boundary; at least one kind is required. */
28
28
  readonly resources?: Readonly<Record<string, readonly (string | number)[] | undefined>>;
29
- /** Administrator narrowing of the service ceiling. Only `deny` is accepted. */
29
+ /** Allow or deny a classified reading by capability or operation name. */
30
30
  readonly policy?: Readonly<Record<string, string | undefined>>;
31
31
  }
32
32
  /**
@@ -58,7 +58,7 @@ export interface ManagedServiceCredentialProfileConfig {
58
58
  readonly authType: string;
59
59
  readonly secretRef: string;
60
60
  readonly resources: Readonly<Record<string, readonly string[]>>;
61
- readonly policy: Readonly<Record<string, "deny">>;
61
+ readonly policy: Readonly<Record<string, "allow" | "deny">>;
62
62
  }
63
63
  export interface ManagedServiceCredentialsConfig {
64
64
  readonly enabled: boolean;
@@ -0,0 +1,15 @@
1
+ import type { OperationSecurityMetadata } from "./types.js";
2
+ export type ServiceOperationPolicy = Readonly<Record<string, "allow" | "deny">>;
3
+ /** Server-owned profile policy; never taken from a tool's arguments. */
4
+ export interface ServiceOperationSelection {
5
+ readonly provider?: string | undefined;
6
+ readonly capability?: string | undefined;
7
+ readonly operation?: string | undefined;
8
+ readonly policy?: ServiceOperationPolicy | undefined;
9
+ }
10
+ export type ServiceOperationAccess = "allow" | "effect" | "secret" | "policy" | "sensitive" | "default";
11
+ /** Capability and operation aliases share one rule: any explicit deny wins. */
12
+ export declare function serviceOperationOverride(selection: ServiceOperationSelection): "allow" | "deny" | undefined;
13
+ /** Explicit allowances can open classified sensitive reads only. */
14
+ export declare function serviceOperationAccess(metadata: OperationSecurityMetadata | undefined, selection?: ServiceOperationSelection): ServiceOperationAccess;
15
+ //# sourceMappingURL=operation-policy.d.ts.map
@@ -3,7 +3,8 @@ import type { IntegrationCapability } from "../types.js";
3
3
  import type { OperationSecurityMetadata, ServiceCredentialProfile, ServiceResourceBoundary } from "./types.js";
4
4
  /**
5
5
  * The service ceiling: an operation reaches a managed credential only when it
6
- * is a read, carries no more than normal sensitivity, and was classified as
6
+ * is a classified read and either uses its conservative default or an explicit
7
+ * profile allowance for sensitive content. It was classified as
7
8
  * service-safe on purpose. Upstream permissions are never part of this test:
8
9
  * a service token that happens to be able to trigger a build still cannot,
9
10
  * because the operation is a write.
@@ -18,6 +19,7 @@ export type ServicePolicyDecision = {
18
19
  };
19
20
  export interface ServiceOperationQuery {
20
21
  readonly metadata: OperationSecurityMetadata;
22
+ readonly operation?: string | undefined;
21
23
  /** Capability the operation belongs to, when its provider declares one. */
22
24
  readonly capability: IntegrationCapability | undefined;
23
25
  readonly profile: ServiceCredentialProfile;
@@ -1,3 +1,4 @@
1
+ import { type ServiceOperationSelection } from "./operation-policy.js";
1
2
  import type { OperationSecurityMetadata } from "./types.js";
2
3
  import type { CapabilityServiceState } from "../types.js";
3
4
  /**
@@ -10,5 +11,5 @@ import type { CapabilityServiceState } from "../types.js";
10
11
  export declare function operationCapabilityServiceState(operations: Readonly<Record<string, {
11
12
  readonly capability: string;
12
13
  readonly security: OperationSecurityMetadata;
13
- }>>, capability: string): CapabilityServiceState;
14
+ }>>, capability: string, selection?: ServiceOperationSelection): CapabilityServiceState;
14
15
  //# sourceMappingURL=state.d.ts.map
@@ -11,7 +11,7 @@ export declare const CREDENTIAL_SOURCES: readonly CredentialSource[];
11
11
  export declare function isCredentialSource(value: unknown): value is CredentialSource;
12
12
  /** What an operation does upstream; only `read` can ever be service-reachable. */
13
13
  export type OperationEffect = "read" | "write" | "admin";
14
- /** How much an answer may reveal; sensitive and secret answers stay personal. */
14
+ /** Sensitive reads need explicit permission; secret data stays personal. */
15
15
  export type DataSensitivity = "normal" | "sensitive" | "secret";
16
16
  /** Whether the deployment's managed credential may reach one operation. */
17
17
  export type OperationServiceDecision = "allow" | "deny";
@@ -30,6 +30,8 @@ export interface OperationSecurityMetadata {
30
30
  * administrator-defined resource boundary.
31
31
  */
32
32
  readonly requiresResourceBoundary?: boolean;
33
+ /** False when the provider cannot prove a reading's resource ownership. */
34
+ readonly serviceOverrideAllowed?: false;
33
35
  }
34
36
  /**
35
37
  * Classification of an operation its provider does not classify. Deliberately
@@ -81,8 +83,8 @@ export interface ServiceCredentialProfile {
81
83
  /** Set to false to retire a profile without deleting its configuration. */
82
84
  readonly enabled: boolean;
83
85
  readonly resources: ServiceResourceBoundary;
84
- /** Administrator narrowing of the service ceiling; only ever removes. */
85
- readonly policy: Readonly<Record<string, "deny">>;
86
+ /** Operator decisions for classified reads; denies take precedence. */
87
+ readonly policy: Readonly<Record<string, "allow" | "deny">>;
86
88
  /** Hash of the policy-relevant configuration of this profile. */
87
89
  readonly policyRevision: string;
88
90
  }
@@ -3,6 +3,19 @@ export type IntegrationProviderId = string;
3
3
  export type IntegrationAuthKind = "token" | "oauth" | "mcp_token";
4
4
  export type IntegrationStatus = "pending" | "connected" | "error" | "revoked";
5
5
  export type IntegrationPolicyMode = "allow" | "confirm" | "deny";
6
+ /** Public operator metadata only; contains neither credentials nor addresses. */
7
+ export interface ServicePolicyOperation {
8
+ readonly operation: string;
9
+ readonly capability: string;
10
+ readonly label: string;
11
+ readonly security: {
12
+ readonly effect: "read" | "write" | "admin";
13
+ readonly sensitivity: "normal" | "sensitive" | "secret";
14
+ readonly serviceCredential: "allow" | "deny";
15
+ readonly requiresResourceBoundary?: boolean;
16
+ readonly serviceOverrideAllowed?: false;
17
+ };
18
+ }
6
19
  /**
7
20
  * Which credential the broker spends for one binding. Declared here rather than
8
21
  * next to the service-credential machinery because it is part of the stored
@@ -17,6 +30,8 @@ export type CredentialSource = "personal" | "service";
17
30
  export type CapabilityServiceState =
18
31
  /** Every operation of this capability is service-safe. */
19
32
  "available"
33
+ /** Some reads are allowed, while other operations remain blocked. */
34
+ | "partial"
20
35
  /** At least one operation returns sensitive data: needs a personal account. */
21
36
  | "sensitive"
22
37
  /** At least one operation is a write, an admin action or explicitly denied. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yadsh/dsh-qa-integrations",
3
- "version": "0.10.4",
3
+ "version": "0.11.0",
4
4
  "description": "Principal-scoped, encrypted user integrations for DSH QA Surface",
5
5
  "repository": {
6
6
  "type": "git",
@@ -89,30 +89,30 @@
89
89
  },
90
90
  "dependencies": {
91
91
  "zod": "^4.4.3",
92
- "@yadsh/dsh-plugin-kit": "^0.5.1",
93
- "@yadsh/dsh-plugin-log": "^0.4.2",
94
- "@yadsh/dsh-qa-surface": "^0.16.0"
92
+ "@yadsh/dsh-plugin-kit": "^0.6.0",
93
+ "@yadsh/dsh-qa-surface": "^0.18.0",
94
+ "@yadsh/dsh-plugin-log": "^0.4.2"
95
95
  },
96
96
  "peerDependencies": {
97
97
  "@deepseek-ai/cordis": "^4.0.4",
98
- "@deepseek-ai/dsh-client-ui-plugin-manager": ">=0.1.7-rc.2 <0.2.0",
99
- "@deepseek-ai/dsh-client-ui-settings": ">=0.1.7-rc.2 <0.2.0",
100
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.2 <0.2.0",
101
- "@deepseek-ai/dsh-typert-protocol": ">=0.1.7-rc.2 <0.2.0",
98
+ "@deepseek-ai/dsh-client-ui-plugin-manager": ">=0.1.7-rc.2 <0.3.0-0",
99
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.1.7-rc.2 <0.3.0-0",
100
+ "@deepseek-ai/dsh-tools": ">=0.1.7-rc.2 <0.3.0-0",
101
+ "@deepseek-ai/dsh-typert-protocol": ">=0.1.7-rc.2 <0.3.0-0",
102
102
  "@deepseek-ai/schemastery": "^3.18.4",
103
103
  "react": "^18.2.0"
104
104
  },
105
105
  "devDependencies": {
106
- "@deepseek-ai/cordis": "4.0.4",
107
- "@deepseek-ai/dsh-api-gateway": "0.1.7-rc.2",
108
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.1.7-rc.2",
109
- "@deepseek-ai/dsh-client-ui-renderer": "0.1.7-rc.2",
110
- "@deepseek-ai/dsh-client-ui-settings": "0.1.7-rc.2",
111
- "@deepseek-ai/dsh-client-ui-slots": "0.1.7-rc.2",
112
- "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
113
- "@deepseek-ai/dsh-typert-generator": "0.1.7-rc.2",
114
- "@deepseek-ai/dsh-typert-protocol": "0.1.7-rc.2",
115
- "@deepseek-ai/schemastery": "3.18.4",
106
+ "@deepseek-ai/cordis": "4.0.5",
107
+ "@deepseek-ai/dsh-api-gateway": "0.2.1-rc.3",
108
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-rc.3",
109
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.3",
110
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.3",
111
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.3",
112
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.3",
113
+ "@deepseek-ai/dsh-typert-generator": "0.2.1-rc.3",
114
+ "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.3",
115
+ "@deepseek-ai/schemastery": "3.18.5",
116
116
  "@testing-library/react": "^16.3.0",
117
117
  "@types/node": "^26.4.0",
118
118
  "@types/react": "18.3.28",
@@ -126,8 +126,8 @@
126
126
  "typescript": "^7.0.2",
127
127
  "vitest": "^4.1.11",
128
128
  "@yadsh/dsh-config": "^0.0.0",
129
- "@yadsh/dsh-test-kit": "^0.1.0",
130
- "@yadsh/dsh-plugin-scripts": "^0.0.0"
129
+ "@yadsh/dsh-plugin-scripts": "^0.0.0",
130
+ "@yadsh/dsh-test-kit": "^0.1.0"
131
131
  },
132
132
  "publishConfig": {
133
133
  "access": "public",