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