@warmhub/cli 0.69.0 → 0.71.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 (3) hide show
  1. package/README.md +12 -24
  2. package/dist/wh.js +298 -379
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -23,33 +23,21 @@ $ wh auth login
23
23
  Opening browser to authenticate...
24
24
  ✓ Logged in as alice@example.com
25
25
 
26
- $ wh thing search "Josh Gottheimer" --repo warmhub-data/congress-members --limit 3
27
- Legislator/g000583@v1 thing
26
+ $ wh thing search "Josh Gottheimer" --repo warmhub-data/us.congress --limit 3
27
+ Legislator/g000583@v2 thing
28
28
  {"gender":"M","full_name":"Josh Gottheimer","in_office":true,"last_name":"Got...
29
- MembershipTerm/g000583/119@v1 assertion
30
- {"party":"Democratic","state":"NJ","chamber":"house","district":5,"end_date":...
31
- Legislator/r000622@v1 thing
32
- {"gender":"M","full_name":"Josh Riley","in_office":true,"last_name":"Riley","...
29
+ CommitteeAssignment/g000583--hsba10@v1 assertion
30
+ {"rank":"2","role":"member","party":"minority","bioguide_id":"G000583",...
31
+ CommitteeAssignment/g000583--hsba16@v1 assertion
32
+ {"rank":"5","role":"member","party":"minority","bioguide_id":"G000583",...
33
33
  3 result(s)
34
34
 
35
- $ wh thing about wh:warmhub-data/congress-members/Legislator/g000583 \
36
- --repo warmhub-data/congress-trading --resolve-collections --limit 5
37
- Assertions about wh:warmhub-data/congress-members/Legislator/g000583 (5+)
38
- StockTrade/2023/20024097/32@v1
39
- about: Pair/Legislator+Security/g000583v1+tmov1@v1
40
- {"owner":"joint","amount":"$1,001 - $15,000","ticker":"TMO","tx_type":"sale",...
41
- StockTrade/2023/20024097/31@v1
42
- about: Pair/Legislator+Security/g000583v1+nowv1@v1
43
- {"owner":"joint","amount":"$1,001 - $15,000","ticker":"NOW","tx_type":"purcha...
44
- StockTrade/2023/20024097/30@v1
45
- about: Pair/Legislator+Security/g000583v1+nowv1@v1
46
- {"owner":"joint","amount":"$1,001 - $15,000","ticker":"NOW","tx_type":"purcha...
47
- StockTrade/2023/20024097/29@v1
48
- about: Pair/Legislator+Security/g000583v1+nowv1@v1
49
- {"owner":"joint","amount":"$1,001 - $15,000","ticker":"NOW","tx_type":"purcha...
50
- StockTrade/2023/20024097/28@v1
51
- about: Pair/Legislator+Security/g000583v1+crmv1@v1
52
- {"owner":"joint","amount":"$1,001 - $15,000","ticker":"CRM","tx_type":"sale_p...
35
+ $ wh thing about CongressTrade/20034954/bd598743649e738e-2 \
36
+ --repo warmhub-data/us.congress.trades --resolve-collections --limit 5
37
+ Assertions about CongressTrade/20034954/bd598743649e738e-2 (1)
38
+ CongressTradeSecurity/20034954/bd598743649e738e-2--0000858877@v1
39
+ about: Pair/congress-trade-20034954-bd598743649e738e-2-security-listing-0000858877@v1
40
+ {"cik10":"0000858877","ticker_raw":"CSCO","trade_date":"2026-06-12",...
53
41
  ```
54
42
 
55
43
  ## Reference
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.1",
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.",
@@ -32946,6 +32621,7 @@ function makeChars(env = process.env) {
32946
32621
  function makeColors(opts) {
32947
32622
  const enabled = !opts.noColor && opts.isTTY;
32948
32623
  const on = (code) => enabled ? code : "";
32624
+ const truecolor = enabled && /^(truecolor|24bit)$/i.test((opts.colorterm ?? "").trim());
32949
32625
  return {
32950
32626
  reset: on("\x1B[0m"),
32951
32627
  bold: on("\x1B[1m"),
@@ -32956,7 +32632,8 @@ function makeColors(opts) {
32956
32632
  blue: on("\x1B[34m"),
32957
32633
  cyan: on("\x1B[36m"),
32958
32634
  magenta: on("\x1B[35m"),
32959
- gray: on("\x1B[90m")
32635
+ gray: on("\x1B[90m"),
32636
+ truecolor
32960
32637
  };
32961
32638
  }
32962
32639
  function formatTime(ts, now) {
@@ -33002,7 +32679,7 @@ function collectionFields(shapeName, data) {
33002
32679
  return result;
33003
32680
  }
33004
32681
  function effectiveKind(kind, shapeName) {
33005
- if ((kind === "thing" || !kind) && shapeName && isBuiltinCollectionShape(shapeName)) {
32682
+ if ((kind === "thing" || kind === "collection" || !kind) && shapeName && isBuiltinCollectionShape(shapeName)) {
33006
32683
  return shapeName.toLowerCase();
33007
32684
  }
33008
32685
  return kind;
@@ -33245,7 +32922,8 @@ async function fetchAllAssertionHeadPages(ctx, org, repo, opts) {
33245
32922
  match: opts.match,
33246
32923
  includeRetracted: opts.includeRetracted,
33247
32924
  limit: opts.limit,
33248
- cursor
32925
+ cursor,
32926
+ ...opts.where ? { where: opts.where } : {}
33249
32927
  });
33250
32928
  items.push(...page.items ?? []);
33251
32929
  if (!page.nextCursor)
@@ -33266,7 +32944,8 @@ async function fetchAllAssertionAboutPages(ctx, org, repo, wref, opts) {
33266
32944
  includeRetracted: opts.includeRetracted,
33267
32945
  resolveCollections: opts.resolveCollections,
33268
32946
  limit: opts.limit,
33269
- cursor
32947
+ cursor,
32948
+ ...opts.where ? { where: opts.where } : {}
33270
32949
  });
33271
32950
  target = page.target;
33272
32951
  assertions.push(...page.assertions ?? []);
@@ -33283,7 +32962,7 @@ async function fetchAllAssertionAboutPages(ctx, org, repo, wref, opts) {
33283
32962
 
33284
32963
  // ../../packages/warmhub-cli/src/domains/assertion/mutators.ts
33285
32964
  var createFlags = {
33286
- name: flag.string({ description: "Assertion name" }),
32965
+ name: flag.string({ description: "assertion name (required)" }),
33287
32966
  shape: flag.string({ description: "Shape for assertion (required)" }),
33288
32967
  data: flag.string({ description: "Data payload (JSON)" }),
33289
32968
  about: flag.string({ description: "Target wref" }),
@@ -33364,11 +33043,11 @@ var handleCreate = async (ctx, { flags, args }) => {
33364
33043
  const message = flags.message;
33365
33044
  const data = flags.data !== undefined ? parseJsonObject(flags.data, "--data") : undefined;
33366
33045
  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}'`);
33046
+ if (!shape || !aboutRaw || !name) {
33047
+ 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
33048
  }
33370
33049
  const about = parseAbout(aboutRaw);
33371
- const localName = name ? `${shape}/${name}` : `${shape}/${shape}-$1`;
33050
+ const localName = `${shape}/${name}`;
33372
33051
  const operations = [
33373
33052
  {
33374
33053
  operation: "add",
@@ -33395,6 +33074,13 @@ var CANONICAL_WREF_PATTERN_RE = new RegExp(String.raw`^wh:${WREF_SEGMENT}/${WREF
33395
33074
  function looksLikeDurableId(wref) {
33396
33075
  return DURABLE_ID_PATTERN_RE.test(wref);
33397
33076
  }
33077
+ function parseGraphRepoScope(ctx, wref) {
33078
+ const explicitRepoRef = getRepoRef(ctx);
33079
+ if (looksLikeDurableId(wref) && explicitRepoRef === undefined) {
33080
+ return {};
33081
+ }
33082
+ return parseOrgRepo(explicitRepoRef, ctx.config);
33083
+ }
33398
33084
  function looksLikeCanonicalWref(wref) {
33399
33085
  return CANONICAL_WREF_PATTERN_RE.test(wref);
33400
33086
  }
@@ -33587,6 +33273,180 @@ var handleCreate2 = async (ctx, { flags, args }) => {
33587
33273
  }));
33588
33274
  };
33589
33275
 
33276
+ // ../../packages/rules/src/crockford-base32.ts
33277
+ var ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
33278
+ var DECODE_TABLE = new Uint8Array(256).fill(255);
33279
+ for (let i = 0;i < ALPHABET.length; i++) {
33280
+ const ch = ALPHABET.charCodeAt(i);
33281
+ DECODE_TABLE[ch] = i;
33282
+ if (ch >= 65)
33283
+ DECODE_TABLE[ch + 32] = i;
33284
+ }
33285
+ function encodeBytes(data) {
33286
+ const bitLen = data.length * 8;
33287
+ const charCount = Math.ceil(bitLen / 5);
33288
+ let out = "";
33289
+ for (let i = 0;i < charCount; i++) {
33290
+ const bitPos = i * 5;
33291
+ const byteIdx = bitPos >> 3;
33292
+ const bitOff = bitPos & 7;
33293
+ const b1 = data[byteIdx] ?? 0;
33294
+ let val;
33295
+ if (bitOff <= 3) {
33296
+ val = b1 >> 3 - bitOff & 31;
33297
+ } else {
33298
+ const b2 = data[byteIdx + 1] ?? 0;
33299
+ val = (b1 << bitOff - 3 | b2 >> 11 - bitOff) & 31;
33300
+ }
33301
+ out += ALPHABET[val];
33302
+ }
33303
+ return out;
33304
+ }
33305
+ function decodeBytes(encoded) {
33306
+ const byteLen = Math.floor(encoded.length * 5 / 8);
33307
+ const bytes = new Uint8Array(byteLen);
33308
+ let bitBuf = 0;
33309
+ let bitsInBuf = 0;
33310
+ let bytePos = 0;
33311
+ for (let i = 0;i < encoded.length; i++) {
33312
+ const ch = encoded.charCodeAt(i);
33313
+ const val = DECODE_TABLE[ch];
33314
+ if (val === undefined || val === 255)
33315
+ return null;
33316
+ bitBuf = bitBuf << 5 | val;
33317
+ bitsInBuf += 5;
33318
+ if (bitsInBuf >= 8) {
33319
+ bitsInBuf -= 8;
33320
+ if (bytePos < byteLen) {
33321
+ bytes[bytePos++] = bitBuf >> bitsInBuf & 255;
33322
+ }
33323
+ }
33324
+ }
33325
+ return bytes;
33326
+ }
33327
+
33328
+ // ../../packages/rules/src/durable-id.ts
33329
+ var THING_SCHEME = 1;
33330
+ var REPO_SCHEME = 2;
33331
+ var UUID_BYTES = 16;
33332
+ var CRC_BYTES = 4;
33333
+ function encodedLengthFor(payloadLen) {
33334
+ return Math.ceil((1 + payloadLen + CRC_BYTES) * 8 / 5);
33335
+ }
33336
+ var CRC32C_TABLE = (() => {
33337
+ const POLY = 2197175160;
33338
+ const table = new Uint32Array(256);
33339
+ for (let i = 0;i < 256; i++) {
33340
+ let crc = i;
33341
+ for (let j = 0;j < 8; j++) {
33342
+ crc = crc & 1 ? crc >>> 1 ^ POLY : crc >>> 1;
33343
+ }
33344
+ table[i] = crc >>> 0;
33345
+ }
33346
+ return table;
33347
+ })();
33348
+ function crc32c(data) {
33349
+ let crc = 4294967295;
33350
+ for (const byte of data) {
33351
+ crc = (crc >>> 8 ^ (CRC32C_TABLE[(crc ^ byte) & 255] ?? 0)) >>> 0;
33352
+ }
33353
+ return (crc ^ 4294967295) >>> 0;
33354
+ }
33355
+ function bytesToUuid(bytes, offset = 0) {
33356
+ const hex = Array.from(bytes.slice(offset, offset + 16)).map((b) => b.toString(16).padStart(2, "0")).join("");
33357
+ return [
33358
+ hex.slice(0, 8),
33359
+ hex.slice(8, 12),
33360
+ hex.slice(12, 16),
33361
+ hex.slice(16, 20),
33362
+ hex.slice(20, 32)
33363
+ ].join("-");
33364
+ }
33365
+ function unpackToken(scheme, token, payloadLen) {
33366
+ const stripped = token.startsWith("wh:") ? token.slice(3) : token;
33367
+ if (stripped.length !== encodedLengthFor(payloadLen))
33368
+ return null;
33369
+ const raw = decodeBytes(stripped);
33370
+ if (!raw || raw.length !== 1 + payloadLen + CRC_BYTES)
33371
+ return null;
33372
+ if (raw[0] !== scheme)
33373
+ return null;
33374
+ const crcOffset = 1 + payloadLen;
33375
+ const storedCrc = (raw[crcOffset] ?? 0) << 24 | (raw[crcOffset + 1] ?? 0) << 16 | (raw[crcOffset + 2] ?? 0) << 8 | (raw[crcOffset + 3] ?? 0);
33376
+ const computedCrc = crc32c(raw.slice(0, crcOffset));
33377
+ if (storedCrc >>> 0 !== computedCrc >>> 0)
33378
+ return null;
33379
+ if (encodeBytes(raw) !== stripped.toUpperCase())
33380
+ return null;
33381
+ return raw.slice(1, 1 + payloadLen);
33382
+ }
33383
+ function decodeDurableId(token) {
33384
+ const payload = unpackToken(THING_SCHEME, token, UUID_BYTES * 2);
33385
+ if (!payload)
33386
+ return null;
33387
+ return {
33388
+ repoId: bytesToUuid(payload, 0),
33389
+ thingId: bytesToUuid(payload, UUID_BYTES)
33390
+ };
33391
+ }
33392
+ function decodeRepoDurableId(token) {
33393
+ const payload = unpackToken(REPO_SCHEME, token, UUID_BYTES);
33394
+ if (!payload)
33395
+ return null;
33396
+ return { repoId: bytesToUuid(payload, 0) };
33397
+ }
33398
+
33399
+ // ../../packages/warmhub-cli/src/durable-id-style.ts
33400
+ var THING_TOKEN_LEN = 60;
33401
+ var REPO_TOKEN_LEN = 34;
33402
+ var HUE_REPO = "8A7C6A";
33403
+ var HUE_TIMESTAMP = "7E9BAC";
33404
+ var HUE_ENTROPY = "E8C378";
33405
+ var HUE_CRC = "74846B";
33406
+ var THING_BANDS = [
33407
+ { start: 0, end: 28, weight: "faint", hex: HUE_REPO },
33408
+ { start: 28, end: 37, weight: "normal", hex: HUE_TIMESTAMP },
33409
+ { start: 37, end: 53, weight: "bold", hex: HUE_ENTROPY },
33410
+ { start: 53, end: 60, weight: "faint", hex: HUE_CRC }
33411
+ ];
33412
+ var REPO_BANDS = [
33413
+ { start: 0, end: 28, weight: "faint", hex: HUE_REPO },
33414
+ { start: 28, end: 34, weight: "faint", hex: HUE_CRC }
33415
+ ];
33416
+ function fg(hex) {
33417
+ const r = Number.parseInt(hex.slice(0, 2), 16);
33418
+ const g = Number.parseInt(hex.slice(2, 4), 16);
33419
+ const b = Number.parseInt(hex.slice(4, 6), 16);
33420
+ return `\x1B[38;2;${r};${g};${b}m`;
33421
+ }
33422
+ function bandsFor(token) {
33423
+ if (token.length === THING_TOKEN_LEN && decodeDurableId(token)) {
33424
+ return THING_BANDS;
33425
+ }
33426
+ if (token.length === REPO_TOKEN_LEN && decodeRepoDurableId(token)) {
33427
+ return REPO_BANDS;
33428
+ }
33429
+ return null;
33430
+ }
33431
+ function styleBand(text, band, c) {
33432
+ const weight = band.weight === "bold" ? c.bold : band.weight === "faint" ? c.dim : "";
33433
+ const hue = c.truecolor ? fg(band.hex) : "";
33434
+ const prefix = `${weight}${hue}`;
33435
+ return prefix === "" ? text : `${prefix}${text}${c.reset}`;
33436
+ }
33437
+ function styleDurableId(token, c) {
33438
+ if (c.reset === "")
33439
+ return token;
33440
+ const bands = bandsFor(token);
33441
+ if (!bands)
33442
+ return token;
33443
+ let out = "";
33444
+ for (const band of bands) {
33445
+ out += styleBand(token.slice(band.start, band.end), band, c);
33446
+ }
33447
+ return out;
33448
+ }
33449
+
33590
33450
  // ../../packages/warmhub-cli/src/domains/thing/render.ts
33591
33451
  function renderHead(out, c, chars, result, org, repo, shape, kind) {
33592
33452
  const items = result.items ?? [];
@@ -33605,10 +33465,10 @@ function renderHead(out, c, chars, result, org, repo, shape, kind) {
33605
33465
  if (item.kind === "assertion" && item.aboutWref) {
33606
33466
  out(` ${c.dim}about:${c.reset} ${pinnedWref(c, item.aboutWref)}`);
33607
33467
  }
33608
- const fields = shapeName && item.kind === "thing" && item.data ? collectionFields(shapeName, item.data) : null;
33468
+ const fields = shapeName && (item.kind === "thing" || item.kind === "collection") && item.data ? collectionFields(shapeName, item.data) : null;
33609
33469
  if (fields) {
33610
33470
  const allWrefs = fields.flatMap((f) => f.wrefs);
33611
- out(` ${allWrefs.map((w) => pinnedWref(c, w)).join(`${c.dim},${c.reset} `)}`);
33471
+ out(` ${allWrefs.map((w) => pinnedWref(c, escapeTerminalTextForDisplay(w))).join(`${c.dim},${c.reset} `)}`);
33612
33472
  } else if (item.data && typeof item.data === "object") {
33613
33473
  const preview = JSON.stringify(item.data);
33614
33474
  const truncated = preview.length > 80 ? `${preview.slice(0, 77)}...` : preview;
@@ -33616,7 +33476,7 @@ function renderHead(out, c, chars, result, org, repo, shape, kind) {
33616
33476
  }
33617
33477
  const itemMeta = item.metadata;
33618
33478
  if (itemMeta?.durableId) {
33619
- out(` ${c.dim}durableId:${c.reset} ${itemMeta.durableId}`);
33479
+ out(` ${c.dim}durableId:${c.reset} ${styleDurableId(itemMeta.durableId, c)}`);
33620
33480
  }
33621
33481
  }
33622
33482
  out(`${c.dim}${items.length} item(s)${c.reset}`);
@@ -33641,7 +33501,7 @@ function renderThing(out, c, result) {
33641
33501
  if (meta?.durableId || meta?.createdOn || meta?.revisedOn) {
33642
33502
  const now = Date.now();
33643
33503
  if (meta.durableId) {
33644
- out(` ${c.dim}durableId:${c.reset} ${meta.durableId}`);
33504
+ out(` ${c.dim}durableId:${c.reset} ${styleDurableId(meta.durableId, c)}`);
33645
33505
  }
33646
33506
  if (meta.createdOn) {
33647
33507
  out(` ${c.dim}createdOn:${c.reset} ${formatTime(meta.createdOn, now)}`);
@@ -33658,11 +33518,11 @@ function renderThing(out, c, result) {
33658
33518
  for (const field of fields) {
33659
33519
  if (field.wrefs.length === 1) {
33660
33520
  const pad = " ".repeat(Math.max(1, 9 - field.name.length));
33661
- out(` ${c.dim}${field.name}:${c.reset}${pad}${pinnedWref(c, field.wrefs[0])}`);
33521
+ out(` ${c.dim}${field.name}:${c.reset}${pad}${pinnedWref(c, escapeTerminalTextForDisplay(field.wrefs[0]))}`);
33662
33522
  } else {
33663
33523
  out(` ${c.dim}${field.name}:${c.reset}`);
33664
33524
  for (const w of field.wrefs) {
33665
- out(` ${pinnedWref(c, w)}`);
33525
+ out(` ${pinnedWref(c, escapeTerminalTextForDisplay(w))}`);
33666
33526
  }
33667
33527
  }
33668
33528
  }
@@ -33687,7 +33547,7 @@ function renderCollectionSummary(out, c, collection) {
33687
33547
  return;
33688
33548
  out(` ${c.dim}preview:${c.reset}`);
33689
33549
  for (const wref of preview) {
33690
- out(` ${pinnedWref(c, wref)}`);
33550
+ out(` ${pinnedWref(c, escapeTerminalTextForDisplay(wref))}`);
33691
33551
  }
33692
33552
  }
33693
33553
  function renderDataBlock(out, data, indent) {
@@ -33756,11 +33616,11 @@ function renderThingGraph(out, c, result) {
33756
33616
  function renderHistory(out, c, result) {
33757
33617
  if (result.thing && typeof result.thing === "object") {
33758
33618
  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")}`);
33619
+ out(`${c.bold}History: ${pinnedWref(c, wref)}${c.reset} ${kindLabel(c, effectiveKind(result.thing.kind ?? "thing", result.thing.shapeName))}`);
33760
33620
  }
33761
33621
  const firstMeta = result.versions?.[0]?.metadata;
33762
33622
  if (firstMeta?.durableId) {
33763
- out(` ${c.dim}durableId:${c.reset} ${firstMeta.durableId}`);
33623
+ out(` ${c.dim}durableId:${c.reset} ${styleDurableId(firstMeta.durableId, c)}`);
33764
33624
  }
33765
33625
  const versions = result.versions ?? [];
33766
33626
  const now = Date.now();
@@ -33860,7 +33720,7 @@ var handleThingGraph = async (ctx, { flags, args }) => {
33860
33720
  if (depth !== undefined && (depth < 1 || depth > 5)) {
33861
33721
  usageError("Usage: wh thing graph <wref> --depth <1-5>", "wh thing graph Game/base --depth 2");
33862
33722
  }
33863
- const { org, repo } = parseOrgRepo(getRepoRef(ctx), ctx.config);
33723
+ const { org, repo } = parseGraphRepoScope(ctx, wref);
33864
33724
  const result = await ctx.client.thing.graph(org, repo, wref, {
33865
33725
  depth,
33866
33726
  version: flags.version
@@ -34047,6 +33907,7 @@ function validateComponentFilters(componentRef, excludeComponents, ...examples)
34047
33907
  // ../../packages/warmhub-cli/src/domains/thing/where.ts
34048
33908
  var MAX_WHERE_IN_VALUES = 1000;
34049
33909
  var WHERE_USAGE_HINT = 'Example: --where state=NC --where "employees>=100" --where "state?"';
33910
+ var FIELD_USAGE_HINT = "Example: --field data.round=1";
34050
33911
  function requireWhereFieldPath(raw, fieldPath) {
34051
33912
  const normalized = fieldPath.trim();
34052
33913
  if (!normalized) {
@@ -34089,6 +33950,27 @@ function parseWhereFlag(raw) {
34089
33950
  }
34090
33951
  throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --where predicate: "${raw}". Supported operators: =, !=, >, >=, <, <=, ~, in:[...], ?`, undefined, WHERE_USAGE_HINT);
34091
33952
  }
33953
+ function parseFieldFlag(raw) {
33954
+ if (!raw.trim()) {
33955
+ throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --field predicate: "${raw}". --field requires data.path=value.`, undefined, FIELD_USAGE_HINT);
33956
+ }
33957
+ const parsed = parseWhereFlag(raw);
33958
+ if (parsed.op !== "eq") {
33959
+ throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --field predicate: "${raw}". --field supports exact equality only.`, undefined, FIELD_USAGE_HINT);
33960
+ }
33961
+ if (!parsed.fieldPath.startsWith("data.")) {
33962
+ throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --field predicate: "${raw}". Field paths must start with "data.".`, undefined, FIELD_USAGE_HINT);
33963
+ }
33964
+ const fieldPath = parsed.fieldPath.slice("data.".length);
33965
+ if (!fieldPath) {
33966
+ throw new CliError(2 /* UserInput */, "USER_INPUT", `Malformed --field predicate: "${raw}". Field path cannot be empty after "data.".`, undefined, FIELD_USAGE_HINT);
33967
+ }
33968
+ return {
33969
+ fieldPath,
33970
+ op: "eq",
33971
+ rhs: parsed.rhs
33972
+ };
33973
+ }
34092
33974
  function coerceValue(s) {
34093
33975
  if (s.startsWith('"') && s.endsWith('"') || s.startsWith("'") && s.endsWith("'")) {
34094
33976
  return s.slice(1, -1);
@@ -34437,10 +34319,10 @@ function renderQueryResults(out, c, result) {
34437
34319
  const kl = kindLabel(c, effectiveKind(item.kind ?? "thing", shapeName));
34438
34320
  const retractedTag = item.active === false ? ` ${c.red}[RETRACTED]${c.reset}` : "";
34439
34321
  out(` ${wref} ${kl}${retractedTag}`);
34440
- const fields = shapeName && (item.kind === "thing" || !item.kind) && item.data ? collectionFields(shapeName, item.data) : null;
34322
+ const fields = shapeName && (item.kind === "thing" || item.kind === "collection" || !item.kind) && item.data ? collectionFields(shapeName, item.data) : null;
34441
34323
  if (fields) {
34442
34324
  const allWrefs = fields.flatMap((f) => f.wrefs);
34443
- out(` ${allWrefs.map((w) => pinnedWref(c, w)).join(`${c.dim},${c.reset} `)}`);
34325
+ out(` ${allWrefs.map((w) => pinnedWref(c, escapeTerminalTextForDisplay(w))).join(`${c.dim},${c.reset} `)}`);
34444
34326
  } else if (item.data && typeof item.data === "object") {
34445
34327
  const preview = JSON.stringify(item.data);
34446
34328
  const truncated = preview.length > 80 ? `${preview.slice(0, 77)}...` : preview;
@@ -34908,7 +34790,7 @@ async function collectWrefs(opts) {
34908
34790
  async function runSingleView(ctx, wref, flags) {
34909
34791
  const version = flags.version;
34910
34792
  const depth = flags.depth;
34911
- const { org, repo } = looksLikeDurableId(wref) && depth === undefined ? parseOrgRepoOptional(getRepoRef(ctx), ctx.config) : parseOrgRepo(getRepoRef(ctx), ctx.config);
34793
+ const { org, repo } = depth === undefined ? looksLikeDurableId(wref) ? parseOrgRepoOptional(getRepoRef(ctx), ctx.config) : parseOrgRepo(getRepoRef(ctx), ctx.config) : parseGraphRepoScope(ctx, wref);
34912
34794
  const includeRetracted = flags["include-retracted"] || version !== undefined;
34913
34795
  const dataMode = validateDataMode(flags["data-mode"]);
34914
34796
  if (depth !== undefined && (depth < 1 || depth > 5)) {
@@ -35192,7 +35074,7 @@ var handleView2 = async (ctx, { flags, args }) => {
35192
35074
  }
35193
35075
  const version = flags.version;
35194
35076
  const depth = flags.depth;
35195
- const { org, repo } = looksLikeDurableId(wref) && depth === undefined ? parseOrgRepoOptional(getRepoRef(ctx), ctx.config) : parseOrgRepo(getRepoRef(ctx), ctx.config);
35077
+ const { org, repo } = depth === undefined ? looksLikeDurableId(wref) ? parseOrgRepoOptional(getRepoRef(ctx), ctx.config) : parseOrgRepo(getRepoRef(ctx), ctx.config) : parseGraphRepoScope(ctx, wref);
35196
35078
  const includeRetracted = flags["include-retracted"] || version !== undefined;
35197
35079
  if (depth !== undefined && (depth < 1 || depth > 5)) {
35198
35080
  usageError("Usage: wh assertion view <wref> --depth <1-5>", "wh assertion view Belief/cave-safe --depth 2");
@@ -35317,6 +35199,9 @@ var listFlags = {
35317
35199
  cursor: flag.string({ description: "Opaque pagination cursor" }),
35318
35200
  all: flag.boolean({ description: "Fetch all pages" }),
35319
35201
  count: flag.boolean({ description: "Return count of matching assertions" }),
35202
+ field: flag.string({
35203
+ description: "exact data-field filter (data.path=value); served by the typed field index"
35204
+ }),
35320
35205
  match: flag.string({ description: "Filter by wref glob pattern" }),
35321
35206
  "resolve-collections": flag.boolean({
35322
35207
  description: "Include assertions about collections (Pair/Set/List) containing the target."
@@ -35334,9 +35219,11 @@ var handleList = async (ctx, { flags, args }) => {
35334
35219
  const cursor = flags.cursor;
35335
35220
  const all = flags.all;
35336
35221
  const count = flags.count;
35222
+ const field = flags.field;
35337
35223
  const match = flags.match;
35338
35224
  const resolveCollections = flags["resolve-collections"];
35339
35225
  const includeRetracted = flags["include-retracted"];
35226
+ const where = field === undefined ? undefined : [parseFieldFlag(field)];
35340
35227
  if (count) {
35341
35228
  if (cursor || all || limit || ctx.liveMode) {
35342
35229
  usageError("Usage: wh assertion list --count [--shape SHAPE] [--about WREF] [--match PATTERN]", "wh assertion list --shape Belief --count");
@@ -35350,7 +35237,8 @@ var handleList = async (ctx, { flags, args }) => {
35350
35237
  match,
35351
35238
  about: wref,
35352
35239
  includeRetracted,
35353
- resolveCollections
35240
+ resolveCollections,
35241
+ ...where ? { where } : {}
35354
35242
  });
35355
35243
  }
35356
35244
  if (cursor && !limit) {
@@ -35371,7 +35259,8 @@ var handleList = async (ctx, { flags, args }) => {
35371
35259
  match,
35372
35260
  includeRetracted,
35373
35261
  limit: pageLimit,
35374
- cursor
35262
+ cursor,
35263
+ ...where ? { where } : {}
35375
35264
  };
35376
35265
  if (ctx.liveMode) {
35377
35266
  await runLive({
@@ -35416,7 +35305,8 @@ var handleList = async (ctx, { flags, args }) => {
35416
35305
  includeRetracted,
35417
35306
  resolveCollections,
35418
35307
  limit: pageLimit,
35419
- cursor
35308
+ cursor,
35309
+ ...where ? { where } : {}
35420
35310
  };
35421
35311
  if (ctx.liveMode) {
35422
35312
  await runLive({
@@ -35445,7 +35335,8 @@ var handleList = async (ctx, { flags, args }) => {
35445
35335
  includeRetracted,
35446
35336
  resolveCollections,
35447
35337
  limit: pageLimit,
35448
- cursor
35338
+ cursor,
35339
+ ...where ? { where } : {}
35449
35340
  }) : await ctx.client.thing.about(org, repo, wref, {
35450
35341
  shape,
35451
35342
  match,
@@ -35453,7 +35344,8 @@ var handleList = async (ctx, { flags, args }) => {
35453
35344
  includeRetracted,
35454
35345
  resolveCollections,
35455
35346
  limit: boundedLimit,
35456
- cursor
35347
+ cursor,
35348
+ ...where ? { where } : {}
35457
35349
  });
35458
35350
  if (!all && result.nextCursor) {
35459
35351
  emitPartialPageHint(ctx, (result.assertions ?? []).length, result.nextCursor, boundedLimit);
@@ -35478,6 +35370,7 @@ var ASSERTION_DOMAIN = defineDomain({
35478
35370
  examples: [
35479
35371
  "wh assertion list",
35480
35372
  "wh assertion list Location/cave --shape Belief",
35373
+ "wh assertion list Session/run-001 --shape HypothesisCandidate --field data.round=1",
35481
35374
  "wh assertion view Belief/cave-safe",
35482
35375
  "wh assertion list --about Location/cave --shape Belief"
35483
35376
  ],
@@ -35501,8 +35394,8 @@ var ASSERTION_DOMAIN = defineDomain({
35501
35394
  args: "",
35502
35395
  flags: createFlags,
35503
35396
  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}'`
35397
+ `wh assertion create --shape belief --name player-belief --about player --data '{"confidence":0.8}'`,
35398
+ `wh assertion create --shape Distance --name location-distance-value --about Pair/location-distance --data '{"value":5}'`
35506
35399
  ],
35507
35400
  handler: handleCreate
35508
35401
  },
@@ -40971,7 +40864,7 @@ var CREDENTIAL_DOMAIN = defineDomain({
40971
40864
  revoke: {
40972
40865
  status: "live",
40973
40866
  prime: true,
40974
- summary: "Revoke a credential set (blocks new binds and strips auth from existing webhook deliveries)",
40867
+ summary: "Revoke a credential set (blocks new binds and stops bound webhook deliveries)",
40975
40868
  args: "<setName>",
40976
40869
  flags: revokeFlags,
40977
40870
  examples: [
@@ -42119,6 +42012,13 @@ var ONBOARD_DOMAIN = defineDomain({
42119
42012
  handler: handleOnboard
42120
42013
  });
42121
42014
 
42015
+ // ../../packages/warmhub-cli/src/display-name.ts
42016
+ function ensureNonEmptyDisplayName(value, exampleCommand) {
42017
+ if (value !== undefined && value.trim() === "") {
42018
+ usageError("--display-name requires a non-empty value", exampleCommand);
42019
+ }
42020
+ }
42021
+
42122
42022
  // ../../packages/warmhub-cli/src/domains/org-member.ts
42123
42023
  var addMemberFlags = {
42124
42024
  role: flag.string({
@@ -42272,6 +42172,7 @@ var handleCreate4 = async (ctx, { flags, args }) => {
42272
42172
  if (!name) {
42273
42173
  usageError('Usage: wh org create <name> [--display-name "..."] [--description "..."]', 'wh org create caryden --display-name "Carl Ryden" -d "A great org"');
42274
42174
  }
42175
+ ensureNonEmptyDisplayName(flags["display-name"], 'wh org create acme --display-name "Acme Co"');
42275
42176
  const c = ctx.colors;
42276
42177
  const result = await ctx.client.org.create(name, flags["display-name"], flags.description);
42277
42178
  writeOutput(ctx, result, () => {
@@ -42356,6 +42257,7 @@ var handleOrgRename = async (ctx, { args, flags }) => {
42356
42257
  if (newSlug !== undefined && newSlug.length === 0 || rawSlugFromInvocation === "" || flagSlug === "") {
42357
42258
  usageError("New slug must be a non-empty string", "wh org rename acme acme-co");
42358
42259
  }
42260
+ ensureNonEmptyDisplayName(displayName2, 'wh org rename acme --display-name "Acme Co"');
42359
42261
  const c = ctx.colors;
42360
42262
  const slugChange = newSlug && newSlug !== oldName ? newSlug : undefined;
42361
42263
  if (displayName2 !== undefined && slugChange) {
@@ -42479,7 +42381,7 @@ var ORG_DOMAIN = defineDomain({
42479
42381
  });
42480
42382
 
42481
42383
  // ../../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";
42384
+ 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
42385
 
42484
42386
  // ../../packages/warmhub-cli/src/domains/prime.ts
42485
42387
  function buildMarkdown(config) {
@@ -42630,11 +42532,6 @@ function parseExplicitOrgRepoArg(ref, usage, example) {
42630
42532
  const [orgName, repoName] = parts;
42631
42533
  return { orgName, repoName };
42632
42534
  }
42633
- function ensureNonEmptyDisplayName(value, exampleCommand) {
42634
- if (value !== undefined && value.trim() === "") {
42635
- usageError("--display-name requires a non-empty value", exampleCommand);
42636
- }
42637
- }
42638
42535
  function resolveOrgRepoArg(ref, orgFlag) {
42639
42536
  if (ref?.includes("/")) {
42640
42537
  const parts = ref.split("/");
@@ -44852,10 +44749,11 @@ var TOKEN_DOMAIN = defineDomain({
44852
44749
  // ../../packages/warmhub-cli/src/update-check-cache.ts
44853
44750
  import { mkdirSync as mkdirSync7, readFileSync as readFileSync10, writeFileSync as writeFileSync7 } from "node:fs";
44854
44751
  import { homedir as homedir5 } from "node:os";
44855
- import { dirname as dirname7, resolve as resolve3 } from "node:path";
44752
+ import { dirname as dirname8, resolve as resolve3 } from "node:path";
44856
44753
 
44857
44754
  // ../../packages/warmhub-cli/src/update-check-fetch.ts
44858
44755
  import * as childProcess4 from "node:child_process";
44756
+ import { dirname as dirname7 } from "node:path";
44859
44757
  var WH_CLI_PACKAGE_NAME = "@warmhub/cli";
44860
44758
  var UPDATE_DIST_TAG = "latest";
44861
44759
  var DEFAULT_UPDATE_REGISTRY = "https://registry.npmjs.org";
@@ -44896,8 +44794,24 @@ var getUpdateRegistryConfigFingerprint = (env, _cwd, _homePath, _options = {}) =
44896
44794
  return `env:${override}`;
44897
44795
  return `default:${DEFAULT_UPDATE_REGISTRY}`;
44898
44796
  };
44797
+ function withNpmRegistryEnv(env, registry2) {
44798
+ const childEnv = { ...env };
44799
+ for (const key of Object.keys(childEnv)) {
44800
+ if (key.toLowerCase() === "npm_config_registry")
44801
+ delete childEnv[key];
44802
+ }
44803
+ return { ...childEnv, npm_config_registry: registry2 };
44804
+ }
44899
44805
  var fetchLatestCliVersion = (env, registry2) => {
44900
- const proc = childProcess4.spawnSync("npm", [
44806
+ const isWindows = process.platform === "win32";
44807
+ const proc = isWindows ? childProcess4.spawnSync(`npm view ${WH_CLI_PACKAGE_NAME}@${UPDATE_DIST_TAG} version --json`, {
44808
+ encoding: "utf8",
44809
+ cwd: dirname7(process.execPath),
44810
+ env: withNpmRegistryEnv(env, registry2),
44811
+ shell: true,
44812
+ stdio: "pipe",
44813
+ timeout: 8000
44814
+ }) : childProcess4.spawnSync("npm", [
44901
44815
  "view",
44902
44816
  `${WH_CLI_PACKAGE_NAME}@${UPDATE_DIST_TAG}`,
44903
44817
  "version",
@@ -44926,7 +44840,7 @@ var readCache = (homePath) => {
44926
44840
  };
44927
44841
  var writeCache = (homePath, cache) => {
44928
44842
  const path2 = cachePath(homePath);
44929
- mkdirSync7(dirname7(path2), { recursive: true });
44843
+ mkdirSync7(dirname8(path2), { recursive: true });
44930
44844
  writeFileSync7(path2, `${JSON.stringify(cache, null, 2)}
44931
44845
  `, "utf8");
44932
44846
  };
@@ -44945,7 +44859,7 @@ var markUpdateNoticeShown = ({
44945
44859
  import { spawnSync as spawnSync2 } from "node:child_process";
44946
44860
  import { existsSync as existsSync9, readFileSync as readFileSync11, realpathSync } from "node:fs";
44947
44861
  import { homedir as homedir6 } from "node:os";
44948
- import { dirname as dirname8, resolve as resolve4 } from "node:path";
44862
+ import { dirname as dirname9, resolve as resolve4 } from "node:path";
44949
44863
  var DEV_INSTALL_PACKAGE_SEARCH_DEPTH = 8;
44950
44864
  var DEV_INSTALL_GIT_SEARCH_DEPTH = 4;
44951
44865
  var normalizePath = (path2) => path2 ? path2.replaceAll("\\", "/") : "";
@@ -45089,7 +45003,7 @@ var formatUnknownInstallHint = (activePath, realPath, latestVersion, registry2)
45089
45003
  var isDevInstall = (scriptPath) => {
45090
45004
  if (!scriptPath)
45091
45005
  return false;
45092
- let dir = dirname8(scriptPath);
45006
+ let dir = dirname9(scriptPath);
45093
45007
  for (let i = 0;i < DEV_INSTALL_PACKAGE_SEARCH_DEPTH; i += 1) {
45094
45008
  const pkgPath = resolve4(dir, "package.json");
45095
45009
  try {
@@ -45101,7 +45015,7 @@ var isDevInstall = (scriptPath) => {
45101
45015
  for (let j = 0;j < DEV_INSTALL_GIT_SEARCH_DEPTH; j += 1) {
45102
45016
  if (existsSync9(resolve4(probe, ".git")))
45103
45017
  return true;
45104
- const parent2 = dirname8(probe);
45018
+ const parent2 = dirname9(probe);
45105
45019
  if (parent2 === probe)
45106
45020
  break;
45107
45021
  probe = parent2;
@@ -45109,7 +45023,7 @@ var isDevInstall = (scriptPath) => {
45109
45023
  return false;
45110
45024
  }
45111
45025
  } catch {}
45112
- const parent = dirname8(dir);
45026
+ const parent = dirname9(dir);
45113
45027
  if (parent === dir)
45114
45028
  break;
45115
45029
  dir = parent;
@@ -46324,6 +46238,7 @@ async function runCli(argv, opts) {
46324
46238
  ...traceFields
46325
46239
  });
46326
46240
  let exitCode = 0 /* Ok */;
46241
+ let cancelledExitCode;
46327
46242
  let removeSignalListeners;
46328
46243
  try {
46329
46244
  canonicalizeGlobalFlags({ invocation });
@@ -46372,12 +46287,12 @@ async function runCli(argv, opts) {
46372
46287
  });
46373
46288
  const colors = makeColors({
46374
46289
  noColor: !!process.env.NO_COLOR,
46375
- isTTY: !!process.stdout.isTTY
46290
+ isTTY: !!process.stdout.isTTY,
46291
+ colorterm: process.env.COLORTERM
46376
46292
  });
46377
46293
  const chars = makeChars();
46378
46294
  const ac = new AbortController;
46379
46295
  const liveMode = getBoolFlag(invocation.flags, "live");
46380
- let cancelledExitCode;
46381
46296
  const handleSigint = () => {
46382
46297
  ac.abort();
46383
46298
  logger.info("cli.cancelled", { signal: "SIGINT", ...traceFields });
@@ -46424,6 +46339,10 @@ async function runCli(argv, opts) {
46424
46339
  exitCode = cancelledExitCode ?? 0 /* Ok */;
46425
46340
  return exitCode;
46426
46341
  } catch (error) {
46342
+ if (cancelledExitCode !== undefined) {
46343
+ exitCode = cancelledExitCode;
46344
+ return exitCode;
46345
+ }
46427
46346
  const cliError = toCliError2(error);
46428
46347
  const fields = {
46429
46348
  kind: cliError.kind,
@@ -46502,7 +46421,7 @@ function resolveLogLevel(flags, env) {
46502
46421
  // package.json
46503
46422
  var package_default3 = {
46504
46423
  name: "@warmhub/cli",
46505
- version: "0.69.0",
46424
+ version: "0.71.0",
46506
46425
  private: false,
46507
46426
  type: "module",
46508
46427
  description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -47157,4 +47076,4 @@ if (!updateCheckSuppressedByArgv && shouldRunUpdateCheck(updateEligibility)) {
47157
47076
  var interceptedExitCode = await maybeHandleComponentShellBoundary(dispatchArgv);
47158
47077
  process.exitCode = interceptedExitCode === undefined ? await runCli(dispatchArgv, { version: package_default3.version }) : interceptedExitCode;
47159
47078
 
47160
- //# debugId=C8123553A9E5F6D464756E2164756E21
47079
+ //# debugId=94B2C7EE252C64A264756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/cli",
3
- "version": "0.69.0",
3
+ "version": "0.71.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.",