@shanepadgett/tau-agent 0.20.0 → 0.20.2
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.
|
@@ -5,13 +5,7 @@ import { homedir } from "node:os";
|
|
|
5
5
|
import { basename, dirname, extname, isAbsolute, join, resolve } from "node:path";
|
|
6
6
|
import { type Static, Type } from "typebox";
|
|
7
7
|
import { detectImageMimeType, editImage, generateImage, type EditImage, type GeneratedImage } from "./client.ts";
|
|
8
|
-
import {
|
|
9
|
-
OPENAI_IMAGE_MODEL,
|
|
10
|
-
OPENAI_PROVIDER,
|
|
11
|
-
XAI_IMAGE_MODEL,
|
|
12
|
-
XAI_PROVIDER,
|
|
13
|
-
type ImageProvider,
|
|
14
|
-
} from "./constants.ts";
|
|
8
|
+
import { OPENAI_IMAGE_MODEL, OPENAI_PROVIDER, XAI_IMAGE_MODEL, XAI_PROVIDER, type ImageProvider } from "./constants.ts";
|
|
15
9
|
|
|
16
10
|
const MAX_INPUT_BYTES = 50 * 1024 * 1024;
|
|
17
11
|
const MAX_INLINE_BYTES = 12 * 1024 * 1024;
|
|
@@ -75,7 +69,8 @@ export default function imageGenExtension(pi: ExtensionAPI): void {
|
|
|
75
69
|
}
|
|
76
70
|
|
|
77
71
|
const parentUsesXai =
|
|
78
|
-
ctx.model?.provider.toLowerCase() === XAI_PROVIDER ||
|
|
72
|
+
ctx.model?.provider.toLowerCase() === XAI_PROVIDER ||
|
|
73
|
+
ctx.model?.id.toLowerCase().includes("grok") === true;
|
|
79
74
|
const preferredProvider: ImageProvider = params.provider ?? (parentUsesXai ? "xai" : "openai");
|
|
80
75
|
const providers: readonly ImageProvider[] = params.provider
|
|
81
76
|
? [params.provider]
|
|
@@ -101,9 +96,7 @@ export default function imageGenExtension(pi: ExtensionAPI): void {
|
|
|
101
96
|
if (params.provider === "xai") {
|
|
102
97
|
throw new Error("xAI authentication is unavailable. Run /login xai and choose a login method.");
|
|
103
98
|
}
|
|
104
|
-
throw new Error(
|
|
105
|
-
"Image generation authentication is unavailable. Run /login for OpenAI Codex or xAI.",
|
|
106
|
-
);
|
|
99
|
+
throw new Error("Image generation authentication is unavailable. Run /login for OpenAI Codex or xAI.");
|
|
107
100
|
}
|
|
108
101
|
const model = provider === "openai" ? OPENAI_IMAGE_MODEL : XAI_IMAGE_MODEL;
|
|
109
102
|
const images: EditImage[] = [];
|
|
@@ -135,18 +135,13 @@ export default function subagentExtension(pi: ExtensionAPI): void {
|
|
|
135
135
|
const discovery = await discoverAgents(ctx.cwd, ctx.isProjectTrusted());
|
|
136
136
|
warn(discovery, ctx);
|
|
137
137
|
const lines = (await parentVisibleAgents(ctx, discovery)).map((agent) => `- ${agent.name}: ${agent.description}`);
|
|
138
|
-
const activeThreads = runtime.listThreads(ctx.cwd).map((thread) => {
|
|
139
|
-
const task = thread.initialTask.replace(/\s+/g, " ").trim();
|
|
140
|
-
return `- ${thread.id} (${thread.displayName} · ${thread.definition.name}): ${task.length <= 160 ? task : `${task.slice(0, 159)}…`}`;
|
|
141
|
-
});
|
|
142
|
-
const threadSection = activeThreads.length ? `\n\nActive reusable threads:\n${activeThreads.join("\n")}` : "";
|
|
143
138
|
const prompt = `## Subagents
|
|
144
139
|
Use \`subagent\` when an available agent matches a focused part of the task.
|
|
145
140
|
|
|
146
141
|
Available agents for this turn:
|
|
147
142
|
${lines.join("\n")}
|
|
148
143
|
|
|
149
|
-
Start a fresh thread with \`agent\` and \`task\`. Continue an existing thread with \`thread\` and \`task\`. Reuse a thread when feedback or follow-up work depends on its prior reads and reasoning. Start fresh for unrelated work or when its context is stale or oversized
|
|
144
|
+
Start a fresh thread with \`agent\` and \`task\`. Continue an existing thread with \`thread\` and \`task\`. Reuse a thread when feedback or follow-up work depends on its prior reads and reasoning. Start fresh for unrelated work or when its context is stale or oversized.
|
|
150
145
|
|
|
151
146
|
Pass \`files\` when exact relevant files are already known. Tau autoreads current line-numbered snapshots into that child turn before it starts.
|
|
152
147
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shanepadgett/tau-agent",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.2",
|
|
4
4
|
"description": "Tau is a custom agentic harness built with pi extensions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@shanepadgett/tau-tui": "0.20.
|
|
31
|
+
"@shanepadgett/tau-tui": "0.20.2",
|
|
32
32
|
"@toon-format/toon": "2.3.0",
|
|
33
33
|
"smol-toml": "1.7.0"
|
|
34
34
|
},
|