@warmhub/cli 0.144.0 → 0.146.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/dist/wh.js +81 -73
- package/package.json +1 -1
package/dist/wh.js
CHANGED
|
@@ -25989,6 +25989,7 @@ var SYSTEM_MANIFEST = {
|
|
|
25989
25989
|
teardown: {},
|
|
25990
25990
|
runtimeAccess: { reads: [], writes: [] }
|
|
25991
25991
|
};
|
|
25992
|
+
var SYSTEM_SHAPE_NAMES = new Set(SYSTEM_MANIFEST.shapes.map((shape) => shape.name));
|
|
25992
25993
|
var SYSTEM_COMPONENT = {
|
|
25993
25994
|
componentId: SYSTEM_COMPONENT_ID,
|
|
25994
25995
|
name: SYSTEM_MANIFEST.component.name,
|
|
@@ -26004,8 +26005,9 @@ var SYSTEM_COMPONENTS = [
|
|
|
26004
26005
|
var SYSTEM_PROTECTED_SHAPES = SYSTEM_COMPONENT.shapes.filter((shape) => shape.installInfra !== true);
|
|
26005
26006
|
var SYSTEM_PROTECTED_FAMILY_SHAPES = SYSTEM_PROTECTED_SHAPES.filter((shape) => shape.onDemand !== true);
|
|
26006
26007
|
var SYSTEM_INFRA_SHAPE_NAMES = new Set(SYSTEM_COMPONENTS.flatMap((entry) => entry.shapes.filter((shape) => shape.installInfra === true).map((shape) => shape.name)));
|
|
26007
|
-
|
|
26008
|
-
|
|
26008
|
+
var SYSTEM_SHAPE_NAMES2 = new Set(SYSTEM_MANIFEST.shapes.map((shape) => shape.name));
|
|
26009
|
+
function isSystemShapeName(name) {
|
|
26010
|
+
return SYSTEM_SHAPE_NAMES2.has(name);
|
|
26009
26011
|
}
|
|
26010
26012
|
|
|
26011
26013
|
// ../../packages/rules/src/component-manifest-validate-json.ts
|
|
@@ -26839,7 +26841,10 @@ function builtinShapeGuard(op, operationIndex) {
|
|
|
26839
26841
|
const errors = [];
|
|
26840
26842
|
const name = addressesShape(op) && op.name ? bareShapeName(op.name) : undefined;
|
|
26841
26843
|
const isShapeRename = op.operation === "rename" && addressesShape(op);
|
|
26842
|
-
const
|
|
26844
|
+
const isShapeRestore = op.operation === "restore" && op.newName !== undefined && isShapeThingName(op.newName);
|
|
26845
|
+
const movesShape = isShapeRename || isShapeRestore;
|
|
26846
|
+
const newName = movesShape && op.newName ? bareShapeName(op.newName) : undefined;
|
|
26847
|
+
const action = op.operation === "add" ? "created" : op.operation === "rename" ? "renamed" : op.operation === "restore" ? "restored" : "revised";
|
|
26843
26848
|
const reservedSourcePassThrough = isShapeRename && name !== undefined && isRenameableSquattedShape(name) && newName !== undefined && !isReservedCollectionShape(newName) && !isBuiltinShape(newName);
|
|
26844
26849
|
if (name && isRetiredCollectionShape(name) && !reservedSourcePassThrough) {
|
|
26845
26850
|
errors.push({
|
|
@@ -26856,8 +26861,7 @@ function builtinShapeGuard(op, operationIndex) {
|
|
|
26856
26861
|
});
|
|
26857
26862
|
} else {
|
|
26858
26863
|
const builtinShapeName = name && (isBuiltinShape(name) || isCollectionV2Shape(name)) && !reservedSourcePassThrough ? name : newName && (isBuiltinShape(newName) || isCollectionV2Shape(newName)) ? newName : undefined;
|
|
26859
|
-
if (builtinShapeName && (
|
|
26860
|
-
const action = op.operation === "add" ? "created" : op.operation === "rename" ? "renamed" : "revised";
|
|
26864
|
+
if (builtinShapeName && (movesShape || op.operation === "add" || op.operation === "revise")) {
|
|
26861
26865
|
errors.push({
|
|
26862
26866
|
code: "RESERVED_NAME",
|
|
26863
26867
|
operationIndex,
|
|
@@ -26865,6 +26869,14 @@ function builtinShapeGuard(op, operationIndex) {
|
|
|
26865
26869
|
});
|
|
26866
26870
|
}
|
|
26867
26871
|
}
|
|
26872
|
+
const systemShapeName = op.operation === "add" ? name : movesShape ? newName : undefined;
|
|
26873
|
+
if (systemShapeName && isSystemShapeName(systemShapeName) && !isBuiltinShape(systemShapeName) && !isCollectionV2Shape(systemShapeName)) {
|
|
26874
|
+
errors.push({
|
|
26875
|
+
code: "RESERVED_NAME",
|
|
26876
|
+
operationIndex,
|
|
26877
|
+
message: `Shape "${systemShapeName}" is a system shape and cannot be ${action} manually`
|
|
26878
|
+
});
|
|
26879
|
+
}
|
|
26868
26880
|
const retiredV2 = v2Write(op)?.shapes.find(isRetiredCollectionShape);
|
|
26869
26881
|
if (op.operation === "add" && retiredV2 !== undefined) {
|
|
26870
26882
|
errors.push({
|
|
@@ -42697,8 +42709,9 @@ function compileShapesValidator(shapes) {
|
|
|
42697
42709
|
}
|
|
42698
42710
|
}
|
|
42699
42711
|
const unionFieldSpecs = shapes.map((shape) => shape.fields);
|
|
42700
|
-
return (
|
|
42701
|
-
|
|
42712
|
+
return (input) => {
|
|
42713
|
+
const data = input === null ? {} : input;
|
|
42714
|
+
if (typeof data !== "object" || Array.isArray(data)) {
|
|
42702
42715
|
return { valid: false, errors: ["Data must be a plain object"] };
|
|
42703
42716
|
}
|
|
42704
42717
|
const record2 = data;
|
|
@@ -44539,6 +44552,9 @@ function createSubmissionShapesResolver(read) {
|
|
|
44539
44552
|
});
|
|
44540
44553
|
};
|
|
44541
44554
|
}
|
|
44555
|
+
function resolverFor(checks3, read) {
|
|
44556
|
+
return checks3 === "passThrough" ? async (operations) => operations : createSubmissionShapesResolver(read);
|
|
44557
|
+
}
|
|
44542
44558
|
function namesWritten(op) {
|
|
44543
44559
|
if (op.operation === "rename")
|
|
44544
44560
|
return [op.name, op.newName];
|
|
@@ -44920,7 +44936,7 @@ async function submitOperationsViaStream(client, args) {
|
|
|
44920
44936
|
let acknowledgedOperationCount = 0;
|
|
44921
44937
|
let lastAcknowledgedRepoSeq;
|
|
44922
44938
|
let chunkOrdinal = 0;
|
|
44923
|
-
const resolve =
|
|
44939
|
+
const resolve = resolverFor(checks3, async (wrefs) => {
|
|
44924
44940
|
if (!client.thing) {
|
|
44925
44941
|
throw new StreamValidationError("A keepShapes revise needs the client to read its Thing: this stream client has no thing.getMany");
|
|
44926
44942
|
}
|
|
@@ -45021,7 +45037,7 @@ async function* normalizedChunks(source, chunkSize, skipExisting, resolve, check
|
|
|
45021
45037
|
const checked = whole.map((operation, index) => normalizeStreamOperation(operation, index, skipExisting, checks3));
|
|
45022
45038
|
if (!passThrough)
|
|
45023
45039
|
checkOperationSequence(checked);
|
|
45024
|
-
const operations =
|
|
45040
|
+
const operations = await resolve(checked);
|
|
45025
45041
|
for (let start = 0;start < operations.length; start += chunkSize) {
|
|
45026
45042
|
yield { operations: operations.slice(start, start + chunkSize), start };
|
|
45027
45043
|
}
|
|
@@ -45211,10 +45227,10 @@ async function resolveValidateOperations(resolve, operations) {
|
|
|
45211
45227
|
async function sendCommitValidate(procedure, read, orgName, repoName, operations, opts, sender) {
|
|
45212
45228
|
const checks3 = operationChecksFor(sender, operations);
|
|
45213
45229
|
const checked = normalizeCommitValidationOperations(operations, opts?.skipExisting, checks3);
|
|
45214
|
-
const resolve =
|
|
45230
|
+
const resolve = resolverFor(checks3, read);
|
|
45215
45231
|
const input = {
|
|
45216
45232
|
...createCommitValidateInput(orgName, repoName, [], opts, checks3),
|
|
45217
|
-
operations:
|
|
45233
|
+
operations: await resolveValidateOperations(resolve, checked)
|
|
45218
45234
|
};
|
|
45219
45235
|
const encodedBytes = commitValidateRequestBodyBytes(input);
|
|
45220
45236
|
if (encodedBytes > MAX_COMMIT_VALIDATION_ENCODED_BYTES) {
|
|
@@ -46652,7 +46668,7 @@ function submissionPath(identity2) {
|
|
|
46652
46668
|
}
|
|
46653
46669
|
function createRequestBody(source, groupSize, readThings, checks3) {
|
|
46654
46670
|
const iterator = createNormalizedOperationIterator(source, false, checks3);
|
|
46655
|
-
const resolve = checks3
|
|
46671
|
+
const resolve = resolverFor(checks3, readThings);
|
|
46656
46672
|
let position = 0;
|
|
46657
46673
|
let closed = false;
|
|
46658
46674
|
const observeSourceReturn = async (returned) => {
|
|
@@ -46815,7 +46831,7 @@ function createStreamingSubmissionHandle(input, deps) {
|
|
|
46815
46831
|
// ../../packages/sdk-ts/package.json
|
|
46816
46832
|
var package_default = {
|
|
46817
46833
|
name: "@warmhub/sdk-ts",
|
|
46818
|
-
version: "0.
|
|
46834
|
+
version: "0.144.0",
|
|
46819
46835
|
private: false,
|
|
46820
46836
|
type: "module",
|
|
46821
46837
|
description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
|
|
@@ -53792,6 +53808,9 @@ var flag = {
|
|
|
53792
53808
|
...def
|
|
53793
53809
|
})
|
|
53794
53810
|
};
|
|
53811
|
+
var committerFlag = flag.string({
|
|
53812
|
+
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
53813
|
+
});
|
|
53795
53814
|
function defineDomain(def) {
|
|
53796
53815
|
return def;
|
|
53797
53816
|
}
|
|
@@ -54111,11 +54130,16 @@ function decorateJsonlRows(items, decorations) {
|
|
|
54111
54130
|
});
|
|
54112
54131
|
}
|
|
54113
54132
|
function emitPartialPageHint(ctx, count, _nextCursor, _limit) {
|
|
54114
|
-
if (ctx.format === "json"
|
|
54133
|
+
if (ctx.format === "json")
|
|
54115
54134
|
return;
|
|
54116
54135
|
const c = ctx.colors;
|
|
54117
54136
|
ctx.status(`${c.yellow}${count} shown; more available${c.reset}. Use ${c.cyan}--all${c.reset} to fetch every page.`);
|
|
54118
54137
|
}
|
|
54138
|
+
function emitNoMatchHint(ctx, match, count) {
|
|
54139
|
+
if (!match || count > 0 || ctx.format === "json")
|
|
54140
|
+
return;
|
|
54141
|
+
ctx.status(`${ctx.colors.yellow}No results match "${match}"${ctx.colors.reset}. --match globs the Thing name, not its Shape; use ${ctx.colors.cyan}--shape <Shape>${ctx.colors.reset} to filter by Shape.`);
|
|
54142
|
+
}
|
|
54119
54143
|
|
|
54120
54144
|
// ../../packages/warmhub-cli/src/domains/commit-output-contract-id.ts
|
|
54121
54145
|
var COMMIT_SUBMIT_OUTPUT_SCHEMA_ID = "wh.commit.submit.result/v0.11";
|
|
@@ -54590,9 +54614,7 @@ var createFlags = {
|
|
|
54590
54614
|
description: "Pinned target version the claim is affirmed for (repeatable): name@vN"
|
|
54591
54615
|
}),
|
|
54592
54616
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
54593
|
-
committer:
|
|
54594
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
54595
|
-
})
|
|
54617
|
+
committer: committerFlag
|
|
54596
54618
|
};
|
|
54597
54619
|
var reviseFlags = {
|
|
54598
54620
|
shape: shapeChoiceFlags.shape,
|
|
@@ -54603,9 +54625,7 @@ var reviseFlags = {
|
|
|
54603
54625
|
description: "Complete affirmation set for the changed claim (repeatable); omitted clears it"
|
|
54604
54626
|
}),
|
|
54605
54627
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
54606
|
-
committer:
|
|
54607
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
54608
|
-
})
|
|
54628
|
+
committer: committerFlag
|
|
54609
54629
|
};
|
|
54610
54630
|
var reaffirmFlags = {
|
|
54611
54631
|
add: flag.string({
|
|
@@ -54620,9 +54640,7 @@ var reaffirmFlags = {
|
|
|
54620
54640
|
description: "only reaffirm if the assertion is still at this version (optimistic concurrency)"
|
|
54621
54641
|
}),
|
|
54622
54642
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
54623
|
-
committer:
|
|
54624
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
54625
|
-
})
|
|
54643
|
+
committer: committerFlag
|
|
54626
54644
|
};
|
|
54627
54645
|
var retractFlags = {
|
|
54628
54646
|
reason: flag.string({ description: "Reason for retraction (<=500 chars)" }),
|
|
@@ -54630,9 +54648,7 @@ var retractFlags = {
|
|
|
54630
54648
|
description: "only retract if the target is still at this version (optimistic concurrency)"
|
|
54631
54649
|
}),
|
|
54632
54650
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
54633
|
-
committer:
|
|
54634
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
54635
|
-
})
|
|
54651
|
+
committer: committerFlag
|
|
54636
54652
|
};
|
|
54637
54653
|
var handleRevise = async (ctx, { flags, args }) => {
|
|
54638
54654
|
const name = args[0];
|
|
@@ -55041,9 +55057,7 @@ var createFlags2 = {
|
|
|
55041
55057
|
description: "read thing data from a JSON object file (portable alternative to inline --data)"
|
|
55042
55058
|
}),
|
|
55043
55059
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
55044
|
-
committer:
|
|
55045
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
55046
|
-
})
|
|
55060
|
+
committer: committerFlag
|
|
55047
55061
|
};
|
|
55048
55062
|
var handleCreate2 = async (ctx, { flags, args }) => {
|
|
55049
55063
|
const name = args[0];
|
|
@@ -55681,7 +55695,7 @@ var headFlags = {
|
|
|
55681
55695
|
}),
|
|
55682
55696
|
where: flag.string({
|
|
55683
55697
|
multiple: true,
|
|
55684
|
-
description: `Field-value WHERE predicate (repeatable). Syntax: field=val, field>=val, field~prefix*, field in:[a,b] (max ${MAX_WHERE_IN_VALUES} values), field? (exists). Predicates are served by the typed field index; unservable fields return a machine-readable field-index error instead of scanning JSONB bodies.`
|
|
55698
|
+
description: `Field-value WHERE predicate (repeatable). Syntax: field=val, field>=val, field~prefix*, field in:[a,b] (max ${MAX_WHERE_IN_VALUES} values), field? (exists). Text comparisons ignore case. Predicates are served by the typed field index; unservable fields return a machine-readable field-index error instead of scanning JSONB bodies.`
|
|
55685
55699
|
})
|
|
55686
55700
|
};
|
|
55687
55701
|
var handleHead = async (ctx, { flags, args }) => {
|
|
@@ -55823,6 +55837,7 @@ var handleHead = async (ctx, { flags, args }) => {
|
|
|
55823
55837
|
if (!all && result.nextCursor) {
|
|
55824
55838
|
emitPartialPageHint(ctx, (result.items ?? []).length, result.nextCursor, boundedLimit);
|
|
55825
55839
|
}
|
|
55840
|
+
emitNoMatchHint(ctx, match, (result.items ?? []).length);
|
|
55826
55841
|
writePageOutput(ctx, result.items ?? [], {
|
|
55827
55842
|
limit: all ? pageLimit : boundedLimit,
|
|
55828
55843
|
nextCursor: result.nextCursor ?? null,
|
|
@@ -55899,7 +55914,7 @@ var queryFlags = {
|
|
|
55899
55914
|
}),
|
|
55900
55915
|
where: flag.string({
|
|
55901
55916
|
multiple: true,
|
|
55902
|
-
description: `Field-value WHERE predicate (repeatable). Syntax: field=val, field>=val, field~prefix*, field in:[a,b] (max ${MAX_WHERE_IN_VALUES} values), field? (exists). Predicates are served by the typed field index; unservable fields return a machine-readable field-index error instead of scanning JSONB bodies.`
|
|
55917
|
+
description: `Field-value WHERE predicate (repeatable). Syntax: field=val, field>=val, field~prefix*, field in:[a,b] (max ${MAX_WHERE_IN_VALUES} values), field? (exists). Text comparisons ignore case. Predicates are served by the typed field index; unservable fields return a machine-readable field-index error instead of scanning JSONB bodies.`
|
|
55903
55918
|
})
|
|
55904
55919
|
};
|
|
55905
55920
|
var handleQuery = async (ctx, { flags }) => {
|
|
@@ -56061,6 +56076,7 @@ var handleQuery = async (ctx, { flags }) => {
|
|
|
56061
56076
|
if (!all && result.nextCursor) {
|
|
56062
56077
|
emitPartialPageHint(ctx, (result.items ?? []).length, result.nextCursor, boundedLimit);
|
|
56063
56078
|
}
|
|
56079
|
+
emitNoMatchHint(ctx, match, (result.items ?? []).length);
|
|
56064
56080
|
writePageOutput(ctx, result.items ?? [], {
|
|
56065
56081
|
limit: all ? pageLimit : boundedLimit,
|
|
56066
56082
|
nextCursor: result.nextCursor ?? null,
|
|
@@ -56342,9 +56358,7 @@ var restoreFlags = {
|
|
|
56342
56358
|
description: "only restore if the target is still at this version (optimistic concurrency)"
|
|
56343
56359
|
}),
|
|
56344
56360
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
56345
|
-
committer:
|
|
56346
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
56347
|
-
}),
|
|
56361
|
+
committer: committerFlag,
|
|
56348
56362
|
"lease-id": flag.string({
|
|
56349
56363
|
description: "Read-lease token from `wh thing lease` (auto-released on success)"
|
|
56350
56364
|
})
|
|
@@ -56383,9 +56397,7 @@ var retractFlags2 = {
|
|
|
56383
56397
|
description: "only retract if the target is still at this version (optimistic concurrency)"
|
|
56384
56398
|
}),
|
|
56385
56399
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
56386
|
-
committer:
|
|
56387
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
56388
|
-
}),
|
|
56400
|
+
committer: committerFlag,
|
|
56389
56401
|
"lease-id": flag.string({
|
|
56390
56402
|
description: "Read-lease token from `wh thing lease` (auto-released on success)"
|
|
56391
56403
|
})
|
|
@@ -56424,9 +56436,7 @@ var reviseFlags2 = {
|
|
|
56424
56436
|
...keepShapesFlag,
|
|
56425
56437
|
data: flag.string({ description: "Data payload (JSON)" }),
|
|
56426
56438
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
56427
|
-
committer:
|
|
56428
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
56429
|
-
}),
|
|
56439
|
+
committer: committerFlag,
|
|
56430
56440
|
"expected-version": flag.number({
|
|
56431
56441
|
description: "Only apply if the target is still at this version (optimistic concurrency)"
|
|
56432
56442
|
}),
|
|
@@ -57359,7 +57369,7 @@ var listFlags = {
|
|
|
57359
57369
|
all: flag.boolean({ description: "Fetch all pages" }),
|
|
57360
57370
|
count: flag.boolean({ description: "Return count of matching assertions" }),
|
|
57361
57371
|
field: flag.string({
|
|
57362
|
-
description: "
|
|
57372
|
+
description: "data-field equality filter (data.path=value); served by the typed field index; text ignores case"
|
|
57363
57373
|
}),
|
|
57364
57374
|
match: flag.string({ description: "Filter by wref glob pattern" }),
|
|
57365
57375
|
"resolve-collections": flag.boolean({
|
|
@@ -57453,6 +57463,7 @@ var handleList = async (ctx, { flags, args }) => {
|
|
|
57453
57463
|
if (!all && result2.nextCursor) {
|
|
57454
57464
|
emitPartialPageHint(ctx, (result2.items ?? []).length, result2.nextCursor, boundedLimit);
|
|
57455
57465
|
}
|
|
57466
|
+
emitNoMatchHint(ctx, match, (result2.items ?? []).length);
|
|
57456
57467
|
writePageOutput(ctx, result2.items ?? [], {
|
|
57457
57468
|
limit: all ? pageLimit : boundedLimit,
|
|
57458
57469
|
nextCursor: result2.nextCursor ?? null,
|
|
@@ -57700,6 +57711,9 @@ Run \`wh auth login --profile ${explicitProfile}\` to create it.`);
|
|
|
57700
57711
|
}
|
|
57701
57712
|
|
|
57702
57713
|
// ../../packages/warmhub-cli/src/scope-parse.ts
|
|
57714
|
+
function fail(message, hint) {
|
|
57715
|
+
throw new CliError(2 /* UserInput */, "USER_INPUT", message, undefined, hint);
|
|
57716
|
+
}
|
|
57703
57717
|
var ENTRY_KEYS = new Set(["resource", "permissions", "grants"]);
|
|
57704
57718
|
var PAIR_KEYS = new Set(["allowedMatches", "allowedShapes"]);
|
|
57705
57719
|
var SHAPE_LIST_KEYS = ["shapes", "shapesAll", "shapesNot"];
|
|
@@ -57718,54 +57732,54 @@ function parseScopeEntriesJson(json2, opts) {
|
|
|
57718
57732
|
try {
|
|
57719
57733
|
parsed = JSON.parse(json2);
|
|
57720
57734
|
} catch {
|
|
57721
|
-
|
|
57735
|
+
fail(`${flagLabel} must be valid JSON`, inputHint);
|
|
57722
57736
|
}
|
|
57723
57737
|
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
57724
|
-
|
|
57738
|
+
fail(`${flagLabel} must be a non-empty JSON array`, inputHint);
|
|
57725
57739
|
}
|
|
57726
57740
|
return parsed.map((entry, i) => {
|
|
57727
57741
|
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
57728
|
-
|
|
57742
|
+
fail(`${flagLabel} entry ${i + 1}: must be an object`, inputHint);
|
|
57729
57743
|
}
|
|
57730
57744
|
const obj = entry;
|
|
57731
57745
|
if ("allowedMatches" in obj || "allowedShapes" in obj) {
|
|
57732
|
-
|
|
57746
|
+
fail(`${flagLabel} entry ${i + 1}: allowedMatches and allowedShapes are no longer scope-entry fields; use grants: [{"allowedMatches": [...], "allowedShapes": {...}}]`, grantsHint(flagLabel));
|
|
57733
57747
|
}
|
|
57734
57748
|
const unknownKey = Object.keys(obj).find((key) => !ENTRY_KEYS.has(key));
|
|
57735
57749
|
if (unknownKey !== undefined) {
|
|
57736
|
-
|
|
57750
|
+
fail(`${flagLabel} entry ${i + 1}: unknown key "${unknownKey}"`, `Entry keys are resource, permissions, grants. Example: ${exampleCommand(flagLabel)}`);
|
|
57737
57751
|
}
|
|
57738
57752
|
if (!Array.isArray(obj.permissions) || obj.permissions.length === 0 || obj.permissions.some((p) => typeof p !== "string" || p.trim().length === 0)) {
|
|
57739
|
-
|
|
57753
|
+
fail(`${flagLabel} entry ${i + 1}: "permissions" must be a non-empty array of non-empty strings`, inputHint);
|
|
57740
57754
|
}
|
|
57741
57755
|
if (obj.resource !== undefined && typeof obj.resource !== "string") {
|
|
57742
|
-
|
|
57756
|
+
fail(`${flagLabel} entry ${i + 1}: "resource" must be a string`, inputHint);
|
|
57743
57757
|
}
|
|
57744
57758
|
let grants;
|
|
57745
57759
|
if (obj.grants !== undefined) {
|
|
57746
57760
|
if (!Array.isArray(obj.grants) || obj.grants.length === 0) {
|
|
57747
|
-
|
|
57761
|
+
fail(`${flagLabel} entry ${i + 1}: "grants" must be a non-empty array of pairs`, grantsHint(flagLabel));
|
|
57748
57762
|
}
|
|
57749
57763
|
grants = obj.grants.map((pair, pairIndex) => {
|
|
57750
57764
|
const label = `${flagLabel} entry ${i + 1} grants pair ${pairIndex + 1}`;
|
|
57751
57765
|
if (typeof pair !== "object" || pair === null || Array.isArray(pair)) {
|
|
57752
|
-
|
|
57766
|
+
fail(`${label}: must be an object`, grantsHint(flagLabel));
|
|
57753
57767
|
}
|
|
57754
57768
|
const fields = pair;
|
|
57755
57769
|
const unknown2 = Object.keys(fields).find((key) => !PAIR_KEYS.has(key));
|
|
57756
57770
|
if (unknown2 !== undefined) {
|
|
57757
|
-
|
|
57771
|
+
fail(`${label}: unknown key "${unknown2}"`, grantsHint(flagLabel));
|
|
57758
57772
|
}
|
|
57759
57773
|
let allowedMatches;
|
|
57760
57774
|
if (fields.allowedMatches !== undefined) {
|
|
57761
57775
|
if (!Array.isArray(fields.allowedMatches) || fields.allowedMatches.length === 0 || fields.allowedMatches.some((m) => typeof m !== "string" || m.trim().length === 0)) {
|
|
57762
|
-
|
|
57776
|
+
fail(`${label}: "allowedMatches" must be a non-empty array of non-empty strings`, grantsHint(flagLabel));
|
|
57763
57777
|
}
|
|
57764
57778
|
allowedMatches = fields.allowedMatches.map((m) => m.trim());
|
|
57765
57779
|
}
|
|
57766
57780
|
const allowedShapes = fields.allowedShapes === undefined ? undefined : parseAllowedShapes(fields.allowedShapes, flagLabel, label);
|
|
57767
57781
|
if (allowedMatches === undefined && (allowedShapes === undefined || Object.values(allowedShapes).every((v) => v === undefined))) {
|
|
57768
|
-
|
|
57782
|
+
fail(`${label}: pair must restrict allowedMatches or allowedShapes`, grantsHint(flagLabel));
|
|
57769
57783
|
}
|
|
57770
57784
|
return {
|
|
57771
57785
|
...allowedMatches && { allowedMatches },
|
|
@@ -57774,7 +57788,7 @@ function parseScopeEntriesJson(json2, opts) {
|
|
|
57774
57788
|
});
|
|
57775
57789
|
}
|
|
57776
57790
|
if (grants !== undefined && (typeof obj.resource !== "string" || !obj.resource.includes("/"))) {
|
|
57777
|
-
|
|
57791
|
+
fail(`${flagLabel} entry ${i + 1}: grants would restrict nothing on ${typeof obj.resource === "string" ? `the org entry "${obj.resource}"` : "an entry without a resource"}; name and Shape restrictions apply only to a repository entry`, `Name the repository. Example: ${exampleCommand(flagLabel)}`);
|
|
57778
57792
|
}
|
|
57779
57793
|
const result = {
|
|
57780
57794
|
permissions: obj.permissions.map((p) => p.trim())
|
|
@@ -57788,7 +57802,7 @@ function parseScopeEntriesJson(json2, opts) {
|
|
|
57788
57802
|
}
|
|
57789
57803
|
function parseAllowedShapes(value, flagLabel, label) {
|
|
57790
57804
|
const refuse = (message) => {
|
|
57791
|
-
|
|
57805
|
+
fail(`${label}: "allowedShapes" ${message}`, `Keys are shapes, shapesAll, shapesNot (1-${MAX_ALLOWED_SHAPES_PER_LIST} Shape names each) and shapeless (boolean). Example: ${exampleCommand(flagLabel)}`);
|
|
57792
57806
|
};
|
|
57793
57807
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
57794
57808
|
refuse("must be an object");
|
|
@@ -58916,9 +58930,7 @@ var CANONICAL_COLLECTION_TYPE_USAGE = "<arc|bond|pair|set|list>";
|
|
|
58916
58930
|
var commonWriteFlags = {
|
|
58917
58931
|
"event-request-id": operationEventRequestIdFlag,
|
|
58918
58932
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
58919
|
-
committer:
|
|
58920
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
58921
|
-
})
|
|
58933
|
+
committer: committerFlag
|
|
58922
58934
|
};
|
|
58923
58935
|
var collectionInputFlags = {
|
|
58924
58936
|
members: flag.string({
|
|
@@ -59612,9 +59624,7 @@ var createFlags3 = {
|
|
|
59612
59624
|
}),
|
|
59613
59625
|
"submission-id": operationEventSubmissionIdFlag,
|
|
59614
59626
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
59615
|
-
committer:
|
|
59616
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
59617
|
-
}),
|
|
59627
|
+
committer: committerFlag,
|
|
59618
59628
|
"component-ref": flag.string({
|
|
59619
59629
|
description: "attribute writes to an actively installed component (Org/Name); the server checks caller authorization."
|
|
59620
59630
|
}),
|
|
@@ -63242,7 +63252,7 @@ var handleCreate3 = async (ctx, { flags, args }) => {
|
|
|
63242
63252
|
});
|
|
63243
63253
|
writeOutput(ctx, result, () => {
|
|
63244
63254
|
const c = ctx.colors;
|
|
63245
|
-
ctx.status(`${c.green}Created credential set${c.reset} ${c.cyan}${name}${c.reset} (${scope}) in ${c.cyan}${formatCredentialContextTarget(context)}${c.reset}`);
|
|
63255
|
+
ctx.status(`${c.green}Created credential set${c.reset} ${c.cyan}${name}${c.reset} (${result.scope}) in ${c.cyan}${formatCredentialContextTarget(context)}${c.reset}`);
|
|
63246
63256
|
});
|
|
63247
63257
|
};
|
|
63248
63258
|
var handleList3 = async (ctx, { flags }) => {
|
|
@@ -65110,8 +65120,10 @@ var handleAddMember = async (ctx, { flags, args }) => {
|
|
|
65110
65120
|
writeOutput(ctx, result, () => {
|
|
65111
65121
|
if (result.status === "pending") {
|
|
65112
65122
|
ctx.status(`${c.green}Invited${c.reset} ${c.bold}${email3}${c.reset} to ${c.bold}${orgName}${c.reset} as ${c.cyan}${result.role}${c.reset} ${c.dim}— invite email pending${c.reset}`);
|
|
65113
|
-
} else {
|
|
65123
|
+
} else if (result.status === "active") {
|
|
65114
65124
|
ctx.status(`${c.green}Added${c.reset} ${c.bold}${email3}${c.reset} to ${c.bold}${orgName}${c.reset} as ${c.cyan}${result.role}${c.reset}`);
|
|
65125
|
+
} else {
|
|
65126
|
+
ctx.status(`${c.bold}${email3}${c.reset} in ${c.bold}${orgName}${c.reset}: membership status ${result.status}`);
|
|
65115
65127
|
}
|
|
65116
65128
|
});
|
|
65117
65129
|
};
|
|
@@ -65167,7 +65179,7 @@ var handleListMembers = async (ctx, { args, flags }) => {
|
|
|
65167
65179
|
for (const m of members) {
|
|
65168
65180
|
const name = [m.firstName, m.lastName].filter(Boolean).join(" ");
|
|
65169
65181
|
const display = name ? ` ${c.dim}(${name})${c.reset}` : "";
|
|
65170
|
-
const status = m.status === "pending" ? ` ${c.yellow}pending${c.reset}` : ` ${c.dim}
|
|
65182
|
+
const status = m.status === "pending" ? ` ${c.yellow}pending${c.reset}` : ` ${c.dim}${m.status}${c.reset}`;
|
|
65171
65183
|
ctx.out(` ${c.cyan}${m.email}${c.reset}${display} ${c.dim}${m.role}${c.reset}${status}`);
|
|
65172
65184
|
}
|
|
65173
65185
|
});
|
|
@@ -65453,7 +65465,7 @@ var ORG_DOMAIN = defineDomain({
|
|
|
65453
65465
|
});
|
|
65454
65466
|
|
|
65455
65467
|
// ../../packages/warmhub-cli/src/domains/prime-content.md
|
|
65456
|
-
var prime_content_default = "# WarmHub CLI Context\n> **Context Recovery**: Run `wh prime` after compaction or new session\n\n## Environment\n{{REPO_LINE}}\n\n## Core Concepts\n- **Thing**: A named entity versioned by writes. **Assertion**: A thing that makes a shape-validated claim about another thing.\n- **Shape**: A thing defining data structure. **Write**: One or more add/revise/retract operations with per-operation results.\n- **wref**: A thing's full name: `alice`, or `hub/shapes/Player` for a Shape. Cross-repo: `wh:org/repo/alice`.\n\n## Versioned Wrefs\n- `hub/shapes/X` addresses the Shape X. `@vN` pins a version. `--shape` takes bare names.\n- Floating write refs to retracted targets fail; existing pinned versions remain valid.\n- Rename invalidates old spellings, including `@vN`; the new name resolves history.\n- Untyped wrefs accept any thing. `wref<T>` requires the target's shape to be `T`; a shape has no shape, so never satisfies it. `wref?` coalesces only `thing_absent`, never a missing shape.\n- Wref `binding`: `identity` follows the Thing, `versioned` pins.\n\n## Key Workflows\n\n**Write data** (discover shapes → scaffold ops → submit):\n```bash\nwh shape list --repo org/repo # list available shapes\nwh shape view ShapeName --repo org/repo # inspect fields\nwh shape template ShapeName -o ops.json --repo org/repo # scaffold write ops (supports --kind assertion)\n# edit ops.json — fill FILL_IN placeholders — then:\nwh commit submit --file ops.json --dry-run --repo org/repo # preview; remove --dry-run to submit\n# or single assertion (no file needed):\nwh assertion create my-assertion --shape ShapeName --about target --data '{\"field\":1}' --repo org/repo # ShapeName composes Assertion\n# Relay failed operation details when present. Never hand-guess ops JSON — use `wh shape template <Shape>`.\n```\n\n**Read data:**\n```bash\nwh thing list --repo org/repo # all things at HEAD\nwh thing view alice --repo org/repo # inspect a thing\nwh thing query --shape MyShape --repo org/repo # find things by shape\nwh thing about hub/shapes/X --repo org/repo # assertions about a shape\nwh assertion list --repo org/repo # all assertions at HEAD\nwh thing history alice --repo org/repo # version history\n\n# Batch read — wh thing view is variadic (max 500 wrefs/call):\nwh thing view alice bob # variadic positionals\nwh thing view --file wrefs.txt --json # one wref per line\ncat wrefs.txt | wh thing view --format jsonl # one JSON line per *deduped* requested wref\n```\n\n## Wref Quick Reference\n\nWrites use explicit names and wrefs. Untyped fields, collection members,\nassertion `about`, and committers accept any thing. Create a deterministic\ntarget before referencing it in the same commit.\n`WH_CLIENT_FLAGS=legacy-wrefs`: raw v1 `commit submit` only; a bare name is a Shape.\n\n## Command Reference\n\n**Global flags**: `--repo`, `--format`, `--json`, `--live`\n### thing — Things\n- `wh thing list [--shape] [--kind] [--match] [--include-retracted]` — Current HEAD state\n- `wh thing view [<wref>...] [--file <path>] [--version] [--depth] [--include-retracted] [--data-mode auto|full]` — Thing details. Variadic (max 500). `--version` implies `--include-retracted`. Batch JSON returns `{ requested, items, missing }`; jsonl emits one row per deduped requested wref. Large Set/List bodies summarize by default; use `--data-mode full` for canonical collection JSON.\n- `wh thing history [wref] [--shape] [--about] [--include-retracted]` — Version history\n- `wh thing resolve <wref>` — Resolve a wref to its canonical thing identity\n- `wh thing create <name> (--shape <S>...|--shapeless) (--data|--file)` — Create\n- `wh thing revise <name> (--shape <S>...|--shapeless|--keep-shapes) [--data] [--expected-version]` — Revise (CONFLICT if HEAD≠n)\n- `wh thing retract <name> -m <message> [--reason] [--expected-version]` — Retract\n- `wh thing query [--shape] [--kind] [--about] [--match]` — Query by filters\n- `wh thing search <query> [--shape] [--kind] [--about] [--mode]` — Search text\n- `wh thing rename <name> <newName>` — Rename\n- `wh thing refs <wref> [--inbound] [--outbound] [--field]` — Show field references; use `wh thing about` for assertions about the target thing\n- `wh thing about <wref> [--shape] [--match] [--depth] [--resolve-collections] [--role from|to|ends] [--limit] [--include-retracted]` — Show assertions about the target identity; `--resolve-collections` expands bare/@HEAD/@ALL members, `--role` filters direction; not pinned @vN\n\n- `wh view evaluate VIEW [--limit N] [--cursor TOK] [--all]`\n### commit — Write operations\n- `wh commit submit [--ops|--file|--add|--revise|--retract] [--dry-run] [--skip-existing]` — Submit operations, or evaluate the complete bounded input without durable changes under `--dry-run`. JSONL preview emits one operation row per input plus one summary.\n- `wh shape template <shape> [shape2 ...] [--kind] [--operation add|revise|retract] [-o file]` — Generate sample ops\n\n### assertion — Assertion operations\n- `wh assertion list [--about wref] [--shape] [--match] [--include-retracted]` — Browse assertions\n- `wh assertion view <wref> [--version] [--include-retracted]` — Assertion details\n- `wh assertion create --shape <s> --name <n> --about <wref> [--data] [-m] [--committer]` — Create assertion\n- `wh assertion revise <wref> --data <json> [--message] [--committer]` — Revise assertion\n- `wh assertion retract <wref> -m <message> [--reason] [--committer] [--expected-version]` — Retract assertion\n- `wh assertion history <wref> [--include-retracted]` — Assertion history\n\n### shape — Shape management\n- `wh shape list [--match] [--include-retracted]` — List all shapes\n- `wh shape view <name> [--include-retracted]` — Shape details\n- `wh shape revise <name> (--fields|--file)`\n- `wh shape create <name> (--fields|--file)`\n- `wh shape retract <name> -m <message> [--reason] [--expected-version]` — Retract shape\n- `wh shape history <name> [--include-retracted]` — Shape history\n- `wh shape rename <oldName> <newName>` — Rename shape\n\n### repo — Repository management\n- `wh repo create <org/name> [--display-name] [--description] [--visibility]` — Create repo\n- `wh repo list [org]` — List repos\n- `wh repo view [org/repo]` — Repo details\n\n### org — Organization management\n- `wh org create <name> [--display-name]` — Create a new organization\n- `wh org view <name>` — View organization details (alias: info)\n- `wh org list` — List all organizations\n\n### sub — Subscription management\n- `wh sub create <name> [flags]` — Create a subscription\n- `wh sub view <name>` — View subscription details\n- `wh sub list` — List all subscriptions\n- `wh sub log <name>` — Tail subscription delivery feed\n- `wh sub attempts <runId>` — Show attempt history for a run\n- `wh sub pause <name>` — Pause a subscription\n- `wh sub resume <name>` — Resume a paused subscription\n- `wh sub bind <name> [--credentials]` — Bind a credential set to a subscription for webhook auth\n- `wh sub unbind <name>` — Remove credential binding from a subscription\n- `wh sub delete <name>` — Retire; name reserved\n\n### notifications — Action notification listing\n- `wh notifications [--limit] [--since]` — List repo-scoped action notifications\n\n### credential — Credential set management\n- `wh credential create <name> [--repo org/repo | --org org] [--scope] [--description]` — Create an empty credential set\n- `wh credential list [--repo org/repo | --org org]` — List credential sets accessible from a repo or org\n- `wh credential view <name> [--repo org/repo | --org org]` — View a credential set (key names only, no values)\n- `wh credential delete <name> [--repo org/repo | --org org]` — Delete a credential set and its Vault object\n- `wh credential set <setName> [<keyName>] [--repo org/repo | --org org] [--value]` — Set credential key(s). With `<keyName>`: single-key form (reads value from `--value` or stdin). Without `<keyName>`: batch form (reads JSON object from stdin, e.g. `{\"KEY\":\"val\"}`)\n- `wh credential unset <setName> <keyName> [--repo org/repo | --org org]` — Remove a key from a credential set\n- `wh credential audit <setName> [--repo org/repo | --org org]` — View audit log for a credential set\n- `wh credential revoke <setName> [--repo org/repo | --org org] [--reason]` — Revoke a credential set (blocks new binds and stops bound webhook deliveries)\n\n### component — Component management\n- `wh component validate <path>` — Validate package\n- `wh component install <org/name>` — Install; resource-phase CONFLICT → 2, degraded replay → 1\n- `wh component register <name> --org <org> --manifest <path> [flags]` — Register component identity\n- `wh component unregister <org/name>` — Remove a registered component identity\n- `wh component registry list --org <org>` — List registered components\n- `wh component registry view <org/name>` — View a registered component\n- `wh component registry update <org/name> [flags]` — Update a registered component\n- `wh component list` — List installed components\n- `wh component update <org/name>` — Update; resource-phase CONFLICT → 2, degraded replay → 1\n- `wh component view <org/name>` — Show component details (alias: show)\n- `wh component doctor <org/name>` — Health; degraded/error/uninstalled → exit 1\n- `wh component teardown <org/name>` — Pause component subscriptions\n\n### Getting More Info\n- `wh help` — help overview\n- `wh <domain>` — domain verbs\n- `wh <domain> <verb> --help` — verb flags and examples\n- `wh help --format json` — `CliSpecV2` (`schemaVersion: 2`): global/contextual/root tables and command overrides\n\n## Common Workflows\n\n**Explore a repo:**\n```bash\nwh thing list --repo org/repo # see all things in HEAD\nwh thing view alice --repo org/repo # inspect a specific thing\nwh thing history alice --repo org/repo # inspect version history\nwh thing about alice # assertions about a thing\n```\n\n**Create an assertion** (most common write):\n```bash\n# Assertion = Shape with composes:[\"Assertion\"]; write a thing with data.about.\n# --about is written as data.about.\nwh assertion create my-assertion --shape MyShape --about target-name \\\n --data '{\"field_a\":1,\"field_b\":\"value\"}' --repo org/repo\n# Output includes per-operation status; relay failures.\n```\n\n**Write entrypoint** (batches and streams):\n```bash\nwh commit submit --add my-item --shape MyShape \\\n --about target-name --data '{\"field_a\":1}' --repo org/repo\n```\n\n**Batch write via file** (generate template → edit → submit):\n```bash\nwh shape template Hypothesis Evidence -o ops.json # --kind assertion --about X for assertions\n# edit ops.json — fill FILL_IN placeholders\nwh commit submit --file ops.json -m \"batch update\" # submit all ops (bare `wh commit` is equivalent)\n# --file format: docs.warmhub.ai/cli-reference/commit-operations\n```\n\n**Bulk write (JSONL stream, >1k ops)** — one chunked stream beats per-record commits (~60× faster):\n```bash\nwh shape template MyShape -o ops.jsonl # one op per line (.jsonl)\nID=\"bulk-$(date +%s)\" # caller id for chunk correlation\nwh commit submit --file ops.jsonl --stream-id \"$ID\" --chunk-size 5000 \\\n --skip-existing --progress -m \"bulk ingest\" --repo org/repo\n# --chunk-size: ops per append chunk (default 1000, max 10000); chunk≈1 is ~60× slower\n# --skip-existing: skips already-written add ops (drops per-row read-before-write)\n# --stream-id identifies the submission but provides no receipt or resume.\n# After an outcome-unknown append, stop writes and reconcile attempted + unsent\n# work from a later verified checkpoint; never blindly replay revise/retract.\n```\n\n**Create collections:**\n```bash\nwh commit submit --add route --shape Arc --data '{\"from\":\"a\",\"to\":\"b\"}'\nwh assertion create route-support --shape Supports --about route --data '{\"confidence\":0.8}' --repo org/repo\n```\n\n**Modify data:**\n```bash\nwh thing revise my-item --keep-shapes --data '{\"x\":5,\"y\":3}' -m \"update\" --repo org/repo\nwh thing retract old-item -m \"withdrawn\" --reason \"data feed contaminated\" --repo org/repo\n```\n\n**Query and filter:**\n```bash\nwh thing query --shape MyShape # by shape\nwh thing query --kind assertion --about alice # by kind + target\nwh thing history alice --limit 10 # version history\n```\n\n## Built-in Content shape\n\nWarmHub repos expose three well-known content Things (Shape `Content`):\n- `Readme` — stored markdown for humans\n- `Agents` — stored markdown guidance for AI agents\n- `LlmsTxt` — synthesized per-request sitemap (read-only)\n\nFetch via `wh repo content get --kind readme|agents|llms-txt`,\n`client.repo.getReadme/getAgents/getLlmsTxt`, MCP `warmhub_repo_content_get`,\nor raw HTTP `GET /{org}/{repo}/readme.md|agents.md|llms.txt`.\nSee `wh repo describe` → `additionalInformation` for the discovery field.\n\n## Query Discipline\n- Plan the repo, shapes, and wrefs you need before the first query.\n- Gather the needed facts from one repo before switching to another.\n- Do the queries first, then write one complete answer.\n\n## Agent Tips\n- **Always run commands for live data** — this context describes the CLI, not repo contents\n- **Before writing, discover wrefs** — run `wh thing list` or `wh shape list`\n- **Shape field types**: `string`, `number`, `boolean`, `wref`, arrays, optionals, nested objects\n- **Write commands return per-operation results** — relay failures and affected wrefs to the user\n- **Pass data inline** with `--data '{...}'` — do NOT create temp files\n- Add `--json` to any command for machine-readable JSON output\n- **Aliases teach canonical commands** — executing aliases emit a status hint; misleading lifecycle aliases reject and point to `retract`\n- Writes go through `wh commit submit` (or bare `wh commit`) or wrappers (`create`, `revise`, `retract`, `assertion create`). `retract` withdraws an identity and creates a history entry; `wh thing restore <durableId>` makes it active again.\n- Use `wh doctor` to check environment health\n";
|
|
65468
|
+
var prime_content_default = "# WarmHub CLI Context\n> **Context Recovery**: Run `wh prime` after compaction or new session\n\n## Environment\n{{REPO_LINE}}\n\n## Core Concepts\n- **Thing**: A named entity versioned by writes. **Assertion**: A thing that makes a shape-validated claim about another thing.\n- **Shape**: A thing defining data structure. **Write**: One or more add/revise/retract operations with per-operation results.\n- **wref**: A thing's full name: `alice`, or `hub/shapes/Player` for a Shape. Cross-repo: `wh:org/repo/alice`.\n\n## Versioned Wrefs\n- `hub/shapes/X` addresses the Shape X. `@vN` pins a version. `--shape` takes bare names.\n- Floating write refs to retracted targets fail; existing pinned versions remain valid.\n- Rename invalidates old spellings, including `@vN`; the new name resolves history.\n- Untyped wrefs accept any thing. `wref<T>` requires the target's shape to be `T`; a shape has no shape, so never satisfies it. `wref?` coalesces only `thing_absent`, never a missing shape.\n- Wref `binding`: `identity` follows the Thing, `versioned` pins.\n\n## Key Workflows\n\n**Write data** (discover shapes → scaffold ops → submit):\n```bash\nwh shape list --repo org/repo # list available shapes\nwh shape view ShapeName --repo org/repo # inspect fields\nwh shape template ShapeName -o ops.json --repo org/repo # scaffold write ops (supports --kind assertion)\n# edit ops.json — fill FILL_IN placeholders — then:\nwh commit submit --file ops.json --dry-run --repo org/repo # preview; remove --dry-run to submit\n# or single assertion (no file needed):\nwh assertion create my-assertion --shape ShapeName --about target --data '{\"field\":1}' --repo org/repo # ShapeName composes Assertion\n# Relay failed operation details when present. Never hand-guess ops JSON — use `wh shape template <Shape>`.\n```\n\n**Read data:**\n```bash\nwh thing list --repo org/repo # all things at HEAD\nwh thing view alice --repo org/repo # inspect a thing\nwh thing query --shape MyShape --repo org/repo # find things by shape\nwh thing about hub/shapes/X --repo org/repo # assertions about a shape\nwh assertion list --repo org/repo # all assertions at HEAD\nwh thing history alice --repo org/repo # version history\n\n# Batch read — wh thing view is variadic (max 500 wrefs/call):\nwh thing view alice bob # variadic positionals\nwh thing view --file wrefs.txt --json # one wref per line\ncat wrefs.txt | wh thing view --format jsonl # one JSON line per *deduped* requested wref\n```\n\n## Wref Quick Reference\n\nWrites use explicit names and wrefs. Untyped fields, collection members,\nassertion `about`, and committers accept any thing. Create a deterministic\ntarget before referencing it in the same commit.\n`WH_CLIENT_FLAGS=legacy-wrefs`: raw v1 `commit submit` only; a bare name is a Shape.\n\n## Command Reference\n\n**Global flags**: `--repo`, `--format`, `--json`, `--live`\n### thing — Things\n- `wh thing list [--shape] [--kind] [--match] [--include-retracted]` — Current HEAD state\n- `wh thing view [<wref>...] [--file <path>] [--version] [--depth] [--include-retracted] [--data-mode auto|full]` — Thing details. Variadic (max 500). `--version` implies `--include-retracted`. Batch JSON returns `{ requested, items, missing }`; jsonl emits one row per deduped requested wref. Large Set/List bodies summarize by default; use `--data-mode full` for canonical collection JSON.\n- `wh thing history [wref] [--shape] [--about] [--include-retracted]` — Version history\n- `wh thing resolve <wref>` — Resolve a wref to its canonical thing identity\n- `wh thing create <name> (--shape <S>...|--shapeless) (--data|--file)` — Create\n- `wh thing revise <name> (--shape <S>...|--shapeless|--keep-shapes) [--data] [--expected-version]` — Revise (CONFLICT if HEAD≠n)\n- `wh thing retract <name> -m <message> [--reason] [--expected-version]` — Retract\n- `wh thing query [--shape] [--kind] [--about] [--match]` — Query by filters\n- `wh thing search <query> [--shape] [--kind] [--about] [--mode]` — Search text\n- `wh thing rename <name> <newName>` — Rename\n- `wh thing refs <wref> [--inbound] [--outbound] [--field]` — Show field references; use `wh thing about` for assertions about the target thing\n- `wh thing about <wref> [--shape] [--match] [--depth] [--resolve-collections] [--role from|to|ends] [--limit] [--include-retracted]` — Show assertions about the target identity; `--resolve-collections` expands bare/@HEAD/@ALL members, `--role` filters direction; not pinned @vN\n\n- `wh view evaluate VIEW [--limit N] [--cursor TOK] [--all]`\n### commit — Write operations\n- `wh commit submit [--ops|--file|--add|--revise|--retract] [--dry-run] [--skip-existing]` — Submit operations, or evaluate the complete bounded input without durable changes under `--dry-run`. JSONL preview emits one operation row per input plus one summary.\n- `wh shape template <shape> [shape2 ...] [--kind] [--operation add|revise|retract] [-o file]` — Generate sample ops\n\n### assertion — Assertion operations\n- `wh assertion list [--about wref] [--shape] [--match] [--include-retracted]` — Browse assertions\n- `wh assertion view <wref> [--version] [--include-retracted]` — Assertion details\n- `wh assertion create --shape <s> --name <n> --about <wref> [--data] [-m] [--committer]` — Create assertion\n- `wh assertion revise <wref> --data <json> [--message] [--committer]` — Revise assertion\n- `wh assertion retract <wref> -m <message> [--reason] [--committer] [--expected-version]` — Retract assertion\n- `wh assertion history <wref> [--include-retracted]` — Assertion history\n\n### shape — Shape management\n- `wh shape list [--match] [--include-retracted]` — List all shapes\n- `wh shape view <name> [--include-retracted]` — Shape details\n- `wh shape revise <name> (--fields|--file)`\n- `wh shape create <name> (--fields|--file)`\n- `wh shape retract <name> -m <message> [--reason] [--expected-version]` — Retract shape\n- `wh shape history <name> [--include-retracted]` — Shape history\n- `wh shape rename <oldName> <newName>` — Rename shape\n\n### repo — Repository management\n- `wh repo create <org/name> [--display-name] [--description] [--visibility]` — Create repo\n- `wh repo list [org]` — List repos\n- `wh repo view [org/repo]` — Repo details\n\n### org — Organization management\n- `wh org create <name> [--display-name]` — Create a new organization\n- `wh org view <name>` — View organization details (alias: info)\n- `wh org list` — List all organizations\n\n### sub — Subscription management\n- `wh sub create <name> [flags]` — Create a subscription\n- `wh sub view <name>` — View subscription details\n- `wh sub list` — List all subscriptions\n- `wh sub log <name>` — Tail subscription delivery feed\n- `wh sub attempts <runId>` — Show attempt history for a run\n- `wh sub pause <name>` — Pause a subscription\n- `wh sub resume <name>` — Resume a paused subscription\n- `wh sub bind <name> [--credentials]` — Bind a credential set to a subscription for webhook auth\n- `wh sub unbind <name>` — Remove credential binding from a subscription\n- `wh sub delete <name>` — Retire; name reserved\n\n### notifications — Action notification listing\n- `wh notifications [--limit] [--since]` — List repo-scoped action notifications\n\n### credential — Credential set management\n- `wh credential create <name> [--repo org/repo | --org org] [--scope] [--description]` — Create an empty credential set\n- `wh credential list [--repo org/repo | --org org]` — List credential sets accessible from a repo or org\n- `wh credential view <name> [--repo org/repo | --org org]` — View a credential set (key names only, no values)\n- `wh credential delete <name> [--repo org/repo | --org org]` — Delete a credential set and its Vault object\n- `wh credential set <setName> [<keyName>] [--repo org/repo | --org org] [--value]` — Set credential key(s). With `<keyName>`: single-key form (reads value from `--value` or stdin). Without `<keyName>`: batch form (reads JSON object from stdin, e.g. `{\"KEY\":\"val\"}`)\n- `wh credential unset <setName> <keyName> [--repo org/repo | --org org]` — Remove a key from a credential set\n- `wh credential audit <setName> [--repo org/repo | --org org]` — View audit log for a credential set\n- `wh credential revoke <setName> [--repo org/repo | --org org] [--reason]` — Revoke a credential set (blocks new binds and stops bound webhook deliveries)\n\n### component — Component management\n- `wh component validate <path>` — Validate package\n- `wh component install <org/name>` — Install; resource-phase CONFLICT → 2, degraded replay → 1\n- `wh component register <name> --org <org> --manifest <path> [flags]` — Register component identity\n- `wh component unregister <org/name>` — Remove a registered component identity\n- `wh component registry list --org <org>` — List registered components\n- `wh component registry view <org/name>` — View a registered component\n- `wh component registry update <org/name> [flags]` — Update a registered component\n- `wh component list` — List installed components\n- `wh component update <org/name>` — Update; resource-phase CONFLICT → 2, degraded replay → 1\n- `wh component view <org/name>` — Show component details (alias: show)\n- `wh component doctor <org/name>` — Health; degraded/error/uninstalled → exit 1\n- `wh component teardown <org/name>` — Pause component subscriptions\n\n### Getting More Info\n- `wh help` — help overview\n- `wh <domain>` — domain verbs\n- `wh <domain> <verb> --help` — verb flags and examples\n- `wh help --format json` — `CliSpecV2` (`schemaVersion: 2`): global/contextual/root tables and command overrides\n\n## Common Workflows\n\n**Agent identities:** `wh auth status` shows your user identity; `wh token create --committer-identity wh:org/repo/agent` binds a persona to a PAT. Install `warmhub/identity` in your chosen repo and manage personas with `wh thing`. [Create an agent identity](https://docs.warmhub.ai/auth/agent-identities/) covers setup, private-repo scopes, attribution, and retirement.\n\n**Explore a repo:**\n```bash\nwh thing list --repo org/repo # see all things in HEAD\nwh thing view alice --repo org/repo # inspect a specific thing\nwh thing history alice --repo org/repo # inspect version history\nwh thing about alice # assertions about a thing\n```\n\n**Create an assertion** (most common write):\n```bash\n# Assertion = Shape with composes:[\"Assertion\"]; write a thing with data.about.\n# --about is written as data.about.\nwh assertion create my-assertion --shape MyShape --about target-name \\\n --data '{\"field_a\":1,\"field_b\":\"value\"}' --repo org/repo\n# Output includes per-operation status; relay failures.\n```\n\n**Write entrypoint** (batches and streams):\n```bash\nwh commit submit --add my-item --shape MyShape \\\n --about target-name --data '{\"field_a\":1}' --repo org/repo\n```\n\n**Batch write via file** (generate template → edit → submit):\n```bash\nwh shape template Hypothesis Evidence -o ops.json # --kind assertion --about X for assertions\n# edit ops.json — fill FILL_IN placeholders\nwh commit submit --file ops.json -m \"batch update\" # submit all ops (bare `wh commit` is equivalent)\n# --file format: docs.warmhub.ai/cli-reference/commit-operations\n```\n\n**Bulk write (JSONL stream, >1k ops)** — one chunked stream beats per-record commits (~60× faster):\n```bash\nwh shape template MyShape -o ops.jsonl # one op per line (.jsonl)\nID=\"bulk-$(date +%s)\" # caller id for chunk correlation\nwh commit submit --file ops.jsonl --stream-id \"$ID\" --chunk-size 5000 \\\n --skip-existing --progress -m \"bulk ingest\" --repo org/repo\n# --chunk-size: ops per append chunk (default 1000, max 10000); chunk≈1 is ~60× slower\n# --skip-existing: skips already-written add ops (drops per-row read-before-write)\n# --stream-id identifies the submission but provides no receipt or resume.\n# After an outcome-unknown append, stop writes and reconcile attempted + unsent\n# work from a later verified checkpoint; never blindly replay revise/retract.\n```\n\n**Create collections:**\n```bash\nwh commit submit --add route --shape Arc --data '{\"from\":\"a\",\"to\":\"b\"}'\nwh assertion create route-support --shape Supports --about route --data '{\"confidence\":0.8}' --repo org/repo\n```\n\n**Modify data:**\n```bash\nwh thing revise my-item --keep-shapes --data '{\"x\":5,\"y\":3}' -m \"update\" --repo org/repo\nwh thing retract old-item -m \"withdrawn\" --reason \"data feed contaminated\" --repo org/repo\n```\n\n**Query and filter:**\n```bash\nwh thing query --shape MyShape # by shape\nwh thing query --kind assertion --about alice # by kind + target\nwh thing history alice --limit 10 # version history\n```\n\n## Built-in Content shape\n\nWarmHub repos expose three well-known content Things (Shape `Content`):\n- `Readme` — stored markdown for humans\n- `Agents` — stored markdown guidance for AI agents\n- `LlmsTxt` — synthesized per-request sitemap (read-only)\n\nFetch via `wh repo content get --kind readme|agents|llms-txt`,\n`client.repo.getReadme/getAgents/getLlmsTxt`, MCP `warmhub_repo_content_get`,\nor raw HTTP `GET /{org}/{repo}/readme.md|agents.md|llms.txt`.\nSee `wh repo describe` → `additionalInformation` for the discovery field.\n\n## Query Discipline\n- Plan the repo, shapes, and wrefs you need before the first query.\n- Gather the needed facts from one repo before switching to another.\n- Do the queries first, then write one complete answer.\n\n## Agent Tips\n- **Always run commands for live data** — this context describes the CLI, not repo contents\n- **Before writing, discover wrefs** — run `wh thing list` or `wh shape list`\n- **Shape field types**: `string`, `number`, `boolean`, `wref`, arrays, optionals, nested objects\n- **Write commands return per-operation results** — relay failures and affected wrefs to the user\n- **Pass data inline** with `--data '{...}'` — do NOT create temp files\n- Add `--json` to any command for machine-readable JSON output\n- **Aliases teach canonical commands** — executing aliases emit a status hint; misleading lifecycle aliases reject and point to `retract`\n- Writes go through `wh commit submit` (or bare `wh commit`) or wrappers (`create`, `revise`, `retract`, `assertion create`). `retract` withdraws an identity and creates a history entry; `wh thing restore <durableId>` makes it active again.\n- Use `wh doctor` to check environment health\n";
|
|
65457
65469
|
|
|
65458
65470
|
// ../../packages/warmhub-cli/src/domains/prime.ts
|
|
65459
65471
|
function buildMarkdown(config2) {
|
|
@@ -68584,9 +68596,7 @@ var retractFlags3 = {
|
|
|
68584
68596
|
description: "only retract if the target is still at this version (optimistic concurrency)"
|
|
68585
68597
|
}),
|
|
68586
68598
|
message: flag.string({ short: "m", description: "Commit message" }),
|
|
68587
|
-
committer:
|
|
68588
|
-
description: "Committer wref: a Thing name (bot-1) or a Shape (hub/shapes/Agent)"
|
|
68589
|
-
})
|
|
68599
|
+
committer: committerFlag
|
|
68590
68600
|
};
|
|
68591
68601
|
var handleCreate7 = async (ctx, { flags, args }) => {
|
|
68592
68602
|
const shapeName = args[0];
|
|
@@ -70833,8 +70843,6 @@ async function dispatch(ctx) {
|
|
|
70833
70843
|
}
|
|
70834
70844
|
await dispatchDomain(ctx, invocation);
|
|
70835
70845
|
}
|
|
70836
|
-
// ../../packages/warmhub-cli/src/manifest/shared-infra.ts
|
|
70837
|
-
var SHARED_INFRA_SHAPES = findSystemComponent(SYSTEM_COMPONENT_ID)?.shapes.filter((shape) => shape.installInfra === true) ?? [];
|
|
70838
70846
|
// ../../packages/warmhub-cli/src/parser/binder.ts
|
|
70839
70847
|
function effectiveSpecs(specs, options) {
|
|
70840
70848
|
return specs.map((spec) => {
|
|
@@ -72240,7 +72248,7 @@ function resolveLogLevel(flagLevel, env) {
|
|
|
72240
72248
|
// package.json
|
|
72241
72249
|
var package_default3 = {
|
|
72242
72250
|
name: "@warmhub/cli",
|
|
72243
|
-
version: "0.
|
|
72251
|
+
version: "0.146.0",
|
|
72244
72252
|
private: false,
|
|
72245
72253
|
type: "module",
|
|
72246
72254
|
description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
|
|
@@ -72865,5 +72873,5 @@ process.exitCode = interceptedExitCode === undefined ? await runPreparedCli(laun
|
|
|
72865
72873
|
version: package_default3.version
|
|
72866
72874
|
}) : interceptedExitCode;
|
|
72867
72875
|
|
|
72868
|
-
//# debugId=
|
|
72869
|
-
//# warmhub-cli-build-info {"cliVersion":"0.
|
|
72876
|
+
//# debugId=C60966EBD66E31FA64756E2164756E21
|
|
72877
|
+
//# warmhub-cli-build-info {"cliVersion":"0.146.0","sdkVersion":"0.144.0"}
|
package/package.json
CHANGED