@solidnumber/cli 2.17.0 → 2.19.0
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 +15 -0
- package/dist/commands/accounting.d.ts +10 -1
- package/dist/commands/accounting.d.ts.map +1 -1
- package/dist/commands/accounting.js +77 -52
- package/dist/commands/accounting.js.map +1 -1
- package/dist/commands/agent.js +214 -0
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/apply.d.ts +10 -0
- package/dist/commands/apply.d.ts.map +1 -1
- package/dist/commands/apply.js +436 -51
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/books.d.ts +24 -0
- package/dist/commands/books.d.ts.map +1 -0
- package/dist/commands/books.js +242 -0
- package/dist/commands/books.js.map +1 -0
- package/dist/commands/call.js +11 -0
- package/dist/commands/call.js.map +1 -1
- package/dist/commands/company.js +84 -22
- package/dist/commands/company.js.map +1 -1
- package/dist/commands/dispatch_shortcuts.d.ts +7 -0
- package/dist/commands/dispatch_shortcuts.d.ts.map +1 -1
- package/dist/commands/dispatch_shortcuts.js +2 -0
- package/dist/commands/dispatch_shortcuts.js.map +1 -1
- package/dist/commands/how-to.js +1 -1
- package/dist/commands/how-to.js.map +1 -1
- package/dist/commands/update.d.ts +22 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +197 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +43 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +39 -0
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/apply/engine.d.ts +13 -0
- package/dist/lib/apply/engine.d.ts.map +1 -1
- package/dist/lib/apply/engine.js +122 -13
- package/dist/lib/apply/engine.js.map +1 -1
- package/dist/lib/apply/lock.d.ts +107 -0
- package/dist/lib/apply/lock.d.ts.map +1 -0
- package/dist/lib/apply/lock.js +285 -0
- package/dist/lib/apply/lock.js.map +1 -0
- package/dist/lib/apply/registry.d.ts +62 -5
- package/dist/lib/apply/registry.d.ts.map +1 -1
- package/dist/lib/apply/registry.js +151 -1
- package/dist/lib/apply/registry.js.map +1 -1
- package/dist/lib/config.d.ts +3 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +15 -0
- package/dist/lib/config.js.map +1 -1
- package/package.json +1 -1
- package/platform-docs/ai.txt +2 -2
- package/platform-docs/llms.txt +16 -12
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The books from the terminal — money in, money out, one picture.
|
|
3
|
+
*
|
|
4
|
+
* solid books summary in vs out, owed to you, you owe
|
|
5
|
+
* solid invoices list|get|aging|summary money in (reads)
|
|
6
|
+
* solid invoices pay|cancel money in (writes, --confirm)
|
|
7
|
+
* solid expenses list|get|aging|summary|vendors money out (reads)
|
|
8
|
+
* solid expenses file|pay|void money out (writes, --confirm)
|
|
9
|
+
*
|
|
10
|
+
* ⭐ Solid# is the book of record for AR and AP — every company has these,
|
|
11
|
+
* with or without QuickBooks / Xero / FreshBooks (those are optional mirrors:
|
|
12
|
+
* `solid accounting`). Every command is a thin wrapper over a verb the same
|
|
13
|
+
* company's ADA, MCP and web use, so the answer is identical everywhere:
|
|
14
|
+
* reads → manifest verbs (invoice.*, expense.*, vendor.list, books.summary)
|
|
15
|
+
* writes → ADA verbs through /api/v1/ada/cli-dispatch (invoice_record_payment,
|
|
16
|
+
* invoice_cancel, expense_create, bill_mark_paid, expense_void)
|
|
17
|
+
* Writes refuse to run without --confirm. They RECORD money — none pays anyone.
|
|
18
|
+
* Any verb without a shortcut: `solid agent dispatch <verb> --args '{…}' --confirm`.
|
|
19
|
+
*/
|
|
20
|
+
import { Command } from 'commander';
|
|
21
|
+
export declare const booksCommand: Command;
|
|
22
|
+
export declare const invoicesCommand: Command;
|
|
23
|
+
export declare const expensesCommand: Command;
|
|
24
|
+
//# sourceMappingURL=books.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"books.d.ts","sourceRoot":"","sources":["../../src/commands/books.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+BpC,eAAO,MAAM,YAAY,SACsF,CAAC;AAoBhH,eAAO,MAAM,eAAe,SAC2C,CAAC;AAuFxE,eAAO,MAAM,eAAe,SAC0B,CAAC"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.expensesCommand = exports.invoicesCommand = exports.booksCommand = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* The books from the terminal — money in, money out, one picture.
|
|
9
|
+
*
|
|
10
|
+
* solid books summary in vs out, owed to you, you owe
|
|
11
|
+
* solid invoices list|get|aging|summary money in (reads)
|
|
12
|
+
* solid invoices pay|cancel money in (writes, --confirm)
|
|
13
|
+
* solid expenses list|get|aging|summary|vendors money out (reads)
|
|
14
|
+
* solid expenses file|pay|void money out (writes, --confirm)
|
|
15
|
+
*
|
|
16
|
+
* ⭐ Solid# is the book of record for AR and AP — every company has these,
|
|
17
|
+
* with or without QuickBooks / Xero / FreshBooks (those are optional mirrors:
|
|
18
|
+
* `solid accounting`). Every command is a thin wrapper over a verb the same
|
|
19
|
+
* company's ADA, MCP and web use, so the answer is identical everywhere:
|
|
20
|
+
* reads → manifest verbs (invoice.*, expense.*, vendor.list, books.summary)
|
|
21
|
+
* writes → ADA verbs through /api/v1/ada/cli-dispatch (invoice_record_payment,
|
|
22
|
+
* invoice_cancel, expense_create, bill_mark_paid, expense_void)
|
|
23
|
+
* Writes refuse to run without --confirm. They RECORD money — none pays anyone.
|
|
24
|
+
* Any verb without a shortcut: `solid agent dispatch <verb> --args '{…}' --confirm`.
|
|
25
|
+
*/
|
|
26
|
+
const commander_1 = require("commander");
|
|
27
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
28
|
+
const command_kit_1 = require("../lib/command-kit");
|
|
29
|
+
const dispatch_shortcuts_1 = require("./dispatch_shortcuts");
|
|
30
|
+
function requireConfirm(options, what) {
|
|
31
|
+
if (!options.confirm) {
|
|
32
|
+
console.error(chalk_1.default.red(`Refusing to ${what} without --confirm.`));
|
|
33
|
+
process.exit(2);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function money(value, flag) {
|
|
37
|
+
const n = Number(String(value).replace(/[$,]/g, ''));
|
|
38
|
+
if (!Number.isFinite(n) || n <= 0) {
|
|
39
|
+
console.error(chalk_1.default.red(`${flag} must be an amount greater than 0 (got "${value}").`));
|
|
40
|
+
process.exit(2);
|
|
41
|
+
}
|
|
42
|
+
return n;
|
|
43
|
+
}
|
|
44
|
+
function present(entries) {
|
|
45
|
+
return Object.fromEntries(Object.entries(entries).filter(([, v]) => v !== undefined && v !== null && v !== ''));
|
|
46
|
+
}
|
|
47
|
+
// ── solid books ─────────────────────────────────────────────────────────────
|
|
48
|
+
exports.booksCommand = new commander_1.Command('books')
|
|
49
|
+
.description("The books — money in and out from Solid#'s own records (with or without an accounting system)");
|
|
50
|
+
exports.booksCommand
|
|
51
|
+
.command('summary')
|
|
52
|
+
.description('Invoiced / collected, spent / billed, what customers owe you, what you owe')
|
|
53
|
+
.option('--since <date>', 'YYYY-MM-DD')
|
|
54
|
+
.option('--until <date>', 'YYYY-MM-DD')
|
|
55
|
+
.option('--json', 'Output as JSON')
|
|
56
|
+
.action(async (options) => {
|
|
57
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('books.summary', present({ since: options.since, until: options.until }), options, 'Reading the books...');
|
|
58
|
+
});
|
|
59
|
+
(0, command_kit_1.appendExamples)(exports.booksCommand, [
|
|
60
|
+
{ cmd: 'solid books summary', why: 'How am I doing — in, out, owed both ways' },
|
|
61
|
+
{ cmd: 'solid books summary --since 2026-09-01 --until 2026-09-30', why: 'One month' },
|
|
62
|
+
]);
|
|
63
|
+
// ── solid invoices (money in) ───────────────────────────────────────────────
|
|
64
|
+
exports.invoicesCommand = new commander_1.Command('invoices')
|
|
65
|
+
.description('Money in — invoices, who owes you, recording payments');
|
|
66
|
+
exports.invoicesCommand
|
|
67
|
+
.command('list')
|
|
68
|
+
.description('Invoices, newest first')
|
|
69
|
+
.option('--status <status>', 'draft | sent | viewed | partial_paid | paid | overdue | cancelled')
|
|
70
|
+
.option('--open', 'Only invoices with money still owed')
|
|
71
|
+
.option('--overdue', 'Only overdue invoices')
|
|
72
|
+
.option('--contact-id <id>', 'One customer (CRM contact id)')
|
|
73
|
+
.option('--limit <n>', 'How many', '50')
|
|
74
|
+
.option('--json', 'Output as JSON')
|
|
75
|
+
.action(async (options) => {
|
|
76
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('invoice.list', present({
|
|
77
|
+
status: options.status, open_only: options.open ? true : undefined,
|
|
78
|
+
overdue_only: options.overdue ? true : undefined,
|
|
79
|
+
contact_id: options.contactId ? Number(options.contactId) : undefined, limit: Number(options.limit),
|
|
80
|
+
}), options, 'Loading invoices...');
|
|
81
|
+
});
|
|
82
|
+
exports.invoicesCommand
|
|
83
|
+
.command('get <invoice_id>')
|
|
84
|
+
.description('One invoice with its lines and every payment on it')
|
|
85
|
+
.option('--json', 'Output as JSON')
|
|
86
|
+
.action(async (invoiceId, options) => {
|
|
87
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('invoice.get', { invoice_id: Number(invoiceId) }, options, `Loading invoice ${invoiceId}...`);
|
|
88
|
+
});
|
|
89
|
+
exports.invoicesCommand
|
|
90
|
+
.command('aging')
|
|
91
|
+
.description('What customers owe you, by how overdue')
|
|
92
|
+
.option('--as-of <date>', 'YYYY-MM-DD; default today')
|
|
93
|
+
.option('--json', 'Output as JSON')
|
|
94
|
+
.action(async (options) => {
|
|
95
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('invoice.receivables', present({ as_of: options.asOf }), options, 'Aging receivables...');
|
|
96
|
+
});
|
|
97
|
+
exports.invoicesCommand
|
|
98
|
+
.command('summary')
|
|
99
|
+
.description('Invoiced, collected and still owed — by customer, month or status')
|
|
100
|
+
.option('--since <date>', 'YYYY-MM-DD')
|
|
101
|
+
.option('--until <date>', 'YYYY-MM-DD')
|
|
102
|
+
.option('--group-by <by>', 'customer | month | status', 'customer')
|
|
103
|
+
.option('--json', 'Output as JSON')
|
|
104
|
+
.action(async (options) => {
|
|
105
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('invoice.summary', present({ since: options.since, until: options.until, group_by: options.groupBy }), options, 'Summarising money in...');
|
|
106
|
+
});
|
|
107
|
+
exports.invoicesCommand
|
|
108
|
+
.command('pay <invoice_id>')
|
|
109
|
+
.description('Record money a customer paid on an invoice (records it — charges no one)')
|
|
110
|
+
.requiredOption('--amount <n>', 'Amount received')
|
|
111
|
+
.option('--method <m>', 'cash | check | card | ach | bank_transfer | venmo | zelle | other', 'other')
|
|
112
|
+
.option('--date <date>', 'YYYY-MM-DD received; default today')
|
|
113
|
+
.option('--reference <ref>', 'Check or confirmation number')
|
|
114
|
+
.option('--notes <text>', 'Notes')
|
|
115
|
+
.option('--confirm', 'Required: actually record the payment')
|
|
116
|
+
.option('--json', 'Output as JSON')
|
|
117
|
+
.action(async (invoiceId, options) => {
|
|
118
|
+
requireConfirm(options, 'record a payment');
|
|
119
|
+
await (0, dispatch_shortcuts_1.dispatchVerbShortcut)('invoice_record_payment', present({
|
|
120
|
+
invoice_id: Number(invoiceId), amount: money(options.amount, '--amount'), method: options.method,
|
|
121
|
+
received_at: options.date, reference: options.reference, notes: options.notes,
|
|
122
|
+
}), options, `Recording a payment on invoice ${invoiceId}...`);
|
|
123
|
+
});
|
|
124
|
+
exports.invoicesCommand
|
|
125
|
+
.command('cancel <invoice_id>')
|
|
126
|
+
.description('Cancel an invoice — never deleted; the reason stays on it')
|
|
127
|
+
.requiredOption('--reason <text>', 'Why')
|
|
128
|
+
.option('--confirm', 'Required: actually cancel the invoice')
|
|
129
|
+
.option('--json', 'Output as JSON')
|
|
130
|
+
.action(async (invoiceId, options) => {
|
|
131
|
+
requireConfirm(options, 'cancel an invoice');
|
|
132
|
+
await (0, dispatch_shortcuts_1.dispatchVerbShortcut)('invoice_cancel', { invoice_id: Number(invoiceId), reason: options.reason }, options, `Cancelling invoice ${invoiceId}...`);
|
|
133
|
+
});
|
|
134
|
+
(0, command_kit_1.appendExamples)(exports.invoicesCommand, [
|
|
135
|
+
{ cmd: 'solid invoices aging', why: 'Who owes you, and how late' },
|
|
136
|
+
{ cmd: 'solid invoices list --overdue', why: 'Just the overdue ones' },
|
|
137
|
+
{ cmd: 'solid invoices pay 31 --amount 500 --method check --reference 1042 --confirm', why: 'A check came in' },
|
|
138
|
+
]);
|
|
139
|
+
// ── solid expenses (money out) ──────────────────────────────────────────────
|
|
140
|
+
exports.expensesCommand = new commander_1.Command('expenses')
|
|
141
|
+
.description('Money out — expenses, bills, vendors');
|
|
142
|
+
exports.expensesCommand
|
|
143
|
+
.command('list')
|
|
144
|
+
.description('Expenses and bills, newest first')
|
|
145
|
+
.option('--kind <kind>', 'expense | bill')
|
|
146
|
+
.option('--status <status>', 'draft | posted | paid | void')
|
|
147
|
+
.option('--deal-id <id>', 'One job')
|
|
148
|
+
.option('--since <date>', 'YYYY-MM-DD')
|
|
149
|
+
.option('--until <date>', 'YYYY-MM-DD')
|
|
150
|
+
.option('--limit <n>', 'How many', '50')
|
|
151
|
+
.option('--json', 'Output as JSON')
|
|
152
|
+
.action(async (options) => {
|
|
153
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('expense.list', present({
|
|
154
|
+
kind: options.kind, status: options.status, deal_id: options.dealId ? Number(options.dealId) : undefined,
|
|
155
|
+
since: options.since, until: options.until, limit: Number(options.limit),
|
|
156
|
+
}), options, 'Loading expenses...');
|
|
157
|
+
});
|
|
158
|
+
exports.expensesCommand
|
|
159
|
+
.command('get <purchase_id>')
|
|
160
|
+
.description('One expense or bill with its lines')
|
|
161
|
+
.option('--json', 'Output as JSON')
|
|
162
|
+
.action(async (purchaseId, options) => {
|
|
163
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('expense.get', { purchase_id: Number(purchaseId) }, options, `Loading ${purchaseId}...`);
|
|
164
|
+
});
|
|
165
|
+
exports.expensesCommand
|
|
166
|
+
.command('aging')
|
|
167
|
+
.description('Bills you owe, by how overdue')
|
|
168
|
+
.option('--as-of <date>', 'YYYY-MM-DD; default today')
|
|
169
|
+
.option('--json', 'Output as JSON')
|
|
170
|
+
.action(async (options) => {
|
|
171
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('expense.payables', present({ as_of: options.asOf }), options, 'Aging payables...');
|
|
172
|
+
});
|
|
173
|
+
exports.expensesCommand
|
|
174
|
+
.command('summary')
|
|
175
|
+
.description('Money out, paid and owed apart — by category, vendor, kind or job')
|
|
176
|
+
.option('--since <date>', 'YYYY-MM-DD')
|
|
177
|
+
.option('--until <date>', 'YYYY-MM-DD')
|
|
178
|
+
.option('--group-by <by>', 'category | vendor | kind | deal', 'category')
|
|
179
|
+
.option('--json', 'Output as JSON')
|
|
180
|
+
.action(async (options) => {
|
|
181
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('expense.summary', present({ since: options.since, until: options.until, group_by: options.groupBy }), options, 'Summarising money out...');
|
|
182
|
+
});
|
|
183
|
+
exports.expensesCommand
|
|
184
|
+
.command('vendors')
|
|
185
|
+
.description('The vendors this business buys from')
|
|
186
|
+
.option('--search <text>', 'Name contains')
|
|
187
|
+
.option('--json', 'Output as JSON')
|
|
188
|
+
.action(async (options) => {
|
|
189
|
+
await (0, dispatch_shortcuts_1.invokeAgentVerbShortcut)('vendor.list', present({ search: options.search }), options, 'Loading vendors...');
|
|
190
|
+
});
|
|
191
|
+
exports.expensesCommand
|
|
192
|
+
.command('file')
|
|
193
|
+
.description('Record money spent (expense, paid) or owed (--bill)')
|
|
194
|
+
.requiredOption('--vendor <name>', 'Who it was from')
|
|
195
|
+
.requiredOption('--amount <n>', 'The total')
|
|
196
|
+
.option('--bill', 'A bill still owed, instead of an expense already paid')
|
|
197
|
+
.option('--category <c>', 'materials | fuel | tools | meals | rent | software …')
|
|
198
|
+
.option('--date <date>', 'YYYY-MM-DD; default today')
|
|
199
|
+
.option('--due <date>', 'Bills: YYYY-MM-DD due')
|
|
200
|
+
.option('--reference <ref>', "The vendor's receipt or invoice number")
|
|
201
|
+
.option('--deal-id <id>', 'The job it was for')
|
|
202
|
+
.option('--notes <text>', 'Notes')
|
|
203
|
+
.option('--confirm', 'Required: actually record it')
|
|
204
|
+
.option('--json', 'Output as JSON')
|
|
205
|
+
.action(async (options) => {
|
|
206
|
+
requireConfirm(options, 'record an expense');
|
|
207
|
+
await (0, dispatch_shortcuts_1.dispatchVerbShortcut)('expense_create', present({
|
|
208
|
+
kind: options.bill ? 'bill' : 'expense', vendor_name: options.vendor, amount: money(options.amount, '--amount'),
|
|
209
|
+
category: options.category, purchase_date: options.date, due_date: options.due, reference: options.reference,
|
|
210
|
+
deal_id: options.dealId ? Number(options.dealId) : undefined, notes: options.notes,
|
|
211
|
+
}), options, `Recording ${options.bill ? 'a bill' : 'an expense'} from ${options.vendor}...`);
|
|
212
|
+
});
|
|
213
|
+
exports.expensesCommand
|
|
214
|
+
.command('pay <purchase_id>')
|
|
215
|
+
.description('A bill was paid (records it — pays no one)')
|
|
216
|
+
.option('--date <date>', 'YYYY-MM-DD paid; default today')
|
|
217
|
+
.option('--method <m>', 'card | cash | check | ach | company_card | personal_reimburse | other')
|
|
218
|
+
.option('--reference <ref>', 'Check or confirmation number')
|
|
219
|
+
.option('--confirm', 'Required: actually mark it paid')
|
|
220
|
+
.option('--json', 'Output as JSON')
|
|
221
|
+
.action(async (purchaseId, options) => {
|
|
222
|
+
requireConfirm(options, 'mark a bill paid');
|
|
223
|
+
await (0, dispatch_shortcuts_1.dispatchVerbShortcut)('bill_mark_paid', present({
|
|
224
|
+
purchase_id: Number(purchaseId), paid_at: options.date, payment_method: options.method, reference: options.reference,
|
|
225
|
+
}), options, `Marking ${purchaseId} paid...`);
|
|
226
|
+
});
|
|
227
|
+
exports.expensesCommand
|
|
228
|
+
.command('void <purchase_id>')
|
|
229
|
+
.description('Void an expense or bill — never deleted; the reason stays on it')
|
|
230
|
+
.requiredOption('--reason <text>', 'Why')
|
|
231
|
+
.option('--confirm', 'Required: actually void it')
|
|
232
|
+
.option('--json', 'Output as JSON')
|
|
233
|
+
.action(async (purchaseId, options) => {
|
|
234
|
+
requireConfirm(options, 'void a purchase');
|
|
235
|
+
await (0, dispatch_shortcuts_1.dispatchVerbShortcut)('expense_void', { purchase_id: Number(purchaseId), reason: options.reason }, options, `Voiding ${purchaseId}...`);
|
|
236
|
+
});
|
|
237
|
+
(0, command_kit_1.appendExamples)(exports.expensesCommand, [
|
|
238
|
+
{ cmd: 'solid expenses aging', why: 'Bills you owe, and how late' },
|
|
239
|
+
{ cmd: 'solid expenses file --vendor "Ferguson" --amount 110.70 --category materials --confirm', why: 'A receipt' },
|
|
240
|
+
{ cmd: 'solid expenses pay 12 --method check --reference 2210 --confirm', why: 'A bill was paid' },
|
|
241
|
+
]);
|
|
242
|
+
//# sourceMappingURL=books.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"books.js","sourceRoot":"","sources":["../../src/commands/books.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,yCAAoC;AACpC,kDAA0B;AAE1B,oDAAoD;AACpD,6DAAyG;AAIzG,SAAS,cAAc,CAAC,OAAa,EAAE,IAAY;IACjD,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,eAAe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WAAW,EAAE;IACnH,EAAE,GAAG,EAAE,iEAAiE,EAAE,GAAG,EAAE,iBAAiB,EAAE;CACnG,CAAC,CAAC"}
|
package/dist/commands/call.js
CHANGED
|
@@ -102,6 +102,17 @@ exports.callCommand
|
|
|
102
102
|
const tone = route ? chalk_1.default.bold : chalk_1.default.yellow;
|
|
103
103
|
console.log(` ${chalk_1.default.dim(step.node)} · pressed ${chalk_1.default.cyan(step.input)} → ${tone(dest)}`);
|
|
104
104
|
}
|
|
105
|
+
// Routes that reach nothing. NOT an error and NOT a non-zero exit — a
|
|
106
|
+
// department named before it is wired up is ordinary work in progress, and
|
|
107
|
+
// failing CI on it would make the builder unusable. But the path above
|
|
108
|
+
// prints "→ department (Sales)" as though it works, and on a real call
|
|
109
|
+
// that caller is offered a message instead. Say so.
|
|
110
|
+
const unreachable = result.unreachable_routes || [];
|
|
111
|
+
if (unreachable.length > 0)
|
|
112
|
+
console.log('');
|
|
113
|
+
for (const u of unreachable) {
|
|
114
|
+
console.log(chalk_1.default.yellow(` ⚠ ${u.node} · ${u.key} — ${u.reason}`));
|
|
115
|
+
}
|
|
105
116
|
}
|
|
106
117
|
catch (error) {
|
|
107
118
|
spinner.fail(chalk_1.default.red(`Simulate failed: ${error.message || error}`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../src/commands/call.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;AAEH,yCAAoC;AACpC,8CAAsB;AACtB,kDAA0B;AAC1B,0CAAuC;AACvC,kDAA8C;AAC9C,oDAAkD;AAElD,SAAS,WAAW;IAClB,IAAI,CAAC,eAAM,CAAC,UAAU,EAAE,EAAE,CAAC;QACzB,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAEY,QAAA,WAAW,G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AAO,CAAC,GAAG,CAAC,KAAK,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/F,CAAC;QAED,sEAAsE;QACtE,2EAA2E;QAC3E,uEAAuE;QACvE,uEAAuE;QACvE,oDAAoD;QACpD,MAAM,WAAW,GAAG,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC;QACpD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5C,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,eAAK,CAAC,GAAG,CAAC,oBAAqB,KAAe,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC;QACjF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/commands/company.js
CHANGED
|
@@ -381,14 +381,31 @@ exports.companyCommand
|
|
|
381
381
|
}
|
|
382
382
|
});
|
|
383
383
|
// ════════════════════════════════════════════════════════════════════
|
|
384
|
-
// T10 — Agency-managed companies +
|
|
384
|
+
// T10 — Agency-managed companies + verb-scoped locks (SPRINT-AGENT-FIREWALL Phase 0)
|
|
385
385
|
// solid company create-for-client — provision + lock all + invite
|
|
386
|
-
// solid company lock-status — read current lock map
|
|
387
|
-
// solid company lock — lock areas
|
|
388
|
-
// solid company unlock — unlock
|
|
386
|
+
// solid company lock-status — read current lock map (grouped by area)
|
|
387
|
+
// solid company lock — lock keys (or legacy areas — the server expands them)
|
|
388
|
+
// solid company unlock — unlock keys (or --all)
|
|
389
|
+
// solid company lock-preset — apply a whole posture: design-lock | content-freeze | read-only
|
|
389
390
|
// solid company request-unlock — client asks agency to unlock
|
|
390
391
|
// ════════════════════════════════════════════════════════════════════
|
|
391
|
-
|
|
392
|
+
// Lock keys are `area:verb`. `{"design:write": true, "pages:delete": true}` (the
|
|
393
|
+
// `design-lock` preset) still lets the client add a landing page, edit copy and
|
|
394
|
+
// change business hours — that is what "lock my design" means. Single source of
|
|
395
|
+
// truth: solid-backend/services/policy/lock.py::VALID_LOCK_KEYS. A bare legacy
|
|
396
|
+
// area (`pages`) is still accepted and expands to every key under it.
|
|
397
|
+
const LOCK_KEYS = [
|
|
398
|
+
'design:write',
|
|
399
|
+
'pages:create', 'pages:update', 'pages:delete',
|
|
400
|
+
'content:metadata',
|
|
401
|
+
'brand:logo', 'brand:colors',
|
|
402
|
+
'domains:add', 'domains:remove',
|
|
403
|
+
'modules:deploy', 'modules:remove',
|
|
404
|
+
'billing_lock',
|
|
405
|
+
];
|
|
406
|
+
const LEGACY_LOCK_AREAS = ['pages', 'brand', 'domains', 'modules', 'design', 'billing_lock'];
|
|
407
|
+
const LOCK_PRESETS = ['design-lock', 'content-freeze', 'read-only'];
|
|
408
|
+
const LOCK_AREAS = LOCK_KEYS; // kept for callers that read the list
|
|
392
409
|
function parseAreas(raw) {
|
|
393
410
|
return raw
|
|
394
411
|
.split(',')
|
|
@@ -396,18 +413,33 @@ function parseAreas(raw) {
|
|
|
396
413
|
.filter((s) => s.length > 0);
|
|
397
414
|
}
|
|
398
415
|
function validateAreas(areas) {
|
|
399
|
-
const
|
|
416
|
+
const known = [...LOCK_KEYS, ...LEGACY_LOCK_AREAS];
|
|
417
|
+
const invalid = areas.filter((a) => !known.includes(a));
|
|
400
418
|
if (invalid.length > 0) {
|
|
401
|
-
return `Unknown lock
|
|
419
|
+
return `Unknown lock key(s): ${invalid.join(', ')}. Valid keys: ${LOCK_KEYS.join(', ')} (legacy areas ${LEGACY_LOCK_AREAS.join(', ')} expand to every key under them)`;
|
|
402
420
|
}
|
|
403
421
|
return null;
|
|
404
422
|
}
|
|
405
423
|
function printLocks(locks) {
|
|
406
424
|
console.log('');
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
425
|
+
// Group by area so the map reads as a posture, not a wall of booleans.
|
|
426
|
+
const keys = Object.keys(locks).length ? Object.keys(locks) : [...LOCK_KEYS];
|
|
427
|
+
const byArea = new Map();
|
|
428
|
+
keys.forEach((key) => {
|
|
429
|
+
const area = key.includes(':') ? key.split(':')[0] : key;
|
|
430
|
+
byArea.set(area, [...(byArea.get(area) ?? []), key]);
|
|
431
|
+
});
|
|
432
|
+
byArea.forEach((areaKeys, area) => {
|
|
433
|
+
const lockedCount = areaKeys.filter((k) => locks[k] === true).length;
|
|
434
|
+
const rollup = lockedCount === areaKeys.length ? chalk_1.default.red('locked') :
|
|
435
|
+
lockedCount > 0 ? chalk_1.default.yellow('partial') : chalk_1.default.green('unlocked');
|
|
436
|
+
console.log(` ${chalk_1.default.bold(area.padEnd(13))} ${rollup}`);
|
|
437
|
+
areaKeys.forEach((key) => {
|
|
438
|
+
const locked = locks[key] === true;
|
|
439
|
+
const badge = locked ? chalk_1.default.red('🔒 locked ') : chalk_1.default.green('✔ unlocked');
|
|
440
|
+
const verb = key.includes(':') ? key.split(':')[1] : '';
|
|
441
|
+
console.log(` ${badge} ${chalk_1.default.dim(verb ? `${area}:` : '')}${verb || chalk_1.default.dim(key)}`);
|
|
442
|
+
});
|
|
411
443
|
});
|
|
412
444
|
}
|
|
413
445
|
// Create a company for a client, locked by default
|
|
@@ -419,7 +451,7 @@ exports.companyCommand
|
|
|
419
451
|
.option('--client-name <name>', 'Client contact name')
|
|
420
452
|
.option('--industry <industry>', 'Industry slug (e.g. "plumber", "hvac")')
|
|
421
453
|
.option('--template <template>', 'KB template name (usually same as industry)')
|
|
422
|
-
.option('--unlock <
|
|
454
|
+
.option('--unlock <keys>', `Comma-separated lock keys to leave UNLOCKED at creation (valid: ${LOCK_KEYS.join(', ')}; a legacy area like "pages" expands to every key under it)`)
|
|
423
455
|
.action(async (options) => {
|
|
424
456
|
if (!config_1.config.isLoggedIn()) {
|
|
425
457
|
console.error(chalk_1.default.red('Not logged in. Run `solid auth login` first.'));
|
|
@@ -475,7 +507,7 @@ exports.companyCommand
|
|
|
475
507
|
});
|
|
476
508
|
exports.companyCommand
|
|
477
509
|
.command('lock-status [company_id]')
|
|
478
|
-
.description('Show which
|
|
510
|
+
.description('Show which lock keys are locked on a company, grouped by area')
|
|
479
511
|
.option('--json', 'Output as JSON')
|
|
480
512
|
.action(async (companyIdArg, options) => {
|
|
481
513
|
if (!config_1.config.isLoggedIn()) {
|
|
@@ -510,8 +542,8 @@ exports.companyCommand
|
|
|
510
542
|
});
|
|
511
543
|
exports.companyCommand
|
|
512
544
|
.command('lock <company_id>')
|
|
513
|
-
.description('Lock one or more
|
|
514
|
-
.requiredOption('--area <
|
|
545
|
+
.description('Lock one or more keys (area:verb) — agency owner only')
|
|
546
|
+
.requiredOption('--area <keys>', `Comma-separated lock keys (valid: ${LOCK_KEYS.join(', ')}; a legacy area like "pages" expands to every key under it)`)
|
|
515
547
|
.action(async (companyIdArg, options) => {
|
|
516
548
|
if (!config_1.config.isLoggedIn()) {
|
|
517
549
|
console.error(chalk_1.default.red('Not logged in. Run `solid auth login` first.'));
|
|
@@ -539,9 +571,9 @@ exports.companyCommand
|
|
|
539
571
|
});
|
|
540
572
|
exports.companyCommand
|
|
541
573
|
.command('unlock <company_id>')
|
|
542
|
-
.description('Unlock one or more
|
|
543
|
-
.option('--area <
|
|
544
|
-
.option('--all', 'Unlock every
|
|
574
|
+
.description('Unlock one or more keys (area:verb) — agency owner only')
|
|
575
|
+
.option('--area <keys>', 'Comma-separated lock keys to unlock (a legacy area expands to every key under it)')
|
|
576
|
+
.option('--all', 'Unlock every key (full handoff)', false)
|
|
545
577
|
.action(async (companyIdArg, options) => {
|
|
546
578
|
if (!config_1.config.isLoggedIn()) {
|
|
547
579
|
console.error(chalk_1.default.red('Not logged in. Run `solid auth login` first.'));
|
|
@@ -561,7 +593,7 @@ exports.companyCommand
|
|
|
561
593
|
process.exit(1);
|
|
562
594
|
}
|
|
563
595
|
}
|
|
564
|
-
const label = all ? 'ALL
|
|
596
|
+
const label = all ? 'ALL keys' : areas.join(', ');
|
|
565
597
|
const spinner = (0, ora_1.default)(`Unlocking ${label} on company #${companyId}...`).start();
|
|
566
598
|
try {
|
|
567
599
|
const res = await api_client_1.apiClient.companyUnlock(companyId, areas, all);
|
|
@@ -577,8 +609,8 @@ exports.companyCommand
|
|
|
577
609
|
});
|
|
578
610
|
exports.companyCommand
|
|
579
611
|
.command('request-unlock <company_id>')
|
|
580
|
-
.description('Ask your agency to unlock one or more
|
|
581
|
-
.requiredOption('--area <
|
|
612
|
+
.description('Ask your agency to unlock one or more keys (client-side)')
|
|
613
|
+
.requiredOption('--area <keys>', 'Comma-separated lock keys to request (e.g. "pages:update")')
|
|
582
614
|
.requiredOption('--reason <reason>', 'Why you need this unlocked')
|
|
583
615
|
.action(async (companyIdArg, options) => {
|
|
584
616
|
if (!config_1.config.isLoggedIn()) {
|
|
@@ -597,7 +629,7 @@ exports.companyCommand
|
|
|
597
629
|
const res = await api_client_1.apiClient.companyRequestUnlock(companyId, areas, options.reason);
|
|
598
630
|
spinner.succeed(chalk_1.default.green('Request sent'));
|
|
599
631
|
console.log(chalk_1.default.dim(` Agency owner: user_id=${res.data.agency_owner_user_id}`));
|
|
600
|
-
console.log(chalk_1.default.dim(`
|
|
632
|
+
console.log(chalk_1.default.dim(` Keys: ${res.data.areas.join(', ')}`));
|
|
601
633
|
}
|
|
602
634
|
catch (error) {
|
|
603
635
|
spinner.fail(chalk_1.default.red('Request failed'));
|
|
@@ -606,11 +638,41 @@ exports.companyCommand
|
|
|
606
638
|
process.exit(1);
|
|
607
639
|
}
|
|
608
640
|
});
|
|
641
|
+
exports.companyCommand
|
|
642
|
+
.command('lock-preset <company_id>')
|
|
643
|
+
.description('Apply a lock posture — REPLACES the whole map. Agency owner only')
|
|
644
|
+
.requiredOption('--profile <name>', `One of: ${LOCK_PRESETS.join(', ')}`)
|
|
645
|
+
.action(async (companyIdArg, options) => {
|
|
646
|
+
if (!config_1.config.isLoggedIn()) {
|
|
647
|
+
console.error(chalk_1.default.red('Not logged in. Run `solid auth login` first.'));
|
|
648
|
+
process.exit(1);
|
|
649
|
+
}
|
|
650
|
+
const companyId = parseInt(companyIdArg, 10);
|
|
651
|
+
const profile = String(options.profile);
|
|
652
|
+
if (!LOCK_PRESETS.includes(profile)) {
|
|
653
|
+
console.error(chalk_1.default.red(`Unknown preset '${profile}'. Valid: ${LOCK_PRESETS.join(', ')}`));
|
|
654
|
+
process.exit(1);
|
|
655
|
+
}
|
|
656
|
+
const spinner = (0, ora_1.default)(`Applying '${profile}' on company #${companyId}...`).start();
|
|
657
|
+
try {
|
|
658
|
+
const res = await api_client_1.apiClient.companyLockPreset(companyId, profile);
|
|
659
|
+
spinner.succeed(chalk_1.default.green(`Applied: ${profile}`));
|
|
660
|
+
printLocks(res.data.locks);
|
|
661
|
+
}
|
|
662
|
+
catch (error) {
|
|
663
|
+
spinner.fail(chalk_1.default.red('Preset failed'));
|
|
664
|
+
const apiError = (0, api_client_1.handleApiError)(error);
|
|
665
|
+
console.error(chalk_1.default.red(` ${apiError.message}`));
|
|
666
|
+
process.exit(1);
|
|
667
|
+
}
|
|
668
|
+
});
|
|
609
669
|
const command_kit_1 = require("../lib/command-kit");
|
|
610
670
|
(0, command_kit_1.appendExamples)(exports.companyCommand, [
|
|
611
671
|
{ cmd: 'solid company list', why: 'Companies you have access to' },
|
|
612
672
|
{ cmd: 'solid company current', why: 'Active company (same as whoami)' },
|
|
613
673
|
{ cmd: 'solid company info <id>', why: 'Settings, tier, domain' },
|
|
614
674
|
{ cmd: 'solid company create-for-client --name "..."', why: 'Agency: spin up a new tenant' },
|
|
675
|
+
{ cmd: 'solid company lock-preset 47 --profile design-lock', why: 'Lock design + deletes; new pages and copy edits stay open' },
|
|
676
|
+
{ cmd: 'solid company lock 47 --area design:write,pages:delete', why: 'Lock individual keys (area:verb)' },
|
|
615
677
|
]);
|
|
616
678
|
//# sourceMappingURL=company.js.map
|