@runappsai/agent 0.1.10 → 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/dist/chat.d.ts CHANGED
@@ -1,4 +1,6 @@
1
+ import { type FileDialog } from "./dom.js";
1
2
  import { type SelectBox } from "./select.js";
3
+ import { type ScheduleStore, type ScheduleLimits } from "./schedule.js";
2
4
  import { CHAT_PALETTES, type ChatPalette, type ChatVars } from "./chat-theme.js";
3
5
  import { Agent } from "./index.js";
4
6
  import type { ModelProvider, RunAppsClientLike, Workspace, AgentOptions, AgentUI, RunResult } from "./index.js";
@@ -102,6 +104,16 @@ export interface ChatOptions extends Omit<AgentOptions, "workspace"> {
102
104
  * text files go inline. `false` turns the feature off.
103
105
  */
104
106
  attachments?: boolean;
107
+ /**
108
+ * The dialog for picking files (attach, upload, skill zips) and saving
109
+ * them (downloads from the Files panel, the transcript). Default: the
110
+ * RunApps platform's dialog when the page has it (`puter.ui.openFiles` /
111
+ * `saveFile`, from the shim), which offers the user's files and this
112
+ * device; else the browser's own chooser and downloads. An app that
113
+ * loads the shim on first use passes its own; `false` keeps the
114
+ * browser's.
115
+ */
116
+ fileDialog?: FileDialog | false;
105
117
  /** Where attached files are saved in the directory (default `/uploads`). */
106
118
  uploadsDir?: string;
107
119
  /**
@@ -112,6 +124,24 @@ export interface ChatOptions extends Omit<AgentOptions, "workspace"> {
112
124
  * own; `false` hides it, `true` shows it anyway.
113
125
  */
114
126
  webSearch?: boolean;
127
+ /**
128
+ * Scheduled tasks (default off): a *Scheduled* button in the header lists
129
+ * them (add, edit, pause, run now, delete, open a task's conversation),
130
+ * and the agent gets tools to list, add, change and remove them. A task
131
+ * is a prompt run at set times — once, every N minutes, daily at a time
132
+ * (on chosen weekdays), or by cron — in a conversation of its own. They
133
+ * run only while the app is open, each when it is due and the chat is
134
+ * idle (nothing running, no question open, the user not typing); one
135
+ * missed while the page was closed runs once on the next visit. Kept per
136
+ * app in localStorage unless `store` is given. `minMinutes` (default 5)
137
+ * is the shortest repeat, `maxTasks` (default 20) the most tasks;
138
+ * `tools: false` leaves the agent without the tools (the user manages
139
+ * them alone).
140
+ */
141
+ schedule?: boolean | (ScheduleLimits & {
142
+ store?: ScheduleStore;
143
+ tools?: boolean;
144
+ });
115
145
  /**
116
146
  * Called when a link in the conversation (a reply, its thinking, a tool
117
147
  * card) is clicked, before the chat's own handling: return `true` when you
@@ -121,7 +151,16 @@ export interface ChatOptions extends Omit<AgentOptions, "workspace"> {
121
151
  onLink?: (href: string, text: string) => boolean | void;
122
152
  /** A tool card's file path becomes a link that calls this. */
123
153
  onOpenFile?: (path: string) => void;
124
- /** The "Tool permissions" choice in the settings panel (default on). `false` for an app that decides when to ask itself (its own settings, its tools' `confirm`). */
154
+ /**
155
+ * The user's say over tool permissions (default on): an "Always allow
156
+ * (this app)" answer on each permission question, which lets every tool
157
+ * run without asking from then on, and the "Tool permissions" choice in
158
+ * the settings panel, where it is turned off again. The choice is kept per app; the app's `permissions`
159
+ * ("ask" by default, "auto" to start in auto) is what a user who never
160
+ * chose gets. `false` for an app that decides when to ask itself (its own
161
+ * settings, its tools' `confirm`); hidden as well when `permissions` is a
162
+ * function or the chat was given its own `agent`.
163
+ */
125
164
  permissionsSetting?: boolean;
126
165
  /**
127
166
  * Your app's own state to put back on a rewind (an editor's text, a form):