@skaile/workspaces 0.35.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{asset-feeds-PCLTE2W5.js → asset-feeds-W6JNAGNQ.js} +7 -7
  3. package/dist/{asset-feeds-PCLTE2W5.js.map → asset-feeds-W6JNAGNQ.js.map} +1 -1
  4. package/dist/asset-manager/index.js +5 -5
  5. package/dist/asset-manager/installer.js +4 -4
  6. package/dist/bridge/drivers/claude-sdk.js +9 -5
  7. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  8. package/dist/bridge/drivers/codex.js +2 -2
  9. package/dist/bridge/drivers/continue.js +3 -3
  10. package/dist/bridge/drivers/echo.js +1 -1
  11. package/dist/bridge/drivers/gemini.js +4 -4
  12. package/dist/bridge/drivers/goose.js +3 -3
  13. package/dist/bridge/drivers/omp.js +2 -2
  14. package/dist/bridge/drivers/opencode.js +3 -3
  15. package/dist/bridge/drivers/qwen.js +4 -4
  16. package/dist/bridge/index.js +3 -3
  17. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  18. package/dist/bridge/src/error-classifier.d.ts +22 -0
  19. package/dist/bridge/src/error-classifier.d.ts.map +1 -1
  20. package/dist/bridge/src/index.d.ts +1 -1
  21. package/dist/bridge/src/index.d.ts.map +1 -1
  22. package/dist/bridge/src/types.d.ts +1 -1
  23. package/dist/bridge/src/types.d.ts.map +1 -1
  24. package/dist/{chunk-NAMD4AIK.js → chunk-3HR6IN5B.js} +4 -4
  25. package/dist/{chunk-NAMD4AIK.js.map → chunk-3HR6IN5B.js.map} +1 -1
  26. package/dist/{chunk-WEQN6EWW.js → chunk-4A2LAEX6.js} +4 -4
  27. package/dist/{chunk-WEQN6EWW.js.map → chunk-4A2LAEX6.js.map} +1 -1
  28. package/dist/{chunk-TV2OU2EZ.js → chunk-4ZACMAT3.js} +4 -4
  29. package/dist/{chunk-TV2OU2EZ.js.map → chunk-4ZACMAT3.js.map} +1 -1
  30. package/dist/{chunk-NSVAJWWQ.js → chunk-5IXCNMMU.js} +4 -4
  31. package/dist/{chunk-NSVAJWWQ.js.map → chunk-5IXCNMMU.js.map} +1 -1
  32. package/dist/{chunk-O2OHGE4S.js → chunk-6KKNROBU.js} +2 -2
  33. package/dist/{chunk-O2OHGE4S.js.map → chunk-6KKNROBU.js.map} +1 -1
  34. package/dist/{chunk-XOBPOVFT.js → chunk-C54IAYEU.js} +3 -3
  35. package/dist/{chunk-XOBPOVFT.js.map → chunk-C54IAYEU.js.map} +1 -1
  36. package/dist/{chunk-EOCKR5TN.js → chunk-CBXZB3G5.js} +3 -3
  37. package/dist/{chunk-EOCKR5TN.js.map → chunk-CBXZB3G5.js.map} +1 -1
  38. package/dist/{chunk-52HINMW4.js → chunk-CC5ZHSHJ.js} +22 -10
  39. package/dist/chunk-CC5ZHSHJ.js.map +1 -0
  40. package/dist/{chunk-ZGJE4ZDP.js → chunk-CCQ3EMJT.js} +2 -2
  41. package/dist/{chunk-ZGJE4ZDP.js.map → chunk-CCQ3EMJT.js.map} +1 -1
  42. package/dist/{chunk-5DPQ766L.js → chunk-CFCSDZYF.js} +3 -3
  43. package/dist/{chunk-5DPQ766L.js.map → chunk-CFCSDZYF.js.map} +1 -1
  44. package/dist/{chunk-SKVUDDHE.js → chunk-DAEYSPOC.js} +333 -106
  45. package/dist/chunk-DAEYSPOC.js.map +1 -0
  46. package/dist/{chunk-2Q6OY3SU.js → chunk-FBIQ4QPF.js} +3 -3
  47. package/dist/{chunk-2Q6OY3SU.js.map → chunk-FBIQ4QPF.js.map} +1 -1
  48. package/dist/{chunk-NGJ6E344.js → chunk-GAH4YRCI.js} +20 -3
  49. package/dist/chunk-GAH4YRCI.js.map +1 -0
  50. package/dist/{chunk-I3TERDTR.js → chunk-HAXQAC6D.js} +2 -2
  51. package/dist/{chunk-I3TERDTR.js.map → chunk-HAXQAC6D.js.map} +1 -1
  52. package/dist/{chunk-56YT6CWS.js → chunk-HL66R2P2.js} +23 -18
  53. package/dist/chunk-HL66R2P2.js.map +1 -0
  54. package/dist/{chunk-CIFTUSBV.js → chunk-KM6DCR7A.js} +2 -2
  55. package/dist/{chunk-CIFTUSBV.js.map → chunk-KM6DCR7A.js.map} +1 -1
  56. package/dist/{chunk-7B3CL5JT.js → chunk-RNFNWOKZ.js} +6 -6
  57. package/dist/{chunk-7B3CL5JT.js.map → chunk-RNFNWOKZ.js.map} +1 -1
  58. package/dist/{chunk-67AXL4OK.js → chunk-U3TV7SRR.js} +4 -4
  59. package/dist/{chunk-67AXL4OK.js.map → chunk-U3TV7SRR.js.map} +1 -1
  60. package/dist/{chunk-6422UOMQ.js → chunk-ZSFWJAFD.js} +5 -5
  61. package/dist/{chunk-6422UOMQ.js.map → chunk-ZSFWJAFD.js.map} +1 -1
  62. package/dist/cli/index.js +31 -31
  63. package/dist/connectors/config.js +4 -4
  64. package/dist/connectors/index.js +5 -5
  65. package/dist/connectors/src/secrets.d.ts +14 -14
  66. package/dist/connectors/src/secrets.d.ts.map +1 -1
  67. package/dist/core/index.js +3 -3
  68. package/dist/core/runtime-assets.js +2 -2
  69. package/dist/core/src/index.d.ts +1 -1
  70. package/dist/core/src/index.d.ts.map +1 -1
  71. package/dist/core/src/workspace-config.d.ts +6 -0
  72. package/dist/core/src/workspace-config.d.ts.map +1 -1
  73. package/dist/core/workspace-config.js +1 -1
  74. package/dist/deploy/index.js +3 -3
  75. package/dist/{ensure-sources-HMMEQEZC.js → ensure-sources-AGORTKJC.js} +5 -5
  76. package/dist/{ensure-sources-HMMEQEZC.js.map → ensure-sources-AGORTKJC.js.map} +1 -1
  77. package/dist/factory-assets/connectors/deploy.js +5 -5
  78. package/dist/factory-assets/connectors/devserver.js +5 -5
  79. package/dist/factory-assets/connectors/flow/adapter.js +5 -5
  80. package/dist/factory-assets/connectors/flow/engine.js +3 -3
  81. package/dist/factory-assets/connectors/flow/run-flow.js +6 -6
  82. package/dist/factory-assets/connectors/flow.js +5 -5
  83. package/dist/factory-assets/connectors/git.js +5 -5
  84. package/dist/factory-assets/connectors/gmail.js +5 -5
  85. package/dist/factory-assets/connectors/googledrive.js +5 -5
  86. package/dist/factory-assets/connectors/local.js +5 -5
  87. package/dist/factory-assets/connectors/mattermost.js +5 -5
  88. package/dist/factory-assets/connectors/memory.js +5 -5
  89. package/dist/factory-assets/connectors/minio.js +5 -5
  90. package/dist/factory-assets/connectors/postgres.js +5 -5
  91. package/dist/factory-assets/connectors/s3.js +5 -5
  92. package/dist/factory-assets/connectors/sharepoint.js +5 -5
  93. package/dist/factory-assets/connectors/sqlite.js +5 -5
  94. package/dist/factory-assets/connectors/static-server.js +5 -5
  95. package/dist/factory-assets/connectors/tunnel.js +5 -5
  96. package/dist/factory-assets/connectors/webdav.js +5 -5
  97. package/dist/factory-assets/connectors/xstate-store.js +5 -5
  98. package/dist/factory-assets/connectors/xstate.js +5 -5
  99. package/dist/{flows-O7OXGFIY.js → flows-BOJMGLRI.js} +3 -3
  100. package/dist/{flows-O7OXGFIY.js.map → flows-BOJMGLRI.js.map} +1 -1
  101. package/dist/library/index.js +3 -3
  102. package/dist/library/install.js +3 -3
  103. package/dist/{open-library-5WWTBHQD.js → open-library-WTN7QLN7.js} +6 -6
  104. package/dist/{open-library-5WWTBHQD.js.map → open-library-WTN7QLN7.js.map} +1 -1
  105. package/dist/{paths-UC3ZHLKC.js → paths-66ZDGXK3.js} +6 -6
  106. package/dist/{paths-UC3ZHLKC.js.map → paths-66ZDGXK3.js.map} +1 -1
  107. package/dist/{plugin-store-R2WLXRT3.js → plugin-store-BOQXW3XV.js} +5 -5
  108. package/dist/{plugin-store-R2WLXRT3.js.map → plugin-store-BOQXW3XV.js.map} +1 -1
  109. package/dist/runner/index.js +10 -10
  110. package/dist/runner/src/external-mcp.d.ts +29 -1
  111. package/dist/runner/src/external-mcp.d.ts.map +1 -1
  112. package/dist/runner/src/mcp-runtime-handlers.d.ts +58 -0
  113. package/dist/runner/src/mcp-runtime-handlers.d.ts.map +1 -0
  114. package/dist/runner/src/resources.d.ts +12 -0
  115. package/dist/runner/src/resources.d.ts.map +1 -1
  116. package/dist/runner/src/runner-capabilities.d.ts +59 -0
  117. package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
  118. package/dist/runner/src/serve.d.ts +18 -1
  119. package/dist/runner/src/serve.d.ts.map +1 -1
  120. package/dist/runner/src/session-builder.d.ts +8 -0
  121. package/dist/runner/src/session-builder.d.ts.map +1 -1
  122. package/dist/runner/src/session-resource-handlers.d.ts +5 -1
  123. package/dist/runner/src/session-resource-handlers.d.ts.map +1 -1
  124. package/dist/sdk/asset-manager.js +5 -5
  125. package/dist/sdk/bridge.js +3 -3
  126. package/dist/sdk/core.js +3 -3
  127. package/dist/sdk/flow.js +3 -3
  128. package/dist/sdk/index.js +10 -10
  129. package/dist/sdk/runner.js +10 -10
  130. package/dist/{setup-BSDHVMR6.js → setup-JIGNL3O4.js} +8 -8
  131. package/dist/{setup-BSDHVMR6.js.map → setup-JIGNL3O4.js.map} +1 -1
  132. package/dist/{store-client-4GKV4LOD.js → store-client-ODJJK5XS.js} +6 -6
  133. package/dist/{store-client-4GKV4LOD.js.map → store-client-ODJJK5XS.js.map} +1 -1
  134. package/dist/tui/index.js +10 -10
  135. package/dist/types/src/events.d.ts +22 -4
  136. package/dist/types/src/events.d.ts.map +1 -1
  137. package/dist/types/src/index.d.ts +1 -1
  138. package/dist/types/src/index.d.ts.map +1 -1
  139. package/dist/workspace-plugin/adapters/mcp.js +1 -1
  140. package/dist/workspace-plugin/adapters/omp.js +3 -3
  141. package/dist/workspace-plugin/index.js +1 -1
  142. package/package.json +1 -1
  143. package/dist/chunk-52HINMW4.js.map +0 -1
  144. package/dist/chunk-56YT6CWS.js.map +0 -1
  145. package/dist/chunk-NGJ6E344.js.map +0 -1
  146. package/dist/chunk-SKVUDDHE.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.37.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#144](https://github.com/skaile-ai/workspaces/pull/144) [`91f371f`](https://github.com/skaile-ai/workspaces/commit/91f371fbd9fb8b112886500481e3011d7df045da) Thanks [@peteralbert](https://github.com/peteralbert)! - feat: `runner.attach_instance` capability — materialize-then-attach-by-ref for live MCP hot-plug. The platform materializes a just-assigned MCP instance to `.skaile/assets/mcp-server/<name>/` and invokes this cap; the runner self-derives the declaration from disk (`deriveSingleMaterializedMcpDeclaration`) and attaches it live via `ExternalMcpManager.addServer`. Connectors return `unsupported_kind` (deferred — Phase 2.5).
8
+
9
+ ## 0.36.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#143](https://github.com/skaile-ai/workspaces/pull/143) [`987613d`](https://github.com/skaile-ai/workspaces/commit/987613da9a77b3a4d8ceb3e47a0763cf2806af36) Thanks [@peteralbert](https://github.com/peteralbert)! - feat: live MCP hot-plug-on-assign — new `runner.add_mcp_server` capability (connect a remote/stdio MCP server to a running session and register its `mcp__<id>__*` tools with no restart) and MCP servers are now reported in the `resources_available` event (`mcp_servers: McpServerInfo[]`) so the platform can show a truthful Live/Restart badge.
14
+
15
+ ### Patch Changes
16
+
17
+ - [#141](https://github.com/skaile-ai/workspaces/pull/141) [`ffc110e`](https://github.com/skaile-ai/workspaces/commit/ffc110eabb97e19d8f2f76f0354fdd5108da7083) Thanks [@Frozen666](https://github.com/Frozen666)! - fix(bridge): classify a 401 that recurs after a successful credential refresh as an `account` failure, not `auth`
18
+
19
+ When Anthropic returns 401 for a non-auth reason (hidden-tier rate limit, billing block, anti-abuse throttle on OAuth tokens), the bridge refreshed the credential, retried, hit the same 401, and surfaced "Invalid authentication credentials" — a wrong, non-actionable message. The driver now downgrades a post-refresh 401 (`this.authSelfHealUsed === true`) from `auth` to a new `account` category and surfaces `AccountUnavailableError` (not an `AuthError`, so the self-heal does not loop). Applied on both the thrown-exception (`handleConsumerError`) and `is_error`-result (`handleResultErrorPayload`) paths. Adds `"account"` to `ErrorCategory` in `@skaile/workspaces/types`.
20
+
3
21
  ## 0.35.0
4
22
 
5
23
  ### Minor Changes
@@ -1,6 +1,6 @@
1
- import './chunk-2Q6OY3SU.js';
2
- import './chunk-5DPQ766L.js';
3
- import { scanRepo } from './chunk-56YT6CWS.js';
1
+ import './chunk-FBIQ4QPF.js';
2
+ import './chunk-CFCSDZYF.js';
3
+ import { scanRepo } from './chunk-HL66R2P2.js';
4
4
  import './chunk-SAXDHVJZ.js';
5
5
  import './chunk-MAPRKFBD.js';
6
6
  import './chunk-BM7XANVN.js';
@@ -17,7 +17,7 @@ async function libraryAssets() {
17
17
  const notes = [];
18
18
  try {
19
19
  const [{ openLibraryManager }, { skaileHomeDir }] = await Promise.all([
20
- import('./open-library-5WWTBHQD.js'),
20
+ import('./open-library-WTN7QLN7.js'),
21
21
  import('./library/index.js')
22
22
  ]);
23
23
  const { manager, close } = await openLibraryManager();
@@ -46,7 +46,7 @@ async function libraryAssets() {
46
46
  async function storeAssets(projectDir) {
47
47
  const notes = [];
48
48
  try {
49
- const { resolveCatalogSource } = await import('./open-library-5WWTBHQD.js');
49
+ const { resolveCatalogSource } = await import('./open-library-WTN7QLN7.js');
50
50
  const { source, close } = await resolveCatalogSource({ projectDir });
51
51
  try {
52
52
  const assets = await source.listAssets();
@@ -102,5 +102,5 @@ async function gatherAssetFeeds(am, projectDir) {
102
102
  }
103
103
 
104
104
  export { gatherAssetFeeds };
105
- //# sourceMappingURL=asset-feeds-PCLTE2W5.js.map
106
- //# sourceMappingURL=asset-feeds-PCLTE2W5.js.map
105
+ //# sourceMappingURL=asset-feeds-W6JNAGNQ.js.map
106
+ //# sourceMappingURL=asset-feeds-W6JNAGNQ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA+DA,eAAe,aAAA,GAAyE;AACtF,EAAA,MAAM,QAAoB,EAAC;AAC3B,EAAA,IAAI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* asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Three feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex` (filesystem\n * scan of each library's `path`).\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport { existsSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogDomain,\n type CatalogEntry,\n scanRepo,\n} from \"@skaile/workspaces/core\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n /**\n * Display-only domain metadata, keyed (by the consumer) on `slug`. Populated\n * from the store's `catalog.listDomains` when the connected catalog source\n * exposes it; empty otherwise. The manage TUI joins `entry.domainSlug` → a\n * domain for grouping headers, descriptions, and relation badges.\n */\n domains: CatalogDomain[];\n notes: FeedNote[];\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/sources/` cache). Each\n * library's `path` is scanned with `scanRepo` and tagged with\n * `repository = \"library:<name>\"` so the manage TUI groups them into their\n * own headers.\n */\nasync function libraryAssets(): Promise<{ entries: CatalogEntry[]; notes: FeedNote[] }> {\n const notes: FeedNote[] = [];\n try {\n const [{ openLibraryManager }, { skaileHomeDir }] = await Promise.all([\n import(\"./open-library.ts\"),\n import(\"@skaile/workspaces/library\"),\n ]);\n const { manager, close } = await openLibraryManager();\n try {\n const sourcesDir = path.join(skaileHomeDir(), \"sources\");\n const libs = (await manager.listLibraries()).filter((l) => !l.path.startsWith(sourcesDir));\n const entries: CatalogEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n for (const e of scanRepo(lib.path, `library:${lib.name}`)) {\n entries.push(e);\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n const assets = await source.listAssets();\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n domainSlug: a.domainSlug,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n // Domains are optional on the catalog source — only the store backend\n // (post Part 4 `catalog.listDomains`) exposes them. Duck-type the call so\n // older sources and the local catalog degrade to no domains, not an error.\n const domains = await loadDomains(source);\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], domains: [], notes };\n }\n}\n\n/** Optional `listDomains` capability — returns `[]` when the source lacks it. */\nasync function loadDomains(source: unknown): Promise<CatalogDomain[]> {\n const fn = (source as { listDomains?: () => Promise<CatalogDomain[]> }).listDomains;\n if (typeof fn !== \"function\") return [];\n const domains = await fn.call(source);\n return Array.isArray(domains) ? domains : [];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which now merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Provided as a\n * function rather than an inline call so the caller can supply a fresh\n * `AssetManager` instance.\n */\nfunction sourceAssets(am: { search: () => CatalogEntry[] }): CatalogEntry[] {\n return am.search();\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all three feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk.\n */\nexport async function gatherAssetFeeds(\n am: { search: () => CatalogEntry[] },\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n return {\n entries: [\n ...tag(\"source\", sourceAssets(am)),\n ...tag(\"library\", libs.entries),\n ...tag(\"store\", store.entries),\n ],\n domains: store.domains,\n notes: [...libs.notes, ...store.notes],\n };\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA+DA,eAAe,aAAA,GAAyE;AACtF,EAAA,MAAM,QAAoB,EAAC;AAC3B,EAAA,IAAI;AACF,IAAA,MAAM,CAAC,EAAE,kBAAA,EAAmB,EAAG,EAAE,eAAe,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI;AAAA,M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;AAAA,EAC3C;AACF;AAGA,eAAe,YAAY,MAAA,EAA2C;AACpE,EAAA,MAAM,KAAM,MAAA,CAA4D,WAAA;AACxE,EAAA,IAAI,OAAO,EAAA,KAAO,UAAA,EAAY,OAAO,EAAC;AACtC,EAAA,MAAM,OAAA,GAAU,MAAM,EAAA,CAAG,IAAA,CAAK,MAAM,CAAA;AACpC,EAAA,OAAO,KAAA,CAAM,OAAA,CAAQ,OAAO,CAAA,GAAI,UAAU,EAAC;AAC7C;AAQA,SAAS,aAAa,EAAA,EAAsD;AAC1E,EAAA,OAAO,GAAG,MAAA,EAAO;AACnB;AAGA,SAAS,GAAA,CAAI,QAAqB,OAAA,EAAwC;AACxE,EAAA,OAAO,QAAQ,GAAA,CAAI,CAAC,WAAW,EAAE,MAAA,EAAQ,OAAM,CAAE,CAAA;AACnD;AAQA,eAAsB,gBAAA,CACpB,IACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,KAAK,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,aAAA,EAAc,EAAG,WAAA,CAAY,UAAU,CAAC,CAAC,CAAA;AAClF,EAAA,OAAO;AAAA,IACL,OAAA,EAAS;AAAA,MACP,GAAG,GAAA,CAAI,QAAA,EAAU,YAAA,CAAa,EAAE,CAAC,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,SAAA,EAAW,IAAA,CAAK,OAAO,CAAA;AAAA,MAC9B,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;AAAA,KAC/B;AAAA,IACA,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,OAAO,CAAC,GAAG,KAAK,KAAA,EAAO,GAAG,MAAM,KAAK;AAAA,GACvC;AACF","file":"asset-feeds-W6JNAGNQ.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Three feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex` (filesystem\n * scan of each library's `path`).\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport { existsSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogDomain,\n type CatalogEntry,\n scanRepo,\n} from \"@skaile/workspaces/core\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n /**\n * Display-only domain metadata, keyed (by the consumer) on `slug`. Populated\n * from the store's `catalog.listDomains` when the connected catalog source\n * exposes it; empty otherwise. The manage TUI joins `entry.domainSlug` → a\n * domain for grouping headers, descriptions, and relation badges.\n */\n domains: CatalogDomain[];\n notes: FeedNote[];\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/sources/` cache). Each\n * library's `path` is scanned with `scanRepo` and tagged with\n * `repository = \"library:<name>\"` so the manage TUI groups them into their\n * own headers.\n */\nasync function libraryAssets(): Promise<{ entries: CatalogEntry[]; notes: FeedNote[] }> {\n const notes: FeedNote[] = [];\n try {\n const [{ openLibraryManager }, { skaileHomeDir }] = await Promise.all([\n import(\"./open-library.ts\"),\n import(\"@skaile/workspaces/library\"),\n ]);\n const { manager, close } = await openLibraryManager();\n try {\n const sourcesDir = path.join(skaileHomeDir(), \"sources\");\n const libs = (await manager.listLibraries()).filter((l) => !l.path.startsWith(sourcesDir));\n const entries: CatalogEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n for (const e of scanRepo(lib.path, `library:${lib.name}`)) {\n entries.push(e);\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n const assets = await source.listAssets();\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n domainSlug: a.domainSlug,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n // Domains are optional on the catalog source — only the store backend\n // (post Part 4 `catalog.listDomains`) exposes them. Duck-type the call so\n // older sources and the local catalog degrade to no domains, not an error.\n const domains = await loadDomains(source);\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], domains: [], notes };\n }\n}\n\n/** Optional `listDomains` capability — returns `[]` when the source lacks it. */\nasync function loadDomains(source: unknown): Promise<CatalogDomain[]> {\n const fn = (source as { listDomains?: () => Promise<CatalogDomain[]> }).listDomains;\n if (typeof fn !== \"function\") return [];\n const domains = await fn.call(source);\n return Array.isArray(domains) ? domains : [];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which now merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Provided as a\n * function rather than an inline call so the caller can supply a fresh\n * `AssetManager` instance.\n */\nfunction sourceAssets(am: { search: () => CatalogEntry[] }): CatalogEntry[] {\n return am.search();\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all three feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk.\n */\nexport async function gatherAssetFeeds(\n am: { search: () => CatalogEntry[] },\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n return {\n entries: [\n ...tag(\"source\", sourceAssets(am)),\n ...tag(\"library\", libs.entries),\n ...tag(\"store\", store.entries),\n ],\n domains: store.domains,\n notes: [...libs.notes, ...store.notes],\n };\n}\n"]}
@@ -1,8 +1,8 @@
1
- export { AssetManager, parseCanonicalLockKey } from '../chunk-7B3CL5JT.js';
2
- export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-WEQN6EWW.js';
3
- import '../chunk-2Q6OY3SU.js';
4
- import '../chunk-5DPQ766L.js';
5
- import '../chunk-56YT6CWS.js';
1
+ export { AssetManager, parseCanonicalLockKey } from '../chunk-RNFNWOKZ.js';
2
+ export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-4A2LAEX6.js';
3
+ import '../chunk-FBIQ4QPF.js';
4
+ import '../chunk-CFCSDZYF.js';
5
+ import '../chunk-HL66R2P2.js';
6
6
  import '../chunk-SAXDHVJZ.js';
7
7
  import '../chunk-MAPRKFBD.js';
8
8
  import '../chunk-BM7XANVN.js';
@@ -1,7 +1,7 @@
1
- export { createScaffold, deployAll, deployAsset, removeAsset } from '../chunk-WEQN6EWW.js';
2
- import '../chunk-2Q6OY3SU.js';
3
- import '../chunk-5DPQ766L.js';
4
- import '../chunk-56YT6CWS.js';
1
+ export { createScaffold, deployAll, deployAsset, removeAsset } from '../chunk-4A2LAEX6.js';
2
+ import '../chunk-FBIQ4QPF.js';
3
+ import '../chunk-CFCSDZYF.js';
4
+ import '../chunk-HL66R2P2.js';
5
5
  import '../chunk-SAXDHVJZ.js';
6
6
  import '../chunk-MAPRKFBD.js';
7
7
  import '../chunk-BM7XANVN.js';
@@ -1,7 +1,7 @@
1
1
  import { dispatchCapability } from '../../chunk-RRVQAE5D.js';
2
2
  import { fetchProviderModels } from '../../chunk-BMQKMOQY.js';
3
- import { AuthError, classifyClaudeSdkError } from '../../chunk-NGJ6E344.js';
4
- import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-CIFTUSBV.js';
3
+ import { AuthError, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable, AccountUnavailableError } from '../../chunk-GAH4YRCI.js';
4
+ import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-KM6DCR7A.js';
5
5
  import '../../chunk-6E6PKKAD.js';
6
6
  import '../../chunk-JB35MVBN.js';
7
7
  import '../../chunk-NSBPE2FW.js';
@@ -796,16 +796,17 @@ var ClaudeSdkDriver = class extends AgentDriver {
796
796
  this.log.info("aborted");
797
797
  return;
798
798
  }
799
- const detail = classifyClaudeSdkError({
799
+ const rawDetail = classifyClaudeSdkError({
800
800
  errors: [error.message],
801
801
  oauthCredential: this.usingOauthCredential
802
802
  });
803
+ const detail = rawDetail.category === "auth" && this.authSelfHealUsed ? reclassifyAuthAsAccountUnavailable(rawDetail) : rawDetail;
803
804
  this.log.error("consumer error", {
804
805
  message: error.message,
805
806
  category: detail.category,
806
807
  retryable: detail.retryable
807
808
  });
808
- const surfaced = detail.category === "auth" ? new AuthError(detail) : error;
809
+ const surfaced = detail.category === "auth" ? new AuthError(detail) : detail.category === "account" ? new AccountUnavailableError(detail) : error;
809
810
  this.failTurn(surfaced, detail);
810
811
  }
811
812
  /**
@@ -1067,12 +1068,13 @@ var ClaudeSdkDriver = class extends AgentDriver {
1067
1068
  * empty errors defer to the consumer-error catch.
1068
1069
  */
1069
1070
  handleResultErrorPayload(msg, errors) {
1070
- const detail = classifyClaudeSdkError({
1071
+ const rawDetail = classifyClaudeSdkError({
1071
1072
  errors,
1072
1073
  terminalReason: msg.terminal_reason,
1073
1074
  subtype: msg.subtype,
1074
1075
  oauthCredential: this.usingOauthCredential
1075
1076
  });
1077
+ const detail = rawDetail.category === "auth" && this.authSelfHealUsed ? reclassifyAuthAsAccountUnavailable(rawDetail) : rawDetail;
1076
1078
  this.log.error("turn ended with error", {
1077
1079
  subtype: msg.subtype,
1078
1080
  terminalReason: msg.terminal_reason,
@@ -1083,6 +1085,8 @@ var ClaudeSdkDriver = class extends AgentDriver {
1083
1085
  const errorText = errors.join("; ") || `Agent stopped: ${msg.subtype}`;
1084
1086
  if (detail.category === "auth") {
1085
1087
  this.failTurn(new AuthError({ ...detail, message: errorText }), detail);
1088
+ } else if (detail.category === "account") {
1089
+ this.failTurn(new AccountUnavailableError({ ...detail, message: errorText }), detail);
1086
1090
  } else if (errors.length > 0) {
1087
1091
  this.emit("agent-event", {
1088
1092
  type: "error",