@mirage-cli/contentdynamite 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @mirage-cli/contentdynamite
2
+
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - The product's own `ve-dynamite` CLI against the Content Dynamite Workers API, replacing the 0.1.0 port of the Python CLI. First npm release.
package/README.md CHANGED
@@ -1,3 +1,27 @@
1
- # Temporary Holding Version
1
+ # @mirage-cli/contentdynamite
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Thin Mirage wrapper around [`@mirage-cli/contentdynamite-cli`](../contentdynamite-cli), exposing the global `ve-dynamite` command for mirage runtimes and Cloudflare Workers.
4
+
5
+ ## Use
6
+
7
+ ```ts
8
+ import { contentdynamiteResource } from "@mirage-cli/contentdynamite";
9
+
10
+ workspace.addMount("/dynamite/", await contentdynamiteResource());
11
+ ```
12
+
13
+ - `buildProgram()` returns one cached Commander program, built in the CLI's mount mode with `@mirage-cli/core`'s `reportCost`, so paid work shows up in the host's cost telemetry.
14
+ - `contentdynamiteCommand` is ready for a Mirage `command({ fn })` registration.
15
+ - `contentdynamiteResource()` lazily imports Mirage core and returns a command-only remote resource.
16
+
17
+ Auth comes from `VE_DYNAMITE_TOKEN` (a `ved_` API token), which the host should inject per call. `VE_DYNAMITE_API_URL` picks the API host; mount mode has no `--url` flag, so a host that pins this variable pins where the token goes. Mount mode also has no `login` and no `watch`: agents poll `get`.
18
+
19
+ ## Access boundary
20
+
21
+ Reads, safe on every mount: `whoami`, `tokens list`, `profiles list|get`, `icp show|export`, `categories list`, `design-system show`, `articles get|list|parts|revisions|download|export|embed-audit|provenance-audit|research-prompt`, `revisions list|get`, `batches list|get`, `gbp list|get|image-options`, `landing-pages get|list|versions|research|deck|export|audit`, `images status`.
22
+
23
+ Paid, real money per item, gate behind a write mode: `articles write|reject`, `articles clean-provenance --rewrite`, `batches create`, `gbp write|batch|regenerate`, `landing-pages write|reiterate|new-version|fix-images`, `profiles create`, `icp regenerate`, `design-system set|rescan`, `images edit`, `evals run --judge`.
24
+
25
+ Changes stored content, gate behind a write mode: `profiles update`, `icp update`, `categories add`, `articles update|strip-embeds|clean-provenance`, `revisions verdict`, `gbp update`, `landing-pages update|criteria|fix-placeholders|rebrand`, `images commit`, `evals run` (it stores the score).
26
+
27
+ Recommend blocking outright: every `delete`, `design-system clear` and `upload` (permanent, matching the product's own MCP server), `users` (account administration), and `tokens create|revoke` (a new secret in the transcript, or revoking the mount's own token). Also block `--token`, which swaps in another account's credential.
@@ -0,0 +1,9 @@
1
+ import { Command } from 'commander';
2
+ import { MirageCommandFn } from '@mirage-cli/core';
3
+ import { Resource } from '@struktoai/mirage-core';
4
+
5
+ declare function buildProgram(): Command;
6
+ declare const contentdynamiteCommand: MirageCommandFn;
7
+ declare function contentdynamiteResource(): Promise<Resource>;
8
+
9
+ export { buildProgram, contentdynamiteCommand, contentdynamiteResource };
package/dist/index.js ADDED
@@ -0,0 +1,53 @@
1
+ // src/index.ts
2
+ import { buildProgram as buildContentDynamiteProgram } from "@mirage-cli/contentdynamite-cli";
3
+ import {
4
+ reportCost,
5
+ toMirageCommandFn
6
+ } from "@mirage-cli/core";
7
+ var cachedProgram = null;
8
+ function buildProgram() {
9
+ if (cachedProgram === null) cachedProgram = buildContentDynamiteProgram({ mount: true, reportCost });
10
+ return cachedProgram;
11
+ }
12
+ var cachedFn = null;
13
+ var contentdynamiteCommand = async (accessor, paths, texts, opts) => {
14
+ if (cachedFn === null) cachedFn = toMirageCommandFn(buildProgram());
15
+ return cachedFn(accessor, paths, texts, opts);
16
+ };
17
+ var cachedResource = null;
18
+ async function contentdynamiteResource() {
19
+ if (cachedResource !== null) return cachedResource;
20
+ const mirage = await import("@struktoai/mirage-core");
21
+ const fn = toMirageCommandFn(buildProgram(), {
22
+ IOResult: mirage.IOResult
23
+ });
24
+ const commands = [
25
+ new mirage.RegisteredCommand({
26
+ name: "ve-dynamite",
27
+ resource: null,
28
+ spec: new mirage.CommandSpec({
29
+ rest: new mirage.Operand({ kind: mirage.OperandKind.TEXT }),
30
+ description: "Content Dynamite CLI (articles, GBP posts and landing pages spend real money)"
31
+ }),
32
+ fn
33
+ })
34
+ ];
35
+ cachedResource = {
36
+ kind: "contentdynamite",
37
+ isRemote: true,
38
+ prompt: "Content Dynamite CLI. Auth via VE_DYNAMITE_TOKEN (a ved_ API token); VE_DYNAMITE_API_URL picks the API. Reads cover profiles, ICP, categories, design systems, articles, revisions, batches, GBP posts, landing pages and image jobs. `articles write|reject`, `batches create`, `gbp write|batch|regenerate`, `landing-pages write|reiterate|new-version|fix-images`, `profiles create`, `icp regenerate`, `design-system set|rescan`, `images edit` and `evals run --judge` spend real money per item and should require a write-mode mount. Generation is asynchronous and there is no watch: poll `get` about every 10 seconds. Use `ve-dynamite --help` for usage.",
39
+ async open() {
40
+ },
41
+ async close() {
42
+ },
43
+ commands() {
44
+ return commands;
45
+ }
46
+ };
47
+ return cachedResource;
48
+ }
49
+ export {
50
+ buildProgram,
51
+ contentdynamiteCommand,
52
+ contentdynamiteResource
53
+ };
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "@mirage-cli/contentdynamite",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "The Content Dynamite CLI (ve-dynamite) in its mount mode as an importable Mirage and Cloudflare Worker command.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "dist/",
18
+ "README.md",
19
+ "CHANGELOG.md"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsup src/index.ts --format esm --target node18 --dts --external @mirage-cli/core --external @mirage-cli/contentdynamite-cli --external commander --external @struktoai/mirage-core --clean --silent",
23
+ "test": "bun test --reporter=dots",
24
+ "typecheck": "tsc --noEmit"
25
+ },
26
+ "dependencies": {
27
+ "@mirage-cli/core": "^0.1.11"
28
+ },
29
+ "peerDependencies": {
30
+ "@struktoai/mirage-core": ">=0.0.1",
31
+ "@mirage-cli/contentdynamite-cli": "^1.0.0"
32
+ },
33
+ "peerDependenciesMeta": {
34
+ "@struktoai/mirage-core": {
35
+ "optional": true
36
+ }
37
+ },
38
+ "devDependencies": {
39
+ "@mirage-cli/contentdynamite-cli": "^1.0.0",
40
+ "@struktoai/mirage-core": "^0.0.1",
41
+ "commander": "^14.0.3",
42
+ "tsup": "^8.5.1"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "https://github.com/alexbruf/mirage-cli.git",
50
+ "directory": "packages/contentdynamite"
51
+ },
52
+ "keywords": [
53
+ "content-dynamite",
54
+ "ve-dynamite",
55
+ "seo",
56
+ "commander",
57
+ "mirage",
58
+ "cloudflare-workers"
59
+ ],
60
+ "license": "MIT"
61
+ }