@uibot/cli 0.0.0-stage → 0.2.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/dist/cli.d.ts +2 -0
- package/dist/cli.js +404 -0
- package/dist/command-manifest.d.ts +8 -0
- package/dist/commands/add.d.ts +28 -0
- package/dist/commands/design-md-sync.d.ts +12 -0
- package/dist/commands/doctor.d.ts +11 -0
- package/dist/commands/init.d.ts +72 -0
- package/dist/commands/link.d.ts +76 -0
- package/dist/commands/list.d.ts +14 -0
- package/dist/commands/publish.d.ts +41 -0
- package/dist/commands/regressions-reverify.d.ts +20 -0
- package/dist/commands/resource.d.ts +31 -0
- package/dist/commands/skills-lifecycle.d.ts +7 -0
- package/dist/commands/sync.d.ts +76 -0
- package/dist/constants.d.ts +8 -0
- package/dist/flags.d.ts +19 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +222 -0
- package/dist/resource-runtime.d.ts +4 -0
- package/dist/shells/app-shell-floating.yaml +42 -0
- package/dist/shells/app-shell-icon-rail.yaml +42 -0
- package/dist/shells/app-shell-inset.yaml +42 -0
- package/dist/shells/app-shell-settings.yaml +56 -0
- package/dist/shells/app-shell-sidebar.yaml +47 -0
- package/dist/shells/app-shell-workspace.yaml +54 -0
- package/dist/shells/shadcn-admin-shell.yaml +151 -0
- package/dist/templates/admin-dashboard.yaml +183 -0
- package/dist/templates/ai-chat.yaml +448 -0
- package/dist/templates/analytics-dashboard.yaml +152 -0
- package/dist/templates/auth.yaml +90 -0
- package/dist/templates/blog.yaml +111 -0
- package/dist/templates/crm.yaml +161 -0
- package/dist/templates/ecommerce.yaml +169 -0
- package/dist/templates/lms.yaml +459 -0
- package/dist/templates/portfolio.yaml +139 -0
- package/dist/templates/pricing.yaml +171 -0
- package/dist/templates/saas-landing.yaml +199 -0
- package/dist/templates/settings.yaml +151 -0
- package/dist/templates/shadcn-admin.yaml +4660 -0
- package/dist/templates/store.yaml +469 -0
- package/dist/templates/support-inbox.yaml +96 -0
- package/dist/templates/team-directory.yaml +98 -0
- package/package.json +44 -4
- package/README.md +0 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface UIBotCliCommandDescriptor {
|
|
2
|
+
name: string;
|
|
3
|
+
usage: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
group: "resources" | "artifacts" | "design" | "skills" | "project" | "diagnostics" | "linked";
|
|
6
|
+
}
|
|
7
|
+
export declare const UIBOT_CLI_COMMAND_MANIFEST: readonly UIBotCliCommandDescriptor[];
|
|
8
|
+
export declare function renderCliUsage(): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ArtifactRegistrySource } from "@uibot/registry";
|
|
2
|
+
export interface AddOptions {
|
|
3
|
+
/** Registry base URL. Defaults to {@link DEFAULT_REGISTRY}. */
|
|
4
|
+
registry?: string;
|
|
5
|
+
/** Workspace root the artifact files are written under. Defaults to `process.cwd()`. */
|
|
6
|
+
workspaceRoot: string;
|
|
7
|
+
/**
|
|
8
|
+
* Inject explicit registry sources (tests pass a `MemoryArtifactRegistrySource`
|
|
9
|
+
* to avoid network). When omitted a `RemoteArtifactRegistrySource` is built
|
|
10
|
+
* from `registry`.
|
|
11
|
+
*/
|
|
12
|
+
sources?: ArtifactRegistrySource[];
|
|
13
|
+
/** Output sink. Defaults to `console.log`. */
|
|
14
|
+
log?: (line: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface AddResult {
|
|
17
|
+
installed: {
|
|
18
|
+
name: string;
|
|
19
|
+
version: string;
|
|
20
|
+
files: number;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* `uibot add <name> [--registry url]` — resolve an artifact (and its
|
|
25
|
+
* `registryDependencies`, recursively) from the registry and write each into
|
|
26
|
+
* the workspace via `installArtifactToWorkspace`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function runAdd(name: string, opts: AddOptions): Promise<AddResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RemoteSyncResult } from "@uibot/design-md";
|
|
2
|
+
export interface DesignMdSyncOptions {
|
|
3
|
+
from: string;
|
|
4
|
+
cwd?: string;
|
|
5
|
+
mode?: "text" | "json";
|
|
6
|
+
license?: string;
|
|
7
|
+
dryRun?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function runDesignMdSync(options: DesignMdSyncOptions): Promise<{
|
|
10
|
+
code: number;
|
|
11
|
+
result: RemoteSyncResult;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ArtifactRegistryManifest } from "@uibot/contracts";
|
|
2
|
+
export interface DoctorOptions {
|
|
3
|
+
cwd?: string;
|
|
4
|
+
registry?: string;
|
|
5
|
+
mode?: "text" | "json";
|
|
6
|
+
/** Test DI */
|
|
7
|
+
fetchImpl?: typeof fetch;
|
|
8
|
+
lockfilePath?: string;
|
|
9
|
+
manifest?: ArtifactRegistryManifest;
|
|
10
|
+
}
|
|
11
|
+
export declare function runDoctor(options?: DoctorOptions): Promise<number>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `uibot init <dir>` — scaffold a minimal UIBot project (v2.28 SC-6).
|
|
3
|
+
* `uibot init --into <existing-app>` — L1 Embed recipe into an existing app.
|
|
4
|
+
*
|
|
5
|
+
* Greenfield layout:
|
|
6
|
+
* <dir>/
|
|
7
|
+
* package.json
|
|
8
|
+
* control-plane.ts
|
|
9
|
+
* templates/demo.yaml
|
|
10
|
+
* .uibot/design-md/*.design.md
|
|
11
|
+
* uibot.artifacts.lock.json
|
|
12
|
+
*
|
|
13
|
+
* Embed (--into) layout (additive only; never overwrites package.json):
|
|
14
|
+
* <into>/
|
|
15
|
+
* src/pages/home.uibot.yaml # starter Spec beside routes
|
|
16
|
+
* src/uibot-mount.example.tsx # compileSpec → adapter → renderer
|
|
17
|
+
* uibot.embed.md # App Runtime deps + next steps
|
|
18
|
+
*/
|
|
19
|
+
export interface InitOptions {
|
|
20
|
+
/** Target directory (created if missing). */
|
|
21
|
+
dir: string;
|
|
22
|
+
/** Optional template name from examples/templates (default: first available or embedded). */
|
|
23
|
+
template?: string;
|
|
24
|
+
log?: (line: string) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface InitResult {
|
|
27
|
+
dir: string;
|
|
28
|
+
files: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface InitIntoOptions {
|
|
31
|
+
/** Existing app root (must contain package.json). */
|
|
32
|
+
into: string;
|
|
33
|
+
/**
|
|
34
|
+
* Relative Spec path under `into` (POSIX). Default: `src/pages/home.uibot.yaml`.
|
|
35
|
+
* Must stay inside the app root — escapes fail closed.
|
|
36
|
+
*/
|
|
37
|
+
specPath?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Relative mount-snippet path under `into`. Default: `src/uibot-mount.example.tsx`.
|
|
40
|
+
*/
|
|
41
|
+
mountPath?: string;
|
|
42
|
+
/** Relative recipe doc path. Default: `uibot.embed.md`. */
|
|
43
|
+
recipePath?: string;
|
|
44
|
+
/** Overwrite existing scaffold files. */
|
|
45
|
+
force?: boolean;
|
|
46
|
+
mode?: "text" | "json";
|
|
47
|
+
log?: (line: string) => void;
|
|
48
|
+
error?: (line: string) => void;
|
|
49
|
+
}
|
|
50
|
+
export interface InitIntoResult {
|
|
51
|
+
code: number;
|
|
52
|
+
into?: string;
|
|
53
|
+
files?: string[];
|
|
54
|
+
dependencies?: string[];
|
|
55
|
+
error?: string;
|
|
56
|
+
}
|
|
57
|
+
export declare class InitIntoError extends Error {
|
|
58
|
+
constructor(message: string);
|
|
59
|
+
}
|
|
60
|
+
/** App Runtime packages for L1 Embed — never Studio / @uibot/application. */
|
|
61
|
+
export declare const APP_RUNTIME_DEPENDENCIES: readonly ["@uibot/contracts", "@uibot/compiler", "@uibot/runtime", "@uibot/renderer-react"];
|
|
62
|
+
export declare function runInit(options: InitOptions): Promise<InitResult>;
|
|
63
|
+
/**
|
|
64
|
+
* L1 Embed: scaffold Spec + mount recipe into an **existing** app.
|
|
65
|
+
* Fail closed when package.json is missing or relative paths escape the app root.
|
|
66
|
+
*/
|
|
67
|
+
export declare function runInitInto(options: InitIntoOptions): InitIntoResult;
|
|
68
|
+
/** Resolve and validate `--into` root (exists, is a directory). */
|
|
69
|
+
export declare function resolveIntoRoot(intoRaw: string): string;
|
|
70
|
+
export declare function assertPackageJson(into: string): void;
|
|
71
|
+
/** Reject absolute / empty / null-byte relative paths; ensure containment. */
|
|
72
|
+
export declare function assertContainedRelative(relativePath: string, baseDir: string, label: string): string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export declare const LINK_SCHEMA: "uibot.link.v1";
|
|
2
|
+
export declare const LINK_RELATIVE_PATH: string;
|
|
3
|
+
export declare const DEFAULT_LOCK_RELATIVE_PATH: string;
|
|
4
|
+
export interface UibotLinkConfig {
|
|
5
|
+
schema: typeof LINK_SCHEMA;
|
|
6
|
+
/** Absolute consumer workspace root recorded at link time. */
|
|
7
|
+
consumerRoot: string;
|
|
8
|
+
/** Spec directory relative to consumerRoot (contained). */
|
|
9
|
+
specDir: string;
|
|
10
|
+
/**
|
|
11
|
+
* Local studio / control-plane Spec directory for local sync.
|
|
12
|
+
* Absolute path preferred; relative paths resolve against consumerRoot.
|
|
13
|
+
*/
|
|
14
|
+
sourceDir?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Hosted control-plane base URL (no trailing path required), e.g. `https://uibot.example`.
|
|
17
|
+
* Spec sync uses `{controlPlaneUrl}/api/studio/spec-sync`. Never store secrets here.
|
|
18
|
+
*/
|
|
19
|
+
controlPlaneUrl?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional project namespace on the control-plane (`?projectId=`).
|
|
22
|
+
* Defaults to `default` when talking to a remote CP.
|
|
23
|
+
*/
|
|
24
|
+
projectId?: string;
|
|
25
|
+
/** Digest pin (`sha256:<hex>`) or null before first sync. */
|
|
26
|
+
digest: string | null;
|
|
27
|
+
/** Lock file path relative to consumerRoot (contained). */
|
|
28
|
+
lockPath: string;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
updatedAt?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface LinkOptions {
|
|
33
|
+
cwd?: string;
|
|
34
|
+
/** Relative Spec directory under the consumer root. */
|
|
35
|
+
specDir: string;
|
|
36
|
+
/** Optional local source (studio/CP) Spec directory. */
|
|
37
|
+
sourceDir?: string;
|
|
38
|
+
/** Optional hosted control-plane base URL (no secrets). */
|
|
39
|
+
controlPlaneUrl?: string;
|
|
40
|
+
/** Optional remote project id for Spec sync. */
|
|
41
|
+
projectId?: string;
|
|
42
|
+
/** Relative lock path under consumer root. Defaults to `.uibot/spec.lock`. */
|
|
43
|
+
lockPath?: string;
|
|
44
|
+
/** Overwrite an existing link.json. */
|
|
45
|
+
force?: boolean;
|
|
46
|
+
mode?: "text" | "json";
|
|
47
|
+
log?: (line: string) => void;
|
|
48
|
+
error?: (line: string) => void;
|
|
49
|
+
}
|
|
50
|
+
export declare class LinkPathError extends Error {
|
|
51
|
+
constructor(message: string);
|
|
52
|
+
}
|
|
53
|
+
/** Reject null bytes / empty; ensure relative path stays inside baseDir. */
|
|
54
|
+
export declare function assertRelativeContained(relativePath: string, baseDir: string, label: string): string;
|
|
55
|
+
/** Resolve an optional sourceDir; absolute allowed (studio may live outside consumer). */
|
|
56
|
+
export declare function resolveSourceDir(sourceDir: string, consumerRoot: string): string;
|
|
57
|
+
/** Normalize / validate a control-plane base URL (http/https only; no secrets). */
|
|
58
|
+
export declare function normalizeControlPlaneUrl(raw: string): string;
|
|
59
|
+
/** Validate optional projectId (same rules as CP Spec sync). */
|
|
60
|
+
export declare function normalizeLinkProjectId(raw: string): string;
|
|
61
|
+
export declare function linkConfigPath(consumerRoot: string): string;
|
|
62
|
+
export declare function readLinkConfig(consumerRoot: string): UibotLinkConfig;
|
|
63
|
+
export declare function writeLinkConfig(config: UibotLinkConfig): string;
|
|
64
|
+
/**
|
|
65
|
+
* Register the consumer workspace for L2 Linked Spec sync.
|
|
66
|
+
*/
|
|
67
|
+
export declare function runLink(options: LinkOptions): {
|
|
68
|
+
code: number;
|
|
69
|
+
config?: UibotLinkConfig;
|
|
70
|
+
};
|
|
71
|
+
/** Resolve consumer Spec absolute path from a link config (containment checked). */
|
|
72
|
+
export declare function resolveConsumerSpecDir(config: UibotLinkConfig): string;
|
|
73
|
+
/** Resolve lock absolute path from a link config (containment checked). */
|
|
74
|
+
export declare function resolveConsumerLockPath(config: UibotLinkConfig): string;
|
|
75
|
+
/** Relative path helper that always uses `/` separators for lock digests. */
|
|
76
|
+
export declare function toPosixRelative(from: string, to: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ArtifactRegistryManifest } from "@uibot/contracts";
|
|
2
|
+
export interface ListOptions {
|
|
3
|
+
/** Registry base URL or direct `registry.json` URL. Defaults to {@link DEFAULT_REGISTRY}. */
|
|
4
|
+
registry?: string;
|
|
5
|
+
/** Override the fetcher (tests inject an in-memory manifest, avoiding network). */
|
|
6
|
+
fetchManifest?: (registry: string) => Promise<ArtifactRegistryManifest>;
|
|
7
|
+
/** Output sink. Defaults to `console.log`. */
|
|
8
|
+
log?: (line: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* `uibot list [--registry url]` — fetch the manifest and print one line per
|
|
12
|
+
* artifact: `<name>\t<kind>\t<title>`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function runList(opts?: ListOptions): Promise<ArtifactRegistryManifest>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type BlockSource, type TemplateSource } from "@uibot/registry";
|
|
2
|
+
import type { ArtifactRegistryManifest, CatalogEntry } from "@uibot/contracts";
|
|
3
|
+
export interface PublishOptions {
|
|
4
|
+
/** Output directory. Defaults to `dist/registry`. */
|
|
5
|
+
out: string;
|
|
6
|
+
/** Manifest name. Defaults to `"local"`. */
|
|
7
|
+
manifestName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Block sources to publish. When omitted, the caller must provide
|
|
10
|
+
* {@link blockFileMap} + {@link catalog} + {@link sourceDir} so the command
|
|
11
|
+
* can `collectBlockSources` itself.
|
|
12
|
+
*/
|
|
13
|
+
sources?: BlockSource[];
|
|
14
|
+
/** Optional template sources (v2.28). */
|
|
15
|
+
templates?: TemplateSource[];
|
|
16
|
+
/** Block name → source file path, relative to {@link sourceDir}. */
|
|
17
|
+
blockFileMap?: Record<string, string>;
|
|
18
|
+
/** Block name → catalog metadata. */
|
|
19
|
+
catalog?: Record<string, CatalogEntry>;
|
|
20
|
+
/** Absolute directory the file-map paths resolve against. */
|
|
21
|
+
sourceDir?: string;
|
|
22
|
+
/** File reader override (tests inject in-memory fixtures). */
|
|
23
|
+
readFile?: (absolutePath: string) => string;
|
|
24
|
+
/** Directory writer override (tests capture output without touching disk). */
|
|
25
|
+
writeArtifacts?: (out: string, manifest: ArtifactRegistryManifest) => void;
|
|
26
|
+
/** Output sink. Defaults to `console.log`. */
|
|
27
|
+
log?: (line: string) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface PublishResult {
|
|
30
|
+
manifest: ArtifactRegistryManifest;
|
|
31
|
+
writtenFiles: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `uibot publish [--out dir]` — emit a static, deployable registry:
|
|
35
|
+
* - `<out>/registry.json` — the full {@link ArtifactRegistryManifest}
|
|
36
|
+
* - `<out>/artifacts/<name>.json` — one item per block
|
|
37
|
+
*
|
|
38
|
+
* Block sources are gathered via `collectBlockSources` (shared with the
|
|
39
|
+
* shadcn emitter), then run through `buildUiBotRegistryManifest`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function runPublish(opts: PublishOptions): Promise<PublishResult>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ReverifyOptions {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
skillId?: string;
|
|
4
|
+
mode?: "text" | "json";
|
|
5
|
+
}
|
|
6
|
+
export interface ReverifyResult {
|
|
7
|
+
ok: boolean;
|
|
8
|
+
checked: number;
|
|
9
|
+
reactivated: number;
|
|
10
|
+
details: Array<{
|
|
11
|
+
skillId: string;
|
|
12
|
+
id: string;
|
|
13
|
+
action: "pass" | "reactivated";
|
|
14
|
+
reason?: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export declare function runRegressionsReverify(options?: ReverifyOptions): Promise<{
|
|
18
|
+
code: number;
|
|
19
|
+
result: ReverifyResult;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ResourceQueryError, type ResourceQueryOperationName, type ResourceQueryService } from "@uibot/registry";
|
|
2
|
+
export declare const UIBOT_RESOURCE_ENVELOPE_SCHEMA_VERSION: "uibot.resource.envelope.v1";
|
|
3
|
+
export declare const RESOURCE_CLI_ERROR_CODES: readonly ["resource-cli-invalid-mode", "resource-cli-invalid-argument", "resource-cli-internal-error"];
|
|
4
|
+
export type ResourceCliErrorCode = (typeof RESOURCE_CLI_ERROR_CODES)[number];
|
|
5
|
+
export type UIBotResourceEnvelopeErrorCode = ResourceQueryError["code"] | ResourceCliErrorCode;
|
|
6
|
+
export interface UIBotResourceEnvelopeError {
|
|
7
|
+
code: UIBotResourceEnvelopeErrorCode;
|
|
8
|
+
message: string;
|
|
9
|
+
detail: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UIBotResourceEnvelopeMeta {
|
|
12
|
+
dense: boolean;
|
|
13
|
+
encoding: "full" | "dense-v1";
|
|
14
|
+
resourceIndexSchemaVersion: string;
|
|
15
|
+
}
|
|
16
|
+
export interface UIBotResourceEnvelope<T> {
|
|
17
|
+
schemaVersion: typeof UIBOT_RESOURCE_ENVELOPE_SCHEMA_VERSION;
|
|
18
|
+
requestId: string;
|
|
19
|
+
command: ResourceQueryOperationName;
|
|
20
|
+
ok: boolean;
|
|
21
|
+
data?: T;
|
|
22
|
+
error?: UIBotResourceEnvelopeError;
|
|
23
|
+
meta: UIBotResourceEnvelopeMeta;
|
|
24
|
+
}
|
|
25
|
+
export interface RunResourceCommandOptions {
|
|
26
|
+
queryService: ResourceQueryService;
|
|
27
|
+
requestId?: string;
|
|
28
|
+
log?: (line: string) => void;
|
|
29
|
+
errorLog?: (line: string) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function runResourceCommand(command: ResourceQueryOperationName, argv: string[], options: RunResourceCommandOptions): Promise<number>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface LifecycleOptions {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
mode?: "text" | "json";
|
|
4
|
+
}
|
|
5
|
+
export declare function runSkillsPromote(id: string, options?: LifecycleOptions): Promise<number>;
|
|
6
|
+
export declare function runSkillsRollback(id: string, options?: LifecycleOptions): Promise<number>;
|
|
7
|
+
export declare function runProjectExport(outDir: string, options?: LifecycleOptions): Promise<number>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export declare const SPEC_LOCK_SCHEMA: "uibot.spec.lock.v1";
|
|
2
|
+
export declare const SPEC_SYNC_HTTP_SCHEMA: "uibot.spec.sync.v1";
|
|
3
|
+
export declare const SPEC_SYNC_HTTP_PATH = "/api/studio/spec-sync";
|
|
4
|
+
export interface SpecLockFile {
|
|
5
|
+
schema: typeof SPEC_LOCK_SCHEMA;
|
|
6
|
+
digest: string;
|
|
7
|
+
files: {
|
|
8
|
+
path: string;
|
|
9
|
+
sha256: string;
|
|
10
|
+
}[];
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SyncOptions {
|
|
14
|
+
cwd?: string;
|
|
15
|
+
/** Override source directory for this invocation (also recorded into link.json). */
|
|
16
|
+
from?: string;
|
|
17
|
+
/** Alias used by pull when overriding destination (studio side). */
|
|
18
|
+
to?: string;
|
|
19
|
+
/** One-shot control-plane base URL override (not required if link.json has it). */
|
|
20
|
+
controlPlaneUrl?: string;
|
|
21
|
+
/** One-shot projectId override. */
|
|
22
|
+
projectId?: string;
|
|
23
|
+
/** Optional fetch impl (tests inject a mock). */
|
|
24
|
+
fetchImpl?: typeof fetch;
|
|
25
|
+
/** Optional env map (tests inject Bearer without mutating process.env). */
|
|
26
|
+
env?: NodeJS.ProcessEnv;
|
|
27
|
+
mode?: "text" | "json";
|
|
28
|
+
log?: (line: string) => void;
|
|
29
|
+
error?: (line: string) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface SpecSyncRemoteFile {
|
|
32
|
+
path: string;
|
|
33
|
+
content: string;
|
|
34
|
+
sha256?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface SpecSyncRemoteTree {
|
|
37
|
+
schema: typeof SPEC_SYNC_HTTP_SCHEMA;
|
|
38
|
+
projectId: string;
|
|
39
|
+
digest: string;
|
|
40
|
+
files: SpecSyncRemoteFile[];
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
}
|
|
43
|
+
/** Deterministic digest over relative YAML paths + contents under a Spec dir. */
|
|
44
|
+
export declare function computeSpecDigest(specDirAbs: string): {
|
|
45
|
+
digest: string;
|
|
46
|
+
files: {
|
|
47
|
+
path: string;
|
|
48
|
+
sha256: string;
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
export declare function writeSpecLock(lockPathAbs: string, lock: SpecLockFile): void;
|
|
52
|
+
/**
|
|
53
|
+
* Copy YAML Spec files from srcRoot → destRoot, preserving relative paths.
|
|
54
|
+
* Fail closed if any relative path would escape destRoot.
|
|
55
|
+
*/
|
|
56
|
+
export declare function copySpecYamlTree(srcRoot: string, destRoot: string): {
|
|
57
|
+
copied: string[];
|
|
58
|
+
removedNone: true;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Write a remote Spec file list into destRoot (replace YAML tree).
|
|
62
|
+
* Fail closed on path escape / non-YAML.
|
|
63
|
+
*/
|
|
64
|
+
export declare function writeSpecYamlTreeFromRemote(files: SpecSyncRemoteFile[], destRoot: string): {
|
|
65
|
+
copied: string[];
|
|
66
|
+
};
|
|
67
|
+
export declare function resolveSyncBearerToken(env?: NodeJS.ProcessEnv): string | undefined;
|
|
68
|
+
export declare function buildSpecSyncUrl(controlPlaneUrl: string, projectId?: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* push: studio/source (local or remote CP) → consumer specDir (+ lock digest pin).
|
|
71
|
+
*/
|
|
72
|
+
export declare function runSyncPush(options?: SyncOptions): Promise<number>;
|
|
73
|
+
/**
|
|
74
|
+
* pull: consumer specDir → studio/source (local or remote CP).
|
|
75
|
+
*/
|
|
76
|
+
export declare function runSyncPull(options?: SyncOptions): Promise<number>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default registry endpoint used when `--registry` is omitted.
|
|
3
|
+
*
|
|
4
|
+
* Points at the control-plane registry route (`/api/registry`) on localhost so
|
|
5
|
+
* offline/dev use works out of the box against `example:control-plane`. Pass
|
|
6
|
+
* `--registry https://your-host/api/registry` for a remote registry.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_REGISTRY = "http://127.0.0.1:3202/api/registry";
|
package/dist/flags.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal zero-dependency flag parser.
|
|
3
|
+
*
|
|
4
|
+
* Supports:
|
|
5
|
+
* - positional args → `parsed._`
|
|
6
|
+
* - `--key value` → `parsed.key = "value"`
|
|
7
|
+
* - `--key=value` → `parsed.key = "value"`
|
|
8
|
+
* - `--flag` (boolean) → `parsed.flag = true` (when no value follows)
|
|
9
|
+
*
|
|
10
|
+
* Everything is intentionally tiny — the CLI takes no third-party arg library.
|
|
11
|
+
*/
|
|
12
|
+
export interface ParsedFlags {
|
|
13
|
+
_: string[];
|
|
14
|
+
[key: string]: string | boolean | string[];
|
|
15
|
+
}
|
|
16
|
+
/** A flag is boolean only if it is the last token or is followed by another `--flag`. */
|
|
17
|
+
export declare function parseFlags(argv: string[]): ParsedFlags;
|
|
18
|
+
/** Read a string flag, returning `undefined` for booleans / missing. */
|
|
19
|
+
export declare function stringFlag(flags: ParsedFlags, key: string): string | undefined;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@uibot/cli` — public programmatic surface.
|
|
3
|
+
*
|
|
4
|
+
* The executable lives in `cli.ts` (bin: `uibot`); this module re-exports the
|
|
5
|
+
* command runners so they can be embedded/tested without spawning a process.
|
|
6
|
+
* No package imports `@uibot/cli`; it is a leaf executable.
|
|
7
|
+
*/
|
|
8
|
+
export { runAdd, type AddOptions, type AddResult } from "./commands/add.js";
|
|
9
|
+
export { runList, type ListOptions } from "./commands/list.js";
|
|
10
|
+
export { runPublish, type PublishOptions, type PublishResult } from "./commands/publish.js";
|
|
11
|
+
export { parseFlags, stringFlag, type ParsedFlags } from "./flags.js";
|
|
12
|
+
export { DEFAULT_REGISTRY } from "./constants.js";
|
|
13
|
+
export { UIBOT_CLI_COMMAND_MANIFEST, renderCliUsage, type UIBotCliCommandDescriptor, } from "./command-manifest.js";
|
|
14
|
+
export { UIBOT_RESOURCE_ENVELOPE_SCHEMA_VERSION, RESOURCE_CLI_ERROR_CODES, runResourceCommand, type UIBotResourceEnvelope, type UIBotResourceEnvelopeError, type UIBotResourceEnvelopeMeta, type RunResourceCommandOptions, } from "./commands/resource.js";
|
|
15
|
+
export { loadBuiltInResourceQueryService } from "./resource-runtime.js";
|