@solidnumber/cli 2.20.0 → 2.21.1
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 +2 -2
- package/dist/commands/apply.d.ts.map +1 -1
- package/dist/commands/apply.js +11 -1
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +58 -2
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/find.d.ts +16 -0
- package/dist/commands/find.d.ts.map +1 -0
- package/dist/commands/find.js +94 -0
- package/dist/commands/find.js.map +1 -0
- package/dist/commands/map.d.ts +38 -0
- package/dist/commands/map.d.ts.map +1 -0
- package/dist/commands/map.js +119 -0
- package/dist/commands/map.js.map +1 -0
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +17 -4
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/verbs.d.ts.map +1 -1
- package/dist/commands/verbs.js +302 -13
- package/dist/commands/verbs.js.map +1 -1
- package/dist/commands/where.d.ts +13 -0
- package/dist/commands/where.d.ts.map +1 -0
- package/dist/commands/where.js +118 -0
- package/dist/commands/where.js.map +1 -0
- package/dist/index.js +93 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +7 -2
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/apply/engine.d.ts +4 -0
- package/dist/lib/apply/engine.d.ts.map +1 -1
- package/dist/lib/apply/engine.js +13 -6
- package/dist/lib/apply/engine.js.map +1 -1
- package/dist/lib/command-kit.d.ts.map +1 -1
- package/dist/lib/command-kit.js +5 -1
- package/dist/lib/command-kit.js.map +1 -1
- package/dist/lib/dry-run.d.ts +0 -1
- package/dist/lib/dry-run.d.ts.map +1 -1
- package/dist/lib/dry-run.js +0 -1
- package/dist/lib/dry-run.js.map +1 -1
- package/dist/lib/error-codes.d.ts +17 -1
- package/dist/lib/error-codes.d.ts.map +1 -1
- package/dist/lib/error-codes.js +72 -2
- package/dist/lib/error-codes.js.map +1 -1
- package/dist/lib/json-output.d.ts +15 -0
- package/dist/lib/json-output.d.ts.map +1 -1
- package/dist/lib/json-output.js +20 -2
- package/dist/lib/json-output.js.map +1 -1
- package/dist/lib/schema-validate.d.ts +72 -0
- package/dist/lib/schema-validate.d.ts.map +1 -0
- package/dist/lib/schema-validate.js +149 -0
- package/dist/lib/schema-validate.js.map +1 -0
- package/dist/lib/suggest.d.ts +23 -0
- package/dist/lib/suggest.d.ts.map +1 -1
- package/dist/lib/suggest.js +64 -0
- package/dist/lib/suggest.js.map +1 -1
- package/dist/lib/ui.d.ts.map +1 -1
- package/dist/lib/ui.js +20 -3
- package/dist/lib/ui.js.map +1 -1
- package/dist/lib/verb-example.d.ts +67 -0
- package/dist/lib/verb-example.d.ts.map +1 -0
- package/dist/lib/verb-example.js +141 -0
- package/dist/lib/verb-example.js.map +1 -0
- package/dist/lib/verb-search.d.ts +45 -0
- package/dist/lib/verb-search.d.ts.map +1 -0
- package/dist/lib/verb-search.js +266 -0
- package/dist/lib/verb-search.js.map +1 -0
- package/package.json +2 -2
- package/platform-docs/llms.txt +8 -5
package/dist/lib/ui.js
CHANGED
|
@@ -266,14 +266,31 @@ function loginSuccessScreen(args) {
|
|
|
266
266
|
workspace.push(`${chalk_1.default.dim('Role'.padEnd(10))} ${args.role}`);
|
|
267
267
|
lines.push(box(workspace.join('\n'), { title: 'Active workspace', padding: 1 }));
|
|
268
268
|
lines.push('');
|
|
269
|
-
// 4. "Try these next" — the first
|
|
270
|
-
//
|
|
269
|
+
// 4. "Try these next" — the first screen a human sees after logging in, and
|
|
270
|
+
// for most people the only list they will ever read. Ordered by what someone
|
|
271
|
+
// actually does next, not by what we shipped most recently.
|
|
272
|
+
//
|
|
273
|
+
// ⛔ HAND-WRITTEN, AND THAT IS THE BUG THIS KEEPS CAUSING. Nothing adds a
|
|
274
|
+
// command here automatically, so a shipped command stays invisible until
|
|
275
|
+
// somebody types it in. `solid update` existed for weeks before anyone found
|
|
276
|
+
// it; on 2026-09-13 `find`, `map` and `where` had all shipped and none of the
|
|
277
|
+
// three appeared, so the discovery work of an entire sprint was unreachable
|
|
278
|
+
// from the one screen every user reads.
|
|
279
|
+
//
|
|
280
|
+
// KEEP IT SHORT. The temptation on noticing the gap is to list everything —
|
|
281
|
+
// that turns the highest-signal screen in the product into a second --help
|
|
282
|
+
// and it stops being read at all. Seven is about the limit. Earning a place
|
|
283
|
+
// here means displacing something, and `solid --help` stays last because it
|
|
284
|
+
// is the escape hatch.
|
|
271
285
|
lines.push(` ${chalk_1.default.bold('Try these next')}`);
|
|
272
286
|
lines.push('');
|
|
273
287
|
lines.push(commandHelp([
|
|
274
288
|
{ cmd: 'solid ai', desc: 'launch Claude / Cursor with this company loaded' },
|
|
275
|
-
{ cmd: 'solid
|
|
289
|
+
{ cmd: 'solid find "…"', desc: 'say what you want in words — get the exact command' },
|
|
276
290
|
{ cmd: 'solid status', desc: 'your business, at a glance' },
|
|
291
|
+
{ cmd: 'solid switch', desc: 'change to a different company (picker)' },
|
|
292
|
+
{ cmd: 'solid map', desc: 'everything this platform can do, one screen' },
|
|
293
|
+
{ cmd: 'solid update', desc: 'get the latest CLI (npm, Homebrew or scoop)' },
|
|
277
294
|
{ cmd: 'solid --help', desc: 'all commands' },
|
|
278
295
|
]));
|
|
279
296
|
lines.push('');
|
package/dist/lib/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/lib/ui.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GH,8BAGC;AAED,sBAEC;AAED,oBAGC;AAED,0CAQC;AAKD,gCAOC;AAuBD,wBAsBC;AAED,kCAMC;AAED,gCASC;AAOD,gDA0CC;AAED,gCAGC;AAED,4BAGC;AAED,0BAGC;AAED,0BAMC;AAED,wBAEC;AAED,sBAEC;AAED,8BA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C,CAAC;IAClB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,IAAI,GAAG,eAAK,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAEY,QAAA,EAAE,GAAG;IAChB,MAAM;IACN,WAAW;IACX,UAAU;IACV,SAAS;IACT,KAAK;IACL,IAAI;IACJ,eAAe;IACf,UAAU;IACV,kBAAkB;IAClB,UAAU;IACV,QAAQ;IACR,OAAO;IACP,OAAO;IACP,MAAM;IACN,KAAK;IACL,SAAS;IACT,IAAI;IACJ,WAAW;IACX,KAAK;IACL,cAAc;IACd,aAAa;IACb,GAAG;CACJ,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a ready-to-edit call from a verb's declared input_schema.
|
|
3
|
+
*
|
|
4
|
+
* Sprint VNP 4.1. Between "I found the verb" and "I called it correctly" sits
|
|
5
|
+
* a guess: which fields, in what shape. That guess is where most sad paths
|
|
6
|
+
* start, and the manifest already contains everything needed to remove it.
|
|
7
|
+
*
|
|
8
|
+
* Two rules make the output worth pasting rather than merely reading.
|
|
9
|
+
*
|
|
10
|
+
* ⛔ AUTH-INJECTED FIELDS ARE NEVER IN THE EXAMPLE. `company_id` sits in most
|
|
11
|
+
* verbs' `required[]` and is filled by the server — `cli_dispatch` strips it
|
|
12
|
+
* from caller args. An example that includes it teaches an agent to send a
|
|
13
|
+
* field the platform ignores, and the same trap already made a naive 2.3
|
|
14
|
+
* validator report a missing field on nearly every verb. Reuses the one
|
|
15
|
+
* exclusion list from schema-validate so the two can never disagree.
|
|
16
|
+
*
|
|
17
|
+
* ⛔ EVERY PLACEHOLDER IS TYPE-CORRECT. The point of the example is that
|
|
18
|
+
* `--dry-run` on it reaches a real validation answer instead of tripping on
|
|
19
|
+
* the example's own types. A string placeholder is visibly angle-bracketed so
|
|
20
|
+
* nobody mistakes it for a value; numbers and booleans cannot be, which is why
|
|
21
|
+
* `notes` names them explicitly rather than hoping the shape speaks for itself.
|
|
22
|
+
*
|
|
23
|
+
* Pure — no network, no I/O. The command string is assembled here so the JSON
|
|
24
|
+
* and human paths cannot drift.
|
|
25
|
+
*/
|
|
26
|
+
import { type JsonSchema } from './schema-validate';
|
|
27
|
+
/** A property as the manifest declares it. Deliberately loose: the registry
|
|
28
|
+
* carries untyped and enum-only properties and both must survive. */
|
|
29
|
+
export interface SchemaProperty {
|
|
30
|
+
type?: string | string[];
|
|
31
|
+
format?: string;
|
|
32
|
+
enum?: unknown[];
|
|
33
|
+
description?: string;
|
|
34
|
+
items?: {
|
|
35
|
+
type?: string | string[];
|
|
36
|
+
};
|
|
37
|
+
nullable?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface VerbExample {
|
|
40
|
+
verb: string;
|
|
41
|
+
/** The payload, required fields only, every value a typed placeholder. */
|
|
42
|
+
payload: Record<string, unknown>;
|
|
43
|
+
/** Declared optional properties, named but not filled in. */
|
|
44
|
+
optional: string[];
|
|
45
|
+
/** Fields the server supplies; listed so their absence reads as deliberate. */
|
|
46
|
+
injected: string[];
|
|
47
|
+
/** Placeholders a reader could mistake for real values. */
|
|
48
|
+
notes: string[];
|
|
49
|
+
/** Optional fields filled in only because nothing was required. */
|
|
50
|
+
seeded: string[];
|
|
51
|
+
/** The literal command, ready to paste. */
|
|
52
|
+
command: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A placeholder for one property: the right JSON type, and unmistakable as a
|
|
56
|
+
* value wherever the type allows it to be.
|
|
57
|
+
*/
|
|
58
|
+
export declare function placeholderFor(name: string, p?: SchemaProperty): unknown;
|
|
59
|
+
/** Single-quoted for a POSIX shell; embedded quotes are escaped the only way
|
|
60
|
+
* a single-quoted shell string can be. */
|
|
61
|
+
export declare function shellQuote(s: string): string;
|
|
62
|
+
export declare function buildExample(verbName: string, schema?: JsonSchema & {
|
|
63
|
+
properties?: Record<string, SchemaProperty>;
|
|
64
|
+
}, opts?: {
|
|
65
|
+
sideEffects?: string;
|
|
66
|
+
}): VerbExample;
|
|
67
|
+
//# sourceMappingURL=verb-example.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verb-example.d.ts","sourceRoot":"","sources":["../../src/lib/verb-example.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnE;sEACsE;AACtE,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,mEAAmE;IACnE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,GAAE,cAAmB,GAAG,OAAO,CAiC5E;AAED;2CAC2C;AAC3C,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,UAAU,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;CAAO,EACzE,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,WAAW,CA6Db"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.placeholderFor = placeholderFor;
|
|
4
|
+
exports.shellQuote = shellQuote;
|
|
5
|
+
exports.buildExample = buildExample;
|
|
6
|
+
/**
|
|
7
|
+
* Build a ready-to-edit call from a verb's declared input_schema.
|
|
8
|
+
*
|
|
9
|
+
* Sprint VNP 4.1. Between "I found the verb" and "I called it correctly" sits
|
|
10
|
+
* a guess: which fields, in what shape. That guess is where most sad paths
|
|
11
|
+
* start, and the manifest already contains everything needed to remove it.
|
|
12
|
+
*
|
|
13
|
+
* Two rules make the output worth pasting rather than merely reading.
|
|
14
|
+
*
|
|
15
|
+
* ⛔ AUTH-INJECTED FIELDS ARE NEVER IN THE EXAMPLE. `company_id` sits in most
|
|
16
|
+
* verbs' `required[]` and is filled by the server — `cli_dispatch` strips it
|
|
17
|
+
* from caller args. An example that includes it teaches an agent to send a
|
|
18
|
+
* field the platform ignores, and the same trap already made a naive 2.3
|
|
19
|
+
* validator report a missing field on nearly every verb. Reuses the one
|
|
20
|
+
* exclusion list from schema-validate so the two can never disagree.
|
|
21
|
+
*
|
|
22
|
+
* ⛔ EVERY PLACEHOLDER IS TYPE-CORRECT. The point of the example is that
|
|
23
|
+
* `--dry-run` on it reaches a real validation answer instead of tripping on
|
|
24
|
+
* the example's own types. A string placeholder is visibly angle-bracketed so
|
|
25
|
+
* nobody mistakes it for a value; numbers and booleans cannot be, which is why
|
|
26
|
+
* `notes` names them explicitly rather than hoping the shape speaks for itself.
|
|
27
|
+
*
|
|
28
|
+
* Pure — no network, no I/O. The command string is assembled here so the JSON
|
|
29
|
+
* and human paths cannot drift.
|
|
30
|
+
*/
|
|
31
|
+
const schema_validate_1 = require("./schema-validate");
|
|
32
|
+
/** The first declared type, when a property declares a union. */
|
|
33
|
+
function firstType(t) {
|
|
34
|
+
if (Array.isArray(t))
|
|
35
|
+
return t.find((x) => x !== 'null') ?? t[0];
|
|
36
|
+
return t;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A placeholder for one property: the right JSON type, and unmistakable as a
|
|
40
|
+
* value wherever the type allows it to be.
|
|
41
|
+
*/
|
|
42
|
+
function placeholderFor(name, p = {}) {
|
|
43
|
+
// An enum's first member is a real, legal value — better than a placeholder,
|
|
44
|
+
// because it also documents the vocabulary.
|
|
45
|
+
if (Array.isArray(p.enum) && p.enum.length > 0)
|
|
46
|
+
return p.enum[0];
|
|
47
|
+
switch (firstType(p.type)) {
|
|
48
|
+
case 'integer':
|
|
49
|
+
case 'number':
|
|
50
|
+
return 0;
|
|
51
|
+
case 'boolean':
|
|
52
|
+
return false;
|
|
53
|
+
case 'array': {
|
|
54
|
+
const inner = firstType(p.items?.type);
|
|
55
|
+
if (inner === 'integer' || inner === 'number')
|
|
56
|
+
return [0];
|
|
57
|
+
if (inner === 'object')
|
|
58
|
+
return [{}];
|
|
59
|
+
return inner === undefined ? [] : [`<${name}>`];
|
|
60
|
+
}
|
|
61
|
+
case 'object':
|
|
62
|
+
return {};
|
|
63
|
+
case 'null':
|
|
64
|
+
return null;
|
|
65
|
+
case 'string':
|
|
66
|
+
default:
|
|
67
|
+
// Formats an agent would otherwise have to guess the spelling of.
|
|
68
|
+
switch (p.format) {
|
|
69
|
+
case 'date-time': return '2026-01-01T09:00:00Z';
|
|
70
|
+
case 'date': return '2026-01-01';
|
|
71
|
+
case 'email': return 'name@example.com';
|
|
72
|
+
case 'uri':
|
|
73
|
+
case 'url': return 'https://example.com';
|
|
74
|
+
default: return `<${name}>`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/** Single-quoted for a POSIX shell; embedded quotes are escaped the only way
|
|
79
|
+
* a single-quoted shell string can be. */
|
|
80
|
+
function shellQuote(s) {
|
|
81
|
+
return `'${s.replace(/'/g, `'\\''`)}'`;
|
|
82
|
+
}
|
|
83
|
+
function buildExample(verbName, schema = {}, opts = {}) {
|
|
84
|
+
const properties = (schema.properties ?? {});
|
|
85
|
+
const required = (schema.required ?? []).filter((f) => typeof f === 'string');
|
|
86
|
+
const injected = required.filter((f) => schema_validate_1.AUTH_INJECTED.has(f));
|
|
87
|
+
const callerRequired = required.filter((f) => !schema_validate_1.AUTH_INJECTED.has(f));
|
|
88
|
+
const payload = {};
|
|
89
|
+
const notes = [];
|
|
90
|
+
for (const field of callerRequired) {
|
|
91
|
+
const prop = properties[field] ?? {};
|
|
92
|
+
const value = placeholderFor(field, prop);
|
|
93
|
+
payload[field] = value;
|
|
94
|
+
// A `0` or a `false` reads as a decision, not a blank. Say so, once per
|
|
95
|
+
// field, rather than trusting the reader to infer it from the type.
|
|
96
|
+
if (value === 0)
|
|
97
|
+
notes.push(`${field} is a placeholder 0 — replace it with a real ${firstType(prop.type) ?? 'number'}`);
|
|
98
|
+
else if (value === false)
|
|
99
|
+
notes.push(`${field} defaults to false here — set it deliberately`);
|
|
100
|
+
}
|
|
101
|
+
const optional = Object.keys(properties)
|
|
102
|
+
.filter((f) => !required.includes(f) && !schema_validate_1.AUTH_INJECTED.has(f))
|
|
103
|
+
.sort();
|
|
104
|
+
// A verb whose only required field is auth-injected would otherwise hand back
|
|
105
|
+
// `-p '{}'` — technically correct and useless. contact.create is exactly this
|
|
106
|
+
// shape: `company_id` is its sole required field, and the seven fields an
|
|
107
|
+
// agent actually needs are all optional. Seed a few so the example is a call
|
|
108
|
+
// rather than an empty object, and say which they are so nobody reads them as
|
|
109
|
+
// mandatory.
|
|
110
|
+
//
|
|
111
|
+
// ⛔ Seed in DECLARATION order, not the sorted order `optional` is displayed
|
|
112
|
+
// in. Schema authors list the fields that matter first: contact.create
|
|
113
|
+
// declares `name, email, phone, company_name, source, contact_type,
|
|
114
|
+
// custom_fields`, so alphabetical seeding picked company_name, contact_type
|
|
115
|
+
// and custom_fields — the three least useful fields it has. Sorting is right
|
|
116
|
+
// for a list a human scans and wrong for a choice about significance.
|
|
117
|
+
//
|
|
118
|
+
// Containers are skipped: `{}` or `[]` in an example teaches nothing about
|
|
119
|
+
// what belongs inside them.
|
|
120
|
+
const seeded = [];
|
|
121
|
+
if (callerRequired.length === 0) {
|
|
122
|
+
const candidates = Object.keys(properties).filter((f) => {
|
|
123
|
+
if (required.includes(f) || schema_validate_1.AUTH_INJECTED.has(f))
|
|
124
|
+
return false;
|
|
125
|
+
const t = firstType(properties[f]?.type);
|
|
126
|
+
return t !== 'object' && t !== 'array';
|
|
127
|
+
});
|
|
128
|
+
for (const field of candidates.slice(0, 3)) {
|
|
129
|
+
payload[field] = placeholderFor(field, properties[field] ?? {});
|
|
130
|
+
seeded.push(field);
|
|
131
|
+
}
|
|
132
|
+
if (seeded.length) {
|
|
133
|
+
notes.push(`no field is required beyond auth — ${seeded.join(', ')} are optional, seeded so this is a call you can run`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const writes = opts.sideEffects !== undefined && opts.sideEffects !== 'read';
|
|
137
|
+
const command = `solid verbs invoke ${verbName} -p ${shellQuote(JSON.stringify(payload))}` +
|
|
138
|
+
` --dry-run${writes ? ' # then swap --dry-run for --confirm' : ''}`;
|
|
139
|
+
return { verb: verbName, payload, optional, injected, seeded, notes, command };
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=verb-example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verb-example.js","sourceRoot":"","sources":["../../src/lib/verb-example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Today the only route from intent to a callable
|
|
6
|
+
* name is reading all 845 verbs, which is 315,898 tokens after 1.1 and was
|
|
7
|
+
* 486,986 before. This turns that into one ~120-token answer.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately lexical, not semantic. The descriptions average ~170 characters
|
|
10
|
+
* and are unusually specific, so plain term matching over name + description
|
|
11
|
+
* lands well, and it ships against the manifest exactly as it stands — no
|
|
12
|
+
* embeddings to build, no model to call, no index to keep in sync. It is also
|
|
13
|
+
* the honest baseline: if this is not good enough we will be able to say so
|
|
14
|
+
* with a number instead of a hunch.
|
|
15
|
+
*
|
|
16
|
+
* Pure. No I/O, no env, no clock — the ranking is unit-testable on its own.
|
|
17
|
+
*/
|
|
18
|
+
export interface SearchableVerb {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
side_effects?: string;
|
|
22
|
+
/** Canonical twin, when this verb is the non-canonical half of a pair. */
|
|
23
|
+
same_as?: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface VerbMatch {
|
|
26
|
+
name: string;
|
|
27
|
+
score: number;
|
|
28
|
+
description: string;
|
|
29
|
+
side_effects: string;
|
|
30
|
+
/** Internal: the canonical twin, used to collapse duplicate pairs. */
|
|
31
|
+
canonicalOf?: string | null;
|
|
32
|
+
}
|
|
33
|
+
/** Split a phrase into meaningful lowercase terms. */
|
|
34
|
+
export declare function terms(query: string): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Rank verbs against a plain-language query.
|
|
37
|
+
*
|
|
38
|
+
* Returns at most `limit` matches, best first, with a 0..1 score. Verbs
|
|
39
|
+
* matching no term at all are dropped — a ranked list of things that do not
|
|
40
|
+
* match is worse than an empty one, because it invites a confident wrong pick.
|
|
41
|
+
*/
|
|
42
|
+
export declare function rankVerbs(query: string, verbs: readonly SearchableVerb[], limit?: number): VerbMatch[];
|
|
43
|
+
/** Trim a description to a budget without cutting mid-word. */
|
|
44
|
+
export declare function clip(text: string, max?: number): string;
|
|
45
|
+
//# sourceMappingURL=verb-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verb-search.d.ts","sourceRoot":"","sources":["../../src/lib/verb-search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA+DH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,sDAAsD;AACtD,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAK7C;AAwCD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,KAAK,SAAI,GACR,SAAS,EAAE,CA6Fb;AAsCD,+DAA+D;AAC/D,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,MAAM,CAKnD"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Lexical ranking over the verb manifest.
|
|
4
|
+
*
|
|
5
|
+
* Sprint VNP 2.1. An agent arrives with a sentence, not a location — "refund a
|
|
6
|
+
* payment", not "class 420". Today the only route from intent to a callable
|
|
7
|
+
* name is reading all 845 verbs, which is 315,898 tokens after 1.1 and was
|
|
8
|
+
* 486,986 before. This turns that into one ~120-token answer.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately lexical, not semantic. The descriptions average ~170 characters
|
|
11
|
+
* and are unusually specific, so plain term matching over name + description
|
|
12
|
+
* lands well, and it ships against the manifest exactly as it stands — no
|
|
13
|
+
* embeddings to build, no model to call, no index to keep in sync. It is also
|
|
14
|
+
* the honest baseline: if this is not good enough we will be able to say so
|
|
15
|
+
* with a number instead of a hunch.
|
|
16
|
+
*
|
|
17
|
+
* Pure. No I/O, no env, no clock — the ranking is unit-testable on its own.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.terms = terms;
|
|
21
|
+
exports.rankVerbs = rankVerbs;
|
|
22
|
+
exports.clip = clip;
|
|
23
|
+
/** Words that carry no signal in a capability search. */
|
|
24
|
+
const STOPWORDS = new Set([
|
|
25
|
+
'a', 'an', 'and', 'are', 'as', 'at', 'be', 'by', 'can', 'do', 'for', 'from',
|
|
26
|
+
'how', 'i', 'in', 'is', 'it', 'me', 'my', 'of', 'on', 'or', 'that', 'the',
|
|
27
|
+
'this', 'to', 'want', 'was', 'what', 'when', 'where', 'which', 'with',
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* Owner vocabulary -> platform vocabulary.
|
|
31
|
+
*
|
|
32
|
+
* ⛔ THIS IS THE BIGGEST SINGLE WIN AND IT IS NOT A SCORING TWEAK. Measured
|
|
33
|
+
* 2026-09-13: "Add a new customer" returned `phone.external_add`, because the
|
|
34
|
+
* owner says *customer* and the verb says *contact*, the owner says *add* and
|
|
35
|
+
* the verb says *create*. `contact.create` matched NEITHER query term, scoring
|
|
36
|
+
* zero, while `external_add` matched "add" as a whole name segment for six
|
|
37
|
+
* points. No weighting fixes that — the words simply never meet.
|
|
38
|
+
*
|
|
39
|
+
* Kept small and one-directional on purpose. Every entry is a word a business
|
|
40
|
+
* owner actually uses for a thing the platform names differently; none is a
|
|
41
|
+
* guess about intent. A synonym that is merely *related* ("money" -> "invoice")
|
|
42
|
+
* would drag every financial query toward whichever verb has the longest
|
|
43
|
+
* description, so relatedness is not enough — it has to be the same thing.
|
|
44
|
+
*/
|
|
45
|
+
const SYNONYMS = {
|
|
46
|
+
customer: ['contact', 'client'],
|
|
47
|
+
customers: ['contact', 'contacts'],
|
|
48
|
+
client: ['contact'],
|
|
49
|
+
clients: ['contacts'],
|
|
50
|
+
add: ['create'],
|
|
51
|
+
new: ['create'],
|
|
52
|
+
make: ['create'],
|
|
53
|
+
text: ['sms'],
|
|
54
|
+
texting: ['sms'],
|
|
55
|
+
job: ['order', 'appointment'],
|
|
56
|
+
jobs: ['orders', 'appointments'],
|
|
57
|
+
booking: ['appointment'],
|
|
58
|
+
owed: ['outstanding', 'receivable'],
|
|
59
|
+
owe: ['outstanding', 'receivable'],
|
|
60
|
+
unpaid: ['outstanding', 'overdue'],
|
|
61
|
+
staff: ['team', 'user'],
|
|
62
|
+
apprentice: ['team', 'user'],
|
|
63
|
+
employee: ['team', 'user'],
|
|
64
|
+
website: ['site', 'page'],
|
|
65
|
+
webpage: ['page'],
|
|
66
|
+
post: ['blog'],
|
|
67
|
+
stock: ['inventory'],
|
|
68
|
+
quote: ['proposal', 'deal'],
|
|
69
|
+
called: ['call'],
|
|
70
|
+
ring: ['call'],
|
|
71
|
+
chase: ['followup', 'follow'],
|
|
72
|
+
note: ['notes'],
|
|
73
|
+
refund: ['refund'],
|
|
74
|
+
};
|
|
75
|
+
/** A query term plus anything the platform calls the same thing. */
|
|
76
|
+
function expand(term) {
|
|
77
|
+
const extra = SYNONYMS[term];
|
|
78
|
+
return extra ? [term, ...extra] : [term];
|
|
79
|
+
}
|
|
80
|
+
/** Split a phrase into meaningful lowercase terms. */
|
|
81
|
+
function terms(query) {
|
|
82
|
+
return query
|
|
83
|
+
.toLowerCase()
|
|
84
|
+
.split(/[^a-z0-9]+/)
|
|
85
|
+
.filter((t) => t.length > 1 && !STOPWORDS.has(t));
|
|
86
|
+
}
|
|
87
|
+
/** The pieces of a verb name: "payment.refund" -> ["payment", "refund"]. */
|
|
88
|
+
function nameSegments(name) {
|
|
89
|
+
return name.toLowerCase().split(/[._]/).filter(Boolean);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Score one verb against one term.
|
|
93
|
+
*
|
|
94
|
+
* The weights encode a simple claim: a term appearing in the NAME is far
|
|
95
|
+
* stronger evidence than the same term appearing in prose, because a name is
|
|
96
|
+
* chosen and a description merely mentions. "refund" in `payment.refund` means
|
|
97
|
+
* the verb refunds; "refund" in a description may only mean it is refund-aware
|
|
98
|
+
* (`payments.preview_refund_impact` is a read).
|
|
99
|
+
*/
|
|
100
|
+
function scoreTerm(term, segs, nameLower, desc) {
|
|
101
|
+
let best = 0;
|
|
102
|
+
const variants = expand(term);
|
|
103
|
+
for (let i = 0; i < variants.length; i++) {
|
|
104
|
+
const t = variants[i];
|
|
105
|
+
let s = 0;
|
|
106
|
+
if (segs.includes(t)) {
|
|
107
|
+
s += 6; // whole segment: payment.REFUND
|
|
108
|
+
}
|
|
109
|
+
else if (nameLower.includes(t)) {
|
|
110
|
+
s += 3; // inside a segment: preview_REFUND_impact
|
|
111
|
+
}
|
|
112
|
+
if (desc.includes(t)) {
|
|
113
|
+
// Word boundary, so "pay" does not score against "payment".
|
|
114
|
+
s += new RegExp(`\\b${t}\\b`).test(desc) ? 2 : 0.5;
|
|
115
|
+
}
|
|
116
|
+
// A synonym is weaker evidence than the word the caller actually typed.
|
|
117
|
+
// Without this discount "add" would match `create` as strongly as `add`,
|
|
118
|
+
// and a verb literally named *_add would lose to one merely about creating.
|
|
119
|
+
if (i > 0)
|
|
120
|
+
s *= 0.8;
|
|
121
|
+
if (s > best)
|
|
122
|
+
best = s;
|
|
123
|
+
}
|
|
124
|
+
return best;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Rank verbs against a plain-language query.
|
|
128
|
+
*
|
|
129
|
+
* Returns at most `limit` matches, best first, with a 0..1 score. Verbs
|
|
130
|
+
* matching no term at all are dropped — a ranked list of things that do not
|
|
131
|
+
* match is worse than an empty one, because it invites a confident wrong pick.
|
|
132
|
+
*/
|
|
133
|
+
function rankVerbs(query, verbs, limit = 5) {
|
|
134
|
+
const qTerms = terms(query);
|
|
135
|
+
if (qTerms.length === 0)
|
|
136
|
+
return [];
|
|
137
|
+
/**
|
|
138
|
+
* ⛔ WEIGHT EACH TERM BY HOW RARE IT IS. Without this, every word in the
|
|
139
|
+
* query counted the same and a sentence was worse than a keyword: measured
|
|
140
|
+
* 2026-09-13, "A customer wants a refund on a payment they made" returned
|
|
141
|
+
* `payment.refund` correctly, and the SAME sentence plus "Work out how to do
|
|
142
|
+
* that." returned `payment.full_history`. Five filler words flipped it,
|
|
143
|
+
* because coverage was `matched / qTerms.length` — unmatched noise punished
|
|
144
|
+
* the right verb in exact proportion to how much noise there was.
|
|
145
|
+
*
|
|
146
|
+
* A term appearing in 300 of 845 verbs carries almost no information; one
|
|
147
|
+
* appearing in 3 decides the query. Standard IDF, and it is what lets a
|
|
148
|
+
* prompt be a sentence rather than a keyword — which is how an agent (and an
|
|
149
|
+
* owner) actually asks.
|
|
150
|
+
*/
|
|
151
|
+
const df = new Map();
|
|
152
|
+
for (const t of qTerms) {
|
|
153
|
+
let n = 0;
|
|
154
|
+
for (const v of verbs) {
|
|
155
|
+
const hay = `${v.name} ${v.description || ''}`.toLowerCase();
|
|
156
|
+
if (expand(t).some((x) => hay.includes(x)))
|
|
157
|
+
n++;
|
|
158
|
+
}
|
|
159
|
+
df.set(t, n);
|
|
160
|
+
}
|
|
161
|
+
const N = Math.max(1, verbs.length);
|
|
162
|
+
/**
|
|
163
|
+
* ⛔ CAP THE RARITY BONUS, AND DROP TERMS THAT MATCH NOTHING.
|
|
164
|
+
*
|
|
165
|
+
* Uncapped IDF made things worse, not better — measured: top-3 fell 16/20 to
|
|
166
|
+
* 13/20. The reason is that a real query is full of PROPER NOUNS and VALUES:
|
|
167
|
+
* "Dana", "Whitfield", "4471", "£450". Those are the rarest terms in any
|
|
168
|
+
* query by a distance, so pure IDF hands them the loudest voice — and
|
|
169
|
+
* whichever unrelated verb happens to mention a digit or a name in its
|
|
170
|
+
* description wins. Rarity is a proxy for informativeness, and for names it
|
|
171
|
+
* is exactly the wrong proxy.
|
|
172
|
+
*
|
|
173
|
+
* df === 0 the term matches no verb at all. It is a value, not a
|
|
174
|
+
* capability. Excluded entirely: keeping it in the denominator
|
|
175
|
+
* only scales every candidate down by the same amount, and
|
|
176
|
+
* excluding it makes coverage mean what it says.
|
|
177
|
+
* cap 2.2 ~ a term in 90 of 845 verbs. Beyond that, rarer stops earning
|
|
178
|
+
* more, so "refund" and "Whitfield" cannot outrank each other on
|
|
179
|
+
* scarcity alone.
|
|
180
|
+
*/
|
|
181
|
+
const IDF_CAP = 2.2;
|
|
182
|
+
const scoring = qTerms.filter((t) => (df.get(t) ?? 0) > 0);
|
|
183
|
+
const useTerms = scoring.length ? scoring : qTerms; // never rank on nothing
|
|
184
|
+
const idf = (t) => Math.min(IDF_CAP, Math.max(0.15, Math.log((N + 1) / ((df.get(t) ?? 0) + 1))));
|
|
185
|
+
const totalIdf = useTerms.reduce((a, t) => a + idf(t), 0) || 1;
|
|
186
|
+
// Best achievable score for this query, used to normalize.
|
|
187
|
+
const perfect = totalIdf * 8;
|
|
188
|
+
const scored = [];
|
|
189
|
+
for (const v of verbs) {
|
|
190
|
+
const nameLower = v.name.toLowerCase();
|
|
191
|
+
const segs = nameSegments(v.name);
|
|
192
|
+
const desc = (v.description || '').toLowerCase();
|
|
193
|
+
let raw = 0;
|
|
194
|
+
let matchedIdf = 0;
|
|
195
|
+
let matched = 0;
|
|
196
|
+
for (const t of useTerms) {
|
|
197
|
+
const s = scoreTerm(t, segs, nameLower, desc);
|
|
198
|
+
if (s > 0) {
|
|
199
|
+
matched++;
|
|
200
|
+
matchedIdf += idf(t);
|
|
201
|
+
}
|
|
202
|
+
raw += s * idf(t);
|
|
203
|
+
}
|
|
204
|
+
if (matched === 0)
|
|
205
|
+
continue;
|
|
206
|
+
// Covering the terms that MATTER beats covering the most terms. Weighted
|
|
207
|
+
// by IDF, so failing to match "the" costs nothing and failing to match
|
|
208
|
+
// "refund" costs almost everything.
|
|
209
|
+
raw *= matchedIdf / totalIdf;
|
|
210
|
+
// Nudge shorter names up. Between two equal matches the more specific
|
|
211
|
+
// name is nearly always the one meant.
|
|
212
|
+
raw *= 1 + 0.05 / segs.length;
|
|
213
|
+
scored.push({
|
|
214
|
+
name: v.name,
|
|
215
|
+
score: Math.min(1, Number((raw / perfect).toFixed(2))),
|
|
216
|
+
description: v.description || '',
|
|
217
|
+
side_effects: v.side_effects || 'read',
|
|
218
|
+
canonicalOf: v.same_as ?? null,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
scored.sort((a, b) => b.score - a.score || a.name.length - b.name.length);
|
|
222
|
+
return collapseDuplicates(scored).slice(0, limit);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Collapse the 71 duplicate pairs to their canonical half.
|
|
226
|
+
*
|
|
227
|
+
* Without this, "book an appointment" spends three of its five slots on
|
|
228
|
+
* appointment.book, appointment_book and healthcare_appointment_book, all
|
|
229
|
+
* scoring 1.00 — which hands the agent exactly the coin-flip that `same_as`
|
|
230
|
+
* exists to remove, and buries three genuinely different verbs that would
|
|
231
|
+
* have been more useful.
|
|
232
|
+
*
|
|
233
|
+
* Prefers `same_as` when the manifest carries it. It does not yet in
|
|
234
|
+
* production — the field is committed but undeployed — so this falls back to
|
|
235
|
+
* the same rule the pairs were counted with: two names are the same operation
|
|
236
|
+
* when they match after dots become underscores. The fallback is not a guess;
|
|
237
|
+
* it is the definition.
|
|
238
|
+
*/
|
|
239
|
+
function collapseDuplicates(matches) {
|
|
240
|
+
const bestByOperation = new Map();
|
|
241
|
+
const order = [];
|
|
242
|
+
for (const m of matches) {
|
|
243
|
+
const key = (m.canonicalOf ?? m.name).replace(/\./g, '_').toLowerCase();
|
|
244
|
+
const held = bestByOperation.get(key);
|
|
245
|
+
if (!held) {
|
|
246
|
+
bestByOperation.set(key, m);
|
|
247
|
+
order.push(key);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
// The dotted name is canonical: it is the one with a real REST route.
|
|
251
|
+
const heldIsCanonical = held.name.includes('.');
|
|
252
|
+
const mineIsCanonical = m.name.includes('.');
|
|
253
|
+
if (mineIsCanonical && !heldIsCanonical)
|
|
254
|
+
bestByOperation.set(key, m);
|
|
255
|
+
}
|
|
256
|
+
return order.map((k) => bestByOperation.get(k));
|
|
257
|
+
}
|
|
258
|
+
/** Trim a description to a budget without cutting mid-word. */
|
|
259
|
+
function clip(text, max = 90) {
|
|
260
|
+
if (text.length <= max)
|
|
261
|
+
return text;
|
|
262
|
+
const cut = text.slice(0, max);
|
|
263
|
+
const lastSpace = cut.lastIndexOf(' ');
|
|
264
|
+
return `${cut.slice(0, lastSpace > 40 ? lastSpace : max).trimEnd()}…`;
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=verb-search.js.map
|