@chatpanel/sdk 0.13.0 → 0.14.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.
@@ -342,6 +342,16 @@ export declare const OPERATIONS: {
342
342
  readonly pathParams: readonly [];
343
343
  readonly queryParams: readonly [];
344
344
  };
345
+ readonly "teams.stream": {
346
+ readonly id: "teams.stream";
347
+ readonly method: "GET";
348
+ readonly path: "/v1/teams/stream";
349
+ readonly auth: "token";
350
+ readonly since: "0.55.0";
351
+ readonly stream: "sse";
352
+ readonly pathParams: readonly [];
353
+ readonly queryParams: readonly [];
354
+ };
345
355
  readonly "teams.getRun": {
346
356
  readonly id: "teams.getRun";
347
357
  readonly method: "GET";
@@ -1070,6 +1080,8 @@ export declare class TeamsApi {
1070
1080
  ok: boolean;
1071
1081
  run: T.TeamRun;
1072
1082
  }>;
1083
+ /** Run changes, pushed — `hello` once, then a `run` notice whenever a run is created, moves or is removed. A Runs or Board view listens here and re-reads a run (`GET /v1/teams/runs/{runId}`) or the list only when a notice names one, instead of polling. Facts only — a task's streamed text never produces a notice. Staleness is judged by the clock, not by an event, so a view keeps a slow re-read beside the stream. — Requires the gateway token. Gateway 0.55.0+. */
1084
+ stream(opts?: RequestOptions): AsyncIterable<SseFrame<T.TeamsStreamEvent>>;
1073
1085
  /** One run, optionally with its events. — Gateway 0.6.78+. */
1074
1086
  getRun(runId: string, query?: {
1075
1087
  events?: boolean;
@@ -34,6 +34,7 @@ export const OPERATIONS = {
34
34
  "prefs.events": { id: "prefs.events", method: "GET", path: "/v1/prefs/events", auth: "open", since: "0.6.77", stream: "sse", pathParams: [], queryParams: [] },
35
35
  "teams.listRuns": { id: "teams.listRuns", method: "GET", path: "/v1/teams/runs", auth: "open", since: "0.6.78", stream: null, pathParams: [], queryParams: ["limit", "team"] },
36
36
  "teams.createRun": { id: "teams.createRun", method: "POST", path: "/v1/teams/runs", auth: "open", since: "0.6.78", stream: null, pathParams: [], queryParams: [] },
37
+ "teams.stream": { id: "teams.stream", method: "GET", path: "/v1/teams/stream", auth: "token", since: "0.55.0", stream: "sse", pathParams: [], queryParams: [] },
37
38
  "teams.getRun": { id: "teams.getRun", method: "GET", path: "/v1/teams/runs/{runId}", auth: "open", since: "0.6.78", stream: null, pathParams: ["runId"], queryParams: ["events"] },
38
39
  "teams.deleteRun": { id: "teams.deleteRun", method: "DELETE", path: "/v1/teams/runs/{runId}", auth: "open", since: "0.6.110", stream: null, pathParams: ["runId"], queryParams: [] },
39
40
  "teams.runEvents": { id: "teams.runEvents", method: "GET", path: "/v1/teams/runs/{runId}/events", auth: "open", since: "0.6.78", stream: "sse", pathParams: ["runId"], queryParams: ["after"] },
@@ -273,6 +274,10 @@ export class TeamsApi {
273
274
  createRun(body, opts) {
274
275
  return this.rt.request(OPERATIONS["teams.createRun"], { path: {}, query: undefined, headers: opts?.headers, body: body, opts });
275
276
  }
277
+ /** Run changes, pushed — `hello` once, then a `run` notice whenever a run is created, moves or is removed. A Runs or Board view listens here and re-reads a run (`GET /v1/teams/runs/{runId}`) or the list only when a notice names one, instead of polling. Facts only — a task's streamed text never produces a notice. Staleness is judged by the clock, not by an event, so a view keeps a slow re-read beside the stream. — Requires the gateway token. Gateway 0.55.0+. */
278
+ stream(opts) {
279
+ return this.rt.stream(OPERATIONS["teams.stream"], { path: {}, query: undefined, headers: opts?.headers, opts });
280
+ }
276
281
  /** One run, optionally with its events. — Gateway 0.6.78+. */
277
282
  getRun(runId, query, opts) {
278
283
  return this.rt.request(OPERATIONS["teams.getRun"], { path: { runId }, query: query, headers: opts?.headers, body: undefined, opts });
@@ -712,6 +712,15 @@ export interface HistoryStreamEvent {
712
712
  ids?: Array<string>;
713
713
  at?: number;
714
714
  }
715
+ export interface TeamsStreamEvent {
716
+ type: "hello" | "run";
717
+ /** On `hello`. */
718
+ at?: number;
719
+ /** The run that changed. */
720
+ id?: string;
721
+ /** True when the run left the store. */
722
+ removed?: boolean;
723
+ }
715
724
  export interface PrefsEvent {
716
725
  type: "hello" | "changed";
717
726
  revision?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/sdk",
3
- "version": "0.13.0",
3
+ "version": "0.14.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",