@skaile/workspaces 4.9.3 → 4.10.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 (174) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-74HE5Q7W.js → asset-feeds-W24JZM36.js} +7 -7
  4. package/dist/{asset-feeds-74HE5Q7W.js.map → asset-feeds-W24JZM36.js.map} +1 -1
  5. package/dist/asset-manager/catalog-deployer.js +3 -3
  6. package/dist/asset-manager/index.js +6 -6
  7. package/dist/asset-manager/installer.js +4 -4
  8. package/dist/bridge/drivers/claude-sdk.js +7 -7
  9. package/dist/bridge/drivers/codex.js +5 -5
  10. package/dist/bridge/drivers/continue.js +6 -6
  11. package/dist/bridge/drivers/echo.js +3 -3
  12. package/dist/bridge/drivers/gemini.js +4 -4
  13. package/dist/bridge/drivers/goose.js +6 -6
  14. package/dist/bridge/drivers/omp.js +1 -1
  15. package/dist/bridge/drivers/opencode.js +6 -6
  16. package/dist/bridge/drivers/qwen.js +4 -4
  17. package/dist/bridge/index.js +8 -8
  18. package/dist/{chunk-3GKBSHUG.js → chunk-35PMOWAD.js} +3 -3
  19. package/dist/{chunk-3GKBSHUG.js.map → chunk-35PMOWAD.js.map} +1 -1
  20. package/dist/{chunk-7ZWLVXQN.js → chunk-37PUZERM.js} +2 -2
  21. package/dist/{chunk-7ZWLVXQN.js.map → chunk-37PUZERM.js.map} +1 -1
  22. package/dist/{chunk-LDQB5VEC.js → chunk-3T5DRUNZ.js} +2 -2
  23. package/dist/{chunk-LDQB5VEC.js.map → chunk-3T5DRUNZ.js.map} +1 -1
  24. package/dist/{chunk-WPW5XS6I.js → chunk-3YTFHHMI.js} +2 -2
  25. package/dist/{chunk-WPW5XS6I.js.map → chunk-3YTFHHMI.js.map} +1 -1
  26. package/dist/{chunk-6L2WH2LS.js → chunk-5D5MCO4L.js} +9 -9
  27. package/dist/{chunk-6L2WH2LS.js.map → chunk-5D5MCO4L.js.map} +1 -1
  28. package/dist/{chunk-FTSXFA7P.js → chunk-6XKQEDF7.js} +5 -5
  29. package/dist/{chunk-FTSXFA7P.js.map → chunk-6XKQEDF7.js.map} +1 -1
  30. package/dist/{chunk-VLRP35H4.js → chunk-7J4YIVKJ.js} +7 -7
  31. package/dist/{chunk-VLRP35H4.js.map → chunk-7J4YIVKJ.js.map} +1 -1
  32. package/dist/{chunk-2LT4CWA5.js → chunk-7ZJXFQ42.js} +3 -3
  33. package/dist/{chunk-2LT4CWA5.js.map → chunk-7ZJXFQ42.js.map} +1 -1
  34. package/dist/{chunk-7LHSC2DS.js → chunk-A3X4LDOD.js} +4 -4
  35. package/dist/{chunk-7LHSC2DS.js.map → chunk-A3X4LDOD.js.map} +1 -1
  36. package/dist/{chunk-YCIW4YOT.js → chunk-BXV6RLF4.js} +3 -3
  37. package/dist/{chunk-YCIW4YOT.js.map → chunk-BXV6RLF4.js.map} +1 -1
  38. package/dist/{chunk-RL7O3OZQ.js → chunk-BZ7GHZ2J.js} +5 -5
  39. package/dist/{chunk-RL7O3OZQ.js.map → chunk-BZ7GHZ2J.js.map} +1 -1
  40. package/dist/{chunk-AF3ETSXF.js → chunk-CJXSTOGW.js} +4 -4
  41. package/dist/{chunk-AF3ETSXF.js.map → chunk-CJXSTOGW.js.map} +1 -1
  42. package/dist/{chunk-O33RRDO5.js → chunk-CSS3HHQ6.js} +7 -7
  43. package/dist/{chunk-O33RRDO5.js.map → chunk-CSS3HHQ6.js.map} +1 -1
  44. package/dist/{chunk-JU736VOI.js → chunk-CTQ4G3UY.js} +229 -43
  45. package/dist/chunk-CTQ4G3UY.js.map +1 -0
  46. package/dist/{chunk-XEWX4V7T.js → chunk-DIQVQT5C.js} +4 -4
  47. package/dist/{chunk-XEWX4V7T.js.map → chunk-DIQVQT5C.js.map} +1 -1
  48. package/dist/{chunk-LMS54WVA.js → chunk-EUWEMCYO.js} +4 -4
  49. package/dist/{chunk-LMS54WVA.js.map → chunk-EUWEMCYO.js.map} +1 -1
  50. package/dist/{chunk-P2G6XSJ3.js → chunk-HO4UO25I.js} +4 -2
  51. package/dist/chunk-HO4UO25I.js.map +1 -0
  52. package/dist/{chunk-KQTMJP3X.js → chunk-IECQMSQ5.js} +3 -3
  53. package/dist/{chunk-KQTMJP3X.js.map → chunk-IECQMSQ5.js.map} +1 -1
  54. package/dist/{chunk-GFU367UH.js → chunk-JECDED7B.js} +4 -4
  55. package/dist/{chunk-GFU367UH.js.map → chunk-JECDED7B.js.map} +1 -1
  56. package/dist/{chunk-2KVFAWUA.js → chunk-LFW2SH54.js} +3 -3
  57. package/dist/{chunk-2KVFAWUA.js.map → chunk-LFW2SH54.js.map} +1 -1
  58. package/dist/{chunk-JUZJUKWM.js → chunk-MMLXSVQ3.js} +3 -3
  59. package/dist/{chunk-JUZJUKWM.js.map → chunk-MMLXSVQ3.js.map} +1 -1
  60. package/dist/{chunk-R4OMDCGZ.js → chunk-NQ3OMJFK.js} +3 -3
  61. package/dist/{chunk-R4OMDCGZ.js.map → chunk-NQ3OMJFK.js.map} +1 -1
  62. package/dist/{chunk-AOE4KOMJ.js → chunk-O3DHAGBO.js} +3 -3
  63. package/dist/{chunk-AOE4KOMJ.js.map → chunk-O3DHAGBO.js.map} +1 -1
  64. package/dist/{chunk-QAH24E5U.js → chunk-O64WU6WS.js} +4 -4
  65. package/dist/{chunk-QAH24E5U.js.map → chunk-O64WU6WS.js.map} +1 -1
  66. package/dist/{chunk-XZYZOCPK.js → chunk-OE2OMMOX.js} +5 -5
  67. package/dist/{chunk-XZYZOCPK.js.map → chunk-OE2OMMOX.js.map} +1 -1
  68. package/dist/{chunk-LN4M7WMX.js → chunk-QV36ENWE.js} +295 -38
  69. package/dist/chunk-QV36ENWE.js.map +1 -0
  70. package/dist/{chunk-WXECUQC6.js → chunk-ULX3R5PV.js} +6 -6
  71. package/dist/{chunk-WXECUQC6.js.map → chunk-ULX3R5PV.js.map} +1 -1
  72. package/dist/{chunk-F4PCBWPB.js → chunk-UXUDNBJM.js} +3 -3
  73. package/dist/{chunk-F4PCBWPB.js.map → chunk-UXUDNBJM.js.map} +1 -1
  74. package/dist/{chunk-ZVYWMD6Q.js → chunk-VLXODO37.js} +4 -4
  75. package/dist/{chunk-ZVYWMD6Q.js.map → chunk-VLXODO37.js.map} +1 -1
  76. package/dist/{chunk-UM4LDXV5.js → chunk-WILO77HE.js} +3 -3
  77. package/dist/{chunk-UM4LDXV5.js.map → chunk-WILO77HE.js.map} +1 -1
  78. package/dist/{chunk-S4RYZDBB.js → chunk-WXB6YEHZ.js} +3 -3
  79. package/dist/{chunk-S4RYZDBB.js.map → chunk-WXB6YEHZ.js.map} +1 -1
  80. package/dist/{chunk-SDNGG6FB.js → chunk-YZSMZK37.js} +3 -3
  81. package/dist/{chunk-SDNGG6FB.js.map → chunk-YZSMZK37.js.map} +1 -1
  82. package/dist/cli/index.js +52 -52
  83. package/dist/connectors/config.js +4 -4
  84. package/dist/connectors/index.js +12 -12
  85. package/dist/connectors-shared/index.js +2 -2
  86. package/dist/core/index.js +3 -3
  87. package/dist/core/runtime-assets.js +2 -2
  88. package/dist/core/src/index.d.ts +1 -1
  89. package/dist/core/src/index.d.ts.map +1 -1
  90. package/dist/core/src/workspace-config.d.ts +50 -0
  91. package/dist/core/src/workspace-config.d.ts.map +1 -1
  92. package/dist/core/workspace-config.js +1 -1
  93. package/dist/deploy/index.js +3 -3
  94. package/dist/{ensure-sources-VTIIEJBO.js → ensure-sources-5ZYEU4BE.js} +9 -9
  95. package/dist/{ensure-sources-VTIIEJBO.js.map → ensure-sources-5ZYEU4BE.js.map} +1 -1
  96. package/dist/factory-assets/connectors/box.js +12 -12
  97. package/dist/factory-assets/connectors/deploy.js +12 -12
  98. package/dist/factory-assets/connectors/devserver.js +12 -12
  99. package/dist/factory-assets/connectors/flow/adapter.js +12 -12
  100. package/dist/factory-assets/connectors/flow/engine.js +4 -4
  101. package/dist/factory-assets/connectors/flow/run-flow.js +13 -13
  102. package/dist/factory-assets/connectors/flow.js +12 -12
  103. package/dist/factory-assets/connectors/git/CONNECTOR.md +7 -1
  104. package/dist/factory-assets/connectors/git/driver.d.ts +60 -10
  105. package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
  106. package/dist/factory-assets/connectors/git.js +12 -12
  107. package/dist/factory-assets/connectors/gmail.js +12 -12
  108. package/dist/factory-assets/connectors/googledrive.js +12 -12
  109. package/dist/factory-assets/connectors/local.js +12 -12
  110. package/dist/factory-assets/connectors/mattermost.js +12 -12
  111. package/dist/factory-assets/connectors/memory.js +12 -12
  112. package/dist/factory-assets/connectors/minio.js +12 -12
  113. package/dist/factory-assets/connectors/postgres.js +12 -12
  114. package/dist/factory-assets/connectors/s3.js +12 -12
  115. package/dist/factory-assets/connectors/sharepoint.js +12 -12
  116. package/dist/factory-assets/connectors/sqlite.js +12 -12
  117. package/dist/factory-assets/connectors/static-server.js +12 -12
  118. package/dist/factory-assets/connectors/tunnel.js +12 -12
  119. package/dist/factory-assets/connectors/webdav.js +12 -12
  120. package/dist/factory-assets/connectors/xstate-store.js +12 -12
  121. package/dist/factory-assets/connectors/xstate.js +12 -12
  122. package/dist/{flows-SYYQDDCT.js → flows-H6FL4NZU.js} +6 -6
  123. package/dist/{flows-SYYQDDCT.js.map → flows-H6FL4NZU.js.map} +1 -1
  124. package/dist/{helpers-JJ4OLUVW.js → helpers-4SAB547F.js} +9 -9
  125. package/dist/{helpers-JJ4OLUVW.js.map → helpers-4SAB547F.js.map} +1 -1
  126. package/dist/library/index.js +4 -4
  127. package/dist/library/install.js +3 -3
  128. package/dist/{library-publish-IA76SB6X.js → library-publish-GXIWW7NW.js} +13 -13
  129. package/dist/{library-publish-IA76SB6X.js.map → library-publish-GXIWW7NW.js.map} +1 -1
  130. package/dist/{open-library-F24FIE65.js → open-library-OOP3UQUP.js} +11 -11
  131. package/dist/{open-library-F24FIE65.js.map → open-library-OOP3UQUP.js.map} +1 -1
  132. package/dist/{paths-NHONUGUU.js → paths-RL6NZW5X.js} +6 -6
  133. package/dist/{paths-NHONUGUU.js.map → paths-RL6NZW5X.js.map} +1 -1
  134. package/dist/{plugin-store-4RALGK5S.js → plugin-store-ZTAJCMTY.js} +5 -5
  135. package/dist/{plugin-store-4RALGK5S.js.map → plugin-store-ZTAJCMTY.js.map} +1 -1
  136. package/dist/{project-OGJSXBAC.js → project-P27CJXPB.js} +10 -10
  137. package/dist/{project-OGJSXBAC.js.map → project-P27CJXPB.js.map} +1 -1
  138. package/dist/resolver/index.js +3 -3
  139. package/dist/runner/index.js +17 -17
  140. package/dist/runner/src/assistant-home.d.ts +86 -0
  141. package/dist/runner/src/assistant-home.d.ts.map +1 -0
  142. package/dist/runner/src/session-builder.d.ts +1 -1
  143. package/dist/runner/src/session-builder.d.ts.map +1 -1
  144. package/dist/sdk/asset-manager.js +6 -6
  145. package/dist/sdk/bridge.js +8 -8
  146. package/dist/sdk/core.js +3 -3
  147. package/dist/sdk/flow.js +4 -4
  148. package/dist/sdk/index.js +17 -17
  149. package/dist/sdk/resolver.js +3 -3
  150. package/dist/sdk/runner.js +17 -17
  151. package/dist/sdk/session.js +2 -2
  152. package/dist/sdk/types.js +1 -1
  153. package/dist/session/index.js +2 -2
  154. package/dist/{setup-3IIIW3QM.js → setup-JNGNZTTP.js} +15 -15
  155. package/dist/{setup-3IIIW3QM.js.map → setup-JNGNZTTP.js.map} +1 -1
  156. package/dist/{skills-VUPPILR5.js → skills-Y6MU2NRI.js} +5 -5
  157. package/dist/{skills-VUPPILR5.js.map → skills-Y6MU2NRI.js.map} +1 -1
  158. package/dist/{source-HBEZDIWE.js → source-LOGTGPGJ.js} +12 -12
  159. package/dist/{source-HBEZDIWE.js.map → source-LOGTGPGJ.js.map} +1 -1
  160. package/dist/{source-manifest-publish-G7ZAYFMH.js → source-manifest-publish-PH2XMOLW.js} +14 -14
  161. package/dist/{source-manifest-publish-G7ZAYFMH.js.map → source-manifest-publish-PH2XMOLW.js.map} +1 -1
  162. package/dist/tui/index.js +17 -17
  163. package/dist/types/index.js +1 -1
  164. package/dist/types/src/events.d.ts +2 -2
  165. package/dist/types/src/events.d.ts.map +1 -1
  166. package/dist/types/src/version.d.ts +6 -1
  167. package/dist/types/src/version.d.ts.map +1 -1
  168. package/dist/workspace-plugin/adapters/mcp.js +6 -6
  169. package/dist/workspace-plugin/adapters/omp.js +7 -7
  170. package/dist/workspace-plugin/index.js +1 -1
  171. package/package.json +1 -1
  172. package/dist/chunk-JU736VOI.js.map +0 -1
  173. package/dist/chunk-LN4M7WMX.js.map +0 -1
  174. package/dist/chunk-P2G6XSJ3.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { logErr } from './chunk-2KVFAWUA.js';
2
- import { flowKindProvider } from './chunk-AOE4KOMJ.js';
3
- import { knowledgeKindProvider } from './chunk-7LHSC2DS.js';
1
+ import { logErr } from './chunk-LFW2SH54.js';
2
+ import { flowKindProvider } from './chunk-O3DHAGBO.js';
3
+ import { knowledgeKindProvider } from './chunk-A3X4LDOD.js';
4
4
  import { createDefaultRegistry } from './chunk-M5H4DWIA.js';
5
5
 
6
6
  // cli/src/open-registry.ts
@@ -103,5 +103,5 @@ async function openLibraryManager() {
103
103
  }
104
104
 
105
105
  export { LocalCatalogDisabledError, createFullRegistry, openCatalogSource, openLibrary, openLibraryManager, resolveCatalogSource };
106
- //# sourceMappingURL=chunk-XZYZOCPK.js.map
107
- //# sourceMappingURL=chunk-XZYZOCPK.js.map
106
+ //# sourceMappingURL=chunk-OE2OMMOX.js.map
107
+ //# sourceMappingURL=chunk-OE2OMMOX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/open-registry.ts","../cli/src/open-library.ts"],"names":["source"],"mappings":";;;;;;AA2BO,SAAS,kBAAA,GAAwC;AACtD,EAAA,MAAM,WAAW,qBAAA,EAAsB;AACvC,EAAA,QAAA,CAAS,SAAS,gBAAgB,CAAA;AAClC,EAAA,QAAA,CAAS,SAAS,qBAAqB,CAAA;AACvC,EAAA,OAAO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M,OAAA,CAAQ,OAAM,EAAE;AAC1D","file":"chunk-XZYZOCPK.js","sourcesContent":["/**\n * open-registry.ts — shared helper to create a full AssetKindRegistry.\n *\n * Bootstraps the registry with all built-in providers (9 core + preset)\n * from @skaile/discovery, plus the extension kind providers (flow from\n * @skaile/workspaces/factory-assets/connectors/flow/engine, knowledge from @skaile/library).\n *\n * This is the single registration point for the CLI. All code paths\n * that need a registry (source sync, lib-status, etc.) should use this.\n */\n\nimport type { AssetKindRegistry } from \"@skaile/workspaces/discovery\";\nimport { createDefaultRegistry } from \"@skaile/workspaces/discovery\";\nimport { flowKindProvider } from \"@skaile/workspaces/factory-assets/connectors/flow/engine\";\nimport { knowledgeKindProvider } from \"@skaile/workspaces/library\";\n\n/**\n * Create a fully-configured AssetKindRegistry with all known providers.\n *\n * Registers:\n * - 9 core kinds (skill, agent, connector, mount, mcp-server, contract, prompt, persona, ruleset)\n * - preset (composition entity)\n * - flow (extension, from @skaile/workspaces/factory-assets/connectors/flow/engine)\n * - knowledge (extension, from @skaile/library)\n *\n * @returns An unfrozen registry (auto-freezes on first read)\n */\nexport function createFullRegistry(): AssetKindRegistry {\n const registry = createDefaultRegistry();\n registry.register(flowKindProvider);\n registry.register(knowledgeKindProvider);\n return registry;\n}\n","/**\n * open-library.ts — shared helpers to open the LocalIndex and the configured\n * Catalog source.\n *\n * Lazy-loads the `@skaile/workspaces/library` subpath and returns the\n * LocalIndex instance (backed by `@libsql/client`; runs on Node and Bun).\n * The catalog-source helper reads\n * `~/.skaile/config.yaml` (and project-level overlay if `projectDir` is given)\n * to decide between {@link RemoteCatalogSource} (default — points at\n * `https://skaile.store`) and a {@link LocalCatalogSource} bound to the most\n * recent local library registered via `skaile source add`.\n */\n\nimport { logErr } from \"./helpers.ts\";\nimport { createFullRegistry } from \"./open-registry.ts\";\n\n/** Thrown by {@link openCatalogSource} when `catalog.url` is the `local` sentinel. */\nexport class LocalCatalogDisabledError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"LocalCatalogDisabledError\";\n }\n}\n\n/**\n * Open the LocalIndex with the full kind registry. Exits with code 1\n * if the library directory cannot be created.\n *\n * @returns A `LocalIndex` instance ready for use.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibrary() {\n try {\n const { LocalIndex } = await import(\"@skaile/workspaces/library\");\n return new LocalIndex({ kindRegistry: createFullRegistry() });\n } catch (err) {\n logErr(`Could not open LocalIndex: ${err instanceof Error ? err.message : String(err)}`);\n process.exit(1);\n }\n}\n\n/**\n * Resolve the configured **remote** Catalog source for the CLI.\n *\n * Reads `~/.skaile/config.yaml` (plus the optional project-level overlay) and\n * returns a {@link RemoteCatalogSource} pointing at `catalog.url` (default:\n * `https://skaile.store`). The `cache_ttl: 0` config flag flips the source\n * into air-gapped mode: network reads are disabled, only `skaile update`\n * performs refreshes.\n *\n * **Local-mode rejection.** If the resolved config has `catalog.url: local`\n * this helper throws — callers wanting the dispatched local-or-remote source\n * must use {@link resolveCatalogSource}. Remote-only consumers like\n * `skaile update --catalog-only` rely on this strict behaviour.\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A configured {@link RemoteCatalogSource}.\n * @throws When `catalog.url` is the `local` sentinel.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<\n | import(\"@skaile/workspaces/library\").RemoteCatalogSource\n | import(\"@skaile/workspaces/library\").RestCatalogSource\n> {\n const { resolveConfig, RemoteCatalogSource, RestCatalogSource, isLocalCatalogUrl } = await import(\n \"@skaile/workspaces/library\"\n );\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n if (isLocalCatalogUrl(baseUrl)) {\n throw new LocalCatalogDisabledError(\n \"catalog.url is set to 'local' — remote catalog is disabled. \" +\n \"Use `skaile source add <path>` + `skaile source sync` for local sources, \" +\n \"or set `catalog.url: https://skaile.store` in ~/.skaile/config.yaml.\",\n );\n }\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n if (cfg.catalog.framing === \"rest\") {\n return new RestCatalogSource({ baseUrl, cacheTtlMs });\n }\n return new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n}\n\n/**\n * Resolved catalog source plus a close handle for releasing any underlying\n * resources (e.g. the `LocalIndex` SQLite connection in local mode).\n *\n * Callers MUST invoke `close()` when done — typically in a `finally` block.\n * For remote-mode sources `close()` is a no-op, but the contract is uniform\n * so consumers don't have to branch.\n *\n * @docLink cli/dev-guide#open-library\n */\nexport interface ResolvedCatalogSource {\n /** The {@link ICatalogSource} ready for use. */\n source: import(\"@skaile/workspaces/library\").ICatalogSource;\n /** Release any underlying resources (SQLite handle in local mode). */\n close(): void;\n}\n\n/**\n * Resolve the configured Catalog source — local or remote — based on\n * `~/.skaile/config.yaml`.\n *\n * Dispatch:\n * - `catalog.url: local` → opens {@link LocalIndex}, picks the most recently\n * registered local library whose `path` still exists on disk, and returns a\n * {@link LocalCatalogSource} bound to that library. Throws if no usable\n * local library is registered.\n * - any URL → returns {@link RemoteCatalogSource} (same as\n * {@link openCatalogSource}).\n *\n * The returned `close()` releases the underlying `LocalIndex` SQLite handle\n * in local mode (no-op in remote mode). Callers MUST invoke it — typically in\n * a `finally` block — to satisfy `library/CLAUDE.md` § \"Notes for Consumers\".\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A `ResolvedCatalogSource` carrying the source and a close handle.\n * @throws When `local` is configured but no usable local library is registered.\n * @docLink cli/dev-guide#open-library\n */\nexport async function resolveCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<ResolvedCatalogSource> {\n const {\n resolveConfig,\n RemoteCatalogSource,\n RestCatalogSource,\n LocalCatalogSource,\n isLocalCatalogUrl,\n } = await import(\"@skaile/workspaces/library\");\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n\n if (isLocalCatalogUrl(baseUrl)) {\n const fs = await import(\"node:fs\");\n const library = await openLibrary();\n try {\n const sources = await library.listSources();\n type LibraryRow = (typeof sources)[number];\n // Type-narrow: `path` is required for local libraries after the filter.\n const usable = sources\n .filter(\n (s): s is LibraryRow & { path: string } =>\n s.backend === \"local\" && typeof s.path === \"string\" && s.path.length > 0,\n )\n .sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());\n\n if (usable.length === 0) {\n throw new Error(\n \"catalog.url is set to 'local' but no local library is registered. \" +\n \"Run `skaile source add <path>` first, then `skaile source sync`.\",\n );\n }\n\n // Prefer the most recently added library whose path still exists.\n const present = usable.find((s) => fs.existsSync(s.path));\n if (!present) {\n const head = usable[0];\n throw new Error(\n `catalog.url is set to 'local' but every registered local library has a missing path on disk. ` +\n `Most recent: ${head.path} (library ${head.id}). ` +\n `Re-register with \\`skaile source add <existing-path>\\` or run \\`skaile source list\\` to inspect.`,\n );\n }\n\n const source = new LocalCatalogSource(\n library,\n present.id,\n present.path,\n createFullRegistry(),\n );\n return { source, close: () => library.close() };\n } catch (err) {\n // Release the handle on any failure during dispatch — otherwise the\n // SQLite WAL state leaks for the lifetime of the process.\n library.close();\n throw err;\n }\n }\n\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n const source =\n cfg.catalog.framing === \"rest\"\n ? new RestCatalogSource({ baseUrl, cacheTtlMs })\n : new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n return { source, close: () => {} };\n}\n\n/**\n * Open the LibraryManager bound to the active LocalIndex.\n * Caller owns lifetime — must call `close()` (returned helper closes the\n * underlying LocalIndex).\n *\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibraryManager(): Promise<{\n manager: import(\"@skaile/workspaces/library\").LibraryManager;\n library: import(\"@skaile/workspaces/library\").LocalIndex;\n close: () => void;\n}> {\n const { LibraryManager } = await import(\"@skaile/workspaces/library\");\n const library = await openLibrary();\n const manager = new LibraryManager(library);\n return { manager, library, close: () => library.close() };\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/open-registry.ts","../cli/src/open-library.ts"],"names":["source"],"mappings":";;;;;;AA2BO,SAAS,kBAAA,GAAwC;AACtD,EAAA,MAAM,WAAW,qBAAA,EAAsB;AACvC,EAAA,QAAA,CAAS,SAAS,gBAAgB,CAAA;AAClC,EAAA,QAAA,CAAS,SAAS,qBAAqB,CAAA;AACvC,EAAA,OAAO,QAAA;AACT;;;ACfO,IAAM,yBAAA,GAAN,cAAwC,KAAA,CAAM;AAAA,EACnD,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,2BAAA;AAAA,EACd;AACF;AASA,eAAsB,WAAA,GAAc;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAM,OAAO,oBAA4B,CAAA;AAChE,IAAA,OAAO,IAAI,UAAA,CAAW,EAAE,YAAA,EAAc,kBAAA,IAAsB,CAAA;AAAA,EAC9D,SAAS,GAAA,EAAK;AACZ,IAAA,MAAA,CAAO,CAAA,2BAAA,EAA8B,eAAe,KAAA,GAAQ,GAAA,CAAI,UAAU,MAAA,CAAO,GAAG,CAAC,CAAA,CAAE,CAAA;AACvF,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF;AAqBA,eAAsB,kBAAkB,IAAA,EAQtC;AACA,EAAA,MAAM,EAAE,eAAe,mBAAA,EAAqB,iBAAA,EAAmB,mBAAkB,GAAI,MAAM,OACzF,oBACF,CAAA;AACA,EAAA,MAAM,MAAM,aAAA,CAAc;AAAA,IACxB,YAAY,IAAA,EAAM,UAAA;AAAA,IAClB,gBAAgB,IAAA,EAAM;AAAA,GACvB,CAAA;AACD,EAAA,MAAM,OAAA,GAAU,IA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AAS,YAAY,CAAA;AACrD,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,MAAM;AAAA,EAAC,CAAA,EAAE;AACnC;AASA,eAAsB,kBAAA,GAInB;AACD,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,MAAM,OAAO,oBAA4B,CAAA;AACpE,EAAA,MAAM,OAAA,GAAU,MAAM,WAAA,EAAY;AAClC,EAAA,MAAM,OAAA,GAAU,IAAI,cAAA,CAAe,OAAO,CAAA;AAC1C,EAAA,OAAO,EAAE,OAAA,EAAS,OAAA,EAAS,OAAO,MAAM,OAAA,CAAQ,OAAM,EAAE;AAC1D","file":"chunk-OE2OMMOX.js","sourcesContent":["/**\n * open-registry.ts — shared helper to create a full AssetKindRegistry.\n *\n * Bootstraps the registry with all built-in providers (9 core + preset)\n * from @skaile/discovery, plus the extension kind providers (flow from\n * @skaile/workspaces/factory-assets/connectors/flow/engine, knowledge from @skaile/library).\n *\n * This is the single registration point for the CLI. All code paths\n * that need a registry (source sync, lib-status, etc.) should use this.\n */\n\nimport type { AssetKindRegistry } from \"@skaile/workspaces/discovery\";\nimport { createDefaultRegistry } from \"@skaile/workspaces/discovery\";\nimport { flowKindProvider } from \"@skaile/workspaces/factory-assets/connectors/flow/engine\";\nimport { knowledgeKindProvider } from \"@skaile/workspaces/library\";\n\n/**\n * Create a fully-configured AssetKindRegistry with all known providers.\n *\n * Registers:\n * - 9 core kinds (skill, agent, connector, mount, mcp-server, contract, prompt, persona, ruleset)\n * - preset (composition entity)\n * - flow (extension, from @skaile/workspaces/factory-assets/connectors/flow/engine)\n * - knowledge (extension, from @skaile/library)\n *\n * @returns An unfrozen registry (auto-freezes on first read)\n */\nexport function createFullRegistry(): AssetKindRegistry {\n const registry = createDefaultRegistry();\n registry.register(flowKindProvider);\n registry.register(knowledgeKindProvider);\n return registry;\n}\n","/**\n * open-library.ts — shared helpers to open the LocalIndex and the configured\n * Catalog source.\n *\n * Lazy-loads the `@skaile/workspaces/library` subpath and returns the\n * LocalIndex instance (backed by `@libsql/client`; runs on Node and Bun).\n * The catalog-source helper reads\n * `~/.skaile/config.yaml` (and project-level overlay if `projectDir` is given)\n * to decide between {@link RemoteCatalogSource} (default — points at\n * `https://skaile.store`) and a {@link LocalCatalogSource} bound to the most\n * recent local library registered via `skaile source add`.\n */\n\nimport { logErr } from \"./helpers.ts\";\nimport { createFullRegistry } from \"./open-registry.ts\";\n\n/** Thrown by {@link openCatalogSource} when `catalog.url` is the `local` sentinel. */\nexport class LocalCatalogDisabledError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"LocalCatalogDisabledError\";\n }\n}\n\n/**\n * Open the LocalIndex with the full kind registry. Exits with code 1\n * if the library directory cannot be created.\n *\n * @returns A `LocalIndex` instance ready for use.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibrary() {\n try {\n const { LocalIndex } = await import(\"@skaile/workspaces/library\");\n return new LocalIndex({ kindRegistry: createFullRegistry() });\n } catch (err) {\n logErr(`Could not open LocalIndex: ${err instanceof Error ? err.message : String(err)}`);\n process.exit(1);\n }\n}\n\n/**\n * Resolve the configured **remote** Catalog source for the CLI.\n *\n * Reads `~/.skaile/config.yaml` (plus the optional project-level overlay) and\n * returns a {@link RemoteCatalogSource} pointing at `catalog.url` (default:\n * `https://skaile.store`). The `cache_ttl: 0` config flag flips the source\n * into air-gapped mode: network reads are disabled, only `skaile update`\n * performs refreshes.\n *\n * **Local-mode rejection.** If the resolved config has `catalog.url: local`\n * this helper throws — callers wanting the dispatched local-or-remote source\n * must use {@link resolveCatalogSource}. Remote-only consumers like\n * `skaile update --catalog-only` rely on this strict behaviour.\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A configured {@link RemoteCatalogSource}.\n * @throws When `catalog.url` is the `local` sentinel.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<\n | import(\"@skaile/workspaces/library\").RemoteCatalogSource\n | import(\"@skaile/workspaces/library\").RestCatalogSource\n> {\n const { resolveConfig, RemoteCatalogSource, RestCatalogSource, isLocalCatalogUrl } = await import(\n \"@skaile/workspaces/library\"\n );\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n if (isLocalCatalogUrl(baseUrl)) {\n throw new LocalCatalogDisabledError(\n \"catalog.url is set to 'local' — remote catalog is disabled. \" +\n \"Use `skaile source add <path>` + `skaile source sync` for local sources, \" +\n \"or set `catalog.url: https://skaile.store` in ~/.skaile/config.yaml.\",\n );\n }\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n if (cfg.catalog.framing === \"rest\") {\n return new RestCatalogSource({ baseUrl, cacheTtlMs });\n }\n return new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n}\n\n/**\n * Resolved catalog source plus a close handle for releasing any underlying\n * resources (e.g. the `LocalIndex` SQLite connection in local mode).\n *\n * Callers MUST invoke `close()` when done — typically in a `finally` block.\n * For remote-mode sources `close()` is a no-op, but the contract is uniform\n * so consumers don't have to branch.\n *\n * @docLink cli/dev-guide#open-library\n */\nexport interface ResolvedCatalogSource {\n /** The {@link ICatalogSource} ready for use. */\n source: import(\"@skaile/workspaces/library\").ICatalogSource;\n /** Release any underlying resources (SQLite handle in local mode). */\n close(): void;\n}\n\n/**\n * Resolve the configured Catalog source — local or remote — based on\n * `~/.skaile/config.yaml`.\n *\n * Dispatch:\n * - `catalog.url: local` → opens {@link LocalIndex}, picks the most recently\n * registered local library whose `path` still exists on disk, and returns a\n * {@link LocalCatalogSource} bound to that library. Throws if no usable\n * local library is registered.\n * - any URL → returns {@link RemoteCatalogSource} (same as\n * {@link openCatalogSource}).\n *\n * The returned `close()` releases the underlying `LocalIndex` SQLite handle\n * in local mode (no-op in remote mode). Callers MUST invoke it — typically in\n * a `finally` block — to satisfy `library/CLAUDE.md` § \"Notes for Consumers\".\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A `ResolvedCatalogSource` carrying the source and a close handle.\n * @throws When `local` is configured but no usable local library is registered.\n * @docLink cli/dev-guide#open-library\n */\nexport async function resolveCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<ResolvedCatalogSource> {\n const {\n resolveConfig,\n RemoteCatalogSource,\n RestCatalogSource,\n LocalCatalogSource,\n isLocalCatalogUrl,\n } = await import(\"@skaile/workspaces/library\");\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n\n if (isLocalCatalogUrl(baseUrl)) {\n const fs = await import(\"node:fs\");\n const library = await openLibrary();\n try {\n const sources = await library.listSources();\n type LibraryRow = (typeof sources)[number];\n // Type-narrow: `path` is required for local libraries after the filter.\n const usable = sources\n .filter(\n (s): s is LibraryRow & { path: string } =>\n s.backend === \"local\" && typeof s.path === \"string\" && s.path.length > 0,\n )\n .sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());\n\n if (usable.length === 0) {\n throw new Error(\n \"catalog.url is set to 'local' but no local library is registered. \" +\n \"Run `skaile source add <path>` first, then `skaile source sync`.\",\n );\n }\n\n // Prefer the most recently added library whose path still exists.\n const present = usable.find((s) => fs.existsSync(s.path));\n if (!present) {\n const head = usable[0];\n throw new Error(\n `catalog.url is set to 'local' but every registered local library has a missing path on disk. ` +\n `Most recent: ${head.path} (library ${head.id}). ` +\n `Re-register with \\`skaile source add <existing-path>\\` or run \\`skaile source list\\` to inspect.`,\n );\n }\n\n const source = new LocalCatalogSource(\n library,\n present.id,\n present.path,\n createFullRegistry(),\n );\n return { source, close: () => library.close() };\n } catch (err) {\n // Release the handle on any failure during dispatch — otherwise the\n // SQLite WAL state leaks for the lifetime of the process.\n library.close();\n throw err;\n }\n }\n\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n const source =\n cfg.catalog.framing === \"rest\"\n ? new RestCatalogSource({ baseUrl, cacheTtlMs })\n : new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n return { source, close: () => {} };\n}\n\n/**\n * Open the LibraryManager bound to the active LocalIndex.\n * Caller owns lifetime — must call `close()` (returned helper closes the\n * underlying LocalIndex).\n *\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibraryManager(): Promise<{\n manager: import(\"@skaile/workspaces/library\").LibraryManager;\n library: import(\"@skaile/workspaces/library\").LocalIndex;\n close: () => void;\n}> {\n const { LibraryManager } = await import(\"@skaile/workspaces/library\");\n const library = await openLibrary();\n const manager = new LibraryManager(library);\n return { manager, library, close: () => library.close() };\n}\n"]}
@@ -1,27 +1,27 @@
1
- import { WorkspacePlugin } from './chunk-7ZWLVXQN.js';
2
- import { buildWorkspaceToolDefs } from './chunk-XEWX4V7T.js';
1
+ import { WorkspacePlugin } from './chunk-37PUZERM.js';
2
+ import { buildWorkspaceToolDefs } from './chunk-DIQVQT5C.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-2HUQUTJ3.js';
7
- import { resolveFlowPath } from './chunk-WXECUQC6.js';
7
+ import { resolveFlowPath } from './chunk-ULX3R5PV.js';
8
8
  import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-7BUZQVRR.js';
9
- import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-JU736VOI.js';
10
- import { loadConnectorDeclarations, SecretProviderChain, ConnectorStartupError, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, isKnownSecretRef, deriveSingleMaterializedConnectorDeclaration } from './chunk-JUZJUKWM.js';
11
- import { EventNormalizer } from './chunk-ZVYWMD6Q.js';
9
+ import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-CTQ4G3UY.js';
10
+ import { loadConnectorDeclarations, SecretProviderChain, ConnectorStartupError, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, isKnownSecretRef, deriveSingleMaterializedConnectorDeclaration } from './chunk-MMLXSVQ3.js';
11
+ import { EventNormalizer } from './chunk-VLXODO37.js';
12
12
  import { probeResumeTranscript } from './chunk-OUJVFZWJ.js';
13
13
  import { CodexNativeStateUnavailable } from './chunk-LOO5CB5M.js';
14
- import { dispatchCapability } from './chunk-3GKBSHUG.js';
14
+ import { dispatchCapability } from './chunk-35PMOWAD.js';
15
15
  import { classifyClaudeSdkError } from './chunk-GAH4YRCI.js';
16
- import { createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv, AI_PROVIDER_PRESETS } from './chunk-LDQB5VEC.js';
17
- import { loadFlow } from './chunk-AOE4KOMJ.js';
16
+ import { createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv, AI_PROVIDER_PRESETS } from './chunk-3T5DRUNZ.js';
17
+ import { loadFlow } from './chunk-O3DHAGBO.js';
18
18
  import { parseFlowDefinition } from './chunk-REYJKU7T.js';
19
19
  import { renderStimulusPrompt } from './chunk-2D5BYAL6.js';
20
- import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-QAH24E5U.js';
21
- import { resolveSettings, loadProviderRegistry } from './chunk-GFU367UH.js';
22
- import { resolveRuntimeAssets } from './chunk-UM4LDXV5.js';
20
+ import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-O64WU6WS.js';
21
+ import { resolveSettings, loadProviderRegistry } from './chunk-JECDED7B.js';
22
+ import { resolveRuntimeAssets } from './chunk-WILO77HE.js';
23
23
  import { resolveDriverPaths } from './chunk-K5GBV4SA.js';
24
- import { resolveSkWorkspaceConfig, resolveAgentDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill } from './chunk-P2G6XSJ3.js';
24
+ import { resolveSkWorkspaceConfig, resolveAgentDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill } from './chunk-HO4UO25I.js';
25
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, resolveLogsRetention, enforceLogsRetention } from './chunk-3HKYCT2M.js';
@@ -32,7 +32,7 @@ import pc from 'picocolors';
32
32
  import path5, { join, resolve, relative, sep, isAbsolute, basename, dirname } from 'path';
33
33
  import { Marked } from 'marked';
34
34
  import { markedTerminal } from 'marked-terminal';
35
- import fs4, { readFile, readdir, lstat, stat, rm, unlink, mkdir, writeFile, realpath, rename, readlink, mkdtemp } from 'fs/promises';
35
+ import fs4, { readFile, readdir, lstat, stat, rm, unlink, mkdir, writeFile, realpath, rename, open, readlink, mkdtemp } from 'fs/promises';
36
36
  import { createHash, randomBytes, timingSafeEqual, randomUUID } from 'crypto';
37
37
  import { existsSync, lstatSync, realpathSync, readFileSync, mkdirSync, writeFileSync, watch, chmodSync, accessSync, constants } from 'fs';
38
38
  import { homedir } from 'os';
@@ -1017,16 +1017,16 @@ async function assertScopedTree(path6, root) {
1017
1017
  let remaining = 1e4;
1018
1018
  async function visit(entry) {
1019
1019
  if (--remaining < 0) throw new Error("CODEX_RESOURCE_SCOPE_INVALID");
1020
- let stat3;
1020
+ let stat4;
1021
1021
  try {
1022
- stat3 = await lstat(entry);
1022
+ stat4 = await lstat(entry);
1023
1023
  } catch (error) {
1024
1024
  if (error.code === "ENOENT") return;
1025
1025
  throw error;
1026
1026
  }
1027
- if (!contains(root, await realpath(entry)) || stat3.isSymbolicLink())
1027
+ if (!contains(root, await realpath(entry)) || stat4.isSymbolicLink())
1028
1028
  throw new Error("CODEX_RESOURCE_SCOPE_INVALID");
1029
- if (stat3.isDirectory())
1029
+ if (stat4.isDirectory())
1030
1030
  for (const child of await readdir(entry)) await visit(join(entry, child));
1031
1031
  }
1032
1032
  await visit(path6);
@@ -1138,6 +1138,255 @@ async function loadAgentManifest(agentDir) {
1138
1138
  return void 0;
1139
1139
  }
1140
1140
  }
1141
+ var DEFAULT_HOME_TAG = "SKAILE_HOME";
1142
+ var HOME_MAX_FILES = 16;
1143
+ var HOME_MAX_CHARS = 1e5;
1144
+ var HOME_READ_BYTES_PER_CHAR = 4;
1145
+ var TAG_PATTERN = /^[A-Z][A-Z0-9_]*$/;
1146
+ function isRecord(value) {
1147
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1148
+ }
1149
+ function homePathProblem(relPath) {
1150
+ if (typeof relPath !== "string" || relPath.length === 0) return "path must be a non-empty string";
1151
+ if (isAbsolute(relPath) || relPath.includes("\\") || relPath.includes("\0"))
1152
+ return "path must be relative and '/'-separated";
1153
+ for (const segment of relPath.split("/")) {
1154
+ if (segment.length === 0) return "path has an empty segment";
1155
+ if (segment.startsWith(".")) return "path segments must not start with '.'";
1156
+ }
1157
+ return void 0;
1158
+ }
1159
+ function resolveHomeConfig(raw) {
1160
+ if (!isRecord(raw)) return { problems: ["agent.home must be a mapping"] };
1161
+ const problems = [];
1162
+ let tag = DEFAULT_HOME_TAG;
1163
+ if (raw.tag !== void 0) {
1164
+ if (typeof raw.tag === "string" && TAG_PATTERN.test(raw.tag)) tag = raw.tag;
1165
+ else problems.push(`agent.home.tag must match ${TAG_PATTERN}; using ${DEFAULT_HOME_TAG}`);
1166
+ }
1167
+ let intro;
1168
+ if (raw.intro !== void 0) {
1169
+ if (typeof raw.intro === "string") intro = raw.intro.length > 0 ? raw.intro : void 0;
1170
+ else problems.push("agent.home.intro must be a string; omitted");
1171
+ }
1172
+ if (!Array.isArray(raw.files))
1173
+ return { problems: [...problems, "agent.home.files must be a list"] };
1174
+ if (raw.files.length > HOME_MAX_FILES)
1175
+ problems.push(
1176
+ `agent.home.files has ${raw.files.length} entries; only the first ${HOME_MAX_FILES} are used`
1177
+ );
1178
+ const files = [];
1179
+ const seen = /* @__PURE__ */ new Set();
1180
+ raw.files.slice(0, HOME_MAX_FILES).forEach((entry, index) => {
1181
+ const at = `agent.home.files[${index}]`;
1182
+ if (!isRecord(entry)) {
1183
+ problems.push(`${at} must be a mapping; ignored`);
1184
+ return;
1185
+ }
1186
+ const pathProblem = homePathProblem(entry.path);
1187
+ if (pathProblem) {
1188
+ problems.push(`${at}: ${pathProblem}; ignored`);
1189
+ return;
1190
+ }
1191
+ const path6 = entry.path;
1192
+ const maxChars = entry["max-chars"];
1193
+ if (typeof maxChars !== "number" || !Number.isInteger(maxChars) || maxChars < 1 || maxChars > HOME_MAX_CHARS) {
1194
+ problems.push(`${at}: max-chars must be an integer from 1 to ${HOME_MAX_CHARS}; ignored`);
1195
+ return;
1196
+ }
1197
+ const from = entry.from ?? "head";
1198
+ if (from !== "head" && from !== "tail") {
1199
+ problems.push(`${at}: from must be 'head' or 'tail'; ignored`);
1200
+ return;
1201
+ }
1202
+ let label = basename(path6).replace(/\.md$/, "");
1203
+ if (entry.label !== void 0) {
1204
+ if (typeof entry.label !== "string" || entry.label.length === 0 || /[\r\n]/.test(entry.label)) {
1205
+ problems.push(`${at}: label must be a one-line string; ignored`);
1206
+ return;
1207
+ }
1208
+ label = entry.label;
1209
+ }
1210
+ if (seen.has(path6)) {
1211
+ problems.push(`${at}: duplicate path ${path6}; ignored`);
1212
+ return;
1213
+ }
1214
+ seen.add(path6);
1215
+ files.push({ path: path6, label, maxChars, from });
1216
+ });
1217
+ return { tag, intro, files, problems };
1218
+ }
1219
+ function isWithin(root, target) {
1220
+ const rel = relative(root, target);
1221
+ return rel === "" || !rel.startsWith(`..${sep}`) && rel !== ".." && !isAbsolute(rel);
1222
+ }
1223
+ function errorCode(err) {
1224
+ const code = err?.code;
1225
+ if (typeof code === "string") return code;
1226
+ if (err?.name === "FsDeadlineError") return "FS_DEADLINE";
1227
+ return "UNKNOWN";
1228
+ }
1229
+ function errorMessage(err) {
1230
+ const message = err?.message;
1231
+ return typeof message === "string" ? message : String(err);
1232
+ }
1233
+ function createSafeHomeFileReader(deniedRoots = []) {
1234
+ return async (projectDir, relPath, maxBytes, from, timeoutMs) => {
1235
+ try {
1236
+ return await withFsDeadline(
1237
+ `read home file ${relPath}`,
1238
+ async () => {
1239
+ const root = await realpath(projectDir);
1240
+ const denied = await Promise.all(deniedRoots.map((d) => realpath(d).catch(() => d)));
1241
+ const absPath = join(root, ...relPath.split("/"));
1242
+ const handle = await open(
1243
+ absPath,
1244
+ constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0)
1245
+ );
1246
+ try {
1247
+ const opened = await handle.stat();
1248
+ if (!opened.isFile())
1249
+ return { status: "unreadable", code: "NOT_A_FILE", message: "not a regular file" };
1250
+ if (opened.nlink > 1)
1251
+ return {
1252
+ status: "unreadable",
1253
+ code: "HARDLINK",
1254
+ message: "file has more than one link"
1255
+ };
1256
+ const real = await realpath(absPath);
1257
+ if (!isWithin(root, real) || denied.some((d) => isWithin(d, real)))
1258
+ return {
1259
+ status: "unreadable",
1260
+ code: "OUTSIDE_PROJECT",
1261
+ message: "real path is outside the project root"
1262
+ };
1263
+ if (relative(root, real).split(sep).some((segment) => segment.startsWith(".")))
1264
+ return {
1265
+ status: "unreadable",
1266
+ code: "OUTSIDE_PROJECT",
1267
+ message: "real path enters a dot-directory"
1268
+ };
1269
+ const named = await stat(real);
1270
+ if (named.dev !== opened.dev || named.ino !== opened.ino)
1271
+ return {
1272
+ status: "unreadable",
1273
+ code: "PATH_CHANGED",
1274
+ message: "path changed during read"
1275
+ };
1276
+ const length = Math.min(opened.size, maxBytes);
1277
+ const buf = Buffer.alloc(length);
1278
+ const start = from === "tail" ? opened.size - length : 0;
1279
+ let bytesRead = 0;
1280
+ while (bytesRead < length) {
1281
+ const chunk = await handle.read(
1282
+ buf,
1283
+ bytesRead,
1284
+ length - bytesRead,
1285
+ start + bytesRead
1286
+ );
1287
+ if (chunk.bytesRead === 0) break;
1288
+ bytesRead += chunk.bytesRead;
1289
+ }
1290
+ if (length > 0 && bytesRead === 0)
1291
+ return {
1292
+ status: "unreadable",
1293
+ code: "SHORT_READ",
1294
+ message: `read 0 of ${length} bytes`
1295
+ };
1296
+ return { status: "read", content: buf.subarray(0, bytesRead).toString("utf8") };
1297
+ } finally {
1298
+ await handle.close().catch(() => void 0);
1299
+ }
1300
+ },
1301
+ timeoutMs
1302
+ );
1303
+ } catch (err) {
1304
+ if (errorCode(err) === "ENOENT") return { status: "absent" };
1305
+ return { status: "unreadable", code: errorCode(err), message: errorMessage(err) };
1306
+ }
1307
+ };
1308
+ }
1309
+ function capHead(text2, max) {
1310
+ return text2.length <= max ? text2 : text2.slice(0, max);
1311
+ }
1312
+ function capTail(text2, max) {
1313
+ return text2.length <= max ? text2 : text2.slice(text2.length - max);
1314
+ }
1315
+ var warnedConfigProblems = /* @__PURE__ */ new Set();
1316
+ function warnOnce(log, problem) {
1317
+ if (warnedConfigProblems.has(problem)) return;
1318
+ warnedConfigProblems.add(problem);
1319
+ log.warn(problem);
1320
+ }
1321
+ async function buildHomeSection(raw, projectDir, opts = {}) {
1322
+ if (raw === void 0 || raw === null) return void 0;
1323
+ const log = opts.log ?? createLogger({ kind: "runner", subkind: "home" });
1324
+ const config = resolveHomeConfig(raw);
1325
+ for (const problem of config.problems) warnOnce(log, problem);
1326
+ if (!("files" in config)) return void 0;
1327
+ const read = opts.read ?? createSafeHomeFileReader(opts.deniedRoots);
1328
+ const until = Date.now() + (opts.budgetMs ?? fsDeadlineMs());
1329
+ const results = [];
1330
+ let deadlineHit;
1331
+ for (const file of config.files) {
1332
+ const left = until - Date.now();
1333
+ if (!deadlineHit && left <= 0)
1334
+ deadlineHit = {
1335
+ status: "unreadable",
1336
+ code: "FS_DEADLINE",
1337
+ message: "not read: the home block read budget is used up"
1338
+ };
1339
+ if (deadlineHit) {
1340
+ results.push(deadlineHit);
1341
+ continue;
1342
+ }
1343
+ let result;
1344
+ try {
1345
+ result = await read(
1346
+ projectDir,
1347
+ file.path,
1348
+ file.maxChars * HOME_READ_BYTES_PER_CHAR,
1349
+ file.from,
1350
+ left
1351
+ );
1352
+ } catch (err) {
1353
+ result = { status: "unreadable", code: errorCode(err), message: errorMessage(err) };
1354
+ }
1355
+ if (result.status === "unreadable" && result.code === "FS_DEADLINE")
1356
+ deadlineHit = {
1357
+ status: "unreadable",
1358
+ code: "FS_DEADLINE",
1359
+ message: "not read: an earlier home file missed its deadline"
1360
+ };
1361
+ results.push(result);
1362
+ }
1363
+ const sections = [];
1364
+ config.files.forEach((file, index) => {
1365
+ const result = results[index];
1366
+ if (result.status === "unreadable") {
1367
+ log.warn(
1368
+ `home file ${file.path} could not be read (${result.code}); the agent starts without it: ${result.message}`,
1369
+ { path: file.path, code: result.code }
1370
+ );
1371
+ return;
1372
+ }
1373
+ if (result.status === "absent") {
1374
+ log.info(`home file ${file.path} is absent; skipped`, { path: file.path });
1375
+ return;
1376
+ }
1377
+ if (result.content.trim() === "") return;
1378
+ const content = file.from === "tail" ? capTail(result.content, file.maxChars) : capHead(result.content, file.maxChars);
1379
+ sections.push(`## ${file.label}
1380
+ ${content}`);
1381
+ });
1382
+ if (sections.length === 0) return void 0;
1383
+ return [
1384
+ `<${config.tag}>`,
1385
+ ...config.intro !== void 0 ? [config.intro, ""] : [],
1386
+ sections.join("\n\n"),
1387
+ `</${config.tag}>`
1388
+ ].join("\n");
1389
+ }
1141
1390
 
1142
1391
  // runner/src/file-changed-coalescer.ts
1143
1392
  var DEFAULT_WINDOW_MS = 1e3;
@@ -2322,6 +2571,10 @@ async function createAgentSession(config) {
2322
2571
  const wsConfig = managedWorkspaceConfig ?? wsConfigOverride ?? resolveSkWorkspaceConfig(projectDir);
2323
2572
  const contextSection = buildContextSection(wsConfig.agent?.context);
2324
2573
  const userPromptSection = wsConfig.agent?.prompt?.trim();
2574
+ const homeSection = await buildHomeSection(wsConfig.agent?.home, projectDir, {
2575
+ deniedRoots: managed ? [managed.runtime.privateRoot] : [],
2576
+ log: createLogger({ kind: "runner", subkind: "home", instance: sessionId ?? "no-session" })
2577
+ });
2325
2578
  const environmentSection = await buildEnvironmentSection(projectDir);
2326
2579
  const promptExtensions = await loadPromptExtensions(
2327
2580
  wsConfig.agent?.["prompt-extensions"],
@@ -2353,6 +2606,7 @@ async function createAgentSession(config) {
2353
2606
  const systemPromptSections = buildSystemPromptSections({
2354
2607
  contextSection,
2355
2608
  userPromptSection,
2609
+ homeSection,
2356
2610
  environmentSection,
2357
2611
  resourcePromptSection,
2358
2612
  mcpPromptSection,
@@ -2363,6 +2617,7 @@ async function createAgentSession(config) {
2363
2617
  const systemPrompt = assembleSystemPrompt([
2364
2618
  contextSection,
2365
2619
  userPromptSection,
2620
+ homeSection,
2366
2621
  environmentSection,
2367
2622
  resourcePromptSection,
2368
2623
  mcpPromptSection,
@@ -2517,6 +2772,7 @@ function buildSystemPromptSections(parts) {
2517
2772
  const {
2518
2773
  contextSection,
2519
2774
  userPromptSection,
2775
+ homeSection,
2520
2776
  environmentSection,
2521
2777
  resourcePromptSection,
2522
2778
  mcpPromptSection,
@@ -2527,6 +2783,7 @@ function buildSystemPromptSections(parts) {
2527
2783
  const systemPromptSections = [];
2528
2784
  if (contextSection) systemPromptSections.push({ label: "context", value: contextSection });
2529
2785
  if (userPromptSection) systemPromptSections.push({ label: "prompt", value: userPromptSection });
2786
+ if (homeSection) systemPromptSections.push({ label: "home", value: homeSection });
2530
2787
  if (environmentSection)
2531
2788
  systemPromptSections.push({ label: "environment", value: environmentSection });
2532
2789
  if (resourcePromptSection)
@@ -3527,7 +3784,7 @@ function isSessionRootPathAllowed(rel, operation) {
3527
3784
  (dir) => rel.startsWith(`${dir}/`) || operation === "delete" && rel === dir
3528
3785
  );
3529
3786
  }
3530
- function isWithin(root, child) {
3787
+ function isWithin2(root, child) {
3531
3788
  const rel = relative(root, child);
3532
3789
  return rel === "" || !(rel === ".." || rel.startsWith(`..${sep}`) || isAbsolute(rel));
3533
3790
  }
@@ -3580,7 +3837,7 @@ async function handleSessionRootResourceRequest(command, rootDir, emit) {
3580
3837
  if (isAbsolute(reqPath)) throw new Error("Absolute paths are not allowed for the session root");
3581
3838
  const root = resolve(rootDir);
3582
3839
  const targetPath = resolve(root, reqPath);
3583
- if (!isWithin(root, targetPath)) throw new Error("Path traversal outside the session root");
3840
+ if (!isWithin2(root, targetPath)) throw new Error("Path traversal outside the session root");
3584
3841
  const rel = relative(root, targetPath).split(sep).join("/");
3585
3842
  if (!isSessionRootPathAllowed(rel, operation)) {
3586
3843
  throw new Error(
@@ -3589,7 +3846,7 @@ async function handleSessionRootResourceRequest(command, rootDir, emit) {
3589
3846
  }
3590
3847
  const realRoot = await withFsDeadline(`realpath ${root}`, () => realpath(root));
3591
3848
  const onDisk = operation === "write" ? await resolveOnDisk(targetPath) : join(await resolveOnDisk(dirname(targetPath)), basename(targetPath));
3592
- if (!isWithin(realRoot, operation === "write" ? onDisk : dirname(onDisk))) {
3849
+ if (!isWithin2(realRoot, operation === "write" ? onDisk : dirname(onDisk))) {
3593
3850
  throw new Error("Path escapes the session root through a symlink");
3594
3851
  }
3595
3852
  let data = true;
@@ -3742,10 +3999,10 @@ function validateManagedCodexHost(input, projectDir) {
3742
3999
  function loadManagedCodexHostConfig(file, projectDir) {
3743
4000
  try {
3744
4001
  if (!isAbsolute(file)) throw refused();
3745
- const stat3 = lstatSync(file);
3746
- if (!stat3.isFile() || stat3.isSymbolicLink() || stat3.size > 64 * 1024 || stat3.mode & 63)
4002
+ const stat4 = lstatSync(file);
4003
+ if (!stat4.isFile() || stat4.isSymbolicLink() || stat4.size > 64 * 1024 || stat4.mode & 63)
3747
4004
  throw refused();
3748
- if (process.getuid && stat3.uid !== 0 && stat3.uid !== process.getuid()) throw refused();
4005
+ if (process.getuid && stat4.uid !== 0 && stat4.uid !== process.getuid()) throw refused();
3749
4006
  if (overlaps(realpathSync(file), realpathSync(projectDir))) throw refused();
3750
4007
  return validateManagedCodexHost(
3751
4008
  zHost.parse(JSON.parse(readFileSync(file, "utf8"))),
@@ -4794,9 +5051,9 @@ var CompactionOrchestrator = class {
4794
5051
  const { summaryText, promptError, elapsedMs, timedOut } = await this._runCompactionPrompt(prompt);
4795
5052
  const attempt = { ...attemptBase, elapsedMs };
4796
5053
  if (promptError !== null) {
4797
- const errorCode = this._emitThrownFailure(attempt, promptError, timedOut);
5054
+ const errorCode2 = this._emitThrownFailure(attempt, promptError, timedOut);
4798
5055
  this._beginCooldown();
4799
- if (this._shouldRetry(trigger, errorCode, focus, isRetry)) {
5056
+ if (this._shouldRetry(trigger, errorCode2, focus, isRetry)) {
4800
5057
  return await this._doCompact(trigger, RETRY_FOCUS_DIRECTIVE, { tokensBefore });
4801
5058
  }
4802
5059
  this._endCompaction();
@@ -4851,8 +5108,8 @@ var CompactionOrchestrator = class {
4851
5108
  * caller owns the decision to try again, and a caller-supplied `focus` would
4852
5109
  * be discarded by the retry's own directive.
4853
5110
  */
4854
- _shouldRetry(trigger, errorCode, focus, isRetry) {
4855
- return !isRetry && trigger === "threshold" && focus === void 0 && RETRYABLE_ERROR_CODES.has(errorCode);
5111
+ _shouldRetry(trigger, errorCode2, focus, isRetry) {
5112
+ return !isRetry && trigger === "threshold" && focus === void 0 && RETRYABLE_ERROR_CODES.has(errorCode2);
4856
5113
  }
4857
5114
  /**
4858
5115
  * Drive the compaction `prompt()` call, capturing summary text from the
@@ -4963,16 +5220,16 @@ var CompactionOrchestrator = class {
4963
5220
  const rawMessage = promptError instanceof Error ? promptError.message : String(promptError);
4964
5221
  const classified = classifyClaudeSdkError(rawMessage);
4965
5222
  const classifiedCode = classified.category === "rate_limit" ? "rate_limit" : classified.category === "auth" ? "auth" : classified.category === "network" ? "timeout" : classified.category === "validation" ? "parse_error" : classified.category;
4966
- const errorCode = timedOut ? "timeout" : classifiedCode;
5223
+ const errorCode2 = timedOut ? "timeout" : classifiedCode;
4967
5224
  const diagnostic = truncateDiagnostic(classified.message);
4968
- this.opts.onLog?.(`[compaction] Failed: ${classified.message} (${errorCode})`);
5225
+ this.opts.onLog?.(`[compaction] Failed: ${classified.message} (${errorCode2})`);
4969
5226
  this.opts.onCompactionAttempt?.({
4970
5227
  // Spread first: `status`/`validatedAt` below are load-bearing (see the
4971
5228
  // summary comment) and must not be override-able from the base object.
4972
5229
  ...attemptBase,
4973
5230
  type: "compaction_attempt",
4974
5231
  status: "failed",
4975
- errorCode,
5232
+ errorCode: errorCode2,
4976
5233
  errorMessage: diagnostic,
4977
5234
  // Mirrored so the platform's existing `summary` column explains the
4978
5235
  // failure with no schema change. Safe: a failed attempt is never
@@ -4981,7 +5238,7 @@ var CompactionOrchestrator = class {
4981
5238
  outputTokens: 0,
4982
5239
  validatedAt: null
4983
5240
  });
4984
- return errorCode;
5241
+ return errorCode2;
4985
5242
  }
4986
5243
  /**
4987
5244
  * Record a `failed` attempt for output that passed `prompt()` but failed
@@ -4989,17 +5246,17 @@ var CompactionOrchestrator = class {
4989
5246
  * occurrence is diagnosable from the row alone; signalling compaction end is
4990
5247
  * the caller's job.
4991
5248
  */
4992
- _emitValidationFailure(attemptBase, errorCode, tokensAfter, rejectedText) {
5249
+ _emitValidationFailure(attemptBase, errorCode2, tokensAfter, rejectedText) {
4993
5250
  this.opts.onLog?.(
4994
- `[compaction] Output failed validation (${errorCode}); recording failed attempt`
5251
+ `[compaction] Output failed validation (${errorCode2}); recording failed attempt`
4995
5252
  );
4996
5253
  this.opts.onCompactionAttempt?.({
4997
5254
  // Spread first — see _emitThrownFailure.
4998
5255
  ...attemptBase,
4999
5256
  type: "compaction_attempt",
5000
5257
  status: "failed",
5001
- errorCode,
5002
- errorMessage: `Compaction output rejected by validation (${errorCode}): ${rejectedText.length} chars, ${tokensAfter} output tokens`,
5258
+ errorCode: errorCode2,
5259
+ errorMessage: `Compaction output rejected by validation (${errorCode2}): ${rejectedText.length} chars, ${tokensAfter} output tokens`,
5003
5260
  // The rejected text itself, not a summary — see _emitThrownFailure on
5004
5261
  // why persisting it here cannot leak into a restored session.
5005
5262
  summary: truncateDiagnostic(rejectedText),
@@ -9153,5 +9410,5 @@ function touchSession(state) {
9153
9410
  }
9154
9411
 
9155
9412
  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 };
9156
- //# sourceMappingURL=chunk-LN4M7WMX.js.map
9157
- //# sourceMappingURL=chunk-LN4M7WMX.js.map
9413
+ //# sourceMappingURL=chunk-QV36ENWE.js.map
9414
+ //# sourceMappingURL=chunk-QV36ENWE.js.map