@runappsai/agent 0.1.4 → 0.1.6
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-core.umd.js +67 -67
- package/dist/agent.js +3 -1
- package/dist/agent.umd.js +112 -112
- package/dist/chat.js +17 -7
- package/dist/context.js +11 -2
- package/dist/index.cjs +13 -3
- package/dist/ui.cjs +16 -6
- package/docs/chat-ui.md +1 -1
- package/docs/tools.md +1 -1
- package/package.json +1 -1
package/dist/chat.js
CHANGED
|
@@ -783,6 +783,7 @@ function parseAttachLine(line) {
|
|
|
783
783
|
const typedOf = (m) => m?.typed;
|
|
784
784
|
/** Added to the agent's instructions when it has a directory: how to hand a file to the user. */
|
|
785
785
|
const linksHint = (uploads) => `When you create or change a file for the user, name its absolute path in backticks (for example \`/index.html\`); in the chat that path becomes a link that opens the file. Files the user attaches arrive under ${uploads}.`;
|
|
786
|
+
const attachHint = (uploads) => `Files the user attaches arrive under ${uploads}.`;
|
|
786
787
|
const filesHint = (uploads) => `The user can browse, edit and download every file of the directory from the chat's Files panel. When you create or change a file for the user, name its absolute path in backticks (for example \`${uploads}/report.csv\`); in the chat that path becomes a link that opens the file, with a download button. Files the user attaches arrive under ${uploads}.`;
|
|
787
788
|
/** Text when the type or extension says so, or when the first 8 KB hold no NUL byte and decode as UTF-8. */
|
|
788
789
|
function decodeText(file, bytes) {
|
|
@@ -1075,6 +1076,9 @@ export function renderChat(target, opts) {
|
|
|
1075
1076
|
clearBtn.type = "button";
|
|
1076
1077
|
clearBtn.innerHTML = I.eraser() + `<span>${escapeHTML(t.clearChat)}</span>`;
|
|
1077
1078
|
clearBtn.style.display = "none";
|
|
1079
|
+
// One conversation, no list of them (sessions: false, or the host's own agent): Clear stands in for New chat, and shows only when there is something to clear.
|
|
1080
|
+
let oneChat = false;
|
|
1081
|
+
const syncClear = () => { clearBtn.style.display = oneChat && agent?.messages.length ? "" : "none"; };
|
|
1078
1082
|
// How full the context is, as a ring; a click opens the numbers and the spending.
|
|
1079
1083
|
const useBtn = h("button", "ra-btn ghost ra-usebtn");
|
|
1080
1084
|
useBtn.type = "button";
|
|
@@ -2396,6 +2400,7 @@ export function renderChat(target, opts) {
|
|
|
2396
2400
|
flush(true);
|
|
2397
2401
|
if (!messages.length)
|
|
2398
2402
|
showEmpty();
|
|
2403
|
+
syncClear();
|
|
2399
2404
|
list.scrollToBottom();
|
|
2400
2405
|
};
|
|
2401
2406
|
/* --- composer --- */
|
|
@@ -3505,7 +3510,7 @@ export function renderChat(target, opts) {
|
|
|
3505
3510
|
closeActive();
|
|
3506
3511
|
}
|
|
3507
3512
|
await new Promise((r) => setTimeout(r, 0));
|
|
3508
|
-
await (
|
|
3513
|
+
await (oneChat ? clearConversation() : newSession().then(() => undefined));
|
|
3509
3514
|
const b = agent;
|
|
3510
3515
|
if (summary) {
|
|
3511
3516
|
await b.seed(summary);
|
|
@@ -3616,7 +3621,7 @@ export function renderChat(target, opts) {
|
|
|
3616
3621
|
const lines = builtinCommands().map((c) => `- \`/${c.name}${c.args ? ` ${c.args}` : ""}\` — ${c.description}`);
|
|
3617
3622
|
addNote(t.cmdsTitle, [...lines, "", t.cmdsMore].join("\n"));
|
|
3618
3623
|
} },
|
|
3619
|
-
{ name: "new", aliases: ["clear"], run: () => { closeMenu(); return
|
|
3624
|
+
{ name: "new", aliases: ["clear"], run: () => { closeMenu(); return oneChat ? clearConversation() : newSession().then(() => undefined); } },
|
|
3620
3625
|
{ name: "resume", run: () => openMenu() },
|
|
3621
3626
|
{ name: "compact", args: t.cmdArgs.compact, run: async (focus) => { await compactNow(focus); } },
|
|
3622
3627
|
{ name: "continue", run: async () => {
|
|
@@ -3703,8 +3708,8 @@ export function renderChat(target, opts) {
|
|
|
3703
3708
|
];
|
|
3704
3709
|
/** The built-ins this chat offers now (the files, settings and debug ones only where their button shows). */
|
|
3705
3710
|
const builtinCommands = () => builtins
|
|
3706
|
-
.filter((b) => (b.name !== "files" || (!!agent?.workspace && filesOpt !== false)) && (b.name !== "settings" || hasSettings) && (b.name !== "debug" || debugOn) && (b.name !== "resume" || (!givenAgent && !!agent?.workspace &&
|
|
3707
|
-
.map((b) => ({ name: b.name, description: b.name === "new" &&
|
|
3711
|
+
.filter((b) => (b.name !== "files" || (!!agent?.workspace && filesOpt !== false)) && (b.name !== "settings" || hasSettings) && (b.name !== "debug" || debugOn) && (b.name !== "resume" || (!givenAgent && !!agent?.workspace && !oneChat)))
|
|
3712
|
+
.map((b) => ({ name: b.name, description: b.name === "new" && oneChat ? t.confirmClear.split(/[??]/)[0] : t.cmd[b.name] ?? "", kind: t.command, args: b.args, builtin: true }));
|
|
3708
3713
|
/** `/name [arg]` naming a built-in: run it here (nothing goes to the model). */
|
|
3709
3714
|
const runBuiltin = (text) => {
|
|
3710
3715
|
const m = /^\/(\S+)(?:\s+([\s\S]*))?$/.exec(text);
|
|
@@ -3862,7 +3867,8 @@ export function renderChat(target, opts) {
|
|
|
3862
3867
|
// A host's own agent has no sessions to switch between: the chat cannot make a new one.
|
|
3863
3868
|
const hasSessions = !givenAgent && (sessions ?? !!a.workspace);
|
|
3864
3869
|
histBtn.style.display = newBtn.style.display = hasSessions && a.workspace ? "" : "none";
|
|
3865
|
-
|
|
3870
|
+
oneChat = !(hasSessions && a.workspace);
|
|
3871
|
+
syncClear();
|
|
3866
3872
|
filesBtn.style.display = a.workspace && filesOpt !== false ? "" : "none";
|
|
3867
3873
|
skillsBtn.style.display = a.workspace && skillsMenu !== false ? "" : "none";
|
|
3868
3874
|
panel.setWorkspace(a.workspace);
|
|
@@ -3877,6 +3883,7 @@ export function renderChat(target, opts) {
|
|
|
3877
3883
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3878
3884
|
const on = (name, fn) => unsub.push(a.on(name, fn));
|
|
3879
3885
|
on("run_start", (ev) => {
|
|
3886
|
+
syncClear();
|
|
3880
3887
|
// A prompt sent from here was drawn then (awaitingRow); one from a queued follow-up or the host is drawn now; continue() has none.
|
|
3881
3888
|
if (ev.message) {
|
|
3882
3889
|
if (awaitingRow && !awaitingRow.msg) {
|
|
@@ -4077,8 +4084,11 @@ export function renderChat(target, opts) {
|
|
|
4077
4084
|
const workspace = typeof wsOpt === "function" ? await wsOpt(sid) : wsOpt ?? null;
|
|
4078
4085
|
// The host's instructions may be a function (re-read every turn): the hint joins whatever it returns.
|
|
4079
4086
|
const base = agentOpts.instructions;
|
|
4080
|
-
|
|
4081
|
-
const
|
|
4087
|
+
// Only about what the model can do: no file tools, nothing about files (attachments then go into the message); read-only, only where attachments land.
|
|
4088
|
+
const fileOpt = agentOpts.fileTools;
|
|
4089
|
+
const writes = fileOpt === undefined || fileOpt === true || (Array.isArray(fileOpt) && (fileOpt.includes("write_file") || fileOpt.includes("edit_file")));
|
|
4090
|
+
const hint = fileOpt === false ? "" : !writes ? attachHint(uploadsDir) : filesOpt === false ? linksHint(uploadsDir) : filesHint(uploadsDir);
|
|
4091
|
+
const instructions = !workspace || !hint ? base : typeof base === "function" ? () => [base(), hint].filter(Boolean).join("\n\n") : [base, hint].filter(Boolean).join("\n\n");
|
|
4082
4092
|
const over = {};
|
|
4083
4093
|
if (userSettings.model)
|
|
4084
4094
|
over.model = userSettings.model;
|
package/dist/context.js
CHANGED
|
@@ -25,16 +25,25 @@ export function buildSystemPrompt(input) {
|
|
|
25
25
|
rules.push("For arithmetic, dates, counting, parsing or any other computation, run run_js instead of working it out in your head, and report the computed result.");
|
|
26
26
|
}
|
|
27
27
|
out.push("# How to work\n" + rules.map((r) => `- ${r}`).join("\n"));
|
|
28
|
+
// Only what the model can really call: a tool it does not have costs a failed turn.
|
|
29
|
+
const has = (name) => input.tools.some((t) => t.name === name);
|
|
28
30
|
if (input.workspaceDescription) {
|
|
31
|
+
const look = ["list_files", "read_file"].filter(has);
|
|
32
|
+
const uses = [
|
|
33
|
+
look.length ? `${look.join(" and ")} to look around` : "",
|
|
34
|
+
has("edit_file") ? "edit_file for small changes (each oldText must match exactly once)" : "",
|
|
35
|
+
has("write_file") ? "write_file for new files or rewrites" : "",
|
|
36
|
+
].filter(Boolean);
|
|
29
37
|
out.push("# Workspace\nYou have a file tree (absolute POSIX paths).\n" + input.workspaceDescription +
|
|
30
|
-
|
|
38
|
+
(uses.length ? `\nUse ${uses.join(", ")}.` : "") +
|
|
39
|
+
(has("write_file") && has("edit_file") ? " A reply has an output limit: a file longer than you can emit in one call is written in parts — write_file the first part, then edit_file to append the rest (oldText = the last lines written) — never one huge write_file." : "") +
|
|
31
40
|
(input.canWrite && input.memoryPath ? `\nTo remember something for later conversations (a preference, a decision, a fact about the user's project), append a short line to ${input.memoryPath}; it is shown to you at the start of every conversation.` : ""));
|
|
32
41
|
}
|
|
33
42
|
if (input.memory?.trim()) {
|
|
34
43
|
out.push(`# Memory\nYour notes from earlier conversations (${input.memoryPath ?? "/memory/notes.md"}):\n` + input.memory.trim());
|
|
35
44
|
}
|
|
36
45
|
const visible = input.skills.filter((s) => !s.disableModelInvocation);
|
|
37
|
-
if (visible.length) {
|
|
46
|
+
if (visible.length && has("read_file")) {
|
|
38
47
|
const esc = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
39
48
|
out.push("# Skills\nThe following skills provide specialized instructions for specific tasks.\nUse read_file to load a skill's file when the task matches its description.\nWhen a skill file references a relative path, resolve it against the skill directory (the folder of SKILL.md) and use that absolute path in tool calls." +
|
|
40
49
|
(input.hasSandbox
|
package/dist/index.cjs
CHANGED
|
@@ -293,9 +293,17 @@ ${input.agentsMd.trim()}
|
|
|
293
293
|
rules.push("For arithmetic, dates, counting, parsing or any other computation, run run_js instead of working it out in your head, and report the computed result.");
|
|
294
294
|
}
|
|
295
295
|
out.push("# How to work\n" + rules.map((r) => `- ${r}`).join("\n"));
|
|
296
|
+
const has = (name) => input.tools.some((t) => t.name === name);
|
|
296
297
|
if (input.workspaceDescription) {
|
|
298
|
+
const look = ["list_files", "read_file"].filter(has);
|
|
299
|
+
const uses = [
|
|
300
|
+
look.length ? `${look.join(" and ")} to look around` : "",
|
|
301
|
+
has("edit_file") ? "edit_file for small changes (each oldText must match exactly once)" : "",
|
|
302
|
+
has("write_file") ? "write_file for new files or rewrites" : ""
|
|
303
|
+
].filter(Boolean);
|
|
297
304
|
out.push(
|
|
298
|
-
"# Workspace\nYou have a file tree (absolute POSIX paths).\n" + input.workspaceDescription +
|
|
305
|
+
"# Workspace\nYou have a file tree (absolute POSIX paths).\n" + input.workspaceDescription + (uses.length ? `
|
|
306
|
+
Use ${uses.join(", ")}.` : "") + (has("write_file") && has("edit_file") ? " A reply has an output limit: a file longer than you can emit in one call is written in parts \u2014 write_file the first part, then edit_file to append the rest (oldText = the last lines written) \u2014 never one huge write_file." : "") + (input.canWrite && input.memoryPath ? `
|
|
299
307
|
To remember something for later conversations (a preference, a decision, a fact about the user's project), append a short line to ${input.memoryPath}; it is shown to you at the start of every conversation.` : "")
|
|
300
308
|
);
|
|
301
309
|
}
|
|
@@ -305,7 +313,7 @@ Your notes from earlier conversations (${input.memoryPath ?? "/memory/notes.md"}
|
|
|
305
313
|
` + input.memory.trim());
|
|
306
314
|
}
|
|
307
315
|
const visible = input.skills.filter((s) => !s.disableModelInvocation);
|
|
308
|
-
if (visible.length) {
|
|
316
|
+
if (visible.length && has("read_file")) {
|
|
309
317
|
const esc = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
310
318
|
out.push(
|
|
311
319
|
"# Skills\nThe following skills provide specialized instructions for specific tasks.\nUse read_file to load a skill's file when the task matches its description.\nWhen a skill file references a relative path, resolve it against the skill directory (the folder of SKILL.md) and use that absolute path in tool calls." + (input.hasSandbox ? "\nThe only runtime here is run_js (JavaScript in a sandbox: no shell, no Python, no network). A skill's scripts written for another language (Python, shell, Ruby\u2026) cannot be run as they are: read the script, port its logic to JavaScript and run that with run_js, keeping the same inputs, outputs and behaviour (fs.read for files the script reads; browser-safe APIs only \u2014 no npm imports, no subprocesses, no network); tell the user it was ported. If a script truly needs what the sandbox lacks (a binary, a network service), say so and do the part that can be done." : "\nThere is no runtime for scripts here: a skill's scripts (Python, shell, JavaScript\u2026) cannot be executed; follow their logic by hand where feasible and say so, or tell the user what cannot be done.") + "\n\n<available_skills>\n" + visible.map((s) => ` <skill>
|
|
@@ -3539,6 +3547,7 @@ function withoutMedia(messages, media, model) {
|
|
|
3539
3547
|
var emptyUsage = () => ({ total_cost: 0, prompt_tokens: 0, completion_tokens: 0, calls: 0 });
|
|
3540
3548
|
var abortedResult = () => ({ runId: "", reason: "aborted", text: "", usage: emptyUsage() });
|
|
3541
3549
|
var SKIPPED_STOP = "Skipped: the user stopped the run.";
|
|
3550
|
+
var FILE_TOOL_NAMES = /* @__PURE__ */ new Set(["read_file", "list_files", "search_files", "write_file", "edit_file", "move_file", "copy_file", "delete_file"]);
|
|
3542
3551
|
var balanceError = () => new ProviderError(402, "The reply was cut short because the balance could not cover a full answer; top up to continue", { code: "insufficient_balance" });
|
|
3543
3552
|
function raceAbort(p, signal) {
|
|
3544
3553
|
if (signal.aborted) {
|
|
@@ -4139,7 +4148,8 @@ var Agent = class {
|
|
|
4139
4148
|
appName: this.opts.appName,
|
|
4140
4149
|
instructions: typeof this.opts.instructions === "function" ? this.opts.instructions() : this.opts.instructions,
|
|
4141
4150
|
tools,
|
|
4142
|
-
|
|
4151
|
+
// run_js reaches the files too; with neither, the directory is only where the session is kept.
|
|
4152
|
+
workspaceDescription: ws && tools.some((t) => FILE_TOOL_NAMES.has(t.name) || t.name === "run_js") ? ws.describe() : void 0,
|
|
4143
4153
|
skills: ws ? await ws.skills() : [],
|
|
4144
4154
|
hasSandbox: tools.some((t) => t.name === "run_js"),
|
|
4145
4155
|
hasAskUser: tools.some((t) => t.name === "ask_user"),
|
package/dist/ui.cjs
CHANGED
|
@@ -3104,6 +3104,7 @@ function parseAttachLine(line) {
|
|
|
3104
3104
|
}
|
|
3105
3105
|
var typedOf = (m) => m?.typed;
|
|
3106
3106
|
var linksHint = (uploads) => `When you create or change a file for the user, name its absolute path in backticks (for example \`/index.html\`); in the chat that path becomes a link that opens the file. Files the user attaches arrive under ${uploads}.`;
|
|
3107
|
+
var attachHint = (uploads) => `Files the user attaches arrive under ${uploads}.`;
|
|
3107
3108
|
var filesHint = (uploads) => `The user can browse, edit and download every file of the directory from the chat's Files panel. When you create or change a file for the user, name its absolute path in backticks (for example \`${uploads}/report.csv\`); in the chat that path becomes a link that opens the file, with a download button. Files the user attaches arrive under ${uploads}.`;
|
|
3108
3109
|
function decodeText(file, bytes) {
|
|
3109
3110
|
const typed = /^text\//.test(file.type) || /json|xml|javascript|yaml|csv|svg/.test(file.type) || TEXT_EXT.test(file.name);
|
|
@@ -3381,6 +3382,10 @@ function renderChat(target, opts) {
|
|
|
3381
3382
|
clearBtn.type = "button";
|
|
3382
3383
|
clearBtn.innerHTML = I.eraser() + `<span>${escapeHTML(t.clearChat)}</span>`;
|
|
3383
3384
|
clearBtn.style.display = "none";
|
|
3385
|
+
let oneChat = false;
|
|
3386
|
+
const syncClear = () => {
|
|
3387
|
+
clearBtn.style.display = oneChat && agent?.messages.length ? "" : "none";
|
|
3388
|
+
};
|
|
3384
3389
|
const useBtn = h("button", "ra-btn ghost ra-usebtn");
|
|
3385
3390
|
useBtn.type = "button";
|
|
3386
3391
|
useBtn.style.display = "none";
|
|
@@ -4563,6 +4568,7 @@ function renderChat(target, opts) {
|
|
|
4563
4568
|
}
|
|
4564
4569
|
flush(true);
|
|
4565
4570
|
if (!messages.length) showEmpty();
|
|
4571
|
+
syncClear();
|
|
4566
4572
|
list.scrollToBottom();
|
|
4567
4573
|
};
|
|
4568
4574
|
let nextSuggestion = null;
|
|
@@ -5640,7 +5646,7 @@ ${c.text}` })));
|
|
|
5640
5646
|
closeActive();
|
|
5641
5647
|
}
|
|
5642
5648
|
await new Promise((r) => setTimeout(r, 0));
|
|
5643
|
-
await (
|
|
5649
|
+
await (oneChat ? clearConversation() : newSession().then(() => void 0));
|
|
5644
5650
|
const b = agent;
|
|
5645
5651
|
if (summary) {
|
|
5646
5652
|
await b.seed(summary);
|
|
@@ -5746,7 +5752,7 @@ ${c.text}` })));
|
|
|
5746
5752
|
} },
|
|
5747
5753
|
{ name: "new", aliases: ["clear"], run: () => {
|
|
5748
5754
|
closeMenu();
|
|
5749
|
-
return
|
|
5755
|
+
return oneChat ? clearConversation() : newSession().then(() => void 0);
|
|
5750
5756
|
} },
|
|
5751
5757
|
{ name: "resume", run: () => openMenu() },
|
|
5752
5758
|
{ name: "compact", args: t.cmdArgs.compact, run: async (focus) => {
|
|
@@ -5831,7 +5837,7 @@ ${c.text}` })));
|
|
|
5831
5837
|
else ui.notify(t.debugOff);
|
|
5832
5838
|
} }
|
|
5833
5839
|
];
|
|
5834
|
-
const builtinCommands = () => builtins.filter((b) => (b.name !== "files" || !!agent?.workspace && filesOpt !== false) && (b.name !== "settings" || hasSettings) && (b.name !== "debug" || debugOn) && (b.name !== "resume" || !givenAgent && !!agent?.workspace &&
|
|
5840
|
+
const builtinCommands = () => builtins.filter((b) => (b.name !== "files" || !!agent?.workspace && filesOpt !== false) && (b.name !== "settings" || hasSettings) && (b.name !== "debug" || debugOn) && (b.name !== "resume" || !givenAgent && !!agent?.workspace && !oneChat)).map((b) => ({ name: b.name, description: b.name === "new" && oneChat ? t.confirmClear.split(/[??]/)[0] : t.cmd[b.name] ?? "", kind: t.command, args: b.args, builtin: true }));
|
|
5835
5841
|
const runBuiltin = (text) => {
|
|
5836
5842
|
const m = /^\/(\S+)(?:\s+([\s\S]*))?$/.exec(text);
|
|
5837
5843
|
if (!m) return false;
|
|
@@ -5967,7 +5973,8 @@ ${c.text}` })));
|
|
|
5967
5973
|
modelEl.style.display = a.model ? "" : "none";
|
|
5968
5974
|
const hasSessions = !givenAgent && (sessions ?? !!a.workspace);
|
|
5969
5975
|
histBtn.style.display = newBtn.style.display = hasSessions && a.workspace ? "" : "none";
|
|
5970
|
-
|
|
5976
|
+
oneChat = !(hasSessions && a.workspace);
|
|
5977
|
+
syncClear();
|
|
5971
5978
|
filesBtn.style.display = a.workspace && filesOpt !== false ? "" : "none";
|
|
5972
5979
|
skillsBtn.style.display = a.workspace && skillsMenu !== false ? "" : "none";
|
|
5973
5980
|
panel.setWorkspace(a.workspace);
|
|
@@ -5979,6 +5986,7 @@ ${c.text}` })));
|
|
|
5979
5986
|
if (!givenAgent) writeLast(project, a.id);
|
|
5980
5987
|
const on = (name, fn) => unsub.push(a.on(name, fn));
|
|
5981
5988
|
on("run_start", (ev) => {
|
|
5989
|
+
syncClear();
|
|
5982
5990
|
if (ev.message) {
|
|
5983
5991
|
if (awaitingRow && !awaitingRow.msg) {
|
|
5984
5992
|
awaitingRow.msg = ev.message;
|
|
@@ -6147,8 +6155,10 @@ ${c.text}` })));
|
|
|
6147
6155
|
const sid = id ?? newId();
|
|
6148
6156
|
const workspace = typeof wsOpt === "function" ? await wsOpt(sid) : wsOpt ?? null;
|
|
6149
6157
|
const base = agentOpts.instructions;
|
|
6150
|
-
const
|
|
6151
|
-
const
|
|
6158
|
+
const fileOpt = agentOpts.fileTools;
|
|
6159
|
+
const writes = fileOpt === void 0 || fileOpt === true || Array.isArray(fileOpt) && (fileOpt.includes("write_file") || fileOpt.includes("edit_file"));
|
|
6160
|
+
const hint2 = fileOpt === false ? "" : !writes ? attachHint(uploadsDir) : filesOpt === false ? linksHint(uploadsDir) : filesHint(uploadsDir);
|
|
6161
|
+
const instructions = !workspace || !hint2 ? base : typeof base === "function" ? () => [base(), hint2].filter(Boolean).join("\n\n") : [base, hint2].filter(Boolean).join("\n\n");
|
|
6152
6162
|
const over = {};
|
|
6153
6163
|
if (userSettings.model) over.model = userSettings.model;
|
|
6154
6164
|
if (userSettings.maxTurns) over.maxTurns = userSettings.maxTurns;
|
package/docs/chat-ui.md
CHANGED
|
@@ -252,7 +252,7 @@ An app with one conversation per document or project turns the list off:
|
|
|
252
252
|
renderChat(el, { provider, workspace: projectWorkspace, sessions: false });
|
|
253
253
|
```
|
|
254
254
|
|
|
255
|
-
The header then has no *Chats* or *New chat*; a **Clear** button (after a confirmation) starts the conversation over — the messages, the queue and the usage go, the conversation keeps its id, the files stay. `/new` and `/clear` do the same, `/resume` is not offered, and `chat.clear()` does it from your code. A chat showing your own `agent` works the same way.
|
|
255
|
+
The header then has no *Chats* or *New chat*; a **Clear** button, shown once there is a conversation to clear, (after a confirmation) starts the conversation over — the messages, the queue and the usage go, the conversation keeps its id, the files stay. `/new` and `/clear` do the same, `/resume` is not offered, and `chat.clear()` does it from your code. A chat showing your own `agent` works the same way.
|
|
256
256
|
|
|
257
257
|
## Inside your app's layout
|
|
258
258
|
|
package/docs/tools.md
CHANGED
|
@@ -249,6 +249,6 @@ The agent does not change a file from a stale or partial view of it — the user
|
|
|
249
249
|
|
|
250
250
|
New files can always be written, and the model's own writes count as read. `fs.read` in `run_js` counts as reading. A file's version is its modified time, size and a fingerprint of its content (files over 4 MB: time and size), so even a same-size change in the same instant shows. What the model has read is forgotten when the conversation is compacted or rewound, since it no longer has those contents. Turn it all off with `readBeforeWrite: false`.
|
|
251
251
|
|
|
252
|
-
The file tools come with a workspace; `fileTools: ["read_file", "list_files", "search_files"]` gives a read-only agent, `fileTools: false` none.
|
|
252
|
+
The file tools come with a workspace; `fileTools: ["read_file", "list_files", "search_files"]` gives a read-only agent, `fileTools: false` none. The system prompt mentions only the file tools the model has; with none (and no `run_js`) it says nothing about the directory or its skills.
|
|
253
253
|
|
|
254
254
|
`sandboxTool(workspace, options)` and `runInSandbox(workspace, code, input)` are exported if you want the sandbox on its own.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runappsai/agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent harness: the model ↔ tool loop with a workspace, skills, sessions, compaction, a sandbox and a chat UI. Bring any OpenAI-compatible model provider (RunApps included); no runtime dependencies.",
|
|
6
6
|
"license": "MIT",
|