@north-light/sdk 0.3.853 → 0.3.855
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 +2 -2
- package/dist/resources/questions.d.ts +38 -3
- package/dist/resources/questions.js +20 -3
- package/dist/resources/reviews.d.ts +14 -2
- package/dist/resources/reviews.js +11 -2
- package/dist/skill/northlight/SKILL.md +2 -2
- package/dist/testing/cloud.d.ts +1 -1
- package/dist/testing/cloud.js +20 -2
- package/dist/testing/run.d.ts +5 -1
- package/dist/testing/run.js +16 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ export type { Charges, ChargeListParams } from './resources/charges.js';
|
|
|
18
18
|
export type { Environments } from './resources/environments.js';
|
|
19
19
|
export type { SpendLimits } from './resources/spend-limits.js';
|
|
20
20
|
export type { MemoryDocument, MemoryGetParams, MemoryListItem, MemoryListPage, MemoryListParams } from './resources/memory.js';
|
|
21
|
-
export type { Question, QuestionAnswered, QuestionCanceled, QuestionFields, QuestionKind, QuestionResponses, QuestionSlot, QuestionStatus } from './resources/questions.js';
|
|
22
|
-
export type { ReviewListQuery } from './resources/reviews.js';
|
|
21
|
+
export type { Question, QuestionAnswered, QuestionCanceled, QuestionFields, QuestionHistory, QuestionHistoryItem, QuestionKind, QuestionResponses, QuestionSettledBy, QuestionSlot, QuestionStatus } from './resources/questions.js';
|
|
22
|
+
export type { ReviewListQuery, SubmitReviewRequest } from './resources/reviews.js';
|
|
23
23
|
export type { ProviderToolEntry } from './resources/providers.js';
|
|
24
24
|
export { OAuth2Client, ConnectedCrouter, MemoryConnectionStore, profileFromClaims } from './oauth/index.js';
|
|
25
25
|
export { authorizationRefusalOf, refusalOf } from './oauth/index.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { DiscussDTO, PostDiscussMessageDTO } from '@north-light/api';
|
|
1
2
|
import type { RequestOptions } from '../types.js';
|
|
2
|
-
import type
|
|
3
|
+
import { type Request } from './request.js';
|
|
3
4
|
/** One input or display element of a question. `id` is absent on a slot that takes no response. */
|
|
4
5
|
export interface QuestionSlot {
|
|
5
6
|
id?: string;
|
|
@@ -43,6 +44,29 @@ export interface QuestionAnswered {
|
|
|
43
44
|
status: 'answered';
|
|
44
45
|
answer: QuestionResponses;
|
|
45
46
|
}
|
|
47
|
+
/** Who settled a question: the person, the asking agent withdrawing it, or a companion acting on the person's word. */
|
|
48
|
+
export type QuestionSettledBy = 'person' | 'asker' | 'companion';
|
|
49
|
+
/** One settled question or notice in `questions.history`. */
|
|
50
|
+
export interface QuestionHistoryItem {
|
|
51
|
+
question_id: string;
|
|
52
|
+
run_id: string;
|
|
53
|
+
title: string;
|
|
54
|
+
kind: QuestionKind;
|
|
55
|
+
/** ISO time it was settled. */
|
|
56
|
+
settled_at: string;
|
|
57
|
+
state: 'answered' | 'canceled';
|
|
58
|
+
settled_by: QuestionSettledBy;
|
|
59
|
+
/** Labels of the options chosen, when answered. */
|
|
60
|
+
selected_labels?: string[];
|
|
61
|
+
/** The written answer, when answered in writing. */
|
|
62
|
+
written_answer?: string;
|
|
63
|
+
/** The reason given, when canceled with one. */
|
|
64
|
+
cancel_reason?: string;
|
|
65
|
+
}
|
|
66
|
+
/** `questions.history`'s result, newest settlement first. */
|
|
67
|
+
export interface QuestionHistory {
|
|
68
|
+
questions: QuestionHistoryItem[];
|
|
69
|
+
}
|
|
46
70
|
/** Questions from agents in runs (app listener only). */
|
|
47
71
|
export declare class Questions {
|
|
48
72
|
private readonly request;
|
|
@@ -54,7 +78,18 @@ export declare class Questions {
|
|
|
54
78
|
* canceled — including the loser of a race — is 409 `run_settled` with `details.state` and `details.result`. */
|
|
55
79
|
answer(questionId: string, responses: QuestionResponses, options?: RequestOptions): Promise<QuestionAnswered>;
|
|
56
80
|
/** Cancel an open question of the caller's own run (or the caller's own runless provider approval): the person
|
|
57
|
-
* dismissed it, and the asking agent is told so. A question already answered or canceled is 409 `run_settled`
|
|
81
|
+
* dismissed it, and the asking agent is told so. With `reason` the cancellation carries it to the asking agent as the person's words instead. A question already answered or canceled is 409 `run_settled`
|
|
58
82
|
* with `details.state` and `details.result`; another app's run is `other_app_run`. A notice is canceled the same way. */
|
|
59
|
-
cancel(questionId: string, options?: RequestOptions
|
|
83
|
+
cancel(questionId: string, { reason, ...options }?: RequestOptions & {
|
|
84
|
+
reason?: string;
|
|
85
|
+
}): Promise<QuestionCanceled>;
|
|
86
|
+
/** The caller's run-bound questions and notices settled at or after `settled_since` (an ISO timestamp), newest first,
|
|
87
|
+
* including ones settled while the app was not looking. */
|
|
88
|
+
history(query: {
|
|
89
|
+
settled_since: string;
|
|
90
|
+
}, options?: RequestOptions): Promise<QuestionHistory>;
|
|
91
|
+
/** The person's Discuss conversation about an open question with a copy of the asking agent, from its first message on. Empty before one is posted. The ticket id is the question id. */
|
|
92
|
+
discuss(questionId: string, options?: RequestOptions): Promise<DiscussDTO>;
|
|
93
|
+
/** Post a Discuss message. The first one forks the asking agent at that moment. The message never reaches the question's result. */
|
|
94
|
+
postDiscuss(questionId: string, text: string, options?: RequestOptions): Promise<PostDiscussMessageDTO>;
|
|
60
95
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { pathSegment } from './identifiers.js';
|
|
2
|
+
import { withQuery } from './request.js';
|
|
2
3
|
/** Questions from agents in runs (app listener only). */
|
|
3
4
|
export class Questions {
|
|
4
5
|
request;
|
|
@@ -16,11 +17,27 @@ export class Questions {
|
|
|
16
17
|
return this.request('POST', `${questionPath(questionId)}/answer`, { responses }, { ...options, maxRetries: 0 });
|
|
17
18
|
}
|
|
18
19
|
/** Cancel an open question of the caller's own run (or the caller's own runless provider approval): the person
|
|
19
|
-
* dismissed it, and the asking agent is told so. A question already answered or canceled is 409 `run_settled`
|
|
20
|
+
* dismissed it, and the asking agent is told so. With `reason` the cancellation carries it to the asking agent as the person's words instead. A question already answered or canceled is 409 `run_settled`
|
|
20
21
|
* with `details.state` and `details.result`; another app's run is `other_app_run`. A notice is canceled the same way. */
|
|
21
|
-
cancel(questionId, options = {}) {
|
|
22
|
-
return this.request('POST', `${questionPath(questionId)}/cancel`, undefined, { ...options, maxRetries: 0 });
|
|
22
|
+
cancel(questionId, { reason, ...options } = {}) {
|
|
23
|
+
return this.request('POST', `${questionPath(questionId)}/cancel`, reason === undefined ? undefined : { reason }, { ...options, maxRetries: 0 });
|
|
23
24
|
}
|
|
25
|
+
/** The caller's run-bound questions and notices settled at or after `settled_since` (an ISO timestamp), newest first,
|
|
26
|
+
* including ones settled while the app was not looking. */
|
|
27
|
+
history(query, options) {
|
|
28
|
+
return this.request('GET', withQuery('/v1/questions', query), undefined, options);
|
|
29
|
+
}
|
|
30
|
+
/** The person's Discuss conversation about an open question with a copy of the asking agent, from its first message on. Empty before one is posted. The ticket id is the question id. */
|
|
31
|
+
discuss(questionId, options) {
|
|
32
|
+
return this.request('GET', discussPath(questionId), undefined, options);
|
|
33
|
+
}
|
|
34
|
+
/** Post a Discuss message. The first one forks the asking agent at that moment. The message never reaches the question's result. */
|
|
35
|
+
postDiscuss(questionId, text, options = {}) {
|
|
36
|
+
return this.request('POST', discussPath(questionId), { text }, { ...options, maxRetries: 0 });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function discussPath(id) {
|
|
40
|
+
return `/v1/human/inbox/tickets/${encodeURIComponent(pathSegment(id, 'question id'))}/discuss`;
|
|
24
41
|
}
|
|
25
42
|
function questionPath(id) {
|
|
26
43
|
return `/v1/questions/${encodeURIComponent(pathSegment(id, 'question id'))}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReviewCancelResultDTO, ReviewDTO, ReviewDocumentBaseDTO, ReviewListDTO, ReviewStateDTO, ReviewSubmitResultDTO } from '@north-light/api';
|
|
1
|
+
import type { DiscussDTO, PostDiscussMessageDTO, ReviewCancelResultDTO, ReviewDTO, ReviewDocumentBaseDTO, ReviewListDTO, ReviewStateDTO, ReviewSubmitResultDTO } from '@north-light/api';
|
|
2
2
|
import type { RequestOptions } from '../types.js';
|
|
3
3
|
import { type Request } from './request.js';
|
|
4
4
|
export type { ReviewCancelResultDTO, ReviewDTO, ReviewDocumentBaseDTO, ReviewListDTO, ReviewStateDTO, ReviewSubmitResultDTO };
|
|
@@ -9,6 +9,13 @@ export interface ReviewListQuery {
|
|
|
9
9
|
origin_node_id?: string;
|
|
10
10
|
file?: string;
|
|
11
11
|
}
|
|
12
|
+
/** Body of `reviews.submit`. */
|
|
13
|
+
export interface SubmitReviewRequest {
|
|
14
|
+
/** A note with the approval, at most 8,000 characters; the asking agent receives it. */
|
|
15
|
+
note?: string;
|
|
16
|
+
/** SHA-256 hex of the document text the person approved. A different current text refuses with 409 `document_changed` and leaves the review open. */
|
|
17
|
+
seen_sha256?: string;
|
|
18
|
+
}
|
|
12
19
|
/** Reviews of documents that agents in the caller's runs asked the person to review (app listener only).
|
|
13
20
|
* A review whose run the caller may not read is `not_found`; one of another app's run is `other_app_run` when acting. */
|
|
14
21
|
export declare class Reviews {
|
|
@@ -18,8 +25,13 @@ export declare class Reviews {
|
|
|
18
25
|
get(reviewId: string, options?: RequestOptions): Promise<ReviewDTO>;
|
|
19
26
|
/** The text the review's comments are anchored to. */
|
|
20
27
|
document(reviewId: string, options?: RequestOptions): Promise<ReviewDocumentBaseDTO>;
|
|
21
|
-
|
|
28
|
+
/** Approve. `note` goes to the asking agent with the approval; `seen_sha256` refuses with 409 `document_changed` when the text differs. */
|
|
29
|
+
submit(reviewId: string, { note, seen_sha256, ...options }?: RequestOptions & SubmitReviewRequest): Promise<ReviewSubmitResultDTO>;
|
|
22
30
|
cancel(reviewId: string, body?: {
|
|
23
31
|
reason?: string;
|
|
24
32
|
}, options?: RequestOptions): Promise<ReviewCancelResultDTO>;
|
|
33
|
+
/** The Discuss conversation with the review's companion, from its boundary marker on. */
|
|
34
|
+
discuss(reviewId: string, options?: RequestOptions): Promise<DiscussDTO>;
|
|
35
|
+
/** Post a Discuss message to the review's companion. It is not a review comment. */
|
|
36
|
+
postDiscuss(reviewId: string, text: string, options?: RequestOptions): Promise<PostDiscussMessageDTO>;
|
|
25
37
|
}
|
|
@@ -17,12 +17,21 @@ export class Reviews {
|
|
|
17
17
|
document(reviewId, options) {
|
|
18
18
|
return this.request('GET', `${reviewPath(reviewId)}/document`, undefined, options);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/** Approve. `note` goes to the asking agent with the approval; `seen_sha256` refuses with 409 `document_changed` when the text differs. */
|
|
21
|
+
submit(reviewId, { note, seen_sha256, ...options } = {}) {
|
|
22
|
+
return this.request('POST', `${reviewPath(reviewId)}/submit`, { ...(note === undefined ? {} : { note }), ...(seen_sha256 === undefined ? {} : { seen_sha256 }) }, { ...options, maxRetries: 0 });
|
|
22
23
|
}
|
|
23
24
|
cancel(reviewId, body = {}, options = {}) {
|
|
24
25
|
return this.request('POST', `${reviewPath(reviewId)}/cancel`, body, { ...options, maxRetries: 0 });
|
|
25
26
|
}
|
|
27
|
+
/** The Discuss conversation with the review's companion, from its boundary marker on. */
|
|
28
|
+
discuss(reviewId, options) {
|
|
29
|
+
return this.request('GET', `${reviewPath(reviewId)}/discuss`, undefined, options);
|
|
30
|
+
}
|
|
31
|
+
/** Post a Discuss message to the review's companion. It is not a review comment. */
|
|
32
|
+
postDiscuss(reviewId, text, options = {}) {
|
|
33
|
+
return this.request('POST', `${reviewPath(reviewId)}/discuss`, { text }, { ...options, maxRetries: 0 });
|
|
34
|
+
}
|
|
26
35
|
}
|
|
27
36
|
function reviewPath(id) {
|
|
28
37
|
return `/v1/human/reviews/${encodeURIComponent(pathSegment(id, 'review id'))}`;
|
|
@@ -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.855"
|
|
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.855`. 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/testing/cloud.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { type SpaceOp } from './space.js';
|
|
|
7
7
|
import { type FakeRefusalCode, type FakeScope, type FakeUser, type Responder } from './users.js';
|
|
8
8
|
import { type FakeError } from './wire.js';
|
|
9
9
|
/** A runtime operation, named as the daemon's `OPERATIONS` table names it. */
|
|
10
|
-
export type FakeOp = 'grant.get' | 'run.start' | 'run.list' | 'run.get' | 'run.message' | 'run.events' | 'run.interrupt' | 'run.cancel' | 'run.delete' | 'run.rename' | 'question.get' | 'question.answer' | 'question.cancel' | 'review.list' | 'review.get' | 'review.submit' | 'review.cancel' | 'trace.get' | 'memory.list' | 'memory.get' | 'provider.tools' | 'provider.call' | 'provider.machine' | 'profile.list' | 'exec' | SpaceOp;
|
|
10
|
+
export type FakeOp = 'grant.get' | 'run.start' | 'run.list' | 'run.get' | 'run.message' | 'run.events' | 'run.interrupt' | 'run.cancel' | 'run.delete' | 'run.rename' | 'question.get' | 'question.answer' | 'question.cancel' | 'question.history' | 'review.list' | 'review.get' | 'review.submit' | 'review.cancel' | 'discuss.ticket.get' | 'discuss.ticket.post' | 'discuss.review.get' | 'discuss.review.post' | 'trace.get' | 'memory.list' | 'memory.get' | 'provider.tools' | 'provider.call' | 'provider.machine' | 'profile.list' | 'exec' | SpaceOp;
|
|
11
11
|
/** A directory operation. */
|
|
12
12
|
export type FakeDirectoryOp = 'directory.discovery' | 'directory.token' | 'directory.jwks';
|
|
13
13
|
/** What `intercept` / `failNext` / `gate` match: a runtime operation, `'*'` (every runtime operation), or a directory operation. */
|
package/dist/testing/cloud.js
CHANGED
|
@@ -27,6 +27,7 @@ const ROUTES = [
|
|
|
27
27
|
['POST', /^\/v1\/runs\/([^/]+)\/cancel$/, 'run.cancel'],
|
|
28
28
|
['POST', /^\/v1\/runs\/([^/]+)\/rename$/, 'run.rename'],
|
|
29
29
|
['GET', /^\/v1\/runs\/([^/]+)\/trace$/, 'trace.get'],
|
|
30
|
+
['GET', /^\/v1\/questions$/, 'question.history'],
|
|
30
31
|
['GET', /^\/v1\/questions\/([^/]+)$/, 'question.get'],
|
|
31
32
|
['POST', /^\/v1\/questions\/([^/]+)\/answer$/, 'question.answer'],
|
|
32
33
|
['POST', /^\/v1\/questions\/([^/]+)\/cancel$/, 'question.cancel'],
|
|
@@ -34,6 +35,10 @@ const ROUTES = [
|
|
|
34
35
|
['GET', /^\/v1\/human\/reviews\/([^/]+)$/, 'review.get'],
|
|
35
36
|
['POST', /^\/v1\/human\/reviews\/([^/]+)\/submit$/, 'review.submit'],
|
|
36
37
|
['POST', /^\/v1\/human\/reviews\/([^/]+)\/cancel$/, 'review.cancel'],
|
|
38
|
+
['GET', /^\/v1\/human\/inbox\/tickets\/([^/]+)\/discuss$/, 'discuss.ticket.get'],
|
|
39
|
+
['POST', /^\/v1\/human\/inbox\/tickets\/([^/]+)\/discuss$/, 'discuss.ticket.post'],
|
|
40
|
+
['GET', /^\/v1\/human\/reviews\/([^/]+)\/discuss$/, 'discuss.review.get'],
|
|
41
|
+
['POST', /^\/v1\/human\/reviews\/([^/]+)\/discuss$/, 'discuss.review.post'],
|
|
37
42
|
['GET', /^\/v1\/memory$/, 'memory.list'],
|
|
38
43
|
['GET', /^\/v1\/memory\/document$/, 'memory.get'],
|
|
39
44
|
['GET', /^\/v1\/providers\/tools$/, 'provider.tools'],
|
|
@@ -812,9 +817,18 @@ export class FakeCloud {
|
|
|
812
817
|
const current = run.questionObject(question);
|
|
813
818
|
if (current['status'] !== 'open')
|
|
814
819
|
throw refuse(409, 'run_settled', `question ${question} is already ${String(current['status'])}`, { details: { state: current['status'] } });
|
|
815
|
-
|
|
820
|
+
const reason = body !== null && typeof body === 'object' ? body['reason'] : undefined;
|
|
821
|
+
run.cancelQuestion(question, typeof reason === 'string' ? reason : undefined);
|
|
816
822
|
return { status: 200, body: run.questionObject(question) };
|
|
817
823
|
}
|
|
824
|
+
case 'question.history': {
|
|
825
|
+
const since = Date.parse(query.get('settled_since') ?? '');
|
|
826
|
+
if (Number.isNaN(since))
|
|
827
|
+
throw invalid('settled_since must be an ISO timestamp', 'settled_since');
|
|
828
|
+
const questions = user.runs.filter((run) => !run.deleted).flatMap((run) => run.questionHistory(since))
|
|
829
|
+
.sort((a, b) => String(b['settled_at']).localeCompare(String(a['settled_at'])));
|
|
830
|
+
return { status: 200, body: { questions } };
|
|
831
|
+
}
|
|
818
832
|
case 'memory.list': return { status: 200, body: this.memoryList(user, query) };
|
|
819
833
|
case 'memory.get': {
|
|
820
834
|
this.memoryStore(query);
|
|
@@ -836,7 +850,11 @@ export class FakeCloud {
|
|
|
836
850
|
case 'review.list': return { status: 200, body: { reviews: [] } };
|
|
837
851
|
case 'review.get':
|
|
838
852
|
case 'review.submit':
|
|
839
|
-
case 'review.cancel':
|
|
853
|
+
case 'review.cancel':
|
|
854
|
+
case 'discuss.review.get':
|
|
855
|
+
case 'discuss.review.post': throw refuse(404, 'not_found', 'review not found');
|
|
856
|
+
case 'discuss.ticket.get':
|
|
857
|
+
case 'discuss.ticket.post': throw refuse(404, 'not_found', 'question not found');
|
|
840
858
|
case 'provider.tools': return this.providerTools(user, id);
|
|
841
859
|
case 'provider.call': return this.providerCall(user, body, signal);
|
|
842
860
|
case 'provider.machine': return this.providerMachine(user, body);
|
package/dist/testing/run.d.ts
CHANGED
|
@@ -67,6 +67,8 @@ interface OpenQuestion {
|
|
|
67
67
|
slots: RunQuestionSlotDTO[];
|
|
68
68
|
status: 'open' | 'answered' | 'canceled';
|
|
69
69
|
answer?: Record<string, unknown>;
|
|
70
|
+
settledAt?: string;
|
|
71
|
+
cancelReason?: string;
|
|
70
72
|
}
|
|
71
73
|
/** `activity.tool.summary` as the daemon writes it: a command's first line, else a path; null otherwise. */
|
|
72
74
|
export declare function toolCallSummary(args: unknown): string | null;
|
|
@@ -166,7 +168,9 @@ export declare class FakeRun {
|
|
|
166
168
|
/** The app answered a question. */
|
|
167
169
|
answer(questionId: string, responses: Record<string, unknown>): void;
|
|
168
170
|
/** The app canceled a question: the person dismissed it. */
|
|
169
|
-
cancelQuestion(questionId: string): void;
|
|
171
|
+
cancelQuestion(questionId: string, reason?: string): void;
|
|
172
|
+
/** The settled questions of this run as `questions.history` lists them. */
|
|
173
|
+
questionHistory(since: number): Array<Record<string, unknown>>;
|
|
170
174
|
questionObject(questionId: string): Record<string, unknown> | undefined;
|
|
171
175
|
/** Resolves when the run rests (`idle`, `waiting_on_user`, `settled`), is deleted, `seconds` pass, or `signal` aborts. */
|
|
172
176
|
waitResting(seconds: number, signal?: AbortSignal | null): Promise<void>;
|
package/dist/testing/run.js
CHANGED
|
@@ -278,12 +278,26 @@ export class FakeRun {
|
|
|
278
278
|
const question = this.questions.get(questionId);
|
|
279
279
|
question.status = 'answered';
|
|
280
280
|
question.answer = responses;
|
|
281
|
+
question.settledAt = nowIso(this.host.now());
|
|
281
282
|
this.answered = true;
|
|
282
283
|
this.append('question.answered', { question_id: questionId, answer: responses });
|
|
283
284
|
}
|
|
284
285
|
/** The app canceled a question: the person dismissed it. */
|
|
285
|
-
cancelQuestion(questionId) {
|
|
286
|
-
this.questions.get(questionId)
|
|
286
|
+
cancelQuestion(questionId, reason) {
|
|
287
|
+
const question = this.questions.get(questionId);
|
|
288
|
+
question.status = 'canceled';
|
|
289
|
+
question.settledAt = nowIso(this.host.now());
|
|
290
|
+
if (reason !== undefined)
|
|
291
|
+
question.cancelReason = reason;
|
|
292
|
+
}
|
|
293
|
+
/** The settled questions of this run as `questions.history` lists them. */
|
|
294
|
+
questionHistory(since) {
|
|
295
|
+
return [...this.questions.values()]
|
|
296
|
+
.filter((q) => q.settledAt !== undefined && Date.parse(q.settledAt) >= since)
|
|
297
|
+
.map((q) => ({
|
|
298
|
+
question_id: q.question_id, run_id: this.id, title: q.title, kind: q.kind, settled_at: q.settledAt, state: q.status, settled_by: 'person',
|
|
299
|
+
...(q.cancelReason === undefined ? {} : { cancel_reason: q.cancelReason }),
|
|
300
|
+
}));
|
|
287
301
|
}
|
|
288
302
|
questionObject(questionId) {
|
|
289
303
|
const q = this.questions.get(questionId);
|
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.855";
|
|
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.855';
|
|
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.855",
|
|
4
|
+
"crouterContract": "1.102",
|
|
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.855",
|
|
48
|
+
"@north-light/identity": "0.3.855",
|
|
49
|
+
"@north-light/plugin": "0.3.855",
|
|
50
50
|
"jose": "^6.2.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|