@north-light/sdk 0.3.468 → 0.3.470
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/resources/runs.d.ts +2 -0
- package/dist/testing/cloud.js +8 -3
- package/dist/testing/run.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/dist/resources/runs.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export interface RunStartParams {
|
|
|
11
11
|
isolated?: boolean;
|
|
12
12
|
/** Profile id (`profile_id` from `profiles.list()`) the run's agent uses; absent uses the app's default profile. */
|
|
13
13
|
profile?: string;
|
|
14
|
+
/** The model the run's root agent runs on: a bare strength (`medium`, resolved against the default provider), `family/strength` (`anthropic/medium`), or a concrete registered model id. Absent uses the run kind's default. Applies to the root only; its child nodes choose their own. An unknown or unregistered value is refused (`invalid_request`, `param: model`). */
|
|
15
|
+
model?: string;
|
|
14
16
|
/** A JSON Schema, or an object with `toJSONSchema()` (a Zod v4 object), the run's result must satisfy.
|
|
15
17
|
* Sent as a JSON object; the daemon refuses one that is not an object or is over 256 KB serialized
|
|
16
18
|
* (`invalid_request`, `param: output_schema`), which is raised without a resend. The SDK does not
|
package/dist/testing/cloud.js
CHANGED
|
@@ -827,12 +827,17 @@ export class FakeCloud {
|
|
|
827
827
|
for (const field of ['mode', 'parent', 'fork_from', 'node_id', 'env', 'tools', 'system_prompt'])
|
|
828
828
|
if (params[field] !== undefined)
|
|
829
829
|
throw refuse(403, 'owner_only', `${field} is owner-only`, { param: field });
|
|
830
|
-
for (const field of ['payer', '
|
|
830
|
+
for (const field of ['payer', 'model_policy', 'deadline', 'kind'])
|
|
831
831
|
if (params[field] !== undefined)
|
|
832
832
|
throw invalid(`${field} is not available`, field);
|
|
833
833
|
for (const field of Object.keys(params))
|
|
834
|
-
if (!['prompt', 'scopes', 'metadata', 'profile', 'isolated', 'cwd', 'worktree', 'output_schema', 'message'].includes(field))
|
|
834
|
+
if (!['prompt', 'scopes', 'metadata', 'profile', 'isolated', 'cwd', 'worktree', 'output_schema', 'message', 'model'].includes(field))
|
|
835
835
|
throw invalid(`unknown field ${field}`, field);
|
|
836
|
+
if (params['model'] !== undefined && (typeof params['model'] !== 'string' || !params['model'].trim()))
|
|
837
|
+
throw invalid('model must be a non-empty string', 'model');
|
|
838
|
+
// The fake has no model registry, so it checks only the shape the real server also refuses: a strength, a family/strength, or a provider/model id.
|
|
839
|
+
if (typeof params['model'] === 'string' && !/^(ultra|strong|medium|light|normal|weak|opus|sonnet|haiku|[^/\s]+\/[^\s]+)$/.test(params['model']))
|
|
840
|
+
throw invalid(`model '${params['model']}' is not a strength, a family/strength, or a provider/model id`, 'model');
|
|
836
841
|
if (params['profile'] !== undefined && (typeof params['profile'] !== 'string' || !params['profile']))
|
|
837
842
|
throw invalid('profile must be a profile id', 'profile');
|
|
838
843
|
if (params['isolated'] !== undefined && typeof params['isolated'] !== 'boolean')
|
|
@@ -864,7 +869,7 @@ export class FakeCloud {
|
|
|
864
869
|
const key = this.idempotencyKey(rawKey);
|
|
865
870
|
const message = params['message'];
|
|
866
871
|
const hash = sha256Hex(JSON.stringify({
|
|
867
|
-
prompt: params['prompt'], scopes, metadata, profile: params['profile'], isolated: params['isolated'], cwd: params['cwd'],
|
|
872
|
+
prompt: params['prompt'], scopes, metadata, profile: params['profile'], isolated: params['isolated'], cwd: params['cwd'], ...(params['model'] === undefined ? {} : { model: params['model'] }),
|
|
868
873
|
...(outputSchema === undefined ? {} : { output_schema: outputSchema }), ...(message === undefined ? {} : { message }),
|
|
869
874
|
}));
|
|
870
875
|
if (key !== null) {
|
package/dist/testing/run.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export interface FakeRunParams {
|
|
|
34
34
|
output_schema?: Record<string, unknown>;
|
|
35
35
|
metadata?: Record<string, unknown>;
|
|
36
36
|
profile?: string;
|
|
37
|
+
/** The model the app asked the root to run on. */
|
|
38
|
+
model?: string;
|
|
37
39
|
}
|
|
38
40
|
/** How `settle` ends a run. */
|
|
39
41
|
export type FakeRunEnding = {
|
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.
|
|
2
|
+
export declare const SDK_VERSION = "0.3.470";
|
|
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.
|
|
3
|
+
export const SDK_VERSION = '0.3.470';
|
|
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.
|
|
4
|
-
"crouterContract": "1.
|
|
3
|
+
"version": "0.3.470",
|
|
4
|
+
"crouterContract": "1.7",
|
|
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",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"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); }\""
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@north-light/api": "0.3.
|
|
45
|
-
"@north-light/identity": "0.3.
|
|
44
|
+
"@north-light/api": "0.3.470",
|
|
45
|
+
"@north-light/identity": "0.3.470",
|
|
46
46
|
"jose": "^6.2.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|