@xpert-ai/plugin-sdk 3.35.0 → 3.37.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 (65) hide show
  1. package/agent-results.cjs.js +5 -3
  2. package/agent-results.esm.js +2 -2
  3. package/analytics-result.cjs.js +64 -27
  4. package/analytics-result.esm.js +62 -28
  5. package/analytics.cjs.js +157 -15
  6. package/analytics.esm.js +154 -17
  7. package/artifact-document.cjs.js +9 -3
  8. package/artifact-document.esm.js +9 -3
  9. package/collaboration-client.cjs.js +274 -140
  10. package/collaboration-client.esm.js +273 -141
  11. package/docs/README.md +23 -0
  12. package/index.cjs.js +227 -10
  13. package/index.esm.js +198 -13
  14. package/package.json +8 -2
  15. package/remote-component.cjs.default.js +1 -0
  16. package/remote-component.cjs.js +143 -0
  17. package/remote-component.cjs.mjs +2 -0
  18. package/remote-component.d.ts +1 -0
  19. package/remote-component.esm.js +139 -0
  20. package/results.cjs.js +2 -14
  21. package/results.esm.js +2 -12
  22. package/src/analytics.d.ts +2 -0
  23. package/src/collaboration-client.d.ts +1 -0
  24. package/src/index.d.ts +1 -0
  25. package/src/lib/agent/handoff/agent-runtime-message.contract.d.ts +24 -24
  26. package/src/lib/agent/middleware/strategy.interface.d.ts +4 -0
  27. package/src/lib/agent/runtime/capability.d.ts +2 -0
  28. package/src/lib/agent/runtime/cli-model-profile.d.ts +14 -1
  29. package/src/lib/agent/runtime/dispatch.d.ts +79 -79
  30. package/src/lib/agent/runtime/execution-runner.d.ts +19 -10
  31. package/src/lib/agent/runtime/pipeline-scope.d.ts +4 -4
  32. package/src/lib/agent/runtime/results.d.ts +14 -234
  33. package/src/lib/agent/runtime/types.d.ts +19 -0
  34. package/src/lib/agent-event/index.d.ts +89 -0
  35. package/src/lib/agent-event/journal.d.ts +30 -0
  36. package/src/lib/artifact-document/dependencies.d.ts +3 -3
  37. package/src/lib/artifact-document/protocol.d.ts +2 -2
  38. package/src/lib/artifact-document/scheduler.d.ts +3 -0
  39. package/src/lib/artifact-type/definition.schema.d.ts +11 -39
  40. package/src/lib/assistant-capability/middleware.d.ts +2 -1
  41. package/src/lib/channel/strategy.interface.d.ts +20 -0
  42. package/src/lib/collaboration/client.d.ts +6 -59
  43. package/src/lib/collaboration/index.d.ts +1 -0
  44. package/src/lib/collaboration/operations-client.d.ts +23 -0
  45. package/src/lib/collaboration/presence.d.ts +36 -0
  46. package/src/lib/collaboration/provider.registry.d.ts +2 -2
  47. package/src/lib/collaboration/transport.d.ts +24 -0
  48. package/src/lib/collaboration/types.d.ts +57 -5
  49. package/src/lib/content-resource/catalog.d.ts +40 -2
  50. package/src/lib/content-resource/editor.d.ts +36 -1
  51. package/src/lib/data/analytics/analysis-evidence.d.ts +757 -0
  52. package/src/lib/data/analytics/analytics-certification.d.ts +64 -0
  53. package/src/lib/data/analytics/analytics-provider.d.ts +9 -0
  54. package/src/lib/data/analytics/analytics-value.d.ts +5 -0
  55. package/src/lib/data/analytics/index.d.ts +1 -0
  56. package/src/lib/evolution/runtime-capability.d.ts +1 -0
  57. package/src/lib/project-pipeline/adapters.d.ts +9 -2
  58. package/src/lib/project-pipeline/registry.d.ts +59 -48
  59. package/src/lib/project-task/acceptance.d.ts +13 -1
  60. package/src/lib/project-task/index.d.ts +4 -2
  61. package/src/lib/runtime/capabilities/project-configuration.d.ts +2 -0
  62. package/src/lib/view-extension/index.d.ts +1 -0
  63. package/src/lib/view-extension/provider.interface.d.ts +51 -0
  64. package/src/lib/view-extension/workbench-decision.d.ts +10 -0
  65. package/src/remote-component.d.ts +13 -0
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod/v3';
2
+ import type { AnalyticsCertification } from '@xpert-ai/contracts';
3
+ /** Parse only provider results. A valid shape alone never grants certification authority.
4
+ * Legacy records remain explicitly unverified; approval fields require a verified source proof. */
5
+ export declare const analyticsCertificationSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
6
+ status: z.ZodLiteral<"legacy_unverified">;
7
+ kind: z.ZodLiteral<"business_metric">;
8
+ subjectId: z.ZodString;
9
+ verifiedAt: z.ZodString;
10
+ }, "strict", z.ZodTypeAny, {
11
+ status?: "legacy_unverified";
12
+ kind?: "business_metric";
13
+ subjectId?: string;
14
+ verifiedAt?: string;
15
+ }, {
16
+ status?: "legacy_unverified";
17
+ kind?: "business_metric";
18
+ subjectId?: string;
19
+ verifiedAt?: string;
20
+ }>, z.ZodObject<{
21
+ status: z.ZodLiteral<"verified">;
22
+ definitionHash: z.ZodString;
23
+ dependency: z.ZodObject<{
24
+ id: z.ZodString;
25
+ version: z.ZodNumber;
26
+ }, "strict", z.ZodTypeAny, {
27
+ id?: string;
28
+ version?: number;
29
+ }, {
30
+ id?: string;
31
+ version?: number;
32
+ }>;
33
+ certifiedBy: z.ZodString;
34
+ certifiedAt: z.ZodString;
35
+ kind: z.ZodLiteral<"business_metric">;
36
+ subjectId: z.ZodString;
37
+ verifiedAt: z.ZodString;
38
+ }, "strict", z.ZodTypeAny, {
39
+ status?: "verified";
40
+ kind?: "business_metric";
41
+ subjectId?: string;
42
+ verifiedAt?: string;
43
+ definitionHash?: string;
44
+ dependency?: {
45
+ id?: string;
46
+ version?: number;
47
+ };
48
+ certifiedBy?: string;
49
+ certifiedAt?: string;
50
+ }, {
51
+ status?: "verified";
52
+ kind?: "business_metric";
53
+ subjectId?: string;
54
+ verifiedAt?: string;
55
+ definitionHash?: string;
56
+ dependency?: {
57
+ id?: string;
58
+ version?: number;
59
+ };
60
+ certifiedBy?: string;
61
+ certifiedAt?: string;
62
+ }>]>;
63
+ /** The package supports hosts compiled without strictNullChecks; parsing still requires every field. */
64
+ export declare function parseAnalyticsCertification(value: unknown): AnalyticsCertification;
@@ -43,6 +43,8 @@ export interface AnalyticsProviderResult {
43
43
  upstreamExecutionId?: string;
44
44
  /** Reference to audit evidence, not embedded logs or credentials. */
45
45
  auditRef?: string;
46
+ /** Only source-verified business approvals; never copy from Binding payload or display metadata. */
47
+ certification?: AnalyticalDataset['provenance']['certification'];
46
48
  }
47
49
  /**
48
50
  * Plugin extension point for SQL, ontology, file or other query formats.
@@ -53,6 +55,13 @@ export interface AnalyticsQueryProvider {
53
55
  readonly descriptor: AnalyticsProviderDescriptor;
54
56
  readonly configuration?: AnalyticsConfigurationEntry;
55
57
  readonly authoring?: AnalyticsDefinitionAuthoring;
58
+ /** Independently authorize this exact query, including upstream privileges, and return its current
59
+ * sourceVersion. Called before and after EVERY reuse (including coalesced requests). Omission disables
60
+ * caching. The revision must match execute() and cover the exact result, including its certification.
61
+ * Metadata discovery alone is insufficient. Never return a credential or reusable grant. */
62
+ authorizeResultReuse?(binding: AnalyticsBinding, parameters: Record<string, AnalyticsValue>, context: AnalyticsProviderContext): Promise<{
63
+ sourceVersion: string;
64
+ }>;
56
65
  /** Explicit source authority to disclose this binding's results to a group.
57
66
  * Read access alone is insufficient. Unsupported providers must remain view-only. */
58
67
  authorizeGroupSharing?(binding: AnalyticsBinding, context: AnalyticsProviderContext): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import type { AnalyticsField, AnalyticsValue } from '@xpert-ai/contracts';
2
+ /** Shared wire-value rules for normalized query results and immutable evidence snapshots. */
3
+ export declare function isAnalyticsDate(value: string): boolean;
4
+ /** int64/decimal stay strings on the wire to avoid JavaScript number rounding; never coerce them. */
5
+ export declare function isAnalyticsCell(type: AnalyticsField['logicalType'], cell: AnalyticsValue, nullable: boolean): boolean;
@@ -6,3 +6,4 @@ export * from './analytics-result';
6
6
  export * from './analytics-payload';
7
7
  export * from './analytics-source.commands';
8
8
  export * from './analytics-authoring';
9
+ export * from './analytics-certification';
@@ -1,5 +1,6 @@
1
1
  import type { EvolutionRuntimeApi, EvolutionChangeRuntimeApi, EvolutionBaselineRuntimeApi } from '@xpert-ai/contracts';
2
2
  export declare const EVOLUTION_RUNTIME_SERVICE_TOKEN = "XPERT_EVOLUTION_RUNTIME_SERVICE";
3
+ export declare const ExecutionReviewRuntimeCapability: import("../core").RuntimeCapabilityKey<import("@xpert-ai/contracts").ExecutionReviewApi>;
3
4
  /** Capability for inspecting and publishing source baselines within an authorized organization. */
4
5
  export declare const EvolutionBaselineRuntimeCapability: import("../core").RuntimeCapabilityKey<EvolutionBaselineRuntimeApi>;
5
6
  /** Capability for version selection and evidence tied to Agent executions. */
@@ -1,13 +1,20 @@
1
- import type { ProjectPipelineEvidenceRef, ProjectPipelineJsonValue, ProjectPipelineSubjectVersion, ProjectPipelineWorkContext, ProjectPipelineOperationInput, ProjectPipelineOperationReceipt, ProjectPipelineCompletionReceipt, ProjectPipelinePolicyReceipt, ProjectPipelineAssistantInput, ProjectPipelineResourceClaim, ProjectPipelineResourceReservation, ProjectPipelineRuntimeInput, XpertProjectViewSelection } from '@xpert-ai/contracts';
1
+ import type { ProjectPipelineEvidenceRef, ProjectPipelineNodeWorkbench, ProjectPipelineJsonValue, ProjectPipelineSubjectVersion, ProjectPipelineWorkContext, ProjectPipelineOperationInput, ProjectPipelineOperationReceipt, ProjectPipelineCompletionReceipt, ProjectPipelinePolicyReceipt, ProjectPipelineAssistantInput, ProjectPipelineResourceClaim, ProjectPipelineResourceReservation, ProjectPipelineRuntimeInput, XpertProjectViewSelection } from '@xpert-ai/contracts';
2
2
  import type { ProjectPipelineContext } from './capability';
3
3
  import type { AgentInvocationResult } from '../agent/runtime/types';
4
4
  export type { ProjectPipelineOperationReceipt } from '@xpert-ai/contracts';
5
5
  /** Runtime adapters are registered separately from catalog declarations and resolved in the actor scope. */
6
6
  export interface ProjectPipelineSubjectResolver {
7
+ /** Definition versions whose individual nodes have subject-scoped workbench entries. */
8
+ readonly nodeWorkbenches?: ReadonlyArray<ProjectPipelineNodeWorkbench & {
9
+ definitionKey: string;
10
+ version: string;
11
+ }>;
7
12
  resolve(context: ProjectPipelineContext, objectKey: string): Promise<ProjectPipelineSubjectVersion>;
8
13
  checkCurrent(context: ProjectPipelineContext, version: ProjectPipelineSubjectVersion): Promise<boolean>;
9
14
  /** Read-only business entry for a saved subject. Reauthorize its Project and actor; never return a URL. */
10
- resolveEntry?(context: ProjectPipelineContext, objectKey: string): Promise<XpertProjectViewSelection & {
15
+ resolveEntry?(context: ProjectPipelineContext, objectKey: string, hostXpertId?: string, nodeTarget?: {
16
+ executorXpertId?: string;
17
+ }): Promise<XpertProjectViewSelection & {
11
18
  xpertId: string;
12
19
  }>;
13
20
  }
@@ -27,6 +27,7 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
27
27
  register(key: string, contribution: ProjectPipelineContribution, source: StrategySource): {
28
28
  key: string;
29
29
  configurations: {
30
+ schemaVersion: 1;
30
31
  binding: {
31
32
  templateRef: string;
32
33
  roleBindings: Record<string, {
@@ -36,8 +37,8 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
36
37
  }>;
37
38
  parameters: Record<string, import("packages/contracts/dist/src/ai/project-pipeline/primitives.schema").ProjectPipelineJsonValue>;
38
39
  executorBindings?: Record<string, {
39
- roleKey: string;
40
40
  kind: "assistant" | "runtime_binding" | "human" | "service";
41
+ roleKey: string;
41
42
  selectionKey: string;
42
43
  requiredCapabilities?: string[] | undefined;
43
44
  workspaceId?: string | undefined;
@@ -58,17 +59,22 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
58
59
  events: string[];
59
60
  }[] | undefined;
60
61
  };
61
- schemaVersion: 1;
62
62
  template: {
63
63
  key: string;
64
+ title: string;
65
+ version: string;
66
+ lanes: {
67
+ key: string;
68
+ label: string;
69
+ order: number;
70
+ roleKey: string;
71
+ }[];
64
72
  executionAuthority: "provider";
65
73
  providerRef: string;
66
74
  topology: {
67
75
  source: "provider";
68
76
  presentationAdapterRef: string;
69
77
  };
70
- version: string;
71
- title: string;
72
78
  projectTypes: {
73
79
  applicationKey: string;
74
80
  projectTypeKey: string;
@@ -78,40 +84,40 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
78
84
  key: string;
79
85
  allowedKinds: ("assistant" | "runtime_binding" | "human" | "service")[];
80
86
  }[];
81
- lanes: {
82
- key: string;
83
- roleKey: string;
84
- label: string;
85
- order: number;
86
- }[];
87
87
  stages: {
88
88
  key: string;
89
89
  label: string;
90
90
  order: number;
91
91
  icon?: "code" | "layers" | "file-text" | "folder-open" | "list-checks" | "search" | "scan-search" | "boxes" | "package" | "settings" | "clipboard-check" | "shield-check" | "git-pull-request" | "test-tube" | "git-merge" | "calculator" | "file-check" | "truck" | undefined;
92
92
  }[];
93
- actionRefs?: string[] | undefined;
94
- hostRequirements?: {
95
- protocol: number;
96
- features: Record<string, number>;
97
- } | undefined;
98
93
  presentation?: {
99
94
  views: ("tasks" | "pipeline" | "agent_timeline")[];
100
95
  nodeDetailRef?: string | undefined;
101
96
  evidenceTypes?: string[] | undefined;
102
97
  } | undefined;
98
+ actionRefs?: string[] | undefined;
99
+ hostRequirements?: {
100
+ protocol: number;
101
+ features: Record<string, number>;
102
+ } | undefined;
103
103
  metrics?: {
104
104
  dimensionRefs: string[];
105
105
  metricRefs: string[];
106
106
  } | undefined;
107
107
  } | {
108
108
  key: string;
109
+ title: string;
110
+ version: string;
111
+ lanes: {
112
+ key: string;
113
+ label: string;
114
+ order: number;
115
+ roleKey: string;
116
+ }[];
109
117
  executionAuthority: "platform";
110
118
  topology: {
111
119
  source: "definition";
112
120
  };
113
- version: string;
114
- title: string;
115
121
  projectTypes: {
116
122
  applicationKey: string;
117
123
  projectTypeKey: string;
@@ -121,12 +127,6 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
121
127
  key: string;
122
128
  allowedKinds: ("assistant" | "runtime_binding" | "human" | "service")[];
123
129
  }[];
124
- lanes: {
125
- key: string;
126
- roleKey: string;
127
- label: string;
128
- order: number;
129
- }[];
130
130
  stages: {
131
131
  key: string;
132
132
  label: string;
@@ -134,14 +134,17 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
134
134
  icon?: "code" | "layers" | "file-text" | "folder-open" | "list-checks" | "search" | "scan-search" | "boxes" | "package" | "settings" | "clipboard-check" | "shield-check" | "git-pull-request" | "test-tube" | "git-merge" | "calculator" | "file-check" | "truck" | undefined;
135
135
  }[];
136
136
  nodes: ({
137
- key: string;
138
137
  kind: "work";
138
+ key: string;
139
139
  laneKey: string;
140
140
  operationRef: string;
141
141
  executorSlot: string;
142
142
  completionRef: string;
143
143
  stageKey: string;
144
144
  label?: string | undefined;
145
+ presentation?: {
146
+ foldIntoApproval: string;
147
+ } | undefined;
145
148
  resourceResolverRef?: string | undefined;
146
149
  outputSchemaRef?: string | undefined;
147
150
  inputBindings?: Record<string, {
@@ -154,17 +157,17 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
154
157
  key: string;
155
158
  from: "parameter";
156
159
  } | {
157
- from: "collection";
158
160
  items: {
159
161
  from: "node_output";
160
162
  nodeKey: string;
161
163
  port: string;
162
164
  }[];
165
+ from: "collection";
163
166
  }> | undefined;
164
167
  outputPorts?: Record<string, string> | undefined;
165
168
  } | {
166
- key: string;
167
169
  kind: "fork";
170
+ key: string;
168
171
  stageKey: string;
169
172
  label?: string | undefined;
170
173
  inputBindings?: Record<string, {
@@ -177,21 +180,21 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
177
180
  key: string;
178
181
  from: "parameter";
179
182
  } | {
180
- from: "collection";
181
183
  items: {
182
184
  from: "node_output";
183
185
  nodeKey: string;
184
186
  port: string;
185
187
  }[];
188
+ from: "collection";
186
189
  }> | undefined;
187
190
  outputPorts?: Record<string, string> | undefined;
188
191
  } | {
192
+ kind: "join";
193
+ key: string;
189
194
  join: {
190
195
  mode: "all_selected";
191
196
  accept: "completed";
192
197
  };
193
- key: string;
194
- kind: "join";
195
198
  stageKey: string;
196
199
  label?: string | undefined;
197
200
  inputBindings?: Record<string, {
@@ -204,17 +207,17 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
204
207
  key: string;
205
208
  from: "parameter";
206
209
  } | {
207
- from: "collection";
208
210
  items: {
209
211
  from: "node_output";
210
212
  nodeKey: string;
211
213
  port: string;
212
214
  }[];
215
+ from: "collection";
213
216
  }> | undefined;
214
217
  outputPorts?: Record<string, string> | undefined;
215
218
  } | {
216
- key: string;
217
219
  kind: "router";
220
+ key: string;
218
221
  stageKey: string;
219
222
  policyRef: string;
220
223
  outcomes: string[];
@@ -230,17 +233,17 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
230
233
  key: string;
231
234
  from: "parameter";
232
235
  } | {
233
- from: "collection";
234
236
  items: {
235
237
  from: "node_output";
236
238
  nodeKey: string;
237
239
  port: string;
238
240
  }[];
241
+ from: "collection";
239
242
  }> | undefined;
240
243
  outputPorts?: Record<string, string> | undefined;
241
244
  } | {
242
- key: string;
243
245
  kind: "human_gate";
246
+ key: string;
244
247
  laneKey: string;
245
248
  stageKey: string;
246
249
  policyRef: string;
@@ -257,18 +260,18 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
257
260
  key: string;
258
261
  from: "parameter";
259
262
  } | {
260
- from: "collection";
261
263
  items: {
262
264
  from: "node_output";
263
265
  nodeKey: string;
264
266
  port: string;
265
267
  }[];
268
+ from: "collection";
266
269
  }> | undefined;
267
270
  outputPorts?: Record<string, string> | undefined;
268
271
  outcomeLabels?: Record<string, string> | undefined;
269
272
  } | {
270
- key: string;
271
273
  kind: "external_wait";
274
+ key: string;
272
275
  laneKey: string;
273
276
  stageKey: string;
274
277
  subscriptionRef: string;
@@ -283,18 +286,18 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
283
286
  key: string;
284
287
  from: "parameter";
285
288
  } | {
286
- from: "collection";
287
289
  items: {
288
290
  from: "node_output";
289
291
  nodeKey: string;
290
292
  port: string;
291
293
  }[];
294
+ from: "collection";
292
295
  }> | undefined;
293
296
  outputPorts?: Record<string, string> | undefined;
294
297
  } | {
298
+ kind: "terminal";
295
299
  key: string;
296
300
  outcome: string;
297
- kind: "terminal";
298
301
  stageKey: string;
299
302
  label?: string | undefined;
300
303
  inputBindings?: Record<string, {
@@ -307,12 +310,12 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
307
310
  key: string;
308
311
  from: "parameter";
309
312
  } | {
310
- from: "collection";
311
313
  items: {
312
314
  from: "node_output";
313
315
  nodeKey: string;
314
316
  port: string;
315
317
  }[];
318
+ from: "collection";
316
319
  }> | undefined;
317
320
  outputPorts?: Record<string, string> | undefined;
318
321
  disposition?: "complete" | "await_new_subject" | undefined;
@@ -334,20 +337,28 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
334
337
  requiredNodeFailure: "block_and_attention";
335
338
  unknownExecution: "inspect_without_replay";
336
339
  };
337
- hostRequirements?: {
338
- protocol: number;
339
- features: Record<string, number>;
340
- } | undefined;
341
340
  presentation?: {
342
341
  views: ("tasks" | "pipeline" | "agent_timeline")[];
343
342
  nodeDetailRef?: string | undefined;
344
343
  evidenceTypes?: string[] | undefined;
345
344
  } | undefined;
345
+ hostRequirements?: {
346
+ protocol: number;
347
+ features: Record<string, number>;
348
+ } | undefined;
346
349
  metrics?: {
347
350
  dimensionRefs: string[];
348
351
  metricRefs: string[];
349
352
  } | undefined;
350
353
  };
354
+ nativeModelBudgetPolicy?: {
355
+ maximum: {
356
+ maxCalls: number;
357
+ maxTokens: number;
358
+ reservationTokens: number;
359
+ };
360
+ maxTokensDefaultSource: "configuration" | "host";
361
+ } | undefined;
351
362
  }[];
352
363
  descriptors: ({
353
364
  kind: "schema";
@@ -404,8 +415,8 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
404
415
  forms?: {
405
416
  templateRef: string;
406
417
  parameters: ({
407
- type: "boolean";
408
418
  key: string;
419
+ type: "boolean";
409
420
  label: {
410
421
  en_US: string;
411
422
  zh_Hans?: string | undefined;
@@ -415,8 +426,8 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
415
426
  zh_Hans?: string | undefined;
416
427
  } | undefined;
417
428
  } | {
418
- type: "text";
419
429
  key: string;
430
+ type: "text";
420
431
  label: {
421
432
  en_US: string;
422
433
  zh_Hans?: string | undefined;
@@ -428,9 +439,9 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
428
439
  zh_Hans?: string | undefined;
429
440
  } | undefined;
430
441
  } | {
442
+ key: string;
431
443
  type: "number";
432
444
  integer: boolean;
433
- key: string;
434
445
  label: {
435
446
  en_US: string;
436
447
  zh_Hans?: string | undefined;
@@ -442,6 +453,7 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
442
453
  zh_Hans?: string | undefined;
443
454
  } | undefined;
444
455
  } | {
456
+ key: string;
445
457
  options: {
446
458
  value: string;
447
459
  label: {
@@ -450,7 +462,6 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
450
462
  };
451
463
  }[];
452
464
  type: "choice";
453
- key: string;
454
465
  label: {
455
466
  en_US: string;
456
467
  zh_Hans?: string | undefined;
@@ -460,6 +471,7 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
460
471
  zh_Hans?: string | undefined;
461
472
  } | undefined;
462
473
  } | {
474
+ key: string;
463
475
  options: {
464
476
  value: string;
465
477
  label: {
@@ -468,7 +480,6 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
468
480
  };
469
481
  }[];
470
482
  type: "multi_choice";
471
- key: string;
472
483
  label: {
473
484
  en_US: string;
474
485
  zh_Hans?: string | undefined;
@@ -479,8 +490,8 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
479
490
  zh_Hans?: string | undefined;
480
491
  } | undefined;
481
492
  } | {
482
- type: "string_list";
483
493
  key: string;
494
+ type: "string_list";
484
495
  label: {
485
496
  en_US: string;
486
497
  zh_Hans?: string | undefined;
@@ -1,3 +1,15 @@
1
+ /** Read-only current implementation output; not a review or acceptance receipt. */
2
+ export interface ProjectTaskCandidateReceipt {
3
+ projectId: string;
4
+ taskId: string;
5
+ taskRevision: number;
6
+ conversationId: string;
7
+ executionId: string;
8
+ artifacts: Array<{
9
+ artifactId: string;
10
+ versionId: string;
11
+ }>;
12
+ }
1
13
  /** Current formal acceptance facts; consumers decide which review mode their workflow requires. */
2
14
  export interface ProjectTaskAcceptanceReceipt {
3
15
  projectId: string;
@@ -8,7 +20,7 @@ export interface ProjectTaskAcceptanceReceipt {
8
20
  review: {
9
21
  executionId: string;
10
22
  mode: 'evidence_only' | 'execution';
11
- verdict: 'pass' | 'changes_required' | 'indeterminate';
23
+ reportDigest: string;
12
24
  } | null;
13
25
  artifacts: Array<{
14
26
  artifactId: string;
@@ -2,8 +2,8 @@ import { DiscoveryService, Reflector } from '@nestjs/core';
2
2
  import type { ProjectTaskGraph, ProjectTaskGraphChange, ProjectTaskExecutionTarget, ProjectTaskTypeDefinition, TXpertProjectTaskStatus } from '@xpert-ai/contracts';
3
3
  import { BaseStrategyRegistry } from '../strategy';
4
4
  import type { ProjectAccessActor } from '../runtime/capabilities/project-access';
5
- import type { ProjectTaskAcceptanceReceipt } from './acceptance';
6
- export type { ProjectTaskAcceptanceReceipt } from './acceptance';
5
+ import type { ProjectTaskAcceptanceReceipt, ProjectTaskCandidateReceipt } from './acceptance';
6
+ export type { ProjectTaskAcceptanceReceipt, ProjectTaskCandidateReceipt } from './acceptance';
7
7
  export interface ProjectTaskContext {
8
8
  actor: ProjectAccessActor;
9
9
  projectId: string;
@@ -62,6 +62,8 @@ export declare class ProjectTaskProviderRegistry extends BaseStrategyRegistry<IP
62
62
  }
63
63
  /** ORM-independent project task management; actor values come from trusted server context. */
64
64
  export interface ProjectTasksApi {
65
+ /** Read completed implementation output before review, without reconciling or accepting work. */
66
+ readCandidate?(context: ProjectTaskContext, taskId: string): Promise<ProjectTaskCandidateReceipt>;
65
67
  /** Read current formal acceptance without dispatching or reconciling work; null means no current acceptance. */
66
68
  readAcceptance(context: ProjectTaskContext, taskId: string): Promise<ProjectTaskAcceptanceReceipt | null>;
67
69
  /** Read the saved graph and current execution facts. Never invokes provider snapshot/linked callbacks. */
@@ -68,6 +68,8 @@ export interface ProjectConfigurationConnectorAuthorization {
68
68
  * Each call revalidates identity and domain permissions; this API does not grant machine principals
69
69
  * human management or consent authority. Browser OAuth launch still needs an authenticated HTTP origin. */
70
70
  export interface ProjectConfigurationApi {
71
+ /** Non-secret effective settings for authorized execution, including a Project Assistant. No management authority. */
72
+ getRuntimeConfiguration(scope: ProjectConfigurationScope): Promise<Pick<XpertProjectConfigurationView, 'projectType' | 'revision' | 'effectiveValues'>>;
71
73
  getOverview(scope: ProjectConfigurationScope): Promise<ProjectConfigurationOverview>;
72
74
  get(scope: ProjectConfigurationScope): Promise<XpertProjectConfigurationView>;
73
75
  update(scope: ProjectConfigurationScope, input: ProjectConfigurationUpdate): Promise<XpertProjectConfigurationView>;
@@ -4,4 +4,5 @@ export * from './provider.registry';
4
4
  export * from './remote-component-html';
5
5
  export * from './tokens';
6
6
  export * from './middleware-runtime';
7
+ export * from './workbench-decision';
7
8
  export { ASSISTANT_CHAT_SEND_MESSAGE_COMMAND, ASSISTANT_CONTEXT_SET_COMMAND } from '@xpert-ai/contracts';
@@ -12,13 +12,64 @@ export interface XpertViewFileResource {
12
12
  mimeType: string;
13
13
  size?: number;
14
14
  }
15
+ /**
16
+ * Server-side adapter that exposes plugin-owned views in host-defined slots.
17
+ * Register an injectable implementation with `@ViewExtensionProvider(providerKey)`.
18
+ *
19
+ * The host supplies caller context and enforces host/manifest access; providers validate
20
+ * business inputs and delegate resource authorization and business rules to domain services.
21
+ * Method `viewKey` arguments are provider-local manifest keys; the host handles public namespacing.
22
+ * Implement optional hooks for the capabilities the manifests expose. Prefer declared actions
23
+ * and domain services for new business features; keep this contract focused on host/view integration.
24
+ */
15
25
  export interface IXpertViewExtensionProvider {
26
+ /**
27
+ * Authorize each local draft operation through the resource's existing domain access checks.
28
+ * Use the trusted view context; throw on denial and return the canonical resource ID on success.
29
+ * Required to support workbench.content.draft; the host owns draft isolation and storage.
30
+ */
31
+ authorizeLocalDraftResource?(context: XpertResolvedViewHostContext, viewKey: string, resourceId: string): Promise<string> | string;
32
+ /**
33
+ * Decide whether this provider applies to the resolved host, independently of any slot.
34
+ * Keep discovery lightweight and free of side effects; a match does not grant resource access.
35
+ */
16
36
  supports(context: XpertResolvedViewHostContext): Promise<boolean> | boolean;
37
+ /**
38
+ * Describe the views available in a slot, including rendering, data, actions and optional capabilities.
39
+ * Use stable provider-local keys and return an empty list for unsupported slots.
40
+ * Keep discovery free of business mutations; the host applies activation and visibility policies.
41
+ */
17
42
  getViewManifests(context: XpertResolvedViewHostContext, slot: string): Promise<XpertExtensionViewManifest[]> | XpertExtensionViewManifest[];
43
+ /**
44
+ * Read the view's data for its declared query contract, within the caller's authorized resource scope.
45
+ * Keep this path free of business mutations; the host may cache results according to the manifest.
46
+ */
18
47
  getViewData(context: XpertResolvedViewHostContext, viewKey: string, query: XpertViewQuery): Promise<XpertViewDataResult> | XpertViewDataResult;
48
+ /**
49
+ * Handle a declared JSON action, such as saving, exporting or invoking a domain workflow.
50
+ * Validate action-specific input and delegate authorization and execution to domain services.
51
+ * Use the result's refresh hint when the operation invalidates the view's data.
52
+ */
19
53
  executeViewAction?(context: XpertResolvedViewHostContext, viewKey: string, actionKey: string, request: XpertViewActionRequest): Promise<XpertViewActionResult> | XpertViewActionResult;
54
+ /**
55
+ * Handle a declared file-transport action, such as importing an uploaded document.
56
+ * Apply the same domain rules as JSON actions and validate the file for its intended use.
57
+ */
20
58
  executeViewFileAction?(context: XpertResolvedViewHostContext, viewKey: string, actionKey: string, request: XpertViewActionRequest, file: XpertViewFileActionFile): Promise<XpertViewActionResult> | XpertViewActionResult;
59
+ /**
60
+ * Authorize a view-owned file for a purpose declared in the manifest's fileAccess policy.
61
+ * Return its portable workspace reference and presentation metadata for host-managed delivery.
62
+ */
21
63
  resolveViewFile?(context: XpertResolvedViewHostContext, viewKey: string, request: XpertViewFileAccessRequest): Promise<XpertViewFileResource> | XpertViewFileResource;
64
+ /**
65
+ * Supply dynamic choices for a declared view parameter, honoring search and dependent parameters.
66
+ * Restrict choices to resources visible to the caller; keep option lookup free of business mutations.
67
+ */
22
68
  getViewParameterOptions?(context: XpertResolvedViewHostContext, viewKey: string, parameterKey: string, query: XpertViewParameterOptionsQuery): Promise<XpertViewParameterOptionsResult> | XpertViewParameterOptionsResult;
69
+ /**
70
+ * Supply the HTML entry for a remote-component view using the component declared in its manifest.
71
+ * Serve plugin-controlled UI assets; use the host bridge for runtime data and actions.
72
+ * The host owns the iframe integration, while resource access remains enforced by the data/action hooks.
73
+ */
23
74
  getRemoteComponentEntry?(context: XpertResolvedViewHostContext, viewKey: string, component: XpertRemoteComponentViewSchema['component']): Promise<XpertRemoteComponentEntry> | XpertRemoteComponentEntry;
24
75
  }
@@ -0,0 +1,10 @@
1
+ import type { HumanDecisionInput, HumanDecisionResult } from '@xpert-ai/contracts';
2
+ /**
3
+ * Lets a plugin's server-side View provider submit a human decision during an authorized
4
+ * assistant or project workbench action. The host takes the actor and plugin identity from
5
+ * the current action and routes the submission to their active source binding.
6
+ * The event source checks who can decide the business matter and records the choice.
7
+ */
8
+ export declare const WorkbenchDecisionCapability: import("../core/runtime-capability").RuntimeCapabilityKey<{
9
+ submit(adapter: string, sourceBindingRef: string, input: HumanDecisionInput): Promise<HumanDecisionResult>;
10
+ }>;
@@ -0,0 +1,13 @@
1
+ export interface RemoteComponentInit {
2
+ locale: string;
3
+ theme?: {
4
+ mode?: string;
5
+ density?: 'default' | 'compact';
6
+ tokens?: Record<string, string | number>;
7
+ };
8
+ }
9
+ /** Subscribe before rendering. The returned cleanup releases the listener and all outstanding requests. */
10
+ export declare function connect(init: (context: RemoteComponentInit, changed: boolean) => void, contextChanged: () => void): () => void;
11
+ export declare function request(type: string, body?: object): Promise<unknown>;
12
+ /** Bind a request before asynchronous preparation, so a context switch cannot redirect it. */
13
+ export declare function scopedRequest(): typeof request;