@holon-run/uxc-daemon-client 0.15.2 → 0.15.4

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/dist/index.cjs CHANGED
@@ -164,29 +164,36 @@ var UxcDaemonClient = class {
164
164
  });
165
165
  }
166
166
  async request(method, params) {
167
- await this.ensureDaemon();
168
167
  try {
169
168
  return await this.requestOnce(method, params);
170
169
  } catch (error) {
171
170
  if (!this.autoStart || !isSocketError(error)) {
172
171
  throw error;
173
172
  }
174
- await this.ensureDaemon(true);
173
+ await this.ensureDaemon();
175
174
  return this.requestOnce(method, params);
176
175
  }
177
176
  }
178
- async ensureDaemon(force = false) {
177
+ async ensureDaemon() {
179
178
  if (!this.autoStart) {
180
179
  return;
181
180
  }
182
- if (!this.ensureDaemonPromise || force) {
183
- this.ensureDaemonPromise = execFileAsync(this.binaryPath, ["daemon", "start"], {
184
- env: this.env,
185
- timeout: this.requestTimeoutMs
186
- }).then(() => void 0);
181
+ if (!this.ensureDaemonPromise) {
182
+ const startPromise = this.startDaemonProcess().finally(() => {
183
+ if (this.ensureDaemonPromise === startPromise) {
184
+ this.ensureDaemonPromise = void 0;
185
+ }
186
+ });
187
+ this.ensureDaemonPromise = startPromise;
187
188
  }
188
189
  await this.ensureDaemonPromise;
189
190
  }
191
+ async startDaemonProcess() {
192
+ await execFileAsync(this.binaryPath, ["daemon", "start"], {
193
+ env: this.env,
194
+ timeout: this.requestTimeoutMs
195
+ }).then(() => void 0);
196
+ }
190
197
  async requestOnce(method, params) {
191
198
  const socket = import_node_net.default.createConnection(this.socketPath);
192
199
  const response = await new Promise((resolve, reject) => {
@@ -610,6 +617,7 @@ function normalizeOptions(options) {
610
617
  inject_env: [],
611
618
  no_cache: false,
612
619
  refresh_schema: false,
620
+ artifact_compaction: false,
613
621
  daemon_exclusive: [],
614
622
  ...options
615
623
  };
package/dist/index.d.cts CHANGED
@@ -4,6 +4,7 @@ interface RuntimeInvokeOptions {
4
4
  no_cache?: boolean;
5
5
  cache_ttl?: number;
6
6
  refresh_schema?: boolean;
7
+ artifact_compaction?: boolean;
7
8
  schema_url?: string;
8
9
  link_name?: string;
9
10
  link_skill?: string;
@@ -262,6 +263,7 @@ declare class UxcDaemonClient {
262
263
  streamTrim(streamId: string, beforeOffset: number): Promise<ManagedStreamTrimResponse>;
263
264
  request<T>(method: string, params?: unknown): Promise<T>;
264
265
  private ensureDaemon;
266
+ private startDaemonProcess;
265
267
  private requestOnce;
266
268
  }
267
269
  declare function generateTypeScriptClient(schema: CodegenHostSchemaV1, options?: GenerateTypeScriptClientOptions): string;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ interface RuntimeInvokeOptions {
4
4
  no_cache?: boolean;
5
5
  cache_ttl?: number;
6
6
  refresh_schema?: boolean;
7
+ artifact_compaction?: boolean;
7
8
  schema_url?: string;
8
9
  link_name?: string;
9
10
  link_skill?: string;
@@ -262,6 +263,7 @@ declare class UxcDaemonClient {
262
263
  streamTrim(streamId: string, beforeOffset: number): Promise<ManagedStreamTrimResponse>;
263
264
  request<T>(method: string, params?: unknown): Promise<T>;
264
265
  private ensureDaemon;
266
+ private startDaemonProcess;
265
267
  private requestOnce;
266
268
  }
267
269
  declare function generateTypeScriptClient(schema: CodegenHostSchemaV1, options?: GenerateTypeScriptClientOptions): string;
package/dist/index.js CHANGED
@@ -128,29 +128,36 @@ var UxcDaemonClient = class {
128
128
  });
129
129
  }
130
130
  async request(method, params) {
131
- await this.ensureDaemon();
132
131
  try {
133
132
  return await this.requestOnce(method, params);
134
133
  } catch (error) {
135
134
  if (!this.autoStart || !isSocketError(error)) {
136
135
  throw error;
137
136
  }
138
- await this.ensureDaemon(true);
137
+ await this.ensureDaemon();
139
138
  return this.requestOnce(method, params);
140
139
  }
141
140
  }
142
- async ensureDaemon(force = false) {
141
+ async ensureDaemon() {
143
142
  if (!this.autoStart) {
144
143
  return;
145
144
  }
146
- if (!this.ensureDaemonPromise || force) {
147
- this.ensureDaemonPromise = execFileAsync(this.binaryPath, ["daemon", "start"], {
148
- env: this.env,
149
- timeout: this.requestTimeoutMs
150
- }).then(() => void 0);
145
+ if (!this.ensureDaemonPromise) {
146
+ const startPromise = this.startDaemonProcess().finally(() => {
147
+ if (this.ensureDaemonPromise === startPromise) {
148
+ this.ensureDaemonPromise = void 0;
149
+ }
150
+ });
151
+ this.ensureDaemonPromise = startPromise;
151
152
  }
152
153
  await this.ensureDaemonPromise;
153
154
  }
155
+ async startDaemonProcess() {
156
+ await execFileAsync(this.binaryPath, ["daemon", "start"], {
157
+ env: this.env,
158
+ timeout: this.requestTimeoutMs
159
+ }).then(() => void 0);
160
+ }
154
161
  async requestOnce(method, params) {
155
162
  const socket = net.createConnection(this.socketPath);
156
163
  const response = await new Promise((resolve, reject) => {
@@ -574,6 +581,7 @@ function normalizeOptions(options) {
574
581
  inject_env: [],
575
582
  no_cache: false,
576
583
  refresh_schema: false,
584
+ artifact_compaction: false,
577
585
  daemon_exclusive: [],
578
586
  ...options
579
587
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holon-run/uxc-daemon-client",
3
- "version": "0.15.2",
3
+ "version": "0.15.4",
4
4
  "description": "Thin Node.js client for UXC daemon-backed operations",
5
5
  "license": "MIT",
6
6
  "repository": {