@crewx/sdk 0.9.0-rc.16 → 0.9.0-rc.161
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 +59 -6
- package/dist/agent/agent-list-view.d.ts +19 -0
- package/dist/app/app.d.ts +157 -0
- package/dist/app/backend-env.d.ts +3 -0
- package/dist/app/content-media-types.d.ts +2 -0
- package/dist/app/context.d.ts +2 -0
- package/dist/app/entry.d.ts +7 -0
- package/dist/app/frame.d.ts +55 -0
- package/dist/app/index.d.ts +12 -0
- package/dist/app/index.js +10 -0
- package/dist/app/protocol.d.ts +9 -0
- package/dist/app/runtime.d.ts +21 -0
- package/dist/app/schedule-contract.d.ts +59 -0
- package/dist/app/tool-mode.d.ts +3 -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 +63 -0
- package/dist/context-budget/index.d.ts +142 -0
- package/dist/conversation/index.d.ts +1 -1
- package/dist/conversation/sqlite-provider.d.ts +6 -3
- package/dist/conversation/to-template-messages.d.ts +9 -0
- package/dist/conversation/types.d.ts +58 -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/app/index.js +10 -0
- package/dist/esm/desktop/index.js +3 -0
- package/dist/esm/index.js +1128 -226
- package/dist/esm/node/index.js +2 -0
- package/dist/esm/plugins/index.js +496 -214
- package/dist/esm/process/index.js +1 -0
- package/dist/esm/publish/index.js +2 -0
- package/dist/esm/repository/index.js +608 -211
- package/dist/esm/skills/index.js +2 -0
- package/dist/esm/testing/index.js +1 -1
- package/dist/events/types.d.ts +16 -0
- package/dist/facade/Crewx.d.ts +61 -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 +21 -1
- package/dist/index.browser.js +6 -2
- package/dist/index.d.ts +137 -17
- package/dist/index.js +1128 -226
- 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/app-handoff.d.ts +109 -0
- package/dist/mcp-app/app-icon-read.d.ts +7 -0
- package/dist/mcp-app/app-schedule.d.ts +85 -0
- package/dist/mcp-app/apps-context.d.ts +32 -0
- package/dist/mcp-app/bundle-provenance.d.ts +3 -0
- package/dist/mcp-app/candidate-registration.d.ts +4 -0
- package/dist/mcp-app/card-handler.d.ts +7 -0
- package/dist/mcp-app/catalog.d.ts +7 -0
- package/dist/mcp-app/content-channel.d.ts +86 -0
- package/dist/mcp-app/content-declarations.d.ts +31 -0
- package/dist/mcp-app/dev-checks.d.ts +31 -0
- package/dist/mcp-app/diagnostic-reason.d.ts +3 -0
- package/dist/mcp-app/discovery.d.ts +164 -0
- package/dist/mcp-app/errors.d.ts +7 -0
- package/dist/mcp-app/index.d.ts +41 -0
- package/dist/mcp-app/installed-app-ref.d.ts +25 -0
- package/dist/mcp-app/model-context.d.ts +29 -0
- package/dist/mcp-app/node-app-discovery-fs.d.ts +23 -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 +14 -0
- package/dist/mcp-app/prompt-cards.d.ts +28 -0
- package/dist/mcp-app/registry.d.ts +28 -0
- package/dist/mcp-app/skill-backend.d.ts +135 -0
- package/dist/mcp-app/state-set.d.ts +9 -0
- package/dist/mcp-app/types.d.ts +488 -0
- package/dist/mcp-app/workspace-app-assets.d.ts +42 -0
- package/dist/mcp-app/workspace-app-scan-cache.d.ts +27 -0
- package/dist/mcp-app/workspace-snapshot.d.ts +75 -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/0035_request_log_daily.sql +11 -0
- package/dist/migrations/0036_ui_definition_archive.sql +8 -0
- package/dist/migrations/0037_ui_instance_agent_open_request.sql +1 -0
- package/dist/migrations/0038_task_rating.sql +3 -0
- package/dist/migrations/0039_aspiring_purifiers.sql +9 -0
- package/dist/migrations/0040_task_provider_inputs.sql +53 -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/0035_snapshot.json +3547 -0
- package/dist/migrations/meta/0036_snapshot.json +3591 -0
- package/dist/migrations/meta/0037_snapshot.json +3598 -0
- package/dist/migrations/meta/0038_snapshot.json +3626 -0
- package/dist/migrations/meta/0039_snapshot.json +3684 -0
- package/dist/migrations/meta/0040_snapshot.json +3759 -0
- package/dist/migrations/meta/_journal.json +210 -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 +496 -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 +22 -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 +55 -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 +10 -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-send-history.repository.d.ts +23 -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 +49 -6
- package/dist/repository/index.js +608 -211
- package/dist/repository/logs-db.d.ts +12 -0
- package/dist/repository/notification.repository.d.ts +58 -0
- package/dist/repository/project.repository.d.ts +90 -0
- package/dist/repository/request-log-mover.d.ts +70 -0
- package/dist/repository/request-log.repository.d.ts +7 -3
- 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 +21 -0
- package/dist/repository/task.repository.d.ts +300 -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 +118 -7
- 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-send-history.d.ts +85 -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 +15 -0
- package/dist/schema/notifications.d.ts +303 -0
- package/dist/schema/projects.d.ts +610 -0
- package/dist/schema/request-log-daily.d.ts +151 -0
- package/dist/schema/storage-metadata.d.ts +181 -0
- package/dist/schema/task-log-events.d.ts +119 -0
- package/dist/schema/task-provider-inputs.d.ts +100 -0
- package/dist/schema/tasks.d.ts +1058 -1
- 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-definition-archive.d.ts +63 -0
- package/dist/schema/ui-instance-repins.d.ts +222 -0
- package/dist/schema/ui-instances.d.ts +324 -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/helpers/format-conversation.d.ts +1 -0
- package/dist/template/types.d.ts +20 -0
- package/dist/testing/index.js +1 -1
- package/dist/types/index.d.ts +1578 -3
- package/dist/types/task-log.types.d.ts +3 -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 +24 -0
- package/dist/ui-instance/runtime.d.ts +19 -0
- package/dist/ui-instance/store.d.ts +213 -0
- package/dist/ui-instance/types.d.ts +337 -0
- package/dist/ui-plugin/app-icon.d.ts +50 -0
- package/dist/ui-plugin/app-manifest.d.ts +64 -0
- package/dist/ui-plugin/csp.d.ts +28 -0
- package/dist/ui-plugin/index.d.ts +8 -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 +204 -0
- package/dist/ui-plugin/validator.d.ts +18 -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 +3 -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 +57 -3
- package/templates/agents/default.yaml +303 -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,85 @@
|
|
|
1
|
+
import { type SkillBackendExecutionRequest, type SkillBackendPayloadV1 } from './skill-backend.js';
|
|
2
|
+
import { type AppScheduleIntervalMinutes, type AppSchedulePeriodicReason, type AppScheduleRunVerdict, type AppScheduleSnapshot } from '../app/schedule-contract.js';
|
|
3
|
+
import type { UiDefinitionInput } from '../ui-instance/types.js';
|
|
4
|
+
import type { WorkspaceAppSource } from './discovery.js';
|
|
5
|
+
export { decideScheduleDirective } from '../app/schedule-contract.js';
|
|
6
|
+
export type { AppScheduleActorKind, ScheduleDirectiveDecision } from '../app/schedule-contract.js';
|
|
7
|
+
export type AppScheduleOwnerSource = WorkspaceAppSource | 'bundled';
|
|
8
|
+
export interface AppScheduleOwner {
|
|
9
|
+
readonly appId: string;
|
|
10
|
+
readonly actionId: string;
|
|
11
|
+
readonly source: AppScheduleOwnerSource;
|
|
12
|
+
}
|
|
13
|
+
export interface AppScheduleBinding extends AppScheduleOwner {
|
|
14
|
+
readonly enabled: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ResolvedAppSchedule {
|
|
17
|
+
readonly actionId: string;
|
|
18
|
+
readonly everyMinutes: AppScheduleIntervalMinutes;
|
|
19
|
+
readonly timeoutMs: number;
|
|
20
|
+
}
|
|
21
|
+
export interface AppScheduleTemplate {
|
|
22
|
+
readonly cron: string;
|
|
23
|
+
readonly timeout_ms: number;
|
|
24
|
+
readonly name: string | null;
|
|
25
|
+
}
|
|
26
|
+
export interface AppScheduleRowView extends AppScheduleTemplate {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly app: AppScheduleBinding;
|
|
29
|
+
readonly last_started_at?: string;
|
|
30
|
+
readonly last_run?: string;
|
|
31
|
+
readonly last_outcome?: string;
|
|
32
|
+
readonly last_error_code?: string;
|
|
33
|
+
readonly next_run?: string | null;
|
|
34
|
+
}
|
|
35
|
+
export type AppScheduleAvailability = {
|
|
36
|
+
readonly periodic: 'available';
|
|
37
|
+
} | {
|
|
38
|
+
readonly periodic: 'unavailable';
|
|
39
|
+
readonly reason: AppSchedulePeriodicReason;
|
|
40
|
+
};
|
|
41
|
+
export type ScheduleLifecycleEntry = {
|
|
42
|
+
readonly kind: 'absent';
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'invalid';
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: 'verified';
|
|
47
|
+
readonly source: AppScheduleOwnerSource;
|
|
48
|
+
readonly declaration: ResolvedAppSchedule | undefined;
|
|
49
|
+
readonly name: string | null;
|
|
50
|
+
};
|
|
51
|
+
export type AppScheduledRunPayload = SkillBackendPayloadV1 & {
|
|
52
|
+
readonly schedule: AppScheduleSnapshot;
|
|
53
|
+
};
|
|
54
|
+
export interface AppScheduledRunPlan {
|
|
55
|
+
readonly actorKind: 'schedule';
|
|
56
|
+
readonly instanceId: string;
|
|
57
|
+
readonly threadId: null;
|
|
58
|
+
readonly actionId: string;
|
|
59
|
+
readonly payload: AppScheduledRunPayload;
|
|
60
|
+
}
|
|
61
|
+
export type ScheduledAppLaunchRequest = AppScheduledRunPlan & Pick<SkillBackendExecutionRequest, 'appId' | 'definitionId' | 'definitionVersion' | 'definitionHash' | 'command' | 'entry' | 'relativePath'>;
|
|
62
|
+
export type ScheduleLifecyclePlan = {
|
|
63
|
+
readonly kind: 'run';
|
|
64
|
+
readonly run: AppScheduledRunPlan;
|
|
65
|
+
} | {
|
|
66
|
+
readonly kind: 'refresh';
|
|
67
|
+
readonly owner: AppScheduleOwner;
|
|
68
|
+
readonly template: AppScheduleTemplate;
|
|
69
|
+
} | {
|
|
70
|
+
readonly kind: 'skip';
|
|
71
|
+
readonly code: 'APP_INVALID' | 'APP_SCHEDULE_OFF';
|
|
72
|
+
} | {
|
|
73
|
+
readonly kind: 'disable';
|
|
74
|
+
readonly code: 'APP_SCHEDULE_UNDECLARED' | 'APP_SCHEDULE_SOURCE_CHANGED';
|
|
75
|
+
} | {
|
|
76
|
+
readonly kind: 'remove';
|
|
77
|
+
readonly code: 'APP_MISSING';
|
|
78
|
+
};
|
|
79
|
+
export declare function cronExpressionForInterval(everyMinutes: AppScheduleIntervalMinutes): string;
|
|
80
|
+
export declare function appScheduleCommandLabel(owner: Pick<AppScheduleOwner, 'appId' | 'actionId'>): string;
|
|
81
|
+
export declare function resolveDeclaredSchedule(definition: Pick<UiDefinitionInput, 'actions'>): ResolvedAppSchedule | undefined;
|
|
82
|
+
export declare function scheduleTemplateFor(declaration: ResolvedAppSchedule, name: string | null): AppScheduleTemplate;
|
|
83
|
+
export declare function toScheduleSnapshot(row: Pick<AppScheduleRowView, 'app' | 'last_started_at' | 'last_run' | 'last_outcome' | 'last_error_code' | 'next_run'> | undefined, declared: Pick<ResolvedAppSchedule, 'everyMinutes'>, availability: AppScheduleAvailability): AppScheduleSnapshot;
|
|
84
|
+
export declare function toScheduledRunVerdict(response: unknown): AppScheduleRunVerdict;
|
|
85
|
+
export declare function planScheduledFire(row: AppScheduleRowView, entry: ScheduleLifecycleEntry, availability: AppScheduleAvailability): ScheduleLifecyclePlan;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { McpAppLayoutSnapshot, McpAppStateDescriptor } from './types.js';
|
|
2
|
+
import type { McpAppModelContext } from './model-context.js';
|
|
3
|
+
export interface McpAppsContext {
|
|
4
|
+
readonly rendered: string;
|
|
5
|
+
readonly guidanceRendered?: string;
|
|
6
|
+
readonly available?: ReadonlyArray<{
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly description: string;
|
|
10
|
+
readonly agent: 'direct' | 'approval' | 'none';
|
|
11
|
+
readonly usage?: 'card' | 'window';
|
|
12
|
+
}>;
|
|
13
|
+
readonly availableRendered?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface McpAppsContextOptions {
|
|
16
|
+
readonly cli?: string;
|
|
17
|
+
readonly available?: McpAppsContext['available'];
|
|
18
|
+
readonly appLayoutSnapshot?: McpAppLayoutSnapshot;
|
|
19
|
+
}
|
|
20
|
+
export declare const MCP_APPS_AVAILABLE_MAX_BYTES: number;
|
|
21
|
+
export declare function buildMcpAppsContext(descriptors: readonly McpAppStateDescriptor[] | undefined, modelContext?: McpAppModelContext, optionsOrAvailable?: McpAppsContextOptions | McpAppsContext['available']): McpAppsContext | undefined;
|
|
22
|
+
export declare function attachAvailableApps(context: McpAppsContext | undefined, available: McpAppsContext['available'], cli?: string): McpAppsContext | undefined;
|
|
23
|
+
export interface RunningInstructionApps {
|
|
24
|
+
readonly guidanceRendered?: string;
|
|
25
|
+
readonly rendered?: string;
|
|
26
|
+
readonly omittedCount: number;
|
|
27
|
+
}
|
|
28
|
+
export declare function buildRunningInstructionApps(descriptors: readonly McpAppStateDescriptor[] | undefined, options?: {
|
|
29
|
+
readonly cli?: string;
|
|
30
|
+
readonly modelContext?: McpAppModelContext;
|
|
31
|
+
readonly appLayoutSnapshot?: McpAppLayoutSnapshot;
|
|
32
|
+
}): RunningInstructionApps;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function markVerifiedProductAppBundleProvenance<T extends object>(value: T, executableRelativePath?: string): T;
|
|
2
|
+
export declare function isVerifiedProductAppBundleProvenance(value: unknown): value is object;
|
|
3
|
+
export declare function getVerifiedProductAppBundleExecutable(value: unknown): string | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkspaceAppCandidate } from './discovery.js';
|
|
2
|
+
import type { McpAppLocalRegistration } from './types.js';
|
|
3
|
+
export declare function buildWorkspaceCandidateRegistration(candidate: WorkspaceAppCandidate): McpAppLocalRegistration;
|
|
4
|
+
export declare function validateWorkspaceCandidateRegistration(candidate: WorkspaceAppCandidate): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const MCP_APP_CARD_HANDLERS: readonly ["card.secret-env"];
|
|
2
|
+
export type McpAppCardHandler = (typeof MCP_APP_CARD_HANDLERS)[number];
|
|
3
|
+
export declare function isMcpAppCardHandler(handler: unknown): handler is McpAppCardHandler;
|
|
4
|
+
export declare function isMcpAppCardAction(usage: string | undefined, backend: {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly handler?: unknown;
|
|
7
|
+
} | undefined): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CrewxAppCatalogOptions, CrewxAppCatalogResult, CrewxAppDefinitionHashInput } from './types.js';
|
|
2
|
+
export declare function hashCrewxAppDefinition(input: CrewxAppDefinitionHashInput): string;
|
|
3
|
+
export declare const hashAppDefinition: typeof hashCrewxAppDefinition;
|
|
4
|
+
export declare function discoverWorkspaceAppCatalog(workspaceRoot: string, options?: CrewxAppCatalogOptions): Promise<CrewxAppCatalogResult>;
|
|
5
|
+
export declare const listWorkspaceApps: typeof discoverWorkspaceAppCatalog;
|
|
6
|
+
export declare const createWorkspaceAppCatalog: typeof discoverWorkspaceAppCatalog;
|
|
7
|
+
export type { CrewxAppDefinitionHashInput, CrewxAppCatalogOptions, CrewxAppCatalogResult, } from './types.js';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { UI_CONTENT_MAX_BYTES, UI_CONTENT_MAX_LINES, UI_CONTENT_MEDIA_TYPES, countContentLines, sha256Content } from '../app/protocol.js';
|
|
2
|
+
import { isUiContentMediaType, isValidUiAppInstanceId } from './content-declarations.js';
|
|
3
|
+
import type { UiContentMediaType } from './content-declarations.js';
|
|
4
|
+
export { UI_CONTENT_MAX_BYTES, UI_CONTENT_MAX_LINES, UI_CONTENT_MEDIA_TYPES, countContentLines, isUiContentMediaType, isValidUiAppInstanceId, sha256Content, };
|
|
5
|
+
export type { UiContentMediaType };
|
|
6
|
+
export declare const UI_CONTENT_TICKET_TTL_MS = 120000;
|
|
7
|
+
export declare const UI_CONTENT_OUTPUT_TTL_MS = 120000;
|
|
8
|
+
export declare const UI_CONTENT_MAX_MEMORY_BYTES: number;
|
|
9
|
+
export declare const UI_CONTENT_ERROR_CODES: readonly ["CONTENT_SOURCE_UNSUPPORTED", "CONTENT_REQUIRED", "CONTENT_EXPIRED", "CONTENT_BINDING_MISMATCH", "CONTENT_DIGEST_MISMATCH", "CONTENT_TOO_LARGE", "CONTENT_ENCODING_INVALID", "CONTENT_BUSY", "IDENTITY_UNAVAILABLE", "EXEC_OUTPUT_INVALID"];
|
|
10
|
+
export type UiContentErrorCode = (typeof UI_CONTENT_ERROR_CODES)[number];
|
|
11
|
+
export interface UiContentInputDeclaration {
|
|
12
|
+
readonly mediaType: UiContentMediaType;
|
|
13
|
+
readonly required?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface UiContentOutputDeclaration {
|
|
16
|
+
readonly mediaType: UiContentMediaType;
|
|
17
|
+
readonly range?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface UiActionContentDeclaration {
|
|
20
|
+
readonly in?: UiContentInputDeclaration;
|
|
21
|
+
readonly out?: UiContentOutputDeclaration;
|
|
22
|
+
}
|
|
23
|
+
export interface UiContentRangeRequest {
|
|
24
|
+
readonly startLine: number;
|
|
25
|
+
readonly lineCount: number;
|
|
26
|
+
}
|
|
27
|
+
export interface UiContentRange extends UiContentRangeRequest {
|
|
28
|
+
readonly totalLines: number;
|
|
29
|
+
}
|
|
30
|
+
export interface ContentFrame {
|
|
31
|
+
readonly bytes: Uint8Array;
|
|
32
|
+
readonly sha256: string;
|
|
33
|
+
readonly lines: number;
|
|
34
|
+
readonly mediaType: UiContentMediaType;
|
|
35
|
+
readonly range?: UiContentRange;
|
|
36
|
+
readonly complete?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface UiContentBinding {
|
|
39
|
+
readonly workspaceId: string;
|
|
40
|
+
readonly threadId: string;
|
|
41
|
+
readonly instanceId: string;
|
|
42
|
+
readonly actionId: string;
|
|
43
|
+
readonly requestId: string;
|
|
44
|
+
}
|
|
45
|
+
export interface UiContentInputTicket {
|
|
46
|
+
readonly ticket: string;
|
|
47
|
+
readonly binding: UiContentBinding;
|
|
48
|
+
readonly sha256: string;
|
|
49
|
+
readonly bytes: number;
|
|
50
|
+
readonly lines: number;
|
|
51
|
+
readonly mediaType: UiContentMediaType;
|
|
52
|
+
readonly expiresAt: number;
|
|
53
|
+
}
|
|
54
|
+
export interface UiContentChannelPort {
|
|
55
|
+
putInput(ticket: UiContentInputTicket, frame: ContentFrame): void;
|
|
56
|
+
lookupInput(ticket: string, now: number): UiContentInputTicket | null;
|
|
57
|
+
consumeInput(ticket: string, now: number): ContentFrame | null;
|
|
58
|
+
reserveOutput(binding: UiContentBinding, now: number): boolean;
|
|
59
|
+
releaseOutput(binding: UiContentBinding): void;
|
|
60
|
+
putOutput(binding: UiContentBinding, frame: ContentFrame, now: number): void;
|
|
61
|
+
readOutput(binding: UiContentBinding, now: number): ContentFrame | null;
|
|
62
|
+
}
|
|
63
|
+
export declare class UiContentChannelError extends Error {
|
|
64
|
+
readonly code: UiContentErrorCode;
|
|
65
|
+
readonly name = "UiContentChannelError";
|
|
66
|
+
constructor(code: UiContentErrorCode);
|
|
67
|
+
}
|
|
68
|
+
export declare function decodeContentUtf8(bytes: Uint8Array): string;
|
|
69
|
+
export declare function validateContentBytes(value: unknown, mediaType: unknown): {
|
|
70
|
+
readonly bytes: Uint8Array;
|
|
71
|
+
readonly sha256: string;
|
|
72
|
+
readonly lines: number;
|
|
73
|
+
};
|
|
74
|
+
export interface ValidateContentFrameOptions {
|
|
75
|
+
readonly direction: 'in' | 'out';
|
|
76
|
+
readonly mediaType: UiContentMediaType;
|
|
77
|
+
readonly expectedSha256?: string;
|
|
78
|
+
readonly expectedBytes?: number;
|
|
79
|
+
readonly expectedLines?: number;
|
|
80
|
+
readonly requestedRange?: UiContentRangeRequest;
|
|
81
|
+
}
|
|
82
|
+
export declare function validateContentFrame(value: unknown, options: ValidateContentFrameOptions): ContentFrame;
|
|
83
|
+
export declare function isUiContentDeclaration(value: unknown): value is UiActionContentDeclaration;
|
|
84
|
+
export declare function isUiContentRangeRequest(value: unknown): value is UiContentRangeRequest;
|
|
85
|
+
export declare function contentBindingMatches(left: UiContentBinding, right: UiContentBinding): boolean;
|
|
86
|
+
export declare function isValidUiThreadIdentity(value: unknown): value is string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { UI_CONTENT_MEDIA_TYPES } from '../app/content-media-types.js';
|
|
2
|
+
import type { UiContentMediaType } from '../app/content-media-types.js';
|
|
3
|
+
import type { UiDefinition, UiDefinitionRef } from '../ui-instance/types.js';
|
|
4
|
+
export { UI_CONTENT_MEDIA_TYPES };
|
|
5
|
+
export type { UiContentMediaType };
|
|
6
|
+
export interface McpAppContentActionDeclaration {
|
|
7
|
+
readonly actionId: string;
|
|
8
|
+
readonly in?: {
|
|
9
|
+
readonly mediaType: UiContentMediaType;
|
|
10
|
+
readonly required: boolean;
|
|
11
|
+
};
|
|
12
|
+
readonly out?: {
|
|
13
|
+
readonly mediaType: UiContentMediaType;
|
|
14
|
+
readonly range: boolean;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface McpAppContentActions {
|
|
18
|
+
readonly schemaVersion: 1;
|
|
19
|
+
readonly instanceId: string;
|
|
20
|
+
readonly definition: {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly version: number;
|
|
23
|
+
readonly hash: string;
|
|
24
|
+
};
|
|
25
|
+
readonly actions: readonly McpAppContentActionDeclaration[];
|
|
26
|
+
}
|
|
27
|
+
export declare function isUiContentMediaType(value: unknown): value is UiContentMediaType;
|
|
28
|
+
export declare function isValidUiAppInstanceId(value: unknown): value is string;
|
|
29
|
+
export declare function buildMcpAppContentActions(instanceId: string, definition: UiDefinition): McpAppContentActions | undefined;
|
|
30
|
+
export declare function isMcpAppContentActions(value: unknown): value is McpAppContentActions;
|
|
31
|
+
export declare function contentActionsMatch(value: unknown, instanceId: string, definitionRef: UiDefinitionRef): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AppIconDiagnostic } from '../ui-plugin/app-icon.js';
|
|
2
|
+
export type AppDevCheckItem = {
|
|
3
|
+
readonly rule: 'manifest' | 'external_resource' | 'output_unsafe_string' | 'output_invalid' | 'output_size' | 'call_duration';
|
|
4
|
+
readonly severity: 'error' | 'warning' | 'ok';
|
|
5
|
+
readonly code: string;
|
|
6
|
+
readonly where: string;
|
|
7
|
+
readonly detail?: Record<string, string | number>;
|
|
8
|
+
};
|
|
9
|
+
export type ExternalResourceKind = 'script' | 'style' | 'image' | 'font' | 'media' | 'frame' | 'object' | 'form' | 'navigation' | 'css' | 'script_network';
|
|
10
|
+
export interface ExternalResourceFinding {
|
|
11
|
+
readonly line: number;
|
|
12
|
+
readonly column: number;
|
|
13
|
+
readonly url: string;
|
|
14
|
+
readonly directive: string;
|
|
15
|
+
readonly kind: ExternalResourceKind;
|
|
16
|
+
}
|
|
17
|
+
export interface InspectSkillBackendOutputOptions {
|
|
18
|
+
readonly actionId: string;
|
|
19
|
+
readonly dataPaths?: readonly string[];
|
|
20
|
+
readonly resultProjectionAllow?: readonly string[];
|
|
21
|
+
readonly durationMs?: number;
|
|
22
|
+
readonly timedOut?: boolean;
|
|
23
|
+
readonly contentFramed?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ScanExternalResourcesOptions {
|
|
26
|
+
readonly csp: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function inspectSkillBackendOutput(stdoutText: string, options: InspectSkillBackendOutputOptions): AppDevCheckItem[];
|
|
29
|
+
export declare function scanExternalResources(html: string, options: ScanExternalResourcesOptions): ExternalResourceFinding[];
|
|
30
|
+
export declare function externalResourceCheckItems(entryRelativePath: string, findings: readonly ExternalResourceFinding[]): AppDevCheckItem[];
|
|
31
|
+
export declare function appIconCheckItems(diagnostics: readonly AppIconDiagnostic[]): AppDevCheckItem[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AppManifestFileName, AppManifestReason } from '../ui-plugin/app-manifest.js';
|
|
2
|
+
export declare function projectAppManifestReason(value: unknown): AppManifestReason | undefined;
|
|
3
|
+
export declare function projectAppManifestFiles(value: unknown): readonly AppManifestFileName[] | undefined;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { UiDefinitionLineageEntry } from '../ui-instance/lineage.js';
|
|
2
|
+
import type { JsonObject, JsonValue, UiDefinition } from '../ui-instance/types.js';
|
|
3
|
+
import type { AppManifestFileName, AppManifestReason } from '../ui-plugin/index.js';
|
|
4
|
+
import type { AppIconDiagnostic, AppIconFile } from '../ui-plugin/app-icon.js';
|
|
5
|
+
import type { UiPluginHandlerMetadata, UiPluginManifestV2, UiPluginNormalizedManifestV2 } from '../ui-plugin/types.js';
|
|
6
|
+
import { createWorkspaceAppScanCache, type WorkspaceAppScanCache, type WorkspaceAppScanRootIdentity } from './workspace-app-scan-cache.js';
|
|
7
|
+
import { AppDiscoveryFsError, NodeAppDiscoveryFs, NodeAppDiscoveryFsAdapter, defaultAppDiscoveryFs, defaultNodeAppDiscoveryFs, type AppDiscoveryFsErrorCode } from './node-app-discovery-fs.js';
|
|
8
|
+
import type { McpAppRegistry } from './types.js';
|
|
9
|
+
import type { ProductAppBundleFileHash, ProductAppBundleInput, ProductAppBundleProvenance as LoadedProductAppBundleProvenance } from './product-bundle-loader.js';
|
|
10
|
+
export type { ProductAppBundleDefinitionIdentity, ProductAppBundleFileHash, ProductAppBundleIndex, ProductAppBundleInput, ProductAppBundlePackageIndex, ProductAppBundleReservations, } from './product-bundle-loader.js';
|
|
11
|
+
export { productAppBundleReservations } from './product-bundle-loader.js';
|
|
12
|
+
export type WorkspaceAppSource = 'apps' | 'skills';
|
|
13
|
+
export declare function isWorkspacePackage(source: WorkspaceAppSource, relativePath: string): boolean;
|
|
14
|
+
export type WorkspaceAppDiscoverySource = WorkspaceAppSource | 'bundled';
|
|
15
|
+
export interface ProductAppBundleProvenance extends LoadedProductAppBundleProvenance {
|
|
16
|
+
readonly appId: string;
|
|
17
|
+
readonly definitionId: string;
|
|
18
|
+
readonly version: number;
|
|
19
|
+
readonly definitionHash: string;
|
|
20
|
+
readonly files: readonly ProductAppBundleFileHash[];
|
|
21
|
+
}
|
|
22
|
+
export type WorkspaceAppDiscoveryIncompleteReason = 'time_limit';
|
|
23
|
+
export type WorkspaceAppDiagnosticCode = 'MANIFEST_MISSING' | 'MANIFEST_INVALID' | 'MANIFEST_DUAL_MISMATCH' | 'ENTRY_INVALID' | 'INITIAL_STATE_INVALID' | 'DUPLICATE_ID' | 'RESERVED_ID' | 'BUNDLE_INTEGRITY' | 'LINEAGE_INVALID' | 'LINEAGE_STALE' | 'PATH_ESCAPED' | 'LIMIT_EXCEEDED' | 'DISCOVERY_TIME_LIMIT' | 'ASSET_CATALOG_INVALID' | 'EXEC_DENIED';
|
|
24
|
+
export interface WorkspaceAppDiagnostic {
|
|
25
|
+
readonly code: WorkspaceAppDiagnosticCode;
|
|
26
|
+
readonly pluginId?: string;
|
|
27
|
+
readonly source: WorkspaceAppDiscoverySource;
|
|
28
|
+
readonly relativePath: string;
|
|
29
|
+
readonly reason?: AppManifestReason;
|
|
30
|
+
readonly files?: readonly AppManifestFileName[];
|
|
31
|
+
}
|
|
32
|
+
export interface ProductAppBundleSnapshotMetadata {
|
|
33
|
+
readonly indexHash?: string;
|
|
34
|
+
readonly candidates?: readonly WorkspaceAppCandidate[];
|
|
35
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
36
|
+
readonly reservedAppIds: readonly string[];
|
|
37
|
+
readonly reservedDefinitionIds: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
export type McpAppDiscoveryDiagnostic = WorkspaceAppDiagnostic;
|
|
40
|
+
export type AppDiscoveryDiagnostic = WorkspaceAppDiagnostic;
|
|
41
|
+
export type AppDiscoveryDirectoryEntryKind = 'file' | 'directory' | 'symlink' | 'other';
|
|
42
|
+
export interface AppDiscoveryDirectoryEntry {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly kind: AppDiscoveryDirectoryEntryKind;
|
|
45
|
+
}
|
|
46
|
+
export interface AppDiscoveryFileFingerprint {
|
|
47
|
+
readonly dev: bigint;
|
|
48
|
+
readonly ino: bigint;
|
|
49
|
+
readonly size: bigint;
|
|
50
|
+
readonly mtimeNs: bigint;
|
|
51
|
+
readonly ctimeNs: bigint;
|
|
52
|
+
readonly candidateRealPath: string;
|
|
53
|
+
}
|
|
54
|
+
export interface AppDiscoveryRootIdentity extends WorkspaceAppScanRootIdentity {
|
|
55
|
+
}
|
|
56
|
+
export type AppDiscoveryDirectoryListing = readonly AppDiscoveryDirectoryEntry[] | readonly string[];
|
|
57
|
+
export type AppDiscoveryBytes = Uint8Array | ArrayBuffer | readonly number[];
|
|
58
|
+
export type AppDiscoveryMaybePromise<T> = T | PromiseLike<T>;
|
|
59
|
+
export interface AppDiscoveryFileSystem {
|
|
60
|
+
readonly listDirectory?: (root: string, relativePath: string) => AppDiscoveryMaybePromise<AppDiscoveryDirectoryListing>;
|
|
61
|
+
readonly readDirectory?: (root: string, relativePath: string) => AppDiscoveryMaybePromise<AppDiscoveryDirectoryListing>;
|
|
62
|
+
readonly readdir?: (root: string, relativePath: string) => AppDiscoveryMaybePromise<AppDiscoveryDirectoryListing>;
|
|
63
|
+
readonly readVerifiedFile?: (root: string, relativePath: string, byteLimit: number) => AppDiscoveryMaybePromise<AppDiscoveryBytes>;
|
|
64
|
+
readonly readFileVerified?: (root: string, relativePath: string, byteLimit: number) => AppDiscoveryMaybePromise<AppDiscoveryBytes>;
|
|
65
|
+
readonly fingerprintVerifiedFile?: (root: string, relativePath: string, byteLimit: number) => AppDiscoveryMaybePromise<AppDiscoveryFileFingerprint>;
|
|
66
|
+
readonly getRootIdentity?: (root: string) => AppDiscoveryMaybePromise<AppDiscoveryRootIdentity>;
|
|
67
|
+
}
|
|
68
|
+
export interface WorkspaceAppReservedCatalog {
|
|
69
|
+
readonly appIds?: Iterable<string>;
|
|
70
|
+
readonly definitionIds?: Iterable<string>;
|
|
71
|
+
readonly toolNames?: Iterable<string>;
|
|
72
|
+
}
|
|
73
|
+
export type WorkspaceAppBuiltinCatalog = Pick<McpAppRegistry, 'listMcpApps' | 'listMcpAppTools'>;
|
|
74
|
+
export interface WorkspaceAppDiscoveryOptions {
|
|
75
|
+
readonly filesystem?: AppDiscoveryFileSystem;
|
|
76
|
+
readonly fileSystem?: AppDiscoveryFileSystem;
|
|
77
|
+
readonly fs?: AppDiscoveryFileSystem;
|
|
78
|
+
readonly clock?: () => number;
|
|
79
|
+
readonly reserved?: WorkspaceAppReservedCatalog;
|
|
80
|
+
readonly builtin?: WorkspaceAppReservedCatalog;
|
|
81
|
+
readonly builtins?: WorkspaceAppReservedCatalog | WorkspaceAppBuiltinCatalog;
|
|
82
|
+
readonly builtinCatalog?: WorkspaceAppBuiltinCatalog;
|
|
83
|
+
readonly reservedAppIds?: Iterable<string>;
|
|
84
|
+
readonly reservedDefinitionIds?: Iterable<string>;
|
|
85
|
+
readonly reservedToolNames?: Iterable<string>;
|
|
86
|
+
readonly productBundle?: ProductAppBundleInput;
|
|
87
|
+
readonly productBundleReservationMetadata?: ProductAppBundleSnapshotMetadata;
|
|
88
|
+
readonly scanCache?: WorkspaceAppScanCache;
|
|
89
|
+
}
|
|
90
|
+
export interface WorkspaceAppToolNames {
|
|
91
|
+
readonly read: string;
|
|
92
|
+
readonly action?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface WorkspaceAppResourceSnapshot {
|
|
95
|
+
readonly provenance?: ProductAppBundleProvenance;
|
|
96
|
+
readonly entry: {
|
|
97
|
+
readonly path: 'ui/index.html';
|
|
98
|
+
readonly hash: string;
|
|
99
|
+
readonly bytes: readonly number[];
|
|
100
|
+
};
|
|
101
|
+
readonly initialState?: {
|
|
102
|
+
readonly path: 'ui/state.json';
|
|
103
|
+
readonly hash: string;
|
|
104
|
+
readonly bytes: readonly number[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
interface WorkspaceAppCandidateBase {
|
|
108
|
+
readonly appId: string;
|
|
109
|
+
readonly pluginId: string;
|
|
110
|
+
readonly definitionId: string;
|
|
111
|
+
readonly version: number;
|
|
112
|
+
readonly releaseVersion?: string;
|
|
113
|
+
readonly manifestFile?: AppManifestFileName;
|
|
114
|
+
readonly mcpb?: Readonly<Record<string, JsonValue>>;
|
|
115
|
+
readonly relativePath: string;
|
|
116
|
+
readonly manifest: UiPluginManifestV2;
|
|
117
|
+
readonly normalized: UiPluginNormalizedManifestV2;
|
|
118
|
+
readonly name: string;
|
|
119
|
+
readonly description: string;
|
|
120
|
+
readonly icon?: string;
|
|
121
|
+
readonly tone?: UiPluginManifestV2['tone'];
|
|
122
|
+
readonly iconFile?: AppIconFile;
|
|
123
|
+
readonly iconDiagnostics?: readonly AppIconDiagnostic[];
|
|
124
|
+
readonly definition: UiDefinition;
|
|
125
|
+
readonly handlers: Readonly<Record<string, UiPluginHandlerMetadata>>;
|
|
126
|
+
readonly resources: WorkspaceAppResourceSnapshot;
|
|
127
|
+
readonly html: string;
|
|
128
|
+
readonly entryBytes: readonly number[];
|
|
129
|
+
readonly entryHash: string;
|
|
130
|
+
readonly initialState: JsonObject;
|
|
131
|
+
readonly initialStateBytes?: readonly number[];
|
|
132
|
+
readonly initialStateHash?: string;
|
|
133
|
+
readonly sourceHash: string;
|
|
134
|
+
readonly toolNames: WorkspaceAppToolNames;
|
|
135
|
+
}
|
|
136
|
+
export type WorkspaceAppCandidate = WorkspaceAppCandidateBase & ({
|
|
137
|
+
readonly source: WorkspaceAppSource;
|
|
138
|
+
readonly provenance?: never;
|
|
139
|
+
readonly lineage?: never;
|
|
140
|
+
} | {
|
|
141
|
+
readonly source?: never;
|
|
142
|
+
readonly provenance: ProductAppBundleProvenance;
|
|
143
|
+
readonly lineage: readonly UiDefinitionLineageEntry[];
|
|
144
|
+
});
|
|
145
|
+
export interface WorkspaceAppDiscoveryResult {
|
|
146
|
+
readonly apps: readonly WorkspaceAppCandidate[];
|
|
147
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
148
|
+
readonly complete: boolean;
|
|
149
|
+
readonly incompleteReason?: WorkspaceAppDiscoveryIncompleteReason;
|
|
150
|
+
readonly productBundleIndexHash?: string;
|
|
151
|
+
readonly productBundleSnapshotMetadata?: ProductAppBundleSnapshotMetadata;
|
|
152
|
+
readonly candidates?: readonly WorkspaceAppCandidate[];
|
|
153
|
+
}
|
|
154
|
+
export declare const WORKSPACE_APP_TOOL_PREFIX = "crewx_local_app_";
|
|
155
|
+
export declare const LOCAL_APP_TOOL_PREFIX = "crewx_local_app_";
|
|
156
|
+
export declare const MCP_APP_WORKSPACE_TOOL_PREFIX = "crewx_local_app_";
|
|
157
|
+
export declare function deriveWorkspaceAppToolNames(pluginId: string): WorkspaceAppToolNames;
|
|
158
|
+
export declare function deriveWorkspaceAppToolName(pluginId: string, kind?: 'read' | 'action'): string;
|
|
159
|
+
export declare function discoverWorkspaceApps(workspaceRoot: string, fs?: AppDiscoveryFileSystem, options?: WorkspaceAppDiscoveryOptions): Promise<WorkspaceAppDiscoveryResult>;
|
|
160
|
+
export declare function discoverWorkspaceApps(workspaceRoot: string, options?: WorkspaceAppDiscoveryOptions): Promise<WorkspaceAppDiscoveryResult>;
|
|
161
|
+
export declare const discoverWorkspaceAppCandidates: typeof discoverWorkspaceApps;
|
|
162
|
+
export declare const scanWorkspaceApps: typeof discoverWorkspaceApps;
|
|
163
|
+
export { AppDiscoveryFsError, NodeAppDiscoveryFs, NodeAppDiscoveryFsAdapter, defaultAppDiscoveryFs, defaultNodeAppDiscoveryFs, createWorkspaceAppScanCache, };
|
|
164
|
+
export type { AppDiscoveryFsErrorCode, WorkspaceAppScanCache, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type McpAppContractErrorCode = 'APP_ID_INVALID' | 'APP_ID_CONFLICT' | 'TOOL_ID_INVALID' | 'TOOL_ID_CONFLICT' | 'RESOURCE_URI_INVALID' | 'RESOURCE_NOT_FOUND' | 'HTML_INVALID' | 'TOOL_INVALID' | 'STATE_INVALID' | 'STATE_PROJECTION_INVALID' | 'BUTTON_INVALID' | 'SERIALIZATION_INVALID';
|
|
2
|
+
export declare class McpAppContractError extends Error {
|
|
3
|
+
readonly code: McpAppContractErrorCode;
|
|
4
|
+
readonly name = "McpAppContractError";
|
|
5
|
+
constructor(code: McpAppContractErrorCode, message?: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function rejectMcpApp(code: McpAppContractErrorCode, message?: string): never;
|
|
@@ -0,0 +1,41 @@
|
|
|
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, makeUiUri, buildMcpAppBundleRegistrationInput, buildMcpAppBundleAgentActionDescriptors, planProductBundleLegacyToolNames, resolveMcpAppFixedResultCall, } from './registry.js';
|
|
6
|
+
export { AppDiscoveryFsError, NodeAppDiscoveryFs, NodeAppDiscoveryFsAdapter, defaultAppDiscoveryFs, defaultNodeAppDiscoveryFs, createWorkspaceAppScanCache, deriveWorkspaceAppToolName, deriveWorkspaceAppToolNames, discoverWorkspaceAppCandidates, discoverWorkspaceApps, LOCAL_APP_TOOL_PREFIX, MCP_APP_WORKSPACE_TOOL_PREFIX, productAppBundleReservations, scanWorkspaceApps, WORKSPACE_APP_TOOL_PREFIX, } from './discovery.js';
|
|
7
|
+
export { loadProductAppBundleAssets } from './product-bundle-assets.js';
|
|
8
|
+
export type { ProductAppBundleAsset, ProductAppBundleAssetCatalog, ProductAppBundleAssetLoadOptions, } from './product-bundle-assets.js';
|
|
9
|
+
export type { WorkspaceAppAsset, WorkspaceAppAssetCatalog, WorkspaceAppAssetDescriptorV1, WorkspaceAppAssetLocator, } from './workspace-app-assets.js';
|
|
10
|
+
export type { AppDiscoveryBytes, AppDiscoveryDiagnostic, AppDiscoveryDirectoryEntry, AppDiscoveryDirectoryEntryKind, AppDiscoveryDirectoryListing, AppDiscoveryFileSystem, AppDiscoveryFileFingerprint, AppDiscoveryFsErrorCode, AppDiscoveryMaybePromise, AppDiscoveryRootIdentity, WorkspaceAppDiscoveryOptions as AppDiscoveryOptions, McpAppDiscoveryDiagnostic, WorkspaceAppBuiltinCatalog, WorkspaceAppCandidate, WorkspaceAppDiscoveryIncompleteReason, WorkspaceAppDiscoveryOptions, WorkspaceAppDiscoveryResult, WorkspaceAppDiagnostic, WorkspaceAppDiagnosticCode, WorkspaceAppDiscoverySource, WorkspaceAppResourceSnapshot, WorkspaceAppScanCache, WorkspaceAppReservedCatalog, WorkspaceAppSource, WorkspaceAppToolNames, ProductAppBundleDefinitionIdentity, ProductAppBundleFileHash, ProductAppBundleIndex, ProductAppBundleInput, ProductAppBundlePackageIndex, ProductAppBundleReservations, ProductAppBundleProvenance, ProductAppBundleSnapshotMetadata, } from './discovery.js';
|
|
11
|
+
export { createWorkspaceAppCatalog, discoverWorkspaceAppCatalog, hashAppDefinition, hashCrewxAppDefinition, listWorkspaceApps, } from './catalog.js';
|
|
12
|
+
export type { CrewxAppBuiltinCatalog, CrewxAppCapability, CrewxAppCatalogOptions, CrewxAppCatalogResult, CrewxAppDefinitionHashInput, CrewxAppDefinitionSummary, CrewxAppDiagnostic, CrewxAppDiagnosticCode, CrewxAppDiagnosticSource, CrewxAppInstalledProjection, CrewxAppLocalDefinitionRef, CrewxAppOrigin, CrewxAppOwnership, CrewxAppShareability, CrewxAppSharingAvailability, CrewxAppSummary, } from './types.js';
|
|
13
|
+
export { MCP_APP_PROJECTION_MAX_BYTES, buildMcpAppStateDescriptor, buildMcpAppStateProjections, createMcpAppToolResult, projectMcpAppSummaryState, serializeMcpAppStateJson, serializeMcpAppStateXml, } from './projection.js';
|
|
14
|
+
export { attachAvailableApps, buildMcpAppsContext } from './apps-context.js';
|
|
15
|
+
export type { McpAppsContext, McpAppsContextOptions } from './apps-context.js';
|
|
16
|
+
export { UI_CONTENT_ERROR_CODES, UI_CONTENT_MAX_BYTES, UI_CONTENT_MAX_LINES, UI_CONTENT_MAX_MEMORY_BYTES, UI_CONTENT_MEDIA_TYPES, UI_CONTENT_OUTPUT_TTL_MS, UI_CONTENT_TICKET_TTL_MS, UiContentChannelError, contentBindingMatches, countContentLines, decodeContentUtf8, isUiContentDeclaration, isUiContentMediaType, isUiContentRangeRequest, isValidUiAppInstanceId, isValidUiThreadIdentity, sha256Content, validateContentBytes, validateContentFrame, } from './content-channel.js';
|
|
17
|
+
export type { ContentFrame, UiActionContentDeclaration, UiContentBinding, UiContentChannelPort, UiContentErrorCode, UiContentInputDeclaration, UiContentInputTicket, UiContentMediaType, UiContentOutputDeclaration, UiContentRange, UiContentRangeRequest, ValidateContentFrameOptions, } from './content-channel.js';
|
|
18
|
+
export { buildMcpAppContentActions, contentActionsMatch, isMcpAppContentActions, } from './content-declarations.js';
|
|
19
|
+
export type { McpAppContentActionDeclaration, McpAppContentActions, } from './content-declarations.js';
|
|
20
|
+
export { CREWX_OPEN_APP_CAPABILITY, CREWX_OPEN_APP_CAPABILITY_VERSION, CREWX_OPEN_APP_MAX_JSON_DEPTH, CREWX_OPEN_APP_MAX_PARAMS_BYTES, CREWX_OPEN_APP_METHOD, CREWX_OPEN_APP_STATUS_METHOD, CREWX_OPEN_APP_SUCCESS_STATUSES, CrewxOpenAppError, UI_APP_OPEN_CAUSE_CODES, UI_APP_OPEN_ERROR_CODES, canonicalCrewxOpenAppPayload, createCrewxOpenAppCapabilityDeclaration, createCrewxOpenAppErrorResult, createCrewxOpenAppRequestId, createCrewxOpenAppSuccessResult, decideCrewxOpenAppOpen, decideCrewxOpenAppStatus, isSameCrewxOpenAppSourceBinding, parseCrewxOpenAppCapabilityDeclaration, parseCrewxOpenAppRequest, parseCrewxOpenAppResult, parseCrewxOpenAppStatusRequest, resolveCrewxOpenAppActionOutcome, } from './app-handoff.js';
|
|
21
|
+
export type { CrewxOpenAppAction, CrewxOpenAppActionOutcome, CrewxOpenAppCapabilityDeclaration, CrewxOpenAppDecisionInput, CrewxOpenAppErrorResult, CrewxOpenAppIdempotencyDecision, CrewxOpenAppLedgerLookup, CrewxOpenAppLedgerRecord, CrewxOpenAppReceiptLookup, CrewxOpenAppRequest, CrewxOpenAppResult, CrewxOpenAppSourceBinding, CrewxOpenAppStatusRequest, CrewxOpenAppSuccessResult, CrewxOpenAppSuccessStatus, UiAppOpenCauseCode, UiAppOpenErrorCode, } from './app-handoff.js';
|
|
22
|
+
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';
|
|
23
|
+
export type { McpAppModelContext, McpAppModelContextInput } from './model-context.js';
|
|
24
|
+
export { resolveAgentAccess, listMcpAppAgentActions } from './agent-access.js';
|
|
25
|
+
export type { McpAppAgentAccess, McpAppAgentAccessAction, McpAppVerifiedBundleAccessContext } from './agent-access.js';
|
|
26
|
+
export { MCP_APP_CARD_HANDLERS, isMcpAppCardHandler, isMcpAppCardAction } from './card-handler.js';
|
|
27
|
+
export type { McpAppCardHandler } from './card-handler.js';
|
|
28
|
+
export { buildStateSetHandler, createStateSetHandler, } from './state-set.js';
|
|
29
|
+
export type { StateSetHandlerBuildInput } from './state-set.js';
|
|
30
|
+
export { SKILL_BACKEND_DEFAULT_TIMEOUT_MS, SKILL_BACKEND_INHERITED_ENV_ALLOWLIST, SKILL_BACKEND_CONTENT_SCHEMA_VERSION, SKILL_BACKEND_MAX_INPUT_BYTES, SKILL_BACKEND_MAX_OUTPUT_BYTES, SKILL_BACKEND_SCHEMA_VERSION, buildSkillBackendChildEnvironment, buildSkillBackendHandler, buildVerifiedBundleSkillBackendHandler, } from './skill-backend.js';
|
|
31
|
+
export type { SkillBackendChildEnvironment, SkillBackendExecutionPort, SkillBackendExecutionRequest, SkillBackendExecutionResponse, SkillBackendHandlerBuildInput, SkillBackendInfrastructureErrorCode, SkillBackendPayload, VerifiedBundleSkillBackendBuildInput, VerifiedBundleSkillRunnerPort, VerifiedBundleSkillSpawnRequest, SkillBackendPayloadV1, SkillBackendPayloadV2, SkillBackendContentInputHeader, SkillBackendContentOutputHeader, } from './skill-backend.js';
|
|
32
|
+
export { externalResourceCheckItems, appIconCheckItems, inspectSkillBackendOutput, scanExternalResources, } from './dev-checks.js';
|
|
33
|
+
export { readWorkspaceAppIconFile } from './app-icon-read.js';
|
|
34
|
+
export type { WorkspaceAppIconBytes } from './app-icon-read.js';
|
|
35
|
+
export type { AppDevCheckItem, ExternalResourceFinding, ExternalResourceKind, InspectSkillBackendOutputOptions, ScanExternalResourcesOptions, } from './dev-checks.js';
|
|
36
|
+
export { MCP_APP_HOST_TOOL_ALLOWLIST, MCP_CORE_TOOL_NAMES, MCP_APP_LOCAL_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_URI_PREFIX, } from './types.js';
|
|
37
|
+
export type { McpAppActionDispatcherToolInput, McpAppActionToolDescriptor, McpAppActionToolInput, McpAppButtonDescriptor, McpAppButtonInput, McpAppDescriptor, McpAppDescriptorInput, McpAppInputSchema, McpAppTone, McpUiResourceCsp, McpAppRegistry, McpAppResource, McpAppServerStateInput, McpAppStateDescriptor, McpAppStateProjections, McpAppHostToolInput, McpAppLayoutSnapshot, McpAppPromptResult, McpAppPromptStatus, McpAppWindowState, McpAppStateView, McpAppHostToolName, McpCoreToolName, McpAppReadToolInput, McpAppSingleActionToolInput, McpAppToolCommonInput, McpAppToolDescriptor, McpAppFixedResult, McpAppFixedResultCall, McpAppFixedResultInvalidParams, McpAppFixedResultResolution, McpAppFixedResultUnavailable, McpAppToolInput, McpAppToolMetadata, McpAppToolRegistration, McpAppToolResult, McpAppToolVisibility, McpAppInstanceResourceBinding, McpAppMcpResourceBinding, McpAppResourceBinding, McpAppLocalResource, McpAppLocalRegistrationInput, McpAppLocalReadToolDescriptor, McpAppLocalActionToolDescriptor, McpAppLocalSingleActionToolDescriptor, McpAppLocalHostToolDescriptor, McpAppLocalToolDiagnostic, McpAppLocalToolDescriptor, McpAppLocalRegistration, McpAppBuiltinRegistration, McpAppResolvedRegistration, McpAppLocalLauncher, McpAppBuiltinLauncher, McpAppLauncher, WorkspaceAppLauncher, WorkspaceAppResolvedRegistration, McpAppWorkspaceRegistry, WorkspaceAppRegistry, McpAppWorkspaceRegistryInput, McpAppRegistryOptions, McpAppBundleHostToolTemplate, McpAppBundleAgentActionDescriptor, } from './types.js';
|
|
38
|
+
export { buildWorkspaceAppSnapshot, discoverWorkspaceAppSnapshot, reconfirmWorkspaceAppSnapshot, } from './workspace-snapshot.js';
|
|
39
|
+
export type { WorkspaceAppSnapshot, WorkspaceAppSnapshotBuildOptions, WorkspaceAppSnapshotOptions, WorkspaceAppSnapshotReconfirmResult, WorkspaceAppSnapshotResource, WorkspaceAppSnapshotInitialState, WorkspaceAppInitialState, } from './workspace-snapshot.js';
|
|
40
|
+
export { appScheduleCommandLabel, cronExpressionForInterval, decideScheduleDirective, planScheduledFire, resolveDeclaredSchedule, scheduleTemplateFor, toScheduledRunVerdict, toScheduleSnapshot, } from './app-schedule.js';
|
|
41
|
+
export type { AppScheduleActorKind, AppScheduleAvailability, AppScheduleBinding, AppScheduleOwner, AppScheduleOwnerSource, AppScheduleRowView, AppScheduleTemplate, AppScheduledRunPayload, AppScheduledRunPlan, ResolvedAppSchedule, ScheduleDirectiveDecision, ScheduleLifecycleEntry, ScheduleLifecyclePlan, ScheduledAppLaunchRequest, } from './app-schedule.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,29 @@
|
|
|
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 declare const MCP_APP_ACTION_RESULT_MAX_BYTES = 2097152;
|
|
7
|
+
export interface McpAppModelContextInput {
|
|
8
|
+
readonly instanceId: string;
|
|
9
|
+
readonly definitionHash: string;
|
|
10
|
+
readonly revision: number;
|
|
11
|
+
readonly content?: unknown;
|
|
12
|
+
readonly structuredContent?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface McpAppModelContext {
|
|
15
|
+
readonly instanceId: string;
|
|
16
|
+
readonly definitionHash: string;
|
|
17
|
+
readonly revision: number;
|
|
18
|
+
readonly content?: readonly {
|
|
19
|
+
readonly type: 'text';
|
|
20
|
+
readonly text: string;
|
|
21
|
+
}[];
|
|
22
|
+
readonly structuredContent?: JsonObject;
|
|
23
|
+
}
|
|
24
|
+
export declare function sanitizeMcpAppActionResult(value: unknown): JsonObject;
|
|
25
|
+
export declare function prepareMcpAppActionResult(value: unknown, selectedAllow: readonly string[]): JsonObject;
|
|
26
|
+
export declare function sanitizeMcpAppModelContext(value: unknown): McpAppModelContext;
|
|
27
|
+
export declare function serializeMcpAppModelContextXml(context: McpAppModelContext, options?: {
|
|
28
|
+
readonly stale?: boolean;
|
|
29
|
+
}): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AppDiscoveryFileFingerprint, AppDiscoveryRootIdentity } from './discovery.js';
|
|
2
|
+
export type AppDiscoveryFsErrorCode = 'NOT_FOUND' | 'READ_DENIED' | 'LIMIT_EXCEEDED' | 'PATH_ESCAPED' | 'IDENTITY_CHANGED' | 'TOCTOU' | 'UNSUPPORTED';
|
|
3
|
+
export declare class AppDiscoveryFsError extends Error {
|
|
4
|
+
readonly code: AppDiscoveryFsErrorCode;
|
|
5
|
+
readonly name = "AppDiscoveryFsError";
|
|
6
|
+
constructor(code: AppDiscoveryFsErrorCode);
|
|
7
|
+
}
|
|
8
|
+
export interface NodeAppDiscoveryDirectoryEntry {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly kind: 'file' | 'directory' | 'symlink' | 'other';
|
|
11
|
+
}
|
|
12
|
+
export declare class NodeAppDiscoveryFs {
|
|
13
|
+
getRootIdentity(root: string): Promise<AppDiscoveryRootIdentity>;
|
|
14
|
+
listDirectory(root: string, relativePath: string): Promise<readonly NodeAppDiscoveryDirectoryEntry[]>;
|
|
15
|
+
readdir(root: string, relativePath: string): Promise<readonly NodeAppDiscoveryDirectoryEntry[]>;
|
|
16
|
+
readDirectory(root: string, relativePath: string): Promise<readonly NodeAppDiscoveryDirectoryEntry[]>;
|
|
17
|
+
readVerifiedFile(root: string, relativePath: string, byteLimit: number): Promise<Uint8Array>;
|
|
18
|
+
fingerprintVerifiedFile(root: string, relativePath: string, byteLimit: number): Promise<AppDiscoveryFileFingerprint>;
|
|
19
|
+
readFileVerified(root: string, relativePath: string, byteLimit: number): Promise<Uint8Array>;
|
|
20
|
+
}
|
|
21
|
+
export declare const defaultAppDiscoveryFs: NodeAppDiscoveryFs;
|
|
22
|
+
export declare const defaultNodeAppDiscoveryFs: NodeAppDiscoveryFs;
|
|
23
|
+
export declare const NodeAppDiscoveryFsAdapter: typeof NodeAppDiscoveryFs;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ProductAppBundleInput } from './product-bundle-loader.js';
|
|
2
|
+
import type { AppDiscoveryFileSystem, WorkspaceAppDiagnostic } from './discovery.js';
|
|
3
|
+
import type { ProductAppBundleProvenance } from './product-bundle-loader.js';
|
|
4
|
+
export declare const MCP_APP_ASSET_MAX_FILE_BYTES: number;
|
|
5
|
+
export declare const MCP_APP_ASSET_MAX_TOTAL_BYTES: number;
|
|
6
|
+
export declare const MCP_APP_ASSET_MAX_LOCATORS = 128;
|
|
7
|
+
export declare function isCanonicalMcpAppAssetFilename(filename: string): boolean;
|
|
8
|
+
export declare function mcpAppAssetContentType(filename: string): string | undefined;
|
|
9
|
+
export interface ProductAppBundleAsset {
|
|
10
|
+
readonly sha256: string;
|
|
11
|
+
readonly filename: string;
|
|
12
|
+
readonly contentType: string;
|
|
13
|
+
readonly byteLength: number;
|
|
14
|
+
readonly provenance: ProductAppBundleProvenance;
|
|
15
|
+
bytes(): Uint8Array;
|
|
16
|
+
}
|
|
17
|
+
export interface ProductAppBundleAssetCatalog {
|
|
18
|
+
readonly indexHash?: string;
|
|
19
|
+
readonly complete: boolean;
|
|
20
|
+
readonly diagnostics: readonly WorkspaceAppDiagnostic[];
|
|
21
|
+
get(sha256: string, filename: string): ProductAppBundleAsset | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface ProductAppBundleAssetLoadOptions {
|
|
24
|
+
readonly filesystem?: AppDiscoveryFileSystem;
|
|
25
|
+
readonly clock?: () => number;
|
|
26
|
+
}
|
|
27
|
+
export declare function loadProductAppBundleAssets(input: ProductAppBundleInput, options?: ProductAppBundleAssetLoadOptions): Promise<ProductAppBundleAssetCatalog>;
|