@chatpanel/sdk 0.28.0 → 0.29.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 +145 -0
- package/dist/api.generated.js +46 -0
- package/dist/types.generated.d.ts +22 -0
- package/package.json +1 -1
package/dist/api.generated.d.ts
CHANGED
|
@@ -1152,6 +1152,86 @@ export declare const OPERATIONS: {
|
|
|
1152
1152
|
readonly pathParams: readonly ["skillId", "path"];
|
|
1153
1153
|
readonly queryParams: readonly ["workdir"];
|
|
1154
1154
|
};
|
|
1155
|
+
readonly "contexts.list": {
|
|
1156
|
+
readonly id: "contexts.list";
|
|
1157
|
+
readonly method: "GET";
|
|
1158
|
+
readonly path: "/v1/contexts";
|
|
1159
|
+
readonly auth: "open";
|
|
1160
|
+
readonly since: "0.141.0";
|
|
1161
|
+
readonly stream: null;
|
|
1162
|
+
readonly pathParams: readonly [];
|
|
1163
|
+
readonly queryParams: readonly [];
|
|
1164
|
+
};
|
|
1165
|
+
readonly "contexts.create": {
|
|
1166
|
+
readonly id: "contexts.create";
|
|
1167
|
+
readonly method: "POST";
|
|
1168
|
+
readonly path: "/v1/contexts";
|
|
1169
|
+
readonly auth: "token";
|
|
1170
|
+
readonly since: "0.141.0";
|
|
1171
|
+
readonly stream: null;
|
|
1172
|
+
readonly pathParams: readonly [];
|
|
1173
|
+
readonly queryParams: readonly [];
|
|
1174
|
+
};
|
|
1175
|
+
readonly "contexts.suggest": {
|
|
1176
|
+
readonly id: "contexts.suggest";
|
|
1177
|
+
readonly method: "POST";
|
|
1178
|
+
readonly path: "/v1/contexts/suggest";
|
|
1179
|
+
readonly auth: "open";
|
|
1180
|
+
readonly since: "0.141.0";
|
|
1181
|
+
readonly stream: null;
|
|
1182
|
+
readonly pathParams: readonly [];
|
|
1183
|
+
readonly queryParams: readonly [];
|
|
1184
|
+
};
|
|
1185
|
+
readonly "contexts.get": {
|
|
1186
|
+
readonly id: "contexts.get";
|
|
1187
|
+
readonly method: "GET";
|
|
1188
|
+
readonly path: "/v1/contexts/{contextId}";
|
|
1189
|
+
readonly auth: "open";
|
|
1190
|
+
readonly since: "0.141.0";
|
|
1191
|
+
readonly stream: null;
|
|
1192
|
+
readonly pathParams: readonly ["contextId"];
|
|
1193
|
+
readonly queryParams: readonly [];
|
|
1194
|
+
};
|
|
1195
|
+
readonly "contexts.remove": {
|
|
1196
|
+
readonly id: "contexts.remove";
|
|
1197
|
+
readonly method: "DELETE";
|
|
1198
|
+
readonly path: "/v1/contexts/{contextId}";
|
|
1199
|
+
readonly auth: "token";
|
|
1200
|
+
readonly since: "0.141.0";
|
|
1201
|
+
readonly stream: null;
|
|
1202
|
+
readonly pathParams: readonly ["contextId"];
|
|
1203
|
+
readonly queryParams: readonly [];
|
|
1204
|
+
};
|
|
1205
|
+
readonly "contexts.edit": {
|
|
1206
|
+
readonly id: "contexts.edit";
|
|
1207
|
+
readonly method: "PATCH";
|
|
1208
|
+
readonly path: "/v1/contexts/{contextId}";
|
|
1209
|
+
readonly auth: "token";
|
|
1210
|
+
readonly since: "0.141.0";
|
|
1211
|
+
readonly stream: null;
|
|
1212
|
+
readonly pathParams: readonly ["contextId"];
|
|
1213
|
+
readonly queryParams: readonly [];
|
|
1214
|
+
};
|
|
1215
|
+
readonly "contexts.items": {
|
|
1216
|
+
readonly id: "contexts.items";
|
|
1217
|
+
readonly method: "POST";
|
|
1218
|
+
readonly path: "/v1/contexts/{contextId}/items";
|
|
1219
|
+
readonly auth: "token";
|
|
1220
|
+
readonly since: "0.141.0";
|
|
1221
|
+
readonly stream: null;
|
|
1222
|
+
readonly pathParams: readonly ["contextId"];
|
|
1223
|
+
readonly queryParams: readonly [];
|
|
1224
|
+
};
|
|
1225
|
+
readonly "contexts.scope": {
|
|
1226
|
+
readonly id: "contexts.scope";
|
|
1227
|
+
readonly method: "GET";
|
|
1228
|
+
readonly path: "/v1/contexts/{contextId}/scope";
|
|
1229
|
+
readonly auth: "open";
|
|
1230
|
+
readonly since: "0.141.0";
|
|
1231
|
+
readonly stream: null;
|
|
1232
|
+
readonly pathParams: readonly ["contextId"];
|
|
1233
|
+
readonly queryParams: readonly [];
|
|
1234
|
+
};
|
|
1155
1235
|
readonly "fusions.list": {
|
|
1156
1236
|
readonly id: "fusions.list";
|
|
1157
1237
|
readonly method: "GET";
|
|
@@ -1967,6 +2047,70 @@ export declare class A2aApi {
|
|
|
1967
2047
|
}>;
|
|
1968
2048
|
}>;
|
|
1969
2049
|
}
|
|
2050
|
+
/** What chats, notes and meetings are about, across kinds — made, filed and suggested. */
|
|
2051
|
+
export declare class ContextsApi {
|
|
2052
|
+
private readonly rt;
|
|
2053
|
+
constructor(rt: Runtime);
|
|
2054
|
+
/** 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+. */
|
|
2055
|
+
list(opts?: RequestOptions): Promise<{
|
|
2056
|
+
ok: boolean;
|
|
2057
|
+
contexts: Array<T.Context>;
|
|
2058
|
+
}>;
|
|
2059
|
+
/** Make a context. — Requires the gateway token. Gateway 0.141.0+. */
|
|
2060
|
+
create(body: T.ContextEdit, opts?: RequestOptions): Promise<{
|
|
2061
|
+
ok: boolean;
|
|
2062
|
+
context: T.Context;
|
|
2063
|
+
}>;
|
|
2064
|
+
/** 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+. */
|
|
2065
|
+
suggest(body: {
|
|
2066
|
+
id?: string;
|
|
2067
|
+
title?: string;
|
|
2068
|
+
text?: string;
|
|
2069
|
+
limit?: number;
|
|
2070
|
+
}, opts?: RequestOptions): Promise<{
|
|
2071
|
+
ok: boolean;
|
|
2072
|
+
suggestions: Array<{
|
|
2073
|
+
id: string;
|
|
2074
|
+
title: string;
|
|
2075
|
+
score: number;
|
|
2076
|
+
why: string;
|
|
2077
|
+
}>;
|
|
2078
|
+
}>;
|
|
2079
|
+
/** A context and what it holds — each item by id, kind and title, never its body. — Gateway 0.141.0+. */
|
|
2080
|
+
get(contextId: string, opts?: RequestOptions): Promise<{
|
|
2081
|
+
ok: boolean;
|
|
2082
|
+
context: T.Context;
|
|
2083
|
+
items: Array<{
|
|
2084
|
+
id: string;
|
|
2085
|
+
kind: "chat" | "note" | "meeting" | "brief";
|
|
2086
|
+
title: string;
|
|
2087
|
+
updatedAt: number;
|
|
2088
|
+
}>;
|
|
2089
|
+
}>;
|
|
2090
|
+
/** Delete a context. Its chats, notes and meetings stay. — Requires the gateway token. Gateway 0.141.0+. */
|
|
2091
|
+
remove(contextId: string, opts?: RequestOptions): Promise<{
|
|
2092
|
+
ok: boolean;
|
|
2093
|
+
}>;
|
|
2094
|
+
/** Rename a context, or change its colour, what it is about or its keywords. — Requires the gateway token. Gateway 0.141.0+. */
|
|
2095
|
+
edit(contextId: string, body: T.ContextEdit, opts?: RequestOptions): Promise<{
|
|
2096
|
+
ok: boolean;
|
|
2097
|
+
context: T.Context;
|
|
2098
|
+
}>;
|
|
2099
|
+
/** Put chats, notes or meetings in a context, or take them out — the items themselves are untouched. One write to the context, never to the items; each item keeps its own clock there, so two devices filing at once both count. — Requires the gateway token. Gateway 0.141.0+. */
|
|
2100
|
+
items(contextId: string, body: {
|
|
2101
|
+
add?: Array<string>;
|
|
2102
|
+
remove?: Array<string>;
|
|
2103
|
+
}, opts?: RequestOptions): Promise<{
|
|
2104
|
+
ok: boolean;
|
|
2105
|
+
context: T.Context;
|
|
2106
|
+
}>;
|
|
2107
|
+
/** What a turn inside a context searches (its item ids) and the one line it is told. — Gateway 0.141.0+. */
|
|
2108
|
+
scope(contextId: string, opts?: RequestOptions): Promise<{
|
|
2109
|
+
ok: boolean;
|
|
2110
|
+
ids: Array<string>;
|
|
2111
|
+
line: string;
|
|
2112
|
+
}>;
|
|
2113
|
+
}
|
|
1970
2114
|
/** Several models as one — union, draft + target, fallback. */
|
|
1971
2115
|
export declare class FusionsApi {
|
|
1972
2116
|
private readonly rt;
|
|
@@ -2046,6 +2190,7 @@ export declare function buildApi(rt: Runtime): {
|
|
|
2046
2190
|
engines: EnginesApi;
|
|
2047
2191
|
skills: SkillsApi;
|
|
2048
2192
|
a2a: A2aApi;
|
|
2193
|
+
contexts: ContextsApi;
|
|
2049
2194
|
fusions: FusionsApi;
|
|
2050
2195
|
browser: BrowserApi;
|
|
2051
2196
|
link: LinkApi;
|
package/dist/api.generated.js
CHANGED
|
@@ -115,6 +115,14 @@ export const OPERATIONS = {
|
|
|
115
115
|
"skills.list": { id: "skills.list", method: "GET", path: "/skills", auth: "open", since: "0.6.64", stream: null, pathParams: [], queryParams: ["workdir"] },
|
|
116
116
|
"skills.get": { id: "skills.get", method: "GET", path: "/skills/{skillId}", auth: "open", since: "0.6.67", stream: null, pathParams: ["skillId"], queryParams: ["workdir"] },
|
|
117
117
|
"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"] },
|
|
118
|
+
"contexts.list": { id: "contexts.list", method: "GET", path: "/v1/contexts", auth: "open", since: "0.141.0", stream: null, pathParams: [], queryParams: [] },
|
|
119
|
+
"contexts.create": { id: "contexts.create", method: "POST", path: "/v1/contexts", auth: "token", since: "0.141.0", stream: null, pathParams: [], queryParams: [] },
|
|
120
|
+
"contexts.suggest": { id: "contexts.suggest", method: "POST", path: "/v1/contexts/suggest", auth: "open", since: "0.141.0", stream: null, pathParams: [], queryParams: [] },
|
|
121
|
+
"contexts.get": { id: "contexts.get", method: "GET", path: "/v1/contexts/{contextId}", auth: "open", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
122
|
+
"contexts.remove": { id: "contexts.remove", method: "DELETE", path: "/v1/contexts/{contextId}", auth: "token", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
123
|
+
"contexts.edit": { id: "contexts.edit", method: "PATCH", path: "/v1/contexts/{contextId}", auth: "token", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
124
|
+
"contexts.items": { id: "contexts.items", method: "POST", path: "/v1/contexts/{contextId}/items", auth: "token", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
125
|
+
"contexts.scope": { id: "contexts.scope", method: "GET", path: "/v1/contexts/{contextId}/scope", auth: "open", since: "0.141.0", stream: null, pathParams: ["contextId"], queryParams: [] },
|
|
118
126
|
"fusions.list": { id: "fusions.list", method: "GET", path: "/v1/fusions", auth: "open", since: "0.33.0", stream: null, pathParams: [], queryParams: [] },
|
|
119
127
|
"browser.status": { id: "browser.status", method: "GET", path: "/v1/browser", auth: "token", since: "0.59.0", stream: null, pathParams: [], queryParams: [] },
|
|
120
128
|
"browser.call": { id: "browser.call", method: "POST", path: "/v1/browser/call", auth: "token", since: "0.59.0", stream: null, pathParams: [], queryParams: [] },
|
|
@@ -689,6 +697,43 @@ export class A2aApi {
|
|
|
689
697
|
return this.rt.request(OPERATIONS["a2a.agents"], { path: {}, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
690
698
|
}
|
|
691
699
|
}
|
|
700
|
+
/** What chats, notes and meetings are about, across kinds — made, filed and suggested. */
|
|
701
|
+
export class ContextsApi {
|
|
702
|
+
rt;
|
|
703
|
+
constructor(rt) { this.rt = rt; }
|
|
704
|
+
/** 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+. */
|
|
705
|
+
list(opts) {
|
|
706
|
+
return this.rt.request(OPERATIONS["contexts.list"], { path: {}, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
707
|
+
}
|
|
708
|
+
/** Make a context. — Requires the gateway token. Gateway 0.141.0+. */
|
|
709
|
+
create(body, opts) {
|
|
710
|
+
return this.rt.request(OPERATIONS["contexts.create"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
711
|
+
}
|
|
712
|
+
/** 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+. */
|
|
713
|
+
suggest(body, opts) {
|
|
714
|
+
return this.rt.request(OPERATIONS["contexts.suggest"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
715
|
+
}
|
|
716
|
+
/** A context and what it holds — each item by id, kind and title, never its body. — Gateway 0.141.0+. */
|
|
717
|
+
get(contextId, opts) {
|
|
718
|
+
return this.rt.request(OPERATIONS["contexts.get"], { path: { contextId }, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
719
|
+
}
|
|
720
|
+
/** Delete a context. Its chats, notes and meetings stay. — Requires the gateway token. Gateway 0.141.0+. */
|
|
721
|
+
remove(contextId, opts) {
|
|
722
|
+
return this.rt.request(OPERATIONS["contexts.remove"], { path: { contextId }, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
723
|
+
}
|
|
724
|
+
/** Rename a context, or change its colour, what it is about or its keywords. — Requires the gateway token. Gateway 0.141.0+. */
|
|
725
|
+
edit(contextId, body, opts) {
|
|
726
|
+
return this.rt.request(OPERATIONS["contexts.edit"], { path: { contextId }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
727
|
+
}
|
|
728
|
+
/** Put chats, notes or meetings in a context, or take them out — the items themselves are untouched. One write to the context, never to the items; each item keeps its own clock there, so two devices filing at once both count. — Requires the gateway token. Gateway 0.141.0+. */
|
|
729
|
+
items(contextId, body, opts) {
|
|
730
|
+
return this.rt.request(OPERATIONS["contexts.items"], { path: { contextId }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
731
|
+
}
|
|
732
|
+
/** What a turn inside a context searches (its item ids) and the one line it is told. — Gateway 0.141.0+. */
|
|
733
|
+
scope(contextId, opts) {
|
|
734
|
+
return this.rt.request(OPERATIONS["contexts.scope"], { path: { contextId }, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
735
|
+
}
|
|
736
|
+
}
|
|
692
737
|
/** Several models as one — union, draft + target, fallback. */
|
|
693
738
|
export class FusionsApi {
|
|
694
739
|
rt;
|
|
@@ -782,6 +827,7 @@ export function buildApi(rt) {
|
|
|
782
827
|
engines: new EnginesApi(rt),
|
|
783
828
|
skills: new SkillsApi(rt),
|
|
784
829
|
a2a: new A2aApi(rt),
|
|
830
|
+
contexts: new ContextsApi(rt),
|
|
785
831
|
fusions: new FusionsApi(rt),
|
|
786
832
|
browser: new BrowserApi(rt),
|
|
787
833
|
link: new LinkApi(rt),
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
export interface Context {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
color: "blue" | "orange" | "green" | "purple" | "pink" | "teal" | "gray";
|
|
5
|
+
about: string;
|
|
6
|
+
keywords: Array<string>;
|
|
7
|
+
counts?: {
|
|
8
|
+
chat?: number;
|
|
9
|
+
note?: number;
|
|
10
|
+
meeting?: number;
|
|
11
|
+
brief?: number;
|
|
12
|
+
};
|
|
13
|
+
/** The newest item's time (ms). */
|
|
14
|
+
last?: number;
|
|
15
|
+
updatedAt: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ContextEdit {
|
|
18
|
+
name?: string;
|
|
19
|
+
color?: "blue" | "orange" | "green" | "purple" | "pink" | "teal" | "gray";
|
|
20
|
+
about?: string;
|
|
21
|
+
keywords?: Array<string>;
|
|
22
|
+
}
|
|
1
23
|
/** A domain object whose shape is owned by `@chatpanel/events`; the SDK carries it as-is. */
|
|
2
24
|
export interface AnyObject {
|
|
3
25
|
[key: string]: unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.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",
|