@solidnumber/cli 2.21.1 → 2.23.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/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +119 -0
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/audit.js +3 -3
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/blog.js +1 -1
- package/dist/commands/blog.js.map +1 -1
- package/dist/commands/chains.js +1 -1
- package/dist/commands/chains.js.map +1 -1
- package/dist/commands/company.js +1 -1
- package/dist/commands/company.js.map +1 -1
- package/dist/commands/design.d.ts.map +1 -1
- package/dist/commands/design.js +12 -4
- package/dist/commands/design.js.map +1 -1
- package/dist/commands/dev.js +3 -3
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.js +117 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/droplet.js +1 -1
- package/dist/commands/droplet.js.map +1 -1
- package/dist/commands/emails.js +1 -1
- package/dist/commands/emails.js.map +1 -1
- package/dist/commands/find.d.ts.map +1 -1
- package/dist/commands/find.js +18 -2
- package/dist/commands/find.js.map +1 -1
- package/dist/commands/health.js +3 -3
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/how-to.d.ts +12 -1
- package/dist/commands/how-to.d.ts.map +1 -1
- package/dist/commands/how-to.js +69 -11
- package/dist/commands/how-to.js.map +1 -1
- package/dist/commands/inbound.js +1 -1
- package/dist/commands/inbound.js.map +1 -1
- package/dist/commands/inventory.js +2 -2
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/onboarding.js +1 -1
- package/dist/commands/onboarding.js.map +1 -1
- package/dist/commands/pages.js +132 -2
- package/dist/commands/pages.js.map +1 -1
- package/dist/commands/payment.js +2 -2
- package/dist/commands/payment.js.map +1 -1
- package/dist/commands/sandbox.d.ts.map +1 -1
- package/dist/commands/sandbox.js +23 -0
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/commands/site.js +1 -1
- package/dist/commands/site.js.map +1 -1
- package/dist/commands/storage.js +1 -1
- package/dist/commands/storage.js.map +1 -1
- package/dist/commands/subscriptions.js +2 -2
- package/dist/commands/subscriptions.js.map +1 -1
- package/dist/commands/switch.js +1 -1
- package/dist/commands/switch.js.map +1 -1
- package/dist/commands/users.js +4 -4
- package/dist/commands/users.js.map +1 -1
- package/dist/commands/verbs.js +4 -0
- package/dist/commands/verbs.js.map +1 -1
- package/dist/commands/visual.js +1 -1
- package/dist/commands/visual.js.map +1 -1
- package/dist/commands/widgets.js +1 -1
- package/dist/commands/widgets.js.map +1 -1
- package/dist/index.js +97 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +3 -1
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/apply/registry.js +1 -1
- package/dist/lib/apply/registry.js.map +1 -1
- package/dist/lib/command-kit.d.ts +16 -17
- package/dist/lib/command-kit.d.ts.map +1 -1
- package/dist/lib/command-kit.js +53 -1
- package/dist/lib/command-kit.js.map +1 -1
- package/dist/lib/config.d.ts +12 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +14 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/list-envelope.d.ts +20 -5
- package/dist/lib/list-envelope.d.ts.map +1 -1
- package/dist/lib/list-envelope.js +53 -5
- package/dist/lib/list-envelope.js.map +1 -1
- package/dist/lib/schema-validate.d.ts +30 -4
- package/dist/lib/schema-validate.d.ts.map +1 -1
- package/dist/lib/schema-validate.js +46 -0
- package/dist/lib/schema-validate.js.map +1 -1
- package/dist/lib/skills/index.d.ts +34 -0
- package/dist/lib/skills/index.d.ts.map +1 -0
- package/dist/lib/skills/index.js +218 -0
- package/dist/lib/skills/index.js.map +1 -0
- package/dist/lib/skills/plugin.d.ts +106 -0
- package/dist/lib/skills/plugin.d.ts.map +1 -0
- package/dist/lib/skills/plugin.js +187 -0
- package/dist/lib/skills/plugin.js.map +1 -0
- package/dist/lib/telemetry.d.ts +1 -1
- package/dist/lib/telemetry.d.ts.map +1 -1
- package/dist/lib/telemetry.js.map +1 -1
- package/dist/lib/tenant-warn.d.ts +12 -0
- package/dist/lib/tenant-warn.d.ts.map +1 -1
- package/dist/lib/tenant-warn.js +39 -4
- package/dist/lib/tenant-warn.js.map +1 -1
- package/dist/lib/verb-example.d.ts.map +1 -1
- package/dist/lib/verb-example.js +34 -15
- package/dist/lib/verb-example.js.map +1 -1
- package/dist/lib/verb-search.d.ts +56 -1
- package/dist/lib/verb-search.d.ts.map +1 -1
- package/dist/lib/verb-search.js +391 -6
- package/dist/lib/verb-search.js.map +1 -1
- package/package.json +7 -3
- package/platform-docs/ai.txt +53 -30
- package/platform-docs/llms.txt +55 -14
|
@@ -0,0 +1,218 @@
|
|
|
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.SKILLS = void 0;
|
|
37
|
+
exports.installSkills = installSkills;
|
|
38
|
+
/**
|
|
39
|
+
* The skills index — what Solid# teaches a coding agent about itself.
|
|
40
|
+
*
|
|
41
|
+
* ⛔ WHY AN INDEX AND NOT MORE ONE-OFFS. `solid-commerce` was installed by a
|
|
42
|
+
* single call buried inside `solid context --claude`. It worked, but it meant
|
|
43
|
+
* the only way to gain a skill was to add another hard-coded call at another
|
|
44
|
+
* call site, and there was no way to ask "what skills are there?" — not from
|
|
45
|
+
* the CLI, not from an agent, not from us. One more skill written that way
|
|
46
|
+
* would have made three copies of the same install logic.
|
|
47
|
+
*
|
|
48
|
+
* A skill here is the Agent Skills standard and nothing invented: a directory
|
|
49
|
+
* under `.claude/skills/<name>/` holding a `SKILL.md` whose YAML frontmatter
|
|
50
|
+
* carries `name` and `description`. Claude Code and anything else that reads
|
|
51
|
+
* that layout picks them up with no further wiring. Matching the standard is
|
|
52
|
+
* the entire point — a bespoke format would need a bespoke reader.
|
|
53
|
+
*
|
|
54
|
+
* ⛔ ROLE-2 BOUNDARY. These files describe ONE company's platform and land in
|
|
55
|
+
* a tenant-bound directory only. Callers must clear `requireTenantManifest`
|
|
56
|
+
* first, exactly as `commerce-skill.ts` documents: never `$HOME`, never
|
|
57
|
+
* `$HOME/.claude/`, never the platform monorepo.
|
|
58
|
+
*
|
|
59
|
+
* ⚠️ EVERY COMMAND NAMED IN A SKILL BELOW WAS CHECKED TO EXIST. A skill that
|
|
60
|
+
* teaches an agent a command we do not ship is worse than no skill: the agent
|
|
61
|
+
* runs it, gets "unknown command", and distrusts the rest of the file. `solid
|
|
62
|
+
* pin` and `solid use` read naturally and are NOT real — they were cut for
|
|
63
|
+
* that reason.
|
|
64
|
+
*/
|
|
65
|
+
const fs = __importStar(require("fs"));
|
|
66
|
+
const path = __importStar(require("path"));
|
|
67
|
+
const commerce_skill_1 = require("../commerce-skill");
|
|
68
|
+
const VERBS_SKILL = `---
|
|
69
|
+
name: solid-verbs
|
|
70
|
+
description: Discover and call Solid# verbs correctly — read the manifest instead of guessing command names, check what a verb returns before chaining it, and know which calls mutate state. Use before running any solid command you have not run in this session.
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
# Calling Solid# verbs
|
|
74
|
+
|
|
75
|
+
This CLI is self-describing. **Read the contract, do not guess the command.**
|
|
76
|
+
Guessing produces "unknown command" and a wasted turn; the manifest is one call
|
|
77
|
+
away and is always current, because it is generated from the same registry the
|
|
78
|
+
server dispatches from.
|
|
79
|
+
|
|
80
|
+
## Find the verb
|
|
81
|
+
|
|
82
|
+
\`\`\`bash
|
|
83
|
+
solid schema verbs --json # every command, its options and arguments
|
|
84
|
+
solid schema describe <verb> # one verb: input, output, errors, mutates flag
|
|
85
|
+
solid schema contracts --json # all contracts at once, for a tool manifest
|
|
86
|
+
\`\`\`
|
|
87
|
+
|
|
88
|
+
Use \`--reads-only\` or \`--mutates-only\` on \`contracts\` to separate the safe
|
|
89
|
+
calls from the ones that change something.
|
|
90
|
+
|
|
91
|
+
## Know what comes back before you chain
|
|
92
|
+
|
|
93
|
+
\`solid schema envelopes\` gives the response shape per command type. Individual
|
|
94
|
+
verbs also publish an \`output_schema\`.
|
|
95
|
+
|
|
96
|
+
⚠️ **An output schema is a hint, not a contract.** Where it is marked
|
|
97
|
+
\`x-solid-derivation: inferred-from-return-literals\`, the keys were recovered by
|
|
98
|
+
reading the verb's source, not by observing a response. So:
|
|
99
|
+
|
|
100
|
+
- no key is guaranteed present — check before you index into it;
|
|
101
|
+
- the list may be incomplete — \`additionalProperties\` is true;
|
|
102
|
+
- value types are unknown.
|
|
103
|
+
|
|
104
|
+
Treat those keys as "worth looking for", never as a promise. A verb with no
|
|
105
|
+
inferred schema is not broken; its shape simply could not be read statically.
|
|
106
|
+
|
|
107
|
+
## Reads and writes are not the same risk
|
|
108
|
+
|
|
109
|
+
Every contract carries a \`mutates\` flag. A mutating verb may also require an
|
|
110
|
+
explicit confirmation before it runs — the CLI will say so rather than doing it
|
|
111
|
+
quietly. Do not try to route around a confirmation prompt; it is the boundary
|
|
112
|
+
that makes an agent safe to run unattended.
|
|
113
|
+
|
|
114
|
+
## When something fails
|
|
115
|
+
|
|
116
|
+
\`\`\`bash
|
|
117
|
+
solid doctor # what is broken about this environment, in order
|
|
118
|
+
\`\`\`
|
|
119
|
+
|
|
120
|
+
Run it before reporting a bug or retrying a failing call a third time.
|
|
121
|
+
`;
|
|
122
|
+
const TENANCY_SKILL = `---
|
|
123
|
+
name: solid-tenancy
|
|
124
|
+
description: Confirm which business you are acting on before any Solid# write. This directory is bound to one company, and a command run against the wrong tenant writes real data to a real customer. Use before the first write of any session.
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
# Which business am I writing to?
|
|
128
|
+
|
|
129
|
+
Solid# is multi-tenant. Every write lands in **one real company's** data — its
|
|
130
|
+
CRM, its invoices, its customers. There is no staging shadow behind these
|
|
131
|
+
commands, and no undo for most of them.
|
|
132
|
+
|
|
133
|
+
## Check the pin before the first write
|
|
134
|
+
|
|
135
|
+
\`\`\`bash
|
|
136
|
+
solid scope whoami # the effective scope contract for this session, as JSON
|
|
137
|
+
\`\`\`
|
|
138
|
+
|
|
139
|
+
Read it and confirm it names the company you mean. Do this once per session
|
|
140
|
+
before the first mutating call — not after something looks wrong.
|
|
141
|
+
|
|
142
|
+
## The binding lives in the directory
|
|
143
|
+
|
|
144
|
+
A tenant-bound directory holds \`.solid/manifest.json\`, and that binding is what
|
|
145
|
+
authorises tenant-specific context and skills to exist here at all. If it is
|
|
146
|
+
absent, this is not a tenant directory and you should not be generating
|
|
147
|
+
company-specific work in it.
|
|
148
|
+
|
|
149
|
+
## Rules that are not negotiable
|
|
150
|
+
|
|
151
|
+
- **Never assume the pin carried over** from an earlier session, another
|
|
152
|
+
terminal, or another directory. Sessions are not the unit of tenancy;
|
|
153
|
+
the directory and the credential are.
|
|
154
|
+
- **Never write to a company you did not confirm this session.** "It was right
|
|
155
|
+
last time" is how data reaches the wrong customer.
|
|
156
|
+
- **A read is a fine way to check.** Prefer a read-only verb to confirm you are
|
|
157
|
+
where you think you are before issuing the write.
|
|
158
|
+
- **If the scope contract and your intent disagree, stop and say so.** Do not
|
|
159
|
+
pick the interpretation that lets the task continue.
|
|
160
|
+
`;
|
|
161
|
+
/**
|
|
162
|
+
* Every skill Solid# installs, in install order.
|
|
163
|
+
*
|
|
164
|
+
* ⛔ `solid-commerce` is IMPORTED, never copied. One source of truth: a second
|
|
165
|
+
* copy here would drift from the one `solid context --claude` writes, and two
|
|
166
|
+
* files claiming to be the same skill is worse than one stale file.
|
|
167
|
+
*/
|
|
168
|
+
exports.SKILLS = [
|
|
169
|
+
{
|
|
170
|
+
dirname: commerce_skill_1.COMMERCE_SKILL_DIRNAME,
|
|
171
|
+
description: 'Wire generated websites to the real backend — forms, chat, payment links.',
|
|
172
|
+
content: commerce_skill_1.COMMERCE_SKILL_CONTENT,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
dirname: 'solid-verbs',
|
|
176
|
+
description: 'Discover and call verbs from the manifest; read output schemas as hints, not contracts.',
|
|
177
|
+
content: VERBS_SKILL,
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
dirname: 'solid-tenancy',
|
|
181
|
+
description: 'Confirm which company a write lands on before making it.',
|
|
182
|
+
content: TENANCY_SKILL,
|
|
183
|
+
},
|
|
184
|
+
];
|
|
185
|
+
/**
|
|
186
|
+
* Write every skill into `<baseDir>/.claude/skills/<name>/SKILL.md`.
|
|
187
|
+
*
|
|
188
|
+
* ⛔ The caller is responsible for the tenant guard. This function does not
|
|
189
|
+
* check, because the two call sites already have a verified manifest in hand
|
|
190
|
+
* and re-deriving it here would invite a third caller that skips it.
|
|
191
|
+
*
|
|
192
|
+
* Byte-identical files are reported as `unchanged` and not rewritten, so
|
|
193
|
+
* re-running is quiet and does not churn mtimes in a watched directory.
|
|
194
|
+
*/
|
|
195
|
+
function installSkills(baseDir, skills = exports.SKILLS) {
|
|
196
|
+
const out = [];
|
|
197
|
+
for (const skill of skills) {
|
|
198
|
+
const dir = path.join(baseDir, '.claude', 'skills', skill.dirname);
|
|
199
|
+
const file = path.join(dir, 'SKILL.md');
|
|
200
|
+
let state = 'written';
|
|
201
|
+
if (fs.existsSync(file)) {
|
|
202
|
+
try {
|
|
203
|
+
if (fs.readFileSync(file, 'utf8') === skill.content)
|
|
204
|
+
state = 'unchanged';
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
/* unreadable — fall through and rewrite it */
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (state === 'written') {
|
|
211
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
212
|
+
fs.writeFileSync(file, skill.content);
|
|
213
|
+
}
|
|
214
|
+
out.push({ dirname: skill.dirname, path: file, state });
|
|
215
|
+
}
|
|
216
|
+
return out;
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/skills/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqLA,sCAoBC;AAzMD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,uCAAyB;AACz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,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"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Skill } from './index';
|
|
2
|
+
/** The Agent Plugins version this package targets. */
|
|
3
|
+
export declare const AGENT_PLUGINS_VERSION = "1.1.0";
|
|
4
|
+
export declare const PLUGIN_SCHEMA_URL = "https://agent-plugins.org/schemas/1.1.0/plugin.schema.json";
|
|
5
|
+
export declare const MCP_SCHEMA_URL = "https://agent-plugins.org/schemas/1.1.0/mcp.schema.json";
|
|
6
|
+
/**
|
|
7
|
+
* Plugin root, relative to a tenant directory.
|
|
8
|
+
*
|
|
9
|
+
* Under `.solid/` because that is the directory `requireTenantManifest`
|
|
10
|
+
* already governs: the plugin describes ONE company, and putting it anywhere
|
|
11
|
+
* the guard does not cover would be a way to write tenant content outside the
|
|
12
|
+
* boundary. `.claude/skills/` is still written alongside it — that is what
|
|
13
|
+
* Claude Code reads today, and removing it to avoid duplicating two-kilobyte
|
|
14
|
+
* files would break the client most likely to be pointed at this directory.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PLUGIN_DIR: string;
|
|
17
|
+
/**
|
|
18
|
+
* Manifest `name` constraints, transcribed from plugin.schema.json §5.5.
|
|
19
|
+
* Lowercase alphanumeric with dots and hyphens inside, 1-64 characters,
|
|
20
|
+
* alphanumeric at both ends, and no `--` or `..` anywhere.
|
|
21
|
+
*/
|
|
22
|
+
export declare const PLUGIN_NAME_RE: RegExp;
|
|
23
|
+
export declare function isValidPluginName(name: string): boolean;
|
|
24
|
+
export interface PluginManifest {
|
|
25
|
+
$schema: string;
|
|
26
|
+
name: string;
|
|
27
|
+
version?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
author?: {
|
|
30
|
+
name?: string;
|
|
31
|
+
email?: string;
|
|
32
|
+
url?: string;
|
|
33
|
+
};
|
|
34
|
+
homepage?: string;
|
|
35
|
+
repository?: string;
|
|
36
|
+
license?: string;
|
|
37
|
+
keywords?: string[];
|
|
38
|
+
extensions?: Record<string, Record<string, unknown>>;
|
|
39
|
+
}
|
|
40
|
+
export interface BuildManifestInput {
|
|
41
|
+
/** Plugin name. Must satisfy isValidPluginName. */
|
|
42
|
+
name?: string;
|
|
43
|
+
/** Usually the CLI version that generated it. */
|
|
44
|
+
version?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
homepage?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Build `plugin.json`. Pure.
|
|
50
|
+
*
|
|
51
|
+
* Optional fields are OMITTED rather than set to empty strings: the schema
|
|
52
|
+
* types them as strings, so `""` validates and then shows up in a client's
|
|
53
|
+
* plugin list as a blank description. Absent is the honest encoding of
|
|
54
|
+
* "we do not know this".
|
|
55
|
+
*/
|
|
56
|
+
export declare function buildPluginManifest(input?: BuildManifestInput): PluginManifest;
|
|
57
|
+
export interface StdioServer {
|
|
58
|
+
type: 'stdio';
|
|
59
|
+
command: string;
|
|
60
|
+
args?: string[];
|
|
61
|
+
env?: Record<string, string>;
|
|
62
|
+
cwd?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface McpConfig {
|
|
65
|
+
$schema: string;
|
|
66
|
+
mcpServers: Record<string, StdioServer>;
|
|
67
|
+
}
|
|
68
|
+
export interface BuildMcpInput {
|
|
69
|
+
/** Backend base URL. Omitted when it is the default. */
|
|
70
|
+
apiUrl?: string;
|
|
71
|
+
/** Tenant pin. Not a secret; the plugin is tenant-bound by construction. */
|
|
72
|
+
companyId?: number | string;
|
|
73
|
+
/** Npm package that ships the stdio server. */
|
|
74
|
+
packageName?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Default package that ships the stdio MCP server. Mirrors mcp-client-config. */
|
|
77
|
+
export declare const DEFAULT_MCP_PACKAGE = "@solidnumber/mcp";
|
|
78
|
+
/**
|
|
79
|
+
* Build `mcp.json`. Pure.
|
|
80
|
+
*
|
|
81
|
+
* ⛔ `type` IS REQUIRED HERE AND IS NOT IN OUR OWN CLIENT CONFIGS. The
|
|
82
|
+
* Agent Plugins server object is a `oneOf` over stdio / streamable-http / sse
|
|
83
|
+
* discriminated on `type`, so omitting it — which the native Claude/Cursor
|
|
84
|
+
* formats tolerate — fails the schema outright. This is exactly the kind of
|
|
85
|
+
* difference that makes copying `buildServerEntry` the wrong move.
|
|
86
|
+
*/
|
|
87
|
+
export declare function buildMcpConfig(input?: BuildMcpInput): McpConfig;
|
|
88
|
+
export interface WrittenFile {
|
|
89
|
+
/** Path relative to the plugin root, as the spec names it. */
|
|
90
|
+
rel: string;
|
|
91
|
+
path: string;
|
|
92
|
+
state: 'written' | 'unchanged';
|
|
93
|
+
}
|
|
94
|
+
export interface WritePluginInput {
|
|
95
|
+
manifest?: BuildManifestInput;
|
|
96
|
+
mcp?: BuildMcpInput;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Write the Agent Plugins package under `<baseDir>/.solid/plugin/`.
|
|
100
|
+
*
|
|
101
|
+
* ⛔ The caller owns the tenant guard, exactly as `installSkills` documents.
|
|
102
|
+
* This writes tenant-describing content and must never be reachable without a
|
|
103
|
+
* verified `.solid/manifest.json`.
|
|
104
|
+
*/
|
|
105
|
+
export declare function writePlugin(baseDir: string, skills: readonly Skill[], input?: WritePluginInput): WrittenFile[];
|
|
106
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/plugin.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,KAAK,EAAE,M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,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,GAAE,aAAkB,GAAG,SAAS,CAenE;AAED,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,GAAG,WAAW,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAgBD;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,KAAK,GAAE,gBAAqB,GAC3B,WAAW,EAAE,CA2Bf"}
|
|
@@ -0,0 +1,187 @@
|
|
|
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.DEFAULT_MCP_PACKAGE = exports.PLUGIN_NAME_RE = exports.PLUGIN_DIR = exports.MCP_SCHEMA_URL = exports.PLUGIN_SCHEMA_URL = exports.AGENT_PLUGINS_VERSION = void 0;
|
|
37
|
+
exports.isValidPluginName = isValidPluginName;
|
|
38
|
+
exports.buildPluginManifest = buildPluginManifest;
|
|
39
|
+
exports.buildMcpConfig = buildMcpConfig;
|
|
40
|
+
exports.writePlugin = writePlugin;
|
|
41
|
+
/**
|
|
42
|
+
* Agent Plugins 1.1.0 packaging — the same skills, portable off Claude Code.
|
|
43
|
+
*
|
|
44
|
+
* ⛔ WHY THIS EXISTS. `installSkills` writes `.claude/skills/<name>/SKILL.md`,
|
|
45
|
+
* which is the layout Claude Code reads and nothing else does. Agent Plugins
|
|
46
|
+
* (Amazon, Cursor, Microsoft, OpenAI, Vercel; 1.0.0 published 2026-08-06)
|
|
47
|
+
* standardises the OUTER packaging — a directory with a `plugin.json`
|
|
48
|
+
* manifest, a `skills/` folder of exactly the SKILL.md files we already
|
|
49
|
+
* generate, and an `mcp.json` naming the servers. Emitting that costs two
|
|
50
|
+
* small JSON files and makes the identical content loadable by every client
|
|
51
|
+
* that implements the standard.
|
|
52
|
+
*
|
|
53
|
+
* We are not inventing a format here and must not drift from one. The field
|
|
54
|
+
* sets below are transcribed from the normative schemas at
|
|
55
|
+
* https://agent-plugins.org/schemas/1.1.0/ — `plugin.schema.json` and
|
|
56
|
+
* `mcp.schema.json` — both of which are CLOSED (`additionalProperties: false`)
|
|
57
|
+
* with `$schema` and one other field required. A stray key is a validation
|
|
58
|
+
* failure, not a hint, so every builder here emits exactly the permitted set.
|
|
59
|
+
*
|
|
60
|
+
* ⛔ NO CREDENTIAL EVER ENTERS mcp.json. A plugin directory is a DISTRIBUTABLE
|
|
61
|
+
* artifact — that is its entire purpose — and `buildServerEntry` in
|
|
62
|
+
* lib/mcp-client-config.ts puts `SOLID_API_KEY` into the env block because a
|
|
63
|
+
* client config is a private file on one machine. The two look alike and are
|
|
64
|
+
* opposites. This writer pins the tenant (`SOLID_COMPANY_ID`, not a secret,
|
|
65
|
+
* and the plugin is already tenant-bound) and leaves the key to the
|
|
66
|
+
* environment, so a shared plugin carries no way to act as anybody.
|
|
67
|
+
*
|
|
68
|
+
* ⛔ 1.1.0, NOT 1.0.0. The two plugin schemas are byte-identical apart from
|
|
69
|
+
* the `$schema` constant, so there is no compatibility argument for pinning
|
|
70
|
+
* the older one — and §5.2.1 requires the value to match the version targeted
|
|
71
|
+
* exactly. Clients MUST reject a version they do not recognise, so this is the
|
|
72
|
+
* one field that cannot be approximated.
|
|
73
|
+
*/
|
|
74
|
+
const fs = __importStar(require("fs"));
|
|
75
|
+
const path = __importStar(require("path"));
|
|
76
|
+
/** The Agent Plugins version this package targets. */
|
|
77
|
+
exports.AGENT_PLUGINS_VERSION = '1.1.0';
|
|
78
|
+
exports.PLUGIN_SCHEMA_URL = `https://agent-plugins.org/schemas/${exports.AGENT_PLUGINS_VERSION}/plugin.schema.json`;
|
|
79
|
+
exports.MCP_SCHEMA_URL = `https://agent-plugins.org/schemas/${exports.AGENT_PLUGINS_VERSION}/mcp.schema.json`;
|
|
80
|
+
/**
|
|
81
|
+
* Plugin root, relative to a tenant directory.
|
|
82
|
+
*
|
|
83
|
+
* Under `.solid/` because that is the directory `requireTenantManifest`
|
|
84
|
+
* already governs: the plugin describes ONE company, and putting it anywhere
|
|
85
|
+
* the guard does not cover would be a way to write tenant content outside the
|
|
86
|
+
* boundary. `.claude/skills/` is still written alongside it — that is what
|
|
87
|
+
* Claude Code reads today, and removing it to avoid duplicating two-kilobyte
|
|
88
|
+
* files would break the client most likely to be pointed at this directory.
|
|
89
|
+
*/
|
|
90
|
+
exports.PLUGIN_DIR = path.join('.solid', 'plugin');
|
|
91
|
+
/**
|
|
92
|
+
* Manifest `name` constraints, transcribed from plugin.schema.json §5.5.
|
|
93
|
+
* Lowercase alphanumeric with dots and hyphens inside, 1-64 characters,
|
|
94
|
+
* alphanumeric at both ends, and no `--` or `..` anywhere.
|
|
95
|
+
*/
|
|
96
|
+
exports.PLUGIN_NAME_RE = /^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/;
|
|
97
|
+
function isValidPluginName(name) {
|
|
98
|
+
return name.length >= 1 && name.length <= 64 && exports.PLUGIN_NAME_RE.test(name);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Build `plugin.json`. Pure.
|
|
102
|
+
*
|
|
103
|
+
* Optional fields are OMITTED rather than set to empty strings: the schema
|
|
104
|
+
* types them as strings, so `""` validates and then shows up in a client's
|
|
105
|
+
* plugin list as a blank description. Absent is the honest encoding of
|
|
106
|
+
* "we do not know this".
|
|
107
|
+
*/
|
|
108
|
+
function buildPluginManifest(input = {}) {
|
|
109
|
+
const name = input.name ?? 'solid';
|
|
110
|
+
if (!isValidPluginName(name)) {
|
|
111
|
+
throw new Error(`plugin name "${name}" violates Agent Plugins ${exports.AGENT_PLUGINS_VERSION} §5.5 ` +
|
|
112
|
+
'(1-64 chars, lowercase alphanumeric with . or -, alphanumeric at both ends, no -- or ..)');
|
|
113
|
+
}
|
|
114
|
+
const manifest = { $schema: exports.PLUGIN_SCHEMA_URL, name };
|
|
115
|
+
if (input.version)
|
|
116
|
+
manifest.version = input.version;
|
|
117
|
+
if (input.description)
|
|
118
|
+
manifest.description = input.description;
|
|
119
|
+
if (input.homepage)
|
|
120
|
+
manifest.homepage = input.homepage;
|
|
121
|
+
manifest.license = 'BUSL-1.1';
|
|
122
|
+
manifest.keywords = ['solid', 'business-operations', 'crm', 'mcp'];
|
|
123
|
+
return manifest;
|
|
124
|
+
}
|
|
125
|
+
/** Default package that ships the stdio MCP server. Mirrors mcp-client-config. */
|
|
126
|
+
exports.DEFAULT_MCP_PACKAGE = '@solidnumber/mcp';
|
|
127
|
+
/**
|
|
128
|
+
* Build `mcp.json`. Pure.
|
|
129
|
+
*
|
|
130
|
+
* ⛔ `type` IS REQUIRED HERE AND IS NOT IN OUR OWN CLIENT CONFIGS. The
|
|
131
|
+
* Agent Plugins server object is a `oneOf` over stdio / streamable-http / sse
|
|
132
|
+
* discriminated on `type`, so omitting it — which the native Claude/Cursor
|
|
133
|
+
* formats tolerate — fails the schema outright. This is exactly the kind of
|
|
134
|
+
* difference that makes copying `buildServerEntry` the wrong move.
|
|
135
|
+
*/
|
|
136
|
+
function buildMcpConfig(input = {}) {
|
|
137
|
+
const env = {};
|
|
138
|
+
if (input.apiUrl)
|
|
139
|
+
env.SOLID_API_URL = input.apiUrl;
|
|
140
|
+
if (input.companyId !== undefined && input.companyId !== null && input.companyId !== '') {
|
|
141
|
+
env.SOLID_COMPANY_ID = String(input.companyId);
|
|
142
|
+
}
|
|
143
|
+
const server = {
|
|
144
|
+
type: 'stdio',
|
|
145
|
+
command: 'npx',
|
|
146
|
+
args: ['-y', input.packageName ?? exports.DEFAULT_MCP_PACKAGE],
|
|
147
|
+
};
|
|
148
|
+
if (Object.keys(env).length > 0)
|
|
149
|
+
server.env = env;
|
|
150
|
+
return { $schema: exports.MCP_SCHEMA_URL, mcpServers: { solid: server } };
|
|
151
|
+
}
|
|
152
|
+
/** Write `file` only when its bytes would change. Keeps re-runs quiet. */
|
|
153
|
+
function writeIfChanged(file, content, rel) {
|
|
154
|
+
if (fs.existsSync(file)) {
|
|
155
|
+
try {
|
|
156
|
+
if (fs.readFileSync(file, 'utf8') === content)
|
|
157
|
+
return { rel, path: file, state: 'unchanged' };
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
/* unreadable — fall through and rewrite */
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
164
|
+
fs.writeFileSync(file, content);
|
|
165
|
+
return { rel, path: file, state: 'written' };
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Write the Agent Plugins package under `<baseDir>/.solid/plugin/`.
|
|
169
|
+
*
|
|
170
|
+
* ⛔ The caller owns the tenant guard, exactly as `installSkills` documents.
|
|
171
|
+
* This writes tenant-describing content and must never be reachable without a
|
|
172
|
+
* verified `.solid/manifest.json`.
|
|
173
|
+
*/
|
|
174
|
+
function writePlugin(baseDir, skills, input = {}) {
|
|
175
|
+
const root = path.join(baseDir, exports.PLUGIN_DIR);
|
|
176
|
+
const out = [];
|
|
177
|
+
// Trailing newline on both: these are files a human may open in an editor,
|
|
178
|
+
// and every other JSON this CLI writes ends in one.
|
|
179
|
+
out.push(writeIfChanged(path.join(root, 'plugin.json'), `${JSON.stringify(buildPluginManifest(input.manifest), null, 2)}\n`, 'plugin.json'));
|
|
180
|
+
out.push(writeIfChanged(path.join(root, 'mcp.json'), `${JSON.stringify(buildMcpConfig(input.mcp), null, 2)}\n`, 'mcp.json'));
|
|
181
|
+
for (const skill of skills) {
|
|
182
|
+
const rel = path.join('skills', skill.dirname, 'SKILL.md');
|
|
183
|
+
out.push(writeIfChanged(path.join(root, rel), skill.content, rel));
|
|
184
|
+
}
|
|
185
|
+
return out;
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/lib/skills/plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,8CAEC;AAgCD,kDAeC;AAoCD,wCAeC;AAmCD,kCA+BC;AAvOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,uCAAyB;AACzB,2CAA6B;AAI7B,sDAAsD;AACzC,QAAA,qBAAqB,GAAG,OAAO,CAAC;AAEhC,QAAA,iBAAiB,GAC5B,qCAAqC,6BAAqB,qBAAqB,CAAC;AACrE,QAAA,cAAc,GACzB,qCAAqC,6BAAqB,kBAAkB,CAAC;AAE/E;;;;;;;;;GASG;AACU,QAAA,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAExD;;;;GAIG;AACU,QAAA,cAAc,GAAG,qDAAqD,CAAC;AAEpF,SAAgB,iBAAiB,CAAC,IAAY;IAC5C,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,IAAI,sBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC;AAwBD;;;;;;;GAOG;AACH,SAAgB,m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D;IACpD,GAAG,CAAC,IAAI,CACN,cAAc,CACZ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,EAC9B,GAAG,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EACnE,aAAa,CACd,CACF,CAAC;IACF,GAAG,CAAC,IAAI,CACN,cAAc,CACZ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAC3B,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EACzD,UAAU,CACX,CACF,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3D,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/lib/telemetry.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See: SPRINT-CLI-MONETIZATION.md §"Layer 2 — Behavior-triggered outreach"
|
|
11
11
|
*/
|
|
12
|
-
export type TelemetryEventName = 'installed' | 'first_command' | 'first_run_welcome_shown' | 'first_run_email_captured' | 'first_run_email_skipped' | 'auth_started' | 'auth_success' | 'auth_failed' | 'demo_created' | 'demo_email_captured' | 'demo_failed' | 'clone_created' | 'clone_failed' | 'company_created' | 'company_create_for_client' | 'page_published' | 'deploy_preview' | 'context_claude' | 'context_cursor' | 'template_publish' | 'agent_onboard' | 'api_key_created' | 'billing_invoice_sent' | 'billing_checkout_link_created' | 'subscription_started' | 'command_error' | 'help_shown' | 'bare_invocation' | 'feedback_sent' | 'unknown_command';
|
|
12
|
+
export type TelemetryEventName = 'installed' | 'first_command' | 'first_run_welcome_shown' | 'first_run_email_captured' | 'first_run_email_skipped' | 'auth_started' | 'auth_success' | 'auth_failed' | 'demo_created' | 'demo_email_captured' | 'demo_failed' | 'clone_created' | 'clone_failed' | 'company_created' | 'company_create_for_client' | 'page_published' | 'deploy_preview' | 'context_claude' | 'context_cursor' | 'template_publish' | 'agent_onboard' | 'api_key_created' | 'billing_invoice_sent' | 'billing_checkout_link_created' | 'subscription_started' | 'command_error' | 'help_shown' | 'bare_invocation' | 'feedback_sent' | 'unknown_command' | 'option_error';
|
|
13
13
|
/**
|
|
14
14
|
* Append an entry to the local command-history file (used by `solid feedback`
|
|
15
15
|
* to include context). Safe to call from every command. Best-effort.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/lib/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,MAAM,MAAM,kBAAkB,GAC1B,WAAW,GACX,eAAe,GACf,yBAAyB,GACzB,0BAA0B,GAC1B,yBAAyB,GACzB,cAAc,GACd,cAAc,GACd,aAAa,GACb,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,2BAA2B,GAC3B,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,iBAAiB,GACjB,sBAAsB,GACtB,+BAA+B,GAC/B,sBAAsB,GACtB,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,eAAe,GACf,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/lib/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,MAAM,MAAM,kBAAkB,GAC1B,WAAW,GACX,eAAe,GACf,yBAAyB,GACzB,0BAA0B,GAC1B,yBAAyB,GACzB,cAAc,GACd,cAAc,GACd,aAAa,GACb,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,2BAA2B,GAC3B,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,iBAAiB,GACjB,sBAAsB,GACtB,+BAA+B,GAC/B,sBAAsB,GACtB,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GAKjB,cAAc,CAAC;AAsCnB;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAmBnD;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAClB,KAAK,EAAE,kBAAkB,EACzB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAO,GAC/D,IAAI,CA0BN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/lib/telemetry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/lib/telemetry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFH,sCAmBC;AAMD,oBA6BC;AA3ID,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AACrD,MAAM,aAAa,GAAG,IAAI,CAAC,IAA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AI,UAAU,EAAE;QAAE,OAAO;IACzB,MAAM,UAAU,GAAG,YAAY,EAAE,CAAC;IAClC,IAAI,CAAC,UAAU;QAAE,OAAO,CAAC,2CAA2C;IAEpE,MAAM,IAAI,GAAG;QACX,UAAU;QACV,KAAK;QACL,WAAW,EAAE,aAAa,EAAE;QAC5B,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;KACxB,CAAC;IAEF,mCAAmC;IACnC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;IAC7D,KAAK,CAAC,GAAG,UAAU,EAAE,6BAA6B,EAAE;QAClD,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAC1B,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;SACC,KAAK,CAAC,GAAG,EAAE;QACV,aAAa;IACf,CAAC,CAAC;SACD,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -34,4 +34,16 @@ export declare function maybeWarnImplicitTenant(opts: {
|
|
|
34
34
|
hasCurrentCompany: boolean;
|
|
35
35
|
companyId: number | null;
|
|
36
36
|
}): void;
|
|
37
|
+
/**
|
|
38
|
+
* Refuse to run when SOLID_COMPANY_ID names a tenant the session is not.
|
|
39
|
+
*
|
|
40
|
+
* The variable cannot scope a request — the backend derives company_id from the
|
|
41
|
+
* JWT. So when it disagrees with the authenticated company, the caller believes
|
|
42
|
+
* it is acting on one tenant while every write lands on another. Silence there
|
|
43
|
+
* is the failure: better to stop than to write a page, an invoice or a contact
|
|
44
|
+
* into the wrong business.
|
|
45
|
+
*
|
|
46
|
+
* Returns an error message, or null when there is nothing to complain about.
|
|
47
|
+
*/
|
|
48
|
+
export declare function tenantEnvMismatch(env: NodeJS.ProcessEnv, authenticatedCompanyId: number | undefined): string | null;
|
|
37
49
|
//# sourceMappingURL=tenant-warn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-warn.d.ts","sourceRoot":"","sources":["../../src/lib/tenant-warn.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE;QACP,IAAI,EAAE,iBAAiB,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB,
|
|
1
|
+
{"version":3,"file":"tenant-warn.d.ts","sourceRoot":"","sources":["../../src/lib/tenant-warn.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE;QACP,IAAI,EAAE,iBAAiB,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB,CAenF;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,GAAG,OAAO,CAmBV;AAED,qEAAqE;AACrE,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CASjE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,MAAM,EAAE,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