@crewx/sdk 0.9.0-rc.12 → 0.9.0-rc.121
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/README.md +1 -1
- package/dist/account/auth-client.d.ts +61 -0
- package/dist/account/auth-json-v2.d.ts +1 -0
- package/dist/account/auth-json.d.ts +30 -0
- package/dist/account/config.d.ts +37 -0
- package/dist/account/env-bootstrap.d.ts +11 -0
- package/dist/account/errors.d.ts +24 -0
- package/dist/account/index.d.ts +12 -0
- package/dist/account/index.js +2 -0
- package/dist/account/session-manager.d.ts +47 -0
- package/dist/activity-log/builder.d.ts +56 -6
- package/dist/agent/agent-list-view.d.ts +19 -0
- package/dist/boxing/box.types.d.ts +4 -0
- package/dist/config/canonicalize-agent-options.d.ts +18 -0
- package/dist/config/default-agent-models.d.ts +11 -0
- package/dist/config/global-settings.d.ts +33 -0
- package/dist/config/migrate-grok-mode.d.ts +6 -0
- package/dist/config/model-compat.d.ts +31 -0
- package/dist/config/models.generated.d.ts +37 -0
- package/dist/config/models.remote.d.ts +1 -0
- package/dist/config/overdrive.d.ts +7 -0
- package/dist/config/pricing.d.ts +6 -3
- package/dist/config/pricing.generated.d.ts +4 -0
- package/dist/config/pricing.types.d.ts +4 -0
- package/dist/config/timeout.config.d.ts +4 -0
- package/dist/config/wi-boards.d.ts +19 -0
- package/dist/context-budget/continuity.d.ts +61 -0
- package/dist/context-budget/index.d.ts +141 -0
- package/dist/conversation/index.d.ts +1 -1
- package/dist/conversation/sqlite-provider.d.ts +6 -2
- package/dist/conversation/to-template-messages.d.ts +9 -0
- package/dist/conversation/types.d.ts +47 -1
- package/dist/desktop/command-runner.d.ts +4 -0
- package/dist/desktop/default-adapters.d.ts +4 -0
- package/dist/desktop/global-install.d.ts +19 -0
- package/dist/desktop/index.d.ts +3 -0
- package/dist/desktop/index.js +3 -0
- package/dist/desktop/install.d.ts +5 -0
- package/dist/desktop/lnk.d.ts +22 -0
- package/dist/desktop/manifest.d.ts +21 -0
- package/dist/desktop/types.d.ts +67 -0
- package/dist/desktop/version.d.ts +1 -0
- package/dist/desktop/windows-paths.d.ts +21 -0
- package/dist/desktop/wrapper.d.ts +18 -0
- package/dist/esm/account/index.js +2 -0
- package/dist/esm/desktop/index.js +3 -0
- package/dist/esm/index.js +774 -210
- package/dist/esm/node/index.js +2 -0
- package/dist/esm/plugins/index.js +327 -205
- package/dist/esm/process/index.js +1 -0
- package/dist/esm/publish/index.js +2 -0
- package/dist/esm/repository/index.js +398 -198
- package/dist/esm/skills/index.js +1 -0
- package/dist/esm/testing/index.js +1 -1
- package/dist/events/types.d.ts +9 -0
- package/dist/facade/Crewx.d.ts +58 -5
- package/dist/facade/task-ticket.d.ts +14 -0
- package/dist/highlight/thread-highlight-prompt.d.ts +2 -0
- package/dist/highlight/thread-highlighter.d.ts +326 -0
- package/dist/index.browser.d.ts +15 -1
- package/dist/index.browser.js +6 -2
- package/dist/index.d.ts +116 -17
- package/dist/index.js +774 -210
- package/dist/internal/console-decoder.d.ts +38 -0
- package/dist/internal/windows-spawn.d.ts +10 -0
- package/dist/layout/types.d.ts +18 -1
- package/dist/lifecycle/process-lease.d.ts +80 -0
- package/dist/lifecycle/process-owner.d.ts +20 -0
- package/dist/lifecycle/task-heartbeat.d.ts +41 -0
- package/dist/lifecycle/task-stop.d.ts +82 -0
- package/dist/lifecycle/update-admission.d.ts +45 -0
- package/dist/local-server/base-url.d.ts +18 -0
- package/dist/local-server/index.d.ts +8 -0
- package/dist/local-server/opencode.d.ts +8 -0
- package/dist/local-server/probe.d.ts +3 -0
- package/dist/local-server/runtime.d.ts +26 -0
- package/dist/local-server/types.d.ts +43 -0
- package/dist/mcp-app/agent-access.d.ts +14 -0
- package/dist/mcp-app/apps-context.d.ts +6 -0
- package/dist/mcp-app/catalog.d.ts +7 -0
- package/dist/mcp-app/discovery.d.ts +108 -0
- package/dist/mcp-app/errors.d.ts +7 -0
- package/dist/mcp-app/index.d.ts +24 -0
- package/dist/mcp-app/installed-app-ref.d.ts +25 -0
- package/dist/mcp-app/model-context.d.ts +26 -0
- package/dist/mcp-app/node-app-discovery-fs.d.ts +20 -0
- package/dist/mcp-app/projection.d.ts +14 -0
- package/dist/mcp-app/registry.d.ts +19 -0
- package/dist/mcp-app/skill-backend.d.ts +48 -0
- package/dist/mcp-app/state-set.d.ts +9 -0
- package/dist/mcp-app/types.d.ts +394 -0
- package/dist/mcp-app/workspace-snapshot.d.ts +61 -0
- package/dist/migrations/0008_careful_black_bird.sql +17 -0
- package/dist/migrations/0009_hot_dark_phoenix.sql +1 -0
- package/dist/migrations/0010_analyze_stats.sql +6 -0
- package/dist/migrations/0011_far_black_tarantula.sql +1 -0
- package/dist/migrations/0012_blue_turbo.sql +23 -0
- package/dist/migrations/0013_hesitant_adam_destine.sql +15 -0
- package/dist/migrations/0014_organic_mongu.sql +73 -0
- package/dist/migrations/0015_panoramic_gorilla_man.sql +71 -0
- package/dist/migrations/0016_fuzzy_hemingway.sql +14 -0
- package/dist/migrations/0017_project_stage_sdk_migration.sql +29 -0
- package/dist/migrations/0018_bored_jackal.sql +33 -0
- package/dist/migrations/0019_backfill_task_thread_ids.sql +74 -0
- package/dist/migrations/0020_useful_iron_lad.sql +55 -0
- package/dist/migrations/0021_dashing_peter_quill.sql +51 -0
- package/dist/migrations/0022_wandering_bucky.sql +1 -0
- package/dist/migrations/0023_red_payback.sql +1 -0
- package/dist/migrations/0024_storage_metadata.sql +262 -0
- package/dist/migrations/0025_task_heartbeat.sql +8 -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/0027_task_stop_scope_cleanup.sql +5 -0
- package/dist/migrations/0027_ui_instance_active_unique.sql +2 -0
- package/dist/migrations/0029_nice_rhino.sql +1 -0
- package/dist/migrations/0031_petite_arclight.sql +6 -0
- package/dist/migrations/0032_ui_instance_opened_by.sql +1 -0
- package/dist/migrations/0033_thread_creator_boundary_guard.sql +38 -0
- package/dist/migrations/meta/0008_snapshot.json +1327 -0
- package/dist/migrations/meta/0009_snapshot.json +1335 -0
- package/dist/migrations/meta/0010_snapshot.json +1335 -0
- package/dist/migrations/meta/0011_snapshot.json +1342 -0
- package/dist/migrations/meta/0012_snapshot.json +1494 -0
- package/dist/migrations/meta/0013_snapshot.json +1592 -0
- package/dist/migrations/meta/0014_snapshot.json +1975 -0
- package/dist/migrations/meta/0015_snapshot.json +2315 -0
- package/dist/migrations/meta/0016_snapshot.json +2419 -0
- package/dist/migrations/meta/0017_snapshot.json +2419 -0
- package/dist/migrations/meta/0018_snapshot.json +2570 -0
- package/dist/migrations/meta/0020_snapshot.json +2895 -0
- package/dist/migrations/meta/0021_snapshot.json +3031 -0
- package/dist/migrations/meta/0022_snapshot.json +3039 -0
- package/dist/migrations/meta/0023_snapshot.json +3047 -0
- package/dist/migrations/meta/0029_snapshot.json +3206 -0
- package/dist/migrations/meta/0031_snapshot.json +3251 -0
- package/dist/migrations/meta/_journal.json +183 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +2 -0
- package/dist/paths.d.ts +1 -0
- package/dist/plugin/types.d.ts +1 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +327 -205
- package/dist/plugins/sqlite-tracing.d.ts +46 -0
- package/dist/process/index.d.ts +2 -0
- package/dist/process/index.js +1 -0
- package/dist/process/process-control.d.ts +41 -0
- package/dist/prompt/tag-names.d.ts +20 -0
- package/dist/provider/acp/connection.d.ts +6 -0
- package/dist/provider/acp/meta.d.ts +11 -0
- package/dist/provider/bridge.d.ts +7 -1
- package/dist/provider/classify-task-error.d.ts +2 -0
- package/dist/provider/cli/adapter.types.d.ts +14 -2
- package/dist/provider/cli/adapters/agent-call.util.d.ts +1 -1
- package/dist/provider/cli/adapters/cli-knob.util.d.ts +7 -0
- package/dist/provider/cli/adapters/codex-item.d.ts +1 -0
- package/dist/provider/cli/adapters/event-timestamp.util.d.ts +1 -0
- package/dist/provider/cli/adapters/grok.d.ts +2 -0
- package/dist/provider/cli/adapters/index.d.ts +5 -0
- package/dist/provider/cli/index.d.ts +3 -2
- package/dist/provider/cli/meta.d.ts +5 -0
- package/dist/provider/cli/protocol-envelope.d.ts +3 -0
- package/dist/provider/errors.d.ts +5 -1
- package/dist/provider/idle-watchdog.d.ts +19 -0
- package/dist/provider/models.d.ts +17 -12
- package/dist/provider/order.d.ts +1 -1
- package/dist/provider/parse-usage.d.ts +6 -0
- package/dist/provider/provider-selection.d.ts +8 -0
- package/dist/provider/redact-technical-message.d.ts +1 -0
- package/dist/provider/task-error.types.d.ts +17 -0
- package/dist/publish/constants.d.ts +6 -0
- package/dist/publish/errors.d.ts +7 -0
- package/dist/publish/index.d.ts +50 -0
- package/dist/publish/index.js +2 -0
- package/dist/publish/manifest.d.ts +47 -0
- package/dist/publish/marketplace-api.constants.d.ts +1 -0
- package/dist/publish/pack.d.ts +6 -0
- package/dist/publish/scan.d.ts +9 -0
- package/dist/publish/secrets.d.ts +6 -0
- package/dist/publish/upload.d.ts +19 -0
- package/dist/remote/execution-profile.d.ts +9 -0
- package/dist/remote/index.d.ts +1 -0
- package/dist/remote/types.d.ts +28 -0
- package/dist/repository/agent-suggestion.repository.d.ts +34 -0
- package/dist/repository/base-sqlite-repository.d.ts +1 -0
- package/dist/repository/common-code.repository.d.ts +45 -0
- package/dist/repository/db.d.ts +12 -1
- package/dist/repository/index.d.ts +38 -5
- package/dist/repository/index.js +398 -198
- package/dist/repository/notification.repository.d.ts +58 -0
- package/dist/repository/project.repository.d.ts +90 -0
- package/dist/repository/request-log.repository.d.ts +1 -0
- package/dist/repository/storage-metadata.repository.d.ts +64 -0
- package/dist/repository/task-log-migration.d.ts +74 -0
- package/dist/repository/task-log.repository.d.ts +44 -0
- package/dist/repository/task-status.d.ts +14 -0
- package/dist/repository/task.repository.d.ts +233 -7
- package/dist/repository/thread-history.repository.d.ts +193 -0
- package/dist/repository/thread-origin-verdict.d.ts +27 -0
- package/dist/repository/thread-title.types.d.ts +29 -0
- package/dist/repository/thread.repository.d.ts +47 -6
- package/dist/repository/usage-backfill.d.ts +62 -0
- package/dist/repository/usage-from-logs.d.ts +21 -0
- package/dist/repository/usage-report.repository.d.ts +27 -0
- package/dist/repository/workspace.repository.d.ts +3 -0
- package/dist/schema/agent-suggestions.d.ts +199 -0
- package/dist/schema/common-codes.d.ts +216 -0
- package/dist/schema/index.d.ts +11 -0
- package/dist/schema/notifications.d.ts +303 -0
- package/dist/schema/projects.d.ts +610 -0
- package/dist/schema/storage-metadata.d.ts +181 -0
- package/dist/schema/task-log-events.d.ts +119 -0
- package/dist/schema/tasks.d.ts +165 -0
- package/dist/schema/thread-creator-unverified.d.ts +45 -0
- package/dist/schema/thread-history.d.ts +734 -0
- package/dist/schema/threads.d.ts +59 -0
- package/dist/schema/ui-action-receipts.d.ts +303 -0
- package/dist/schema/ui-instances.d.ts +305 -0
- package/dist/schema/usage-reports.d.ts +252 -0
- package/dist/schema/workspaces.d.ts +17 -0
- package/dist/skills/index.d.ts +8 -0
- package/dist/skills/index.js +1 -0
- package/dist/skills/types.d.ts +18 -0
- package/dist/task-log/anchor-child-tasks.d.ts +7 -0
- package/dist/task-log/delegation-trailer.d.ts +34 -0
- package/dist/template/engine.d.ts +2 -2
- package/dist/template/helpers/exec.browser.d.ts +4 -3
- package/dist/template/helpers/exec.d.ts +4 -3
- package/dist/template/types.d.ts +20 -0
- package/dist/testing/index.js +1 -1
- package/dist/types/index.d.ts +1572 -3
- package/dist/types/task-log.types.d.ts +2 -0
- package/dist/ui-card/index.d.ts +2 -0
- package/dist/ui-card/legacy-card-parser.d.ts +11 -0
- package/dist/ui-instance/definition.d.ts +6 -0
- package/dist/ui-instance/errors.d.ts +17 -0
- package/dist/ui-instance/index.d.ts +9 -0
- package/dist/ui-instance/json.d.ts +8 -0
- package/dist/ui-instance/runtime.d.ts +18 -0
- package/dist/ui-instance/store.d.ts +142 -0
- package/dist/ui-instance/types.d.ts +260 -0
- package/dist/ui-plugin/index.d.ts +4 -0
- package/dist/ui-plugin/limits.d.ts +27 -0
- package/dist/ui-plugin/manifest.d.ts +3 -0
- package/dist/ui-plugin/types.d.ts +179 -0
- package/dist/ui-plugin/validator.d.ts +15 -0
- package/dist/utils/crewx-executable.d.ts +76 -0
- package/dist/utils/crewx-home.d.ts +1 -0
- package/dist/utils/env-defaults.d.ts +2 -0
- package/dist/utils/id.d.ts +1 -1
- package/dist/utils/local-identity.d.ts +2 -0
- package/dist/utils/runner-env.d.ts +3 -0
- package/dist/utils/timestamp.d.ts +1 -0
- package/dist/utils/workspace.d.ts +1 -0
- package/dist/wi/create.d.ts +48 -0
- package/dist/wi/select.d.ts +20 -0
- package/package.json +48 -2
- package/templates/agents/default.yaml +279 -127
- package/templates/documents/crewx-manual.md +138 -138
- package/templates/documents/crewx-quick-guide.md +1 -1
- package/templates/workflows/wi-default-flow.yaml +65 -0
- package/templates/workflows/wi-plan-flow.yaml +140 -0
|
@@ -0,0 +1,24 @@
|
|
|
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 { MAX_HTML_LENGTH, createMcpAppRegistry, createBuiltinMcpAppRegistry, buildMcpAppLocalRegistration, createMcpAppLocalRegistration, registerLocalMcpApp, createMcpAppWorkspaceRegistry, createWorkspaceAppRegistry, createWorkspaceMcpAppRegistry, registerMcpApp, resolveMcpAppResource, resolveLocalMcpAppResource, requireMcpAppResource, toMcpAppToolRegistration, } from './registry.js';
|
|
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';
|
|
8
|
+
export { createWorkspaceAppCatalog, discoverWorkspaceAppCatalog, hashAppDefinition, hashCrewxAppDefinition, listWorkspaceApps, } from './catalog.js';
|
|
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';
|
|
11
|
+
export { buildMcpAppsContext } from './apps-context.js';
|
|
12
|
+
export type { McpAppsContext } from './apps-context.js';
|
|
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
|
+
export type { McpAppModelContext, McpAppModelContextInput } from './model-context.js';
|
|
15
|
+
export { resolveAgentAccess } from './agent-access.js';
|
|
16
|
+
export type { McpAppAgentAccess, McpAppAgentAccessAction } from './agent-access.js';
|
|
17
|
+
export { buildStateSetHandler, createStateSetHandler, } from './state-set.js';
|
|
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';
|
|
21
|
+
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';
|
|
23
|
+
export { buildWorkspaceAppSnapshot, discoverWorkspaceAppSnapshot, reconfirmWorkspaceAppSnapshot, } from './workspace-snapshot.js';
|
|
24
|
+
export type { WorkspaceAppSnapshot, WorkspaceAppSnapshotBuildOptions, WorkspaceAppSnapshotOptions, WorkspaceAppSnapshotReconfirmResult, WorkspaceAppSnapshotResource, WorkspaceAppSnapshotInitialState, WorkspaceAppInitialState, } from './workspace-snapshot.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,26 @@
|
|
|
1
|
+
import type { JsonObject } from '../ui-instance/types.js';
|
|
2
|
+
export declare const MCP_APP_MODEL_CONTEXT_MAX_BYTES: number;
|
|
3
|
+
export declare const MCP_APP_MODEL_CONTEXT_MAX_STRING_LENGTH = 2048;
|
|
4
|
+
export declare const MCP_APP_MODEL_CONTEXT_MAX_ARRAY_LENGTH = 200;
|
|
5
|
+
export declare const MCP_APP_MODEL_CONTEXT_MAX_DEPTH = 8;
|
|
6
|
+
export interface McpAppModelContextInput {
|
|
7
|
+
readonly instanceId: string;
|
|
8
|
+
readonly definitionHash: string;
|
|
9
|
+
readonly revision: number;
|
|
10
|
+
readonly content?: unknown;
|
|
11
|
+
readonly structuredContent?: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface McpAppModelContext {
|
|
14
|
+
readonly instanceId: string;
|
|
15
|
+
readonly definitionHash: string;
|
|
16
|
+
readonly revision: number;
|
|
17
|
+
readonly content?: readonly {
|
|
18
|
+
readonly type: 'text';
|
|
19
|
+
readonly text: string;
|
|
20
|
+
}[];
|
|
21
|
+
readonly structuredContent?: JsonObject;
|
|
22
|
+
}
|
|
23
|
+
export declare function sanitizeMcpAppModelContext(value: unknown): McpAppModelContext;
|
|
24
|
+
export declare function serializeMcpAppModelContextXml(context: McpAppModelContext, options?: {
|
|
25
|
+
readonly stale?: boolean;
|
|
26
|
+
}): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type AppDiscoveryFsErrorCode = 'NOT_FOUND' | 'READ_DENIED' | 'LIMIT_EXCEEDED' | 'PATH_ESCAPED' | 'IDENTITY_CHANGED' | 'TOCTOU' | 'UNSUPPORTED';
|
|
2
|
+
export declare class AppDiscoveryFsError extends Error {
|
|
3
|
+
readonly code: AppDiscoveryFsErrorCode;
|
|
4
|
+
readonly name = "AppDiscoveryFsError";
|
|
5
|
+
constructor(code: AppDiscoveryFsErrorCode);
|
|
6
|
+
}
|
|
7
|
+
export interface NodeAppDiscoveryDirectoryEntry {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly kind: 'file' | 'directory' | 'symlink' | 'other';
|
|
10
|
+
}
|
|
11
|
+
export declare class NodeAppDiscoveryFs {
|
|
12
|
+
listDirectory(root: string, relativePath: string): Promise<readonly NodeAppDiscoveryDirectoryEntry[]>;
|
|
13
|
+
readdir(root: string, relativePath: string): Promise<readonly NodeAppDiscoveryDirectoryEntry[]>;
|
|
14
|
+
readDirectory(root: string, relativePath: string): Promise<readonly NodeAppDiscoveryDirectoryEntry[]>;
|
|
15
|
+
readVerifiedFile(root: string, relativePath: string, byteLimit: number): Promise<Uint8Array>;
|
|
16
|
+
readFileVerified(root: string, relativePath: string, byteLimit: number): Promise<Uint8Array>;
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultAppDiscoveryFs: NodeAppDiscoveryFs;
|
|
19
|
+
export declare const defaultNodeAppDiscoveryFs: NodeAppDiscoveryFs;
|
|
20
|
+
export declare const NodeAppDiscoveryFsAdapter: typeof NodeAppDiscoveryFs;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JsonObject } from '../ui-instance/types.js';
|
|
2
|
+
import type { McpAppServerStateInput, McpAppStateDescriptor, McpAppStateProjections, McpAppToolDescriptor, McpAppToolResult } from './types.js';
|
|
3
|
+
export declare const MCP_APP_PROJECTION_MAX_BYTES: number;
|
|
4
|
+
export declare const SENSITIVE_KEY: RegExp;
|
|
5
|
+
export declare function buildMcpAppStateDescriptor(input: McpAppServerStateInput): McpAppStateDescriptor;
|
|
6
|
+
export declare function buildTerminalMcpAppStateDescriptor(input: McpAppServerStateInput): McpAppStateDescriptor;
|
|
7
|
+
export declare function serializeMcpAppStateJson(descriptor: McpAppStateDescriptor, dataPaths?: readonly string[]): string;
|
|
8
|
+
export declare function serializeMcpAppStateXml(descriptor: McpAppStateDescriptor): string;
|
|
9
|
+
export declare function buildMcpAppStateProjections(input: McpAppServerStateInput): McpAppStateProjections;
|
|
10
|
+
export declare function buildTerminalMcpAppStateProjections(input: McpAppServerStateInput): McpAppStateProjections;
|
|
11
|
+
export declare function createMcpAppToolResult(tool: Pick<McpAppToolDescriptor, 'textFallback'>, options?: {
|
|
12
|
+
structuredContent?: JsonObject;
|
|
13
|
+
meta?: JsonObject;
|
|
14
|
+
}): McpAppToolResult;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
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 } from './types.js';
|
|
2
|
+
export declare const MAX_HTML_LENGTH: number;
|
|
3
|
+
export declare function createMcpAppRegistry(): McpAppRegistry;
|
|
4
|
+
export declare function createBuiltinMcpAppRegistry(): McpAppRegistry;
|
|
5
|
+
export declare function registerMcpApp(registry: McpAppRegistry, input: McpAppDescriptorInput): McpAppDescriptor;
|
|
6
|
+
export declare function resolveMcpAppResource(registry: McpAppRegistry, uri: string): McpAppResource | null;
|
|
7
|
+
export declare function requireMcpAppResource(registry: McpAppRegistry, uri: string): McpAppResource;
|
|
8
|
+
export declare function toMcpAppToolRegistration(tool: McpAppToolDescriptor): McpAppToolRegistration;
|
|
9
|
+
export declare function buildMcpAppLocalRegistration(input: McpAppLocalRegistrationInput): McpAppLocalRegistration;
|
|
10
|
+
export declare const createMcpAppLocalRegistration: typeof buildMcpAppLocalRegistration;
|
|
11
|
+
export declare const registerLocalMcpApp: typeof buildMcpAppLocalRegistration;
|
|
12
|
+
export declare function createMcpAppWorkspaceRegistry(input?: McpAppWorkspaceRegistryInput): McpAppWorkspaceRegistry;
|
|
13
|
+
export declare const createWorkspaceAppRegistry: typeof createMcpAppWorkspaceRegistry;
|
|
14
|
+
export declare const createWorkspaceMcpAppRegistry: typeof createMcpAppWorkspaceRegistry;
|
|
15
|
+
export declare function createMcpAppLocalActionInputSchema(actions: readonly {
|
|
16
|
+
readonly actionId: string;
|
|
17
|
+
readonly inputSchema: McpAppInputSchema;
|
|
18
|
+
}[]): McpAppInputSchema;
|
|
19
|
+
export declare function resolveLocalMcpAppResource(registry: McpAppWorkspaceRegistry, appId: string, definitionHash?: string): McpAppLocalResource | null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { JsonObject, UiExternalActionHandlerRegistration } from '../ui-instance/types.js';
|
|
2
|
+
import type { UiPluginNormalizedManifestV2 } from '../ui-plugin/types.js';
|
|
3
|
+
import type { WorkspaceAppSource } from './discovery.js';
|
|
4
|
+
export declare const SKILL_BACKEND_SCHEMA_VERSION: 1;
|
|
5
|
+
export declare const SKILL_BACKEND_MAX_INPUT_BYTES: number;
|
|
6
|
+
export declare const SKILL_BACKEND_MAX_OUTPUT_BYTES: number;
|
|
7
|
+
export declare const SKILL_BACKEND_DEFAULT_TIMEOUT_MS = 15000;
|
|
8
|
+
export type SkillBackendInfrastructureErrorCode = 'EXEC_DENIED' | 'EXEC_TIMEOUT' | 'EXEC_OUTPUT_INVALID' | 'EXECUTION_FAILED' | 'ACTION_IN_FLIGHT' | 'INPUT_INVALID';
|
|
9
|
+
export interface SkillBackendPayload {
|
|
10
|
+
readonly schemaVersion: typeof SKILL_BACKEND_SCHEMA_VERSION;
|
|
11
|
+
readonly actionId: string;
|
|
12
|
+
readonly input: JsonObject;
|
|
13
|
+
readonly state: JsonObject;
|
|
14
|
+
}
|
|
15
|
+
export type SkillBackendExecutionResponse = {
|
|
16
|
+
readonly state?: JsonObject;
|
|
17
|
+
readonly result?: JsonObject;
|
|
18
|
+
} | {
|
|
19
|
+
readonly outcome: 'rejected' | 'failed';
|
|
20
|
+
readonly errorCode: string;
|
|
21
|
+
readonly state?: JsonObject;
|
|
22
|
+
readonly result?: JsonObject;
|
|
23
|
+
};
|
|
24
|
+
export interface SkillBackendExecutionRequest {
|
|
25
|
+
readonly instanceId: string;
|
|
26
|
+
readonly appId: string;
|
|
27
|
+
readonly definitionId: string;
|
|
28
|
+
readonly definitionVersion: number;
|
|
29
|
+
readonly definitionHash: string;
|
|
30
|
+
readonly actionId: string;
|
|
31
|
+
readonly source: WorkspaceAppSource;
|
|
32
|
+
readonly relativePath: string;
|
|
33
|
+
readonly command: readonly string[];
|
|
34
|
+
readonly payload: SkillBackendPayload;
|
|
35
|
+
}
|
|
36
|
+
export interface SkillBackendExecutionPort {
|
|
37
|
+
execute(request: SkillBackendExecutionRequest): PromiseLike<SkillBackendExecutionResponse>;
|
|
38
|
+
}
|
|
39
|
+
export interface SkillBackendHandlerBuildInput {
|
|
40
|
+
readonly normalized: UiPluginNormalizedManifestV2;
|
|
41
|
+
readonly actionId: string;
|
|
42
|
+
readonly source: WorkspaceAppSource;
|
|
43
|
+
readonly relativePath: string;
|
|
44
|
+
readonly execute: SkillBackendExecutionPort;
|
|
45
|
+
readonly definitionHash?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function buildSkillBackendHandler(normalized: UiPluginNormalizedManifestV2, actionId: string, source: WorkspaceAppSource, relativePath: string, execute: SkillBackendExecutionPort): UiExternalActionHandlerRegistration | undefined;
|
|
48
|
+
export declare function buildSkillBackendHandler(input: SkillBackendHandlerBuildInput): UiExternalActionHandlerRegistration | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UiStateActionHandlerRegistration } from '../ui-instance/types.js';
|
|
2
|
+
import type { UiPluginNormalizedManifestV2 } from '../ui-plugin/types.js';
|
|
3
|
+
export interface StateSetHandlerBuildInput {
|
|
4
|
+
readonly normalized: UiPluginNormalizedManifestV2;
|
|
5
|
+
readonly actionId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildStateSetHandler(normalized: UiPluginNormalizedManifestV2, actionId: string): UiStateActionHandlerRegistration | undefined;
|
|
8
|
+
export declare function buildStateSetHandler(input: StateSetHandlerBuildInput): UiStateActionHandlerRegistration | undefined;
|
|
9
|
+
export declare const createStateSetHandler: typeof buildStateSetHandler;
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import type { JsonObject, UiDefinition, UiDefinitionRef, UiDefinitionDisplayMode, UiDefinitionUsage, UiInstance, UiInstanceStatus, UiActionConfirmation, UiActionHandlerRegistration } from '../ui-instance/types.js';
|
|
2
|
+
import type { AppDiscoveryFileSystem } from './discovery.js';
|
|
3
|
+
export declare const MCP_APP_RESOURCE_MIME_TYPE: "text/html;profile=mcp-app";
|
|
4
|
+
export declare const MCP_APP_RESOURCE_URI_PREFIX = "ui://crewx/";
|
|
5
|
+
export type McpAppToolVisibility = 'model' | 'app';
|
|
6
|
+
export type McpAppTone = 'blue' | 'violet' | 'emerald' | 'amber' | 'rose' | 'sky' | 'slate' | 'indigo';
|
|
7
|
+
export declare const MCP_APP_HOST_TOOL_ALLOWLIST: readonly ["crewx_app_terminal_connect", "crewx_app_html_viewer_open"];
|
|
8
|
+
export type McpAppHostToolName = typeof MCP_APP_HOST_TOOL_ALLOWLIST[number];
|
|
9
|
+
export interface McpUiResourceCsp {
|
|
10
|
+
readonly connectDomains?: readonly string[];
|
|
11
|
+
readonly resourceDomains?: readonly string[];
|
|
12
|
+
readonly frameDomains?: readonly string[];
|
|
13
|
+
readonly baseUriDomains?: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export type McpAppInputSchema = JsonObject;
|
|
16
|
+
export interface McpAppToolCommonInput {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly description: string;
|
|
19
|
+
readonly inputSchema: McpAppInputSchema;
|
|
20
|
+
readonly textFallback: string;
|
|
21
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
22
|
+
}
|
|
23
|
+
export interface McpAppReadToolInput extends McpAppToolCommonInput {
|
|
24
|
+
readonly kind: 'read';
|
|
25
|
+
readonly actionId?: never;
|
|
26
|
+
}
|
|
27
|
+
export interface McpAppSingleActionToolInput extends McpAppToolCommonInput {
|
|
28
|
+
readonly kind: 'action';
|
|
29
|
+
readonly actionId: string;
|
|
30
|
+
readonly actionIds?: never;
|
|
31
|
+
}
|
|
32
|
+
export interface McpAppActionDispatcherToolInput extends McpAppToolCommonInput {
|
|
33
|
+
readonly kind: 'action';
|
|
34
|
+
readonly actionId?: never;
|
|
35
|
+
readonly actionIds: readonly string[];
|
|
36
|
+
}
|
|
37
|
+
export type McpAppActionToolInput = McpAppSingleActionToolInput | McpAppActionDispatcherToolInput;
|
|
38
|
+
export type McpAppActionToolDescriptor = (Omit<McpAppSingleActionToolInput, 'actionIds'> & {
|
|
39
|
+
readonly actionIds: readonly string[];
|
|
40
|
+
}) | (Omit<McpAppActionDispatcherToolInput, 'actionId'> & {
|
|
41
|
+
readonly actionIds: readonly string[];
|
|
42
|
+
});
|
|
43
|
+
type McpAppToolDescriptorMetadata = {
|
|
44
|
+
readonly resourceUri: string;
|
|
45
|
+
readonly _meta: McpAppToolMetadata;
|
|
46
|
+
};
|
|
47
|
+
export interface McpAppHostToolInput extends Omit<McpAppToolCommonInput, 'name' | 'visibility'> {
|
|
48
|
+
readonly name: McpAppHostToolName;
|
|
49
|
+
readonly kind: 'host';
|
|
50
|
+
readonly visibility: readonly ['app'];
|
|
51
|
+
readonly actionId?: never;
|
|
52
|
+
}
|
|
53
|
+
export type McpAppToolInput = McpAppReadToolInput | McpAppActionToolInput | McpAppHostToolInput;
|
|
54
|
+
export interface McpAppDescriptorInput {
|
|
55
|
+
readonly appId: string;
|
|
56
|
+
readonly html: string;
|
|
57
|
+
readonly name?: string;
|
|
58
|
+
readonly description?: string;
|
|
59
|
+
readonly icon?: string;
|
|
60
|
+
readonly tone?: McpAppTone;
|
|
61
|
+
readonly builtinOnly?: boolean;
|
|
62
|
+
readonly csp?: McpUiResourceCsp;
|
|
63
|
+
readonly tools: readonly McpAppToolInput[];
|
|
64
|
+
readonly definition?: UiDefinition;
|
|
65
|
+
}
|
|
66
|
+
export interface McpAppResource {
|
|
67
|
+
readonly uri: string;
|
|
68
|
+
readonly mimeType: typeof MCP_APP_RESOURCE_MIME_TYPE;
|
|
69
|
+
readonly text: string;
|
|
70
|
+
readonly _meta?: {
|
|
71
|
+
readonly ui?: {
|
|
72
|
+
readonly csp?: McpUiResourceCsp;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export declare const MCP_APP_LOCAL_RESOURCE_MIME_TYPE: "text/html";
|
|
77
|
+
export interface McpAppInstanceResourceBinding {
|
|
78
|
+
readonly kind: 'instance';
|
|
79
|
+
}
|
|
80
|
+
export interface McpAppMcpResourceBinding {
|
|
81
|
+
readonly kind: 'mcp';
|
|
82
|
+
readonly uri: string;
|
|
83
|
+
}
|
|
84
|
+
export type McpAppResourceBinding = McpAppInstanceResourceBinding | McpAppMcpResourceBinding;
|
|
85
|
+
export interface McpAppLocalResource {
|
|
86
|
+
readonly mimeType: typeof MCP_APP_LOCAL_RESOURCE_MIME_TYPE;
|
|
87
|
+
readonly entryHash: string;
|
|
88
|
+
readonly html: string;
|
|
89
|
+
readonly bytes: readonly number[];
|
|
90
|
+
readonly initialState?: {
|
|
91
|
+
readonly hash: string;
|
|
92
|
+
readonly bytes: readonly number[];
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export interface McpAppLocalRegistrationInput {
|
|
96
|
+
readonly appId: string;
|
|
97
|
+
readonly name: string;
|
|
98
|
+
readonly description: string;
|
|
99
|
+
readonly icon?: string;
|
|
100
|
+
readonly tone?: McpAppTone;
|
|
101
|
+
readonly csp?: McpUiResourceCsp;
|
|
102
|
+
readonly definition: UiDefinition;
|
|
103
|
+
readonly html: string;
|
|
104
|
+
readonly entryHash: string;
|
|
105
|
+
readonly entryBytes?: readonly number[];
|
|
106
|
+
readonly initialState?: JsonObject;
|
|
107
|
+
readonly initialStateHash?: string;
|
|
108
|
+
readonly initialStateBytes?: readonly number[];
|
|
109
|
+
readonly readToolName: string;
|
|
110
|
+
readonly actionToolName?: string;
|
|
111
|
+
readonly modelActions?: readonly string[];
|
|
112
|
+
readonly actions: readonly {
|
|
113
|
+
readonly actionId: string;
|
|
114
|
+
readonly inputSchema: McpAppInputSchema;
|
|
115
|
+
readonly backend?: {
|
|
116
|
+
readonly type: 'core';
|
|
117
|
+
readonly handler: string;
|
|
118
|
+
} | {
|
|
119
|
+
readonly type: 'skill';
|
|
120
|
+
readonly command?: readonly string[];
|
|
121
|
+
};
|
|
122
|
+
}[];
|
|
123
|
+
}
|
|
124
|
+
export interface McpAppLocalReadToolDescriptor extends McpAppToolCommonInput {
|
|
125
|
+
readonly kind: 'read';
|
|
126
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
127
|
+
readonly actionIds?: never;
|
|
128
|
+
}
|
|
129
|
+
export interface McpAppLocalActionToolDescriptor extends McpAppToolCommonInput {
|
|
130
|
+
readonly kind: 'action';
|
|
131
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
132
|
+
readonly actionIds: readonly string[];
|
|
133
|
+
}
|
|
134
|
+
export interface McpAppLocalSingleActionToolDescriptor extends McpAppToolCommonInput {
|
|
135
|
+
readonly kind: 'action';
|
|
136
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
137
|
+
readonly actionId: string;
|
|
138
|
+
readonly actionIds: readonly [string];
|
|
139
|
+
readonly _meta: {
|
|
140
|
+
readonly ui: {
|
|
141
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export interface McpAppLocalToolDiagnostic {
|
|
146
|
+
readonly toolName: string;
|
|
147
|
+
readonly actionId: string;
|
|
148
|
+
readonly reason: 'name_too_long' | 'name_collision';
|
|
149
|
+
}
|
|
150
|
+
export type McpAppLocalToolDescriptor = McpAppLocalReadToolDescriptor | McpAppLocalActionToolDescriptor | McpAppLocalSingleActionToolDescriptor;
|
|
151
|
+
export interface McpAppLocalRegistration {
|
|
152
|
+
readonly appId: string;
|
|
153
|
+
readonly name: string;
|
|
154
|
+
readonly description: string;
|
|
155
|
+
readonly icon?: string;
|
|
156
|
+
readonly tone?: McpAppTone;
|
|
157
|
+
readonly builtinOnly: false;
|
|
158
|
+
readonly definition: UiDefinition;
|
|
159
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
160
|
+
readonly resource: McpAppLocalResource;
|
|
161
|
+
readonly tools: readonly McpAppLocalToolDescriptor[];
|
|
162
|
+
readonly toolDiagnostics: readonly McpAppLocalToolDiagnostic[];
|
|
163
|
+
}
|
|
164
|
+
export interface McpAppBuiltinRegistration {
|
|
165
|
+
readonly appId: string;
|
|
166
|
+
readonly name: string;
|
|
167
|
+
readonly description: string;
|
|
168
|
+
readonly icon?: string;
|
|
169
|
+
readonly tone?: McpAppTone;
|
|
170
|
+
readonly builtinOnly: boolean;
|
|
171
|
+
readonly uiUri: string;
|
|
172
|
+
readonly definition?: UiDefinition;
|
|
173
|
+
readonly resourceBinding: McpAppMcpResourceBinding;
|
|
174
|
+
readonly resource: McpAppResource;
|
|
175
|
+
readonly tools: readonly McpAppToolDescriptor[];
|
|
176
|
+
readonly descriptor: McpAppDescriptor;
|
|
177
|
+
}
|
|
178
|
+
export type McpAppResolvedRegistration = McpAppLocalRegistration | McpAppBuiltinRegistration;
|
|
179
|
+
export interface McpAppLocalLauncher {
|
|
180
|
+
readonly appId: string;
|
|
181
|
+
readonly name: string;
|
|
182
|
+
readonly description: string;
|
|
183
|
+
readonly icon?: string;
|
|
184
|
+
readonly tone?: McpAppTone;
|
|
185
|
+
readonly builtinOnly: false;
|
|
186
|
+
readonly definition: UiDefinitionRef;
|
|
187
|
+
readonly entryHash: string;
|
|
188
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
189
|
+
readonly tools: readonly McpAppLocalToolDescriptor[];
|
|
190
|
+
}
|
|
191
|
+
export interface McpAppBuiltinLauncher {
|
|
192
|
+
readonly appId: string;
|
|
193
|
+
readonly name: string;
|
|
194
|
+
readonly description: string;
|
|
195
|
+
readonly icon?: string;
|
|
196
|
+
readonly tone?: McpAppTone;
|
|
197
|
+
readonly builtinOnly: boolean;
|
|
198
|
+
readonly uiUri: string;
|
|
199
|
+
readonly definition?: UiDefinitionRef;
|
|
200
|
+
readonly resourceBinding: McpAppMcpResourceBinding;
|
|
201
|
+
readonly tools: readonly McpAppToolDescriptor[];
|
|
202
|
+
}
|
|
203
|
+
export type McpAppLauncher = McpAppLocalLauncher | McpAppBuiltinLauncher;
|
|
204
|
+
export type WorkspaceAppLauncher = McpAppLauncher;
|
|
205
|
+
export type WorkspaceAppResolvedRegistration = McpAppResolvedRegistration;
|
|
206
|
+
export interface McpAppWorkspaceRegistry {
|
|
207
|
+
getMcpApp(appId: string): McpAppDescriptor | null;
|
|
208
|
+
listMcpApps(): readonly McpAppDescriptor[];
|
|
209
|
+
listMcpAppTools(): readonly McpAppToolDescriptor[];
|
|
210
|
+
resolveMcpAppTool(toolName: string): McpAppToolDescriptor | null;
|
|
211
|
+
resolveMcpAppResource(uri: string): McpAppResource | null;
|
|
212
|
+
requireMcpAppResource(uri: string): McpAppResource;
|
|
213
|
+
listLocalMcpApps(): readonly McpAppLocalRegistration[];
|
|
214
|
+
getLocalMcpApp(appId: string): McpAppLocalRegistration | null;
|
|
215
|
+
listLocalMcpAppTools(): readonly McpAppLocalToolDescriptor[];
|
|
216
|
+
resolveLocalMcpAppTool(toolName: string): McpAppLocalToolDescriptor | null;
|
|
217
|
+
resolveLocalMcpAppResource(appId: string, definitionHash?: string): McpAppLocalResource | null;
|
|
218
|
+
listRegistrations(): readonly McpAppResolvedRegistration[];
|
|
219
|
+
getRegistration(appId: string): McpAppResolvedRegistration | null;
|
|
220
|
+
listLaunchers(): readonly McpAppLauncher[];
|
|
221
|
+
getLauncher(appId: string): McpAppLauncher | null;
|
|
222
|
+
resolveDefinition(ref: UiDefinitionRef): UiDefinition | null;
|
|
223
|
+
resolveActionHandler(definitionId: string, version: number, actionId: string): UiActionHandlerRegistration | null;
|
|
224
|
+
}
|
|
225
|
+
export type WorkspaceAppRegistry = McpAppWorkspaceRegistry;
|
|
226
|
+
export interface McpAppWorkspaceRegistryInput {
|
|
227
|
+
readonly builtins?: McpAppRegistry;
|
|
228
|
+
readonly builtin?: McpAppRegistry;
|
|
229
|
+
readonly localApps?: readonly McpAppLocalRegistration[];
|
|
230
|
+
readonly locals?: readonly McpAppLocalRegistration[];
|
|
231
|
+
readonly definitions?: readonly UiDefinition[];
|
|
232
|
+
readonly handlers?: readonly UiActionHandlerRegistration[];
|
|
233
|
+
}
|
|
234
|
+
export interface McpAppToolMetadata {
|
|
235
|
+
readonly ui: {
|
|
236
|
+
readonly resourceUri: string;
|
|
237
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
export type McpAppToolDescriptor = (McpAppReadToolInput & McpAppToolDescriptorMetadata) | (McpAppActionToolDescriptor & McpAppToolDescriptorMetadata) | (McpAppHostToolInput & McpAppToolDescriptorMetadata);
|
|
241
|
+
export interface McpAppToolRegistration {
|
|
242
|
+
readonly name: string;
|
|
243
|
+
readonly description: string;
|
|
244
|
+
readonly inputSchema: McpAppInputSchema;
|
|
245
|
+
readonly _meta: McpAppToolMetadata;
|
|
246
|
+
}
|
|
247
|
+
export interface McpAppDescriptor {
|
|
248
|
+
readonly appId: string;
|
|
249
|
+
readonly name: string;
|
|
250
|
+
readonly description: string;
|
|
251
|
+
readonly icon?: string;
|
|
252
|
+
readonly tone?: McpAppTone;
|
|
253
|
+
readonly builtinOnly: boolean;
|
|
254
|
+
readonly csp?: McpUiResourceCsp;
|
|
255
|
+
readonly uiUri: string;
|
|
256
|
+
readonly html: string;
|
|
257
|
+
readonly definition?: UiDefinition;
|
|
258
|
+
readonly tools: readonly McpAppToolDescriptor[];
|
|
259
|
+
}
|
|
260
|
+
export interface McpAppToolResult {
|
|
261
|
+
readonly content: readonly [{
|
|
262
|
+
readonly type: 'text';
|
|
263
|
+
readonly text: string;
|
|
264
|
+
}];
|
|
265
|
+
readonly structuredContent?: JsonObject;
|
|
266
|
+
readonly _meta?: JsonObject;
|
|
267
|
+
}
|
|
268
|
+
export interface McpAppButtonInput {
|
|
269
|
+
readonly id: string;
|
|
270
|
+
readonly label: string;
|
|
271
|
+
readonly enabled: boolean;
|
|
272
|
+
readonly confirmation?: UiActionConfirmation;
|
|
273
|
+
readonly requiresHumanConfirmation?: boolean;
|
|
274
|
+
readonly disabledReason?: string;
|
|
275
|
+
readonly inputSchema: McpAppInputSchema;
|
|
276
|
+
}
|
|
277
|
+
export interface McpAppServerStateInput {
|
|
278
|
+
readonly source: 'server';
|
|
279
|
+
readonly instance: Pick<UiInstance, 'id' | 'definition' | 'revision' | 'status' | 'state'>;
|
|
280
|
+
readonly definition: UiDefinition;
|
|
281
|
+
readonly buttons: readonly McpAppButtonInput[];
|
|
282
|
+
}
|
|
283
|
+
export interface McpAppButtonDescriptor {
|
|
284
|
+
readonly id: string;
|
|
285
|
+
readonly label: string;
|
|
286
|
+
readonly enabled: boolean;
|
|
287
|
+
readonly confirmation: UiActionConfirmation;
|
|
288
|
+
readonly requiresHumanConfirmation?: boolean;
|
|
289
|
+
readonly disabledReason: string | null;
|
|
290
|
+
readonly inputSchema: McpAppInputSchema;
|
|
291
|
+
}
|
|
292
|
+
export interface McpAppStateDescriptor {
|
|
293
|
+
readonly schemaVersion: 1;
|
|
294
|
+
readonly source: 'server';
|
|
295
|
+
readonly instanceId: string;
|
|
296
|
+
readonly definition: UiDefinitionRef;
|
|
297
|
+
readonly revision: number;
|
|
298
|
+
readonly status: UiInstanceStatus;
|
|
299
|
+
readonly state: JsonObject;
|
|
300
|
+
readonly buttons: readonly McpAppButtonDescriptor[];
|
|
301
|
+
}
|
|
302
|
+
export interface McpAppStateProjections {
|
|
303
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
304
|
+
readonly card: McpAppStateDescriptor;
|
|
305
|
+
readonly developer: {
|
|
306
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
307
|
+
readonly json: string;
|
|
308
|
+
};
|
|
309
|
+
readonly ai: {
|
|
310
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
311
|
+
readonly json: string;
|
|
312
|
+
readonly xml: string;
|
|
313
|
+
readonly omittedPaths?: readonly string[];
|
|
314
|
+
};
|
|
315
|
+
readonly focusedAi: {
|
|
316
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
317
|
+
readonly json: string;
|
|
318
|
+
readonly xml: string;
|
|
319
|
+
readonly omittedPaths?: readonly string[];
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
export interface McpAppRegistry {
|
|
323
|
+
registerMcpApp(input: McpAppDescriptorInput): McpAppDescriptor;
|
|
324
|
+
getMcpApp(appId: string): McpAppDescriptor | null;
|
|
325
|
+
listMcpApps(): readonly McpAppDescriptor[];
|
|
326
|
+
listMcpAppTools(): readonly McpAppToolDescriptor[];
|
|
327
|
+
resolveMcpAppTool(toolName: string): McpAppToolDescriptor | null;
|
|
328
|
+
resolveMcpAppResource(uri: string): McpAppResource | null;
|
|
329
|
+
requireMcpAppResource(uri: string): McpAppResource;
|
|
330
|
+
}
|
|
331
|
+
export type CrewxAppCapability = 'screen' | 'skill';
|
|
332
|
+
export type CrewxAppOrigin = 'local' | 'installed' | 'builtin';
|
|
333
|
+
export type CrewxAppOwnership = 'mine' | 'external' | 'unknown';
|
|
334
|
+
export type CrewxAppShareability = 'shareable' | 'requiresPublish' | 'forbidden' | 'unknown';
|
|
335
|
+
export type CrewxAppSharingAvailability = 'ready' | 'loginRequired' | 'unavailable';
|
|
336
|
+
export interface CrewxAppLocalDefinitionRef {
|
|
337
|
+
readonly packageRoot: string;
|
|
338
|
+
}
|
|
339
|
+
export interface CrewxAppDefinitionSummary extends UiDefinitionRef {
|
|
340
|
+
readonly usage: UiDefinitionUsage;
|
|
341
|
+
readonly detailPanel?: boolean;
|
|
342
|
+
readonly displayModes?: readonly UiDefinitionDisplayMode[];
|
|
343
|
+
}
|
|
344
|
+
export interface CrewxAppDefinitionHashInput {
|
|
345
|
+
readonly screenHash?: string;
|
|
346
|
+
readonly skillHash?: string;
|
|
347
|
+
readonly relativePath?: string;
|
|
348
|
+
readonly fileBytes?: Uint8Array | ArrayBuffer | readonly number[] | string;
|
|
349
|
+
}
|
|
350
|
+
export interface CrewxAppSummary {
|
|
351
|
+
readonly appId: string;
|
|
352
|
+
readonly name: string;
|
|
353
|
+
readonly description: string;
|
|
354
|
+
readonly version?: string;
|
|
355
|
+
readonly capabilities: readonly CrewxAppCapability[];
|
|
356
|
+
readonly definition?: CrewxAppDefinitionSummary;
|
|
357
|
+
readonly skillName?: string;
|
|
358
|
+
readonly localDefinitionRef?: CrewxAppLocalDefinitionRef;
|
|
359
|
+
readonly origin: CrewxAppOrigin;
|
|
360
|
+
readonly ownership: CrewxAppOwnership;
|
|
361
|
+
readonly shareability: CrewxAppShareability;
|
|
362
|
+
readonly sharingAvailability: CrewxAppSharingAvailability;
|
|
363
|
+
readonly marketplaceContentId?: string;
|
|
364
|
+
readonly slug?: string;
|
|
365
|
+
readonly definitionHash: string;
|
|
366
|
+
}
|
|
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';
|
|
369
|
+
export interface CrewxAppDiagnostic {
|
|
370
|
+
readonly code: CrewxAppDiagnosticCode;
|
|
371
|
+
readonly source: CrewxAppDiagnosticSource;
|
|
372
|
+
readonly relativePath: string;
|
|
373
|
+
readonly appId?: string;
|
|
374
|
+
}
|
|
375
|
+
export interface CrewxAppInstalledProjection {
|
|
376
|
+
readonly packageRoot?: string;
|
|
377
|
+
readonly relativePath?: string;
|
|
378
|
+
readonly packageRootPath?: string;
|
|
379
|
+
readonly appId?: string;
|
|
380
|
+
readonly definitionHash?: string;
|
|
381
|
+
readonly marketplaceContentId?: string;
|
|
382
|
+
readonly slug?: string;
|
|
383
|
+
}
|
|
384
|
+
export type CrewxAppBuiltinCatalog = Pick<McpAppRegistry, 'listMcpApps' | 'listMcpAppTools'>;
|
|
385
|
+
export interface CrewxAppCatalogOptions {
|
|
386
|
+
readonly filesystem?: AppDiscoveryFileSystem;
|
|
387
|
+
readonly builtinCatalog?: CrewxAppBuiltinCatalog;
|
|
388
|
+
readonly installed?: readonly CrewxAppInstalledProjection[];
|
|
389
|
+
}
|
|
390
|
+
export interface CrewxAppCatalogResult {
|
|
391
|
+
readonly items: readonly CrewxAppSummary[];
|
|
392
|
+
readonly diagnostics: readonly CrewxAppDiagnostic[];
|
|
393
|
+
}
|
|
394
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type AppDiscoveryFileSystem, type WorkspaceAppDiscoveryIncompleteReason, type WorkspaceAppDiagnostic, type WorkspaceAppDiscoveryOptions, type WorkspaceAppDiscoveryResult, type WorkspaceAppSource } from './discovery.js';
|
|
2
|
+
import { type SkillBackendExecutionPort } from './skill-backend.js';
|
|
3
|
+
import type { JsonObject, UiActionHandlerRegistration, UiDefinition, UiDefinitionRef } from '../ui-instance/types.js';
|
|
4
|
+
import type { McpAppLauncher, McpAppLocalResource, McpAppRegistry, McpAppWorkspaceRegistry } from './types.js';
|
|
5
|
+
export interface WorkspaceAppSnapshotResource extends McpAppLocalResource {
|
|
6
|
+
readonly appId: string;
|
|
7
|
+
readonly definition: UiDefinitionRef;
|
|
8
|
+
readonly source: WorkspaceAppSource;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkspaceAppSnapshotInitialState {
|
|
11
|
+
readonly appId: string;
|
|
12
|
+
readonly definition: UiDefinitionRef;
|
|
13
|
+
readonly hash: string;
|
|
14
|
+
readonly bytes: readonly number[];
|
|
15
|
+
readonly state: JsonObject;
|
|
16
|
+
}
|
|
17
|
+
export type WorkspaceAppInitialState = WorkspaceAppSnapshotInitialState;
|
|
18
|
+
export interface WorkspaceAppSnapshotBuildOptions {
|
|
19
|
+
readonly builtins?: McpAppRegistry;
|
|
20
|
+
readonly builtin?: McpAppRegistry;
|
|
21
|
+
readonly registry?: McpAppRegistry;
|
|
22
|
+
readonly skillBackend?: SkillBackendExecutionPort;
|
|
23
|
+
}
|
|
24
|
+
export type WorkspaceAppSnapshotOptions = WorkspaceAppDiscoveryOptions & WorkspaceAppSnapshotBuildOptions;
|
|
25
|
+
export interface WorkspaceAppSnapshot {
|
|
26
|
+
readonly snapshotHash: string;
|
|
27
|
+
readonly launchers: readonly McpAppLauncher[];
|
|
28
|
+
readonly definitions: readonly UiDefinition[];
|
|
29
|
+
readonly actionHandlers: readonly UiActionHandlerRegistration[];
|
|
30
|
+
readonly resources: readonly WorkspaceAppSnapshotResource[];
|
|
31
|
+
readonly initialStates: readonly WorkspaceAppSnapshotInitialState[];
|
|
32
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
33
|
+
readonly registry: McpAppWorkspaceRegistry;
|
|
34
|
+
resolveDefinition(ref: UiDefinitionRef): UiDefinition | null;
|
|
35
|
+
resolveActionHandler(definitionId: string, version: number, actionId: string): UiActionHandlerRegistration | null;
|
|
36
|
+
resolveResource(appId: string, definitionHash?: string): WorkspaceAppSnapshotResource | null;
|
|
37
|
+
}
|
|
38
|
+
export type WorkspaceAppSnapshotReconfirmResult = {
|
|
39
|
+
readonly kind: 'same_generation';
|
|
40
|
+
readonly snapshot: WorkspaceAppSnapshot;
|
|
41
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
42
|
+
} | {
|
|
43
|
+
readonly kind: 'new_generation';
|
|
44
|
+
readonly previousSnapshot: WorkspaceAppSnapshot;
|
|
45
|
+
readonly snapshot: WorkspaceAppSnapshot;
|
|
46
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: 'incomplete';
|
|
49
|
+
readonly reason: WorkspaceAppDiscoveryIncompleteReason;
|
|
50
|
+
readonly snapshot: WorkspaceAppSnapshot;
|
|
51
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'io_error';
|
|
54
|
+
readonly snapshot: WorkspaceAppSnapshot;
|
|
55
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
56
|
+
};
|
|
57
|
+
export declare function buildWorkspaceAppSnapshot(discovery: WorkspaceAppDiscoveryResult, options?: WorkspaceAppSnapshotBuildOptions): WorkspaceAppSnapshot;
|
|
58
|
+
export declare function discoverWorkspaceAppSnapshot(workspaceRoot: string, options?: WorkspaceAppSnapshotOptions): Promise<WorkspaceAppSnapshot>;
|
|
59
|
+
export declare function discoverWorkspaceAppSnapshot(workspaceRoot: string, filesystem: AppDiscoveryFileSystem, options?: WorkspaceAppSnapshotOptions): Promise<WorkspaceAppSnapshot>;
|
|
60
|
+
export declare function reconfirmWorkspaceAppSnapshot(workspaceRoot: string, currentSnapshot: WorkspaceAppSnapshot, options?: WorkspaceAppSnapshotOptions): Promise<WorkspaceAppSnapshotReconfirmResult>;
|
|
61
|
+
export declare function reconfirmWorkspaceAppSnapshot(workspaceRoot: string, currentSnapshot: WorkspaceAppSnapshot, filesystem: AppDiscoveryFileSystem, options?: WorkspaceAppSnapshotOptions): Promise<WorkspaceAppSnapshotReconfirmResult>;
|