{"_id":"@dsh-io/identity-sentinel","name":"@dsh-io/identity-sentinel","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@dsh-io/identity-sentinel","version":"0.1.0","description":"Performance-art dsh plugin: the machine inspects its owner; non-Chinese verdicts terminate all workflows. Installing = informed consent.","type":"module","main":"lib/core/index.js","exports":{".":{"types":"./lib/core/index.d.ts","default":"./lib/core/index.js"},"./plugin":{"types":"./lib/plugin/index.d.ts","default":"./lib/plugin/index.js"}},"scripts":{"build":"tsc","test":"vitest run"},"dependencies":{"@deepseek-ai/cordis":"latest","@deepseek-ai/dsh-tools":"latest"},"devDependencies":{"@types/node":"^22.0.0","typescript":"^5.5.0","vitest":"^3.0.0"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"gitHead":"d7f3a2aae88e41a60eb33678d4d0d674460a148d","types":"./lib/core/index.d.ts","_id":"@dsh-io/identity-sentinel@0.1.0","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-xXYWfNPwNx/4/BAD3NW4jQ2YkE8pAGeeeL/wm/m8RdWJnqx3H8KaVlaYW87nUYC4ApsAUD6d88kS74guIdYeGQ==","shasum":"05cdf59178a4b5af5b4c22793f15994817682c78","tarball":"https://registry.npmjs.org/@dsh-io/identity-sentinel/-/identity-sentinel-0.1.0.tgz","fileCount":26,"unpackedSize":19457,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDNIH6DbI8HBvHc/skkcY8nRbeRIMYALtjSUqsTV9R+QAIgLs6wDoaURTauDJTxOIfE0eC2rsnH7G0+Agb4QkJLUAo="}]},"_npmUser":{"name":"lemonhub","email":"lemonhub@163.com"},"directories":{},"maintainers":[{"name":"lemonhub","email":"lemonhub@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/identity-sentinel_0.1.0_1786981555663_0.08473343175981118"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-17T15:45:55.324Z","0.1.0":"2026-08-17T15:45:55.814Z","modified":"2026-08-17T15:45:56.272Z"},"maintainers":[{"name":"lemonhub","email":"lemonhub@163.com"}],"description":"Performance-art dsh plugin: the machine inspects its owner; non-Chinese verdicts terminate all workflows. Installing = informed consent.","readme":"# Identity Sentinel · 身份哨兵\n\n> **⚠ CONSENT / 知情同意:** Installing this plugin means you have read this README and agree:\n> the plugin inspects your machine's local signals (locale, language, timezone, keyboard layout,\n> region format — all purely local, **zero network requests**). If the composite verdict is\n> \"not Chinese\" (mainland / Hong Kong / Macau / Taiwan), the plugin **terminates all workflows**.\n> If the verdict is Chinese, it does nothing. 安装本插件即视为已知情并同意上述行为。\n\n**THIS IS A PERFORMANCE ART PIECE.** This is not security tooling and not policy. It is a mirror\nheld up to the idea that a machine can — or should — judge the nationality of its operator.\n\n## How it works\n\n1. On startup the plugin collects **four local signals** — never sent anywhere:\n   - `locale` — system language / locale (`LC_ALL`, `LC_CTYPE`, `LANG`, Intl locale)\n   - `timezone` — e.g. `Asia/Shanghai`, `Asia/Hong_Kong`, `Asia/Taipei`, `Asia/Macau`\n   - `keyboard` — keyboard layout (`XKBLAYOUT` on Linux, `defaults` on macOS, registry on Windows)\n   - `region` — region part of the Intl locale (`CN`, `HK`, `MO`, `TW`)\n2. Signals are aggregated into an identity profile with a confidence score.\n3. A weighted rule engine renders a verdict:\n   - `non-cn` signals `>= threshold` (default **2**) and `forceTerminate` on → **terminate**\n   - otherwise → **pass** (nothing happens)\n4. On `terminate`: an art banner, the manifesto, and a termination declaration are printed;\n   the process exits with code 1. On `pass`: a banner is printed and a single introspection tool\n   (`system_identity`) is registered — nothing else changes.\n\nAmbiguous or undetectable signals never count toward the threshold. Each failing collector\ndegrades gracefully and is logged.\n\n## Install\n\n```bash\n# via the dsh plugin manager\ndsh plugin add <path-to-this-package>\n\n# or with a patch overlay on the web profile\nnpx @deepseek-ai/dsh --profile web --patch <abs-path>/cordis.patch.yml\n```\n\n**pnpm users** need the upstream peer fix (the official `latest` train still declares the\nunpublished `@deepseek-ai/dsh-type-meta` — see\n[deepseek-harness discussion #2862](https://github.com/deepseek-ai/deepseek-harness/discussions/2862)):\n\n```yaml\n# pnpm-workspace.yaml\noverrides:\n  \"@deepseek-ai/dsh-type-meta\": \"npm:@deepseek-ai/dsh-invariants@0.0.1-rc.1\"\n```\n\n## Tool\n\n`system_identity` — asks the machine for its current verdict about its owner:\nidentity (`cn` / `non-cn` / `unknown`), action, confidence, and the full signal list.\n\n## Embed\n\nThe core is a **zero-dependency pure-function library** — import it from any project:\n\n```ts\nimport {\n  collectSystemLocale, collectTimezone, collectKeyboard, collectRegion,\n  aggregateIdentity, decide, renderArt,\n} from '@dsh-io/identity-sentinel'\n```\n\n## Configuration\n\n| Option | Type | Default | Meaning |\n|---|---|---|---|\n| `threshold` | number | 2 | Non-CN signals required to terminate |\n| `artMode` | boolean | true | Print the art banners |\n| `forceTerminate` | boolean | true | Actually exit (code 1) on a non-CN verdict; `false` = banners only |\n\n## License\n\nMIT © 2026 dsh-io","readmeFilename":"README.md","_rev":"1-382cf79941266862ed8d4ede912e0d02"}