codiedev 0.9.85 → 0.9.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/pack.d.ts +14 -1
- package/dist/commands/pack.js +78 -2
- package/package.json +1 -1
package/dist/commands/pack.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ export interface PackArgs {
|
|
|
21
21
|
out?: string;
|
|
22
22
|
git?: boolean;
|
|
23
23
|
manifest?: boolean;
|
|
24
|
+
/** publish / apply --publish: which channel (default stable). */
|
|
25
|
+
channel?: "stable" | "beta" | "alpha";
|
|
26
|
+
/** apply: publish the draft afterwards. */
|
|
27
|
+
publish?: boolean;
|
|
24
28
|
}
|
|
25
29
|
export declare function parsePackArgs(args: string[]): PackArgs;
|
|
26
30
|
/** Download a pack's files (SIG-127) into the blob cache, verified by sha256. */
|
|
@@ -54,4 +58,13 @@ export declare function runExport(config: CodiedevConfig, args: PackArgs): Promi
|
|
|
54
58
|
commit?: string;
|
|
55
59
|
}>;
|
|
56
60
|
export declare function runApply(config: CodiedevConfig, args: PackArgs): Promise<Record<string, unknown>>;
|
|
57
|
-
export
|
|
61
|
+
export interface PublishResult {
|
|
62
|
+
slug: string;
|
|
63
|
+
channel: string;
|
|
64
|
+
version: number;
|
|
65
|
+
unchanged: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** `codiedev pack publish <slug> [--channel stable|beta|alpha]`: snapshot the
|
|
68
|
+
* draft onto a channel. Re-running with no changes publishes nothing. */
|
|
69
|
+
export declare function runPublish(config: CodiedevConfig, args: PackArgs): Promise<PublishResult>;
|
|
70
|
+
export declare const PACK_HELP = "Usage:\n codiedev pack list Packs assigned to your team\n codiedev pack install [slug] [--harness claude,codex,copilot,cursor,codie,pi] [--dry-run] [--json] [--quiet]\n Install one pack, or every pack that applies\n codiedev pack status [--json] Installed packs and whether they're up to date\n codiedev pack export <slug> --out <dir> [--git] [--manifest]\n Write the pack as a Claude-format plugin folder plus\n .claude-plugin/marketplace.json (commit it for CI).\n --git inits the folder and commits; --manifest writes\n an editable <slug>.pack.md instead\n codiedev pack apply <pack.md> [--publish] [--channel stable|beta|alpha] [--dry-run]\n Create or update a pack from a pack.md\n (--publish then publishes it, see below)\n codiedev pack publish <slug> [--channel stable|beta|alpha]\n Publish the pack's draft to a channel (default\n stable). Nothing happens when it hasn't changed.\n\nFiles (scripts, PDFs, a runner folder): list them under \"## Files\" in pack.md,\none \"- <path in pack> <- <local path>\" per line (local paths are relative to\nthe pack.md; \".\" is the pack root):\n\n ## Files\n\n - runner <- ~/.claude/runner\n - skills/healthcare-scan <- ~/.claude/skills/healthcare-scan\n\n`pack apply` uploads them (admins and team managers; 15MB per file, 50MB per\npack; caches, .git and hidden files are skipped). Without a \"## Files\"\nsection the pack's files are left alone. In skills, point at files relative to\nthe skill's folder, or use ${CLAUDE_PLUGIN_ROOT}/runner/...: Codiedev swaps in the\nreal path for Codex, Copilot, Cursor, pi and Codie.\n\nCursor: packs are copied to ~/.cursor/plugins/local/codiedev-<slug>/. A Cursor\nteam admin can disable \"user local plugin imports\"; then Cursor ignores them.\n\nAuto-update: session starts run `codiedev pack install --quiet` in the background\nabout once an hour. Opt out with CODIEDEV_PACK_AUTOSYNC=0.\n\nHooks for specific skills only: codiedev hook-gate --skills a,b --cmd-b64 <base64url of the command>\n(the pack editor writes this; the command runs via /bin/sh, or cmd.exe on Windows)\n\nCI: set CODIEDEV_TOKEN to a pack CI key (cdvci_\u2026, from the pack's page in the portal).\nNo `codiedev connect` or config file is needed. CI mode (a cdvci_ key, or CI=true)\nnever auto-syncs, reports or prunes, installs the one pack the key can see, defaults\n--harness to claude when it's on PATH, and exits non-zero unless every requested tool\ngot the pack. Skills from a pack are /<pack-slug>:<skill> in Claude Code.\n\n GitLab CI (.gitlab-ci.yml; add CODIEDEV_TOKEN and ANTHROPIC_API_KEY as masked\n CI/CD variables):\n pack-scan:\n image: node:22\n script:\n - npm i -g codiedev @anthropic-ai/claude-code\n - codiedev pack install --harness claude\n - claude -p \"/platform-starter:healthcare-scan\" --output-format text\n\n GitHub Actions (repository secrets CODIEDEV_TOKEN and ANTHROPIC_API_KEY):\n - uses: actions/setup-node@v4\n with: { node-version: 22 }\n - run: npm i -g codiedev @anthropic-ai/claude-code\n - run: codiedev pack install --harness claude\n env:\n CODIEDEV_TOKEN: ${{ secrets.CODIEDEV_TOKEN }}\n - run: claude -p \"/platform-starter:healthcare-scan\" --output-format text\n env:\n ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n\n Keep a pack up to date from its repo (GitLab; on merges to main). Use a\n personal Codiedev token of a pack owner (portal \u2192 Integrations \u2192 CLI tokens) as a\n masked CODIEDEV_TOKEN: pack CI keys can only install, not publish.\n pack-release:\n image: node:22\n rules: [{ if: '$CI_COMMIT_BRANCH == \"main\"' }]\n script:\n - npm i -g codiedev\n - codiedev pack apply packs/platform-starter.pack.md --publish\n This ships the pack's files, agents, hooks and skill list. Edits to a skill's\n own SKILL.md still go to the library with `codiedev push`.\n\n Or vendor the plugin into the repo instead of installing at build time:\n codiedev pack export <slug> --out .codiedev/packs";
|
package/dist/commands/pack.js
CHANGED
|
@@ -46,6 +46,7 @@ exports.commitExport = commitExport;
|
|
|
46
46
|
exports.exportPluginFolder = exportPluginFolder;
|
|
47
47
|
exports.runExport = runExport;
|
|
48
48
|
exports.runApply = runApply;
|
|
49
|
+
exports.runPublish = runPublish;
|
|
49
50
|
const install_1 = require("../packs/install");
|
|
50
51
|
const harnesses_1 = require("../packs/harnesses");
|
|
51
52
|
const manifest_1 = require("../packs/manifest");
|
|
@@ -103,8 +104,12 @@ const USAGE = `Usage:
|
|
|
103
104
|
.claude-plugin/marketplace.json (commit it for CI).
|
|
104
105
|
--git inits the folder and commits; --manifest writes
|
|
105
106
|
an editable <slug>.pack.md instead
|
|
106
|
-
codiedev pack apply <pack.md> [--dry-run]
|
|
107
|
+
codiedev pack apply <pack.md> [--publish] [--channel stable|beta|alpha] [--dry-run]
|
|
107
108
|
Create or update a pack from a pack.md
|
|
109
|
+
(--publish then publishes it, see below)
|
|
110
|
+
codiedev pack publish <slug> [--channel stable|beta|alpha]
|
|
111
|
+
Publish the pack's draft to a channel (default
|
|
112
|
+
stable). Nothing happens when it hasn't changed.
|
|
108
113
|
|
|
109
114
|
Files (scripts, PDFs, a runner folder): list them under "## Files" in pack.md,
|
|
110
115
|
one "- <path in pack> <- <local path>" per line (local paths are relative to
|
|
@@ -156,8 +161,25 @@ got the pack. Skills from a pack are /<pack-slug>:<skill> in Claude Code.
|
|
|
156
161
|
env:
|
|
157
162
|
ANTHROPIC_API_KEY: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
158
163
|
|
|
164
|
+
Keep a pack up to date from its repo (GitLab; on merges to main). Use a
|
|
165
|
+
personal Codiedev token of a pack owner (portal → Integrations → CLI tokens) as a
|
|
166
|
+
masked CODIEDEV_TOKEN: pack CI keys can only install, not publish.
|
|
167
|
+
pack-release:
|
|
168
|
+
image: node:22
|
|
169
|
+
rules: [{ if: '$CI_COMMIT_BRANCH == "main"' }]
|
|
170
|
+
script:
|
|
171
|
+
- npm i -g codiedev
|
|
172
|
+
- codiedev pack apply packs/platform-starter.pack.md --publish
|
|
173
|
+
This ships the pack's files, agents, hooks and skill list. Edits to a skill's
|
|
174
|
+
own SKILL.md still go to the library with \`codiedev push\`.
|
|
175
|
+
|
|
159
176
|
Or vendor the plugin into the repo instead of installing at build time:
|
|
160
177
|
codiedev pack export <slug> --out .codiedev/packs`;
|
|
178
|
+
function parseChannel(value) {
|
|
179
|
+
if (value === "stable" || value === "beta" || value === "alpha")
|
|
180
|
+
return value;
|
|
181
|
+
throw new Error(`--channel must be stable, beta or alpha (got ${value})`);
|
|
182
|
+
}
|
|
161
183
|
function parsePackArgs(args) {
|
|
162
184
|
const out = { dryRun: false, json: false };
|
|
163
185
|
const positional = [];
|
|
@@ -175,6 +197,15 @@ function parsePackArgs(args) {
|
|
|
175
197
|
out.git = true;
|
|
176
198
|
else if (a === "--manifest")
|
|
177
199
|
out.manifest = true;
|
|
200
|
+
else if (a === "--publish")
|
|
201
|
+
out.publish = true;
|
|
202
|
+
else if (a === "--channel") {
|
|
203
|
+
if (i + 1 >= args.length)
|
|
204
|
+
throw new Error("--channel needs stable, beta or alpha");
|
|
205
|
+
out.channel = parseChannel(args[++i]);
|
|
206
|
+
}
|
|
207
|
+
else if (a.startsWith("--channel="))
|
|
208
|
+
out.channel = parseChannel(a.slice("--channel=".length));
|
|
178
209
|
else if (a === "--out" || a === "-o") {
|
|
179
210
|
if (i + 1 >= args.length)
|
|
180
211
|
throw new Error("--out needs a directory");
|
|
@@ -456,7 +487,7 @@ async function runPack(args) {
|
|
|
456
487
|
console.error(USAGE);
|
|
457
488
|
process.exit(1);
|
|
458
489
|
}
|
|
459
|
-
if (!parsed.sub || !["list", "ls", "install", "status", "export", "apply"].includes(parsed.sub)) {
|
|
490
|
+
if (!parsed.sub || !["list", "ls", "install", "status", "export", "apply", "publish"].includes(parsed.sub)) {
|
|
460
491
|
console.error(USAGE);
|
|
461
492
|
process.exit(parsed.sub ? 1 : 0);
|
|
462
493
|
}
|
|
@@ -476,6 +507,8 @@ async function runPack(args) {
|
|
|
476
507
|
await runExport(config, parsed);
|
|
477
508
|
else if (parsed.sub === "apply")
|
|
478
509
|
await runApply(config, parsed);
|
|
510
|
+
else if (parsed.sub === "publish")
|
|
511
|
+
await runPublish(config, parsed);
|
|
479
512
|
else
|
|
480
513
|
await runStatus(config, parsed.json, {}, { prune: !parsed.noPrune });
|
|
481
514
|
});
|
|
@@ -684,8 +717,51 @@ async function runApply(config, args) {
|
|
|
684
717
|
}
|
|
685
718
|
}
|
|
686
719
|
}
|
|
720
|
+
if (args.publish && typeof res.slug === "string") {
|
|
721
|
+
const published = await runPublish(config, { ...args, slug: res.slug, json: false });
|
|
722
|
+
if (args.json)
|
|
723
|
+
return { ...res, published };
|
|
724
|
+
}
|
|
687
725
|
return res;
|
|
688
726
|
}
|
|
727
|
+
/** `codiedev pack publish <slug> [--channel stable|beta|alpha]`: snapshot the
|
|
728
|
+
* draft onto a channel. Re-running with no changes publishes nothing. */
|
|
729
|
+
async function runPublish(config, args) {
|
|
730
|
+
if (!args.slug)
|
|
731
|
+
throw new Error("Usage: codiedev pack publish <slug> [--channel stable|beta|alpha]");
|
|
732
|
+
if (!(0, manifest_2.isSafeSegment)(args.slug))
|
|
733
|
+
throw new Error(`Not a pack slug: ${args.slug}`);
|
|
734
|
+
const channel = args.channel ?? "stable";
|
|
735
|
+
if (args.dryRun) {
|
|
736
|
+
console.log(`Dry run — would publish ${args.slug}'s draft to ${channel}.`);
|
|
737
|
+
return { slug: args.slug, channel, version: 0, unchanged: true };
|
|
738
|
+
}
|
|
739
|
+
let res;
|
|
740
|
+
try {
|
|
741
|
+
res = await (0, shared_1.apiRequest)("POST", "/api/cli/packs/publish", { config, body: { slug: args.slug, channel } });
|
|
742
|
+
}
|
|
743
|
+
catch (error) {
|
|
744
|
+
const e = error;
|
|
745
|
+
if (e.status === 404)
|
|
746
|
+
throw new Error(`Pack not found: ${args.slug}`);
|
|
747
|
+
if (e.status === 403)
|
|
748
|
+
throw new Error(`You can't publish ${args.slug} (only its owners and admins can)`);
|
|
749
|
+
throw new Error(e.message);
|
|
750
|
+
}
|
|
751
|
+
const out = {
|
|
752
|
+
slug: typeof res.slug === "string" ? res.slug : args.slug,
|
|
753
|
+
channel,
|
|
754
|
+
version: typeof res.version === "number" ? res.version : 0,
|
|
755
|
+
unchanged: res.unchanged === true,
|
|
756
|
+
};
|
|
757
|
+
if (args.json)
|
|
758
|
+
console.log(JSON.stringify(out));
|
|
759
|
+
else if (out.unchanged)
|
|
760
|
+
console.log(`· ${out.slug} v${out.version} is already on ${channel} (no changes to publish)`);
|
|
761
|
+
else
|
|
762
|
+
console.log(`✓ Published ${out.slug} v${out.version} to ${channel}. Teams on ${channel} get it at their next sync.`);
|
|
763
|
+
return out;
|
|
764
|
+
}
|
|
689
765
|
function formatBytes(n) {
|
|
690
766
|
return n >= 1024 * 1024 ? `${(n / (1024 * 1024)).toFixed(1)}MB` : n >= 1024 ? `${Math.round(n / 1024)}KB` : `${n}B`;
|
|
691
767
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codiedev",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.86",
|
|
4
4
|
"description": "Connect Claude Code, Codex, Cursor, OpenCode, or VS Code Copilot to Codiedev for team session capture and artifact collaboration — and run the governed Codie harness",
|
|
5
5
|
"bin": {
|
|
6
6
|
"codiedev": "dist/cli.js",
|