@north-light/cli 0.3.655 → 0.3.656

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.
@@ -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.51";
2
+ export declare const CONTRACT_LEVEL = "1.52";
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`. */
@@ -1 +1 @@
1
- var c=Object.defineProperty;var e=(r,t)=>c(r,"name",{value:t,configurable:!0});const f="1.51",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};
1
+ var c=Object.defineProperty;var e=(r,t)=>c(r,"name",{value:t,configurable:!0});const f="1.52",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};
@@ -134,10 +134,13 @@ export interface DocLintFindingDTO {
134
134
  export interface DocLintDTO {
135
135
  findings: DocLintFindingDTO[];
136
136
  }
137
- /** `GET /v1/documents/browser-access`: the secret that opens the localhost document listener (put in a link as `?t=`). */
138
- export interface DocumentAccessDTO {
137
+ /** `GET /v1/documents/browser-access`: where document links open. `secret` opens the localhost document listener (put in a link as
138
+ * `?t=`); `canvas_url` is the origin of the signed-in document page a cloud API serves, linked as `<canvas_url>/r/<ref>`. */
139
+ export type DocumentAccessDTO = {
139
140
  secret: string;
140
- }
141
+ } | {
142
+ canvas_url: string;
143
+ };
141
144
  export interface ReconcilePackagesDTO {
142
145
  created: number;
143
146
  updated: number;
@@ -1,11 +1,12 @@
1
+ import type { DocumentAccessDTO } from '../../../api/dto/docs.js';
1
2
  import type { CanvasSource } from '../../../core/canvas/source.js';
2
3
  export declare function createDocumentLinks(opts: {
3
4
  selfNodeId: string;
4
5
  remote: boolean;
5
6
  canvasSource: CanvasSource;
6
7
  port: number;
7
- fetchSecret: () => Promise<string>;
8
- onSecretError: (err: unknown) => void;
8
+ fetchAccess: () => Promise<DocumentAccessDTO>;
9
+ onAccessError: (err: unknown) => void;
9
10
  refresh: () => void;
10
11
  }): {
11
12
  dispose(): void;
@@ -1 +1 @@
1
- var h=Object.defineProperty;var o=(e,t)=>h(e,"name",{value:t,configurable:!0});import{noteDocLinksChanged as a,setDocLinkContext as l}from"../render/doc-links.js";function L(e){const t=new Map;let r=!1,s=!1,d;e.remote||e.fetchSecret().then(n=>{d=n,a(),s||e.refresh()},e.onSecretError);const u=o(()=>{if(r)return;r=!0;const n=e.canvasSource;(n.panelRoster?n.panelRoster().then(c=>c.nodes):n.listNodes()).then(c=>{for(const f of c)t.set(f.node_id,f.name);a(),s||e.refresh()},()=>{r=!1})},"loadRoster"),m={selfNodeId:e.selfNodeId,nodeName:o(n=>{const i=t.get(n);return i===void 0&&u(),i},"nodeName"),urlFor:o(n=>e.remote||d===void 0?void 0:`http://127.0.0.1:${e.port}/r/${n.split("/").map(encodeURIComponent).join("/")}?t=${d}`,"urlFor")};return l(m),{dispose(){s=!0,l(void 0)}}}o(L,"createDocumentLinks");export{L as createDocumentLinks};
1
+ var h=Object.defineProperty;var t=(e,s)=>h(e,"name",{value:s,configurable:!0});import{noteDocLinksChanged as f,setDocLinkContext as u}from"../render/doc-links.js";function v(e){const s=new Map;let c=!1,d=!1,r;e.remote||e.fetchAccess().then(n=>{r=n,f(),d||e.refresh()},e.onAccessError);const l=t(()=>{if(c)return;c=!0;const n=e.canvasSource;(n.panelRoster?n.panelRoster().then(i=>i.nodes):n.listNodes()).then(i=>{for(const a of i)s.set(a.node_id,a.name);f(),d||e.refresh()},()=>{c=!1})},"loadRoster"),m={selfNodeId:e.selfNodeId,nodeName:t(n=>{const o=s.get(n);return o===void 0&&l(),o},"nodeName"),urlFor:t(n=>{if(e.remote||r===void 0)return;const o=`/r/${n.split("/").map(encodeURIComponent).join("/")}`;return"canvas_url"in r?`${r.canvas_url}${o}`:`http://127.0.0.1:${e.port}${o}?t=${r.secret}`},"urlFor")};return u(m),{dispose(){d=!0,u(void 0)}}}t(v,"createDocumentLinks");export{v as createDocumentLinks};