@warmhub/cli 0.136.0 → 0.137.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/wh.js +34 -11
  2. package/package.json +1 -1
package/dist/wh.js CHANGED
@@ -26272,6 +26272,9 @@ var RESERVED_THING_ROOT_PREFIX = `${RESERVED_THING_ROOT}/`;
26272
26272
  function isReservedThingRoot(name) {
26273
26273
  return name === RESERVED_THING_ROOT || name.startsWith(RESERVED_THING_ROOT_PREFIX);
26274
26274
  }
26275
+ function isReservedShapeName(name) {
26276
+ return name === RESERVED_THING_ROOT;
26277
+ }
26275
26278
  function reservedThingRootMessage(name) {
26276
26279
  return `Name "${name}" is under the reserved root "${RESERVED_THING_ROOT_PREFIX}"; only Shapes live there, as ${RESERVED_THING_ROOT_PREFIX}shapes/<Name>`;
26277
26280
  }
@@ -26354,8 +26357,9 @@ function reservedRootRefusal(name, operationIndex) {
26354
26357
  };
26355
26358
  }
26356
26359
  function reservedRootGuard(op, operationIndex) {
26357
- if (op.kind === "shape")
26358
- return [];
26360
+ if (op.operation === "add" && op.kind === "shape") {
26361
+ return op.name && isReservedShapeName(op.name) ? [reservedRootRefusal(op.name, operationIndex)] : [];
26362
+ }
26359
26363
  if (op.operation === "add" && op.name) {
26360
26364
  const stored = op.kind === "collection" ? op.name : splitLocalPath2(op.name)?.bareName;
26361
26365
  if (stored !== undefined && isReservedThingRoot(stored)) {
@@ -26363,8 +26367,8 @@ function reservedRootGuard(op, operationIndex) {
26363
26367
  }
26364
26368
  return [];
26365
26369
  }
26366
- const isShapeRename = op.name !== undefined && splitLocalPath2(op.name) === null;
26367
- if (op.operation === "rename" && !isShapeRename && op.newName !== undefined && isReservedThingRoot(op.newName)) {
26370
+ const isShapeRename = op.kind === "shape" || op.name !== undefined && splitLocalPath2(op.name) === null;
26371
+ if (op.operation === "rename" && op.newName !== undefined && (isShapeRename ? isReservedShapeName(op.newName) : isReservedThingRoot(op.newName))) {
26368
26372
  return [reservedRootRefusal(op.newName, operationIndex)];
26369
26373
  }
26370
26374
  return [];
@@ -44589,6 +44593,7 @@ var DEFINITE_CLIENT_REJECT_CODES = new Set([
44589
44593
  "NOT_FOUND",
44590
44594
  "KIND_MISMATCH",
44591
44595
  "CONFLICT",
44596
+ "NAME_TAKEN",
44592
44597
  "ALREADY_RETRACTED",
44593
44598
  "ARCHIVED",
44594
44599
  "RATE_LIMITED",
@@ -44988,7 +44993,13 @@ var currentErrorDetailsSchema = exports_external.discriminatedUnion("reason", [
44988
44993
  exports_external.object({
44989
44994
  reason: exports_external.literal("dependency_failed"),
44990
44995
  producerOpIndexes: exports_external.array(exports_external.number().int().nonnegative()).min(1)
44991
- }).strict()
44996
+ }).strict(),
44997
+ exports_external.object({
44998
+ reason: exports_external.literal("name_taken"),
44999
+ name: exports_external.string().min(1),
45000
+ takenBy: exports_external.object({ shape: exports_external.string().min(1), durableId: exports_external.string().min(1) }).loose().optional(),
45001
+ suggestedName: exports_external.string().min(1).optional()
45002
+ }).loose()
44992
45003
  ]);
44993
45004
  var currentBaseShape = {
44994
45005
  ...positionShape,
@@ -45478,7 +45489,7 @@ function createStreamingSubmissionHandle(input, deps) {
45478
45489
  // ../../packages/sdk-ts/package.json
45479
45490
  var package_default = {
45480
45491
  name: "@warmhub/sdk-ts",
45481
- version: "0.134.0",
45492
+ version: "0.135.0",
45482
45493
  private: false,
45483
45494
  type: "module",
45484
45495
  description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -48397,6 +48408,8 @@ function classifyConflict(message, code) {
48397
48408
  return "lease-held";
48398
48409
  case "INCREMENTAL_READ_UNAVAILABLE":
48399
48410
  return "incremental-read-unavailable";
48411
+ case "NAME_TAKEN":
48412
+ return "name-taken";
48400
48413
  case undefined:
48401
48414
  default:
48402
48415
  break;
@@ -48433,6 +48446,10 @@ function conflictHint(message, code) {
48433
48446
  return "This thing is leased by another holder. Back off until the lease expires (see leaseExpiresAt / retryAfter), then retry.";
48434
48447
  case "incremental-read-unavailable":
48435
48448
  return INCREMENTAL_READ_UNAVAILABLE_GUIDANCE;
48449
+ case "name-taken": {
48450
+ const suggested = /for example "([^"]+)"/.exec(message)?.[1];
48451
+ return suggested ? `Another Thing in this repository holds this name. Use "${suggested}" or another free name; retrying the same name cannot succeed.` : "Another Thing in this repository holds this name. Choose another name; retrying the same name cannot succeed.";
48452
+ }
48436
48453
  case "other":
48437
48454
  default:
48438
48455
  return "Resolve the conflicting existing state and try again.";
@@ -48456,6 +48473,7 @@ var TOP_LEVEL_USER_INPUT_CODES = new Set([
48456
48473
  ]);
48457
48474
  var CONFLICT_SHAPED_CODES = new Set([
48458
48475
  "CONFLICT",
48476
+ "NAME_TAKEN",
48459
48477
  "ALREADY_EXISTS",
48460
48478
  "BUILTIN_SHAPE_CONFLICT",
48461
48479
  "ARCHIVED",
@@ -48668,6 +48686,11 @@ function generateSuggestions(code, message, context, errorCode) {
48668
48686
  action: "Wait for the repo delete to finish or cancel it before retrying"
48669
48687
  });
48670
48688
  break;
48689
+ case "name-taken":
48690
+ suggestions.push({
48691
+ action: "Choose a name no other Thing in the repository holds (use details.suggestedName when the error carries one)"
48692
+ });
48693
+ break;
48671
48694
  case "lease-held":
48672
48695
  suggestions.push({
48673
48696
  action: "Another holder leased this thing. Back off until the lease expires (leaseExpiresAt / retryAfter), then retry"
@@ -52561,7 +52584,7 @@ function emitPartialPageHint(ctx, count, _nextCursor, _limit) {
52561
52584
  }
52562
52585
 
52563
52586
  // ../../packages/warmhub-cli/src/domains/commit-output-contract-id.ts
52564
- var COMMIT_SUBMIT_OUTPUT_SCHEMA_ID = "wh.commit.submit.result/v0.4";
52587
+ var COMMIT_SUBMIT_OUTPUT_SCHEMA_ID = "wh.commit.submit.result/v0.5";
52565
52588
  function identifyCommitSubmitOutput(value) {
52566
52589
  if ("schema" in value) {
52567
52590
  if (value.schema === COMMIT_SUBMIT_OUTPUT_SCHEMA_ID) {
@@ -57622,7 +57645,7 @@ var createFlags3 = {
57622
57645
  };
57623
57646
 
57624
57647
  // ../../packages/warmhub-cli/src/domains/commit-stream-output-contract-id.ts
57625
- var COMMIT_SUBMIT_STREAM_ROW_SCHEMA_ID = "wh.commit.submit.stream.row/v0.3";
57648
+ var COMMIT_SUBMIT_STREAM_ROW_SCHEMA_ID = "wh.commit.submit.stream.row/v0.4";
57626
57649
  function identify(row) {
57627
57650
  if ("schema" in row) {
57628
57651
  throw new Error("Streaming submission row already defines a schema field");
@@ -70052,7 +70075,7 @@ function resolveLogLevel(flagLevel, env) {
70052
70075
  // package.json
70053
70076
  var package_default3 = {
70054
70077
  name: "@warmhub/cli",
70055
- version: "0.136.0",
70078
+ version: "0.137.0",
70056
70079
  private: false,
70057
70080
  type: "module",
70058
70081
  description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -70677,5 +70700,5 @@ process.exitCode = interceptedExitCode === undefined ? await runPreparedCli(laun
70677
70700
  version: package_default3.version
70678
70701
  }) : interceptedExitCode;
70679
70702
 
70680
- //# debugId=17E23D79103C8D1164756E2164756E21
70681
- //# warmhub-cli-build-info {"cliVersion":"0.136.0","sdkVersion":"0.134.0"}
70703
+ //# debugId=9B1B476B36DD254E64756E2164756E21
70704
+ //# warmhub-cli-build-info {"cliVersion":"0.137.0","sdkVersion":"0.135.0"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/cli",
3
- "version": "0.136.0",
3
+ "version": "0.137.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.",