@north-light/sdk 0.3.794 → 0.3.795

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
@@ -63,7 +63,7 @@ export type AppClient = Omit<Crouter, OwnerOnly> & {
63
63
  * or the human inbox uses `CrtrClient` from `@north-light/api`.
64
64
  */
65
65
  export declare class Crouter {
66
- /** Link nodes to the app's objects: `watch` and `unwatch` with `watcher` (and `watcher_machine` for a node of another machine), under `crtr:objects:link:node`. */
66
+ /** Link nodes to the app's objects: `watch` and `unwatch` with `watcher`, under `crtr:objects:link:node`. */
67
67
  readonly canvas: Canvas;
68
68
  /** Register, publish, receive, and acknowledge custom canvas objects. */
69
69
  readonly customObjects: CustomObjects;
package/dist/client.js CHANGED
@@ -28,7 +28,7 @@ const DEFAULT_TIMEOUT_MS = 30_000;
28
28
  * or the human inbox uses `CrtrClient` from `@north-light/api`.
29
29
  */
30
30
  export class Crouter {
31
- /** Link nodes to the app's objects: `watch` and `unwatch` with `watcher` (and `watcher_machine` for a node of another machine), under `crtr:objects:link:node`. */
31
+ /** Link nodes to the app's objects: `watch` and `unwatch` with `watcher`, under `crtr:objects:link:node`. */
32
32
  canvas;
33
33
  /** Register, publish, receive, and acknowledge custom canvas objects. */
34
34
  customObjects;
@@ -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.794"
5
+ sdk-version: "0.3.795"
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.794`. 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.795`. 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
 
@@ -103,8 +103,8 @@ export declare class PostgresObjectStore {
103
103
  name: string;
104
104
  description: string;
105
105
  }): Promise<ObjectInstance>;
106
- /** Links `node` (on `machine`, `undefined` or `''` for the person's hosted runtime) to the object, then records the link. A node the runtime does not know rejects with `NotFoundError`. */
107
- watch(objectId: string, node: string, machine?: string): Promise<void>;
106
+ /** Links `node` to the object, then records the link. A node the runtime does not know rejects with `NotFoundError`. */
107
+ watch(objectId: string, node: string): Promise<void>;
108
108
  /** Adds a publish row. Pass the client of the caller's open transaction so the row exists exactly when the write it records does. */
109
109
  enqueue(client: PostgresQueryable, objectId: string, event: PublishRequest): Promise<void>;
110
110
  /** Delivers due rows once under the advisory lock; false when another process holds it. */
@@ -180,15 +180,15 @@ export class PostgresObjectStore {
180
180
  await runtime.customObjects.unregister(registered.id);
181
181
  return winner;
182
182
  }
183
- /** Links `node` (on `machine`, `undefined` or `''` for the person's hosted runtime) to the object, then records the link. A node the runtime does not know rejects with `NotFoundError`. */
184
- async watch(objectId, node, machine) {
183
+ /** Links `node` to the object, then records the link. A node the runtime does not know rejects with `NotFoundError`. */
184
+ async watch(objectId, node) {
185
185
  const found = await this.pool.query(`SELECT sub FROM ${this.object} WHERE object_id = $1`, [objectId]);
186
186
  const sub = found.rows[0]?.sub;
187
187
  if (sub === undefined)
188
188
  throw new Error(`no object ${objectId}`);
189
189
  const runtime = await this.options.runtime(sub);
190
- await runtime.canvas.watch(objectId, { watcher: node, ...(machine ? { watcher_machine: machine } : {}) });
191
- await this.pool.query(`INSERT INTO ${this.watcher} (object_id, node, machine) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING`, [objectId, node, machine ?? '']);
190
+ await runtime.canvas.watch(objectId, { watcher: node });
191
+ await this.pool.query(`INSERT INTO ${this.watcher} (object_id, node, machine) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING`, [objectId, node, '']);
192
192
  }
193
193
  /** Adds a publish row. Pass the client of the caller's open transaction so the row exists exactly when the write it records does. */
194
194
  async enqueue(client, objectId, event) {
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.794";
2
+ export declare const SDK_VERSION = "0.3.795";
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.794';
3
+ export const SDK_VERSION = '0.3.795';
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.794",
4
- "crouterContract": "1.90",
3
+ "version": "0.3.795",
4
+ "crouterContract": "1.91",
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.794",
48
- "@north-light/identity": "0.3.794",
49
- "@north-light/plugin": "0.3.794",
47
+ "@north-light/api": "0.3.795",
48
+ "@north-light/identity": "0.3.795",
49
+ "@north-light/plugin": "0.3.795",
50
50
  "jose": "^6.2.1"
51
51
  },
52
52
  "peerDependencies": {