@crewx/sdk 0.9.0-rc.124 → 0.9.0-rc.126
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/config/models.generated.d.ts +2 -2
- package/dist/config/pricing.generated.d.ts +2 -2
- package/dist/esm/index.js +382 -257
- package/dist/esm/plugins/index.js +70 -64
- package/dist/esm/publish/index.js +2 -2
- package/dist/esm/repository/index.js +84 -78
- package/dist/esm/testing/index.js +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.d.ts +7 -5
- package/dist/index.js +383 -258
- package/dist/mcp-app/agent-access.d.ts +12 -1
- package/dist/mcp-app/bundle-provenance.d.ts +2 -0
- package/dist/mcp-app/dev-checks.d.ts +27 -0
- package/dist/mcp-app/discovery.d.ts +51 -4
- package/dist/mcp-app/index.d.ts +10 -8
- package/dist/mcp-app/projection.d.ts +2 -1
- package/dist/mcp-app/registry.d.ts +9 -2
- package/dist/mcp-app/skill-backend.d.ts +40 -3
- package/dist/mcp-app/types.d.ts +52 -3
- package/dist/mcp-app/workspace-snapshot.d.ts +3 -2
- package/dist/migrations/0034_keen_fallen_one.sql +36 -0
- package/dist/migrations/meta/0034_snapshot.json +3473 -0
- package/dist/migrations/meta/_journal.json +8 -1
- package/dist/plugins/index.js +71 -65
- package/dist/publish/index.js +2 -2
- package/dist/repository/index.js +86 -80
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/ui-action-receipts.d.ts +55 -0
- package/dist/schema/ui-instance-repins.d.ts +222 -0
- package/dist/testing/index.js +1 -1
- package/dist/ui-instance/index.d.ts +4 -2
- package/dist/ui-instance/json.d.ts +10 -0
- package/dist/ui-instance/lineage.d.ts +22 -0
- package/dist/ui-instance/store.d.ts +38 -1
- package/dist/ui-instance/types.d.ts +24 -0
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { UiActionConfirmation } from '../ui-instance/types.js';
|
|
2
|
+
import type { UiDefinition } from '../ui-instance/types.js';
|
|
3
|
+
import type { ProductAppBundleProvenance } from './discovery.js';
|
|
2
4
|
export type McpAppAgentAccess = 'allowed' | 'approval_required' | 'denied';
|
|
3
5
|
export interface McpAppAgentAccessAction {
|
|
4
6
|
readonly actionId: string;
|
|
@@ -11,4 +13,13 @@ export interface McpAppAgentAccessAction {
|
|
|
11
13
|
readonly command?: readonly string[];
|
|
12
14
|
};
|
|
13
15
|
}
|
|
14
|
-
export
|
|
16
|
+
export interface McpAppVerifiedBundleAccessContext {
|
|
17
|
+
readonly appId: string;
|
|
18
|
+
readonly definition: UiDefinition;
|
|
19
|
+
readonly provenance: ProductAppBundleProvenance;
|
|
20
|
+
}
|
|
21
|
+
export declare function resolveAgentAccess(action: McpAppAgentAccessAction, modelActions?: readonly string[], bundle?: McpAppVerifiedBundleAccessContext): McpAppAgentAccess;
|
|
22
|
+
export declare function listMcpAppAgentActions(actions: readonly McpAppAgentAccessAction[], modelActions?: readonly string[], bundle?: McpAppVerifiedBundleAccessContext): readonly {
|
|
23
|
+
readonly actionId: string;
|
|
24
|
+
readonly access: McpAppAgentAccess;
|
|
25
|
+
}[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type AppDevCheckItem = {
|
|
2
|
+
readonly rule: 'manifest' | 'external_resource' | 'output_unsafe_string' | 'output_invalid' | 'output_size' | 'call_duration';
|
|
3
|
+
readonly severity: 'error' | 'warning' | 'ok';
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly where: string;
|
|
6
|
+
readonly detail?: Record<string, string | number>;
|
|
7
|
+
};
|
|
8
|
+
export type ExternalResourceKind = 'script' | 'style' | 'image' | 'font' | 'media' | 'frame' | 'object' | 'form' | 'navigation' | 'css' | 'script_network';
|
|
9
|
+
export interface ExternalResourceFinding {
|
|
10
|
+
readonly line: number;
|
|
11
|
+
readonly column: number;
|
|
12
|
+
readonly url: string;
|
|
13
|
+
readonly directive: string;
|
|
14
|
+
readonly kind: ExternalResourceKind;
|
|
15
|
+
}
|
|
16
|
+
export interface InspectSkillBackendOutputOptions {
|
|
17
|
+
readonly actionId: string;
|
|
18
|
+
readonly dataPaths?: readonly string[];
|
|
19
|
+
readonly durationMs?: number;
|
|
20
|
+
readonly timedOut?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface ScanExternalResourcesOptions {
|
|
23
|
+
readonly csp: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function inspectSkillBackendOutput(stdoutText: string, options: InspectSkillBackendOutputOptions): AppDevCheckItem[];
|
|
26
|
+
export declare function scanExternalResources(html: string, options: ScanExternalResourcesOptions): ExternalResourceFinding[];
|
|
27
|
+
export declare function externalResourceCheckItems(entryRelativePath: string, findings: readonly ExternalResourceFinding[]): AppDevCheckItem[];
|
|
@@ -1,14 +1,50 @@
|
|
|
1
|
+
import type { UiDefinitionLineageEntry } from '../ui-instance/lineage.js';
|
|
1
2
|
import type { JsonObject, UiDefinition } from '../ui-instance/types.js';
|
|
2
3
|
import type { UiPluginHandlerMetadata, UiPluginManifestV2, UiPluginNormalizedManifestV2 } from '../ui-plugin/types.js';
|
|
3
4
|
import { AppDiscoveryFsError, NodeAppDiscoveryFs, NodeAppDiscoveryFsAdapter, defaultAppDiscoveryFs, defaultNodeAppDiscoveryFs, type AppDiscoveryFsErrorCode } from './node-app-discovery-fs.js';
|
|
4
5
|
import type { McpAppRegistry } from './types.js';
|
|
5
6
|
export type WorkspaceAppSource = 'apps' | 'skills';
|
|
7
|
+
export type WorkspaceAppDiscoverySource = WorkspaceAppSource | 'bundled';
|
|
8
|
+
export interface ProductAppBundleInput {
|
|
9
|
+
readonly root: string;
|
|
10
|
+
readonly expectedIndexHash: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ProductAppBundleProvenance {
|
|
13
|
+
readonly kind: 'bundled';
|
|
14
|
+
readonly indexHash: string;
|
|
15
|
+
readonly packageDir: string;
|
|
16
|
+
readonly appId: string;
|
|
17
|
+
readonly definitionId: string;
|
|
18
|
+
readonly version: number;
|
|
19
|
+
readonly definitionHash: string;
|
|
20
|
+
readonly files: readonly ProductAppBundleFileHash[];
|
|
21
|
+
}
|
|
22
|
+
export interface ProductAppBundleFileHash {
|
|
23
|
+
readonly path: string;
|
|
24
|
+
readonly sha256: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ProductAppBundleDefinitionIdentity {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly version: number;
|
|
29
|
+
readonly hash: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ProductAppBundlePackageIndex {
|
|
32
|
+
readonly packageDir: string;
|
|
33
|
+
readonly appId: string;
|
|
34
|
+
readonly definition: ProductAppBundleDefinitionIdentity;
|
|
35
|
+
readonly lineage: readonly UiDefinitionLineageEntry[];
|
|
36
|
+
readonly files: readonly ProductAppBundleFileHash[];
|
|
37
|
+
}
|
|
38
|
+
export interface ProductAppBundleIndex {
|
|
39
|
+
readonly version: 1;
|
|
40
|
+
readonly packages: readonly ProductAppBundlePackageIndex[];
|
|
41
|
+
}
|
|
6
42
|
export type WorkspaceAppDiscoveryIncompleteReason = 'time_limit';
|
|
7
|
-
export type WorkspaceAppDiagnosticCode = 'MANIFEST_MISSING' | 'MANIFEST_INVALID' | 'ENTRY_INVALID' | 'INITIAL_STATE_INVALID' | 'DUPLICATE_ID' | 'RESERVED_ID' | 'PATH_ESCAPED' | 'LIMIT_EXCEEDED' | 'EXEC_DENIED';
|
|
43
|
+
export type WorkspaceAppDiagnosticCode = 'MANIFEST_MISSING' | 'MANIFEST_INVALID' | 'ENTRY_INVALID' | 'INITIAL_STATE_INVALID' | 'DUPLICATE_ID' | 'RESERVED_ID' | 'BUNDLE_INTEGRITY' | 'LINEAGE_INVALID' | 'LINEAGE_STALE' | 'PATH_ESCAPED' | 'LIMIT_EXCEEDED' | 'EXEC_DENIED';
|
|
8
44
|
export interface WorkspaceAppDiagnostic {
|
|
9
45
|
readonly code: WorkspaceAppDiagnosticCode;
|
|
10
46
|
readonly pluginId?: string;
|
|
11
|
-
readonly source:
|
|
47
|
+
readonly source: WorkspaceAppDiscoverySource;
|
|
12
48
|
readonly relativePath: string;
|
|
13
49
|
}
|
|
14
50
|
export type McpAppDiscoveryDiagnostic = WorkspaceAppDiagnostic;
|
|
@@ -46,12 +82,14 @@ export interface WorkspaceAppDiscoveryOptions {
|
|
|
46
82
|
readonly reservedAppIds?: Iterable<string>;
|
|
47
83
|
readonly reservedDefinitionIds?: Iterable<string>;
|
|
48
84
|
readonly reservedToolNames?: Iterable<string>;
|
|
85
|
+
readonly productBundle?: ProductAppBundleInput;
|
|
49
86
|
}
|
|
50
87
|
export interface WorkspaceAppToolNames {
|
|
51
88
|
readonly read: string;
|
|
52
89
|
readonly action?: string;
|
|
53
90
|
}
|
|
54
91
|
export interface WorkspaceAppResourceSnapshot {
|
|
92
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
55
93
|
readonly entry: {
|
|
56
94
|
readonly path: 'ui/index.html';
|
|
57
95
|
readonly hash: string;
|
|
@@ -63,12 +101,11 @@ export interface WorkspaceAppResourceSnapshot {
|
|
|
63
101
|
readonly bytes: readonly number[];
|
|
64
102
|
};
|
|
65
103
|
}
|
|
66
|
-
|
|
104
|
+
interface WorkspaceAppCandidateBase {
|
|
67
105
|
readonly appId: string;
|
|
68
106
|
readonly pluginId: string;
|
|
69
107
|
readonly definitionId: string;
|
|
70
108
|
readonly version: number;
|
|
71
|
-
readonly source: WorkspaceAppSource;
|
|
72
109
|
readonly relativePath: string;
|
|
73
110
|
readonly manifest: UiPluginManifestV2;
|
|
74
111
|
readonly normalized: UiPluginNormalizedManifestV2;
|
|
@@ -88,11 +125,21 @@ export interface WorkspaceAppCandidate {
|
|
|
88
125
|
readonly sourceHash: string;
|
|
89
126
|
readonly toolNames: WorkspaceAppToolNames;
|
|
90
127
|
}
|
|
128
|
+
export type WorkspaceAppCandidate = WorkspaceAppCandidateBase & ({
|
|
129
|
+
readonly source: WorkspaceAppSource;
|
|
130
|
+
readonly provenance?: never;
|
|
131
|
+
readonly lineage?: never;
|
|
132
|
+
} | {
|
|
133
|
+
readonly source?: never;
|
|
134
|
+
readonly provenance: ProductAppBundleProvenance;
|
|
135
|
+
readonly lineage: readonly UiDefinitionLineageEntry[];
|
|
136
|
+
});
|
|
91
137
|
export interface WorkspaceAppDiscoveryResult {
|
|
92
138
|
readonly apps: readonly WorkspaceAppCandidate[];
|
|
93
139
|
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
94
140
|
readonly complete: boolean;
|
|
95
141
|
readonly incompleteReason?: WorkspaceAppDiscoveryIncompleteReason;
|
|
142
|
+
readonly productBundleIndexHash?: string;
|
|
96
143
|
readonly candidates?: readonly WorkspaceAppCandidate[];
|
|
97
144
|
}
|
|
98
145
|
export declare const WORKSPACE_APP_TOOL_PREFIX = "crewx_local_app_";
|
package/dist/mcp-app/index.d.ts
CHANGED
|
@@ -2,23 +2,25 @@ export type { McpAppContractErrorCode } from './errors.js';
|
|
|
2
2
|
export { McpAppContractError } from './errors.js';
|
|
3
3
|
export { INSTALLED_APP_ENTRY, InstalledAppRefError, buildInstalledAppRef, validateInstalledAppRef, } from './installed-app-ref.js';
|
|
4
4
|
export type { BuildInstalledAppRefInput, InstalledAppPackageFile, InstalledAppRef, InstalledAppRefErrorCode, } from './installed-app-ref.js';
|
|
5
|
-
export { MAX_HTML_LENGTH, createMcpAppRegistry, createBuiltinMcpAppRegistry, buildMcpAppLocalRegistration, createMcpAppLocalRegistration, registerLocalMcpApp, createMcpAppWorkspaceRegistry, createWorkspaceAppRegistry, createWorkspaceMcpAppRegistry, registerMcpApp, resolveMcpAppResource, resolveLocalMcpAppResource, requireMcpAppResource, toMcpAppToolRegistration, } from './registry.js';
|
|
5
|
+
export { MAX_HTML_LENGTH, createMcpAppRegistry, createBuiltinMcpAppRegistry, buildMcpAppLocalRegistration, createMcpAppLocalRegistration, registerLocalMcpApp, createMcpAppWorkspaceRegistry, createWorkspaceAppRegistry, createWorkspaceMcpAppRegistry, registerMcpApp, resolveMcpAppResource, resolveLocalMcpAppResource, requireMcpAppResource, toMcpAppToolRegistration, makeUiUri, buildMcpAppBundleRegistrationInput, buildMcpAppBundleAgentActionDescriptors, resolveMcpAppFixedResultCall, } from './registry.js';
|
|
6
6
|
export { AppDiscoveryFsError, NodeAppDiscoveryFs, NodeAppDiscoveryFsAdapter, defaultAppDiscoveryFs, defaultNodeAppDiscoveryFs, deriveWorkspaceAppToolName, deriveWorkspaceAppToolNames, discoverWorkspaceAppCandidates, discoverWorkspaceApps, LOCAL_APP_TOOL_PREFIX, MCP_APP_WORKSPACE_TOOL_PREFIX, scanWorkspaceApps, WORKSPACE_APP_TOOL_PREFIX, } from './discovery.js';
|
|
7
|
-
export type { AppDiscoveryBytes, AppDiscoveryDiagnostic, AppDiscoveryDirectoryEntry, AppDiscoveryDirectoryEntryKind, AppDiscoveryDirectoryListing, AppDiscoveryFileSystem, AppDiscoveryFsErrorCode, AppDiscoveryMaybePromise, WorkspaceAppDiscoveryOptions as AppDiscoveryOptions, McpAppDiscoveryDiagnostic, WorkspaceAppBuiltinCatalog, WorkspaceAppCandidate, WorkspaceAppDiscoveryIncompleteReason, WorkspaceAppDiscoveryOptions, WorkspaceAppDiscoveryResult, WorkspaceAppDiagnostic, WorkspaceAppDiagnosticCode, WorkspaceAppResourceSnapshot, WorkspaceAppReservedCatalog, WorkspaceAppSource, WorkspaceAppToolNames, } from './discovery.js';
|
|
7
|
+
export type { AppDiscoveryBytes, AppDiscoveryDiagnostic, AppDiscoveryDirectoryEntry, AppDiscoveryDirectoryEntryKind, AppDiscoveryDirectoryListing, AppDiscoveryFileSystem, AppDiscoveryFsErrorCode, AppDiscoveryMaybePromise, WorkspaceAppDiscoveryOptions as AppDiscoveryOptions, McpAppDiscoveryDiagnostic, WorkspaceAppBuiltinCatalog, WorkspaceAppCandidate, WorkspaceAppDiscoveryIncompleteReason, WorkspaceAppDiscoveryOptions, WorkspaceAppDiscoveryResult, WorkspaceAppDiagnostic, WorkspaceAppDiagnosticCode, WorkspaceAppDiscoverySource, WorkspaceAppResourceSnapshot, WorkspaceAppReservedCatalog, WorkspaceAppSource, WorkspaceAppToolNames, ProductAppBundleDefinitionIdentity, ProductAppBundleFileHash, ProductAppBundleIndex, ProductAppBundleInput, ProductAppBundlePackageIndex, ProductAppBundleProvenance, } from './discovery.js';
|
|
8
8
|
export { createWorkspaceAppCatalog, discoverWorkspaceAppCatalog, hashAppDefinition, hashCrewxAppDefinition, listWorkspaceApps, } from './catalog.js';
|
|
9
9
|
export type { CrewxAppBuiltinCatalog, CrewxAppCapability, CrewxAppCatalogOptions, CrewxAppCatalogResult, CrewxAppDefinitionHashInput, CrewxAppDefinitionSummary, CrewxAppDiagnostic, CrewxAppDiagnosticCode, CrewxAppDiagnosticSource, CrewxAppInstalledProjection, CrewxAppLocalDefinitionRef, CrewxAppOrigin, CrewxAppOwnership, CrewxAppShareability, CrewxAppSharingAvailability, CrewxAppSummary, } from './types.js';
|
|
10
|
-
export { MCP_APP_PROJECTION_MAX_BYTES, buildMcpAppStateDescriptor, buildMcpAppStateProjections, buildTerminalMcpAppStateDescriptor, buildTerminalMcpAppStateProjections, createMcpAppToolResult, serializeMcpAppStateJson, serializeMcpAppStateXml, } from './projection.js';
|
|
10
|
+
export { MCP_APP_PROJECTION_MAX_BYTES, buildMcpAppStateDescriptor, buildMcpAppStateProjections, buildTerminalMcpAppStateDescriptor, buildTerminalMcpAppStateProjections, createMcpAppToolResult, projectMcpAppSummaryState, serializeMcpAppStateJson, serializeMcpAppStateXml, } from './projection.js';
|
|
11
11
|
export { buildMcpAppsContext } from './apps-context.js';
|
|
12
12
|
export type { McpAppsContext } from './apps-context.js';
|
|
13
13
|
export { MCP_APP_MODEL_CONTEXT_MAX_ARRAY_LENGTH, MCP_APP_MODEL_CONTEXT_MAX_BYTES, MCP_APP_MODEL_CONTEXT_MAX_DEPTH, MCP_APP_MODEL_CONTEXT_MAX_STRING_LENGTH, sanitizeMcpAppModelContext, serializeMcpAppModelContextXml, } from './model-context.js';
|
|
14
14
|
export type { McpAppModelContext, McpAppModelContextInput } from './model-context.js';
|
|
15
|
-
export { resolveAgentAccess } from './agent-access.js';
|
|
16
|
-
export type { McpAppAgentAccess, McpAppAgentAccessAction } from './agent-access.js';
|
|
15
|
+
export { resolveAgentAccess, listMcpAppAgentActions } from './agent-access.js';
|
|
16
|
+
export type { McpAppAgentAccess, McpAppAgentAccessAction, McpAppVerifiedBundleAccessContext } from './agent-access.js';
|
|
17
17
|
export { buildStateSetHandler, createStateSetHandler, } from './state-set.js';
|
|
18
18
|
export type { StateSetHandlerBuildInput } from './state-set.js';
|
|
19
|
-
export { SKILL_BACKEND_DEFAULT_TIMEOUT_MS, SKILL_BACKEND_MAX_INPUT_BYTES, SKILL_BACKEND_MAX_OUTPUT_BYTES, SKILL_BACKEND_SCHEMA_VERSION, buildSkillBackendHandler, } from './skill-backend.js';
|
|
20
|
-
export type { SkillBackendExecutionPort, SkillBackendExecutionRequest, SkillBackendExecutionResponse, SkillBackendHandlerBuildInput, SkillBackendInfrastructureErrorCode, SkillBackendPayload, } from './skill-backend.js';
|
|
19
|
+
export { SKILL_BACKEND_DEFAULT_TIMEOUT_MS, SKILL_BACKEND_INHERITED_ENV_ALLOWLIST, SKILL_BACKEND_MAX_INPUT_BYTES, SKILL_BACKEND_MAX_OUTPUT_BYTES, SKILL_BACKEND_SCHEMA_VERSION, buildSkillBackendChildEnvironment, buildSkillBackendHandler, buildVerifiedBundleSkillBackendHandler, } from './skill-backend.js';
|
|
20
|
+
export type { SkillBackendChildEnvironment, SkillBackendExecutionPort, SkillBackendExecutionRequest, SkillBackendExecutionResponse, SkillBackendHandlerBuildInput, SkillBackendInfrastructureErrorCode, SkillBackendPayload, VerifiedBundleSkillBackendBuildInput, VerifiedBundleSkillRunnerPort, VerifiedBundleSkillSpawnRequest, } from './skill-backend.js';
|
|
21
|
+
export { externalResourceCheckItems, inspectSkillBackendOutput, scanExternalResources, } from './dev-checks.js';
|
|
22
|
+
export type { AppDevCheckItem, ExternalResourceFinding, ExternalResourceKind, InspectSkillBackendOutputOptions, ScanExternalResourcesOptions, } from './dev-checks.js';
|
|
21
23
|
export { MCP_APP_HOST_TOOL_ALLOWLIST, MCP_APP_LOCAL_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_URI_PREFIX, } from './types.js';
|
|
22
|
-
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, McpAppInstanceResourceBinding, McpAppMcpResourceBinding, McpAppResourceBinding, McpAppLocalResource, McpAppLocalRegistrationInput, McpAppLocalReadToolDescriptor, McpAppLocalActionToolDescriptor, McpAppLocalSingleActionToolDescriptor, McpAppLocalToolDiagnostic, McpAppLocalToolDescriptor, McpAppLocalRegistration, McpAppBuiltinRegistration, McpAppResolvedRegistration, McpAppLocalLauncher, McpAppBuiltinLauncher, McpAppLauncher, WorkspaceAppLauncher, WorkspaceAppResolvedRegistration, McpAppWorkspaceRegistry, WorkspaceAppRegistry, McpAppWorkspaceRegistryInput, } from './types.js';
|
|
24
|
+
export type { McpAppActionDispatcherToolInput, McpAppActionToolDescriptor, McpAppActionToolInput, McpAppButtonDescriptor, McpAppButtonInput, McpAppDescriptor, McpAppDescriptorInput, McpAppInputSchema, McpAppTone, McpUiResourceCsp, McpAppRegistry, McpAppResource, McpAppServerStateInput, McpAppStateDescriptor, McpAppStateProjections, McpAppHostToolInput, McpAppHostToolName, McpAppReadToolInput, McpAppSingleActionToolInput, McpAppToolCommonInput, McpAppToolDescriptor, McpAppFixedResult, McpAppFixedResultCall, McpAppFixedResultInvalidParams, McpAppFixedResultResolution, McpAppFixedResultUnavailable, McpAppToolInput, McpAppToolMetadata, McpAppToolRegistration, McpAppToolResult, McpAppToolVisibility, McpAppInstanceResourceBinding, McpAppMcpResourceBinding, McpAppResourceBinding, McpAppLocalResource, McpAppLocalRegistrationInput, McpAppLocalReadToolDescriptor, McpAppLocalActionToolDescriptor, McpAppLocalSingleActionToolDescriptor, McpAppLocalToolDiagnostic, McpAppLocalToolDescriptor, McpAppLocalRegistration, McpAppBuiltinRegistration, McpAppResolvedRegistration, McpAppLocalLauncher, McpAppBuiltinLauncher, McpAppLauncher, WorkspaceAppLauncher, WorkspaceAppResolvedRegistration, McpAppWorkspaceRegistry, WorkspaceAppRegistry, McpAppWorkspaceRegistryInput, McpAppRegistryOptions, McpAppBundleHostToolTemplate, McpAppBundleAgentActionDescriptor, } from './types.js';
|
|
23
25
|
export { buildWorkspaceAppSnapshot, discoverWorkspaceAppSnapshot, reconfirmWorkspaceAppSnapshot, } from './workspace-snapshot.js';
|
|
24
26
|
export type { WorkspaceAppSnapshot, WorkspaceAppSnapshotBuildOptions, WorkspaceAppSnapshotOptions, WorkspaceAppSnapshotReconfirmResult, WorkspaceAppSnapshotResource, WorkspaceAppSnapshotInitialState, WorkspaceAppInitialState, } from './workspace-snapshot.js';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { JsonObject } from '../ui-instance/types.js';
|
|
1
|
+
import type { JsonObject, UiDefinition } from '../ui-instance/types.js';
|
|
2
2
|
import type { McpAppServerStateInput, McpAppStateDescriptor, McpAppStateProjections, McpAppToolDescriptor, McpAppToolResult } from './types.js';
|
|
3
3
|
export declare const MCP_APP_PROJECTION_MAX_BYTES: number;
|
|
4
4
|
export declare const SENSITIVE_KEY: RegExp;
|
|
5
|
+
export declare function projectMcpAppSummaryState(state: unknown, definition: UiDefinition): JsonObject;
|
|
5
6
|
export declare function buildMcpAppStateDescriptor(input: McpAppServerStateInput): McpAppStateDescriptor;
|
|
6
7
|
export declare function buildTerminalMcpAppStateDescriptor(input: McpAppServerStateInput): McpAppStateDescriptor;
|
|
7
8
|
export declare function serializeMcpAppStateJson(descriptor: McpAppStateDescriptor, dataPaths?: readonly string[]): string;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { WorkspaceAppCandidate } from './discovery.js';
|
|
2
|
+
import { type McpAppDescriptor, type McpAppDescriptorInput, type McpAppInputSchema, type McpAppLocalRegistration, type McpAppLocalRegistrationInput, type McpAppLocalResource, type McpAppRegistry, type McpAppResource, type McpAppWorkspaceRegistry, type McpAppWorkspaceRegistryInput, type McpAppToolDescriptor, type McpAppToolRegistration, type McpAppRegistryOptions, type McpAppBundleHostToolTemplate, type McpAppFixedResultResolution, type McpAppBundleAgentActionDescriptor } from './types.js';
|
|
2
3
|
export declare const MAX_HTML_LENGTH: number;
|
|
3
|
-
export declare function
|
|
4
|
+
export declare function resolveMcpAppFixedResultCall(tool: McpAppToolDescriptor, args: unknown): McpAppFixedResultResolution;
|
|
5
|
+
export declare function buildMcpAppBundleRegistrationInput(candidate: WorkspaceAppCandidate, options?: {
|
|
6
|
+
readonly hostTools?: readonly McpAppBundleHostToolTemplate[];
|
|
7
|
+
}): McpAppDescriptorInput;
|
|
8
|
+
export declare function buildMcpAppBundleAgentActionDescriptors(candidate: WorkspaceAppCandidate): readonly McpAppBundleAgentActionDescriptor[];
|
|
9
|
+
export declare function makeUiUri(appId: string, entry: string | Uint8Array | readonly number[]): string;
|
|
10
|
+
export declare function createMcpAppRegistry(options?: McpAppRegistryOptions): McpAppRegistry;
|
|
4
11
|
export declare function createBuiltinMcpAppRegistry(): McpAppRegistry;
|
|
5
12
|
export declare function registerMcpApp(registry: McpAppRegistry, input: McpAppDescriptorInput): McpAppDescriptor;
|
|
6
13
|
export declare function resolveMcpAppResource(registry: McpAppRegistry, uri: string): McpAppResource | null;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { JsonObject, UiExternalActionHandlerRegistration } from '../ui-instance/types.js';
|
|
2
2
|
import type { UiPluginNormalizedManifestV2 } from '../ui-plugin/types.js';
|
|
3
|
-
import type { WorkspaceAppSource } from './discovery.js';
|
|
3
|
+
import type { WorkspaceAppCandidate, WorkspaceAppSource } from './discovery.js';
|
|
4
4
|
export declare const SKILL_BACKEND_SCHEMA_VERSION: 1;
|
|
5
|
-
export declare const SKILL_BACKEND_MAX_INPUT_BYTES
|
|
6
|
-
export declare const SKILL_BACKEND_MAX_OUTPUT_BYTES
|
|
5
|
+
export declare const SKILL_BACKEND_MAX_INPUT_BYTES = 524288;
|
|
6
|
+
export declare const SKILL_BACKEND_MAX_OUTPUT_BYTES = 524288;
|
|
7
7
|
export declare const SKILL_BACKEND_DEFAULT_TIMEOUT_MS = 15000;
|
|
8
|
+
export declare const SKILL_BACKEND_INHERITED_ENV_ALLOWLIST: readonly ["CREWX_HOME", "CREWX_DB", "XDG_CONFIG_HOME"];
|
|
8
9
|
export type SkillBackendInfrastructureErrorCode = 'EXEC_DENIED' | 'EXEC_TIMEOUT' | 'EXEC_OUTPUT_INVALID' | 'EXECUTION_FAILED' | 'ACTION_IN_FLIGHT' | 'INPUT_INVALID';
|
|
9
10
|
export interface SkillBackendPayload {
|
|
10
11
|
readonly schemaVersion: typeof SKILL_BACKEND_SCHEMA_VERSION;
|
|
@@ -22,6 +23,9 @@ export type SkillBackendExecutionResponse = {
|
|
|
22
23
|
readonly result?: JsonObject;
|
|
23
24
|
};
|
|
24
25
|
export interface SkillBackendExecutionRequest {
|
|
26
|
+
readonly requestId?: string;
|
|
27
|
+
readonly reservationNowMs?: number;
|
|
28
|
+
readonly actorKind?: 'user' | 'agent';
|
|
25
29
|
readonly instanceId: string;
|
|
26
30
|
readonly appId: string;
|
|
27
31
|
readonly definitionId: string;
|
|
@@ -36,6 +40,38 @@ export interface SkillBackendExecutionRequest {
|
|
|
36
40
|
export interface SkillBackendExecutionPort {
|
|
37
41
|
execute(request: SkillBackendExecutionRequest): PromiseLike<SkillBackendExecutionResponse>;
|
|
38
42
|
}
|
|
43
|
+
export interface SkillBackendChildEnvironment {
|
|
44
|
+
readonly CREWX_APP_REQUEST_ID: string;
|
|
45
|
+
readonly CREWX_APP_NOW_MS: string;
|
|
46
|
+
readonly CREWX_APP_ACTOR_KIND: 'user' | 'agent';
|
|
47
|
+
}
|
|
48
|
+
export declare function buildSkillBackendChildEnvironment(request: Pick<SkillBackendExecutionRequest, 'requestId' | 'reservationNowMs' | 'actorKind'>): SkillBackendChildEnvironment;
|
|
49
|
+
export interface VerifiedBundleSkillSpawnRequest {
|
|
50
|
+
readonly appId: string;
|
|
51
|
+
readonly packageDir: string;
|
|
52
|
+
readonly packageCwd: string;
|
|
53
|
+
readonly executableRelativePath: string;
|
|
54
|
+
readonly command: readonly string[];
|
|
55
|
+
readonly payload: SkillBackendPayload;
|
|
56
|
+
readonly childEnvironment: SkillBackendChildEnvironment;
|
|
57
|
+
readonly inheritedEnvAllowlist: typeof SKILL_BACKEND_INHERITED_ENV_ALLOWLIST;
|
|
58
|
+
readonly requestId: string;
|
|
59
|
+
}
|
|
60
|
+
export interface VerifiedBundleSkillRunnerPort {
|
|
61
|
+
hashExecutable(input: {
|
|
62
|
+
readonly packageCwd: string;
|
|
63
|
+
readonly executableRelativePath: string;
|
|
64
|
+
}): PromiseLike<string>;
|
|
65
|
+
spawn(input: VerifiedBundleSkillSpawnRequest): PromiseLike<SkillBackendExecutionResponse>;
|
|
66
|
+
}
|
|
67
|
+
export interface VerifiedBundleSkillBackendBuildInput {
|
|
68
|
+
readonly normalized: UiPluginNormalizedManifestV2;
|
|
69
|
+
readonly actionId: string;
|
|
70
|
+
readonly candidate: WorkspaceAppCandidate;
|
|
71
|
+
readonly packageCwd: string;
|
|
72
|
+
readonly executableRelativePath: string;
|
|
73
|
+
readonly runner: VerifiedBundleSkillRunnerPort;
|
|
74
|
+
}
|
|
39
75
|
export interface SkillBackendHandlerBuildInput {
|
|
40
76
|
readonly normalized: UiPluginNormalizedManifestV2;
|
|
41
77
|
readonly actionId: string;
|
|
@@ -46,3 +82,4 @@ export interface SkillBackendHandlerBuildInput {
|
|
|
46
82
|
}
|
|
47
83
|
export declare function buildSkillBackendHandler(normalized: UiPluginNormalizedManifestV2, actionId: string, source: WorkspaceAppSource, relativePath: string, execute: SkillBackendExecutionPort): UiExternalActionHandlerRegistration | undefined;
|
|
48
84
|
export declare function buildSkillBackendHandler(input: SkillBackendHandlerBuildInput): UiExternalActionHandlerRegistration | undefined;
|
|
85
|
+
export declare function buildVerifiedBundleSkillBackendHandler(input: VerifiedBundleSkillBackendBuildInput): UiExternalActionHandlerRegistration | undefined;
|
package/dist/mcp-app/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JsonObject, UiDefinition, UiDefinitionRef, UiDefinitionDisplayMode, UiDefinitionUsage, UiInstance, UiInstanceStatus, UiActionConfirmation, UiActionHandlerRegistration } from '../ui-instance/types.js';
|
|
2
|
-
import type { AppDiscoveryFileSystem } from './discovery.js';
|
|
2
|
+
import type { AppDiscoveryFileSystem, ProductAppBundleInput, ProductAppBundleProvenance } from './discovery.js';
|
|
3
3
|
export declare const MCP_APP_RESOURCE_MIME_TYPE: "text/html;profile=mcp-app";
|
|
4
4
|
export declare const MCP_APP_RESOURCE_URI_PREFIX = "ui://crewx/";
|
|
5
5
|
export type McpAppToolVisibility = 'model' | 'app';
|
|
@@ -23,6 +23,11 @@ export interface McpAppToolCommonInput {
|
|
|
23
23
|
export interface McpAppReadToolInput extends McpAppToolCommonInput {
|
|
24
24
|
readonly kind: 'read';
|
|
25
25
|
readonly actionId?: never;
|
|
26
|
+
readonly fixedResult?: McpAppFixedResult;
|
|
27
|
+
}
|
|
28
|
+
export interface McpAppFixedResult {
|
|
29
|
+
readonly structuredContent: JsonObject;
|
|
30
|
+
readonly argsPolicy: 'empty-only' | 'ignore';
|
|
26
31
|
}
|
|
27
32
|
export interface McpAppSingleActionToolInput extends McpAppToolCommonInput {
|
|
28
33
|
readonly kind: 'action';
|
|
@@ -41,6 +46,8 @@ export type McpAppActionToolDescriptor = (Omit<McpAppSingleActionToolInput, 'act
|
|
|
41
46
|
readonly actionIds: readonly string[];
|
|
42
47
|
});
|
|
43
48
|
type McpAppToolDescriptorMetadata = {
|
|
49
|
+
readonly appId?: string;
|
|
50
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
44
51
|
readonly resourceUri: string;
|
|
45
52
|
readonly _meta: McpAppToolMetadata;
|
|
46
53
|
};
|
|
@@ -62,6 +69,8 @@ export interface McpAppDescriptorInput {
|
|
|
62
69
|
readonly csp?: McpUiResourceCsp;
|
|
63
70
|
readonly tools: readonly McpAppToolInput[];
|
|
64
71
|
readonly definition?: UiDefinition;
|
|
72
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
73
|
+
readonly entryBytes?: Uint8Array | readonly number[];
|
|
65
74
|
}
|
|
66
75
|
export interface McpAppResource {
|
|
67
76
|
readonly uri: string;
|
|
@@ -184,6 +193,7 @@ export interface McpAppLocalLauncher {
|
|
|
184
193
|
readonly tone?: McpAppTone;
|
|
185
194
|
readonly builtinOnly: false;
|
|
186
195
|
readonly definition: UiDefinitionRef;
|
|
196
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
187
197
|
readonly entryHash: string;
|
|
188
198
|
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
189
199
|
readonly tools: readonly McpAppLocalToolDescriptor[];
|
|
@@ -255,8 +265,22 @@ export interface McpAppDescriptor {
|
|
|
255
265
|
readonly uiUri: string;
|
|
256
266
|
readonly html: string;
|
|
257
267
|
readonly definition?: UiDefinition;
|
|
268
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
258
269
|
readonly tools: readonly McpAppToolDescriptor[];
|
|
259
270
|
}
|
|
271
|
+
export interface McpAppFixedResultCall {
|
|
272
|
+
readonly kind: 'result';
|
|
273
|
+
readonly result: McpAppToolResult;
|
|
274
|
+
}
|
|
275
|
+
export interface McpAppFixedResultInvalidParams {
|
|
276
|
+
readonly kind: 'invalid_params';
|
|
277
|
+
readonly code: 'INVALID_PARAMS';
|
|
278
|
+
readonly message: string;
|
|
279
|
+
}
|
|
280
|
+
export interface McpAppFixedResultUnavailable {
|
|
281
|
+
readonly kind: 'unavailable';
|
|
282
|
+
}
|
|
283
|
+
export type McpAppFixedResultResolution = McpAppFixedResultCall | McpAppFixedResultInvalidParams | McpAppFixedResultUnavailable;
|
|
260
284
|
export interface McpAppToolResult {
|
|
261
285
|
readonly content: readonly [{
|
|
262
286
|
readonly type: 'text';
|
|
@@ -328,6 +352,29 @@ export interface McpAppRegistry {
|
|
|
328
352
|
resolveMcpAppResource(uri: string): McpAppResource | null;
|
|
329
353
|
requireMcpAppResource(uri: string): McpAppResource;
|
|
330
354
|
}
|
|
355
|
+
export interface McpAppRegistryOptions {
|
|
356
|
+
readonly reservedToolNames?: Iterable<string>;
|
|
357
|
+
}
|
|
358
|
+
export interface McpAppBundleHostToolTemplate {
|
|
359
|
+
readonly capability: string;
|
|
360
|
+
readonly description: string;
|
|
361
|
+
readonly inputSchema: McpAppInputSchema;
|
|
362
|
+
readonly textFallback: string;
|
|
363
|
+
}
|
|
364
|
+
export interface McpAppBundleAgentActionDescriptor {
|
|
365
|
+
readonly appId: string;
|
|
366
|
+
readonly provenance: ProductAppBundleProvenance;
|
|
367
|
+
readonly name: string;
|
|
368
|
+
readonly description: string;
|
|
369
|
+
readonly inputSchema: McpAppInputSchema;
|
|
370
|
+
readonly textFallback: string;
|
|
371
|
+
readonly kind: 'action';
|
|
372
|
+
readonly actionId: string;
|
|
373
|
+
readonly access: 'allowed' | 'approval_required' | 'denied';
|
|
374
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
375
|
+
readonly resourceUri: string;
|
|
376
|
+
readonly _meta: McpAppToolMetadata;
|
|
377
|
+
}
|
|
331
378
|
export type CrewxAppCapability = 'screen' | 'skill';
|
|
332
379
|
export type CrewxAppOrigin = 'local' | 'installed' | 'builtin';
|
|
333
380
|
export type CrewxAppOwnership = 'mine' | 'external' | 'unknown';
|
|
@@ -363,9 +410,10 @@ export interface CrewxAppSummary {
|
|
|
363
410
|
readonly marketplaceContentId?: string;
|
|
364
411
|
readonly slug?: string;
|
|
365
412
|
readonly definitionHash: string;
|
|
413
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
366
414
|
}
|
|
367
|
-
export type CrewxAppDiagnosticCode = 'MANIFEST_MISSING' | 'MANIFEST_INVALID' | 'ENTRY_INVALID' | 'INITIAL_STATE_INVALID' | 'DUPLICATE_ID' | 'RESERVED_ID' | 'PATH_ESCAPED' | 'LIMIT_EXCEEDED' | 'EXEC_DENIED' | 'SKILL_INVALID' | 'SKILL_READ_FAILED' | 'INSTALLED_MISSING' | 'INSTALLED_CONTENT_ID_MISSING' | 'INSTALLED_IDENTITY_MISMATCH' | 'BUILTIN_INVALID';
|
|
368
|
-
export type CrewxAppDiagnosticSource = 'apps' | 'skills' | 'node_modules' | 'builtin' | 'installed';
|
|
415
|
+
export type CrewxAppDiagnosticCode = 'MANIFEST_MISSING' | 'MANIFEST_INVALID' | 'ENTRY_INVALID' | 'INITIAL_STATE_INVALID' | 'DUPLICATE_ID' | 'RESERVED_ID' | 'BUNDLE_INTEGRITY' | 'LINEAGE_INVALID' | 'LINEAGE_STALE' | 'PATH_ESCAPED' | 'LIMIT_EXCEEDED' | 'EXEC_DENIED' | 'SKILL_INVALID' | 'SKILL_READ_FAILED' | 'INSTALLED_MISSING' | 'INSTALLED_CONTENT_ID_MISSING' | 'INSTALLED_IDENTITY_MISMATCH' | 'BUILTIN_INVALID';
|
|
416
|
+
export type CrewxAppDiagnosticSource = 'apps' | 'skills' | 'bundled' | 'node_modules' | 'builtin' | 'installed';
|
|
369
417
|
export interface CrewxAppDiagnostic {
|
|
370
418
|
readonly code: CrewxAppDiagnosticCode;
|
|
371
419
|
readonly source: CrewxAppDiagnosticSource;
|
|
@@ -384,6 +432,7 @@ export interface CrewxAppInstalledProjection {
|
|
|
384
432
|
export type CrewxAppBuiltinCatalog = Pick<McpAppRegistry, 'listMcpApps' | 'listMcpAppTools'>;
|
|
385
433
|
export interface CrewxAppCatalogOptions {
|
|
386
434
|
readonly filesystem?: AppDiscoveryFileSystem;
|
|
435
|
+
readonly productBundle?: ProductAppBundleInput;
|
|
387
436
|
readonly builtinCatalog?: CrewxAppBuiltinCatalog;
|
|
388
437
|
readonly installed?: readonly CrewxAppInstalledProjection[];
|
|
389
438
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { type AppDiscoveryFileSystem, type WorkspaceAppDiscoveryIncompleteReason, type WorkspaceAppDiagnostic, type WorkspaceAppDiscoveryOptions, type WorkspaceAppDiscoveryResult, type WorkspaceAppSource } from './discovery.js';
|
|
1
|
+
import { type AppDiscoveryFileSystem, type WorkspaceAppDiscoveryIncompleteReason, type WorkspaceAppDiagnostic, type WorkspaceAppDiscoveryOptions, type WorkspaceAppDiscoveryResult, type WorkspaceAppSource, type ProductAppBundleProvenance } from './discovery.js';
|
|
2
2
|
import { type SkillBackendExecutionPort } from './skill-backend.js';
|
|
3
3
|
import type { JsonObject, UiActionHandlerRegistration, UiDefinition, UiDefinitionRef } from '../ui-instance/types.js';
|
|
4
4
|
import type { McpAppLauncher, McpAppLocalResource, McpAppRegistry, McpAppWorkspaceRegistry } from './types.js';
|
|
5
5
|
export interface WorkspaceAppSnapshotResource extends McpAppLocalResource {
|
|
6
6
|
readonly appId: string;
|
|
7
7
|
readonly definition: UiDefinitionRef;
|
|
8
|
-
readonly source
|
|
8
|
+
readonly source?: WorkspaceAppSource;
|
|
9
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
9
10
|
}
|
|
10
11
|
export interface WorkspaceAppSnapshotInitialState {
|
|
11
12
|
readonly appId: string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS `ui_instance_repins` (
|
|
2
|
+
`instance_id` text NOT NULL,
|
|
3
|
+
`from_version` integer NOT NULL,
|
|
4
|
+
`from_hash` text NOT NULL,
|
|
5
|
+
`to_version` integer NOT NULL,
|
|
6
|
+
`to_hash` text NOT NULL,
|
|
7
|
+
`from_revision` integer NOT NULL,
|
|
8
|
+
`to_revision` integer,
|
|
9
|
+
`status` text NOT NULL,
|
|
10
|
+
`code` text,
|
|
11
|
+
`attempts` integer DEFAULT 1 NOT NULL,
|
|
12
|
+
`first_at` integer NOT NULL,
|
|
13
|
+
`last_at` integer NOT NULL,
|
|
14
|
+
PRIMARY KEY(`instance_id`, `to_hash`),
|
|
15
|
+
CONSTRAINT "ui_instance_repins_instance_id_ck" CHECK(length("ui_instance_repins"."instance_id") BETWEEN 5 AND 128 AND "ui_instance_repins"."instance_id" GLOB 'uic_*'),
|
|
16
|
+
CONSTRAINT "ui_instance_repins_from_version_ck" CHECK("ui_instance_repins"."from_version" >= 1),
|
|
17
|
+
CONSTRAINT "ui_instance_repins_to_version_ck" CHECK("ui_instance_repins"."to_version" >= 1),
|
|
18
|
+
CONSTRAINT "ui_instance_repins_from_hash_ck" CHECK(length("ui_instance_repins"."from_hash") = 64 AND "ui_instance_repins"."from_hash" NOT GLOB '*[^0-9a-f]*'),
|
|
19
|
+
CONSTRAINT "ui_instance_repins_to_hash_ck" CHECK(length("ui_instance_repins"."to_hash") = 64 AND "ui_instance_repins"."to_hash" NOT GLOB '*[^0-9a-f]*'),
|
|
20
|
+
CONSTRAINT "ui_instance_repins_from_revision_ck" CHECK("ui_instance_repins"."from_revision" >= 0),
|
|
21
|
+
CONSTRAINT "ui_instance_repins_to_revision_ck" CHECK("ui_instance_repins"."to_revision" IS NULL OR "ui_instance_repins"."to_revision" >= 0),
|
|
22
|
+
CONSTRAINT "ui_instance_repins_status_ck" CHECK("ui_instance_repins"."status" IN ('applied', 'deferred', 'failed')),
|
|
23
|
+
CONSTRAINT "ui_instance_repins_attempts_ck" CHECK("ui_instance_repins"."attempts" >= 1),
|
|
24
|
+
CONSTRAINT "ui_instance_repins_dates_ck" CHECK("ui_instance_repins"."first_at" >= 0 AND "ui_instance_repins"."last_at" >= "ui_instance_repins"."first_at"),
|
|
25
|
+
CONSTRAINT "ui_instance_repins_result_ck" CHECK((
|
|
26
|
+
("ui_instance_repins"."status" = 'applied' AND "ui_instance_repins"."code" IS NULL
|
|
27
|
+
AND "ui_instance_repins"."to_revision" = "ui_instance_repins"."from_revision" + 1)
|
|
28
|
+
OR
|
|
29
|
+
("ui_instance_repins"."status" IN ('deferred', 'failed') AND "ui_instance_repins"."code" IS NOT NULL
|
|
30
|
+
AND "ui_instance_repins"."to_revision" IS NULL)
|
|
31
|
+
))
|
|
32
|
+
);
|
|
33
|
+
--> statement-breakpoint
|
|
34
|
+
ALTER TABLE `ui_action_receipts` ADD `definition_id` text;--> statement-breakpoint
|
|
35
|
+
ALTER TABLE `ui_action_receipts` ADD `definition_version` integer;--> statement-breakpoint
|
|
36
|
+
ALTER TABLE `ui_action_receipts` ADD `definition_hash` text;
|