@runappsai/agent 0.1.11 → 0.1.15
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 +1 -1
- package/dist/agent-core.umd.js +90 -87
- package/dist/agent.d.ts +5 -1
- package/dist/agent.js +11 -7
- package/dist/agent.umd.js +130 -104
- package/dist/chat.d.ts +40 -1
- package/dist/chat.js +375 -16
- package/dist/dom.d.ts +28 -1
- package/dist/dom.js +38 -1
- package/dist/files-panel.js +2 -2
- package/dist/index.cjs +514 -37
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/schedule.d.ts +152 -0
- package/dist/schedule.js +505 -0
- package/dist/types.d.ts +3 -0
- package/dist/ui.cjs +932 -13
- package/dist/ui.d.ts +1 -0
- package/docs/chat-ui.md +23 -1
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -41,7 +41,11 @@ export declare class Agent {
|
|
|
41
41
|
private readonly loaded;
|
|
42
42
|
private createdAt;
|
|
43
43
|
/** The session's title, fixed once known (a later compaction must not turn it into the summary's first words). */
|
|
44
|
-
private
|
|
44
|
+
private fixedTitle;
|
|
45
|
+
/** The conversation's title as the session list shows it (the first thing the user wrote, unless `setTitle` fixed another); undefined before there is one. */
|
|
46
|
+
get title(): string | undefined;
|
|
47
|
+
/** Fixes the conversation's title (a scheduled task's name, say); saved with the session. */
|
|
48
|
+
setTitle(title: string): void;
|
|
45
49
|
private _ended;
|
|
46
50
|
private persist;
|
|
47
51
|
/** `provider`: a ModelProvider, or a RunApps SDK client (wrapped in runappsProvider). */
|
package/dist/agent.js
CHANGED
|
@@ -171,7 +171,11 @@ export class Agent {
|
|
|
171
171
|
loaded;
|
|
172
172
|
createdAt = Date.now();
|
|
173
173
|
/** The session's title, fixed once known (a later compaction must not turn it into the summary's first words). */
|
|
174
|
-
|
|
174
|
+
fixedTitle;
|
|
175
|
+
/** The conversation's title as the session list shows it (the first thing the user wrote, unless `setTitle` fixed another); undefined before there is one. */
|
|
176
|
+
get title() { return this.fixedTitle; }
|
|
177
|
+
/** Fixes the conversation's title (a scheduled task's name, say); saved with the session. */
|
|
178
|
+
setTitle(title) { this.fixedTitle = title.trim() || undefined; }
|
|
175
179
|
_ended = null;
|
|
176
180
|
persist;
|
|
177
181
|
/** `provider`: a ModelProvider, or a RunApps SDK client (wrapped in runappsProvider). */
|
|
@@ -240,7 +244,7 @@ export class Agent {
|
|
|
240
244
|
this.createdAt = data.createdAt ?? data.savedAt ?? Date.now();
|
|
241
245
|
this._ended = data.ended ?? null;
|
|
242
246
|
// Titles saved before titleOf skipped summaries and expanded commands are worked out again.
|
|
243
|
-
this.
|
|
247
|
+
this.fixedTitle = data.title && !isMachineTitle(data.title) ? data.title : undefined;
|
|
244
248
|
if (data.model && !this.opts.model) {
|
|
245
249
|
this.opts.model = data.model;
|
|
246
250
|
this.catalogue = null;
|
|
@@ -379,12 +383,12 @@ export class Agent {
|
|
|
379
383
|
savedAt: Date.now(),
|
|
380
384
|
...(this._ended ? { ended: this._ended } : {}),
|
|
381
385
|
};
|
|
382
|
-
if (!this.
|
|
386
|
+
if (!this.fixedTitle) {
|
|
383
387
|
const tt = titleOf(data);
|
|
384
388
|
if (tt !== UNTITLED)
|
|
385
|
-
this.
|
|
389
|
+
this.fixedTitle = tt;
|
|
386
390
|
}
|
|
387
|
-
data.title = this.
|
|
391
|
+
data.title = this.fixedTitle ?? UNTITLED;
|
|
388
392
|
return data;
|
|
389
393
|
}
|
|
390
394
|
/** Forgets the conversation (the workspace stays). */
|
|
@@ -392,7 +396,7 @@ export class Agent {
|
|
|
392
396
|
if (this.current)
|
|
393
397
|
throw new Error("cannot reset while a run is active; abort() first");
|
|
394
398
|
this.history = [];
|
|
395
|
-
this.
|
|
399
|
+
this.fixedTitle = undefined;
|
|
396
400
|
this._ended = null;
|
|
397
401
|
this.committed = 0;
|
|
398
402
|
this.droppedTurns = 0;
|
|
@@ -1281,7 +1285,7 @@ export class Agent {
|
|
|
1281
1285
|
if (question === false)
|
|
1282
1286
|
return true;
|
|
1283
1287
|
const { title, message, always, ok, body } = typeof question === "string" ? { title: question, message: undefined, always: undefined, ok: undefined, body: undefined } : question;
|
|
1284
|
-
return this.ui.confirm(title, message, { danger: !!tool.destructive, signal, always, ...(ok ? { ok } : {}), ...(body ? { body } : {}) });
|
|
1288
|
+
return this.ui.confirm(title, message, { danger: !!tool.destructive, signal, always, permission: true, ...(ok ? { ok } : {}), ...(body ? { body } : {}) });
|
|
1285
1289
|
}
|
|
1286
1290
|
/** After an abort, every open tool call gets a result so the transcript stays valid. */
|
|
1287
1291
|
closeOpenToolCalls() {
|