@warmhub/cli 0.69.0 → 0.70.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 +109 -374
  2. package/package.json +1 -1
package/dist/wh.js CHANGED
@@ -19630,336 +19630,6 @@ var PUBLIC_ORG_PERMISSIONS = new Set([
19630
19630
  "org:read",
19631
19631
  "components:read"
19632
19632
  ]);
19633
- // ../../packages/rules/src/platform-status-constants.ts
19634
- var PLATFORM_STATUS_CATALOG_SHAPE = "PlatformStatusCatalog";
19635
- var PLATFORM_STATUS_CATALOG_NAME = "main";
19636
- var PLATFORM_STATUS_CATALOG_WREF = `${PLATFORM_STATUS_CATALOG_SHAPE}/${PLATFORM_STATUS_CATALOG_NAME}`;
19637
- var PLATFORM_STATUS_STATUSES = [
19638
- {
19639
- key: "available",
19640
- label: "Available",
19641
- description: "Works as expected."
19642
- },
19643
- {
19644
- key: "degraded",
19645
- label: "Degraded",
19646
- description: "Works with known caveats or partial reliability."
19647
- },
19648
- {
19649
- key: "unavailable",
19650
- label: "Unavailable",
19651
- description: "Exists in code but is broken or blocked."
19652
- },
19653
- {
19654
- key: "not_yet_built",
19655
- label: "Not Yet Built",
19656
- description: "This feature-surface combination does not exist yet."
19657
- },
19658
- {
19659
- key: "unknown",
19660
- label: "Unknown",
19661
- description: "Has not been assessed yet."
19662
- }
19663
- ];
19664
- var PLATFORM_STATUS_OBSERVATION_SOURCES = [
19665
- "probe",
19666
- "code_inventory",
19667
- "issue_mining",
19668
- "manual"
19669
- ];
19670
- var PLATFORM_STATUS_OBSERVATION_KINDS = [
19671
- "surface_present",
19672
- "surface_missing",
19673
- "probe_pass",
19674
- "probe_fail",
19675
- "issue_linked",
19676
- "manual_assessment"
19677
- ];
19678
- var PLATFORM_STATUS_PROBE_ARTIFACT_KINDS = [
19679
- "evidence",
19680
- "note",
19681
- "step",
19682
- "workflow_run",
19683
- "issue"
19684
- ];
19685
- // ../../packages/rules/src/platform-status-field-specs.ts
19686
- var issueFields = {
19687
- number: {
19688
- type: "number",
19689
- integer: true,
19690
- description: "GitHub issue number."
19691
- },
19692
- title: {
19693
- type: "string",
19694
- description: "GitHub issue title."
19695
- },
19696
- oneLineSummary: {
19697
- type: "string",
19698
- description: "One-line summary of the issue impact."
19699
- }
19700
- };
19701
- var dimensionFields = {
19702
- slug: {
19703
- type: "string",
19704
- description: "Stable slug used in thing names and programmatic queries."
19705
- },
19706
- label: {
19707
- type: "string",
19708
- description: "Human-readable label."
19709
- },
19710
- description: {
19711
- type: "string",
19712
- description: "Human-readable description."
19713
- },
19714
- "url?": {
19715
- type: "string",
19716
- description: "Optional canonical URL for this environment."
19717
- }
19718
- };
19719
- var PLATFORM_STATUS_CATALOG_FIELDS = {
19720
- schemaVersion: {
19721
- type: "number",
19722
- integer: true,
19723
- description: "Schema version for the platform status catalog."
19724
- },
19725
- title: {
19726
- type: "string",
19727
- description: "Display title for the status board."
19728
- },
19729
- orgName: {
19730
- type: "string",
19731
- description: "Owning organization for the status repo."
19732
- },
19733
- repoName: {
19734
- type: "string",
19735
- description: "Repository name for the status repo."
19736
- },
19737
- sourceIssueNumber: {
19738
- type: "number",
19739
- integer: true,
19740
- description: "Source GitHub issue number for this board."
19741
- },
19742
- sourceIssueUrl: {
19743
- type: "string",
19744
- description: "Source GitHub issue URL for this board."
19745
- },
19746
- features: [dimensionFields],
19747
- surfaces: [dimensionFields],
19748
- environments: [dimensionFields],
19749
- statuses: [
19750
- {
19751
- key: {
19752
- type: "string",
19753
- enum: PLATFORM_STATUS_STATUSES.map((status) => status.key),
19754
- description: "Stable status key."
19755
- },
19756
- label: {
19757
- type: "string",
19758
- description: "Human-readable label for the status."
19759
- },
19760
- description: {
19761
- type: "string",
19762
- description: "Human-readable definition of the status."
19763
- }
19764
- }
19765
- ],
19766
- updatedAt: {
19767
- type: "number",
19768
- integer: true,
19769
- description: "Timestamp when the catalog was last updated."
19770
- },
19771
- "notes?": {
19772
- type: "string",
19773
- description: "Optional operator notes for the board as a whole."
19774
- }
19775
- };
19776
- var PLATFORM_STATUS_CELL_FIELDS = {
19777
- feature: {
19778
- type: "string",
19779
- description: "Feature slug from the catalog."
19780
- },
19781
- surface: {
19782
- type: "string",
19783
- description: "Surface slug from the catalog."
19784
- },
19785
- environment: {
19786
- type: "string",
19787
- description: "Environment slug from the catalog."
19788
- },
19789
- status: {
19790
- type: "string",
19791
- enum: PLATFORM_STATUS_STATUSES.map((status) => status.key),
19792
- description: "Current readiness state for this matrix cell."
19793
- },
19794
- since: {
19795
- type: "number",
19796
- integer: true,
19797
- description: "Timestamp when this status last changed."
19798
- },
19799
- lastVerified: {
19800
- type: "number",
19801
- integer: true,
19802
- description: "Timestamp when this cell was last verified."
19803
- },
19804
- verifiedBy: {
19805
- type: "string",
19806
- enum: ["probe", "code_inventory", "issue_mining", "manual"],
19807
- description: "Verification source for the latest assessment."
19808
- },
19809
- knownIssues: [issueFields],
19810
- caveats: [
19811
- {
19812
- type: "string",
19813
- description: "Human caveat describing a limitation or workaround."
19814
- }
19815
- ],
19816
- "notes?": {
19817
- type: "string",
19818
- description: "Optional free-form notes for this cell."
19819
- },
19820
- "issueMiningBaseline?": {
19821
- status: {
19822
- type: "string",
19823
- enum: PLATFORM_STATUS_STATUSES.map((status) => status.key),
19824
- description: "Cell status before issue mining temporarily degraded it."
19825
- },
19826
- since: {
19827
- type: "number",
19828
- integer: true,
19829
- description: "Original status-change timestamp before issue mining."
19830
- },
19831
- lastVerified: {
19832
- type: "number",
19833
- integer: true,
19834
- description: "Original verification timestamp before issue mining."
19835
- },
19836
- verifiedBy: {
19837
- type: "string",
19838
- enum: ["probe", "code_inventory", "issue_mining", "manual"],
19839
- description: "Original verifier before issue mining."
19840
- },
19841
- knownIssues: [issueFields],
19842
- caveats: [
19843
- {
19844
- type: "string",
19845
- description: "Original caveats before issue mining."
19846
- }
19847
- ],
19848
- "notes?": {
19849
- type: "string",
19850
- description: "Original notes before issue mining."
19851
- }
19852
- }
19853
- };
19854
- var PLATFORM_STATUS_OBSERVATION_FIELDS = {
19855
- cell: {
19856
- type: "wref",
19857
- description: "Target PlatformStatusCell/<feature>/<surface>/<environment> wref."
19858
- },
19859
- feature: {
19860
- type: "string",
19861
- description: "Feature slug from the catalog."
19862
- },
19863
- surface: {
19864
- type: "string",
19865
- description: "Surface slug from the catalog."
19866
- },
19867
- environment: {
19868
- type: "string",
19869
- description: "Environment slug from the catalog."
19870
- },
19871
- source: {
19872
- type: "string",
19873
- enum: [...PLATFORM_STATUS_OBSERVATION_SOURCES],
19874
- description: "Producer of this observation."
19875
- },
19876
- kind: {
19877
- type: "string",
19878
- enum: [...PLATFORM_STATUS_OBSERVATION_KINDS],
19879
- description: "Observation kind within the status pipeline."
19880
- },
19881
- observedAt: {
19882
- type: "number",
19883
- integer: true,
19884
- description: "Timestamp when this observation was recorded."
19885
- },
19886
- summary: {
19887
- type: "string",
19888
- description: "One-line summary of the observation."
19889
- },
19890
- evidence: [
19891
- {
19892
- type: "string",
19893
- description: "Supporting evidence path, command, or URL."
19894
- }
19895
- ],
19896
- "statusHint?": {
19897
- type: "string",
19898
- enum: PLATFORM_STATUS_STATUSES.map((status) => status.key),
19899
- description: "Optional status implication suggested by this observation alone."
19900
- },
19901
- "notes?": {
19902
- type: "string",
19903
- description: "Optional free-form notes for this observation."
19904
- }
19905
- };
19906
- var PLATFORM_STATUS_PROBE_ARTIFACT_FIELDS = {
19907
- run: {
19908
- type: "wref",
19909
- description: "Target PlatformStatusProbeRun wref."
19910
- },
19911
- cell: {
19912
- type: "wref",
19913
- description: "Target PlatformStatusCell/<feature>/<surface>/<environment> wref."
19914
- },
19915
- runId: {
19916
- type: "string",
19917
- description: "Shared batch run identifier for this probe execution."
19918
- },
19919
- probeId: {
19920
- type: "string",
19921
- description: "Stable probe definition identifier."
19922
- },
19923
- feature: {
19924
- type: "string",
19925
- description: "Feature slug from the catalog."
19926
- },
19927
- surface: {
19928
- type: "string",
19929
- description: "Surface slug from the catalog."
19930
- },
19931
- environment: {
19932
- type: "string",
19933
- description: "Environment slug from the catalog."
19934
- },
19935
- observedAt: {
19936
- type: "number",
19937
- integer: true,
19938
- description: "Timestamp when this artifact was captured."
19939
- },
19940
- index: {
19941
- type: "number",
19942
- integer: true,
19943
- description: "Stable ordering index within the probe run."
19944
- },
19945
- kind: {
19946
- type: "string",
19947
- enum: [...PLATFORM_STATUS_PROBE_ARTIFACT_KINDS],
19948
- description: "Artifact category captured during the run."
19949
- },
19950
- label: {
19951
- type: "string",
19952
- description: "Human-readable artifact label."
19953
- },
19954
- value: {
19955
- type: "string",
19956
- description: "Artifact payload or summary text."
19957
- },
19958
- "url?": {
19959
- type: "string",
19960
- description: "Optional URL associated with this artifact."
19961
- }
19962
- };
19963
19633
  // ../../packages/rules/src/tokens.ts
19964
19634
  var COMMIT_TOKEN_SYNTAX_REMOVED_MESSAGE = "$N/#N commit-token syntax is no longer supported. Use explicit names and explicit wrefs. For assertions about newly created things, create the thing with a deterministic name and set about to that wref in the same commit.";
19965
19635
  var ANY_TOKEN_RE = /[$#]\d+/;
@@ -26989,7 +26659,7 @@ function validatePersistedStringFieldLimits(value, typeDef, errors, path) {
26989
26659
  }
26990
26660
  if (Array.isArray(value)) {
26991
26661
  const elementType = arrayElementType(normalized);
26992
- if (normalized !== undefined && elementType === undefined)
26662
+ if (elementType === undefined && !isDeclaredArrayType(normalized))
26993
26663
  return;
26994
26664
  for (let i = 0;i < value.length; i++) {
26995
26665
  validatePersistedStringFieldLimits(value[i], elementType, errors, `${path ?? "<value>"}[${i}]`);
@@ -27022,6 +26692,11 @@ function arrayElementType(typeDef) {
27022
26692
  return typeDef.items;
27023
26693
  return;
27024
26694
  }
26695
+ function isDeclaredArrayType(typeDef) {
26696
+ if (typeDef === "array" || Array.isArray(typeDef))
26697
+ return true;
26698
+ return isTypeSpecObject(typeDef) && typeDef.type === "array";
26699
+ }
27025
26700
  function nestedObjectFields(typeDef) {
27026
26701
  if (!isPlainObject(typeDef) || isTypeSpecObject(typeDef))
27027
26702
  return;
@@ -27461,7 +27136,7 @@ function findSystemComponent(componentId) {
27461
27136
  // ../../packages/sdk-ts/package.json
27462
27137
  var package_default = {
27463
27138
  name: "@warmhub/sdk-ts",
27464
- version: "0.68.0",
27139
+ version: "0.69.0",
27465
27140
  private: false,
27466
27141
  type: "module",
27467
27142
  description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -33002,7 +32677,7 @@ function collectionFields(shapeName, data) {
33002
32677
  return result;
33003
32678
  }
33004
32679
  function effectiveKind(kind, shapeName) {
33005
- if ((kind === "thing" || !kind) && shapeName && isBuiltinCollectionShape(shapeName)) {
32680
+ if ((kind === "thing" || kind === "collection" || !kind) && shapeName && isBuiltinCollectionShape(shapeName)) {
33006
32681
  return shapeName.toLowerCase();
33007
32682
  }
33008
32683
  return kind;
@@ -33245,7 +32920,8 @@ async function fetchAllAssertionHeadPages(ctx, org, repo, opts) {
33245
32920
  match: opts.match,
33246
32921
  includeRetracted: opts.includeRetracted,
33247
32922
  limit: opts.limit,
33248
- cursor
32923
+ cursor,
32924
+ ...opts.where ? { where: opts.where } : {}
33249
32925
  });
33250
32926
  items.push(...page.items ?? []);
33251
32927
  if (!page.nextCursor)
@@ -33266,7 +32942,8 @@ async function fetchAllAssertionAboutPages(ctx, org, repo, wref, opts) {
33266
32942
  includeRetracted: opts.includeRetracted,
33267
32943
  resolveCollections: opts.resolveCollections,
33268
32944
  limit: opts.limit,
33269
- cursor
32945
+ cursor,
32946
+ ...opts.where ? { where: opts.where } : {}
33270
32947
  });
33271
32948
  target = page.target;
33272
32949
  assertions.push(...page.assertions ?? []);
@@ -33283,7 +32960,7 @@ async function fetchAllAssertionAboutPages(ctx, org, repo, wref, opts) {
33283
32960
 
33284
32961
  // ../../packages/warmhub-cli/src/domains/assertion/mutators.ts
33285
32962
  var createFlags = {
33286
- name: flag.string({ description: "Assertion name" }),
32963
+ name: flag.string({ description: "assertion name (required)" }),
33287
32964
  shape: flag.string({ description: "Shape for assertion (required)" }),
33288
32965
  data: flag.string({ description: "Data payload (JSON)" }),
33289
32966
  about: flag.string({ description: "Target wref" }),
@@ -33364,11 +33041,11 @@ var handleCreate = async (ctx, { flags, args }) => {
33364
33041
  const message = flags.message;
33365
33042
  const data = flags.data !== undefined ? parseJsonObject(flags.data, "--data") : undefined;
33366
33043
  const c = ctx.colors;
33367
- if (!shape || !aboutRaw) {
33368
- usageError("Usage: wh assertion create --shape <shape> --about <wref|type:members> [--name <name>] --data <json>", `wh assertion create --shape belief --about player --data '{"confidence":0.8}'`);
33044
+ if (!shape || !aboutRaw || !name) {
33045
+ usageError("Usage: wh assertion create --shape <shape> --name <name> --about <wref> [--data <json>]", `wh assertion create --shape belief --name player-belief --about player --data '{"confidence":0.8}'`);
33369
33046
  }
33370
33047
  const about = parseAbout(aboutRaw);
33371
- const localName = name ? `${shape}/${name}` : `${shape}/${shape}-$1`;
33048
+ const localName = `${shape}/${name}`;
33372
33049
  const operations = [
33373
33050
  {
33374
33051
  operation: "add",
@@ -33605,10 +33282,10 @@ function renderHead(out, c, chars, result, org, repo, shape, kind) {
33605
33282
  if (item.kind === "assertion" && item.aboutWref) {
33606
33283
  out(` ${c.dim}about:${c.reset} ${pinnedWref(c, item.aboutWref)}`);
33607
33284
  }
33608
- const fields = shapeName && item.kind === "thing" && item.data ? collectionFields(shapeName, item.data) : null;
33285
+ const fields = shapeName && (item.kind === "thing" || item.kind === "collection") && item.data ? collectionFields(shapeName, item.data) : null;
33609
33286
  if (fields) {
33610
33287
  const allWrefs = fields.flatMap((f) => f.wrefs);
33611
- out(` ${allWrefs.map((w) => pinnedWref(c, w)).join(`${c.dim},${c.reset} `)}`);
33288
+ out(` ${allWrefs.map((w) => pinnedWref(c, escapeTerminalTextForDisplay(w))).join(`${c.dim},${c.reset} `)}`);
33612
33289
  } else if (item.data && typeof item.data === "object") {
33613
33290
  const preview = JSON.stringify(item.data);
33614
33291
  const truncated = preview.length > 80 ? `${preview.slice(0, 77)}...` : preview;
@@ -33658,11 +33335,11 @@ function renderThing(out, c, result) {
33658
33335
  for (const field of fields) {
33659
33336
  if (field.wrefs.length === 1) {
33660
33337
  const pad = " ".repeat(Math.max(1, 9 - field.name.length));
33661
- out(` ${c.dim}${field.name}:${c.reset}${pad}${pinnedWref(c, field.wrefs[0])}`);
33338
+ out(` ${c.dim}${field.name}:${c.reset}${pad}${pinnedWref(c, escapeTerminalTextForDisplay(field.wrefs[0]))}`);
33662
33339
  } else {
33663
33340
  out(` ${c.dim}${field.name}:${c.reset}`);
33664
33341
  for (const w of field.wrefs) {
33665
- out(` ${pinnedWref(c, w)}`);
33342
+ out(` ${pinnedWref(c, escapeTerminalTextForDisplay(w))}`);
33666
33343
  }
33667
33344
  }
33668
33345
  }
@@ -33687,7 +33364,7 @@ function renderCollectionSummary(out, c, collection) {
33687
33364
  return;
33688
33365
  out(` ${c.dim}preview:${c.reset}`);
33689
33366
  for (const wref of preview) {
33690
- out(` ${pinnedWref(c, wref)}`);
33367
+ out(` ${pinnedWref(c, escapeTerminalTextForDisplay(wref))}`);
33691
33368
  }
33692
33369
  }
33693
33370
  function renderDataBlock(out, data, indent) {
@@ -33756,7 +33433,7 @@ function renderThingGraph(out, c, result) {
33756
33433
  function renderHistory(out, c, result) {
33757
33434
  if (result.thing && typeof result.thing === "object") {
33758
33435
  const wref = result.thing.wref ?? result.thing.name ?? "(unknown)";
33759
- out(`${c.bold}History: ${pinnedWref(c, wref)}${c.reset} ${kindLabel(c, result.thing.kind ?? "thing")}`);
33436
+ out(`${c.bold}History: ${pinnedWref(c, wref)}${c.reset} ${kindLabel(c, effectiveKind(result.thing.kind ?? "thing", result.thing.shapeName))}`);
33760
33437
  }
33761
33438
  const firstMeta = result.versions?.[0]?.metadata;
33762
33439
  if (firstMeta?.durableId) {
@@ -33860,7 +33537,7 @@ var handleThingGraph = async (ctx, { flags, args }) => {
33860
33537
  if (depth !== undefined && (depth < 1 || depth > 5)) {
33861
33538
  usageError("Usage: wh thing graph <wref> --depth <1-5>", "wh thing graph Game/base --depth 2");
33862
33539
  }
33863
- const { org, repo } = parseOrgRepo(getRepoRef(ctx), ctx.config);
33540
+ const { org, repo } = looksLikeDurableId(wref) ? parseOrgRepoOptional(getRepoRef(ctx), ctx.config) : parseOrgRepo(getRepoRef(ctx), ctx.config);
33864
33541
  const result = await ctx.client.thing.graph(org, repo, wref, {
33865
33542
  depth,
33866
33543
  version: flags.version
@@ -34047,6 +33724,7 @@ function validateComponentFilters(componentRef, excludeComponents, ...examples)
34047
33724
  // ../../packages/warmhub-cli/src/domains/thing/where.ts
34048
33725
  var MAX_WHERE_IN_VALUES = 1000;
34049
33726
  var WHERE_USAGE_HINT = 'Example: --where state=NC --where "employees>=100" --where "state?"';
33727
+ var FIELD_USAGE_HINT = "Example: --field data.round=1";
34050
33728
  function requireWhereFieldPath(raw, fieldPath) {
34051
33729
  const normalized = fieldPath.trim();
34052
33730
  if (!normalized) {
@@ -34089,6 +33767,27 @@ function parseWhereFlag(raw) {
34089
33767
  }
34090
33768
  throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --where predicate: "${raw}". Supported operators: =, !=, >, >=, <, <=, ~, in:[...], ?`, undefined, WHERE_USAGE_HINT);
34091
33769
  }
33770
+ function parseFieldFlag(raw) {
33771
+ if (!raw.trim()) {
33772
+ throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --field predicate: "${raw}". --field requires data.path=value.`, undefined, FIELD_USAGE_HINT);
33773
+ }
33774
+ const parsed = parseWhereFlag(raw);
33775
+ if (parsed.op !== "eq") {
33776
+ throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --field predicate: "${raw}". --field supports exact equality only.`, undefined, FIELD_USAGE_HINT);
33777
+ }
33778
+ if (!parsed.fieldPath.startsWith("data.")) {
33779
+ throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --field predicate: "${raw}". Field paths must start with "data.".`, undefined, FIELD_USAGE_HINT);
33780
+ }
33781
+ const fieldPath = parsed.fieldPath.slice("data.".length);
33782
+ if (!fieldPath) {
33783
+ throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --field predicate: "${raw}". Field path cannot be empty after "data.".`, undefined, FIELD_USAGE_HINT);
33784
+ }
33785
+ return {
33786
+ fieldPath,
33787
+ op: "eq",
33788
+ rhs: parsed.rhs
33789
+ };
33790
+ }
34092
33791
  function coerceValue(s) {
34093
33792
  if (s.startsWith('"') && s.endsWith('"') || s.startsWith("'") && s.endsWith("'")) {
34094
33793
  return s.slice(1, -1);
@@ -34437,10 +34136,10 @@ function renderQueryResults(out, c, result) {
34437
34136
  const kl = kindLabel(c, effectiveKind(item.kind ?? "thing", shapeName));
34438
34137
  const retractedTag = item.active === false ? ` ${c.red}[RETRACTED]${c.reset}` : "";
34439
34138
  out(` ${wref} ${kl}${retractedTag}`);
34440
- const fields = shapeName && (item.kind === "thing" || !item.kind) && item.data ? collectionFields(shapeName, item.data) : null;
34139
+ const fields = shapeName && (item.kind === "thing" || item.kind === "collection" || !item.kind) && item.data ? collectionFields(shapeName, item.data) : null;
34441
34140
  if (fields) {
34442
34141
  const allWrefs = fields.flatMap((f) => f.wrefs);
34443
- out(` ${allWrefs.map((w) => pinnedWref(c, w)).join(`${c.dim},${c.reset} `)}`);
34142
+ out(` ${allWrefs.map((w) => pinnedWref(c, escapeTerminalTextForDisplay(w))).join(`${c.dim},${c.reset} `)}`);
34444
34143
  } else if (item.data && typeof item.data === "object") {
34445
34144
  const preview = JSON.stringify(item.data);
34446
34145
  const truncated = preview.length > 80 ? `${preview.slice(0, 77)}...` : preview;
@@ -34908,7 +34607,7 @@ async function collectWrefs(opts) {
34908
34607
  async function runSingleView(ctx, wref, flags) {
34909
34608
  const version = flags.version;
34910
34609
  const depth = flags.depth;
34911
- const { org, repo } = looksLikeDurableId(wref) && depth === undefined ? parseOrgRepoOptional(getRepoRef(ctx), ctx.config) : parseOrgRepo(getRepoRef(ctx), ctx.config);
34610
+ const { org, repo } = looksLikeDurableId(wref) ? parseOrgRepoOptional(getRepoRef(ctx), ctx.config) : parseOrgRepo(getRepoRef(ctx), ctx.config);
34912
34611
  const includeRetracted = flags["include-retracted"] || version !== undefined;
34913
34612
  const dataMode = validateDataMode(flags["data-mode"]);
34914
34613
  if (depth !== undefined && (depth < 1 || depth > 5)) {
@@ -35192,7 +34891,7 @@ var handleView2 = async (ctx, { flags, args }) => {
35192
34891
  }
35193
34892
  const version = flags.version;
35194
34893
  const depth = flags.depth;
35195
- const { org, repo } = looksLikeDurableId(wref) && depth === undefined ? parseOrgRepoOptional(getRepoRef(ctx), ctx.config) : parseOrgRepo(getRepoRef(ctx), ctx.config);
34894
+ const { org, repo } = looksLikeDurableId(wref) ? parseOrgRepoOptional(getRepoRef(ctx), ctx.config) : parseOrgRepo(getRepoRef(ctx), ctx.config);
35196
34895
  const includeRetracted = flags["include-retracted"] || version !== undefined;
35197
34896
  if (depth !== undefined && (depth < 1 || depth > 5)) {
35198
34897
  usageError("Usage: wh assertion view <wref> --depth <1-5>", "wh assertion view Belief/cave-safe --depth 2");
@@ -35317,6 +35016,9 @@ var listFlags = {
35317
35016
  cursor: flag.string({ description: "Opaque pagination cursor" }),
35318
35017
  all: flag.boolean({ description: "Fetch all pages" }),
35319
35018
  count: flag.boolean({ description: "Return count of matching assertions" }),
35019
+ field: flag.string({
35020
+ description: "exact data-field filter (data.path=value); served by the typed field index"
35021
+ }),
35320
35022
  match: flag.string({ description: "Filter by wref glob pattern" }),
35321
35023
  "resolve-collections": flag.boolean({
35322
35024
  description: "Include assertions about collections (Pair/Set/List) containing the target."
@@ -35334,9 +35036,11 @@ var handleList = async (ctx, { flags, args }) => {
35334
35036
  const cursor = flags.cursor;
35335
35037
  const all = flags.all;
35336
35038
  const count = flags.count;
35039
+ const field = flags.field;
35337
35040
  const match = flags.match;
35338
35041
  const resolveCollections = flags["resolve-collections"];
35339
35042
  const includeRetracted = flags["include-retracted"];
35043
+ const where = field === undefined ? undefined : [parseFieldFlag(field)];
35340
35044
  if (count) {
35341
35045
  if (cursor || all || limit || ctx.liveMode) {
35342
35046
  usageError("Usage: wh assertion list --count [--shape SHAPE] [--about WREF] [--match PATTERN]", "wh assertion list --shape Belief --count");
@@ -35350,7 +35054,8 @@ var handleList = async (ctx, { flags, args }) => {
35350
35054
  match,
35351
35055
  about: wref,
35352
35056
  includeRetracted,
35353
- resolveCollections
35057
+ resolveCollections,
35058
+ ...where ? { where } : {}
35354
35059
  });
35355
35060
  }
35356
35061
  if (cursor && !limit) {
@@ -35371,7 +35076,8 @@ var handleList = async (ctx, { flags, args }) => {
35371
35076
  match,
35372
35077
  includeRetracted,
35373
35078
  limit: pageLimit,
35374
- cursor
35079
+ cursor,
35080
+ ...where ? { where } : {}
35375
35081
  };
35376
35082
  if (ctx.liveMode) {
35377
35083
  await runLive({
@@ -35416,7 +35122,8 @@ var handleList = async (ctx, { flags, args }) => {
35416
35122
  includeRetracted,
35417
35123
  resolveCollections,
35418
35124
  limit: pageLimit,
35419
- cursor
35125
+ cursor,
35126
+ ...where ? { where } : {}
35420
35127
  };
35421
35128
  if (ctx.liveMode) {
35422
35129
  await runLive({
@@ -35445,7 +35152,8 @@ var handleList = async (ctx, { flags, args }) => {
35445
35152
  includeRetracted,
35446
35153
  resolveCollections,
35447
35154
  limit: pageLimit,
35448
- cursor
35155
+ cursor,
35156
+ ...where ? { where } : {}
35449
35157
  }) : await ctx.client.thing.about(org, repo, wref, {
35450
35158
  shape,
35451
35159
  match,
@@ -35453,7 +35161,8 @@ var handleList = async (ctx, { flags, args }) => {
35453
35161
  includeRetracted,
35454
35162
  resolveCollections,
35455
35163
  limit: boundedLimit,
35456
- cursor
35164
+ cursor,
35165
+ ...where ? { where } : {}
35457
35166
  });
35458
35167
  if (!all && result.nextCursor) {
35459
35168
  emitPartialPageHint(ctx, (result.assertions ?? []).length, result.nextCursor, boundedLimit);
@@ -35478,6 +35187,7 @@ var ASSERTION_DOMAIN = defineDomain({
35478
35187
  examples: [
35479
35188
  "wh assertion list",
35480
35189
  "wh assertion list Location/cave --shape Belief",
35190
+ "wh assertion list Session/run-001 --shape HypothesisCandidate --field data.round=1",
35481
35191
  "wh assertion view Belief/cave-safe",
35482
35192
  "wh assertion list --about Location/cave --shape Belief"
35483
35193
  ],
@@ -35501,8 +35211,8 @@ var ASSERTION_DOMAIN = defineDomain({
35501
35211
  args: "",
35502
35212
  flags: createFlags,
35503
35213
  examples: [
35504
- `wh assertion create --shape belief --about player --data '{"confidence":0.8}'`,
35505
- `wh assertion create --shape Distance --about Pair/location-distance --data '{"value":5}'`
35214
+ `wh assertion create --shape belief --name player-belief --about player --data '{"confidence":0.8}'`,
35215
+ `wh assertion create --shape Distance --name location-distance-value --about Pair/location-distance --data '{"value":5}'`
35506
35216
  ],
35507
35217
  handler: handleCreate
35508
35218
  },
@@ -40971,7 +40681,7 @@ var CREDENTIAL_DOMAIN = defineDomain({
40971
40681
  revoke: {
40972
40682
  status: "live",
40973
40683
  prime: true,
40974
- summary: "Revoke a credential set (blocks new binds and strips auth from existing webhook deliveries)",
40684
+ summary: "Revoke a credential set (blocks new binds and stops bound webhook deliveries)",
40975
40685
  args: "<setName>",
40976
40686
  flags: revokeFlags,
40977
40687
  examples: [
@@ -42119,6 +41829,13 @@ var ONBOARD_DOMAIN = defineDomain({
42119
41829
  handler: handleOnboard
42120
41830
  });
42121
41831
 
41832
+ // ../../packages/warmhub-cli/src/display-name.ts
41833
+ function ensureNonEmptyDisplayName(value, exampleCommand) {
41834
+ if (value !== undefined && value.trim() === "") {
41835
+ usageError("--display-name requires a non-empty value", exampleCommand);
41836
+ }
41837
+ }
41838
+
42122
41839
  // ../../packages/warmhub-cli/src/domains/org-member.ts
42123
41840
  var addMemberFlags = {
42124
41841
  role: flag.string({
@@ -42272,6 +41989,7 @@ var handleCreate4 = async (ctx, { flags, args }) => {
42272
41989
  if (!name) {
42273
41990
  usageError('Usage: wh org create <name> [--display-name "..."] [--description "..."]', 'wh org create caryden --display-name "Carl Ryden" -d "A great org"');
42274
41991
  }
41992
+ ensureNonEmptyDisplayName(flags["display-name"], 'wh org create acme --display-name "Acme Co"');
42275
41993
  const c = ctx.colors;
42276
41994
  const result = await ctx.client.org.create(name, flags["display-name"], flags.description);
42277
41995
  writeOutput(ctx, result, () => {
@@ -42356,6 +42074,7 @@ var handleOrgRename = async (ctx, { args, flags }) => {
42356
42074
  if (newSlug !== undefined && newSlug.length === 0 || rawSlugFromInvocation === "" || flagSlug === "") {
42357
42075
  usageError("New slug must be a non-empty string", "wh org rename acme acme-co");
42358
42076
  }
42077
+ ensureNonEmptyDisplayName(displayName2, 'wh org rename acme --display-name "Acme Co"');
42359
42078
  const c = ctx.colors;
42360
42079
  const slugChange = newSlug && newSlug !== oldName ? newSlug : undefined;
42361
42080
  if (displayName2 !== undefined && slugChange) {
@@ -42479,7 +42198,7 @@ var ORG_DOMAIN = defineDomain({
42479
42198
  });
42480
42199
 
42481
42200
  // ../../packages/warmhub-cli/src/domains/prime-content.md
42482
- 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\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 -m \"msg\" --repo org/repo # submit operations (bare `wh commit` also works)\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 — Thing operations\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 <json-object> [--shape] [--message] [--committer]` — 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]` — 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] [--limit] [--include-retracted]` — Show assertions about the target identity; `--resolve-collections` expands collection members for bare/@HEAD/@ALL inputs, not pinned @vN\n\n### commit — Write operations\n- `wh commit submit [--ops|--file|--add|--revise|--retract] [--kind] [--data] [--reason] [--expected-version] [--chunk-size] [--skip-existing] [--progress] [--stream-id]` — Submit operations (bare `wh commit` is equivalent). Use `--file ops.jsonl --stream-id <id> --chunk-size 5000 --skip-existing` for bulk ingest.\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 [--name] [--shape] [--data] [--about] [--message] [--committer]` — Create assertion\n- `wh assertion revise <wref> --data <json> [--message] [--committer]` — Revise assertion\n- `wh assertion retract <wref> -m <message> [--reason] [--committer]` — 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]` — Revise shape\n- `wh shape create <name> [--fields]` — Create shape\n- `wh shape retract <name> -m <message> [--reason]` — 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>` — Delete a subscription\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 strips auth from existing 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` — full help overview\n- `wh <domain>` — list verbs for a domain\n- `wh <domain> <verb> --help` — verb details with flags and examples\n- `wh help --format json` — full CLI spec as JSON (best for agents)\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)\" # choose your own; set it up front so reruns are safe\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# Add-stream restart: rerun the WHOLE file with the SAME --stream-id.\n# Fixed-name adds are idempotent via --skip-existing. Mid-stream resume is not\n# a CLI mode. Mixed revise/retract JSONL streams are not full-rerun safe after\n# an ambiguous append; inspect repo state and reconcile explicitly.\n```\n\n**Create collections:**\n```bash\nwh commit submit --type pair --name location-distance --members Location,Location/a --repo org/repo\nwh assertion create --shape Distance --about Pair/location-distance --data '{\"value\":5}' --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";
42201
+ 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\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 -m \"msg\" --repo org/repo # submit operations (bare `wh commit` also works)\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 — Thing operations\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 <json-object> [--shape] [--message] [--committer]` — 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]` — 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] [--limit] [--include-retracted]` — Show assertions about the target identity; `--resolve-collections` expands collection members for bare/@HEAD/@ALL inputs, not pinned @vN\n\n### commit — Write operations\n- `wh commit submit [--ops|--file|--add|--revise|--retract] [--kind] [--data] [--reason] [--expected-version] [--chunk-size] [--skip-existing] [--progress] [--stream-id]` — Submit operations (bare `wh commit` is equivalent). Use `--file ops.jsonl --stream-id <id> --chunk-size 5000 --skip-existing` for bulk ingest.\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]` — 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]` — Revise shape\n- `wh shape create <name> [--fields]` — Create shape\n- `wh shape retract <name> -m <message> [--reason]` — 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>` — Delete a subscription\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` — full help overview\n- `wh <domain>` — list verbs for a domain\n- `wh <domain> <verb> --help` — verb details with flags and examples\n- `wh help --format json` — full CLI spec as JSON (best for agents)\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)\" # choose your own; set it up front so reruns are safe\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# Add-stream restart: rerun the WHOLE file with the SAME --stream-id.\n# Fixed-name adds are idempotent via --skip-existing. Mid-stream resume is not\n# a CLI mode. Mixed revise/retract JSONL streams are not full-rerun safe after\n# an ambiguous append; inspect repo state and reconcile explicitly.\n```\n\n**Create collections:**\n```bash\nwh commit submit --type pair --name location-distance --members Location,Location/a --repo org/repo\nwh assertion create --shape Distance --name location-distance-value --about Pair/location-distance --data '{\"value\":5}' --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";
42483
42202
 
42484
42203
  // ../../packages/warmhub-cli/src/domains/prime.ts
42485
42204
  function buildMarkdown(config) {
@@ -42630,11 +42349,6 @@ function parseExplicitOrgRepoArg(ref, usage, example) {
42630
42349
  const [orgName, repoName] = parts;
42631
42350
  return { orgName, repoName };
42632
42351
  }
42633
- function ensureNonEmptyDisplayName(value, exampleCommand) {
42634
- if (value !== undefined && value.trim() === "") {
42635
- usageError("--display-name requires a non-empty value", exampleCommand);
42636
- }
42637
- }
42638
42352
  function resolveOrgRepoArg(ref, orgFlag) {
42639
42353
  if (ref?.includes("/")) {
42640
42354
  const parts = ref.split("/");
@@ -44852,10 +44566,11 @@ var TOKEN_DOMAIN = defineDomain({
44852
44566
  // ../../packages/warmhub-cli/src/update-check-cache.ts
44853
44567
  import { mkdirSync as mkdirSync7, readFileSync as readFileSync10, writeFileSync as writeFileSync7 } from "node:fs";
44854
44568
  import { homedir as homedir5 } from "node:os";
44855
- import { dirname as dirname7, resolve as resolve3 } from "node:path";
44569
+ import { dirname as dirname8, resolve as resolve3 } from "node:path";
44856
44570
 
44857
44571
  // ../../packages/warmhub-cli/src/update-check-fetch.ts
44858
44572
  import * as childProcess4 from "node:child_process";
44573
+ import { dirname as dirname7 } from "node:path";
44859
44574
  var WH_CLI_PACKAGE_NAME = "@warmhub/cli";
44860
44575
  var UPDATE_DIST_TAG = "latest";
44861
44576
  var DEFAULT_UPDATE_REGISTRY = "https://registry.npmjs.org";
@@ -44896,8 +44611,24 @@ var getUpdateRegistryConfigFingerprint = (env, _cwd, _homePath, _options = {}) =
44896
44611
  return `env:${override}`;
44897
44612
  return `default:${DEFAULT_UPDATE_REGISTRY}`;
44898
44613
  };
44614
+ function withNpmRegistryEnv(env, registry2) {
44615
+ const childEnv = { ...env };
44616
+ for (const key of Object.keys(childEnv)) {
44617
+ if (key.toLowerCase() === "npm_config_registry")
44618
+ delete childEnv[key];
44619
+ }
44620
+ return { ...childEnv, npm_config_registry: registry2 };
44621
+ }
44899
44622
  var fetchLatestCliVersion = (env, registry2) => {
44900
- const proc = childProcess4.spawnSync("npm", [
44623
+ const isWindows = process.platform === "win32";
44624
+ const proc = isWindows ? childProcess4.spawnSync(`npm view ${WH_CLI_PACKAGE_NAME}@${UPDATE_DIST_TAG} version --json`, {
44625
+ encoding: "utf8",
44626
+ cwd: dirname7(process.execPath),
44627
+ env: withNpmRegistryEnv(env, registry2),
44628
+ shell: true,
44629
+ stdio: "pipe",
44630
+ timeout: 8000
44631
+ }) : childProcess4.spawnSync("npm", [
44901
44632
  "view",
44902
44633
  `${WH_CLI_PACKAGE_NAME}@${UPDATE_DIST_TAG}`,
44903
44634
  "version",
@@ -44926,7 +44657,7 @@ var readCache = (homePath) => {
44926
44657
  };
44927
44658
  var writeCache = (homePath, cache) => {
44928
44659
  const path2 = cachePath(homePath);
44929
- mkdirSync7(dirname7(path2), { recursive: true });
44660
+ mkdirSync7(dirname8(path2), { recursive: true });
44930
44661
  writeFileSync7(path2, `${JSON.stringify(cache, null, 2)}
44931
44662
  `, "utf8");
44932
44663
  };
@@ -44945,7 +44676,7 @@ var markUpdateNoticeShown = ({
44945
44676
  import { spawnSync as spawnSync2 } from "node:child_process";
44946
44677
  import { existsSync as existsSync9, readFileSync as readFileSync11, realpathSync } from "node:fs";
44947
44678
  import { homedir as homedir6 } from "node:os";
44948
- import { dirname as dirname8, resolve as resolve4 } from "node:path";
44679
+ import { dirname as dirname9, resolve as resolve4 } from "node:path";
44949
44680
  var DEV_INSTALL_PACKAGE_SEARCH_DEPTH = 8;
44950
44681
  var DEV_INSTALL_GIT_SEARCH_DEPTH = 4;
44951
44682
  var normalizePath = (path2) => path2 ? path2.replaceAll("\\", "/") : "";
@@ -45089,7 +44820,7 @@ var formatUnknownInstallHint = (activePath, realPath, latestVersion, registry2)
45089
44820
  var isDevInstall = (scriptPath) => {
45090
44821
  if (!scriptPath)
45091
44822
  return false;
45092
- let dir = dirname8(scriptPath);
44823
+ let dir = dirname9(scriptPath);
45093
44824
  for (let i = 0;i < DEV_INSTALL_PACKAGE_SEARCH_DEPTH; i += 1) {
45094
44825
  const pkgPath = resolve4(dir, "package.json");
45095
44826
  try {
@@ -45101,7 +44832,7 @@ var isDevInstall = (scriptPath) => {
45101
44832
  for (let j = 0;j < DEV_INSTALL_GIT_SEARCH_DEPTH; j += 1) {
45102
44833
  if (existsSync9(resolve4(probe, ".git")))
45103
44834
  return true;
45104
- const parent2 = dirname8(probe);
44835
+ const parent2 = dirname9(probe);
45105
44836
  if (parent2 === probe)
45106
44837
  break;
45107
44838
  probe = parent2;
@@ -45109,7 +44840,7 @@ var isDevInstall = (scriptPath) => {
45109
44840
  return false;
45110
44841
  }
45111
44842
  } catch {}
45112
- const parent = dirname8(dir);
44843
+ const parent = dirname9(dir);
45113
44844
  if (parent === dir)
45114
44845
  break;
45115
44846
  dir = parent;
@@ -46324,6 +46055,7 @@ async function runCli(argv, opts) {
46324
46055
  ...traceFields
46325
46056
  });
46326
46057
  let exitCode = 0 /* Ok */;
46058
+ let cancelledExitCode;
46327
46059
  let removeSignalListeners;
46328
46060
  try {
46329
46061
  canonicalizeGlobalFlags({ invocation });
@@ -46377,7 +46109,6 @@ async function runCli(argv, opts) {
46377
46109
  const chars = makeChars();
46378
46110
  const ac = new AbortController;
46379
46111
  const liveMode = getBoolFlag(invocation.flags, "live");
46380
- let cancelledExitCode;
46381
46112
  const handleSigint = () => {
46382
46113
  ac.abort();
46383
46114
  logger.info("cli.cancelled", { signal: "SIGINT", ...traceFields });
@@ -46424,6 +46155,10 @@ async function runCli(argv, opts) {
46424
46155
  exitCode = cancelledExitCode ?? 0 /* Ok */;
46425
46156
  return exitCode;
46426
46157
  } catch (error) {
46158
+ if (cancelledExitCode !== undefined) {
46159
+ exitCode = cancelledExitCode;
46160
+ return exitCode;
46161
+ }
46427
46162
  const cliError = toCliError2(error);
46428
46163
  const fields = {
46429
46164
  kind: cliError.kind,
@@ -46502,7 +46237,7 @@ function resolveLogLevel(flags, env) {
46502
46237
  // package.json
46503
46238
  var package_default3 = {
46504
46239
  name: "@warmhub/cli",
46505
- version: "0.69.0",
46240
+ version: "0.70.0",
46506
46241
  private: false,
46507
46242
  type: "module",
46508
46243
  description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -47157,4 +46892,4 @@ if (!updateCheckSuppressedByArgv && shouldRunUpdateCheck(updateEligibility)) {
47157
46892
  var interceptedExitCode = await maybeHandleComponentShellBoundary(dispatchArgv);
47158
46893
  process.exitCode = interceptedExitCode === undefined ? await runCli(dispatchArgv, { version: package_default3.version }) : interceptedExitCode;
47159
46894
 
47160
- //# debugId=C8123553A9E5F6D464756E2164756E21
46895
+ //# debugId=14D7F2CE92253D6D64756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/cli",
3
- "version": "0.69.0",
3
+ "version": "0.70.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.",