@composable-os/cli 0.1.0-beta.10 → 0.1.0-beta.13

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 (173) hide show
  1. package/dist/{accounts-X4CKM3HL.js → accounts-GOCNY6WI.js} +17 -14
  2. package/dist/app-RPRZMLU5.js +43 -0
  3. package/dist/app-upload-YJVEKZC6.js +198 -0
  4. package/dist/{blocks-YWDHEBOK.js → blocks-DE4RRWPJ.js} +207 -25
  5. package/dist/{chunk-VY64DMQO.js → chunk-2B6YUYZV.js} +23576 -11674
  6. package/dist/{run-RT2HVWMK.js → chunk-2CCHB37H.js} +9 -146
  7. package/dist/{chunk-DU6OIFOU.js → chunk-3OGDWKJ3.js} +530 -434
  8. package/dist/chunk-5D7BDF4Y.js +141 -0
  9. package/dist/{chunk-WO6D3XP3.js → chunk-6CM3WZG5.js} +13 -2470
  10. package/dist/chunk-CIBJGB5H.js +962 -0
  11. package/dist/chunk-EPDTPGZJ.js +330 -0
  12. package/dist/{chunk-LLULPZAJ.js → chunk-HAYF4G5V.js} +66 -23
  13. package/dist/chunk-HCG6T53D.js +61904 -0
  14. package/dist/chunk-JX4IFWNT.js +330 -0
  15. package/dist/{chunk-A4NTSYWV.js → chunk-KFHKNXGH.js} +786 -386
  16. package/dist/chunk-KMFMD52Z.js +13276 -0
  17. package/dist/{chunk-E4WCYTCT.js → chunk-LX2TTLVY.js} +174 -55
  18. package/dist/{chunk-GYTEW66E.js → chunk-O3R4FS2J.js} +1 -1
  19. package/dist/{chunk-LJFLENFC.js → chunk-Q6Y45DY6.js} +25 -2
  20. package/dist/{chunk-Y7JZFSTQ.js → chunk-QJZGYJVV.js} +823 -44
  21. package/dist/{chunk-6VXHPKGG.js → chunk-QQ3YSL5F.js} +172 -16
  22. package/dist/chunk-RGKJKC5T.js +876 -0
  23. package/dist/{chunk-IFG4FRW5.js → chunk-RSEWEFAV.js} +12 -2
  24. package/dist/{chunk-2ABSVMGB.js → chunk-SMJZIK2O.js} +1 -1
  25. package/dist/{chunk-CP6BXI6F.js → chunk-U72NEGCT.js} +8818 -3829
  26. package/dist/{chunk-WC5LHBBA.js → chunk-Z4IKF23A.js} +11 -7
  27. package/dist/chunk-Z7OVQ6BC.js +713 -0
  28. package/dist/{chunk-6UWRT4VM.js → chunk-ZJSFX4RD.js} +175 -3
  29. package/dist/{cli-2DFENR62.js → cli-OKQHHSOE.js} +17 -23
  30. package/dist/{cli-YIOVSKOD.js → cli-VYSD2S4Z.js} +231 -82
  31. package/dist/cli.js +5 -5
  32. package/dist/{client-repo-PRU3VCQQ.js → client-repo-NNUCHQ2Y.js} +7 -5
  33. package/dist/create.js +5 -5
  34. package/dist/{fields-2NC7LSYE.js → fields-GTHE6TTS.js} +27 -3
  35. package/dist/gateway-DPPEQZT4.js +25 -0
  36. package/dist/grants-6JY4XZO7.js +27 -0
  37. package/dist/invoke-MRONRZ5Q.js +33 -0
  38. package/dist/moves-UAUCMWL5.js +36 -0
  39. package/dist/{order-PUWD65BC.js → order-RKLGT74L.js} +2 -2
  40. package/dist/{person-WIQQ7ITU.js → person-YOZTFV4Q.js} +11 -11
  41. package/dist/plan-on-sale-H4F26YIN.js +26 -0
  42. package/dist/platform/migrations/0610_waitlists.sql +54 -0
  43. package/dist/platform/migrations/0630_subscription_changes.sql +122 -0
  44. package/dist/platform/migrations/0650_person_links.sql +90 -0
  45. package/dist/platform/migrations/0670_unmoved_guard.sql +52 -0
  46. package/dist/platform/migrations/0690_sellable_refund_due.sql +98 -0
  47. package/dist/platform/migrations/0730_practitioners.sql +79 -0
  48. package/dist/platform/migrations/0750_routine_mail.sql +98 -0
  49. package/dist/platform/migrations/0770_clear_fixed_role_grants.sql +64 -0
  50. package/dist/platform/migrations/0810_recurrence_exceptions.sql +66 -0
  51. package/dist/platform/migrations/0811_staff_time.sql +109 -0
  52. package/dist/platform/migrations/0812_staff_offers.sql +112 -0
  53. package/dist/platform/migrations/0813_pay_periods.sql +241 -0
  54. package/dist/platform/migrations/0814_staff_feed.sql +47 -0
  55. package/dist/platform/migrations/0815_checklists.sql +237 -0
  56. package/dist/platform/migrations/0816_checklist_schedules.sql +121 -0
  57. package/dist/platform/migrations/0817_checklist_day_window.sql +35 -0
  58. package/dist/platform/migrations/0850_agreements.sql +271 -0
  59. package/dist/platform/migrations/0851_agreement_acceptances.sql +387 -0
  60. package/dist/platform/migrations/0853_agreement_enforcement.sql +58 -0
  61. package/dist/platform/migrations/0854_agreement_copy.sql +149 -0
  62. package/dist/platform/migrations/0855_agreement_retention.sql +279 -0
  63. package/dist/platform/migrations/0856_subscription_cooling_off.sql +159 -0
  64. package/dist/platform/migrations/0857_agreement_copy_guardian.sql +337 -0
  65. package/dist/platform/migrations/0858_agreement_desk.sql +175 -0
  66. package/dist/platform/migrations/0910_routine_messages.sql +99 -0
  67. package/dist/platform/migrations/0911_texts.sql +60 -0
  68. package/dist/platform/migrations/0913_contact_consent.sql +93 -0
  69. package/dist/platform/migrations/0916_contact_mailbox_index.sql +29 -0
  70. package/dist/platform/migrations/0930_stock_movements.sql +95 -0
  71. package/dist/platform/migrations/0931_stock_low.sql +25 -0
  72. package/dist/platform/migrations/0932_order_delivery.sql +78 -0
  73. package/dist/platform/migrations/0950_order_adjustments.sql +111 -0
  74. package/dist/platform/migrations/0951_order_price_guards.sql +33 -0
  75. package/dist/platform/migrations/0952_order_paid_another_way.sql +194 -0
  76. package/dist/platform/migrations/0953_discount_uses.sql +183 -0
  77. package/dist/platform/migrations/0955_folded_addresses.sql +92 -0
  78. package/dist/platform/migrations/0970_published_text.sql +59 -0
  79. package/dist/platform/migrations/0971_publish_acks.sql +68 -0
  80. package/dist/platform/migrations/0990_customer_email_change.sql +65 -0
  81. package/dist/platform/migrations/1010_intake_links.sql +148 -0
  82. package/dist/platform/migrations/1030_invoices.sql +747 -0
  83. package/dist/platform/migrations/1031_invoice_orders.sql +327 -0
  84. package/dist/platform/migrations/1050_inbox_conversations.sql +83 -0
  85. package/dist/platform/migrations/1090_staff_hours.sql +43 -0
  86. package/dist/platform/migrations/1091_staff_time_margins.sql +12 -0
  87. package/dist/platform/migrations/1092_client_guard.sql +26 -0
  88. package/dist/platform/migrations/1095_thing_time.sql +70 -0
  89. package/dist/platform/migrations/1130_devices.sql +162 -0
  90. package/dist/platform/migrations/1135_person_codes.sql +88 -0
  91. package/dist/platform/migrations/1150_finance_periods.sql +316 -0
  92. package/dist/platform/migrations/1151_payouts.sql +202 -0
  93. package/dist/platform/migrations/1153_finance_money_dates.sql +18 -0
  94. package/dist/platform/migrations/1170_journeys.sql +318 -0
  95. package/dist/platform/migrations/1171_person_birthday.sql +52 -0
  96. package/dist/platform/migrations/1175_person_signals.sql +29 -0
  97. package/dist/platform/migrations/1190_restricted_values.sql +25 -0
  98. package/dist/platform/migrations/1230_note_levels.sql +113 -0
  99. package/dist/platform/migrations/1231_person_carers.sql +33 -0
  100. package/dist/platform/migrations/1232_note_kinds.sql +122 -0
  101. package/dist/platform/migrations/1270_time_entries.sql +145 -0
  102. package/dist/platform/migrations/1271_leave.sql +249 -0
  103. package/dist/platform/migrations/1273_time_entry_reopened.sql +21 -0
  104. package/dist/platform/migrations/1330_accounting.sql +260 -0
  105. package/dist/platform/migrations/1350_customer_feed.sql +24 -0
  106. package/dist/platform/migrations/1390_locations.sql +77 -0
  107. package/dist/platform/migrations/1410_outside_copy.sql +213 -0
  108. package/dist/platform/migrations/1430_inbox_activities.sql +231 -0
  109. package/dist/platform/migrations/1450_wrong_guesses.sql +23 -0
  110. package/dist/platform/sdk/acknowledge.ts +100 -0
  111. package/dist/platform/sdk/agreements.ts +185 -0
  112. package/dist/platform/sdk/allowance.ts +98 -8
  113. package/dist/platform/sdk/automation-check.ts +120 -9
  114. package/dist/platform/sdk/automation.ts +78 -10
  115. package/dist/platform/sdk/behaviour.ts +26 -6
  116. package/dist/platform/sdk/calendar-entry.ts +258 -0
  117. package/dist/platform/sdk/capacity.ts +103 -2
  118. package/dist/platform/sdk/checklists.ts +118 -0
  119. package/dist/platform/sdk/contract.ts +514 -27
  120. package/dist/platform/sdk/discount.ts +408 -0
  121. package/dist/platform/sdk/document.ts +4 -2
  122. package/dist/platform/sdk/field-types.ts +5 -0
  123. package/dist/platform/sdk/formula/compile.ts +10 -0
  124. package/dist/platform/sdk/index.ts +17 -0
  125. package/dist/platform/sdk/intake.ts +380 -0
  126. package/dist/platform/sdk/journey-signals.ts +215 -0
  127. package/dist/platform/sdk/manifest.ts +1313 -66
  128. package/dist/platform/sdk/mine.ts +161 -0
  129. package/dist/platform/sdk/occupies.ts +192 -0
  130. package/dist/platform/sdk/questions.ts +681 -0
  131. package/dist/platform/sdk/recurring.ts +90 -9
  132. package/dist/platform/sdk/restricted-fields.ts +129 -0
  133. package/dist/platform/sdk/rich-text.ts +112 -0
  134. package/dist/platform/sdk/routine-mail.ts +1272 -0
  135. package/dist/platform/sdk/runtime.ts +25 -12
  136. package/dist/platform/sdk/screens.ts +91 -0
  137. package/dist/platform/sdk/sellable.ts +595 -1
  138. package/dist/platform/sdk/slug.ts +7 -2
  139. package/dist/platform/sdk/staffed.ts +474 -0
  140. package/dist/platform/sdk/states.ts +220 -64
  141. package/dist/platform/sdk/stock.ts +332 -0
  142. package/dist/platform/sdk/team.ts +83 -0
  143. package/dist/platform/sdk/testing.ts +70 -6
  144. package/dist/platform/sdk/worked-on.ts +134 -0
  145. package/dist/{products-2H5DR232.js → products-GCQLSZ3U.js} +2 -2
  146. package/dist/run-7ID64RA6.js +65 -0
  147. package/dist/run-FH7OGGTV.js +131 -0
  148. package/dist/run-OYZIAP6M.js +3363 -0
  149. package/dist/{run-Y7T4TVOL.js → run-QOFRRSZV.js} +41 -60
  150. package/dist/{run-PZUCSDDL.js → run-TJAEWR5U.js} +21 -51
  151. package/dist/{src-XTOD7EXW.js → src-52VERUPK.js} +312 -4
  152. package/dist/src-PHRELWN5.js +40 -0
  153. package/dist/visibility-SZCINPP4.js +58 -0
  154. package/package.json +2 -2
  155. package/dist/chunk-6GDEDOV7.js +0 -157
  156. package/dist/chunk-6UPUF4ML.js +0 -29998
  157. package/dist/chunk-7CQGMVDO.js +0 -63
  158. package/dist/chunk-GYSGVT6R.js +0 -284
  159. package/dist/chunk-JJHHNV46.js +0 -227
  160. package/dist/chunk-K6T42YCH.js +0 -704
  161. package/dist/chunk-M7A6FR2Z.js +0 -2586
  162. package/dist/chunk-O2UIZHND.js +0 -249
  163. package/dist/chunk-Q4N55M2Z.js +0 -552
  164. package/dist/chunk-QGGJ2G6Z.js +0 -349
  165. package/dist/chunk-R4W5XAUD.js +0 -837
  166. package/dist/chunk-TQFGGSA4.js +0 -748
  167. package/dist/chunk-YJJHF65I.js +0 -759
  168. package/dist/chunk-Z3RMMB6S.js +0 -668
  169. package/dist/grants-QXMKYMGB.js +0 -32
  170. package/dist/invoke-I3NNNXVL.js +0 -39
  171. package/dist/plan-on-sale-NB774CQL.js +0 -26
  172. package/dist/src-GYS6NBQB.js +0 -44
  173. package/dist/visibility-DLGHU4YN.js +0 -33
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composable-os/cli",
3
- "version": "0.1.0-beta.10",
3
+ "version": "0.1.0-beta.13",
4
4
  "license": "FSL-1.1-ALv2",
5
5
  "type": "module",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "esbuild": "0.28.2",
31
31
  "typescript": "6.0.3",
32
- "@composable-os/sdk": "0.1.0-beta.10",
32
+ "@composable-os/sdk": "0.1.0-beta.13",
33
33
  "zod": "4.6.7"
34
34
  }
35
35
  }
@@ -1,157 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- ACTORS,
4
- PERMISSIONS,
5
- RISK_CLASSES
6
- } from "./chunk-A4NTSYWV.js";
7
-
8
- // ../core/src/audiences.ts
9
- var AUDIENCES = ["staff", "customer", "public"];
10
- var DEFAULT_AUDIENCES = Object.freeze(["staff"]);
11
- var OUTSIDE_RISK_CLASSES = Object.freeze(["read", "write"]);
12
- function audiencesOf(op) {
13
- return op.audiences ?? DEFAULT_AUDIENCES;
14
- }
15
- function isOpenOutside(op) {
16
- return audiencesOf(op).some((audience) => audience !== "staff");
17
- }
18
- function audienceOf(principal) {
19
- return principal.kind;
20
- }
21
- function allowsAudience(op, principal) {
22
- return audiencesOf(op).includes(audienceOf(principal));
23
- }
24
- function audienceProblems(op) {
25
- const problems = [];
26
- const declared = op.audiences;
27
- if (declared !== void 0) {
28
- if (!Array.isArray(declared) || declared.length === 0) {
29
- problems.push("audiences must list at least one of staff, customer, public");
30
- return problems;
31
- }
32
- if (declared.some((a) => !AUDIENCES.includes(a))) {
33
- problems.push("audiences must be a subset of staff, customer, public");
34
- return problems;
35
- }
36
- if (new Set(declared).size !== declared.length) problems.push("audiences lists one twice");
37
- }
38
- if (isOpenOutside(op) && !OUTSIDE_RISK_CLASSES.includes(op.risk)) {
39
- const who = audiencesOf(op).filter((a) => a !== "staff");
40
- problems.push(
41
- `an operation open to ${who.join(" and ")} callers must have risk class read or write, not ${op.risk} (ADR 0402)`
42
- );
43
- }
44
- return problems;
45
- }
46
- function packOf(name) {
47
- const [first, id] = name.split(".");
48
- return first === "x" && id ? id : void 0;
49
- }
50
- function forPacks(file, installed) {
51
- return {
52
- ...file,
53
- operations: file.operations.filter((op) => {
54
- const pack = op.pack ?? packOf(op.name);
55
- return pack === void 0 || installed.includes(pack);
56
- }).map(({ pack: _pack, ...op }) => op)
57
- };
58
- }
59
-
60
- // ../core/src/operation.ts
61
- var AFTER_COMMIT = /* @__PURE__ */ Symbol("afterCommit");
62
- function afterCommit(read) {
63
- return { [AFTER_COMMIT]: read };
64
- }
65
- function isAfterCommit(value) {
66
- return typeof value === "object" && value !== null && AFTER_COMMIT in value;
67
- }
68
- function runAfterCommit(value) {
69
- return value[AFTER_COMMIT]();
70
- }
71
- function recordHostChange(ctx, change) {
72
- (ctx.recordHostChange ?? ctx.recordChange)(change);
73
- }
74
- function personsTool(ctx, extensionId) {
75
- const caller = ctx.extension;
76
- if (!caller || !extensionId || caller.id !== extensionId) return null;
77
- const tool = caller.tool;
78
- return tool?.humanOnly && tool.permission ? tool.name : null;
79
- }
80
- var HOST_TOOLS = /* @__PURE__ */ new WeakSet();
81
- function markHostTool(op) {
82
- HOST_TOOLS.add(op);
83
- }
84
- function isHostTool(op) {
85
- return HOST_TOOLS.has(op);
86
- }
87
- var OPERATION_NAME_RE = /^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)+$/;
88
- function defineOperation(definition) {
89
- const problems = operationProblems(definition);
90
- if (problems.length) {
91
- throw new Error(`Operation ${definition.name}: ${problems.join("; ")}`);
92
- }
93
- return Object.freeze({ ...definition });
94
- }
95
- function operationProblems(op) {
96
- const problems = [];
97
- if (!OPERATION_NAME_RE.test(op.name ?? "")) problems.push("name must be <object>.<verb>");
98
- if (typeof op.description !== "string" || op.description.trim().length < 20) {
99
- problems.push("description must explain what it does, when to use it and side effects");
100
- }
101
- if (!op.input || typeof op.input.safeParse !== "function") problems.push("input schema missing");
102
- if (!op.output || typeof op.output.safeParse !== "function") {
103
- problems.push("output schema missing");
104
- }
105
- if (!PERMISSIONS.includes(op.permission)) problems.push("permission missing or unknown");
106
- if (op.packPermission !== void 0) {
107
- const extension = /^x\.([a-z][a-z0-9]{1,29})\./.exec(op.name ?? "")?.[1];
108
- if (!extension) problems.push("packPermission is for extension tools only");
109
- else if (!op.packPermission.startsWith(`${extension}:`)) {
110
- problems.push(`packPermission is named ${extension}:<word>`);
111
- }
112
- }
113
- if (!RISK_CLASSES.includes(op.risk)) problems.push("risk class missing or unknown");
114
- if (op.actors && (op.actors.length === 0 || op.actors.some((a) => !ACTORS.includes(a)))) {
115
- problems.push("actors must list known actor types");
116
- }
117
- if (typeof op.handler !== "function") problems.push("handler missing");
118
- problems.push(...audienceProblems(op));
119
- if (op.hostInternal !== void 0) {
120
- if (op.hostInternal !== true) problems.push("hostInternal is true or left out");
121
- if (op.name?.startsWith("x.")) problems.push("an extension tool can never be hostInternal");
122
- if (!isOpenOutside(op)) {
123
- problems.push("hostInternal is only for an operation open to customer or public callers");
124
- }
125
- }
126
- if (op.toolOnly !== void 0) {
127
- if (op.toolOnly !== true) problems.push("toolOnly is true or left out");
128
- if (op.name?.startsWith("x.")) problems.push("an extension tool cannot be toolOnly");
129
- if (!audiencesOf(op).includes("customer")) {
130
- problems.push("toolOnly is only for an operation open to customer callers");
131
- }
132
- }
133
- if (isOpenOutside(op) && op.alwaysReview) {
134
- problems.push("an operation open to customer or public callers is never queued for review");
135
- }
136
- if ((op.risk === "bulk-write" || op.risk === "destructive") && op.name.endsWith("Many")) {
137
- if (typeof op.bulkSize !== "function") problems.push("batch operations need bulkSize");
138
- }
139
- return problems;
140
- }
141
-
142
- export {
143
- AUDIENCES,
144
- OUTSIDE_RISK_CLASSES,
145
- audiencesOf,
146
- allowsAudience,
147
- forPacks,
148
- afterCommit,
149
- isAfterCommit,
150
- runAfterCommit,
151
- recordHostChange,
152
- personsTool,
153
- markHostTool,
154
- isHostTool,
155
- defineOperation,
156
- operationProblems
157
- };