@chatpanel/sdk 0.37.1 → 0.38.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/api.generated.d.ts +43 -8
- package/dist/api.generated.js +18 -8
- package/dist/types.generated.d.ts +40 -0
- package/package.json +1 -1
package/dist/api.generated.d.ts
CHANGED
|
@@ -1336,7 +1336,7 @@ export declare const OPERATIONS: {
|
|
|
1336
1336
|
readonly id: "contexts.list";
|
|
1337
1337
|
readonly method: "GET";
|
|
1338
1338
|
readonly path: "/v1/contexts";
|
|
1339
|
-
readonly auth: "
|
|
1339
|
+
readonly auth: "token";
|
|
1340
1340
|
readonly since: "0.141.0";
|
|
1341
1341
|
readonly stream: null;
|
|
1342
1342
|
readonly pathParams: readonly [];
|
|
@@ -1356,7 +1356,7 @@ export declare const OPERATIONS: {
|
|
|
1356
1356
|
readonly id: "contexts.suggest";
|
|
1357
1357
|
readonly method: "POST";
|
|
1358
1358
|
readonly path: "/v1/contexts/suggest";
|
|
1359
|
-
readonly auth: "
|
|
1359
|
+
readonly auth: "token";
|
|
1360
1360
|
readonly since: "0.141.0";
|
|
1361
1361
|
readonly stream: null;
|
|
1362
1362
|
readonly pathParams: readonly [];
|
|
@@ -1366,7 +1366,7 @@ export declare const OPERATIONS: {
|
|
|
1366
1366
|
readonly id: "contexts.get";
|
|
1367
1367
|
readonly method: "GET";
|
|
1368
1368
|
readonly path: "/v1/contexts/{contextId}";
|
|
1369
|
-
readonly auth: "
|
|
1369
|
+
readonly auth: "token";
|
|
1370
1370
|
readonly since: "0.141.0";
|
|
1371
1371
|
readonly stream: null;
|
|
1372
1372
|
readonly pathParams: readonly ["contextId"];
|
|
@@ -1402,11 +1402,31 @@ export declare const OPERATIONS: {
|
|
|
1402
1402
|
readonly pathParams: readonly ["contextId"];
|
|
1403
1403
|
readonly queryParams: readonly [];
|
|
1404
1404
|
};
|
|
1405
|
+
readonly "contexts.resources": {
|
|
1406
|
+
readonly id: "contexts.resources";
|
|
1407
|
+
readonly method: "POST";
|
|
1408
|
+
readonly path: "/v1/contexts/{contextId}/resources";
|
|
1409
|
+
readonly auth: "token";
|
|
1410
|
+
readonly since: "0.156.0";
|
|
1411
|
+
readonly stream: null;
|
|
1412
|
+
readonly pathParams: readonly ["contextId"];
|
|
1413
|
+
readonly queryParams: readonly [];
|
|
1414
|
+
};
|
|
1415
|
+
readonly "contexts.people": {
|
|
1416
|
+
readonly id: "contexts.people";
|
|
1417
|
+
readonly method: "POST";
|
|
1418
|
+
readonly path: "/v1/contexts/{contextId}/people";
|
|
1419
|
+
readonly auth: "token";
|
|
1420
|
+
readonly since: "0.156.0";
|
|
1421
|
+
readonly stream: null;
|
|
1422
|
+
readonly pathParams: readonly ["contextId"];
|
|
1423
|
+
readonly queryParams: readonly [];
|
|
1424
|
+
};
|
|
1405
1425
|
readonly "contexts.scope": {
|
|
1406
1426
|
readonly id: "contexts.scope";
|
|
1407
1427
|
readonly method: "GET";
|
|
1408
1428
|
readonly path: "/v1/contexts/{contextId}/scope";
|
|
1409
|
-
readonly auth: "
|
|
1429
|
+
readonly auth: "token";
|
|
1410
1430
|
readonly since: "0.141.0";
|
|
1411
1431
|
readonly stream: null;
|
|
1412
1432
|
readonly pathParams: readonly ["contextId"];
|
|
@@ -2336,7 +2356,7 @@ export declare class A2aApi {
|
|
|
2336
2356
|
export declare class ContextsApi {
|
|
2337
2357
|
private readonly rt;
|
|
2338
2358
|
constructor(rt: Runtime);
|
|
2339
|
-
/** The person's contexts — what their chats, notes and meetings are about — with what each holds. A context groups chats, notes and meetings across kinds ("Product launch", "Kitchen remodel"). It is a record in the library every client syncs, so one made here appears in the panel, the desktop and the phones on their next pull. Busiest first. — Gateway 0.141.0+. */
|
|
2359
|
+
/** The person's contexts — what their chats, notes and meetings are about — with what each holds. A context groups chats, notes and meetings across kinds ("Product launch", "Kitchen remodel"). It is a record in the library every client syncs, so one made here appears in the panel, the desktop and the phones on their next pull. Busiest first. — Requires the gateway token. Gateway 0.141.0+. */
|
|
2340
2360
|
list(opts?: RequestOptions): Promise<{
|
|
2341
2361
|
ok: boolean;
|
|
2342
2362
|
contexts: Array<T.Context>;
|
|
@@ -2346,7 +2366,7 @@ export declare class ContextsApi {
|
|
|
2346
2366
|
ok: boolean;
|
|
2347
2367
|
context: T.Context;
|
|
2348
2368
|
}>;
|
|
2349
|
-
/** Which contexts a chat, note or meeting probably belongs to — a suggestion, never filed by itself. By words — the item's title and text against each context's name, keywords and what it already holds. Pass an item's `id`, or a `title` and `text` for something not saved yet. — Gateway 0.141.0+. */
|
|
2369
|
+
/** Which contexts a chat, note or meeting probably belongs to — a suggestion, never filed by itself. By words — the item's title and text against each context's name, keywords and what it already holds. Pass an item's `id`, or a `title` and `text` for something not saved yet. — Requires the gateway token. Gateway 0.141.0+. */
|
|
2350
2370
|
suggest(body: {
|
|
2351
2371
|
id?: string;
|
|
2352
2372
|
title?: string;
|
|
@@ -2361,7 +2381,7 @@ export declare class ContextsApi {
|
|
|
2361
2381
|
why: string;
|
|
2362
2382
|
}>;
|
|
2363
2383
|
}>;
|
|
2364
|
-
/** A context and what it holds — each item by id, kind and title, never its body. — Gateway 0.141.0+. */
|
|
2384
|
+
/** A context and what it holds — each item by id, kind and title, never its body. — Requires the gateway token. Gateway 0.141.0+. */
|
|
2365
2385
|
get(contextId: string, opts?: RequestOptions): Promise<{
|
|
2366
2386
|
ok: boolean;
|
|
2367
2387
|
context: T.Context;
|
|
@@ -2389,7 +2409,22 @@ export declare class ContextsApi {
|
|
|
2389
2409
|
ok: boolean;
|
|
2390
2410
|
context: T.Context;
|
|
2391
2411
|
}>;
|
|
2392
|
-
/**
|
|
2412
|
+
/** Add or take out members and refs in one typed list — the industry's `resources` (a Copilot Space's, an Anthropic session's). A string `chat:`/`note:`/`meeting:`/`brief:` is a member; `kb:`, `folder:`, `gw:`, `copilot-space:`, `vector-store:`, `file-search-store:`, `notebook:`, `bedrock:` or `mcp-resource:` is a ref, by reference — or `{ type, id, name, noAccess }`. Needs the edit role. Each item keeps its own clock, so two devices editing at once both count. — Requires the gateway token. Gateway 0.156.0+. */
|
|
2413
|
+
resources(contextId: string, body: {
|
|
2414
|
+
add?: Array<string | T.ContextRef>;
|
|
2415
|
+
remove?: Array<string | T.ContextRef>;
|
|
2416
|
+
}, opts?: RequestOptions): Promise<{
|
|
2417
|
+
ok: boolean;
|
|
2418
|
+
context: T.Context;
|
|
2419
|
+
}>;
|
|
2420
|
+
/** Share a context with people or groups by role, or take them off (null). Needs the manage role. — Requires the gateway token. Gateway 0.156.0+. */
|
|
2421
|
+
people(contextId: string, body: {
|
|
2422
|
+
[key: string]: "viewer" | "editor" | "manager" | null;
|
|
2423
|
+
}, opts?: RequestOptions): Promise<{
|
|
2424
|
+
ok: boolean;
|
|
2425
|
+
context: T.Context;
|
|
2426
|
+
}>;
|
|
2427
|
+
/** What a turn inside a context searches (its item ids) and the one line it is told. — Requires the gateway token. Gateway 0.141.0+. */
|
|
2393
2428
|
scope(contextId: string, opts?: RequestOptions): Promise<{
|
|
2394
2429
|
ok: boolean;
|
|
2395
2430
|
ids: Array<string>;
|
package/dist/api.generated.js
CHANGED
|
@@ -133,14 +133,16 @@ export const OPERATIONS = {
|
|
|
133
133
|
"skills.list": { id: "skills.list", method: "GET", path: "/skills", auth: "open", since: "0.6.64", stream: null, pathParams: [], queryParams: ["workdir"] },
|
|
134
134
|
"skills.get": { id: "skills.get", method: "GET", path: "/skills/{skillId}", auth: "open", since: "0.6.67", stream: null, pathParams: ["skillId"], queryParams: ["workdir"] },
|
|
135
135
|
"skills.file": { id: "skills.file", method: "GET", path: "/skills/{skillId}/file/{path}", auth: "open", since: "0.11.4", stream: null, pathParams: ["skillId", "path"], queryParams: ["workdir"] },
|
|
136
|
-
"contexts.list": { id: "contexts.list", method: "GET", path: "/v1/contexts", auth: "
|
|
136
|
+
"contexts.list": { id: "contexts.list", method: "GET", path: "/v1/contexts", auth: "token", since: "0.141.0", stream: null, pathParams: [], queryParams: [] },
|
|
137
137
|
"contexts.create": { id: "contexts.create", method: "POST", path: "/v1/contexts", auth: "token", since: "0.141.0", stream: null, pathParams: [], queryParams: [] },
|
|
138
|
-
"contexts.suggest": { id: "contexts.suggest", method: "POST", path: "/v1/contexts/suggest", auth: "
|
|
139
|
-
"contexts.get": { id: "contexts.get", method: "GET", path: "/v1/contexts/{contextId}", auth: "
|
|
138
|
+
"contexts.suggest": { id: "contexts.suggest", method: "POST", path: "/v1/contexts/suggest", auth: "token", since: "0.141.0", stream: null, pathParams: [], queryParams: [] },
|
|
139
|
+
"contexts.get": { id: "contexts.get", method: "GET", path: "/v1/contexts/{contextId}", auth: "token", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
140
140
|
"contexts.remove": { id: "contexts.remove", method: "DELETE", path: "/v1/contexts/{contextId}", auth: "token", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
141
141
|
"contexts.edit": { id: "contexts.edit", method: "PATCH", path: "/v1/contexts/{contextId}", auth: "token", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
142
142
|
"contexts.items": { id: "contexts.items", method: "POST", path: "/v1/contexts/{contextId}/items", auth: "token", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
143
|
-
"contexts.
|
|
143
|
+
"contexts.resources": { id: "contexts.resources", method: "POST", path: "/v1/contexts/{contextId}/resources", auth: "token", since: "0.156.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
144
|
+
"contexts.people": { id: "contexts.people", method: "POST", path: "/v1/contexts/{contextId}/people", auth: "token", since: "0.156.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
145
|
+
"contexts.scope": { id: "contexts.scope", method: "GET", path: "/v1/contexts/{contextId}/scope", auth: "token", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
144
146
|
"fusions.list": { id: "fusions.list", method: "GET", path: "/v1/fusions", auth: "open", since: "0.33.0", stream: null, pathParams: [], queryParams: [] },
|
|
145
147
|
"browser.status": { id: "browser.status", method: "GET", path: "/v1/browser", auth: "token", since: "0.59.0", stream: null, pathParams: [], queryParams: [] },
|
|
146
148
|
"browser.call": { id: "browser.call", method: "POST", path: "/v1/browser/call", auth: "token", since: "0.59.0", stream: null, pathParams: [], queryParams: [] },
|
|
@@ -801,7 +803,7 @@ export class A2aApi {
|
|
|
801
803
|
export class ContextsApi {
|
|
802
804
|
rt;
|
|
803
805
|
constructor(rt) { this.rt = rt; }
|
|
804
|
-
/** The person's contexts — what their chats, notes and meetings are about — with what each holds. A context groups chats, notes and meetings across kinds ("Product launch", "Kitchen remodel"). It is a record in the library every client syncs, so one made here appears in the panel, the desktop and the phones on their next pull. Busiest first. — Gateway 0.141.0+. */
|
|
806
|
+
/** The person's contexts — what their chats, notes and meetings are about — with what each holds. A context groups chats, notes and meetings across kinds ("Product launch", "Kitchen remodel"). It is a record in the library every client syncs, so one made here appears in the panel, the desktop and the phones on their next pull. Busiest first. — Requires the gateway token. Gateway 0.141.0+. */
|
|
805
807
|
list(opts) {
|
|
806
808
|
return this.rt.request(OPERATIONS["contexts.list"], { path: {}, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
807
809
|
}
|
|
@@ -809,11 +811,11 @@ export class ContextsApi {
|
|
|
809
811
|
create(body, opts) {
|
|
810
812
|
return this.rt.request(OPERATIONS["contexts.create"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
811
813
|
}
|
|
812
|
-
/** Which contexts a chat, note or meeting probably belongs to — a suggestion, never filed by itself. By words — the item's title and text against each context's name, keywords and what it already holds. Pass an item's `id`, or a `title` and `text` for something not saved yet. — Gateway 0.141.0+. */
|
|
814
|
+
/** Which contexts a chat, note or meeting probably belongs to — a suggestion, never filed by itself. By words — the item's title and text against each context's name, keywords and what it already holds. Pass an item's `id`, or a `title` and `text` for something not saved yet. — Requires the gateway token. Gateway 0.141.0+. */
|
|
813
815
|
suggest(body, opts) {
|
|
814
816
|
return this.rt.request(OPERATIONS["contexts.suggest"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
815
817
|
}
|
|
816
|
-
/** A context and what it holds — each item by id, kind and title, never its body. — Gateway 0.141.0+. */
|
|
818
|
+
/** A context and what it holds — each item by id, kind and title, never its body. — Requires the gateway token. Gateway 0.141.0+. */
|
|
817
819
|
get(contextId, opts) {
|
|
818
820
|
return this.rt.request(OPERATIONS["contexts.get"], { path: { contextId }, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
819
821
|
}
|
|
@@ -829,7 +831,15 @@ export class ContextsApi {
|
|
|
829
831
|
items(contextId, body, opts) {
|
|
830
832
|
return this.rt.request(OPERATIONS["contexts.items"], { path: { contextId }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
831
833
|
}
|
|
832
|
-
/**
|
|
834
|
+
/** Add or take out members and refs in one typed list — the industry's `resources` (a Copilot Space's, an Anthropic session's). A string `chat:`/`note:`/`meeting:`/`brief:` is a member; `kb:`, `folder:`, `gw:`, `copilot-space:`, `vector-store:`, `file-search-store:`, `notebook:`, `bedrock:` or `mcp-resource:` is a ref, by reference — or `{ type, id, name, noAccess }`. Needs the edit role. Each item keeps its own clock, so two devices editing at once both count. — Requires the gateway token. Gateway 0.156.0+. */
|
|
835
|
+
resources(contextId, body, opts) {
|
|
836
|
+
return this.rt.request(OPERATIONS["contexts.resources"], { path: { contextId }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
837
|
+
}
|
|
838
|
+
/** Share a context with people or groups by role, or take them off (null). Needs the manage role. — Requires the gateway token. Gateway 0.156.0+. */
|
|
839
|
+
people(contextId, body, opts) {
|
|
840
|
+
return this.rt.request(OPERATIONS["contexts.people"], { path: { contextId }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
841
|
+
}
|
|
842
|
+
/** What a turn inside a context searches (its item ids) and the one line it is told. — Requires the gateway token. Gateway 0.141.0+. */
|
|
833
843
|
scope(contextId, opts) {
|
|
834
844
|
return this.rt.request(OPERATIONS["contexts.scope"], { path: { contextId }, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
835
845
|
}
|
|
@@ -13,12 +13,52 @@ export interface Context {
|
|
|
13
13
|
/** The newest item's time (ms). */
|
|
14
14
|
last?: number;
|
|
15
15
|
updatedAt: number;
|
|
16
|
+
/** How Chap answers inside it (v2, 0.156.0) — empty for a caller without read. */
|
|
17
|
+
instructions?: string;
|
|
18
|
+
/** What it points at, by reference (v2). A ref the caller cannot open in its own system is `locked` (name only) or absent (hidden), as the context's creator chose. */
|
|
19
|
+
refs?: Array<ContextRef>;
|
|
20
|
+
/** The MCP servers a turn inside it may find; null = every one (v2). */
|
|
21
|
+
mcp_servers?: Array<string> | null;
|
|
22
|
+
/** The skills a turn inside it may find; null = every one (v2). */
|
|
23
|
+
skills?: Array<string> | null;
|
|
24
|
+
access?: ContextAccess;
|
|
25
|
+
}
|
|
26
|
+
export interface ContextRef {
|
|
27
|
+
/** `<type>:<id>`. */
|
|
28
|
+
key: string;
|
|
29
|
+
type: "kb" | "folder" | "gw" | "bedrock" | "copilot-space" | "vector-store" | "file-search-store" | "notebook" | "mcp-resource";
|
|
30
|
+
id?: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
provider?: string;
|
|
33
|
+
/** Overrides the context's choice for this ref. */
|
|
34
|
+
noAccess?: "locked" | "hidden";
|
|
35
|
+
/** The caller cannot open it in its own system; only its name is shown. */
|
|
36
|
+
locked?: boolean;
|
|
37
|
+
at?: number;
|
|
38
|
+
}
|
|
39
|
+
/** Who may reach the context — shown to its owner and managers only (v2, 0.156.0). */
|
|
40
|
+
export interface ContextAccess {
|
|
41
|
+
/** Agents that may find and use it, by name; null = none. */
|
|
42
|
+
agents?: Array<string> | null;
|
|
43
|
+
/** A person's id or `group:<id>` → role. */
|
|
44
|
+
people?: {
|
|
45
|
+
[key: string]: "viewer" | "editor" | "manager";
|
|
46
|
+
};
|
|
47
|
+
/** What a viewer sees of a ref they cannot open in its own system. */
|
|
48
|
+
noAccess?: "locked" | "hidden";
|
|
16
49
|
}
|
|
17
50
|
export interface ContextEdit {
|
|
18
51
|
name?: string;
|
|
19
52
|
color?: "blue" | "orange" | "green" | "purple" | "pink" | "teal" | "gray";
|
|
20
53
|
about?: string;
|
|
21
54
|
keywords?: Array<string>;
|
|
55
|
+
instructions?: string;
|
|
56
|
+
mcp_servers?: Array<string> | null;
|
|
57
|
+
skills?: Array<string> | null;
|
|
58
|
+
/** Needs the manage role. */
|
|
59
|
+
noAccess?: "locked" | "hidden";
|
|
60
|
+
/** Needs the manage role. */
|
|
61
|
+
agents?: Array<string> | null;
|
|
22
62
|
}
|
|
23
63
|
/** A domain object whose shape is owned by `@chatpanel/events`; the SDK carries it as-is. */
|
|
24
64
|
export interface AnyObject {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Typed client for the local ChatPanel gateway — chat through the privacy proxy, search the user's history, read and write memory, follow team runs. Zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|