exponential-sdk 1.22.0 → 1.25.0
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 +342 -6
- package/dist/index.js +86 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -284,6 +284,14 @@ interface TrpcClient {
|
|
|
284
284
|
limit?: number;
|
|
285
285
|
}) => Promise<unknown>;
|
|
286
286
|
};
|
|
287
|
+
knowledge: {
|
|
288
|
+
query: (input: {
|
|
289
|
+
query: string;
|
|
290
|
+
workspaceId: string;
|
|
291
|
+
limit?: number;
|
|
292
|
+
sourceTypes?: ('transcription' | 'resource' | 'document' | 'page')[];
|
|
293
|
+
}) => Promise<unknown>;
|
|
294
|
+
};
|
|
287
295
|
};
|
|
288
296
|
action: {
|
|
289
297
|
getAll: {
|
|
@@ -905,6 +913,16 @@ interface TrpcClient {
|
|
|
905
913
|
get: {
|
|
906
914
|
query: (input: {
|
|
907
915
|
id: string;
|
|
916
|
+
format?: 'full' | 'markdown' | 'outline';
|
|
917
|
+
section?: string;
|
|
918
|
+
}) => Promise<unknown>;
|
|
919
|
+
};
|
|
920
|
+
search: {
|
|
921
|
+
query: (input: {
|
|
922
|
+
workspaceId: string;
|
|
923
|
+
query: string;
|
|
924
|
+
projectId?: string;
|
|
925
|
+
limit?: number;
|
|
908
926
|
}) => Promise<unknown>;
|
|
909
927
|
};
|
|
910
928
|
create: {
|
|
@@ -914,6 +932,9 @@ interface TrpcClient {
|
|
|
914
932
|
title?: string;
|
|
915
933
|
body?: string;
|
|
916
934
|
includeInSearch?: boolean;
|
|
935
|
+
note?: string;
|
|
936
|
+
source?: string | null;
|
|
937
|
+
asOf?: Date | null;
|
|
917
938
|
}) => Promise<unknown>;
|
|
918
939
|
};
|
|
919
940
|
update: {
|
|
@@ -923,6 +944,38 @@ interface TrpcClient {
|
|
|
923
944
|
projectId?: string | null;
|
|
924
945
|
includeInSearch?: boolean;
|
|
925
946
|
body?: string;
|
|
947
|
+
baseVersion?: number;
|
|
948
|
+
note?: string;
|
|
949
|
+
source?: string | null;
|
|
950
|
+
asOf?: Date | null;
|
|
951
|
+
}) => Promise<unknown>;
|
|
952
|
+
};
|
|
953
|
+
history: {
|
|
954
|
+
query: (input: {
|
|
955
|
+
id: string;
|
|
956
|
+
limit?: number;
|
|
957
|
+
cursor?: string;
|
|
958
|
+
}) => Promise<unknown>;
|
|
959
|
+
};
|
|
960
|
+
revision: {
|
|
961
|
+
query: (input: {
|
|
962
|
+
id: string;
|
|
963
|
+
revisionId: string;
|
|
964
|
+
}) => Promise<unknown>;
|
|
965
|
+
};
|
|
966
|
+
diff: {
|
|
967
|
+
query: (input: {
|
|
968
|
+
id: string;
|
|
969
|
+
revisionId: string;
|
|
970
|
+
against?: string;
|
|
971
|
+
}) => Promise<unknown>;
|
|
972
|
+
};
|
|
973
|
+
restore: {
|
|
974
|
+
mutate: (input: {
|
|
975
|
+
id: string;
|
|
976
|
+
revisionId: string;
|
|
977
|
+
note?: string;
|
|
978
|
+
baseVersion?: number;
|
|
926
979
|
}) => Promise<unknown>;
|
|
927
980
|
};
|
|
928
981
|
};
|
|
@@ -954,6 +1007,20 @@ interface TrpcClient {
|
|
|
954
1007
|
generateEmbeddings?: boolean;
|
|
955
1008
|
}) => Promise<unknown>;
|
|
956
1009
|
};
|
|
1010
|
+
get: {
|
|
1011
|
+
query: (input: {
|
|
1012
|
+
id: string;
|
|
1013
|
+
}) => Promise<unknown>;
|
|
1014
|
+
};
|
|
1015
|
+
update: {
|
|
1016
|
+
mutate: (input: {
|
|
1017
|
+
id: string;
|
|
1018
|
+
title?: string;
|
|
1019
|
+
description?: string;
|
|
1020
|
+
tags?: string[];
|
|
1021
|
+
readStatus?: string;
|
|
1022
|
+
}) => Promise<unknown>;
|
|
1023
|
+
};
|
|
957
1024
|
setReadStatus: {
|
|
958
1025
|
mutate: (input: {
|
|
959
1026
|
id: string;
|
|
@@ -3090,8 +3157,19 @@ declare class DecisionsApi {
|
|
|
3090
3157
|
unlink(workspaceId: string, linkId: string): Promise<{
|
|
3091
3158
|
deleted: boolean;
|
|
3092
3159
|
}>;
|
|
3093
|
-
/**
|
|
3094
|
-
|
|
3160
|
+
/**
|
|
3161
|
+
* Publish a draft into the log. Needs a person's login: agent keys are
|
|
3162
|
+
* refused. Idempotent on a decision that is already confirmed.
|
|
3163
|
+
*
|
|
3164
|
+
* `status` moves it in the same write — `{ status: 'ACCEPTED' }` is
|
|
3165
|
+
* "confirm as accepted", and works on an already-confirmed decision too.
|
|
3166
|
+
* `SUPERSEDED` is refused (it needs a successor; use {@link setStatus}).
|
|
3167
|
+
* A person confirming or accepting a decision that no person stands behind
|
|
3168
|
+
* becomes its decider. `decisionId` may also be a `D-0006` label.
|
|
3169
|
+
*/
|
|
3170
|
+
confirmDraft(workspaceId: string, decisionId: string, options?: {
|
|
3171
|
+
status?: DecisionStatus;
|
|
3172
|
+
}): Promise<Decision>;
|
|
3095
3173
|
/**
|
|
3096
3174
|
* Reject a draft. Confirmed decisions are never rejected — deprecate or
|
|
3097
3175
|
* supersede them through {@link setStatus}.
|
|
@@ -4038,9 +4116,19 @@ interface KnowledgePage {
|
|
|
4038
4116
|
workspaceId: string;
|
|
4039
4117
|
projectId: string | null;
|
|
4040
4118
|
title: string;
|
|
4119
|
+
/**
|
|
4120
|
+
* Markdown body. With `format: "outline"` this is null; with `section` it is
|
|
4121
|
+
* that section only (see `section`).
|
|
4122
|
+
*/
|
|
4041
4123
|
body: string | null;
|
|
4124
|
+
/** UTF-8 size of the whole Markdown body, whatever `format`/`section` returned. */
|
|
4125
|
+
bodyBytes?: number;
|
|
4042
4126
|
includeInSearch: boolean;
|
|
4043
4127
|
docVersion: number;
|
|
4128
|
+
/** Provenance (ADR-0074): where the page's facts come from — a URL, a document, a person. */
|
|
4129
|
+
source?: string | null;
|
|
4130
|
+
/** Provenance (ADR-0074): the date the page's facts were true. */
|
|
4131
|
+
asOf?: Date | null;
|
|
4044
4132
|
createdById: string;
|
|
4045
4133
|
createdAt: Date;
|
|
4046
4134
|
updatedAt: Date;
|
|
@@ -4056,13 +4144,148 @@ interface KnowledgePage {
|
|
|
4056
4144
|
};
|
|
4057
4145
|
/** Present on `get` responses: whether the caller may edit the page. */
|
|
4058
4146
|
canEdit?: boolean;
|
|
4147
|
+
/** Present on `get` responses: which `format` produced this payload. */
|
|
4148
|
+
format?: PageGetFormat;
|
|
4149
|
+
/** Present on `get` with `format: "outline"`: the page's headings. */
|
|
4150
|
+
outline?: PageOutlineEntry[] | null;
|
|
4151
|
+
/** Present on `get` with `section`: the heading the body was narrowed to. */
|
|
4152
|
+
section?: PageOutlineEntry | null;
|
|
4153
|
+
}
|
|
4154
|
+
type PageGetFormat = 'full' | 'markdown' | 'outline';
|
|
4155
|
+
interface PageOutlineEntry {
|
|
4156
|
+
/** Heading depth, 1–6. */
|
|
4157
|
+
level: number;
|
|
4158
|
+
text: string;
|
|
4159
|
+
/** 0-based line in the Markdown body. */
|
|
4160
|
+
line: number;
|
|
4161
|
+
}
|
|
4162
|
+
/** `baseline` is the unattributed starting row seeded for pages that predate history. */
|
|
4163
|
+
type PageRevisionKind = 'baseline' | 'create' | 'editor' | 'markdown' | 'restore';
|
|
4164
|
+
interface PageRevisionAuthor {
|
|
4165
|
+
id: string;
|
|
4166
|
+
name: string | null;
|
|
4167
|
+
image: string | null;
|
|
4168
|
+
}
|
|
4169
|
+
/** One row of a page's history (ADR-0074): a snapshot after a write, without its body. */
|
|
4170
|
+
interface PageRevision {
|
|
4171
|
+
id: string;
|
|
4172
|
+
/** The page's `docVersion` after this write. */
|
|
4173
|
+
docVersion: number;
|
|
4174
|
+
title: string;
|
|
4175
|
+
kind: PageRevisionKind;
|
|
4176
|
+
/** Why the change was made, when the writer said. */
|
|
4177
|
+
note: string | null;
|
|
4178
|
+
/** UTF-8 size of the Markdown body at this revision. */
|
|
4179
|
+
bodyBytes: number;
|
|
4180
|
+
/** Provenance as it stood at this revision. */
|
|
4181
|
+
source: string | null;
|
|
4182
|
+
asOf: Date | null;
|
|
4183
|
+
/**
|
|
4184
|
+
* The author, or null. Null with `authorHidden: true` means names are
|
|
4185
|
+
* withheld from you (you can view the page but are not a workspace member).
|
|
4186
|
+
* Null with `authorHidden: false` means no person wrote it: a `baseline`
|
|
4187
|
+
* row, or an automated write (an agenda seed, a generated Workspace update)
|
|
4188
|
+
* whose `note` says what did.
|
|
4189
|
+
*/
|
|
4190
|
+
author: PageRevisionAuthor | null;
|
|
4191
|
+
authorHidden: boolean;
|
|
4192
|
+
/** When the revision was first recorded. */
|
|
4193
|
+
createdAt: Date;
|
|
4194
|
+
/** When it last moved forward (editor saves fold into an open revision). */
|
|
4195
|
+
updatedAt: Date;
|
|
4196
|
+
}
|
|
4197
|
+
interface PageHistory {
|
|
4198
|
+
revisions: PageRevision[];
|
|
4199
|
+
/** Pass back as `cursor` to fetch older revisions; null when there are none. */
|
|
4200
|
+
nextCursor: string | null;
|
|
4201
|
+
}
|
|
4202
|
+
/** A revision with its Markdown body. */
|
|
4203
|
+
interface PageRevisionDetail extends PageRevision {
|
|
4204
|
+
pageId: string;
|
|
4205
|
+
body: string | null;
|
|
4206
|
+
}
|
|
4207
|
+
interface PageDiffSide {
|
|
4208
|
+
/** Null for the empty state before the first revision, or for the live page. */
|
|
4209
|
+
revisionId: string | null;
|
|
4210
|
+
docVersion: number;
|
|
4211
|
+
title: string;
|
|
4212
|
+
source: string | null;
|
|
4213
|
+
asOf: Date | null;
|
|
4214
|
+
createdAt: Date | null;
|
|
4215
|
+
}
|
|
4216
|
+
interface PageDiff {
|
|
4217
|
+
from: PageDiffSide;
|
|
4218
|
+
to: PageDiffSide;
|
|
4219
|
+
/** Unified diff of the Markdown bodies; empty when identical. */
|
|
4220
|
+
unified: string;
|
|
4221
|
+
stats: {
|
|
4222
|
+
added: number;
|
|
4223
|
+
removed: number;
|
|
4224
|
+
};
|
|
4225
|
+
titleChanged: boolean;
|
|
4226
|
+
/** `source` or `asOf` differ between the two sides. */
|
|
4227
|
+
provenanceChanged: boolean;
|
|
4228
|
+
}
|
|
4229
|
+
interface PageSearchResult {
|
|
4230
|
+
id: string;
|
|
4231
|
+
title: string;
|
|
4232
|
+
/** The best-matching chunk (semantic) or the text around the match. */
|
|
4233
|
+
snippet: string;
|
|
4234
|
+
/** Cosine similarity for semantic hits; null for substring matches. */
|
|
4235
|
+
similarity: number | null;
|
|
4236
|
+
matchedBy: 'semantic' | 'text';
|
|
4237
|
+
/** App-relative URL. */
|
|
4238
|
+
url: string;
|
|
4239
|
+
}
|
|
4240
|
+
interface PageSearchOutput {
|
|
4241
|
+
query: string;
|
|
4242
|
+
workspaceId: string;
|
|
4243
|
+
results: PageSearchResult[];
|
|
4059
4244
|
}
|
|
4060
4245
|
|
|
4061
4246
|
interface PageListOptions {
|
|
4062
4247
|
workspaceId: string;
|
|
4063
4248
|
projectId?: string;
|
|
4249
|
+
/** Case-insensitive title match. To find pages by content or meaning use `search`. */
|
|
4064
4250
|
search?: string;
|
|
4065
4251
|
}
|
|
4252
|
+
interface PageGetOptions {
|
|
4253
|
+
/**
|
|
4254
|
+
* How much of the body to fetch. Defaults to `markdown` — the Markdown body
|
|
4255
|
+
* without the editor's ProseMirror doc, which is several times larger and
|
|
4256
|
+
* carries nothing an agent needs. `outline` returns headings only; `full`
|
|
4257
|
+
* is the editor payload.
|
|
4258
|
+
*/
|
|
4259
|
+
format?: PageGetFormat;
|
|
4260
|
+
/**
|
|
4261
|
+
* Narrow the body to one section: the heading's text (case-insensitive;
|
|
4262
|
+
* `## ` prefix tolerated) through to the next heading of the same or a
|
|
4263
|
+
* higher level. Unknown headings fail with the list of headings that exist.
|
|
4264
|
+
*/
|
|
4265
|
+
section?: string;
|
|
4266
|
+
}
|
|
4267
|
+
interface PageSearchOptions {
|
|
4268
|
+
workspaceId: string;
|
|
4269
|
+
/** What the page should be about (2–200 chars). */
|
|
4270
|
+
query: string;
|
|
4271
|
+
projectId?: string;
|
|
4272
|
+
/** Max pages returned (1–25, server default 10). */
|
|
4273
|
+
limit?: number;
|
|
4274
|
+
}
|
|
4275
|
+
interface PageHistoryOptions {
|
|
4276
|
+
/** Max revisions (1–200, server default 50). */
|
|
4277
|
+
limit?: number;
|
|
4278
|
+
/** `nextCursor` from a previous page of history. */
|
|
4279
|
+
cursor?: string;
|
|
4280
|
+
}
|
|
4281
|
+
interface PageDiffOptions {
|
|
4282
|
+
/**
|
|
4283
|
+
* What to compare the revision with: `previous` (default — what this
|
|
4284
|
+
* revision changed), `current` (the page as it is now), or another
|
|
4285
|
+
* revision's id.
|
|
4286
|
+
*/
|
|
4287
|
+
against?: 'previous' | 'current' | string;
|
|
4288
|
+
}
|
|
4066
4289
|
interface PageCreateInput {
|
|
4067
4290
|
workspaceId: string;
|
|
4068
4291
|
projectId?: string | null;
|
|
@@ -4070,6 +4293,12 @@ interface PageCreateInput {
|
|
|
4070
4293
|
/** Markdown body. Indexed for search when non-empty. */
|
|
4071
4294
|
body?: string;
|
|
4072
4295
|
includeInSearch?: boolean;
|
|
4296
|
+
/** Why the page was created — recorded on its first revision. */
|
|
4297
|
+
note?: string;
|
|
4298
|
+
/** Provenance: where the facts come from (URL, document, person). */
|
|
4299
|
+
source?: string | null;
|
|
4300
|
+
/** Provenance: the date the facts were true. */
|
|
4301
|
+
asOf?: Date | null;
|
|
4073
4302
|
}
|
|
4074
4303
|
interface PageUpdateInput {
|
|
4075
4304
|
id: string;
|
|
@@ -4082,18 +4311,73 @@ interface PageUpdateInput {
|
|
|
4082
4311
|
* the editor re-derives its rich document on next open.
|
|
4083
4312
|
*/
|
|
4084
4313
|
body?: string;
|
|
4314
|
+
/**
|
|
4315
|
+
* The `docVersion` you read before editing. With it, a body write is a
|
|
4316
|
+
* compare-and-set: if someone saved in between, the call fails with
|
|
4317
|
+
* CONFLICT instead of overwriting their work. Always send it when you can.
|
|
4318
|
+
*/
|
|
4319
|
+
baseVersion?: number;
|
|
4320
|
+
/**
|
|
4321
|
+
* Why this change — recorded on the revision and shown in the page's
|
|
4322
|
+
* history. Always send one from an agent: a body write without a note
|
|
4323
|
+
* reads "No reason given" to everyone who looks at the history.
|
|
4324
|
+
*/
|
|
4325
|
+
note?: string;
|
|
4326
|
+
/** Provenance: where the facts come from. Empty string / null clears it. */
|
|
4327
|
+
source?: string | null;
|
|
4328
|
+
/** Provenance: the date the facts were true. Null clears it. */
|
|
4329
|
+
asOf?: Date | null;
|
|
4330
|
+
}
|
|
4331
|
+
interface PageRestoreOptions {
|
|
4332
|
+
/** Why you are restoring; defaults to "Restored the version from <date>". */
|
|
4333
|
+
note?: string;
|
|
4334
|
+
/**
|
|
4335
|
+
* The page's `docVersion` when you decided to restore (the newest
|
|
4336
|
+
* revision's `docVersion` from `history`). With it, a page saved since then
|
|
4337
|
+
* fails with CONFLICT instead of being replaced. Always send it.
|
|
4338
|
+
*/
|
|
4339
|
+
baseVersion?: number;
|
|
4085
4340
|
}
|
|
4086
4341
|
/**
|
|
4087
4342
|
* Knowledge pages (PRDs, research, technical specs). Workspace-scoped
|
|
4088
4343
|
* documents; link one to a feature via `FeaturesApi.linkPage`.
|
|
4344
|
+
*
|
|
4345
|
+
* Reads are lean by default: `get` returns Markdown only. Use `outline` to see
|
|
4346
|
+
* a long page's shape, then `get(id, { section })` for the part you need.
|
|
4347
|
+
* Every write is recorded in the page's history (`history`, `diff`,
|
|
4348
|
+
* `restore`); pass a `note` so the record says why.
|
|
4089
4349
|
*/
|
|
4090
4350
|
declare class PagesApi {
|
|
4091
4351
|
private client;
|
|
4092
4352
|
constructor(client: TrpcClient);
|
|
4093
4353
|
list(options: PageListOptions): Promise<KnowledgePage[]>;
|
|
4094
|
-
|
|
4354
|
+
/** One page. Markdown body only unless `format` says otherwise. */
|
|
4355
|
+
get(id: string, options?: PageGetOptions): Promise<KnowledgePage>;
|
|
4356
|
+
/** The page's headings (level, text, line) and `bodyBytes`, no body. */
|
|
4357
|
+
outline(id: string): Promise<KnowledgePage>;
|
|
4358
|
+
/**
|
|
4359
|
+
* Pages about something: semantic hits from the Knowledge index first
|
|
4360
|
+
* (nearest first, with the matching passage as `snippet`), then pages whose
|
|
4361
|
+
* title or body contain the query. Only pages the caller can view.
|
|
4362
|
+
*/
|
|
4363
|
+
search(options: PageSearchOptions): Promise<PageSearchOutput>;
|
|
4095
4364
|
create(input: PageCreateInput): Promise<KnowledgePage>;
|
|
4096
4365
|
update(input: PageUpdateInput): Promise<KnowledgePage>;
|
|
4366
|
+
/** The page's revisions, newest first — who, when, why, size. Never the bodies. */
|
|
4367
|
+
history(id: string, options?: PageHistoryOptions): Promise<PageHistory>;
|
|
4368
|
+
/** One revision with its Markdown body. */
|
|
4369
|
+
revision(pageId: string, revisionId: string): Promise<PageRevisionDetail>;
|
|
4370
|
+
/** What a revision changed, as a unified diff of the Markdown. */
|
|
4371
|
+
diff(pageId: string, revisionId: string, options?: PageDiffOptions): Promise<PageDiff>;
|
|
4372
|
+
/**
|
|
4373
|
+
* Put a revision's content back as the page's current content. A forward
|
|
4374
|
+
* write: `docVersion` bumps and a "restore" revision is recorded.
|
|
4375
|
+
*/
|
|
4376
|
+
restore(pageId: string, revisionId: string, options?: PageRestoreOptions): Promise<{
|
|
4377
|
+
id: string;
|
|
4378
|
+
docVersion: number;
|
|
4379
|
+
revisionId: string;
|
|
4380
|
+
}>;
|
|
4097
4381
|
}
|
|
4098
4382
|
|
|
4099
4383
|
type ResourceContentType = 'web_page' | 'document' | 'pdf' | 'bookmark' | 'note';
|
|
@@ -4155,6 +4439,13 @@ interface ResourceCreateInput {
|
|
|
4155
4439
|
/** Defaults to true server-side; a no-op when there is no content to embed. */
|
|
4156
4440
|
generateEmbeddings?: boolean;
|
|
4157
4441
|
}
|
|
4442
|
+
/** Fields `update` may change. `tags` replaces the whole set. */
|
|
4443
|
+
interface ResourceUpdateInput {
|
|
4444
|
+
title?: string;
|
|
4445
|
+
description?: string;
|
|
4446
|
+
tags?: string[];
|
|
4447
|
+
readStatus?: ReadStatus;
|
|
4448
|
+
}
|
|
4158
4449
|
interface ResourceReadState {
|
|
4159
4450
|
id: string;
|
|
4160
4451
|
readStatus: ReadStatus | string;
|
|
@@ -4173,11 +4464,20 @@ declare class ResourcesApi {
|
|
|
4173
4464
|
constructor(client: TrpcClient);
|
|
4174
4465
|
list(options?: ResourceListOptions): Promise<ResourceListResult>;
|
|
4175
4466
|
create(input: ResourceCreateInput): Promise<Resource>;
|
|
4176
|
-
|
|
4467
|
+
get(id: string): Promise<Resource>;
|
|
4468
|
+
update(id: string, input: ResourceUpdateInput): Promise<Resource>;
|
|
4469
|
+
/**
|
|
4470
|
+
* Save a link to the Reading list: a `bookmark` in `to_read`, not embedded.
|
|
4471
|
+
*
|
|
4472
|
+
* `tags` are added to the ones the link already has. The server dedupes by
|
|
4473
|
+
* URL and would replace the set on re-save, so the link is saved untagged
|
|
4474
|
+
* (which leaves existing tags alone) and the union written after.
|
|
4475
|
+
*/
|
|
4177
4476
|
save(input: {
|
|
4178
4477
|
url: string;
|
|
4179
4478
|
title?: string;
|
|
4180
4479
|
note?: string;
|
|
4480
|
+
tags?: string[];
|
|
4181
4481
|
workspaceId?: string;
|
|
4182
4482
|
readStatus?: ReadStatus;
|
|
4183
4483
|
}): Promise<Resource>;
|
|
@@ -4304,6 +4604,34 @@ interface GlobalSearchOutput {
|
|
|
4304
4604
|
query: string;
|
|
4305
4605
|
results: SearchResult[];
|
|
4306
4606
|
}
|
|
4607
|
+
type KnowledgeSourceType = 'transcription' | 'resource' | 'document' | 'page';
|
|
4608
|
+
interface KnowledgeSearchOptions {
|
|
4609
|
+
/** What the content should be about (3–200 chars). */
|
|
4610
|
+
query: string;
|
|
4611
|
+
/** Required: the Knowledge index is searched one workspace at a time. */
|
|
4612
|
+
workspaceId: string;
|
|
4613
|
+
/** Max sources returned (1-20, server default 5). */
|
|
4614
|
+
limit?: number;
|
|
4615
|
+
/** Restrict to these kinds of source; default is every kind the caller can see. */
|
|
4616
|
+
sourceTypes?: KnowledgeSourceType[];
|
|
4617
|
+
}
|
|
4618
|
+
/** One Knowledge Base hit: the best-matching chunk of one indexed source. */
|
|
4619
|
+
interface KnowledgeSearchResult {
|
|
4620
|
+
sourceType: KnowledgeSourceType;
|
|
4621
|
+
sourceId: string;
|
|
4622
|
+
title: string;
|
|
4623
|
+
/** The matching chunk, whitespace-collapsed and cut to a one-line preview. */
|
|
4624
|
+
snippet: string;
|
|
4625
|
+
similarity: number;
|
|
4626
|
+
/** In-app route, or the source's own URL when `external`. */
|
|
4627
|
+
url: string;
|
|
4628
|
+
external: boolean;
|
|
4629
|
+
}
|
|
4630
|
+
interface KnowledgeSearchOutput {
|
|
4631
|
+
query: string;
|
|
4632
|
+
workspaceId: string;
|
|
4633
|
+
results: KnowledgeSearchResult[];
|
|
4634
|
+
}
|
|
4307
4635
|
|
|
4308
4636
|
declare class SearchApi {
|
|
4309
4637
|
private client;
|
|
@@ -4311,9 +4639,17 @@ declare class SearchApi {
|
|
|
4311
4639
|
/**
|
|
4312
4640
|
* Global text search across the entities the caller can access — the same
|
|
4313
4641
|
* coverage as the app's Cmd+K palette (projects, actions, goals,
|
|
4314
|
-
* workspaces, and other entity types as the API grows).
|
|
4642
|
+
* workspaces, and other entity types as the API grows). Matches titles;
|
|
4643
|
+
* for pages by meaning use `knowledge` or `PagesApi.search`.
|
|
4315
4644
|
*/
|
|
4316
4645
|
global(options: GlobalSearchOptions): Promise<GlobalSearchOutput>;
|
|
4646
|
+
/**
|
|
4647
|
+
* Semantic search over one workspace's Knowledge index — the caller's own
|
|
4648
|
+
* indexed meetings, resources, documents and pages, scored by meaning. Each
|
|
4649
|
+
* source contributes its best-matching passage. Costs an embedding call;
|
|
4650
|
+
* never throws for an index failure (returns no results instead).
|
|
4651
|
+
*/
|
|
4652
|
+
knowledge(options: KnowledgeSearchOptions): Promise<KnowledgeSearchOutput>;
|
|
4317
4653
|
}
|
|
4318
4654
|
|
|
4319
4655
|
type TimeEntryStatus = 'PROPOSED' | 'CONFIRMED';
|
|
@@ -4726,4 +5062,4 @@ declare class ExponentialClient {
|
|
|
4726
5062
|
});
|
|
4727
5063
|
}
|
|
4728
5064
|
|
|
4729
|
-
export { type Action, type ActionComment, type ActionCommentAddInput, type ActionCommentUpdateInput, type ActionCreateInput, type ActionOutput, type ActionStatus, type ActionUpdateInput, type ActionUpsertBySourceInput, type ActionUpsertBySourceResult, type ActionsListOutput, type AddInteractionInput, type AgentRunStatus, AgentRunsApi, type AppendEventsResult, type Area, type AreaCreateInput, type AreaListOptions, type ClaimedRun, type CommentAuthor, type Contact, type ContactCreateInput, type ContactInteraction, type ContactListOutput, type ContactUpdateInput, type ContactsListOptions, type ConversationMessage, DEFAULT_GAP_MINUTES, type DayReport, type DayReportActionRow, type DayReportEntry, type DayReportProductRow, type Deal, type DealActivity, type DealCreateInput, type DealMoveInput, type DealUpdateInput, type Decision, type DecisionAdrRef, type DecisionChainRef, type DecisionCreateInput, type DecisionDecider, type DecisionDeciderInput, type DecisionEvidenceTurn, type DecisionFeatureRef, type DecisionLink, type DecisionListOptions, type DecisionListRow, type DecisionMeetingRef, type DecisionOccurrenceRef, type DecisionProductRef, type DecisionProjectRef, type DecisionReviewState, type DecisionSetStatusInput, type DecisionSource, type DecisionStatus, type DecisionTicketRef, type DecisionUpdateInput, type DecisionUserRef, type DraftDecisionsResult, type EnrichContactResult, type Epic, type EpicCreateInput, type EpicListOptions, type EpicPriority, type EpicStatus, type EpicUpdateInput, ExponentialClient, type ExponentialConfig, type Feature, type FeatureComment, type FeatureCommentCreateInput, type FeatureCommentReplyInput, type FeatureCommentThreadInput, type FeatureCommentUpdateInput, type FeatureCreateInput, type FeatureKeyResultLink, type FeatureLinkPageInput, type FeatureListOptions, type FeatureScope, type FeatureScopeStatus, type FeatureStatus, type FeatureUpdateInput, type FinishInput, type FinishResult, type GlobalSearchOptions, type GlobalSearchOutput, type Goal, type GoalChildSummary, type GoalComment, type GoalCommentAddInput, type GoalCommentUpdateInput, type GoalCreateInput, type GoalHealth, type GoalKeyResultSummary, type GoalLifeDomain, type GoalListOptions, type GoalPeriod, type GoalProjectSummary, type GoalSetParentInput, type GoalSetStatusInput, type GoalStats, type GoalStatsOptions, type GoalStatus, type GoalTreeNode, type GoalTreeOptions, type GoalUpdateInput, type GoalUserSummary, type GoalWritableStatus, type HeartbeatResult, type InteractionDirection, type InteractionType, type KanbanStatus, type KeyResult, type KeyResultByObjectiveOptions, type KeyResultCheckIn, type KeyResultCheckInInput, type KeyResultCreateInput, type KeyResultFeatureLink, type KeyResultListOptions, type KeyResultProjectLink, type KeyResultStatus, type KeyResultUnit, type KeyResultUpdateInput, type KnowledgePage, type LabelCreateInput, type LabelListOptions, type ListForEntityInput, type Meeting, type MeetingActionSummary, type MeetingCreateInput, type MeetingDecisions, type MeetingListOptions, type MeetingParticipant, type MeetingParticipantInput, type MeetingProjectRef, type MeetingSourceIntegration, type MeetingTypeFilter, type MeetingUpdateInput, type MeetingWorkspaceRef, type ObjectiveWithKeyResults, type Organization, type OrganizationCreateInput, type OrganizationListOutput, type OrganizationSize, type OrganizationsListOptions, type OverdueCohort, type OverdueTriage, type OverdueTriageRow, type PageComment, type PageCommentCreateInput, type PageCommentUpdateInput, type PageCreateInput, type PageListOptions, type PageUpdateInput, type Pipeline, type PipelineStage, type Priority, type Product, type ProductCreateInput, type ProductUpdateInput, type Project, type ProjectDetail, type ProjectKeyResultLink, type ProjectOutput, type ProjectPriority, type ProjectStatus, type ProjectUpdateInput, type ProjectsListOptions, type ProjectsListOutput, ROUND_MINUTES, type ReadStatus, type Requirement, type RequirementCreateInput, type RequirementKind, type RequirementListOptions, type Resource, type ResourceContentType, type ResourceCreateInput, type ResourceListOptions, type ResourceListResult, type ResourceReadState, type RunMessage, type RunnerEvent, type RunnerEventKind, type ScopeCreateInput, type ScopeListOptions, type ScopeUpdateInput, type SearchResult, type SearchResultType, type SearchResultWorkspace, type SetEntityTagsInput, type SetEntityTagsResult, type Tag, type TagEntityType, type TagListResult, type Ticket, type TicketAssignee, type TicketComment, type TicketCommentAddInput, type TicketCommentUpdateInput, type TicketCreateInput, type TicketDependencyEdge, type TicketDetail, type TicketListOptions, type TicketSearchOptions, type TicketStatus, type TicketType, type TicketUpdateInput, TimeApi, type TimeConfirmDayResult, type TimeEntry, type TimeEntrySource, type TimeEntryStatus, type TimeLogBatchResult, type TimeLogInput, type TimeLogOutcome, type TimeLogResult, type TodaysActionRow, type TodaysActions, type TodaysActionsGroup, type UserStory, type UserStoryCreateInput, type UserStoryListOptions, type UserStoryUpdateInput, type WorklogSegment, type Workspace, type WorkspaceMember, type WorkspaceOutput, type WorkspacesListOutput, clearConfig, createConfigStore, getConfigPath, isAuthenticated, isTRPCError, loadConfig, saveConfig, segmentConversation };
|
|
5065
|
+
export { type Action, type ActionComment, type ActionCommentAddInput, type ActionCommentUpdateInput, type ActionCreateInput, type ActionOutput, type ActionStatus, type ActionUpdateInput, type ActionUpsertBySourceInput, type ActionUpsertBySourceResult, type ActionsListOutput, type AddInteractionInput, type AgentRunStatus, AgentRunsApi, type AppendEventsResult, type Area, type AreaCreateInput, type AreaListOptions, type ClaimedRun, type CommentAuthor, type Contact, type ContactCreateInput, type ContactInteraction, type ContactListOutput, type ContactUpdateInput, type ContactsListOptions, type ConversationMessage, DEFAULT_GAP_MINUTES, type DayReport, type DayReportActionRow, type DayReportEntry, type DayReportProductRow, type Deal, type DealActivity, type DealCreateInput, type DealMoveInput, type DealUpdateInput, type Decision, type DecisionAdrRef, type DecisionChainRef, type DecisionCreateInput, type DecisionDecider, type DecisionDeciderInput, type DecisionEvidenceTurn, type DecisionFeatureRef, type DecisionLink, type DecisionListOptions, type DecisionListRow, type DecisionMeetingRef, type DecisionOccurrenceRef, type DecisionProductRef, type DecisionProjectRef, type DecisionReviewState, type DecisionSetStatusInput, type DecisionSource, type DecisionStatus, type DecisionTicketRef, type DecisionUpdateInput, type DecisionUserRef, type DraftDecisionsResult, type EnrichContactResult, type Epic, type EpicCreateInput, type EpicListOptions, type EpicPriority, type EpicStatus, type EpicUpdateInput, ExponentialClient, type ExponentialConfig, type Feature, type FeatureComment, type FeatureCommentCreateInput, type FeatureCommentReplyInput, type FeatureCommentThreadInput, type FeatureCommentUpdateInput, type FeatureCreateInput, type FeatureKeyResultLink, type FeatureLinkPageInput, type FeatureListOptions, type FeatureScope, type FeatureScopeStatus, type FeatureStatus, type FeatureUpdateInput, type FinishInput, type FinishResult, type GlobalSearchOptions, type GlobalSearchOutput, type Goal, type GoalChildSummary, type GoalComment, type GoalCommentAddInput, type GoalCommentUpdateInput, type GoalCreateInput, type GoalHealth, type GoalKeyResultSummary, type GoalLifeDomain, type GoalListOptions, type GoalPeriod, type GoalProjectSummary, type GoalSetParentInput, type GoalSetStatusInput, type GoalStats, type GoalStatsOptions, type GoalStatus, type GoalTreeNode, type GoalTreeOptions, type GoalUpdateInput, type GoalUserSummary, type GoalWritableStatus, type HeartbeatResult, type InteractionDirection, type InteractionType, type KanbanStatus, type KeyResult, type KeyResultByObjectiveOptions, type KeyResultCheckIn, type KeyResultCheckInInput, type KeyResultCreateInput, type KeyResultFeatureLink, type KeyResultListOptions, type KeyResultProjectLink, type KeyResultStatus, type KeyResultUnit, type KeyResultUpdateInput, type KnowledgePage, type KnowledgeSearchOptions, type KnowledgeSearchOutput, type KnowledgeSearchResult, type KnowledgeSourceType, type LabelCreateInput, type LabelListOptions, type ListForEntityInput, type Meeting, type MeetingActionSummary, type MeetingCreateInput, type MeetingDecisions, type MeetingListOptions, type MeetingParticipant, type MeetingParticipantInput, type MeetingProjectRef, type MeetingSourceIntegration, type MeetingTypeFilter, type MeetingUpdateInput, type MeetingWorkspaceRef, type ObjectiveWithKeyResults, type Organization, type OrganizationCreateInput, type OrganizationListOutput, type OrganizationSize, type OrganizationsListOptions, type OverdueCohort, type OverdueTriage, type OverdueTriageRow, type PageComment, type PageCommentCreateInput, type PageCommentUpdateInput, type PageCreateInput, type PageDiff, type PageDiffOptions, type PageDiffSide, type PageGetFormat, type PageGetOptions, type PageHistory, type PageHistoryOptions, type PageListOptions, type PageOutlineEntry, type PageRestoreOptions, type PageRevision, type PageRevisionAuthor, type PageRevisionDetail, type PageRevisionKind, type PageSearchOptions, type PageSearchOutput, type PageSearchResult, type PageUpdateInput, type Pipeline, type PipelineStage, type Priority, type Product, type ProductCreateInput, type ProductUpdateInput, type Project, type ProjectDetail, type ProjectKeyResultLink, type ProjectOutput, type ProjectPriority, type ProjectStatus, type ProjectUpdateInput, type ProjectsListOptions, type ProjectsListOutput, ROUND_MINUTES, type ReadStatus, type Requirement, type RequirementCreateInput, type RequirementKind, type RequirementListOptions, type Resource, type ResourceContentType, type ResourceCreateInput, type ResourceListOptions, type ResourceListResult, type ResourceReadState, type ResourceUpdateInput, type RunMessage, type RunnerEvent, type RunnerEventKind, type ScopeCreateInput, type ScopeListOptions, type ScopeUpdateInput, type SearchResult, type SearchResultType, type SearchResultWorkspace, type SetEntityTagsInput, type SetEntityTagsResult, type Tag, type TagEntityType, type TagListResult, type Ticket, type TicketAssignee, type TicketComment, type TicketCommentAddInput, type TicketCommentUpdateInput, type TicketCreateInput, type TicketDependencyEdge, type TicketDetail, type TicketListOptions, type TicketSearchOptions, type TicketStatus, type TicketType, type TicketUpdateInput, TimeApi, type TimeConfirmDayResult, type TimeEntry, type TimeEntrySource, type TimeEntryStatus, type TimeLogBatchResult, type TimeLogInput, type TimeLogOutcome, type TimeLogResult, type TodaysActionRow, type TodaysActions, type TodaysActionsGroup, type UserStory, type UserStoryCreateInput, type UserStoryListOptions, type UserStoryUpdateInput, type WorklogSegment, type Workspace, type WorkspaceMember, type WorkspaceOutput, type WorkspacesListOutput, clearConfig, createConfigStore, getConfigPath, isAuthenticated, isTRPCError, loadConfig, saveConfig, segmentConversation };
|
package/dist/index.js
CHANGED
|
@@ -643,11 +643,21 @@ var DecisionsApi = class {
|
|
|
643
643
|
linkId
|
|
644
644
|
});
|
|
645
645
|
}
|
|
646
|
-
/**
|
|
647
|
-
|
|
646
|
+
/**
|
|
647
|
+
* Publish a draft into the log. Needs a person's login: agent keys are
|
|
648
|
+
* refused. Idempotent on a decision that is already confirmed.
|
|
649
|
+
*
|
|
650
|
+
* `status` moves it in the same write — `{ status: 'ACCEPTED' }` is
|
|
651
|
+
* "confirm as accepted", and works on an already-confirmed decision too.
|
|
652
|
+
* `SUPERSEDED` is refused (it needs a successor; use {@link setStatus}).
|
|
653
|
+
* A person confirming or accepting a decision that no person stands behind
|
|
654
|
+
* becomes its decider. `decisionId` may also be a `D-0006` label.
|
|
655
|
+
*/
|
|
656
|
+
async confirmDraft(workspaceId, decisionId, options = {}) {
|
|
648
657
|
return await this.client.decision.confirmDraft.mutate({
|
|
649
658
|
workspaceId,
|
|
650
|
-
decisionId
|
|
659
|
+
decisionId,
|
|
660
|
+
...options.status ? { status: options.status } : {}
|
|
651
661
|
});
|
|
652
662
|
}
|
|
653
663
|
/**
|
|
@@ -1076,8 +1086,25 @@ var PagesApi = class {
|
|
|
1076
1086
|
async list(options) {
|
|
1077
1087
|
return await this.client.page.list.query(options);
|
|
1078
1088
|
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1089
|
+
/** One page. Markdown body only unless `format` says otherwise. */
|
|
1090
|
+
async get(id, options = {}) {
|
|
1091
|
+
return await this.client.page.get.query({
|
|
1092
|
+
id,
|
|
1093
|
+
format: options.format ?? "markdown",
|
|
1094
|
+
...options.section ? { section: options.section } : {}
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
/** The page's headings (level, text, line) and `bodyBytes`, no body. */
|
|
1098
|
+
async outline(id) {
|
|
1099
|
+
return await this.get(id, { format: "outline" });
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* Pages about something: semantic hits from the Knowledge index first
|
|
1103
|
+
* (nearest first, with the matching passage as `snippet`), then pages whose
|
|
1104
|
+
* title or body contain the query. Only pages the caller can view.
|
|
1105
|
+
*/
|
|
1106
|
+
async search(options) {
|
|
1107
|
+
return await this.client.page.search.query(options);
|
|
1081
1108
|
}
|
|
1082
1109
|
async create(input) {
|
|
1083
1110
|
return await this.client.page.create.mutate(input);
|
|
@@ -1085,6 +1112,29 @@ var PagesApi = class {
|
|
|
1085
1112
|
async update(input) {
|
|
1086
1113
|
return await this.client.page.update.mutate(input);
|
|
1087
1114
|
}
|
|
1115
|
+
/** The page's revisions, newest first — who, when, why, size. Never the bodies. */
|
|
1116
|
+
async history(id, options = {}) {
|
|
1117
|
+
return await this.client.page.history.query({ id, ...options });
|
|
1118
|
+
}
|
|
1119
|
+
/** One revision with its Markdown body. */
|
|
1120
|
+
async revision(pageId, revisionId) {
|
|
1121
|
+
return await this.client.page.revision.query({ id: pageId, revisionId });
|
|
1122
|
+
}
|
|
1123
|
+
/** What a revision changed, as a unified diff of the Markdown. */
|
|
1124
|
+
async diff(pageId, revisionId, options = {}) {
|
|
1125
|
+
return await this.client.page.diff.query({
|
|
1126
|
+
id: pageId,
|
|
1127
|
+
revisionId,
|
|
1128
|
+
against: options.against ?? "previous"
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Put a revision's content back as the page's current content. A forward
|
|
1133
|
+
* write: `docVersion` bumps and a "restore" revision is recorded.
|
|
1134
|
+
*/
|
|
1135
|
+
async restore(pageId, revisionId, options = {}) {
|
|
1136
|
+
return await this.client.page.restore.mutate({ id: pageId, revisionId, ...options });
|
|
1137
|
+
}
|
|
1088
1138
|
};
|
|
1089
1139
|
|
|
1090
1140
|
// src/resources.ts
|
|
@@ -1099,9 +1149,23 @@ var ResourcesApi = class {
|
|
|
1099
1149
|
const result = await this.client.resource.create.mutate(input);
|
|
1100
1150
|
return result.resource;
|
|
1101
1151
|
}
|
|
1102
|
-
|
|
1152
|
+
async get(id) {
|
|
1153
|
+
const result = await this.client.resource.get.query({ id });
|
|
1154
|
+
return result.resource;
|
|
1155
|
+
}
|
|
1156
|
+
async update(id, input) {
|
|
1157
|
+
const result = await this.client.resource.update.mutate({ id, ...input });
|
|
1158
|
+
return result.resource;
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Save a link to the Reading list: a `bookmark` in `to_read`, not embedded.
|
|
1162
|
+
*
|
|
1163
|
+
* `tags` are added to the ones the link already has. The server dedupes by
|
|
1164
|
+
* URL and would replace the set on re-save, so the link is saved untagged
|
|
1165
|
+
* (which leaves existing tags alone) and the union written after.
|
|
1166
|
+
*/
|
|
1103
1167
|
async save(input) {
|
|
1104
|
-
|
|
1168
|
+
const resource = await this.create({
|
|
1105
1169
|
title: input.title?.trim() || hostnameOf(input.url) || input.url,
|
|
1106
1170
|
url: input.url,
|
|
1107
1171
|
description: input.note,
|
|
@@ -1110,6 +1174,10 @@ var ResourcesApi = class {
|
|
|
1110
1174
|
generateEmbeddings: false,
|
|
1111
1175
|
workspaceId: input.workspaceId
|
|
1112
1176
|
});
|
|
1177
|
+
const existing = resource.tags ?? [];
|
|
1178
|
+
const added = (input.tags ?? []).filter((t) => !existing.includes(t));
|
|
1179
|
+
if (added.length === 0) return resource;
|
|
1180
|
+
return await this.update(resource.id, { tags: [...existing, ...added] });
|
|
1113
1181
|
}
|
|
1114
1182
|
async setReadStatus(id, readStatus) {
|
|
1115
1183
|
return await this.client.resource.setReadStatus.mutate({ id, readStatus });
|
|
@@ -1193,11 +1261,21 @@ var SearchApi = class {
|
|
|
1193
1261
|
/**
|
|
1194
1262
|
* Global text search across the entities the caller can access — the same
|
|
1195
1263
|
* coverage as the app's Cmd+K palette (projects, actions, goals,
|
|
1196
|
-
* workspaces, and other entity types as the API grows).
|
|
1264
|
+
* workspaces, and other entity types as the API grows). Matches titles;
|
|
1265
|
+
* for pages by meaning use `knowledge` or `PagesApi.search`.
|
|
1197
1266
|
*/
|
|
1198
1267
|
async global(options) {
|
|
1199
1268
|
return await this.client.search.global.query(options);
|
|
1200
1269
|
}
|
|
1270
|
+
/**
|
|
1271
|
+
* Semantic search over one workspace's Knowledge index — the caller's own
|
|
1272
|
+
* indexed meetings, resources, documents and pages, scored by meaning. Each
|
|
1273
|
+
* source contributes its best-matching passage. Costs an embedding call;
|
|
1274
|
+
* never throws for an index failure (returns no results instead).
|
|
1275
|
+
*/
|
|
1276
|
+
async knowledge(options) {
|
|
1277
|
+
return await this.client.search.knowledge.query(options);
|
|
1278
|
+
}
|
|
1201
1279
|
};
|
|
1202
1280
|
|
|
1203
1281
|
// src/time.ts
|