@memberjunction/cli 5.41.0 → 5.42.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/bundle/index.d.ts +1 -0
- package/dist/commands/bundle/index.d.ts.map +1 -1
- package/dist/commands/bundle/index.js +7 -1
- package/dist/commands/bundle/index.js.map +1 -1
- package/dist/commands/codegen/index.d.ts +6 -16
- package/dist/commands/codegen/index.d.ts.map +1 -1
- package/dist/commands/codegen/index.js +6 -90
- package/dist/commands/codegen/index.js.map +1 -1
- package/dist/commands/codegen/usage.d.ts +7 -0
- package/dist/commands/codegen/usage.d.ts.map +1 -0
- package/dist/commands/codegen/usage.js +10 -0
- package/dist/commands/codegen/usage.js.map +1 -0
- package/dist/commands/install/claude.d.ts +35 -0
- package/dist/commands/install/claude.d.ts.map +1 -0
- package/dist/commands/install/claude.js +108 -0
- package/dist/commands/install/claude.js.map +1 -0
- package/dist/commands/install/index.d.ts +1 -0
- package/dist/commands/install/index.d.ts.map +1 -1
- package/dist/commands/install/index.js +4 -0
- package/dist/commands/install/index.js.map +1 -1
- package/dist/commands/migrate/convert.d.ts +59 -12
- package/dist/commands/migrate/convert.d.ts.map +1 -1
- package/dist/commands/migrate/convert.js +294 -21
- package/dist/commands/migrate/convert.js.map +1 -1
- package/dist/commands/migrate/rebake.d.ts +41 -0
- package/dist/commands/migrate/rebake.d.ts.map +1 -0
- package/dist/commands/migrate/rebake.js +193 -0
- package/dist/commands/migrate/rebake.js.map +1 -0
- package/dist/commands/plugin/add.d.ts +18 -0
- package/dist/commands/plugin/add.d.ts.map +1 -0
- package/dist/commands/plugin/add.js +53 -0
- package/dist/commands/plugin/add.js.map +1 -0
- package/dist/commands/sync/pull.d.ts +6 -26
- package/dist/commands/sync/pull.d.ts.map +1 -1
- package/dist/commands/sync/pull.js +6 -281
- package/dist/commands/sync/pull.js.map +1 -1
- package/dist/commands/sync/push.d.ts +8 -19
- package/dist/commands/sync/push.d.ts.map +1 -1
- package/dist/commands/sync/push.js +8 -328
- package/dist/commands/sync/push.js.map +1 -1
- package/dist/commands/sync/usage.d.ts +7 -0
- package/dist/commands/sync/usage.d.ts.map +1 -0
- package/dist/commands/sync/usage.js +10 -0
- package/dist/commands/sync/usage.js.map +1 -0
- package/dist/commands/update/claude.d.ts +37 -0
- package/dist/commands/update/claude.d.ts.map +1 -0
- package/dist/commands/update/claude.js +90 -0
- package/dist/commands/update/claude.js.map +1 -0
- package/dist/commands/usage.d.ts +17 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +29 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/hooks/prerun.d.ts.map +1 -1
- package/dist/hooks/prerun.js +49 -8
- package/dist/hooks/prerun.js.map +1 -1
- package/dist/lib/claude-pack/ManagedBlockEditor.d.ts +40 -0
- package/dist/lib/claude-pack/ManagedBlockEditor.d.ts.map +1 -0
- package/dist/lib/claude-pack/ManagedBlockEditor.js +127 -0
- package/dist/lib/claude-pack/ManagedBlockEditor.js.map +1 -0
- package/dist/lib/claude-pack/PackFetcher.d.ts +86 -0
- package/dist/lib/claude-pack/PackFetcher.d.ts.map +1 -0
- package/dist/lib/claude-pack/PackFetcher.js +163 -0
- package/dist/lib/claude-pack/PackFetcher.js.map +1 -0
- package/dist/lib/claude-pack/PackInstaller.d.ts +62 -0
- package/dist/lib/claude-pack/PackInstaller.d.ts.map +1 -0
- package/dist/lib/claude-pack/PackInstaller.js +197 -0
- package/dist/lib/claude-pack/PackInstaller.js.map +1 -0
- package/dist/lib/claude-pack/PackMerger.d.ts +61 -0
- package/dist/lib/claude-pack/PackMerger.d.ts.map +1 -0
- package/dist/lib/claude-pack/PackMerger.js +315 -0
- package/dist/lib/claude-pack/PackMerger.js.map +1 -0
- package/dist/lib/claude-pack/PackOutputFormatter.d.ts +29 -0
- package/dist/lib/claude-pack/PackOutputFormatter.d.ts.map +1 -0
- package/dist/lib/claude-pack/PackOutputFormatter.js +82 -0
- package/dist/lib/claude-pack/PackOutputFormatter.js.map +1 -0
- package/dist/lib/claude-pack/PackPaths.d.ts +80 -0
- package/dist/lib/claude-pack/PackPaths.d.ts.map +1 -0
- package/dist/lib/claude-pack/PackPaths.js +182 -0
- package/dist/lib/claude-pack/PackPaths.js.map +1 -0
- package/dist/lib/claude-pack/PackTypes.d.ts +124 -0
- package/dist/lib/claude-pack/PackTypes.d.ts.map +1 -0
- package/dist/lib/claude-pack/PackTypes.js +32 -0
- package/dist/lib/claude-pack/PackTypes.js.map +1 -0
- package/dist/lib/claude-pack/SettingsMerger.d.ts +47 -0
- package/dist/lib/claude-pack/SettingsMerger.d.ts.map +1 -0
- package/dist/lib/claude-pack/SettingsMerger.js +163 -0
- package/dist/lib/claude-pack/SettingsMerger.js.map +1 -0
- package/dist/lib/cli-plugins.d.ts +16 -0
- package/dist/lib/cli-plugins.d.ts.map +1 -0
- package/dist/lib/cli-plugins.js +26 -0
- package/dist/lib/cli-plugins.js.map +1 -0
- package/dist/lib/domain-usage-command.d.ts +16 -0
- package/dist/lib/domain-usage-command.d.ts.map +1 -0
- package/dist/lib/domain-usage-command.js +23 -0
- package/dist/lib/domain-usage-command.js.map +1 -0
- package/dist/lib/usage-render.d.ts +14 -0
- package/dist/lib/usage-render.d.ts.map +1 -0
- package/dist/lib/usage-render.js +64 -0
- package/dist/lib/usage-render.js.map +1 -0
- package/dist/light-commands.d.ts.map +1 -1
- package/dist/light-commands.js +11 -0
- package/dist/light-commands.js.map +1 -1
- package/oclif.manifest.json +815 -135
- package/package.json +17 -15
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep-merge for `.claude/settings.json`.
|
|
3
|
+
*
|
|
4
|
+
* The pack ships a baseline `settings.json` with a top-level
|
|
5
|
+
* `__mj_managed: { version, mjMajor?, keys: ["permissions.allow", "env.MJ_CLAUDE_PACK", ...] }`
|
|
6
|
+
* block. `keys` lists the dotted JSON paths the pack owns.
|
|
7
|
+
*
|
|
8
|
+
* The merger:
|
|
9
|
+
* 1. Deep-clones the user's existing settings as the starting point
|
|
10
|
+
* 2. For each path in `__mj_managed.keys`, merges the pack's value into the
|
|
11
|
+
* user's:
|
|
12
|
+
* - Arrays → union, deduped, user entries first then pack entries
|
|
13
|
+
* - Objects → recursive merge (per-key)
|
|
14
|
+
* - Primitives → pack wins (rare in practice — primitives shouldn't
|
|
15
|
+
* really be managed keys, but the rule keeps the merger total)
|
|
16
|
+
* 3. Replaces `__mj_managed` wholesale with the pack's block (so version
|
|
17
|
+
* and mjMajor stamps update on every merge)
|
|
18
|
+
* 4. Leaves every user key outside `__mj_managed.keys` completely alone
|
|
19
|
+
*
|
|
20
|
+
* @see plans/claude-install-pack.md §10.2
|
|
21
|
+
*/
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Errors
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
export class SettingsMergeError extends Error {
|
|
26
|
+
constructor(message) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.name = 'SettingsMergeError';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function mergeSettings(opts) {
|
|
32
|
+
const packMeta = readManagedMeta(opts.Pack);
|
|
33
|
+
if (!packMeta) {
|
|
34
|
+
throw new SettingsMergeError('Pack settings.json has no __mj_managed.keys block — cannot determine what to merge.');
|
|
35
|
+
}
|
|
36
|
+
const result = deepClone(opts.Existing);
|
|
37
|
+
for (const dottedPath of packMeta.keys) {
|
|
38
|
+
const packValue = getAtPath(opts.Pack, dottedPath);
|
|
39
|
+
if (packValue === undefined)
|
|
40
|
+
continue; // pack declares the key but didn't ship a value — skip
|
|
41
|
+
const existingValue = getAtPath(result, dottedPath);
|
|
42
|
+
const merged = mergeValues(existingValue, packValue);
|
|
43
|
+
setAtPath(result, dottedPath, merged);
|
|
44
|
+
}
|
|
45
|
+
// Replace __mj_managed wholesale so version + mjMajor stamps refresh.
|
|
46
|
+
// Casting through unknown is required because the index signature is `unknown`.
|
|
47
|
+
result.__mj_managed = deepClone(opts.Pack.__mj_managed);
|
|
48
|
+
const changed = !shallowJsonEqual(result, opts.Existing);
|
|
49
|
+
return { Result: result, Changed: changed };
|
|
50
|
+
}
|
|
51
|
+
/** Read the `__mj_managed` block out of a settings object, or null if absent. */
|
|
52
|
+
export function readManagedMeta(settings) {
|
|
53
|
+
const raw = settings.__mj_managed;
|
|
54
|
+
if (!isPlainObject(raw))
|
|
55
|
+
return null;
|
|
56
|
+
const obj = raw;
|
|
57
|
+
if (typeof obj.version !== 'string')
|
|
58
|
+
return null;
|
|
59
|
+
if (!Array.isArray(obj.keys))
|
|
60
|
+
return null;
|
|
61
|
+
if (!obj.keys.every((k) => typeof k === 'string'))
|
|
62
|
+
return null;
|
|
63
|
+
return {
|
|
64
|
+
version: obj.version,
|
|
65
|
+
mjMajor: typeof obj.mjMajor === 'string' ? obj.mjMajor : undefined,
|
|
66
|
+
keys: obj.keys,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// Merge primitives
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
function mergeValues(existing, pack) {
|
|
73
|
+
if (Array.isArray(pack) && Array.isArray(existing)) {
|
|
74
|
+
return mergeArrays(existing, pack);
|
|
75
|
+
}
|
|
76
|
+
if (isPlainObject(pack) && isPlainObject(existing)) {
|
|
77
|
+
return mergeObjects(existing, pack);
|
|
78
|
+
}
|
|
79
|
+
// Type mismatch or primitive — pack wins.
|
|
80
|
+
return deepClone(pack);
|
|
81
|
+
}
|
|
82
|
+
/** Union user entries first, then pack entries; deduped by stable JSON encoding. */
|
|
83
|
+
function mergeArrays(existing, pack) {
|
|
84
|
+
const seen = new Set();
|
|
85
|
+
const out = [];
|
|
86
|
+
for (const item of [...existing, ...pack]) {
|
|
87
|
+
const key = stableKey(item);
|
|
88
|
+
if (!seen.has(key)) {
|
|
89
|
+
seen.add(key);
|
|
90
|
+
out.push(deepClone(item));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
function mergeObjects(existing, pack) {
|
|
96
|
+
const out = deepClone(existing);
|
|
97
|
+
for (const [key, value] of Object.entries(pack)) {
|
|
98
|
+
out[key] = mergeValues(out[key], value);
|
|
99
|
+
}
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// Path helpers
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
export function getAtPath(obj, dottedPath) {
|
|
106
|
+
const parts = dottedPath.split('.');
|
|
107
|
+
let cur = obj;
|
|
108
|
+
for (const p of parts) {
|
|
109
|
+
if (!isPlainObject(cur))
|
|
110
|
+
return undefined;
|
|
111
|
+
cur = cur[p];
|
|
112
|
+
}
|
|
113
|
+
return cur;
|
|
114
|
+
}
|
|
115
|
+
export function setAtPath(obj, dottedPath, value) {
|
|
116
|
+
const parts = dottedPath.split('.');
|
|
117
|
+
const last = parts.pop();
|
|
118
|
+
if (last === undefined)
|
|
119
|
+
return;
|
|
120
|
+
let cur = obj;
|
|
121
|
+
for (const p of parts) {
|
|
122
|
+
const next = cur[p];
|
|
123
|
+
if (!isPlainObject(next)) {
|
|
124
|
+
cur[p] = {};
|
|
125
|
+
}
|
|
126
|
+
cur = cur[p];
|
|
127
|
+
}
|
|
128
|
+
cur[last] = value;
|
|
129
|
+
}
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
// Misc utilities
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
export function isPlainObject(v) {
|
|
134
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
135
|
+
}
|
|
136
|
+
function deepClone(value) {
|
|
137
|
+
if (value === null || typeof value !== 'object')
|
|
138
|
+
return value;
|
|
139
|
+
if (Array.isArray(value))
|
|
140
|
+
return value.map((v) => deepClone(v));
|
|
141
|
+
const out = {};
|
|
142
|
+
for (const [k, v] of Object.entries(value)) {
|
|
143
|
+
out[k] = deepClone(v);
|
|
144
|
+
}
|
|
145
|
+
return out;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Stable string key for an arbitrary JSON-ish value, used to dedupe array
|
|
149
|
+
* entries. Sorts object keys so `{a:1,b:2}` and `{b:2,a:1}` produce the same
|
|
150
|
+
* key.
|
|
151
|
+
*/
|
|
152
|
+
function stableKey(value) {
|
|
153
|
+
if (value === null || typeof value !== 'object')
|
|
154
|
+
return JSON.stringify(value);
|
|
155
|
+
if (Array.isArray(value))
|
|
156
|
+
return '[' + value.map(stableKey).join(',') + ']';
|
|
157
|
+
const entries = Object.entries(value).sort(([a], [b]) => a.localeCompare(b));
|
|
158
|
+
return '{' + entries.map(([k, v]) => JSON.stringify(k) + ':' + stableKey(v)).join(',') + '}';
|
|
159
|
+
}
|
|
160
|
+
function shallowJsonEqual(a, b) {
|
|
161
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=SettingsMerger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsMerger.js","sourceRoot":"","sources":["../../../src/lib/claude-pack/SettingsMerger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACzC,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACrC,CAAC;CACJ;AAuBD,MAAM,UAAU,aAAa,CAAC,IAA0B;IACpD,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,kBAAkB,CACxB,qFAAqF,CACxF,CAAC;IACN,CAAC;IAED,MAAM,MAAM,GAAG,SA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,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAC/E,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CACrB,CAAC;IACF,OAAO,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AACjG,CAAC;AAED,SAAS,gBAAgB,CAAC,CAAU,EAAE,CAAU;IAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads all CLI plugins so their `@RegisterClass(BaseCLIPlugin, …)` decorators
|
|
3
|
+
* populate the ClassFactory — the basis for the `mj usage` / `mj <domain> usage`
|
|
4
|
+
* progressive-disclosure surface (plan §5).
|
|
5
|
+
*
|
|
6
|
+
* The metadata-sync and codegen-lib plugin entry points ship WITH the CLI, so
|
|
7
|
+
* they're loaded unconditionally as built-ins (available even when no
|
|
8
|
+
* `mj-cli-plugins.json` is present). Any third-party plugins listed in that file
|
|
9
|
+
* are then loaded on top.
|
|
10
|
+
*
|
|
11
|
+
* These plugin modules are intentionally light — they static-import only
|
|
12
|
+
* cli-core + oclif + global and dynamic-import their heavy engines at execution
|
|
13
|
+
* time — so loading them here for usage composition is cheap.
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadAllCliPlugins(searchFrom?: string): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=cli-plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-plugins.d.ts","sourceRoot":"","sources":["../../src/lib/cli-plugins.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CASzF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CLIPluginRegistry } from '@memberjunction/cli-core';
|
|
2
|
+
/**
|
|
3
|
+
* Loads all CLI plugins so their `@RegisterClass(BaseCLIPlugin, …)` decorators
|
|
4
|
+
* populate the ClassFactory — the basis for the `mj usage` / `mj <domain> usage`
|
|
5
|
+
* progressive-disclosure surface (plan §5).
|
|
6
|
+
*
|
|
7
|
+
* The metadata-sync and codegen-lib plugin entry points ship WITH the CLI, so
|
|
8
|
+
* they're loaded unconditionally as built-ins (available even when no
|
|
9
|
+
* `mj-cli-plugins.json` is present). Any third-party plugins listed in that file
|
|
10
|
+
* are then loaded on top.
|
|
11
|
+
*
|
|
12
|
+
* These plugin modules are intentionally light — they static-import only
|
|
13
|
+
* cli-core + oclif + global and dynamic-import their heavy engines at execution
|
|
14
|
+
* time — so loading them here for usage composition is cheap.
|
|
15
|
+
*/
|
|
16
|
+
export async function loadAllCliPlugins(searchFrom = process.cwd()) {
|
|
17
|
+
await import('@memberjunction/metadata-sync/plugins');
|
|
18
|
+
await import('@memberjunction/codegen-lib/plugins');
|
|
19
|
+
const { failed } = await CLIPluginRegistry.LoadPluginsFromConfig(searchFrom);
|
|
20
|
+
// Surface (don't swallow) any third-party plugin that failed to load. stderr
|
|
21
|
+
// keeps stdout clean for `--format=json` consumers.
|
|
22
|
+
for (const f of failed) {
|
|
23
|
+
process.stderr.write(`Warning: could not load CLI plugin "${f.specifier}": ${f.error}\n`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=cli-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-plugins.js","sourceRoot":"","sources":["../../src/lib/cli-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,aAAqB,OAAO,CAAC,GAAG,EAAE;IACxE,MAAM,MAAM,CAAC,uCAAuC,CAAC,CAAC;IACtD,MAAM,MAAM,CAAC,qCAAqC,CAAC,CAAC;IACpD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,iBAAiB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC7E,6EAA6E;IAC7E,oDAAoD;IACpD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Shared base for tier-2 usage commands (`mj <domain> usage`). Concrete
|
|
4
|
+
* subclasses under `commands/<domain>/usage.ts` set {@link Domain}. Returns every
|
|
5
|
+
* command in that domain — summary, flags, examples, runtime — composed from the
|
|
6
|
+
* registered plugins' `static Usage` (plan §5).
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class DomainUsageCommand extends Command {
|
|
9
|
+
static flags: {
|
|
10
|
+
format: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
/** The domain this command documents (e.g. 'sync', 'codegen'). */
|
|
13
|
+
protected abstract Domain: string;
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=domain-usage-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-usage-command.d.ts","sourceRoot":"","sources":["../../src/lib/domain-usage-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C;;;;;GAKG;AACH,8BAAsB,kBAAmB,SAAQ,OAAO;IACtD,MAAM,CAAC,KAAK;;MAEV;IAEF,kEAAkE;IAClE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAE5B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAO3B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { CLIPluginRegistry } from '@memberjunction/cli-core';
|
|
3
|
+
import { loadAllCliPlugins } from './cli-plugins.js';
|
|
4
|
+
import { emitUsage, renderDomainDetail } from './usage-render.js';
|
|
5
|
+
/**
|
|
6
|
+
* Shared base for tier-2 usage commands (`mj <domain> usage`). Concrete
|
|
7
|
+
* subclasses under `commands/<domain>/usage.ts` set {@link Domain}. Returns every
|
|
8
|
+
* command in that domain — summary, flags, examples, runtime — composed from the
|
|
9
|
+
* registered plugins' `static Usage` (plan §5).
|
|
10
|
+
*/
|
|
11
|
+
export class DomainUsageCommand extends Command {
|
|
12
|
+
static { this.flags = {
|
|
13
|
+
format: Flags.string({ options: ['text', 'json', 'md'], default: 'text', description: 'Output format' }),
|
|
14
|
+
}; }
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags } = await this.parse(this.constructor);
|
|
17
|
+
await loadAllCliPlugins(process.cwd());
|
|
18
|
+
const detail = CLIPluginRegistry.BuildDomainDetail(this.Domain);
|
|
19
|
+
const result = CLIPluginRegistry.AsResult(`${this.Domain}:usage`, { domain: detail.domain, commands: detail.commands });
|
|
20
|
+
emitUsage((m) => this.log(m), flags.format, result, renderDomainDetail(detail));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=domain-usage-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-usage-command.js","sourceRoot":"","sources":["../../src/lib/domain-us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|
2
|
+
type LogFn = (message: string) => void;
|
|
3
|
+
/**
|
|
4
|
+
* Serializes a usage {@link MJCLIResult} per `--format`, via the same
|
|
5
|
+
* {@link SerializeResult} the runtime host uses (single source of truth). For
|
|
6
|
+
* `text`, the caller supplies pre-rendered human lines.
|
|
7
|
+
*/
|
|
8
|
+
export declare function emitUsage(log: LogFn, format: string, result: MJCLIResult, textLines: string[]): void;
|
|
9
|
+
/** Human-readable tier-1 domain map. */
|
|
10
|
+
export declare function renderDomainMap(map: UsageDomainMap): string[];
|
|
11
|
+
/** Human-readable tier-2 domain detail. */
|
|
12
|
+
export declare function renderDomainDetail(detail: UsageDomainDetail): string[];
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=usage-render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-render.d.ts","sourceRoot":"","sources":["../../src/lib/usage-render.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,WAAW,EAAuC,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/J,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAEvC;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAMpG;AAED,wCAAwC;AACxC,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,EAAE,CAa7D;AAED,2CAA2C;AAC3C,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAsBtE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { SerializeResult } from '@memberjunction/cli-core';
|
|
3
|
+
/**
|
|
4
|
+
* Serializes a usage {@link MJCLIResult} per `--format`, via the same
|
|
5
|
+
* {@link SerializeResult} the runtime host uses (single source of truth). For
|
|
6
|
+
* `text`, the caller supplies pre-rendered human lines.
|
|
7
|
+
*/
|
|
8
|
+
export function emitUsage(log, format, result, textLines) {
|
|
9
|
+
if (format === 'json' || format === 'md') {
|
|
10
|
+
log(SerializeResult(result, format));
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
textLines.forEach((line) => log(line));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** Human-readable tier-1 domain map. */
|
|
17
|
+
export function renderDomainMap(map) {
|
|
18
|
+
const lines = [];
|
|
19
|
+
lines.push(chalk.bold('\nmj — command domains'));
|
|
20
|
+
lines.push(chalk.gray(map.guidance) + '\n');
|
|
21
|
+
const pad = Math.max(...map.domains.map((d) => d.domain.length), 4);
|
|
22
|
+
for (const d of map.domains) {
|
|
23
|
+
const name = chalk.cyan(d.domain.padEnd(pad));
|
|
24
|
+
const rt = chalk.gray(`[${d.runtime}]`);
|
|
25
|
+
lines.push(` ${name} ${d.summary} ${rt}`);
|
|
26
|
+
}
|
|
27
|
+
lines.push('');
|
|
28
|
+
lines.push(chalk.gray('Next: `mj <domain> usage` for that domain\'s commands, flags, and timeouts.'));
|
|
29
|
+
return lines;
|
|
30
|
+
}
|
|
31
|
+
/** Human-readable tier-2 domain detail. */
|
|
32
|
+
export function renderDomainDetail(detail) {
|
|
33
|
+
const lines = [];
|
|
34
|
+
lines.push(chalk.bold(`\nmj ${detail.domain} — commands`));
|
|
35
|
+
if (detail.commands.length === 0) {
|
|
36
|
+
lines.push(chalk.gray(` (no commands registered for domain "${detail.domain}")`));
|
|
37
|
+
return lines;
|
|
38
|
+
}
|
|
39
|
+
for (const cmd of detail.commands) {
|
|
40
|
+
lines.push('');
|
|
41
|
+
lines.push(` ${chalk.cyan(cmd.command)} — ${cmd.summary}`);
|
|
42
|
+
if (cmd.description)
|
|
43
|
+
lines.push(chalk.gray(` ${cmd.description}`));
|
|
44
|
+
lines.push(` ${chalk.gray('runtime:')} ${formatRuntime(cmd)}`);
|
|
45
|
+
if (cmd.flags?.length) {
|
|
46
|
+
lines.push(` ${chalk.gray('flags:')}`);
|
|
47
|
+
for (const f of cmd.flags)
|
|
48
|
+
lines.push(` ${chalk.yellow(f.name)} (${f.type}) — ${f.description}`);
|
|
49
|
+
}
|
|
50
|
+
if (cmd.examples?.length) {
|
|
51
|
+
lines.push(` ${chalk.gray('examples:')}`);
|
|
52
|
+
for (const e of cmd.examples)
|
|
53
|
+
lines.push(` ${e}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return lines;
|
|
57
|
+
}
|
|
58
|
+
function formatRuntime(cmd) {
|
|
59
|
+
const r = cmd.runtime;
|
|
60
|
+
const secs = r.typicalSeconds ? `~${r.typicalSeconds}s` : '';
|
|
61
|
+
const note = r.note ? ` — ${r.note}` : '';
|
|
62
|
+
return `${r.class}${secs ? ` (${secs})` : ''}${note}`;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=usage-render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-render.js","sourceRoot":"","sources":["../../src/lib/usage-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAsG,MAAM,0BAA0B,CAAC;AAI/J;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAU,EAAE,MAAc,EAAE,MAAmB,EAAE,SAAmB;IAC5F,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACzC,GAAG,CAAC,eAAe,CAAC,MAAM,EAAE,MAAsB,CAAC,CAAC,CAAC;IACvD,CAAC;SAAM,CAAC;QACN,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,eAAe,CA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IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAAC,GAAgB;IACrC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC;IACtB,MAAM,IAAI,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7D,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,OAAO,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light-commands.d.ts","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"light-commands.d.ts","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CA4D7C,CAAC"}
|
package/dist/light-commands.js
CHANGED
|
@@ -17,6 +17,13 @@ export const LIGHT_COMMANDS = new Set([
|
|
|
17
17
|
// Built-in oclif plugins
|
|
18
18
|
'version',
|
|
19
19
|
'help',
|
|
20
|
+
// Progressive-disclosure usage (tier 1 + tier 2) — composes plugin static
|
|
21
|
+
// metadata only; no bootstrap needed. Plugin entry points are light.
|
|
22
|
+
'usage',
|
|
23
|
+
'sync usage',
|
|
24
|
+
'codegen usage',
|
|
25
|
+
// Plugin registry editing — just writes mj-cli-plugins.json
|
|
26
|
+
'plugin add',
|
|
20
27
|
// Bump - uses zod, fast-glob, fs only
|
|
21
28
|
'bump',
|
|
22
29
|
// Database commands - use @memberjunction/skyway-core + config only
|
|
@@ -38,6 +45,10 @@ export const LIGHT_COMMANDS = new Set([
|
|
|
38
45
|
// SQL conversion commands - use @memberjunction/sql-converter + sqlglot-ts only
|
|
39
46
|
'sql-convert',
|
|
40
47
|
'sql-audit',
|
|
48
|
+
// Claude pack commands - use only node stdlib + the lib/claude-pack/ helpers;
|
|
49
|
+
// no MJ runtime / bootstrap needed.
|
|
50
|
+
'install:claude',
|
|
51
|
+
'update:claude',
|
|
41
52
|
// CodeGen manifest - uses @memberjunction/codegen-lib for AST scanning only, no bootstrap needed.
|
|
42
53
|
// Must be light to break the circular dependency: server-bootstrap-lite's prebuild calls
|
|
43
54
|
// `mj codegen manifest`, but bootstrap-lite must be built before MJCLI's prerun can import it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light-commands.js","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACzD,yBAAyB;IACzB,SAAS;IACT,MAAM;IAEN,sCAAsC;IACtC,MAAM;IAEN,oEAAoE;IACpE,OAAO;IACP,SAAS;IACT,iBAAiB;IACjB,gBAAgB;IAEhB,qFAAqF;IACrF,SAAS;IAET,6EAA6E;IAC7E,QAAQ;IAER,4FAA4F;IAC5F,QAAQ;IAER,kEAAkE;IAClE,IAAI;IACJ,UAAU;IACV,MAAM;IACN,OAAO;IAEP,gFAAgF;IAChF,aAAa;IACb,WAAW;IAEX,kGAAkG;IAClG,yFAAyF;IACzF,+FAA+F;IAC/F,kBAAkB;IAElB,0DAA0D;IAC1D,YAAY;IACZ,eAAe;IACf,cAAc;IACd,6BAA6B;IAC7B,wBAAwB;IACxB,aAAa;IACb,cAAc;CACf,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"light-commands.js","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACzD,yBAAyB;IACzB,SAAS;IACT,MAAM;IAEN,0EAA0E;IAC1E,qEAAqE;IACrE,OAAO;IACP,YAAY;IACZ,eAAe;IAEf,4DAA4D;IAC5D,YAAY;IAEZ,sCAAsC;IACtC,MAAM;IAEN,oEAAoE;IACpE,OAAO;IACP,SAAS;IACT,iBAAiB;IACjB,gBAAgB;IAEhB,qFAAqF;IACrF,SAAS;IAET,6EAA6E;IAC7E,QAAQ;IAER,4FAA4F;IAC5F,QAAQ;IAER,kEAAkE;IAClE,IAAI;IACJ,UAAU;IACV,MAAM;IACN,OAAO;IAEP,gFAAgF;IAChF,aAAa;IACb,WAAW;IAEX,8EAA8E;IAC9E,oCAAoC;IACpC,gBAAgB;IAChB,eAAe;IAEf,kGAAkG;IAClG,yFAAyF;IACzF,+FAA+F;IAC/F,kBAAkB;IAElB,0DAA0D;IAC1D,YAAY;IACZ,eAAe;IACf,cAAc;IACd,6BAA6B;IAC7B,wBAAwB;IACxB,aAAa;IACb,cAAc;CACf,CAAC,CAAC"}
|