@crewx/sdk 0.9.0-rc.136 → 0.9.0-rc.138

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.
@@ -2,5 +2,19 @@ import type { McpAppStateDescriptor } from './types.js';
2
2
  import type { McpAppModelContext } from './model-context.js';
3
3
  export interface McpAppsContext {
4
4
  readonly rendered: string;
5
+ readonly guidanceRendered?: string;
6
+ readonly available?: ReadonlyArray<{
7
+ readonly id: string;
8
+ readonly name: string;
9
+ readonly description: string;
10
+ readonly agent: 'direct' | 'approval' | 'none';
11
+ }>;
12
+ readonly availableRendered?: string;
5
13
  }
6
- export declare function buildMcpAppsContext(descriptors: readonly McpAppStateDescriptor[] | undefined, modelContext?: McpAppModelContext): McpAppsContext | undefined;
14
+ export interface McpAppsContextOptions {
15
+ readonly cli?: string;
16
+ readonly available?: McpAppsContext['available'];
17
+ }
18
+ export declare const MCP_APPS_AVAILABLE_MAX_BYTES: number;
19
+ export declare function buildMcpAppsContext(descriptors: readonly McpAppStateDescriptor[] | undefined, modelContext?: McpAppModelContext, optionsOrAvailable?: McpAppsContextOptions | McpAppsContext['available']): McpAppsContext | undefined;
20
+ export declare function attachAvailableApps(context: McpAppsContext | undefined, available: McpAppsContext['available'], cli?: string): McpAppsContext | undefined;
@@ -0,0 +1,3 @@
1
+ import type { AppManifestFileName, AppManifestReason } from '../ui-plugin/app-manifest.js';
2
+ export declare function projectAppManifestReason(value: unknown): AppManifestReason | undefined;
3
+ export declare function projectAppManifestFiles(value: unknown): readonly AppManifestFileName[] | undefined;
@@ -1,5 +1,6 @@
1
1
  import type { UiDefinitionLineageEntry } from '../ui-instance/lineage.js';
2
- import type { JsonObject, UiDefinition } from '../ui-instance/types.js';
2
+ import type { JsonObject, JsonValue, UiDefinition } from '../ui-instance/types.js';
3
+ import type { AppManifestFileName, AppManifestReason } from '../ui-plugin/index.js';
3
4
  import type { UiPluginHandlerMetadata, UiPluginManifestV2, UiPluginNormalizedManifestV2 } from '../ui-plugin/types.js';
4
5
  import { createWorkspaceAppScanCache, type WorkspaceAppScanCache, type WorkspaceAppScanRootIdentity } from './workspace-app-scan-cache.js';
5
6
  import { AppDiscoveryFsError, NodeAppDiscoveryFs, NodeAppDiscoveryFsAdapter, defaultAppDiscoveryFs, defaultNodeAppDiscoveryFs, type AppDiscoveryFsErrorCode } from './node-app-discovery-fs.js';
@@ -18,12 +19,14 @@ export interface ProductAppBundleProvenance extends LoadedProductAppBundleProven
18
19
  readonly files: readonly ProductAppBundleFileHash[];
19
20
  }
20
21
  export type WorkspaceAppDiscoveryIncompleteReason = 'time_limit';
21
- 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' | 'DISCOVERY_TIME_LIMIT' | 'ASSET_CATALOG_INVALID' | 'EXEC_DENIED';
22
+ export type WorkspaceAppDiagnosticCode = 'MANIFEST_MISSING' | 'MANIFEST_INVALID' | 'MANIFEST_DUAL_MISMATCH' | 'ENTRY_INVALID' | 'INITIAL_STATE_INVALID' | 'DUPLICATE_ID' | 'RESERVED_ID' | 'BUNDLE_INTEGRITY' | 'LINEAGE_INVALID' | 'LINEAGE_STALE' | 'PATH_ESCAPED' | 'LIMIT_EXCEEDED' | 'DISCOVERY_TIME_LIMIT' | 'ASSET_CATALOG_INVALID' | 'EXEC_DENIED';
22
23
  export interface WorkspaceAppDiagnostic {
23
24
  readonly code: WorkspaceAppDiagnosticCode;
24
25
  readonly pluginId?: string;
25
26
  readonly source: WorkspaceAppDiscoverySource;
26
27
  readonly relativePath: string;
28
+ readonly reason?: AppManifestReason;
29
+ readonly files?: readonly AppManifestFileName[];
27
30
  }
28
31
  export interface ProductAppBundleSnapshotMetadata {
29
32
  readonly indexHash?: string;
@@ -104,6 +107,9 @@ interface WorkspaceAppCandidateBase {
104
107
  readonly pluginId: string;
105
108
  readonly definitionId: string;
106
109
  readonly version: number;
110
+ readonly releaseVersion?: string;
111
+ readonly manifestFile?: AppManifestFileName;
112
+ readonly mcpb?: Readonly<Record<string, JsonValue>>;
107
113
  readonly relativePath: string;
108
114
  readonly manifest: UiPluginManifestV2;
109
115
  readonly normalized: UiPluginNormalizedManifestV2;
@@ -11,8 +11,8 @@ export type { AppDiscoveryBytes, AppDiscoveryDiagnostic, AppDiscoveryDirectoryEn
11
11
  export { createWorkspaceAppCatalog, discoverWorkspaceAppCatalog, hashAppDefinition, hashCrewxAppDefinition, listWorkspaceApps, } from './catalog.js';
12
12
  export type { CrewxAppBuiltinCatalog, CrewxAppCapability, CrewxAppCatalogOptions, CrewxAppCatalogResult, CrewxAppDefinitionHashInput, CrewxAppDefinitionSummary, CrewxAppDiagnostic, CrewxAppDiagnosticCode, CrewxAppDiagnosticSource, CrewxAppInstalledProjection, CrewxAppLocalDefinitionRef, CrewxAppOrigin, CrewxAppOwnership, CrewxAppShareability, CrewxAppSharingAvailability, CrewxAppSummary, } from './types.js';
13
13
  export { MCP_APP_PROJECTION_MAX_BYTES, buildMcpAppStateDescriptor, buildMcpAppStateProjections, createMcpAppToolResult, projectMcpAppSummaryState, serializeMcpAppStateJson, serializeMcpAppStateXml, } from './projection.js';
14
- export { buildMcpAppsContext } from './apps-context.js';
15
- export type { McpAppsContext } from './apps-context.js';
14
+ export { attachAvailableApps, buildMcpAppsContext } from './apps-context.js';
15
+ export type { McpAppsContext, McpAppsContextOptions } from './apps-context.js';
16
16
  export { UI_CONTENT_ERROR_CODES, UI_CONTENT_MAX_BYTES, UI_CONTENT_MAX_LINES, UI_CONTENT_MAX_MEMORY_BYTES, UI_CONTENT_MEDIA_TYPES, UI_CONTENT_OUTPUT_TTL_MS, UI_CONTENT_TICKET_TTL_MS, UiContentChannelError, contentBindingMatches, countContentLines, decodeContentUtf8, isUiContentDeclaration, isUiContentMediaType, isUiContentRangeRequest, isValidUiAppInstanceId, isValidUiThreadIdentity, sha256Content, validateContentBytes, validateContentFrame, } from './content-channel.js';
17
17
  export type { ContentFrame, UiActionContentDeclaration, UiContentBinding, UiContentChannelPort, UiContentErrorCode, UiContentInputDeclaration, UiContentInputTicket, UiContentMediaType, UiContentOutputDeclaration, UiContentRange, UiContentRangeRequest, ValidateContentFrameOptions, } from './content-channel.js';
18
18
  export { buildMcpAppContentActions, contentActionsMatch, isMcpAppContentActions, } from './content-declarations.js';
@@ -1,6 +1,8 @@
1
1
  import type { JsonObject, UiDefinition, UiDefinitionRef, UiDefinitionDisplayMode, UiDefinitionUsage, UiProjectionPolicy, UiInstance, UiInstanceStatus, UiActionConfirmation, UiActionHandlerRegistration } from '../ui-instance/types.js';
2
2
  import type { AppDiscoveryFileSystem, ProductAppBundleInput, ProductAppBundleProvenance, ProductAppBundleSnapshotMetadata } from './discovery.js';
3
3
  import type { UiPluginManifestV2 } from '../ui-plugin/types.js';
4
+ import type { AppManifestFileName, AppManifestReason } from '../ui-plugin/app-manifest.js';
5
+ import type { McpAppAgentAccess } from './agent-access.js';
4
6
  export declare const MCP_APP_RESOURCE_MIME_TYPE: "text/html;profile=mcp-app";
5
7
  export declare const MCP_APP_RESOURCE_URI_PREFIX = "ui://crewx/";
6
8
  export type McpAppToolVisibility = 'model' | 'app';
@@ -308,13 +310,20 @@ export interface McpAppButtonInput {
308
310
  readonly enabled: boolean;
309
311
  readonly confirmation?: UiActionConfirmation;
310
312
  readonly requiresHumanConfirmation?: boolean;
313
+ readonly agentAccess?: McpAppAgentAccess;
311
314
  readonly disabledReason?: string;
312
315
  readonly inputSchema: McpAppInputSchema;
313
316
  }
317
+ export interface McpAppDescriptorAppInfo {
318
+ readonly id: string;
319
+ readonly name: string;
320
+ readonly description: string;
321
+ }
314
322
  export interface McpAppServerStateInput {
315
323
  readonly source: 'server';
316
324
  readonly instance: Pick<UiInstance, 'id' | 'definition' | 'revision' | 'status' | 'state'>;
317
325
  readonly definition: UiDefinition;
326
+ readonly app?: McpAppDescriptorAppInfo;
318
327
  readonly buttons: readonly McpAppButtonInput[];
319
328
  }
320
329
  export interface McpAppButtonDescriptor {
@@ -323,6 +332,7 @@ export interface McpAppButtonDescriptor {
323
332
  readonly enabled: boolean;
324
333
  readonly confirmation: UiActionConfirmation;
325
334
  readonly requiresHumanConfirmation?: boolean;
335
+ readonly agentAccess?: McpAppAgentAccess;
326
336
  readonly disabledReason: string | null;
327
337
  readonly inputSchema: McpAppInputSchema;
328
338
  }
@@ -331,6 +341,7 @@ export interface McpAppStateDescriptor {
331
341
  readonly source: 'server';
332
342
  readonly instanceId: string;
333
343
  readonly definition: UiDefinitionRef;
344
+ readonly app?: McpAppDescriptorAppInfo;
334
345
  readonly revision: number;
335
346
  readonly status: UiInstanceStatus;
336
347
  readonly state: JsonObject;
@@ -425,14 +436,17 @@ export interface CrewxAppSummary {
425
436
  readonly slug?: string;
426
437
  readonly definitionHash: string;
427
438
  readonly provenance?: ProductAppBundleProvenance;
439
+ readonly connectDomains?: readonly string[];
428
440
  }
429
- 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' | 'DISCOVERY_TIME_LIMIT' | 'ASSET_CATALOG_INVALID' | 'EXEC_DENIED' | 'SKILL_INVALID' | 'SKILL_READ_FAILED' | 'INSTALLED_MISSING' | 'INSTALLED_CONTENT_ID_MISSING' | 'INSTALLED_IDENTITY_MISMATCH' | 'BUILTIN_INVALID';
441
+ export type CrewxAppDiagnosticCode = 'MANIFEST_MISSING' | 'MANIFEST_INVALID' | 'MANIFEST_DUAL_MISMATCH' | 'ENTRY_INVALID' | 'INITIAL_STATE_INVALID' | 'DUPLICATE_ID' | 'RESERVED_ID' | 'BUNDLE_INTEGRITY' | 'LINEAGE_INVALID' | 'LINEAGE_STALE' | 'PATH_ESCAPED' | 'LIMIT_EXCEEDED' | 'DISCOVERY_TIME_LIMIT' | 'ASSET_CATALOG_INVALID' | 'EXEC_DENIED' | 'SKILL_INVALID' | 'SKILL_READ_FAILED' | 'INSTALLED_MISSING' | 'INSTALLED_CONTENT_ID_MISSING' | 'INSTALLED_IDENTITY_MISMATCH' | 'BUILTIN_INVALID';
430
442
  export type CrewxAppDiagnosticSource = 'apps' | 'skills' | 'bundled' | 'node_modules' | 'builtin' | 'installed';
431
443
  export interface CrewxAppDiagnostic {
432
444
  readonly code: CrewxAppDiagnosticCode;
433
445
  readonly source: CrewxAppDiagnosticSource;
434
446
  readonly relativePath: string;
435
447
  readonly appId?: string;
448
+ readonly reason?: AppManifestReason;
449
+ readonly files?: readonly AppManifestFileName[];
436
450
  }
437
451
  export interface CrewxAppInstalledProjection {
438
452
  readonly packageRoot?: string;
@@ -9,6 +9,7 @@ export interface WorkspaceAppSnapshotResource extends McpAppLocalResource {
9
9
  readonly definition: UiDefinitionRef;
10
10
  readonly relativePath?: string;
11
11
  readonly runtime?: NonNullable<UiPluginManifestV2['runtime']>;
12
+ readonly csp?: NonNullable<UiPluginManifestV2['csp']>;
12
13
  readonly source?: WorkspaceAppSource;
13
14
  readonly provenance?: ProductAppBundleProvenance;
14
15
  readonly assetCatalogId?: string;