@runappsai/agent 0.1.15 → 0.2.1

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/agent.d.ts CHANGED
@@ -276,4 +276,24 @@ export declare class Agent {
276
276
  /** The model's context window in tokens (from the catalogue); same as `(await limits()).input`. */
277
277
  contextWindow(): Promise<number>;
278
278
  }
279
+ /**
280
+ * What the chat UI (`renderChat`) needs of an agent. `Agent` is one; a host
281
+ * may give `renderChat` its own object with these members instead — say one
282
+ * whose loop runs on a server, with `prompt` a request and the events relayed
283
+ * from a stream. Such an agent keeps three promises the UI relies on:
284
+ * - the objects in `messages` are stable: the message a `run_start` or
285
+ * `steered` event carried is the very object later found in `messages`;
286
+ * - `busy` is true from `run_start` until after `run_end`;
287
+ * - `rewind`, and `remove` / `clear` when it has them, emit `rewind` (or
288
+ * `history`) so the transcript is drawn again.
289
+ * The members in the second group belong to features a host can switch off
290
+ * (`queue`, `replyActions`, `clearButton`, `commands`, `debug` in ChatOptions);
291
+ * an agent without one of them must have its feature off.
292
+ */
293
+ export type ChatAgent = Pick<Agent, "id" | "provider" | "workspace" | "tools" | "messages" | "usage" | "lastEnd" | "busy" | "model" | "settings" | "title" | "on" | "ready" | "configure" | "prompt" | "abort" | "rewind" | "continue" | "compact" | "context" | "limits" | "modelInfo" | "accepts" | "compactionFor"> & Partial<Pick<Agent, "queued" | "steer" | "followUp" | "dequeue" | "remove" | "clear" | "summarize" | "seed" | "setTitle" | "systemPrompt">> & {
294
+ /** There are messages older than the first of `messages` that `loadOlder` can bring in. */
295
+ readonly hasOlder?: boolean;
296
+ /** Puts older messages before the ones in `messages`, then emits `history` (`reason: "older"`). */
297
+ loadOlder?(): Promise<void>;
298
+ };
279
299
  export {};