@crewx/sdk 0.9.0-rc.15 → 0.9.0-rc.150
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 +148 -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 +56 -0
- package/dist/app/index.d.ts +10 -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/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 +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 -3
- package/dist/conversation/to-template-messages.d.ts +9 -0
- package/dist/conversation/types.d.ts +48 -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 +1137 -226
- package/dist/esm/node/index.js +2 -0
- package/dist/esm/plugins/index.js +498 -216
- package/dist/esm/process/index.js +1 -0
- package/dist/esm/publish/index.js +2 -0
- package/dist/esm/repository/index.js +606 -209
- 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 +60 -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 +127 -17
- package/dist/index.js +1137 -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/apps-context.d.ts +20 -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/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 +29 -0
- package/dist/mcp-app/diagnostic-reason.d.ts +3 -0
- package/dist/mcp-app/discovery.d.ts +161 -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 +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/registry.d.ts +28 -0
- package/dist/mcp-app/skill-backend.d.ts +132 -0
- package/dist/mcp-app/state-set.d.ts +9 -0
- package/dist/mcp-app/types.d.ts +472 -0
- package/dist/mcp-app/workspace-app-assets.d.ts +42 -0
- package/dist/mcp-app/workspace-app-scan-cache.d.ts +24 -0
- package/dist/mcp-app/workspace-snapshot.d.ts +71 -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/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/_journal.json +196 -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 +498 -216
- 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 +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 +43 -5
- package/dist/repository/index.js +606 -209
- 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 +275 -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 +115 -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-suggestions.d.ts +199 -0
- package/dist/schema/common-codes.d.ts +216 -0
- package/dist/schema/index.d.ts +13 -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/tasks.d.ts +203 -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-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/types.d.ts +20 -0
- package/dist/testing/index.js +1 -1
- package/dist/types/index.d.ts +1574 -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 +18 -0
- package/dist/ui-instance/store.d.ts +210 -0
- package/dist/ui-instance/types.d.ts +327 -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 +6 -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 +203 -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 +296 -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,64 @@
|
|
|
1
|
+
import type { JsonValue } from '../ui-instance/types.js';
|
|
2
|
+
import { APP_TOOLS_FILE } from '../app/tool-mode.js';
|
|
3
|
+
import type { UiPluginManifestMode, UiPluginManifestV2, UiPluginValidationErrorCode } from './types.js';
|
|
4
|
+
export declare const APP_MANIFEST_FILE = "manifest.json";
|
|
5
|
+
export declare const LEGACY_APP_MANIFEST_FILE = "ui-plugin.json";
|
|
6
|
+
export declare const APP_MANIFEST_FILES: readonly ["manifest.json", "ui-plugin.json"];
|
|
7
|
+
export type AppManifestFileName = (typeof APP_MANIFEST_FILES)[number];
|
|
8
|
+
export { APP_TOOLS_FILE };
|
|
9
|
+
export type AppToolsFileName = typeof APP_TOOLS_FILE;
|
|
10
|
+
export declare const MCPB_MANIFEST_VERSION = "0.3";
|
|
11
|
+
export declare const CREWX_META_NAMESPACE = "dev.crewx";
|
|
12
|
+
export declare const MCPB_MANIFEST_KEYS: readonly ["manifest_version", "name", "display_name", "version", "description", "long_description", "author", "repository", "homepage", "documentation", "support", "icon", "icons", "screenshots", "localization", "server", "tools", "tools_generated", "prompts", "prompts_generated", "keywords", "license", "privacy_policies", "compatibility", "user_config", "_meta"];
|
|
13
|
+
export declare const APP_MANIFEST_REQUIRED_KEYS: readonly ["manifest_version", "name", "display_name", "version", "description", "_meta"];
|
|
14
|
+
export declare const APP_MANIFEST_PASSTHROUGH_KEYS: readonly ("name" | "description" | "server" | "tools" | "version" | "_meta" | "icon" | "manifest_version" | "display_name" | "long_description" | "author" | "repository" | "homepage" | "documentation" | "support" | "icons" | "screenshots" | "localization" | "tools_generated" | "prompts" | "prompts_generated" | "keywords" | "license" | "privacy_policies" | "compatibility" | "user_config")[];
|
|
15
|
+
export declare const CREWX_META_REQUIRED_KEYS: readonly ["entry", "surfaces", "size", "stateProjection", "actions"];
|
|
16
|
+
export declare const CREWX_META_OPTIONAL_KEYS: readonly ["definitionId", "definitionVersion", "icon", "tone", "entryHash", "runtime", "initialState", "usage", "detailPanel", "displayModes", "summaryProjection", "dataPaths", "focusedAiDataPaths", "csp"];
|
|
17
|
+
export declare function isAppSemver(value: unknown): value is string;
|
|
18
|
+
export interface AppManifestReason {
|
|
19
|
+
readonly path: string;
|
|
20
|
+
readonly rule: string;
|
|
21
|
+
readonly message?: string;
|
|
22
|
+
readonly file?: AppManifestFileName | AppToolsFileName;
|
|
23
|
+
}
|
|
24
|
+
export type AppManifestRejectionCode = UiPluginValidationErrorCode | 'MANIFEST_DUAL_MISMATCH';
|
|
25
|
+
export interface AppManifestRejection {
|
|
26
|
+
readonly code: AppManifestRejectionCode;
|
|
27
|
+
readonly reason: AppManifestReason;
|
|
28
|
+
readonly files: readonly AppManifestFileName[];
|
|
29
|
+
}
|
|
30
|
+
export interface AppManifestIdentity {
|
|
31
|
+
readonly pluginId: string;
|
|
32
|
+
readonly definitionId?: string;
|
|
33
|
+
readonly definitionVersion?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface AppManifestFileResult {
|
|
36
|
+
readonly file: AppManifestFileName;
|
|
37
|
+
readonly manifest: UiPluginManifestV2;
|
|
38
|
+
readonly v2Input: Readonly<Record<string, unknown>>;
|
|
39
|
+
readonly releaseVersion?: string;
|
|
40
|
+
readonly mcpb?: Readonly<Record<string, JsonValue>>;
|
|
41
|
+
}
|
|
42
|
+
export interface AppManifestSource extends AppManifestFileResult {
|
|
43
|
+
readonly ok: true;
|
|
44
|
+
readonly identity: AppManifestIdentity;
|
|
45
|
+
readonly files: readonly AppManifestFileName[];
|
|
46
|
+
}
|
|
47
|
+
export interface AppManifestFailure {
|
|
48
|
+
readonly ok: false;
|
|
49
|
+
readonly rejection: AppManifestRejection;
|
|
50
|
+
readonly parseFailure: boolean;
|
|
51
|
+
readonly identity?: AppManifestIdentity;
|
|
52
|
+
readonly builtinOnly: boolean;
|
|
53
|
+
}
|
|
54
|
+
export type AppManifestResult = AppManifestSource | AppManifestFailure;
|
|
55
|
+
export interface AppManifestOptions {
|
|
56
|
+
readonly mode?: UiPluginManifestMode;
|
|
57
|
+
readonly maxBytes?: number;
|
|
58
|
+
}
|
|
59
|
+
export type AppManifestFileBytes = Partial<Record<AppManifestFileName, Uint8Array>> & {
|
|
60
|
+
[APP_TOOLS_FILE]?: Uint8Array;
|
|
61
|
+
};
|
|
62
|
+
export declare function claimsCrewxNamespace(bytes: Uint8Array): boolean;
|
|
63
|
+
export declare function appManifestDefinitionHash(manifest: UiPluginManifestV2): string;
|
|
64
|
+
export declare function resolveAppManifest(files: AppManifestFileBytes, options?: AppManifestOptions): AppManifestResult;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface UiPluginCspInput {
|
|
2
|
+
readonly connectDomains?: readonly string[];
|
|
3
|
+
readonly frameDomains?: readonly string[];
|
|
4
|
+
readonly resourceDomains?: readonly string[];
|
|
5
|
+
readonly baseUriDomains?: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
export type UiPluginCspNormalizationErrorCode = 'CSP_AXIS_UNSUPPORTED' | 'CSP_AXIS_UNKNOWN' | 'CSP_LIMIT_EXCEEDED' | 'CSP_ORIGIN_INVALID' | 'CSP_ORIGIN_FORBIDDEN';
|
|
8
|
+
export interface NormalizedUiPluginCsp {
|
|
9
|
+
readonly declared: boolean;
|
|
10
|
+
readonly connectDomains: readonly string[];
|
|
11
|
+
readonly frameDomains: readonly string[];
|
|
12
|
+
readonly resourceDomains: readonly [];
|
|
13
|
+
readonly baseUriDomains: readonly [];
|
|
14
|
+
readonly cspHash: string;
|
|
15
|
+
}
|
|
16
|
+
export interface UiPluginCspNormalizeOptions {
|
|
17
|
+
readonly runtimeHostnames?: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
export interface UiPluginPolicyRuntime {
|
|
20
|
+
readonly wasm?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface UiPluginPolicyHashInput {
|
|
23
|
+
readonly runtime?: UiPluginPolicyRuntime;
|
|
24
|
+
readonly cspHash: string;
|
|
25
|
+
readonly policySchema: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function normalizeUiPluginCsp(input: UiPluginCspInput | undefined, options?: UiPluginCspNormalizeOptions): NormalizedUiPluginCsp;
|
|
28
|
+
export declare function policyHash(input: UiPluginPolicyHashInput): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { canonicalManifestJson, manifestHash } from './manifest.js';
|
|
2
|
+
export { APP_MANIFEST_FILE, APP_MANIFEST_FILES, APP_MANIFEST_PASSTHROUGH_KEYS, APP_MANIFEST_REQUIRED_KEYS, CREWX_META_NAMESPACE, CREWX_META_OPTIONAL_KEYS, CREWX_META_REQUIRED_KEYS, LEGACY_APP_MANIFEST_FILE, MCPB_MANIFEST_KEYS, MCPB_MANIFEST_VERSION, appManifestDefinitionHash, APP_TOOLS_FILE, claimsCrewxNamespace, isAppSemver, resolveAppManifest, } from './app-manifest.js';
|
|
3
|
+
export type { AppManifestFailure, AppManifestFileBytes, AppManifestFileName, AppManifestFileResult, AppManifestIdentity, AppManifestOptions, AppManifestReason, AppManifestRejection, AppManifestRejectionCode, AppManifestResult, AppManifestSource, AppToolsFileName, } from './app-manifest.js';
|
|
4
|
+
export { UiPluginValidationError, normalizeManifest, validateInitialState, validateManifest, validatePayload, } from './validator.js';
|
|
5
|
+
export { UI_PLUGIN_CAPABILITY_PATTERN, UI_PLUGIN_HANDLER_PATTERN, UI_PLUGIN_IDENTIFIER_PATTERN, UI_PLUGIN_MAX_ACTIONS, UI_PLUGIN_MAX_ARRAY_LENGTH, UI_PLUGIN_MAX_CANDIDATE_DEPTH, UI_PLUGIN_MAX_COMMAND_LENGTH, UI_PLUGIN_MAX_COMMAND_PARTS, UI_PLUGIN_MAX_DISCOVERED_APPS, UI_PLUGIN_MAX_DISCOVERY_TIME_MS, UI_PLUGIN_MAX_HEIGHT, UI_PLUGIN_MAX_INITIAL_STATE_BYTES, UI_PLUGIN_MAX_JSON_DEPTH, UI_PLUGIN_MAX_MANIFEST_BYTES, UI_PLUGIN_MAX_PROJECTION_PATHS, UI_PLUGIN_MAX_SCHEMA_DEPTH, UI_PLUGIN_MAX_SCHEMA_PROPERTIES, UI_PLUGIN_MAX_STRING_LENGTH, UI_PLUGIN_MAX_SUBTREE_BYTES, UI_PLUGIN_MAX_SURFACES, UI_PLUGIN_RESERVED_STATE_KEYS, UI_PLUGIN_SAFE_PATH_PATTERN, UI_PLUGIN_SAFE_PATH_SEGMENT_PATTERN, UI_PLUGIN_SKILL_TOKEN_PATTERN, UI_PLUGIN_SURFACES, UI_PLUGIN_TONES, isUiPluginReservedStateKey, } from './limits.js';
|
|
6
|
+
export type { UiPluginActivation, UiPluginAction, UiPluginBackend, UiPluginCardShellNode, UiPluginCoreBackend, UiPluginFieldSchema, UiPluginHeadingNode, UiPluginInputSchema, UiPluginJsonSchema, UiPluginJsonSchemaType, UiPluginLabeledTextNode, UiPluginLayoutNode, UiPluginLayout, UiPluginManifest, UiPluginManifestMode, UiPluginManifestV1, UiPluginManifestV2, UiPluginCspRequest, UiPluginRuntimeRequest, UiPluginMetaBannerNode, UiPluginNormalizedManifestV2, UiPluginNormalizedV2, UiPluginPayload, UiPluginPayloadValue, UiPluginPrimitive, UiPluginProjectionPolicy, UiPluginResourceMetadata, UiPluginResourceRef, UiPluginSchemaType, UiPluginSchema, UiPluginSize, UiPluginSkillBackend, UiPluginStep, UiPluginStepFlowNode, UiPluginStepListSchema, UiPluginTextListNode, UiPluginTextListSchema, UiPluginTextSchema, UiPluginSurface, UiPluginTone, UiPluginHandlerMetadata, UiPluginValidationErrorCode, UiPluginValidationOptions, } from './types.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const UI_PLUGIN_MAX_STRING_LENGTH = 4096;
|
|
2
|
+
export declare const UI_PLUGIN_MAX_ARRAY_LENGTH = 128;
|
|
3
|
+
export declare const UI_PLUGIN_MAX_SUBTREE_BYTES: number;
|
|
4
|
+
export declare const UI_PLUGIN_MAX_INITIAL_STATE_BYTES: number;
|
|
5
|
+
export declare const UI_PLUGIN_MAX_JSON_DEPTH = 8;
|
|
6
|
+
export declare const UI_PLUGIN_MAX_SCHEMA_DEPTH = 8;
|
|
7
|
+
export declare const UI_PLUGIN_MAX_SCHEMA_PROPERTIES = 64;
|
|
8
|
+
export declare const UI_PLUGIN_MAX_ACTIONS = 32;
|
|
9
|
+
export declare const UI_PLUGIN_MAX_SURFACES = 2;
|
|
10
|
+
export declare const UI_PLUGIN_MAX_PROJECTION_PATHS = 128;
|
|
11
|
+
export declare const UI_PLUGIN_MAX_COMMAND_PARTS = 16;
|
|
12
|
+
export declare const UI_PLUGIN_MAX_COMMAND_LENGTH = 256;
|
|
13
|
+
export declare const UI_PLUGIN_MAX_HEIGHT = 720;
|
|
14
|
+
export declare const UI_PLUGIN_MAX_DISCOVERED_APPS = 64;
|
|
15
|
+
export declare const UI_PLUGIN_MAX_MANIFEST_BYTES: number;
|
|
16
|
+
export declare const UI_PLUGIN_MAX_CANDIDATE_DEPTH = 2;
|
|
17
|
+
export declare const UI_PLUGIN_MAX_DISCOVERY_TIME_MS = 5000;
|
|
18
|
+
export declare const UI_PLUGIN_RESERVED_STATE_KEYS: readonly ["__proto__", "prototype", "constructor", "proof", "token", "secret", "password", "cookie", "authorization", "private_key", "private-key", "stack", "exception", "plugin_text", "url", "uri", "endpoint", "path", "filename", "filepath", "cwd", "shell", "directory", "dir", "folder"];
|
|
19
|
+
export declare function isUiPluginReservedStateKey(key: string): boolean;
|
|
20
|
+
export declare const UI_PLUGIN_SAFE_PATH_SEGMENT_PATTERN: RegExp;
|
|
21
|
+
export declare const UI_PLUGIN_SAFE_PATH_PATTERN: RegExp;
|
|
22
|
+
export declare const UI_PLUGIN_IDENTIFIER_PATTERN: RegExp;
|
|
23
|
+
export declare const UI_PLUGIN_CAPABILITY_PATTERN: RegExp;
|
|
24
|
+
export declare const UI_PLUGIN_HANDLER_PATTERN: RegExp;
|
|
25
|
+
export declare const UI_PLUGIN_SKILL_TOKEN_PATTERN: RegExp;
|
|
26
|
+
export declare const UI_PLUGIN_TONES: readonly ["blue", "violet", "emerald", "amber", "rose", "sky", "slate", "indigo"];
|
|
27
|
+
export declare const UI_PLUGIN_SURFACES: readonly ["inline", "panel"];
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import type { JsonObject, JsonValue, UiActionConfirmation, UiDefinitionInput } from '../ui-instance/types.js';
|
|
2
|
+
import type { APP_TOOL_ENTRY } from '../app/tool-mode.js';
|
|
3
|
+
import type { UiSkillBackendEnvironmentKey } from '../ui-instance/types.js';
|
|
4
|
+
import type { UiActionContentDeclaration } from '../mcp-app/content-channel.js';
|
|
5
|
+
export type UiPluginPrimitive = 'card-shell' | 'meta-banner' | 'heading' | 'labeled-text' | 'step-flow' | 'text-list';
|
|
6
|
+
export type UiPluginSchemaType = 'text' | 'text-list' | 'step-list';
|
|
7
|
+
export interface UiPluginTextSchema {
|
|
8
|
+
readonly type: 'text';
|
|
9
|
+
readonly maxLength: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UiPluginTextListSchema {
|
|
12
|
+
readonly type: 'text-list';
|
|
13
|
+
readonly max: number;
|
|
14
|
+
readonly itemMaxLength: number;
|
|
15
|
+
}
|
|
16
|
+
export interface UiPluginStepListSchema {
|
|
17
|
+
readonly type: 'step-list';
|
|
18
|
+
readonly min: number;
|
|
19
|
+
readonly max: number;
|
|
20
|
+
readonly labelMaxLength: number;
|
|
21
|
+
readonly detailMaxLength: number;
|
|
22
|
+
}
|
|
23
|
+
export type UiPluginFieldSchema = UiPluginTextSchema | UiPluginTextListSchema | UiPluginStepListSchema;
|
|
24
|
+
export type UiPluginSchema = Readonly<Record<string, UiPluginFieldSchema>>;
|
|
25
|
+
export interface UiPluginActivation {
|
|
26
|
+
readonly kind: 'fenced-code';
|
|
27
|
+
readonly language: string;
|
|
28
|
+
}
|
|
29
|
+
export interface UiPluginCardShellNode {
|
|
30
|
+
readonly primitive: 'card-shell';
|
|
31
|
+
}
|
|
32
|
+
export interface UiPluginMetaBannerNode {
|
|
33
|
+
readonly primitive: 'meta-banner';
|
|
34
|
+
readonly badgeToken: string;
|
|
35
|
+
readonly noticeToken: string;
|
|
36
|
+
}
|
|
37
|
+
export interface UiPluginHeadingNode {
|
|
38
|
+
readonly primitive: 'heading';
|
|
39
|
+
readonly field: string;
|
|
40
|
+
}
|
|
41
|
+
export interface UiPluginLabeledTextNode {
|
|
42
|
+
readonly primitive: 'labeled-text';
|
|
43
|
+
readonly titleToken: string;
|
|
44
|
+
readonly field: string;
|
|
45
|
+
readonly variant: 'callout';
|
|
46
|
+
}
|
|
47
|
+
export interface UiPluginStepFlowNode {
|
|
48
|
+
readonly primitive: 'step-flow';
|
|
49
|
+
readonly titleToken: string;
|
|
50
|
+
readonly field: string;
|
|
51
|
+
}
|
|
52
|
+
export interface UiPluginTextListNode {
|
|
53
|
+
readonly primitive: 'text-list';
|
|
54
|
+
readonly titleToken: string;
|
|
55
|
+
readonly field: string;
|
|
56
|
+
readonly emptyToken?: string;
|
|
57
|
+
readonly hideWhenEmpty?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export type UiPluginLayoutNode = UiPluginCardShellNode | UiPluginMetaBannerNode | UiPluginHeadingNode | UiPluginLabeledTextNode | UiPluginStepFlowNode | UiPluginTextListNode;
|
|
60
|
+
export type UiPluginLayout = readonly UiPluginLayoutNode[];
|
|
61
|
+
export interface UiPluginManifestV1 {
|
|
62
|
+
readonly manifestVersion: 1;
|
|
63
|
+
readonly pluginId: string;
|
|
64
|
+
readonly definitionId: string;
|
|
65
|
+
readonly version: number;
|
|
66
|
+
readonly primitiveSet: number;
|
|
67
|
+
readonly activation: UiPluginActivation;
|
|
68
|
+
readonly schema: UiPluginSchema;
|
|
69
|
+
readonly layout: UiPluginLayout;
|
|
70
|
+
}
|
|
71
|
+
export type UiPluginManifestMode = 'local' | 'installed' | 'published';
|
|
72
|
+
export type UiPluginSurface = 'inline' | 'panel';
|
|
73
|
+
export type UiPluginTone = 'blue' | 'violet' | 'emerald' | 'amber' | 'rose' | 'sky' | 'slate' | 'indigo';
|
|
74
|
+
export type UiPluginJsonSchemaType = 'object' | 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'null';
|
|
75
|
+
export interface UiPluginJsonSchema {
|
|
76
|
+
readonly type: UiPluginJsonSchemaType;
|
|
77
|
+
readonly enum?: readonly JsonValue[];
|
|
78
|
+
readonly minLength?: number;
|
|
79
|
+
readonly maxLength?: number;
|
|
80
|
+
readonly minItems?: number;
|
|
81
|
+
readonly maxItems?: number;
|
|
82
|
+
readonly minProperties?: number;
|
|
83
|
+
readonly maxProperties?: number;
|
|
84
|
+
readonly minimum?: number;
|
|
85
|
+
readonly maximum?: number;
|
|
86
|
+
readonly items?: UiPluginJsonSchema;
|
|
87
|
+
readonly properties?: Readonly<Record<string, UiPluginJsonSchema>>;
|
|
88
|
+
readonly required?: readonly string[];
|
|
89
|
+
readonly additionalProperties?: false;
|
|
90
|
+
}
|
|
91
|
+
export interface UiPluginInputSchema extends UiPluginJsonSchema {
|
|
92
|
+
readonly type: 'object';
|
|
93
|
+
readonly properties: Readonly<Record<string, UiPluginJsonSchema>>;
|
|
94
|
+
}
|
|
95
|
+
export interface UiPluginProjectionPolicy {
|
|
96
|
+
readonly allow: readonly string[];
|
|
97
|
+
}
|
|
98
|
+
export interface UiPluginCoreBackend {
|
|
99
|
+
readonly type: 'core';
|
|
100
|
+
readonly handler: string;
|
|
101
|
+
}
|
|
102
|
+
export interface UiPluginSkillCommandBackend {
|
|
103
|
+
readonly type: 'skill';
|
|
104
|
+
readonly command: readonly string[];
|
|
105
|
+
readonly entry?: never;
|
|
106
|
+
readonly env?: readonly UiSkillBackendEnvironmentKey[];
|
|
107
|
+
}
|
|
108
|
+
export interface UiPluginSkillEntryBackend {
|
|
109
|
+
readonly type: 'skill';
|
|
110
|
+
readonly entry: typeof APP_TOOL_ENTRY;
|
|
111
|
+
readonly command?: never;
|
|
112
|
+
readonly env?: never;
|
|
113
|
+
}
|
|
114
|
+
export type UiPluginSkillBackend = UiPluginSkillCommandBackend | UiPluginSkillEntryBackend;
|
|
115
|
+
export type UiPluginBackend = UiPluginCoreBackend | UiPluginSkillBackend;
|
|
116
|
+
export interface UiPluginAction {
|
|
117
|
+
readonly actionId: string;
|
|
118
|
+
readonly capability: string;
|
|
119
|
+
readonly mutation: boolean;
|
|
120
|
+
readonly inputSchema: UiPluginInputSchema;
|
|
121
|
+
readonly resultProjection: UiPluginProjectionPolicy;
|
|
122
|
+
readonly backend: UiPluginBackend;
|
|
123
|
+
readonly content?: UiActionContentDeclaration;
|
|
124
|
+
readonly dataInputs?: readonly string[];
|
|
125
|
+
readonly confirmation?: UiActionConfirmation;
|
|
126
|
+
readonly _meta?: JsonObject;
|
|
127
|
+
}
|
|
128
|
+
export interface UiPluginResourceRef {
|
|
129
|
+
readonly path: 'ui/index.html' | 'ui/state.json';
|
|
130
|
+
readonly hash?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface UiPluginSize {
|
|
133
|
+
readonly height: number;
|
|
134
|
+
}
|
|
135
|
+
export interface UiPluginRuntimeRequest {
|
|
136
|
+
readonly wasm?: true;
|
|
137
|
+
readonly terminal?: true;
|
|
138
|
+
readonly htmlDocuments?: true;
|
|
139
|
+
}
|
|
140
|
+
export interface UiPluginCspRequest {
|
|
141
|
+
readonly connectDomains: readonly string[];
|
|
142
|
+
}
|
|
143
|
+
export interface UiPluginManifestV2 {
|
|
144
|
+
readonly manifestVersion: 2;
|
|
145
|
+
readonly pluginId: string;
|
|
146
|
+
readonly definitionId: string;
|
|
147
|
+
readonly version: number;
|
|
148
|
+
readonly name: string;
|
|
149
|
+
readonly description: string;
|
|
150
|
+
readonly icon?: string;
|
|
151
|
+
readonly tone?: UiPluginTone;
|
|
152
|
+
readonly entry: 'ui/index.html';
|
|
153
|
+
readonly entryHash?: string;
|
|
154
|
+
readonly runtime?: UiPluginRuntimeRequest;
|
|
155
|
+
readonly csp?: UiPluginCspRequest;
|
|
156
|
+
readonly initialState?: {
|
|
157
|
+
readonly path: 'ui/state.json';
|
|
158
|
+
readonly hash?: string;
|
|
159
|
+
};
|
|
160
|
+
readonly usage?: UiDefinitionInput['usage'];
|
|
161
|
+
readonly detailPanel?: UiDefinitionInput['detailPanel'];
|
|
162
|
+
readonly displayModes?: UiDefinitionInput['displayModes'];
|
|
163
|
+
readonly surfaces: readonly UiPluginSurface[];
|
|
164
|
+
readonly size: UiPluginSize;
|
|
165
|
+
readonly stateProjection: UiPluginProjectionPolicy;
|
|
166
|
+
readonly summaryProjection?: UiPluginProjectionPolicy;
|
|
167
|
+
readonly dataPaths?: readonly string[];
|
|
168
|
+
readonly actions: readonly UiPluginAction[];
|
|
169
|
+
readonly _meta?: JsonObject;
|
|
170
|
+
}
|
|
171
|
+
export type UiPluginManifest = UiPluginManifestV1 | UiPluginManifestV2;
|
|
172
|
+
export interface UiPluginHandlerMetadata {
|
|
173
|
+
readonly actionId: string;
|
|
174
|
+
readonly mutation: boolean;
|
|
175
|
+
readonly backend: UiPluginBackend;
|
|
176
|
+
readonly launchPolicy: 'allowed' | 'denied';
|
|
177
|
+
readonly denialCode?: 'EXEC_DENIED';
|
|
178
|
+
}
|
|
179
|
+
export interface UiPluginResourceMetadata {
|
|
180
|
+
readonly entry: UiPluginResourceRef;
|
|
181
|
+
readonly initialState?: {
|
|
182
|
+
readonly path: 'ui/state.json';
|
|
183
|
+
readonly hash?: string;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
export interface UiPluginNormalizedManifestV2 {
|
|
187
|
+
readonly manifest: UiPluginManifestV2;
|
|
188
|
+
readonly definition: UiDefinitionInput;
|
|
189
|
+
readonly handlers: Readonly<Record<string, UiPluginHandlerMetadata>>;
|
|
190
|
+
readonly resources: UiPluginResourceMetadata;
|
|
191
|
+
}
|
|
192
|
+
export type UiPluginNormalizedV2 = UiPluginNormalizedManifestV2;
|
|
193
|
+
export interface UiPluginStep {
|
|
194
|
+
readonly label: string;
|
|
195
|
+
readonly detail: string;
|
|
196
|
+
}
|
|
197
|
+
export type UiPluginPayloadValue = string | string[] | UiPluginStep[];
|
|
198
|
+
export type UiPluginPayload = Record<string, UiPluginPayloadValue>;
|
|
199
|
+
export interface UiPluginValidationOptions {
|
|
200
|
+
readonly supportedPrimitiveSet?: number;
|
|
201
|
+
readonly mode?: UiPluginManifestMode;
|
|
202
|
+
}
|
|
203
|
+
export type UiPluginValidationErrorCode = 'MANIFEST_INVALID' | 'PRIMITIVE_UNKNOWN' | 'PRIMITIVE_SET_UNSUPPORTED' | 'SCHEMA_TYPE_UNSUPPORTED' | 'TOKEN_INVALID' | 'UNSAFE_VALUE' | 'LIMIT_EXCEEDED' | 'INITIAL_STATE_INVALID';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UiPluginManifest, UiPluginManifestV1, UiPluginManifestV2, UiPluginNormalizedManifestV2, UiPluginPayload, UiPluginValidationErrorCode, UiPluginValidationOptions } from './types.js';
|
|
2
|
+
import type { JsonObject } from '../ui-instance/types.js';
|
|
3
|
+
export declare class UiPluginValidationError extends Error {
|
|
4
|
+
readonly code: UiPluginValidationErrorCode;
|
|
5
|
+
readonly path?: string | undefined;
|
|
6
|
+
readonly rule?: string | undefined;
|
|
7
|
+
readonly name = "UiPluginValidationError";
|
|
8
|
+
constructor(code: UiPluginValidationErrorCode, message?: string, path?: string | undefined, rule?: string | undefined);
|
|
9
|
+
withPathPrefix(prefix: string): UiPluginValidationError;
|
|
10
|
+
}
|
|
11
|
+
export declare function validateInitialState(value: unknown, dataPaths?: readonly string[]): JsonObject;
|
|
12
|
+
export declare function validateManifest(input: UiPluginManifestV1, options?: UiPluginValidationOptions): UiPluginManifestV1;
|
|
13
|
+
export declare function validateManifest(input: UiPluginManifestV2, options?: UiPluginValidationOptions): UiPluginManifestV2;
|
|
14
|
+
export declare function validateManifest(input: unknown, options?: UiPluginValidationOptions): UiPluginManifest;
|
|
15
|
+
export declare function normalizeManifest(input: UiPluginManifestV1, options?: UiPluginValidationOptions): UiPluginManifestV1;
|
|
16
|
+
export declare function normalizeManifest(input: UiPluginManifestV2, options?: UiPluginValidationOptions): UiPluginNormalizedManifestV2;
|
|
17
|
+
export declare function normalizeManifest(input: unknown, options?: UiPluginValidationOptions): UiPluginManifestV1 | UiPluginNormalizedManifestV2;
|
|
18
|
+
export declare function validatePayload(manifest: UiPluginManifestV1, rawPayload: unknown): UiPluginPayload;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export type CrewxExecutableStage = 'env' | 'self' | 'workspace' | 'module' | 'path';
|
|
2
|
+
export interface CrewxExecutableAttempt {
|
|
3
|
+
stage: CrewxExecutableStage;
|
|
4
|
+
reason: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CrewxExecutableSuccess {
|
|
7
|
+
ok: true;
|
|
8
|
+
argv: string[];
|
|
9
|
+
stage: CrewxExecutableStage;
|
|
10
|
+
requiredEnv?: CrewxRequiredEnv;
|
|
11
|
+
}
|
|
12
|
+
export type CrewxRequiredEnv = Readonly<Partial<Record<'ELECTRON_RUN_AS_NODE', '1'>>>;
|
|
13
|
+
export interface CrewxElectronRuntimeContext {
|
|
14
|
+
platform: NodeJS.Platform;
|
|
15
|
+
stage: CrewxExecutableStage;
|
|
16
|
+
isSelf: boolean;
|
|
17
|
+
execPath: string;
|
|
18
|
+
isFile: (candidate: string) => boolean;
|
|
19
|
+
}
|
|
20
|
+
export type CrewxElectronRuntimePredicate = (executable: string, context: CrewxElectronRuntimeContext) => boolean;
|
|
21
|
+
export interface CrewxExecutableFailure {
|
|
22
|
+
ok: false;
|
|
23
|
+
reason: string;
|
|
24
|
+
attempts: CrewxExecutableAttempt[];
|
|
25
|
+
}
|
|
26
|
+
export type CrewxExecutableResolution = CrewxExecutableSuccess | CrewxExecutableFailure;
|
|
27
|
+
export interface CrewxExecutablePathLookupOptions {
|
|
28
|
+
env: NodeJS.ProcessEnv;
|
|
29
|
+
cwd: string;
|
|
30
|
+
platform: NodeJS.Platform;
|
|
31
|
+
}
|
|
32
|
+
export type CrewxExecutablePathLookupResult = string | readonly string[] | undefined;
|
|
33
|
+
export interface CrewxExecutableResolverOptions {
|
|
34
|
+
env?: NodeJS.ProcessEnv;
|
|
35
|
+
cwd?: string;
|
|
36
|
+
argv?: readonly string[];
|
|
37
|
+
execPath?: string;
|
|
38
|
+
platform?: NodeJS.Platform;
|
|
39
|
+
modulePaths?: readonly string[];
|
|
40
|
+
requireResolve?: (request: string) => string;
|
|
41
|
+
findOnPath?: (command: string, options: CrewxExecutablePathLookupOptions) => CrewxExecutablePathLookupResult;
|
|
42
|
+
isFile?: (candidate: string) => boolean;
|
|
43
|
+
isElectronRuntime?: CrewxElectronRuntimePredicate;
|
|
44
|
+
}
|
|
45
|
+
export interface CrewxCliShim {
|
|
46
|
+
directory: string;
|
|
47
|
+
executable: string;
|
|
48
|
+
fingerprint: string;
|
|
49
|
+
}
|
|
50
|
+
export interface CrewxCliShimOptions {
|
|
51
|
+
home?: string;
|
|
52
|
+
platform?: NodeJS.Platform;
|
|
53
|
+
}
|
|
54
|
+
export interface CrewxStableEntrypointOptions extends CrewxCliShimOptions {
|
|
55
|
+
cwd?: string;
|
|
56
|
+
allowEnvStage?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface CrewxChildInvocation {
|
|
59
|
+
command: string;
|
|
60
|
+
args: string[];
|
|
61
|
+
env: Record<string, string>;
|
|
62
|
+
}
|
|
63
|
+
export interface CrewxChildInvocationOptions extends CrewxCliShimOptions {
|
|
64
|
+
baseEnv?: NodeJS.ProcessEnv;
|
|
65
|
+
}
|
|
66
|
+
export declare function isVolatilePath(candidate: string): boolean;
|
|
67
|
+
export declare function isRotatingInstallPath(candidate: string): boolean;
|
|
68
|
+
export declare function resolveCrewxExecutable(options?: CrewxExecutableResolverOptions): CrewxExecutableResolution;
|
|
69
|
+
export declare const resolveCrewxCliArgv: typeof resolveCrewxExecutable;
|
|
70
|
+
export declare function crewxCliShimFingerprint(resolution: CrewxExecutableSuccess): string;
|
|
71
|
+
export declare function materializeCrewxCliShim(resolution: CrewxExecutableSuccess, options?: CrewxCliShimOptions): CrewxCliShim;
|
|
72
|
+
export declare function createCrewxChildInvocation(resolution: CrewxExecutableSuccess, options?: CrewxChildInvocationOptions): CrewxChildInvocation;
|
|
73
|
+
export declare function getCrewxStableEntrypoint(options?: CrewxCliShimOptions): string;
|
|
74
|
+
export declare function materializeCrewxStableEntrypoint(resolution: CrewxExecutableResolution, options?: CrewxStableEntrypointOptions): string | undefined;
|
|
75
|
+
export declare function formatCrewxExecutableArgv(argv: readonly string[], platform?: NodeJS.Platform): string;
|
|
76
|
+
export declare function formatCrewxExecutableFailure(failure: CrewxExecutableFailure): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCrewxHome(): string;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { type CrewxExecutableResolution } from './crewx-executable';
|
|
2
|
+
export declare function resolveCrewxCliDisplay(env?: Readonly<Record<string, string | undefined>>): string;
|
|
1
3
|
export declare function resolveCrewxCli(): string;
|
|
4
|
+
export declare function resolveCrewxCliArgv(): CrewxExecutableResolution;
|
|
2
5
|
export declare function resolveCrewxWorkspace(): string;
|
package/dist/utils/id.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type EntityPrefix = 'tsk' | 'thd' | 'msg' | 'box' | 'prj' | 'mem' | 'spn' | 'cron' | 'wbs' | 'job' | 'tcl' | 'req' | 'ws' | 'wfr';
|
|
1
|
+
export type EntityPrefix = 'tsk' | 'thd' | 'msg' | 'box' | 'prj' | 'mem' | 'spn' | 'cron' | 'wbs' | 'job' | 'tcl' | 'req' | 'ws' | 'wfr' | 'ntf' | 'sug' | 'brd' | 'pjc' | 'pje' | 'the' | 'thl' | 'thr';
|
|
2
2
|
export type PrefixedId<P extends EntityPrefix> = `${P}_${string}`;
|
|
3
3
|
export declare function generateId<P extends EntityPrefix>(prefix: P): PrefixedId<P>;
|
|
4
4
|
export declare function generateFingerprint<P extends EntityPrefix>(prefix: P, input: string): PrefixedId<P>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const CREWX_RUNNER_IDENTITY_ENV: readonly ["CREWX_ASSIGNED_TASK_ID", "CREWX_DETACHED_RUNNER"];
|
|
2
|
+
export declare function withoutCrewxRunnerIdentity(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
3
|
+
export declare function withoutCrewxRootContext(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function normalizeWorkspacePath(workspacePath: string): string;
|
|
2
2
|
export declare function hashWorkspaceId(workspacePath: string): string;
|
|
3
|
+
export declare function resolveWorkspaceOwnerPath(workspacePath: string): string;
|
|
3
4
|
export declare function slugify(input: string): string;
|
|
4
5
|
export declare function isValidSlug(slug: string): boolean;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type WiStatus = 'draft' | 'approved' | 'in-progress' | 'done' | 'cancelled';
|
|
2
|
+
export interface WiCreateInput {
|
|
3
|
+
title: string;
|
|
4
|
+
assignee?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
board?: string;
|
|
7
|
+
source?: string;
|
|
8
|
+
depends_on?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface WiBatchCreateInput {
|
|
11
|
+
board: string;
|
|
12
|
+
source?: string;
|
|
13
|
+
items: Array<{
|
|
14
|
+
key?: string;
|
|
15
|
+
title: string;
|
|
16
|
+
assignee?: string;
|
|
17
|
+
depends_on?: string[];
|
|
18
|
+
body: string;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export interface WiCreatedSummary {
|
|
22
|
+
wi_id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
status: WiStatus;
|
|
25
|
+
priority?: string;
|
|
26
|
+
assignee?: string;
|
|
27
|
+
depends_on: string[];
|
|
28
|
+
blocks: string[];
|
|
29
|
+
date?: string;
|
|
30
|
+
board?: string;
|
|
31
|
+
source: string;
|
|
32
|
+
screens: string[];
|
|
33
|
+
path: string;
|
|
34
|
+
mtime: number;
|
|
35
|
+
}
|
|
36
|
+
export interface WiCreatedDetail {
|
|
37
|
+
summary: WiCreatedSummary;
|
|
38
|
+
frontmatter: Record<string, unknown>;
|
|
39
|
+
body: string;
|
|
40
|
+
}
|
|
41
|
+
export interface WiBatchCreateResult {
|
|
42
|
+
created: WiCreatedDetail[];
|
|
43
|
+
}
|
|
44
|
+
export declare class WiCreateError extends Error {
|
|
45
|
+
constructor(message: string);
|
|
46
|
+
}
|
|
47
|
+
export declare function createWorkInstruction(workspacePath: string, input: WiCreateInput): Promise<WiCreatedDetail>;
|
|
48
|
+
export declare function createWorkInstructionBatch(workspacePath: string, input: WiBatchCreateInput): Promise<WiBatchCreateResult>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type WiSelectableStatus = 'draft' | 'approved' | 'in-progress' | 'done' | 'cancelled';
|
|
2
|
+
export interface WiSummary {
|
|
3
|
+
wi_id: string;
|
|
4
|
+
status: WiSelectableStatus;
|
|
5
|
+
depends_on?: string[];
|
|
6
|
+
}
|
|
7
|
+
export type SelectNextWiResult = {
|
|
8
|
+
pick: string;
|
|
9
|
+
} | {
|
|
10
|
+
blocked: true;
|
|
11
|
+
reason: string;
|
|
12
|
+
} | {
|
|
13
|
+
cycle: string[];
|
|
14
|
+
} | {
|
|
15
|
+
done: true;
|
|
16
|
+
};
|
|
17
|
+
export declare function selectNextWi(wis: WiSummary[], opts: {
|
|
18
|
+
batch: string[];
|
|
19
|
+
exclude?: string[];
|
|
20
|
+
}): SelectNextWiResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewx/sdk",
|
|
3
|
-
"version": "0.9.0-rc.
|
|
3
|
+
"version": "0.9.0-rc.150",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
@@ -20,6 +20,19 @@
|
|
|
20
20
|
"types": "./dist/index.browser.d.ts",
|
|
21
21
|
"import": "./dist/index.browser.js"
|
|
22
22
|
},
|
|
23
|
+
"./node": {
|
|
24
|
+
"types": "./dist/node/index.d.ts",
|
|
25
|
+
"node": {
|
|
26
|
+
"import": "./dist/node/index.js",
|
|
27
|
+
"require": "./dist/node/index.js"
|
|
28
|
+
},
|
|
29
|
+
"browser": null
|
|
30
|
+
},
|
|
31
|
+
"./skills": {
|
|
32
|
+
"types": "./dist/skills/index.d.ts",
|
|
33
|
+
"import": "./dist/skills/index.js",
|
|
34
|
+
"require": "./dist/skills/index.js"
|
|
35
|
+
},
|
|
23
36
|
"./client": {
|
|
24
37
|
"types": "./dist/client/index.d.ts",
|
|
25
38
|
"import": "./dist/client/index.js",
|
|
@@ -50,6 +63,31 @@
|
|
|
50
63
|
"import": "./dist/repository/index.js",
|
|
51
64
|
"require": "./dist/repository/index.js"
|
|
52
65
|
},
|
|
66
|
+
"./desktop": {
|
|
67
|
+
"types": "./dist/desktop/index.d.ts",
|
|
68
|
+
"import": "./dist/desktop/index.js",
|
|
69
|
+
"require": "./dist/desktop/index.js"
|
|
70
|
+
},
|
|
71
|
+
"./process": {
|
|
72
|
+
"types": "./dist/process/index.d.ts",
|
|
73
|
+
"import": "./dist/process/index.js",
|
|
74
|
+
"require": "./dist/process/index.js"
|
|
75
|
+
},
|
|
76
|
+
"./publish": {
|
|
77
|
+
"types": "./dist/publish/index.d.ts",
|
|
78
|
+
"import": "./dist/publish/index.js",
|
|
79
|
+
"require": "./dist/publish/index.js"
|
|
80
|
+
},
|
|
81
|
+
"./account": {
|
|
82
|
+
"types": "./dist/account/index.d.ts",
|
|
83
|
+
"import": "./dist/account/index.js",
|
|
84
|
+
"require": "./dist/account/index.js"
|
|
85
|
+
},
|
|
86
|
+
"./app": {
|
|
87
|
+
"types": "./dist/app/index.d.ts",
|
|
88
|
+
"import": "./dist/app/index.js",
|
|
89
|
+
"require": "./dist/app/index.js"
|
|
90
|
+
},
|
|
53
91
|
"./package.json": "./package.json"
|
|
54
92
|
},
|
|
55
93
|
"browser": {
|
|
@@ -60,7 +98,19 @@
|
|
|
60
98
|
"./dist/layout/loader.js": false,
|
|
61
99
|
"./dist/esm/layout/loader.js": false,
|
|
62
100
|
"./dist/repository/index.js": false,
|
|
63
|
-
"./dist/esm/repository/index.js": false
|
|
101
|
+
"./dist/esm/repository/index.js": false,
|
|
102
|
+
"./dist/desktop/index.js": false,
|
|
103
|
+
"./dist/esm/desktop/index.js": false,
|
|
104
|
+
"./dist/process/index.js": false,
|
|
105
|
+
"./dist/esm/process/index.js": false,
|
|
106
|
+
"./dist/publish/index.js": false,
|
|
107
|
+
"./dist/esm/publish/index.js": false,
|
|
108
|
+
"./dist/account/index.js": false,
|
|
109
|
+
"./dist/esm/account/index.js": false,
|
|
110
|
+
"./dist/app/index.js": false,
|
|
111
|
+
"./dist/esm/app/index.js": false,
|
|
112
|
+
"./dist/skills/index.js": false,
|
|
113
|
+
"./dist/esm/skills/index.js": false
|
|
64
114
|
},
|
|
65
115
|
"files": [
|
|
66
116
|
"dist",
|
|
@@ -73,8 +123,11 @@
|
|
|
73
123
|
"@modelcontextprotocol/sdk": "1.27.0",
|
|
74
124
|
"ai": "4.0.0",
|
|
75
125
|
"drizzle-orm": "0.45.2",
|
|
126
|
+
"dotenv": "17.2.3",
|
|
76
127
|
"handlebars": "4.7.9",
|
|
128
|
+
"js-tiktoken": "1.0.21",
|
|
77
129
|
"js-yaml": "4.1.0",
|
|
130
|
+
"tar": "7.5.15",
|
|
78
131
|
"zod": "3.25.76"
|
|
79
132
|
},
|
|
80
133
|
"peerDependencies": {
|
|
@@ -117,7 +170,7 @@
|
|
|
117
170
|
"vitest": "3.2.4"
|
|
118
171
|
},
|
|
119
172
|
"scripts": {
|
|
120
|
-
"prebuild": "node scripts/generate-pricing.mjs && node scripts/generate-models.mjs",
|
|
173
|
+
"prebuild": "node ../../scripts/check-sdk-app-imports.mjs && node scripts/generate-pricing.mjs && node scripts/generate-models.mjs",
|
|
121
174
|
"build:cjs": "tsup --config tsup.cjs.js",
|
|
122
175
|
"build:esm": "tsup --config tsup.esm.js",
|
|
123
176
|
"build:browser": "tsup --config tsup.browser.js",
|
|
@@ -126,6 +179,7 @@
|
|
|
126
179
|
"db:generate": "cd ../.. && drizzle-kit generate --config drizzle.config.ts && node packages/sdk/scripts/post-generate.mjs",
|
|
127
180
|
"db:check": "cd ../.. && drizzle-kit check --config drizzle.config.ts",
|
|
128
181
|
"test": "vitest run --config ./vitest.config.ts",
|
|
182
|
+
"test:bundle-provenance-dist": "node scripts/check-bundle-provenance-dist.mjs",
|
|
129
183
|
"test:watch": "vitest --config ./vitest.config.ts",
|
|
130
184
|
"lint": "echo 'SDK lint pending' && exit 0"
|
|
131
185
|
}
|