@astrale-os/cli 1.0.0-beta.44 → 1.0.0-beta.45

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.0-beta.45](https://github.com/astrale-os/cli/compare/cli/v1.0.0-beta.44...cli/v1.0.0-beta.45) (2026-08-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **cli:** generate protocol-safe operation ids ([#254](https://github.com/astrale-os/cli/issues/254)) ([f38d09f](https://github.com/astrale-os/cli/commit/f38d09f55fb1fa450a8fac66c1c7233a6c56c077))
9
+
3
10
  ## [1.0.0-beta.44](https://github.com/astrale-os/cli/compare/cli/v1.0.0-beta.43...cli/v1.0.0-beta.44) (2026-08-28)
4
11
 
5
12
 
package/dist/astrale.js CHANGED
@@ -2578,7 +2578,7 @@ var package_default;
2578
2578
  var init_package = __esm(() => {
2579
2579
  package_default = {
2580
2580
  name: "@astrale-os/cli",
2581
- version: "1.0.0-beta.44",
2581
+ version: "1.0.0-beta.45",
2582
2582
  description: "Astrale CLI — connect to existing Astrale kernels",
2583
2583
  keywords: [
2584
2584
  "astrale",
@@ -84614,6 +84614,22 @@ var init_query3 = __esm(() => {
84614
84614
  init_query();
84615
84615
  });
84616
84616
 
84617
+ // src/lib/idempotency.ts
84618
+ function idempotencyKey(...segments) {
84619
+ const value2 = segments.join(".");
84620
+ if (value2.length < 1 || value2.length > MAXIMUM_KEY_LENGTH || !URL_SAFE_KEY.test(value2)) {
84621
+ throw new TypeError("Idempotency key must contain 1-128 URL-safe ASCII characters.");
84622
+ }
84623
+ return value2;
84624
+ }
84625
+ function randomOperationId(...namespace) {
84626
+ return idempotencyKey(...namespace, globalThis.crypto.randomUUID());
84627
+ }
84628
+ var MAXIMUM_KEY_LENGTH = 128, URL_SAFE_KEY;
84629
+ var init_idempotency2 = __esm(() => {
84630
+ URL_SAFE_KEY = /^[A-Za-z0-9._~-]+$/u;
84631
+ });
84632
+
84617
84633
  // node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.15/node_modules/@astrale-os/kernel-dsl/dist/v1/builder/schema/diagnostic.js
84618
84634
  function diagnostic(code, pointer, message2, ref) {
84619
84635
  return Object.freeze({ code, pointer, message: message2, ...ref === undefined ? {} : { ref } });
@@ -98905,7 +98921,7 @@ async function connectAdminInstances(context, dependencies = {}) {
98905
98921
  maximum: MAXIMUM_INSTANCES,
98906
98922
  maximumPages: MAXIMUM_PAGES
98907
98923
  });
98908
- return nodes.map(instanceFromNode);
98924
+ return nodes.map(instanceFromNode).filter((instance) => instance.state !== "deleted");
98909
98925
  };
98910
98926
  const requireInstance = async (identifier) => {
98911
98927
  const found = findOwnedInstance(await list3(), identifier);
@@ -99023,13 +99039,14 @@ function record7(input, label) {
99023
99039
  return input;
99024
99040
  }
99025
99041
  function defaultOperationId(kind) {
99026
- return `cli.instance.${kind}:${globalThis.crypto.randomUUID()}`;
99042
+ return randomOperationId("cli", "instance", kind);
99027
99043
  }
99028
99044
  var PAGE_SIZE = 256, MAXIMUM_INSTANCES = 1e4, MAXIMUM_PAGES;
99029
99045
  var init_client4 = __esm(() => {
99030
99046
  init_class();
99031
99047
  init_path3();
99032
99048
  init_query3();
99049
+ init_idempotency2();
99033
99050
  init_contract();
99034
99051
  init_graph5();
99035
99052
  init_model6();
@@ -101373,11 +101390,11 @@ function remainingSessionTime(operation) {
101373
101390
  throw new SessionError("Session operation timed out.", { failure: "timeout" });
101374
101391
  return remaining;
101375
101392
  }
101376
- function sessionTransportOptions(operation, idempotencyKey) {
101393
+ function sessionTransportOptions(operation, idempotencyKey2) {
101377
101394
  return Object.freeze({
101378
101395
  signal: operation.signal,
101379
101396
  timeoutMs: remainingSessionTime(operation),
101380
- ...idempotencyKey === undefined ? {} : { idempotencyKey }
101397
+ ...idempotencyKey2 === undefined ? {} : { idempotencyKey: idempotencyKey2 }
101381
101398
  });
101382
101399
  }
101383
101400
  async function runSessionOperation(operation, task) {
@@ -102604,10 +102621,10 @@ function admitRequestOptions2(input = {}) {
102604
102621
  if (fields.some((field) => !["signal", "timeoutMs", "idempotencyKey"].includes(String(field)))) {
102605
102622
  throw new TypeError("Session request options contain unsupported fields.");
102606
102623
  }
102607
- const idempotencyKey = input.idempotencyKey === undefined ? undefined : acceptIdempotencyKey(input.idempotencyKey, "request.idempotencyKey");
102624
+ const idempotencyKey2 = input.idempotencyKey === undefined ? undefined : acceptIdempotencyKey(input.idempotencyKey, "request.idempotencyKey");
102608
102625
  return Object.freeze({
102609
102626
  ...control,
102610
- ...idempotencyKey === undefined ? {} : { idempotencyKey }
102627
+ ...idempotencyKey2 === undefined ? {} : { idempotencyKey: idempotencyKey2 }
102611
102628
  });
102612
102629
  }
102613
102630
  function admitEnvelopeTransport(input) {
@@ -113155,12 +113172,13 @@ function record13(input, label) {
113155
113172
  return input;
113156
113173
  }
113157
113174
  function defaultOperationId2(kind) {
113158
- return `cli.domain.${kind}:${globalThis.crypto.randomUUID()}`;
113175
+ return randomOperationId("cli", "domain", kind);
113159
113176
  }
113160
113177
  var PAGE_SIZE2 = 256, MAXIMUM_DOMAINS = 1e4, MAXIMUM_PAGES2;
113161
113178
  var init_client5 = __esm(() => {
113162
113179
  init_path3();
113163
113180
  init_query3();
113181
+ init_idempotency2();
113164
113182
  init_contract();
113165
113183
  init_graph5();
113166
113184
  init_model9();
@@ -114173,9 +114191,9 @@ async function prepareIdentityProvision(input) {
114173
114191
  builder.createNode({ as: binding6, class: input.classPath, props: input.properties });
114174
114192
  return;
114175
114193
  });
114176
- const idempotencyKey = `identity-register:${input.name}`;
114194
+ const registrationKey = idempotencyKey("identity-register", input.name);
114177
114195
  const unsigned = exports_provision.accept({
114178
- idempotencyKey,
114196
+ idempotencyKey: registrationKey,
114179
114197
  mutation,
114180
114198
  identities: [
114181
114199
  {
@@ -114193,7 +114211,7 @@ async function prepareIdentityProvision(input) {
114193
114211
  binding: binding6,
114194
114212
  authentication: Object.freeze({ iss: issuer, sub: "self" }),
114195
114213
  request: exports_provision.accept({
114196
- idempotencyKey,
114214
+ idempotencyKey: registrationKey,
114197
114215
  mutation,
114198
114216
  identities: [
114199
114217
  {
@@ -114220,6 +114238,7 @@ var init_register = __esm(() => {
114220
114238
  init_graph6();
114221
114239
  init_identity7();
114222
114240
  init_keys();
114241
+ init_idempotency2();
114223
114242
  init_log();
114224
114243
  init_output();
114225
114244
  register_default = {
@@ -0,0 +1,4 @@
1
+ /** Build one protocol-compatible key for an operation that may cross nested Kernel calls. */
2
+ export declare function idempotencyKey(...segments: readonly string[]): string;
3
+ /** Generate a fresh operation id while retaining a short diagnostic namespace. */
4
+ export declare function randomOperationId(...namespace: readonly string[]): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/cli",
3
- "version": "1.0.0-beta.44",
3
+ "version": "1.0.0-beta.45",
4
4
  "description": "Astrale CLI — connect to existing Astrale kernels",
5
5
  "keywords": [
6
6
  "astrale",