@zalosai/zalos-cli 0.2.31 → 0.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/commands/close.js +79 -44
- package/dist/commands/onboard-input.js +81 -14
- package/dist/commands/registry-add-agent.js +98 -0
- package/dist/commands/team-skill.js +158 -0
- package/dist/commands/worker.js +131 -0
- package/dist/main.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,6 +101,23 @@ Creation requires team owner access. The preview provides a stable operation key
|
|
|
101
101
|
checksum, and destination origin for apply. Import accepts at most 1,000 rows and
|
|
102
102
|
a 1 MB request. Workflow writer grants are separate and preview by default.
|
|
103
103
|
|
|
104
|
+
## Team skills
|
|
105
|
+
|
|
106
|
+
A Team skill is a folder with `SKILL.md` (YAML frontmatter with `description` and an
|
|
107
|
+
optional display `name`, then the instructions) and optional text files under
|
|
108
|
+
`scripts/`, `references/` and `assets/`. The slug defaults to the folder name.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
zl --environment staging team-skill list
|
|
112
|
+
zl --environment staging team-skill push ./accruals-glossary # preview
|
|
113
|
+
zl --environment staging team-skill push ./accruals-glossary --apply --publish
|
|
114
|
+
zl --environment staging team-skill publish accruals-glossary --apply
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`push` creates the skill or replaces the draft of the one with the same slug,
|
|
118
|
+
including its files. Workers use only published versions. Writing needs a team
|
|
119
|
+
owner or admin; deleting stays in the app.
|
|
120
|
+
|
|
104
121
|
## Product operations
|
|
105
122
|
|
|
106
123
|
```bash
|
package/dist/commands/close.js
CHANGED
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
import { registerOnboardInput } from './onboard-input.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { registerAddAgent } from './registry-add-agent.js';
|
|
3
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
|
|
4
5
|
import { client } from '../client.js';
|
|
5
6
|
import { currentEnvironment } from '../environments.js';
|
|
6
7
|
import { ValidationError } from '../utils/errors.js';
|
|
7
8
|
import { printJson } from '../utils/output.js';
|
|
8
9
|
import { action, dataRow, isRow, resourceId } from '../utils/product-api.js';
|
|
9
10
|
const APPLY_TIMEOUT_MS = 120_000;
|
|
11
|
+
function positiveVersion(value) {
|
|
12
|
+
const version = Number(value);
|
|
13
|
+
if (!Number.isSafeInteger(version) || version < 1)
|
|
14
|
+
throw new ValidationError('expected-version', 'Expected a positive registry version');
|
|
15
|
+
return version;
|
|
16
|
+
}
|
|
17
|
+
function confirmDigest(value) {
|
|
18
|
+
if (!/^[a-f0-9]{64}$/.test(value))
|
|
19
|
+
throw new ValidationError('confirm', 'Expected the preview confirmation digest');
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
/** `bank=/bank:Bank` → a source keyed `bank` in Team Files `/bank`, named Bank. */
|
|
23
|
+
export function parseSourceOption(value) {
|
|
24
|
+
const match = /^([a-z0-9][a-z0-9_.]*)=(\/[^:]*)(?::(.+))?$/.exec(value);
|
|
25
|
+
if (!match)
|
|
26
|
+
throw new ValidationError('source', `Expected key=/folder:Name, got ${value}`);
|
|
27
|
+
const [, key, folder, name] = match;
|
|
28
|
+
return { key, folder, name: name ?? key, description: '' };
|
|
29
|
+
}
|
|
30
|
+
/** The exported document as YAML, with its version and hash in a header comment. */
|
|
31
|
+
export function registryYaml(result) {
|
|
32
|
+
return (`# Mesh finance registry, team ${String(result.teamId)}, version ${String(result.registryVersion)}\n` +
|
|
33
|
+
`# sha256 ${String(result.documentHash)}\n` +
|
|
34
|
+
stringifyYaml(result.document));
|
|
35
|
+
}
|
|
10
36
|
async function readCatalogJson(location) {
|
|
11
37
|
let text;
|
|
12
38
|
if (/^https?:\/\//.test(location)) {
|
|
@@ -27,8 +53,8 @@ async function readCatalogJson(location) {
|
|
|
27
53
|
}
|
|
28
54
|
}
|
|
29
55
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
56
|
+
* Deprecated: applies a git overlay and a local catalog file to a team not yet migrated to the
|
|
57
|
+
* Mesh registry document. Mesh never fetches the catalog itself; a migrated team refuses this.
|
|
32
58
|
*/
|
|
33
59
|
export async function applyRegistryAction(options) {
|
|
34
60
|
const overlayText = await readFile(options.file, 'utf8');
|
|
@@ -49,17 +75,7 @@ export async function applyRegistryAction(options) {
|
|
|
49
75
|
};
|
|
50
76
|
if (options.revision)
|
|
51
77
|
payload.revision = options.revision;
|
|
52
|
-
|
|
53
|
-
payload.catalog = await readCatalogJson(options.catalog);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
if (!isRow(overlay.catalog)) {
|
|
57
|
-
throw new ValidationError('catalog', 'Pass --catalog, or pin catalog in the overlay');
|
|
58
|
-
}
|
|
59
|
-
// Only where the catalog lives; `catalog.client` stays in the overlay, which the server reads.
|
|
60
|
-
const { repository, revision, path } = overlay.catalog;
|
|
61
|
-
payload.catalogRef = { repository, revision: options.revision ?? revision, path };
|
|
62
|
-
}
|
|
78
|
+
payload.catalog = await readCatalogJson(options.catalog);
|
|
63
79
|
printJson(dataRow(await client.post('/developer/finance/registry/apply', payload, {
|
|
64
80
|
timeoutMs: APPLY_TIMEOUT_MS,
|
|
65
81
|
})));
|
|
@@ -74,10 +90,10 @@ export function registerCloseCommand(program) {
|
|
|
74
90
|
.description("A client's finance registry: sources, datasets, agents and close tasks");
|
|
75
91
|
registry
|
|
76
92
|
.command('apply')
|
|
77
|
-
.description('
|
|
93
|
+
.description('Deprecated: apply a git overlay and catalog file to a team not yet migrated; prints the diff')
|
|
78
94
|
.requiredOption('--file <overlay.yaml>', 'Client overlay YAML')
|
|
79
95
|
.requiredOption('--team-id <ref>', 'Target team public ID (preferred) or UUID')
|
|
80
|
-
.
|
|
96
|
+
.requiredOption('--catalog <path-or-url>', 'Catalog JSON file or URL')
|
|
81
97
|
.option('--revision <sha>', 'Catalog revision to pin; default: the overlay pin')
|
|
82
98
|
.option('--dry-run', 'Print the diff without writing anything')
|
|
83
99
|
.action(async (o) => action(() => applyRegistryAction(o)));
|
|
@@ -100,41 +116,60 @@ export function registerCloseCommand(program) {
|
|
|
100
116
|
})));
|
|
101
117
|
}));
|
|
102
118
|
registry
|
|
103
|
-
.command('
|
|
104
|
-
.description(
|
|
105
|
-
.requiredOption('--team-id <ref>', 'Team public ID or UUID')
|
|
106
|
-
.requiredOption('--expected-version <number>', 'Active registry version
|
|
107
|
-
.option('--
|
|
108
|
-
.option('--
|
|
119
|
+
.command('migrate')
|
|
120
|
+
.description("Convert a team's registry into the Mesh document and make Mesh its owner; previews unless --confirm")
|
|
121
|
+
.requiredOption('--team-id <ref>', 'Team public ID or UUID (select it before confirming)')
|
|
122
|
+
.requiredOption('--expected-version <number>', 'Active registry version')
|
|
123
|
+
.option('--confirm <digest>', 'Publish the previewed migration with its confirmation digest')
|
|
124
|
+
.option('--output <file.yaml>', 'Also write the converted document as YAML for review')
|
|
109
125
|
.action(async (o) => action(async () => {
|
|
110
|
-
const
|
|
111
|
-
if (!Number.isSafeInteger(expectedVersion) || expectedVersion < 1)
|
|
112
|
-
throw new ValidationError('expected-version', 'Expected a positive registry version');
|
|
113
|
-
printJson(dataRow(await client.post('/developer/finance/registry/import-baseline', {
|
|
126
|
+
const result = dataRow(await client.post('/developer/finance/registry/migrate', {
|
|
114
127
|
teamId: resourceId(o.teamId),
|
|
115
|
-
expectedVersion,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
128
|
+
expectedVersion: positiveVersion(o.expectedVersion),
|
|
129
|
+
...(o.confirm ? { confirm: confirmDigest(o.confirm) } : {}),
|
|
130
|
+
}, { timeoutMs: APPLY_TIMEOUT_MS }));
|
|
131
|
+
if (o.output)
|
|
132
|
+
await writeFile(o.output, stringifyYaml(result.document));
|
|
133
|
+
// The document can be long; --output holds it, the summary stays readable.
|
|
134
|
+
printJson(o.output ? { ...result, document: `written to ${o.output}` } : result);
|
|
121
135
|
}));
|
|
122
136
|
registry
|
|
123
|
-
.command('
|
|
124
|
-
.description(
|
|
137
|
+
.command('init')
|
|
138
|
+
.description("Start a new team's registry in Mesh: version 1, Mesh-owned, with its close template")
|
|
125
139
|
.requiredOption('--team-id <ref>', 'Selected team public ID or UUID')
|
|
126
|
-
.requiredOption('--
|
|
127
|
-
.requiredOption('--
|
|
140
|
+
.requiredOption('--client <key>', 'Client key, e.g. acme')
|
|
141
|
+
.requiredOption('--template-name <name>', 'Books close template name')
|
|
142
|
+
.option('--template-description <text>', 'Template description')
|
|
143
|
+
.option('--recurrence <monthly|quarterly|yearly>', 'Close recurrence', 'monthly')
|
|
144
|
+
.option('--source <key=folder:name>', 'A source and its Team Files folder, e.g. bank=/bank:Bank (repeatable)', (value, previous = []) => [...previous, value])
|
|
145
|
+
.action(async (o) => action(async () => {
|
|
146
|
+
printJson(dataRow(await client.post('/developer/finance/registry/init', {
|
|
147
|
+
teamId: resourceId(o.teamId),
|
|
148
|
+
client: o.client,
|
|
149
|
+
template: {
|
|
150
|
+
name: o.templateName,
|
|
151
|
+
description: o.templateDescription ?? null,
|
|
152
|
+
recurrence: o.recurrence,
|
|
153
|
+
},
|
|
154
|
+
sources: (o.source ?? []).map(parseSourceOption),
|
|
155
|
+
})));
|
|
156
|
+
}));
|
|
157
|
+
registry
|
|
158
|
+
.command('export')
|
|
159
|
+
.description("Print a Mesh-native team's registry document as YAML")
|
|
160
|
+
.requiredOption('--team-id <ref>', 'Team public ID or UUID')
|
|
161
|
+
.option('--output <file.yaml>', 'Write the YAML to a file instead')
|
|
128
162
|
.action(async (o) => action(async () => {
|
|
129
|
-
const
|
|
130
|
-
if (!Number.isSafeInteger(expectedVersion) || expectedVersion < 1)
|
|
131
|
-
throw new ValidationError('expected-version', 'Expected a positive registry version');
|
|
132
|
-
printJson(dataRow(await client.post('/developer/finance/registry/adopt-baseline', {
|
|
163
|
+
const result = dataRow(await client.get('/developer/finance/registry/export', {
|
|
133
164
|
teamId: resourceId(o.teamId),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
165
|
+
}));
|
|
166
|
+
const yaml = registryYaml(result);
|
|
167
|
+
if (o.output)
|
|
168
|
+
await writeFile(o.output, yaml);
|
|
169
|
+
else
|
|
170
|
+
process.stdout.write(yaml);
|
|
137
171
|
}));
|
|
138
172
|
registerOnboardInput(registry);
|
|
173
|
+
registerAddAgent(registry);
|
|
139
174
|
}
|
|
140
175
|
//# sourceMappingURL=close.js.map
|
|
@@ -5,6 +5,30 @@ import { readProfile } from '../credentials.js';
|
|
|
5
5
|
import { printJson } from '../utils/output.js';
|
|
6
6
|
import { action, dataRow, resourceId } from '../utils/product-api.js';
|
|
7
7
|
import { profileSample } from './registry-sample.js';
|
|
8
|
+
/** Named report windows a finance input can read, as month offsets from the close period. */
|
|
9
|
+
const NAMED_WINDOWS = {
|
|
10
|
+
period: 0,
|
|
11
|
+
prior_period: -1,
|
|
12
|
+
next_period: 1,
|
|
13
|
+
prior_year: -12,
|
|
14
|
+
};
|
|
15
|
+
/** Any other month within two years: period-N or period+N. Mesh checks the same pattern. */
|
|
16
|
+
const OFFSET_WINDOW = /^period[+-]([1-9]|1[0-9]|2[0-4])$/;
|
|
17
|
+
const WINDOW_CHOICES = Object.keys(NAMED_WINDOWS).join(', ') + ', or period-N / period+N (N ≤ 24)';
|
|
18
|
+
function windowOffset(window) {
|
|
19
|
+
if (Object.hasOwn(NAMED_WINDOWS, window))
|
|
20
|
+
return NAMED_WINDOWS[window];
|
|
21
|
+
return OFFSET_WINDOW.test(window) ? Number(window.slice('period'.length)) : null;
|
|
22
|
+
}
|
|
23
|
+
function assertWindow(window) {
|
|
24
|
+
if (windowOffset(window) === null)
|
|
25
|
+
throw new Error('Choose a window: ' + WINDOW_CHOICES);
|
|
26
|
+
return window;
|
|
27
|
+
}
|
|
28
|
+
/** Two spellings of the same month (`prior_year` and `period-12`) are the same window. */
|
|
29
|
+
function sameWindow(a, b) {
|
|
30
|
+
return windowOffset(a) === windowOffset(b);
|
|
31
|
+
}
|
|
8
32
|
function matchingHeaders(sample, spec, names) {
|
|
9
33
|
const parser = spec.parser;
|
|
10
34
|
if (!parser ||
|
|
@@ -66,6 +90,8 @@ function suggestedWindow(field) {
|
|
|
66
90
|
return 'next_period';
|
|
67
91
|
if (/(?:^|_)(?:previous|prior|last)_(?:month|period)(?:_|$)/.test(words))
|
|
68
92
|
return 'prior_period';
|
|
93
|
+
if (/(?:^|_)(?:previous|prior|last)_year(?:_|$)/.test(words))
|
|
94
|
+
return 'prior_year';
|
|
69
95
|
return 'period';
|
|
70
96
|
}
|
|
71
97
|
export async function onboardInput(o) {
|
|
@@ -73,6 +99,8 @@ export async function onboardInput(o) {
|
|
|
73
99
|
if (!ref)
|
|
74
100
|
throw new Error('Select a team or specify --team-id');
|
|
75
101
|
const teamId = resourceId(ref), workflowId = resourceId(o.workflowId), field = o.field;
|
|
102
|
+
if (o.window)
|
|
103
|
+
assertWindow(o.window);
|
|
76
104
|
const [inputResponse, registryResponse] = await Promise.all([
|
|
77
105
|
client.get('/developer/finance/registry/inspect-input', { teamId, workflowId, field }),
|
|
78
106
|
client.get('/developer/finance/registry', { teamId }),
|
|
@@ -81,8 +109,8 @@ export async function onboardInput(o) {
|
|
|
81
109
|
if (input.registeredAgent === false)
|
|
82
110
|
throw new Error('Register this workflow as a finance registry agent before onboarding its inputs');
|
|
83
111
|
const registry = dataRow(registryResponse);
|
|
84
|
-
if (registry.
|
|
85
|
-
throw new Error('Dataset onboarding
|
|
112
|
+
if (!registry.meshNative)
|
|
113
|
+
throw new Error('Dataset onboarding edits the Mesh registry document: run zl close registry migrate for this team first');
|
|
86
114
|
const extension = extname(o.sample).toLowerCase();
|
|
87
115
|
if (input.input.acceptedFileTypes?.length &&
|
|
88
116
|
!input.input.acceptedFileTypes.map((t) => t.toLowerCase()).includes(extension))
|
|
@@ -176,14 +204,8 @@ export async function onboardInput(o) {
|
|
|
176
204
|
if (!match)
|
|
177
205
|
throw new Error('Choose one of the matching datasets');
|
|
178
206
|
const windowHint = suggestedWindow(field);
|
|
179
|
-
const prompt = 'Use ' +
|
|
180
|
-
|
|
181
|
-
' for ' +
|
|
182
|
-
field +
|
|
183
|
-
' in which report window (period, prior_period, next_period)?';
|
|
184
|
-
const window = o.window ?? (terminal ? await ask(prompt, windowHint) : windowHint);
|
|
185
|
-
if (!['period', 'prior_period', 'next_period'].includes(window))
|
|
186
|
-
throw new Error('Choose period, prior_period or next_period');
|
|
207
|
+
const prompt = 'Use ' + key + ' for ' + field + ' in which report window (' + WINDOW_CHOICES + ')?';
|
|
208
|
+
const window = assertWindow(o.window ?? (terminal ? await ask(prompt, windowHint) : windowHint));
|
|
187
209
|
const confirmed = Boolean(o.window || terminal);
|
|
188
210
|
const details = {
|
|
189
211
|
...context,
|
|
@@ -242,7 +264,7 @@ export async function onboardInput(o) {
|
|
|
242
264
|
current.spec.contract.sha256 === previous.contract?.sha256 &&
|
|
243
265
|
registry.latestVersion?.version === input.registryVersion &&
|
|
244
266
|
(!o.datasetKey || o.datasetKey === previous.datasetKey) &&
|
|
245
|
-
(!o.window || o.window
|
|
267
|
+
(!o.window || sameWindow(o.window, previous.window)) &&
|
|
246
268
|
(!o.rules || o.rules === 'inherit')) {
|
|
247
269
|
const matchedHeaders = matchingHeaders(sample, current.spec);
|
|
248
270
|
if (matchedHeaders) {
|
|
@@ -265,6 +287,51 @@ export async function onboardInput(o) {
|
|
|
265
287
|
return;
|
|
266
288
|
}
|
|
267
289
|
}
|
|
290
|
+
// Same dataset, another report window: rebind the input without authoring a dataset.
|
|
291
|
+
if (previous &&
|
|
292
|
+
current &&
|
|
293
|
+
!current.retired &&
|
|
294
|
+
o.window &&
|
|
295
|
+
!sameWindow(o.window, previous.window) &&
|
|
296
|
+
(!o.datasetKey || o.datasetKey === previous.datasetKey) &&
|
|
297
|
+
(!o.source || o.source === previous.source) &&
|
|
298
|
+
(!o.rules || o.rules === 'inherit') &&
|
|
299
|
+
current.spec.contract?.sha256 &&
|
|
300
|
+
current.spec.contract.sha256 === previous.contract?.sha256 &&
|
|
301
|
+
registry.latestVersion?.version === input.registryVersion) {
|
|
302
|
+
const matchedHeaders = matchingHeaders(sample, current.spec);
|
|
303
|
+
if (!matchedHeaders)
|
|
304
|
+
throw new Error('Sample does not match ' +
|
|
305
|
+
previous.datasetKey +
|
|
306
|
+
'. Pass --dataset-key with a new key to author a dataset instead.');
|
|
307
|
+
await publish({
|
|
308
|
+
teamId,
|
|
309
|
+
workflowId,
|
|
310
|
+
field,
|
|
311
|
+
authoredDate: new Date().toISOString().slice(0, 10),
|
|
312
|
+
expectedVersion: input.registryVersion,
|
|
313
|
+
workflowVersionId: input.workflowVersionId,
|
|
314
|
+
archiveSha256: input.package.archiveSha256,
|
|
315
|
+
existingContractSha256: current.spec.contract.sha256,
|
|
316
|
+
format: sample.format,
|
|
317
|
+
columns: sample.columns,
|
|
318
|
+
sizeBytes: sample.sizeBytes,
|
|
319
|
+
source: previous.source,
|
|
320
|
+
datasetKey: previous.datasetKey,
|
|
321
|
+
name: previous.datasetKey,
|
|
322
|
+
window: o.window,
|
|
323
|
+
rules: 'inherit',
|
|
324
|
+
}, 'Read ' +
|
|
325
|
+
previous.datasetKey +
|
|
326
|
+
' for ' +
|
|
327
|
+
field +
|
|
328
|
+
' from ' +
|
|
329
|
+
o.window +
|
|
330
|
+
' instead of ' +
|
|
331
|
+
previous.window +
|
|
332
|
+
' and publish?', { headerRow: sample.headerRow, matchedHeaders });
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
268
335
|
if (!o.preview) {
|
|
269
336
|
process.stderr.write('Inferred headers (row ' +
|
|
270
337
|
sample.headerRow +
|
|
@@ -298,9 +365,9 @@ export async function onboardInput(o) {
|
|
|
298
365
|
throw new Error('Choose a new key in source.dataset format with --dataset-key');
|
|
299
366
|
datasetKey = await ask('Choose an unused key in source.dataset format');
|
|
300
367
|
}
|
|
301
|
-
const window = o.window ??
|
|
368
|
+
const window = assertWindow(o.window ??
|
|
302
369
|
previous?.window ??
|
|
303
|
-
(await ask('Input window (
|
|
370
|
+
(await ask('Input window (' + WINDOW_CHOICES + ')', 'period')));
|
|
304
371
|
const compatible = current?.spec.parser?.kind === sample.format.kind;
|
|
305
372
|
const rules = o.rules ??
|
|
306
373
|
(compatible
|
|
@@ -346,7 +413,7 @@ export function registerOnboardInput(registry) {
|
|
|
346
413
|
.option('--source <key>', 'Existing registry source')
|
|
347
414
|
.option('--dataset-key <key>', 'Select a matching dataset for an unbound input, or choose a new dataset key')
|
|
348
415
|
.option('--rules <mode>', 'inherit compatible rules from the bound dataset, or table')
|
|
349
|
-
.option('--window <window>', 'Input window (
|
|
416
|
+
.option('--window <window>', 'Input window (' + WINDOW_CHOICES + ')')
|
|
350
417
|
.option('--sheet <name>', 'Workbook worksheet')
|
|
351
418
|
.option('--header-row <number>', 'One-based sample header row')
|
|
352
419
|
.option('--delimiter <character>', 'CSV delimiter')
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { client } from '../client.js';
|
|
2
|
+
import { ValidationError } from '../utils/errors.js';
|
|
3
|
+
import { printJson } from '../utils/output.js';
|
|
4
|
+
import { action, dataRow, isRow, resourceId } from '../utils/product-api.js';
|
|
5
|
+
const PATH = '/developer/finance/registry/add-agent';
|
|
6
|
+
function collect(value, previous = []) {
|
|
7
|
+
return [...previous, value];
|
|
8
|
+
}
|
|
9
|
+
function pairs(values, option) {
|
|
10
|
+
if (!values?.length)
|
|
11
|
+
return undefined;
|
|
12
|
+
return Object.fromEntries(values.map((value) => {
|
|
13
|
+
const at = value.indexOf('=');
|
|
14
|
+
if (at < 1)
|
|
15
|
+
throw new ValidationError(option, `Expected name=value, got ${value}`);
|
|
16
|
+
return [value.slice(0, at), value.slice(at + 1)];
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
/** The request body `add-agent` sends; exported for tests. */
|
|
20
|
+
export function addAgentRequest(o) {
|
|
21
|
+
const expectedVersion = Number(o.expectedVersion);
|
|
22
|
+
if (!Number.isSafeInteger(expectedVersion) || expectedVersion < 1)
|
|
23
|
+
throw new ValidationError('expected-version', 'Expected a positive registry version');
|
|
24
|
+
if (o.preview && o.confirm)
|
|
25
|
+
throw new ValidationError('confirm', 'Pass either --preview or --confirm, not both');
|
|
26
|
+
if (o.confirm && !/^[a-f0-9]{64}$/.test(o.confirm))
|
|
27
|
+
throw new ValidationError('confirm', 'Expected the preview confirmation digest');
|
|
28
|
+
const hasTaskFields = [o.category, o.dueDayOffset, o.description].some((v) => v !== undefined);
|
|
29
|
+
if (hasTaskFields && !o.taskTitle)
|
|
30
|
+
throw new ValidationError('task-title', 'Name the task with --task-title');
|
|
31
|
+
let dueDayOffset;
|
|
32
|
+
if (o.dueDayOffset !== undefined) {
|
|
33
|
+
dueDayOffset = Number(o.dueDayOffset);
|
|
34
|
+
if (!Number.isSafeInteger(dueDayOffset) || dueDayOffset < 0)
|
|
35
|
+
throw new ValidationError('due-day-offset', 'Expected business days after period end');
|
|
36
|
+
}
|
|
37
|
+
const sources = o.newSource?.map((text) => {
|
|
38
|
+
let source;
|
|
39
|
+
try {
|
|
40
|
+
source = JSON.parse(text);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
throw new ValidationError('new-source', 'Expected a JSON object');
|
|
44
|
+
}
|
|
45
|
+
if (!isRow(source))
|
|
46
|
+
throw new ValidationError('new-source', 'Expected {key, name, description, folder}');
|
|
47
|
+
return source;
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
teamId: resourceId(o.teamId),
|
|
51
|
+
expectedVersion,
|
|
52
|
+
agentKey: o.agentKey,
|
|
53
|
+
...(o.name ? { name: o.name } : {}),
|
|
54
|
+
...(o.workflowId ? { workflowId: resourceId(o.workflowId) } : {}),
|
|
55
|
+
...(o.param?.length ? { parameters: pairs(o.param, 'param') } : {}),
|
|
56
|
+
...(sources?.length ? { sources } : {}),
|
|
57
|
+
...(o.taskTitle
|
|
58
|
+
? {
|
|
59
|
+
task: {
|
|
60
|
+
title: o.taskTitle,
|
|
61
|
+
...(o.category !== undefined ? { category: o.category } : {}),
|
|
62
|
+
...(dueDayOffset !== undefined ? { dueDayOffset } : {}),
|
|
63
|
+
...(o.description !== undefined ? { description: o.description } : {}),
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
: {}),
|
|
67
|
+
openPeriods: o.openPeriods !== false,
|
|
68
|
+
...(o.confirm ? { confirm: o.confirm } : {}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Adds a catalog agent to a Mesh-owned finance registry and/or links the close task that runs
|
|
73
|
+
* it. Without `--confirm` it previews and prints the digest to confirm with.
|
|
74
|
+
*/
|
|
75
|
+
export async function addAgentAction(o) {
|
|
76
|
+
printJson(dataRow(await client.post(PATH, addAgentRequest(o), { timeoutMs: 120_000 })));
|
|
77
|
+
}
|
|
78
|
+
export function registerAddAgent(registry) {
|
|
79
|
+
registry
|
|
80
|
+
.command('add-agent')
|
|
81
|
+
.description('Add an agent to a Mesh-native registry and/or a close task that runs it; previews unless --confirm')
|
|
82
|
+
.requiredOption('--team-id <ref>', 'Team public ID or UUID (select it before confirming)')
|
|
83
|
+
.requiredOption('--expected-version <number>', 'Active registry version')
|
|
84
|
+
.requiredOption('--agent-key <key>', 'Agent key: one in the registry, or a new one Mesh defines from its workflow')
|
|
85
|
+
.option('--workflow-id <id>', "The agent's runtime workflow in this team. A new agent is defined from its runtime package, its file inputs unbound until onboard-input binds them")
|
|
86
|
+
.option('--name <name>', 'Display name for an agent Mesh defines from its workflow')
|
|
87
|
+
.option('--task-title <title>', 'Close task that runs the agent; an existing title is linked')
|
|
88
|
+
.option('--category <category>', 'New task category')
|
|
89
|
+
.option('--due-day-offset <days>', 'New task due date, business days after period end')
|
|
90
|
+
.option('--description <text>', 'New task description')
|
|
91
|
+
.option('--param <name=value>', 'Agent parameter value (repeatable)', collect)
|
|
92
|
+
.option('--new-source <json>', 'New source {key,name,description,folder} (repeatable)', collect)
|
|
93
|
+
.option('--no-open-periods', 'Leave periods that are already open unchanged')
|
|
94
|
+
.option('--preview', 'Print the proposed changes and digest without publishing (default)')
|
|
95
|
+
.option('--confirm <digest>', 'Publish the previewed change with its confirmation digest')
|
|
96
|
+
.action(async (o) => action(() => addAgentAction(o)));
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=registry-add-agent.js.map
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
2
|
+
import { basename, join, resolve } from 'node:path';
|
|
3
|
+
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
import { client } from '../client.js';
|
|
5
|
+
import { ValidationError } from '../utils/errors.js';
|
|
6
|
+
import { printJson, printList } from '../utils/output.js';
|
|
7
|
+
import { action, dataRow, dataRows, fields, resourceId } from '../utils/product-api.js';
|
|
8
|
+
/** Mirrors the server's slug rule so a bad folder name fails before any request. */
|
|
9
|
+
const SLUG = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
10
|
+
/** The server accepts skill files only under these folders; everything else is left out. */
|
|
11
|
+
const FILE_FOLDERS = ['scripts', 'references', 'assets'];
|
|
12
|
+
const IGNORED_ENTRIES = new Set(['__pycache__', 'node_modules']);
|
|
13
|
+
function splitFrontmatter(text) {
|
|
14
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(text);
|
|
15
|
+
if (!match)
|
|
16
|
+
throw new ValidationError('SKILL.md', 'SKILL.md must start with --- frontmatter ---');
|
|
17
|
+
const parsed = parseYaml(match[1]);
|
|
18
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
19
|
+
throw new ValidationError('SKILL.md', 'SKILL.md frontmatter must be a YAML mapping');
|
|
20
|
+
return { frontmatter: parsed, body: text.slice(match[0].length).replace(/^\s*\n/, '') };
|
|
21
|
+
}
|
|
22
|
+
async function collectFiles(root, folder) {
|
|
23
|
+
const files = [];
|
|
24
|
+
const walk = async (relativeDir) => {
|
|
25
|
+
let entries;
|
|
26
|
+
try {
|
|
27
|
+
entries = await readdir(join(root, relativeDir), { withFileTypes: true });
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error && typeof error === 'object' && 'code' in error && error.code === 'ENOENT')
|
|
31
|
+
return;
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name, 'en'))) {
|
|
35
|
+
if (entry.name.startsWith('.') || IGNORED_ENTRIES.has(entry.name))
|
|
36
|
+
continue;
|
|
37
|
+
const path = `${relativeDir}/${entry.name}`;
|
|
38
|
+
if (entry.isDirectory())
|
|
39
|
+
await walk(path);
|
|
40
|
+
else if (entry.isFile())
|
|
41
|
+
files.push({ path, content: await readFile(join(root, path), 'utf8') });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
await walk(folder);
|
|
45
|
+
return files;
|
|
46
|
+
}
|
|
47
|
+
/** Reads a skill folder: SKILL.md (frontmatter + instructions) and its scripts, references and assets. */
|
|
48
|
+
export async function readTeamSkillSource(directory, slugOption) {
|
|
49
|
+
const root = resolve(directory);
|
|
50
|
+
const { frontmatter, body } = splitFrontmatter(await readFile(join(root, 'SKILL.md'), 'utf8'));
|
|
51
|
+
const slug = slugOption ?? basename(root);
|
|
52
|
+
if (!SLUG.test(slug))
|
|
53
|
+
throw new ValidationError('slug', `"${slug}" is not a valid skill slug; use --slug with lowercase letters, numbers and hyphens`);
|
|
54
|
+
const description = frontmatter.description;
|
|
55
|
+
if (typeof description !== 'string' || !description.trim())
|
|
56
|
+
throw new ValidationError('description', 'SKILL.md frontmatter needs a description');
|
|
57
|
+
const name = frontmatter.name ?? slug;
|
|
58
|
+
if (typeof name !== 'string' || !name.trim())
|
|
59
|
+
throw new ValidationError('name', 'SKILL.md frontmatter name must be text');
|
|
60
|
+
if (!body.trim())
|
|
61
|
+
throw new ValidationError('SKILL.md', 'SKILL.md needs instructions after the frontmatter');
|
|
62
|
+
const files = (await Promise.all(FILE_FOLDERS.map((folder) => collectFiles(root, folder)))).flat();
|
|
63
|
+
return { slug, name: name.trim(), description: description.trim(), body, files };
|
|
64
|
+
}
|
|
65
|
+
async function findSkill(slug) {
|
|
66
|
+
return dataRows(await client.get('/team-skills')).find((skill) => skill.slug === slug) ?? null;
|
|
67
|
+
}
|
|
68
|
+
function skillId(skill) {
|
|
69
|
+
if (typeof skill.id !== 'string')
|
|
70
|
+
throw new ValidationError('team-skill', 'Invalid server skill');
|
|
71
|
+
return resourceId(skill.id);
|
|
72
|
+
}
|
|
73
|
+
export async function listTeamSkillsAction(options) {
|
|
74
|
+
const rows = dataRows(await client.get('/team-skills')).map((skill) => ({
|
|
75
|
+
id: skill.id,
|
|
76
|
+
slug: skill.slug,
|
|
77
|
+
name: skill.name,
|
|
78
|
+
description: skill.description,
|
|
79
|
+
published: Boolean(skill.published),
|
|
80
|
+
updatedAt: skill.updatedAt,
|
|
81
|
+
}));
|
|
82
|
+
printList(rows, options.fields, undefined);
|
|
83
|
+
}
|
|
84
|
+
/** Creates or updates a Team skill draft from a local folder; previews unless --apply. */
|
|
85
|
+
export async function pushTeamSkillAction(directory, options) {
|
|
86
|
+
const source = await readTeamSkillSource(directory, options.slug);
|
|
87
|
+
const existing = await findSkill(source.slug);
|
|
88
|
+
const plan = {
|
|
89
|
+
operation: existing ? 'update' : 'create',
|
|
90
|
+
slug: source.slug,
|
|
91
|
+
name: source.name,
|
|
92
|
+
description: source.description,
|
|
93
|
+
bodyChars: source.body.length,
|
|
94
|
+
files: source.files.map((file) => file.path),
|
|
95
|
+
publish: Boolean(options.publish),
|
|
96
|
+
...(existing ? { id: existing.id, published: Boolean(existing.published) } : {}),
|
|
97
|
+
};
|
|
98
|
+
if (!options.apply || options.dryRun) {
|
|
99
|
+
printJson({ dryRun: true, ...plan });
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const draft = {
|
|
103
|
+
name: source.name,
|
|
104
|
+
description: source.description,
|
|
105
|
+
body: source.body,
|
|
106
|
+
files: source.files,
|
|
107
|
+
};
|
|
108
|
+
const saved = dataRow(existing
|
|
109
|
+
? await client.put(`/team-skills/${skillId(existing)}`, draft)
|
|
110
|
+
: await client.post('/team-skills', { slug: source.slug, ...draft }));
|
|
111
|
+
const published = options.publish
|
|
112
|
+
? dataRow(await client.post(`/team-skills/${skillId(saved)}/publish`, {}))
|
|
113
|
+
: null;
|
|
114
|
+
printJson({
|
|
115
|
+
data: {
|
|
116
|
+
operation: plan.operation,
|
|
117
|
+
id: saved.id,
|
|
118
|
+
slug: saved.slug,
|
|
119
|
+
files: plan.files,
|
|
120
|
+
...(published ? { published } : {}),
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/** Publishes a Team skill's current draft as its next version; previews unless --apply. */
|
|
125
|
+
export async function publishTeamSkillAction(slug, options) {
|
|
126
|
+
const skill = await findSkill(slug);
|
|
127
|
+
if (!skill)
|
|
128
|
+
throw new ValidationError('slug', `No Team skill with slug "${slug}"`);
|
|
129
|
+
if (!options.apply || options.dryRun) {
|
|
130
|
+
printJson({ dryRun: true, id: skill.id, slug, published: Boolean(skill.published) });
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
printJson({ data: dataRow(await client.post(`/team-skills/${skillId(skill)}/publish`, {})) });
|
|
134
|
+
}
|
|
135
|
+
export function registerTeamSkillCommand(program) {
|
|
136
|
+
const command = program
|
|
137
|
+
.command('team-skill')
|
|
138
|
+
.description('Create, update and publish Team skills that Workers use');
|
|
139
|
+
command
|
|
140
|
+
.command('list')
|
|
141
|
+
.description('List Team skills in the selected team')
|
|
142
|
+
.action(async () => action(async () => listTeamSkillsAction(fields(program))));
|
|
143
|
+
command
|
|
144
|
+
.command('push <directory>')
|
|
145
|
+
.description('Create or update a Team skill draft from a folder with SKILL.md and optional scripts/, references/, assets/')
|
|
146
|
+
.option('--slug <slug>', 'Skill slug (defaults to the folder name)')
|
|
147
|
+
.option('--publish', 'Publish the draft as the next version after saving')
|
|
148
|
+
.option('--apply', 'Save the draft (preview by default)')
|
|
149
|
+
.option('--dry-run', 'Preview without saving')
|
|
150
|
+
.action(async (directory, options) => action(async () => pushTeamSkillAction(directory, options)));
|
|
151
|
+
command
|
|
152
|
+
.command('publish <slug>')
|
|
153
|
+
.description("Publish a Team skill's current draft as its next version")
|
|
154
|
+
.option('--apply', 'Publish (preview by default)')
|
|
155
|
+
.option('--dry-run', 'Preview without publishing')
|
|
156
|
+
.action(async (slug, options) => action(async () => publishTeamSkillAction(slug, options)));
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=team-skill.js.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { client } from '../client.js';
|
|
2
|
+
import { currentEnvironment, ENVIRONMENTS } from '../environments.js';
|
|
3
|
+
import { ApiError, ValidationError } from '../utils/errors.js';
|
|
4
|
+
import { printJson } from '../utils/output.js';
|
|
5
|
+
import { action, resourceId } from '../utils/product-api.js';
|
|
6
|
+
function inspectedVersion(identity) {
|
|
7
|
+
return [identity.source, identity.versionId].filter(Boolean).join(' ');
|
|
8
|
+
}
|
|
9
|
+
function shellArg(value) {
|
|
10
|
+
return /^[a-zA-Z0-9_./-]+$/.test(value) ? value : "'" + value.replaceAll("'", "'\"'\"'") + "'";
|
|
11
|
+
}
|
|
12
|
+
function renderReport(report, environment, actionKey) {
|
|
13
|
+
const { worker, actions, dependencies } = report;
|
|
14
|
+
if (report.node) {
|
|
15
|
+
const { nodeName, nodeId, workflow, language, code } = report.node;
|
|
16
|
+
return [
|
|
17
|
+
worker.name + ' / ' + environment.name,
|
|
18
|
+
'Action: ' + actionKey,
|
|
19
|
+
'Workflow: ' + workflow.name + ' (' + workflow.id + ') · ' + inspectedVersion(workflow),
|
|
20
|
+
'Node: ' + nodeName + ' (' + nodeId + ') · ' + language,
|
|
21
|
+
'',
|
|
22
|
+
code,
|
|
23
|
+
].join('\n');
|
|
24
|
+
}
|
|
25
|
+
const lines = [
|
|
26
|
+
`${worker.name} ${worker.id} ${report.teamName} / ${environment.name}`,
|
|
27
|
+
`${worker.visibility} · ${worker.publicationState} · ${worker.active ? 'active' : 'inactive'} · inspected ${inspectedVersion(worker)}`,
|
|
28
|
+
];
|
|
29
|
+
for (const { name, enabled, schedule } of report.schedules) {
|
|
30
|
+
const timing = schedule.kind === 'cron' ? schedule.expression : `every ${schedule.everyMs} ms`;
|
|
31
|
+
lines.push(`Schedule: ${name} · ${timing} ${schedule.timezone} · ${enabled ? 'enabled' : 'disabled'}`);
|
|
32
|
+
}
|
|
33
|
+
const keyWidth = Math.max('ACTION'.length, ...actions.map((entry) => entry.key.length));
|
|
34
|
+
const targetWidth = Math.max('TARGET WORKFLOW'.length, ...actions.map((entry) => (entry.target?.id ?? 'unavailable').length));
|
|
35
|
+
lines.push('', `${'ACTION'.padEnd(keyWidth)} ${'TARGET WORKFLOW'.padEnd(targetWidth)} APPROVAL REQUIRED`);
|
|
36
|
+
for (const entry of actions) {
|
|
37
|
+
const { target } = entry;
|
|
38
|
+
lines.push(`${entry.key.padEnd(keyWidth)} ${(target?.id ?? 'unavailable').padEnd(targetWidth)} ${entry.requiresApproval ? 'yes' : 'no'}`);
|
|
39
|
+
if (actionKey === undefined)
|
|
40
|
+
continue;
|
|
41
|
+
if (entry.description)
|
|
42
|
+
lines.push(entry.description);
|
|
43
|
+
if (target) {
|
|
44
|
+
lines.push(`Target: ${target.name} · ${target.visibility} · ${inspectedVersion(target)}`);
|
|
45
|
+
const exportArgs = ['zl', '--environment', environment.name];
|
|
46
|
+
if (environment.apiUrl !== ENVIRONMENTS[environment.name])
|
|
47
|
+
exportArgs.push('--api-url', environment.apiUrl);
|
|
48
|
+
if (process.env.ZL_PROFILE)
|
|
49
|
+
exportArgs.push('--profile', process.env.ZL_PROFILE);
|
|
50
|
+
exportArgs.push('workflow', 'export', target.id);
|
|
51
|
+
if (target.visibility === 'internal')
|
|
52
|
+
exportArgs.push('--include-internal');
|
|
53
|
+
if (target.source === 'published')
|
|
54
|
+
exportArgs.push('--published');
|
|
55
|
+
exportArgs.push('--pretty', '--output', `${entry.key}.json`);
|
|
56
|
+
lines.push(exportArgs.map(shellArg).join(' '));
|
|
57
|
+
}
|
|
58
|
+
const inputs = entry.inputs
|
|
59
|
+
?.map(({ name, type, required }) => `${name} (${type}, ${required ? 'required' : 'optional'})`)
|
|
60
|
+
.join(', ');
|
|
61
|
+
lines.push(`Inputs: ${inputs === undefined ? 'unavailable' : inputs || 'none'}`);
|
|
62
|
+
}
|
|
63
|
+
if (actionKey !== undefined && dependencies.length) {
|
|
64
|
+
lines.push('', 'DEPENDENCIES');
|
|
65
|
+
for (const dep of dependencies) {
|
|
66
|
+
const ref = dep.status === 'resolved' ? [dep.name, dep.id].filter(Boolean).join(' ') : dep.status;
|
|
67
|
+
lines.push(`${dep.type} ${ref} ${dep.operation ?? ''} from ${dep.workflowId} / ${dep.nodeName} (${dep.nodeId})`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
for (const [type, title] of [
|
|
72
|
+
['dataTable', 'TABLES REFERENCED BY WORKFLOWS'],
|
|
73
|
+
['codepack', 'PINNED CODEPACKS'],
|
|
74
|
+
]) {
|
|
75
|
+
const resources = new Map();
|
|
76
|
+
for (const dep of dependencies) {
|
|
77
|
+
if (dep.type === type && dep.status === 'resolved' && dep.id)
|
|
78
|
+
resources.set(dep.id, [dep.name, dep.id].filter(Boolean).join(' '));
|
|
79
|
+
}
|
|
80
|
+
if (resources.size)
|
|
81
|
+
lines.push('', title, ...resources.values());
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (report.directTableGrants.length)
|
|
85
|
+
lines.push('', 'DIRECT TABLE GRANTS');
|
|
86
|
+
for (const { binding, operation, table, columns, writableColumns } of report.directTableGrants) {
|
|
87
|
+
const parts = [binding, operation, table ? `${table.name} ${table.id}` : 'unavailable'];
|
|
88
|
+
if (columns)
|
|
89
|
+
parts.push(`columns: ${columns.join(', ') || 'none'}`);
|
|
90
|
+
if (writableColumns)
|
|
91
|
+
parts.push(`writable columns: ${writableColumns.join(', ') || 'none'}`);
|
|
92
|
+
lines.push(parts.join(' '));
|
|
93
|
+
}
|
|
94
|
+
if (report.warnings.length)
|
|
95
|
+
lines.push('', 'WARNINGS');
|
|
96
|
+
for (const warning of report.warnings)
|
|
97
|
+
lines.push([warning.code, warning.action, warning.nodeId, warning.message].filter(Boolean).join(' '));
|
|
98
|
+
return lines.join('\n');
|
|
99
|
+
}
|
|
100
|
+
async function inspectWorker(id, options) {
|
|
101
|
+
const environment = currentEnvironment();
|
|
102
|
+
if (options.node !== undefined && !options.action)
|
|
103
|
+
throw new ValidationError('node', '--node requires --action');
|
|
104
|
+
const query = options.action === undefined
|
|
105
|
+
? undefined
|
|
106
|
+
: {
|
|
107
|
+
action: options.action,
|
|
108
|
+
...(options.node !== undefined ? { node: options.node } : {}),
|
|
109
|
+
};
|
|
110
|
+
const { data } = await client.get(`/workers/${resourceId(id)}/inspect`, query);
|
|
111
|
+
if (data?.schemaVersion !== 1 || !data.worker)
|
|
112
|
+
throw new ApiError(502, 'Invalid Worker inspection response');
|
|
113
|
+
if (options.node !== undefined && !data.node)
|
|
114
|
+
throw new ApiError(502, 'Regional API did not return the requested node source');
|
|
115
|
+
if (options.json || !process.stdout.isTTY)
|
|
116
|
+
printJson({ ...data, environment: environment.name });
|
|
117
|
+
else
|
|
118
|
+
process.stdout.write(renderReport(data, environment, options.action) + '\n');
|
|
119
|
+
}
|
|
120
|
+
export function registerWorkerCommand(program) {
|
|
121
|
+
program
|
|
122
|
+
.command('worker')
|
|
123
|
+
.description('Inspect Workers')
|
|
124
|
+
.command('inspect <id>')
|
|
125
|
+
.description('Inspect the Worker configuration and its workflow dependencies')
|
|
126
|
+
.option('--action <key>', 'Inspect one exact action key')
|
|
127
|
+
.option('--node <id>', 'Show inline code by node ID within the action (or workflow-id/node-id)')
|
|
128
|
+
.option('--json', 'Print JSON (default when stdout is piped)')
|
|
129
|
+
.action((id, options) => action(() => inspectWorker(id, options)));
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=worker.js.map
|
package/dist/main.js
CHANGED
|
@@ -4,6 +4,7 @@ import { readFileSync } from 'node:fs';
|
|
|
4
4
|
import { registerDesktopCommand } from './commands/desktop.js';
|
|
5
5
|
import { registerSetupCommand } from './commands/setup.js';
|
|
6
6
|
import { registerDoctorCommand } from './commands/doctor.js';
|
|
7
|
+
import { registerWorkerCommand } from './commands/worker.js';
|
|
7
8
|
import { registerWorkflowCommand } from './commands/workflow.js';
|
|
8
9
|
import { registerCodepackCommand } from './commands/codepack.js';
|
|
9
10
|
import { registerDataTableCommand } from './commands/data-table.js';
|
|
@@ -26,6 +27,7 @@ import { registerTeamCommand } from './commands/team.js';
|
|
|
26
27
|
import { registerPageCommand } from './commands/page.js';
|
|
27
28
|
import { registerCustomPageCommand } from './commands/custom-page.js';
|
|
28
29
|
import { registerSkillsCommand } from './commands/skills.js';
|
|
30
|
+
import { registerTeamSkillCommand } from './commands/team-skill.js';
|
|
29
31
|
import { configureApiUrlOverride, currentEnvironment } from './environments.js';
|
|
30
32
|
import { handleError } from './utils/errors.js';
|
|
31
33
|
const program = new Command();
|
|
@@ -73,6 +75,7 @@ registerApiTokenCommand(program);
|
|
|
73
75
|
registerSetupCommand(program);
|
|
74
76
|
registerDoctorCommand(program);
|
|
75
77
|
registerWorkflowCommand(program);
|
|
78
|
+
registerWorkerCommand(program);
|
|
76
79
|
registerCodepackCommand(program);
|
|
77
80
|
registerDataTableCommand(program);
|
|
78
81
|
registerExecutionCommand(program);
|
|
@@ -83,6 +86,7 @@ registerTeamCommand(program);
|
|
|
83
86
|
registerPageCommand(program);
|
|
84
87
|
registerCustomPageCommand(program);
|
|
85
88
|
registerSkillsCommand(program);
|
|
89
|
+
registerTeamSkillCommand(program);
|
|
86
90
|
registerSchemaCommand(program);
|
|
87
91
|
registerStateCommand(program);
|
|
88
92
|
registerLabelCommand(program);
|