@solidnumber/cli 2.24.1 → 2.24.3
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 +1 -1
- package/dist/commands/ai.d.ts.map +1 -1
- package/dist/commands/ai.js +27 -0
- package/dist/commands/ai.js.map +1 -1
- package/dist/commands/auth.js +2 -2
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/setup.d.ts +23 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +31 -10
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/switch.js +1 -1
- package/dist/commands/switch.js.map +1 -1
- package/dist/commands/today.d.ts +58 -22
- package/dist/commands/today.d.ts.map +1 -1
- package/dist/commands/today.js +121 -89
- package/dist/commands/today.js.map +1 -1
- package/dist/commands/update.d.ts +8 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +31 -7
- package/dist/commands/update.js.map +1 -1
- package/dist/index.js +34 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/mcp-sync.d.ts +28 -4
- package/dist/lib/mcp-sync.d.ts.map +1 -1
- package/dist/lib/mcp-sync.js +68 -4
- package/dist/lib/mcp-sync.js.map +1 -1
- package/dist/lib/suggest.d.ts +22 -0
- package/dist/lib/suggest.d.ts.map +1 -1
- package/dist/lib/suggest.js +49 -13
- package/dist/lib/suggest.js.map +1 -1
- package/dist/lib/verb-search.d.ts.map +1 -1
- package/dist/lib/verb-search.js +12 -9
- package/dist/lib/verb-search.js.map +1 -1
- package/package.json +2 -2
- package/platform-docs/llms.txt +3 -3
package/dist/commands/today.d.ts
CHANGED
|
@@ -1,44 +1,80 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `solid today` — the daily brief.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* ⛔ THIS COMMAND DOES NOT COMPUTE A BRIEF. It renders the platform's one
|
|
5
|
+
* brief (`GET /api/v1/dashboard/brief`), the same payload the web Daily Brief
|
|
6
|
+
* page reads, whose "what needs you" list comes from `services/needs_you.py`
|
|
7
|
+
* — the same list the phone's Home shows.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* ⛔ WHY (2026-09-23). It used to stitch four endpoints together itself
|
|
10
|
+
* (/crm/dashboard/summary, /crm/tasks, /predictions/targets) and guess at
|
|
11
|
+
* field names — `net_revenue`, `pipeline_value`, `open_deals`. None of those
|
|
12
|
+
* keys exists at the top level of /crm/dashboard/summary: revenue lives at
|
|
13
|
+
* `overview.revenue.revenue` and pipeline at `insights.pipeline`. So every
|
|
14
|
+
* number came back **null**, with no reason, forever. Worse, the pipeline
|
|
15
|
+
* payload it ignored was already carrying `available: false` and a sentence
|
|
16
|
+
* explaining itself — the platform knew why and the brief threw it away.
|
|
17
|
+
*
|
|
18
|
+
* It also reported the raw pending-task total as "urgent": 785 of them, every
|
|
19
|
+
* sample reading "CALLBACK REQUEST: Chat Visitor". Those are now one grouped
|
|
20
|
+
* item with a count, decided once in `services/needs_you.py`, so the phone,
|
|
21
|
+
* the web page and this command agree.
|
|
22
|
+
*
|
|
23
|
+
* The shaping is the pure `buildBrief()` so it can be unit-tested offline.
|
|
12
24
|
*/
|
|
13
25
|
import { Command } from 'commander';
|
|
14
26
|
type AnyRec = Record<string, any>;
|
|
27
|
+
/**
|
|
28
|
+
* A number the platform either measured or could not.
|
|
29
|
+
*
|
|
30
|
+
* ⛔ `available: false` means NOT MEASURED — never render it as 0. `value: 0`
|
|
31
|
+
* with `available: true` means measured and empty, which is a fact. A reader
|
|
32
|
+
* that cannot tell those apart reports a false zero, and a false zero is worse
|
|
33
|
+
* than a null.
|
|
34
|
+
*/
|
|
35
|
+
export interface Metric {
|
|
36
|
+
value: number | null;
|
|
37
|
+
available: boolean;
|
|
38
|
+
/** Plain words: why it is missing, or why it is zero. */
|
|
39
|
+
reason: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface NeedsYouItem {
|
|
42
|
+
title: string;
|
|
43
|
+
kicker: string | null;
|
|
44
|
+
priority: string;
|
|
45
|
+
/** How many rows this one item stands for (a grouped backlog), else null. */
|
|
46
|
+
count: number | null;
|
|
47
|
+
}
|
|
15
48
|
export interface Brief {
|
|
16
49
|
companyName: string | null;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
50
|
+
date: string | null;
|
|
51
|
+
summary: string | null;
|
|
52
|
+
revenue: Metric & {
|
|
53
|
+
change: number | null;
|
|
54
|
+
period: string | null;
|
|
21
55
|
};
|
|
22
|
-
pipeline: {
|
|
23
|
-
total: number | null;
|
|
56
|
+
pipeline: Metric & {
|
|
24
57
|
openDeals: number | null;
|
|
25
58
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
59
|
+
tasks: {
|
|
60
|
+
open: Metric;
|
|
61
|
+
overdue: number | null;
|
|
62
|
+
completed: number | null;
|
|
63
|
+
};
|
|
64
|
+
needsYou: {
|
|
65
|
+
items: NeedsYouItem[];
|
|
66
|
+
grouped: number;
|
|
29
67
|
};
|
|
30
68
|
actions: string[];
|
|
31
69
|
}
|
|
32
70
|
/**
|
|
33
|
-
* Pure:
|
|
34
|
-
* Every field degrades to null/empty rather than
|
|
35
|
-
*
|
|
71
|
+
* Pure: the brief payload (plus the company record, for its name) as the
|
|
72
|
+
* model this command renders. Every field degrades to null/empty rather than
|
|
73
|
+
* throwing, so a partial payload never breaks the brief.
|
|
36
74
|
*/
|
|
37
75
|
export declare function buildBrief(parts: {
|
|
38
76
|
company?: AnyRec | null;
|
|
39
|
-
|
|
40
|
-
tasks?: unknown;
|
|
41
|
-
targets?: unknown;
|
|
77
|
+
brief?: AnyRec | null;
|
|
42
78
|
}): Brief;
|
|
43
79
|
export declare const todayCommand: Command;
|
|
44
80
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"today.d.ts","sourceRoot":"","sources":["../../src/commands/today.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"today.d.ts","sourceRoot":"","sources":["../../src/commands/today.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,yDAAyD;IACzD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,KAAK;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACnE,QAAQ,EAAE,MAAM,GAAG;QAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAChD,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC1E,QAAQ,EAAE;QAAE,KAAK,EAAE,YAAY,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AA4BD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,KAAK,CA6C3F;AA6DD,eAAO,MAAM,YAAY,SAmCrB,CAAC"}
|
package/dist/commands/today.js
CHANGED
|
@@ -2,14 +2,26 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* `solid today` — the daily brief.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* ⛔ THIS COMMAND DOES NOT COMPUTE A BRIEF. It renders the platform's one
|
|
6
|
+
* brief (`GET /api/v1/dashboard/brief`), the same payload the web Daily Brief
|
|
7
|
+
* page reads, whose "what needs you" list comes from `services/needs_you.py`
|
|
8
|
+
* — the same list the phone's Home shows.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* ⛔ WHY (2026-09-23). It used to stitch four endpoints together itself
|
|
11
|
+
* (/crm/dashboard/summary, /crm/tasks, /predictions/targets) and guess at
|
|
12
|
+
* field names — `net_revenue`, `pipeline_value`, `open_deals`. None of those
|
|
13
|
+
* keys exists at the top level of /crm/dashboard/summary: revenue lives at
|
|
14
|
+
* `overview.revenue.revenue` and pipeline at `insights.pipeline`. So every
|
|
15
|
+
* number came back **null**, with no reason, forever. Worse, the pipeline
|
|
16
|
+
* payload it ignored was already carrying `available: false` and a sentence
|
|
17
|
+
* explaining itself — the platform knew why and the brief threw it away.
|
|
18
|
+
*
|
|
19
|
+
* It also reported the raw pending-task total as "urgent": 785 of them, every
|
|
20
|
+
* sample reading "CALLBACK REQUEST: Chat Visitor". Those are now one grouped
|
|
21
|
+
* item with a count, decided once in `services/needs_you.py`, so the phone,
|
|
22
|
+
* the web page and this command agree.
|
|
23
|
+
*
|
|
24
|
+
* The shaping is the pure `buildBrief()` so it can be unit-tested offline.
|
|
13
25
|
*/
|
|
14
26
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -24,108 +36,132 @@ const config_1 = require("../lib/config");
|
|
|
24
36
|
const api_client_1 = require("../lib/api-client");
|
|
25
37
|
const ui_1 = require("../lib/ui");
|
|
26
38
|
const json_output_1 = require("../lib/json-output");
|
|
27
|
-
/**
|
|
28
|
-
function num(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
/** A finite number, or null. Never coerces absent/garbage to 0. */
|
|
40
|
+
function num(v) {
|
|
41
|
+
if (v === null || v === undefined || v === '')
|
|
42
|
+
return null;
|
|
43
|
+
const n = typeof v === 'string' ? Number(v) : v;
|
|
44
|
+
return typeof n === 'number' && Number.isFinite(n) ? n : null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read one `keyMetrics` entry. `available` is trusted when the server sends it;
|
|
48
|
+
* an older server that does not gets the honest fallback — a present number is
|
|
49
|
+
* measured, an absent one is unknown with no reason we can invent.
|
|
50
|
+
*/
|
|
51
|
+
function metric(m, key = 'value') {
|
|
52
|
+
const value = num(m?.[key]);
|
|
53
|
+
const available = typeof m?.available === 'boolean' ? m.available : value !== null;
|
|
54
|
+
return {
|
|
55
|
+
value: available ? value : null,
|
|
56
|
+
available,
|
|
57
|
+
reason: (m?.reason ?? null),
|
|
58
|
+
};
|
|
35
59
|
}
|
|
36
60
|
function asArray(v) {
|
|
37
|
-
|
|
38
|
-
return v;
|
|
39
|
-
if (v && typeof v === 'object') {
|
|
40
|
-
const o = v;
|
|
41
|
-
if (Array.isArray(o.tasks))
|
|
42
|
-
return o.tasks;
|
|
43
|
-
if (Array.isArray(o.items))
|
|
44
|
-
return o.items;
|
|
45
|
-
if (Array.isArray(o.results))
|
|
46
|
-
return o.results;
|
|
47
|
-
if (Array.isArray(o.targets))
|
|
48
|
-
return o.targets;
|
|
49
|
-
}
|
|
50
|
-
return [];
|
|
61
|
+
return Array.isArray(v) ? v : [];
|
|
51
62
|
}
|
|
52
63
|
/**
|
|
53
|
-
* Pure:
|
|
54
|
-
* Every field degrades to null/empty rather than
|
|
55
|
-
*
|
|
64
|
+
* Pure: the brief payload (plus the company record, for its name) as the
|
|
65
|
+
* model this command renders. Every field degrades to null/empty rather than
|
|
66
|
+
* throwing, so a partial payload never breaks the brief.
|
|
56
67
|
*/
|
|
57
68
|
function buildBrief(parts) {
|
|
58
69
|
const company = parts.company || {};
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
const taskList = asArray(parts.tasks);
|
|
70
|
-
const urgent = {
|
|
71
|
-
taskCount: num(parts.tasks?.total, parts.tasks?.count, taskList.length) ?? taskList.length,
|
|
72
|
-
samples: taskList
|
|
73
|
-
.slice(0, 3)
|
|
74
|
-
.map((t) => String(t.title || t.name || t.description || 'Untitled task').slice(0, 80)),
|
|
75
|
-
};
|
|
76
|
-
// Recommended actions: prefer server-suggested targets, else derive from state.
|
|
77
|
-
const targetList = asArray(parts.targets);
|
|
78
|
-
const actions = targetList
|
|
79
|
-
.slice(0, 5)
|
|
80
|
-
.map((t) => String(t.title || t.recommendation || t.action || '').trim())
|
|
81
|
-
.filter(Boolean);
|
|
82
|
-
if (actions.length === 0) {
|
|
83
|
-
if (urgent.taskCount > 0)
|
|
84
|
-
actions.push(`Clear ${urgent.taskCount} pending task(s)`);
|
|
85
|
-
if ((pipeline.openDeals ?? 0) > 0)
|
|
86
|
-
actions.push(`Follow up on ${pipeline.openDeals} open deal(s)`);
|
|
87
|
-
if (actions.length === 0)
|
|
88
|
-
actions.push('No urgent items — good time to prospect or publish content');
|
|
70
|
+
const b = parts.brief || {};
|
|
71
|
+
const km = (b.keyMetrics || {});
|
|
72
|
+
// The brief itself did not come back. Say that once, on every number, rather
|
|
73
|
+
// than four bare nulls that look like "you have no revenue".
|
|
74
|
+
if (!parts.brief) {
|
|
75
|
+
const dead = { value: null, available: false, reason: 'The daily brief could not be read from the server.' };
|
|
76
|
+
km.revenue = km.revenue || dead;
|
|
77
|
+
km.pipeline = km.pipeline || dead;
|
|
78
|
+
km.tasks = km.tasks || dead;
|
|
89
79
|
}
|
|
80
|
+
const revenue = { ...metric(km.revenue), change: num(km.revenue?.change), period: (km.revenue?.period ?? null) };
|
|
81
|
+
const pipeline = { ...metric(km.pipeline), openDeals: num(km.pipeline?.openDeals) };
|
|
82
|
+
const tasks = {
|
|
83
|
+
open: metric(km.tasks),
|
|
84
|
+
overdue: num(km.tasks?.overdue),
|
|
85
|
+
completed: num(km.tasks?.completed),
|
|
86
|
+
};
|
|
87
|
+
const items = asArray(b.priorities)
|
|
88
|
+
.map((p) => ({
|
|
89
|
+
title: String(p.title || '').trim(),
|
|
90
|
+
kicker: (p.subtitle ?? null) || null,
|
|
91
|
+
priority: String(p.priority || 'medium'),
|
|
92
|
+
count: num(p.count),
|
|
93
|
+
}))
|
|
94
|
+
.filter((i) => i.title.length > 0);
|
|
95
|
+
// The rows the grouped items stand for — so "1 item" never hides 785 rows.
|
|
96
|
+
const grouped = items.reduce((sum, i) => sum + (i.count && i.count > 1 ? i.count : 0), 0);
|
|
97
|
+
const actions = asArray(b.recommendations).map((r) => String(r).trim()).filter(Boolean);
|
|
90
98
|
return {
|
|
91
|
-
companyName: company.name ?? null,
|
|
99
|
+
companyName: (company.name ?? null),
|
|
100
|
+
date: (b.date ?? null),
|
|
101
|
+
summary: (b.summary ?? null),
|
|
92
102
|
revenue,
|
|
93
103
|
pipeline,
|
|
94
|
-
|
|
104
|
+
tasks,
|
|
105
|
+
needsYou: { items, grouped },
|
|
95
106
|
actions,
|
|
96
107
|
};
|
|
97
108
|
}
|
|
98
|
-
function money(
|
|
99
|
-
if (
|
|
109
|
+
function money(m) {
|
|
110
|
+
if (m.value === null)
|
|
100
111
|
return chalk_1.default.dim('—');
|
|
101
|
-
return '$' +
|
|
112
|
+
return '$' + m.value.toLocaleString('en-US', { maximumFractionDigits: 2 });
|
|
113
|
+
}
|
|
114
|
+
function count(v) {
|
|
115
|
+
return v === null ? chalk_1.default.dim('—') : String(v);
|
|
116
|
+
}
|
|
117
|
+
/** The reason line under a number. This is the whole point: never a bare null. */
|
|
118
|
+
function why(m) {
|
|
119
|
+
if (m.reason)
|
|
120
|
+
console.log(chalk_1.default.dim(' ' + (m.available ? '' : 'not measured — ') + m.reason));
|
|
121
|
+
else if (!m.available)
|
|
122
|
+
console.log(chalk_1.default.dim(' not measured, and the server gave no reason'));
|
|
102
123
|
}
|
|
103
124
|
function render(brief) {
|
|
104
125
|
console.log('');
|
|
105
|
-
console.log(ui_1.ui.header(`Daily Brief${brief.companyName ? ' — ' + brief.companyName : ''}`));
|
|
126
|
+
console.log(ui_1.ui.header(`Daily Brief${brief.companyName ? ' — ' + brief.companyName : ''}${brief.date ? ' · ' + brief.date : ''}`));
|
|
127
|
+
if (brief.summary) {
|
|
128
|
+
console.log('');
|
|
129
|
+
console.log(' ' + brief.summary);
|
|
130
|
+
}
|
|
106
131
|
console.log('');
|
|
107
132
|
console.log(chalk_1.default.bold('Revenue'));
|
|
108
|
-
console.log(' ' + ui_1.ui.label(
|
|
109
|
-
|
|
110
|
-
console.log(' ' + ui_1.ui.label('Orders', String(brief.revenue.orders)));
|
|
111
|
-
if (brief.revenue.aov !== null)
|
|
112
|
-
console.log(' ' + ui_1.ui.label('Avg order', money(brief.revenue.aov)));
|
|
133
|
+
console.log(' ' + ui_1.ui.label(brief.revenue.period || 'Recent', money(brief.revenue)));
|
|
134
|
+
why(brief.revenue);
|
|
113
135
|
console.log('');
|
|
114
136
|
console.log(chalk_1.default.bold('Pipeline'));
|
|
115
|
-
console.log(' ' + ui_1.ui.label('Open pipeline', money(brief.pipeline
|
|
116
|
-
console.log(' ' + ui_1.ui.label('Open deals',
|
|
137
|
+
console.log(' ' + ui_1.ui.label('Open pipeline', money(brief.pipeline)));
|
|
138
|
+
console.log(' ' + ui_1.ui.label('Open deals', count(brief.pipeline.openDeals)));
|
|
139
|
+
why(brief.pipeline);
|
|
117
140
|
console.log('');
|
|
118
|
-
console.log(chalk_1.default.bold('
|
|
119
|
-
console.log(' ' + ui_1.ui.label('
|
|
120
|
-
|
|
121
|
-
|
|
141
|
+
console.log(chalk_1.default.bold('Open tasks'));
|
|
142
|
+
console.log(' ' + ui_1.ui.label('On the books', count(brief.tasks.open.value)));
|
|
143
|
+
console.log(' ' + ui_1.ui.label('Overdue', count(brief.tasks.overdue)));
|
|
144
|
+
why(brief.tasks.open);
|
|
122
145
|
console.log('');
|
|
123
|
-
console.log(chalk_1.default.bold('
|
|
124
|
-
brief.
|
|
146
|
+
console.log(chalk_1.default.bold('Needs you'));
|
|
147
|
+
if (brief.needsYou.items.length === 0) {
|
|
148
|
+
console.log(chalk_1.default.dim(' nothing is waiting on you'));
|
|
149
|
+
}
|
|
150
|
+
for (const i of brief.needsYou.items) {
|
|
151
|
+
const tag = i.count && i.count > 1 ? chalk_1.default.dim(` (${i.count} rows, grouped)`) : '';
|
|
152
|
+
console.log(` • ${i.title}${tag}`);
|
|
153
|
+
if (i.kicker)
|
|
154
|
+
console.log(chalk_1.default.dim(` ${i.kicker} · ${i.priority}`));
|
|
155
|
+
}
|
|
156
|
+
if (brief.actions.length) {
|
|
157
|
+
console.log('');
|
|
158
|
+
console.log(chalk_1.default.bold('Recommended actions'));
|
|
159
|
+
brief.actions.forEach((a, i) => console.log(` ${chalk_1.default.cyan(String(i + 1) + '.')} ${a}`));
|
|
160
|
+
}
|
|
125
161
|
console.log('');
|
|
126
162
|
}
|
|
127
163
|
exports.todayCommand = new commander_1.Command('today')
|
|
128
|
-
.description('Your daily brief: revenue, pipeline,
|
|
164
|
+
.description('Your daily brief: revenue, pipeline, what needs you, recommended actions')
|
|
129
165
|
.option('--json', 'Output as JSON')
|
|
130
166
|
.action(async (options) => {
|
|
131
167
|
if (!config_1.config.isLoggedIn()) {
|
|
@@ -134,19 +170,15 @@ exports.todayCommand = new commander_1.Command('today')
|
|
|
134
170
|
}
|
|
135
171
|
const spinner = (0, ora_1.default)('Building your brief...').start();
|
|
136
172
|
try {
|
|
137
|
-
const [companyRes,
|
|
173
|
+
const [companyRes, briefRes] = await Promise.allSettled([
|
|
138
174
|
api_client_1.apiClient.companyInfo(),
|
|
139
|
-
api_client_1.apiClient.get('/api/v1/
|
|
140
|
-
api_client_1.apiClient.get('/api/v1/crm/tasks', { params: { status: 'pending', limit: 50 } }),
|
|
141
|
-
api_client_1.apiClient.get('/api/v1/predictions/targets'),
|
|
175
|
+
api_client_1.apiClient.get('/api/v1/dashboard/brief'),
|
|
142
176
|
]);
|
|
143
177
|
spinner.stop();
|
|
144
178
|
const pick = (r) => r.status === 'fulfilled' ? (r.value?.data ?? null) : null;
|
|
145
179
|
const brief = buildBrief({
|
|
146
180
|
company: pick(companyRes)?.company ?? pick(companyRes),
|
|
147
|
-
|
|
148
|
-
tasks: pick(tasksRes),
|
|
149
|
-
targets: pick(targetsRes),
|
|
181
|
+
brief: pick(briefRes),
|
|
150
182
|
});
|
|
151
183
|
if ((0, json_output_1.isJsonOutput)(options)) {
|
|
152
184
|
console.log(JSON.stringify(brief, null, 2));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"today.js","sourceRoot":"","sources":["../../src/commands/today.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"today.js","sourceRoot":"","sources":["../../src/commands/today.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;;;;AA6EH,gCA6CC;AAxHD,yCAAoC;AACpC,8CAAsB;AACtB,kDAA0B;AAC1B,0CAAuC;AACvC,kDAA8D;AAC9D,kCAA+B;AAC/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AAC;YAC1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC5C,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,eAAK,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;QACjD,OAAO,CAAC,KAAK,CAAC,IAAA,2BAAc,EAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -5,6 +5,14 @@ export interface InstallInfo {
|
|
|
5
5
|
installer: Installer;
|
|
6
6
|
/** argv to run, or null when we cannot tell — then we say so rather than guess. */
|
|
7
7
|
command: string[] | null;
|
|
8
|
+
/**
|
|
9
|
+
* Run before `command`, when the upgrade needs something in place first.
|
|
10
|
+
* Homebrew's is `brew tap solidnumber/tap`: `brew upgrade user/repo/formula`
|
|
11
|
+
* does NOT auto-tap (only `brew install` does), so on a machine whose tap has
|
|
12
|
+
* gone missing the upgrade dies with "requires the tap solidnumber/tap".
|
|
13
|
+
* Tapping is idempotent and cheap, so we just do it every time.
|
|
14
|
+
*/
|
|
15
|
+
preflight?: string[];
|
|
8
16
|
}
|
|
9
17
|
export interface OtherCopy {
|
|
10
18
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAG/C,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,mFAAmF;IACnF,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAG/C,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,mFAAmF;IACnF,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,CA6BhE;AAED,oFAAoF;AACpF,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAQnE;AAED,gGAAgG;AAChG,wBAAsB,aAAa,CAAC,SAAS,GAAE,OAAO,KAAa,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAS3F;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,oBAAc,GAAG,SAAS,EAAE,CAuBzF;AAoBD,eAAO,MAAM,aAAa,SA4FtB,CAAC"}
|
package/dist/commands/update.js
CHANGED
|
@@ -48,9 +48,22 @@ function detectInstaller(path) {
|
|
|
48
48
|
return { installer: 'unknown', command: null };
|
|
49
49
|
const p = path.replace(/\\/g, '/').toLowerCase();
|
|
50
50
|
// Homebrew before npm: a brew formula's payload also lives in a node_modules
|
|
51
|
-
// directory
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
// directory (the formula installs into the keg's libexec), so the npm check
|
|
52
|
+
// would swallow it and print the wrong command.
|
|
53
|
+
//
|
|
54
|
+
// ⛔ THE TEST IS /Cellar/, NEVER /homebrew/. A Homebrew PREFIX is not a
|
|
55
|
+
// Homebrew INSTALL: `npm i -g` under a brew-installed node lands in
|
|
56
|
+
// /opt/homebrew/lib/node_modules/@solidnumber/cli — an npm global that merely
|
|
57
|
+
// lives inside the brew tree. Calling that brew sent `brew upgrade
|
|
58
|
+
// solidnumber/tap/cli` to a machine that had never tapped, which is exactly
|
|
59
|
+
// the error Adam hit on the iMac 2026-09-17. install.sh has always matched
|
|
60
|
+
// */Cellar/* — this is the same rule, finally spelled the same way.
|
|
61
|
+
if (p.includes('/cellar/')) {
|
|
62
|
+
return {
|
|
63
|
+
installer: 'brew',
|
|
64
|
+
command: ['brew', 'upgrade', 'solidnumber/tap/cli'],
|
|
65
|
+
preflight: ['brew', 'tap', 'solidnumber/tap'],
|
|
66
|
+
};
|
|
54
67
|
}
|
|
55
68
|
if (p.includes('/scoop/') || p.includes('scoop/apps/')) {
|
|
56
69
|
return { installer: 'scoop', command: ['scoop', 'update', 'solid'] };
|
|
@@ -138,7 +151,7 @@ exports.updateCommand = new commander_1.Command('update')
|
|
|
138
151
|
.option('--json', 'Emit JSON')
|
|
139
152
|
.action(async (opts) => {
|
|
140
153
|
const me = selfPath();
|
|
141
|
-
const { installer, command } = detectInstaller(me);
|
|
154
|
+
const { installer, command, preflight } = detectInstaller(me);
|
|
142
155
|
const latest = await latestVersion();
|
|
143
156
|
const others = otherCopiesOnPath(me);
|
|
144
157
|
const behind = latest ? isNewer(api_client_1.CLI_VERSION, latest) : false;
|
|
@@ -149,6 +162,7 @@ exports.updateCommand = new commander_1.Command('update')
|
|
|
149
162
|
up_to_date: latest ? !behind : null,
|
|
150
163
|
installer,
|
|
151
164
|
command: command ? command.join(' ') : null,
|
|
165
|
+
preflight: preflight ? preflight.join(' ') : null,
|
|
152
166
|
other_copies: others,
|
|
153
167
|
ran: false,
|
|
154
168
|
}, null, 2) + '\n');
|
|
@@ -177,13 +191,23 @@ exports.updateCommand = new commander_1.Command('update')
|
|
|
177
191
|
console.log(`${chalk_1.default.bold('Update available')} ${api_client_1.CLI_VERSION} → ${chalk_1.default.green(latest)}`);
|
|
178
192
|
if (!command) {
|
|
179
193
|
console.log(chalk_1.default.yellow(`Cannot tell how this copy was installed (${me ?? 'unknown path'}).`));
|
|
180
|
-
console.log(`Run whichever fits:\n npm install -g ${exports.PACKAGE_NAME}@latest\n brew upgrade solidnumber/tap/cli\n scoop update solid`);
|
|
194
|
+
console.log(`Run whichever fits:\n npm install -g ${exports.PACKAGE_NAME}@latest\n brew tap solidnumber/tap && brew upgrade solidnumber/tap/cli\n scoop update solid`);
|
|
181
195
|
return;
|
|
182
196
|
}
|
|
197
|
+
const steps = preflight ? [preflight, command] : [command];
|
|
198
|
+
const recipe = steps.map((s) => s.join(' ')).join(' && ');
|
|
183
199
|
if (opts.check) {
|
|
184
|
-
console.log(`Would run: ${chalk_1.default.cyan(
|
|
200
|
+
console.log(`Would run: ${chalk_1.default.cyan(recipe)}`);
|
|
185
201
|
return;
|
|
186
202
|
}
|
|
203
|
+
// The preflight is plumbing, not news — run it quietly and only speak up if
|
|
204
|
+
// it fails, and even then keep going: the upgrade may not have needed it.
|
|
205
|
+
if (preflight) {
|
|
206
|
+
const tapped = (0, child_process_1.spawnSync)(preflight[0], preflight.slice(1), { stdio: 'ignore' });
|
|
207
|
+
if (tapped.status !== 0) {
|
|
208
|
+
console.log(chalk_1.default.yellow(`(${preflight.join(' ')} did not succeed — trying the upgrade anyway)`));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
187
211
|
console.log(`Running ${chalk_1.default.cyan(command.join(' '))} …\n`);
|
|
188
212
|
const result = (0, child_process_1.spawnSync)(command[0], command.slice(1), { stdio: 'inherit' });
|
|
189
213
|
if (result.status === 0) {
|
|
@@ -191,7 +215,7 @@ exports.updateCommand = new commander_1.Command('update')
|
|
|
191
215
|
return;
|
|
192
216
|
}
|
|
193
217
|
console.log(chalk_1.default.red(`\nThat did not finish (exit ${result.status ?? 'unknown'}).`));
|
|
194
|
-
console.log(`Run it yourself: ${
|
|
218
|
+
console.log(`Run it yourself: ${recipe}`);
|
|
195
219
|
process.exitCode = 1;
|
|
196
220
|
});
|
|
197
221
|
//# sourceMappingURL=update.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":";;;;;;AA4DA,0CA6BC;AAGD,0BAQC;AAGD,sCASC;AAGD,8CAuBC;AA1ID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,iDAA0C;AAC1C,2BAA8C;AAC9C,+BAAuC;AAEvC,kDAA0B;AAC1B,yCAAoC;AAEpC,kDAAgD;AAChD,oDAAkD;AAErC,QAAA,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,QAAQ,GAAG,8BAA8B,oBAAY,SAAS,CAAC;AAuBrE,yFAAyF;AACzF,SAAgB,eAAe,CAAC,IAAmB;IACjD,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1D,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IAEjD,6EAA6E;IAC7E,4EAA4E;IAC5E,gDAAgD;IAChD,EAAE;IACF,uEAAuE;IACvE,oEAAoE;IACpE,8EAA8E;IAC9E,mEAAmE;IACnE,4EAA4E;IAC5E,2EAA2E;IAC3E,oEAAoE;IACpE,IAAI,CAAC,CAAC,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