@north-light/cli 0.3.491 → 0.3.492
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/dist/api/command-manifest/index.d.ts +1 -0
- package/dist/api/command-manifest/index.js +1 -1
- package/dist/api/command-manifest/object-kinds.d.ts +20 -0
- package/dist/api/command-manifest/object-kinds.js +1 -0
- package/dist/api/contract.d.ts +1 -1
- package/dist/api/contract.js +1 -1
- package/dist/builtin-memory/crouter-sdk/release-notes.md +1 -1
- package/dist/clients/attach/viewer.js +429 -429
- package/dist/core/graph/access.d.ts +3 -0
- package/dist/core/graph/access.js +3 -3
- package/dist/core/plugin-objects-manifest.d.ts +2 -16
- package/dist/core/plugin-objects-manifest.js +1 -1
- package/docs/sdk/release-notes.md +1 -1
- package/package.json +2 -2
- package/packages/crouter-identity/package.json +1 -1
- package/runtime.lock.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./schema.js";export*from"./manifest.js";export*from"./result.js";
|
|
1
|
+
export*from"./schema.js";export*from"./manifest.js";export*from"./result.js";export*from"./object-kinds.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const KIND: RegExp;
|
|
2
|
+
export declare const LOCAL: RegExp;
|
|
3
|
+
/** A kind's first segment may not be one of the built-in object types. */
|
|
4
|
+
export declare const RESERVED_KIND_ROOTS: readonly string[];
|
|
5
|
+
export declare const MAX_KIND_EVENTS = 64;
|
|
6
|
+
export declare const MIN_EVENT_LEVEL = 1;
|
|
7
|
+
export declare const MAX_EVENT_LEVEL = 10;
|
|
8
|
+
/** Reasons a catalog (`events` map) is invalid; shared with `registerCustomObject`. */
|
|
9
|
+
export declare function eventCatalogReasons(events: unknown, where: string): string[];
|
|
10
|
+
/** The JSON shape of both blocks of a raw manifest record, independent of the plugin's name and commands. */
|
|
11
|
+
export declare function objectBlocksShapeReasons(record: Record<string, unknown>): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Reasons a kind's `read.command` does not name a non-streaming leaf of plugin `name`. `leafPaths` holds the space-joined path of
|
|
14
|
+
* every leaf below the plugin's root command; `streamingLeafPaths` holds those declared streaming.
|
|
15
|
+
*/
|
|
16
|
+
export declare function objectKindReadReasons(kind: string, decl: {
|
|
17
|
+
read?: {
|
|
18
|
+
command: readonly string[];
|
|
19
|
+
};
|
|
20
|
+
}, name: string, leafPaths: ReadonlySet<string>, streamingLeafPaths: ReadonlySet<string>): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=Object.defineProperty;var f=(t,e)=>u(t,"name",{value:e,configurable:!0});const m=/^[a-z][a-z0-9-]*\.[a-z][a-z0-9-]*$/,E=/^[a-z][a-z0-9-]*$/,b=["report","notice","node","job","document","person","app","repo","profile","action"],_=64,N=1,k=10,l=new Set(["description","events","read"]),y=new Set(["level","supersedes"]);function d(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}f(d,"isRecord");function $(t,e){if(!d(t))return[`${e} events must be an object`];const o=[],c=Object.entries(t);c.length>64&&o.push(`${e} declares more than 64 events`);for(const[r,s]of c){const n=`${e} event ${JSON.stringify(r)}`;if(E.test(r)||o.push(`${n} is not a valid event name`),!d(s)){o.push(`${n} must be an object { level, supersedes? }`);continue}for(const a of Object.keys(s))y.has(a)||o.push(`${n} has unknown key ${JSON.stringify(a)}`);const i=s.level;(typeof i!="number"||!Number.isInteger(i)||i<1||i>10)&&o.push(`${n} level must be an integer 1-10`),s.supersedes!==void 0&&typeof s.supersedes!="boolean"&&o.push(`${n} supersedes must be a boolean`)}return o}f($,"eventCatalogReasons");function j(t){const e=[],o=t.object_kinds;if(o!==void 0)if(!d(o))e.push("object_kinds must be an object keyed by kind name");else for(const[r,s]of Object.entries(o)){const n=`object_kinds ${JSON.stringify(r)}`;if(m.test(r)?b.includes(r.split(".")[0])&&e.push(`${n} uses a reserved first segment`):e.push(`${n} is not a valid kind name (<plugin>.<name>, lowercase)`),!d(s)){e.push(`${n} must be an object { description, events, read? }`);continue}for(const a of Object.keys(s))l.has(a)||e.push(`${n} has unknown key ${JSON.stringify(a)}`);(typeof s.description!="string"||s.description.trim()==="")&&e.push(`${n} description must be non-empty text`),e.push(...$(s.events,n));const i=s.read;if(i!==void 0){const a=d(i)?i.command:void 0;!d(i)||Object.keys(i).some(p=>p!=="command")?e.push(`${n} read must be { command: [leaf path] }`):(!Array.isArray(a)||a.length===0||a.some(p=>typeof p!="string"||p===""))&&e.push(`${n} read.command must be a non-empty array of command names`)}}const c=t.scopes;return c!==void 0&&(!Array.isArray(c)||c.some(r=>typeof r!="string"))&&e.push("scopes must be an array of scope strings"),e}f(j,"objectBlocksShapeReasons");function g(t,e,o,c,r){const s=e.read?.command;if(s===void 0)return[];const n=s.join(" ");return c.has(n)?r.has(n)?[`object_kinds ${JSON.stringify(t)} read.command "${n}" streams; a read is one {markdown} answer`]:[]:[`object_kinds ${JSON.stringify(t)} read.command "${n}" is not a leaf of plugin "${o}"`]}f(g,"objectKindReadReasons");export{m as KIND,E as LOCAL,k as MAX_EVENT_LEVEL,_ as MAX_KIND_EVENTS,N as MIN_EVENT_LEVEL,b as RESERVED_KIND_ROOTS,$ as eventCatalogReasons,j as objectBlocksShapeReasons,g as objectKindReadReasons};
|
package/dist/api/contract.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
|
|
2
|
-
export declare const CONTRACT_LEVEL = "1.
|
|
2
|
+
export declare const CONTRACT_LEVEL = "1.13";
|
|
3
3
|
/** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
|
|
4
4
|
export declare const REQUIRED_CONTRACT_HEADER = "Crouter-Required-Contract";
|
|
5
5
|
/** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
|
package/dist/api/contract.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var e=(r,t)=>c(r,"name",{value:t,configurable:!0});const f="1.
|
|
1
|
+
var c=Object.defineProperty;var e=(r,t)=>c(r,"name",{value:t,configurable:!0});const f="1.13",i="Crouter-Required-Contract",p="Crouter-Contract";function l(r){const t=/^(\d+)\.(\d+)$/.exec(r.trim());return t===null?null:{major:Number(t[1]),minor:Number(t[2])}}e(l,"parseContractLevel");function a(r){return r==null?[]:r.split(",").map(t=>l(t)).filter(t=>t!==null)}e(a,"parseServedContracts");function s(r,t){const n=l(r);return n===null?!1:(typeof t=="string"||t===null||t===void 0?a(t):t).some(u=>u.major===n.major&&u.minor>=n.minor)}e(s,"contractSatisfies");function C(r,t,n={}){if(r===void 0)return null;if(l(r)===null)return{status:400,code:"invalid_request",param:i,message:`${i} must be a contract level like 1.0.`};if(s(r,t))return null;const o=r.trim();return{status:426,code:"runtime_version_unsupported",message:t===null||a(t).length===0?`The runtime did not name its contract level; the caller requires contract ${o} or later. Roll the runtime forward.`:`The runtime serves contract ${t}; the caller requires contract ${o} or later within the same major. Roll the runtime forward, or pin an SDK whose crouterContract the runtime serves.`,details:{sdk_version:(n.legacyMinimum??"").trim(),runtime_version:n.runtimeVersion??null,required_contract:o,runtime_contract:t}}}e(C,"contractRefusal");export{p as CONTRACT_HEADER,f as CONTRACT_LEVEL,i as REQUIRED_CONTRACT_HEADER,C as contractRefusal,s as contractSatisfies,l as parseContractLevel,a as parseServedContracts};
|
|
@@ -60,7 +60,7 @@ Plugins can now declare canvas object kinds and act on the canvas, and an app to
|
|
|
60
60
|
- `app:<x>`: nodes and custom objects of another app `x`. An app never needs a scope for its own objects, and a plugin may not declare its own `app:<plugin>` space.
|
|
61
61
|
- `node`: any node, including the stub of a node on another of the account's machines.
|
|
62
62
|
|
|
63
|
-
`read` lets the holder read objects of the target, `write` change them, and `link` (below) make a node watch an object the holder owns. `watch` lets a custom object that watches an object of the target read it. Holding a scope never lifts run confinement inside the owning app, and a revoked grant holds nothing. A public custom object is readable by any app that may use the owning app's tools, with no scope. The app listener now serves the canvas operations (`objects.*`, `custom-objects.*`, `docs.*`) to an app grant token under its resolved scopes; those rows answered `unknown operation` there before.
|
|
63
|
+
`read` lets the holder read objects of the target, `write` change them, and `link` (below) make a node watch an object the holder owns. `watch` lets a custom object that watches an object of the target read it. Holding a scope never lifts run confinement inside the owning app, and a revoked grant holds nothing. A public custom object is readable by any app that may use the owning app's tools, with no scope. A `friends` or `private` instance is readable, with no read scope, only by a run (a node, or a node of another machine) that holds one of the owning app's provider-group scopes `<app>:<group>`, the scopes a call to that app's provider commands needs; another app's server reads it only through a held `crtr:objects:read:app:<app>` scope. The app listener now serves the canvas operations (`objects.*`, `custom-objects.*`, `docs.*`) to an app grant token under its resolved scopes; those rows answered `unknown operation` there before.
|
|
64
64
|
|
|
65
65
|
### The `crtr_app_` credential and its socket fetch (additive)
|
|
66
66
|
|