@chatpanel/sdk 0.22.0 → 0.24.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/README.md +12 -0
- package/dist/api.generated.d.ts +113 -0
- package/dist/api.generated.js +46 -0
- package/dist/types.generated.d.ts +129 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,6 +46,18 @@ const { token } = await cp.pair(codeTheUserTyped);
|
|
|
46
46
|
Reads on the `/v1` data plane work without a token; the gateway allows `http://localhost`
|
|
47
47
|
origins and anything in its `allowedOrigins`.
|
|
48
48
|
|
|
49
|
+
### From a partner server (ChatPanel Link)
|
|
50
|
+
|
|
51
|
+
A server the user paired by hand (`chatpanel-gateway link pair --partner <name>`) reaches their
|
|
52
|
+
gateway with the Link client as the `fetch` — the base URL stays loopback:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { createLinkFetch } from '@chatpanel/events/link-fetch.js';
|
|
56
|
+
const cp = new ChatPanel({ baseUrl: 'http://127.0.0.1:4320', fetch: await createLinkFetch({ pairing: code, store }) });
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Scopes, routes and the security model: the repository README, "Remote access for partner servers".
|
|
60
|
+
|
|
49
61
|
### Errors
|
|
50
62
|
|
|
51
63
|
Every failure is a `ChatPanelError` with `status`, `type` and `operation`:
|
package/dist/api.generated.d.ts
CHANGED
|
@@ -972,6 +972,86 @@ export declare const OPERATIONS: {
|
|
|
972
972
|
readonly pathParams: readonly [];
|
|
973
973
|
readonly queryParams: readonly [];
|
|
974
974
|
};
|
|
975
|
+
readonly "link.status": {
|
|
976
|
+
readonly id: "link.status";
|
|
977
|
+
readonly method: "GET";
|
|
978
|
+
readonly path: "/v1/link";
|
|
979
|
+
readonly auth: "token";
|
|
980
|
+
readonly since: "0.60.0";
|
|
981
|
+
readonly stream: null;
|
|
982
|
+
readonly pathParams: readonly [];
|
|
983
|
+
readonly queryParams: readonly [];
|
|
984
|
+
};
|
|
985
|
+
readonly "link.pair": {
|
|
986
|
+
readonly id: "link.pair";
|
|
987
|
+
readonly method: "POST";
|
|
988
|
+
readonly path: "/v1/link/pair";
|
|
989
|
+
readonly auth: "token";
|
|
990
|
+
readonly since: "0.60.0";
|
|
991
|
+
readonly stream: null;
|
|
992
|
+
readonly pathParams: readonly [];
|
|
993
|
+
readonly queryParams: readonly [];
|
|
994
|
+
};
|
|
995
|
+
readonly "link.route": {
|
|
996
|
+
readonly id: "link.route";
|
|
997
|
+
readonly method: "POST";
|
|
998
|
+
readonly path: "/v1/link/route";
|
|
999
|
+
readonly auth: "token";
|
|
1000
|
+
readonly since: "0.65.0";
|
|
1001
|
+
readonly stream: null;
|
|
1002
|
+
readonly pathParams: readonly [];
|
|
1003
|
+
readonly queryParams: readonly [];
|
|
1004
|
+
};
|
|
1005
|
+
readonly "link.removeDevice": {
|
|
1006
|
+
readonly id: "link.removeDevice";
|
|
1007
|
+
readonly method: "DELETE";
|
|
1008
|
+
readonly path: "/v1/link/devices/{deviceId}";
|
|
1009
|
+
readonly auth: "token";
|
|
1010
|
+
readonly since: "0.60.0";
|
|
1011
|
+
readonly stream: null;
|
|
1012
|
+
readonly pathParams: readonly ["deviceId"];
|
|
1013
|
+
readonly queryParams: readonly [];
|
|
1014
|
+
};
|
|
1015
|
+
readonly "link.approvals": {
|
|
1016
|
+
readonly id: "link.approvals";
|
|
1017
|
+
readonly method: "GET";
|
|
1018
|
+
readonly path: "/v1/link/approvals";
|
|
1019
|
+
readonly auth: "token";
|
|
1020
|
+
readonly since: "0.91.0";
|
|
1021
|
+
readonly stream: null;
|
|
1022
|
+
readonly pathParams: readonly [];
|
|
1023
|
+
readonly queryParams: readonly [];
|
|
1024
|
+
};
|
|
1025
|
+
readonly "link.approvalsStream": {
|
|
1026
|
+
readonly id: "link.approvalsStream";
|
|
1027
|
+
readonly method: "GET";
|
|
1028
|
+
readonly path: "/v1/link/approvals/stream";
|
|
1029
|
+
readonly auth: "token";
|
|
1030
|
+
readonly since: "0.91.0";
|
|
1031
|
+
readonly stream: "sse";
|
|
1032
|
+
readonly pathParams: readonly [];
|
|
1033
|
+
readonly queryParams: readonly [];
|
|
1034
|
+
};
|
|
1035
|
+
readonly "link.answerApproval": {
|
|
1036
|
+
readonly id: "link.answerApproval";
|
|
1037
|
+
readonly method: "POST";
|
|
1038
|
+
readonly path: "/v1/link/approvals/{approvalId}";
|
|
1039
|
+
readonly auth: "token";
|
|
1040
|
+
readonly since: "0.91.0";
|
|
1041
|
+
readonly stream: null;
|
|
1042
|
+
readonly pathParams: readonly ["approvalId"];
|
|
1043
|
+
readonly queryParams: readonly [];
|
|
1044
|
+
};
|
|
1045
|
+
readonly "link.listFiles": {
|
|
1046
|
+
readonly id: "link.listFiles";
|
|
1047
|
+
readonly method: "GET";
|
|
1048
|
+
readonly path: "/v1/link/files";
|
|
1049
|
+
readonly auth: "token";
|
|
1050
|
+
readonly since: "0.92.0";
|
|
1051
|
+
readonly stream: null;
|
|
1052
|
+
readonly pathParams: readonly [];
|
|
1053
|
+
readonly queryParams: readonly [];
|
|
1054
|
+
};
|
|
975
1055
|
};
|
|
976
1056
|
export type OperationId = keyof typeof OPERATIONS;
|
|
977
1057
|
/** Liveness, identity and pairing. */
|
|
@@ -1603,6 +1683,38 @@ export declare class BrowserApi {
|
|
|
1603
1683
|
ok: boolean;
|
|
1604
1684
|
}>;
|
|
1605
1685
|
}
|
|
1686
|
+
/** ChatPanel Link — the person's phones and the partner servers they chose reach this gateway end-to-end encrypted (Noise) through a relay or the person's own tunnel, with no port open. Pairing, listing and removing devices is the owner's, at their own computer — token only, and never over Link itself. */
|
|
1687
|
+
export declare class LinkApi {
|
|
1688
|
+
private readonly rt;
|
|
1689
|
+
constructor(rt: Runtime);
|
|
1690
|
+
/** The Link route and every paired device — phones and partner servers — with what each may reach. No keys, tokens or secrets. A partner device (gateway 0.89.0+) carries `kind: partner`, its `partner.name`, `scopes`, the `route` it was paired on and the `host` it connects to; a phone carries `kind: phone` and follows the gateway's route. Changing the route never moves a partner: one whose tunnel door shut with the route says `routeClosed`. — Requires the gateway token. Gateway 0.60.0+. */
|
|
1691
|
+
status(opts?: RequestOptions): Promise<T.LinkStatus>;
|
|
1692
|
+
/** Start a pairing — a phone's QR, or (with `kind partner`) a partner server's one-time code, shown and confirmed first. **A phone** (no `kind`, or `kind: phone`): a room on the route's relay and the QR the phone scans; the answer carries `uri`, `svg`, `expiresAt`, `room`. **A partner server** (`kind: partner`, gateway 0.89.0+): nothing is issued without the owner's yes. Without `confirm: true` the answer is `{ confirmed: false, preview }` — what the partner will be able to do (scopes, agents yes/no), the route and the one host its server will connect to — and nothing is created. With `confirm: true` the answer adds the `code` (`cplink1.…`, one use, 10 minutes), `room`, `route` and `host`. The route is the gateway's own unless `route` names another; a tunnel route reaches the tunnel door with no relay at all, and ChatPanel's hosted relay is used only for `link`. Refused with 403 from a device on Link: a paired device never pairs another. — Requires the gateway token. Gateway 0.60.0+. */
|
|
1693
|
+
pair(body: T.LinkPairRequest, opts?: RequestOptions): Promise<T.LinkPairResult>;
|
|
1694
|
+
/** How devices reach this computer — ChatPanel Link, the person's own relay, Tailscale or Cloudflare Tunnel. Checked, saved in the gateway's config and applied without a restart. Phones follow it; partner devices keep the route they were paired on, and the answer lists which is on which. — Requires the gateway token. Gateway 0.65.0+. */
|
|
1695
|
+
route(body: T.LinkRouteRequest, opts?: RequestOptions): Promise<T.LinkStatus>;
|
|
1696
|
+
/** Remove a paired device now — its relay room, its key and its open connection. — Requires the gateway token. Gateway 0.60.0+. */
|
|
1697
|
+
removeDevice(deviceId: string, opts?: RequestOptions): Promise<{
|
|
1698
|
+
ok: boolean;
|
|
1699
|
+
}>;
|
|
1700
|
+
/** What partners' agents are waiting on the owner for — each request a partner's coding agent made that the owner's settings do not already allow. A partner granted `agents` (gateway 0.90.0+) runs them as the owner's own turn does, and never answers their permission prompts: the request waits here for the OWNER (0.91.0+). Nothing that arrives over Link may list or answer these — 403 for a partner and a phone alike. In memory only. — Requires the gateway token. Gateway 0.91.0+. */
|
|
1701
|
+
approvals(opts?: RequestOptions): Promise<{
|
|
1702
|
+
pending: Array<T.LinkApproval>;
|
|
1703
|
+
}>;
|
|
1704
|
+
/** The waiting requests as they change — one `approvals` event with the whole list on each change, and at connect. — Requires the gateway token. Gateway 0.91.0+. */
|
|
1705
|
+
approvalsStream(opts?: RequestOptions): AsyncIterable<SseFrame<unknown>>;
|
|
1706
|
+
/** The owner's answer — once, this action for the rest of the conversation, everything in it, or no. No answer within the agent's own wait (10 minutes) is a no; revoking the partner denies what it waits on. — Requires the gateway token. Gateway 0.91.0+. */
|
|
1707
|
+
answerApproval(approvalId: string, body: {
|
|
1708
|
+
decision: "allow" | "allow_action" | "allow_all" | "deny";
|
|
1709
|
+
}, opts?: RequestOptions): Promise<{
|
|
1710
|
+
ok: boolean;
|
|
1711
|
+
}>;
|
|
1712
|
+
/** A partner's own folder, from its side — every file it may hold there, with size and last change. Called BY A PARTNER over Link (`createLinkFetch`), granted `files` (0.92.0+; needs `agents`). The folder is the one the owner chose at pairing, where its agents work; a partner may hold its data (`data/`), skills (`.claude/skills/`, `.agents/skills/`), subagents (`.claude/agents/*.md`) and instructions (`CLAUDE.md`, `AGENTS.md`) — never what configures the agent. `GET /v1/link/files/data` lists one root. — Requires the gateway token. Gateway 0.92.0+. */
|
|
1713
|
+
listFiles(opts?: RequestOptions): Promise<{
|
|
1714
|
+
folder?: string;
|
|
1715
|
+
files: Array<T.LinkPartnerFile>;
|
|
1716
|
+
}>;
|
|
1717
|
+
}
|
|
1606
1718
|
/** The namespaces a client exposes, built on one runtime. */
|
|
1607
1719
|
export declare function buildApi(rt: Runtime): {
|
|
1608
1720
|
gateway: GatewayApi;
|
|
@@ -1625,4 +1737,5 @@ export declare function buildApi(rt: Runtime): {
|
|
|
1625
1737
|
a2a: A2aApi;
|
|
1626
1738
|
fusions: FusionsApi;
|
|
1627
1739
|
browser: BrowserApi;
|
|
1740
|
+
link: LinkApi;
|
|
1628
1741
|
};
|
package/dist/api.generated.js
CHANGED
|
@@ -97,6 +97,14 @@ export const OPERATIONS = {
|
|
|
97
97
|
"browser.stream": { id: "browser.stream", method: "GET", path: "/v1/browser/stream", auth: "token", since: "0.59.0", stream: "sse", pathParams: [], queryParams: [] },
|
|
98
98
|
"browser.announce": { id: "browser.announce", method: "POST", path: "/v1/browser/announce", auth: "token", since: "0.59.0", stream: null, pathParams: [], queryParams: [] },
|
|
99
99
|
"browser.result": { id: "browser.result", method: "POST", path: "/v1/browser/result", auth: "token", since: "0.59.0", stream: null, pathParams: [], queryParams: [] },
|
|
100
|
+
"link.status": { id: "link.status", method: "GET", path: "/v1/link", auth: "token", since: "0.60.0", stream: null, pathParams: [], queryParams: [] },
|
|
101
|
+
"link.pair": { id: "link.pair", method: "POST", path: "/v1/link/pair", auth: "token", since: "0.60.0", stream: null, pathParams: [], queryParams: [] },
|
|
102
|
+
"link.route": { id: "link.route", method: "POST", path: "/v1/link/route", auth: "token", since: "0.65.0", stream: null, pathParams: [], queryParams: [] },
|
|
103
|
+
"link.removeDevice": { id: "link.removeDevice", method: "DELETE", path: "/v1/link/devices/{deviceId}", auth: "token", since: "0.60.0", stream: null, pathParams: ["deviceId"], queryParams: [] },
|
|
104
|
+
"link.approvals": { id: "link.approvals", method: "GET", path: "/v1/link/approvals", auth: "token", since: "0.91.0", stream: null, pathParams: [], queryParams: [] },
|
|
105
|
+
"link.approvalsStream": { id: "link.approvalsStream", method: "GET", path: "/v1/link/approvals/stream", auth: "token", since: "0.91.0", stream: "sse", pathParams: [], queryParams: [] },
|
|
106
|
+
"link.answerApproval": { id: "link.answerApproval", method: "POST", path: "/v1/link/approvals/{approvalId}", auth: "token", since: "0.91.0", stream: null, pathParams: ["approvalId"], queryParams: [] },
|
|
107
|
+
"link.listFiles": { id: "link.listFiles", method: "GET", path: "/v1/link/files", auth: "token", since: "0.92.0", stream: null, pathParams: [], queryParams: [] },
|
|
100
108
|
};
|
|
101
109
|
/** Liveness, identity and pairing. */
|
|
102
110
|
export class GatewayApi {
|
|
@@ -590,6 +598,43 @@ export class BrowserApi {
|
|
|
590
598
|
return this.rt.request(OPERATIONS["browser.result"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
591
599
|
}
|
|
592
600
|
}
|
|
601
|
+
/** ChatPanel Link — the person's phones and the partner servers they chose reach this gateway end-to-end encrypted (Noise) through a relay or the person's own tunnel, with no port open. Pairing, listing and removing devices is the owner's, at their own computer — token only, and never over Link itself. */
|
|
602
|
+
export class LinkApi {
|
|
603
|
+
rt;
|
|
604
|
+
constructor(rt) { this.rt = rt; }
|
|
605
|
+
/** The Link route and every paired device — phones and partner servers — with what each may reach. No keys, tokens or secrets. A partner device (gateway 0.89.0+) carries `kind: partner`, its `partner.name`, `scopes`, the `route` it was paired on and the `host` it connects to; a phone carries `kind: phone` and follows the gateway's route. Changing the route never moves a partner: one whose tunnel door shut with the route says `routeClosed`. — Requires the gateway token. Gateway 0.60.0+. */
|
|
606
|
+
status(opts) {
|
|
607
|
+
return this.rt.request(OPERATIONS["link.status"], { path: {}, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
608
|
+
}
|
|
609
|
+
/** Start a pairing — a phone's QR, or (with `kind partner`) a partner server's one-time code, shown and confirmed first. **A phone** (no `kind`, or `kind: phone`): a room on the route's relay and the QR the phone scans; the answer carries `uri`, `svg`, `expiresAt`, `room`. **A partner server** (`kind: partner`, gateway 0.89.0+): nothing is issued without the owner's yes. Without `confirm: true` the answer is `{ confirmed: false, preview }` — what the partner will be able to do (scopes, agents yes/no), the route and the one host its server will connect to — and nothing is created. With `confirm: true` the answer adds the `code` (`cplink1.…`, one use, 10 minutes), `room`, `route` and `host`. The route is the gateway's own unless `route` names another; a tunnel route reaches the tunnel door with no relay at all, and ChatPanel's hosted relay is used only for `link`. Refused with 403 from a device on Link: a paired device never pairs another. — Requires the gateway token. Gateway 0.60.0+. */
|
|
610
|
+
pair(body, opts) {
|
|
611
|
+
return this.rt.request(OPERATIONS["link.pair"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
612
|
+
}
|
|
613
|
+
/** How devices reach this computer — ChatPanel Link, the person's own relay, Tailscale or Cloudflare Tunnel. Checked, saved in the gateway's config and applied without a restart. Phones follow it; partner devices keep the route they were paired on, and the answer lists which is on which. — Requires the gateway token. Gateway 0.65.0+. */
|
|
614
|
+
route(body, opts) {
|
|
615
|
+
return this.rt.request(OPERATIONS["link.route"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
616
|
+
}
|
|
617
|
+
/** Remove a paired device now — its relay room, its key and its open connection. — Requires the gateway token. Gateway 0.60.0+. */
|
|
618
|
+
removeDevice(deviceId, opts) {
|
|
619
|
+
return this.rt.request(OPERATIONS["link.removeDevice"], { path: { deviceId }, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
620
|
+
}
|
|
621
|
+
/** What partners' agents are waiting on the owner for — each request a partner's coding agent made that the owner's settings do not already allow. A partner granted `agents` (gateway 0.90.0+) runs them as the owner's own turn does, and never answers their permission prompts: the request waits here for the OWNER (0.91.0+). Nothing that arrives over Link may list or answer these — 403 for a partner and a phone alike. In memory only. — Requires the gateway token. Gateway 0.91.0+. */
|
|
622
|
+
approvals(opts) {
|
|
623
|
+
return this.rt.request(OPERATIONS["link.approvals"], { path: {}, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
624
|
+
}
|
|
625
|
+
/** The waiting requests as they change — one `approvals` event with the whole list on each change, and at connect. — Requires the gateway token. Gateway 0.91.0+. */
|
|
626
|
+
approvalsStream(opts) {
|
|
627
|
+
return this.rt.stream(OPERATIONS["link.approvalsStream"], { path: {}, query: undefined, headers: opts?.headers, opts });
|
|
628
|
+
}
|
|
629
|
+
/** The owner's answer — once, this action for the rest of the conversation, everything in it, or no. No answer within the agent's own wait (10 minutes) is a no; revoking the partner denies what it waits on. — Requires the gateway token. Gateway 0.91.0+. */
|
|
630
|
+
answerApproval(approvalId, body, opts) {
|
|
631
|
+
return this.rt.request(OPERATIONS["link.answerApproval"], { path: { approvalId }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
632
|
+
}
|
|
633
|
+
/** A partner's own folder, from its side — every file it may hold there, with size and last change. Called BY A PARTNER over Link (`createLinkFetch`), granted `files` (0.92.0+; needs `agents`). The folder is the one the owner chose at pairing, where its agents work; a partner may hold its data (`data/`), skills (`.claude/skills/`, `.agents/skills/`), subagents (`.claude/agents/*.md`) and instructions (`CLAUDE.md`, `AGENTS.md`) — never what configures the agent. `GET /v1/link/files/data` lists one root. — Requires the gateway token. Gateway 0.92.0+. */
|
|
634
|
+
listFiles(opts) {
|
|
635
|
+
return this.rt.request(OPERATIONS["link.listFiles"], { path: {}, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
636
|
+
}
|
|
637
|
+
}
|
|
593
638
|
/** The namespaces a client exposes, built on one runtime. */
|
|
594
639
|
export function buildApi(rt) {
|
|
595
640
|
return {
|
|
@@ -613,5 +658,6 @@ export function buildApi(rt) {
|
|
|
613
658
|
a2a: new A2aApi(rt),
|
|
614
659
|
fusions: new FusionsApi(rt),
|
|
615
660
|
browser: new BrowserApi(rt),
|
|
661
|
+
link: new LinkApi(rt),
|
|
616
662
|
};
|
|
617
663
|
}
|
|
@@ -1143,6 +1143,135 @@ export interface BrowserInfo {
|
|
|
1143
1143
|
kind: "chrome" | "edge" | "firefox" | "brave" | "opera" | "chromium" | "other";
|
|
1144
1144
|
version?: string;
|
|
1145
1145
|
}
|
|
1146
|
+
export interface LinkPairRequest {
|
|
1147
|
+
/** Absent is a phone. */
|
|
1148
|
+
kind?: "phone" | "partner";
|
|
1149
|
+
/** A phone pairing — what the phone calls this computer. */
|
|
1150
|
+
name?: string;
|
|
1151
|
+
partner?: {
|
|
1152
|
+
/** What the owner calls the partner. */
|
|
1153
|
+
name: string;
|
|
1154
|
+
};
|
|
1155
|
+
/** What the partner may reach: `models` (GET /v1/models), `chat` (POST /v1/chat/completions and /v1/messages to API models), `agents` (also the coding agents, as the owner's own turn runs them — the Coding Agents settings, the sandbox and the org policy decide what they may do, in the partner's own folder, and the owner answers their approval prompts; needs chat; 0.90.0+), `files` (its data, skills, subagents and instructions in that folder — /v1/link/files; needs agents; 0.92.0+). An array or a comma list; absent is models and chat. */
|
|
1156
|
+
scopes?: Array<"models" | "chat" | "agents" | "files"> | string;
|
|
1157
|
+
/** The partner's one path. Absent is the gateway's own route. */
|
|
1158
|
+
route?: "link" | "relay" | "tailscale" | "cloudflare";
|
|
1159
|
+
/** The https relay for `route relay`. */
|
|
1160
|
+
relay?: string;
|
|
1161
|
+
/** Where the partner's agents work (with `agents`, 0.90.0+): an absolute path or ~/…; absent is ~/.chatpanel/partners/<name>. Never the disk or the home folder. */
|
|
1162
|
+
folder?: string;
|
|
1163
|
+
/** The owner saw the preview and said yes. Without it nothing is issued. */
|
|
1164
|
+
confirm?: boolean;
|
|
1165
|
+
}
|
|
1166
|
+
export interface LinkPartnerPreview {
|
|
1167
|
+
partner: string;
|
|
1168
|
+
scopes: Array<string>;
|
|
1169
|
+
agents: boolean;
|
|
1170
|
+
route: string;
|
|
1171
|
+
/** The one host the partner's server will connect to. */
|
|
1172
|
+
host: string;
|
|
1173
|
+
/** Where its agents will work (with agents). */
|
|
1174
|
+
folder?: string;
|
|
1175
|
+
/** The confirmation as the owner reads it. */
|
|
1176
|
+
lines: Array<string>;
|
|
1177
|
+
}
|
|
1178
|
+
export interface LinkPairResult {
|
|
1179
|
+
/** A phone's QR text. */
|
|
1180
|
+
uri?: string;
|
|
1181
|
+
/** The QR as SVG. */
|
|
1182
|
+
svg?: string;
|
|
1183
|
+
/** Epoch ms when the code stops working. */
|
|
1184
|
+
expiresAt?: number;
|
|
1185
|
+
/** The device id it pairs. */
|
|
1186
|
+
room?: string;
|
|
1187
|
+
/** Partner pairings — false is a preview only. */
|
|
1188
|
+
confirmed?: boolean;
|
|
1189
|
+
preview?: LinkPartnerPreview;
|
|
1190
|
+
/** A partner's one-time `cplink1.` code — give it to the partner through a channel you trust. */
|
|
1191
|
+
code?: string;
|
|
1192
|
+
kind?: string;
|
|
1193
|
+
partner?: {
|
|
1194
|
+
name?: string;
|
|
1195
|
+
};
|
|
1196
|
+
scopes?: Array<string>;
|
|
1197
|
+
route?: string;
|
|
1198
|
+
host?: string;
|
|
1199
|
+
}
|
|
1200
|
+
export interface LinkRouteRequest {
|
|
1201
|
+
route: "link" | "relay" | "tailscale" | "cloudflare";
|
|
1202
|
+
/** The relay (relay) or this computer's tunnel address (tailscale */
|
|
1203
|
+
url?: string;
|
|
1204
|
+
/** A tunnel route keeps ChatPanel Link as the phones' fallback unless false. */
|
|
1205
|
+
fallback?: boolean;
|
|
1206
|
+
}
|
|
1207
|
+
export interface LinkApproval {
|
|
1208
|
+
id: string;
|
|
1209
|
+
/** The partner whose agent asks. */
|
|
1210
|
+
partner: string;
|
|
1211
|
+
device?: string;
|
|
1212
|
+
/** The partner's conversation (`partner.<device>.<thread>`), or the turn's own. */
|
|
1213
|
+
conversation?: string;
|
|
1214
|
+
/** Who asks and what kind of action — "Atlas’s agent asks — run a command?" */
|
|
1215
|
+
title: string;
|
|
1216
|
+
/** The command */
|
|
1217
|
+
body: string;
|
|
1218
|
+
tool?: string;
|
|
1219
|
+
createdAt: number;
|
|
1220
|
+
/** When it becomes a no. */
|
|
1221
|
+
expiresAt: number;
|
|
1222
|
+
}
|
|
1223
|
+
export interface LinkPartnerFile {
|
|
1224
|
+
/** Relative to the partner's folder. */
|
|
1225
|
+
path: string;
|
|
1226
|
+
size: number;
|
|
1227
|
+
modifiedAt?: number;
|
|
1228
|
+
}
|
|
1229
|
+
export interface LinkDevice {
|
|
1230
|
+
id: string;
|
|
1231
|
+
kind?: "phone" | "partner";
|
|
1232
|
+
name: string;
|
|
1233
|
+
pairedAt?: number | null;
|
|
1234
|
+
lastSeen?: number | null;
|
|
1235
|
+
online?: boolean;
|
|
1236
|
+
/** tunnel or relay, while online. */
|
|
1237
|
+
via?: string | null;
|
|
1238
|
+
partner?: {
|
|
1239
|
+
name?: string;
|
|
1240
|
+
};
|
|
1241
|
+
scopes?: Array<string>;
|
|
1242
|
+
/** A partner's route */
|
|
1243
|
+
route?: string | null;
|
|
1244
|
+
host?: string;
|
|
1245
|
+
/** A tunnel partner whose door shut when the gateway's route moved — pair it again to move it. */
|
|
1246
|
+
routeClosed?: boolean;
|
|
1247
|
+
/** Where a partner's agents work (0.90.0+, with agents). */
|
|
1248
|
+
folder?: string;
|
|
1249
|
+
staleRelay?: string;
|
|
1250
|
+
tunnelNeedsRelink?: boolean;
|
|
1251
|
+
}
|
|
1252
|
+
export interface LinkStatus {
|
|
1253
|
+
enabled: boolean;
|
|
1254
|
+
route?: string;
|
|
1255
|
+
relay?: string | null;
|
|
1256
|
+
tunnel?: string | null;
|
|
1257
|
+
problem?: string;
|
|
1258
|
+
routes?: Array<{
|
|
1259
|
+
[key: string]: unknown;
|
|
1260
|
+
}>;
|
|
1261
|
+
setup?: {
|
|
1262
|
+
[key: string]: unknown;
|
|
1263
|
+
};
|
|
1264
|
+
devices: Array<LinkDevice>;
|
|
1265
|
+
/** A phone code waiting to be scanned. */
|
|
1266
|
+
pairing?: {
|
|
1267
|
+
[key: string]: unknown;
|
|
1268
|
+
} | null;
|
|
1269
|
+
/** A partner code waiting to be used. */
|
|
1270
|
+
partnerPairing?: {
|
|
1271
|
+
[key: string]: unknown;
|
|
1272
|
+
} | null;
|
|
1273
|
+
agentSessions?: boolean;
|
|
1274
|
+
}
|
|
1146
1275
|
export interface BrowserStatus {
|
|
1147
1276
|
connected: boolean;
|
|
1148
1277
|
/** Calls waiting on the browser. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.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",
|