@aswless_854771076/ai_short_studio_cli 0.1.13 → 0.1.15
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
CHANGED
|
@@ -5,7 +5,6 @@ VVICAT 新链路无限画布的官方命令行客户端。要求 Node.js 22 或
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install --global @aswless_854771076/ai_short_studio_cli
|
|
7
7
|
ai-short-studio auth login --google \
|
|
8
|
-
--base-url https://vvicat.example.com \
|
|
9
8
|
--supabase-url https://your-project.supabase.co \
|
|
10
9
|
--supabase-publishable-key your-publishable-key
|
|
11
10
|
ai-short-studio project list --json
|
|
@@ -25,7 +24,7 @@ Agent 代操作时,用户已在当前会话明确提供的密码只能直接
|
|
|
25
24
|
|
|
26
25
|
注册确认链接使用当前 profile 的 `baseUrl` 和 `--locale`,指向同域的 `/{locale}/auth/callback`。API 与网页需保持同域,并在 Supabase Redirect URLs 中允许各环境的 `/**`;Site URL 只作为未显式传入回调时的生产兜底。
|
|
27
26
|
|
|
28
|
-
CLI 只把 refresh token 保存到系统钥匙串,access token
|
|
27
|
+
CLI 只把 refresh token 保存到系统钥匙串,access token 仅驻留内存并在到期前自动刷新。未配置服务地址时默认连接 `https://ai-short-studio.vvicat.dev`,`--base-url`、`VVICAT_BASE_URL` 和当前 profile 可依次覆盖。首次登录会从服务端 bootstrap 取得 Supabase 公共配置,也可用 `VVICAT_SUPABASE_URL`、`VVICAT_SUPABASE_PUBLISHABLE_KEY` 显式覆盖。服务地址和非敏感 profile 写入系统配置目录;切换环境时必须使用独立的 `--profile`,避免复用旧认证。
|
|
29
28
|
|
|
30
29
|
创作前运行 `ai-short-studio preflight --json`。CLI 会通过公开的 `/api/v1/bootstrap` 检查服务连通性、取得 Supabase 公共配置、读取 npm `latest` 稳定版本并默认更新当前全局包,再检查登录态和文本、人物、场景、故事版、视频模型配置。npm registry 暂时不可用时服务端使用配置版本降级。更新后必须按输出重跑;明确不允许全局写入时使用 `--no-update`。
|
|
31
30
|
|
|
@@ -2,7 +2,7 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import { BaseCommand } from '../base-command.js';
|
|
3
3
|
import { ProfileStore } from '../config/profiles.js';
|
|
4
4
|
import { VvicatApi } from '../domain/vvicat-api.js';
|
|
5
|
-
import { createRuntime } from '../runtime.js';
|
|
5
|
+
import { createRuntime, DEFAULT_BASE_URL } from '../runtime.js';
|
|
6
6
|
import { compareStableVersions, fetchBootstrap, inspectCreationConfig, readCurrentPackageIdentity, updateCliPackage, } from '../preflight.js';
|
|
7
7
|
export default class Preflight extends BaseCommand {
|
|
8
8
|
static description = '创作前检查 CLI、服务连接、认证和模型配置';
|
|
@@ -14,9 +14,7 @@ export default class Preflight extends BaseCommand {
|
|
|
14
14
|
const { flags } = await this.parse(Preflight);
|
|
15
15
|
const profiles = new ProfileStore();
|
|
16
16
|
const selected = flags.profile ? await profiles.get(flags.profile) : await profiles.current();
|
|
17
|
-
const baseUrl = (flags['base-url'] || process.env.VVICAT_BASE_URL || selected?.baseUrl ||
|
|
18
|
-
if (!baseUrl)
|
|
19
|
-
this.error('缺少服务地址,请传入 --base-url 或设置 VVICAT_BASE_URL');
|
|
17
|
+
const baseUrl = (flags['base-url'] || process.env.VVICAT_BASE_URL || selected?.baseUrl || DEFAULT_BASE_URL).replace(/\/+$/, '');
|
|
20
18
|
const bootstrap = await fetchBootstrap(baseUrl);
|
|
21
19
|
const current = await readCurrentPackageIdentity();
|
|
22
20
|
const hasUpdate = compareStableVersions(current.version, bootstrap.cli.latestVersion) < 0;
|
package/dist/runtime.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface RuntimeFlags {
|
|
|
8
8
|
'supabase-publishable-key'?: string;
|
|
9
9
|
'supabase-url'?: string;
|
|
10
10
|
}
|
|
11
|
+
export declare const DEFAULT_BASE_URL = "https://ai-short-studio.vvicat.dev";
|
|
11
12
|
export declare function createRuntime(flags: RuntimeFlags): Promise<{
|
|
12
13
|
profile: CliProfile;
|
|
13
14
|
session: SessionManager;
|
package/dist/runtime.js
CHANGED
|
@@ -3,12 +3,11 @@ import { KeyringCredentialStore } from './auth/credential-store.js';
|
|
|
3
3
|
import { SessionManager, SupabaseAuthProvider } from './auth/session-manager.js';
|
|
4
4
|
import { ProfileStore } from './config/profiles.js';
|
|
5
5
|
import { fetchBootstrap } from './preflight.js';
|
|
6
|
+
export const DEFAULT_BASE_URL = 'https://ai-short-studio.vvicat.dev';
|
|
6
7
|
export async function createRuntime(flags) {
|
|
7
8
|
const profiles = new ProfileStore();
|
|
8
9
|
const selected = flags.profile ? await profiles.get(flags.profile) : await profiles.current();
|
|
9
|
-
const baseUrl = (flags['base-url'] || process.env.VVICAT_BASE_URL || selected?.baseUrl ||
|
|
10
|
-
if (!baseUrl)
|
|
11
|
-
throw new Error('缺少服务地址,请传入 --base-url 或设置 VVICAT_BASE_URL');
|
|
10
|
+
const baseUrl = (flags['base-url'] || process.env.VVICAT_BASE_URL || selected?.baseUrl || DEFAULT_BASE_URL).replace(/\/+$/, '');
|
|
12
11
|
if (selected?.baseUrl && selected.baseUrl.replace(/\/+$/, '') !== baseUrl) {
|
|
13
12
|
throw new Error('API base URL 与当前 profile 不一致;请为新服务使用独立的 --profile,避免复用旧环境认证');
|
|
14
13
|
}
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ description: Use when an agent needs to inspect or operate VVICAT infinite-canva
|
|
|
13
13
|
|
|
14
14
|
创建项目或修改任何资源前,按顺序执行:
|
|
15
15
|
|
|
16
|
-
1. 运行 `ai-short-studio preflight --json`。它通过 API base URL 检查连通性和 CLI
|
|
16
|
+
1. 运行 `ai-short-studio preflight --json`。它通过 API base URL 检查连通性和 CLI 最新稳定版,未配置地址时使用测试环境 `https://ai-short-studio.vvicat.dev`,默认发现更新就更新当前全局包;`restartRequired` 为真时必须重跑。连不上时提醒用户检查 `--base-url`、`VVICAT_BASE_URL`、profile 或默认测试环境,不猜其他地址。
|
|
17
17
|
2. 未登录且已有账号时执行 `ai-short-studio auth login --google` 或邮箱登录;没有账号且用户明确要求注册时,先核对 profile 的 `baseUrl` 确实指向目标环境,再使用 `auth signup --email <email> --password-stdin`。CLI 会从服务端取得 Supabase 公共配置,并把同域的 `/{locale}/auth/callback` 显式设为注册确认回调。注册返回 `confirmationRequired: true` 时,等待用户完成邮件验证后再登录。登录后重跑 preflight。`ready` 为 false 时,把 `missing` 一次性告知用户并询问如何补齐;新配置模型首选公司的 [StarRouter](https://starrouter.io/),账号开通联系邱茂。
|
|
18
18
|
3. 运行账户级只读命令 `ai-short-studio config get --json`,取得账户默认模型及可用 provider;此步骤只用于计算继承后的有效模型,不得用 `config set` 改账户配置来完成项目配置。
|
|
19
19
|
4. 运行 `ai-short-studio canvas node types --json`,按实时 `inputSchema`、`outputSchema`、`configSchema` 和 `defaultConfig` 确定能力与必填项。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 命令参考
|
|
2
2
|
|
|
3
|
-
所有命令支持 `--base-url`、`--profile`、`--locale zh|en` 和 `--json
|
|
3
|
+
所有命令支持 `--base-url`、`--profile`、`--locale zh|en` 和 `--json`。未配置地址时默认连接 `https://ai-short-studio.vvicat.dev`;`--base-url`、`VVICAT_BASE_URL` 和当前 profile 可依次覆盖。默认档案保存服务地址与默认项目;refresh token 仅保存在系统钥匙串。
|
|
4
4
|
|
|
5
5
|
## 创作前预检
|
|
6
6
|
|