@north-light/sdk 0.3.482 → 0.3.484
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 +1 -0
- package/dist/index.js +1 -0
- package/dist/setup-link.d.ts +7 -0
- package/dist/setup-link.js +10 -0
- package/dist/skill/northlight/SKILL.md +2 -2
- package/dist/testing/cloud.js +1 -0
- package/dist/testing/users.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export type { ActivityStep, DescribeTool } from './resources/activity.js';
|
|
|
35
35
|
export { APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConflictError, CrouterError, DeadlineExceededError, InternalServerError, NotFoundError, PermissionDeniedError, RateLimitError, RuntimeVersionError, UnprocessableEntityError, mapError, } from './errors.js';
|
|
36
36
|
export type { DeadlineDetails, RuntimeVersionDetails } from './errors.js';
|
|
37
37
|
export { SDK_VERSION } from './version.js';
|
|
38
|
+
export { setupLink } from './setup-link.js';
|
|
38
39
|
export { sdkErrorCodes } from './error-codes.js';
|
|
39
40
|
export type { SdkErrorCode } from './error-codes.js';
|
|
40
41
|
export type { AuthStatus, AuthStatusParams, CancelParams, EnsureProfileParams, JsonSchema, MessageParams, NodeCreateParams, NodeEventsOptions, NodeOutcomeOptions, OutputSchema, ParsedOutcome, RequestOptions, SchemaOutput, } from './types.js';
|
package/dist/index.js
CHANGED
|
@@ -14,4 +14,5 @@ export { RUN_NOTICE_SCOPE, RunNoticeError, verifyRunNotice } from './resources/r
|
|
|
14
14
|
export { describeToolDefault, followActivity } from './resources/activity.js';
|
|
15
15
|
export { APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConflictError, CrouterError, DeadlineExceededError, InternalServerError, NotFoundError, PermissionDeniedError, RateLimitError, RuntimeVersionError, UnprocessableEntityError, mapError, } from './errors.js';
|
|
16
16
|
export { SDK_VERSION } from './version.js';
|
|
17
|
+
export { setupLink } from './setup-link.js';
|
|
17
18
|
export { sdkErrorCodes } from './error-codes.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProviderDependency } from '@north-light/api';
|
|
2
|
+
/** The link that sends the person to a dependency's setup page and back: `dependency.next` with `return_to` set to
|
|
3
|
+
* `returnTo` (an `https` URL on your app's registered redirect origin), percent-encoded. Any query `next` already
|
|
4
|
+
* carries, such as `client_id`, is kept. Throws when `next` is not an absolute URL or `returnTo` is empty. */
|
|
5
|
+
export declare function setupLink(dependency: Pick<ProviderDependency, 'next'>, options: {
|
|
6
|
+
returnTo: string;
|
|
7
|
+
}): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The link that sends the person to a dependency's setup page and back: `dependency.next` with `return_to` set to
|
|
2
|
+
* `returnTo` (an `https` URL on your app's registered redirect origin), percent-encoded. Any query `next` already
|
|
3
|
+
* carries, such as `client_id`, is kept. Throws when `next` is not an absolute URL or `returnTo` is empty. */
|
|
4
|
+
export function setupLink(dependency, options) {
|
|
5
|
+
if (!options.returnTo)
|
|
6
|
+
throw new TypeError('setupLink: returnTo is required');
|
|
7
|
+
const url = new URL(dependency.next);
|
|
8
|
+
url.searchParams.set('return_to', options.returnTo);
|
|
9
|
+
return url.href;
|
|
10
|
+
}
|
|
@@ -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.484"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Building a Northlight app
|
|
@@ -11,7 +11,7 @@ An app on Northlight signs people in with their Northlight account, then starts
|
|
|
11
11
|
|
|
12
12
|
## First: check this skill matches the SDK
|
|
13
13
|
|
|
14
|
-
This skill is for SDK version `0.3.
|
|
14
|
+
This skill is for SDK version `0.3.484`. 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. That command needs no account and no crtr. A project that has no SDK yet starts with `npx @north-light/sdk@latest init <dir>`.
|
|
15
15
|
|
|
16
16
|
## Where things run
|
|
17
17
|
|
package/dist/testing/cloud.js
CHANGED
|
@@ -245,6 +245,7 @@ export class FakeCloud {
|
|
|
245
245
|
const dependency = {
|
|
246
246
|
state: setupState, ...(options.message === undefined ? {} : { message: options.message }),
|
|
247
247
|
next: options.next ?? `${cloud.issuer}/connect/setup/${provider}?client_id=${cloud.clientId}`,
|
|
248
|
+
...(options.step === undefined ? {} : { step: options.step }),
|
|
248
249
|
};
|
|
249
250
|
state.dependencies = { ...state.dependencies, [provider]: dependency };
|
|
250
251
|
state.wakeHolds();
|
package/dist/testing/users.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ export interface FakeUser {
|
|
|
110
110
|
setup(provider: string, state: SetupState, options?: {
|
|
111
111
|
message?: string;
|
|
112
112
|
next?: string;
|
|
113
|
+
step?: string;
|
|
113
114
|
}): void;
|
|
114
115
|
/** A grant sync with unchanged content: nothing changes, no held read wakes. */
|
|
115
116
|
sync(): void;
|
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.484";
|
|
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.484';
|
|
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.484",
|
|
4
|
+
"crouterContract": "1.10",
|
|
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,8 +44,8 @@
|
|
|
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.
|
|
47
|
+
"@north-light/api": "0.3.484",
|
|
48
|
+
"@north-light/identity": "0.3.484",
|
|
49
49
|
"jose": "^6.2.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|