paseo-recap 0.1.0 → 0.2.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/OVERVIEW.md +2 -2
- package/README.md +22 -5
- package/client/settings-screen.tsx +6 -8
- package/index.server.ts +10 -7
- package/package.json +1 -1
- package/server/models.ts +80 -36
- package/server/paseo-types.ts +1 -0
- package/shared/recap.ts +5 -8
package/OVERVIEW.md
CHANGED
|
@@ -22,13 +22,13 @@ Open **Settings → Plugins → paseo-recap → Recap**.
|
|
|
22
22
|
- **Every N turns**, **Wait after a turn**, and **Start after** control when automatic recaps run.
|
|
23
23
|
- **Recent exchanges to read.** How many of your messages and the replies a recap reads, from 1 to 100. The default is 8.
|
|
24
24
|
- **Recap subagents** and **Wait for subagents.** Recap agents started by other agents, and hold a parent's recap while its subagents run, for up to 10 minutes.
|
|
25
|
-
- **Recap model.**
|
|
25
|
+
- **Recap model.** Recaps pick a model the way Paseo's metadata generation does: the models set in Paseo's metadata generation settings, then Paseo's small models that are installed, such as Claude Haiku. By default an agent whose own provider has one of those small models is recapped by it first. You can also choose any Claude, Codex, or OpenCode model by name. The settings page lists the exact models that will run.
|
|
26
26
|
|
|
27
27
|
## Data and permissions
|
|
28
28
|
|
|
29
29
|
A recap reads only the text of recent user and assistant messages, plus the agent's title and its current to-do item. It never reads tool output, file contents, or reasoning. That text goes to one model at a time, through its command line tool.
|
|
30
30
|
|
|
31
|
-
With **Same as agent** or **Metadata model**, a model that is unavailable or fails is followed by the next one: the agent's own provider first (for Same as agent), then the models in Paseo's metadata generation settings, then Claude Haiku,
|
|
31
|
+
With **Same as agent** or **Metadata model**, a model that is unavailable or fails is followed by the next one: the agent's own provider first (for Same as agent, when it has a small model), then the models in Paseo's metadata generation settings, then Paseo's small models that are installed (Claude Haiku, GPT-5.4 mini, MiniMax M3, Nemotron 3 Super). Any of those providers can therefore receive the conversation text. Unlike Paseo's own metadata generation, a recap never falls back to the agent's large model. Choosing Claude, Codex, or OpenCode sends recaps only to that provider, with no fallback.
|
|
32
32
|
|
|
33
33
|
Claude runs with no tools, MCP servers, or user settings. Codex runs in a read-only sandbox with your own Codex configuration, which includes any MCP servers you have set up there. OpenCode runs its read-only plan agent. Each run uses a temporary folder. Claude and Codex runs are not saved as sessions. OpenCode always saves one, and the plugin deletes it right after the run; if that deletion fails, the session stays in OpenCode.
|
|
34
34
|
|
package/README.md
CHANGED
|
@@ -16,9 +16,10 @@ OpenCode, OMP, Pi, and custom agents.
|
|
|
16
16
|
- **Recap pill on every agent.** Shows the latest recap's age; tap it to read, regenerate, or see
|
|
17
17
|
earlier recaps, or to generate one for an agent that has none yet. `/paseo-recap` does the same
|
|
18
18
|
(Claude agents keep Claude Code's own `/recap`).
|
|
19
|
-
- **
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
- **Picks a model like Paseo does.** Recaps use the same order as Paseo's metadata generation: your
|
|
20
|
+
metadata generation models, then Paseo's small models that are installed, such as Claude Haiku.
|
|
21
|
+
Never the agent's large model. Or choose any Claude, Codex, or OpenCode model; the settings screen
|
|
22
|
+
shows exactly which models will run.
|
|
22
23
|
- **Quiet and cheap.** About 40 words, from recent text only. Skips canceled turns, pending
|
|
23
24
|
permissions, context compaction, and providers near their usage limit. ~3 s and ~$0.002 per recap
|
|
24
25
|
with Claude Haiku.
|
|
@@ -87,8 +88,9 @@ Code, Codex, and OMP.
|
|
|
87
88
|
|
|
88
89
|
- Recaps send recent conversation text to one model at a time, using that CLI's login. With
|
|
89
90
|
**Same as agent** or **Metadata model**, a model that is unavailable or fails is followed by the
|
|
90
|
-
next: the agent's own provider, Paseo's metadata generation models,
|
|
91
|
-
|
|
91
|
+
next: the agent's own provider (when it has a small model), Paseo's metadata generation models,
|
|
92
|
+
then Paseo's installed small models, so any of them can receive that text. A specific provider
|
|
93
|
+
gets recaps only for itself.
|
|
92
94
|
- Claude runs with no tools, MCP servers, or settings. Codex runs in a read-only sandbox with your
|
|
93
95
|
own Codex configuration, including any MCP servers you set up there. OpenCode uses its read-only
|
|
94
96
|
`plan` agent, which rejects permission requests.
|
|
@@ -119,6 +121,21 @@ paseo plugin logs paseo-recap
|
|
|
119
121
|
| `client/` | Recap line, pill and card, settings screen |
|
|
120
122
|
| `shared/recap.ts` | Providers, settings schema, recap types, RPC contracts |
|
|
121
123
|
|
|
124
|
+
## Releasing
|
|
125
|
+
|
|
126
|
+
Releases publish to npm from GitHub Actions with [trusted publishing](https://docs.npmjs.com/trusted-publishers)
|
|
127
|
+
(OIDC), so no npm token is stored anywhere. The publish job runs in the `npm` GitHub environment,
|
|
128
|
+
which only `v*` tags can deploy to, and npm trusts only that environment. Bump `version` in `package.json` in a PR, merge it,
|
|
129
|
+
then tag the merged commit:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
git tag v0.2.0 && git push origin v0.2.0
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
[`.github/workflows/publish.yml`](.github/workflows/publish.yml) checks that the tag matches the
|
|
136
|
+
version, runs the type check and tests, and publishes with provenance. Once the paseo.sh listing
|
|
137
|
+
uses the npm package as its source, the registry proposes each new version automatically.
|
|
138
|
+
|
|
122
139
|
## License
|
|
123
140
|
|
|
124
141
|
[MIT](LICENSE)
|
|
@@ -40,9 +40,9 @@ const MODEL_SOURCE_OPTIONS: ReadonlyArray<{ label: string; value: ModelSource }>
|
|
|
40
40
|
];
|
|
41
41
|
|
|
42
42
|
const MODE_HINTS: Record<GeneratorMode, string> = {
|
|
43
|
-
auto: "Recaps use the agent's own provider, so the conversation stays with the vendor you chose.
|
|
43
|
+
auto: "Recaps use the agent's own provider when it has a small model, so the conversation stays with the vendor you chose. Otherwise they pick a model the way Paseo's Metadata generation does.",
|
|
44
44
|
metadata:
|
|
45
|
-
"Recaps
|
|
45
|
+
"Recaps pick a model the way Paseo's Metadata generation does: the models set there, then Paseo's small models that are installed.",
|
|
46
46
|
};
|
|
47
47
|
const CLI_HINT = " Runs the provider's CLI on this computer with your existing login.";
|
|
48
48
|
|
|
@@ -56,11 +56,9 @@ function modelSource(generator: RecapSettings["generator"]): ModelSource {
|
|
|
56
56
|
return isRecapProvider(generator.provider) ? generator.provider : "auto";
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/**
|
|
59
|
+
/** A provider without a model name uses its small model from Paseo's list, or the CLI default. */
|
|
60
60
|
function generatorFor(source: ModelSource): GeneratorMode | GeneratorChoice {
|
|
61
|
-
|
|
62
|
-
const model = RECAP_PROVIDERS[source].defaultModel;
|
|
63
|
-
return model ? { provider: source, model } : { provider: source };
|
|
61
|
+
return isRecapProvider(source) ? { provider: source } : source;
|
|
64
62
|
}
|
|
65
63
|
|
|
66
64
|
/**
|
|
@@ -253,9 +251,9 @@ function RecapSettingsForm({ settings }: { settings: ReadySettings }) {
|
|
|
253
251
|
// Remount per provider so the field shows the newly selected provider's model.
|
|
254
252
|
key={source}
|
|
255
253
|
label="Model name"
|
|
256
|
-
hint="Any model id the CLI accepts
|
|
254
|
+
hint="Any model id the CLI accepts. Leave empty for the provider's small model from Paseo's list, or the CLI's default."
|
|
257
255
|
initialValue={model}
|
|
258
|
-
placeholder="
|
|
256
|
+
placeholder="Small model"
|
|
259
257
|
disabled={false}
|
|
260
258
|
parse={(text) => {
|
|
261
259
|
const trimmed = text.trim();
|
package/index.server.ts
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./shared/recap";
|
|
15
15
|
import { errorMessage, RecapSkippedError } from "./server/errors";
|
|
16
16
|
import { RecapGenerator } from "./server/generators";
|
|
17
|
-
import { describeModelPlan, resolveCandidates, type
|
|
17
|
+
import { describeModelPlan, resolveCandidates, type GeneratorInputs } from "./server/models";
|
|
18
18
|
import type { PaseoApi } from "./server/paseo-types";
|
|
19
19
|
import { runProcess } from "./server/process";
|
|
20
20
|
import { RecapScheduler } from "./server/scheduler";
|
|
@@ -50,9 +50,12 @@ export default function contribute(server: PluginServerContext) {
|
|
|
50
50
|
return paseo;
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
const
|
|
54
|
-
const { config } = await api.config.get();
|
|
55
|
-
return {
|
|
53
|
+
const readGeneratorInputs = async (api: PaseoApi): Promise<GeneratorInputs> => {
|
|
54
|
+
const [{ config }, { entries }] = await Promise.all([api.config.get(), api.providers.snapshot()]);
|
|
55
|
+
return {
|
|
56
|
+
config: { metadataGeneration: config.metadataGeneration, providers: config.providers },
|
|
57
|
+
providers: entries,
|
|
58
|
+
};
|
|
56
59
|
};
|
|
57
60
|
|
|
58
61
|
const readSettings = async (): Promise<RecapSettings> => {
|
|
@@ -67,8 +70,8 @@ export default function contribute(server: PluginServerContext) {
|
|
|
67
70
|
readSettings,
|
|
68
71
|
log,
|
|
69
72
|
async generate(prompt, signal, { agentProvider, trigger }) {
|
|
70
|
-
const [
|
|
71
|
-
let candidates = resolveCandidates(current.generator,
|
|
73
|
+
const [inputs, current] = await Promise.all([readGeneratorInputs(requirePaseo()), readSettings()]);
|
|
74
|
+
let candidates = resolveCandidates(current.generator, inputs, agentProvider);
|
|
72
75
|
if (trigger === "auto" && candidates.length > 0) {
|
|
73
76
|
const nearLimit = await usage.nearLimit();
|
|
74
77
|
const allowed = candidates.filter((candidate) => !nearLimit.has(candidate.provider));
|
|
@@ -146,7 +149,7 @@ export default function contribute(server: PluginServerContext) {
|
|
|
146
149
|
});
|
|
147
150
|
server.handle(recapModelPlanRpc, async ({ generator }, context) => {
|
|
148
151
|
paseo = context.paseo;
|
|
149
|
-
return describeModelPlan(generator, await
|
|
152
|
+
return describeModelPlan(generator, await readGeneratorInputs(context.paseo));
|
|
150
153
|
});
|
|
151
154
|
server.handle(recapRegenerateRpc, async ({ agentId }, context) => {
|
|
152
155
|
paseo = context.paseo;
|
package/package.json
CHANGED
package/server/models.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isRecapProvider,
|
|
3
|
-
RECAP_PROVIDERS,
|
|
4
3
|
type GeneratorChoice,
|
|
5
4
|
type GeneratorMode,
|
|
6
5
|
type ModelPlan,
|
|
@@ -9,6 +8,13 @@ import {
|
|
|
9
8
|
} from "../shared/recap";
|
|
10
9
|
import { asRecord } from "./json";
|
|
11
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Paseo's built-in small models for one-shot text, tried after the configured metadata models.
|
|
13
|
+
* Mirrors DEFAULT_STRUCTURED_GENERATION_PROVIDERS in Paseo's server, which plugins cannot import.
|
|
14
|
+
* Each entry matches an installed model whose id or label contains it.
|
|
15
|
+
*/
|
|
16
|
+
const PASEO_SMALL_MODELS = ["haiku", "gpt-5.4-mini", "minimax-m3", "nemotron-3-super"] as const;
|
|
17
|
+
|
|
12
18
|
export interface GeneratorCandidate {
|
|
13
19
|
provider: RecapProvider;
|
|
14
20
|
model: string | null;
|
|
@@ -22,66 +28,104 @@ export interface GeneratorConfig {
|
|
|
22
28
|
providers?: Record<string, unknown>;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
provider
|
|
28
|
-
|
|
29
|
-
}
|
|
31
|
+
/** The parts of a Paseo provider snapshot entry that model selection reads. */
|
|
32
|
+
export interface ProviderModels {
|
|
33
|
+
provider: string;
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
models?: ReadonlyArray<{ id: string; label: string; isDefault?: boolean }>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface GeneratorInputs {
|
|
39
|
+
config: GeneratorConfig;
|
|
40
|
+
/** `paseo.providers.snapshot().entries`: the providers and models installed on this host. */
|
|
41
|
+
providers: readonly ProviderModels[];
|
|
42
|
+
}
|
|
30
43
|
|
|
31
44
|
/**
|
|
32
|
-
* Orders recap
|
|
33
|
-
*
|
|
34
|
-
*
|
|
45
|
+
* Orders recap models the way Paseo picks a model for metadata generation: the configured metadata
|
|
46
|
+
* models, then Paseo's small models that are installed. Unlike Paseo, the agent's own model is never
|
|
47
|
+
* a last resort, so a recap does not run on a large model. `auto` puts the agent's own provider first
|
|
48
|
+
* when it has one of those small models, keeping the conversation with the vendor already in use.
|
|
35
49
|
*/
|
|
36
50
|
export function resolveCandidates(
|
|
37
51
|
choice: GeneratorMode | GeneratorChoice,
|
|
38
|
-
|
|
52
|
+
inputs: GeneratorInputs,
|
|
39
53
|
agentProvider: string | null = null,
|
|
40
54
|
): GeneratorCandidate[] {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
ordered = paseoOrder;
|
|
55
|
+
const runnable = inputs.providers.filter(
|
|
56
|
+
(entry): entry is ProviderModels & { provider: RecapProvider } =>
|
|
57
|
+
entry.enabled && isRecapProvider(entry.provider),
|
|
58
|
+
);
|
|
59
|
+
const byProvider = new Map<string, ProviderModels>(runnable.map((entry) => [entry.provider, entry]));
|
|
60
|
+
let ordered: ModelRef[];
|
|
61
|
+
if (typeof choice === "object") {
|
|
62
|
+
const entry = byProvider.get(choice.provider);
|
|
63
|
+
ordered = [{ provider: choice.provider, model: choice.model ?? (entry ? smallModel(entry) : null) }];
|
|
51
64
|
} else {
|
|
52
|
-
|
|
65
|
+
const own = agentProvider ? byProvider.get(agentProvider) : undefined;
|
|
66
|
+
const ownSmall = own ? smallModel(own) : null;
|
|
67
|
+
ordered = [
|
|
68
|
+
...(choice === "auto" && own && ownSmall ? [{ provider: own.provider, model: ownSmall }] : []),
|
|
69
|
+
...configuredModels(inputs.config, byProvider),
|
|
70
|
+
...PASEO_SMALL_MODELS.flatMap((needle) => {
|
|
71
|
+
for (const entry of runnable) {
|
|
72
|
+
const model = entry.models?.find((candidate) => matches(candidate, needle));
|
|
73
|
+
if (model) return [{ provider: entry.provider, model: model.id }];
|
|
74
|
+
}
|
|
75
|
+
return [];
|
|
76
|
+
}),
|
|
77
|
+
];
|
|
53
78
|
}
|
|
54
79
|
const seen = new Set<string>();
|
|
55
80
|
const candidates: GeneratorCandidate[] = [];
|
|
56
|
-
for (const
|
|
57
|
-
if (!isRecapProvider(
|
|
58
|
-
const
|
|
59
|
-
if (providerConfig?.enabled === false) continue;
|
|
60
|
-
const model = entry.model ?? null;
|
|
61
|
-
const key = `${entry.provider}\u0000${model ?? ""}`;
|
|
81
|
+
for (const { provider, model } of ordered) {
|
|
82
|
+
if (!isRecapProvider(provider)) continue;
|
|
83
|
+
const key = `${provider}\u0000${model ?? ""}`;
|
|
62
84
|
if (seen.has(key)) continue;
|
|
63
85
|
seen.add(key);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
model,
|
|
67
|
-
command: configuredCommand(providerConfig?.command) ?? [entry.provider],
|
|
68
|
-
});
|
|
86
|
+
const providerConfig = asRecord(inputs.config.providers?.[provider]);
|
|
87
|
+
candidates.push({ provider, model, command: configuredCommand(providerConfig?.command) ?? [provider] });
|
|
69
88
|
}
|
|
70
89
|
return candidates;
|
|
71
90
|
}
|
|
72
91
|
|
|
73
92
|
/** Which models a setting resolves to, for the settings screen. Availability is checked at run time. */
|
|
74
|
-
export function describeModelPlan(choice: GeneratorMode | GeneratorChoice,
|
|
93
|
+
export function describeModelPlan(choice: GeneratorMode | GeneratorChoice, inputs: GeneratorInputs): ModelPlan {
|
|
75
94
|
const refs = (candidates: readonly GeneratorCandidate[]): ModelRef[] =>
|
|
76
95
|
candidates.map(({ provider, model }) => ({ provider, model }));
|
|
77
|
-
const fallback = refs(resolveCandidates(choice === "auto" ? "metadata" : choice,
|
|
96
|
+
const fallback = refs(resolveCandidates(choice === "auto" ? "metadata" : choice, inputs));
|
|
78
97
|
if (choice !== "auto") return { perProvider: [], fallback };
|
|
79
|
-
|
|
80
|
-
|
|
98
|
+
// What each provider's agents try first; a provider without a small model just uses the fallback.
|
|
99
|
+
const perProvider = inputs.providers.flatMap((entry) =>
|
|
100
|
+
refs(resolveCandidates("auto", inputs, entry.provider).slice(0, 1)).filter((ref) => ref.provider === entry.provider),
|
|
81
101
|
);
|
|
82
102
|
return { perProvider, fallback };
|
|
83
103
|
}
|
|
84
104
|
|
|
105
|
+
/** Configured metadata models on enabled providers; without a model, the provider's default model. */
|
|
106
|
+
function configuredModels(config: GeneratorConfig, byProvider: ReadonlyMap<string, ProviderModels>): ModelRef[] {
|
|
107
|
+
return (config.metadataGeneration?.providers ?? []).flatMap(({ provider, model }) => {
|
|
108
|
+
const entry = byProvider.get(provider);
|
|
109
|
+
if (!entry) return [];
|
|
110
|
+
const configured = model?.trim();
|
|
111
|
+
const fallback = entry.models?.find((candidate) => candidate.isDefault) ?? entry.models?.[0];
|
|
112
|
+
return [{ provider, model: configured || fallback?.id || null }];
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** The provider's first installed model from Paseo's small-model list, in list order. */
|
|
117
|
+
function smallModel(entry: ProviderModels): string | null {
|
|
118
|
+
for (const needle of PASEO_SMALL_MODELS) {
|
|
119
|
+
const model = entry.models?.find((candidate) => matches(candidate, needle));
|
|
120
|
+
if (model) return model.id;
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function matches(model: { id: string; label: string }, needle: string): boolean {
|
|
126
|
+
return [model.id, model.label].some((value) => value.toLowerCase().includes(needle));
|
|
127
|
+
}
|
|
128
|
+
|
|
85
129
|
function configuredCommand(value: unknown): readonly [string, ...string[]] | null {
|
|
86
130
|
if (typeof value === "string" && value.trim() !== "") return [value];
|
|
87
131
|
if (!Array.isArray(value)) return null;
|
package/server/paseo-types.ts
CHANGED
|
@@ -5,3 +5,4 @@ import type { PluginHookContext, PluginLifecycleEvents } from "@getpaseo/plugin/
|
|
|
5
5
|
|
|
6
6
|
export type PaseoApi = PluginHookContext["paseo"];
|
|
7
7
|
export type AgentTimelineItem = PluginLifecycleEvents["agent.turn_ended"]["timeline"][number];
|
|
8
|
+
export type ProviderSnapshotEntry = Awaited<ReturnType<PaseoApi["providers"]["snapshot"]>>["entries"][number];
|
package/shared/recap.ts
CHANGED
|
@@ -3,15 +3,12 @@ import { z } from "zod";
|
|
|
3
3
|
|
|
4
4
|
// Providers ------------------------------------------------------------------------------------
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* CLIs that can write recaps, each with the small, fast model it uses by default. OpenCode model
|
|
8
|
-
* ids depend on the user's own providers, so it uses its configured default.
|
|
9
|
-
*/
|
|
6
|
+
/** Providers whose CLI can write recaps. Models come from what Paseo reports as installed. */
|
|
10
7
|
export const RECAP_PROVIDERS = {
|
|
11
|
-
claude: { label: "Claude"
|
|
12
|
-
codex: { label: "Codex"
|
|
13
|
-
opencode: { label: "OpenCode"
|
|
14
|
-
} as const satisfies Record<string, { label: string
|
|
8
|
+
claude: { label: "Claude" },
|
|
9
|
+
codex: { label: "Codex" },
|
|
10
|
+
opencode: { label: "OpenCode" },
|
|
11
|
+
} as const satisfies Record<string, { label: string }>;
|
|
15
12
|
export type RecapProvider = keyof typeof RECAP_PROVIDERS;
|
|
16
13
|
|
|
17
14
|
export function isRecapProvider(value: string): value is RecapProvider {
|