@crewx/sdk 0.9.0-rc.140 → 0.9.0-rc.142
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/app/app.d.ts +49 -1
- package/dist/app/content-media-types.d.ts +2 -0
- package/dist/app/context.d.ts +2 -0
- package/dist/app/frame.d.ts +56 -0
- package/dist/app/index.d.ts +4 -2
- package/dist/app/index.js +10 -9
- package/dist/app/protocol.d.ts +9 -0
- package/dist/app/runtime.d.ts +4 -2
- package/dist/app/tool-mode.d.ts +3 -0
- package/dist/esm/app/index.js +10 -9
- package/dist/esm/index.js +321 -288
- package/dist/esm/plugins/index.js +56 -56
- package/dist/esm/publish/index.js +2 -2
- package/dist/esm/repository/index.js +78 -78
- package/dist/esm/skills/index.js +2 -2
- package/dist/index.browser.js +3 -3
- package/dist/index.d.ts +5 -4
- package/dist/index.js +322 -289
- package/dist/mcp-app/content-channel.d.ts +3 -6
- package/dist/mcp-app/content-declarations.d.ts +4 -2
- package/dist/mcp-app/skill-backend.d.ts +3 -4
- package/dist/migrations/0036_ui_definition_archive.sql +8 -0
- package/dist/migrations/meta/0036_snapshot.json +3591 -0
- package/dist/migrations/meta/_journal.json +7 -0
- package/dist/plugins/index.js +55 -55
- package/dist/publish/index.js +2 -2
- package/dist/repository/index.js +74 -74
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/ui-definition-archive.d.ts +63 -0
- package/dist/skills/index.js +2 -2
- package/dist/ui-instance/index.d.ts +3 -3
- package/dist/ui-instance/lineage.d.ts +2 -0
- package/dist/ui-instance/store.d.ts +14 -0
- package/dist/ui-plugin/app-manifest.d.ts +7 -2
- package/dist/ui-plugin/index.d.ts +2 -2
- package/dist/ui-plugin/types.d.ts +10 -1
- package/package.json +1 -1
|
@@ -4,8 +4,8 @@ export { UiRuntimeError } from './errors.js';
|
|
|
4
4
|
export type { UiRuntimeErrorCode } from './errors.js';
|
|
5
5
|
export { projectSafeJsonObject, redactJsonPaths } from './json.js';
|
|
6
6
|
export { hashUiDefinition } from './definition.js';
|
|
7
|
-
export { hasUiDefinitionLineageBreak, selectUiDefinitionLineageEntry, UiDefinitionLineageError, validateUiDefinitionLineage, } from './lineage.js';
|
|
7
|
+
export { hasUiDefinitionLineageBreak, selectUiDefinitionLineageEntry, UiDefinitionLineageError, uiDefinitionStaticCompatibilityViolations, validateUiDefinitionLineage, } from './lineage.js';
|
|
8
8
|
export type { UiDefinitionLineageEntry, UiDefinitionLineageFailureCode, ValidatedUiDefinitionLineage, } from './lineage.js';
|
|
9
|
-
export { UiInstanceStore, openUiInstanceReadStore } from './store.js';
|
|
10
|
-
export type { UiAuditSnapshotInput, UiInstanceReadStore, UiInstanceRepinInput, UiInstanceRepinLedgerEntry, UiInstanceRepinResult, UiInstanceRepinWorkspaceInput, ReservationInput, } from './store.js';
|
|
9
|
+
export { UiInstanceStore, WORKSPACE_REPIN_ENV, isWorkspaceRepinEnabled, openUiInstanceReadStore } from './store.js';
|
|
10
|
+
export type { UiAuditSnapshotInput, UiInstanceReadStore, UiInstanceRepinInput, UiInstanceRepinLedgerEntry, UiInstanceRepinResult, UiInstanceRepinWorkspaceGenerationInput, UiInstanceRepinWorkspaceInput, ReservationInput, } from './store.js';
|
|
11
11
|
export { createUiRuntimeForTest, createUiServerRuntime } from './runtime.js';
|
|
@@ -17,6 +17,8 @@ export declare class UiDefinitionLineageError extends Error {
|
|
|
17
17
|
readonly name = "UiDefinitionLineageError";
|
|
18
18
|
constructor(code: UiDefinitionLineageFailureCode, message?: string, violations?: readonly string[]);
|
|
19
19
|
}
|
|
20
|
+
export declare function parseUiDefinitionInput(value: unknown): UiDefinitionInput;
|
|
21
|
+
export declare function uiDefinitionStaticCompatibilityViolations(previous: UiDefinitionInput, current: UiDefinitionInput): string[];
|
|
20
22
|
export declare function validateUiDefinitionLineage(entriesValue: unknown, currentValue: unknown): ValidatedUiDefinitionLineage;
|
|
21
23
|
export declare function selectUiDefinitionLineageEntry(entries: unknown, current: unknown, selected: UiDefinitionRef): UiDefinition;
|
|
22
24
|
export declare function hasUiDefinitionLineageBreak(lineage: ValidatedUiDefinitionLineage, from: UiDefinitionRef, to?: UiDefinitionRef): boolean;
|
|
@@ -6,6 +6,7 @@ interface UiInstanceStoreTestHooks {
|
|
|
6
6
|
bumpRevisionBeforeCas?: boolean;
|
|
7
7
|
beforeOpenRead?: () => void;
|
|
8
8
|
bumpRevisionBeforeRepinCas?: boolean;
|
|
9
|
+
afterRepinGenerationRead?: () => void;
|
|
9
10
|
}
|
|
10
11
|
export interface ReservationInput {
|
|
11
12
|
instanceId: string;
|
|
@@ -31,6 +32,15 @@ export interface UiInstanceRepinInput {
|
|
|
31
32
|
readonly now: number;
|
|
32
33
|
}
|
|
33
34
|
export type UiInstanceRepinWorkspaceInput = Omit<UiInstanceRepinInput, 'instanceId' | 'observedRevision'>;
|
|
35
|
+
export interface UiInstanceRepinWorkspaceGenerationInput {
|
|
36
|
+
readonly workspaceId: string;
|
|
37
|
+
readonly appId: string;
|
|
38
|
+
readonly currentDefinition: UiDefinition;
|
|
39
|
+
readonly hasSkillActions: boolean;
|
|
40
|
+
readonly now: number;
|
|
41
|
+
}
|
|
42
|
+
export declare const WORKSPACE_REPIN_ENV = "CREWX_APP_WORKSPACE_REPIN";
|
|
43
|
+
export declare function isWorkspaceRepinEnabled(env?: Readonly<Record<string, string | undefined>>): boolean;
|
|
34
44
|
export interface UiInstanceRepinLedgerEntry {
|
|
35
45
|
readonly instanceId: string;
|
|
36
46
|
readonly fromVersion: number;
|
|
@@ -113,6 +123,10 @@ export declare class UiInstanceStore {
|
|
|
113
123
|
close(): void;
|
|
114
124
|
repinInstance(input: UiInstanceRepinInput): UiInstanceRepinResult | null;
|
|
115
125
|
repinWorkspaceApp(input: UiInstanceRepinWorkspaceInput): UiInstanceRepinResult[];
|
|
126
|
+
archiveDefinition(definition: UiDefinition, now: number): void;
|
|
127
|
+
getArchivedDefinition(definitionHash: string): UiDefinition | null;
|
|
128
|
+
repinWorkspaceGeneration(input: UiInstanceRepinWorkspaceGenerationInput): UiInstanceRepinResult[];
|
|
129
|
+
private repinGenerationRow;
|
|
116
130
|
getRepinLedgerEntry(instanceId: string, workspaceId: string, appId: string, toHash: string): UiInstanceRepinLedgerEntry | null;
|
|
117
131
|
listRepinLedgerEntries(workspaceId: string, appId: string, toHash: string): UiInstanceRepinLedgerEntry[];
|
|
118
132
|
private writeRepinLedger;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { JsonValue } from '../ui-instance/types.js';
|
|
2
|
+
import { APP_TOOLS_FILE } from '../app/tool-mode.js';
|
|
2
3
|
import type { UiPluginManifestMode, UiPluginManifestV2, UiPluginValidationErrorCode } from './types.js';
|
|
3
4
|
export declare const APP_MANIFEST_FILE = "manifest.json";
|
|
4
5
|
export declare const LEGACY_APP_MANIFEST_FILE = "ui-plugin.json";
|
|
5
6
|
export declare const APP_MANIFEST_FILES: readonly ["manifest.json", "ui-plugin.json"];
|
|
6
7
|
export type AppManifestFileName = (typeof APP_MANIFEST_FILES)[number];
|
|
8
|
+
export { APP_TOOLS_FILE };
|
|
9
|
+
export type AppToolsFileName = typeof APP_TOOLS_FILE;
|
|
7
10
|
export declare const MCPB_MANIFEST_VERSION = "0.3";
|
|
8
11
|
export declare const CREWX_META_NAMESPACE = "dev.crewx";
|
|
9
12
|
export declare const MCPB_MANIFEST_KEYS: readonly ["manifest_version", "name", "display_name", "version", "description", "long_description", "author", "repository", "homepage", "documentation", "support", "icon", "icons", "screenshots", "localization", "server", "tools", "tools_generated", "prompts", "prompts_generated", "keywords", "license", "privacy_policies", "compatibility", "user_config", "_meta"];
|
|
@@ -16,7 +19,7 @@ export interface AppManifestReason {
|
|
|
16
19
|
readonly path: string;
|
|
17
20
|
readonly rule: string;
|
|
18
21
|
readonly message?: string;
|
|
19
|
-
readonly file?: AppManifestFileName;
|
|
22
|
+
readonly file?: AppManifestFileName | AppToolsFileName;
|
|
20
23
|
}
|
|
21
24
|
export type AppManifestRejectionCode = UiPluginValidationErrorCode | 'MANIFEST_DUAL_MISMATCH';
|
|
22
25
|
export interface AppManifestRejection {
|
|
@@ -53,7 +56,9 @@ export interface AppManifestOptions {
|
|
|
53
56
|
readonly mode?: UiPluginManifestMode;
|
|
54
57
|
readonly maxBytes?: number;
|
|
55
58
|
}
|
|
56
|
-
export type AppManifestFileBytes = Partial<Record<AppManifestFileName, Uint8Array
|
|
59
|
+
export type AppManifestFileBytes = Partial<Record<AppManifestFileName, Uint8Array>> & {
|
|
60
|
+
[APP_TOOLS_FILE]?: Uint8Array;
|
|
61
|
+
};
|
|
57
62
|
export declare function claimsCrewxNamespace(bytes: Uint8Array): boolean;
|
|
58
63
|
export declare function appManifestDefinitionHash(manifest: UiPluginManifestV2): string;
|
|
59
64
|
export declare function resolveAppManifest(files: AppManifestFileBytes, options?: AppManifestOptions): AppManifestResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { canonicalManifestJson, manifestHash } from './manifest.js';
|
|
2
|
-
export { APP_MANIFEST_FILE, APP_MANIFEST_FILES, APP_MANIFEST_PASSTHROUGH_KEYS, APP_MANIFEST_REQUIRED_KEYS, CREWX_META_NAMESPACE, CREWX_META_OPTIONAL_KEYS, CREWX_META_REQUIRED_KEYS, LEGACY_APP_MANIFEST_FILE, MCPB_MANIFEST_KEYS, MCPB_MANIFEST_VERSION, appManifestDefinitionHash, claimsCrewxNamespace, isAppSemver, resolveAppManifest, } from './app-manifest.js';
|
|
3
|
-
export type { AppManifestFailure, AppManifestFileBytes, AppManifestFileName, AppManifestFileResult, AppManifestIdentity, AppManifestOptions, AppManifestReason, AppManifestRejection, AppManifestRejectionCode, AppManifestResult, AppManifestSource, } from './app-manifest.js';
|
|
2
|
+
export { APP_MANIFEST_FILE, APP_MANIFEST_FILES, APP_MANIFEST_PASSTHROUGH_KEYS, APP_MANIFEST_REQUIRED_KEYS, CREWX_META_NAMESPACE, CREWX_META_OPTIONAL_KEYS, CREWX_META_REQUIRED_KEYS, LEGACY_APP_MANIFEST_FILE, MCPB_MANIFEST_KEYS, MCPB_MANIFEST_VERSION, appManifestDefinitionHash, APP_TOOLS_FILE, claimsCrewxNamespace, isAppSemver, resolveAppManifest, } from './app-manifest.js';
|
|
3
|
+
export type { AppManifestFailure, AppManifestFileBytes, AppManifestFileName, AppManifestFileResult, AppManifestIdentity, AppManifestOptions, AppManifestReason, AppManifestRejection, AppManifestRejectionCode, AppManifestResult, AppManifestSource, AppToolsFileName, } from './app-manifest.js';
|
|
4
4
|
export { UiPluginValidationError, normalizeManifest, validateInitialState, validateManifest, validatePayload, } from './validator.js';
|
|
5
5
|
export { UI_PLUGIN_CAPABILITY_PATTERN, UI_PLUGIN_HANDLER_PATTERN, UI_PLUGIN_IDENTIFIER_PATTERN, UI_PLUGIN_MAX_ACTIONS, UI_PLUGIN_MAX_ARRAY_LENGTH, UI_PLUGIN_MAX_CANDIDATE_DEPTH, UI_PLUGIN_MAX_COMMAND_LENGTH, UI_PLUGIN_MAX_COMMAND_PARTS, UI_PLUGIN_MAX_DISCOVERED_APPS, UI_PLUGIN_MAX_DISCOVERY_TIME_MS, UI_PLUGIN_MAX_HEIGHT, UI_PLUGIN_MAX_INITIAL_STATE_BYTES, UI_PLUGIN_MAX_JSON_DEPTH, UI_PLUGIN_MAX_MANIFEST_BYTES, UI_PLUGIN_MAX_PROJECTION_PATHS, UI_PLUGIN_MAX_SCHEMA_DEPTH, UI_PLUGIN_MAX_SCHEMA_PROPERTIES, UI_PLUGIN_MAX_STRING_LENGTH, UI_PLUGIN_MAX_SUBTREE_BYTES, UI_PLUGIN_MAX_SURFACES, UI_PLUGIN_RESERVED_STATE_KEYS, UI_PLUGIN_SAFE_PATH_PATTERN, UI_PLUGIN_SAFE_PATH_SEGMENT_PATTERN, UI_PLUGIN_SKILL_TOKEN_PATTERN, UI_PLUGIN_SURFACES, UI_PLUGIN_TONES, isUiPluginReservedStateKey, } from './limits.js';
|
|
6
6
|
export type { UiPluginActivation, UiPluginAction, UiPluginBackend, UiPluginCardShellNode, UiPluginCoreBackend, UiPluginFieldSchema, UiPluginHeadingNode, UiPluginInputSchema, UiPluginJsonSchema, UiPluginJsonSchemaType, UiPluginLabeledTextNode, UiPluginLayoutNode, UiPluginLayout, UiPluginManifest, UiPluginManifestMode, UiPluginManifestV1, UiPluginManifestV2, UiPluginCspRequest, UiPluginRuntimeRequest, UiPluginMetaBannerNode, UiPluginNormalizedManifestV2, UiPluginNormalizedV2, UiPluginPayload, UiPluginPayloadValue, UiPluginPrimitive, UiPluginProjectionPolicy, UiPluginResourceMetadata, UiPluginResourceRef, UiPluginSchemaType, UiPluginSchema, UiPluginSize, UiPluginSkillBackend, UiPluginStep, UiPluginStepFlowNode, UiPluginStepListSchema, UiPluginTextListNode, UiPluginTextListSchema, UiPluginTextSchema, UiPluginSurface, UiPluginTone, UiPluginHandlerMetadata, UiPluginValidationErrorCode, UiPluginValidationOptions, } from './types.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { JsonObject, JsonValue, UiActionConfirmation, UiDefinitionInput } from '../ui-instance/types.js';
|
|
2
|
+
import type { APP_TOOL_ENTRY } from '../app/tool-mode.js';
|
|
2
3
|
import type { UiSkillBackendEnvironmentKey } from '../ui-instance/types.js';
|
|
3
4
|
import type { UiActionContentDeclaration } from '../mcp-app/content-channel.js';
|
|
4
5
|
export type UiPluginPrimitive = 'card-shell' | 'meta-banner' | 'heading' | 'labeled-text' | 'step-flow' | 'text-list';
|
|
@@ -98,11 +99,19 @@ export interface UiPluginCoreBackend {
|
|
|
98
99
|
readonly type: 'core';
|
|
99
100
|
readonly handler: string;
|
|
100
101
|
}
|
|
101
|
-
export interface
|
|
102
|
+
export interface UiPluginSkillCommandBackend {
|
|
102
103
|
readonly type: 'skill';
|
|
103
104
|
readonly command: readonly string[];
|
|
105
|
+
readonly entry?: never;
|
|
104
106
|
readonly env?: readonly UiSkillBackendEnvironmentKey[];
|
|
105
107
|
}
|
|
108
|
+
export interface UiPluginSkillEntryBackend {
|
|
109
|
+
readonly type: 'skill';
|
|
110
|
+
readonly entry: typeof APP_TOOL_ENTRY;
|
|
111
|
+
readonly command?: never;
|
|
112
|
+
readonly env?: never;
|
|
113
|
+
}
|
|
114
|
+
export type UiPluginSkillBackend = UiPluginSkillCommandBackend | UiPluginSkillEntryBackend;
|
|
106
115
|
export type UiPluginBackend = UiPluginCoreBackend | UiPluginSkillBackend;
|
|
107
116
|
export interface UiPluginAction {
|
|
108
117
|
readonly actionId: string;
|