@skaile/workspaces 3.17.0 → 3.19.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 +73 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-FQT6GH24.js → asset-feeds-OO3NIRVI.js} +7 -7
- package/dist/{asset-feeds-FQT6GH24.js.map → asset-feeds-OO3NIRVI.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/codex-app-server.js +2 -203
- package/dist/bridge/codex-app-server.js.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +5 -5
- package/dist/bridge/drivers/codex.js +1238 -6
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +2 -2
- package/dist/bridge/drivers/echo.js +2 -2
- package/dist/bridge/drivers/gemini.js +3 -3
- package/dist/bridge/drivers/goose.js +2 -2
- package/dist/bridge/drivers/omp.js +1 -1
- package/dist/bridge/drivers/opencode.js +2 -2
- package/dist/bridge/drivers/qwen.js +3 -3
- package/dist/bridge/index.js +7 -6
- package/dist/bridge/src/capability-dispatch.d.ts +1 -1
- package/dist/bridge/src/capability-dispatch.d.ts.map +1 -1
- package/dist/bridge/src/codex/credentials.d.ts +12 -0
- package/dist/bridge/src/codex/credentials.d.ts.map +1 -0
- package/dist/bridge/src/codex/inputs.d.ts +8 -0
- package/dist/bridge/src/codex/inputs.d.ts.map +1 -0
- package/dist/bridge/src/codex/instance-state.d.ts +16 -0
- package/dist/bridge/src/codex/instance-state.d.ts.map +1 -0
- package/dist/bridge/src/codex/managed-driver.d.ts +73 -0
- package/dist/bridge/src/codex/managed-driver.d.ts.map +1 -0
- package/dist/bridge/src/codex/native-approvals.d.ts +22 -0
- package/dist/bridge/src/codex/native-approvals.d.ts.map +1 -0
- package/dist/bridge/src/codex/native-mcp-approval.d.ts +13 -0
- package/dist/bridge/src/codex/native-mcp-approval.d.ts.map +1 -0
- package/dist/bridge/src/codex/native-policy.d.ts +38 -0
- package/dist/bridge/src/codex/native-policy.d.ts.map +1 -0
- package/dist/bridge/src/codex/native-protocol.generated.d.ts +291 -201
- package/dist/bridge/src/codex/native-protocol.generated.d.ts.map +1 -1
- package/dist/bridge/src/codex/native-state.d.ts +7 -0
- package/dist/bridge/src/codex/native-state.d.ts.map +1 -0
- package/dist/bridge/src/codex/questions.d.ts +19 -0
- package/dist/bridge/src/codex/questions.d.ts.map +1 -0
- package/dist/bridge/src/codex-app-server.d.ts +8 -1
- package/dist/bridge/src/codex-app-server.d.ts.map +1 -1
- package/dist/bridge/src/drivers/codex.d.ts +9 -1
- package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +1 -0
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/normalizer.d.ts.map +1 -1
- package/dist/bridge/src/runtime.d.ts +3 -2
- package/dist/bridge/src/runtime.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +83 -4
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-BCOGOM6F.js → chunk-23L3P7IB.js} +4 -4
- package/dist/{chunk-BCOGOM6F.js.map → chunk-23L3P7IB.js.map} +1 -1
- package/dist/{chunk-NC5YXVZF.js → chunk-2FDKUKDE.js} +3 -3
- package/dist/{chunk-NC5YXVZF.js.map → chunk-2FDKUKDE.js.map} +1 -1
- package/dist/{chunk-CMGYUF5P.js → chunk-34RUVLL6.js} +7 -7
- package/dist/{chunk-CMGYUF5P.js.map → chunk-34RUVLL6.js.map} +1 -1
- package/dist/{chunk-EXT2LNST.js → chunk-3BOWST5G.js} +125 -37
- package/dist/chunk-3BOWST5G.js.map +1 -0
- package/dist/{chunk-BUKPS4YL.js → chunk-4JDCKPTM.js} +2 -2
- package/dist/{chunk-BUKPS4YL.js.map → chunk-4JDCKPTM.js.map} +1 -1
- package/dist/{chunk-5KSIVLOX.js → chunk-5T7Y3AZU.js} +3 -3
- package/dist/{chunk-5KSIVLOX.js.map → chunk-5T7Y3AZU.js.map} +1 -1
- package/dist/{chunk-HEKLK4NG.js → chunk-5Y4RBNT2.js} +6 -6
- package/dist/{chunk-HEKLK4NG.js.map → chunk-5Y4RBNT2.js.map} +1 -1
- package/dist/{chunk-PYX4WZLJ.js → chunk-7ECAUWFU.js} +9 -9
- package/dist/{chunk-PYX4WZLJ.js.map → chunk-7ECAUWFU.js.map} +1 -1
- package/dist/{chunk-QFYEDM63.js → chunk-7J4W54DV.js} +5 -5
- package/dist/{chunk-QFYEDM63.js.map → chunk-7J4W54DV.js.map} +1 -1
- package/dist/{chunk-RRVQAE5D.js → chunk-7ZO3MUP3.js} +6 -5
- package/dist/chunk-7ZO3MUP3.js.map +1 -0
- package/dist/{chunk-HY6CIKFH.js → chunk-CP62G5PK.js} +8 -7
- package/dist/chunk-CP62G5PK.js.map +1 -0
- package/dist/{chunk-OIDFK7SG.js → chunk-DCG4UWJM.js} +3 -3
- package/dist/{chunk-OIDFK7SG.js.map → chunk-DCG4UWJM.js.map} +1 -1
- package/dist/{chunk-RTM4SFLA.js → chunk-GMKNGIIB.js} +7 -4
- package/dist/chunk-GMKNGIIB.js.map +1 -0
- package/dist/{chunk-CIPK5JMJ.js → chunk-H662SXKS.js} +4 -4
- package/dist/{chunk-CIPK5JMJ.js.map → chunk-H662SXKS.js.map} +1 -1
- package/dist/{chunk-VT4MPCRK.js → chunk-HFL3PYJ7.js} +3 -3
- package/dist/{chunk-VT4MPCRK.js.map → chunk-HFL3PYJ7.js.map} +1 -1
- package/dist/{chunk-NMAICJUA.js → chunk-IST2V7RU.js} +3 -3
- package/dist/{chunk-NMAICJUA.js.map → chunk-IST2V7RU.js.map} +1 -1
- package/dist/{chunk-ZNCZ7RUO.js → chunk-JVFZ5R7L.js} +3 -3
- package/dist/{chunk-ZNCZ7RUO.js.map → chunk-JVFZ5R7L.js.map} +1 -1
- package/dist/{chunk-FRER2PEN.js → chunk-KB2GC6YY.js} +16 -3
- package/dist/chunk-KB2GC6YY.js.map +1 -0
- package/dist/chunk-LOO5CB5M.js +12 -0
- package/dist/chunk-LOO5CB5M.js.map +1 -0
- package/dist/{chunk-AL6BU3SP.js → chunk-OJ4N4T4H.js} +12 -4
- package/dist/chunk-OJ4N4T4H.js.map +1 -0
- package/dist/{chunk-X7FJ3ES3.js → chunk-OLRKNOO2.js} +4 -4
- package/dist/{chunk-X7FJ3ES3.js.map → chunk-OLRKNOO2.js.map} +1 -1
- package/dist/chunk-PHBYB4XT.js +247 -0
- package/dist/chunk-PHBYB4XT.js.map +1 -0
- package/dist/{chunk-EO7IJY3Q.js → chunk-PWBURVRH.js} +3 -3
- package/dist/{chunk-EO7IJY3Q.js.map → chunk-PWBURVRH.js.map} +1 -1
- package/dist/chunk-QEZPFJX3.js +254 -0
- package/dist/chunk-QEZPFJX3.js.map +1 -0
- package/dist/{chunk-C4AP3XZB.js → chunk-QG2ZXU5W.js} +4 -4
- package/dist/{chunk-C4AP3XZB.js.map → chunk-QG2ZXU5W.js.map} +1 -1
- package/dist/{chunk-OZ7UNMTK.js → chunk-RPVTPVGX.js} +7 -5
- package/dist/chunk-RPVTPVGX.js.map +1 -0
- package/dist/{chunk-S4UA244H.js → chunk-S635WMXH.js} +4 -4
- package/dist/{chunk-S4UA244H.js.map → chunk-S635WMXH.js.map} +1 -1
- package/dist/{chunk-2XGFQKNJ.js → chunk-SBDTLR3Q.js} +2 -2
- package/dist/{chunk-2XGFQKNJ.js.map → chunk-SBDTLR3Q.js.map} +1 -1
- package/dist/{chunk-BQMRUH7J.js → chunk-SFCVAEJ5.js} +4 -4
- package/dist/{chunk-BQMRUH7J.js.map → chunk-SFCVAEJ5.js.map} +1 -1
- package/dist/{chunk-KCI7DAKE.js → chunk-SZ3HIMSX.js} +988 -238
- package/dist/chunk-SZ3HIMSX.js.map +1 -0
- package/dist/chunk-T3YLZQS4.js +336 -0
- package/dist/chunk-T3YLZQS4.js.map +1 -0
- package/dist/{chunk-PBRMY64S.js → chunk-WB4EWSDR.js} +31 -9
- package/dist/chunk-WB4EWSDR.js.map +1 -0
- package/dist/{chunk-SUPIVTLX.js → chunk-XL45U3C5.js} +3 -3
- package/dist/{chunk-SUPIVTLX.js.map → chunk-XL45U3C5.js.map} +1 -1
- package/dist/{chunk-AXEOG4B5.js → chunk-YCMHWNZA.js} +3 -3
- package/dist/{chunk-AXEOG4B5.js.map → chunk-YCMHWNZA.js.map} +1 -1
- package/dist/{chunk-SWUVULBU.js → chunk-YLSMYOHN.js} +7 -7
- package/dist/{chunk-SWUVULBU.js.map → chunk-YLSMYOHN.js.map} +1 -1
- package/dist/{chunk-NIQPSQFN.js → chunk-YWGL52GT.js} +4 -4
- package/dist/{chunk-NIQPSQFN.js.map → chunk-YWGL52GT.js.map} +1 -1
- package/dist/cli/index.js +75 -53
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/serve.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/src/client.d.ts +3 -2
- package/dist/client/src/client.d.ts.map +1 -1
- package/dist/connectors/config.js +4 -4
- package/dist/connectors/index.js +12 -11
- package/dist/connectors/src/connector-prompt.d.ts +11 -0
- package/dist/connectors/src/connector-prompt.d.ts.map +1 -1
- package/dist/core/index.js +3 -3
- package/dist/core/runtime-assets.js +2 -2
- 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-4GBXK6UR.js → ensure-sources-PR7YN3HV.js} +9 -9
- package/dist/{ensure-sources-4GBXK6UR.js.map → ensure-sources-PR7YN3HV.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +12 -11
- package/dist/factory-assets/connectors/deploy.js +12 -11
- package/dist/factory-assets/connectors/devserver.js +12 -11
- package/dist/factory-assets/connectors/flow/CONNECTOR.md +4 -5
- package/dist/factory-assets/connectors/flow/adapter.d.ts +8 -0
- package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +12 -11
- package/dist/factory-assets/connectors/flow/contract/index.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/contract/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract/schema.d.ts +50 -17
- package/dist/factory-assets/connectors/flow/contract/schema.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract.js +3 -3
- package/dist/factory-assets/connectors/flow/engine/index.d.ts +1 -0
- package/dist/factory-assets/connectors/flow/engine/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine.js +5 -5
- package/dist/factory-assets/connectors/flow/run-flow.js +13 -12
- package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts +10 -1
- package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow.js +12 -11
- package/dist/factory-assets/connectors/git.js +12 -11
- package/dist/factory-assets/connectors/gmail.js +12 -11
- package/dist/factory-assets/connectors/googledrive.js +12 -11
- package/dist/factory-assets/connectors/local.js +12 -11
- package/dist/factory-assets/connectors/mattermost.js +12 -11
- package/dist/factory-assets/connectors/memory.js +12 -11
- package/dist/factory-assets/connectors/minio.js +12 -11
- package/dist/factory-assets/connectors/postgres.js +12 -11
- package/dist/factory-assets/connectors/s3.js +12 -11
- package/dist/factory-assets/connectors/sharepoint.js +12 -11
- package/dist/factory-assets/connectors/sqlite.js +12 -11
- package/dist/factory-assets/connectors/static-server.js +12 -11
- package/dist/factory-assets/connectors/tunnel.js +12 -11
- package/dist/factory-assets/connectors/webdav.js +12 -11
- package/dist/factory-assets/connectors/xstate-store.js +12 -11
- package/dist/factory-assets/connectors/xstate.js +12 -11
- package/dist/{flows-2SUFOVVO.js → flows-COBS26MK.js} +6 -6
- package/dist/{flows-2SUFOVVO.js.map → flows-COBS26MK.js.map} +1 -1
- package/dist/{helpers-26LW4IXY.js → helpers-TFSZSWT5.js} +9 -9
- package/dist/{helpers-26LW4IXY.js.map → helpers-TFSZSWT5.js.map} +1 -1
- package/dist/library/index.js +4 -4
- package/dist/library/install.js +3 -3
- package/dist/{library-publish-IYGHOPEK.js → library-publish-WVIUUYG3.js} +14 -14
- package/dist/{library-publish-IYGHOPEK.js.map → library-publish-WVIUUYG3.js.map} +1 -1
- package/dist/{open-library-HH5LST7Z.js → open-library-2AWZGIWE.js} +12 -12
- package/dist/{open-library-HH5LST7Z.js.map → open-library-2AWZGIWE.js.map} +1 -1
- package/dist/{paths-4APA2PKT.js → paths-CZPCCBYX.js} +6 -6
- package/dist/{paths-4APA2PKT.js.map → paths-CZPCCBYX.js.map} +1 -1
- package/dist/{plugin-store-JQAIKR3R.js → plugin-store-ZEIBSNTO.js} +5 -5
- package/dist/{plugin-store-JQAIKR3R.js.map → plugin-store-ZEIBSNTO.js.map} +1 -1
- package/dist/{project-U5QRUCBN.js → project-XZDKNIRG.js} +10 -10
- package/dist/{project-U5QRUCBN.js.map → project-XZDKNIRG.js.map} +1 -1
- package/dist/resolver/index.js +3 -3
- package/dist/runner/index.js +25 -16
- package/dist/runner/src/capability-registry.d.ts +4 -0
- package/dist/runner/src/capability-registry.d.ts.map +1 -1
- package/dist/runner/src/codex-init.d.ts +2 -11
- package/dist/runner/src/codex-init.d.ts.map +1 -1
- package/dist/runner/src/codex-resource-tools.d.ts +16 -0
- package/dist/runner/src/codex-resource-tools.d.ts.map +1 -0
- package/dist/runner/src/codex-tools.d.ts +12 -0
- package/dist/runner/src/codex-tools.d.ts.map +1 -0
- package/dist/runner/src/define-capability.d.ts +2 -0
- package/dist/runner/src/define-capability.d.ts.map +1 -1
- package/dist/runner/src/external-mcp.d.ts +8 -3
- package/dist/runner/src/external-mcp.d.ts.map +1 -1
- package/dist/runner/src/index.d.ts +2 -0
- package/dist/runner/src/index.d.ts.map +1 -1
- package/dist/runner/src/managed-codex-bootstrap.d.ts +54 -0
- package/dist/runner/src/managed-codex-bootstrap.d.ts.map +1 -0
- package/dist/runner/src/resources.d.ts +1 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +5 -0
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +18 -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 +7 -6
- package/dist/sdk/client.js +1 -1
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/flow.js +5 -5
- package/dist/sdk/index.js +26 -17
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +3 -3
- package/dist/sdk/runner.js +25 -16
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/store.js +1 -1
- package/dist/sdk/types.js +1 -1
- package/dist/session/index.js +2 -2
- package/dist/{setup-XKTBHRWM.js → setup-J34TR5IR.js} +9 -8
- package/dist/setup-J34TR5IR.js.map +1 -0
- package/dist/{skills-Q7PJVB3W.js → skills-LG6IQSSN.js} +5 -5
- package/dist/{skills-Q7PJVB3W.js.map → skills-LG6IQSSN.js.map} +1 -1
- package/dist/{source-ODR4IU6R.js → source-QYINHHUP.js} +13 -13
- package/dist/{source-ODR4IU6R.js.map → source-QYINHHUP.js.map} +1 -1
- package/dist/{source-manifest-publish-WCJY3GAM.js → source-manifest-publish-3RBW5E2O.js} +15 -15
- package/dist/{source-manifest-publish-WCJY3GAM.js.map → source-manifest-publish-3RBW5E2O.js.map} +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/react.js +1 -1
- package/dist/store/react.js.map +1 -1
- package/dist/store/src/react.d.ts +1 -1
- package/dist/store/src/react.d.ts.map +1 -1
- package/dist/store/src/store.d.ts +2 -1
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/tui/index.js +25 -16
- package/dist/tui/index.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/src/events.d.ts +14 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/protocol.d.ts +18 -0
- package/dist/types/src/protocol.d.ts.map +1 -1
- package/dist/types/src/runtime.d.ts +3 -1
- package/dist/types/src/runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +7 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +9 -255
- package/dist/workspace-plugin/adapters/mcp.js.map +1 -1
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +4 -1
- package/dist/chunk-AL6BU3SP.js.map +0 -1
- package/dist/chunk-EXT2LNST.js.map +0 -1
- package/dist/chunk-FRER2PEN.js.map +0 -1
- package/dist/chunk-HY6CIKFH.js.map +0 -1
- package/dist/chunk-KCI7DAKE.js.map +0 -1
- package/dist/chunk-OZ7UNMTK.js.map +0 -1
- package/dist/chunk-PBRMY64S.js.map +0 -1
- package/dist/chunk-RRVQAE5D.js.map +0 -1
- package/dist/chunk-RTM4SFLA.js.map +0 -1
- package/dist/setup-XKTBHRWM.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#674](https://github.com/skaile-ai/workspaces/pull/674) [`95ff13e`](https://github.com/skaile-ai/workspaces/commit/95ff13ef72e86c721b9107744ed4cc5614794e81) Thanks [@peteralbert](https://github.com/peteralbert)! - Add explicit approve-once/deny managed MCP consent using the original native callback and configured transport binding. Preserve the native elicitation envelope in the generated protocol; reject unsupported approval forms, stale replies and changed bindings through the final RPC write. Consent cards add the `mcp` kind with bounded durable presentation, without replacing capability or Platform authorization.
|
|
8
|
+
|
|
9
|
+
Update strict consent consumers as described in MIGRATION.md. Synthetic driver/runner regressions and a separately constrained allowed-only fixture harness do not establish native/provider readiness or production activation.
|
|
10
|
+
|
|
11
|
+
Sample final passive MCP counters after owned transport closure, so rejected post-terminal SDK entries cannot disappear from the final audit. Uncertain closure or a failed counter read does not claim a completed final sample.
|
|
12
|
+
|
|
13
|
+
## 3.18.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#656](https://github.com/skaile-ai/workspaces/pull/656) [`b82c03e`](https://github.com/skaile-ai/workspaces/commit/b82c03eaa659e01bd6d0c0cac52fe1c82cbcc90f) Thanks [@peteralbert](https://github.com/peteralbert)! - Add an explicit managed App Server implementation behind the existing Codex driver, with dedicated authentication, private instance state, account-bound resume, correlated queued turns and bounded cancellation/disposal. Preserve no-option standalone SDK behavior. Reuse shared credential validation with bounded mint-time clock skew and strict expiry. This supplies the driver lifecycle seam for tool integration; it does not advertise Codex support or establish native/provider/Linux readiness.
|
|
18
|
+
|
|
19
|
+
- [#663](https://github.com/skaile-ai/workspaces/pull/663) [`08b3b0e`](https://github.com/skaile-ai/workspaces/commit/08b3b0e20102a42260cbb62458eb53058a7b68ea) Thanks [@peteralbert](https://github.com/peteralbert)! - Wire managed Codex into the production serve CLI through an explicit private, nonsecret host configuration. Validate launcher paths and model policy before feature advertisement; bind existing init credentials and profiles without ambient auth or project overrides, then initialize the driver before acknowledging the session.
|
|
20
|
+
|
|
21
|
+
Use the existing account-bound subscription refresh RPC with cancellation. Keep changed bindings fail-closed, preserve ordinary Claude startup, and decline unsupported CLI native approval grants. Publication, native qualification and Platform private-state compatibility remain separate adoption requirements.
|
|
22
|
+
|
|
23
|
+
Cancel and join an in-progress native initialize handshake before managed disposal releases its private instance lease, including shutdown before serve initialization is acknowledged.
|
|
24
|
+
|
|
25
|
+
- [#659](https://github.com/skaile-ai/workspaces/pull/659) [`101ffda`](https://github.com/skaile-ai/workspaces/commit/101ffda6e84f2189f4cfe0d051c5e5dcdc1164ab) Thanks [@peteralbert](https://github.com/peteralbert)! - Run managed Codex flow subprompts in disposable isolated drivers with one admitted native turn and the existing five-minute deadline. A native turn may make multiple internal provider requests; report and account for every response through cumulative native usage, including cache reads, context, and the actual model on successful and failed turns.
|
|
26
|
+
|
|
27
|
+
Preserve the first response's usage when resuming a thread with no prior usage, and join child disposal after node timeouts before draining or disconnect completes.
|
|
28
|
+
|
|
29
|
+
- [#658](https://github.com/skaile-ai/workspaces/pull/658) [`6886372`](https://github.com/skaile-ai/workspaces/commit/6886372dac1675c658e0d451b40e93777bc0455a) Thanks [@peteralbert](https://github.com/peteralbert)! - Add the explicit managed Codex runner MCP adapter, correlated native questions and approval hooks, and scoped image/file/skill inputs. Reuse existing registry and connector/flow handlers with cancellation and live inventory checks. This source does not advertise the gated runtime feature or authorize complete runtime publication.
|
|
30
|
+
|
|
31
|
+
- [#664](https://github.com/skaile-ai/workspaces/pull/664) [`87d0818`](https://github.com/skaile-ai/workspaces/commit/87d08189831140f9691585868571de38ec73cdee) Thanks [@peteralbert](https://github.com/peteralbert)! - Version managed Codex state by session/account binding under the existing private lease. Positively classified unavailable native state can use one same-binding fresh initialization and the existing DB restore event; other failures remain fatal. Clarify that native permission consent lasts for the current turn.
|
|
32
|
+
|
|
33
|
+
- [#663](https://github.com/skaile-ai/workspaces/pull/663) [`08b3b0e`](https://github.com/skaile-ai/workspaces/commit/08b3b0e20102a42260cbb62458eb53058a7b68ea) Thanks [@peteralbert](https://github.com/peteralbert)! - Carry exact question request identities through reply actions and add managed
|
|
34
|
+
native approval consent over the existing question transport. Native grants
|
|
35
|
+
require the active managed private policy and explicit approval for one request.
|
|
36
|
+
|
|
37
|
+
Require the explicit host-owned privateRoot for managed native policy composition;
|
|
38
|
+
deny the full private mount and retain that policy across thread, turn and native
|
|
39
|
+
approval handling. Published runtime adoption and live isolation evidence remain required.
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- [#667](https://github.com/skaile-ai/workspaces/pull/667) [`50c0c86`](https://github.com/skaile-ai/workspaces/commit/50c0c8677387975b53fd615533ff03ff890bf3c8) Thanks [@peteralbert](https://github.com/peteralbert)! - Add opt-in strict external MCP disposal that reports failed client closes after attempting all owned cleanup. The native tool harness reuses the production runtime manager for an explicitly approved public external-tool observation.
|
|
44
|
+
|
|
45
|
+
- [#672](https://github.com/skaile-ai/workspaces/pull/672) [`8c5e3c2`](https://github.com/skaile-ai/workspaces/commit/8c5e3c2da0df5b692ab70c83068ac10d539ad613) Thanks [@peteralbert](https://github.com/peteralbert)! - Add passive, closed managed MCP startup and request-count diagnostics without changing native admission or turn behavior.
|
|
46
|
+
|
|
47
|
+
- [#669](https://github.com/skaile-ai/workspaces/pull/669) [`e9ce1b5`](https://github.com/skaile-ai/workspaces/commit/e9ce1b5d703ee4e7665ca352ca8984bb9ad06b40) Thanks [@mortegro](https://github.com/mortegro)! - Stop zod's recursive `JSONType` from reaching `FlowDefinition` (TS2589).
|
|
48
|
+
|
|
49
|
+
`input.example` and `defaults.run_input` were typed with `z.json()`, whose
|
|
50
|
+
inferred type is zod's self-recursive `util.JSONType`. Consumers that wrap a
|
|
51
|
+
`FlowDefinition` in a Vue `ref()` hit "Type instantiation is excessively deep
|
|
52
|
+
and possibly infinite": Vue's `UnwrapRefSimple` maps arrays through a
|
|
53
|
+
homomorphic mapped type, minting a fresh anonymous type at every level and
|
|
54
|
+
defeating TypeScript's recursion-identity check. Only the anonymous _array_
|
|
55
|
+
member of the union triggers it.
|
|
56
|
+
|
|
57
|
+
Replaced with an explicit `FlowJsonValue` whose array member is a named
|
|
58
|
+
`FlowJsonArray` interface, so the recursion resolves to a stable identity.
|
|
59
|
+
The accepted value space is unchanged. Covered by a type test in
|
|
60
|
+
`@skaile/workspace-bridge-vue`.
|
|
61
|
+
|
|
62
|
+
- [#668](https://github.com/skaile-ai/workspaces/pull/668) [`71e3067`](https://github.com/skaile-ai/workspaces/commit/71e306791288de979a6908ca12e1c951583c74fe) Thanks [@mortegro](https://github.com/mortegro)! - Point the legacy-manifest errors at a migration path instead of a dead end.
|
|
63
|
+
|
|
64
|
+
`assertNoLegacyTopLevelKeys` rejected `repositories:`, `ai_resources:`,
|
|
65
|
+
`publisher:`, `version:` and `assets:` with a bare "unknown top-level key",
|
|
66
|
+
leaving no indication of what replaced them. The keys were removed in 0.22.0,
|
|
67
|
+
so every consumer still carrying one is already broken at `resolveSkWorkspaceConfig`
|
|
68
|
+
— the error is the only place they find out. Each message now names the
|
|
69
|
+
replacement and links the migration guide.
|
|
70
|
+
|
|
71
|
+
Note for anyone hitting this: the check is `!== undefined`, so an empty
|
|
72
|
+
`repositories: {}` throws identically. `decodeSkaileYaml` stays total and merely
|
|
73
|
+
records `legacy_key_rejected`; only the runtime boundary re-throws, which is why
|
|
74
|
+
a preview pane can look healthy while `serve` cannot start.
|
|
75
|
+
|
|
3
76
|
## 3.17.0
|
|
4
77
|
|
|
5
78
|
### Minor Changes
|
package/dist/app-sdk/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { assignDomain, buildDomainIndex, DOMAIN_MD_FILENAME, parseDomainMd } from './chunk-DZ4UZOFB.js';
|
|
2
2
|
import './chunk-JXT46QFC.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-H662SXKS.js';
|
|
4
4
|
import './chunk-F3HNW354.js';
|
|
5
5
|
import './chunk-K5GBV4SA.js';
|
|
6
6
|
import './chunk-QVZA2MDT.js';
|
|
7
|
-
import { factoryAssetRoots } from './chunk-
|
|
8
|
-
import { scanRepo } from './chunk-
|
|
7
|
+
import { factoryAssetRoots } from './chunk-DCG4UWJM.js';
|
|
8
|
+
import { scanRepo } from './chunk-RPVTPVGX.js';
|
|
9
9
|
import './chunk-MENCWIHW.js';
|
|
10
10
|
import './chunk-P4VHQA4N.js';
|
|
11
11
|
import { walkDir, parseFrontmatter } from './chunk-MKZOK4JU.js';
|
|
@@ -65,7 +65,7 @@ async function libraryAssets() {
|
|
|
65
65
|
const domains = [];
|
|
66
66
|
try {
|
|
67
67
|
const [{ openLibraryManager }, { skaileHomeDir }, { getGlobalCacheDir }] = await Promise.all([
|
|
68
|
-
import('./open-library-
|
|
68
|
+
import('./open-library-2AWZGIWE.js'),
|
|
69
69
|
import('./library/index.js'),
|
|
70
70
|
import('./core/index.js')
|
|
71
71
|
]);
|
|
@@ -98,7 +98,7 @@ async function libraryAssets() {
|
|
|
98
98
|
async function storeAssets(projectDir) {
|
|
99
99
|
const notes = [];
|
|
100
100
|
try {
|
|
101
|
-
const { resolveCatalogSource } = await import('./open-library-
|
|
101
|
+
const { resolveCatalogSource } = await import('./open-library-2AWZGIWE.js');
|
|
102
102
|
const { source, close } = await resolveCatalogSource({ projectDir });
|
|
103
103
|
try {
|
|
104
104
|
const assets = await source.listAssets();
|
|
@@ -202,5 +202,5 @@ function dedupeBySlug(domains) {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
export { gatherAssetFeeds };
|
|
205
|
-
//# sourceMappingURL=asset-feeds-
|
|
206
|
-
//# sourceMappingURL=asset-feeds-
|
|
205
|
+
//# sourceMappingURL=asset-feeds-OO3NIRVI.js.map
|
|
206
|
+
//# sourceMappingURL=asset-feeds-OO3NIRVI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAqFA,SAAS,QAAQ,CAAA,EAAmB;AAClC,EAAA,OAAO,CAAA,CAAE,KAAA,CAAW,IAAA,CAAA,GAAG,CAAA,CAAE,KAAK,GAAG,CAAA;AACnC;AAGA,eAAe,cAAc,IAAA,EAAmC;AAC9D,EAAA,MAAM,MAAkB,EAAC;AACzB,EAAA,WAAA,MAAiB,EAAE,IAAA,EAAM,QAAA,EAAU,MAAK,IAAK,OAAA,CAAQ,IAAI,CAAA,EAAG;AAC1D,IAAA,IAAI,SAAS,kBAAA,EAAoB;AACjC,IAAA,IAAI;AACF,MAAA,MAAM,EAAE,IAAA,EAAK,GAAI,iBAAiB,YAAA,CAAa,QAAA,EAAU,MAAM,CAAC,CAAA;AAChE,M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W,KAAK,OAAA,EAAS;AACvB,IAAA,IAAI,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,IAAI,CAAA,EAAG;AACtB,IAAA,IAAA,CAAK,GAAA,CAAI,EAAE,IAAI,CAAA;AACf,IAAA,GAAA,CAAI,KAAK,CAAC,CAAA;AAAA,EACZ;AACA,EAAA,OAAO,GAAA;AACT","file":"asset-feeds-FQT6GH24.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex` (filesystem\n * scan of each library's `path`).\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogDomain,\n type CatalogEntry,\n factoryAssetRoots,\n parseFrontmatter,\n scanRepo,\n walkDir,\n} from \"@skaile/workspaces/core\";\nimport {\n assignDomain,\n buildDomainIndex,\n DOMAIN_MD_FILENAME,\n type DomainMd,\n parseDomainMd,\n} from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n /**\n * Display-only domain metadata, keyed (by the consumer) on `slug`. Populated\n * from the store's `catalog.listDomains` when the connected catalog source\n * exposes it; empty otherwise. The manage TUI joins `entry.domainSlug` → a\n * domain for grouping headers, descriptions, and relation badges.\n */\n domains: CatalogDomain[];\n notes: FeedNote[];\n}\n\n// ── Domain stamping (on-disk feeds) ──────────────────────────────────────────\n//\n// `scanRepo` (the source / library / factory scan path) does not read the\n// `DOMAIN.md` sidecars, so its entries arrive with no `domainSlug` and render\n// flat under their publisher band. We re-derive the grouping here from the\n// root's `DOMAIN.md` files (the same sidecars the remote store computes\n// server-side), and fall back to the repo/source name for any entry no domain\n// claims so it still groups instead of landing in the synthetic \"no domain\" pile.\n\n/** Repo-relative POSIX path (DOMAIN.md slugs are matched whole-segment, `/`-joined). */\nfunction toPosix(p: string): string {\n return p.split(path.sep).join(\"/\");\n}\n\n/** Parse every `DOMAIN.md` sidecar under `root` into a {@link DomainMd}. */\nasync function loadDomainMds(root: string): Promise<DomainMd[]> {\n const out: DomainMd[] = [];\n for await (const { path: filePath, name } of walkDir(root)) {\n if (name !== DOMAIN_MD_FILENAME) continue;\n try {\n const { data } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n out.push(parseDomainMd(toPosix(path.relative(root, filePath)), data));\n } catch {}\n }\n return out;\n}\n\n/**\n * Stamp `domainSlug` onto every entry scanned from `root` using the root's\n * `DOMAIN.md` sidecars. Returns the `CatalogDomain` registry for the real\n * domains, plus a synthetic fallback domain when any entry used the fallback.\n * Mutates `entries` in place (sets `entry.domainSlug`).\n *\n * `synthesizeFallback` (default true): entries no domain claims fall back to\n * `fallbackSlug` (the repo/source name). Pass `false` when the caller already\n * groups these entries one level up (e.g. the source feed groups by source\n * node) — unmatched entries then get no domain (`\"\"`) and hang directly under\n * that parent, instead of nesting under a same-named fallback domain.\n */\nasync function stampDomains(\n root: string,\n fallbackSlug: string,\n entries: CatalogEntry[],\n synthesizeFallback = true,\n): Promise<CatalogDomain[]> {\n const domainMds = await loadDomainMds(root);\n const assignables = entries.map((entry) => ({\n entry,\n ref: `${entry.kind}:${entry.name}`,\n relativePath: toPosix(path.relative(root, entry.source)),\n }));\n\n let usedFallback = false;\n for (const a of assignables) {\n const slug = assignDomain(a.relativePath, domainMds);\n if (slug) a.entry.domainSlug = slug;\n else if (synthesizeFallback) {\n a.entry.domainSlug = fallbackSlug;\n usedFallback = true;\n } else a.entry.domainSlug = \"\";\n }\n\n const { index } = buildDomainIndex(assignables, domainMds);\n const catalog: CatalogDomain[] = Object.values(index).map((d) => ({\n slug: d.slug,\n title: d.title,\n ...(d.description ? { description: d.description } : {}),\n ...(d.relation ? { relation: d.relation } : {}),\n ...(d.order !== undefined ? { order: d.order } : {}),\n ...(d.recommended[0] ? { recommendedRef: d.recommended[0] } : {}),\n }));\n if (usedFallback) catalog.push({ slug: fallbackSlug, title: fallbackSlug });\n return catalog;\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache). Each\n * library's `path` is scanned with `scanRepo` and grouped under the bare library\n * name (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix and no redundant same-named fallback domain (mirrors the\n * source feed).\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const [{ openLibraryManager }, { skaileHomeDir }, { getGlobalCacheDir }] = await Promise.all([\n import(\"./open-library.ts\"),\n import(\"@skaile/workspaces/library\"),\n import(\"@skaile/workspaces/core\"),\n ]);\n const { manager, close } = await openLibraryManager();\n try {\n // Authoring libraries are the rows that are NOT source clones. index.db\n // rows predating the cache migration still carry the legacy\n // ~/.skaile/sources path, so exclude both roots.\n const newRoot = getGlobalCacheDir();\n const legacyRoot = path.join(skaileHomeDir(), \"sources\");\n const libs = (await manager.listLibraries()).filter(\n (l) => !l.path.startsWith(newRoot) && !l.path.startsWith(legacyRoot),\n );\n const entries: OriginEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n // Scan + group under the bare library name. `synthesizeFallback: false`\n // (as the source feed does) keeps domainless assets directly under the\n // library band instead of a redundant same-named fallback domain.\n const libEntries = [...(await scanRepo(lib.path, lib.name))];\n domains.push(...(await stampDomains(lib.path, lib.name, libEntries, false)));\n for (const entry of libEntries) entries.push({ origin: \"library\", entry, group: lib.name });\n }\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], domains, notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n const assets = await source.listAssets();\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n domainSlug: a.domainSlug,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n // Domains are optional on the catalog source — only the store backend\n // (post Part 4 `catalog.listDomains`) exposes them. Duck-type the call so\n // older sources and the local catalog degrade to no domains, not an error.\n const domains = await loadDomains(source);\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], domains: [], notes };\n }\n}\n\n/** Optional `listDomains` capability — returns `[]` when the source lacks it. */\nasync function loadDomains(source: unknown): Promise<CatalogDomain[]> {\n const fn = (source as { listDomains?: () => Promise<CatalogDomain[]> }).listDomains;\n if (typeof fn !== \"function\") return [];\n const domains = await fn.call(source);\n return Array.isArray(domains) ? domains : [];\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => Promise<CatalogEntry[]>;\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which now merges\n * `skaile.yaml`'s `sources:` field into the repositories map, then stamps\n * `DOMAIN.md`-derived domain grouping onto the scanned entries via\n * `searchRepoRoots()`.\n */\nasync function sourceAssets(\n am: AssetManagerLike,\n): Promise<{ entries: OriginEntry[]; domains: CatalogDomain[] }> {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = (await am.search()).filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n const domains: CatalogDomain[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group + stamp by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n // No synthetic fallback domain — the source node already groups these, so a\n // same-named fallback would just nest the source under itself.\n domains.push(...(await stampDomains(root, sourceName, owned, false)));\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return { entries, domains };\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Local disk only, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n const rootEntries = [...(await scanRepo(root, \"skaile-factory\"))];\n domains.push(...(await stampDomains(root, \"skaile-factory\", rootEntries)));\n entries.push(...rootEntries);\n }\n return { entries, domains, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], domains, notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local disk only, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = await factoryAssets();\n const src = await sourceAssets(am);\n return {\n entries: [\n ...src.entries,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n // Store domains first (server-curated), then the on-disk feeds; dedupe by\n // slug, first-wins, so a store-served domain shadows a same-slug local one.\n domains: dedupeBySlug([...store.domains, ...src.domains, ...libs.domains, ...factory.domains]),\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n\n/** First-wins dedupe of a domain list by `slug`. */\nfunction dedupeBySlug(domains: CatalogDomain[]): CatalogDomain[] {\n const seen = new Set<string>();\n const out: CatalogDomain[] = [];\n for (const d of domains) {\n if (seen.has(d.slug)) continue;\n seen.add(d.slug);\n out.push(d);\n }\n return out;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAqFA,SAAS,QAAQ,CAAA,EAAmB;AAClC,EAAA,OAAO,CAAA,CAAE,KAAA,CAAW,IAAA,CAAA,GAAG,CAAA,CAAE,KAAK,GAAG,CAAA;AACnC;AAGA,eAAe,cAAc,IAAA,EAAmC;AAC9D,EAAA,MAAM,MAAkB,EAAC;AACzB,EAAA,WAAA,MAAiB,EAAE,IAAA,EAAM,QAAA,EAAU,MAAK,IAAK,OAAA,CAAQ,IAAI,CAAA,EAAG;AAC1D,IAAA,IAAI,SAAS,kBAAA,EAAoB;AACjC,IAAA,IAAI;AACF,MAAA,MAAM,EAAE,IAAA,EAAK,GAAI,iBAAiB,YAAA,CAAa,QAAA,EAAU,MAAM,CAAC,CAAA;AAChE,MAAA,GAAA,CAAI,IAAA,CAAK,cAAc,OAAA,CAAa,IAAA,CAAA,QAAA,CAAS,MAAM,QAAQ,CAAC,CAAA,EAAG,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A,IAAA,CAAK,GAAA,CAAI,EAAE,IAAI,CAAA;AACf,IAAA,GAAA,CAAI,KAAK,CAAC,CAAA;AAAA,EACZ;AACA,EAAA,OAAO,GAAA;AACT","file":"asset-feeds-OO3NIRVI.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex` (filesystem\n * scan of each library's `path`).\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogDomain,\n type CatalogEntry,\n factoryAssetRoots,\n parseFrontmatter,\n scanRepo,\n walkDir,\n} from \"@skaile/workspaces/core\";\nimport {\n assignDomain,\n buildDomainIndex,\n DOMAIN_MD_FILENAME,\n type DomainMd,\n parseDomainMd,\n} from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n /**\n * Display-only domain metadata, keyed (by the consumer) on `slug`. Populated\n * from the store's `catalog.listDomains` when the connected catalog source\n * exposes it; empty otherwise. The manage TUI joins `entry.domainSlug` → a\n * domain for grouping headers, descriptions, and relation badges.\n */\n domains: CatalogDomain[];\n notes: FeedNote[];\n}\n\n// ── Domain stamping (on-disk feeds) ──────────────────────────────────────────\n//\n// `scanRepo` (the source / library / factory scan path) does not read the\n// `DOMAIN.md` sidecars, so its entries arrive with no `domainSlug` and render\n// flat under their publisher band. We re-derive the grouping here from the\n// root's `DOMAIN.md` files (the same sidecars the remote store computes\n// server-side), and fall back to the repo/source name for any entry no domain\n// claims so it still groups instead of landing in the synthetic \"no domain\" pile.\n\n/** Repo-relative POSIX path (DOMAIN.md slugs are matched whole-segment, `/`-joined). */\nfunction toPosix(p: string): string {\n return p.split(path.sep).join(\"/\");\n}\n\n/** Parse every `DOMAIN.md` sidecar under `root` into a {@link DomainMd}. */\nasync function loadDomainMds(root: string): Promise<DomainMd[]> {\n const out: DomainMd[] = [];\n for await (const { path: filePath, name } of walkDir(root)) {\n if (name !== DOMAIN_MD_FILENAME) continue;\n try {\n const { data } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n out.push(parseDomainMd(toPosix(path.relative(root, filePath)), data));\n } catch {}\n }\n return out;\n}\n\n/**\n * Stamp `domainSlug` onto every entry scanned from `root` using the root's\n * `DOMAIN.md` sidecars. Returns the `CatalogDomain` registry for the real\n * domains, plus a synthetic fallback domain when any entry used the fallback.\n * Mutates `entries` in place (sets `entry.domainSlug`).\n *\n * `synthesizeFallback` (default true): entries no domain claims fall back to\n * `fallbackSlug` (the repo/source name). Pass `false` when the caller already\n * groups these entries one level up (e.g. the source feed groups by source\n * node) — unmatched entries then get no domain (`\"\"`) and hang directly under\n * that parent, instead of nesting under a same-named fallback domain.\n */\nasync function stampDomains(\n root: string,\n fallbackSlug: string,\n entries: CatalogEntry[],\n synthesizeFallback = true,\n): Promise<CatalogDomain[]> {\n const domainMds = await loadDomainMds(root);\n const assignables = entries.map((entry) => ({\n entry,\n ref: `${entry.kind}:${entry.name}`,\n relativePath: toPosix(path.relative(root, entry.source)),\n }));\n\n let usedFallback = false;\n for (const a of assignables) {\n const slug = assignDomain(a.relativePath, domainMds);\n if (slug) a.entry.domainSlug = slug;\n else if (synthesizeFallback) {\n a.entry.domainSlug = fallbackSlug;\n usedFallback = true;\n } else a.entry.domainSlug = \"\";\n }\n\n const { index } = buildDomainIndex(assignables, domainMds);\n const catalog: CatalogDomain[] = Object.values(index).map((d) => ({\n slug: d.slug,\n title: d.title,\n ...(d.description ? { description: d.description } : {}),\n ...(d.relation ? { relation: d.relation } : {}),\n ...(d.order !== undefined ? { order: d.order } : {}),\n ...(d.recommended[0] ? { recommendedRef: d.recommended[0] } : {}),\n }));\n if (usedFallback) catalog.push({ slug: fallbackSlug, title: fallbackSlug });\n return catalog;\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache). Each\n * library's `path` is scanned with `scanRepo` and grouped under the bare library\n * name (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix and no redundant same-named fallback domain (mirrors the\n * source feed).\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const [{ openLibraryManager }, { skaileHomeDir }, { getGlobalCacheDir }] = await Promise.all([\n import(\"./open-library.ts\"),\n import(\"@skaile/workspaces/library\"),\n import(\"@skaile/workspaces/core\"),\n ]);\n const { manager, close } = await openLibraryManager();\n try {\n // Authoring libraries are the rows that are NOT source clones. index.db\n // rows predating the cache migration still carry the legacy\n // ~/.skaile/sources path, so exclude both roots.\n const newRoot = getGlobalCacheDir();\n const legacyRoot = path.join(skaileHomeDir(), \"sources\");\n const libs = (await manager.listLibraries()).filter(\n (l) => !l.path.startsWith(newRoot) && !l.path.startsWith(legacyRoot),\n );\n const entries: OriginEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n // Scan + group under the bare library name. `synthesizeFallback: false`\n // (as the source feed does) keeps domainless assets directly under the\n // library band instead of a redundant same-named fallback domain.\n const libEntries = [...(await scanRepo(lib.path, lib.name))];\n domains.push(...(await stampDomains(lib.path, lib.name, libEntries, false)));\n for (const entry of libEntries) entries.push({ origin: \"library\", entry, group: lib.name });\n }\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], domains, notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n const assets = await source.listAssets();\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n domainSlug: a.domainSlug,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n // Domains are optional on the catalog source — only the store backend\n // (post Part 4 `catalog.listDomains`) exposes them. Duck-type the call so\n // older sources and the local catalog degrade to no domains, not an error.\n const domains = await loadDomains(source);\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], domains: [], notes };\n }\n}\n\n/** Optional `listDomains` capability — returns `[]` when the source lacks it. */\nasync function loadDomains(source: unknown): Promise<CatalogDomain[]> {\n const fn = (source as { listDomains?: () => Promise<CatalogDomain[]> }).listDomains;\n if (typeof fn !== \"function\") return [];\n const domains = await fn.call(source);\n return Array.isArray(domains) ? domains : [];\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => Promise<CatalogEntry[]>;\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which now merges\n * `skaile.yaml`'s `sources:` field into the repositories map, then stamps\n * `DOMAIN.md`-derived domain grouping onto the scanned entries via\n * `searchRepoRoots()`.\n */\nasync function sourceAssets(\n am: AssetManagerLike,\n): Promise<{ entries: OriginEntry[]; domains: CatalogDomain[] }> {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = (await am.search()).filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n const domains: CatalogDomain[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group + stamp by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n // No synthetic fallback domain — the source node already groups these, so a\n // same-named fallback would just nest the source under itself.\n domains.push(...(await stampDomains(root, sourceName, owned, false)));\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return { entries, domains };\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Local disk only, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n const rootEntries = [...(await scanRepo(root, \"skaile-factory\"))];\n domains.push(...(await stampDomains(root, \"skaile-factory\", rootEntries)));\n entries.push(...rootEntries);\n }\n return { entries, domains, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], domains, notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local disk only, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = await factoryAssets();\n const src = await sourceAssets(am);\n return {\n entries: [\n ...src.entries,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n // Store domains first (server-curated), then the on-disk feeds; dedupe by\n // slug, first-wins, so a store-served domain shadows a same-slug local one.\n domains: dedupeBySlug([...store.domains, ...src.domains, ...libs.domains, ...factory.domains]),\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n\n/** First-wins dedupe of a domain list by `slug`. */\nfunction dedupeBySlug(domains: CatalogDomain[]): CatalogDomain[] {\n const seen = new Set<string>();\n const out: CatalogDomain[] = [];\n for (const d of domains) {\n if (seen.has(d.slug)) continue;\n seen.add(d.slug);\n out.push(d);\n }\n return out;\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { WORKSPACE_MOUNT_ENV_VAR, deployAll, deployCatalogEntry, findAiAssetsRoot, isUnderWorkspaceMount, resolveFlowSkills, undeployCatalogEntry, workspaceMountDirs } from '../chunk-7BUZQVRR.js';
|
|
2
|
-
import '../chunk-
|
|
2
|
+
import '../chunk-H662SXKS.js';
|
|
3
3
|
import '../chunk-F3HNW354.js';
|
|
4
4
|
import '../chunk-K5GBV4SA.js';
|
|
5
5
|
import '../chunk-QVZA2MDT.js';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-DCG4UWJM.js';
|
|
7
|
+
import '../chunk-RPVTPVGX.js';
|
|
8
8
|
import '../chunk-MENCWIHW.js';
|
|
9
9
|
import '../chunk-P4VHQA4N.js';
|
|
10
10
|
import '../chunk-MKZOK4JU.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, softDepName } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, softDepName } from '../chunk-YLSMYOHN.js';
|
|
2
|
+
import '../chunk-QG2ZXU5W.js';
|
|
3
3
|
import '../chunk-DZ4UZOFB.js';
|
|
4
4
|
import '../chunk-UKJMQZV6.js';
|
|
5
5
|
import '../chunk-R7FOF242.js';
|
|
6
6
|
import '../chunk-JXT46QFC.js';
|
|
7
|
-
export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-
|
|
7
|
+
export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-S635WMXH.js';
|
|
8
8
|
export { BUILT_IN_FRAGMENTS, loadPromptExtensions, resolveFragments } from '../chunk-CGYEHQOX.js';
|
|
9
|
-
import '../chunk-
|
|
9
|
+
import '../chunk-H662SXKS.js';
|
|
10
10
|
import '../chunk-F3HNW354.js';
|
|
11
11
|
import '../chunk-K5GBV4SA.js';
|
|
12
12
|
import '../chunk-QVZA2MDT.js';
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-DCG4UWJM.js';
|
|
14
|
+
import '../chunk-RPVTPVGX.js';
|
|
15
15
|
import '../chunk-MENCWIHW.js';
|
|
16
16
|
import '../chunk-P4VHQA4N.js';
|
|
17
17
|
import '../chunk-MKZOK4JU.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { createScaffold, deployAll, deployAsset, removeAsset } from '../chunk-
|
|
1
|
+
export { createScaffold, deployAll, deployAsset, removeAsset } from '../chunk-S635WMXH.js';
|
|
2
2
|
import '../chunk-CGYEHQOX.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-H662SXKS.js';
|
|
4
4
|
import '../chunk-F3HNW354.js';
|
|
5
5
|
import '../chunk-K5GBV4SA.js';
|
|
6
6
|
import '../chunk-QVZA2MDT.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-DCG4UWJM.js';
|
|
8
|
+
import '../chunk-RPVTPVGX.js';
|
|
9
9
|
import '../chunk-MENCWIHW.js';
|
|
10
10
|
import '../chunk-P4VHQA4N.js';
|
|
11
11
|
import '../chunk-MKZOK4JU.js';
|
|
@@ -1,206 +1,5 @@
|
|
|
1
|
+
export { CodexAppServerClient, CodexAppServerError } from '../chunk-PHBYB4XT.js';
|
|
2
|
+
import '../chunk-LOO5CB5M.js';
|
|
1
3
|
import '../chunk-NSBPE2FW.js';
|
|
2
|
-
import { spawn } from 'child_process';
|
|
3
|
-
|
|
4
|
-
var CodexAppServerError = class extends Error {
|
|
5
|
-
constructor(code) {
|
|
6
|
-
super(`Codex App Server ${code}`);
|
|
7
|
-
this.code = code;
|
|
8
|
-
this.name = "CodexAppServerError";
|
|
9
|
-
}
|
|
10
|
-
code;
|
|
11
|
-
};
|
|
12
|
-
var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
13
|
-
var validId = (value) => typeof value === "string" || typeof value === "number" && Number.isSafeInteger(value);
|
|
14
|
-
function bound(value, fallback, maximum) {
|
|
15
|
-
const result = value ?? fallback;
|
|
16
|
-
if (!Number.isSafeInteger(result) || result <= 0 || result > maximum)
|
|
17
|
-
throw new CodexAppServerError("protocol");
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
var CodexAppServerClient = class _CodexAppServerClient {
|
|
21
|
-
constructor(options) {
|
|
22
|
-
this.options = options;
|
|
23
|
-
this.timeout = bound(options.requestTimeoutMs, 15e3, 3e5);
|
|
24
|
-
this.callbackTimeout = bound(options.serverRequestTimeoutMs, 3e4, 3e5);
|
|
25
|
-
this.capacity = bound(options.maxPendingRequests, 64, 1024);
|
|
26
|
-
this.frameLimit = bound(options.maxFrameBytes, 1024 * 1024, 16 * 1024 * 1024);
|
|
27
|
-
this.child = spawn(options.command, options.args, {
|
|
28
|
-
cwd: options.cwd,
|
|
29
|
-
env: options.env,
|
|
30
|
-
stdio: "pipe"
|
|
31
|
-
});
|
|
32
|
-
this.closed = new Promise((resolve) => this.child.once("close", () => resolve()));
|
|
33
|
-
this.child.stdout.setEncoding("utf8");
|
|
34
|
-
this.child.stdout.on("data", (chunk) => this.receive(chunk));
|
|
35
|
-
this.child.stderr.resume();
|
|
36
|
-
this.child.on("error", () => this.fail("process"));
|
|
37
|
-
this.child.stdin.on("error", () => this.fail("process"));
|
|
38
|
-
this.child.stdout.on("error", () => this.fail("process"));
|
|
39
|
-
this.child.stderr.on("error", () => this.fail("process"));
|
|
40
|
-
this.child.once("exit", () => this.fail("process"));
|
|
41
|
-
}
|
|
42
|
-
options;
|
|
43
|
-
pending = /* @__PURE__ */ new Map();
|
|
44
|
-
callbacks = /* @__PURE__ */ new Map();
|
|
45
|
-
timeout;
|
|
46
|
-
callbackTimeout;
|
|
47
|
-
capacity;
|
|
48
|
-
frameLimit;
|
|
49
|
-
child;
|
|
50
|
-
closed;
|
|
51
|
-
terminal = false;
|
|
52
|
-
nextId = 1;
|
|
53
|
-
buffer = "";
|
|
54
|
-
/** Spawn and finish the native initialize/initialized handshake before returning. */
|
|
55
|
-
static async connect(options) {
|
|
56
|
-
let client;
|
|
57
|
-
try {
|
|
58
|
-
client = new _CodexAppServerClient(options);
|
|
59
|
-
await client.request("initialize", {
|
|
60
|
-
clientInfo: options.clientInfo,
|
|
61
|
-
capabilities: { experimentalApi: true }
|
|
62
|
-
});
|
|
63
|
-
client.write({ method: "initialized" });
|
|
64
|
-
return client;
|
|
65
|
-
} catch (error) {
|
|
66
|
-
await client?.dispose();
|
|
67
|
-
throw error instanceof CodexAppServerError ? error : new CodexAppServerError("process");
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/** Timeout closes this generation, so late replies can never satisfy a later request. */
|
|
71
|
-
request(method, params) {
|
|
72
|
-
if (this.terminal) return Promise.reject(new CodexAppServerError("closed"));
|
|
73
|
-
if (this.pending.size >= this.capacity)
|
|
74
|
-
return Promise.reject(new CodexAppServerError("capacity"));
|
|
75
|
-
const id = this.nextId++;
|
|
76
|
-
return new Promise((resolve, reject) => {
|
|
77
|
-
const timer = setTimeout(() => this.fail("timeout"), this.timeout);
|
|
78
|
-
this.pending.set(id, { resolve, reject, timer });
|
|
79
|
-
try {
|
|
80
|
-
this.write({ id, method, params });
|
|
81
|
-
} catch {
|
|
82
|
-
this.fail("protocol");
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
/** Reject pending work immediately and wait a bounded interval for process shutdown. */
|
|
87
|
-
async dispose() {
|
|
88
|
-
this.fail("closed");
|
|
89
|
-
let timer;
|
|
90
|
-
await Promise.race([
|
|
91
|
-
this.closed,
|
|
92
|
-
new Promise((resolve) => {
|
|
93
|
-
timer = setTimeout(resolve, 1e3);
|
|
94
|
-
})
|
|
95
|
-
]);
|
|
96
|
-
clearTimeout(timer);
|
|
97
|
-
}
|
|
98
|
-
fail(code) {
|
|
99
|
-
if (this.terminal) return;
|
|
100
|
-
this.terminal = true;
|
|
101
|
-
this.buffer = "";
|
|
102
|
-
for (const request of this.pending.values()) {
|
|
103
|
-
clearTimeout(request.timer);
|
|
104
|
-
request.reject(new CodexAppServerError(code));
|
|
105
|
-
}
|
|
106
|
-
this.pending.clear();
|
|
107
|
-
for (const controller of this.callbacks.values()) controller.abort();
|
|
108
|
-
this.callbacks.clear();
|
|
109
|
-
this.child.kill("SIGKILL");
|
|
110
|
-
try {
|
|
111
|
-
this.options.onClose?.(new CodexAppServerError(code));
|
|
112
|
-
} catch {
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
write(frame) {
|
|
116
|
-
if (this.terminal) throw new CodexAppServerError("closed");
|
|
117
|
-
const line = `${JSON.stringify(frame)}
|
|
118
|
-
`;
|
|
119
|
-
if (Buffer.byteLength(line) > this.frameLimit) throw new CodexAppServerError("protocol");
|
|
120
|
-
this.child.stdin.write(line);
|
|
121
|
-
}
|
|
122
|
-
receive(chunk) {
|
|
123
|
-
if (this.terminal) return;
|
|
124
|
-
this.buffer += chunk;
|
|
125
|
-
try {
|
|
126
|
-
for (; ; ) {
|
|
127
|
-
const end = this.buffer.indexOf("\n");
|
|
128
|
-
if (end < 0) break;
|
|
129
|
-
const line = this.buffer.slice(0, end);
|
|
130
|
-
this.buffer = this.buffer.slice(end + 1);
|
|
131
|
-
if (Buffer.byteLength(line) > this.frameLimit) throw new CodexAppServerError("protocol");
|
|
132
|
-
if (!line.trim()) continue;
|
|
133
|
-
const frame = JSON.parse(line);
|
|
134
|
-
if (!record(frame)) throw new CodexAppServerError("protocol");
|
|
135
|
-
if (typeof frame.method === "string") {
|
|
136
|
-
if ("id" in frame) {
|
|
137
|
-
if (!validId(frame.id)) throw new CodexAppServerError("protocol");
|
|
138
|
-
void this.handleServerRequest(frame.id, frame.method, frame.params);
|
|
139
|
-
} else this.options.onNotification?.(frame.method, frame.params);
|
|
140
|
-
} else {
|
|
141
|
-
if (typeof frame.id !== "number" || !Number.isSafeInteger(frame.id) || "error" in frame === "result" in frame)
|
|
142
|
-
throw new CodexAppServerError("protocol");
|
|
143
|
-
const request = this.pending.get(frame.id);
|
|
144
|
-
if (!request) throw new CodexAppServerError("protocol");
|
|
145
|
-
clearTimeout(request.timer);
|
|
146
|
-
this.pending.delete(frame.id);
|
|
147
|
-
if ("error" in frame) request.reject(new CodexAppServerError("rejected"));
|
|
148
|
-
else request.resolve(frame.result);
|
|
149
|
-
}
|
|
150
|
-
if (this.terminal) return;
|
|
151
|
-
}
|
|
152
|
-
if (Buffer.byteLength(this.buffer) > this.frameLimit)
|
|
153
|
-
throw new CodexAppServerError("protocol");
|
|
154
|
-
} catch {
|
|
155
|
-
this.fail("protocol");
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
async handleServerRequest(id, method, params) {
|
|
159
|
-
if (this.callbacks.has(id) || this.callbacks.size >= this.capacity)
|
|
160
|
-
return this.fail("protocol");
|
|
161
|
-
const controller = new AbortController();
|
|
162
|
-
this.callbacks.set(id, controller);
|
|
163
|
-
let timer;
|
|
164
|
-
try {
|
|
165
|
-
const handler = Object.hasOwn(this.options.onServerRequest ?? {}, method) ? this.options.onServerRequest?.[method] : void 0;
|
|
166
|
-
if (!handler) throw new CodexAppServerError("rejected");
|
|
167
|
-
const result = await Promise.race([
|
|
168
|
-
Promise.resolve().then(() => {
|
|
169
|
-
if (this.terminal || controller.signal.aborted) throw new CodexAppServerError("closed");
|
|
170
|
-
return handler(
|
|
171
|
-
params,
|
|
172
|
-
controller.signal
|
|
173
|
-
);
|
|
174
|
-
}),
|
|
175
|
-
new Promise((_, reject) => {
|
|
176
|
-
controller.signal.addEventListener(
|
|
177
|
-
"abort",
|
|
178
|
-
() => reject(new CodexAppServerError("closed")),
|
|
179
|
-
{ once: true }
|
|
180
|
-
);
|
|
181
|
-
timer = setTimeout(() => {
|
|
182
|
-
controller.abort();
|
|
183
|
-
reject(new CodexAppServerError("timeout"));
|
|
184
|
-
}, this.callbackTimeout);
|
|
185
|
-
})
|
|
186
|
-
]);
|
|
187
|
-
this.write({ id, result });
|
|
188
|
-
} catch {
|
|
189
|
-
if (!this.terminal) {
|
|
190
|
-
try {
|
|
191
|
-
this.write({ id, error: { code: -32603, message: "Codex client request failed" } });
|
|
192
|
-
} catch {
|
|
193
|
-
this.fail("protocol");
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
} finally {
|
|
197
|
-
clearTimeout(timer);
|
|
198
|
-
controller.abort();
|
|
199
|
-
this.callbacks.delete(id);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
export { CodexAppServerClient, CodexAppServerError };
|
|
205
4
|
//# sourceMappingURL=codex-app-server.js.map
|
|
206
5
|
//# sourceMappingURL=codex-app-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../bridge/src/codex-app-server.ts"],"names":[],"mappings":";;;AA6BO,IAAM,mBAAA,GAAN,c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F,UAAA,OAAQ,OAAA;AAAA,YACN,MAAA;AAAA,YACA,UAAA,CAAW;AAAA,WACb;AAAA,QACF,CAAC,CAAA;AAAA,QACD,IAAI,OAAA,CAAe,CAAC,CAAA,EAAG,MAAA,KAAW;AAChC,UAAA,UAAA,CAAW,MAAA,CAAO,gBAAA;AAAA,YAChB,OAAA;AAAA,YACA,MAAM,MAAA,CAAO,IAAI,mBAAA,CAAoB,QAAQ,CAAC,CAAA;AAAA,YAC9C,EAAE,MAAM,IAAA;AAAK,WACf;AACA,UAAA,KAAA,GAAQ,WAAW,MAAM;AACvB,YAAA,UAAA,CAAW,KAAA,EAAM;AACjB,YAAA,MAAA,CAAO,IAAI,mBAAA,CAAoB,SAAS,CAAC,CAAA;AAAA,UAC3C,CAAA,EAAG,KAAK,eAAe,CAAA;AAAA,QACzB,CAAC;AAAA,OACF,CAAA;AACD,MAAA,IAAA,CAAK,KAAA,CAAM,EAAE,EAAA,EAAI,MAAA,EAAQ,CAAA;AAAA,IAC3B,CAAA,CAAA,MAAQ;AACN,MAAA,IAAI,CAAC,KAAK,QAAA,EAAU;AAClB,QAAA,IAAI;AACF,UAAA,IAAA,CAAK,KAAA,CAAM,EAAE,EAAA,EAAI,KAAA,EAAO,EAAE,MAAM,CAAA,KAAA,EAAQ,OAAA,EAAS,6BAAA,EAA8B,EAAG,CAAA;AAAA,QACpF,CAAA,CAAA,MAAQ;AACN,UAAA,IAAA,CAAK,KAAK,UAAU,CAAA;AAAA,QACtB;AAAA,MACF;AAAA,IACF,CAAA,SAAE;AACA,MAAA,YAAA,CAAa,KAAK,CAAA;AAClB,MAAA,UAAA,CAAW,KAAA,EAAM;AACjB,MAAA,IAAA,CAAK,SAAA,CAAU,OAAO,EAAE,CAAA;AAAA,IAC1B;AAAA,EACF;AACF","file":"codex-app-server.js","sourcesContent":["import { spawn, type ChildProcessWithoutNullStreams } from \"node:child_process\";\nimport type { NativeRequests, NativeServerRequests } from \"./codex/native-protocol.generated.js\";\n\n/** The retained native request types, exposed only through this client surface. */\nexport type CodexRequestMethod = keyof NativeRequests;\n/** Native callback handlers receive cancellation when their process is disposed. */\nexport type CodexServerRequestHandlers = {\n [M in keyof NativeServerRequests]?: (\n params: NativeServerRequests[M][\"params\"],\n signal: AbortSignal,\n ) => Promise<NativeServerRequests[M][\"result\"]>;\n};\n/** Explicit process inputs keep managed callers from inheriting ambient credentials. */\nexport interface CodexAppServerOptions {\n command: string;\n args: string[];\n cwd: string;\n env: Record<string, string>;\n clientInfo: NativeRequests[\"initialize\"][\"params\"][\"clientInfo\"];\n requestTimeoutMs?: number;\n serverRequestTimeoutMs?: number;\n maxPendingRequests?: number;\n maxFrameBytes?: number;\n onServerRequest?: CodexServerRequestHandlers;\n onNotification?: (method: string, params: unknown) => void;\n /** Exactly once on terminal failure or disposal, even with no RPC pending. */\n onClose?: (error: CodexAppServerError) => void;\n}\n/** Safe error codes never contain stderr, native errors, RPC payloads or credentials. */\nexport class CodexAppServerError extends Error {\n constructor(\n readonly code: \"closed\" | \"process\" | \"protocol\" | \"timeout\" | \"rejected\" | \"capacity\",\n ) {\n super(`Codex App Server ${code}`);\n this.name = \"CodexAppServerError\";\n }\n}\ntype Pending = {\n resolve: (value: unknown) => void;\n reject: (error: CodexAppServerError) => void;\n timer: ReturnType<typeof setTimeout>;\n};\nconst record = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === \"object\" && !Array.isArray(value);\nconst validId = (value: unknown): value is string | number =>\n typeof value === \"string\" || (typeof value === \"number\" && Number.isSafeInteger(value));\nfunction bound(value: number | undefined, fallback: number, maximum: number): number {\n const result = value ?? fallback;\n if (!Number.isSafeInteger(result) || result <= 0 || result > maximum)\n throw new CodexAppServerError(\"protocol\");\n return result;\n}\n\n/** One initialized stdio process with correlated, bounded requests and terminal disposal. */\nexport class CodexAppServerClient {\n private readonly pending = new Map<number, Pending>();\n private readonly callbacks = new Map<string | number, AbortController>();\n private readonly timeout: number;\n private readonly callbackTimeout: number;\n private readonly capacity: number;\n private readonly frameLimit: number;\n private readonly child: ChildProcessWithoutNullStreams;\n private readonly closed: Promise<void>;\n private terminal = false;\n private nextId = 1;\n private buffer = \"\";\n\n private constructor(private readonly options: CodexAppServerOptions) {\n this.timeout = bound(options.requestTimeoutMs, 15_000, 300_000);\n this.callbackTimeout = bound(options.serverRequestTimeoutMs, 30_000, 300_000);\n this.capacity = bound(options.maxPendingRequests, 64, 1024);\n this.frameLimit = bound(options.maxFrameBytes, 1024 * 1024, 16 * 1024 * 1024);\n this.child = spawn(options.command, options.args, {\n cwd: options.cwd,\n env: options.env,\n stdio: \"pipe\",\n });\n this.closed = new Promise((resolve) => this.child.once(\"close\", () => resolve()));\n this.child.stdout.setEncoding(\"utf8\");\n this.child.stdout.on(\"data\", (chunk: string) => this.receive(chunk));\n // Drain without retaining raw diagnostic output: native stderr can contain secrets.\n this.child.stderr.resume();\n this.child.on(\"error\", () => this.fail(\"process\"));\n this.child.stdin.on(\"error\", () => this.fail(\"process\"));\n this.child.stdout.on(\"error\", () => this.fail(\"process\"));\n this.child.stderr.on(\"error\", () => this.fail(\"process\"));\n this.child.once(\"exit\", () => this.fail(\"process\"));\n }\n\n /** Spawn and finish the native initialize/initialized handshake before returning. */\n static async connect(options: CodexAppServerOptions): Promise<CodexAppServerClient> {\n let client: CodexAppServerClient | undefined;\n try {\n client = new CodexAppServerClient(options);\n await client.request(\"initialize\", {\n clientInfo: options.clientInfo,\n capabilities: { experimentalApi: true },\n });\n client.write({ method: \"initialized\" });\n return client;\n } catch (error) {\n await client?.dispose();\n throw error instanceof CodexAppServerError ? error : new CodexAppServerError(\"process\");\n }\n }\n\n /** Timeout closes this generation, so late replies can never satisfy a later request. */\n request<M extends CodexRequestMethod>(\n method: M,\n params: NativeRequests[M][\"params\"],\n ): Promise<NativeRequests[M][\"result\"]> {\n if (this.terminal) return Promise.reject(new CodexAppServerError(\"closed\"));\n if (this.pending.size >= this.capacity)\n return Promise.reject(new CodexAppServerError(\"capacity\"));\n const id = this.nextId++;\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => this.fail(\"timeout\"), this.timeout);\n this.pending.set(id, { resolve: resolve as (value: unknown) => void, reject, timer });\n try {\n this.write({ id, method, params });\n } catch {\n this.fail(\"protocol\");\n }\n });\n }\n\n /** Reject pending work immediately and wait a bounded interval for process shutdown. */\n async dispose(): Promise<void> {\n this.fail(\"closed\");\n let timer: ReturnType<typeof setTimeout> | undefined;\n await Promise.race([\n this.closed,\n new Promise<void>((resolve) => {\n timer = setTimeout(resolve, 1000);\n }),\n ]);\n clearTimeout(timer);\n }\n\n private fail(code: CodexAppServerError[\"code\"]): void {\n if (this.terminal) return;\n this.terminal = true;\n this.buffer = \"\";\n for (const request of this.pending.values()) {\n clearTimeout(request.timer);\n request.reject(new CodexAppServerError(code));\n }\n this.pending.clear();\n for (const controller of this.callbacks.values()) controller.abort();\n this.callbacks.clear();\n this.child.kill(\"SIGKILL\");\n try {\n this.options.onClose?.(new CodexAppServerError(code));\n } catch {\n // Observer failures cannot interrupt transport cleanup.\n }\n }\n\n private write(frame: unknown): void {\n if (this.terminal) throw new CodexAppServerError(\"closed\");\n const line = `${JSON.stringify(frame)}\\n`;\n if (Buffer.byteLength(line) > this.frameLimit) throw new CodexAppServerError(\"protocol\");\n this.child.stdin.write(line);\n }\n\n private receive(chunk: string): void {\n if (this.terminal) return;\n this.buffer += chunk;\n try {\n for (;;) {\n const end = this.buffer.indexOf(\"\\n\");\n if (end < 0) break;\n const line = this.buffer.slice(0, end);\n this.buffer = this.buffer.slice(end + 1);\n if (Buffer.byteLength(line) > this.frameLimit) throw new CodexAppServerError(\"protocol\");\n if (!line.trim()) continue;\n const frame: unknown = JSON.parse(line);\n if (!record(frame)) throw new CodexAppServerError(\"protocol\");\n if (typeof frame.method === \"string\") {\n if (\"id\" in frame) {\n if (!validId(frame.id)) throw new CodexAppServerError(\"protocol\");\n void this.handleServerRequest(frame.id, frame.method, frame.params);\n } else this.options.onNotification?.(frame.method, frame.params);\n } else {\n if (\n typeof frame.id !== \"number\" ||\n !Number.isSafeInteger(frame.id) ||\n \"error\" in frame === \"result\" in frame\n )\n throw new CodexAppServerError(\"protocol\");\n const request = this.pending.get(frame.id);\n if (!request) throw new CodexAppServerError(\"protocol\");\n clearTimeout(request.timer);\n this.pending.delete(frame.id);\n if (\"error\" in frame) request.reject(new CodexAppServerError(\"rejected\"));\n else request.resolve(frame.result);\n }\n if (this.terminal) return;\n }\n if (Buffer.byteLength(this.buffer) > this.frameLimit)\n throw new CodexAppServerError(\"protocol\");\n } catch {\n this.fail(\"protocol\");\n }\n }\n\n private async handleServerRequest(\n id: string | number,\n method: string,\n params: unknown,\n ): Promise<void> {\n if (this.callbacks.has(id) || this.callbacks.size >= this.capacity)\n return this.fail(\"protocol\");\n const controller = new AbortController();\n this.callbacks.set(id, controller);\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n const handler = Object.hasOwn(this.options.onServerRequest ?? {}, method)\n ? this.options.onServerRequest?.[method as keyof NativeServerRequests]\n : undefined;\n if (!handler) throw new CodexAppServerError(\"rejected\");\n const result = await Promise.race([\n Promise.resolve().then(() => {\n if (this.terminal || controller.signal.aborted) throw new CodexAppServerError(\"closed\");\n return (handler as (params: unknown, signal: AbortSignal) => Promise<unknown>)(\n params,\n controller.signal,\n );\n }),\n new Promise<never>((_, reject) => {\n controller.signal.addEventListener(\n \"abort\",\n () => reject(new CodexAppServerError(\"closed\")),\n { once: true },\n );\n timer = setTimeout(() => {\n controller.abort();\n reject(new CodexAppServerError(\"timeout\"));\n }, this.callbackTimeout);\n }),\n ]);\n this.write({ id, result });\n } catch {\n if (!this.terminal) {\n try {\n this.write({ id, error: { code: -32603, message: \"Codex client request failed\" } });\n } catch {\n this.fail(\"protocol\");\n }\n }\n } finally {\n clearTimeout(timer);\n controller.abort();\n this.callbacks.delete(id);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"codex-app-server.js"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { scrubPoisonedTranscript, resolveClaudeConfigDir, SUPPORTED_CLOUDS, buildClaudeCloudEnv } from '../../chunk-3NCGSSCU.js';
|
|
2
|
-
import { dispatchCapability } from '../../chunk-
|
|
2
|
+
import { dispatchCapability } from '../../chunk-7ZO3MUP3.js';
|
|
3
3
|
import { fetchProviderModels } from '../../chunk-GURXUF2J.js';
|
|
4
4
|
import { AuthError, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable, AccountUnavailableError } from '../../chunk-GAH4YRCI.js';
|
|
5
|
-
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-
|
|
5
|
+
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-KB2GC6YY.js';
|
|
6
6
|
import '../../chunk-6E6PKKAD.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-H662SXKS.js';
|
|
8
8
|
import '../../chunk-F3HNW354.js';
|
|
9
9
|
import '../../chunk-K5GBV4SA.js';
|
|
10
10
|
import '../../chunk-QVZA2MDT.js';
|
|
11
|
-
import '../../chunk-
|
|
12
|
-
import '../../chunk-
|
|
11
|
+
import '../../chunk-DCG4UWJM.js';
|
|
12
|
+
import '../../chunk-RPVTPVGX.js';
|
|
13
13
|
import '../../chunk-MENCWIHW.js';
|
|
14
14
|
import '../../chunk-P4VHQA4N.js';
|
|
15
15
|
import '../../chunk-MKZOK4JU.js';
|