@crewx/sdk 0.9.0-rc.103 → 0.9.0-rc.105

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.
Files changed (36) hide show
  1. package/dist/activity-log/builder.d.ts +1 -0
  2. package/dist/esm/index.js +191 -181
  3. package/dist/esm/plugins/index.js +81 -78
  4. package/dist/esm/repository/index.js +69 -66
  5. package/dist/events/types.d.ts +1 -0
  6. package/dist/index.d.ts +8 -6
  7. package/dist/index.js +189 -179
  8. package/dist/lifecycle/task-stop.d.ts +4 -1
  9. package/dist/mcp-app/discovery.d.ts +105 -0
  10. package/dist/mcp-app/index.d.ts +9 -3
  11. package/dist/mcp-app/node-app-discovery-fs.d.ts +20 -0
  12. package/dist/mcp-app/registry.d.ts +9 -1
  13. package/dist/mcp-app/state-set.d.ts +9 -0
  14. package/dist/mcp-app/types.d.ts +134 -1
  15. package/dist/mcp-app/workspace-snapshot.d.ts +53 -0
  16. package/dist/migrations/0027_task_stop_scope_cleanup.sql +5 -0
  17. package/dist/migrations/0027_ui_instance_active_unique.sql +2 -0
  18. package/dist/migrations/0029_nice_rhino.sql +1 -0
  19. package/dist/migrations/meta/0029_snapshot.json +3206 -0
  20. package/dist/migrations/meta/_journal.json +21 -0
  21. package/dist/plugins/index.js +82 -79
  22. package/dist/plugins/sqlite-tracing.d.ts +2 -0
  23. package/dist/repository/index.d.ts +1 -1
  24. package/dist/repository/index.js +69 -66
  25. package/dist/repository/task.repository.d.ts +12 -1
  26. package/dist/schema/tasks.d.ts +19 -0
  27. package/dist/types/index.d.ts +1 -0
  28. package/dist/ui-instance/runtime.d.ts +7 -2
  29. package/dist/ui-instance/store.d.ts +1 -0
  30. package/dist/ui-instance/types.d.ts +1 -0
  31. package/dist/ui-plugin/index.d.ts +3 -2
  32. package/dist/ui-plugin/limits.d.ts +27 -0
  33. package/dist/ui-plugin/types.d.ts +97 -2
  34. package/dist/ui-plugin/validator.d.ts +9 -3
  35. package/dist/utils/workspace.d.ts +1 -0
  36. package/package.json +1 -1
@@ -18,6 +18,7 @@ export interface TaskStartEvent extends BaseEvent {
18
18
  workspaceId?: string;
19
19
  projectId?: string;
20
20
  workspaceName?: string;
21
+ cwd?: string;
21
22
  parentTaskId?: string | null;
22
23
  rootTraceId?: string;
23
24
  callerAgentId?: string | null;
package/dist/index.d.ts CHANGED
@@ -1,13 +1,15 @@
1
1
  export { Crewx, loadAgentSkills } from './facade/Crewx';
2
2
  export type { ToolDefinition } from './facade/Crewx';
3
3
  export type { ActionReceipt, ActionReceiptOutcome, CreateUiInstanceInput, JsonObject, JsonPrimitive, JsonValue, UiActionHandlerContext, UiActionHandlerRegistration, UiActionHandlerResult, UiActionEnvelope, UiActionConfirmation, UiActor, UiDefinition, UiDefinitionAction, UiDefinitionInput, UiDefinitionRef, UiProjectionPolicy, UiExecutionContext, UiAuthenticatedActor, UiAuthenticatedExecutionContext, UiAuthenticatedGrantPolicy, UiServerRuntimeFacade, UiServerRuntimeOptions, UiAgentContextProjection, UiExternalActionHandlerRegistration, UiInstance, UiInstanceStatus, UiLocalGrantPolicy, UiRuntimeFacade, UiRuntimeOptions, UiStateActionHandlerRegistration, } from './ui-instance/types.js';
4
+ export type { UiRuntimeStoreOptions } from './ui-instance/runtime.js';
4
5
  export { UiInstanceStore, openUiInstanceReadStore, UiRuntimeError, hashUiDefinition, projectSafeJsonObject, createUiServerRuntime, resolveUiEffectiveCapabilities, } from './ui-instance/index.js';
5
6
  export type { UiAuditSnapshotInput, UiInstanceReadStore } from './ui-instance/index.js';
6
7
  export type { UiRuntimeErrorCode } from './ui-instance/index.js';
7
- export { MCP_APP_HOST_TOOL_ALLOWLIST, MCP_APP_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_URI_PREFIX, McpAppContractError, buildMcpAppStateDescriptor, buildMcpAppStateProjections, buildTerminalMcpAppStateDescriptor, buildTerminalMcpAppStateProjections, createBuiltinMcpAppRegistry, buildInstalledAppRef, createMcpAppRegistry, createMcpAppToolResult, INSTALLED_APP_ENTRY, InstalledAppRefError, registerMcpApp, requireMcpAppResource, resolveMcpAppResource, serializeMcpAppStateJson, serializeMcpAppStateXml, toMcpAppToolRegistration, validateInstalledAppRef, } from './mcp-app/index.js';
8
- export type { McpAppActionDispatcherToolInput, McpAppActionToolDescriptor, McpAppActionToolInput, McpAppButtonDescriptor, McpAppButtonInput, McpAppContractErrorCode, McpAppDescriptor, McpAppDescriptorInput, McpAppInputSchema, McpAppTone, McpUiResourceCsp, McpAppRegistry, McpAppResource, McpAppServerStateInput, McpAppStateDescriptor, McpAppStateProjections, McpAppHostToolInput, McpAppHostToolName, McpAppReadToolInput, McpAppSingleActionToolInput, McpAppToolCommonInput, McpAppToolDescriptor, McpAppToolInput, McpAppToolMetadata, McpAppToolRegistration, McpAppToolResult, McpAppToolVisibility, BuildInstalledAppRefInput, InstalledAppPackageFile, InstalledAppRef, InstalledAppRefErrorCode, } from './mcp-app/index.js';
9
- export { canonicalManifestJson, manifestHash, normalizeManifest, UiPluginValidationError, validateManifest, validatePayload, } from './ui-plugin/index.js';
10
- export type { UiPluginActivation, UiPluginCardShellNode, UiPluginFieldSchema, UiPluginHeadingNode, UiPluginLabeledTextNode, UiPluginLayoutNode, UiPluginLayout, UiPluginManifest, UiPluginMetaBannerNode, UiPluginPayload, UiPluginPayloadValue, UiPluginPrimitive, UiPluginSchemaType, UiPluginSchema, UiPluginStep, UiPluginStepFlowNode, UiPluginStepListSchema, UiPluginTextListNode, UiPluginTextListSchema, UiPluginTextSchema, UiPluginValidationErrorCode, UiPluginValidationOptions, } from './ui-plugin/index.js';
8
+ export { MAX_HTML_LENGTH, MCP_APP_HOST_TOOL_ALLOWLIST, MCP_APP_LOCAL_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_MIME_TYPE, MCP_APP_RESOURCE_URI_PREFIX, McpAppContractError, buildMcpAppStateDescriptor, buildMcpAppStateProjections, buildTerminalMcpAppStateDescriptor, buildTerminalMcpAppStateProjections, createBuiltinMcpAppRegistry, buildMcpAppLocalRegistration, createMcpAppLocalRegistration, registerLocalMcpApp, createMcpAppWorkspaceRegistry, createWorkspaceAppRegistry, createWorkspaceMcpAppRegistry, buildInstalledAppRef, createMcpAppRegistry, createMcpAppToolResult, INSTALLED_APP_ENTRY, InstalledAppRefError, registerMcpApp, requireMcpAppResource, resolveLocalMcpAppResource, resolveMcpAppResource, serializeMcpAppStateJson, serializeMcpAppStateXml, toMcpAppToolRegistration, validateInstalledAppRef, AppDiscoveryFsError, NodeAppDiscoveryFs, NodeAppDiscoveryFsAdapter, defaultAppDiscoveryFs, defaultNodeAppDiscoveryFs, deriveWorkspaceAppToolName, deriveWorkspaceAppToolNames, discoverWorkspaceAppCandidates, discoverWorkspaceApps, buildWorkspaceAppSnapshot, discoverWorkspaceAppSnapshot, reconfirmWorkspaceAppSnapshot, LOCAL_APP_TOOL_PREFIX, MCP_APP_WORKSPACE_TOOL_PREFIX, scanWorkspaceApps, WORKSPACE_APP_TOOL_PREFIX, } from './mcp-app/index.js';
9
+ export type { AppDiscoveryBytes, AppDiscoveryDiagnostic, AppDiscoveryDirectoryEntry, AppDiscoveryDirectoryEntryKind, AppDiscoveryDirectoryListing, AppDiscoveryFileSystem, AppDiscoveryFsErrorCode, AppDiscoveryMaybePromise, AppDiscoveryOptions, McpAppDiscoveryDiagnostic, WorkspaceAppBuiltinCatalog, WorkspaceAppCandidate, WorkspaceAppDiscoveryOptions, WorkspaceAppDiscoveryResult, WorkspaceAppDiagnostic, WorkspaceAppDiagnosticCode, WorkspaceAppResourceSnapshot, WorkspaceAppReservedCatalog, WorkspaceAppSource, WorkspaceAppToolNames, McpAppActionDispatcherToolInput, McpAppActionToolDescriptor, McpAppActionToolInput, McpAppButtonDescriptor, McpAppButtonInput, McpAppContractErrorCode, McpAppDescriptor, McpAppDescriptorInput, McpAppInputSchema, McpAppTone, McpUiResourceCsp, McpAppRegistry, McpAppResource, McpAppServerStateInput, McpAppStateDescriptor, McpAppStateProjections, McpAppHostToolInput, McpAppHostToolName, McpAppReadToolInput, McpAppSingleActionToolInput, McpAppToolCommonInput, McpAppToolDescriptor, McpAppToolInput, McpAppToolMetadata, McpAppToolRegistration, McpAppToolResult, McpAppToolVisibility, McpAppInstanceResourceBinding, McpAppMcpResourceBinding, McpAppResourceBinding, McpAppLocalResource, McpAppLocalRegistrationInput, McpAppLocalReadToolDescriptor, McpAppLocalActionToolDescriptor, McpAppLocalToolDescriptor, McpAppLocalRegistration, McpAppBuiltinRegistration, McpAppResolvedRegistration, McpAppLocalLauncher, McpAppBuiltinLauncher, McpAppLauncher, WorkspaceAppLauncher, WorkspaceAppResolvedRegistration, McpAppWorkspaceRegistry, WorkspaceAppRegistry, McpAppWorkspaceRegistryInput, WorkspaceAppSnapshot, WorkspaceAppSnapshotBuildOptions, WorkspaceAppSnapshotOptions, WorkspaceAppSnapshotReconfirmResult, WorkspaceAppSnapshotResource, WorkspaceAppSnapshotInitialState, WorkspaceAppInitialState, BuildInstalledAppRefInput, InstalledAppPackageFile, InstalledAppRef, InstalledAppRefErrorCode, } from './mcp-app/index.js';
10
+ export { canonicalManifestJson, manifestHash, normalizeManifest, UiPluginValidationError, validateInitialState, validateManifest, validatePayload, } from './ui-plugin/index.js';
11
+ export { UI_PLUGIN_CAPABILITY_PATTERN, UI_PLUGIN_HANDLER_PATTERN, UI_PLUGIN_IDENTIFIER_PATTERN, UI_PLUGIN_MAX_CANDIDATE_DEPTH, UI_PLUGIN_MAX_ACTIONS, UI_PLUGIN_MAX_ARRAY_LENGTH, 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 './ui-plugin/index.js';
12
+ export type { UiPluginActivation, UiPluginCardShellNode, UiPluginFieldSchema, UiPluginHeadingNode, UiPluginLabeledTextNode, UiPluginLayoutNode, UiPluginLayout, UiPluginManifest, UiPluginAction, UiPluginBackend, UiPluginCoreBackend, UiPluginInputSchema, UiPluginJsonSchema, UiPluginJsonSchemaType, UiPluginManifestMode, UiPluginManifestV1, UiPluginManifestV2, UiPluginNormalizedManifestV2, UiPluginNormalizedV2, UiPluginMetaBannerNode, UiPluginPayload, UiPluginPayloadValue, UiPluginPrimitive, UiPluginSchemaType, UiPluginSchema, UiPluginStep, UiPluginStepFlowNode, UiPluginStepListSchema, UiPluginTextListNode, UiPluginTextListSchema, UiPluginTextSchema, UiPluginProjectionPolicy, UiPluginResourceMetadata, UiPluginResourceRef, UiPluginSize, UiPluginSkillBackend, UiPluginSurface, UiPluginTone, UiPluginHandlerMetadata, UiPluginValidationErrorCode, UiPluginValidationOptions, } from './ui-plugin/index.js';
11
13
  export { CrewxPlugin } from './plugin';
12
14
  export { TypedEventEmitter } from './events/TypedEventEmitter';
13
15
  export type { CrewxEvents, CrewxEventName, CrewxEventPayload, BaseEvent, TaskStartEvent, TaskEndEvent, TaskOutputEvent, AdapterLifecycleEvent, AdapterMessageEvent, UnsubscribeFn, } from './events/types';
@@ -86,7 +88,7 @@ export { getCrewxHome } from './utils/crewx-home';
86
88
  export { CREWX_RUNNER_IDENTITY_ENV, withoutCrewxRootContext, withoutCrewxRunnerIdentity, } from './utils/runner-env';
87
89
  export { generateId, generateFingerprint } from './utils/id';
88
90
  export type { EntityPrefix, PrefixedId } from './utils/id';
89
- export { hashWorkspaceId, normalizeWorkspacePath } from './utils/workspace';
91
+ export { hashWorkspaceId, normalizeWorkspacePath, resolveWorkspaceOwnerPath } from './utils/workspace';
90
92
  export { formatTimestamp, formatDisplayTimestamp } from './utils/timestamp';
91
93
  export type { TaskLogEntry, TaskLogEntryType } from './types/task-log.types';
92
94
  export { anchorChildTasks } from './task-log/anchor-child-tasks';
@@ -115,7 +117,7 @@ export { PluginProviderRuntime, createPluginProviderFactory } from './plugin/plu
115
117
  export type { PluginProviderConfig } from './plugin/types';
116
118
  export { DEFAULT_TASK_REAPER_TICK_INTERVAL_MS, mergeTerminalReason, TaskRepository, TASK_HEARTBEAT_HARD_STALE_MS, TASK_HEARTBEAT_INTERVAL_MS, TASK_HEARTBEAT_STALE_MS, resolveTaskHeartbeatHardStaleMs, resolveTaskHeartbeatIntervalMs, resolveTaskHeartbeatStaleMs, } from './repository/task.repository.js';
117
119
  export type { ReapOrphanedTasksOptions } from './repository/task.repository.js';
118
- export type { FinalizeTaskStopOptions, TaskStopMethod, TaskStopRequestResult, } from './repository/task.repository.js';
120
+ export type { FinalizeTaskStopOptions, TaskStopMethod, TaskStopOrigin, TaskStopRequestContext, TaskStopRequestResult, } from './repository/task.repository.js';
119
121
  export { INSTRUCTION_STOP_EPOCH_MISMATCH, INSTRUCTION_STOP_GENERATION_ALREADY_SETTLED, INSTRUCTION_STOP_PROCESS_TERMINATION_FAILED, INSTRUCTION_STOP_REQUEST_FAILED, INSTRUCTION_STOP_SETTLE_CAS_FAILED, INSTRUCTION_STOP_TARGET_PID_MISSING, INSTRUCTION_STOP_WORKSPACE_MISMATCH, stopTask, resolveTaskStopMethod, TASK_STOP_DEFAULT_GRACE_MS, TASK_STOP_DEFAULT_POLL_MS, TASK_STOP_OWNED_PROCESS_MARKERS, } from './lifecycle/task-stop.js';
120
122
  export type { StopTaskGenerationForInstructionOptions, StopTaskOptions, StopTaskProcessControl, StopTaskResult, StopTaskStatus, } from './lifecycle/task-stop.js';
121
123
  export { LEGACY_TASK_TERMINAL_ERROR_PATTERNS, normalizeTaskStatus, TASK_TERMINAL_STATUSES, } from './repository/task-status.js';