@remixmate/cli 0.9.72 → 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 -192
- 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 +44 -3
- 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-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 -22
- 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
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure environment predicates that gate the auto device-login feature.
|
|
3
|
-
*
|
|
4
|
-
* Everything here is synchronous, side-effect free, never touches the network
|
|
5
|
-
* and never reads a PrivToken. The conservative bias is: when in doubt, treat
|
|
6
|
-
* the environment as headless so we fail fast rather than pop a useless browser.
|
|
7
|
-
*
|
|
8
|
-
* See .kiro/specs/cli-auto-device-login/design.md (Requirement 1.4–1.7).
|
|
9
|
-
*/
|
|
10
|
-
/** Total kill switch: hosts can force-disable auto auth and fall back to fail-fast. */
|
|
11
|
-
export declare function autoAuthDisabled(): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the process is likely running without a desktop session capable of
|
|
14
|
-
* opening a browser.
|
|
15
|
-
*
|
|
16
|
-
* - CI environments are always treated as headless.
|
|
17
|
-
* - On Linux a browser needs an X11 / Wayland display; absence → headless.
|
|
18
|
-
* - macOS / Windows are assumed to have a GUI session available.
|
|
19
|
-
*/
|
|
20
|
-
export declare function isHeadless(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Master gate for auto authorization. Only true when auto auth is not disabled
|
|
23
|
-
* AND the environment can plausibly open a browser for the user.
|
|
24
|
-
*/
|
|
25
|
-
export declare function canAutoAuth(): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Whether the CLI is being driven by an agent host (Claude Code / Codex /
|
|
28
|
-
* ab-agent) rather than typed by a human at a terminal.
|
|
29
|
-
*
|
|
30
|
-
* Used to decide (a) whether to emit the machine-readable AUTH_REQUIRED block
|
|
31
|
-
* alongside the human text, and (b) whether an interactive `login` may block
|
|
32
|
-
* for the device code's full lifetime — an agent's tool call is time-bounded,
|
|
33
|
-
* so it must get a bounded, resumable wait instead.
|
|
34
|
-
*
|
|
35
|
-
* Detection is deliberately loose: a piped stdout is the reliable signal, the
|
|
36
|
-
* env markers just make the intent explicit for hosts that allocate a pty.
|
|
37
|
-
*/
|
|
38
|
-
export declare function isAgentHost(): boolean;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pending device-authorization state, at ~/.config/remixmate/pending.json.
|
|
3
|
-
*
|
|
4
|
-
* Exists so authorization can outlive a single process. `login --start` requests
|
|
5
|
-
* a device code, persists it and returns immediately; `login --wait` picks it up
|
|
6
|
-
* and polls with a bounded window, as many times as needed. That split is what
|
|
7
|
-
* makes authorization workable from an agent host, whose tool calls are
|
|
8
|
-
* time-bounded and cannot sit on a 10-minute blocking poll.
|
|
9
|
-
*
|
|
10
|
-
* The device_code IS a short-lived bearer secret (it can be exchanged for the
|
|
11
|
-
* PrivToken until it expires or is used), so the file is written 0600 like the
|
|
12
|
-
* credential store, and is deleted as soon as it is redeemed or found expired.
|
|
13
|
-
*/
|
|
14
|
-
export declare const PENDING_FILE: string;
|
|
15
|
-
export interface PendingAuth {
|
|
16
|
-
apiBaseUrl: string;
|
|
17
|
-
deviceCode: string;
|
|
18
|
-
userCode: string;
|
|
19
|
-
verificationUri: string;
|
|
20
|
-
verificationUriComplete?: string;
|
|
21
|
-
/** Poll interval in seconds, as instructed by the backend. */
|
|
22
|
-
interval: number;
|
|
23
|
-
/** Absolute epoch-ms deadline after which the device code is dead. */
|
|
24
|
-
expiresAt: number;
|
|
25
|
-
}
|
|
26
|
-
export declare function setPending(pending: PendingAuth): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Read the pending authorization for `apiBaseUrl`. Returns null when absent,
|
|
29
|
-
* unreadable, bound to a different backend, or already expired — callers then
|
|
30
|
-
* tell the user to run `login --start` again.
|
|
31
|
-
*/
|
|
32
|
-
export declare function getPending(apiBaseUrl: string): Promise<PendingAuth | null>;
|
|
33
|
-
export declare function clearPending(): Promise<void>;
|
package/dist/auth/resolve.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single source of truth for PrivToken resolution precedence, shared by the
|
|
3
|
-
* CLI commands and the HTTP layer (src/http.ts wires this in — Wave 2 task 4.3).
|
|
4
|
-
*
|
|
5
|
-
* Precedence (high → low), per requirements 7.1–7.4:
|
|
6
|
-
* 1. explicit --token flag (caller override)
|
|
7
|
-
* 2. PRIV_TOKEN environment variable (CI / agent-embedded hosts)
|
|
8
|
-
* 3. Credential_Store entry for the active API base URL (written by `login`)
|
|
9
|
-
*
|
|
10
|
-
* A value that is empty after trimming whitespace is treated as ABSENT, so an
|
|
11
|
-
* exported-but-empty `PRIV_TOKEN=""` falls through to the credential store
|
|
12
|
-
* rather than masking it.
|
|
13
|
-
*/
|
|
14
|
-
export type CredentialSource = 'flag' | 'env' | 'credential-store';
|
|
15
|
-
export interface ResolvedToken {
|
|
16
|
-
privToken: string;
|
|
17
|
-
source: CredentialSource;
|
|
18
|
-
/** Present only for the credential-store source. */
|
|
19
|
-
userLabel?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Resolve the PrivToken following the documented precedence. Returns null when
|
|
23
|
-
* no source yields a token (callers render the not-authenticated message).
|
|
24
|
-
*/
|
|
25
|
-
export declare function resolvePrivToken(opts: {
|
|
26
|
-
flag?: string;
|
|
27
|
-
apiBaseUrl: string;
|
|
28
|
-
}): Promise<ResolvedToken | null>;
|
|
29
|
-
/** Human-readable hint shown when resolution fails (no token echoed). */
|
|
30
|
-
export declare const NOT_AUTHENTICATED_HINT = "\u274C not authenticated \u2014 run `remixmate login`, set PRIV_TOKEN, or pass --token";
|
package/dist/billing.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Billing capture — makes credit consumption visible to whoever ran the skill.
|
|
3
|
-
*
|
|
4
|
-
* Credits are deducted server-side and used to be invisible here: a run printed
|
|
5
|
-
* its image/video URL and nothing else, so the first time a user noticed the
|
|
6
|
-
* credit system at all was the `insufficient_credits` error after the balance
|
|
7
|
-
* had already run out. ab-api now attaches a `billing` object to the envelope of
|
|
8
|
-
* every response that charged something (see core.Success / credits_billing.go);
|
|
9
|
-
* this module accumulates those across all the calls a single skill run makes —
|
|
10
|
-
* a gen-image run polls, a gen-video run polls, and each may charge once — and
|
|
11
|
-
* renders one footer at the end.
|
|
12
|
-
*
|
|
13
|
-
* Two outputs, two audiences, both on stdout:
|
|
14
|
-
* - a human-readable footer, which is what the agent relays to the user.
|
|
15
|
-
* - one `__progress__` line (phase `billing`) — the existing machine protocol,
|
|
16
|
-
* already parsed by ab-agent's executor and skipped by the line-scanning
|
|
17
|
-
* parsers in render_video.py, so a nested pipeline caller can aggregate a
|
|
18
|
-
* whole run's spend without a new stdout contract.
|
|
19
|
-
*
|
|
20
|
-
* Both go to stdout rather than stderr (where the auth footer lives) because
|
|
21
|
-
* ab-agent hands the LLM `result.stdout || result.stderr` (mcp-tools.ts) — a
|
|
22
|
-
* stderr-only footer would be invisible in the hosted agent, visible only when
|
|
23
|
-
* a local host like codex shows both streams. Adding stdout lines is safe:
|
|
24
|
-
* emitProgress already writes NDJSON there, so no consumer can be treating
|
|
25
|
-
* stdout as a single JSON document.
|
|
26
|
-
*/
|
|
27
|
-
export interface BillingItem {
|
|
28
|
-
credits: number;
|
|
29
|
-
bizType?: string;
|
|
30
|
-
detail?: string;
|
|
31
|
-
}
|
|
32
|
-
/** The `billing` object ab-api attaches to a charged response. */
|
|
33
|
-
export interface Billing {
|
|
34
|
-
credits: number;
|
|
35
|
-
balance: number;
|
|
36
|
-
items?: BillingItem[];
|
|
37
|
-
}
|
|
38
|
-
/** Accumulate one response's billing object; no-ops on responses that charged nothing. */
|
|
39
|
-
export declare function recordBilling(billing: Billing | undefined | null): void;
|
|
40
|
-
/** Everything charged so far in this process, or null when nothing was. */
|
|
41
|
-
export declare function billingSummary(): Billing | null;
|
|
42
|
-
export declare function emitBillingFooter(): void;
|
|
43
|
-
/** Test seam — resets the accumulator between runs in-process. */
|
|
44
|
-
export declare function resetBilling(): void;
|
package/dist/capabilities.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model capabilities client.
|
|
3
|
-
*
|
|
4
|
-
* The model roster — internal model ids, friendly aliases, defaults, and each
|
|
5
|
-
* model's parameter constraints (aspect ratios / resolutions / durations /
|
|
6
|
-
* reference-image caps / Seedream size presets) — is owned by ab-api and served
|
|
7
|
-
* from POST /model/capabilities (public, no auth). The CLI fetches it at runtime
|
|
8
|
-
* instead of hardcoding it, so this npm package never ships the internal model
|
|
9
|
-
* matrix or provider details, and validation can't drift from the backend.
|
|
10
|
-
*
|
|
11
|
-
* Fetched once per process and memoized; the catalog is static server-side.
|
|
12
|
-
*/
|
|
13
|
-
export interface ModelConstraints {
|
|
14
|
-
aspectRatios?: string[];
|
|
15
|
-
resolutions?: string[];
|
|
16
|
-
durations?: number[];
|
|
17
|
-
durationMin?: number;
|
|
18
|
-
durationMax?: number;
|
|
19
|
-
durationDefault?: number;
|
|
20
|
-
refImageMax?: number;
|
|
21
|
-
/** Omni-modal reference caps (Seedance 2.0): videos and audio clips per request. */
|
|
22
|
-
refVideoMax?: number;
|
|
23
|
-
refAudioMax?: number;
|
|
24
|
-
sizes?: string[];
|
|
25
|
-
/** aspect-ratio → [width, height] pixel preset (Seedream). Per model: the same
|
|
26
|
-
* ratio maps to different pixels on different Seedream variants. */
|
|
27
|
-
sizePresets?: Record<string, [number, number]>;
|
|
28
|
-
/** total-pixel bounds (width × height); the backend rescales sizes outside them. */
|
|
29
|
-
pixelMin?: number;
|
|
30
|
-
pixelMax?: number;
|
|
31
|
-
}
|
|
32
|
-
export interface ModelDescriptor {
|
|
33
|
-
id: string;
|
|
34
|
-
label: string;
|
|
35
|
-
aliases?: string[];
|
|
36
|
-
default?: boolean;
|
|
37
|
-
constraints: ModelConstraints;
|
|
38
|
-
}
|
|
39
|
-
export interface VoiceCapabilities {
|
|
40
|
-
provider: string;
|
|
41
|
-
defaultVoiceId: string;
|
|
42
|
-
speedMin: number;
|
|
43
|
-
speedMax: number;
|
|
44
|
-
}
|
|
45
|
-
export interface DigitalHumanCapabilities {
|
|
46
|
-
sources: string[];
|
|
47
|
-
defaultVoiceId: string;
|
|
48
|
-
}
|
|
49
|
-
export interface ModelCapabilities {
|
|
50
|
-
image: ModelDescriptor[];
|
|
51
|
-
video: ModelDescriptor[];
|
|
52
|
-
voice: VoiceCapabilities;
|
|
53
|
-
digitalHuman: DigitalHumanCapabilities;
|
|
54
|
-
}
|
|
55
|
-
/** Fetch (and memoize) the model capabilities catalog from ab-api. */
|
|
56
|
-
export declare function getCapabilities(apiBaseUrl?: string): Promise<ModelCapabilities>;
|
|
57
|
-
/**
|
|
58
|
-
* Resolve a user-supplied model (friendly alias or full id) against a model
|
|
59
|
-
* list. Returns the matched descriptor, or null when nothing matches.
|
|
60
|
-
*/
|
|
61
|
-
export declare function matchModel(list: ModelDescriptor[], input: string): ModelDescriptor | null;
|
|
62
|
-
/** The descriptor flagged `default` in a list, falling back to the first entry. */
|
|
63
|
-
export declare function defaultModel(list: ModelDescriptor[]): ModelDescriptor | undefined;
|
package/dist/cli.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* remixmate CLI entrypoint.
|
|
4
|
-
*
|
|
5
|
-
* remixmate --list list registered skills
|
|
6
|
-
* remixmate <name> --help forward --help to underlying skill
|
|
7
|
-
* remixmate <name> [--flag value ...] invoke the skill
|
|
8
|
-
*
|
|
9
|
-
* For python skills (entry.type === 'python') we spawn the script and inherit
|
|
10
|
-
* its stdio so progress / errors flow through unchanged.
|
|
11
|
-
* For http / builtin skills we dispatch in-process to handlers/.
|
|
12
|
-
*/
|
|
13
|
-
export {};
|
package/dist/diagnostics.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare function traceHeaders(): Record<string, string>;
|
|
2
|
-
/**
|
|
3
|
-
* Redact a string for anything that leaves this process (diagnostic lines,
|
|
4
|
-
* execution traces).
|
|
5
|
-
*
|
|
6
|
-
* Kept in lockstep with ab-agent's `lib/telemetry.cleanText` — the two feed the
|
|
7
|
-
* same `media_chat_turn_trace` table, and a table whose rows were sanitized by
|
|
8
|
-
* two different rulesets is a table nobody can reason about. ANSI stripping,
|
|
9
|
-
* e-mail and phone redaction were added here to close that gap.
|
|
10
|
-
*
|
|
11
|
-
* `max` caps the result in BYTES, keeping the head. Callers that need the tail
|
|
12
|
-
* (a command's decisive line is its last one) slice before calling.
|
|
13
|
-
*/
|
|
14
|
-
export declare function cleanDiagnosticText(value: string, max?: number): string;
|
|
15
|
-
/**
|
|
16
|
-
* Exit code → the outcome vocabulary of the logging contract.
|
|
17
|
-
*
|
|
18
|
-
* Exported because the execution trace (project/trace.ts) reports the same
|
|
19
|
-
* verdict for the same run: two mappings would let a run be `failure` in the
|
|
20
|
-
* diagnostic line and `success` in the database.
|
|
21
|
-
*/
|
|
22
|
-
export declare function outcomeOf(exitCode: number): 'success' | 'cancelled' | 'rejected' | 'failure';
|
|
23
|
-
/** Opt-in line framing for hosts; stdout is exclusively the existing skill protocol. */
|
|
24
|
-
export declare function diagnostic(exitCode: number, durationMs: number, error?: unknown): void;
|
package/dist/doctor.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `remixmate doctor` — one command that answers "why isn't this working?".
|
|
3
|
-
*
|
|
4
|
-
* The failure modes this package actually produces in the field are: no
|
|
5
|
-
* credential, a credential bound to a different backend, a missing python3, a
|
|
6
|
-
* missing Playwright, and an unreachable backend. Each of those used to surface
|
|
7
|
-
* only as a downstream error from whichever skill happened to be run first, in
|
|
8
|
-
* that skill's own wording. Checking them up front, in one place, turns a
|
|
9
|
-
* scavenger hunt into a list.
|
|
10
|
-
*
|
|
11
|
-
* Also exports the one-line status shown under `--list` / `--help`, so a first
|
|
12
|
-
* run says "you are not logged in" instead of leaving the user to find out by
|
|
13
|
-
* invoking a skill.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Short auth status suitable for a footer. Never performs network I/O — a
|
|
17
|
-
* listing command must stay instant and work offline.
|
|
18
|
-
*/
|
|
19
|
-
export declare function authStatusLine(): Promise<string>;
|
|
20
|
-
export declare function runDoctor(opts?: {
|
|
21
|
-
skipNetwork?: boolean;
|
|
22
|
-
}): Promise<number>;
|
package/dist/errors.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Process-wide error type and exit-code contract.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from http.ts so the auth gateway (auth/ensure.ts) can throw the same
|
|
5
|
-
* error type without creating an import cycle (http.ts → ensure.ts → http.ts).
|
|
6
|
-
* `SkillError` is still re-exported from http.ts, so existing imports are unchanged.
|
|
7
|
-
*
|
|
8
|
-
* Exit codes are a CONTRACT with hosts (Claude Code / Codex / ab-agent): an agent
|
|
9
|
-
* reads the code to decide whether to guide the user through authorization, retry
|
|
10
|
-
* later, or surface a hard failure. Never reuse a code for a different meaning.
|
|
11
|
-
*/
|
|
12
|
-
export declare const EXIT: {
|
|
13
|
-
/** Success. */
|
|
14
|
-
readonly OK: 0;
|
|
15
|
-
/** Generic runtime failure. */
|
|
16
|
-
readonly ERROR: 1;
|
|
17
|
-
/** Usage error — unknown skill / unknown option. */
|
|
18
|
-
readonly USAGE: 2;
|
|
19
|
-
/** No usable credential, or the credential was rejected. Host should offer to authorize. */
|
|
20
|
-
readonly NOT_AUTHENTICATED: 4;
|
|
21
|
-
/** Backend unreachable / timed out. Distinct from 4 so "log in" isn't suggested for an outage. */
|
|
22
|
-
readonly BACKEND_UNREACHABLE: 5;
|
|
23
|
-
/** Failed to spawn the underlying interpreter. */
|
|
24
|
-
readonly SPAWN_FAILED: 127;
|
|
25
|
-
};
|
|
26
|
-
export declare class SkillError extends Error {
|
|
27
|
-
readonly exitCode: number;
|
|
28
|
-
constructor(message: string, exitCode?: number);
|
|
29
|
-
}
|
package/dist/exec.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `remixmate exec -- <command> [args...]`
|
|
3
|
-
*
|
|
4
|
-
* Runs an arbitrary command with the resolved credential injected into its
|
|
5
|
-
* environment (`PRIV_TOKEN` + `MM_API_BASE_URL`), using the same gateway that
|
|
6
|
-
* skill dispatch uses.
|
|
7
|
-
*
|
|
8
|
-
* This is the general form of the invariant the auth rework establishes: Node
|
|
9
|
-
* is the only thing that reads the credential store / keychain / device flow,
|
|
10
|
-
* and every child process receives the result through its environment. Without
|
|
11
|
-
* it, maintenance scripts that import `registry_loader` directly (e.g.
|
|
12
|
-
* scripts/test-template-pipeline.py) would have to re-implement credential
|
|
13
|
-
* lookup — which is exactly the duplication, and the cross-origin token leak,
|
|
14
|
-
* that was just removed.
|
|
15
|
-
*
|
|
16
|
-
* The token is never printed; it only ever reaches the child's environment.
|
|
17
|
-
*/
|
|
18
|
-
export declare function runExec(argv: string[]): Promise<number>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* gen-digital-human handler — talking-head video + custom avatars, five modes:
|
|
3
|
-
* --list-avatars true → POST /digital-human/avatar/page (list)
|
|
4
|
-
* --clone --clone-url <url> --name <n> → POST /digital-human/avatar/clone, then poll clone-status
|
|
5
|
-
* --clone-status --avatar-id <id> → POST /digital-human/avatar/clone-status (one-shot)
|
|
6
|
-
* --check-status --generation-id <id> → POST /digital-human/video/status (one-shot)
|
|
7
|
-
* default (--avatar-id <id> ...) → generate: resolve avatar → submit → poll
|
|
8
|
-
*
|
|
9
|
-
* Ported from `scripts/gen_digital_human_video.py` (python → http) so it shares
|
|
10
|
-
* auth / base-URL / business-code handling with the other generators via
|
|
11
|
-
* http.ts. Endpoints and payloads match the backend DigitalHuman* DTOs.
|
|
12
|
-
*
|
|
13
|
-
* Avatar ids are the backend's opaque uids (`dh_...`); legacy numeric ids are
|
|
14
|
-
* still accepted as strings.
|
|
15
|
-
*/
|
|
16
|
-
import type { HandlerContext, HandlerInput } from './index.js';
|
|
17
|
-
export declare function genDigitalHuman(input: HandlerInput, ctxIn: HandlerContext): Promise<void>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* gen-image handler — POST ab-api /model/genImg.
|
|
3
|
-
*
|
|
4
|
-
* Thin forwarder: the model roster, defaults, size presets and reference-image
|
|
5
|
-
* caps all come from ab-api's capabilities catalog (see capabilities.ts), not
|
|
6
|
-
* from this package. Behavior:
|
|
7
|
-
* - --model accepts a friendly alias or a full id; resolved against the catalog
|
|
8
|
-
* (ab-api also resolves aliases server-side, so an unknown value still passes
|
|
9
|
-
* through and is validated by the backend).
|
|
10
|
-
* - --size accepts a WxH string (→ width/height) or an aspect-ratio preset key
|
|
11
|
-
* (→ aspectRatio; for Seedream models ab-api maps the preset to pixels).
|
|
12
|
-
* - --resolution is accepted but inert: it only ever fed the Gemini `size` tier,
|
|
13
|
-
* and Gemini is not wired up on the gateway, so we no longer send it.
|
|
14
|
-
* - Reference images: HTTPS URLs and data: URIs pass through; local paths are
|
|
15
|
-
* read and base64-encoded into a data: URI.
|
|
16
|
-
* - Async response (generationId + status:'generating'/'pending') is polled
|
|
17
|
-
* against /model/getImgStatus until completed/failed/timeout.
|
|
18
|
-
*/
|
|
19
|
-
import type { HandlerContext, HandlerInput } from './index.js';
|
|
20
|
-
export declare function genImage(input: HandlerInput, ctxIn: HandlerContext): Promise<void>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* gen-post handler — POST ab-api /publish/caption/generate.
|
|
3
|
-
*
|
|
4
|
-
* Generates the text of a social post — per-platform title / description / tags —
|
|
5
|
-
* for a finished video (the video itself is not touched or uploaded): the same endpoint and prompts the web studio's 「发布文案」
|
|
6
|
-
* panel uses. Prompt wording, compliance rules and the platform roster all live
|
|
7
|
-
* in ab-api (publish_prompts.go + the user's saved prompt overrides); this
|
|
8
|
-
* handler only collects context and forwards it.
|
|
9
|
-
*
|
|
10
|
-
* Behavior:
|
|
11
|
-
* - --platform is repeatable and/or comma-separated; `all` (the default) expands
|
|
12
|
-
* to the three platforms the web panel shows. Each platform is one backend
|
|
13
|
-
* call (one LLM run, billed separately), issued concurrently.
|
|
14
|
-
* - --render-id links the result to a studio take so it shows up in the web
|
|
15
|
-
* panel; without it the backend generates without persisting anything.
|
|
16
|
-
* - --instruction is the user's "how should it read" request. With a draft
|
|
17
|
-
* (--title / --description / --tag) it rewrites that caption — single platform
|
|
18
|
-
* only, since the draft belongs to one platform. Without a draft it is an extra
|
|
19
|
-
* requirement applied to a fresh generation on every requested platform.
|
|
20
|
-
*/
|
|
21
|
-
import type { HandlerContext, HandlerInput } from './index.js';
|
|
22
|
-
export declare function genPost(input: HandlerInput, ctxIn: HandlerContext): Promise<void>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* gen-video handler — POST ab-api /model/genVideo, then poll /model/getVideoStatus.
|
|
3
|
-
*
|
|
4
|
-
* Thin forwarder: the model roster, friendly aliases, defaults and per-model
|
|
5
|
-
* constraints (aspect ratios / resolutions / durations / reference-image caps)
|
|
6
|
-
* come from ab-api's capabilities catalog (see capabilities.ts), not from this
|
|
7
|
-
* package. Pre-flight validation here is purely data-driven from that catalog —
|
|
8
|
-
* the CLI carries no model matrix — and ab-api re-validates authoritatively.
|
|
9
|
-
*
|
|
10
|
-
* --model accepts a friendly alias or a full id; ab-api also resolves aliases
|
|
11
|
-
* server-side, so an unknown value still passes through to the backend.
|
|
12
|
-
*
|
|
13
|
-
* Local image paths for first/last/reference frames are read and base64-encoded
|
|
14
|
-
* into a data: URI; https / data: URIs pass through unchanged. Reference videos
|
|
15
|
-
* and audio are the exception — they must already be public URLs, see
|
|
16
|
-
* `requirePublicUrls`.
|
|
17
|
-
*/
|
|
18
|
-
import type { HandlerContext, HandlerInput } from './index.js';
|
|
19
|
-
export declare function genVideo(input: HandlerInput, ctxIn: HandlerContext): Promise<void>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* gen-voice handler — Minimax TTS via ab-api unified /tool/tts (provider=minimax).
|
|
3
|
-
*
|
|
4
|
-
* Operations:
|
|
5
|
-
* --list-voices true → GET available voice IDs from /voice/page (live)
|
|
6
|
-
* --list-voices true --local true → print the built-in language-tagged
|
|
7
|
-
* fallback catalog (offline, no API call).
|
|
8
|
-
* **CLI-only escape hatch for offline dev.**
|
|
9
|
-
* default → synthesize text into an MP3 URL
|
|
10
|
-
*
|
|
11
|
-
* `local` is deliberately absent from `skills/gen-voice/skill.json`'s
|
|
12
|
-
* `parameters`, which is what ab-agent turns into the model-facing tool schema.
|
|
13
|
-
* A model asked to check a voice id would reach for `local: true`, get a
|
|
14
|
-
* two-entry hardcoded list back, and conclude that a perfectly valid voice does
|
|
15
|
-
* not exist — which is exactly what happened on the hosted web agent
|
|
16
|
-
* ("本地回退列表中没有该音色"). The remote catalog is the only authority on
|
|
17
|
-
* which voices exist; the local list is a developer convenience for working
|
|
18
|
-
* without a token, and it is only reachable by typing the flag yourself.
|
|
19
|
-
*
|
|
20
|
-
* The previous Python script also offered `--download` to write the MP3 to
|
|
21
|
-
* disk. That's intentionally dropped here: the agent flow never used it (the
|
|
22
|
-
* audio URL is persisted in cloud) and removing local file I/O keeps the
|
|
23
|
-
* handler stateless.
|
|
24
|
-
*/
|
|
25
|
-
import type { HandlerContext, HandlerInput } from './index.js';
|
|
26
|
-
export declare function genVoice(input: HandlerInput, ctxIn: HandlerContext): Promise<void>;
|
package/dist/handlers/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handler registry — maps `entry.handler` strings to their implementation.
|
|
3
|
-
*
|
|
4
|
-
* Only `entry.type` in ('http' | 'builtin') uses this registry; python
|
|
5
|
-
* skills go through spawn() in runner.ts and bypass handlers entirely.
|
|
6
|
-
*/
|
|
7
|
-
import type { AuthPreflight } from '../auth/ensure.js';
|
|
8
|
-
export type HandlerInput = Record<string, unknown>;
|
|
9
|
-
export interface HandlerContext {
|
|
10
|
-
/** ISO-style skill name from the registry (e.g. `gen-image`). Used for x-invoke-skill. */
|
|
11
|
-
skillName: string;
|
|
12
|
-
/**
|
|
13
|
-
* Credential resolved by the dispatcher's preflight (runner.ts). Handlers pass
|
|
14
|
-
* `auth.token` into resolveHttpContext so the device flow can't run twice for
|
|
15
|
-
* a single invocation.
|
|
16
|
-
*/
|
|
17
|
-
auth?: AuthPreflight;
|
|
18
|
-
}
|
|
19
|
-
export type SkillHandler = (input: HandlerInput, ctx: HandlerContext) => Promise<void>;
|
|
20
|
-
export declare const HANDLERS: Record<string, SkillHandler>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared helpers for TS skill handlers.
|
|
3
|
-
*
|
|
4
|
-
* These were previously copy-pasted across gen-image / gen-video /
|
|
5
|
-
* gen-digital-human / gen-voice. Centralizing them keeps argument coercion and
|
|
6
|
-
* image-input resolution identical across every atomic generator.
|
|
7
|
-
*
|
|
8
|
-
* Lives under handlers/ (not src/ root) so the compiled `dist/handlers/shared.js`
|
|
9
|
-
* travels with the rest of the handler bundle when ab-agent copies `dist/`.
|
|
10
|
-
*/
|
|
11
|
-
/** Truthy check tolerant of CLI string values (`--flag` → true, `--flag true` → 'true'). */
|
|
12
|
-
export declare function isTrue(value: unknown): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Coerce a flag value into a finite number, or `undefined` when absent/empty.
|
|
15
|
-
* Throws SkillError on a non-numeric value so callers fail fast with a clear msg.
|
|
16
|
-
*/
|
|
17
|
-
export declare function toNumber(value: unknown, name: string): number | undefined;
|
|
18
|
-
/** Coerce a repeatable flag (string | string[] | undefined) into a string array. */
|
|
19
|
-
export declare function toStringArray(value: unknown): string[];
|
|
20
|
-
/**
|
|
21
|
-
* Resolve an image reference into a value the backend accepts:
|
|
22
|
-
* - http(s) URLs and data: URIs pass through unchanged
|
|
23
|
-
* - local file paths are read and base64-encoded into a `data:<mime>;base64,…` URI
|
|
24
|
-
* Throws SkillError when a local path does not exist or is not a file.
|
|
25
|
-
*/
|
|
26
|
-
export declare function resolveImageInput(pathOrUrl: string): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* template-authoring skill → `remixmate template init`.
|
|
3
|
-
*
|
|
4
|
-
* Agent hosts call skills as `remixmate template-authoring --dir X [--force]`;
|
|
5
|
-
* this handler is a thin adapter so both entry points share one implementation.
|
|
6
|
-
* Purely local (auth: none): fetches the starter via npm, no ab-api calls.
|
|
7
|
-
*/
|
|
8
|
-
import type { HandlerContext, HandlerInput } from './index.js';
|
|
9
|
-
export declare function templateInit(input: HandlerInput, _ctx: HandlerContext): Promise<void>;
|
|
10
|
-
export default templateInit;
|
package/dist/http.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared HTTP helpers for ab-api endpoints.
|
|
3
|
-
*
|
|
4
|
-
* Centralizes the auth contract (X-Priv-Token + x-invoke-skill / x-invoke-agent /
|
|
5
|
-
* x-conversation-id), business-code error handling (result.code != 0), and the
|
|
6
|
-
* env var resolution order that every Python skill used to duplicate.
|
|
7
|
-
*
|
|
8
|
-
* Token resolution order (high → low), shared with the CLI auth commands via
|
|
9
|
-
* src/auth/resolve.ts:
|
|
10
|
-
* 1. opts.privateToken — caller override (maps to --token/--priv-token)
|
|
11
|
-
* 2. process.env.PRIV_TOKEN — process env (CI / agent-embedded hosts)
|
|
12
|
-
* 3. Credential_Store[apiBaseUrl] — written by `remixmate login`
|
|
13
|
-
* (none) → throws SkillError — non-interactive failure
|
|
14
|
-
*
|
|
15
|
-
* Base URL resolution:
|
|
16
|
-
* 1. opts.apiBaseUrl — caller override
|
|
17
|
-
* 2. process.env.MM_API_BASE_URL — process env (point at local/staging here)
|
|
18
|
-
* 3. process.env.MM_BACKEND_API_URL — ab-agent's convention (back-compat)
|
|
19
|
-
* 4. https://api.remixmate.ai/api — production default (zero-config)
|
|
20
|
-
*/
|
|
21
|
-
import { type Billing } from './billing.js';
|
|
22
|
-
export { SkillError, EXIT } from './errors.js';
|
|
23
|
-
/**
|
|
24
|
-
* Resolve the ab-api base URL the same way for authenticated and device-flow calls.
|
|
25
|
-
*
|
|
26
|
-
* `MM_BACKEND_API_URL` is honored because several Python skills already fall back
|
|
27
|
-
* to it (registry_loader, render_job_client, _vod_polling). Since runner.ts now
|
|
28
|
-
* injects the resolved base URL into those child processes, leaving it out here
|
|
29
|
-
* would let a prod default silently override an ab-agent-injected backend.
|
|
30
|
-
*/
|
|
31
|
-
export declare function resolveApiBaseUrl(flag?: string): string;
|
|
32
|
-
export interface HttpContext {
|
|
33
|
-
apiBaseUrl: string;
|
|
34
|
-
privateToken: string;
|
|
35
|
-
skillName: string;
|
|
36
|
-
agentName?: string;
|
|
37
|
-
conversationId?: string;
|
|
38
|
-
}
|
|
39
|
-
export declare function resolveHttpContext(skillName: string, opts?: {
|
|
40
|
-
apiBaseUrl?: string;
|
|
41
|
-
privateToken?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Token already resolved by the dispatcher's auth preflight (runner.ts).
|
|
44
|
-
* Reusing it avoids a second credential-store read — and, more importantly,
|
|
45
|
-
* a second device-flow attempt — per skill invocation.
|
|
46
|
-
*/
|
|
47
|
-
preflightToken?: string;
|
|
48
|
-
}): Promise<HttpContext>;
|
|
49
|
-
export interface MmResponse<T = unknown> {
|
|
50
|
-
code: number;
|
|
51
|
-
msg?: string;
|
|
52
|
-
data?: T;
|
|
53
|
-
/** Present only on responses that charged credits — see billing.ts. */
|
|
54
|
-
billing?: Billing;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* POST JSON to ab-api and return the parsed business payload.
|
|
58
|
-
* Throws SkillError on HTTP errors or business code != 0.
|
|
59
|
-
*/
|
|
60
|
-
export declare function mmPost<T = unknown>(ctx: HttpContext, pathOrUrl: string, body: unknown, opts?: {
|
|
61
|
-
timeoutMs?: number;
|
|
62
|
-
}): Promise<T>;
|
|
63
|
-
/**
|
|
64
|
-
* Generic polling helper. Invokes `probe()` immediately, then every
|
|
65
|
-
* `intervalMs`, until it returns a non-null value or `timeoutMs` elapses.
|
|
66
|
-
* Probing first (rather than sleeping first) avoids a wasted initial interval
|
|
67
|
-
* when the backend job is already complete.
|
|
68
|
-
*/
|
|
69
|
-
export declare function pollUntil<T>(probe: () => Promise<T | null>, opts?: {
|
|
70
|
-
intervalMs?: number;
|
|
71
|
-
timeoutMs?: number;
|
|
72
|
-
}): Promise<T>;
|
package/dist/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* remixmate — public library exports.
|
|
3
|
-
*
|
|
4
|
-
* The CLI entrypoint lives in `cli.ts` (`bin: remixmate`). This file is the
|
|
5
|
-
* library surface for type-sharing consumers; the published npm package
|
|
6
|
-
* exposes it via `main: dist/index.js` / `types: dist/index.d.ts`.
|
|
7
|
-
*/
|
|
8
|
-
export { loadSkills, findSkill, SKILLS_DIR } from './registry.js';
|
|
9
|
-
export type { SkillDef, SkillEntry } from './registry.js';
|
package/dist/install.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `remixmate install` / `remixmate uninstall` — 把包内 skills/ 铺进 agent 宿主。
|
|
3
|
-
*
|
|
4
|
-
* 为什么需要一条命令,而不是让站点给出 `cp -R "$(npm root -g)/…/skills/." ~/.claude/skills/`:
|
|
5
|
-
*
|
|
6
|
-
* 1. 目标已经不止一个。Claude Code 与 Codex 现在用同一套 SKILL.md 格式
|
|
7
|
-
* (Codex 装到 $CODEX_HOME/skills/<name>),手工 cp 的心智成本直接翻倍。
|
|
8
|
-
* 2. 拷贝出去的副本没有主人。`npm update -g` 之后包升了级、副本停在旧版;
|
|
9
|
-
* `npm uninstall -g` 之后副本原地变成孤儿。两种都是静默的 —— 本项目作者机器上
|
|
10
|
-
* 就留着一批 5 月建的、指向早已不存在路径的 skill 目录,没有任何东西负责清理。
|
|
11
|
-
*
|
|
12
|
-
* 所以这里的安装是**受管**的:每个宿主的 skills 目录下写一份装机回执
|
|
13
|
-
* (.remixmate-install.json),记下版本、来源与这次铺下去的 skill 名单。升级照名单
|
|
14
|
-
* 覆盖、卸载照名单删除、doctor 照名单比对版本 —— 三件事都不靠猜目录里哪些是我们的。
|
|
15
|
-
*
|
|
16
|
-
* 刻意不做的两件事:
|
|
17
|
-
* - 不挂 npm postinstall。`npm i -g` 时往 ~/.claude、~/.codex 写东西太越界,
|
|
18
|
-
* 且 `--ignore-scripts` 下会静默失效。安装必须是用户显式发起的动作。
|
|
19
|
-
* - 不用软链。指向 $(npm root -g) 看着优雅,但 node 版本管理器一切换路径就变,
|
|
20
|
-
* 全部断掉且极难排查。拷贝 + 回执 + doctor 漂移检查更稳。
|
|
21
|
-
*/
|
|
22
|
-
export declare const INSTALL_VERB = "install";
|
|
23
|
-
export declare const UNINSTALL_VERB = "uninstall";
|
|
24
|
-
export type HostId = 'claude' | 'codex' | 'workbuddy' | 'codebuddy' | 'trae';
|
|
25
|
-
interface Host {
|
|
26
|
-
id: HostId | 'custom';
|
|
27
|
-
label: string;
|
|
28
|
-
/** skill 的父目录 —— 安装写到 <skillsDir>/<skill-name>/。 */
|
|
29
|
-
skillsDir: string;
|
|
30
|
-
}
|
|
31
|
-
/** 已检测到、且**有用户级位置**的宿主。 */
|
|
32
|
-
export declare function detectHosts(): Host[];
|
|
33
|
-
/**
|
|
34
|
-
* 检测到了、但只能项目级安装的宿主(当前只有 Trae)。
|
|
35
|
-
*
|
|
36
|
-
* 单独拎出来是为了别把它们**静默**跳过:用户装了 Trae 却在全局 install 的输出里
|
|
37
|
-
* 完全看不到它,只会以为这个 CLI 不支持 —— 正是这次 WorkBuddy 的翻车方式。
|
|
38
|
-
*/
|
|
39
|
-
export declare function projectOnlyHosts(): HostId[];
|
|
40
|
-
export declare function packageVersion(): string;
|
|
41
|
-
export declare function installUsage(): void;
|
|
42
|
-
export declare function uninstallUsage(): void;
|
|
43
|
-
export declare function runInstall(argv: string[]): number;
|
|
44
|
-
export declare function runUninstall(argv: string[]): number;
|
|
45
|
-
export interface InstallState {
|
|
46
|
-
label: string;
|
|
47
|
-
skillsDir: string;
|
|
48
|
-
/** 回执里的版本;null = 该宿主下没有本 CLI 的安装。 */
|
|
49
|
-
installedVersion: string | null;
|
|
50
|
-
/** 当前包的版本,供报告直接引用。 */
|
|
51
|
-
currentVersion: string;
|
|
52
|
-
/** 回执版本与当前包版本不一致。 */
|
|
53
|
-
drifted: boolean;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* 供 doctor 使用:每个宿主的安装状态。
|
|
57
|
-
*
|
|
58
|
-
* 漂移是这套方案唯一的静默失败模式 —— `npm update -g` 只动包,不动铺出去的副本,
|
|
59
|
-
* 用户会拿着旧 SKILL.md 打新后端。doctor 是「为什么跑不起来」的统一入口,检查放这里。
|
|
60
|
-
*/
|
|
61
|
-
export declare function installStates(): InstallState[];
|
|
62
|
-
/**
|
|
63
|
-
* 首次使用提示:检测到了宿主、但还没跑过 `remixmate install`(或装的是旧版)时返回一行提示,
|
|
64
|
-
* 否则 null。
|
|
65
|
-
*
|
|
66
|
-
* 不用 postinstall 做这件事:npm 7+ 默认吞掉生命周期脚本的输出,而在安装期往用户家目录
|
|
67
|
-
* 写文件太侵入。改为在用户/agent 一定会看到的地方(--list、--help 页脚、template init 的
|
|
68
|
-
* 下一步、doctor)提示。纯本地读文件,不发网络请求。
|
|
69
|
-
*/
|
|
70
|
-
export declare function skillInstallHint(states?: InstallState[]): string | null;
|
|
71
|
-
export {};
|