@aswless_854771076/ai_short_studio_cli 0.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +56 -0
  2. package/bin/run.js +5 -0
  3. package/dist/auth/credential-store.d.ts +6 -0
  4. package/dist/auth/credential-store.js +27 -0
  5. package/dist/auth/google-oauth.d.ts +2 -0
  6. package/dist/auth/google-oauth.js +72 -0
  7. package/dist/auth/session-manager.d.ts +44 -0
  8. package/dist/auth/session-manager.js +100 -0
  9. package/dist/base-command.d.ts +11 -0
  10. package/dist/base-command.js +39 -0
  11. package/dist/client/api-client.d.ts +23 -0
  12. package/dist/client/api-client.js +64 -0
  13. package/dist/client/errors.d.ts +14 -0
  14. package/dist/client/errors.js +34 -0
  15. package/dist/command-helpers.d.ts +10 -0
  16. package/dist/command-helpers.js +24 -0
  17. package/dist/commands/auth/login.d.ts +14 -0
  18. package/dist/commands/auth/login.js +32 -0
  19. package/dist/commands/auth/logout.d.ts +11 -0
  20. package/dist/commands/auth/logout.js +12 -0
  21. package/dist/commands/auth/status.d.ts +11 -0
  22. package/dist/commands/auth/status.js +12 -0
  23. package/dist/commands/canvas/apply.d.ts +12 -0
  24. package/dist/commands/canvas/apply.js +7 -0
  25. package/dist/commands/canvas/asset/download.d.ts +16 -0
  26. package/dist/commands/canvas/asset/download.js +34 -0
  27. package/dist/commands/canvas/asset/get.d.ts +14 -0
  28. package/dist/commands/canvas/asset/get.js +12 -0
  29. package/dist/commands/canvas/asset/list.d.ts +13 -0
  30. package/dist/commands/canvas/asset/list.js +7 -0
  31. package/dist/commands/canvas/asset/select.d.ts +15 -0
  32. package/dist/commands/canvas/asset/select.js +8 -0
  33. package/dist/commands/canvas/asset/upload.d.ts +14 -0
  34. package/dist/commands/canvas/asset/upload.js +10 -0
  35. package/dist/commands/canvas/edge/connect.d.ts +13 -0
  36. package/dist/commands/canvas/edge/connect.js +9 -0
  37. package/dist/commands/canvas/edge/disconnect.d.ts +15 -0
  38. package/dist/commands/canvas/edge/disconnect.js +8 -0
  39. package/dist/commands/canvas/edge/list.d.ts +11 -0
  40. package/dist/commands/canvas/edge/list.js +10 -0
  41. package/dist/commands/canvas/get.d.ts +11 -0
  42. package/dist/commands/canvas/get.js +6 -0
  43. package/dist/commands/canvas/node/add.d.ts +18 -0
  44. package/dist/commands/canvas/node/add.js +8 -0
  45. package/dist/commands/canvas/node/delete.d.ts +15 -0
  46. package/dist/commands/canvas/node/delete.js +8 -0
  47. package/dist/commands/canvas/node/get.d.ts +14 -0
  48. package/dist/commands/canvas/node/get.js +12 -0
  49. package/dist/commands/canvas/node/list.d.ts +11 -0
  50. package/dist/commands/canvas/node/list.js +10 -0
  51. package/dist/commands/canvas/node/run.d.ts +16 -0
  52. package/dist/commands/canvas/node/run.js +11 -0
  53. package/dist/commands/canvas/node/types.d.ts +13 -0
  54. package/dist/commands/canvas/node/types.js +8 -0
  55. package/dist/commands/canvas/node/update.d.ts +15 -0
  56. package/dist/commands/canvas/node/update.js +8 -0
  57. package/dist/commands/config/get.d.ts +10 -0
  58. package/dist/commands/config/get.js +6 -0
  59. package/dist/commands/config/set.d.ts +11 -0
  60. package/dist/commands/config/set.js +7 -0
  61. package/dist/commands/project/create.d.ts +12 -0
  62. package/dist/commands/project/create.js +7 -0
  63. package/dist/commands/project/delete.d.ts +14 -0
  64. package/dist/commands/project/delete.js +8 -0
  65. package/dist/commands/project/get.d.ts +13 -0
  66. package/dist/commands/project/get.js +8 -0
  67. package/dist/commands/project/list.d.ts +14 -0
  68. package/dist/commands/project/list.js +13 -0
  69. package/dist/commands/project/update.d.ts +15 -0
  70. package/dist/commands/project/update.js +9 -0
  71. package/dist/commands/skill/install.d.ts +13 -0
  72. package/dist/commands/skill/install.js +8 -0
  73. package/dist/commands/skill/path.d.ts +10 -0
  74. package/dist/commands/skill/path.js +6 -0
  75. package/dist/commands/skill/status.d.ts +12 -0
  76. package/dist/commands/skill/status.js +7 -0
  77. package/dist/commands/skill/update.d.ts +1 -0
  78. package/dist/commands/skill/update.js +1 -0
  79. package/dist/commands/task/cancel.d.ts +14 -0
  80. package/dist/commands/task/cancel.js +8 -0
  81. package/dist/commands/task/get.d.ts +13 -0
  82. package/dist/commands/task/get.js +8 -0
  83. package/dist/commands/task/wait.d.ts +14 -0
  84. package/dist/commands/task/wait.js +9 -0
  85. package/dist/config/profiles.d.ts +15 -0
  86. package/dist/config/profiles.js +47 -0
  87. package/dist/domain/vvicat-api.d.ts +84 -0
  88. package/dist/domain/vvicat-api.js +144 -0
  89. package/dist/index.d.ts +1 -0
  90. package/dist/index.js +1 -0
  91. package/dist/output/formatter.d.ts +1 -0
  92. package/dist/output/formatter.js +3 -0
  93. package/dist/runtime.d.ts +14 -0
  94. package/dist/runtime.js +45 -0
  95. package/dist/skill/command-flags.d.ts +8 -0
  96. package/dist/skill/command-flags.js +9 -0
  97. package/dist/skill/skill-manager.d.ts +24 -0
  98. package/dist/skill/skill-manager.js +100 -0
  99. package/dist/terminal/prompt.d.ts +2 -0
  100. package/dist/terminal/prompt.js +49 -0
  101. package/package.json +55 -0
  102. package/skills/using-vvicat-cli/SKILL.md +49 -0
  103. package/skills/using-vvicat-cli/agents/openai.yaml +4 -0
  104. package/skills/using-vvicat-cli/references/commands.md +90 -0
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class CanvasApply extends BaseCommand {
3
+ static flags: {
4
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
5
+ file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { commandApi, projectFlag, readJsonInput } from '../../command-helpers.js';
4
+ export default class CanvasApply extends BaseCommand {
5
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, file: Flags.string({ description: 'patch JSON 文件;省略时读取 stdin' }) };
6
+ async run() { const { flags } = await this.parse(CanvasApply); const { api } = await commandApi(flags); const canvas = await api.canvas(flags.project); this.print(await api.patchCanvas(flags.project, { ...(await readJsonInput(flags.file)), canvasId: canvas.id, expectedVersion: canvas.version })); }
7
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasAssetDownload extends BaseCommand {
3
+ static args: {
4
+ assetId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,34 @@
1
+ import { basename, join } from 'node:path';
2
+ import { mkdir, rename, writeFile } from 'node:fs/promises';
3
+ import { Args, Flags } from '@oclif/core';
4
+ import { BaseCommand } from '../../../base-command.js';
5
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
6
+ export default class CanvasAssetDownload extends BaseCommand {
7
+ static args = { assetId: Args.string({ required: true }) };
8
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, version: Flags.string(), output: Flags.string({ default: '.' }) };
9
+ async run() {
10
+ const { args, flags } = await this.parse(CanvasAssetDownload);
11
+ const { api, client, profile } = await commandApi(flags);
12
+ const payload = await api.asset(flags.project, args.assetId);
13
+ const asset = payload.asset;
14
+ if (!asset)
15
+ this.error('资产响应无效');
16
+ const version = flags.version ? asset.versions?.find((item) => item.id === flags.version) : asset.selectedVersion;
17
+ const media = version?.media || version?.items?.[0]?.media;
18
+ if (!media?.url)
19
+ this.error('所选资产版本没有可下载媒体');
20
+ const mediaUrl = new URL(media.url, profile.baseUrl);
21
+ mediaUrl.searchParams.set('download', '1');
22
+ const response = await client.response(mediaUrl.toString(), {
23
+ auth: mediaUrl.origin === new URL(profile.baseUrl).origin,
24
+ });
25
+ await mkdir(flags.output, { recursive: true });
26
+ const filename = safeName(asset.name || basename(media.url));
27
+ const target = join(flags.output, filename);
28
+ const partial = `${target}.part`;
29
+ await writeFile(partial, Buffer.from(await response.arrayBuffer()));
30
+ await rename(partial, target);
31
+ this.print({ assetId: asset.id, versionId: version?.id, path: target });
32
+ }
33
+ }
34
+ function safeName(value) { return value.replace(/[\\/:*?"<>|]/g, '_') || 'download.bin'; }
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasAssetGet extends BaseCommand {
3
+ static args: {
4
+ assetId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
4
+ export default class CanvasAssetGet extends BaseCommand {
5
+ static args = { assetId: Args.string({ required: true }) };
6
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag };
7
+ async run() {
8
+ const { args, flags } = await this.parse(CanvasAssetGet);
9
+ const { api } = await commandApi(flags);
10
+ this.print(await api.asset(flags.project, args.assetId));
11
+ }
12
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasAssetList extends BaseCommand {
3
+ static flags: {
4
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
5
+ kind: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,7 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
4
+ export default class CanvasAssetList extends BaseCommand {
5
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, kind: Flags.string(), search: Flags.string() };
6
+ async run() { const { flags } = await this.parse(CanvasAssetList); const query = new URLSearchParams({ ...(flags.kind ? { kind: flags.kind } : {}), ...(flags.search ? { search: flags.search } : {}) }); const { api } = await commandApi(flags); this.print(await api.listAssets(flags.project, query.toString())); }
7
+ }
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasAssetSelect extends BaseCommand {
3
+ static args: {
4
+ assetId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ version: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,8 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
4
+ export default class CanvasAssetSelect extends BaseCommand {
5
+ static args = { assetId: Args.string({ required: true }) };
6
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, version: Flags.string({ required: true }) };
7
+ async run() { const { args, flags } = await this.parse(CanvasAssetSelect); const { api } = await commandApi(flags); this.print(await api.selectAssetVersion(flags.project, args.assetId, flags.version)); }
8
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasAssetUpload extends BaseCommand {
3
+ static args: {
4
+ file: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { basename } from 'node:path';
2
+ import { readFile } from 'node:fs/promises';
3
+ import { Args } from '@oclif/core';
4
+ import { BaseCommand } from '../../../base-command.js';
5
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
6
+ export default class CanvasAssetUpload extends BaseCommand {
7
+ static args = { file: Args.string({ required: true }) };
8
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag };
9
+ async run() { const { args, flags } = await this.parse(CanvasAssetUpload); const bytes = await readFile(args.file); const form = new FormData(); form.set('file', new Blob([bytes]), basename(args.file)); const { api } = await commandApi(flags); this.print(await api.uploadAsset(flags.project, form)); }
10
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasEdgeConnect extends BaseCommand {
3
+ static flags: {
4
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
5
+ from: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
+ to: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,9 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
4
+ export default class CanvasEdgeConnect extends BaseCommand {
5
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, from: Flags.string({ required: true, description: 'sourceNodeId:sourceHandle' }), to: Flags.string({ required: true, description: 'targetNodeId:targetHandle' }) };
6
+ async run() { const { flags } = await this.parse(CanvasEdgeConnect); const [sourceNodeId, sourceHandle] = splitPort(flags.from); const [targetNodeId, targetHandle] = splitPort(flags.to); const { api } = await commandApi(flags); this.print(await api.connect(flags.project, { sourceNodeId, sourceHandle, targetNodeId, targetHandle })); }
7
+ }
8
+ function splitPort(value) { const index = value.lastIndexOf(':'); if (index < 1 || index === value.length - 1)
9
+ throw new Error(`端口格式错误:${value}`); return [value.slice(0, index), value.slice(index + 1)]; }
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasEdgeDisconnect extends BaseCommand {
3
+ static args: {
4
+ edgeId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,8 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
4
+ export default class CanvasEdgeDisconnect extends BaseCommand {
5
+ static args = { edgeId: Args.string({ required: true }) };
6
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, yes: Flags.boolean({ required: true }) };
7
+ async run() { const { args, flags } = await this.parse(CanvasEdgeDisconnect); const { api } = await commandApi(flags); this.print(await api.disconnect(flags.project, args.edgeId)); }
8
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasEdgeList extends BaseCommand {
3
+ static flags: {
4
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
5
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
3
+ export default class CanvasEdgeList extends BaseCommand {
4
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag };
5
+ async run() {
6
+ const { flags } = await this.parse(CanvasEdgeList);
7
+ const { api } = await commandApi(flags);
8
+ this.print(await api.listEdges(flags.project));
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class CanvasGet extends BaseCommand {
3
+ static flags: {
4
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
5
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ import { commandApi, projectFlag } from '../../command-helpers.js';
3
+ export default class CanvasGet extends BaseCommand {
4
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag };
5
+ async run() { const { flags } = await this.parse(CanvasGet); const { api } = await commandApi(flags); this.print(await api.canvas(flags.project)); }
6
+ }
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasNodeAdd extends BaseCommand {
3
+ static args: {
4
+ kind: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ x: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
9
+ y: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
10
+ title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ };
17
+ run(): Promise<void>;
18
+ }
@@ -0,0 +1,8 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag, readJsonInput } from '../../../command-helpers.js';
4
+ export default class CanvasNodeAdd extends BaseCommand {
5
+ static args = { kind: Args.string({ required: true }) };
6
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, x: Flags.integer({ default: 0 }), y: Flags.integer({ default: 0 }), title: Flags.string(), config: Flags.string({ description: '配置 JSON 文件' }) };
7
+ async run() { const { args, flags } = await this.parse(CanvasNodeAdd); const { api } = await commandApi(flags); this.print(await api.addNode(flags.project, { kind: args.kind, x: flags.x, y: flags.y, title: flags.title, config: flags.config ? await readJsonInput(flags.config) : {} })); }
8
+ }
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasNodeDelete extends BaseCommand {
3
+ static args: {
4
+ nodeId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,8 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
4
+ export default class CanvasNodeDelete extends BaseCommand {
5
+ static args = { nodeId: Args.string({ required: true }) };
6
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, yes: Flags.boolean({ required: true }) };
7
+ async run() { const { args, flags } = await this.parse(CanvasNodeDelete); const { api } = await commandApi(flags); this.print(await api.deleteNode(flags.project, args.nodeId)); }
8
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasNodeGet extends BaseCommand {
3
+ static args: {
4
+ nodeId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
4
+ export default class CanvasNodeGet extends BaseCommand {
5
+ static args = { nodeId: Args.string({ required: true }) };
6
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag };
7
+ async run() {
8
+ const { args, flags } = await this.parse(CanvasNodeGet);
9
+ const { api } = await commandApi(flags);
10
+ this.print(await api.node(flags.project, args.nodeId));
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasNodeList extends BaseCommand {
3
+ static flags: {
4
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
5
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
3
+ export default class CanvasNodeList extends BaseCommand {
4
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag };
5
+ async run() {
6
+ const { flags } = await this.parse(CanvasNodeList);
7
+ const { api } = await commandApi(flags);
8
+ this.print(await api.listNodes(flags.project));
9
+ }
10
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasNodeRun extends BaseCommand {
3
+ static args: {
4
+ nodeId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ wait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ interval: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,11 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag } from '../../../command-helpers.js';
4
+ export default class CanvasNodeRun extends BaseCommand {
5
+ static args = { nodeId: Args.string({ required: true }) };
6
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, wait: Flags.boolean({ default: false }), interval: Flags.integer({ default: 1000 }) };
7
+ async run() { const { args, flags } = await this.parse(CanvasNodeRun); const { api } = await commandApi(flags); const submitted = await api.runNode(flags.project, args.nodeId); if (flags.wait && submitted.task?.id)
8
+ this.print(await api.waitTask(submitted.task.id, flags.interval));
9
+ else
10
+ this.print(submitted); }
11
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasNodeTypes extends BaseCommand {
3
+ static args: {
4
+ kind: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,8 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi } from '../../../command-helpers.js';
4
+ export default class CanvasNodeTypes extends BaseCommand {
5
+ static args = { kind: Args.string() };
6
+ static flags = BaseCommand.baseFlags;
7
+ async run() { const { args, flags } = await this.parse(CanvasNodeTypes); const { api } = await commandApi(flags); const catalog = await api.nodeTypes(); this.print(args.kind ? catalog.nodeTypes.find((item) => item.kind === args.kind) ?? null : catalog); }
8
+ }
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../../base-command.js';
2
+ export default class CanvasNodeUpdate extends BaseCommand {
3
+ static args: {
4
+ nodeId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,8 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../../base-command.js';
3
+ import { commandApi, projectFlag, readJsonInput } from '../../../command-helpers.js';
4
+ export default class CanvasNodeUpdate extends BaseCommand {
5
+ static args = { nodeId: Args.string({ required: true }) };
6
+ static flags = { ...BaseCommand.baseFlags, project: projectFlag, config: Flags.string({ description: '配置 JSON 文件;省略时读取 stdin' }) };
7
+ async run() { const { args, flags } = await this.parse(CanvasNodeUpdate); const { api } = await commandApi(flags); this.print(await api.updateNode(flags.project, args.nodeId, await readJsonInput(flags.config))); }
8
+ }
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class ConfigGet extends BaseCommand {
3
+ static flags: {
4
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
5
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
6
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ };
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ import { commandApi } from '../../command-helpers.js';
3
+ export default class ConfigGet extends BaseCommand {
4
+ static flags = BaseCommand.baseFlags;
5
+ async run() { const { flags } = await this.parse(ConfigGet); const { api } = await commandApi(flags); this.print(await api.config()); }
6
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class ConfigSet extends BaseCommand {
3
+ static flags: {
4
+ file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
5
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,7 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { commandApi, readJsonInput } from '../../command-helpers.js';
4
+ export default class ConfigSet extends BaseCommand {
5
+ static flags = { ...BaseCommand.baseFlags, file: Flags.string({ description: '配置 JSON;省略时读取 stdin' }) };
6
+ async run() { const { flags } = await this.parse(ConfigSet); const { api } = await commandApi(flags); this.print(await api.updateConfig(await readJsonInput(flags.file))); }
7
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class ProjectCreate extends BaseCommand {
3
+ static flags: {
4
+ name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
5
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { commandApi } from '../../command-helpers.js';
4
+ export default class ProjectCreate extends BaseCommand {
5
+ static flags = { ...BaseCommand.baseFlags, name: Flags.string({ required: true }), description: Flags.string() };
6
+ async run() { const { flags } = await this.parse(ProjectCreate); const { api } = await commandApi(flags); this.print(await api.createProject({ name: flags.name, description: flags.description })); }
7
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class ProjectDelete extends BaseCommand {
3
+ static args: {
4
+ projectId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,8 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { commandApi } from '../../command-helpers.js';
4
+ export default class ProjectDelete extends BaseCommand {
5
+ static args = { projectId: Args.string({ required: true }) };
6
+ static flags = { ...BaseCommand.baseFlags, yes: Flags.boolean({ required: true, description: '确认不可逆删除' }) };
7
+ async run() { const { args, flags } = await this.parse(ProjectDelete); const { api } = await commandApi(flags); this.print(await api.deleteProject(args.projectId)); }
8
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class ProjectGet extends BaseCommand {
3
+ static args: {
4
+ projectId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static flags: {
7
+ 'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,8 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { commandApi } from '../../command-helpers.js';
4
+ export default class ProjectGet extends BaseCommand {
5
+ static args = { projectId: Args.string({ required: true }) };
6
+ static flags = BaseCommand.baseFlags;
7
+ async run() { const { args, flags } = await this.parse(ProjectGet); const { api } = await commandApi(flags); this.print(await api.project(args.projectId)); }
8
+ }