@north-light/cli 0.3.501 → 0.3.503

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 (42) hide show
  1. package/dist/api/contract.d.ts +1 -1
  2. package/dist/api/contract.js +1 -1
  3. package/dist/api/dto/grants.d.ts +2 -2
  4. package/dist/api/dto/run-events.d.ts +3 -1
  5. package/dist/builtin-memory/crouter-sdk/release-notes.md +10 -0
  6. package/dist/clients/attach/viewer.js +433 -433
  7. package/dist/core/canvas/migrations.js +1 -1
  8. package/dist/core/fault-classifier.d.ts +2 -0
  9. package/dist/core/fault-classifier.js +1 -1
  10. package/dist/core/grants/mirror.d.ts +16 -2
  11. package/dist/core/grants/mirror.js +3 -3
  12. package/dist/core/grants/sync.js +1 -1
  13. package/dist/core/llm/app-rungs.d.ts +16 -0
  14. package/dist/core/llm/app-rungs.js +1 -0
  15. package/dist/core/llm/run.d.ts +10 -1
  16. package/dist/core/llm/run.js +2 -2
  17. package/dist/core/model-routes.d.ts +2 -0
  18. package/dist/core/model-routes.js +1 -1
  19. package/dist/core/peer/ingest.d.ts +5 -1
  20. package/dist/core/peer/ingest.js +1 -1
  21. package/dist/core/peer/outbox-store.d.ts +5 -1
  22. package/dist/core/peer/outbox-store.js +5 -4
  23. package/dist/core/providers/token-cache.d.ts +1 -1
  24. package/dist/core/providers/token-cache.js +1 -1
  25. package/dist/core/runs/operations.js +5 -5
  26. package/dist/core/runtime/broker/model-adapter.js +2 -2
  27. package/dist/core/runtime/launch.d.ts +13 -1
  28. package/dist/core/runtime/launch.js +1 -1
  29. package/dist/core/runtime/spawn.d.ts +4 -1
  30. package/dist/core/runtime/spawn.js +2 -2
  31. package/dist/daemon/api/app-listener.js +13 -13
  32. package/dist/daemon/api/handlers/llm.js +3 -3
  33. package/dist/daemon/api/handlers/nodes.js +1 -1
  34. package/dist/daemon/api/handlers/objects.js +3 -3
  35. package/dist/daemon/api/handlers/runs.js +1 -1
  36. package/dist/daemon/cron/armed-context.js +1 -1
  37. package/dist/daemon/peer/outbox.js +1 -1
  38. package/dist/daemon/runs/append-section.js +2 -2
  39. package/docs/sdk/release-notes.md +10 -0
  40. package/package.json +2 -2
  41. package/packages/crouter-identity/package.json +1 -1
  42. package/runtime.lock.json +12 -12
@@ -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.16";
2
+ export declare const CONTRACT_LEVEL = "1.17";
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.16",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.17",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};
@@ -22,9 +22,9 @@ export interface GrantGetDTO {
22
22
  mode: 'always' | 'ask';
23
23
  }[];
24
24
  spend_cap: number | null;
25
- payer: 'user';
25
+ payer: 'user' | 'app';
26
26
  /** `{ <setup id>: ProviderDependency }` (a setup id is a provider id such as `context`, or a dotted level such as `context.deep`) as the directory's grant sync carried it; `{}` when the grantee has none. The daemon performs no `requires` check: an app follows this with the SDK grant watch (`oauth.watchGrants`, or `grant.get` with `wait`/`since`) and refuses its own operation with `provider_setup_pending`. When an entry's `state` is not `ready`, show its `message` (the provider's own sentence, when it has one) and send the person to its `next` (the directory's setup page; not for `unavailable`, where there is nothing for them to do) — never copy the provider's prose into the app. */
27
27
  dependencies: Record<string, ProviderDependency>;
28
- /** Opaque; changes exactly when `rev`, `resolved_scopes`, `spend_cap`, `payer` or `dependencies` changes (never on a periodic sync alone or a new token). Pass it back as `since` with `wait` to hold the read until it changes. */
28
+ /** Opaque; changes exactly when `rev`, `resolved_scopes`, `spend_cap`, `payer`, `inference_endpoint` or `dependencies` changes (never on a periodic sync alone or a new token). Pass it back as `since` with `wait` to hold the read until it changes. */
29
29
  version: string;
30
30
  }
@@ -94,7 +94,7 @@ export interface RunStartedEvent extends RunEventBaseDTO {
94
94
  * default model, not one actually served. The served model is on `usage`. */
95
95
  served_model?: string | null;
96
96
  scopes: string[] | null;
97
- payer: 'user';
97
+ payer: 'user' | 'app';
98
98
  usage: RunUsageDTO;
99
99
  /** Present when a schedule's firing started the run. */
100
100
  schedule_id?: string;
@@ -170,6 +170,8 @@ export interface RunUsageEvent extends RunEventBaseDTO, RunUsageDTO {
170
170
  type: 'usage';
171
171
  /** One model call's model; its tokens and cost are the event's own counts. */
172
172
  served_model: string;
173
+ /** Who paid for this call: the run's grant's payer. */
174
+ payer: 'user' | 'app';
173
175
  /** The run's cumulative usage after this call. */
174
176
  usage: RunUsageDTO;
175
177
  entry_id: string;
@@ -9,6 +9,16 @@ when-and-why-to-read: When you need Release notes, this knowledge should be read
9
9
 
10
10
  Changes to `@north-light/sdk` that can change what an existing app sees. Newest first.
11
11
 
12
+ ## 0.3.502
13
+
14
+ An app can be app-paid: the directory registers the app's inference endpoint, and the runtime serves the app's `llm` calls and its runs' model calls from that endpoint instead of the person's subscription. Additive: an app registered as user-paid sees no change.
15
+
16
+ ### `payer: "app"` on `grant.get`, `run.start`, `run.get` and `run.started` (additive)
17
+
18
+ - `payer` is now `"user" | "app"` (it was always `"user"`). It reports the payer of the caller's grant, and every grant stays `"user"` until the directory sends `app` for it.
19
+ - Under an app-paid grant, `llm` with `payer: "user"` is refused `invalid_request` naming `payer`; with `payer: "app"` on a user-paid grant, `payer_not_app` (as before).
20
+ - An app-paid grant's usage rows are `payer: "app"` at list price and never count toward the grant's `spend_cap`.
21
+
12
22
  ## 0.3.500
13
23
 
14
24
  An app-paid app can serve its model calls from its own service. Additive: no request or response an existing app sends or reads changes.