@crewx/sdk 0.9.0-rc.13 → 0.9.0-rc.130
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 +931 -224
- package/dist/esm/node/index.js +2 -0
- package/dist/esm/plugins/index.js +338 -214
- package/dist/esm/process/index.js +1 -0
- package/dist/esm/publish/index.js +2 -0
- package/dist/esm/repository/index.js +413 -211
- package/dist/esm/skills/index.js +2 -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 +17 -1
- package/dist/index.browser.js +6 -2
- package/dist/index.d.ts +122 -17
- package/dist/index.js +931 -224
- 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 +26 -0
- package/dist/mcp-app/apps-context.d.ts +6 -0
- package/dist/mcp-app/bundle-provenance.d.ts +3 -0
- package/dist/mcp-app/catalog.d.ts +7 -0
- package/dist/mcp-app/content-channel.d.ts +89 -0
- package/dist/mcp-app/content-declarations.d.ts +29 -0
- package/dist/mcp-app/dev-checks.d.ts +28 -0
- package/dist/mcp-app/discovery.d.ts +139 -0
- package/dist/mcp-app/errors.d.ts +7 -0
- package/dist/mcp-app/index.d.ts +33 -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/product-bundle-assets.d.ts +27 -0
- package/dist/mcp-app/product-bundle-loader.d.ts +53 -0
- package/dist/mcp-app/projection.d.ts +13 -0
- package/dist/mcp-app/registry.d.ts +28 -0
- package/dist/mcp-app/skill-backend.d.ts +133 -0
- package/dist/mcp-app/state-set.d.ts +9 -0
- package/dist/mcp-app/types.d.ts +458 -0
- package/dist/mcp-app/workspace-app-assets.d.ts +38 -0
- package/dist/mcp-app/workspace-snapshot.d.ts +70 -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/0034_keen_fallen_one.sql +36 -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/0034_snapshot.json +3473 -0
- package/dist/migrations/meta/_journal.json +175 -0
- 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 +338 -214
- 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 +37 -5
- package/dist/repository/index.js +413 -211
- 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 +224 -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 +72 -6
- package/dist/repository/usage-backfill.d.ts +62 -0
- package/dist/repository/usage-from-logs.d.ts +21 -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 +358 -0
- package/dist/schema/ui-instance-repins.d.ts +222 -0
- package/dist/schema/ui-instances.d.ts +305 -0
- package/dist/schema/workspaces.d.ts +17 -0
- package/dist/skills/index.d.ts +15 -0
- package/dist/skills/index.js +2 -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 +18 -0
- package/dist/ui-instance/index.d.ts +11 -0
- package/dist/ui-instance/json.d.ts +19 -0
- package/dist/ui-instance/lineage.d.ts +22 -0
- package/dist/ui-instance/runtime.d.ts +18 -0
- package/dist/ui-instance/store.d.ts +184 -0
- package/dist/ui-instance/types.d.ts +308 -0
- package/dist/ui-plugin/csp.d.ts +25 -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 +190 -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 +49 -2
- package/templates/agents/default.yaml +284 -128
- package/templates/documents/crewx-manual.md +138 -138
- package/templates/documents/crewx-quick-guide.md +8 -7
- package/templates/workflows/wi-default-flow.yaml +65 -0
- package/templates/workflows/wi-plan-flow.yaml +140 -0
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
import type { JsonObject, UiDefinition, UiDefinitionRef, UiDefinitionDisplayMode, UiDefinitionUsage, UiProjectionPolicy, UiInstance, UiInstanceStatus, UiActionConfirmation, UiActionHandlerRegistration } from '../ui-instance/types.js';
|
|
2
|
+
import type { AppDiscoveryFileSystem, ProductAppBundleInput, ProductAppBundleProvenance, ProductAppBundleSnapshotMetadata } from './discovery.js';
|
|
3
|
+
import type { UiPluginManifestV2 } from '../ui-plugin/types.js';
|
|
4
|
+
export declare const MCP_APP_RESOURCE_MIME_TYPE: "text/html;profile=mcp-app";
|
|
5
|
+
export declare const MCP_APP_RESOURCE_URI_PREFIX = "ui://crewx/";
|
|
6
|
+
export type McpAppToolVisibility = 'model' | 'app';
|
|
7
|
+
export type McpAppTone = 'blue' | 'violet' | 'emerald' | 'amber' | 'rose' | 'sky' | 'slate' | 'indigo';
|
|
8
|
+
export declare const MCP_APP_HOST_TOOL_ALLOWLIST: readonly ["crewx_app_terminal_connect", "crewx_app_html_viewer_open"];
|
|
9
|
+
export type McpAppHostToolName = typeof MCP_APP_HOST_TOOL_ALLOWLIST[number];
|
|
10
|
+
export declare const MCP_CORE_TOOL_NAMES: readonly ["crewx_listWorkspaces", "crewx_queryAgent", "crewx_executeAgent", "crewx_getTaskResult", "crewx_listTasks", "crewx_listAgents", "callBrowser", "openTab", "listTabs", "closeTab"];
|
|
11
|
+
export type McpCoreToolName = typeof MCP_CORE_TOOL_NAMES[number];
|
|
12
|
+
export interface McpUiResourceCsp {
|
|
13
|
+
readonly connectDomains?: readonly string[];
|
|
14
|
+
readonly resourceDomains?: readonly string[];
|
|
15
|
+
readonly frameDomains?: readonly string[];
|
|
16
|
+
readonly baseUriDomains?: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export type McpAppInputSchema = JsonObject;
|
|
19
|
+
export interface McpAppToolCommonInput {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly description: string;
|
|
22
|
+
readonly inputSchema: McpAppInputSchema;
|
|
23
|
+
readonly textFallback: string;
|
|
24
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
25
|
+
}
|
|
26
|
+
export interface McpAppReadToolInput extends McpAppToolCommonInput {
|
|
27
|
+
readonly kind: 'read';
|
|
28
|
+
readonly actionId?: never;
|
|
29
|
+
readonly fixedResult?: McpAppFixedResult;
|
|
30
|
+
}
|
|
31
|
+
export interface McpAppFixedResult {
|
|
32
|
+
readonly structuredContent: JsonObject;
|
|
33
|
+
readonly argsPolicy: 'empty-only' | 'ignore';
|
|
34
|
+
}
|
|
35
|
+
export interface McpAppSingleActionToolInput extends McpAppToolCommonInput {
|
|
36
|
+
readonly kind: 'action';
|
|
37
|
+
readonly actionId: string;
|
|
38
|
+
readonly actionIds?: never;
|
|
39
|
+
}
|
|
40
|
+
export interface McpAppActionDispatcherToolInput extends McpAppToolCommonInput {
|
|
41
|
+
readonly kind: 'action';
|
|
42
|
+
readonly actionId?: never;
|
|
43
|
+
readonly actionIds: readonly string[];
|
|
44
|
+
}
|
|
45
|
+
export type McpAppActionToolInput = McpAppSingleActionToolInput | McpAppActionDispatcherToolInput;
|
|
46
|
+
export type McpAppActionToolDescriptor = (Omit<McpAppSingleActionToolInput, 'actionIds'> & {
|
|
47
|
+
readonly actionIds: readonly string[];
|
|
48
|
+
}) | (Omit<McpAppActionDispatcherToolInput, 'actionId'> & {
|
|
49
|
+
readonly actionIds: readonly string[];
|
|
50
|
+
});
|
|
51
|
+
type McpAppToolDescriptorMetadata = {
|
|
52
|
+
readonly appId?: string;
|
|
53
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
54
|
+
readonly resourceUri: string;
|
|
55
|
+
readonly _meta: McpAppToolMetadata;
|
|
56
|
+
};
|
|
57
|
+
export interface McpAppHostToolInput extends Omit<McpAppToolCommonInput, 'name' | 'visibility'> {
|
|
58
|
+
readonly name: McpAppHostToolName;
|
|
59
|
+
readonly kind: 'host';
|
|
60
|
+
readonly visibility: readonly ['app'];
|
|
61
|
+
readonly actionId?: never;
|
|
62
|
+
}
|
|
63
|
+
export type McpAppToolInput = McpAppReadToolInput | McpAppActionToolInput | McpAppHostToolInput;
|
|
64
|
+
export interface McpAppDescriptorInput {
|
|
65
|
+
readonly appId: string;
|
|
66
|
+
readonly html: string;
|
|
67
|
+
readonly name?: string;
|
|
68
|
+
readonly description?: string;
|
|
69
|
+
readonly icon?: string;
|
|
70
|
+
readonly tone?: McpAppTone;
|
|
71
|
+
readonly builtinOnly?: boolean;
|
|
72
|
+
readonly csp?: McpUiResourceCsp;
|
|
73
|
+
readonly tools: readonly McpAppToolInput[];
|
|
74
|
+
readonly definition?: UiDefinition;
|
|
75
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
76
|
+
readonly entryBytes?: Uint8Array | readonly number[];
|
|
77
|
+
}
|
|
78
|
+
export interface McpAppResource {
|
|
79
|
+
readonly uri: string;
|
|
80
|
+
readonly mimeType: typeof MCP_APP_RESOURCE_MIME_TYPE;
|
|
81
|
+
readonly text: string;
|
|
82
|
+
readonly _meta?: {
|
|
83
|
+
readonly ui?: {
|
|
84
|
+
readonly csp?: McpUiResourceCsp;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export declare const MCP_APP_LOCAL_RESOURCE_MIME_TYPE: "text/html";
|
|
89
|
+
export interface McpAppInstanceResourceBinding {
|
|
90
|
+
readonly kind: 'instance';
|
|
91
|
+
}
|
|
92
|
+
export interface McpAppMcpResourceBinding {
|
|
93
|
+
readonly kind: 'mcp';
|
|
94
|
+
readonly uri: string;
|
|
95
|
+
}
|
|
96
|
+
export type McpAppResourceBinding = McpAppInstanceResourceBinding | McpAppMcpResourceBinding;
|
|
97
|
+
export interface McpAppLocalResource {
|
|
98
|
+
readonly mimeType: typeof MCP_APP_LOCAL_RESOURCE_MIME_TYPE;
|
|
99
|
+
readonly entryHash: string;
|
|
100
|
+
readonly html: string;
|
|
101
|
+
readonly bytes: readonly number[];
|
|
102
|
+
readonly initialState?: {
|
|
103
|
+
readonly hash: string;
|
|
104
|
+
readonly bytes: readonly number[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export interface McpAppLocalRegistrationInput {
|
|
108
|
+
readonly appId: string;
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly description: string;
|
|
111
|
+
readonly icon?: string;
|
|
112
|
+
readonly tone?: McpAppTone;
|
|
113
|
+
readonly csp?: McpUiResourceCsp;
|
|
114
|
+
readonly runtime?: NonNullable<UiPluginManifestV2['runtime']>;
|
|
115
|
+
readonly definition: UiDefinition;
|
|
116
|
+
readonly html: string;
|
|
117
|
+
readonly entryHash: string;
|
|
118
|
+
readonly entryBytes?: readonly number[];
|
|
119
|
+
readonly initialState?: JsonObject;
|
|
120
|
+
readonly initialStateHash?: string;
|
|
121
|
+
readonly initialStateBytes?: readonly number[];
|
|
122
|
+
readonly readToolName: string;
|
|
123
|
+
readonly actionToolName?: string;
|
|
124
|
+
readonly modelActions?: readonly string[];
|
|
125
|
+
readonly actions: readonly {
|
|
126
|
+
readonly actionId: string;
|
|
127
|
+
readonly inputSchema: McpAppInputSchema;
|
|
128
|
+
readonly backend?: {
|
|
129
|
+
readonly type: 'core';
|
|
130
|
+
readonly handler: string;
|
|
131
|
+
} | {
|
|
132
|
+
readonly type: 'skill';
|
|
133
|
+
readonly command?: readonly string[];
|
|
134
|
+
};
|
|
135
|
+
}[];
|
|
136
|
+
}
|
|
137
|
+
export interface McpAppLocalReadToolDescriptor extends McpAppToolCommonInput {
|
|
138
|
+
readonly kind: 'read';
|
|
139
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
140
|
+
readonly actionIds?: never;
|
|
141
|
+
}
|
|
142
|
+
export interface McpAppLocalActionToolDescriptor extends McpAppToolCommonInput {
|
|
143
|
+
readonly kind: 'action';
|
|
144
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
145
|
+
readonly actionIds: readonly string[];
|
|
146
|
+
}
|
|
147
|
+
export interface McpAppLocalSingleActionToolDescriptor extends McpAppToolCommonInput {
|
|
148
|
+
readonly kind: 'action';
|
|
149
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
150
|
+
readonly actionId: string;
|
|
151
|
+
readonly actionIds: readonly [string];
|
|
152
|
+
readonly _meta: {
|
|
153
|
+
readonly ui: {
|
|
154
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export interface McpAppLocalHostToolDescriptor extends Omit<McpAppToolCommonInput, 'name' | 'visibility'> {
|
|
159
|
+
readonly name: McpAppHostToolName;
|
|
160
|
+
readonly kind: 'host';
|
|
161
|
+
readonly visibility: readonly ['app'];
|
|
162
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
163
|
+
readonly actionId?: never;
|
|
164
|
+
}
|
|
165
|
+
export interface McpAppLocalToolDiagnostic {
|
|
166
|
+
readonly toolName: string;
|
|
167
|
+
readonly actionId: string;
|
|
168
|
+
readonly reason: 'name_too_long' | 'name_collision';
|
|
169
|
+
}
|
|
170
|
+
export type McpAppLocalToolDescriptor = McpAppLocalReadToolDescriptor | McpAppLocalActionToolDescriptor | McpAppLocalSingleActionToolDescriptor | McpAppLocalHostToolDescriptor;
|
|
171
|
+
export interface McpAppLocalRegistration {
|
|
172
|
+
readonly appId: string;
|
|
173
|
+
readonly name: string;
|
|
174
|
+
readonly description: string;
|
|
175
|
+
readonly icon?: string;
|
|
176
|
+
readonly tone?: McpAppTone;
|
|
177
|
+
readonly builtinOnly: false;
|
|
178
|
+
readonly definition: UiDefinition;
|
|
179
|
+
readonly runtime?: NonNullable<UiPluginManifestV2['runtime']>;
|
|
180
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
181
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
182
|
+
readonly resource: McpAppLocalResource;
|
|
183
|
+
readonly tools: readonly McpAppLocalToolDescriptor[];
|
|
184
|
+
readonly toolDiagnostics: readonly McpAppLocalToolDiagnostic[];
|
|
185
|
+
}
|
|
186
|
+
export interface McpAppBuiltinRegistration {
|
|
187
|
+
readonly appId: string;
|
|
188
|
+
readonly name: string;
|
|
189
|
+
readonly description: string;
|
|
190
|
+
readonly icon?: string;
|
|
191
|
+
readonly tone?: McpAppTone;
|
|
192
|
+
readonly builtinOnly: boolean;
|
|
193
|
+
readonly uiUri: string;
|
|
194
|
+
readonly definition?: UiDefinition;
|
|
195
|
+
readonly resourceBinding: McpAppMcpResourceBinding;
|
|
196
|
+
readonly resource: McpAppResource;
|
|
197
|
+
readonly tools: readonly McpAppToolDescriptor[];
|
|
198
|
+
readonly descriptor: McpAppDescriptor;
|
|
199
|
+
}
|
|
200
|
+
export type McpAppResolvedRegistration = McpAppLocalRegistration | McpAppBuiltinRegistration;
|
|
201
|
+
export interface McpAppLocalLauncher {
|
|
202
|
+
readonly appId: string;
|
|
203
|
+
readonly name: string;
|
|
204
|
+
readonly description: string;
|
|
205
|
+
readonly icon?: string;
|
|
206
|
+
readonly tone?: McpAppTone;
|
|
207
|
+
readonly builtinOnly: false;
|
|
208
|
+
readonly definition: UiDefinitionRef;
|
|
209
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
210
|
+
readonly entryHash: string;
|
|
211
|
+
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
212
|
+
readonly tools: readonly McpAppLocalToolDescriptor[];
|
|
213
|
+
}
|
|
214
|
+
export interface McpAppBuiltinLauncher {
|
|
215
|
+
readonly appId: string;
|
|
216
|
+
readonly name: string;
|
|
217
|
+
readonly description: string;
|
|
218
|
+
readonly icon?: string;
|
|
219
|
+
readonly tone?: McpAppTone;
|
|
220
|
+
readonly builtinOnly: boolean;
|
|
221
|
+
readonly uiUri: string;
|
|
222
|
+
readonly definition?: UiDefinitionRef;
|
|
223
|
+
readonly resourceBinding: McpAppMcpResourceBinding;
|
|
224
|
+
readonly tools: readonly McpAppToolDescriptor[];
|
|
225
|
+
}
|
|
226
|
+
export type McpAppLauncher = McpAppLocalLauncher | McpAppBuiltinLauncher;
|
|
227
|
+
export type WorkspaceAppLauncher = McpAppLauncher;
|
|
228
|
+
export type WorkspaceAppResolvedRegistration = McpAppResolvedRegistration;
|
|
229
|
+
export interface McpAppWorkspaceRegistry {
|
|
230
|
+
getMcpApp(appId: string): McpAppDescriptor | null;
|
|
231
|
+
listMcpApps(): readonly McpAppDescriptor[];
|
|
232
|
+
listMcpAppTools(): readonly McpAppToolDescriptor[];
|
|
233
|
+
resolveMcpAppTool(toolName: string): McpAppToolDescriptor | null;
|
|
234
|
+
resolveMcpAppResource(uri: string): McpAppResource | null;
|
|
235
|
+
requireMcpAppResource(uri: string): McpAppResource;
|
|
236
|
+
listLocalMcpApps(): readonly McpAppLocalRegistration[];
|
|
237
|
+
getLocalMcpApp(appId: string): McpAppLocalRegistration | null;
|
|
238
|
+
listLocalMcpAppTools(): readonly McpAppLocalToolDescriptor[];
|
|
239
|
+
resolveLocalMcpAppTool(toolName: string): McpAppLocalToolDescriptor | null;
|
|
240
|
+
resolveLocalMcpAppResource(appId: string, definitionHash?: string): McpAppLocalResource | null;
|
|
241
|
+
listRegistrations(): readonly McpAppResolvedRegistration[];
|
|
242
|
+
getRegistration(appId: string): McpAppResolvedRegistration | null;
|
|
243
|
+
listLaunchers(): readonly McpAppLauncher[];
|
|
244
|
+
getLauncher(appId: string): McpAppLauncher | null;
|
|
245
|
+
resolveDefinition(ref: UiDefinitionRef): UiDefinition | null;
|
|
246
|
+
resolveActionHandler(definitionId: string, version: number, actionId: string): UiActionHandlerRegistration | null;
|
|
247
|
+
}
|
|
248
|
+
export type WorkspaceAppRegistry = McpAppWorkspaceRegistry;
|
|
249
|
+
export interface McpAppWorkspaceRegistryInput {
|
|
250
|
+
readonly builtins?: McpAppRegistry;
|
|
251
|
+
readonly builtin?: McpAppRegistry;
|
|
252
|
+
readonly localApps?: readonly McpAppLocalRegistration[];
|
|
253
|
+
readonly locals?: readonly McpAppLocalRegistration[];
|
|
254
|
+
readonly definitions?: readonly UiDefinition[];
|
|
255
|
+
readonly handlers?: readonly UiActionHandlerRegistration[];
|
|
256
|
+
}
|
|
257
|
+
export interface McpAppToolMetadata {
|
|
258
|
+
readonly ui: {
|
|
259
|
+
readonly resourceUri: string;
|
|
260
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
export type McpAppToolDescriptor = (McpAppReadToolInput & McpAppToolDescriptorMetadata) | (McpAppActionToolDescriptor & McpAppToolDescriptorMetadata) | (McpAppHostToolInput & McpAppToolDescriptorMetadata);
|
|
264
|
+
export interface McpAppToolRegistration {
|
|
265
|
+
readonly name: string;
|
|
266
|
+
readonly description: string;
|
|
267
|
+
readonly inputSchema: McpAppInputSchema;
|
|
268
|
+
readonly _meta: McpAppToolMetadata;
|
|
269
|
+
}
|
|
270
|
+
export interface McpAppDescriptor {
|
|
271
|
+
readonly appId: string;
|
|
272
|
+
readonly name: string;
|
|
273
|
+
readonly description: string;
|
|
274
|
+
readonly icon?: string;
|
|
275
|
+
readonly tone?: McpAppTone;
|
|
276
|
+
readonly builtinOnly: boolean;
|
|
277
|
+
readonly csp?: McpUiResourceCsp;
|
|
278
|
+
readonly uiUri: string;
|
|
279
|
+
readonly html: string;
|
|
280
|
+
readonly definition?: UiDefinition;
|
|
281
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
282
|
+
readonly tools: readonly McpAppToolDescriptor[];
|
|
283
|
+
}
|
|
284
|
+
export interface McpAppFixedResultCall {
|
|
285
|
+
readonly kind: 'result';
|
|
286
|
+
readonly result: McpAppToolResult;
|
|
287
|
+
}
|
|
288
|
+
export interface McpAppFixedResultInvalidParams {
|
|
289
|
+
readonly kind: 'invalid_params';
|
|
290
|
+
readonly code: 'INVALID_PARAMS';
|
|
291
|
+
readonly message: string;
|
|
292
|
+
}
|
|
293
|
+
export interface McpAppFixedResultUnavailable {
|
|
294
|
+
readonly kind: 'unavailable';
|
|
295
|
+
}
|
|
296
|
+
export type McpAppFixedResultResolution = McpAppFixedResultCall | McpAppFixedResultInvalidParams | McpAppFixedResultUnavailable;
|
|
297
|
+
export interface McpAppToolResult {
|
|
298
|
+
readonly content: readonly [{
|
|
299
|
+
readonly type: 'text';
|
|
300
|
+
readonly text: string;
|
|
301
|
+
}];
|
|
302
|
+
readonly structuredContent?: JsonObject;
|
|
303
|
+
readonly _meta?: JsonObject;
|
|
304
|
+
}
|
|
305
|
+
export interface McpAppButtonInput {
|
|
306
|
+
readonly id: string;
|
|
307
|
+
readonly label: string;
|
|
308
|
+
readonly enabled: boolean;
|
|
309
|
+
readonly confirmation?: UiActionConfirmation;
|
|
310
|
+
readonly requiresHumanConfirmation?: boolean;
|
|
311
|
+
readonly disabledReason?: string;
|
|
312
|
+
readonly inputSchema: McpAppInputSchema;
|
|
313
|
+
}
|
|
314
|
+
export interface McpAppServerStateInput {
|
|
315
|
+
readonly source: 'server';
|
|
316
|
+
readonly instance: Pick<UiInstance, 'id' | 'definition' | 'revision' | 'status' | 'state'>;
|
|
317
|
+
readonly definition: UiDefinition;
|
|
318
|
+
readonly buttons: readonly McpAppButtonInput[];
|
|
319
|
+
}
|
|
320
|
+
export interface McpAppButtonDescriptor {
|
|
321
|
+
readonly id: string;
|
|
322
|
+
readonly label: string;
|
|
323
|
+
readonly enabled: boolean;
|
|
324
|
+
readonly confirmation: UiActionConfirmation;
|
|
325
|
+
readonly requiresHumanConfirmation?: boolean;
|
|
326
|
+
readonly disabledReason: string | null;
|
|
327
|
+
readonly inputSchema: McpAppInputSchema;
|
|
328
|
+
}
|
|
329
|
+
export interface McpAppStateDescriptor {
|
|
330
|
+
readonly schemaVersion: 1;
|
|
331
|
+
readonly source: 'server';
|
|
332
|
+
readonly instanceId: string;
|
|
333
|
+
readonly definition: UiDefinitionRef;
|
|
334
|
+
readonly revision: number;
|
|
335
|
+
readonly status: UiInstanceStatus;
|
|
336
|
+
readonly state: JsonObject;
|
|
337
|
+
readonly buttons: readonly McpAppButtonDescriptor[];
|
|
338
|
+
}
|
|
339
|
+
export interface McpAppStateProjections {
|
|
340
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
341
|
+
readonly card: McpAppStateDescriptor;
|
|
342
|
+
readonly developer: {
|
|
343
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
344
|
+
readonly json: string;
|
|
345
|
+
};
|
|
346
|
+
readonly ai: {
|
|
347
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
348
|
+
readonly json: string;
|
|
349
|
+
readonly xml: string;
|
|
350
|
+
readonly omittedPaths?: readonly string[];
|
|
351
|
+
};
|
|
352
|
+
readonly focusedAi: {
|
|
353
|
+
readonly descriptor: McpAppStateDescriptor;
|
|
354
|
+
readonly json: string;
|
|
355
|
+
readonly xml: string;
|
|
356
|
+
readonly omittedPaths?: readonly string[];
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
export interface McpAppRegistry {
|
|
360
|
+
registerMcpApp(input: McpAppDescriptorInput): McpAppDescriptor;
|
|
361
|
+
getMcpApp(appId: string): McpAppDescriptor | null;
|
|
362
|
+
listMcpApps(): readonly McpAppDescriptor[];
|
|
363
|
+
listMcpAppTools(): readonly McpAppToolDescriptor[];
|
|
364
|
+
resolveMcpAppTool(toolName: string): McpAppToolDescriptor | null;
|
|
365
|
+
resolveMcpAppResource(uri: string): McpAppResource | null;
|
|
366
|
+
requireMcpAppResource(uri: string): McpAppResource;
|
|
367
|
+
}
|
|
368
|
+
export interface McpAppRegistryOptions {
|
|
369
|
+
readonly reservedToolNames?: Iterable<string>;
|
|
370
|
+
}
|
|
371
|
+
export interface McpAppBundleHostToolTemplate {
|
|
372
|
+
readonly capability: string;
|
|
373
|
+
readonly description: string;
|
|
374
|
+
readonly inputSchema: McpAppInputSchema;
|
|
375
|
+
readonly textFallback: string;
|
|
376
|
+
}
|
|
377
|
+
export interface McpAppBundleAgentActionDescriptor {
|
|
378
|
+
readonly appId: string;
|
|
379
|
+
readonly provenance: ProductAppBundleProvenance;
|
|
380
|
+
readonly name: string;
|
|
381
|
+
readonly description: string;
|
|
382
|
+
readonly inputSchema: McpAppInputSchema;
|
|
383
|
+
readonly textFallback: string;
|
|
384
|
+
readonly kind: 'action';
|
|
385
|
+
readonly actionId: string;
|
|
386
|
+
readonly access: 'allowed' | 'approval_required' | 'denied';
|
|
387
|
+
readonly visibility: readonly McpAppToolVisibility[];
|
|
388
|
+
readonly resourceUri: string;
|
|
389
|
+
readonly _meta: McpAppToolMetadata;
|
|
390
|
+
}
|
|
391
|
+
export type CrewxAppCapability = 'screen' | 'skill';
|
|
392
|
+
export type CrewxAppOrigin = 'local' | 'installed' | 'builtin';
|
|
393
|
+
export type CrewxAppOwnership = 'mine' | 'external' | 'unknown';
|
|
394
|
+
export type CrewxAppShareability = 'shareable' | 'requiresPublish' | 'forbidden' | 'unknown';
|
|
395
|
+
export type CrewxAppSharingAvailability = 'ready' | 'loginRequired' | 'unavailable';
|
|
396
|
+
export interface CrewxAppLocalDefinitionRef {
|
|
397
|
+
readonly packageRoot: string;
|
|
398
|
+
}
|
|
399
|
+
export interface CrewxAppDefinitionSummary extends UiDefinitionRef {
|
|
400
|
+
readonly usage: UiDefinitionUsage;
|
|
401
|
+
readonly detailPanel?: boolean;
|
|
402
|
+
readonly displayModes?: readonly UiDefinitionDisplayMode[];
|
|
403
|
+
readonly summaryProjection?: UiProjectionPolicy;
|
|
404
|
+
}
|
|
405
|
+
export interface CrewxAppDefinitionHashInput {
|
|
406
|
+
readonly screenHash?: string;
|
|
407
|
+
readonly skillHash?: string;
|
|
408
|
+
readonly relativePath?: string;
|
|
409
|
+
readonly fileBytes?: Uint8Array | ArrayBuffer | readonly number[] | string;
|
|
410
|
+
}
|
|
411
|
+
export interface CrewxAppSummary {
|
|
412
|
+
readonly appId: string;
|
|
413
|
+
readonly name: string;
|
|
414
|
+
readonly description: string;
|
|
415
|
+
readonly version?: string;
|
|
416
|
+
readonly capabilities: readonly CrewxAppCapability[];
|
|
417
|
+
readonly definition?: CrewxAppDefinitionSummary;
|
|
418
|
+
readonly skillName?: string;
|
|
419
|
+
readonly localDefinitionRef?: CrewxAppLocalDefinitionRef;
|
|
420
|
+
readonly origin: CrewxAppOrigin;
|
|
421
|
+
readonly ownership: CrewxAppOwnership;
|
|
422
|
+
readonly shareability: CrewxAppShareability;
|
|
423
|
+
readonly sharingAvailability: CrewxAppSharingAvailability;
|
|
424
|
+
readonly marketplaceContentId?: string;
|
|
425
|
+
readonly slug?: string;
|
|
426
|
+
readonly definitionHash: string;
|
|
427
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
428
|
+
}
|
|
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' | 'ASSET_CATALOG_INVALID' | 'EXEC_DENIED' | 'SKILL_INVALID' | 'SKILL_READ_FAILED' | 'INSTALLED_MISSING' | 'INSTALLED_CONTENT_ID_MISSING' | 'INSTALLED_IDENTITY_MISMATCH' | 'BUILTIN_INVALID';
|
|
430
|
+
export type CrewxAppDiagnosticSource = 'apps' | 'skills' | 'bundled' | 'node_modules' | 'builtin' | 'installed';
|
|
431
|
+
export interface CrewxAppDiagnostic {
|
|
432
|
+
readonly code: CrewxAppDiagnosticCode;
|
|
433
|
+
readonly source: CrewxAppDiagnosticSource;
|
|
434
|
+
readonly relativePath: string;
|
|
435
|
+
readonly appId?: string;
|
|
436
|
+
}
|
|
437
|
+
export interface CrewxAppInstalledProjection {
|
|
438
|
+
readonly packageRoot?: string;
|
|
439
|
+
readonly relativePath?: string;
|
|
440
|
+
readonly packageRootPath?: string;
|
|
441
|
+
readonly appId?: string;
|
|
442
|
+
readonly definitionHash?: string;
|
|
443
|
+
readonly marketplaceContentId?: string;
|
|
444
|
+
readonly slug?: string;
|
|
445
|
+
}
|
|
446
|
+
export type CrewxAppBuiltinCatalog = Pick<McpAppRegistry, 'listMcpApps' | 'listMcpAppTools'>;
|
|
447
|
+
export interface CrewxAppCatalogOptions {
|
|
448
|
+
readonly filesystem?: AppDiscoveryFileSystem;
|
|
449
|
+
readonly productBundle?: ProductAppBundleInput;
|
|
450
|
+
readonly registeredProductBundle?: ProductAppBundleSnapshotMetadata;
|
|
451
|
+
readonly builtinCatalog?: CrewxAppBuiltinCatalog;
|
|
452
|
+
readonly installed?: readonly CrewxAppInstalledProjection[];
|
|
453
|
+
}
|
|
454
|
+
export interface CrewxAppCatalogResult {
|
|
455
|
+
readonly items: readonly CrewxAppSummary[];
|
|
456
|
+
readonly diagnostics: readonly CrewxAppDiagnostic[];
|
|
457
|
+
}
|
|
458
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AppDiscoveryFileSystem, WorkspaceAppCandidate, WorkspaceAppDiagnostic, WorkspaceAppSource } from './discovery.js';
|
|
2
|
+
import { type ProductAppBundleAsset } from './product-bundle-assets.js';
|
|
3
|
+
export interface WorkspaceAppAssetLocator {
|
|
4
|
+
readonly role: string;
|
|
5
|
+
readonly sha256: string;
|
|
6
|
+
readonly filename: string;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkspaceAppAssetDescriptorV1 {
|
|
9
|
+
readonly schemaVersion: 1;
|
|
10
|
+
readonly styles: readonly WorkspaceAppAssetLocator[];
|
|
11
|
+
readonly imports: readonly WorkspaceAppAssetLocator[];
|
|
12
|
+
readonly moduleEntry: WorkspaceAppAssetLocator & {
|
|
13
|
+
readonly role: 'app-entry';
|
|
14
|
+
};
|
|
15
|
+
readonly workers: readonly WorkspaceAppAssetLocator[];
|
|
16
|
+
}
|
|
17
|
+
export interface WorkspaceAppAsset extends Pick<ProductAppBundleAsset, 'sha256' | 'filename' | 'contentType' | 'byteLength' | 'bytes'> {
|
|
18
|
+
readonly role: string;
|
|
19
|
+
}
|
|
20
|
+
export interface WorkspaceAppAssetCatalog {
|
|
21
|
+
readonly catalogId: string;
|
|
22
|
+
readonly snapshotHash: string;
|
|
23
|
+
readonly appId: string;
|
|
24
|
+
readonly source: WorkspaceAppSource;
|
|
25
|
+
readonly definitionHash: string;
|
|
26
|
+
readonly descriptor: WorkspaceAppAssetDescriptorV1;
|
|
27
|
+
readonly assets: readonly WorkspaceAppAsset[];
|
|
28
|
+
get(sha256: string, filename: string): WorkspaceAppAsset | undefined;
|
|
29
|
+
readVerified(sha256: string, filename: string): Promise<Uint8Array | undefined>;
|
|
30
|
+
}
|
|
31
|
+
export interface WorkspaceAppAssetCatalogDraft extends Omit<WorkspaceAppAssetCatalog, 'catalogId' | 'snapshotHash' | 'get'> {
|
|
32
|
+
}
|
|
33
|
+
export interface WorkspaceAppAssetCatalogLoadResult {
|
|
34
|
+
readonly catalogs: readonly WorkspaceAppAssetCatalogDraft[];
|
|
35
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
36
|
+
}
|
|
37
|
+
export declare function loadWorkspaceAppAssetCatalogs(workspaceRoot: string, candidates: readonly WorkspaceAppCandidate[], filesystem?: AppDiscoveryFileSystem): Promise<WorkspaceAppAssetCatalogLoadResult>;
|
|
38
|
+
export declare function sealWorkspaceAppAssetCatalog(draft: WorkspaceAppAssetCatalogDraft, snapshotHash: string): WorkspaceAppAssetCatalog;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type AppDiscoveryFileSystem, type WorkspaceAppDiscoveryIncompleteReason, type WorkspaceAppDiagnostic, type WorkspaceAppDiscoveryOptions, type WorkspaceAppDiscoveryResult, type WorkspaceAppSource, type ProductAppBundleProvenance, type ProductAppBundleSnapshotMetadata } from './discovery.js';
|
|
2
|
+
import { type SkillBackendExecutionPort } from './skill-backend.js';
|
|
3
|
+
import { type WorkspaceAppAssetCatalog } from './workspace-app-assets.js';
|
|
4
|
+
import type { JsonObject, UiActionHandlerRegistration, UiDefinition, UiDefinitionRef } from '../ui-instance/types.js';
|
|
5
|
+
import type { UiPluginManifestV2 } from '../ui-plugin/types.js';
|
|
6
|
+
import type { McpAppLauncher, McpAppLocalResource, McpAppRegistry, McpAppWorkspaceRegistry } from './types.js';
|
|
7
|
+
export interface WorkspaceAppSnapshotResource extends McpAppLocalResource {
|
|
8
|
+
readonly appId: string;
|
|
9
|
+
readonly definition: UiDefinitionRef;
|
|
10
|
+
readonly relativePath?: string;
|
|
11
|
+
readonly runtime?: NonNullable<UiPluginManifestV2['runtime']>;
|
|
12
|
+
readonly source?: WorkspaceAppSource;
|
|
13
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
14
|
+
readonly assetCatalogId?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface WorkspaceAppSnapshotInitialState {
|
|
17
|
+
readonly appId: string;
|
|
18
|
+
readonly definition: UiDefinitionRef;
|
|
19
|
+
readonly hash: string;
|
|
20
|
+
readonly bytes: readonly number[];
|
|
21
|
+
readonly state: JsonObject;
|
|
22
|
+
}
|
|
23
|
+
export type WorkspaceAppInitialState = WorkspaceAppSnapshotInitialState;
|
|
24
|
+
export interface WorkspaceAppSnapshotBuildOptions {
|
|
25
|
+
readonly builtins?: McpAppRegistry;
|
|
26
|
+
readonly builtin?: McpAppRegistry;
|
|
27
|
+
readonly registry?: McpAppRegistry;
|
|
28
|
+
readonly registeredProductBundle?: ProductAppBundleSnapshotMetadata;
|
|
29
|
+
readonly skillBackend?: SkillBackendExecutionPort;
|
|
30
|
+
}
|
|
31
|
+
export type WorkspaceAppSnapshotOptions = WorkspaceAppDiscoveryOptions & WorkspaceAppSnapshotBuildOptions;
|
|
32
|
+
export interface WorkspaceAppSnapshot {
|
|
33
|
+
readonly snapshotHash: string;
|
|
34
|
+
readonly launchers: readonly McpAppLauncher[];
|
|
35
|
+
readonly definitions: readonly UiDefinition[];
|
|
36
|
+
readonly actionHandlers: readonly UiActionHandlerRegistration[];
|
|
37
|
+
readonly resources: readonly WorkspaceAppSnapshotResource[];
|
|
38
|
+
readonly assetCatalogs: readonly WorkspaceAppAssetCatalog[];
|
|
39
|
+
readonly initialStates: readonly WorkspaceAppSnapshotInitialState[];
|
|
40
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
41
|
+
readonly registry: McpAppWorkspaceRegistry;
|
|
42
|
+
resolveDefinition(ref: UiDefinitionRef): UiDefinition | null;
|
|
43
|
+
resolveActionHandler(definitionId: string, version: number, actionId: string): UiActionHandlerRegistration | null;
|
|
44
|
+
resolveResource(appId: string, definitionHash?: string): WorkspaceAppSnapshotResource | null;
|
|
45
|
+
resolveAssetCatalog(appId: string, definitionHash?: string): WorkspaceAppAssetCatalog | null;
|
|
46
|
+
}
|
|
47
|
+
export type WorkspaceAppSnapshotReconfirmResult = {
|
|
48
|
+
readonly kind: 'same_generation';
|
|
49
|
+
readonly snapshot: WorkspaceAppSnapshot;
|
|
50
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
51
|
+
} | {
|
|
52
|
+
readonly kind: 'new_generation';
|
|
53
|
+
readonly previousSnapshot: WorkspaceAppSnapshot;
|
|
54
|
+
readonly snapshot: WorkspaceAppSnapshot;
|
|
55
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
56
|
+
} | {
|
|
57
|
+
readonly kind: 'incomplete';
|
|
58
|
+
readonly reason: WorkspaceAppDiscoveryIncompleteReason;
|
|
59
|
+
readonly snapshot: WorkspaceAppSnapshot;
|
|
60
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
61
|
+
} | {
|
|
62
|
+
readonly kind: 'io_error';
|
|
63
|
+
readonly snapshot: WorkspaceAppSnapshot;
|
|
64
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
65
|
+
};
|
|
66
|
+
export declare function buildWorkspaceAppSnapshot(discovery: WorkspaceAppDiscoveryResult, options?: WorkspaceAppSnapshotBuildOptions): WorkspaceAppSnapshot;
|
|
67
|
+
export declare function discoverWorkspaceAppSnapshot(workspaceRoot: string, options?: WorkspaceAppSnapshotOptions): Promise<WorkspaceAppSnapshot>;
|
|
68
|
+
export declare function discoverWorkspaceAppSnapshot(workspaceRoot: string, filesystem: AppDiscoveryFileSystem, options?: WorkspaceAppSnapshotOptions): Promise<WorkspaceAppSnapshot>;
|
|
69
|
+
export declare function reconfirmWorkspaceAppSnapshot(workspaceRoot: string, currentSnapshot: WorkspaceAppSnapshot, options?: WorkspaceAppSnapshotOptions): Promise<WorkspaceAppSnapshotReconfirmResult>;
|
|
70
|
+
export declare function reconfirmWorkspaceAppSnapshot(workspaceRoot: string, currentSnapshot: WorkspaceAppSnapshot, filesystem: AppDiscoveryFileSystem, options?: WorkspaceAppSnapshotOptions): Promise<WorkspaceAppSnapshotReconfirmResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE INDEX IF NOT EXISTS `idx_threads_title` ON `threads` (`title`);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS `notification_reads` (
|
|
2
|
+
`notification_id` text NOT NULL,
|
|
3
|
+
`user_id` text NOT NULL,
|
|
4
|
+
`read_at` text NOT NULL,
|
|
5
|
+
PRIMARY KEY(`notification_id`, `user_id`)
|
|
6
|
+
);
|
|
7
|
+
--> statement-breakpoint
|
|
8
|
+
CREATE TABLE IF NOT EXISTS `notifications` (
|
|
9
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
10
|
+
`workspace_id` text NOT NULL,
|
|
11
|
+
`agent_id` text,
|
|
12
|
+
`task_id` text,
|
|
13
|
+
`thread_id` text,
|
|
14
|
+
`source` text DEFAULT 'agent' NOT NULL,
|
|
15
|
+
`level` text DEFAULT 'info' NOT NULL,
|
|
16
|
+
`title` text NOT NULL,
|
|
17
|
+
`body` text,
|
|
18
|
+
`target_user_id` text,
|
|
19
|
+
`created_at` text NOT NULL,
|
|
20
|
+
`metadata` text
|
|
21
|
+
);
|
|
22
|
+
--> statement-breakpoint
|
|
23
|
+
CREATE INDEX IF NOT EXISTS `idx_notifications_ws_created` ON `notifications` (`workspace_id`,"created_at" DESC);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS `agent_suggestions` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`workspace_id` text NOT NULL,
|
|
4
|
+
`agent_id` text NOT NULL,
|
|
5
|
+
`task_id` text,
|
|
6
|
+
`type` text NOT NULL,
|
|
7
|
+
`status` text DEFAULT 'pending' NOT NULL,
|
|
8
|
+
`payload` text NOT NULL,
|
|
9
|
+
`applied_commit_sha` text,
|
|
10
|
+
`created_at` text NOT NULL,
|
|
11
|
+
`updated_at` text NOT NULL
|
|
12
|
+
);
|
|
13
|
+
--> statement-breakpoint
|
|
14
|
+
CREATE INDEX IF NOT EXISTS `idx_agent_suggestions_ws_agent` ON `agent_suggestions` (`workspace_id`,`agent_id`);--> statement-breakpoint
|
|
15
|
+
CREATE INDEX IF NOT EXISTS `idx_agent_suggestions_ws_created` ON `agent_suggestions` (`workspace_id`,`created_at`);
|