@north-light/sdk 0.3.550 → 0.3.552
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 +15 -4
- package/dist/client.js +14 -4
- package/dist/errors.d.ts +5 -2
- package/dist/errors.js +6 -1
- package/dist/index.d.ts +3 -0
- package/dist/oauth/index.js +1 -1
- package/dist/resources/charges.d.ts +23 -0
- package/dist/resources/charges.js +15 -0
- package/dist/resources/runs.d.ts +7 -0
- package/dist/resources/runs.js +6 -2
- package/dist/resources/spend-limits.d.ts +14 -0
- package/dist/resources/spend-limits.js +20 -0
- package/dist/skill/northlight/SKILL.md +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
package/dist/client.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { Bash } from './resources/bash.js';
|
|
|
3
3
|
import { Canvas } from './resources/canvas.js';
|
|
4
4
|
import { Crons } from './resources/crons.js';
|
|
5
5
|
import { Docs } from './resources/docs.js';
|
|
6
|
+
import { Charges } from './resources/charges.js';
|
|
7
|
+
import { SpendLimits } from './resources/spend-limits.js';
|
|
6
8
|
import { Relations } from './resources/relations.js';
|
|
7
9
|
import { Schemas } from './resources/schemas.js';
|
|
8
10
|
import { CustomObjects } from './resources/custom-objects.js';
|
|
@@ -61,13 +63,17 @@ export interface CrouterOptions {
|
|
|
61
63
|
defaultHeaders?: Record<string, string>;
|
|
62
64
|
/** Merged after `defaultHeaders`; the `Authorization` generated from `token` still wins. */
|
|
63
65
|
headers?: Record<string, string>;
|
|
66
|
+
/** Sent as the `Crtr-Caused-By` header on every request of this client: `message:<id>`, `request:<id>` or `cron_run:<id>`.
|
|
67
|
+
* The runtime records it on the charges and runs the request causes. A provider handler passes the inbound `request:<id>`. The runtime
|
|
68
|
+
* ignores any other form. `RunStartParams.causedBy` overrides it for one `runs.start`. */
|
|
69
|
+
causedBy?: string;
|
|
64
70
|
/** Transport override, for proxies and instrumentation. */
|
|
65
71
|
fetch?: typeof fetch;
|
|
66
72
|
/** On a cold socket, run `crtr sys daemon start` and retry once. Node only. Defaults to true for a socket, false for `baseURL`. */
|
|
67
73
|
autostart?: boolean;
|
|
68
74
|
}
|
|
69
75
|
/** The namespaces of `Crouter` that only the owner's own daemon serves. A person's app listener answers them `404 unknown operation`. */
|
|
70
|
-
export type OwnerOnly = 'nodes' | 'bash' | 'canvas' | 'crons' | 'structuredRequests' | 'customObjects' | 'human' | 'models' | 'system' | 'auth';
|
|
76
|
+
export type OwnerOnly = 'spendLimits' | 'nodes' | 'bash' | 'canvas' | 'crons' | 'structuredRequests' | 'customObjects' | 'human' | 'models' | 'system' | 'auth';
|
|
71
77
|
/** What an app reaches on a person's runtime (the app listener): `Crouter` without the owner-daemon namespaces, `files.download`
|
|
72
78
|
* only, `profiles.list` only, `customObjects` register/publish/unregister and `canvas` watch/unwatch. `Crouter` is assignable to it, so a function that takes `AppClient` takes either. */
|
|
73
79
|
export type AppClient = Omit<Crouter, OwnerOnly | 'files' | 'profiles'> & {
|
|
@@ -140,6 +146,10 @@ export declare class Crouter {
|
|
|
140
146
|
readonly schemas: Schemas;
|
|
141
147
|
/** Write, replace and list the relation facts of the app's own schema (app listener only). */
|
|
142
148
|
readonly relations: Relations;
|
|
149
|
+
/** The runtime's money ledger: month charge rows and the rows under a reference (`GET /v1/charges`). */
|
|
150
|
+
readonly charges: Charges;
|
|
151
|
+
/** Dollar limits (`GET`/`PUT`/`DELETE /v1/spend-limits`); the person's own client only. */
|
|
152
|
+
readonly spendLimits: SpendLimits;
|
|
143
153
|
/** Scope-filtered provider tools and daemon-mediated calls. */
|
|
144
154
|
readonly providers: Providers;
|
|
145
155
|
/** The caller's grant. With `wait` (1–25 s) and `since` (a `version` from an earlier answer), the runtime holds the
|
|
@@ -157,9 +167,10 @@ export declare class Crouter {
|
|
|
157
167
|
api_version: string;
|
|
158
168
|
}>;
|
|
159
169
|
};
|
|
160
|
-
/** The caller's month-to-date spend (`usage.get`): user-paid model and
|
|
161
|
-
* `spend_cap`, and `reset_at`.
|
|
162
|
-
* (a `RateLimitError`, status 402, `userAction: 'raise_cap'
|
|
170
|
+
/** @deprecated Use `charges.list`. The caller's month-to-date spend (`usage.get`): user-paid model and priced tool usage, app-paid usage,
|
|
171
|
+
* the grant's `spend_cap`, and `reset_at`. The cap counts priced tool calls as well as model calls. Once user-paid spend reaches
|
|
172
|
+
* `spend_cap`, calls billed to the user answer `cap_exhausted` (a `RateLimitError`, status 402, `userAction: 'raise_cap'`,
|
|
173
|
+
* `error.capExhausted` holds the limit) until `reset_at`. `month` is `YYYY-MM` (UTC; default: current). */
|
|
163
174
|
readonly usage: {
|
|
164
175
|
get: (params?: {
|
|
165
176
|
month?: string;
|
package/dist/client.js
CHANGED
|
@@ -4,6 +4,8 @@ import { Bash } from './resources/bash.js';
|
|
|
4
4
|
import { Canvas } from './resources/canvas.js';
|
|
5
5
|
import { Crons } from './resources/crons.js';
|
|
6
6
|
import { Docs } from './resources/docs.js';
|
|
7
|
+
import { Charges } from './resources/charges.js';
|
|
8
|
+
import { SpendLimits } from './resources/spend-limits.js';
|
|
7
9
|
import { Relations } from './resources/relations.js';
|
|
8
10
|
import { Schemas } from './resources/schemas.js';
|
|
9
11
|
import { CustomObjects } from './resources/custom-objects.js';
|
|
@@ -16,7 +18,7 @@ import { nodeId, pathSegment } from './resources/identifiers.js';
|
|
|
16
18
|
import { NodeStream } from './resources/node-stream.js';
|
|
17
19
|
import { Questions } from './resources/questions.js';
|
|
18
20
|
import { Providers } from './resources/providers.js';
|
|
19
|
-
import { Runs } from './resources/runs.js';
|
|
21
|
+
import { CAUSED_BY_HEADER, Runs } from './resources/runs.js';
|
|
20
22
|
import { Shares } from './resources/shares.js';
|
|
21
23
|
import { StructuredRequests } from './resources/structured-requests.js';
|
|
22
24
|
import { Memory } from './resources/memory.js';
|
|
@@ -75,6 +77,10 @@ export class Crouter {
|
|
|
75
77
|
schemas;
|
|
76
78
|
/** Write, replace and list the relation facts of the app's own schema (app listener only). */
|
|
77
79
|
relations;
|
|
80
|
+
/** The runtime's money ledger: month charge rows and the rows under a reference (`GET /v1/charges`). */
|
|
81
|
+
charges;
|
|
82
|
+
/** Dollar limits (`GET`/`PUT`/`DELETE /v1/spend-limits`); the person's own client only. */
|
|
83
|
+
spendLimits;
|
|
78
84
|
/** Scope-filtered provider tools and daemon-mediated calls. */
|
|
79
85
|
providers;
|
|
80
86
|
/** The caller's grant. With `wait` (1–25 s) and `since` (a `version` from an earlier answer), the runtime holds the
|
|
@@ -82,9 +88,10 @@ export class Crouter {
|
|
|
82
88
|
* `wait`. To follow many people's grants, use `oauth.watchGrants`. */
|
|
83
89
|
grant;
|
|
84
90
|
health;
|
|
85
|
-
/** The caller's month-to-date spend (`usage.get`): user-paid model and
|
|
86
|
-
* `spend_cap`, and `reset_at`.
|
|
87
|
-
* (a `RateLimitError`, status 402, `userAction: 'raise_cap'
|
|
91
|
+
/** @deprecated Use `charges.list`. The caller's month-to-date spend (`usage.get`): user-paid model and priced tool usage, app-paid usage,
|
|
92
|
+
* the grant's `spend_cap`, and `reset_at`. The cap counts priced tool calls as well as model calls. Once user-paid spend reaches
|
|
93
|
+
* `spend_cap`, calls billed to the user answer `cap_exhausted` (a `RateLimitError`, status 402, `userAction: 'raise_cap'`,
|
|
94
|
+
* `error.capExhausted` holds the limit) until `reset_at`. `month` is `YYYY-MM` (UTC; default: current). */
|
|
88
95
|
usage;
|
|
89
96
|
eventFetch;
|
|
90
97
|
bearerToken;
|
|
@@ -118,6 +125,7 @@ export class Crouter {
|
|
|
118
125
|
const headers = {
|
|
119
126
|
...options.defaultHeaders,
|
|
120
127
|
...options.headers,
|
|
128
|
+
...(options.causedBy === undefined ? {} : { [CAUSED_BY_HEADER]: options.causedBy }),
|
|
121
129
|
...(token === undefined ? {} : { Authorization: `Bearer ${token}` }),
|
|
122
130
|
};
|
|
123
131
|
const baseFetch = requireCurrentRuntime(options.fetch ?? (baseURL === undefined && isNodeRuntime() ? localSocketFetch(options.socketPath ?? env['CRTR_SOCKET']) : undefined));
|
|
@@ -235,6 +243,8 @@ export class Crouter {
|
|
|
235
243
|
this.docs = new Docs(request);
|
|
236
244
|
this.schemas = new Schemas(request);
|
|
237
245
|
this.relations = new Relations(request);
|
|
246
|
+
this.charges = new Charges(request);
|
|
247
|
+
this.spendLimits = new SpendLimits(request);
|
|
238
248
|
this.runs = new Runs(request, (id, after, signal) => this.openRunEvents(id, after, signal), this.questions);
|
|
239
249
|
this.providers = new Providers(request);
|
|
240
250
|
this.grant = { get: (options = {}) => {
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIError } from '@north-light/api';
|
|
1
|
+
import { APIError, type CapExhaustedDetails } from '@north-light/api';
|
|
2
2
|
import type { SdkErrorCode } from './error-codes.js';
|
|
3
3
|
export { APIError };
|
|
4
4
|
/** An SDK configuration or protocol error, raised by the SDK itself. Its `code` is an `SdkErrorCode`. */
|
|
@@ -50,8 +50,11 @@ export declare class ConflictError extends APIError {
|
|
|
50
50
|
/** The request was well-formed but unusable, or too large: HTTP 413 and 422. */
|
|
51
51
|
export declare class UnprocessableEntityError extends APIError {
|
|
52
52
|
}
|
|
53
|
-
/** Too many requests
|
|
53
|
+
/** Too many requests (HTTP 429) or a refused spend (HTTP 402 `cap_exhausted`). */
|
|
54
54
|
export declare class RateLimitError extends APIError {
|
|
55
|
+
/** For `cap_exhausted`: the limit that refused the call, the dollars counted against it, `reset_at`, and what the person can do
|
|
56
|
+
* (`raise_cap` or `clear_limit`; none for an operator limit). `null` for any other code. */
|
|
57
|
+
get capExhausted(): CapExhaustedDetails | null;
|
|
55
58
|
}
|
|
56
59
|
/** The daemon failed while handling the request: HTTP 500 and above. */
|
|
57
60
|
export declare class InternalServerError extends APIError {
|
package/dist/errors.js
CHANGED
|
@@ -44,8 +44,13 @@ export class ConflictError extends APIError {
|
|
|
44
44
|
/** The request was well-formed but unusable, or too large: HTTP 413 and 422. */
|
|
45
45
|
export class UnprocessableEntityError extends APIError {
|
|
46
46
|
}
|
|
47
|
-
/** Too many requests
|
|
47
|
+
/** Too many requests (HTTP 429) or a refused spend (HTTP 402 `cap_exhausted`). */
|
|
48
48
|
export class RateLimitError extends APIError {
|
|
49
|
+
/** For `cap_exhausted`: the limit that refused the call, the dollars counted against it, `reset_at`, and what the person can do
|
|
50
|
+
* (`raise_cap` or `clear_limit`; none for an operator limit). `null` for any other code. */
|
|
51
|
+
get capExhausted() {
|
|
52
|
+
return this.code === 'cap_exhausted' && this.details !== null && typeof this.details === 'object' ? this.details : null;
|
|
53
|
+
}
|
|
49
54
|
}
|
|
50
55
|
/** The daemon failed while handling the request: HTTP 500 and above. */
|
|
51
56
|
export class InternalServerError extends APIError {
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export type { Share, ShareCreated, ShareCreateParams } from './resources/shares.
|
|
|
15
15
|
export type { Doc, DocEditParams, DocListParams, DocWriteParams } from './resources/docs.js';
|
|
16
16
|
export type { Schemas } from './resources/schemas.js';
|
|
17
17
|
export type { Relations } from './resources/relations.js';
|
|
18
|
+
export type { Charges, ChargeListParams } from './resources/charges.js';
|
|
19
|
+
export type { SpendLimits } from './resources/spend-limits.js';
|
|
18
20
|
export type { MemoryDocument, MemoryGetParams, MemoryListItem, MemoryListPage, MemoryListParams } from './resources/memory.js';
|
|
19
21
|
export type { Question, QuestionAnswered, QuestionCanceled, QuestionFields, QuestionKind, QuestionResponses, QuestionSlot, QuestionStatus } from './resources/questions.js';
|
|
20
22
|
export type { ProviderToolEntry } from './resources/providers.js';
|
|
@@ -39,6 +41,7 @@ export { describeToolDefault, followActivity } from './resources/activity.js';
|
|
|
39
41
|
export type { ActivityStep, DescribeTool } from './resources/activity.js';
|
|
40
42
|
export { APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConflictError, CrouterError, DeadlineExceededError, InternalServerError, NoHostedRuntimeError, NotGrantedError, NotFoundError, PermissionDeniedError, RateLimitError, RuntimeVersionError, UnprocessableEntityError, mapError, } from './errors.js';
|
|
41
43
|
export type { DeadlineDetails, RuntimeVersionDetails } from './errors.js';
|
|
44
|
+
export type { CapExhaustedDetails } from '@north-light/api';
|
|
42
45
|
export { SDK_VERSION } from './version.js';
|
|
43
46
|
export { setupLink } from './setup-link.js';
|
|
44
47
|
export { sdkErrorCodes } from './error-codes.js';
|
package/dist/oauth/index.js
CHANGED
|
@@ -64,7 +64,7 @@ function httpsUrl(value) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
/** The owner-daemon namespaces a person's runtime does not serve to an app. `canvas` and `customObjects` are narrowed below, not absent. */
|
|
67
|
-
const OWNER_ONLY = ['nodes', 'bash', 'crons', 'structuredRequests', 'human', 'models', 'system', 'auth'];
|
|
67
|
+
const OWNER_ONLY = ['spendLimits', 'nodes', 'bash', 'crons', 'structuredRequests', 'human', 'models', 'system', 'auth'];
|
|
68
68
|
/** The class `ConnectedCrouter` extends: `Crouter`'s implementation under the type of what a person's app listener serves. */
|
|
69
69
|
const AppCrouter = Crouter;
|
|
70
70
|
/** A runtime client on one person's stored connection (`oauth.client(userId)`): an `AppClient` that refreshes its
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ChargeListDTO } from '@north-light/api';
|
|
2
|
+
import type { RequestOptions } from '../types.js';
|
|
3
|
+
import { type Request } from './request.js';
|
|
4
|
+
/** `charges.list` input. */
|
|
5
|
+
export interface ChargeListParams {
|
|
6
|
+
/** UTC `YYYY-MM`; default the current month. With `under`, no default: the chain spans every month unless one is named. */
|
|
7
|
+
month?: string;
|
|
8
|
+
/** A reference (`message:<id>`, `request:<id>`, `cron_run:<id>`, `run:<id>`) or a charge id: only the rows under it. */
|
|
9
|
+
under?: string;
|
|
10
|
+
/** Page size, 1 to 10,000; default 1,000. */
|
|
11
|
+
limit?: number;
|
|
12
|
+
/** The `next` of the previous page. */
|
|
13
|
+
after?: string;
|
|
14
|
+
}
|
|
15
|
+
/** The runtime's money ledger, read-only. */
|
|
16
|
+
export declare class Charges {
|
|
17
|
+
private readonly request;
|
|
18
|
+
constructor(request: Request);
|
|
19
|
+
/** One page of the month's charge rows on this runtime, or of the rows under a reference, in time order; while `next` is not null,
|
|
20
|
+
* call again with it as `after` to read the rest. An app sees only rows it is the grantee of; the person also gets the month's
|
|
21
|
+
* totals by payer and funding with the limits (over every row of the month, not the page). Replaces `usage.get`. */
|
|
22
|
+
list(params?: ChargeListParams, options?: RequestOptions): Promise<ChargeListDTO>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { routes } from '@north-light/api';
|
|
2
|
+
import { withQuery } from './request.js';
|
|
3
|
+
/** The runtime's money ledger, read-only. */
|
|
4
|
+
export class Charges {
|
|
5
|
+
request;
|
|
6
|
+
constructor(request) {
|
|
7
|
+
this.request = request;
|
|
8
|
+
}
|
|
9
|
+
/** One page of the month's charge rows on this runtime, or of the rows under a reference, in time order; while `next` is not null,
|
|
10
|
+
* call again with it as `after` to read the rest. An app sees only rows it is the grantee of; the person also gets the month's
|
|
11
|
+
* totals by payer and funding with the limits (over every row of the month, not the page). Replaces `usage.get`. */
|
|
12
|
+
list(params = {}, options) {
|
|
13
|
+
return this.request('GET', withQuery(routes.charges(), params), undefined, options);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/dist/resources/runs.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { RunReply, type SentRunMessage } from './run-reply.js';
|
|
|
3
3
|
import type { Questions, Question, QuestionResponses } from './questions.js';
|
|
4
4
|
import type { JsonSchema, OutputSchema, RequestOptions, SchemaOutput } from '../types.js';
|
|
5
5
|
import type { RunActivityDTO, RunOutcomeDTO, RunTraceDTO, TurnErrorDTO } from '@north-light/api';
|
|
6
|
+
/** The request header that names what caused a call; the runtime reads it on `/v1`. */
|
|
7
|
+
export declare const CAUSED_BY_HEADER = "Crtr-Caused-By";
|
|
6
8
|
export interface RunStartParams {
|
|
7
9
|
prompt: string;
|
|
8
10
|
scopes?: string[];
|
|
@@ -25,6 +27,11 @@ export interface RunStartParams {
|
|
|
25
27
|
/** A first message, stored with the run as a `start_turn: false` message: it always joins the first turn
|
|
26
28
|
* as context ahead of `prompt`. The result's `message` is what `runs.reply` takes to follow that turn. */
|
|
27
29
|
message?: string;
|
|
30
|
+
/** What caused this run, sent as the `Crtr-Caused-By` request header (not in the body): `message:<id>`, `request:<id>` or `cron_run:<id>`.
|
|
31
|
+
* The runtime records it on the run's root node and its charges, so spend traces back to the call that started the run.
|
|
32
|
+
* A call from inside a provider's handler passes the inbound `request:<id>`. It overrides a client-wide `CrouterOptions.causedBy`
|
|
33
|
+
* for this call. A value in any other form is ignored by the runtime. */
|
|
34
|
+
causedBy?: string;
|
|
28
35
|
}
|
|
29
36
|
export interface RunStartResult {
|
|
30
37
|
run_id: string;
|
package/dist/resources/runs.js
CHANGED
|
@@ -4,6 +4,8 @@ import { RunStream } from './run-stream.js';
|
|
|
4
4
|
import { RunReply } from './run-reply.js';
|
|
5
5
|
import { resolveJsonSchema } from '../schema.js';
|
|
6
6
|
import { deadline, heldReadOptions } from './request.js';
|
|
7
|
+
/** The request header that names what caused a call; the runtime reads it on `/v1`. */
|
|
8
|
+
export const CAUSED_BY_HEADER = 'Crtr-Caused-By';
|
|
7
9
|
export class Runs {
|
|
8
10
|
request;
|
|
9
11
|
openEvents;
|
|
@@ -15,8 +17,10 @@ export class Runs {
|
|
|
15
17
|
}
|
|
16
18
|
async start(params, options = {}) {
|
|
17
19
|
const { idempotencyKey = crypto.randomUUID(), maxRetries = 2, ...rest } = options;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
+
const { causedBy, ...fields } = params;
|
|
21
|
+
const body = fields.output_schema === undefined ? fields : { ...fields, output_schema: resolveJsonSchema(fields.output_schema) };
|
|
22
|
+
const headers = causedBy === undefined ? rest.headers : { ...rest.headers, [CAUSED_BY_HEADER]: causedBy };
|
|
23
|
+
return this.keyedSend('/v1/runs', body, idempotencyKey, maxRetries, headers === undefined ? rest : { ...rest, headers });
|
|
20
24
|
}
|
|
21
25
|
get(runId, options = {}) {
|
|
22
26
|
const { wait, ...rest } = options;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type LimitDTO, type SpendLimitListDTO, type SpendLimitRemovedDTO, type SpendLimitSetRequest } from '@north-light/api';
|
|
2
|
+
import type { RequestOptions } from '../types.js';
|
|
3
|
+
import type { Request } from './request.js';
|
|
4
|
+
/** The runtime's dollar limits. The person's own client only: an app is refused `403 owner_only` (`limits.*` is the unrelated per-app memory and disk cap). */
|
|
5
|
+
export declare class SpendLimits {
|
|
6
|
+
private readonly request;
|
|
7
|
+
constructor(request: Request);
|
|
8
|
+
/** Every limit row: grant caps, the person's own limits and operator limits. */
|
|
9
|
+
list(options?: RequestOptions): Promise<SpendLimitListDTO>;
|
|
10
|
+
/** Write the limit row `id` (it must start `person:`), replacing any row with that id. `usd_per_month: 0` is an emergency stop. */
|
|
11
|
+
set(id: string, params: SpendLimitSetRequest, options?: RequestOptions): Promise<LimitDTO>;
|
|
12
|
+
/** Clear a `person:` limit row. `404 not_found` when there is none. */
|
|
13
|
+
remove(id: string, options?: RequestOptions): Promise<SpendLimitRemovedDTO>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { routes } from '@north-light/api';
|
|
2
|
+
/** The runtime's dollar limits. The person's own client only: an app is refused `403 owner_only` (`limits.*` is the unrelated per-app memory and disk cap). */
|
|
3
|
+
export class SpendLimits {
|
|
4
|
+
request;
|
|
5
|
+
constructor(request) {
|
|
6
|
+
this.request = request;
|
|
7
|
+
}
|
|
8
|
+
/** Every limit row: grant caps, the person's own limits and operator limits. */
|
|
9
|
+
list(options) {
|
|
10
|
+
return this.request('GET', routes.spendLimits(), undefined, options);
|
|
11
|
+
}
|
|
12
|
+
/** Write the limit row `id` (it must start `person:`), replacing any row with that id. `usd_per_month: 0` is an emergency stop. */
|
|
13
|
+
set(id, params, options) {
|
|
14
|
+
return this.request('PUT', routes.spendLimit(id), params, options);
|
|
15
|
+
}
|
|
16
|
+
/** Clear a `person:` limit row. `404 not_found` when there is none. */
|
|
17
|
+
remove(id, options) {
|
|
18
|
+
return this.request('DELETE', routes.spendLimit(id), undefined, options);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -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.
|
|
5
|
+
sdk-version: "0.3.552"
|
|
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.
|
|
30
|
+
This skill is for SDK version `0.3.552`. 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.
|
|
2
|
+
export declare const SDK_VERSION = "0.3.552";
|
|
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.552';
|
|
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.552",
|
|
4
|
+
"crouterContract": "1.32",
|
|
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.
|
|
48
|
-
"@north-light/identity": "0.3.
|
|
49
|
-
"@north-light/plugin": "0.3.
|
|
47
|
+
"@north-light/api": "0.3.552",
|
|
48
|
+
"@north-light/identity": "0.3.552",
|
|
49
|
+
"@north-light/plugin": "0.3.552",
|
|
50
50
|
"jose": "^6.2.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|