@chatpanel/sdk 0.11.0 → 0.13.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 +186 -0
- package/dist/api.generated.js +56 -0
- package/dist/types.generated.d.ts +130 -0
- package/package.json +1 -1
package/dist/api.generated.d.ts
CHANGED
|
@@ -752,6 +752,106 @@ 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 "a2a.card": {
|
|
766
|
+
readonly id: "a2a.card";
|
|
767
|
+
readonly method: "POST";
|
|
768
|
+
readonly path: "/a2a/card";
|
|
769
|
+
readonly auth: "token";
|
|
770
|
+
readonly since: "0.53.0";
|
|
771
|
+
readonly stream: null;
|
|
772
|
+
readonly pathParams: readonly [];
|
|
773
|
+
readonly queryParams: readonly [];
|
|
774
|
+
};
|
|
775
|
+
readonly "a2a.message": {
|
|
776
|
+
readonly id: "a2a.message";
|
|
777
|
+
readonly method: "POST";
|
|
778
|
+
readonly path: "/a2a/message";
|
|
779
|
+
readonly auth: "token";
|
|
780
|
+
readonly since: "0.53.0";
|
|
781
|
+
readonly stream: null;
|
|
782
|
+
readonly pathParams: readonly [];
|
|
783
|
+
readonly queryParams: readonly [];
|
|
784
|
+
};
|
|
785
|
+
readonly "a2a.stream": {
|
|
786
|
+
readonly id: "a2a.stream";
|
|
787
|
+
readonly method: "POST";
|
|
788
|
+
readonly path: "/a2a/message/stream";
|
|
789
|
+
readonly auth: "token";
|
|
790
|
+
readonly since: "0.53.0";
|
|
791
|
+
readonly stream: "sse";
|
|
792
|
+
readonly pathParams: readonly [];
|
|
793
|
+
readonly queryParams: readonly [];
|
|
794
|
+
};
|
|
795
|
+
readonly "a2a.task": {
|
|
796
|
+
readonly id: "a2a.task";
|
|
797
|
+
readonly method: "POST";
|
|
798
|
+
readonly path: "/a2a/task";
|
|
799
|
+
readonly auth: "token";
|
|
800
|
+
readonly since: "0.53.0";
|
|
801
|
+
readonly stream: null;
|
|
802
|
+
readonly pathParams: readonly [];
|
|
803
|
+
readonly queryParams: readonly [];
|
|
804
|
+
};
|
|
805
|
+
readonly "a2a.agents": {
|
|
806
|
+
readonly id: "a2a.agents";
|
|
807
|
+
readonly method: "GET";
|
|
808
|
+
readonly path: "/a2a/agents";
|
|
809
|
+
readonly auth: "token";
|
|
810
|
+
readonly since: "0.53.0";
|
|
811
|
+
readonly stream: null;
|
|
812
|
+
readonly pathParams: readonly [];
|
|
813
|
+
readonly queryParams: readonly [];
|
|
814
|
+
};
|
|
815
|
+
readonly "agents.listDefs": {
|
|
816
|
+
readonly id: "agents.listDefs";
|
|
817
|
+
readonly method: "GET";
|
|
818
|
+
readonly path: "/agent-defs";
|
|
819
|
+
readonly auth: "open";
|
|
820
|
+
readonly since: "0.48.0";
|
|
821
|
+
readonly stream: null;
|
|
822
|
+
readonly pathParams: readonly [];
|
|
823
|
+
readonly queryParams: readonly ["workdir", "dir"];
|
|
824
|
+
};
|
|
825
|
+
readonly "agents.getDef": {
|
|
826
|
+
readonly id: "agents.getDef";
|
|
827
|
+
readonly method: "GET";
|
|
828
|
+
readonly path: "/agent-defs/{agentId}";
|
|
829
|
+
readonly auth: "open";
|
|
830
|
+
readonly since: "0.48.0";
|
|
831
|
+
readonly stream: null;
|
|
832
|
+
readonly pathParams: readonly ["agentId"];
|
|
833
|
+
readonly queryParams: readonly ["workdir"];
|
|
834
|
+
};
|
|
835
|
+
readonly "agents.exportPlan": {
|
|
836
|
+
readonly id: "agents.exportPlan";
|
|
837
|
+
readonly method: "POST";
|
|
838
|
+
readonly path: "/agent-defs/export-plan";
|
|
839
|
+
readonly auth: "token";
|
|
840
|
+
readonly since: "0.48.0";
|
|
841
|
+
readonly stream: null;
|
|
842
|
+
readonly pathParams: readonly [];
|
|
843
|
+
readonly queryParams: readonly [];
|
|
844
|
+
};
|
|
845
|
+
readonly "agents.exportDef": {
|
|
846
|
+
readonly id: "agents.exportDef";
|
|
847
|
+
readonly method: "POST";
|
|
848
|
+
readonly path: "/agent-defs/export";
|
|
849
|
+
readonly auth: "token";
|
|
850
|
+
readonly since: "0.48.0";
|
|
851
|
+
readonly stream: null;
|
|
852
|
+
readonly pathParams: readonly [];
|
|
853
|
+
readonly queryParams: readonly [];
|
|
854
|
+
};
|
|
755
855
|
readonly "skills.list": {
|
|
756
856
|
readonly id: "skills.list";
|
|
757
857
|
readonly method: "GET";
|
|
@@ -1156,6 +1256,41 @@ export declare class AgentsApi {
|
|
|
1156
1256
|
jobId?: string;
|
|
1157
1257
|
refs?: T.AnyObject;
|
|
1158
1258
|
}, opts?: RequestOptions): Promise<T.AnyObject>;
|
|
1259
|
+
/** 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+. */
|
|
1260
|
+
listDefs(query?: {
|
|
1261
|
+
workdir?: string;
|
|
1262
|
+
dir?: string;
|
|
1263
|
+
}, opts?: RequestOptions): Promise<{
|
|
1264
|
+
agents: Array<T.AgentDef>;
|
|
1265
|
+
/** Definitions the scanner refused. */
|
|
1266
|
+
quarantined?: Array<{
|
|
1267
|
+
[key: string]: unknown;
|
|
1268
|
+
}>;
|
|
1269
|
+
/** Files that parsed as a definition and could not be made one. */
|
|
1270
|
+
problems?: Array<{
|
|
1271
|
+
[key: string]: unknown;
|
|
1272
|
+
}>;
|
|
1273
|
+
}>;
|
|
1274
|
+
/** One agent definition, prompt included. — Gateway 0.48.0+. */
|
|
1275
|
+
getDef(agentId: string, query?: {
|
|
1276
|
+
workdir?: string;
|
|
1277
|
+
}, opts?: RequestOptions): Promise<{
|
|
1278
|
+
agent?: T.AgentDef;
|
|
1279
|
+
dialect?: "chatpanel" | "claude" | "codex" | "a2a";
|
|
1280
|
+
source?: string;
|
|
1281
|
+
path?: string;
|
|
1282
|
+
}>;
|
|
1283
|
+
/** 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+. */
|
|
1284
|
+
exportPlan(body: T.AgentExportRequest, opts?: RequestOptions): Promise<T.AgentExportPlan>;
|
|
1285
|
+
/** 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+. */
|
|
1286
|
+
exportDef(body: T.AgentExportRequest, opts?: RequestOptions): Promise<{
|
|
1287
|
+
ok?: boolean;
|
|
1288
|
+
path?: string;
|
|
1289
|
+
to?: string;
|
|
1290
|
+
backedUp?: boolean;
|
|
1291
|
+
status?: "new" | "ours" | "theirs";
|
|
1292
|
+
fidelity?: T.AgentFidelity;
|
|
1293
|
+
}>;
|
|
1159
1294
|
}
|
|
1160
1295
|
/** The small non-generative models this gateway provides — discovery, and one standard signature per capability (docs/capability-endpoints.md). */
|
|
1161
1296
|
export declare class CapabilitiesApi {
|
|
@@ -1246,6 +1381,12 @@ export declare class EnginesApi {
|
|
|
1246
1381
|
export declare class SkillsApi {
|
|
1247
1382
|
private readonly rt;
|
|
1248
1383
|
constructor(rt: Runtime);
|
|
1384
|
+
/** 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+. */
|
|
1385
|
+
quarantined(query?: {
|
|
1386
|
+
workdir?: string;
|
|
1387
|
+
}, opts?: RequestOptions): Promise<{
|
|
1388
|
+
quarantined: Array<T.QuarantinedSkill>;
|
|
1389
|
+
}>;
|
|
1249
1390
|
/** The skills on this machine — with a prompt character count, not the prompt. — Gateway 0.6.64+. */
|
|
1250
1391
|
list(query?: {
|
|
1251
1392
|
workdir?: string;
|
|
@@ -1259,6 +1400,50 @@ export declare class SkillsApi {
|
|
|
1259
1400
|
skill: T.Skill | null;
|
|
1260
1401
|
}>;
|
|
1261
1402
|
}
|
|
1403
|
+
/** Remote agents reached over the Agent2Agent protocol — discovery, messages, tasks. */
|
|
1404
|
+
export declare class A2aApi {
|
|
1405
|
+
private readonly rt;
|
|
1406
|
+
constructor(rt: Runtime);
|
|
1407
|
+
/** Fetch a remote agent's card, revalidating the one already held. The gateway is the only component allowed to reach a remote agent: every outbound host goes through its SSRF guard, and a card names the endpoints this machine will then talk to. Cached per §8.6 — an ETag is revalidated with `If-None-Match`, so `fresh: false` means the peer answered 304 and the card is unchanged. Plain HTTP is refused for a remote host; loopback is not. — Requires the gateway token. Gateway 0.53.0+. */
|
|
1408
|
+
card(body: {
|
|
1409
|
+
/** The agent's origin, or a card URL outright. */
|
|
1410
|
+
url: string;
|
|
1411
|
+
/** Skip the TTL and revalidate — the ETag is still sent. */
|
|
1412
|
+
force?: boolean;
|
|
1413
|
+
/** Drop the cached card first. */
|
|
1414
|
+
forget?: boolean;
|
|
1415
|
+
/** An Authorization header value for agents that need one. */
|
|
1416
|
+
auth?: string;
|
|
1417
|
+
}, opts?: RequestOptions): Promise<{
|
|
1418
|
+
ok?: boolean;
|
|
1419
|
+
card?: T.AgentCard;
|
|
1420
|
+
/** Changes when the card's content does. */
|
|
1421
|
+
fingerprint?: string;
|
|
1422
|
+
/** false when the peer answered 304. */
|
|
1423
|
+
fresh?: boolean;
|
|
1424
|
+
changed?: boolean;
|
|
1425
|
+
url?: string;
|
|
1426
|
+
}>;
|
|
1427
|
+
/** Send a message to a remote agent and wait for the answer. The reply is a TASK or a MESSAGE — an agent that can answer at once returns a message and no task is ever created, so `kind` says which. `text` and `needs` are derived here rather than by each caller: `needs` is `answer` for an input stop and `approval` for an authorization one, and telling a caller to send a message when approval is wanted is how a task sits forever with both ends waiting. — Requires the gateway token. Gateway 0.53.0+. */
|
|
1428
|
+
message(body: T.A2ASendRequest, opts?: RequestOptions): Promise<T.A2AResult>;
|
|
1429
|
+
/** Send a message and stream the answer as it is produced. Server-sent events, one per protocol frame — `task`, `status`, `artifact`, `message`, then `done` with the final result (or `error`). Each event carries the task as it stands, so a chunked artifact arrives whole rather than as fragments the caller must reassemble. Requires the agent to advertise `capabilities.streaming`. — Requires the gateway token. Gateway 0.53.0+. */
|
|
1430
|
+
stream(body: T.A2ASendRequest, opts?: RequestOptions): AsyncIterable<SseFrame<unknown>>;
|
|
1431
|
+
/** Poll or cancel a task on a remote agent. — Requires the gateway token. Gateway 0.53.0+. */
|
|
1432
|
+
task(body: {
|
|
1433
|
+
id: string;
|
|
1434
|
+
url?: string;
|
|
1435
|
+
card?: T.AgentCard;
|
|
1436
|
+
/** Cancel instead of polling. */
|
|
1437
|
+
cancel?: boolean;
|
|
1438
|
+
auth?: string;
|
|
1439
|
+
}, opts?: RequestOptions): Promise<T.A2AResult>;
|
|
1440
|
+
/** Every remote agent this gateway has spoken to. What the audit lists — an agent a person connected is a host this machine talks to. — Requires the gateway token. Gateway 0.53.0+. */
|
|
1441
|
+
agents(opts?: RequestOptions): Promise<{
|
|
1442
|
+
agents: Array<{
|
|
1443
|
+
[key: string]: unknown;
|
|
1444
|
+
}>;
|
|
1445
|
+
}>;
|
|
1446
|
+
}
|
|
1262
1447
|
/** Several models as one — union, draft + target, fallback. */
|
|
1263
1448
|
export declare class FusionsApi {
|
|
1264
1449
|
private readonly rt;
|
|
@@ -1284,5 +1469,6 @@ export declare function buildApi(rt: Runtime): {
|
|
|
1284
1469
|
retrieval: RetrievalApi;
|
|
1285
1470
|
engines: EnginesApi;
|
|
1286
1471
|
skills: SkillsApi;
|
|
1472
|
+
a2a: A2aApi;
|
|
1287
1473
|
fusions: FusionsApi;
|
|
1288
1474
|
};
|
package/dist/api.generated.js
CHANGED
|
@@ -75,6 +75,16 @@ 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
|
+
"a2a.card": { id: "a2a.card", method: "POST", path: "/a2a/card", auth: "token", since: "0.53.0", stream: null, pathParams: [], queryParams: [] },
|
|
80
|
+
"a2a.message": { id: "a2a.message", method: "POST", path: "/a2a/message", auth: "token", since: "0.53.0", stream: null, pathParams: [], queryParams: [] },
|
|
81
|
+
"a2a.stream": { id: "a2a.stream", method: "POST", path: "/a2a/message/stream", auth: "token", since: "0.53.0", stream: "sse", pathParams: [], queryParams: [] },
|
|
82
|
+
"a2a.task": { id: "a2a.task", method: "POST", path: "/a2a/task", auth: "token", since: "0.53.0", stream: null, pathParams: [], queryParams: [] },
|
|
83
|
+
"a2a.agents": { id: "a2a.agents", method: "GET", path: "/a2a/agents", auth: "token", since: "0.53.0", stream: null, pathParams: [], queryParams: [] },
|
|
84
|
+
"agents.listDefs": { id: "agents.listDefs", method: "GET", path: "/agent-defs", auth: "open", since: "0.48.0", stream: null, pathParams: [], queryParams: ["workdir", "dir"] },
|
|
85
|
+
"agents.getDef": { id: "agents.getDef", method: "GET", path: "/agent-defs/{agentId}", auth: "open", since: "0.48.0", stream: null, pathParams: ["agentId"], queryParams: ["workdir"] },
|
|
86
|
+
"agents.exportPlan": { id: "agents.exportPlan", method: "POST", path: "/agent-defs/export-plan", auth: "token", since: "0.48.0", stream: null, pathParams: [], queryParams: [] },
|
|
87
|
+
"agents.exportDef": { id: "agents.exportDef", method: "POST", path: "/agent-defs/export", auth: "token", since: "0.48.0", stream: null, pathParams: [], queryParams: [] },
|
|
78
88
|
"skills.list": { id: "skills.list", method: "GET", path: "/skills", auth: "open", since: "0.6.64", stream: null, pathParams: [], queryParams: ["workdir"] },
|
|
79
89
|
"skills.get": { id: "skills.get", method: "GET", path: "/skills/{skillId}", auth: "open", since: "0.6.67", stream: null, pathParams: ["skillId"], queryParams: ["workdir"] },
|
|
80
90
|
"fusions.list": { id: "fusions.list", method: "GET", path: "/v1/fusions", auth: "open", since: "0.33.0", stream: null, pathParams: [], queryParams: [] },
|
|
@@ -377,6 +387,22 @@ export class AgentsApi {
|
|
|
377
387
|
rate(agentId, body, opts) {
|
|
378
388
|
return this.rt.request(OPERATIONS["agents.rate"], { path: { agentId }, query: undefined, headers: opts?.headers, body: body, opts });
|
|
379
389
|
}
|
|
390
|
+
/** 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+. */
|
|
391
|
+
listDefs(query, opts) {
|
|
392
|
+
return this.rt.request(OPERATIONS["agents.listDefs"], { path: {}, query: query, headers: opts?.headers, body: undefined, opts });
|
|
393
|
+
}
|
|
394
|
+
/** One agent definition, prompt included. — Gateway 0.48.0+. */
|
|
395
|
+
getDef(agentId, query, opts) {
|
|
396
|
+
return this.rt.request(OPERATIONS["agents.getDef"], { path: { agentId }, query: query, headers: opts?.headers, body: undefined, opts });
|
|
397
|
+
}
|
|
398
|
+
/** 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+. */
|
|
399
|
+
exportPlan(body, opts) {
|
|
400
|
+
return this.rt.request(OPERATIONS["agents.exportPlan"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
401
|
+
}
|
|
402
|
+
/** 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+. */
|
|
403
|
+
exportDef(body, opts) {
|
|
404
|
+
return this.rt.request(OPERATIONS["agents.exportDef"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
405
|
+
}
|
|
380
406
|
}
|
|
381
407
|
/** The small non-generative models this gateway provides — discovery, and one standard signature per capability (docs/capability-endpoints.md). */
|
|
382
408
|
export class CapabilitiesApi {
|
|
@@ -462,6 +488,10 @@ export class EnginesApi {
|
|
|
462
488
|
export class SkillsApi {
|
|
463
489
|
rt;
|
|
464
490
|
constructor(rt) { this.rt = rt; }
|
|
491
|
+
/** 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+. */
|
|
492
|
+
quarantined(query, opts) {
|
|
493
|
+
return this.rt.request(OPERATIONS["skills.quarantined"], { path: {}, query: query, headers: opts?.headers, body: undefined, opts });
|
|
494
|
+
}
|
|
465
495
|
/** The skills on this machine — with a prompt character count, not the prompt. — Gateway 0.6.64+. */
|
|
466
496
|
list(query, opts) {
|
|
467
497
|
return this.rt.request(OPERATIONS["skills.list"], { path: {}, query: query, headers: opts?.headers, body: undefined, opts });
|
|
@@ -471,6 +501,31 @@ export class SkillsApi {
|
|
|
471
501
|
return this.rt.request(OPERATIONS["skills.get"], { path: { skillId }, query: query, headers: opts?.headers, body: undefined, opts });
|
|
472
502
|
}
|
|
473
503
|
}
|
|
504
|
+
/** Remote agents reached over the Agent2Agent protocol — discovery, messages, tasks. */
|
|
505
|
+
export class A2aApi {
|
|
506
|
+
rt;
|
|
507
|
+
constructor(rt) { this.rt = rt; }
|
|
508
|
+
/** Fetch a remote agent's card, revalidating the one already held. The gateway is the only component allowed to reach a remote agent: every outbound host goes through its SSRF guard, and a card names the endpoints this machine will then talk to. Cached per §8.6 — an ETag is revalidated with `If-None-Match`, so `fresh: false` means the peer answered 304 and the card is unchanged. Plain HTTP is refused for a remote host; loopback is not. — Requires the gateway token. Gateway 0.53.0+. */
|
|
509
|
+
card(body, opts) {
|
|
510
|
+
return this.rt.request(OPERATIONS["a2a.card"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
511
|
+
}
|
|
512
|
+
/** Send a message to a remote agent and wait for the answer. The reply is a TASK or a MESSAGE — an agent that can answer at once returns a message and no task is ever created, so `kind` says which. `text` and `needs` are derived here rather than by each caller: `needs` is `answer` for an input stop and `approval` for an authorization one, and telling a caller to send a message when approval is wanted is how a task sits forever with both ends waiting. — Requires the gateway token. Gateway 0.53.0+. */
|
|
513
|
+
message(body, opts) {
|
|
514
|
+
return this.rt.request(OPERATIONS["a2a.message"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
515
|
+
}
|
|
516
|
+
/** Send a message and stream the answer as it is produced. Server-sent events, one per protocol frame — `task`, `status`, `artifact`, `message`, then `done` with the final result (or `error`). Each event carries the task as it stands, so a chunked artifact arrives whole rather than as fragments the caller must reassemble. Requires the agent to advertise `capabilities.streaming`. — Requires the gateway token. Gateway 0.53.0+. */
|
|
517
|
+
stream(body, opts) {
|
|
518
|
+
return this.rt.stream(OPERATIONS["a2a.stream"], { path: {}, query: undefined, headers: opts?.headers, opts });
|
|
519
|
+
}
|
|
520
|
+
/** Poll or cancel a task on a remote agent. — Requires the gateway token. Gateway 0.53.0+. */
|
|
521
|
+
task(body, opts) {
|
|
522
|
+
return this.rt.request(OPERATIONS["a2a.task"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
|
|
523
|
+
}
|
|
524
|
+
/** Every remote agent this gateway has spoken to. What the audit lists — an agent a person connected is a host this machine talks to. — Requires the gateway token. Gateway 0.53.0+. */
|
|
525
|
+
agents(opts) {
|
|
526
|
+
return this.rt.request(OPERATIONS["a2a.agents"], { path: {}, query: undefined, headers: opts?.headers, body: undefined, opts });
|
|
527
|
+
}
|
|
528
|
+
}
|
|
474
529
|
/** Several models as one — union, draft + target, fallback. */
|
|
475
530
|
export class FusionsApi {
|
|
476
531
|
rt;
|
|
@@ -499,6 +554,7 @@ export function buildApi(rt) {
|
|
|
499
554
|
retrieval: new RetrievalApi(rt),
|
|
500
555
|
engines: new EnginesApi(rt),
|
|
501
556
|
skills: new SkillsApi(rt),
|
|
557
|
+
a2a: new A2aApi(rt),
|
|
502
558
|
fusions: new FusionsApi(rt),
|
|
503
559
|
};
|
|
504
560
|
}
|
|
@@ -780,6 +780,136 @@ export interface Project {
|
|
|
780
780
|
jobs?: Array<AnyObject>;
|
|
781
781
|
[key: string]: unknown;
|
|
782
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 A2A Agent Card (protocol 1.0). Unknown fields are preserved, so a card from a later spec round-trips. */
|
|
791
|
+
export interface AgentCard {
|
|
792
|
+
name: string;
|
|
793
|
+
description: string;
|
|
794
|
+
version: string;
|
|
795
|
+
supportedInterfaces?: Array<{
|
|
796
|
+
url?: string;
|
|
797
|
+
/** JSONRPC, GRPC, HTTP+JSON — an open string, so an unknown binding is carried. */
|
|
798
|
+
protocolBinding?: string;
|
|
799
|
+
protocolVersion?: string;
|
|
800
|
+
/** Echoed on every request to this interface when set. */
|
|
801
|
+
tenant?: string;
|
|
802
|
+
}>;
|
|
803
|
+
provider?: {
|
|
804
|
+
organization?: string;
|
|
805
|
+
url?: string;
|
|
806
|
+
};
|
|
807
|
+
capabilities?: {
|
|
808
|
+
streaming?: boolean;
|
|
809
|
+
pushNotifications?: boolean;
|
|
810
|
+
extendedAgentCard?: boolean;
|
|
811
|
+
[key: string]: unknown;
|
|
812
|
+
};
|
|
813
|
+
defaultInputModes?: Array<string>;
|
|
814
|
+
defaultOutputModes?: Array<string>;
|
|
815
|
+
skills?: Array<{
|
|
816
|
+
[key: string]: unknown;
|
|
817
|
+
}>;
|
|
818
|
+
iconUrl?: string;
|
|
819
|
+
documentationUrl?: string;
|
|
820
|
+
[key: string]: unknown;
|
|
821
|
+
}
|
|
822
|
+
/** Either `url` or `card` identifies the agent; either `text` or `message` is what to say. */
|
|
823
|
+
export interface A2ASendRequest {
|
|
824
|
+
url?: string;
|
|
825
|
+
card?: AgentCard;
|
|
826
|
+
/** Shorthand for a one-part text message. */
|
|
827
|
+
text?: string;
|
|
828
|
+
/** A full A2A Message. */
|
|
829
|
+
message?: {
|
|
830
|
+
[key: string]: unknown;
|
|
831
|
+
};
|
|
832
|
+
/** Groups related interactions. */
|
|
833
|
+
contextId?: string;
|
|
834
|
+
/** Continues an existing task — how an input or auth stop is answered. */
|
|
835
|
+
taskId?: string;
|
|
836
|
+
/** Do not wait for a terminal or interrupted state. */
|
|
837
|
+
returnImmediately?: boolean;
|
|
838
|
+
auth?: string;
|
|
839
|
+
}
|
|
840
|
+
/** The reply, plus the two facts every caller derives — done, and what a person must do. */
|
|
841
|
+
export interface A2AResult {
|
|
842
|
+
ok?: boolean;
|
|
843
|
+
/** A2A returns one or the other; an agent answering at once creates no task. */
|
|
844
|
+
kind?: "task" | "message";
|
|
845
|
+
task?: {
|
|
846
|
+
[key: string]: unknown;
|
|
847
|
+
};
|
|
848
|
+
message?: {
|
|
849
|
+
[key: string]: unknown;
|
|
850
|
+
};
|
|
851
|
+
/** The answer as text — artifacts first, then what the agent actually said. */
|
|
852
|
+
text?: string;
|
|
853
|
+
done?: boolean;
|
|
854
|
+
/** `answer` for TASK_STATE_INPUT_REQUIRED, `approval` for TASK_STATE_AUTH_REQUIRED, null otherwise. */
|
|
855
|
+
needs?: "answer" | "approval";
|
|
856
|
+
}
|
|
857
|
+
/** An agent definition, read from whichever tool's dialect wrote it. */
|
|
858
|
+
export interface AgentDef {
|
|
859
|
+
id: string;
|
|
860
|
+
name?: string;
|
|
861
|
+
purpose?: string;
|
|
862
|
+
dialect?: "chatpanel" | "claude" | "codex" | "a2a";
|
|
863
|
+
/** The folder it was read from: chatpanel, claude, codex, agents-dir, external. */
|
|
864
|
+
source?: string;
|
|
865
|
+
label?: string;
|
|
866
|
+
/** Relative to the root it was found in. */
|
|
867
|
+
path?: string;
|
|
868
|
+
writable?: boolean;
|
|
869
|
+
engine?: {
|
|
870
|
+
[key: string]: unknown;
|
|
871
|
+
};
|
|
872
|
+
grants?: Array<string>;
|
|
873
|
+
skills?: Array<string>;
|
|
874
|
+
promptChars?: number;
|
|
875
|
+
/** Only on `GET /agent-defs/{agentId}`. */
|
|
876
|
+
prompt?: string;
|
|
877
|
+
/** What the dialect could not map — an unmapped tool is reported, never widened into a grant. */
|
|
878
|
+
warnings?: Array<string>;
|
|
879
|
+
scanned?: {
|
|
880
|
+
[key: string]: unknown;
|
|
881
|
+
};
|
|
882
|
+
[key: string]: unknown;
|
|
883
|
+
}
|
|
884
|
+
export interface AgentExportRequest {
|
|
885
|
+
agent: AgentDef;
|
|
886
|
+
/** The dialect to write. */
|
|
887
|
+
to: "claude" | "codex" | "chatpanel";
|
|
888
|
+
/** Only ever after a plan reported `theirs` and a person agreed. */
|
|
889
|
+
overwrite?: boolean;
|
|
890
|
+
}
|
|
891
|
+
export interface AgentExportPlan {
|
|
892
|
+
to?: string;
|
|
893
|
+
label?: string;
|
|
894
|
+
/** The exact file that would be written. */
|
|
895
|
+
path?: string;
|
|
896
|
+
/** Its rendered contents. */
|
|
897
|
+
text?: string;
|
|
898
|
+
exists?: boolean;
|
|
899
|
+
/** `theirs` means ChatPanel did not write it, or it has been edited since. */
|
|
900
|
+
status?: "new" | "ours" | "theirs";
|
|
901
|
+
fidelity?: AgentFidelity;
|
|
902
|
+
}
|
|
903
|
+
/** What survives a trip into a dialect, derived from what that dialect declares it can express. */
|
|
904
|
+
export interface AgentFidelity {
|
|
905
|
+
dialect?: string;
|
|
906
|
+
lossless?: boolean;
|
|
907
|
+
carried?: Array<string>;
|
|
908
|
+
dropped?: Array<{
|
|
909
|
+
field?: string;
|
|
910
|
+
why?: string;
|
|
911
|
+
}>;
|
|
912
|
+
}
|
|
783
913
|
export interface Skill {
|
|
784
914
|
id: string;
|
|
785
915
|
name?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.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",
|