@north-light/sdk 0.3.751 → 0.3.753

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/client.d.ts CHANGED
@@ -2,6 +2,7 @@ import { type CheckDTO } from '@north-light/api';
2
2
  import { Canvas } from './resources/canvas.js';
3
3
  import { Docs } from './resources/docs.js';
4
4
  import { Charges } from './resources/charges.js';
5
+ import { Environments } from './resources/environments.js';
5
6
  import { SpendLimits } from './resources/spend-limits.js';
6
7
  import { Relations } from './resources/relations.js';
7
8
  import { Schemas } from './resources/schemas.js';
@@ -97,6 +98,8 @@ export declare class Crouter {
97
98
  readonly relations: Relations;
98
99
  /** The runtime's money ledger: month charge rows and the rows under a reference (`GET /v1/charges`). */
99
100
  readonly charges: Charges;
101
+ /** An app's own cloud environments, paid by the app (`/v1/environments`). */
102
+ readonly environments: Environments;
100
103
  /** Dollar limits (`GET`/`PUT`/`DELETE /v1/spend-limits`); the person's own client only. */
101
104
  readonly spendLimits: SpendLimits;
102
105
  /** Scope-filtered provider tools and daemon-mediated calls. */
package/dist/client.js CHANGED
@@ -3,6 +3,7 @@ import { CrouterError, mapError } from './errors.js';
3
3
  import { Canvas } from './resources/canvas.js';
4
4
  import { Docs } from './resources/docs.js';
5
5
  import { Charges } from './resources/charges.js';
6
+ import { Environments } from './resources/environments.js';
6
7
  import { SpendLimits } from './resources/spend-limits.js';
7
8
  import { Relations } from './resources/relations.js';
8
9
  import { Schemas } from './resources/schemas.js';
@@ -57,6 +58,8 @@ export class Crouter {
57
58
  relations;
58
59
  /** The runtime's money ledger: month charge rows and the rows under a reference (`GET /v1/charges`). */
59
60
  charges;
61
+ /** An app's own cloud environments, paid by the app (`/v1/environments`). */
62
+ environments;
60
63
  /** Dollar limits (`GET`/`PUT`/`DELETE /v1/spend-limits`); the person's own client only. */
61
64
  spendLimits;
62
65
  /** Scope-filtered provider tools and daemon-mediated calls. */
@@ -168,6 +171,7 @@ export class Crouter {
168
171
  this.schemas = new Schemas(request);
169
172
  this.relations = new Relations(request);
170
173
  this.charges = new Charges(request);
174
+ this.environments = new Environments(request);
171
175
  this.spendLimits = new SpendLimits(request);
172
176
  this.runs = new Runs(request, (id, after, signal) => this.openRunEvents(id, after, signal), this.questions);
173
177
  this.providers = new Providers(request);
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export type { Doc, DocEditParams, DocListParams, DocWriteParams } from './resour
15
15
  export type { Schemas } from './resources/schemas.js';
16
16
  export type { Relations } from './resources/relations.js';
17
17
  export type { Charges, ChargeListParams } from './resources/charges.js';
18
+ export type { Environments } from './resources/environments.js';
18
19
  export type { SpendLimits } from './resources/spend-limits.js';
19
20
  export type { MemoryDocument, MemoryGetParams, MemoryListItem, MemoryListPage, MemoryListParams } from './resources/memory.js';
20
21
  export type { Question, QuestionAnswered, QuestionCanceled, QuestionFields, QuestionKind, QuestionResponses, QuestionSlot, QuestionStatus } from './resources/questions.js';
@@ -0,0 +1,15 @@
1
+ import { type AppEnvironmentDTO, type AppEnvironmentListDTO, type CreateAppEnvironmentRequest, type PatchAppEnvironmentRequest } from '@north-light/api';
2
+ import type { RequestOptions } from '../types.js';
3
+ import type { Request } from './request.js';
4
+ /** An app's own environments (`/v1/environments`), paid by the app. */
5
+ export declare class Environments {
6
+ private readonly request;
7
+ constructor(request: Request);
8
+ /** Create the environment `name`, or return the existing one when its recipe is the same; a different recipe is `409 conflict` (use `patch`). `payer` must be a principal the app speaks for or a grant owner naming itself payer. */
9
+ create(params: CreateAppEnvironmentRequest, options?: RequestOptions): Promise<AppEnvironmentDTO>;
10
+ list(options?: RequestOptions): Promise<AppEnvironmentListDTO>;
11
+ /** Change the recipe or memory; a field left out keeps its value. */
12
+ patch(name: string, params: PatchAppEnvironmentRequest, options?: RequestOptions): Promise<AppEnvironmentDTO>;
13
+ /** Delete the environment and its profile. */
14
+ delete(name: string, options?: RequestOptions): Promise<unknown>;
15
+ }
@@ -0,0 +1,23 @@
1
+ import { routes } from '@north-light/api';
2
+ /** An app's own environments (`/v1/environments`), paid by the app. */
3
+ export class Environments {
4
+ request;
5
+ constructor(request) {
6
+ this.request = request;
7
+ }
8
+ /** Create the environment `name`, or return the existing one when its recipe is the same; a different recipe is `409 conflict` (use `patch`). `payer` must be a principal the app speaks for or a grant owner naming itself payer. */
9
+ create(params, options) {
10
+ return this.request('POST', routes.environments(), params, options);
11
+ }
12
+ list(options) {
13
+ return this.request('GET', routes.environments(), undefined, options);
14
+ }
15
+ /** Change the recipe or memory; a field left out keeps its value. */
16
+ patch(name, params, options) {
17
+ return this.request('PATCH', routes.environment(name), params, options);
18
+ }
19
+ /** Delete the environment and its profile. */
20
+ delete(name, options) {
21
+ return this.request('DELETE', routes.environment(name), undefined, options);
22
+ }
23
+ }
@@ -2,7 +2,7 @@
2
2
  name: northlight
3
3
  description: "Use when building, debugging or shipping an app that signs people in with Northlight, starts runs on their Northlight runtime, or calls Northlight providers (sms, search, integrations, context, device) with @north-light/sdk."
4
4
  metadata:
5
- sdk-version: "0.3.751"
5
+ sdk-version: "0.3.753"
6
6
  ---
7
7
 
8
8
  # Building a Northlight app
@@ -27,7 +27,7 @@ Never text a person first: Comms refuses a send to anyone who has not texted you
27
27
 
28
28
  ## First: check this skill matches the SDK
29
29
 
30
- This skill is for SDK version `0.3.751`. If the project has `node_modules/@north-light/sdk/package.json`, compare its `version` with that number. If they differ, run `npx @north-light/sdk skill` in the project, then read the rewritten `.agents/skills/northlight/SKILL.md` (or `.claude/skills/northlight/SKILL.md`) instead of this copy. It needs no account. A project that has no SDK yet starts with `npx @north-light/sdk@latest init <dir>`.
30
+ This skill is for SDK version `0.3.753`. If the project has `node_modules/@north-light/sdk/package.json`, compare its `version` with that number. If they differ, run `npx @north-light/sdk skill` in the project, then read the rewritten `.agents/skills/northlight/SKILL.md` (or `.claude/skills/northlight/SKILL.md`) instead of this copy. It needs no account. A project that has no SDK yet starts with `npx @north-light/sdk@latest init <dir>`.
31
31
 
32
32
  ## Where things run
33
33
 
package/dist/version.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** This SDK's release version. Informational only: compatibility is the contract level, not this number. */
2
- export declare const SDK_VERSION = "0.3.751";
2
+ export declare const SDK_VERSION = "0.3.753";
3
3
  /** The release sent in `Crouter-Minimum-Runtime-Version` on every request. It is frozen, so a runtime from before the
4
4
  * contract level existed (which only knows this header) refuses this SDK, while every later runtime accepts it. */
5
5
  export declare const LEGACY_FLOOR = "0.3.423";
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // SDK_VERSION is written by scripts/release-version.mjs on every release; do not edit by hand.
2
2
  /** This SDK's release version. Informational only: compatibility is the contract level, not this number. */
3
- export const SDK_VERSION = '0.3.751';
3
+ export const SDK_VERSION = '0.3.753';
4
4
  // LEGACY_FLOOR is written once by `scripts/contract.mjs release`, at the first release that carries the contract level
5
5
  // (the `0.0.0` placeholder is replaced there and never again); do not edit by hand.
6
6
  /** The release sent in `Crouter-Minimum-Runtime-Version` on every request. It is frozen, so a runtime from before the
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@north-light/sdk",
3
- "version": "0.3.751",
4
- "crouterContract": "1.75",
3
+ "version": "0.3.753",
4
+ "crouterContract": "1.77",
5
5
  "description": "Typed Node and browser client for running crouter agents through the crtrd /v1 API.",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -44,9 +44,9 @@
44
44
  "prepublishOnly": "node -e \"if (process.env.npm_config_tag !== 'next') { console.error('@north-light/sdk publishes only with --tag next; scripts/promote-sdk.mjs is the only mover of latest.'); process.exit(1); }\""
45
45
  },
46
46
  "dependencies": {
47
- "@north-light/api": "0.3.751",
48
- "@north-light/identity": "0.3.751",
49
- "@north-light/plugin": "0.3.751",
47
+ "@north-light/api": "0.3.753",
48
+ "@north-light/identity": "0.3.753",
49
+ "@north-light/plugin": "0.3.753",
50
50
  "jose": "^6.2.1"
51
51
  },
52
52
  "peerDependencies": {