@skillbuilder/minitool-cli 0.0.0-beta-20261027053041051

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 (79) hide show
  1. package/README.md +185 -0
  2. package/bin/redminitool.js +176 -0
  3. package/lib/bootstrap.js +69 -0
  4. package/lib/commands/auth/identity.js +98 -0
  5. package/lib/commands/auth/index.js +20 -0
  6. package/lib/commands/auth/login.js +148 -0
  7. package/lib/commands/auth/logout.js +52 -0
  8. package/lib/commands/auth/storage.js +105 -0
  9. package/lib/commands/dev/dev.test.js +108 -0
  10. package/lib/commands/dev.js +119 -0
  11. package/lib/commands/index.js +19 -0
  12. package/lib/commands/minitool/cli.test.js +222 -0
  13. package/lib/commands/minitool/commands.test.js +119 -0
  14. package/lib/commands/minitool/common.js +103 -0
  15. package/lib/commands/minitool/config.js +51 -0
  16. package/lib/commands/minitool/edit.js +55 -0
  17. package/lib/commands/minitool/history.js +56 -0
  18. package/lib/commands/minitool/index.js +24 -0
  19. package/lib/commands/minitool/list.js +65 -0
  20. package/lib/commands/minitool/preview.js +115 -0
  21. package/lib/commands/minitool/status.js +55 -0
  22. package/lib/commands/minitool/submit.js +58 -0
  23. package/lib/commands/minitool/upload.js +80 -0
  24. package/lib/core/base.js +133 -0
  25. package/lib/decorators/auth.js +26 -0
  26. package/lib/decorators/captureError.js +32 -0
  27. package/lib/decorators/constants.js +11 -0
  28. package/lib/decorators/decorators.test.js +94 -0
  29. package/lib/decorators/index.js +21 -0
  30. package/lib/decorators/injectParams.js +30 -0
  31. package/lib/decorators/json-output.js +18 -0
  32. package/lib/decorators/params/common.js +21 -0
  33. package/lib/decorators/params/index.js +24 -0
  34. package/lib/index.js +18 -0
  35. package/lib/main.js +26 -0
  36. package/lib/mcp.js +197 -0
  37. package/lib/output.js +7 -0
  38. package/lib/ui.js +39 -0
  39. package/lib/utils/agent-check.js +157 -0
  40. package/lib/utils/templates.js +75 -0
  41. package/package.json +48 -0
  42. package/types/bootstrap.d.ts +14 -0
  43. package/types/commands/auth/identity.d.ts +9 -0
  44. package/types/commands/auth/index.d.ts +4 -0
  45. package/types/commands/auth/login.d.ts +13 -0
  46. package/types/commands/auth/logout.d.ts +7 -0
  47. package/types/commands/auth/storage.d.ts +14 -0
  48. package/types/commands/dev/dev.test.d.ts +1 -0
  49. package/types/commands/dev.d.ts +8 -0
  50. package/types/commands/index.d.ts +3 -0
  51. package/types/commands/minitool/cli.test.d.ts +1 -0
  52. package/types/commands/minitool/commands.test.d.ts +1 -0
  53. package/types/commands/minitool/common.d.ts +12 -0
  54. package/types/commands/minitool/config.d.ts +5 -0
  55. package/types/commands/minitool/edit.d.ts +20 -0
  56. package/types/commands/minitool/history.d.ts +5 -0
  57. package/types/commands/minitool/index.d.ts +8 -0
  58. package/types/commands/minitool/list.d.ts +5 -0
  59. package/types/commands/minitool/preview.d.ts +23 -0
  60. package/types/commands/minitool/status.d.ts +5 -0
  61. package/types/commands/minitool/submit.d.ts +25 -0
  62. package/types/commands/minitool/upload.d.ts +20 -0
  63. package/types/core/base.d.ts +37 -0
  64. package/types/decorators/auth.d.ts +1 -0
  65. package/types/decorators/captureError.d.ts +1 -0
  66. package/types/decorators/constants.d.ts +7 -0
  67. package/types/decorators/decorators.test.d.ts +1 -0
  68. package/types/decorators/index.d.ts +5 -0
  69. package/types/decorators/injectParams.d.ts +1 -0
  70. package/types/decorators/json-output.d.ts +2 -0
  71. package/types/decorators/params/common.d.ts +10 -0
  72. package/types/decorators/params/index.d.ts +5 -0
  73. package/types/index.d.ts +2 -0
  74. package/types/main.d.ts +5 -0
  75. package/types/mcp.d.ts +9 -0
  76. package/types/output.d.ts +4 -0
  77. package/types/ui.d.ts +4 -0
  78. package/types/utils/agent-check.d.ts +16 -0
  79. package/types/utils/templates.d.ts +17 -0
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TEMPLATE_CATEGORIES = void 0;
16
+ exports.loadTemplatesConfig = loadTemplatesConfig;
17
+ exports.resolveTemplatePath = resolveTemplatePath;
18
+ exports.selectTemplate = selectTemplate;
19
+ const fs_1 = __importDefault(require("fs"));
20
+ const path_1 = __importDefault(require("path"));
21
+ const inquirer_1 = __importDefault(require("inquirer"));
22
+ const TEMPLATES_ROOT = path_1.default.join(__dirname, "../../templates");
23
+ exports.TEMPLATE_CATEGORIES = {
24
+ "cloud-agents": path_1.default.join(TEMPLATES_ROOT, "cloud-agents"),
25
+ "cloud-dev": path_1.default.join(TEMPLATES_ROOT, "cloud-dev"),
26
+ };
27
+ function loadTemplatesConfig(category) {
28
+ const categoryDir = exports.TEMPLATE_CATEGORIES[category];
29
+ const configPath = path_1.default.join(categoryDir, "templates.json");
30
+ if (!fs_1.default.existsSync(configPath)) {
31
+ return [];
32
+ }
33
+ try {
34
+ const content = fs_1.default.readFileSync(configPath, "utf-8");
35
+ const config = JSON.parse(content);
36
+ if (!Array.isArray(config.templates))
37
+ return [];
38
+ return config.templates.filter((t) => {
39
+ const templateDir = path_1.default.join(categoryDir, t.id);
40
+ return fs_1.default.existsSync(templateDir) && fs_1.default.statSync(templateDir).isDirectory();
41
+ });
42
+ }
43
+ catch (_a) {
44
+ return [];
45
+ }
46
+ }
47
+ function resolveTemplatePath(category, templateId) {
48
+ return path_1.default.join(exports.TEMPLATE_CATEGORIES[category], templateId);
49
+ }
50
+ function selectTemplate(category, options) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ const templates = loadTemplatesConfig(category);
53
+ if (templates.length === 0) {
54
+ throw new Error(`未找到可用模板,请检查 ${exports.TEMPLATE_CATEGORIES[category]}/templates.json`);
55
+ }
56
+ if (options.template) {
57
+ const found = templates.find((t) => t.id === options.template);
58
+ if (found)
59
+ return found.id;
60
+ throw new Error(`模板 "${options.template}" 不存在。可用: ${templates.map((t) => t.id).join(", ")}`);
61
+ }
62
+ const { templateId } = yield inquirer_1.default.prompt([
63
+ {
64
+ type: "list",
65
+ name: "templateId",
66
+ message: "请选择模板:",
67
+ choices: templates.map((t) => ({
68
+ name: `${t.name} - ${t.desc}`,
69
+ value: t.id,
70
+ })),
71
+ },
72
+ ]);
73
+ return templateId;
74
+ });
75
+ }
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@skillbuilder/minitool-cli",
3
+ "version": "0.0.0-beta-20261027053041051",
4
+ "description": "小红书小工具 CLI,面向创作者、三方 AI 工具和自动化流程",
5
+ "engines": {
6
+ "node": ">=20.0.0"
7
+ },
8
+ "main": "lib/index.js",
9
+ "types": "types/index.d.ts",
10
+ "bin": {
11
+ "redminitool": "./bin/redminitool.js",
12
+ "red-minitool": "./bin/redminitool.js",
13
+ "xhs-minitool": "./bin/redminitool.js",
14
+ "minitool": "./bin/redminitool.js"
15
+ },
16
+ "files": [
17
+ "bin",
18
+ "lib",
19
+ "README.md",
20
+ "types"
21
+ ],
22
+ "dependencies": {
23
+ "@modelcontextprotocol/sdk": "1.25.3",
24
+ "chalk": "^2.4.2",
25
+ "cli-table3": "^0.5.1",
26
+ "commander": "7",
27
+ "didyoumean": "^1.2.2",
28
+ "inquirer": "^6.5.2",
29
+ "jszip": "^3.10.1",
30
+ "log-symbols": "^3.0.0",
31
+ "open": "^7.4.2",
32
+ "ora": "^4.0.2",
33
+ "semver": "^7.3.7",
34
+ "update-notifier": "^4.0.0",
35
+ "yargs-parser": "^21.0.1",
36
+ "zod": "4.3.5",
37
+ "qrcode": "^1.5.4",
38
+ "@skillbuilder/endpoints": "0.0.0-beta-20261027053041051",
39
+ "@skillbuilder/minitool-cli-auth": "0.0.0-beta-20261027053041051",
40
+ "@skillbuilder/minitool-cli-config": "0.0.0-beta-20261027053041051",
41
+ "@skillbuilder/minitool-core": "0.0.0-beta-20261027053041051",
42
+ "@skillbuilder/miniapp-simulator": "0.0.0-beta-20261027053041051",
43
+ "@skillbuilder/minitool-e2e": "0.0.0-beta-20261027053041051"
44
+ },
45
+ "keywords": [],
46
+ "author": "",
47
+ "license": "ISC"
48
+ }
@@ -0,0 +1,14 @@
1
+ import { type AuthService, type CredentialStorageController, DeviceAuthService } from "@skillbuilder/minitool-cli-auth";
2
+ import { type MinitoolRuntime } from "@skillbuilder/minitool-core";
3
+ export interface CliServiceGraph extends MinitoolRuntime {
4
+ readonly auth: AuthService & Pick<DeviceAuthService, "loginWithQr" | "cancelLogin">;
5
+ readonly credentialStorage: CredentialStorageController;
6
+ readonly environment: "prod" | "beta";
7
+ }
8
+ export interface CliServiceOptions {
9
+ environment?: string;
10
+ homeDir?: string;
11
+ apiBaseUrl?: string;
12
+ request?: typeof fetch;
13
+ }
14
+ export declare function createCliServices(options?: CliServiceOptions): CliServiceGraph;
@@ -0,0 +1,9 @@
1
+ import { Command, type ICommandOptions } from "../../core/base";
2
+ export declare class AuthStatusCommand extends Command {
3
+ execute(ctx: any): Promise<import("@skillbuilder/minitool-cli-auth").AuthState>;
4
+ get options(): ICommandOptions;
5
+ }
6
+ export declare class WhoAmICommand extends Command {
7
+ execute(ctx: any): Promise<import("@skillbuilder/minitool-cli-auth").CreatorIdentity>;
8
+ get options(): ICommandOptions;
9
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./login";
2
+ export * from "./logout";
3
+ export * from "./identity";
4
+ export * from "./storage";
@@ -0,0 +1,13 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../../core/base";
2
+ export declare class LoginCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<{
4
+ authenticated: boolean;
5
+ creator: any;
6
+ credentialStore: "file" | "keychain";
7
+ credentialProvider: string;
8
+ expiresAt: any;
9
+ } | {
10
+ cancelled: boolean;
11
+ }>;
12
+ get options(): ICommandOptions;
13
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, type ICommandOptions } from "../../core/base";
2
+ export declare class LogoutCommand extends Command {
3
+ execute(ctx: any): Promise<{
4
+ loggedOut: true;
5
+ }>;
6
+ get options(): ICommandOptions;
7
+ }
@@ -0,0 +1,14 @@
1
+ import { Command, type ICommandOptions } from "../../core/base";
2
+ export declare class AuthStorageCommand extends Command {
3
+ execute(ctx: any): Promise<{
4
+ authReason?: "credential_store_error" | "not_logged_in" | "expired";
5
+ authState: "authenticated" | "anonymous" | "unavailable";
6
+ sourceRetained?: boolean;
7
+ keyringIssue?: "package_unavailable" | "access_error";
8
+ keyringAvailable?: boolean;
9
+ credentialStore: "file" | "keychain";
10
+ provider: string;
11
+ protection: "restricted_plaintext_file" | "os_protected_store";
12
+ }>;
13
+ get options(): ICommandOptions;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../core/base";
2
+ export declare class DevCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<{
4
+ rootDir: string;
5
+ workbenchUrl: string;
6
+ }>;
7
+ get options(): ICommandOptions;
8
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./auth";
2
+ export * from "./dev";
3
+ export * from "./minitool";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { ICommandContext } from "../../core/base";
2
+ export declare const sourceOption: {
3
+ flags: string;
4
+ desc: string;
5
+ };
6
+ export declare const writeOptions: {
7
+ flags: string;
8
+ desc: string;
9
+ }[];
10
+ export declare function source(ctx: ICommandContext): string;
11
+ export declare function payloadFile(ctx: ICommandContext): Record<string, unknown>;
12
+ export declare function confirmWrite(ctx: ICommandContext, message: string): Promise<boolean>;
@@ -0,0 +1,5 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../../core/base";
2
+ export declare class MiniToolConfigCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<import("@skillbuilder/minitool-core").MiniToolConfig>;
4
+ get options(): ICommandOptions;
5
+ }
@@ -0,0 +1,20 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../../core/base";
2
+ export declare class MiniToolEditCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<import("@skillbuilder/minitool-core").MiniToolReviewResult | {
4
+ dryRun: boolean;
5
+ input: {
6
+ appId: string;
7
+ appName: string;
8
+ slogan: string;
9
+ iconFileId: string;
10
+ source: string;
11
+ coverFileId?: string;
12
+ };
13
+ cancelled?: undefined;
14
+ } | {
15
+ cancelled: boolean;
16
+ dryRun?: undefined;
17
+ input?: undefined;
18
+ }>;
19
+ get options(): ICommandOptions;
20
+ }
@@ -0,0 +1,5 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../../core/base";
2
+ export declare class MiniToolHistoryCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<import("@skillbuilder/minitool-core").MiniToolHistory>;
4
+ get options(): ICommandOptions;
5
+ }
@@ -0,0 +1,8 @@
1
+ export * from "./list";
2
+ export * from "./preview";
3
+ export * from "./status";
4
+ export * from "./submit";
5
+ export * from "./upload";
6
+ export * from "./config";
7
+ export * from "./history";
8
+ export * from "./edit";
@@ -0,0 +1,5 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../../core/base";
2
+ export declare class MiniToolListCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<import("@skillbuilder/minitool-core").MiniToolPage>;
4
+ get options(): ICommandOptions;
5
+ }
@@ -0,0 +1,23 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../../core/base";
2
+ export declare class MiniToolPreviewCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<{
4
+ [x: string]: unknown;
5
+ previewUrl: string;
6
+ } | {
7
+ dryRun: boolean;
8
+ input: {
9
+ pkgFileId: string;
10
+ md5: string;
11
+ source: string;
12
+ appName?: string;
13
+ iconFileId?: string;
14
+ version?: string;
15
+ };
16
+ cancelled?: undefined;
17
+ } | {
18
+ cancelled: boolean;
19
+ dryRun?: undefined;
20
+ input?: undefined;
21
+ }>;
22
+ get options(): ICommandOptions;
23
+ }
@@ -0,0 +1,5 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../../core/base";
2
+ export declare class MiniToolStatusCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<import("@skillbuilder/minitool-core").MiniToolSummary>;
4
+ get options(): ICommandOptions;
5
+ }
@@ -0,0 +1,25 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../../core/base";
2
+ export declare class MiniToolSubmitCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<import("@skillbuilder/minitool-core").MiniToolReviewResult | {
4
+ dryRun: boolean;
5
+ input: {
6
+ appName: string;
7
+ slogan: string;
8
+ iconFileId: string;
9
+ coverFileId: string;
10
+ version: string;
11
+ pkgFileId: string;
12
+ md5: string;
13
+ categories: string[];
14
+ authorizations: string[];
15
+ source: string;
16
+ appId?: string;
17
+ };
18
+ cancelled?: undefined;
19
+ } | {
20
+ cancelled: boolean;
21
+ dryRun?: undefined;
22
+ input?: undefined;
23
+ }>;
24
+ get options(): ICommandOptions;
25
+ }
@@ -0,0 +1,20 @@
1
+ import { Command, type ICommandContext, type ICommandOptions } from "../../core/base";
2
+ export declare class MiniToolUploadCommand extends Command {
3
+ execute(ctx: ICommandContext): Promise<import("@skillbuilder/minitool-core").MiniToolUploadResult | {
4
+ dryRun: boolean;
5
+ file: {
6
+ filePath: string;
7
+ type: "pkg" | "image";
8
+ format: string;
9
+ size: number;
10
+ md5: string;
11
+ sha256: string;
12
+ };
13
+ cancelled?: undefined;
14
+ } | {
15
+ cancelled: boolean;
16
+ dryRun?: undefined;
17
+ file?: undefined;
18
+ }>;
19
+ get options(): ICommandOptions;
20
+ }
@@ -0,0 +1,37 @@
1
+ import { program } from "commander";
2
+ import type { CliServiceGraph } from "../bootstrap";
3
+ type Commander = typeof program;
4
+ export declare const registrableCommands: Array<{
5
+ Command: CommandConstructor;
6
+ }>;
7
+ export declare function ICommand(): ClassDecorator;
8
+ export interface ICommandOptions {
9
+ cmd: string;
10
+ childCmd?: {
11
+ cmd: string;
12
+ desc: string;
13
+ };
14
+ rootAlias?: boolean;
15
+ desc: string;
16
+ options: Array<{
17
+ flags: string;
18
+ desc: string;
19
+ hideHelp?: boolean;
20
+ }>;
21
+ }
22
+ export interface ICommandContext {
23
+ options: Record<string, unknown>;
24
+ params: unknown[];
25
+ services: CliServiceGraph;
26
+ }
27
+ export type CommandConstructor = new (services: CliServiceGraph) => Command;
28
+ export declare abstract class Command {
29
+ readonly services: CliServiceGraph;
30
+ constructor(services: CliServiceGraph);
31
+ init(root?: Commander): void;
32
+ private configure;
33
+ protected isJson(ctx: ICommandContext): boolean;
34
+ abstract execute(ctx: ICommandContext): Promise<unknown> | unknown;
35
+ abstract get options(): ICommandOptions;
36
+ }
37
+ export {};
@@ -0,0 +1 @@
1
+ export declare function AuthGuard(): ClassDecorator;
@@ -0,0 +1 @@
1
+ export declare function CaptureError(): MethodDecorator;
@@ -0,0 +1,7 @@
1
+ export declare enum ParamTypes {
2
+ Credential = "Credential",
3
+ Log = "Log",
4
+ CmdContext = "CmdContext",
5
+ ArgsOptions = "ArgsOptions",
6
+ ArgsParams = "ArgsParams"
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from "./auth";
2
+ export * from "./captureError";
3
+ export * from "./injectParams";
4
+ export * from "./json-output";
5
+ export * from "./params";
@@ -0,0 +1 @@
1
+ export declare function InjectParams(): MethodDecorator;
@@ -0,0 +1,2 @@
1
+ export declare function JsonOutput(): ClassDecorator;
2
+ export declare function isJsonOutputEnabled(target: object): boolean;
@@ -0,0 +1,10 @@
1
+ import type { ICommandContext } from "../../core/base";
2
+ import type { ParamTypes } from "../constants";
3
+ export type ParamGetter = (context: ICommandContext) => unknown | Promise<unknown>;
4
+ export interface ParamBinding {
5
+ type: ParamTypes;
6
+ index: number;
7
+ getter: ParamGetter;
8
+ }
9
+ export declare function createParamDecorator(type: ParamTypes, getter: ParamGetter): () => ParameterDecorator;
10
+ export declare function getParamBindings(method: Function): readonly ParamBinding[];
@@ -0,0 +1,5 @@
1
+ export declare const Credential: () => ParameterDecorator;
2
+ export declare const Log: () => ParameterDecorator;
3
+ export declare const CmdContext: () => ParameterDecorator;
4
+ export declare const ArgsOptions: () => ParameterDecorator;
5
+ export declare const ArgsParams: () => ParameterDecorator;
@@ -0,0 +1,2 @@
1
+ export * from "./main";
2
+ export * from "./bootstrap";
@@ -0,0 +1,5 @@
1
+ import { program } from "commander";
2
+ import { type CliServiceGraph } from "./bootstrap";
3
+ import "./commands";
4
+ export declare function registerCommands(services?: CliServiceGraph, root?: typeof program): Promise<void>;
5
+ export { flushCliApm } from "@skillbuilder/minitool-core";
package/types/mcp.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { type MinitoolE2EMcpServerOptions } from "@skillbuilder/minitool-e2e";
3
+ import { type CliServiceGraph, type CliServiceOptions } from "./bootstrap";
4
+ export interface MinitoolMcpServerOptions extends MinitoolE2EMcpServerOptions {
5
+ services?: CliServiceGraph;
6
+ mcpUploadRoot?: string;
7
+ }
8
+ export declare function createMinitoolMcpServer(opts?: MinitoolMcpServerOptions): McpServer;
9
+ export declare function runMcpCommand(options?: CliServiceOptions): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { outputHelpInfo } from "@skillbuilder/minitool-core";
2
+ export declare const output: {
3
+ helpInfo: typeof outputHelpInfo;
4
+ };
package/types/ui.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export declare function printHeading(title: string, subtitle?: string): void;
2
+ export declare function printDetails(rows: Array<[string, string | undefined]>): void;
3
+ export declare function printHint(message: string): void;
4
+ export declare function printTable(headers: string[], rows: string[][]): void;
@@ -0,0 +1,16 @@
1
+ export interface LegacyAgentLookup {
2
+ getAgentInfoById(agentId: string): Promise<{
3
+ agentId: string;
4
+ agentName?: string;
5
+ description?: string;
6
+ } | null>;
7
+ getAgentList(page: {
8
+ pageNo: number;
9
+ pageSize: number;
10
+ }): Promise<Array<{
11
+ agentId: string;
12
+ agentName?: string;
13
+ description?: string;
14
+ }>>;
15
+ }
16
+ export declare function checkAndGuideAgentProject(workDir: string, services: LegacyAgentLookup): Promise<string | undefined>;
@@ -0,0 +1,17 @@
1
+ export interface TemplateEntry {
2
+ id: string;
3
+ name: string;
4
+ desc: string;
5
+ }
6
+ export interface TemplatesConfig {
7
+ templates: TemplateEntry[];
8
+ }
9
+ export declare const TEMPLATE_CATEGORIES: {
10
+ readonly "cloud-agents": string;
11
+ readonly "cloud-dev": string;
12
+ };
13
+ export declare function loadTemplatesConfig(category: keyof typeof TEMPLATE_CATEGORIES): TemplateEntry[];
14
+ export declare function resolveTemplatePath(category: keyof typeof TEMPLATE_CATEGORIES, templateId: string): string;
15
+ export declare function selectTemplate(category: keyof typeof TEMPLATE_CATEGORIES, options: {
16
+ template?: string;
17
+ }): Promise<string>;