@skaile/workspaces 5.15.0 → 5.15.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.
- package/CHANGELOG.md +6 -0
- package/dist/{asset-feeds-LIDC7547.js → asset-feeds-FVDNQ2FM.js} +4 -4
- package/dist/{asset-feeds-LIDC7547.js.map → asset-feeds-FVDNQ2FM.js.map} +1 -1
- package/dist/asset-manager/index.js +1 -1
- package/dist/{chunk-YL23KWBX.js → chunk-354JIEIE.js} +3 -3
- package/dist/{chunk-YL23KWBX.js.map → chunk-354JIEIE.js.map} +1 -1
- package/dist/{chunk-JHP6MIW2.js → chunk-55VKZUQY.js} +7 -7
- package/dist/{chunk-JHP6MIW2.js.map → chunk-55VKZUQY.js.map} +1 -1
- package/dist/{chunk-SCUEPCSJ.js → chunk-7Y7UYNGL.js} +3 -3
- package/dist/{chunk-SCUEPCSJ.js.map → chunk-7Y7UYNGL.js.map} +1 -1
- package/dist/{chunk-QR7W5JV4.js → chunk-B6I7SF2X.js} +7 -7
- package/dist/{chunk-QR7W5JV4.js.map → chunk-B6I7SF2X.js.map} +1 -1
- package/dist/{chunk-2LTF2ZHH.js → chunk-GR7TV4XC.js} +3 -3
- package/dist/{chunk-2LTF2ZHH.js.map → chunk-GR7TV4XC.js.map} +1 -1
- package/dist/{chunk-PIDMOE7R.js → chunk-GV3MFKDV.js} +3 -3
- package/dist/{chunk-PIDMOE7R.js.map → chunk-GV3MFKDV.js.map} +1 -1
- package/dist/{chunk-SRKU7QUG.js → chunk-JJLH4TX4.js} +6 -6
- package/dist/{chunk-SRKU7QUG.js.map → chunk-JJLH4TX4.js.map} +1 -1
- package/dist/{chunk-D2MZZ2KB.js → chunk-JUHDED6J.js} +3 -3
- package/dist/{chunk-D2MZZ2KB.js.map → chunk-JUHDED6J.js.map} +1 -1
- package/dist/{chunk-DP6YRAPZ.js → chunk-MUOSKYI2.js} +49 -5
- package/dist/chunk-MUOSKYI2.js.map +1 -0
- package/dist/{chunk-KUB4HFGK.js → chunk-NHH3MRSC.js} +3 -3
- package/dist/{chunk-KUB4HFGK.js.map → chunk-NHH3MRSC.js.map} +1 -1
- package/dist/{chunk-AXNX2SKZ.js → chunk-NVBN3YOH.js} +5 -5
- package/dist/{chunk-AXNX2SKZ.js.map → chunk-NVBN3YOH.js.map} +1 -1
- package/dist/{chunk-XX4C72CC.js → chunk-R37L4BNR.js} +2 -2
- package/dist/{chunk-XX4C72CC.js.map → chunk-R37L4BNR.js.map} +1 -1
- package/dist/{chunk-74THIMZV.js → chunk-RNFHJUK7.js} +3 -3
- package/dist/{chunk-74THIMZV.js.map → chunk-RNFHJUK7.js.map} +1 -1
- package/dist/{chunk-AVUJBSFA.js → chunk-U7YMGW7M.js} +2 -2
- package/dist/{chunk-AVUJBSFA.js.map → chunk-U7YMGW7M.js.map} +1 -1
- package/dist/{chunk-I3JO3NIZ.js → chunk-VQQCA7BD.js} +3 -3
- package/dist/{chunk-I3JO3NIZ.js.map → chunk-VQQCA7BD.js.map} +1 -1
- package/dist/cli/index.js +34 -34
- package/dist/connectors/index.js +1 -1
- package/dist/{connectors-JQR5RAMC.js → connectors-TVFFE5H4.js} +4 -4
- package/dist/{connectors-JQR5RAMC.js.map → connectors-TVFFE5H4.js.map} +1 -1
- package/dist/{ensure-sources-NAGBSMJE.js → ensure-sources-N4E5EDGC.js} +4 -4
- package/dist/{ensure-sources-NAGBSMJE.js.map → ensure-sources-N4E5EDGC.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +1 -1
- package/dist/factory-assets/connectors/deploy.js +1 -1
- package/dist/factory-assets/connectors/devserver.js +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +2 -2
- package/dist/factory-assets/connectors/flow.js +1 -1
- package/dist/factory-assets/connectors/git/CONNECTOR.md +1 -0
- package/dist/factory-assets/connectors/git/lifecycle.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git/repo.d.ts +17 -3
- package/dist/factory-assets/connectors/git/repo.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +1 -1
- package/dist/factory-assets/connectors/gmail.js +1 -1
- package/dist/factory-assets/connectors/googledrive.js +1 -1
- package/dist/factory-assets/connectors/local.js +1 -1
- package/dist/factory-assets/connectors/mattermost.js +1 -1
- package/dist/factory-assets/connectors/memory.js +1 -1
- package/dist/factory-assets/connectors/minio.js +1 -1
- package/dist/factory-assets/connectors/postgres.js +1 -1
- package/dist/factory-assets/connectors/s3.js +1 -1
- package/dist/factory-assets/connectors/sharepoint.js +1 -1
- package/dist/factory-assets/connectors/sqlite.js +1 -1
- package/dist/factory-assets/connectors/static-server.js +1 -1
- package/dist/factory-assets/connectors/tunnel.js +1 -1
- package/dist/factory-assets/connectors/webdav.js +1 -1
- package/dist/factory-assets/connectors/xstate-store.js +1 -1
- package/dist/factory-assets/connectors/xstate.js +1 -1
- package/dist/{helpers-XFHJDJOA.js → helpers-PPVGVYIZ.js} +4 -4
- package/dist/{helpers-XFHJDJOA.js.map → helpers-PPVGVYIZ.js.map} +1 -1
- package/dist/{library-publish-FC3ZABR2.js → library-publish-EQFYHJ6G.js} +14 -14
- package/dist/{library-publish-FC3ZABR2.js.map → library-publish-EQFYHJ6G.js.map} +1 -1
- package/dist/{open-library-5ET7SAJC.js → open-library-JJGDEYYT.js} +5 -5
- package/dist/{open-library-5ET7SAJC.js.map → open-library-JJGDEYYT.js.map} +1 -1
- package/dist/{project-2UXHSVVA.js → project-5HW3XSOE.js} +11 -11
- package/dist/{project-2UXHSVVA.js.map → project-5HW3XSOE.js.map} +1 -1
- package/dist/runner/index.js +6 -6
- package/dist/sdk/asset-manager.js +1 -1
- package/dist/sdk/index.js +6 -6
- package/dist/sdk/runner.js +6 -6
- package/dist/{setup-IKH4R7UN.js → setup-52NDDR7C.js} +5 -5
- package/dist/{setup-IKH4R7UN.js.map → setup-52NDDR7C.js.map} +1 -1
- package/dist/{source-M6IARYNO.js → source-WKV4QFGS.js} +13 -13
- package/dist/{source-M6IARYNO.js.map → source-WKV4QFGS.js.map} +1 -1
- package/dist/{source-manifest-publish-UP2IS2QW.js → source-manifest-publish-3HAX6DPN.js} +15 -15
- package/dist/{source-manifest-publish-UP2IS2QW.js.map → source-manifest-publish-3HAX6DPN.js.map} +1 -1
- package/dist/tui/index.js +6 -6
- package/dist/workspace-plugin/adapters/mcp.js +3 -3
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DP6YRAPZ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../cli/src/open-library.ts"],"names":["source"],"mappings":";;;;;AAkBO,IAAM,yBAAA,GAAN,cAAwC,KAAA,CAAM;AAAA,EACnD,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,2BAAA;AAAA,EACd;AACF;AASA,eAAsB,WAAA,GAAc;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAM,OAAO,oBAA4B,CAAA;AAChE,IAAA,OAAO,IAAI,UAAA,CAAW,EAAE,YAAA,EAAc,eAAA,IAAmB,CAAA;AAAA,EAC3D,SAAS,GAAA,EAAK;AACZ,IAAA,MAAA,CAAO,CAAA,2BAAA,EAA8B,eAAe,KAAA,GAAQ,GAAA,CAAI,UAAU,MAAA,CAAO,GAAG,CAAC,CAAA,CAAE,CAAA;AACvF,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF;AAqBA,eAAsB,kBAAkB,IAAA,EAQtC;AACA,EAAA,MAAM,EAAE,eAAe,mBAAA,EAAqB,iBAAA,EAAmB,mBAAkB,GAAI,MAAM,OACzF,oBACF,CAAA;AACA,EAAA,MAAM,MAAM,aAAA,CAAc;AAAA,IACxB,YAAY,IAAA,EAAM,UAAA;AAAA,IAClB,gBA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,MAAM,GAAA;AAAA,IACR;AAAA,EACF;AAEA,EAAA,MAAM,UAAA,GAAa,GAAA,CAAI,OAAA,CAAQ,SAAA,GAAY,GAAA;AAC3C,EAAA,MAAM,SACJ,GAAA,CAAI,OAAA,CAAQ,OAAA,KAAY,MAAA,GACpB,IAAI,iBAAA,CAAkB,EAAE,OAAA,EAAS,UAAA,EAAY,CAAA,GAC7C,IAAI,oBAAoB,EAAE,OAAA,EAAS,YAAY,CAAA;AACrD,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,MAAM;AAAA,EAAC,CAAA,EAAE;AACnC;AASA,eAAsB,kBAAA,GAInB;AACD,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,MAAM,OAAO,oBAA4B,CAAA;AACpE,EAAA,MAAM,OAAA,GAAU,MAAM,WAAA,EAAY;AAClC,EAAA,MAAM,OAAA,GAAU,IAAI,cAAA,CAAe,OAAO,CAAA;AAC1C,EAAA,OAAO,EAAE,OAAA,EAAS,OAAA,EAAS,OAAO,MAAM,OAAA,CAAQ,OAAM,EAAE;AAC1D","file":"chunk-2LTF2ZHH.js","sourcesContent":["/**\n * open-library.ts — shared helpers to open the LocalIndex and the configured\n * Catalog source.\n *\n * Lazy-loads the `@skaile/workspaces/library` subpath and returns the\n * LocalIndex instance (backed by `@libsql/client`; runs on Node and Bun).\n * The catalog-source helper reads\n * `~/.skaile/config.yaml` (and project-level overlay if `projectDir` is given)\n * to decide between {@link RemoteCatalogSource} (default — points at\n * `https://skaile.store`) and a {@link LocalCatalogSource} bound to the most\n * recent local library registered via `skaile source add`.\n */\n\nimport { userConfigPath } from \"@skaile/workspaces/core\";\nimport { logErr } from \"./helpers.ts\";\nimport { getKindRegistry } from \"./open-registry.ts\";\n\n/** Thrown by {@link openCatalogSource} when `catalog.url` is the `local` sentinel. */\nexport class LocalCatalogDisabledError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"LocalCatalogDisabledError\";\n }\n}\n\n/**\n * Open the LocalIndex with the full kind registry. Exits with code 1\n * if the library directory cannot be created.\n *\n * @returns A `LocalIndex` instance ready for use.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibrary() {\n try {\n const { LocalIndex } = await import(\"@skaile/workspaces/library\");\n return new LocalIndex({ kindRegistry: getKindRegistry() });\n } catch (err) {\n logErr(`Could not open LocalIndex: ${err instanceof Error ? err.message : String(err)}`);\n process.exit(1);\n }\n}\n\n/**\n * Resolve the configured **remote** Catalog source for the CLI.\n *\n * Reads `~/.skaile/config.yaml` (plus the optional project-level overlay) and\n * returns a {@link RemoteCatalogSource} pointing at `catalog.url` (default:\n * `https://skaile.store`). The `cache_ttl: 0` config flag flips the source\n * into air-gapped mode: network reads are disabled, only `skaile update`\n * performs refreshes.\n *\n * **Local-mode rejection.** If the resolved config has `catalog.url: local`\n * this helper throws — callers wanting the dispatched local-or-remote source\n * must use {@link resolveCatalogSource}. Remote-only consumers like\n * `skaile update --catalog-only` rely on this strict behaviour.\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A configured {@link RemoteCatalogSource}.\n * @throws When `catalog.url` is the `local` sentinel.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<\n | import(\"@skaile/workspaces/library\").RemoteCatalogSource\n | import(\"@skaile/workspaces/library\").RestCatalogSource\n> {\n const { resolveConfig, RemoteCatalogSource, RestCatalogSource, isLocalCatalogUrl } = await import(\n \"@skaile/workspaces/library\"\n );\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n if (isLocalCatalogUrl(baseUrl)) {\n throw new LocalCatalogDisabledError(\n \"catalog.url is set to 'local' — remote catalog is disabled. \" +\n \"Use `skaile library init <name> --path <dir>` for a local folder, \" +\n `or set \\`catalog.url: https://skaile.store\\` in ${userConfigPath()}.`,\n );\n }\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n if (cfg.catalog.framing === \"rest\") {\n return new RestCatalogSource({ baseUrl, cacheTtlMs });\n }\n return new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n}\n\n/**\n * Resolved catalog source plus a close handle for releasing any underlying\n * resources (e.g. the `LocalIndex` SQLite connection in local mode).\n *\n * Callers MUST invoke `close()` when done — typically in a `finally` block.\n * For remote-mode sources `close()` is a no-op, but the contract is uniform\n * so consumers don't have to branch.\n *\n * @docLink cli/dev-guide#open-library\n */\nexport interface ResolvedCatalogSource {\n /** The {@link ICatalogSource} ready for use. */\n source: import(\"@skaile/workspaces/library\").ICatalogSource;\n /** Release any underlying resources (SQLite handle in local mode). */\n close(): void;\n}\n\n/**\n * Resolve the configured Catalog source — local or remote — based on\n * `~/.skaile/config.yaml`.\n *\n * Dispatch:\n * - `catalog.url: local` → opens {@link LocalIndex}, picks the most recently\n * registered local library whose `path` still exists on disk, and returns a\n * {@link LocalCatalogSource} bound to that library. Throws if no usable\n * local library is registered.\n * - any URL → returns {@link RemoteCatalogSource} (same as\n * {@link openCatalogSource}).\n *\n * The returned `close()` releases the underlying `LocalIndex` SQLite handle\n * in local mode (no-op in remote mode). Callers MUST invoke it — typically in\n * a `finally` block — to satisfy `library/CLAUDE.md` § \"Notes for Consumers\".\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A `ResolvedCatalogSource` carrying the source and a close handle.\n * @throws When `local` is configured but no usable local library is registered.\n * @docLink cli/dev-guide#open-library\n */\nexport async function resolveCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<ResolvedCatalogSource> {\n const {\n resolveConfig,\n RemoteCatalogSource,\n RestCatalogSource,\n LocalCatalogSource,\n isLocalCatalogUrl,\n libraryDirMissing,\n missingLibraryDirMessage,\n } = await import(\"@skaile/workspaces/library\");\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n\n if (isLocalCatalogUrl(baseUrl)) {\n const fs = await import(\"node:fs\");\n const library = await openLibrary();\n try {\n const sources = await library.listSources();\n type LibraryRow = (typeof sources)[number];\n // Type-narrow: `path` is required for local libraries after the filter.\n const usable = sources\n .filter(\n (s): s is LibraryRow & { path: string } =>\n s.backend === \"local\" && typeof s.path === \"string\" && s.path.length > 0,\n )\n .sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());\n\n // A registered library whose directory is gone has one wording everywhere.\n const gone = sources.filter(libraryDirMissing);\n if (usable.length === 0) {\n if (gone.length > 0) throw new Error(gone.map(missingLibraryDirMessage).join(\"\\n\"));\n throw new Error(\n \"catalog.url is set to 'local' but no local library is registered. \" +\n \"Run `skaile library init <name> --path <dir>` first (a git repo: `skaile source add <git-url>`).\",\n );\n }\n\n // Prefer the most recently added library whose path still exists.\n const present = usable.find((s) => fs.existsSync(s.path));\n if (!present) {\n throw new Error(gone.map(missingLibraryDirMessage).join(\"\\n\"));\n }\n\n const source = new LocalCatalogSource(library, present.id, present.path, getKindRegistry());\n return { source, close: () => library.close() };\n } catch (err) {\n // Release the handle on any failure during dispatch — otherwise the\n // SQLite WAL state leaks for the lifetime of the process.\n library.close();\n throw err;\n }\n }\n\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n const source =\n cfg.catalog.framing === \"rest\"\n ? new RestCatalogSource({ baseUrl, cacheTtlMs })\n : new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n return { source, close: () => {} };\n}\n\n/**\n * Open the LibraryManager bound to the active LocalIndex.\n * Caller owns lifetime — must call `close()` (returned helper closes the\n * underlying LocalIndex).\n *\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibraryManager(): Promise<{\n manager: import(\"@skaile/workspaces/library\").LibraryManager;\n library: import(\"@skaile/workspaces/library\").LocalIndex;\n close: () => void;\n}> {\n const { LibraryManager } = await import(\"@skaile/workspaces/library\");\n const library = await openLibrary();\n const manager = new LibraryManager(library);\n return { manager, library, close: () => library.close() };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../cli/src/open-library.ts"],"names":["source"],"mappings":";;;;;AAkBO,IAAM,yBAAA,GAAN,cAAwC,KAAA,CAAM;AAAA,EACnD,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,2BAAA;AAAA,EACd;AACF;AASA,eAAsB,WAAA,GAAc;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAM,OAAO,oBAA4B,CAAA;AAChE,IAAA,OAAO,IAAI,UAAA,CAAW,EAAE,YAAA,EAAc,eAAA,IAAmB,CAAA;AAAA,EAC3D,SAAS,GAAA,EAAK;AACZ,IAAA,MAAA,CAAO,CAAA,2BAAA,EAA8B,eAAe,KAAA,GAAQ,GAAA,CAAI,UAAU,MAAA,CAAO,GAAG,CAAC,CAAA,CAAE,CAAA;AACvF,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF;AAqBA,eAAsB,kBAAkB,IAAA,EAQtC;AACA,EAAA,MAAM,EAAE,eAAe,mBAAA,EAAqB,iBAAA,EAAmB,mBAAkB,GAAI,MAAM,OACzF,oBACF,CAAA;AACA,EAAA,MAAM,MAAM,aAAA,CAAc;AAAA,IACxB,YAAY,IAAA,EAAM,UAAA;AAAA,IAClB,gBAAgB,IAAA,EAAM;AAAA,GACvB,CAAA;AACD,EAAA,MAAM,OAAA,GAAU,IAAA,EAAM,eAAA,IAAmB,GAAA,CAAI,OAAA,CAAQ,GAAA;AACrD,EAAA,IAAI,iBAAA,CAAkB,OAAO,CAAA,EAAG;AAC9B,IAAA,MAAM,IAAI,yBAAA;AAAA,MACR,CAAA,qLAAA,EAEqD,gBAAgB,CAAA,CAAA;AAAA,KACvE;AAAA,EACF;AAC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AAY,CAAA;AACrD,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,MAAM;AAAA,EAAC,CAAA,EAAE;AACnC;AASA,eAAsB,kBAAA,GAInB;AACD,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,MAAM,OAAO,oBAA4B,CAAA;AACpE,EAAA,MAAM,OAAA,GAAU,MAAM,WAAA,EAAY;AAClC,EAAA,MAAM,OAAA,GAAU,IAAI,cAAA,CAAe,OAAO,CAAA;AAC1C,EAAA,OAAO,EAAE,OAAA,EAAS,OAAA,EAAS,OAAO,MAAM,OAAA,CAAQ,OAAM,EAAE;AAC1D","file":"chunk-GR7TV4XC.js","sourcesContent":["/**\n * open-library.ts — shared helpers to open the LocalIndex and the configured\n * Catalog source.\n *\n * Lazy-loads the `@skaile/workspaces/library` subpath and returns the\n * LocalIndex instance (backed by `@libsql/client`; runs on Node and Bun).\n * The catalog-source helper reads\n * `~/.skaile/config.yaml` (and project-level overlay if `projectDir` is given)\n * to decide between {@link RemoteCatalogSource} (default — points at\n * `https://skaile.store`) and a {@link LocalCatalogSource} bound to the most\n * recent local library registered via `skaile source add`.\n */\n\nimport { userConfigPath } from \"@skaile/workspaces/core\";\nimport { logErr } from \"./helpers.ts\";\nimport { getKindRegistry } from \"./open-registry.ts\";\n\n/** Thrown by {@link openCatalogSource} when `catalog.url` is the `local` sentinel. */\nexport class LocalCatalogDisabledError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"LocalCatalogDisabledError\";\n }\n}\n\n/**\n * Open the LocalIndex with the full kind registry. Exits with code 1\n * if the library directory cannot be created.\n *\n * @returns A `LocalIndex` instance ready for use.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibrary() {\n try {\n const { LocalIndex } = await import(\"@skaile/workspaces/library\");\n return new LocalIndex({ kindRegistry: getKindRegistry() });\n } catch (err) {\n logErr(`Could not open LocalIndex: ${err instanceof Error ? err.message : String(err)}`);\n process.exit(1);\n }\n}\n\n/**\n * Resolve the configured **remote** Catalog source for the CLI.\n *\n * Reads `~/.skaile/config.yaml` (plus the optional project-level overlay) and\n * returns a {@link RemoteCatalogSource} pointing at `catalog.url` (default:\n * `https://skaile.store`). The `cache_ttl: 0` config flag flips the source\n * into air-gapped mode: network reads are disabled, only `skaile update`\n * performs refreshes.\n *\n * **Local-mode rejection.** If the resolved config has `catalog.url: local`\n * this helper throws — callers wanting the dispatched local-or-remote source\n * must use {@link resolveCatalogSource}. Remote-only consumers like\n * `skaile update --catalog-only` rely on this strict behaviour.\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A configured {@link RemoteCatalogSource}.\n * @throws When `catalog.url` is the `local` sentinel.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<\n | import(\"@skaile/workspaces/library\").RemoteCatalogSource\n | import(\"@skaile/workspaces/library\").RestCatalogSource\n> {\n const { resolveConfig, RemoteCatalogSource, RestCatalogSource, isLocalCatalogUrl } = await import(\n \"@skaile/workspaces/library\"\n );\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n if (isLocalCatalogUrl(baseUrl)) {\n throw new LocalCatalogDisabledError(\n \"catalog.url is set to 'local' — remote catalog is disabled. \" +\n \"Use `skaile library init <name> --path <dir>` for a local folder, \" +\n `or set \\`catalog.url: https://skaile.store\\` in ${userConfigPath()}.`,\n );\n }\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n if (cfg.catalog.framing === \"rest\") {\n return new RestCatalogSource({ baseUrl, cacheTtlMs });\n }\n return new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n}\n\n/**\n * Resolved catalog source plus a close handle for releasing any underlying\n * resources (e.g. the `LocalIndex` SQLite connection in local mode).\n *\n * Callers MUST invoke `close()` when done — typically in a `finally` block.\n * For remote-mode sources `close()` is a no-op, but the contract is uniform\n * so consumers don't have to branch.\n *\n * @docLink cli/dev-guide#open-library\n */\nexport interface ResolvedCatalogSource {\n /** The {@link ICatalogSource} ready for use. */\n source: import(\"@skaile/workspaces/library\").ICatalogSource;\n /** Release any underlying resources (SQLite handle in local mode). */\n close(): void;\n}\n\n/**\n * Resolve the configured Catalog source — local or remote — based on\n * `~/.skaile/config.yaml`.\n *\n * Dispatch:\n * - `catalog.url: local` → opens {@link LocalIndex}, picks the most recently\n * registered local library whose `path` still exists on disk, and returns a\n * {@link LocalCatalogSource} bound to that library. Throws if no usable\n * local library is registered.\n * - any URL → returns {@link RemoteCatalogSource} (same as\n * {@link openCatalogSource}).\n *\n * The returned `close()` releases the underlying `LocalIndex` SQLite handle\n * in local mode (no-op in remote mode). Callers MUST invoke it — typically in\n * a `finally` block — to satisfy `library/CLAUDE.md` § \"Notes for Consumers\".\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A `ResolvedCatalogSource` carrying the source and a close handle.\n * @throws When `local` is configured but no usable local library is registered.\n * @docLink cli/dev-guide#open-library\n */\nexport async function resolveCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<ResolvedCatalogSource> {\n const {\n resolveConfig,\n RemoteCatalogSource,\n RestCatalogSource,\n LocalCatalogSource,\n isLocalCatalogUrl,\n libraryDirMissing,\n missingLibraryDirMessage,\n } = await import(\"@skaile/workspaces/library\");\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n\n if (isLocalCatalogUrl(baseUrl)) {\n const fs = await import(\"node:fs\");\n const library = await openLibrary();\n try {\n const sources = await library.listSources();\n type LibraryRow = (typeof sources)[number];\n // Type-narrow: `path` is required for local libraries after the filter.\n const usable = sources\n .filter(\n (s): s is LibraryRow & { path: string } =>\n s.backend === \"local\" && typeof s.path === \"string\" && s.path.length > 0,\n )\n .sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());\n\n // A registered library whose directory is gone has one wording everywhere.\n const gone = sources.filter(libraryDirMissing);\n if (usable.length === 0) {\n if (gone.length > 0) throw new Error(gone.map(missingLibraryDirMessage).join(\"\\n\"));\n throw new Error(\n \"catalog.url is set to 'local' but no local library is registered. \" +\n \"Run `skaile library init <name> --path <dir>` first (a git repo: `skaile source add <git-url>`).\",\n );\n }\n\n // Prefer the most recently added library whose path still exists.\n const present = usable.find((s) => fs.existsSync(s.path));\n if (!present) {\n throw new Error(gone.map(missingLibraryDirMessage).join(\"\\n\"));\n }\n\n const source = new LocalCatalogSource(library, present.id, present.path, getKindRegistry());\n return { source, close: () => library.close() };\n } catch (err) {\n // Release the handle on any failure during dispatch — otherwise the\n // SQLite WAL state leaks for the lifetime of the process.\n library.close();\n throw err;\n }\n }\n\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n const source =\n cfg.catalog.framing === \"rest\"\n ? new RestCatalogSource({ baseUrl, cacheTtlMs })\n : new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n return { source, close: () => {} };\n}\n\n/**\n * Open the LibraryManager bound to the active LocalIndex.\n * Caller owns lifetime — must call `close()` (returned helper closes the\n * underlying LocalIndex).\n *\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibraryManager(): Promise<{\n manager: import(\"@skaile/workspaces/library\").LibraryManager;\n library: import(\"@skaile/workspaces/library\").LocalIndex;\n close: () => void;\n}> {\n const { LibraryManager } = await import(\"@skaile/workspaces/library\");\n const library = await openLibrary();\n const manager = new LibraryManager(library);\n return { manager, library, close: () => library.close() };\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { softDepName } from './chunk-
|
|
1
|
+
import { softDepName } from './chunk-R37L4BNR.js';
|
|
2
2
|
import { SKAILE_YAML_DEFAULT, resolveSkWorkspaceConfig } from './chunk-J76LDUDS.js';
|
|
3
3
|
import { existsSync } from 'fs';
|
|
4
4
|
import path from 'path';
|
|
@@ -157,5 +157,5 @@ function formatRelativeTime(date) {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
export { KIND_COL_WIDTH, S, TARGET_DEFAULT_HINT, bareSoftDepName, colorRef, deferredWarnings, fitWidth, formatRelativeTime, formatSoftDepAddPreview, formatSoftDepHint, formatSoftDepRemovePreview, formatSoftDepSection, kindColor, kindColorPad, logErr, logInfo, logNoProject, logOk, logWarn, requireProjectConfig, warnLegacyClaudeCopies };
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-GV3MFKDV.js.map
|
|
161
|
+
//# sourceMappingURL=chunk-GV3MFKDV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../cli/src/helpers.ts"],"names":[],"mappings":";;;;;;AAWO,IAAM,CAAA,GAAI;AAAA,EACf,KAAA,EAAO,CAAC,CAAA,KAAc,EAAA,CAAG,KAAK,EAAA,CAAG,IAAA,CAAK,CAAC,CAAC,CAAA;AAAA,EACxC,GAAA,EAAK,CAAC,CAAA,KAAc,EAAA,CAAG,KAAK,CAAC,CAAA;AAAA,EAC7B,OAAA,EAAS,CAAC,CAAA,KAAc,EAAA,CAAG,KAAK,CAAC,CAAA;AAAA,EACjC,IAAA,EAAM,CAAC,CAAA,KAAc,EAAA,CAAG,KAAK,CAAC,CAAA;AAAA,EAC9B,GAAA,EAAK,CAAC,CAAA,KAAc,EAAA,CAAG,IAAI,CAAC,CAAA;AAAA,EAC5B,EAAA,EAAI,CAAC,CAAA,KAAc,EAAA,CAAG,MAAM,CAAC,CAAA;AAAA,EAC7B,IAAA,EAAM,CAAC,CAAA,KAAc,EAAA,CAAG,OAAO,CAAC,CAAA;AAAA,EAChC,GAAA,EAAK,CAAC,CAAA,KAAc,EAAA,CAAG,IAAI,CAAC,CAAA;AAAA,EAC5B,KAAA,EAAO,C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AAG,OAAO,EAAA;AACjC,EAAA,OAAO,CAAA,CAAE,IAAI,CAAA,EAAG,IAAI,eAAe,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA,2BAAA,CAA6B,CAAA;AACpF;AAOO,SAAS,0BAAA,CAA2B,MAAc,OAAA,EAA2B;AAClF,EAAA,IAAI,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG,OAAO,EAAA;AACjC,EAAA,OAAO,CAAA,CAAE,IAAI,CAAA,SAAA,EAAY,IAAI,iBAAiB,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA,WAAA,CAAa,CAAA;AAC/E;AAGO,SAAS,mBAAmB,IAAA,EAAoB;AACrD,EAAA,MAAM,IAAA,GAAO,IAAA,CAAK,GAAA,EAAI,GAAI,KAAK,OAAA,EAAQ;AACvC,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,KAAA,CAAM,IAAA,GAAO,GAAI,CAAA;AACtC,EAAA,IAAI,OAAA,GAAU,IAAI,OAAO,UAAA;AACzB,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,KAAA,CAAM,OAAA,GAAU,EAAE,CAAA;AACvC,EAAA,IAAI,OAAA,GAAU,EAAA,EAAI,OAAO,CAAA,EAAG,OAAO,CAAA,KAAA,CAAA;AACnC,EAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,KAAA,CAAM,OAAA,GAAU,EAAE,CAAA;AACrC,EAAA,IAAI,KAAA,GAAQ,EAAA,EAAI,OAAO,CAAA,EAAG,KAAK,CAAA,KAAA,CAAA;AAC/B,EAAA,MAAM,IAAA,GAAO,IAAA,CAAK,KAAA,CAAM,KAAA,GAAQ,EAAE,CAAA;AAClC,EAAA,OAAO,GAAG,IAAI,CAAA,KAAA,CAAA;AAChB","file":"chunk-PIDMOE7R.js","sourcesContent":["import { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { softDepName } from \"@skaile/workspaces/asset-manager\";\nimport { resolveSkWorkspaceConfig, SKAILE_YAML_DEFAULT } from \"@skaile/workspaces/core\";\nimport pc from \"picocolors\";\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 driver `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 * 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/** 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` and `--project-dir`, when there is one: skaile\n * does not search parent directories.\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 logErr(\n `${S.cmd(parent)} holds a ${S.cmd(\"skaile.yaml\")}: run from there or pass ${S.cmd(`--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}\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 `.claude/` copies named inline by {@link warnLegacyClaudeCopies}. */\nconst LEGACY_COPY_LIST_MAX = 5;\n\n/**\n * Print ONE warning when tracked assets still have a copy in `.claude/` although\n * the project deploys to another harness (the old default target, see\n * MIGRATION.md). Those copies are orphans: `remove` / `clean` / `list` only look\n * in the active harness dir. Nothing is deleted. Silent when there are none.\n */\nexport function warnLegacyClaudeCopies(am: {\n projectDir: string;\n driverTarget: string;\n listLegacyClaudeDeployed(): Array<{ path: string }>;\n}): void {\n let legacy: Array<{ path: string }>;\n try {\n legacy = am.listLegacyClaudeDeployed();\n } catch {\n return; // advisory only — never fail the command\n }\n if (legacy.length === 0) return;\n const rel = legacy.map((l) => path.relative(am.projectDir, l.path));\n const shown = rel.slice(0, LEGACY_COPY_LIST_MAX).join(\", \");\n const more =\n rel.length > LEGACY_COPY_LIST_MAX ? `, +${rel.length - LEGACY_COPY_LIST_MAX} more` : \"\";\n logWarn(\n `Stale ${S.cmd(\".claude/\")} copies no longer managed (deploying to ${am.driverTarget}): ${shown}${more}. ` +\n `Delete them once ${S.cmd(\"skaile install\")} has deployed to ${am.driverTarget}, or pass ${S.cmd(\"--target claude-code\")} to keep using .claude/.`,\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"]}
|
|
1
|
+
{"version":3,"sources":["../cli/src/helpers.ts"],"names":[],"mappings":";;;;;;AAWO,IAAM,CAAA,GAAI;AAAA,EACf,KAAA,EAAO,CAAC,CAAA,KAAc,EAAA,CAAG,KAAK,EAAA,CAAG,IAAA,CAAK,CAAC,CAAC,CAAA;AAAA,EACxC,GAAA,EAAK,CAAC,CAAA,KAAc,EAAA,CAAG,KAAK,CAAC,CAAA;AAAA,EAC7B,OAAA,EAAS,CAAC,CAAA,KAAc,EAAA,CAAG,KAAK,CAAC,CAAA;AAAA,EACjC,IAAA,EAAM,CAAC,CAAA,KAAc,EAAA,CAAG,KAAK,CAAC,CAAA;AAAA,EAC9B,GAAA,EAAK,CAAC,CAAA,KAAc,EAAA,CAAG,IAAI,CAAC,CAAA;AAAA,EAC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AAA,CAAK,KAAA,CAAM,KAAA,GAAQ,EAAE,CAAA;AAClC,EAAA,OAAO,GAAG,IAAI,CAAA,KAAA,CAAA;AAChB","file":"chunk-GV3MFKDV.js","sourcesContent":["import { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { softDepName } from \"@skaile/workspaces/asset-manager\";\nimport { resolveSkWorkspaceConfig, SKAILE_YAML_DEFAULT } from \"@skaile/workspaces/core\";\nimport pc from \"picocolors\";\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 driver `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 * 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/** 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` and `--project-dir`, when there is one: skaile\n * does not search parent directories.\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 logErr(\n `${S.cmd(parent)} holds a ${S.cmd(\"skaile.yaml\")}: run from there or pass ${S.cmd(`--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}\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 `.claude/` copies named inline by {@link warnLegacyClaudeCopies}. */\nconst LEGACY_COPY_LIST_MAX = 5;\n\n/**\n * Print ONE warning when tracked assets still have a copy in `.claude/` although\n * the project deploys to another harness (the old default target, see\n * MIGRATION.md). Those copies are orphans: `remove` / `clean` / `list` only look\n * in the active harness dir. Nothing is deleted. Silent when there are none.\n */\nexport function warnLegacyClaudeCopies(am: {\n projectDir: string;\n driverTarget: string;\n listLegacyClaudeDeployed(): Array<{ path: string }>;\n}): void {\n let legacy: Array<{ path: string }>;\n try {\n legacy = am.listLegacyClaudeDeployed();\n } catch {\n return; // advisory only — never fail the command\n }\n if (legacy.length === 0) return;\n const rel = legacy.map((l) => path.relative(am.projectDir, l.path));\n const shown = rel.slice(0, LEGACY_COPY_LIST_MAX).join(\", \");\n const more =\n rel.length > LEGACY_COPY_LIST_MAX ? `, +${rel.length - LEGACY_COPY_LIST_MAX} more` : \"\";\n logWarn(\n `Stale ${S.cmd(\".claude/\")} copies no longer managed (deploying to ${am.driverTarget}): ${shown}${more}. ` +\n `Delete them once ${S.cmd(\"skaile install\")} has deployed to ${am.driverTarget}, or pass ${S.cmd(\"--target claude-code\")} to keep using .claude/.`,\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"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { WorkspacePlugin } from './chunk-
|
|
2
|
-
import { buildWorkspaceToolDefs } from './chunk-
|
|
1
|
+
import { WorkspacePlugin } from './chunk-U7YMGW7M.js';
|
|
2
|
+
import { buildWorkspaceToolDefs } from './chunk-NHH3MRSC.js';
|
|
3
3
|
import { findAiAssetsRoot } from './chunk-SZPE55SB.js';
|
|
4
4
|
import { startModelEndpoint } from './chunk-RTYDYSUV.js';
|
|
5
5
|
import { WebSocketServerTransport } from './chunk-NOF73BUH.js';
|
|
6
6
|
import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
|
|
7
7
|
import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-PHRNUTSG.js';
|
|
8
|
-
import { resolveFlowPath } from './chunk-
|
|
8
|
+
import { resolveFlowPath } from './chunk-7Y7UYNGL.js';
|
|
9
9
|
import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-LEOXPIC6.js';
|
|
10
|
-
import { ConnectFailureCarryOver, registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-
|
|
10
|
+
import { ConnectFailureCarryOver, registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-MUOSKYI2.js';
|
|
11
11
|
import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-MKTJZLQM.js';
|
|
12
12
|
import { EventNormalizer } from './chunk-PQF5QHVS.js';
|
|
13
13
|
import { probeResumeTranscript, transcriptStoreForRuntime } from './chunk-TCWECSEB.js';
|
|
@@ -15646,5 +15646,5 @@ function touchSession(state) {
|
|
|
15646
15646
|
}
|
|
15647
15647
|
|
|
15648
15648
|
export { AgentRunError, CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CONNECTOR_MUTATE_NOT_READY, CapabilityRegistry, CompileManifestEntrySchema, CompositionError, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, DEFAULT_MAX_FINISHED_TREES, DEFAULT_RUN_LIMITS, MOUNT_LIST_MAX_DEPTH, MOUNT_LIST_MAX_ENTRIES, MOUNT_READ_DEADLINE_FACTOR, MOUNT_READ_MAX_CHUNK_BYTES, MOUNT_STAT_BUDGET_MS, MOUNT_STAT_MAX_ENTRIES, MOUNT_TREE_OP_DEADLINE_FACTOR, MOUNT_WRITE_MAX_CHUNK_BYTES, MarkdownStreamer, PreInitRingSink, ResourceOperationError, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, UnknownCompositionKindError, WRITE_RANGE_PARTIAL_TTL_MS, WS_AUTH_TOKEN_ENV, WS_AUTH_TOKEN_FILE_ENV, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildCompositionRunSnapshot, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildRunnerAgentSections, buildStoreSnapshotReplay, builtinCapabilities, canonicalJson, capabilityLogInstance, capabilitySignatureInputs, clearPreInitRingSink, clearSession, compileComposition, compositionRunSnapshotPath, computeCapabilitySignature, computeDirectoryTotals, computeRevisionHash, connectorRefreshKind, createAgentSession, createCompositionContentSource, createFinalTextFallback, createFlowConnectorReadiness, createInMemoryRunStore, createManagedCodexSubpromptDriver, createRunController, createSessionStimulusBus, defineCapability, deleteSession, describeComposition, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, driverActiveAfterTurnEnd, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowStartNeedsDriverRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, hasNonTerminalFlow, hashAgentFiles, hashContent, hostOpResumeStimulus, installPreInitRingSink, instanceForSession, isCompositionError, isEmptyKnowledgeIndex, isSessionRootPathAllowed, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadCompositionRunSnapshot, loadKnowledgeDir, loadManagedCodexHostConfig, loadSession, loadSessionById, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickChatFlowTarget, pickFlowToolTarget, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, reconnectedRunNeedsAgentTurn, recreateKeepingLiveFlows, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, rejectPendingCapabilityCallsOnDisconnect, resetRunnerLogStore, resolveAgentInstance, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveMixin, resolveSessionId, restoredRunHasWorkToResume, runAgentChat, saveCompositionRunSnapshot, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, stripFrontmatter, takeRunnerWsAuthToken, toActiveFlowTarget, touchSession, unresolvedCredentialNotices, validateInputResponse, verifyConventionItems, writeClaudeCodeCredentialsFile, writeRangeChunk, writeRangePartialPath };
|
|
15649
|
-
//# sourceMappingURL=chunk-
|
|
15650
|
-
//# sourceMappingURL=chunk-
|
|
15649
|
+
//# sourceMappingURL=chunk-JJLH4TX4.js.map
|
|
15650
|
+
//# sourceMappingURL=chunk-JJLH4TX4.js.map
|