@toddzheng024/dscode-desktop 0.0.0-stage → 0.7.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +120 -2
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/bin/apply_patch +9 -0
- package/cordis.patch.yml +433 -0
- package/docs/CHANGELOG.md +649 -0
- package/docs/account-login.md +44 -0
- package/docs/auto-review.md +128 -0
- package/docs/browser-use.md +784 -0
- package/docs/computer-use.md +81 -0
- package/docs/custom-providers.md +88 -0
- package/docs/demo.md +158 -0
- package/docs/distribution.md +58 -0
- package/docs/dscode-ultra.md +75 -0
- package/docs/email.md +296 -0
- package/docs/exec.md +40 -0
- package/docs/hub-distribution.md +212 -0
- package/docs/memory.md +121 -0
- package/docs/opencode-go.md +61 -0
- package/docs/plugin-hub.md +68 -0
- package/docs/releases/0.2.0.md +28 -0
- package/docs/releases/0.3.0.md +21 -0
- package/docs/releases/0.4.0.md +20 -0
- package/docs/releases/0.5.0.md +19 -0
- package/docs/releases/0.6.0.md +20 -0
- package/docs/releases/0.7.0.md +22 -0
- package/docs/releases/0.7.1.md +20 -0
- package/docs/releases/0.7.10.md +10 -0
- package/docs/releases/0.7.11.md +17 -0
- package/docs/releases/0.7.12.md +11 -0
- package/docs/releases/0.7.13.md +12 -0
- package/docs/releases/0.7.14.md +11 -0
- package/docs/releases/0.7.15.md +11 -0
- package/docs/releases/0.7.16.md +10 -0
- package/docs/releases/0.7.17.md +12 -0
- package/docs/releases/0.7.18.md +13 -0
- package/docs/releases/0.7.19.md +8 -0
- package/docs/releases/0.7.2.md +19 -0
- package/docs/releases/0.7.20.md +10 -0
- package/docs/releases/0.7.21.md +9 -0
- package/docs/releases/0.7.22.md +11 -0
- package/docs/releases/0.7.23.md +14 -0
- package/docs/releases/0.7.24.md +11 -0
- package/docs/releases/0.7.25.md +8 -0
- package/docs/releases/0.7.26.md +18 -0
- package/docs/releases/0.7.27.md +8 -0
- package/docs/releases/0.7.28.md +22 -0
- package/docs/releases/0.7.29.md +12 -0
- package/docs/releases/0.7.3.md +23 -0
- package/docs/releases/0.7.30.md +19 -0
- package/docs/releases/0.7.31.md +14 -0
- package/docs/releases/0.7.32.md +14 -0
- package/docs/releases/0.7.33.md +37 -0
- package/docs/releases/0.7.34.md +24 -0
- package/docs/releases/0.7.4.md +16 -0
- package/docs/releases/0.7.5.md +18 -0
- package/docs/releases/0.7.6.md +29 -0
- package/docs/releases/0.7.7.md +36 -0
- package/docs/releases/0.7.8.md +14 -0
- package/docs/releases/0.7.9.md +15 -0
- package/docs/session-bridge.md +80 -0
- package/docs/session-cards.md +53 -0
- package/docs/session-communication.md +186 -0
- package/docs/session-metrics.md +41 -0
- package/docs/skills.md +81 -0
- package/docs/triggers.md +338 -0
- package/docs/tui-commands.md +204 -0
- package/extensions/browser/manifest.json +22 -0
- package/extensions/browser/popup.css +6 -0
- package/extensions/browser/popup.html +11 -0
- package/extensions/browser/popup.mjs +47 -0
- package/extensions/browser/protocol.mjs +168 -0
- package/extensions/browser/worker.mjs +94 -0
- package/icon.svg +7 -0
- package/locale/en.json +6 -0
- package/locale/zh-cn.json +6 -0
- package/node_modules/@deepseek-ai/node-addon-system/LICENSE +21 -0
- package/node_modules/@deepseek-ai/node-addon-system/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system/README.md +15 -0
- package/node_modules/@deepseek-ai/node-addon-system/README.zh.md +15 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/flock.d.ts +13 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/flock.js +51 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/index.d.ts +73 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/index.js +98 -0
- package/node_modules/@deepseek-ai/node-addon-system/package.json +45 -0
- package/node_modules/@deepseek-ai/node-addon-system/src/flock.c +164 -0
- package/node_modules/@deepseek-ai/node-addon-system/src/main.c +298 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.zh.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/bin/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/prebuilds.json +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.zh.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/bin/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/prebuilds.json +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.zh.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/glibc/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/landlock-run +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/musl/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/prebuilds.json +24 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.zh.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/glibc/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/landlock-run +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/musl/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/prebuilds.json +24 -0
- package/package.json +156 -4
- package/plugins/account/index.mjs +178 -0
- package/plugins/account/state.mjs +123 -0
- package/plugins/auto-review/audit.mjs +24 -0
- package/plugins/auto-review/index.mjs +267 -0
- package/plugins/auto-review/policy.mjs +92 -0
- package/plugins/browser/SKILL.md +158 -0
- package/plugins/browser/access.mjs +143 -0
- package/plugins/browser/config.mjs +60 -0
- package/plugins/browser/connection.mjs +385 -0
- package/plugins/browser/desktop-client.mjs +282 -0
- package/plugins/browser/desktop-host.mjs +74 -0
- package/plugins/browser/document-identity.mjs +57 -0
- package/plugins/browser/extension-relay.mjs +66 -0
- package/plugins/browser/files.mjs +32 -0
- package/plugins/browser/index.mjs +235 -0
- package/plugins/browser/mcp-entry.mjs +18 -0
- package/plugins/browser/mcp-tools.mjs +21 -0
- package/plugins/browser/presentation.mjs +45 -0
- package/plugins/browser/preview.mjs +77 -0
- package/plugins/browser/review.mjs +20 -0
- package/plugins/browser/screenshots.mjs +35 -0
- package/plugins/clipboard-image/clipboard-image.swift +56 -0
- package/plugins/clipboard-image/index.mjs +70 -0
- package/plugins/code-review/baseline.mjs +143 -0
- package/plugins/code-review/git.mjs +163 -0
- package/plugins/code-review/index.mjs +236 -0
- package/plugins/compaction/engine.mjs +304 -0
- package/plugins/compaction/tetris.mjs +65 -0
- package/plugins/compaction/threshold.mjs +99 -0
- package/plugins/computer-use/DESKTOP-SKILL.md +64 -0
- package/plugins/computer-use/desktop-host.mjs +75 -0
- package/plugins/computer-use/desktop-skill.mjs +28 -0
- package/plugins/computer-use/desktop-upstream.mjs +3 -0
- package/plugins/computer-use/index.mjs +37 -0
- package/plugins/cordis-config/plain.mjs +31 -0
- package/plugins/credentials/index.mjs +73 -0
- package/plugins/custom/adapter.mjs +110 -0
- package/plugins/custom/config.mjs +85 -0
- package/plugins/custom/desktop-client.mjs +150 -0
- package/plugins/custom/desktop-host.mjs +78 -0
- package/plugins/custom/images.mjs +32 -0
- package/plugins/custom/index.mjs +145 -0
- package/plugins/custom/wire.mjs +179 -0
- package/plugins/desktop/client.mjs +1041 -0
- package/plugins/desktop/index.mjs +10 -0
- package/plugins/desktop/shell-environment.mjs +9 -0
- package/plugins/desktop-workspace/hooks.mjs +29 -0
- package/plugins/desktop-workspace/index.mjs +37 -0
- package/plugins/dscode/board.mjs +260 -0
- package/plugins/dscode/child-target.mjs +11 -0
- package/plugins/dscode/control.mjs +17 -0
- package/plugins/dscode/desktop-client.mjs +55 -0
- package/plugins/dscode/desktop-host.mjs +37 -0
- package/plugins/dscode/index.mjs +270 -0
- package/plugins/email/cli.mjs +32 -0
- package/plugins/email/contacts.mjs +36 -0
- package/plugins/email/desktop-client.mjs +117 -0
- package/plugins/email/desktop-host.mjs +54 -0
- package/plugins/email/desktop-service.mjs +106 -0
- package/plugins/email/gmail-oauth.mjs +69 -0
- package/plugins/email/gmail-store.mjs +2 -0
- package/plugins/email/gmail.mjs +194 -0
- package/plugins/email/imap.mjs +136 -0
- package/plugins/email/inbox.d.mts +25 -0
- package/plugins/email/inbox.mjs +76 -0
- package/plugins/email/smtp.mjs +70 -0
- package/plugins/email/store.mjs +32 -0
- package/plugins/email-tools/index.mjs +46 -0
- package/plugins/exec/cli.mjs +64 -0
- package/plugins/exec/index.mjs +112 -0
- package/plugins/grok/adapter.mjs +114 -0
- package/plugins/grok/auth.mjs +76 -0
- package/plugins/grok/billing.mjs +147 -0
- package/plugins/grok/index.mjs +123 -0
- package/plugins/grok/models.mjs +129 -0
- package/plugins/grok/status.mjs +29 -0
- package/plugins/grok/wire.mjs +268 -0
- package/plugins/hub/catalog.mjs +82 -0
- package/plugins/hub/desktop-client.mjs +114 -0
- package/plugins/hub/desktop-host.mjs +129 -0
- package/plugins/i18n/messages.d.mts +21 -0
- package/plugins/i18n/messages.mjs +537 -0
- package/plugins/jev/approval.mjs +131 -0
- package/plugins/jev/client.mjs +74 -0
- package/plugins/jev/index.mjs +100 -0
- package/plugins/memory/content.mjs +57 -0
- package/plugins/memory/desktop-host.mjs +3 -0
- package/plugins/memory/index.mjs +168 -0
- package/plugins/memory/pipeline.mjs +79 -0
- package/plugins/memory/store.mjs +93 -0
- package/plugins/message-source/kind.mjs +20 -0
- package/plugins/opencode-go/adapter.mjs +96 -0
- package/plugins/opencode-go/command.mjs +128 -0
- package/plugins/opencode-go/index.mjs +121 -0
- package/plugins/opencode-go/models.mjs +58 -0
- package/plugins/opencode-go/oauth.mjs +194 -0
- package/plugins/opencode-go/search.mjs +86 -0
- package/plugins/opencode-go/usage.mjs +120 -0
- package/plugins/opencode-go/version.mjs +10 -0
- package/plugins/opencode-go/wire.mjs +73 -0
- package/plugins/openrouter/adapter.mjs +232 -0
- package/plugins/openrouter/index.mjs +124 -0
- package/plugins/openrouter/models.mjs +157 -0
- package/plugins/openrouter/search.mjs +113 -0
- package/plugins/openrouter/wire.mjs +101 -0
- package/plugins/providers/catalog.mjs +160 -0
- package/plugins/providers/chat-messages.mjs +120 -0
- package/plugins/providers/chat-stream.mjs +174 -0
- package/plugins/providers/desktop-client.mjs +84 -0
- package/plugins/providers/desktop-host.mjs +63 -0
- package/plugins/providers/effort.mjs +35 -0
- package/plugins/providers/http-errors.mjs +50 -0
- package/plugins/providers/openrouter-account.mjs +171 -0
- package/plugins/session-bridge/client.mjs +106 -0
- package/plugins/session-bridge/communication.mjs +260 -0
- package/plugins/session-bridge/index.mjs +67 -0
- package/plugins/session-bridge/mailbox.mjs +267 -0
- package/plugins/session-bridge/paths.mjs +21 -0
- package/plugins/session-bridge/server.mjs +172 -0
- package/plugins/session-bridge/tasks.mjs +229 -0
- package/plugins/session-cards/content.mjs +64 -0
- package/plugins/session-cards/index.mjs +38 -0
- package/plugins/session-cards/manager.mjs +140 -0
- package/plugins/session-metrics/attribution.mjs +30 -0
- package/plugins/session-metrics/balance.mjs +81 -0
- package/plugins/session-metrics/desktop-client.mjs +62 -0
- package/plugins/session-metrics/desktop-host.mjs +46 -0
- package/plugins/session-metrics/index.mjs +97 -0
- package/plugins/session-metrics/pricing.mjs +84 -0
- package/plugins/session-metrics/rate.mjs +59 -0
- package/plugins/session-metrics/store.mjs +75 -0
- package/plugins/session-metrics/turns.mjs +134 -0
- package/plugins/session-metrics/view.mjs +272 -0
- package/plugins/time-marks/desktop-host.mjs +2 -0
- package/plugins/time-marks/index.mjs +116 -0
- package/plugins/time-marks/marks.mjs +152 -0
- package/plugins/triggers/cli.mjs +558 -0
- package/plugins/triggers/commands.mjs +143 -0
- package/plugins/triggers/config.mjs +264 -0
- package/plugins/triggers/desktop-client.mjs +155 -0
- package/plugins/triggers/desktop-host.mjs +88 -0
- package/plugins/triggers/desktop-management.mjs +97 -0
- package/plugins/triggers/desktop-scheduler.mjs +125 -0
- package/plugins/triggers/host.mjs +24 -0
- package/plugins/triggers/index.mjs +27 -0
- package/plugins/triggers/job-cli.mjs +110 -0
- package/plugins/triggers/jobs.mjs +156 -0
- package/plugins/triggers/launchd.mjs +101 -0
- package/plugins/triggers/lease.mjs +24 -0
- package/plugins/triggers/log.mjs +104 -0
- package/plugins/triggers/management.mjs +181 -0
- package/plugins/triggers/options.mjs +117 -0
- package/plugins/triggers/overlay.mjs +7 -0
- package/plugins/triggers/poll.mjs +65 -0
- package/plugins/triggers/run.mjs +157 -0
- package/plugins/triggers/schedule.mjs +40 -0
- package/plugins/triggers/scheduler-service.mjs +46 -0
- package/plugins/triggers/scheduler.mjs +92 -0
- package/plugins/triggers/session-run.mjs +125 -0
- package/plugins/triggers/session.mjs +48 -0
- package/plugins/triggers/source-emit.mjs +19 -0
- package/plugins/triggers/source-host.mjs +78 -0
- package/plugins/triggers/source-ingress.mjs +70 -0
- package/plugins/triggers/source-sandbox.mjs +35 -0
- package/plugins/triggers/sources.mjs +45 -0
- package/plugins/triggers/spool.mjs +145 -0
- package/plugins/triggers/tools.mjs +67 -0
- package/plugins/triggers/unattended.mjs +18 -0
- package/plugins/tui-tools/composition.mjs +28 -0
- package/plugins/tui-tools/desktop-host.mjs +2 -0
- package/plugins/tui-tools/doctor-cli.mjs +22 -0
- package/plugins/tui-tools/doctor.mjs +149 -0
- package/plugins/tui-tools/hook-sources.mjs +113 -0
- package/plugins/tui-tools/hooks.mjs +23 -0
- package/plugins/tui-tools/index.mjs +269 -0
- package/plugins/tui-tools/sandbox-runner.mjs +123 -0
- package/plugins/tui-tools/shell.mjs +27 -0
- package/plugins/tui-tools/update.mjs +111 -0
- package/plugins/tui-tools/workspace-discovery.mjs +129 -0
- package/plugins/ultra/policy.mjs +42 -0
- package/plugins/worktree-subagent/worktree.mjs +56 -0
- package/runtime-sources.json +94 -0
- package/vendor/bash/LICENSE +21 -0
- package/vendor/bash/index.js +717 -0
- package/vendor/bash/types/background.d.ts +50 -0
- package/vendor/bash/types/index.d.ts +38 -0
- package/vendor/bash/types/render.d.ts +57 -0
- package/vendor/command-goal/LICENSE +21 -0
- package/vendor/command-goal/index.js +210 -0
- package/vendor/command-goal/types/index.d.ts +10 -0
- package/vendor/computer-use/LICENSE +21 -0
- package/vendor/computer-use/lib/approval-policy.js +12 -0
- package/vendor/computer-use/lib/approval-policy.js.map +1 -0
- package/vendor/computer-use/lib/artifacts.js +79 -0
- package/vendor/computer-use/lib/artifacts.js.map +1 -0
- package/vendor/computer-use/lib/backend.js +3 -0
- package/vendor/computer-use/lib/backend.js.map +1 -0
- package/vendor/computer-use/lib/client.js +369 -0
- package/vendor/computer-use/lib/client.js.map +1 -0
- package/vendor/computer-use/lib/config.js +159 -0
- package/vendor/computer-use/lib/config.js.map +1 -0
- package/vendor/computer-use/lib/confirmations.js +99 -0
- package/vendor/computer-use/lib/confirmations.js.map +1 -0
- package/vendor/computer-use/lib/diff.js +58 -0
- package/vendor/computer-use/lib/diff.js.map +1 -0
- package/vendor/computer-use/lib/errors.js +22 -0
- package/vendor/computer-use/lib/errors.js.map +1 -0
- package/vendor/computer-use/lib/exposure.js +244 -0
- package/vendor/computer-use/lib/exposure.js.map +1 -0
- package/vendor/computer-use/lib/index.js +66 -0
- package/vendor/computer-use/lib/index.js.map +1 -0
- package/vendor/computer-use/lib/leases.js +262 -0
- package/vendor/computer-use/lib/leases.js.map +1 -0
- package/vendor/computer-use/lib/providers/macos.js +243 -0
- package/vendor/computer-use/lib/providers/macos.js.map +1 -0
- package/vendor/computer-use/lib/providers/native-helper.js +726 -0
- package/vendor/computer-use/lib/providers/native-helper.js.map +1 -0
- package/vendor/computer-use/lib/providers/unsupported.js +51 -0
- package/vendor/computer-use/lib/providers/unsupported.js.map +1 -0
- package/vendor/computer-use/lib/service.js +608 -0
- package/vendor/computer-use/lib/service.js.map +1 -0
- package/vendor/computer-use/lib/skill.js +136 -0
- package/vendor/computer-use/lib/skill.js.map +1 -0
- package/vendor/computer-use/lib/target-resolver.js +180 -0
- package/vendor/computer-use/lib/target-resolver.js.map +1 -0
- package/vendor/computer-use/lib/tools.js +511 -0
- package/vendor/computer-use/lib/tools.js.map +1 -0
- package/vendor/computer-use/lib/types/approval-policy.d.ts +13 -0
- package/vendor/computer-use/lib/types/approval-policy.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/artifacts.d.ts +10 -0
- package/vendor/computer-use/lib/types/artifacts.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/backend.d.ts +124 -0
- package/vendor/computer-use/lib/types/backend.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/client/index.d.ts +83 -0
- package/vendor/computer-use/lib/types/client/index.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/config.d.ts +94 -0
- package/vendor/computer-use/lib/types/config.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/confirmations.d.ts +23 -0
- package/vendor/computer-use/lib/types/confirmations.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/diff.d.ts +5 -0
- package/vendor/computer-use/lib/types/diff.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/errors.d.ts +15 -0
- package/vendor/computer-use/lib/types/errors.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/exposure.d.ts +30 -0
- package/vendor/computer-use/lib/types/exposure.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/index.d.ts +21 -0
- package/vendor/computer-use/lib/types/index.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/leases.d.ts +81 -0
- package/vendor/computer-use/lib/types/leases.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/providers/macos.d.ts +39 -0
- package/vendor/computer-use/lib/types/providers/macos.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/providers/native-helper.d.ts +48 -0
- package/vendor/computer-use/lib/types/providers/native-helper.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/providers/unsupported.d.ts +23 -0
- package/vendor/computer-use/lib/types/providers/unsupported.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/service.d.ts +58 -0
- package/vendor/computer-use/lib/types/service.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/skill.d.ts +14 -0
- package/vendor/computer-use/lib/types/skill.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/target-resolver.d.ts +38 -0
- package/vendor/computer-use/lib/types/target-resolver.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/tools.d.ts +6 -0
- package/vendor/computer-use/lib/types/tools.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/types.d.ts +270 -0
- package/vendor/computer-use/lib/types/types.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/web.d.ts +33 -0
- package/vendor/computer-use/lib/types/web.d.ts.map +1 -0
- package/vendor/computer-use/lib/types.js +9 -0
- package/vendor/computer-use/lib/types.js.map +1 -0
- package/vendor/computer-use/lib/web.js +188 -0
- package/vendor/computer-use/lib/web.js.map +1 -0
- package/vendor/computer-use/native/macos/Sources/Fixture/main.swift +412 -0
- package/vendor/computer-use/native/macos/Sources/Helper/CursorImage.swift +11 -0
- package/vendor/computer-use/native/macos/Sources/Helper/CursorMotion.swift +67 -0
- package/vendor/computer-use/native/macos/Sources/Helper/CursorOverlay.swift +840 -0
- package/vendor/computer-use/native/macos/Sources/Helper/TargetedPointer.swift +327 -0
- package/vendor/computer-use/native/macos/Sources/Helper/WindowNumberMatcher.swift +29 -0
- package/vendor/computer-use/native/macos/Sources/Helper/main.swift +1244 -0
- package/vendor/computer-use/native/macos/Sources/Monitor/main.swift +153 -0
- package/vendor/computer-use/native/macos/bin/dsh-computer-use-helper +0 -0
- package/vendor/computer-use/native/macos/manifest.json +14 -0
- package/vendor/persistent/LICENSE +21 -0
- package/vendor/persistent/index.js +411 -0
- package/vendor/persistent/types/index.d.ts +24 -0
- package/vendor/subagent/LICENSE +21 -0
- package/vendor/subagent/index.js +694 -0
- package/vendor/subagent/invariant.js +52 -0
- package/vendor/subagent/model-selection-settings.js +68 -0
- package/vendor/subagent/types/index.d.ts +82 -0
- package/vendor/subagent/types/invariant.d.ts +16 -0
- package/vendor/subagent/types/list-models.d.ts +10 -0
- package/vendor/subagent/types/model-selection-settings.d.ts +45 -0
- package/vendor/subagent/types/model-selection-state.d.ts +48 -0
- package/vendor/subagent/types/model-selection.d.ts +81 -0
- package/vendor/subagent-core/LICENSE +21 -0
- package/vendor/subagent-core/index.js +3202 -0
- package/vendor/subagent-core/invariant.js +76 -0
- package/vendor/subagent-core/typert.host.d.ts +3 -0
- package/vendor/subagent-core/typert.host.js +978 -0
- package/vendor/subagent-core/typert.remote-client.d.ts +25 -0
- package/vendor/subagent-core/typert.remote-client.js +114 -0
- package/vendor/subagent-core/types/archive-admission.d.ts +16 -0
- package/vendor/subagent-core/types/archive-admission.js +151 -0
- package/vendor/subagent-core/types/assistant-output.d.ts +48 -0
- package/vendor/subagent-core/types/assistant-output.js +73 -0
- package/vendor/subagent-core/types/catalog.d.ts +84 -0
- package/vendor/subagent-core/types/catalog.js +109 -0
- package/vendor/subagent-core/types/child-agent.d.ts +156 -0
- package/vendor/subagent-core/types/child-agent.js +213 -0
- package/vendor/subagent-core/types/client.d.ts +8 -0
- package/vendor/subagent-core/types/client.js +7 -0
- package/vendor/subagent-core/types/continuation-activation.d.ts +267 -0
- package/vendor/subagent-core/types/continuation-activation.js +700 -0
- package/vendor/subagent-core/types/continuation-messages.d.ts +62 -0
- package/vendor/subagent-core/types/continuation-messages.js +106 -0
- package/vendor/subagent-core/types/continuation.d.ts +124 -0
- package/vendor/subagent-core/types/continuation.js +455 -0
- package/vendor/subagent-core/types/control-types.d.ts +135 -0
- package/vendor/subagent-core/types/control-types.js +8 -0
- package/vendor/subagent-core/types/control.d.ts +45 -0
- package/vendor/subagent-core/types/control.js +79 -0
- package/vendor/subagent-core/types/depth.d.ts +31 -0
- package/vendor/subagent-core/types/depth.js +39 -0
- package/vendor/subagent-core/types/descriptor.d.ts +144 -0
- package/vendor/subagent-core/types/descriptor.js +193 -0
- package/vendor/subagent-core/types/error.d.ts +11 -0
- package/vendor/subagent-core/types/error.js +14 -0
- package/vendor/subagent-core/types/inbox.d.ts +43 -0
- package/vendor/subagent-core/types/inbox.js +61 -0
- package/vendor/subagent-core/types/index.d.ts +320 -0
- package/vendor/subagent-core/types/index.js +475 -0
- package/vendor/subagent-core/types/internal.d.ts +58 -0
- package/vendor/subagent-core/types/internal.js +58 -0
- package/vendor/subagent-core/types/invariant.d.ts +13 -0
- package/vendor/subagent-core/types/invariant.js +91 -0
- package/vendor/subagent-core/types/lifecycle.d.ts +113 -0
- package/vendor/subagent-core/types/lifecycle.js +180 -0
- package/vendor/subagent-core/types/list-children.d.ts +36 -0
- package/vendor/subagent-core/types/list-children.js +166 -0
- package/vendor/subagent-core/types/out-of-process.d.ts +118 -0
- package/vendor/subagent-core/types/out-of-process.js +219 -0
- package/vendor/subagent-core/types/projection-types.d.ts +82 -0
- package/vendor/subagent-core/types/projection-types.js +7 -0
- package/vendor/subagent-core/types/projection.d.ts +100 -0
- package/vendor/subagent-core/types/projection.js +157 -0
- package/vendor/subagent-core/types/run-settlement.d.ts +17 -0
- package/vendor/subagent-core/types/run-settlement.js +70 -0
- package/vendor/subagent-core/types/types.d.ts +377 -0
- package/vendor/subagent-core/types/types.js +19 -0
- package/vendor/subagent-driver/LICENSE +21 -0
- package/vendor/subagent-driver/index.js +255 -0
- package/vendor/subagent-driver/types/index.d.ts +33 -0
- package/vendor/subagent-driver/types/structured.d.ts +42 -0
- package/vendor/subagent-fork/LICENSE +21 -0
- package/vendor/subagent-fork/index.js +61 -0
- package/vendor/subagent-fork/types/index.d.ts +20 -0
- package/vendor/subagent-spawn/LICENSE +21 -0
- package/vendor/subagent-spawn/index.js +45 -0
- package/vendor/subagent-spawn/types/index.d.ts +19 -0
- package/vendor/terminal/LICENSE +21 -0
- package/vendor/terminal/index.js +1093 -0
- package/vendor/terminal/types/config.d.ts +82 -0
- package/vendor/terminal/types/index.d.ts +36 -0
- package/vendor/terminal/types/sanitize.d.ts +47 -0
- package/vendor/terminal/types/session.d.ts +87 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/node-addon-system",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Prebuilt system primitives: a Linux Landlock launcher and asynchronous POSIX flock through stable Node-API",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/deepseek-harness/deepseek-harness.git",
|
|
9
|
+
"directory": "native/system/packages/entry"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
"./landlock-run": {
|
|
13
|
+
"types": "./lib/index.d.ts",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./flock": {
|
|
17
|
+
"types": "./lib/flock.d.ts",
|
|
18
|
+
"default": "./lib/flock.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"README.md",
|
|
24
|
+
"lib/",
|
|
25
|
+
"!lib/*.tsbuildinfo",
|
|
26
|
+
"src/main.c",
|
|
27
|
+
"src/flock.c"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=20"
|
|
31
|
+
},
|
|
32
|
+
"license": "BSD-3-Clause",
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"optionalDependencies": {
|
|
37
|
+
"@deepseek-ai/node-addon-system-darwin-arm64": "0.1.2",
|
|
38
|
+
"@deepseek-ai/node-addon-system-darwin-x64": "0.1.2",
|
|
39
|
+
"@deepseek-ai/node-addon-system-linux-x64": "0.1.2",
|
|
40
|
+
"@deepseek-ai/node-addon-system-linux-arm64": "0.1.2"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build:js": "tsc -b"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Node-API v8 binding for asynchronous flock(LOCK_EX | LOCK_NB).
|
|
3
|
+
* The caller owns fd through completion; this module never opens, duplicates,
|
|
4
|
+
* closes, or explicitly unlocks it. The callback receives zero or a positive
|
|
5
|
+
* errno; JavaScript owns the promise and syscall error construction.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include <node_api.h>
|
|
9
|
+
#include <errno.h>
|
|
10
|
+
#include <limits.h>
|
|
11
|
+
#include <stdlib.h>
|
|
12
|
+
#include <sys/file.h>
|
|
13
|
+
|
|
14
|
+
typedef struct {
|
|
15
|
+
napi_env env;
|
|
16
|
+
napi_ref callback;
|
|
17
|
+
napi_async_work work;
|
|
18
|
+
napi_async_cleanup_hook_handle cleanup;
|
|
19
|
+
int fd;
|
|
20
|
+
int error;
|
|
21
|
+
bool closing;
|
|
22
|
+
} lock_request;
|
|
23
|
+
|
|
24
|
+
static void check_status(napi_status status, const char *message) {
|
|
25
|
+
if (status != napi_ok) {
|
|
26
|
+
napi_fatal_error("flock", NAPI_AUTO_LENGTH, message, NAPI_AUTO_LENGTH);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static void release_request(lock_request *request) {
|
|
31
|
+
if (request->callback != NULL) {
|
|
32
|
+
(void)napi_delete_reference(request->env, request->callback);
|
|
33
|
+
}
|
|
34
|
+
if (request->work != NULL) {
|
|
35
|
+
(void)napi_delete_async_work(request->env, request->work);
|
|
36
|
+
}
|
|
37
|
+
if (request->cleanup != NULL) {
|
|
38
|
+
(void)napi_remove_async_cleanup_hook(request->cleanup);
|
|
39
|
+
}
|
|
40
|
+
free(request);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static napi_value throw_setup_error(napi_env env, napi_status status,
|
|
44
|
+
const char *message) {
|
|
45
|
+
if (status != napi_pending_exception) {
|
|
46
|
+
status = napi_throw_error(env, "ERR_FLOCK_ASYNC_WORK", message);
|
|
47
|
+
bool pending;
|
|
48
|
+
/* Error construction can fail with both generic_failure and a JS exception. */
|
|
49
|
+
check_status(napi_is_exception_pending(env, &pending), "Cannot inspect flock setup exception");
|
|
50
|
+
if (!pending && status != napi_pending_exception) check_status(status, message);
|
|
51
|
+
}
|
|
52
|
+
return NULL;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static void execute_lock(napi_env env, void *data) {
|
|
56
|
+
(void)env;
|
|
57
|
+
lock_request *request = data;
|
|
58
|
+
request->error = flock(request->fd, LOCK_EX | LOCK_NB) == 0 ? 0 : errno;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static void complete_lock(napi_env env, napi_status status, void *data) {
|
|
62
|
+
lock_request *request = data;
|
|
63
|
+
if (env != NULL && !request->closing) {
|
|
64
|
+
napi_value callback;
|
|
65
|
+
napi_value receiver;
|
|
66
|
+
napi_value result;
|
|
67
|
+
check_status(status, "flock async work did not complete");
|
|
68
|
+
check_status(napi_get_reference_value(env, request->callback, &callback),
|
|
69
|
+
"Cannot retrieve flock callback");
|
|
70
|
+
check_status(napi_get_undefined(env, &receiver), "Cannot create flock receiver");
|
|
71
|
+
check_status(napi_create_int32(env, request->error, &result),
|
|
72
|
+
"Cannot create flock result");
|
|
73
|
+
status = napi_call_function(env, receiver, callback, 1, &result, NULL);
|
|
74
|
+
} else {
|
|
75
|
+
status = napi_ok;
|
|
76
|
+
}
|
|
77
|
+
release_request(request);
|
|
78
|
+
/* Node's async-work dispatcher reports callback exceptions and handles termination. */
|
|
79
|
+
if (status != napi_pending_exception) {
|
|
80
|
+
check_status(status, "Cannot invoke flock callback");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static void cleanup_lock(napi_async_cleanup_hook_handle handle, void *data) {
|
|
85
|
+
(void)handle;
|
|
86
|
+
lock_request *request = data;
|
|
87
|
+
request->closing = true;
|
|
88
|
+
/*
|
|
89
|
+
* Running work cannot be cancelled. The hook keeps the environment alive
|
|
90
|
+
* until completion releases both the work and this hook; it never frees
|
|
91
|
+
* memory that the execution thread can still access.
|
|
92
|
+
*/
|
|
93
|
+
(void)napi_cancel_async_work(request->env, request->work);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
static napi_value try_lock(napi_env env, napi_callback_info info) {
|
|
97
|
+
size_t argc = 2;
|
|
98
|
+
napi_value argv[2];
|
|
99
|
+
double fd;
|
|
100
|
+
napi_status status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL);
|
|
101
|
+
if (status != napi_ok) {
|
|
102
|
+
return throw_setup_error(env, status, "Cannot read flock arguments");
|
|
103
|
+
}
|
|
104
|
+
if (argc < 1 || napi_get_value_double(env, argv[0], &fd) != napi_ok) {
|
|
105
|
+
(void)napi_throw_type_error(env, NULL, "fd must be a number");
|
|
106
|
+
return NULL;
|
|
107
|
+
}
|
|
108
|
+
if (!(fd >= INT_MIN && fd <= INT_MAX) || fd != (int)fd) {
|
|
109
|
+
(void)napi_throw_range_error(env, NULL, "fd must be a signed C int");
|
|
110
|
+
return NULL;
|
|
111
|
+
}
|
|
112
|
+
napi_valuetype callback_type;
|
|
113
|
+
if (argc < 2 || napi_typeof(env, argv[1], &callback_type) != napi_ok ||
|
|
114
|
+
callback_type != napi_function) {
|
|
115
|
+
(void)napi_throw_type_error(env, NULL, "callback must be a function");
|
|
116
|
+
return NULL;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
lock_request *request = calloc(1, sizeof(*request));
|
|
120
|
+
if (request == NULL) {
|
|
121
|
+
(void)napi_throw_error(env, "ENOMEM", "Cannot allocate flock async work");
|
|
122
|
+
return NULL;
|
|
123
|
+
}
|
|
124
|
+
request->env = env;
|
|
125
|
+
request->fd = (int)fd;
|
|
126
|
+
|
|
127
|
+
status = napi_create_reference(env, argv[1], 1, &request->callback);
|
|
128
|
+
if (status != napi_ok) {
|
|
129
|
+
release_request(request);
|
|
130
|
+
return throw_setup_error(env, status, "Cannot retain flock callback");
|
|
131
|
+
}
|
|
132
|
+
napi_value name;
|
|
133
|
+
status = napi_create_string_utf8(env, "flock", NAPI_AUTO_LENGTH, &name);
|
|
134
|
+
if (status == napi_ok) {
|
|
135
|
+
status = napi_create_async_work(env, NULL, name, execute_lock, complete_lock,
|
|
136
|
+
request, &request->work);
|
|
137
|
+
}
|
|
138
|
+
if (status != napi_ok) {
|
|
139
|
+
release_request(request);
|
|
140
|
+
return throw_setup_error(env, status, "Cannot create flock async work");
|
|
141
|
+
}
|
|
142
|
+
status = napi_add_async_cleanup_hook(env, cleanup_lock, request, &request->cleanup);
|
|
143
|
+
if (status != napi_ok) {
|
|
144
|
+
release_request(request);
|
|
145
|
+
return throw_setup_error(env, status, "Cannot register flock environment cleanup");
|
|
146
|
+
}
|
|
147
|
+
status = napi_queue_async_work(env, request->work);
|
|
148
|
+
if (status != napi_ok) {
|
|
149
|
+
/* Queue failure schedules no completion callback. */
|
|
150
|
+
release_request(request);
|
|
151
|
+
return throw_setup_error(env, status, "Cannot queue flock async work");
|
|
152
|
+
}
|
|
153
|
+
return NULL;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
NAPI_MODULE_INIT() {
|
|
157
|
+
napi_value function;
|
|
158
|
+
if (napi_create_function(env, "tryLock", NAPI_AUTO_LENGTH, try_lock,
|
|
159
|
+
NULL, &function) != napi_ok ||
|
|
160
|
+
napi_set_named_property(env, exports, "tryLock", function) != napi_ok) {
|
|
161
|
+
return NULL;
|
|
162
|
+
}
|
|
163
|
+
return exports;
|
|
164
|
+
}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* landlock-run: self-restrict-then-exec Landlock launcher.
|
|
3
|
+
*
|
|
4
|
+
* The Landlock rung of a consuming sandbox seam, for Linux hosts where
|
|
5
|
+
* `bwrap` is
|
|
6
|
+
* unusable (not installed, unprivileged user namespaces disabled, or an LSM
|
|
7
|
+
* profile that denies mount — Landlock is an independent syscall family and
|
|
8
|
+
* needs none of those). The launcher installs a Landlock
|
|
9
|
+
* ruleset on itself and `exec`s the wrapped command; the ruleset is inherited
|
|
10
|
+
* across `execve`, so the command (and every process it spawns) runs confined
|
|
11
|
+
* while the invoking process stays unrestricted.
|
|
12
|
+
*
|
|
13
|
+
* CLI contract (mirrors the `bwrap` runner argv shape the executor wraps):
|
|
14
|
+
*
|
|
15
|
+
* landlock-run [--ro <path>]... [--rw <path>]... -- <argv>...
|
|
16
|
+
* landlock-run --probe
|
|
17
|
+
*
|
|
18
|
+
* `--ro` grants read+execute beneath the path; `--rw` grants full filesystem
|
|
19
|
+
* access beneath the path. Everything else is denied (Landlock is an
|
|
20
|
+
* allow-list). `--probe` builds a maximal ruleset and reports whether the
|
|
21
|
+
* running kernel actually enforces it — the executor's functional probe.
|
|
22
|
+
*
|
|
23
|
+
* Fail-closed: if the ruleset cannot be created or is NOT enforced by the
|
|
24
|
+
* kernel, the launcher exits non-zero WITHOUT exec'ing the command. A partial
|
|
25
|
+
* (best-effort) enforcement on an older ABI is accepted and reported on
|
|
26
|
+
* stderr; the consumer's mode vocabulary keeps its file-effect promises
|
|
27
|
+
* honest per ABI level (surfaced as `full` vs `partial` by the entry
|
|
28
|
+
* package's probe).
|
|
29
|
+
*
|
|
30
|
+
* Plain C11 over the raw Landlock UAPI — no libraries beyond libc (musl,
|
|
31
|
+
* linked statically), so the whole audit surface is this file plus the
|
|
32
|
+
* kernel's stable syscall contract. Built natively per architecture by
|
|
33
|
+
* `scripts/build.ts` into the per-platform npm packages
|
|
34
|
+
* (`@deepseek-ai/node-addon-system-linux-{x64,arm64}`); the argv grammar,
|
|
35
|
+
* exit codes, and report lines are pinned in `docs/cli-contract.md`.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
#define _GNU_SOURCE
|
|
39
|
+
#include <errno.h>
|
|
40
|
+
#include <fcntl.h>
|
|
41
|
+
#include <stdint.h>
|
|
42
|
+
#include <stdio.h>
|
|
43
|
+
#include <stdlib.h>
|
|
44
|
+
#include <string.h>
|
|
45
|
+
#include <sys/prctl.h>
|
|
46
|
+
#include <sys/stat.h>
|
|
47
|
+
#include <sys/syscall.h>
|
|
48
|
+
#include <unistd.h>
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
* The Landlock UAPI, defined locally instead of via <linux/landlock.h>: the
|
|
52
|
+
* kernel's user-space ABI is stable by contract, self-defining it keeps the
|
|
53
|
+
* build independent of the toolchain's header vintage, and the definitions
|
|
54
|
+
* double as the audit record of exactly which kernel API this launcher
|
|
55
|
+
* touches. Layouts and values are verbatim from the kernel header (the
|
|
56
|
+
* path-beneath struct is packed there, so it must be packed here).
|
|
57
|
+
*/
|
|
58
|
+
struct landlock_ruleset_attr {
|
|
59
|
+
uint64_t handled_access_fs;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
struct landlock_path_beneath_attr {
|
|
63
|
+
uint64_t allowed_access;
|
|
64
|
+
int32_t parent_fd;
|
|
65
|
+
} __attribute__((packed));
|
|
66
|
+
|
|
67
|
+
#define LANDLOCK_CREATE_RULESET_VERSION (1U << 0)
|
|
68
|
+
#define LANDLOCK_RULE_PATH_BENEATH 1
|
|
69
|
+
|
|
70
|
+
/* Filesystem access bits, grouped by the Landlock ABI that introduced them. */
|
|
71
|
+
#define LL_FS_EXECUTE (UINT64_C(1) << 0) /* ABI 1 */
|
|
72
|
+
#define LL_FS_WRITE_FILE (UINT64_C(1) << 1)
|
|
73
|
+
#define LL_FS_READ_FILE (UINT64_C(1) << 2)
|
|
74
|
+
#define LL_FS_READ_DIR (UINT64_C(1) << 3)
|
|
75
|
+
#define LL_FS_REMOVE_DIR (UINT64_C(1) << 4)
|
|
76
|
+
#define LL_FS_REMOVE_FILE (UINT64_C(1) << 5)
|
|
77
|
+
#define LL_FS_MAKE_CHAR (UINT64_C(1) << 6)
|
|
78
|
+
#define LL_FS_MAKE_DIR (UINT64_C(1) << 7)
|
|
79
|
+
#define LL_FS_MAKE_REG (UINT64_C(1) << 8)
|
|
80
|
+
#define LL_FS_MAKE_SOCK (UINT64_C(1) << 9)
|
|
81
|
+
#define LL_FS_MAKE_FIFO (UINT64_C(1) << 10)
|
|
82
|
+
#define LL_FS_MAKE_BLOCK (UINT64_C(1) << 11)
|
|
83
|
+
#define LL_FS_MAKE_SYM (UINT64_C(1) << 12)
|
|
84
|
+
#define LL_FS_REFER (UINT64_C(1) << 13) /* ABI 2 */
|
|
85
|
+
#define LL_FS_TRUNCATE (UINT64_C(1) << 14) /* ABI 3 (ABI 4 added TCP bits only) */
|
|
86
|
+
#define LL_FS_IOCTL_DEV (UINT64_C(1) << 15) /* ABI 5 */
|
|
87
|
+
|
|
88
|
+
#define LL_ABI1_MASK (LL_FS_REFER - 1) /* bits 0..12: every ABI-1 access, nothing newer */
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* Newest ABI this build knows; the negotiation below scales the actual
|
|
92
|
+
* ruleset down to what the running kernel supports.
|
|
93
|
+
*/
|
|
94
|
+
#define MAX_ABI 5L
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
* Landlock has no libc wrappers; these are the raw syscalls. The numbers are
|
|
98
|
+
* identical on every architecture (the post-2011 unified table) — the
|
|
99
|
+
* fallbacks only matter to a libc older than the feature.
|
|
100
|
+
*/
|
|
101
|
+
#ifndef __NR_landlock_create_ruleset
|
|
102
|
+
#define __NR_landlock_create_ruleset 444
|
|
103
|
+
#define __NR_landlock_add_rule 445
|
|
104
|
+
#define __NR_landlock_restrict_self 446
|
|
105
|
+
#endif
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
* Every fatal launcher error prints `landlock-run: <message>` to stderr
|
|
109
|
+
* and exits 125 — a code the wrapped command itself is unlikely to use, so
|
|
110
|
+
* the executor can tell launcher failures from command failures.
|
|
111
|
+
*/
|
|
112
|
+
#define EXIT_LAUNCHER_FAILURE 125
|
|
113
|
+
|
|
114
|
+
static const char NOT_ENFORCED_MESSAGE[] =
|
|
115
|
+
"landlock is not enforced by this kernel (ABI unsupported or disabled)";
|
|
116
|
+
|
|
117
|
+
/* Print one fatal `landlock-run: ...` line; returns the fatal exit code. */
|
|
118
|
+
static int fail(const char *prefix, const char *detail) {
|
|
119
|
+
if (detail == NULL) {
|
|
120
|
+
fprintf(stderr, "landlock-run: %s\n", prefix);
|
|
121
|
+
} else {
|
|
122
|
+
fprintf(stderr, "landlock-run: %s: %s\n", prefix, detail);
|
|
123
|
+
}
|
|
124
|
+
return EXIT_LAUNCHER_FAILURE;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
static int fail_usage(const char *message, const char *detail) {
|
|
128
|
+
fprintf(stderr, "landlock-run: usage error: %s%s\n", message, detail == NULL ? "" : detail);
|
|
129
|
+
return EXIT_LAUNCHER_FAILURE;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Parsed CLI: either a probe, or grants plus the command argv after `--`. */
|
|
133
|
+
struct cli {
|
|
134
|
+
int probe;
|
|
135
|
+
const char **ro;
|
|
136
|
+
size_t ro_count;
|
|
137
|
+
const char **rw;
|
|
138
|
+
size_t rw_count;
|
|
139
|
+
char **command; /* NULL-terminated tail of main's argv */
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/*
|
|
143
|
+
* Hand-rolled argv parsing — four flags do not justify a parsing library.
|
|
144
|
+
* Returns 0 on success, else the process exit code (message already printed).
|
|
145
|
+
*/
|
|
146
|
+
static int parse(int argc, char **argv, struct cli *cli) {
|
|
147
|
+
/* argc bounds each grant list; the launcher execs or exits, so no free. */
|
|
148
|
+
cli->ro = calloc(argc > 0 ? (size_t)argc : 1, sizeof *cli->ro);
|
|
149
|
+
cli->rw = calloc(argc > 0 ? (size_t)argc : 1, sizeof *cli->rw);
|
|
150
|
+
if (cli->ro == NULL || cli->rw == NULL) return fail("out of memory", NULL);
|
|
151
|
+
|
|
152
|
+
int index = 1;
|
|
153
|
+
while (index < argc) {
|
|
154
|
+
const char *arg = argv[index];
|
|
155
|
+
if (strcmp(arg, "--probe") == 0) {
|
|
156
|
+
if (argc != 2) {
|
|
157
|
+
return fail_usage("--probe takes no other arguments", NULL);
|
|
158
|
+
}
|
|
159
|
+
cli->probe = 1;
|
|
160
|
+
index += 1;
|
|
161
|
+
} else if (strcmp(arg, "--ro") == 0 || strcmp(arg, "--rw") == 0) {
|
|
162
|
+
if (index + 1 >= argc) {
|
|
163
|
+
return fail_usage(arg, " requires a path");
|
|
164
|
+
}
|
|
165
|
+
if (strcmp(arg, "--ro") == 0) {
|
|
166
|
+
cli->ro[cli->ro_count++] = argv[index + 1];
|
|
167
|
+
} else {
|
|
168
|
+
cli->rw[cli->rw_count++] = argv[index + 1];
|
|
169
|
+
}
|
|
170
|
+
index += 2;
|
|
171
|
+
} else if (strcmp(arg, "--") == 0) {
|
|
172
|
+
cli->command = &argv[index + 1];
|
|
173
|
+
break;
|
|
174
|
+
} else {
|
|
175
|
+
return fail_usage("unknown argument: ", arg);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (!cli->probe && (cli->command == NULL || cli->command[0] == NULL)) {
|
|
179
|
+
return fail_usage("missing `-- <argv>...` command", NULL);
|
|
180
|
+
}
|
|
181
|
+
return 0;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* The filesystem accesses the running kernel's ABI can govern. */
|
|
185
|
+
static uint64_t fs_mask_for_abi(long abi) {
|
|
186
|
+
uint64_t mask = LL_ABI1_MASK;
|
|
187
|
+
if (abi >= 2) mask |= LL_FS_REFER;
|
|
188
|
+
if (abi >= 3) mask |= LL_FS_TRUNCATE;
|
|
189
|
+
if (abi >= 5) mask |= LL_FS_IOCTL_DEV;
|
|
190
|
+
return mask;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Add one path-beneath rule; 0 on success, else the exit code. */
|
|
194
|
+
static int add_rule(int ruleset_fd, const char *path, uint64_t access) {
|
|
195
|
+
int path_fd = open(path, O_PATH | O_CLOEXEC);
|
|
196
|
+
if (path_fd < 0) {
|
|
197
|
+
/* Fail closed on an unopenable grant root: silently narrowing the
|
|
198
|
+
* granted set would be safe, but running with a profile the caller did
|
|
199
|
+
* not get is not worth the ambiguity. */
|
|
200
|
+
fprintf(stderr, "landlock-run: cannot open rule path: %s: %s\n", path, strerror(errno));
|
|
201
|
+
return EXIT_LAUNCHER_FAILURE;
|
|
202
|
+
}
|
|
203
|
+
/* The kernel rejects directory-only accesses on a non-directory rule
|
|
204
|
+
* (EINVAL), so a file grant keeps only the file-compatible bits — how the
|
|
205
|
+
* `--rw /dev/null` grant works. */
|
|
206
|
+
struct stat st;
|
|
207
|
+
if (fstat(path_fd, &st) == 0 && !S_ISDIR(st.st_mode)) {
|
|
208
|
+
access &= LL_FS_EXECUTE | LL_FS_WRITE_FILE | LL_FS_READ_FILE | LL_FS_TRUNCATE | LL_FS_IOCTL_DEV;
|
|
209
|
+
}
|
|
210
|
+
struct landlock_path_beneath_attr attr = { .allowed_access = access, .parent_fd = path_fd };
|
|
211
|
+
if (syscall(__NR_landlock_add_rule, ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, &attr, 0) != 0) {
|
|
212
|
+
int saved = errno;
|
|
213
|
+
close(path_fd);
|
|
214
|
+
return fail("landlock ruleset error", strerror(saved));
|
|
215
|
+
}
|
|
216
|
+
close(path_fd);
|
|
217
|
+
return 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/*
|
|
221
|
+
* Install the ruleset on the current thread, negotiating the kernel's ABI
|
|
222
|
+
* down from MAX_ABI. `--ro` paths get the read side of the vocabulary (read
|
|
223
|
+
* file/dir + execute — the wrapped `bash` and everything it spawns must
|
|
224
|
+
* remain executable); `--rw` paths get every filesystem access the
|
|
225
|
+
* negotiated ABI can grant. Sets `no_new_privs` first (mandatory for an
|
|
226
|
+
* unprivileged restrict, and it neutralizes setuid/setgid escalation inside
|
|
227
|
+
* the sandbox). On success `*partial` reports whether the kernel governs
|
|
228
|
+
* only a subset of MAX_ABI's accesses. Returns 0, else the exit code.
|
|
229
|
+
*/
|
|
230
|
+
static int restrict_self(const struct cli *cli, int *partial) {
|
|
231
|
+
long abi = syscall(__NR_landlock_create_ruleset, NULL, 0, LANDLOCK_CREATE_RULESET_VERSION);
|
|
232
|
+
if (abi < 0) {
|
|
233
|
+
/* ENOSYS: kernel built without Landlock; EOPNOTSUPP: built but disabled.
|
|
234
|
+
* Either way: not enforceable — fail CLOSED, never exec unconfined. */
|
|
235
|
+
return fail(NOT_ENFORCED_MESSAGE, NULL);
|
|
236
|
+
}
|
|
237
|
+
*partial = abi < MAX_ABI;
|
|
238
|
+
uint64_t handled = fs_mask_for_abi(abi < MAX_ABI ? abi : MAX_ABI);
|
|
239
|
+
|
|
240
|
+
struct landlock_ruleset_attr attr = { .handled_access_fs = handled };
|
|
241
|
+
int ruleset_fd = (int)syscall(__NR_landlock_create_ruleset, &attr, sizeof attr, 0);
|
|
242
|
+
if (ruleset_fd < 0) return fail("landlock ruleset error", strerror(errno));
|
|
243
|
+
|
|
244
|
+
const uint64_t read_side = LL_FS_EXECUTE | LL_FS_READ_FILE | LL_FS_READ_DIR;
|
|
245
|
+
for (size_t i = 0; i < cli->ro_count; i++) {
|
|
246
|
+
int code = add_rule(ruleset_fd, cli->ro[i], read_side & handled);
|
|
247
|
+
if (code != 0) return code;
|
|
248
|
+
}
|
|
249
|
+
for (size_t i = 0; i < cli->rw_count; i++) {
|
|
250
|
+
int code = add_rule(ruleset_fd, cli->rw[i], handled);
|
|
251
|
+
if (code != 0) return code;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) != 0) {
|
|
255
|
+
return fail("landlock ruleset error", strerror(errno));
|
|
256
|
+
}
|
|
257
|
+
if (syscall(__NR_landlock_restrict_self, ruleset_fd, 0) != 0) {
|
|
258
|
+
return fail("landlock ruleset error", strerror(errno));
|
|
259
|
+
}
|
|
260
|
+
close(ruleset_fd);
|
|
261
|
+
return 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
int main(int argc, char **argv) {
|
|
265
|
+
struct cli cli = { 0 };
|
|
266
|
+
int code = parse(argc, argv, &cli);
|
|
267
|
+
if (code != 0) return code;
|
|
268
|
+
|
|
269
|
+
if (cli.probe) {
|
|
270
|
+
/* The functional probe: build and enforce a maximal ruleset in THIS
|
|
271
|
+
* short-lived process (the probe run exits right after). `--version`
|
|
272
|
+
* style checks would miss a kernel that has the syscalls but refuses
|
|
273
|
+
* enforcement; actually restricting is the only honest signal. The one
|
|
274
|
+
* report line is part of the launcher CLI contract — the executor reads
|
|
275
|
+
* enforcement completeness from it. */
|
|
276
|
+
static const char *probe_root = "/";
|
|
277
|
+
struct cli probe = { .ro = &probe_root, .ro_count = 1 };
|
|
278
|
+
int partial = 0;
|
|
279
|
+
code = restrict_self(&probe, &partial);
|
|
280
|
+
if (code != 0) return code;
|
|
281
|
+
printf("landlock: %s\n", partial ? "partially enforced (older ABI)" : "fully enforced");
|
|
282
|
+
return 0;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
int partial = 0;
|
|
286
|
+
code = restrict_self(&cli, &partial);
|
|
287
|
+
if (code != 0) return code;
|
|
288
|
+
if (partial) {
|
|
289
|
+
/* Older ABI: some handled accesses are not governed (e.g. truncate
|
|
290
|
+
* before ABI 3). Still confined for everything the kernel supports —
|
|
291
|
+
* report, do not refuse. */
|
|
292
|
+
fprintf(stderr, "landlock-run: partial enforcement (older Landlock ABI)\n");
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
execvp(cli.command[0], cli.command);
|
|
296
|
+
/* exec only returns on failure. */
|
|
297
|
+
return fail("exec failed", strerror(errno));
|
|
298
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, node-addon-landlock-run contributors
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write native/system/packages/darwin-arm64/README.md
|
|
5
|
+
README.md: 71cfaacc9bc442341b3a9d57389c2cb1904fbb70
|
|
6
|
+
README.zh.md: 5e54c8155009b98e3336ea612535ce08e56817ae
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Prebuilt system.node for macOS arm64 POSIX locks."
|
|
3
|
+
kind: "package-library"
|
|
4
|
+
---
|
|
5
|
+
# @deepseek-ai/node-addon-system-darwin-arm64
|
|
6
|
+
|
|
7
|
+
English | [中文](README.zh.md)
|
|
8
|
+
|
|
9
|
+
This platform package supplies `bin/system.node`, a stable Node-API v8 addon used by `@deepseek-ai/node-addon-system/flock`. It contains no Landlock executable, JavaScript loader, or installation build script. The native workflow builds it on macOS arm64 and owns its installed-artifact validation.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "为 macOS arm64 POSIX 锁提供预编译 system.node。"
|
|
3
|
+
kind: "package-library"
|
|
4
|
+
---
|
|
5
|
+
# @deepseek-ai/node-addon-system-darwin-arm64
|
|
6
|
+
|
|
7
|
+
[English](README.md) | 中文
|
|
8
|
+
|
|
9
|
+
此平台包提供 `bin/system.node`,供 `@deepseek-ai/node-addon-system/flock` 使用的稳定 Node-API v8 addon。它不包含 Landlock 可执行文件、JavaScript 加载器或安装构建脚本。Native 工作流在 macOS arm64 上构建它,并负责验证安装后的产物。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/node-addon-system-darwin-arm64",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Prebuilt POSIX flock Node-API binding for macOS arm64",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/deepseek-harness/deepseek-harness.git",
|
|
8
|
+
"directory": "native/system/packages/darwin-arm64"
|
|
9
|
+
},
|
|
10
|
+
"os": [
|
|
11
|
+
"darwin"
|
|
12
|
+
],
|
|
13
|
+
"cpu": [
|
|
14
|
+
"arm64"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"README.md",
|
|
18
|
+
"bin/",
|
|
19
|
+
"prebuilds.json"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"prepack": "node ../../scripts/verify-launcher-binary.mjs"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=20"
|
|
26
|
+
},
|
|
27
|
+
"license": "BSD-3-Clause",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, node-addon-landlock-run contributors
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write native/system/packages/darwin-x64/README.md
|
|
5
|
+
README.md: 1740788eef943373591a895baeb7207635972a46
|
|
6
|
+
README.zh.md: 644165743486a29e48bee7af33429ebf4f5d8fe2
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Prebuilt system.node for macOS x64 POSIX locks."
|
|
3
|
+
kind: "package-library"
|
|
4
|
+
---
|
|
5
|
+
# @deepseek-ai/node-addon-system-darwin-x64
|
|
6
|
+
|
|
7
|
+
English | [中文](README.zh.md)
|
|
8
|
+
|
|
9
|
+
This platform package supplies `bin/system.node`, a stable Node-API v8 addon used by `@deepseek-ai/node-addon-system/flock`. It contains no Landlock executable, JavaScript loader, or installation build script. The native workflow builds it on macOS x64 and owns its installed-artifact validation.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "为 macOS x64 POSIX 锁提供预编译 system.node。"
|
|
3
|
+
kind: "package-library"
|
|
4
|
+
---
|
|
5
|
+
# @deepseek-ai/node-addon-system-darwin-x64
|
|
6
|
+
|
|
7
|
+
[English](README.md) | 中文
|
|
8
|
+
|
|
9
|
+
此平台包提供 `bin/system.node`,供 `@deepseek-ai/node-addon-system/flock` 使用的稳定 Node-API v8 addon。它不包含 Landlock 可执行文件、JavaScript 加载器或安装构建脚本。Native 工作流在 macOS x64 上构建它,并负责验证安装后的产物。
|