@justjoshn/pi-pstack-v2 0.1.4 → 0.1.6
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/README.md +4 -4
- package/docs/guide/01-setup.md +3 -3
- package/docs/guide/02-poteto-mode.md +21 -0
- package/docs/guide/05-build-and-clean.md +1 -1
- package/docs/pi-mechanisms.md +2 -2
- package/package.json +12 -5
- package/skills/create-formal-verification-skill/SKILL.md +1 -1
- package/skills/interrogate/SKILL.md +2 -2
- package/skills/poteto-mode/SKILL.md +12 -2
- package/skills/poteto-mode/playbooks/autonomous-run.md +1 -1
- package/skills/poteto-mode/playbooks/autopilot-full.md +1 -1
- package/skills/poteto-mode/playbooks/opening-a-pr.md +2 -2
- package/skills/poteto-mode/scripts/bootstrap.ts +1 -2
- package/skills/poteto-mode/scripts/bun.lock +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/LICENSE +21 -0
- package/skills/poteto-mode/scripts/node_modules/zod/README.md +218 -0
- package/skills/poteto-mode/scripts/node_modules/zod/compile.cjs +96 -0
- package/skills/poteto-mode/scripts/node_modules/zod/compile.d.cts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/compile.d.ts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/compile.js +52 -0
- package/skills/poteto-mode/scripts/node_modules/zod/index.cjs +52 -0
- package/skills/poteto-mode/scripts/node_modules/zod/index.d.cts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/index.d.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/index.js +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/locales/index.cjs +36 -0
- package/skills/poteto-mode/scripts/node_modules/zod/locales/index.d.cts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/locales/index.d.ts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/locales/index.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/locales/package.json +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/mini/index.cjs +51 -0
- package/skills/poteto-mode/scripts/node_modules/zod/mini/index.d.cts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/mini/index.d.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/mini/index.js +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/mini/package.json +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/package.json +147 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/compile.ts +56 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/index.ts +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/locales/index.ts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/mini/index.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/ZodError.ts +340 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/errors.ts +13 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/external.ts +6 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/index.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/error.test.ts +586 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/object.test.ts +431 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/string.test.ts +922 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v3/types.ts +5138 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/checks.ts +33 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/compat.ts +78 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/errors.ts +97 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/external.ts +57 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/iso.ts +20 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/parse.ts +88 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/array.test.ts +291 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/map.test.ts +349 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/set.test.ts +196 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/api.ts +1875 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/checks.ts +1266 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/compile.ts +2322 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/core.ts +230 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/doc.ts +52 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/errors.ts +543 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/index.ts +19 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/json-schema.ts +148 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/parse.ts +309 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/regexes.ts +217 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/schemas.ts +5226 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/util.ts +1293 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/index.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ar.ts +120 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/az.ts +116 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/be.ts +188 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/bg.ts +133 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ca.ts +121 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/cs.ts +123 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/da.ts +128 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/de.ts +121 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/el.ts +124 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/en.ts +136 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/eo.ts +123 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/es.ts +145 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/fa.ts +131 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/fi.ts +126 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/fr.ts +139 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/he.ts +253 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/hr.ts +135 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/hu.ts +122 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/hy.ts +175 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/id.ts +120 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/index.ts +63 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/is.ts +124 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/it.ts +121 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ja.ts +119 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ka.ts +128 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/km.ts +124 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ko.ts +126 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/lt.ts +243 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/mk.ts +123 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ms.ts +120 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/no.ts +121 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ota.ts +122 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/pl.ts +123 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ps.ts +131 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/pt.ts +159 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ro.ts +132 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ru.ts +188 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/sl.ts +123 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/sv.ts +124 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ta.ts +123 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/th.ts +124 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/tr.ts +116 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/uk.ts +122 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/ur.ts +124 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/uz.ts +120 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/vi.ts +122 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/yo.ts +129 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/checks.ts +33 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/external.ts +52 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/parse.ts +16 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
- package/skills/poteto-mode/scripts/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/ZodError.cjs +167 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/ZodError.js +143 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/errors.cjs +36 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/errors.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/errors.d.ts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/errors.js +9 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/external.cjs +41 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/external.d.cts +6 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/external.d.ts +6 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/external.js +6 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/util.cjs +156 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/helpers/util.js +133 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/index.cjs +52 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/index.d.cts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/index.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/index.js +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/locales/en.cjs +112 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/locales/en.js +109 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/package.json +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/standard-schema.cjs +21 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/standard-schema.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/types.cjs +3798 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/types.d.cts +1034 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/types.d.ts +1034 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v3/types.js +3697 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/checks.cjs +53 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/checks.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/coerce.cjs +66 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/coerce.js +17 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/compat.cjs +80 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/compat.d.cts +48 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/compat.d.ts +48 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/compat.js +31 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/errors.cjs +102 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/errors.d.cts +29 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/errors.d.ts +29 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/errors.js +57 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/external.cjs +97 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/external.d.cts +19 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/external.d.ts +19 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/external.js +17 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/from-json-schema.js +881 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/in-out.js +36 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/index.cjs +52 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/index.d.cts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/index.d.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/index.js +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/iso.cjs +68 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/iso.d.cts +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/iso.d.ts +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/iso.js +15 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/package.json +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/parse.cjs +63 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/parse.d.cts +44 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/parse.d.ts +44 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/parse.js +16 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/schemas.cjs +1676 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/schemas.d.cts +816 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/schemas.d.ts +816 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/classic/schemas.js +1535 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/api.cjs +1269 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/api.d.cts +335 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/api.d.ts +335 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/api.js +1107 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/checks.cjs +561 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/checks.d.cts +294 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/checks.d.ts +294 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/checks.js +516 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/compile.cjs +1916 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/compile.js +1866 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/core.cjs +167 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/core.d.cts +82 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/core.d.ts +82 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/core.js +141 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/doc.cjs +61 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/doc.d.cts +16 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/doc.d.ts +16 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/doc.js +38 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/errors.cjs +317 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/errors.d.cts +225 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/errors.d.ts +225 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/errors.js +267 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/index.cjs +70 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/index.d.cts +19 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/index.d.ts +19 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/index.js +19 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema-processors.js +843 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema.cjs +21 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema.d.cts +89 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema.d.ts +89 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/json-schema.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/memoizer.js +311 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/package.json +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/parse.cjs +233 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/parse.d.cts +52 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/parse.d.ts +52 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/parse.js +175 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/regexes.cjs +209 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/regexes.d.cts +90 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/regexes.d.ts +90 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/regexes.js +156 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/registries.cjs +75 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/registries.js +51 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/schemas.cjs +2699 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/schemas.d.cts +1275 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/schemas.d.ts +1275 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/schemas.js +2636 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/standard-schema.cjs +21 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/to-json-schema.js +651 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/util.cjs +964 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/util.d.cts +280 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/util.d.ts +280 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/util.js +873 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/versions.cjs +27 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/versions.js +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/visit.cjs +214 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/core/visit.js +169 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/index.cjs +51 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/index.d.cts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/index.d.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/index.js +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ar.cjs +138 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ar.js +111 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/az.cjs +137 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/az.js +110 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/be.cjs +195 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/be.js +168 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/bg.cjs +152 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/bg.js +125 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/bn.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ca.cjs +139 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ca.js +112 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ckb.js +133 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/cs.cjs +143 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/cs.js +116 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/da.cjs +147 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/da.js +120 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/de.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/de.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/el.cjs +139 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/el.js +112 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/en.cjs +152 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/en.js +125 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/eo.cjs +141 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/eo.js +114 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/es.cjs +163 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/es.js +136 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fa.cjs +146 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fa.js +119 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fi.cjs +144 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fi.js +117 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fr-CA.js +112 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fr.cjs +156 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/fr.js +129 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/gu.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/he.cjs +248 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/he.js +221 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hi.js +111 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hr.cjs +153 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hr.js +126 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hu.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hu.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hy.cjs +185 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/hy.js +158 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/id.cjs +138 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/id.js +111 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/index.cjs +152 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/index.d.cts +63 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/index.d.ts +63 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/index.js +63 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/is.cjs +141 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/is.js +114 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/it.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/it.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ja.cjs +139 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ja.js +112 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ka.cjs +144 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ka.js +117 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/kh.js +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/km.cjs +142 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/km.js +115 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/kn.js +116 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ko.cjs +143 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ko.js +116 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/lt.cjs +234 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/lt.js +207 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/mk.cjs +141 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/mk.js +114 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ms.cjs +139 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ms.js +112 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ne.js +111 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/nl.cjs +142 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/nl.js +115 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/nn.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/no.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/no.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ota.cjs +141 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ota.js +114 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/package.json +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pl.cjs +141 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pl.js +114 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ps.cjs +146 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ps.js +119 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pt.cjs +169 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/pt.js +142 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ro.cjs +149 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ro.js +122 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ru.cjs +195 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ru.js +168 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sk.js +116 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sl.cjs +141 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sl.js +114 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sv.cjs +142 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/sv.js +115 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ta.cjs +142 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ta.js +115 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tg.js +117 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/th.cjs +142 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/th.js +115 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tk.js +107 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tr.cjs +137 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/tr.js +110 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ua.js +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/uk.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/uk.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ur.cjs +142 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/ur.js +115 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/uz.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/uz.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/vi.cjs +140 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/vi.js +113 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/yo.cjs +139 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/yo.js +112 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/zh-CN.js +114 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/locales/zh-TW.js +112 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/checks.cjs +54 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/checks.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/coerce.cjs +71 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/coerce.js +22 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/external.cjs +95 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/external.d.cts +16 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/external.d.ts +16 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/external.js +16 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/in-out.js +36 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/index.cjs +51 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/index.js +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/iso.cjs +83 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/iso.js +34 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/package.json +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/parse.cjs +37 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/parse.js +1 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/schemas.cjs +1147 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/schemas.d.cts +480 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/schemas.d.ts +480 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/mini/schemas.js +1002 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4/package.json +7 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4-mini/index.cjs +51 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4-mini/index.js +3 -0
- package/skills/poteto-mode/scripts/node_modules/zod/v4-mini/package.json +7 -0
- package/skills/poteto-mode/scripts/package.json +2 -1
- package/skills/poteto-mode/scripts/watch-pr/classify.ts +144 -0
- package/skills/poteto-mode/scripts/watch-pr/cli.test.ts +68 -41
- package/skills/poteto-mode/scripts/watch-pr/cli.ts +95 -48
- package/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +26 -19
- package/skills/poteto-mode/scripts/watch-pr/github-checks.ts +91 -0
- package/skills/poteto-mode/scripts/watch-pr/github-json.ts +92 -0
- package/skills/poteto-mode/scripts/watch-pr/github-pr.ts +125 -0
- package/skills/poteto-mode/scripts/watch-pr/github-queries.ts +26 -0
- package/skills/poteto-mode/scripts/watch-pr/github-review.ts +112 -0
- package/skills/poteto-mode/scripts/watch-pr/github-stack.ts +67 -0
- package/skills/poteto-mode/scripts/watch-pr/github.test.ts +125 -104
- package/skills/poteto-mode/scripts/watch-pr/github.ts +158 -564
- package/skills/poteto-mode/scripts/watch-pr/policy.test.ts +210 -161
- package/skills/poteto-mode/scripts/watch-pr/policy.ts +23 -842
- package/skills/poteto-mode/scripts/watch-pr/poll.ts +121 -0
- package/skills/poteto-mode/scripts/watch-pr/queue.ts +190 -0
- package/skills/poteto-mode/scripts/watch-pr/recorder.test-helper.ts +16 -0
- package/skills/poteto-mode/scripts/watch-pr/render.ts +91 -63
- package/skills/poteto-mode/scripts/watch-pr/run-queued.ts +187 -0
- package/skills/poteto-mode/scripts/watch-pr/run-simple.ts +135 -0
- package/skills/poteto-mode/scripts/watch-pr/snapshot.ts +139 -0
- package/skills/poteto-mode/scripts/watch-pr/types.compile.ts +2 -1
- package/skills/poteto-mode/scripts/watch-pr/types.ts +27 -21
- package/skills/poteto-mode/scripts/watch-pr/verdict.ts +88 -0
- package/skills/pr-review-canvas/SKILL.md +1 -1
- package/skills/pr-review-canvas/renderer.js +169 -119
- package/skills/pr-review-canvas/template.html +1 -1
- package/skills/statechart/scripts/backends/cfg.ts +2 -6
- package/skills/statechart/scripts/backends/mermaid-escape.ts +91 -0
- package/skills/statechart/scripts/backends/mermaid.ts +190 -223
- package/skills/statechart/scripts/backends/report-notes.ts +137 -0
- package/skills/statechart/scripts/backends/report.ts +93 -146
- package/skills/statechart/scripts/frontends/config.ts +82 -260
- package/skills/statechart/scripts/frontends/configLex.ts +142 -0
- package/skills/statechart/scripts/frontends/configReader.ts +116 -0
- package/skills/statechart/scripts/frontends/configSections.ts +53 -0
- package/skills/statechart/scripts/frontends/dot.ts +44 -38
- package/skills/statechart/scripts/frontends/marks.ts +63 -52
- package/skills/statechart/scripts/frontends/messages.ts +69 -16
- package/skills/statechart/scripts/frontends/spec.ts +66 -49
- package/skills/statechart/scripts/frontends/trace.ts +33 -18
- package/skills/statechart/scripts/frontends/value.ts +180 -103
- package/skills/statechart/scripts/frontends/view.ts +81 -71
- package/skills/statechart/scripts/host-env.ts +8 -0
- package/skills/statechart/scripts/ir.ts +159 -226
- package/skills/statechart/scripts/passes/annotate.ts +106 -70
- package/skills/statechart/scripts/passes/label.ts +128 -150
- package/skills/statechart/scripts/passes/lift.ts +54 -67
- package/skills/statechart/scripts/passes/loop-check.ts +33 -40
- package/skills/statechart/scripts/passes/paths.ts +82 -45
- package/skills/statechart/scripts/passes/reach.ts +121 -106
- package/skills/statechart/scripts/passes/region-check.ts +71 -69
- package/skills/statechart/scripts/passes/regions.ts +355 -251
- package/skills/statechart/scripts/pipeline.ts +18 -13
- package/skills/statechart/scripts/run-io.ts +159 -0
- package/skills/statechart/scripts/run-judge.ts +131 -0
- package/skills/statechart/scripts/run-tlc.ts +133 -0
- package/skills/statechart/scripts/run.ts +209 -442
- package/skills/statechart/scripts/statechart.ts +150 -121
- package/skills/statechart/scripts/test/attempt.ts +11 -0
- package/skills/statechart/scripts/test/chart-labels.test.ts +262 -0
- package/skills/statechart/scripts/test/chart-loops.test.ts +109 -0
- package/skills/statechart/scripts/test/chart-marks.test.ts +136 -0
- package/skills/statechart/scripts/test/chart-paths.test.ts +166 -0
- package/skills/statechart/scripts/test/chart-support.ts +92 -0
- package/skills/statechart/scripts/test/chart-truth.test.ts +277 -0
- package/skills/statechart/scripts/test/chart-values.test.ts +98 -0
- package/skills/statechart/scripts/test/chart-view.test.ts +191 -0
- package/skills/statechart/scripts/test/check-child.ts +8 -0
- package/skills/statechart/scripts/test/cli-config.test.ts +142 -0
- package/skills/statechart/scripts/test/cli-corpus.test.ts +160 -0
- package/skills/statechart/scripts/test/cli-out.test.ts +108 -0
- package/skills/statechart/scripts/test/cli-process-support.ts +129 -0
- package/skills/statechart/scripts/test/cli-report.test.ts +223 -0
- package/skills/statechart/scripts/test/cli-signals.test.ts +198 -0
- package/skills/statechart/scripts/test/cli-support.ts +88 -0
- package/skills/statechart/scripts/test/cli-view-labels.test.ts +208 -0
- package/skills/statechart/scripts/test/cli-view.test.ts +177 -0
- package/skills/statechart/scripts/test/config-fuzz.test.ts +191 -116
- package/skills/statechart/scripts/test/corpus.test.ts +92 -95
- package/skills/statechart/scripts/test/differential.test.ts +202 -145
- package/skills/statechart/scripts/test/drawn.ts +37 -16
- package/skills/statechart/scripts/test/exit-status.ts +8 -0
- package/skills/statechart/scripts/test/host-env.ts +21 -0
- package/skills/statechart/scripts/test/java.ts +9 -6
- package/skills/statechart/scripts/test/labels-oracle.ts +357 -0
- package/skills/statechart/scripts/test/labels.ts +120 -349
- package/skills/statechart/scripts/test/messages.test.ts +148 -118
- package/skills/statechart/scripts/test/pipeline.test.ts +52 -45
- package/skills/statechart/scripts/test/plain-tlc.test.ts +40 -38
- package/skills/statechart/scripts/test/render.test.ts +94 -69
- package/skills/statechart/scripts/test/tail-text.test.ts +18 -0
- package/skills/statechart/scripts/test/tla-text.ts +2 -0
- package/skills/statechart/scripts/test/tlc-out.test.ts +62 -58
- package/skills/statechart/scripts/test/tlc.ts +90 -70
- package/skills/statechart/scripts/worker.ts +3 -1
- package/src/credentials.ts +49 -34
- package/src/git.ts +94 -0
- package/src/host-env.ts +6 -0
- package/src/index.ts +299 -532
- package/src/jobs.ts +109 -63
- package/src/object-schema.ts +8 -0
- package/src/paths.ts +16 -0
- package/src/requests.ts +182 -0
- package/src/sandbox.ts +137 -96
- package/src/subagent/README.md +180 -0
- package/src/subagent/agent-resolution.ts +31 -0
- package/{agents → src/subagent/agents}/ci-watcher.md +3 -1
- package/{agents → src/subagent/agents}/comment-sicko.md +2 -1
- package/src/subagent/agents/poteto-agent.md +10 -0
- package/src/subagent/agents/scout.md +49 -0
- package/src/subagent/agents/thermo-nuclear-code-quality-review.md +24 -0
- package/src/subagent/agents.ts +138 -0
- package/src/subagent/concurrency.ts +21 -0
- package/src/subagent/dispatch-chain.ts +39 -0
- package/src/subagent/dispatch-parallel.ts +51 -0
- package/src/subagent/dispatch.ts +59 -0
- package/src/subagent/format-tool-call.ts +60 -0
- package/src/subagent/format.ts +29 -0
- package/src/subagent/index.ts +52 -0
- package/src/subagent/pi-invocation.ts +43 -0
- package/src/subagent/render-call.ts +35 -0
- package/src/subagent/render-result.ts +109 -0
- package/src/subagent/render-shared.ts +87 -0
- package/src/subagent/result-stream.ts +105 -0
- package/src/subagent/results.ts +118 -0
- package/src/subagent/run-in-tmux.ts +165 -0
- package/src/subagent/run-single.ts +107 -0
- package/src/subagent/schema.ts +58 -0
- package/src/subagent/types.ts +62 -0
- package/src/sweep.ts +107 -67
- package/src/transcript.ts +61 -51
- package/agents/poteto-agent.md +0 -8
- package/agents/thermo-nuclear-code-quality-review.md +0 -23
- package/skills/statechart/scripts/test/chart.test.ts +0 -1253
- package/skills/statechart/scripts/test/cli.test.ts +0 -1315
package/src/index.ts
CHANGED
|
@@ -1,39 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { existsSync,
|
|
3
|
-
import {
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
|
|
6
|
-
import { type ExtensionAPI, type ExtensionContext, getAgentDir,
|
|
6
|
+
import { type ExtensionAPI, type ExtensionContext, getAgentDir, stripFrontmatter } from '@earendil-works/pi-coding-agent';
|
|
7
7
|
import { Type } from 'typebox';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { jobAgentDir, makeJobAgentDir, syncTokens } from './credentials.ts';
|
|
10
|
+
import { gitPath, projectPath, protectedPaths } from './git.ts';
|
|
11
|
+
import { hostEnv } from './host-env.ts';
|
|
12
|
+
import { claimWake, clip, excerpt, exitPath, type Job, type JobSpec, launch, list, newJobId, outputPath, read, request, stop, tail, tmuxSocket } from './jobs.ts';
|
|
13
|
+
import { within } from './paths.ts';
|
|
14
|
+
import { serveRequests, sweepFor } from './requests.ts';
|
|
10
15
|
import { JOB_DIR_ENV, SANDBOX_ENV, type SandboxPolicy, sandboxed, TOP_DIR_ENV } from './sandbox.ts';
|
|
11
|
-
import { codePaths, PI_CODE } from './sweep.ts';
|
|
12
16
|
import { workerReport } from './transcript.ts';
|
|
13
17
|
|
|
14
18
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
|
-
const AGENTS = ['poteto-agent', 'comment-sicko', 'ci-watcher', 'thermo-nuclear-code-quality-review'] as const;
|
|
16
|
-
const THINKING = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'] as const;
|
|
17
19
|
const POLL_MS = 2000;
|
|
20
|
+
const SECONDS_PER_MINUTE = 60;
|
|
21
|
+
const MS_PER_SECOND = 1000;
|
|
22
|
+
const STDERR_TAIL_LINES = 40;
|
|
23
|
+
const RAW_OUTPUT_TAIL_LINES = 60;
|
|
24
|
+
const DEFAULT_OUTPUT_LINES = 80;
|
|
25
|
+
const DEFAULT_WAIT_SECONDS = 300;
|
|
18
26
|
const REPORT_LIMIT = 20000;
|
|
19
27
|
// A report's first lines hold its verdict, so they are kept ahead of the end when a report is cut.
|
|
20
28
|
const REPORT_HEAD = 4000;
|
|
21
29
|
|
|
22
30
|
export const modelsFile = (agentDir: string): string => join(agentDir, 'pstack-v2-models.md');
|
|
23
|
-
const insideJob = (): boolean =>
|
|
24
|
-
// The root and the workers it starts may start workers, and a worker started by another worker may not.
|
|
25
|
-
const startedByWorker = (): boolean => insideJob() && process.env[JOB_DIR_ENV] !== process.env[TOP_DIR_ENV];
|
|
31
|
+
const insideJob = (): boolean => hostEnv()[SANDBOX_ENV] === '1';
|
|
26
32
|
const topJobsRoot = (): string => join(getAgentDir(), 'pstack-v2', 'jobs');
|
|
27
33
|
// A sandboxed worker can write only inside its own job directory's `nested/`, so the jobs it starts live there.
|
|
28
|
-
const jobsRoot = (env:
|
|
34
|
+
const jobsRoot = (env: Readonly<Record<string, string | undefined>> = hostEnv()): string => {
|
|
29
35
|
const parent = env[JOB_DIR_ENV];
|
|
30
36
|
return env[SANDBOX_ENV] === '1' && parent ? join(parent, 'nested') : topJobsRoot();
|
|
31
37
|
};
|
|
32
38
|
// A plain string enum, which every provider accepts, typed for TypeBox inference.
|
|
33
39
|
const stringEnum = <T extends readonly string[]>(values: T, description?: string) => Type.Unsafe<T[number]>({ type: 'string', enum: [...values], ...(description ? { description } : {}) });
|
|
40
|
+
const tmuxRunParameters = Type.Object({
|
|
41
|
+
name: Type.String({ description: 'Short label, such as "watch-pr-123" or "dev-server".' }),
|
|
42
|
+
command: Type.String({ description: 'Shell command, run with bash -c.' }),
|
|
43
|
+
cwd: Type.Optional(Type.String({ description: 'Working directory inside this project. Default this session cwd. The command may write only here, in its git directory, and in temp directories.' })),
|
|
44
|
+
wake: Type.Optional(Type.String({ description: 'Message to wake this session with when the command exits. Omit for a server you will stop yourself.' })),
|
|
45
|
+
repeat: Type.Optional(Type.Boolean({ description: 'Restart the command after each clean exit and wake each time. Requires wake. Stop it with tmux_jobs stop.' })),
|
|
46
|
+
});
|
|
47
|
+
const tmuxJobsParameters = Type.Object({
|
|
48
|
+
action: stringEnum(['list', 'output', 'wait', 'stop'] as const),
|
|
49
|
+
ids: Type.Optional(Type.Array(Type.String(), { description: 'Job ids. Required for output and stop.' })),
|
|
50
|
+
lines: Type.Optional(Type.Number({ description: 'Lines for raw output. Exited Pi workers show their completed answers instead. Default 80.' })),
|
|
51
|
+
timeout_seconds: Type.Optional(Type.Number({ description: 'Longest wait. Default 300.' })),
|
|
52
|
+
});
|
|
53
|
+
// Mirror the TypeBox parameters, which Pi checks before a tool runs, so these accept exactly the calls that reach it.
|
|
54
|
+
// Each tool validates with them and keeps Pi's own params object, so every key and its order reach the tool unchanged.
|
|
55
|
+
export const TmuxRunParamsSchema = z.looseObject({ name: z.string(), command: z.string(), cwd: z.string().optional(), wake: z.string().optional(), repeat: z.boolean().optional() });
|
|
56
|
+
export const TmuxJobsParamsSchema = z.looseObject({ action: z.enum(['list', 'output', 'wait', 'stop']), ids: z.array(z.string()).optional(), lines: z.number().optional(), timeout_seconds: z.number().optional() });
|
|
57
|
+
export { tmuxJobsParameters, tmuxRunParameters };
|
|
58
|
+
|
|
34
59
|
const text = (value: string) => ({ content: [{ type: 'text' as const, text: value }], details: undefined });
|
|
35
60
|
|
|
36
|
-
const agentRoles = AGENTS.map((name) => `${name}: ${parseFrontmatter<{ description?: string }>(readFileSync(join(packageRoot, 'agents', `${name}.md`), 'utf8')).frontmatter.description ?? ''}`);
|
|
37
61
|
const skillsHint = `pstack skills, including ones hidden from the skill list, live at ${join(packageRoot, 'skills')}/<name>/SKILL.md. When a skill says to run another skill, read that file and follow it.`;
|
|
38
62
|
// A mode keeps a skill in context every turn. Pi rebuilds the system prompt each turn, so the skill rides there.
|
|
39
63
|
const MODE = 'pstack-mode';
|
|
@@ -47,99 +71,9 @@ const SANDBOX_NOTE =
|
|
|
47
71
|
'You run in the pstack sandbox. The shared /tmp, macOS per-user temp directory, and user caches are read-only. Keep temp files in $TMPDIR, your own temp directory. Chromium uses the same private directory through MAC_CHROMIUM_TMPDIR. Tools that ignore both variables cannot write shared temp files. `ps` and `top` are refused, so read the load with `uptime`. In a checkout you cannot write, a bash here-document fails, so `cd "$TMPDIR"` first or write the file with printf. Unix sockets are refused, so ssh-agent, gpg-agent, and git over SSH with agent-held keys fail: use an HTTPS remote (`gh auth setup-git`) or leave the push to the session that started you. Code that runs outside the sandbox later stays read-only: `.git/hooks` and git config, `.pi` extensions and settings, and editor and harness configuration (`.vscode`, `.idea`, `*.code-workspace`, `.cursorignore`, and `.cursor` and `.claude` apart from their rules, commands, worktrees, skills, and agents). Any such file you create anyway moves to quarantine when your job ends.';
|
|
48
72
|
const flagValue = (command: string[], flag: string): string | undefined => (command.includes(flag) ? command[command.indexOf(flag) + 1] : undefined);
|
|
49
73
|
|
|
50
|
-
function git(cwd: string, args: string[]): string {
|
|
51
|
-
return execFileSync('git', ['-C', cwd, ...args], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }).trim();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function gitPath(cwd: string, flag: '--git-common-dir' | '--show-toplevel' | '--absolute-git-dir'): string | undefined {
|
|
55
|
-
try {
|
|
56
|
-
return resolve(cwd, git(cwd, ['rev-parse', flag]));
|
|
57
|
-
} catch {
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** A job may only work inside the session's project, so the model cannot widen its own sandbox by naming another directory. */
|
|
63
|
-
function projectPath(ctx: ExtensionContext, path: string | undefined): string {
|
|
64
|
-
const root = realpathSync(gitPath(ctx.cwd, '--show-toplevel') ?? ctx.cwd);
|
|
65
|
-
const target = realpathSync(path === undefined ? ctx.cwd : resolve(ctx.cwd, path));
|
|
66
|
-
// A linked worktree of the same repository, such as a worker's checkout, is the same project on another branch.
|
|
67
|
-
const common = gitPath(ctx.cwd, '--git-common-dir');
|
|
68
|
-
const targetCommon = gitPath(target, '--git-common-dir');
|
|
69
|
-
const sameRepository = common !== undefined && targetCommon !== undefined && landing(targetCommon) === landing(common);
|
|
70
|
-
const worktree = sameRepository ? gitPath(target, '--show-toplevel') : undefined;
|
|
71
|
-
if (!within(target, [root, ...(worktree ? [worktree] : [])])) throw new Error(`cwd must be inside this project (${root}), got ${target}. To work on another branch, pass worktree and the job gets its own checkout.`);
|
|
72
|
-
// A checkout of another repository can sit inside the project, and a job there would be handed that repository's git directory.
|
|
73
|
-
if (targetCommon !== undefined && !sameRepository && !within(targetCommon, [root])) throw new Error(`cwd ${target} is a checkout of another repository (${targetCommon}). A job works only in this session's repository.`);
|
|
74
|
-
return target;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Paths an unsandboxed process later executes from: git hooks and config, Pi's project extensions and settings, and
|
|
79
|
-
* editor and agent-harness configuration. Git finds hooks through `.git`, and in a linked worktree through its `commondir`
|
|
80
|
-
* and `gitdir` files, so each of those is protected too. A job that could repoint any of them would make the next
|
|
81
|
-
* `git commit` run its own hooks unsandboxed.
|
|
82
|
-
*/
|
|
83
|
-
function protectedPaths(cwd: string, common: string | undefined): { protect: string[]; lock: string[]; gitDirs: string[] } {
|
|
84
|
-
// Every code entry already in the checkout, at any depth, since Pi, git, editors, and harnesses find them anywhere.
|
|
85
|
-
const found = codePaths([cwd]);
|
|
86
|
-
const piDirs = [...new Set([join(cwd, '.pi'), ...found.filter((path) => basename(dirname(path)) === '.pi').map(dirname)])];
|
|
87
|
-
const pi = piDirs.flatMap((dir) => PI_CODE.map((name) => join(dir, name)));
|
|
88
|
-
// The checkout's own .git is its git directory, which the job may write. Any other is a repository git would run hooks
|
|
89
|
-
// from, and an editor or harness entry runs as it stands. `pi` already covers each .pi directory, and a .pi link stays as it is.
|
|
90
|
-
const others = found.filter((path) => basename(path) !== '.pi' && basename(dirname(path)) !== '.pi' && path !== join(cwd, '.git'));
|
|
91
|
-
let protect = [...pi, ...others];
|
|
92
|
-
let lock: string[] = [];
|
|
93
|
-
if (common) {
|
|
94
|
-
const own = gitPath(cwd, '--absolute-git-dir') ?? common;
|
|
95
|
-
const worktree = own === common ? [] : [join(cwd, '.git'), ...['commondir', 'gitdir', 'config.worktree'].map((name) => join(own, name))];
|
|
96
|
-
let hooksPath: string[] = [];
|
|
97
|
-
try {
|
|
98
|
-
const configured = git(cwd, ['config', '--get', 'core.hooksPath']);
|
|
99
|
-
if (configured) hooksPath = [resolve(gitPath(cwd, '--show-toplevel') ?? cwd, configured)];
|
|
100
|
-
} catch {
|
|
101
|
-
// No custom hooks path.
|
|
102
|
-
}
|
|
103
|
-
protect = [...protect, join(common, 'hooks'), join(common, 'config'), join(common, 'config.worktree'), join(common, 'info'), ...worktree, ...hooksPath];
|
|
104
|
-
lock = [join(cwd, '.git'), own, common];
|
|
105
|
-
}
|
|
106
|
-
// A directory above a protected path could be renamed away and replaced, so each existing one up to the checkout is locked.
|
|
107
|
-
const ancestors = protect.flatMap((path) => {
|
|
108
|
-
const chain: string[] = [];
|
|
109
|
-
for (let dir = dirname(path); within(dir, [cwd]) && dir !== cwd; dir = dirname(dir)) if (existsSync(dir)) chain.push(dir);
|
|
110
|
-
return chain;
|
|
111
|
-
});
|
|
112
|
-
return { protect, lock: [...new Set([...lock, ...ancestors])], gitDirs: common ? [common] : [] };
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/** Adds the worktree and returns whether it created the branch, so a failed start can remove it. */
|
|
116
|
-
function addWorktree(cwd: string, path: string, branch: string, base: string | undefined): boolean {
|
|
117
|
-
if (branch.startsWith('-') || base?.startsWith('-')) throw new Error('worktree and base cannot start with "-".');
|
|
118
|
-
let exists = true;
|
|
119
|
-
try {
|
|
120
|
-
git(cwd, ['rev-parse', '--verify', '--quiet', `refs/heads/${branch}`]);
|
|
121
|
-
} catch {
|
|
122
|
-
exists = false;
|
|
123
|
-
}
|
|
124
|
-
git(cwd, exists ? ['worktree', 'add', path, branch] : ['worktree', 'add', '-b', branch, path, base === undefined ? 'HEAD' : baseOrSoleRemoteBranch(cwd, base)]);
|
|
125
|
-
return !exists;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function baseOrSoleRemoteBranch(cwd: string, base: string): string {
|
|
129
|
-
try {
|
|
130
|
-
git(cwd, ['rev-parse', '--verify', '--quiet', `${base}^{commit}`]);
|
|
131
|
-
return base;
|
|
132
|
-
} catch {
|
|
133
|
-
const remote = git(cwd, ['for-each-ref', '--format=%(refname:short)', `refs/remotes/*/${base}`])
|
|
134
|
-
.split('\n')
|
|
135
|
-
.filter(Boolean);
|
|
136
|
-
return remote.length === 1 ? (remote[0] ?? base) : base;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
74
|
const duration = (ms: number): string => {
|
|
141
|
-
const seconds = Math.max(0, Math.round(ms /
|
|
142
|
-
return seconds <
|
|
75
|
+
const seconds = Math.max(0, Math.round(ms / MS_PER_SECOND));
|
|
76
|
+
return seconds < SECONDS_PER_MINUTE ? `${seconds}s` : `${Math.floor(seconds / SECONDS_PER_MINUTE)}m ${seconds % SECONDS_PER_MINUTE}s`;
|
|
143
77
|
};
|
|
144
78
|
|
|
145
79
|
function report(job: Job): string {
|
|
@@ -155,10 +89,10 @@ function report(job: Job): string {
|
|
|
155
89
|
? clip(answers.join('\n\n[Later completed answer]\n\n'), REPORT_HEAD, REPORT_LIMIT - REPORT_HEAD, transcript.path)
|
|
156
90
|
: job.spec.kind === 'pi'
|
|
157
91
|
? excerpt(output, REPORT_HEAD, REPORT_LIMIT - REPORT_HEAD)
|
|
158
|
-
: tail(output,
|
|
92
|
+
: tail(output, RAW_OUTPUT_TAIL_LINES);
|
|
159
93
|
// A worker that fails at startup, such as on a bad model or credential, says why only on stderr.
|
|
160
94
|
const failed = job.status.state !== 'exited' || job.status.code !== 0 || !body.trim();
|
|
161
|
-
const errors = failed ? tail(join(job.spec.out, 'stderr.log'),
|
|
95
|
+
const errors = failed ? tail(join(job.spec.out, 'stderr.log'), STDERR_TAIL_LINES).trim() : '';
|
|
162
96
|
return [
|
|
163
97
|
`tmux job ${job.spec.name} (${job.spec.id}) ${state}. Raw output: ${output}`,
|
|
164
98
|
transcript ? `Transcript: ${transcript.path}` : '',
|
|
@@ -177,28 +111,6 @@ function describe(job: Job): string {
|
|
|
177
111
|
return `${job.spec.id} ${job.spec.kind} ${state} ${job.spec.name}\n follow: tail -f ${outputPath(job.spec.out)}${attach}`;
|
|
178
112
|
}
|
|
179
113
|
|
|
180
|
-
function resolveModel(ctx: ExtensionContext, model: string | undefined): string | undefined {
|
|
181
|
-
if (model === undefined) return ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : undefined;
|
|
182
|
-
// Pi also knows models it holds no credentials for, and a worker on one fails only after it starts. Only a usable model passes.
|
|
183
|
-
const valid = ctx.modelRegistry.getAvailable().map((known) => `${known.provider}/${known.id}`);
|
|
184
|
-
if (!valid.includes(model)) throw new Error(`Unavailable model "${model}". Pass provider/id exactly as \`pi --list-models\` prints it, or omit model to use the parent's model. Valid models: ${valid.join(', ') || 'none'}.`);
|
|
185
|
-
return model;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/** Resolves symlinks in the longest existing prefix, so a path that does not exist yet still compares by where it would land. */
|
|
189
|
-
function landing(path: string): string {
|
|
190
|
-
const absolute = resolve(path);
|
|
191
|
-
if (existsSync(absolute)) return realpathSync(absolute);
|
|
192
|
-
const parent = dirname(absolute);
|
|
193
|
-
return parent === absolute ? absolute : join(landing(parent), relative(parent, absolute));
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const within = (path: string, roots: string[]): boolean =>
|
|
197
|
-
roots.some((root) => {
|
|
198
|
-
const inside = relative(landing(root), landing(path));
|
|
199
|
-
return inside !== '..' && !inside.startsWith(`..${sep}`) && !isAbsolute(inside);
|
|
200
|
-
});
|
|
201
|
-
|
|
202
114
|
// A sandboxed worker asks the root Pi to launch for it on every platform, so nested jobs get the same sandbox everywhere
|
|
203
115
|
// and no job needs a tmux server of its own. macOS could not apply a second Seatbelt profile anyway.
|
|
204
116
|
const brokering = (): boolean => insideJob();
|
|
@@ -207,204 +119,215 @@ const brokering = (): boolean => insideJob();
|
|
|
207
119
|
function start(root: string, spec: JobSpec, files: Record<string, string> = {}, resolved: Record<string, string> = {}): Job {
|
|
208
120
|
const jobDir = join(root, spec.id);
|
|
209
121
|
// A job started from inside another uses its top-level job's agent directory, which that start already created.
|
|
210
|
-
const top = insideJob() ? (
|
|
122
|
+
const top = insideJob() ? (hostEnv()[TOP_DIR_ENV] ?? jobDir) : jobDir;
|
|
211
123
|
if (!insideJob()) makeJobAgentDir(getAgentDir(), jobAgentDir(jobDir), resolved);
|
|
212
124
|
// Every job gets a private temp directory, since the shared ones hold code unsandboxed programs load, and writes
|
|
213
125
|
// credentials only to its top-level job's copy.
|
|
214
126
|
// A command a worker starts shares the worker's temp directory, so a path the worker hands it under $TMPDIR exists for both.
|
|
215
|
-
const parent =
|
|
127
|
+
const parent = hostEnv()[JOB_DIR_ENV];
|
|
216
128
|
const tmp = insideJob() && parent && spec.kind === 'command' ? join(parent, 'tmp') : undefined;
|
|
217
|
-
const
|
|
129
|
+
const sized: SandboxPolicy = { ...spec.policy, jobDir, credentials: jobAgentDir(top), writable: [...new Set([...spec.policy.writable, join(jobDir, 'tmp'), ...(tmp ? [tmp] : [])])] };
|
|
218
130
|
// A writable path that holds Pi's agent directory would let the job rewrite Pi's own code and settings.
|
|
219
|
-
const holder =
|
|
220
|
-
if (holder) throw new Error(`pstack will not let a job write ${holder}, because it contains Pi's agent directory ${
|
|
221
|
-
spec = { ...spec, sweep: sweepFor(
|
|
222
|
-
policy
|
|
131
|
+
const holder = sized.writable.find((path) => within(sized.agentDir, [path]));
|
|
132
|
+
if (holder) throw new Error(`pstack will not let a job write ${holder}, because it contains Pi's agent directory ${sized.agentDir}. Run Pi from a project directory.`);
|
|
133
|
+
spec = { ...spec, sweep: sweepFor(sized), ...(tmp ? { tmp } : {}) };
|
|
134
|
+
const policy: SandboxPolicy = { ...sized, checkouts: spec.sweep.roots };
|
|
223
135
|
// bubblewrap binds only paths that exist, so the private temp directory exists before the sandbox is built.
|
|
224
136
|
mkdirSync(join(jobDir, 'tmp'), { recursive: true });
|
|
225
137
|
if (brokering()) return request(root, { ...spec, policy }, files);
|
|
226
138
|
return launch(root, { ...spec, policy, argv: sandboxed(spec.command, policy) }, files);
|
|
227
139
|
}
|
|
228
140
|
|
|
229
|
-
|
|
230
|
-
const sweepFor = (policy: SandboxPolicy): JobSpec['sweep'] => ({
|
|
231
|
-
// A job's own session, nested, temp, and agent directories live under Pi's agent directory. A worktree does too, and is a checkout.
|
|
232
|
-
roots: policy.writable.filter((path) => (basename(path) === 'worktree' || !within(path, [policy.agentDir])) && !within(path, policy.gitDirs)),
|
|
233
|
-
protect: policy.protect.filter((path) => within(path, policy.writable)),
|
|
234
|
-
});
|
|
141
|
+
type Waiter = { signal: AbortSignal | undefined; update: ((partial: ReturnType<typeof text>) => void) | undefined; ctx: ExtensionContext };
|
|
235
142
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
143
|
+
/** Polls until no job runs, the deadline passes, or the user sends a message, so they are never shut out until the timeout. */
|
|
144
|
+
async function blockWhileRunning(current: () => Job[], deadline: number, { signal, update, ctx }: Waiter): Promise<void> {
|
|
145
|
+
const running = (): number => current().filter((job) => job.status.state === 'running').length;
|
|
146
|
+
while (running() > 0 && Date.now() < deadline && !signal?.aborted && !ctx.hasPendingMessages()) {
|
|
147
|
+
update?.(text(`Waiting on ${running()} job(s)...`));
|
|
148
|
+
await new Promise((done) => setTimeout(done, POLL_MS));
|
|
242
149
|
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const outputOf = (job: Job, lines: number): string => (job.spec.kind === 'pi' && job.status.state !== 'running' ? report(job) : `${describe(job)}\n${tail(outputPath(job.spec.out), lines)}`);
|
|
153
|
+
|
|
154
|
+
/** A heartbeat or a server never stops on its own, so waiting on everything leaves them out. */
|
|
155
|
+
const waitableIds = (root: string, owner: string): string[] =>
|
|
156
|
+
list(root, owner)
|
|
157
|
+
.filter((job) => job.status.state === 'running' && !job.spec.repeat && job.spec.wake !== null)
|
|
158
|
+
.map((job) => job.spec.id);
|
|
159
|
+
|
|
160
|
+
/** The jobs a tmux_jobs action named, each of which must belong to this session. */
|
|
161
|
+
function namedJobs(root: string, owner: string, action: string, ids: string[] | undefined): Job[] {
|
|
162
|
+
if (!ids?.length) throw new Error(`${action} needs ids.`);
|
|
163
|
+
return ids.map((id) => {
|
|
164
|
+
const job = read(root, id, owner);
|
|
165
|
+
if (!job) throw new Error(`No job ${id} in this session.`);
|
|
166
|
+
return job;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Mutable session state, held as rebound closure variables so each extension instance keeps its own. */
|
|
171
|
+
type PstackState = {
|
|
172
|
+
stoppedSeries: () => ReadonlySet<string>;
|
|
173
|
+
stopSeries: (ids: Iterable<string>) => void;
|
|
174
|
+
awaited: () => ReadonlySet<string>;
|
|
175
|
+
await: (ids: readonly string[]) => void;
|
|
176
|
+
release: (ids: readonly string[]) => void;
|
|
177
|
+
settling: () => boolean;
|
|
178
|
+
setSettling: (value: boolean) => void;
|
|
179
|
+
mode: () => string | undefined;
|
|
180
|
+
setMode: (value: string | undefined) => void;
|
|
181
|
+
watcher: () => ReturnType<typeof setInterval> | undefined;
|
|
182
|
+
setWatcher: (value: ReturnType<typeof setInterval> | undefined) => void;
|
|
243
183
|
};
|
|
244
184
|
|
|
245
|
-
|
|
185
|
+
function createState(): PstackState {
|
|
186
|
+
// Jobs a tmux_jobs wait call is blocking on. Their report goes back as that call's result, not as a wake.
|
|
187
|
+
let awaited: ReadonlySet<string> = new Set();
|
|
188
|
+
let stoppedSeries: ReadonlySet<string> = new Set();
|
|
189
|
+
// While a print-mode run settles, agent_before_settle delivers the reports itself.
|
|
190
|
+
let settling = false;
|
|
191
|
+
let mode: string | undefined;
|
|
192
|
+
let watcher: ReturnType<typeof setInterval> | undefined;
|
|
193
|
+
return {
|
|
194
|
+
stoppedSeries: () => stoppedSeries,
|
|
195
|
+
stopSeries: (ids) => {
|
|
196
|
+
stoppedSeries = new Set([...stoppedSeries, ...ids]);
|
|
197
|
+
},
|
|
198
|
+
awaited: () => awaited,
|
|
199
|
+
await: (ids) => {
|
|
200
|
+
awaited = new Set([...awaited, ...ids]);
|
|
201
|
+
},
|
|
202
|
+
release: (ids) => {
|
|
203
|
+
awaited = new Set([...awaited].filter((id) => !ids.includes(id)));
|
|
204
|
+
},
|
|
205
|
+
settling: () => settling,
|
|
206
|
+
setSettling: (value) => {
|
|
207
|
+
settling = value;
|
|
208
|
+
},
|
|
209
|
+
mode: () => mode,
|
|
210
|
+
setMode: (value) => {
|
|
211
|
+
mode = value;
|
|
212
|
+
},
|
|
213
|
+
watcher: () => watcher,
|
|
214
|
+
setWatcher: (value) => {
|
|
215
|
+
watcher = value;
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
}
|
|
246
219
|
|
|
247
|
-
|
|
220
|
+
// Reports a finished job whose wake was just claimed, restarting it first when it is a heartbeat that exited cleanly.
|
|
221
|
+
const finish = (state: PstackState, job: Job): string => {
|
|
222
|
+
if (!job.spec.repeat) return report(job);
|
|
223
|
+
// A heartbeat repeats only while it exits cleanly, so a failing command cannot wake the session in a tight loop.
|
|
224
|
+
if (job.status.state !== 'exited' || job.status.code !== 0) return `${report(job)}\n\nThis heartbeat did not exit cleanly, so it was not restarted.`;
|
|
248
225
|
try {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
226
|
+
if (state.stoppedSeries().has(job.spec.series)) return report(job);
|
|
227
|
+
// The next run gets its own temp directory in place of this one's.
|
|
228
|
+
const policy = { ...job.spec.policy, writable: job.spec.policy.writable.filter((path) => path !== join(job.dir, 'tmp')) };
|
|
229
|
+
start(jobsRoot(), { ...job.spec, policy, id: newJobId(job.spec.name), brokered: false, createdAt: new Date().toISOString() });
|
|
230
|
+
return report(job);
|
|
231
|
+
} catch (error) {
|
|
232
|
+
return `${report(job)}\n\nThis heartbeat could not be restarted: ${error instanceof Error ? error.message : String(error)}`;
|
|
252
233
|
}
|
|
253
234
|
};
|
|
254
235
|
|
|
255
|
-
|
|
256
|
-
try {
|
|
257
|
-
execFileSync('tmux', ['-S', socket, 'has-session', '-t', `=${session}`], { stdio: 'ignore' });
|
|
258
|
-
return true;
|
|
259
|
-
} catch {
|
|
260
|
-
return false;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
236
|
+
const interactive = (ctx: ExtensionContext): boolean => ctx.mode === 'tui' || ctx.mode === 'rpc';
|
|
263
237
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
export function serveRequests(top: Job, socket: string, nested: string, requesterDone: boolean, depth = 0, grant: string[] = top.spec.policy.writable): void {
|
|
270
|
-
// A worker could link its nested directory back up its own tree, so only real directories are followed, and not far.
|
|
271
|
-
if (depth > 8 || !existsSync(nested) || !lstatSync(nested).isDirectory()) return;
|
|
272
|
-
for (const name of readdirSync(nested)) {
|
|
273
|
-
try {
|
|
274
|
-
const dir = join(nested, name);
|
|
275
|
-
// A worker could link an entry back up its own tree, so only real directories are followed.
|
|
276
|
-
if (!lstatSync(dir).isDirectory()) continue;
|
|
277
|
-
const spec = readSpec(dir);
|
|
278
|
-
const policy = spec?.policy;
|
|
279
|
-
// A worker writes these files, so anything malformed is skipped instead of stopping every other request.
|
|
280
|
-
if (!spec || !policy || (spec.kind !== 'pi' && spec.kind !== 'command') || typeof spec.cwd !== 'string' || !isStrings(spec.command) || spec.command.length === 0) continue;
|
|
281
|
-
if (!isStrings(policy.writable) || !isStrings(policy.protect) || !isStrings(policy.lock) || !isStrings(policy.gitDirs)) continue;
|
|
282
|
-
const out = resultsDir(top.dir, dir);
|
|
283
|
-
const stopped = existsSync(join(dir, 'stop'));
|
|
284
|
-
const done = existsSync(exitPath(out)) || stopped;
|
|
285
|
-
// A request's own requests may write only what the root granted it, recorded where no worker can write.
|
|
286
|
-
const own = readGrant(out);
|
|
287
|
-
serveRequests(top, socket, join(dir, 'nested'), requesterDone || done, depth + 1, own);
|
|
288
|
-
if (!spec.brokered || existsSync(exitPath(out))) continue;
|
|
289
|
-
const session = brokeredSession(dir);
|
|
290
|
-
if (existsSync(join(out, 'launched'))) {
|
|
291
|
-
if (requesterDone || stopped) tmuxKill(socket, session);
|
|
292
|
-
else if (!hasSession(socket, session)) settleBrokered(out, 137, 'pstack lost this job: its tmux session ended without an exit code.');
|
|
293
|
-
continue;
|
|
294
|
-
}
|
|
295
|
-
if (requesterDone || stopped) continue;
|
|
296
|
-
if (spec.kind === 'pi' && depth > 0) {
|
|
297
|
-
settleBrokered(out, 126, 'pstack refused to start this Pi worker. A worker started by another worker cannot start workers of its own.');
|
|
298
|
-
continue;
|
|
299
|
-
}
|
|
300
|
-
const writable = policy.writable.map(landing);
|
|
301
|
-
const refused = [...writable.filter((path) => !within(path, grant)), ...(within(spec.cwd, [top.spec.cwd, ...grant]) ? [] : [`cwd ${spec.cwd}`])];
|
|
302
|
-
if (refused.length) {
|
|
303
|
-
settleBrokered(out, 126, `pstack refused to launch this job. It asked to write outside what the job that requested it may write: ${refused.join(', ')}`);
|
|
304
|
-
continue;
|
|
305
|
-
}
|
|
306
|
-
// The sandbox is built from the paths just validated, so swapping a link afterwards changes nothing.
|
|
307
|
-
const granted: SandboxPolicy = {
|
|
308
|
-
writable,
|
|
309
|
-
protect: [...policy.protect, ...top.spec.policy.protect],
|
|
310
|
-
lock: [...policy.lock, ...top.spec.policy.lock],
|
|
311
|
-
gitDirs: [...policy.gitDirs, ...top.spec.policy.gitDirs],
|
|
312
|
-
checkouts: [],
|
|
313
|
-
credentials: jobAgentDir(top.dir),
|
|
314
|
-
agentDir: getAgentDir(),
|
|
315
|
-
jobDir: dir,
|
|
316
|
-
};
|
|
317
|
-
granted.checkouts = sweepFor(granted).roots;
|
|
318
|
-
mkdirSync(out, { recursive: true });
|
|
319
|
-
writeFileSync(join(out, 'granted.json'), JSON.stringify(writable));
|
|
320
|
-
// The worker supplies tmp, so it is trusted only if it is one of the writable paths validated above.
|
|
321
|
-
const { tmp: asked, ...rest } = spec;
|
|
322
|
-
const tmp = typeof asked === 'string' && writable.includes(landing(asked)) ? landing(asked) : undefined;
|
|
323
|
-
launchBrokered(top.dir, dir, { ...rest, ...(tmp ? { tmp } : {}) }, sweepFor(granted), sandboxed(spec.command, granted), socket);
|
|
324
|
-
} catch {
|
|
325
|
-
// One request failing must not stop the others.
|
|
326
|
-
}
|
|
238
|
+
const deliverFinished = (pi: ExtensionAPI, state: PstackState, ctx: ExtensionContext): void => {
|
|
239
|
+
const jobs = list(jobsRoot(), ctx.sessionManager.getSessionId());
|
|
240
|
+
for (const job of jobs) {
|
|
241
|
+
if (job.spec.wake === null || job.status.state === 'running' || state.awaited().has(job.spec.id) || !claimWake(job)) continue;
|
|
242
|
+
pi.sendMessage({ customType: 'pstack-job', content: finish(state, job), display: true }, { triggerTurn: true, deliverAs: 'steer' });
|
|
327
243
|
}
|
|
328
|
-
|
|
244
|
+
if (ctx.hasUI) {
|
|
245
|
+
const running = jobs.filter((job) => job.status.state === 'running').length;
|
|
246
|
+
ctx.ui.setStatus('pstack', running ? `tmux jobs: ${running} running` : undefined);
|
|
247
|
+
}
|
|
248
|
+
};
|
|
329
249
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
250
|
+
const serve = (ctx: ExtensionContext): void => {
|
|
251
|
+
if (brokering()) return;
|
|
252
|
+
const owner = ctx.sessionManager.getSessionId();
|
|
253
|
+
for (const top of list(jobsRoot(), owner)) if (top.spec.kind === 'pi') serveRequests(top, tmuxSocket(owner), join(top.dir, 'nested'), top.status.state !== 'running');
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
// Carries refreshed OAuth tokens between your credentials and each top-level job's copy, once more after the job ends.
|
|
257
|
+
const syncCredentials = (ctx: ExtensionContext): void => {
|
|
258
|
+
if (insideJob()) return;
|
|
259
|
+
for (const job of list(jobsRoot(), ctx.sessionManager.getSessionId())) {
|
|
260
|
+
const copy = jobAgentDir(job.dir);
|
|
261
|
+
if (!existsSync(join(copy, 'auth.json')) || existsSync(join(job.dir, 'tokens-synced'))) continue;
|
|
262
|
+
if (syncTokens(getAgentDir(), copy) && job.status.state !== 'running') writeFileSync(join(job.dir, 'tokens-synced'), '');
|
|
263
|
+
}
|
|
264
|
+
};
|
|
337
265
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
if (job.status.state !== 'exited' || job.status.code !== 0) return `${report(job)}\n\nThis heartbeat did not exit cleanly, so it was not restarted.`;
|
|
266
|
+
// Each step runs on its own, so one failing does not stop the others.
|
|
267
|
+
const tick = (pi: ExtensionAPI, state: PstackState, ctx: ExtensionContext): void => {
|
|
268
|
+
const deliverable = interactive(ctx) || (!state.settling() && !ctx.isIdle());
|
|
269
|
+
for (const step of [() => syncCredentials(ctx), () => serve(ctx), () => deliverable && deliverFinished(pi, state, ctx)]) {
|
|
343
270
|
try {
|
|
344
|
-
|
|
345
|
-
// The next run gets its own temp directory in place of this one's.
|
|
346
|
-
const policy = { ...job.spec.policy, writable: job.spec.policy.writable.filter((path) => path !== join(job.dir, 'tmp')) };
|
|
347
|
-
start(jobsRoot(), { ...job.spec, policy, id: newJobId(job.spec.name), brokered: false, createdAt: new Date().toISOString() });
|
|
348
|
-
return report(job);
|
|
271
|
+
step();
|
|
349
272
|
} catch (error) {
|
|
350
|
-
|
|
273
|
+
if (ctx.hasUI) ctx.ui.notify(`pstack job watcher: ${error instanceof Error ? error.message : String(error)}`, 'error');
|
|
351
274
|
}
|
|
352
|
-
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
353
277
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
};
|
|
278
|
+
/** Ends the session's tmux server; false when it started no jobs and so had none. */
|
|
279
|
+
function killTmuxServer(socket: string): boolean {
|
|
280
|
+
return spawnSync('tmux', ['-S', socket, 'kill-server'], { stdio: 'ignore' }).status === 0;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function registerWatcher(pi: ExtensionAPI, state: PstackState): void {
|
|
284
|
+
pi.on('session_start', async (_event, ctx) => {
|
|
285
|
+
restoreMode(state, ctx);
|
|
286
|
+
clearInterval(state.watcher());
|
|
287
|
+
state.setWatcher(setInterval(() => tick(pi, state, ctx), POLL_MS));
|
|
288
|
+
});
|
|
365
289
|
|
|
366
|
-
|
|
367
|
-
|
|
290
|
+
pi.on('session_shutdown', async (_event, ctx) => {
|
|
291
|
+
clearInterval(state.watcher());
|
|
292
|
+
state.setWatcher(undefined);
|
|
293
|
+
// A print-mode worker's leftover jobs, such as a dev server it never stopped, end with it.
|
|
294
|
+
if (interactive(ctx)) return;
|
|
295
|
+
killTmuxServer(tmuxSocket(ctx.sessionManager.getSessionId()));
|
|
296
|
+
});
|
|
368
297
|
|
|
369
|
-
|
|
370
|
-
|
|
298
|
+
// A print-mode run would exit while its jobs still run, so it waits for them and continues with their reports.
|
|
299
|
+
pi.on('agent_before_settle', async (event, ctx) => {
|
|
300
|
+
if (interactive(ctx)) return;
|
|
371
301
|
const owner = ctx.sessionManager.getSessionId();
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
302
|
+
const pending = () => list(jobsRoot(), owner).filter((job) => job.spec.wake !== null && !job.spec.repeat && !existsSync(join(job.dir, 'woken')));
|
|
303
|
+
if (pending().length === 0) return;
|
|
304
|
+
state.setSettling(true);
|
|
305
|
+
try {
|
|
306
|
+
while (pending().some((job) => job.status.state === 'running')) await new Promise((done) => setTimeout(done, POLL_MS));
|
|
307
|
+
syncCredentials(ctx);
|
|
308
|
+
const finished = pending().filter(claimWake);
|
|
309
|
+
return {
|
|
310
|
+
entries: [...event.entries, ...finished.map((job) => ({ type: 'custom_message' as const, customType: 'pstack-job', content: finish(state, job), display: true }))],
|
|
311
|
+
continue: true,
|
|
312
|
+
};
|
|
313
|
+
} finally {
|
|
314
|
+
state.setSettling(false);
|
|
382
315
|
}
|
|
383
|
-
};
|
|
316
|
+
});
|
|
317
|
+
}
|
|
384
318
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
try {
|
|
389
|
-
step();
|
|
390
|
-
} catch (error) {
|
|
391
|
-
if (ctx.hasUI) ctx.ui.notify(`pstack job watcher: ${error instanceof Error ? error.message : String(error)}`, 'error');
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
};
|
|
319
|
+
const showMode = (state: PstackState, ctx: ExtensionContext): void => {
|
|
320
|
+
if (ctx.hasUI) ctx.ui.setStatus(MODE, state.mode() ? `mode: ${state.mode()}` : undefined);
|
|
321
|
+
};
|
|
395
322
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
mode = undefined;
|
|
403
|
-
for (const entry of ctx.sessionManager.getBranch()) if (entry.type === 'custom' && entry.customType === MODE) mode = (entry.data as { skill?: string } | undefined)?.skill;
|
|
404
|
-
if (mode && !skillNames.includes(mode)) mode = undefined;
|
|
405
|
-
showMode(ctx);
|
|
406
|
-
};
|
|
323
|
+
// The mode lives on the session branch, so a resumed session or a /tree jump gets the mode that branch had.
|
|
324
|
+
const restoreMode = (state: PstackState, ctx: ExtensionContext): void => {
|
|
325
|
+
const recorded = ctx.sessionManager.getBranch().reduce<string | undefined>((current, entry) => (entry.type === 'custom' && entry.customType === MODE ? (entry.data as { skill?: string } | undefined)?.skill : current), undefined);
|
|
326
|
+
state.setMode(recorded && skillNames.includes(recorded) ? recorded : undefined);
|
|
327
|
+
showMode(state, ctx);
|
|
328
|
+
};
|
|
407
329
|
|
|
330
|
+
function registerModeCommand(pi: ExtensionAPI, state: PstackState): void {
|
|
408
331
|
pi.registerCommand(MODE, {
|
|
409
332
|
description: 'Keep a pstack skill in context every turn. /pstack-mode off ends it.',
|
|
410
333
|
getArgumentCompletions: (prefix: string) => {
|
|
@@ -412,8 +335,9 @@ export default function pstack(pi: ExtensionAPI) {
|
|
|
412
335
|
return items.length ? items : null;
|
|
413
336
|
},
|
|
414
337
|
handler: async (args, ctx) => {
|
|
415
|
-
const name = args.trim();
|
|
338
|
+
const name = z.string().parse(args).trim();
|
|
416
339
|
if (!name) {
|
|
340
|
+
const mode = state.mode();
|
|
417
341
|
if (ctx.hasUI) ctx.ui.notify(mode ? `${mode} mode is on. /pstack-mode off ends it.` : 'No pstack mode is on. /pstack-mode <skill> starts one.', 'info');
|
|
418
342
|
return;
|
|
419
343
|
}
|
|
@@ -421,176 +345,40 @@ export default function pstack(pi: ExtensionAPI) {
|
|
|
421
345
|
if (ctx.hasUI) ctx.ui.notify(`${name} is not a pstack skill. Pick one from /pstack-mode's completions.`, 'error');
|
|
422
346
|
return;
|
|
423
347
|
}
|
|
424
|
-
|
|
425
|
-
pi.appendEntry(MODE, { skill: mode });
|
|
426
|
-
showMode(ctx);
|
|
348
|
+
state.setMode(name === 'off' ? undefined : name);
|
|
349
|
+
pi.appendEntry(MODE, { skill: state.mode() });
|
|
350
|
+
showMode(state, ctx);
|
|
427
351
|
},
|
|
428
352
|
});
|
|
353
|
+
pi.on('session_tree', async (_event, ctx) => restoreMode(state, ctx));
|
|
354
|
+
}
|
|
429
355
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
// A print-mode worker's leftover jobs, such as a dev server it never stopped, end with it.
|
|
442
|
-
if (interactive(ctx)) return;
|
|
443
|
-
try {
|
|
444
|
-
execFileSync('tmux', ['-S', tmuxSocket(ctx.sessionManager.getSessionId()), 'kill-server'], { stdio: 'ignore' });
|
|
445
|
-
} catch {
|
|
446
|
-
// It started no jobs.
|
|
447
|
-
}
|
|
448
|
-
});
|
|
356
|
+
function promptSections(transcript: string | undefined, mode: string | undefined): Record<string, string> {
|
|
357
|
+
const models = modelsFile(getAgentDir());
|
|
358
|
+
return {
|
|
359
|
+
...(transcript && {
|
|
360
|
+
'pstack-session': `This session's transcript is ${transcript}. A worker's Pi agent directory is its job's own, so it cannot find this file by itself. Put the path in any brief that asks a worker to read the transcript.`,
|
|
361
|
+
}),
|
|
362
|
+
...(insideJob() && { 'pstack-sandbox': SANDBOX_NOTE }),
|
|
363
|
+
...(mode && { [MODE]: modeSection(mode) }),
|
|
364
|
+
...(existsSync(models) && { 'pstack-models': `Role lines from ${models}, written by /skill:setup-pstack:\n${readFileSync(models, 'utf8').trim()}` }),
|
|
365
|
+
};
|
|
366
|
+
}
|
|
449
367
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
settling = true;
|
|
457
|
-
try {
|
|
458
|
-
while (pending().some((job) => job.status.state === 'running')) await new Promise((done) => setTimeout(done, POLL_MS));
|
|
459
|
-
syncCredentials(ctx);
|
|
460
|
-
const finished = pending().filter(claimWake);
|
|
461
|
-
return {
|
|
462
|
-
entries: [...event.entries, ...finished.map((job) => ({ type: 'custom_message' as const, customType: 'pstack-job', content: finish(job), display: true }))],
|
|
463
|
-
continue: true,
|
|
464
|
-
};
|
|
465
|
-
} finally {
|
|
466
|
-
settling = false;
|
|
467
|
-
}
|
|
468
|
-
});
|
|
368
|
+
// Pi 1.5.2 reads prompt additions only from the options object it passes in (runner.js emitBeforeAgentStart),
|
|
369
|
+
// so this is the one place that writes into a host-owned object.
|
|
370
|
+
function writeIntoHostPrompt(options: { promptGuidelines: string[]; sections: Record<string, string> }, guideline: string, sections: Record<string, string>): void {
|
|
371
|
+
if (!options.promptGuidelines.includes(guideline)) options.promptGuidelines.push(guideline);
|
|
372
|
+
Object.assign(options.sections, sections);
|
|
373
|
+
}
|
|
469
374
|
|
|
375
|
+
function registerPromptHook(pi: ExtensionAPI, state: PstackState): void {
|
|
470
376
|
pi.on('before_agent_start', async (event, ctx) => {
|
|
471
|
-
|
|
472
|
-
if (!options.promptGuidelines.includes(skillsHint)) options.promptGuidelines.push(skillsHint);
|
|
473
|
-
const transcript = ctx.sessionManager.getSessionFile();
|
|
474
|
-
if (transcript)
|
|
475
|
-
options.sections['pstack-session'] =
|
|
476
|
-
`This session's transcript is ${transcript}. A worker's Pi agent directory is its job's own, so it cannot find this file by itself. Put the path in any brief that asks a worker to read the transcript.`;
|
|
477
|
-
if (insideJob()) options.sections['pstack-sandbox'] = SANDBOX_NOTE;
|
|
478
|
-
const models = modelsFile(getAgentDir());
|
|
479
|
-
if (mode) options.sections[MODE] = modeSection(mode);
|
|
480
|
-
if (existsSync(models)) options.sections['pstack-models'] = `Role lines from ${models}, written by /skill:setup-pstack:\n${readFileSync(models, 'utf8').trim()}`;
|
|
377
|
+
writeIntoHostPrompt(event.systemPromptOptions, skillsHint, promptSections(ctx.sessionManager.getSessionFile(), state.mode()));
|
|
481
378
|
});
|
|
379
|
+
}
|
|
482
380
|
|
|
483
|
-
|
|
484
|
-
pi.registerTool({
|
|
485
|
-
name: 'pi_spawn',
|
|
486
|
-
label: 'Spawn Pi',
|
|
487
|
-
description:
|
|
488
|
-
'Start a separate Pi process in its own tmux session, inside a Seatbelt (macOS) or bubblewrap (Linux) sandbox, with a standalone brief. It runs in parallel and does not see this conversation. When it exits you are woken with its final report. Each call starts one fresh instance; to start several, call pi_spawn several times in one message. A Pi it starts can start workers too, and those workers cannot. The shared /tmp is read-only to the worker, so a brief that names a scratch path uses $TMPDIR or the checkout.',
|
|
489
|
-
promptSnippet: 'Start a parallel Pi instance in tmux with a standalone brief, then get woken with its report',
|
|
490
|
-
promptGuidelines: [
|
|
491
|
-
'Use pi_spawn wherever a pstack skill says to spawn a worker, delegate, explorer, reviewer, or Pi instance. Pi has no subagents.',
|
|
492
|
-
'Write each pi_spawn brief so it stands alone. The spawned Pi sees only the brief, never this conversation.',
|
|
493
|
-
],
|
|
494
|
-
parameters: Type.Object({
|
|
495
|
-
name: Type.String({ description: 'Short label for the job, such as "explorer-auth" or "runner-2".' }),
|
|
496
|
-
brief: Type.String({ description: 'The complete standalone prompt for the spawned Pi.' }),
|
|
497
|
-
agent: Type.Optional(stringEnum(AGENTS, `Role instructions from pstack agents/<agent>.md, appended to the spawned system prompt. Roles:\n${agentRoles.join('\n')}`)),
|
|
498
|
-
model: Type.Optional(Type.String({ description: 'provider/id as `pi --list-models` prints it. Omit to use this session model.' })),
|
|
499
|
-
thinking: Type.Optional(stringEnum(THINKING, 'Thinking level. Omit to use the model default.')),
|
|
500
|
-
readonly: Type.Optional(Type.Boolean({ description: 'Deny writes to the project and remove the edit and write tools. Temp directories stay writable. Default false.' })),
|
|
501
|
-
worktree: Type.Optional(Type.String({ description: 'Branch for a new git worktree the spawned Pi works in, created from base. Writes are confined to that worktree.' })),
|
|
502
|
-
base: Type.Optional(Type.String({ description: "Ref the new worktree branch starts from. Default is this session's current HEAD, not the repository's default branch, so pass the default branch to start from it." })),
|
|
503
|
-
cwd: Type.Optional(Type.String({ description: 'Working directory inside this project when no worktree is requested. Default this session cwd.' })),
|
|
504
|
-
resume: Type.Optional(Type.String({ description: 'Job id of a finished pi_spawn job whose session the brief continues. Use only when that session holds state too costly to move.' })),
|
|
505
|
-
wake: Type.Optional(Type.Boolean({ description: 'Wake this session with the report when the job exits. Default true.' })),
|
|
506
|
-
}),
|
|
507
|
-
async execute(_id, params, _signal, _update, ctx) {
|
|
508
|
-
const root = jobsRoot();
|
|
509
|
-
const id = newJobId(params.name);
|
|
510
|
-
const dir = join(root, id);
|
|
511
|
-
const owner = ctx.sessionManager.getSessionId();
|
|
512
|
-
const prior = params.resume === undefined ? undefined : read(root, params.resume, owner);
|
|
513
|
-
if (params.resume !== undefined && (prior === undefined || prior.spec.kind !== 'pi' || prior.status.state === 'running')) {
|
|
514
|
-
throw new Error(`resume needs a finished pi_spawn job id from this session, got "${params.resume}".`);
|
|
515
|
-
}
|
|
516
|
-
if (params.resume !== undefined && params.worktree !== undefined) throw new Error('resume continues in the earlier job checkout, so it cannot take a worktree.');
|
|
517
|
-
// A resumed worker keeps the model, thinking level, role, and readonly it started with unless the call says otherwise.
|
|
518
|
-
const earlier = prior?.spec.command ?? [];
|
|
519
|
-
const model = resolveModel(ctx, params.model ?? flagValue(earlier, '--model'));
|
|
520
|
-
const thinking = params.thinking ?? flagValue(earlier, '--thinking');
|
|
521
|
-
const priorRole = flagValue(earlier, '--append-system-prompt') && prior ? join(prior.dir, 'agent.md') : undefined;
|
|
522
|
-
// Refreshing the worker's credentials now, under Pi's lock, means a worker rarely has to refresh one itself.
|
|
523
|
-
const provider = model?.slice(0, model.indexOf('/'));
|
|
524
|
-
const chosen = model && provider ? ctx.modelRegistry.find(provider, model.slice(model.indexOf('/') + 1)) : undefined;
|
|
525
|
-
if (chosen) await ctx.modelRegistry.getApiKeyAndHeaders(chosen).catch(() => undefined);
|
|
526
|
-
// A job's credentials copy holds no commands, so the worker's own provider gets its command resolved here, once.
|
|
527
|
-
const resolved: Record<string, string> = {};
|
|
528
|
-
if (provider && !insideJob() && commandProviders(getAgentDir()).includes(provider)) {
|
|
529
|
-
const key = await ctx.modelRegistry.getApiKeyForProvider(provider).catch(() => undefined);
|
|
530
|
-
if (key) resolved[provider] = key;
|
|
531
|
-
}
|
|
532
|
-
const base = prior?.spec.cwd ?? projectPath(ctx, params.cwd);
|
|
533
|
-
const readonly = params.readonly ?? earlier.includes('--exclude-tools');
|
|
534
|
-
// The job directory itself stays read-only to the worker, so it cannot rewrite its own spec or exit code.
|
|
535
|
-
const sessionDir = (prior && flagValue(earlier, '--session-dir')) || join(dir, 'session');
|
|
536
|
-
const writable = [sessionDir, join(dir, 'nested')];
|
|
537
|
-
let createdBranch = false;
|
|
538
|
-
try {
|
|
539
|
-
for (const path of writable) mkdirSync(path, { recursive: true });
|
|
540
|
-
const cwd = params.worktree !== undefined && prior === undefined ? join(dir, 'worktree') : base;
|
|
541
|
-
if (cwd !== base && params.worktree !== undefined) createdBranch = addWorktree(base, cwd, params.worktree, params.base);
|
|
542
|
-
const common = gitPath(cwd, '--git-common-dir');
|
|
543
|
-
if (!readonly) writable.push(cwd, ...(common ? [common] : []));
|
|
544
|
-
const guarded = protectedPaths(cwd, common);
|
|
545
|
-
const piCommand = process.argv[1] && isAbsolute(process.argv[1]) ? [process.execPath, process.argv[1]] : ['pi'];
|
|
546
|
-
const argv = [
|
|
547
|
-
...piCommand,
|
|
548
|
-
'-p',
|
|
549
|
-
'--session-dir',
|
|
550
|
-
sessionDir,
|
|
551
|
-
...(prior ? ['--continue'] : []),
|
|
552
|
-
...(model ? ['--model', model] : []),
|
|
553
|
-
...(thinking ? ['--thinking', thinking] : []),
|
|
554
|
-
...(params.agent || priorRole ? ['--append-system-prompt', join(dir, 'agent.md')] : []),
|
|
555
|
-
...(readonly ? ['--exclude-tools', 'edit,write'] : []),
|
|
556
|
-
ctx.isProjectTrusted() ? '--approve' : '--no-approve',
|
|
557
|
-
`@${join(dir, 'brief.md')}`,
|
|
558
|
-
];
|
|
559
|
-
const files: Record<string, string> = { 'brief.md': params.brief };
|
|
560
|
-
if (params.agent) files['agent.md'] = stripFrontmatter(readFileSync(join(packageRoot, 'agents', `${params.agent}.md`), 'utf8'));
|
|
561
|
-
else if (priorRole) files['agent.md'] = readFileSync(priorRole, 'utf8');
|
|
562
|
-
const spec: JobSpec = {
|
|
563
|
-
id,
|
|
564
|
-
name: params.name,
|
|
565
|
-
kind: 'pi',
|
|
566
|
-
cwd,
|
|
567
|
-
argv: [],
|
|
568
|
-
command: argv,
|
|
569
|
-
policy: { writable, protect: guarded.protect, lock: guarded.lock, gitDirs: guarded.gitDirs, checkouts: [], credentials: '', agentDir: getAgentDir(), jobDir: dir },
|
|
570
|
-
brokered: false,
|
|
571
|
-
owner,
|
|
572
|
-
wake: params.wake === false ? null : 'Review this report against the brief and inspect the artifacts it names before you rely on it.',
|
|
573
|
-
repeat: false,
|
|
574
|
-
series: id,
|
|
575
|
-
socket: brokering() ? '' : tmuxSocket(owner),
|
|
576
|
-
sweep: { roots: [], protect: [] },
|
|
577
|
-
out: dir,
|
|
578
|
-
createdAt: new Date().toISOString(),
|
|
579
|
-
};
|
|
580
|
-
const job = start(root, spec, files, resolved);
|
|
581
|
-
return text(`Started ${describe(job)}\n cwd: ${cwd}${spec.wake ? '\nYou will be woken with its report when it exits. Keep working or end your turn.' : ''}`);
|
|
582
|
-
} catch (error) {
|
|
583
|
-
rmSync(dir, { recursive: true, force: true });
|
|
584
|
-
if (params.worktree !== undefined && gitPath(base, '--git-common-dir')) {
|
|
585
|
-
git(base, ['worktree', 'prune']);
|
|
586
|
-
if (createdBranch) git(base, ['branch', '-D', params.worktree]);
|
|
587
|
-
}
|
|
588
|
-
throw error;
|
|
589
|
-
}
|
|
590
|
-
},
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
|
|
381
|
+
function registerTmuxRun(pi: ExtensionAPI): void {
|
|
594
382
|
pi.registerTool({
|
|
595
383
|
name: 'tmux_run',
|
|
596
384
|
label: 'Run in tmux',
|
|
@@ -598,34 +386,30 @@ export default function pstack(pi: ExtensionAPI) {
|
|
|
598
386
|
'Run a shell command in its own tmux session, inside the pstack sandbox, instead of a background shell. Use it for watchers, dev servers, long builds, and heartbeat timers. With wake set, you are woken with that message and the output tail when the command exits. With repeat, the command restarts each time it exits cleanly, so `sleep 3600` plus a wake message is an hourly tick. The shared /tmp is read-only to the command, so it keeps temp files in $TMPDIR, its own temp directory. The command reads no input.',
|
|
599
387
|
promptSnippet: 'Run a long-lived or watched command in tmux and get woken when it exits',
|
|
600
388
|
promptGuidelines: ['Use tmux_run for any command that would otherwise run in the background. Never background a command with &, nohup, setsid, or disown.'],
|
|
601
|
-
parameters:
|
|
602
|
-
name: Type.String({ description: 'Short label, such as "watch-pr-123" or "dev-server".' }),
|
|
603
|
-
command: Type.String({ description: 'Shell command, run with bash -c.' }),
|
|
604
|
-
cwd: Type.Optional(Type.String({ description: 'Working directory inside this project. Default this session cwd. The command may write only here, in its git directory, and in temp directories.' })),
|
|
605
|
-
wake: Type.Optional(Type.String({ description: 'Message to wake this session with when the command exits. Omit for a server you will stop yourself.' })),
|
|
606
|
-
repeat: Type.Optional(Type.Boolean({ description: 'Restart the command after each clean exit and wake each time. Requires wake. Stop it with tmux_jobs stop.' })),
|
|
607
|
-
}),
|
|
389
|
+
parameters: tmuxRunParameters,
|
|
608
390
|
async execute(_id, params, _signal, _update, ctx) {
|
|
609
|
-
|
|
391
|
+
TmuxRunParamsSchema.parse(params);
|
|
392
|
+
const input = params;
|
|
393
|
+
if (input.repeat && input.wake === undefined) throw new Error('repeat needs a wake message, or nothing would ever notice the ticks.');
|
|
610
394
|
const root = jobsRoot();
|
|
611
|
-
const id = newJobId(
|
|
395
|
+
const id = newJobId(input.name);
|
|
612
396
|
const owner = ctx.sessionManager.getSessionId();
|
|
613
|
-
const cwd = projectPath(ctx,
|
|
397
|
+
const cwd = projectPath(ctx, input.cwd);
|
|
614
398
|
const common = gitPath(cwd, '--git-common-dir');
|
|
615
399
|
const guarded = protectedPaths(cwd, common);
|
|
616
400
|
const policy = { writable: [cwd, ...(common ? [common] : [])], protect: guarded.protect, lock: guarded.lock, gitDirs: guarded.gitDirs, checkouts: [], credentials: '', agentDir: getAgentDir(), jobDir: join(root, id) };
|
|
617
401
|
const spec: JobSpec = {
|
|
618
402
|
id,
|
|
619
|
-
name:
|
|
403
|
+
name: input.name,
|
|
620
404
|
kind: 'command',
|
|
621
405
|
cwd,
|
|
622
406
|
argv: [],
|
|
623
|
-
command: ['bash', '-c',
|
|
407
|
+
command: ['bash', '-c', input.command],
|
|
624
408
|
policy,
|
|
625
409
|
brokered: false,
|
|
626
410
|
owner,
|
|
627
|
-
wake:
|
|
628
|
-
repeat:
|
|
411
|
+
wake: input.wake ?? null,
|
|
412
|
+
repeat: input.repeat ?? false,
|
|
629
413
|
series: id,
|
|
630
414
|
socket: brokering() ? '' : tmuxSocket(owner),
|
|
631
415
|
sweep: { roots: [], protect: [] },
|
|
@@ -640,78 +424,61 @@ export default function pstack(pi: ExtensionAPI) {
|
|
|
640
424
|
}
|
|
641
425
|
},
|
|
642
426
|
});
|
|
427
|
+
}
|
|
643
428
|
|
|
429
|
+
/** Blocks on the named jobs, or every waitable one, and reports each. */
|
|
430
|
+
async function waitFor(state: PstackState, root: string, owner: string, named: string[] | undefined, timeout: number | undefined, waiter: Waiter): Promise<string> {
|
|
431
|
+
const ids = named?.length ? named : waitableIds(root, owner);
|
|
432
|
+
const current = () => ids.map((id) => read(root, id, owner)).filter((job): job is Job => job !== undefined);
|
|
433
|
+
state.await(ids);
|
|
434
|
+
try {
|
|
435
|
+
await blockWhileRunning(current, Date.now() + (timeout ?? DEFAULT_WAIT_SECONDS) * MS_PER_SECOND, waiter);
|
|
436
|
+
// A job whose wake the watcher already delivered is reported plainly, without restarting a heartbeat twice.
|
|
437
|
+
const reports = current().map((job) => (job.status.state === 'running' ? `${describe(job)}\n still running` : claimWake(job) ? finish(state, job) : report(job)));
|
|
438
|
+
return reports.join('\n\n') || 'No jobs to wait on.';
|
|
439
|
+
} finally {
|
|
440
|
+
state.release(ids);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
const jobOutputs = (jobs: Job[], lines: number): string => jobs.map((job) => outputOf(job, lines)).join('\n\n');
|
|
445
|
+
|
|
446
|
+
function registerTmuxJobs(pi: ExtensionAPI, state: PstackState): void {
|
|
644
447
|
pi.registerTool({
|
|
645
448
|
name: 'tmux_jobs',
|
|
646
449
|
label: 'tmux jobs',
|
|
647
450
|
description:
|
|
648
|
-
"Inspect or control this session's
|
|
649
|
-
parameters:
|
|
650
|
-
action: stringEnum(['list', 'output', 'wait', 'stop'] as const),
|
|
651
|
-
ids: Type.Optional(Type.Array(Type.String(), { description: 'Job ids. Required for output and stop.' })),
|
|
652
|
-
lines: Type.Optional(Type.Number({ description: 'Lines for raw output. Exited Pi workers show their completed answers instead. Default 80.' })),
|
|
653
|
-
timeout_seconds: Type.Optional(Type.Number({ description: 'Longest wait. Default 300.' })),
|
|
654
|
-
}),
|
|
451
|
+
"Inspect or control this session's tmux_run jobs. list shows every job with its state, a command to follow its output, and for a running job a command to attach to its tmux session, where the output shows live and Ctrl-C stops it. output shows the last lines of a command or running job. wait blocks until the named jobs (default every running job with a wake) exit, the timeout passes, or the user sends a message, then returns their reports. A job with a wake reports on its own, so end your turn instead of waiting unless the wait is short. stop ends jobs, and every later run of a repeating one, and suppresses their wake.",
|
|
452
|
+
parameters: tmuxJobsParameters,
|
|
655
453
|
async execute(_id, params, signal, update, ctx) {
|
|
454
|
+
TmuxJobsParamsSchema.parse(params);
|
|
455
|
+
const input = params;
|
|
656
456
|
const root = jobsRoot();
|
|
657
457
|
const owner = ctx.sessionManager.getSessionId();
|
|
658
|
-
const named = (): Job[] =>
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
if (!job) throw new Error(`No job ${id} in this session.`);
|
|
663
|
-
return job;
|
|
664
|
-
});
|
|
665
|
-
};
|
|
666
|
-
switch (params.action) {
|
|
667
|
-
case 'list': {
|
|
668
|
-
const jobs = list(root, owner);
|
|
669
|
-
return text(jobs.length ? jobs.map(describe).join('\n') : 'No jobs in this session.');
|
|
670
|
-
}
|
|
671
|
-
case 'output':
|
|
672
|
-
return text(
|
|
673
|
-
named()
|
|
674
|
-
.map((job) => (job.spec.kind === 'pi' && job.status.state !== 'running' ? report(job) : `${describe(job)}\n${tail(outputPath(job.spec.out), params.lines ?? 80)}`))
|
|
675
|
-
.join('\n\n'),
|
|
676
|
-
);
|
|
677
|
-
case 'stop': {
|
|
678
|
-
const series = new Set(named().map((job) => job.spec.series));
|
|
679
|
-
// Recorded before stopping, so a run that finishes meanwhile is not restarted into a run this stop misses.
|
|
680
|
-
for (const id of series) stoppedSeries.add(id);
|
|
681
|
-
// Every run in the series, finished ones included, so a run that just exited is not restarted after the stop.
|
|
682
|
-
const jobs = list(root, owner).filter((job) => series.has(job.spec.series));
|
|
683
|
-
await Promise.all(jobs.map(stop));
|
|
684
|
-
return text(`Stopped ${jobs.map((job) => job.spec.id).join(', ')}.`);
|
|
685
|
-
}
|
|
686
|
-
case 'wait': {
|
|
687
|
-
const ids = params.ids?.length
|
|
688
|
-
? params.ids
|
|
689
|
-
: list(root, owner)
|
|
690
|
-
// A heartbeat or a server never stops on its own, so waiting on everything leaves them out.
|
|
691
|
-
.filter((job) => job.status.state === 'running' && !job.spec.repeat && job.spec.wake !== null)
|
|
692
|
-
.map((job) => job.spec.id);
|
|
693
|
-
const deadline = Date.now() + (params.timeout_seconds ?? 300) * 1000;
|
|
694
|
-
const current = () => ids.map((id) => read(root, id, owner)).filter((job): job is Job => job !== undefined);
|
|
695
|
-
for (const id of ids) awaited.add(id);
|
|
696
|
-
try {
|
|
697
|
-
// A message the user sends while this blocks ends the wait, so they are never shut out until the timeout.
|
|
698
|
-
while (current().some((job) => job.status.state === 'running') && Date.now() < deadline && !signal?.aborted && !ctx.hasPendingMessages()) {
|
|
699
|
-
update?.(text(`Waiting on ${current().filter((job) => job.status.state === 'running').length} job(s)...`));
|
|
700
|
-
await new Promise((done) => setTimeout(done, POLL_MS));
|
|
701
|
-
}
|
|
702
|
-
const jobs = current();
|
|
703
|
-
// A job whose wake the watcher already delivered is reported plainly, without restarting a heartbeat twice.
|
|
704
|
-
const reports = jobs.map((job) => (job.status.state === 'running' ? `${describe(job)}\n still running` : claimWake(job) ? finish(job) : report(job)));
|
|
705
|
-
return text(reports.join('\n\n') || 'No jobs to wait on.');
|
|
706
|
-
} finally {
|
|
707
|
-
for (const id of ids) awaited.delete(id);
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
default: {
|
|
711
|
-
const unreachable: never = params.action;
|
|
712
|
-
throw new Error(`Unknown action ${String(unreachable)}`);
|
|
713
|
-
}
|
|
458
|
+
const named = (): Job[] => namedJobs(root, owner, input.action, input.ids);
|
|
459
|
+
if (input.action === 'list') {
|
|
460
|
+
const jobs = list(root, owner);
|
|
461
|
+
return text(jobs.length ? jobs.map(describe).join('\n') : 'No jobs in this session.');
|
|
714
462
|
}
|
|
463
|
+
if (input.action === 'output') return text(jobOutputs(named(), input.lines ?? DEFAULT_OUTPUT_LINES));
|
|
464
|
+
if (input.action === 'wait') return text(await waitFor(state, root, owner, input.ids, input.timeout_seconds, { signal, update, ctx }));
|
|
465
|
+
if (input.action !== 'stop') throw new Error(`Unknown action ${String(input.action)}`);
|
|
466
|
+
const series = new Set(named().map((job) => job.spec.series));
|
|
467
|
+
// Recorded before stopping, so a run that finishes meanwhile is not restarted into a run this stop misses.
|
|
468
|
+
state.stopSeries(series);
|
|
469
|
+
// Every run in the series, finished ones included, so a run that just exited is not restarted after the stop.
|
|
470
|
+
const jobs = list(root, owner).filter((job) => series.has(job.spec.series));
|
|
471
|
+
await Promise.all(jobs.map(stop));
|
|
472
|
+
return text(`Stopped ${jobs.map((job) => job.spec.id).join(', ')}.`);
|
|
715
473
|
},
|
|
716
474
|
});
|
|
717
475
|
}
|
|
476
|
+
|
|
477
|
+
export default function pstack(pi: ExtensionAPI) {
|
|
478
|
+
const state = createState();
|
|
479
|
+
registerModeCommand(pi, state);
|
|
480
|
+
registerWatcher(pi, state);
|
|
481
|
+
registerPromptHook(pi, state);
|
|
482
|
+
registerTmuxRun(pi);
|
|
483
|
+
registerTmuxJobs(pi, state);
|
|
484
|
+
}
|