@paperclipai/adapter-utils 2026.909.0-canary.4 → 2026.910.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acpx-engine/execute.d.ts.map +1 -1
- package/dist/acpx-engine/execute.js +147 -11
- package/dist/acpx-engine/execute.js.map +1 -1
- package/dist/acpx-engine/execute.test.js +138 -0
- package/dist/acpx-engine/execute.test.js.map +1 -1
- package/dist/acpx-engine/local-process-control.d.ts +5 -0
- package/dist/acpx-engine/local-process-control.d.ts.map +1 -0
- package/dist/acpx-engine/local-process-control.js +39 -0
- package/dist/acpx-engine/local-process-control.js.map +1 -0
- package/dist/acpx-engine/local-process-control.test.d.ts +2 -0
- package/dist/acpx-engine/local-process-control.test.d.ts.map +1 -0
- package/dist/acpx-engine/local-process-control.test.js +38 -0
- package/dist/acpx-engine/local-process-control.test.js.map +1 -0
- package/dist/acpx-engine/operator-stop.test.d.ts +2 -0
- package/dist/acpx-engine/operator-stop.test.d.ts.map +1 -0
- package/dist/acpx-engine/operator-stop.test.js +99 -0
- package/dist/acpx-engine/operator-stop.test.js.map +1 -0
- package/dist/acpx-engine/run-site-host.d.ts +2 -0
- package/dist/acpx-engine/run-site-host.d.ts.map +1 -1
- package/dist/acpx-engine/run-site-host.js.map +1 -1
- package/dist/acpx-engine/session-codec.d.ts.map +1 -1
- package/dist/acpx-engine/session-codec.js +1 -0
- package/dist/acpx-engine/session-codec.js.map +1 -1
- package/dist/acpx-engine/spawn-smoke.test.js +115 -1
- package/dist/acpx-engine/spawn-smoke.test.js.map +1 -1
- package/dist/acpx-engine/turn-sequence.d.ts +1 -0
- package/dist/acpx-engine/turn-sequence.d.ts.map +1 -1
- package/dist/acpx-engine/turn-sequence.js +20 -0
- package/dist/acpx-engine/turn-sequence.js.map +1 -1
- package/dist/chat-file-delivery.d.ts +10 -0
- package/dist/chat-file-delivery.d.ts.map +1 -0
- package/dist/chat-file-delivery.js +37 -0
- package/dist/chat-file-delivery.js.map +1 -0
- package/dist/chat-file-delivery.test.d.ts +2 -0
- package/dist/chat-file-delivery.test.d.ts.map +1 -0
- package/dist/chat-file-delivery.test.js +92 -0
- package/dist/chat-file-delivery.test.js.map +1 -0
- package/dist/execution-target.d.ts.map +1 -1
- package/dist/execution-target.js +3 -1
- package/dist/execution-target.js.map +1 -1
- package/dist/github-launcher-environment.test.js +31 -1
- package/dist/github-launcher-environment.test.js.map +1 -1
- package/dist/server-utils.d.ts +38 -0
- package/dist/server-utils.d.ts.map +1 -1
- package/dist/server-utils.js +554 -116
- package/dist/server-utils.js.map +1 -1
- package/dist/server-utils.test.js +437 -14
- package/dist/server-utils.test.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/node_modules/acpx/dist/live-checkpoint-ClPCSdrW.js +29 -2
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v4/classic/checks.ts +0 -1
- package/node_modules/zod/src/v4/classic/external.ts +2 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
- package/node_modules/zod/src/v4/classic/schemas.ts +255 -164
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +59 -9
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +274 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +18 -2
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +225 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +25 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +147 -3
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
- package/node_modules/zod/src/v4/core/api.ts +30 -6
- package/node_modules/zod/src/v4/core/checks.ts +1 -101
- package/node_modules/zod/src/v4/core/compile.ts +194 -82
- package/node_modules/zod/src/v4/core/doc.ts +6 -2
- package/node_modules/zod/src/v4/core/errors.ts +3 -6
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +226 -68
- package/node_modules/zod/src/v4/core/memoizer.ts +78 -28
- package/node_modules/zod/src/v4/core/parse.ts +37 -16
- package/node_modules/zod/src/v4/core/regexes.ts +10 -4
- package/node_modules/zod/src/v4/core/schemas.ts +350 -113
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +222 -2
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +10 -8
- package/node_modules/zod/src/v4/core/util.ts +222 -147
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +11 -0
- package/node_modules/zod/src/v4/locales/ar.ts +1 -0
- package/node_modules/zod/src/v4/locales/az.ts +1 -0
- package/node_modules/zod/src/v4/locales/be.ts +1 -0
- package/node_modules/zod/src/v4/locales/bg.ts +1 -0
- package/node_modules/zod/src/v4/locales/bn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ca.ts +1 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +1 -0
- package/node_modules/zod/src/v4/locales/cs.ts +1 -0
- package/node_modules/zod/src/v4/locales/da.ts +1 -0
- package/node_modules/zod/src/v4/locales/de.ts +1 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +1 -0
- package/node_modules/zod/src/v4/locales/eo.ts +1 -0
- package/node_modules/zod/src/v4/locales/es.ts +1 -0
- package/node_modules/zod/src/v4/locales/fa.ts +1 -0
- package/node_modules/zod/src/v4/locales/fi.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr.ts +1 -0
- package/node_modules/zod/src/v4/locales/gu.ts +1 -0
- package/node_modules/zod/src/v4/locales/he.ts +1 -0
- package/node_modules/zod/src/v4/locales/hi.ts +1 -0
- package/node_modules/zod/src/v4/locales/hr.ts +1 -0
- package/node_modules/zod/src/v4/locales/hu.ts +1 -0
- package/node_modules/zod/src/v4/locales/hy.ts +1 -0
- package/node_modules/zod/src/v4/locales/id.ts +1 -0
- package/node_modules/zod/src/v4/locales/index.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +1 -0
- package/node_modules/zod/src/v4/locales/it.ts +1 -0
- package/node_modules/zod/src/v4/locales/ja.ts +1 -0
- package/node_modules/zod/src/v4/locales/ka.ts +1 -0
- package/node_modules/zod/src/v4/locales/km.ts +1 -0
- package/node_modules/zod/src/v4/locales/kn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ko.ts +1 -0
- package/node_modules/zod/src/v4/locales/lt.ts +1 -0
- package/node_modules/zod/src/v4/locales/mk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ms.ts +1 -0
- package/node_modules/zod/src/v4/locales/ne.ts +1 -0
- package/node_modules/zod/src/v4/locales/nl.ts +1 -0
- package/node_modules/zod/src/v4/locales/nn.ts +1 -0
- package/node_modules/zod/src/v4/locales/no.ts +1 -0
- package/node_modules/zod/src/v4/locales/ota.ts +1 -0
- package/node_modules/zod/src/v4/locales/pl.ts +1 -0
- package/node_modules/zod/src/v4/locales/ps.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt.ts +1 -0
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +1 -0
- package/node_modules/zod/src/v4/locales/sk.ts +1 -0
- package/node_modules/zod/src/v4/locales/sl.ts +1 -0
- package/node_modules/zod/src/v4/locales/sv.ts +1 -0
- package/node_modules/zod/src/v4/locales/ta.ts +1 -0
- package/node_modules/zod/src/v4/locales/tg.ts +134 -0
- package/node_modules/zod/src/v4/locales/th.ts +1 -0
- package/node_modules/zod/src/v4/locales/tk.ts +1 -0
- package/node_modules/zod/src/v4/locales/tr.ts +1 -0
- package/node_modules/zod/src/v4/locales/uk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ur.ts +1 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +1 -0
- package/node_modules/zod/src/v4/locales/yo.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +1 -0
- package/node_modules/zod/src/v4/mini/checks.ts +0 -1
- package/node_modules/zod/src/v4/mini/external.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +38 -2
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +8 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +16 -0
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +20 -2
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.d.cts +1 -1
- package/node_modules/zod/v4/classic/external.d.ts +1 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -31
- package/node_modules/zod/v4/classic/schemas.d.cts +17 -1
- package/node_modules/zod/v4/classic/schemas.d.ts +17 -1
- package/node_modules/zod/v4/classic/schemas.js +77 -29
- package/node_modules/zod/v4/core/api.cjs +37 -2
- package/node_modules/zod/v4/core/api.d.cts +6 -4
- package/node_modules/zod/v4/core/api.d.ts +6 -4
- package/node_modules/zod/v4/core/api.js +17 -2
- package/node_modules/zod/v4/core/checks.cjs +19 -96
- package/node_modules/zod/v4/core/checks.d.cts +1 -1
- package/node_modules/zod/v4/core/checks.d.ts +1 -1
- package/node_modules/zod/v4/core/checks.js +0 -96
- package/node_modules/zod/v4/core/compile.cjs +165 -66
- package/node_modules/zod/v4/core/compile.d.cts +18 -4
- package/node_modules/zod/v4/core/compile.d.ts +18 -4
- package/node_modules/zod/v4/core/compile.js +146 -67
- package/node_modules/zod/v4/core/core.cjs +19 -0
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +215 -63
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +17 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +17 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +195 -64
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +114 -23
- package/node_modules/zod/v4/core/memoizer.js +72 -23
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +29 -6
- package/node_modules/zod/v4/core/regexes.d.cts +2 -0
- package/node_modules/zod/v4/core/regexes.d.ts +2 -0
- package/node_modules/zod/v4/core/regexes.js +8 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +322 -95
- package/node_modules/zod/v4/core/schemas.d.cts +42 -7
- package/node_modules/zod/v4/core/schemas.d.ts +42 -7
- package/node_modules/zod/v4/core/schemas.js +301 -94
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +29 -7
- package/node_modules/zod/v4/core/to-json-schema.d.cts +7 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +7 -3
- package/node_modules/zod/v4/core/to-json-schema.js +8 -7
- package/node_modules/zod/v4/core/util.cjs +181 -143
- package/node_modules/zod/v4/core/util.d.cts +25 -4
- package/node_modules/zod/v4/core/util.d.ts +25 -4
- package/node_modules/zod/v4/core/util.js +160 -143
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +31 -0
- package/node_modules/zod/v4/core/visit.js +12 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +1 -0
- package/node_modules/zod/v4/locales/ar.js +1 -0
- package/node_modules/zod/v4/locales/az.cjs +1 -0
- package/node_modules/zod/v4/locales/az.js +1 -0
- package/node_modules/zod/v4/locales/be.cjs +1 -0
- package/node_modules/zod/v4/locales/be.js +1 -0
- package/node_modules/zod/v4/locales/bg.cjs +1 -0
- package/node_modules/zod/v4/locales/bg.js +1 -0
- package/node_modules/zod/v4/locales/bn.cjs +1 -0
- package/node_modules/zod/v4/locales/bn.js +1 -0
- package/node_modules/zod/v4/locales/ca.cjs +1 -0
- package/node_modules/zod/v4/locales/ca.js +1 -0
- package/node_modules/zod/v4/locales/ckb.cjs +1 -0
- package/node_modules/zod/v4/locales/ckb.js +1 -0
- package/node_modules/zod/v4/locales/cs.cjs +1 -0
- package/node_modules/zod/v4/locales/cs.js +1 -0
- package/node_modules/zod/v4/locales/da.cjs +1 -0
- package/node_modules/zod/v4/locales/da.js +1 -0
- package/node_modules/zod/v4/locales/de.cjs +1 -0
- package/node_modules/zod/v4/locales/de.js +1 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +1 -0
- package/node_modules/zod/v4/locales/en.js +1 -0
- package/node_modules/zod/v4/locales/eo.cjs +1 -0
- package/node_modules/zod/v4/locales/eo.js +1 -0
- package/node_modules/zod/v4/locales/es.cjs +1 -0
- package/node_modules/zod/v4/locales/es.js +1 -0
- package/node_modules/zod/v4/locales/fa.cjs +1 -0
- package/node_modules/zod/v4/locales/fa.js +1 -0
- package/node_modules/zod/v4/locales/fi.cjs +1 -0
- package/node_modules/zod/v4/locales/fi.js +1 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +1 -0
- package/node_modules/zod/v4/locales/fr-CA.js +1 -0
- package/node_modules/zod/v4/locales/fr.cjs +1 -0
- package/node_modules/zod/v4/locales/fr.js +1 -0
- package/node_modules/zod/v4/locales/gu.cjs +1 -0
- package/node_modules/zod/v4/locales/gu.js +1 -0
- package/node_modules/zod/v4/locales/he.cjs +1 -0
- package/node_modules/zod/v4/locales/he.js +1 -0
- package/node_modules/zod/v4/locales/hi.cjs +1 -0
- package/node_modules/zod/v4/locales/hi.js +1 -0
- package/node_modules/zod/v4/locales/hr.cjs +1 -0
- package/node_modules/zod/v4/locales/hr.js +1 -0
- package/node_modules/zod/v4/locales/hu.cjs +1 -0
- package/node_modules/zod/v4/locales/hu.js +1 -0
- package/node_modules/zod/v4/locales/hy.cjs +1 -0
- package/node_modules/zod/v4/locales/hy.js +1 -0
- package/node_modules/zod/v4/locales/id.cjs +1 -0
- package/node_modules/zod/v4/locales/id.js +1 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.d.cts +1 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +1 -0
- package/node_modules/zod/v4/locales/is.js +1 -0
- package/node_modules/zod/v4/locales/it.cjs +1 -0
- package/node_modules/zod/v4/locales/it.js +1 -0
- package/node_modules/zod/v4/locales/ja.cjs +1 -0
- package/node_modules/zod/v4/locales/ja.js +1 -0
- package/node_modules/zod/v4/locales/ka.cjs +1 -0
- package/node_modules/zod/v4/locales/ka.js +1 -0
- package/node_modules/zod/v4/locales/km.cjs +1 -0
- package/node_modules/zod/v4/locales/km.js +1 -0
- package/node_modules/zod/v4/locales/kn.cjs +1 -0
- package/node_modules/zod/v4/locales/kn.js +1 -0
- package/node_modules/zod/v4/locales/ko.cjs +1 -0
- package/node_modules/zod/v4/locales/ko.js +1 -0
- package/node_modules/zod/v4/locales/lt.cjs +1 -0
- package/node_modules/zod/v4/locales/lt.js +1 -0
- package/node_modules/zod/v4/locales/mk.cjs +1 -0
- package/node_modules/zod/v4/locales/mk.js +1 -0
- package/node_modules/zod/v4/locales/ms.cjs +1 -0
- package/node_modules/zod/v4/locales/ms.js +1 -0
- package/node_modules/zod/v4/locales/ne.cjs +1 -0
- package/node_modules/zod/v4/locales/ne.js +1 -0
- package/node_modules/zod/v4/locales/nl.cjs +1 -0
- package/node_modules/zod/v4/locales/nl.js +1 -0
- package/node_modules/zod/v4/locales/nn.cjs +1 -0
- package/node_modules/zod/v4/locales/nn.js +1 -0
- package/node_modules/zod/v4/locales/no.cjs +1 -0
- package/node_modules/zod/v4/locales/no.js +1 -0
- package/node_modules/zod/v4/locales/ota.cjs +1 -0
- package/node_modules/zod/v4/locales/ota.js +1 -0
- package/node_modules/zod/v4/locales/pl.cjs +1 -0
- package/node_modules/zod/v4/locales/pl.js +1 -0
- package/node_modules/zod/v4/locales/ps.cjs +1 -0
- package/node_modules/zod/v4/locales/ps.js +1 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +1 -0
- package/node_modules/zod/v4/locales/pt-BR.js +1 -0
- package/node_modules/zod/v4/locales/pt.cjs +1 -0
- package/node_modules/zod/v4/locales/pt.js +1 -0
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +1 -0
- package/node_modules/zod/v4/locales/ru.js +1 -0
- package/node_modules/zod/v4/locales/sk.cjs +1 -0
- package/node_modules/zod/v4/locales/sk.js +1 -0
- package/node_modules/zod/v4/locales/sl.cjs +1 -0
- package/node_modules/zod/v4/locales/sl.js +1 -0
- package/node_modules/zod/v4/locales/sv.cjs +1 -0
- package/node_modules/zod/v4/locales/sv.js +1 -0
- package/node_modules/zod/v4/locales/ta.cjs +1 -0
- package/node_modules/zod/v4/locales/ta.js +1 -0
- package/node_modules/zod/v4/locales/tg.cjs +143 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +116 -0
- package/node_modules/zod/v4/locales/th.cjs +1 -0
- package/node_modules/zod/v4/locales/th.js +1 -0
- package/node_modules/zod/v4/locales/tk.cjs +1 -0
- package/node_modules/zod/v4/locales/tk.js +1 -0
- package/node_modules/zod/v4/locales/tr.cjs +1 -0
- package/node_modules/zod/v4/locales/tr.js +1 -0
- package/node_modules/zod/v4/locales/uk.cjs +1 -0
- package/node_modules/zod/v4/locales/uk.js +1 -0
- package/node_modules/zod/v4/locales/ur.cjs +1 -0
- package/node_modules/zod/v4/locales/ur.js +1 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +1 -0
- package/node_modules/zod/v4/locales/vi.js +1 -0
- package/node_modules/zod/v4/locales/yo.cjs +1 -0
- package/node_modules/zod/v4/locales/yo.js +1 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-CN.js +1 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-TW.js +1 -0
- package/node_modules/zod/v4/mini/checks.cjs +20 -2
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.d.cts +1 -1
- package/node_modules/zod/v4/mini/external.d.ts +1 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +42 -4
- package/node_modules/zod/v4/mini/schemas.d.cts +8 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +8 -0
- package/node_modules/zod/v4/mini/schemas.js +19 -2
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/acpx-engine/execute.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAcL,KAAK,sBAAsB,EAI3B,KAAK,0BAA0B,EAC/B,K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AC5C,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpC,cAAc,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAChD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,GAAG;IACF,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAyDA;AAgjBD,wBAAgB,wBAAwB,CAAC,IAAI,GAAE,yBAA8B,SAQ9B,uBAAuB,KAAG,OAAO,CAAC,sBAAsB,CAAC,CAo+CvG;AAGD,eAAO,MAAM,OAAO,QAv+C2B,uBAAuB,KAAG,OAAO,CAAC,sBAAsB,CAu+CtD,CAAC"}
|
|
@@ -7,9 +7,10 @@ import { promisify } from "node:util";
|
|
|
7
7
|
import { createHash, randomUUID } from "node:crypto";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { adapterExecutionTargetSessionIdentity, describeAdapterExecutionTarget, adapterExecutionTargetDuplexObservabilityRecorder, adapterExecutionTargetEnablesSandboxDuplexBridge, formatAdapterExecutionTimeoutErrorMessage, formatAdapterExecutionTimeoutStartLogLine, prepareAdapterExecutionTargetRuntime, readAdapterExecutionTarget, resolveAdapterExecutionTargetTimeout, resolveReferencedSourceIgnore, runAdapterExecutionTargetShellCommand, startAdapterExecutionTargetPaperclipBridge, startAdapterExecutionTargetProcessSessionBridge, } from "@paperclipai/adapter-utils/execution-target";
|
|
10
|
+
import { captureLocalProcess, capturedProcessExited, killCapturedLocalProcess } from "./local-process-control.js";
|
|
10
11
|
import { DUPLEX_CHANNEL_LOST_ERROR_CODE } from "../bridge-transport-contract.js";
|
|
11
12
|
import { classifyWorkspaceRestoreFailure, describeWorkspaceRestoreFailure, } from "../workspace-restore-merge.js";
|
|
12
|
-
import { DEFAULT_PAPERCLIP_AGENT_PROMPT_TEMPLATE, applyPaperclipWorkspaceEnv, asNumber, asString, buildInvocationEnvForLogs, buildPaperclipEnv, ensureAbsoluteDirectory, ensurePathInEnv, ensurePaperclipSkillSymlink, isForbiddenConfigEnvKey, isPaperclipRuntimeEnvKey, joinPromptSections, materializePaperclipSkillCopy, parseObject, isPaperclipSkillSourceMissing, readPaperclipRuntimeSkillEntries, readPaperclipIssueWorkModeFromContext, renderPaperclipWakePrompt, renderTemplate, resolvePaperclipInstanceRootForAdapter, selectPaperclipTaskMarkdown, resolveLegacyPaperclipDesiredSkillNames, removeMaintainerOnlySkillSymlinks, rewriteWorkspaceCwdEnvVarsForExecution, shapePaperclipWorkspaceEnvForExecution, stringifyPaperclipWakePayload, } from "@paperclipai/adapter-utils/server-utils";
|
|
13
|
+
import { DEFAULT_PAPERCLIP_AGENT_PROMPT_TEMPLATE, applyPaperclipWorkspaceEnv, asNumber, asString, buildInvocationEnvForLogs, buildPaperclipEnv, ensureAbsoluteDirectory, ensurePathInEnv, ensurePaperclipSkillSymlink, isForbiddenConfigEnvKey, isPaperclipExternalChatTurn, isPaperclipRuntimeEnvKey, joinPromptSections, materializePaperclipSkillCopy, parseObject, isPaperclipSkillSourceMissing, readPaperclipRuntimeSkillEntries, readPaperclipIssueWorkModeFromContext, renderPaperclipWakePrompt, renderTemplate, resolvePaperclipInstanceRootForAdapter, selectPaperclipTaskMarkdown, resolveLegacyPaperclipDesiredSkillNames, removeMaintainerOnlySkillSymlinks, rewriteWorkspaceCwdEnvVarsForExecution, shapePaperclipWorkspaceEnvForExecution, stringifyPaperclipWakePayload, } from "@paperclipai/adapter-utils/server-utils";
|
|
13
14
|
import { shellQuote } from "@paperclipai/adapter-utils/ssh";
|
|
14
15
|
import { createAcpRuntime, createAgentRegistry, createRuntimeStore, isAcpRuntimeError, } from "acpx/runtime";
|
|
15
16
|
import { ACPX_HANDSHAKE_TIMEOUT_MS, ACPX_HANDSHAKE_TRANSPORT_POLL_MS, DEFAULT_ACP_ENGINE_AGENT, DEFAULT_ACP_ENGINE_MODE, DEFAULT_ACP_ENGINE_NON_INTERACTIVE_PERMISSIONS, DEFAULT_ACP_ENGINE_PERMISSION_MODE, DEFAULT_ACP_ENGINE_TIMEOUT_SEC, DEFAULT_ACP_ENGINE_WARM_HANDLE_IDLE_MS, } from "./constants.js";
|
|
@@ -1206,6 +1207,11 @@ async function buildRuntime(input) {
|
|
|
1206
1207
|
// `env` above and are never present in shapedEnvConfig, so they inherently
|
|
1207
1208
|
// stay out of the hash and don't reset the session every heartbeat.
|
|
1208
1209
|
const resolvedAdapterEnv = {};
|
|
1210
|
+
const scratch = parseObject(context.paperclipScratch);
|
|
1211
|
+
const scratchKeys = scratch.type === "heartbeat_run" && typeof scratch.dir === "string"
|
|
1212
|
+
? new Set(["PAPERCLIP_RUN_SCRATCH_DIR", "PAPERCLIP_TASK_SCRATCH_DIR", "PAPERCLIP_SCRATCH_DIR", "PAPERCLIP_TMPDIR",
|
|
1213
|
+
...(Array.isArray(scratch.tempKeysApplied) ? scratch.tempKeysApplied.filter((key) => typeof key === "string" && ["TMPDIR", "TEMP", "TMP"].includes(key)) : [])])
|
|
1214
|
+
: new Set();
|
|
1209
1215
|
for (const [key, value] of Object.entries(shapedEnvConfig)) {
|
|
1210
1216
|
if (typeof value !== "string")
|
|
1211
1217
|
continue;
|
|
@@ -1219,7 +1225,11 @@ async function buildRuntime(input) {
|
|
|
1219
1225
|
if (isPaperclipRuntimeEnvKey(key) && key in env)
|
|
1220
1226
|
continue;
|
|
1221
1227
|
env[key] = value;
|
|
1222
|
-
|
|
1228
|
+
// The server rotates run-owned scratch paths on every wake. Still forward
|
|
1229
|
+
// them, but only hash actual adapter settings. User-supplied temp overrides
|
|
1230
|
+
// are absent from tempKeysApplied and keep their compatibility protection.
|
|
1231
|
+
if (!scratchKeys.has(key) || value !== scratch.dir)
|
|
1232
|
+
resolvedAdapterEnv[key] = value;
|
|
1223
1233
|
}
|
|
1224
1234
|
if (authToken)
|
|
1225
1235
|
env.PAPERCLIP_API_KEY = authToken;
|
|
@@ -2008,7 +2018,11 @@ function renderApiAccessNote(env) {
|
|
|
2008
2018
|
}
|
|
2009
2019
|
async function buildPrompt(ctx, resumedSession, env) {
|
|
2010
2020
|
const { agent, runId, config, context, onLog } = ctx;
|
|
2011
|
-
const
|
|
2021
|
+
const configuredPromptTemplate = asString(config.promptTemplate, "");
|
|
2022
|
+
const hasCustomPromptTemplate = configuredPromptTemplate.trim().length > 0;
|
|
2023
|
+
const promptTemplate = hasCustomPromptTemplate
|
|
2024
|
+
? configuredPromptTemplate
|
|
2025
|
+
: DEFAULT_PAPERCLIP_AGENT_PROMPT_TEMPLATE;
|
|
2012
2026
|
const instructionsFilePath = asString(config.instructionsFilePath, "").trim();
|
|
2013
2027
|
const instructionsDir = instructionsFilePath ? `${path.dirname(instructionsFilePath)}/` : "";
|
|
2014
2028
|
let instructionsPrefix = "";
|
|
@@ -2042,6 +2056,7 @@ async function buildPrompt(ctx, resumedSession, env) {
|
|
|
2042
2056
|
? renderTemplate(bootstrapPromptTemplate, templateData).trim()
|
|
2043
2057
|
: "";
|
|
2044
2058
|
const taskContextNote = selectPaperclipTaskMarkdown(context, { resumedSession });
|
|
2059
|
+
const externalChatTurn = isPaperclipExternalChatTurn(context.paperclipWake);
|
|
2045
2060
|
const wakePrompt = renderPaperclipWakePrompt(context.paperclipWake, {
|
|
2046
2061
|
resumedSession,
|
|
2047
2062
|
// The task-context markdown is the authoritative brief on this lane; keep
|
|
@@ -2050,10 +2065,12 @@ async function buildPrompt(ctx, resumedSession, env) {
|
|
|
2050
2065
|
});
|
|
2051
2066
|
const shouldUseResumeDeltaPrompt = resumedSession && wakePrompt.length > 0;
|
|
2052
2067
|
const promptInstructionsPrefix = shouldUseResumeDeltaPrompt ? "" : instructionsPrefix;
|
|
2053
|
-
const renderedPrompt = shouldUseResumeDeltaPrompt
|
|
2068
|
+
const renderedPrompt = shouldUseResumeDeltaPrompt || (externalChatTurn && !hasCustomPromptTemplate)
|
|
2069
|
+
? ""
|
|
2070
|
+
: renderTemplate(promptTemplate, templateData);
|
|
2054
2071
|
const sessionHandoffNote = asString(context.paperclipSessionHandoffMarkdown, "").trim();
|
|
2055
|
-
const paperclipEnvNote = renderPaperclipEnvNote(env);
|
|
2056
|
-
const apiAccessNote = renderApiAccessNote(env);
|
|
2072
|
+
const paperclipEnvNote = externalChatTurn ? "" : renderPaperclipEnvNote(env);
|
|
2073
|
+
const apiAccessNote = externalChatTurn ? "" : renderApiAccessNote(env);
|
|
2057
2074
|
const prompt = joinPromptSections([
|
|
2058
2075
|
promptInstructionsPrefix,
|
|
2059
2076
|
renderedBootstrapPrompt,
|
|
@@ -2847,7 +2864,22 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
2847
2864
|
// null on the host lane (no staging) and on a build failure (where
|
|
2848
2865
|
// `buildRuntime` already released its own partial lease).
|
|
2849
2866
|
let releaseStagingLease = null;
|
|
2867
|
+
let stopTimer;
|
|
2868
|
+
let removeStopListener;
|
|
2869
|
+
let forcedStop = false;
|
|
2870
|
+
let runtimeStopConfirmed = false;
|
|
2871
|
+
let safeInterruptedSession = false;
|
|
2872
|
+
const interruptionTools = new Map();
|
|
2873
|
+
let incompleteToolInventory = false;
|
|
2850
2874
|
try {
|
|
2875
|
+
await ctx.onCancellationReady?.();
|
|
2876
|
+
if (ctx.signal?.aborted)
|
|
2877
|
+
return {
|
|
2878
|
+
exitCode: null, signal: null, timedOut: false,
|
|
2879
|
+
errorCode: "cancelled", errorMessage: "Stopped before provider startup",
|
|
2880
|
+
executionRecovery: { kind: "bootstrap", providerWorkStarted: false },
|
|
2881
|
+
resultJson: { executionCancellation: { state: "acknowledged", acknowledgedAt: new Date().toISOString(), forced: false } },
|
|
2882
|
+
};
|
|
2851
2883
|
// Evict idle staged runtimes BEFORE building the runtime, since buildRuntime
|
|
2852
2884
|
// consults the staged cache to decide whether a compatible resume may reuse
|
|
2853
2885
|
// an already-staged runtime — an expired entry must not be reused.
|
|
@@ -3053,6 +3085,9 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3053
3085
|
await hostStore.evictIdle(now());
|
|
3054
3086
|
const previousParams = parseObject(ctx.runtime.sessionParams);
|
|
3055
3087
|
const canResume = isCompatibleSession(previousParams, prepared);
|
|
3088
|
+
if (previousParams.interruptedCheckpoint === true && !canResume) {
|
|
3089
|
+
throw new Error("The interrupted session is no longer compatible. Its action history must be checked before starting a new session.");
|
|
3090
|
+
}
|
|
3056
3091
|
const resumeSessionId = canResume ? asString(previousParams.acpSessionId, "") || undefined : undefined;
|
|
3057
3092
|
// Borrow the warm entry without removing it, so an overlapping run of the
|
|
3058
3093
|
// same session still sees it. The borrow clears the entry's idle timer, so
|
|
@@ -3070,6 +3105,28 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3070
3105
|
processIdentitySink.current = ctx.onSpawn;
|
|
3071
3106
|
flushChildStderr(childStderrState);
|
|
3072
3107
|
childStderrState.logPath = prepared.childStderrLogPath;
|
|
3108
|
+
const persistedRuntimeStore = createRuntimeStore({ stateDir: prepared.stateDir });
|
|
3109
|
+
const runtimeStore = {
|
|
3110
|
+
async load(id) {
|
|
3111
|
+
const record = await persistedRuntimeStore.load(id);
|
|
3112
|
+
if (!record)
|
|
3113
|
+
return undefined;
|
|
3114
|
+
// ACPX resumes from the stored session options rather than the
|
|
3115
|
+
// options passed to ensureSession. Keep conversation state, but
|
|
3116
|
+
// launch the provider with this run's credentials and scratch paths.
|
|
3117
|
+
return {
|
|
3118
|
+
...record,
|
|
3119
|
+
acpx: {
|
|
3120
|
+
...record.acpx,
|
|
3121
|
+
session_options: {
|
|
3122
|
+
...record.acpx?.session_options,
|
|
3123
|
+
env: { ...prepared.env },
|
|
3124
|
+
},
|
|
3125
|
+
},
|
|
3126
|
+
};
|
|
3127
|
+
},
|
|
3128
|
+
save: (record) => persistedRuntimeStore.save(record),
|
|
3129
|
+
};
|
|
3073
3130
|
const runtimeOptions = {
|
|
3074
3131
|
cwd: prepared.cwd,
|
|
3075
3132
|
// Host-only spawn cwd for the relay proxy on the remote process-session
|
|
@@ -3078,7 +3135,7 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3078
3135
|
// fingerprint / compat key are unaffected — this redirects ONLY the host
|
|
3079
3136
|
// `spawn()` `chdir`, not the in-sandbox data path.
|
|
3080
3137
|
spawnCwd: prepared.hostSpawnCwd,
|
|
3081
|
-
sessionStore:
|
|
3138
|
+
sessionStore: runtimeStore,
|
|
3082
3139
|
agentRegistry: prepared.agentRegistry,
|
|
3083
3140
|
permissionMode: prepared.permissionMode,
|
|
3084
3141
|
nonInteractivePermissions: prepared.nonInteractivePermissions,
|
|
@@ -3097,6 +3154,7 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3097
3154
|
: undefined,
|
|
3098
3155
|
onAgentSpawn: async (meta) => {
|
|
3099
3156
|
processIdentitySink.latest = meta;
|
|
3157
|
+
processIdentitySink.localProcess = prepared.processSessionBridge ? undefined : captureLocalProcess(meta.pid);
|
|
3100
3158
|
await processIdentitySink.current?.({
|
|
3101
3159
|
pid: meta.pid,
|
|
3102
3160
|
processGroupId: null,
|
|
@@ -3222,7 +3280,7 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3222
3280
|
});
|
|
3223
3281
|
}
|
|
3224
3282
|
catch (err) {
|
|
3225
|
-
if (!resumeSessionId || !isResumeFailure(err))
|
|
3283
|
+
if (!resumeSessionId || !isResumeFailure(err) || previousParams.interruptedCheckpoint === true)
|
|
3226
3284
|
throw err;
|
|
3227
3285
|
clearSession = true;
|
|
3228
3286
|
resumedSession = false;
|
|
@@ -3268,6 +3326,9 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3268
3326
|
});
|
|
3269
3327
|
}
|
|
3270
3328
|
// A compatible warm handle reuses the already-running ACP agent and does
|
|
3329
|
+
if (previousParams.interruptedCheckpoint === true && handle?.backendSessionId !== resumeSessionId) {
|
|
3330
|
+
throw new Error("The provider did not restore the interrupted session; refusing a fresh-session fallback.");
|
|
3331
|
+
}
|
|
3271
3332
|
// not emit another spawn event. Persist its known identity on this run
|
|
3272
3333
|
// before the next prompt starts so every running heartbeat is adoptable.
|
|
3273
3334
|
if (handle && cached && processIdentitySink.latest && ctx.onSpawn) {
|
|
@@ -3574,6 +3635,7 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3574
3635
|
turnPhaseStart = now();
|
|
3575
3636
|
};
|
|
3576
3637
|
const stepTurnStart = (signal, startTimeoutMs) => {
|
|
3638
|
+
ctx.signal?.throwIfAborted();
|
|
3577
3639
|
const turn = runtime.startTurn({
|
|
3578
3640
|
handle: sessionHandle,
|
|
3579
3641
|
text: runPrompt,
|
|
@@ -3583,6 +3645,27 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3583
3645
|
signal,
|
|
3584
3646
|
});
|
|
3585
3647
|
activeTurn = turn;
|
|
3648
|
+
// ACP can resolve the turn before its provider exits. Keep the Stop
|
|
3649
|
+
// deadline armed through settlement, including provider cleanup.
|
|
3650
|
+
const armStopDeadline = () => {
|
|
3651
|
+
stopTimer = setTimeout(() => {
|
|
3652
|
+
forcedStop = true;
|
|
3653
|
+
const providerPid = processIdentitySink.latest?.pid;
|
|
3654
|
+
if (providerPid && !prepared.processSessionBridge) {
|
|
3655
|
+
// Escalate the owned local process directly. A second ACP close
|
|
3656
|
+
// can wait behind the same hung cleanup (or open a new client).
|
|
3657
|
+
killCapturedLocalProcess(processIdentitySink.localProcess);
|
|
3658
|
+
}
|
|
3659
|
+
else {
|
|
3660
|
+
void runtime.close({ handle: sessionHandle, reason: "operator stop deadline", discardPersistentState: true })
|
|
3661
|
+
.catch(() => { });
|
|
3662
|
+
}
|
|
3663
|
+
}, Math.max(1, asNumber(ctx.config.graceSec, 15)) * 1000);
|
|
3664
|
+
};
|
|
3665
|
+
ctx.signal?.addEventListener("abort", armStopDeadline, { once: true });
|
|
3666
|
+
removeStopListener = () => ctx.signal?.removeEventListener("abort", armStopDeadline);
|
|
3667
|
+
if (ctx.signal?.aborted)
|
|
3668
|
+
armStopDeadline();
|
|
3586
3669
|
return {
|
|
3587
3670
|
cancel: async (reason) => {
|
|
3588
3671
|
await turn.cancel({ reason });
|
|
@@ -3593,6 +3676,21 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3593
3676
|
const turn = activeTurn;
|
|
3594
3677
|
const toolTitles = new Map();
|
|
3595
3678
|
for await (const event of turn.events) {
|
|
3679
|
+
// ACPX currently flattens client-side filesystem/terminal receipts
|
|
3680
|
+
// into status text. They cannot establish complete action outcomes.
|
|
3681
|
+
if (event.type === "status" && /^(fs|terminal)\//.test(event.text))
|
|
3682
|
+
incompleteToolInventory = true;
|
|
3683
|
+
if (event.type === "tool_call") {
|
|
3684
|
+
if (!event.toolCallId)
|
|
3685
|
+
incompleteToolInventory = true;
|
|
3686
|
+
else {
|
|
3687
|
+
const previous = interruptionTools.get(event.toolCallId);
|
|
3688
|
+
interruptionTools.set(event.toolCallId, {
|
|
3689
|
+
kind: event.kind ?? previous?.kind,
|
|
3690
|
+
status: event.status ?? previous?.status,
|
|
3691
|
+
});
|
|
3692
|
+
}
|
|
3693
|
+
}
|
|
3596
3694
|
if (event.type === "text_delta" && event.stream !== "thought") {
|
|
3597
3695
|
currentOutputChunk.push(event.text);
|
|
3598
3696
|
}
|
|
@@ -3667,6 +3765,15 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3667
3765
|
eventCostUsd,
|
|
3668
3766
|
});
|
|
3669
3767
|
const failedTurn = terminal.status === "failed" || terminal.status === "cancelled" || timedOut;
|
|
3768
|
+
// A provider-native command/write has no reliable external outcome
|
|
3769
|
+
// receipt. Only settled reads (or a turn with no tools) can establish
|
|
3770
|
+
// automatic interrupted-session continuity here.
|
|
3771
|
+
safeInterruptedSession = ctx.signal?.aborted === true && !forcedStop && !timedOut && !channelLost
|
|
3772
|
+
&& (terminal.status === "cancelled" || terminal.status === "completed")
|
|
3773
|
+
&& prepared.mode === "persistent" && !prepared.processSessionBridge
|
|
3774
|
+
&& Boolean(sessionHandle.backendSessionId)
|
|
3775
|
+
&& !incompleteToolInventory
|
|
3776
|
+
&& [...interruptionTools.values()].every((tool) => tool.kind === "read" && tool.status === "completed");
|
|
3670
3777
|
// Record how the settlement `endSession` step closes the runtime for this
|
|
3671
3778
|
// outcome. A clean persistent host turn is save-eligible, but the
|
|
3672
3779
|
// Amendment B credential gate fails on the host lane (the run API key is
|
|
@@ -3686,7 +3793,7 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3686
3793
|
: failedTurn
|
|
3687
3794
|
? `paperclip turn ${terminal.status}`
|
|
3688
3795
|
: "paperclip completed turn cleanup",
|
|
3689
|
-
discardPersistentState: terminal.status === "cancelled" || timedOut || channelLost,
|
|
3796
|
+
discardPersistentState: (terminal.status === "cancelled" && !safeInterruptedSession) || timedOut || channelLost,
|
|
3690
3797
|
dropWarmEntry: false,
|
|
3691
3798
|
recordCloseError: false,
|
|
3692
3799
|
cancelTurnReason: null,
|
|
@@ -3862,6 +3969,7 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
3862
3969
|
};
|
|
3863
3970
|
try {
|
|
3864
3971
|
return await runTurnSequence({
|
|
3972
|
+
signal: ctx.signal,
|
|
3865
3973
|
timeoutMs: prepared.timeoutSec > 0 ? prepared.timeoutSec * 1000 : undefined,
|
|
3866
3974
|
timeoutMessage: formatAdapterExecutionTimeoutErrorMessage(prepared.timeoutResolution),
|
|
3867
3975
|
promptBuild: stepPromptBuild,
|
|
@@ -4000,7 +4108,7 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
4000
4108
|
});
|
|
4001
4109
|
return;
|
|
4002
4110
|
}
|
|
4003
|
-
const onCloseError = settlement.recordCloseError
|
|
4111
|
+
const onCloseError = settlement.recordCloseError || ctx.signal?.aborted
|
|
4004
4112
|
? (closeErr) => recordTeardownError("runtime-close", closeErr)
|
|
4005
4113
|
: () => { };
|
|
4006
4114
|
await runtime
|
|
@@ -4009,6 +4117,7 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
4009
4117
|
reason: settlement.reason,
|
|
4010
4118
|
discardPersistentState: settlement.discardPersistentState,
|
|
4011
4119
|
})
|
|
4120
|
+
.then(() => { runtimeStopConfirmed = true; })
|
|
4012
4121
|
.catch(onCloseError);
|
|
4013
4122
|
if (settlement.dropWarmEntry && warmHandleMatches(existing, runtime, settlement.handle) && existing) {
|
|
4014
4123
|
clearWarmHandleTimer(existing);
|
|
@@ -4082,10 +4191,35 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
4082
4191
|
if (childStderrState)
|
|
4083
4192
|
flushChildStderr(childStderrState);
|
|
4084
4193
|
},
|
|
4085
|
-
reproduceResult: () => {
|
|
4194
|
+
reproduceResult: async () => {
|
|
4086
4195
|
if (!capturedResult) {
|
|
4087
4196
|
throw new Error("run coordinator reproduced a result before the run recorded one");
|
|
4088
4197
|
}
|
|
4198
|
+
clearTimeout(stopTimer);
|
|
4199
|
+
let providerExited = false;
|
|
4200
|
+
const providerPid = processIdentitySink?.latest?.pid;
|
|
4201
|
+
if (ctx.signal?.aborted && providerPid && !prepared.processSessionBridge) {
|
|
4202
|
+
for (let attempt = 0; attempt < 40; attempt += 1) {
|
|
4203
|
+
providerExited = capturedProcessExited(processIdentitySink.localProcess);
|
|
4204
|
+
if (providerExited || !forcedStop)
|
|
4205
|
+
break;
|
|
4206
|
+
await new Promise((resolve) => setTimeout(resolve, 25));
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4209
|
+
// A forced process exit can reject ACP close after the OS has already
|
|
4210
|
+
// confirmed termination. Acknowledge Stop, but never grant replay.
|
|
4211
|
+
if (ctx.signal?.aborted && providerExited && (runtimeStopConfirmed || forcedStop)) {
|
|
4212
|
+
capturedResult = {
|
|
4213
|
+
...capturedResult,
|
|
4214
|
+
...(safeInterruptedSession && !forcedStop && !("workspaceRestoreFailure" in workspaceRestoreFailureField)
|
|
4215
|
+
? { executionRecovery: { kind: "interrupted", providerStopped: true, sessionPreserved: true, actionOutcomes: "settled" },
|
|
4216
|
+
sessionParams: { ...capturedResult.sessionParams, interruptedCheckpoint: true } }
|
|
4217
|
+
: {}),
|
|
4218
|
+
resultJson: { ...capturedResult.resultJson, executionCancellation: {
|
|
4219
|
+
state: "acknowledged", acknowledgedAt: new Date().toISOString(), forced: forcedStop,
|
|
4220
|
+
} },
|
|
4221
|
+
};
|
|
4222
|
+
}
|
|
4089
4223
|
// The sync-back settlement step runs before this reproduces the result
|
|
4090
4224
|
// (settlement precedes reproduction), so a failed workspace restore is
|
|
4091
4225
|
// already recorded by the time we get here. Merge it into `resultJson`
|
|
@@ -4105,6 +4239,8 @@ export function createAcpxEngineExecutor(deps = {}) {
|
|
|
4105
4239
|
return await runAttempt(plan);
|
|
4106
4240
|
}
|
|
4107
4241
|
finally {
|
|
4242
|
+
clearTimeout(stopTimer);
|
|
4243
|
+
removeStopListener?.();
|
|
4108
4244
|
// End the run root span exactly once, on every return and on a throw.
|
|
4109
4245
|
runRootSpan.end(runFailed);
|
|
4110
4246
|
// Release the per-session staging lease as the run's final act, AFTER the
|