@kahitsan/plugin-sdk 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +76 -0
  3. package/dist/index.js +1 -1
  4. package/package.json +27 -5
  5. package/shell/_build/.vite/manifest.json +59 -59
  6. package/shell/_build/.vite/manifest.json.br +0 -0
  7. package/shell/_build/.vite/manifest.json.gz +0 -0
  8. package/shell/_build/assets/{_...slug_-BNycC89F.js → _...slug_-BcdF4l5Z.js} +1 -1
  9. package/shell/_build/assets/_...slug_-BcdF4l5Z.js.br +0 -0
  10. package/shell/_build/assets/_...slug_-BcdF4l5Z.js.gz +0 -0
  11. package/shell/_build/assets/{api-keys-zDu0DTIi.js → api-keys-BNWgFkG0.js} +1 -1
  12. package/shell/_build/assets/{auth-CPW4mGTx.js → auth-DnjIzX2B.js} +5 -5
  13. package/shell/_build/assets/auth-DnjIzX2B.js.br +0 -0
  14. package/shell/_build/assets/auth-DnjIzX2B.js.gz +0 -0
  15. package/shell/_build/assets/client-BmadCoeU.css +1 -0
  16. package/shell/_build/assets/client-BmadCoeU.css.br +0 -0
  17. package/shell/_build/assets/client-BmadCoeU.css.gz +0 -0
  18. package/shell/_build/assets/client-StEn6jq1.js +2 -0
  19. package/shell/_build/assets/client-StEn6jq1.js.br +0 -0
  20. package/shell/_build/assets/client-StEn6jq1.js.gz +0 -0
  21. package/shell/_build/assets/{components-kMeatXhB.js → components-CWmQ2MDX.js} +1 -1
  22. package/shell/_build/assets/dashboard-pbkizuaa.js +1 -0
  23. package/shell/_build/assets/{index-dCQOOcel.js → index-CwObwzl5.js} +1 -1
  24. package/shell/_build/assets/login-pbkizuaa.js +1 -0
  25. package/shell/_build/assets/{members-CKVe_2mI.js → members-49i-57sG.js} +1 -1
  26. package/shell/_build/assets/plugin-ui-CBTroTyb.js +10 -0
  27. package/shell/_build/assets/plugin-ui-CBTroTyb.js.br +0 -0
  28. package/shell/_build/assets/plugin-ui-CBTroTyb.js.gz +0 -0
  29. package/shell/_build/assets/register-pbkizuaa.js +1 -0
  30. package/shell/_build/assets/routing-C6AwqsGL.js +1 -0
  31. package/shell/_build/assets/routing-C6AwqsGL.js.br +0 -0
  32. package/shell/_build/assets/routing-C6AwqsGL.js.gz +0 -0
  33. package/shell/_build/assets/settings-pbkizuaa.js +1 -0
  34. package/shell/_build/assets/users-pbkizuaa.js +1 -0
  35. package/shell/_build/assets/{workspace-nav-DsOJmRdY.js → workspace-nav-fkYL3-AV.js} +1 -1
  36. package/shell/_build/assets/workspace-nav-fkYL3-AV.js.br +0 -0
  37. package/shell/_build/assets/workspace-nav-fkYL3-AV.js.gz +0 -0
  38. package/shell/_build/assets/workspace-settings-pbkizuaa.js +1 -0
  39. package/shell/_build/assets/workspaces-pbkizuaa.js +1 -0
  40. package/shell/_server/assets/app-BmadCoeU.css +1 -0
  41. package/shell/_server/assets/app-BmadCoeU.css.br +0 -0
  42. package/shell/_server/assets/app-BmadCoeU.css.gz +0 -0
  43. package/shell/index.html +1 -1
  44. package/shell/index.html.br +0 -0
  45. package/shell/index.html.gz +0 -0
  46. package/shell/sw.js +2 -2
  47. package/shell/sw.js.br +0 -0
  48. package/shell/sw.js.gz +0 -0
  49. package/shell/_build/assets/_...slug_-BNycC89F.js.br +0 -0
  50. package/shell/_build/assets/_...slug_-BNycC89F.js.gz +0 -0
  51. package/shell/_build/assets/auth-CPW4mGTx.js.br +0 -0
  52. package/shell/_build/assets/auth-CPW4mGTx.js.gz +0 -0
  53. package/shell/_build/assets/client-B0tH7z8C.css +0 -1
  54. package/shell/_build/assets/client-B0tH7z8C.css.br +0 -0
  55. package/shell/_build/assets/client-B0tH7z8C.css.gz +0 -0
  56. package/shell/_build/assets/client-BuqEzg-5.js +0 -2
  57. package/shell/_build/assets/client-BuqEzg-5.js.br +0 -0
  58. package/shell/_build/assets/client-BuqEzg-5.js.gz +0 -0
  59. package/shell/_build/assets/dashboard-BwMkrsX2.js +0 -1
  60. package/shell/_build/assets/login-BwMkrsX2.js +0 -1
  61. package/shell/_build/assets/plugin-ui-rgxz3UHD.js +0 -10
  62. package/shell/_build/assets/plugin-ui-rgxz3UHD.js.br +0 -0
  63. package/shell/_build/assets/plugin-ui-rgxz3UHD.js.gz +0 -0
  64. package/shell/_build/assets/register-BwMkrsX2.js +0 -1
  65. package/shell/_build/assets/routing-BlHUL5zP.js +0 -1
  66. package/shell/_build/assets/routing-BlHUL5zP.js.br +0 -0
  67. package/shell/_build/assets/routing-BlHUL5zP.js.gz +0 -0
  68. package/shell/_build/assets/settings-BwMkrsX2.js +0 -1
  69. package/shell/_build/assets/users-BwMkrsX2.js +0 -1
  70. package/shell/_build/assets/workspace-nav-DsOJmRdY.js.br +0 -0
  71. package/shell/_build/assets/workspace-nav-DsOJmRdY.js.gz +0 -0
  72. package/shell/_build/assets/workspace-settings-BwMkrsX2.js +0 -1
  73. package/shell/_build/assets/workspaces-BwMkrsX2.js +0 -1
  74. package/shell/_server/assets/app-B0tH7z8C.css +0 -1
  75. package/shell/_server/assets/app-B0tH7z8C.css.br +0 -0
  76. package/shell/_server/assets/app-B0tH7z8C.css.gz +0 -0
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ @kahitsan/plugin-sdk — PROPRIETARY & CONFIDENTIAL
2
+ Copyright (c) KahitSan Corp. All rights reserved. Licensed, not sold.
3
+
4
+ This software is the property of KahitSan Corp. and is provided to authorized
5
+ licensees solely to build, run, and test plugins for the Hilinga ERP platform.
6
+
7
+ The published runtime (`dist/index.js`) is intentionally OBFUSCATED to protect
8
+ trade secrets. De-obfuscating, decompiling, reverse-engineering, beautifying, or
9
+ reconstructing its source is STRICTLY PROHIBITED by this license and by law,
10
+ including anti-circumvention statutes (e.g. 17 U.S.C. § 1201 / DMCA and
11
+ equivalents).
12
+
13
+ No part of this package may be copied, modified, redistributed, sublicensed, or
14
+ used to create a competing product without the prior written permission of
15
+ KahitSan Corp. (https://kahitsan.com).
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH
20
+ THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # @kahitsan/plugin-sdk
2
+
3
+ The author surface + dev toolkit for building [Hilinga](https://www.hilinga.com) ERP plugins —
4
+ build, run, and test a plugin locally against a **kernel-identical dev shell**, with **no kernel
5
+ source required**.
6
+
7
+ Hilinga is a kernel (`kserp`) plus process-isolated plugins. Each plugin is its own repo with its
8
+ own API routes, UI bundle, Postgres schema, migrations, and pm2 process. This package is the single
9
+ public specifier a plugin author installs: it provides the server bootstrap, the workspace-scoped
10
+ data surface, auth/permission guards, the cross-plugin RPC + wire-protocol verify surface, and a Bun
11
+ dev toolkit that boots your plugin inside the real, kernel-identical app shell.
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ npm install @kahitsan/plugin-sdk
17
+ ```
18
+
19
+ ## The dev toolkit
20
+
21
+ ```bash
22
+ npx @kahitsan/plugin-sdk <pluginDir> [<pluginDir> …]
23
+ ```
24
+
25
+ Boots a dev-kernel mediator + each plugin on [Bun](https://bun.sh) (local SQLite + a synthetic
26
+ logged-in admin) **entirely from the installed package** — no kernel checkout, no Postgres. It also
27
+ serves the prebuilt **kernel-identical host-UI shell** (sidebar, plugin route renderer, the settings
28
+ gear + modal — the real visual app), so you develop against what production actually renders.
29
+
30
+ Pass several plugin dirs to exercise the **contract between plugins** locally — does B expose the
31
+ method A consumes?
32
+
33
+ ```bash
34
+ npx @kahitsan/plugin-sdk ./kplugin_transactions ./kplugin_payees
35
+ ```
36
+
37
+ Requires [Bun](https://bun.sh). `Ctrl-C` stops every plugin.
38
+
39
+ ## The server surface — `createPluginServer`
40
+
41
+ `createPluginServer` is the one shared bootstrap. It collapses a plugin's hand-written
42
+ `server/main.ts` (manifest + port + pg pool + migrations + identity verify + RLS tenant context +
43
+ services + routers + listen) into a single call, and is the seam the Express → Bun + WS transport
44
+ cutover moves through. Opt-in capabilities (each gated by the kernel + consent model at runtime):
45
+
46
+ - `settings` — a plugin's private, workspace-scoped KV store (`ctx.settings`)
47
+ - `assets` — the kernel object store (`ctx.assets`)
48
+ - `kernel` — the kernel-data read channel (`ctx.kernel.workspace.get()`)
49
+ - `plugins` — the mediated inter-plugin call surface (`ctx.plugins.get(peer).call(...)`)
50
+ - `events` — emit a domain event the kernel fans out (`ctx.events.emit(topic, payload)`)
51
+ - `flows` — the §9 node-step flow authoring DSL (`buildFlow`, `defineFlow`), imported from
52
+ `@kahitsan/plugin-sdk/flow` (a browser-safe subpath with no Node built-ins, for plugin UI bundles)
53
+
54
+ The package **never** includes `signIdentity` (the identity-forging capability) or any shared
55
+ secret — that is the one genuine package-level boundary, enforced by the build's leak gate.
56
+
57
+ ## Authoring guide
58
+
59
+ The full new-plugin walkthrough lives in the Hilinga docs: **<https://kdocs.kahitsan.com>**
60
+ (`create-plugin/step-1…6`) and in-app at `/docs/plugins`.
61
+
62
+ ## Publishing (maintainers)
63
+
64
+ This repo publishes `@kahitsan/plugin-sdk` to public npm **independently of any kernel deploy**,
65
+ and builds with **ZERO live kernel** — no submodule, no `KERNEL_REPO_TOKEN`. The minimal `@ks-erp`
66
+ runtime/type surface the SDK inlines is **vendored** at `src/vendor-kernel/` (regenerate it from a
67
+ kernel checkout with `node sync-vendor.mjs <path-to-kserp>`), and the toolkit host-UI shell source
68
+ lives at `shell-src/` (`kserp/src` built with `KSERP_TOOLKIT=1`; its only kernel coupling is two
69
+ pure nav helpers vendored under `shell-src/kernel/`). `build.mjs` produces a self-contained,
70
+ obfuscated `dist/` and runs the K1/K2 leak gate over both the JS and the `.d.ts`; `npm run
71
+ build:shell` builds the kernel-identical static shell from `shell-src/`. CI is
72
+ `.github/workflows/publish-sdk.yml`.
73
+
74
+ ## License
75
+
76
+ Proprietary. Copyright (c) KahitSan Corp. All rights reserved. Licensed, not sold.