stitchkit 0.132.3 → 0.133.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +178 -1
- package/README.md +4 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +12 -1
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +3 -1
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts +9 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-permission.d.ts +3 -2
- package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-probe.d.ts +10 -1
- package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +11 -2
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-turn.d.ts +13 -10
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +6 -0
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/record-router.d.ts +44 -0
- package/dist/agent-executor/claude/record-router.d.ts.map +1 -0
- package/dist/agent-executor/claude/session.d.ts +2 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/driver.d.ts +20 -2
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/engine-spawn.d.ts +18 -0
- package/dist/agent-executor/claude-sdk/engine-spawn.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +8 -11
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-manager.d.ts +4 -2
- package/dist/agent-executor/claude-sdk/query-manager.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-options.d.ts +1 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/capabilities.d.ts +8 -0
- package/dist/agent-executor/codex/capabilities.d.ts.map +1 -0
- package/dist/agent-executor/codex/connect.d.ts +6 -1
- package/dist/agent-executor/codex/connect.d.ts.map +1 -1
- package/dist/agent-executor/codex/driver.d.ts +10 -0
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/event-routing.d.ts +23 -1
- package/dist/agent-executor/codex/event-routing.d.ts.map +1 -1
- package/dist/agent-executor/codex/handlers.d.ts +23 -3
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
- package/dist/agent-executor/codex/limits.d.ts +17 -0
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +23 -3
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-bind.d.ts +6 -1
- package/dist/agent-executor/codex/session-bind.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-types.d.ts +5 -1
- package/dist/agent-executor/codex/session-types.d.ts.map +1 -1
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-thread.d.ts +6 -8
- package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
- package/dist/agent-executor/codex/thread-open.d.ts +12 -3
- package/dist/agent-executor/codex/thread-open.d.ts.map +1 -1
- package/dist/agent-executor/engine-requests.d.ts +42 -0
- package/dist/agent-executor/engine-requests.d.ts.map +1 -1
- package/dist/agent-executor/handoff-schemas.d.ts.map +1 -1
- package/dist/agent-executor/handoff.d.ts.map +1 -1
- package/dist/agent-executor/image-input.d.ts +6 -5
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/profile.d.ts +3 -5
- package/dist/agent-executor/profile.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +64 -3
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/testing/claude-sdk-stubs.d.ts +5 -0
- package/dist/agent-executor/testing/claude-sdk-stubs.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance-lifecycle.d.ts +11 -0
- package/dist/agent-executor/testing/conformance-lifecycle.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance-support.d.ts +23 -0
- package/dist/agent-executor/testing/conformance-support.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance.d.ts +7 -2
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
- package/dist/agent-executor/testing/consumer-stubs.d.ts +5 -3
- package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -1
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts +5 -1
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-driver.d.ts +6 -0
- package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-gate.d.ts +4 -1
- package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +2 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/operation-refusal.d.ts +10 -0
- package/dist/browser/operation-refusal.d.ts.map +1 -0
- package/dist/contract/client-types.d.ts +13 -4
- package/dist/contract/client-types.d.ts.map +1 -1
- package/dist/contract/define-validation.d.ts +6 -0
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts +3 -0
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/errors-factory.d.ts +8 -2
- package/dist/contract/errors-factory.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +9 -0
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/fingerprint.d.ts +4 -1
- package/dist/contract/fingerprint.d.ts.map +1 -1
- package/dist/contract/operation-refusals.d.ts +51 -0
- package/dist/contract/operation-refusals.d.ts.map +1 -0
- package/dist/contract/tool-options.d.ts +4 -0
- package/dist/contract/tool-options.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +253 -210
- package/dist/entrypoints/agent-executor/claude-sdk.js +248 -173
- package/dist/entrypoints/agent-executor/claude.js +57 -109
- package/dist/entrypoints/agent-executor/codex.js +412 -335
- package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts +3 -0
- package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/testing/claude-sdk.js +329 -0
- package/dist/entrypoints/agent-executor/testing.d.ts +1 -2
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/testing.js +413 -667
- package/dist/entrypoints/agent-executor.d.ts +1 -1
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +12 -12
- package/dist/entrypoints/agent-runtime/browser.js +2 -2
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +8 -8
- package/dist/entrypoints/agent-runtime/postgres.js +5 -5
- package/dist/entrypoints/agent-runtime/realtime.js +2 -2
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
- package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
- package/dist/entrypoints/agent-runtime/testing.js +5 -5
- package/dist/entrypoints/agent-runtime.js +26 -18
- package/dist/entrypoints/application/grammy.js +1 -1
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli.js +8 -8
- package/dist/entrypoints/contract.d.ts +3 -2
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +6 -4
- package/dist/entrypoints/files/packaging.d.ts +4 -1
- package/dist/entrypoints/files/packaging.d.ts.map +1 -1
- package/dist/entrypoints/files/packaging.js +1008 -168
- package/dist/entrypoints/files.js +1 -1
- package/dist/entrypoints/handler.js +7 -7
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +10 -8
- package/dist/entrypoints/node.js +11 -11
- package/dist/entrypoints/observability.js +1 -1
- package/dist/entrypoints/process/bootstrap.d.ts +3 -0
- package/dist/entrypoints/process/bootstrap.d.ts.map +1 -0
- package/dist/entrypoints/process/bootstrap.js +16 -0
- package/dist/entrypoints/process.js +7 -7
- package/dist/entrypoints/realtime.js +3 -3
- package/dist/entrypoints/remote.js +8 -7
- package/dist/entrypoints/server.js +30 -14
- package/dist/entrypoints/service-host/macos.js +72 -206
- package/dist/entrypoints/service-host/work.d.ts +15 -0
- package/dist/entrypoints/service-host/work.d.ts.map +1 -0
- package/dist/entrypoints/service-host/work.js +676 -0
- package/dist/entrypoints/service-host.js +146 -536
- package/dist/entrypoints/telegram/screens.js +4 -4
- package/dist/entrypoints/telegram.js +4 -4
- package/dist/entrypoints/testing.d.ts +2 -1
- package/dist/entrypoints/testing.d.ts.map +1 -1
- package/dist/entrypoints/testing.js +27 -8
- package/dist/entrypoints/tools/agent.js +6 -6
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +5 -5
- package/dist/entrypoints/tools/mcp.js +8 -6
- package/dist/entrypoints/tools/toolkit.js +11 -9
- package/dist/entrypoints/tools.js +19 -17
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/tracking/performance.js +3 -3
- package/dist/files/client-artifact.d.ts +14 -42
- package/dist/files/client-artifact.d.ts.map +1 -1
- package/dist/files/client-build.d.ts +57 -0
- package/dist/files/client-build.d.ts.map +1 -0
- package/dist/files/client-declarations.d.ts +35 -0
- package/dist/files/client-declarations.d.ts.map +1 -0
- package/dist/files/client-package-bundle.d.ts +25 -0
- package/dist/files/client-package-bundle.d.ts.map +1 -0
- package/dist/files/client-package-contract.d.ts +183 -0
- package/dist/files/client-package-contract.d.ts.map +1 -0
- package/dist/files/client-package-proof.d.ts +40 -0
- package/dist/files/client-package-proof.d.ts.map +1 -0
- package/dist/files/client-package.d.ts +17 -0
- package/dist/files/client-package.d.ts.map +1 -0
- package/dist/files/declaration-specifiers.d.ts +30 -0
- package/dist/files/declaration-specifiers.d.ts.map +1 -0
- package/dist/{index-v759mzed.js → index-02r5sq9p.js} +36 -23
- package/dist/{index-0r15pkjq.js → index-0k1ba0ss.js} +1 -1
- package/dist/{index-znd1b57f.js → index-1dn2wjq6.js} +5 -4
- package/dist/{index-p06z7g7w.js → index-1p8q0yrt.js} +6 -5
- package/dist/{index-wa6h4tz6.js → index-1qwd54n3.js} +6 -5
- package/dist/index-2dzc7mv9.js +174 -0
- package/dist/index-2mz8hj58.js +155 -0
- package/dist/{index-17qgm6xe.js → index-34k82crg.js} +2 -2
- package/dist/index-3mcbr8sx.js +349 -0
- package/dist/{index-ybdq8kk2.js → index-3y2tzhr8.js} +3 -3
- package/dist/{index-fgahdc7s.js → index-5n3a8hd8.js} +5 -3
- package/dist/{index-jb4m241t.js → index-6918kxbf.js} +45 -1
- package/dist/{index-n3bm7zqq.js → index-6kmjcm81.js} +4 -4
- package/dist/{index-akf0xkrm.js → index-78da4g74.js} +1 -1
- package/dist/{index-9pv126eh.js → index-7fjbdga8.js} +7 -1
- package/dist/{index-zhshhxew.js → index-8jf4bt7v.js} +1 -1
- package/dist/{index-p16q492v.js → index-8t9dr41h.js} +18 -5
- package/dist/{index-xq4s9mka.js → index-8yt3rwe7.js} +1 -1
- package/dist/{index-39c2hj6h.js → index-9c76vfxf.js} +7 -3
- package/dist/index-9ft4n9j1.js +432 -0
- package/dist/{index-sd4e5x5j.js → index-9wdrwx3b.js} +8 -7
- package/dist/{index-z114ax5e.js → index-an7vcmwf.js} +49 -2
- package/dist/{index-pzhqydxb.js → index-d04w81fz.js} +1 -1
- package/dist/index-d2drhb9c.js +219 -0
- package/dist/{index-8gmmdz7k.js → index-dacxr7nf.js} +1 -1
- package/dist/{index-dnzxxf8a.js → index-dm6nxkn1.js} +1 -1
- package/dist/index-dxft2mnm.js +42 -0
- package/dist/{index-rxh3qy4x.js → index-fzd477xk.js} +1 -1
- package/dist/{index-xgae0bn7.js → index-g4gstmp1.js} +2 -2
- package/dist/{index-athc412x.js → index-g5fgeb6v.js} +1 -1
- package/dist/{index-z9d74jmb.js → index-gbhj370g.js} +3 -3
- package/dist/{index-3fym4j8n.js → index-gtaaxe9d.js} +1 -1
- package/dist/{index-v59pxmf1.js → index-jpecjm30.js} +2 -2
- package/dist/index-k9g061ma.js +164 -0
- package/dist/{index-669374qc.js → index-ma26mfnt.js} +84 -315
- package/dist/{index-ryxb427v.js → index-msxf2r8x.js} +16 -3
- package/dist/{index-rbd2rq3z.js → index-nr4fhfn4.js} +1 -1
- package/dist/{index-qa2jjb65.js → index-pbekeqzm.js} +1 -1
- package/dist/{index-mkfhpk11.js → index-pq6g1k9t.js} +2 -2
- package/dist/{index-gya4hwh3.js → index-pws5c3x6.js} +21 -1
- package/dist/{index-x2fb37t0.js → index-q427q23r.js} +3 -2
- package/dist/{index-jcrj0b8z.js → index-qggqqja2.js} +39 -2
- package/dist/{index-jxtg307y.js → index-rkjfzs0a.js} +1 -1
- package/dist/{index-5tdc0q43.js → index-rw8ze745.js} +5 -3
- package/dist/index-s43tr4my.js +129 -0
- package/dist/{index-f9p62ean.js → index-stpy56r3.js} +175 -249
- package/dist/index-t5g5rm9n.js +213 -0
- package/dist/{index-z20pdxeb.js → index-tmv3ez1h.js} +3 -3
- package/dist/{index-dcsxj68j.js → index-tqjamnax.js} +1 -1
- package/dist/{index-j15dhkda.js → index-wddcfbng.js} +1 -325
- package/dist/{index-9sfhje6y.js → index-wh70tmpd.js} +24 -234
- package/dist/index-wxjv4sqx.js +82 -0
- package/dist/{index-qhjmmsm2.js → index-x46y9z26.js} +2 -2
- package/dist/{index-nk0cy9g1.js → index-y53cqwke.js} +1 -1
- package/dist/{index-sv5svtq7.js → index-y68gavb5.js} +1 -1
- package/dist/{index-5y7j383h.js → index-yrhw10ef.js} +1 -1
- package/dist/process/bootstrap.d.ts +12 -0
- package/dist/process/bootstrap.d.ts.map +1 -0
- package/dist/process/owner-loss-guard.d.ts +2 -9
- package/dist/process/owner-loss-guard.d.ts.map +1 -1
- package/dist/process/work-root.d.ts +20 -0
- package/dist/process/work-root.d.ts.map +1 -0
- package/dist/server/contract-identity.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts +12 -0
- package/dist/server/contract-method.d.ts.map +1 -1
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/types.d.ts +10 -9
- package/dist/server/types.d.ts.map +1 -1
- package/dist/service-host/host-adapter.d.ts +2 -0
- package/dist/service-host/host-adapter.d.ts.map +1 -1
- package/dist/service-host/work/command.d.ts +72 -0
- package/dist/service-host/work/command.d.ts.map +1 -0
- package/dist/service-host/work/errors.d.ts +29 -0
- package/dist/service-host/work/errors.d.ts.map +1 -0
- package/dist/service-host/work/host.d.ts +38 -0
- package/dist/service-host/work/host.d.ts.map +1 -0
- package/dist/service-host/work/launch.d.ts +51 -0
- package/dist/service-host/work/launch.d.ts.map +1 -0
- package/dist/service-host/work/membership.d.ts +51 -0
- package/dist/service-host/work/membership.d.ts.map +1 -0
- package/dist/service-host/work/origin.d.ts +79 -0
- package/dist/service-host/work/origin.d.ts.map +1 -0
- package/dist/service-host/work/owner.d.ts +45 -0
- package/dist/service-host/work/owner.d.ts.map +1 -0
- package/dist/service-host/work/placement.d.ts +55 -0
- package/dist/service-host/work/placement.d.ts.map +1 -0
- package/dist/service-host/work/probe.d.ts +24 -0
- package/dist/service-host/work/probe.d.ts.map +1 -0
- package/dist/service-host/work/scope-command.d.ts +68 -0
- package/dist/service-host/work/scope-command.d.ts.map +1 -0
- package/dist/sync/session.d.ts +4 -1
- package/dist/sync/session.d.ts.map +1 -1
- package/dist/testing/surface-manifest-digest.d.ts +2 -0
- package/dist/testing/surface-manifest-digest.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +32 -3
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +2 -0
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/stream-surface.d.ts.map +1 -1
- package/dist/tools/internal/mcp-projection.d.ts +58 -0
- package/dist/tools/internal/mcp-projection.d.ts.map +1 -0
- package/dist/tools/internal/surface-projector.d.ts +3 -47
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +2 -0
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +4 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +5 -2
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mount.d.ts +2 -0
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/schema/nesting-limit.d.ts +8 -0
- package/dist/tools/schema/nesting-limit.d.ts.map +1 -0
- package/dist/tools/schema/presentation.d.ts +7 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tools/surface.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +3 -3
- package/llms/agent-executor-claude-sdk.txt +1 -1
- package/llms/agent-executor-claude.txt +1 -1
- package/llms/agent-executor-codex.txt +1 -1
- package/llms/agent-executor-testing-claude-sdk.txt +28 -0
- package/llms/agent-executor-testing.txt +7 -8
- package/llms/agent-executor.txt +27 -4
- package/llms/agent-runtime.txt +1 -1
- package/llms/contract.txt +8 -2
- package/llms/files-packaging.txt +11 -6
- package/llms/process-bootstrap.txt +18 -0
- package/llms/process.2.txt +248 -18
- package/llms/process.txt +130 -92
- package/llms/server.4.txt +49 -1
- package/llms/service-host-work.txt +34 -0
- package/llms/stitchkit.2.txt +31 -0
- package/llms/stitchkit.txt +78 -75
- package/llms/sync.txt +5 -2
- package/llms/testing.txt +1 -0
- package/llms/tools.2.txt +747 -775
- package/llms/tools.3.txt +846 -210
- package/llms/tools.4.txt +226 -0
- package/llms/tools.txt +3 -790
- package/llms/{upgrading-0.128.0-0.132.0.txt → upgrading-0.128.0-0.133.0.txt} +194 -6
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +779 -135
- package/llms.txt +18 -16
- package/package.json +12 -4
- package/dist/entrypoints/process/owner-loss.d.ts +0 -3
- package/dist/entrypoints/process/owner-loss.d.ts.map +0 -1
- package/dist/entrypoints/process/owner-loss.js +0 -7
- package/llms/process-owner-loss.txt +0 -18
|
@@ -6,7 +6,13 @@ import {
|
|
|
6
6
|
loadDarwinBinding
|
|
7
7
|
} from "../../index-6kec3b14.js";
|
|
8
8
|
import {
|
|
9
|
-
computeSha256Hex
|
|
9
|
+
computeSha256Hex
|
|
10
|
+
} from "../../index-d2drhb9c.js";
|
|
11
|
+
import {
|
|
12
|
+
NativeCommandError2
|
|
13
|
+
} from "../../index-jpecjm30.js";
|
|
14
|
+
import"../../index-pbekeqzm.js";
|
|
15
|
+
import {
|
|
10
16
|
isProcessGoneError,
|
|
11
17
|
renderPlistStringElement,
|
|
12
18
|
renderPlistKeyElement,
|
|
@@ -15,18 +21,28 @@ import {
|
|
|
15
21
|
createDefaultLaunchdHostAdapter2,
|
|
16
22
|
lintLaunchdPlist2,
|
|
17
23
|
readLaunchdPlist2
|
|
18
|
-
} from "../../index-
|
|
19
|
-
import {
|
|
20
|
-
NativeCommandError2
|
|
21
|
-
} from "../../index-v59pxmf1.js";
|
|
22
|
-
import"../../index-qa2jjb65.js";
|
|
24
|
+
} from "../../index-wh70tmpd.js";
|
|
23
25
|
import {
|
|
24
26
|
sameProcessInstance,
|
|
25
27
|
observeProcessInstance2
|
|
26
28
|
} from "../../index-673drwkn.js";
|
|
27
29
|
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
CODESIGN_PATH2,
|
|
31
|
+
SECURITY_PATH2,
|
|
32
|
+
CLANG_PATH2,
|
|
33
|
+
SIPS_PATH2,
|
|
34
|
+
QLMANAGE_PATH2,
|
|
35
|
+
ICONUTIL_PATH2,
|
|
36
|
+
PS_PATH2,
|
|
37
|
+
createDefaultMacosCommandRunner2,
|
|
38
|
+
normalizeMacosSyntheticPath2,
|
|
39
|
+
macosPathKey,
|
|
40
|
+
canonicalizeMacosPath2,
|
|
41
|
+
isPathWithinDirectory2,
|
|
42
|
+
isProtectedMacosSystemPath,
|
|
43
|
+
isMacosForbiddenBuildRoot
|
|
44
|
+
} from "../../index-2mz8hj58.js";
|
|
45
|
+
import"../../index-d04w81fz.js";
|
|
30
46
|
import {
|
|
31
47
|
messageOf
|
|
32
48
|
} from "../../index-r9kq5ark.js";
|
|
@@ -44,7 +60,7 @@ import {
|
|
|
44
60
|
import { randomBytes } from "node:crypto";
|
|
45
61
|
import { constants as fsConstants } from "node:fs";
|
|
46
62
|
import { lstat as lstat2, mkdir as mkdir2, open, rename, rm as rm3, writeFile as writeFile3 } from "node:fs/promises";
|
|
47
|
-
import { basename, dirname as dirname2, join as join3, posix as
|
|
63
|
+
import { basename, dirname as dirname2, join as join3, posix as posix2 } from "node:path";
|
|
48
64
|
|
|
49
65
|
// src/service-host/macos/bundle-plist.ts
|
|
50
66
|
import { z } from "zod";
|
|
@@ -177,156 +193,6 @@ function computeBundleSpecDigest(spec, launcherSource) {
|
|
|
177
193
|
}));
|
|
178
194
|
}
|
|
179
195
|
|
|
180
|
-
// src/service-host/macos/runner.ts
|
|
181
|
-
import { realpath } from "node:fs/promises";
|
|
182
|
-
import { posix } from "node:path";
|
|
183
|
-
var CODESIGN_PATH = "/usr/bin/codesign";
|
|
184
|
-
var SECURITY_PATH = "/usr/bin/security";
|
|
185
|
-
var CLANG_PATH = "/usr/bin/clang";
|
|
186
|
-
var SIPS_PATH = "/usr/bin/sips";
|
|
187
|
-
var QLMANAGE_PATH = "/usr/bin/qlmanage";
|
|
188
|
-
var ICONUTIL_PATH = "/usr/bin/iconutil";
|
|
189
|
-
var PS_PATH = "/bin/ps";
|
|
190
|
-
var DEFAULT_TIMEOUT_MS = 60000;
|
|
191
|
-
var DEFAULT_MAX_OUTPUT_BYTES = 16 * 1024 * 1024;
|
|
192
|
-
var MAX_STREAMED_STDERR_BYTES = 64 * 1024;
|
|
193
|
-
var MACOS_COMMAND_PATH = "/usr/bin:/bin:/usr/sbin:/sbin";
|
|
194
|
-
var MACOS_COMMAND_KEYS = [
|
|
195
|
-
"HOME",
|
|
196
|
-
"TMPDIR",
|
|
197
|
-
"DEVELOPER_DIR",
|
|
198
|
-
"SDKROOT",
|
|
199
|
-
"TOOLCHAINS"
|
|
200
|
-
];
|
|
201
|
-
function macosCommandEnv(extra) {
|
|
202
|
-
const env = { PATH: MACOS_COMMAND_PATH };
|
|
203
|
-
for (const key of MACOS_COMMAND_KEYS) {
|
|
204
|
-
const value = process.env[key];
|
|
205
|
-
if (value !== undefined)
|
|
206
|
-
env[key] = value;
|
|
207
|
-
}
|
|
208
|
-
return { ...env, ...extra };
|
|
209
|
-
}
|
|
210
|
-
function createDefaultMacosCommandRunner() {
|
|
211
|
-
const decoder = new TextDecoder;
|
|
212
|
-
return {
|
|
213
|
-
async runCommand(executable, args, options) {
|
|
214
|
-
const timeoutMs = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
215
|
-
const env = macosCommandEnv(options?.env);
|
|
216
|
-
if (options?.onOutput !== undefined) {
|
|
217
|
-
const sink = options.onOutput;
|
|
218
|
-
const stderrChunks = [];
|
|
219
|
-
let stderrBytes = 0;
|
|
220
|
-
const result = await runNativeCommand2({
|
|
221
|
-
executable,
|
|
222
|
-
args: [...args],
|
|
223
|
-
envPolicy: "declared-only",
|
|
224
|
-
env,
|
|
225
|
-
capture: false,
|
|
226
|
-
timeoutMs,
|
|
227
|
-
...options.maxOutputBytes !== undefined ? { maxOutputBytes: options.maxOutputBytes } : {},
|
|
228
|
-
...options.stdin !== undefined ? { stdin: options.stdin } : {},
|
|
229
|
-
...options.cwd !== undefined ? { cwd: options.cwd } : {},
|
|
230
|
-
async onOutput(bytes, channel) {
|
|
231
|
-
if (channel === "stderr" && stderrBytes < MAX_STREAMED_STDERR_BYTES) {
|
|
232
|
-
const remaining = MAX_STREAMED_STDERR_BYTES - stderrBytes;
|
|
233
|
-
const slice = bytes.byteLength <= remaining ? bytes : bytes.subarray(0, remaining);
|
|
234
|
-
stderrChunks.push(slice.slice());
|
|
235
|
-
stderrBytes += slice.byteLength;
|
|
236
|
-
}
|
|
237
|
-
await sink(bytes, channel);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
const stderrCombined = new Uint8Array(stderrBytes);
|
|
241
|
-
let offset = 0;
|
|
242
|
-
for (const chunk of stderrChunks) {
|
|
243
|
-
stderrCombined.set(chunk, offset);
|
|
244
|
-
offset += chunk.byteLength;
|
|
245
|
-
}
|
|
246
|
-
return {
|
|
247
|
-
exitCode: result.exitCode ?? 1,
|
|
248
|
-
stdout: "",
|
|
249
|
-
stderr: decoder.decode(stderrCombined)
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
const result = await runNativeCommand2({
|
|
253
|
-
executable,
|
|
254
|
-
args: [...args],
|
|
255
|
-
envPolicy: "declared-only",
|
|
256
|
-
env,
|
|
257
|
-
capture: true,
|
|
258
|
-
maxOutputBytes: options?.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES,
|
|
259
|
-
timeoutMs,
|
|
260
|
-
...options?.stdin !== undefined ? { stdin: options.stdin } : {},
|
|
261
|
-
...options?.cwd !== undefined ? { cwd: options.cwd } : {}
|
|
262
|
-
});
|
|
263
|
-
return {
|
|
264
|
-
exitCode: result.exitCode ?? 1,
|
|
265
|
-
stdout: decoder.decode(result.stdout),
|
|
266
|
-
stderr: decoder.decode(result.stderr)
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
function normalizeMacosSyntheticPath(targetPath) {
|
|
272
|
-
const normalized = posix.normalize(targetPath).replace(/\/+$/, "");
|
|
273
|
-
if (normalized.length === 0)
|
|
274
|
-
return "/";
|
|
275
|
-
const lowered = normalized.toLowerCase();
|
|
276
|
-
if (lowered === "/var" || lowered.startsWith("/var/") || lowered === "/tmp" || lowered.startsWith("/tmp/") || lowered === "/etc" || lowered.startsWith("/etc/")) {
|
|
277
|
-
return `/private${normalized}`;
|
|
278
|
-
}
|
|
279
|
-
return normalized;
|
|
280
|
-
}
|
|
281
|
-
function macosPathKey(targetPath) {
|
|
282
|
-
return normalizeMacosSyntheticPath(targetPath).toLowerCase();
|
|
283
|
-
}
|
|
284
|
-
async function canonicalizeMacosPath(targetPath, realpathFn = realpath) {
|
|
285
|
-
try {
|
|
286
|
-
return normalizeMacosSyntheticPath(await realpathFn(targetPath));
|
|
287
|
-
} catch {
|
|
288
|
-
return normalizeMacosSyntheticPath(targetPath);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
function isPathWithinDirectory(candidate, directory) {
|
|
292
|
-
const normCandidate = macosPathKey(candidate);
|
|
293
|
-
const normDir = macosPathKey(directory);
|
|
294
|
-
if (normDir === "/")
|
|
295
|
-
return normCandidate.startsWith("/");
|
|
296
|
-
return normCandidate === normDir || normCandidate.startsWith(`${normDir}/`);
|
|
297
|
-
}
|
|
298
|
-
var APPLICATIONS_PREFIX = "/applications/";
|
|
299
|
-
var PROTECTED_SYSTEM_PREFIXES = [
|
|
300
|
-
"/system/",
|
|
301
|
-
APPLICATIONS_PREFIX,
|
|
302
|
-
"/library/apple/",
|
|
303
|
-
"/usr/",
|
|
304
|
-
"/bin/",
|
|
305
|
-
"/sbin/"
|
|
306
|
-
];
|
|
307
|
-
var FORBIDDEN_BUILD_ROOTS = new Set("/ /system /applications /library /library/apple /users /var /private /private/var /tmp /private/tmp /etc /private/etc /usr /bin /sbin".split(" "));
|
|
308
|
-
var USER_HOME_ROOT_PATTERN = /^\/users\/[^/]+$/;
|
|
309
|
-
function isProtectedMacosSystemPath(targetPath, options = { applications: "protected" }) {
|
|
310
|
-
const normalized = (posix.normalize(targetPath).replace(/\/+$/, "") || "/").toLowerCase();
|
|
311
|
-
const synthetic = macosPathKey(targetPath);
|
|
312
|
-
return PROTECTED_SYSTEM_PREFIXES.some((prefix) => {
|
|
313
|
-
if (prefix === APPLICATIONS_PREFIX && options.applications === "install-target")
|
|
314
|
-
return false;
|
|
315
|
-
const root = prefix.slice(0, -1);
|
|
316
|
-
return normalized === root || normalized.startsWith(prefix) || synthetic === root || synthetic.startsWith(prefix);
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
function isMacosForbiddenBuildRoot(targetPath) {
|
|
320
|
-
const rawLower = (posix.normalize(targetPath).replace(/\/+$/, "") || "/").toLowerCase();
|
|
321
|
-
const syntheticLower = macosPathKey(targetPath);
|
|
322
|
-
if (FORBIDDEN_BUILD_ROOTS.has(rawLower) || FORBIDDEN_BUILD_ROOTS.has(syntheticLower) || isProtectedMacosSystemPath(targetPath)) {
|
|
323
|
-
return true;
|
|
324
|
-
}
|
|
325
|
-
const strippedRaw = rawLower.startsWith("/private/") ? rawLower.slice("/private".length) : rawLower;
|
|
326
|
-
const strippedSynthetic = syntheticLower.startsWith("/private/") ? syntheticLower.slice("/private".length) : syntheticLower;
|
|
327
|
-
return USER_HOME_ROOT_PATTERN.test(strippedRaw) || USER_HOME_ROOT_PATTERN.test(strippedSynthetic);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
196
|
// src/service-host/macos/codesign.ts
|
|
331
197
|
var DEVELOPER_ID_PREFIX = "Developer ID Application:";
|
|
332
198
|
var DEVELOPER_ID_INTERMEDIATE_AUTHORITY = "Developer ID Certification Authority";
|
|
@@ -368,7 +234,7 @@ function parseDeveloperIdsOutput(stdout) {
|
|
|
368
234
|
return identities;
|
|
369
235
|
}
|
|
370
236
|
async function findDeveloperIds(options) {
|
|
371
|
-
const runner = options?.runner ??
|
|
237
|
+
const runner = options?.runner ?? createDefaultMacosCommandRunner2();
|
|
372
238
|
const args = ["find-identity", "-v", "-p", "codesigning"];
|
|
373
239
|
if (options?.keychain !== undefined) {
|
|
374
240
|
if (options.keychain.length === 0 || options.keychain.startsWith("-") || /[\0\r\n]/.test(options.keychain)) {
|
|
@@ -376,7 +242,7 @@ async function findDeveloperIds(options) {
|
|
|
376
242
|
}
|
|
377
243
|
args.push(options.keychain);
|
|
378
244
|
}
|
|
379
|
-
const result = await runner.runCommand(
|
|
245
|
+
const result = await runner.runCommand(SECURITY_PATH2, args, {
|
|
380
246
|
timeoutMs: options?.timeoutMs
|
|
381
247
|
});
|
|
382
248
|
if (result.exitCode !== 0) {
|
|
@@ -490,9 +356,9 @@ async function verifySignedBundle(options) {
|
|
|
490
356
|
if (!options.bundlePath.startsWith("/") || /[\0\r\n]/.test(options.bundlePath)) {
|
|
491
357
|
failVerify(`Invalid bundlePath: ${JSON.stringify(options.bundlePath)}`);
|
|
492
358
|
}
|
|
493
|
-
const runner = options.runner ??
|
|
359
|
+
const runner = options.runner ?? createDefaultMacosCommandRunner2();
|
|
494
360
|
const cmdOpts = { timeoutMs: options.timeoutMs };
|
|
495
|
-
const displayResult = await runner.runCommand(
|
|
361
|
+
const displayResult = await runner.runCommand(CODESIGN_PATH2, ["-dvvv", options.bundlePath], cmdOpts);
|
|
496
362
|
if (displayResult.exitCode !== 0) {
|
|
497
363
|
failVerify(`codesign -dvvv failed for ${options.bundlePath} (exit ${displayResult.exitCode}): ${displayResult.stderr.trim()}`);
|
|
498
364
|
}
|
|
@@ -516,7 +382,7 @@ async function verifySignedBundle(options) {
|
|
|
516
382
|
if ((options.requireHardenedRuntime ?? true) && !details.hasHardenedRuntime) {
|
|
517
383
|
failVerify(`Bundle ${options.bundlePath} is missing the hardened runtime flag`);
|
|
518
384
|
}
|
|
519
|
-
const verifyResult = await runner.runCommand(
|
|
385
|
+
const verifyResult = await runner.runCommand(CODESIGN_PATH2, [
|
|
520
386
|
"--verify",
|
|
521
387
|
"--deep",
|
|
522
388
|
"--strict",
|
|
@@ -540,7 +406,7 @@ async function signBundle(options) {
|
|
|
540
406
|
if (!options.bundlePath.startsWith("/") || /[\0\r\n]/.test(options.bundlePath)) {
|
|
541
407
|
throw new MacosCodesignError("COMMAND_FAILED", `Invalid bundlePath: ${JSON.stringify(options.bundlePath)}`);
|
|
542
408
|
}
|
|
543
|
-
const runner = options.runner ??
|
|
409
|
+
const runner = options.runner ?? createDefaultMacosCommandRunner2();
|
|
544
410
|
const validatedIdentity = await resolveSigningIdentity({
|
|
545
411
|
identity: options.identity,
|
|
546
412
|
runner,
|
|
@@ -560,7 +426,7 @@ async function signBundle(options) {
|
|
|
560
426
|
args.push("--entitlements", options.entitlementsPath);
|
|
561
427
|
}
|
|
562
428
|
args.push(options.bundlePath);
|
|
563
|
-
const result = await runner.runCommand(
|
|
429
|
+
const result = await runner.runCommand(CODESIGN_PATH2, args, {
|
|
564
430
|
timeoutMs: options.timeoutMs
|
|
565
431
|
});
|
|
566
432
|
if (result.exitCode !== 0) {
|
|
@@ -743,7 +609,7 @@ async function generateAppIconIcns(options) {
|
|
|
743
609
|
throw new MacosIconError("INVALID_SOURCE", `Invalid macOS icon source: ${parsedResult.error.message}`, { cause: parsedResult.error });
|
|
744
610
|
}
|
|
745
611
|
const source = parsedResult.data;
|
|
746
|
-
const runner = options.runner ??
|
|
612
|
+
const runner = options.runner ?? createDefaultMacosCommandRunner2();
|
|
747
613
|
const cmdOpts = options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : undefined;
|
|
748
614
|
const parentDir = dirname(options.outputPath);
|
|
749
615
|
await mkdir(parentDir, { recursive: true });
|
|
@@ -755,11 +621,11 @@ async function generateAppIconIcns(options) {
|
|
|
755
621
|
const svgPath = join(stagingDir, "icon.svg");
|
|
756
622
|
const qlOutPath = join(stagingDir, "icon.svg.png");
|
|
757
623
|
await writeFile(svgPath, svgDoc, "utf8");
|
|
758
|
-
const qlResult = await runner.runCommand(
|
|
624
|
+
const qlResult = await runner.runCommand(QLMANAGE_PATH2, ["-t", "-s", String(sizePx), "-o", stagingDir, svgPath], cmdOpts);
|
|
759
625
|
if (qlResult.exitCode !== 0) {
|
|
760
626
|
throw new MacosIconError("COMMAND_FAILED", `qlmanage failed to rasterize SVG (exit ${qlResult.exitCode}): ${qlResult.stderr.trim()}`);
|
|
761
627
|
}
|
|
762
|
-
const sipsResult = await runner.runCommand(
|
|
628
|
+
const sipsResult = await runner.runCommand(SIPS_PATH2, [
|
|
763
629
|
"-s",
|
|
764
630
|
"format",
|
|
765
631
|
"png",
|
|
@@ -805,12 +671,12 @@ async function generateAppIconIcns(options) {
|
|
|
805
671
|
await mkdir(iconsetDir, { recursive: true });
|
|
806
672
|
for (const slot of APPLE_ICONSET_SLOTS) {
|
|
807
673
|
const slotPath = join(iconsetDir, slot.filename);
|
|
808
|
-
const sipsResult = await runner.runCommand(
|
|
674
|
+
const sipsResult = await runner.runCommand(SIPS_PATH2, ["-z", String(slot.pixels), String(slot.pixels), masterPngPath, "--out", slotPath], cmdOpts);
|
|
809
675
|
if (sipsResult.exitCode !== 0) {
|
|
810
676
|
throw new MacosIconError("COMMAND_FAILED", `sips failed for ${slot.filename} (exit ${sipsResult.exitCode}): ${sipsResult.stderr.trim()}`);
|
|
811
677
|
}
|
|
812
678
|
}
|
|
813
|
-
const iconutilResult = await runner.runCommand(
|
|
679
|
+
const iconutilResult = await runner.runCommand(ICONUTIL_PATH2, ["-c", "icns", iconsetDir, "-o", stagedIcnsPath], cmdOpts);
|
|
814
680
|
if (iconutilResult.exitCode !== 0) {
|
|
815
681
|
throw new MacosIconError("COMMAND_FAILED", `iconutil failed (exit ${iconutilResult.exitCode}): ${iconutilResult.stderr.trim()}`);
|
|
816
682
|
}
|
|
@@ -830,9 +696,9 @@ async function generateAppIconIcns(options) {
|
|
|
830
696
|
}
|
|
831
697
|
|
|
832
698
|
// src/service-host/macos/launch-services.ts
|
|
833
|
-
import { lstat, realpath
|
|
699
|
+
import { lstat, realpath } from "node:fs/promises";
|
|
834
700
|
import { homedir } from "node:os";
|
|
835
|
-
import { posix
|
|
701
|
+
import { posix } from "node:path";
|
|
836
702
|
var LSREGISTER_PATH = "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";
|
|
837
703
|
var KLS_APPLICATION_NOT_FOUND_ERR = -10814;
|
|
838
704
|
var DEFAULT_LSREGISTER_DUMP_MAX_BYTES = 128 * 1024 * 1024;
|
|
@@ -866,7 +732,7 @@ function assertPositiveLimit(label, value, fallback) {
|
|
|
866
732
|
}
|
|
867
733
|
async function registerBundle(options) {
|
|
868
734
|
assertAbsolutePath("bundlePath", options.bundlePath);
|
|
869
|
-
const runner = options.runner ??
|
|
735
|
+
const runner = options.runner ?? createDefaultMacosCommandRunner2();
|
|
870
736
|
const result = await runner.runCommand(LSREGISTER_PATH, ["-f", options.bundlePath], {
|
|
871
737
|
timeoutMs: options.timeoutMs
|
|
872
738
|
});
|
|
@@ -876,7 +742,7 @@ async function registerBundle(options) {
|
|
|
876
742
|
}
|
|
877
743
|
async function forgetRegistration(options) {
|
|
878
744
|
assertAbsolutePath("bundlePath", options.bundlePath);
|
|
879
|
-
const runner = options.runner ??
|
|
745
|
+
const runner = options.runner ?? createDefaultMacosCommandRunner2();
|
|
880
746
|
const result = await runner.runCommand(LSREGISTER_PATH, ["-u", options.bundlePath], {
|
|
881
747
|
timeoutMs: options.timeoutMs
|
|
882
748
|
});
|
|
@@ -972,7 +838,7 @@ function parseLsregisterDump(dumpText) {
|
|
|
972
838
|
}
|
|
973
839
|
async function scanLsregisterDump(options) {
|
|
974
840
|
const maxDumpBytes = assertPositiveLimit("maxDumpBytes", options.maxDumpBytes, DEFAULT_LSREGISTER_DUMP_MAX_BYTES);
|
|
975
|
-
const runner = options.runner ??
|
|
841
|
+
const runner = options.runner ?? createDefaultMacosCommandRunner2();
|
|
976
842
|
const decoder = new TextDecoder("utf-8");
|
|
977
843
|
let totalBytes = 0;
|
|
978
844
|
let recordCount = 0;
|
|
@@ -1093,15 +959,15 @@ async function forgetStaleRegistrations(options) {
|
|
|
1093
959
|
if (bundleId?.includes("*") || bundleIdPrefix?.includes("*")) {
|
|
1094
960
|
failOptions("Wildcards are not permitted in bundleId or bundleIdPrefix");
|
|
1095
961
|
}
|
|
1096
|
-
const realpathFn = options.realpathFn ??
|
|
962
|
+
const realpathFn = options.realpathFn ?? realpath;
|
|
1097
963
|
const pathExists = options.pathExists ?? defaultPathExists;
|
|
1098
964
|
const keepCanonical = new Set;
|
|
1099
965
|
for (const keep of options.keepPaths ?? []) {
|
|
1100
966
|
assertAbsolutePath("keepPaths[]", keep);
|
|
1101
|
-
keepCanonical.add(macosPathKey(await
|
|
967
|
+
keepCanonical.add(macosPathKey(await canonicalizeMacosPath2(keep, realpathFn)));
|
|
1102
968
|
}
|
|
1103
969
|
return sweepRegistrations({ ...options, bundleId, bundleIdPrefix }, async (record) => {
|
|
1104
|
-
const canonicalRecord = await
|
|
970
|
+
const canonicalRecord = await canonicalizeMacosPath2(record.path, realpathFn);
|
|
1105
971
|
if (isProtectedMacosSystemPath(record.path) || isProtectedMacosSystemPath(canonicalRecord)) {
|
|
1106
972
|
return "protected";
|
|
1107
973
|
}
|
|
@@ -1117,7 +983,7 @@ async function resolveForbiddenHomes(realpathFn) {
|
|
|
1117
983
|
for (const raw of [homedir(), process.env.HOME]) {
|
|
1118
984
|
if (typeof raw === "string" && raw.startsWith("/") && raw.length > 1) {
|
|
1119
985
|
homes.add(macosPathKey(raw));
|
|
1120
|
-
homes.add(macosPathKey(await
|
|
986
|
+
homes.add(macosPathKey(await canonicalizeMacosPath2(raw, realpathFn)));
|
|
1121
987
|
}
|
|
1122
988
|
}
|
|
1123
989
|
return homes;
|
|
@@ -1127,16 +993,16 @@ async function forgetBuildTree(options) {
|
|
|
1127
993
|
if (options.buildDir.split("/").includes("..")) {
|
|
1128
994
|
failOptions(`buildDir must not contain '..' segments: ${options.buildDir}`);
|
|
1129
995
|
}
|
|
1130
|
-
const rawNormalized =
|
|
1131
|
-
const realpathFn = options.realpathFn ??
|
|
1132
|
-
const canonicalBuildDir = await
|
|
996
|
+
const rawNormalized = posix.normalize(options.buildDir).replace(/\/+$/, "") || "/";
|
|
997
|
+
const realpathFn = options.realpathFn ?? realpath;
|
|
998
|
+
const canonicalBuildDir = await canonicalizeMacosPath2(rawNormalized, realpathFn);
|
|
1133
999
|
const forbiddenHomes = await resolveForbiddenHomes(realpathFn);
|
|
1134
1000
|
if (isMacosForbiddenBuildRoot(rawNormalized) || isMacosForbiddenBuildRoot(canonicalBuildDir) || forbiddenHomes.has(macosPathKey(rawNormalized)) || forbiddenHomes.has(macosPathKey(canonicalBuildDir))) {
|
|
1135
1001
|
failOptions(`Refusing to sweep LaunchServices entries for root, home, or system directory: ${options.buildDir}`);
|
|
1136
1002
|
}
|
|
1137
1003
|
return sweepRegistrations(options, async (record) => {
|
|
1138
|
-
const canonicalRecord = await
|
|
1139
|
-
if (!
|
|
1004
|
+
const canonicalRecord = await canonicalizeMacosPath2(record.path, realpathFn);
|
|
1005
|
+
if (!isPathWithinDirectory2(canonicalRecord, canonicalBuildDir))
|
|
1140
1006
|
return "skip";
|
|
1141
1007
|
if (isProtectedMacosSystemPath(record.path) || isProtectedMacosSystemPath(canonicalRecord)) {
|
|
1142
1008
|
return "protected";
|
|
@@ -1394,7 +1260,7 @@ async function compileMacosLauncher(options) {
|
|
|
1394
1260
|
}
|
|
1395
1261
|
const source = renderMacosLauncherSource(options.config);
|
|
1396
1262
|
const sourceDigest = computeSha256Hex(source);
|
|
1397
|
-
const runner = options.runner ??
|
|
1263
|
+
const runner = options.runner ?? createDefaultMacosCommandRunner2();
|
|
1398
1264
|
let tempDir;
|
|
1399
1265
|
let cSourcePath;
|
|
1400
1266
|
if (options.sourcePath !== undefined) {
|
|
@@ -1417,7 +1283,7 @@ async function compileMacosLauncher(options) {
|
|
|
1417
1283
|
options.outputPath,
|
|
1418
1284
|
cSourcePath
|
|
1419
1285
|
];
|
|
1420
|
-
const result = await runner.runCommand(
|
|
1286
|
+
const result = await runner.runCommand(CLANG_PATH2, args, {
|
|
1421
1287
|
...options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : {}
|
|
1422
1288
|
});
|
|
1423
1289
|
if (result.exitCode !== 0) {
|
|
@@ -1467,7 +1333,7 @@ async function swapDirectoriesDarwin(fromDirPath, toDirPath) {
|
|
|
1467
1333
|
}
|
|
1468
1334
|
}
|
|
1469
1335
|
function createDefaultMacosBundleHostAdapter(overrides) {
|
|
1470
|
-
const runner = overrides?.runner ??
|
|
1336
|
+
const runner = overrides?.runner ?? createDefaultMacosCommandRunner2();
|
|
1471
1337
|
const launchdAdapter = createDefaultLaunchdHostAdapter2();
|
|
1472
1338
|
return {
|
|
1473
1339
|
runner,
|
|
@@ -1488,7 +1354,7 @@ function normalizeBundleTargetPath(bundlePath) {
|
|
|
1488
1354
|
if (!bundlePath.startsWith("/") || /[\0\r\n]/.test(bundlePath) || bundlePath.split("/").includes("..")) {
|
|
1489
1355
|
failInvalidPath(`bundlePath must be a clean absolute path ending with ".app": ${JSON.stringify(bundlePath)}`);
|
|
1490
1356
|
}
|
|
1491
|
-
const normalized =
|
|
1357
|
+
const normalized = posix2.normalize(bundlePath).replace(/\/+$/, "");
|
|
1492
1358
|
const lowered = normalized.toLowerCase();
|
|
1493
1359
|
if (!lowered.endsWith(".app") || lowered === "/.app" || isProtectedMacosSystemPath(normalized, { applications: "install-target" })) {
|
|
1494
1360
|
failInvalidPath(`Refusing to install bundle at forbidden or invalid path: ${bundlePath}`);
|
|
@@ -1697,7 +1563,7 @@ async function ensureSignedBundle(rawOptions) {
|
|
|
1697
1563
|
}
|
|
1698
1564
|
}
|
|
1699
1565
|
// src/service-host/macos/responsibility.ts
|
|
1700
|
-
import { posix as
|
|
1566
|
+
import { posix as posix3 } from "node:path";
|
|
1701
1567
|
import { z as z4 } from "zod";
|
|
1702
1568
|
var MAX_PID = 2 ** 31 - 1;
|
|
1703
1569
|
var DEFAULT_MAX_SUBTREE_PROCESSES = 1024;
|
|
@@ -1759,14 +1625,14 @@ function isExecutableInsideBundle(canonicalExecutablePath, canonicalBundlePath)
|
|
|
1759
1625
|
if (canonicalExecutablePath.includes("\x00") || canonicalBundlePath.includes("\x00") || canonicalExecutablePath.split("/").includes("..") || canonicalBundlePath.split("/").includes("..")) {
|
|
1760
1626
|
return false;
|
|
1761
1627
|
}
|
|
1762
|
-
const cleanExe =
|
|
1763
|
-
const cleanBundle =
|
|
1628
|
+
const cleanExe = posix3.normalize(canonicalExecutablePath).replace(/\/+$/, "");
|
|
1629
|
+
const cleanBundle = posix3.normalize(canonicalBundlePath).replace(/\/+$/, "");
|
|
1764
1630
|
if (cleanBundle.length === 0 || !cleanExe.startsWith("/") || !cleanBundle.startsWith("/")) {
|
|
1765
1631
|
return false;
|
|
1766
1632
|
}
|
|
1767
1633
|
return macosPathKey(cleanExe).startsWith(`${macosPathKey(cleanBundle)}/contents/`);
|
|
1768
1634
|
}
|
|
1769
|
-
function createDefaultMacosResponsibilityAdapter(runner =
|
|
1635
|
+
function createDefaultMacosResponsibilityAdapter(runner = createDefaultMacosCommandRunner2()) {
|
|
1770
1636
|
return {
|
|
1771
1637
|
async responsiblePid(pid) {
|
|
1772
1638
|
const fn = requireDarwinServiceHostMethod(loadDarwinBinding(), "responsiblePid");
|
|
@@ -1777,9 +1643,9 @@ function createDefaultMacosResponsibilityAdapter(runner = createDefaultMacosComm
|
|
|
1777
1643
|
return fn(pid);
|
|
1778
1644
|
},
|
|
1779
1645
|
observeProcessInstance: observeProcessInstance2,
|
|
1780
|
-
canonicalizePath: (targetPath) =>
|
|
1646
|
+
canonicalizePath: (targetPath) => canonicalizeMacosPath2(targetPath),
|
|
1781
1647
|
async listProcesses() {
|
|
1782
|
-
const result = await runner.runCommand(
|
|
1648
|
+
const result = await runner.runCommand(PS_PATH2, ["-axo", "pid=,ppid="]);
|
|
1783
1649
|
if (result.exitCode !== 0) {
|
|
1784
1650
|
throw new Error(`ps failed (exit ${result.exitCode}): ${result.stderr.trim()}`);
|
|
1785
1651
|
}
|
|
@@ -1941,11 +1807,11 @@ export {
|
|
|
1941
1807
|
APPLE_ICON_INSET_PX,
|
|
1942
1808
|
APPLE_ICON_TILE_PX,
|
|
1943
1809
|
BUNDLE_SPEC_DIGEST_PLIST_KEY,
|
|
1944
|
-
CLANG_PATH,
|
|
1945
|
-
CODESIGN_PATH,
|
|
1810
|
+
CLANG_PATH2 as CLANG_PATH,
|
|
1811
|
+
CODESIGN_PATH2 as CODESIGN_PATH,
|
|
1946
1812
|
DEFAULT_LSREGISTER_DUMP_MAX_BYTES,
|
|
1947
1813
|
DEFAULT_MAX_UNREGISTRATIONS,
|
|
1948
|
-
ICONUTIL_PATH,
|
|
1814
|
+
ICONUTIL_PATH2 as ICONUTIL_PATH,
|
|
1949
1815
|
KLS_APPLICATION_NOT_FOUND_ERR,
|
|
1950
1816
|
LAUNCHER_EXIT_NOT_LAUNCHD,
|
|
1951
1817
|
LSREGISTER_PATH,
|
|
@@ -1957,18 +1823,18 @@ export {
|
|
|
1957
1823
|
MacosLaunchServicesError,
|
|
1958
1824
|
MacosLauncherConfigSchema,
|
|
1959
1825
|
MacosLauncherError,
|
|
1960
|
-
PS_PATH,
|
|
1961
|
-
QLMANAGE_PATH,
|
|
1962
|
-
SECURITY_PATH,
|
|
1963
|
-
SIPS_PATH,
|
|
1826
|
+
PS_PATH2 as PS_PATH,
|
|
1827
|
+
QLMANAGE_PATH2 as QLMANAGE_PATH,
|
|
1828
|
+
SECURITY_PATH2 as SECURITY_PATH,
|
|
1829
|
+
SIPS_PATH2 as SIPS_PATH,
|
|
1964
1830
|
assertSafeSvg,
|
|
1965
1831
|
assertValidIcnsBytes,
|
|
1966
|
-
canonicalizeMacosPath,
|
|
1832
|
+
canonicalizeMacosPath2 as canonicalizeMacosPath,
|
|
1967
1833
|
collectProcessSubtreePids,
|
|
1968
1834
|
compileMacosLauncher,
|
|
1969
1835
|
computeBundleSpecDigest,
|
|
1970
1836
|
createDefaultMacosBundleHostAdapter,
|
|
1971
|
-
createDefaultMacosCommandRunner,
|
|
1837
|
+
createDefaultMacosCommandRunner2 as createDefaultMacosCommandRunner,
|
|
1972
1838
|
createDefaultMacosResponsibilityAdapter,
|
|
1973
1839
|
createLsregisterDumpParser,
|
|
1974
1840
|
ensureSignedBundle,
|
|
@@ -1979,8 +1845,8 @@ export {
|
|
|
1979
1845
|
generateAppIconIcns,
|
|
1980
1846
|
inspectResponsibleProcess,
|
|
1981
1847
|
isExecutableInsideBundle,
|
|
1982
|
-
isPathWithinDirectory,
|
|
1983
|
-
normalizeMacosSyntheticPath,
|
|
1848
|
+
isPathWithinDirectory2 as isPathWithinDirectory,
|
|
1849
|
+
normalizeMacosSyntheticPath2 as normalizeMacosSyntheticPath,
|
|
1984
1850
|
parseCodesignDetails,
|
|
1985
1851
|
parseDeveloperIdsOutput,
|
|
1986
1852
|
parseLsregisterDump,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work launched in its own boundary with a declared owner: a transient systemd scope on Linux
|
|
3
|
+
* or a recorded process root, the typed owner record, the one inherited variable that names the
|
|
4
|
+
* boundary, and the check that asks the boundary whether a process belongs to it.
|
|
5
|
+
*/
|
|
6
|
+
export { type WorkCommand, type WorkCommandInput, workCommand, } from '../../service-host/work/command.js';
|
|
7
|
+
export { WorkLaunchError, type WorkLaunchErrorReason } from '../../service-host/work/errors.js';
|
|
8
|
+
export { launchWork, type WorkLaunch, type WorkLaunchCommand, type WorkLaunchInput, } from '../../service-host/work/launch.js';
|
|
9
|
+
export { checkWorkMembership, inheritedWork, type WorkMembership, type WorkMembershipUnavailableReason, } from '../../service-host/work/membership.js';
|
|
10
|
+
export { readWorkOrigin, WORK_ORIGIN_ENV, type WorkBoundary, WorkBoundarySchema, type WorkOrigin, WorkOriginSchema, } from '../../service-host/work/origin.js';
|
|
11
|
+
export { type WorkAgent, WorkAgentSchema, type WorkOwner, WorkOwnerSchema, type WorkRef, WorkRefSchema, } from '../../service-host/work/owner.js';
|
|
12
|
+
export type { WorkPlacement, WorkScopeLimits, WorkScopePlacement, } from '../../service-host/work/placement.js';
|
|
13
|
+
export { probeWorkBoundary, type WorkBoundaryAvailability, } from '../../service-host/work/probe.js';
|
|
14
|
+
export { workUnitName } from '../../service-host/work/scope-command.js';
|
|
15
|
+
//# sourceMappingURL=work.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/service-host/work.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,WAAW,GACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC7F,OAAO,EACL,UAAU,EACV,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,eAAe,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,+BAA+B,GACrC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,cAAc,EACd,eAAe,EACf,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,UAAU,EACf,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,KAAK,SAAS,EACd,eAAe,EACf,KAAK,SAAS,EACd,eAAe,EACf,KAAK,OAAO,EACZ,aAAa,GACd,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,aAAa,EACb,eAAe,EACf,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,GAC9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC"}
|