@warmhub/cli 0.80.0 → 0.81.1

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 +158 -27
  2. package/package.json +1 -1
package/dist/wh.js CHANGED
@@ -19201,11 +19201,16 @@ var isStoredContentName = (n) => STORED_CONTENT_NAMES.includes(n);
19201
19201
  var isSynthesizedContentName = (n) => SYNTHESIZED_CONTENT_NAMES.includes(n);
19202
19202
  var BUILTIN_VIEW_SHAPE_NAMES = ["View"];
19203
19203
  var isViewShape = (name) => BUILTIN_VIEW_SHAPE_NAMES.includes(name);
19204
+ var BUILTIN_LICENSE_SHAPE_NAMES = [
19205
+ "LicenseSubject",
19206
+ "LicenseDeclaration"
19207
+ ];
19208
+ var isLicenseShape = (name) => BUILTIN_LICENSE_SHAPE_NAMES.includes(name);
19204
19209
  function isRenameableSquattedShape(name) {
19205
- return isReservedCollectionShape(name) || isViewShape(name);
19210
+ return isReservedCollectionShape(name) || isViewShape(name) || isLicenseShape(name);
19206
19211
  }
19207
19212
  function isBuiltinShape(name) {
19208
- return BUILTIN_SHAPE_NAMES.includes(name) || BUILTIN_CONTENT_SHAPE_NAMES.includes(name) || BUILTIN_VIEW_SHAPE_NAMES.includes(name);
19213
+ return BUILTIN_SHAPE_NAMES.includes(name) || BUILTIN_CONTENT_SHAPE_NAMES.includes(name) || BUILTIN_VIEW_SHAPE_NAMES.includes(name) || BUILTIN_LICENSE_SHAPE_NAMES.includes(name);
19209
19214
  }
19210
19215
  var BUILTIN_SHAPE_DEFS = {
19211
19216
  Arc: {
@@ -19271,10 +19276,63 @@ var BUILTIN_VIEW_SHAPE_DEFS = {
19271
19276
  description: "A named, shareable WarmQuery definition bound to durable IDs"
19272
19277
  }
19273
19278
  };
19279
+ var BUILTIN_LICENSE_SHAPE_DEFS = {
19280
+ LicenseSubject: {
19281
+ fields: {
19282
+ scope: {
19283
+ type: "string",
19284
+ description: "What portion of the repository is being licensed"
19285
+ },
19286
+ "note?": {
19287
+ type: "string",
19288
+ description: "Optional clarification of the licensed scope"
19289
+ }
19290
+ },
19291
+ description: "A licensable body of work in this repository"
19292
+ },
19293
+ LicenseDeclaration: {
19294
+ fields: {
19295
+ "licenseWref?": {
19296
+ type: "wref",
19297
+ description: "Canonical license reference when one license applies"
19298
+ },
19299
+ spdxIdRaw: {
19300
+ type: "string",
19301
+ description: "Declared SPDX identifier or raw license value"
19302
+ },
19303
+ "spdxExpression?": {
19304
+ type: "string",
19305
+ description: "Full SPDX expression for compound declarations"
19306
+ },
19307
+ "appliesTo?": {
19308
+ type: "string",
19309
+ description: "Kind of work covered by the declaration"
19310
+ },
19311
+ "attributionText?": {
19312
+ type: "string",
19313
+ description: "Attribution text reusers should preserve"
19314
+ },
19315
+ "declaredBy?": {
19316
+ type: "string",
19317
+ description: "Person or organization making the declaration"
19318
+ },
19319
+ "sourceUrl?": {
19320
+ type: "string",
19321
+ description: "Upstream source for the licensing terms"
19322
+ },
19323
+ "note?": {
19324
+ type: "string",
19325
+ description: "Optional declaration caveats or clarification"
19326
+ }
19327
+ },
19328
+ description: "Declares the license of a LicenseSubject"
19329
+ }
19330
+ };
19274
19331
  var ALL_BUILTIN_SHAPE_DEFS = {
19275
19332
  ...BUILTIN_SHAPE_DEFS,
19276
19333
  ...BUILTIN_CONTENT_SHAPE_DEFS,
19277
- ...BUILTIN_VIEW_SHAPE_DEFS
19334
+ ...BUILTIN_VIEW_SHAPE_DEFS,
19335
+ ...BUILTIN_LICENSE_SHAPE_DEFS
19278
19336
  };
19279
19337
  // ../../packages/rules/src/client-header.ts
19280
19338
  var CLIENT_HEADER = "X-WarmHub-Client";
@@ -27080,10 +27138,13 @@ function hasAnyTokens(s) {
27080
27138
  // ../../packages/rules/src/preflight-commit.ts
27081
27139
  function preflightCommitDiagnostics(operations, options) {
27082
27140
  const errors = [];
27083
- rejectCommitTokenSyntax(operations, errors);
27084
- illegalOpSequences(operations, errors, options?.checkAddAdd ?? true);
27141
+ rejectCommitTokenSyntax(operations, errors, options);
27142
+ illegalOpSequences(operations, errors, options?.checkAddAdd ?? true, options);
27085
27143
  return errors;
27086
27144
  }
27145
+ function sourceOperationIndex(filteredIndex, options) {
27146
+ return options?.sourceOperationIndexes?.[filteredIndex] ?? filteredIndex;
27147
+ }
27087
27148
  function getOpName(op) {
27088
27149
  return op.name;
27089
27150
  }
@@ -27097,7 +27158,7 @@ function tokenStringFields(op) {
27097
27158
  }
27098
27159
  return fields;
27099
27160
  }
27100
- function rejectCommitTokenSyntax(operations, errors) {
27161
+ function rejectCommitTokenSyntax(operations, errors, options) {
27101
27162
  for (let i = 0;i < operations.length; i++) {
27102
27163
  const op = operations[i];
27103
27164
  if (!op)
@@ -27106,7 +27167,7 @@ function rejectCommitTokenSyntax(operations, errors) {
27106
27167
  if (field && hasAnyTokens(field)) {
27107
27168
  errors.push({
27108
27169
  code: "COMMIT_TOKEN_SYNTAX_REMOVED",
27109
- operationIndex: i,
27170
+ operationIndex: sourceOperationIndex(i, options),
27110
27171
  message: COMMIT_TOKEN_SYNTAX_REMOVED_MESSAGE
27111
27172
  });
27112
27173
  break;
@@ -27114,7 +27175,7 @@ function rejectCommitTokenSyntax(operations, errors) {
27114
27175
  }
27115
27176
  }
27116
27177
  }
27117
- function illegalOpSequences(operations, errors, checkAddAdd) {
27178
+ function illegalOpSequences(operations, errors, checkAddAdd, options) {
27118
27179
  const opHistory = new Map;
27119
27180
  for (let i = 0;i < operations.length; i++) {
27120
27181
  const op = operations[i];
@@ -27128,7 +27189,10 @@ function illegalOpSequences(operations, errors, checkAddAdd) {
27128
27189
  const kind = inferOperationKind({ ...op, name });
27129
27190
  const qualName = kind === "shape" ? `shape:${name}` : `thing:${name}`;
27130
27191
  const history = opHistory.get(qualName) ?? [];
27131
- history.push({ operation: op.operation, index: i });
27192
+ history.push({
27193
+ operation: op.operation,
27194
+ index: sourceOperationIndex(i, options)
27195
+ });
27132
27196
  opHistory.set(qualName, history);
27133
27197
  }
27134
27198
  for (const [qualName, history] of opHistory) {
@@ -28477,7 +28541,7 @@ function dedupeDeprecationsByShape(results) {
28477
28541
  // ../../packages/sdk-ts/package.json
28478
28542
  var package_default = {
28479
28543
  name: "@warmhub/sdk-ts",
28480
- version: "0.78.0",
28544
+ version: "0.79.1",
28481
28545
  private: false,
28482
28546
  type: "module",
28483
28547
  description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -29623,6 +29687,26 @@ class WarmHubClient {
29623
29687
  throw toWarmHubError(error);
29624
29688
  }
29625
29689
  },
29690
+ getLicense: async (orgName, repoName) => {
29691
+ try {
29692
+ return await this.trpc.repo.getLicense.query({
29693
+ orgName,
29694
+ repoName
29695
+ });
29696
+ } catch (error) {
29697
+ throw toWarmHubError(error);
29698
+ }
29699
+ },
29700
+ describe: async (orgName, repoName) => {
29701
+ try {
29702
+ return await this.trpc.repo.describe.query({
29703
+ orgName,
29704
+ repoName
29705
+ });
29706
+ } catch (error) {
29707
+ throw toWarmHubError(error);
29708
+ }
29709
+ },
29626
29710
  setReadme: async (orgName, repoName, content) => {
29627
29711
  try {
29628
29712
  assertContentWithinLimit("Content/Readme.content", content);
@@ -39090,7 +39174,7 @@ var createFlags3 = {
39090
39174
  description: "Write per-append timing sidecar JSON to this path (debug/bench instrumentation)"
39091
39175
  }),
39092
39176
  "stream-id": flag.string({
39093
- description: "Use a caller-managed stream id for JSONL token continuity."
39177
+ description: "caller-managed stream id for JSONL observability and partial-submission diagnostics"
39094
39178
  }),
39095
39179
  message: flag.string({ short: "m", description: "Commit message" }),
39096
39180
  committer: flag.string({
@@ -40205,10 +40289,10 @@ var handleSubmit = async (ctx, { flags, args }) => {
40205
40289
  throw new CliError(2 /* UserInput */, "USER_INPUT", "--timing-out requires a .jsonl --file.", undefined, "wh commit submit --file ops.jsonl --timing-out timing.json --stream-id import-1 --skip-existing -m 'Import operations' --repo acme/world");
40206
40290
  }
40207
40291
  if ((streamInput || jsonlFile) && streamId === undefined) {
40208
- throw new CliError(2 /* UserInput */, "USER_INPUT", "JSONL streaming requires --stream-id.", undefined, "Choose a stable id up front so add streams can rebuild token state on full rerun: --stream-id bulk-2026-06-04.");
40292
+ throw new CliError(2 /* UserInput */, "USER_INPUT", "JSONL streaming requires --stream-id.", undefined, 'Example: wh commit submit --file ops.jsonl --stream-id bulk-2026-06-04 --skip-existing -m "Bulk import" --repo acme/world');
40209
40293
  }
40210
40294
  if ((streamInput || jsonlFile) && !skipExisting) {
40211
- throw new CliError(2 /* UserInput */, "USER_INPUT", "JSONL streaming requires --skip-existing.", undefined, "Full-input rerun recovery depends on idempotent add operations; pass --skip-existing with --stream-id.");
40295
+ throw new CliError(2 /* UserInput */, "USER_INPUT", "JSONL streaming requires --skip-existing.", undefined, 'Example: wh commit submit --file ops.jsonl --stream-id bulk-2026-06-04 --skip-existing -m "Bulk import" --repo acme/world');
40212
40296
  }
40213
40297
  let operations;
40214
40298
  if (operationSource === "--stream") {
@@ -42875,6 +42959,42 @@ function getHttpTimeoutSnapshot() {
42875
42959
  return snapshot;
42876
42960
  }
42877
42961
 
42962
+ // ../../packages/warmhub-cli/src/domains/doctor-repo-license.ts
42963
+ var LICENSE_SUBSTRATE = "warmhub-data/global.reference.licenses";
42964
+ async function checkRepoLicenseDeclaration(ctx, repo, repoInfo) {
42965
+ if (repoInfo.visibility !== "public")
42966
+ return null;
42967
+ const safeRepoRef = escapeTerminalTextForDisplay(repo.ref);
42968
+ try {
42969
+ const license = await ctx.client.repo.getLicense(repo.orgName, repo.repoName);
42970
+ if (license) {
42971
+ const safeSpdxId = escapeTerminalTextForDisplay(license.spdxId);
42972
+ return {
42973
+ key: "repo-license",
42974
+ name: "repo-license",
42975
+ status: "ok",
42976
+ message: `Public repo ${safeRepoRef} declares ${safeSpdxId}`
42977
+ };
42978
+ }
42979
+ return {
42980
+ key: "repo-license",
42981
+ name: "repo-license",
42982
+ status: "warn",
42983
+ message: `Public repo ${safeRepoRef} has no repository license declaration.`,
42984
+ detail: `Choose the correct license, then create the native LicenseSubject/repo thing and LicenseDeclaration/repo assertion. Set spdxIdRaw and, when applicable, licenseWref to a canonical License in ${LICENSE_SUBSTRATE}. No component installation is required.`
42985
+ };
42986
+ } catch (error) {
42987
+ const failure = classifyDoctorLookupError(error);
42988
+ const safeDescription = escapeTerminalTextForDisplay(failure.description);
42989
+ return {
42990
+ key: "repo-license",
42991
+ name: "repo-license",
42992
+ status: "warn",
42993
+ message: `Could not verify repository license declaration for public repo ${safeRepoRef}: ${safeDescription}`
42994
+ };
42995
+ }
42996
+ }
42997
+
42878
42998
  // ../../packages/warmhub-cli/src/domains/doctor-checks.ts
42879
42999
  async function collectChecks(ctx) {
42880
43000
  const harnessPaths = getHarnessPaths();
@@ -42920,14 +43040,18 @@ async function collectChecks(ctx) {
42920
43040
  status: apiUrl ? "ok" : "fail",
42921
43041
  message: apiUrl ? `API URL: ${apiUrl}` : "WARMHUB_API_URL not set and no default available"
42922
43042
  });
42923
- const repo = ctx.config.defaultRepo;
42924
- const repoSource = ctx.config.configSource?.repo;
43043
+ const repoFlag = getRepoRef(ctx);
43044
+ const hasRepoFlag = repoFlag !== undefined;
43045
+ const repo = repoFlag ?? ctx.config.defaultRepo;
43046
+ const repoParts = repo !== undefined ? splitRepoSlug(repo) : null;
43047
+ const repoForDisplay = repo !== undefined ? escapeTerminalTextForDisplay(repo) : undefined;
43048
+ const repoSource = hasRepoFlag ? "flag" : ctx.config.configSource?.repo;
42925
43049
  const repoProvenance = repoSource === "env" ? " (from WARMHUB_REPO)" : repoSource === "wh-file" ? " (from .wh file)" : repoSource === "flag" ? " (from --repo flag)" : "";
42926
43050
  checks.push({
42927
43051
  key: "default-repo",
42928
43052
  name: "default-repo",
42929
- status: repo ? "ok" : "warn",
42930
- message: repo ? `Default repo: ${repo}${repoProvenance}` : "No default repo set (use --repo flag, WARMHUB_REPO, or wh use org/repo)"
43053
+ status: repo !== undefined ? repoParts ? "ok" : "fail" : "warn",
43054
+ message: repo !== undefined ? repoParts ? `${hasRepoFlag ? "Target" : "Default"} repo: ${repoForDisplay}${repoProvenance}` : `Invalid repo format "${repoForDisplay}". Expected "org/repo".` : "No default repo set (use --repo flag, WARMHUB_REPO, or wh use org/repo)"
42931
43055
  });
42932
43056
  const profileFlag = ctx.invocation.flags.profile;
42933
43057
  const profile = (typeof profileFlag === "string" ? profileFlag : undefined) ?? ctx.config.profile ?? ctx.profile ?? "default";
@@ -43035,7 +43159,8 @@ async function collectChecks(ctx) {
43035
43159
  });
43036
43160
  }
43037
43161
  }
43038
- if (repo?.includes("/")) {
43162
+ if (repo !== undefined && repoParts) {
43163
+ const safeRepoRef = escapeTerminalTextForDisplay(repo);
43039
43164
  if (!backendOk) {
43040
43165
  checks.push({
43041
43166
  key: "repo",
@@ -43044,22 +43169,25 @@ async function collectChecks(ctx) {
43044
43169
  message: "Skipped (backend unreachable)"
43045
43170
  });
43046
43171
  } else {
43047
- const [orgName, repoName] = repo.split("/", 2);
43172
+ const { org: orgName, repo: repoName } = repoParts;
43048
43173
  try {
43049
- await ctx.client.repo.get(orgName, repoName);
43174
+ const repoInfo = await ctx.client.repo.get(orgName, repoName);
43050
43175
  checks.push({
43051
43176
  key: "repo",
43052
43177
  name: "repo",
43053
43178
  status: "ok",
43054
- message: `Repo ${repo} exists`
43179
+ message: `Repo ${safeRepoRef} exists`
43055
43180
  });
43181
+ const licenseCheck = await checkRepoLicenseDeclaration(ctx, { ref: repo, orgName, repoName }, repoInfo);
43182
+ if (licenseCheck)
43183
+ checks.push(licenseCheck);
43056
43184
  } catch (e) {
43057
43185
  const failure = classifyDoctorLookupError(e);
43058
43186
  checks.push({
43059
43187
  key: "repo",
43060
43188
  name: "repo",
43061
43189
  status: "fail",
43062
- message: failure.classification === "not-found" ? `Repo ${repo} not found: ${failure.description}` : `Repo ${repo} lookup failed: ${failure.description}`
43190
+ message: failure.classification === "not-found" ? `Repo ${safeRepoRef} not found: ${failure.description}` : `Repo ${safeRepoRef} lookup failed: ${failure.description}`
43063
43191
  });
43064
43192
  }
43065
43193
  }
@@ -44148,7 +44276,7 @@ var ORG_DOMAIN = defineDomain({
44148
44276
  });
44149
44277
 
44150
44278
  // ../../packages/warmhub-cli/src/domains/prime-content.md
44151
- 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|--file) [--shape]` — Create\n- `wh thing revise <name> [--data] [--message] [--committer] [--expected-version]` — Revise (CONFLICT if HEAD≠n)\n- `wh thing retract <wref> -m <message> [--reason] [--kind]` — Retract\n- `wh thing query [--shape] [--kind] [--about] [--match]` — Query by filters\n- `wh thing search <query> [--shape] [--kind] [--about] [--mode]` — Search text\n- `wh thing rename <Shape/oldName> <newName>` — Rename\n- `wh thing refs <wref> [--inbound] [--outbound] [--field]` — Show field references; use `wh thing about` for assertions about the target thing\n- `wh thing about <wref> [--shape] [--match] [--depth] [--resolve-collections] [--role from|to|ends] [--limit] [--include-retracted]` — Show assertions about the target identity; `--resolve-collections` expands bare/@HEAD/@ALL members, `--role` filters direction; not pinned @vN\n\n### 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|--file)`\n- `wh shape create <name> (--fields|--file)`\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` — help overview\n- `wh <domain>` — domain verbs\n- `wh <domain> <verb> --help` — verb flags and examples\n- `wh help --format json` — `CliSpecV2` (`schemaVersion: 2`): global/contextual/root tables and command overrides\n\n## Common Workflows\n\n**Explore a repo:**\n```bash\nwh thing list --repo org/repo # see all things in HEAD\nwh thing view Shape/name --repo org/repo # inspect a specific thing\nwh thing history Shape/name --repo org/repo # inspect version history\nwh thing about Shape/name # assertions about thing/shape\n```\n\n**Create an assertion** (most common write):\n```bash\n# --about takes an untyped target wref: Shape or Shape/name.\nwh assertion create --shape MyShape --about TargetShape/target-name \\\n --name my-assertion --data '{\"field_a\":1,\"field_b\":\"value\"}' --repo org/repo\n# Output includes per-operation status; relay failures when present.\n```\n\n**Create via write entrypoint** (alternative, supports batches and streams):\n```bash\nwh commit submit --add my-item --shape MyShape --kind assertion \\\n --about TargetShape/target-name --data '{\"field_a\":1}' --repo org/repo\n```\n\n**Batch write via file** (generate template → edit → submit):\n```bash\nwh shape template Hypothesis Evidence -o ops.json # add --kind assertion --about TargetShape/name for assertions\n# edit ops.json — fill FILL_IN placeholders\nwh commit submit --file ops.json -m \"batch update\" # submit all operations (bare `wh commit` is equivalent)\n# --file format: docs.warmhub.ai/cli-reference/commit-operations\n```\n\n**Bulk write (JSONL stream, >1k ops)** — one chunked stream beats per-record commits (~60× faster):\n```bash\nwh shape template MyShape -o ops.jsonl # one op per line (.jsonl)\nID=\"bulk-$(date +%s)\" # 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 arc --name route --members Location/a,Location/b --repo org/repo\nwh assertion create --shape Supports --name route-support --about Arc/route --data '{\"confidence\":0.8}' --repo org/repo\n```\n\n**Modify data:**\n```bash\nwh thing revise Shape/name --data '{\"x\":5,\"y\":3}' -m \"update\" --repo org/repo\nwh thing retract Shape/old-item -m \"withdrawn\" --reason \"data feed contaminated\" --repo org/repo\n```\n\n**Query and filter:**\n```bash\nwh thing query --shape MyShape # by shape\nwh thing query --kind assertion --about Shape/name # by kind + target\nwh thing history Shape/name --limit 10 # version history\n```\n\n## Built-in Content shape\n\nWarmHub repos expose three well-known content wrefs:\n- `Content/Readme` — stored markdown for humans\n- `Content/Agents` — stored markdown guidance for AI agents\n- `Content/LlmsTxt` — synthesized per-request sitemap (read-only)\n\nFetch via `wh repo content get --kind readme|agents|llms-txt`,\n`client.repo.getReadme/getAgents/getLlmsTxt`, MCP `warmhub_repo_content_get`,\nor raw HTTP `GET /{org}/{repo}/readme.md|agents.md|llms.txt`.\nSee `wh repo describe` → `additionalInformation` for the discovery field.\n\n## Query Discipline\n- Plan the repo, shapes, and wrefs you need before the first query.\n- Gather the needed facts from one repo before switching to another.\n- Do the queries first, then write one complete answer.\n\n## Agent Tips\n- **Always run commands for live data** — this context describes the CLI, not repo contents\n- **Before writing, discover wrefs** — run `wh thing list` or `wh shape list`\n- **Shape field types**: `string`, `number`, `boolean`, `wref`, arrays, optionals, nested objects\n- **Write commands return per-operation results** — relay failures and affected wrefs to the user\n- **Pass data inline** with `--data '{...}'` — do NOT create temp files\n- Add `--json` to any command for machine-readable JSON output\n- **Aliases teach canonical commands** — executing aliases emit a status hint; misleading lifecycle aliases reject and point to `retract`\n- Writes go through `wh commit submit` (or bare `wh commit`) or wrappers (`create`, `revise`, `retract`, `assertion create`). `retract` irreversibly withdraws an identity and creates a history entry.\n- Use `wh doctor` to check environment health\n";
44279
+ 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|--file) [--shape]` — Create\n- `wh thing revise <name> [--data] [--message] [--committer] [--expected-version]` — Revise (CONFLICT if HEAD≠n)\n- `wh thing retract <wref> -m <message> [--reason] [--kind]` — Retract\n- `wh thing query [--shape] [--kind] [--about] [--match]` — Query by filters\n- `wh thing search <query> [--shape] [--kind] [--about] [--mode]` — Search text\n- `wh thing rename <Shape/oldName> <newName>` — Rename\n- `wh thing refs <wref> [--inbound] [--outbound] [--field]` — Show field references; use `wh thing about` for assertions about the target thing\n- `wh thing about <wref> [--shape] [--match] [--depth] [--resolve-collections] [--role from|to|ends] [--limit] [--include-retracted]` — Show assertions about the target identity; `--resolve-collections` expands bare/@HEAD/@ALL members, `--role` filters direction; not pinned @vN\n\n### 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|--file)`\n- `wh shape create <name> (--fields|--file)`\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` — help overview\n- `wh <domain>` — domain verbs\n- `wh <domain> <verb> --help` — verb flags and examples\n- `wh help --format json` — `CliSpecV2` (`schemaVersion: 2`): global/contextual/root tables and command overrides\n\n## Common Workflows\n\n**Explore a repo:**\n```bash\nwh thing list --repo org/repo # see all things in HEAD\nwh thing view Shape/name --repo org/repo # inspect a specific thing\nwh thing history Shape/name --repo org/repo # inspect version history\nwh thing about Shape/name # assertions about thing/shape\n```\n\n**Create an assertion** (most common write):\n```bash\n# --about takes an untyped target wref: Shape or Shape/name.\nwh assertion create --shape MyShape --about TargetShape/target-name \\\n --name my-assertion --data '{\"field_a\":1,\"field_b\":\"value\"}' --repo org/repo\n# Output includes per-operation status; relay failures when present.\n```\n\n**Create via write entrypoint** (alternative, supports batches and streams):\n```bash\nwh commit submit --add my-item --shape MyShape --kind assertion \\\n --about TargetShape/target-name --data '{\"field_a\":1}' --repo org/repo\n```\n\n**Batch write via file** (generate template → edit → submit):\n```bash\nwh shape template Hypothesis Evidence -o ops.json # add --kind assertion --about TargetShape/name for assertions\n# edit ops.json — fill FILL_IN placeholders\nwh commit submit --file ops.json -m \"batch update\" # submit all operations (bare `wh commit` is equivalent)\n# --file format: docs.warmhub.ai/cli-reference/commit-operations\n```\n\n**Bulk write (JSONL stream, >1k ops)** — one chunked stream beats per-record commits (~60× faster):\n```bash\nwh shape template MyShape -o ops.jsonl # one op per line (.jsonl)\nID=\"bulk-$(date +%s)\" # caller id for chunk correlation\nwh commit submit --file ops.jsonl --stream-id \"$ID\" --chunk-size 5000 \\\n --skip-existing --progress -m \"bulk ingest\" --repo org/repo\n# --chunk-size: ops per append chunk (default 1000, max 10000); chunk≈1 is ~60× slower\n# --skip-existing: skips already-written add ops (drops per-row read-before-write)\n# Add-only restart: rerun the WHOLE file. --skip-existing makes fixed-name adds\n# idempotent; --stream-id only identifies the submission. Mid-stream resume is\n# not a CLI mode. Revise/retract JSONL is not full-rerun safe after an ambiguous\n# append; inspect repo state and reconcile.\n```\n\n**Create collections:**\n```bash\nwh commit submit --type arc --name route --members Location/a,Location/b --repo org/repo\nwh assertion create --shape Supports --name route-support --about Arc/route --data '{\"confidence\":0.8}' --repo org/repo\n```\n\n**Modify data:**\n```bash\nwh thing revise Shape/name --data '{\"x\":5,\"y\":3}' -m \"update\" --repo org/repo\nwh thing retract Shape/old-item -m \"withdrawn\" --reason \"data feed contaminated\" --repo org/repo\n```\n\n**Query and filter:**\n```bash\nwh thing query --shape MyShape # by shape\nwh thing query --kind assertion --about Shape/name # by kind + target\nwh thing history Shape/name --limit 10 # version history\n```\n\n## Built-in Content shape\n\nWarmHub repos expose three well-known content wrefs:\n- `Content/Readme` — stored markdown for humans\n- `Content/Agents` — stored markdown guidance for AI agents\n- `Content/LlmsTxt` — synthesized per-request sitemap (read-only)\n\nFetch via `wh repo content get --kind readme|agents|llms-txt`,\n`client.repo.getReadme/getAgents/getLlmsTxt`, MCP `warmhub_repo_content_get`,\nor raw HTTP `GET /{org}/{repo}/readme.md|agents.md|llms.txt`.\nSee `wh repo describe` → `additionalInformation` for the discovery field.\n\n## Query Discipline\n- Plan the repo, shapes, and wrefs you need before the first query.\n- Gather the needed facts from one repo before switching to another.\n- Do the queries first, then write one complete answer.\n\n## Agent Tips\n- **Always run commands for live data** — this context describes the CLI, not repo contents\n- **Before writing, discover wrefs** — run `wh thing list` or `wh shape list`\n- **Shape field types**: `string`, `number`, `boolean`, `wref`, arrays, optionals, nested objects\n- **Write commands return per-operation results** — relay failures and affected wrefs to the user\n- **Pass data inline** with `--data '{...}'` — do NOT create temp files\n- Add `--json` to any command for machine-readable JSON output\n- **Aliases teach canonical commands** — executing aliases emit a status hint; misleading lifecycle aliases reject and point to `retract`\n- Writes go through `wh commit submit` (or bare `wh commit`) or wrappers (`create`, `revise`, `retract`, `assertion create`). `retract` irreversibly withdraws an identity and creates a history entry.\n- Use `wh doctor` to check environment health\n";
44152
44280
 
44153
44281
  // ../../packages/warmhub-cli/src/domains/prime.ts
44154
44282
  function buildMarkdown(config) {
@@ -44768,8 +44896,9 @@ var handleDescribe = async (ctx, { args, flags }) => {
44768
44896
  const { org, repo } = parseOrgRepo(repoRef, ctx.config);
44769
44897
  const c = ctx.colors;
44770
44898
  const showIndexedFields = flags["indexed-fields"] === true;
44771
- const [repoInfo, shapesPage, stats, indexedFields] = await Promise.all([
44899
+ const [repoInfo, license, shapesPage, stats, indexedFields] = await Promise.all([
44772
44900
  ctx.client.repo.get(org, repo),
44901
+ ctx.client.repo.getLicense(org, repo),
44773
44902
  ctx.client.shape.list(org, repo),
44774
44903
  ctx.client.repo.getStats(org, repo),
44775
44904
  showIndexedFields ? ctx.client.repo.index.describe(org, repo) : null
@@ -44792,6 +44921,7 @@ var handleDescribe = async (ctx, { args, flags }) => {
44792
44921
  org,
44793
44922
  repo,
44794
44923
  description: repoInfo.description ?? null,
44924
+ license,
44795
44925
  counts: {
44796
44926
  byKind: stats.byKind,
44797
44927
  byShape
@@ -44815,6 +44945,7 @@ var handleDescribe = async (ctx, { args, flags }) => {
44815
44945
  if (repoInfo.description) {
44816
44946
  ctx.out(` ${escapeTerminalTextForDisplay(repoInfo.description)}`);
44817
44947
  }
44948
+ ctx.out(` License: ${license ? escapeTerminalTextForDisplay(license.spdxExpression ?? license.spdxId) : "not declared"}`);
44818
44949
  ctx.out("");
44819
44950
  ctx.out(`${c.bold}Counts${c.reset} ${stats.byKind.shape} shapes, ${stats.byKind.thing} things, ${stats.byKind.assertion} assertions (${stats.total} total)`);
44820
44951
  const shapeCountEntries = Object.entries(byShape);
@@ -48972,7 +49103,7 @@ function resolveLogLevel(flagLevel, env) {
48972
49103
  // package.json
48973
49104
  var package_default3 = {
48974
49105
  name: "@warmhub/cli",
48975
- version: "0.80.0",
49106
+ version: "0.81.1",
48976
49107
  private: false,
48977
49108
  type: "module",
48978
49109
  description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -49589,5 +49720,5 @@ process.exitCode = interceptedExitCode === undefined ? await runPreparedCli(laun
49589
49720
  version: package_default3.version
49590
49721
  }) : interceptedExitCode;
49591
49722
 
49592
- //# debugId=3EAE1910B1B57D6664756E2164756E21
49593
- //# warmhub-cli-build-info {"cliVersion":"0.80.0","sdkVersion":"0.78.0"}
49723
+ //# debugId=AA89D7481E5617C864756E2164756E21
49724
+ //# warmhub-cli-build-info {"cliVersion":"0.81.1","sdkVersion":"0.79.1"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/cli",
3
- "version": "0.80.0",
3
+ "version": "0.81.1",
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.",