@skaile/workspaces 0.43.1 → 0.45.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 (163) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/dist/{asset-feeds-3PSV57NT.js → asset-feeds-AOZLZMDV.js} +15 -11
  3. package/dist/asset-feeds-AOZLZMDV.js.map +1 -0
  4. package/dist/asset-manager/index.js +5 -5
  5. package/dist/asset-manager/installer.js +4 -4
  6. package/dist/asset-manager/src/index.d.ts +149 -4
  7. package/dist/asset-manager/src/index.d.ts.map +1 -1
  8. package/dist/{chunk-KYQNWFJV.js → chunk-BLGHFVXE.js} +3 -3
  9. package/dist/{chunk-KYQNWFJV.js.map → chunk-BLGHFVXE.js.map} +1 -1
  10. package/dist/{chunk-R4H6EJW5.js → chunk-CBZEIFU4.js} +3 -3
  11. package/dist/{chunk-R4H6EJW5.js.map → chunk-CBZEIFU4.js.map} +1 -1
  12. package/dist/{chunk-GJI6FZ56.js → chunk-COSTF7QW.js} +60 -8
  13. package/dist/chunk-COSTF7QW.js.map +1 -0
  14. package/dist/{chunk-NYMRKIOR.js → chunk-CVWA4RIK.js} +4 -4
  15. package/dist/{chunk-NYMRKIOR.js.map → chunk-CVWA4RIK.js.map} +1 -1
  16. package/dist/{chunk-BXYMGZCI.js → chunk-ETDXTGDF.js} +3 -3
  17. package/dist/{chunk-BXYMGZCI.js.map → chunk-ETDXTGDF.js.map} +1 -1
  18. package/dist/{chunk-TDSRLMDB.js → chunk-EVZKWY5J.js} +2 -2
  19. package/dist/chunk-EVZKWY5J.js.map +1 -0
  20. package/dist/{chunk-3HUUP3JC.js → chunk-FYLIR4AV.js} +107 -7
  21. package/dist/chunk-FYLIR4AV.js.map +1 -0
  22. package/dist/{chunk-G6FJZG4C.js → chunk-GM3BV6JK.js} +2 -2
  23. package/dist/{chunk-G6FJZG4C.js.map → chunk-GM3BV6JK.js.map} +1 -1
  24. package/dist/{chunk-R4YUZRGF.js → chunk-JUZGLINM.js} +2 -2
  25. package/dist/{chunk-R4YUZRGF.js.map → chunk-JUZGLINM.js.map} +1 -1
  26. package/dist/{chunk-WKZ5R4NP.js → chunk-L6BKSTAX.js} +332 -38
  27. package/dist/chunk-L6BKSTAX.js.map +1 -0
  28. package/dist/{chunk-WRDHUTOK.js → chunk-LHUCCPH4.js} +5 -5
  29. package/dist/{chunk-WRDHUTOK.js.map → chunk-LHUCCPH4.js.map} +1 -1
  30. package/dist/{chunk-U2XHHLE3.js → chunk-LMRO2QNF.js} +5 -5
  31. package/dist/{chunk-U2XHHLE3.js.map → chunk-LMRO2QNF.js.map} +1 -1
  32. package/dist/{chunk-N4FSBCLV.js → chunk-N2KV5RK3.js} +127 -10
  33. package/dist/chunk-N2KV5RK3.js.map +1 -0
  34. package/dist/{chunk-CIEKKLMG.js → chunk-PCXU2CVW.js} +3 -3
  35. package/dist/{chunk-CIEKKLMG.js.map → chunk-PCXU2CVW.js.map} +1 -1
  36. package/dist/{chunk-HVCZLD5Z.js → chunk-VPXV2Z5E.js} +5 -7
  37. package/dist/chunk-VPXV2Z5E.js.map +1 -0
  38. package/dist/{chunk-2BEDUMTA.js → chunk-XF2BBX6P.js} +3 -3
  39. package/dist/{chunk-2BEDUMTA.js.map → chunk-XF2BBX6P.js.map} +1 -1
  40. package/dist/{chunk-3K2CYDBT.js → chunk-Z5Z3MYDL.js} +8 -4
  41. package/dist/chunk-Z5Z3MYDL.js.map +1 -0
  42. package/dist/{chunk-M54RYUXY.js → chunk-ZAEJ33Y6.js} +19 -7
  43. package/dist/chunk-ZAEJ33Y6.js.map +1 -0
  44. package/dist/cli/index.js +969 -572
  45. package/dist/cli/index.js.map +1 -1
  46. package/dist/cli/src/asset-feeds.d.ts.map +1 -1
  47. package/dist/cli/src/commands/asset-cmd.d.ts +1 -1
  48. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  49. package/dist/cli/src/commands/cache.d.ts +27 -0
  50. package/dist/cli/src/commands/cache.d.ts.map +1 -0
  51. package/dist/cli/src/commands/catalog.d.ts +9 -3
  52. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  53. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  54. package/dist/cli/src/commands/manage.d.ts.map +1 -1
  55. package/dist/cli/src/commands/npx.d.ts +1 -1
  56. package/dist/cli/src/commands/skailify-lib.d.ts +108 -0
  57. package/dist/cli/src/commands/skailify-lib.d.ts.map +1 -0
  58. package/dist/cli/src/commands/source.d.ts +3 -1
  59. package/dist/cli/src/commands/source.d.ts.map +1 -1
  60. package/dist/cli/src/commands/update.d.ts +1 -1
  61. package/dist/cli/src/ensure-sources.d.ts +2 -2
  62. package/dist/cli/src/ensure-sources.d.ts.map +1 -1
  63. package/dist/connectors/config.js +4 -4
  64. package/dist/connectors/index.js +6 -6
  65. package/dist/connectors/rclone.js +1 -1
  66. package/dist/connectors/src/rclone-process-manager.d.ts +57 -2
  67. package/dist/connectors/src/rclone-process-manager.d.ts.map +1 -1
  68. package/dist/core/index.js +3 -3
  69. package/dist/core/runtime-assets.js +2 -2
  70. package/dist/core/src/cache-paths.d.ts +25 -0
  71. package/dist/core/src/cache-paths.d.ts.map +1 -0
  72. package/dist/core/src/index.d.ts +2 -1
  73. package/dist/core/src/index.d.ts.map +1 -1
  74. package/dist/core/src/repo-manager.d.ts +11 -8
  75. package/dist/core/src/repo-manager.d.ts.map +1 -1
  76. package/dist/core/src/runtime-assets.d.ts.map +1 -1
  77. package/dist/core/src/workspace-config.d.ts +2 -2
  78. package/dist/core/src/workspace-config.d.ts.map +1 -1
  79. package/dist/core/workspace-config.js +1 -1
  80. package/dist/deploy/index.js +3 -3
  81. package/dist/{ensure-sources-VQDZB7NT.js → ensure-sources-NSDMTAWN.js} +6 -12
  82. package/dist/ensure-sources-NSDMTAWN.js.map +1 -0
  83. package/dist/factory-assets/connectors/deploy.js +6 -6
  84. package/dist/factory-assets/connectors/devserver.js +6 -6
  85. package/dist/factory-assets/connectors/flow/adapter.js +6 -6
  86. package/dist/factory-assets/connectors/flow/engine.js +3 -3
  87. package/dist/factory-assets/connectors/flow/run-flow.js +7 -7
  88. package/dist/factory-assets/connectors/flow.js +6 -6
  89. package/dist/factory-assets/connectors/git.js +6 -6
  90. package/dist/factory-assets/connectors/gmail.js +6 -6
  91. package/dist/factory-assets/connectors/googledrive.js +6 -6
  92. package/dist/factory-assets/connectors/local.js +6 -6
  93. package/dist/factory-assets/connectors/mattermost.js +6 -6
  94. package/dist/factory-assets/connectors/memory.js +6 -6
  95. package/dist/factory-assets/connectors/minio.js +6 -6
  96. package/dist/factory-assets/connectors/postgres.js +6 -6
  97. package/dist/factory-assets/connectors/s3.js +6 -6
  98. package/dist/factory-assets/connectors/sharepoint.js +6 -6
  99. package/dist/factory-assets/connectors/sqlite.js +6 -6
  100. package/dist/factory-assets/connectors/static-server.js +6 -6
  101. package/dist/factory-assets/connectors/tunnel.js +6 -6
  102. package/dist/factory-assets/connectors/webdav.js +6 -6
  103. package/dist/factory-assets/connectors/xstate-store.js +6 -6
  104. package/dist/factory-assets/connectors/xstate.js +6 -6
  105. package/dist/factory-assets/skaile.manifest.yaml +3 -0
  106. package/dist/factory-assets/skills/skailify/SKILL.md +84 -0
  107. package/dist/{flows-KTBCZ5GQ.js → flows-WELXQ7IG.js} +3 -3
  108. package/dist/{flows-KTBCZ5GQ.js.map → flows-WELXQ7IG.js.map} +1 -1
  109. package/dist/library/index.js +4 -4
  110. package/dist/library/install.js +3 -3
  111. package/dist/library/src/local/local-catalog-source.d.ts +1 -1
  112. package/dist/library/src/local/sidecar-git.d.ts +2 -2
  113. package/dist/library/src/local/sidecar-paths.d.ts +12 -10
  114. package/dist/library/src/local/sidecar-paths.d.ts.map +1 -1
  115. package/dist/library/src/local/store-paths.d.ts +2 -2
  116. package/dist/library/src/remote/cache.d.ts +8 -2
  117. package/dist/library/src/remote/cache.d.ts.map +1 -1
  118. package/dist/library/src/remote/remote-catalog-source.d.ts +1 -1
  119. package/dist/library/src/remote/rest-catalog-source.d.ts +1 -1
  120. package/dist/{open-library-FHUXOCN7.js → open-library-362BZ6OW.js} +7 -7
  121. package/dist/{open-library-FHUXOCN7.js.map → open-library-362BZ6OW.js.map} +1 -1
  122. package/dist/{paths-7H5CSBLQ.js → paths-4SSFMX5Z.js} +6 -6
  123. package/dist/{paths-7H5CSBLQ.js.map → paths-4SSFMX5Z.js.map} +1 -1
  124. package/dist/{plugin-store-LGLN2QUX.js → plugin-store-2X2YXJVG.js} +5 -5
  125. package/dist/{plugin-store-LGLN2QUX.js.map → plugin-store-2X2YXJVG.js.map} +1 -1
  126. package/dist/runner/index.js +9 -9
  127. package/dist/runner/src/file-changed-coalescer.d.ts +48 -0
  128. package/dist/runner/src/file-changed-coalescer.d.ts.map +1 -0
  129. package/dist/runner/src/resources.d.ts.map +1 -1
  130. package/dist/sdk/asset-manager.js +5 -5
  131. package/dist/sdk/core.js +3 -3
  132. package/dist/sdk/flow.js +3 -3
  133. package/dist/sdk/index.js +9 -9
  134. package/dist/sdk/runner.js +9 -9
  135. package/dist/sdk/session.js +2 -2
  136. package/dist/sdk/types.js +1 -1
  137. package/dist/session/index.js +2 -2
  138. package/dist/session/src/index.d.ts +1 -1
  139. package/dist/session/src/index.d.ts.map +1 -1
  140. package/dist/session/src/mentions.d.ts +11 -0
  141. package/dist/session/src/mentions.d.ts.map +1 -1
  142. package/dist/{setup-EVNPECSY.js → setup-VGZTFQ32.js} +5 -5
  143. package/dist/{setup-EVNPECSY.js.map → setup-VGZTFQ32.js.map} +1 -1
  144. package/dist/{store-client-4XN7IB3R.js → store-client-XFZFKY3W.js} +6 -6
  145. package/dist/{store-client-4XN7IB3R.js.map → store-client-XFZFKY3W.js.map} +1 -1
  146. package/dist/tui/index.js +9 -9
  147. package/dist/types/index.js +1 -1
  148. package/dist/types/src/mentions.d.ts +12 -0
  149. package/dist/types/src/mentions.d.ts.map +1 -1
  150. package/dist/workspace-plugin/adapters/mcp.js +1 -1
  151. package/dist/workspace-plugin/adapters/omp.js +3 -3
  152. package/dist/workspace-plugin/index.js +1 -1
  153. package/package.json +1 -1
  154. package/dist/asset-feeds-3PSV57NT.js.map +0 -1
  155. package/dist/chunk-3HUUP3JC.js.map +0 -1
  156. package/dist/chunk-3K2CYDBT.js.map +0 -1
  157. package/dist/chunk-GJI6FZ56.js.map +0 -1
  158. package/dist/chunk-HVCZLD5Z.js.map +0 -1
  159. package/dist/chunk-M54RYUXY.js.map +0 -1
  160. package/dist/chunk-N4FSBCLV.js.map +0 -1
  161. package/dist/chunk-TDSRLMDB.js.map +0 -1
  162. package/dist/chunk-WKZ5R4NP.js.map +0 -1
  163. package/dist/ensure-sources-VQDZB7NT.js.map +0 -1
@@ -1,17 +1,17 @@
1
- import { WorkspacePlugin } from './chunk-R4YUZRGF.js';
1
+ import { WorkspacePlugin } from './chunk-JUZGLINM.js';
2
2
  import { WebSocketServerTransport } from './chunk-WQ7DE5UC.js';
3
3
  import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
4
- import { PROTOCOL_VERSION } from './chunk-TDSRLMDB.js';
4
+ import { PROTOCOL_VERSION } from './chunk-EVZKWY5J.js';
5
5
  import { EventNormalizer } from './chunk-5C3QJSOD.js';
6
6
  import { classifyClaudeSdkError } from './chunk-GAH4YRCI.js';
7
7
  import { createDriver } from './chunk-OCAQH66V.js';
8
8
  import { deployCatalogEntry, undeployCatalogEntry } from './chunk-LV2HPH3C.js';
9
- import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools } from './chunk-U2XHHLE3.js';
10
- import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, deriveSingleMaterializedConnectorDeclaration } from './chunk-R4H6EJW5.js';
9
+ import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools } from './chunk-LMRO2QNF.js';
10
+ import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, deriveSingleMaterializedConnectorDeclaration } from './chunk-CBZEIFU4.js';
11
11
  import { renderStimulusPrompt, buildOrchestratorPrompt } from './chunk-DEYYRFQU.js';
12
- import { resolveSettings, resolveApiKey, providerEnvKey } from './chunk-KYQNWFJV.js';
13
- import { resolveRuntimeAssets } from './chunk-HVCZLD5Z.js';
14
- import { resolveSkWorkspaceConfig, resolveAgentDir, stageMaterializedSkills, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration } from './chunk-GJI6FZ56.js';
12
+ import { resolveSettings, resolveApiKey, providerEnvKey } from './chunk-BLGHFVXE.js';
13
+ import { resolveRuntimeAssets } from './chunk-VPXV2Z5E.js';
14
+ import { resolveSkWorkspaceConfig, resolveAgentDir, stageMaterializedSkills, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration } from './chunk-COSTF7QW.js';
15
15
  import { parseAssetRef } from './chunk-GEEW6SY2.js';
16
16
  import { resolveDriverPaths } from './chunk-K5GBV4SA.js';
17
17
  import { getLogStore, resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink, registerLogStore, resetLogStore, createLogger } from './chunk-JB35MVBN.js';
@@ -728,6 +728,115 @@ async function loadAgentManifest(agentDir) {
728
728
  return void 0;
729
729
  }
730
730
  }
731
+
732
+ // runner/src/file-changed-coalescer.ts
733
+ var DEFAULT_WINDOW_MS = 1e3;
734
+ var DEFAULT_THRESHOLD = 50;
735
+ var DEFAULT_MAX_DIRS = 256;
736
+ function isStructuralAction(action) {
737
+ return action === "create" || action === "delete";
738
+ }
739
+ function parentDirOf(path5) {
740
+ return path5.includes("/") ? path5.slice(0, path5.lastIndexOf("/")) : "";
741
+ }
742
+ var FileChangedCoalescer = class {
743
+ windowMs;
744
+ threshold;
745
+ maxDirs;
746
+ emit;
747
+ now;
748
+ log;
749
+ states = /* @__PURE__ */ new Map();
750
+ constructor(emit, options, now = Date.now, log = (m) => console.warn(m)) {
751
+ this.emit = emit;
752
+ this.windowMs = options?.windowMs ?? DEFAULT_WINDOW_MS;
753
+ this.threshold = options?.threshold ?? DEFAULT_THRESHOLD;
754
+ this.maxDirs = options?.maxDirs ?? DEFAULT_MAX_DIRS;
755
+ this.now = now;
756
+ this.log = log;
757
+ }
758
+ push(mountId, event) {
759
+ const t = this.now();
760
+ let state = this.states.get(mountId);
761
+ if (!state) {
762
+ state = {
763
+ lastEvent: t,
764
+ count: 0,
765
+ bursting: false,
766
+ dirs: /* @__PURE__ */ new Map(),
767
+ dirCapHit: false,
768
+ timer: null
769
+ };
770
+ this.states.set(mountId, state);
771
+ }
772
+ if (t - state.lastEvent > this.windowMs) {
773
+ this.flush(mountId, state);
774
+ state.count = 0;
775
+ }
776
+ state.lastEvent = t;
777
+ state.count += 1;
778
+ if (state.bursting) {
779
+ this.recordDir(state, event);
780
+ this.armFlush(mountId, state);
781
+ return;
782
+ }
783
+ if (state.count > this.threshold) {
784
+ state.bursting = true;
785
+ this.recordDir(state, event);
786
+ this.armFlush(mountId, state);
787
+ return;
788
+ }
789
+ this.emit(mountId, event);
790
+ }
791
+ /** Cancel timers and emit any pending representatives. Call on watcher teardown. */
792
+ dispose() {
793
+ for (const [mountId, state] of this.states) this.flush(mountId, state);
794
+ this.states.clear();
795
+ }
796
+ recordDir(state, event) {
797
+ const dir = parentDirOf(event.path);
798
+ let rep = state.dirs.get(dir);
799
+ if (!rep) {
800
+ if (state.dirs.size >= this.maxDirs) {
801
+ state.dirCapHit = true;
802
+ return;
803
+ }
804
+ rep = { first: event, structural: null };
805
+ state.dirs.set(dir, rep);
806
+ }
807
+ if (!rep.structural && isStructuralAction(event.action)) {
808
+ rep.structural = event;
809
+ }
810
+ }
811
+ armFlush(mountId, state) {
812
+ if (state.timer) clearTimeout(state.timer);
813
+ state.timer = setTimeout(() => {
814
+ const s = this.states.get(mountId);
815
+ if (s) this.flush(mountId, s);
816
+ }, this.windowMs);
817
+ state.timer.unref?.();
818
+ }
819
+ flush(mountId, state) {
820
+ if (state.timer) {
821
+ clearTimeout(state.timer);
822
+ state.timer = null;
823
+ }
824
+ if (state.bursting && state.dirs.size > 0) {
825
+ for (const rep of state.dirs.values()) {
826
+ this.emit(mountId, rep.structural ?? rep.first);
827
+ }
828
+ if (state.dirCapHit) {
829
+ this.log(
830
+ `[file-changed-coalescer] mount ${mountId}: burst touched more than ${this.maxDirs} directories; emitted ${this.maxDirs} per-dir events + a root fallback`
831
+ );
832
+ this.emit(mountId, { path: "", action: "edit", source: "filesystem" });
833
+ }
834
+ }
835
+ state.bursting = false;
836
+ state.dirs.clear();
837
+ state.dirCapHit = false;
838
+ }
839
+ };
731
840
  var RecipeUnavailableError = class extends Error {
732
841
  constructor(flakeRef, attr, cause) {
733
842
  super(
@@ -1422,10 +1531,17 @@ async function buildAgentResources(projectDir, driverType, _onLog, watch, secret
1422
1531
  }
1423
1532
  if (!resourceManager && driverType !== "claude-sdk" && !externalMcpManager?.hasServers() && !capabilityRegistry)
1424
1533
  return noopResult;
1534
+ let coalescer = null;
1425
1535
  const startWatching = () => {
1426
1536
  if (resourceManager && watch?.onFileChanged) {
1427
1537
  const dedupTtlMs = watch.dedupTtlMs ?? 500;
1428
1538
  const recentlyEmitted = /* @__PURE__ */ new Map();
1539
+ coalescer = new FileChangedCoalescer(
1540
+ (mountId, event) => watch.onFileChanged(mountId, event),
1541
+ void 0,
1542
+ Date.now,
1543
+ (m) => resLog.warn(m)
1544
+ );
1429
1545
  resourceManager.watchAll((connectorId, event) => {
1430
1546
  const dedupKey = `${connectorId}:${event.path}`;
1431
1547
  const now = Date.now();
@@ -1437,11 +1553,12 @@ async function buildAgentResources(projectDir, driverType, _onLog, watch, secret
1437
1553
  if (now - ts > dedupTtlMs) recentlyEmitted.delete(key);
1438
1554
  }
1439
1555
  }
1440
- watch.onFileChanged(connectorId, event);
1556
+ coalescer.push(connectorId, event);
1441
1557
  });
1442
1558
  }
1443
1559
  };
1444
1560
  const dispose = async () => {
1561
+ coalescer?.dispose();
1445
1562
  try {
1446
1563
  await externalMcpManager?.dispose();
1447
1564
  } catch {
@@ -5603,5 +5720,5 @@ function touchSession(state) {
5603
5720
  }
5604
5721
 
5605
5722
  export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile };
5606
- //# sourceMappingURL=chunk-N4FSBCLV.js.map
5607
- //# sourceMappingURL=chunk-N4FSBCLV.js.map
5723
+ //# sourceMappingURL=chunk-N2KV5RK3.js.map
5724
+ //# sourceMappingURL=chunk-N2KV5RK3.js.map