@crewx/sdk 0.9.0-rc.95 → 0.9.0-rc.97
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/conversation/to-template-messages.d.ts +2 -0
- package/dist/esm/index.js +185 -151
- package/dist/esm/plugins/index.js +61 -61
- package/dist/esm/repository/index.js +73 -73
- package/dist/highlight/thread-highlighter.d.ts +24 -24
- package/dist/index.browser.js +3 -3
- package/dist/index.d.ts +4 -2
- package/dist/index.js +185 -151
- package/dist/lifecycle/task-stop.d.ts +1 -1
- package/dist/mcp-app/errors.d.ts +7 -0
- package/dist/mcp-app/index.d.ts +8 -0
- package/dist/mcp-app/installed-app-ref.d.ts +25 -0
- package/dist/mcp-app/projection.d.ts +12 -0
- package/dist/mcp-app/registry.d.ts +7 -0
- package/dist/mcp-app/types.d.ts +165 -0
- package/dist/migrations/0025_thread_app_instance_ledger.sql +2 -0
- package/dist/migrations/0026_mcp_action_source.sql +47 -0
- package/dist/migrations/meta/_journal.json +14 -0
- package/dist/plugins/index.js +61 -61
- package/dist/repository/index.js +74 -74
- package/dist/repository/task.repository.d.ts +1 -0
- package/dist/schema/ui-instances.d.ts +19 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/ui-instance/index.d.ts +2 -1
- package/dist/ui-instance/store.d.ts +20 -1
- package/dist/ui-instance/types.d.ts +9 -3
- package/package.json +1 -1
- package/templates/agents/default.yaml +5 -4
|
@@ -24,7 +24,7 @@ export interface StopTaskOptions {
|
|
|
24
24
|
processControl?: StopTaskProcessControl;
|
|
25
25
|
processControlOptions?: ProcessControlOptions;
|
|
26
26
|
}
|
|
27
|
-
type StopTaskRepository = Pick<TaskRepository, 'requestTaskStop' | 'getTask' | 'finalizeTaskStop'>;
|
|
27
|
+
type StopTaskRepository = Pick<TaskRepository, 'requestTaskStop' | 'stopPendingTask' | 'getTask' | 'finalizeTaskStop'>;
|
|
28
28
|
export declare function stopTask(taskId: string, options?: StopTaskOptions): Promise<StopTaskResult>;
|
|
29
29
|
export declare function stopTask(repo: StopTaskRepository, taskId: string, options?: StopTaskOptions): Promise<StopTaskResult>;
|
|
30
30
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type McpAppContractErrorCode = 'APP_ID_INVALID' | 'APP_ID_CONFLICT' | 'TOOL_ID_INVALID' | 'TOOL_ID_CONFLICT' | 'RESOURCE_URI_INVALID' | 'RESOURCE_NOT_FOUND' | 'HTML_INVALID' | 'TOOL_INVALID' | 'STATE_INVALID' | 'STATE_PROJECTION_INVALID' | 'BUTTON_INVALID' | 'SERIALIZATION_INVALID';
|
|
2
|
+
export declare class McpAppContractError extends Error {
|
|
3
|
+
readonly code: McpAppContractErrorCode;
|
|
4
|
+
readonly name = "McpAppContractError";
|
|
5
|
+
constructor(code: McpAppContractErrorCode, message?: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function rejectMcpApp(code: McpAppContractErrorCode, message?: string): never;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { McpAppContractErrorCode } from './errors.js';
|
|
2
|
+
export { McpAppContractError } from './errors.js';
|
|
3
|
+
export { INSTALLED_APP_ENTRY, InstalledAppRefError, buildInstalledAppRef, validateInstalledAppRef, } from './installed-app-ref.js';
|
|
4
|
+
export type { BuildInstalledAppRefInput, InstalledAppPackageFile, InstalledAppRef, InstalledAppRefErrorCode, } from './installed-app-ref.js';
|
|
5
|
+
export { createMcpAppRegistry, createBuiltinMcpAppRegistry, registerMcpApp, resolveMcpAppResource, requireMcpAppResource, toMcpAppToolRegistration, } from './registry.js';
|
|
6
|
+
export { buildMcpAppStateDescriptor, buildMcpAppStateProjections, buildTerminalMcpAppStateDescriptor, buildTerminalMcpAppStateProjections, createMcpAppToolResult, serializeMcpAppStateJson, serializeMcpAppStateXml, } from './projection.js';
|
|
7
|
+
export { MCP_APP_HOST_TOOL_ALLOWLIST, MCP_APP_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_URI_PREFIX, } from './types.js';
|
|
8
|
+
export type { McpAppActionDispatcherToolInput, McpAppActionToolDescriptor, McpAppActionToolInput, McpAppButtonDescriptor, McpAppButtonInput, McpAppDescriptor, McpAppDescriptorInput, McpAppInputSchema, McpAppTone, McpUiResourceCsp, McpAppRegistry, McpAppResource, McpAppServerStateInput, McpAppStateDescriptor, McpAppStateProjections, McpAppHostToolInput, McpAppHostToolName, McpAppReadToolInput, McpAppSingleActionToolInput, McpAppToolCommonInput, McpAppToolDescriptor, McpAppToolInput, McpAppToolMetadata, McpAppToolRegistration, McpAppToolResult, McpAppToolVisibility, } from './types.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { UiDefinition, UiDefinitionRef } from '../ui-instance/types.js';
|
|
2
|
+
export declare const INSTALLED_APP_ENTRY: "ui/index.html";
|
|
3
|
+
export type InstalledAppRefErrorCode = 'APP_ID_INVALID' | 'DEFINITION_REF_INVALID' | 'ENTRY_DUPLICATE' | 'ENTRY_PATH_INVALID' | 'ENTRY_MISSING' | 'ENTRY_HASH_INVALID' | 'INSTALLED_APP_REF_INVALID';
|
|
4
|
+
export declare class InstalledAppRefError extends Error {
|
|
5
|
+
readonly code: InstalledAppRefErrorCode;
|
|
6
|
+
readonly name = "InstalledAppRefError";
|
|
7
|
+
constructor(code: InstalledAppRefErrorCode, message?: string);
|
|
8
|
+
}
|
|
9
|
+
export interface InstalledAppRef {
|
|
10
|
+
readonly appId: string;
|
|
11
|
+
readonly definition: UiDefinitionRef;
|
|
12
|
+
readonly entry: typeof INSTALLED_APP_ENTRY;
|
|
13
|
+
readonly entryHash: string;
|
|
14
|
+
}
|
|
15
|
+
export interface InstalledAppPackageFile {
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly sha256: string;
|
|
18
|
+
}
|
|
19
|
+
export interface BuildInstalledAppRefInput {
|
|
20
|
+
readonly appId: string;
|
|
21
|
+
readonly definition: UiDefinition;
|
|
22
|
+
readonly packageFiles: readonly InstalledAppPackageFile[];
|
|
23
|
+
}
|
|
24
|
+
export declare function validateInstalledAppRef(value: unknown): InstalledAppRef;
|
|
25
|
+
export declare function buildInstalledAppRef(input: BuildInstalledAppRefInput): InstalledAppRef;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { JsonObject } from '../ui-instance/types.js';
|
|
2
|
+
import type { McpAppServerStateInput, McpAppStateDescriptor, McpAppStateProjections, McpAppToolDescriptor, McpAppToolResult } from './types.js';
|
|
3
|
+
export declare function buildMcpAppStateDescriptor(input: McpAppServerStateInput): McpAppStateDescriptor;
|
|
4
|
+
export declare function buildTerminalMcpAppStateDescriptor(input: McpAppServerStateInput): McpAppStateDescriptor;
|
|
5
|
+
export declare function serializeMcpAppStateJson(descriptor: McpAppStateDescriptor): string;
|
|
6
|
+
export declare function serializeMcpAppStateXml(descriptor: McpAppStateDescriptor): string;
|
|
7
|
+
export declare function buildMcpAppStateProjections(input: McpAppServerStateInput): McpAppStateProjections;
|
|
8
|
+
export declare function buildTerminalMcpAppStateProjections(input: McpAppServerStateInput): McpAppStateProjections;
|
|
9
|
+
export declare function createMcpAppToolResult(tool: Pick<McpAppToolDescriptor, 'textFallback'>, options?: {
|
|
10
|
+
structuredContent?: JsonObject;
|
|
11
|
+
meta?: JsonObject;
|
|
12
|
+
}): McpAppToolResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type McpAppDescriptor, type McpAppDescriptorInput, type McpAppRegistry, type McpAppResource, type McpAppToolDescriptor, type McpAppToolRegistration } from './types.js';
|
|
2
|
+
export declare function createMcpAppRegistry(): McpAppRegistry;
|
|
3
|
+
export declare function createBuiltinMcpAppRegistry(): McpAppRegistry;
|
|
4
|
+
export declare function registerMcpApp(registry: McpAppRegistry, input: McpAppDescriptorInput): McpAppDescriptor;
|
|
5
|
+
export declare function resolveMcpAppResource(registry: McpAppRegistry, uri: string): McpAppResource | null;
|
|
6
|
+
export declare function requireMcpAppResource(registry: McpAppRegistry, uri: string): McpAppResource;
|
|
7
|
+
export declare function toMcpAppToolRegistration(tool: McpAppToolDescriptor): McpAppToolRegistration;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { JsonObject, UiDefinition, UiDefinitionRef, UiInstance, UiInstanceStatus, UiActionConfirmation } from '../ui-instance/types.js';
|
|
2
|
+
export declare const MCP_APP_RESOURCE_MIME_TYPE: "text/html;profile=mcp-app";
|
|
3
|
+
export declare const MCP_APP_RESOURCE_URI_PREFIX = "ui://crewx/";
|
|
4
|
+
export type McpAppToolVisibility = 'model' | 'app';
|
|
5
|
+
export type McpAppTone = 'blue' | 'violet' | 'emerald' | 'amber' | 'rose' | 'sky' | 'slate' | 'indigo';
|
|
6
|
+
export declare const MCP_APP_HOST_TOOL_ALLOWLIST: readonly ["crewx_app_terminal_connect"];
|
|
7
|
+
export type McpAppHostToolName = typeof MCP_APP_HOST_TOOL_ALLOWLIST[number];
|
|
8
|
+
export interface McpUiResourceCsp {
|
|
9
|
+
readonly connectDomains?: readonly string[];
|
|
10
|
+
readonly resourceDomains?: readonly string[];
|
|
11
|
+
readonly frameDomains?: readonly string[];
|
|
12
|
+
readonly baseUriDomains?: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
export type McpAppInputSchema = JsonObject;
|
|
15
|
+
export interface McpAppToolCommonInput {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly description: string;
|
|
18
|
+
readonly inputSchema: McpAppInputSchema;
|
|
19
|
+
readonly textFallback: string;
|
|
20
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
21
|
+
}
|
|
22
|
+
export interface McpAppReadToolInput extends McpAppToolCommonInput {
|
|
23
|
+
readonly kind: 'read';
|
|
24
|
+
readonly actionId?: never;
|
|
25
|
+
}
|
|
26
|
+
export interface McpAppSingleActionToolInput extends McpAppToolCommonInput {
|
|
27
|
+
readonly kind: 'action';
|
|
28
|
+
readonly actionId: string;
|
|
29
|
+
readonly actionIds?: never;
|
|
30
|
+
}
|
|
31
|
+
export interface McpAppActionDispatcherToolInput extends McpAppToolCommonInput {
|
|
32
|
+
readonly kind: 'action';
|
|
33
|
+
readonly actionId?: never;
|
|
34
|
+
readonly actionIds: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
export type McpAppActionToolInput = McpAppSingleActionToolInput | McpAppActionDispatcherToolInput;
|
|
37
|
+
export type McpAppActionToolDescriptor = (Omit<McpAppSingleActionToolInput, 'actionIds'> & {
|
|
38
|
+
readonly actionIds: readonly string[];
|
|
39
|
+
}) | (Omit<McpAppActionDispatcherToolInput, 'actionId'> & {
|
|
40
|
+
readonly actionIds: readonly string[];
|
|
41
|
+
});
|
|
42
|
+
type McpAppToolDescriptorMetadata = {
|
|
43
|
+
readonly resourceUri: string;
|
|
44
|
+
readonly _meta: McpAppToolMetadata;
|
|
45
|
+
};
|
|
46
|
+
export interface McpAppHostToolInput extends Omit<McpAppToolCommonInput, 'name' | 'visibility'> {
|
|
47
|
+
readonly name: McpAppHostToolName;
|
|
48
|
+
readonly kind: 'host';
|
|
49
|
+
readonly visibility: readonly ['app'];
|
|
50
|
+
readonly actionId?: never;
|
|
51
|
+
}
|
|
52
|
+
export type McpAppToolInput = McpAppReadToolInput | McpAppActionToolInput | McpAppHostToolInput;
|
|
53
|
+
export interface McpAppDescriptorInput {
|
|
54
|
+
readonly appId: string;
|
|
55
|
+
readonly html: string;
|
|
56
|
+
readonly name?: string;
|
|
57
|
+
readonly description?: string;
|
|
58
|
+
readonly icon?: string;
|
|
59
|
+
readonly tone?: McpAppTone;
|
|
60
|
+
readonly builtinOnly?: boolean;
|
|
61
|
+
readonly csp?: McpUiResourceCsp;
|
|
62
|
+
readonly tools: readonly McpAppToolInput[];
|
|
63
|
+
readonly definition?: UiDefinition;
|
|
64
|
+
}
|
|
65
|
+
export interface McpAppResource {
|
|
66
|
+
readonly uri: string;
|
|
67
|
+
readonly mimeType: typeof MCP_APP_RESOURCE_MIME_TYPE;
|
|
68
|
+
readonly text: string;
|
|
69
|
+
readonly _meta?: {
|
|
70
|
+
readonly ui?: {
|
|
71
|
+
readonly csp?: McpUiResourceCsp;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export interface McpAppToolMetadata {
|
|
76
|
+
readonly ui: {
|
|
77
|
+
readonly resourceUri: string;
|
|
78
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export type McpAppToolDescriptor = (McpAppReadToolInput & McpAppToolDescriptorMetadata) | (McpAppActionToolDescriptor & McpAppToolDescriptorMetadata) | (McpAppHostToolInput & McpAppToolDescriptorMetadata);
|
|
82
|
+
export interface McpAppToolRegistration {
|
|
83
|
+
readonly name: string;
|
|
84
|
+
readonly description: string;
|
|
85
|
+
readonly inputSchema: McpAppInputSchema;
|
|
86
|
+
readonly _meta: McpAppToolMetadata;
|
|
87
|
+
}
|
|
88
|
+
export interface McpAppDescriptor {
|
|
89
|
+
readonly appId: string;
|
|
90
|
+
readonly name: string;
|
|
91
|
+
readonly description: string;
|
|
92
|
+
readonly icon?: string;
|
|
93
|
+
readonly tone?: McpAppTone;
|
|
94
|
+
readonly builtinOnly: boolean;
|
|
95
|
+
readonly csp?: McpUiResourceCsp;
|
|
96
|
+
readonly uiUri: string;
|
|
97
|
+
readonly html: string;
|
|
98
|
+
readonly definition?: UiDefinition;
|
|
99
|
+
readonly tools: readonly McpAppToolDescriptor[];
|
|
100
|
+
}
|
|
101
|
+
export interface McpAppToolResult {
|
|
102
|
+
readonly content: readonly [{
|
|
103
|
+
readonly type: 'text';
|
|
104
|
+
readonly text: string;
|
|
105
|
+
}];
|
|
106
|
+
readonly structuredContent?: JsonObject;
|
|
107
|
+
readonly _meta?: JsonObject;
|
|
108
|
+
}
|
|
109
|
+
export interface McpAppButtonInput {
|
|
110
|
+
readonly id: string;
|
|
111
|
+
readonly label: string;
|
|
112
|
+
readonly enabled: boolean;
|
|
113
|
+
readonly confirmation?: UiActionConfirmation;
|
|
114
|
+
readonly requiresHumanConfirmation?: boolean;
|
|
115
|
+
readonly disabledReason?: string;
|
|
116
|
+
readonly inputSchema: McpAppInputSchema;
|
|
117
|
+
}
|
|
118
|
+
export interface McpAppServerStateInput {
|
|
119
|
+
readonly source: 'server';
|
|
120
|
+
readonly instance: Pick<UiInstance, 'id' | 'definition' | 'revision' | 'status' | 'state'>;
|
|
121
|
+
readonly definition: UiDefinition;
|
|
122
|
+
readonly buttons: readonly McpAppButtonInput[];
|
|
123
|
+
}
|
|
124
|
+
export interface McpAppButtonDescriptor {
|
|
125
|
+
readonly id: string;
|
|
126
|
+
readonly label: string;
|
|
127
|
+
readonly enabled: boolean;
|
|
128
|
+
readonly confirmation: UiActionConfirmation;
|
|
129
|
+
readonly requiresHumanConfirmation?: boolean;
|
|
130
|
+
readonly disabledReason: string | null;
|
|
131
|
+
readonly inputSchema: McpAppInputSchema;
|
|
132
|
+
}
|
|
133
|
+
export interface McpAppStateDescriptor {
|
|
134
|
+
readonly schemaVersion: 1;
|
|
135
|
+
readonly source: 'server';
|
|
136
|
+
readonly instanceId: string;
|
|
137
|
+
readonly definition: UiDefinitionRef;
|
|
138
|
+
readonly revision: number;
|
|
139
|
+
readonly status: UiInstanceStatus;
|
|
140
|
+
readonly state: JsonObject;
|
|
141
|
+
readonly buttons: readonly McpAppButtonDescriptor[];
|
|
142
|
+
}
|
|
143
|
+
export interface McpAppStateProjections {
|
|
144
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
145
|
+
readonly card: McpAppStateDescriptor;
|
|
146
|
+
readonly developer: {
|
|
147
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
148
|
+
readonly json: string;
|
|
149
|
+
};
|
|
150
|
+
readonly ai: {
|
|
151
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
152
|
+
readonly json: string;
|
|
153
|
+
readonly xml: string;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export interface McpAppRegistry {
|
|
157
|
+
registerMcpApp(input: McpAppDescriptorInput): McpAppDescriptor;
|
|
158
|
+
getMcpApp(appId: string): McpAppDescriptor | null;
|
|
159
|
+
listMcpApps(): readonly McpAppDescriptor[];
|
|
160
|
+
listMcpAppTools(): readonly McpAppToolDescriptor[];
|
|
161
|
+
resolveMcpAppTool(toolName: string): McpAppToolDescriptor | null;
|
|
162
|
+
resolveMcpAppResource(uri: string): McpAppResource | null;
|
|
163
|
+
requireMcpAppResource(uri: string): McpAppResource;
|
|
164
|
+
}
|
|
165
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
ALTER TABLE `ui_instances` ADD `app_id` text CONSTRAINT "ui_instances_app_id_ck" CHECK("ui_instances"."app_id" IS NULL OR length("ui_instances"."app_id") BETWEEN 1 AND 128);--> statement-breakpoint
|
|
2
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `ui_instances_workspace_thread_app_uq` ON `ui_instances` (`workspace_id`,`thread_id`,`app_id`);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
2
|
+
CREATE TABLE `__new_ui_action_receipts` (
|
|
3
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
4
|
+
`instance_id` text NOT NULL,
|
|
5
|
+
`request_id` text NOT NULL,
|
|
6
|
+
`action_id` text NOT NULL,
|
|
7
|
+
`actor_json` text NOT NULL,
|
|
8
|
+
`source` text NOT NULL,
|
|
9
|
+
`expected_revision` integer NOT NULL,
|
|
10
|
+
`before_revision` integer NOT NULL,
|
|
11
|
+
`after_revision` integer,
|
|
12
|
+
`status` text NOT NULL,
|
|
13
|
+
`outcome` text,
|
|
14
|
+
`input_json` text NOT NULL,
|
|
15
|
+
`result_json` text,
|
|
16
|
+
`error_code` text,
|
|
17
|
+
`requested_at` integer NOT NULL,
|
|
18
|
+
`settled_at` integer,
|
|
19
|
+
CONSTRAINT "ui_action_receipts_id_ck" CHECK(length("__new_ui_action_receipts"."id") BETWEEN 5 AND 128),
|
|
20
|
+
CONSTRAINT "ui_action_receipts_instance_id_ck" CHECK(length("__new_ui_action_receipts"."instance_id") BETWEEN 1 AND 128),
|
|
21
|
+
CONSTRAINT "ui_action_receipts_request_id_ck" CHECK(length("__new_ui_action_receipts"."request_id") BETWEEN 1 AND 128),
|
|
22
|
+
CONSTRAINT "ui_action_receipts_action_id_ck" CHECK(length("__new_ui_action_receipts"."action_id") BETWEEN 1 AND 128),
|
|
23
|
+
CONSTRAINT "ui_action_receipts_actor_json_ck" CHECK(json_valid("__new_ui_action_receipts"."actor_json") AND json_type("__new_ui_action_receipts"."actor_json") = 'object'),
|
|
24
|
+
CONSTRAINT "ui_action_receipts_source_ck" CHECK("__new_ui_action_receipts"."source" IN ('ui_host', 'cli', 'system', 'mcp')),
|
|
25
|
+
CONSTRAINT "ui_action_receipts_expected_revision_ck" CHECK("__new_ui_action_receipts"."expected_revision" >= 0),
|
|
26
|
+
CONSTRAINT "ui_action_receipts_before_revision_ck" CHECK("__new_ui_action_receipts"."before_revision" >= 0),
|
|
27
|
+
CONSTRAINT "ui_action_receipts_after_revision_ck" CHECK("__new_ui_action_receipts"."after_revision" IS NULL OR "__new_ui_action_receipts"."after_revision" >= 0),
|
|
28
|
+
CONSTRAINT "ui_action_receipts_status_ck" CHECK("__new_ui_action_receipts"."status" IN ('requested', 'settled')),
|
|
29
|
+
CONSTRAINT "ui_action_receipts_outcome_ck" CHECK("__new_ui_action_receipts"."outcome" IS NULL OR "__new_ui_action_receipts"."outcome" IN ('succeeded', 'rejected', 'failed', 'conflicted', 'expired')),
|
|
30
|
+
CONSTRAINT "ui_action_receipts_input_json_ck" CHECK(json_valid("__new_ui_action_receipts"."input_json") AND json_type("__new_ui_action_receipts"."input_json") = 'object'),
|
|
31
|
+
CONSTRAINT "ui_action_receipts_result_json_ck" CHECK("__new_ui_action_receipts"."result_json" IS NULL OR (json_valid("__new_ui_action_receipts"."result_json") AND json_type("__new_ui_action_receipts"."result_json") = 'object')),
|
|
32
|
+
CONSTRAINT "ui_action_receipts_requested_at_ck" CHECK("__new_ui_action_receipts"."requested_at" >= 0),
|
|
33
|
+
CONSTRAINT "ui_action_receipts_settled_at_ck" CHECK("__new_ui_action_receipts"."settled_at" IS NULL OR "__new_ui_action_receipts"."settled_at" >= "__new_ui_action_receipts"."requested_at"),
|
|
34
|
+
CONSTRAINT "ui_action_receipts_status_transition_ck" CHECK((
|
|
35
|
+
("__new_ui_action_receipts"."status" = 'requested' AND "__new_ui_action_receipts"."after_revision" IS NULL AND "__new_ui_action_receipts"."outcome" IS NULL AND "__new_ui_action_receipts"."settled_at" IS NULL)
|
|
36
|
+
OR
|
|
37
|
+
("__new_ui_action_receipts"."status" = 'settled' AND "__new_ui_action_receipts"."after_revision" IS NOT NULL AND "__new_ui_action_receipts"."outcome" IS NOT NULL AND "__new_ui_action_receipts"."settled_at" IS NOT NULL)
|
|
38
|
+
))
|
|
39
|
+
);
|
|
40
|
+
--> statement-breakpoint
|
|
41
|
+
INSERT INTO `__new_ui_action_receipts`("id", "instance_id", "request_id", "action_id", "actor_json", "source", "expected_revision", "before_revision", "after_revision", "status", "outcome", "input_json", "result_json", "error_code", "requested_at", "settled_at") SELECT "id", "instance_id", "request_id", "action_id", "actor_json", "source", "expected_revision", "before_revision", "after_revision", "status", "outcome", "input_json", "result_json", "error_code", "requested_at", "settled_at" FROM `ui_action_receipts`;--> statement-breakpoint
|
|
42
|
+
DROP TABLE `ui_action_receipts`;--> statement-breakpoint
|
|
43
|
+
ALTER TABLE `__new_ui_action_receipts` RENAME TO `ui_action_receipts`;--> statement-breakpoint
|
|
44
|
+
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
45
|
+
CREATE UNIQUE INDEX `ui_action_receipts_instance_request_uq` ON `ui_action_receipts` (`instance_id`,`request_id`);--> statement-breakpoint
|
|
46
|
+
CREATE INDEX `ui_action_receipts_instance_id_idx` ON `ui_action_receipts` (`instance_id`);--> statement-breakpoint
|
|
47
|
+
CREATE INDEX `ui_action_receipts_requested_at_idx` ON `ui_action_receipts` (`requested_at`);
|
|
@@ -180,6 +180,20 @@
|
|
|
180
180
|
{
|
|
181
181
|
"idx": 25,
|
|
182
182
|
"version": "6",
|
|
183
|
+
"when": 1788854442066,
|
|
184
|
+
"tag": "0025_thread_app_instance_ledger",
|
|
185
|
+
"breakpoints": true
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"idx": 26,
|
|
189
|
+
"version": "6",
|
|
190
|
+
"when": 1788944186188,
|
|
191
|
+
"tag": "0026_mcp_action_source",
|
|
192
|
+
"breakpoints": true
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"idx": 27,
|
|
196
|
+
"version": "6",
|
|
183
197
|
"when": 1789128000000,
|
|
184
198
|
"tag": "0025_task_heartbeat",
|
|
185
199
|
"breakpoints": true
|