@bo-agent/pwsh-sandbox 0.0.2
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/lib/.tsbuildinfo +1 -0
- package/lib/helpers.d.ts +55 -0
- package/lib/helpers.d.ts.map +1 -0
- package/lib/helpers.js +107 -0
- package/lib/helpers.js.map +1 -0
- package/lib/index.d.ts +74 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +159 -0
- package/lib/index.js.map +1 -0
- package/package.json +24 -0
- package/src/helpers.ts +116 -0
- package/src/index.ts +194 -0
- package/tsconfig.json +43 -0
package/lib/.tsbuildinfo
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.full.d.ts","../../../node_modules/.pnpm/cosmokit@1.8.1/node_modules/cosmokit/lib/index.d.ts","../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts","../../../node_modules/.pnpm/cordis@4.0.0-rc.10/node_modules/cordis/lib/utils.d.ts","../../../node_modules/.pnpm/cordis@4.0.0-rc.10/node_modules/cordis/lib/registry.d.ts","../../../node_modules/.pnpm/cordis@4.0.0-rc.10/node_modules/cordis/lib/reflect.d.ts","../../../node_modules/.pnpm/cordis@4.0.0-rc.10/node_modules/cordis/lib/fiber.d.ts","../../../node_modules/.pnpm/cordis@4.0.0-rc.10/node_modules/cordis/lib/events.d.ts","../../../node_modules/.pnpm/cordis@4.0.0-rc.10/node_modules/cordis/lib/logger.d.ts","../../../node_modules/.pnpm/cordis@4.0.0-rc.10/node_modules/cordis/lib/context.d.ts","../../../node_modules/.pnpm/cordis@4.0.0-rc.10/node_modules/cordis/lib/service.d.ts","../../../node_modules/.pnpm/cordis@4.0.0-rc.10/node_modules/cordis/lib/index.d.ts","../../inline/lib/harness-error.d.ts","../../inline/lib/assert-never.d.ts","../../inline/lib/session-id.d.ts","../../inline/lib/index.d.ts","../../sandbox/lib/escalation.d.ts","../../sandbox/lib/roots.d.ts","../../sandbox/lib/index.d.ts","../../subprocess/lib/types.d.ts","../../subprocess/lib/index.d.ts","../../shell/lib/types.d.ts","../../shell/lib/render.d.ts","../../shell/lib/index.d.ts","../src/helpers.ts","../../../node_modules/.pnpm/schemastery@3.18.0/node_modules/schemastery/lib/index.d.ts","../../pwsh-local/lib/resolve.d.ts","../../pwsh-local/lib/index.d.ts","../src/index.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/compatibility/disposable.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/compatibility/indexable.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/compatibility/index.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/header.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/readable.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/file.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/fetch.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/formdata.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/connector.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/client.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/errors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-origin.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool-stats.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/handlers.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-client.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-errors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-handler.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/api.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/interceptors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/util.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cookies.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/patch.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/websocket.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/eventsource.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/filereader.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/content-type.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cache.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/index.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/web-globals/streams.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/sea.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/sqlite.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@22.20.2/node_modules/@types/node/index.d.ts"],"fileIdsList":[[109,158,175,176],[109,155,156,158,175,176],[109,157,158,175,176],[158,175,176],[109,158,163,175,176,193],[109,158,159,164,169,175,176,178,190,201],[109,158,159,160,169,175,176,178],[104,105,106,109,158,175,176],[109,158,161,175,176,202],[109,158,162,163,170,175,176,179],[109,158,163,175,176,190,198],[109,158,164,166,169,175,176,178],[109,157,158,165,175,176],[109,158,166,167,175,176],[109,158,168,169,175,176],[109,157,158,169,175,176],[109,158,169,170,171,175,176,190,201],[109,158,169,170,171,175,176,185,190,193],[109,150,158,166,169,172,175,176,178,190,201],[109,158,169,170,172,173,175,176,178,190,198,201],[109,158,172,174,175,176,190,198,201],[107,108,109,110,111,112,113,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207],[109,158,169,175,176],[109,158,175,176,177,201],[109,158,166,169,175,176,178,190],[109,158,175,176,179],[109,158,175,176,180],[109,157,158,175,176,181],[109,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207],[109,158,175,176,183],[109,158,175,176,184],[109,158,169,175,176,185,186],[109,158,175,176,185,187,202,204],[109,158,170,175,176],[109,158,169,175,176,190,191,193],[109,158,175,176,192,193],[109,158,175,176,190,191],[109,158,175,176,193],[109,158,175,176,194],[109,155,158,175,176,190,195,201],[109,158,169,175,176,196,197],[109,158,175,176,196,197],[109,158,163,175,176,178,190,198],[109,158,175,176,199],[109,158,175,176,178,200],[109,158,172,175,176,184,201],[109,158,163,175,176,202],[109,158,175,176,190,203],[109,158,175,176,177,204],[109,158,175,176,205],[109,150,158,175,176],[109,150,158,169,171,175,176,181,190,193,201,203,204,206],[109,158,175,176,190,207],[76,78,79,80,81,82,83,109,158,175,176],[76,79,80,81,82,83,84,109,158,175,176],[76,77,78,79,80,81,82,83,84,109,158,175,176],[78,79,80,81,82,83,84,85,109,158,175,176],[78,79,80,81,82,83,84,109,158,175,176],[86,93,95,98,109,158,175,176],[76,77,109,158,175,176],[109,122,126,158,175,176,201],[109,122,158,175,176,190,201],[109,117,158,175,176],[109,119,122,158,175,176,198,201],[109,158,175,176,178,198],[109,158,175,176,208],[109,117,158,175,176,208],[109,119,122,158,175,176,178,201],[109,114,115,118,121,158,169,175,176,190,201],[109,122,129,158,175,176],[109,114,120,158,175,176],[109,122,143,144,158,175,176],[109,118,122,158,175,176,193,201,208],[109,143,158,175,176,208],[109,116,117,158,175,176,208],[109,122,158,175,176],[109,116,117,118,119,120,121,122,123,124,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,148,149,158,175,176],[109,122,137,158,175,176],[109,122,129,130,158,175,176],[109,120,122,130,131,158,175,176],[109,121,158,175,176],[109,114,117,122,158,175,176],[109,122,126,130,131,158,175,176],[109,126,158,175,176],[109,120,122,125,158,175,176,201],[109,114,119,122,129,158,175,176],[109,158,175,176,190],[109,117,122,143,158,175,176,206,208],[87,88,89,109,158,175,176],[86,93,95,98,100,101,109,158,175,176],[93,98,109,158,170,175,176],[86,93,95,98,99,102,109,158,175,176],[93,109,158,175,176],[86,90,91,92,93,95,98,109,158,175,176],[86,93,95,96,97,98,109,158,175,176],[93,95,109,158,175,176],[86,93,94,95,98,109,158,175,176]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3e9cef4eed59f8a2249ed834ba4aabe9d0d4e9037d4679487fa17dad99004a3","impliedFormat":1},{"version":"0e7086243656ce24ba7dfe15a8d8e3cd4310afa6cbddb97dd06d5dc399794676","impliedFormat":99},{"version":"bdd14f07b4eca0b4b5203b85b8dbc4d084c749fa590bee5ea613e1641dcd3b29","impliedFormat":99},{"version":"1f9b9bc4eb18864e8c1628ecd0630442eb857e7b77322559a9a00004f1e39d80","impliedFormat":99},{"version":"598ee676b4645a043e7c4198d53221dd8c44bc628b12776efd8bc6fabd804ced","impliedFormat":99},{"version":"3de8c258acd8647678a8c96db4cee1151a16bc18626028a9c7b33b6bdd037db9","impliedFormat":99},{"version":"b7f6288c956d50a63f4d14610f39df7f7b1e9d481413a0e95c82c37179448ddc","impliedFormat":99},{"version":"18930b7045a527847a039cf29af8927c8079414527707396672ed3cd706fc399","impliedFormat":99},{"version":"7395b909d9b5c754cf8af3937a7ac783bd82eeea31c42a35a02bbcfb5db945a4","impliedFormat":99},{"version":"3a0bf69f6275288de8b20cc353c1e0e6c6d61644789ddec51b526d0d5166acc1","impliedFormat":99},{"version":"6adf2288c91294fe0c68828187e96820b0620fe5d78f79ccbff06d230d9b0c8e","impliedFormat":99},{"version":"8cc48b522565f226e5bdb0f6a4d4b1bcdc8f82ac72c32fd869831a96f583b3cc","impliedFormat":99},"3207040072c5856d33d3f2f039436dc39a81b1dea1577702ff9b7d705bf2ceb5","8176d2ff27e0d895260bb1f1b3e094ab521819e7536c79bad057f6c475f00ee6","70b6cdce0800a89493f582f239c4cc49f4dba7e5b0e674f651d039476333fca0","e0ecc9ceeb052adc8590f8e527e58d572ae564f7b90a407295e4846b9bdb7b8a","eab4d0f1a497f676581d205a6019850414d7aac01f9ae05e8320d250d7409cf3","eb85ac6e1d061fa97b89e2cf810253e688a0f008a71bfd3a720f05788966d932","10f45007344ec6e7bd7384ab49b8b72feafcdc9df3d20d040ac058b0514f5a1b","f45efbcb0323d0749d12447c82e6ed374b237d73d0f701872c937546200173ce","fd0992b57c68dbe57ea0a54c49402c5071ccf7f8612c0cf191882f09fa7b71d8","bbb563f8367741fefe917ecd36a9f4ba7eca941af02a3b3f847d24cc0267fd46","505d4823e96d7928286311bf7109ae342ec0caf86283ed2e04b8d17afe33b3a3","94dd664bf328d51a448daff6f6e0bb0aff78e8401bd303e0da67bd1a8fd4098d",{"version":"757e00475522602efc7b90db2b6af931e2cb5dfd327b1da457b2662de46c6ac0","signature":"88d8ed1cf21b9c047368dc28dc21aa59964d8c1e63d981332327eccd18be5d6f"},{"version":"d84b05b596aafd7be8867d29ff85e02cb690888a1f8aaa85afe5d5f01862efd8","affectsGlobalScope":true,"impliedFormat":1},"e47d6021b5ce4e8ee943cd43c9b26f60273736eae570df1d04d5dafe63f1df2e","16240ff1c34bb10cb71f088b0cfee59d621d04a4add2386dbb4b408f87c8b724",{"version":"f70297391e21b548b2877b0c74c2d26213896c07022c6772f489d4cc2538517f","signature":"2a5129645cfa30d0530ff8e7b36b8b6497f96ca344a6471cc98c43e66db8c1b6"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b52476feb4a0cbcb25e5931b930fc73cb6643fb1a5060bf8a3dda0eeae5b4b68","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d97fb21da858fb18b8ae72c314e9743fd52f73ebe2764e12af1db32fc03f853f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"78dbea00e90d2df8ea3dbef0cc379d95b8be9b71cd6bde4c28728f306811803b","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e1e46d0a9837ee058c100501080c920fa98081ea3956af0374308ba6f22a33e","impliedFormat":1},{"version":"272ca407e0c9068bdc5152552d876e68037ceae3de62e529306403e973dec8e1","impliedFormat":1},{"version":"fa7834c715d5357e4540cee40ce96c3250ddb67a7b879a6b7fa0e86d6696f121","impliedFormat":1},{"version":"22dfb07a7ab15b66ac043829056fe70124844636ae719551812ac631ba04985b","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6f137d651076822d4fe884287e68fd61785a0d3d1fdb250a5059b691fa897db","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"bceb58df66ab8fb00170df20cd813978c5ab84be1d285710c4eb005d8e9d8efb","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"0cb167c371eaa8c869f8a7656a7296f2e4fae43b4d8b803a680236b24794e5f9","impliedFormat":1},{"version":"0a839dba0287cc0481ad4beedd48a1c64acf1e212ae865d1315f7007ca215161","impliedFormat":1},{"version":"38dc4655376cd1a4bd6bb3763d92949233e33d38d3dd3cbea7bbf218175a38ef","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"208a6a0bfb227bdf8fb964799d0a206c75cf03ccd72e63bf5495c9331354c6d6","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"48a679952eefe4cb776d5a0e1ccba2d3eb53b57448bbb7abc1fcebcbd5440188","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"2d14da6ecb49bf828d83948765ec2d3a579d476bbb9645e749610baa6ec880ca","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"0aef708fb4c7a6b915e8305cbfac40cd207b032dbaabe9a01889a5fff3254681","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"ad9bdafb4e7abf14cc53ce7970486a84c87831e62891e5dfe798ddcd55e84701","affectsGlobalScope":true,"impliedFormat":1},{"version":"358765d5ea8afd285d4fd1532e78b88273f18cb3f87403a9b16fef61ac9fdcfe","impliedFormat":1},{"version":"71d3ae6a5e73ca4130762560425e00984ebaff64d5353a3333d1bb7eb86ef336","impliedFormat":1}],"root":[99,103],"options":{"allowImportingTsExtensions":true,"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rewriteRelativeImportExtensions":true,"rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":11,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":false},"referencedMap":[[77,1],[155,2],[156,2],[157,3],[109,4],[158,5],[159,6],[160,7],[104,1],[107,8],[105,1],[106,1],[161,9],[162,10],[163,11],[164,12],[165,13],[166,14],[167,14],[168,15],[169,16],[170,17],[171,18],[110,1],[108,1],[172,19],[173,20],[174,21],[208,22],[175,23],[176,1],[177,24],[178,25],[179,26],[180,27],[181,28],[182,29],[183,30],[184,31],[185,32],[186,32],[187,33],[188,1],[189,34],[190,35],[192,36],[191,37],[193,38],[194,39],[195,40],[196,41],[197,42],[198,43],[199,44],[200,45],[201,46],[202,47],[203,48],[204,49],[205,50],[111,1],[112,1],[113,1],[151,51],[152,1],[153,1],[154,38],[206,52],[207,53],[84,54],[82,55],[81,56],[86,57],[83,58],[80,55],[79,56],[85,58],[78,59],[76,1],[100,60],[73,1],[74,1],[14,1],[12,1],[13,1],[18,1],[17,1],[2,1],[19,1],[20,1],[21,1],[22,1],[23,1],[24,1],[25,1],[26,1],[3,1],[27,1],[28,1],[4,1],[29,1],[33,1],[30,1],[31,1],[32,1],[34,1],[35,1],[36,1],[5,1],[37,1],[38,1],[39,1],[40,1],[6,1],[44,1],[41,1],[42,1],[43,1],[45,1],[7,1],[46,1],[51,1],[52,1],[47,1],[48,1],[49,1],[50,1],[8,1],[56,1],[53,1],[54,1],[55,1],[57,1],[9,1],[58,1],[59,1],[60,1],[62,1],[61,1],[63,1],[64,1],[10,1],[65,1],[66,1],[67,1],[11,1],[75,1],[68,1],[69,1],[70,1],[71,1],[72,1],[1,1],[16,1],[15,1],[129,61],[139,62],[128,61],[149,63],[120,64],[119,65],[148,66],[142,67],[147,68],[122,69],[136,70],[121,71],[145,72],[117,73],[116,66],[146,74],[118,75],[123,76],[124,1],[127,76],[114,1],[150,77],[140,78],[131,79],[132,80],[134,81],[130,82],[133,83],[143,66],[125,84],[126,85],[135,86],[115,87],[138,78],[137,76],[141,1],[144,88],[88,1],[87,1],[90,89],[89,1],[102,90],[101,1],[99,91],[103,92],[91,93],[93,94],[92,93],[98,95],[97,1],[96,96],[95,97],[94,87]],"latestChangedDtsFile":"./index.d.ts","version":"5.9.3"}
|
package/lib/helpers.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal sandbox-result classification helpers.
|
|
3
|
+
*
|
|
4
|
+
* @module @bo-agent/pwsh-sandbox/helpers
|
|
5
|
+
*/
|
|
6
|
+
import type { ShellRunResult } from '@bo-agent/shell';
|
|
7
|
+
import type { RunnerFailureRule } from '@bo-agent/sandbox';
|
|
8
|
+
/**
|
|
9
|
+
* Attribute only Node ENOENT/EACCES failures whose error path equals argv[0]
|
|
10
|
+
* after independently ruling out the caller-owned cwd. A supplied error path
|
|
11
|
+
* must exactly identify the runner; without one, the syscall must. With a
|
|
12
|
+
* usable cwd, these codes describe resolution or execute permission for that
|
|
13
|
+
* argv[0] or its shebang interpreter.
|
|
14
|
+
* The workdir is checked at classification time, not atomically with spawn;
|
|
15
|
+
* concurrent path replacement may change attribution but cannot permit an
|
|
16
|
+
* unconfined execution.
|
|
17
|
+
* @param error - the original spawn rejection.
|
|
18
|
+
* @param runnerProgram - provider argv[0], the executable that establishes confinement.
|
|
19
|
+
* @param workdir - the caller-owned spawn cwd, checked independently for usability.
|
|
20
|
+
* @returns whether the rejection has executable-specific runner evidence.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isRunnerSpawnFailure(error: unknown, runnerProgram: string | undefined, workdir: string): boolean;
|
|
23
|
+
/** Fatal runner evidence retained for infrastructure-error detail. */
|
|
24
|
+
interface RunnerFailureMatch {
|
|
25
|
+
/** The original stderr line that matched a fatal signature. */
|
|
26
|
+
detail: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Classify a failed run against the selected backend's denial dialect.
|
|
30
|
+
* @param result - settled foreground run.
|
|
31
|
+
* @param signatures - case-insensitive denial substrings from the active wrap.
|
|
32
|
+
* @returns whether the failed run matches that denial dialect.
|
|
33
|
+
*/
|
|
34
|
+
export declare function classifyDenial(result: ShellRunResult, signatures: readonly string[]): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Classify one settled process against the selected backend's structured
|
|
37
|
+
* runner-failure rules. Each rule requires a nonzero exit, its optional
|
|
38
|
+
* exit-code gate, and a fatal signature on one stderr line after exact
|
|
39
|
+
* informational lines are excluded.
|
|
40
|
+
* @param exitCode - process exit code; null means signal termination.
|
|
41
|
+
* @param stderr - collected stderr text, left unchanged.
|
|
42
|
+
* @param rules - structured runner-failure rules from the active wrap.
|
|
43
|
+
* @returns the first matching fatal line, or undefined when evidence is insufficient.
|
|
44
|
+
*/
|
|
45
|
+
export declare function classifyRunnerFailure(exitCode: number | null, stderr: string, rules: readonly RunnerFailureRule[]): RunnerFailureMatch | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Match a non-zero exit against case-insensitive stderr signatures.
|
|
48
|
+
* @param exitCode - process exit code; null means signal termination.
|
|
49
|
+
* @param stderr - collected stderr text.
|
|
50
|
+
* @param signatures - substrings identifying the selected backend's dialect.
|
|
51
|
+
* @returns whether this is a non-zero exit whose stderr matches a signature.
|
|
52
|
+
*/
|
|
53
|
+
export declare function matchesSignature(exitCode: number | null, stderr: string, signatures: readonly string[]): boolean;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAgB1D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,OAAO,EAAE,MAAM,GACd,OAAO,CAUT;AAED,sEAAsE;AACtE,UAAU,kBAAkB;IAC1B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE7F;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAClC,kBAAkB,GAAG,SAAS,CAkBhC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAIhH"}
|
package/lib/helpers.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal sandbox-result classification helpers.
|
|
3
|
+
*
|
|
4
|
+
* @module @bo-agent/pwsh-sandbox/helpers
|
|
5
|
+
*/
|
|
6
|
+
import { accessSync, constants, statSync } from 'node:fs';
|
|
7
|
+
/** Node-local spawn codes proven to identify executable resolution or permission failure. */
|
|
8
|
+
const EXECUTABLE_SPAWN_CODES = new Set(['EACCES', 'ENOENT']);
|
|
9
|
+
/** Whether the caller-owned spawn cwd can be entered. */
|
|
10
|
+
function isUsableWorkdir(path) {
|
|
11
|
+
try {
|
|
12
|
+
if (!statSync(path).isDirectory())
|
|
13
|
+
return false;
|
|
14
|
+
accessSync(path, constants.X_OK);
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Attribute only Node ENOENT/EACCES failures whose error path equals argv[0]
|
|
23
|
+
* after independently ruling out the caller-owned cwd. A supplied error path
|
|
24
|
+
* must exactly identify the runner; without one, the syscall must. With a
|
|
25
|
+
* usable cwd, these codes describe resolution or execute permission for that
|
|
26
|
+
* argv[0] or its shebang interpreter.
|
|
27
|
+
* The workdir is checked at classification time, not atomically with spawn;
|
|
28
|
+
* concurrent path replacement may change attribution but cannot permit an
|
|
29
|
+
* unconfined execution.
|
|
30
|
+
* @param error - the original spawn rejection.
|
|
31
|
+
* @param runnerProgram - provider argv[0], the executable that establishes confinement.
|
|
32
|
+
* @param workdir - the caller-owned spawn cwd, checked independently for usability.
|
|
33
|
+
* @returns whether the rejection has executable-specific runner evidence.
|
|
34
|
+
*/
|
|
35
|
+
export function isRunnerSpawnFailure(error, runnerProgram, workdir) {
|
|
36
|
+
if (runnerProgram === undefined || !isUsableWorkdir(workdir))
|
|
37
|
+
return false;
|
|
38
|
+
if (typeof error !== 'object' || error === null)
|
|
39
|
+
return false;
|
|
40
|
+
const { code, path, syscall } = error;
|
|
41
|
+
if (typeof code !== 'string' || !EXECUTABLE_SPAWN_CODES.has(code))
|
|
42
|
+
return false;
|
|
43
|
+
if (typeof syscall !== 'string')
|
|
44
|
+
return false;
|
|
45
|
+
const exactSyscall = `spawn ${runnerProgram}`;
|
|
46
|
+
if (path === undefined)
|
|
47
|
+
return syscall === exactSyscall;
|
|
48
|
+
if (typeof path !== 'string' || path.length === 0 || path !== runnerProgram)
|
|
49
|
+
return false;
|
|
50
|
+
return syscall === 'spawn' || syscall === exactSyscall;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Classify a failed run against the selected backend's denial dialect.
|
|
54
|
+
* @param result - settled foreground run.
|
|
55
|
+
* @param signatures - case-insensitive denial substrings from the active wrap.
|
|
56
|
+
* @returns whether the failed run matches that denial dialect.
|
|
57
|
+
*/
|
|
58
|
+
export function classifyDenial(result, signatures) {
|
|
59
|
+
return matchesSignature(result.exitCode, result.stderr.text, signatures);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Classify one settled process against the selected backend's structured
|
|
63
|
+
* runner-failure rules. Each rule requires a nonzero exit, its optional
|
|
64
|
+
* exit-code gate, and a fatal signature on one stderr line after exact
|
|
65
|
+
* informational lines are excluded.
|
|
66
|
+
* @param exitCode - process exit code; null means signal termination.
|
|
67
|
+
* @param stderr - collected stderr text, left unchanged.
|
|
68
|
+
* @param rules - structured runner-failure rules from the active wrap.
|
|
69
|
+
* @returns the first matching fatal line, or undefined when evidence is insufficient.
|
|
70
|
+
*/
|
|
71
|
+
export function classifyRunnerFailure(exitCode, stderr, rules) {
|
|
72
|
+
if (exitCode === null || exitCode === 0)
|
|
73
|
+
return undefined;
|
|
74
|
+
const lines = stderr.split(/\r?\n/);
|
|
75
|
+
for (const rule of rules) {
|
|
76
|
+
if (rule.allowedExitCodes !== undefined && !rule.allowedExitCodes.includes(exitCode))
|
|
77
|
+
continue;
|
|
78
|
+
const informationalLines = new Set((rule.informationalLines ?? []).map(line => line.toLowerCase()));
|
|
79
|
+
// An empty or whitespace-only substring is not meaningful runner evidence.
|
|
80
|
+
// Ignore it while keeping any valid signatures beside it active.
|
|
81
|
+
const fatalSignatures = rule.fatalSignatures
|
|
82
|
+
.filter(signature => signature.trim().length > 0)
|
|
83
|
+
.map(signature => signature.toLowerCase());
|
|
84
|
+
for (const line of lines) {
|
|
85
|
+
const lowered = line.toLowerCase();
|
|
86
|
+
if (informationalLines.has(lowered))
|
|
87
|
+
continue;
|
|
88
|
+
if (fatalSignatures.some(signature => lowered.includes(signature)))
|
|
89
|
+
return { detail: line };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Match a non-zero exit against case-insensitive stderr signatures.
|
|
96
|
+
* @param exitCode - process exit code; null means signal termination.
|
|
97
|
+
* @param stderr - collected stderr text.
|
|
98
|
+
* @param signatures - substrings identifying the selected backend's dialect.
|
|
99
|
+
* @returns whether this is a non-zero exit whose stderr matches a signature.
|
|
100
|
+
*/
|
|
101
|
+
export function matchesSignature(exitCode, stderr, signatures) {
|
|
102
|
+
if (exitCode === null || exitCode === 0)
|
|
103
|
+
return false;
|
|
104
|
+
const lowered = stderr.toLowerCase();
|
|
105
|
+
return signatures.some(signature => lowered.includes(signature.toLowerCase()));
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"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"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-consuming PowerShell executor — the pwsh twin of
|
|
3
|
+
* `@bo-agent/bash-sandbox`. It wraps the exact local pwsh argv through
|
|
4
|
+
* `ctx.sandbox` (which on Windows resolves to the ACL restricted-token
|
|
5
|
+
* runner chain), inherits local process mechanics, and reports the selected
|
|
6
|
+
* mode, enforcement, and denial facts. Positive runner-launch evidence means
|
|
7
|
+
* the command never ran: foreground calls throw `SANDBOX_UNAVAILABLE`, while
|
|
8
|
+
* background processes carry `runnerFailed`; other spawn rejections retain
|
|
9
|
+
* local-executor semantics. The tool layer is unchanged. Tool calls pass
|
|
10
|
+
* the calling session's resolved policy; direct calls fall back to
|
|
11
|
+
* deployment policy. `result.sandbox` reports the mode and enforcement
|
|
12
|
+
* actually used.
|
|
13
|
+
*
|
|
14
|
+
* @module @bo-agent/pwsh-sandbox
|
|
15
|
+
*/
|
|
16
|
+
import { Context } from 'cordis';
|
|
17
|
+
import type { ShellExecRequest, ShellExecSpec, ShellProcess, ShellRunResult } from '@bo-agent/shell';
|
|
18
|
+
import type { SandboxMode } from '@bo-agent/sandbox';
|
|
19
|
+
import { PwshLocalExecutor } from '@bo-agent/pwsh-local';
|
|
20
|
+
import type { Config as LocalConfig } from '@bo-agent/pwsh-local';
|
|
21
|
+
/**
|
|
22
|
+
* Plugin config: the local executor's knobs, verbatim. The sandbox policy —
|
|
23
|
+
* the default mode and fallback `workspace-write` root — is NOT here: it
|
|
24
|
+
* lives on `ctx.sandboxPolicy`, which resolves each calling session's mode
|
|
25
|
+
* and cwd for every enforcing capability. The runner choice is likewise the
|
|
26
|
+
* `ctx.sandbox` provider's config, not this executor's.
|
|
27
|
+
*/
|
|
28
|
+
export type Config = LocalConfig;
|
|
29
|
+
/**
|
|
30
|
+
* Registers as `ctx.shell` in place of the local pwsh executor and requires
|
|
31
|
+
* a `ctx.sandbox` provider plus `ctx.sandboxPolicy`; the tool layer is
|
|
32
|
+
* unchanged. Tool calls pass the calling session's resolved policy; direct
|
|
33
|
+
* calls fall back to deployment policy. `result.sandbox` reports the mode
|
|
34
|
+
* and enforcement actually used.
|
|
35
|
+
*/
|
|
36
|
+
export declare class SandboxPwshExecutor extends PwshLocalExecutor {
|
|
37
|
+
static inject: string[];
|
|
38
|
+
private readonly mode;
|
|
39
|
+
/**
|
|
40
|
+
* Per-process confinement facts retained until settlement. Providers may
|
|
41
|
+
* vary enforcement and diagnostic dialect between overlapping calls, so a
|
|
42
|
+
* shared latest-wrap value would classify a process against the wrong facts.
|
|
43
|
+
* Unconfined processes have no entry.
|
|
44
|
+
*/
|
|
45
|
+
private readonly processFacts;
|
|
46
|
+
constructor(ctx: Context, config: Config);
|
|
47
|
+
/** The configured default mode — the capability fact the tool layer reads. */
|
|
48
|
+
get sandboxMode(): SandboxMode;
|
|
49
|
+
/**
|
|
50
|
+
* Stamp a complete per-call policy onto the spec. Tool calls supply the
|
|
51
|
+
* calling session's resolved mode and root; lower-level callers fall back
|
|
52
|
+
* to the deployment policy.
|
|
53
|
+
*/
|
|
54
|
+
resolve(request: ShellExecRequest): ShellExecSpec;
|
|
55
|
+
run(spec: ShellExecSpec): Promise<ShellRunResult>;
|
|
56
|
+
start(spec: ShellExecSpec): ShellProcess;
|
|
57
|
+
/**
|
|
58
|
+
* Stamp per-process sandbox facts before `done` settles. Full-access
|
|
59
|
+
* processes have no facts; signal deaths are not denials.
|
|
60
|
+
*/
|
|
61
|
+
protected onProcessDone(proc: ShellProcess, stderr: string, spawnFailed: boolean, spawnError?: unknown): void;
|
|
62
|
+
/**
|
|
63
|
+
* Wrap one pwsh invocation via the `ctx.sandbox` provider. Provider errors
|
|
64
|
+
* propagate unchanged; the returned argv is handed directly to the local
|
|
65
|
+
* executor's subprocess path. The parent class's `argv(spec)` builds the
|
|
66
|
+
* exact pwsh invocation this package knows how to confine.
|
|
67
|
+
* @param spec - resolved execution spec whose pwsh argv is confined.
|
|
68
|
+
* @param policy - resolved confined execution policy.
|
|
69
|
+
* @returns the provider's exact argv and settlement-classification facts.
|
|
70
|
+
*/
|
|
71
|
+
private confine;
|
|
72
|
+
}
|
|
73
|
+
export default SandboxPwshExecutor;
|
|
74
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEpG,OAAO,KAAK,EAMV,WAAW,EAEZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGjE;;;;;;GAMG;AACH,MAAM,MAAM,MAAM,GAAG,WAAW,CAAA;AAEhC;;;;;;GAMG;AAEH,qBAAa,mBAAoB,SAAQ,iBAAiB;IACxD,OAAgB,MAAM,WAA6C;IAMnE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAOzB;gBAEQ,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;IAOxC,8EAA8E;IAC9E,IAAa,WAAW,IAAI,WAAW,CAEtC;IAED;;;;OAIG;IACM,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa;IAQ3C,GAAG,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IA4BvD,KAAK,CAAC,IAAI,EAAE,aAAa,GAAG,YAAY;IA8BjD;;;OAGG;cACgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI;IAmBtH;;;;;;;;OAQG;IACH,OAAO,CAAC,OAAO;CAGhB;AAGD,eAAe,mBAAmB,CAAA"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-consuming PowerShell executor — the pwsh twin of
|
|
3
|
+
* `@bo-agent/bash-sandbox`. It wraps the exact local pwsh argv through
|
|
4
|
+
* `ctx.sandbox` (which on Windows resolves to the ACL restricted-token
|
|
5
|
+
* runner chain), inherits local process mechanics, and reports the selected
|
|
6
|
+
* mode, enforcement, and denial facts. Positive runner-launch evidence means
|
|
7
|
+
* the command never ran: foreground calls throw `SANDBOX_UNAVAILABLE`, while
|
|
8
|
+
* background processes carry `runnerFailed`; other spawn rejections retain
|
|
9
|
+
* local-executor semantics. The tool layer is unchanged. Tool calls pass
|
|
10
|
+
* the calling session's resolved policy; direct calls fall back to
|
|
11
|
+
* deployment policy. `result.sandbox` reports the mode and enforcement
|
|
12
|
+
* actually used.
|
|
13
|
+
*
|
|
14
|
+
* @module @bo-agent/pwsh-sandbox
|
|
15
|
+
*/
|
|
16
|
+
import { SandboxUnavailableError } from '@bo-agent/sandbox';
|
|
17
|
+
import { PwshLocalExecutor } from '@bo-agent/pwsh-local';
|
|
18
|
+
import { classifyDenial, classifyRunnerFailure, isRunnerSpawnFailure, matchesSignature } from "./helpers.js";
|
|
19
|
+
/**
|
|
20
|
+
* Registers as `ctx.shell` in place of the local pwsh executor and requires
|
|
21
|
+
* a `ctx.sandbox` provider plus `ctx.sandboxPolicy`; the tool layer is
|
|
22
|
+
* unchanged. Tool calls pass the calling session's resolved policy; direct
|
|
23
|
+
* calls fall back to deployment policy. `result.sandbox` reports the mode
|
|
24
|
+
* and enforcement actually used.
|
|
25
|
+
*/
|
|
26
|
+
/* jscpd:ignore-start -- deliberate call-for-call mirror of bash-sandbox's executor (pwsh-tool-and-executor Agent Note) */
|
|
27
|
+
export class SandboxPwshExecutor extends PwshLocalExecutor {
|
|
28
|
+
static inject = ['subprocess', 'sandbox', 'sandboxPolicy'];
|
|
29
|
+
// No own Config: the sandbox default (mode + workspaceRoot) is owned by
|
|
30
|
+
// ctx.sandboxPolicy, so this executor inherits PwshLocalExecutor's Config
|
|
31
|
+
// verbatim (the config catalog walks the inherited static).
|
|
32
|
+
mode;
|
|
33
|
+
/**
|
|
34
|
+
* Per-process confinement facts retained until settlement. Providers may
|
|
35
|
+
* vary enforcement and diagnostic dialect between overlapping calls, so a
|
|
36
|
+
* shared latest-wrap value would classify a process against the wrong facts.
|
|
37
|
+
* Unconfined processes have no entry.
|
|
38
|
+
*/
|
|
39
|
+
processFacts = new Map();
|
|
40
|
+
constructor(ctx, config) {
|
|
41
|
+
super(ctx, config);
|
|
42
|
+
// The default mode is the capability fact used for schema advertisement;
|
|
43
|
+
// actual tool executions carry their resolved per-call policy.
|
|
44
|
+
this.mode = ctx.sandboxPolicy.defaultMode;
|
|
45
|
+
}
|
|
46
|
+
/** The configured default mode — the capability fact the tool layer reads. */
|
|
47
|
+
get sandboxMode() {
|
|
48
|
+
return this.mode;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Stamp a complete per-call policy onto the spec. Tool calls supply the
|
|
52
|
+
* calling session's resolved mode and root; lower-level callers fall back
|
|
53
|
+
* to the deployment policy.
|
|
54
|
+
*/
|
|
55
|
+
resolve(request) {
|
|
56
|
+
return {
|
|
57
|
+
...super.resolve(request),
|
|
58
|
+
sandboxPolicy: request.sandboxPolicy
|
|
59
|
+
?? this.ctx.sandboxPolicy.resolve(),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
async run(spec) {
|
|
63
|
+
const policy = spec.sandboxPolicy;
|
|
64
|
+
const { mode } = policy;
|
|
65
|
+
if (mode === 'danger-full-access') {
|
|
66
|
+
const result = await super.run(spec);
|
|
67
|
+
return { ...result, sandbox: { mode, denied: false } };
|
|
68
|
+
}
|
|
69
|
+
const confined = this.confine(spec, { ...policy, mode });
|
|
70
|
+
let result;
|
|
71
|
+
try {
|
|
72
|
+
result = await this.runArgv(spec, confined.argv);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
// An upstream abort remains cancellation even when it prevents spawn.
|
|
76
|
+
if (spec.signal?.aborted === true)
|
|
77
|
+
spec.signal.throwIfAborted();
|
|
78
|
+
if (isRunnerSpawnFailure(error, confined.argv[0], spec.workdir)) {
|
|
79
|
+
throw new SandboxUnavailableError(mode, String(error));
|
|
80
|
+
}
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
// Runner failure outranks denial because the command did not run. Carry
|
|
84
|
+
// the matched fatal line, not an informational line that preceded it.
|
|
85
|
+
const runnerFailure = classifyRunnerFailure(result.exitCode, result.stderr.text, confined.runnerFailureRules);
|
|
86
|
+
if (runnerFailure !== undefined) {
|
|
87
|
+
throw new SandboxUnavailableError(mode, runnerFailure.detail);
|
|
88
|
+
}
|
|
89
|
+
return { ...result, sandbox: { mode, denied: classifyDenial(result, confined.denialSignatures), enforcement: confined.enforcement } };
|
|
90
|
+
}
|
|
91
|
+
start(spec) {
|
|
92
|
+
const policy = spec.sandboxPolicy;
|
|
93
|
+
const { mode } = policy;
|
|
94
|
+
if (mode === 'danger-full-access')
|
|
95
|
+
return super.start(spec);
|
|
96
|
+
// Once startArgv returns, install facts synchronously; promise settlement
|
|
97
|
+
// cannot run before start() returns.
|
|
98
|
+
const confined = this.confine(spec, { ...policy, mode });
|
|
99
|
+
let proc;
|
|
100
|
+
try {
|
|
101
|
+
proc = this.startArgv(spec, confined.argv);
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
// LocalSubprocessRuntime reports ENOENT/EACCES with the failed executable path through async
|
|
105
|
+
// `done` rejection; this covers alternatives that throw the same error synchronously.
|
|
106
|
+
if (isRunnerSpawnFailure(error, confined.argv[0], spec.workdir)) {
|
|
107
|
+
throw new SandboxUnavailableError(mode, String(error));
|
|
108
|
+
}
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
111
|
+
const { enforcement, denialSignatures, runnerFailureRules } = confined;
|
|
112
|
+
this.processFacts.set(proc, {
|
|
113
|
+
mode,
|
|
114
|
+
enforcement,
|
|
115
|
+
denialSignatures,
|
|
116
|
+
runnerFailureRules,
|
|
117
|
+
runnerProgram: confined.argv[0],
|
|
118
|
+
workdir: spec.workdir,
|
|
119
|
+
});
|
|
120
|
+
return proc;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Stamp per-process sandbox facts before `done` settles. Full-access
|
|
124
|
+
* processes have no facts; signal deaths are not denials.
|
|
125
|
+
*/
|
|
126
|
+
onProcessDone(proc, stderr, spawnFailed, spawnError) {
|
|
127
|
+
const facts = this.processFacts.get(proc);
|
|
128
|
+
if (facts !== undefined) {
|
|
129
|
+
this.processFacts.delete(proc);
|
|
130
|
+
// A rejected spawn never started the confined launch. Otherwise runner
|
|
131
|
+
// failure outranks denial because its diagnostics may contain denial terms.
|
|
132
|
+
const runnerFailed = spawnFailed
|
|
133
|
+
? isRunnerSpawnFailure(spawnError, facts.runnerProgram, facts.workdir)
|
|
134
|
+
: classifyRunnerFailure(proc.exitCode, stderr, facts.runnerFailureRules) !== undefined;
|
|
135
|
+
proc.sandbox = {
|
|
136
|
+
mode: facts.mode,
|
|
137
|
+
denied: !runnerFailed && matchesSignature(proc.exitCode, stderr, facts.denialSignatures),
|
|
138
|
+
enforcement: facts.enforcement,
|
|
139
|
+
...(runnerFailed ? { runnerFailed } : {}),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
super.onProcessDone(proc, stderr, spawnFailed, spawnError);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Wrap one pwsh invocation via the `ctx.sandbox` provider. Provider errors
|
|
146
|
+
* propagate unchanged; the returned argv is handed directly to the local
|
|
147
|
+
* executor's subprocess path. The parent class's `argv(spec)` builds the
|
|
148
|
+
* exact pwsh invocation this package knows how to confine.
|
|
149
|
+
* @param spec - resolved execution spec whose pwsh argv is confined.
|
|
150
|
+
* @param policy - resolved confined execution policy.
|
|
151
|
+
* @returns the provider's exact argv and settlement-classification facts.
|
|
152
|
+
*/
|
|
153
|
+
confine(spec, policy) {
|
|
154
|
+
return this.ctx.sandbox.confine(this.argv(spec), policy);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/* jscpd:ignore-end */
|
|
158
|
+
export default SandboxPwshExecutor;
|
|
159
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bo-agent/pwsh-sandbox",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"types": "./lib/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./lib/index.d.ts",
|
|
10
|
+
"import": "./lib/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"cordis": "4.0.0-rc.10",
|
|
15
|
+
"schemastery": "3.18.0",
|
|
16
|
+
"@bo-agent/bash-sandbox": "0.0.2",
|
|
17
|
+
"@bo-agent/pwsh-local": "0.0.2",
|
|
18
|
+
"@bo-agent/inline": "0.0.2",
|
|
19
|
+
"@bo-agent/sandbox": "0.0.2",
|
|
20
|
+
"@bo-agent/sandbox-policy": "0.0.2",
|
|
21
|
+
"@bo-agent/shell": "0.0.2"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT"
|
|
24
|
+
}
|
package/src/helpers.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal sandbox-result classification helpers.
|
|
3
|
+
*
|
|
4
|
+
* @module @bo-agent/pwsh-sandbox/helpers
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { accessSync, constants, statSync } from 'node:fs'
|
|
8
|
+
import type { ShellRunResult } from '@bo-agent/shell'
|
|
9
|
+
import type { RunnerFailureRule } from '@bo-agent/sandbox'
|
|
10
|
+
|
|
11
|
+
/** Node-local spawn codes proven to identify executable resolution or permission failure. */
|
|
12
|
+
const EXECUTABLE_SPAWN_CODES = new Set(['EACCES', 'ENOENT'])
|
|
13
|
+
|
|
14
|
+
/** Whether the caller-owned spawn cwd can be entered. */
|
|
15
|
+
function isUsableWorkdir(path: string): boolean {
|
|
16
|
+
try {
|
|
17
|
+
if (!statSync(path).isDirectory()) return false
|
|
18
|
+
accessSync(path, constants.X_OK)
|
|
19
|
+
return true
|
|
20
|
+
} catch {
|
|
21
|
+
return false
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Attribute only Node ENOENT/EACCES failures whose error path equals argv[0]
|
|
27
|
+
* after independently ruling out the caller-owned cwd. A supplied error path
|
|
28
|
+
* must exactly identify the runner; without one, the syscall must. With a
|
|
29
|
+
* usable cwd, these codes describe resolution or execute permission for that
|
|
30
|
+
* argv[0] or its shebang interpreter.
|
|
31
|
+
* The workdir is checked at classification time, not atomically with spawn;
|
|
32
|
+
* concurrent path replacement may change attribution but cannot permit an
|
|
33
|
+
* unconfined execution.
|
|
34
|
+
* @param error - the original spawn rejection.
|
|
35
|
+
* @param runnerProgram - provider argv[0], the executable that establishes confinement.
|
|
36
|
+
* @param workdir - the caller-owned spawn cwd, checked independently for usability.
|
|
37
|
+
* @returns whether the rejection has executable-specific runner evidence.
|
|
38
|
+
*/
|
|
39
|
+
export function isRunnerSpawnFailure(
|
|
40
|
+
error: unknown,
|
|
41
|
+
runnerProgram: string | undefined,
|
|
42
|
+
workdir: string,
|
|
43
|
+
): boolean {
|
|
44
|
+
if (runnerProgram === undefined || !isUsableWorkdir(workdir)) return false
|
|
45
|
+
if (typeof error !== 'object' || error === null) return false
|
|
46
|
+
const { code, path, syscall } = error as { code?: unknown; path?: unknown; syscall?: unknown }
|
|
47
|
+
if (typeof code !== 'string' || !EXECUTABLE_SPAWN_CODES.has(code)) return false
|
|
48
|
+
if (typeof syscall !== 'string') return false
|
|
49
|
+
const exactSyscall = `spawn ${runnerProgram}`
|
|
50
|
+
if (path === undefined) return syscall === exactSyscall
|
|
51
|
+
if (typeof path !== 'string' || path.length === 0 || path !== runnerProgram) return false
|
|
52
|
+
return syscall === 'spawn' || syscall === exactSyscall
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Fatal runner evidence retained for infrastructure-error detail. */
|
|
56
|
+
interface RunnerFailureMatch {
|
|
57
|
+
/** The original stderr line that matched a fatal signature. */
|
|
58
|
+
detail: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Classify a failed run against the selected backend's denial dialect.
|
|
63
|
+
* @param result - settled foreground run.
|
|
64
|
+
* @param signatures - case-insensitive denial substrings from the active wrap.
|
|
65
|
+
* @returns whether the failed run matches that denial dialect.
|
|
66
|
+
*/
|
|
67
|
+
export function classifyDenial(result: ShellRunResult, signatures: readonly string[]): boolean {
|
|
68
|
+
return matchesSignature(result.exitCode, result.stderr.text, signatures)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Classify one settled process against the selected backend's structured
|
|
73
|
+
* runner-failure rules. Each rule requires a nonzero exit, its optional
|
|
74
|
+
* exit-code gate, and a fatal signature on one stderr line after exact
|
|
75
|
+
* informational lines are excluded.
|
|
76
|
+
* @param exitCode - process exit code; null means signal termination.
|
|
77
|
+
* @param stderr - collected stderr text, left unchanged.
|
|
78
|
+
* @param rules - structured runner-failure rules from the active wrap.
|
|
79
|
+
* @returns the first matching fatal line, or undefined when evidence is insufficient.
|
|
80
|
+
*/
|
|
81
|
+
export function classifyRunnerFailure(
|
|
82
|
+
exitCode: number | null,
|
|
83
|
+
stderr: string,
|
|
84
|
+
rules: readonly RunnerFailureRule[],
|
|
85
|
+
): RunnerFailureMatch | undefined {
|
|
86
|
+
if (exitCode === null || exitCode === 0) return undefined
|
|
87
|
+
const lines = stderr.split(/\r?\n/)
|
|
88
|
+
for (const rule of rules) {
|
|
89
|
+
if (rule.allowedExitCodes !== undefined && !rule.allowedExitCodes.includes(exitCode)) continue
|
|
90
|
+
const informationalLines = new Set((rule.informationalLines ?? []).map(line => line.toLowerCase()))
|
|
91
|
+
// An empty or whitespace-only substring is not meaningful runner evidence.
|
|
92
|
+
// Ignore it while keeping any valid signatures beside it active.
|
|
93
|
+
const fatalSignatures = rule.fatalSignatures
|
|
94
|
+
.filter(signature => signature.trim().length > 0)
|
|
95
|
+
.map(signature => signature.toLowerCase())
|
|
96
|
+
for (const line of lines) {
|
|
97
|
+
const lowered = line.toLowerCase()
|
|
98
|
+
if (informationalLines.has(lowered)) continue
|
|
99
|
+
if (fatalSignatures.some(signature => lowered.includes(signature))) return { detail: line }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return undefined
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Match a non-zero exit against case-insensitive stderr signatures.
|
|
107
|
+
* @param exitCode - process exit code; null means signal termination.
|
|
108
|
+
* @param stderr - collected stderr text.
|
|
109
|
+
* @param signatures - substrings identifying the selected backend's dialect.
|
|
110
|
+
* @returns whether this is a non-zero exit whose stderr matches a signature.
|
|
111
|
+
*/
|
|
112
|
+
export function matchesSignature(exitCode: number | null, stderr: string, signatures: readonly string[]): boolean {
|
|
113
|
+
if (exitCode === null || exitCode === 0) return false
|
|
114
|
+
const lowered = stderr.toLowerCase()
|
|
115
|
+
return signatures.some(signature => lowered.includes(signature.toLowerCase()))
|
|
116
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox-consuming PowerShell executor — the pwsh twin of
|
|
3
|
+
* `@bo-agent/bash-sandbox`. It wraps the exact local pwsh argv through
|
|
4
|
+
* `ctx.sandbox` (which on Windows resolves to the ACL restricted-token
|
|
5
|
+
* runner chain), inherits local process mechanics, and reports the selected
|
|
6
|
+
* mode, enforcement, and denial facts. Positive runner-launch evidence means
|
|
7
|
+
* the command never ran: foreground calls throw `SANDBOX_UNAVAILABLE`, while
|
|
8
|
+
* background processes carry `runnerFailed`; other spawn rejections retain
|
|
9
|
+
* local-executor semantics. The tool layer is unchanged. Tool calls pass
|
|
10
|
+
* the calling session's resolved policy; direct calls fall back to
|
|
11
|
+
* deployment policy. `result.sandbox` reports the mode and enforcement
|
|
12
|
+
* actually used.
|
|
13
|
+
*
|
|
14
|
+
* @module @bo-agent/pwsh-sandbox
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Context } from 'cordis'
|
|
18
|
+
import type { ShellExecRequest, ShellExecSpec, ShellProcess, ShellRunResult } from '@bo-agent/shell'
|
|
19
|
+
import { SandboxUnavailableError } from '@bo-agent/sandbox'
|
|
20
|
+
import type {
|
|
21
|
+
ConfinedArgv,
|
|
22
|
+
ConfinedSandboxMode,
|
|
23
|
+
RunnerFailureRule,
|
|
24
|
+
SandboxEnforcement,
|
|
25
|
+
SandboxExecutionPolicy,
|
|
26
|
+
SandboxMode,
|
|
27
|
+
SandboxPolicy,
|
|
28
|
+
} from '@bo-agent/sandbox'
|
|
29
|
+
import { PwshLocalExecutor } from '@bo-agent/pwsh-local'
|
|
30
|
+
import type { Config as LocalConfig } from '@bo-agent/pwsh-local'
|
|
31
|
+
import { classifyDenial, classifyRunnerFailure, isRunnerSpawnFailure, matchesSignature } from './helpers.ts'
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Plugin config: the local executor's knobs, verbatim. The sandbox policy —
|
|
35
|
+
* the default mode and fallback `workspace-write` root — is NOT here: it
|
|
36
|
+
* lives on `ctx.sandboxPolicy`, which resolves each calling session's mode
|
|
37
|
+
* and cwd for every enforcing capability. The runner choice is likewise the
|
|
38
|
+
* `ctx.sandbox` provider's config, not this executor's.
|
|
39
|
+
*/
|
|
40
|
+
export type Config = LocalConfig
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Registers as `ctx.shell` in place of the local pwsh executor and requires
|
|
44
|
+
* a `ctx.sandbox` provider plus `ctx.sandboxPolicy`; the tool layer is
|
|
45
|
+
* unchanged. Tool calls pass the calling session's resolved policy; direct
|
|
46
|
+
* calls fall back to deployment policy. `result.sandbox` reports the mode
|
|
47
|
+
* and enforcement actually used.
|
|
48
|
+
*/
|
|
49
|
+
/* jscpd:ignore-start -- deliberate call-for-call mirror of bash-sandbox's executor (pwsh-tool-and-executor Agent Note) */
|
|
50
|
+
export class SandboxPwshExecutor extends PwshLocalExecutor {
|
|
51
|
+
static override inject = ['subprocess', 'sandbox', 'sandboxPolicy']
|
|
52
|
+
|
|
53
|
+
// No own Config: the sandbox default (mode + workspaceRoot) is owned by
|
|
54
|
+
// ctx.sandboxPolicy, so this executor inherits PwshLocalExecutor's Config
|
|
55
|
+
// verbatim (the config catalog walks the inherited static).
|
|
56
|
+
|
|
57
|
+
private readonly mode: SandboxMode
|
|
58
|
+
/**
|
|
59
|
+
* Per-process confinement facts retained until settlement. Providers may
|
|
60
|
+
* vary enforcement and diagnostic dialect between overlapping calls, so a
|
|
61
|
+
* shared latest-wrap value would classify a process against the wrong facts.
|
|
62
|
+
* Unconfined processes have no entry.
|
|
63
|
+
*/
|
|
64
|
+
private readonly processFacts = new Map<ShellProcess, {
|
|
65
|
+
mode: ConfinedSandboxMode
|
|
66
|
+
enforcement: SandboxEnforcement
|
|
67
|
+
denialSignatures: readonly string[]
|
|
68
|
+
runnerFailureRules: readonly RunnerFailureRule[]
|
|
69
|
+
runnerProgram: string | undefined
|
|
70
|
+
workdir: string
|
|
71
|
+
}>()
|
|
72
|
+
|
|
73
|
+
constructor(ctx: Context, config: Config) {
|
|
74
|
+
super(ctx, config)
|
|
75
|
+
// The default mode is the capability fact used for schema advertisement;
|
|
76
|
+
// actual tool executions carry their resolved per-call policy.
|
|
77
|
+
this.mode = (ctx as unknown as { sandboxPolicy: { defaultMode: SandboxMode } }).sandboxPolicy.defaultMode
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The configured default mode — the capability fact the tool layer reads. */
|
|
81
|
+
override get sandboxMode(): SandboxMode {
|
|
82
|
+
return this.mode
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Stamp a complete per-call policy onto the spec. Tool calls supply the
|
|
87
|
+
* calling session's resolved mode and root; lower-level callers fall back
|
|
88
|
+
* to the deployment policy.
|
|
89
|
+
*/
|
|
90
|
+
override resolve(request: ShellExecRequest): ShellExecSpec {
|
|
91
|
+
return {
|
|
92
|
+
...super.resolve(request),
|
|
93
|
+
sandboxPolicy: request.sandboxPolicy
|
|
94
|
+
?? (this.ctx as unknown as { sandboxPolicy: { resolve(): import('@bo-agent/sandbox').SandboxExecutionPolicy } }).sandboxPolicy.resolve(),
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
override async run(spec: ShellExecSpec): Promise<ShellRunResult> {
|
|
99
|
+
const policy = spec.sandboxPolicy as SandboxExecutionPolicy
|
|
100
|
+
const { mode } = policy
|
|
101
|
+
if (mode === 'danger-full-access') {
|
|
102
|
+
const result = await super.run(spec)
|
|
103
|
+
return { ...result, sandbox: { mode, denied: false } }
|
|
104
|
+
}
|
|
105
|
+
const confined = this.confine(spec, { ...policy, mode })
|
|
106
|
+
let result: ShellRunResult
|
|
107
|
+
try {
|
|
108
|
+
result = await this.runArgv(spec, confined.argv)
|
|
109
|
+
} catch (error) {
|
|
110
|
+
// An upstream abort remains cancellation even when it prevents spawn.
|
|
111
|
+
if (spec.signal?.aborted === true) spec.signal.throwIfAborted()
|
|
112
|
+
if (isRunnerSpawnFailure(error, confined.argv[0], spec.workdir)) {
|
|
113
|
+
throw new SandboxUnavailableError(mode, String(error))
|
|
114
|
+
}
|
|
115
|
+
throw error
|
|
116
|
+
}
|
|
117
|
+
// Runner failure outranks denial because the command did not run. Carry
|
|
118
|
+
// the matched fatal line, not an informational line that preceded it.
|
|
119
|
+
const runnerFailure = classifyRunnerFailure(result.exitCode, result.stderr.text, confined.runnerFailureRules)
|
|
120
|
+
if (runnerFailure !== undefined) {
|
|
121
|
+
throw new SandboxUnavailableError(mode, runnerFailure.detail)
|
|
122
|
+
}
|
|
123
|
+
return { ...result, sandbox: { mode, denied: classifyDenial(result, confined.denialSignatures), enforcement: confined.enforcement } }
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
override start(spec: ShellExecSpec): ShellProcess {
|
|
127
|
+
const policy = spec.sandboxPolicy as SandboxExecutionPolicy
|
|
128
|
+
const { mode } = policy
|
|
129
|
+
if (mode === 'danger-full-access') return super.start(spec)
|
|
130
|
+
// Once startArgv returns, install facts synchronously; promise settlement
|
|
131
|
+
// cannot run before start() returns.
|
|
132
|
+
const confined = this.confine(spec, { ...policy, mode })
|
|
133
|
+
let proc: ShellProcess
|
|
134
|
+
try {
|
|
135
|
+
proc = this.startArgv(spec, confined.argv)
|
|
136
|
+
} catch (error) {
|
|
137
|
+
// LocalSubprocessRuntime reports ENOENT/EACCES with the failed executable path through async
|
|
138
|
+
// `done` rejection; this covers alternatives that throw the same error synchronously.
|
|
139
|
+
if (isRunnerSpawnFailure(error, confined.argv[0], spec.workdir)) {
|
|
140
|
+
throw new SandboxUnavailableError(mode, String(error))
|
|
141
|
+
}
|
|
142
|
+
throw error
|
|
143
|
+
}
|
|
144
|
+
const { enforcement, denialSignatures, runnerFailureRules } = confined
|
|
145
|
+
this.processFacts.set(proc, {
|
|
146
|
+
mode,
|
|
147
|
+
enforcement,
|
|
148
|
+
denialSignatures,
|
|
149
|
+
runnerFailureRules,
|
|
150
|
+
runnerProgram: confined.argv[0],
|
|
151
|
+
workdir: spec.workdir,
|
|
152
|
+
})
|
|
153
|
+
return proc
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Stamp per-process sandbox facts before `done` settles. Full-access
|
|
158
|
+
* processes have no facts; signal deaths are not denials.
|
|
159
|
+
*/
|
|
160
|
+
protected override onProcessDone(proc: ShellProcess, stderr: string, spawnFailed: boolean, spawnError?: unknown): void {
|
|
161
|
+
const facts = this.processFacts.get(proc)
|
|
162
|
+
if (facts !== undefined) {
|
|
163
|
+
this.processFacts.delete(proc)
|
|
164
|
+
// A rejected spawn never started the confined launch. Otherwise runner
|
|
165
|
+
// failure outranks denial because its diagnostics may contain denial terms.
|
|
166
|
+
const runnerFailed = spawnFailed
|
|
167
|
+
? isRunnerSpawnFailure(spawnError, facts.runnerProgram, facts.workdir)
|
|
168
|
+
: classifyRunnerFailure(proc.exitCode, stderr, facts.runnerFailureRules) !== undefined
|
|
169
|
+
proc.sandbox = {
|
|
170
|
+
mode: facts.mode,
|
|
171
|
+
denied: !runnerFailed && matchesSignature(proc.exitCode, stderr, facts.denialSignatures),
|
|
172
|
+
enforcement: facts.enforcement,
|
|
173
|
+
...(runnerFailed ? { runnerFailed } : {}),
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
super.onProcessDone(proc, stderr, spawnFailed, spawnError)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Wrap one pwsh invocation via the `ctx.sandbox` provider. Provider errors
|
|
181
|
+
* propagate unchanged; the returned argv is handed directly to the local
|
|
182
|
+
* executor's subprocess path. The parent class's `argv(spec)` builds the
|
|
183
|
+
* exact pwsh invocation this package knows how to confine.
|
|
184
|
+
* @param spec - resolved execution spec whose pwsh argv is confined.
|
|
185
|
+
* @param policy - resolved confined execution policy.
|
|
186
|
+
* @returns the provider's exact argv and settlement-classification facts.
|
|
187
|
+
*/
|
|
188
|
+
private confine(spec: ShellExecSpec, policy: SandboxPolicy): ConfinedArgv {
|
|
189
|
+
return this.ctx.sandbox.confine(this.argv(spec), policy)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/* jscpd:ignore-end */
|
|
193
|
+
|
|
194
|
+
export default SandboxPwshExecutor
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2024",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"composite": true,
|
|
10
|
+
"incremental": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"rewriteRelativeImportExtensions": true,
|
|
15
|
+
"verbatimModuleSyntax": false,
|
|
16
|
+
"strict": true,
|
|
17
|
+
"noUncheckedIndexedAccess": true,
|
|
18
|
+
"exactOptionalPropertyTypes": true,
|
|
19
|
+
"noImplicitOverride": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUnusedLocals": false,
|
|
22
|
+
"noUnusedParameters": false,
|
|
23
|
+
"types": ["node"],
|
|
24
|
+
"outDir": "lib",
|
|
25
|
+
"rootDir": "src",
|
|
26
|
+
"tsBuildInfoFile": "lib/.tsbuildinfo",
|
|
27
|
+
"paths": {
|
|
28
|
+
"@bo-agent/inline": ["../inline/src"],
|
|
29
|
+
"@bo-agent/sandbox": ["../sandbox/src"],
|
|
30
|
+
"@bo-agent/shell": ["../shell/src"],
|
|
31
|
+
"@bo-agent/pwsh-local": ["../pwsh-local/src"],
|
|
32
|
+
"@bo-agent/sandbox-policy": ["../sandbox-policy/src"]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"include": ["src"],
|
|
36
|
+
"references": [
|
|
37
|
+
{ "path": "../inline" },
|
|
38
|
+
{ "path": "../sandbox" },
|
|
39
|
+
{ "path": "../shell" },
|
|
40
|
+
{ "path": "../pwsh-local" },
|
|
41
|
+
{ "path": "../sandbox-policy" }
|
|
42
|
+
]
|
|
43
|
+
}
|