@explyt/ai-agent 0.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -0
- package/README.md +24 -0
- package/THIRD-PARTY-NOTICES.md +321 -0
- package/dist/acp/index.js +62 -0
- package/dist/cli/engine.js +377 -0
- package/dist/cli/index.js +315 -0
- package/dist/extensions/hello.js +1 -0
- package/dist/extensions/policy.js +1 -0
- package/dist/extensions/tool-gradle.js +1 -0
- package/dist/extensions/usage.js +1 -0
- package/node_modules/@modelcontextprotocol/client/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/client/README.md +26 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-1b6pVpkg.cjs +7531 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-1b6pVpkg.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs +7514 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-INpkxUi1.d.mts +1071 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-INpkxUi1.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3ZJEoRM.d.mts +74 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3ZJEoRM.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3dvjU3F.cjs +986 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3dvjU3F.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-BylNJ1R5.mjs +981 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-BylNJ1R5.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Br0eD_fh.mjs +42 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BGO_ZrYF.cjs +46 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BGO_ZrYF.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs +34 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts +2526 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts +2523 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs +5690 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +3252 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +3252 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs +5481 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs +14 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs +14 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +21 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +20 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs +7063 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs +7431 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +217 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +96 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +96 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +212 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts +1099 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-mS0yxCL0.d.mts +1099 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-mS0yxCL0.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.cjs +5 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.mjs +3 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.cjs +3 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.mjs +3 -0
- package/node_modules/@modelcontextprotocol/client/package.json +166 -0
- package/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/core/README.md +40 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +1678 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +2899 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/package.json +85 -0
- package/node_modules/@modelcontextprotocol/ext-apps/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/ext-apps/README.md +259 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/docs/patterns.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.d.ts +1320 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js +39 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-with-deps.js +78 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.d.ts +1449 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js +39 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/events.d.ts +130 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.d.ts +1041 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.json +6090 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.test.d.ts +41 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.d.ts +127 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.d.ts +37 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.js +39 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/react-with-deps.js +78 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useApp.d.ts +115 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useApp.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useAutoResize.d.ts +54 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useAutoResize.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useDocumentTheme.d.ts +44 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useDocumentTheme.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useHostStyles.d.ts +113 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useHostStyles.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.d.ts +361 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js +39 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/spec.types.d.ts +698 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/standard-schema.d.ts +35 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/styles.d.ts +184 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/styles.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/types.d.ts +43 -0
- package/node_modules/@modelcontextprotocol/ext-apps/package.json +133 -0
- package/node_modules/@napi-rs/keyring/LICENSE +21 -0
- package/node_modules/@napi-rs/keyring/README.md +19 -0
- package/node_modules/@napi-rs/keyring/index.d.ts +166 -0
- package/node_modules/@napi-rs/keyring/index.js +514 -0
- package/node_modules/@napi-rs/keyring/keytar.d.ts +53 -0
- package/node_modules/@napi-rs/keyring/keytar.js +26 -0
- package/node_modules/@napi-rs/keyring/package.json +125 -0
- package/node_modules/@pkgr/core/lib/constants.d.ts +3 -0
- package/node_modules/@pkgr/core/lib/constants.js +5 -0
- package/node_modules/@pkgr/core/lib/constants.js.map +1 -0
- package/node_modules/@pkgr/core/lib/helpers.d.ts +5 -0
- package/node_modules/@pkgr/core/lib/helpers.js +51 -0
- package/node_modules/@pkgr/core/lib/helpers.js.map +1 -0
- package/node_modules/@pkgr/core/lib/index.cjs +66 -0
- package/node_modules/@pkgr/core/lib/index.d.ts +2 -0
- package/node_modules/@pkgr/core/lib/index.js +3 -0
- package/node_modules/@pkgr/core/lib/index.js.map +1 -0
- package/node_modules/@pkgr/core/package.json +29 -0
- package/node_modules/@standard-schema/spec/LICENSE +21 -0
- package/node_modules/@standard-schema/spec/README.md +198 -0
- package/node_modules/@standard-schema/spec/dist/index.cjs +18 -0
- package/node_modules/@standard-schema/spec/dist/index.d.cts +119 -0
- package/node_modules/@standard-schema/spec/dist/index.d.ts +119 -0
- package/node_modules/@standard-schema/spec/dist/index.js +0 -0
- package/node_modules/@standard-schema/spec/package.json +52 -0
- package/node_modules/ajv/.runkit_example.js +23 -0
- package/node_modules/ajv/LICENSE +22 -0
- package/node_modules/ajv/README.md +207 -0
- package/node_modules/ajv/dist/2019.d.ts +19 -0
- package/node_modules/ajv/dist/2019.js +61 -0
- package/node_modules/ajv/dist/2019.js.map +1 -0
- package/node_modules/ajv/dist/2020.d.ts +19 -0
- package/node_modules/ajv/dist/2020.js +55 -0
- package/node_modules/ajv/dist/2020.js.map +1 -0
- package/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/node_modules/ajv/dist/ajv.js +50 -0
- package/node_modules/ajv/dist/ajv.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/node_modules/ajv/dist/compile/errors.js +123 -0
- package/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/node_modules/ajv/dist/compile/index.js +242 -0
- package/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js +236 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/node_modules/ajv/dist/compile/names.js +28 -0
- package/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/node_modules/ajv/dist/compile/rules.js +26 -0
- package/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/node_modules/ajv/dist/compile/util.js +178 -0
- package/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/node_modules/ajv/dist/core.d.ts +174 -0
- package/node_modules/ajv/dist/core.js +618 -0
- package/node_modules/ajv/dist/core.js.map +1 -0
- package/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/node_modules/ajv/dist/jtd.js +72 -0
- package/node_modules/ajv/dist/jtd.js.map +1 -0
- package/node_modules/ajv/dist/refs/data.json +13 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/node_modules/ajv/dist/standalone/index.js +90 -0
- package/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/node_modules/ajv/dist/types/index.js +3 -0
- package/node_modules/ajv/dist/types/index.js.map +1 -0
- package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/node_modules/ajv/lib/2019.ts +81 -0
- package/node_modules/ajv/lib/2020.ts +75 -0
- package/node_modules/ajv/lib/ajv.ts +70 -0
- package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/node_modules/ajv/lib/compile/index.ts +324 -0
- package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/node_modules/ajv/lib/compile/jtd/serialize.ts +277 -0
- package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/node_modules/ajv/lib/compile/names.ts +27 -0
- package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/node_modules/ajv/lib/compile/util.ts +213 -0
- package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/node_modules/ajv/lib/core.ts +892 -0
- package/node_modules/ajv/lib/jtd.ts +132 -0
- package/node_modules/ajv/lib/refs/data.json +13 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/node_modules/ajv/lib/types/index.ts +244 -0
- package/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +39 -0
- package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/node_modules/ajv/package.json +126 -0
- package/node_modules/ajv-formats/LICENSE +21 -0
- package/node_modules/ajv-formats/README.md +125 -0
- package/node_modules/ajv-formats/dist/formats.d.ts +9 -0
- package/node_modules/ajv-formats/dist/formats.js +208 -0
- package/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/node_modules/ajv-formats/dist/index.d.ts +15 -0
- package/node_modules/ajv-formats/dist/index.js +37 -0
- package/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/node_modules/ajv-formats/dist/limit.d.ts +10 -0
- package/node_modules/ajv-formats/dist/limit.js +69 -0
- package/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/node_modules/ajv-formats/package.json +74 -0
- package/node_modules/ajv-formats/src/formats.ts +269 -0
- package/node_modules/ajv-formats/src/index.ts +62 -0
- package/node_modules/ajv-formats/src/limit.ts +99 -0
- package/node_modules/bundle-name/index.js +5 -0
- package/node_modules/bundle-name/license +9 -0
- package/node_modules/bundle-name/package.json +45 -0
- package/node_modules/bundle-name/readme.md +23 -0
- package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/cross-spawn/README.md +89 -0
- package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/cross-spawn/lib/parse.js +91 -0
- package/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/node_modules/cross-spawn/package.json +73 -0
- package/node_modules/default-browser/index.d.ts +29 -0
- package/node_modules/default-browser/index.js +34 -0
- package/node_modules/default-browser/license +9 -0
- package/node_modules/default-browser/package.json +54 -0
- package/node_modules/default-browser/readme.md +24 -0
- package/node_modules/default-browser/windows.js +57 -0
- package/node_modules/default-browser-id/index.js +25 -0
- package/node_modules/default-browser-id/license +9 -0
- package/node_modules/default-browser-id/package.json +41 -0
- package/node_modules/default-browser-id/readme.md +19 -0
- package/node_modules/define-lazy-prop/index.d.ts +31 -0
- package/node_modules/define-lazy-prop/index.js +18 -0
- package/node_modules/define-lazy-prop/license +9 -0
- package/node_modules/define-lazy-prop/package.json +51 -0
- package/node_modules/define-lazy-prop/readme.md +55 -0
- package/node_modules/eventsource/LICENSE +22 -0
- package/node_modules/eventsource/README.md +167 -0
- package/node_modules/eventsource/dist/index.cjs +273 -0
- package/node_modules/eventsource/dist/index.cjs.map +1 -0
- package/node_modules/eventsource/dist/index.d.cts +332 -0
- package/node_modules/eventsource/dist/index.d.ts +332 -0
- package/node_modules/eventsource/dist/index.js +273 -0
- package/node_modules/eventsource/dist/index.js.map +1 -0
- package/node_modules/eventsource/package.json +130 -0
- package/node_modules/eventsource/src/EventSource.ts +596 -0
- package/node_modules/eventsource/src/errors.ts +141 -0
- package/node_modules/eventsource/src/index.ts +3 -0
- package/node_modules/eventsource/src/types.ts +152 -0
- package/node_modules/eventsource-parser/LICENSE +21 -0
- package/node_modules/eventsource-parser/README.md +157 -0
- package/node_modules/eventsource-parser/dist/index.cjs +177 -0
- package/node_modules/eventsource-parser/dist/index.cjs.map +1 -0
- package/node_modules/eventsource-parser/dist/index.d.cts +169 -0
- package/node_modules/eventsource-parser/dist/index.d.ts +169 -0
- package/node_modules/eventsource-parser/dist/index.js +177 -0
- package/node_modules/eventsource-parser/dist/index.js.map +1 -0
- package/node_modules/eventsource-parser/dist/stream.cjs +29 -0
- package/node_modules/eventsource-parser/dist/stream.cjs.map +1 -0
- package/node_modules/eventsource-parser/dist/stream.d.cts +134 -0
- package/node_modules/eventsource-parser/dist/stream.d.ts +134 -0
- package/node_modules/eventsource-parser/dist/stream.js +30 -0
- package/node_modules/eventsource-parser/dist/stream.js.map +1 -0
- package/node_modules/eventsource-parser/package.json +92 -0
- package/node_modules/eventsource-parser/src/errors.ts +44 -0
- package/node_modules/eventsource-parser/src/index.ts +8 -0
- package/node_modules/eventsource-parser/src/parse.ts +439 -0
- package/node_modules/eventsource-parser/src/stream.ts +107 -0
- package/node_modules/eventsource-parser/src/types.ts +122 -0
- package/node_modules/eventsource-parser/stream.js +2 -0
- package/node_modules/fast-deep-equal/LICENSE +21 -0
- package/node_modules/fast-deep-equal/README.md +96 -0
- package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/react.js +79 -0
- package/node_modules/fast-deep-equal/index.d.ts +4 -0
- package/node_modules/fast-deep-equal/index.js +46 -0
- package/node_modules/fast-deep-equal/package.json +61 -0
- package/node_modules/fast-deep-equal/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/react.js +53 -0
- package/node_modules/fast-uri/.gitattributes +2 -0
- package/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/node_modules/fast-uri/.github/workflows/ci.yml +106 -0
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
- package/node_modules/fast-uri/LICENSE +30 -0
- package/node_modules/fast-uri/README.md +152 -0
- package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/node_modules/fast-uri/benchmark/package.json +17 -0
- package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/node_modules/fast-uri/eslint.config.js +6 -0
- package/node_modules/fast-uri/index.js +459 -0
- package/node_modules/fast-uri/lib/schemes.js +267 -0
- package/node_modules/fast-uri/lib/utils.js +443 -0
- package/node_modules/fast-uri/package.json +68 -0
- package/node_modules/fast-uri/test/ajv.test.js +43 -0
- package/node_modules/fast-uri/test/equal.test.js +117 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/node_modules/fast-uri/test/parse.test.js +323 -0
- package/node_modules/fast-uri/test/resolve.test.js +87 -0
- package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +39 -0
- package/node_modules/fast-uri/test/security.test.js +359 -0
- package/node_modules/fast-uri/test/serialize.test.js +151 -0
- package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/node_modules/fast-uri/test/uri-js.test.js +912 -0
- package/node_modules/fast-uri/test/util.test.js +38 -0
- package/node_modules/fast-uri/tsconfig.json +9 -0
- package/node_modules/fast-uri/types/index.d.ts +60 -0
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/is-docker/cli.js +5 -0
- package/node_modules/is-docker/index.d.ts +13 -0
- package/node_modules/is-docker/index.js +29 -0
- package/node_modules/is-docker/license +9 -0
- package/node_modules/is-docker/package.json +44 -0
- package/node_modules/is-docker/readme.md +27 -0
- package/node_modules/is-inside-container/cli.js +5 -0
- package/node_modules/is-inside-container/index.d.ts +13 -0
- package/node_modules/is-inside-container/index.js +23 -0
- package/node_modules/is-inside-container/license +9 -0
- package/node_modules/is-inside-container/package.json +51 -0
- package/node_modules/is-inside-container/readme.md +36 -0
- package/node_modules/is-wsl/index.d.ts +15 -0
- package/node_modules/is-wsl/index.js +36 -0
- package/node_modules/is-wsl/license +9 -0
- package/node_modules/is-wsl/package.json +58 -0
- package/node_modules/is-wsl/readme.md +21 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +31 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/jiti/LICENSE +21 -0
- package/node_modules/jiti/README.md +258 -0
- package/node_modules/jiti/dist/babel.cjs +257 -0
- package/node_modules/jiti/dist/jiti.cjs +1 -0
- package/node_modules/jiti/lib/jiti-cli.mjs +34 -0
- package/node_modules/jiti/lib/jiti-hooks.mjs +124 -0
- package/node_modules/jiti/lib/jiti-native.mjs +121 -0
- package/node_modules/jiti/lib/jiti-register.d.mts +1 -0
- package/node_modules/jiti/lib/jiti-register.mjs +4 -0
- package/node_modules/jiti/lib/jiti-static.mjs +23 -0
- package/node_modules/jiti/lib/jiti.cjs +30 -0
- package/node_modules/jiti/lib/jiti.d.cts +8 -0
- package/node_modules/jiti/lib/jiti.d.mts +8 -0
- package/node_modules/jiti/lib/jiti.mjs +29 -0
- package/node_modules/jiti/lib/types.d.ts +420 -0
- package/node_modules/jiti/package.json +146 -0
- package/node_modules/jose/LICENSE.md +21 -0
- package/node_modules/jose/README.md +150 -0
- package/node_modules/jose/dist/types/index.d.ts +56 -0
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +37 -0
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +53 -0
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +37 -0
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +71 -0
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +43 -0
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +73 -0
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +13 -0
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +17 -0
- package/node_modules/jose/dist/types/jwks/local.d.ts +20 -0
- package/node_modules/jose/dist/types/jwks/remote.d.ts +106 -0
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +25 -0
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +37 -0
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +31 -0
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +37 -0
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +52 -0
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +44 -0
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +41 -0
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +67 -0
- package/node_modules/jose/dist/types/jwt/sign.d.ts +32 -0
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +34 -0
- package/node_modules/jose/dist/types/jwt/verify.d.ts +38 -0
- package/node_modules/jose/dist/types/key/export.d.ts +19 -0
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +40 -0
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +37 -0
- package/node_modules/jose/dist/types/key/import.d.ts +73 -0
- package/node_modules/jose/dist/types/types.d.ts +869 -0
- package/node_modules/jose/dist/types/util/base64url.d.ts +16 -0
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +10 -0
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +9 -0
- package/node_modules/jose/dist/types/util/errors.d.ts +220 -0
- package/node_modules/jose/dist/webapi/index.js +32 -0
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +9 -0
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +27 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +11 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +72 -0
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +51 -0
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +166 -0
- package/node_modules/jose/dist/webapi/jwk/embedded.js +19 -0
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +68 -0
- package/node_modules/jose/dist/webapi/jwks/local.js +78 -0
- package/node_modules/jose/dist/webapi/jwks/remote.js +170 -0
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +21 -0
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +9 -0
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +31 -0
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +24 -0
- package/node_modules/jose/dist/webapi/jws/general/sign.js +74 -0
- package/node_modules/jose/dist/webapi/jws/general/verify.js +44 -0
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +23 -0
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +101 -0
- package/node_modules/jose/dist/webapi/jwt/sign.js +51 -0
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +64 -0
- package/node_modules/jose/dist/webapi/jwt/verify.js +15 -0
- package/node_modules/jose/dist/webapi/key/export.js +44 -0
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +48 -0
- package/node_modules/jose/dist/webapi/key/generate_secret.js +40 -0
- package/node_modules/jose/dist/webapi/key/import.js +57 -0
- package/node_modules/jose/dist/webapi/lib/asn1.js +174 -0
- package/node_modules/jose/dist/webapi/lib/base64.js +22 -0
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +44 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +142 -0
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +28 -0
- package/node_modules/jose/dist/webapi/lib/deflate.js +44 -0
- package/node_modules/jose/dist/webapi/lib/helpers.js +42 -0
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +26 -0
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -0
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +107 -0
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +186 -0
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +110 -0
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +17 -0
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +73 -0
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +74 -0
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +107 -0
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +197 -0
- package/node_modules/jose/dist/webapi/lib/key.js +132 -0
- package/node_modules/jose/dist/webapi/lib/key_algorithm.js +10 -0
- package/node_modules/jose/dist/webapi/lib/key_descriptor.js +7 -0
- package/node_modules/jose/dist/webapi/lib/key_management.js +256 -0
- package/node_modules/jose/dist/webapi/lib/options.js +48 -0
- package/node_modules/jose/dist/webapi/lib/signing.js +26 -0
- package/node_modules/jose/dist/webapi/lib/type_checks.js +35 -0
- package/node_modules/jose/dist/webapi/util/base64url.js +39 -0
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -0
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +24 -0
- package/node_modules/jose/dist/webapi/util/errors.js +99 -0
- package/node_modules/jose/package.json +198 -0
- package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/node_modules/json-schema-traverse/LICENSE +21 -0
- package/node_modules/json-schema-traverse/README.md +95 -0
- package/node_modules/json-schema-traverse/index.d.ts +40 -0
- package/node_modules/json-schema-traverse/index.js +93 -0
- package/node_modules/json-schema-traverse/package.json +43 -0
- package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/node_modules/open/index.d.ts +158 -0
- package/node_modules/open/index.js +366 -0
- package/node_modules/open/license +9 -0
- package/node_modules/open/package.json +68 -0
- package/node_modules/open/readme.md +183 -0
- package/node_modules/open/xdg-open +1267 -0
- package/node_modules/path-key/index.d.ts +40 -0
- package/node_modules/path-key/index.js +16 -0
- package/node_modules/path-key/license +9 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-key/readme.md +61 -0
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +635 -0
- package/node_modules/pi-mcp-adapter/LICENSE +21 -0
- package/node_modules/pi-mcp-adapter/README.md +702 -0
- package/node_modules/pi-mcp-adapter/abort.ts +34 -0
- package/node_modules/pi-mcp-adapter/agent-dir.ts +60 -0
- package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +377 -0
- package/node_modules/pi-mcp-adapter/app-bridge.bundle.js +67 -0
- package/node_modules/pi-mcp-adapter/banner.png +0 -0
- package/node_modules/pi-mcp-adapter/cli.js +209 -0
- package/node_modules/pi-mcp-adapter/commands.ts +619 -0
- package/node_modules/pi-mcp-adapter/config.ts +1226 -0
- package/node_modules/pi-mcp-adapter/consent-manager.ts +64 -0
- package/node_modules/pi-mcp-adapter/direct-tools.ts +557 -0
- package/node_modules/pi-mcp-adapter/elicitation-handler.ts +348 -0
- package/node_modules/pi-mcp-adapter/error-signal.ts +21 -0
- package/node_modules/pi-mcp-adapter/errors.ts +223 -0
- package/node_modules/pi-mcp-adapter/glimpse-ui.ts +80 -0
- package/node_modules/pi-mcp-adapter/host-html-template.ts +469 -0
- package/node_modules/pi-mcp-adapter/index.ts +893 -0
- package/node_modules/pi-mcp-adapter/init.ts +625 -0
- package/node_modules/pi-mcp-adapter/json-schema-validator.ts +69 -0
- package/node_modules/pi-mcp-adapter/lifecycle.ts +151 -0
- package/node_modules/pi-mcp-adapter/logger.ts +169 -0
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +994 -0
- package/node_modules/pi-mcp-adapter/mcp-auth.ts +942 -0
- package/node_modules/pi-mcp-adapter/mcp-callback-server.ts +510 -0
- package/node_modules/pi-mcp-adapter/mcp-code.ts +354 -0
- package/node_modules/pi-mcp-adapter/mcp-keyring-helper.cjs +89 -0
- package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +616 -0
- package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +408 -0
- package/node_modules/pi-mcp-adapter/mcp-panel.ts +979 -0
- package/node_modules/pi-mcp-adapter/mcp-probe.ts +187 -0
- package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +128 -0
- package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +666 -0
- package/node_modules/pi-mcp-adapter/mcp-status.ts +109 -0
- package/node_modules/pi-mcp-adapter/mcp-trace.ts +306 -0
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +330 -0
- package/node_modules/pi-mcp-adapter/npx-resolver.ts +488 -0
- package/node_modules/pi-mcp-adapter/oauth-handler.ts +30 -0
- package/node_modules/pi-mcp-adapter/oauth.ts +48 -0
- package/node_modules/pi-mcp-adapter/onboarding-state.ts +76 -0
- package/node_modules/pi-mcp-adapter/package.json +178 -0
- package/node_modules/pi-mcp-adapter/panel-keys.ts +53 -0
- package/node_modules/pi-mcp-adapter/prompts.ts +353 -0
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +1249 -0
- package/node_modules/pi-mcp-adapter/resource-tools.ts +17 -0
- package/node_modules/pi-mcp-adapter/runtime-owner.ts +91 -0
- package/node_modules/pi-mcp-adapter/sampling-handler.ts +284 -0
- package/node_modules/pi-mcp-adapter/search-ranking.ts +127 -0
- package/node_modules/pi-mcp-adapter/server-manager.ts +1095 -0
- package/node_modules/pi-mcp-adapter/session-recovery.ts +145 -0
- package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +38 -0
- package/node_modules/pi-mcp-adapter/state.ts +62 -0
- package/node_modules/pi-mcp-adapter/tool-approval.ts +141 -0
- package/node_modules/pi-mcp-adapter/tool-metadata.ts +238 -0
- package/node_modules/pi-mcp-adapter/tool-registrar.ts +253 -0
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +297 -0
- package/node_modules/pi-mcp-adapter/ts-shape.ts +149 -0
- package/node_modules/pi-mcp-adapter/types.ts +793 -0
- package/node_modules/pi-mcp-adapter/ui-app-bridge-helpers.ts +40 -0
- package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +250 -0
- package/node_modules/pi-mcp-adapter/ui-server.ts +847 -0
- package/node_modules/pi-mcp-adapter/ui-session.ts +570 -0
- package/node_modules/pi-mcp-adapter/ui-stream-types.ts +89 -0
- package/node_modules/pi-mcp-adapter/ui-tool-visibility.ts +25 -0
- package/node_modules/pi-mcp-adapter/unix-socket-transport.ts +85 -0
- package/node_modules/pi-mcp-adapter/utils.ts +310 -0
- package/node_modules/pi-subagents/CHANGELOG.md +1700 -0
- package/node_modules/pi-subagents/LICENSE +21 -0
- package/node_modules/pi-subagents/README.md +120 -0
- package/node_modules/pi-subagents/agents/delegate.md +14 -0
- package/node_modules/pi-subagents/agents/oracle.md +74 -0
- package/node_modules/pi-subagents/agents/researcher.md +52 -0
- package/node_modules/pi-subagents/agents/reviewer.md +78 -0
- package/node_modules/pi-subagents/agents/scout.md +50 -0
- package/node_modules/pi-subagents/agents/worker.md +58 -0
- package/node_modules/pi-subagents/docs/agents.md +342 -0
- package/node_modules/pi-subagents/docs/configuration.md +328 -0
- package/node_modules/pi-subagents/docs/extension-api.md +308 -0
- package/node_modules/pi-subagents/docs/missions.md +119 -0
- package/node_modules/pi-subagents/docs/models.md +192 -0
- package/node_modules/pi-subagents/docs/observability.md +174 -0
- package/node_modules/pi-subagents/docs/tool-reference.md +343 -0
- package/node_modules/pi-subagents/docs/watchdog.md +176 -0
- package/node_modules/pi-subagents/docs/workflows.md +163 -0
- package/node_modules/pi-subagents/index.ts +1 -0
- package/node_modules/pi-subagents/inspector-runner.mjs +11 -0
- package/node_modules/pi-subagents/install.mjs +93 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/compile/code.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/compile/code.mjs +65 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/compile/compile.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/compile/compile.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/compile/index.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/compile/index.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/compile/validator.d.mts +43 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/compile/validator.mjs +121 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/error/errors.d.mts +214 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/error/errors.mjs +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/error/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/error/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/_idna.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/_idna.mjs +216 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/_puny.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/_puny.mjs +74 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/_registry.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/_registry.mjs +96 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/date.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/date.mjs +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/date_time.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/date_time.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/duration.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/duration.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/email.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/email.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/format.d.mts +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/format.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/hostname.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/hostname.mjs +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/idn_email.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/idn_email.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/idn_hostname.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/idn_hostname.mjs +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/index.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/index.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/ipv4.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/ipv4.mjs +38 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/ipv6.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/ipv6.mjs +67 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/iri.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/iri.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/iri_reference.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/iri_reference.mjs +60 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/json_pointer.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/json_pointer.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/regex.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/regex.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/relative_json_pointer.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/relative_json_pointer.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/time.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/time.mjs +27 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/uri.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/uri.mjs +135 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/uri_reference.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/uri_reference.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/uri_template.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/uri_template.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/url.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/url.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/uuid.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/format/uuid.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/emit.d.mts +58 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/emit.mjs +194 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/globals.d.mts +35 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/globals.mjs +90 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/guard.d.mts +69 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/guard.mjs +217 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/index.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/native.d.mts +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/native.mjs +60 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/string.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/guard/string.mjs +164 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/index.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/index.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/build.d.mts +39 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/build.mjs +118 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/check.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/check.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/compile.d.mts +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/compile.mjs +46 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_context.d.mts +35 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_context.mjs +129 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_exact_optional.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_exact_optional.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_externals.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_externals.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_functions.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_functions.mjs +47 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_guard.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_guard.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_reducer.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_reducer.mjs +45 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_refine.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_refine.mjs +29 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_stack.d.mts +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_stack.mjs +107 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_unique.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/_unique.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/additionalItems.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/additionalItems.mjs +50 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/additionalProperties.mjs +110 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/allOf.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/allOf.mjs +47 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/anyOf.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/anyOf.mjs +52 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/boolean.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/boolean.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/const.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/const.mjs +30 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/contains.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/contains.mjs +42 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/dependencies.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/dependencies.mjs +45 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/dependentRequired.mjs +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +38 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/dynamicRef.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/enum.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/enum.mjs +33 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/format.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/format.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/if.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/if.mjs +47 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/index.d.mts +49 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/index.mjs +55 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/items.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/items.mjs +68 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maxContains.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maxContains.mjs +42 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maxItems.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maxItems.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maxLength.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maxLength.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maxProperties.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maxProperties.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maximum.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/maximum.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minContains.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minContains.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minItems.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minItems.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minLength.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minLength.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minProperties.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minProperties.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minimum.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/minimum.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/multipleOf.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/multipleOf.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/not.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/not.mjs +37 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/oneOf.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/oneOf.mjs +58 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/pattern.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/pattern.mjs +28 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/patternProperties.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/patternProperties.mjs +44 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/prefixItems.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/prefixItems.mjs +35 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/properties.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/properties.mjs +75 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/propertyNames.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/propertyNames.mjs +39 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/recursiveRef.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/ref.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/ref.mjs +58 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/required.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/required.mjs +32 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/schema.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/schema.mjs +352 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/type.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/type.mjs +74 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +51 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +51 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/engine/uniqueItems.mjs +51 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/errors.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/errors.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/index.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/index.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/parse.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/parse.mjs +27 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/pointer/index.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/pointer/index.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/pointer/pointer.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/pointer/pointer.mjs +106 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/pointer/pointer_get.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/pointer/pointer_get.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/resolve/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/resolve/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/resolve/ref.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/resolve/ref.mjs +146 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/resolve/resolve.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/resolve/resolve.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/schema.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/schema.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/_canonical.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/_canonical.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/_comparer.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/_comparer.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/_elements.d.mts +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/_elements.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/additionalProperties.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/additionalProperties.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/allOf.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/allOf.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/anyOf.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/anyOf.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/const.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/const.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/enum.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/enum.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/if.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/if.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/items.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/items.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/oneOf.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/oneOf.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/patternProperties.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/patternProperties.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/prefixItems.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/prefixItems.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/properties.d.mts +32 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/properties.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/ref.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/ref.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/required.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/required.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/schema.d.mts +56 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/schema.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/static.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/static.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/type.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/type.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/unevaluatedProperties.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/static/unevaluatedProperties.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/_guard.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/_guard.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/_refine.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/_refine.mjs +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/additionalItems.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/additionalItems.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/additionalProperties.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/additionalProperties.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/allOf.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/allOf.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/anchor.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/anchor.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/anyOf.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/anyOf.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/const.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/const.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/contains.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/contains.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/contentEncoding.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/contentEncoding.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/contentMediaType.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/contentMediaType.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/default.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/default.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/defs.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/defs.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dependencies.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dependencies.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dependentRequired.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dependentRequired.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dependentSchemas.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dependentSchemas.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dynamicAnchor.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dynamicAnchor.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dynamicRef.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/dynamicRef.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/else.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/else.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/enum.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/enum.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/exclusiveMaximum.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/exclusiveMaximum.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/exclusiveMinimum.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/exclusiveMinimum.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/format.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/format.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/id.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/id.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/if.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/if.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/index.d.mts +54 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/index.mjs +60 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/items.d.mts +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/items.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maxContains.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maxContains.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maxItems.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maxItems.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maxLength.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maxLength.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maxProperties.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maxProperties.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maximum.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/maximum.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minContains.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minContains.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minItems.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minItems.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minLength.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minLength.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minProperties.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minProperties.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minimum.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/minimum.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/multipleOf.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/multipleOf.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/not.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/not.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/oneOf.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/oneOf.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/pattern.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/pattern.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/patternProperties.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/patternProperties.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/prefixItems.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/prefixItems.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/properties.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/properties.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/propertyNames.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/propertyNames.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/recursiveAnchor.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/recursiveAnchor.mjs +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/recursiveRef.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/recursiveRef.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/ref.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/ref.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/required.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/required.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/schema.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/schema.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/then.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/then.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/type.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/type.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/unevaluatedItems.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/unevaluatedItems.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/unevaluatedProperties.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/unevaluatedProperties.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/uniqueItems.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/schema/types/uniqueItems.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/arguments/arguments.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/arguments/arguments.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/arguments/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/arguments/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/environment/environment.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/environment/environment.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/environment/evaluate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/environment/evaluate.mjs +37 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/environment/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/environment/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/hashing/hash.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/hashing/hash.mjs +232 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/hashing/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/hashing/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/index.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/index.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/_config.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/_config.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/_locale.d.mts +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/_locale.mjs +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ar_001.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ar_001.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/bn_BD.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/bn_BD.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/cs_CZ.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/cs_CZ.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/de_DE.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/de_DE.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/el_GR.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/el_GR.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/en_US.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/en_US.mjs +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/es_419.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/es_419.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/es_AR.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/es_AR.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/es_ES.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/es_ES.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/es_MX.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/es_MX.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/fa_IR.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/fa_IR.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/fil_PH.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/fil_PH.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/fr_CA.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/fr_CA.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/fr_FR.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/fr_FR.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ha_NG.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ha_NG.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/hi_IN.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/hi_IN.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/hu_HU.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/hu_HU.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/id_ID.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/id_ID.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/it_IT.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/it_IT.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ja_JP.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ja_JP.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ko_KR.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ko_KR.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ms_MY.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ms_MY.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/nl_NL.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/nl_NL.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/pl_PL.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/pl_PL.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/pt_BR.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/pt_BR.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/pt_PT.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/pt_PT.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ro_RO.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ro_RO.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ru_RU.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ru_RU.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/sv_SE.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/sv_SE.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/sw_TZ.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/sw_TZ.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/th_TH.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/th_TH.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/tr_TR.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/tr_TR.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/uk_UA.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/uk_UA.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ur_PK.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/ur_PK.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/vi_VN.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/vi_VN.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/yo_NG.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/yo_NG.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/zh_Hans.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/zh_Hans.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/zh_Hant.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/locale/zh_Hant.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/assign.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/assign.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/clone.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/clone.mjs +63 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/create.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/create.mjs +30 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/discard.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/discard.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/memory.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/memory.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/metrics.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/metrics.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/update.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/memory/update.mjs +32 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/settings/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/settings/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/settings/settings.d.mts +56 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/settings/settings.mjs +32 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/system.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/system.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/unreachable/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/unreachable/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/unreachable/unreachable.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/system/unreachable/unreachable.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/_optional.d.mts +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/_optional.mjs +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/_readonly.d.mts +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/_readonly.mjs +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/awaited.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/awaited.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/capitalize.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/capitalize.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/conditional.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/conditional.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/constructor_parameters.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/constructor_parameters.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/evaluate.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/evaluate.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/exclude.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/exclude.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/extract.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/extract.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/index.d.mts +27 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/index.mjs +27 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/indexed.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/indexed.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/instance_type.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/instance_type.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/interface.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/interface.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/keyof.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/keyof.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/lowercase.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/lowercase.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/mapped.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/mapped.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/module.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/module.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/non_nullable.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/non_nullable.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/omit.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/omit.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/options.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/options.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/parameters.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/parameters.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/partial.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/partial.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/pick.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/pick.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/readonly_object.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/readonly_object.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/required.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/required.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/return_type.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/return_type.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/uncapitalize.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/uncapitalize.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/uppercase.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/action/uppercase.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/awaited/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/awaited/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +53 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/call/instantiate.d.mts +23 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/call/instantiate.mjs +48 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/call/resolve_arguments.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +33 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/call/resolve_target.d.mts +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/call/resolve_target.mjs +27 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/conditional/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/conditional/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/conditional/instantiate.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/conditional/instantiate.mjs +23 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/constructor_parameters/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/constructor_parameters/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/check.d.mts +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/check.mjs +51 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +53 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +31 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/extends.mjs +53 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/index.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/index.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +30 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/target.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/cyclic/target.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/enum/index.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/enum/index.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +47 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/compare.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +30 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/composite.mjs +63 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +27 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +45 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +27 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/index.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/index.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/instantiate.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/exclude/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/exclude/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/exclude/instantiate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/exclude/instantiate.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/exclude/operation.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/exclude/operation.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/extract/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/extract/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/extract/instantiate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/extract/instantiate.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/extract/operation.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/extract/operation.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/helpers/index.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/helpers/index.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/helpers/keys.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/helpers/keys.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/helpers/union.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/helpers/union.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/index.d.mts +31 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/index.mjs +37 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_cyclic.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_intersect.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_literal.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_literal.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_type.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_union.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/from_union.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/to_indexable.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/array_indexer.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/from_array.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/from_array.mjs +35 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/from_object.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/from_object.mjs +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/from_tuple.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs +35 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/from_type.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/from_type.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/instance_type/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/instance_type/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/instance_type/instantiate.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/instantiate.d.mts +165 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/instantiate.mjs +159 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/interface/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/interface/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/interface/instantiate.mjs +23 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/from_literal.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/from_type.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/from_union.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/instantiate.d.mts +38 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs +52 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/mapping.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_any.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_any.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_array.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_array.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_object.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_object.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_record.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_record.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_tuple.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_type.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/from_type.mjs +23 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/mapped/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/mapped/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/mapped/instantiate.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/mapped/instantiate.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +42 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +34 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/module/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/module/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/module/instantiate.d.mts +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/module/instantiate.mjs +34 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/non_nullable/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/non_nullable/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/non_nullable/instantiate.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/collapse.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/collapse.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_cyclic.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_cyclic.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_intersect.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_object.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_object.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_tuple.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_tuple.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_type.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_type.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_union.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/from_union.mjs +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/object/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/omit/from_type.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/omit/from_type.mjs +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/omit/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/omit/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/omit/instantiate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/omit/instantiate.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/options/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/options/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/options/instantiate.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/options/instantiate.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/parameters/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/parameters/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_cyclic.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_object.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_object.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_type.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_type.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_union.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/from_union.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/instantiate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/partial/instantiate.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/patterns/index.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/patterns/index.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/patterns/pattern.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/patterns/pattern.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/patterns/template.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/patterns/template.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/pick/from_type.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/pick/from_type.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/pick/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/pick/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/pick/instantiate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/pick/instantiate.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_union.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/instantiate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key.d.mts +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key.mjs +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_any.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_any.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_boolean.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_integer.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_integer.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_intersect.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_literal.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_literal.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_number.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_number.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_string.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_string.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_union.d.mts +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/from_key_union.mjs +39 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/instantiate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/instantiate.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/record_create.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/record/record_create.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/ref/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/ref/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/ref/instantiate.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_cyclic.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_cyclic.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_intersect.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_object.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_object.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_type.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_type.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_union.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/from_union.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/instantiate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/required/instantiate.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/rest/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/rest/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/rest/spread.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/rest/spread.mjs +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/return_type/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/return_type/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/return_type/instantiate.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/return_type/instantiate.mjs +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/create.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/create.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/decode.d.mts +30 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/decode.mjs +81 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +33 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/encode.mjs +81 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/index.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/index.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/instantiate.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/is_finite.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/is_pattern.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/static.d.mts +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/template_literal/static.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/this/expand_this.d.mts +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/this/expand_this.mjs +32 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/tuple/to_object.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/engine/tuple/to_object.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/any.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/any.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/array.d.mts +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/array.mjs +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/async_iterator.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/async_iterator.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/bigint.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/bigint.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/boolean.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/boolean.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/constructor.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/constructor.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/enum.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/enum.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/extends.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/extends.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/extends_left.d.mts +55 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/extends_left.mjs +83 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/extends_right.d.mts +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/extends_right.mjs +44 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/function.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/function.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/index.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/index.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/inference.d.mts +34 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/inference.mjs +62 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/integer.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/integer.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/intersect.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/intersect.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/iterator.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/iterator.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/literal.d.mts +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/literal.mjs +44 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/never.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/never.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/null.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/null.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/number.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/number.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/object.d.mts +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/object.mjs +87 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/parameters.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/parameters.mjs +28 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/promise.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/promise.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/result.d.mts +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/result.mjs +36 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/return_type.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/return_type.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/string.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/string.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/symbol.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/symbol.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/template_literal.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/template_literal.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/tuple.d.mts +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/tuple.mjs +60 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/undefined.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/undefined.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/union.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/union.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/unknown.d.mts +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/unknown.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/void.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/extends/void.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/index.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/index.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/mapping.d.mts +365 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/mapping.mjs +532 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/parser.d.mts +260 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/parser.mjs +135 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/script.d.mts +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/script.mjs +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/bigint.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/bigint.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/const.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/const.mjs +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/ident.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/ident.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/index.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/index.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/integer.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/integer.mjs +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/char.d.mts +75 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/char.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/guard.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/many.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/many.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/match.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/match.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/optional.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/optional.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/take.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/take.mjs +30 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/trim.d.mts +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/internal/trim.mjs +34 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/number.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/number.mjs +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/rest.d.mts +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/rest.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/span.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/span.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/string.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/string.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/unsigned_integer.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/unsigned_integer.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/unsigned_number.d.mts +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/unsigned_number.mjs +38 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/until.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/until.mjs +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/until_1.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/script/token/until_1.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_codec.d.mts +30 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_codec.mjs +61 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_immutable.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_immutable.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_optional.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_optional.mjs +27 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_readonly.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_readonly.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_refine.d.mts +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/_refine.mjs +37 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/any.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/any.mjs +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/array.d.mts +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/array.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/async_iterator.d.mts +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/async_iterator.mjs +28 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/base.d.mts +50 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/base.mjs +84 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/bigint.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/bigint.mjs +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/boolean.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/boolean.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/call.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/call.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/constructor.d.mts +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/constructor.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/cyclic.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/cyclic.mjs +29 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/deferred.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/deferred.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/enum.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/enum.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/function.d.mts +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/function.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/generic.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/generic.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/identifier.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/identifier.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/index.d.mts +48 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/index.mjs +54 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/infer.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/infer.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/integer.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/integer.mjs +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/intersect.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/intersect.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/iterator.d.mts +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/iterator.mjs +28 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/literal.d.mts +31 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/literal.mjs +62 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/never.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/never.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/null.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/null.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/number.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/number.mjs +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/object.d.mts +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/object.mjs +28 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/parameter.d.mts +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/parameter.mjs +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/promise.d.mts +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/promise.mjs +29 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/properties.d.mts +43 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/properties.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/record.d.mts +46 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/record.mjs +60 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/ref.d.mts +19 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/ref.mjs +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/rest.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/rest.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/schema.d.mts +176 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/schema.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/static.d.mts +48 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/static.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/string.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/string.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/symbol.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/symbol.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/template_literal.d.mts +28 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/template_literal.mjs +37 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/this.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/this.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/tuple.d.mts +38 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/tuple.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/undefined.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/undefined.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/union.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/union.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/unknown.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/unknown.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/unsafe.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/unsafe.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/void.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/type/types/void.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/typebox.d.mts +73 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/typebox.mjs +89 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/assert/assert.d.mts +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/assert/assert.mjs +28 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/assert/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/assert/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/check/check.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/check/check.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/check/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/check/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/additional.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/additional.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/clean.d.mts +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/clean.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_array.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_array.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_base.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_base.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_cyclic.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_cyclic.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_intersect.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_intersect.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_object.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_object.mjs +31 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_record.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_record.mjs +32 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_ref.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_ref.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_tuple.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_tuple.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_type.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_type.mjs +23 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_union.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/from_union.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clean/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clone/clone.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clone/clone.mjs +83 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clone/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/clone/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/callback.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/callback.mjs +25 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/decode.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/decode.mjs +50 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/encode.d.mts +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/encode.mjs +50 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_array.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_array.mjs +38 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_cyclic.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_cyclic.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_intersect.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_intersect.mjs +58 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_object.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_object.mjs +45 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_record.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_record.mjs +44 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_ref.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_ref.mjs +31 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_tuple.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_tuple.mjs +35 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_type.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_type.mjs +22 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_union.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/from_union.mjs +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/has.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/has.mjs +93 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/index.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/codec/index.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/convert.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/convert.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_additional.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_additional.mjs +18 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_array.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_array.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_base.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_base.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_bigint.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_bigint.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_boolean.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_boolean.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_cyclic.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_cyclic.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_enum.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_enum.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_integer.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_integer.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_intersect.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_intersect.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_literal.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_literal.mjs +44 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_null.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_null.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_number.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_number.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_object.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_object.mjs +28 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_record.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_record.mjs +23 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_ref.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_ref.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_string.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_string.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_template_literal.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_template_literal.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_tuple.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_tuple.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_type.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_type.mjs +45 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_undefined.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_undefined.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_union.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_union.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_void.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/from_void.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_array.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_array.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_bigint.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_bigint.mjs +45 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_boolean.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_boolean.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_null.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_null.mjs +44 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_number.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_number.mjs +44 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_result.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_result.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_string.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_string.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_undefined.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/convert/try/try_undefined.mjs +44 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/create.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/create.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/error.d.mts +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/error.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_array.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_array.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_async_iterator.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_async_iterator.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_base.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_base.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_bigint.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_bigint.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_boolean.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_boolean.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_constructor.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_constructor.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_cyclic.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_cyclic.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_default.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_default.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_enum.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_enum.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_function.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_function.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_integer.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_integer.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_intersect.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_intersect.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_iterator.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_iterator.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_literal.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_literal.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_never.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_never.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_null.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_null.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_number.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_number.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_object.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_object.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_promise.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_promise.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_record.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_record.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_ref.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_ref.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_string.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_string.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_symbol.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_symbol.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_template_literal.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_template_literal.mjs +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_tuple.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_tuple.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_type.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_type.mjs +69 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_undefined.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_undefined.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_union.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_union.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_void.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/from_void.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/index.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/create/index.mjs +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/default.d.mts +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/default.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_array.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_array.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_base.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_base.mjs +5 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_cyclic.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_cyclic.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_default.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_default.mjs +13 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_intersect.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_intersect.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_object.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_object.mjs +32 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_record.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_record.mjs +26 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_ref.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_ref.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_tuple.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_tuple.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_type.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_type.mjs +27 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_union.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/from_union.mjs +14 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/default/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/delta/diff.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/delta/diff.mjs +135 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/delta/edit.d.mts +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/delta/edit.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/delta/index.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/delta/index.mjs +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/delta/patch.d.mts +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/delta/patch.mjs +42 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/equal/equal.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/equal/equal.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/equal/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/equal/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/errors/errors.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/errors/errors.mjs +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/errors/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/errors/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/hash/hash.d.mts +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/hash/hash.mjs +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/hash/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/hash/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/index.d.mts +21 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/index.mjs +30 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/error.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/error.mjs +6 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/from_array.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/from_array.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/from_object.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/from_object.mjs +40 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/from_unknown.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/from_unknown.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/from_value.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/from_value.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/mutate.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/mutate/mutate.mjs +41 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/parse/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/parse/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/parse/parse.d.mts +11 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/parse/parse.mjs +47 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/pipeline/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/pipeline/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/pipeline/pipeline.d.mts +10 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/pipeline/pipeline.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/pointer/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/pointer/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/error.d.mts +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/error.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_array.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_array.mjs +39 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_base.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_base.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_enum.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_enum.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_intersect.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_intersect.mjs +8 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_object.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_object.mjs +33 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_record.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_record.mjs +33 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_ref.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_ref.mjs +9 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_template_literal.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_template_literal.mjs +7 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_tuple.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_tuple.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_type.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_type.mjs +86 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_union.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_union.mjs +24 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_unknown.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/from_unknown.mjs +12 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/index.d.mts +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/index.mjs +1 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/repair.d.mts +17 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/repair/repair.mjs +20 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/shared/index.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/shared/index.mjs +4 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/shared/optional_undefined.d.mts +2 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/shared/optional_undefined.mjs +15 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/shared/union_priority_sort.mjs +36 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/shared/union_score_select.d.mts +3 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/shared/union_score_select.mjs +51 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/value.d.mts +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/build/value/value.mjs +16 -0
- package/node_modules/pi-subagents/node_modules/typebox/license +23 -0
- package/node_modules/pi-subagents/node_modules/typebox/package.json +87 -0
- package/node_modules/pi-subagents/node_modules/typebox/readme.md +356 -0
- package/node_modules/pi-subagents/package.json +104 -0
- package/node_modules/pi-subagents/prompts/gather-context-and-clarify.md +13 -0
- package/node_modules/pi-subagents/prompts/parallel-cleanup.md +59 -0
- package/node_modules/pi-subagents/prompts/parallel-research.md +50 -0
- package/node_modules/pi-subagents/prompts/parallel-review.md +54 -0
- package/node_modules/pi-subagents/prompts/review-loop.md +43 -0
- package/node_modules/pi-subagents/skills/pi-subagents/SKILL.md +41 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +251 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/execution-controls.md +428 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +161 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +242 -0
- package/node_modules/pi-subagents/src/agents/agent-management.ts +1256 -0
- package/node_modules/pi-subagents/src/agents/agent-memory.ts +254 -0
- package/node_modules/pi-subagents/src/agents/agent-refinements.ts +624 -0
- package/node_modules/pi-subagents/src/agents/agent-scope.ts +6 -0
- package/node_modules/pi-subagents/src/agents/agent-selection.ts +25 -0
- package/node_modules/pi-subagents/src/agents/agent-serializer.ts +163 -0
- package/node_modules/pi-subagents/src/agents/agents.ts +1898 -0
- package/node_modules/pi-subagents/src/agents/chain-serializer.ts +280 -0
- package/node_modules/pi-subagents/src/agents/frontmatter.ts +153 -0
- package/node_modules/pi-subagents/src/agents/identity.ts +30 -0
- package/node_modules/pi-subagents/src/agents/proactive-skills.ts +194 -0
- package/node_modules/pi-subagents/src/agents/skills.ts +754 -0
- package/node_modules/pi-subagents/src/api/background-work.ts +197 -0
- package/node_modules/pi-subagents/src/api/capability-ceiling.ts +17 -0
- package/node_modules/pi-subagents/src/api/control-channel.ts +4 -0
- package/node_modules/pi-subagents/src/api/delegation.ts +119 -0
- package/node_modules/pi-subagents/src/api/external-runs.ts +129 -0
- package/node_modules/pi-subagents/src/api/intercom-bridge.ts +3 -0
- package/node_modules/pi-subagents/src/api/pi-args.ts +5 -0
- package/node_modules/pi-subagents/src/api/preflight.ts +403 -0
- package/node_modules/pi-subagents/src/api/project-panes.ts +30 -0
- package/node_modules/pi-subagents/src/api/shared-types.ts +19 -0
- package/node_modules/pi-subagents/src/extension/config.ts +103 -0
- package/node_modules/pi-subagents/src/extension/control-notices.ts +58 -0
- package/node_modules/pi-subagents/src/extension/doctor.ts +230 -0
- package/node_modules/pi-subagents/src/extension/fanout-child.ts +202 -0
- package/node_modules/pi-subagents/src/extension/index.ts +850 -0
- package/node_modules/pi-subagents/src/extension/public-execution.ts +71 -0
- package/node_modules/pi-subagents/src/extension/rpc.ts +654 -0
- package/node_modules/pi-subagents/src/extension/schemas.ts +396 -0
- package/node_modules/pi-subagents/src/extension/steering-notices.ts +35 -0
- package/node_modules/pi-subagents/src/extension/subagent-guide.ts +39 -0
- package/node_modules/pi-subagents/src/extension/tool-description.ts +182 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/actions.ts +229 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/client.ts +130 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/inspector-runner.ts +141 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.ts +550 -0
- package/node_modules/pi-subagents/src/integrations/herdr-status.ts +330 -0
- package/node_modules/pi-subagents/src/intercom/intercom-bridge.ts +187 -0
- package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.ts +813 -0
- package/node_modules/pi-subagents/src/intercom/result-intercom.ts +421 -0
- package/node_modules/pi-subagents/src/missions/actions.ts +433 -0
- package/node_modules/pi-subagents/src/missions/goal-driver.ts +162 -0
- package/node_modules/pi-subagents/src/missions/lifecycle.ts +365 -0
- package/node_modules/pi-subagents/src/missions/store.ts +584 -0
- package/node_modules/pi-subagents/src/missions/types.ts +190 -0
- package/node_modules/pi-subagents/src/missions/workflow-state.ts +256 -0
- package/node_modules/pi-subagents/src/policy/authority.ts +46 -0
- package/node_modules/pi-subagents/src/profiles/profiles.ts +661 -0
- package/node_modules/pi-subagents/src/runs/background/active-run-index.ts +42 -0
- package/node_modules/pi-subagents/src/runs/background/async-execution.ts +1585 -0
- package/node_modules/pi-subagents/src/runs/background/async-job-tracker.ts +671 -0
- package/node_modules/pi-subagents/src/runs/background/async-resume.ts +555 -0
- package/node_modules/pi-subagents/src/runs/background/async-status.ts +570 -0
- package/node_modules/pi-subagents/src/runs/background/auto-drain.ts +67 -0
- package/node_modules/pi-subagents/src/runs/background/chain-append.ts +328 -0
- package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.ts +199 -0
- package/node_modules/pi-subagents/src/runs/background/completion-batcher.ts +168 -0
- package/node_modules/pi-subagents/src/runs/background/completion-dedupe.ts +54 -0
- package/node_modules/pi-subagents/src/runs/background/completion-replay.ts +267 -0
- package/node_modules/pi-subagents/src/runs/background/control-channel.ts +733 -0
- package/node_modules/pi-subagents/src/runs/background/fleet-view.ts +540 -0
- package/node_modules/pi-subagents/src/runs/background/notify.ts +332 -0
- package/node_modules/pi-subagents/src/runs/background/parallel-groups.ts +45 -0
- package/node_modules/pi-subagents/src/runs/background/process-terminal.ts +280 -0
- package/node_modules/pi-subagents/src/runs/background/result-watcher.ts +517 -0
- package/node_modules/pi-subagents/src/runs/background/resume-guidance.ts +33 -0
- package/node_modules/pi-subagents/src/runs/background/retained-children.ts +68 -0
- package/node_modules/pi-subagents/src/runs/background/run-id-resolver.ts +167 -0
- package/node_modules/pi-subagents/src/runs/background/run-status.ts +522 -0
- package/node_modules/pi-subagents/src/runs/background/scheduled-runs.ts +777 -0
- package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.ts +384 -0
- package/node_modules/pi-subagents/src/runs/background/steering.ts +239 -0
- package/node_modules/pi-subagents/src/runs/background/subagent-runner.ts +4776 -0
- package/node_modules/pi-subagents/src/runs/background/subagent-wait.ts +664 -0
- package/node_modules/pi-subagents/src/runs/background/top-level-async.ts +14 -0
- package/node_modules/pi-subagents/src/runs/background/wait-completions.ts +146 -0
- package/node_modules/pi-subagents/src/runs/background/wait-config.ts +36 -0
- package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.ts +269 -0
- package/node_modules/pi-subagents/src/runs/background/wait-tool.ts +34 -0
- package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.ts +85 -0
- package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.ts +255 -0
- package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.ts +65 -0
- package/node_modules/pi-subagents/src/runs/foreground/chain-clarify.ts +1354 -0
- package/node_modules/pi-subagents/src/runs/foreground/chain-execution.ts +1530 -0
- package/node_modules/pi-subagents/src/runs/foreground/execution.ts +1875 -0
- package/node_modules/pi-subagents/src/runs/foreground/foreground-control.ts +132 -0
- package/node_modules/pi-subagents/src/runs/foreground/foreground-history.ts +137 -0
- package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.ts +5937 -0
- package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +187 -0
- package/node_modules/pi-subagents/src/runs/shared/acceptance.ts +1365 -0
- package/node_modules/pi-subagents/src/runs/shared/agent-contract.ts +38 -0
- package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.ts +209 -0
- package/node_modules/pi-subagents/src/runs/shared/chain-outputs.ts +118 -0
- package/node_modules/pi-subagents/src/runs/shared/child-protocol.ts +401 -0
- package/node_modules/pi-subagents/src/runs/shared/completion-guard.ts +95 -0
- package/node_modules/pi-subagents/src/runs/shared/context-mode.ts +44 -0
- package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.ts +297 -0
- package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.ts +130 -0
- package/node_modules/pi-subagents/src/runs/shared/long-running-guard.ts +220 -0
- package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +406 -0
- package/node_modules/pi-subagents/src/runs/shared/model-fallback.ts +340 -0
- package/node_modules/pi-subagents/src/runs/shared/model-scope.ts +138 -0
- package/node_modules/pi-subagents/src/runs/shared/nested-events.ts +1076 -0
- package/node_modules/pi-subagents/src/runs/shared/nested-path.ts +52 -0
- package/node_modules/pi-subagents/src/runs/shared/nested-render.ts +123 -0
- package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.ts +238 -0
- package/node_modules/pi-subagents/src/runs/shared/parallel-utils.ts +257 -0
- package/node_modules/pi-subagents/src/runs/shared/permissions.ts +95 -0
- package/node_modules/pi-subagents/src/runs/shared/pi-args.ts +798 -0
- package/node_modules/pi-subagents/src/runs/shared/pi-spawn.ts +163 -0
- package/node_modules/pi-subagents/src/runs/shared/process-signal.ts +19 -0
- package/node_modules/pi-subagents/src/runs/shared/run-history.ts +181 -0
- package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.ts +71 -0
- package/node_modules/pi-subagents/src/runs/shared/session-lease.ts +299 -0
- package/node_modules/pi-subagents/src/runs/shared/single-output.ts +235 -0
- package/node_modules/pi-subagents/src/runs/shared/spawn-budget.ts +128 -0
- package/node_modules/pi-subagents/src/runs/shared/structured-output.ts +182 -0
- package/node_modules/pi-subagents/src/runs/shared/subagent-control.ts +231 -0
- package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +673 -0
- package/node_modules/pi-subagents/src/runs/shared/subagent-startup-retry.ts +104 -0
- package/node_modules/pi-subagents/src/runs/shared/task-intent.ts +181 -0
- package/node_modules/pi-subagents/src/runs/shared/tool-availability.ts +83 -0
- package/node_modules/pi-subagents/src/runs/shared/tool-budget.ts +80 -0
- package/node_modules/pi-subagents/src/runs/shared/turn-budget.ts +98 -0
- package/node_modules/pi-subagents/src/runs/shared/usage-budget.ts +65 -0
- package/node_modules/pi-subagents/src/runs/shared/workflow-graph.ts +231 -0
- package/node_modules/pi-subagents/src/runs/shared/worktree.ts +760 -0
- package/node_modules/pi-subagents/src/shared/accessible-dir.ts +47 -0
- package/node_modules/pi-subagents/src/shared/artifacts.ts +285 -0
- package/node_modules/pi-subagents/src/shared/atomic-json.ts +61 -0
- package/node_modules/pi-subagents/src/shared/child-transcript.ts +264 -0
- package/node_modules/pi-subagents/src/shared/display-text.ts +100 -0
- package/node_modules/pi-subagents/src/shared/file-coalescer.ts +49 -0
- package/node_modules/pi-subagents/src/shared/file-system-retry.ts +47 -0
- package/node_modules/pi-subagents/src/shared/fork-context.ts +226 -0
- package/node_modules/pi-subagents/src/shared/formatters.ts +131 -0
- package/node_modules/pi-subagents/src/shared/jsonl-writer.ts +81 -0
- package/node_modules/pi-subagents/src/shared/launch-contract.ts +124 -0
- package/node_modules/pi-subagents/src/shared/model-info.ts +81 -0
- package/node_modules/pi-subagents/src/shared/post-exit-stdio-guard.ts +85 -0
- package/node_modules/pi-subagents/src/shared/prompt-resources.ts +51 -0
- package/node_modules/pi-subagents/src/shared/session-identity.ts +10 -0
- package/node_modules/pi-subagents/src/shared/session-tokens.ts +44 -0
- package/node_modules/pi-subagents/src/shared/settings.ts +514 -0
- package/node_modules/pi-subagents/src/shared/status-format.ts +55 -0
- package/node_modules/pi-subagents/src/shared/types.ts +2112 -0
- package/node_modules/pi-subagents/src/shared/utf8.ts +11 -0
- package/node_modules/pi-subagents/src/shared/utils.ts +623 -0
- package/node_modules/pi-subagents/src/slash/delegation-adapters.ts +434 -0
- package/node_modules/pi-subagents/src/slash/delegation-json.ts +108 -0
- package/node_modules/pi-subagents/src/slash/delegation-request.ts +166 -0
- package/node_modules/pi-subagents/src/slash/prompt-template-bridge.ts +383 -0
- package/node_modules/pi-subagents/src/slash/prompt-workflows.ts +287 -0
- package/node_modules/pi-subagents/src/slash/selector.ts +147 -0
- package/node_modules/pi-subagents/src/slash/slash-bridge.ts +192 -0
- package/node_modules/pi-subagents/src/slash/slash-commands.ts +1014 -0
- package/node_modules/pi-subagents/src/slash/slash-live-state.ts +296 -0
- package/node_modules/pi-subagents/src/slash/subagents-admin.ts +432 -0
- package/node_modules/pi-subagents/src/tui/fleet-status.ts +574 -0
- package/node_modules/pi-subagents/src/tui/fleet-transcript.ts +577 -0
- package/node_modules/pi-subagents/src/tui/fleet.ts +989 -0
- package/node_modules/pi-subagents/src/tui/render-helpers.ts +80 -0
- package/node_modules/pi-subagents/src/tui/render.ts +2146 -0
- package/node_modules/pi-subagents/src/types/pi-runtime-compat.d.ts +8 -0
- package/node_modules/pi-subagents/src/watchdog/change-signature.ts +221 -0
- package/node_modules/pi-subagents/src/watchdog/child-status.ts +205 -0
- package/node_modules/pi-subagents/src/watchdog/emission-guard.ts +123 -0
- package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.ts +537 -0
- package/node_modules/pi-subagents/src/watchdog/model-selection.ts +167 -0
- package/node_modules/pi-subagents/src/watchdog/permission-arbiter.ts +145 -0
- package/node_modules/pi-subagents/src/watchdog/register-child.ts +117 -0
- package/node_modules/pi-subagents/src/watchdog/register-main.ts +440 -0
- package/node_modules/pi-subagents/src/watchdog/render.ts +54 -0
- package/node_modules/pi-subagents/src/watchdog/review.ts +302 -0
- package/node_modules/pi-subagents/src/watchdog/runtime.ts +868 -0
- package/node_modules/pi-subagents/src/watchdog/scope.ts +62 -0
- package/node_modules/pi-subagents/src/watchdog/settings.ts +568 -0
- package/node_modules/pi-subagents/src/watchdog/tool-actions.ts +155 -0
- package/node_modules/pi-subagents/src/watchdog/turn-delta.ts +161 -0
- package/node_modules/pi-subagents/src/watchdog/types.ts +198 -0
- package/node_modules/pi-subagents/src/watchdog/warning-format.ts +73 -0
- package/node_modules/pi-subagents/src/workflows/chat-progress.ts +140 -0
- package/node_modules/pi-subagents/src/workflows/scripted-workflow.ts +703 -0
- package/node_modules/pkce-challenge/CHANGELOG.md +114 -0
- package/node_modules/pkce-challenge/LICENSE +21 -0
- package/node_modules/pkce-challenge/README.md +55 -0
- package/node_modules/pkce-challenge/dist/index.browser.d.ts +19 -0
- package/node_modules/pkce-challenge/dist/index.browser.js +75 -0
- package/node_modules/pkce-challenge/dist/index.node.cjs +83 -0
- package/node_modules/pkce-challenge/dist/index.node.d.cts +19 -0
- package/node_modules/pkce-challenge/dist/index.node.d.ts +19 -0
- package/node_modules/pkce-challenge/dist/index.node.js +78 -0
- package/node_modules/pkce-challenge/package.json +59 -0
- package/node_modules/recheck/LICENSE +9 -0
- package/node_modules/recheck/README.md +5 -0
- package/node_modules/recheck/index.d.ts +400 -0
- package/node_modules/recheck/index.js +4 -0
- package/node_modules/recheck/lib/browser.js +124 -0
- package/node_modules/recheck/lib/main.js +127 -0
- package/node_modules/recheck/lib/synckit-worker.js +1 -0
- package/node_modules/recheck/package.json +62 -0
- package/node_modules/require-from-string/index.js +34 -0
- package/node_modules/require-from-string/license +21 -0
- package/node_modules/require-from-string/package.json +28 -0
- package/node_modules/require-from-string/readme.md +56 -0
- package/node_modules/run-applescript/index.d.ts +66 -0
- package/node_modules/run-applescript/index.js +37 -0
- package/node_modules/run-applescript/license +9 -0
- package/node_modules/run-applescript/package.json +42 -0
- package/node_modules/run-applescript/readme.md +78 -0
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/license +9 -0
- package/node_modules/shebang-command/package.json +34 -0
- package/node_modules/shebang-command/readme.md +34 -0
- package/node_modules/shebang-regex/index.d.ts +22 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/license +9 -0
- package/node_modules/shebang-regex/package.json +35 -0
- package/node_modules/shebang-regex/readme.md +33 -0
- package/node_modules/smol-toml/LICENSE +24 -0
- package/node_modules/smol-toml/README.md +418 -0
- package/node_modules/smol-toml/dist/date.d.ts +41 -0
- package/node_modules/smol-toml/dist/date.js +127 -0
- package/node_modules/smol-toml/dist/error.d.ts +38 -0
- package/node_modules/smol-toml/dist/error.js +63 -0
- package/node_modules/smol-toml/dist/extract.js +69 -0
- package/node_modules/smol-toml/dist/index.cjs +734 -0
- package/node_modules/smol-toml/dist/index.d.ts +43 -0
- package/node_modules/smol-toml/dist/index.js +33 -0
- package/node_modules/smol-toml/dist/parse.d.ts +36 -0
- package/node_modules/smol-toml/dist/parse.js +149 -0
- package/node_modules/smol-toml/dist/primitive.js +238 -0
- package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
- package/node_modules/smol-toml/dist/stringify.js +181 -0
- package/node_modules/smol-toml/dist/struct.js +179 -0
- package/node_modules/smol-toml/dist/util.d.ts +38 -0
- package/node_modules/smol-toml/dist/util.js +89 -0
- package/node_modules/smol-toml/package.json +68 -0
- package/node_modules/strip-json-comments/index.d.ts +41 -0
- package/node_modules/strip-json-comments/index.js +113 -0
- package/node_modules/strip-json-comments/license +9 -0
- package/node_modules/strip-json-comments/package.json +56 -0
- package/node_modules/strip-json-comments/readme.md +75 -0
- package/node_modules/synckit/LICENSE +21 -0
- package/node_modules/synckit/README.md +191 -0
- package/node_modules/synckit/lib/index.cjs +472 -0
- package/node_modules/synckit/lib/index.d.ts +32 -0
- package/node_modules/synckit/lib/index.js +380 -0
- package/node_modules/synckit/lib/index.js.map +1 -0
- package/node_modules/synckit/lib/types.d.ts +35 -0
- package/node_modules/synckit/lib/types.js +2 -0
- package/node_modules/synckit/lib/types.js.map +1 -0
- package/node_modules/synckit/package.json +40 -0
- package/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/node_modules/tslib/LICENSE.txt +12 -0
- package/node_modules/tslib/README.md +164 -0
- package/node_modules/tslib/SECURITY.md +41 -0
- package/node_modules/tslib/modules/index.d.ts +38 -0
- package/node_modules/tslib/modules/index.js +70 -0
- package/node_modules/tslib/modules/package.json +3 -0
- package/node_modules/tslib/package.json +47 -0
- package/node_modules/tslib/tslib.d.ts +460 -0
- package/node_modules/tslib/tslib.es6.html +1 -0
- package/node_modules/tslib/tslib.es6.js +402 -0
- package/node_modules/tslib/tslib.es6.mjs +401 -0
- package/node_modules/tslib/tslib.html +1 -0
- package/node_modules/tslib/tslib.js +484 -0
- package/node_modules/which/LICENSE +15 -0
- package/node_modules/which/README.md +54 -0
- package/node_modules/which/bin/node-which +52 -0
- package/node_modules/which/package.json +43 -0
- package/node_modules/which/which.js +125 -0
- package/node_modules/wsl-utils/index.d.ts +21 -0
- package/node_modules/wsl-utils/index.js +57 -0
- package/node_modules/wsl-utils/license +9 -0
- package/node_modules/wsl-utils/package.json +46 -0
- package/node_modules/wsl-utils/readme.md +50 -0
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +217 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +114 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +717 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +967 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +64 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +222 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +116 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +43 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +719 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +972 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +68 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +191 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +52 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +216 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +325 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1823 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +153 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +455 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +190 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4730 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
- package/node_modules/zod/src/v4/core/util.ts +983 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/zod/src/v4/locales/en.ts +123 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +132 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +52 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +117 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +41 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +16 -0
- package/node_modules/zod/v4/classic/external.d.ts +16 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +599 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1511 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +767 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +767 -0
- package/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/node_modules/zod/v4/core/api.cjs +1227 -0
- package/node_modules/zod/v4/core/api.d.cts +325 -0
- package/node_modules/zod/v4/core/api.d.ts +325 -0
- package/node_modules/zod/v4/core/api.js +1087 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +575 -0
- package/node_modules/zod/v4/core/core.cjs +85 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +78 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +216 -0
- package/node_modules/zod/v4/core/errors.d.cts +221 -0
- package/node_modules/zod/v4/core/errors.d.ts +221 -0
- package/node_modules/zod/v4/core/errors.js +185 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +172 -0
- package/node_modules/zod/v4/core/regexes.d.cts +85 -0
- package/node_modules/zod/v4/core/regexes.d.ts +85 -0
- package/node_modules/zod/v4/core/regexes.js +139 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2270 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1184 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1184 -0
- package/node_modules/zod/v4/core/schemas.js +2239 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/node_modules/zod/v4/core/util.cjs +734 -0
- package/node_modules/zod/v4/core/util.d.cts +200 -0
- package/node_modules/zod/v4/core/util.d.ts +200 -0
- package/node_modules/zod/v4/core/util.js +674 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +133 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +108 -0
- package/node_modules/zod/v4/locales/el.cjs +136 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +109 -0
- package/node_modules/zod/v4/locales/en.cjs +140 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +113 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +152 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +125 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +214 -0
- package/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +122 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +106 -0
- package/node_modules/zod/v4/locales/index.cjs +111 -0
- package/node_modules/zod/v4/locales/index.d.cts +52 -0
- package/node_modules/zod/v4/locales/index.d.ts +52 -0
- package/node_modules/zod/v4/locales/index.js +52 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +112 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +137 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +109 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +108 -0
- package/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +119 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +105 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +137 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +110 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +13 -0
- package/node_modules/zod/v4/mini/external.d.ts +13 -0
- package/node_modules/zod/v4/mini/external.js +14 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1083 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +445 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +445 -0
- package/node_modules/zod/v4/mini/schemas.js +961 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +67 -0
|
@@ -0,0 +1,4776 @@
|
|
|
1
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
import type { Message } from "@earendil-works/pi-ai";
|
|
7
|
+
import { writeAtomicJson } from "../../shared/atomic-json.ts";
|
|
8
|
+
import { createFileCoalescer } from "../../shared/file-coalescer.ts";
|
|
9
|
+
import { isActiveAsyncState, updateActiveRunIndex } from "./active-run-index.ts";
|
|
10
|
+
import { createChildTranscriptWriter, type ChildTranscriptWriter } from "../../shared/child-transcript.ts";
|
|
11
|
+
import { closeSteerInbox, consumeInterruptRequest, consumeSteerRequests, deliverInterruptRequest, deliverStopRequest, deliverTimeoutRequest, enqueueStepSteer, steerAcksDir, steerCapabilityPath, stepSteerInboxDir, watchAsyncControlInbox, type SteerAck, type SteerCapability, type SteerRequest } from "./control-channel.ts";
|
|
12
|
+
import { appendJsonl as appendRawJsonl, formatOutputArtifactContent, getArtifactPaths, writeArtifact, writeMetadata } from "../../shared/artifacts.ts";
|
|
13
|
+
import { PI_CODING_AGENT_PACKAGE, getPiSpawnCommand, resolveInstalledPiPackageRoot } from "../shared/pi-spawn.ts";
|
|
14
|
+
import { captureSingleOutputSnapshot, extractChildWrittenOutput, finalizeSingleOutput, formatSavedOutputReference, injectOutputPathSystemPrompt, injectSingleOutputInstruction, resolveSingleOutput, type SingleOutputSnapshot } from "../shared/single-output.ts";
|
|
15
|
+
import {
|
|
16
|
+
type ActivityState,
|
|
17
|
+
type ArtifactConfig,
|
|
18
|
+
type ExternalCliRunnerStatus,
|
|
19
|
+
type ExternalProcessStatus,
|
|
20
|
+
type ArtifactPaths,
|
|
21
|
+
type AsyncParallelGroupStatus,
|
|
22
|
+
type AsyncStatus,
|
|
23
|
+
type ChainOutputMap,
|
|
24
|
+
type CostSummary,
|
|
25
|
+
type LaunchResolvedChildExtensionsV1,
|
|
26
|
+
type RuntimeAcknowledgedChildExtensionsV1,
|
|
27
|
+
type ModelAttempt,
|
|
28
|
+
type NestedRouteInfo,
|
|
29
|
+
type NestedRunSummary,
|
|
30
|
+
type ResolvedControlConfig,
|
|
31
|
+
type ResolvedTurnBudget,
|
|
32
|
+
type ResolvedToolBudget,
|
|
33
|
+
type SubagentRunMode,
|
|
34
|
+
type SubagentOutputState,
|
|
35
|
+
type UsageBudgetConfig,
|
|
36
|
+
type ToolBudgetState,
|
|
37
|
+
type TurnBudgetState,
|
|
38
|
+
type Usage,
|
|
39
|
+
type WorkflowGraphSnapshot,
|
|
40
|
+
type SteeringStatus,
|
|
41
|
+
type SteeringTargetState,
|
|
42
|
+
type SteeringTargetStatus,
|
|
43
|
+
DEFAULT_MAX_OUTPUT,
|
|
44
|
+
type MaxOutputConfig,
|
|
45
|
+
SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
46
|
+
POLL_INTERVAL_MS,
|
|
47
|
+
truncateOutput,
|
|
48
|
+
getSubagentDepthEnv,
|
|
49
|
+
} from "../../shared/types.ts";
|
|
50
|
+
import {
|
|
51
|
+
DEFAULT_CONTROL_CONFIG,
|
|
52
|
+
buildControlEvent,
|
|
53
|
+
deriveActivityState,
|
|
54
|
+
claimControlNotification,
|
|
55
|
+
formatControlIntercomMessage,
|
|
56
|
+
formatControlNoticeMessage,
|
|
57
|
+
} from "../shared/subagent-control.ts";
|
|
58
|
+
import {
|
|
59
|
+
type RunnerSubagentStep as SubagentStep,
|
|
60
|
+
type RunnerStep,
|
|
61
|
+
isCheckpointRunnerStep,
|
|
62
|
+
isDynamicRunnerGroup,
|
|
63
|
+
isParallelGroup,
|
|
64
|
+
flattenSteps,
|
|
65
|
+
mapConcurrent,
|
|
66
|
+
aggregateParallelOutputs,
|
|
67
|
+
MAX_PARALLEL_CONCURRENCY,
|
|
68
|
+
DEFAULT_GLOBAL_CONCURRENCY_LIMIT,
|
|
69
|
+
Semaphore,
|
|
70
|
+
} from "../shared/parallel-utils.ts";
|
|
71
|
+
import { applyThinkingSuffix, buildPiArgs, cleanupTempDir, projectLaunchResolvedChildExtensions, resolvePiLaunchToolPlan } from "../shared/pi-args.ts";
|
|
72
|
+
import { readRuntimeAcknowledgedExtensions } from "../shared/runtime-acknowledged-extensions.ts";
|
|
73
|
+
import { outputEntryFromAsyncResult, resolveOutputReferences } from "../shared/chain-outputs.ts";
|
|
74
|
+
import { createStructuredOutputRuntime, MISSING_STRUCTURED_OUTPUT_CALL_ERROR, readStructuredOutput } from "../shared/structured-output.ts";
|
|
75
|
+
import { formatProcessSignalError, isUnexplainedProcessSignal } from "../shared/process-signal.ts";
|
|
76
|
+
import { readChildToolDiagnosticError } from "../shared/tool-availability.ts";
|
|
77
|
+
import { collectDynamicResults, DynamicFanoutError, materializeDynamicParallelStep, validateDynamicCollection } from "../shared/dynamic-fanout.ts";
|
|
78
|
+
import { nestedSummaryFromAsyncStatus, projectNestedEvents, resolveNestedAsyncDir, writeNestedEvent } from "../shared/nested-events.ts";
|
|
79
|
+
import { formatModelAttemptNote, isRetryableModelFailure } from "../shared/model-fallback.ts";
|
|
80
|
+
import {
|
|
81
|
+
SUBAGENT_STARTUP_RETRY_DELAYS_MS,
|
|
82
|
+
formatSubagentStartupRetryExhaustedError,
|
|
83
|
+
formatSubagentStartupRetryNote,
|
|
84
|
+
isRetryableSubagentStartupFailure,
|
|
85
|
+
waitForSubagentStartupRetry,
|
|
86
|
+
} from "../shared/subagent-startup-retry.ts";
|
|
87
|
+
import { markProcessTerminalCandidateLeaseRelease, writeProcessTerminalCandidate, type ProcessTerminalCandidate } from "./process-terminal.ts";
|
|
88
|
+
import { createSteeringStatus, recordSteeringRequest, steeringStatus, terminalSteeringNoticeState, updateSteeringTarget } from "./steering.ts";
|
|
89
|
+
import { attachPostExitStdioGuard, trySignalChild } from "../../shared/post-exit-stdio-guard.ts";
|
|
90
|
+
import { detectSubagentError, extractTextFromContent, extractToolArgsPreview, getFinalOutput, hasEmptyTerminalAssistantResponse, readStatus } from "../../shared/utils.ts";
|
|
91
|
+
import { evaluateCompletionMutationGuard } from "../shared/completion-guard.ts";
|
|
92
|
+
import {
|
|
93
|
+
createMutatingFailureState,
|
|
94
|
+
didMutatingToolFail,
|
|
95
|
+
isMutatingTool,
|
|
96
|
+
nextLongRunningTrigger,
|
|
97
|
+
recordMutatingFailure,
|
|
98
|
+
resetMutatingFailureState,
|
|
99
|
+
resolveCurrentPath,
|
|
100
|
+
shouldEscalateMutatingFailures,
|
|
101
|
+
summarizeRecentMutatingFailures,
|
|
102
|
+
} from "../shared/long-running-guard.ts";
|
|
103
|
+
import { parseSessionTokens } from "../../shared/session-tokens.ts";
|
|
104
|
+
import type { TokenUsage } from "../../shared/types.ts";
|
|
105
|
+
import {
|
|
106
|
+
cleanupWorktrees,
|
|
107
|
+
createWorktrees,
|
|
108
|
+
diffWorktrees,
|
|
109
|
+
findWorktreeTaskCwdConflict,
|
|
110
|
+
formatWorktreeDiffSummary,
|
|
111
|
+
formatWorktreeTaskCwdConflict,
|
|
112
|
+
type WorktreeSetup,
|
|
113
|
+
} from "../shared/worktree.ts";
|
|
114
|
+
import { resolveEffectiveThinking } from "../../shared/model-info.ts";
|
|
115
|
+
import { launchBindingDigest } from "../../shared/launch-contract.ts";
|
|
116
|
+
import { writeInitialProgressFile } from "../../shared/settings.ts";
|
|
117
|
+
import { resolveSubagentIntercomTarget } from "../../intercom/intercom-bridge.ts";
|
|
118
|
+
import { acceptanceFailureMessage, aggregateAcceptanceReport, buildSkippedAcceptanceLedger, evaluateAcceptance, formatAcceptancePrompt, resolveEffectiveAcceptance, stripAcceptanceReport } from "../shared/acceptance.ts";
|
|
119
|
+
import { attachContractProjections, isAgentContractV1 } from "../shared/agent-contract.ts";
|
|
120
|
+
import { waitForImportedAsyncRoot } from "./chain-root-attachment.ts";
|
|
121
|
+
import { appendRunnerStepsToStatus, consumeChainAppendRequests, countPendingChainAppendRequests, statusStepDescription } from "./chain-append.ts";
|
|
122
|
+
import { appendTurnBudgetSystemPrompt, formatTurnBudgetOutput, initialTurnBudgetState, turnBudgetDecision, turnBudgetDeferredNote, turnBudgetDeferredState, turnBudgetExceededMessage, turnBudgetSoftNote, turnBudgetState } from "../shared/turn-budget.ts";
|
|
123
|
+
import { initialToolBudgetState, toolBudgetState } from "../shared/tool-budget.ts";
|
|
124
|
+
import { usageBudgetExceededMessage, usageBudgetState } from "../shared/usage-budget.ts";
|
|
125
|
+
import { formatParallelHandoffError, formatParallelHandoffReference, parallelHandoffPath, writeParallelHandoffGroup, writePendingParallelHandoff } from "../shared/parallel-handoff.ts";
|
|
126
|
+
import { resolveWatchdogConfig } from "../../watchdog/settings.ts";
|
|
127
|
+
import { createBoundedByteTail, createBoundedLineReader, formatProtocolOutputLimit, MAX_CHILD_STDERR_BYTES, PI_AGGREGATE_EVENT_PROJECTOR, projectChildLifecycle, type ChildLifecycleAction, type ProtocolOutputLimit } from "../shared/child-protocol.ts";
|
|
128
|
+
import { acquireSessionLease, type SessionLeaseRequest } from "../shared/session-lease.ts";
|
|
129
|
+
import { buildExternalCliPrompt, runExternalCli } from "../shared/external-cli-runner.ts";
|
|
130
|
+
import { decodeSubagentCapabilityCeiling, SUBAGENT_CAPABILITY_CEILING_ENV, type ResolvedSubagentCapabilityCeiling } from "../shared/capability-ceiling.ts";
|
|
131
|
+
import {
|
|
132
|
+
CHILD_WATCHDOG_CONFIG_ENV,
|
|
133
|
+
acceptChildWatchdogEvent,
|
|
134
|
+
childWatchdogIsActive,
|
|
135
|
+
decodeChildWatchdogConfig,
|
|
136
|
+
isChildWatchdogStatusEvent,
|
|
137
|
+
resolveChildWatchdogConfig,
|
|
138
|
+
type ChildWatchdogStateSnapshot,
|
|
139
|
+
} from "../../watchdog/child-status.ts";
|
|
140
|
+
|
|
141
|
+
interface SubagentRunConfig {
|
|
142
|
+
id: string;
|
|
143
|
+
steps: RunnerStep[];
|
|
144
|
+
resultPath: string;
|
|
145
|
+
cwd: string;
|
|
146
|
+
placeholder: string;
|
|
147
|
+
taskIndex?: number;
|
|
148
|
+
totalTasks?: number;
|
|
149
|
+
maxOutput?: MaxOutputConfig;
|
|
150
|
+
artifactsDir?: string;
|
|
151
|
+
artifactConfig?: Partial<ArtifactConfig>;
|
|
152
|
+
share?: boolean;
|
|
153
|
+
sessionDir?: string;
|
|
154
|
+
asyncDir: string;
|
|
155
|
+
sessionId?: string | null;
|
|
156
|
+
piPackageRoot?: string;
|
|
157
|
+
piArgv1?: string;
|
|
158
|
+
worktreeSetupHook?: string;
|
|
159
|
+
worktreeSetupHookTimeoutMs?: number;
|
|
160
|
+
worktreeBaseDir?: string;
|
|
161
|
+
controlConfig?: ResolvedControlConfig;
|
|
162
|
+
controlIntercomTarget?: string;
|
|
163
|
+
childIntercomTargets?: Array<string | undefined>;
|
|
164
|
+
resultMode?: SubagentRunMode;
|
|
165
|
+
mode?: SubagentRunMode;
|
|
166
|
+
dynamicFanoutMaxItems?: number;
|
|
167
|
+
workflowGraph?: WorkflowGraphSnapshot;
|
|
168
|
+
nestedRoute?: NestedRouteInfo;
|
|
169
|
+
nestedSelf?: { parentRunId: string; parentStepIndex?: number; depth: number; path?: Array<{ runId: string; stepIndex?: number; agent?: string }> };
|
|
170
|
+
timeoutMs?: number;
|
|
171
|
+
deadlineAt?: number;
|
|
172
|
+
turnBudget?: ResolvedTurnBudget;
|
|
173
|
+
toolBudget?: ResolvedToolBudget;
|
|
174
|
+
usageBudget?: UsageBudgetConfig;
|
|
175
|
+
revivalLease?: SessionLeaseRequest;
|
|
176
|
+
revivalLeaseToken?: string;
|
|
177
|
+
/** Global cap on simultaneously-running subagent tasks within this run. */
|
|
178
|
+
globalConcurrencyLimit?: number;
|
|
179
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
180
|
+
launchContractDigest?: string;
|
|
181
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensionsV1;
|
|
182
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensionsV1;
|
|
183
|
+
runnerProcessInstanceId?: string;
|
|
184
|
+
parentWorkflowRunId?: string;
|
|
185
|
+
workflowKey?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
interface StepResult {
|
|
189
|
+
agent: string;
|
|
190
|
+
context?: "fresh" | "fork";
|
|
191
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
192
|
+
capabilityAudit?: import("../shared/capability-ceiling.ts").SubagentCapabilityAudit;
|
|
193
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensionsV1;
|
|
194
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensionsV1;
|
|
195
|
+
output: string;
|
|
196
|
+
outputState?: SubagentOutputState;
|
|
197
|
+
error?: string;
|
|
198
|
+
protocolError?: ProtocolOutputLimit;
|
|
199
|
+
success?: boolean;
|
|
200
|
+
exitCode: number | null;
|
|
201
|
+
usage?: Usage;
|
|
202
|
+
savedOutputPath?: string;
|
|
203
|
+
skipped?: boolean;
|
|
204
|
+
interrupted?: boolean;
|
|
205
|
+
timedOut?: boolean;
|
|
206
|
+
stopped?: boolean;
|
|
207
|
+
processSignal?: string | null;
|
|
208
|
+
turnBudget?: TurnBudgetState;
|
|
209
|
+
turnBudgetExceeded?: boolean;
|
|
210
|
+
wrapUpRequested?: boolean;
|
|
211
|
+
toolBudget?: ToolBudgetState;
|
|
212
|
+
toolBudgetBlocked?: boolean;
|
|
213
|
+
sessionFile?: string;
|
|
214
|
+
intercomTarget?: string;
|
|
215
|
+
model?: string;
|
|
216
|
+
attemptedModels?: string[];
|
|
217
|
+
modelAttempts?: ModelAttempt[];
|
|
218
|
+
totalCost?: CostSummary;
|
|
219
|
+
artifactPaths?: ArtifactPaths;
|
|
220
|
+
outputSaveError?: string;
|
|
221
|
+
metadataSaveError?: string;
|
|
222
|
+
truncated?: boolean;
|
|
223
|
+
transcriptPath?: string;
|
|
224
|
+
transcriptError?: string;
|
|
225
|
+
agentContract?: import("../../shared/types.ts").AgentContract;
|
|
226
|
+
launchContractDigest?: string;
|
|
227
|
+
execution?: import("../../shared/types.ts").ExecutionProjection;
|
|
228
|
+
review?: import("../../shared/types.ts").ReviewProjection;
|
|
229
|
+
effects?: import("../../shared/types.ts").EffectsProjection;
|
|
230
|
+
structuredOutput?: unknown;
|
|
231
|
+
structuredOutputPath?: string;
|
|
232
|
+
structuredOutputSchemaPath?: string;
|
|
233
|
+
acceptance?: import("../../shared/types.ts").AcceptanceLedger;
|
|
234
|
+
watchdog?: import("../../shared/types.ts").ChildWatchdogProgress;
|
|
235
|
+
writerProcesses?: Array<{ processInstanceId: string; kind: "pi-writer"; attempt: number; closeObservedAt: number; exitCode: number | null; signal: string | null }>;
|
|
236
|
+
writerAttemptCount?: number;
|
|
237
|
+
runner?: ExternalCliRunnerStatus;
|
|
238
|
+
externalProcess?: ExternalProcessStatus;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function persistStepArtifacts(input: {
|
|
242
|
+
artifactPaths: ArtifactPaths;
|
|
243
|
+
artifactConfig?: Partial<ArtifactConfig>;
|
|
244
|
+
output: string;
|
|
245
|
+
metadata: object;
|
|
246
|
+
}): { outputSaveError?: string; metadataSaveError?: string } {
|
|
247
|
+
const errors: { outputSaveError?: string; metadataSaveError?: string } = {};
|
|
248
|
+
if (input.artifactConfig?.includeOutput !== false) {
|
|
249
|
+
try {
|
|
250
|
+
writeArtifact(input.artifactPaths.outputPath, input.output);
|
|
251
|
+
} catch (error) {
|
|
252
|
+
errors.outputSaveError = `Artifact output post-processing failed: ${error instanceof Error ? error.message : String(error)}`;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (input.artifactConfig?.includeMetadata !== false) {
|
|
256
|
+
try {
|
|
257
|
+
writeMetadata(input.artifactPaths.metadataPath, input.metadata);
|
|
258
|
+
} catch (error) {
|
|
259
|
+
errors.metadataSaveError = `Artifact metadata post-processing failed: ${error instanceof Error ? error.message : String(error)}`;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return errors;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const ASYNC_INTERRUPT_SIGNAL: NodeJS.Signals = process.platform === "win32" ? "SIGBREAK" : "SIGUSR2";
|
|
266
|
+
const DEFAULT_MAX_ASYNC_EVENTS_BYTES = 50 * 1024 * 1024;
|
|
267
|
+
const ASYNC_EVENTS_MAX_BYTES_ENV = "PI_SUBAGENT_ASYNC_EVENTS_MAX_BYTES";
|
|
268
|
+
const TRUNCATED_EVENT_TYPE = "subagent.events.truncated";
|
|
269
|
+
const TRUNCATION_MARKER_RESERVE_BYTES = 512;
|
|
270
|
+
|
|
271
|
+
interface AsyncEventLogState {
|
|
272
|
+
bytes: number;
|
|
273
|
+
diagnosticsTruncated: boolean;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const asyncEventLogStates = new Map<string, AsyncEventLogState>();
|
|
277
|
+
|
|
278
|
+
function maxAsyncEventsBytes(): number {
|
|
279
|
+
const raw = process.env[ASYNC_EVENTS_MAX_BYTES_ENV];
|
|
280
|
+
if (!raw) return DEFAULT_MAX_ASYNC_EVENTS_BYTES;
|
|
281
|
+
const parsed = Number(raw);
|
|
282
|
+
if (!Number.isFinite(parsed) || parsed < 0) return DEFAULT_MAX_ASYNC_EVENTS_BYTES;
|
|
283
|
+
return Math.floor(parsed);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function eventLogState(filePath: string): AsyncEventLogState {
|
|
287
|
+
let state = asyncEventLogStates.get(filePath);
|
|
288
|
+
if (state) return state;
|
|
289
|
+
let bytes = 0;
|
|
290
|
+
try {
|
|
291
|
+
bytes = fs.statSync(filePath).size;
|
|
292
|
+
} catch (error) {
|
|
293
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") {
|
|
294
|
+
// Diagnostic event accounting is best-effort; writes below are also safe.
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
state = { bytes, diagnosticsTruncated: false };
|
|
298
|
+
asyncEventLogStates.set(filePath, state);
|
|
299
|
+
return state;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function appendJsonl(filePath: string, line: string): void {
|
|
303
|
+
try {
|
|
304
|
+
appendRawJsonl(filePath, line);
|
|
305
|
+
const state = asyncEventLogStates.get(filePath);
|
|
306
|
+
if (state) state.bytes += Buffer.byteLength(`${line}\n`, "utf-8");
|
|
307
|
+
} catch {
|
|
308
|
+
// Async event logging is diagnostic and must not fail the run.
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function appendDiagnosticJsonl(filePath: string, line: string, droppedEventType?: string): void {
|
|
313
|
+
if (!line.trim()) return;
|
|
314
|
+
const state = eventLogState(filePath);
|
|
315
|
+
if (state.diagnosticsTruncated) return;
|
|
316
|
+
const maxBytes = maxAsyncEventsBytes();
|
|
317
|
+
const chunkBytes = Buffer.byteLength(`${line}\n`, "utf-8");
|
|
318
|
+
const diagnosticBudget = Math.max(0, maxBytes - TRUNCATION_MARKER_RESERVE_BYTES);
|
|
319
|
+
if (state.bytes + chunkBytes <= diagnosticBudget) {
|
|
320
|
+
appendJsonl(filePath, line);
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
const marker = JSON.stringify({
|
|
325
|
+
type: TRUNCATED_EVENT_TYPE,
|
|
326
|
+
ts: Date.now(),
|
|
327
|
+
maxBytes,
|
|
328
|
+
droppedEventType,
|
|
329
|
+
});
|
|
330
|
+
if (state.bytes + Buffer.byteLength(`${marker}\n`, "utf-8") <= maxBytes) {
|
|
331
|
+
appendJsonl(filePath, marker);
|
|
332
|
+
}
|
|
333
|
+
state.diagnosticsTruncated = true;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function shouldPersistChildEvent(event: Record<string, unknown>): boolean {
|
|
337
|
+
return event.type !== "message_update";
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function isBlockingSupervisorTool(toolName: string | undefined, args: unknown): boolean {
|
|
341
|
+
if (!args || typeof args !== "object" || Array.isArray(args)) return false;
|
|
342
|
+
if (toolName === "contact_supervisor") {
|
|
343
|
+
const reason = (args as Record<string, unknown>).reason;
|
|
344
|
+
return reason === "need_decision" || reason === "interview_request";
|
|
345
|
+
}
|
|
346
|
+
return toolName === "intercom" && (args as Record<string, unknown>).action === "ask";
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function findLatestSessionFile(sessionDir: string): string | null {
|
|
350
|
+
try {
|
|
351
|
+
const files = fs
|
|
352
|
+
.readdirSync(sessionDir)
|
|
353
|
+
.filter((f) => f.endsWith(".jsonl"))
|
|
354
|
+
.map((f) => path.join(sessionDir, f));
|
|
355
|
+
if (files.length === 0) return null;
|
|
356
|
+
files.sort((a, b) => fs.statSync(b).mtimeMs - fs.statSync(a).mtimeMs);
|
|
357
|
+
return files[0] ?? null;
|
|
358
|
+
} catch {
|
|
359
|
+
// Session lookup is optional metadata.
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function emptyUsage(): Usage {
|
|
365
|
+
return { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0, turns: 0 };
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function tokenUsageFromAttempts(attempts: ModelAttempt[] | undefined): TokenUsage | null {
|
|
369
|
+
if (!attempts || attempts.length === 0) return null;
|
|
370
|
+
let input = 0;
|
|
371
|
+
let output = 0;
|
|
372
|
+
for (const attempt of attempts) {
|
|
373
|
+
input += attempt.usage?.input ?? 0;
|
|
374
|
+
output += attempt.usage?.output ?? 0;
|
|
375
|
+
}
|
|
376
|
+
const total = input + output;
|
|
377
|
+
return total > 0 ? { input, output, total } : null;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
function costSummaryFromAttempts(attempts: ModelAttempt[] | undefined): CostSummary | undefined {
|
|
381
|
+
if (!attempts || attempts.length === 0) return undefined;
|
|
382
|
+
let inputTokens = 0;
|
|
383
|
+
let outputTokens = 0;
|
|
384
|
+
let costUsd = 0;
|
|
385
|
+
for (const attempt of attempts) {
|
|
386
|
+
inputTokens += attempt.usage?.input ?? 0;
|
|
387
|
+
outputTokens += attempt.usage?.output ?? 0;
|
|
388
|
+
costUsd += attempt.usage?.cost ?? 0;
|
|
389
|
+
}
|
|
390
|
+
return inputTokens > 0 || outputTokens > 0 || costUsd > 0
|
|
391
|
+
? { inputTokens, outputTokens, costUsd }
|
|
392
|
+
: undefined;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
function appendRecentStepOutput(step: RunnerStatusStep, lines: string[]): void {
|
|
396
|
+
const nonEmpty = lines.filter((line) => line.trim());
|
|
397
|
+
if (nonEmpty.length === 0) return;
|
|
398
|
+
step.recentOutput ??= [];
|
|
399
|
+
step.recentOutput.push(...nonEmpty);
|
|
400
|
+
if (step.recentOutput.length > 50) {
|
|
401
|
+
step.recentOutput.splice(0, step.recentOutput.length - 50);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function assistantStartsToolCall(message: Message): boolean {
|
|
406
|
+
return Array.isArray(message.content)
|
|
407
|
+
&& message.content.some((part) => (part as { type?: string }).type === "toolCall");
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function isTerminalAssistantStop(message: Message): boolean {
|
|
411
|
+
return (message as { stopReason?: string }).stopReason === "stop" && !assistantStartsToolCall(message);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
type UndefinedOmitted<T extends object> = {
|
|
415
|
+
[K in keyof T]: Exclude<T[K], undefined>;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
function omitUndefinedProperties<const T extends object>(value: T): UndefinedOmitted<T> {
|
|
419
|
+
for (const key in value) {
|
|
420
|
+
if (value[key] === undefined) delete value[key];
|
|
421
|
+
}
|
|
422
|
+
return value as UndefinedOmitted<T>;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
type WithUndefinedOptionals<T extends object> = {
|
|
426
|
+
[K in keyof T]: {} extends Pick<T, K> ? T[K] | undefined : T[K];
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
type RequiredKeysAllowingUndefined<T extends object> = {
|
|
430
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? never : undefined extends T[K] ? K : never;
|
|
431
|
+
}[keyof T];
|
|
432
|
+
|
|
433
|
+
function compactOptional<T extends object>(
|
|
434
|
+
value: WithUndefinedOptionals<T> & (RequiredKeysAllowingUndefined<T> extends never ? unknown : never),
|
|
435
|
+
): T {
|
|
436
|
+
for (const key of Object.keys(value) as Array<keyof T>) {
|
|
437
|
+
if (value[key] === undefined) delete value[key];
|
|
438
|
+
}
|
|
439
|
+
return value as T;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function setOptionalProperty<T extends object, K extends keyof T>(target: T, key: K, value: T[K]): void {
|
|
443
|
+
if (value === undefined) delete target[key];
|
|
444
|
+
else target[key] = value;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function resetStepLiveDetail(step: RunnerStatusStep): void {
|
|
448
|
+
delete step.currentTool;
|
|
449
|
+
delete step.currentToolArgs;
|
|
450
|
+
delete step.currentToolStartedAt;
|
|
451
|
+
delete step.currentPath;
|
|
452
|
+
step.recentTools = [];
|
|
453
|
+
step.recentOutput = [];
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
interface ChildEventContext {
|
|
457
|
+
eventsPath: string;
|
|
458
|
+
runId: string;
|
|
459
|
+
stepIndex: number;
|
|
460
|
+
agent: string;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
interface ChildUsage {
|
|
464
|
+
input?: number;
|
|
465
|
+
inputTokens?: number;
|
|
466
|
+
output?: number;
|
|
467
|
+
outputTokens?: number;
|
|
468
|
+
cacheRead?: number;
|
|
469
|
+
cacheWrite?: number;
|
|
470
|
+
cost?: { total?: number };
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
type ChildMessage = Message & {
|
|
474
|
+
model?: string;
|
|
475
|
+
errorMessage?: string;
|
|
476
|
+
usage?: ChildUsage;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
interface ChildEvent {
|
|
480
|
+
type?: string;
|
|
481
|
+
message?: ChildMessage;
|
|
482
|
+
toolName?: string;
|
|
483
|
+
args?: Record<string, unknown>;
|
|
484
|
+
willRetry?: unknown;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
interface RunPiStreamingResult {
|
|
488
|
+
stderr: string;
|
|
489
|
+
exitCode: number | null;
|
|
490
|
+
messages: Message[];
|
|
491
|
+
usage: Usage;
|
|
492
|
+
toolCount: number;
|
|
493
|
+
durationMs: number;
|
|
494
|
+
model?: string;
|
|
495
|
+
error?: string;
|
|
496
|
+
protocolError?: ProtocolOutputLimit;
|
|
497
|
+
finalOutput: string;
|
|
498
|
+
outputState: SubagentOutputState;
|
|
499
|
+
interrupted?: boolean;
|
|
500
|
+
timedOut?: boolean;
|
|
501
|
+
stopped?: boolean;
|
|
502
|
+
turnBudget?: TurnBudgetState;
|
|
503
|
+
turnBudgetExceeded?: boolean;
|
|
504
|
+
wrapUpRequested?: boolean;
|
|
505
|
+
toolBudget?: ToolBudgetState;
|
|
506
|
+
toolBudgetBlocked?: boolean;
|
|
507
|
+
observedMutationAttempt?: boolean;
|
|
508
|
+
structuredOutputToolInvoked?: boolean;
|
|
509
|
+
structuredOutputMessageStartIndex?: number;
|
|
510
|
+
watchdog?: ChildWatchdogStateSnapshot;
|
|
511
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensionsV1;
|
|
512
|
+
processInstanceId: string;
|
|
513
|
+
processCloseObservedAt?: number;
|
|
514
|
+
processSignal?: string | null;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function runPiStreaming(
|
|
518
|
+
args: string[],
|
|
519
|
+
cwd: string,
|
|
520
|
+
outputFile: string,
|
|
521
|
+
env?: Record<string, string | undefined>,
|
|
522
|
+
piPackageRoot?: string,
|
|
523
|
+
piArgv1?: string,
|
|
524
|
+
maxSubagentDepth?: number,
|
|
525
|
+
childEventContext?: ChildEventContext,
|
|
526
|
+
registerInterrupt?: (interrupt: (() => void) | undefined) => void,
|
|
527
|
+
onChildEvent?: (event: ChildEvent) => void,
|
|
528
|
+
transcriptWriter?: ChildTranscriptWriter,
|
|
529
|
+
registerTimeout?: (interrupt: (() => void) | undefined) => void,
|
|
530
|
+
timeoutMessage?: string,
|
|
531
|
+
registerStop?: (stop: (() => void) | undefined) => void,
|
|
532
|
+
stopMessage?: string,
|
|
533
|
+
registerTurnBudgetAbort?: (abort: ((message: string, state?: TurnBudgetState) => void) | undefined) => void,
|
|
534
|
+
onWriterProcess?: (writer: { state: "none" | "spawning" } | { state: "running"; pid: number }) => void,
|
|
535
|
+
): Promise<RunPiStreamingResult> {
|
|
536
|
+
return new Promise((resolve) => {
|
|
537
|
+
const startedAt = Date.now();
|
|
538
|
+
const processInstanceId = randomUUID();
|
|
539
|
+
onWriterProcess?.({ state: "spawning" });
|
|
540
|
+
const outputStream = fs.createWriteStream(outputFile, { flags: "w" });
|
|
541
|
+
const spawnEnv = { ...process.env, ...(env ?? {}), ...getSubagentDepthEnv(maxSubagentDepth) };
|
|
542
|
+
const spawnSpec = getPiSpawnCommand(args, {
|
|
543
|
+
...(piPackageRoot ? { piPackageRoot } : {}),
|
|
544
|
+
...(piArgv1 ? { argv1: piArgv1 } : {}),
|
|
545
|
+
});
|
|
546
|
+
const child = spawn(spawnSpec.command, spawnSpec.args, {
|
|
547
|
+
cwd,
|
|
548
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
549
|
+
env: spawnEnv,
|
|
550
|
+
windowsHide: true,
|
|
551
|
+
});
|
|
552
|
+
const stderrTail = createBoundedByteTail();
|
|
553
|
+
const rawStdoutTail = createBoundedByteTail();
|
|
554
|
+
const messages: Message[] = [];
|
|
555
|
+
const usage = emptyUsage();
|
|
556
|
+
let model: string | undefined;
|
|
557
|
+
let writerRegistrationError: string | undefined;
|
|
558
|
+
if (typeof child.pid === "number") {
|
|
559
|
+
try {
|
|
560
|
+
onWriterProcess?.({ state: "running", pid: child.pid });
|
|
561
|
+
} catch (writerError) {
|
|
562
|
+
writerRegistrationError = `Failed to record revived Pi writer ownership: ${writerError instanceof Error ? writerError.message : String(writerError)}`;
|
|
563
|
+
trySignalChild(child, "SIGKILL");
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
let error: string | undefined = writerRegistrationError;
|
|
567
|
+
let assistantError: string | undefined;
|
|
568
|
+
let interrupted = false;
|
|
569
|
+
let timedOut = false;
|
|
570
|
+
let stopped = false;
|
|
571
|
+
let turnBudgetExceeded = false;
|
|
572
|
+
let turnBudgetMessage: string | undefined;
|
|
573
|
+
let turnBudget: TurnBudgetState | undefined;
|
|
574
|
+
let observedMutationAttempt = false;
|
|
575
|
+
let structuredOutputToolInvoked = false;
|
|
576
|
+
let structuredOutputMessageStartIndex: number | undefined;
|
|
577
|
+
let toolCount = 0;
|
|
578
|
+
const childWatchdogConfig = decodeChildWatchdogConfig(env?.[CHILD_WATCHDOG_CONFIG_ENV]);
|
|
579
|
+
let childWatchdogState: ChildWatchdogStateSnapshot | undefined;
|
|
580
|
+
let applyChildLifecycle = (_action: ChildLifecycleAction): void => {};
|
|
581
|
+
const updateChildWatchdogState = (snapshot: ChildWatchdogStateSnapshot): void => {
|
|
582
|
+
childWatchdogState = snapshot;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
const writeOutputLine = (line: string) => {
|
|
586
|
+
if (!line.trim()) return;
|
|
587
|
+
outputStream.write(`${line}\n`);
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
const writeOutputText = (text: string) => {
|
|
591
|
+
for (const line of text.split("\n")) {
|
|
592
|
+
writeOutputLine(line);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
const appendChildEvent = (event: Record<string, unknown>) => {
|
|
597
|
+
if (!childEventContext) return;
|
|
598
|
+
if (!shouldPersistChildEvent(event)) return;
|
|
599
|
+
appendDiagnosticJsonl(childEventContext.eventsPath, JSON.stringify({
|
|
600
|
+
...event,
|
|
601
|
+
subagentSource: "child",
|
|
602
|
+
subagentRunId: childEventContext.runId,
|
|
603
|
+
subagentStepIndex: childEventContext.stepIndex,
|
|
604
|
+
subagentAgent: childEventContext.agent,
|
|
605
|
+
observedAt: Date.now(),
|
|
606
|
+
}), typeof event.type === "string" ? event.type : undefined);
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
const appendChildLine = (type: "subagent.child.stdout" | "subagent.child.stderr", line: string) => {
|
|
610
|
+
appendChildEvent({ type, line });
|
|
611
|
+
if (type === "subagent.child.stdout") transcriptWriter?.writeStdoutLine(line);
|
|
612
|
+
else transcriptWriter?.writeStderrLine(line);
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
const processStdoutLine = (line: string) => {
|
|
616
|
+
if (!line.trim()) return;
|
|
617
|
+
let event: ChildEvent;
|
|
618
|
+
try {
|
|
619
|
+
event = JSON.parse(line) as ChildEvent;
|
|
620
|
+
} catch {
|
|
621
|
+
rawStdoutTail.push(`${line}\n`);
|
|
622
|
+
writeOutputLine(line);
|
|
623
|
+
appendChildLine("subagent.child.stdout", line);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
appendChildEvent(event as unknown as Record<string, unknown>);
|
|
628
|
+
transcriptWriter?.writeChildEvent(event);
|
|
629
|
+
if (event.type === "agent_settled") agentSettledReceived = true;
|
|
630
|
+
applyChildLifecycle(projectChildLifecycle(event));
|
|
631
|
+
|
|
632
|
+
if (isChildWatchdogStatusEvent(event)) {
|
|
633
|
+
if (!childWatchdogConfig) return;
|
|
634
|
+
const next = acceptChildWatchdogEvent({
|
|
635
|
+
current: childWatchdogState,
|
|
636
|
+
event,
|
|
637
|
+
...(childEventContext ? {
|
|
638
|
+
runId: childEventContext.runId,
|
|
639
|
+
agent: childEventContext.agent,
|
|
640
|
+
childIndex: childEventContext.stepIndex,
|
|
641
|
+
} : {}),
|
|
642
|
+
});
|
|
643
|
+
if (!next) return;
|
|
644
|
+
updateChildWatchdogState(next);
|
|
645
|
+
onChildEvent?.(event);
|
|
646
|
+
if (childWatchdogIsActive(next)) {
|
|
647
|
+
if (finalDrainTimer) {
|
|
648
|
+
clearTimeout(finalDrainTimer);
|
|
649
|
+
finalDrainTimer = undefined;
|
|
650
|
+
}
|
|
651
|
+
if (finalHardKillTimer) {
|
|
652
|
+
clearTimeout(finalHardKillTimer);
|
|
653
|
+
finalHardKillTimer = undefined;
|
|
654
|
+
}
|
|
655
|
+
armWatchdogTail();
|
|
656
|
+
} else {
|
|
657
|
+
clearWatchdogTailTimer();
|
|
658
|
+
if (cleanTerminalAssistantStopReceived || agentSettledReceived) startFinalDrain();
|
|
659
|
+
}
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
onChildEvent?.(event);
|
|
664
|
+
|
|
665
|
+
if (event.type === "tool_execution_start" && event.toolName) {
|
|
666
|
+
toolCount += 1;
|
|
667
|
+
if (event.toolName === "structured_output") {
|
|
668
|
+
structuredOutputToolInvoked = true;
|
|
669
|
+
structuredOutputMessageStartIndex = messages.length;
|
|
670
|
+
}
|
|
671
|
+
observedMutationAttempt = observedMutationAttempt || isMutatingTool(event.toolName, event.args);
|
|
672
|
+
const toolArgs = extractToolArgsPreview(event.args ?? {});
|
|
673
|
+
writeOutputLine(toolArgs ? `${event.toolName}: ${toolArgs}` : event.toolName);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
if ((event.type === "message_end" || event.type === "tool_result_end") && event.message) {
|
|
678
|
+
messages.push(event.message);
|
|
679
|
+
const text = extractTextFromContent(event.message.content);
|
|
680
|
+
if (text) writeOutputText(text);
|
|
681
|
+
|
|
682
|
+
if (event.type !== "message_end" || event.message.role !== "assistant") return;
|
|
683
|
+
if (event.message.model) model = event.message.model;
|
|
684
|
+
if (event.message.errorMessage) assistantError = event.message.errorMessage;
|
|
685
|
+
const eventUsage = event.message.usage;
|
|
686
|
+
if (eventUsage) {
|
|
687
|
+
usage.turns++;
|
|
688
|
+
usage.input += eventUsage.input ?? eventUsage.inputTokens ?? 0;
|
|
689
|
+
usage.output += eventUsage.output ?? eventUsage.outputTokens ?? 0;
|
|
690
|
+
usage.cacheRead += eventUsage.cacheRead ?? 0;
|
|
691
|
+
usage.cacheWrite += eventUsage.cacheWrite ?? 0;
|
|
692
|
+
usage.cost += eventUsage.cost?.total ?? 0;
|
|
693
|
+
}
|
|
694
|
+
if (isTerminalAssistantStop(event.message)) {
|
|
695
|
+
if (!event.message.errorMessage && extractTextFromContent(event.message.content).trim()) assistantError = undefined;
|
|
696
|
+
cleanTerminalAssistantStopReceived ||= !event.message.errorMessage;
|
|
697
|
+
applyChildLifecycle(projectChildLifecycle(event, true));
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
// Guard both cases that can leave the parent waiting on `close` forever:
|
|
703
|
+
// a lingering stdio holder after `exit`, or a child that never exits.
|
|
704
|
+
const FINAL_STOP_GRACE_MS = 1000;
|
|
705
|
+
const HARD_KILL_MS = 3000;
|
|
706
|
+
const TIMEOUT_HARD_KILL_MS = 3000;
|
|
707
|
+
let childExited = false;
|
|
708
|
+
let forcedTerminationSignal = false;
|
|
709
|
+
let cleanTerminalAssistantStopReceived = false;
|
|
710
|
+
let agentSettledReceived = false;
|
|
711
|
+
let finalDrainTimer: NodeJS.Timeout | undefined;
|
|
712
|
+
let finalHardKillTimer: NodeJS.Timeout | undefined;
|
|
713
|
+
let watchdogTailTimer: NodeJS.Timeout | undefined;
|
|
714
|
+
let timeoutHardKillTimer: NodeJS.Timeout | undefined;
|
|
715
|
+
let turnBudgetTerminationTimer: NodeJS.Timeout | undefined;
|
|
716
|
+
let turnBudgetHardKillTimer: NodeJS.Timeout | undefined;
|
|
717
|
+
let protocolHardKillTimer: NodeJS.Timeout | undefined;
|
|
718
|
+
let protocolError: ProtocolOutputLimit | undefined;
|
|
719
|
+
let settled = false;
|
|
720
|
+
applyChildLifecycle = (action: ChildLifecycleAction): void => {
|
|
721
|
+
if (action === "cancel-drain") {
|
|
722
|
+
if (finalDrainTimer) {
|
|
723
|
+
clearTimeout(finalDrainTimer);
|
|
724
|
+
finalDrainTimer = undefined;
|
|
725
|
+
}
|
|
726
|
+
if (finalHardKillTimer) {
|
|
727
|
+
clearTimeout(finalHardKillTimer);
|
|
728
|
+
finalHardKillTimer = undefined;
|
|
729
|
+
}
|
|
730
|
+
clearWatchdogTailTimer();
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
if (action === "start-drain") startFinalDrain();
|
|
734
|
+
};
|
|
735
|
+
const failProtocol = (limit: ProtocolOutputLimit): void => {
|
|
736
|
+
if (protocolError) return;
|
|
737
|
+
protocolError = limit;
|
|
738
|
+
error = formatProtocolOutputLimit(limit);
|
|
739
|
+
if (!childExited) {
|
|
740
|
+
trySignalChild(child, "SIGTERM");
|
|
741
|
+
protocolHardKillTimer = setTimeout(() => {
|
|
742
|
+
if (!settled) trySignalChild(child, "SIGKILL");
|
|
743
|
+
}, 3000);
|
|
744
|
+
protocolHardKillTimer.unref?.();
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
const stdoutReader = createBoundedLineReader({
|
|
748
|
+
oversizedLineProjector: PI_AGGREGATE_EVENT_PROJECTOR,
|
|
749
|
+
onLine: processStdoutLine,
|
|
750
|
+
onLimit: failProtocol,
|
|
751
|
+
});
|
|
752
|
+
const stderrReader = createBoundedLineReader({
|
|
753
|
+
stream: "stderr",
|
|
754
|
+
maxPendingLineBytes: MAX_CHILD_STDERR_BYTES,
|
|
755
|
+
onLine: (line) => appendChildLine("subagent.child.stderr", line),
|
|
756
|
+
onLimit: (limit) => appendChildLine("subagent.child.stderr", formatProtocolOutputLimit(limit)),
|
|
757
|
+
});
|
|
758
|
+
const clearStdioGuard = attachPostExitStdioGuard(child, { idleMs: 2000, hardMs: 8000 });
|
|
759
|
+
child.stdout.on("data", (chunk: Buffer) => stdoutReader.push(chunk));
|
|
760
|
+
child.stderr.on("data", (chunk: Buffer) => {
|
|
761
|
+
stderrTail.push(chunk);
|
|
762
|
+
stderrReader.push(chunk);
|
|
763
|
+
outputStream.write(chunk);
|
|
764
|
+
});
|
|
765
|
+
registerInterrupt?.(() => {
|
|
766
|
+
if (settled || timedOut || stopped) return;
|
|
767
|
+
interrupted = true;
|
|
768
|
+
if (!error) error = "Interrupted. Waiting for explicit next action.";
|
|
769
|
+
trySignalChild(child, "SIGINT");
|
|
770
|
+
setTimeout(() => {
|
|
771
|
+
if (!settled && !timedOut && !stopped) trySignalChild(child, "SIGTERM");
|
|
772
|
+
}, 1000).unref?.();
|
|
773
|
+
});
|
|
774
|
+
registerTimeout?.(() => {
|
|
775
|
+
if (settled || timedOut || stopped) return;
|
|
776
|
+
timedOut = true;
|
|
777
|
+
interrupted = false;
|
|
778
|
+
error = timeoutMessage ?? "Subagent timed out.";
|
|
779
|
+
trySignalChild(child, "SIGTERM");
|
|
780
|
+
timeoutHardKillTimer = setTimeout(() => {
|
|
781
|
+
if (!settled) trySignalChild(child, "SIGKILL");
|
|
782
|
+
}, TIMEOUT_HARD_KILL_MS);
|
|
783
|
+
timeoutHardKillTimer.unref?.();
|
|
784
|
+
});
|
|
785
|
+
registerStop?.(() => {
|
|
786
|
+
if (settled || timedOut || stopped) return;
|
|
787
|
+
stopped = true;
|
|
788
|
+
interrupted = false;
|
|
789
|
+
error = stopMessage ?? "Subagent stopped by user.";
|
|
790
|
+
trySignalChild(child, "SIGTERM");
|
|
791
|
+
timeoutHardKillTimer = setTimeout(() => {
|
|
792
|
+
if (!settled) trySignalChild(child, "SIGKILL");
|
|
793
|
+
}, TIMEOUT_HARD_KILL_MS);
|
|
794
|
+
timeoutHardKillTimer.unref?.();
|
|
795
|
+
});
|
|
796
|
+
registerTurnBudgetAbort?.((message, state) => {
|
|
797
|
+
if (settled || timedOut || stopped || turnBudgetExceeded) return;
|
|
798
|
+
turnBudgetExceeded = true;
|
|
799
|
+
turnBudgetMessage = message;
|
|
800
|
+
turnBudget = state;
|
|
801
|
+
interrupted = false;
|
|
802
|
+
error = message;
|
|
803
|
+
trySignalChild(child, "SIGINT");
|
|
804
|
+
turnBudgetTerminationTimer = setTimeout(() => {
|
|
805
|
+
if (!settled && !timedOut && !stopped) trySignalChild(child, "SIGTERM");
|
|
806
|
+
}, 1000);
|
|
807
|
+
turnBudgetTerminationTimer.unref?.();
|
|
808
|
+
turnBudgetHardKillTimer = setTimeout(() => {
|
|
809
|
+
if (!settled && !timedOut && !stopped) trySignalChild(child, "SIGKILL");
|
|
810
|
+
}, 4000);
|
|
811
|
+
turnBudgetHardKillTimer.unref?.();
|
|
812
|
+
});
|
|
813
|
+
const clearDrainTimers = () => {
|
|
814
|
+
if (finalDrainTimer) {
|
|
815
|
+
clearTimeout(finalDrainTimer);
|
|
816
|
+
finalDrainTimer = undefined;
|
|
817
|
+
}
|
|
818
|
+
if (finalHardKillTimer) {
|
|
819
|
+
clearTimeout(finalHardKillTimer);
|
|
820
|
+
finalHardKillTimer = undefined;
|
|
821
|
+
}
|
|
822
|
+
clearWatchdogTailTimer();
|
|
823
|
+
if (timeoutHardKillTimer) {
|
|
824
|
+
clearTimeout(timeoutHardKillTimer);
|
|
825
|
+
timeoutHardKillTimer = undefined;
|
|
826
|
+
}
|
|
827
|
+
if (turnBudgetTerminationTimer) {
|
|
828
|
+
clearTimeout(turnBudgetTerminationTimer);
|
|
829
|
+
turnBudgetTerminationTimer = undefined;
|
|
830
|
+
}
|
|
831
|
+
if (turnBudgetHardKillTimer) {
|
|
832
|
+
clearTimeout(turnBudgetHardKillTimer);
|
|
833
|
+
turnBudgetHardKillTimer = undefined;
|
|
834
|
+
}
|
|
835
|
+
if (protocolHardKillTimer) {
|
|
836
|
+
clearTimeout(protocolHardKillTimer);
|
|
837
|
+
protocolHardKillTimer = undefined;
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
function startFinalDrain(): void {
|
|
841
|
+
if (childWatchdogIsActive(childWatchdogState)) {
|
|
842
|
+
armWatchdogTail();
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
if (childExited || finalDrainTimer || settled) return;
|
|
846
|
+
finalDrainTimer = setTimeout(() => {
|
|
847
|
+
if (settled) return;
|
|
848
|
+
const termSent = trySignalChild(child, "SIGTERM");
|
|
849
|
+
if (!termSent) return;
|
|
850
|
+
forcedTerminationSignal = true;
|
|
851
|
+
if (!cleanTerminalAssistantStopReceived && !agentSettledReceived && !error && !assistantError) {
|
|
852
|
+
error = `Subagent process did not exit within ${FINAL_STOP_GRACE_MS}ms after its terminal event. Forcing termination.`;
|
|
853
|
+
}
|
|
854
|
+
finalHardKillTimer = setTimeout(() => {
|
|
855
|
+
if (settled) return;
|
|
856
|
+
forcedTerminationSignal = trySignalChild(child, "SIGKILL") || forcedTerminationSignal;
|
|
857
|
+
}, HARD_KILL_MS);
|
|
858
|
+
finalHardKillTimer.unref?.();
|
|
859
|
+
}, FINAL_STOP_GRACE_MS);
|
|
860
|
+
finalDrainTimer.unref?.();
|
|
861
|
+
}
|
|
862
|
+
function clearWatchdogTailTimer(): void {
|
|
863
|
+
if (watchdogTailTimer) {
|
|
864
|
+
clearTimeout(watchdogTailTimer);
|
|
865
|
+
watchdogTailTimer = undefined;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
function armWatchdogTail(): void {
|
|
869
|
+
if ((!cleanTerminalAssistantStopReceived && !agentSettledReceived) || watchdogTailTimer || settled) return;
|
|
870
|
+
watchdogTailTimer = setTimeout(() => {
|
|
871
|
+
watchdogTailTimer = undefined;
|
|
872
|
+
updateChildWatchdogState({
|
|
873
|
+
phase: "stale",
|
|
874
|
+
seq: (childWatchdogState?.seq ?? 0) + 1,
|
|
875
|
+
lastUpdate: Date.now(),
|
|
876
|
+
followUpPending: false,
|
|
877
|
+
reason: "child watchdog tail timeout",
|
|
878
|
+
timedOut: true,
|
|
879
|
+
});
|
|
880
|
+
startFinalDrain();
|
|
881
|
+
}, childWatchdogConfig?.watchdogTailTimeoutMs ?? 120_000);
|
|
882
|
+
watchdogTailTimer.unref?.();
|
|
883
|
+
}
|
|
884
|
+
child.on("exit", () => {
|
|
885
|
+
childExited = true;
|
|
886
|
+
clearDrainTimers();
|
|
887
|
+
});
|
|
888
|
+
child.on("close", (exitCode, signal) => {
|
|
889
|
+
settled = true;
|
|
890
|
+
const processCloseObservedAt = Date.now();
|
|
891
|
+
try {
|
|
892
|
+
onWriterProcess?.({ state: "none" });
|
|
893
|
+
} catch {
|
|
894
|
+
// The runner still owns and releases the lease during finalization.
|
|
895
|
+
}
|
|
896
|
+
registerInterrupt?.(undefined);
|
|
897
|
+
registerTimeout?.(undefined);
|
|
898
|
+
registerStop?.(undefined);
|
|
899
|
+
registerTurnBudgetAbort?.(undefined);
|
|
900
|
+
clearDrainTimers();
|
|
901
|
+
clearStdioGuard();
|
|
902
|
+
stdoutReader.end();
|
|
903
|
+
stderrReader.end();
|
|
904
|
+
outputStream.end();
|
|
905
|
+
const stderr = stderrTail.text();
|
|
906
|
+
const finalOutput = getFinalOutput(messages) || rawStdoutTail.text().trim();
|
|
907
|
+
const finalError = error ?? assistantError;
|
|
908
|
+
const forcedDrainAfterFinalSuccess = Boolean(forcedTerminationSignal || signal) && (cleanTerminalAssistantStopReceived || agentSettledReceived) && !finalError;
|
|
909
|
+
const signalError = isUnexplainedProcessSignal({
|
|
910
|
+
processSignal: signal,
|
|
911
|
+
interrupted,
|
|
912
|
+
timedOut,
|
|
913
|
+
stopped,
|
|
914
|
+
turnBudgetExceeded,
|
|
915
|
+
forcedDrainAfterFinalSuccess,
|
|
916
|
+
}) ? formatProcessSignalError(signal!) : undefined;
|
|
917
|
+
resolve(omitUndefinedProperties({
|
|
918
|
+
stderr,
|
|
919
|
+
exitCode: timedOut || stopped ? 1 : turnBudgetExceeded ? 1 : interrupted || forcedDrainAfterFinalSuccess ? 0 : forcedTerminationSignal || signal ? (exitCode ?? 1) : exitCode,
|
|
920
|
+
messages,
|
|
921
|
+
usage,
|
|
922
|
+
toolCount,
|
|
923
|
+
durationMs: Date.now() - startedAt,
|
|
924
|
+
model,
|
|
925
|
+
error: stopped ? (stopMessage ?? "Subagent stopped by user.") : timedOut ? (timeoutMessage ?? "Subagent timed out.") : turnBudgetExceeded ? turnBudgetMessage : interrupted || forcedDrainAfterFinalSuccess ? undefined : finalError ?? signalError,
|
|
926
|
+
protocolError,
|
|
927
|
+
finalOutput: (timedOut || stopped) && !finalOutput.trim() ? (stopped ? stopMessage ?? "Subagent stopped by user." : timeoutMessage ?? "Subagent timed out.") : finalOutput,
|
|
928
|
+
outputState: finalOutput.trim() ? "present" : "absent",
|
|
929
|
+
interrupted,
|
|
930
|
+
timedOut,
|
|
931
|
+
stopped,
|
|
932
|
+
turnBudget,
|
|
933
|
+
turnBudgetExceeded,
|
|
934
|
+
wrapUpRequested: turnBudget?.outcome === "wrap-up-requested" || turnBudget?.outcome === "termination-deferred" || turnBudgetExceeded || undefined,
|
|
935
|
+
observedMutationAttempt,
|
|
936
|
+
structuredOutputToolInvoked,
|
|
937
|
+
structuredOutputMessageStartIndex,
|
|
938
|
+
watchdog: childWatchdogState,
|
|
939
|
+
processInstanceId,
|
|
940
|
+
processCloseObservedAt,
|
|
941
|
+
processSignal: signal,
|
|
942
|
+
}));
|
|
943
|
+
});
|
|
944
|
+
|
|
945
|
+
child.on("error", (spawnError) => {
|
|
946
|
+
settled = true;
|
|
947
|
+
try {
|
|
948
|
+
onWriterProcess?.({ state: "none" });
|
|
949
|
+
} catch {
|
|
950
|
+
// The runner still owns and releases the lease during finalization.
|
|
951
|
+
}
|
|
952
|
+
registerInterrupt?.(undefined);
|
|
953
|
+
registerTimeout?.(undefined);
|
|
954
|
+
registerStop?.(undefined);
|
|
955
|
+
registerTurnBudgetAbort?.(undefined);
|
|
956
|
+
clearDrainTimers();
|
|
957
|
+
clearStdioGuard();
|
|
958
|
+
stdoutReader.end();
|
|
959
|
+
stderrReader.end();
|
|
960
|
+
outputStream.end();
|
|
961
|
+
const stderr = stderrTail.text();
|
|
962
|
+
const finalOutput = getFinalOutput(messages) || rawStdoutTail.text().trim();
|
|
963
|
+
const spawnErrorMessage = spawnError instanceof Error ? spawnError.message : String(spawnError);
|
|
964
|
+
resolve(omitUndefinedProperties({ stderr, exitCode: 1, messages, usage, toolCount, durationMs: Date.now() - startedAt, model, error: stopped ? (stopMessage ?? "Subagent stopped by user.") : timedOut ? (timeoutMessage ?? "Subagent timed out.") : turnBudgetExceeded ? turnBudgetMessage : error ?? assistantError ?? spawnErrorMessage, protocolError, finalOutput: (timedOut || stopped) && !finalOutput.trim() ? (stopped ? stopMessage ?? "Subagent stopped by user." : timeoutMessage ?? "Subagent timed out.") : finalOutput, outputState: finalOutput.trim() ? "present" : "absent", timedOut, stopped, turnBudget, turnBudgetExceeded, wrapUpRequested: turnBudget?.outcome === "wrap-up-requested" || turnBudget?.outcome === "termination-deferred" || turnBudgetExceeded || undefined, observedMutationAttempt, structuredOutputToolInvoked, structuredOutputMessageStartIndex, watchdog: childWatchdogState, processInstanceId }));
|
|
965
|
+
});
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
function resolvePiPackageRootFallback(): string {
|
|
970
|
+
const root = resolveInstalledPiPackageRoot();
|
|
971
|
+
if (root) return root;
|
|
972
|
+
throw new Error(`Could not resolve ${PI_CODING_AGENT_PACKAGE} package root`);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
async function exportSessionHtml(sessionFile: string, outputDir: string, piPackageRoot?: string): Promise<string> {
|
|
976
|
+
const pkgRoot = piPackageRoot ?? resolvePiPackageRootFallback();
|
|
977
|
+
const exportModulePath = path.join(pkgRoot, "dist", "core", "export-html", "index.js");
|
|
978
|
+
const moduleUrl = pathToFileURL(exportModulePath).href;
|
|
979
|
+
const mod = await import(moduleUrl);
|
|
980
|
+
const exportFromFile = (mod as { exportFromFile?: (inputPath: string, options?: { outputPath?: string }) => string })
|
|
981
|
+
.exportFromFile;
|
|
982
|
+
if (typeof exportFromFile !== "function") {
|
|
983
|
+
throw new Error("exportFromFile not available");
|
|
984
|
+
}
|
|
985
|
+
const outputPath = path.join(outputDir, `${path.basename(sessionFile, ".jsonl")}.html`);
|
|
986
|
+
return exportFromFile(sessionFile, { outputPath });
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
function createShareLink(htmlPath: string): { shareUrl: string; gistUrl: string } | { error: string } {
|
|
990
|
+
try {
|
|
991
|
+
const auth = spawnSync("gh", ["auth", "status"], { encoding: "utf-8" });
|
|
992
|
+
if (auth.status !== 0) {
|
|
993
|
+
return { error: "GitHub CLI is not logged in. Run 'gh auth login' first." };
|
|
994
|
+
}
|
|
995
|
+
} catch {
|
|
996
|
+
return { error: "GitHub CLI (gh) is not installed." };
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
try {
|
|
1000
|
+
const result = spawnSync("gh", ["gist", "create", htmlPath], { encoding: "utf-8" });
|
|
1001
|
+
if (result.status !== 0) {
|
|
1002
|
+
const err = (result.stderr || "").trim() || "Failed to create gist.";
|
|
1003
|
+
return { error: err };
|
|
1004
|
+
}
|
|
1005
|
+
const gistUrl = (result.stdout || "").trim();
|
|
1006
|
+
const gistId = gistUrl.split("/").pop();
|
|
1007
|
+
if (!gistId) return { error: "Failed to parse gist ID." };
|
|
1008
|
+
const shareUrl = `https://shittycodingagent.ai/session/?${gistId}`;
|
|
1009
|
+
return { shareUrl, gistUrl };
|
|
1010
|
+
} catch (err) {
|
|
1011
|
+
return { error: String(err) };
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
function formatDuration(ms: number): string {
|
|
1016
|
+
if (ms < 1000) return `${ms}ms`;
|
|
1017
|
+
if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;
|
|
1018
|
+
const minutes = Math.floor(ms / 60000);
|
|
1019
|
+
const seconds = Math.floor((ms % 60000) / 1000);
|
|
1020
|
+
return `${minutes}m${seconds}s`;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
function writeRunLog(
|
|
1024
|
+
logPath: string,
|
|
1025
|
+
input: {
|
|
1026
|
+
id: string;
|
|
1027
|
+
mode: SubagentRunMode;
|
|
1028
|
+
cwd: string;
|
|
1029
|
+
startedAt: number;
|
|
1030
|
+
endedAt: number;
|
|
1031
|
+
steps: Array<{
|
|
1032
|
+
agent: string;
|
|
1033
|
+
status: string;
|
|
1034
|
+
durationMs?: number;
|
|
1035
|
+
}>;
|
|
1036
|
+
summary: string;
|
|
1037
|
+
truncated: boolean;
|
|
1038
|
+
artifactsDir?: string;
|
|
1039
|
+
sessionFile?: string;
|
|
1040
|
+
shareUrl?: string;
|
|
1041
|
+
shareError?: string;
|
|
1042
|
+
},
|
|
1043
|
+
): void {
|
|
1044
|
+
const lines: string[] = [];
|
|
1045
|
+
lines.push(`# Subagent run ${input.id}`);
|
|
1046
|
+
lines.push("");
|
|
1047
|
+
lines.push(`- **Mode:** ${input.mode}`);
|
|
1048
|
+
lines.push(`- **CWD:** ${input.cwd}`);
|
|
1049
|
+
lines.push(`- **Started:** ${new Date(input.startedAt).toISOString()}`);
|
|
1050
|
+
lines.push(`- **Ended:** ${new Date(input.endedAt).toISOString()}`);
|
|
1051
|
+
lines.push(`- **Duration:** ${formatDuration(input.endedAt - input.startedAt)}`);
|
|
1052
|
+
if (input.sessionFile) lines.push(`- **Session:** ${input.sessionFile}`);
|
|
1053
|
+
if (input.shareUrl) lines.push(`- **Share:** ${input.shareUrl}`);
|
|
1054
|
+
if (input.shareError) lines.push(`- **Share error:** ${input.shareError}`);
|
|
1055
|
+
if (input.artifactsDir) lines.push(`- **Artifacts:** ${input.artifactsDir}`);
|
|
1056
|
+
lines.push("");
|
|
1057
|
+
lines.push("## Steps");
|
|
1058
|
+
lines.push("| Step | Agent | Status | Duration |");
|
|
1059
|
+
lines.push("| --- | --- | --- | --- |");
|
|
1060
|
+
input.steps.forEach((step, i) => {
|
|
1061
|
+
const duration = step.durationMs !== undefined ? formatDuration(step.durationMs) : "-";
|
|
1062
|
+
lines.push(`| ${i + 1} | ${step.agent} | ${step.status} | ${duration} |`);
|
|
1063
|
+
});
|
|
1064
|
+
lines.push("");
|
|
1065
|
+
lines.push("## Summary");
|
|
1066
|
+
if (input.truncated) {
|
|
1067
|
+
lines.push("_Output truncated_");
|
|
1068
|
+
lines.push("");
|
|
1069
|
+
}
|
|
1070
|
+
lines.push(input.summary.trim() || "(no output)");
|
|
1071
|
+
lines.push("");
|
|
1072
|
+
fs.writeFileSync(logPath, lines.join("\n"), "utf-8");
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
/** Context for running a single step */
|
|
1076
|
+
interface SingleStepContext {
|
|
1077
|
+
previousOutput: string;
|
|
1078
|
+
outputs?: ChainOutputMap;
|
|
1079
|
+
placeholder: string;
|
|
1080
|
+
cwd: string;
|
|
1081
|
+
sessionEnabled: boolean;
|
|
1082
|
+
sessionDir?: string;
|
|
1083
|
+
artifactsDir?: string;
|
|
1084
|
+
artifactConfig?: Partial<ArtifactConfig>;
|
|
1085
|
+
id: string;
|
|
1086
|
+
flatIndex: number;
|
|
1087
|
+
flatStepCount: number;
|
|
1088
|
+
outputFile: string;
|
|
1089
|
+
steerInboxDir?: string;
|
|
1090
|
+
steerCapabilityPath?: string;
|
|
1091
|
+
steerAckDir?: string;
|
|
1092
|
+
transcriptPath?: string;
|
|
1093
|
+
piPackageRoot?: string;
|
|
1094
|
+
piArgv1?: string;
|
|
1095
|
+
registerInterrupt?: (interrupt: (() => void) | undefined) => void;
|
|
1096
|
+
registerTimeout?: (interrupt: (() => void) | undefined) => void;
|
|
1097
|
+
registerStop?: (stop: (() => void) | undefined) => void;
|
|
1098
|
+
registerTurnBudgetAbort?: (abort: ((message: string, state?: TurnBudgetState) => void) | undefined) => void;
|
|
1099
|
+
timeoutSignal?: AbortSignal;
|
|
1100
|
+
stopSignal?: AbortSignal;
|
|
1101
|
+
timeoutMessage?: string;
|
|
1102
|
+
stopMessage?: string;
|
|
1103
|
+
turnBudget?: ResolvedTurnBudget;
|
|
1104
|
+
childIntercomTarget?: string;
|
|
1105
|
+
orchestratorIntercomTarget?: string;
|
|
1106
|
+
nestedRoute?: NestedRouteInfo;
|
|
1107
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1108
|
+
onAttemptStart?: (attempt: { model?: string; thinking?: string }) => void;
|
|
1109
|
+
onChildEvent?: (event: ChildEvent) => void;
|
|
1110
|
+
onWriterProcess?: (writer: { state: "none" | "spawning" } | { state: "running"; pid: number }) => void;
|
|
1111
|
+
onExternalProcess?: (process: ExternalProcessStatus) => void;
|
|
1112
|
+
skipAcceptance?: () => boolean;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
/** Run a single pi agent step, returning output and metadata */
|
|
1116
|
+
async function runSingleStep(
|
|
1117
|
+
step: SubagentStep,
|
|
1118
|
+
ctx: SingleStepContext,
|
|
1119
|
+
): Promise<StepResult & { completionGuardTriggered?: boolean }> {
|
|
1120
|
+
if (step.importAsyncRoot) {
|
|
1121
|
+
let importTimedOut = false;
|
|
1122
|
+
let importStopped = false;
|
|
1123
|
+
ctx.registerTimeout?.(() => {
|
|
1124
|
+
importTimedOut = true;
|
|
1125
|
+
let pid: number | undefined;
|
|
1126
|
+
try {
|
|
1127
|
+
pid = readStatus(step.importAsyncRoot!.asyncDir)?.pid;
|
|
1128
|
+
} catch {
|
|
1129
|
+
pid = undefined;
|
|
1130
|
+
}
|
|
1131
|
+
try {
|
|
1132
|
+
deliverTimeoutRequest(omitUndefinedProperties({ asyncDir: step.importAsyncRoot!.asyncDir, pid, source: "ancestor-timeout" }));
|
|
1133
|
+
} catch {
|
|
1134
|
+
// The parent runner's own timeout result is authoritative for the attached step.
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1137
|
+
ctx.registerStop?.(() => {
|
|
1138
|
+
importStopped = true;
|
|
1139
|
+
let pid: number | undefined;
|
|
1140
|
+
try {
|
|
1141
|
+
pid = readStatus(step.importAsyncRoot!.asyncDir)?.pid;
|
|
1142
|
+
} catch {
|
|
1143
|
+
pid = undefined;
|
|
1144
|
+
}
|
|
1145
|
+
try {
|
|
1146
|
+
deliverStopRequest(omitUndefinedProperties({ asyncDir: step.importAsyncRoot!.asyncDir, pid, source: "ancestor-stop" }));
|
|
1147
|
+
} catch {
|
|
1148
|
+
// The parent runner's own stopped result is authoritative for the attached step.
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
try {
|
|
1152
|
+
const imported = await waitForImportedAsyncRoot(step.importAsyncRoot, omitUndefinedProperties({
|
|
1153
|
+
shouldAbort: () => importTimedOut || importStopped || ctx.timeoutSignal?.aborted === true || ctx.stopSignal?.aborted === true || ctx.skipAcceptance?.() === true,
|
|
1154
|
+
timeoutMessage: importStopped || ctx.stopSignal?.aborted === true ? ctx.stopMessage : ctx.timeoutMessage,
|
|
1155
|
+
}));
|
|
1156
|
+
try {
|
|
1157
|
+
fs.writeFileSync(ctx.outputFile, imported.output, "utf-8");
|
|
1158
|
+
} catch {
|
|
1159
|
+
// Output files are observability only for imported roots.
|
|
1160
|
+
}
|
|
1161
|
+
const stopped = importStopped || imported.stopped === true || ctx.stopSignal?.aborted === true;
|
|
1162
|
+
const timedOut = !stopped && (importTimedOut || imported.timedOut === true || ctx.timeoutSignal?.aborted === true || ctx.skipAcceptance?.() === true);
|
|
1163
|
+
const message = stopped ? ctx.stopMessage ?? "Subagent stopped by user." : ctx.timeoutMessage ?? "Subagent timed out.";
|
|
1164
|
+
return omitUndefinedProperties({
|
|
1165
|
+
agent: imported.agent,
|
|
1166
|
+
output: timedOut || stopped ? message : imported.output,
|
|
1167
|
+
exitCode: timedOut || stopped ? 1 : imported.exitCode,
|
|
1168
|
+
error: timedOut || stopped ? message : imported.error,
|
|
1169
|
+
timedOut: timedOut ? true : undefined,
|
|
1170
|
+
stopped: stopped ? true : undefined,
|
|
1171
|
+
sessionFile: imported.sessionFile,
|
|
1172
|
+
intercomTarget: imported.intercomTarget,
|
|
1173
|
+
model: imported.model,
|
|
1174
|
+
attemptedModels: imported.attemptedModels,
|
|
1175
|
+
modelAttempts: imported.modelAttempts,
|
|
1176
|
+
totalCost: imported.totalCost,
|
|
1177
|
+
structuredOutput: timedOut || stopped ? undefined : imported.structuredOutput,
|
|
1178
|
+
structuredOutputPath: timedOut || stopped ? undefined : imported.structuredOutputPath,
|
|
1179
|
+
structuredOutputSchemaPath: timedOut || stopped ? undefined : imported.structuredOutputSchemaPath,
|
|
1180
|
+
acceptance: timedOut || stopped ? undefined : imported.acceptance,
|
|
1181
|
+
});
|
|
1182
|
+
} finally {
|
|
1183
|
+
ctx.registerTimeout?.(undefined);
|
|
1184
|
+
ctx.registerStop?.(undefined);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
const effectiveStructuredOutput = step.structuredOutput ?? (step.structuredOutputSchema
|
|
1189
|
+
? createStructuredOutputRuntime(step.structuredOutputSchema, path.join(path.dirname(ctx.outputFile), "structured-output"))
|
|
1190
|
+
: undefined);
|
|
1191
|
+
const placeholderRegex = new RegExp(ctx.placeholder.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g");
|
|
1192
|
+
let task = step.task.replace(placeholderRegex, () => ctx.previousOutput);
|
|
1193
|
+
if (ctx.outputs) task = resolveOutputReferences(task, ctx.outputs);
|
|
1194
|
+
const taskForCompletionGuard = task;
|
|
1195
|
+
if (step.effectiveAcceptance) {
|
|
1196
|
+
const acceptancePrompt = formatAcceptancePrompt(step.effectiveAcceptance, { reportOptional: isAgentContractV1(step.agentContract) });
|
|
1197
|
+
if (acceptancePrompt) task = `${task}\n${acceptancePrompt}`;
|
|
1198
|
+
}
|
|
1199
|
+
const sessionEnabled = Boolean(step.sessionFile) || ctx.sessionEnabled;
|
|
1200
|
+
const sessionDir = step.sessionFile ? undefined : ctx.sessionDir;
|
|
1201
|
+
|
|
1202
|
+
let artifactPaths: ArtifactPaths | undefined;
|
|
1203
|
+
let transcriptWriter: ChildTranscriptWriter | undefined;
|
|
1204
|
+
if (ctx.artifactsDir && ctx.artifactConfig?.enabled !== false) {
|
|
1205
|
+
const index = ctx.flatStepCount > 1 ? ctx.flatIndex : undefined;
|
|
1206
|
+
artifactPaths = getArtifactPaths(ctx.artifactsDir, ctx.id, step.agent, index);
|
|
1207
|
+
fs.mkdirSync(ctx.artifactsDir, { recursive: true });
|
|
1208
|
+
if (ctx.artifactConfig?.includeInput !== false) {
|
|
1209
|
+
fs.writeFileSync(artifactPaths.inputPath, `# Task for ${step.agent}\n\n${task}`, "utf-8");
|
|
1210
|
+
}
|
|
1211
|
+
if (ctx.artifactConfig?.includeTranscript !== false) {
|
|
1212
|
+
transcriptWriter = createChildTranscriptWriter({
|
|
1213
|
+
transcriptPath: artifactPaths.transcriptPath,
|
|
1214
|
+
source: "async",
|
|
1215
|
+
runId: ctx.id,
|
|
1216
|
+
agent: step.agent,
|
|
1217
|
+
childIndex: ctx.flatIndex,
|
|
1218
|
+
cwd: step.cwd ?? ctx.cwd,
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
transcriptWriter?.writeInitialUserMessage(task);
|
|
1223
|
+
|
|
1224
|
+
if (step.runner?.type === "external-cli") {
|
|
1225
|
+
const runner: ExternalCliRunnerStatus = {
|
|
1226
|
+
type: "external-cli",
|
|
1227
|
+
command: step.runner.command,
|
|
1228
|
+
args: step.runner.args ?? [],
|
|
1229
|
+
promptDelivery: step.runner.promptDelivery ?? "stdin",
|
|
1230
|
+
capabilities: { stop: true, steer: false, resume: false, structuredOutput: false, toolEvents: false },
|
|
1231
|
+
};
|
|
1232
|
+
const outputSnapshot = captureSingleOutputSnapshot(step.outputPath);
|
|
1233
|
+
const external = await runExternalCli(omitUndefinedProperties({
|
|
1234
|
+
command: runner.command,
|
|
1235
|
+
args: runner.args,
|
|
1236
|
+
cwd: step.cwd ?? ctx.cwd,
|
|
1237
|
+
prompt: buildExternalCliPrompt(step.systemPrompt ?? "", task),
|
|
1238
|
+
asyncDir: path.dirname(ctx.outputFile),
|
|
1239
|
+
stepIndex: ctx.flatIndex,
|
|
1240
|
+
registerTimeout: ctx.registerTimeout,
|
|
1241
|
+
registerStop: ctx.registerStop,
|
|
1242
|
+
timeoutMessage: ctx.timeoutMessage,
|
|
1243
|
+
stopMessage: ctx.stopMessage,
|
|
1244
|
+
onProcess: ctx.onExternalProcess,
|
|
1245
|
+
}));
|
|
1246
|
+
try { fs.writeFileSync(ctx.outputFile, external.output, "utf-8"); } catch { /* Observability output is best-effort. */ }
|
|
1247
|
+
const resolvedOutput = step.outputPath && external.exitCode === 0
|
|
1248
|
+
? resolveSingleOutput(step.outputPath, external.output, outputSnapshot)
|
|
1249
|
+
: { fullOutput: external.output };
|
|
1250
|
+
const outputReference = resolvedOutput.savedPath ? formatSavedOutputReference(resolvedOutput.savedPath, resolvedOutput.fullOutput) : undefined;
|
|
1251
|
+
const finalizedOutput = finalizeSingleOutput(omitUndefinedProperties({
|
|
1252
|
+
fullOutput: resolvedOutput.fullOutput,
|
|
1253
|
+
outputPath: step.outputPath,
|
|
1254
|
+
outputMode: step.outputMode,
|
|
1255
|
+
exitCode: external.exitCode ?? 1,
|
|
1256
|
+
savedPath: resolvedOutput.savedPath,
|
|
1257
|
+
outputReference,
|
|
1258
|
+
saveError: resolvedOutput.saveError,
|
|
1259
|
+
}));
|
|
1260
|
+
const artifactErrors = artifactPaths && ctx.artifactConfig?.enabled !== false
|
|
1261
|
+
? persistStepArtifacts({
|
|
1262
|
+
artifactPaths,
|
|
1263
|
+
artifactConfig: ctx.artifactConfig,
|
|
1264
|
+
output: formatOutputArtifactContent(omitUndefinedProperties({ output: resolvedOutput.fullOutput, error: external.error, metadataPath: ctx.artifactConfig?.includeMetadata === false ? undefined : artifactPaths.metadataPath })),
|
|
1265
|
+
metadata: { runId: ctx.id, agent: step.agent, task, runner, externalProcess: external.externalProcess, exitCode: external.exitCode, error: external.error, timestamp: Date.now() },
|
|
1266
|
+
})
|
|
1267
|
+
: {};
|
|
1268
|
+
return omitUndefinedProperties({
|
|
1269
|
+
agent: step.agent,
|
|
1270
|
+
context: step.context,
|
|
1271
|
+
output: finalizedOutput.displayOutput,
|
|
1272
|
+
outputState: external.output.trim() ? "present" : "absent",
|
|
1273
|
+
exitCode: external.exitCode,
|
|
1274
|
+
error: external.error,
|
|
1275
|
+
timedOut: external.timedOut,
|
|
1276
|
+
stopped: external.stopped,
|
|
1277
|
+
processSignal: external.processSignal,
|
|
1278
|
+
artifactPaths,
|
|
1279
|
+
outputSaveError: artifactErrors.outputSaveError,
|
|
1280
|
+
metadataSaveError: artifactErrors.metadataSaveError,
|
|
1281
|
+
runner,
|
|
1282
|
+
externalProcess: external.externalProcess,
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
const candidates = step.modelCandidates && step.modelCandidates.length > 0
|
|
1287
|
+
? step.modelCandidates
|
|
1288
|
+
: step.model
|
|
1289
|
+
? [step.model]
|
|
1290
|
+
: [undefined];
|
|
1291
|
+
const attemptedModels: string[] = [];
|
|
1292
|
+
let capabilityAudit: import("../shared/capability-ceiling.ts").SubagentCapabilityAudit | undefined;
|
|
1293
|
+
let launchResolvedExtensions = step.launchResolvedExtensions;
|
|
1294
|
+
const modelAttempts: ModelAttempt[] = [];
|
|
1295
|
+
const writerProcesses: Array<{ processInstanceId: string; kind: "pi-writer"; attempt: number; closeObservedAt: number; exitCode: number | null; signal: string | null }> = [];
|
|
1296
|
+
let writerAttemptCount = 0;
|
|
1297
|
+
const attemptNotes: string[] = [];
|
|
1298
|
+
const eventsPath = path.join(path.dirname(ctx.outputFile), "events.jsonl");
|
|
1299
|
+
let finalResult: RunPiStreamingResult | undefined;
|
|
1300
|
+
let finalOutputSnapshot: SingleOutputSnapshot | undefined;
|
|
1301
|
+
let completionGuardTriggeredFinal = false;
|
|
1302
|
+
let turnBudget = ctx.turnBudget ? initialTurnBudgetState(ctx.turnBudget) : undefined;
|
|
1303
|
+
let toolBudget = step.toolBudget ? initialToolBudgetState(step.toolBudget) : undefined;
|
|
1304
|
+
let toolBudgetBlocked = false;
|
|
1305
|
+
let actualLaunchContractDigest = step.launchContractDigest;
|
|
1306
|
+
|
|
1307
|
+
let modelIndex = 0;
|
|
1308
|
+
let startupAttemptIndex = 0;
|
|
1309
|
+
modelAttemptsLoop: while (modelIndex < candidates.length) {
|
|
1310
|
+
if (ctx.timeoutSignal?.aborted || ctx.stopSignal?.aborted || ctx.skipAcceptance?.()) break;
|
|
1311
|
+
const candidate = candidates[modelIndex];
|
|
1312
|
+
ctx.onAttemptStart?.(omitUndefinedProperties({ model: candidate, thinking: resolveEffectiveThinking(candidate, step.thinking) }));
|
|
1313
|
+
const outputSnapshot = captureSingleOutputSnapshot(step.outputPath);
|
|
1314
|
+
if (effectiveStructuredOutput) {
|
|
1315
|
+
try {
|
|
1316
|
+
if (fs.existsSync(effectiveStructuredOutput.outputPath)) fs.unlinkSync(effectiveStructuredOutput.outputPath);
|
|
1317
|
+
} catch {
|
|
1318
|
+
// Missing/stale structured-output files are handled after the child exits.
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
const watchdogConfig = resolveWatchdogConfig(step.cwd ?? ctx.cwd);
|
|
1322
|
+
const childWatchdog = watchdogConfig.ok
|
|
1323
|
+
? resolveChildWatchdogConfig({
|
|
1324
|
+
config: watchdogConfig.config,
|
|
1325
|
+
agent: step.agent,
|
|
1326
|
+
runId: ctx.id,
|
|
1327
|
+
childIndex: ctx.flatIndex,
|
|
1328
|
+
})
|
|
1329
|
+
: undefined;
|
|
1330
|
+
const { args, env, tempDir, toolDiagnosticPath, runtimeAcknowledgedExtensionsPath, capabilityAudit: attemptCapabilityAudit } = buildPiArgs(omitUndefinedProperties({
|
|
1331
|
+
parentSessionId: step.parentSessionId,
|
|
1332
|
+
baseArgs: ["--mode", "json", "-p"],
|
|
1333
|
+
task,
|
|
1334
|
+
sessionEnabled,
|
|
1335
|
+
sessionDir,
|
|
1336
|
+
sessionFile: step.sessionFile,
|
|
1337
|
+
model: candidate,
|
|
1338
|
+
inheritProjectContext: step.inheritProjectContext,
|
|
1339
|
+
inheritSkills: step.inheritSkills,
|
|
1340
|
+
requireReadTool: Boolean(step.skills?.length),
|
|
1341
|
+
tools: step.tools,
|
|
1342
|
+
extensions: step.extensions,
|
|
1343
|
+
subagentOnlyExtensions: step.subagentOnlyExtensions,
|
|
1344
|
+
systemPrompt: appendTurnBudgetSystemPrompt(step.systemPrompt ?? "", ctx.turnBudget),
|
|
1345
|
+
systemPromptMode: step.systemPromptMode,
|
|
1346
|
+
mcpDirectTools: step.mcpDirectTools,
|
|
1347
|
+
capabilityCeiling: step.capabilityCeiling ?? ctx.capabilityCeiling,
|
|
1348
|
+
cwd: step.cwd ?? ctx.cwd,
|
|
1349
|
+
promptFileStem: step.agent,
|
|
1350
|
+
intercomSessionName: ctx.childIntercomTarget,
|
|
1351
|
+
orchestratorIntercomTarget: ctx.orchestratorIntercomTarget,
|
|
1352
|
+
runId: ctx.id,
|
|
1353
|
+
childAgentName: step.agent,
|
|
1354
|
+
childIndex: ctx.flatIndex,
|
|
1355
|
+
parentEventSink: ctx.nestedRoute?.eventSink,
|
|
1356
|
+
parentControlInbox: ctx.nestedRoute?.controlInbox,
|
|
1357
|
+
parentRootRunId: ctx.nestedRoute?.rootRunId,
|
|
1358
|
+
parentCapabilityToken: ctx.nestedRoute?.capabilityToken,
|
|
1359
|
+
steerInboxDir: ctx.steerInboxDir,
|
|
1360
|
+
steerCapabilityPath: ctx.steerCapabilityPath,
|
|
1361
|
+
steerAckDir: ctx.steerAckDir,
|
|
1362
|
+
structuredOutput: effectiveStructuredOutput,
|
|
1363
|
+
toolBudget: step.toolBudget,
|
|
1364
|
+
permissionRules: step.permissionRules,
|
|
1365
|
+
permissionAuditPath: step.permissionRules && ctx.artifactsDir
|
|
1366
|
+
? path.join(ctx.artifactsDir, "permission-audit", `${ctx.id}-${ctx.flatIndex}.jsonl`)
|
|
1367
|
+
: undefined,
|
|
1368
|
+
childWatchdog,
|
|
1369
|
+
waitToolEnabled: step.waitToolEnabled,
|
|
1370
|
+
}));
|
|
1371
|
+
if (step.definitionDigest) {
|
|
1372
|
+
const toolPlan = resolvePiLaunchToolPlan(omitUndefinedProperties({
|
|
1373
|
+
tools: step.tools,
|
|
1374
|
+
extensions: step.extensions,
|
|
1375
|
+
subagentOnlyExtensions: step.subagentOnlyExtensions,
|
|
1376
|
+
mcpDirectTools: step.mcpDirectTools,
|
|
1377
|
+
cwd: step.cwd ?? ctx.cwd,
|
|
1378
|
+
requireReadTool: Boolean(step.skills?.length),
|
|
1379
|
+
structuredOutput: Boolean(effectiveStructuredOutput),
|
|
1380
|
+
capabilityCeiling: step.capabilityCeiling ?? ctx.capabilityCeiling,
|
|
1381
|
+
inheritedCapabilityCeiling: decodeSubagentCapabilityCeiling(process.env[SUBAGENT_CAPABILITY_CEILING_ENV]),
|
|
1382
|
+
}));
|
|
1383
|
+
launchResolvedExtensions = projectLaunchResolvedChildExtensions(toolPlan);
|
|
1384
|
+
actualLaunchContractDigest = launchBindingDigest(omitUndefinedProperties({
|
|
1385
|
+
definitionDigest: step.definitionDigest,
|
|
1386
|
+
task: step.launchBindingTask ?? task,
|
|
1387
|
+
...(candidate ? { model: candidate } : {}),
|
|
1388
|
+
modelCandidates: candidates as string[],
|
|
1389
|
+
...(resolveEffectiveThinking(candidate, step.thinking) ? { thinking: resolveEffectiveThinking(candidate, step.thinking) } : {}),
|
|
1390
|
+
systemPrompt: appendTurnBudgetSystemPrompt(step.systemPrompt ?? "", ctx.turnBudget),
|
|
1391
|
+
systemPromptMode: step.systemPromptMode,
|
|
1392
|
+
inheritProjectContext: step.inheritProjectContext,
|
|
1393
|
+
inheritSkills: step.inheritSkills,
|
|
1394
|
+
skills: step.skills,
|
|
1395
|
+
tools: toolPlan.effectiveToolAllowlist,
|
|
1396
|
+
extensions: toolPlan.extensionArgs,
|
|
1397
|
+
mcpDirectTools: toolPlan.effectiveMcpTools,
|
|
1398
|
+
...(step.outputPath ? { outputPath: step.outputPath } : {}),
|
|
1399
|
+
...(step.outputMode ? { outputMode: step.outputMode } : {}),
|
|
1400
|
+
...(step.structuredOutputSchema ? { structuredOutputSchema: step.structuredOutputSchema } : {}),
|
|
1401
|
+
}));
|
|
1402
|
+
}
|
|
1403
|
+
capabilityAudit = attemptCapabilityAudit;
|
|
1404
|
+
writerAttemptCount += 1;
|
|
1405
|
+
const run = await runPiStreaming(
|
|
1406
|
+
args,
|
|
1407
|
+
step.cwd ?? ctx.cwd,
|
|
1408
|
+
ctx.outputFile,
|
|
1409
|
+
env,
|
|
1410
|
+
ctx.piPackageRoot,
|
|
1411
|
+
ctx.piArgv1,
|
|
1412
|
+
step.maxSubagentDepth,
|
|
1413
|
+
{ eventsPath, runId: ctx.id, stepIndex: ctx.flatIndex, agent: step.agent },
|
|
1414
|
+
ctx.registerInterrupt,
|
|
1415
|
+
ctx.onChildEvent,
|
|
1416
|
+
transcriptWriter,
|
|
1417
|
+
ctx.registerTimeout,
|
|
1418
|
+
ctx.timeoutMessage,
|
|
1419
|
+
ctx.registerStop,
|
|
1420
|
+
ctx.stopMessage,
|
|
1421
|
+
ctx.registerTurnBudgetAbort,
|
|
1422
|
+
ctx.onWriterProcess,
|
|
1423
|
+
);
|
|
1424
|
+
if (run.processCloseObservedAt !== undefined) {
|
|
1425
|
+
writerProcesses.push({
|
|
1426
|
+
processInstanceId: run.processInstanceId,
|
|
1427
|
+
kind: "pi-writer",
|
|
1428
|
+
attempt: writerAttemptCount - 1,
|
|
1429
|
+
closeObservedAt: run.processCloseObservedAt,
|
|
1430
|
+
exitCode: run.exitCode,
|
|
1431
|
+
signal: run.processSignal ?? null,
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
if (run.turnBudget) turnBudget = run.turnBudget;
|
|
1435
|
+
else if (ctx.turnBudget) {
|
|
1436
|
+
const assistantMessages = run.messages.filter((message) => message.role === "assistant");
|
|
1437
|
+
const turnCount = assistantMessages.length;
|
|
1438
|
+
const lastAssistantMessage = assistantMessages.at(-1);
|
|
1439
|
+
if (turnCount > 0 && turnCount < ctx.turnBudget.maxTurns) {
|
|
1440
|
+
turnBudget = { ...ctx.turnBudget, outcome: "within-budget", turnCount };
|
|
1441
|
+
} else if (turnCount >= ctx.turnBudget.maxTurns) {
|
|
1442
|
+
const decision = turnBudgetDecision(
|
|
1443
|
+
ctx.turnBudget,
|
|
1444
|
+
turnCount,
|
|
1445
|
+
lastAssistantMessage ? isTerminalAssistantStop(lastAssistantMessage) : false,
|
|
1446
|
+
lastAssistantMessage ? assistantStartsToolCall(lastAssistantMessage) : false,
|
|
1447
|
+
);
|
|
1448
|
+
turnBudget = decision === "defer"
|
|
1449
|
+
? turnBudgetDeferredState(ctx.turnBudget, turnCount)
|
|
1450
|
+
: turnBudgetState(ctx.turnBudget, turnCount, decision === "abort");
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
const toolAvailabilityError = run.exitCode === 0 && !run.error
|
|
1454
|
+
? readChildToolDiagnosticError(toolDiagnosticPath)
|
|
1455
|
+
: undefined;
|
|
1456
|
+
const runtimeAcknowledgedExtensions = readRuntimeAcknowledgedExtensions(runtimeAcknowledgedExtensionsPath);
|
|
1457
|
+
cleanupTempDir(tempDir);
|
|
1458
|
+
|
|
1459
|
+
let structuredOutput: unknown;
|
|
1460
|
+
let structuredError: string | undefined;
|
|
1461
|
+
let validatedStructuredOutput = false;
|
|
1462
|
+
if (effectiveStructuredOutput && run.exitCode === 0 && !run.error && !toolAvailabilityError) {
|
|
1463
|
+
if (!run.structuredOutputToolInvoked) {
|
|
1464
|
+
structuredError = MISSING_STRUCTURED_OUTPUT_CALL_ERROR;
|
|
1465
|
+
} else {
|
|
1466
|
+
const structured = await readStructuredOutput({
|
|
1467
|
+
schema: effectiveStructuredOutput.schema,
|
|
1468
|
+
schemaPath: effectiveStructuredOutput.schemaPath,
|
|
1469
|
+
outputPath: effectiveStructuredOutput.outputPath,
|
|
1470
|
+
});
|
|
1471
|
+
if (structured.error) structuredError = structured.error;
|
|
1472
|
+
else {
|
|
1473
|
+
structuredOutput = structured.value;
|
|
1474
|
+
validatedStructuredOutput = true;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
const errorMessages = validatedStructuredOutput
|
|
1479
|
+
? run.messages.slice(run.structuredOutputMessageStartIndex ?? run.messages.length)
|
|
1480
|
+
: run.messages;
|
|
1481
|
+
const hiddenError = run.exitCode === 0 && !run.error && !toolAvailabilityError && !structuredError
|
|
1482
|
+
? detectSubagentError(errorMessages)
|
|
1483
|
+
: null;
|
|
1484
|
+
const emptyOutputError = run.exitCode === 0
|
|
1485
|
+
&& !run.error
|
|
1486
|
+
&& !toolAvailabilityError
|
|
1487
|
+
&& !structuredError
|
|
1488
|
+
&& !run.finalOutput.trim()
|
|
1489
|
+
&& !validatedStructuredOutput
|
|
1490
|
+
&& (!hiddenError?.hasError || hasEmptyTerminalAssistantResponse(run.messages))
|
|
1491
|
+
? "Subagent produced no output (possible model cold-start or empty response)."
|
|
1492
|
+
: undefined;
|
|
1493
|
+
const completionGuardEnabled = isAgentContractV1(step.agentContract) ? step.completionGuard === true : step.completionGuard !== false;
|
|
1494
|
+
const completionGuard = run.exitCode === 0 && !run.error && !toolAvailabilityError && !structuredError && !hiddenError?.hasError && !emptyOutputError && completionGuardEnabled
|
|
1495
|
+
? evaluateCompletionMutationGuard(omitUndefinedProperties({
|
|
1496
|
+
agent: step.agent,
|
|
1497
|
+
task: taskForCompletionGuard,
|
|
1498
|
+
messages: run.messages,
|
|
1499
|
+
tools: step.tools,
|
|
1500
|
+
mcpDirectTools: step.mcpDirectTools,
|
|
1501
|
+
}))
|
|
1502
|
+
: undefined;
|
|
1503
|
+
const completionGuardTriggered = completionGuard?.triggered === true && !run.observedMutationAttempt;
|
|
1504
|
+
const fileMutationEffect = completionGuard
|
|
1505
|
+
? {
|
|
1506
|
+
status: completionGuard.expectedMutation ? completionGuardTriggered ? "missing" as const : "observed" as const : "not-applicable" as const,
|
|
1507
|
+
expected: completionGuard.expectedMutation,
|
|
1508
|
+
attempted: completionGuard.attemptedMutation || run.observedMutationAttempt === true,
|
|
1509
|
+
...(completionGuardTriggered ? { message: "Subagent completed without making edits for an implementation task." } : {}),
|
|
1510
|
+
}
|
|
1511
|
+
: undefined;
|
|
1512
|
+
const completionGuardError = completionGuardTriggered && !isAgentContractV1(step.agentContract)
|
|
1513
|
+
? "Subagent completed without making edits for an implementation task.\nIt appears to have returned planning or scratchpad output instead of applying changes."
|
|
1514
|
+
: undefined;
|
|
1515
|
+
const effectiveExitCode = toolAvailabilityError || (completionGuardTriggered && !isAgentContractV1(step.agentContract)) || structuredError || emptyOutputError
|
|
1516
|
+
? 1
|
|
1517
|
+
: hiddenError?.hasError
|
|
1518
|
+
? (hiddenError.exitCode ?? 1)
|
|
1519
|
+
: run.error && run.exitCode === 0
|
|
1520
|
+
? 1
|
|
1521
|
+
: run.exitCode;
|
|
1522
|
+
const signalError = run.exitCode !== 0 && isUnexplainedProcessSignal(omitUndefinedProperties({
|
|
1523
|
+
processSignal: run.processSignal,
|
|
1524
|
+
interrupted: run.interrupted,
|
|
1525
|
+
timedOut: run.timedOut,
|
|
1526
|
+
stopped: run.stopped,
|
|
1527
|
+
turnBudgetExceeded: run.turnBudgetExceeded,
|
|
1528
|
+
})) ? formatProcessSignalError(run.processSignal!) : undefined;
|
|
1529
|
+
const error = toolAvailabilityError
|
|
1530
|
+
?? completionGuardError
|
|
1531
|
+
?? structuredError
|
|
1532
|
+
?? emptyOutputError
|
|
1533
|
+
?? (hiddenError?.hasError
|
|
1534
|
+
? hiddenError.details
|
|
1535
|
+
? `${hiddenError.errorType} failed (exit ${effectiveExitCode}): ${hiddenError.details}`
|
|
1536
|
+
: `${hiddenError.errorType} failed with exit code ${effectiveExitCode}`
|
|
1537
|
+
: run.error || signalError || (run.exitCode !== 0 && run.stderr.trim() ? run.stderr.trim() : undefined));
|
|
1538
|
+
const attempt: ModelAttempt = omitUndefinedProperties({
|
|
1539
|
+
model: candidate ?? run.model ?? step.model ?? "default",
|
|
1540
|
+
success: effectiveExitCode === 0 && !error,
|
|
1541
|
+
exitCode: effectiveExitCode,
|
|
1542
|
+
error,
|
|
1543
|
+
usage: run.usage,
|
|
1544
|
+
});
|
|
1545
|
+
modelAttempts.push(attempt);
|
|
1546
|
+
if (candidate && startupAttemptIndex === 0) attemptedModels.push(candidate);
|
|
1547
|
+
completionGuardTriggeredFinal = completionGuardTriggered;
|
|
1548
|
+
finalOutputSnapshot = outputSnapshot;
|
|
1549
|
+
if (step.toolBudget) {
|
|
1550
|
+
const toolMessages = run.messages.filter((message) => message.role === "toolResult");
|
|
1551
|
+
const blockedMessage = toolMessages.find((message) => extractTextFromContent(message.content).includes("Tool budget hard limit reached"));
|
|
1552
|
+
toolBudgetBlocked = Boolean(blockedMessage);
|
|
1553
|
+
toolBudget = toolBudgetState(step.toolBudget, toolMessages.length, blockedMessage ? (blockedMessage as { toolName?: string }).toolName : undefined);
|
|
1554
|
+
}
|
|
1555
|
+
finalResult = { ...run, exitCode: effectiveExitCode, model: candidate ?? run.model, error, structuredOutput, runtimeAcknowledgedExtensions, ...(step.agentContract ? { agentContract: step.agentContract } : {}), ...(fileMutationEffect ? { effects: { fileMutation: fileMutationEffect } } : {}) } as RunPiStreamingResult & { structuredOutput?: unknown; agentContract?: import("../../shared/types.ts").AgentContract; effects?: import("../../shared/types.ts").EffectsProjection };
|
|
1556
|
+
if (run.turnBudgetExceeded) break modelAttemptsLoop;
|
|
1557
|
+
if (run.stopped || run.timedOut || ctx.timeoutSignal?.aborted || ctx.stopSignal?.aborted || ctx.skipAcceptance?.()) break modelAttemptsLoop;
|
|
1558
|
+
if (attempt.success || completionGuardTriggered) break modelAttemptsLoop;
|
|
1559
|
+
|
|
1560
|
+
const startupFailure = isRetryableSubagentStartupFailure(omitUndefinedProperties({
|
|
1561
|
+
exitCode: effectiveExitCode,
|
|
1562
|
+
error,
|
|
1563
|
+
finalOutput: run.finalOutput,
|
|
1564
|
+
messageCount: run.messages.length,
|
|
1565
|
+
toolCount: run.toolCount,
|
|
1566
|
+
usage: run.usage,
|
|
1567
|
+
durationMs: run.durationMs,
|
|
1568
|
+
protocolError: run.protocolError,
|
|
1569
|
+
processSignal: run.processSignal,
|
|
1570
|
+
observedMutationAttempt: run.observedMutationAttempt,
|
|
1571
|
+
interrupted: run.interrupted,
|
|
1572
|
+
timedOut: run.timedOut,
|
|
1573
|
+
stopped: run.stopped,
|
|
1574
|
+
turnBudgetExceeded: run.turnBudgetExceeded,
|
|
1575
|
+
}));
|
|
1576
|
+
const retryDelayMs = SUBAGENT_STARTUP_RETRY_DELAYS_MS[startupAttemptIndex];
|
|
1577
|
+
if (startupFailure && retryDelayMs !== undefined) {
|
|
1578
|
+
const retryNote = formatSubagentStartupRetryNote({
|
|
1579
|
+
model: attempt.model,
|
|
1580
|
+
attempt: startupAttemptIndex + 1,
|
|
1581
|
+
maxAttempts: SUBAGENT_STARTUP_RETRY_DELAYS_MS.length + 1,
|
|
1582
|
+
delayMs: retryDelayMs,
|
|
1583
|
+
});
|
|
1584
|
+
const shouldRetry = await waitForSubagentStartupRetry(retryDelayMs, [ctx.timeoutSignal, ctx.stopSignal]);
|
|
1585
|
+
if (!shouldRetry || ctx.skipAcceptance?.()) break modelAttemptsLoop;
|
|
1586
|
+
attempt.error = retryNote;
|
|
1587
|
+
attemptNotes.push(retryNote);
|
|
1588
|
+
startupAttemptIndex += 1;
|
|
1589
|
+
continue;
|
|
1590
|
+
}
|
|
1591
|
+
if (startupFailure) {
|
|
1592
|
+
const startupError = formatSubagentStartupRetryExhaustedError({
|
|
1593
|
+
model: attempt.model,
|
|
1594
|
+
attempts: startupAttemptIndex + 1,
|
|
1595
|
+
});
|
|
1596
|
+
attempt.error = startupError;
|
|
1597
|
+
finalResult.error = startupError;
|
|
1598
|
+
finalResult.finalOutput = startupError;
|
|
1599
|
+
break modelAttemptsLoop;
|
|
1600
|
+
}
|
|
1601
|
+
if (!isRetryableModelFailure(error) || modelIndex === candidates.length - 1) break modelAttemptsLoop;
|
|
1602
|
+
attemptNotes.push(formatModelAttemptNote(attempt, candidates[modelIndex + 1]));
|
|
1603
|
+
modelIndex += 1;
|
|
1604
|
+
startupAttemptIndex = 0;
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
const rawOutput = finalResult?.finalOutput ?? "";
|
|
1608
|
+
const outputForPersistence = stripAcceptanceReport(rawOutput);
|
|
1609
|
+
const resolvedOutput = step.outputPath && finalResult?.exitCode === 0
|
|
1610
|
+
? resolveSingleOutput(step.outputPath, outputForPersistence, finalOutputSnapshot)
|
|
1611
|
+
: { fullOutput: outputForPersistence };
|
|
1612
|
+
const output = stripAcceptanceReport(resolvedOutput.fullOutput);
|
|
1613
|
+
const outputReference = resolvedOutput.savedPath ? formatSavedOutputReference(resolvedOutput.savedPath, output) : undefined;
|
|
1614
|
+
let outputForSummary = output;
|
|
1615
|
+
if (attemptNotes.length > 0) {
|
|
1616
|
+
outputForSummary = `${attemptNotes.join("\n")}\n\n${outputForSummary}`.trim();
|
|
1617
|
+
}
|
|
1618
|
+
if (finalResult?.stopped && !outputForSummary.trim()) {
|
|
1619
|
+
outputForSummary = ctx.stopMessage ?? "Subagent stopped by user.";
|
|
1620
|
+
} else if (!finalResult?.timedOut && !finalResult?.stopped && finalResult?.turnBudgetExceeded && turnBudget) {
|
|
1621
|
+
outputForSummary = formatTurnBudgetOutput(turnBudgetExceededMessage(turnBudget, turnBudget.turnCount), outputForSummary);
|
|
1622
|
+
} else if (!finalResult?.timedOut && !finalResult?.stopped && turnBudget?.outcome === "termination-deferred") {
|
|
1623
|
+
const note = turnBudgetDeferredNote(turnBudget, turnBudget.terminationDeferredAtTurn ?? turnBudget.turnCount);
|
|
1624
|
+
outputForSummary = outputForSummary.trim() ? `${note}\n\n${outputForSummary}` : note;
|
|
1625
|
+
} else if (!finalResult?.timedOut && !finalResult?.stopped && turnBudget?.outcome === "wrap-up-requested") {
|
|
1626
|
+
const note = turnBudgetSoftNote(turnBudget, turnBudget.wrapUpRequestedAtTurn ?? turnBudget.turnCount);
|
|
1627
|
+
outputForSummary = outputForSummary.trim() ? `${note}\n\n${outputForSummary}` : note;
|
|
1628
|
+
}
|
|
1629
|
+
const outputForAcceptance = rawOutput;
|
|
1630
|
+
const childWrittenOutput = step.outputPath
|
|
1631
|
+
? extractChildWrittenOutput(finalResult?.messages, step.outputPath, step.cwd ?? ctx.cwd)
|
|
1632
|
+
: undefined;
|
|
1633
|
+
const outputState: SubagentOutputState = finalResult?.outputState === "present"
|
|
1634
|
+
|| (finalResult as (RunPiStreamingResult & { structuredOutput?: unknown }) | undefined)?.structuredOutput !== undefined
|
|
1635
|
+
|| Boolean(childWrittenOutput?.trim())
|
|
1636
|
+
? "present"
|
|
1637
|
+
: resolvedOutput.savedPath
|
|
1638
|
+
? "unknown"
|
|
1639
|
+
: finalResult?.outputState ?? "unknown";
|
|
1640
|
+
const finalizedOutput = finalizeSingleOutput(omitUndefinedProperties({
|
|
1641
|
+
fullOutput: outputForSummary,
|
|
1642
|
+
outputPath: step.outputPath,
|
|
1643
|
+
outputMode: step.outputMode,
|
|
1644
|
+
exitCode: finalResult?.exitCode ?? 1,
|
|
1645
|
+
savedPath: resolvedOutput.savedPath,
|
|
1646
|
+
outputReference,
|
|
1647
|
+
saveError: resolvedOutput.saveError,
|
|
1648
|
+
}));
|
|
1649
|
+
outputForSummary = finalizedOutput.displayOutput;
|
|
1650
|
+
const acceptance = step.effectiveAcceptance && !finalResult?.stopped && !finalResult?.turnBudgetExceeded && !ctx.timeoutSignal?.aborted && !ctx.stopSignal?.aborted && !ctx.skipAcceptance?.()
|
|
1651
|
+
? await evaluateAcceptance(omitUndefinedProperties({
|
|
1652
|
+
acceptance: step.effectiveAcceptance,
|
|
1653
|
+
output: outputForAcceptance,
|
|
1654
|
+
fileOutput: childWrittenOutput !== undefined && step.outputPath
|
|
1655
|
+
? { content: childWrittenOutput, path: step.outputPath, authoritative: step.outputMode === "file-only" }
|
|
1656
|
+
: undefined,
|
|
1657
|
+
cwd: step.cwd ?? ctx.cwd,
|
|
1658
|
+
signal: combinedAbortSignal([ctx.timeoutSignal, ctx.stopSignal]),
|
|
1659
|
+
abortMessage: ctx.stopSignal?.aborted ? ctx.stopMessage ?? "Subagent stopped by user." : ctx.timeoutMessage ?? "Subagent timed out.",
|
|
1660
|
+
reportOptional: isAgentContractV1(step.agentContract),
|
|
1661
|
+
artifactsDir: ctx.artifactsDir,
|
|
1662
|
+
runId: ctx.id,
|
|
1663
|
+
}))
|
|
1664
|
+
: undefined;
|
|
1665
|
+
const stoppedAfterAcceptance = finalResult?.stopped === true || ctx.stopSignal?.aborted === true;
|
|
1666
|
+
const timedOutAfterAcceptance = !stoppedAfterAcceptance && (finalResult?.timedOut === true || ctx.timeoutSignal?.aborted === true);
|
|
1667
|
+
const turnBudgetExceeded = finalResult?.turnBudgetExceeded === true;
|
|
1668
|
+
const effectiveAcceptance = step.effectiveAcceptance
|
|
1669
|
+
? stoppedAfterAcceptance
|
|
1670
|
+
? buildSkippedAcceptanceLedger(step.effectiveAcceptance, { id: "stopped", message: "Acceptance was not evaluated because the subagent was stopped." })
|
|
1671
|
+
: timedOutAfterAcceptance
|
|
1672
|
+
? buildSkippedAcceptanceLedger(step.effectiveAcceptance, { id: "timeout", message: "Acceptance was not evaluated because the subagent timed out." })
|
|
1673
|
+
: turnBudgetExceeded
|
|
1674
|
+
? buildSkippedAcceptanceLedger(step.effectiveAcceptance, { id: "turn-budget", message: "Acceptance was not evaluated because the subagent exceeded its turn budget." })
|
|
1675
|
+
: acceptance
|
|
1676
|
+
: undefined;
|
|
1677
|
+
const acceptanceFailure = effectiveAcceptance ? acceptanceFailureMessage(effectiveAcceptance) : undefined;
|
|
1678
|
+
const acceptanceCanFailRun = acceptanceFailure && effectiveAcceptance?.explicit && (finalResult?.exitCode ?? 1) === 0 && !finalResult?.interrupted && !timedOutAfterAcceptance && !stoppedAfterAcceptance && !turnBudgetExceeded && !isAgentContractV1(step.agentContract);
|
|
1679
|
+
const effectiveFinalExitCode = timedOutAfterAcceptance || stoppedAfterAcceptance || turnBudgetExceeded ? 1 : acceptanceCanFailRun ? 1 : finalResult?.exitCode ?? 1;
|
|
1680
|
+
const effectiveFinalError = stoppedAfterAcceptance
|
|
1681
|
+
? ctx.stopMessage ?? "Subagent stopped by user."
|
|
1682
|
+
: timedOutAfterAcceptance
|
|
1683
|
+
? ctx.timeoutMessage ?? "Subagent timed out."
|
|
1684
|
+
: turnBudgetExceeded
|
|
1685
|
+
? finalResult?.error ?? (turnBudget ? turnBudgetExceededMessage(turnBudget, turnBudget.turnCount) : "Subagent exceeded turn budget.")
|
|
1686
|
+
: acceptanceCanFailRun
|
|
1687
|
+
? (finalResult?.error ? `${finalResult.error}\n${acceptanceFailure}` : acceptanceFailure)
|
|
1688
|
+
: finalResult?.error;
|
|
1689
|
+
|
|
1690
|
+
const artifactErrors = artifactPaths && ctx.artifactConfig?.enabled !== false
|
|
1691
|
+
? persistStepArtifacts({
|
|
1692
|
+
artifactPaths,
|
|
1693
|
+
artifactConfig: ctx.artifactConfig,
|
|
1694
|
+
output: formatOutputArtifactContent(omitUndefinedProperties({
|
|
1695
|
+
output,
|
|
1696
|
+
error: effectiveFinalError,
|
|
1697
|
+
transcriptPath: transcriptWriter ? artifactPaths.transcriptPath : undefined,
|
|
1698
|
+
metadataPath: ctx.artifactConfig?.includeMetadata === false ? undefined : artifactPaths.metadataPath,
|
|
1699
|
+
})),
|
|
1700
|
+
metadata: {
|
|
1701
|
+
runId: ctx.id,
|
|
1702
|
+
agent: step.agent,
|
|
1703
|
+
task,
|
|
1704
|
+
exitCode: effectiveFinalExitCode,
|
|
1705
|
+
model: finalResult?.model,
|
|
1706
|
+
attemptedModels: attemptedModels.length > 0 ? attemptedModels : undefined,
|
|
1707
|
+
modelAttempts,
|
|
1708
|
+
error: effectiveFinalError,
|
|
1709
|
+
acceptance: effectiveAcceptance,
|
|
1710
|
+
...(capabilityAudit ? { capabilityCeiling: capabilityAudit.ceiling, capabilityAudit } : {}),
|
|
1711
|
+
launchContractDigest: actualLaunchContractDigest,
|
|
1712
|
+
launchResolvedExtensions,
|
|
1713
|
+
...((finalResult as (RunPiStreamingResult & { runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensionsV1 }) | undefined)?.runtimeAcknowledgedExtensions ? { runtimeAcknowledgedExtensions: (finalResult as RunPiStreamingResult & { runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensionsV1 }).runtimeAcknowledgedExtensions } : {}),
|
|
1714
|
+
...(transcriptWriter ? { transcriptPath: artifactPaths.transcriptPath } : {}),
|
|
1715
|
+
transcriptError: transcriptWriter?.getError(),
|
|
1716
|
+
skills: step.skills,
|
|
1717
|
+
timestamp: Date.now(),
|
|
1718
|
+
},
|
|
1719
|
+
})
|
|
1720
|
+
: {};
|
|
1721
|
+
|
|
1722
|
+
const result: StepResult & { completionGuardTriggered?: boolean } = omitUndefinedProperties({
|
|
1723
|
+
agent: step.agent,
|
|
1724
|
+
context: step.context,
|
|
1725
|
+
...(step.agentContract ? { agentContract: step.agentContract } : {}),
|
|
1726
|
+
launchContractDigest: actualLaunchContractDigest,
|
|
1727
|
+
output: outputForSummary,
|
|
1728
|
+
outputState,
|
|
1729
|
+
exitCode: effectiveFinalExitCode,
|
|
1730
|
+
error: effectiveFinalError,
|
|
1731
|
+
protocolError: finalResult?.protocolError,
|
|
1732
|
+
sessionFile: step.sessionFile,
|
|
1733
|
+
intercomTarget: ctx.childIntercomTarget,
|
|
1734
|
+
model: finalResult?.model,
|
|
1735
|
+
attemptedModels: attemptedModels.length > 0 ? attemptedModels : undefined,
|
|
1736
|
+
modelAttempts,
|
|
1737
|
+
totalCost: costSummaryFromAttempts(modelAttempts),
|
|
1738
|
+
artifactPaths,
|
|
1739
|
+
outputSaveError: artifactErrors.outputSaveError,
|
|
1740
|
+
metadataSaveError: artifactErrors.metadataSaveError,
|
|
1741
|
+
transcriptPath: transcriptWriter ? artifactPaths?.transcriptPath : undefined,
|
|
1742
|
+
transcriptError: transcriptWriter?.getError(),
|
|
1743
|
+
interrupted: timedOutAfterAcceptance || stoppedAfterAcceptance || turnBudgetExceeded ? false : finalResult?.interrupted,
|
|
1744
|
+
timedOut: timedOutAfterAcceptance ? true : finalResult?.timedOut,
|
|
1745
|
+
stopped: stoppedAfterAcceptance ? true : finalResult?.stopped,
|
|
1746
|
+
processSignal: finalResult?.processSignal,
|
|
1747
|
+
turnBudget,
|
|
1748
|
+
turnBudgetExceeded: turnBudgetExceeded || undefined,
|
|
1749
|
+
wrapUpRequested: finalResult?.wrapUpRequested || turnBudget?.outcome === "wrap-up-requested" || turnBudget?.outcome === "termination-deferred" || turnBudgetExceeded || undefined,
|
|
1750
|
+
toolBudget,
|
|
1751
|
+
toolBudgetBlocked: toolBudgetBlocked || undefined,
|
|
1752
|
+
completionGuardTriggered: completionGuardTriggeredFinal,
|
|
1753
|
+
...((finalResult as (RunPiStreamingResult & { effects?: import("../../shared/types.ts").EffectsProjection }) | undefined)?.effects ? { effects: (finalResult as RunPiStreamingResult & { effects?: import("../../shared/types.ts").EffectsProjection }).effects } : {}),
|
|
1754
|
+
structuredOutput: timedOutAfterAcceptance || stoppedAfterAcceptance || turnBudgetExceeded ? undefined : (finalResult as (RunPiStreamingResult & { structuredOutput?: unknown }) | undefined)?.structuredOutput,
|
|
1755
|
+
structuredOutputPath: timedOutAfterAcceptance || stoppedAfterAcceptance || turnBudgetExceeded ? undefined : effectiveStructuredOutput?.outputPath,
|
|
1756
|
+
structuredOutputSchemaPath: timedOutAfterAcceptance || stoppedAfterAcceptance || turnBudgetExceeded ? undefined : effectiveStructuredOutput?.schemaPath,
|
|
1757
|
+
acceptance: effectiveAcceptance,
|
|
1758
|
+
watchdog: finalResult?.watchdog,
|
|
1759
|
+
...(capabilityAudit ? { capabilityCeiling: capabilityAudit.ceiling, capabilityAudit } : {}),
|
|
1760
|
+
launchResolvedExtensions,
|
|
1761
|
+
...((finalResult as (RunPiStreamingResult & { runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensionsV1 }) | undefined)?.runtimeAcknowledgedExtensions ? { runtimeAcknowledgedExtensions: (finalResult as RunPiStreamingResult & { runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensionsV1 }).runtimeAcknowledgedExtensions } : {}),
|
|
1762
|
+
writerProcesses,
|
|
1763
|
+
writerAttemptCount,
|
|
1764
|
+
});
|
|
1765
|
+
return isAgentContractV1(step.agentContract) ? attachContractProjections(result as unknown as import("../../shared/types.ts").SingleResult) as unknown as typeof result : result;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
type RunnerStatusStep = NonNullable<AsyncStatus["steps"]>[number] & {
|
|
1769
|
+
exitCode?: number | null;
|
|
1770
|
+
description?: string;
|
|
1771
|
+
};
|
|
1772
|
+
|
|
1773
|
+
function externalRunnerStatus(runner: SubagentStep["runner"]): ExternalCliRunnerStatus | undefined {
|
|
1774
|
+
if (runner?.type !== "external-cli") return undefined;
|
|
1775
|
+
return {
|
|
1776
|
+
type: "external-cli",
|
|
1777
|
+
command: runner.command,
|
|
1778
|
+
args: runner.args ?? [],
|
|
1779
|
+
promptDelivery: runner.promptDelivery ?? "stdin",
|
|
1780
|
+
capabilities: { stop: true, steer: false, resume: false, structuredOutput: false, toolEvents: false },
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
function appendCapabilityCeilingAppliedEvent(eventsPath: string, runId: string, stepIndex: number, agent: string, result: StepResult): void {
|
|
1785
|
+
if (!result.capabilityCeiling) return;
|
|
1786
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
1787
|
+
type: "subagent.capability-ceiling.applied",
|
|
1788
|
+
ts: Date.now(),
|
|
1789
|
+
runId,
|
|
1790
|
+
stepIndex,
|
|
1791
|
+
agent,
|
|
1792
|
+
capabilityCeiling: result.capabilityCeiling,
|
|
1793
|
+
...(result.capabilityAudit ? { capabilityAudit: result.capabilityAudit } : {}),
|
|
1794
|
+
}));
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
type RunnerStatusPayload = Omit<AsyncStatus, "steps" | "parallelGroups" | "pid" | "cwd" | "currentStep" | "chainStepCount" | "lastUpdate"> & {
|
|
1798
|
+
pid: number;
|
|
1799
|
+
cwd: string;
|
|
1800
|
+
currentStep: number;
|
|
1801
|
+
chainStepCount: number;
|
|
1802
|
+
parallelGroups: AsyncParallelGroupStatus[];
|
|
1803
|
+
steps: RunnerStatusStep[];
|
|
1804
|
+
lastUpdate: number;
|
|
1805
|
+
artifactsDir?: string;
|
|
1806
|
+
shareUrl?: string;
|
|
1807
|
+
gistUrl?: string;
|
|
1808
|
+
shareError?: string;
|
|
1809
|
+
error?: string;
|
|
1810
|
+
};
|
|
1811
|
+
|
|
1812
|
+
function requiredStatusStep(statusPayload: RunnerStatusPayload, index: number): RunnerStatusStep {
|
|
1813
|
+
const step = statusPayload.steps[index];
|
|
1814
|
+
if (!step) throw new Error(`Missing status step at index ${index}`);
|
|
1815
|
+
return step;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
function markParallelGroupSetupFailure(input: {
|
|
1819
|
+
statusPayload: RunnerStatusPayload;
|
|
1820
|
+
results: StepResult[];
|
|
1821
|
+
group: Extract<RunnerStep, { parallel: SubagentStep[] }>;
|
|
1822
|
+
groupStartFlatIndex: number;
|
|
1823
|
+
setupError: string;
|
|
1824
|
+
failedAt: number;
|
|
1825
|
+
statusPath: string;
|
|
1826
|
+
eventsPath: string;
|
|
1827
|
+
asyncDir: string;
|
|
1828
|
+
runId: string;
|
|
1829
|
+
stepIndex: number;
|
|
1830
|
+
}): void {
|
|
1831
|
+
for (let taskIndex = 0; taskIndex < input.group.parallel.length; taskIndex++) {
|
|
1832
|
+
const flatTaskIndex = input.groupStartFlatIndex + taskIndex;
|
|
1833
|
+
const statusStep = requiredStatusStep(input.statusPayload, flatTaskIndex);
|
|
1834
|
+
const task = input.group.parallel[taskIndex];
|
|
1835
|
+
if (!task) throw new Error(`Missing parallel task at index ${taskIndex}`);
|
|
1836
|
+
statusStep.status = "failed";
|
|
1837
|
+
statusStep.startedAt = input.failedAt;
|
|
1838
|
+
statusStep.endedAt = input.failedAt;
|
|
1839
|
+
statusStep.durationMs = 0;
|
|
1840
|
+
statusStep.exitCode = 1;
|
|
1841
|
+
input.results.push(omitUndefinedProperties({ agent: task.agent, context: task.context, output: input.setupError, success: false, exitCode: 1, sessionFile: task.sessionFile }));
|
|
1842
|
+
}
|
|
1843
|
+
input.statusPayload.currentStep = input.groupStartFlatIndex;
|
|
1844
|
+
input.statusPayload.lastUpdate = input.failedAt;
|
|
1845
|
+
input.statusPayload.outputFile = path.join(input.asyncDir, `output-${input.groupStartFlatIndex}.log`);
|
|
1846
|
+
writeAtomicJson(input.statusPath, input.statusPayload);
|
|
1847
|
+
appendJsonl(input.eventsPath, JSON.stringify({
|
|
1848
|
+
type: "subagent.parallel.completed",
|
|
1849
|
+
ts: input.failedAt,
|
|
1850
|
+
runId: input.runId,
|
|
1851
|
+
stepIndex: input.stepIndex,
|
|
1852
|
+
success: false,
|
|
1853
|
+
}));
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
function markParallelGroupRunning(input: {
|
|
1857
|
+
statusPayload: RunnerStatusPayload;
|
|
1858
|
+
group: Extract<RunnerStep, { parallel: SubagentStep[] }>;
|
|
1859
|
+
groupStartFlatIndex: number;
|
|
1860
|
+
groupStartTime: number;
|
|
1861
|
+
statusPath: string;
|
|
1862
|
+
eventsPath: string;
|
|
1863
|
+
asyncDir: string;
|
|
1864
|
+
runId: string;
|
|
1865
|
+
stepIndex: number;
|
|
1866
|
+
}): void {
|
|
1867
|
+
for (let taskIndex = 0; taskIndex < input.group.parallel.length; taskIndex++) {
|
|
1868
|
+
const flatTaskIndex = input.groupStartFlatIndex + taskIndex;
|
|
1869
|
+
const statusStep = requiredStatusStep(input.statusPayload, flatTaskIndex);
|
|
1870
|
+
statusStep.status = "pending";
|
|
1871
|
+
delete statusStep.startedAt;
|
|
1872
|
+
delete statusStep.endedAt;
|
|
1873
|
+
delete statusStep.durationMs;
|
|
1874
|
+
delete statusStep.lastActivityAt;
|
|
1875
|
+
delete statusStep.activityState;
|
|
1876
|
+
delete statusStep.error;
|
|
1877
|
+
}
|
|
1878
|
+
input.statusPayload.currentStep = input.groupStartFlatIndex;
|
|
1879
|
+
delete input.statusPayload.activityState;
|
|
1880
|
+
input.statusPayload.lastActivityAt = input.groupStartTime;
|
|
1881
|
+
input.statusPayload.lastUpdate = input.groupStartTime;
|
|
1882
|
+
input.statusPayload.outputFile = path.join(input.asyncDir, `output-${input.groupStartFlatIndex}.log`);
|
|
1883
|
+
writeAtomicJson(input.statusPath, input.statusPayload);
|
|
1884
|
+
appendJsonl(input.eventsPath, JSON.stringify({
|
|
1885
|
+
type: "subagent.parallel.started",
|
|
1886
|
+
ts: input.groupStartTime,
|
|
1887
|
+
runId: input.runId,
|
|
1888
|
+
stepIndex: input.stepIndex,
|
|
1889
|
+
agents: input.group.parallel.map((task) => task.agent),
|
|
1890
|
+
count: input.group.parallel.length,
|
|
1891
|
+
}));
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
function prepareParallelTaskRun(
|
|
1895
|
+
task: SubagentStep,
|
|
1896
|
+
cwd: string,
|
|
1897
|
+
worktreeSetup: WorktreeSetup | undefined,
|
|
1898
|
+
taskIndex: number,
|
|
1899
|
+
): { taskForRun: SubagentStep; taskCwd: string } {
|
|
1900
|
+
if (!worktreeSetup) return { taskForRun: task, taskCwd: cwd };
|
|
1901
|
+
const { cwd: _taskCwd, ...taskForRun } = task;
|
|
1902
|
+
return {
|
|
1903
|
+
taskForRun,
|
|
1904
|
+
taskCwd: worktreeSetup.worktrees[taskIndex]!.agentCwd,
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
function captureParallelWorktreeDiffs(
|
|
1909
|
+
worktreeSetup: WorktreeSetup,
|
|
1910
|
+
asyncDir: string,
|
|
1911
|
+
stepIndex: number,
|
|
1912
|
+
group: Extract<RunnerStep, { parallel: SubagentStep[] }>,
|
|
1913
|
+
): { diffs: ReturnType<typeof diffWorktrees>; summary: string } {
|
|
1914
|
+
const diffsDir = path.join(asyncDir, "worktree-diffs", `step-${stepIndex}`);
|
|
1915
|
+
const diffs = diffWorktrees(worktreeSetup, group.parallel.map((task) => task.agent), diffsDir);
|
|
1916
|
+
return { diffs, summary: formatWorktreeDiffSummary(diffs) };
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
function ensureParallelProgressFile(cwd: string, group: Extract<RunnerStep, { parallel: SubagentStep[] }>): void {
|
|
1920
|
+
const progressPath = path.join(cwd, "progress.md");
|
|
1921
|
+
if (!group.parallel.some((task) => task.task.includes(`Update progress at: ${progressPath}`))) return;
|
|
1922
|
+
writeInitialProgressFile(cwd);
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
function resolveAsyncStepTranscriptPath(input: {
|
|
1926
|
+
artifactsDir?: string;
|
|
1927
|
+
artifactConfig?: Partial<ArtifactConfig>;
|
|
1928
|
+
runId: string;
|
|
1929
|
+
agent: string;
|
|
1930
|
+
flatIndex: number;
|
|
1931
|
+
flatStepCount: number;
|
|
1932
|
+
}): string | undefined {
|
|
1933
|
+
if (!input.artifactsDir || input.artifactConfig?.enabled === false || input.artifactConfig?.includeTranscript === false) return undefined;
|
|
1934
|
+
return getArtifactPaths(
|
|
1935
|
+
input.artifactsDir,
|
|
1936
|
+
input.runId,
|
|
1937
|
+
input.agent,
|
|
1938
|
+
input.flatStepCount > 1 ? input.flatIndex : undefined,
|
|
1939
|
+
).transcriptPath;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
type SingleStepResult = Awaited<ReturnType<typeof runSingleStep>>;
|
|
1943
|
+
|
|
1944
|
+
function combinedAbortSignal(signals: Array<AbortSignal | undefined>): AbortSignal | undefined {
|
|
1945
|
+
const activeSignals = signals.filter((signal): signal is AbortSignal => Boolean(signal));
|
|
1946
|
+
if (activeSignals.length === 0) return undefined;
|
|
1947
|
+
if (activeSignals.length === 1) return activeSignals[0];
|
|
1948
|
+
const controller = new AbortController();
|
|
1949
|
+
const abort = (): void => controller.abort();
|
|
1950
|
+
for (const signal of activeSignals) {
|
|
1951
|
+
if (signal.aborted) {
|
|
1952
|
+
abort();
|
|
1953
|
+
break;
|
|
1954
|
+
}
|
|
1955
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
1956
|
+
}
|
|
1957
|
+
return controller.signal;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
async function runSingleStepWithTimeout(
|
|
1961
|
+
step: SubagentStep,
|
|
1962
|
+
ctx: SingleStepContext,
|
|
1963
|
+
parentDeadlineAt?: number,
|
|
1964
|
+
): Promise<SingleStepResult> {
|
|
1965
|
+
if (step.timeoutMs === undefined) return runSingleStep(step, ctx);
|
|
1966
|
+
|
|
1967
|
+
const parentRemainingMs = parentDeadlineAt === undefined ? undefined : Math.max(0, parentDeadlineAt - Date.now());
|
|
1968
|
+
const timeoutMs = parentRemainingMs === undefined ? step.timeoutMs : Math.min(step.timeoutMs, parentRemainingMs);
|
|
1969
|
+
const timeoutMessage = parentRemainingMs !== undefined && parentRemainingMs <= step.timeoutMs
|
|
1970
|
+
? ctx.timeoutMessage
|
|
1971
|
+
: `Subagent timed out after ${step.timeoutMs}ms.`;
|
|
1972
|
+
const timeoutController = new AbortController();
|
|
1973
|
+
let timeoutAction: (() => void) | undefined;
|
|
1974
|
+
let timeoutTriggered = false;
|
|
1975
|
+
const triggerTimeout = (): void => {
|
|
1976
|
+
if (timeoutTriggered) return;
|
|
1977
|
+
timeoutTriggered = true;
|
|
1978
|
+
timeoutController.abort();
|
|
1979
|
+
timeoutAction?.();
|
|
1980
|
+
};
|
|
1981
|
+
const registerTimeout = (action: (() => void) | undefined): void => {
|
|
1982
|
+
timeoutAction = action;
|
|
1983
|
+
ctx.registerTimeout?.(action ? triggerTimeout : undefined);
|
|
1984
|
+
if (action && timeoutTriggered) action();
|
|
1985
|
+
};
|
|
1986
|
+
const timer = setTimeout(triggerTimeout, timeoutMs);
|
|
1987
|
+
timer.unref?.();
|
|
1988
|
+
try {
|
|
1989
|
+
return await runSingleStep(step, {
|
|
1990
|
+
...ctx,
|
|
1991
|
+
registerTimeout,
|
|
1992
|
+
timeoutSignal: combinedAbortSignal([ctx.timeoutSignal, timeoutController.signal]),
|
|
1993
|
+
timeoutMessage,
|
|
1994
|
+
});
|
|
1995
|
+
} finally {
|
|
1996
|
+
clearTimeout(timer);
|
|
1997
|
+
ctx.registerTimeout?.(undefined);
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
async function runSubagent(
|
|
2002
|
+
config: SubagentRunConfig,
|
|
2003
|
+
onWriterProcess?: (writer: { state: "none" | "spawning" } | { state: "running"; pid: number }) => void,
|
|
2004
|
+
): Promise<void> {
|
|
2005
|
+
const { id, steps, resultPath, cwd, placeholder, taskIndex, totalTasks, maxOutput, artifactsDir, artifactConfig } =
|
|
2006
|
+
config;
|
|
2007
|
+
const globalSemaphore = new Semaphore(config.globalConcurrencyLimit ?? DEFAULT_GLOBAL_CONCURRENCY_LIMIT);
|
|
2008
|
+
let previousOutput = "";
|
|
2009
|
+
const outputs: ChainOutputMap = {};
|
|
2010
|
+
const results: StepResult[] = [];
|
|
2011
|
+
const overallStartTime = Date.now();
|
|
2012
|
+
const shareEnabled = config.share === true;
|
|
2013
|
+
const asyncDir = config.asyncDir;
|
|
2014
|
+
const statusPath = path.join(asyncDir, "status.json");
|
|
2015
|
+
const eventsPath = path.join(asyncDir, "events.jsonl");
|
|
2016
|
+
const logPath = path.join(asyncDir, `subagent-log-${id}.md`);
|
|
2017
|
+
const controlConfig = config.controlConfig ?? DEFAULT_CONTROL_CONFIG;
|
|
2018
|
+
const activeChildInterrupts = new Map<number, () => void>();
|
|
2019
|
+
const activeChildTimeouts = new Map<number, () => void>();
|
|
2020
|
+
const activeChildStops = new Map<number, () => void>();
|
|
2021
|
+
const activeChildTurnBudgetAborts = new Map<number, (message: string, state?: TurnBudgetState) => void>();
|
|
2022
|
+
const pendingStepSteers: SteerRequest[] = [];
|
|
2023
|
+
const steeringCapabilities = new Map<number, SteerCapability>();
|
|
2024
|
+
let interrupted = false;
|
|
2025
|
+
let currentActivityState: ActivityState | undefined;
|
|
2026
|
+
let activityTimer: NodeJS.Timeout | undefined;
|
|
2027
|
+
let timeoutTimer: NodeJS.Timeout | undefined;
|
|
2028
|
+
let timedOut = false;
|
|
2029
|
+
let stopped = false;
|
|
2030
|
+
let turnBudgetExceeded = false;
|
|
2031
|
+
let usageBudgetExceeded = false;
|
|
2032
|
+
let checkpointRejected = false;
|
|
2033
|
+
let pendingCheckpointDecision: "approved" | "rejected" | undefined;
|
|
2034
|
+
let wakeCheckpointDecision: (() => void) | undefined;
|
|
2035
|
+
const timeoutMessage = config.timeoutMs !== undefined ? `Subagent timed out after ${config.timeoutMs}ms.` : undefined;
|
|
2036
|
+
const stopMessage = "Subagent stopped by user.";
|
|
2037
|
+
const timeoutAbortController = new AbortController();
|
|
2038
|
+
const stopAbortController = new AbortController();
|
|
2039
|
+
let previousCumulativeTokens: TokenUsage = { input: 0, output: 0, total: 0 };
|
|
2040
|
+
let latestSessionFile: string | undefined;
|
|
2041
|
+
|
|
2042
|
+
const flatSteps = flattenSteps(steps);
|
|
2043
|
+
const initialFlatStepCount = flatSteps.length;
|
|
2044
|
+
const parallelGroups: Array<{ start: number; count: number; stepIndex: number }> = [];
|
|
2045
|
+
const initialStatusSteps: RunnerStatusStep[] = [];
|
|
2046
|
+
let flatStepCount = 0;
|
|
2047
|
+
for (let stepIndex = 0; stepIndex < steps.length; stepIndex++) {
|
|
2048
|
+
const step = steps[stepIndex]!;
|
|
2049
|
+
if (isCheckpointRunnerStep(step)) {
|
|
2050
|
+
initialStatusSteps.push(omitUndefinedProperties({
|
|
2051
|
+
agent: `checkpoint:${step.checkpoint}`,
|
|
2052
|
+
phase: step.phase,
|
|
2053
|
+
label: step.label ?? step.checkpoint,
|
|
2054
|
+
status: "pending",
|
|
2055
|
+
checkpoint: { name: step.checkpoint, ...(step.message ? { message: step.message } : {}), status: "pending", stepIndex },
|
|
2056
|
+
recentTools: [],
|
|
2057
|
+
recentOutput: [],
|
|
2058
|
+
}));
|
|
2059
|
+
flatStepCount++;
|
|
2060
|
+
continue;
|
|
2061
|
+
}
|
|
2062
|
+
if (isParallelGroup(step)) {
|
|
2063
|
+
parallelGroups.push({ start: flatStepCount, count: step.parallel.length, stepIndex });
|
|
2064
|
+
for (const task of step.parallel) {
|
|
2065
|
+
const taskFlatIndex = flatStepCount;
|
|
2066
|
+
const transcriptPath = resolveAsyncStepTranscriptPath(omitUndefinedProperties({ artifactsDir, artifactConfig, runId: id, agent: task.agent, flatIndex: taskFlatIndex, flatStepCount: initialFlatStepCount }));
|
|
2067
|
+
initialStatusSteps.push(omitUndefinedProperties({
|
|
2068
|
+
agent: task.agent,
|
|
2069
|
+
...(externalRunnerStatus(task.runner) ? { runner: externalRunnerStatus(task.runner) } : {}),
|
|
2070
|
+
...(statusStepDescription(task.task) ? { description: statusStepDescription(task.task) } : {}),
|
|
2071
|
+
...(task.context ? { context: task.context } : {}),
|
|
2072
|
+
phase: task.phase,
|
|
2073
|
+
label: task.label,
|
|
2074
|
+
outputName: task.outputName,
|
|
2075
|
+
structured: task.structured,
|
|
2076
|
+
...(task.agentContract ? { agentContract: task.agentContract } : {}),
|
|
2077
|
+
...(task.launchContractDigest ? { launchContractDigest: task.launchContractDigest } : {}),
|
|
2078
|
+
...(task.launchResolvedExtensions ? { launchResolvedExtensions: task.launchResolvedExtensions } : {}),
|
|
2079
|
+
...(task.capabilityCeiling ? { capabilityCeiling: task.capabilityCeiling } : {}),
|
|
2080
|
+
status: "pending",
|
|
2081
|
+
...(task.toolBudget ? { toolBudget: initialToolBudgetState(task.toolBudget) } : {}),
|
|
2082
|
+
...(task.sessionFile ? { sessionFile: task.sessionFile } : {}),
|
|
2083
|
+
...(transcriptPath ? { transcriptPath } : {}),
|
|
2084
|
+
skills: task.skills,
|
|
2085
|
+
model: task.model,
|
|
2086
|
+
thinking: task.thinking,
|
|
2087
|
+
attemptedModels: task.modelCandidates && task.modelCandidates.length > 0 ? task.modelCandidates : task.model ? [task.model] : undefined,
|
|
2088
|
+
recentTools: [],
|
|
2089
|
+
recentOutput: [],
|
|
2090
|
+
}));
|
|
2091
|
+
flatStepCount++;
|
|
2092
|
+
}
|
|
2093
|
+
} else if (isDynamicRunnerGroup(step)) {
|
|
2094
|
+
parallelGroups.push({ start: flatStepCount, count: 1, stepIndex });
|
|
2095
|
+
initialStatusSteps.push(omitUndefinedProperties({
|
|
2096
|
+
agent: `expand:${step.parallel.agent}`,
|
|
2097
|
+
...(externalRunnerStatus(step.parallel.runner) ? { runner: externalRunnerStatus(step.parallel.runner) } : {}),
|
|
2098
|
+
...(step.parallel.context ? { context: step.parallel.context } : {}),
|
|
2099
|
+
phase: step.phase ?? step.parallel.phase,
|
|
2100
|
+
label: step.label ?? step.parallel.label ?? `Dynamic fanout (${step.collect.as})`,
|
|
2101
|
+
outputName: step.collect.as,
|
|
2102
|
+
structured: Boolean(step.collect.outputSchema),
|
|
2103
|
+
...(step.agentContract ? { agentContract: step.agentContract } : {}),
|
|
2104
|
+
...(step.capabilityCeiling ? { capabilityCeiling: step.capabilityCeiling } : {}),
|
|
2105
|
+
status: "pending",
|
|
2106
|
+
...(step.parallel.toolBudget ? { toolBudget: initialToolBudgetState(step.parallel.toolBudget) } : {}),
|
|
2107
|
+
recentTools: [],
|
|
2108
|
+
recentOutput: [],
|
|
2109
|
+
}));
|
|
2110
|
+
flatStepCount++;
|
|
2111
|
+
} else {
|
|
2112
|
+
const stepFlatIndex = flatStepCount;
|
|
2113
|
+
const transcriptPath = resolveAsyncStepTranscriptPath(omitUndefinedProperties({ artifactsDir, artifactConfig, runId: id, agent: step.agent, flatIndex: stepFlatIndex, flatStepCount: initialFlatStepCount }));
|
|
2114
|
+
initialStatusSteps.push(omitUndefinedProperties({
|
|
2115
|
+
agent: step.agent,
|
|
2116
|
+
...(externalRunnerStatus(step.runner) ? { runner: externalRunnerStatus(step.runner) } : {}),
|
|
2117
|
+
...(statusStepDescription(step.task) ? { description: statusStepDescription(step.task) } : {}),
|
|
2118
|
+
...(step.context ? { context: step.context } : {}),
|
|
2119
|
+
phase: step.phase,
|
|
2120
|
+
label: step.label,
|
|
2121
|
+
outputName: step.outputName,
|
|
2122
|
+
structured: step.structured,
|
|
2123
|
+
...(step.agentContract ? { agentContract: step.agentContract } : {}),
|
|
2124
|
+
...(step.launchContractDigest ? { launchContractDigest: step.launchContractDigest } : {}),
|
|
2125
|
+
...(step.launchResolvedExtensions ? { launchResolvedExtensions: step.launchResolvedExtensions } : {}),
|
|
2126
|
+
...(step.capabilityCeiling ? { capabilityCeiling: step.capabilityCeiling } : {}),
|
|
2127
|
+
status: "pending",
|
|
2128
|
+
...(step.toolBudget ? { toolBudget: initialToolBudgetState(step.toolBudget) } : {}),
|
|
2129
|
+
...(step.sessionFile ? { sessionFile: step.sessionFile } : {}),
|
|
2130
|
+
...(transcriptPath ? { transcriptPath } : {}),
|
|
2131
|
+
skills: step.skills,
|
|
2132
|
+
model: step.model,
|
|
2133
|
+
thinking: step.thinking,
|
|
2134
|
+
attemptedModels: step.modelCandidates && step.modelCandidates.length > 0 ? step.modelCandidates : step.model ? [step.model] : undefined,
|
|
2135
|
+
recentTools: [],
|
|
2136
|
+
recentOutput: [],
|
|
2137
|
+
}));
|
|
2138
|
+
flatStepCount++;
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
const sessionEnabled = Boolean(config.sessionDir)
|
|
2142
|
+
|| shareEnabled
|
|
2143
|
+
|| flatSteps.some((step) => Boolean(step.sessionFile));
|
|
2144
|
+
if (config.runnerProcessInstanceId) {
|
|
2145
|
+
for (const step of initialStatusSteps) {
|
|
2146
|
+
step.processTerminal = { version: 1, state: "pending", runId: id, runnerProcessInstanceId: config.runnerProcessInstanceId };
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
const statusPayload: RunnerStatusPayload = omitUndefinedProperties({
|
|
2150
|
+
lifecycleArtifactVersion: SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
2151
|
+
runId: id,
|
|
2152
|
+
...(config.sessionId ? { sessionId: config.sessionId } : {}),
|
|
2153
|
+
mode: config.resultMode ?? (flatSteps.length > 1 ? "chain" : "single"),
|
|
2154
|
+
...(config.nestedRoute ? { isNested: true } : {}),
|
|
2155
|
+
state: "running",
|
|
2156
|
+
steering: createSteeringStatus(),
|
|
2157
|
+
lastActivityAt: overallStartTime,
|
|
2158
|
+
startedAt: overallStartTime,
|
|
2159
|
+
lastUpdate: overallStartTime,
|
|
2160
|
+
...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),
|
|
2161
|
+
...(config.deadlineAt !== undefined ? { deadlineAt: config.deadlineAt } : {}),
|
|
2162
|
+
...(config.turnBudget ? { turnBudget: initialTurnBudgetState(config.turnBudget) } : {}),
|
|
2163
|
+
...(config.toolBudget ? { toolBudget: initialToolBudgetState(config.toolBudget) } : {}),
|
|
2164
|
+
...(config.usageBudget ? { usageBudget: usageBudgetState(config.usageBudget, undefined) } : {}),
|
|
2165
|
+
pid: process.pid,
|
|
2166
|
+
cwd,
|
|
2167
|
+
currentStep: 0,
|
|
2168
|
+
chainStepCount: steps.length,
|
|
2169
|
+
parallelGroups,
|
|
2170
|
+
workflowGraph: config.workflowGraph,
|
|
2171
|
+
...(config.launchContractDigest ? { launchContractDigest: config.launchContractDigest } : {}),
|
|
2172
|
+
...(config.launchResolvedExtensions ? { launchResolvedExtensions: config.launchResolvedExtensions } : {}),
|
|
2173
|
+
...(config.capabilityCeiling ? { capabilityCeiling: config.capabilityCeiling } : {}),
|
|
2174
|
+
...(config.parentWorkflowRunId ? { parentWorkflowRunId: config.parentWorkflowRunId } : {}),
|
|
2175
|
+
...(config.workflowKey ? { workflowKey: config.workflowKey } : {}),
|
|
2176
|
+
...(config.runnerProcessInstanceId ? { processTerminal: { version: 1 as const, state: "pending" as const, runId: id, runnerProcessInstanceId: config.runnerProcessInstanceId } } : {}),
|
|
2177
|
+
steps: initialStatusSteps,
|
|
2178
|
+
artifactsDir,
|
|
2179
|
+
sessionDir: config.sessionDir,
|
|
2180
|
+
outputFile: path.join(asyncDir, "output-0.log"),
|
|
2181
|
+
});
|
|
2182
|
+
|
|
2183
|
+
fs.mkdirSync(asyncDir, { recursive: true });
|
|
2184
|
+
writeAtomicJson(statusPath, statusPayload);
|
|
2185
|
+
updateActiveRunIndex(asyncDir, statusPayload.state);
|
|
2186
|
+
let pendingParallelUsageCost: CostSummary = { inputTokens: 0, outputTokens: 0, costUsd: 0 };
|
|
2187
|
+
const currentUsageTotals = (): CostSummary => {
|
|
2188
|
+
const cost = results.reduce<CostSummary>((sum, result) => ({
|
|
2189
|
+
inputTokens: sum.inputTokens + (result.totalCost?.inputTokens ?? result.usage?.input ?? 0),
|
|
2190
|
+
outputTokens: sum.outputTokens + (result.totalCost?.outputTokens ?? result.usage?.output ?? 0),
|
|
2191
|
+
costUsd: sum.costUsd + (result.totalCost?.costUsd ?? result.usage?.cost ?? 0),
|
|
2192
|
+
}), { inputTokens: pendingParallelUsageCost.inputTokens, outputTokens: pendingParallelUsageCost.outputTokens, costUsd: pendingParallelUsageCost.costUsd });
|
|
2193
|
+
return {
|
|
2194
|
+
inputTokens: Math.max(cost.inputTokens, statusPayload.totalTokens?.input ?? 0),
|
|
2195
|
+
outputTokens: Math.max(cost.outputTokens, statusPayload.totalTokens?.output ?? 0),
|
|
2196
|
+
costUsd: cost.costUsd,
|
|
2197
|
+
};
|
|
2198
|
+
};
|
|
2199
|
+
const refreshUsageBudget = () => {
|
|
2200
|
+
setOptionalProperty(statusPayload, "usageBudget", usageBudgetState(config.usageBudget, currentUsageTotals()));
|
|
2201
|
+
return statusPayload.usageBudget;
|
|
2202
|
+
};
|
|
2203
|
+
const emitNestedSelfEvent = (type: "subagent.nested.updated" | "subagent.nested.completed"): void => {
|
|
2204
|
+
if (!config.nestedRoute || !config.nestedSelf) return;
|
|
2205
|
+
try {
|
|
2206
|
+
writeNestedEvent(config.nestedRoute, omitUndefinedProperties({
|
|
2207
|
+
type,
|
|
2208
|
+
ts: Date.now(),
|
|
2209
|
+
parentRunId: config.nestedSelf.parentRunId,
|
|
2210
|
+
parentStepIndex: config.nestedSelf.parentStepIndex,
|
|
2211
|
+
child: nestedSummaryFromAsyncStatus(statusPayload, asyncDir, omitUndefinedProperties({
|
|
2212
|
+
id,
|
|
2213
|
+
parentRunId: config.nestedSelf.parentRunId,
|
|
2214
|
+
parentStepIndex: config.nestedSelf.parentStepIndex,
|
|
2215
|
+
depth: config.nestedSelf.depth,
|
|
2216
|
+
path: config.nestedSelf.path,
|
|
2217
|
+
mode: statusPayload.mode,
|
|
2218
|
+
ts: Date.now(),
|
|
2219
|
+
})),
|
|
2220
|
+
}));
|
|
2221
|
+
} catch (error) {
|
|
2222
|
+
console.error("Failed to emit nested async status event:", error);
|
|
2223
|
+
}
|
|
2224
|
+
};
|
|
2225
|
+
const refreshWorkflowGraph = (): void => {
|
|
2226
|
+
if (!config.workflowGraph) return;
|
|
2227
|
+
const graph = structuredClone(statusPayload.workflowGraph ?? config.workflowGraph);
|
|
2228
|
+
const normalize = (status: RunnerStatusStep["status"]): "pending" | "running" | "completed" | "failed" | "paused" | "stopped" | "detached" | "rejected" => {
|
|
2229
|
+
if (status === "complete" || status === "completed") return "completed";
|
|
2230
|
+
if (status === "running" || status === "failed" || status === "paused" || status === "stopped" || status === "pending" || status === "rejected") return status;
|
|
2231
|
+
return "pending";
|
|
2232
|
+
};
|
|
2233
|
+
const updateNode = (node: NonNullable<typeof graph.nodes>[number]): void => {
|
|
2234
|
+
if (node.flatIndex !== undefined) {
|
|
2235
|
+
const step = statusPayload.steps[node.flatIndex];
|
|
2236
|
+
if (step) {
|
|
2237
|
+
node.status = normalize(step.status);
|
|
2238
|
+
setOptionalProperty(node, "error", step.error);
|
|
2239
|
+
setOptionalProperty(node, "acceptanceStatus", step.acceptance?.status);
|
|
2240
|
+
setOptionalProperty(node, "checkpoint", step.checkpoint);
|
|
2241
|
+
}
|
|
2242
|
+
if (statusPayload.currentStep === node.flatIndex) graph.currentNodeId = node.id;
|
|
2243
|
+
}
|
|
2244
|
+
for (const child of node.children ?? []) updateNode(child);
|
|
2245
|
+
if (node.children?.length) {
|
|
2246
|
+
if (node.children.every((child) => child.status === "completed")) node.status = "completed";
|
|
2247
|
+
else if (node.children.some((child) => child.status === "running")) node.status = "running";
|
|
2248
|
+
else if (node.children.some((child) => child.status === "stopped")) node.status = "stopped";
|
|
2249
|
+
else if (node.children.some((child) => child.status === "rejected")) node.status = "rejected";
|
|
2250
|
+
else if (node.children.some((child) => child.status === "failed")) node.status = "failed";
|
|
2251
|
+
else if (node.children.some((child) => child.status === "paused")) node.status = "paused";
|
|
2252
|
+
}
|
|
2253
|
+
if (node.error && node.status !== "stopped" && node.status !== "rejected") node.status = "failed";
|
|
2254
|
+
};
|
|
2255
|
+
for (const node of graph.nodes) updateNode(node);
|
|
2256
|
+
statusPayload.workflowGraph = graph;
|
|
2257
|
+
};
|
|
2258
|
+
let lastIndexedActiveState = isActiveAsyncState(statusPayload.state);
|
|
2259
|
+
const writeStatusPayloadNow = (): void => {
|
|
2260
|
+
refreshWorkflowGraph();
|
|
2261
|
+
writeAtomicJson(statusPath, statusPayload);
|
|
2262
|
+
const activeState = isActiveAsyncState(statusPayload.state);
|
|
2263
|
+
if (activeState !== lastIndexedActiveState) {
|
|
2264
|
+
updateActiveRunIndex(asyncDir, statusPayload.state);
|
|
2265
|
+
lastIndexedActiveState = activeState;
|
|
2266
|
+
}
|
|
2267
|
+
emitNestedSelfEvent(statusPayload.state === "running" || statusPayload.state === "queued" ? "subagent.nested.updated" : "subagent.nested.completed");
|
|
2268
|
+
};
|
|
2269
|
+
const statusWriteCoalescer = createFileCoalescer(writeStatusPayloadNow, 100);
|
|
2270
|
+
const writeStatusPayload = (immediate = true): void => {
|
|
2271
|
+
if (immediate || statusPayload.state !== "running" || statusPayload.activityState !== undefined) {
|
|
2272
|
+
if (!statusWriteCoalescer.flush(statusPath)) writeStatusPayloadNow();
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
statusWriteCoalescer.schedule(statusPath);
|
|
2276
|
+
};
|
|
2277
|
+
const updateExternalProcess = (index: number, process: ExternalProcessStatus): void => {
|
|
2278
|
+
requiredStatusStep(statusPayload, index).externalProcess = process;
|
|
2279
|
+
statusPayload.lastUpdate = Date.now();
|
|
2280
|
+
writeStatusPayload();
|
|
2281
|
+
};
|
|
2282
|
+
const registerStepInterrupt = (flatIndex: number, interrupt: (() => void) | undefined): void => {
|
|
2283
|
+
if (!interrupt) {
|
|
2284
|
+
activeChildInterrupts.delete(flatIndex);
|
|
2285
|
+
return;
|
|
2286
|
+
}
|
|
2287
|
+
activeChildInterrupts.set(flatIndex, interrupt);
|
|
2288
|
+
if (interrupted) interrupt();
|
|
2289
|
+
};
|
|
2290
|
+
const registerStepTimeout = (flatIndex: number, interrupt: (() => void) | undefined): void => {
|
|
2291
|
+
if (!interrupt) {
|
|
2292
|
+
activeChildTimeouts.delete(flatIndex);
|
|
2293
|
+
return;
|
|
2294
|
+
}
|
|
2295
|
+
activeChildTimeouts.set(flatIndex, interrupt);
|
|
2296
|
+
if (timedOut) interrupt();
|
|
2297
|
+
};
|
|
2298
|
+
const registerStepStop = (flatIndex: number, stop: (() => void) | undefined): void => {
|
|
2299
|
+
if (!stop) {
|
|
2300
|
+
activeChildStops.delete(flatIndex);
|
|
2301
|
+
return;
|
|
2302
|
+
}
|
|
2303
|
+
activeChildStops.set(flatIndex, stop);
|
|
2304
|
+
if (stopped) stop();
|
|
2305
|
+
};
|
|
2306
|
+
const registerStepTurnBudgetAbort = (flatIndex: number, abort: ((message: string, state?: TurnBudgetState) => void) | undefined): void => {
|
|
2307
|
+
if (!abort) {
|
|
2308
|
+
activeChildTurnBudgetAborts.delete(flatIndex);
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
activeChildTurnBudgetAborts.set(flatIndex, abort);
|
|
2312
|
+
};
|
|
2313
|
+
const interruptActiveChildren = (): void => {
|
|
2314
|
+
for (const interrupt of [...activeChildInterrupts.values()]) interrupt();
|
|
2315
|
+
};
|
|
2316
|
+
const timeoutActiveChildren = (): void => {
|
|
2317
|
+
for (const interrupt of [...activeChildTimeouts.values()]) interrupt();
|
|
2318
|
+
};
|
|
2319
|
+
const stopActiveChildren = (): void => {
|
|
2320
|
+
for (const stop of [...activeChildStops.values()]) stop();
|
|
2321
|
+
};
|
|
2322
|
+
const nestedRuns = function* (children: NestedRunSummary[] | undefined): Generator<NestedRunSummary> {
|
|
2323
|
+
for (const child of children ?? []) {
|
|
2324
|
+
yield child;
|
|
2325
|
+
yield* nestedRuns(child.children);
|
|
2326
|
+
yield* nestedRuns(child.steps?.flatMap((step) => step.children ?? []));
|
|
2327
|
+
}
|
|
2328
|
+
};
|
|
2329
|
+
const interruptNestedAsyncDescendants = (): void => {
|
|
2330
|
+
if (!config.nestedRoute) return;
|
|
2331
|
+
let registry: ReturnType<typeof projectNestedEvents>;
|
|
2332
|
+
try {
|
|
2333
|
+
registry = projectNestedEvents(config.nestedRoute);
|
|
2334
|
+
} catch (error) {
|
|
2335
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
2336
|
+
type: "subagent.nested.interrupt_failed",
|
|
2337
|
+
ts: Date.now(),
|
|
2338
|
+
runId: id,
|
|
2339
|
+
message: error instanceof Error ? error.message : String(error),
|
|
2340
|
+
}));
|
|
2341
|
+
return;
|
|
2342
|
+
}
|
|
2343
|
+
for (const run of nestedRuns(registry.children)) {
|
|
2344
|
+
if (run.state !== "running" && run.state !== "queued") continue;
|
|
2345
|
+
const nestedAsyncDir = run.asyncDir ?? resolveNestedAsyncDir(config.nestedRoute.rootRunId, run);
|
|
2346
|
+
if (!nestedAsyncDir) continue;
|
|
2347
|
+
try {
|
|
2348
|
+
deliverInterruptRequest({ asyncDir: nestedAsyncDir, source: "ancestor-interrupt" });
|
|
2349
|
+
} catch (error) {
|
|
2350
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
2351
|
+
type: "subagent.nested.interrupt_failed",
|
|
2352
|
+
ts: Date.now(),
|
|
2353
|
+
runId: id,
|
|
2354
|
+
targetRunId: run.id,
|
|
2355
|
+
message: error instanceof Error ? error.message : String(error),
|
|
2356
|
+
}));
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
};
|
|
2360
|
+
const stopNestedAsyncDescendants = (): void => {
|
|
2361
|
+
if (!config.nestedRoute) return;
|
|
2362
|
+
let registry: ReturnType<typeof projectNestedEvents>;
|
|
2363
|
+
try {
|
|
2364
|
+
registry = projectNestedEvents(config.nestedRoute);
|
|
2365
|
+
} catch (error) {
|
|
2366
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
2367
|
+
type: "subagent.nested.stop_failed",
|
|
2368
|
+
ts: Date.now(),
|
|
2369
|
+
runId: id,
|
|
2370
|
+
message: error instanceof Error ? error.message : String(error),
|
|
2371
|
+
}));
|
|
2372
|
+
return;
|
|
2373
|
+
}
|
|
2374
|
+
for (const run of nestedRuns(registry.children)) {
|
|
2375
|
+
if (run.state !== "running" && run.state !== "queued") continue;
|
|
2376
|
+
const nestedAsyncDir = run.asyncDir ?? resolveNestedAsyncDir(config.nestedRoute.rootRunId, run);
|
|
2377
|
+
if (!nestedAsyncDir) continue;
|
|
2378
|
+
try {
|
|
2379
|
+
deliverStopRequest(omitUndefinedProperties({ asyncDir: nestedAsyncDir, pid: run.pid, source: "ancestor-stop" }));
|
|
2380
|
+
} catch (error) {
|
|
2381
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
2382
|
+
type: "subagent.nested.stop_failed",
|
|
2383
|
+
ts: Date.now(),
|
|
2384
|
+
runId: id,
|
|
2385
|
+
targetRunId: run.id,
|
|
2386
|
+
message: error instanceof Error ? error.message : String(error),
|
|
2387
|
+
}));
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
};
|
|
2391
|
+
const timeoutNestedAsyncDescendants = (): void => {
|
|
2392
|
+
if (!config.nestedRoute) return;
|
|
2393
|
+
let registry: ReturnType<typeof projectNestedEvents>;
|
|
2394
|
+
try {
|
|
2395
|
+
registry = projectNestedEvents(config.nestedRoute);
|
|
2396
|
+
} catch (error) {
|
|
2397
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
2398
|
+
type: "subagent.nested.timeout_failed",
|
|
2399
|
+
ts: Date.now(),
|
|
2400
|
+
runId: id,
|
|
2401
|
+
message: error instanceof Error ? error.message : String(error),
|
|
2402
|
+
}));
|
|
2403
|
+
return;
|
|
2404
|
+
}
|
|
2405
|
+
for (const run of nestedRuns(registry.children)) {
|
|
2406
|
+
if (run.state !== "running" && run.state !== "queued") continue;
|
|
2407
|
+
const nestedAsyncDir = run.asyncDir ?? resolveNestedAsyncDir(config.nestedRoute.rootRunId, run);
|
|
2408
|
+
if (!nestedAsyncDir) continue;
|
|
2409
|
+
try {
|
|
2410
|
+
deliverTimeoutRequest(omitUndefinedProperties({ asyncDir: nestedAsyncDir, pid: run.pid, source: "ancestor-timeout" }));
|
|
2411
|
+
} catch (error) {
|
|
2412
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
2413
|
+
type: "subagent.nested.timeout_failed",
|
|
2414
|
+
ts: Date.now(),
|
|
2415
|
+
runId: id,
|
|
2416
|
+
targetRunId: run.id,
|
|
2417
|
+
message: error instanceof Error ? error.message : String(error),
|
|
2418
|
+
}));
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
};
|
|
2422
|
+
const pausedStepResult = (agent: string, context?: "fresh" | "fork"): SingleStepResult => omitUndefinedProperties({
|
|
2423
|
+
agent,
|
|
2424
|
+
context,
|
|
2425
|
+
output: "Paused after interrupt. Waiting for explicit next action.",
|
|
2426
|
+
exitCode: 0,
|
|
2427
|
+
interrupted: true,
|
|
2428
|
+
});
|
|
2429
|
+
const timedOutStepResult = (agent: string, context?: "fresh" | "fork"): SingleStepResult => omitUndefinedProperties({
|
|
2430
|
+
agent,
|
|
2431
|
+
context,
|
|
2432
|
+
output: timeoutMessage ?? "Subagent timed out.",
|
|
2433
|
+
error: timeoutMessage ?? "Subagent timed out.",
|
|
2434
|
+
exitCode: 1,
|
|
2435
|
+
timedOut: true,
|
|
2436
|
+
});
|
|
2437
|
+
const stoppedStepResult = (agent: string, context?: "fresh" | "fork"): SingleStepResult => omitUndefinedProperties({
|
|
2438
|
+
agent,
|
|
2439
|
+
context,
|
|
2440
|
+
output: stopMessage,
|
|
2441
|
+
error: stopMessage,
|
|
2442
|
+
exitCode: 1,
|
|
2443
|
+
stopped: true,
|
|
2444
|
+
});
|
|
2445
|
+
const consumePendingAppendRequests = (): void => {
|
|
2446
|
+
if (statusPayload.mode !== "chain" || statusPayload.state !== "running") return;
|
|
2447
|
+
const requests = consumeChainAppendRequests(asyncDir);
|
|
2448
|
+
if (requests.length === 0) {
|
|
2449
|
+
const pendingAppends = countPendingChainAppendRequests(asyncDir);
|
|
2450
|
+
if ((statusPayload.pendingAppends ?? 0) !== pendingAppends) {
|
|
2451
|
+
statusPayload.pendingAppends = pendingAppends;
|
|
2452
|
+
statusPayload.lastUpdate = Date.now();
|
|
2453
|
+
writeStatusPayload();
|
|
2454
|
+
}
|
|
2455
|
+
return;
|
|
2456
|
+
}
|
|
2457
|
+
const appendedSteps = requests.flatMap((request) => request.steps);
|
|
2458
|
+
steps.push(...appendedSteps);
|
|
2459
|
+
const now = Date.now();
|
|
2460
|
+
const pendingAppends = countPendingChainAppendRequests(asyncDir);
|
|
2461
|
+
const added = appendRunnerStepsToStatus({
|
|
2462
|
+
status: statusPayload,
|
|
2463
|
+
steps: appendedSteps,
|
|
2464
|
+
now,
|
|
2465
|
+
pendingAppends,
|
|
2466
|
+
});
|
|
2467
|
+
mutatingFailureStates.push(...Array.from({ length: added.addedFlatSteps }, () => createMutatingFailureState()));
|
|
2468
|
+
pendingToolResults.push(...Array.from({ length: added.addedFlatSteps }, () => undefined));
|
|
2469
|
+
if (config.childIntercomTargets) {
|
|
2470
|
+
config.childIntercomTargets = statusPayload.steps.map((statusStep, index) => resolveSubagentIntercomTarget(id, statusStep.agent, index));
|
|
2471
|
+
}
|
|
2472
|
+
writeStatusPayload();
|
|
2473
|
+
for (const request of requests) {
|
|
2474
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
2475
|
+
type: "subagent.chain.append.accepted",
|
|
2476
|
+
ts: now,
|
|
2477
|
+
runId: id,
|
|
2478
|
+
requestId: request.id,
|
|
2479
|
+
stepCount: request.steps.length,
|
|
2480
|
+
pendingAppends,
|
|
2481
|
+
}));
|
|
2482
|
+
}
|
|
2483
|
+
};
|
|
2484
|
+
const markDynamicGraphGroup = (stepIndex: number, status: "completed" | "failed" | "running" | "stopped", error?: string, acceptance?: import("../../shared/types.ts").AcceptanceLedger): void => {
|
|
2485
|
+
const groupNode = statusPayload.workflowGraph?.nodes.find((node) => node.id === `step-${stepIndex}`);
|
|
2486
|
+
if (!groupNode) return;
|
|
2487
|
+
groupNode.status = status;
|
|
2488
|
+
setOptionalProperty(groupNode, "error", error);
|
|
2489
|
+
setOptionalProperty(groupNode, "acceptanceStatus", acceptance?.status ?? groupNode.acceptanceStatus);
|
|
2490
|
+
};
|
|
2491
|
+
|
|
2492
|
+
const stepOutputActivityAt = (index: number): number => {
|
|
2493
|
+
const step = statusPayload.steps[index];
|
|
2494
|
+
let lastActivityAt = step?.lastActivityAt ?? step?.startedAt ?? overallStartTime;
|
|
2495
|
+
const outputPath = path.join(asyncDir, `output-${index}.log`);
|
|
2496
|
+
try {
|
|
2497
|
+
lastActivityAt = Math.max(lastActivityAt, fs.statSync(outputPath).mtimeMs);
|
|
2498
|
+
} catch (error) {
|
|
2499
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") {
|
|
2500
|
+
console.error(`Failed to inspect async output file '${outputPath}':`, error);
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
return lastActivityAt;
|
|
2504
|
+
};
|
|
2505
|
+
const emittedControlEventKeys = new Set<string>();
|
|
2506
|
+
const activeLongRunningSteps = new Set<number>();
|
|
2507
|
+
const mutatingFailureStates = initialStatusSteps.map(() => createMutatingFailureState());
|
|
2508
|
+
const pendingToolResults: Array<{ tool: string; path?: string; mutates: boolean; startedAt?: number } | undefined> = initialStatusSteps.map(() => undefined);
|
|
2509
|
+
const supervisorAttentionSteps = new Map<number, ActivityState | undefined>();
|
|
2510
|
+
const mutatingFailureWindowMs = 5 * 60_000;
|
|
2511
|
+
const appendControlEvent = (event: ReturnType<typeof buildControlEvent>) => {
|
|
2512
|
+
if (!controlConfig.enabled) return;
|
|
2513
|
+
const childIntercomTarget = config.childIntercomTargets?.[event.index ?? statusPayload.currentStep];
|
|
2514
|
+
const channels = event.type === "active_long_running"
|
|
2515
|
+
? controlConfig.notifyChannels.filter((channel) => channel !== "intercom")
|
|
2516
|
+
: controlConfig.notifyChannels;
|
|
2517
|
+
if (channels.length === 0 || !claimControlNotification(controlConfig, event, emittedControlEventKeys, childIntercomTarget)) return;
|
|
2518
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
2519
|
+
type: "subagent.control",
|
|
2520
|
+
event,
|
|
2521
|
+
channels,
|
|
2522
|
+
childIntercomTarget,
|
|
2523
|
+
noticeText: formatControlNoticeMessage(event, childIntercomTarget),
|
|
2524
|
+
...(config.controlIntercomTarget && channels.includes("intercom") ? {
|
|
2525
|
+
intercom: {
|
|
2526
|
+
to: config.controlIntercomTarget,
|
|
2527
|
+
message: formatControlIntercomMessage(event, childIntercomTarget),
|
|
2528
|
+
},
|
|
2529
|
+
} : {}),
|
|
2530
|
+
}));
|
|
2531
|
+
};
|
|
2532
|
+
const syncTopLevelCurrentTool = (): void => {
|
|
2533
|
+
const activeStep = statusPayload.steps
|
|
2534
|
+
.filter((step) => step.status === "running" && typeof step.currentTool === "string" && step.currentTool.length > 0)
|
|
2535
|
+
.sort((left, right) => (right.currentToolStartedAt ?? 0) - (left.currentToolStartedAt ?? 0))[0];
|
|
2536
|
+
setOptionalProperty(statusPayload, "currentTool", activeStep?.currentTool);
|
|
2537
|
+
setOptionalProperty(statusPayload, "currentToolStartedAt", activeStep?.currentToolStartedAt);
|
|
2538
|
+
setOptionalProperty(statusPayload, "currentPath", activeStep?.currentPath);
|
|
2539
|
+
};
|
|
2540
|
+
const syncAggregateActivityState = (): void => {
|
|
2541
|
+
const nextRunState = statusPayload.steps.some((step) => step.activityState === "needs_attention")
|
|
2542
|
+
? "needs_attention"
|
|
2543
|
+
: statusPayload.steps.some((step) => step.activityState === "active_long_running")
|
|
2544
|
+
? "active_long_running"
|
|
2545
|
+
: undefined;
|
|
2546
|
+
currentActivityState = nextRunState;
|
|
2547
|
+
setOptionalProperty(statusPayload, "activityState", nextRunState);
|
|
2548
|
+
};
|
|
2549
|
+
const maybeEmitActiveLongRunning = (flatIndex: number, now: number): boolean => {
|
|
2550
|
+
if (!controlConfig.enabled || activeLongRunningSteps.has(flatIndex)) return false;
|
|
2551
|
+
const step = statusPayload.steps[flatIndex];
|
|
2552
|
+
if (!step || step.status !== "running" || step.activityState === "needs_attention") return false;
|
|
2553
|
+
const reason = nextLongRunningTrigger(controlConfig, {
|
|
2554
|
+
startedAt: step.startedAt ?? overallStartTime,
|
|
2555
|
+
now,
|
|
2556
|
+
turns: step.turnCount ?? 0,
|
|
2557
|
+
tokens: step.tokens?.total ?? 0,
|
|
2558
|
+
});
|
|
2559
|
+
if (!reason) return false;
|
|
2560
|
+
activeLongRunningSteps.add(flatIndex);
|
|
2561
|
+
const previous = step.activityState;
|
|
2562
|
+
step.activityState = "active_long_running";
|
|
2563
|
+
statusPayload.activityState = statusPayload.activityState === "needs_attention" ? "needs_attention" : "active_long_running";
|
|
2564
|
+
const event = buildControlEvent(omitUndefinedProperties({
|
|
2565
|
+
type: "active_long_running",
|
|
2566
|
+
from: previous,
|
|
2567
|
+
to: "active_long_running",
|
|
2568
|
+
runId: id,
|
|
2569
|
+
agent: step.agent,
|
|
2570
|
+
index: flatIndex,
|
|
2571
|
+
ts: now,
|
|
2572
|
+
message: `${step.agent} is still active but long-running`,
|
|
2573
|
+
reason,
|
|
2574
|
+
turns: step.turnCount,
|
|
2575
|
+
tokens: step.tokens?.total,
|
|
2576
|
+
toolCount: step.toolCount,
|
|
2577
|
+
currentTool: step.currentTool,
|
|
2578
|
+
currentToolDurationMs: step.currentToolStartedAt ? Math.max(0, now - step.currentToolStartedAt) : undefined,
|
|
2579
|
+
currentPath: step.currentPath,
|
|
2580
|
+
elapsedMs: now - (step.startedAt ?? overallStartTime),
|
|
2581
|
+
}));
|
|
2582
|
+
appendControlEvent(event);
|
|
2583
|
+
return true;
|
|
2584
|
+
};
|
|
2585
|
+
const steeringMarkerPath = (requestId: string): string => path.join(asyncDir, "control", "steer-recovery", `${Buffer.from(requestId).toString("base64url")}.json`);
|
|
2586
|
+
const markSteeringAttention = (index: number): void => {
|
|
2587
|
+
const step = statusPayload.steps[index];
|
|
2588
|
+
if (step) step.activityState = "needs_attention";
|
|
2589
|
+
statusPayload.activityState = "needs_attention";
|
|
2590
|
+
};
|
|
2591
|
+
const emitSteeringEvent = (type: string, request: SteerRequest, index?: number, extra: Record<string, unknown> = {}): void => {
|
|
2592
|
+
appendJsonl(eventsPath, JSON.stringify({ type, ts: Date.now(), runId: id, requestId: request.id, ...(index !== undefined ? { index } : {}), ...extra }));
|
|
2593
|
+
};
|
|
2594
|
+
const emitSteeringNotice = (requestId: string, state: "failed" | "partial" | "recovered", message: string): void => {
|
|
2595
|
+
appendJsonl(eventsPath, JSON.stringify({ type: "subagent.steering.notice", ts: Date.now(), runId: id, requestId, state, message, ...(config.sessionId ? { currentSessionId: config.sessionId } : {}) }));
|
|
2596
|
+
};
|
|
2597
|
+
const recordSteeringLifecycle = (request: SteerRequest, targets: Array<{ index: number; state: SteeringTargetState; reason?: string }>): void => {
|
|
2598
|
+
const lifecycle = steeringStatus(statusPayload);
|
|
2599
|
+
recordSteeringRequest(lifecycle, omitUndefinedProperties({ id: request.id, requestedAt: request.ts, source: request.source, message: request.message, targets }));
|
|
2600
|
+
for (const target of targets) {
|
|
2601
|
+
const step = statusPayload.steps[target.index];
|
|
2602
|
+
if (!step) continue;
|
|
2603
|
+
step.steering ??= createSteeringStatus();
|
|
2604
|
+
recordSteeringRequest(step.steering, omitUndefinedProperties({ id: request.id, requestedAt: request.ts, source: request.source, message: request.message, targets: [target] }));
|
|
2605
|
+
}
|
|
2606
|
+
};
|
|
2607
|
+
const updateSteeringLifecycleTarget = (
|
|
2608
|
+
requestId: string,
|
|
2609
|
+
index: number,
|
|
2610
|
+
state: SteeringTargetState,
|
|
2611
|
+
now: number,
|
|
2612
|
+
fields: Pick<SteeringTargetStatus, "reason" | "replacementRunId"> = {},
|
|
2613
|
+
): SteeringTargetStatus | undefined => {
|
|
2614
|
+
const updated = updateSteeringTarget(steeringStatus(statusPayload), requestId, index, state, now, fields);
|
|
2615
|
+
const step = statusPayload.steps[index];
|
|
2616
|
+
if (step?.steering) updateSteeringTarget(step.steering, requestId, index, state, now, fields);
|
|
2617
|
+
return updated;
|
|
2618
|
+
};
|
|
2619
|
+
const emitTerminalSteeringNotice = (requestId: string, failureMessage: string): void => {
|
|
2620
|
+
const state = terminalSteeringNoticeState(steeringStatus(statusPayload), requestId);
|
|
2621
|
+
if (state === "partial") emitSteeringNotice(requestId, "partial", `Steering partially delivered for run ${id}.`);
|
|
2622
|
+
else if (state === "failed") emitSteeringNotice(requestId, "failed", failureMessage);
|
|
2623
|
+
};
|
|
2624
|
+
const deliverSteerRequest = (request: SteerRequest): void => {
|
|
2625
|
+
if (statusPayload.state !== "running") {
|
|
2626
|
+
const reason = `run became ${statusPayload.state} before steering request was consumed`;
|
|
2627
|
+
const indexes = request.targetIndex !== undefined
|
|
2628
|
+
? [request.targetIndex]
|
|
2629
|
+
: request.targetIndexes?.length
|
|
2630
|
+
? request.targetIndexes
|
|
2631
|
+
: statusPayload.steps.map((_, index) => index);
|
|
2632
|
+
const targets = indexes.map((index) => ({ index, state: "failed" as const, reason }));
|
|
2633
|
+
recordSteeringLifecycle(request, targets);
|
|
2634
|
+
emitSteeringEvent("subagent.steer.requested", request, undefined, { targets });
|
|
2635
|
+
for (const target of targets) emitSteeringEvent("subagent.steer.failed", request, target.index, { reason });
|
|
2636
|
+
emitTerminalSteeringNotice(request.id, `Steering failed for run ${id}: ${reason}.`);
|
|
2637
|
+
statusPayload.lastUpdate = Date.now();
|
|
2638
|
+
writeStatusPayload();
|
|
2639
|
+
return;
|
|
2640
|
+
}
|
|
2641
|
+
const runningIndexes = statusPayload.steps
|
|
2642
|
+
.map((step, index) => ({ step, index }))
|
|
2643
|
+
.filter(({ step }) => step.status === "running")
|
|
2644
|
+
.map(({ index }) => index);
|
|
2645
|
+
const targets = request.targetIndex !== undefined
|
|
2646
|
+
? [request.targetIndex]
|
|
2647
|
+
: request.targetIndexes?.length
|
|
2648
|
+
? request.targetIndexes
|
|
2649
|
+
: runningIndexes.length > 0
|
|
2650
|
+
? runningIndexes
|
|
2651
|
+
: statusPayload.mode === "single" && statusPayload.steps[0]?.status === "pending"
|
|
2652
|
+
? [0]
|
|
2653
|
+
: [];
|
|
2654
|
+
const now = Date.now();
|
|
2655
|
+
const targetStates = targets.map((index) => {
|
|
2656
|
+
const step = statusPayload.steps[index];
|
|
2657
|
+
if (!step) return { index, state: "failed" as const, reason: "child index out of range" };
|
|
2658
|
+
if (step.status === "pending") return { index, state: "scheduled" as const };
|
|
2659
|
+
if (step.status !== "running") return { index, state: "failed" as const, reason: `child is ${step.status}` };
|
|
2660
|
+
if (steeringCapabilities.get(index)?.supported === false) return { index, state: "failed" as const, reason: "child Pi session does not support steering" };
|
|
2661
|
+
return { index, state: "routed" as const };
|
|
2662
|
+
});
|
|
2663
|
+
recordSteeringLifecycle(request, targetStates);
|
|
2664
|
+
emitSteeringEvent("subagent.steer.requested", request, undefined, { targets: targetStates });
|
|
2665
|
+
for (const target of targetStates) {
|
|
2666
|
+
if (target.state === "routed") {
|
|
2667
|
+
try {
|
|
2668
|
+
enqueueStepSteer(asyncDir, target.index, request);
|
|
2669
|
+
updateSteeringLifecycleTarget(request.id, target.index, "routed", now);
|
|
2670
|
+
emitSteeringEvent("subagent.steer.routed", request, target.index);
|
|
2671
|
+
} catch (error) {
|
|
2672
|
+
markSteeringAttention(target.index);
|
|
2673
|
+
updateSteeringLifecycleTarget(request.id, target.index, "failed", now, { reason: error instanceof Error ? error.message : String(error) });
|
|
2674
|
+
emitSteeringEvent("subagent.steer.failed", request, target.index, { reason: error instanceof Error ? error.message : String(error) });
|
|
2675
|
+
}
|
|
2676
|
+
} else if (target.state === "failed") {
|
|
2677
|
+
markSteeringAttention(target.index);
|
|
2678
|
+
emitSteeringEvent("subagent.steer.failed", request, target.index, { reason: target.reason });
|
|
2679
|
+
} else {
|
|
2680
|
+
emitSteeringEvent("subagent.steer.scheduled", request, target.index);
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
emitTerminalSteeringNotice(request.id, `Steering failed for run ${id}: no requested child remained steerable.`);
|
|
2684
|
+
statusPayload.lastUpdate = now;
|
|
2685
|
+
writeStatusPayload();
|
|
2686
|
+
};
|
|
2687
|
+
const consumeSteerAck = (ack: SteerAck): void => {
|
|
2688
|
+
const lifecycle = steeringStatus(statusPayload);
|
|
2689
|
+
const request = lifecycle.recent.find((candidate) => candidate.id === ack.requestId);
|
|
2690
|
+
if (!request || !request.targets.some((target) => target.index === ack.index)) return;
|
|
2691
|
+
const late = fs.existsSync(steeringMarkerPath(ack.requestId));
|
|
2692
|
+
const now = Date.now();
|
|
2693
|
+
if (ack.state === "delivered") {
|
|
2694
|
+
updateSteeringLifecycleTarget(ack.requestId, ack.index, late ? "late" : "delivered", now, omitUndefinedProperties({ reason: late ? "acknowledged after recovery commit" : undefined }));
|
|
2695
|
+
emitSteeringEvent("subagent.steer.delivered", { type: "steer", id: ack.requestId, ts: now, message: ack.message }, ack.index, { late, deliveryStatus: "delivered", message: ack.message });
|
|
2696
|
+
} else if (ack.state === "queued") {
|
|
2697
|
+
updateSteeringLifecycleTarget(ack.requestId, ack.index, "queued", now);
|
|
2698
|
+
emitSteeringEvent("subagent.steer.queued", { type: "steer", id: ack.requestId, ts: now, message: ack.message }, ack.index, { deliveryStatus: "queued", message: ack.message });
|
|
2699
|
+
} else {
|
|
2700
|
+
markSteeringAttention(ack.index);
|
|
2701
|
+
updateSteeringLifecycleTarget(ack.requestId, ack.index, "failed", now, { reason: ack.message });
|
|
2702
|
+
emitSteeringEvent("subagent.steer.failed", { type: "steer", id: ack.requestId, ts: now, message: ack.message }, ack.index, { reason: ack.message });
|
|
2703
|
+
}
|
|
2704
|
+
emitTerminalSteeringNotice(ack.requestId, `Steering failed for run ${id}: ${ack.message}`);
|
|
2705
|
+
statusPayload.lastUpdate = now;
|
|
2706
|
+
writeStatusPayload();
|
|
2707
|
+
};
|
|
2708
|
+
const flushPendingStepSteers = (flatIndex: number): void => {
|
|
2709
|
+
const remaining: SteerRequest[] = [];
|
|
2710
|
+
for (const request of pendingStepSteers.splice(0)) {
|
|
2711
|
+
if (request.targetIndex === undefined) deliverSteerRequest({ ...request, targetIndex: flatIndex });
|
|
2712
|
+
else if (request.targetIndex === flatIndex) deliverSteerRequest(request);
|
|
2713
|
+
else remaining.push(request);
|
|
2714
|
+
}
|
|
2715
|
+
pendingStepSteers.push(...remaining);
|
|
2716
|
+
};
|
|
2717
|
+
const updateStepModel = (flatIndex: number, model: string | undefined, thinking: string | undefined, now = Date.now()): void => {
|
|
2718
|
+
const step = statusPayload.steps[flatIndex];
|
|
2719
|
+
if (!step) return;
|
|
2720
|
+
setOptionalProperty(step, "model", model);
|
|
2721
|
+
setOptionalProperty(step, "thinking", thinking);
|
|
2722
|
+
statusPayload.lastUpdate = now;
|
|
2723
|
+
writeStatusPayload();
|
|
2724
|
+
};
|
|
2725
|
+
const updateStepTurnBudget = (
|
|
2726
|
+
flatIndex: number,
|
|
2727
|
+
turnCount: number,
|
|
2728
|
+
now: number,
|
|
2729
|
+
terminalAssistantStop: boolean,
|
|
2730
|
+
toolWorkActiveOrStarting: boolean,
|
|
2731
|
+
): void => {
|
|
2732
|
+
const budget = config.turnBudget;
|
|
2733
|
+
const step = statusPayload.steps[flatIndex];
|
|
2734
|
+
if (!budget || !step || timedOut || stopped || turnBudgetExceeded || step.turnBudgetExceeded) return;
|
|
2735
|
+
if (turnCount < budget.maxTurns) {
|
|
2736
|
+
const state: TurnBudgetState = { ...budget, outcome: "within-budget", turnCount };
|
|
2737
|
+
step.turnBudget = state;
|
|
2738
|
+
statusPayload.turnBudget = state;
|
|
2739
|
+
return;
|
|
2740
|
+
}
|
|
2741
|
+
if (!step.wrapUpRequested) {
|
|
2742
|
+
step.wrapUpRequested = true;
|
|
2743
|
+
statusPayload.wrapUpRequested = true;
|
|
2744
|
+
appendRecentStepOutput(step, [turnBudgetSoftNote(budget, turnCount)]);
|
|
2745
|
+
}
|
|
2746
|
+
const decision = turnBudgetDecision(budget, turnCount, terminalAssistantStop, toolWorkActiveOrStarting);
|
|
2747
|
+
if (decision === "defer") {
|
|
2748
|
+
const firstDeferredTurn = step.turnBudget?.terminationDeferredAtTurn;
|
|
2749
|
+
const deferredState = turnBudgetDeferredState(budget, turnCount, firstDeferredTurn);
|
|
2750
|
+
step.turnBudget = deferredState;
|
|
2751
|
+
statusPayload.turnBudget = deferredState;
|
|
2752
|
+
if (firstDeferredTurn === undefined) {
|
|
2753
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
2754
|
+
type: "subagent.step.turn_budget_deferred",
|
|
2755
|
+
ts: now,
|
|
2756
|
+
runId: id,
|
|
2757
|
+
stepIndex: flatIndex,
|
|
2758
|
+
agent: step.agent,
|
|
2759
|
+
turnCount,
|
|
2760
|
+
maxTurns: budget.maxTurns,
|
|
2761
|
+
graceTurns: budget.graceTurns,
|
|
2762
|
+
}));
|
|
2763
|
+
}
|
|
2764
|
+
return;
|
|
2765
|
+
}
|
|
2766
|
+
const state = turnBudgetState(budget, turnCount, false);
|
|
2767
|
+
step.turnBudget = state;
|
|
2768
|
+
statusPayload.turnBudget = state;
|
|
2769
|
+
if (decision !== "abort") return;
|
|
2770
|
+
const exceededState = turnBudgetState(budget, turnCount, true);
|
|
2771
|
+
const message = turnBudgetExceededMessage(budget, turnCount);
|
|
2772
|
+
step.turnBudget = exceededState;
|
|
2773
|
+
step.turnBudgetExceeded = true;
|
|
2774
|
+
step.wrapUpRequested = true;
|
|
2775
|
+
step.error = message;
|
|
2776
|
+
turnBudgetExceeded = true;
|
|
2777
|
+
statusPayload.turnBudget = exceededState;
|
|
2778
|
+
statusPayload.turnBudgetExceeded = true;
|
|
2779
|
+
statusPayload.wrapUpRequested = true;
|
|
2780
|
+
statusPayload.error = message;
|
|
2781
|
+
statusPayload.lastUpdate = now;
|
|
2782
|
+
appendJsonl(eventsPath, JSON.stringify({ type: "subagent.step.turn_budget_exceeded", ts: now, runId: id, stepIndex: flatIndex, agent: step.agent, turnCount, maxTurns: budget.maxTurns, graceTurns: budget.graceTurns, message }));
|
|
2783
|
+
activeChildTurnBudgetAborts.get(flatIndex)?.(message, exceededState);
|
|
2784
|
+
};
|
|
2785
|
+
const updateStepFromChildEvent = (flatIndex: number, event: ChildEvent): void => {
|
|
2786
|
+
const step = statusPayload.steps[flatIndex];
|
|
2787
|
+
if (!step) return;
|
|
2788
|
+
const now = Date.now();
|
|
2789
|
+
statusPayload.currentStep = flatIndex;
|
|
2790
|
+
if (isChildWatchdogStatusEvent(event)) {
|
|
2791
|
+
const next = acceptChildWatchdogEvent({
|
|
2792
|
+
current: step.watchdog,
|
|
2793
|
+
event,
|
|
2794
|
+
runId: id,
|
|
2795
|
+
agent: step.agent,
|
|
2796
|
+
childIndex: flatIndex,
|
|
2797
|
+
});
|
|
2798
|
+
if (!next) return;
|
|
2799
|
+
step.watchdog = next;
|
|
2800
|
+
step.lastActivityAt = now;
|
|
2801
|
+
statusPayload.lastActivityAt = now;
|
|
2802
|
+
statusPayload.lastUpdate = now;
|
|
2803
|
+
writeStatusPayload(false);
|
|
2804
|
+
return;
|
|
2805
|
+
}
|
|
2806
|
+
if (event.type === "tool_execution_start" && event.toolName) {
|
|
2807
|
+
const mutates = isMutatingTool(event.toolName, event.args);
|
|
2808
|
+
const currentPath = resolveCurrentPath(event.toolName, event.args);
|
|
2809
|
+
step.toolCount = (step.toolCount ?? 0) + 1;
|
|
2810
|
+
const configuredToolBudget = flatSteps[flatIndex]?.toolBudget;
|
|
2811
|
+
if (configuredToolBudget) {
|
|
2812
|
+
step.toolBudget = toolBudgetState(configuredToolBudget, step.toolCount);
|
|
2813
|
+
statusPayload.toolBudget = step.toolBudget;
|
|
2814
|
+
}
|
|
2815
|
+
step.currentTool = event.toolName;
|
|
2816
|
+
step.currentToolArgs = extractToolArgsPreview(event.args ?? {});
|
|
2817
|
+
step.currentToolStartedAt = now;
|
|
2818
|
+
setOptionalProperty(step, "currentPath", currentPath);
|
|
2819
|
+
pendingToolResults[flatIndex] = omitUndefinedProperties({ tool: event.toolName, path: currentPath, mutates, startedAt: now });
|
|
2820
|
+
statusPayload.toolCount = (statusPayload.toolCount ?? 0) + 1;
|
|
2821
|
+
syncTopLevelCurrentTool();
|
|
2822
|
+
if (controlConfig.enabled && isBlockingSupervisorTool(event.toolName, event.args) && step.activityState !== "needs_attention") {
|
|
2823
|
+
const previous = step.activityState;
|
|
2824
|
+
step.activityState = "needs_attention";
|
|
2825
|
+
supervisorAttentionSteps.set(flatIndex, previous);
|
|
2826
|
+
currentActivityState = "needs_attention";
|
|
2827
|
+
statusPayload.activityState = "needs_attention";
|
|
2828
|
+
appendControlEvent(buildControlEvent(omitUndefinedProperties({
|
|
2829
|
+
type: "needs_attention",
|
|
2830
|
+
from: previous,
|
|
2831
|
+
to: "needs_attention",
|
|
2832
|
+
runId: id,
|
|
2833
|
+
agent: step.agent,
|
|
2834
|
+
index: flatIndex,
|
|
2835
|
+
ts: now,
|
|
2836
|
+
message: `${step.agent} is waiting for a supervisor reply`,
|
|
2837
|
+
reason: "supervisor_request",
|
|
2838
|
+
turns: step.turnCount,
|
|
2839
|
+
tokens: step.tokens?.total,
|
|
2840
|
+
toolCount: step.toolCount,
|
|
2841
|
+
currentTool: step.currentTool,
|
|
2842
|
+
currentToolDurationMs: 0,
|
|
2843
|
+
currentPath: step.currentPath,
|
|
2844
|
+
})));
|
|
2845
|
+
}
|
|
2846
|
+
} else if (event.type === "tool_execution_end") {
|
|
2847
|
+
if (step.currentTool) {
|
|
2848
|
+
step.recentTools ??= [];
|
|
2849
|
+
step.recentTools.push({ tool: step.currentTool, args: step.currentToolArgs || "", endMs: now });
|
|
2850
|
+
}
|
|
2851
|
+
const supervisorPreviousActivity = supervisorAttentionSteps.get(flatIndex);
|
|
2852
|
+
const clearedSupervisorAttention = supervisorAttentionSteps.delete(flatIndex);
|
|
2853
|
+
delete step.currentTool;
|
|
2854
|
+
delete step.currentToolArgs;
|
|
2855
|
+
delete step.currentToolStartedAt;
|
|
2856
|
+
delete step.currentPath;
|
|
2857
|
+
if (clearedSupervisorAttention && step.activityState === "needs_attention") {
|
|
2858
|
+
setOptionalProperty(step, "activityState", supervisorPreviousActivity);
|
|
2859
|
+
syncAggregateActivityState();
|
|
2860
|
+
}
|
|
2861
|
+
syncTopLevelCurrentTool();
|
|
2862
|
+
} else if (event.type === "tool_result_end" && event.message) {
|
|
2863
|
+
const toolSnapshot = pendingToolResults[flatIndex];
|
|
2864
|
+
pendingToolResults[flatIndex] = undefined;
|
|
2865
|
+
const resultText = extractTextFromContent(event.message.content);
|
|
2866
|
+
if (toolSnapshot && resultText.includes("Tool budget hard limit reached")) {
|
|
2867
|
+
const configuredToolBudget = flatSteps[flatIndex]?.toolBudget;
|
|
2868
|
+
if (configuredToolBudget) {
|
|
2869
|
+
step.toolBudget = toolBudgetState(configuredToolBudget, step.toolCount ?? 0, toolSnapshot.tool);
|
|
2870
|
+
step.toolBudgetBlocked = true;
|
|
2871
|
+
statusPayload.toolBudget = step.toolBudget;
|
|
2872
|
+
statusPayload.toolBudgetBlocked = true;
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
appendRecentStepOutput(step, resultText.split("\n").slice(-10));
|
|
2876
|
+
if (toolSnapshot?.mutates && didMutatingToolFail(resultText)) {
|
|
2877
|
+
const state = mutatingFailureStates[flatIndex]!;
|
|
2878
|
+
recordMutatingFailure(state, omitUndefinedProperties({
|
|
2879
|
+
tool: toolSnapshot.tool,
|
|
2880
|
+
path: toolSnapshot.path,
|
|
2881
|
+
error: resultText.split("\n").find((line) => line.trim())?.trim().slice(0, 180) ?? "mutating tool failed",
|
|
2882
|
+
ts: now,
|
|
2883
|
+
}), mutatingFailureWindowMs);
|
|
2884
|
+
if (controlConfig.enabled && shouldEscalateMutatingFailures(state, controlConfig.failedToolAttemptsBeforeAttention) && step.activityState !== "needs_attention") {
|
|
2885
|
+
const previous = step.activityState;
|
|
2886
|
+
step.activityState = "needs_attention";
|
|
2887
|
+
statusPayload.activityState = "needs_attention";
|
|
2888
|
+
appendControlEvent(buildControlEvent(omitUndefinedProperties({
|
|
2889
|
+
type: "needs_attention",
|
|
2890
|
+
from: previous,
|
|
2891
|
+
to: "needs_attention",
|
|
2892
|
+
runId: id,
|
|
2893
|
+
agent: step.agent,
|
|
2894
|
+
index: flatIndex,
|
|
2895
|
+
ts: now,
|
|
2896
|
+
message: `${step.agent} needs attention after repeated mutating tool failures`,
|
|
2897
|
+
reason: "tool_failures",
|
|
2898
|
+
turns: step.turnCount,
|
|
2899
|
+
tokens: step.tokens?.total,
|
|
2900
|
+
toolCount: step.toolCount,
|
|
2901
|
+
currentTool: toolSnapshot.tool,
|
|
2902
|
+
currentToolDurationMs: toolSnapshot.startedAt ? Math.max(0, now - toolSnapshot.startedAt) : undefined,
|
|
2903
|
+
currentPath: toolSnapshot.path,
|
|
2904
|
+
recentFailureSummary: summarizeRecentMutatingFailures(state),
|
|
2905
|
+
})));
|
|
2906
|
+
}
|
|
2907
|
+
} else if (toolSnapshot?.mutates) {
|
|
2908
|
+
resetMutatingFailureState(mutatingFailureStates[flatIndex]!);
|
|
2909
|
+
}
|
|
2910
|
+
} else if (event.type === "message_end" && event.message?.role === "assistant") {
|
|
2911
|
+
appendRecentStepOutput(step, stripAcceptanceReport(extractTextFromContent(event.message.content)).split("\n").slice(-10));
|
|
2912
|
+
step.turnCount = (step.turnCount ?? 0) + 1;
|
|
2913
|
+
const usage = event.message.usage;
|
|
2914
|
+
if (usage) {
|
|
2915
|
+
const input = usage.input ?? usage.inputTokens ?? 0;
|
|
2916
|
+
const output = usage.output ?? usage.outputTokens ?? 0;
|
|
2917
|
+
const previousInput = step.tokens?.input ?? 0;
|
|
2918
|
+
const previousOutput = step.tokens?.output ?? 0;
|
|
2919
|
+
step.tokens = { input: previousInput + input, output: previousOutput + output, total: previousInput + previousOutput + input + output };
|
|
2920
|
+
const totalInput = statusPayload.totalTokens?.input ?? 0;
|
|
2921
|
+
const totalOutput = statusPayload.totalTokens?.output ?? 0;
|
|
2922
|
+
statusPayload.totalTokens = { input: totalInput + input, output: totalOutput + output, total: totalInput + totalOutput + input + output };
|
|
2923
|
+
refreshUsageBudget();
|
|
2924
|
+
}
|
|
2925
|
+
statusPayload.turnCount = Math.max(statusPayload.turnCount ?? 0, step.turnCount);
|
|
2926
|
+
updateStepTurnBudget(
|
|
2927
|
+
flatIndex,
|
|
2928
|
+
step.turnCount,
|
|
2929
|
+
now,
|
|
2930
|
+
isTerminalAssistantStop(event.message),
|
|
2931
|
+
assistantStartsToolCall(event.message) || Boolean(step.currentTool),
|
|
2932
|
+
);
|
|
2933
|
+
}
|
|
2934
|
+
syncTopLevelCurrentTool();
|
|
2935
|
+
step.lastActivityAt = now;
|
|
2936
|
+
statusPayload.lastActivityAt = now;
|
|
2937
|
+
statusPayload.lastUpdate = now;
|
|
2938
|
+
maybeEmitActiveLongRunning(flatIndex, now);
|
|
2939
|
+
writeStatusPayload(false);
|
|
2940
|
+
};
|
|
2941
|
+
const updateRunnerActivityState = (now: number): boolean => {
|
|
2942
|
+
if (!controlConfig.enabled) return false;
|
|
2943
|
+
let changed = false;
|
|
2944
|
+
let runLastActivityAt = statusPayload.lastActivityAt ?? overallStartTime;
|
|
2945
|
+
for (let index = 0; index < statusPayload.steps.length; index++) {
|
|
2946
|
+
const step = statusPayload.steps[index]!;
|
|
2947
|
+
if (step.status !== "running") continue;
|
|
2948
|
+
const lastActivityAt = stepOutputActivityAt(index);
|
|
2949
|
+
runLastActivityAt = Math.max(runLastActivityAt, lastActivityAt);
|
|
2950
|
+
if (step.lastActivityAt !== lastActivityAt) {
|
|
2951
|
+
step.lastActivityAt = lastActivityAt;
|
|
2952
|
+
changed = true;
|
|
2953
|
+
}
|
|
2954
|
+
const idleState = deriveActivityState(omitUndefinedProperties({
|
|
2955
|
+
config: controlConfig,
|
|
2956
|
+
startedAt: step.startedAt ?? overallStartTime,
|
|
2957
|
+
lastActivityAt,
|
|
2958
|
+
currentTool: step.currentTool,
|
|
2959
|
+
now,
|
|
2960
|
+
}));
|
|
2961
|
+
if (idleState === "needs_attention") {
|
|
2962
|
+
const previous = step.activityState;
|
|
2963
|
+
step.activityState = "needs_attention";
|
|
2964
|
+
if (previous !== "needs_attention") {
|
|
2965
|
+
appendControlEvent(buildControlEvent(omitUndefinedProperties({
|
|
2966
|
+
from: previous,
|
|
2967
|
+
to: "needs_attention",
|
|
2968
|
+
runId: id,
|
|
2969
|
+
agent: step.agent,
|
|
2970
|
+
index,
|
|
2971
|
+
ts: now,
|
|
2972
|
+
lastActivityAt,
|
|
2973
|
+
})));
|
|
2974
|
+
changed = true;
|
|
2975
|
+
}
|
|
2976
|
+
} else if (maybeEmitActiveLongRunning(index, now)) {
|
|
2977
|
+
changed = true;
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
if (statusPayload.lastActivityAt !== runLastActivityAt) {
|
|
2981
|
+
statusPayload.lastActivityAt = runLastActivityAt;
|
|
2982
|
+
changed = true;
|
|
2983
|
+
}
|
|
2984
|
+
const nextRunState = statusPayload.steps.some((step) => step.activityState === "needs_attention")
|
|
2985
|
+
? "needs_attention"
|
|
2986
|
+
: statusPayload.steps.some((step) => step.activityState === "active_long_running")
|
|
2987
|
+
? "active_long_running"
|
|
2988
|
+
: undefined;
|
|
2989
|
+
if (nextRunState !== currentActivityState) {
|
|
2990
|
+
currentActivityState = nextRunState;
|
|
2991
|
+
setOptionalProperty(statusPayload, "activityState", nextRunState);
|
|
2992
|
+
changed = true;
|
|
2993
|
+
}
|
|
2994
|
+
statusPayload.lastUpdate = now;
|
|
2995
|
+
if (changed) writeStatusPayload();
|
|
2996
|
+
return changed;
|
|
2997
|
+
};
|
|
2998
|
+
if (controlConfig.enabled) {
|
|
2999
|
+
activityTimer = setInterval(() => {
|
|
3000
|
+
if (statusPayload.state !== "running") return;
|
|
3001
|
+
const now = Date.now();
|
|
3002
|
+
updateRunnerActivityState(now);
|
|
3003
|
+
}, 1000);
|
|
3004
|
+
activityTimer.unref?.();
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
const interruptRunner = () => {
|
|
3008
|
+
consumeInterruptRequest(asyncDir);
|
|
3009
|
+
if (interrupted || statusPayload.state !== "running") return;
|
|
3010
|
+
interrupted = true;
|
|
3011
|
+
const now = Date.now();
|
|
3012
|
+
statusPayload.state = "paused";
|
|
3013
|
+
currentActivityState = undefined;
|
|
3014
|
+
delete statusPayload.activityState;
|
|
3015
|
+
statusPayload.lastUpdate = now;
|
|
3016
|
+
for (const step of statusPayload.steps) {
|
|
3017
|
+
if (step.status === "running") {
|
|
3018
|
+
step.status = "paused";
|
|
3019
|
+
delete step.activityState;
|
|
3020
|
+
step.endedAt = now;
|
|
3021
|
+
setOptionalProperty(step, "durationMs", step.startedAt ? now - step.startedAt : undefined);
|
|
3022
|
+
step.lastActivityAt = now;
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
writeStatusPayload();
|
|
3026
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
3027
|
+
type: "subagent.run.paused",
|
|
3028
|
+
ts: now,
|
|
3029
|
+
runId: id,
|
|
3030
|
+
}));
|
|
3031
|
+
interruptNestedAsyncDescendants();
|
|
3032
|
+
interruptActiveChildren();
|
|
3033
|
+
};
|
|
3034
|
+
const stopRunner = () => {
|
|
3035
|
+
if (stopped || timedOut || interrupted || statusPayload.state !== "running") return;
|
|
3036
|
+
stopped = true;
|
|
3037
|
+
const now = Date.now();
|
|
3038
|
+
statusPayload.state = "stopped";
|
|
3039
|
+
statusPayload.stopped = true;
|
|
3040
|
+
statusPayload.error = stopMessage;
|
|
3041
|
+
currentActivityState = undefined;
|
|
3042
|
+
delete statusPayload.activityState;
|
|
3043
|
+
statusPayload.lastUpdate = now;
|
|
3044
|
+
for (const step of statusPayload.steps) {
|
|
3045
|
+
if (step.status !== "running" && step.status !== "pending") continue;
|
|
3046
|
+
step.status = "stopped";
|
|
3047
|
+
step.error = stopMessage;
|
|
3048
|
+
step.exitCode = 1;
|
|
3049
|
+
step.stopped = true;
|
|
3050
|
+
delete step.activityState;
|
|
3051
|
+
step.endedAt = now;
|
|
3052
|
+
step.durationMs = step.startedAt ? now - step.startedAt : 0;
|
|
3053
|
+
step.lastActivityAt = now;
|
|
3054
|
+
}
|
|
3055
|
+
writeStatusPayload();
|
|
3056
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
3057
|
+
type: "subagent.run.stopped",
|
|
3058
|
+
ts: now,
|
|
3059
|
+
runId: id,
|
|
3060
|
+
message: stopMessage,
|
|
3061
|
+
}));
|
|
3062
|
+
stopAbortController.abort();
|
|
3063
|
+
stopNestedAsyncDescendants();
|
|
3064
|
+
stopActiveChildren();
|
|
3065
|
+
};
|
|
3066
|
+
const timeoutRunner = () => {
|
|
3067
|
+
if (timedOut || stopped || interrupted || statusPayload.state !== "running") return;
|
|
3068
|
+
timedOut = true;
|
|
3069
|
+
const now = Date.now();
|
|
3070
|
+
const message = timeoutMessage ?? "Subagent timed out.";
|
|
3071
|
+
statusPayload.state = "failed";
|
|
3072
|
+
statusPayload.timedOut = true;
|
|
3073
|
+
statusPayload.error = message;
|
|
3074
|
+
currentActivityState = undefined;
|
|
3075
|
+
delete statusPayload.activityState;
|
|
3076
|
+
statusPayload.lastUpdate = now;
|
|
3077
|
+
for (const step of statusPayload.steps) {
|
|
3078
|
+
if (step.status !== "running" && step.status !== "pending") continue;
|
|
3079
|
+
step.status = "failed";
|
|
3080
|
+
step.error = message;
|
|
3081
|
+
step.exitCode = 1;
|
|
3082
|
+
step.timedOut = true;
|
|
3083
|
+
delete step.activityState;
|
|
3084
|
+
step.endedAt = now;
|
|
3085
|
+
step.durationMs = step.startedAt ? now - step.startedAt : 0;
|
|
3086
|
+
step.lastActivityAt = now;
|
|
3087
|
+
}
|
|
3088
|
+
writeStatusPayload();
|
|
3089
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
3090
|
+
type: "subagent.run.timed_out",
|
|
3091
|
+
ts: now,
|
|
3092
|
+
runId: id,
|
|
3093
|
+
timeoutMs: config.timeoutMs,
|
|
3094
|
+
deadlineAt: config.deadlineAt,
|
|
3095
|
+
message,
|
|
3096
|
+
}));
|
|
3097
|
+
timeoutAbortController.abort();
|
|
3098
|
+
timeoutNestedAsyncDescendants();
|
|
3099
|
+
timeoutActiveChildren();
|
|
3100
|
+
};
|
|
3101
|
+
process.on(ASYNC_INTERRUPT_SIGNAL, interruptRunner);
|
|
3102
|
+
// Portable control inbox: the parent drops control request files here when
|
|
3103
|
+
// it cannot deliver OS signals (e.g. ENOSYS on Windows) or when steering a
|
|
3104
|
+
// live child. Interrupts still route into the same graceful interruptRunner().
|
|
3105
|
+
const disposeControlInbox = watchAsyncControlInbox(asyncDir, {
|
|
3106
|
+
onInterrupt: interruptRunner,
|
|
3107
|
+
onTimeout: timeoutRunner,
|
|
3108
|
+
onStop: stopRunner,
|
|
3109
|
+
onCheckpointDecision: (decision) => {
|
|
3110
|
+
pendingCheckpointDecision = decision;
|
|
3111
|
+
wakeCheckpointDecision?.();
|
|
3112
|
+
},
|
|
3113
|
+
onSteer: (request) => {
|
|
3114
|
+
const targetStep = request.targetIndex !== undefined ? statusPayload.steps[request.targetIndex] : undefined;
|
|
3115
|
+
if (targetStep?.status === "pending") {
|
|
3116
|
+
deliverSteerRequest(request);
|
|
3117
|
+
pendingStepSteers.push(request);
|
|
3118
|
+
} else if (request.targetIndexes !== undefined || request.targetIndex !== undefined || statusPayload.steps.some((step) => step.status === "running")) {
|
|
3119
|
+
deliverSteerRequest(request);
|
|
3120
|
+
} else {
|
|
3121
|
+
deliverSteerRequest(request);
|
|
3122
|
+
pendingStepSteers.push(request);
|
|
3123
|
+
}
|
|
3124
|
+
},
|
|
3125
|
+
onSteerCapability: (capability) => {
|
|
3126
|
+
steeringCapabilities.set(capability.index, capability);
|
|
3127
|
+
if (!capability.supported) {
|
|
3128
|
+
const now = Date.now();
|
|
3129
|
+
const lifecycle = steeringStatus(statusPayload);
|
|
3130
|
+
for (const request of lifecycle.recent) {
|
|
3131
|
+
if (!request.targets.some((target) => target.index === capability.index && (target.state === "routed" || target.state === "scheduled"))) continue;
|
|
3132
|
+
markSteeringAttention(capability.index);
|
|
3133
|
+
updateSteeringLifecycleTarget(request.id, capability.index, "failed", now, { reason: "child Pi session does not support steering" });
|
|
3134
|
+
emitSteeringEvent("subagent.steer.failed", { type: "steer", id: request.id, ts: request.requestedAt, message: "child Pi session does not support steering" }, capability.index, { reason: "child Pi session does not support steering" });
|
|
3135
|
+
emitTerminalSteeringNotice(request.id, `Steering failed for run ${id}: child ${capability.index} does not support steering.`);
|
|
3136
|
+
}
|
|
3137
|
+
statusPayload.lastUpdate = now;
|
|
3138
|
+
writeStatusPayload();
|
|
3139
|
+
}
|
|
3140
|
+
},
|
|
3141
|
+
onSteerAck: consumeSteerAck,
|
|
3142
|
+
});
|
|
3143
|
+
if (config.deadlineAt !== undefined) {
|
|
3144
|
+
const remainingMs = Math.max(0, config.deadlineAt - Date.now());
|
|
3145
|
+
timeoutTimer = setTimeout(timeoutRunner, remainingMs);
|
|
3146
|
+
timeoutTimer.unref?.();
|
|
3147
|
+
}
|
|
3148
|
+
appendJsonl(
|
|
3149
|
+
eventsPath,
|
|
3150
|
+
JSON.stringify({
|
|
3151
|
+
type: "subagent.run.started",
|
|
3152
|
+
lifecycleArtifactVersion: SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
3153
|
+
ts: overallStartTime,
|
|
3154
|
+
runId: id,
|
|
3155
|
+
mode: statusPayload.mode,
|
|
3156
|
+
cwd,
|
|
3157
|
+
pid: process.pid,
|
|
3158
|
+
}),
|
|
3159
|
+
);
|
|
3160
|
+
|
|
3161
|
+
let flatIndex = 0;
|
|
3162
|
+
let stepCursor = 0;
|
|
3163
|
+
const waitForCheckpointDecision = async (): Promise<"approved" | "rejected" | undefined> => {
|
|
3164
|
+
while (!pendingCheckpointDecision && !interrupted && !timedOut && !stopped) {
|
|
3165
|
+
await new Promise<void>((resolve) => {
|
|
3166
|
+
wakeCheckpointDecision = resolve;
|
|
3167
|
+
const timer = setTimeout(resolve, POLL_INTERVAL_MS);
|
|
3168
|
+
timer.unref?.();
|
|
3169
|
+
});
|
|
3170
|
+
wakeCheckpointDecision = undefined;
|
|
3171
|
+
}
|
|
3172
|
+
const decision = pendingCheckpointDecision;
|
|
3173
|
+
pendingCheckpointDecision = undefined;
|
|
3174
|
+
return decision;
|
|
3175
|
+
};
|
|
3176
|
+
|
|
3177
|
+
while (true) {
|
|
3178
|
+
if (interrupted || timedOut || stopped || turnBudgetExceeded) break;
|
|
3179
|
+
consumePendingAppendRequests();
|
|
3180
|
+
if (stepCursor >= steps.length) break;
|
|
3181
|
+
refreshUsageBudget();
|
|
3182
|
+
if (statusPayload.usageBudget?.exhausted) {
|
|
3183
|
+
usageBudgetExceeded = true;
|
|
3184
|
+
statusPayload.state = "failed";
|
|
3185
|
+
statusPayload.error = usageBudgetExceededMessage(statusPayload.usageBudget);
|
|
3186
|
+
statusPayload.currentStep = flatIndex;
|
|
3187
|
+
statusPayload.lastUpdate = Date.now();
|
|
3188
|
+
writeStatusPayload();
|
|
3189
|
+
break;
|
|
3190
|
+
}
|
|
3191
|
+
const stepIndex = stepCursor++;
|
|
3192
|
+
const step = steps[stepIndex]!;
|
|
3193
|
+
|
|
3194
|
+
if (isCheckpointRunnerStep(step)) {
|
|
3195
|
+
const now = Date.now();
|
|
3196
|
+
const statusStep = statusPayload.steps[flatIndex];
|
|
3197
|
+
const checkpoint = { name: step.checkpoint, ...(step.message ? { message: step.message } : {}), status: "pending" as const, stepIndex };
|
|
3198
|
+
statusPayload.state = "paused";
|
|
3199
|
+
statusPayload.currentStep = flatIndex;
|
|
3200
|
+
statusPayload.checkpoint = checkpoint;
|
|
3201
|
+
delete statusPayload.activityState;
|
|
3202
|
+
statusPayload.lastUpdate = now;
|
|
3203
|
+
if (statusStep) {
|
|
3204
|
+
statusStep.status = "paused";
|
|
3205
|
+
statusStep.startedAt = now;
|
|
3206
|
+
statusStep.checkpoint = checkpoint;
|
|
3207
|
+
}
|
|
3208
|
+
writeStatusPayload();
|
|
3209
|
+
appendJsonl(eventsPath, JSON.stringify({ type: "subagent.checkpoint.paused", ts: now, runId: id, stepIndex, checkpoint }));
|
|
3210
|
+
const decision = await waitForCheckpointDecision();
|
|
3211
|
+
if (decision === "approved") {
|
|
3212
|
+
const approvedAt = Date.now();
|
|
3213
|
+
const approved = { ...checkpoint, status: "approved" as const, approvedAt };
|
|
3214
|
+
statusPayload.state = "running";
|
|
3215
|
+
statusPayload.checkpoint = approved;
|
|
3216
|
+
if (statusStep) {
|
|
3217
|
+
statusStep.status = "complete";
|
|
3218
|
+
statusStep.endedAt = approvedAt;
|
|
3219
|
+
statusStep.durationMs = approvedAt - now;
|
|
3220
|
+
statusStep.exitCode = 0;
|
|
3221
|
+
statusStep.checkpoint = approved;
|
|
3222
|
+
}
|
|
3223
|
+
statusPayload.lastUpdate = approvedAt;
|
|
3224
|
+
writeStatusPayload();
|
|
3225
|
+
appendJsonl(eventsPath, JSON.stringify({ type: "subagent.checkpoint.approved", ts: approvedAt, runId: id, stepIndex, checkpoint: approved }));
|
|
3226
|
+
flatIndex++;
|
|
3227
|
+
continue;
|
|
3228
|
+
}
|
|
3229
|
+
if (decision === "rejected") {
|
|
3230
|
+
const rejectedAt = Date.now();
|
|
3231
|
+
const rejected = { ...checkpoint, status: "rejected" as const, rejectedAt };
|
|
3232
|
+
checkpointRejected = true;
|
|
3233
|
+
statusPayload.state = "rejected";
|
|
3234
|
+
statusPayload.error = `Checkpoint '${step.checkpoint}' rejected.`;
|
|
3235
|
+
statusPayload.checkpoint = rejected;
|
|
3236
|
+
if (statusStep) {
|
|
3237
|
+
statusStep.status = "rejected";
|
|
3238
|
+
statusStep.error = statusPayload.error;
|
|
3239
|
+
statusStep.endedAt = rejectedAt;
|
|
3240
|
+
statusStep.durationMs = rejectedAt - now;
|
|
3241
|
+
statusStep.exitCode = 1;
|
|
3242
|
+
statusStep.checkpoint = rejected;
|
|
3243
|
+
}
|
|
3244
|
+
statusPayload.lastUpdate = rejectedAt;
|
|
3245
|
+
writeStatusPayload();
|
|
3246
|
+
appendJsonl(eventsPath, JSON.stringify({ type: "subagent.checkpoint.rejected", ts: rejectedAt, runId: id, stepIndex, checkpoint: rejected }));
|
|
3247
|
+
break;
|
|
3248
|
+
}
|
|
3249
|
+
break;
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3252
|
+
if (isDynamicRunnerGroup(step)) {
|
|
3253
|
+
const groupStartFlatIndex = flatIndex;
|
|
3254
|
+
let materialized: ReturnType<typeof materializeDynamicParallelStep>;
|
|
3255
|
+
try {
|
|
3256
|
+
materialized = materializeDynamicParallelStep(step as Parameters<typeof materializeDynamicParallelStep>[0], outputs, stepIndex, omitUndefinedProperties({ maxItems: config.dynamicFanoutMaxItems, allowRunnerFields: true }));
|
|
3257
|
+
if (materialized.parallel.length > 1 && step.parallel.outputPath && !step.parallel.namespaceOutputPath) {
|
|
3258
|
+
throw new DynamicFanoutError(`Dynamic chain step ${stepIndex + 1} materialized ${materialized.parallel.length} items that resolve output to the same path: ${step.parallel.outputPath}. Remove the explicit output path or use an inherited relative agent output so each item can be isolated.`);
|
|
3259
|
+
}
|
|
3260
|
+
if (materialized.collectedOnEmpty) await validateDynamicCollection(step.collect.outputSchema, materialized.collectedOnEmpty);
|
|
3261
|
+
} catch (error) {
|
|
3262
|
+
const now = Date.now();
|
|
3263
|
+
const message = error instanceof DynamicFanoutError ? error.message : error instanceof Error ? error.message : String(error);
|
|
3264
|
+
statusPayload.state = "failed";
|
|
3265
|
+
statusPayload.error = message;
|
|
3266
|
+
statusPayload.currentStep = flatIndex;
|
|
3267
|
+
const placeholder = statusPayload.steps[groupStartFlatIndex];
|
|
3268
|
+
if (placeholder) {
|
|
3269
|
+
placeholder.status = "failed";
|
|
3270
|
+
placeholder.error = message;
|
|
3271
|
+
placeholder.startedAt = now;
|
|
3272
|
+
placeholder.endedAt = now;
|
|
3273
|
+
placeholder.durationMs = 0;
|
|
3274
|
+
placeholder.exitCode = 1;
|
|
3275
|
+
}
|
|
3276
|
+
statusPayload.lastUpdate = now;
|
|
3277
|
+
markDynamicGraphGroup(stepIndex, "failed", message);
|
|
3278
|
+
writeStatusPayload();
|
|
3279
|
+
results.push(omitUndefinedProperties({ agent: step.parallel.agent, context: step.parallel.context, output: message, error: message, success: false, exitCode: 1 }));
|
|
3280
|
+
break;
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3283
|
+
const effectiveDynamicGroupAcceptance = resolveEffectiveAcceptance(omitUndefinedProperties({
|
|
3284
|
+
explicit: step.acceptanceInput,
|
|
3285
|
+
agentName: step.parallel.agent,
|
|
3286
|
+
acceptanceRole: step.acceptanceRole,
|
|
3287
|
+
task: materialized.parallel.map((task) => task.task ?? step.parallel.task).join("\n") || step.parallel.task,
|
|
3288
|
+
mode: config.mode,
|
|
3289
|
+
async: true,
|
|
3290
|
+
dynamicGroup: true,
|
|
3291
|
+
agentContract: step.agentContract,
|
|
3292
|
+
}));
|
|
3293
|
+
|
|
3294
|
+
if (materialized.parallel.length === 0) {
|
|
3295
|
+
const now = Date.now();
|
|
3296
|
+
const collection = materialized.collectedOnEmpty ?? [];
|
|
3297
|
+
outputs[step.collect.as] = {
|
|
3298
|
+
text: JSON.stringify(collection),
|
|
3299
|
+
structured: collection,
|
|
3300
|
+
agent: step.parallel.agent,
|
|
3301
|
+
stepIndex,
|
|
3302
|
+
};
|
|
3303
|
+
statusPayload.outputs = outputs;
|
|
3304
|
+
const placeholder = statusPayload.steps[groupStartFlatIndex];
|
|
3305
|
+
if (placeholder) {
|
|
3306
|
+
placeholder.status = "complete";
|
|
3307
|
+
placeholder.startedAt = now;
|
|
3308
|
+
placeholder.endedAt = now;
|
|
3309
|
+
placeholder.durationMs = 0;
|
|
3310
|
+
}
|
|
3311
|
+
previousOutput = "Dynamic fanout produced 0 results.";
|
|
3312
|
+
const groupAcceptance = effectiveDynamicGroupAcceptance.explicit && !timedOut && !stopped
|
|
3313
|
+
? await evaluateAcceptance(omitUndefinedProperties({
|
|
3314
|
+
acceptance: effectiveDynamicGroupAcceptance,
|
|
3315
|
+
output: "",
|
|
3316
|
+
report: aggregateAcceptanceReport({
|
|
3317
|
+
results: [],
|
|
3318
|
+
notes: "Dynamic fanout produced 0 results.",
|
|
3319
|
+
}),
|
|
3320
|
+
cwd,
|
|
3321
|
+
signal: combinedAbortSignal([timeoutAbortController.signal, stopAbortController.signal]),
|
|
3322
|
+
abortMessage: stopAbortController.signal.aborted ? stopMessage : timeoutMessage ?? "Subagent timed out.",
|
|
3323
|
+
reportOptional: isAgentContractV1(step.agentContract),
|
|
3324
|
+
}))
|
|
3325
|
+
: undefined;
|
|
3326
|
+
const groupStopped = stopped || stopAbortController.signal.aborted;
|
|
3327
|
+
const groupTimedOut = !groupStopped && (timedOut || timeoutAbortController.signal.aborted);
|
|
3328
|
+
const effectiveGroupAcceptance = groupTimedOut || groupStopped ? undefined : groupAcceptance;
|
|
3329
|
+
if (placeholder && effectiveGroupAcceptance) placeholder.acceptance = effectiveGroupAcceptance;
|
|
3330
|
+
const groupAcceptanceFailure = effectiveGroupAcceptance && (!isAgentContractV1(step.agentContract) || step.gateOn === "acceptance") ? acceptanceFailureMessage(effectiveGroupAcceptance) : undefined;
|
|
3331
|
+
if (groupTimedOut || groupStopped || groupAcceptanceFailure) {
|
|
3332
|
+
const errorMessage = groupStopped ? stopMessage : groupTimedOut ? timeoutMessage ?? "Subagent timed out." : groupAcceptanceFailure!;
|
|
3333
|
+
statusPayload.state = groupStopped ? "stopped" : "failed";
|
|
3334
|
+
statusPayload.error = errorMessage;
|
|
3335
|
+
setOptionalProperty(statusPayload, "stopped", groupStopped ? true : statusPayload.stopped);
|
|
3336
|
+
if (placeholder) {
|
|
3337
|
+
placeholder.status = groupStopped ? "stopped" : "failed";
|
|
3338
|
+
placeholder.error = errorMessage;
|
|
3339
|
+
placeholder.exitCode = 1;
|
|
3340
|
+
setOptionalProperty(placeholder, "timedOut", groupTimedOut ? true : undefined);
|
|
3341
|
+
setOptionalProperty(placeholder, "stopped", groupStopped ? true : undefined);
|
|
3342
|
+
}
|
|
3343
|
+
markDynamicGraphGroup(stepIndex, groupStopped ? "stopped" : "failed", errorMessage, effectiveGroupAcceptance);
|
|
3344
|
+
statusPayload.lastUpdate = Date.now();
|
|
3345
|
+
writeStatusPayload();
|
|
3346
|
+
results.push(omitUndefinedProperties({ agent: step.parallel.agent, context: step.parallel.context, output: errorMessage, error: errorMessage, success: false, exitCode: 1, timedOut: groupTimedOut ? true : undefined, stopped: groupStopped ? true : undefined, acceptance: effectiveGroupAcceptance }));
|
|
3347
|
+
break;
|
|
3348
|
+
}
|
|
3349
|
+
flatIndex++;
|
|
3350
|
+
statusPayload.lastUpdate = now;
|
|
3351
|
+
markDynamicGraphGroup(stepIndex, "completed", undefined, effectiveGroupAcceptance);
|
|
3352
|
+
writeStatusPayload();
|
|
3353
|
+
continue;
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
const dynamicSteps = materialized.parallel.map((task, itemIndex) => {
|
|
3357
|
+
const thinkingOverride = step.thinkingOverrides?.[itemIndex];
|
|
3358
|
+
const model = thinkingOverride ? applyThinkingSuffix(step.parallel.model, thinkingOverride, true) : step.parallel.model;
|
|
3359
|
+
const thinking = thinkingOverride ? resolveEffectiveThinking(model, thinkingOverride) : undefined;
|
|
3360
|
+
const outputPath = step.parallel.namespaceOutputPath && step.parallel.outputPath
|
|
3361
|
+
? path.join(path.dirname(step.parallel.outputPath), `dynamic-${stepIndex}`, `${itemIndex}-${step.parallel.agent}`, path.basename(step.parallel.outputPath))
|
|
3362
|
+
: step.parallel.outputPath;
|
|
3363
|
+
const taskText = task.task ?? step.parallel.task;
|
|
3364
|
+
const materializedTask = step.parallel.namespaceOutputPath ? injectSingleOutputInstruction(taskText, outputPath, step.parallel) : taskText;
|
|
3365
|
+
return omitUndefinedProperties({
|
|
3366
|
+
...step.parallel,
|
|
3367
|
+
task: materializedTask,
|
|
3368
|
+
effectiveAcceptance: resolveEffectiveAcceptance(omitUndefinedProperties({
|
|
3369
|
+
explicit: step.parallel.acceptanceInput,
|
|
3370
|
+
agentName: step.parallel.agent,
|
|
3371
|
+
acceptanceRole: step.parallel.acceptanceRole,
|
|
3372
|
+
task: materializedTask,
|
|
3373
|
+
mode: config.mode,
|
|
3374
|
+
async: true,
|
|
3375
|
+
dynamic: step.parallel.acceptanceInput === undefined,
|
|
3376
|
+
agentContract: step.parallel.agentContract ?? step.agentContract,
|
|
3377
|
+
})),
|
|
3378
|
+
systemPrompt: step.parallel.namespaceOutputPath ? injectOutputPathSystemPrompt(step.parallel.systemPrompt ?? "", outputPath, step.parallel) : step.parallel.systemPrompt,
|
|
3379
|
+
outputPath,
|
|
3380
|
+
label: task.label ?? step.parallel.label,
|
|
3381
|
+
...(step.sessionFiles?.[itemIndex] ? { sessionFile: step.sessionFiles[itemIndex] } : {}),
|
|
3382
|
+
...(thinkingOverride ? {
|
|
3383
|
+
...(model ? { model } : {}),
|
|
3384
|
+
...(thinking ? { thinking } : {}),
|
|
3385
|
+
...(step.parallel.modelCandidates ? { modelCandidates: step.parallel.modelCandidates.flatMap((candidate) => {
|
|
3386
|
+
const resolved = applyThinkingSuffix(candidate, thinkingOverride, true);
|
|
3387
|
+
return resolved ? [resolved] : [];
|
|
3388
|
+
}) } : {}),
|
|
3389
|
+
} : {}),
|
|
3390
|
+
structuredOutputSchema: step.parallel.structuredOutputSchema ?? step.parallel.structuredOutput?.schema,
|
|
3391
|
+
});
|
|
3392
|
+
});
|
|
3393
|
+
const dynamicFlatStepCount = Math.max(statusPayload.steps.length - 1 + dynamicSteps.length, 1);
|
|
3394
|
+
const dynamicStatusSteps: RunnerStatusStep[] = dynamicSteps.map((task, itemIndex) => {
|
|
3395
|
+
const transcriptPath = resolveAsyncStepTranscriptPath(omitUndefinedProperties({ artifactsDir, artifactConfig, runId: id, agent: task.agent, flatIndex: groupStartFlatIndex + itemIndex, flatStepCount: dynamicFlatStepCount }));
|
|
3396
|
+
return omitUndefinedProperties({
|
|
3397
|
+
agent: task.agent,
|
|
3398
|
+
...(statusStepDescription(task.task) ? { description: statusStepDescription(task.task) } : {}),
|
|
3399
|
+
...(task.context ? { context: task.context } : {}),
|
|
3400
|
+
...(task.phase ?? step.phase ? { phase: task.phase ?? step.phase } : {}),
|
|
3401
|
+
...(task.label ? { label: task.label } : {}),
|
|
3402
|
+
structured: Boolean(task.structuredOutputSchema),
|
|
3403
|
+
...(task.agentContract ? { agentContract: task.agentContract } : {}),
|
|
3404
|
+
...(task.launchResolvedExtensions ? { launchResolvedExtensions: task.launchResolvedExtensions } : {}),
|
|
3405
|
+
...(task.capabilityCeiling ? { capabilityCeiling: task.capabilityCeiling } : {}),
|
|
3406
|
+
status: "pending",
|
|
3407
|
+
...(task.sessionFile ? { sessionFile: task.sessionFile } : {}),
|
|
3408
|
+
...(transcriptPath ? { transcriptPath } : {}),
|
|
3409
|
+
...(task.skills ? { skills: task.skills } : {}),
|
|
3410
|
+
...(task.model ? { model: task.model } : {}),
|
|
3411
|
+
...(task.thinking ? { thinking: task.thinking } : {}),
|
|
3412
|
+
...(task.modelCandidates && task.modelCandidates.length > 0 ? { attemptedModels: task.modelCandidates } : task.model ? { attemptedModels: [task.model] } : {}),
|
|
3413
|
+
recentTools: [],
|
|
3414
|
+
recentOutput: [],
|
|
3415
|
+
});
|
|
3416
|
+
});
|
|
3417
|
+
statusPayload.steps.splice(groupStartFlatIndex, 1, ...dynamicStatusSteps);
|
|
3418
|
+
if (config.childIntercomTargets) {
|
|
3419
|
+
config.childIntercomTargets = statusPayload.steps.map((statusStep, index) => resolveSubagentIntercomTarget(id, statusStep.agent, index));
|
|
3420
|
+
}
|
|
3421
|
+
mutatingFailureStates.splice(groupStartFlatIndex, 1, ...dynamicStatusSteps.map(() => createMutatingFailureState()));
|
|
3422
|
+
pendingToolResults.splice(groupStartFlatIndex, 1, ...dynamicStatusSteps.map(() => undefined));
|
|
3423
|
+
const materializedDelta = dynamicStatusSteps.length - 1;
|
|
3424
|
+
for (const group of statusPayload.parallelGroups) {
|
|
3425
|
+
if (group.stepIndex === stepIndex) {
|
|
3426
|
+
group.start = groupStartFlatIndex;
|
|
3427
|
+
group.count = dynamicStatusSteps.length;
|
|
3428
|
+
} else if (group.start > groupStartFlatIndex) {
|
|
3429
|
+
group.start += materializedDelta;
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
if (statusPayload.workflowGraph) {
|
|
3433
|
+
const shiftFlatIndexes = (nodes: NonNullable<typeof statusPayload.workflowGraph>["nodes"]): void => {
|
|
3434
|
+
for (const node of nodes) {
|
|
3435
|
+
if (node.stepIndex !== undefined && node.stepIndex > stepIndex && node.flatIndex !== undefined && node.flatIndex >= groupStartFlatIndex) {
|
|
3436
|
+
node.flatIndex += dynamicStatusSteps.length;
|
|
3437
|
+
}
|
|
3438
|
+
if (node.children) shiftFlatIndexes(node.children);
|
|
3439
|
+
}
|
|
3440
|
+
};
|
|
3441
|
+
shiftFlatIndexes(statusPayload.workflowGraph.nodes);
|
|
3442
|
+
const groupNode = statusPayload.workflowGraph.nodes.find((node) => node.id === `step-${stepIndex}`);
|
|
3443
|
+
if (groupNode) {
|
|
3444
|
+
groupNode.children = materialized.items.map((item, itemIndex) => omitUndefinedProperties({
|
|
3445
|
+
id: `step-${stepIndex}-item-${item.idKey}`,
|
|
3446
|
+
kind: "agent",
|
|
3447
|
+
agent: step.parallel.agent,
|
|
3448
|
+
phase: dynamicSteps[itemIndex]?.phase ?? step.phase,
|
|
3449
|
+
label: dynamicSteps[itemIndex]?.label?.trim() || `${step.parallel.agent} ${item.key}`,
|
|
3450
|
+
status: "pending",
|
|
3451
|
+
flatIndex: groupStartFlatIndex + itemIndex,
|
|
3452
|
+
stepIndex,
|
|
3453
|
+
itemKey: item.key,
|
|
3454
|
+
structured: Boolean(dynamicSteps[itemIndex]?.structuredOutputSchema),
|
|
3455
|
+
}));
|
|
3456
|
+
}
|
|
3457
|
+
}
|
|
3458
|
+
writeStatusPayload();
|
|
3459
|
+
|
|
3460
|
+
const concurrency = step.concurrency ?? MAX_PARALLEL_CONCURRENCY;
|
|
3461
|
+
const failFast = step.failFast ?? false;
|
|
3462
|
+
let aborted = false;
|
|
3463
|
+
const parallelResults = await mapConcurrent(dynamicSteps, concurrency, async (task, taskIdx): Promise<StepResult> => {
|
|
3464
|
+
const fi = groupStartFlatIndex + taskIdx;
|
|
3465
|
+
refreshUsageBudget();
|
|
3466
|
+
if (statusPayload.usageBudget?.exhausted) {
|
|
3467
|
+
const skippedAt = Date.now();
|
|
3468
|
+
const message = usageBudgetExceededMessage(statusPayload.usageBudget);
|
|
3469
|
+
requiredStatusStep(statusPayload, fi).status = "failed";
|
|
3470
|
+
requiredStatusStep(statusPayload, fi).error = message;
|
|
3471
|
+
requiredStatusStep(statusPayload, fi).startedAt = skippedAt;
|
|
3472
|
+
requiredStatusStep(statusPayload, fi).endedAt = skippedAt;
|
|
3473
|
+
requiredStatusStep(statusPayload, fi).durationMs = 0;
|
|
3474
|
+
requiredStatusStep(statusPayload, fi).exitCode = 1;
|
|
3475
|
+
statusPayload.lastUpdate = skippedAt;
|
|
3476
|
+
usageBudgetExceeded = true;
|
|
3477
|
+
writeStatusPayload();
|
|
3478
|
+
appendJsonl(eventsPath, JSON.stringify({ type: "subagent.step.failed", ts: skippedAt, runId: id, stepIndex: fi, agent: task.agent, exitCode: 1, durationMs: 0 }));
|
|
3479
|
+
return omitUndefinedProperties({ agent: task.agent, context: task.context, output: message, error: message, exitCode: 1 as number | null, skipped: true });
|
|
3480
|
+
}
|
|
3481
|
+
if (timedOut) return timedOutStepResult(task.agent, task.context);
|
|
3482
|
+
if (stopped) return stoppedStepResult(task.agent, task.context);
|
|
3483
|
+
if (interrupted) return pausedStepResult(task.agent, task.context);
|
|
3484
|
+
if (aborted && failFast) {
|
|
3485
|
+
const skippedAt = Date.now();
|
|
3486
|
+
requiredStatusStep(statusPayload, fi).status = "failed";
|
|
3487
|
+
requiredStatusStep(statusPayload, fi).error = "Skipped due to fail-fast";
|
|
3488
|
+
requiredStatusStep(statusPayload, fi).startedAt = skippedAt;
|
|
3489
|
+
requiredStatusStep(statusPayload, fi).endedAt = skippedAt;
|
|
3490
|
+
requiredStatusStep(statusPayload, fi).durationMs = 0;
|
|
3491
|
+
requiredStatusStep(statusPayload, fi).exitCode = -1;
|
|
3492
|
+
statusPayload.lastUpdate = skippedAt;
|
|
3493
|
+
writeStatusPayload();
|
|
3494
|
+
return omitUndefinedProperties({ agent: task.agent, context: task.context, output: "(skipped — fail-fast)", exitCode: -1 as number | null, skipped: true });
|
|
3495
|
+
}
|
|
3496
|
+
const taskStartTime = Date.now();
|
|
3497
|
+
statusPayload.currentStep = fi;
|
|
3498
|
+
requiredStatusStep(statusPayload, fi).status = "running";
|
|
3499
|
+
delete requiredStatusStep(statusPayload, fi).error;
|
|
3500
|
+
delete requiredStatusStep(statusPayload, fi).activityState;
|
|
3501
|
+
resetStepLiveDetail(requiredStatusStep(statusPayload, fi));
|
|
3502
|
+
requiredStatusStep(statusPayload, fi).startedAt = taskStartTime;
|
|
3503
|
+
requiredStatusStep(statusPayload, fi).lastActivityAt = taskStartTime;
|
|
3504
|
+
statusPayload.outputFile = path.join(asyncDir, `output-${fi}.log`);
|
|
3505
|
+
statusPayload.lastActivityAt = taskStartTime;
|
|
3506
|
+
statusPayload.lastUpdate = taskStartTime;
|
|
3507
|
+
writeStatusPayload();
|
|
3508
|
+
appendJsonl(eventsPath, JSON.stringify({ type: "subagent.step.started", ts: taskStartTime, runId: id, stepIndex: fi, agent: task.agent }));
|
|
3509
|
+
flushPendingStepSteers(fi);
|
|
3510
|
+
const singleResult = await runSingleStepWithTimeout(task, compactOptional<SingleStepContext>({
|
|
3511
|
+
previousOutput, placeholder, cwd, sessionEnabled,
|
|
3512
|
+
outputs,
|
|
3513
|
+
sessionDir: config.sessionDir ? path.join(config.sessionDir, `dynamic-${stepIndex}-${taskIdx}`) : undefined,
|
|
3514
|
+
artifactsDir, artifactConfig, id,
|
|
3515
|
+
flatIndex: fi, flatStepCount: Math.max(statusPayload.steps.length, 1),
|
|
3516
|
+
outputFile: path.join(asyncDir, `output-${fi}.log`),
|
|
3517
|
+
steerInboxDir: stepSteerInboxDir(asyncDir, fi),
|
|
3518
|
+
steerCapabilityPath: steerCapabilityPath(asyncDir, fi),
|
|
3519
|
+
steerAckDir: steerAcksDir(asyncDir, fi),
|
|
3520
|
+
piPackageRoot: config.piPackageRoot,
|
|
3521
|
+
piArgv1: config.piArgv1,
|
|
3522
|
+
childIntercomTarget: config.childIntercomTargets?.[fi],
|
|
3523
|
+
orchestratorIntercomTarget: config.controlIntercomTarget,
|
|
3524
|
+
nestedRoute: config.nestedRoute,
|
|
3525
|
+
capabilityCeiling: config.capabilityCeiling,
|
|
3526
|
+
registerInterrupt: (interrupt) => registerStepInterrupt(fi, interrupt),
|
|
3527
|
+
registerTimeout: (interrupt) => registerStepTimeout(fi, interrupt),
|
|
3528
|
+
registerStop: (stop) => registerStepStop(fi, stop),
|
|
3529
|
+
registerTurnBudgetAbort: (abort) => registerStepTurnBudgetAbort(fi, abort),
|
|
3530
|
+
timeoutSignal: timeoutAbortController.signal,
|
|
3531
|
+
stopSignal: stopAbortController.signal,
|
|
3532
|
+
timeoutMessage,
|
|
3533
|
+
stopMessage,
|
|
3534
|
+
turnBudget: config.turnBudget,
|
|
3535
|
+
onAttemptStart: (attempt) => updateStepModel(fi, attempt.model, attempt.thinking),
|
|
3536
|
+
onChildEvent: (event) => updateStepFromChildEvent(fi, event),
|
|
3537
|
+
onWriterProcess,
|
|
3538
|
+
onExternalProcess: (process) => updateExternalProcess(fi, process),
|
|
3539
|
+
skipAcceptance: () => timedOut || stopped,
|
|
3540
|
+
}), config.deadlineAt);
|
|
3541
|
+
const taskEndTime = Date.now();
|
|
3542
|
+
const childInterrupted = singleResult.interrupted === true;
|
|
3543
|
+
const childStopped = singleResult.stopped === true;
|
|
3544
|
+
requiredStatusStep(statusPayload, fi).status = stopped || childStopped ? "stopped" : timedOut ? "failed" : childInterrupted ? "paused" : singleResult.exitCode === 0 ? "complete" : "failed";
|
|
3545
|
+
requiredStatusStep(statusPayload, fi).endedAt = taskEndTime;
|
|
3546
|
+
requiredStatusStep(statusPayload, fi).durationMs = taskEndTime - taskStartTime;
|
|
3547
|
+
requiredStatusStep(statusPayload, fi).exitCode = stopped || childStopped ? 1 : timedOut ? 1 : childInterrupted ? 0 : singleResult.exitCode;
|
|
3548
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "timedOut", timedOut || singleResult.timedOut ? true : undefined);
|
|
3549
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "stopped", stopped || childStopped ? true : undefined);
|
|
3550
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "turnBudget", singleResult.turnBudget);
|
|
3551
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "turnBudgetExceeded", singleResult.turnBudgetExceeded);
|
|
3552
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "wrapUpRequested", singleResult.wrapUpRequested);
|
|
3553
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "toolBudget", singleResult.toolBudget);
|
|
3554
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "toolBudgetBlocked", singleResult.toolBudgetBlocked);
|
|
3555
|
+
if (singleResult.toolBudget) statusPayload.toolBudget = singleResult.toolBudget;
|
|
3556
|
+
if (singleResult.toolBudgetBlocked) statusPayload.toolBudgetBlocked = true;
|
|
3557
|
+
if (singleResult.turnBudget) statusPayload.turnBudget = singleResult.turnBudget;
|
|
3558
|
+
if (singleResult.turnBudgetExceeded) statusPayload.turnBudgetExceeded = true;
|
|
3559
|
+
if (singleResult.wrapUpRequested) statusPayload.wrapUpRequested = true;
|
|
3560
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "model", singleResult.model);
|
|
3561
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "thinking", resolveEffectiveThinking(singleResult.model, requiredStatusStep(statusPayload, fi).thinking));
|
|
3562
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "attemptedModels", singleResult.attemptedModels);
|
|
3563
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "modelAttempts", singleResult.modelAttempts);
|
|
3564
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "totalCost", singleResult.totalCost);
|
|
3565
|
+
if (singleResult.totalCost) {
|
|
3566
|
+
pendingParallelUsageCost = {
|
|
3567
|
+
inputTokens: pendingParallelUsageCost.inputTokens + singleResult.totalCost.inputTokens,
|
|
3568
|
+
outputTokens: pendingParallelUsageCost.outputTokens + singleResult.totalCost.outputTokens,
|
|
3569
|
+
costUsd: pendingParallelUsageCost.costUsd + singleResult.totalCost.costUsd,
|
|
3570
|
+
};
|
|
3571
|
+
refreshUsageBudget();
|
|
3572
|
+
}
|
|
3573
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "error", stopped || childStopped ? stopMessage : timedOut ? (timeoutMessage ?? "Subagent timed out.") : singleResult.error);
|
|
3574
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "transcriptPath", singleResult.transcriptPath ?? requiredStatusStep(statusPayload, fi).transcriptPath);
|
|
3575
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "transcriptError", singleResult.transcriptError);
|
|
3576
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "agentContract", singleResult.agentContract);
|
|
3577
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "launchContractDigest", singleResult.launchContractDigest);
|
|
3578
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "launchResolvedExtensions", singleResult.launchResolvedExtensions);
|
|
3579
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "runtimeAcknowledgedExtensions", singleResult.runtimeAcknowledgedExtensions);
|
|
3580
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "effects", singleResult.effects);
|
|
3581
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "execution", singleResult.execution);
|
|
3582
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "review", singleResult.review);
|
|
3583
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "structuredOutput", singleResult.structuredOutput);
|
|
3584
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "structuredOutputPath", singleResult.structuredOutputPath);
|
|
3585
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "structuredOutputSchemaPath", singleResult.structuredOutputSchemaPath);
|
|
3586
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "acceptance", singleResult.acceptance);
|
|
3587
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "watchdog", singleResult.watchdog);
|
|
3588
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "capabilityCeiling", singleResult.capabilityCeiling);
|
|
3589
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "capabilityAudit", singleResult.capabilityAudit);
|
|
3590
|
+
if (singleResult.capabilityCeiling) statusPayload.capabilityCeiling = singleResult.capabilityCeiling;
|
|
3591
|
+
if (singleResult.capabilityAudit) statusPayload.capabilityAudit = singleResult.capabilityAudit;
|
|
3592
|
+
statusPayload.lastUpdate = taskEndTime;
|
|
3593
|
+
writeStatusPayload();
|
|
3594
|
+
appendCapabilityCeilingAppliedEvent(eventsPath, id, fi, task.agent, singleResult);
|
|
3595
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
3596
|
+
type: stopped || childStopped ? "subagent.step.stopped" : timedOut ? "subagent.step.failed" : childInterrupted ? "subagent.step.paused" : singleResult.exitCode === 0 ? "subagent.step.completed" : "subagent.step.failed",
|
|
3597
|
+
ts: taskEndTime, runId: id, stepIndex: fi, agent: task.agent,
|
|
3598
|
+
exitCode: stopped || childStopped ? 1 : timedOut ? 1 : childInterrupted ? 0 : singleResult.exitCode, durationMs: taskEndTime - taskStartTime,
|
|
3599
|
+
}));
|
|
3600
|
+
if (singleResult.exitCode !== 0 && failFast) aborted = true;
|
|
3601
|
+
return stopped || childStopped ? { ...singleResult, output: stopMessage, error: stopMessage, exitCode: 1, interrupted: false, timedOut: false, stopped: true, skipped: false } : timedOut ? { ...singleResult, output: timeoutMessage ?? "Subagent timed out.", error: timeoutMessage ?? "Subagent timed out.", exitCode: 1, interrupted: false, timedOut: true, skipped: false } : { ...singleResult, skipped: false };
|
|
3602
|
+
}, globalSemaphore);
|
|
3603
|
+
|
|
3604
|
+
flatIndex += dynamicSteps.length;
|
|
3605
|
+
for (const pr of parallelResults) {
|
|
3606
|
+
results.push(omitUndefinedProperties({
|
|
3607
|
+
agent: pr.agent,
|
|
3608
|
+
context: pr.context,
|
|
3609
|
+
agentContract: pr.agentContract,
|
|
3610
|
+
launchContractDigest: pr.launchContractDigest,
|
|
3611
|
+
launchResolvedExtensions: pr.launchResolvedExtensions,
|
|
3612
|
+
runtimeAcknowledgedExtensions: pr.runtimeAcknowledgedExtensions,
|
|
3613
|
+
output: pr.output,
|
|
3614
|
+
outputState: pr.outputState,
|
|
3615
|
+
error: pr.error,
|
|
3616
|
+
protocolError: pr.protocolError,
|
|
3617
|
+
success: pr.stopped !== true && pr.interrupted !== true && pr.exitCode === 0,
|
|
3618
|
+
exitCode: pr.interrupted === true ? 0 : pr.exitCode,
|
|
3619
|
+
skipped: pr.skipped,
|
|
3620
|
+
interrupted: pr.interrupted,
|
|
3621
|
+
timedOut: pr.timedOut,
|
|
3622
|
+
stopped: pr.stopped,
|
|
3623
|
+
turnBudget: pr.turnBudget,
|
|
3624
|
+
turnBudgetExceeded: pr.turnBudgetExceeded,
|
|
3625
|
+
wrapUpRequested: pr.wrapUpRequested,
|
|
3626
|
+
toolBudget: pr.toolBudget,
|
|
3627
|
+
toolBudgetBlocked: pr.toolBudgetBlocked,
|
|
3628
|
+
sessionFile: pr.sessionFile,
|
|
3629
|
+
intercomTarget: pr.intercomTarget,
|
|
3630
|
+
model: pr.model,
|
|
3631
|
+
attemptedModels: pr.attemptedModels,
|
|
3632
|
+
modelAttempts: pr.modelAttempts,
|
|
3633
|
+
totalCost: pr.totalCost,
|
|
3634
|
+
artifactPaths: pr.artifactPaths,
|
|
3635
|
+
transcriptPath: pr.transcriptPath,
|
|
3636
|
+
transcriptError: pr.transcriptError,
|
|
3637
|
+
effects: pr.effects,
|
|
3638
|
+
execution: pr.execution,
|
|
3639
|
+
review: pr.review,
|
|
3640
|
+
structuredOutput: pr.structuredOutput,
|
|
3641
|
+
structuredOutputPath: pr.structuredOutputPath,
|
|
3642
|
+
structuredOutputSchemaPath: pr.structuredOutputSchemaPath,
|
|
3643
|
+
acceptance: pr.acceptance,
|
|
3644
|
+
watchdog: pr.watchdog,
|
|
3645
|
+
capabilityCeiling: pr.capabilityCeiling,
|
|
3646
|
+
capabilityAudit: pr.capabilityAudit,
|
|
3647
|
+
}));
|
|
3648
|
+
}
|
|
3649
|
+
pendingParallelUsageCost = { inputTokens: 0, outputTokens: 0, costUsd: 0 };
|
|
3650
|
+
refreshUsageBudget();
|
|
3651
|
+
const collection = collectDynamicResults(step as Parameters<typeof collectDynamicResults>[0], materialized.items, parallelResults);
|
|
3652
|
+
const failures = parallelResults.filter((result) => result.exitCode !== 0 && result.exitCode !== -1);
|
|
3653
|
+
const acceptanceFailures = parallelResults
|
|
3654
|
+
.map((result, originalIndex) => ({ result, originalIndex, task: dynamicSteps[originalIndex] }))
|
|
3655
|
+
.filter(({ result, task }) => isAgentContractV1(task?.agentContract ?? step.agentContract) && task?.gateOn === "acceptance" && result.acceptance?.status === "rejected");
|
|
3656
|
+
if (acceptanceFailures.length > 0) {
|
|
3657
|
+
const message = acceptanceFailures
|
|
3658
|
+
.map(({ result, originalIndex }) => `Dynamic item ${originalIndex + 1} (${result.agent}, key ${materialized.items[originalIndex]?.key ?? originalIndex}) acceptance rejected: ${(result.acceptance ? acceptanceFailureMessage(result.acceptance) : undefined) ?? "acceptance rejected"}`)
|
|
3659
|
+
.join("\n");
|
|
3660
|
+
results.push(omitUndefinedProperties({ agent: step.parallel.agent, context: step.parallel.context, output: message, error: message, success: false, exitCode: 1, structuredOutput: collection }));
|
|
3661
|
+
statusPayload.error = message;
|
|
3662
|
+
markDynamicGraphGroup(stepIndex, "failed", message);
|
|
3663
|
+
}
|
|
3664
|
+
if (failures.length === 0 && acceptanceFailures.length === 0) {
|
|
3665
|
+
try {
|
|
3666
|
+
await validateDynamicCollection(step.collect.outputSchema, collection);
|
|
3667
|
+
outputs[step.collect.as] = {
|
|
3668
|
+
text: JSON.stringify(collection),
|
|
3669
|
+
structured: collection,
|
|
3670
|
+
agent: step.parallel.agent,
|
|
3671
|
+
stepIndex,
|
|
3672
|
+
};
|
|
3673
|
+
statusPayload.outputs = outputs;
|
|
3674
|
+
const groupAcceptance = !timedOut && !stopped
|
|
3675
|
+
? await evaluateAcceptance(omitUndefinedProperties({
|
|
3676
|
+
acceptance: effectiveDynamicGroupAcceptance,
|
|
3677
|
+
output: "",
|
|
3678
|
+
report: aggregateAcceptanceReport({
|
|
3679
|
+
results: parallelResults,
|
|
3680
|
+
notes: `Dynamic fanout collected ${collection.length} result(s) into ${step.collect.as}.`,
|
|
3681
|
+
}),
|
|
3682
|
+
cwd,
|
|
3683
|
+
signal: combinedAbortSignal([timeoutAbortController.signal, stopAbortController.signal]),
|
|
3684
|
+
abortMessage: stopAbortController.signal.aborted ? stopMessage : timeoutMessage ?? "Subagent timed out.",
|
|
3685
|
+
reportOptional: isAgentContractV1(step.agentContract),
|
|
3686
|
+
}))
|
|
3687
|
+
: undefined;
|
|
3688
|
+
const groupStopped = stopped || stopAbortController.signal.aborted;
|
|
3689
|
+
const groupTimedOut = !groupStopped && (timedOut || timeoutAbortController.signal.aborted);
|
|
3690
|
+
const effectiveGroupAcceptance = groupTimedOut || groupStopped ? undefined : groupAcceptance;
|
|
3691
|
+
const groupAcceptanceFailure = effectiveDynamicGroupAcceptance.explicit && effectiveGroupAcceptance && (!isAgentContractV1(step.agentContract) || step.gateOn === "acceptance") ? acceptanceFailureMessage(effectiveGroupAcceptance) : undefined;
|
|
3692
|
+
const groupError = groupStopped ? stopMessage : groupTimedOut ? timeoutMessage ?? "Subagent timed out." : groupAcceptanceFailure;
|
|
3693
|
+
markDynamicGraphGroup(stepIndex, groupError ? groupStopped ? "stopped" : "failed" : "completed", groupError, effectiveGroupAcceptance);
|
|
3694
|
+
if (groupError) {
|
|
3695
|
+
results.push(omitUndefinedProperties({
|
|
3696
|
+
agent: step.parallel.agent,
|
|
3697
|
+
output: groupError,
|
|
3698
|
+
error: groupError,
|
|
3699
|
+
success: false,
|
|
3700
|
+
exitCode: 1,
|
|
3701
|
+
timedOut: groupTimedOut ? true : undefined,
|
|
3702
|
+
stopped: groupStopped ? true : undefined,
|
|
3703
|
+
structuredOutput: collection,
|
|
3704
|
+
acceptance: effectiveGroupAcceptance,
|
|
3705
|
+
}));
|
|
3706
|
+
statusPayload.error = groupError;
|
|
3707
|
+
setOptionalProperty(statusPayload, "stopped", groupStopped ? true : statusPayload.stopped);
|
|
3708
|
+
}
|
|
3709
|
+
} catch (error) {
|
|
3710
|
+
const message = error instanceof DynamicFanoutError ? error.message : error instanceof Error ? error.message : String(error);
|
|
3711
|
+
results.push(omitUndefinedProperties({ agent: step.parallel.agent, context: step.parallel.context, output: message, error: message, success: false, exitCode: 1, structuredOutput: collection }));
|
|
3712
|
+
statusPayload.error = message;
|
|
3713
|
+
markDynamicGraphGroup(stepIndex, "failed", message);
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
previousOutput = aggregateParallelOutputs(
|
|
3717
|
+
parallelResults.map((r, i) => omitUndefinedProperties({
|
|
3718
|
+
agent: r.agent,
|
|
3719
|
+
taskIndex: i,
|
|
3720
|
+
output: r.output,
|
|
3721
|
+
exitCode: r.exitCode,
|
|
3722
|
+
error: r.error,
|
|
3723
|
+
})),
|
|
3724
|
+
(i, agent) => `=== Dynamic Item ${i + 1} (${agent}, key ${materialized.items[i]?.key ?? i}) ===`,
|
|
3725
|
+
);
|
|
3726
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
3727
|
+
type: "subagent.dynamic.completed",
|
|
3728
|
+
ts: Date.now(),
|
|
3729
|
+
runId: id,
|
|
3730
|
+
stepIndex,
|
|
3731
|
+
success: failures.length === 0 && acceptanceFailures.length === 0,
|
|
3732
|
+
}));
|
|
3733
|
+
if (failures.length > 0) markDynamicGraphGroup(stepIndex, "failed", failures[0]?.error ?? "Dynamic fanout child failed.");
|
|
3734
|
+
statusPayload.lastUpdate = Date.now();
|
|
3735
|
+
writeStatusPayload();
|
|
3736
|
+
if (failures.length > 0 || statusPayload.error) break;
|
|
3737
|
+
continue;
|
|
3738
|
+
}
|
|
3739
|
+
|
|
3740
|
+
if (isParallelGroup(step)) {
|
|
3741
|
+
const group = step;
|
|
3742
|
+
const concurrency = group.concurrency ?? MAX_PARALLEL_CONCURRENCY;
|
|
3743
|
+
const failFast = group.failFast ?? false;
|
|
3744
|
+
const groupStartFlatIndex = flatIndex;
|
|
3745
|
+
let aborted = false;
|
|
3746
|
+
let worktreeSetup: WorktreeSetup | undefined;
|
|
3747
|
+
let worktreeFinalized = false;
|
|
3748
|
+
if (group.worktree) {
|
|
3749
|
+
const worktreeTaskCwdConflict = findWorktreeTaskCwdConflict(group.parallel, cwd);
|
|
3750
|
+
if (worktreeTaskCwdConflict) {
|
|
3751
|
+
const failedAt = Date.now();
|
|
3752
|
+
markParallelGroupSetupFailure({
|
|
3753
|
+
statusPayload,
|
|
3754
|
+
results,
|
|
3755
|
+
group,
|
|
3756
|
+
groupStartFlatIndex,
|
|
3757
|
+
setupError: formatWorktreeTaskCwdConflict(worktreeTaskCwdConflict, cwd),
|
|
3758
|
+
failedAt,
|
|
3759
|
+
statusPath,
|
|
3760
|
+
eventsPath,
|
|
3761
|
+
asyncDir,
|
|
3762
|
+
runId: id,
|
|
3763
|
+
stepIndex,
|
|
3764
|
+
});
|
|
3765
|
+
flatIndex += group.parallel.length;
|
|
3766
|
+
break;
|
|
3767
|
+
}
|
|
3768
|
+
try {
|
|
3769
|
+
worktreeSetup = createWorktrees(cwd, `${id}-s${stepIndex}`, group.parallel.length, omitUndefinedProperties({
|
|
3770
|
+
agents: group.parallel.map((task) => task.agent),
|
|
3771
|
+
setupHook: config.worktreeSetupHook
|
|
3772
|
+
? omitUndefinedProperties({ hookPath: config.worktreeSetupHook, timeoutMs: config.worktreeSetupHookTimeoutMs })
|
|
3773
|
+
: undefined,
|
|
3774
|
+
baseDir: config.worktreeBaseDir,
|
|
3775
|
+
}));
|
|
3776
|
+
} catch (error) {
|
|
3777
|
+
const setupError = error instanceof Error ? error.message : String(error);
|
|
3778
|
+
const failedAt = Date.now();
|
|
3779
|
+
markParallelGroupSetupFailure({
|
|
3780
|
+
statusPayload,
|
|
3781
|
+
results,
|
|
3782
|
+
group,
|
|
3783
|
+
groupStartFlatIndex,
|
|
3784
|
+
setupError,
|
|
3785
|
+
failedAt,
|
|
3786
|
+
statusPath,
|
|
3787
|
+
eventsPath,
|
|
3788
|
+
asyncDir,
|
|
3789
|
+
runId: id,
|
|
3790
|
+
stepIndex,
|
|
3791
|
+
});
|
|
3792
|
+
flatIndex += group.parallel.length;
|
|
3793
|
+
break;
|
|
3794
|
+
}
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3797
|
+
try {
|
|
3798
|
+
if (worktreeSetup) {
|
|
3799
|
+
writePendingParallelHandoff({
|
|
3800
|
+
manifestPath: parallelHandoffPath(asyncDir),
|
|
3801
|
+
runId: id,
|
|
3802
|
+
mode: (config.resultMode ?? statusPayload.mode) === "parallel" ? "parallel" : "chain",
|
|
3803
|
+
source: "async",
|
|
3804
|
+
cwd,
|
|
3805
|
+
stepIndex,
|
|
3806
|
+
flatStartIndex: groupStartFlatIndex,
|
|
3807
|
+
setup: worktreeSetup,
|
|
3808
|
+
});
|
|
3809
|
+
}
|
|
3810
|
+
if (group.worktree) ensureParallelProgressFile(cwd, group);
|
|
3811
|
+
const groupStartTime = Date.now();
|
|
3812
|
+
markParallelGroupRunning({
|
|
3813
|
+
statusPayload,
|
|
3814
|
+
group,
|
|
3815
|
+
groupStartFlatIndex,
|
|
3816
|
+
groupStartTime,
|
|
3817
|
+
statusPath,
|
|
3818
|
+
eventsPath,
|
|
3819
|
+
asyncDir,
|
|
3820
|
+
runId: id,
|
|
3821
|
+
stepIndex,
|
|
3822
|
+
});
|
|
3823
|
+
const parallelResults = await mapConcurrent(
|
|
3824
|
+
group.parallel,
|
|
3825
|
+
concurrency,
|
|
3826
|
+
async (task, taskIdx): Promise<StepResult> => {
|
|
3827
|
+
const fi = groupStartFlatIndex + taskIdx;
|
|
3828
|
+
refreshUsageBudget();
|
|
3829
|
+
if (statusPayload.usageBudget?.exhausted) {
|
|
3830
|
+
const skippedAt = Date.now();
|
|
3831
|
+
const message = usageBudgetExceededMessage(statusPayload.usageBudget);
|
|
3832
|
+
requiredStatusStep(statusPayload, fi).status = "failed";
|
|
3833
|
+
requiredStatusStep(statusPayload, fi).error = message;
|
|
3834
|
+
requiredStatusStep(statusPayload, fi).startedAt = skippedAt;
|
|
3835
|
+
requiredStatusStep(statusPayload, fi).endedAt = skippedAt;
|
|
3836
|
+
requiredStatusStep(statusPayload, fi).durationMs = 0;
|
|
3837
|
+
requiredStatusStep(statusPayload, fi).exitCode = 1;
|
|
3838
|
+
delete requiredStatusStep(statusPayload, fi).activityState;
|
|
3839
|
+
statusPayload.lastUpdate = skippedAt;
|
|
3840
|
+
usageBudgetExceeded = true;
|
|
3841
|
+
writeStatusPayload();
|
|
3842
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
3843
|
+
type: "subagent.step.failed", ts: skippedAt, runId: id, stepIndex: fi, agent: task.agent, exitCode: 1, durationMs: 0,
|
|
3844
|
+
}));
|
|
3845
|
+
return omitUndefinedProperties({ agent: task.agent, context: task.context, output: message, error: message, exitCode: 1 as number | null, skipped: true });
|
|
3846
|
+
}
|
|
3847
|
+
if (timedOut) return timedOutStepResult(task.agent, task.context);
|
|
3848
|
+
if (stopped) return stoppedStepResult(task.agent, task.context);
|
|
3849
|
+
if (interrupted) return pausedStepResult(task.agent, task.context);
|
|
3850
|
+
if (aborted && failFast) {
|
|
3851
|
+
const skippedAt = Date.now();
|
|
3852
|
+
requiredStatusStep(statusPayload, fi).status = "failed";
|
|
3853
|
+
requiredStatusStep(statusPayload, fi).error = "Skipped due to fail-fast";
|
|
3854
|
+
requiredStatusStep(statusPayload, fi).startedAt = skippedAt;
|
|
3855
|
+
requiredStatusStep(statusPayload, fi).endedAt = skippedAt;
|
|
3856
|
+
requiredStatusStep(statusPayload, fi).durationMs = 0;
|
|
3857
|
+
requiredStatusStep(statusPayload, fi).exitCode = -1;
|
|
3858
|
+
delete requiredStatusStep(statusPayload, fi).activityState;
|
|
3859
|
+
statusPayload.lastUpdate = skippedAt;
|
|
3860
|
+
writeStatusPayload();
|
|
3861
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
3862
|
+
type: "subagent.step.failed", ts: skippedAt, runId: id, stepIndex: fi, agent: task.agent, exitCode: -1, durationMs: 0,
|
|
3863
|
+
}));
|
|
3864
|
+
return omitUndefinedProperties({ agent: task.agent, context: task.context, output: "(skipped — fail-fast)", exitCode: -1 as number | null, skipped: true });
|
|
3865
|
+
}
|
|
3866
|
+
|
|
3867
|
+
const taskStartTime = Date.now();
|
|
3868
|
+
statusPayload.currentStep = fi;
|
|
3869
|
+
requiredStatusStep(statusPayload, fi).status = "running";
|
|
3870
|
+
delete requiredStatusStep(statusPayload, fi).error;
|
|
3871
|
+
delete requiredStatusStep(statusPayload, fi).activityState;
|
|
3872
|
+
resetStepLiveDetail(requiredStatusStep(statusPayload, fi));
|
|
3873
|
+
requiredStatusStep(statusPayload, fi).startedAt = taskStartTime;
|
|
3874
|
+
delete requiredStatusStep(statusPayload, fi).endedAt;
|
|
3875
|
+
delete requiredStatusStep(statusPayload, fi).durationMs;
|
|
3876
|
+
requiredStatusStep(statusPayload, fi).lastActivityAt = taskStartTime;
|
|
3877
|
+
statusPayload.outputFile = path.join(asyncDir, `output-${fi}.log`);
|
|
3878
|
+
statusPayload.lastActivityAt = taskStartTime;
|
|
3879
|
+
statusPayload.lastUpdate = taskStartTime;
|
|
3880
|
+
writeStatusPayload();
|
|
3881
|
+
|
|
3882
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
3883
|
+
type: "subagent.step.started", ts: taskStartTime, runId: id, stepIndex: fi, agent: task.agent,
|
|
3884
|
+
}));
|
|
3885
|
+
|
|
3886
|
+
const taskSessionDir = config.sessionDir
|
|
3887
|
+
? path.join(config.sessionDir, `parallel-${taskIdx}`)
|
|
3888
|
+
: undefined;
|
|
3889
|
+
const { taskForRun, taskCwd } = prepareParallelTaskRun(task, cwd, worktreeSetup, taskIdx);
|
|
3890
|
+
flushPendingStepSteers(fi);
|
|
3891
|
+
|
|
3892
|
+
const singleResult = await runSingleStepWithTimeout(taskForRun, compactOptional<SingleStepContext>({
|
|
3893
|
+
previousOutput, placeholder, cwd: taskCwd, sessionEnabled,
|
|
3894
|
+
outputs,
|
|
3895
|
+
sessionDir: taskSessionDir,
|
|
3896
|
+
artifactsDir, artifactConfig, id,
|
|
3897
|
+
flatIndex: fi, flatStepCount: Math.max(statusPayload.steps.length, 1),
|
|
3898
|
+
outputFile: path.join(asyncDir, `output-${fi}.log`),
|
|
3899
|
+
steerInboxDir: stepSteerInboxDir(asyncDir, fi),
|
|
3900
|
+
steerCapabilityPath: steerCapabilityPath(asyncDir, fi),
|
|
3901
|
+
steerAckDir: steerAcksDir(asyncDir, fi),
|
|
3902
|
+
piPackageRoot: config.piPackageRoot,
|
|
3903
|
+
piArgv1: config.piArgv1,
|
|
3904
|
+
childIntercomTarget: config.childIntercomTargets?.[fi],
|
|
3905
|
+
orchestratorIntercomTarget: config.controlIntercomTarget,
|
|
3906
|
+
nestedRoute: config.nestedRoute,
|
|
3907
|
+
capabilityCeiling: config.capabilityCeiling,
|
|
3908
|
+
registerInterrupt: (interrupt) => registerStepInterrupt(fi, interrupt),
|
|
3909
|
+
registerTimeout: (interrupt) => registerStepTimeout(fi, interrupt),
|
|
3910
|
+
registerStop: (stop) => registerStepStop(fi, stop),
|
|
3911
|
+
registerTurnBudgetAbort: (abort) => registerStepTurnBudgetAbort(fi, abort),
|
|
3912
|
+
timeoutSignal: timeoutAbortController.signal,
|
|
3913
|
+
stopSignal: stopAbortController.signal,
|
|
3914
|
+
timeoutMessage,
|
|
3915
|
+
stopMessage,
|
|
3916
|
+
turnBudget: config.turnBudget,
|
|
3917
|
+
onAttemptStart: (attempt) => updateStepModel(fi, attempt.model, attempt.thinking),
|
|
3918
|
+
onChildEvent: (event) => updateStepFromChildEvent(fi, event),
|
|
3919
|
+
onWriterProcess,
|
|
3920
|
+
onExternalProcess: (process) => updateExternalProcess(fi, process),
|
|
3921
|
+
skipAcceptance: () => timedOut || stopped,
|
|
3922
|
+
}), config.deadlineAt);
|
|
3923
|
+
if (task.sessionFile) {
|
|
3924
|
+
latestSessionFile = task.sessionFile;
|
|
3925
|
+
}
|
|
3926
|
+
|
|
3927
|
+
const taskEndTime = Date.now();
|
|
3928
|
+
const taskDuration = taskEndTime - taskStartTime;
|
|
3929
|
+
const childInterrupted = singleResult.interrupted === true;
|
|
3930
|
+
const childStopped = singleResult.stopped === true;
|
|
3931
|
+
|
|
3932
|
+
requiredStatusStep(statusPayload, fi).status = stopped || childStopped ? "stopped" : timedOut ? "failed" : childInterrupted ? "paused" : singleResult.exitCode === 0 ? "complete" : "failed";
|
|
3933
|
+
requiredStatusStep(statusPayload, fi).endedAt = taskEndTime;
|
|
3934
|
+
requiredStatusStep(statusPayload, fi).durationMs = taskDuration;
|
|
3935
|
+
requiredStatusStep(statusPayload, fi).exitCode = stopped || childStopped ? 1 : timedOut ? 1 : childInterrupted ? 0 : singleResult.exitCode;
|
|
3936
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "timedOut", timedOut || singleResult.timedOut ? true : undefined);
|
|
3937
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "stopped", stopped || childStopped ? true : undefined);
|
|
3938
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "turnBudget", singleResult.turnBudget);
|
|
3939
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "turnBudgetExceeded", singleResult.turnBudgetExceeded);
|
|
3940
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "wrapUpRequested", singleResult.wrapUpRequested);
|
|
3941
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "toolBudget", singleResult.toolBudget);
|
|
3942
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "toolBudgetBlocked", singleResult.toolBudgetBlocked);
|
|
3943
|
+
if (singleResult.toolBudget) statusPayload.toolBudget = singleResult.toolBudget;
|
|
3944
|
+
if (singleResult.toolBudgetBlocked) statusPayload.toolBudgetBlocked = true;
|
|
3945
|
+
if (singleResult.turnBudget) statusPayload.turnBudget = singleResult.turnBudget;
|
|
3946
|
+
if (singleResult.turnBudgetExceeded) statusPayload.turnBudgetExceeded = true;
|
|
3947
|
+
if (singleResult.wrapUpRequested) statusPayload.wrapUpRequested = true;
|
|
3948
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "model", singleResult.model);
|
|
3949
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "thinking", resolveEffectiveThinking(singleResult.model, requiredStatusStep(statusPayload, fi).thinking));
|
|
3950
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "attemptedModels", singleResult.attemptedModels);
|
|
3951
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "modelAttempts", singleResult.modelAttempts);
|
|
3952
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "totalCost", singleResult.totalCost);
|
|
3953
|
+
if (singleResult.totalCost) {
|
|
3954
|
+
pendingParallelUsageCost = {
|
|
3955
|
+
inputTokens: pendingParallelUsageCost.inputTokens + singleResult.totalCost.inputTokens,
|
|
3956
|
+
outputTokens: pendingParallelUsageCost.outputTokens + singleResult.totalCost.outputTokens,
|
|
3957
|
+
costUsd: pendingParallelUsageCost.costUsd + singleResult.totalCost.costUsd,
|
|
3958
|
+
};
|
|
3959
|
+
refreshUsageBudget();
|
|
3960
|
+
}
|
|
3961
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "error", stopped || childStopped ? stopMessage : timedOut ? (timeoutMessage ?? "Subagent timed out.") : singleResult.error);
|
|
3962
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "transcriptPath", singleResult.transcriptPath ?? requiredStatusStep(statusPayload, fi).transcriptPath);
|
|
3963
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "transcriptError", singleResult.transcriptError);
|
|
3964
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "agentContract", singleResult.agentContract);
|
|
3965
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "launchResolvedExtensions", singleResult.launchResolvedExtensions);
|
|
3966
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "runtimeAcknowledgedExtensions", singleResult.runtimeAcknowledgedExtensions);
|
|
3967
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "effects", singleResult.effects);
|
|
3968
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "execution", singleResult.execution);
|
|
3969
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "review", singleResult.review);
|
|
3970
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "structuredOutput", singleResult.structuredOutput);
|
|
3971
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "structuredOutputPath", singleResult.structuredOutputPath);
|
|
3972
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "structuredOutputSchemaPath", singleResult.structuredOutputSchemaPath);
|
|
3973
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "acceptance", singleResult.acceptance);
|
|
3974
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "watchdog", singleResult.watchdog);
|
|
3975
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "capabilityCeiling", singleResult.capabilityCeiling);
|
|
3976
|
+
setOptionalProperty(requiredStatusStep(statusPayload, fi), "capabilityAudit", singleResult.capabilityAudit);
|
|
3977
|
+
if (singleResult.capabilityCeiling) statusPayload.capabilityCeiling = singleResult.capabilityCeiling;
|
|
3978
|
+
if (singleResult.capabilityAudit) statusPayload.capabilityAudit = singleResult.capabilityAudit;
|
|
3979
|
+
statusPayload.lastUpdate = taskEndTime;
|
|
3980
|
+
writeStatusPayload();
|
|
3981
|
+
appendCapabilityCeilingAppliedEvent(eventsPath, id, fi, task.agent, singleResult);
|
|
3982
|
+
|
|
3983
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
3984
|
+
type: stopped || childStopped ? "subagent.step.stopped" : timedOut ? "subagent.step.failed" : childInterrupted ? "subagent.step.paused" : singleResult.exitCode === 0 ? "subagent.step.completed" : "subagent.step.failed",
|
|
3985
|
+
ts: taskEndTime, runId: id, stepIndex: fi, agent: task.agent,
|
|
3986
|
+
exitCode: stopped || childStopped ? 1 : timedOut ? 1 : childInterrupted ? 0 : singleResult.exitCode, durationMs: taskDuration,
|
|
3987
|
+
}));
|
|
3988
|
+
if (singleResult.completionGuardTriggered) {
|
|
3989
|
+
const event = buildControlEvent(omitUndefinedProperties({
|
|
3990
|
+
from: requiredStatusStep(statusPayload, fi).activityState,
|
|
3991
|
+
to: "needs_attention",
|
|
3992
|
+
runId: id,
|
|
3993
|
+
agent: task.agent,
|
|
3994
|
+
index: fi,
|
|
3995
|
+
ts: taskEndTime,
|
|
3996
|
+
message: `${task.agent} completed without making edits for an implementation task`,
|
|
3997
|
+
reason: "completion_guard",
|
|
3998
|
+
}));
|
|
3999
|
+
appendControlEvent(event);
|
|
4000
|
+
}
|
|
4001
|
+
|
|
4002
|
+
if (singleResult.exitCode !== 0 && failFast) aborted = true;
|
|
4003
|
+
return stopped || childStopped ? { ...singleResult, output: stopMessage, error: stopMessage, exitCode: 1, interrupted: false, timedOut: false, stopped: true, skipped: false } : timedOut ? { ...singleResult, output: timeoutMessage ?? "Subagent timed out.", error: timeoutMessage ?? "Subagent timed out.", exitCode: 1, interrupted: false, timedOut: true, skipped: false } : { ...singleResult, skipped: false };
|
|
4004
|
+
},
|
|
4005
|
+
globalSemaphore,
|
|
4006
|
+
);
|
|
4007
|
+
|
|
4008
|
+
flatIndex += group.parallel.length;
|
|
4009
|
+
|
|
4010
|
+
for (let t = 0; t < group.parallel.length; t++) {
|
|
4011
|
+
const fi = groupStartFlatIndex + t;
|
|
4012
|
+
const sessionTokens = config.sessionDir
|
|
4013
|
+
? parseSessionTokens(path.join(config.sessionDir, `parallel-${t}`))
|
|
4014
|
+
: null;
|
|
4015
|
+
const taskTokens = sessionTokens ?? tokenUsageFromAttempts(parallelResults[t]?.modelAttempts);
|
|
4016
|
+
if (!taskTokens) continue;
|
|
4017
|
+
requiredStatusStep(statusPayload, fi).tokens = taskTokens;
|
|
4018
|
+
previousCumulativeTokens = {
|
|
4019
|
+
input: previousCumulativeTokens.input + taskTokens.input,
|
|
4020
|
+
output: previousCumulativeTokens.output + taskTokens.output,
|
|
4021
|
+
total: previousCumulativeTokens.total + taskTokens.total,
|
|
4022
|
+
};
|
|
4023
|
+
}
|
|
4024
|
+
statusPayload.totalTokens = { ...previousCumulativeTokens };
|
|
4025
|
+
statusPayload.lastUpdate = Date.now();
|
|
4026
|
+
writeStatusPayload();
|
|
4027
|
+
|
|
4028
|
+
for (const pr of parallelResults) {
|
|
4029
|
+
results.push(omitUndefinedProperties({
|
|
4030
|
+
agent: pr.agent,
|
|
4031
|
+
context: pr.context,
|
|
4032
|
+
agentContract: pr.agentContract,
|
|
4033
|
+
launchContractDigest: pr.launchContractDigest,
|
|
4034
|
+
launchResolvedExtensions: pr.launchResolvedExtensions,
|
|
4035
|
+
output: pr.output,
|
|
4036
|
+
outputState: pr.outputState,
|
|
4037
|
+
error: pr.error,
|
|
4038
|
+
protocolError: pr.protocolError,
|
|
4039
|
+
success: pr.stopped !== true && pr.interrupted !== true && pr.exitCode === 0,
|
|
4040
|
+
exitCode: pr.interrupted === true ? 0 : pr.exitCode,
|
|
4041
|
+
skipped: pr.skipped,
|
|
4042
|
+
interrupted: pr.interrupted,
|
|
4043
|
+
timedOut: pr.timedOut,
|
|
4044
|
+
stopped: pr.stopped,
|
|
4045
|
+
turnBudget: pr.turnBudget,
|
|
4046
|
+
turnBudgetExceeded: pr.turnBudgetExceeded,
|
|
4047
|
+
wrapUpRequested: pr.wrapUpRequested,
|
|
4048
|
+
toolBudget: pr.toolBudget,
|
|
4049
|
+
toolBudgetBlocked: pr.toolBudgetBlocked,
|
|
4050
|
+
sessionFile: pr.sessionFile,
|
|
4051
|
+
intercomTarget: pr.intercomTarget,
|
|
4052
|
+
model: pr.model,
|
|
4053
|
+
attemptedModels: pr.attemptedModels,
|
|
4054
|
+
modelAttempts: pr.modelAttempts,
|
|
4055
|
+
totalCost: pr.totalCost,
|
|
4056
|
+
artifactPaths: pr.artifactPaths,
|
|
4057
|
+
transcriptPath: pr.transcriptPath,
|
|
4058
|
+
transcriptError: pr.transcriptError,
|
|
4059
|
+
effects: pr.effects,
|
|
4060
|
+
execution: pr.execution,
|
|
4061
|
+
review: pr.review,
|
|
4062
|
+
structuredOutput: pr.structuredOutput,
|
|
4063
|
+
structuredOutputPath: pr.structuredOutputPath,
|
|
4064
|
+
structuredOutputSchemaPath: pr.structuredOutputSchemaPath,
|
|
4065
|
+
acceptance: pr.acceptance,
|
|
4066
|
+
watchdog: pr.watchdog,
|
|
4067
|
+
}));
|
|
4068
|
+
}
|
|
4069
|
+
pendingParallelUsageCost = { inputTokens: 0, outputTokens: 0, costUsd: 0 };
|
|
4070
|
+
refreshUsageBudget();
|
|
4071
|
+
for (let t = 0; t < group.parallel.length; t++) {
|
|
4072
|
+
const outputName = group.parallel[t]?.outputName;
|
|
4073
|
+
if (outputName) outputs[outputName] = outputEntryFromAsyncResult({
|
|
4074
|
+
agent: parallelResults[t]!.agent,
|
|
4075
|
+
output: parallelResults[t]!.output,
|
|
4076
|
+
structuredOutput: parallelResults[t]!.structuredOutput,
|
|
4077
|
+
}, stepIndex);
|
|
4078
|
+
}
|
|
4079
|
+
statusPayload.outputs = outputs;
|
|
4080
|
+
|
|
4081
|
+
previousOutput = aggregateParallelOutputs(
|
|
4082
|
+
parallelResults.map((r) => omitUndefinedProperties({
|
|
4083
|
+
agent: r.agent,
|
|
4084
|
+
output: r.output,
|
|
4085
|
+
exitCode: r.exitCode,
|
|
4086
|
+
error: r.error,
|
|
4087
|
+
model: r.model,
|
|
4088
|
+
attemptedModels: r.attemptedModels,
|
|
4089
|
+
})),
|
|
4090
|
+
);
|
|
4091
|
+
if (worktreeSetup) {
|
|
4092
|
+
const captured = captureParallelWorktreeDiffs(worktreeSetup, asyncDir, stepIndex, group);
|
|
4093
|
+
if (captured.summary) previousOutput = `${previousOutput}\n\n${captured.summary}`;
|
|
4094
|
+
worktreeFinalized = true;
|
|
4095
|
+
const manifestPath = parallelHandoffPath(asyncDir);
|
|
4096
|
+
const handoff = {
|
|
4097
|
+
manifestPath,
|
|
4098
|
+
runId: id,
|
|
4099
|
+
mode: (config.resultMode ?? statusPayload.mode) === "parallel" ? "parallel" as const : "chain" as const,
|
|
4100
|
+
source: "async" as const,
|
|
4101
|
+
cwd,
|
|
4102
|
+
stepIndex,
|
|
4103
|
+
flatStartIndex: groupStartFlatIndex,
|
|
4104
|
+
setup: worktreeSetup,
|
|
4105
|
+
diffs: captured.diffs,
|
|
4106
|
+
results: parallelResults.map((result) => ({
|
|
4107
|
+
agent: result.agent,
|
|
4108
|
+
status: result.stopped || (result.exitCode !== 0 && isUnexplainedProcessSignal(omitUndefinedProperties({
|
|
4109
|
+
processSignal: result.processSignal,
|
|
4110
|
+
interrupted: result.interrupted,
|
|
4111
|
+
timedOut: result.timedOut,
|
|
4112
|
+
stopped: result.stopped,
|
|
4113
|
+
turnBudgetExceeded: result.turnBudgetExceeded,
|
|
4114
|
+
}))) ? "stopped" as const : result.interrupted ? "paused" as const : result.exitCode === 0 ? "completed" as const : "failed" as const,
|
|
4115
|
+
summary: result.output || result.error || "(no output)",
|
|
4116
|
+
...(result.artifactPaths?.outputPath ? { outputPath: result.artifactPaths.outputPath } : {}),
|
|
4117
|
+
...(result.structuredOutput !== undefined ? { structuredOutput: result.structuredOutput } : {}),
|
|
4118
|
+
...(result.structuredOutputPath ? { structuredOutputPath: result.structuredOutputPath } : {}),
|
|
4119
|
+
...(result.sessionFile ? { sessionPath: result.sessionFile } : {}),
|
|
4120
|
+
})),
|
|
4121
|
+
};
|
|
4122
|
+
try {
|
|
4123
|
+
writeParallelHandoffGroup(handoff);
|
|
4124
|
+
const cleanup = cleanupWorktrees(worktreeSetup, { kind: "preserve", capturedDiffs: captured.diffs, handoffManifestPath: manifestPath });
|
|
4125
|
+
statusPayload.parallelHandoff = writeParallelHandoffGroup({ ...handoff, cleanup });
|
|
4126
|
+
previousOutput = `${previousOutput}\n\n${formatParallelHandoffReference(statusPayload.parallelHandoff)}`;
|
|
4127
|
+
} catch (error) {
|
|
4128
|
+
previousOutput = `${previousOutput}\n\n${formatParallelHandoffError(error)}`;
|
|
4129
|
+
}
|
|
4130
|
+
writeStatusPayload();
|
|
4131
|
+
}
|
|
4132
|
+
|
|
4133
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
4134
|
+
type: "subagent.parallel.completed",
|
|
4135
|
+
ts: Date.now(),
|
|
4136
|
+
runId: id,
|
|
4137
|
+
stepIndex,
|
|
4138
|
+
success: parallelResults.every((r) => r.exitCode === 0 || r.exitCode === -1)
|
|
4139
|
+
&& parallelResults.every((result, index) => !(isAgentContractV1(group.parallel[index]?.agentContract) && group.parallel[index]?.gateOn === "acceptance" && result.acceptance?.status === "rejected")),
|
|
4140
|
+
}));
|
|
4141
|
+
|
|
4142
|
+
const acceptanceGateFailure = parallelResults
|
|
4143
|
+
.map((result, index) => ({ result, index, task: group.parallel[index] }))
|
|
4144
|
+
.find(({ result, task }) => isAgentContractV1(task?.agentContract) && task?.gateOn === "acceptance" && result.acceptance?.status === "rejected");
|
|
4145
|
+
if (acceptanceGateFailure) {
|
|
4146
|
+
statusPayload.error = (acceptanceGateFailure.result.acceptance ? acceptanceFailureMessage(acceptanceGateFailure.result.acceptance) : undefined) ?? "Parallel acceptance gate rejected the step.";
|
|
4147
|
+
writeStatusPayload();
|
|
4148
|
+
break;
|
|
4149
|
+
}
|
|
4150
|
+
if (parallelResults.some((r) => r.exitCode !== 0 && r.exitCode !== -1)) {
|
|
4151
|
+
break;
|
|
4152
|
+
}
|
|
4153
|
+
} finally {
|
|
4154
|
+
if (worktreeSetup && !worktreeFinalized) cleanupWorktrees(worktreeSetup);
|
|
4155
|
+
}
|
|
4156
|
+
} else {
|
|
4157
|
+
const seqStep = step as SubagentStep;
|
|
4158
|
+
const stepStartTime = Date.now();
|
|
4159
|
+
statusPayload.currentStep = flatIndex;
|
|
4160
|
+
requiredStatusStep(statusPayload, flatIndex).status = "running";
|
|
4161
|
+
delete requiredStatusStep(statusPayload, flatIndex).activityState;
|
|
4162
|
+
delete statusPayload.activityState;
|
|
4163
|
+
resetStepLiveDetail(requiredStatusStep(statusPayload, flatIndex));
|
|
4164
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "skills", seqStep.skills);
|
|
4165
|
+
requiredStatusStep(statusPayload, flatIndex).startedAt = stepStartTime;
|
|
4166
|
+
requiredStatusStep(statusPayload, flatIndex).lastActivityAt = stepStartTime;
|
|
4167
|
+
statusPayload.lastActivityAt = stepStartTime;
|
|
4168
|
+
statusPayload.lastUpdate = stepStartTime;
|
|
4169
|
+
statusPayload.outputFile = path.join(asyncDir, `output-${flatIndex}.log`);
|
|
4170
|
+
writeStatusPayload();
|
|
4171
|
+
|
|
4172
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
4173
|
+
type: "subagent.step.started",
|
|
4174
|
+
ts: stepStartTime,
|
|
4175
|
+
runId: id,
|
|
4176
|
+
stepIndex: flatIndex,
|
|
4177
|
+
agent: seqStep.agent,
|
|
4178
|
+
}));
|
|
4179
|
+
|
|
4180
|
+
flushPendingStepSteers(flatIndex);
|
|
4181
|
+
const singleResult = await runSingleStepWithTimeout(seqStep, compactOptional<SingleStepContext>({
|
|
4182
|
+
previousOutput, placeholder, cwd, sessionEnabled,
|
|
4183
|
+
outputs: statusPayload.mode === "single" ? undefined : outputs,
|
|
4184
|
+
sessionDir: config.sessionDir,
|
|
4185
|
+
artifactsDir, artifactConfig, id,
|
|
4186
|
+
flatIndex, flatStepCount: Math.max(statusPayload.steps.length, 1),
|
|
4187
|
+
outputFile: path.join(asyncDir, `output-${flatIndex}.log`),
|
|
4188
|
+
steerInboxDir: stepSteerInboxDir(asyncDir, flatIndex),
|
|
4189
|
+
steerCapabilityPath: steerCapabilityPath(asyncDir, flatIndex),
|
|
4190
|
+
steerAckDir: steerAcksDir(asyncDir, flatIndex),
|
|
4191
|
+
piPackageRoot: config.piPackageRoot,
|
|
4192
|
+
piArgv1: config.piArgv1,
|
|
4193
|
+
childIntercomTarget: config.childIntercomTargets?.[flatIndex],
|
|
4194
|
+
orchestratorIntercomTarget: config.controlIntercomTarget,
|
|
4195
|
+
nestedRoute: config.nestedRoute,
|
|
4196
|
+
capabilityCeiling: config.capabilityCeiling,
|
|
4197
|
+
registerInterrupt: (interrupt) => registerStepInterrupt(flatIndex, interrupt),
|
|
4198
|
+
registerTimeout: (interrupt) => registerStepTimeout(flatIndex, interrupt),
|
|
4199
|
+
registerStop: (stop) => registerStepStop(flatIndex, stop),
|
|
4200
|
+
registerTurnBudgetAbort: (abort) => registerStepTurnBudgetAbort(flatIndex, abort),
|
|
4201
|
+
timeoutSignal: timeoutAbortController.signal,
|
|
4202
|
+
stopSignal: stopAbortController.signal,
|
|
4203
|
+
timeoutMessage,
|
|
4204
|
+
stopMessage,
|
|
4205
|
+
turnBudget: config.turnBudget,
|
|
4206
|
+
onAttemptStart: (attempt) => updateStepModel(flatIndex, attempt.model, attempt.thinking),
|
|
4207
|
+
onChildEvent: (event) => updateStepFromChildEvent(flatIndex, event),
|
|
4208
|
+
onWriterProcess,
|
|
4209
|
+
onExternalProcess: (process) => updateExternalProcess(flatIndex, process),
|
|
4210
|
+
skipAcceptance: () => timedOut || stopped,
|
|
4211
|
+
}), config.deadlineAt);
|
|
4212
|
+
if (seqStep.sessionFile) {
|
|
4213
|
+
latestSessionFile = seqStep.sessionFile;
|
|
4214
|
+
}
|
|
4215
|
+
|
|
4216
|
+
previousOutput = singleResult.output;
|
|
4217
|
+
const childStopped = singleResult.stopped === true;
|
|
4218
|
+
results.push(omitUndefinedProperties({
|
|
4219
|
+
agent: singleResult.agent,
|
|
4220
|
+
context: singleResult.context,
|
|
4221
|
+
agentContract: singleResult.agentContract,
|
|
4222
|
+
launchContractDigest: singleResult.launchContractDigest,
|
|
4223
|
+
launchResolvedExtensions: singleResult.launchResolvedExtensions,
|
|
4224
|
+
runtimeAcknowledgedExtensions: singleResult.runtimeAcknowledgedExtensions,
|
|
4225
|
+
output: stopped || childStopped ? stopMessage : timedOut ? (timeoutMessage ?? "Subagent timed out.") : singleResult.output,
|
|
4226
|
+
outputState: singleResult.outputState,
|
|
4227
|
+
error: stopped || childStopped ? stopMessage : timedOut ? (timeoutMessage ?? "Subagent timed out.") : singleResult.error,
|
|
4228
|
+
protocolError: singleResult.protocolError,
|
|
4229
|
+
success: !stopped && !childStopped && !timedOut && singleResult.interrupted !== true && singleResult.exitCode === 0,
|
|
4230
|
+
exitCode: stopped || childStopped ? 1 : timedOut ? 1 : singleResult.interrupted === true ? 0 : singleResult.exitCode,
|
|
4231
|
+
sessionFile: singleResult.sessionFile,
|
|
4232
|
+
intercomTarget: singleResult.intercomTarget,
|
|
4233
|
+
model: singleResult.model,
|
|
4234
|
+
attemptedModels: singleResult.attemptedModels,
|
|
4235
|
+
modelAttempts: singleResult.modelAttempts,
|
|
4236
|
+
totalCost: singleResult.totalCost,
|
|
4237
|
+
artifactPaths: singleResult.artifactPaths,
|
|
4238
|
+
transcriptPath: singleResult.transcriptPath,
|
|
4239
|
+
transcriptError: singleResult.transcriptError,
|
|
4240
|
+
effects: singleResult.effects,
|
|
4241
|
+
execution: singleResult.execution,
|
|
4242
|
+
review: singleResult.review,
|
|
4243
|
+
structuredOutput: singleResult.structuredOutput,
|
|
4244
|
+
structuredOutputPath: singleResult.structuredOutputPath,
|
|
4245
|
+
structuredOutputSchemaPath: singleResult.structuredOutputSchemaPath,
|
|
4246
|
+
acceptance: singleResult.acceptance,
|
|
4247
|
+
watchdog: singleResult.watchdog,
|
|
4248
|
+
capabilityCeiling: singleResult.capabilityCeiling,
|
|
4249
|
+
capabilityAudit: singleResult.capabilityAudit,
|
|
4250
|
+
interrupted: singleResult.interrupted,
|
|
4251
|
+
timedOut: timedOut || singleResult.timedOut ? true : undefined,
|
|
4252
|
+
stopped: stopped || childStopped ? true : undefined,
|
|
4253
|
+
turnBudget: singleResult.turnBudget,
|
|
4254
|
+
turnBudgetExceeded: singleResult.turnBudgetExceeded,
|
|
4255
|
+
wrapUpRequested: singleResult.wrapUpRequested,
|
|
4256
|
+
toolBudget: singleResult.toolBudget,
|
|
4257
|
+
toolBudgetBlocked: singleResult.toolBudgetBlocked,
|
|
4258
|
+
runner: singleResult.runner,
|
|
4259
|
+
externalProcess: singleResult.externalProcess,
|
|
4260
|
+
}));
|
|
4261
|
+
if (seqStep.outputName) {
|
|
4262
|
+
outputs[seqStep.outputName] = outputEntryFromAsyncResult({
|
|
4263
|
+
agent: singleResult.agent,
|
|
4264
|
+
output: singleResult.output,
|
|
4265
|
+
structuredOutput: singleResult.structuredOutput,
|
|
4266
|
+
}, stepIndex);
|
|
4267
|
+
}
|
|
4268
|
+
statusPayload.outputs = outputs;
|
|
4269
|
+
|
|
4270
|
+
const cumulativeTokens = config.sessionDir ? parseSessionTokens(config.sessionDir) : null;
|
|
4271
|
+
let stepTokens: TokenUsage | null = cumulativeTokens
|
|
4272
|
+
? {
|
|
4273
|
+
input: cumulativeTokens.input - previousCumulativeTokens.input,
|
|
4274
|
+
output: cumulativeTokens.output - previousCumulativeTokens.output,
|
|
4275
|
+
total: cumulativeTokens.total - previousCumulativeTokens.total,
|
|
4276
|
+
}
|
|
4277
|
+
: null;
|
|
4278
|
+
if (cumulativeTokens) {
|
|
4279
|
+
previousCumulativeTokens = cumulativeTokens;
|
|
4280
|
+
} else {
|
|
4281
|
+
stepTokens = tokenUsageFromAttempts(singleResult.modelAttempts);
|
|
4282
|
+
if (stepTokens) {
|
|
4283
|
+
previousCumulativeTokens = {
|
|
4284
|
+
input: previousCumulativeTokens.input + stepTokens.input,
|
|
4285
|
+
output: previousCumulativeTokens.output + stepTokens.output,
|
|
4286
|
+
total: previousCumulativeTokens.total + stepTokens.total,
|
|
4287
|
+
};
|
|
4288
|
+
}
|
|
4289
|
+
}
|
|
4290
|
+
|
|
4291
|
+
const stepEndTime = Date.now();
|
|
4292
|
+
const childInterrupted = singleResult.interrupted === true;
|
|
4293
|
+
requiredStatusStep(statusPayload, flatIndex).status = stopped || childStopped ? "stopped" : timedOut ? "failed" : childInterrupted ? "paused" : singleResult.exitCode === 0 ? "complete" : "failed";
|
|
4294
|
+
requiredStatusStep(statusPayload, flatIndex).endedAt = stepEndTime;
|
|
4295
|
+
requiredStatusStep(statusPayload, flatIndex).durationMs = stepEndTime - stepStartTime;
|
|
4296
|
+
requiredStatusStep(statusPayload, flatIndex).exitCode = stopped || childStopped ? 1 : timedOut ? 1 : childInterrupted ? 0 : singleResult.exitCode;
|
|
4297
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "timedOut", timedOut || singleResult.timedOut ? true : undefined);
|
|
4298
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "stopped", stopped || childStopped ? true : undefined);
|
|
4299
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "turnBudget", singleResult.turnBudget);
|
|
4300
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "turnBudgetExceeded", singleResult.turnBudgetExceeded);
|
|
4301
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "wrapUpRequested", singleResult.wrapUpRequested);
|
|
4302
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "toolBudget", singleResult.toolBudget);
|
|
4303
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "toolBudgetBlocked", singleResult.toolBudgetBlocked);
|
|
4304
|
+
if (singleResult.toolBudget) statusPayload.toolBudget = singleResult.toolBudget;
|
|
4305
|
+
if (singleResult.toolBudgetBlocked) statusPayload.toolBudgetBlocked = true;
|
|
4306
|
+
if (singleResult.turnBudget) statusPayload.turnBudget = singleResult.turnBudget;
|
|
4307
|
+
if (singleResult.turnBudgetExceeded) statusPayload.turnBudgetExceeded = true;
|
|
4308
|
+
if (singleResult.wrapUpRequested) statusPayload.wrapUpRequested = true;
|
|
4309
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "model", singleResult.model);
|
|
4310
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "thinking", resolveEffectiveThinking(singleResult.model, requiredStatusStep(statusPayload, flatIndex).thinking));
|
|
4311
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "attemptedModels", singleResult.attemptedModels);
|
|
4312
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "modelAttempts", singleResult.modelAttempts);
|
|
4313
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "totalCost", singleResult.totalCost);
|
|
4314
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "error", stopped || childStopped ? stopMessage : timedOut ? (timeoutMessage ?? "Subagent timed out.") : singleResult.error);
|
|
4315
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "transcriptPath", singleResult.transcriptPath ?? requiredStatusStep(statusPayload, flatIndex).transcriptPath);
|
|
4316
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "transcriptError", singleResult.transcriptError);
|
|
4317
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "agentContract", singleResult.agentContract);
|
|
4318
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "launchResolvedExtensions", singleResult.launchResolvedExtensions);
|
|
4319
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "runtimeAcknowledgedExtensions", singleResult.runtimeAcknowledgedExtensions);
|
|
4320
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "effects", singleResult.effects);
|
|
4321
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "execution", singleResult.execution);
|
|
4322
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "review", singleResult.review);
|
|
4323
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "structuredOutput", singleResult.structuredOutput);
|
|
4324
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "structuredOutputPath", singleResult.structuredOutputPath);
|
|
4325
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "structuredOutputSchemaPath", singleResult.structuredOutputSchemaPath);
|
|
4326
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "acceptance", singleResult.acceptance);
|
|
4327
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "watchdog", singleResult.watchdog);
|
|
4328
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "capabilityCeiling", singleResult.capabilityCeiling);
|
|
4329
|
+
setOptionalProperty(requiredStatusStep(statusPayload, flatIndex), "capabilityAudit", singleResult.capabilityAudit);
|
|
4330
|
+
if (singleResult.capabilityCeiling) statusPayload.capabilityCeiling = singleResult.capabilityCeiling;
|
|
4331
|
+
if (singleResult.capabilityAudit) statusPayload.capabilityAudit = singleResult.capabilityAudit;
|
|
4332
|
+
if (stepTokens) {
|
|
4333
|
+
requiredStatusStep(statusPayload, flatIndex).tokens = stepTokens;
|
|
4334
|
+
statusPayload.totalTokens = { ...previousCumulativeTokens };
|
|
4335
|
+
}
|
|
4336
|
+
statusPayload.lastUpdate = stepEndTime;
|
|
4337
|
+
writeStatusPayload();
|
|
4338
|
+
appendCapabilityCeilingAppliedEvent(eventsPath, id, flatIndex, seqStep.agent, singleResult);
|
|
4339
|
+
|
|
4340
|
+
appendJsonl(eventsPath, JSON.stringify({
|
|
4341
|
+
type: stopped || childStopped ? "subagent.step.stopped" : timedOut ? "subagent.step.failed" : childInterrupted ? "subagent.step.paused" : singleResult.exitCode === 0 ? "subagent.step.completed" : "subagent.step.failed",
|
|
4342
|
+
ts: stepEndTime,
|
|
4343
|
+
runId: id,
|
|
4344
|
+
stepIndex: flatIndex,
|
|
4345
|
+
agent: seqStep.agent,
|
|
4346
|
+
exitCode: stopped || childStopped ? 1 : timedOut ? 1 : childInterrupted ? 0 : singleResult.exitCode,
|
|
4347
|
+
durationMs: stepEndTime - stepStartTime,
|
|
4348
|
+
tokens: stepTokens,
|
|
4349
|
+
}));
|
|
4350
|
+
if (singleResult.completionGuardTriggered) {
|
|
4351
|
+
const event = buildControlEvent(omitUndefinedProperties({
|
|
4352
|
+
from: requiredStatusStep(statusPayload, flatIndex).activityState,
|
|
4353
|
+
to: "needs_attention",
|
|
4354
|
+
runId: id,
|
|
4355
|
+
agent: seqStep.agent,
|
|
4356
|
+
index: flatIndex,
|
|
4357
|
+
ts: stepEndTime,
|
|
4358
|
+
message: `${seqStep.agent} completed without making edits for an implementation task`,
|
|
4359
|
+
reason: "completion_guard",
|
|
4360
|
+
}));
|
|
4361
|
+
appendControlEvent(event);
|
|
4362
|
+
}
|
|
4363
|
+
|
|
4364
|
+
flatIndex++;
|
|
4365
|
+
if (isAgentContractV1(seqStep.agentContract) && seqStep.gateOn === "acceptance" && singleResult.acceptance?.status === "rejected") {
|
|
4366
|
+
statusPayload.error = acceptanceFailureMessage(singleResult.acceptance) ?? "Chain acceptance gate rejected the step.";
|
|
4367
|
+
writeStatusPayload();
|
|
4368
|
+
break;
|
|
4369
|
+
}
|
|
4370
|
+
if (singleResult.exitCode !== 0) {
|
|
4371
|
+
break;
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4374
|
+
}
|
|
4375
|
+
|
|
4376
|
+
let summary = results.map((r) => `${r.agent}:\n${r.output}`).join("\n\n");
|
|
4377
|
+
let truncated = false;
|
|
4378
|
+
|
|
4379
|
+
if (maxOutput) {
|
|
4380
|
+
const config = { ...DEFAULT_MAX_OUTPUT, ...maxOutput };
|
|
4381
|
+
const lastArtifactPath = results[results.length - 1]?.artifactPaths?.outputPath;
|
|
4382
|
+
const truncResult = truncateOutput(summary, config, lastArtifactPath);
|
|
4383
|
+
if (truncResult.truncated) {
|
|
4384
|
+
summary = truncResult.text;
|
|
4385
|
+
truncated = true;
|
|
4386
|
+
}
|
|
4387
|
+
}
|
|
4388
|
+
|
|
4389
|
+
const resultMode = config.resultMode ?? statusPayload.mode;
|
|
4390
|
+
const singleRuntimeAcknowledgedExtensions = results.length === 1 ? results[0]?.runtimeAcknowledgedExtensions : undefined;
|
|
4391
|
+
const totalCost = results.reduce<CostSummary>((sum, result) => ({
|
|
4392
|
+
inputTokens: sum.inputTokens + (result.totalCost?.inputTokens ?? 0),
|
|
4393
|
+
outputTokens: sum.outputTokens + (result.totalCost?.outputTokens ?? 0),
|
|
4394
|
+
costUsd: sum.costUsd + (result.totalCost?.costUsd ?? 0),
|
|
4395
|
+
}), { inputTokens: 0, outputTokens: 0, costUsd: 0 });
|
|
4396
|
+
const finalTotalCost = totalCost.inputTokens > 0 || totalCost.outputTokens > 0 || totalCost.costUsd > 0 ? totalCost : undefined;
|
|
4397
|
+
const finalFlatAgents = statusPayload.steps.map((step) => step.agent);
|
|
4398
|
+
const agentName = finalFlatAgents.length === 1
|
|
4399
|
+
? finalFlatAgents[0]!
|
|
4400
|
+
: resultMode === "parallel"
|
|
4401
|
+
? `parallel:${finalFlatAgents.join("+")}`
|
|
4402
|
+
: `chain:${finalFlatAgents.join("->")}`;
|
|
4403
|
+
let sessionFile: string | undefined;
|
|
4404
|
+
let shareUrl: string | undefined;
|
|
4405
|
+
let gistUrl: string | undefined;
|
|
4406
|
+
let shareError: string | undefined;
|
|
4407
|
+
|
|
4408
|
+
if (shareEnabled) {
|
|
4409
|
+
sessionFile = config.sessionDir
|
|
4410
|
+
? (findLatestSessionFile(config.sessionDir) ?? undefined)
|
|
4411
|
+
: undefined;
|
|
4412
|
+
if (!sessionFile && latestSessionFile) {
|
|
4413
|
+
sessionFile = latestSessionFile;
|
|
4414
|
+
}
|
|
4415
|
+
if (sessionFile) {
|
|
4416
|
+
try {
|
|
4417
|
+
const exportDir = config.sessionDir ?? path.dirname(sessionFile);
|
|
4418
|
+
const htmlPath = await exportSessionHtml(sessionFile, exportDir, config.piPackageRoot);
|
|
4419
|
+
const share = createShareLink(htmlPath);
|
|
4420
|
+
if ("error" in share) shareError = share.error;
|
|
4421
|
+
else {
|
|
4422
|
+
shareUrl = share.shareUrl;
|
|
4423
|
+
gistUrl = share.gistUrl;
|
|
4424
|
+
}
|
|
4425
|
+
} catch (err) {
|
|
4426
|
+
shareError = String(err);
|
|
4427
|
+
}
|
|
4428
|
+
} else {
|
|
4429
|
+
shareError = "Session file not found.";
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
|
|
4433
|
+
if (activityTimer) {
|
|
4434
|
+
clearInterval(activityTimer);
|
|
4435
|
+
activityTimer = undefined;
|
|
4436
|
+
}
|
|
4437
|
+
if (timeoutTimer) {
|
|
4438
|
+
clearTimeout(timeoutTimer);
|
|
4439
|
+
timeoutTimer = undefined;
|
|
4440
|
+
}
|
|
4441
|
+
const signalTerminated = !stopped && !timedOut && !turnBudgetExceeded && !interrupted && results.some((result) => result.exitCode !== 0 && isUnexplainedProcessSignal(omitUndefinedProperties({
|
|
4442
|
+
processSignal: result.processSignal,
|
|
4443
|
+
interrupted: result.interrupted,
|
|
4444
|
+
timedOut: result.timedOut,
|
|
4445
|
+
stopped: result.stopped,
|
|
4446
|
+
turnBudgetExceeded: result.turnBudgetExceeded,
|
|
4447
|
+
})));
|
|
4448
|
+
statusPayload.state = checkpointRejected ? "rejected" : stopped || signalTerminated ? "stopped" : timedOut || turnBudgetExceeded || usageBudgetExceeded || statusPayload.error ? "failed" : interrupted ? "paused" : results.every((r) => r.success) ? "complete" : "failed";
|
|
4449
|
+
closeSteerInbox(asyncDir, statusPayload.state);
|
|
4450
|
+
disposeControlInbox();
|
|
4451
|
+
for (const request of consumeSteerRequests(asyncDir)) deliverSteerRequest(request);
|
|
4452
|
+
const effectiveSessionFile = sessionFile ?? latestSessionFile;
|
|
4453
|
+
const steeringLifecycle = steeringStatus(statusPayload);
|
|
4454
|
+
for (const request of steeringLifecycle.recent) {
|
|
4455
|
+
let changed = false;
|
|
4456
|
+
for (const target of request.targets) {
|
|
4457
|
+
if (target.state !== "scheduled" && target.state !== "routed" && target.state !== "queued") continue;
|
|
4458
|
+
changed = true;
|
|
4459
|
+
const reason = target.state === "queued" ? "run ended before queued follow-up delivery" : "child terminated before steering delivery";
|
|
4460
|
+
updateSteeringLifecycleTarget(request.id, target.index, "failed", Date.now(), { reason });
|
|
4461
|
+
markSteeringAttention(target.index);
|
|
4462
|
+
emitSteeringEvent("subagent.steer.failed", { type: "steer", id: request.id, ts: request.requestedAt, message: reason }, target.index, { reason });
|
|
4463
|
+
}
|
|
4464
|
+
if (changed) emitTerminalSteeringNotice(request.id, `Steering failed for run ${id}: child terminated before delivery.`);
|
|
4465
|
+
}
|
|
4466
|
+
const runEndedAt = Date.now();
|
|
4467
|
+
delete statusPayload.activityState;
|
|
4468
|
+
if (stopped) {
|
|
4469
|
+
statusPayload.stopped = true;
|
|
4470
|
+
statusPayload.error = stopMessage;
|
|
4471
|
+
} else if (signalTerminated && !statusPayload.error) {
|
|
4472
|
+
setOptionalProperty(statusPayload, "error", results.find((result) => result.processSignal)?.error);
|
|
4473
|
+
}
|
|
4474
|
+
if (timedOut) {
|
|
4475
|
+
statusPayload.timedOut = true;
|
|
4476
|
+
statusPayload.error = timeoutMessage ?? "Subagent timed out.";
|
|
4477
|
+
}
|
|
4478
|
+
if (turnBudgetExceeded && !statusPayload.error) {
|
|
4479
|
+
const budget = statusPayload.turnBudget;
|
|
4480
|
+
statusPayload.error = budget ? turnBudgetExceededMessage(budget, budget.turnCount) : "Subagent exceeded turn budget.";
|
|
4481
|
+
}
|
|
4482
|
+
if (usageBudgetExceeded && statusPayload.usageBudget && !statusPayload.error) {
|
|
4483
|
+
statusPayload.error = usageBudgetExceededMessage(statusPayload.usageBudget);
|
|
4484
|
+
}
|
|
4485
|
+
statusPayload.endedAt = runEndedAt;
|
|
4486
|
+
statusPayload.lastUpdate = runEndedAt;
|
|
4487
|
+
setOptionalProperty(statusPayload, "sessionFile", effectiveSessionFile);
|
|
4488
|
+
if (singleRuntimeAcknowledgedExtensions) statusPayload.runtimeAcknowledgedExtensions = singleRuntimeAcknowledgedExtensions;
|
|
4489
|
+
setOptionalProperty(statusPayload, "totalCost", finalTotalCost);
|
|
4490
|
+
setOptionalProperty(statusPayload, "usageBudget", usageBudgetState(config.usageBudget, currentUsageTotals()));
|
|
4491
|
+
setOptionalProperty(statusPayload, "shareUrl", shareUrl);
|
|
4492
|
+
setOptionalProperty(statusPayload, "gistUrl", gistUrl);
|
|
4493
|
+
setOptionalProperty(statusPayload, "shareError", shareError);
|
|
4494
|
+
if (statusPayload.state === "failed" && !statusPayload.error) {
|
|
4495
|
+
const failedStep = statusPayload.steps.find((s) => s.status === "failed");
|
|
4496
|
+
if (failedStep?.agent) {
|
|
4497
|
+
statusPayload.error = `Step failed: ${failedStep.agent}`;
|
|
4498
|
+
}
|
|
4499
|
+
}
|
|
4500
|
+
writeStatusPayload();
|
|
4501
|
+
try {
|
|
4502
|
+
writeAtomicJson(resultPath, {
|
|
4503
|
+
lifecycleArtifactVersion: SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
4504
|
+
id,
|
|
4505
|
+
agent: agentName,
|
|
4506
|
+
mode: resultMode,
|
|
4507
|
+
success: !checkpointRejected && !stopped && !timedOut && !turnBudgetExceeded && !usageBudgetExceeded && !interrupted && !signalTerminated && results.every((r) => r.success),
|
|
4508
|
+
state: checkpointRejected ? "rejected" : stopped || signalTerminated ? "stopped" : timedOut || turnBudgetExceeded || usageBudgetExceeded ? "failed" : interrupted ? "paused" : results.every((r) => r.success) ? "complete" : "failed",
|
|
4509
|
+
summary: checkpointRejected ? (statusPayload.error ?? "Checkpoint rejected.") : stopped ? stopMessage : signalTerminated ? (statusPayload.error ?? "Subagent process terminated by signal.") : timedOut ? (timeoutMessage ?? "Subagent timed out.") : turnBudgetExceeded ? (statusPayload.error ?? "Subagent exceeded turn budget.") : usageBudgetExceeded ? (statusPayload.error ?? "Usage budget exhausted.") : interrupted ? "Paused after interrupt. Waiting for explicit next action." : summary,
|
|
4510
|
+
...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),
|
|
4511
|
+
...(config.deadlineAt !== undefined ? { deadlineAt: config.deadlineAt } : {}),
|
|
4512
|
+
...(statusPayload.turnBudget ? { turnBudget: statusPayload.turnBudget } : {}),
|
|
4513
|
+
...(statusPayload.turnBudgetExceeded ? { turnBudgetExceeded: true } : {}),
|
|
4514
|
+
...(statusPayload.wrapUpRequested ? { wrapUpRequested: true } : {}),
|
|
4515
|
+
...(statusPayload.toolBudget ? { toolBudget: statusPayload.toolBudget } : {}),
|
|
4516
|
+
...(statusPayload.toolBudgetBlocked ? { toolBudgetBlocked: true } : {}),
|
|
4517
|
+
...(statusPayload.usageBudget ? { usageBudget: statusPayload.usageBudget } : {}),
|
|
4518
|
+
...(statusPayload.checkpoint ? { checkpoint: statusPayload.checkpoint } : {}),
|
|
4519
|
+
...(stopped ? { stopped: true, error: stopMessage } : timedOut ? { timedOut: true, error: timeoutMessage ?? "Subagent timed out." } : turnBudgetExceeded ? { error: statusPayload.error ?? "Subagent exceeded turn budget." } : usageBudgetExceeded ? { error: statusPayload.error ?? "Usage budget exhausted." } : {}),
|
|
4520
|
+
results: results.map((r) => omitUndefinedProperties({
|
|
4521
|
+
agent: r.agent,
|
|
4522
|
+
context: r.context,
|
|
4523
|
+
output: r.output,
|
|
4524
|
+
outputState: r.outputState,
|
|
4525
|
+
error: r.error,
|
|
4526
|
+
protocolError: r.protocolError,
|
|
4527
|
+
success: r.success,
|
|
4528
|
+
skipped: r.skipped || undefined,
|
|
4529
|
+
interrupted: r.interrupted || undefined,
|
|
4530
|
+
timedOut: r.timedOut || undefined,
|
|
4531
|
+
stopped: r.stopped || undefined,
|
|
4532
|
+
processSignal: r.processSignal || undefined,
|
|
4533
|
+
turnBudget: r.turnBudget,
|
|
4534
|
+
turnBudgetExceeded: r.turnBudgetExceeded || undefined,
|
|
4535
|
+
wrapUpRequested: r.wrapUpRequested || undefined,
|
|
4536
|
+
toolBudget: r.toolBudget,
|
|
4537
|
+
toolBudgetBlocked: r.toolBudgetBlocked || undefined,
|
|
4538
|
+
sessionFile: r.sessionFile,
|
|
4539
|
+
intercomTarget: r.intercomTarget,
|
|
4540
|
+
model: r.model,
|
|
4541
|
+
attemptedModels: r.attemptedModels,
|
|
4542
|
+
modelAttempts: r.modelAttempts,
|
|
4543
|
+
totalCost: r.totalCost,
|
|
4544
|
+
artifactPaths: r.artifactPaths,
|
|
4545
|
+
outputSaveError: r.outputSaveError,
|
|
4546
|
+
metadataSaveError: r.metadataSaveError,
|
|
4547
|
+
truncated: r.truncated,
|
|
4548
|
+
transcriptPath: r.transcriptPath,
|
|
4549
|
+
transcriptError: r.transcriptError,
|
|
4550
|
+
agentContract: r.agentContract,
|
|
4551
|
+
launchContractDigest: r.launchContractDigest,
|
|
4552
|
+
launchResolvedExtensions: r.launchResolvedExtensions,
|
|
4553
|
+
runtimeAcknowledgedExtensions: r.runtimeAcknowledgedExtensions,
|
|
4554
|
+
runner: r.runner,
|
|
4555
|
+
externalProcess: r.externalProcess,
|
|
4556
|
+
execution: r.execution,
|
|
4557
|
+
review: r.review,
|
|
4558
|
+
effects: r.effects,
|
|
4559
|
+
structuredOutput: r.structuredOutput,
|
|
4560
|
+
structuredOutputPath: r.structuredOutputPath,
|
|
4561
|
+
structuredOutputSchemaPath: r.structuredOutputSchemaPath,
|
|
4562
|
+
acceptance: r.acceptance,
|
|
4563
|
+
watchdog: r.watchdog,
|
|
4564
|
+
capabilityCeiling: r.capabilityCeiling,
|
|
4565
|
+
capabilityAudit: r.capabilityAudit,
|
|
4566
|
+
})),
|
|
4567
|
+
outputs,
|
|
4568
|
+
workflowGraph: statusPayload.workflowGraph,
|
|
4569
|
+
parallelHandoff: statusPayload.parallelHandoff,
|
|
4570
|
+
capabilityCeiling: statusPayload.capabilityCeiling,
|
|
4571
|
+
capabilityAudit: statusPayload.capabilityAudit,
|
|
4572
|
+
...(config.parentWorkflowRunId ? { parentWorkflowRunId: config.parentWorkflowRunId } : {}),
|
|
4573
|
+
...(config.workflowKey ? { workflowKey: config.workflowKey } : {}),
|
|
4574
|
+
exitCode: checkpointRejected || stopped || timedOut || turnBudgetExceeded || usageBudgetExceeded ? 1 : interrupted || results.every((r) => r.success) ? 0 : 1,
|
|
4575
|
+
timestamp: runEndedAt,
|
|
4576
|
+
durationMs: runEndedAt - overallStartTime,
|
|
4577
|
+
totalTokens: statusPayload.totalTokens,
|
|
4578
|
+
totalCost: finalTotalCost,
|
|
4579
|
+
usageBudget: statusPayload.usageBudget,
|
|
4580
|
+
checkpoint: statusPayload.checkpoint,
|
|
4581
|
+
truncated,
|
|
4582
|
+
artifactsDir,
|
|
4583
|
+
cwd,
|
|
4584
|
+
asyncDir,
|
|
4585
|
+
launchContractDigest: config.launchContractDigest,
|
|
4586
|
+
launchResolvedExtensions: config.launchResolvedExtensions,
|
|
4587
|
+
runtimeAcknowledgedExtensions: singleRuntimeAcknowledgedExtensions,
|
|
4588
|
+
sessionId: config.sessionId,
|
|
4589
|
+
sessionFile: effectiveSessionFile,
|
|
4590
|
+
intercomTarget: config.controlIntercomTarget,
|
|
4591
|
+
shareUrl,
|
|
4592
|
+
gistUrl,
|
|
4593
|
+
shareError,
|
|
4594
|
+
...(taskIndex !== undefined && { taskIndex }),
|
|
4595
|
+
...(totalTasks !== undefined && { totalTasks }),
|
|
4596
|
+
});
|
|
4597
|
+
} catch (err) {
|
|
4598
|
+
console.error(`Failed to write result file ${resultPath}:`, err);
|
|
4599
|
+
}
|
|
4600
|
+
appendJsonl(
|
|
4601
|
+
eventsPath,
|
|
4602
|
+
JSON.stringify({
|
|
4603
|
+
type: "subagent.run.completed",
|
|
4604
|
+
lifecycleArtifactVersion: SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
4605
|
+
ts: runEndedAt,
|
|
4606
|
+
runId: id,
|
|
4607
|
+
status: statusPayload.state,
|
|
4608
|
+
durationMs: runEndedAt - overallStartTime,
|
|
4609
|
+
totalTokens: statusPayload.totalTokens,
|
|
4610
|
+
totalCost: finalTotalCost,
|
|
4611
|
+
usageBudget: statusPayload.usageBudget,
|
|
4612
|
+
}),
|
|
4613
|
+
);
|
|
4614
|
+
writeRunLog(logPath, omitUndefinedProperties({
|
|
4615
|
+
id,
|
|
4616
|
+
mode: statusPayload.mode,
|
|
4617
|
+
cwd,
|
|
4618
|
+
startedAt: overallStartTime,
|
|
4619
|
+
endedAt: runEndedAt,
|
|
4620
|
+
steps: statusPayload.steps.map((step) => omitUndefinedProperties({
|
|
4621
|
+
agent: step.agent,
|
|
4622
|
+
status: step.status,
|
|
4623
|
+
durationMs: step.durationMs,
|
|
4624
|
+
})),
|
|
4625
|
+
summary,
|
|
4626
|
+
truncated,
|
|
4627
|
+
artifactsDir,
|
|
4628
|
+
sessionFile: effectiveSessionFile,
|
|
4629
|
+
shareUrl,
|
|
4630
|
+
shareError,
|
|
4631
|
+
}));
|
|
4632
|
+
if (config.runnerProcessInstanceId) {
|
|
4633
|
+
const writers: Record<string, Array<{ processInstanceId: string; kind: "pi-writer"; attempt: number; closeObservedAt: number; exitCode: number | null; signal: string | null }>> = {};
|
|
4634
|
+
const expectedWriters: Record<string, number> = {};
|
|
4635
|
+
for (const [index, result] of results.entries()) {
|
|
4636
|
+
writers[String(index)] = result.writerProcesses ?? [];
|
|
4637
|
+
expectedWriters[String(index)] = result.writerAttemptCount ?? 0;
|
|
4638
|
+
}
|
|
4639
|
+
const candidate: ProcessTerminalCandidate = {
|
|
4640
|
+
version: 1,
|
|
4641
|
+
runId: id,
|
|
4642
|
+
runnerProcessInstanceId: config.runnerProcessInstanceId,
|
|
4643
|
+
writers,
|
|
4644
|
+
expectedWriters,
|
|
4645
|
+
...(config.revivalLease?.sessionFile ? { sessionFile: config.revivalLease.sessionFile } : {}),
|
|
4646
|
+
...(config.revivalLeaseToken ? { revivalLeaseToken: config.revivalLeaseToken } : {}),
|
|
4647
|
+
};
|
|
4648
|
+
try {
|
|
4649
|
+
writeProcessTerminalCandidate(asyncDir, candidate);
|
|
4650
|
+
} catch (error) {
|
|
4651
|
+
console.error(`Failed to write process-terminal candidate for '${id}':`, error);
|
|
4652
|
+
}
|
|
4653
|
+
}
|
|
4654
|
+
}
|
|
4655
|
+
|
|
4656
|
+
async function waitForStartupControl(
|
|
4657
|
+
controlPath: string,
|
|
4658
|
+
token: string,
|
|
4659
|
+
action: "ack" | "proceed",
|
|
4660
|
+
timeoutMs = 30_000,
|
|
4661
|
+
): Promise<void> {
|
|
4662
|
+
const deadline = Date.now() + timeoutMs;
|
|
4663
|
+
while (Date.now() <= deadline) {
|
|
4664
|
+
if (fs.existsSync(controlPath)) {
|
|
4665
|
+
let payload: { action?: unknown; token?: unknown };
|
|
4666
|
+
try {
|
|
4667
|
+
payload = JSON.parse(fs.readFileSync(controlPath, "utf-8")) as { action?: unknown; token?: unknown };
|
|
4668
|
+
} catch (error) {
|
|
4669
|
+
throw new Error(`Failed to read runner startup control '${controlPath}': ${error instanceof Error ? error.message : String(error)}`);
|
|
4670
|
+
}
|
|
4671
|
+
if (payload.token !== token) throw new Error("Runner startup control token does not match the acquired session lease.");
|
|
4672
|
+
if (payload.action === action) return;
|
|
4673
|
+
if (payload.action !== "ack" && payload.action !== "proceed") throw new Error("Runner startup control action is invalid.");
|
|
4674
|
+
}
|
|
4675
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
4676
|
+
}
|
|
4677
|
+
throw new Error(`Timed out after ${timeoutMs}ms waiting for runner startup control '${action}'.`);
|
|
4678
|
+
}
|
|
4679
|
+
|
|
4680
|
+
async function runConfiguredSubagent(config: SubagentRunConfig): Promise<void> {
|
|
4681
|
+
let lease: ReturnType<typeof acquireSessionLease> | undefined;
|
|
4682
|
+
let startupCommitted = config.revivalLease === undefined;
|
|
4683
|
+
const startupPath = path.join(config.asyncDir, "runner-startup.json");
|
|
4684
|
+
const startupAckPath = path.join(config.asyncDir, "runner-startup-ack.json");
|
|
4685
|
+
const startupProceedPath = path.join(config.asyncDir, "runner-startup-proceed.json");
|
|
4686
|
+
const releaseOnExit = (): void => {
|
|
4687
|
+
try {
|
|
4688
|
+
lease?.release();
|
|
4689
|
+
} catch {
|
|
4690
|
+
// Exit cleanup is best effort; a dead-owner lease is reclaimed on the next revival.
|
|
4691
|
+
}
|
|
4692
|
+
};
|
|
4693
|
+
process.once("exit", releaseOnExit);
|
|
4694
|
+
try {
|
|
4695
|
+
if (config.revivalLease) {
|
|
4696
|
+
lease = acquireSessionLease(config.revivalLease);
|
|
4697
|
+
config.revivalLeaseToken = lease.owner.token;
|
|
4698
|
+
writeAtomicJson(startupPath, { state: "ready", token: lease.owner.token, pid: process.pid, owner: lease.owner });
|
|
4699
|
+
await waitForStartupControl(startupAckPath, lease.owner.token, "ack");
|
|
4700
|
+
writeAtomicJson(startupPath, { state: "acknowledged", token: lease.owner.token, pid: process.pid });
|
|
4701
|
+
await waitForStartupControl(startupProceedPath, lease.owner.token, "proceed");
|
|
4702
|
+
startupCommitted = true;
|
|
4703
|
+
for (const controlPath of [startupAckPath, startupProceedPath]) {
|
|
4704
|
+
try {
|
|
4705
|
+
fs.rmSync(controlPath, { force: true });
|
|
4706
|
+
} catch {
|
|
4707
|
+
// Startup control cleanup is best effort after the parent commits the run.
|
|
4708
|
+
}
|
|
4709
|
+
}
|
|
4710
|
+
}
|
|
4711
|
+
await runSubagent(config, lease ? (writer) => lease!.updateWriter(writer) : undefined);
|
|
4712
|
+
} catch (error) {
|
|
4713
|
+
if (config.revivalLease && !startupCommitted) {
|
|
4714
|
+
try {
|
|
4715
|
+
writeAtomicJson(startupPath, { state: "error", pid: process.pid, error: error instanceof Error ? error.message : String(error) });
|
|
4716
|
+
} catch {
|
|
4717
|
+
// The parent will time out and terminate this runner if the handshake cannot be written.
|
|
4718
|
+
}
|
|
4719
|
+
}
|
|
4720
|
+
throw error;
|
|
4721
|
+
} finally {
|
|
4722
|
+
process.off("exit", releaseOnExit);
|
|
4723
|
+
if (lease) {
|
|
4724
|
+
let acknowledged = false;
|
|
4725
|
+
try {
|
|
4726
|
+
acknowledged = lease.release();
|
|
4727
|
+
} catch (error) {
|
|
4728
|
+
console.error("Failed to release session revival lease:", error);
|
|
4729
|
+
}
|
|
4730
|
+
try {
|
|
4731
|
+
markProcessTerminalCandidateLeaseRelease(config.asyncDir, lease.owner.token, acknowledged);
|
|
4732
|
+
} catch (error) {
|
|
4733
|
+
console.error("Failed to record session revival lease release:", error);
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4736
|
+
}
|
|
4737
|
+
}
|
|
4738
|
+
|
|
4739
|
+
function startConfiguredSubagent(config: SubagentRunConfig): void {
|
|
4740
|
+
runConfiguredSubagent(config).catch((runErr) => {
|
|
4741
|
+
console.error("Subagent runner error:", runErr);
|
|
4742
|
+
process.exit(1);
|
|
4743
|
+
});
|
|
4744
|
+
}
|
|
4745
|
+
|
|
4746
|
+
const configArg = process.argv[2];
|
|
4747
|
+
if (configArg) {
|
|
4748
|
+
try {
|
|
4749
|
+
const configJson = fs.readFileSync(configArg, "utf-8");
|
|
4750
|
+
const config = JSON.parse(configJson) as SubagentRunConfig;
|
|
4751
|
+
try {
|
|
4752
|
+
fs.unlinkSync(configArg);
|
|
4753
|
+
} catch {
|
|
4754
|
+
// Temp config cleanup is best effort.
|
|
4755
|
+
}
|
|
4756
|
+
startConfiguredSubagent(config);
|
|
4757
|
+
} catch (err) {
|
|
4758
|
+
console.error("Subagent runner error:", err);
|
|
4759
|
+
process.exit(1);
|
|
4760
|
+
}
|
|
4761
|
+
} else {
|
|
4762
|
+
let input = "";
|
|
4763
|
+
process.stdin.setEncoding("utf-8");
|
|
4764
|
+
process.stdin.on("data", (chunk) => {
|
|
4765
|
+
input += chunk;
|
|
4766
|
+
});
|
|
4767
|
+
process.stdin.on("end", () => {
|
|
4768
|
+
try {
|
|
4769
|
+
const config = JSON.parse(input) as SubagentRunConfig;
|
|
4770
|
+
startConfiguredSubagent(config);
|
|
4771
|
+
} catch (err) {
|
|
4772
|
+
console.error("Subagent runner error:", err);
|
|
4773
|
+
process.exit(1);
|
|
4774
|
+
}
|
|
4775
|
+
});
|
|
4776
|
+
}
|