@north-light/sdk 0.3.866 → 0.3.868

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/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export type { CustomDeliveryStream, ReceiveOptions } from './resources/custom-ob
6
6
  export type { RunEvent, RunEventOf, RunEventType, UnknownRunEvent } from './resources/run-stream.js';
7
7
  export { RunReply } from './resources/run-reply.js';
8
8
  export type { RunReplyCollectOptions, RunReplyEnding, RunReplyEvent, RunReplyResult, SentRunMessage } from './resources/run-reply.js';
9
- export type { AppMachine, AppProfile, RunActivity, RunDeleteResult, RunObject, RunParsedOutcome, RunParseOptions, RunParseParams, RunRecap, RunStartParams, RunStartResult, RunStatus, RunTrace } from './resources/runs.js';
9
+ export type { AppMachine, AppProfile, RunActivity, RunDeleteResult, RunObject, RunParsedOutcome, RunParseOptions, RunParseParams, RunRecap, RunStartParams, RunStartResult, StopHook, RunStatus, RunTrace } from './resources/runs.js';
10
10
  export type { FileLink } from './resources/files.js';
11
11
  export type { Upload, UploadCreateParams } from './resources/uploads.js';
12
12
  export type { AttachmentLink } from './resources/attachments.js';
@@ -5,6 +5,11 @@ import type { JsonSchema, OutputSchema, RequestOptions, SchemaOutput } from '../
5
5
  import type { RunActivityDTO, RunOutcomeDTO, RunTraceDTO, TurnErrorDTO } from '@north-light/api';
6
6
  /** The request header that names what caused a call; the runtime reads it on `/v1`. */
7
7
  export declare const CAUSED_BY_HEADER = "Crtr-Caused-By";
8
+ /** `RunStartParams.stop_hook`. */
9
+ export interface StopHook {
10
+ require_command: string[];
11
+ reprompt: string;
12
+ }
8
13
  export interface RunStartParams {
9
14
  prompt: string;
10
15
  scopes?: string[];
@@ -33,6 +38,16 @@ export interface RunStartParams {
33
38
  /** A first message, stored with the run as a `start_turn: false` message: it always joins the first turn
34
39
  * as context ahead of `prompt`. The result's `message` is what `runs.reply` takes to follow that turn. */
35
40
  message?: string;
41
+ /** Text appended to the run agent's system prompt, after the runtime's own. At most 256 KB. */
42
+ system_prompt?: string;
43
+ /** Tool allow-list for the run's agent, replacing its kind's. */
44
+ tools?: string[];
45
+ /** Env for the run agent's process. Names that would change the runtime's own process are refused (`CRTR_*`, `LD_*`, `DYLD_*`, `NODE_*`, `PATH`, `HOME`, `*_PROXY`, `*_BASE_URL`, `*_API_KEY`, `*_TOKEN`) (`invalid_request`, `param: env`). */
46
+ env?: Record<string, string>;
47
+ /** Start the run as a copy of the conversation of one of this app's own runs (its `run_id`). Another app's run is `not_found`. */
48
+ fork_from?: string;
49
+ /** A check on the run agent's turn end. If the turn ran no bash command containing any `require_command` string, the agent is reprompted with `reprompt` and the turn continues; each turn is refused at most once, then the run rests as usual. */
50
+ stop_hook?: StopHook;
36
51
  /** What caused this run, sent as the `Crtr-Caused-By` request header (not in the body): `message:<id>`, `request:<id>` or `cron_run:<id>`.
37
52
  * The runtime records it on the run's root node and its charges, so spend traces back to the call that started the run.
38
53
  * A call from inside a provider's handler passes the inbound `request:<id>`. It overrides a client-wide `CrouterOptions.causedBy`
@@ -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.866"
5
+ sdk-version: "0.3.868"
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.866`. 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.868`. 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
 
@@ -891,14 +891,14 @@ export class FakeCloud {
891
891
  }
892
892
  runStart(user, body, rawKey) {
893
893
  const params = objectBody(body);
894
- for (const field of ['mode', 'parent', 'fork_from', 'node_id', 'env', 'tools', 'system_prompt'])
894
+ for (const field of ['mode', 'parent', 'node_id'])
895
895
  if (params[field] !== undefined)
896
896
  throw refuse(403, 'owner_only', `${field} is owner-only`, { param: field });
897
897
  for (const field of ['payer', 'model_policy', 'kind'])
898
898
  if (params[field] !== undefined)
899
899
  throw invalid(`${field} is not available`, field);
900
900
  for (const field of Object.keys(params))
901
- if (!['prompt', 'scopes', 'metadata', 'profile', 'isolated', 'cwd', 'worktree', 'output_schema', 'message', 'model', 'deadline'].includes(field))
901
+ if (!['prompt', 'scopes', 'metadata', 'profile', 'isolated', 'cwd', 'worktree', 'output_schema', 'message', 'model', 'deadline', 'system_prompt', 'tools', 'env', 'fork_from', 'stop_hook'].includes(field))
902
902
  throw invalid(`unknown field ${field}`, field);
903
903
  if (params['model'] !== undefined && (typeof params['model'] !== 'string' || !params['model'].trim()))
904
904
  throw invalid('model must be a non-empty string', 'model');
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.866";
2
+ export declare const SDK_VERSION = "0.3.868";
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.866';
3
+ export const SDK_VERSION = '0.3.868';
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.866",
4
- "crouterContract": "1.107",
3
+ "version": "0.3.868",
4
+ "crouterContract": "1.108",
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",
@@ -50,9 +50,9 @@
50
50
  "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); }\""
51
51
  },
52
52
  "dependencies": {
53
- "@north-light/api": "0.3.866",
54
- "@north-light/identity": "0.3.866",
55
- "@north-light/plugin": "0.3.866",
53
+ "@north-light/api": "0.3.868",
54
+ "@north-light/identity": "0.3.868",
55
+ "@north-light/plugin": "0.3.868",
56
56
  "jose": "^6.2.1"
57
57
  },
58
58
  "peerDependencies": {