@skaile/workspaces 0.43.0 → 0.43.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 (51) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/asset-manager/index.js +1 -1
  3. package/dist/{chunk-XMKBIVG3.js → chunk-N4FSBCLV.js} +4 -4
  4. package/dist/{chunk-XMKBIVG3.js.map → chunk-N4FSBCLV.js.map} +1 -1
  5. package/dist/{chunk-JZQFZ55W.js → chunk-R4YUZRGF.js} +2 -2
  6. package/dist/{chunk-JZQFZ55W.js.map → chunk-R4YUZRGF.js.map} +1 -1
  7. package/dist/{chunk-F5Q2RMH4.js → chunk-U2XHHLE3.js} +174 -132
  8. package/dist/chunk-U2XHHLE3.js.map +1 -0
  9. package/dist/{chunk-R2SKIYU2.js → chunk-WKZ5R4NP.js} +2 -2
  10. package/dist/{chunk-R2SKIYU2.js.map → chunk-WKZ5R4NP.js.map} +1 -1
  11. package/dist/{chunk-4UTJNFUS.js → chunk-WRDHUTOK.js} +3 -3
  12. package/dist/{chunk-4UTJNFUS.js.map → chunk-WRDHUTOK.js.map} +1 -1
  13. package/dist/cli/index.js +5 -5
  14. package/dist/connectors/index.js +1 -1
  15. package/dist/connectors/src/connector-manager.d.ts +21 -4
  16. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  17. package/dist/connectors/src/fleet-health-gate.d.ts +2 -0
  18. package/dist/connectors/src/fleet-health-gate.d.ts.map +1 -1
  19. package/dist/connectors/src/fleet-utils.d.ts +10 -0
  20. package/dist/connectors/src/fleet-utils.d.ts.map +1 -1
  21. package/dist/connectors/src/mount-placeholder.d.ts +11 -0
  22. package/dist/connectors/src/mount-placeholder.d.ts.map +1 -1
  23. package/dist/factory-assets/connectors/deploy.js +1 -1
  24. package/dist/factory-assets/connectors/devserver.js +1 -1
  25. package/dist/factory-assets/connectors/flow/adapter.js +1 -1
  26. package/dist/factory-assets/connectors/flow/run-flow.js +2 -2
  27. package/dist/factory-assets/connectors/flow.js +1 -1
  28. package/dist/factory-assets/connectors/git.js +1 -1
  29. package/dist/factory-assets/connectors/gmail.js +1 -1
  30. package/dist/factory-assets/connectors/googledrive.js +1 -1
  31. package/dist/factory-assets/connectors/local.js +1 -1
  32. package/dist/factory-assets/connectors/mattermost.js +1 -1
  33. package/dist/factory-assets/connectors/memory.js +1 -1
  34. package/dist/factory-assets/connectors/minio.js +1 -1
  35. package/dist/factory-assets/connectors/postgres.js +1 -1
  36. package/dist/factory-assets/connectors/s3.js +1 -1
  37. package/dist/factory-assets/connectors/sharepoint.js +1 -1
  38. package/dist/factory-assets/connectors/sqlite.js +1 -1
  39. package/dist/factory-assets/connectors/static-server.js +1 -1
  40. package/dist/factory-assets/connectors/tunnel.js +1 -1
  41. package/dist/factory-assets/connectors/webdav.js +1 -1
  42. package/dist/factory-assets/connectors/xstate-store.js +1 -1
  43. package/dist/factory-assets/connectors/xstate.js +1 -1
  44. package/dist/runner/index.js +3 -3
  45. package/dist/sdk/asset-manager.js +1 -1
  46. package/dist/sdk/index.js +3 -3
  47. package/dist/sdk/runner.js +3 -3
  48. package/dist/tui/index.js +3 -3
  49. package/dist/workspace-plugin/index.js +1 -1
  50. package/package.json +1 -1
  51. package/dist/chunk-F5Q2RMH4.js.map +0 -1
@@ -8,13 +8,13 @@ import { computeStimulus } from './chunk-IFGTRL2I.js';
8
8
  import { portableSpawn } from './chunk-KYQNWFJV.js';
9
9
  import { createLogger } from './chunk-JB35MVBN.js';
10
10
  import { existsSync, mkdirSync, renameSync, writeFileSync, readFileSync, cpSync, statSync, createReadStream, readdirSync, openSync, writeSync, closeSync, chmodSync } from 'fs';
11
- import path, { join, dirname, resolve, sep } from 'path';
11
+ import path2, { join, dirname, resolve, sep } from 'path';
12
12
  import * as zNS from 'zod';
13
13
  import { execFile, execSync, spawn } from 'child_process';
14
14
  import { createServer } from 'http';
15
15
  import mime from 'mime';
16
16
  import { promisify } from 'util';
17
- import { stat, readdir, writeFile, chmod, rm, mkdir } from 'fs/promises';
17
+ import { stat, readdir, writeFile, chmod, rm, mkdir, readFile } from 'fs/promises';
18
18
  import { createRequire } from 'module';
19
19
  import { pathToFileURL } from 'url';
20
20
 
@@ -2260,8 +2260,8 @@ var MattermostConnector = class extends AbstractConnector {
2260
2260
  constructor() {
2261
2261
  super();
2262
2262
  this.tools = {
2263
- read: (handle, path2) => this._read(handle, path2),
2264
- write: (handle, path2, content) => this._write(handle, path2, content),
2263
+ read: (handle, path3) => this._read(handle, path3),
2264
+ write: (handle, path3, content) => this._write(handle, path3, content),
2265
2265
  describeOperations: (handle) => this._describeOperations(handle),
2266
2266
  executeOp: (handle, operation, args) => this._executeOp(handle, operation, args),
2267
2267
  describeSkill: (handle, declaration) => this._describeSkill(handle, declaration)
@@ -2333,23 +2333,23 @@ var MattermostConnector = class extends AbstractConnector {
2333
2333
  handle.status = "disconnected";
2334
2334
  }
2335
2335
  // ── Tool face methods (private, wired in constructor) ─────────────────────
2336
- async _read(handle, path2) {
2336
+ async _read(handle, path3) {
2337
2337
  const state = handle.state;
2338
2338
  try {
2339
- const post = await this._apiGet(state.url, state.token, `/api/v4/posts/${path2}`);
2339
+ const post = await this._apiGet(state.url, state.token, `/api/v4/posts/${path3}`);
2340
2340
  this._assertChannelAccess(String(post.channel_id ?? ""), state.channelFilter);
2341
2341
  return { data: JSON.stringify(post, null, 2), contentType: "application/json" };
2342
2342
  } catch {
2343
2343
  return null;
2344
2344
  }
2345
2345
  }
2346
- async _write(handle, path2, content) {
2346
+ async _write(handle, path3, content) {
2347
2347
  if (handle.access === "read-only")
2348
2348
  throw new Error("MattermostConnector: write denied \u2014 read-only");
2349
2349
  const state = handle.state;
2350
2350
  const message = typeof content === "string" ? content : String(content.data ?? "");
2351
- await this._apiPut(state.url, state.token, `/api/v4/posts/${path2}`, { id: path2, message });
2352
- this.emitChange?.({ path: path2, action: "edit", source: "operation" });
2351
+ await this._apiPut(state.url, state.token, `/api/v4/posts/${path3}`, { id: path3, message });
2352
+ this.emitChange?.({ path: path3, action: "edit", source: "operation" });
2353
2353
  }
2354
2354
  _describeSkill(handle, declaration) {
2355
2355
  const state = handle.state;
@@ -2607,31 +2607,31 @@ var MattermostConnector = class extends AbstractConnector {
2607
2607
  return typeof id === "string" && filter.has(id);
2608
2608
  });
2609
2609
  }
2610
- async _apiGet(baseUrl, token, path2) {
2611
- const res = await fetch(baseUrl + path2, { headers: { Authorization: `Bearer ${token}` } });
2610
+ async _apiGet(baseUrl, token, path3) {
2611
+ const res = await fetch(baseUrl + path3, { headers: { Authorization: `Bearer ${token}` } });
2612
2612
  if (!res.ok) {
2613
2613
  const body = await res.text();
2614
- this.log.warn("REST error", { method: "GET", endpoint: path2, status: res.status });
2615
- throw new Error(`Mattermost GET ${path2}: ${res.status} ${body}`);
2614
+ this.log.warn("REST error", { method: "GET", endpoint: path3, status: res.status });
2615
+ throw new Error(`Mattermost GET ${path3}: ${res.status} ${body}`);
2616
2616
  }
2617
2617
  return res.json();
2618
2618
  }
2619
- async _apiPost(baseUrl, token, path2, body) {
2620
- const res = await fetch(baseUrl + path2, {
2619
+ async _apiPost(baseUrl, token, path3, body) {
2620
+ const res = await fetch(baseUrl + path3, {
2621
2621
  method: "POST",
2622
2622
  headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
2623
2623
  body: JSON.stringify(body)
2624
2624
  });
2625
- if (!res.ok) throw new Error(`Mattermost POST ${path2}: ${res.status} ${await res.text()}`);
2625
+ if (!res.ok) throw new Error(`Mattermost POST ${path3}: ${res.status} ${await res.text()}`);
2626
2626
  return res.json();
2627
2627
  }
2628
- async _apiPut(baseUrl, token, path2, body) {
2629
- const res = await fetch(baseUrl + path2, {
2628
+ async _apiPut(baseUrl, token, path3, body) {
2629
+ const res = await fetch(baseUrl + path3, {
2630
2630
  method: "PUT",
2631
2631
  headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
2632
2632
  body: JSON.stringify(body)
2633
2633
  });
2634
- if (!res.ok) throw new Error(`Mattermost PUT ${path2}: ${res.status} ${await res.text()}`);
2634
+ if (!res.ok) throw new Error(`Mattermost PUT ${path3}: ${res.status} ${await res.text()}`);
2635
2635
  return res.json();
2636
2636
  }
2637
2637
  };
@@ -2646,10 +2646,10 @@ var MemoryConnector = class extends AbstractConnector {
2646
2646
  constructor() {
2647
2647
  super();
2648
2648
  this.tools = {
2649
- read: (handle, path2) => this._read(handle, path2),
2650
- write: (handle, path2, content) => this._write(handle, path2, content),
2651
- delete: (handle, path2) => this._delete(handle, path2),
2652
- list: (handle, path2, options) => this._list(handle, path2, options),
2649
+ read: (handle, path3) => this._read(handle, path3),
2650
+ write: (handle, path3, content) => this._write(handle, path3, content),
2651
+ delete: (handle, path3) => this._delete(handle, path3),
2652
+ list: (handle, path3, options) => this._list(handle, path3, options),
2653
2653
  search: (handle, query, options) => this._search(handle, query, options),
2654
2654
  describeOperations: (handle) => this._describeOperations(handle),
2655
2655
  executeOp: (handle, operation, args) => this._executeOp(handle, operation, args)
@@ -2668,26 +2668,26 @@ var MemoryConnector = class extends AbstractConnector {
2668
2668
  store(handle) {
2669
2669
  return handle.state.store;
2670
2670
  }
2671
- async _read(handle, path2) {
2672
- const value = this.store(handle).get(path2);
2671
+ async _read(handle, path3) {
2672
+ const value = this.store(handle).get(path3);
2673
2673
  if (value === void 0) return null;
2674
2674
  return { data: value, contentType: "application/json" };
2675
2675
  }
2676
- async _write(handle, path2, content) {
2677
- const isNew = !this.store(handle).has(path2);
2676
+ async _write(handle, path3, content) {
2677
+ const isNew = !this.store(handle).has(path3);
2678
2678
  this.store(handle).set(
2679
- path2,
2679
+ path3,
2680
2680
  typeof content.data === "string" ? content.data : content.data.toString("utf-8")
2681
2681
  );
2682
- this.emitChange?.({ path: path2, action: isNew ? "create" : "edit", source: "operation" });
2682
+ this.emitChange?.({ path: path3, action: isNew ? "create" : "edit", source: "operation" });
2683
2683
  }
2684
- async _delete(handle, path2) {
2685
- const deleted = this.store(handle).delete(path2);
2686
- if (deleted) this.emitChange?.({ path: path2, action: "delete", source: "operation" });
2684
+ async _delete(handle, path3) {
2685
+ const deleted = this.store(handle).delete(path3);
2686
+ if (deleted) this.emitChange?.({ path: path3, action: "delete", source: "operation" });
2687
2687
  return deleted;
2688
2688
  }
2689
- async _list(handle, path2, options) {
2690
- const prefix = path2 ?? "";
2689
+ async _list(handle, path3, options) {
2690
+ const prefix = path3 ?? "";
2691
2691
  const entries = [];
2692
2692
  for (const key of this.store(handle).keys()) {
2693
2693
  if (prefix && !key.startsWith(prefix)) continue;
@@ -2800,8 +2800,8 @@ var MinIOConnector = class extends AbstractConnector {
2800
2800
  constructor() {
2801
2801
  super();
2802
2802
  this.tools = {
2803
- list: (handle, path2) => this._list(handle, path2),
2804
- read: (handle, path2) => this._read(handle, path2),
2803
+ list: (handle, path3) => this._list(handle, path3),
2804
+ read: (handle, path3) => this._read(handle, path3),
2805
2805
  describeOperations: (handle) => this._describeOperations(handle),
2806
2806
  executeOp: (handle, operation, args) => this._executeOp(handle, operation, args),
2807
2807
  describeSkill: (handle, declaration) => this._describeSkill(handle, declaration)
@@ -2979,10 +2979,10 @@ var MinIOConnector = class extends AbstractConnector {
2979
2979
  }
2980
2980
  return ops;
2981
2981
  }
2982
- async _list(handle, path2, recursive = false) {
2982
+ async _list(handle, path3, recursive = false) {
2983
2983
  const { client, bucket } = handle.state;
2984
2984
  const entries = [];
2985
- const stream = client.listObjects(bucket, path2 ?? "", recursive);
2985
+ const stream = client.listObjects(bucket, path3 ?? "", recursive);
2986
2986
  return new Promise((resolve5, reject) => {
2987
2987
  stream.on("data", (obj) => {
2988
2988
  entries.push({
@@ -2997,10 +2997,10 @@ var MinIOConnector = class extends AbstractConnector {
2997
2997
  stream.on("error", reject);
2998
2998
  });
2999
2999
  }
3000
- async _read(handle, path2) {
3000
+ async _read(handle, path3) {
3001
3001
  const { client, bucket } = handle.state;
3002
3002
  const chunks = [];
3003
- const stream = await client.getObject(bucket, path2);
3003
+ const stream = await client.getObject(bucket, path3);
3004
3004
  return new Promise((resolve5, reject) => {
3005
3005
  stream.on("data", (chunk) => chunks.push(chunk));
3006
3006
  stream.on("end", () => resolve5({ data: Buffer.concat(chunks).toString() }));
@@ -3058,8 +3058,8 @@ var PostgresConnector = class extends AbstractConnector {
3058
3058
  constructor() {
3059
3059
  super();
3060
3060
  this.tools = {
3061
- read: (handle, path2) => this._read(handle, path2),
3062
- list: (handle, path2, options) => this._list(handle, path2, options),
3061
+ read: (handle, path3) => this._read(handle, path3),
3062
+ list: (handle, path3, options) => this._list(handle, path3, options),
3063
3063
  search: (handle, query, options) => this._search(handle, query, options),
3064
3064
  describeOperations: (handle) => this._describeOperations(handle),
3065
3065
  executeOp: (handle, operation, args) => this._executeOp(handle, operation, args),
@@ -3147,8 +3147,8 @@ var PostgresConnector = class extends AbstractConnector {
3147
3147
  return handle.state.pool;
3148
3148
  }
3149
3149
  // Base ops map to table/row access via path convention: <table>/<pk>
3150
- async _read(handle, path2) {
3151
- const parts = path2.split("/");
3150
+ async _read(handle, path3) {
3151
+ const parts = path3.split("/");
3152
3152
  if (parts.length === 1) {
3153
3153
  const table2 = parts[0];
3154
3154
  const result2 = await this.pool(handle).query(
@@ -3167,8 +3167,8 @@ var PostgresConnector = class extends AbstractConnector {
3167
3167
  if (result.rows.length === 0) return null;
3168
3168
  return { data: JSON.stringify(result.rows[0], null, 2), contentType: "application/json" };
3169
3169
  }
3170
- async _list(handle, path2, options) {
3171
- if (!path2) {
3170
+ async _list(handle, path3, options) {
3171
+ if (!path3) {
3172
3172
  const result2 = await this.pool(handle).query(
3173
3173
  `SELECT table_name FROM information_schema.tables
3174
3174
  WHERE table_schema = 'public' ORDER BY table_name`
@@ -3180,12 +3180,12 @@ var PostgresConnector = class extends AbstractConnector {
3180
3180
  }));
3181
3181
  }
3182
3182
  const limit = options?.limit ?? 100;
3183
- const result = await this.pool(handle).query(`SELECT * FROM "${quoteIdent(path2)}" LIMIT $1`, [
3183
+ const result = await this.pool(handle).query(`SELECT * FROM "${quoteIdent(path3)}" LIMIT $1`, [
3184
3184
  limit
3185
3185
  ]);
3186
3186
  return result.rows.map((row, i) => ({
3187
3187
  name: String(row.id ?? i),
3188
- path: `${path2}/${row.id ?? i}`,
3188
+ path: `${path3}/${row.id ?? i}`,
3189
3189
  type: "row"
3190
3190
  }));
3191
3191
  }
@@ -3685,8 +3685,8 @@ var SQLiteConnector = class extends AbstractConnector {
3685
3685
  constructor() {
3686
3686
  super();
3687
3687
  this.tools = {
3688
- read: (handle, path2) => this._read(handle, path2),
3689
- list: (handle, path2, options) => this._list(handle, path2, options),
3688
+ read: (handle, path3) => this._read(handle, path3),
3689
+ list: (handle, path3, options) => this._list(handle, path3, options),
3690
3690
  search: (handle, query, options) => this._search(handle, query, options),
3691
3691
  describeOperations: (handle) => this._describeOperations(handle),
3692
3692
  executeOp: (handle, operation, args) => this._executeOp(handle, operation, args)
@@ -3770,8 +3770,8 @@ var SQLiteConnector = class extends AbstractConnector {
3770
3770
  const changes = db.getRowsModified();
3771
3771
  return changes;
3772
3772
  }
3773
- async _read(handle, path2) {
3774
- const parts = path2.split("/");
3773
+ async _read(handle, path3) {
3774
+ const parts = path3.split("/");
3775
3775
  if (parts.length === 1) {
3776
3776
  const table2 = parts[0];
3777
3777
  const info = this.queryRows(this.db(handle), `PRAGMA table_info("${quoteIdent2(table2)}")`);
@@ -3787,8 +3787,8 @@ var SQLiteConnector = class extends AbstractConnector {
3787
3787
  if (rows.length === 0) return null;
3788
3788
  return { data: JSON.stringify(rows[0], null, 2), contentType: "application/json" };
3789
3789
  }
3790
- async _list(handle, path2, options) {
3791
- if (!path2) {
3790
+ async _list(handle, path3, options) {
3791
+ if (!path3) {
3792
3792
  const tables = this.queryRows(
3793
3793
  this.db(handle),
3794
3794
  "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' ORDER BY name"
@@ -3802,12 +3802,12 @@ var SQLiteConnector = class extends AbstractConnector {
3802
3802
  const limit = options?.limit ?? 100;
3803
3803
  const rows = this.queryRows(
3804
3804
  this.db(handle),
3805
- `SELECT rowid, * FROM "${quoteIdent2(path2)}" LIMIT ?`,
3805
+ `SELECT rowid, * FROM "${quoteIdent2(path3)}" LIMIT ?`,
3806
3806
  [limit]
3807
3807
  );
3808
3808
  return rows.map((row) => ({
3809
3809
  name: String(row.rowid ?? row.id ?? "?"),
3810
- path: `${path2}/${row.rowid ?? row.id ?? "?"}`,
3810
+ path: `${path3}/${row.rowid ?? row.id ?? "?"}`,
3811
3811
  type: "row"
3812
3812
  }));
3813
3813
  }
@@ -4633,8 +4633,8 @@ var XStateConnector = class extends AbstractConnector {
4633
4633
  constructor() {
4634
4634
  super();
4635
4635
  this.tools = {
4636
- read: (handle, path2) => this._read(handle, path2),
4637
- list: (handle, path2, options) => this._list(handle, path2, options),
4636
+ read: (handle, path3) => this._read(handle, path3),
4637
+ list: (handle, path3, options) => this._list(handle, path3, options),
4638
4638
  search: (handle, query) => this._search(handle, query),
4639
4639
  describeOperations: (handle) => this._describeOperations(handle),
4640
4640
  executeOp: (handle, operation, args) => this._executeOp(handle, operation, args)
@@ -4736,15 +4736,15 @@ var XStateConnector = class extends AbstractConnector {
4736
4736
  this.s(handle).onChange = cb;
4737
4737
  }
4738
4738
  // ── Tool face methods (private, wired in constructor) ─────────────────────
4739
- async _read(handle, path2) {
4739
+ async _read(handle, path3) {
4740
4740
  const snapshot = this.s(handle).actor.getSnapshot();
4741
- if (path2 === "" || path2 === "state") {
4741
+ if (path3 === "" || path3 === "state") {
4742
4742
  return { data: JSON.stringify(snapshot.value), contentType: "application/json" };
4743
4743
  }
4744
- if (path2 === "context") {
4744
+ if (path3 === "context") {
4745
4745
  return { data: JSON.stringify(snapshot.context, null, 2), contentType: "application/json" };
4746
4746
  }
4747
- const value = snapshot.context?.[path2];
4747
+ const value = snapshot.context?.[path3];
4748
4748
  if (value === void 0) return null;
4749
4749
  return { data: JSON.stringify(value), contentType: "application/json" };
4750
4750
  }
@@ -4938,10 +4938,10 @@ var XStateStoreConnector = class extends AbstractConnector {
4938
4938
  constructor() {
4939
4939
  super();
4940
4940
  this.tools = {
4941
- read: (handle, path2) => this._read(handle, path2),
4942
- write: (handle, path2, content) => this._write(handle, path2, content),
4943
- delete: (handle, path2) => this._delete(handle, path2),
4944
- list: (handle, path2, options) => this._list(handle, path2, options),
4941
+ read: (handle, path3) => this._read(handle, path3),
4942
+ write: (handle, path3, content) => this._write(handle, path3, content),
4943
+ delete: (handle, path3) => this._delete(handle, path3),
4944
+ list: (handle, path3, options) => this._list(handle, path3, options),
4945
4945
  search: (handle, query, options) => this._search(handle, query, options),
4946
4946
  describeOperations: (handle) => this._describeOperations(handle),
4947
4947
  executeOp: (handle, operation, args) => this._executeOp(handle, operation, args)
@@ -4995,17 +4995,17 @@ var XStateStoreConnector = class extends AbstractConnector {
4995
4995
  handle.state.onChange = cb;
4996
4996
  }
4997
4997
  // ── Tool face methods (private, wired in constructor) ─────────────────────
4998
- async _read(handle, path2) {
4998
+ async _read(handle, path3) {
4999
4999
  const ctx = this.context(handle);
5000
- if (path2 === "*") {
5000
+ if (path3 === "*") {
5001
5001
  if (Object.keys(ctx).length === 0) return null;
5002
5002
  return { data: JSON.stringify(ctx, null, 2), contentType: "application/json" };
5003
5003
  }
5004
- const value = ctx[path2];
5004
+ const value = ctx[path3];
5005
5005
  if (value === void 0) return null;
5006
5006
  return { data: JSON.stringify(value), contentType: "application/json" };
5007
5007
  }
5008
- async _write(handle, path2, content) {
5008
+ async _write(handle, path3, content) {
5009
5009
  const data = typeof content.data === "string" ? content.data : content.data.toString("utf-8");
5010
5010
  let value;
5011
5011
  try {
@@ -5013,14 +5013,14 @@ var XStateStoreConnector = class extends AbstractConnector {
5013
5013
  } catch {
5014
5014
  value = data;
5015
5015
  }
5016
- this.storeState(handle).store.send({ type: "set", key: path2, value });
5017
- this._recordHistory(handle, "set", { key: path2, value });
5016
+ this.storeState(handle).store.send({ type: "set", key: path3, value });
5017
+ this._recordHistory(handle, "set", { key: path3, value });
5018
5018
  }
5019
- async _delete(handle, path2) {
5019
+ async _delete(handle, path3) {
5020
5020
  const ctx = this.context(handle);
5021
- if (!(path2 in ctx)) return false;
5022
- this.storeState(handle).store.send({ type: "delete", key: path2 });
5023
- this._recordHistory(handle, "delete", { key: path2 });
5021
+ if (!(path3 in ctx)) return false;
5022
+ this.storeState(handle).store.send({ type: "delete", key: path3 });
5023
+ this._recordHistory(handle, "delete", { key: path3 });
5024
5024
  return true;
5025
5025
  }
5026
5026
  async _list(handle, _path, options) {
@@ -5370,6 +5370,10 @@ var FleetHealthGate = class {
5370
5370
  get currentSurface() {
5371
5371
  return this.surface;
5372
5372
  }
5373
+ /** The mount target this gate guards (recovery-probe lookup). */
5374
+ get mountTarget() {
5375
+ return this.target;
5376
+ }
5373
5377
  /**
5374
5378
  * Feed one health verdict. Applies hysteresis, then drives the barrier toward
5375
5379
  * the target surface on a change. Resolves once the (possibly no-op)
@@ -5486,6 +5490,24 @@ async function probeFleetHealth(dir) {
5486
5490
  return "error";
5487
5491
  }
5488
5492
  }
5493
+ async function probeFleetMountTablePresent(dir) {
5494
+ try {
5495
+ const text = await readFile("/proc/self/mounts", "utf8");
5496
+ const resolved = path2.resolve(dir);
5497
+ for (const raw of text.split("\n")) {
5498
+ if (raw.length === 0) continue;
5499
+ const fields = raw.split(/\s+/);
5500
+ const mp = fields[1];
5501
+ const fstype = fields[2];
5502
+ if (!mp || !fstype) continue;
5503
+ if (mp.replace(/\\040/g, " ") !== resolved) continue;
5504
+ if (fstype !== "tmpfs") return true;
5505
+ }
5506
+ return false;
5507
+ } catch {
5508
+ return false;
5509
+ }
5510
+ }
5489
5511
  var NOT_READY_SENTINEL = ".skaile-workspace-not-ready";
5490
5512
  var TARGET_ALREADY_PRESENT_CODES = /* @__PURE__ */ new Set(["EEXIST", "ENOTCONN", "EBUSY", "ENOTDIR"]);
5491
5513
  function errnoCode(err) {
@@ -5543,7 +5565,7 @@ var RoMountPlaceholderBarrier = class {
5543
5565
  target
5544
5566
  ]);
5545
5567
  tmpfsMounted = true;
5546
- await writeFile(path.join(target, NOT_READY_SENTINEL), SENTINEL_BODY);
5568
+ await writeFile(path2.join(target, NOT_READY_SENTINEL), SENTINEL_BODY);
5547
5569
  await this.run("mount", ["-o", "remount,ro", target]);
5548
5570
  this.modes.set(target, "mount");
5549
5571
  log?.info("deferred mount barrier established (read-only tmpfs)", { target });
@@ -5594,7 +5616,7 @@ var RoMountPlaceholderBarrier = class {
5594
5616
  if (mode === "chmod" || mode === "unprotected") {
5595
5617
  if (mode === "chmod") await chmod(target, 493).catch(() => {
5596
5618
  });
5597
- await rm(path.join(target, NOT_READY_SENTINEL), { force: true }).catch(() => {
5619
+ await rm(path2.join(target, NOT_READY_SENTINEL), { force: true }).catch(() => {
5598
5620
  });
5599
5621
  log?.debug("deferred mount live; degraded barrier lifted", { target, mode });
5600
5622
  }
@@ -5640,6 +5662,9 @@ var RoMountPlaceholderBarrier = class {
5640
5662
  );
5641
5663
  }
5642
5664
  }
5665
+ isOpaque(target) {
5666
+ return this.modes.get(target) === "mount";
5667
+ }
5643
5668
  async remove(target, log) {
5644
5669
  const mode = this.modes.get(target);
5645
5670
  if (!mode) return;
@@ -5671,7 +5696,7 @@ var RoMountPlaceholderBarrier = class {
5671
5696
  }
5672
5697
  if (mode === "chmod") await chmod(target, 493).catch(() => {
5673
5698
  });
5674
- await rm(path.join(target, NOT_READY_SENTINEL), { force: true }).catch(() => {
5699
+ await rm(path2.join(target, NOT_READY_SENTINEL), { force: true }).catch(() => {
5675
5700
  });
5676
5701
  log?.debug(
5677
5702
  mode === "chmod" ? "deferred mount barrier removed (chmod restored)" : "deferred mount barrier removed (was never enforced \u2014 target stayed writable)",
@@ -5679,7 +5704,7 @@ var RoMountPlaceholderBarrier = class {
5679
5704
  );
5680
5705
  }
5681
5706
  async chmodFallback(target, cause, log) {
5682
- await writeFile(path.join(target, NOT_READY_SENTINEL), SENTINEL_BODY).catch(() => {
5707
+ await writeFile(path2.join(target, NOT_READY_SENTINEL), SENTINEL_BODY).catch(() => {
5683
5708
  });
5684
5709
  const chmodOk = await chmod(target, 365).then(
5685
5710
  () => true,
@@ -5816,6 +5841,7 @@ var ConnectorManager = class {
5816
5841
  this.preMintedSecrets = opts.preMintedSecrets;
5817
5842
  this.placeholderBarrier = opts.placeholderBarrier ?? defaultMountPlaceholderBarrier;
5818
5843
  this.fleetHealthPollMs = opts.fleetHealthPollMs ?? parseFleetHealthPollMs();
5844
+ this.fleetMountRecoveryProbe = opts.fleetMountRecoveryProbe ?? probeFleetMountTablePresent;
5819
5845
  const secrets = opts.secrets;
5820
5846
  if (secrets && typeof secrets === "object" && "prepareRef" in secrets) {
5821
5847
  this.chain = secrets;
@@ -5850,6 +5876,8 @@ var ConnectorManager = class {
5850
5876
  fleetHealthTimer;
5851
5877
  /** Local fleet-health poll interval (ms). 0 disables the local probe. */
5852
5878
  fleetHealthPollMs;
5879
+ /** Host-mount recovery detector under an opaque placeholder (injectable for tests). */
5880
+ fleetMountRecoveryProbe;
5853
5881
  // ── Private helpers ──────────────────────────────────────────────────────────
5854
5882
  /**
5855
5883
  * Wrap the user-supplied `TokenMediator` so `reason: 'initial'` calls for an
@@ -5972,8 +6000,8 @@ var ConnectorManager = class {
5972
6000
  }
5973
6001
  /** Release every mount target owned by `id` (on disconnect). */
5974
6002
  releaseMountTarget(id) {
5975
- for (const [path2, owner] of [...this.mountTargets]) {
5976
- if (owner === id) this.mountTargets.delete(path2);
6003
+ for (const [path3, owner] of [...this.mountTargets]) {
6004
+ if (owner === id) this.mountTargets.delete(path3);
5977
6005
  }
5978
6006
  }
5979
6007
  /**
@@ -6241,10 +6269,11 @@ var ConnectorManager = class {
6241
6269
  }
6242
6270
  /**
6243
6271
  * Start the periodic local fleet-health probe if it is not already running and
6244
- * the poll interval is enabled. Each tick `stat`+`readdir`s every fleet target
6245
- * and feeds the verdict to its gate (hysteresis lives in the gate). The probe
6246
- * only catches directly-detectable failures (EIO / dead bind); silent
6247
- * degradation is covered by the platform signal via `reportFleetHealth`.
6272
+ * the poll interval is enabled. Each tick probes every fleet target and feeds
6273
+ * the verdict to its gate (hysteresis lives in the gate). The probe catches both
6274
+ * directly-detectable failures (EIO / dead bind) AND host-mount recovery while a
6275
+ * placeholder is up; silent degradation is covered by the platform signal via
6276
+ * `reportFleetHealth`.
6248
6277
  */
6249
6278
  ensureFleetHealthPoll() {
6250
6279
  if (this.fleetHealthTimer || this.fleetHealthPollMs <= 0 || this.disposed) return;
@@ -6260,13 +6289,26 @@ var ConnectorManager = class {
6260
6289
  );
6261
6290
  await Promise.all(
6262
6291
  gates.map(async (e) => {
6263
- if (e.fleetHealthGate.isGated) return;
6264
- const verdict = await probeFleetHealth(e.fleetHealthTarget);
6292
+ const verdict = e.fleetHealthGate.isGated ? await this.probeGatedRecovery(e.fleetHealthGate) : await probeFleetHealth(e.fleetHealthTarget);
6265
6293
  await e.fleetHealthGate.observe(verdict).catch(() => {
6266
6294
  });
6267
6295
  })
6268
6296
  );
6269
6297
  }
6298
+ /**
6299
+ * Detect host-mount RECOVERY for an already-gated target so the placeholder lifts
6300
+ * edge-triggered (no restart). Over an opaque mask a stat/readdir reads the 0555
6301
+ * mask and falsely reads healthy, so recovery is detected via the mount table;
6302
+ * non-opaque surfaces hold their current surface until the platform signal lifts.
6303
+ * Rationale: `_devlog/notes/2026-06-17-fleet-gate-edge-triggered-recovery.md`.
6304
+ */
6305
+ async probeGatedRecovery(gate) {
6306
+ const target = gate.mountTarget;
6307
+ if (!(this.placeholderBarrier.isOpaque?.(target) ?? false)) {
6308
+ return gate.currentSurface === "ro" ? "degraded" : "error";
6309
+ }
6310
+ return await this.fleetMountRecoveryProbe(target) ? "healthy" : "error";
6311
+ }
6270
6312
  /**
6271
6313
  * Feed an externally-derived fleet-health verdict for a connector into its gate.
6272
6314
  *
@@ -6651,7 +6693,7 @@ var ConnectorManager = class {
6651
6693
  }
6652
6694
  return entry.connector.tools;
6653
6695
  }
6654
- async read(id, path2) {
6696
+ async read(id, path3) {
6655
6697
  const entry = this.get(id);
6656
6698
  const tools = this.requireToolFace(id, entry);
6657
6699
  if (!tools.read) {
@@ -6664,10 +6706,10 @@ var ConnectorManager = class {
6664
6706
  "skaile.connector.driver": entry.connector.name,
6665
6707
  "skaile.connector.operation": "read"
6666
6708
  },
6667
- () => tools.read(entry.handle, path2)
6709
+ () => tools.read(entry.handle, path3)
6668
6710
  );
6669
6711
  }
6670
- async write(id, path2, content) {
6712
+ async write(id, path3, content) {
6671
6713
  const entry = this.get(id);
6672
6714
  if (entry.declaration.access === "read-only") {
6673
6715
  throw new Error(`Connector "${id}" is read-only`);
@@ -6683,10 +6725,10 @@ var ConnectorManager = class {
6683
6725
  "skaile.connector.driver": entry.connector.name,
6684
6726
  "skaile.connector.operation": "write"
6685
6727
  },
6686
- () => tools.write(entry.handle, path2, content)
6728
+ () => tools.write(entry.handle, path3, content)
6687
6729
  );
6688
6730
  }
6689
- async delete(id, path2) {
6731
+ async delete(id, path3) {
6690
6732
  const entry = this.get(id);
6691
6733
  if (entry.declaration.access === "read-only") {
6692
6734
  throw new Error(`Connector "${id}" is read-only`);
@@ -6702,10 +6744,10 @@ var ConnectorManager = class {
6702
6744
  "skaile.connector.driver": entry.connector.name,
6703
6745
  "skaile.connector.operation": "delete"
6704
6746
  },
6705
- () => tools.delete(entry.handle, path2)
6747
+ () => tools.delete(entry.handle, path3)
6706
6748
  );
6707
6749
  }
6708
- async list(id, path2, options) {
6750
+ async list(id, path3, options) {
6709
6751
  const entry = this.get(id);
6710
6752
  const tools = this.requireToolFace(id, entry);
6711
6753
  if (!tools.list) {
@@ -6718,7 +6760,7 @@ var ConnectorManager = class {
6718
6760
  "skaile.connector.driver": entry.connector.name,
6719
6761
  "skaile.connector.operation": "list"
6720
6762
  },
6721
- () => tools.list(entry.handle, path2, options)
6763
+ () => tools.list(entry.handle, path3, options)
6722
6764
  );
6723
6765
  }
6724
6766
  async search(id, query, options) {
@@ -6859,9 +6901,9 @@ async function buildSdkConnectorTools(manager, options) {
6859
6901
  connector_id: z4.string().describe("Connector ID"),
6860
6902
  path: z4.string().describe("Path within the connector")
6861
6903
  },
6862
- handler: async ({ connector_id, path: path2 }) => {
6904
+ handler: async ({ connector_id, path: path3 }) => {
6863
6905
  try {
6864
- const content = await manager.read(connector_id, path2);
6906
+ const content = await manager.read(connector_id, path3);
6865
6907
  return {
6866
6908
  content: [{ type: "text", text: content?.data?.toString() ?? "(empty)" }]
6867
6909
  };
@@ -6883,11 +6925,11 @@ async function buildSdkConnectorTools(manager, options) {
6883
6925
  },
6884
6926
  handler: async ({
6885
6927
  connector_id,
6886
- path: path2,
6928
+ path: path3,
6887
6929
  content
6888
6930
  }) => {
6889
6931
  try {
6890
- await manager.write(connector_id, path2, { data: content });
6932
+ await manager.write(connector_id, path3, { data: content });
6891
6933
  return { content: [{ type: "text", text: "Written." }] };
6892
6934
  } catch (err) {
6893
6935
  return {
@@ -6907,11 +6949,11 @@ async function buildSdkConnectorTools(manager, options) {
6907
6949
  },
6908
6950
  handler: async ({
6909
6951
  connector_id,
6910
- path: path2,
6952
+ path: path3,
6911
6953
  recursive
6912
6954
  }) => {
6913
6955
  try {
6914
- const entries = await manager.list(connector_id, path2, { recursive });
6956
+ const entries = await manager.list(connector_id, path3, { recursive });
6915
6957
  return { content: [{ type: "text", text: JSON.stringify(entries, null, 2) }] };
6916
6958
  } catch (err) {
6917
6959
  return {
@@ -6947,9 +6989,9 @@ async function buildSdkConnectorTools(manager, options) {
6947
6989
  connector_id: z4.string().describe("Connector ID"),
6948
6990
  path: z4.string().describe("Path to delete")
6949
6991
  },
6950
- handler: async ({ connector_id, path: path2 }) => {
6992
+ handler: async ({ connector_id, path: path3 }) => {
6951
6993
  try {
6952
- const ok = await manager.delete(connector_id, path2);
6994
+ const ok = await manager.delete(connector_id, path3);
6953
6995
  return { content: [{ type: "text", text: ok ? "Deleted." : "Not found." }] };
6954
6996
  } catch (err) {
6955
6997
  return {
@@ -7265,19 +7307,19 @@ var ManagedGitconfigCollisionError = class extends Error {
7265
7307
  var blockStart = (mountId) => `# skaile-mount: ${mountId}`;
7266
7308
  var blockEnd = (mountId) => `# skaile-mount: ${mountId} (end)`;
7267
7309
  var credentialTag = (mountId) => `# skaile-mount: ${mountId}`;
7268
- function readFileOrEmpty(path2) {
7310
+ function readFileOrEmpty(path3) {
7269
7311
  try {
7270
- return readFileSync(path2, "utf-8");
7312
+ return readFileSync(path3, "utf-8");
7271
7313
  } catch {
7272
7314
  return "";
7273
7315
  }
7274
7316
  }
7275
- function atomicWrite(path2, content, mode) {
7276
- const dir = dirname(path2);
7317
+ function atomicWrite(path3, content, mode) {
7318
+ const dir = dirname(path3);
7277
7319
  if (!existsSync(dir)) {
7278
7320
  mkdirSync(dir, { recursive: true, mode: 448 });
7279
7321
  }
7280
- const tmp = `${path2}.tmp.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}`;
7322
+ const tmp = `${path3}.tmp.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}`;
7281
7323
  const fd = openSync(tmp, "w", mode);
7282
7324
  try {
7283
7325
  writeSync(fd, content);
@@ -7285,7 +7327,7 @@ function atomicWrite(path2, content, mode) {
7285
7327
  closeSync(fd);
7286
7328
  }
7287
7329
  chmodSync(tmp, mode);
7288
- renameSync(tmp, path2);
7330
+ renameSync(tmp, path3);
7289
7331
  }
7290
7332
  function appendForeignLine(blocks, line) {
7291
7333
  const last = blocks[blocks.length - 1];
@@ -7351,13 +7393,13 @@ function buildCredentialLine(urlPrefix, token, mountId) {
7351
7393
  const encodedToken = encodeURIComponent(token);
7352
7394
  return `${scheme}://x-access-token:${encodedToken}@${host} ${credentialTag(mountId)}`;
7353
7395
  }
7354
- function readCredentialLines(path2) {
7355
- return readFileOrEmpty(path2).split("\n").filter((l) => l.length > 0);
7396
+ function readCredentialLines(path3) {
7397
+ return readFileOrEmpty(path3).split("\n").filter((l) => l.length > 0);
7356
7398
  }
7357
- function writeCredentialLines(path2, lines) {
7399
+ function writeCredentialLines(path3, lines) {
7358
7400
  const content = lines.length > 0 ? `${lines.join("\n")}
7359
7401
  ` : "";
7360
- atomicWrite(path2, content, 416);
7402
+ atomicWrite(path3, content, 416);
7361
7403
  }
7362
7404
  function findExistingBlock(blocks, mountId) {
7363
7405
  return blocks.find((b) => b.mountId === mountId);
@@ -7592,25 +7634,25 @@ function createRcloneTokenRefresh(deps) {
7592
7634
  }
7593
7635
  var WorktreeRegistryImpl = class {
7594
7636
  entries = /* @__PURE__ */ new Map();
7595
- register(path2, owner) {
7596
- let owners = this.entries.get(path2);
7637
+ register(path3, owner) {
7638
+ let owners = this.entries.get(path3);
7597
7639
  if (!owners) {
7598
7640
  owners = /* @__PURE__ */ new Set();
7599
- this.entries.set(path2, owners);
7641
+ this.entries.set(path3, owners);
7600
7642
  }
7601
7643
  owners.add(owner);
7602
7644
  }
7603
- deregister(path2, owner) {
7604
- const owners = this.entries.get(path2);
7645
+ deregister(path3, owner) {
7646
+ const owners = this.entries.get(path3);
7605
7647
  if (!owners) return;
7606
7648
  owners.delete(owner);
7607
- if (owners.size === 0) this.entries.delete(path2);
7649
+ if (owners.size === 0) this.entries.delete(path3);
7608
7650
  }
7609
- isInUse(path2) {
7610
- return (this.entries.get(path2)?.size ?? 0) > 0;
7651
+ isInUse(path3) {
7652
+ return (this.entries.get(path3)?.size ?? 0) > 0;
7611
7653
  }
7612
- owners(path2) {
7613
- return [...this.entries.get(path2) ?? []];
7654
+ owners(path3) {
7655
+ return [...this.entries.get(path3) ?? []];
7614
7656
  }
7615
7657
  };
7616
7658
  var worktreeRegistry = new WorktreeRegistryImpl();
@@ -7739,8 +7781,8 @@ var FlowAdapter = class extends AbstractConnector {
7739
7781
  constructor() {
7740
7782
  super();
7741
7783
  this.tools = {
7742
- read: (handle, path2) => this.read(handle, path2),
7743
- list: (handle, path2, options) => this.list(handle, path2, options),
7784
+ read: (handle, path3) => this.read(handle, path3),
7785
+ list: (handle, path3, options) => this.list(handle, path3, options),
7744
7786
  search: (handle, query, options) => this.search(handle, query, options),
7745
7787
  describeOperations: (handle) => this.describeOperations(handle),
7746
7788
  executeOp: (handle, operation, args) => this.executeOp(handle, operation, args)
@@ -7784,16 +7826,16 @@ var FlowAdapter = class extends AbstractConnector {
7784
7826
  s.execution = this.recompute(s);
7785
7827
  }
7786
7828
  // ── Base operations (private — wired into tools face in constructor) ──
7787
- async read(handle, path2) {
7829
+ async read(handle, path3) {
7788
7830
  const s = this.s(handle);
7789
- if (path2 === "" || path2 === "state") {
7831
+ if (path3 === "" || path3 === "state") {
7790
7832
  return {
7791
7833
  data: JSON.stringify(s.execution, null, 2),
7792
7834
  contentType: "application/json"
7793
7835
  };
7794
7836
  }
7795
- if (path2.startsWith("node/")) {
7796
- const nodeId = path2.slice(5);
7837
+ if (path3.startsWith("node/")) {
7838
+ const nodeId = path3.slice(5);
7797
7839
  const node = s.flowDef.nodes.find((n) => n.id === nodeId);
7798
7840
  if (!node) return null;
7799
7841
  const exec = s.execution.nodes[nodeId];
@@ -8611,5 +8653,5 @@ function createConnector() {
8611
8653
  }
8612
8654
 
8613
8655
  export { AbstractConnector, BUILTIN_CONNECTOR_CATALOG, ConnectorFieldMissingError, ConnectorManager, ConnectorStartupError, DEFAULT_REACTIVE_COOLDOWN_MS, DeployConnector, DevServerConnector, FleetHealthGate, FlowAdapter, GitConnector, GmailConnector, GoogleDriveConnector, LocalConnector, LogBuffer, ManagedGitconfigCollisionError, MattermostConnector, MemoryConnector, MinIOConnector, NOT_READY_SENTINEL, PROACTIVE_RCLONE_REFRESH_MARGIN_MS, PostgresConnector, RoMountPlaceholderBarrier, S3Connector, SQLiteConnector, SharePointConnector, StaticServerConnector, TunnelConnector, WebDAVConnector, XStateConnector, XStateStoreConnector, __test, atomicReplaceCredential, buildConnectorPromptSection, buildSdkConnectorTools, createConnector, createConnector10, createConnector11, createConnector12, createConnector13, createConnector14, createConnector15, createConnector16, createConnector17, createConnector18, createConnector19, createConnector2, createConnector3, createConnector4, createConnector5, createConnector6, createConnector7, createConnector8, createConnector9, createRcloneTokenRefresh, createWorktree, defaultMountPlaceholderBarrier, defaultSpawn, ensureFleetMounted, findGitRoot, findMissingPackages, getConnector, installNpmPackages, isFleetManaged, isPackageResolvable, listConnectors, listWorktrees, probeFleetHealth, registerBuiltinConnectors, removeMountBlock, renderCredentialHelperScript, tryGetConnector, worktreeRegistry, writeHelperScript, writeMountBlock };
8614
- //# sourceMappingURL=chunk-F5Q2RMH4.js.map
8615
- //# sourceMappingURL=chunk-F5Q2RMH4.js.map
8656
+ //# sourceMappingURL=chunk-U2XHHLE3.js.map
8657
+ //# sourceMappingURL=chunk-U2XHHLE3.js.map