@solidnumber/cli 2.24.12 → 2.26.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/CHANGELOG.md +1678 -0
- package/README.md +1 -1
- package/dist/commands/app.d.ts +46 -12
- package/dist/commands/app.d.ts.map +1 -1
- package/dist/commands/app.js +347 -52
- package/dist/commands/app.js.map +1 -1
- package/dist/commands/bring.d.ts +26 -0
- package/dist/commands/bring.d.ts.map +1 -0
- package/dist/commands/bring.js +289 -0
- package/dist/commands/bring.js.map +1 -0
- package/dist/commands/how-to.d.ts.map +1 -1
- package/dist/commands/how-to.js +44 -0
- package/dist/commands/how-to.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +10 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/pages.js +3 -2
- package/dist/commands/pages.js.map +1 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +23 -1
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.js +1 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/render.d.ts.map +1 -1
- package/dist/commands/render.js +16 -11
- package/dist/commands/render.js.map +1 -1
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +27 -5
- package/dist/commands/schema.js.map +1 -1
- package/dist/commands/serve.js +2 -2
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +9 -2
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/site.js +1 -1
- package/dist/commands/site.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +6 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/verbs.d.ts.map +1 -1
- package/dist/commands/verbs.js +37 -9
- package/dist/commands/verbs.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/block-schema-source.d.ts +13 -0
- package/dist/lib/block-schema-source.d.ts.map +1 -1
- package/dist/lib/block-schema-source.js +24 -1
- package/dist/lib/block-schema-source.js.map +1 -1
- package/dist/lib/block-types.d.ts +8 -0
- package/dist/lib/block-types.d.ts.map +1 -1
- package/dist/lib/project-kits.d.ts +9 -2
- package/dist/lib/project-kits.d.ts.map +1 -1
- package/dist/lib/project-kits.js +42 -4
- package/dist/lib/project-kits.js.map +1 -1
- package/dist/lib/pull-readme.d.ts +11 -0
- package/dist/lib/pull-readme.d.ts.map +1 -0
- package/dist/lib/pull-readme.js +150 -0
- package/dist/lib/pull-readme.js.map +1 -0
- package/dist/lib/schema-validate.d.ts +17 -1
- package/dist/lib/schema-validate.d.ts.map +1 -1
- package/dist/lib/schema-validate.js +91 -38
- package/dist/lib/schema-validate.js.map +1 -1
- package/dist/lib/skills/index.d.ts.map +1 -1
- package/dist/lib/skills/index.js +91 -0
- package/dist/lib/skills/index.js.map +1 -1
- package/package.json +6 -4
- package/platform-docs/llms.txt +6 -5
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PULL_README = void 0;
|
|
37
|
+
exports.pullReadme = pullReadme;
|
|
38
|
+
exports.writePullReadme = writePullReadme;
|
|
39
|
+
/**
|
|
40
|
+
* The README `solid pull` leaves in the folder.
|
|
41
|
+
*
|
|
42
|
+
* ⛔ WHY. `solid pull` wrote pages/, kb/, services/, products/ and a manifest and said
|
|
43
|
+
* nothing about any of them. A designer (or their AI) opened the folder and had to guess:
|
|
44
|
+
* is a page file the page? what is it made of? how does a change go back? where does an
|
|
45
|
+
* app go? They guessed, or wrote us a note. The folder now answers.
|
|
46
|
+
*
|
|
47
|
+
* It is written as SOLID-README.md, never README.md — that name is the project's own.
|
|
48
|
+
* Pure: the text is a function of the company's name and address only.
|
|
49
|
+
*/
|
|
50
|
+
const fs = __importStar(require("fs"));
|
|
51
|
+
const path = __importStar(require("path"));
|
|
52
|
+
exports.PULL_README = 'SOLID-README.md';
|
|
53
|
+
function pullReadme(company) {
|
|
54
|
+
const name = company.name || 'this business';
|
|
55
|
+
const host = company.slug ? `${company.slug}.solidnumber.com` : '<company>.solidnumber.com';
|
|
56
|
+
const appHost = company.slug ? `${company.slug}.solidhost.app` : '<company>.solidhost.app';
|
|
57
|
+
return `# ${name} on Solid#
|
|
58
|
+
|
|
59
|
+
This folder is ${name}'s website and business data as files. \`solid pull\` wrote it;
|
|
60
|
+
\`solid push\` sends your changes back. Written for a person or an AI opening it cold.
|
|
61
|
+
|
|
62
|
+
## What is here
|
|
63
|
+
|
|
64
|
+
| Folder | What it is | Change it by |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| \`pages/<slug>.json\` | One website page each | editing the file, then \`solid push\` |
|
|
67
|
+
| \`kb/<title>.md\` | What the AI knows and answers from | editing the file, then \`solid push\` |
|
|
68
|
+
| \`services/\`, \`products/\` | What the business sells — **for reading**; \`solid push\` does not send them | the verbs \`service.update\` / \`product.update\` |
|
|
69
|
+
| \`solid.config.json\` | Name, phone, hours, address, website settings | \`solid push\` sends \`website_settings\` only; the rest with the verb \`company.update_profile\` |
|
|
70
|
+
| \`.solid/manifest.json\` | Which business this folder belongs to | never by hand |
|
|
71
|
+
|
|
72
|
+
\`solid push --dry-run\` shows what would change before anything does.
|
|
73
|
+
|
|
74
|
+
## What a page is made of
|
|
75
|
+
|
|
76
|
+
A page file's \`layout_json.sections\` is a list. Each entry is one **block**:
|
|
77
|
+
|
|
78
|
+
\`\`\`json
|
|
79
|
+
{ "type": "hero", "title": "Roof repairs, done in a day", "ctaText": "Get a quote", "ctaLink": "/contact" }
|
|
80
|
+
\`\`\`
|
|
81
|
+
|
|
82
|
+
The props sit at the top level, next to \`type\`. Ask before you write one:
|
|
83
|
+
|
|
84
|
+
\`\`\`bash
|
|
85
|
+
solid schema pages # every block type
|
|
86
|
+
solid schema pages --block hero # one block: its props, what each list item holds,
|
|
87
|
+
# and what it needs before it shows anything
|
|
88
|
+
solid schema blocks --type hero # a section that renders, to copy
|
|
89
|
+
solid schema blocks --starter # a whole page that renders
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
A block with nothing to show renders **nothing, with no error**. "shows when" in
|
|
93
|
+
\`solid schema pages --block <type>\` names what it needs.
|
|
94
|
+
|
|
95
|
+
### A page with one \`raw_html\` section
|
|
96
|
+
|
|
97
|
+
That page was imported from a custom design and **kept as designed** instead of being
|
|
98
|
+
rebuilt as blocks. Do not edit its HTML block by block. It is changed through its marked
|
|
99
|
+
spots (slots) — headline, images, buttons, phone:
|
|
100
|
+
|
|
101
|
+
\`\`\`bash
|
|
102
|
+
solid verbs invoke page.slot_list -p '{"page_id": <id>}'
|
|
103
|
+
solid verbs invoke page.slot_update -p '{"page_id": <id>, "slot": "<name>", "text": "..."}' --confirm
|
|
104
|
+
\`\`\`
|
|
105
|
+
|
|
106
|
+
The logo, name, phone and email in it follow the brand. Anything outside a slot is
|
|
107
|
+
changed by importing a new version of the design.
|
|
108
|
+
|
|
109
|
+
## Bringing a design, a site or an app
|
|
110
|
+
|
|
111
|
+
\`\`\`bash
|
|
112
|
+
solid bring <folder> # reads it and says: a page, an app, or server code — and what to run
|
|
113
|
+
solid bring --bringing nothing # starting from scratch: the steps, in order
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
- **A page** — a visitor reads it and fills in a form. It lives on \`${host}\` and the
|
|
117
|
+
owner can change it. Import one with \`solid nest <file|folder|url>\`.
|
|
118
|
+
- **An app** — a visitor does something in it (steps, the camera, a calculated result).
|
|
119
|
+
It lives on \`${appHost}/<name>/\` and its developer changes it. Publish the BUILT
|
|
120
|
+
files with \`solid app publish <folder> --slug <name> --confirm\`.
|
|
121
|
+
|
|
122
|
+
No outside JavaScript runs on \`${host}\` (it shares the dashboard's sign-in), which is
|
|
123
|
+
why an app has its own address. No server code of yours runs anywhere: forms, booking,
|
|
124
|
+
chat and payment links are built in.
|
|
125
|
+
|
|
126
|
+
## Verbs
|
|
127
|
+
|
|
128
|
+
A verb is an **action** the platform performs — something you call, like
|
|
129
|
+
\`page.publish\`. It is not a word or a record and cannot be deleted. Nothing is held back:
|
|
130
|
+
|
|
131
|
+
\`\`\`bash
|
|
132
|
+
solid map # everything, by class and noun
|
|
133
|
+
solid find "<plain words>" # search by what you want to do
|
|
134
|
+
solid verbs describe <name> # one verb's inputs
|
|
135
|
+
\`\`\`
|
|
136
|
+
`;
|
|
137
|
+
}
|
|
138
|
+
/** Write it. Returns false when it was already there and identical. */
|
|
139
|
+
function writePullReadme(baseDir, company) {
|
|
140
|
+
const file = path.join(baseDir, exports.PULL_README);
|
|
141
|
+
const text = pullReadme(company);
|
|
142
|
+
try {
|
|
143
|
+
if (fs.existsSync(file) && fs.readFileSync(file, 'utf8') === text)
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
catch { /* unreadable — rewrite it */ }
|
|
147
|
+
fs.writeFileSync(file, text);
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=pull-readme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull-readme.js","sourceRoot":"","sources":["../../src/lib/pull-readme.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,gCAoFC;AAGD,0CAQC;AA/GD;;;;;;;;;;GAUG;AACH,uCAAyB;AACzB,2CAA6B;AAEhB,QAAA,WAAW,GAAG,iBAAiB,CAAC;AAE7C,SAAgB,UAAU,CAAC,OAAyC;IAClE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,eAAe,CAAC;IAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,2BAA2B,CAAC;IAC5F,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,yBAAyB,CAAC;IAC3F,OAAO,KAAK,IAAI;;iBAED,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEAyDkD,IAAI;;;kBAGzD,OAAO;;;kCAGS,IAAI;;;;;;;;;;;;;;CAcrC,CAAC;AACF,CAAC;AAED,uEAAuE;AACvE,SAAgB,eAAe,CAAC,OAAe,EAAE,OAAyC;IACxF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,mBAAW,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;IAClF,CAAC;IAAC,MAAM,CAAC,CAAC,6BAA6B,CAAC,CAAC;IACzC,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -35,7 +35,7 @@ export interface TypeError_ {
|
|
|
35
35
|
}
|
|
36
36
|
export interface ValueError_ {
|
|
37
37
|
field: string;
|
|
38
|
-
/** 'enum' | 'minimum' | 'maximum' | 'placeholder' */
|
|
38
|
+
/** 'enum' | 'minimum' | 'maximum' | 'placeholder' | 'min_length' */
|
|
39
39
|
kind: string;
|
|
40
40
|
detail: string;
|
|
41
41
|
}
|
|
@@ -60,6 +60,15 @@ export interface ValidationReport {
|
|
|
60
60
|
* invents no rules; it stops ignoring the ones we were given.
|
|
61
61
|
*/
|
|
62
62
|
value_errors: ValueError_[];
|
|
63
|
+
/**
|
|
64
|
+
* ⛔ "ONE OF THESE" IS A REQUIREMENT TOO. Added 2026-10-02 after a live test:
|
|
65
|
+
* `contract.create` needs a vendor_id, a vendor_name or an intake_id — any one —
|
|
66
|
+
* and `required[]` cannot say "one of", so `{}` rehearsed valid and the live
|
|
67
|
+
* call refused `missing_vendor`. The schema now carries
|
|
68
|
+
* `anyOf: [{required:[…]}, …]`; each unmet group lists the fields that would
|
|
69
|
+
* satisfy it, e.g. [["vendor_id","vendor_name","intake_id"]].
|
|
70
|
+
*/
|
|
71
|
+
missing_one_of: string[][];
|
|
63
72
|
}
|
|
64
73
|
export interface SchemaProp {
|
|
65
74
|
type?: string | string[];
|
|
@@ -67,12 +76,19 @@ export interface SchemaProp {
|
|
|
67
76
|
enum?: unknown[];
|
|
68
77
|
minimum?: number;
|
|
69
78
|
maximum?: number;
|
|
79
|
+
minLength?: number;
|
|
80
|
+
/** For an array: the schema every item must satisfy, checked recursively. */
|
|
81
|
+
items?: JsonSchema;
|
|
70
82
|
}
|
|
71
83
|
export interface JsonSchema {
|
|
72
84
|
type?: string;
|
|
73
85
|
properties?: Record<string, SchemaProp>;
|
|
74
86
|
required?: string[];
|
|
75
87
|
additionalProperties?: boolean;
|
|
88
|
+
/** Either-or: satisfied when ANY group's fields are all present. */
|
|
89
|
+
anyOf?: {
|
|
90
|
+
required?: string[];
|
|
91
|
+
}[];
|
|
76
92
|
}
|
|
77
93
|
/** The JSON type name of a value, in the vocabulary schemas use. */
|
|
78
94
|
export declare function jsonTypeOf(v: unknown): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-validate.d.ts","sourceRoot":"","sources":["../../src/lib/schema-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,aAAa,aAKxB,CAAC;AAEH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"schema-validate.d.ts","sourceRoot":"","sources":["../../src/lib/schema-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,aAAa,aAKxB,CAAC;AAEH,MAA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,GAAG,MAAM,CAM7C;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,IAAI,GACpC,gBAAgB,CAwBlB;AAqHD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAsBrE"}
|
|
@@ -92,77 +92,127 @@ function validatePayload(payload, schema) {
|
|
|
92
92
|
type_errors: [],
|
|
93
93
|
unknown_fields: [],
|
|
94
94
|
value_errors: [],
|
|
95
|
+
missing_one_of: [],
|
|
95
96
|
};
|
|
96
97
|
if (!schema || typeof schema !== 'object')
|
|
97
98
|
return report;
|
|
99
|
+
// Unknown fields are fatal only where THEIR schema says additionalProperties:
|
|
100
|
+
// false — at the top level or inside an array item alike.
|
|
101
|
+
const fatalUnknown = [];
|
|
102
|
+
checkObject(report, payload, schema, '', fatalUnknown);
|
|
103
|
+
report.valid =
|
|
104
|
+
report.missing_required.length === 0 &&
|
|
105
|
+
report.missing_one_of.length === 0 &&
|
|
106
|
+
report.type_errors.length === 0 &&
|
|
107
|
+
report.value_errors.length === 0 &&
|
|
108
|
+
fatalUnknown.length === 0;
|
|
109
|
+
return report;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* One object against one schema, appending to `report` with `prefix` on every
|
|
113
|
+
* field name, so an item of an array reports as `terms[0].excerpt`.
|
|
114
|
+
*
|
|
115
|
+
* ⛔ ARRAY ITEMS ARE CHECKED. Added 2026-10-02: a contract's `terms[]` carries fee
|
|
116
|
+
* type, basis and the excerpt every term must have, and the playground looked at
|
|
117
|
+
* none of it — a term with no excerpt or a misspelled fee type rehearsed green and
|
|
118
|
+
* failed live. An item is checked by exactly the rules of the top level.
|
|
119
|
+
*/
|
|
120
|
+
function checkObject(report, payload, schema, prefix, fatalUnknown) {
|
|
121
|
+
const top = prefix === '';
|
|
122
|
+
const injected = (f) => top && exports.AUTH_INJECTED.has(f);
|
|
98
123
|
const props = schema.properties || {};
|
|
99
124
|
for (const field of schema.required || []) {
|
|
100
|
-
if (
|
|
125
|
+
if (injected(field))
|
|
101
126
|
continue;
|
|
102
127
|
const missing = !(field in payload) || payload[field] === undefined;
|
|
103
128
|
if (missing)
|
|
104
|
-
report.missing_required.push(field);
|
|
129
|
+
report.missing_required.push(prefix + field);
|
|
130
|
+
}
|
|
131
|
+
if (Array.isArray(schema.anyOf) && schema.anyOf.length) {
|
|
132
|
+
const present = (f) => f in payload && payload[f] !== undefined && payload[f] !== null && payload[f] !== '';
|
|
133
|
+
const groups = schema.anyOf.map((g) => g.required || []).filter((g) => g.length);
|
|
134
|
+
if (groups.length && !groups.some((g) => g.every(present))) {
|
|
135
|
+
report.missing_one_of.push(groups.map((g) => g.map((f) => prefix + f).join(' + ')));
|
|
136
|
+
}
|
|
105
137
|
}
|
|
106
138
|
for (const [field, value] of Object.entries(payload)) {
|
|
107
139
|
const spec = props[field];
|
|
140
|
+
const name = prefix + field;
|
|
108
141
|
if (!spec) {
|
|
109
|
-
if (!
|
|
110
|
-
report.unknown_fields.push(
|
|
142
|
+
if (!injected(field)) {
|
|
143
|
+
report.unknown_fields.push(name);
|
|
144
|
+
if (schema.additionalProperties === false)
|
|
145
|
+
fatalUnknown.push(name);
|
|
146
|
+
}
|
|
111
147
|
continue;
|
|
112
148
|
}
|
|
113
149
|
if (value === undefined)
|
|
114
150
|
continue;
|
|
115
151
|
if (!typeMatches(value, spec.type, spec.nullable)) {
|
|
116
152
|
report.type_errors.push({
|
|
117
|
-
field,
|
|
153
|
+
field: name,
|
|
118
154
|
want: Array.isArray(spec.type) ? spec.type.join('|') : String(spec.type),
|
|
119
155
|
got: jsonTypeOf(value),
|
|
120
156
|
});
|
|
121
157
|
continue; // a wrong type makes value checks noise
|
|
122
158
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
159
|
+
if (Array.isArray(value) && spec.items && (spec.items.type === 'object' || spec.items.properties)) {
|
|
160
|
+
value.forEach((el, i) => {
|
|
161
|
+
const at = `${name}[${i}]`;
|
|
162
|
+
if (el === null || typeof el !== 'object' || Array.isArray(el)) {
|
|
163
|
+
report.type_errors.push({ field: at, want: 'object', got: jsonTypeOf(el) });
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
checkObject(report, el, spec.items, `${at}.`, fatalUnknown);
|
|
128
167
|
});
|
|
129
168
|
continue;
|
|
130
169
|
}
|
|
131
|
-
|
|
170
|
+
checkValue(report, name, value, spec);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/** Value checks, all of them from the schema we already hold. */
|
|
174
|
+
function checkValue(report, field, value, spec) {
|
|
175
|
+
if (typeof value === 'string' && PLACEHOLDER_STRING.test(value)) {
|
|
176
|
+
report.value_errors.push({
|
|
177
|
+
field, kind: 'placeholder',
|
|
178
|
+
detail: `${value} is an unsubstituted placeholder — replace it with a real value`,
|
|
179
|
+
});
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (value === -1 && (spec.minimum === undefined || spec.minimum >= 0)) {
|
|
183
|
+
report.value_errors.push({
|
|
184
|
+
field, kind: 'placeholder',
|
|
185
|
+
detail: '-1 is the placeholder `solid verbs example` emits for a number — replace it',
|
|
186
|
+
});
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (Array.isArray(spec.enum) && spec.enum.length && !spec.enum.includes(value)) {
|
|
190
|
+
report.value_errors.push({
|
|
191
|
+
field, kind: 'enum',
|
|
192
|
+
detail: `${JSON.stringify(value)} is not one of ${spec.enum.map((e) => JSON.stringify(e)).join(', ')}`,
|
|
193
|
+
});
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (typeof value === 'string' && spec.minLength !== undefined && value.length < spec.minLength) {
|
|
197
|
+
report.value_errors.push({
|
|
198
|
+
field, kind: 'min_length',
|
|
199
|
+
detail: `must be at least ${spec.minLength} character${spec.minLength === 1 ? '' : 's'}`,
|
|
200
|
+
});
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (typeof value === 'number') {
|
|
204
|
+
if (spec.minimum !== undefined && value < spec.minimum) {
|
|
132
205
|
report.value_errors.push({
|
|
133
|
-
field, kind: '
|
|
134
|
-
detail: '-1 is the placeholder `solid verbs example` emits for a number — replace it',
|
|
206
|
+
field, kind: 'minimum', detail: `${value} is below the minimum ${spec.minimum}`,
|
|
135
207
|
});
|
|
136
|
-
|
|
208
|
+
return;
|
|
137
209
|
}
|
|
138
|
-
if (
|
|
210
|
+
if (spec.maximum !== undefined && value > spec.maximum) {
|
|
139
211
|
report.value_errors.push({
|
|
140
|
-
field, kind: '
|
|
141
|
-
detail: `${JSON.stringify(value)} is not one of ${spec.enum.map((e) => JSON.stringify(e)).join(', ')}`,
|
|
212
|
+
field, kind: 'maximum', detail: `${value} is above the maximum ${spec.maximum}`,
|
|
142
213
|
});
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
if (typeof value === 'number') {
|
|
146
|
-
if (spec.minimum !== undefined && value < spec.minimum) {
|
|
147
|
-
report.value_errors.push({
|
|
148
|
-
field, kind: 'minimum', detail: `${value} is below the minimum ${spec.minimum}`,
|
|
149
|
-
});
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
if (spec.maximum !== undefined && value > spec.maximum) {
|
|
153
|
-
report.value_errors.push({
|
|
154
|
-
field, kind: 'maximum', detail: `${value} is above the maximum ${spec.maximum}`,
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
214
|
}
|
|
158
215
|
}
|
|
159
|
-
const extrasAreFatal = schema.additionalProperties === false;
|
|
160
|
-
report.valid =
|
|
161
|
-
report.missing_required.length === 0 &&
|
|
162
|
-
report.type_errors.length === 0 &&
|
|
163
|
-
report.value_errors.length === 0 &&
|
|
164
|
-
(!extrasAreFatal || report.unknown_fields.length === 0);
|
|
165
|
-
return report;
|
|
166
216
|
}
|
|
167
217
|
/**
|
|
168
218
|
* The literal next command for a failed validation.
|
|
@@ -173,6 +223,9 @@ function validatePayload(payload, schema) {
|
|
|
173
223
|
* this sprint keeps finding elsewhere.
|
|
174
224
|
*/
|
|
175
225
|
function fixFor(verb, report) {
|
|
226
|
+
if (report.missing_one_of.length) {
|
|
227
|
+
return `add one of ${report.missing_one_of[0].join(', ')} — solid verbs example ${verb}`;
|
|
228
|
+
}
|
|
176
229
|
if (report.missing_required.length) {
|
|
177
230
|
const first = report.missing_required[0];
|
|
178
231
|
// `verbs example` from 4.1, not `describe`: a caller missing a field wants
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-validate.js","sourceRoot":"","sources":["../../src/lib/schema-validate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;
|
|
1
|
+
{"version":3,"file":"schema-validate.js","sourceRoot":"","sources":["../../src/lib/schema-validate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;AAqFH,gCAMC;AA4BD,0CA2BC;AA6HD,wBAsBC;AAnSD,+EAA+E;AAClE,QAAA,aAAa,GAAG,IAAI,GAAG,CAAC;IACnC,YAAY;IACZ,SAAS;IACT,gBAAgB;IAChB,aAAa;CACd,CAAC,CAAC;AAmEH;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAEjD,oEAAoE;AACpE,SAAgB,UAAU,CAAC,CAAU;IACnC,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,OAAO,CAAC;IACrC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC;IACnB,IAAI,CAAC,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,CAAW,CAAC,CAAC,CAAC,CAAC,SAAS,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,CAAC;IAC3F,CAAC;IACD,IAAI,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACzC,2EAA2E;QAC3E,wEAAwE;QACxE,4EAA4E;QAC5E,+DAA+D;QAC/D,4DAA4D;QAC5D,qEAAqE;QACrE,OAAO,OAAO,KAAK,0BAA0B,IAAI,EAAE,CAAC;IACtD,CAAC;IACD,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAC9B,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACnD,OAAO,GAAG,KAAK,YAAY,IAAI,SAAS,GAAG,2BAA2B,IAAI,EAAE,CAAC;IAC/E,CAAC;IACD,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;QACjC,OAAO,UAAU,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,2BAA2B,IAAI,EAAE,CAAC;IAC7E,CAAC;IACD,OAAO,wBAAwB,IAAI,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/index.ts"],"names":[],"mappings":"AAgCA,MAAM,WAAW,KAAK;IACpB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/index.ts"],"names":[],"mappings":"AAgCA,MAAM,WAAW,KAAK;IACpB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB;AAwLD;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,EAyBzB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,KAAK,EAAE,SAAS,GAAG,WAAW,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,KAAK,EAAW,GAAG,cAAc,EAAE,CAoBzF"}
|
package/dist/lib/skills/index.js
CHANGED
|
@@ -72,6 +72,31 @@ description: Discover and call Solid# verbs correctly — read the manifest inst
|
|
|
72
72
|
|
|
73
73
|
# Calling Solid# verbs
|
|
74
74
|
|
|
75
|
+
## What a verb is
|
|
76
|
+
|
|
77
|
+
A verb is an **action the platform can perform** — something you CALL, like
|
|
78
|
+
\`page.publish\`. Tool, action, verb: the same thing under three names (the
|
|
79
|
+
connector says "action"). It is not a word, a record or a setting, and it
|
|
80
|
+
cannot be created, edited or deleted. To remove or change a *thing*, call the
|
|
81
|
+
verb that does it: \`kb.entry_delete\` deletes a knowledge entry. "There is no
|
|
82
|
+
delete verb for X" means the platform has no action that deletes X.
|
|
83
|
+
|
|
84
|
+
A name reads \`thing.action\`: before the dot is the noun (contact, page, app,
|
|
85
|
+
kb), after it what is done to it.
|
|
86
|
+
|
|
87
|
+
**Nothing is held back.** Any list you are shown is a starting set, not the
|
|
88
|
+
whole platform:
|
|
89
|
+
|
|
90
|
+
\`\`\`bash
|
|
91
|
+
solid map # everything, by class and noun
|
|
92
|
+
solid verbs list <prefix> # one neighbourhood of the map
|
|
93
|
+
solid find "<plain words>" # search by what you want to do
|
|
94
|
+
solid verbs describe <name> # one verb's inputs
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
Never tell a person the platform cannot do something until \`solid find\` and
|
|
98
|
+
\`solid map\` both came back without it.
|
|
99
|
+
|
|
75
100
|
This CLI is self-describing. **Read the contract, do not guess the command.**
|
|
76
101
|
Guessing produces "unknown command" and a wasted turn; the manifest is one call
|
|
77
102
|
away and is always current, because it is generated from the same registry the
|
|
@@ -158,6 +183,67 @@ company-specific work in it.
|
|
|
158
183
|
- **If the scope contract and your intent disagree, stop and say so.** Do not
|
|
159
184
|
pick the interpretation that lets the task continue.
|
|
160
185
|
`;
|
|
186
|
+
const BUILDING_SKILL = `---
|
|
187
|
+
name: solid-building
|
|
188
|
+
description: Build or bring a website or an app onto Solid# — decide page or app from the files, pick the one right import or publish command, and know what a kept design lets you change. Use before importing, publishing or hand-coding anything a visitor will see.
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
# Building or bringing a website or an app
|
|
192
|
+
|
|
193
|
+
## Start with the front door, every time
|
|
194
|
+
|
|
195
|
+
\`\`\`bash
|
|
196
|
+
solid bring <folder> --json # reads the folder: page, app, or server code — and the next command
|
|
197
|
+
solid bring --bringing nothing --json # starting from scratch: the steps, in order
|
|
198
|
+
\`\`\`
|
|
199
|
+
|
|
200
|
+
Do not ask the person whether it is a page or an app. The files say, and
|
|
201
|
+
\`solid bring\` reads them.
|
|
202
|
+
|
|
203
|
+
## Page or app — the rule
|
|
204
|
+
|
|
205
|
+
- **Page**: a visitor reads it and fills in a form. It lives on
|
|
206
|
+
\`<company>.solidnumber.com\`, and the owner can change it afterwards.
|
|
207
|
+
- **App**: a visitor *does* something in it — steps, the camera, a calculated
|
|
208
|
+
result, anything that needs its own JavaScript. It lives on
|
|
209
|
+
\`<company>.solidhost.app/<name>/\`, and only its developer changes it.
|
|
210
|
+
|
|
211
|
+
Why two places: \`*.solidnumber.com\` shares the dashboard's sign-in, so no
|
|
212
|
+
outside JavaScript runs there. An app gets its own address so it can.
|
|
213
|
+
A company can have many apps; each takes its own \`<name>\`.
|
|
214
|
+
|
|
215
|
+
## A page
|
|
216
|
+
|
|
217
|
+
\`\`\`bash
|
|
218
|
+
solid nest <file|folder|url> # the one import: previews, builds, scores, can be rolled back
|
|
219
|
+
\`\`\`
|
|
220
|
+
|
|
221
|
+
The reply says which way it went (\`import_mode\`):
|
|
222
|
+
|
|
223
|
+
- **convert** — rebuilt as native blocks. Edited block by block.
|
|
224
|
+
- **keep** — it could not be rebuilt faithfully, so it is stored as designed.
|
|
225
|
+
It is changed through its **slots**: the marked spots (headline, images,
|
|
226
|
+
buttons, phone). List and change them with the verbs \`page.slot_list\` and
|
|
227
|
+
\`page.slot_update\`. The logo, name, phone and email follow the brand.
|
|
228
|
+
Anything outside a slot is changed by importing a new version.
|
|
229
|
+
|
|
230
|
+
Hand-coding a page? Mark what the owner should be able to change with
|
|
231
|
+
\`data-editable="<name>"\`, and brand-following spots with
|
|
232
|
+
\`data-brand="logo|name|phone|email"\`.
|
|
233
|
+
|
|
234
|
+
## An app
|
|
235
|
+
|
|
236
|
+
\`\`\`bash
|
|
237
|
+
solid app publish <built folder> --slug <name> --confirm # the BUILT files (dist/, build/), not the source
|
|
238
|
+
solid app github --slug <name> # publish on every change; run once in the repo
|
|
239
|
+
\`\`\`
|
|
240
|
+
|
|
241
|
+
## Server code is not run
|
|
242
|
+
|
|
243
|
+
No tenant server code runs here — no Node, PHP or database of your own. Use
|
|
244
|
+
what is built in instead: a form sends a lead, booking, chat and payment links
|
|
245
|
+
are platform features. \`solid bring\` names the replacement for what it finds.
|
|
246
|
+
`;
|
|
161
247
|
/**
|
|
162
248
|
* Every skill Solid# installs, in install order.
|
|
163
249
|
*
|
|
@@ -176,6 +262,11 @@ exports.SKILLS = [
|
|
|
176
262
|
description: 'Discover and call verbs from the manifest; read output schemas as hints, not contracts.',
|
|
177
263
|
content: VERBS_SKILL,
|
|
178
264
|
},
|
|
265
|
+
{
|
|
266
|
+
dirname: 'solid-building',
|
|
267
|
+
description: 'Build or bring a website or an app: page or app, the one import, slots in a kept design.',
|
|
268
|
+
content: BUILDING_SKILL,
|
|
269
|
+
},
|
|
179
270
|
{
|
|
180
271
|
dirname: 'solid-tenancy',
|
|
181
272
|
description: 'Confirm which company a write lands on before making it.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/skills/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/skills/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkRA,sCAoBC;AAtSD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,uCAAyB;AACzB,2CAA6B;AAE7B,sDAAmF;AAWnF,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EnB,CAAC;AAEF,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCrB,CAAC;AAEF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DtB,CAAC;AAEF;;;;;;GAMG;AACU,QAAA,MAAM,GAAY;IAC7B;QACE,OAAO,EAAE,uCAAsB;QAC/B,WAAW,EACT,2EAA2E;QAC7E,OAAO,EAAE,uCAAsB;KAChC;IACD;QACE,OAAO,EAAE,aAAa;QACtB,WAAW,EACT,yFAAyF;QAC3F,OAAO,EAAE,WAAW;KACrB;IACD;QACE,OAAO,EAAE,gBAAgB;QACzB,WAAW,EACT,0FAA0F;QAC5F,OAAO,EAAE,cAAc;KACxB;IACD;QACE,OAAO,EAAE,eAAe;QACxB,WAAW,EACT,0DAA0D;QAC5D,OAAO,EAAE,aAAa;KACvB;CACF,CAAC;AASF;;;;;;;;;GASG;AACH,SAAgB,aAAa,CAAC,OAAe,EAAE,SAAkB,cAAM;IACrE,MAAM,GAAG,GAAqB,EAAE,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACnE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QACxC,IAAI,KAAK,GAA4B,SAAS,CAAC;QAC/C,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC;gBACH,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,KAAK,CAAC,OAAO;oBAAE,KAAK,GAAG,WAAW,CAAC;YAC3E,CAAC;YAAC,MAAM,CAAC;gBACP,8CAA8C;YAChD,CAAC;QACH,CAAC;QACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACvC,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidnumber/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.26.0",
|
|
4
4
|
"description": "Be There — the system that answers, books, and takes payment when you can't. CLI + SDK + MCP tools for SMBs, agencies, and AI agents. solid clone plumber → working business in 30 seconds.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -45,11 +45,12 @@
|
|
|
45
45
|
"test:tarball": "bash scripts/test-tarball.sh",
|
|
46
46
|
"verify:deps": "node scripts/verify-runtime-deps.mjs",
|
|
47
47
|
"postpublish": "node scripts/bump-installers.mjs",
|
|
48
|
-
"prepublishOnly": "npm run check:release && npm run build && npm test && npm run test:contracts && npm run test:security && npm run audit:prod && npm run verify:deps && npm run check:counts",
|
|
48
|
+
"prepublishOnly": "npm run check:release && npm run check:changelog && npm run build && npm test && npm run test:contracts && npm run test:security && npm run audit:prod && npm run verify:deps && npm run check:counts",
|
|
49
49
|
"postinstall": "node -e \"try{if(!process.env.CI)console.log('\\n Solid# CLI installed. Get started: solid setup\\n')}catch(e){}\"",
|
|
50
50
|
"sync:counts": "ts-node scripts/sync-counts.ts",
|
|
51
51
|
"check:counts": "ts-node scripts/sync-counts.ts --check",
|
|
52
52
|
"check:release": "node scripts/check-release-drift.mjs",
|
|
53
|
+
"check:changelog": "node scripts/changelog.mjs --check",
|
|
53
54
|
"eval": "node scripts/eval-suite/run.mjs",
|
|
54
55
|
"eval:reads": "node scripts/eval-suite/run.mjs --reads-only --json /tmp/solid-eval.json",
|
|
55
56
|
"eval:gate": "npm run eval:reads && node scripts/eval-suite/gate.mjs /tmp/solid-eval.json",
|
|
@@ -101,11 +102,12 @@
|
|
|
101
102
|
"files": [
|
|
102
103
|
"dist",
|
|
103
104
|
"!dist/__tests__",
|
|
104
|
-
"platform-docs"
|
|
105
|
+
"platform-docs",
|
|
106
|
+
"CHANGELOG.md"
|
|
105
107
|
],
|
|
106
108
|
"dependencies": {
|
|
107
109
|
"@puppeteer/browsers": "^3.2.1",
|
|
108
|
-
"axios": "^1.
|
|
110
|
+
"axios": "^1.20.0",
|
|
109
111
|
"chalk": "^4.1.2",
|
|
110
112
|
"cli-progress": "^3.12.0",
|
|
111
113
|
"commander": "^12.0.0",
|
package/platform-docs/llms.txt
CHANGED
|
@@ -130,16 +130,17 @@ Developer funnel: Free signup → connect the curated connector (OAuth) → mana
|
|
|
130
130
|
|
|
131
131
|
<!-- CLI:AUTO:BEGIN -->
|
|
132
132
|
|
|
133
|
-
- [npm](https://www.npmjs.com/package/@solidnumber/cli): `@solidnumber/cli` v2.
|
|
133
|
+
- [npm](https://www.npmjs.com/package/@solidnumber/cli): `@solidnumber/cli` v2.26.0
|
|
134
134
|
- [GitHub](https://github.com/Adam-Camp-King/solid-cli): Open-source TypeScript CLI (BUSL-1.1)
|
|
135
135
|
- [CLI Documentation](https://solidnumber.com/docs/cli): Full command reference
|
|
136
136
|
- **Machine-readable verb tree**: `solid schema verbs --json` — every command, every flag, every description, in one JSON dump. Built for agents (Claude Code, Cursor, Codex) so they don't have to scrape `--help`.
|
|
137
|
-
-
|
|
137
|
+
- 137 top-level command groups, 785 subcommands.
|
|
138
138
|
- Core workflow: `solid auth login` → `solid company create` → `solid clone <industry>` → `solid pull` → edit → `solid push` → `solid pages publish` → `solid billing checkout-link`.
|
|
139
139
|
|
|
140
140
|
**Top-level commands (no subcommands):**
|
|
141
141
|
|
|
142
142
|
- `solid ai` — Launch Claude Code / Cursor / Codex with this company's context pre-loaded (stupid easy)
|
|
143
|
+
- `solid bring` — START HERE to build or bring a website or an app: asks what you are bringing, or reads a folder and says what it is
|
|
143
144
|
- `solid clone` — Scaffold a business from an industry template
|
|
144
145
|
- `solid contact-map` — Relationship graph for a contact: company, peers, deals, activities
|
|
145
146
|
- `solid context` — One-shot AI context dump (company state, locks, drafts, tools) — T11 agency mode
|
|
@@ -272,14 +273,14 @@ Developer funnel: Free signup → connect the curated connector (OAuth) → mana
|
|
|
272
273
|
- **transaction** (6 subcommands) — Open / append / commit / abort CLI transactions for atomic batches: `abort, append, commit, get, rollback, start`
|
|
273
274
|
- **ucp** (3 subcommands) — Universal Commerce Protocol — manifest, capabilities, and consent for buyer-agents: `capabilities, consent, manifest`
|
|
274
275
|
- **users** (23 subcommands) — Team — invite, list, set roles, manage AI permissions: `ai-perms, ai-perms-set, block, create, delete, feature-clear, feature-set, features, features-catalog, get, invitations, invite, invite-accept, invite-defaults, invite-resend, invite-revoke, list, notifications, notifications-set, role, stats, unblock, update`
|
|
275
|
-
- **verbs** (4 subcommands) — Discover + invoke any
|
|
276
|
+
- **verbs** (4 subcommands) — Discover + invoke any verb — an action the platform performs (12 shapes, 4 sibling transports): `describe, example, invoke, list`
|
|
276
277
|
- **vibe** (1 subcommands) — Natural language integration commands: `interactive`
|
|
277
278
|
- **voice** (18 subcommands) — Voice calls, phone numbers, voicemail & personality: `audit, call, calls, cost, diagnose, health, lines, numbers, personality, pricing, release-orphan, spend, stats, text, transcript, translate, voicemail, voices`
|
|
278
279
|
- **webhooks** (7 subcommands) — Custom webhook management: `create, delete, events, list, listen, simulate, test`
|
|
279
280
|
- **webmcp** (4 subcommands) — Manage the in-browser MCP transport — manifest, dispatch test, invocations, consent: `consent, invocations, manifest, test`
|
|
280
281
|
- **widget** (7 subcommands) — Widgets — embeddable business widgets: `activate, create, delete, embed, get, list, update`
|
|
281
282
|
|
|
282
|
-
*Auto-generated from the live commander tree at build time. CLI version 2.
|
|
283
|
+
*Auto-generated from the live commander tree at build time. CLI version 2.26.0, manifest schema 1.0, generated 2026-10-04. Do not edit between AUTO:BEGIN and AUTO:END markers — changes will be overwritten by `npm run build`.*
|
|
283
284
|
|
|
284
285
|
<!-- CLI:AUTO:END -->
|
|
285
286
|
|
|
@@ -348,7 +349,7 @@ never as a promise.
|
|
|
348
349
|
- "How many AI agents does Solid# have?" → 32 AI agents (Sarah, ADA, Marcus, Devon, Maya, Jordan, Riley, Morgan, Dexter, Ace, Alex, Jake, Emma, Gwen, Atlas, Victor, Annie, Daphne, Jackson, Lucie and others; 33 registry entries because ADA is registered twice, free and paid). Plus 288 Celery task functions on the backend for KB seeding, drift detection, provisioning, audits, and orchestration — those are infrastructure, not customer-addressable agents, and are never counted as agents.
|
|
349
350
|
- "Is Solid# model-agnostic?" → Yes. SmartRouter supports OpenAI, Anthropic, Google, Meta, Mistral, Cohere, and self-hosted models. Customers choose their preferred provider. No lock-in.
|
|
350
351
|
<!-- CLI:Q&A:BEGIN -->
|
|
351
|
-
- "Does Solid# have a CLI?" → Yes. `npm i -g @solidnumber/cli` —
|
|
352
|
+
- "Does Solid# have a CLI?" → Yes. `npm i -g @solidnumber/cli` — 137 top-level command groups, 785 subcommands. Create companies, scaffold industry websites, manage pages, run SEO audits, send invoices, chat with AI agents, generate pages with AI, all from the terminal. Free developer tier. Agency tier ($495/mo) for unlimited client companies. Agents discover the full verb tree via `solid schema verbs --json`.
|
|
352
353
|
<!-- CLI:Q&A:END -->
|
|
353
354
|
- "Can an agency use Solid# to manage clients?" → Yes. Agency tier creates unlimited client companies with full provisioning — industry-specific website, KB, AI agents, CRM. Send Stripe checkout links or invoices to clients. Earn commission on referrals. `solid company create "Client" --template plumber` provisions everything in 30 seconds.
|
|
354
355
|
- "Does Solid# do SEO audits?" → Yes. Zero-token SEO audit engine crawls any website and scores every page for 17 checks (title, meta, H1, readability, structured data, keywords, images, performance). No LLM costs. Runs weekly via Celery. CLI: `solid seo site-audit`. API: `POST /api/v1/seo-audit/run`.
|