@lahat-group/cli 1.1.4 → 1.1.6
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/dist/index.js +85 -10
- package/package.json +1 -1
- package/skill/SKILL.md +10 -4
package/dist/index.js
CHANGED
|
@@ -3128,10 +3128,12 @@ var HELP_KEYS = {
|
|
|
3128
3128
|
},
|
|
3129
3129
|
orderStatus: {
|
|
3130
3130
|
created: "orderStatus.created",
|
|
3131
|
-
|
|
3131
|
+
pending_payment: "orderStatus.pending_payment",
|
|
3132
3132
|
paid: "orderStatus.paid",
|
|
3133
|
+
pending_measurement: "orderStatus.pending_measurement",
|
|
3133
3134
|
sent_to_manufacturing: "orderStatus.sent_to_manufacturing",
|
|
3134
3135
|
in_manufacturing: "orderStatus.in_manufacturing",
|
|
3136
|
+
pending_assembly: "orderStatus.pending_assembly",
|
|
3135
3137
|
provided: "orderStatus.provided"
|
|
3136
3138
|
}
|
|
3137
3139
|
};
|
|
@@ -3156,10 +3158,12 @@ var ALL_HELP_KEYS = [
|
|
|
3156
3158
|
HELP_KEYS.inspector.layout,
|
|
3157
3159
|
HELP_KEYS.inspector.column,
|
|
3158
3160
|
HELP_KEYS.orderStatus.created,
|
|
3159
|
-
HELP_KEYS.orderStatus.
|
|
3161
|
+
HELP_KEYS.orderStatus.pending_payment,
|
|
3160
3162
|
HELP_KEYS.orderStatus.paid,
|
|
3163
|
+
HELP_KEYS.orderStatus.pending_measurement,
|
|
3161
3164
|
HELP_KEYS.orderStatus.sent_to_manufacturing,
|
|
3162
3165
|
HELP_KEYS.orderStatus.in_manufacturing,
|
|
3166
|
+
HELP_KEYS.orderStatus.pending_assembly,
|
|
3163
3167
|
HELP_KEYS.orderStatus.provided
|
|
3164
3168
|
];
|
|
3165
3169
|
|
|
@@ -9424,6 +9428,29 @@ init_esm_shims();
|
|
|
9424
9428
|
// ../../packages/shared/src/permissions.ts
|
|
9425
9429
|
init_esm_shims();
|
|
9426
9430
|
|
|
9431
|
+
// ../../packages/shared/src/agentScopes.ts
|
|
9432
|
+
init_esm_shims();
|
|
9433
|
+
var AGENT_SCOPES = {
|
|
9434
|
+
"profile:read": { he: "\u05DC\u05E8\u05D0\u05D5\u05EA \u05D0\u05EA \u05D4\u05E9\u05DD \u05D5\u05D4\u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05E9\u05DC\u05DA", en: "See your name and email" },
|
|
9435
|
+
"projects:read": { he: "\u05DC\u05E8\u05D0\u05D5\u05EA \u05D0\u05EA \u05D4\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA", en: "See your projects" },
|
|
9436
|
+
"projects:write": { he: "\u05DC\u05D9\u05E6\u05D5\u05E8 \u05D5\u05DC\u05E2\u05E8\u05D5\u05DA \u05E4\u05E8\u05D5\u05D9\u05E7\u05D8\u05D9\u05DD", en: "Create and edit projects" },
|
|
9437
|
+
"customers:read": { he: "\u05DC\u05E8\u05D0\u05D5\u05EA \u05D0\u05EA \u05D4\u05DC\u05E7\u05D5\u05D7\u05D5\u05EA \u05E9\u05DC\u05DA", en: "See your customers" },
|
|
9438
|
+
"customers:write": { he: "\u05DC\u05D9\u05E6\u05D5\u05E8 \u05D5\u05DC\u05E2\u05E8\u05D5\u05DA \u05DC\u05E7\u05D5\u05D7\u05D5\u05EA", en: "Create and edit customers" },
|
|
9439
|
+
"designs:read": { he: "\u05DC\u05E8\u05D0\u05D5\u05EA \u05D0\u05EA \u05EA\u05DB\u05E0\u05D5\u05E0\u05D9 \u05D4\u05D0\u05E8\u05D5\u05E0\u05D5\u05EA \u05E9\u05DC\u05DA", en: "See your wardrobe designs" },
|
|
9440
|
+
"designs:write": { he: "\u05DC\u05D9\u05E6\u05D5\u05E8 \u05D5\u05DC\u05E2\u05E8\u05D5\u05DA \u05EA\u05DB\u05E0\u05D5\u05E0\u05D9 \u05D0\u05E8\u05D5\u05E0\u05D5\u05EA", en: "Create and edit wardrobe designs" },
|
|
9441
|
+
"price:read": { he: "\u05DC\u05EA\u05DE\u05D7\u05E8 \u05EA\u05E6\u05D5\u05E8\u05EA \u05D0\u05E8\u05D5\u05DF", en: "Price a configuration" },
|
|
9442
|
+
"chat:read": { he: "\u05DC\u05E7\u05E8\u05D5\u05D0 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D1\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA", en: "Read project messages" },
|
|
9443
|
+
"chat:write": { he: "\u05DC\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D1\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA", en: "Post project messages" },
|
|
9444
|
+
"files:write": { he: "\u05DC\u05D4\u05E2\u05DC\u05D5\u05EA \u05EA\u05DE\u05D5\u05E0\u05D5\u05EA \u05E9\u05DC \u05EA\u05DB\u05E0\u05D5\u05E0\u05D9\u05DD", en: "Upload design images" },
|
|
9445
|
+
"quotations:write": { he: "\u05DC\u05D4\u05E4\u05D9\u05E7 \u05D4\u05E6\u05E2\u05EA \u05DE\u05D7\u05D9\u05E8", en: "Generate a quotation PDF" },
|
|
9446
|
+
"orders:read": { he: "\u05DC\u05E8\u05D0\u05D5\u05EA \u05D0\u05EA \u05D4\u05D4\u05D6\u05DE\u05E0\u05D5\u05EA \u05E9\u05DC\u05DA", en: "See your orders" },
|
|
9447
|
+
"orders:write": { he: "\u05DC\u05D4\u05DB\u05D9\u05DF \u05D8\u05D9\u05D5\u05D8\u05EA \u05D4\u05D6\u05DE\u05E0\u05D4 \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8\u05DA", en: "Draft an order for you to confirm" },
|
|
9448
|
+
"orders:commit": { he: "\u05DC\u05D0\u05E9\u05E8 \u05D4\u05D6\u05DE\u05E0\u05D4 \u05D1\u05E9\u05DE\u05DA", en: "Confirm an order on your behalf" },
|
|
9449
|
+
"invitations:write": { he: "\u05DC\u05D4\u05D6\u05DE\u05D9\u05DF \u05D0\u05E0\u05E9\u05D9\u05DD \u05DC\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA", en: "Invite people to your projects" },
|
|
9450
|
+
"staff:read": { he: "\u05DC\u05E7\u05E8\u05D5\u05D0 \u05D0\u05EA \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05E9\u05DC \u05DB\u05DC \u05D4\u05DE\u05E9\u05EA\u05DE\u05E9\u05D9\u05DD \u05D1\u05DE\u05E2\u05E8\u05DB\u05EA", en: "Read every user's data in the system" }
|
|
9451
|
+
};
|
|
9452
|
+
var ALL_AGENT_SCOPES = Object.keys(AGENT_SCOPES);
|
|
9453
|
+
|
|
9427
9454
|
// ../../packages/shared/src/legal.ts
|
|
9428
9455
|
init_esm_shims();
|
|
9429
9456
|
|
|
@@ -9431,10 +9458,12 @@ init_esm_shims();
|
|
|
9431
9458
|
init_esm_shims();
|
|
9432
9459
|
var ORDER_STATUSES = [
|
|
9433
9460
|
"created",
|
|
9434
|
-
"
|
|
9461
|
+
"pending_payment",
|
|
9435
9462
|
"paid",
|
|
9463
|
+
"pending_measurement",
|
|
9436
9464
|
"sent_to_manufacturing",
|
|
9437
9465
|
"in_manufacturing",
|
|
9466
|
+
"pending_assembly",
|
|
9438
9467
|
"provided",
|
|
9439
9468
|
"cancelled"
|
|
9440
9469
|
];
|
|
@@ -9443,25 +9472,66 @@ var LOGISTICS_STATUSES = ["pending_coordination", "coordinated", "done"];
|
|
|
9443
9472
|
var OFFICE = ["admin", "support"];
|
|
9444
9473
|
var TRANSITIONS = [
|
|
9445
9474
|
// Main pipeline
|
|
9446
|
-
{ track: "main", from: "created", to: "
|
|
9447
|
-
{ track: "main", from: "
|
|
9475
|
+
{ track: "main", from: "created", to: "pending_payment", roles: ["admin", "support", "designer", "client"], viaVerification: true },
|
|
9476
|
+
{ track: "main", from: "pending_payment", to: "paid", roles: OFFICE },
|
|
9477
|
+
// Exactly one of the next two is unblocked, decided by whether the customer
|
|
9478
|
+
// bought the measurement service. `pending_measurement` is never entered — and
|
|
9479
|
+
// so never appears in statusHistory — when they didn't.
|
|
9480
|
+
{
|
|
9481
|
+
track: "main",
|
|
9482
|
+
from: "paid",
|
|
9483
|
+
to: "pending_measurement",
|
|
9484
|
+
roles: OFFICE,
|
|
9485
|
+
guard: (o) => o.services.measurement ? null : "measurementNotPurchased"
|
|
9486
|
+
},
|
|
9448
9487
|
{
|
|
9449
9488
|
track: "main",
|
|
9450
9489
|
from: "paid",
|
|
9451
9490
|
to: "sent_to_manufacturing",
|
|
9452
9491
|
roles: OFFICE,
|
|
9453
|
-
guard: (o) =>
|
|
9492
|
+
guard: (o) => o.services.measurement ? "measurementRequired" : null
|
|
9493
|
+
},
|
|
9494
|
+
{
|
|
9495
|
+
track: "main",
|
|
9496
|
+
from: "pending_measurement",
|
|
9497
|
+
to: "sent_to_manufacturing",
|
|
9498
|
+
roles: OFFICE,
|
|
9499
|
+
guard: (o) => o.measurement?.status === "measured" ? null : "measurementNotDone"
|
|
9454
9500
|
},
|
|
9455
9501
|
{ track: "main", from: "sent_to_manufacturing", to: "in_manufacturing", roles: OFFICE, requires: "estimatedDeliveryDate" },
|
|
9502
|
+
// Same either/or shape as measurement, for transport & installation.
|
|
9456
9503
|
{
|
|
9457
9504
|
track: "main",
|
|
9458
9505
|
from: "in_manufacturing",
|
|
9506
|
+
to: "pending_assembly",
|
|
9507
|
+
roles: OFFICE,
|
|
9508
|
+
guard: (o) => o.services.logistics ? null : "logisticsNotPurchased"
|
|
9509
|
+
},
|
|
9510
|
+
{
|
|
9511
|
+
track: "main",
|
|
9512
|
+
from: "in_manufacturing",
|
|
9513
|
+
to: "provided",
|
|
9514
|
+
roles: OFFICE,
|
|
9515
|
+
guard: (o) => o.services.logistics ? "logisticsRequired" : null
|
|
9516
|
+
},
|
|
9517
|
+
{
|
|
9518
|
+
track: "main",
|
|
9519
|
+
from: "pending_assembly",
|
|
9459
9520
|
to: "provided",
|
|
9460
9521
|
roles: OFFICE,
|
|
9461
|
-
guard: (o) =>
|
|
9522
|
+
guard: (o) => o.logistics?.status === "done" ? null : "logisticsNotDone"
|
|
9462
9523
|
},
|
|
9463
9524
|
// Cancel — reachable from any non-terminal main status, office only
|
|
9464
|
-
...[
|
|
9525
|
+
...[
|
|
9526
|
+
"created",
|
|
9527
|
+
"pending_payment",
|
|
9528
|
+
"paid",
|
|
9529
|
+
"pending_measurement",
|
|
9530
|
+
"sent_to_manufacturing",
|
|
9531
|
+
"in_manufacturing",
|
|
9532
|
+
"pending_assembly",
|
|
9533
|
+
"provided"
|
|
9534
|
+
].map(
|
|
9465
9535
|
(from) => ({ track: "main", from, to: "cancelled", roles: OFFICE })
|
|
9466
9536
|
),
|
|
9467
9537
|
// Measurement sub-track
|
|
@@ -9472,14 +9542,19 @@ var TRANSITIONS = [
|
|
|
9472
9542
|
{ track: "logistics", from: "coordinated", to: "done", roles: OFFICE }
|
|
9473
9543
|
];
|
|
9474
9544
|
|
|
9545
|
+
// ../../packages/shared/src/quotations.ts
|
|
9546
|
+
init_esm_shims();
|
|
9547
|
+
|
|
9475
9548
|
// ../../packages/shared/src/orderEmailEvents.ts
|
|
9476
9549
|
init_esm_shims();
|
|
9477
9550
|
var MAIN_LABELS = {
|
|
9478
9551
|
created: "\u05D4\u05D6\u05DE\u05E0\u05D4 \u05E0\u05D5\u05E6\u05E8\u05D4",
|
|
9479
|
-
|
|
9552
|
+
pending_payment: "\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05EA\u05E9\u05DC\u05D5\u05DD",
|
|
9480
9553
|
paid: "\u05E9\u05D5\u05DC\u05DD",
|
|
9554
|
+
pending_measurement: "\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05DE\u05D3\u05D9\u05D3\u05D4",
|
|
9481
9555
|
sent_to_manufacturing: "\u05E0\u05E9\u05DC\u05D7 \u05DC\u05D9\u05D9\u05E6\u05D5\u05E8",
|
|
9482
9556
|
in_manufacturing: "\u05D1\u05D9\u05D9\u05E6\u05D5\u05E8",
|
|
9557
|
+
pending_assembly: "\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D4\u05E8\u05DB\u05D1\u05D4",
|
|
9483
9558
|
provided: "\u05E1\u05D5\u05E4\u05E7",
|
|
9484
9559
|
cancelled: "\u05D1\u05D5\u05D8\u05DC"
|
|
9485
9560
|
};
|
|
@@ -11891,7 +11966,7 @@ async function formatCliError(err, json) {
|
|
|
11891
11966
|
|
|
11892
11967
|
// src/version.ts
|
|
11893
11968
|
init_esm_shims();
|
|
11894
|
-
var CLI_VERSION = "1.1.
|
|
11969
|
+
var CLI_VERSION = "1.1.6";
|
|
11895
11970
|
|
|
11896
11971
|
// src/index.ts
|
|
11897
11972
|
program.name("wardrobe").description("Wardrobe configurator CLI").version(CLI_VERSION);
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -63,15 +63,21 @@ Prefer generating the skeleton with `wardrobe init` rather than hand-writing it
|
|
|
63
63
|
`init` fills materials, `ruleVersion`, and a valid column layout for you. Column
|
|
64
64
|
`id`s are `nanoid()` and are not stable across rebuilds.
|
|
65
65
|
|
|
66
|
-
## Guardrails —
|
|
66
|
+
## Guardrails — committing to an order requires a human
|
|
67
67
|
|
|
68
|
-
- **The CLI cannot place orders.**
|
|
69
|
-
|
|
70
|
-
admin scope
|
|
68
|
+
- **The CLI cannot place orders.** The `wardrobe-cli` client is registered with
|
|
69
|
+
`profile:read`, `projects:read`, `designs:read`, `designs:write`, `price:read` —
|
|
70
|
+
**no order or admin scope** — so every order route answers `403 insufficient_scope`.
|
|
71
|
+
Don't attempt to order, or to run admin/catalog operations.
|
|
71
72
|
- To turn a saved design into an order, direct the **human** to the web app: they
|
|
72
73
|
open the project, review the design, and complete the **verify-details** flow —
|
|
73
74
|
which computes the final price, freezes the PDF, and advances the order. Only a
|
|
74
75
|
human does this. Your job ends at `apply` (a saved design) plus a clear summary.
|
|
76
|
+
- This is now a **scope** boundary rather than a property of the API surface: other
|
|
77
|
+
registered clients may hold `orders:write` and *draft* an order (status `created` —
|
|
78
|
+
no frozen PDF, no confirmation email). But `orders:commit`, which gates
|
|
79
|
+
`verify-details`, is held by no client at all, so the commitment step stays human
|
|
80
|
+
for every agent. See `docs/bot-api.md`.
|
|
75
81
|
|
|
76
82
|
## Error handling
|
|
77
83
|
|