@north-light/plugin 0.3.514 → 0.3.518

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/README.md CHANGED
@@ -120,6 +120,8 @@ const handler = createFetchHandler(plugin, {
120
120
 
121
121
  `providerId` is the app's client id (its OAuth client id), bare or as `app:<id>`. The directory mints scopes as `<provider id>:<group>`, so the kit requires `<providerId>:<group>` on each leaf. Without `providerId` it requires `<plugin name>:<group>`, which only a first-party provider whose name equals its id carries — every call from any other app answers 403 `scope_missing`, and the error's `next` names the id to set.
122
122
 
123
+ Declare the app's tool groups next to its leaves with `definePlugin({ provider: true, version, groups })`. `groups` is keyed by group id; each value has `consentLine` and optionally `who` (`own`, `user`, `allowlist`, `any`; omitted means `user`) and `allowlist` (`app:<id>` principals, only with `who: 'allowlist'`). Every leaf's `group` must name a declared group and every declared group must be used by a leaf, or `definePlugin` throws. The served `bundle.json` carries it as `"groups": {"<id>": {"consent_line": "...", "who"?: "...", "allowlist"?: [...]}}` and the directory applies it when it refreshes the provider's manifest. See Commands in the docs.
124
+
123
125
  On Node, Express or Nest, mount the Fetch handler with `createNodeHandler(handler, { bodyLimit?, origin? })`. It turns the request into a Fetch `Request` (using `req.rawBody` when the framework buffered it, else the stream), refuses a body over `bodyLimit` (default 65536 bytes) with 413 before the handler runs, streams the response with its repeated headers and `set-cookie`, and answers 500 if the handler throws. In Nest, a controller method is `@All(['', '*path']) serve(@Req() req, @Res() res) { return node(req, res); }`; with `node:http`, `createServer((req, res) => void node(req, res))`. Pass `origin` when the public origin differs from the Host header.
124
126
 
125
127
  ## Metered provider tools
package/dist/bundle.js CHANGED
@@ -1,8 +1,8 @@
1
- var y=Object.defineProperty;var o=(t,n)=>y(t,"name",{value:n,configurable:!0});import{objectBlocksShapeReasons as w}from"@north-light/api/command-manifest";import{PluginDefinitionError as c}from"./define.js";import{buildCommandManifest as p}from"./manifest.js";const i=512,$=100,u=new TextEncoder;async function P(t,n){const e=p(t,{...n,mountPath:n.mountPath===""?"/":n.mountPath}),r=`${JSON.stringify(e,null,2)}
2
- `,a=g(t,n.providerId??t.name),s=`${JSON.stringify({bundleVersion:1,...t.version!==void 0?{version:t.version}:{},...a!==void 0?{object_kinds:a}:{}})}
3
- `,f=S(t.memory),b=[{path:"bundle.json",contents:s},{path:"commands.json",contents:r},...f],h=U(b),l=await N(h);return{commandsJson:r,bundleJson:s,memory:f,tar:h,etag:l}}o(P,"buildBundle");function g(t,n){if(t.objectKinds===void 0)return;const e=Object.fromEntries(Object.entries(t.objectKinds).map(([a,s])=>[`${n}.${a}`,s])),r=w({object_kinds:e});if(r.length>0)throw new c(r.join("; "));return e}o(g,"objectKindsBlock");function S(t){const n=new Set;return t.map(e=>{const r=j(e);if(n.has(r))throw new c(`memory document "${e.name}" produces a duplicate tar member path ${r}`);return n.add(r),{path:r,contents:k(e)}})}o(S,"buildMemoryMembers");function j(t){if(t.name.includes("\0"))throw new c(`memory document "${t.name}" must not contain a NUL character`);const n=`memory/${t.name}.md`;if(u.encode(n).length>$)throw new c(`memory document "${t.name}" produces a tar member path longer than 100 bytes (${n}); shorten its name`);return n}o(j,"memoryMemberPath");function k(t){const n=[`kind: ${t.kind}`,`when-and-why-to-read: ${x(t.whenAndWhyToRead)}`];return t.unlisted===!0&&n.push("unlisted: true"),t.rules!==void 0&&t.rules.length>0&&n.push(`surfaces: ${JSON.stringify(t.rules.map(E))}`),`---
4
- ${n.join(`
1
+ var w=Object.defineProperty;var r=(n,t)=>w(n,"name",{value:t,configurable:!0});import{objectBlocksShapeReasons as y}from"@north-light/api/command-manifest";import{PluginDefinitionError as c}from"./define.js";import{buildCommandManifest as p}from"./manifest.js";const i=512,$=100,u=new TextEncoder;async function P(n,t){const e=p(n,{...t,mountPath:t.mountPath===""?"/":t.mountPath}),o=`${JSON.stringify(e,null,2)}
2
+ `,a=S(n,t.providerId??n.name),s=`${JSON.stringify({bundleVersion:1,...n.version!==void 0?{version:n.version}:{},...n.groups!==void 0?{groups:g(n.groups)}:{},...a!==void 0?{object_kinds:a}:{}})}
3
+ `,f=j(n.memory),l=[{path:"bundle.json",contents:s},{path:"commands.json",contents:o},...f],h=B(l),b=await N(h);return{commandsJson:o,bundleJson:s,memory:f,tar:h,etag:b}}r(P,"buildBundle");function g(n){return Object.fromEntries(Object.entries(n).map(([t,e])=>[t,{consent_line:e.consentLine,...e.who!==void 0?{who:e.who}:{},...e.allowlist!==void 0?{allowlist:e.allowlist}:{}}]))}r(g,"groupsBlock");function S(n,t){if(n.objectKinds===void 0)return;const e=Object.fromEntries(Object.entries(n.objectKinds).map(([a,s])=>[`${t}.${a}`,s])),o=y({object_kinds:e});if(o.length>0)throw new c(o.join("; "));return e}r(S,"objectKindsBlock");function j(n){const t=new Set;return n.map(e=>{const o=k(e);if(t.has(o))throw new c(`memory document "${e.name}" produces a duplicate tar member path ${o}`);return t.add(o),{path:o,contents:A(e)}})}r(j,"buildMemoryMembers");function k(n){if(n.name.includes("\0"))throw new c(`memory document "${n.name}" must not contain a NUL character`);const t=`memory/${n.name}.md`;if(u.encode(t).length>$)throw new c(`memory document "${n.name}" produces a tar member path longer than 100 bytes (${t}); shorten its name`);return t}r(k,"memoryMemberPath");function A(n){const t=[`kind: ${n.kind}`,`when-and-why-to-read: ${O(n.whenAndWhyToRead)}`];return n.unlisted===!0&&t.push("unlisted: true"),n.rules!==void 0&&n.rules.length>0&&t.push(`surfaces: ${JSON.stringify(n.rules.map(x))}`),`---
4
+ ${t.join(`
5
5
  `)}
6
6
  ---
7
- ${t.body}`}o(k,"renderMemoryDoc");const A={boot:"boot","file-read":"read","document-read":"memory-read",command:"command","pre-command":"pre-command"};function E(t){return{on:A[t.on],at:t.deliver,...t.match!==void 0?{match:t.match}:{},...t.matchFrontmatter!==void 0?{"match-frontmatter":t.matchFrontmatter}:{},...t.if!==void 0?{gate:t.if}:{}}}o(E,"surfaceEntry");function x(t){let n='"';for(const e of t)switch(e){case"\\":n+="\\\\";break;case'"':n+='\\"';break;case`
8
- `:n+="\\n";break;case" ":n+="\\t";break;case"\r":n+="\\r";break;default:n+=e.charCodeAt(0)<=31||e==="\x7F"?`\\x${e.charCodeAt(0).toString(16).padStart(2,"0")}`:e}return`${n}"`}o(x,"yamlDoubleQuoted");function U(t){const n=[];for(const e of t){const r=u.encode(e.contents);n.push(O(e.path,r.length)),n.push(r);const a=B(r.length);a>0&&n.push(new Uint8Array(a))}return n.push(new Uint8Array(i)),n.push(new Uint8Array(i)),M(n)}o(U,"writeTar");function B(t){const n=t%i;return n===0?0:i-n}o(B,"padLength");function O(t,n){const e=new Uint8Array(i);return m(e,0,t),d(e,100,8,420),d(e,108,8,0),d(e,116,8,0),d(e,124,12,n),d(e,136,12,0),e.fill(32,148,156),e[156]=48,m(e,257,"ustar\0"),m(e,263,"00"),C(e,148,F(e)),e}o(O,"ustarHeader");function m(t,n,e){t.set(u.encode(e),n)}o(m,"writeAscii");function d(t,n,e,r){const a=e-1,s=r.toString(8).padStart(a,"0");if(s.length>a)throw new c(`tar header field at offset ${n} cannot hold value ${r} in ${a} octal digits`);m(t,n,s)}o(d,"writeOctalField");function C(t,n,e){m(t,n,e.toString(8).padStart(6,"0")),t[n+6]=0,t[n+7]=32}o(C,"writeChecksumField");function F(t){let n=0;for(const e of t)n+=e;return n}o(F,"sumBytes");function M(t){const n=t.reduce((a,s)=>a+s.length,0),e=new Uint8Array(n);let r=0;for(const a of t)e.set(a,r),r+=a.length;return e}o(M,"concatBytes");async function N(t){const n=new Uint8Array(await crypto.subtle.digest("SHA-256",t));return`"${Array.from(n,r=>r.toString(16).padStart(2,"0")).join("")}"`}o(N,"sha256Etag");export{P as buildBundle};
7
+ ${n.body}`}r(A,"renderMemoryDoc");const E={boot:"boot","file-read":"read","document-read":"memory-read",command:"command","pre-command":"pre-command"};function x(n){return{on:E[n.on],at:n.deliver,...n.match!==void 0?{match:n.match}:{},...n.matchFrontmatter!==void 0?{"match-frontmatter":n.matchFrontmatter}:{},...n.if!==void 0?{gate:n.if}:{}}}r(x,"surfaceEntry");function O(n){let t='"';for(const e of n)switch(e){case"\\":t+="\\\\";break;case'"':t+='\\"';break;case`
8
+ `:t+="\\n";break;case" ":t+="\\t";break;case"\r":t+="\\r";break;default:t+=e.charCodeAt(0)<=31||e==="\x7F"?`\\x${e.charCodeAt(0).toString(16).padStart(2,"0")}`:e}return`${t}"`}r(O,"yamlDoubleQuoted");function B(n){const t=[];for(const e of n){const o=u.encode(e.contents);t.push(_(e.path,o.length)),t.push(o);const a=U(o.length);a>0&&t.push(new Uint8Array(a))}return t.push(new Uint8Array(i)),t.push(new Uint8Array(i)),M(t)}r(B,"writeTar");function U(n){const t=n%i;return t===0?0:i-t}r(U,"padLength");function _(n,t){const e=new Uint8Array(i);return d(e,0,n),m(e,100,8,420),m(e,108,8,0),m(e,116,8,0),m(e,124,12,t),m(e,136,12,0),e.fill(32,148,156),e[156]=48,d(e,257,"ustar\0"),d(e,263,"00"),C(e,148,F(e)),e}r(_,"ustarHeader");function d(n,t,e){n.set(u.encode(e),t)}r(d,"writeAscii");function m(n,t,e,o){const a=e-1,s=o.toString(8).padStart(a,"0");if(s.length>a)throw new c(`tar header field at offset ${t} cannot hold value ${o} in ${a} octal digits`);d(n,t,s)}r(m,"writeOctalField");function C(n,t,e){d(n,t,e.toString(8).padStart(6,"0")),n[t+6]=0,n[t+7]=32}r(C,"writeChecksumField");function F(n){let t=0;for(const e of n)t+=e;return t}r(F,"sumBytes");function M(n){const t=n.reduce((a,s)=>a+s.length,0),e=new Uint8Array(t);let o=0;for(const a of n)e.set(a,o),o+=a.length;return e}r(M,"concatBytes");async function N(n){const t=new Uint8Array(await crypto.subtle.digest("SHA-256",n));return`"${Array.from(t,o=>o.toString(16).padStart(2,"0")).join("")}"`}r(N,"sha256Etag");export{P as buildBundle};
package/dist/define.d.ts CHANGED
@@ -212,6 +212,19 @@ export interface PluginDefinition {
212
212
  readonly provider?: boolean;
213
213
  /** Canvas object kinds by relative name; the served bundle prefixes each with the provider id. */
214
214
  readonly objectKinds?: Readonly<Record<string, ObjectKindSpec>>;
215
+ /** The provider's tool groups by id, written into `bundle.json` as `groups`; every leaf `group` names one. */
216
+ readonly groups?: Readonly<Record<string, ToolGroupSpec>>;
217
+ }
218
+ /** Who may be granted a tool group. `user` is the default; `own` is the provider's own app. */
219
+ export type ToolGroupWho = 'own' | 'user' | 'allowlist' | 'any';
220
+ /** One tool group of a provider: the consent line the directory shows and who may be granted it. */
221
+ export interface ToolGroupSpec {
222
+ /** The line the consent page shows for this group. */
223
+ readonly consentLine: string;
224
+ /** Who may be granted the group; the directory treats an omitted `who` as `user`. */
225
+ readonly who?: ToolGroupWho;
226
+ /** App principals (`app:<id>`) granted the group; required with `who: 'allowlist'` and refused otherwise. */
227
+ readonly allowlist?: readonly string[];
215
228
  }
216
229
  /**
217
230
  * Declares one command whose handler returns a single object matching `output`.
@@ -272,6 +285,7 @@ export declare function definePlugin(spec: {
272
285
  version?: number;
273
286
  provider?: boolean;
274
287
  objectKinds?: Record<string, ObjectKindSpec>;
288
+ groups?: Record<string, ToolGroupSpec>;
275
289
  }): PluginDefinition;
276
290
  /**
277
291
  * The lowercase kebab-case name crtr exposes for a camelCase key. Throws
package/dist/define.js CHANGED
@@ -1 +1 @@
1
- var T=Object.defineProperty;var r=(e,t)=>T(e,"name",{value:t,configurable:!0});import{LOCAL as P,mentionsFile as U,objectBlocksShapeReasons as K,objectKindReadReasons as R,outputBaseType as g}from"@north-light/api/command-manifest";class f extends Error{static{r(this,"PluginDefinitionError")}constructor(t){super(t),this.name="PluginDefinitionError"}}function G(e){return{kind:"leaf",description:e.description,whenToUse:e.whenToUse,summary:e.summary,...e.tier!==void 0?{tier:e.tier}:{},...e.group!==void 0?{group:e.group}:{},...e.sideEffect!==void 0?{sideEffect:e.sideEffect}:{},params:e.params??{},output:e.output,effects:e.effects,streaming:!1,run:r((t,n)=>Promise.resolve(e.handler(t,n)),"run")}}r(G,"defineLeaf");function V(e){return{kind:"leaf",description:e.description,whenToUse:e.whenToUse,summary:e.summary,...e.tier!==void 0?{tier:e.tier}:{},...e.group!==void 0?{group:e.group}:{},...e.sideEffect!==void 0?{sideEffect:e.sideEffect}:{},params:e.params??{},output:e.output,effects:e.effects,streaming:!0,run:r((t,n)=>Promise.resolve(e.handler(t,n)),"run")}}r(V,"defineStreamingLeaf");function H(e){return{kind:"branch",...e}}r(H,"defineBranch");function Q(e){if(W(e.name,"plugin name"),m(e.description,"plugin description"),m(e.whenToUse,"plugin whenToUse"),m(e.summary,"plugin summary"),m(e.rootEntry?.concept,"plugin rootEntry.concept"),m(e.rootEntry?.description,"plugin rootEntry.description"),m(e.rootEntry?.whenToUse,"plugin rootEntry.whenToUse"),I(e.timeouts),e.version!==void 0&&(typeof e.version!="number"||!Number.isInteger(e.version)||e.version<1))throw new f("plugin version must be an integer of at least 1");if(e.provider!==void 0&&typeof e.provider!="boolean")throw new f("plugin provider must be a boolean");if(e.provider===!0&&e.version===void 0)throw new f("a provider plugin must declare its major version");for(const[t,n]of Object.entries(e.commands))v(n,[e.name,t]);if(e.provider===!0){const t=w(e.commands,[e.name]);t!==void 0&&i(t,"needs a group because the plugin is a provider")}for(const t of e.memory??[])C(t);return e.objectKinds!==void 0&&x(e.objectKinds,e.name,e.commands),Object.freeze({name:e.name,description:e.description,whenToUse:e.whenToUse,summary:e.summary,rootEntry:Object.freeze({...e.rootEntry}),commands:p(e.commands),memory:Object.freeze((e.memory??[]).map(D)),...e.timeouts!==void 0?{timeouts:Object.freeze({...e.timeouts})}:{},...e.version!==void 0?{version:e.version}:{},...e.provider!==void 0?{provider:e.provider}:{},...e.objectKinds!==void 0?{objectKinds:S(e.objectKinds)}:{}})}r(Q,"definePlugin");function x(e,t,n){if(!u(e))throw new f("objectKinds must be an object keyed by relative kind name");const s={};for(const[a,d]of Object.entries(e)){if(!P.test(a))throw new f(`object kind ${JSON.stringify(a)} must be a lowercase relative name without a "."; the bundle prefixes it with the provider id`);s[`${t}.${a}`]=d}const o=K({object_kinds:s});if(o.length===0){const{leafPaths:a,streamingLeafPaths:d}=F(n);for(const[l,b]of Object.entries(s))o.push(...R(l,b,t,a,d))}if(o.length>0)throw new f(o.join("; "))}r(x,"validateObjectKinds");function F(e){const t=new Set,n=new Set,s=r((o,a)=>{for(const[d,l]of Object.entries(o)){const b=[...a,A(d)];l.kind==="branch"?s(l.children,b):(t.add(b.join(" ")),l.streaming&&n.add(b.join(" ")))}},"walk");return s(e,[]),{leafPaths:t,streamingLeafPaths:n}}r(F,"leafPathsOf");function S(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Object.freeze({description:n.description,events:Object.freeze(Object.fromEntries(Object.entries(n.events).map(([s,o])=>[s,Object.freeze({...o})]))),...n.read!==void 0?{read:Object.freeze({command:Object.freeze([...n.read.command])})}:{}})])))}r(S,"snapshotObjectKinds");function w(e,t){for(const[n,s]of Object.entries(e)){const o=[...t,n];if(s.kind==="leaf"){if(s.group===void 0)return o;continue}const a=w(s.children,o);if(a!==void 0)return a}}r(w,"firstLeafWithoutGroup");function p(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,L(n)])))}r(p,"snapshotCommands");function L(e){return e.kind==="branch"?Object.freeze({kind:"branch",description:e.description,whenToUse:e.whenToUse,summary:e.summary,...e.tier!==void 0?{tier:e.tier}:{},children:p(e.children)}):Object.freeze({kind:"leaf",description:e.description,whenToUse:e.whenToUse,summary:e.summary,...e.tier!==void 0?{tier:e.tier}:{},params:M(e.params),output:j(e.output),effects:Object.freeze([...e.effects]),streaming:e.streaming,...e.group!==void 0?{group:e.group}:{},...e.sideEffect!==void 0?{sideEffect:e.sideEffect}:{},run:e.run})}r(L,"snapshotNode");function M(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,N(n)])))}r(M,"snapshotParams");function N(e){return e.kind==="flag"&&e.type==="enum"?Object.freeze({...e,choices:Object.freeze([...e.choices])}):Object.freeze({...e})}r(N,"snapshotParam");function j(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,O(n)])))}r(j,"snapshotOutput");function O(e){return Object.freeze({...e,...e.children!==void 0?{children:j(e.children)}:{},...e.items!==void 0?{items:O(e.items)}:{},...e.values!==void 0?{values:Object.freeze([...e.values])}:{}})}r(O,"snapshotField");function v(e,t){(!u(e)||e.kind!=="branch"&&e.kind!=="leaf")&&i(t,"must be a branch or leaf defined by this package"),m(e.description,`${c(t)} description`),m(e.whenToUse,`${c(t)} whenToUse`),m(e.summary,`${c(t)} summary`),e.tier!==void 0&&e.tier!=="normal"&&e.tier!=="common"&&e.tier!=="important"&&i(t,"tier must be normal, common, or important");const n=t.at(-1);if(n===void 0&&i(t,"has no command name"),z(n,`${c(t)} command key`),e.kind==="branch"){u(e.children)||i(t,"branch children must be an object");for(const[o,a]of Object.entries(e.children))v(a,[...t,o]);return}e.group!==void 0&&(typeof e.group!="string"||!J.test(e.group))&&i(t,`group ${JSON.stringify(e.group)} must match [A-Za-z0-9_-]{1,64}`),e.sideEffect!==void 0&&typeof e.sideEffect!="boolean"&&i(t,"sideEffect must be a boolean"),u(e.params)||i(t,"leaf params must be an object");for(const[o,a]of Object.entries(e.params))z(o,`${c(t)} parameter key`),_(a,[...t,`parameter ${o}`]);Object.values(e.params).filter(o=>u(o)&&o.kind==="positional").length>1&&i(t,"a leaf may have at most one positional parameter"),u(e.output)||i(t,"leaf output must be an object");let s;for(const[o,a]of Object.entries(e.output))o.length===0&&i(t,"output field names must not be empty"),y(a,[...t,`output ${o}`],!0),g(a.type)==="file"&&(s!==void 0&&i(t,`declares file outputs ${s} and ${o}; a leaf may declare at most one file output`),s=o);(!Array.isArray(e.effects)||e.effects.length===0||!e.effects.every(o=>typeof o=="string"))&&i(t,"leaf effects must be a non-empty array of strings"),typeof e.streaming!="boolean"&&i(t,"leaf streaming must be a boolean"),typeof e.run!="function"&&i(t,"leaf handler must be a function")}r(v,"validateNode");function _(e,t){if((!u(e)||e.kind!=="flag"&&e.kind!=="positional"&&e.kind!=="stdin")&&i(t,"must be a parameter descriptor produced by param.*"),m(e.constraint,`${c(t)} constraint`),(typeof e.required!="boolean"||typeof e.repeatable!="boolean")&&i(t,"required and repeatable must be booleans"),e.kind==="stdin"){e.repeatable&&i(t,"stdin cannot be repeatable"),Object.hasOwn(e,"default")&&i(t,"stdin parameters cannot have a default");return}if(e.kind==="positional"){e.type!=="string"&&i(t,"positional parameters must have type string"),Object.hasOwn(e,"default")&&i(t,"positional parameters cannot have a default");return}if(e.type==="enum"?(!Array.isArray(e.choices)||e.choices.length===0||!e.choices.every(s=>typeof s=="string"))&&i(t,"enum parameters need at least one string choice"):e.type!=="string"&&e.type!=="int"&&e.type!=="bool"&&e.type!=="path"&&e.type!=="file"&&i(t,"flag parameters must have a supported type"),(e.type==="bool"||e.type==="path"||e.type==="file")&&e.repeatable&&i(t,`${e.type} parameters cannot be repeatable`),e.type==="path"&&e.encoding!=="text"&&e.encoding!=="base64"&&i(t,"path parameters must have text or base64 encoding"),e.type!=="path"&&e.encoding!==void 0&&i(t,"encoding is only valid on path parameters"),e.repeatable&&Object.hasOwn(e,"default")&&i(t,"repeatable parameters cannot have a default"),!Object.hasOwn(e,"default"))return;const n=e.default;e.type==="string"&&typeof n!="string"&&i(t,"string parameter defaults must be strings"),e.type==="int"&&(typeof n!="number"||!Number.isInteger(n))&&i(t,"int parameter defaults must be integers"),e.type==="bool"&&typeof n!="boolean"&&i(t,"bool parameter defaults must be booleans"),e.type==="enum"&&(typeof n!="string"||!Array.isArray(e.choices)||!e.choices.includes(n))&&i(t,"enum parameter defaults must be one of their choices"),(e.type==="path"||e.type==="file")&&i(t,`${e.type} parameters cannot have a default`)}r(_,"validateParam");function y(e,t,n){(!u(e)||typeof e.type!="string"||e.type.length===0||typeof e.constraint!="string"||typeof e.required!="boolean")&&i(t,"must be an output field descriptor produced by field.*");const s=g(e.type);if(e.kind!==void 0&&s!=="file"&&i(t,"is a parameter descriptor; declare output fields with field.*"),U(e.type)&&s!=="file"&&i(t,`has type ${e.type}; a file output is one file, declared file or file | null`),s==="file"&&!n&&i(t,"is a file, which is only valid as a top-level output field"),e.children!==void 0){s!=="object"&&i(t,"children are only valid on an object field"),u(e.children)||i(t,"children must be an object of output fields");for(const[o,a]of Object.entries(e.children))o.length===0&&i(t,"member names must not be empty"),y(a,[...t,`member ${o}`],!1)}e.items!==void 0&&(s!=="array"&&i(t,"items are only valid on an array field"),y(e.items,[...t,"items"],!1)),e.values!==void 0&&(s!=="enum"&&i(t,"values are only valid on an enum field"),(!Array.isArray(e.values)||e.values.length===0||!e.values.every(o=>typeof o=="string"&&o.length>0))&&i(t,"enum values must be a non-empty array of non-empty strings"),new Set(e.values).size!==e.values.length&&i(t,"enum values must be unique"))}r(y,"validateField");function C(e){if(!u(e)||typeof e.name!="string"||!B(e.name))throw new f("memory document name must be a safe relative path");if(e.kind!=="knowledge"&&e.kind!=="preference")throw new f(`memory document ${e.name} has an invalid kind`);if(m(e.whenAndWhyToRead,`memory document ${e.name} whenAndWhyToRead`),typeof e.body!="string")throw new f(`memory document ${e.name} body must be a string`);if(e.unlisted!==void 0&&typeof e.unlisted!="boolean")throw new f(`memory document ${e.name} unlisted must be a boolean`);if(e.rules!==void 0){if(!Array.isArray(e.rules))throw new f(`memory document ${e.name} rules must be an array`);e.rules.forEach((t,n)=>q(t,`memory document ${e.name} rules[${n}]`))}}r(C,"validateMemoryDoc");const $=["boot","file-read","document-read","command","pre-command"],k=["on","deliver","match","matchFrontmatter","if"];function q(e,t){if(!u(e))throw new f(`${t} must be an object`);for(const n of Object.keys(e))if(!k.includes(n))throw new f(`${t} has unknown key ${n}; a rule carries only ${k.join(", ")}`);if(typeof e.on!="string"||!$.includes(e.on))throw new f(`${t} on must be one of ${$.join(", ")}`);if(e.deliver!=="name"&&e.deliver!=="preview"&&e.deliver!=="content")throw new f(`${t} deliver must be name, preview or content`);if(e.match!==void 0){if(e.on==="boot")throw new f(`${t} match is meaningless on boot; drop it`);if(!Array.isArray(e.match)||e.match.length===0||!e.match.every(n=>typeof n=="string"&&n.trim().length>0))throw new f(`${t} match must be a non-empty array of non-empty globs`)}if(e.matchFrontmatter!==void 0){if(e.on!=="file-read")throw new f(`${t} matchFrontmatter applies only to file-read`);E(e.matchFrontmatter,`${t} matchFrontmatter`)}if(e.on!=="boot"&&e.match===void 0&&e.matchFrontmatter===void 0)throw new f(`${t} needs match${e.on==="file-read"?" or matchFrontmatter":""} on ${e.on}`);e.if!==void 0&&E(e.if,`${t} if`)}r(q,"validateMemoryRule");function E(e,t){if(!u(e))throw new f(`${t} must be a field\u2192matcher object`);if(!h(e,0))throw new f(`${t} must hold only strings, finite numbers, booleans, null, arrays and plain objects`)}r(E,"assertCondition");function h(e,t){return t>32?!1:e===null||typeof e=="string"||typeof e=="boolean"?!0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.every(n=>h(n,t+1)):!u(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null?!1:Object.values(e).every(n=>h(n,t+1))}r(h,"isPlainJson");function D(e){const{rules:t,...n}=e;return Object.freeze({...n,...t!==void 0?{rules:Object.freeze(t.map(s=>structuredClone(s)))}:{}})}r(D,"freezeMemoryDoc");function I(e){if(e!==void 0){if(!u(e))throw new f("timeouts must be an object");for(const t of["connectMs","requestMs","streamIdleMs"]){const n=e[t];if(n!==void 0&&(typeof n!="number"||!Number.isInteger(n)||n<=0))throw new f(`timeouts.${t} must be a positive integer`)}}}r(I,"assertTimeouts");const J=/^[A-Za-z0-9_-]{1,64}$/;function z(e,t){if(A(e).replace(/-([a-z])/g,(s,o)=>o.toUpperCase())!==e)throw new f(`${t} must round-trip between camelCase and kebab-case`)}r(z,"assertKey");function W(e,t){if(!/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(e))throw new f(`${t} must be lowercase kebab-case`)}r(W,"assertKebabName");function A(e){const t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);if(!/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(t))throw new f(`invalid key ${JSON.stringify(e)}; use camelCase keys that convert to lowercase kebab-case`);return t}r(A,"kebab");function m(e,t){if(typeof e!="string"||e.length===0)throw new f(`${t} must be a non-empty string`)}r(m,"assertText");function B(e){return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&e.split("/").every(t=>t.length>0&&t!=="."&&t!=="..")}r(B,"isSafeRelativePath");function u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(u,"isRecord");function i(e,t){throw new f(`${c(e)} ${t}`)}r(i,"fail");function c(e){return e.join(" ")}r(c,"formatPath");export{f as PluginDefinitionError,H as defineBranch,G as defineLeaf,Q as definePlugin,V as defineStreamingLeaf,A as kebab};
1
+ var T=Object.defineProperty;var o=(e,t)=>T(e,"name",{value:t,configurable:!0});import{LOCAL as U,mentionsFile as L,objectBlocksShapeReasons as K,objectKindReadReasons as R,outputBaseType as w}from"@north-light/api/command-manifest";class s extends Error{static{o(this,"PluginDefinitionError")}constructor(t){super(t),this.name="PluginDefinitionError"}}function Q(e){return{kind:"leaf",description:e.description,whenToUse:e.whenToUse,summary:e.summary,...e.tier!==void 0?{tier:e.tier}:{},...e.group!==void 0?{group:e.group}:{},...e.sideEffect!==void 0?{sideEffect:e.sideEffect}:{},params:e.params??{},output:e.output,effects:e.effects,streaming:!1,run:o((t,n)=>Promise.resolve(e.handler(t,n)),"run")}}o(Q,"defineLeaf");function X(e){return{kind:"leaf",description:e.description,whenToUse:e.whenToUse,summary:e.summary,...e.tier!==void 0?{tier:e.tier}:{},...e.group!==void 0?{group:e.group}:{},...e.sideEffect!==void 0?{sideEffect:e.sideEffect}:{},params:e.params??{},output:e.output,effects:e.effects,streaming:!0,run:o((t,n)=>Promise.resolve(e.handler(t,n)),"run")}}o(X,"defineStreamingLeaf");function ee(e){return{kind:"branch",...e}}o(ee,"defineBranch");function te(e){if(B(e.name,"plugin name"),d(e.description,"plugin description"),d(e.whenToUse,"plugin whenToUse"),d(e.summary,"plugin summary"),d(e.rootEntry?.concept,"plugin rootEntry.concept"),d(e.rootEntry?.description,"plugin rootEntry.description"),d(e.rootEntry?.whenToUse,"plugin rootEntry.whenToUse"),Z(e.timeouts),e.version!==void 0&&(typeof e.version!="number"||!Number.isInteger(e.version)||e.version<1))throw new s("plugin version must be an integer of at least 1");if(e.provider!==void 0&&typeof e.provider!="boolean")throw new s("plugin provider must be a boolean");if(e.provider===!0&&e.version===void 0)throw new s("a provider plugin must declare its major version");for(const[t,n]of Object.entries(e.commands))O(n,[e.name,t]);if(e.provider===!0){const t=_(e.commands,[e.name]);t!==void 0&&r(t,"needs a group because the plugin is a provider")}if(e.groups!==void 0){if(e.provider!==!0)throw new s("groups can only be declared by a provider plugin; set provider: true");S(e.groups,e.commands,e.name)}for(const t of e.memory??[])J(t);return e.objectKinds!==void 0&&F(e.objectKinds,e.name,e.commands),Object.freeze({name:e.name,description:e.description,whenToUse:e.whenToUse,summary:e.summary,rootEntry:Object.freeze({...e.rootEntry}),commands:g(e.commands),memory:Object.freeze((e.memory??[]).map(W)),...e.timeouts!==void 0?{timeouts:Object.freeze({...e.timeouts})}:{},...e.version!==void 0?{version:e.version}:{},...e.provider!==void 0?{provider:e.provider}:{},...e.objectKinds!==void 0?{objectKinds:M(e.objectKinds)}:{},...e.groups!==void 0?{groups:x(e.groups)}:{}})}o(te,"definePlugin");function S(e,t,n){if(!u(e))throw new s("groups must be an object keyed by group id");for(const[i,f]of Object.entries(e)){if(!z.test(i))throw new s(`group ${JSON.stringify(i)} must match [A-Za-z0-9_-]{1,64}`);if(!u(f))throw new s(`group "${i}" must be an object with consentLine`);const l=Object.keys(f).filter(c=>c!=="consentLine"&&c!=="who"&&c!=="allowlist");if(l.length>0)throw new s(`group "${i}" has unknown keys: ${l.join(", ")}`);if(d(f.consentLine,`group "${i}" consentLine`),f.who!==void 0&&f.who!=="own"&&f.who!=="user"&&f.who!=="allowlist"&&f.who!=="any")throw new s(`group "${i}" who must be own, user, allowlist, or any`);if(f.who==="allowlist"){if(!Array.isArray(f.allowlist)||f.allowlist.length===0||!f.allowlist.every(c=>typeof c=="string"&&/^app:.+/.test(c)))throw new s(`group "${i}" allowlist must be a non-empty array of app principals ("app:<id>") when who is allowlist`)}else if(f.allowlist!==void 0)throw new s(`group "${i}" allowlist is only allowed with who: "allowlist"`)}const a=new Set;for(const[i,f]of b(t,[n]))f.group!==void 0&&(Object.hasOwn(e,f.group)||r(i,`names group "${f.group}", which definePlugin groups does not declare`),a.add(f.group));for(const i of Object.keys(e))if(!a.has(i))throw new s(`group "${i}" is declared but no leaf uses it`)}o(S,"validateGroups");function x(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Object.freeze({consentLine:n.consentLine,...n.who!==void 0?{who:n.who}:{},...n.allowlist!==void 0?{allowlist:Object.freeze([...n.allowlist])}:{}})])))}o(x,"snapshotGroups");function F(e,t,n){if(!u(e))throw new s("objectKinds must be an object keyed by relative kind name");const a={};for(const[f,l]of Object.entries(e)){if(!U.test(f))throw new s(`object kind ${JSON.stringify(f)} must be a lowercase relative name without a "."; the bundle prefixes it with the provider id`);a[`${t}.${f}`]=l}const i=K({object_kinds:a});if(i.length===0){const{leafPaths:f,streamingLeafPaths:l}=N(n);for(const[c,P]of Object.entries(a))i.push(...R(c,P,t,f,l))}if(i.length>0)throw new s(i.join("; "))}o(F,"validateObjectKinds");function N(e){const t=new Set,n=new Set;for(const[a,i]of b(e,[])){const f=a.map(A).join(" ");t.add(f),i.streaming&&n.add(f)}return{leafPaths:t,streamingLeafPaths:n}}o(N,"leafPathsOf");function M(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Object.freeze({description:n.description,events:Object.freeze(Object.fromEntries(Object.entries(n.events).map(([a,i])=>[a,Object.freeze({...i})]))),...n.read!==void 0?{read:Object.freeze({command:Object.freeze([...n.read.command])})}:{}})])))}o(M,"snapshotObjectKinds");function _(e,t){for(const[n,a]of b(e,t))if(a.group===void 0)return n}o(_,"firstLeafWithoutGroup");function*b(e,t){for(const[n,a]of Object.entries(e)){const i=[...t,n];a.kind==="leaf"?yield[i,a]:yield*b(a.children,i)}}o(b,"leavesOf");function g(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,C(n)])))}o(g,"snapshotCommands");function C(e){return e.kind==="branch"?Object.freeze({kind:"branch",description:e.description,whenToUse:e.whenToUse,summary:e.summary,...e.tier!==void 0?{tier:e.tier}:{},children:g(e.children)}):Object.freeze({kind:"leaf",description:e.description,whenToUse:e.whenToUse,summary:e.summary,...e.tier!==void 0?{tier:e.tier}:{},params:q(e.params),output:p(e.output),effects:Object.freeze([...e.effects]),streaming:e.streaming,...e.group!==void 0?{group:e.group}:{},...e.sideEffect!==void 0?{sideEffect:e.sideEffect}:{},run:e.run})}o(C,"snapshotNode");function q(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,D(n)])))}o(q,"snapshotParams");function D(e){return e.kind==="flag"&&e.type==="enum"?Object.freeze({...e,choices:Object.freeze([...e.choices])}):Object.freeze({...e})}o(D,"snapshotParam");function p(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([t,n])=>[t,j(n)])))}o(p,"snapshotOutput");function j(e){return Object.freeze({...e,...e.children!==void 0?{children:p(e.children)}:{},...e.items!==void 0?{items:j(e.items)}:{},...e.values!==void 0?{values:Object.freeze([...e.values])}:{}})}o(j,"snapshotField");function O(e,t){(!u(e)||e.kind!=="branch"&&e.kind!=="leaf")&&r(t,"must be a branch or leaf defined by this package"),d(e.description,`${m(t)} description`),d(e.whenToUse,`${m(t)} whenToUse`),d(e.summary,`${m(t)} summary`),e.tier!==void 0&&e.tier!=="normal"&&e.tier!=="common"&&e.tier!=="important"&&r(t,"tier must be normal, common, or important");const n=t.at(-1);if(n===void 0&&r(t,"has no command name"),E(n,`${m(t)} command key`),e.kind==="branch"){u(e.children)||r(t,"branch children must be an object");for(const[i,f]of Object.entries(e.children))O(f,[...t,i]);return}e.group!==void 0&&(typeof e.group!="string"||!z.test(e.group))&&r(t,`group ${JSON.stringify(e.group)} must match [A-Za-z0-9_-]{1,64}`),e.sideEffect!==void 0&&typeof e.sideEffect!="boolean"&&r(t,"sideEffect must be a boolean"),u(e.params)||r(t,"leaf params must be an object");for(const[i,f]of Object.entries(e.params))E(i,`${m(t)} parameter key`),I(f,[...t,`parameter ${i}`]);Object.values(e.params).filter(i=>u(i)&&i.kind==="positional").length>1&&r(t,"a leaf may have at most one positional parameter"),u(e.output)||r(t,"leaf output must be an object");let a;for(const[i,f]of Object.entries(e.output))i.length===0&&r(t,"output field names must not be empty"),y(f,[...t,`output ${i}`],!0),w(f.type)==="file"&&(a!==void 0&&r(t,`declares file outputs ${a} and ${i}; a leaf may declare at most one file output`),a=i);(!Array.isArray(e.effects)||e.effects.length===0||!e.effects.every(i=>typeof i=="string"))&&r(t,"leaf effects must be a non-empty array of strings"),typeof e.streaming!="boolean"&&r(t,"leaf streaming must be a boolean"),typeof e.run!="function"&&r(t,"leaf handler must be a function")}o(O,"validateNode");function I(e,t){if((!u(e)||e.kind!=="flag"&&e.kind!=="positional"&&e.kind!=="stdin")&&r(t,"must be a parameter descriptor produced by param.*"),d(e.constraint,`${m(t)} constraint`),(typeof e.required!="boolean"||typeof e.repeatable!="boolean")&&r(t,"required and repeatable must be booleans"),e.kind==="stdin"){e.repeatable&&r(t,"stdin cannot be repeatable"),Object.hasOwn(e,"default")&&r(t,"stdin parameters cannot have a default");return}if(e.kind==="positional"){e.type!=="string"&&r(t,"positional parameters must have type string"),Object.hasOwn(e,"default")&&r(t,"positional parameters cannot have a default");return}if(e.type==="enum"?(!Array.isArray(e.choices)||e.choices.length===0||!e.choices.every(a=>typeof a=="string"))&&r(t,"enum parameters need at least one string choice"):e.type!=="string"&&e.type!=="int"&&e.type!=="bool"&&e.type!=="path"&&e.type!=="file"&&r(t,"flag parameters must have a supported type"),(e.type==="bool"||e.type==="path"||e.type==="file")&&e.repeatable&&r(t,`${e.type} parameters cannot be repeatable`),e.type==="path"&&e.encoding!=="text"&&e.encoding!=="base64"&&r(t,"path parameters must have text or base64 encoding"),e.type!=="path"&&e.encoding!==void 0&&r(t,"encoding is only valid on path parameters"),e.repeatable&&Object.hasOwn(e,"default")&&r(t,"repeatable parameters cannot have a default"),!Object.hasOwn(e,"default"))return;const n=e.default;e.type==="string"&&typeof n!="string"&&r(t,"string parameter defaults must be strings"),e.type==="int"&&(typeof n!="number"||!Number.isInteger(n))&&r(t,"int parameter defaults must be integers"),e.type==="bool"&&typeof n!="boolean"&&r(t,"bool parameter defaults must be booleans"),e.type==="enum"&&(typeof n!="string"||!Array.isArray(e.choices)||!e.choices.includes(n))&&r(t,"enum parameter defaults must be one of their choices"),(e.type==="path"||e.type==="file")&&r(t,`${e.type} parameters cannot have a default`)}o(I,"validateParam");function y(e,t,n){(!u(e)||typeof e.type!="string"||e.type.length===0||typeof e.constraint!="string"||typeof e.required!="boolean")&&r(t,"must be an output field descriptor produced by field.*");const a=w(e.type);if(e.kind!==void 0&&a!=="file"&&r(t,"is a parameter descriptor; declare output fields with field.*"),L(e.type)&&a!=="file"&&r(t,`has type ${e.type}; a file output is one file, declared file or file | null`),a==="file"&&!n&&r(t,"is a file, which is only valid as a top-level output field"),e.children!==void 0){a!=="object"&&r(t,"children are only valid on an object field"),u(e.children)||r(t,"children must be an object of output fields");for(const[i,f]of Object.entries(e.children))i.length===0&&r(t,"member names must not be empty"),y(f,[...t,`member ${i}`],!1)}e.items!==void 0&&(a!=="array"&&r(t,"items are only valid on an array field"),y(e.items,[...t,"items"],!1)),e.values!==void 0&&(a!=="enum"&&r(t,"values are only valid on an enum field"),(!Array.isArray(e.values)||e.values.length===0||!e.values.every(i=>typeof i=="string"&&i.length>0))&&r(t,"enum values must be a non-empty array of non-empty strings"),new Set(e.values).size!==e.values.length&&r(t,"enum values must be unique"))}o(y,"validateField");function J(e){if(!u(e)||typeof e.name!="string"||!Y(e.name))throw new s("memory document name must be a safe relative path");if(e.kind!=="knowledge"&&e.kind!=="preference")throw new s(`memory document ${e.name} has an invalid kind`);if(d(e.whenAndWhyToRead,`memory document ${e.name} whenAndWhyToRead`),typeof e.body!="string")throw new s(`memory document ${e.name} body must be a string`);if(e.unlisted!==void 0&&typeof e.unlisted!="boolean")throw new s(`memory document ${e.name} unlisted must be a boolean`);if(e.rules!==void 0){if(!Array.isArray(e.rules))throw new s(`memory document ${e.name} rules must be an array`);e.rules.forEach((t,n)=>G(t,`memory document ${e.name} rules[${n}]`))}}o(J,"validateMemoryDoc");const v=["boot","file-read","document-read","command","pre-command"],$=["on","deliver","match","matchFrontmatter","if"];function G(e,t){if(!u(e))throw new s(`${t} must be an object`);for(const n of Object.keys(e))if(!$.includes(n))throw new s(`${t} has unknown key ${n}; a rule carries only ${$.join(", ")}`);if(typeof e.on!="string"||!v.includes(e.on))throw new s(`${t} on must be one of ${v.join(", ")}`);if(e.deliver!=="name"&&e.deliver!=="preview"&&e.deliver!=="content")throw new s(`${t} deliver must be name, preview or content`);if(e.match!==void 0){if(e.on==="boot")throw new s(`${t} match is meaningless on boot; drop it`);if(!Array.isArray(e.match)||e.match.length===0||!e.match.every(n=>typeof n=="string"&&n.trim().length>0))throw new s(`${t} match must be a non-empty array of non-empty globs`)}if(e.matchFrontmatter!==void 0){if(e.on!=="file-read")throw new s(`${t} matchFrontmatter applies only to file-read`);k(e.matchFrontmatter,`${t} matchFrontmatter`)}if(e.on!=="boot"&&e.match===void 0&&e.matchFrontmatter===void 0)throw new s(`${t} needs match${e.on==="file-read"?" or matchFrontmatter":""} on ${e.on}`);e.if!==void 0&&k(e.if,`${t} if`)}o(G,"validateMemoryRule");function k(e,t){if(!u(e))throw new s(`${t} must be a field\u2192matcher object`);if(!h(e,0))throw new s(`${t} must hold only strings, finite numbers, booleans, null, arrays and plain objects`)}o(k,"assertCondition");function h(e,t){return t>32?!1:e===null||typeof e=="string"||typeof e=="boolean"?!0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.every(n=>h(n,t+1)):!u(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null?!1:Object.values(e).every(n=>h(n,t+1))}o(h,"isPlainJson");function W(e){const{rules:t,...n}=e;return Object.freeze({...n,...t!==void 0?{rules:Object.freeze(t.map(a=>structuredClone(a)))}:{}})}o(W,"freezeMemoryDoc");function Z(e){if(e!==void 0){if(!u(e))throw new s("timeouts must be an object");for(const t of["connectMs","requestMs","streamIdleMs"]){const n=e[t];if(n!==void 0&&(typeof n!="number"||!Number.isInteger(n)||n<=0))throw new s(`timeouts.${t} must be a positive integer`)}}}o(Z,"assertTimeouts");const z=/^[A-Za-z0-9_-]{1,64}$/;function E(e,t){if(A(e).replace(/-([a-z])/g,(a,i)=>i.toUpperCase())!==e)throw new s(`${t} must round-trip between camelCase and kebab-case`)}o(E,"assertKey");function B(e,t){if(!/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(e))throw new s(`${t} must be lowercase kebab-case`)}o(B,"assertKebabName");function A(e){const t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);if(!/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(t))throw new s(`invalid key ${JSON.stringify(e)}; use camelCase keys that convert to lowercase kebab-case`);return t}o(A,"kebab");function d(e,t){if(typeof e!="string"||e.length===0)throw new s(`${t} must be a non-empty string`)}o(d,"assertText");function Y(e){return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&e.split("/").every(t=>t.length>0&&t!=="."&&t!=="..")}o(Y,"isSafeRelativePath");function u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(u,"isRecord");function r(e,t){throw new s(`${m(e)} ${t}`)}o(r,"fail");function m(e){return e.join(" ")}o(m,"formatPath");export{s as PluginDefinitionError,ee as defineBranch,Q as defineLeaf,te as definePlugin,X as defineStreamingLeaf,A as kebab};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/plugin",
3
- "version": "0.3.514",
3
+ "version": "0.3.518",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "postpack": "node ../../scripts/pack-minify.mjs postpack packages/crouter-plugin"
24
24
  },
25
25
  "dependencies": {
26
- "@north-light/api": "0.3.514",
27
- "@north-light/identity": "0.3.514"
26
+ "@north-light/api": "0.3.518",
27
+ "@north-light/identity": "0.3.518"
28
28
  },
29
29
  "license": "UNLICENSED",
30
30
  "publishConfig": {