@xpert-ai/contracts 3.33.0 → 3.34.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 (51) hide show
  1. package/index.cjs.js +79 -61
  2. package/index.esm.js +75 -62
  3. package/package.json +2 -2
  4. package/src/ai/ai.model.d.ts +1 -1
  5. package/src/ai/chat-group-entity.model.d.ts +1 -1
  6. package/src/ai/chat-group.model.d.ts +116 -3
  7. package/src/ai/evolution/baseline.d.ts +12 -0
  8. package/src/ai/evolution/candidate.d.ts +20 -0
  9. package/src/ai/evolution/capability-version.d.ts +12 -0
  10. package/src/ai/evolution/change.d.ts +40 -2
  11. package/src/ai/evolution/evaluation.d.ts +26 -0
  12. package/src/ai/evolution/example.d.ts +5 -0
  13. package/src/ai/evolution/experience.d.ts +3 -0
  14. package/src/ai/evolution/governance.d.ts +29 -3
  15. package/src/ai/evolution/index.d.ts +1 -0
  16. package/src/ai/evolution/learning-event.d.ts +13 -0
  17. package/src/ai/evolution/learning-review.d.ts +61 -0
  18. package/src/ai/evolution/persistence.d.ts +7 -2
  19. package/src/ai/evolution/provider.d.ts +38 -0
  20. package/src/ai/evolution/release.d.ts +24 -6
  21. package/src/ai/evolution/runtime.d.ts +19 -0
  22. package/src/ai/evolution/strategy.d.ts +10 -0
  23. package/src/ai/evolution/target.d.ts +34 -6
  24. package/src/ai/execution-control-evidence.schema.d.ts +42 -0
  25. package/src/ai/index.d.ts +2 -0
  26. package/src/ai/project-pipeline/analytics.d.ts +5 -33
  27. package/src/ai/project-pipeline/model-usage-statistics.d.ts +4 -24
  28. package/src/ai/project-pipeline/operation.schema.d.ts +330 -0
  29. package/src/ai/project-pipeline/portfolio.schema.d.ts +14 -86
  30. package/src/ai/project-pipeline/statistics.d.ts +5 -33
  31. package/src/ai/xpert-agent-execution.model.d.ts +16 -2
  32. package/src/ai/xpert.model.d.ts +2 -0
  33. package/src/app-platform.d.ts +36 -36
  34. package/src/artifact-group-reference.model.d.ts +71 -0
  35. package/src/artifact-use-grant-command.d.ts +54 -0
  36. package/src/artifact-use-grant.model.d.ts +62 -0
  37. package/src/content-resource.model.d.ts +3 -0
  38. package/src/conversation-resource.model.d.ts +63 -0
  39. package/src/desktop-shell.model.d.ts +13 -1
  40. package/src/icon-definition.schema.d.ts +24 -0
  41. package/src/index.d.ts +6 -0
  42. package/src/plugin-management.d.ts +28 -0
  43. package/src/plugin.d.ts +7 -0
  44. package/src/resource-analysis.model.d.ts +140 -0
  45. package/src/runtime-control.d.ts +6 -0
  46. package/src/types.d.ts +1 -2
  47. package/src/user.model.d.ts +11 -0
  48. package/src/view-extension/client-commands.d.ts +176 -0
  49. package/src/view-extension/index.d.ts +1 -0
  50. package/src/view-extension/model.d.ts +2 -158
  51. package/src/view-extension/workbench-open.d.ts +17 -2
@@ -0,0 +1,140 @@
1
+ import type { AnalyticalDataset, AnalyticsField, AnalyticsParameter, AnalyticsValue } from './analytics-query.model';
2
+ /**
3
+ * Explicit consent to disclose bounded query results to every member of the receiving group.
4
+ * The source manager proposes this scope and the group owner independently accepts it.
5
+ * Each query still uses the requesting human's upstream data permissions, never the source author's credentials.
6
+ * Omit the policy entirely for view-only access; an empty dataset list is not a wildcard grant.
7
+ */
8
+ export interface ResourceAnalysisPolicy {
9
+ /**
10
+ * bindings permits declared parameter values and field projection over published binding results.
11
+ * explore additionally permits query filters, grouping, aggregation and sorting within the same approved datasets.
12
+ * Neither mode permits arbitrary SQL, new tables/models, source browsing or writes.
13
+ */
14
+ mode: 'bindings' | 'explore';
15
+ /** Nonempty allowlist of datasets in the pinned published resource; keys must be unique. */
16
+ datasets: Array<{
17
+ /** Published AnalyticsBinding.id, matching the provider's dataset key; not a label or output datasetId. */
18
+ key: string;
19
+ /** Nonempty, unique AnalyticsField.id allowlist used by projection, filters and aggregation. */
20
+ fields: string[];
21
+ /** Immutable AND predicates on allowed fields, applied before aggregation and disclosure to the Agent. */
22
+ filters: ResourceAnalysisFilter[];
23
+ }>;
24
+ /**
25
+ * Allows returning dataset rows without further aggregation. These may already be aggregated by the binding.
26
+ * false requires an aggregate query; bindings mode therefore requires true.
27
+ */
28
+ allowDetails: boolean;
29
+ /** Maximum output rows per query (1–100), after filtering/aggregation; not a source-scan or per-turn budget. */
30
+ maxRows: number;
31
+ }
32
+ /**
33
+ * One typed predicate on a declared dataset field. Predicate arrays combine with AND; in matches any listed value.
34
+ * Uses AnalyticsValue wire types: int64/decimal values are exact strings, not floating-point numbers.
35
+ * Null participates in eq/ne/in comparisons; ordered comparisons with null do not match.
36
+ */
37
+ export interface ResourceAnalysisFilter {
38
+ /** AnalyticsField.id within the approved field allowlist, never a SQL expression. */
39
+ field: string;
40
+ /** Closed comparison vocabulary; additions require matching schema and execution support. */
41
+ operator: 'eq' | 'ne' | 'in' | 'gt' | 'gte' | 'lt' | 'lte';
42
+ /** Exactly one scalar except for in, which accepts a nonempty list; values must match the field's logical type. */
43
+ values: AnalyticsValue[];
44
+ }
45
+ /**
46
+ * Normalized request for resource_query, scoped externally by the accepted group reference ID.
47
+ * Read ResourceAnalysisDescription first; keys and fields must come from that authorized description.
48
+ * The shared schema supplies empty collections for omitted wire fields. The server then validates the live policy.
49
+ * Extend schema, authorization checks and execution together when adding a query operation.
50
+ */
51
+ export interface ResourceAnalysisQuery {
52
+ /** Approved published binding key, matching ResourceAnalysisDataset.key. */
53
+ datasetKey: string;
54
+ /** Declared parameter values keyed by AnalyticsParameter.controlId; source identities/payloads cannot be supplied. */
55
+ controls: Record<string, AnalyticsValue>;
56
+ /** Detail projection; [] selects all approved fields. Aggregate output instead consists of groupBy and aggregate keys. */
57
+ select: string[];
58
+ /** Additional AND predicates in explore mode; cannot replace or relax the policy's fixed filters. */
59
+ filters: ResourceAnalysisFilter[];
60
+ /** Approved field IDs for grouping; requires at least one aggregate. [] aggregates the whole filtered dataset. */
61
+ groupBy: string[];
62
+ /** Explore-only aggregates; incomplete/truncated input is rejected rather than reported as an exact aggregate. */
63
+ aggregates: Array<{
64
+ /** Omit for count (row count); sum/min/max require an approved numeric field. */
65
+ field?: string;
66
+ /** New output field ID, unique among aggregate/grouping keys and distinct from existing dataset field IDs. */
67
+ key: string;
68
+ /** Supported aggregate vocabulary; count counts rows, while numeric aggregates ignore null values. */
69
+ operation: 'count' | 'sum' | 'min' | 'max';
70
+ }>;
71
+ /** Explore-only sort, evaluated after projection/aggregation and before the output row limit. */
72
+ orderBy: Array<{
73
+ /** Output field ID: a projected field, grouping field or aggregate key. */
74
+ field: string;
75
+ /** Ordered entries are applied in sequence, allowing deterministic multi-column sorting. */
76
+ direction: 'asc' | 'desc';
77
+ }>;
78
+ /** Omission uses the grant's maxRows; explicit limits must be positive and may not exceed that budget. */
79
+ limit?: number;
80
+ }
81
+ /**
82
+ * Public metadata for one analyzable dataset in a fixed resource version, without rows or native query declarations.
83
+ * Authoring inspection can describe the resource's fields; group inspection exposes only the accepted field scope.
84
+ */
85
+ export interface ResourceAnalysisDataset {
86
+ /** Stable key within this published resource, equal to its AnalyticsBinding.id; do not derive it from title. */
87
+ key: string;
88
+ /** Display text only; it need not be unique and cannot be used for authorization or query routing. */
89
+ title: string;
90
+ /** Typed dataset fields; use their IDs and logical types when constructing queries. */
91
+ fields: AnalyticsField[];
92
+ /** Declared control inputs; group descriptions may omit defaults and allowed-value lists to avoid disclosure. */
93
+ parameters: AnalyticsParameter[];
94
+ /**
95
+ * Authoring-only eligibility hint for the inspecting actor. Missing means unchecked; false may include unavailable support.
96
+ * This is not permission for a recipient to query; issuing and using the grant both revalidate their own authority.
97
+ */
98
+ canShare?: boolean;
99
+ }
100
+ /** resource_describe response for a currently authorized group reference; contains no business rows or credentials. */
101
+ export interface ResourceAnalysisDescription {
102
+ /** Accepted reference ID to use for the subsequent query; not the source Artifact or grant ID. */
103
+ referenceId: string;
104
+ /** Resource title for display/citation only. */
105
+ title: string;
106
+ /** Pinned published version's display sequence, not a mutable latest-version pointer. */
107
+ versionNumber: number;
108
+ /** Effective, explicitly accepted scope; clients must not widen it when constructing requests. */
109
+ policy: ResourceAnalysisPolicy;
110
+ /** Only approved datasets and fields; absence of another dataset must not trigger source-catalog discovery. */
111
+ datasets: ResourceAnalysisDataset[];
112
+ }
113
+ /**
114
+ * Authorized query output and provenance for group-visible answers.
115
+ * Consumers must inspect dataset.completeness and freshness before claiming totals or current source state.
116
+ * Evidence identifies an executed result; it is not a reusable authorization or a complete replayable query.
117
+ */
118
+ export interface ResourceAnalysisResult {
119
+ /** Result after policy projection, fixed/request filters, permitted analysis and the output row limit. */
120
+ dataset: AnalyticalDataset;
121
+ /** Host-produced provenance for citations and traceability, without source credentials or native query payloads. */
122
+ evidence: {
123
+ /** Accepted group reference used for this execution. */
124
+ referenceId: string;
125
+ /** Original source Artifact that supplied the fixed resource definition. */
126
+ artifactId: string;
127
+ /** Published version actually queried; never substitute the resource's current latest version. */
128
+ versionId: string;
129
+ /** Audience authorized to receive this result; not permission to forward it to another group. */
130
+ groupId: string;
131
+ /** Approved published binding key that was queried. */
132
+ datasetKey: string;
133
+ /** Dataset freshness.executedAt as an ISO 8601 timestamp, not the time the chat answer was rendered. */
134
+ queriedAt: string;
135
+ /** Control values supplied in the request; provider defaults may not be expanded into this map. */
136
+ controls: Record<string, AnalyticsValue>;
137
+ /** Combined fixed grant restrictions and request predicates, with AND semantics. */
138
+ filters: ResourceAnalysisFilter[];
139
+ };
140
+ }
@@ -8,6 +8,12 @@ export interface IRuntimeStreamInterruption {
8
8
  /** Process-supervisor execution modes; neither implies Pod/deployment orchestration. */
9
9
  export type RuntimeRestartMode = 'self-signal' | 'rolling-self-signal';
10
10
  export type RuntimeRestartStatus = 'in_progress' | 'completed' | 'failed' | 'awaiting_restart';
11
+ /** Host-attested rejection before a plugin module enters the Nest container. */
12
+ export interface IRuntimePluginFailureIsolation {
13
+ stage: 'provider-preflight';
14
+ version: string;
15
+ runtimeRevision?: string;
16
+ }
11
17
  export interface IRuntimePluginRequirement {
12
18
  scopeKey: string;
13
19
  pluginName: string;
package/src/types.d.ts CHANGED
@@ -6,8 +6,7 @@ import type { I18nObject } from './i18n.model';
6
6
  export type { AssistantAppearance as TAssistantAppearance, AssistantCharacterConfig as TAssistantCharacterConfig } from '@xpert-ai/chatkit-types';
7
7
  export type { I18nObject, I18nText } from './i18n.model';
8
8
  export { resolveI18nText } from './i18n.model';
9
- declare const uuidGenerator: ShortUniqueId;
10
- export declare const uuid: (...args: Parameters<(typeof uuidGenerator)["randomUUID"]>) => string;
9
+ export declare const uuid: (...args: Parameters<ShortUniqueId["randomUUID"]>) => string;
11
10
  /**
12
11
  * @description
13
12
  * An entity ID. Represents a unique identifier as a string.
@@ -74,6 +74,17 @@ export interface IUserLoginInput {
74
74
  email: string;
75
75
  password: string;
76
76
  }
77
+ export interface AccessTokenClaims {
78
+ /** Login tokens issued before purpose marking omit this claim. */
79
+ purpose?: 'access';
80
+ id: string;
81
+ thirdPartyId?: string;
82
+ tenantId?: string;
83
+ employeeId?: string | null;
84
+ username?: string;
85
+ role?: string | null;
86
+ permissions?: string[] | null;
87
+ }
77
88
  export interface IAuthResponse {
78
89
  user: IUser;
79
90
  token: string;
@@ -0,0 +1,176 @@
1
+ import type { I18nObject } from '../types';
2
+ import type { XpertViewScalar } from './model';
3
+ export declare const XPERT_REMOTE_COMPONENT_INVOKE_CLIENT_COMMAND_MESSAGE_TYPE = "invokeClientCommand";
4
+ export declare const ASSISTANT_CHAT_SEND_MESSAGE_COMMAND = "assistant.chat.send_message";
5
+ /** Append text selections to the current draft without sending or replacing it. */
6
+ export declare const ASSISTANT_COMPOSER_APPEND_REFERENCES_COMMAND = "assistant.composer.append_references";
7
+ /** Append editable context to the current composer. Never starts a run or changes thread. */
8
+ export declare const ASSISTANT_COMPOSER_INSERT_COMMAND = "assistant.composer.insert";
9
+ export declare const ASSISTANT_CONTEXT_SET_COMMAND = "assistant.context.set";
10
+ export declare const WORKBENCH_FILE_OPEN_COMMAND = "workbench.file.open";
11
+ export declare const WORKBENCH_NAVIGATION_OPEN_COMMAND = "workbench.navigation.open";
12
+ export declare const WORKBENCH_AGENT_EVOLUTION_TARGET = "agent-evolution.target";
13
+ export declare const WORKBENCH_AGENT_EVOLUTION_CHANGE_TARGET = "agent-evolution.change";
14
+ export declare const WORKBENCH_ASSISTANT_CONVERSATION_TARGET = "assistant.conversation";
15
+ /** Locate a public message in the currently open group; never opens an Assistant's private runtime. */
16
+ export declare const WORKBENCH_GROUP_MESSAGE_TARGET = "group.message";
17
+ /** Inspect an exact execution; embedded clients may open it without changing the active conversation. */
18
+ export declare const WORKBENCH_ASSISTANT_EXECUTION_TARGET = "assistant.execution";
19
+ /** Opens the current Assistant inside a Project-scoped workbench route. */
20
+ export declare const WORKBENCH_ASSISTANT_PROJECT_TARGET = "assistant.project";
21
+ export declare const WORKBENCH_EXTENSION_VIEW_TARGET = "workbench.view";
22
+ export declare const WORKBENCH_KNOWLEDGEBASE_DOCUMENTS_TARGET = "knowledgebase.documents";
23
+ /** Resolve the Project's application entry through its registered type and current access checks. */
24
+ export declare const WORKBENCH_PROJECT_APPLICATION_TARGET = "project.application";
25
+ /** Open full Project pipeline management in the configured platform. */
26
+ export declare const WORKBENCH_PROJECT_PIPELINES_TARGET = "project.pipelines";
27
+ export interface XpertViewClientCommandDefinition {
28
+ /** A host must implement this command before mounting the view. Optional actions may omit this. */
29
+ required?: boolean;
30
+ key: string;
31
+ label?: I18nObject;
32
+ description?: I18nObject;
33
+ permissions?: string[];
34
+ }
35
+ export interface AssistantComposerInsertPayload {
36
+ text: string;
37
+ workspaceFiles?: {
38
+ path: string;
39
+ name: string;
40
+ mimeType?: string;
41
+ size?: number;
42
+ }[];
43
+ /** Exact skill names resolved uniquely against the current assistant/project capability catalog. */
44
+ skillNames?: string[];
45
+ }
46
+ export interface WorkbenchOpenFileEvidenceBox {
47
+ x: number;
48
+ y: number;
49
+ width: number;
50
+ height: number;
51
+ }
52
+ export interface WorkbenchOpenFileEvidence {
53
+ observationId?: string;
54
+ attributeCode?: string;
55
+ displayValue?: string;
56
+ text?: string;
57
+ method?: string;
58
+ region?: string;
59
+ confidence?: number;
60
+ locator?: {
61
+ sourceType?: string;
62
+ page?: number;
63
+ coordinateSpace?: string;
64
+ recognitionRotation?: number;
65
+ orientationConfidence?: number;
66
+ box?: WorkbenchOpenFileEvidenceBox;
67
+ };
68
+ }
69
+ /** Payload accepted by the host-side `workbench.file.open` client command. */
70
+ export interface WorkbenchOpenFile {
71
+ id?: string;
72
+ fileId?: string;
73
+ fileAssetId?: string;
74
+ storageFileId?: string;
75
+ name: string;
76
+ mimeType?: string;
77
+ size?: number;
78
+ url: string;
79
+ previewUrl?: string;
80
+ evidence?: WorkbenchOpenFileEvidence;
81
+ }
82
+ export type WorkbenchNavigationOpenTarget = typeof WORKBENCH_AGENT_EVOLUTION_TARGET | typeof WORKBENCH_AGENT_EVOLUTION_CHANGE_TARGET | typeof WORKBENCH_KNOWLEDGEBASE_DOCUMENTS_TARGET | typeof WORKBENCH_ASSISTANT_CONVERSATION_TARGET | typeof WORKBENCH_GROUP_MESSAGE_TARGET | typeof WORKBENCH_ASSISTANT_EXECUTION_TARGET | typeof WORKBENCH_ASSISTANT_PROJECT_TARGET | typeof WORKBENCH_EXTENSION_VIEW_TARGET | typeof WORKBENCH_PROJECT_APPLICATION_TARGET | typeof WORKBENCH_PROJECT_PIPELINES_TARGET;
83
+ export interface WorkbenchNavigationOpenPayload {
84
+ target: WorkbenchNavigationOpenTarget;
85
+ targetId?: string;
86
+ /** Exact evolution request to select on the existing evaluation page. */
87
+ changeId?: string;
88
+ knowledgebaseId?: string;
89
+ documentId?: string;
90
+ parentId?: string;
91
+ /** Exact KnowledgeDocument chunk anchor for evidence navigation. */
92
+ chunkId?: string;
93
+ /** One-based source page anchor when the document has an analysis preview. */
94
+ page?: number;
95
+ /** Parser/OCR block anchors within the source page. */
96
+ sourceBlockIds?: string[];
97
+ /** Transient source excerpt used for context/highlighting; the host must not place it in the URL. */
98
+ evidenceText?: string;
99
+ /** For `group.message`, the current public group ID. Hosts reject navigation to a different group. */
100
+ conversationId?: string;
101
+ threadId?: string;
102
+ executionId?: string;
103
+ /** Untrusted Assistant hint; the host resolves the canonical owner from `conversationId`. */
104
+ xpertId?: string;
105
+ /** Platform Chat Project selected for Project-scoped Assistant navigation. */
106
+ projectId?: string;
107
+ /** Untrusted identity hint; Project application entry reauthorizes the current persisted node. */
108
+ pipelineNodeId?: string;
109
+ /** Read-only Project pipeline return focus, rechecked when the graph is read. */
110
+ pipelineInstanceId?: string;
111
+ pipelineRoundId?: string;
112
+ viewKey?: string;
113
+ selectionId?: string;
114
+ parameters?: Record<string, XpertViewScalar | XpertViewScalar[]>;
115
+ /** Exact visible message in the requested branch, or a public group message for `group.message`. */
116
+ messageId?: string;
117
+ /** Keep the originating Workbench view open during navigation. */
118
+ preserveView?: boolean;
119
+ }
120
+ export interface WorkbenchAssistantConversationOpenRequest {
121
+ conversationId: string;
122
+ threadId?: string;
123
+ executionId?: string;
124
+ /** Untrusted hint; the host must resolve the canonical Assistant from `conversationId`. */
125
+ xpertId?: string;
126
+ /** Untrusted hint; the host must resolve the canonical Project from `conversationId`. */
127
+ projectId?: string;
128
+ /** Exact visible message in the requested branch. */
129
+ messageId?: string;
130
+ /** Keep the originating Workbench view open during navigation. */
131
+ preserveView?: boolean;
132
+ }
133
+ /** Server-authorized runtime scope used to rebuild ChatKit for one persisted Assistant conversation. */
134
+ export interface WorkbenchAssistantConversationResolution {
135
+ conversationId: string;
136
+ threadId: string;
137
+ xpertId: string;
138
+ projectId: string | null;
139
+ isExternalAssistant: boolean;
140
+ messageId?: string;
141
+ }
142
+ export interface WorkbenchAssistantProjectOpenRequest {
143
+ /** Trusted platform Chat Project id; this is distinct from plugin business ids. */
144
+ projectId: string;
145
+ /** Inspect a View in this Project without changing the active conversation. */
146
+ view?: WorkbenchExtensionViewOpenRequest;
147
+ }
148
+ export interface WorkbenchExtensionViewOpenRequest {
149
+ viewKey: string;
150
+ selectionId?: string;
151
+ parameters?: Record<string, XpertViewScalar | XpertViewScalar[]>;
152
+ }
153
+ export interface XpertRemoteComponentInvokeClientCommandRequest {
154
+ type: typeof XPERT_REMOTE_COMPONENT_INVOKE_CLIENT_COMMAND_MESSAGE_TYPE;
155
+ requestId: string;
156
+ commandKey: string;
157
+ payload?: unknown;
158
+ }
159
+ export type AssistantComposerReference = {
160
+ id?: string;
161
+ label?: string;
162
+ text: string;
163
+ } & ({
164
+ type: 'code';
165
+ path: string;
166
+ startLine: number;
167
+ endLine: number;
168
+ language?: string;
169
+ } | {
170
+ type: 'quote';
171
+ source?: string;
172
+ messageId?: string;
173
+ });
174
+ export type AssistantComposerAppendReferencesPayload = {
175
+ references: AssistantComposerReference[];
176
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './model';
2
+ export * from './client-commands';
2
3
  export * from './assistant-profile';
3
4
  export * from './workbench';
4
5
  export * from './workbench-open';
@@ -3,6 +3,8 @@ import type { PluginApplicationScope } from '../plugin-application';
3
3
  import type { I18nObject, IconDefinition } from '../types';
4
4
  import type { JsonSchemaObjectType } from '../ai/types';
5
5
  import type { XpertViewAssistantIdentity } from './assistant-profile';
6
+ import type { XpertViewClientCommandDefinition } from './client-commands';
7
+ export * from './client-commands';
6
8
  export type XpertViewHostType = 'integration' | 'knowledgebase' | 'agent' | 'project' | 'sandbox' | string;
7
9
  export type XpertViewSlotMode = 'tabs' | 'sections' | 'widgets' | 'sidebar';
8
10
  export type XpertViewSchemaType = 'stats' | 'table' | 'list' | 'detail' | 'raw_json' | 'remote_component';
@@ -327,14 +329,6 @@ export interface XpertViewActionDefinition {
327
329
  permissions?: string[];
328
330
  requiredHostAccess?: XpertViewHostAccessLevel;
329
331
  }
330
- export interface XpertViewClientCommandDefinition {
331
- /** A host must implement this command before mounting the view. Optional actions may omit this. */
332
- required?: boolean;
333
- key: string;
334
- label?: I18nObject;
335
- description?: I18nObject;
336
- permissions?: string[];
337
- }
338
332
  export interface XpertViewFileAccessDefinition {
339
333
  purposes: XpertViewFileAccessPurpose[];
340
334
  }
@@ -354,136 +348,6 @@ export interface XpertViewFileAccessGrantResult {
354
348
  mimeType: string;
355
349
  size?: number;
356
350
  }
357
- export declare const ASSISTANT_CHAT_SEND_MESSAGE_COMMAND = "assistant.chat.send_message";
358
- export declare const ASSISTANT_CONTEXT_SET_COMMAND = "assistant.context.set";
359
- export declare const WORKBENCH_FILE_OPEN_COMMAND = "workbench.file.open";
360
- export declare const WORKBENCH_NAVIGATION_OPEN_COMMAND = "workbench.navigation.open";
361
- export declare const WORKBENCH_AGENT_EVOLUTION_TARGET = "agent-evolution.target";
362
- export declare const WORKBENCH_AGENT_EVOLUTION_CHANGE_TARGET = "agent-evolution.change";
363
- export declare const WORKBENCH_KNOWLEDGEBASE_DOCUMENTS_TARGET = "knowledgebase.documents";
364
- export declare const WORKBENCH_ASSISTANT_CONVERSATION_TARGET = "assistant.conversation";
365
- /** Inspect an exact execution; embedded clients may open it without changing the active conversation. */
366
- export declare const WORKBENCH_ASSISTANT_EXECUTION_TARGET = "assistant.execution";
367
- /** Opens the current Assistant inside a Project-scoped workbench route. */
368
- export declare const WORKBENCH_ASSISTANT_PROJECT_TARGET = "assistant.project";
369
- export declare const WORKBENCH_EXTENSION_VIEW_TARGET = "workbench.view";
370
- /** Resolve the Project's application entry through its registered type and current access checks. */
371
- export declare const WORKBENCH_PROJECT_APPLICATION_TARGET = "project.application";
372
- /** Open full Project pipeline management in the configured platform. */
373
- export declare const WORKBENCH_PROJECT_PIPELINES_TARGET = "project.pipelines";
374
- export declare const XPERT_REMOTE_COMPONENT_INVOKE_CLIENT_COMMAND_MESSAGE_TYPE = "invokeClientCommand";
375
- export interface WorkbenchOpenFileEvidenceBox {
376
- x: number;
377
- y: number;
378
- width: number;
379
- height: number;
380
- }
381
- export interface WorkbenchOpenFileEvidence {
382
- observationId?: string;
383
- attributeCode?: string;
384
- displayValue?: string;
385
- text?: string;
386
- method?: string;
387
- region?: string;
388
- confidence?: number;
389
- locator?: {
390
- sourceType?: string;
391
- page?: number;
392
- coordinateSpace?: string;
393
- recognitionRotation?: number;
394
- orientationConfidence?: number;
395
- box?: WorkbenchOpenFileEvidenceBox;
396
- };
397
- }
398
- /** Payload accepted by the host-side `workbench.file.open` client command. */
399
- export interface WorkbenchOpenFile {
400
- id?: string;
401
- fileId?: string;
402
- fileAssetId?: string;
403
- storageFileId?: string;
404
- name: string;
405
- mimeType?: string;
406
- size?: number;
407
- url: string;
408
- previewUrl?: string;
409
- evidence?: WorkbenchOpenFileEvidence;
410
- }
411
- export type WorkbenchNavigationOpenTarget = typeof WORKBENCH_AGENT_EVOLUTION_TARGET | typeof WORKBENCH_AGENT_EVOLUTION_CHANGE_TARGET | typeof WORKBENCH_KNOWLEDGEBASE_DOCUMENTS_TARGET | typeof WORKBENCH_ASSISTANT_CONVERSATION_TARGET | typeof WORKBENCH_ASSISTANT_EXECUTION_TARGET | typeof WORKBENCH_ASSISTANT_PROJECT_TARGET | typeof WORKBENCH_EXTENSION_VIEW_TARGET | typeof WORKBENCH_PROJECT_APPLICATION_TARGET | typeof WORKBENCH_PROJECT_PIPELINES_TARGET;
412
- export interface WorkbenchNavigationOpenPayload {
413
- target: WorkbenchNavigationOpenTarget;
414
- targetId?: string;
415
- /** Exact evolution request to select on the existing evaluation page. */
416
- changeId?: string;
417
- knowledgebaseId?: string;
418
- documentId?: string;
419
- parentId?: string;
420
- /** Exact KnowledgeDocument chunk anchor for evidence navigation. */
421
- chunkId?: string;
422
- /** One-based source page anchor when the document has an analysis preview. */
423
- page?: number;
424
- /** Parser/OCR block anchors within the source page. */
425
- sourceBlockIds?: string[];
426
- /** Transient source excerpt used for context/highlighting; the host must not place it in the URL. */
427
- evidenceText?: string;
428
- conversationId?: string;
429
- threadId?: string;
430
- executionId?: string;
431
- /** Untrusted Assistant hint; the host resolves the canonical owner from `conversationId`. */
432
- xpertId?: string;
433
- /** Platform Chat Project selected for Project-scoped Assistant navigation. */
434
- projectId?: string;
435
- /** Untrusted identity hint; Project application entry reauthorizes the current persisted node. */
436
- pipelineNodeId?: string;
437
- /** Read-only Project pipeline return focus, rechecked when the graph is read. */
438
- pipelineInstanceId?: string;
439
- pipelineRoundId?: string;
440
- viewKey?: string;
441
- selectionId?: string;
442
- parameters?: Record<string, XpertViewScalar | XpertViewScalar[]>;
443
- /** Exact visible message in the requested branch. */
444
- messageId?: string;
445
- /** Keep the originating Workbench view open during navigation. */
446
- preserveView?: boolean;
447
- }
448
- export interface WorkbenchAssistantConversationOpenRequest {
449
- conversationId: string;
450
- threadId?: string;
451
- executionId?: string;
452
- /** Untrusted hint; the host must resolve the canonical Assistant from `conversationId`. */
453
- xpertId?: string;
454
- /** Untrusted hint; the host must resolve the canonical Project from `conversationId`. */
455
- projectId?: string;
456
- /** Exact visible message in the requested branch. */
457
- messageId?: string;
458
- /** Keep the originating Workbench view open during navigation. */
459
- preserveView?: boolean;
460
- }
461
- /** Server-authorized runtime scope used to rebuild ChatKit for one persisted Assistant conversation. */
462
- export interface WorkbenchAssistantConversationResolution {
463
- conversationId: string;
464
- threadId: string;
465
- xpertId: string;
466
- projectId: string | null;
467
- isExternalAssistant: boolean;
468
- messageId?: string;
469
- }
470
- export interface WorkbenchAssistantProjectOpenRequest {
471
- /** Trusted platform Chat Project id; this is distinct from plugin business ids. */
472
- projectId: string;
473
- /** Inspect a View in this Project without changing the active conversation. */
474
- view?: WorkbenchExtensionViewOpenRequest;
475
- }
476
- export interface WorkbenchExtensionViewOpenRequest {
477
- viewKey: string;
478
- selectionId?: string;
479
- parameters?: Record<string, XpertViewScalar | XpertViewScalar[]>;
480
- }
481
- export interface XpertRemoteComponentInvokeClientCommandRequest {
482
- type: typeof XPERT_REMOTE_COMPONENT_INVOKE_CLIENT_COMMAND_MESSAGE_TYPE;
483
- requestId: string;
484
- commandKey: string;
485
- payload?: unknown;
486
- }
487
351
  export declare const ASSISTANT_CITATION_OPEN_EVENT = "assistant.citation.open";
488
352
  export declare const KNOWLEDGEBASE_OPEN_CITATION_EFFECT = "knowledgebase.open_citation";
489
353
  /**
@@ -641,23 +505,3 @@ export interface XpertViewActionResult<TData = unknown> {
641
505
  code: string;
642
506
  };
643
507
  }
644
- /** Append text selections to the current draft without sending or replacing it. */
645
- export declare const ASSISTANT_COMPOSER_APPEND_REFERENCES_COMMAND = "assistant.composer.append_references";
646
- export type AssistantComposerReference = {
647
- id?: string;
648
- label?: string;
649
- text: string;
650
- } & ({
651
- type: 'code';
652
- path: string;
653
- startLine: number;
654
- endLine: number;
655
- language?: string;
656
- } | {
657
- type: 'quote';
658
- source?: string;
659
- messageId?: string;
660
- });
661
- export type AssistantComposerAppendReferencesPayload = {
662
- references: AssistantComposerReference[];
663
- };
@@ -1,10 +1,25 @@
1
- import type { WorkbenchExtensionViewOpenRequest } from './model';
1
+ import type { WorkbenchExtensionViewOpenRequest } from './client-commands';
2
2
  /** Live-only UI request. Project scope is mandatory; history playback must not reopen Views. */
3
3
  export declare const WORKBENCH_VIEW_OPEN_EVENT = "workbench.view.open";
4
+ /**
5
+ * Server-emitted instruction to open a declared View in the current Workbench context.
6
+ * Consumers verify Project/conversation scope and suppress stale or duplicate requests; the event grants no resource access.
7
+ * requestId and issuedAt are optional as a pair for legacy emitters; new navigation emitters should provide both.
8
+ */
4
9
  export interface WorkbenchViewOpenEvent extends WorkbenchExtensionViewOpenRequest {
10
+ /** Stable event discriminator; arbitrary logs and similarly shaped objects are not navigation requests. */
5
11
  type: typeof WORKBENCH_VIEW_OPEN_EVENT;
12
+ /** Project that owns the navigation context; must match the active authorized Workbench scope. */
6
13
  projectId: string;
14
+ /** Unique event deduplication ID, separate from the View's selectionId; supply together with issuedAt. */
15
+ requestId?: string;
16
+ /** Positive Unix epoch milliseconds used for freshness checks; supply together with requestId. */
17
+ issuedAt?: number;
18
+ /** Conversation restriction when present; consumers must not apply it to another conversation. */
7
19
  conversationId?: string;
8
20
  }
9
- /** Parse the public lg.chat.event boundary, keeping arbitrary logs out of navigation. */
21
+ /**
22
+ * Parse the public lg.chat.event shape and paired replay metadata, keeping arbitrary logs out of navigation.
23
+ * Returns null for invalid payloads. Shape validation does not perform access, active-scope or freshness checks.
24
+ */
10
25
  export declare function parseWorkbenchViewOpenEvent(value: unknown): WorkbenchViewOpenEvent | null;