@velaro/cli 1.4.240 → 1.4.241
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/bin/velaro.js +360 -370
- package/lib/commands/article.js +772 -763
- package/lib/commands/billing-subscription.js +909 -907
- package/lib/commands/index.js +259 -322
- package/lib/commands/ingest.js +36 -32
- package/lib/commands/mcp-key.js +218 -209
- package/lib/confirm.js +14 -0
- package/package.json +40 -45
- package/assets/billing-doc-patterns/concentric-arcs.png +0 -0
- package/assets/billing-doc-patterns/diagonal-hatch.png +0 -0
- package/assets/billing-doc-patterns/dot-grid.png +0 -0
- package/assets/billing-doc-patterns/hex-grid.png +0 -0
- package/assets/billing-doc-patterns/wave-lines.png +0 -0
- package/assets/velaro-logo-lockup-full-color.png +0 -0
- package/lib/commands/db.js +0 -105
- package/lib/commands/deploy-state.js +0 -26
- package/lib/commands/deployment.js +0 -107
- package/lib/commands/schedule-adherence.js +0 -33
- package/lib/commands/sharepoint.js +0 -168
- package/lib/deploy-state.js +0 -408
- package/lib/deploy-state.test.js +0 -133
- package/lib/kb-screenshot.js +0 -433
- package/lib/migrations/amscro.json +0 -72
- package/lib/migrations/azenta.json +0 -68
- package/lib/migrations/bluefire.json +0 -49
- package/lib/migrations/donaldson.json +0 -75
- package/lib/pdf/billing-document.js +0 -534
- package/lib/pdf/billing-document.test.js +0 -349
- package/lib/sharepoint-auth.js +0 -138
package/lib/commands/ingest.js
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import { getCredentials, messagingPost } from '../api.js';
|
|
2
|
-
import { runCommand } from '../run.js';
|
|
3
|
-
|
|
4
|
-
export const ingestCommand = {
|
|
5
|
-
command: 'ingest',
|
|
6
|
-
describe: 'Trigger knowledge base ingestion for a completed scraper job',
|
|
7
|
-
builder: (y) =>
|
|
8
|
-
y.option('job-id', {
|
|
9
|
-
describe: 'Scraper job ID to ingest',
|
|
10
|
-
type: 'string',
|
|
11
|
-
demandOption: true,
|
|
12
|
-
}),
|
|
13
|
-
|
|
14
|
-
handler: runCommand(async (argv) => {
|
|
15
|
-
// Single credential resolution — avoids double readConfig() from calling readConfig()
|
|
16
|
-
// here and again inside post() → getCredentials().
|
|
17
|
-
const creds = await getCredentials();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
1
|
+
import { getCredentials, messagingPost } from '../api.js';
|
|
2
|
+
import { runCommand } from '../run.js';
|
|
3
|
+
|
|
4
|
+
export const ingestCommand = {
|
|
5
|
+
command: 'ingest',
|
|
6
|
+
describe: 'Trigger knowledge base ingestion for a completed scraper job',
|
|
7
|
+
builder: (y) =>
|
|
8
|
+
y.option('job-id', {
|
|
9
|
+
describe: 'Scraper job ID to ingest',
|
|
10
|
+
type: 'string',
|
|
11
|
+
demandOption: true,
|
|
12
|
+
}),
|
|
13
|
+
|
|
14
|
+
handler: runCommand(async (argv) => {
|
|
15
|
+
// Single credential resolution — avoids double readConfig() from calling readConfig()
|
|
16
|
+
// here and again inside post() → getCredentials().
|
|
17
|
+
const creds = await getCredentials();
|
|
18
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_-]{5,}$/.test(String(argv['job-id']))) {
|
|
19
|
+
throw new Error(`"${argv['job-id']}" is not a valid scraper job id.`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
console.log(`Triggering ingestion for job ${argv['job-id']} on site ${creds.siteId}...`);
|
|
23
|
+
|
|
24
|
+
// AzureIndexesController (IngestJobDirect) lives on the MESSAGING api; the admin api has no such route.
|
|
25
|
+
const result = await messagingPost('/AzureIndexes/IngestJobDirect', {
|
|
26
|
+
siteId: creds.siteId,
|
|
27
|
+
jobId: argv['job-id'],
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (!result?.jobId) throw new Error(`Job ${argv['job-id']} was not found or could not be ingested; nothing was started.`);
|
|
31
|
+
console.log('Ingestion started.');
|
|
32
|
+
console.log(` Job ID: ${result.jobId}`);
|
|
33
|
+
console.log(` Index: ${result.physicalIndex}`);
|
|
34
|
+
console.log('\nEmbedding runs in the background. Check logs for completion.');
|
|
35
|
+
}),
|
|
36
|
+
};
|
package/lib/commands/mcp-key.js
CHANGED
|
@@ -1,209 +1,218 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import os from 'os';
|
|
4
|
-
import { get, post, del, request } from '../api.js';
|
|
5
|
-
import { getActiveEnv, ENVS } from '../config.js';
|
|
6
|
-
import { runCommand } from '../run.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (Array.isArray(response
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
.command(
|
|
23
|
-
.command(
|
|
24
|
-
.command(
|
|
25
|
-
.command(
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
console.log(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import { get, post, del, request } from '../api.js';
|
|
5
|
+
import { getActiveEnv, ENVS } from '../config.js';
|
|
6
|
+
import { runCommand } from '../run.js';
|
|
7
|
+
import { confirmDestructive } from '../confirm.js';
|
|
8
|
+
|
|
9
|
+
// The API returns { keys, monthlyLimit }; older deployments returned an array.
|
|
10
|
+
// Fail on any other shape so a contract change cannot appear as an empty list.
|
|
11
|
+
export function normalizeMcpKeysResponse(response) {
|
|
12
|
+
if (Array.isArray(response)) return response;
|
|
13
|
+
if (Array.isArray(response?.keys)) return response.keys;
|
|
14
|
+
throw new Error('Unexpected MCP API key list response.');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const mcpKeyCommand = {
|
|
18
|
+
command: 'mcp-key <subcommand>',
|
|
19
|
+
describe: 'Manage MCP API keys (vel_live_* keys for AI skill access)',
|
|
20
|
+
builder: (yargs) =>
|
|
21
|
+
yargs
|
|
22
|
+
.command(mcpKeyListCommand)
|
|
23
|
+
.command(mcpKeyCreateCommand)
|
|
24
|
+
.command(mcpKeyRevokeCommand)
|
|
25
|
+
.command(mcpKeyRotateCommand)
|
|
26
|
+
.command(mcpKeyInstallCommand)
|
|
27
|
+
.demandCommand(1, 'Specify a subcommand: list, create, revoke, rotate, install'),
|
|
28
|
+
handler: () => {},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const mcpKeyListCommand = {
|
|
32
|
+
command: 'list',
|
|
33
|
+
describe: 'List MCP API keys for your site',
|
|
34
|
+
handler: runCommand(async () => {
|
|
35
|
+
const response = await get('/McpApiKeys');
|
|
36
|
+
if (response?.entitled === false) {
|
|
37
|
+
console.log('MCP keys are included with the Professional plan and above. Contact support@velaro.com to upgrade.');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const keys = normalizeMcpKeysResponse(response);
|
|
41
|
+
if (!keys.length) { console.log('No MCP keys found.'); return; }
|
|
42
|
+
console.log(`Found ${keys.length} key(s):\n`);
|
|
43
|
+
for (const k of keys) {
|
|
44
|
+
const used = k.lastUsedAt ? new Date(k.lastUsedAt).toLocaleDateString() : 'never';
|
|
45
|
+
const expired = k.expiresAt && new Date(k.expiresAt).getTime() <= Date.now();
|
|
46
|
+
const expires = k.expiresAt ? ` ${expired ? 'expired' : 'expires'} ${new Date(k.expiresAt).toLocaleDateString()}` : '';
|
|
47
|
+
console.log(` [${k.id}] ${k.label} prefix=${k.keyPrefix} ${!k.isActive ? 'revoked' : expired ? 'expired' : 'active'} last used=${used}${expires}`);
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const mcpKeyCreateCommand = {
|
|
53
|
+
command: 'create',
|
|
54
|
+
describe: 'Create a new MCP API key',
|
|
55
|
+
builder: (y) =>
|
|
56
|
+
y
|
|
57
|
+
.option('label', {
|
|
58
|
+
describe: 'Human-readable label (e.g. "Claude Code")',
|
|
59
|
+
type: 'string',
|
|
60
|
+
demandOption: true,
|
|
61
|
+
})
|
|
62
|
+
.option('expires', {
|
|
63
|
+
describe: 'Expiry date in ISO 8601 format (e.g. 2027-01-01)',
|
|
64
|
+
type: 'string',
|
|
65
|
+
})
|
|
66
|
+
.option('scopes', {
|
|
67
|
+
describe: 'Comma-separated scopes (the only grantable scope is "admin"; every key already reads and writes the knowledge base and contacts). The server rejects unknown scopes and lists the valid ones.',
|
|
68
|
+
type: 'string',
|
|
69
|
+
}),
|
|
70
|
+
|
|
71
|
+
handler: runCommand(async (argv) => {
|
|
72
|
+
const payload = { label: argv.label };
|
|
73
|
+
if (argv.expires) {
|
|
74
|
+
const when = new Date(argv.expires);
|
|
75
|
+
if (Number.isNaN(when.getTime())) throw new Error(`--expires "${argv.expires}" is not a valid date (use ISO 8601, e.g. 2027-01-01).`);
|
|
76
|
+
if (when.getTime() <= Date.now()) throw new Error(`--expires "${argv.expires}" is in the past. Choose a future date.`);
|
|
77
|
+
payload.expiresAt = when.toISOString();
|
|
78
|
+
}
|
|
79
|
+
if (argv.scopes) payload.scopes = String(argv.scopes).split(',').map((s) => s.trim()).filter(Boolean);
|
|
80
|
+
|
|
81
|
+
const result = await post('/McpApiKeys', payload);
|
|
82
|
+
console.log(`MCP key created: ${result.label}`);
|
|
83
|
+
console.log(`\n Key: ${result.rawKey}`);
|
|
84
|
+
console.log(`\n ${result.warning ?? 'Copy this key now — it will not be shown again.'}`);
|
|
85
|
+
}),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const mcpKeyRevokeCommand = {
|
|
89
|
+
command: 'revoke <id>',
|
|
90
|
+
describe: 'Revoke an MCP API key by ID',
|
|
91
|
+
builder: (y) => y.option('yes', { type: 'boolean', default: false, alias: 'y', describe: 'Skip the confirmation prompt' }),
|
|
92
|
+
handler: runCommand(async (argv) => {
|
|
93
|
+
await confirmDestructive(`This revokes MCP key ${argv.id}; anything using it stops working.`, { yes: argv.yes });
|
|
94
|
+
await del(`/McpApiKeys/${argv.id}`);
|
|
95
|
+
console.log(`Key ${argv.id} revoked.`);
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const mcpKeyInstallCommand = {
|
|
100
|
+
command: 'install',
|
|
101
|
+
describe: 'Create an MCP key and write it to ~/.claude.json automatically',
|
|
102
|
+
builder: (y) =>
|
|
103
|
+
y
|
|
104
|
+
.option('label', {
|
|
105
|
+
describe: 'Label for the key',
|
|
106
|
+
type: 'string',
|
|
107
|
+
})
|
|
108
|
+
.option('staging', {
|
|
109
|
+
describe: 'Install key for the staging environment',
|
|
110
|
+
type: 'boolean',
|
|
111
|
+
default: false,
|
|
112
|
+
}),
|
|
113
|
+
|
|
114
|
+
handler: runCommand(async (argv) => {
|
|
115
|
+
const env = argv.staging ? 'staging' : getActiveEnv();
|
|
116
|
+
const apiBase = ENVS[env].adminApiBase;
|
|
117
|
+
const label = argv.label || (env === 'staging' ? 'Claude Code (Staging)' : 'Claude Code');
|
|
118
|
+
|
|
119
|
+
const payload = { label };
|
|
120
|
+
const result = await request('POST', '/McpApiKeys', payload, env);
|
|
121
|
+
const rawKey = result.rawKey;
|
|
122
|
+
|
|
123
|
+
// Claude Code reads MCP server definitions from the top-level "mcpServers" key
|
|
124
|
+
// in ~/.claude.json (NOT ~/.claude/settings.json — that file has no effect here).
|
|
125
|
+
// This is the same shape `claude mcp add` itself writes.
|
|
126
|
+
// prod → entry named "velaro"
|
|
127
|
+
// staging → entry named "velaro-staging"
|
|
128
|
+
const serverName = env === 'prod' ? 'velaro' : `velaro-${env}`;
|
|
129
|
+
const configPath = path.join(os.homedir(), '.claude.json');
|
|
130
|
+
let config = {};
|
|
131
|
+
if (fs.existsSync(configPath)) {
|
|
132
|
+
const raw = fs.readFileSync(configPath, 'utf8');
|
|
133
|
+
try {
|
|
134
|
+
config = JSON.parse(raw);
|
|
135
|
+
} catch (err) {
|
|
136
|
+
throw new Error(
|
|
137
|
+
`~/.claude.json exists but isn't valid JSON (${err.message}) — refusing to overwrite it. ` +
|
|
138
|
+
`Fix or remove the file, then re-run 'velaro mcp-key install'.`
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
config.mcpServers = config.mcpServers || {};
|
|
144
|
+
config.mcpServers[serverName] = {
|
|
145
|
+
type: 'stdio',
|
|
146
|
+
command: 'npx',
|
|
147
|
+
args: ['-y', '@velaro/mcp-server'],
|
|
148
|
+
env: {
|
|
149
|
+
VELARO_MCP_KEY: rawKey,
|
|
150
|
+
VELARO_ADMIN_API: apiBase,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
fs.mkdirSync(path.dirname(configPath), { recursive: true });
|
|
155
|
+
// Claude Code itself writes ~/.claude.json continuously (history, project state),
|
|
156
|
+
// so this must never be a plain in-place write: write to a temp file and rename,
|
|
157
|
+
// which is atomic on the same filesystem — a crash or concurrent write mid-save
|
|
158
|
+
// can't leave the file truncated or silently clobber a write that landed between
|
|
159
|
+
// our read and our write.
|
|
160
|
+
const tmpPath = `${configPath}.tmp-${process.pid}`;
|
|
161
|
+
fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2));
|
|
162
|
+
fs.renameSync(tmpPath, configPath);
|
|
163
|
+
|
|
164
|
+
console.log(`✅ MCP key created: ${label} (${result.keyPrefix}...)`);
|
|
165
|
+
console.log(`✅ Written to ~/.claude.json as "${serverName}" → ${apiBase}`);
|
|
166
|
+
console.log(`\nRestart Claude Code to pick up the new MCP server.`);
|
|
167
|
+
console.log(`\nTo use in Claude Code: say "use ${serverName}" to target ${env}.`);
|
|
168
|
+
}),
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const mcpKeyRotateCommand = {
|
|
172
|
+
command: 'rotate <id|label>',
|
|
173
|
+
describe: 'Issue a replacement key, then revoke the existing key',
|
|
174
|
+
builder: (y) =>
|
|
175
|
+
y
|
|
176
|
+
.positional('id|label', { type: 'string', describe: 'Numeric ID or partial label of the key to rotate (e.g. "jb" or "42")' })
|
|
177
|
+
.option('label', {
|
|
178
|
+
describe: 'Label for the replacement key (defaults to the old key\'s label)',
|
|
179
|
+
type: 'string',
|
|
180
|
+
})
|
|
181
|
+
.option('expires', {
|
|
182
|
+
describe: 'Expiry date for the new key in ISO 8601 format (e.g. 2027-01-01)',
|
|
183
|
+
type: 'string',
|
|
184
|
+
}),
|
|
185
|
+
|
|
186
|
+
handler: runCommand(async (argv) => {
|
|
187
|
+
const keys = normalizeMcpKeysResponse(await get('/McpApiKeys'));
|
|
188
|
+
const search = String(argv['id|label'] ?? argv.id ?? '');
|
|
189
|
+
const numId = /^\d+$/.test(search) ? Number(search) : null;
|
|
190
|
+
const matches = numId === null
|
|
191
|
+
? keys.filter(k => k.label.toLowerCase().includes(search.toLowerCase()))
|
|
192
|
+
: keys.filter(k => k.id === numId);
|
|
193
|
+
|
|
194
|
+
if (!matches?.length)
|
|
195
|
+
throw new Error(`No key found matching "${search}". Run 'velaro mcp-key list' to see your keys.`);
|
|
196
|
+
if (matches.length > 1) {
|
|
197
|
+
console.log(`Multiple keys match "${search}":\n`);
|
|
198
|
+
matches.forEach(k => console.log(` [${k.id}] ${k.label} (${k.keyPrefix}...)`));
|
|
199
|
+
throw new Error('Be more specific — provide the numeric ID or a more unique label fragment.');
|
|
200
|
+
}
|
|
201
|
+
const old = matches[0];
|
|
202
|
+
|
|
203
|
+
const label = argv.label || old.label;
|
|
204
|
+
|
|
205
|
+
const payload = { label };
|
|
206
|
+
if (argv.expires) payload.expiresAt = new Date(argv.expires).toISOString();
|
|
207
|
+
else if (old.expiresAt) payload.expiresAt = old.expiresAt;
|
|
208
|
+
const result = await post('/McpApiKeys', payload);
|
|
209
|
+
|
|
210
|
+
// Print the one-time secret before revoking. If revocation fails, the user
|
|
211
|
+
// can still install this replacement and revoke the old key by ID.
|
|
212
|
+
console.log(`Created: [${result.id}] ${result.label}`);
|
|
213
|
+
console.log(`\n New key: ${result.rawKey}`);
|
|
214
|
+
console.log(`\n ${result.warning ?? 'Copy this key now — it will not be shown again.'}`);
|
|
215
|
+
await del(`/McpApiKeys/${old.id}`);
|
|
216
|
+
console.log(`Revoked: [${old.id}] ${old.label} (${old.keyPrefix}...)`);
|
|
217
|
+
}),
|
|
218
|
+
};
|
package/lib/confirm.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import readline from 'node:readline';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Destructive-action confirmation. --yes skips the prompt. Without a TTY and without --yes the command refuses,
|
|
5
|
+
* so a script can never delete or revoke by accident.
|
|
6
|
+
*/
|
|
7
|
+
export async function confirmDestructive(message, { yes = false } = {}) {
|
|
8
|
+
if (yes) return;
|
|
9
|
+
if (!process.stdin.isTTY) throw new Error(`${message} Refusing to continue without a terminal: pass --yes to confirm.`);
|
|
10
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
11
|
+
const answer = await new Promise((resolve) => rl.question(`${message} Type "yes" to continue: `, resolve));
|
|
12
|
+
rl.close();
|
|
13
|
+
if (String(answer).trim().toLowerCase() !== 'yes') throw new Error('Cancelled. Nothing was changed.');
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,45 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@velaro/cli",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "Velaro Workspace v20
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"velaro": "bin/velaro.js"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"postinstall": "node scripts/postinstall.js",
|
|
11
|
-
"test": "node --test lib/*.test.js staff/tests/*.test.js"
|
|
12
|
-
},
|
|
13
|
-
"engines": {
|
|
14
|
-
"node": ">=18.0.0"
|
|
15
|
-
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
},
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
"@azure/msal-node": "^7.1.0",
|
|
42
|
-
"minimatch": "^11.0.1",
|
|
43
|
-
"glob": "^14.0.2"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@velaro/cli",
|
|
3
|
+
"version": "1.4.241",
|
|
4
|
+
"description": "Velaro Workspace v20 — command-line interface for managing bots, knowledge base ingestion, MCP API keys, search indexes, and ops health.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"velaro": "bin/velaro.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node scripts/postinstall.js",
|
|
11
|
+
"test": "node --test lib/*.test.js lib/commands/*.test.js staff/tests/*.test.js"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18.0.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"yargs": "^17.7.2"
|
|
18
|
+
},
|
|
19
|
+
"optionalDependencies": {
|
|
20
|
+
"playwright": "^1.43.1",
|
|
21
|
+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/velaro/velaro-admin"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"bin/",
|
|
29
|
+
"lib/",
|
|
30
|
+
"scripts/"
|
|
31
|
+
],
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"license-checker-rseidelsohn": "^4.4.2"
|
|
34
|
+
},
|
|
35
|
+
"overrides": {
|
|
36
|
+
"@azure/msal-node": "^7.1.0",
|
|
37
|
+
"minimatch": "^11.0.1",
|
|
38
|
+
"glob": "^14.0.2"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|