@solarains/va-cli 0.1.1
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/LICENSE +21 -0
- package/README.md +132 -0
- package/dist/cli/command-types.js +2 -0
- package/dist/cli/help-copy.js +97 -0
- package/dist/cli/help.js +29 -0
- package/dist/cli/root-command.js +24 -0
- package/dist/cli/run-cli.js +107 -0
- package/dist/commands/assets/assets-command.js +10 -0
- package/dist/commands/assets/list-command.js +52 -0
- package/dist/commands/auth/auth-command.js +11 -0
- package/dist/commands/auth/login-command.js +127 -0
- package/dist/commands/auth/logout-command.js +57 -0
- package/dist/commands/doctor/doctor-command.js +33 -0
- package/dist/commands/init/init-command.js +19 -0
- package/dist/commands/intelligence/intelligence-command.js +10 -0
- package/dist/commands/intelligence/query-command.js +109 -0
- package/dist/commands/reports/get-command.js +69 -0
- package/dist/commands/reports/list-command.js +33 -0
- package/dist/commands/reports/reports-command.js +11 -0
- package/dist/commands/usage/usage-command.js +27 -0
- package/dist/config/locale.js +30 -0
- package/dist/config/runtime-config.js +64 -0
- package/dist/features/assets/assets-api-client.js +18 -0
- package/dist/features/assets/assets-output.js +28 -0
- package/dist/features/auth/auth-api-client.js +60 -0
- package/dist/features/auth/authenticated-api-client.js +142 -0
- package/dist/features/auth/browser-login.js +191 -0
- package/dist/features/auth/installation-state.js +65 -0
- package/dist/features/auth/loopback-callback-page.js +231 -0
- package/dist/features/daily-reports/daily-reports-api-client.js +22 -0
- package/dist/features/daily-reports/daily-reports-output.js +54 -0
- package/dist/features/init/detect-targets.js +57 -0
- package/dist/features/init/init-copy.js +348 -0
- package/dist/features/init/init-flow.js +661 -0
- package/dist/features/init/installer.js +122 -0
- package/dist/features/init/manifest.js +29 -0
- package/dist/features/init/presentation.js +147 -0
- package/dist/features/init/prompt.js +135 -0
- package/dist/features/init/target-registry.js +45 -0
- package/dist/features/init/templates.js +84 -0
- package/dist/features/init/types.js +2 -0
- package/dist/features/intelligence/intelligence-api-client.js +18 -0
- package/dist/features/intelligence/intelligence-output.js +36 -0
- package/dist/features/intelligence/intelligence-query-state.js +20 -0
- package/dist/features/usage/usage-api-client.js +7 -0
- package/dist/features/usage/usage-output.js +52 -0
- package/dist/main.js +7 -0
- package/dist/shared/argv.js +65 -0
- package/dist/shared/logger.js +32 -0
- package/dist/shared/output.js +22 -0
- package/dist/state/paths.js +32 -0
- package/dist/state/stores/file-json-store.js +29 -0
- package/dist/state/stores/installation-store.js +20 -0
- package/dist/state/stores/token-store.js +20 -0
- package/package.json +19 -0
- package/skills/visionalpha-operator/SKILL.md +38 -0
- package/skills/visionalpha-operator/agents/openai.yaml +4 -0
- package/skills/visionalpha-operator/references/asset-intelligence.md +35 -0
- package/skills/visionalpha-operator/references/assets.md +29 -0
- package/skills/visionalpha-operator/references/auth-recovery.md +26 -0
- package/skills/visionalpha-operator/references/daily-reports.md +30 -0
- package/skills/visionalpha-operator/references/usage-summary.md +24 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderUsageSummary = renderUsageSummary;
|
|
4
|
+
const output_1 = require("../../shared/output");
|
|
5
|
+
function formatQuotaLine(label, quota) {
|
|
6
|
+
if (!quota) {
|
|
7
|
+
return `${label}: not enabled`;
|
|
8
|
+
}
|
|
9
|
+
return `${label}: ${quota.used}/${quota.limit} used, ${quota.remaining} remaining`;
|
|
10
|
+
}
|
|
11
|
+
function formatSelectedReportKey(key) {
|
|
12
|
+
if (!key) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const [assetId, date] = key.split(':');
|
|
16
|
+
if (!assetId || !date) {
|
|
17
|
+
return key;
|
|
18
|
+
}
|
|
19
|
+
return `${assetId} on ${date}`;
|
|
20
|
+
}
|
|
21
|
+
function renderUsageSummary(logger, summary) {
|
|
22
|
+
(0, output_1.printSection)(logger, 'Plan');
|
|
23
|
+
(0, output_1.printKeyValue)(logger, 'Current plan', summary.plan.name);
|
|
24
|
+
(0, output_1.printKeyValue)(logger, 'Commercial status', summary.subscriptionSummary.statusLabel);
|
|
25
|
+
if (summary.subscriptionSummary.providerLabel) {
|
|
26
|
+
(0, output_1.printKeyValue)(logger, 'Provider', summary.subscriptionSummary.providerLabel);
|
|
27
|
+
}
|
|
28
|
+
if (summary.subscriptionSummary.billingIntervalLabel) {
|
|
29
|
+
(0, output_1.printKeyValue)(logger, 'Billing interval', summary.subscriptionSummary.billingIntervalLabel);
|
|
30
|
+
}
|
|
31
|
+
if (summary.subscriptionSummary.currentPeriodEnd) {
|
|
32
|
+
(0, output_1.printKeyValue)(logger, 'Current period end', summary.subscriptionSummary.currentPeriodEnd);
|
|
33
|
+
}
|
|
34
|
+
(0, output_1.printKeyValue)(logger, 'Cancellation', summary.subscriptionSummary.cancellationLabel);
|
|
35
|
+
(0, output_1.printSection)(logger, 'Daily report');
|
|
36
|
+
(0, output_1.printKeyValue)(logger, 'Status', summary.dailyReport.statusLabel);
|
|
37
|
+
(0, output_1.printKeyValue)(logger, 'Product day', summary.dailyReport.productDay);
|
|
38
|
+
(0, output_1.printKeyValue)(logger, 'Remaining selections today', summary.dailyReport.remainingToday === null
|
|
39
|
+
? 'not limited'
|
|
40
|
+
: String(summary.dailyReport.remainingToday));
|
|
41
|
+
const selectedReport = formatSelectedReportKey(summary.dailyReport.selectedReportKey);
|
|
42
|
+
if (selectedReport) {
|
|
43
|
+
(0, output_1.printKeyValue)(logger, 'Locked report', selectedReport);
|
|
44
|
+
}
|
|
45
|
+
(0, output_1.printSection)(logger, 'Intelligence quota');
|
|
46
|
+
(0, output_1.printKeyValue)(logger, 'Status', summary.intelligence.statusLabel);
|
|
47
|
+
(0, output_1.printList)(logger, [
|
|
48
|
+
formatQuotaLine('Calls', summary.intelligence.calls),
|
|
49
|
+
formatQuotaLine('Rows', summary.intelligence.rows),
|
|
50
|
+
`Reset cadence: ${summary.intelligence.resetCadence} (${summary.intelligence.resetTimezone})`,
|
|
51
|
+
]);
|
|
52
|
+
}
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const run_cli_1 = require("./cli/run-cli");
|
|
5
|
+
void (0, run_cli_1.runCli)(process.argv.slice(2), process.env).then((exitCode) => {
|
|
6
|
+
process.exitCode = exitCode;
|
|
7
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCommandArgs = parseCommandArgs;
|
|
4
|
+
exports.getStringOption = getStringOption;
|
|
5
|
+
exports.getBooleanOption = getBooleanOption;
|
|
6
|
+
exports.getNumberOption = getNumberOption;
|
|
7
|
+
function parseCommandArgs(args) {
|
|
8
|
+
const positionals = [];
|
|
9
|
+
const options = {};
|
|
10
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
11
|
+
const token = args[index];
|
|
12
|
+
if (!token.startsWith('--')) {
|
|
13
|
+
positionals.push(token);
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const trimmed = token.slice(2);
|
|
17
|
+
const equalsIndex = trimmed.indexOf('=');
|
|
18
|
+
if (equalsIndex >= 0) {
|
|
19
|
+
const key = trimmed.slice(0, equalsIndex);
|
|
20
|
+
const value = trimmed.slice(equalsIndex + 1);
|
|
21
|
+
options[key] = value;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const next = args[index + 1];
|
|
25
|
+
if (next && !next.startsWith('--')) {
|
|
26
|
+
options[trimmed] = next;
|
|
27
|
+
index += 1;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
options[trimmed] = true;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
positionals,
|
|
34
|
+
options,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function getStringOption(parsed, key) {
|
|
38
|
+
const value = parsed.options[key];
|
|
39
|
+
if (typeof value !== 'string') {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
const trimmed = value.trim();
|
|
43
|
+
return trimmed ? trimmed : undefined;
|
|
44
|
+
}
|
|
45
|
+
function getBooleanOption(parsed, key) {
|
|
46
|
+
const value = parsed.options[key];
|
|
47
|
+
if (typeof value === 'boolean') {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
if (typeof value === 'string') {
|
|
51
|
+
return value === 'true' || value === '1';
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
function getNumberOption(parsed, key) {
|
|
56
|
+
const value = getStringOption(parsed, key);
|
|
57
|
+
if (value === undefined) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
const parsedNumber = Number(value);
|
|
61
|
+
if (!Number.isFinite(parsedNumber)) {
|
|
62
|
+
throw new Error(`Option "--${key}" must be a number.`);
|
|
63
|
+
}
|
|
64
|
+
return parsedNumber;
|
|
65
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = void 0;
|
|
4
|
+
class Logger {
|
|
5
|
+
debugEnabled;
|
|
6
|
+
constructor(debugEnabled) {
|
|
7
|
+
this.debugEnabled = debugEnabled;
|
|
8
|
+
}
|
|
9
|
+
setDebugMode(value) {
|
|
10
|
+
this.debugEnabled = value;
|
|
11
|
+
}
|
|
12
|
+
plain(message) {
|
|
13
|
+
process.stdout.write(`${message}\n`);
|
|
14
|
+
}
|
|
15
|
+
info(message) {
|
|
16
|
+
this.plain(message);
|
|
17
|
+
}
|
|
18
|
+
error(message) {
|
|
19
|
+
process.stderr.write(`Error: ${message}\n`);
|
|
20
|
+
}
|
|
21
|
+
debug(message, payload) {
|
|
22
|
+
if (!this.debugEnabled) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (payload === undefined) {
|
|
26
|
+
this.plain(`[debug] ${message}`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.plain(`[debug] ${message} ${JSON.stringify(payload, null, 2)}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.Logger = Logger;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.printSection = printSection;
|
|
4
|
+
exports.printList = printList;
|
|
5
|
+
exports.printKeyValue = printKeyValue;
|
|
6
|
+
exports.printEmptyLine = printEmptyLine;
|
|
7
|
+
function printSection(logger, title) {
|
|
8
|
+
logger.plain('');
|
|
9
|
+
logger.plain(title);
|
|
10
|
+
logger.plain('-'.repeat(title.length));
|
|
11
|
+
}
|
|
12
|
+
function printList(logger, items) {
|
|
13
|
+
for (const item of items) {
|
|
14
|
+
logger.plain(`- ${item}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function printKeyValue(logger, key, value) {
|
|
18
|
+
logger.plain(`${key}: ${value}`);
|
|
19
|
+
}
|
|
20
|
+
function printEmptyLine(logger) {
|
|
21
|
+
logger.plain('');
|
|
22
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCliPaths = createCliPaths;
|
|
4
|
+
exports.ensureCliDirectories = ensureCliDirectories;
|
|
5
|
+
const promises_1 = require("node:fs/promises");
|
|
6
|
+
const node_os_1 = require("node:os");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
function expandHomePath(value) {
|
|
9
|
+
if (value === '~') {
|
|
10
|
+
return (0, node_os_1.homedir)();
|
|
11
|
+
}
|
|
12
|
+
if (value.startsWith('~/')) {
|
|
13
|
+
return value.replace('~', (0, node_os_1.homedir)());
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
function createCliPaths(env) {
|
|
18
|
+
const rootDir = expandHomePath(env.VAONE_HOME ?? (0, node_path_1.join)((0, node_os_1.homedir)(), '.vaone'));
|
|
19
|
+
const stateDir = (0, node_path_1.join)(rootDir, 'state');
|
|
20
|
+
return {
|
|
21
|
+
rootDir,
|
|
22
|
+
stateDir,
|
|
23
|
+
configFile: (0, node_path_1.join)(rootDir, 'config.json'),
|
|
24
|
+
authStateFile: (0, node_path_1.join)(stateDir, 'auth.json'),
|
|
25
|
+
installationStateFile: (0, node_path_1.join)(stateDir, 'installation.json'),
|
|
26
|
+
intelligenceQueryStateFile: (0, node_path_1.join)(stateDir, 'intelligence-query.json'),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
async function ensureCliDirectories(paths) {
|
|
30
|
+
await (0, promises_1.mkdir)(paths.rootDir, { recursive: true });
|
|
31
|
+
await (0, promises_1.mkdir)(paths.stateDir, { recursive: true });
|
|
32
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileJsonStore = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
class FileJsonStore {
|
|
6
|
+
filePath;
|
|
7
|
+
constructor(filePath) {
|
|
8
|
+
this.filePath = filePath;
|
|
9
|
+
}
|
|
10
|
+
async read() {
|
|
11
|
+
try {
|
|
12
|
+
const raw = await (0, promises_1.readFile)(this.filePath, 'utf8');
|
|
13
|
+
return JSON.parse(raw);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
if (error.code === 'ENOENT') {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async write(data) {
|
|
23
|
+
await (0, promises_1.writeFile)(this.filePath, `${JSON.stringify(data, null, 2)}\n`, 'utf8');
|
|
24
|
+
}
|
|
25
|
+
async clear() {
|
|
26
|
+
await (0, promises_1.rm)(this.filePath, { force: true });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.FileJsonStore = FileJsonStore;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InstallationStore = void 0;
|
|
4
|
+
const file_json_store_1 = require("./file-json-store");
|
|
5
|
+
class InstallationStore {
|
|
6
|
+
store;
|
|
7
|
+
constructor(filePath) {
|
|
8
|
+
this.store = new file_json_store_1.FileJsonStore(filePath);
|
|
9
|
+
}
|
|
10
|
+
async read() {
|
|
11
|
+
return this.store.read();
|
|
12
|
+
}
|
|
13
|
+
async save(installation) {
|
|
14
|
+
await this.store.write(installation);
|
|
15
|
+
}
|
|
16
|
+
async clear() {
|
|
17
|
+
await this.store.clear();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.InstallationStore = InstallationStore;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenStore = void 0;
|
|
4
|
+
const file_json_store_1 = require("./file-json-store");
|
|
5
|
+
class TokenStore {
|
|
6
|
+
store;
|
|
7
|
+
constructor(filePath) {
|
|
8
|
+
this.store = new file_json_store_1.FileJsonStore(filePath);
|
|
9
|
+
}
|
|
10
|
+
async read() {
|
|
11
|
+
return this.store.read();
|
|
12
|
+
}
|
|
13
|
+
async save(tokens) {
|
|
14
|
+
await this.store.write(tokens);
|
|
15
|
+
}
|
|
16
|
+
async clear() {
|
|
17
|
+
await this.store.clear();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.TokenStore = TokenStore;
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solarains/va-cli",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Bootstrap CLI for the VAOne product.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"vaone": "dist/main.js"
|
|
7
|
+
},
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=20"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@inquirer/core": "^10.2.2",
|
|
13
|
+
"@inquirer/prompts": "^7.8.0",
|
|
14
|
+
"chalk": "^5.5.0",
|
|
15
|
+
"ora": "^8.2.0",
|
|
16
|
+
"qrcode-terminal": "^0.12.0"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT"
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: visionalpha-operator
|
|
3
|
+
description: Use when the user asks in Chinese or English to use VA or VisionAlpha for daily reports, usage summary, auth recovery, asset intelligence, or asset listing. Route all supported work through the local `vaone` CLI and send installation or billing requests to the web portal.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VisionAlpha Operator
|
|
7
|
+
|
|
8
|
+
Use this skill as the single VisionAlpha umbrella entrypoint. It is for brand-led requests such as "用va看下今日日报", "use visionalpha to check usage", "用 VA 查资产列表", or "query VisionAlpha intelligence".
|
|
9
|
+
|
|
10
|
+
## Trigger contract
|
|
11
|
+
|
|
12
|
+
Use this skill when the user:
|
|
13
|
+
|
|
14
|
+
- Mentions `va`, `VA`, `VisionAlpha`, or `visionalpha`
|
|
15
|
+
- Asks for daily reports, usage, login recovery, asset intelligence, or asset listing through that brand entrypoint
|
|
16
|
+
- Writes the request in Chinese or English
|
|
17
|
+
|
|
18
|
+
## Operating rules
|
|
19
|
+
|
|
20
|
+
1. Use only the local `vaone` CLI for product operations. Do not call private HTTP APIs directly from the skill.
|
|
21
|
+
2. Do not ask the user for access tokens, refresh tokens, verification codes, or copied secrets. Keep auth inside the CLI flow.
|
|
22
|
+
3. If the CLI is missing, not initialized, or the managed skill looks stale, tell the user to run `vaone init`.
|
|
23
|
+
4. If a supported command says login is required, use `vaone auth login`.
|
|
24
|
+
5. Before quota-sensitive work such as daily reports or intelligence queries, you may run `vaone usage`, but summarize readiness in one short line unless the user explicitly asked for detailed usage.
|
|
25
|
+
|
|
26
|
+
## Routing
|
|
27
|
+
|
|
28
|
+
- Daily reports: read [references/daily-reports.md](references/daily-reports.md)
|
|
29
|
+
- Usage summary: read [references/usage-summary.md](references/usage-summary.md)
|
|
30
|
+
- Auth recovery or logout: read [references/auth-recovery.md](references/auth-recovery.md)
|
|
31
|
+
- Asset intelligence query: read [references/asset-intelligence.md](references/asset-intelligence.md)
|
|
32
|
+
- Asset catalog listing: read [references/assets.md](references/assets.md)
|
|
33
|
+
|
|
34
|
+
## Unsupported in this version
|
|
35
|
+
|
|
36
|
+
- Installations or device-slot management: explain that this currently routes through the web portal. Do not invent CLI steps.
|
|
37
|
+
- Billing or subscription actions: explain that this currently routes through the web portal. Do not invent CLI steps.
|
|
38
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Asset Intelligence
|
|
2
|
+
|
|
3
|
+
Use this reference when the user wants paid intelligence results, intelligence narratives, or filtered research results through VA or VisionAlpha.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
- `vaone intelligence query --query` is not available.
|
|
8
|
+
- Use the supported filter arguments on `vaone intelligence query`:
|
|
9
|
+
- `--asset-id <id>`
|
|
10
|
+
- `--category <category>`
|
|
11
|
+
- `--issuer <issuer>`
|
|
12
|
+
- `--publish-date-from <yyyy-mm-dd>`
|
|
13
|
+
- `--publish-date-to <yyyy-mm-dd>`
|
|
14
|
+
- `--min-relevance-score <n>`
|
|
15
|
+
- `--limit <n>`
|
|
16
|
+
- `--next`
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
1. If the user gives clear structured filters, run `vaone intelligence query` with those filters.
|
|
21
|
+
2. If the user asks an open-ended intelligence question without structured filters, ask a short clarification rather than inventing a free-text query mode.
|
|
22
|
+
3. Use `--limit` to keep the first result set tight.
|
|
23
|
+
4. Use `--next` only when continuing the immediately previous intelligence query.
|
|
24
|
+
|
|
25
|
+
## Usage preflight
|
|
26
|
+
|
|
27
|
+
- You may run `vaone usage` before the intelligence query.
|
|
28
|
+
- Keep that usage summary to one short line unless the user explicitly asked for usage details.
|
|
29
|
+
|
|
30
|
+
## Recovery notes
|
|
31
|
+
|
|
32
|
+
- If the CLI says the account lacks paid intelligence access, say that directly.
|
|
33
|
+
- If the CLI says quota is exceeded, explain that the current intelligence query would exceed the daily paid quota.
|
|
34
|
+
- If the cursor is invalid, restart the query without `--next`.
|
|
35
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Assets
|
|
2
|
+
|
|
3
|
+
Use this reference when the user wants the asset catalog, a filtered asset list, or asks VA or VisionAlpha to show supported assets.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
- `vaone assets list`
|
|
8
|
+
|
|
9
|
+
## Supported filters
|
|
10
|
+
|
|
11
|
+
The first version is a filterable list, not a search workflow. Use only:
|
|
12
|
+
|
|
13
|
+
- `--category <category>`
|
|
14
|
+
- `--enabled true|false`
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
1. If the user asks for the asset list without filters, run `vaone assets list`.
|
|
19
|
+
2. If the user asks for a filtered list, pass only the supported filters above.
|
|
20
|
+
3. If the user asks for fuzzy search, issuer search, or unsupported filter fields, explain that the current CLI only supports category and enabled filters.
|
|
21
|
+
|
|
22
|
+
## Response style
|
|
23
|
+
|
|
24
|
+
- Keep the first response compact.
|
|
25
|
+
- If the returned list is long, summarize the most relevant assets and mention the filters used.
|
|
26
|
+
|
|
27
|
+
## Recovery notes
|
|
28
|
+
|
|
29
|
+
- If asset listing says login is required, run `vaone auth login`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Auth Recovery
|
|
2
|
+
|
|
3
|
+
Use this reference when the user wants to log in, recover access, verify that the current machine is authenticated, or log out of VA or VisionAlpha.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
- Log in: `vaone auth login`
|
|
8
|
+
- Log out: `vaone auth logout`
|
|
9
|
+
- Check access after login: `vaone usage`
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
1. If a supported command fails because authentication is missing or expired, run `vaone auth login`.
|
|
14
|
+
2. If the user explicitly asks to sign out, run `vaone auth logout`.
|
|
15
|
+
3. After login or logout, use `vaone usage` only when the user needs confirmation or when another workflow depends on it.
|
|
16
|
+
|
|
17
|
+
## Important behavior
|
|
18
|
+
|
|
19
|
+
- `vaone auth logout` is best-effort remote logout plus guaranteed local cleanup.
|
|
20
|
+
- If remote logout fails, local logout still succeeds. Report that clearly.
|
|
21
|
+
- Do not ask the user to paste tokens, cookies, or secret values into chat.
|
|
22
|
+
|
|
23
|
+
## When to redirect
|
|
24
|
+
|
|
25
|
+
- If the request is really about installation or device-slot management, explain that it currently belongs in the web portal rather than the CLI.
|
|
26
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Daily Reports
|
|
2
|
+
|
|
3
|
+
Use this reference when the user wants a report list, a specific report, or "today's report" through VA or VisionAlpha.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
- List reports: `vaone reports list`
|
|
8
|
+
- Filter by asset or category: `vaone reports list --asset-id <id> --category <category>`
|
|
9
|
+
- Limit rows: `vaone reports list --limit <n>`
|
|
10
|
+
- Get a report by asset id: `vaone reports get <asset-id>`
|
|
11
|
+
- Get a report for a specific date: `vaone reports get <asset-id> --date <yyyy-mm-dd>`
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. If the user asked for a list, run `vaone reports list` with the smallest useful filters.
|
|
16
|
+
2. If the user asked for one report and did not give the asset id clearly, list first and clarify from the returned choices.
|
|
17
|
+
3. If the user asked for "today's" report, prefer the current product-day report via `vaone reports get <asset-id>` without forcing a date.
|
|
18
|
+
4. If the user asked for a historical date, pass `--date`.
|
|
19
|
+
5. Keep summaries concise first. Expand only if the user wants the full report body or detailed interpretation.
|
|
20
|
+
|
|
21
|
+
## Usage preflight
|
|
22
|
+
|
|
23
|
+
- You may run `vaone usage` before a report fetch.
|
|
24
|
+
- Default output should be one short readiness line, not the full usage dump.
|
|
25
|
+
|
|
26
|
+
## Recovery notes
|
|
27
|
+
|
|
28
|
+
- If the CLI says login is required, run `vaone auth login`.
|
|
29
|
+
- If the CLI reports the daily report selection is already locked, explain that free accounts can keep only one report selection for the current product day.
|
|
30
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Usage Summary
|
|
2
|
+
|
|
3
|
+
Use this reference when the user asks for usage, plan state, entitlement, quota, or asks whether VA can still run a quota-sensitive action.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
- `vaone usage`
|
|
8
|
+
|
|
9
|
+
## Workflow
|
|
10
|
+
|
|
11
|
+
1. Run `vaone usage`.
|
|
12
|
+
2. If the user asked a direct usage question, return the relevant fields from the CLI output.
|
|
13
|
+
3. If usage is just a preflight for another task, compress it to one short line.
|
|
14
|
+
|
|
15
|
+
## Default response style
|
|
16
|
+
|
|
17
|
+
- Good: "Usage ready: daily report available, intelligence quota still open."
|
|
18
|
+
- Avoid dumping the full usage output unless the user asked for detailed usage or troubleshooting.
|
|
19
|
+
|
|
20
|
+
## Recovery notes
|
|
21
|
+
|
|
22
|
+
- If usage says login is required, run `vaone auth login`.
|
|
23
|
+
- If the user is troubleshooting access, show the full usage output instead of the one-line summary.
|
|
24
|
+
|