@ximatai/muyun-web-app 0.26.13 → 0.26.14
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.
- package/dist/{BusinessActivityLogView-UC4rH4Fn.js → BusinessActivityLogView-BUg5WTm-.js} +1 -1
- package/dist/BusinessLogListDrawer-BOTE_7aT.js +825 -0
- package/dist/{LoginAuditLogView-Cjrp8MKX.js → LoginAuditLogView-DBNtvmIy.js} +1 -1
- package/dist/{ModuleActionManagementView-Dkb35QXc.js → ModuleActionManagementView-Bq1VO51Y.js} +165 -165
- package/dist/{ModuleGovernanceView-Dx43QvGf.js → ModuleGovernanceView-B8u4_erd.js} +3570 -2877
- package/dist/{RequestErrorLogView-WnGvMWiF.js → RequestErrorLogView-BrtH3ptj.js} +1 -1
- package/dist/{RoleDetailWorkspaceView-DPDb_QOn.js → RoleDetailWorkspaceView-6LW3tLA1.js} +276 -276
- package/dist/{RuntimeLogView-BRl4ZDkU.js → RuntimeLogView-s3X5CdHB.js} +47 -80
- package/dist/index.css +1 -1
- package/dist/index.js +400 -400
- package/dist/{moduleGovernanceWorkspaceView-4V_UW-Bt.js → moduleGovernanceWorkspaceView-BRgJbUjJ.js} +2 -2
- package/dist/{platform-components-1cvOeHmo.js → platform-components-Dt859Hbr.js} +3449 -2676
- package/dist/platform-workbench-DfqFnlm-.js +14701 -0
- package/dist/{http-B0TC0pJB.js → sse-mGbuCAax.js} +41 -11
- package/dist/types/dynamic-page-runtime/ModulePageBusinessSession.d.ts +218 -8
- package/dist/types/dynamic-page-runtime/ModulePageHostRuntime.vue.d.ts +230 -18
- package/dist/types/dynamic-page-runtime/PageNavigatorExplorer.vue.d.ts +2 -2
- package/dist/types/dynamic-page-runtime/assistantRecordEditorPolicy.d.ts +6 -0
- package/dist/types/dynamic-page-runtime/composables/useModulePageListSession.d.ts +1 -0
- package/dist/types/dynamic-page-runtime/composables/useRecordEditingSession.d.ts +2 -0
- package/dist/types/dynamic-page-runtime/index.d.ts +1 -0
- package/dist/types/dynamic-page-runtime/modulePageAssistantScope.d.ts +8 -0
- package/dist/types/dynamic-page-runtime/modulePageAssistantSurface.d.ts +6 -0
- package/dist/types/dynamic-page-runtime/useModulePageSession.d.ts +110 -5
- package/dist/types/dynamic-page-runtime/useTenantScopeController.d.ts +1 -0
- package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +8 -0
- package/dist/types/platform-components/QueryValueEditor.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordDetailFields.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordFormFields.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordQueryListCell.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +8 -0
- package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +5 -2
- package/dist/types/platform-components/index.d.ts +4 -1
- package/dist/types/platform-components/querySettlementController.d.ts +5 -0
- package/dist/types/platform-components/recordQueryListColumnModel.d.ts +7 -0
- package/dist/types/platform-components/recordQueryListQueryController.d.ts +36 -0
- package/dist/types/platform-components/recordTreeQueryController.d.ts +18 -0
- package/dist/types/platform-components/referencePickerModel.d.ts +2 -0
- package/dist/types/platform-workbench/AssistantMarkdownContent.vue.d.ts +6 -0
- package/dist/types/platform-workbench/AssistantSelectionCard.vue.d.ts +15 -0
- package/dist/types/platform-workbench/Workbench.vue.d.ts +7 -2
- package/dist/types/platform-workbench/WorkbenchAssistantPanel.vue.d.ts +12 -0
- package/dist/types/platform-workbench/assistantMarkdown.d.ts +1 -0
- package/dist/types/platform-workbench/index.d.ts +1 -0
- package/dist/types/platform-workbench/workbenchAssistantCapabilities.d.ts +3 -0
- package/dist/types/views/BusinessLogRetentionControl.vue.d.ts +7 -0
- package/dist/types/views/businessLogClient.d.ts +3 -0
- package/dist/types/views/businessLogRetentionClient.d.ts +25 -0
- package/dist/types/views/metadataGovernanceAssistantSurface.d.ts +122 -0
- package/dist/types/views/metadataModelChangeSetClient.d.ts +36 -0
- package/dist/types/views/metadataNaming.d.ts +4 -0
- package/dist/types/views/runtimeLogSse.d.ts +3 -13
- package/dist/types/vue-ui-antdv/components/UiTextArea.vue.d.ts +2 -0
- package/dist/types/web-contracts/assistant.d.ts +59 -0
- package/dist/types/web-contracts/index.d.ts +1 -0
- package/dist/types/web-core/assistantRuntime.d.ts +77 -0
- package/dist/types/web-core/assistantSurface.d.ts +92 -0
- package/dist/types/web-core/assistantTurnClient.d.ts +8 -0
- package/dist/types/web-core/index.d.ts +4 -0
- package/dist/types/web-core/sse.d.ts +9 -0
- package/dist/{workspaceViews-CCg6V0pr.js → workspaceViews-DijY4n32.js} +554 -554
- package/package.json +1 -1
- package/dist/BusinessLogListDrawer-BtaXVJKz.js +0 -564
- package/dist/platform-workbench-Cu14Xd9d.js +0 -10299
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { type AssistantCapability, type AssistantSurface, type AssistantTurnRequester } from '../web-core/index';
|
|
2
|
+
import type { MetadataModelChangeSetProposal } from './metadataModelEditSession';
|
|
3
|
+
import type { MetadataChangeSetPreview } from './metadataModelChangeSetClient';
|
|
4
|
+
export interface MetadataGovernanceAssistantModelSummary {
|
|
5
|
+
moduleAlias: string;
|
|
6
|
+
moduleTitle?: string;
|
|
7
|
+
relationCount: number;
|
|
8
|
+
selectedRelation?: {
|
|
9
|
+
relationId: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
fieldCount: number;
|
|
12
|
+
fields: Array<{
|
|
13
|
+
fieldName: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
fieldSpecAlias?: string;
|
|
16
|
+
propertyKind: string;
|
|
17
|
+
governance: string;
|
|
18
|
+
}>;
|
|
19
|
+
truncated: boolean;
|
|
20
|
+
};
|
|
21
|
+
draft: {
|
|
22
|
+
active: boolean;
|
|
23
|
+
dirty: boolean;
|
|
24
|
+
editorOpen: boolean;
|
|
25
|
+
};
|
|
26
|
+
fieldSpecs: Array<{
|
|
27
|
+
alias: string;
|
|
28
|
+
title?: string;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
export interface AddMetadataFieldDraftInput {
|
|
32
|
+
title: string;
|
|
33
|
+
fieldName?: string;
|
|
34
|
+
fieldSpecAlias: string;
|
|
35
|
+
required?: boolean;
|
|
36
|
+
unique?: boolean;
|
|
37
|
+
indexed?: boolean;
|
|
38
|
+
sortable?: boolean;
|
|
39
|
+
titleField?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface UpdateMetadataFieldDraftInput {
|
|
42
|
+
fieldName: string;
|
|
43
|
+
title?: string;
|
|
44
|
+
fieldSpecAlias?: string;
|
|
45
|
+
required?: boolean;
|
|
46
|
+
unique?: boolean;
|
|
47
|
+
indexed?: boolean;
|
|
48
|
+
sortable?: boolean;
|
|
49
|
+
titleField?: boolean;
|
|
50
|
+
enabled?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export type MetadataPropertyFieldKind = 'MODULE_REFERENCE' | 'DICTIONARY';
|
|
53
|
+
export interface FindMetadataFieldTargetsInput {
|
|
54
|
+
kind: MetadataPropertyFieldKind;
|
|
55
|
+
keyword?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface AddMetadataPropertyFieldDraftInput {
|
|
58
|
+
kind: MetadataPropertyFieldKind;
|
|
59
|
+
title: string;
|
|
60
|
+
fieldName?: string;
|
|
61
|
+
target: string;
|
|
62
|
+
selectionMode?: 'SINGLE' | 'MULTIPLE';
|
|
63
|
+
required?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface PreparedMetadataPropertyFieldDraft {
|
|
66
|
+
relationId: string;
|
|
67
|
+
kind: MetadataPropertyFieldKind;
|
|
68
|
+
title: string;
|
|
69
|
+
fieldName: string;
|
|
70
|
+
columnName: string;
|
|
71
|
+
fieldSpecAlias: string;
|
|
72
|
+
required: boolean;
|
|
73
|
+
reference?: {
|
|
74
|
+
targetModuleAlias: string;
|
|
75
|
+
targetMetadataId?: string;
|
|
76
|
+
targetKeyField: string;
|
|
77
|
+
targetLabelField: string;
|
|
78
|
+
};
|
|
79
|
+
dictionary?: {
|
|
80
|
+
applicationAlias: string;
|
|
81
|
+
categoryAlias: string;
|
|
82
|
+
selectionMode: 'SINGLE' | 'MULTIPLE';
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export interface MetadataGovernanceAssistantAdapter {
|
|
86
|
+
summary(): MetadataGovernanceAssistantModelSummary;
|
|
87
|
+
proposal(): MetadataModelChangeSetProposal | undefined;
|
|
88
|
+
preview(proposal: MetadataModelChangeSetProposal, signal: AbortSignal): Promise<MetadataChangeSetPreview>;
|
|
89
|
+
fieldSpecAliases(): string[];
|
|
90
|
+
editableBasicFieldNames(): string[];
|
|
91
|
+
addFieldDraft?(input: AddMetadataFieldDraftInput): {
|
|
92
|
+
relationId: string;
|
|
93
|
+
fieldName: string;
|
|
94
|
+
columnName: string;
|
|
95
|
+
title: string;
|
|
96
|
+
fieldSpecAlias: string;
|
|
97
|
+
};
|
|
98
|
+
updateFieldDraft?(input: UpdateMetadataFieldDraftInput): {
|
|
99
|
+
relationId: string;
|
|
100
|
+
fieldName: string;
|
|
101
|
+
title?: string;
|
|
102
|
+
fieldSpecAlias?: string;
|
|
103
|
+
};
|
|
104
|
+
findFieldTargets?(input: FindMetadataFieldTargetsInput, signal: AbortSignal): Promise<{
|
|
105
|
+
targets: Array<{
|
|
106
|
+
target: string;
|
|
107
|
+
title?: string;
|
|
108
|
+
}>;
|
|
109
|
+
truncated: boolean;
|
|
110
|
+
}>;
|
|
111
|
+
preparePropertyFieldDraft?(input: AddMetadataPropertyFieldDraftInput, signal: AbortSignal): Promise<PreparedMetadataPropertyFieldDraft>;
|
|
112
|
+
commitPropertyFieldDraft?(prepared: PreparedMetadataPropertyFieldDraft): {
|
|
113
|
+
relationId: string;
|
|
114
|
+
kind: MetadataPropertyFieldKind;
|
|
115
|
+
fieldName: string;
|
|
116
|
+
columnName: string;
|
|
117
|
+
title: string;
|
|
118
|
+
fieldSpecAlias: string;
|
|
119
|
+
target: string;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export declare function createMetadataGovernanceAssistantSurface(adapter: MetadataGovernanceAssistantAdapter, requestTurn: AssistantTurnRequester, contributedCapabilities?: () => AssistantCapability[]): AssistantSurface;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { HttpClient } from '../web-core/index';
|
|
2
|
+
import type { MetadataModelChangeSetProposal } from './metadataModelEditSession';
|
|
3
|
+
export type MetadataChangeSetIssue = {
|
|
4
|
+
severity: 'WARNING' | 'ERROR' | string;
|
|
5
|
+
code: string;
|
|
6
|
+
subject: string;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
export type MetadataChangeSetPreview = {
|
|
10
|
+
proposalFingerprint: string;
|
|
11
|
+
fieldImpacts: Array<{
|
|
12
|
+
operation: string;
|
|
13
|
+
fieldName: string;
|
|
14
|
+
columnName: string;
|
|
15
|
+
platformManaged: boolean;
|
|
16
|
+
description: string;
|
|
17
|
+
}>;
|
|
18
|
+
schemaImpacts: Array<{
|
|
19
|
+
operation: string;
|
|
20
|
+
schemaName: string;
|
|
21
|
+
tableName: string;
|
|
22
|
+
columnName: string;
|
|
23
|
+
description: string;
|
|
24
|
+
}>;
|
|
25
|
+
orderImpacts: Array<{
|
|
26
|
+
operation: string;
|
|
27
|
+
relationId?: string;
|
|
28
|
+
parentMetadataId?: string;
|
|
29
|
+
orderedIds: string[];
|
|
30
|
+
description: string;
|
|
31
|
+
}>;
|
|
32
|
+
warnings: MetadataChangeSetIssue[];
|
|
33
|
+
errors: MetadataChangeSetIssue[];
|
|
34
|
+
};
|
|
35
|
+
export declare function previewMetadataModelChangeSet(http: HttpClient, moduleAlias: string, proposal: MetadataModelChangeSetProposal, signal?: AbortSignal): Promise<MetadataChangeSetPreview>;
|
|
36
|
+
export declare function applyMetadataModelChangeSet(http: HttpClient, moduleAlias: string, proposal: MetadataModelChangeSetProposal, proposalFingerprint: string): Promise<unknown>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { MetadataFieldPropertyKind } from './metadataOrchestrationState';
|
|
2
|
+
export declare const PLATFORM_FIELD_NAME_PATTERN = "^[a-z][A-Za-z0-9]{0,62}$";
|
|
3
|
+
export declare const DYNAMIC_RECORD_RESERVED_FIELD_NAMES: Set<string>;
|
|
4
|
+
export declare function isPlatformFieldName(value: string): boolean;
|
|
5
|
+
export declare function isDynamicRecordReservedFieldName(value: string): boolean;
|
|
2
6
|
export declare function physicalNameOf(fieldName?: string): string;
|
|
3
7
|
export declare function generatedFieldName(title?: string): string;
|
|
4
8
|
/** Default names for newly created business fields; runtime semantics remain metadata-driven. */
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Incrementally decodes an SSE response body. Keeping this small parser beside
|
|
7
|
-
* the log surface avoids coupling a one-way operational stream to the broader
|
|
8
|
-
* realtime messaging runtime.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createRuntimeLogSseParser(emit: (event: RuntimeLogSseEvent) => void): {
|
|
11
|
-
push(chunk: string): void;
|
|
12
|
-
finish(): void;
|
|
13
|
-
};
|
|
1
|
+
import { createSseParser, type SseEvent } from '../web-core/index';
|
|
2
|
+
export type RuntimeLogSseEvent = SseEvent;
|
|
3
|
+
export declare const createRuntimeLogSseParser: typeof createSseParser;
|
|
@@ -19,6 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
19
19
|
focusSelection: typeof focusSelection;
|
|
20
20
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
21
|
"update:value": (value: string) => any;
|
|
22
|
+
keydown: (event: KeyboardEvent) => any;
|
|
22
23
|
drop: (event: {
|
|
23
24
|
source: UiDragSource;
|
|
24
25
|
selection: {
|
|
@@ -33,6 +34,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
33
34
|
}) => any;
|
|
34
35
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
36
|
"onUpdate:value"?: ((value: string) => any) | undefined;
|
|
37
|
+
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
36
38
|
onDrop?: ((event: {
|
|
37
39
|
source: UiDragSource;
|
|
38
40
|
selection: {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface AssistantCapabilityDescriptor {
|
|
2
|
+
code: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export interface AssistantSurfaceContext {
|
|
7
|
+
surface: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
facts: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface AssistantCapabilityCall {
|
|
12
|
+
id: string;
|
|
13
|
+
code: string;
|
|
14
|
+
input: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface AssistantCapabilityResult {
|
|
17
|
+
callId: string;
|
|
18
|
+
capabilityCode: string;
|
|
19
|
+
output?: unknown;
|
|
20
|
+
error?: {
|
|
21
|
+
code: string;
|
|
22
|
+
message: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface AssistantConversationMessage {
|
|
26
|
+
role: 'user' | 'assistant';
|
|
27
|
+
text: string;
|
|
28
|
+
}
|
|
29
|
+
export interface AssistantSelectionOption {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
export interface AssistantSelectionInteraction {
|
|
34
|
+
interactionId: string;
|
|
35
|
+
prompt: string;
|
|
36
|
+
inputPolicy: 'free_text_allowed' | 'selection_required';
|
|
37
|
+
presentation: 'options' | 'confirmation';
|
|
38
|
+
options: AssistantSelectionOption[];
|
|
39
|
+
}
|
|
40
|
+
export interface AssistantSelectionResponse {
|
|
41
|
+
interactionId: string;
|
|
42
|
+
optionId: string;
|
|
43
|
+
label: string;
|
|
44
|
+
}
|
|
45
|
+
export interface AssistantTurnInput {
|
|
46
|
+
message: string;
|
|
47
|
+
history?: AssistantConversationMessage[];
|
|
48
|
+
context: AssistantSurfaceContext;
|
|
49
|
+
capabilities: AssistantCapabilityDescriptor[];
|
|
50
|
+
results?: AssistantCapabilityResult[];
|
|
51
|
+
selectionResponse?: AssistantSelectionResponse;
|
|
52
|
+
}
|
|
53
|
+
export interface AssistantTurnOutput {
|
|
54
|
+
text?: string;
|
|
55
|
+
toolCalls: AssistantCapabilityCall[];
|
|
56
|
+
selection?: AssistantSelectionInteraction;
|
|
57
|
+
finishReason?: string;
|
|
58
|
+
requestId?: string;
|
|
59
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { AssistantCapabilityResult, AssistantConversationMessage, AssistantSelectionResponse, AssistantTurnOutput } from '../web-contracts/index';
|
|
2
|
+
import { type AssistantSurfaceRegistry } from './assistantSurface';
|
|
3
|
+
export interface AssistantRuntimeStepResult {
|
|
4
|
+
output: AssistantTurnOutput;
|
|
5
|
+
results: AssistantCapabilityResult[];
|
|
6
|
+
contextChanged: boolean;
|
|
7
|
+
/** Successful capability invocations that committed an effect through applyEffect in this step. */
|
|
8
|
+
appliedEffectCount: number;
|
|
9
|
+
}
|
|
10
|
+
export interface AssistantConversationOptions {
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
maxSteps?: number;
|
|
13
|
+
/** Completed dialogue before the current user message. */
|
|
14
|
+
history?: AssistantConversationMessage[];
|
|
15
|
+
/** Structured answer to a selection shown by the immediately preceding assistant message. */
|
|
16
|
+
selectionResponse?: AssistantSelectionResponse;
|
|
17
|
+
onStep?(step: AssistantRuntimeStepResult): void | Promise<void>;
|
|
18
|
+
onTextDelta?(text: string, stepIndex: number): void;
|
|
19
|
+
onTextDiscard?(stepIndex: number): void;
|
|
20
|
+
onActivity?(phase: AssistantActivityPhase, stepIndex: number): void;
|
|
21
|
+
/** Receives content-free execution facts for local diagnostics or a governed telemetry adapter. */
|
|
22
|
+
onDiagnostic?(event: AssistantRuntimeDiagnosticEvent): void | Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export type AssistantActivityPhase = 'understanding' | 'executing' | 'responding';
|
|
25
|
+
type AssistantDiagnosticSurface = 'workbench' | 'module-page' | 'metadata-governance' | 'other';
|
|
26
|
+
type AssistantDiagnosticFinishReason = 'stop' | 'tool_calls' | 'length' | 'content_filter' | 'other';
|
|
27
|
+
export type AssistantRuntimeDiagnosticEvent = {
|
|
28
|
+
type: 'decision.started';
|
|
29
|
+
stepIndex: number;
|
|
30
|
+
surface: AssistantDiagnosticSurface;
|
|
31
|
+
backgroundContextRefreshed: boolean;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'decision.completed';
|
|
34
|
+
stepIndex: number;
|
|
35
|
+
finishReason?: AssistantDiagnosticFinishReason;
|
|
36
|
+
toolCallCount: number;
|
|
37
|
+
hasText: boolean;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'decision.restarted';
|
|
40
|
+
stepIndex: number;
|
|
41
|
+
attempt: number;
|
|
42
|
+
reason: 'background-context-refresh' | 'formal-surface-ready';
|
|
43
|
+
} | {
|
|
44
|
+
type: 'decision.failed';
|
|
45
|
+
stepIndex: number;
|
|
46
|
+
reason: 'context-changed' | 'cancelled' | 'surface-settlement-failed' | 'model-request-failed';
|
|
47
|
+
} | {
|
|
48
|
+
type: 'capability.completed';
|
|
49
|
+
stepIndex: number;
|
|
50
|
+
capabilityCode: string;
|
|
51
|
+
outcome: 'succeeded' | 'failed' | 'replayed';
|
|
52
|
+
pageEffectApplied: boolean;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'conversation.completed';
|
|
55
|
+
stepCount: number;
|
|
56
|
+
bounded: boolean;
|
|
57
|
+
};
|
|
58
|
+
export interface AssistantConversationResult {
|
|
59
|
+
steps: AssistantRuntimeStepResult[];
|
|
60
|
+
completed: boolean;
|
|
61
|
+
}
|
|
62
|
+
export declare class AssistantConversationFollowUpError extends Error {
|
|
63
|
+
readonly steps: readonly AssistantRuntimeStepResult[];
|
|
64
|
+
constructor(steps: readonly AssistantRuntimeStepResult[], cause: unknown);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Runs the bounded tool loop for one user message. Every step takes a fresh
|
|
68
|
+
* Surface snapshot so navigation and draft changes are observed before the
|
|
69
|
+
* model decides its next action.
|
|
70
|
+
*/
|
|
71
|
+
export declare function runAssistantConversation(registry: AssistantSurfaceRegistry, message: string, options?: AssistantConversationOptions): Promise<AssistantConversationResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Executes one bounded model step. A context-changing capability ends the step;
|
|
74
|
+
* the caller starts the next turn from a fresh Surface snapshot.
|
|
75
|
+
*/
|
|
76
|
+
export declare function runAssistantStep(registry: AssistantSurfaceRegistry, message: string, previousResults?: AssistantCapabilityResult[], signal?: AbortSignal): Promise<AssistantRuntimeStepResult>;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { AssistantCapabilityCall, AssistantCapabilityDescriptor, AssistantSurfaceContext, AssistantTurnInput, AssistantTurnOutput } from '../web-contracts/index';
|
|
2
|
+
import type { AssistantTurnProgress } from './assistantTurnClient';
|
|
3
|
+
export interface AssistantCapability<TInput = unknown, TOutput = unknown> {
|
|
4
|
+
descriptor: AssistantCapabilityDescriptor;
|
|
5
|
+
parseInput(input: unknown): TInput;
|
|
6
|
+
execute(input: TInput, context: AssistantCapabilityExecutionContext): Promise<TOutput>;
|
|
7
|
+
}
|
|
8
|
+
export declare function emptyAssistantCapabilityInputSchema(): Record<string, unknown>;
|
|
9
|
+
export declare function parseEmptyAssistantCapabilityInput(input: unknown): Record<string, never>;
|
|
10
|
+
export interface AssistantCapabilityExecutionContext {
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
/** Explicit caller cancellation; unlike signal, it is not aborted by an expected Surface replacement. */
|
|
13
|
+
cancellationSignal?: AbortSignal;
|
|
14
|
+
isCurrent(): boolean;
|
|
15
|
+
/** Commit invocation-local guarded state without claiming a user-visible page effect. */
|
|
16
|
+
commitInternalState<T>(commit: () => T): T;
|
|
17
|
+
/**
|
|
18
|
+
* Apply a page effect, retaining its execution scope while background work settles.
|
|
19
|
+
* Navigation adapters may return the token of an explicitly validated replacement surface.
|
|
20
|
+
*/
|
|
21
|
+
applyEffect<T>(effect: () => T, settle?: () => Promise<void | AssistantInvocationToken>): T;
|
|
22
|
+
}
|
|
23
|
+
export interface AssistantSurface {
|
|
24
|
+
describe(): AssistantSurfaceContext;
|
|
25
|
+
capabilities(): AssistantCapability[];
|
|
26
|
+
requestTurn(input: AssistantTurnInput, signal: AbortSignal, progress?: AssistantTurnProgress): Promise<AssistantTurnOutput>;
|
|
27
|
+
}
|
|
28
|
+
export interface AssistantSurfaceRegistration {
|
|
29
|
+
pageInstanceKey: string;
|
|
30
|
+
fallback?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Waits for background page transitions to finish before the model receives a
|
|
33
|
+
* context snapshot. It must not wait for missing user input or mutate page state.
|
|
34
|
+
*/
|
|
35
|
+
settle?(signal: AbortSignal): Promise<void>;
|
|
36
|
+
contextRevision(): string;
|
|
37
|
+
/**
|
|
38
|
+
* User-controlled execution scope. Background refreshes must leave this stable
|
|
39
|
+
* so the runtime can safely refresh context without discarding the user's goal.
|
|
40
|
+
*/
|
|
41
|
+
interactionRevision?(): string;
|
|
42
|
+
surface: AssistantSurface;
|
|
43
|
+
}
|
|
44
|
+
export interface AssistantInvocationToken {
|
|
45
|
+
pageInstanceKey: string;
|
|
46
|
+
surfaceGeneration: number;
|
|
47
|
+
contextRevision: string;
|
|
48
|
+
interactionRevision?: string;
|
|
49
|
+
fallback: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface AssistantSurfaceSnapshot {
|
|
52
|
+
token: AssistantInvocationToken;
|
|
53
|
+
context: AssistantSurfaceContext;
|
|
54
|
+
capabilities: AssistantCapabilityDescriptor[];
|
|
55
|
+
}
|
|
56
|
+
export interface AssistantSurfaceRegistry {
|
|
57
|
+
register(registration: AssistantSurfaceRegistration): () => void;
|
|
58
|
+
activate(pageInstanceKey: string | undefined): void;
|
|
59
|
+
snapshot(): AssistantSurfaceSnapshot | undefined;
|
|
60
|
+
/** Observe registration and active-page changes; read the current snapshot when notified. */
|
|
61
|
+
subscribe(listener: () => void): () => void;
|
|
62
|
+
waitForActiveSurface(options?: {
|
|
63
|
+
pageInstanceKey?: string;
|
|
64
|
+
requireFormal?: boolean;
|
|
65
|
+
signal?: AbortSignal;
|
|
66
|
+
timeoutMs?: number;
|
|
67
|
+
}): Promise<AssistantSurfaceSnapshot>;
|
|
68
|
+
/** Waits for the current page to settle and returns a fresh, execution-compatible snapshot. */
|
|
69
|
+
settleActiveSurface(token: AssistantInvocationToken, signal?: AbortSignal): Promise<AssistantSurfaceSnapshot>;
|
|
70
|
+
requestTurn(input: Omit<AssistantTurnInput, 'context' | 'capabilities'>, token: AssistantInvocationToken, signal?: AbortSignal, progress?: AssistantTurnProgress): Promise<AssistantTurnOutput>;
|
|
71
|
+
invoke(call: AssistantCapabilityCall, token: AssistantInvocationToken, signal?: AbortSignal): Promise<{
|
|
72
|
+
value: unknown;
|
|
73
|
+
contextChanged: boolean;
|
|
74
|
+
}>;
|
|
75
|
+
}
|
|
76
|
+
export interface AssistantSurfaceHost {
|
|
77
|
+
registry: AssistantSurfaceRegistry;
|
|
78
|
+
activePageInstanceKey(): string | undefined;
|
|
79
|
+
capabilities?(): AssistantCapability[];
|
|
80
|
+
}
|
|
81
|
+
export declare function provideAssistantSurfaceHost(host: AssistantSurfaceHost): void;
|
|
82
|
+
export declare function useAssistantSurfaceHost(): AssistantSurfaceHost | undefined;
|
|
83
|
+
export declare class StaleAssistantInvocationError extends Error {
|
|
84
|
+
constructor();
|
|
85
|
+
}
|
|
86
|
+
/** Safe, bounded feedback that helps the model repair a rejected capability call. */
|
|
87
|
+
export declare class AssistantCapabilityUsageError extends Error {
|
|
88
|
+
constructor(message: string);
|
|
89
|
+
}
|
|
90
|
+
export declare function createAssistantSurfaceRegistry(): AssistantSurfaceRegistry;
|
|
91
|
+
/** Compares page identity and revisions, independently of object property order. */
|
|
92
|
+
export declare function sameAssistantInvocationToken(left: AssistantInvocationToken | undefined, right: AssistantInvocationToken | undefined): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AssistantTurnInput, AssistantTurnOutput } from '../web-contracts/index';
|
|
2
|
+
import { type HttpClient } from './http';
|
|
3
|
+
export interface AssistantTurnProgress {
|
|
4
|
+
onTextDelta?(text: string): void;
|
|
5
|
+
}
|
|
6
|
+
export type AssistantTurnRequester = (input: AssistantTurnInput, signal: AbortSignal, progress?: AssistantTurnProgress) => Promise<AssistantTurnOutput>;
|
|
7
|
+
/** Uses the supplied transport as-is so page-owned tenant scope remains authoritative. */
|
|
8
|
+
export declare function createAssistantTurnRequester(http: HttpClient): AssistantTurnRequester;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export * from './errors';
|
|
2
2
|
export * from './http';
|
|
3
|
+
export * from './sse';
|
|
3
4
|
export * from './query';
|
|
4
5
|
export * from './actionResult';
|
|
6
|
+
export * from './assistantSurface';
|
|
7
|
+
export * from './assistantRuntime';
|
|
8
|
+
export * from './assistantTurnClient';
|
|
5
9
|
export * from './businessNotifications';
|
|
6
10
|
export * from './dataChanges';
|
|
7
11
|
export * from './realtime';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface SseEvent {
|
|
2
|
+
event: string;
|
|
3
|
+
data: string;
|
|
4
|
+
}
|
|
5
|
+
/** Incrementally decodes the SSE framing shared by authenticated platform streams. */
|
|
6
|
+
export declare function createSseParser(emit: (event: SseEvent) => void): {
|
|
7
|
+
push(chunk: string): void;
|
|
8
|
+
finish(): void;
|
|
9
|
+
};
|