@chatpanel/sdk 0.29.0 → 0.30.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 +46 -0
- package/dist/api.generated.js +5 -0
- package/package.json +1 -1
package/dist/api.generated.d.ts
CHANGED
|
@@ -972,6 +972,16 @@ export declare const OPERATIONS: {
|
|
|
972
972
|
readonly pathParams: readonly ["id"];
|
|
973
973
|
readonly queryParams: readonly [];
|
|
974
974
|
};
|
|
975
|
+
readonly "knowledge.sync": {
|
|
976
|
+
readonly id: "knowledge.sync";
|
|
977
|
+
readonly method: "POST";
|
|
978
|
+
readonly path: "/v1/kb/{id}/sync";
|
|
979
|
+
readonly auth: "token";
|
|
980
|
+
readonly since: "0.142.0";
|
|
981
|
+
readonly stream: null;
|
|
982
|
+
readonly pathParams: readonly ["id"];
|
|
983
|
+
readonly queryParams: readonly [];
|
|
984
|
+
};
|
|
975
985
|
readonly "retrieval.read": {
|
|
976
986
|
readonly id: "retrieval.read";
|
|
977
987
|
readonly method: "POST";
|
|
@@ -1952,6 +1962,42 @@ export declare class KnowledgeApi {
|
|
|
1952
1962
|
setAccess(id: string, body: T.KbAccessRequest, opts?: RequestOptions): Promise<T.KbAccessResponse>;
|
|
1953
1963
|
/** Embed every passage that has no vector yet, and say where the embedder stands. — Gateway 0.101.0+. */
|
|
1954
1964
|
embed(id: string, body: Record<string, never>, opts?: RequestOptions): Promise<T.KbEmbedResponse>;
|
|
1965
|
+
/** Keep a folder in a base — read only what is new or changed, drop what is gone. A folder becomes a SOURCE of its base (events kb-folder-sync.js). The first sync makes the base when it does not exist (named after the folder) and reads every file once; each later sync lists the folder — sizes and times, nothing opened — and reads only new and changed files, a changed file REPLACING its document (its id is fixed by its path), a deleted one leaving the base. The walk refuses what a first add refuses: credential stores named as withheld, links out of the folder, the size and count limits. A path is a read on this machine, so this is the owner's only. — Requires the gateway token. Gateway 0.142.0+. */
|
|
1966
|
+
sync(id: string, body: {
|
|
1967
|
+
/** The folder (absolute */
|
|
1968
|
+
path: string;
|
|
1969
|
+
/** Only these file types, e.g. ["md", "pdf"]. */
|
|
1970
|
+
include?: Array<string>;
|
|
1971
|
+
/** The base's name when the sync makes it. */
|
|
1972
|
+
name?: string;
|
|
1973
|
+
}, opts?: RequestOptions): Promise<{
|
|
1974
|
+
/** The folder as resolved (its real path). */
|
|
1975
|
+
folder: string;
|
|
1976
|
+
/** Files read for the first time: { id, title, pages, chunks, path }. */
|
|
1977
|
+
added: Array<{
|
|
1978
|
+
[key: string]: unknown;
|
|
1979
|
+
}>;
|
|
1980
|
+
/** Files read again because their size or time moved: { id, title, pages, chunks, replaced, path }. */
|
|
1981
|
+
changed: Array<{
|
|
1982
|
+
[key: string]: unknown;
|
|
1983
|
+
}>;
|
|
1984
|
+
/** Files gone from the folder */
|
|
1985
|
+
removed: Array<string>;
|
|
1986
|
+
/** Files unchanged — not opened. */
|
|
1987
|
+
same: number;
|
|
1988
|
+
/** Files left out and why: { path, why }. */
|
|
1989
|
+
skipped?: Array<{
|
|
1990
|
+
[key: string]: unknown;
|
|
1991
|
+
}>;
|
|
1992
|
+
embedded?: number;
|
|
1993
|
+
/** True when this sync made the base. */
|
|
1994
|
+
made?: boolean;
|
|
1995
|
+
/** The base's status after the sync. */
|
|
1996
|
+
kb: {
|
|
1997
|
+
[key: string]: unknown;
|
|
1998
|
+
};
|
|
1999
|
+
ms?: number;
|
|
2000
|
+
}>;
|
|
1955
2001
|
}
|
|
1956
2002
|
/** The model ledger — every engine's card. */
|
|
1957
2003
|
export declare class EnginesApi {
|
package/dist/api.generated.js
CHANGED
|
@@ -97,6 +97,7 @@ export const OPERATIONS = {
|
|
|
97
97
|
"knowledge.access": { id: "knowledge.access", method: "GET", path: "/v1/kb/{id}/access", auth: "open", since: "0.101.1", stream: null, pathParams: ["id"], queryParams: [] },
|
|
98
98
|
"knowledge.setAccess": { id: "knowledge.setAccess", method: "POST", path: "/v1/kb/{id}/access", auth: "token", since: "0.101.1", stream: null, pathParams: ["id"], queryParams: [] },
|
|
99
99
|
"knowledge.embed": { id: "knowledge.embed", method: "POST", path: "/v1/kb/{id}/embed", auth: "open", since: "0.101.0", stream: null, pathParams: ["id"], queryParams: [] },
|
|
100
|
+
"knowledge.sync": { id: "knowledge.sync", method: "POST", path: "/v1/kb/{id}/sync", auth: "token", since: "0.142.0", stream: null, pathParams: ["id"], queryParams: [] },
|
|
100
101
|
"retrieval.read": { id: "retrieval.read", method: "POST", path: "/v1/read", auth: "open", since: "0.14.0", stream: null, pathParams: [], queryParams: [] },
|
|
101
102
|
"retrieval.readAlias": { id: "retrieval.readAlias", method: "GET", path: "/v1/read/{url}", auth: "open", since: "0.14.0", stream: null, pathParams: ["url"], queryParams: [] },
|
|
102
103
|
"engines.list": { id: "engines.list", method: "GET", path: "/v1/engines", auth: "open", since: "0.6.89", stream: null, pathParams: [], queryParams: ["minCalls"] },
|
|
@@ -633,6 +634,10 @@ export class KnowledgeApi {
|
|
|
633
634
|
embed(id, body, opts) {
|
|
634
635
|
return this.rt.request(OPERATIONS["knowledge.embed"], { path: { id }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
635
636
|
}
|
|
637
|
+
/** Keep a folder in a base — read only what is new or changed, drop what is gone. A folder becomes a SOURCE of its base (events kb-folder-sync.js). The first sync makes the base when it does not exist (named after the folder) and reads every file once; each later sync lists the folder — sizes and times, nothing opened — and reads only new and changed files, a changed file REPLACING its document (its id is fixed by its path), a deleted one leaving the base. The walk refuses what a first add refuses: credential stores named as withheld, links out of the folder, the size and count limits. A path is a read on this machine, so this is the owner's only. — Requires the gateway token. Gateway 0.142.0+. */
|
|
638
|
+
sync(id, body, opts) {
|
|
639
|
+
return this.rt.request(OPERATIONS["knowledge.sync"], { path: { id }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
640
|
+
}
|
|
636
641
|
}
|
|
637
642
|
/** The model ledger — every engine's card. */
|
|
638
643
|
export class EnginesApi {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.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",
|