@chatpanel/sdk 0.10.0 → 0.12.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 +91 -0
- package/dist/api.generated.js +25 -0
- package/dist/types.generated.d.ts +65 -0
- package/package.json +1 -1
package/dist/api.generated.d.ts
CHANGED
|
@@ -752,6 +752,56 @@ export declare const OPERATIONS: {
|
|
|
752
752
|
readonly pathParams: readonly ["engineKey"];
|
|
753
753
|
readonly queryParams: readonly [];
|
|
754
754
|
};
|
|
755
|
+
readonly "skills.quarantined": {
|
|
756
|
+
readonly id: "skills.quarantined";
|
|
757
|
+
readonly method: "GET";
|
|
758
|
+
readonly path: "/skills-quarantined";
|
|
759
|
+
readonly auth: "open";
|
|
760
|
+
readonly since: "0.48.0";
|
|
761
|
+
readonly stream: null;
|
|
762
|
+
readonly pathParams: readonly [];
|
|
763
|
+
readonly queryParams: readonly ["workdir"];
|
|
764
|
+
};
|
|
765
|
+
readonly "agents.listDefs": {
|
|
766
|
+
readonly id: "agents.listDefs";
|
|
767
|
+
readonly method: "GET";
|
|
768
|
+
readonly path: "/agent-defs";
|
|
769
|
+
readonly auth: "open";
|
|
770
|
+
readonly since: "0.48.0";
|
|
771
|
+
readonly stream: null;
|
|
772
|
+
readonly pathParams: readonly [];
|
|
773
|
+
readonly queryParams: readonly ["workdir", "dir"];
|
|
774
|
+
};
|
|
775
|
+
readonly "agents.getDef": {
|
|
776
|
+
readonly id: "agents.getDef";
|
|
777
|
+
readonly method: "GET";
|
|
778
|
+
readonly path: "/agent-defs/{agentId}";
|
|
779
|
+
readonly auth: "open";
|
|
780
|
+
readonly since: "0.48.0";
|
|
781
|
+
readonly stream: null;
|
|
782
|
+
readonly pathParams: readonly ["agentId"];
|
|
783
|
+
readonly queryParams: readonly ["workdir"];
|
|
784
|
+
};
|
|
785
|
+
readonly "agents.exportPlan": {
|
|
786
|
+
readonly id: "agents.exportPlan";
|
|
787
|
+
readonly method: "POST";
|
|
788
|
+
readonly path: "/agent-defs/export-plan";
|
|
789
|
+
readonly auth: "token";
|
|
790
|
+
readonly since: "0.48.0";
|
|
791
|
+
readonly stream: null;
|
|
792
|
+
readonly pathParams: readonly [];
|
|
793
|
+
readonly queryParams: readonly [];
|
|
794
|
+
};
|
|
795
|
+
readonly "agents.exportDef": {
|
|
796
|
+
readonly id: "agents.exportDef";
|
|
797
|
+
readonly method: "POST";
|
|
798
|
+
readonly path: "/agent-defs/export";
|
|
799
|
+
readonly auth: "token";
|
|
800
|
+
readonly since: "0.48.0";
|
|
801
|
+
readonly stream: null;
|
|
802
|
+
readonly pathParams: readonly [];
|
|
803
|
+
readonly queryParams: readonly [];
|
|
804
|
+
};
|
|
755
805
|
readonly "skills.list": {
|
|
756
806
|
readonly id: "skills.list";
|
|
757
807
|
readonly method: "GET";
|
|
@@ -1156,6 +1206,41 @@ export declare class AgentsApi {
|
|
|
1156
1206
|
jobId?: string;
|
|
1157
1207
|
refs?: T.AnyObject;
|
|
1158
1208
|
}, opts?: RequestOptions): Promise<T.AnyObject>;
|
|
1209
|
+
/** The agent definitions on this machine, from every tool that writes one. `.claude/agents/*.md`, `.codex/agents/*.toml`, `~/.chatpanel/agents/*.json` and the project-local equivalents, each read in its own dialect and returned in one shape. No prompts — `promptChars` only, for the same reason `GET /skills` omits them. — Gateway 0.48.0+. */
|
|
1210
|
+
listDefs(query?: {
|
|
1211
|
+
workdir?: string;
|
|
1212
|
+
dir?: string;
|
|
1213
|
+
}, opts?: RequestOptions): Promise<{
|
|
1214
|
+
agents: Array<T.AgentDef>;
|
|
1215
|
+
/** Definitions the scanner refused. */
|
|
1216
|
+
quarantined?: Array<{
|
|
1217
|
+
[key: string]: unknown;
|
|
1218
|
+
}>;
|
|
1219
|
+
/** Files that parsed as a definition and could not be made one. */
|
|
1220
|
+
problems?: Array<{
|
|
1221
|
+
[key: string]: unknown;
|
|
1222
|
+
}>;
|
|
1223
|
+
}>;
|
|
1224
|
+
/** One agent definition, prompt included. — Gateway 0.48.0+. */
|
|
1225
|
+
getDef(agentId: string, query?: {
|
|
1226
|
+
workdir?: string;
|
|
1227
|
+
}, opts?: RequestOptions): Promise<{
|
|
1228
|
+
agent?: T.AgentDef;
|
|
1229
|
+
dialect?: "chatpanel" | "claude" | "codex" | "a2a";
|
|
1230
|
+
source?: string;
|
|
1231
|
+
path?: string;
|
|
1232
|
+
}>;
|
|
1233
|
+
/** What an export would write, and what the target cannot carry — without writing it. A separate call from the export itself, deliberately: "show me what you are about to do to my Claude Code directory" is a question a person answers before saying yes, and a dry run sharing a code path with the real thing is one edit away from not being dry. — Requires the gateway token. Gateway 0.48.0+. */
|
|
1234
|
+
exportPlan(body: T.AgentExportRequest, opts?: RequestOptions): Promise<T.AgentExportPlan>;
|
|
1235
|
+
/** Write an agent definition into another tool's folder. Only from a named action. The file is backed up before it is touched, and one ChatPanel did not write — or one edited since it did — is refused with `NOT_OURS` unless `overwrite` is set. Which of those applies is what `export-plan` reports as `status`. — Requires the gateway token. Gateway 0.48.0+. */
|
|
1236
|
+
exportDef(body: T.AgentExportRequest, opts?: RequestOptions): Promise<{
|
|
1237
|
+
ok?: boolean;
|
|
1238
|
+
path?: string;
|
|
1239
|
+
to?: string;
|
|
1240
|
+
backedUp?: boolean;
|
|
1241
|
+
status?: "new" | "ours" | "theirs";
|
|
1242
|
+
fidelity?: T.AgentFidelity;
|
|
1243
|
+
}>;
|
|
1159
1244
|
}
|
|
1160
1245
|
/** The small non-generative models this gateway provides — discovery, and one standard signature per capability (docs/capability-endpoints.md). */
|
|
1161
1246
|
export declare class CapabilitiesApi {
|
|
@@ -1246,6 +1331,12 @@ export declare class EnginesApi {
|
|
|
1246
1331
|
export declare class SkillsApi {
|
|
1247
1332
|
private readonly rt;
|
|
1248
1333
|
constructor(rt: Runtime);
|
|
1334
|
+
/** Packages the admission scanner refused — what is on disk and deliberately not listed. A skill package is a prompt that will run with tools attached, so it is scanned before it is admitted. One that fails is kept out of `GET /skills` entirely; this is the only way to learn it exists, and why. The bridge has implemented it since packages could arrive; nothing could reach it until 0.48.0. — Gateway 0.48.0+. */
|
|
1335
|
+
quarantined(query?: {
|
|
1336
|
+
workdir?: string;
|
|
1337
|
+
}, opts?: RequestOptions): Promise<{
|
|
1338
|
+
quarantined: Array<T.QuarantinedSkill>;
|
|
1339
|
+
}>;
|
|
1249
1340
|
/** The skills on this machine — with a prompt character count, not the prompt. — Gateway 0.6.64+. */
|
|
1250
1341
|
list(query?: {
|
|
1251
1342
|
workdir?: string;
|
package/dist/api.generated.js
CHANGED
|
@@ -75,6 +75,11 @@ export const OPERATIONS = {
|
|
|
75
75
|
"engines.list": { id: "engines.list", method: "GET", path: "/v1/engines", auth: "open", since: "0.6.89", stream: null, pathParams: [], queryParams: ["minCalls"] },
|
|
76
76
|
"engines.card": { id: "engines.card", method: "GET", path: "/v1/engines/{engineKey}/card", auth: "open", since: "0.6.89", stream: null, pathParams: ["engineKey"], queryParams: ["entries", "minCalls"] },
|
|
77
77
|
"engines.appendEntry": { id: "engines.appendEntry", method: "POST", path: "/v1/engines/{engineKey}/entries", auth: "open", since: "0.6.89", stream: null, pathParams: ["engineKey"], queryParams: [] },
|
|
78
|
+
"skills.quarantined": { id: "skills.quarantined", method: "GET", path: "/skills-quarantined", auth: "open", since: "0.48.0", stream: null, pathParams: [], queryParams: ["workdir"] },
|
|
79
|
+
"agents.listDefs": { id: "agents.listDefs", method: "GET", path: "/agent-defs", auth: "open", since: "0.48.0", stream: null, pathParams: [], queryParams: ["workdir", "dir"] },
|
|
80
|
+
"agents.getDef": { id: "agents.getDef", method: "GET", path: "/agent-defs/{agentId}", auth: "open", since: "0.48.0", stream: null, pathParams: ["agentId"], queryParams: ["workdir"] },
|
|
81
|
+
"agents.exportPlan": { id: "agents.exportPlan", method: "POST", path: "/agent-defs/export-plan", auth: "token", since: "0.48.0", stream: null, pathParams: [], queryParams: [] },
|
|
82
|
+
"agents.exportDef": { id: "agents.exportDef", method: "POST", path: "/agent-defs/export", auth: "token", since: "0.48.0", stream: null, pathParams: [], queryParams: [] },
|
|
78
83
|
"skills.list": { id: "skills.list", method: "GET", path: "/skills", auth: "open", since: "0.6.64", stream: null, pathParams: [], queryParams: ["workdir"] },
|
|
79
84
|
"skills.get": { id: "skills.get", method: "GET", path: "/skills/{skillId}", auth: "open", since: "0.6.67", stream: null, pathParams: ["skillId"], queryParams: ["workdir"] },
|
|
80
85
|
"fusions.list": { id: "fusions.list", method: "GET", path: "/v1/fusions", auth: "open", since: "0.33.0", stream: null, pathParams: [], queryParams: [] },
|
|
@@ -377,6 +382,22 @@ export class AgentsApi {
|
|
|
377
382
|
rate(agentId, body, opts) {
|
|
378
383
|
return this.rt.request(OPERATIONS["agents.rate"], { path: { agentId }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
379
384
|
}
|
|
385
|
+
/** The agent definitions on this machine, from every tool that writes one. `.claude/agents/*.md`, `.codex/agents/*.toml`, `~/.chatpanel/agents/*.json` and the project-local equivalents, each read in its own dialect and returned in one shape. No prompts — `promptChars` only, for the same reason `GET /skills` omits them. — Gateway 0.48.0+. */
|
|
386
|
+
listDefs(query, opts) {
|
|
387
|
+
return this.rt.request(OPERATIONS["agents.listDefs"], { path: {}, query: query, headers: opts?.headers, body: undefined, opts });
|
|
388
|
+
}
|
|
389
|
+
/** One agent definition, prompt included. — Gateway 0.48.0+. */
|
|
390
|
+
getDef(agentId, query, opts) {
|
|
391
|
+
return this.rt.request(OPERATIONS["agents.getDef"], { path: { agentId }, query: query, headers: opts?.headers, body: undefined, opts });
|
|
392
|
+
}
|
|
393
|
+
/** What an export would write, and what the target cannot carry — without writing it. A separate call from the export itself, deliberately: "show me what you are about to do to my Claude Code directory" is a question a person answers before saying yes, and a dry run sharing a code path with the real thing is one edit away from not being dry. — Requires the gateway token. Gateway 0.48.0+. */
|
|
394
|
+
exportPlan(body, opts) {
|
|
395
|
+
return this.rt.request(OPERATIONS["agents.exportPlan"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
396
|
+
}
|
|
397
|
+
/** Write an agent definition into another tool's folder. Only from a named action. The file is backed up before it is touched, and one ChatPanel did not write — or one edited since it did — is refused with `NOT_OURS` unless `overwrite` is set. Which of those applies is what `export-plan` reports as `status`. — Requires the gateway token. Gateway 0.48.0+. */
|
|
398
|
+
exportDef(body, opts) {
|
|
399
|
+
return this.rt.request(OPERATIONS["agents.exportDef"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
400
|
+
}
|
|
380
401
|
}
|
|
381
402
|
/** The small non-generative models this gateway provides — discovery, and one standard signature per capability (docs/capability-endpoints.md). */
|
|
382
403
|
export class CapabilitiesApi {
|
|
@@ -462,6 +483,10 @@ export class EnginesApi {
|
|
|
462
483
|
export class SkillsApi {
|
|
463
484
|
rt;
|
|
464
485
|
constructor(rt) { this.rt = rt; }
|
|
486
|
+
/** Packages the admission scanner refused — what is on disk and deliberately not listed. A skill package is a prompt that will run with tools attached, so it is scanned before it is admitted. One that fails is kept out of `GET /skills` entirely; this is the only way to learn it exists, and why. The bridge has implemented it since packages could arrive; nothing could reach it until 0.48.0. — Gateway 0.48.0+. */
|
|
487
|
+
quarantined(query, opts) {
|
|
488
|
+
return this.rt.request(OPERATIONS["skills.quarantined"], { path: {}, query: query, headers: opts?.headers, body: undefined, opts });
|
|
489
|
+
}
|
|
465
490
|
/** The skills on this machine — with a prompt character count, not the prompt. — Gateway 0.6.64+. */
|
|
466
491
|
list(query, opts) {
|
|
467
492
|
return this.rt.request(OPERATIONS["skills.list"], { path: {}, query: query, headers: opts?.headers, body: undefined, opts });
|
|
@@ -69,6 +69,8 @@ export interface Model {
|
|
|
69
69
|
reason?: string;
|
|
70
70
|
/** False when the agent cannot take per-turn tools. */
|
|
71
71
|
tools?: boolean;
|
|
72
|
+
/** 0.40.0+ — where the model runs, which is what a privacy ceiling reads: `device` on this machine, `trusted` on the private network, `any` a cloud. For a coding agent it is where its MODEL is (Codex → OpenAI is `any`; OpenCode over Ollama is `device`), never where the CLI process runs. Every row is served on the gateway's loopback address, so the address says nothing — read this field. */
|
|
73
|
+
reach?: "device" | "trusted" | "any";
|
|
72
74
|
[key: string]: unknown;
|
|
73
75
|
}
|
|
74
76
|
export interface ModelList {
|
|
@@ -778,6 +780,69 @@ export interface Project {
|
|
|
778
780
|
jobs?: Array<AnyObject>;
|
|
779
781
|
[key: string]: unknown;
|
|
780
782
|
}
|
|
783
|
+
export interface QuarantinedSkill {
|
|
784
|
+
id?: string;
|
|
785
|
+
path?: string;
|
|
786
|
+
source?: string;
|
|
787
|
+
verdict?: "suspicious" | "dangerous";
|
|
788
|
+
[key: string]: unknown;
|
|
789
|
+
}
|
|
790
|
+
/** An agent definition, read from whichever tool's dialect wrote it. */
|
|
791
|
+
export interface AgentDef {
|
|
792
|
+
id: string;
|
|
793
|
+
name?: string;
|
|
794
|
+
purpose?: string;
|
|
795
|
+
dialect?: "chatpanel" | "claude" | "codex" | "a2a";
|
|
796
|
+
/** The folder it was read from: chatpanel, claude, codex, agents-dir, external. */
|
|
797
|
+
source?: string;
|
|
798
|
+
label?: string;
|
|
799
|
+
/** Relative to the root it was found in. */
|
|
800
|
+
path?: string;
|
|
801
|
+
writable?: boolean;
|
|
802
|
+
engine?: {
|
|
803
|
+
[key: string]: unknown;
|
|
804
|
+
};
|
|
805
|
+
grants?: Array<string>;
|
|
806
|
+
skills?: Array<string>;
|
|
807
|
+
promptChars?: number;
|
|
808
|
+
/** Only on `GET /agent-defs/{agentId}`. */
|
|
809
|
+
prompt?: string;
|
|
810
|
+
/** What the dialect could not map — an unmapped tool is reported, never widened into a grant. */
|
|
811
|
+
warnings?: Array<string>;
|
|
812
|
+
scanned?: {
|
|
813
|
+
[key: string]: unknown;
|
|
814
|
+
};
|
|
815
|
+
[key: string]: unknown;
|
|
816
|
+
}
|
|
817
|
+
export interface AgentExportRequest {
|
|
818
|
+
agent: AgentDef;
|
|
819
|
+
/** The dialect to write. */
|
|
820
|
+
to: "claude" | "codex" | "chatpanel";
|
|
821
|
+
/** Only ever after a plan reported `theirs` and a person agreed. */
|
|
822
|
+
overwrite?: boolean;
|
|
823
|
+
}
|
|
824
|
+
export interface AgentExportPlan {
|
|
825
|
+
to?: string;
|
|
826
|
+
label?: string;
|
|
827
|
+
/** The exact file that would be written. */
|
|
828
|
+
path?: string;
|
|
829
|
+
/** Its rendered contents. */
|
|
830
|
+
text?: string;
|
|
831
|
+
exists?: boolean;
|
|
832
|
+
/** `theirs` means ChatPanel did not write it, or it has been edited since. */
|
|
833
|
+
status?: "new" | "ours" | "theirs";
|
|
834
|
+
fidelity?: AgentFidelity;
|
|
835
|
+
}
|
|
836
|
+
/** What survives a trip into a dialect, derived from what that dialect declares it can express. */
|
|
837
|
+
export interface AgentFidelity {
|
|
838
|
+
dialect?: string;
|
|
839
|
+
lossless?: boolean;
|
|
840
|
+
carried?: Array<string>;
|
|
841
|
+
dropped?: Array<{
|
|
842
|
+
field?: string;
|
|
843
|
+
why?: string;
|
|
844
|
+
}>;
|
|
845
|
+
}
|
|
781
846
|
export interface Skill {
|
|
782
847
|
id: string;
|
|
783
848
|
name?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.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",
|