@skaile/workspaces 6.7.0 → 6.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-4A7PJ4OB.js → asset-feeds-R75MH2WW.js} +6 -6
  4. package/dist/{asset-feeds-4A7PJ4OB.js.map → asset-feeds-R75MH2WW.js.map} +1 -1
  5. package/dist/asset-manager/index.js +1 -1
  6. package/dist/bridge/harnesses/claude-sdk.js +18 -10
  7. package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
  8. package/dist/bridge/harnesses/codex.js +3 -3
  9. package/dist/bridge/harnesses/continue.js +4 -4
  10. package/dist/bridge/harnesses/echo.js +4 -4
  11. package/dist/bridge/harnesses/gemini.js +5 -5
  12. package/dist/bridge/harnesses/goose.js +4 -4
  13. package/dist/bridge/harnesses/omp.js +6 -6
  14. package/dist/bridge/harnesses/opencode.js +4 -4
  15. package/dist/bridge/harnesses/qwen.js +5 -5
  16. package/dist/bridge/index.js +9 -9
  17. package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -1
  18. package/dist/bridge/src/harnesses/claude-self-turns.d.ts.map +1 -1
  19. package/dist/bridge/src/types.d.ts +11 -0
  20. package/dist/bridge/src/types.d.ts.map +1 -1
  21. package/dist/{chunk-ZDTDS62B.js → chunk-56PIAGD6.js} +2 -2
  22. package/dist/{chunk-ZDTDS62B.js.map → chunk-56PIAGD6.js.map} +1 -1
  23. package/dist/{chunk-TXX3OUYI.js → chunk-62NNP7LU.js} +3 -3
  24. package/dist/{chunk-TXX3OUYI.js.map → chunk-62NNP7LU.js.map} +1 -1
  25. package/dist/{chunk-KORDNXKA.js → chunk-6PVRP3LW.js} +36 -5
  26. package/dist/chunk-6PVRP3LW.js.map +1 -0
  27. package/dist/{chunk-HPXONAI2.js → chunk-6ZM5X2XW.js} +3 -3
  28. package/dist/{chunk-HPXONAI2.js.map → chunk-6ZM5X2XW.js.map} +1 -1
  29. package/dist/{chunk-ASBZOTEO.js → chunk-7NN3P6VF.js} +22 -5
  30. package/dist/chunk-7NN3P6VF.js.map +1 -0
  31. package/dist/{chunk-Q2NYTMT6.js → chunk-7O2CR5SZ.js} +5 -5
  32. package/dist/{chunk-Q2NYTMT6.js.map → chunk-7O2CR5SZ.js.map} +1 -1
  33. package/dist/{chunk-37X4A6VZ.js → chunk-7RBFYW24.js} +4 -4
  34. package/dist/{chunk-37X4A6VZ.js.map → chunk-7RBFYW24.js.map} +1 -1
  35. package/dist/{chunk-72TLO2AG.js → chunk-BGATDUYX.js} +3 -3
  36. package/dist/{chunk-72TLO2AG.js.map → chunk-BGATDUYX.js.map} +1 -1
  37. package/dist/{chunk-NURTGAWM.js → chunk-BRPEW3UL.js} +3 -3
  38. package/dist/{chunk-NURTGAWM.js.map → chunk-BRPEW3UL.js.map} +1 -1
  39. package/dist/{chunk-L3JQJ6D5.js → chunk-DXBHGNSI.js} +4 -4
  40. package/dist/{chunk-L3JQJ6D5.js.map → chunk-DXBHGNSI.js.map} +1 -1
  41. package/dist/{chunk-CTRTFMCX.js → chunk-E5AZA2FL.js} +3 -3
  42. package/dist/{chunk-CTRTFMCX.js.map → chunk-E5AZA2FL.js.map} +1 -1
  43. package/dist/{chunk-IRK3LNG3.js → chunk-EDKTS44C.js} +3 -3
  44. package/dist/{chunk-IRK3LNG3.js.map → chunk-EDKTS44C.js.map} +1 -1
  45. package/dist/{chunk-ZM4SDVUV.js → chunk-I4DI5DAX.js} +8 -8
  46. package/dist/{chunk-ZM4SDVUV.js.map → chunk-I4DI5DAX.js.map} +1 -1
  47. package/dist/{chunk-4C2E5QUP.js → chunk-I6XH46Q6.js} +3 -3
  48. package/dist/{chunk-4C2E5QUP.js.map → chunk-I6XH46Q6.js.map} +1 -1
  49. package/dist/{chunk-BKLDBUQA.js → chunk-JAGBPHXB.js} +3 -3
  50. package/dist/{chunk-BKLDBUQA.js.map → chunk-JAGBPHXB.js.map} +1 -1
  51. package/dist/{chunk-GAIMSCZ7.js → chunk-LL5GMUQG.js} +6 -6
  52. package/dist/{chunk-GAIMSCZ7.js.map → chunk-LL5GMUQG.js.map} +1 -1
  53. package/dist/{chunk-OGTQUEAO.js → chunk-LZ3E6TML.js} +5 -5
  54. package/dist/{chunk-OGTQUEAO.js.map → chunk-LZ3E6TML.js.map} +1 -1
  55. package/dist/{chunk-L7QOZG5V.js → chunk-N2W7OJC6.js} +6 -3
  56. package/dist/chunk-N2W7OJC6.js.map +1 -0
  57. package/dist/{chunk-WKENHNDM.js → chunk-N65H7YYI.js} +3 -3
  58. package/dist/{chunk-WKENHNDM.js.map → chunk-N65H7YYI.js.map} +1 -1
  59. package/dist/{chunk-LX4TTTRR.js → chunk-NAEXYRHR.js} +313 -48
  60. package/dist/chunk-NAEXYRHR.js.map +1 -0
  61. package/dist/{chunk-UCB7FK25.js → chunk-NW7Y5SNK.js} +4 -4
  62. package/dist/{chunk-UCB7FK25.js.map → chunk-NW7Y5SNK.js.map} +1 -1
  63. package/dist/{chunk-6RPS7JEH.js → chunk-OLZE4IHX.js} +284 -29
  64. package/dist/chunk-OLZE4IHX.js.map +1 -0
  65. package/dist/{chunk-PLLZSKOO.js → chunk-ORXV3UB6.js} +3 -3
  66. package/dist/{chunk-PLLZSKOO.js.map → chunk-ORXV3UB6.js.map} +1 -1
  67. package/dist/{chunk-RAHAZ7LP.js → chunk-PKC2AHOB.js} +2 -2
  68. package/dist/{chunk-RAHAZ7LP.js.map → chunk-PKC2AHOB.js.map} +1 -1
  69. package/dist/{chunk-AO57IFME.js → chunk-QGA2OBUJ.js} +3 -3
  70. package/dist/{chunk-AO57IFME.js.map → chunk-QGA2OBUJ.js.map} +1 -1
  71. package/dist/{chunk-U52FYGK5.js → chunk-REAF7ZFA.js} +4 -4
  72. package/dist/{chunk-U52FYGK5.js.map → chunk-REAF7ZFA.js.map} +1 -1
  73. package/dist/{chunk-ZBA4P5TD.js → chunk-SAL72A7T.js} +2 -2
  74. package/dist/{chunk-ZBA4P5TD.js.map → chunk-SAL72A7T.js.map} +1 -1
  75. package/dist/{chunk-XON6ODIC.js → chunk-SILFO5RY.js} +2 -2
  76. package/dist/{chunk-XON6ODIC.js.map → chunk-SILFO5RY.js.map} +1 -1
  77. package/dist/{chunk-WIYVR24B.js → chunk-SVMIUCTT.js} +3 -3
  78. package/dist/{chunk-WIYVR24B.js.map → chunk-SVMIUCTT.js.map} +1 -1
  79. package/dist/{chunk-3W6XZQ2Y.js → chunk-VQFA5DR7.js} +3 -3
  80. package/dist/{chunk-3W6XZQ2Y.js.map → chunk-VQFA5DR7.js.map} +1 -1
  81. package/dist/{chunk-HMVAGPYR.js → chunk-XIIIGLSL.js} +9 -9
  82. package/dist/{chunk-HMVAGPYR.js.map → chunk-XIIIGLSL.js.map} +1 -1
  83. package/dist/{chunk-N6ZGB5ES.js → chunk-Y6LC5PEZ.js} +3 -3
  84. package/dist/{chunk-N6ZGB5ES.js.map → chunk-Y6LC5PEZ.js.map} +1 -1
  85. package/dist/{chunk-LZPJOF7Y.js → chunk-YEOG7CWQ.js} +3 -3
  86. package/dist/{chunk-LZPJOF7Y.js.map → chunk-YEOG7CWQ.js.map} +1 -1
  87. package/dist/{chunk-37AYPPOO.js → chunk-YMO4ZDLC.js} +8 -8
  88. package/dist/{chunk-37AYPPOO.js.map → chunk-YMO4ZDLC.js.map} +1 -1
  89. package/dist/{chunk-J7VEQORJ.js → chunk-Z5EPCIB6.js} +5 -5
  90. package/dist/{chunk-J7VEQORJ.js.map → chunk-Z5EPCIB6.js.map} +1 -1
  91. package/dist/{claude-code-BLFRZU2X.js → claude-code-DS26HI3K.js} +4 -4
  92. package/dist/{claude-code-BLFRZU2X.js.map → claude-code-DS26HI3K.js.map} +1 -1
  93. package/dist/cli/index.js +56 -56
  94. package/dist/connectors/config.js +1 -1
  95. package/dist/connectors/index.js +12 -12
  96. package/dist/connectors/src/connector-manager.d.ts +66 -2
  97. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  98. package/dist/connectors/src/connector-prompt.d.ts.map +1 -1
  99. package/dist/connectors/src/connector-types.d.ts +6 -0
  100. package/dist/connectors/src/connector-types.d.ts.map +1 -1
  101. package/dist/connectors/src/fleet-utils.d.ts +33 -0
  102. package/dist/connectors/src/fleet-utils.d.ts.map +1 -1
  103. package/dist/connectors/src/index.d.ts +2 -2
  104. package/dist/connectors/src/index.d.ts.map +1 -1
  105. package/dist/{connectors-OJJU4LSN.js → connectors-3ST6PGWP.js} +15 -15
  106. package/dist/{connectors-OJJU4LSN.js.map → connectors-3ST6PGWP.js.map} +1 -1
  107. package/dist/connectors-shared/index.js +2 -2
  108. package/dist/{ensure-sources-F6VQDCWY.js → ensure-sources-VELKRM6X.js} +13 -13
  109. package/dist/{ensure-sources-F6VQDCWY.js.map → ensure-sources-VELKRM6X.js.map} +1 -1
  110. package/dist/factory-assets/connectors/box.js +12 -12
  111. package/dist/factory-assets/connectors/deploy.js +12 -12
  112. package/dist/factory-assets/connectors/devserver.js +12 -12
  113. package/dist/factory-assets/connectors/flow/adapter.js +12 -12
  114. package/dist/factory-assets/connectors/flow/contract/schema.d.ts +3 -3
  115. package/dist/factory-assets/connectors/flow/run-flow.js +13 -13
  116. package/dist/factory-assets/connectors/flow.js +12 -12
  117. package/dist/factory-assets/connectors/git.js +12 -12
  118. package/dist/factory-assets/connectors/gmail.js +12 -12
  119. package/dist/factory-assets/connectors/googledrive.js +12 -12
  120. package/dist/factory-assets/connectors/local.js +12 -12
  121. package/dist/factory-assets/connectors/mattermost.js +12 -12
  122. package/dist/factory-assets/connectors/memory.js +12 -12
  123. package/dist/factory-assets/connectors/minio.js +12 -12
  124. package/dist/factory-assets/connectors/postgres.js +12 -12
  125. package/dist/factory-assets/connectors/s3.js +12 -12
  126. package/dist/factory-assets/connectors/sharepoint.js +12 -12
  127. package/dist/factory-assets/connectors/sqlite.js +12 -12
  128. package/dist/factory-assets/connectors/static-server.js +12 -12
  129. package/dist/factory-assets/connectors/tunnel.js +12 -12
  130. package/dist/factory-assets/connectors/webdav.js +12 -12
  131. package/dist/factory-assets/connectors/xstate-store.js +12 -12
  132. package/dist/factory-assets/connectors/xstate.js +12 -12
  133. package/dist/{helpers-PJNUTZXZ.js → helpers-LWNKX56Y.js} +13 -13
  134. package/dist/{helpers-PJNUTZXZ.js.map → helpers-LWNKX56Y.js.map} +1 -1
  135. package/dist/{library-publish-FNNDWVBO.js → library-publish-WJVCT2IK.js} +28 -28
  136. package/dist/{library-publish-FNNDWVBO.js.map → library-publish-WJVCT2IK.js.map} +1 -1
  137. package/dist/model-endpoint/index.js +3 -3
  138. package/dist/{open-library-R5EZROFN.js → open-library-Q7QZJY5D.js} +14 -14
  139. package/dist/{open-library-R5EZROFN.js.map → open-library-Q7QZJY5D.js.map} +1 -1
  140. package/dist/{project-S2FT3LLR.js → project-WVPRL7CP.js} +24 -24
  141. package/dist/{project-S2FT3LLR.js.map → project-WVPRL7CP.js.map} +1 -1
  142. package/dist/runner/index.js +18 -18
  143. package/dist/runner/src/capability-roundtrip.d.ts +2 -1
  144. package/dist/runner/src/capability-roundtrip.d.ts.map +1 -1
  145. package/dist/runner/src/resource-handler.d.ts +1 -1
  146. package/dist/runner/src/resource-handler.d.ts.map +1 -1
  147. package/dist/runner/src/resources.d.ts +1 -0
  148. package/dist/runner/src/resources.d.ts.map +1 -1
  149. package/dist/runner/src/serve.d.ts.map +1 -1
  150. package/dist/runner/src/session-resource-handlers.d.ts.map +1 -1
  151. package/dist/runner/src/turn-scheduler.d.ts +8 -0
  152. package/dist/runner/src/turn-scheduler.d.ts.map +1 -1
  153. package/dist/runner/src/turn-visibility.d.ts +97 -0
  154. package/dist/runner/src/turn-visibility.d.ts.map +1 -0
  155. package/dist/sdk/asset-manager.js +1 -1
  156. package/dist/sdk/bridge.js +9 -9
  157. package/dist/sdk/index.js +18 -18
  158. package/dist/sdk/runner.js +18 -18
  159. package/dist/sdk/session.js +2 -2
  160. package/dist/sdk/types.js +1 -1
  161. package/dist/{serve-preflight-AADSOUO2.js → serve-preflight-24YWWYUG.js} +15 -15
  162. package/dist/{serve-preflight-AADSOUO2.js.map → serve-preflight-24YWWYUG.js.map} +1 -1
  163. package/dist/session/index.js +2 -2
  164. package/dist/session/src/dispatcher.d.ts.map +1 -1
  165. package/dist/{setup-HOAJHUFQ.js → setup-F5JX64UP.js} +14 -14
  166. package/dist/{setup-HOAJHUFQ.js.map → setup-F5JX64UP.js.map} +1 -1
  167. package/dist/{source-FOELFCY6.js → source-DG5IAAGZ.js} +25 -25
  168. package/dist/{source-FOELFCY6.js.map → source-DG5IAAGZ.js.map} +1 -1
  169. package/dist/{source-manifest-publish-Q7P5AEVU.js → source-manifest-publish-76S2JD3O.js} +27 -27
  170. package/dist/{source-manifest-publish-Q7P5AEVU.js.map → source-manifest-publish-76S2JD3O.js.map} +1 -1
  171. package/dist/tui/index.js +18 -18
  172. package/dist/types/index.js +1 -1
  173. package/dist/types/src/capabilities.d.ts +3 -2
  174. package/dist/types/src/capabilities.d.ts.map +1 -1
  175. package/dist/types/src/events.d.ts +11 -10
  176. package/dist/types/src/events.d.ts.map +1 -1
  177. package/dist/types/src/index.d.ts +2 -0
  178. package/dist/types/src/index.d.ts.map +1 -1
  179. package/dist/types/src/manifests/preset.d.ts +5 -5
  180. package/dist/types/src/protocol.d.ts +3 -0
  181. package/dist/types/src/protocol.d.ts.map +1 -1
  182. package/dist/types/src/turn-visibility.d.ts +50 -0
  183. package/dist/types/src/turn-visibility.d.ts.map +1 -0
  184. package/dist/types/src/version.d.ts +14 -1
  185. package/dist/types/src/version.d.ts.map +1 -1
  186. package/dist/workspace-plugin/adapters/mcp.js +14 -14
  187. package/dist/workspace-plugin/adapters/omp.js +7 -7
  188. package/dist/workspace-plugin/index.js +1 -1
  189. package/dist/workspace-plugin/src/tools/connectors.d.ts.map +1 -1
  190. package/package.json +1 -1
  191. package/dist/chunk-6RPS7JEH.js.map +0 -1
  192. package/dist/chunk-ASBZOTEO.js.map +0 -1
  193. package/dist/chunk-KORDNXKA.js.map +0 -1
  194. package/dist/chunk-L7QOZG5V.js.map +0 -1
  195. package/dist/chunk-LX4TTTRR.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/store-client.ts"],"names":[],"mappings":";;;;AAuBO,SAAS,cAAA,GAA8B;AAC5C,EAAA,MAAM,eAAe,kBAAA,EAAmB;AACxC,EAAA,IAAI,WAAgC,EAAC;AACrC,EAAA,IAAI,UAAA,CAAW,YAAY,CAAA,EAAG;AAC5B,IAAA,IAAI;AACF,MAAA,QAAA,GAAW,gBAAgB,IAAA,CAAK,KAAA,CAAM,aAAa,YAAA,EAAc,OAAO,CAAC,CAAC,CAAA;AAAA,IAC5E,CAAA,CAAA,MAAQ;AACN,MAAA,QAAA,GAAW,EAAC;AAAA,IACd;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,GAAA,EAAK,QAAA,CAAS,QAAA,IAAY,OAAA,CAAQ,IAAI,gBAAA,IAAoB,0BAAA;AAAA,IAC1D,GAAA,EAAK;AAAA,GACP;AACF;AAOO,SAAS,cAAc,IAAA,EAAkC;AAC9D,EAAA,OAAO,cAAA,CAAe,mBAAA,EAAoB,EAAG,IAAI,CAAA;AACnD;AAaA,eAAsB,UAAA,CACpB,MAAA,EACA,IAAA,EACA,IAAA,EAOY;AACZ,EAAA,IAAI,GAAA,GAAM,CAAA,EAAG,MAAA,CAAO,GAAG,GAAG,IAAI,CAAA,CAAA;AAC9B,EAAA,IAAI,MAAM,MAAA,EAAQ;AAChB,IAAA,MAAM,EAAA,GAAK,IAAI,eAAA,CAAgB,IAAA,CAAK,MAAM,CAAA;AAC1C,IAAA,GAAA,IAAO,IAAI,EAAE,CAAA,CAAA;AAAA,EACf;AAEA,EAAA,MAAM,OAAA,GAAkC;AAAA,IACtC,cAAA,EAAgB,kBAAA;AAAA,IAChB,MAAA,EAAQ,kBAAA;AAAA,IACR,GAAI,IAAA,EAAM,OAAA,IAA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A;AAC5C","file":"chunk-72TLO2AG.js","sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { globalSettingsPath, mapLegacyFields } from \"@skaile/workspaces/core\";\nimport { type AuthDeps, getAccessToken, hasStoredAuth, loadStoreAuthConfig } from \"./store-auth.ts\";\n\n/**\n * Connection configuration for the AI Asset Store API. `jwt` is normally left\n * null here and filled per-call by the caller from {@link getStoreToken} (the\n * device-flow session); it stays on the type for the `{ ...config, jwt }` spread.\n *\n * @docLink cli/dev-guide#store-client\n */\nexport interface StoreConfig {\n url: string;\n jwt: string | null;\n}\n\n/**\n * Read the store API base URL (settings `storeUrl` → `SKAILE_STORE_URL` →\n * default). Auth is not read here — it lives in the device-flow session; see\n * {@link getStoreToken}.\n *\n * @docLink cli/dev-guide#store-client\n */\nexport function getStoreConfig(): StoreConfig {\n const settingsPath = globalSettingsPath();\n let settings: Record<string, any> = {};\n if (existsSync(settingsPath)) {\n try {\n settings = mapLegacyFields(JSON.parse(readFileSync(settingsPath, \"utf-8\")));\n } catch {\n settings = {};\n }\n }\n return {\n url: settings.storeUrl ?? process.env.SKAILE_STORE_URL ?? \"https://api.skaile.store\",\n jwt: null,\n };\n}\n\n/**\n * Return a valid store access token (Keycloak device-flow session, refreshed if\n * needed). Throws a \"run `skaile store login`\" error when there is no session.\n * This is the auth source for every `/api/v1/*` publisher call.\n */\nexport function getStoreToken(deps?: AuthDeps): Promise<string> {\n return getAccessToken(loadStoreAuthConfig(), deps);\n}\n\n/**\n * Make an authenticated HTTP request to the store REST API.\n *\n * @param config - Store connection config (URL + auth token).\n * @param path - API path (e.g. `/api/assets`).\n * @param opts - Optional method, body, query params, extra headers, and\n * `timeoutMs` (default 1500). Publisher calls pass a longer timeout because\n * they trigger server-side clone/sync work.\n * @returns Parsed JSON response body.\n * @docLink cli/dev-guide#store-client\n */\nexport async function storeFetch<T = any>(\n config: StoreConfig,\n path: string,\n opts?: {\n method?: string;\n body?: unknown;\n params?: Record<string, string>;\n headers?: Record<string, string>;\n timeoutMs?: number;\n },\n): Promise<T> {\n let url = `${config.url}${path}`;\n if (opts?.params) {\n const sp = new URLSearchParams(opts.params);\n url += `?${sp}`;\n }\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n ...(opts?.headers ?? {}),\n };\n if (config.jwt) {\n headers.Authorization = `Bearer ${config.jwt}`;\n }\n\n const fetchOpts: RequestInit = {\n method: opts?.method ?? \"GET\",\n headers,\n };\n if (opts?.body) {\n fetchOpts.body = JSON.stringify(opts.body);\n }\n\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), opts?.timeoutMs ?? 1_500);\n try {\n const res = await fetch(url, { ...fetchOpts, signal: controller.signal });\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: `HTTP ${res.status}` }));\n // Prefer the store's human-readable `message` (e.g. \"Namespace '@x' is\n // reserved … Sign in with GitHub to claim it\") over the bare `error` code\n // (`UNPROCESSABLE_CONTENT`) — the message is the actionable part.\n const b = body as { message?: string; error?: string };\n throw new Error(b.message ?? b.error ?? `Store API error: ${res.status}`);\n }\n return res.json() as Promise<T>;\n } finally {\n clearTimeout(timeout);\n }\n}\n\n/**\n * Return `true` when a store session exists (a Keycloak device-flow token cached\n * at `~/.skaile/auth.json`). Validity/refresh is resolved on use via\n * {@link getStoreToken}.\n *\n * @docLink cli/dev-guide#store-client\n */\nexport function isStoreAuthenticated(): boolean {\n return hasStoredAuth(loadStoreAuthConfig());\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/store-client.ts"],"names":[],"mappings":";;;;AAuBO,SAAS,cAAA,GAA8B;AAC5C,EAAA,MAAM,eAAe,kBAAA,EAAmB;AACxC,EAAA,IAAI,WAAgC,EAAC;AACrC,EAAA,IAAI,UAAA,CAAW,YAAY,CAAA,EAAG;AAC5B,IAAA,IAAI;AACF,MAAA,QAAA,GAAW,gBAAgB,IAAA,CAAK,KAAA,CAAM,aAAa,YAAA,EAAc,OAAO,CAAC,CAAC,CAAA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OAAA,GAAU,WAAW,MAAM,UAAA,CAAW,OAAM,EAAG,IAAA,EAAM,aAAa,IAAK,CAAA;AAC7E,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,MAAM,KAAA,CAAM,GAAA,EAAK,EAAE,GAAG,SAAA,EAAW,MAAA,EAAQ,UAAA,CAAW,MAAA,EAAQ,CAAA;AACxE,IAAA,IAAI,CAAC,IAAI,EAAA,EAAI;AACX,MAAA,MAAM,IAAA,GAAO,MAAM,GAAA,CAAI,IAAA,EAAK,CAAE,KAAA,CAAM,OAAO,EAAE,KAAA,EAAO,CAAA,KAAA,EAAQ,GAAA,CAAI,MAAM,IAAG,CAAE,CAAA;AAI3E,MAAA,MAAM,CAAA,GAAI,IAAA;AACV,MAAA,MAAM,IAAI,MAAM,CAAA,CAAE,OAAA,IAAW,EAAE,KAAA,IAAS,CAAA,iBAAA,EAAoB,GAAA,CAAI,MAAM,CAAA,CAAE,CAAA;AAAA,IAC1E;AACA,IAAA,OAAO,IAAI,IAAA,EAAK;AAAA,EAClB,CAAA,SAAE;AACA,IAAA,YAAA,CAAa,OAAO,CAAA;AAAA,EACtB;AACF;AASO,SAAS,oBAAA,GAAgC;AAC9C,EAAA,OAAO,aAAA,CAAc,qBAAqB,CAAA;AAC5C","file":"chunk-BGATDUYX.js","sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { globalSettingsPath, mapLegacyFields } from \"@skaile/workspaces/core\";\nimport { type AuthDeps, getAccessToken, hasStoredAuth, loadStoreAuthConfig } from \"./store-auth.ts\";\n\n/**\n * Connection configuration for the AI Asset Store API. `jwt` is normally left\n * null here and filled per-call by the caller from {@link getStoreToken} (the\n * device-flow session); it stays on the type for the `{ ...config, jwt }` spread.\n *\n * @docLink cli/dev-guide#store-client\n */\nexport interface StoreConfig {\n url: string;\n jwt: string | null;\n}\n\n/**\n * Read the store API base URL (settings `storeUrl` → `SKAILE_STORE_URL` →\n * default). Auth is not read here — it lives in the device-flow session; see\n * {@link getStoreToken}.\n *\n * @docLink cli/dev-guide#store-client\n */\nexport function getStoreConfig(): StoreConfig {\n const settingsPath = globalSettingsPath();\n let settings: Record<string, any> = {};\n if (existsSync(settingsPath)) {\n try {\n settings = mapLegacyFields(JSON.parse(readFileSync(settingsPath, \"utf-8\")));\n } catch {\n settings = {};\n }\n }\n return {\n url: settings.storeUrl ?? process.env.SKAILE_STORE_URL ?? \"https://api.skaile.store\",\n jwt: null,\n };\n}\n\n/**\n * Return a valid store access token (Keycloak device-flow session, refreshed if\n * needed). Throws a \"run `skaile store login`\" error when there is no session.\n * This is the auth source for every `/api/v1/*` publisher call.\n */\nexport function getStoreToken(deps?: AuthDeps): Promise<string> {\n return getAccessToken(loadStoreAuthConfig(), deps);\n}\n\n/**\n * Make an authenticated HTTP request to the store REST API.\n *\n * @param config - Store connection config (URL + auth token).\n * @param path - API path (e.g. `/api/assets`).\n * @param opts - Optional method, body, query params, extra headers, and\n * `timeoutMs` (default 1500). Publisher calls pass a longer timeout because\n * they trigger server-side clone/sync work.\n * @returns Parsed JSON response body.\n * @docLink cli/dev-guide#store-client\n */\nexport async function storeFetch<T = any>(\n config: StoreConfig,\n path: string,\n opts?: {\n method?: string;\n body?: unknown;\n params?: Record<string, string>;\n headers?: Record<string, string>;\n timeoutMs?: number;\n },\n): Promise<T> {\n let url = `${config.url}${path}`;\n if (opts?.params) {\n const sp = new URLSearchParams(opts.params);\n url += `?${sp}`;\n }\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n ...(opts?.headers ?? {}),\n };\n if (config.jwt) {\n headers.Authorization = `Bearer ${config.jwt}`;\n }\n\n const fetchOpts: RequestInit = {\n method: opts?.method ?? \"GET\",\n headers,\n };\n if (opts?.body) {\n fetchOpts.body = JSON.stringify(opts.body);\n }\n\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), opts?.timeoutMs ?? 1_500);\n try {\n const res = await fetch(url, { ...fetchOpts, signal: controller.signal });\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: `HTTP ${res.status}` }));\n // Prefer the store's human-readable `message` (e.g. \"Namespace '@x' is\n // reserved … Sign in with GitHub to claim it\") over the bare `error` code\n // (`UNPROCESSABLE_CONTENT`) — the message is the actionable part.\n const b = body as { message?: string; error?: string };\n throw new Error(b.message ?? b.error ?? `Store API error: ${res.status}`);\n }\n return res.json() as Promise<T>;\n } finally {\n clearTimeout(timeout);\n }\n}\n\n/**\n * Return `true` when a store session exists (a Keycloak device-flow token cached\n * at `~/.skaile/auth.json`). Validity/refresh is resolved on use via\n * {@link getStoreToken}.\n *\n * @docLink cli/dev-guide#store-client\n */\nexport function isStoreAuthenticated(): boolean {\n return hasStoredAuth(loadStoreAuthConfig());\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { CONNECTOR_ERROR_KINDS } from './chunk-ASBZOTEO.js';
1
+ import { CONNECTOR_ERROR_KINDS } from './chunk-7NN3P6VF.js';
2
2
 
3
3
  // connectors/src/connect-error-kind.ts
4
4
  var CONNECT_ERROR_KIND_PROPERTY = "skaileConnectErrorKind";
@@ -28,5 +28,5 @@ var ClassifiedConnectError = class extends Error {
28
28
  };
29
29
 
30
30
  export { CONNECT_ERROR_KIND_PROPERTY, ClassifiedConnectError, declaredConnectErrorKind, withConnectErrorKind };
31
- //# sourceMappingURL=chunk-NURTGAWM.js.map
32
- //# sourceMappingURL=chunk-NURTGAWM.js.map
31
+ //# sourceMappingURL=chunk-BRPEW3UL.js.map
32
+ //# sourceMappingURL=chunk-BRPEW3UL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../connectors/src/connect-error-kind.ts"],"names":[],"mappings":";;;AAuBO,IAAM,2BAAA,GAA8B;AAYpC,SAAS,yBAAyB,GAAA,EAA8C;AACrF,EAAA,IAAI,QAAQ,IAAA,IAAQ,OAAO,QAAQ,QAAA,IAAY,EAAE,+BAA+B,GAAA,CAAA,EAAM;AACpF,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,MAAM,KAAA,GAAS,IAAgC,2BAA2B,CAAA;AAC1E,EAAA,OAAQ,qBAAA,CAA6C,QAAA,CAAS,KAAK,CAAA,GAC9D,KAAA,GACD,MAAA;AACN;AAOO,SAAS,oBAAA,CAAwB,KAAQ,IAAA,EAA6B;AAC3E,EAAA,IAAI,QAAQ,IAAA,IAAQ,OAAO,QAAQ,QAAA,IAAY,EAAE,+BAA+B,GAAA,CAAA,EAAM;AACpF,IAAA,IAAI;AACF,MAAC,GAAA,CAAgC,2BAA2B,CAAA,GAAI,IAAA;AAAA,IAClE,CAAA,CAAA,MAAQ;AAAA,IAER;AAAA,EACF;AACA,EAAA,OAAO,GAAA;AACT;AAMO,IAAM,sBAAA,GAAN,cAAqC,KAAA,CAAM;AAAA,EAChD,CAAU,2BAA2B;AAAA,EACrC,WAAA,CAAY,SAAiB,IAAA,EAA0B;AACrD,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,wBAAA;AACZ,IAAA,IAAA,CAAK,2BAA2B,CAAA,GAAI,IAAA;AAAA,EACtC;AACF","file":"chunk-NURTGAWM.js","sourcesContent":["/**\n * The driver-side contract for classifying a connect failure: how a thrower\n * says which {@link ConnectorErrorKind} its error is. Read by the manager's\n * `classifyConnectError` (`classify-connect-error.ts`) into the `errorKind`\n * field of `connector_status` error events.\n *\n * Depends on nothing but `types`, so the `connectors-shared` subpath can\n * re-export it to out-of-tree drivers.\n *\n * @docLink packages/connectors/concepts#connector-manager\n */\n\nimport { CONNECTOR_ERROR_KINDS, type ConnectorErrorKind } from \"@skaile/workspaces/types\";\n\n/**\n * The property a thrown error carries its kind on.\n *\n * Namespaced because it is read off any thrown object: a bare `errorKind` is\n * a name a library's own error may already use, and a value that happened to\n * read `\"config\"` would silently misroute the failure. A plain string key\n * rather than a symbol, so a driver with no import from this package can still\n * set it: `throw Object.assign(new Error(msg), { skaileConnectErrorKind: \"config\" })`.\n */\nexport const CONNECT_ERROR_KIND_PROPERTY = \"skaileConnectErrorKind\";\n\n/**\n * The shape of an error that declares its kind. For classes that must spell the\n * key out instead of computing it (see the git driver's `TokenMediatorError`):\n * `implements` keeps the literal tied to {@link CONNECT_ERROR_KIND_PROPERTY}.\n */\nexport type DeclaresConnectErrorKind = {\n readonly [CONNECT_ERROR_KIND_PROPERTY]: ConnectorErrorKind;\n};\n\n/** The kind `err` declares for itself, or `undefined` when it declares none (or an unknown one). */\nexport function declaredConnectErrorKind(err: unknown): ConnectorErrorKind | undefined {\n if (err === null || typeof err !== \"object\" || !(CONNECT_ERROR_KIND_PROPERTY in err)) {\n return undefined;\n }\n const value = (err as Record<string, unknown>)[CONNECT_ERROR_KIND_PROPERTY];\n return (CONNECTOR_ERROR_KINDS as readonly unknown[]).includes(value)\n ? (value as ConnectorErrorKind)\n : undefined;\n}\n\n/**\n * Stamp `kind` onto `err` unless it already declares one, and return it for\n * rethrowing. For throw sites that know what a failure means but throw an\n * error they did not construct (a failed `git` child, say).\n */\nexport function withConnectErrorKind<T>(err: T, kind: ConnectorErrorKind): T {\n if (err !== null && typeof err === \"object\" && !(CONNECT_ERROR_KIND_PROPERTY in err)) {\n try {\n (err as Record<string, unknown>)[CONNECT_ERROR_KIND_PROPERTY] = kind;\n } catch {\n // Frozen or sealed: unclassified beats replacing the real error with a TypeError.\n }\n }\n return err;\n}\n\n/**\n * An `Error` carrying an explicit {@link ConnectorErrorKind}, for throw sites\n * that build their own error.\n */\nexport class ClassifiedConnectError extends Error {\n readonly [CONNECT_ERROR_KIND_PROPERTY]: ConnectorErrorKind;\n constructor(message: string, kind: ConnectorErrorKind) {\n super(message);\n this.name = \"ClassifiedConnectError\";\n this[CONNECT_ERROR_KIND_PROPERTY] = kind;\n }\n}\n"]}
1
+ {"version":3,"sources":["../connectors/src/connect-error-kind.ts"],"names":[],"mappings":";;;AAuBO,IAAM,2BAAA,GAA8B;AAYpC,SAAS,yBAAyB,GAAA,EAA8C;AACrF,EAAA,IAAI,QAAQ,IAAA,IAAQ,OAAO,QAAQ,QAAA,IAAY,EAAE,+BAA+B,GAAA,CAAA,EAAM;AACpF,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,MAAM,KAAA,GAAS,IAAgC,2BAA2B,CAAA;AAC1E,EAAA,OAAQ,qBAAA,CAA6C,QAAA,CAAS,KAAK,CAAA,GAC9D,KAAA,GACD,MAAA;AACN;AAOO,SAAS,oBAAA,CAAwB,KAAQ,IAAA,EAA6B;AAC3E,EAAA,IAAI,QAAQ,IAAA,IAAQ,OAAO,QAAQ,QAAA,IAAY,EAAE,+BAA+B,GAAA,CAAA,EAAM;AACpF,IAAA,IAAI;AACF,MAAC,GAAA,CAAgC,2BAA2B,CAAA,GAAI,IAAA;AAAA,IAClE,CAAA,CAAA,MAAQ;AAAA,IAER;AAAA,EACF;AACA,EAAA,OAAO,GAAA;AACT;AAMO,IAAM,sBAAA,GAAN,cAAqC,KAAA,CAAM;AAAA,EAChD,CAAU,2BAA2B;AAAA,EACrC,WAAA,CAAY,SAAiB,IAAA,EAA0B;AACrD,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,wBAAA;AACZ,IAAA,IAAA,CAAK,2BAA2B,CAAA,GAAI,IAAA;AAAA,EACtC;AACF","file":"chunk-BRPEW3UL.js","sourcesContent":["/**\n * The driver-side contract for classifying a connect failure: how a thrower\n * says which {@link ConnectorErrorKind} its error is. Read by the manager's\n * `classifyConnectError` (`classify-connect-error.ts`) into the `errorKind`\n * field of `connector_status` error events.\n *\n * Depends on nothing but `types`, so the `connectors-shared` subpath can\n * re-export it to out-of-tree drivers.\n *\n * @docLink packages/connectors/concepts#connector-manager\n */\n\nimport { CONNECTOR_ERROR_KINDS, type ConnectorErrorKind } from \"@skaile/workspaces/types\";\n\n/**\n * The property a thrown error carries its kind on.\n *\n * Namespaced because it is read off any thrown object: a bare `errorKind` is\n * a name a library's own error may already use, and a value that happened to\n * read `\"config\"` would silently misroute the failure. A plain string key\n * rather than a symbol, so a driver with no import from this package can still\n * set it: `throw Object.assign(new Error(msg), { skaileConnectErrorKind: \"config\" })`.\n */\nexport const CONNECT_ERROR_KIND_PROPERTY = \"skaileConnectErrorKind\";\n\n/**\n * The shape of an error that declares its kind. For classes that must spell the\n * key out instead of computing it (see the git driver's `TokenMediatorError`):\n * `implements` keeps the literal tied to {@link CONNECT_ERROR_KIND_PROPERTY}.\n */\nexport type DeclaresConnectErrorKind = {\n readonly [CONNECT_ERROR_KIND_PROPERTY]: ConnectorErrorKind;\n};\n\n/** The kind `err` declares for itself, or `undefined` when it declares none (or an unknown one). */\nexport function declaredConnectErrorKind(err: unknown): ConnectorErrorKind | undefined {\n if (err === null || typeof err !== \"object\" || !(CONNECT_ERROR_KIND_PROPERTY in err)) {\n return undefined;\n }\n const value = (err as Record<string, unknown>)[CONNECT_ERROR_KIND_PROPERTY];\n return (CONNECTOR_ERROR_KINDS as readonly unknown[]).includes(value)\n ? (value as ConnectorErrorKind)\n : undefined;\n}\n\n/**\n * Stamp `kind` onto `err` unless it already declares one, and return it for\n * rethrowing. For throw sites that know what a failure means but throw an\n * error they did not construct (a failed `git` child, say).\n */\nexport function withConnectErrorKind<T>(err: T, kind: ConnectorErrorKind): T {\n if (err !== null && typeof err === \"object\" && !(CONNECT_ERROR_KIND_PROPERTY in err)) {\n try {\n (err as Record<string, unknown>)[CONNECT_ERROR_KIND_PROPERTY] = kind;\n } catch {\n // Frozen or sealed: unclassified beats replacing the real error with a TypeError.\n }\n }\n return err;\n}\n\n/**\n * An `Error` carrying an explicit {@link ConnectorErrorKind}, for throw sites\n * that build their own error.\n */\nexport class ClassifiedConnectError extends Error {\n readonly [CONNECT_ERROR_KIND_PROPERTY]: ConnectorErrorKind;\n constructor(message: string, kind: ConnectorErrorKind) {\n super(message);\n this.name = \"ClassifiedConnectError\";\n this[CONNECT_ERROR_KIND_PROPERTY] = kind;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { listHarnesses } from './chunk-XON6ODIC.js';
2
- import { softDepName } from './chunk-ZDTDS62B.js';
1
+ import { listHarnesses } from './chunk-SILFO5RY.js';
2
+ import { softDepName } from './chunk-56PIAGD6.js';
3
3
  import { readLock, LockParseError } from './chunk-TMJBEGS4.js';
4
4
  import { SKAILE_YAML_DEFAULT, resolveSkWorkspaceConfig } from './chunk-O7ADRMCR.js';
5
5
  import { SUPPORTED_HARNESSES } from './chunk-VTETQCR6.js';
@@ -295,5 +295,5 @@ function warnFilesOnlyDelegates(projectDir, target) {
295
295
  }
296
296
 
297
297
  export { KIND_COL_WIDTH, S, TARGET_DEFAULT_HINT, bareSoftDepName, colorRef, deferredWarnings, driverAliasOption, fitWidth, foldDriverFlag, formatRelativeTime, formatSoftDepAddPreview, formatSoftDepHint, formatSoftDepRemovePreview, formatSoftDepSection, friendlyHarnessError, harnessErrorNotes, kindColor, kindColorPad, logErr, logInfo, logNoProject, logOk, logWarn, logWarnErr, parseHarnessFilter, reportLegacyOmpCopies, requireProjectConfig, setActiveCommand, unknownHarnessMessage, unknownHarnessTargetMessage, warnFilesOnlyDelegates, warnPlaceholderBodies, warnStaleHarnessCopies };
298
- //# sourceMappingURL=chunk-L3JQJ6D5.js.map
299
- //# sourceMappingURL=chunk-L3JQJ6D5.js.map
298
+ //# sourceMappingURL=chunk-DXBHGNSI.js.map
299
+ //# sourceMappingURL=chunk-DXBHGNSI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/harness-error.ts","../cli/src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;AAWO,SAAS,sBAAsB,OAAA,EAAqC;AACzE,EAAA,MAAM,QAAQ,aAAA,EAAc,CAAE,IAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAC7C,EAAA,IAAI,KAAA,CAAM,QAAA,CAAS,OAAO,CAAA,EAAG,OAAO,MAAA;AACpC,EAAA,OACE,CAAA,wBAAA,EAA2B,OAAO,CAAA,cAAA,EAAiB,KAAA,CAAM,IAAA,CAAK,IAAI,CAAC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GAAM,IAAA,CAAK,IAAA,CAAK,UAAA,EAAY,UAAU,eAAe,CAAA;AAC3D,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI;AACF,IAAA,KAAA,GAAQ,WAAA,CAAY,GAAG,CAAA,CAAE,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,QAAA,CAAS,KAAK,CAAC,CAAA;AAAA,EAC1D,CAAA,CAAA,MAAQ;AACN,IAAA;AAAA,EACF;AACA,EAAA,MAAM,SAAA,GAAY,KAAA,CACf,MAAA,CAAO,CAAC,CAAA,KAAM;AACb,IAAA,IAAI;AACF,MAAA,OAAO,YAAA,CAAa,KAAK,IAAA,CAAK,GAAA,EAAK,CAAC,CAAA,EAAG,MAAM,CAAA,CAAE,QAAA,CAAS,gBAAgB,CAAA;AAAA,IAC1E,CAAA,CAAA,MAAQ;AACN,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,EACF,CAAC,CAAA,CACA,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,CAAE,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAC,CAAA,CACjC,IAAA,EAAK;AACR,EAAA,IAAI,SAAA,CAAU,WAAW,CAAA,EAAG;AAC5B,EAAA,OAAA;AAAA,IACE,CAAA,uCAAA,EAA0C,SAAA,CAAU,IAAA,CAAK,IAAI,CAAC,CAAA,wFAAA;AAAA,GAChE;AACF","file":"chunk-L3JQJ6D5.js","sourcesContent":["import { listHarnesses } from \"@skaile/workspaces/bridge\";\nimport { SUPPORTED_HARNESSES } from \"@skaile/workspaces/core\";\nimport { Option } from \"commander\";\n\n/**\n * The refusal for a harness name nothing registers, or `undefined` when it is known. One check\n * for `run` (also with `--dry-run`, so the plan never names a harness the real run refuses),\n * `repl` and `config set harness` (p1022). Load the project's plugins first: a plugin's harness\n * counts. The line names the other command group's names too (p1753), see\n * {@link unknownHarnessTargetMessage}.\n */\nexport function unknownHarnessMessage(harness: string): string | undefined {\n const known = listHarnesses().map((d) => d.id);\n if (known.includes(harness)) return undefined;\n return (\n `Unknown agent harness: \"${harness}\". Available: ${known.join(\", \")}. ` +\n `${DEPLOY_COMMANDS} take: ${SUPPORTED_HARNESSES.join(\", \")}.`\n );\n}\n\n/** The commands that write harness files, so they take the harness targets only. */\nconst DEPLOY_COMMANDS = \"harness set, init --harness and add --harness\";\n\n/**\n * The refusal for a name that is no harness target, for the commands that deploy files\n * (`harness set`, `init --harness`, `add --harness`, `integration --harness`). Same wording as\n * {@link unknownHarnessMessage}: the list is the targets, and the line names the commands that\n * run a session and take every registered harness (p1753).\n *\n * @param harness - The name the user typed.\n * @param extra - Further names the command takes, such as `all`.\n */\nexport function unknownHarnessTargetMessage(\n harness: string,\n extra: readonly string[] = [],\n): string {\n const targets = [...SUPPORTED_HARNESSES, ...extra];\n const registered = listHarnesses().map((d) => d.id);\n return (\n `Unknown agent harness: \"${harness}\". Available: ${targets.join(\", \")}. ` +\n `run, repl and config set harness take: ${registered.join(\", \")}.`\n );\n}\n\nlet warnedDriverFlag = false;\n\n/** Print the `--driver` deprecation line to stderr, once per process. */\nexport function warnDriverFlagDeprecated(): void {\n if (warnedDriverFlag) return;\n warnedDriverFlag = true;\n console.error(\"--driver is deprecated; use --harness\");\n}\n\n/**\n * The hidden `--driver <name>` option every command with `--harness <name>` keeps for one\n * major release: an alias that sets the same value (`--harness` wins when both are given).\n */\nexport function driverAliasOption(): Option {\n return new Option(\"--driver <name>\", \"Deprecated alias of --harness\").hideHelp();\n}\n\n/**\n * Fold a parsed `--driver` alias into `harness`: when `--driver` was given, print the\n * deprecation line once and use its value unless `--harness` (or `fallback`, when neither\n * flag was given) already decided. Returns `opts` with `harness` set and `driver` removed.\n */\nexport function foldDriverFlag<T extends { harness?: string; driver?: string }>(\n opts: T,\n fallback?: string,\n): Omit<T, \"driver\"> & { harness?: string } {\n const { driver, ...rest } = opts;\n if (driver !== undefined) warnDriverFlagDeprecated();\n return { ...rest, harness: rest.harness ?? driver ?? fallback };\n}\n\n/**\n * Turn a harness-start/prompt failure into a friendly, actionable message when the\n * cause is a missing/unusable agent binary; otherwise return `null` so the caller\n * surfaces the raw error unchanged.\n *\n * The bridge classifies these as `category: \"config\"` and carries a `hint`, but the\n * shape reaching the CLI varies: omp's `start()` rejects with the raw spawn error\n * (`code === \"ENOENT\"`), while the subprocess CLI harnesses reject with the classified\n * `AgentError` attached under `.detail`. Duck-type across all of them.\n */\nexport function friendlyHarnessError(err: unknown): string | null {\n const e = err as\n | {\n code?: string;\n syscall?: string;\n message?: string;\n category?: string;\n hint?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n if (!e) return null;\n\n // A missing binary is a *spawn* ENOENT (`syscall: \"spawn <bin>\"` / \"spawn … ENOENT\");\n // a bare ENOENT from connector/mount setup is a different failure, not the harness.\n const isSpawnEnoent =\n e.code === \"ENOENT\" &&\n (e.syscall?.startsWith(\"spawn\") === true || /^spawn .*ENOENT/.test(e.message ?? \"\"));\n const isConfig = e.category === \"config\" || e.detail?.category === \"config\";\n if (!isSpawnEnoent && !isConfig) return null;\n\n const hint = e.hint ?? e.detail?.hint;\n const base = hint ?? \"The configured agent binary is not installed or not on your PATH.\";\n return `${base}\\nTry a different harness with \\`--harness claude-sdk\\`.`;\n}\n\n/**\n * Lines that follow the single `✗` line of a failed turn: the classifier's hint\n * (or, for a rejected credential, a pointer at the key), and where the full\n * records are. The JSON records themselves are not printed on the terminal:\n * they live in the project's log database. The pointer names the session whose records\n * the failure left (`logSessionId`); a failure before any session started has none and\n * gets no pointer.\n */\nexport function harnessErrorNotes(err: unknown): string[] {\n const e = err as\n | {\n category?: string;\n hint?: string;\n logSessionId?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n const notes: string[] = [];\n const category = e?.category ?? e?.detail?.category;\n const hint = e?.hint ?? e?.detail?.hint;\n if (hint && category !== \"config\") notes.push(hint);\n else if (category === \"auth\") notes.push(\"Check your API key or login.\");\n if (e?.logSessionId) {\n notes.push(`Full records: .skaile/logs.db (skaile session logs ${e.logSessionId}).`);\n }\n return notes;\n}\n","import { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport path from \"node:path\";\nimport { softDepName } from \"@skaile/workspaces/asset-manager\";\nimport {\n type HarnessName,\n LockParseError,\n readLock,\n resolveSkWorkspaceConfig,\n SKAILE_YAML_DEFAULT,\n SUPPORTED_HARNESSES,\n} from \"@skaile/workspaces/core\";\nimport pc from \"picocolors\";\nimport { unknownHarnessTargetMessage } from \"./harness-error.ts\";\n\n/**\n * Terminal styling helpers used across all CLI commands.\n *\n * @docLink cli/dev-guide#helpers\n */\nexport const S = {\n brand: (s: string) => pc.cyan(pc.bold(s)),\n cmd: (s: string) => pc.cyan(s),\n heading: (s: string) => pc.bold(s),\n bold: (s: string) => pc.bold(s),\n dim: (s: string) => pc.dim(s),\n ok: (s: string) => pc.green(s),\n warn: (s: string) => pc.yellow(s),\n err: (s: string) => pc.red(s),\n label: (s: string) => pc.dim(s),\n rule: (w = 40) => pc.dim(\"─\".repeat(w)),\n};\n\nconst KIND_COLORS: Record<string, (s: string) => string> = {\n skill: pc.blue,\n agent: pc.magenta,\n prompt: pc.yellow,\n flow: pc.green,\n preset: pc.cyan,\n contract: pc.red,\n connector: pc.green,\n knowledge: pc.cyan,\n persona: pc.cyan,\n ruleset: pc.cyan,\n \"mcp-server\": pc.magenta,\n};\n\n/**\n * Fit a plain (ANSI-free) string into exactly `width` columns: truncate with a\n * trailing `…` when too long, pad with spaces when too short. Keeps fixed-width\n * columns from overflowing the row when a value (e.g. an asset name) is wider\n * than its budget.\n */\nexport function fitWidth(s: string, width: number): string {\n if (width <= 0) return \"\";\n if (s.length > width) return width === 1 ? \"…\" : `${s.slice(0, width - 1)}…`;\n return s.padEnd(width);\n}\n\n/** Color-code an asset kind string. */\nexport function kindColor(kind: string): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(kind);\n}\n\n/**\n * Widest kind label (`mcp-server`); the default kind-column width fits it so\n * long kinds don't shove the rest of the row out of alignment.\n */\nexport const KIND_COL_WIDTH = 10;\n\n/**\n * Shared `--target` help suffix: with no flag, the manager deploys into the\n * harness the project is configured for (the harness `skaile config show`\n * resolves), and only then falls back to `claude-code`.\n */\nexport const TARGET_DEFAULT_HINT = \"default: the project's configured harness, else claude-code\";\n\n/**\n * Color-code an asset kind string fit to exactly `width` columns — pads short\n * kinds, truncates over-long ones (via {@link fitWidth}) so the column can never\n * overflow and break row alignment.\n */\nexport function kindColorPad(kind: string, width = KIND_COL_WIDTH): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(fitWidth(kind, width));\n}\n\n/** Color-code a \"kind:name\" reference string. */\nexport function colorRef(ref: string): string {\n const colonIdx = ref.indexOf(\":\");\n if (colonIdx === -1) return ref;\n const kind = ref.slice(0, colonIdx);\n const rest = ref.slice(colonIdx);\n return `${kindColor(kind)}${rest}`;\n}\n\n/**\n * Print a success line prefixed with a green check mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logOk(msg: string) {\n console.log(` ${pc.green(\"✓\")} ${msg}`);\n}\n/**\n * Print an error line prefixed with a red cross to stderr.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logErr(msg: string) {\n console.error(` ${pc.red(\"✗\")} ${msg}`);\n}\n/**\n * Print a warning line prefixed with a yellow exclamation mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logWarn(msg: string) {\n console.log(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * Like {@link logWarn}, on stderr: a warning about the run itself (an asset scan that stopped\n * early) that must not land in the output a script reads from stdout.\n *\n * @param msg - Message to display.\n */\nexport function logWarnErr(msg: string) {\n console.error(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * One `!` line per deployed library asset whose body or description is still the untouched\n * `library create` scaffold: `validate` and the publish plan fail both, so `add`, `install` and\n * `update` name every placeholder they fail (p926).\n *\n * @param bodies - Canonical refs the asset manager reported as placeholder bodies.\n * @param descriptions - Canonical refs the asset manager reported as placeholder descriptions.\n */\nexport function warnPlaceholderBodies(\n bodies: readonly string[] | undefined,\n descriptions?: readonly string[],\n) {\n const refs = [...new Set([...(bodies ?? []), ...(descriptions ?? [])])];\n for (const ref of refs) {\n const parts = [\n ...(descriptions?.includes(ref) ? [\"description\"] : []),\n ...(bodies?.includes(ref) ? [\"body\"] : []),\n ];\n const both = parts.length > 1;\n logWarn(\n `${ref} ${parts.join(\" and \")} ${both ? \"are\" : \"is\"} still the scaffold placeholder; write ${both ? \"them\" : \"it\"} (\\`skaile validate\\` fails ${both ? \"them\" : \"it\"})`,\n );\n }\n}\n/**\n * Print an info line prefixed with a dim dot.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logInfo(msg: string) {\n console.log(` ${pc.dim(\"·\")} ${msg}`);\n}\n\n/** Full command path of the command being run (`harness set`), set before its action runs. */\nlet activeCommandPath: string | undefined;\n\n/**\n * Record the command that is about to run, as the path of subcommand names from the root\n * (`harness set`), so advice that repeats the command shows the whole path (p1656).\n */\nexport function setActiveCommand(cmd: { name(): string; parent: unknown }): void {\n const names: string[] = [];\n for (\n let c: { name(): string; parent: unknown } | null = cmd;\n c && c.parent;\n c = c.parent as { name(): string; parent: unknown } | null\n ) {\n names.unshift(c.name());\n }\n activeCommandPath = names.length > 0 ? names.join(\" \") : undefined;\n}\n\n/** The nearest parent directory of `dir` that holds a `skaile.yaml`, or `undefined`. */\nfunction nearestParentProject(dir: string): string | undefined {\n for (let up = path.dirname(dir); up !== dir; dir = up, up = path.dirname(dir)) {\n if (existsSync(path.join(up, SKAILE_YAML_DEFAULT))) return up;\n }\n return undefined;\n}\n\n/**\n * Print the `No skaile.yaml found` line for `projectDir`, plus a second line naming the nearest\n * parent directory that holds a `skaile.yaml`, when there is one: skaile does not search parent\n * directories. The line shows `--project-dir` after the full command path (`skaile harness set\n * --project-dir /x`), the only place the option is accepted (p1656).\n */\nexport function logNoProject(projectDir: string): void {\n const dir = path.resolve(projectDir);\n logErr(`No ${S.cmd(\"skaile.yaml\")} found. Run ${S.cmd(\"skaile init\")} to create one.`);\n const parent = nearestParentProject(dir);\n if (parent) {\n const command =\n activeCommandPath ?? process.argv.slice(2).find((a) => !a.startsWith(\"-\")) ?? \"<command>\";\n logErr(\n `${S.cmd(parent)} holds a ${S.cmd(\"skaile.yaml\")}: run from there or put the option after the command name: ${S.cmd(`skaile ${command} --project-dir ${parent}`)}.`,\n );\n }\n}\n\n/**\n * Stop a project command that has no usable project: print one `✗` line and exit 1, before\n * the command deploys, undeploys, locks or clones anything. Two causes: no `skaile.yaml` in\n * `projectDir` (`No skaile.yaml found`), or a `skaile.yaml` — project, app or user scope —\n * that does not parse (`<file> — parse error: …`, a duplicate key included). Without this a\n * broken file would read as \"nothing declared\" and `install` would undeploy every asset.\n *\n * Library-level commands (`library …`, `search`, `init`) have no project and do not call it.\n */\nexport function requireProjectConfig(\n projectDir: string,\n opts: { allowMissing?: boolean } = {},\n): void {\n const dir = path.resolve(projectDir);\n if (!existsSync(path.join(dir, SKAILE_YAML_DEFAULT))) {\n if (opts.allowMissing) return;\n logNoProject(dir);\n process.exit(1);\n }\n try {\n resolveSkWorkspaceConfig(dir);\n } catch (err) {\n logErr(err instanceof Error ? err.message : String(err));\n process.exit(1);\n }\n // A lock that is not valid YAML is not \"nothing locked\": `update` would overwrite it and\n // `outdated`/`why`/`check` would call every asset unlocked. One line, exit 1 (p1892).\n try {\n readLock(path.join(dir, \"skaile.lock.yaml\"));\n } catch (err) {\n if (err instanceof LockParseError) {\n logErr(err.message);\n process.exit(1);\n }\n // Another lock problem (an old schema) has its own message where the lock is used.\n }\n}\n\n/**\n * Hold warnings raised while a spinner animates and print them once it stops:\n * on a TTY a line written mid-spin is overwritten by the next frame. Pass\n * `push` as `AssetManager`'s `onLibraryCollision`, call `flush()` after\n * `spinner.stop(...)`. Warnings pushed after `flush()` print immediately.\n */\nexport function deferredWarnings(): { push: (msg: string) => void; flush: () => void } {\n const held: string[] = [];\n let live = false;\n return {\n push: (msg) => {\n if (live) logWarn(msg);\n else held.push(msg);\n },\n flush: () => {\n for (const msg of held.splice(0)) logWarn(msg);\n live = true;\n },\n };\n}\n\n/** Max stale copies of one harness named inline by {@link warnStaleHarnessCopies}. */\nconst STALE_COPY_LIST_MAX = 5;\n\n/**\n * Print one warning per harness whose project dir (`.claude/`, `.omp/`, `.codex/`) still holds\n * copies of tracked assets although the project deploys to another harness: after `skaile\n * harness set`, or when a project moved off the old default. Those copies are orphans: `remove`\n * / `clean` / `list` only look in the active harness dir. Every file a deploy created is named\n * (p1671). Nothing is deleted here; `skaile harness set <name> --clean` deletes them. Silent when\n * there are none.\n */\nexport function warnStaleHarnessCopies(am: {\n projectDir: string;\n harness: string;\n listStaleHarnessCopies(): Array<{ harness: HarnessName; path: string }>;\n}): void {\n let stale: Array<{ harness: HarnessName; path: string }>;\n try {\n stale = am.listStaleHarnessCopies();\n } catch {\n return; // advisory only — never fail the command\n }\n for (const harness of SUPPORTED_HARNESSES) {\n const rel = stale\n .filter((s) => s.harness === harness)\n .map((s) => path.relative(am.projectDir, s.path));\n if (rel.length === 0) continue;\n const dir = `${rel[0]?.split(path.sep)[0] ?? harness}/`;\n const shown = rel.slice(0, STALE_COPY_LIST_MAX).join(\", \");\n const more =\n rel.length > STALE_COPY_LIST_MAX ? `, +${rel.length - STALE_COPY_LIST_MAX} more` : \"\";\n logWarn(\n `Stale ${S.cmd(dir)} copies no longer managed (deploying to ${am.harness}): ${shown}${more}. ` +\n `Delete them with ${S.cmd(`skaile harness set ${am.harness} --clean`)}, or pass ${S.cmd(`--target ${harness}`)} to keep using ${dir}.`,\n );\n }\n}\n\n/**\n * Bare asset name of a canonical soft-dep target ref (`@pub/name@ver` → `name`),\n * for compact rendering in `info` / `tree` / `why`. Delegates to the asset-manager\n * parser (the soft-dep read surface) so the two never diverge.\n */\nexport function bareSoftDepName(ref: string): string {\n return softDepName(ref);\n}\n\n/**\n * The report-only soft-dep hint line shared by the `add` no-TTY branch and the\n * `install` surface, so the two user-facing wordings can't drift. Appends a\n * runnable `skaile add` suffix only when the target has a parseable ref.\n */\nexport function formatSoftDepHint(edge: { from: string; to: string; toRef?: string }): string {\n const suffix = edge.toRef ? ` — run \\`skaile add ${edge.toRef}\\` to include it.` : \"\";\n return `${bareSoftDepName(edge.from)} references ${bareSoftDepName(edge.to)} (soft dependency)${suffix}`;\n}\n\n/**\n * Build the \"Soft dependencies (inferred)\" section for `skaile info`. Returns one\n * header line plus one line per soft-dep target, each marked `(soft)` to read\n * differently from a typed `requires`. Empty array when there are no soft deps,\n * so the caller prints nothing.\n */\nexport function formatSoftDepSection(targets: string[]): string[] {\n if (targets.length === 0) return [];\n const out = [` ${S.label(\"Soft dependencies (inferred)\")}:`];\n for (const t of targets) out.push(` ${S.dim(\"·\")} ${t} ${S.dim(\"(soft)\")}`);\n return out;\n}\n\n/**\n * Footer line previewing the soft deps that *adding* the highlighted asset would\n * reference (manage TUI). \"references\" + \"not auto-added\" makes clear the pull is\n * report-only. Empty string when there are no targets, so the caller clears.\n */\nexport function formatSoftDepAddPreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`${name} references ${targets.join(\", \")} (soft dep, not auto-added)`);\n}\n\n/**\n * Footer line previewing the soft deps that *removing* the highlighted asset\n * would orphan (manage TUI) — symmetric with {@link formatSoftDepAddPreview}.\n * Empty string when nothing would be orphaned, so the caller clears.\n */\nexport function formatSoftDepRemovePreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`removing ${name} would orphan ${targets.join(\", \")} (soft dep)`);\n}\n\n/** Format a Date as a human-readable relative time string (e.g. \"5m ago\"). */\nexport function formatRelativeTime(date: Date): string {\n const diff = Date.now() - date.getTime();\n const seconds = Math.floor(diff / 1000);\n if (seconds < 60) return \"just now\";\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h ago`;\n const days = Math.floor(hours / 24);\n return `${days}d ago`;\n}\n\n/** Name the old `~/.omp/<dir>` copies a global deploy replaced (omp reads `~/.omp/agent/<dir>`). */\nexport function reportLegacyOmpCopies(removed: string[], kept: string[] = []): void {\n for (const p of removed) {\n logInfo(\n S.dim(`removed the old omp copy ${p.replace(homedir(), \"~\")} (omp reads ~/.omp/agent)`),\n );\n }\n for (const p of kept) {\n logWarn(\n `${p.replace(homedir(), \"~\")} is an old omp location and skaile did not write this copy, so it was kept: delete it if you do not need it`,\n );\n }\n}\n\n/**\n * Parse a `--harness a,b` value into validated {@link HarnessName}s, exiting on\n * an unknown id. Returns `undefined` when the flag is absent (the caller then\n * resolves the full global harness set).\n */\nexport function parseHarnessFilter(raw: string | undefined): HarnessName[] | undefined {\n if (!raw) return undefined;\n const ids = raw\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n const out: HarnessName[] = [];\n for (const id of ids) {\n if (!(SUPPORTED_HARNESSES as string[]).includes(id)) {\n logErr(unknownHarnessTargetMessage(id));\n process.exit(1);\n }\n out.push(id as HarnessName);\n }\n return out.length > 0 ? out : undefined;\n}\n\n/** The sentence the agent renderer puts into a delegate sub-agent's file (`asset-manager` fragments). */\nconst SUB_AGENT_MARKER = \"You are a sub-agent:\";\n\n/**\n * One line when a Codex project holds delegate sub-agents. Codex does not load\n * `.codex/agents/*.toml` as spawnable agents (its `spawn_agent` has no `agent_type`), so the\n * delegate exists only as a file there and the orchestrator cannot call it (p428). A delegate is\n * found by the sentence the renderer writes into its file. Silent for every other harness.\n */\nexport function warnFilesOnlyDelegates(projectDir: string, target: string): void {\n if (target !== \"codex\") return;\n const dir = path.join(projectDir, \".codex\", \"skaile-agents\");\n let names: string[];\n try {\n names = readdirSync(dir).filter((f) => f.endsWith(\".md\"));\n } catch {\n return;\n }\n const delegates = names\n .filter((f) => {\n try {\n return readFileSync(path.join(dir, f), \"utf8\").includes(SUB_AGENT_MARKER);\n } catch {\n return false;\n }\n })\n .map((f) => f.replace(/\\.md$/, \"\"))\n .sort();\n if (delegates.length === 0) return;\n logWarn(\n `codex: delegate agents are files only (${delegates.join(\", \")}): Codex does not load .codex/agents as sub-agents, so the orchestrator cannot call them`,\n );\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/harness-error.ts","../cli/src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;AAWO,SAAS,sBAAsB,OAAA,EAAqC;AACzE,EAAA,MAAM,QAAQ,aAAA,EAAc,CAAE,IAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAC7C,EAAA,IAAI,KAAA,CAAM,QAAA,CAAS,OAAO,CAAA,EAAG,OAAO,MAAA;AACpC,EAAA,OACE,CAAA,wBAAA,EAA2B,OAAO,CAAA,cAAA,EAAiB,KAAA,CAAM,IAAA,CAAK,IAAI,CAAC,CAAA,EAAA,EAChE,eAAe,CAAA,OAAA,EAAU,mBAAA,CAAoB,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA,CAAA;AAE9D;AAGA,IAAM,eAAA,GAAkB,+CAAA;AAWjB,SAAS,2BAAA,CACd,OAAA,EACA,KAAA,GAA2B,EAAC,EACpB;AACR,EAAA,MAAM,OAAA,GAAU,CAAC,GAAG,mBAAA,EAAqB,GAAG,KAAK,CAAA;AACjD,EAAA,MAAM,aAAa,aAAA,EAAc,CAAE,IAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAClD,EAAA,OACE,CAAA,wBAAA,EAA2B,OAAO,CAAA,cAAA,EAAiB,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA,yCAAA,EAC3B,UAAA,CAAW,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA,CAAA;AAEnE;AAEA,IAAI,gBAAA,GAAmB,KAAA;AAGhB,SAAS,wBAAA,GAAiC;AAC/C,EAAA,IAAI,gBAAA,EAAkB;AACtB,EAAA,gBAAA,GAAmB,IAAA;AACnB,EAAA,OAA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,EAAK;AACR,EAAA,IAAI,SAAA,CAAU,WAAW,CAAA,EAAG;AAC5B,EAAA,OAAA;AAAA,IACE,CAAA,uCAAA,EAA0C,SAAA,CAAU,IAAA,CAAK,IAAI,CAAC,CAAA,wFAAA;AAAA,GAChE;AACF","file":"chunk-DXBHGNSI.js","sourcesContent":["import { listHarnesses } from \"@skaile/workspaces/bridge\";\nimport { SUPPORTED_HARNESSES } from \"@skaile/workspaces/core\";\nimport { Option } from \"commander\";\n\n/**\n * The refusal for a harness name nothing registers, or `undefined` when it is known. One check\n * for `run` (also with `--dry-run`, so the plan never names a harness the real run refuses),\n * `repl` and `config set harness` (p1022). Load the project's plugins first: a plugin's harness\n * counts. The line names the other command group's names too (p1753), see\n * {@link unknownHarnessTargetMessage}.\n */\nexport function unknownHarnessMessage(harness: string): string | undefined {\n const known = listHarnesses().map((d) => d.id);\n if (known.includes(harness)) return undefined;\n return (\n `Unknown agent harness: \"${harness}\". Available: ${known.join(\", \")}. ` +\n `${DEPLOY_COMMANDS} take: ${SUPPORTED_HARNESSES.join(\", \")}.`\n );\n}\n\n/** The commands that write harness files, so they take the harness targets only. */\nconst DEPLOY_COMMANDS = \"harness set, init --harness and add --harness\";\n\n/**\n * The refusal for a name that is no harness target, for the commands that deploy files\n * (`harness set`, `init --harness`, `add --harness`, `integration --harness`). Same wording as\n * {@link unknownHarnessMessage}: the list is the targets, and the line names the commands that\n * run a session and take every registered harness (p1753).\n *\n * @param harness - The name the user typed.\n * @param extra - Further names the command takes, such as `all`.\n */\nexport function unknownHarnessTargetMessage(\n harness: string,\n extra: readonly string[] = [],\n): string {\n const targets = [...SUPPORTED_HARNESSES, ...extra];\n const registered = listHarnesses().map((d) => d.id);\n return (\n `Unknown agent harness: \"${harness}\". Available: ${targets.join(\", \")}. ` +\n `run, repl and config set harness take: ${registered.join(\", \")}.`\n );\n}\n\nlet warnedDriverFlag = false;\n\n/** Print the `--driver` deprecation line to stderr, once per process. */\nexport function warnDriverFlagDeprecated(): void {\n if (warnedDriverFlag) return;\n warnedDriverFlag = true;\n console.error(\"--driver is deprecated; use --harness\");\n}\n\n/**\n * The hidden `--driver <name>` option every command with `--harness <name>` keeps for one\n * major release: an alias that sets the same value (`--harness` wins when both are given).\n */\nexport function driverAliasOption(): Option {\n return new Option(\"--driver <name>\", \"Deprecated alias of --harness\").hideHelp();\n}\n\n/**\n * Fold a parsed `--driver` alias into `harness`: when `--driver` was given, print the\n * deprecation line once and use its value unless `--harness` (or `fallback`, when neither\n * flag was given) already decided. Returns `opts` with `harness` set and `driver` removed.\n */\nexport function foldDriverFlag<T extends { harness?: string; driver?: string }>(\n opts: T,\n fallback?: string,\n): Omit<T, \"driver\"> & { harness?: string } {\n const { driver, ...rest } = opts;\n if (driver !== undefined) warnDriverFlagDeprecated();\n return { ...rest, harness: rest.harness ?? driver ?? fallback };\n}\n\n/**\n * Turn a harness-start/prompt failure into a friendly, actionable message when the\n * cause is a missing/unusable agent binary; otherwise return `null` so the caller\n * surfaces the raw error unchanged.\n *\n * The bridge classifies these as `category: \"config\"` and carries a `hint`, but the\n * shape reaching the CLI varies: omp's `start()` rejects with the raw spawn error\n * (`code === \"ENOENT\"`), while the subprocess CLI harnesses reject with the classified\n * `AgentError` attached under `.detail`. Duck-type across all of them.\n */\nexport function friendlyHarnessError(err: unknown): string | null {\n const e = err as\n | {\n code?: string;\n syscall?: string;\n message?: string;\n category?: string;\n hint?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n if (!e) return null;\n\n // A missing binary is a *spawn* ENOENT (`syscall: \"spawn <bin>\"` / \"spawn … ENOENT\");\n // a bare ENOENT from connector/mount setup is a different failure, not the harness.\n const isSpawnEnoent =\n e.code === \"ENOENT\" &&\n (e.syscall?.startsWith(\"spawn\") === true || /^spawn .*ENOENT/.test(e.message ?? \"\"));\n const isConfig = e.category === \"config\" || e.detail?.category === \"config\";\n if (!isSpawnEnoent && !isConfig) return null;\n\n const hint = e.hint ?? e.detail?.hint;\n const base = hint ?? \"The configured agent binary is not installed or not on your PATH.\";\n return `${base}\\nTry a different harness with \\`--harness claude-sdk\\`.`;\n}\n\n/**\n * Lines that follow the single `✗` line of a failed turn: the classifier's hint\n * (or, for a rejected credential, a pointer at the key), and where the full\n * records are. The JSON records themselves are not printed on the terminal:\n * they live in the project's log database. The pointer names the session whose records\n * the failure left (`logSessionId`); a failure before any session started has none and\n * gets no pointer.\n */\nexport function harnessErrorNotes(err: unknown): string[] {\n const e = err as\n | {\n category?: string;\n hint?: string;\n logSessionId?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n const notes: string[] = [];\n const category = e?.category ?? e?.detail?.category;\n const hint = e?.hint ?? e?.detail?.hint;\n if (hint && category !== \"config\") notes.push(hint);\n else if (category === \"auth\") notes.push(\"Check your API key or login.\");\n if (e?.logSessionId) {\n notes.push(`Full records: .skaile/logs.db (skaile session logs ${e.logSessionId}).`);\n }\n return notes;\n}\n","import { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport path from \"node:path\";\nimport { softDepName } from \"@skaile/workspaces/asset-manager\";\nimport {\n type HarnessName,\n LockParseError,\n readLock,\n resolveSkWorkspaceConfig,\n SKAILE_YAML_DEFAULT,\n SUPPORTED_HARNESSES,\n} from \"@skaile/workspaces/core\";\nimport pc from \"picocolors\";\nimport { unknownHarnessTargetMessage } from \"./harness-error.ts\";\n\n/**\n * Terminal styling helpers used across all CLI commands.\n *\n * @docLink cli/dev-guide#helpers\n */\nexport const S = {\n brand: (s: string) => pc.cyan(pc.bold(s)),\n cmd: (s: string) => pc.cyan(s),\n heading: (s: string) => pc.bold(s),\n bold: (s: string) => pc.bold(s),\n dim: (s: string) => pc.dim(s),\n ok: (s: string) => pc.green(s),\n warn: (s: string) => pc.yellow(s),\n err: (s: string) => pc.red(s),\n label: (s: string) => pc.dim(s),\n rule: (w = 40) => pc.dim(\"─\".repeat(w)),\n};\n\nconst KIND_COLORS: Record<string, (s: string) => string> = {\n skill: pc.blue,\n agent: pc.magenta,\n prompt: pc.yellow,\n flow: pc.green,\n preset: pc.cyan,\n contract: pc.red,\n connector: pc.green,\n knowledge: pc.cyan,\n persona: pc.cyan,\n ruleset: pc.cyan,\n \"mcp-server\": pc.magenta,\n};\n\n/**\n * Fit a plain (ANSI-free) string into exactly `width` columns: truncate with a\n * trailing `…` when too long, pad with spaces when too short. Keeps fixed-width\n * columns from overflowing the row when a value (e.g. an asset name) is wider\n * than its budget.\n */\nexport function fitWidth(s: string, width: number): string {\n if (width <= 0) return \"\";\n if (s.length > width) return width === 1 ? \"…\" : `${s.slice(0, width - 1)}…`;\n return s.padEnd(width);\n}\n\n/** Color-code an asset kind string. */\nexport function kindColor(kind: string): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(kind);\n}\n\n/**\n * Widest kind label (`mcp-server`); the default kind-column width fits it so\n * long kinds don't shove the rest of the row out of alignment.\n */\nexport const KIND_COL_WIDTH = 10;\n\n/**\n * Shared `--target` help suffix: with no flag, the manager deploys into the\n * harness the project is configured for (the harness `skaile config show`\n * resolves), and only then falls back to `claude-code`.\n */\nexport const TARGET_DEFAULT_HINT = \"default: the project's configured harness, else claude-code\";\n\n/**\n * Color-code an asset kind string fit to exactly `width` columns — pads short\n * kinds, truncates over-long ones (via {@link fitWidth}) so the column can never\n * overflow and break row alignment.\n */\nexport function kindColorPad(kind: string, width = KIND_COL_WIDTH): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(fitWidth(kind, width));\n}\n\n/** Color-code a \"kind:name\" reference string. */\nexport function colorRef(ref: string): string {\n const colonIdx = ref.indexOf(\":\");\n if (colonIdx === -1) return ref;\n const kind = ref.slice(0, colonIdx);\n const rest = ref.slice(colonIdx);\n return `${kindColor(kind)}${rest}`;\n}\n\n/**\n * Print a success line prefixed with a green check mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logOk(msg: string) {\n console.log(` ${pc.green(\"✓\")} ${msg}`);\n}\n/**\n * Print an error line prefixed with a red cross to stderr.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logErr(msg: string) {\n console.error(` ${pc.red(\"✗\")} ${msg}`);\n}\n/**\n * Print a warning line prefixed with a yellow exclamation mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logWarn(msg: string) {\n console.log(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * Like {@link logWarn}, on stderr: a warning about the run itself (an asset scan that stopped\n * early) that must not land in the output a script reads from stdout.\n *\n * @param msg - Message to display.\n */\nexport function logWarnErr(msg: string) {\n console.error(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * One `!` line per deployed library asset whose body or description is still the untouched\n * `library create` scaffold: `validate` and the publish plan fail both, so `add`, `install` and\n * `update` name every placeholder they fail (p926).\n *\n * @param bodies - Canonical refs the asset manager reported as placeholder bodies.\n * @param descriptions - Canonical refs the asset manager reported as placeholder descriptions.\n */\nexport function warnPlaceholderBodies(\n bodies: readonly string[] | undefined,\n descriptions?: readonly string[],\n) {\n const refs = [...new Set([...(bodies ?? []), ...(descriptions ?? [])])];\n for (const ref of refs) {\n const parts = [\n ...(descriptions?.includes(ref) ? [\"description\"] : []),\n ...(bodies?.includes(ref) ? [\"body\"] : []),\n ];\n const both = parts.length > 1;\n logWarn(\n `${ref} ${parts.join(\" and \")} ${both ? \"are\" : \"is\"} still the scaffold placeholder; write ${both ? \"them\" : \"it\"} (\\`skaile validate\\` fails ${both ? \"them\" : \"it\"})`,\n );\n }\n}\n/**\n * Print an info line prefixed with a dim dot.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logInfo(msg: string) {\n console.log(` ${pc.dim(\"·\")} ${msg}`);\n}\n\n/** Full command path of the command being run (`harness set`), set before its action runs. */\nlet activeCommandPath: string | undefined;\n\n/**\n * Record the command that is about to run, as the path of subcommand names from the root\n * (`harness set`), so advice that repeats the command shows the whole path (p1656).\n */\nexport function setActiveCommand(cmd: { name(): string; parent: unknown }): void {\n const names: string[] = [];\n for (\n let c: { name(): string; parent: unknown } | null = cmd;\n c && c.parent;\n c = c.parent as { name(): string; parent: unknown } | null\n ) {\n names.unshift(c.name());\n }\n activeCommandPath = names.length > 0 ? names.join(\" \") : undefined;\n}\n\n/** The nearest parent directory of `dir` that holds a `skaile.yaml`, or `undefined`. */\nfunction nearestParentProject(dir: string): string | undefined {\n for (let up = path.dirname(dir); up !== dir; dir = up, up = path.dirname(dir)) {\n if (existsSync(path.join(up, SKAILE_YAML_DEFAULT))) return up;\n }\n return undefined;\n}\n\n/**\n * Print the `No skaile.yaml found` line for `projectDir`, plus a second line naming the nearest\n * parent directory that holds a `skaile.yaml`, when there is one: skaile does not search parent\n * directories. The line shows `--project-dir` after the full command path (`skaile harness set\n * --project-dir /x`), the only place the option is accepted (p1656).\n */\nexport function logNoProject(projectDir: string): void {\n const dir = path.resolve(projectDir);\n logErr(`No ${S.cmd(\"skaile.yaml\")} found. Run ${S.cmd(\"skaile init\")} to create one.`);\n const parent = nearestParentProject(dir);\n if (parent) {\n const command =\n activeCommandPath ?? process.argv.slice(2).find((a) => !a.startsWith(\"-\")) ?? \"<command>\";\n logErr(\n `${S.cmd(parent)} holds a ${S.cmd(\"skaile.yaml\")}: run from there or put the option after the command name: ${S.cmd(`skaile ${command} --project-dir ${parent}`)}.`,\n );\n }\n}\n\n/**\n * Stop a project command that has no usable project: print one `✗` line and exit 1, before\n * the command deploys, undeploys, locks or clones anything. Two causes: no `skaile.yaml` in\n * `projectDir` (`No skaile.yaml found`), or a `skaile.yaml` — project, app or user scope —\n * that does not parse (`<file> — parse error: …`, a duplicate key included). Without this a\n * broken file would read as \"nothing declared\" and `install` would undeploy every asset.\n *\n * Library-level commands (`library …`, `search`, `init`) have no project and do not call it.\n */\nexport function requireProjectConfig(\n projectDir: string,\n opts: { allowMissing?: boolean } = {},\n): void {\n const dir = path.resolve(projectDir);\n if (!existsSync(path.join(dir, SKAILE_YAML_DEFAULT))) {\n if (opts.allowMissing) return;\n logNoProject(dir);\n process.exit(1);\n }\n try {\n resolveSkWorkspaceConfig(dir);\n } catch (err) {\n logErr(err instanceof Error ? err.message : String(err));\n process.exit(1);\n }\n // A lock that is not valid YAML is not \"nothing locked\": `update` would overwrite it and\n // `outdated`/`why`/`check` would call every asset unlocked. One line, exit 1 (p1892).\n try {\n readLock(path.join(dir, \"skaile.lock.yaml\"));\n } catch (err) {\n if (err instanceof LockParseError) {\n logErr(err.message);\n process.exit(1);\n }\n // Another lock problem (an old schema) has its own message where the lock is used.\n }\n}\n\n/**\n * Hold warnings raised while a spinner animates and print them once it stops:\n * on a TTY a line written mid-spin is overwritten by the next frame. Pass\n * `push` as `AssetManager`'s `onLibraryCollision`, call `flush()` after\n * `spinner.stop(...)`. Warnings pushed after `flush()` print immediately.\n */\nexport function deferredWarnings(): { push: (msg: string) => void; flush: () => void } {\n const held: string[] = [];\n let live = false;\n return {\n push: (msg) => {\n if (live) logWarn(msg);\n else held.push(msg);\n },\n flush: () => {\n for (const msg of held.splice(0)) logWarn(msg);\n live = true;\n },\n };\n}\n\n/** Max stale copies of one harness named inline by {@link warnStaleHarnessCopies}. */\nconst STALE_COPY_LIST_MAX = 5;\n\n/**\n * Print one warning per harness whose project dir (`.claude/`, `.omp/`, `.codex/`) still holds\n * copies of tracked assets although the project deploys to another harness: after `skaile\n * harness set`, or when a project moved off the old default. Those copies are orphans: `remove`\n * / `clean` / `list` only look in the active harness dir. Every file a deploy created is named\n * (p1671). Nothing is deleted here; `skaile harness set <name> --clean` deletes them. Silent when\n * there are none.\n */\nexport function warnStaleHarnessCopies(am: {\n projectDir: string;\n harness: string;\n listStaleHarnessCopies(): Array<{ harness: HarnessName; path: string }>;\n}): void {\n let stale: Array<{ harness: HarnessName; path: string }>;\n try {\n stale = am.listStaleHarnessCopies();\n } catch {\n return; // advisory only — never fail the command\n }\n for (const harness of SUPPORTED_HARNESSES) {\n const rel = stale\n .filter((s) => s.harness === harness)\n .map((s) => path.relative(am.projectDir, s.path));\n if (rel.length === 0) continue;\n const dir = `${rel[0]?.split(path.sep)[0] ?? harness}/`;\n const shown = rel.slice(0, STALE_COPY_LIST_MAX).join(\", \");\n const more =\n rel.length > STALE_COPY_LIST_MAX ? `, +${rel.length - STALE_COPY_LIST_MAX} more` : \"\";\n logWarn(\n `Stale ${S.cmd(dir)} copies no longer managed (deploying to ${am.harness}): ${shown}${more}. ` +\n `Delete them with ${S.cmd(`skaile harness set ${am.harness} --clean`)}, or pass ${S.cmd(`--target ${harness}`)} to keep using ${dir}.`,\n );\n }\n}\n\n/**\n * Bare asset name of a canonical soft-dep target ref (`@pub/name@ver` → `name`),\n * for compact rendering in `info` / `tree` / `why`. Delegates to the asset-manager\n * parser (the soft-dep read surface) so the two never diverge.\n */\nexport function bareSoftDepName(ref: string): string {\n return softDepName(ref);\n}\n\n/**\n * The report-only soft-dep hint line shared by the `add` no-TTY branch and the\n * `install` surface, so the two user-facing wordings can't drift. Appends a\n * runnable `skaile add` suffix only when the target has a parseable ref.\n */\nexport function formatSoftDepHint(edge: { from: string; to: string; toRef?: string }): string {\n const suffix = edge.toRef ? ` — run \\`skaile add ${edge.toRef}\\` to include it.` : \"\";\n return `${bareSoftDepName(edge.from)} references ${bareSoftDepName(edge.to)} (soft dependency)${suffix}`;\n}\n\n/**\n * Build the \"Soft dependencies (inferred)\" section for `skaile info`. Returns one\n * header line plus one line per soft-dep target, each marked `(soft)` to read\n * differently from a typed `requires`. Empty array when there are no soft deps,\n * so the caller prints nothing.\n */\nexport function formatSoftDepSection(targets: string[]): string[] {\n if (targets.length === 0) return [];\n const out = [` ${S.label(\"Soft dependencies (inferred)\")}:`];\n for (const t of targets) out.push(` ${S.dim(\"·\")} ${t} ${S.dim(\"(soft)\")}`);\n return out;\n}\n\n/**\n * Footer line previewing the soft deps that *adding* the highlighted asset would\n * reference (manage TUI). \"references\" + \"not auto-added\" makes clear the pull is\n * report-only. Empty string when there are no targets, so the caller clears.\n */\nexport function formatSoftDepAddPreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`${name} references ${targets.join(\", \")} (soft dep, not auto-added)`);\n}\n\n/**\n * Footer line previewing the soft deps that *removing* the highlighted asset\n * would orphan (manage TUI) — symmetric with {@link formatSoftDepAddPreview}.\n * Empty string when nothing would be orphaned, so the caller clears.\n */\nexport function formatSoftDepRemovePreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`removing ${name} would orphan ${targets.join(\", \")} (soft dep)`);\n}\n\n/** Format a Date as a human-readable relative time string (e.g. \"5m ago\"). */\nexport function formatRelativeTime(date: Date): string {\n const diff = Date.now() - date.getTime();\n const seconds = Math.floor(diff / 1000);\n if (seconds < 60) return \"just now\";\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h ago`;\n const days = Math.floor(hours / 24);\n return `${days}d ago`;\n}\n\n/** Name the old `~/.omp/<dir>` copies a global deploy replaced (omp reads `~/.omp/agent/<dir>`). */\nexport function reportLegacyOmpCopies(removed: string[], kept: string[] = []): void {\n for (const p of removed) {\n logInfo(\n S.dim(`removed the old omp copy ${p.replace(homedir(), \"~\")} (omp reads ~/.omp/agent)`),\n );\n }\n for (const p of kept) {\n logWarn(\n `${p.replace(homedir(), \"~\")} is an old omp location and skaile did not write this copy, so it was kept: delete it if you do not need it`,\n );\n }\n}\n\n/**\n * Parse a `--harness a,b` value into validated {@link HarnessName}s, exiting on\n * an unknown id. Returns `undefined` when the flag is absent (the caller then\n * resolves the full global harness set).\n */\nexport function parseHarnessFilter(raw: string | undefined): HarnessName[] | undefined {\n if (!raw) return undefined;\n const ids = raw\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n const out: HarnessName[] = [];\n for (const id of ids) {\n if (!(SUPPORTED_HARNESSES as string[]).includes(id)) {\n logErr(unknownHarnessTargetMessage(id));\n process.exit(1);\n }\n out.push(id as HarnessName);\n }\n return out.length > 0 ? out : undefined;\n}\n\n/** The sentence the agent renderer puts into a delegate sub-agent's file (`asset-manager` fragments). */\nconst SUB_AGENT_MARKER = \"You are a sub-agent:\";\n\n/**\n * One line when a Codex project holds delegate sub-agents. Codex does not load\n * `.codex/agents/*.toml` as spawnable agents (its `spawn_agent` has no `agent_type`), so the\n * delegate exists only as a file there and the orchestrator cannot call it (p428). A delegate is\n * found by the sentence the renderer writes into its file. Silent for every other harness.\n */\nexport function warnFilesOnlyDelegates(projectDir: string, target: string): void {\n if (target !== \"codex\") return;\n const dir = path.join(projectDir, \".codex\", \"skaile-agents\");\n let names: string[];\n try {\n names = readdirSync(dir).filter((f) => f.endsWith(\".md\"));\n } catch {\n return;\n }\n const delegates = names\n .filter((f) => {\n try {\n return readFileSync(path.join(dir, f), \"utf8\").includes(SUB_AGENT_MARKER);\n } catch {\n return false;\n }\n })\n .map((f) => f.replace(/\\.md$/, \"\"))\n .sort();\n if (delegates.length === 0) return;\n logWarn(\n `codex: delegate agents are files only (${delegates.join(\", \")}): Codex does not load .codex/agents as sub-agents, so the orchestrator cannot call them`,\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { checkAgentInstances } from './chunk-DFP476EU.js';
2
2
  import { loadDeclaredPlugins } from './chunk-QW5B3TEO.js';
3
- import { unknownHarnessMessage, logErr, logWarn } from './chunk-L3JQJ6D5.js';
3
+ import { unknownHarnessMessage, logErr, logWarn } from './chunk-DXBHGNSI.js';
4
4
  import { loadSkWorkspaceConfig, SKAILE_YAML_DEFAULT } from './chunk-O7ADRMCR.js';
5
5
  import fs from 'fs';
6
6
  import path from 'path';
@@ -79,5 +79,5 @@ async function reportProjectConfig(projectDir, opts) {
79
79
  }
80
80
 
81
81
  export { agentInstanceErrorLines, agentInstanceWarningLines, reportProjectConfig, reportUnknownHarnesses, unknownHarnessErrors, unknownKeyWarnings };
82
- //# sourceMappingURL=chunk-CTRTFMCX.js.map
83
- //# sourceMappingURL=chunk-CTRTFMCX.js.map
82
+ //# sourceMappingURL=chunk-E5AZA2FL.js.map
83
+ //# sourceMappingURL=chunk-E5AZA2FL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/config-checks.ts"],"names":["parseYaml"],"mappings":";;;;;;;;AAeO,SAAS,kBAAA,CAAmB,aAAoC,KAAA,EAAyB;AAC9F,EAAA,OAAO,YACJ,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,IAAA,KAAS,wBAAwB,CAAA,CAAE,IAAA,KAAS,qBAAqB,CAAA,CACjF,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,EAAG,KAAK,CAAA,EAAA,EAAK,CAAA,CAAE,OAAO,CAAA,CAAE,CAAA;AACxC;AAGO,IAAM,sBAAA,GAAyB,CAAC,wBAAA,EAA0B,mBAAmB,CAAA;AAO7E,SAAS,sBAAA,CACd,aACA,KAAA,EACU;AACV,EAAA,OAAO,WAAA,CACJ,OAAO,CAAC,CAAA,KAAO,uBAA6C,QAAA,CAAS,CAAA,CAAE,IAAI,CAAC,CAAA,CAC5E,IAAI,CAAC,CAAA,KAAM,GAAG,KAAK,CAAA,uBAAA,EAAqB,EAAE,IAAI,CAAA,EAAA,EAAK,CAAA,CAAE,OAAO,CAAA,CAAE,CAAA;AACnE;AAWA,eAAsB,oBAAA,CACpB,UAAA,EACA,MAAA,EACA,KAAA,EACmB;AACnB,EAAA,MAAM,WAAW,MAAA,CAAO,OAAA,CAAQ,OAAO,YAAA,IAAgB,EAAE,CAAA,CAAE,MAAA;AAAA,IACzD,CAAC,CAAA,KAA0C,OAAO,CAAA,CAAE,CAAC,GAAG,OAAA,KAAY;AAAA,GACtE;AACA,EAAA,IAAI,QAAA,CAAS,KAAA,CAAM,CAAC,GAAG,CAAC,CAAA,KAAM,qBAAA,CAAsB,CAAA,CAAE,OAAO,CAAA,KAAM,MAAS,CAAA,SAAU,EAAC;AACvF,EAAA,MAAM,oBAAoB,UAAU,CAAA;AACp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UAAW,IAAI,CAAA;AACtE,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,GAAI,IAAA,CAAK,OAAA,GAAU,MAAM,oBAAA,CAAqB,YAAY,IAAA,CAAK,MAAA,EAAQ,aAAa,CAAA,GAAI,EAAC;AAAA,IACzF,GAAI,IAAA,CAAK,SAAA,GAAY,uBAAA,CAAwB,UAAU,IAAI;AAAC,GAC9D;AACA,EAAA,KAAA,MAAW,IAAA,IAAQ,MAAA,EAAQ,MAAA,CAAO,IAAI,CAAA;AACtC,EAAA,OAAO,MAAA,CAAO,MAAA;AAChB","file":"chunk-CTRTFMCX.js","sourcesContent":["/**\n * Checks of a project's `skaile.yaml` that `validate`, `check`, `doctor` and `run` share:\n * keys nothing reads (p1474) and a `harness:` no harness registers (p1022).\n */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { Diagnostic, SkWorkspaceConfig } from \"@skaile/workspaces/core\";\nimport { loadSkWorkspaceConfig, SKAILE_YAML_DEFAULT } from \"@skaile/workspaces/core\";\nimport { parse as parseYaml } from \"yaml\";\nimport { checkAgentInstances } from \"./commands/validate-instances.ts\";\nimport { unknownHarnessMessage } from \"./harness-error.ts\";\nimport { logErr, logWarn } from \"./helpers.ts\";\nimport { loadDeclaredPlugins } from \"./plugin-store/index.ts\";\n\n/** One warning line per key of the file that nothing reads. */\nexport function unknownKeyWarnings(diagnostics: readonly Diagnostic[], label: string): string[] {\n return diagnostics\n .filter((d) => d.code === \"unknown_config_key\" || d.code === \"unknown_profile_key\")\n .map((d) => `${label}: ${d.message}`);\n}\n\n/** The `agent-config` key diagnostics that name a replacement: the old `driver` and the retired `agent`. */\nexport const AGENT_CONFIG_KEY_CODES = [\"deprecated_harness_key\", \"retired_agent_key\"] as const;\n\n/**\n * One warning line per `agent-config` key that is deprecated (`driver`, p1873) or retired\n * (`agent`, p1874): still read or ignored, and `skaile migrate harness` fixes it. `validate`,\n * `check`, `doctor`, `run` and `config show` print the same line.\n */\nexport function agentConfigKeyWarnings(\n diagnostics: readonly Diagnostic[],\n label: string,\n): string[] {\n return diagnostics\n .filter((d) => (AGENT_CONFIG_KEY_CODES as readonly string[]).includes(d.code))\n .map((d) => `${label} [agent-config] — ${d.code}: ${d.message}`);\n}\n\n/**\n * One error line per `agent-config` profile whose `harness:` nothing registers. The harnesses of\n * the plugins the project declares count, so they are loaded before the verdict, and only when\n * some profile names a harness the built-in ones do not.\n *\n * @param projectDir - Project whose `plugins:` are loaded.\n * @param config - The decoded config file.\n * @param label - File name for the line.\n */\nexport async function unknownHarnessErrors(\n projectDir: string,\n config: SkWorkspaceConfig,\n label: string,\n): Promise<string[]> {\n const profiles = Object.entries(config.agent_config ?? {}).filter(\n (e): e is [string, { harness: string }] => typeof e[1]?.harness === \"string\",\n );\n if (profiles.every(([, p]) => unknownHarnessMessage(p.harness) === undefined)) return [];\n await loadDeclaredPlugins(projectDir);\n const errors: string[] = [];\n for (const [name, p] of profiles) {\n const refusal = unknownHarnessMessage(p.harness);\n if (refusal) errors.push(`${label}: agent-config.${name}.harness: ${refusal}`);\n }\n return errors;\n}\n\n/**\n * Print the `✗` line for each `agent-config` profile whose `harness:` nothing registers and\n * return how many were printed. The harness check `install`, `list` and `config show` share with\n * `validate`, `check` and `run` (p1754); a file that does not load is not this function's to\n * report.\n */\nexport async function reportUnknownHarnesses(projectDir: string): Promise<number> {\n let config: SkWorkspaceConfig | undefined;\n try {\n config = loadSkWorkspaceConfig(projectDir)?.config;\n } catch {\n return 0;\n }\n if (!config) return 0;\n const errors = await unknownHarnessErrors(projectDir, config, \"skaile.yaml\");\n for (const line of errors) logErr(line);\n return errors.length;\n}\n\n/** The `agents:` / `agent:` diagnostics of the project's `skaile.yaml` as `validate` gives them. */\nfunction agentInstanceDiagnostics(projectDir: string): Diagnostic[] {\n let parsed: unknown;\n try {\n parsed = parseYaml(fs.readFileSync(path.join(projectDir, SKAILE_YAML_DEFAULT), \"utf-8\"));\n } catch {\n return [];\n }\n if (typeof parsed !== \"object\" || parsed === null) return [];\n return checkAgentInstances(projectDir, parsed as Record<string, unknown>);\n}\n\n/** One line the way `validate` prints a diagnostic of the `agents:` map. */\nfunction agentInstanceLine(d: Diagnostic): string {\n return `${SKAILE_YAML_DEFAULT} [agents] — ${d.code}: ${d.path ? `${d.path}: ` : \"\"}${d.message}`;\n}\n\n/**\n * The errors `skaile validate` gives the `agents:` map of the project's `skaile.yaml`, as the\n * lines `validate` prints (p1512): a lifecycle or memory scope that is none of the known ones, a\n * `role` instance whose agent declares no `io`, a connector or trigger the agent does not have.\n * `install`, `check`, `run`, `repl` and `rebuild` refuse the project with them, so they never\n * accept what `validate` rejects. A ref that does not resolve is left out: `install` resolves a\n * catalog ref itself and `check` reports an unbound ref as a gap.\n *\n * @param projectDir - Project directory.\n */\nexport function agentInstanceErrorLines(projectDir: string): string[] {\n return agentInstanceDiagnostics(projectDir)\n .filter((d) => d.severity === \"error\" && d.code !== \"agent_ref_unresolved\")\n .map(agentInstanceLine);\n}\n\n/**\n * The warnings `skaile validate` gives for keys of `agent:` and `agents:` that nothing reads\n * (p1712), as the lines `validate` prints: `agents.audit.colour`, `agent.modle`,\n * `agents.<id>.model.preffered`. Without them a typo leaves the default model or budget in\n * place and says nothing.\n *\n * @param projectDir - Project directory.\n */\nexport function agentInstanceWarningLines(projectDir: string): string[] {\n return agentInstanceDiagnostics(projectDir)\n .filter(\n (d) =>\n d.severity === \"warning\" &&\n (d.code === \"unknown_agent_instance_key\" || d.code === \"unknown_agent_key\"),\n )\n .map(agentInstanceLine);\n}\n\n/**\n * The checks of the project's own `skaile.yaml`, printed: `!` lines for unknown keys (also the\n * ones of `agent:` and `agents:`, p1712), `✗` lines for an unknown harness and for an `agents:`\n * map `validate` rejects. Returns the number of errors printed. A file that does not load is not\n * this function's to report: the command reads it again and says so.\n *\n * @param projectDir - Project directory.\n * @param opts.harness - Also refuse an unknown `harness:` (`check`, `doctor`).\n * @param opts.instances - Also refuse an `agents:` map `validate` rejects (p1512).\n */\nexport async function reportProjectConfig(\n projectDir: string,\n opts: { harness: boolean; instances?: boolean },\n): Promise<number> {\n let file: ReturnType<typeof loadSkWorkspaceConfig>;\n try {\n file = loadSkWorkspaceConfig(projectDir);\n } catch {\n return 0;\n }\n if (!file) return 0;\n for (const line of unknownKeyWarnings(file.diagnostics ?? [], \"skaile.yaml\")) logWarn(line);\n for (const line of agentConfigKeyWarnings(file.diagnostics ?? [], \"skaile.yaml\")) logWarn(line);\n for (const line of agentInstanceWarningLines(projectDir)) logWarn(line);\n const errors = [\n ...(opts.harness ? await unknownHarnessErrors(projectDir, file.config, \"skaile.yaml\") : []),\n ...(opts.instances ? agentInstanceErrorLines(projectDir) : []),\n ];\n for (const line of errors) logErr(line);\n return errors.length;\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/config-checks.ts"],"names":["parseYaml"],"mappings":";;;;;;;;AAeO,SAAS,kBAAA,CAAmB,aAAoC,KAAA,EAAyB;AAC9F,EAAA,OAAO,YACJ,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,IAAA,KAAS,wBAAwB,CAAA,CAAE,IAAA,KAAS,qBAAqB,CAAA,CACjF,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,EAAG,KAAK,CAAA,EAAA,EAAK,CAAA,CAAE,OAAO,CAAA,CAAE,CAAA;AACxC;AAGO,IAAM,sBAAA,GAAyB,CAAC,wBAAA,EAA0B,mBAAmB,CAAA;AAO7E,SAAS,sBAAA,CACd,aACA,KAAA,EACU;AACV,EAAA,OAAO,WAAA,CACJ,OAAO,CAAC,CAAA,KAAO,uBAA6C,QAAA,CAAS,CAAA,CAAE,IAAI,CAAC,CAAA,CAC5E,IAAI,CAAC,CAAA,KAAM,GAAG,KAAK,CAAA,uBAAA,EAAqB,EAAE,IAAI,CAAA,EAAA,EAAK,CAAA,CAAE,OAAO,CAAA,CAAE,CAAA;AACnE;AAWA,eAAsB,oBAAA,CACpB,UAAA,EACA,MAAA,EACA,KAAA,EACmB;AACnB,EAAA,MAAM,WAAW,MAA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AM,OAAO,CAAA;AAClB,EAAA,KAAA,MAAW,IAAA,IAAQ,mBAAmB,IAAA,CAAK,WAAA,IAAe,EAAC,EAAG,aAAa,CAAA,EAAG,OAAA,CAAQ,IAAI,CAAA;AAC1F,EAAA,KAAA,MAAW,IAAA,IAAQ,uBAAuB,IAAA,CAAK,WAAA,IAAe,EAAC,EAAG,aAAa,CAAA,EAAG,OAAA,CAAQ,IAAI,CAAA;AAC9F,EAAA,KAAA,MAAW,IAAA,IAAQ,yBAAA,CAA0B,UAAU,CAAA,UAAW,IAAI,CAAA;AACtE,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,GAAI,IAAA,CAAK,OAAA,GAAU,MAAM,oBAAA,CAAqB,YAAY,IAAA,CAAK,MAAA,EAAQ,aAAa,CAAA,GAAI,EAAC;AAAA,IACzF,GAAI,IAAA,CAAK,SAAA,GAAY,uBAAA,CAAwB,UAAU,IAAI;AAAC,GAC9D;AACA,EAAA,KAAA,MAAW,IAAA,IAAQ,MAAA,EAAQ,MAAA,CAAO,IAAI,CAAA;AACtC,EAAA,OAAO,MAAA,CAAO,MAAA;AAChB","file":"chunk-E5AZA2FL.js","sourcesContent":["/**\n * Checks of a project's `skaile.yaml` that `validate`, `check`, `doctor` and `run` share:\n * keys nothing reads (p1474) and a `harness:` no harness registers (p1022).\n */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { Diagnostic, SkWorkspaceConfig } from \"@skaile/workspaces/core\";\nimport { loadSkWorkspaceConfig, SKAILE_YAML_DEFAULT } from \"@skaile/workspaces/core\";\nimport { parse as parseYaml } from \"yaml\";\nimport { checkAgentInstances } from \"./commands/validate-instances.ts\";\nimport { unknownHarnessMessage } from \"./harness-error.ts\";\nimport { logErr, logWarn } from \"./helpers.ts\";\nimport { loadDeclaredPlugins } from \"./plugin-store/index.ts\";\n\n/** One warning line per key of the file that nothing reads. */\nexport function unknownKeyWarnings(diagnostics: readonly Diagnostic[], label: string): string[] {\n return diagnostics\n .filter((d) => d.code === \"unknown_config_key\" || d.code === \"unknown_profile_key\")\n .map((d) => `${label}: ${d.message}`);\n}\n\n/** The `agent-config` key diagnostics that name a replacement: the old `driver` and the retired `agent`. */\nexport const AGENT_CONFIG_KEY_CODES = [\"deprecated_harness_key\", \"retired_agent_key\"] as const;\n\n/**\n * One warning line per `agent-config` key that is deprecated (`driver`, p1873) or retired\n * (`agent`, p1874): still read or ignored, and `skaile migrate harness` fixes it. `validate`,\n * `check`, `doctor`, `run` and `config show` print the same line.\n */\nexport function agentConfigKeyWarnings(\n diagnostics: readonly Diagnostic[],\n label: string,\n): string[] {\n return diagnostics\n .filter((d) => (AGENT_CONFIG_KEY_CODES as readonly string[]).includes(d.code))\n .map((d) => `${label} [agent-config] — ${d.code}: ${d.message}`);\n}\n\n/**\n * One error line per `agent-config` profile whose `harness:` nothing registers. The harnesses of\n * the plugins the project declares count, so they are loaded before the verdict, and only when\n * some profile names a harness the built-in ones do not.\n *\n * @param projectDir - Project whose `plugins:` are loaded.\n * @param config - The decoded config file.\n * @param label - File name for the line.\n */\nexport async function unknownHarnessErrors(\n projectDir: string,\n config: SkWorkspaceConfig,\n label: string,\n): Promise<string[]> {\n const profiles = Object.entries(config.agent_config ?? {}).filter(\n (e): e is [string, { harness: string }] => typeof e[1]?.harness === \"string\",\n );\n if (profiles.every(([, p]) => unknownHarnessMessage(p.harness) === undefined)) return [];\n await loadDeclaredPlugins(projectDir);\n const errors: string[] = [];\n for (const [name, p] of profiles) {\n const refusal = unknownHarnessMessage(p.harness);\n if (refusal) errors.push(`${label}: agent-config.${name}.harness: ${refusal}`);\n }\n return errors;\n}\n\n/**\n * Print the `✗` line for each `agent-config` profile whose `harness:` nothing registers and\n * return how many were printed. The harness check `install`, `list` and `config show` share with\n * `validate`, `check` and `run` (p1754); a file that does not load is not this function's to\n * report.\n */\nexport async function reportUnknownHarnesses(projectDir: string): Promise<number> {\n let config: SkWorkspaceConfig | undefined;\n try {\n config = loadSkWorkspaceConfig(projectDir)?.config;\n } catch {\n return 0;\n }\n if (!config) return 0;\n const errors = await unknownHarnessErrors(projectDir, config, \"skaile.yaml\");\n for (const line of errors) logErr(line);\n return errors.length;\n}\n\n/** The `agents:` / `agent:` diagnostics of the project's `skaile.yaml` as `validate` gives them. */\nfunction agentInstanceDiagnostics(projectDir: string): Diagnostic[] {\n let parsed: unknown;\n try {\n parsed = parseYaml(fs.readFileSync(path.join(projectDir, SKAILE_YAML_DEFAULT), \"utf-8\"));\n } catch {\n return [];\n }\n if (typeof parsed !== \"object\" || parsed === null) return [];\n return checkAgentInstances(projectDir, parsed as Record<string, unknown>);\n}\n\n/** One line the way `validate` prints a diagnostic of the `agents:` map. */\nfunction agentInstanceLine(d: Diagnostic): string {\n return `${SKAILE_YAML_DEFAULT} [agents] — ${d.code}: ${d.path ? `${d.path}: ` : \"\"}${d.message}`;\n}\n\n/**\n * The errors `skaile validate` gives the `agents:` map of the project's `skaile.yaml`, as the\n * lines `validate` prints (p1512): a lifecycle or memory scope that is none of the known ones, a\n * `role` instance whose agent declares no `io`, a connector or trigger the agent does not have.\n * `install`, `check`, `run`, `repl` and `rebuild` refuse the project with them, so they never\n * accept what `validate` rejects. A ref that does not resolve is left out: `install` resolves a\n * catalog ref itself and `check` reports an unbound ref as a gap.\n *\n * @param projectDir - Project directory.\n */\nexport function agentInstanceErrorLines(projectDir: string): string[] {\n return agentInstanceDiagnostics(projectDir)\n .filter((d) => d.severity === \"error\" && d.code !== \"agent_ref_unresolved\")\n .map(agentInstanceLine);\n}\n\n/**\n * The warnings `skaile validate` gives for keys of `agent:` and `agents:` that nothing reads\n * (p1712), as the lines `validate` prints: `agents.audit.colour`, `agent.modle`,\n * `agents.<id>.model.preffered`. Without them a typo leaves the default model or budget in\n * place and says nothing.\n *\n * @param projectDir - Project directory.\n */\nexport function agentInstanceWarningLines(projectDir: string): string[] {\n return agentInstanceDiagnostics(projectDir)\n .filter(\n (d) =>\n d.severity === \"warning\" &&\n (d.code === \"unknown_agent_instance_key\" || d.code === \"unknown_agent_key\"),\n )\n .map(agentInstanceLine);\n}\n\n/**\n * The checks of the project's own `skaile.yaml`, printed: `!` lines for unknown keys (also the\n * ones of `agent:` and `agents:`, p1712), `✗` lines for an unknown harness and for an `agents:`\n * map `validate` rejects. Returns the number of errors printed. A file that does not load is not\n * this function's to report: the command reads it again and says so.\n *\n * @param projectDir - Project directory.\n * @param opts.harness - Also refuse an unknown `harness:` (`check`, `doctor`).\n * @param opts.instances - Also refuse an `agents:` map `validate` rejects (p1512).\n */\nexport async function reportProjectConfig(\n projectDir: string,\n opts: { harness: boolean; instances?: boolean },\n): Promise<number> {\n let file: ReturnType<typeof loadSkWorkspaceConfig>;\n try {\n file = loadSkWorkspaceConfig(projectDir);\n } catch {\n return 0;\n }\n if (!file) return 0;\n for (const line of unknownKeyWarnings(file.diagnostics ?? [], \"skaile.yaml\")) logWarn(line);\n for (const line of agentConfigKeyWarnings(file.diagnostics ?? [], \"skaile.yaml\")) logWarn(line);\n for (const line of agentInstanceWarningLines(projectDir)) logWarn(line);\n const errors = [\n ...(opts.harness ? await unknownHarnessErrors(projectDir, file.config, \"skaile.yaml\") : []),\n ...(opts.instances ? agentInstanceErrorLines(projectDir) : []),\n ];\n for (const line of errors) logErr(line);\n return errors.length;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { initTelemetry } from './chunk-4R6DROGN.js';
2
2
  import { parseSkillFrontmatter, validateFlowVersions } from './chunk-PTJTOPE5.js';
3
- import { FlowAdapter, SessionNodeExecutor, SessionSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn } from './chunk-LX4TTTRR.js';
3
+ import { FlowAdapter, SessionNodeExecutor, SessionSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn } from './chunk-NAEXYRHR.js';
4
4
  import { loadFlow, flowLookupRoots, findFlowFileInRoots, FLOW_FILE_EXTENSIONS } from './chunk-WFK4MUBL.js';
5
5
  import { renderStimulusPrompt } from './chunk-WD3L5QSU.js';
6
6
  import { flowSkillVersionPins } from './chunk-7RGTAEG6.js';
@@ -537,5 +537,5 @@ function walkForSkill(dir, skillId) {
537
537
  }
538
538
 
539
539
  export { awaitAgentEnd, resolveFlowPath, resumeFlow, runFlow };
540
- //# sourceMappingURL=chunk-IRK3LNG3.js.map
541
- //# sourceMappingURL=chunk-IRK3LNG3.js.map
540
+ //# sourceMappingURL=chunk-EDKTS44C.js.map
541
+ //# sourceMappingURL=chunk-EDKTS44C.js.map