@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.
Files changed (308) hide show
  1. package/README.md +1 -1
  2. package/dist/account/auth-client.d.ts +61 -0
  3. package/dist/account/auth-json-v2.d.ts +1 -0
  4. package/dist/account/auth-json.d.ts +30 -0
  5. package/dist/account/config.d.ts +37 -0
  6. package/dist/account/env-bootstrap.d.ts +11 -0
  7. package/dist/account/errors.d.ts +24 -0
  8. package/dist/account/index.d.ts +12 -0
  9. package/dist/account/index.js +2 -0
  10. package/dist/account/session-manager.d.ts +47 -0
  11. package/dist/activity-log/builder.d.ts +59 -6
  12. package/dist/agent/agent-list-view.d.ts +19 -0
  13. package/dist/app/app.d.ts +157 -0
  14. package/dist/app/backend-env.d.ts +3 -0
  15. package/dist/app/content-media-types.d.ts +2 -0
  16. package/dist/app/context.d.ts +2 -0
  17. package/dist/app/entry.d.ts +7 -0
  18. package/dist/app/frame.d.ts +55 -0
  19. package/dist/app/index.d.ts +12 -0
  20. package/dist/app/index.js +10 -0
  21. package/dist/app/protocol.d.ts +9 -0
  22. package/dist/app/runtime.d.ts +21 -0
  23. package/dist/app/schedule-contract.d.ts +59 -0
  24. package/dist/app/tool-mode.d.ts +3 -0
  25. package/dist/boxing/box.types.d.ts +4 -0
  26. package/dist/config/canonicalize-agent-options.d.ts +18 -0
  27. package/dist/config/default-agent-models.d.ts +11 -0
  28. package/dist/config/global-settings.d.ts +33 -0
  29. package/dist/config/migrate-grok-mode.d.ts +6 -0
  30. package/dist/config/model-compat.d.ts +31 -0
  31. package/dist/config/models.generated.d.ts +37 -0
  32. package/dist/config/models.remote.d.ts +1 -0
  33. package/dist/config/overdrive.d.ts +7 -0
  34. package/dist/config/pricing.d.ts +6 -3
  35. package/dist/config/pricing.generated.d.ts +4 -0
  36. package/dist/config/pricing.types.d.ts +4 -0
  37. package/dist/config/timeout.config.d.ts +4 -0
  38. package/dist/config/wi-boards.d.ts +19 -0
  39. package/dist/context-budget/continuity.d.ts +63 -0
  40. package/dist/context-budget/index.d.ts +142 -0
  41. package/dist/conversation/index.d.ts +1 -1
  42. package/dist/conversation/sqlite-provider.d.ts +6 -3
  43. package/dist/conversation/to-template-messages.d.ts +9 -0
  44. package/dist/conversation/types.d.ts +58 -1
  45. package/dist/desktop/command-runner.d.ts +4 -0
  46. package/dist/desktop/default-adapters.d.ts +4 -0
  47. package/dist/desktop/global-install.d.ts +19 -0
  48. package/dist/desktop/index.d.ts +3 -0
  49. package/dist/desktop/index.js +3 -0
  50. package/dist/desktop/install.d.ts +5 -0
  51. package/dist/desktop/lnk.d.ts +22 -0
  52. package/dist/desktop/manifest.d.ts +21 -0
  53. package/dist/desktop/types.d.ts +67 -0
  54. package/dist/desktop/version.d.ts +1 -0
  55. package/dist/desktop/windows-paths.d.ts +21 -0
  56. package/dist/desktop/wrapper.d.ts +18 -0
  57. package/dist/esm/account/index.js +2 -0
  58. package/dist/esm/app/index.js +10 -0
  59. package/dist/esm/desktop/index.js +3 -0
  60. package/dist/esm/index.js +1128 -226
  61. package/dist/esm/node/index.js +2 -0
  62. package/dist/esm/plugins/index.js +496 -214
  63. package/dist/esm/process/index.js +1 -0
  64. package/dist/esm/publish/index.js +2 -0
  65. package/dist/esm/repository/index.js +608 -211
  66. package/dist/esm/skills/index.js +2 -0
  67. package/dist/esm/testing/index.js +1 -1
  68. package/dist/events/types.d.ts +16 -0
  69. package/dist/facade/Crewx.d.ts +61 -5
  70. package/dist/facade/task-ticket.d.ts +14 -0
  71. package/dist/highlight/thread-highlight-prompt.d.ts +2 -0
  72. package/dist/highlight/thread-highlighter.d.ts +326 -0
  73. package/dist/index.browser.d.ts +21 -1
  74. package/dist/index.browser.js +6 -2
  75. package/dist/index.d.ts +137 -17
  76. package/dist/index.js +1128 -226
  77. package/dist/internal/console-decoder.d.ts +38 -0
  78. package/dist/internal/windows-spawn.d.ts +10 -0
  79. package/dist/layout/types.d.ts +18 -1
  80. package/dist/lifecycle/process-lease.d.ts +80 -0
  81. package/dist/lifecycle/process-owner.d.ts +20 -0
  82. package/dist/lifecycle/task-heartbeat.d.ts +41 -0
  83. package/dist/lifecycle/task-stop.d.ts +82 -0
  84. package/dist/lifecycle/update-admission.d.ts +45 -0
  85. package/dist/local-server/base-url.d.ts +18 -0
  86. package/dist/local-server/index.d.ts +8 -0
  87. package/dist/local-server/opencode.d.ts +8 -0
  88. package/dist/local-server/probe.d.ts +3 -0
  89. package/dist/local-server/runtime.d.ts +26 -0
  90. package/dist/local-server/types.d.ts +43 -0
  91. package/dist/mcp-app/agent-access.d.ts +26 -0
  92. package/dist/mcp-app/app-handoff.d.ts +109 -0
  93. package/dist/mcp-app/app-icon-read.d.ts +7 -0
  94. package/dist/mcp-app/app-schedule.d.ts +85 -0
  95. package/dist/mcp-app/apps-context.d.ts +32 -0
  96. package/dist/mcp-app/bundle-provenance.d.ts +3 -0
  97. package/dist/mcp-app/candidate-registration.d.ts +4 -0
  98. package/dist/mcp-app/card-handler.d.ts +7 -0
  99. package/dist/mcp-app/catalog.d.ts +7 -0
  100. package/dist/mcp-app/content-channel.d.ts +86 -0
  101. package/dist/mcp-app/content-declarations.d.ts +31 -0
  102. package/dist/mcp-app/dev-checks.d.ts +31 -0
  103. package/dist/mcp-app/diagnostic-reason.d.ts +3 -0
  104. package/dist/mcp-app/discovery.d.ts +164 -0
  105. package/dist/mcp-app/errors.d.ts +7 -0
  106. package/dist/mcp-app/index.d.ts +41 -0
  107. package/dist/mcp-app/installed-app-ref.d.ts +25 -0
  108. package/dist/mcp-app/model-context.d.ts +29 -0
  109. package/dist/mcp-app/node-app-discovery-fs.d.ts +23 -0
  110. package/dist/mcp-app/product-bundle-assets.d.ts +27 -0
  111. package/dist/mcp-app/product-bundle-loader.d.ts +53 -0
  112. package/dist/mcp-app/projection.d.ts +14 -0
  113. package/dist/mcp-app/prompt-cards.d.ts +28 -0
  114. package/dist/mcp-app/registry.d.ts +28 -0
  115. package/dist/mcp-app/skill-backend.d.ts +135 -0
  116. package/dist/mcp-app/state-set.d.ts +9 -0
  117. package/dist/mcp-app/types.d.ts +488 -0
  118. package/dist/mcp-app/workspace-app-assets.d.ts +42 -0
  119. package/dist/mcp-app/workspace-app-scan-cache.d.ts +27 -0
  120. package/dist/mcp-app/workspace-snapshot.d.ts +75 -0
  121. package/dist/migrations/0011_far_black_tarantula.sql +1 -0
  122. package/dist/migrations/0012_blue_turbo.sql +23 -0
  123. package/dist/migrations/0013_hesitant_adam_destine.sql +15 -0
  124. package/dist/migrations/0014_organic_mongu.sql +73 -0
  125. package/dist/migrations/0015_panoramic_gorilla_man.sql +71 -0
  126. package/dist/migrations/0016_fuzzy_hemingway.sql +14 -0
  127. package/dist/migrations/0017_project_stage_sdk_migration.sql +29 -0
  128. package/dist/migrations/0018_bored_jackal.sql +33 -0
  129. package/dist/migrations/0019_backfill_task_thread_ids.sql +74 -0
  130. package/dist/migrations/0020_useful_iron_lad.sql +55 -0
  131. package/dist/migrations/0021_dashing_peter_quill.sql +51 -0
  132. package/dist/migrations/0022_wandering_bucky.sql +1 -0
  133. package/dist/migrations/0023_red_payback.sql +1 -0
  134. package/dist/migrations/0024_storage_metadata.sql +262 -0
  135. package/dist/migrations/0025_task_heartbeat.sql +8 -0
  136. package/dist/migrations/0025_thread_app_instance_ledger.sql +2 -0
  137. package/dist/migrations/0026_mcp_action_source.sql +47 -0
  138. package/dist/migrations/0027_task_stop_scope_cleanup.sql +5 -0
  139. package/dist/migrations/0027_ui_instance_active_unique.sql +2 -0
  140. package/dist/migrations/0029_nice_rhino.sql +1 -0
  141. package/dist/migrations/0031_petite_arclight.sql +6 -0
  142. package/dist/migrations/0032_ui_instance_opened_by.sql +1 -0
  143. package/dist/migrations/0033_thread_creator_boundary_guard.sql +38 -0
  144. package/dist/migrations/0034_keen_fallen_one.sql +36 -0
  145. package/dist/migrations/0035_request_log_daily.sql +11 -0
  146. package/dist/migrations/0036_ui_definition_archive.sql +8 -0
  147. package/dist/migrations/0037_ui_instance_agent_open_request.sql +1 -0
  148. package/dist/migrations/0038_task_rating.sql +3 -0
  149. package/dist/migrations/0039_aspiring_purifiers.sql +9 -0
  150. package/dist/migrations/0040_task_provider_inputs.sql +53 -0
  151. package/dist/migrations/meta/0011_snapshot.json +1342 -0
  152. package/dist/migrations/meta/0012_snapshot.json +1494 -0
  153. package/dist/migrations/meta/0013_snapshot.json +1592 -0
  154. package/dist/migrations/meta/0014_snapshot.json +1975 -0
  155. package/dist/migrations/meta/0015_snapshot.json +2315 -0
  156. package/dist/migrations/meta/0016_snapshot.json +2419 -0
  157. package/dist/migrations/meta/0017_snapshot.json +2419 -0
  158. package/dist/migrations/meta/0018_snapshot.json +2570 -0
  159. package/dist/migrations/meta/0020_snapshot.json +2895 -0
  160. package/dist/migrations/meta/0021_snapshot.json +3031 -0
  161. package/dist/migrations/meta/0022_snapshot.json +3039 -0
  162. package/dist/migrations/meta/0023_snapshot.json +3047 -0
  163. package/dist/migrations/meta/0029_snapshot.json +3206 -0
  164. package/dist/migrations/meta/0031_snapshot.json +3251 -0
  165. package/dist/migrations/meta/0034_snapshot.json +3473 -0
  166. package/dist/migrations/meta/0035_snapshot.json +3547 -0
  167. package/dist/migrations/meta/0036_snapshot.json +3591 -0
  168. package/dist/migrations/meta/0037_snapshot.json +3598 -0
  169. package/dist/migrations/meta/0038_snapshot.json +3626 -0
  170. package/dist/migrations/meta/0039_snapshot.json +3684 -0
  171. package/dist/migrations/meta/0040_snapshot.json +3759 -0
  172. package/dist/migrations/meta/_journal.json +210 -0
  173. package/dist/node/index.d.ts +1 -0
  174. package/dist/node/index.js +2 -0
  175. package/dist/paths.d.ts +1 -0
  176. package/dist/plugin/types.d.ts +1 -0
  177. package/dist/plugins/index.d.ts +1 -1
  178. package/dist/plugins/index.js +496 -214
  179. package/dist/plugins/sqlite-tracing.d.ts +46 -0
  180. package/dist/process/index.d.ts +2 -0
  181. package/dist/process/index.js +1 -0
  182. package/dist/process/process-control.d.ts +41 -0
  183. package/dist/prompt/tag-names.d.ts +22 -0
  184. package/dist/provider/acp/connection.d.ts +6 -0
  185. package/dist/provider/acp/meta.d.ts +11 -0
  186. package/dist/provider/bridge.d.ts +7 -1
  187. package/dist/provider/classify-task-error.d.ts +2 -0
  188. package/dist/provider/cli/adapter.types.d.ts +14 -2
  189. package/dist/provider/cli/adapters/agent-call.util.d.ts +1 -1
  190. package/dist/provider/cli/adapters/cli-knob.util.d.ts +7 -0
  191. package/dist/provider/cli/adapters/codex-item.d.ts +1 -0
  192. package/dist/provider/cli/adapters/event-timestamp.util.d.ts +1 -0
  193. package/dist/provider/cli/adapters/grok.d.ts +2 -0
  194. package/dist/provider/cli/adapters/index.d.ts +5 -0
  195. package/dist/provider/cli/index.d.ts +3 -2
  196. package/dist/provider/cli/meta.d.ts +5 -0
  197. package/dist/provider/cli/protocol-envelope.d.ts +3 -0
  198. package/dist/provider/errors.d.ts +5 -1
  199. package/dist/provider/idle-watchdog.d.ts +19 -0
  200. package/dist/provider/models.d.ts +17 -12
  201. package/dist/provider/order.d.ts +1 -1
  202. package/dist/provider/parse-usage.d.ts +6 -0
  203. package/dist/provider/provider-selection.d.ts +8 -0
  204. package/dist/provider/redact-technical-message.d.ts +1 -0
  205. package/dist/provider/task-error.types.d.ts +17 -0
  206. package/dist/publish/constants.d.ts +6 -0
  207. package/dist/publish/errors.d.ts +7 -0
  208. package/dist/publish/index.d.ts +55 -0
  209. package/dist/publish/index.js +2 -0
  210. package/dist/publish/manifest.d.ts +47 -0
  211. package/dist/publish/marketplace-api.constants.d.ts +1 -0
  212. package/dist/publish/pack.d.ts +6 -0
  213. package/dist/publish/scan.d.ts +10 -0
  214. package/dist/publish/secrets.d.ts +6 -0
  215. package/dist/publish/upload.d.ts +19 -0
  216. package/dist/remote/execution-profile.d.ts +9 -0
  217. package/dist/remote/index.d.ts +1 -0
  218. package/dist/remote/types.d.ts +28 -0
  219. package/dist/repository/agent-send-history.repository.d.ts +23 -0
  220. package/dist/repository/agent-suggestion.repository.d.ts +34 -0
  221. package/dist/repository/base-sqlite-repository.d.ts +1 -0
  222. package/dist/repository/common-code.repository.d.ts +45 -0
  223. package/dist/repository/db.d.ts +12 -1
  224. package/dist/repository/index.d.ts +49 -6
  225. package/dist/repository/index.js +608 -211
  226. package/dist/repository/logs-db.d.ts +12 -0
  227. package/dist/repository/notification.repository.d.ts +58 -0
  228. package/dist/repository/project.repository.d.ts +90 -0
  229. package/dist/repository/request-log-mover.d.ts +70 -0
  230. package/dist/repository/request-log.repository.d.ts +7 -3
  231. package/dist/repository/storage-metadata.repository.d.ts +64 -0
  232. package/dist/repository/task-log-migration.d.ts +74 -0
  233. package/dist/repository/task-log.repository.d.ts +44 -0
  234. package/dist/repository/task-status.d.ts +21 -0
  235. package/dist/repository/task.repository.d.ts +300 -7
  236. package/dist/repository/thread-history.repository.d.ts +193 -0
  237. package/dist/repository/thread-origin-verdict.d.ts +27 -0
  238. package/dist/repository/thread-title.types.d.ts +29 -0
  239. package/dist/repository/thread.repository.d.ts +118 -7
  240. package/dist/repository/usage-backfill.d.ts +62 -0
  241. package/dist/repository/usage-from-logs.d.ts +21 -0
  242. package/dist/repository/workspace.repository.d.ts +3 -0
  243. package/dist/schema/agent-send-history.d.ts +85 -0
  244. package/dist/schema/agent-suggestions.d.ts +199 -0
  245. package/dist/schema/common-codes.d.ts +216 -0
  246. package/dist/schema/index.d.ts +15 -0
  247. package/dist/schema/notifications.d.ts +303 -0
  248. package/dist/schema/projects.d.ts +610 -0
  249. package/dist/schema/request-log-daily.d.ts +151 -0
  250. package/dist/schema/storage-metadata.d.ts +181 -0
  251. package/dist/schema/task-log-events.d.ts +119 -0
  252. package/dist/schema/task-provider-inputs.d.ts +100 -0
  253. package/dist/schema/tasks.d.ts +1058 -1
  254. package/dist/schema/thread-creator-unverified.d.ts +45 -0
  255. package/dist/schema/thread-history.d.ts +734 -0
  256. package/dist/schema/threads.d.ts +59 -0
  257. package/dist/schema/ui-action-receipts.d.ts +358 -0
  258. package/dist/schema/ui-definition-archive.d.ts +63 -0
  259. package/dist/schema/ui-instance-repins.d.ts +222 -0
  260. package/dist/schema/ui-instances.d.ts +324 -0
  261. package/dist/schema/workspaces.d.ts +17 -0
  262. package/dist/skills/index.d.ts +15 -0
  263. package/dist/skills/index.js +2 -0
  264. package/dist/skills/types.d.ts +18 -0
  265. package/dist/task-log/anchor-child-tasks.d.ts +7 -0
  266. package/dist/task-log/delegation-trailer.d.ts +34 -0
  267. package/dist/template/engine.d.ts +2 -2
  268. package/dist/template/helpers/exec.browser.d.ts +4 -3
  269. package/dist/template/helpers/exec.d.ts +4 -3
  270. package/dist/template/helpers/format-conversation.d.ts +1 -0
  271. package/dist/template/types.d.ts +20 -0
  272. package/dist/testing/index.js +1 -1
  273. package/dist/types/index.d.ts +1578 -3
  274. package/dist/types/task-log.types.d.ts +3 -0
  275. package/dist/ui-card/index.d.ts +2 -0
  276. package/dist/ui-card/legacy-card-parser.d.ts +11 -0
  277. package/dist/ui-instance/definition.d.ts +6 -0
  278. package/dist/ui-instance/errors.d.ts +18 -0
  279. package/dist/ui-instance/index.d.ts +11 -0
  280. package/dist/ui-instance/json.d.ts +19 -0
  281. package/dist/ui-instance/lineage.d.ts +24 -0
  282. package/dist/ui-instance/runtime.d.ts +19 -0
  283. package/dist/ui-instance/store.d.ts +213 -0
  284. package/dist/ui-instance/types.d.ts +337 -0
  285. package/dist/ui-plugin/app-icon.d.ts +50 -0
  286. package/dist/ui-plugin/app-manifest.d.ts +64 -0
  287. package/dist/ui-plugin/csp.d.ts +28 -0
  288. package/dist/ui-plugin/index.d.ts +8 -0
  289. package/dist/ui-plugin/limits.d.ts +27 -0
  290. package/dist/ui-plugin/manifest.d.ts +3 -0
  291. package/dist/ui-plugin/types.d.ts +204 -0
  292. package/dist/ui-plugin/validator.d.ts +18 -0
  293. package/dist/utils/crewx-executable.d.ts +76 -0
  294. package/dist/utils/crewx-home.d.ts +1 -0
  295. package/dist/utils/env-defaults.d.ts +3 -0
  296. package/dist/utils/id.d.ts +1 -1
  297. package/dist/utils/local-identity.d.ts +2 -0
  298. package/dist/utils/runner-env.d.ts +3 -0
  299. package/dist/utils/timestamp.d.ts +1 -0
  300. package/dist/utils/workspace.d.ts +1 -0
  301. package/dist/wi/create.d.ts +48 -0
  302. package/dist/wi/select.d.ts +20 -0
  303. package/package.json +57 -3
  304. package/templates/agents/default.yaml +303 -128
  305. package/templates/documents/crewx-manual.md +138 -138
  306. package/templates/documents/crewx-quick-guide.md +8 -7
  307. package/templates/workflows/wi-default-flow.yaml +65 -0
  308. package/templates/workflows/wi-plan-flow.yaml +140 -0
@@ -0,0 +1,204 @@
1
+ import type { JsonObject, JsonValue, UiActionConfirmation, UiDefinitionActionSchedule, 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 schedule?: UiDefinitionActionSchedule;
127
+ readonly _meta?: JsonObject;
128
+ }
129
+ export interface UiPluginResourceRef {
130
+ readonly path: 'ui/index.html' | 'ui/state.json';
131
+ readonly hash?: string;
132
+ }
133
+ export interface UiPluginSize {
134
+ readonly height: number;
135
+ }
136
+ export interface UiPluginRuntimeRequest {
137
+ readonly wasm?: true;
138
+ readonly terminal?: true;
139
+ readonly htmlDocuments?: true;
140
+ }
141
+ export interface UiPluginCspRequest {
142
+ readonly connectDomains: readonly string[];
143
+ }
144
+ export interface UiPluginManifestV2 {
145
+ readonly manifestVersion: 2;
146
+ readonly pluginId: string;
147
+ readonly definitionId: string;
148
+ readonly version: number;
149
+ readonly name: string;
150
+ readonly description: string;
151
+ readonly icon?: string;
152
+ readonly tone?: UiPluginTone;
153
+ readonly entry: 'ui/index.html';
154
+ readonly entryHash?: string;
155
+ readonly runtime?: UiPluginRuntimeRequest;
156
+ readonly csp?: UiPluginCspRequest;
157
+ readonly initialState?: {
158
+ readonly path: 'ui/state.json';
159
+ readonly hash?: string;
160
+ };
161
+ readonly usage?: UiDefinitionInput['usage'];
162
+ readonly detailPanel?: UiDefinitionInput['detailPanel'];
163
+ readonly displayModes?: UiDefinitionInput['displayModes'];
164
+ readonly surfaces: readonly UiPluginSurface[];
165
+ readonly size: UiPluginSize;
166
+ readonly stateProjection: UiPluginProjectionPolicy;
167
+ readonly summaryProjection?: UiPluginProjectionPolicy;
168
+ readonly dataPaths?: readonly string[];
169
+ readonly actions: readonly UiPluginAction[];
170
+ readonly _meta?: JsonObject;
171
+ }
172
+ export type UiPluginManifest = UiPluginManifestV1 | UiPluginManifestV2;
173
+ export interface UiPluginHandlerMetadata {
174
+ readonly actionId: string;
175
+ readonly mutation: boolean;
176
+ readonly backend: UiPluginBackend;
177
+ readonly launchPolicy: 'allowed' | 'denied';
178
+ readonly denialCode?: 'EXEC_DENIED';
179
+ }
180
+ export interface UiPluginResourceMetadata {
181
+ readonly entry: UiPluginResourceRef;
182
+ readonly initialState?: {
183
+ readonly path: 'ui/state.json';
184
+ readonly hash?: string;
185
+ };
186
+ }
187
+ export interface UiPluginNormalizedManifestV2 {
188
+ readonly manifest: UiPluginManifestV2;
189
+ readonly definition: UiDefinitionInput;
190
+ readonly handlers: Readonly<Record<string, UiPluginHandlerMetadata>>;
191
+ readonly resources: UiPluginResourceMetadata;
192
+ }
193
+ export type UiPluginNormalizedV2 = UiPluginNormalizedManifestV2;
194
+ export interface UiPluginStep {
195
+ readonly label: string;
196
+ readonly detail: string;
197
+ }
198
+ export type UiPluginPayloadValue = string | string[] | UiPluginStep[];
199
+ export type UiPluginPayload = Record<string, UiPluginPayloadValue>;
200
+ export interface UiPluginValidationOptions {
201
+ readonly supportedPrimitiveSet?: number;
202
+ readonly mode?: UiPluginManifestMode;
203
+ }
204
+ 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;
@@ -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,2 @@
1
+ export declare function normalizeLocalActorId(username: string, hostname: string): string | null;
2
+ export declare function getLocalActorId(): string | null;
@@ -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 +1,2 @@
1
1
  export declare function formatTimestamp(date: Date): string;
2
+ export declare function formatDisplayTimestamp(date: Date): string;
@@ -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.16",
3
+ "version": "0.9.0-rc.161",
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
  }