reasonally 0.7.0 → 0.8.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.
- package/README.md +1 -0
- package/dist/agent/session.js +1 -0
- package/dist/cli.js +1 -1
- package/dist/tui/args.js +20 -1
- package/dist/tui/start.js +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -138,6 +138,7 @@ Every conversation is saved as it happens, in `~/.config/reasonally/sessions/`.
|
|
|
138
138
|
```bash
|
|
139
139
|
reasonally --continue # pick up the last conversation in this folder
|
|
140
140
|
reasonally --resume # choose one
|
|
141
|
+
reasonally --resume <id> # reopen that one (the desktop app's Continue in terminal copies this)
|
|
141
142
|
```
|
|
142
143
|
|
|
143
144
|
When a conversation fills about 80% of the model's context window, earlier turns are summarized
|
package/dist/agent/session.js
CHANGED
|
@@ -462,6 +462,7 @@ export async function listSessions(dir) {
|
|
|
462
462
|
model: s.model,
|
|
463
463
|
costMicros: s.costMicros,
|
|
464
464
|
updatedAt: s.updatedAt,
|
|
465
|
+
createdAt: new Date(s.meta.createdAt),
|
|
465
466
|
}))
|
|
466
467
|
.sort((a, b) => b.updatedAt.getTime() - a.updatedAt.getTime() || b.id.localeCompare(a.id));
|
|
467
468
|
}
|
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ const HELP = `Run the coding agents you already use on Reasonally models.
|
|
|
12
12
|
|
|
13
13
|
Usage:
|
|
14
14
|
reasonally Start Reasonally's coding agent in this folder
|
|
15
|
-
(--model <id>, --plan, --yes, --continue, --resume, --no-web)
|
|
15
|
+
(--model <id>, --plan, --yes, --continue, --resume [id], --no-web)
|
|
16
16
|
reasonally login Log in through your browser (--no-browser: print the link)
|
|
17
17
|
reasonally <agent> [--model <id>] [agent args…]
|
|
18
18
|
reasonally models [search] List models you can use
|
package/dist/tui/args.js
CHANGED
|
@@ -6,6 +6,7 @@ export function parseAgentArgs(argv) {
|
|
|
6
6
|
plan: false,
|
|
7
7
|
continue: false,
|
|
8
8
|
resume: false,
|
|
9
|
+
resumeId: null,
|
|
9
10
|
noWeb: false,
|
|
10
11
|
};
|
|
11
12
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -30,7 +31,21 @@ export function parseAgentArgs(argv) {
|
|
|
30
31
|
args.continue = true;
|
|
31
32
|
}
|
|
32
33
|
else if (arg === "--resume" || arg === "-r") {
|
|
33
|
-
|
|
34
|
+
// An id may follow: `--resume <id>` opens that conversation, `--resume` alone picks one.
|
|
35
|
+
const value = argv[i + 1];
|
|
36
|
+
if (value && !value.startsWith("-")) {
|
|
37
|
+
args.resumeId = value;
|
|
38
|
+
i++;
|
|
39
|
+
}
|
|
40
|
+
else
|
|
41
|
+
args.resume = true;
|
|
42
|
+
}
|
|
43
|
+
else if (arg.startsWith("--resume=")) {
|
|
44
|
+
const value = arg.slice("--resume=".length);
|
|
45
|
+
if (value)
|
|
46
|
+
args.resumeId = value;
|
|
47
|
+
else
|
|
48
|
+
args.resume = true;
|
|
34
49
|
}
|
|
35
50
|
else if (arg === "--no-web") {
|
|
36
51
|
args.noWeb = true;
|
|
@@ -41,6 +56,10 @@ export function parseAgentArgs(argv) {
|
|
|
41
56
|
}
|
|
42
57
|
if (args.plan && args.yes)
|
|
43
58
|
return { ok: false, error: "Pick one of --plan and --yes." };
|
|
59
|
+
if (args.continue && (args.resume || args.resumeId))
|
|
60
|
+
return { ok: false, error: "Pick one of --continue and --resume." };
|
|
61
|
+
if (args.resumeId && !/^[\w.-]+$/.test(args.resumeId))
|
|
62
|
+
return { ok: false, error: `"${args.resumeId}" isn't a conversation id.` };
|
|
44
63
|
return { ok: true, args };
|
|
45
64
|
}
|
|
46
65
|
/** Bare `reasonally` opens the agent only in an interactive terminal; scripts still get help. */
|
package/dist/tui/start.js
CHANGED
|
@@ -84,6 +84,23 @@ export async function startTui(args, log) {
|
|
|
84
84
|
else if (!args.model)
|
|
85
85
|
model = models.find((m) => m.id === resume.model) ?? model;
|
|
86
86
|
}
|
|
87
|
+
// `--resume <id>`: that conversation, as the desktop app's Continue in terminal copies it.
|
|
88
|
+
let pickInstead = false;
|
|
89
|
+
if (args.resumeId) {
|
|
90
|
+
const target = (await listSessions(sessions)).find((s) => s.id === args.resumeId);
|
|
91
|
+
const holder = target ? await sessionHolder(target.path) : null;
|
|
92
|
+
resume = target && !holder ? await loadSession(target.path) : null;
|
|
93
|
+
if (holder)
|
|
94
|
+
startNotice = `${openElsewhere(holder)} Close it there to continue it here.`;
|
|
95
|
+
else if (!target) {
|
|
96
|
+
startNotice = "That conversation isn't in this folder. Pick one to resume.";
|
|
97
|
+
pickInstead = true;
|
|
98
|
+
}
|
|
99
|
+
else if (!resume)
|
|
100
|
+
startNotice = "That conversation couldn't be read.";
|
|
101
|
+
else if (!args.model)
|
|
102
|
+
model = models.find((m) => m.id === resume.model) ?? model;
|
|
103
|
+
}
|
|
87
104
|
const shell = shellFor(process.env).name;
|
|
88
105
|
const promptFor = (m) => systemPrompt({ cwd, home, platform: process.platform, shell, date: new Date(), model: m.id, branch }, instructions);
|
|
89
106
|
// This computer's conversations on the web (`reasonally sync`). Only a login syncs: a key from
|
|
@@ -128,7 +145,7 @@ export async function startTui(args, log) {
|
|
|
128
145
|
mcpErrors,
|
|
129
146
|
mcpConfigPath: mcpPath,
|
|
130
147
|
resume,
|
|
131
|
-
pickSession: args.resume,
|
|
148
|
+
pickSession: args.resume || pickInstead,
|
|
132
149
|
startNotice,
|
|
133
150
|
mode: args.plan ? "plan" : args.yes ? "full" : "ask",
|
|
134
151
|
web: args.noWeb ? WEB_OFF : DEFAULT_WEB_POLICY,
|