@warmhub/cli 0.129.0 → 0.131.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.
Files changed (2) hide show
  1. package/dist/wh.js +105 -65
  2. package/package.json +1 -1
package/dist/wh.js CHANGED
@@ -17780,11 +17780,6 @@ var RESERVED_COLLECTION_SHAPE_NAMES = [
17780
17780
  ...BUILTIN_SHAPE_NAMES,
17781
17781
  ...RETIRED_COLLECTION_SHAPE_NAMES
17782
17782
  ];
17783
- var COLLECTION_CLASSIFICATION_SHAPE_NAMES = [
17784
- "Collection",
17785
- ...RESERVED_COLLECTION_SHAPE_NAMES
17786
- ];
17787
- var COLLECTION_CLASSIFICATION_SHAPE_NAME_SET = new Set(COLLECTION_CLASSIFICATION_SHAPE_NAMES);
17788
17783
  function isBuiltinCollectionShape(name) {
17789
17784
  return BUILTIN_SHAPE_NAMES.includes(name);
17790
17785
  }
@@ -18029,6 +18024,14 @@ var COMMIT_OPERATION_KINDS = [
18029
18024
  "assertion",
18030
18025
  "collection"
18031
18026
  ];
18027
+ var READ_KINDS = ["thing", "shape"];
18028
+ var LEGACY_COLLECTION_READ_KIND = "collection";
18029
+ var LEGACY_ASSERTION_READ_KIND = "assertion";
18030
+ var READ_KIND_FILTERS = [
18031
+ ...READ_KINDS,
18032
+ LEGACY_COLLECTION_READ_KIND,
18033
+ LEGACY_ASSERTION_READ_KIND
18034
+ ];
18032
18035
  function splitLocalPath(name) {
18033
18036
  const idx = name.indexOf("/");
18034
18037
  if (idx === -1)
@@ -24632,6 +24635,11 @@ var VALID_PRIMITIVE_TYPES = new Set([
24632
24635
  function isPlainObject(value) {
24633
24636
  return typeof value === "object" && value !== null && !Array.isArray(value);
24634
24637
  }
24638
+ function dataAboutWref(data) {
24639
+ if (!isPlainObject(data))
24640
+ return;
24641
+ return typeof data.about === "string" ? data.about : undefined;
24642
+ }
24635
24643
  var STRING_CONSTRAINT_KEYS = new Set([
24636
24644
  "minLength",
24637
24645
  "maxLength",
@@ -40652,7 +40660,7 @@ function compareUnsignedUtf8(left, right) {
40652
40660
  var CHECKPOINT_CHUNK_BYTE_LIMIT = 67108864;
40653
40661
  var CHECKPOINT_PART_DIGITS = 10;
40654
40662
  var CHECKPOINT_FORMAT = "warmhub-repository-checkpoint";
40655
- var CHECKPOINT_FORMAT_VERSION = 3;
40663
+ var CHECKPOINT_FORMAT_VERSION = 4;
40656
40664
  var CHECKPOINT_MANIFEST_NAME = "repository-checkpoint.json";
40657
40665
  var checkpointSha256Schema = exports_external.string().regex(/^[0-9a-f]{64}$/);
40658
40666
  var nonnegativeSafeIntegerSchema = exports_external.number().int().nonnegative();
@@ -40696,14 +40704,13 @@ var checkpointRowSchema = exports_external.discriminatedUnion("kind", [
40696
40704
  checkpointRowBaseSchema.extend({
40697
40705
  kind: exports_external.literal("thing"),
40698
40706
  shapeName: exports_external.string().min(1),
40699
- collections: checkpointCollectionsSchema.optional()
40700
- }).strict(),
40701
- checkpointRowBaseSchema.extend({
40702
- kind: exports_external.literal("assertion"),
40703
- shapeName: exports_external.string().min(1),
40704
- aboutWref: pinnedWrefSchema,
40705
- affirmedWrefs: affirmedWrefsSchema
40706
- }).strict()
40707
+ collections: checkpointCollectionsSchema.optional(),
40708
+ aboutWref: pinnedWrefSchema.optional(),
40709
+ affirmedWrefs: affirmedWrefsSchema.optional()
40710
+ }).strict().refine((row) => row.aboutWref === undefined === (row.affirmedWrefs === undefined), {
40711
+ message: "A checkpoint row carries aboutWref and affirmedWrefs together or not at all",
40712
+ path: ["affirmedWrefs"]
40713
+ })
40707
40714
  ]);
40708
40715
  var checkpointManifestChunkSchema = exports_external.object({
40709
40716
  part: nonnegativeSafeIntegerSchema,
@@ -40880,8 +40887,9 @@ function validateCheckpointStreamRow(state, input) {
40880
40887
  const row = input;
40881
40888
  assertCheckpointText(row.wref);
40882
40889
  assertCheckpointText(row.durableId);
40883
- if (row.kind === "assertion")
40890
+ if (row.kind !== "shape" && row.aboutWref !== undefined) {
40884
40891
  assertCheckpointText(row.aboutWref);
40892
+ }
40885
40893
  const rowShapeName = row.kind === "shape" ? row.wref : row.shapeName;
40886
40894
  if (rowShapeName !== state.shapeName) {
40887
40895
  throw new Error("Checkpoint row is grouped under the wrong Shape stream");
@@ -40915,16 +40923,12 @@ function addOneSafe(value) {
40915
40923
  return next;
40916
40924
  }
40917
40925
  // ../../packages/rules/src/repository-export/types.ts
40918
- var REPOSITORY_EXPORT_FORMAT_VERSION = 4;
40926
+ var REPOSITORY_EXPORT_FORMAT_VERSION = 5;
40919
40927
  var REPOSITORY_EXPORT_MEDIA_TYPE = "application/x-ndjson";
40920
40928
  var repositoryExportSha256Schema = exports_external.string().regex(/^[0-9a-f]{64}$/);
40921
40929
  var nonnegativeSafeIntegerSchema2 = exports_external.number().int().nonnegative();
40922
40930
  var positiveSafeIntegerSchema2 = exports_external.number().int().positive();
40923
- var REPOSITORY_EXPORT_ROW_KINDS = [
40924
- "shape",
40925
- "thing",
40926
- "assertion"
40927
- ];
40931
+ var REPOSITORY_EXPORT_ROW_KINDS = ["shape", "thing"];
40928
40932
  var REPOSITORY_EXPORT_MODES = ["heads", "ops"];
40929
40933
  var repositoryExportShapeCertificateSchema = exports_external.string().regex(/^[^\r\n]+@v[1-9]\d*(?![\s\S])/, "Shape certificate must be a pinned wref");
40930
40934
  var repositoryExportReferenceSchema = exports_external.object({
@@ -40980,15 +40984,13 @@ var activeRowSchema = exports_external.discriminatedUnion("kind", [
40980
40984
  ...activeRowFields,
40981
40985
  kind: exports_external.literal("thing"),
40982
40986
  shapes: shapesSchema,
40983
- collections: repositoryExportCollectionsSchema.optional()
40984
- }).strict(),
40985
- exports_external.object({
40986
- ...activeRowFields,
40987
- kind: exports_external.literal("assertion"),
40988
- shapes: shapesSchema,
40989
- about: repositoryExportReferenceSchema,
40990
- affirmed: affirmedSchema
40991
- }).strict()
40987
+ collections: repositoryExportCollectionsSchema.optional(),
40988
+ about: repositoryExportReferenceSchema.optional(),
40989
+ affirmed: affirmedSchema.optional()
40990
+ }).strict().refine((row) => row.about === undefined === (row.affirmed === undefined), {
40991
+ message: "An export row carries `about` and `affirmed` together or not at all",
40992
+ path: ["affirmed"]
40993
+ })
40992
40994
  ]);
40993
40995
  var tombstoneRowSchema = exports_external.object({
40994
40996
  ...rowEnvelopeFields,
@@ -41691,6 +41693,9 @@ var COMPONENT_INSTALL_FIELDS = {
41691
41693
  "updatedAt?": "string"
41692
41694
  };
41693
41695
  var COMPONENT_CONFIG_FIELDS = {};
41696
+ var ASSERTION_FIELDS = {
41697
+ about: "wref"
41698
+ };
41694
41699
  var SYSTEM_MANIFEST = {
41695
41700
  component: {
41696
41701
  id: SYSTEM_COMPONENT_ID,
@@ -41704,7 +41709,8 @@ var SYSTEM_MANIFEST = {
41704
41709
  { name: "Arc", ...COLLECTION_V2_SHAPE_DEFS.Arc },
41705
41710
  { name: "Bond", ...COLLECTION_V2_SHAPE_DEFS.Bond },
41706
41711
  { name: "Set", ...COLLECTION_V2_SHAPE_DEFS.Set },
41707
- { name: "List", ...COLLECTION_V2_SHAPE_DEFS.List }
41712
+ { name: "List", ...COLLECTION_V2_SHAPE_DEFS.List },
41713
+ { name: "Assertion", fields: ASSERTION_FIELDS }
41708
41714
  ],
41709
41715
  credentials: [],
41710
41716
  subscriptions: [],
@@ -41718,7 +41724,8 @@ var SYSTEM_MANIFEST = {
41718
41724
  "Arc",
41719
41725
  "Bond",
41720
41726
  "Set",
41721
- "List"
41727
+ "List",
41728
+ "Assertion"
41722
41729
  ]
41723
41730
  }
41724
41731
  },
@@ -41745,7 +41752,12 @@ var SYSTEM_COMPONENT = {
41745
41752
  { name: "Arc", ...COLLECTION_V2_SHAPE_DEFS.Arc },
41746
41753
  { name: "Bond", ...COLLECTION_V2_SHAPE_DEFS.Bond },
41747
41754
  { name: "Set", ...COLLECTION_V2_SHAPE_DEFS.Set },
41748
- { name: "List", ...COLLECTION_V2_SHAPE_DEFS.List }
41755
+ { name: "List", ...COLLECTION_V2_SHAPE_DEFS.List },
41756
+ {
41757
+ name: "Assertion",
41758
+ fields: ASSERTION_FIELDS,
41759
+ priorVersions: [{ fields: {} }]
41760
+ }
41749
41761
  ]
41750
41762
  };
41751
41763
 
@@ -41753,6 +41765,7 @@ var SYSTEM_COMPONENT = {
41753
41765
  var SYSTEM_COMPONENTS = [
41754
41766
  SYSTEM_COMPONENT
41755
41767
  ];
41768
+ var SYSTEM_PROTECTED_SHAPES = SYSTEM_COMPONENT.shapes.filter((shape) => shape.installInfra !== true);
41756
41769
  var SYSTEM_INFRA_SHAPE_NAMES = new Set(SYSTEM_COMPONENTS.flatMap((entry) => entry.shapes.filter((shape) => shape.installInfra === true).map((shape) => shape.name)));
41757
41770
  function findSystemComponent(componentId) {
41758
41771
  return SYSTEM_COMPONENTS.find((entry) => entry.componentId === componentId);
@@ -43328,6 +43341,7 @@ function normalizeOptionalName(value) {
43328
43341
  }
43329
43342
 
43330
43343
  // ../../packages/sdk-ts/src/operation-normalize.ts
43344
+ var THING_ENVELOPE_ABOUT_MESSAGE = "thing add operation does not accept top-level 'about' — put the target in data.about, or use kind: 'assertion' for the deprecated envelope form";
43331
43345
  function toBackendStreamOperation(operation) {
43332
43346
  if (operation.expectedVersion !== undefined && operation.operation !== "revise" && operation.operation !== "retract" && operation.operation !== "reaffirm") {
43333
43347
  throw new Error("expectedVersion is only valid on revise, retract, or reaffirm operations — set an explicit operation discriminator");
@@ -43400,6 +43414,9 @@ function toBackendStreamOperation(operation) {
43400
43414
  };
43401
43415
  }
43402
43416
  const kind = inferOperationKind(operation);
43417
+ if (kind === "thing" && "about" in operation && operation.about !== undefined) {
43418
+ throw new Error(THING_ENVELOPE_ABOUT_MESSAGE);
43419
+ }
43403
43420
  const skipExisting = "skipExisting" in operation ? operation.skipExisting : undefined;
43404
43421
  if (kind !== "collection" && (("type" in operation) && operation.type !== undefined || ("members" in operation) && operation.members !== undefined)) {
43405
43422
  throw new Error(`add operation '${operation.name ?? ""}' has collection fields but resolved kind '${kind}' — collection adds require both 'type' and 'members', or set kind: 'collection'`);
@@ -43414,10 +43431,11 @@ function toBackendStreamOperation(operation) {
43414
43431
  throw new Error("add operation requires a name");
43415
43432
  }
43416
43433
  if (kind === "assertion") {
43417
- if (!("about" in operation) || operation.about === undefined) {
43418
- throw new Error("assertion add operation requires 'about'");
43434
+ const about = "about" in operation && operation.about !== undefined ? operation.about : dataAboutWref(operation.data);
43435
+ if (about === undefined) {
43436
+ throw new Error("assertion add operation requires 'about', on the envelope or as data.about");
43419
43437
  }
43420
- if (typeof operation.about !== "string") {
43438
+ if (typeof about !== "string") {
43421
43439
  throw new Error(COLLECTION_ABOUT_REMOVED_MESSAGE);
43422
43440
  }
43423
43441
  if (operation.data === undefined) {
@@ -43427,7 +43445,7 @@ function toBackendStreamOperation(operation) {
43427
43445
  operation: "add",
43428
43446
  kind: "assertion",
43429
43447
  name: operation.name,
43430
- about: operation.about,
43448
+ about,
43431
43449
  data: operation.data,
43432
43450
  ...operation.affirmedTargets ? { affirmedTargets: operation.affirmedTargets } : {},
43433
43451
  ...skipExisting === true ? { skipExisting } : {}
@@ -45411,7 +45429,7 @@ function createStreamingSubmissionHandle(input, deps) {
45411
45429
  // ../../packages/sdk-ts/package.json
45412
45430
  var package_default = {
45413
45431
  name: "@warmhub/sdk-ts",
45414
- version: "0.127.0",
45432
+ version: "0.129.0",
45415
45433
  private: false,
45416
45434
  type: "module",
45417
45435
  description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -45450,6 +45468,7 @@ var package_default = {
45450
45468
  files: [
45451
45469
  "dist",
45452
45470
  "CHANGELOG.md",
45471
+ "changelog.json",
45453
45472
  "README.md"
45454
45473
  ],
45455
45474
  publishConfig: {
@@ -45534,7 +45553,7 @@ function sdkVersionIsDevelopment(version2) {
45534
45553
  var SDK_VERSION = typeof __SDK_VERSION__ !== "undefined" ? __SDK_VERSION__ : package_default.version;
45535
45554
 
45536
45555
  // ../../packages/sdk-ts/src/write-compatibility.ts
45537
- var MINIMUM_WRITE_CONTRACT_VERSION = 1;
45556
+ var MINIMUM_WRITE_CONTRACT_VERSION = 2;
45538
45557
  function clientUpgradeHint(name) {
45539
45558
  if (name === WARMHUB_CLI_CLIENT_NAME)
45540
45559
  return "Run: wh update --yes";
@@ -45582,6 +45601,7 @@ function clientCompatibilityFailure(capabilities, identity2) {
45582
45601
  hint: "Upgrade the WarmHub backend before retrying this write."
45583
45602
  };
45584
45603
  }
45604
+ return;
45585
45605
  }
45586
45606
  function isProductionApiUrl(apiUrl, productionApiUrl) {
45587
45607
  try {
@@ -45991,7 +46011,7 @@ class WarmHubClient {
45991
46011
  if (sdkVersionIsDevelopment(this.clientIdentity.version) && isProductionApiUrl(this.apiUrl, DEFAULT_API_URL)) {
45992
46012
  return Promise.reject(clientIncompatible(`Development client ${this.clientIdentity.name}/${this.clientIdentity.version} cannot write to production.`, "Install a released WarmHub client artifact before writing to api.warmhub.ai."));
45993
46013
  }
45994
- if (sdkVersionIsDevelopment(this.clientIdentity.version) && !isProductionApiUrl(this.apiUrl, DEFAULT_API_URL)) {
46014
+ if (sdkVersionIsDevelopment(this.clientIdentity.version) && this.clientIdentity.name !== WARMHUB_CLI_CLIENT_NAME) {
45995
46015
  return Promise.resolve();
45996
46016
  }
45997
46017
  return this.diagnostics.assertCompatible();
@@ -46901,12 +46921,15 @@ class WarmHubClient {
46901
46921
  throw toWarmHubError(error51);
46902
46922
  }
46903
46923
  },
46904
- revise: async (orgName, repoName, shapeName, newFields, opts) => {
46905
- const preflight = shapeDefinitionPreflightError(shapeName, {
46924
+ revise: async (...args) => {
46925
+ const [orgName, repoName, shapeName] = args;
46926
+ const newFields = args.length === 5 ? args[3] : undefined;
46927
+ const opts = args.length === 5 ? args[4] : args[3];
46928
+ const preflight = newFields ? shapeDefinitionPreflightError(shapeName, {
46906
46929
  fields: newFields,
46907
46930
  ...opts.description !== undefined ? { description: opts.description } : {},
46908
46931
  ...opts.composes !== undefined ? { composes: opts.composes } : {}
46909
- }, "revise");
46932
+ }, "revise") : undefined;
46910
46933
  if (preflight)
46911
46934
  throw new WarmHubError("VALIDATION_ERROR", preflight);
46912
46935
  try {
@@ -53178,7 +53201,7 @@ function renderHead(out, c, chars, result, org, repo, shape, kind) {
53178
53201
  if (item.validatedShapes?.length) {
53179
53202
  out(` ${c.dim}validates:${c.reset} ${refList(c, item.validatedShapes, decorations)}`);
53180
53203
  }
53181
- if (item.kind === "assertion" && item.aboutWref) {
53204
+ if (item.aboutWref) {
53182
53205
  out(` ${c.dim}about:${c.reset} ${refDisplay(c, item.aboutWref, decorations)}`);
53183
53206
  }
53184
53207
  if (item.affirmedWrefs?.length) {
@@ -57379,6 +57402,17 @@ function identifyCommitSubmitStreamRow(row) {
57379
57402
  // ../../packages/warmhub-cli/src/domains/commit-submit-template.ts
57380
57403
  import { writeFile } from "node:fs/promises";
57381
57404
  var WRITE_TEMPLATE_KINDS = ["thing", "assertion"];
57405
+ function composesLocalAssertion(shapeData, org, repo) {
57406
+ const composes = shapeData?.composes;
57407
+ if (!Array.isArray(composes))
57408
+ return false;
57409
+ return composes.some((entry) => {
57410
+ if (typeof entry !== "string")
57411
+ return false;
57412
+ const unversioned = entry.replace(/@(HEAD|v\d+)$/i, "");
57413
+ return unversioned === "Assertion" || unversioned === `wh:${org}/${repo}/Assertion`;
57414
+ });
57415
+ }
57382
57416
  async function readTemplateShape(ctx, org, repo, shapeName) {
57383
57417
  try {
57384
57418
  const shape = await ctx.client.shape.get(org, repo, shapeName);
@@ -57528,22 +57562,25 @@ var handleTemplate = async (ctx, { flags, args }) => {
57528
57562
  if (templateKind === "assertion") {
57529
57563
  aboutPlaceholder = flags.about ? parseCollectionAboutFlag(flags.about) : "Shape/FILL_IN";
57530
57564
  }
57565
+ const composesAssertion = composesLocalAssertion(shapeData, org, repo);
57566
+ const emittedKind = templateKind === "assertion" && composesAssertion ? "thing" : templateKind;
57531
57567
  const data = buildTemplateData(fields);
57568
+ const emittedData = aboutPlaceholder && emittedKind === "thing" ? { ...data, about: aboutPlaceholder } : data;
57532
57569
  const affirmedTargetsPlaceholder = templateKind === "assertion" ? { affirmedTargets: [] } : {};
57533
57570
  for (let i = 0;i < count; i++) {
57534
57571
  const op = operationType === "add" ? {
57535
57572
  operation: "add",
57536
- kind: templateKind,
57573
+ kind: emittedKind,
57537
57574
  name: `${shapeName}/${nameSuffix(i)}`,
57538
- ...aboutPlaceholder ? { about: aboutPlaceholder } : {},
57539
- data,
57540
- ...affirmedTargetsPlaceholder
57575
+ ...aboutPlaceholder && emittedKind === "assertion" ? { about: aboutPlaceholder } : {},
57576
+ data: emittedData,
57577
+ ...emittedKind === "assertion" ? affirmedTargetsPlaceholder : {}
57541
57578
  } : {
57542
57579
  operation: "revise",
57543
- kind: templateKind,
57580
+ kind: emittedKind,
57544
57581
  name: `${shapeName}/FILL_IN`,
57545
- data,
57546
- ...affirmedTargetsPlaceholder
57582
+ data: emittedData,
57583
+ ...emittedKind === "assertion" ? affirmedTargetsPlaceholder : {}
57547
57584
  };
57548
57585
  operations.push(op);
57549
57586
  }
@@ -63000,7 +63037,7 @@ var ORG_DOMAIN = defineDomain({
63000
63037
  });
63001
63038
 
63002
63039
  // ../../packages/warmhub-cli/src/domains/prime-content.md
63003
- 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; every other thing has one. **Write**: One or more add/revise/retract operations with per-operation results.\n- **wref**: A reference to a thing. Local: `Player` (the shape) or `Player/alice` (a thing with that shape). Cross-repo: `wh:org/repo/Shape` or `wh:org/repo/Shape/name`.\n\n## Versioned Wrefs\n- `Shape` addresses the shape itself; `Shape/name` addresses a thing with that shape. `@vN` pins either.\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 --shape ShapeName --about Target/name --name my-assertion --data '{\"field\":1}' --repo org/repo\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 Shape/name --repo org/repo # inspect a thing\nwh thing query --shape MyShape --repo org/repo # find things by shape\nwh thing about Shape --repo org/repo # assertions about a shape\nwh assertion list --repo org/repo # all assertions at HEAD\nwh thing history Shape/name --repo org/repo # version history\n\n# Batch read — wh thing view is variadic (max 500 wrefs/call):\nwh thing view Player/alice Player/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\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/name> (--data|--file) [--shape]` — Create\n- `wh thing revise <name> [--data] [--message] [--committer] [--expected-version]` — Revise (CONFLICT if HEAD≠n)\n- `wh thing retract <wref> -m <message> [--reason] [--kind] [--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 <Shape/oldName> <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 a registered component\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 installed component\n- `wh component view <org/name>` — Show component details (alias: show)\n- `wh component doctor <org/name>` — Run component health checks\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 Shape/name --repo org/repo # inspect a specific thing\nwh thing history Shape/name --repo org/repo # inspect version history\nwh thing about Shape/name # assertions about thing/shape\n```\n\n**Create an assertion** (most common write):\n```bash\n# --about takes an untyped target wref: Shape or Shape/name.\nwh assertion create --shape MyShape --about TargetShape/target-name \\\n --name my-assertion --data '{\"field_a\":1,\"field_b\":\"value\"}' --repo org/repo\n# Output includes per-operation status; relay failures when present.\n```\n\n**Create via write entrypoint** (alternative, supports batches and streams):\n```bash\nwh commit submit --add my-item --shape MyShape --kind assertion \\\n --about TargetShape/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 # add --kind assertion --about TargetShape/name for assertions\n# edit ops.json — fill FILL_IN placeholders\nwh commit submit --file ops.json -m \"batch update\" # submit all operations (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\":\"Location/a\",\"to\":\"Location/b\"}'\nwh assertion create --shape Supports --name route-support --about Arc/route --data '{\"confidence\":0.8}' --repo org/repo\n```\n\n**Modify data:**\n```bash\nwh thing revise Shape/name --data '{\"x\":5,\"y\":3}' -m \"update\" --repo org/repo\nwh thing retract Shape/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 Shape/name # by kind + target\nwh thing history Shape/name --limit 10 # version history\n```\n\n## Built-in Content shape\n\nWarmHub repos expose three well-known content wrefs:\n- `Content/Readme` — stored markdown for humans\n- `Content/Agents` — stored markdown guidance for AI agents\n- `Content/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` irreversibly withdraws an identity and creates a history entry.\n- Use `wh doctor` to check environment health\n";
63040
+ 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; every other thing has one. **Write**: One or more add/revise/retract operations with per-operation results.\n- **wref**: A reference to a thing. Local: `Player` (the shape) or `Player/alice` (a thing with that shape). Cross-repo: `wh:org/repo/Shape` or `wh:org/repo/Shape/name`.\n\n## Versioned Wrefs\n- `Shape` addresses the shape itself; `Shape/name` addresses a thing with that shape. `@vN` pins either.\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 --shape ShapeName --about Target/name --name my-assertion --data '{\"field\":1}' --repo org/repo\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 Shape/name --repo org/repo # inspect a thing\nwh thing query --shape MyShape --repo org/repo # find things by shape\nwh thing about Shape --repo org/repo # assertions about a shape\nwh assertion list --repo org/repo # all assertions at HEAD\nwh thing history Shape/name --repo org/repo # version history\n\n# Batch read — wh thing view is variadic (max 500 wrefs/call):\nwh thing view Player/alice Player/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\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/name> (--data|--file) [--shape]` — Create\n- `wh thing revise <name> [--data] [--message] [--committer] [--expected-version]` — Revise (CONFLICT if HEAD≠n)\n- `wh thing retract <wref> -m <message> [--reason] [--kind] [--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 <Shape/oldName> <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 a registered component\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 installed component\n- `wh component view <org/name>` — Show component details (alias: show)\n- `wh component doctor <org/name>` — Run component health checks\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 Shape/name --repo org/repo # inspect a specific thing\nwh thing history Shape/name --repo org/repo # inspect version history\nwh thing about Shape/name # assertions about thing/shape\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 window sugar; a wref Shape/name.\nwh assertion create --shape MyShape --about TargetShape/target-name \\\n --name my-assertion --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 --kind assertion \\\n --about TargetShape/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\":\"Location/a\",\"to\":\"Location/b\"}'\nwh assertion create --shape Supports --name route-support --about Arc/route --data '{\"confidence\":0.8}' --repo org/repo\n```\n\n**Modify data:**\n```bash\nwh thing revise Shape/name --data '{\"x\":5,\"y\":3}' -m \"update\" --repo org/repo\nwh thing retract Shape/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 Shape/name # by kind + target\nwh thing history Shape/name --limit 10 # version history\n```\n\n## Built-in Content shape\n\nWarmHub repos expose three well-known content wrefs:\n- `Content/Readme` — stored markdown for humans\n- `Content/Agents` — stored markdown guidance for AI agents\n- `Content/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` irreversibly withdraws an identity and creates a history entry.\n- Use `wh doctor` to check environment health\n";
63004
63041
 
63005
63042
  // ../../packages/warmhub-cli/src/domains/prime.ts
63006
63043
  function buildMarkdown(config2) {
@@ -66153,16 +66190,19 @@ var handleRevise3 = async (ctx, { flags, args }) => {
66153
66190
  if (!shapeName) {
66154
66191
  usageError("Usage: wh shape revise <name> (--fields '<json>' | --file <path>)", `wh shape revise Location --fields '{"x":"number","y":"number","z":"number"}'`, "wh shape revise Location --file fields.json", `wh shape revise Review --fields '{"score":"number","reason?":"string","tags":["string"]}'`);
66155
66192
  }
66156
- const newFields = await readJsonObjectInput({
66193
+ if (flags.compose !== undefined && flags["clear-composition"]) {
66194
+ usageError("--compose and --clear-composition cannot be used together", "wh shape revise Location --fields '{}' --clear-composition");
66195
+ }
66196
+ const hasFieldInput = flags.fields !== undefined || flags.file !== undefined;
66197
+ if (!hasFieldInput && flags.description === undefined && flags.compose === undefined && !flags["clear-composition"]) {
66198
+ usageError("Usage: wh shape revise <name> (--fields '<json>' | --file <path> | --description <text> | --compose <shape> | --clear-composition)", 'wh shape revise Location --description "Updated description"');
66199
+ }
66200
+ const suppliedFields = hasFieldInput ? await readJsonObjectInput({
66157
66201
  inline: flags.fields,
66158
66202
  file: flags.file,
66159
66203
  inlineFlag: "--fields",
66160
- missingMessage: "Usage: wh shape revise <name> (--fields '<json>' | --file <path>)",
66161
66204
  example: "wh shape revise Location --file fields.json"
66162
- });
66163
- if (flags.compose !== undefined && flags["clear-composition"]) {
66164
- usageError("--compose and --clear-composition cannot be used together", "wh shape revise Location --fields '{}' --clear-composition");
66165
- }
66205
+ }) : undefined;
66166
66206
  const { org, repo: repo2 } = parseOrgRepo(getRepoRef(ctx), ctx.config);
66167
66207
  const c = ctx.colors;
66168
66208
  const previousShape = flags["show-diff"] ? await ctx.client.shape.get(org, repo2, shapeName) : undefined;
@@ -66179,18 +66219,18 @@ var handleRevise3 = async (ctx, { flags, args }) => {
66179
66219
  await assertCompositeShapesEnabled(ctx, "--compose");
66180
66220
  opts.composes = flags.compose;
66181
66221
  }
66182
- const response = await ctx.client.shape.revise(org, repo2, shapeName, newFields, opts);
66222
+ const response = await ctx.client.shape.revise(org, repo2, shapeName, suppliedFields, opts);
66183
66223
  const result = shapeChangeFromReceipt(response.receipt);
66184
66224
  let diff;
66185
- if (previousFields) {
66225
+ if (flags["show-diff"] && previousFields) {
66186
66226
  let committedBaseFields = previousFields;
66187
66227
  if (result.operation === "noop") {
66188
- committedBaseFields = newFields;
66228
+ committedBaseFields = suppliedFields ?? previousFields;
66189
66229
  } else if (previousVersion !== result.version - 1) {
66190
66230
  const committedBase = await ctx.client.thing.get(org, repo2, shapeName, result.version - 1);
66191
66231
  committedBaseFields = fieldsFromShapeData(committedBase.data);
66192
66232
  }
66193
- diff = diffShapeFields(committedBaseFields, newFields);
66233
+ diff = diffShapeFields(committedBaseFields, suppliedFields ?? previousFields);
66194
66234
  }
66195
66235
  writeOutput(ctx, diff ? { ...response, diff } : response, () => {
66196
66236
  if (result.operation === "noop") {
@@ -69808,7 +69848,7 @@ function resolveLogLevel(flagLevel, env) {
69808
69848
  // package.json
69809
69849
  var package_default3 = {
69810
69850
  name: "@warmhub/cli",
69811
- version: "0.129.0",
69851
+ version: "0.131.0",
69812
69852
  private: false,
69813
69853
  type: "module",
69814
69854
  description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -70433,5 +70473,5 @@ process.exitCode = interceptedExitCode === undefined ? await runPreparedCli(laun
70433
70473
  version: package_default3.version
70434
70474
  }) : interceptedExitCode;
70435
70475
 
70436
- //# debugId=F15B1FBD1F7B2AAF64756E2164756E21
70437
- //# warmhub-cli-build-info {"cliVersion":"0.129.0","sdkVersion":"0.127.0"}
70476
+ //# debugId=D045842965BC157364756E2164756E21
70477
+ //# warmhub-cli-build-info {"cliVersion":"0.131.0","sdkVersion":"0.129.0"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/cli",
3
- "version": "0.129.0",
3
+ "version": "0.131.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",