@remixmate/cli 0.9.71 → 0.9.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +45 -21
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/argv.js +1 -51
- package/dist/auth/auth-lock.js +1 -100
- package/dist/auth/auto-login.js +7 -75
- package/dist/auth/commands.js +40 -290
- package/dist/auth/credential-store.js +1 -143
- package/dist/auth/device-flow-runner.js +13 -110
- package/dist/auth/device-flow.js +1 -132
- package/dist/auth/ensure.js +1 -62
- package/dist/auth/environment.js +1 -69
- package/dist/auth/pending-store.js +1 -45
- package/dist/auth/resolve.js +1 -44
- package/dist/billing.js +3 -76
- package/dist/capabilities.js +1 -75
- package/dist/cli.js +39 -211
- package/dist/diagnostics.js +2 -70
- package/dist/doctor.js +9 -188
- package/dist/errors.js +1 -33
- package/dist/exec.js +4 -47
- package/dist/handlers/gen-digital-human.js +33 -264
- package/dist/handlers/gen-image.js +9 -113
- package/dist/handlers/gen-post.js +15 -188
- package/dist/handlers/gen-video.js +7 -185
- package/dist/handlers/gen-voice.js +19 -133
- package/dist/handlers/index.js +1 -20
- package/dist/handlers/shared.js +1 -66
- package/dist/handlers/template-init.js +1 -21
- package/dist/http.js +3 -155
- package/dist/index.js +1 -8
- package/dist/install.js +40 -448
- package/dist/manifest.json +53 -13
- package/dist/progress.js +2 -15
- package/dist/project/commands.js +34 -156
- package/dist/project/host.js +1 -151
- package/dist/project/resolve.js +1 -65
- package/dist/project/store.js +2 -97
- package/dist/project/take.js +1 -106
- package/dist/project/trace.js +5 -278
- package/dist/registry.js +3 -70
- package/dist/runner.js +7 -225
- package/dist/skill-schema.js +1 -194
- package/dist/template/args.js +1 -69
- package/dist/template/check.js +2 -30
- package/dist/template/commands.js +34 -163
- package/dist/template/constants.js +1 -46
- package/dist/template/init.js +5 -133
- package/dist/template/list.js +1 -46
- package/dist/template/preview.js +7 -318
- package/dist/template/proc.js +1 -43
- package/dist/template/project.js +6 -161
- package/dist/template/publish.js +5 -185
- package/dist/template/render-client.js +2 -79
- package/dist/template/upgrade.js +4 -123
- package/dist/text.js +1 -15
- package/package.json +2 -35
- package/skills/doc-parse/scripts/extract_via_render.py +32 -32
- package/skills/export-jianying/scripts/gen_jianying_draft.py +188 -188
- package/skills/gen-post/SKILL.md +23 -13
- package/skills/gen-post/skill.json +9 -10
- package/skills/gen-script/SKILL.md +23 -1
- package/skills/gen-script/scripts/gen_script.py +644 -551
- package/skills/gen-script/skill.json +12 -0
- package/skills/gen-script/version.json +1 -1
- package/skills/prepare-video-assets/scripts/prepare_video_assets.py +21 -21
- package/skills/render-video/scripts/_chrome_vendor.py +17 -17
- package/skills/render-video/scripts/_digital_human_segments.py +34 -34
- package/skills/render-video/scripts/_video_probe.py +33 -33
- package/skills/render-video/scripts/_vod_polling.py +13 -13
- package/skills/render-video/scripts/remote_renderer_client.py +42 -42
- package/skills/render-video/scripts/render_video.py +639 -639
- package/skills/render-video/scripts/required_props.py +37 -37
- package/skills/render-video/scripts/upload_video.py +35 -35
- package/skills/render-video/version.json +1 -1
- package/skills/template-registry/SKILL.md +16 -0
- package/skills/template-registry/scripts/countdown_spec.py +92 -92
- package/skills/template-registry/scripts/doc_extract.py +40 -40
- package/skills/template-registry/scripts/list_templates.py +303 -191
- package/skills/template-registry/scripts/log_diagnostics.py +1 -1
- package/skills/template-registry/scripts/match_template.py +87 -87
- package/skills/template-registry/scripts/payload_hydrator.py +89 -89
- package/skills/template-registry/scripts/registry_loader.py +159 -159
- package/skills/template-registry/scripts/render_job_client.py +75 -75
- package/skills/template-registry/scripts/showcase_loader.py +44 -44
- package/skills/template-registry/skill.json +4 -1
- package/skills/template-registry/version.json +1 -1
- package/skills/template-registry/video_dsl/runtime/__init__.py +8 -8
- package/skills/template-registry/video_dsl/runtime/dsl_validator.py +329 -329
- package/skills/template-registry/video_dsl/runtime/narration_budget.py +36 -36
- package/skills/template-registry/video_dsl/runtime/payload_contract.py +7 -7
- package/skills/template-registry/video_dsl/runtime/prompt_enhancer.py +98 -98
- package/skills/template-registry/video_dsl/runtime/timeline_compiler.py +127 -127
- package/skills/template-registry/video_dsl/schema/video-dsl-v1alpha1.json +14 -1
- package/skills/video-parser/scripts/analyze_video.py +173 -173
- package/skills/video-parser/scripts/deconstruct_video.py +91 -91
- package/skills/video-parser/scripts/parse_via_render.py +21 -21
- package/skills/web-screenshot/scripts/_media_screenshot/__init__.py +4 -4
- package/skills/web-screenshot/scripts/_media_screenshot/bootstrap.py +7 -7
- package/skills/web-screenshot/scripts/_media_screenshot/browser.py +4 -4
- package/skills/web-screenshot/scripts/_media_screenshot/cli_args.py +4 -4
- package/skills/web-screenshot/scripts/_media_screenshot/js_loader.py +2 -2
- package/skills/web-screenshot/scripts/_media_screenshot/overlay.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/reader.py +40 -40
- package/skills/web-screenshot/scripts/_media_screenshot/recording.py +11 -11
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/__init__.py +8 -8
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/arrow.py +2 -2
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/caption.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/click.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/code_lines.py +5 -5
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/focus.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/highlight.py +3 -3
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/hover.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/redact.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/scroll.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/sequence.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/title_card.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/type.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/wait.py +1 -1
- package/skills/web-screenshot/scripts/_media_screenshot/scenes/zoom.py +2 -2
- package/skills/web-screenshot/scripts/_media_screenshot/screenshot.py +15 -15
- package/skills/web-screenshot/scripts/_media_screenshot/storyboard.py +2 -2
- package/skills/web-screenshot/scripts/_media_screenshot/template.py +11 -11
- package/skills/web-screenshot/scripts/_media_screenshot/trim.py +10 -10
- package/skills/web-screenshot/scripts/_media_screenshot/urlguard.py +22 -22
- package/skills/web-screenshot/scripts/_media_upload.py +33 -33
- package/skills/web-screenshot/scripts/read_page.py +15 -15
- package/skills/web-screenshot/scripts/record.py +26 -26
- package/skills/web-screenshot/scripts/screenshot.py +5 -5
- package/dist/argv.d.ts +0 -15
- package/dist/auth/auth-lock.d.ts +0 -26
- package/dist/auth/auto-login.d.ts +0 -20
- package/dist/auth/commands.d.ts +0 -8
- package/dist/auth/credential-store.d.ts +0 -60
- package/dist/auth/device-flow-runner.d.ts +0 -58
- package/dist/auth/device-flow.d.ts +0 -52
- package/dist/auth/ensure.d.ts +0 -55
- package/dist/auth/environment.d.ts +0 -38
- package/dist/auth/pending-store.d.ts +0 -33
- package/dist/auth/resolve.d.ts +0 -30
- package/dist/billing.d.ts +0 -44
- package/dist/capabilities.d.ts +0 -63
- package/dist/cli.d.ts +0 -13
- package/dist/diagnostics.d.ts +0 -24
- package/dist/doctor.d.ts +0 -22
- package/dist/errors.d.ts +0 -29
- package/dist/exec.d.ts +0 -18
- package/dist/handlers/gen-digital-human.d.ts +0 -17
- package/dist/handlers/gen-image.d.ts +0 -20
- package/dist/handlers/gen-post.d.ts +0 -21
- package/dist/handlers/gen-video.d.ts +0 -19
- package/dist/handlers/gen-voice.d.ts +0 -26
- package/dist/handlers/index.d.ts +0 -20
- package/dist/handlers/shared.d.ts +0 -26
- package/dist/handlers/template-init.d.ts +0 -10
- package/dist/http.d.ts +0 -72
- package/dist/index.d.ts +0 -9
- package/dist/install.d.ts +0 -71
- package/dist/progress.d.ts +0 -23
- package/dist/project/commands.d.ts +0 -19
- package/dist/project/host.d.ts +0 -91
- package/dist/project/resolve.d.ts +0 -43
- package/dist/project/store.d.ts +0 -31
- package/dist/project/take.d.ts +0 -50
- package/dist/project/trace.d.ts +0 -98
- package/dist/registry.d.ts +0 -30
- package/dist/runner.d.ts +0 -39
- package/dist/skill-schema.d.ts +0 -138
- package/dist/template/args.d.ts +0 -25
- package/dist/template/check.d.ts +0 -23
- package/dist/template/commands.d.ts +0 -25
- package/dist/template/constants.d.ts +0 -39
- package/dist/template/init.d.ts +0 -28
- package/dist/template/list.d.ts +0 -23
- package/dist/template/preview.d.ts +0 -60
- package/dist/template/proc.d.ts +0 -26
- package/dist/template/project.d.ts +0 -47
- package/dist/template/publish.d.ts +0 -43
- package/dist/template/render-client.d.ts +0 -39
- package/dist/template/upgrade.d.ts +0 -44
- package/dist/text.d.ts +0 -8
package/dist/progress.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress reporting — emits __progress__ JSON lines that ab-agent's
|
|
3
|
-
* executor parses (see apps/ab-agent/src/skills/executor.ts).
|
|
4
|
-
*
|
|
5
|
-
* Always writes to stdout because the consumer reads stdout line-by-line.
|
|
6
|
-
* Each event is a single JSON object on its own line, with the marker
|
|
7
|
-
* field `__progress__: true` so non-progress stdout content is ignored.
|
|
8
|
-
*
|
|
9
|
-
* The consumer flattens the entire parsed JSON into `extra`, so any
|
|
10
|
-
* additional context (model id, generationId, ...) can be passed as
|
|
11
|
-
* top-level keys and will reach the SSE client unchanged.
|
|
12
|
-
*/
|
|
13
|
-
export interface ProgressEvent {
|
|
14
|
-
/** Pipeline phase, e.g. `gen-image:request`. */
|
|
15
|
-
phase?: string;
|
|
16
|
-
/** 0..1 progress fraction. */
|
|
17
|
-
progress?: number;
|
|
18
|
-
etaSeconds?: number | null;
|
|
19
|
-
elapsedSeconds?: number | null;
|
|
20
|
-
/** Free-form context — flattened into the parsed JSON line. */
|
|
21
|
-
[key: string]: unknown;
|
|
22
|
-
}
|
|
23
|
-
export declare function emitProgress(ev: ProgressEvent): void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `remixmate project ...` and `remixmate host probe`.
|
|
3
|
-
*
|
|
4
|
-
* `project use` is the low-friction way to keep CLI output out of 「未分类」:
|
|
5
|
-
* say it once per repo (or once globally) instead of passing --project on every
|
|
6
|
-
* call — an agent won't pass a flag it wasn't told about.
|
|
7
|
-
*
|
|
8
|
-
* `host probe` exists so onboarding an unknown agent shell is a minute's work
|
|
9
|
-
* rather than a reverse-engineering session: run it inside the new host, read
|
|
10
|
-
* off the session variable, add one row to HOST_PROVIDERS.
|
|
11
|
-
*/
|
|
12
|
-
export declare const PROJECT_VERB = "project";
|
|
13
|
-
export declare const HOST_VERB = "host";
|
|
14
|
-
export declare function runProjectCommand(argv: string[]): Promise<number>;
|
|
15
|
-
/**
|
|
16
|
-
* Report what the CLI can see about its host. Prints variable NAMES only —
|
|
17
|
-
* an environment dump is a routine way to leak tokens into a chat transcript.
|
|
18
|
-
*/
|
|
19
|
-
export declare function runHostCommand(argv: string[]): Promise<number>;
|
package/dist/project/host.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host detection — which agent shell is this CLI running inside, and what is
|
|
3
|
-
* its conversation id?
|
|
4
|
-
*
|
|
5
|
-
* The id is used as the *grouping key* for takes: every render fired from the
|
|
6
|
-
* same host conversation lands in one VideoProject as successive takes. The
|
|
7
|
-
* creative loop ("generate → watch → shorten the intro → re-render") spans
|
|
8
|
-
* multiple skill invocations and multiple render jobs, so the conversation —
|
|
9
|
-
* not the render job — is its natural boundary.
|
|
10
|
-
*
|
|
11
|
-
* Everything here reads the **child process environment only**. We deliberately
|
|
12
|
-
* do not speak any host's private IPC (Codex exposes its thread id through an
|
|
13
|
-
* App Server JSON-RPC channel, and finding "the current thread" there means
|
|
14
|
-
* matching on cwd + status + recency — a heuristic, not an identity lookup,
|
|
15
|
-
* which would silently group takes wrong). A host that hands us nothing simply
|
|
16
|
-
* degrades one rung; see resolveTakeKey().
|
|
17
|
-
*
|
|
18
|
-
* See docs/product/cli/cli-project-binding-design.md §5.1 and appendix A.
|
|
19
|
-
*/
|
|
20
|
-
export interface HostSessionProvider {
|
|
21
|
-
/** Host identifier; becomes the namespace of the grouping key. */
|
|
22
|
-
host: string;
|
|
23
|
-
/** First provider whose detect() passes wins — ORDER MATTERS, see below. */
|
|
24
|
-
detect: (env: NodeJS.ProcessEnv) => boolean;
|
|
25
|
-
/** Session-level id candidates, most-preferred first. */
|
|
26
|
-
sessionVars: string[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Adding a host is a data-only change: append a row, touch nothing else.
|
|
30
|
-
* Run `remixmate host probe` inside the new host to discover its variable names.
|
|
31
|
-
*
|
|
32
|
-
* ⚠️ ORDER IS LOAD-BEARING. CodeBuddy also sets `CLAUDE_SESSION_ID` (same value
|
|
33
|
-
* as its own id), while real Claude Code uses the longer `CLAUDE_CODE_*` prefix.
|
|
34
|
-
* Detecting Claude Code first — or matching on a bare `CLAUDE_` prefix — would
|
|
35
|
-
* mislabel every CodeBuddy session.
|
|
36
|
-
*
|
|
37
|
-
* ⚠️ Prefer the ROOT session over a child/sub-agent one. Claude Code exposes
|
|
38
|
-
* both (`CLAUDE_CODE_HOST_SESSION_ID` alongside a per-subagent
|
|
39
|
-
* `CLAUDE_CODE_SESSION_ID`); grouping must follow the root so a render fired
|
|
40
|
-
* from a subagent still joins the main take.
|
|
41
|
-
*/
|
|
42
|
-
export declare const HOST_PROVIDERS: HostSessionProvider[];
|
|
43
|
-
export interface HostSession {
|
|
44
|
-
host: string;
|
|
45
|
-
sessionId: string;
|
|
46
|
-
}
|
|
47
|
-
/** Identify the host and its root session id, or null when unrecognised. */
|
|
48
|
-
export declare function detectHostSession(env?: NodeJS.ProcessEnv): HostSession | null;
|
|
49
|
-
/**
|
|
50
|
-
* Normalise a declared host label.
|
|
51
|
-
*
|
|
52
|
-
* `video_project.client_host` is `varchar(32)`, and the value is rendered as a
|
|
53
|
-
* badge, so free-form input gets slugified rather than trusted: lowercase,
|
|
54
|
-
* non-alphanumerics collapsed to `-`, capped at 32. Anything that normalises to
|
|
55
|
-
* empty is treated as absent — an unusable label should degrade to "no badge",
|
|
56
|
-
* never to a garbage one.
|
|
57
|
-
*/
|
|
58
|
-
export declare function normaliseHostLabel(raw: string | undefined): string;
|
|
59
|
-
/**
|
|
60
|
-
* Host label for provenance, even when no session id could be read.
|
|
61
|
-
*
|
|
62
|
-
* Declaration wins over detection: the declaring party knows, the table guesses.
|
|
63
|
-
*/
|
|
64
|
-
export declare function detectHostLabel(env?: NodeJS.ProcessEnv): string;
|
|
65
|
-
export interface TakeKey {
|
|
66
|
-
/** `<host>:<sessionId>`, or '' when nothing groups this invocation. */
|
|
67
|
-
key: string;
|
|
68
|
-
host: string;
|
|
69
|
-
/** Which rung produced the key — surfaced by `doctor` / `host probe`. */
|
|
70
|
-
source: 'host' | 'env-override' | 'render-job' | 'none';
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Resolve the take grouping key.
|
|
74
|
-
*
|
|
75
|
-
* 1. a recognised host's root session id → "<host>:<id>"
|
|
76
|
-
* 2. REMIXMATE_TAKE_KEY → "custom:<value>"
|
|
77
|
-
* 3. the render job id → "job:<id>"
|
|
78
|
-
*
|
|
79
|
-
* Rung 2 is the escape hatch that matters: an unsupported host (or a user on
|
|
80
|
-
* Codex) can export one variable and get correct grouping without waiting for a
|
|
81
|
-
* CLI release. Rung 3 keeps the feature working everywhere, at the cost of
|
|
82
|
-
* splitting one video's iterations across takes — acceptable as a floor, not as
|
|
83
|
-
* a default.
|
|
84
|
-
*/
|
|
85
|
-
export declare function resolveTakeKey(jobId: number | undefined, env?: NodeJS.ProcessEnv): TakeKey;
|
|
86
|
-
/**
|
|
87
|
-
* Environment variable names that look like a session/thread identifier.
|
|
88
|
-
* Used by `remixmate host probe` to onboard an unknown host in a minute.
|
|
89
|
-
* Returns NAMES ONLY — values may carry tokens and are never printed.
|
|
90
|
-
*/
|
|
91
|
-
export declare function probeSessionVarNames(env?: NodeJS.ProcessEnv): string[];
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Project resolution ladder — which Project does this invocation's output
|
|
3
|
-
* belong to? First rung that matches wins.
|
|
4
|
-
*
|
|
5
|
-
* 0. CONVERSATION_ID already set → do nothing at all (cloud ab-agent path)
|
|
6
|
-
* 1. --project prj_xxx → explicit flag
|
|
7
|
-
* 2. REMIXMATE_PROJECT_ID → explicit env
|
|
8
|
-
* 3. ~/.config/remixmate/projects.json → `project use` binding (byPath → default)
|
|
9
|
-
* 4. the default project 「未分类」 → lazily created server-side
|
|
10
|
-
*
|
|
11
|
-
* Only "explicit" and "fallback" — there is deliberately no inference step in
|
|
12
|
-
* between. Deriving a project from the git remote reads well until you notice
|
|
13
|
-
* it *creates* one on every unfamiliar repo (`/project/create` is an upsert),
|
|
14
|
-
* and that its rules have to keep growing for private remotes, non-GitHub
|
|
15
|
-
* remotes, monorepos and repos with no origin — each misfire silently filing
|
|
16
|
-
* output under a project the user never made.
|
|
17
|
-
*
|
|
18
|
-
* See docs/product/cli/cli-project-binding-design.md §3.
|
|
19
|
-
*/
|
|
20
|
-
import { type HttpContext } from '../http.js';
|
|
21
|
-
export interface ResolvedProject {
|
|
22
|
-
projectId: string;
|
|
23
|
-
source: 'flag' | 'env' | 'binding-path' | 'binding-default' | 'default-project';
|
|
24
|
-
}
|
|
25
|
-
/** Minimal shape of ab-api's ProjectVO — only what the ladder needs. */
|
|
26
|
-
export interface ProjectSummary {
|
|
27
|
-
id: string;
|
|
28
|
-
displayName?: string;
|
|
29
|
-
fullName?: string;
|
|
30
|
-
sourceUrl?: string;
|
|
31
|
-
isDefault?: boolean;
|
|
32
|
-
}
|
|
33
|
-
/** POST /project/default — get-or-lazily-create 「未分类」. */
|
|
34
|
-
export declare function fetchDefaultProject(ctx: HttpContext): Promise<ProjectSummary>;
|
|
35
|
-
/** POST /project/list — for `remixmate project list`. */
|
|
36
|
-
export declare function listProjects(ctx: HttpContext): Promise<ProjectSummary[]>;
|
|
37
|
-
export declare function resolveProject(ctx: HttpContext, opts?: {
|
|
38
|
-
flagProjectId?: string;
|
|
39
|
-
env?: NodeJS.ProcessEnv;
|
|
40
|
-
cwd?: string;
|
|
41
|
-
}): Promise<ResolvedProject>;
|
|
42
|
-
/** Human-readable label for `doctor` / `project show`. */
|
|
43
|
-
export declare function describeProjectSource(source: ResolvedProject['source']): string;
|
package/dist/project/store.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Persistent project binding — which Project should this machine's CLI output
|
|
3
|
-
* belong to?
|
|
4
|
-
*
|
|
5
|
-
* Stored at ~/.config/remixmate/projects.json, NOT in credentials.json: that
|
|
6
|
-
* file is a 0600 secret store keyed by API base URL, with different lifetime
|
|
7
|
-
* and different blast radius on corruption.
|
|
8
|
-
*
|
|
9
|
-
* Two layers, because host cwd semantics are not uniform:
|
|
10
|
-
* - `byPath` — keyed by absolute cwd. Hosts that run inside the user's real
|
|
11
|
-
* repo (Codex, Claude Code) get per-repo bindings.
|
|
12
|
-
* - `default` — a single fallback. Hosts that spawn a throwaway working
|
|
13
|
-
* directory per conversation (WorkBuddy uses
|
|
14
|
-
* ~/WorkBuddy/<timestamp>) would never hit a byPath entry, so a
|
|
15
|
-
* cwd-only design silently degrades to nothing for them.
|
|
16
|
-
*
|
|
17
|
-
* See docs/product/cli/cli-project-binding-design.md §3.
|
|
18
|
-
*/
|
|
19
|
-
export declare const CONFIG_DIR: string;
|
|
20
|
-
export declare const PROJECTS_FILE: string;
|
|
21
|
-
export interface StoredBinding {
|
|
22
|
-
projectId: string;
|
|
23
|
-
/** Which layer matched — surfaced by `project show` / `doctor`. */
|
|
24
|
-
scope: 'path' | 'default';
|
|
25
|
-
}
|
|
26
|
-
/** Look up the binding for a cwd: exact byPath match first, then the default. */
|
|
27
|
-
export declare function readBinding(apiBaseUrl: string, cwd?: string): Promise<StoredBinding | null>;
|
|
28
|
-
/** Bind a project to this cwd (`scope: 'path'`) or as the fallback (`'default'`). */
|
|
29
|
-
export declare function writeBinding(apiBaseUrl: string, projectId: string, scope: 'path' | 'default', cwd?: string): Promise<void>;
|
|
30
|
-
/** Drop a binding. Returns true when something was actually removed. */
|
|
31
|
-
export declare function clearBinding(apiBaseUrl: string, scope: 'path' | 'default', cwd?: string): Promise<boolean>;
|
package/dist/project/take.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Take creation — turn a render invocation into a VideoProject the web app can
|
|
3
|
-
* show, and hand its conversation id down to the skill.
|
|
4
|
-
*
|
|
5
|
-
* Why this exists at all: ab-web derives a video's project from
|
|
6
|
-
* `file.conversation_id → media_video_project → media_project`. A render whose
|
|
7
|
-
* upload carries no conversation id is stored correctly but belongs to nothing,
|
|
8
|
-
* so it shows up only in the raw asset list. The cloud agent injects
|
|
9
|
-
* CONVERSATION_ID for its own runs; locally, nobody did — that is the bug this
|
|
10
|
-
* module fixes.
|
|
11
|
-
*
|
|
12
|
-
* Idempotency lives on the server (`/video-project/ensure` is get-or-create on
|
|
13
|
-
* `(user_id, client_session_key)`), not in a local state file: a pipeline is N
|
|
14
|
-
* separate CLI processes, sometimes concurrent, and a local cache would have to
|
|
15
|
-
* solve staleness and write races that a unique index solves for free.
|
|
16
|
-
*
|
|
17
|
-
* See docs/product/cli/cli-project-binding-design.md §5.
|
|
18
|
-
*/
|
|
19
|
-
import { type HttpContext } from '../http.js';
|
|
20
|
-
export interface EnsuredTake {
|
|
21
|
-
conversationId: string;
|
|
22
|
-
videoProjectId: string;
|
|
23
|
-
projectId: string;
|
|
24
|
-
created: boolean;
|
|
25
|
-
attempt: number;
|
|
26
|
-
/** The grouping key this take was resolved under — reused as the trace's session id. */
|
|
27
|
-
sessionKey: string;
|
|
28
|
-
/** Provenance label of the host we're running inside ('' when unknown). */
|
|
29
|
-
host: string;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Look up the take for the current grouping key without creating anything.
|
|
33
|
-
*
|
|
34
|
-
* Used by pipeline skills that should attach to a take when one exists but must
|
|
35
|
-
* never bring one into being: someone running `remixmate gen-image` on its own
|
|
36
|
-
* isn't making a video, and an empty VideoProject is worse clutter than an
|
|
37
|
-
* unattributed image.
|
|
38
|
-
*
|
|
39
|
-
* Deliberately does NOT resolve a project — resolveProject()'s last rung
|
|
40
|
-
* lazily *creates* 「未分类」, which a read-only lookup has no business doing.
|
|
41
|
-
*/
|
|
42
|
-
export declare function findTake(ctx: HttpContext): Promise<EnsuredTake | null>;
|
|
43
|
-
/**
|
|
44
|
-
* Resolve project + grouping key, then get-or-create the take.
|
|
45
|
-
* Returns null when this invocation shouldn't own a take.
|
|
46
|
-
*/
|
|
47
|
-
export declare function ensureTake(ctx: HttpContext, opts: {
|
|
48
|
-
jobId?: number;
|
|
49
|
-
flagProjectId?: string;
|
|
50
|
-
}): Promise<EnsuredTake | null>;
|
package/dist/project/trace.d.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Execution-trace self-reporting — tell the backend what this invocation
|
|
3
|
-
* actually did, so a locally-run pipeline is not a blind spot.
|
|
4
|
-
*
|
|
5
|
-
* Why this exists: the cloud agent records every tool call, its arguments AND
|
|
6
|
-
* its result into `media_chat_turn_trace` (ab-agent/src/trace-persist.ts). The
|
|
7
|
-
* local path records nothing — a take created from codex / claude code has an
|
|
8
|
-
* empty conversation, zero tool calls and zero credits in the analytics tables,
|
|
9
|
-
* so every session-level metric silently excludes it.
|
|
10
|
-
*
|
|
11
|
-
* What we can honestly report and what we cannot: the CLI is a child process
|
|
12
|
-
* spawned once per skill call. It never sees the user's prompt or the host's
|
|
13
|
-
* reply — those live in the host's own transcript. So this module reports the
|
|
14
|
-
* one thing it genuinely observes: the invocation itself.
|
|
15
|
-
*
|
|
16
|
-
* See docs/product/cli/cli-session-record-design.md §5.
|
|
17
|
-
*/
|
|
18
|
-
import { type HttpContext } from '../http.js';
|
|
19
|
-
import type { ParsedArgs } from '../argv.js';
|
|
20
|
-
import type { EnsuredTake } from './take.js';
|
|
21
|
-
export interface TraceOptions {
|
|
22
|
-
skillName: string;
|
|
23
|
-
args: ParsedArgs;
|
|
24
|
-
take: EnsuredTake;
|
|
25
|
-
ctx: HttpContext;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Whether this invocation should report at all.
|
|
29
|
-
*
|
|
30
|
-
* The rule is deliberately narrow: report only when THIS process resolved the
|
|
31
|
-
* take. Everything else is already covered by someone else —
|
|
32
|
-
* - under the cloud agent, CONVERSATION_ID arrives pre-set and ab-agent's own
|
|
33
|
-
* TurnTracer already recorded the very same call;
|
|
34
|
-
* - a nested `gen-image` spawned by prepare-video-assets inherits its
|
|
35
|
-
* parent's CONVERSATION_ID, and the parent's row already covers it.
|
|
36
|
-
* Since runner.ts only builds a tracer after resolving a take itself, this
|
|
37
|
-
* function just honours the kill switch.
|
|
38
|
-
*/
|
|
39
|
-
export declare function tracingEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Collects one invocation's evidence and posts it as a single turn.
|
|
42
|
-
*
|
|
43
|
-
* Lifecycle (runner.ts): `begin()` → output flows through the tap → `finish()`
|
|
44
|
-
* in a finally block. Every failure mode ends in a warning on stderr: a lost
|
|
45
|
-
* trace row must never cost the user a render they already paid for.
|
|
46
|
-
*/
|
|
47
|
-
export declare class InvocationTrace {
|
|
48
|
-
private readonly opts;
|
|
49
|
-
private chunks;
|
|
50
|
-
private restore;
|
|
51
|
-
private flushed;
|
|
52
|
-
private constructor();
|
|
53
|
-
/** Returns null when tracing is off — callers can then skip output capture entirely. */
|
|
54
|
-
static begin(opts: TraceOptions): InvocationTrace | null;
|
|
55
|
-
/**
|
|
56
|
-
* Tap both output streams.
|
|
57
|
-
*
|
|
58
|
-
* One tap covers both dispatch paths: in-process handlers write here
|
|
59
|
-
* directly, and the Python child's piped output is re-emitted through the
|
|
60
|
-
* same `write` (see runner.ts). Restored in finish().
|
|
61
|
-
*/
|
|
62
|
-
installCapture(): void;
|
|
63
|
-
/** Feed captured output. Keeps a bounded tail — the decisive line is the last one. */
|
|
64
|
-
absorb(chunk: unknown): void;
|
|
65
|
-
/**
|
|
66
|
-
* Emit the turn. Idempotent; never throws.
|
|
67
|
-
*
|
|
68
|
-
* `error` is the dispatcher's caught exception when there is one — a Python
|
|
69
|
-
* child that exits non-zero gives us no exception, only its output, which is
|
|
70
|
-
* exactly why the tail buffer exists.
|
|
71
|
-
*/
|
|
72
|
-
finish(exitCode: number, durationMs: number, error?: unknown): Promise<void>;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Flags → a trace-safe object.
|
|
76
|
-
*
|
|
77
|
-
* Credentials are dropped outright; long strings are cut to their opening
|
|
78
|
-
* because an argument like `--prompt` is *content*, and this table is evidence,
|
|
79
|
-
* not an archive of what the user wrote.
|
|
80
|
-
*/
|
|
81
|
-
export declare function sanitiseArgs(args: ParsedArgs): Record<string, unknown>;
|
|
82
|
-
/**
|
|
83
|
-
* Captured output → the tail we store.
|
|
84
|
-
*
|
|
85
|
-
* Two transformations before truncating, both about spending the 16KB on
|
|
86
|
-
* things a human would read:
|
|
87
|
-
* - progress lines are the machine protocol — one fat JSON object per phase,
|
|
88
|
-
* marked by a `__progress__` field (progress.ts, and the same shape from the
|
|
89
|
-
* Python skills). Their payload is noise here, but WHICH PHASE a failed run
|
|
90
|
-
* reached is the single most useful fact about it, so the line collapses to
|
|
91
|
-
* its phase name instead of being dropped.
|
|
92
|
-
* - `__diagnostic_v1__` lines are our own structured log of this very run;
|
|
93
|
-
* keeping them would store the same verdict twice.
|
|
94
|
-
*
|
|
95
|
-
* Then keeps the TAIL, unlike ab-agent's head-first cleanText: a command's
|
|
96
|
-
* verdict — the error, or the URL it produced — is its last line.
|
|
97
|
-
*/
|
|
98
|
-
export declare function condense(raw: string): string;
|
package/dist/registry.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill registry — scan skills/ and load skill.json definitions.
|
|
3
|
-
*
|
|
4
|
-
* Validation and entry-normalization live in `skill-schema.ts` (shared with
|
|
5
|
-
* the build-time manifest generator and smoke test). A record that fails
|
|
6
|
-
* validation is skipped with a warning rather than crashing the whole CLI.
|
|
7
|
-
*/
|
|
8
|
-
import { type SkillAuthMode, type SkillEntry } from './skill-schema.js';
|
|
9
|
-
export declare const SKILLS_DIR: string;
|
|
10
|
-
export type { SkillEntry, SkillAuthMode } from './skill-schema.js';
|
|
11
|
-
export interface SkillDef {
|
|
12
|
-
name: string;
|
|
13
|
-
toolName: string;
|
|
14
|
-
description: string;
|
|
15
|
-
parameters: Record<string, unknown>;
|
|
16
|
-
entry: SkillEntry;
|
|
17
|
-
/** Authorization requirement enforced by the dispatcher before invocation. */
|
|
18
|
-
auth: SkillAuthMode;
|
|
19
|
-
/** Ensure a take (VideoProject + conversation) before running — see skill-schema.ts. */
|
|
20
|
-
createsTake: boolean;
|
|
21
|
-
/** Attach to an existing take, never create one — see skill-schema.ts. */
|
|
22
|
-
joinsTake: boolean;
|
|
23
|
-
/** Argv keys that downgrade createsTake to joinsTake — see skill-schema.ts. */
|
|
24
|
-
createsTakeUnless: string[];
|
|
25
|
-
skillDir: string;
|
|
26
|
-
/** Absolute path to the python entry script (only when entry.type === 'python'). */
|
|
27
|
-
scriptAbsolutePath?: string;
|
|
28
|
-
}
|
|
29
|
-
export declare function loadSkills(baseDir?: string): SkillDef[];
|
|
30
|
-
export declare function findSkill(name: string, baseDir?: string): SkillDef | null;
|
package/dist/runner.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill dispatcher — routes a parsed invocation to either:
|
|
3
|
-
* - spawn `python3 <scriptAbsolutePath> --flag value ...` (entry.type === 'python')
|
|
4
|
-
* - call a TS handler from handlers/ (entry.type === 'http' | 'builtin')
|
|
5
|
-
*
|
|
6
|
-
* Authorization happens HERE, once, before either path — see auth/ensure.ts for
|
|
7
|
-
* why. Python children receive the resolved credential through their environment
|
|
8
|
-
* and never read the credential store themselves.
|
|
9
|
-
*
|
|
10
|
-
* Resolves to the child process's exit code so cli.ts can propagate it.
|
|
11
|
-
*/
|
|
12
|
-
import { type SkillDef } from './registry.js';
|
|
13
|
-
import type { ParsedArgs } from './argv.js';
|
|
14
|
-
export interface RunOptions {
|
|
15
|
-
/** Override the skills directory (defaults to the package's bundled skills/). */
|
|
16
|
-
baseDir?: string;
|
|
17
|
-
/** Raw argv slice after the skill name (passed verbatim for python; parsed for handlers). */
|
|
18
|
-
rawArgs: string[];
|
|
19
|
-
/** Parsed argv (for handlers). */
|
|
20
|
-
parsedArgs: ParsedArgs;
|
|
21
|
-
}
|
|
22
|
-
export declare function runSkill(skillName: string, opts: RunOptions): Promise<number>;
|
|
23
|
-
/** What this invocation is allowed to do about attribution. */
|
|
24
|
-
export type TakeMode = 'create' | 'join' | 'none';
|
|
25
|
-
/**
|
|
26
|
-
* Decide the take mode from the skill's declaration *and* what this particular
|
|
27
|
-
* invocation was asked to do.
|
|
28
|
-
*
|
|
29
|
-
* The manifest flags alone are not enough, because they describe the skill, not
|
|
30
|
-
* the call: `render-video --help` prints usage and exits, and
|
|
31
|
-
* `render-video --resolve-only` stops after asset resolution. Both used to run
|
|
32
|
-
* the full createsTake path, so a help query was enough to mint an empty take
|
|
33
|
-
* and lazily create 「未分类」 — the exact clutter project/take.ts sets out to
|
|
34
|
-
* avoid ("an empty VideoProject is worse clutter than an unattributed image").
|
|
35
|
-
*
|
|
36
|
-
* Note that a downgraded run still *joins*: when its own pipeline already
|
|
37
|
-
* started a take under the same grouping key, assets it generates stay attached.
|
|
38
|
-
*/
|
|
39
|
-
export declare function resolveTakeMode(skill: Pick<SkillDef, 'createsTake' | 'joinsTake' | 'createsTakeUnless'>, args: ParsedArgs): TakeMode;
|
package/dist/skill-schema.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single source of truth for skill.json shape + validation.
|
|
3
|
-
*
|
|
4
|
-
* Imported directly by `registry.ts` (runtime loader) and — via the compiled
|
|
5
|
-
* `dist/skill-schema.js` — by `scripts/build-manifest.mjs` and `scripts/smoke.mjs`.
|
|
6
|
-
* Previously each of those reimplemented `normalizeEntry` and its own subset of
|
|
7
|
-
* field checks, so "valid at build" ≠ "loadable at runtime". Centralizing here
|
|
8
|
-
* means one definition of a well-formed skill.
|
|
9
|
-
*
|
|
10
|
-
* Error policy is the caller's choice: `validateSkillJson` returns a list of
|
|
11
|
-
* human-readable problems (empty = OK). The runtime loader skips + warns;
|
|
12
|
-
* the build treats them as fatal.
|
|
13
|
-
*/
|
|
14
|
-
export type SkillEntry = {
|
|
15
|
-
type: 'python';
|
|
16
|
-
scriptPath: string;
|
|
17
|
-
} | {
|
|
18
|
-
type: 'http';
|
|
19
|
-
handler: string;
|
|
20
|
-
} | {
|
|
21
|
-
type: 'builtin';
|
|
22
|
-
handler: string;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Skill 类别 — 区分"创作期 / 消费期 / 元数据型" skill。
|
|
26
|
-
*
|
|
27
|
-
* - "authoring": 创建 / 编辑模板期间使用,例如 template-registry / gen-script /
|
|
28
|
-
* render-video(用于 try_render) / prepare-video-assets。
|
|
29
|
-
* - "consuming": 消费已有模板生成媒体,例如 export-jianying / video-parser /
|
|
30
|
-
* web-screenshot / web-record(与"创建模板"无关,是消费侧场景)。
|
|
31
|
-
* - "asset": 生成单一类型素材的原子 skill:gen-image / gen-voice /
|
|
32
|
-
* gen-video / gen-digital-human。authoring 也会用,但通过 stub
|
|
33
|
-
* 方式占位;consuming 场景下是真调用。
|
|
34
|
-
* - "meta": 元 skill(如未来加入 doc-only 的 template-creator)。
|
|
35
|
-
*
|
|
36
|
-
* 下游消费方(如 ab-template-studio)按 category 自动挑选白名单,避免每加一个
|
|
37
|
-
* skill 就要改两侧 hardcode。
|
|
38
|
-
*/
|
|
39
|
-
export type SkillCategory = 'authoring' | 'consuming' | 'asset' | 'meta';
|
|
40
|
-
export declare const CATEGORY_VALUES: readonly ["authoring", "consuming", "asset", "meta"];
|
|
41
|
-
/**
|
|
42
|
-
* Authorization requirement — consumed by the dispatcher's auth preflight.
|
|
43
|
-
* Semantics are documented on `AuthMode` in src/auth/ensure.ts (kept there so
|
|
44
|
-
* the runtime behavior and its description live together); this file only owns
|
|
45
|
-
* the literal values and their validation.
|
|
46
|
-
*/
|
|
47
|
-
export type SkillAuthMode = 'required' | 'optional' | 'none';
|
|
48
|
-
export declare const AUTH_VALUES: readonly ["required", "optional", "none"];
|
|
49
|
-
/**
|
|
50
|
-
* 参数的**展示分级** —— 给人填表用的,不影响调度。
|
|
51
|
-
*
|
|
52
|
-
* `parameters` 是给 agent 的完整契约(十几个字段很正常);把它整份渲染成表单
|
|
53
|
-
* 就是把门槛从"不知道说什么"换成"不知道填什么"。所以每个 skill 自己声明哪些
|
|
54
|
-
* 字段该直出、哪些折叠、哪些**根本不该给人看见**(`json_output` / `seed` 这类
|
|
55
|
-
* 是给调用方的开关,不是给人的选项)。
|
|
56
|
-
*
|
|
57
|
-
* 它和 schema 同住 skill.json,是刻意的:跨仓库的第二份名单必然漂移——
|
|
58
|
-
* ab-web 曾经用硬编码的 `ARCHETYPES` 常量对着后端字典表,最后两边对不上。
|
|
59
|
-
*
|
|
60
|
-
* 未声明的字段自动落进 `advanced`(见 build-manifest 的 resolveUiHints):
|
|
61
|
-
* 新加一个参数时,最坏情况是它多显示了一层,而不是静默消失。
|
|
62
|
-
*/
|
|
63
|
-
export interface SkillUiHints {
|
|
64
|
-
/** 表单展开即可见 */
|
|
65
|
-
primary?: string[];
|
|
66
|
-
/** 折叠在「高级」里 */
|
|
67
|
-
advanced?: string[];
|
|
68
|
-
/** 不渲染给人类 */
|
|
69
|
-
hidden?: string[];
|
|
70
|
-
}
|
|
71
|
-
export interface RawSkillJson {
|
|
72
|
-
name: string;
|
|
73
|
-
toolName: string;
|
|
74
|
-
description: string;
|
|
75
|
-
title?: string;
|
|
76
|
-
tier?: string;
|
|
77
|
-
category?: SkillCategory;
|
|
78
|
-
auth?: SkillAuthMode;
|
|
79
|
-
parameters?: Record<string, unknown>;
|
|
80
|
-
/** 参数的展示分级;缺省时按 required → primary、其余 → advanced 推导。 */
|
|
81
|
-
ui?: SkillUiHints;
|
|
82
|
-
scriptPath?: string;
|
|
83
|
-
entry?: SkillEntry;
|
|
84
|
-
envVars?: string[];
|
|
85
|
-
/**
|
|
86
|
-
* Declares that this skill produces a finished video, so the dispatcher should
|
|
87
|
-
* ensure a "take" (VideoProject + conversation) before running it and inject the
|
|
88
|
-
* resulting CONVERSATION_ID. Declarative rather than a hardcoded skill name in
|
|
89
|
-
* runner.ts, so the pipeline's shape stays visible in the skill's own manifest.
|
|
90
|
-
*/
|
|
91
|
-
createsTake?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Declares that this skill contributes to a video but must never *start* one:
|
|
94
|
-
* attach to an existing take if there is one, otherwise carry on unattributed.
|
|
95
|
-
* A standalone `gen-image` run isn't a video, and an empty VideoProject is
|
|
96
|
-
* worse clutter than an unattributed asset.
|
|
97
|
-
*/
|
|
98
|
-
joinsTake?: boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Parsed-argv keys (snake_case, as produced by argv.ts) whose presence means
|
|
101
|
-
* *this* invocation won't finish a video — `render-video --resolve-only`
|
|
102
|
-
* resolves assets and stops. Such a run degrades from createsTake to
|
|
103
|
-
* joinsTake: it still attaches to a take its own pipeline already started,
|
|
104
|
-
* but never brings one — nor the lazily created 「未分类」 — into being for a
|
|
105
|
-
* pass that may end in a contract error and no video at all.
|
|
106
|
-
*/
|
|
107
|
-
createsTakeUnless?: string[];
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Resolve a skill's auth mode, defaulting for records that predate the field.
|
|
111
|
-
*
|
|
112
|
-
* The default is derived from `envVars` rather than hardcoded to `'required'`:
|
|
113
|
-
* a skill that never declared PRIV_TOKEN cannot possibly need a credential, and
|
|
114
|
-
* defaulting it to `required` would make a purely local skill (web-screenshot)
|
|
115
|
-
* pop a browser. Every skill shipped in this package declares `auth` explicitly,
|
|
116
|
-
* so this only covers externally supplied skill dirs (SKILL_BASE_DIR).
|
|
117
|
-
*/
|
|
118
|
-
export declare function resolveAuthMode(raw: Pick<RawSkillJson, 'auth' | 'envVars'>): SkillAuthMode;
|
|
119
|
-
export declare const TIER_VALUES: readonly ["atomic", "orchestration", "tool"];
|
|
120
|
-
export declare const REQUIRED_SKILL_JSON_FIELDS: readonly ["name", "tier", "title", "description"];
|
|
121
|
-
/**
|
|
122
|
-
* Resolve the dispatcher entry. A missing `entry` falls back to the legacy
|
|
123
|
-
* top-level `scriptPath`, treated as `{ type: 'python', scriptPath }` so older
|
|
124
|
-
* skills keep working untouched. Returns null when neither is present.
|
|
125
|
-
*/
|
|
126
|
-
export declare function normalizeEntry(raw: Pick<RawSkillJson, 'entry' | 'scriptPath'>): SkillEntry | null;
|
|
127
|
-
/**
|
|
128
|
-
* 把 `ui` 声明补全成三个互斥的完整分桶。没声明 `ui` 时按 required 推导。
|
|
129
|
-
*
|
|
130
|
-
* **未提及的字段一律落进 advanced**:新增参数时最坏是多折一层,而不是消失。
|
|
131
|
-
* 返回 null 表示这个 skill 没有可填的参数(不该弹表单)。
|
|
132
|
-
*/
|
|
133
|
-
export declare function resolveUiHints(raw: Pick<RawSkillJson, 'parameters' | 'ui'>): Required<SkillUiHints> | null;
|
|
134
|
-
/**
|
|
135
|
-
* Validate a parsed skill.json against the directory it lives in. Returns an
|
|
136
|
-
* array of problem strings; an empty array means the record is well-formed.
|
|
137
|
-
*/
|
|
138
|
-
export declare function validateSkillJson(raw: RawSkillJson, skillId: string): string[];
|
package/dist/template/args.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Strict argv parser for `remixmate template <sub>`.
|
|
3
|
-
*
|
|
4
|
-
* Unlike src/argv.ts (which is permissive because skill flags are forwarded to
|
|
5
|
-
* Python), these subcommands own their whole surface, so an unknown flag or a
|
|
6
|
-
* stray positional is a usage error (exit 2) rather than something silently
|
|
7
|
-
* ignored — `publish --nmae X` must not publish under the default name.
|
|
8
|
-
*/
|
|
9
|
-
import { SkillError } from '../errors.js';
|
|
10
|
-
export type FlagKind = 'bool' | 'string';
|
|
11
|
-
export type FlagSpec = Record<string, FlagKind>;
|
|
12
|
-
export interface ParsedTemplateArgs {
|
|
13
|
-
positionals: string[];
|
|
14
|
-
/** Keyed by the flag name without dashes, kebab-case preserved (`props-json`). */
|
|
15
|
-
flags: Record<string, string | boolean>;
|
|
16
|
-
}
|
|
17
|
-
/** Flags every subcommand accepts. */
|
|
18
|
-
export declare const COMMON_FLAGS: FlagSpec;
|
|
19
|
-
export declare function usageError(message: string): SkillError;
|
|
20
|
-
export declare function parseTemplateArgs(argv: string[], spec: FlagSpec, opts: {
|
|
21
|
-
maxPositionals: number;
|
|
22
|
-
}): ParsedTemplateArgs;
|
|
23
|
-
export declare function flagString(flags: ParsedTemplateArgs['flags'], name: string): string | undefined;
|
|
24
|
-
/** Parse a positive number flag; usage error on anything else. */
|
|
25
|
-
export declare function flagNumber(flags: ParsedTemplateArgs['flags'], name: string): number | undefined;
|
package/dist/template/check.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `remixmate template check [name] [--json] [--no-write]`
|
|
3
|
-
*
|
|
4
|
-
* Pure orchestration: the validation itself lives in the starter
|
|
5
|
-
* (`.remixmate/check/index.mjs`, K3), synced from the same schema / security
|
|
6
|
-
* policy sources the platform uses. The cli never carries its own copy — that
|
|
7
|
-
* would be the drift requirement 5.2 exists to prevent.
|
|
8
|
-
*/
|
|
9
|
-
import { type ProcOptions } from './proc.js';
|
|
10
|
-
export interface CheckOptions {
|
|
11
|
-
name?: string;
|
|
12
|
-
json?: boolean;
|
|
13
|
-
noWrite?: boolean;
|
|
14
|
-
cwd?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Where the check's stdout goes. Standalone `check` streams it straight
|
|
17
|
-
* through; preview/publish in --json mode route it to stderr so their own
|
|
18
|
-
* JSON stays the last stdout line.
|
|
19
|
-
*/
|
|
20
|
-
stdio?: ProcOptions['stdio'];
|
|
21
|
-
}
|
|
22
|
-
/** Run the starter's check script; resolves to its exit code (0 ok / 1 issues / 2 usage). */
|
|
23
|
-
export declare function runCheck(opts?: CheckOptions): Promise<number>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `remixmate template <init|check|preview|publish|list>` dispatcher.
|
|
3
|
-
*
|
|
4
|
-
* Exit codes follow the cli contract (errors.ts): 2 usage, 4 credentials,
|
|
5
|
-
* 5 backend unreachable; `check` propagates the starter script's own code.
|
|
6
|
-
* With --json a failure also ends stdout with `{"ok":false,...}` so hosts
|
|
7
|
-
* parsing the last line always get an object.
|
|
8
|
-
*/
|
|
9
|
-
import { type FlagSpec, type ParsedTemplateArgs } from './args.js';
|
|
10
|
-
export declare const TEMPLATE_VERB = "template";
|
|
11
|
-
export declare const TEMPLATE_SUBCOMMANDS: readonly ["init", "check", "preview", "publish", "list", "upgrade"];
|
|
12
|
-
export type TemplateSubcommand = (typeof TEMPLATE_SUBCOMMANDS)[number];
|
|
13
|
-
interface SubSpec {
|
|
14
|
-
flags: FlagSpec;
|
|
15
|
-
maxPositionals: number;
|
|
16
|
-
usage: string;
|
|
17
|
-
}
|
|
18
|
-
export declare const SUB_SPECS: Record<TemplateSubcommand, SubSpec>;
|
|
19
|
-
export declare function templateUsage(): string;
|
|
20
|
-
export declare function parseTemplateCommand(argv: string[]): {
|
|
21
|
-
sub: TemplateSubcommand | 'help';
|
|
22
|
-
args: ParsedTemplateArgs;
|
|
23
|
-
};
|
|
24
|
-
export declare function runTemplateCommand(argv: string[]): Promise<number>;
|
|
25
|
-
export {};
|