@skaile/workspaces 4.3.0 → 4.5.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 (157) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-SUK47KWR.js → asset-feeds-7QRZ4RAY.js} +4 -4
  4. package/dist/{asset-feeds-SUK47KWR.js.map → asset-feeds-7QRZ4RAY.js.map} +1 -1
  5. package/dist/asset-manager/index.js +1 -1
  6. package/dist/bridge/drivers/claude-sdk.js +30 -4
  7. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  8. package/dist/bridge/drivers/codex.js +2 -2
  9. package/dist/bridge/drivers/continue.js +2 -2
  10. package/dist/bridge/drivers/echo.js +3 -3
  11. package/dist/bridge/drivers/gemini.js +4 -4
  12. package/dist/bridge/drivers/goose.js +2 -2
  13. package/dist/bridge/drivers/omp.js +1 -1
  14. package/dist/bridge/drivers/opencode.js +2 -2
  15. package/dist/bridge/drivers/qwen.js +4 -4
  16. package/dist/bridge/index.js +5 -5
  17. package/dist/bridge/src/drivers/claude-sdk.d.ts +12 -0
  18. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  19. package/dist/bridge/src/normalizer.d.ts.map +1 -1
  20. package/dist/bridge/src/types.d.ts +10 -0
  21. package/dist/bridge/src/types.d.ts.map +1 -1
  22. package/dist/channels/index.js +25 -1
  23. package/dist/channels/index.js.map +1 -1
  24. package/dist/channels/src/egress/output-mirror.d.ts +6 -0
  25. package/dist/channels/src/egress/output-mirror.d.ts.map +1 -1
  26. package/dist/channels/src/engine.d.ts.map +1 -1
  27. package/dist/{chunk-GB2CMJ3R.js → chunk-2KLW6K7T.js} +194 -38
  28. package/dist/chunk-2KLW6K7T.js.map +1 -0
  29. package/dist/{chunk-GMKNGIIB.js → chunk-3OLCTLTH.js} +46 -5
  30. package/dist/chunk-3OLCTLTH.js.map +1 -0
  31. package/dist/{chunk-ZKIVYTU6.js → chunk-3PXHN5B5.js} +6 -6
  32. package/dist/{chunk-ZKIVYTU6.js.map → chunk-3PXHN5B5.js.map} +1 -1
  33. package/dist/{chunk-6CMMJFPV.js → chunk-4XHZE73P.js} +4 -4
  34. package/dist/{chunk-6CMMJFPV.js.map → chunk-4XHZE73P.js.map} +1 -1
  35. package/dist/{chunk-T3LXTYWS.js → chunk-AR6ODUDD.js} +6 -6
  36. package/dist/{chunk-T3LXTYWS.js.map → chunk-AR6ODUDD.js.map} +1 -1
  37. package/dist/{chunk-PX5M5WDS.js → chunk-BGROQFRC.js} +11 -6
  38. package/dist/chunk-BGROQFRC.js.map +1 -0
  39. package/dist/{chunk-OJ4GNQO5.js → chunk-C7OPE7R5.js} +2 -2
  40. package/dist/{chunk-OJ4GNQO5.js.map → chunk-C7OPE7R5.js.map} +1 -1
  41. package/dist/{chunk-O552FCP7.js → chunk-CNYIITSZ.js} +15 -3
  42. package/dist/chunk-CNYIITSZ.js.map +1 -0
  43. package/dist/{chunk-643F3GNV.js → chunk-FA6OZDCB.js} +3 -3
  44. package/dist/{chunk-643F3GNV.js.map → chunk-FA6OZDCB.js.map} +1 -1
  45. package/dist/{chunk-IXQC4ADP.js → chunk-HFRNPPHK.js} +3 -3
  46. package/dist/{chunk-IXQC4ADP.js.map → chunk-HFRNPPHK.js.map} +1 -1
  47. package/dist/{chunk-2EDBRUFS.js → chunk-II6OMNH2.js} +5 -5
  48. package/dist/{chunk-2EDBRUFS.js.map → chunk-II6OMNH2.js.map} +1 -1
  49. package/dist/{chunk-V7VHX7MK.js → chunk-JHCWUG4L.js} +2 -2
  50. package/dist/{chunk-V7VHX7MK.js.map → chunk-JHCWUG4L.js.map} +1 -1
  51. package/dist/{chunk-TZUAFEYN.js → chunk-L4JEPRKE.js} +3 -3
  52. package/dist/{chunk-TZUAFEYN.js.map → chunk-L4JEPRKE.js.map} +1 -1
  53. package/dist/{chunk-7YNBVDGL.js → chunk-NOH5UDO7.js} +3 -3
  54. package/dist/{chunk-7YNBVDGL.js.map → chunk-NOH5UDO7.js.map} +1 -1
  55. package/dist/{chunk-2CDYYL6T.js → chunk-QTTAATBK.js} +3 -3
  56. package/dist/{chunk-2CDYYL6T.js.map → chunk-QTTAATBK.js.map} +1 -1
  57. package/dist/{chunk-7J3FBC6T.js → chunk-SPNVXXUN.js} +2 -2
  58. package/dist/{chunk-7J3FBC6T.js.map → chunk-SPNVXXUN.js.map} +1 -1
  59. package/dist/{chunk-DY3R7FYY.js → chunk-U4AA7MOV.js} +4 -4
  60. package/dist/chunk-U4AA7MOV.js.map +1 -0
  61. package/dist/{chunk-67IZGZI2.js → chunk-UY3RIH5D.js} +3 -3
  62. package/dist/{chunk-67IZGZI2.js.map → chunk-UY3RIH5D.js.map} +1 -1
  63. package/dist/{chunk-6SBTX44S.js → chunk-VG226ZI5.js} +7 -4
  64. package/dist/chunk-VG226ZI5.js.map +1 -0
  65. package/dist/{chunk-3VUCSJBJ.js → chunk-WHZR3276.js} +3 -3
  66. package/dist/{chunk-3VUCSJBJ.js.map → chunk-WHZR3276.js.map} +1 -1
  67. package/dist/{chunk-HKLCMOK4.js → chunk-YVQZQGVW.js} +3 -3
  68. package/dist/{chunk-HKLCMOK4.js.map → chunk-YVQZQGVW.js.map} +1 -1
  69. package/dist/cli/index.js +37 -34
  70. package/dist/cli/index.js.map +1 -1
  71. package/dist/cli/src/commands/connect.d.ts.map +1 -1
  72. package/dist/cli/src/commands/run.d.ts.map +1 -1
  73. package/dist/connectors/index.js +6 -6
  74. package/dist/{ensure-sources-V62XWSYD.js → ensure-sources-537FIFGO.js} +4 -4
  75. package/dist/{ensure-sources-V62XWSYD.js.map → ensure-sources-537FIFGO.js.map} +1 -1
  76. package/dist/factory-assets/connectors/box.js +6 -6
  77. package/dist/factory-assets/connectors/deploy.js +6 -6
  78. package/dist/factory-assets/connectors/devserver.js +6 -6
  79. package/dist/factory-assets/connectors/flow/adapter.js +6 -6
  80. package/dist/factory-assets/connectors/flow/run-flow.js +7 -7
  81. package/dist/factory-assets/connectors/flow.js +6 -6
  82. package/dist/factory-assets/connectors/git.js +6 -6
  83. package/dist/factory-assets/connectors/gmail.js +6 -6
  84. package/dist/factory-assets/connectors/googledrive.js +6 -6
  85. package/dist/factory-assets/connectors/local.js +6 -6
  86. package/dist/factory-assets/connectors/mattermost.js +6 -6
  87. package/dist/factory-assets/connectors/memory.js +6 -6
  88. package/dist/factory-assets/connectors/minio.js +6 -6
  89. package/dist/factory-assets/connectors/postgres.js +6 -6
  90. package/dist/factory-assets/connectors/s3.js +6 -6
  91. package/dist/factory-assets/connectors/sharepoint.js +6 -6
  92. package/dist/factory-assets/connectors/sqlite.js +6 -6
  93. package/dist/factory-assets/connectors/static-server.js +6 -6
  94. package/dist/factory-assets/connectors/tunnel.js +6 -6
  95. package/dist/factory-assets/connectors/webdav.js +6 -6
  96. package/dist/factory-assets/connectors/xstate-store.js +6 -6
  97. package/dist/factory-assets/connectors/xstate.js +6 -6
  98. package/dist/{helpers-ZXSNIPEH.js → helpers-H3NGF3GO.js} +4 -4
  99. package/dist/{helpers-ZXSNIPEH.js.map → helpers-H3NGF3GO.js.map} +1 -1
  100. package/dist/{library-publish-OHNV7TCD.js → library-publish-JULNH5AJ.js} +6 -6
  101. package/dist/{library-publish-OHNV7TCD.js.map → library-publish-JULNH5AJ.js.map} +1 -1
  102. package/dist/{open-library-VXKQ4KNY.js → open-library-NMKPLBSD.js} +5 -5
  103. package/dist/{open-library-VXKQ4KNY.js.map → open-library-NMKPLBSD.js.map} +1 -1
  104. package/dist/{project-GOQYIOKG.js → project-LCIRUACP.js} +5 -5
  105. package/dist/{project-GOQYIOKG.js.map → project-LCIRUACP.js.map} +1 -1
  106. package/dist/runner/index.js +10 -10
  107. package/dist/runner/src/agent.d.ts.map +1 -1
  108. package/dist/runner/src/compaction/orchestrator.d.ts.map +1 -1
  109. package/dist/runner/src/markdown-stream.d.ts +6 -0
  110. package/dist/runner/src/markdown-stream.d.ts.map +1 -1
  111. package/dist/runner/src/resource-handler.d.ts +40 -1
  112. package/dist/runner/src/resource-handler.d.ts.map +1 -1
  113. package/dist/sdk/asset-manager.js +1 -1
  114. package/dist/sdk/bridge.js +5 -5
  115. package/dist/sdk/index.js +27 -10
  116. package/dist/sdk/index.js.map +1 -1
  117. package/dist/sdk/runner.js +10 -10
  118. package/dist/sdk/session.js +2 -2
  119. package/dist/sdk/src/agent-session.d.ts +5 -0
  120. package/dist/sdk/src/agent-session.d.ts.map +1 -1
  121. package/dist/sdk/store.js +1 -1
  122. package/dist/sdk/types.js +1 -1
  123. package/dist/session/index.js +2 -2
  124. package/dist/session/src/dispatcher.d.ts.map +1 -1
  125. package/dist/{setup-7DVYP3TP.js → setup-ZEAG3PKZ.js} +10 -10
  126. package/dist/{setup-7DVYP3TP.js.map → setup-ZEAG3PKZ.js.map} +1 -1
  127. package/dist/{source-4SAPYPNW.js → source-YOCTM4XQ.js} +6 -6
  128. package/dist/{source-4SAPYPNW.js.map → source-YOCTM4XQ.js.map} +1 -1
  129. package/dist/{source-manifest-publish-UEMPQCE5.js → source-manifest-publish-FIJO6TFQ.js} +7 -7
  130. package/dist/{source-manifest-publish-UEMPQCE5.js.map → source-manifest-publish-FIJO6TFQ.js.map} +1 -1
  131. package/dist/store/index.js +1 -1
  132. package/dist/store/src/index.d.ts +1 -1
  133. package/dist/store/src/index.d.ts.map +1 -1
  134. package/dist/store/src/resource-client.d.ts +32 -2
  135. package/dist/store/src/resource-client.d.ts.map +1 -1
  136. package/dist/store/src/store.d.ts.map +1 -1
  137. package/dist/tui/index.js +18 -10
  138. package/dist/tui/index.js.map +1 -1
  139. package/dist/tui/src/repl-session.d.ts.map +1 -1
  140. package/dist/types/index.js +1 -1
  141. package/dist/types/src/events.d.ts +117 -2
  142. package/dist/types/src/events.d.ts.map +1 -1
  143. package/dist/types/src/index.d.ts +1 -1
  144. package/dist/types/src/index.d.ts.map +1 -1
  145. package/dist/types/src/protocol.d.ts +3 -3
  146. package/dist/types/src/protocol.d.ts.map +1 -1
  147. package/dist/types/src/version.d.ts +18 -1
  148. package/dist/types/src/version.d.ts.map +1 -1
  149. package/dist/workspace-plugin/adapters/mcp.js +2 -2
  150. package/dist/workspace-plugin/index.js +1 -1
  151. package/package.json +1 -1
  152. package/dist/chunk-6SBTX44S.js.map +0 -1
  153. package/dist/chunk-DY3R7FYY.js.map +0 -1
  154. package/dist/chunk-GB2CMJ3R.js.map +0 -1
  155. package/dist/chunk-GMKNGIIB.js.map +0 -1
  156. package/dist/chunk-O552FCP7.js.map +0 -1
  157. package/dist/chunk-PX5M5WDS.js.map +0 -1
@@ -1,28 +1,28 @@
1
- import { WorkspacePlugin } from './chunk-V7VHX7MK.js';
2
- import { buildWorkspaceToolDefs } from './chunk-HKLCMOK4.js';
1
+ import { WorkspacePlugin } from './chunk-JHCWUG4L.js';
2
+ import { buildWorkspaceToolDefs } from './chunk-YVQZQGVW.js';
3
3
  import { findAiAssetsRoot } from './chunk-7IRJ4K4F.js';
4
4
  import { WebSocketServerTransport } from './chunk-73ZXUUL6.js';
5
5
  import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
6
6
  import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-45LLHKQ2.js';
7
- import { resolveFlowPath } from './chunk-IXQC4ADP.js';
7
+ import { resolveFlowPath } from './chunk-HFRNPPHK.js';
8
8
  import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-7BUZQVRR.js';
9
- import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-PX5M5WDS.js';
9
+ import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-BGROQFRC.js';
10
10
  import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, isKnownSecretRef, deriveSingleMaterializedConnectorDeclaration } from './chunk-KW7YIRYL.js';
11
- import { EventNormalizer } from './chunk-6SBTX44S.js';
11
+ import { EventNormalizer } from './chunk-VG226ZI5.js';
12
12
  import { probeResumeTranscript } from './chunk-WLFRA5RM.js';
13
13
  import { CodexNativeStateUnavailable } from './chunk-LOO5CB5M.js';
14
- import { dispatchCapability } from './chunk-7YNBVDGL.js';
14
+ import { dispatchCapability } from './chunk-NOH5UDO7.js';
15
15
  import { classifyClaudeSdkError } from './chunk-GAH4YRCI.js';
16
- import { createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv } from './chunk-7J3FBC6T.js';
16
+ import { createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv } from './chunk-SPNVXXUN.js';
17
17
  import { loadFlow } from './chunk-NWZQMJTI.js';
18
18
  import { parseFlowDefinition } from './chunk-53ORCYPJ.js';
19
19
  import { renderStimulusPrompt } from './chunk-2D5BYAL6.js';
20
- import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-DY3R7FYY.js';
20
+ import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-U4AA7MOV.js';
21
21
  import { resolveSettings, loadProviderRegistry } from './chunk-UJPVUN6H.js';
22
22
  import { resolveRuntimeAssets } from './chunk-REILIKVM.js';
23
23
  import { resolveDriverPaths } from './chunk-K5GBV4SA.js';
24
24
  import { resolveSkWorkspaceConfig, resolveAgentDir, stageMaterializedSkills, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration } from './chunk-K27T47OO.js';
25
- import { withFsDeadline, fsDeadlineMs, FsDeadlineError, tryWithFsDeadline } from './chunk-MKZOK4JU.js';
25
+ import { withFsDeadline, FsDeadlineError, fsDeadlineMs, tryWithFsDeadline } from './chunk-MKZOK4JU.js';
26
26
  import { parseAssetRef } from './chunk-GEEW6SY2.js';
27
27
  import { resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink } from './chunk-FTG7CRFD.js';
28
28
  import { registryEntries, resolveEntryBaseUrl } from './chunk-ILG4BXYE.js';
@@ -31,9 +31,9 @@ import { __require } from './chunk-NSBPE2FW.js';
31
31
  import pc from 'picocolors';
32
32
  import { Marked } from 'marked';
33
33
  import { markedTerminal } from 'marked-terminal';
34
- import fs4, { readFile, stat, rm, unlink, mkdir, writeFile, readdir, realpath, lstat, rename, readlink, mkdtemp } from 'fs/promises';
34
+ import fs4, { readFile, readdir, lstat, stat, rm, unlink, mkdir, writeFile, realpath, rename, readlink, mkdtemp } from 'fs/promises';
35
35
  import { createHash, randomBytes, timingSafeEqual, randomUUID } from 'crypto';
36
- import path4, { join, resolve, relative, sep, isAbsolute, dirname, basename } from 'path';
36
+ import path4, { join, resolve, relative, sep, isAbsolute, basename, dirname } from 'path';
37
37
  import { existsSync, lstatSync, realpathSync, readFileSync, mkdirSync, writeFileSync, watch, chmodSync, accessSync, constants } from 'fs';
38
38
  import { homedir } from 'os';
39
39
  import * as z7 from 'zod';
@@ -166,6 +166,20 @@ var MarkdownStreamer = class {
166
166
  this.buffer += chunk;
167
167
  this.flush();
168
168
  }
169
+ /**
170
+ * Take back a replayed attempt's fragment. Only the uncommitted tail can be
171
+ * cut — text past a blank-line boundary is already on the terminal. When the
172
+ * fragment spanned that boundary, the whole tail belongs to it and goes.
173
+ */
174
+ retract(text2) {
175
+ const uncommitted = this.buffer.slice(this.committedSource.length);
176
+ if (!text2 || !uncommitted) return;
177
+ if (uncommitted.endsWith(text2)) {
178
+ this.buffer = this.buffer.slice(0, this.buffer.length - text2.length);
179
+ } else if (text2.endsWith(uncommitted)) {
180
+ this.buffer = this.committedSource;
181
+ }
182
+ }
169
183
  /** Render any remaining content and reset state. */
170
184
  end() {
171
185
  if (this.buffer.length > this.committedSource.length) {
@@ -2632,6 +2646,8 @@ async function runAgentChat(opts) {
2632
2646
  }
2633
2647
  mdStream.write(delta);
2634
2648
  }
2649
+ } else if (event.type === "message_retract") {
2650
+ mdStream.retract(event.text);
2635
2651
  }
2636
2652
  });
2637
2653
  let message = opts.message;
@@ -3144,6 +3160,30 @@ function rejectCapabilityOnApprovalDeny(pending, callId, feedback) {
3144
3160
  entry.reject(new Error(feedback ?? "declined by user"));
3145
3161
  return true;
3146
3162
  }
3163
+ var ResourceOperationError = class extends Error {
3164
+ constructor(message, code) {
3165
+ super(message);
3166
+ this.code = code;
3167
+ this.name = "ResourceOperationError";
3168
+ }
3169
+ code;
3170
+ };
3171
+ function unsupportedOperation(operation, target) {
3172
+ return new ResourceOperationError(
3173
+ `Unsupported operation for ${target}: ${operation}`,
3174
+ "unsupported_operation"
3175
+ );
3176
+ }
3177
+ function errorResponse(command, resourceId, err) {
3178
+ return {
3179
+ type: "resource_response",
3180
+ requestId: command.requestId,
3181
+ resourceId,
3182
+ operation: command.operation,
3183
+ error: err instanceof Error ? err.message : String(err),
3184
+ ...err instanceof ResourceOperationError ? { code: err.code } : {}
3185
+ };
3186
+ }
3147
3187
  async function handleResourceRequest(command, manager, emit) {
3148
3188
  const { requestId, connectorId, operation, path: path5, options, content } = command;
3149
3189
  try {
@@ -3173,22 +3213,96 @@ async function handleResourceRequest(command, manager, emit) {
3173
3213
  options
3174
3214
  );
3175
3215
  break;
3216
+ default:
3217
+ throw unsupportedOperation(operation, "connector");
3176
3218
  }
3177
3219
  emit({ type: "resource_response", requestId, resourceId: connectorId, operation, data });
3178
3220
  } catch (err) {
3179
- emit({
3180
- type: "resource_response",
3181
- requestId,
3182
- resourceId: connectorId,
3183
- operation,
3184
- error: err instanceof Error ? err.message : String(err)
3185
- });
3221
+ emit(errorResponse(command, connectorId, err));
3186
3222
  }
3187
3223
  }
3188
3224
  var MOUNT_LIST_MAX_DEPTH = 32;
3189
3225
  var MOUNT_LIST_MAX_ENTRIES = 1e4;
3190
3226
  var MOUNT_TREE_OP_DEADLINE_FACTOR = 4;
3191
3227
  var MOUNT_READ_DEADLINE_FACTOR = 4;
3228
+ var MOUNT_STAT_MAX_ENTRIES = 5e4;
3229
+ var MOUNT_STAT_BUDGET_MS = 1e4;
3230
+ var MOUNT_STAT_CONCURRENCY = 16;
3231
+ function lowerCap(requested, cap) {
3232
+ return typeof requested === "number" && Number.isFinite(requested) && requested > 0 ? Math.min(Math.floor(requested), cap) : cap;
3233
+ }
3234
+ function isoTime(time) {
3235
+ const ms = time.getTime();
3236
+ return Number.isFinite(ms) && ms > 0 ? time.toISOString() : void 0;
3237
+ }
3238
+ async function computeDirectoryTotals(root, opts, clock = Date.now) {
3239
+ const deadline = clock() + opts.budgetMs;
3240
+ const totals = { files: 0, directories: 0, bytes: 0, partial: false };
3241
+ const markPartial = (why) => {
3242
+ totals.partial = true;
3243
+ if (why && (!totals.stoppedBy || why !== "depth")) totals.stoppedBy = why;
3244
+ };
3245
+ let stopped = false;
3246
+ let seen = 0;
3247
+ const pending = [{ abs: root, depth: 0 }];
3248
+ while (pending.length > 0 && !stopped) {
3249
+ if (clock() >= deadline) {
3250
+ markPartial("time");
3251
+ break;
3252
+ }
3253
+ const { abs, depth } = pending.pop();
3254
+ let dirents;
3255
+ try {
3256
+ dirents = await withFsDeadline(`readdir ${abs}`, () => readdir(abs, { withFileTypes: true }));
3257
+ } catch (err) {
3258
+ if (err instanceof FsDeadlineError || abs === root) throw err;
3259
+ if (err.code === "ENOENT") {
3260
+ totals.directories--;
3261
+ continue;
3262
+ }
3263
+ totals.unreadable = (totals.unreadable ?? 0) + 1;
3264
+ markPartial();
3265
+ continue;
3266
+ }
3267
+ const files = [];
3268
+ for (const e of dirents) {
3269
+ if (!opts.includeHidden && e.name.startsWith(".")) continue;
3270
+ if (seen >= opts.maxEntries) {
3271
+ markPartial("entries");
3272
+ stopped = true;
3273
+ break;
3274
+ }
3275
+ seen++;
3276
+ if (e.isDirectory()) {
3277
+ totals.directories++;
3278
+ if (depth + 1 > opts.maxDepth) markPartial("depth");
3279
+ else pending.push({ abs: join(abs, e.name), depth: depth + 1 });
3280
+ } else {
3281
+ totals.files++;
3282
+ files.push(join(abs, e.name));
3283
+ }
3284
+ }
3285
+ for (let i = 0; i < files.length; i += MOUNT_STAT_CONCURRENCY) {
3286
+ if (clock() >= deadline) {
3287
+ markPartial("time");
3288
+ stopped = true;
3289
+ break;
3290
+ }
3291
+ const sizes = await Promise.all(
3292
+ files.slice(i, i + MOUNT_STAT_CONCURRENCY).map(async (file) => {
3293
+ try {
3294
+ return (await withFsDeadline(`lstat ${file}`, () => lstat(file))).size;
3295
+ } catch (err) {
3296
+ if (err instanceof FsDeadlineError) throw err;
3297
+ return 0;
3298
+ }
3299
+ })
3300
+ );
3301
+ for (const size of sizes) totals.bytes += size;
3302
+ }
3303
+ }
3304
+ return totals;
3305
+ }
3192
3306
  function getMimeType(filename) {
3193
3307
  return mime.getType(filename) ?? "application/octet-stream";
3194
3308
  }
@@ -3214,7 +3328,10 @@ async function handleMountResourceRequest(command, manager, emit) {
3214
3328
  const entry = manager.get(mountId);
3215
3329
  const mountPath = entry.handle.mountPath;
3216
3330
  if (!mountPath) {
3217
- throw new Error(`Connector "${mountId}" has no projected mount directory`);
3331
+ throw new ResourceOperationError(
3332
+ `Connector "${mountId}" has no projected mount directory`,
3333
+ "unsupported_operation"
3334
+ );
3218
3335
  }
3219
3336
  const targetPath = reqPath ? resolve(mountPath, reqPath) : mountPath;
3220
3337
  const rel = relative(mountPath, targetPath);
@@ -3315,6 +3432,49 @@ async function handleMountResourceRequest(command, manager, emit) {
3315
3432
  data = true;
3316
3433
  break;
3317
3434
  }
3435
+ case "mkdir": {
3436
+ if (rel === "") throw new Error("A folder path is required");
3437
+ const parentDir = dirname(targetPath);
3438
+ await withFsDeadline(`mkdir ${parentDir}`, () => mkdir(parentDir, { recursive: true }));
3439
+ try {
3440
+ await withFsDeadline(`mkdir ${targetPath}`, () => mkdir(targetPath));
3441
+ } catch (mkdirErr) {
3442
+ if (mkdirErr.code === "EEXIST") {
3443
+ throw new ResourceOperationError(
3444
+ `"${rel.split(sep).join("/")}" already exists`,
3445
+ "already_exists"
3446
+ );
3447
+ }
3448
+ throw mkdirErr;
3449
+ }
3450
+ data = true;
3451
+ break;
3452
+ }
3453
+ case "stat": {
3454
+ const statOptions = options;
3455
+ const st = await withFsDeadline(`stat ${targetPath}`, () => stat(targetPath));
3456
+ const isDir = st.isDirectory();
3457
+ const result = {
3458
+ name: rel === "" ? "" : basename(targetPath),
3459
+ path: rel.split(sep).join("/"),
3460
+ type: isDir ? "directory" : "file"
3461
+ };
3462
+ if (!isDir) result.size = st.size;
3463
+ const modifiedAt = isoTime(st.mtime);
3464
+ if (modifiedAt) result.modifiedAt = modifiedAt;
3465
+ const createdAt = isoTime(st.birthtime);
3466
+ if (createdAt) result.createdAt = createdAt;
3467
+ if (isDir && statOptions?.recursive) {
3468
+ result.totals = await computeDirectoryTotals(targetPath, {
3469
+ includeHidden: Boolean(statOptions.includeHidden),
3470
+ maxEntries: lowerCap(statOptions.maxEntries, MOUNT_STAT_MAX_ENTRIES),
3471
+ budgetMs: lowerCap(statOptions.timeoutMs, MOUNT_STAT_BUDGET_MS),
3472
+ maxDepth: MOUNT_LIST_MAX_DEPTH
3473
+ });
3474
+ }
3475
+ data = result;
3476
+ break;
3477
+ }
3318
3478
  case "delete": {
3319
3479
  const st = await withFsDeadline(`stat ${targetPath}`, () => stat(targetPath));
3320
3480
  if (st.isDirectory()) {
@@ -3330,17 +3490,11 @@ async function handleMountResourceRequest(command, manager, emit) {
3330
3490
  break;
3331
3491
  }
3332
3492
  default:
3333
- throw new Error(`Unsupported operation for mount: ${operation}`);
3493
+ throw unsupportedOperation(operation, "mount");
3334
3494
  }
3335
3495
  emit({ type: "resource_response", requestId, resourceId: mountId, operation, data });
3336
3496
  } catch (err) {
3337
- emit({
3338
- type: "resource_response",
3339
- requestId,
3340
- resourceId: mountId,
3341
- operation,
3342
- error: err instanceof Error ? err.message : String(err)
3343
- });
3497
+ emit(errorResponse(command, mountId, err));
3344
3498
  }
3345
3499
  }
3346
3500
  var SESSION_ROOT_WRITABLE_FILES = ["skaile.yaml"];
@@ -3401,7 +3555,7 @@ async function handleSessionRootResourceRequest(command, rootDir, emit) {
3401
3555
  const { requestId, connectorId, operation, path: reqPath, content } = command;
3402
3556
  try {
3403
3557
  if (operation !== "write" && operation !== "delete") {
3404
- throw new Error(`Unsupported operation for the session root: ${operation}`);
3558
+ throw unsupportedOperation(operation, "the session root");
3405
3559
  }
3406
3560
  if (!reqPath) throw new Error("A path is required for the session root");
3407
3561
  if (isAbsolute(reqPath)) throw new Error("Absolute paths are not allowed for the session root");
@@ -3450,13 +3604,7 @@ async function handleSessionRootResourceRequest(command, rootDir, emit) {
3450
3604
  }
3451
3605
  emit({ type: "resource_response", requestId, resourceId: connectorId, operation, data });
3452
3606
  } catch (err) {
3453
- emit({
3454
- type: "resource_response",
3455
- requestId,
3456
- resourceId: connectorId,
3457
- operation,
3458
- error: err instanceof Error ? err.message : String(err)
3459
- });
3607
+ emit(errorResponse(command, connectorId, err));
3460
3608
  }
3461
3609
  }
3462
3610
  async function dispatchResourceRequest(command, deps) {
@@ -4577,6 +4725,14 @@ var CompactionOrchestrator = class {
4577
4725
  }
4578
4726
  return;
4579
4727
  }
4728
+ if (event.type === "message_retract") {
4729
+ const text2 = event.text;
4730
+ if (text2 && summaryText.endsWith(text2)) {
4731
+ summaryText = summaryText.slice(0, summaryText.length - text2.length);
4732
+ }
4733
+ sawDeltas = false;
4734
+ return;
4735
+ }
4580
4736
  if (event.type === "message_start" || event.type === "message_end") {
4581
4737
  const msg = event.message;
4582
4738
  if (!msg?.content) return;
@@ -8668,6 +8824,6 @@ function touchSession(state) {
8668
8824
  return { ...state, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
8669
8825
  }
8670
8826
 
8671
- export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, MOUNT_LIST_MAX_DEPTH, MOUNT_LIST_MAX_ENTRIES, MOUNT_READ_DEADLINE_FACTOR, MOUNT_TREE_OP_DEADLINE_FACTOR, MarkdownStreamer, PreInitRingSink, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildStoreSnapshotReplay, builtinCapabilities, capabilityLogInstance, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, connectorRefreshKind, createAgentSession, createFlowConnectorReadiness, createManagedCodexSubpromptDriver, createSessionStimulusBus, defineCapability, deleteSession, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowStartNeedsDriverRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, hasNonTerminalFlow, hostOpResumeStimulus, installPreInitRingSink, isSessionRootPathAllowed, isTerminalFlowStatus, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadManagedCodexHostConfig, loadSession, loadSessionById, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickFlowToolTarget, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveMixin, runAgentChat, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, supportsLiveToolUpdates, touchSession, validateInputResponse, writeClaudeCodeCredentialsFile };
8672
- //# sourceMappingURL=chunk-GB2CMJ3R.js.map
8673
- //# sourceMappingURL=chunk-GB2CMJ3R.js.map
8827
+ export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, MOUNT_LIST_MAX_DEPTH, MOUNT_LIST_MAX_ENTRIES, MOUNT_READ_DEADLINE_FACTOR, MOUNT_STAT_BUDGET_MS, MOUNT_STAT_MAX_ENTRIES, MOUNT_TREE_OP_DEADLINE_FACTOR, MarkdownStreamer, PreInitRingSink, ResourceOperationError, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildStoreSnapshotReplay, builtinCapabilities, capabilityLogInstance, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, computeDirectoryTotals, connectorRefreshKind, createAgentSession, createFlowConnectorReadiness, createManagedCodexSubpromptDriver, createSessionStimulusBus, defineCapability, deleteSession, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowStartNeedsDriverRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, hasNonTerminalFlow, hostOpResumeStimulus, installPreInitRingSink, isSessionRootPathAllowed, isTerminalFlowStatus, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadManagedCodexHostConfig, loadSession, loadSessionById, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickFlowToolTarget, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveMixin, runAgentChat, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, supportsLiveToolUpdates, touchSession, validateInputResponse, writeClaudeCodeCredentialsFile };
8828
+ //# sourceMappingURL=chunk-2KLW6K7T.js.map
8829
+ //# sourceMappingURL=chunk-2KLW6K7T.js.map