@npayload/sdk 0.0.0-stage → 5.0.4

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 (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -2
  3. package/dist/chunk-22PYMXSS.mjs +1 -0
  4. package/dist/chunk-26BFOUGE.mjs +1 -0
  5. package/dist/chunk-2N25V56J.mjs +20 -0
  6. package/dist/chunk-2OCUKD3K.mjs +1 -0
  7. package/dist/chunk-2PCG57PX.mjs +1 -0
  8. package/dist/chunk-2XQXDEXA.mjs +1 -0
  9. package/dist/chunk-455C67EN.mjs +1 -0
  10. package/dist/chunk-4HVQZC7R.mjs +1 -0
  11. package/dist/chunk-4NWQCPI4.mjs +1 -0
  12. package/dist/chunk-52ZB3ZAG.mjs +1 -0
  13. package/dist/chunk-5SMWYS7Z.mjs +1 -0
  14. package/dist/chunk-5YK2JKKH.mjs +17 -0
  15. package/dist/chunk-6NCRQ746.mjs +9 -0
  16. package/dist/chunk-6RMN6EHY.mjs +1 -0
  17. package/dist/chunk-6ZOPXG44.mjs +64 -0
  18. package/dist/chunk-76OM2ZBO.mjs +5 -0
  19. package/dist/chunk-A7HA64P6.mjs +1 -0
  20. package/dist/chunk-APBVAT7F.mjs +1 -0
  21. package/dist/chunk-BBHWYMQA.mjs +1 -0
  22. package/dist/chunk-BMMAZIUY.mjs +1 -0
  23. package/dist/chunk-CJDCY2NH.mjs +1 -0
  24. package/dist/chunk-EL7XOWA4.mjs +1 -0
  25. package/dist/chunk-EXNCOEHS.mjs +1 -0
  26. package/dist/chunk-FAO3QJC5.mjs +1 -0
  27. package/dist/chunk-FNAZW7X3.mjs +3 -0
  28. package/dist/chunk-GEJT7NMK.mjs +1 -0
  29. package/dist/chunk-GGXNXM73.mjs +1 -0
  30. package/dist/chunk-GKDZ7663.mjs +1 -0
  31. package/dist/chunk-HTQLUO4J.mjs +1 -0
  32. package/dist/chunk-II74EBLQ.mjs +1 -0
  33. package/dist/chunk-JBAV2AQK.mjs +1 -0
  34. package/dist/chunk-KUJJYP3K.mjs +22 -0
  35. package/dist/chunk-LJNU5QHZ.mjs +1 -0
  36. package/dist/chunk-LT2DQLXJ.mjs +1 -0
  37. package/dist/chunk-MDW42OG6.mjs +8 -0
  38. package/dist/chunk-MPYL6HQR.mjs +1 -0
  39. package/dist/chunk-OA73YMB6.mjs +6 -0
  40. package/dist/chunk-PKG2R6XN.mjs +1 -0
  41. package/dist/chunk-QUJ2IZXU.mjs +1 -0
  42. package/dist/chunk-RIBBVOCC.mjs +1 -0
  43. package/dist/chunk-TQFAYJEP.mjs +4 -0
  44. package/dist/chunk-UMQ2SWSM.mjs +5 -0
  45. package/dist/chunk-WE3NRBO6.mjs +1 -0
  46. package/dist/chunk-XLK55DEY.mjs +1 -0
  47. package/dist/chunk-YHY7Y4HD.mjs +4 -0
  48. package/dist/chunk-YQVQTVHK.mjs +2 -0
  49. package/dist/cli/index.d.mts +54 -0
  50. package/dist/cli/index.d.ts +54 -0
  51. package/dist/cli/index.js +852 -0
  52. package/dist/cli/index.mjs +696 -0
  53. package/dist/events/index.d.mts +10 -0
  54. package/dist/events/index.d.ts +10 -0
  55. package/dist/events/index.js +1 -0
  56. package/dist/events/index.mjs +1 -0
  57. package/dist/index.d.mts +49687 -0
  58. package/dist/index.d.ts +49687 -0
  59. package/dist/index.js +2 -0
  60. package/dist/index.mjs +2 -0
  61. package/package.json +120 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The npayload authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,157 @@
1
- # Temporary Holding Version
1
+ # npayload
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ npayload makes your systems autonomous, on one platform. This package is the
4
+ SDK and the CLI for the whole platform: `np.events`, `np.pipes`, `np.primus`
5
+ (AI agents), `np.connect` and `np.feed`.
6
+
7
+ ```bash
8
+ npm install @npayload/sdk
9
+ ```
10
+
11
+ The package ships the SDK, the `npayload` CLI (also callable as `np`) and its MCP server for coding agents.
12
+
13
+ ## Quickstart
14
+
15
+ ```bash
16
+ npx @npayload/sdk init # provision credentials and scaffold a project (device flow)
17
+ # or, non-interactive:
18
+ np login --org <org> --app <app> --env sandbox
19
+ ```
20
+
21
+ ```ts
22
+ import { NPayload } from "@npayload/sdk";
23
+
24
+ // The credentials `npx @npayload/sdk init` wrote into your project's .env, on npayload's production API
25
+ // (on another npayload deployment, pass its API as `baseUrl`: see Transports below)
26
+ const np = await NPayload.connect({ clientId: process.env.NPAYLOAD_CLIENT_ID! });
27
+
28
+ // Publish an event to a channel, by the channel's slug
29
+ await np.events.publish("orders", { orderId: "ord_123", total: 4200 }, { routingKey: "order.confirmed" });
30
+
31
+ // Manage channels, subscriptions, pipes and agents the same way
32
+ const channels = await np.events.channels.list();
33
+ ```
34
+
35
+ ## Transports
36
+
37
+ The live connection (NPP), npayload's own signed protocol, is the default
38
+ transport for publish, subscribe and delivery. Every frame is signed (Ed25519)
39
+ with your app's key. HTTP/JSON is a permanent opt-in:
40
+
41
+ ```ts
42
+ import { NPayload } from "@npayload/sdk";
43
+
44
+ const np = await NPayload.connect({ clientId: process.env.NPAYLOAD_CLIENT_ID!, transport: "http" }); // explicit opt-in
45
+ // or NPAYLOAD_TRANSPORT=http, or `np --transport http` on the CLI
46
+ ```
47
+
48
+ By default the SDK and the CLI reach npayload's hosted service: its API at
49
+ `api.npayload.com`, which also serves sign-in, and the live connection at
50
+ `npp.npayload.com`. Nothing writes those defaults into your `.env`.
51
+
52
+ To use another npayload deployment, a private one or a local one while you
53
+ develop, name its API, its sign-in host and its live connection together:
54
+
55
+ - In code, with the `baseUrl`, `authUrl` and `edgeUrl` options of
56
+ `NPayload.connect` and `new NPayload`.
57
+ - In the shell that runs `np`, `npx @npayload/sdk init` or `np login`, with
58
+ `NPAYLOAD_API_URL`, `NPAYLOAD_AUTH_URL` and `NPAYLOAD_EDGE_URL`. The CLI reads
59
+ your project's `.env` to see which deployment you are on, but dials only what
60
+ the shell exports, so export them.
61
+ - For a new project, `npx @npayload/sdk init --edge-url <url>` writes that live
62
+ connection into its `.env`; a `.env` that already holds your credentials is
63
+ kept as it is.
64
+
65
+ One run, one deployment. As soon as any address you set is outside
66
+ `npayload.com` (a look-alike such as `evilnpayload.com` or
67
+ `api.npayload.com.evil.test` is outside), nothing the run sends goes to the
68
+ hosted service: no token request, sign-in, publish, subscribe or management
69
+ call, and no redirect there is followed. Anything that would go there is
70
+ refused before a request is sent, with a `TransportUnavailableError` in code
71
+ and the code `TRANSPORT_UNAVAILABLE` printed by `np`; the error names what to
72
+ set, and nothing is retried after it.
73
+
74
+ There is no silent fallback between transports: if the live connection is
75
+ selected (or defaulted) and unavailable, calls fail with a typed
76
+ `TransportUnavailableError`. The details are in the docs:
77
+ https://docs.npayload.com/docs/concepts/transports.
78
+
79
+ ## Webhooks
80
+
81
+ ```ts
82
+ import { WebhookHandler } from "@npayload/sdk";
83
+
84
+ const webhooks = new WebhookHandler();
85
+ // The raw request body, the request's headers and your endpoint's signing secret
86
+ const event = await webhooks.constructEvent(rawBody, req.headers, endpointSecret);
87
+ ```
88
+
89
+ During development, pair a local listener with a synthetic trigger:
90
+
91
+ ```bash
92
+ np listen --forward http://localhost:3000/api/webhooks # temporary subscription, forwarded to your handler
93
+ np trigger order.confirmed # fire a sample event at it
94
+ ```
95
+
96
+ ## Networks and fingerprints
97
+
98
+ npayload serves a machine call only when it comes from a network its app
99
+ environment declares, and, once your API key's instances are enrolled, only
100
+ when it presents an enrolled key fingerprint. An administrator declares the
101
+ networks in the dashboard under Settings > Security > Networks.
102
+
103
+ An instance's fingerprint is the RFC 7638 thumbprint of its DPoP public key.
104
+ Keep the key to keep the fingerprint: `NPayload.connect()` uses the key you pass
105
+ as `dpopPrivateJwk`, else the one in `NPAYLOAD_DPOP_PRIVATE_JWK` (which
106
+ `npx @npayload/sdk init` writes into your `.env`), else a new one on every start.
107
+
108
+ ```ts
109
+ import { NPayload, NPayloadSourceNotAllowedError, NPayloadFingerprintNotEnrolledError } from "@npayload/sdk";
110
+
111
+ const np = await NPayload.connect({ clientId: process.env.NPAYLOAD_CLIENT_ID! });
112
+ const fingerprint = await np.fingerprint(); // the value the dashboard lists under the API key
113
+
114
+ try {
115
+ await np.enroll(); // the first connection, made now, while the key's enrollment window is open
116
+ } catch (err) {
117
+ if (err instanceof NPayloadSourceNotAllowedError) {
118
+ // this machine's network is not declared for the environment (err.reason: "not_allowed" | "not_declared")
119
+ } else if (err instanceof NPayloadFingerprintNotEnrolledError) {
120
+ // the window is closed and err.fingerprint is not enrolled for this API key
121
+ } else {
122
+ throw err;
123
+ }
124
+ }
125
+ ```
126
+
127
+ A call refused for its network is tried once more on a fresh token, then
128
+ rejects with `NPayloadSourceNotAllowedError`; a call refused for its fingerprint
129
+ rejects with `NPayloadFingerprintNotEnrolledError` at once. Neither error
130
+ carries your address. The `np` CLI prints the address this machine reaches
131
+ npayload from, read on your machine and sent nowhere, with the entry to add.
132
+
133
+ ## CLI highlights
134
+
135
+ | Command | What it does |
136
+ |---|---|
137
+ | `np init` / `np login` | Provision credentials (device flow or flags); stored in the OS keychain |
138
+ | `np pull` / `np deploy` | Config as code: secrets always become `{{ secrets.… }}` references, never literals |
139
+ | `np validate` | Fails on raw secret values in config |
140
+ | `np listen` | Forward live webhooks to localhost with signature headers intact |
141
+ | `np trigger <event-type>` | Fire a sample event (catalogue example or `--payload-file`) |
142
+ | `np tail <channel>` | Watch events arrive on a channel, live |
143
+ | `np doctor` | Environment, network and auth diagnostics |
144
+
145
+ ## Requirements
146
+
147
+ Node.js 22.23.4 or later on the 22 line, 24.22.1 or later on the 24 line, or 26.12.1 and later. These are the
148
+ first releases with the fixes of the [Node.js security release of October 2026](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases).
149
+ Node.js 20 and older are end-of-life and are not supported. Check with `node --version`.
150
+
151
+ ## Documentation
152
+
153
+ - Docs: https://docs.npayload.com
154
+
155
+ ## License
156
+
157
+ MIT, see [LICENSE](./LICENSE).
@@ -0,0 +1 @@
1
+ import{d as a,e as b,f as c,g as d}from"./chunk-2N25V56J.mjs";import"./chunk-MDW42OG6.mjs";import"./chunk-6RMN6EHY.mjs";import"./chunk-RIBBVOCC.mjs";import"./chunk-76OM2ZBO.mjs";import"./chunk-2OCUKD3K.mjs";import"./chunk-6ZOPXG44.mjs";import"./chunk-TQFAYJEP.mjs";import"./chunk-4NWQCPI4.mjs";import"./chunk-FAO3QJC5.mjs";import"./chunk-455C67EN.mjs";import"./chunk-CJDCY2NH.mjs";import"./chunk-2XQXDEXA.mjs";import"./chunk-XLK55DEY.mjs";import"./chunk-UMQ2SWSM.mjs";import"./chunk-YQVQTVHK.mjs";import"./chunk-OA73YMB6.mjs";import"./chunk-BMMAZIUY.mjs";import"./chunk-WE3NRBO6.mjs";import"./chunk-YHY7Y4HD.mjs";import"./chunk-GGXNXM73.mjs";import"./chunk-LJNU5QHZ.mjs";export{c as pullScopesIntoManifest,d as registerScopes,b as runScopesDiff,a as runScopesFix};
@@ -0,0 +1 @@
1
+ import{a,b,c}from"./chunk-MDW42OG6.mjs";import"./chunk-LJNU5QHZ.mjs";export{c as appendAccessScopes,a as renderScopesArray,b as setAccessScopes};
@@ -0,0 +1,20 @@
1
+ import{b as P,c as R}from"./chunk-MDW42OG6.mjs";import{a as b}from"./chunk-6RMN6EHY.mjs";import{a as y,b as G}from"./chunk-RIBBVOCC.mjs";import{g as x,k as g,l as h,o as m,p as w}from"./chunk-6ZOPXG44.mjs";import{f as S}from"./chunk-UMQ2SWSM.mjs";import{a as c}from"./chunk-LJNU5QHZ.mjs";import{readFileSync as _,writeFileSync as D}from"fs";import a from"chalk";import{existsSync as u,readFileSync as $,watch as j}from"fs";import{resolve as C,join as d}from"path";function L(o){if(o){let e=C(process.cwd(),o);return u(e)?[e]:[]}let t=[];for(let e of["events","primus","pipes"])for(let n of[d("npayload",`${e}.config.ts`),`${e}.config.ts`]){let r=d(process.cwd(),n);u(r)&&t.push(r)}return t}c(L,"findAllConfigs");function I(o,t){if(u(o))try{for(let e of $(o,"utf8").split(`
2
+ `)){let n=e.trim();if(!n||n.startsWith("#"))continue;let r=n.indexOf("=");if(!(r===-1||n.slice(0,r).trim()!==t))return n.slice(r+1).trim().replace(/^["']|["']$/g,"")}}catch{}}c(I,"readEnvVar");function v(o){if(o)return o;let t=process.env.NPAYLOAD_APP_ID?.trim();if(t)return t;for(let e of[d(process.cwd(),".env"),d(process.cwd(),"npayload",".env")]){let n=I(e,"NPAYLOAD_APP_ID");if(n)return n}for(let e=process.cwd(),n=0;n<5;n++){let r=d(e,".npayload.json");if(u(r))try{let i=JSON.parse($(r,"utf8"));if(typeof i.appId=="string"&&i.appId.trim())return i.appId.trim()}catch{}let s=d(e,"..");if(s===e)break;e=s}}c(v,"resolveAppGid");function M(o,t,e=300,n){let r=null,s=c(()=>{r&&clearTimeout(r),r=setTimeout(()=>void t("change"),e)},"bump"),i=o.map(p=>j(p,s)),f=new Promise(p=>{process.on("SIGINT",()=>p())});return n===void 0?f:Promise.race([f,n.ended]).catch(p=>{r&&clearTimeout(r);for(let l of i)l.close();throw p})}c(M,"watchConfigs");function k(o,t){return{...o!==void 0?{cwd:o}:{},components:t}}c(k,"floorOptions");function A(o,t){let e=x(o);e.length!==0&&t?.(a.dim(` (declared component(s) not embeddable \u2014 they contribute no scope: ${e.join(", ")})
3
+ `))}c(A,"reportInertComponents");async function F(o={}){let t=m(o.cwd),e=t?.path??w(o.cwd);if(!t||!e)throw new Error("no npayload.toml found \u2014 `np scopes fix` needs a manifest with an [access_scopes] block.");h(t.accessScopes);let n=o.floor??await y(k(o.cwd,t.embedComponents));A(t.embedComponents,o.log);let r=G(t.accessScopes,n),s=r.filter(l=>g(l)),i=r.filter(l=>!g(l));if(i.length>0&&o.log?.(a.dim(` (skipped ${i.length} non-catalog projection scope(s) \u2014 not declarable in [access_scopes]: ${i.join(", ")})
4
+ `)),s.length===0)return o.log?.(a.dim(` [access_scopes] already covers the projected floor \u2014 nothing to add.
5
+ `)),{appended:[],path:e,covered:!0};let f=_(e,"utf8"),p=R(f,t.accessScopes,s);return D(e,p,"utf8"),o.log?.(a.green(`\u2713 appended ${s.length} floor scope(s) to [access_scopes]:
6
+ ${s.join(`
7
+ `)}
8
+ `)),{appended:s,path:e,covered:!0}}c(F,"runScopesFix");async function T(o={}){let t=m(o.cwd);if(!t)throw new Error("no npayload.toml found \u2014 `np scopes diff` needs a manifest with an [access_scopes] block.");h(t.accessScopes);let e=o.floor??await y(k(o.cwd,t.embedComponents)),n=o.appGid??v(),r=null;o.readRemoteGrant&&n&&(r=await o.readRemoteGrant(n));let s=b({declared:t.accessScopes,floor:e,remote:r??{scopes:[],configDrift:!1}}),i=o.log??(f=>process.stdout.write(f));switch(A(t.embedComponents,i),s.kind){case"floor-gap":i(a.yellow(`\u2717 [access_scopes] is missing ${s.gap.length} floor scope(s):
9
+ ${s.gap.join(`
10
+ `)}
11
+ `)),i(a.dim(" run `npayload scopes fix` to add them.\n"));break;case"conflict":i(a.yellow(`\u2717 remote grant has drifted from the manifest:
12
+ `)),i(a.dim(` manifest : ${s.diff.manifest.join(", ")||"(none)"}
13
+ `)),i(a.dim(` remote : ${s.diff.remote.join(", ")||"(none)"}
14
+ `)),i(a.dim(` resolve on push with --accept-remote or --overwrite-remote.
15
+ `));break;case"sync":i(a.green(`\u2713 [access_scopes] covers the floor and matches the remote grant (${s.grant.length} scope(s)).
16
+ `));break;case"accept-remote":i(a.green(`\u2713 resolvable via --accept-remote.
17
+ `));break}return s}c(T,"runScopesDiff");async function Z(o){let t=m(o.cwd),e=t?.path??w(o.cwd);if(!t||!e)return null;let n=o.appGid??v();if(!n)return null;let r=await o.readRemoteGrant(n);if(!r)return null;let s=[...new Set(r.scopes)].sort(),i=P(_(e,"utf8"),s);return D(e,i,"utf8"),o.log?.(a.green(`\u2713 pulled ${s.length} scope(s) from the remote grant into [access_scopes].
18
+ `)),{written:s,path:e}}c(Z,"pullScopesIntoManifest");async function E(o){let{restoreSession:t}=await import("./chunk-QUJ2IZXU.mjs"),e=await t();return e?e.getOacGrant(o):null}c(E,"sessionGrantReader");function ee(o){let t=o.command("scopes").description("Scopes-as-code: inspect and reconcile the manifest's [access_scopes] against the floor + the remote grant");t.command("diff").description("Show the floor gap + manifest\u21C4remote drift for [access_scopes]. Exit 0 in sync, 2 with a gap/conflict, 1 on error.").action(async()=>{try{let e=await T({readRemoteGrant:E});process.exit(e.kind==="sync"||e.kind==="accept-remote"?0:2)}catch(e){process.stderr.write(a.red(`${S(`scopes diff failed: ${e instanceof Error?e.message:String(e)}`,e)}
19
+ `)),process.exit(1)}}),t.command("fix").description("Append exactly the projected-floor gap to the manifest's [access_scopes] (idempotent)").action(async()=>{try{await F({log:c(e=>process.stdout.write(e),"log")}),process.exit(0)}catch(e){process.stderr.write(a.red(`scopes fix failed: ${e instanceof Error?e.message:String(e)}
20
+ `)),process.exit(1)}})}c(ee,"registerScopes");export{L as a,v as b,M as c,F as d,T as e,Z as f,ee as g};
@@ -0,0 +1 @@
1
+ import{F as i,G as c}from"./chunk-6ZOPXG44.mjs";import{a as e,b as n,c as t}from"./chunk-FAO3QJC5.mjs";import{a as o}from"./chunk-LJNU5QHZ.mjs";var a={events:e,pipes:n,primus:t};async function u(){let s=new Set;for(let[f,p]of Object.entries(a)){let r=i(f);if(!r)continue;let g=await c(r);for(let m of p(g))s.add(m)}return[...s].sort()}o(u,"projectAllPermissions");export{u as a};
@@ -0,0 +1 @@
1
+ import{F as a,G as b,H as c,I as d,J as e,K as f,L as g,M as h,N as i,O as j,P as k,Q as l,R as m,S as n,T as o,U as p,V as q,W as r,X as s,Y as t,Z as u,_ as v}from"./chunk-6ZOPXG44.mjs";import"./chunk-TQFAYJEP.mjs";import"./chunk-4NWQCPI4.mjs";import"./chunk-CJDCY2NH.mjs";import"./chunk-2XQXDEXA.mjs";import"./chunk-XLK55DEY.mjs";import"./chunk-UMQ2SWSM.mjs";import"./chunk-YQVQTVHK.mjs";import"./chunk-OA73YMB6.mjs";import"./chunk-BMMAZIUY.mjs";import"./chunk-WE3NRBO6.mjs";import"./chunk-YHY7Y4HD.mjs";import"./chunk-GGXNXM73.mjs";import"./chunk-LJNU5QHZ.mjs";export{c as READ_ONLY_SEND_BUDGET,h as assertPlanHasNoFailures,v as assertPushHasNoRawSecretHeaders,d as buildKernel,j as canonicalEntryOrder,k as canonicalPlan,o as changedFields,m as envFromCommandLine,g as failedRows,u as findConfig,a as findConfigForProduct,p as immutableDrift,q as isAlreadyExistsError,b as loadEventsConfig,f as planCreatePathParams,i as planThenApply,s as registerDeploy,e as resolveAppIdPublic,r as resolveExistingByIdentity,t as runDeploy,n as syncExitCode,l as yesFromCommandLine};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-LJNU5QHZ.mjs";var t="f4d5410c733e4c4a28858907bb7addc6d1fd34280961bdfb74cf0ac7a0a8419b";function s(n){return n}e(s,"defineEventsConfig");var r={channels:{identity:"slug",deps:[],refs:{},ops:{archive:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelId/archive",scopes:["channels:admin"],pathParams:{channelId:"channelGid"}},create:{convexFn:"",method:"POST",pattern:"/v1/apps/channels",scopes:["channels:write"]},list:{convexFn:"",method:"GET",pattern:"/v1/apps/channels",scopes:["channels:read"]},pause:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelId/pause",scopes:["channels:write"],pathParams:{channelId:"channelGid"}},remove:{convexFn:"",method:"DELETE",pattern:"/v1/channels/:channelId",scopes:["channels:admin"],pathParams:{channelId:"channelGid"}},resume:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelId/resume",scopes:["channels:write"],pathParams:{channelId:"channelGid"}},update:{convexFn:"",method:"PATCH",pattern:"/v1/channels/:channelId",scopes:["channels:write"],pathParams:{channelId:"channelGid"},updatable:["complianceClass","nppMinQos","rateLimit","name","description","status","schema","settings","privacy","replication","compactionConfig","schemaValidation","platformConnectEnforcement","metadata","pii"]}}},consumerGroups:{identity:"name",deps:["channels"],refs:{channelGid:{parent:"channels",product:"events",wire:"gid",identity:"slug",array:!1,publicField:"channelGid"}},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelGid/consumer-groups",scopes:["consumer_groups:write"],pathParams:{channelGid:"channelGid"}},join:{convexFn:"",method:"POST",pattern:"/v1/consumer-groups/:consumerGroupGid/members",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid"},updatable:["subscriptionGid"]},leave:{convexFn:"",method:"DELETE",pattern:"/v1/consumer-groups/:consumerGroupGid/members/:subscriptionGid",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid",subscriptionGid:"subscriptionGid"}},list:{convexFn:"",method:"GET",pattern:"/v1/channels/:channelGid/consumer-groups",scopes:["consumer_groups:read"],pathParams:{channelGid:"channelGid"}},pause:{convexFn:"",method:"POST",pattern:"/v1/consumer-groups/:consumerGroupGid/pause",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid"}},resume:{convexFn:"",method:"POST",pattern:"/v1/consumer-groups/:consumerGroupGid/resume",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid"}},update:{convexFn:"",method:"PATCH",pattern:"/v1/consumer-groups/:consumerGroupGid",scopes:["consumer_groups:write"],pathParams:{consumerGroupGid:"groupGid"},updatable:["strategy","maxConcurrency"]}}},eventTypes:{identity:"name",deps:["channels"],refs:{channels:{parent:"channels",product:"events",wire:"gid",identity:"slug",array:!0,publicField:"channels"}},ops:{activate:{convexFn:"",method:"POST",pattern:"/v1/events/types/:eventTypeGid/activate",scopes:["catalogue:write"],pathParams:{eventTypeGid:"eventTypeGid"}},deprecate:{convexFn:"",method:"POST",pattern:"/v1/events/types/:eventTypeGid/deprecate",scopes:["catalogue:admin"],pathParams:{eventTypeGid:"eventTypeGid"},updatable:["message","sunsetDate"]},list:{convexFn:"",method:"GET",pattern:"/v1/apps/events/types",scopes:["catalogue:read"]},create:{convexFn:"",method:"POST",pattern:"/v1/apps/events/types",scopes:["catalogue:write"]},registerVersion:{convexFn:"",method:"POST",pattern:"/v1/events/types/:eventTypeGid/versions",scopes:["catalogue:write"],pathParams:{eventTypeGid:"eventTypeGid"},updatable:["version","schema","compatibility","changelog","publishedBy"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/events/types/:eventTypeGid",scopes:["catalogue:write"],pathParams:{eventTypeGid:"eventTypeGid"},updatable:["displayName","description","ownership","channels","tags","schema"]}}},exchanges:{identity:"name",deps:[],refs:{},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/exchanges",scopes:["exchanges:write"]},createBinding:{convexFn:"",method:"POST",pattern:"/v1/exchanges/:exchange_gid/bindings",scopes:["exchanges:write"],pathParams:{exchange_gid:"exchangeGid"},updatable:["channelGid","routingKey","headerRules"]},pause:{convexFn:"",method:"POST",pattern:"/v1/exchanges/:exchange_gid/disable",scopes:["exchanges:write"],pathParams:{exchange_gid:"exchangeGid"}},resume:{convexFn:"",method:"POST",pattern:"/v1/exchanges/:exchange_gid/enable",scopes:["exchanges:write"],pathParams:{exchange_gid:"exchangeGid"}},list:{convexFn:"",method:"GET",pattern:"/v1/exchanges",scopes:["exchanges:read"]},remove:{convexFn:"",method:"DELETE",pattern:"/v1/exchanges/:exchange_gid",scopes:["exchanges:admin"],pathParams:{exchange_gid:"exchangeGid"}},removeBinding:{convexFn:"",method:"DELETE",pattern:"/v1/exchange-bindings/:binding_gid",scopes:["exchanges:write"],pathParams:{binding_gid:"bindingGid"}},update:{convexFn:"",method:"PATCH",pattern:"/v1/exchanges/:exchange_gid",scopes:["exchanges:write"],pathParams:{exchange_gid:"exchangeGid"},updatable:["config"]}}},subscriptions:{identity:"name",deps:["channels"],refs:{channelGid:{parent:"channels",product:"events",wire:"gid",identity:"slug",array:!1,publicField:"channelGid"}},ops:{archive:{convexFn:"",method:"POST",pattern:"/v1/subscriptions/:subscriptionId/archive",scopes:["subscriptions:write"],pathParams:{subscriptionId:"subscriptionGid"}},create:{convexFn:"",method:"POST",pattern:"/v1/channels/:channelId/subscriptions",scopes:["subscriptions:write"],pathParams:{channelId:"channelGid"}},list:{convexFn:"",method:"GET",pattern:"/v1/channels/:channelId/subscriptions",scopes:["subscriptions:read"],pathParams:{channelId:"channelGid"}},pause:{convexFn:"",method:"POST",pattern:"/v1/subscriptions/:subscriptionId/pause",scopes:["subscriptions:write"],pathParams:{subscriptionId:"subscriptionGid"}},remove:{convexFn:"",method:"DELETE",pattern:"/v1/subscriptions/:subscriptionId",scopes:["subscriptions:admin"],pathParams:{subscriptionId:"subscriptionGid"}},resume:{convexFn:"",method:"POST",pattern:"/v1/subscriptions/:subscriptionId/resume",scopes:["subscriptions:write"],pathParams:{subscriptionId:"subscriptionGid"}},update:{convexFn:"",method:"PATCH",pattern:"/v1/subscriptions/:subscriptionId",scopes:["subscriptions:write"],pathParams:{subscriptionId:"subscriptionGid"},updatable:["description","status","filter","endpoint","delivery","dlq","metadata","deliveryConfig","transformPipeId","transformTimeout","transformOnFailure"]}}}};var o="41cca5221cf2d3f14ebe43426ffadbc50816dfa8db8d6325205687a732db66dc";function c(n){return n}e(c,"definePrimusConfig");var p={agents:{identity:"slug",deps:["skills"],refs:{skills:{parent:"skills",product:"primus",wire:"gid",identity:"name",array:!0,publicField:"skills"}},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/primus/agents",scopes:["agents:write"]},list:{convexFn:"",method:"GET",pattern:"/v1/primus/agents",scopes:["agents:read"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/primus/agents/:agentId",scopes:["agents:write"],pathParams:{agentId:"agentGid"},updatable:["name","description","systemPrompt","personality","language","skills","enabledIntegrations","trustLevel","defaultModel","maxTurns","config"]}}},skills:{identity:"slug",deps:[],refs:{},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/primus/skills",scopes:["skills:write"]},list:{convexFn:"",method:"GET",pattern:"/v1/primus/skills",scopes:["skills:read"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/primus/skills/:skillId",scopes:["skills:write"],pathParams:{skillId:"skillGid"},updatable:["name","description","category","icon","executor","enabled","definition","limits"]}}},tools:{identity:"slug",deps:[],refs:{},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/primus/tools",scopes:["tools:write"]},list:{convexFn:"",method:"GET",pattern:"/v1/primus/tools",scopes:["tools:read"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/primus/tools/:toolId",scopes:["tools:write"],pathParams:{toolId:"toolGid"},updatable:["description","parameters","outputSchema","riskLevel","requiresApproval","endpoint","executor","timeout","category","secretRef","headers"]}}},triggers:{identity:"slug",deps:["agents"],refs:{agentGid:{parent:"agents",product:"primus",wire:"gid",identity:"slug",array:!1,publicField:"agentGid"}},ops:{create:{convexFn:"",method:"POST",pattern:"/v1/primus/triggers",scopes:["triggers:write"]},update:{convexFn:"",method:"PATCH",pattern:"/v1/primus/triggers/:triggerId",scopes:["triggers:write"],pathParams:{triggerId:"triggerGid"},updatable:["name","description","config","action","conditions","enabled"]},list:{convexFn:"",method:"GET",pattern:"/v1/primus/triggers",scopes:["triggers:read"]}}}};export{t as a,s as b,r as c,o as d,c as e,p as f};