yarkr-cli 1.0.5 → 1.0.7
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/README.md +9 -9
- package/dist/yarkr.js +201 -153
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ Install skills, agents and MCP toolsets from [Yarkr](https://yarkr.com) into the
|
|
|
4
4
|
Claude Code, Codex, opencode, Cursor and more.
|
|
5
5
|
|
|
6
6
|
```sh
|
|
7
|
-
npx yarkr-cli add
|
|
8
|
-
npx yarkr-cli add
|
|
7
|
+
npx yarkr-cli add anthropics/frontend-design # a public package, no account needed (Node 22 or newer)
|
|
8
|
+
npx yarkr-cli add anthropics/webapp-testing --harness codex # pick the harnesses to write
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
With `npx`, the command is always `npx yarkr-cli …`. Installed globally (`npm install -g yarkr-cli`), it answers to
|
|
@@ -17,11 +17,11 @@ An ark is a curated set of skills, agents and toolsets hosted in the registry. `
|
|
|
17
17
|
the harness's own layout (`~/.claude/skills/…`, `~/.agents/…`, MCP configs and so on):
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
|
-
npx yarkr-cli arks
|
|
21
|
-
npx yarkr-cli sync
|
|
22
|
-
npx yarkr-cli sync
|
|
23
|
-
npx yarkr-cli sync
|
|
24
|
-
npx yarkr-cli ark
|
|
20
|
+
npx yarkr-cli arks # list public arks
|
|
21
|
+
npx yarkr-cli sync anthropics/skills # install one into this folder
|
|
22
|
+
npx yarkr-cli sync anthropics/skills -g # …or into your home directory
|
|
23
|
+
npx yarkr-cli sync anthropics/skills --harness claude-code # only write Claude Code's files
|
|
24
|
+
npx yarkr-cli ark # what your arks give you, and which version
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Signed in, a bare `npx yarkr-cli sync` installs every ark you're a member of, plus your personal ark. Run it again to
|
|
@@ -36,7 +36,7 @@ releases:
|
|
|
36
36
|
```sh
|
|
37
37
|
cd my-repo
|
|
38
38
|
npx yarkr-cli init --ark acme/engineering # optional: install a team's ark into this project
|
|
39
|
-
npx yarkr-cli add
|
|
39
|
+
npx yarkr-cli add anthropics/mcp-builder
|
|
40
40
|
git add yarkr.json yarkr.lock .yarkrrc .claude AGENTS.md && git commit
|
|
41
41
|
npx yarkr-cli sync --check # in CI: exit 1 when anything is out of date
|
|
42
42
|
```
|
|
@@ -64,4 +64,4 @@ npx yarkr-cli whoami # check who you're signed in as
|
|
|
64
64
|
In CI, store a read-only token as a secret and set `YARKR_TOKEN`. The CLI uses the public hub at `https://yarkr.com`
|
|
65
65
|
unless you point it at your own instance with `npx yarkr-cli login --registry <url>`.
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
Full command reference: [yarkr.com/docs/install-with-the-cli](https://yarkr.com/docs/install-with-the-cli) · All docs: [yarkr.com/docs](https://yarkr.com/docs)
|
package/dist/yarkr.js
CHANGED
|
@@ -1206,7 +1206,7 @@ var require_command = __commonJS({
|
|
|
1206
1206
|
"use strict";
|
|
1207
1207
|
var EventEmitter = __require("events").EventEmitter;
|
|
1208
1208
|
var childProcess = __require("child_process");
|
|
1209
|
-
var
|
|
1209
|
+
var path20 = __require("path");
|
|
1210
1210
|
var fs = __require("fs");
|
|
1211
1211
|
var process2 = __require("process");
|
|
1212
1212
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
@@ -2219,9 +2219,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2219
2219
|
let launchWithNode = false;
|
|
2220
2220
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
2221
2221
|
function findFile(baseDir, baseName) {
|
|
2222
|
-
const localBin =
|
|
2222
|
+
const localBin = path20.resolve(baseDir, baseName);
|
|
2223
2223
|
if (fs.existsSync(localBin)) return localBin;
|
|
2224
|
-
if (sourceExt.includes(
|
|
2224
|
+
if (sourceExt.includes(path20.extname(baseName))) return void 0;
|
|
2225
2225
|
const foundExt = sourceExt.find(
|
|
2226
2226
|
(ext) => fs.existsSync(`${localBin}${ext}`)
|
|
2227
2227
|
);
|
|
@@ -2239,17 +2239,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2239
2239
|
} catch {
|
|
2240
2240
|
resolvedScriptPath = this._scriptPath;
|
|
2241
2241
|
}
|
|
2242
|
-
executableDir =
|
|
2243
|
-
|
|
2242
|
+
executableDir = path20.resolve(
|
|
2243
|
+
path20.dirname(resolvedScriptPath),
|
|
2244
2244
|
executableDir
|
|
2245
2245
|
);
|
|
2246
2246
|
}
|
|
2247
2247
|
if (executableDir) {
|
|
2248
2248
|
let localFile = findFile(executableDir, executableFile);
|
|
2249
2249
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
2250
|
-
const legacyName =
|
|
2250
|
+
const legacyName = path20.basename(
|
|
2251
2251
|
this._scriptPath,
|
|
2252
|
-
|
|
2252
|
+
path20.extname(this._scriptPath)
|
|
2253
2253
|
);
|
|
2254
2254
|
if (legacyName !== this._name) {
|
|
2255
2255
|
localFile = findFile(
|
|
@@ -2260,7 +2260,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2260
2260
|
}
|
|
2261
2261
|
executableFile = localFile || executableFile;
|
|
2262
2262
|
}
|
|
2263
|
-
launchWithNode = sourceExt.includes(
|
|
2263
|
+
launchWithNode = sourceExt.includes(path20.extname(executableFile));
|
|
2264
2264
|
let proc;
|
|
2265
2265
|
if (process2.platform !== "win32") {
|
|
2266
2266
|
if (launchWithNode) {
|
|
@@ -3175,7 +3175,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3175
3175
|
* @return {Command}
|
|
3176
3176
|
*/
|
|
3177
3177
|
nameFromFilename(filename) {
|
|
3178
|
-
this._name =
|
|
3178
|
+
this._name = path20.basename(filename, path20.extname(filename));
|
|
3179
3179
|
return this;
|
|
3180
3180
|
}
|
|
3181
3181
|
/**
|
|
@@ -3189,9 +3189,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3189
3189
|
* @param {string} [path]
|
|
3190
3190
|
* @return {(string|null|Command)}
|
|
3191
3191
|
*/
|
|
3192
|
-
executableDir(
|
|
3193
|
-
if (
|
|
3194
|
-
this._executableDir =
|
|
3192
|
+
executableDir(path21) {
|
|
3193
|
+
if (path21 === void 0) return this._executableDir;
|
|
3194
|
+
this._executableDir = path21;
|
|
3195
3195
|
return this;
|
|
3196
3196
|
}
|
|
3197
3197
|
/**
|
|
@@ -3547,17 +3547,17 @@ var require_visit = __commonJS({
|
|
|
3547
3547
|
visit2.BREAK = BREAK;
|
|
3548
3548
|
visit2.SKIP = SKIP2;
|
|
3549
3549
|
visit2.REMOVE = REMOVE;
|
|
3550
|
-
function visit_(key, node2, visitor,
|
|
3551
|
-
const ctrl = callVisitor(key, node2, visitor,
|
|
3550
|
+
function visit_(key, node2, visitor, path20) {
|
|
3551
|
+
const ctrl = callVisitor(key, node2, visitor, path20);
|
|
3552
3552
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
3553
|
-
replaceNode(key,
|
|
3554
|
-
return visit_(key, ctrl, visitor,
|
|
3553
|
+
replaceNode(key, path20, ctrl);
|
|
3554
|
+
return visit_(key, ctrl, visitor, path20);
|
|
3555
3555
|
}
|
|
3556
3556
|
if (typeof ctrl !== "symbol") {
|
|
3557
3557
|
if (identity.isCollection(node2)) {
|
|
3558
|
-
|
|
3558
|
+
path20 = Object.freeze(path20.concat(node2));
|
|
3559
3559
|
for (let i = 0; i < node2.items.length; ++i) {
|
|
3560
|
-
const ci = visit_(i, node2.items[i], visitor,
|
|
3560
|
+
const ci = visit_(i, node2.items[i], visitor, path20);
|
|
3561
3561
|
if (typeof ci === "number")
|
|
3562
3562
|
i = ci - 1;
|
|
3563
3563
|
else if (ci === BREAK)
|
|
@@ -3568,13 +3568,13 @@ var require_visit = __commonJS({
|
|
|
3568
3568
|
}
|
|
3569
3569
|
}
|
|
3570
3570
|
} else if (identity.isPair(node2)) {
|
|
3571
|
-
|
|
3572
|
-
const ck = visit_("key", node2.key, visitor,
|
|
3571
|
+
path20 = Object.freeze(path20.concat(node2));
|
|
3572
|
+
const ck = visit_("key", node2.key, visitor, path20);
|
|
3573
3573
|
if (ck === BREAK)
|
|
3574
3574
|
return BREAK;
|
|
3575
3575
|
else if (ck === REMOVE)
|
|
3576
3576
|
node2.key = null;
|
|
3577
|
-
const cv = visit_("value", node2.value, visitor,
|
|
3577
|
+
const cv = visit_("value", node2.value, visitor, path20);
|
|
3578
3578
|
if (cv === BREAK)
|
|
3579
3579
|
return BREAK;
|
|
3580
3580
|
else if (cv === REMOVE)
|
|
@@ -3595,17 +3595,17 @@ var require_visit = __commonJS({
|
|
|
3595
3595
|
visitAsync.BREAK = BREAK;
|
|
3596
3596
|
visitAsync.SKIP = SKIP2;
|
|
3597
3597
|
visitAsync.REMOVE = REMOVE;
|
|
3598
|
-
async function visitAsync_(key, node2, visitor,
|
|
3599
|
-
const ctrl = await callVisitor(key, node2, visitor,
|
|
3598
|
+
async function visitAsync_(key, node2, visitor, path20) {
|
|
3599
|
+
const ctrl = await callVisitor(key, node2, visitor, path20);
|
|
3600
3600
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
3601
|
-
replaceNode(key,
|
|
3602
|
-
return visitAsync_(key, ctrl, visitor,
|
|
3601
|
+
replaceNode(key, path20, ctrl);
|
|
3602
|
+
return visitAsync_(key, ctrl, visitor, path20);
|
|
3603
3603
|
}
|
|
3604
3604
|
if (typeof ctrl !== "symbol") {
|
|
3605
3605
|
if (identity.isCollection(node2)) {
|
|
3606
|
-
|
|
3606
|
+
path20 = Object.freeze(path20.concat(node2));
|
|
3607
3607
|
for (let i = 0; i < node2.items.length; ++i) {
|
|
3608
|
-
const ci = await visitAsync_(i, node2.items[i], visitor,
|
|
3608
|
+
const ci = await visitAsync_(i, node2.items[i], visitor, path20);
|
|
3609
3609
|
if (typeof ci === "number")
|
|
3610
3610
|
i = ci - 1;
|
|
3611
3611
|
else if (ci === BREAK)
|
|
@@ -3616,13 +3616,13 @@ var require_visit = __commonJS({
|
|
|
3616
3616
|
}
|
|
3617
3617
|
}
|
|
3618
3618
|
} else if (identity.isPair(node2)) {
|
|
3619
|
-
|
|
3620
|
-
const ck = await visitAsync_("key", node2.key, visitor,
|
|
3619
|
+
path20 = Object.freeze(path20.concat(node2));
|
|
3620
|
+
const ck = await visitAsync_("key", node2.key, visitor, path20);
|
|
3621
3621
|
if (ck === BREAK)
|
|
3622
3622
|
return BREAK;
|
|
3623
3623
|
else if (ck === REMOVE)
|
|
3624
3624
|
node2.key = null;
|
|
3625
|
-
const cv = await visitAsync_("value", node2.value, visitor,
|
|
3625
|
+
const cv = await visitAsync_("value", node2.value, visitor, path20);
|
|
3626
3626
|
if (cv === BREAK)
|
|
3627
3627
|
return BREAK;
|
|
3628
3628
|
else if (cv === REMOVE)
|
|
@@ -3649,23 +3649,23 @@ var require_visit = __commonJS({
|
|
|
3649
3649
|
}
|
|
3650
3650
|
return visitor;
|
|
3651
3651
|
}
|
|
3652
|
-
function callVisitor(key, node2, visitor,
|
|
3652
|
+
function callVisitor(key, node2, visitor, path20) {
|
|
3653
3653
|
if (typeof visitor === "function")
|
|
3654
|
-
return visitor(key, node2,
|
|
3654
|
+
return visitor(key, node2, path20);
|
|
3655
3655
|
if (identity.isMap(node2))
|
|
3656
|
-
return visitor.Map?.(key, node2,
|
|
3656
|
+
return visitor.Map?.(key, node2, path20);
|
|
3657
3657
|
if (identity.isSeq(node2))
|
|
3658
|
-
return visitor.Seq?.(key, node2,
|
|
3658
|
+
return visitor.Seq?.(key, node2, path20);
|
|
3659
3659
|
if (identity.isPair(node2))
|
|
3660
|
-
return visitor.Pair?.(key, node2,
|
|
3660
|
+
return visitor.Pair?.(key, node2, path20);
|
|
3661
3661
|
if (identity.isScalar(node2))
|
|
3662
|
-
return visitor.Scalar?.(key, node2,
|
|
3662
|
+
return visitor.Scalar?.(key, node2, path20);
|
|
3663
3663
|
if (identity.isAlias(node2))
|
|
3664
|
-
return visitor.Alias?.(key, node2,
|
|
3664
|
+
return visitor.Alias?.(key, node2, path20);
|
|
3665
3665
|
return void 0;
|
|
3666
3666
|
}
|
|
3667
|
-
function replaceNode(key,
|
|
3668
|
-
const parent =
|
|
3667
|
+
function replaceNode(key, path20, node2) {
|
|
3668
|
+
const parent = path20[path20.length - 1];
|
|
3669
3669
|
if (identity.isCollection(parent)) {
|
|
3670
3670
|
parent.items[key] = node2;
|
|
3671
3671
|
} else if (identity.isPair(parent)) {
|
|
@@ -4277,10 +4277,10 @@ var require_Collection = __commonJS({
|
|
|
4277
4277
|
var createNode = require_createNode();
|
|
4278
4278
|
var identity = require_identity();
|
|
4279
4279
|
var Node = require_Node();
|
|
4280
|
-
function collectionFromPath(schema,
|
|
4280
|
+
function collectionFromPath(schema, path20, value) {
|
|
4281
4281
|
let v = value;
|
|
4282
|
-
for (let i =
|
|
4283
|
-
const k =
|
|
4282
|
+
for (let i = path20.length - 1; i >= 0; --i) {
|
|
4283
|
+
const k = path20[i];
|
|
4284
4284
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
4285
4285
|
const a = [];
|
|
4286
4286
|
a[k] = v;
|
|
@@ -4299,7 +4299,7 @@ var require_Collection = __commonJS({
|
|
|
4299
4299
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
4300
4300
|
});
|
|
4301
4301
|
}
|
|
4302
|
-
var isEmptyPath = (
|
|
4302
|
+
var isEmptyPath = (path20) => path20 == null || typeof path20 === "object" && !!path20[Symbol.iterator]().next().done;
|
|
4303
4303
|
var Collection = class extends Node.NodeBase {
|
|
4304
4304
|
constructor(type, schema) {
|
|
4305
4305
|
super(type);
|
|
@@ -4329,11 +4329,11 @@ var require_Collection = __commonJS({
|
|
|
4329
4329
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
4330
4330
|
* that already exists in the map.
|
|
4331
4331
|
*/
|
|
4332
|
-
addIn(
|
|
4333
|
-
if (isEmptyPath(
|
|
4332
|
+
addIn(path20, value) {
|
|
4333
|
+
if (isEmptyPath(path20))
|
|
4334
4334
|
this.add(value);
|
|
4335
4335
|
else {
|
|
4336
|
-
const [key, ...rest] =
|
|
4336
|
+
const [key, ...rest] = path20;
|
|
4337
4337
|
const node2 = this.get(key, true);
|
|
4338
4338
|
if (identity.isCollection(node2))
|
|
4339
4339
|
node2.addIn(rest, value);
|
|
@@ -4347,8 +4347,8 @@ var require_Collection = __commonJS({
|
|
|
4347
4347
|
* Removes a value from the collection.
|
|
4348
4348
|
* @returns `true` if the item was found and removed.
|
|
4349
4349
|
*/
|
|
4350
|
-
deleteIn(
|
|
4351
|
-
const [key, ...rest] =
|
|
4350
|
+
deleteIn(path20) {
|
|
4351
|
+
const [key, ...rest] = path20;
|
|
4352
4352
|
if (rest.length === 0)
|
|
4353
4353
|
return this.delete(key);
|
|
4354
4354
|
const node2 = this.get(key, true);
|
|
@@ -4362,8 +4362,8 @@ var require_Collection = __commonJS({
|
|
|
4362
4362
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
4363
4363
|
* `true` (collections are always returned intact).
|
|
4364
4364
|
*/
|
|
4365
|
-
getIn(
|
|
4366
|
-
const [key, ...rest] =
|
|
4365
|
+
getIn(path20, keepScalar) {
|
|
4366
|
+
const [key, ...rest] = path20;
|
|
4367
4367
|
const node2 = this.get(key, true);
|
|
4368
4368
|
if (rest.length === 0)
|
|
4369
4369
|
return !keepScalar && identity.isScalar(node2) ? node2.value : node2;
|
|
@@ -4381,8 +4381,8 @@ var require_Collection = __commonJS({
|
|
|
4381
4381
|
/**
|
|
4382
4382
|
* Checks if the collection includes a value with the key `key`.
|
|
4383
4383
|
*/
|
|
4384
|
-
hasIn(
|
|
4385
|
-
const [key, ...rest] =
|
|
4384
|
+
hasIn(path20) {
|
|
4385
|
+
const [key, ...rest] = path20;
|
|
4386
4386
|
if (rest.length === 0)
|
|
4387
4387
|
return this.has(key);
|
|
4388
4388
|
const node2 = this.get(key, true);
|
|
@@ -4392,8 +4392,8 @@ var require_Collection = __commonJS({
|
|
|
4392
4392
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
4393
4393
|
* boolean to add/remove the item from the set.
|
|
4394
4394
|
*/
|
|
4395
|
-
setIn(
|
|
4396
|
-
const [key, ...rest] =
|
|
4395
|
+
setIn(path20, value) {
|
|
4396
|
+
const [key, ...rest] = path20;
|
|
4397
4397
|
if (rest.length === 0) {
|
|
4398
4398
|
this.set(key, value);
|
|
4399
4399
|
} else {
|
|
@@ -6908,9 +6908,9 @@ var require_Document = __commonJS({
|
|
|
6908
6908
|
this.contents.add(value);
|
|
6909
6909
|
}
|
|
6910
6910
|
/** Adds a value to the document. */
|
|
6911
|
-
addIn(
|
|
6911
|
+
addIn(path20, value) {
|
|
6912
6912
|
if (assertCollection(this.contents))
|
|
6913
|
-
this.contents.addIn(
|
|
6913
|
+
this.contents.addIn(path20, value);
|
|
6914
6914
|
}
|
|
6915
6915
|
/**
|
|
6916
6916
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -6985,14 +6985,14 @@ var require_Document = __commonJS({
|
|
|
6985
6985
|
* Removes a value from the document.
|
|
6986
6986
|
* @returns `true` if the item was found and removed.
|
|
6987
6987
|
*/
|
|
6988
|
-
deleteIn(
|
|
6989
|
-
if (Collection.isEmptyPath(
|
|
6988
|
+
deleteIn(path20) {
|
|
6989
|
+
if (Collection.isEmptyPath(path20)) {
|
|
6990
6990
|
if (this.contents == null)
|
|
6991
6991
|
return false;
|
|
6992
6992
|
this.contents = null;
|
|
6993
6993
|
return true;
|
|
6994
6994
|
}
|
|
6995
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
6995
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path20) : false;
|
|
6996
6996
|
}
|
|
6997
6997
|
/**
|
|
6998
6998
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -7007,10 +7007,10 @@ var require_Document = __commonJS({
|
|
|
7007
7007
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
7008
7008
|
* `true` (collections are always returned intact).
|
|
7009
7009
|
*/
|
|
7010
|
-
getIn(
|
|
7011
|
-
if (Collection.isEmptyPath(
|
|
7010
|
+
getIn(path20, keepScalar) {
|
|
7011
|
+
if (Collection.isEmptyPath(path20))
|
|
7012
7012
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
7013
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
7013
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path20, keepScalar) : void 0;
|
|
7014
7014
|
}
|
|
7015
7015
|
/**
|
|
7016
7016
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -7021,10 +7021,10 @@ var require_Document = __commonJS({
|
|
|
7021
7021
|
/**
|
|
7022
7022
|
* Checks if the document includes a value at `path`.
|
|
7023
7023
|
*/
|
|
7024
|
-
hasIn(
|
|
7025
|
-
if (Collection.isEmptyPath(
|
|
7024
|
+
hasIn(path20) {
|
|
7025
|
+
if (Collection.isEmptyPath(path20))
|
|
7026
7026
|
return this.contents !== void 0;
|
|
7027
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
7027
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path20) : false;
|
|
7028
7028
|
}
|
|
7029
7029
|
/**
|
|
7030
7030
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -7041,13 +7041,13 @@ var require_Document = __commonJS({
|
|
|
7041
7041
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
7042
7042
|
* boolean to add/remove the item from the set.
|
|
7043
7043
|
*/
|
|
7044
|
-
setIn(
|
|
7045
|
-
if (Collection.isEmptyPath(
|
|
7044
|
+
setIn(path20, value) {
|
|
7045
|
+
if (Collection.isEmptyPath(path20)) {
|
|
7046
7046
|
this.contents = value;
|
|
7047
7047
|
} else if (this.contents == null) {
|
|
7048
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
7048
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path20), value);
|
|
7049
7049
|
} else if (assertCollection(this.contents)) {
|
|
7050
|
-
this.contents.setIn(
|
|
7050
|
+
this.contents.setIn(path20, value);
|
|
7051
7051
|
}
|
|
7052
7052
|
}
|
|
7053
7053
|
/**
|
|
@@ -9008,9 +9008,9 @@ var require_cst_visit = __commonJS({
|
|
|
9008
9008
|
visit2.BREAK = BREAK;
|
|
9009
9009
|
visit2.SKIP = SKIP2;
|
|
9010
9010
|
visit2.REMOVE = REMOVE;
|
|
9011
|
-
visit2.itemAtPath = (cst,
|
|
9011
|
+
visit2.itemAtPath = (cst, path20) => {
|
|
9012
9012
|
let item = cst;
|
|
9013
|
-
for (const [field, index2] of
|
|
9013
|
+
for (const [field, index2] of path20) {
|
|
9014
9014
|
const tok = item?.[field];
|
|
9015
9015
|
if (tok && "items" in tok) {
|
|
9016
9016
|
item = tok.items[index2];
|
|
@@ -9019,23 +9019,23 @@ var require_cst_visit = __commonJS({
|
|
|
9019
9019
|
}
|
|
9020
9020
|
return item;
|
|
9021
9021
|
};
|
|
9022
|
-
visit2.parentCollection = (cst,
|
|
9023
|
-
const parent = visit2.itemAtPath(cst,
|
|
9024
|
-
const field =
|
|
9022
|
+
visit2.parentCollection = (cst, path20) => {
|
|
9023
|
+
const parent = visit2.itemAtPath(cst, path20.slice(0, -1));
|
|
9024
|
+
const field = path20[path20.length - 1][0];
|
|
9025
9025
|
const coll = parent?.[field];
|
|
9026
9026
|
if (coll && "items" in coll)
|
|
9027
9027
|
return coll;
|
|
9028
9028
|
throw new Error("Parent collection not found");
|
|
9029
9029
|
};
|
|
9030
|
-
function _visit(
|
|
9031
|
-
let ctrl = visitor(item,
|
|
9030
|
+
function _visit(path20, item, visitor) {
|
|
9031
|
+
let ctrl = visitor(item, path20);
|
|
9032
9032
|
if (typeof ctrl === "symbol")
|
|
9033
9033
|
return ctrl;
|
|
9034
9034
|
for (const field of ["key", "value"]) {
|
|
9035
9035
|
const token = item[field];
|
|
9036
9036
|
if (token && "items" in token) {
|
|
9037
9037
|
for (let i = 0; i < token.items.length; ++i) {
|
|
9038
|
-
const ci = _visit(Object.freeze(
|
|
9038
|
+
const ci = _visit(Object.freeze(path20.concat([[field, i]])), token.items[i], visitor);
|
|
9039
9039
|
if (typeof ci === "number")
|
|
9040
9040
|
i = ci - 1;
|
|
9041
9041
|
else if (ci === BREAK)
|
|
@@ -9046,10 +9046,10 @@ var require_cst_visit = __commonJS({
|
|
|
9046
9046
|
}
|
|
9047
9047
|
}
|
|
9048
9048
|
if (typeof ctrl === "function" && field === "key")
|
|
9049
|
-
ctrl = ctrl(item,
|
|
9049
|
+
ctrl = ctrl(item, path20);
|
|
9050
9050
|
}
|
|
9051
9051
|
}
|
|
9052
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
9052
|
+
return typeof ctrl === "function" ? ctrl(item, path20) : ctrl;
|
|
9053
9053
|
}
|
|
9054
9054
|
exports.visit = visit2;
|
|
9055
9055
|
}
|
|
@@ -16023,8 +16023,8 @@ var require_utils = __commonJS({
|
|
|
16023
16023
|
}
|
|
16024
16024
|
return ind;
|
|
16025
16025
|
}
|
|
16026
|
-
function removeDotSegments(
|
|
16027
|
-
let input2 =
|
|
16026
|
+
function removeDotSegments(path20) {
|
|
16027
|
+
let input2 = path20;
|
|
16028
16028
|
const output3 = [];
|
|
16029
16029
|
let nextSlash = -1;
|
|
16030
16030
|
let len = 0;
|
|
@@ -16433,8 +16433,8 @@ var require_schemes = __commonJS({
|
|
|
16433
16433
|
}
|
|
16434
16434
|
if (wsComponent.resourceName) {
|
|
16435
16435
|
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
16436
|
-
const
|
|
16437
|
-
wsComponent.path =
|
|
16436
|
+
const path20 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
16437
|
+
wsComponent.path = path20 && path20 !== "/" ? path20 : void 0;
|
|
16438
16438
|
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
16439
16439
|
wsComponent.resourceName = void 0;
|
|
16440
16440
|
}
|
|
@@ -19644,7 +19644,7 @@ var require_ajv = __commonJS({
|
|
|
19644
19644
|
});
|
|
19645
19645
|
|
|
19646
19646
|
// src/index.ts
|
|
19647
|
-
import
|
|
19647
|
+
import path19 from "path";
|
|
19648
19648
|
|
|
19649
19649
|
// ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs
|
|
19650
19650
|
var import_index = __toESM(require_commander(), 1);
|
|
@@ -20479,10 +20479,10 @@ function mergeDefs(...defs) {
|
|
|
20479
20479
|
function cloneDef(schema) {
|
|
20480
20480
|
return mergeDefs(schema._zod.def);
|
|
20481
20481
|
}
|
|
20482
|
-
function getElementAtPath(obj,
|
|
20483
|
-
if (!
|
|
20482
|
+
function getElementAtPath(obj, path20) {
|
|
20483
|
+
if (!path20)
|
|
20484
20484
|
return obj;
|
|
20485
|
-
return
|
|
20485
|
+
return path20.reduce((acc, key) => acc?.[key], obj);
|
|
20486
20486
|
}
|
|
20487
20487
|
function promiseAllObject(promisesObj) {
|
|
20488
20488
|
const keys = Object.keys(promisesObj);
|
|
@@ -20822,11 +20822,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
20822
20822
|
}
|
|
20823
20823
|
return false;
|
|
20824
20824
|
}
|
|
20825
|
-
function prefixIssues(
|
|
20825
|
+
function prefixIssues(path20, issues) {
|
|
20826
20826
|
return issues.map((iss) => {
|
|
20827
20827
|
var _a3;
|
|
20828
20828
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
20829
|
-
iss.path.unshift(
|
|
20829
|
+
iss.path.unshift(path20);
|
|
20830
20830
|
return iss;
|
|
20831
20831
|
});
|
|
20832
20832
|
}
|
|
@@ -21276,16 +21276,16 @@ function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
|
21276
21276
|
}
|
|
21277
21277
|
function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
21278
21278
|
const fieldErrors = { _errors: [] };
|
|
21279
|
-
const processError = (error63,
|
|
21279
|
+
const processError = (error63, path20 = []) => {
|
|
21280
21280
|
for (const issue2 of error63.issues) {
|
|
21281
21281
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
21282
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
21282
|
+
issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
|
|
21283
21283
|
} else if (issue2.code === "invalid_key") {
|
|
21284
|
-
processError({ issues: issue2.issues }, [...
|
|
21284
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
21285
21285
|
} else if (issue2.code === "invalid_element") {
|
|
21286
|
-
processError({ issues: issue2.issues }, [...
|
|
21286
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
21287
21287
|
} else {
|
|
21288
|
-
const fullpath = [...
|
|
21288
|
+
const fullpath = [...path20, ...issue2.path];
|
|
21289
21289
|
if (fullpath.length === 0) {
|
|
21290
21290
|
fieldErrors._errors.push(mapper(issue2));
|
|
21291
21291
|
} else {
|
|
@@ -21324,17 +21324,17 @@ function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
|
21324
21324
|
}
|
|
21325
21325
|
function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
21326
21326
|
const result = { errors: [] };
|
|
21327
|
-
const processError = (error63,
|
|
21327
|
+
const processError = (error63, path20 = []) => {
|
|
21328
21328
|
var _a3;
|
|
21329
21329
|
for (const issue2 of error63.issues) {
|
|
21330
21330
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
21331
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
21331
|
+
issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
|
|
21332
21332
|
} else if (issue2.code === "invalid_key") {
|
|
21333
|
-
processError({ issues: issue2.issues }, [...
|
|
21333
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
21334
21334
|
} else if (issue2.code === "invalid_element") {
|
|
21335
|
-
processError({ issues: issue2.issues }, [...
|
|
21335
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
21336
21336
|
} else {
|
|
21337
|
-
const fullpath = [...
|
|
21337
|
+
const fullpath = [...path20, ...issue2.path];
|
|
21338
21338
|
if (fullpath.length === 0) {
|
|
21339
21339
|
result.errors.push(mapper(issue2));
|
|
21340
21340
|
continue;
|
|
@@ -21373,8 +21373,8 @@ function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
|
21373
21373
|
}
|
|
21374
21374
|
function toDotPath(_path) {
|
|
21375
21375
|
const segs = [];
|
|
21376
|
-
const
|
|
21377
|
-
for (const seg of
|
|
21376
|
+
const path20 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
21377
|
+
for (const seg of path20) {
|
|
21378
21378
|
if (typeof seg === "number")
|
|
21379
21379
|
segs.push(`[${seg}]`);
|
|
21380
21380
|
else if (typeof seg === "symbol")
|
|
@@ -38476,13 +38476,13 @@ function resolveRef(ref, ctx) {
|
|
|
38476
38476
|
if (!ref.startsWith("#")) {
|
|
38477
38477
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
38478
38478
|
}
|
|
38479
|
-
const
|
|
38480
|
-
if (
|
|
38479
|
+
const path20 = ref.slice(1).split("/").filter(Boolean);
|
|
38480
|
+
if (path20.length === 0) {
|
|
38481
38481
|
return ctx.rootSchema;
|
|
38482
38482
|
}
|
|
38483
38483
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
38484
|
-
if (
|
|
38485
|
-
const key =
|
|
38484
|
+
if (path20[0] === defsKey) {
|
|
38485
|
+
const key = path20[1] === void 0 ? void 0 : decodeJSONPointerSegment(path20[1]);
|
|
38486
38486
|
if (!key || !ctx.defs[key]) {
|
|
38487
38487
|
throw new Error(`Reference not found: ${ref}`);
|
|
38488
38488
|
}
|
|
@@ -39541,6 +39541,10 @@ var IndexJobQuery = external_exports.object({
|
|
|
39541
39541
|
repo: external_exports.string().trim().max(200).optional(),
|
|
39542
39542
|
limit: external_exports.coerce.number().int().min(1).max(500).default(200)
|
|
39543
39543
|
});
|
|
39544
|
+
var DeleteIndexJobsQuery = external_exports.object({
|
|
39545
|
+
status: external_exports.literal("error").default("error"),
|
|
39546
|
+
repo: external_exports.string().trim().max(200).optional()
|
|
39547
|
+
});
|
|
39544
39548
|
var AuditQuery = external_exports.object({
|
|
39545
39549
|
package: external_exports.string().optional(),
|
|
39546
39550
|
/** `me`: only what you did yourself. Anyone may read their own events. */
|
|
@@ -39765,8 +39769,8 @@ var Api = class {
|
|
|
39765
39769
|
this.conn = conn;
|
|
39766
39770
|
}
|
|
39767
39771
|
conn;
|
|
39768
|
-
async request(method,
|
|
39769
|
-
const url2 = `${this.conn.server}/api/v1${
|
|
39772
|
+
async request(method, path20, body, { allow404 = false } = {}) {
|
|
39773
|
+
const url2 = `${this.conn.server}/api/v1${path20}`;
|
|
39770
39774
|
let res;
|
|
39771
39775
|
try {
|
|
39772
39776
|
res = await fetch(url2, {
|
|
@@ -39788,7 +39792,7 @@ var Api = class {
|
|
|
39788
39792
|
payload = await res.json();
|
|
39789
39793
|
} catch {
|
|
39790
39794
|
}
|
|
39791
|
-
const msg = payload.message ?? `${method} ${
|
|
39795
|
+
const msg = payload.message ?? `${method} ${path20} failed with HTTP ${res.status}.`;
|
|
39792
39796
|
if (res.status === 401) {
|
|
39793
39797
|
throw new CliError(
|
|
39794
39798
|
msg,
|
|
@@ -39879,17 +39883,17 @@ function parseManifest(text) {
|
|
|
39879
39883
|
}
|
|
39880
39884
|
return manifest;
|
|
39881
39885
|
}
|
|
39882
|
-
function parseEvalSuite(text,
|
|
39886
|
+
function parseEvalSuite(text, path20 = "suite") {
|
|
39883
39887
|
let raw;
|
|
39884
39888
|
try {
|
|
39885
39889
|
raw = import_yaml.default.parse(text);
|
|
39886
39890
|
} catch (err) {
|
|
39887
|
-
throw new ManifestError(`${
|
|
39891
|
+
throw new ManifestError(`${path20} is not valid YAML: ${err.message}`);
|
|
39888
39892
|
}
|
|
39889
39893
|
const res = EvalSuite.safeParse(raw);
|
|
39890
39894
|
if (!res.success) {
|
|
39891
39895
|
const issues = res.error.issues.map((i) => ({ path: i.path.join("."), message: i.message }));
|
|
39892
|
-
throw new ManifestError(`${
|
|
39896
|
+
throw new ManifestError(`${path20} is invalid: ${issues.map((i) => `${i.path}: ${i.message}`).join("; ")}`, issues);
|
|
39893
39897
|
}
|
|
39894
39898
|
return res.data;
|
|
39895
39899
|
}
|
|
@@ -39946,8 +39950,8 @@ function asText(content) {
|
|
|
39946
39950
|
return null;
|
|
39947
39951
|
return typeof content === "string" ? content : new TextDecoder().decode(content);
|
|
39948
39952
|
}
|
|
39949
|
-
function isYarkrOnly(
|
|
39950
|
-
return
|
|
39953
|
+
function isYarkrOnly(path20) {
|
|
39954
|
+
return path20 === MANIFEST_FILE || path20 === INDEX_FILE || path20.startsWith("evals/") || path20.startsWith("fixtures/");
|
|
39951
39955
|
}
|
|
39952
39956
|
function skillEntryPath(m) {
|
|
39953
39957
|
return m.entry ?? "SKILL.md";
|
|
@@ -39975,10 +39979,10 @@ ${body.replace(/^\n+/, "")}`);
|
|
|
39975
39979
|
function skillFolderFiles(pkg, dir, folderName) {
|
|
39976
39980
|
const entry = skillEntryPath(pkg.manifest);
|
|
39977
39981
|
const files = [{ package: pkg.manifest.name, path: join(dir, folderName, "SKILL.md"), content: renderSkillMd(pkg, folderName) }];
|
|
39978
|
-
for (const [
|
|
39979
|
-
if (
|
|
39982
|
+
for (const [path20, content] of Object.entries(pkg.files)) {
|
|
39983
|
+
if (path20 === entry || path20 === "SKILL.md" || isYarkrOnly(path20))
|
|
39980
39984
|
continue;
|
|
39981
|
-
files.push({ package: pkg.manifest.name, path: join(dir, folderName,
|
|
39985
|
+
files.push({ package: pkg.manifest.name, path: join(dir, folderName, path20), content });
|
|
39982
39986
|
}
|
|
39983
39987
|
return files;
|
|
39984
39988
|
}
|
|
@@ -40072,13 +40076,13 @@ function nativeFolderHarness(o) {
|
|
|
40072
40076
|
...o.mcp ? {
|
|
40073
40077
|
toolsets(servers, ctx) {
|
|
40074
40078
|
const mcp = o.mcp;
|
|
40075
|
-
const
|
|
40076
|
-
if (!
|
|
40079
|
+
const path20 = ctx.layout[slot];
|
|
40080
|
+
if (!path20) {
|
|
40077
40081
|
if (mcp.unavailable)
|
|
40078
40082
|
ctx.out.notes.push(mcp.unavailable(servers));
|
|
40079
40083
|
return;
|
|
40080
40084
|
}
|
|
40081
|
-
ctx.out.mcp.push({ path:
|
|
40085
|
+
ctx.out.mcp.push({ path: path20, key: mcp.key, servers: Object.fromEntries(servers.map(({ pkg, server }) => [server.name, mcp.entry(pkg, server, ctx.out.notes)])) });
|
|
40082
40086
|
}
|
|
40083
40087
|
} : {}
|
|
40084
40088
|
});
|
|
@@ -40263,10 +40267,10 @@ var cursor = defineHarness({
|
|
|
40263
40267
|
const entry = skillEntryPath(pkg.manifest);
|
|
40264
40268
|
const { data, body } = splitFrontmatter(asText(pkg.files[entry]) ?? "");
|
|
40265
40269
|
const extra = [];
|
|
40266
|
-
for (const [
|
|
40267
|
-
if (
|
|
40270
|
+
for (const [path20, content] of Object.entries(pkg.files)) {
|
|
40271
|
+
if (path20 === entry || isYarkrOnly(path20))
|
|
40268
40272
|
continue;
|
|
40269
|
-
const p = join(l.assets, name,
|
|
40273
|
+
const p = join(l.assets, name, path20);
|
|
40270
40274
|
ctx.out.files.push({ package: pkg.manifest.name, path: p, content });
|
|
40271
40275
|
extra.push(`- \`${p}\``);
|
|
40272
40276
|
}
|
|
@@ -40337,9 +40341,9 @@ function folderExportHarness(id, rootDefault, opts = {}) {
|
|
|
40337
40341
|
for (const pkg of byKind(input2, "agent")) {
|
|
40338
40342
|
const name = names.get(pkg.manifest.name);
|
|
40339
40343
|
const parts = agentParts(pkg, id, names, out);
|
|
40340
|
-
for (const [
|
|
40341
|
-
if (!isYarkrOnly(
|
|
40342
|
-
out.files.push({ package: pkg.manifest.name, path: join(root, "agents", name,
|
|
40344
|
+
for (const [path20, content] of Object.entries(pkg.files))
|
|
40345
|
+
if (!isYarkrOnly(path20))
|
|
40346
|
+
out.files.push({ package: pkg.manifest.name, path: join(root, "agents", name, path20), content });
|
|
40343
40347
|
index2.push({ kind: "agent", name, package: pkg.manifest.name, version: pkg.manifest.version, description: pkg.manifest.description, model: parts.model, tools: parts.tools, skills: parts.skills, subagents: parts.subagents, system_prompt: join("agents", name, pkg.manifest.agent?.system_prompt ?? "") });
|
|
40344
40348
|
}
|
|
40345
40349
|
for (const pkg of byKind(input2, "toolset")) {
|
|
@@ -41148,36 +41152,36 @@ var dirname = (p) => p.includes("/") ? p.slice(0, p.lastIndexOf("/")) : "";
|
|
|
41148
41152
|
var basename = (p) => p.slice(p.lastIndexOf("/") + 1);
|
|
41149
41153
|
var under = (dir, p) => dir ? p.startsWith(`${dir}/`) : true;
|
|
41150
41154
|
var rel = (dir, p) => dir ? p.slice(dir.length + 1) : p;
|
|
41151
|
-
function parseOverrides(text,
|
|
41155
|
+
function parseOverrides(text, path20, problems) {
|
|
41152
41156
|
if (text === null)
|
|
41153
41157
|
return null;
|
|
41154
41158
|
try {
|
|
41155
41159
|
const raw = import_yaml3.default.parse(text);
|
|
41156
41160
|
return raw && typeof raw === "object" ? raw : null;
|
|
41157
41161
|
} catch (err) {
|
|
41158
|
-
problems.push({ path:
|
|
41162
|
+
problems.push({ path: path20, message: `${MANIFEST_FILE} isn't valid YAML: ${err.message}` });
|
|
41159
41163
|
return null;
|
|
41160
41164
|
}
|
|
41161
41165
|
}
|
|
41162
|
-
function parseIndex(text,
|
|
41166
|
+
function parseIndex(text, path20, problems) {
|
|
41163
41167
|
let raw;
|
|
41164
41168
|
try {
|
|
41165
41169
|
raw = import_yaml3.default.parse(text ?? "");
|
|
41166
41170
|
} catch (err) {
|
|
41167
|
-
problems.push({ path:
|
|
41171
|
+
problems.push({ path: path20, message: `isn't valid YAML: ${err.message}` });
|
|
41168
41172
|
return null;
|
|
41169
41173
|
}
|
|
41170
41174
|
const entries = (key) => {
|
|
41171
41175
|
const list = raw?.[key] ?? [];
|
|
41172
41176
|
if (!Array.isArray(list)) {
|
|
41173
|
-
problems.push({ path:
|
|
41177
|
+
problems.push({ path: path20, message: `\`${key}\` must be a list.` });
|
|
41174
41178
|
return [];
|
|
41175
41179
|
}
|
|
41176
41180
|
return list.flatMap((e, i) => {
|
|
41177
41181
|
const entry = typeof e === "string" ? { path: e } : e;
|
|
41178
41182
|
if (entry && typeof entry === "object" && typeof entry.path === "string" && entry.path.trim())
|
|
41179
41183
|
return [{ ...entry, path: entry.path.replace(/^\.?\/+|\/+$/g, "") }];
|
|
41180
|
-
problems.push({ path:
|
|
41184
|
+
problems.push({ path: path20, message: `${key}[${i}] needs a \`path\`.` });
|
|
41181
41185
|
return [];
|
|
41182
41186
|
});
|
|
41183
41187
|
};
|
|
@@ -41193,7 +41197,7 @@ async function detectAssets(input2) {
|
|
|
41193
41197
|
const claimed = [];
|
|
41194
41198
|
const isClaimed = (p) => claimed.some((d) => d ? p === d || p.startsWith(`${d}/`) : true);
|
|
41195
41199
|
const filesBelow = (dir) => new Map(paths.filter((p) => under(dir, p)).map((p) => [rel(dir, p), p]));
|
|
41196
|
-
const make = (name, kind,
|
|
41200
|
+
const make = (name, kind, path20, files, o, extra) => {
|
|
41197
41201
|
const suites = [...files.keys()].filter((p) => SUITE.test(p));
|
|
41198
41202
|
const raw = {
|
|
41199
41203
|
name: `${input2.namespace}/${slugify2(name)}`,
|
|
@@ -41212,10 +41216,10 @@ async function detectAssets(input2) {
|
|
|
41212
41216
|
};
|
|
41213
41217
|
const res = Manifest.safeParse(raw);
|
|
41214
41218
|
if (!res.success) {
|
|
41215
|
-
problems.push({ path:
|
|
41219
|
+
problems.push({ path: path20, message: res.error.issues.map((i) => `${i.path.join(".") || "manifest"}: ${i.message}`).join("; ") });
|
|
41216
41220
|
return null;
|
|
41217
41221
|
}
|
|
41218
|
-
return { name: slugify2(name), kind, path:
|
|
41222
|
+
return { name: slugify2(name), kind, path: path20, manifest: res.data, files };
|
|
41219
41223
|
};
|
|
41220
41224
|
const manifestNear = async (dir, from) => {
|
|
41221
41225
|
const mp = dir ? `${dir}/${MANIFEST_FILE}` : MANIFEST_FILE;
|
|
@@ -41388,12 +41392,12 @@ async function sameFiles(a, b, read) {
|
|
|
41388
41392
|
}
|
|
41389
41393
|
return true;
|
|
41390
41394
|
}
|
|
41391
|
-
function toolsetServers2(text,
|
|
41395
|
+
function toolsetServers2(text, path20, problems) {
|
|
41392
41396
|
let doc;
|
|
41393
41397
|
try {
|
|
41394
41398
|
doc = JSON.parse(text ?? "");
|
|
41395
41399
|
} catch (err) {
|
|
41396
|
-
problems.push({ path:
|
|
41400
|
+
problems.push({ path: path20, message: `isn't valid JSON: ${err.message}` });
|
|
41397
41401
|
return null;
|
|
41398
41402
|
}
|
|
41399
41403
|
const out = [];
|
|
@@ -41406,7 +41410,7 @@ function toolsetServers2(text, path19, problems) {
|
|
|
41406
41410
|
const ref = String(v).replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}/g, "${env:$1}");
|
|
41407
41411
|
const plain = ref.replace(/^Bearer /, "");
|
|
41408
41412
|
if (!SECRET_REF.test(plain)) {
|
|
41409
|
-
problems.push({ path:
|
|
41413
|
+
problems.push({ path: path20, message: `${name}.${field}.${k} is a literal value. Use \${${k.toUpperCase().replace(/[^A-Z0-9]+/g, "_")}} or \${vault:path#key} so no secret lives in the repo.` });
|
|
41410
41414
|
return null;
|
|
41411
41415
|
}
|
|
41412
41416
|
res[k] = ref;
|
|
@@ -41426,7 +41430,7 @@ function toolsetServers2(text, path19, problems) {
|
|
|
41426
41430
|
});
|
|
41427
41431
|
}
|
|
41428
41432
|
if (!out.length) {
|
|
41429
|
-
problems.push({ path:
|
|
41433
|
+
problems.push({ path: path20, message: "has no mcpServers." });
|
|
41430
41434
|
return null;
|
|
41431
41435
|
}
|
|
41432
41436
|
return out;
|
|
@@ -41550,8 +41554,8 @@ function verifyBundle(b, key, requireSignature) {
|
|
|
41550
41554
|
return { manifest: b.manifest, files, content_hash: b.content_hash };
|
|
41551
41555
|
}
|
|
41552
41556
|
var TEXT_EXT = /\.(md|mdc|mdx|markdown|txt|ya?ml|json|toml|py|sh|bash|js|mjs|cjs|ts|tsx|csv|html|css|xml|sql|rb|go|rs|java|ini|cfg|env)$/i;
|
|
41553
|
-
function looksText(
|
|
41554
|
-
if (TEXT_EXT.test(
|
|
41557
|
+
function looksText(path20, bytes) {
|
|
41558
|
+
if (TEXT_EXT.test(path20)) return true;
|
|
41555
41559
|
const n = Math.min(bytes.length, 4096);
|
|
41556
41560
|
for (let i = 0; i < n; i++) if (bytes[i] === 0) return false;
|
|
41557
41561
|
try {
|
|
@@ -42121,16 +42125,16 @@ var Diff = class {
|
|
|
42121
42125
|
}
|
|
42122
42126
|
}
|
|
42123
42127
|
}
|
|
42124
|
-
addToPath(
|
|
42125
|
-
const last =
|
|
42128
|
+
addToPath(path20, added, removed, oldPosInc, options) {
|
|
42129
|
+
const last = path20.lastComponent;
|
|
42126
42130
|
if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
|
|
42127
42131
|
return {
|
|
42128
|
-
oldPos:
|
|
42132
|
+
oldPos: path20.oldPos + oldPosInc,
|
|
42129
42133
|
lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
|
|
42130
42134
|
};
|
|
42131
42135
|
} else {
|
|
42132
42136
|
return {
|
|
42133
|
-
oldPos:
|
|
42137
|
+
oldPos: path20.oldPos + oldPosInc,
|
|
42134
42138
|
lastComponent: { count: 1, added, removed, previousComponent: last }
|
|
42135
42139
|
};
|
|
42136
42140
|
}
|
|
@@ -42772,10 +42776,10 @@ async function loadSuites(candidate, candFiles, shared) {
|
|
|
42772
42776
|
}
|
|
42773
42777
|
return out;
|
|
42774
42778
|
}
|
|
42775
|
-
function parseSuite(bytes, ref,
|
|
42779
|
+
function parseSuite(bytes, ref, path20, source) {
|
|
42776
42780
|
const text = bytes.toString("utf8");
|
|
42777
42781
|
try {
|
|
42778
|
-
return { suite: parseEvalSuite(text,
|
|
42782
|
+
return { suite: parseEvalSuite(text, path20), ref, path: path20, source, hash: sha256(text) };
|
|
42779
42783
|
} catch (err) {
|
|
42780
42784
|
throw new SuiteError(err.message);
|
|
42781
42785
|
}
|
|
@@ -44276,7 +44280,7 @@ async function registrySnapshot(api, name, opts = {}) {
|
|
|
44276
44280
|
const rel2 = await api.resolve(name, { channel: opts.channel ?? "stable", range: opts.range });
|
|
44277
44281
|
const bundle = await api.bundle(name, rel2.version);
|
|
44278
44282
|
const files = new Map(bundle.files.map((f) => [f.path, Buffer.from(f.content, "base64")]));
|
|
44279
|
-
const tree = buildTree([...files].map(([
|
|
44283
|
+
const tree = buildTree([...files].map(([path20, bytes]) => ({ path: path20, bytes })));
|
|
44280
44284
|
return { snapshot: { name, label: bundle.version, contentHash: bundle.content_hash, manifest: bundle.manifest, tree }, files };
|
|
44281
44285
|
}
|
|
44282
44286
|
function registrySuiteResolver(getApi) {
|
|
@@ -45086,26 +45090,64 @@ var petrol = rgb(74, 163, 191);
|
|
|
45086
45090
|
function link(url2, text = url2) {
|
|
45087
45091
|
return kleur_default.enabled ? `\x1B]8;;${url2}\x1B\\${text}\x1B]8;;\x1B\\` : text;
|
|
45088
45092
|
}
|
|
45089
|
-
function banner(version2,
|
|
45093
|
+
function banner(version2, longName = false, update2) {
|
|
45090
45094
|
return [
|
|
45091
45095
|
"",
|
|
45092
45096
|
...WORDMARK.map((l) => ` ${petrol(l)}`),
|
|
45093
45097
|
"",
|
|
45094
45098
|
` ${kleur_default.bold("yarkr")} ${kleur_default.dim(`v${version2}`)} ${kleur_default.dim("\xB7")} skills, agents and MCP toolsets for every harness`,
|
|
45095
45099
|
` ${petrol("\u2192")} ${kleur_default.underline(petrol(link(WEBSITE)))}`,
|
|
45096
|
-
...
|
|
45100
|
+
...update2 ? ["", ` ${kleur_default.yellow(`\u26A0 yarkr-cli ${update2.latest} is available (you have ${version2}).`)} Update: ${kleur_default.bold(update2.command)}`] : [],
|
|
45101
|
+
...longName ? ["", ` ${kleur_default.dim("Tip:")} install it with ${kleur_default.bold("npm install -g yarkr-cli")}, then just run ${kleur_default.bold("yarkr")}.`] : [],
|
|
45097
45102
|
""
|
|
45098
45103
|
].join("\n");
|
|
45099
45104
|
}
|
|
45100
45105
|
|
|
45106
|
+
// src/update-check.ts
|
|
45107
|
+
var import_semver4 = __toESM(require_semver2(), 1);
|
|
45108
|
+
import { mkdir as mkdir9, readFile as readFile11, writeFile as writeFile8 } from "fs/promises";
|
|
45109
|
+
import path18 from "path";
|
|
45110
|
+
var LATEST_URL = "https://registry.npmjs.org/yarkr-cli/latest";
|
|
45111
|
+
var CHECK_EVERY_MS = 24 * 60 * 60 * 1e3;
|
|
45112
|
+
var TIMEOUT_MS = 1500;
|
|
45113
|
+
var cacheFile = () => path18.join(userStateDir(), "update-check.json");
|
|
45114
|
+
async function newerVersion(current, env = process.env) {
|
|
45115
|
+
if (env.CI || env.YARKR_NO_UPDATE_CHECK || env.NO_UPDATE_NOTIFIER || !import_semver4.default.valid(current) || current === "0.0.0-dev") return null;
|
|
45116
|
+
const latest = await latestVersion();
|
|
45117
|
+
return latest && import_semver4.default.gt(latest, current) ? latest : null;
|
|
45118
|
+
}
|
|
45119
|
+
async function latestVersion() {
|
|
45120
|
+
try {
|
|
45121
|
+
const cached2 = JSON.parse(await readFile11(cacheFile(), "utf8"));
|
|
45122
|
+
if (Date.now() - cached2.checked_at < CHECK_EVERY_MS && import_semver4.default.valid(cached2.latest)) return cached2.latest;
|
|
45123
|
+
} catch {
|
|
45124
|
+
}
|
|
45125
|
+
try {
|
|
45126
|
+
const res = await fetch(LATEST_URL, { signal: AbortSignal.timeout(TIMEOUT_MS), headers: { accept: "application/json" } });
|
|
45127
|
+
if (!res.ok) return null;
|
|
45128
|
+
const { version: version2 } = await res.json();
|
|
45129
|
+
if (!version2 || !import_semver4.default.valid(version2)) return null;
|
|
45130
|
+
await mkdir9(userStateDir(), { recursive: true });
|
|
45131
|
+
await writeFile8(cacheFile(), JSON.stringify({ checked_at: Date.now(), latest: version2 }));
|
|
45132
|
+
return version2;
|
|
45133
|
+
} catch {
|
|
45134
|
+
return null;
|
|
45135
|
+
}
|
|
45136
|
+
}
|
|
45137
|
+
var viaNpx = (scriptPath = process.argv[1] ?? "") => /[\\/]_npx[\\/]/.test(scriptPath);
|
|
45138
|
+
function updateCommand(latest, scriptPath = process.argv[1] ?? "") {
|
|
45139
|
+
return viaNpx(scriptPath) ? `npx yarkr-cli@${latest}` : `npm install -g yarkr-cli@${latest}`;
|
|
45140
|
+
}
|
|
45141
|
+
|
|
45101
45142
|
// src/index.ts
|
|
45102
|
-
var VERSION = true ? "1.0.
|
|
45143
|
+
var VERSION = true ? "1.0.7" : "0.0.0-dev";
|
|
45103
45144
|
var act = (fn) => async (...a) => {
|
|
45104
45145
|
await fn(...a);
|
|
45105
45146
|
};
|
|
45106
45147
|
var syncFlags = (c) => c.option("--harness <ids...>", `limit to some harnesses (${HARNESS_IDS.join(", ")})`).option("--dry-run", "show what would change; write nothing").option("--check", "exit 1 if anything is out of date (for CI)").option("--force", "overwrite files edited locally").option("--require-signatures", "refuse unsigned releases").option("-g, --global", "install into your home directory instead of this folder").addOption(new Option("--user").hideHelp()).option("--registry <url>", "registry to use (default: from .yarkrrc)");
|
|
45107
|
-
|
|
45108
|
-
|
|
45148
|
+
var bannerFor = (latest) => banner(VERSION, viaNpx() || path19.basename(process.argv[1] ?? "", ".js") === "yarkr-cli", latest ? { latest, command: updateCommand(latest) } : null);
|
|
45149
|
+
function buildProgram(latest = null) {
|
|
45150
|
+
const program2 = new Command().name("yarkr").description("Yarkr: install your org's skills, agents and MCP configs into every harness.").version(VERSION).addHelpText("before", () => bannerFor(latest)).option("-q, --quiet", "only print warnings and errors").hook("preAction", (cmd) => {
|
|
45109
45151
|
ui.quiet = !!cmd.opts().quiet;
|
|
45110
45152
|
});
|
|
45111
45153
|
program2.command("login").description("sign in in the browser and keep a token in your keychain (or ~/.yarkrrc)").option("--registry <url>").option("--token <token>", "use this token instead of the browser (or pipe it on stdin)").option("--no-browser", "print a link to open on any device, then paste the token it shows").action(act(login));
|
|
@@ -45150,9 +45192,15 @@ function buildProgram() {
|
|
|
45150
45192
|
program2.command("mcp-config").argument("<harness>", HARNESS_IDS.join(" | ")).description("print the config that connects a harness to Yarkr's MCP server").option("--token-env <name>", "environment variable holding the token", "YARKR_TOKEN").option("--registry <url>").action(act(mcpConfig));
|
|
45151
45193
|
return program2;
|
|
45152
45194
|
}
|
|
45195
|
+
var isTopLevelHelp = (args) => args.length === 0 || args.length === 1 && (args[0] === "-h" || args[0] === "--help");
|
|
45196
|
+
var commandShowsBanner = (args, env = process.env) => !!process.stdout.isTTY && !!process.stderr.isTTY && !env.CI && !args.some((a) => a === "--json" || a.startsWith("--json=") || a === "-q" || a === "--quiet" || a === "-V" || a === "--version");
|
|
45153
45197
|
async function main(argv = process.argv) {
|
|
45154
45198
|
try {
|
|
45155
|
-
|
|
45199
|
+
const args = argv.slice(2);
|
|
45200
|
+
const topLevelHelp = isTopLevelHelp(args);
|
|
45201
|
+
const latest = topLevelHelp || commandShowsBanner(args) ? await newerVersion(VERSION) : null;
|
|
45202
|
+
if (!topLevelHelp && commandShowsBanner(args)) console.error(bannerFor(latest));
|
|
45203
|
+
await buildProgram(latest).parseAsync(argv);
|
|
45156
45204
|
} catch (err) {
|
|
45157
45205
|
if (err instanceof CliError) {
|
|
45158
45206
|
ui.error(err.message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yarkr-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Install skills, agents and MCP toolsets from Yarkr into Claude Code, Codex, opencode, Cursor and more",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://yarkr.com",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"typescript": "~5.9.3",
|
|
49
49
|
"vitest": "^3.2.4",
|
|
50
50
|
"yaml": "^2.8.1",
|
|
51
|
-
"@yarkr/core": "0.1.0",
|
|
52
51
|
"@yarkr/evals": "0.1.0",
|
|
53
|
-
"@yarkr/schema": "0.1.0"
|
|
52
|
+
"@yarkr/schema": "0.1.0",
|
|
53
|
+
"@yarkr/core": "0.1.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsup",
|