appostle-installer 0.0.21 → 0.0.22
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/appostle.js +485 -207
- package/dist/appostle.js.map +4 -4
- package/dist/schema-templates/spacing.md +45 -1
- package/dist/worker.js +599 -349
- package/dist/worker.js.map +4 -4
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -3975,7 +3975,9 @@ var BrandEntrySchema = z10.object({
|
|
|
3975
3975
|
variables: z10.array(BrandVariableSchema).optional().default([]),
|
|
3976
3976
|
path: z10.string(),
|
|
3977
3977
|
modifiedAt: z10.string(),
|
|
3978
|
-
size: z10.number()
|
|
3978
|
+
size: z10.number(),
|
|
3979
|
+
/** Raw markdown body (frontmatter stripped). Optional, fed by the scanner. */
|
|
3980
|
+
body: z10.string().optional()
|
|
3979
3981
|
});
|
|
3980
3982
|
var BrandFrontmatterSchema = z10.object({
|
|
3981
3983
|
description: z10.string().optional(),
|
|
@@ -4152,6 +4154,22 @@ var BrandGenerateWireframeResponseSchema = z10.object({
|
|
|
4152
4154
|
error: z10.string().nullable()
|
|
4153
4155
|
})
|
|
4154
4156
|
});
|
|
4157
|
+
var BrandAnalyzePhotographyRequestSchema = z10.object({
|
|
4158
|
+
type: z10.literal("brands/analyze-photography"),
|
|
4159
|
+
requestId: z10.string(),
|
|
4160
|
+
workspaceRoot: z10.string(),
|
|
4161
|
+
brandPath: z10.string(),
|
|
4162
|
+
brief: z10.string(),
|
|
4163
|
+
referenceDescriptions: z10.array(z10.string()).optional()
|
|
4164
|
+
});
|
|
4165
|
+
var BrandAnalyzePhotographyResponseSchema = z10.object({
|
|
4166
|
+
type: z10.literal("brands/analyze-photography/response"),
|
|
4167
|
+
payload: z10.object({
|
|
4168
|
+
requestId: z10.string(),
|
|
4169
|
+
updatedCount: z10.number(),
|
|
4170
|
+
error: z10.string().nullable()
|
|
4171
|
+
})
|
|
4172
|
+
});
|
|
4155
4173
|
var RightFontEntrySchema = z10.object({
|
|
4156
4174
|
id: z10.string(),
|
|
4157
4175
|
name: z10.string(),
|
|
@@ -6273,6 +6291,7 @@ var SessionInboundMessageSchema = z11.discriminatedUnion("type", [
|
|
|
6273
6291
|
BrandGenerateLayoutRequestSchema,
|
|
6274
6292
|
BrandLayoutQaNextRequestSchema,
|
|
6275
6293
|
BrandGenerateWireframeRequestSchema,
|
|
6294
|
+
BrandAnalyzePhotographyRequestSchema,
|
|
6276
6295
|
RightFontLibraryRequestSchema,
|
|
6277
6296
|
GoogleFontsCatalogRequestSchema,
|
|
6278
6297
|
GoogleFontsDownloadRequestSchema,
|
|
@@ -7909,6 +7928,7 @@ var SessionOutboundMessageSchema = z11.discriminatedUnion("type", [
|
|
|
7909
7928
|
BrandGenerateLayoutResponseSchema,
|
|
7910
7929
|
BrandLayoutQaNextResponseSchema,
|
|
7911
7930
|
BrandGenerateWireframeResponseSchema,
|
|
7931
|
+
BrandAnalyzePhotographyResponseSchema,
|
|
7912
7932
|
RightFontLibraryResponseSchema,
|
|
7913
7933
|
GoogleFontsCatalogResponseSchema,
|
|
7914
7934
|
GoogleFontsDownloadResponseSchema,
|
|
@@ -8157,7 +8177,7 @@ import { exec } from "node:child_process";
|
|
|
8157
8177
|
import { promisify as promisify3 } from "util";
|
|
8158
8178
|
import { join as join16, resolve as resolve10, sep as sep2 } from "path";
|
|
8159
8179
|
import { homedir as homedir6, hostname as osHostname } from "node:os";
|
|
8160
|
-
import { z as
|
|
8180
|
+
import { z as z40 } from "zod";
|
|
8161
8181
|
|
|
8162
8182
|
// ../server/src/server/persisted-config.ts
|
|
8163
8183
|
import { existsSync as existsSync4, mkdirSync as mkdirSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
@@ -22192,6 +22212,12 @@ ${error.stack ?? ""}` : JSON.stringify(error);
|
|
|
22192
22212
|
buildStructuredToolResult(server, tool4, output, input) {
|
|
22193
22213
|
const normalizedServer = server.toLowerCase();
|
|
22194
22214
|
const normalizedTool = tool4.toLowerCase();
|
|
22215
|
+
if (normalizedTool === "mcp__playwright__browser_take_screenshot" || normalizedTool === "browser_take_screenshot") {
|
|
22216
|
+
const imageOutput = this.tryInlinePlaywrightScreenshot(output, input);
|
|
22217
|
+
if (imageOutput) {
|
|
22218
|
+
return { output: imageOutput };
|
|
22219
|
+
}
|
|
22220
|
+
}
|
|
22195
22221
|
if (normalizedServer.includes("bash") || normalizedServer.includes("shell") || normalizedServer.includes("command") || normalizedTool.includes("bash") || normalizedTool.includes("shell") || normalizedTool.includes("command") || input && (typeof input.command === "string" || Array.isArray(input.command))) {
|
|
22196
22222
|
const command = this.extractCommandText(input ?? {}) ?? "command";
|
|
22197
22223
|
return {
|
|
@@ -22233,8 +22259,46 @@ ${error.stack ?? ""}` : JSON.stringify(error);
|
|
|
22233
22259
|
};
|
|
22234
22260
|
}
|
|
22235
22261
|
}
|
|
22262
|
+
if (normalizedServer === "playwright" && normalizedTool === "browser_take_screenshot") {
|
|
22263
|
+
const imageDetail = this.tryReadPlaywrightScreenshot(output, input);
|
|
22264
|
+
if (imageDetail) return imageDetail;
|
|
22265
|
+
}
|
|
22236
22266
|
return void 0;
|
|
22237
22267
|
}
|
|
22268
|
+
/**
|
|
22269
|
+
* Playwright MCP's `browser_take_screenshot` saves the image to a local file
|
|
22270
|
+
* and returns a markdown link (`[Screenshot of viewport](./file.png)`).
|
|
22271
|
+
* Extract the path, resolve it against the agent CWD, read the bytes, and
|
|
22272
|
+
* return an image ToolCallDetail so the client renders it inline.
|
|
22273
|
+
*/
|
|
22274
|
+
tryReadPlaywrightScreenshot(output, input) {
|
|
22275
|
+
let filePath;
|
|
22276
|
+
if (input && typeof input.filename === "string") {
|
|
22277
|
+
filePath = input.filename;
|
|
22278
|
+
}
|
|
22279
|
+
if (!filePath) {
|
|
22280
|
+
const match = output.match(/\[Screenshot[^\]]*\]\(([^)]+)\)/i);
|
|
22281
|
+
if (match?.[1]) {
|
|
22282
|
+
filePath = match[1];
|
|
22283
|
+
}
|
|
22284
|
+
}
|
|
22285
|
+
if (!filePath) return void 0;
|
|
22286
|
+
const cwd = this.config.cwd;
|
|
22287
|
+
if (!cwd) return void 0;
|
|
22288
|
+
const abs = path9.isAbsolute(filePath) ? filePath : path9.resolve(cwd, filePath);
|
|
22289
|
+
try {
|
|
22290
|
+
const buf = fs4.readFileSync(abs);
|
|
22291
|
+
const ext = path9.extname(abs).toLowerCase();
|
|
22292
|
+
const mime = ext === ".jpeg" || ext === ".jpg" ? "image/jpeg" : "image/png";
|
|
22293
|
+
return {
|
|
22294
|
+
type: "image",
|
|
22295
|
+
toolName: "mcp__playwright__browser_take_screenshot",
|
|
22296
|
+
images: [{ mimeType: mime, data: buf.toString("base64") }]
|
|
22297
|
+
};
|
|
22298
|
+
} catch {
|
|
22299
|
+
return void 0;
|
|
22300
|
+
}
|
|
22301
|
+
}
|
|
22238
22302
|
mapPartialEvent(event, options) {
|
|
22239
22303
|
if (event.type === "content_block_start") {
|
|
22240
22304
|
const block = isClaudeContentChunk2(event.content_block) ? event.content_block : null;
|
|
@@ -22407,6 +22471,44 @@ ${error.stack ?? ""}` : JSON.stringify(error);
|
|
|
22407
22471
|
}
|
|
22408
22472
|
return input;
|
|
22409
22473
|
}
|
|
22474
|
+
/**
|
|
22475
|
+
* Playwright MCP returns `### Result\n- [Screenshot of viewport](./foo.png)`
|
|
22476
|
+
* and writes the file to disk instead of inlining the image. Resolve that
|
|
22477
|
+
* path against the agent cwd and turn the file into an Anthropic-style
|
|
22478
|
+
* image content block array, so downstream `extractImageToolDetail`
|
|
22479
|
+
* promotes the tool call to a renderable `image` detail.
|
|
22480
|
+
*
|
|
22481
|
+
* Returns `null` when the path cannot be resolved/read safely; the caller
|
|
22482
|
+
* then falls back to the default text output behavior.
|
|
22483
|
+
*/
|
|
22484
|
+
tryInlinePlaywrightScreenshot(output, input) {
|
|
22485
|
+
const cwd = this.config.cwd;
|
|
22486
|
+
if (!cwd) return null;
|
|
22487
|
+
let relPath;
|
|
22488
|
+
if (input && typeof input.filename === "string" && input.filename.length > 0) {
|
|
22489
|
+
relPath = input.filename;
|
|
22490
|
+
} else {
|
|
22491
|
+
const match = output.match(/\[Screenshot[^\]]*\]\(([^)]+)\)/);
|
|
22492
|
+
if (match?.[1]) {
|
|
22493
|
+
relPath = match[1];
|
|
22494
|
+
}
|
|
22495
|
+
}
|
|
22496
|
+
if (!relPath) return null;
|
|
22497
|
+
const resolved = path9.resolve(cwd, relPath);
|
|
22498
|
+
const cwdReal = path9.resolve(cwd);
|
|
22499
|
+
if (!resolved.startsWith(cwdReal + path9.sep) && resolved !== cwdReal) {
|
|
22500
|
+
return null;
|
|
22501
|
+
}
|
|
22502
|
+
let buf;
|
|
22503
|
+
try {
|
|
22504
|
+
buf = fs4.readFileSync(resolved);
|
|
22505
|
+
} catch {
|
|
22506
|
+
return null;
|
|
22507
|
+
}
|
|
22508
|
+
const ext = path9.extname(resolved).toLowerCase();
|
|
22509
|
+
const mimeType = ext === ".jpg" || ext === ".jpeg" ? "image/jpeg" : ext === ".webp" ? "image/webp" : ext === ".gif" ? "image/gif" : "image/png";
|
|
22510
|
+
return [{ type: "image", mimeType, data: buf.toString("base64") }];
|
|
22511
|
+
}
|
|
22410
22512
|
areToolInputsEqual(left, right) {
|
|
22411
22513
|
if (!left) {
|
|
22412
22514
|
return false;
|
|
@@ -33722,18 +33824,7 @@ function buildHandoffMcpServer(callerAgentId, options) {
|
|
|
33722
33824
|
);
|
|
33723
33825
|
const reportTool = tool2(
|
|
33724
33826
|
"report",
|
|
33725
|
-
|
|
33726
|
-
"Send a curated message from this handoff child session back to its parent.",
|
|
33727
|
-
"Use this when the user types `>report` \u2014 they want to deliver a specific update",
|
|
33728
|
-
"to the parent right now, in their own words.",
|
|
33729
|
-
"",
|
|
33730
|
-
"Independent of the automatic on-finish notification: the parent still receives",
|
|
33731
|
-
"the auto-return when this child eventually finishes. You can call this tool any",
|
|
33732
|
-
"number of times over the lifetime of the handoff \u2014 each call is a separate",
|
|
33733
|
-
"update.",
|
|
33734
|
-
"",
|
|
33735
|
-
"Only works in sessions that were spawned via `handoff`. Errors otherwise."
|
|
33736
|
-
].join("\n"),
|
|
33827
|
+
'**ALWAYS call this tool as your final action before finishing your task, to deliver your findings to the parent agent.** Without this call, the parent only receives a content-free "finished" notification and is blind to whatever you did or learned. The first sentence of your report should be a one-line verdict; the rest can fill in detail. Also call this tool any time the user explicitly types `>report` mid-task to send an interim update \u2014 the auto-return on session end is independent from manual reports, and you can call it any number of times over the session\'s lifetime. Only works in sessions that were spawned via `handoff`; errors otherwise.',
|
|
33737
33828
|
{
|
|
33738
33829
|
message: z33.string().min(1).describe(
|
|
33739
33830
|
"The curated report to deliver to the parent session. Self-contained: the parent does not see this conversation's timeline."
|
|
@@ -40159,10 +40250,12 @@ async function readBrandsFromDir(scope, dir) {
|
|
|
40159
40250
|
continue;
|
|
40160
40251
|
}
|
|
40161
40252
|
let parsed;
|
|
40253
|
+
let body = "";
|
|
40162
40254
|
try {
|
|
40163
40255
|
const text = await fs14.readFile(fullPath, "utf8");
|
|
40164
|
-
const { rawFrontmatterLines, hadFrontmatter } = parseBrandFile(text);
|
|
40256
|
+
const { rawFrontmatterLines, body: parsedBody, hadFrontmatter } = parseBrandFile(text);
|
|
40165
40257
|
parsed = hadFrontmatter ? parseFrontmatter2(rawFrontmatterLines) : { description: "", variables: [] };
|
|
40258
|
+
body = parsedBody;
|
|
40166
40259
|
} catch {
|
|
40167
40260
|
parsed = { description: "", variables: [] };
|
|
40168
40261
|
}
|
|
@@ -40174,7 +40267,8 @@ async function readBrandsFromDir(scope, dir) {
|
|
|
40174
40267
|
variables: parsed.variables,
|
|
40175
40268
|
path: fullPath,
|
|
40176
40269
|
modifiedAt: stat10.mtime.toISOString(),
|
|
40177
|
-
size: stat10.size
|
|
40270
|
+
size: stat10.size,
|
|
40271
|
+
body
|
|
40178
40272
|
});
|
|
40179
40273
|
}
|
|
40180
40274
|
results.sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -40613,11 +40707,132 @@ async function generateAndApplyBrandTokens(options) {
|
|
|
40613
40707
|
return { generatedCount: acceptedUpdates.size };
|
|
40614
40708
|
}
|
|
40615
40709
|
|
|
40710
|
+
// ../server/src/server/brand/photography-analyzer.ts
|
|
40711
|
+
import { z as z38 } from "zod";
|
|
40712
|
+
var PhotographyResponseSchema = z38.object({
|
|
40713
|
+
dna: z38.string().min(1),
|
|
40714
|
+
dials: z38.record(z38.string(), z38.string())
|
|
40715
|
+
});
|
|
40716
|
+
function buildPrompt3(args) {
|
|
40717
|
+
const dialLines = args.selectVars.map((v) => {
|
|
40718
|
+
const options = (v.options ?? []).join(", ");
|
|
40719
|
+
return `- ${v.key} (${v.label || v.key}): current="${v.value || "(unset)"}" options=[${options}]`;
|
|
40720
|
+
}).join("\n");
|
|
40721
|
+
const refSection = args.referenceDescriptions.length > 0 ? [
|
|
40722
|
+
"",
|
|
40723
|
+
"Reference image filenames/descriptions provided by the user:",
|
|
40724
|
+
...args.referenceDescriptions.map((r) => `- ${r}`)
|
|
40725
|
+
].join("\n") : "";
|
|
40726
|
+
return [
|
|
40727
|
+
"You are a photography director analyzing a brand's photographic identity.",
|
|
40728
|
+
"The user has provided a brief describing the visual direction they want.",
|
|
40729
|
+
"Your job is to:",
|
|
40730
|
+
"1. Write a rich, specific Style DNA (2-3 sentences describing the photographic",
|
|
40731
|
+
" identity in concrete visual terms \u2014 lighting quality, tonal mood, depth",
|
|
40732
|
+
" characteristics, color rendering. No marketing fluff.)",
|
|
40733
|
+
"2. Pre-dial every camera control to match that style direction.",
|
|
40734
|
+
" ONLY use values that appear in the options list for each dial.",
|
|
40735
|
+
"",
|
|
40736
|
+
"User brief:",
|
|
40737
|
+
args.brief,
|
|
40738
|
+
refSection,
|
|
40739
|
+
"",
|
|
40740
|
+
"Camera dials (key, current value, valid options):",
|
|
40741
|
+
dialLines,
|
|
40742
|
+
"",
|
|
40743
|
+
"Return JSON only with the shape:",
|
|
40744
|
+
'{ "dna": "Rich style DNA description...", "dials": { "key": "value", ... } }',
|
|
40745
|
+
"",
|
|
40746
|
+
"Rules:",
|
|
40747
|
+
"- The dna field must be a non-empty string, 2-3 sentences.",
|
|
40748
|
+
"- Every value in dials must be one of the listed options for that key.",
|
|
40749
|
+
"- Include ALL dial keys in dials, even if you keep the current value.",
|
|
40750
|
+
"- Do not invent new keys. Do not output anything outside the JSON."
|
|
40751
|
+
].filter((line) => line !== "").join("\n");
|
|
40752
|
+
}
|
|
40753
|
+
async function analyzeAndApplyPhotographyStyle(options) {
|
|
40754
|
+
const { agentManager, workspaceRoot, brandPath, brief, referenceDescriptions, logger } = options;
|
|
40755
|
+
const brands = await listBrands({ workspaceRoot });
|
|
40756
|
+
const photoBrand = brands.find((b) => b.path === brandPath) ?? null;
|
|
40757
|
+
if (!photoBrand) {
|
|
40758
|
+
throw new Error(`Brand file not found at ${brandPath}`);
|
|
40759
|
+
}
|
|
40760
|
+
const allVars = photoBrand.variables;
|
|
40761
|
+
const selectVars = allVars.filter(
|
|
40762
|
+
(v) => v.type === "select" && v.options && v.options.length > 0
|
|
40763
|
+
);
|
|
40764
|
+
if (selectVars.length === 0) {
|
|
40765
|
+
throw new Error("No camera dials found in photography brand file");
|
|
40766
|
+
}
|
|
40767
|
+
const validOptions = /* @__PURE__ */ new Map();
|
|
40768
|
+
for (const v of selectVars) {
|
|
40769
|
+
validOptions.set(v.key, new Set(v.options ?? []));
|
|
40770
|
+
}
|
|
40771
|
+
const agentPrompt = buildPrompt3({
|
|
40772
|
+
brief,
|
|
40773
|
+
referenceDescriptions: referenceDescriptions ?? [],
|
|
40774
|
+
selectVars
|
|
40775
|
+
});
|
|
40776
|
+
let response;
|
|
40777
|
+
try {
|
|
40778
|
+
response = await generateStructuredAgentResponseWithFallback({
|
|
40779
|
+
manager: agentManager,
|
|
40780
|
+
cwd: workspaceRoot,
|
|
40781
|
+
prompt: agentPrompt,
|
|
40782
|
+
schema: PhotographyResponseSchema,
|
|
40783
|
+
schemaName: "PhotographyAnalysis",
|
|
40784
|
+
maxRetries: 2,
|
|
40785
|
+
providers: DEFAULT_STRUCTURED_GENERATION_PROVIDERS,
|
|
40786
|
+
agentConfigOverrides: {
|
|
40787
|
+
title: "Photography style analyzer",
|
|
40788
|
+
internal: true
|
|
40789
|
+
}
|
|
40790
|
+
});
|
|
40791
|
+
} catch (error) {
|
|
40792
|
+
if (error instanceof StructuredAgentResponseError || error instanceof StructuredAgentFallbackError) {
|
|
40793
|
+
logger.warn({ err: error, brandPath }, "Structured photography analysis failed");
|
|
40794
|
+
throw new Error("Photography analysis failed \u2014 the agent did not return valid JSON");
|
|
40795
|
+
}
|
|
40796
|
+
throw error;
|
|
40797
|
+
}
|
|
40798
|
+
const acceptedUpdates = /* @__PURE__ */ new Map();
|
|
40799
|
+
for (const [key, value] of Object.entries(response.dials)) {
|
|
40800
|
+
if (typeof value !== "string") continue;
|
|
40801
|
+
const trimmed = value.trim();
|
|
40802
|
+
const opts = validOptions.get(key);
|
|
40803
|
+
if (!opts) continue;
|
|
40804
|
+
if (!opts.has(trimmed)) continue;
|
|
40805
|
+
acceptedUpdates.set(key, trimmed);
|
|
40806
|
+
}
|
|
40807
|
+
acceptedUpdates.set("photo.dna", response.dna);
|
|
40808
|
+
acceptedUpdates.set("photo.brief", brief);
|
|
40809
|
+
const nextVariables = allVars.map((v) => {
|
|
40810
|
+
const update = acceptedUpdates.get(v.key);
|
|
40811
|
+
if (update === void 0) return v;
|
|
40812
|
+
return { ...v, value: update };
|
|
40813
|
+
});
|
|
40814
|
+
await writeBrandFrontmatter(
|
|
40815
|
+
{
|
|
40816
|
+
path: brandPath,
|
|
40817
|
+
frontmatter: {
|
|
40818
|
+
description: photoBrand.description,
|
|
40819
|
+
variables: nextVariables
|
|
40820
|
+
}
|
|
40821
|
+
},
|
|
40822
|
+
workspaceRoot
|
|
40823
|
+
);
|
|
40824
|
+
logger.info(
|
|
40825
|
+
{ brandPath, updatedCount: acceptedUpdates.size },
|
|
40826
|
+
"photography-analyzer: applied style analysis"
|
|
40827
|
+
);
|
|
40828
|
+
return { updatedCount: acceptedUpdates.size };
|
|
40829
|
+
}
|
|
40830
|
+
|
|
40616
40831
|
// ../server/src/server/brand/layout-generator.ts
|
|
40617
40832
|
import { promises as fs15 } from "node:fs";
|
|
40618
40833
|
import path23 from "node:path";
|
|
40619
40834
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
40620
|
-
import { z as
|
|
40835
|
+
import { z as z39 } from "zod";
|
|
40621
40836
|
var QA_FILENAME = "layout-qa.md";
|
|
40622
40837
|
var PROMPT_FILENAME = "layout-prompt.md";
|
|
40623
40838
|
var MAX_LOOKUP_LEVELS = 10;
|
|
@@ -40652,34 +40867,34 @@ async function writeRoleFile(workspaceRoot, content) {
|
|
|
40652
40867
|
await fs15.mkdir(path23.dirname(filePath), { recursive: true });
|
|
40653
40868
|
await fs15.writeFile(filePath, content, "utf8");
|
|
40654
40869
|
}
|
|
40655
|
-
var QaNextResponseSchema =
|
|
40656
|
-
done:
|
|
40657
|
-
question:
|
|
40658
|
-
options:
|
|
40659
|
-
roleDocument:
|
|
40660
|
-
});
|
|
40661
|
-
var RefinementResponseSchema =
|
|
40662
|
-
roleDocument:
|
|
40663
|
-
});
|
|
40664
|
-
var WireframeBlockSchema =
|
|
40665
|
-
type:
|
|
40666
|
-
widthFraction:
|
|
40667
|
-
heightVh:
|
|
40668
|
-
});
|
|
40669
|
-
var WireframeSectionSchema =
|
|
40670
|
-
type:
|
|
40671
|
-
widthMode:
|
|
40672
|
-
heightVh:
|
|
40673
|
-
arrangement:
|
|
40674
|
-
blocks:
|
|
40675
|
-
bg:
|
|
40676
|
-
gapAfterVh:
|
|
40677
|
-
});
|
|
40678
|
-
var WireframeDataSchema =
|
|
40679
|
-
viewport:
|
|
40680
|
-
maxWidth:
|
|
40681
|
-
pageBg:
|
|
40682
|
-
sections:
|
|
40870
|
+
var QaNextResponseSchema = z39.object({
|
|
40871
|
+
done: z39.boolean(),
|
|
40872
|
+
question: z39.string().optional(),
|
|
40873
|
+
options: z39.array(z39.string()).optional(),
|
|
40874
|
+
roleDocument: z39.string().optional()
|
|
40875
|
+
});
|
|
40876
|
+
var RefinementResponseSchema = z39.object({
|
|
40877
|
+
roleDocument: z39.string()
|
|
40878
|
+
});
|
|
40879
|
+
var WireframeBlockSchema = z39.object({
|
|
40880
|
+
type: z39.enum(["headline", "subheadline", "text", "image", "cta", "spacer"]),
|
|
40881
|
+
widthFraction: z39.number(),
|
|
40882
|
+
heightVh: z39.number()
|
|
40883
|
+
});
|
|
40884
|
+
var WireframeSectionSchema = z39.object({
|
|
40885
|
+
type: z39.enum(["hero", "features", "content", "cta", "footer", "divider"]),
|
|
40886
|
+
widthMode: z39.enum(["full-bleed", "contained"]),
|
|
40887
|
+
heightVh: z39.number(),
|
|
40888
|
+
arrangement: z39.enum(["single-column", "split", "asymmetric-grid", "bento", "stacked"]),
|
|
40889
|
+
blocks: z39.array(WireframeBlockSchema),
|
|
40890
|
+
bg: z39.enum(["neutral", "alt", "accent", "image"]),
|
|
40891
|
+
gapAfterVh: z39.number()
|
|
40892
|
+
});
|
|
40893
|
+
var WireframeDataSchema = z39.object({
|
|
40894
|
+
viewport: z39.object({ width: z39.number(), height: z39.number() }),
|
|
40895
|
+
maxWidth: z39.number(),
|
|
40896
|
+
pageBg: z39.string(),
|
|
40897
|
+
sections: z39.array(WireframeSectionSchema)
|
|
40683
40898
|
});
|
|
40684
40899
|
function buildFullBrandContext(allBrands) {
|
|
40685
40900
|
const lines = [];
|
|
@@ -42364,7 +42579,7 @@ var MIN_STREAMING_SEGMENT_DURATION_MS = 1e3;
|
|
|
42364
42579
|
var MIN_STREAMING_SEGMENT_BYTES = Math.round(
|
|
42365
42580
|
PCM_BYTES_PER_MS * MIN_STREAMING_SEGMENT_DURATION_MS
|
|
42366
42581
|
);
|
|
42367
|
-
var AgentIdSchema2 =
|
|
42582
|
+
var AgentIdSchema2 = z40.string().uuid();
|
|
42368
42583
|
var VOICE_INTERRUPT_CONFIRMATION_MS = 500;
|
|
42369
42584
|
var VoiceFeatureUnavailableError = class extends Error {
|
|
42370
42585
|
constructor(context) {
|
|
@@ -43745,6 +43960,9 @@ var Session = class _Session {
|
|
|
43745
43960
|
case "brands/generate-wireframe":
|
|
43746
43961
|
await this.handleBrandGenerateWireframeRequest(msg);
|
|
43747
43962
|
break;
|
|
43963
|
+
case "brands/analyze-photography":
|
|
43964
|
+
await this.handleBrandAnalyzePhotographyRequest(msg);
|
|
43965
|
+
break;
|
|
43748
43966
|
case "rightfont/library":
|
|
43749
43967
|
await this.handleRightFontLibraryRequest(msg);
|
|
43750
43968
|
break;
|
|
@@ -45404,8 +45622,8 @@ var Session = class _Session {
|
|
|
45404
45622
|
}
|
|
45405
45623
|
async generateCommitMessage(cwd) {
|
|
45406
45624
|
const files = await listUncommittedFiles(cwd);
|
|
45407
|
-
const schema =
|
|
45408
|
-
message:
|
|
45625
|
+
const schema = z40.object({
|
|
45626
|
+
message: z40.string().min(1).max(100).describe(
|
|
45409
45627
|
"Short feature-level summary, lowercase, imperative mood, no trailing period, no filename references."
|
|
45410
45628
|
)
|
|
45411
45629
|
});
|
|
@@ -45450,9 +45668,9 @@ var Session = class _Session {
|
|
|
45450
45668
|
},
|
|
45451
45669
|
{ appostleHome: this.appostleHome }
|
|
45452
45670
|
);
|
|
45453
|
-
const schema =
|
|
45454
|
-
title:
|
|
45455
|
-
body:
|
|
45671
|
+
const schema = z40.object({
|
|
45672
|
+
title: z40.string().min(1).max(72),
|
|
45673
|
+
body: z40.string().min(1)
|
|
45456
45674
|
});
|
|
45457
45675
|
const fileList = diff.structured && diff.structured.length > 0 ? [
|
|
45458
45676
|
"Files changed:",
|
|
@@ -50944,6 +51162,38 @@ ${details}`.trim());
|
|
|
50944
51162
|
});
|
|
50945
51163
|
}
|
|
50946
51164
|
}
|
|
51165
|
+
async handleBrandAnalyzePhotographyRequest(request) {
|
|
51166
|
+
const { requestId, workspaceRoot, brandPath, brief, referenceDescriptions } = request;
|
|
51167
|
+
try {
|
|
51168
|
+
const result = await analyzeAndApplyPhotographyStyle({
|
|
51169
|
+
agentManager: this.agentManager,
|
|
51170
|
+
workspaceRoot: expandTilde(workspaceRoot),
|
|
51171
|
+
brandPath: expandTilde(brandPath),
|
|
51172
|
+
brief,
|
|
51173
|
+
referenceDescriptions,
|
|
51174
|
+
logger: this.sessionLogger
|
|
51175
|
+
});
|
|
51176
|
+
this.emit({
|
|
51177
|
+
type: "brands/analyze-photography/response",
|
|
51178
|
+
payload: {
|
|
51179
|
+
requestId,
|
|
51180
|
+
updatedCount: result.updatedCount,
|
|
51181
|
+
error: null
|
|
51182
|
+
}
|
|
51183
|
+
});
|
|
51184
|
+
} catch (error) {
|
|
51185
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
51186
|
+
this.sessionLogger.error({ err: error, brandPath }, "Failed to analyze photography style");
|
|
51187
|
+
this.emit({
|
|
51188
|
+
type: "brands/analyze-photography/response",
|
|
51189
|
+
payload: {
|
|
51190
|
+
requestId,
|
|
51191
|
+
updatedCount: 0,
|
|
51192
|
+
error: message
|
|
51193
|
+
}
|
|
51194
|
+
});
|
|
51195
|
+
}
|
|
51196
|
+
}
|
|
50947
51197
|
async handleRightFontLibraryRequest(request) {
|
|
50948
51198
|
const { requestId, libraryPath } = request;
|
|
50949
51199
|
try {
|
|
@@ -53808,7 +54058,7 @@ import { pipeline } from "node:stream/promises";
|
|
|
53808
54058
|
import { spawn as spawn7 } from "node:child_process";
|
|
53809
54059
|
|
|
53810
54060
|
// ../server/src/server/speech/providers/local/sherpa/model-catalog.ts
|
|
53811
|
-
import { z as
|
|
54061
|
+
import { z as z41 } from "zod";
|
|
53812
54062
|
var SHERPA_ONNX_MODEL_CATALOG = {
|
|
53813
54063
|
"zipformer-bilingual-zh-en-2023-02-20": {
|
|
53814
54064
|
kind: "stt-online",
|
|
@@ -53901,7 +54151,7 @@ function buildAliasMap(modelIds) {
|
|
|
53901
54151
|
}
|
|
53902
54152
|
function createAliasedModelIdSchema(params) {
|
|
53903
54153
|
const validIds = new Set(params.modelIds);
|
|
53904
|
-
return
|
|
54154
|
+
return z41.string().trim().toLowerCase().refine(
|
|
53905
54155
|
(value) => validIds.has(value) || Object.prototype.hasOwnProperty.call(params.aliases, value),
|
|
53906
54156
|
{
|
|
53907
54157
|
message: "Invalid model id"
|
|
@@ -55533,20 +55783,20 @@ async function initializeLocalSpeechServices(params) {
|
|
|
55533
55783
|
}
|
|
55534
55784
|
|
|
55535
55785
|
// ../server/src/server/speech/providers/openai/config.ts
|
|
55536
|
-
import { z as
|
|
55786
|
+
import { z as z42 } from "zod";
|
|
55537
55787
|
var DEFAULT_OPENAI_REALTIME_TRANSCRIPTION_MODEL = "gpt-4o-transcribe";
|
|
55538
55788
|
var DEFAULT_OPENAI_TTS_MODEL = "tts-1";
|
|
55539
|
-
var OpenAiTtsVoiceSchema =
|
|
55540
|
-
var OpenAiTtsModelSchema =
|
|
55541
|
-
var NumberLikeSchema =
|
|
55542
|
-
var OptionalFiniteNumberSchema = NumberLikeSchema.pipe(
|
|
55543
|
-
var OptionalTrimmedStringSchema =
|
|
55544
|
-
var OpenAiSpeechResolutionSchema =
|
|
55789
|
+
var OpenAiTtsVoiceSchema = z42.enum(["alloy", "echo", "fable", "onyx", "nova", "shimmer"]);
|
|
55790
|
+
var OpenAiTtsModelSchema = z42.enum(["tts-1", "tts-1-hd"]);
|
|
55791
|
+
var NumberLikeSchema = z42.union([z42.number(), z42.string().trim().min(1)]);
|
|
55792
|
+
var OptionalFiniteNumberSchema = NumberLikeSchema.pipe(z42.coerce.number().finite()).optional();
|
|
55793
|
+
var OptionalTrimmedStringSchema = z42.string().trim().optional().transform((value) => value && value.length > 0 ? value : void 0);
|
|
55794
|
+
var OpenAiSpeechResolutionSchema = z42.object({
|
|
55545
55795
|
apiKey: OptionalTrimmedStringSchema,
|
|
55546
55796
|
sttConfidenceThreshold: OptionalFiniteNumberSchema,
|
|
55547
55797
|
sttModel: OptionalTrimmedStringSchema,
|
|
55548
|
-
ttsVoice:
|
|
55549
|
-
ttsModel:
|
|
55798
|
+
ttsVoice: z42.string().trim().toLowerCase().pipe(OpenAiTtsVoiceSchema).default("alloy"),
|
|
55799
|
+
ttsModel: z42.string().trim().toLowerCase().pipe(OpenAiTtsModelSchema).default(DEFAULT_OPENAI_TTS_MODEL),
|
|
55550
55800
|
realtimeTranscriptionModel: OptionalTrimmedStringSchema.default(
|
|
55551
55801
|
DEFAULT_OPENAI_REALTIME_TRANSCRIPTION_MODEL
|
|
55552
55802
|
)
|
|
@@ -56660,70 +56910,70 @@ function createSpeechService(params) {
|
|
|
56660
56910
|
import { randomUUID as randomUUID12 } from "node:crypto";
|
|
56661
56911
|
import { promises as fs16 } from "node:fs";
|
|
56662
56912
|
import path28 from "node:path";
|
|
56663
|
-
import { z as
|
|
56664
|
-
var SERIALIZABLE_CONFIG_SCHEMA =
|
|
56665
|
-
title:
|
|
56666
|
-
modeId:
|
|
56667
|
-
model:
|
|
56668
|
-
thinkingOptionId:
|
|
56669
|
-
featureValues:
|
|
56670
|
-
extra:
|
|
56671
|
-
systemPrompt:
|
|
56672
|
-
mcpServers:
|
|
56913
|
+
import { z as z43 } from "zod";
|
|
56914
|
+
var SERIALIZABLE_CONFIG_SCHEMA = z43.object({
|
|
56915
|
+
title: z43.string().nullable().optional(),
|
|
56916
|
+
modeId: z43.string().nullable().optional(),
|
|
56917
|
+
model: z43.string().nullable().optional(),
|
|
56918
|
+
thinkingOptionId: z43.string().nullable().optional(),
|
|
56919
|
+
featureValues: z43.record(z43.unknown()).nullable().optional(),
|
|
56920
|
+
extra: z43.record(z43.any()).nullable().optional(),
|
|
56921
|
+
systemPrompt: z43.string().nullable().optional(),
|
|
56922
|
+
mcpServers: z43.record(z43.any()).nullable().optional()
|
|
56673
56923
|
}).nullable().optional();
|
|
56674
|
-
var PERSISTENCE_HANDLE_SCHEMA =
|
|
56675
|
-
provider:
|
|
56676
|
-
sessionId:
|
|
56677
|
-
nativeHandle:
|
|
56678
|
-
metadata:
|
|
56924
|
+
var PERSISTENCE_HANDLE_SCHEMA = z43.object({
|
|
56925
|
+
provider: z43.string(),
|
|
56926
|
+
sessionId: z43.string(),
|
|
56927
|
+
nativeHandle: z43.any().optional(),
|
|
56928
|
+
metadata: z43.record(z43.any()).optional()
|
|
56679
56929
|
}).nullable().optional();
|
|
56680
|
-
var STORED_AGENT_SCHEMA =
|
|
56681
|
-
id:
|
|
56682
|
-
provider:
|
|
56683
|
-
cwd:
|
|
56684
|
-
createdAt:
|
|
56685
|
-
updatedAt:
|
|
56686
|
-
lastActivityAt:
|
|
56687
|
-
lastUserMessageAt:
|
|
56688
|
-
title:
|
|
56689
|
-
labels:
|
|
56930
|
+
var STORED_AGENT_SCHEMA = z43.object({
|
|
56931
|
+
id: z43.string(),
|
|
56932
|
+
provider: z43.string(),
|
|
56933
|
+
cwd: z43.string(),
|
|
56934
|
+
createdAt: z43.string(),
|
|
56935
|
+
updatedAt: z43.string(),
|
|
56936
|
+
lastActivityAt: z43.string().optional(),
|
|
56937
|
+
lastUserMessageAt: z43.string().nullable().optional(),
|
|
56938
|
+
title: z43.string().nullable().optional(),
|
|
56939
|
+
labels: z43.record(z43.string()).default({}),
|
|
56690
56940
|
lastStatus: AgentStatusSchema.default("closed"),
|
|
56691
|
-
lastModeId:
|
|
56941
|
+
lastModeId: z43.string().nullable().optional(),
|
|
56692
56942
|
config: SERIALIZABLE_CONFIG_SCHEMA,
|
|
56693
|
-
runtimeInfo:
|
|
56694
|
-
provider:
|
|
56695
|
-
sessionId:
|
|
56696
|
-
model:
|
|
56697
|
-
thinkingOptionId:
|
|
56698
|
-
modeId:
|
|
56699
|
-
extra:
|
|
56943
|
+
runtimeInfo: z43.object({
|
|
56944
|
+
provider: z43.string(),
|
|
56945
|
+
sessionId: z43.string().nullable(),
|
|
56946
|
+
model: z43.string().nullable().optional(),
|
|
56947
|
+
thinkingOptionId: z43.string().nullable().optional(),
|
|
56948
|
+
modeId: z43.string().nullable().optional(),
|
|
56949
|
+
extra: z43.record(z43.unknown()).optional()
|
|
56700
56950
|
}).optional(),
|
|
56701
|
-
features:
|
|
56951
|
+
features: z43.array(AgentFeatureSchema).optional(),
|
|
56702
56952
|
persistence: PERSISTENCE_HANDLE_SCHEMA,
|
|
56703
|
-
lastError:
|
|
56704
|
-
requiresAttention:
|
|
56705
|
-
attentionReason:
|
|
56706
|
-
attentionTimestamp:
|
|
56707
|
-
internal:
|
|
56708
|
-
archivedAt:
|
|
56953
|
+
lastError: z43.string().nullable().optional(),
|
|
56954
|
+
requiresAttention: z43.boolean().optional(),
|
|
56955
|
+
attentionReason: z43.enum(["finished", "error", "permission"]).nullable().optional(),
|
|
56956
|
+
attentionTimestamp: z43.string().nullable().optional(),
|
|
56957
|
+
internal: z43.boolean().optional(),
|
|
56958
|
+
archivedAt: z43.string().nullable().optional(),
|
|
56709
56959
|
// Fork lineage (optional for backward compat with pre-fork records).
|
|
56710
|
-
parentAgentId:
|
|
56711
|
-
forkedFromMessageUuid:
|
|
56960
|
+
parentAgentId: z43.string().optional(),
|
|
56961
|
+
forkedFromMessageUuid: z43.string().optional(),
|
|
56712
56962
|
// Multi-tenant session isolation: the auth-server user-id that created
|
|
56713
56963
|
// (and therefore owns) this agent + the additive ACL of other users
|
|
56714
56964
|
// granted access. Both optional/null-default for backward compatibility
|
|
56715
56965
|
// with pre-Phase-2c records — those load with `null` owner and stay
|
|
56716
56966
|
// visible to every connecting user (matches today's single-tenant
|
|
56717
56967
|
// behavior). Set on new agents at create time via Session.ownerUserId.
|
|
56718
|
-
ownerUserId:
|
|
56719
|
-
sharedWithUserIds:
|
|
56968
|
+
ownerUserId: z43.string().nullable().optional(),
|
|
56969
|
+
sharedWithUserIds: z43.array(z43.string()).default([]),
|
|
56720
56970
|
// Owner's display username — needed on resume to route to the correct
|
|
56721
56971
|
// `CLAUDE_CONFIG_DIR` via `ensureClaudeProfile(username)` for agents
|
|
56722
56972
|
// created by a shared (non-owner) user. Without this, a resumed shared-
|
|
56723
56973
|
// user agent would silently fall back to the daemon owner's Claude
|
|
56724
56974
|
// profile/subscription. Optional — pre-Phase-3 records rehydrate without
|
|
56725
56975
|
// per-user profile routing.
|
|
56726
|
-
ownerUsername:
|
|
56976
|
+
ownerUsername: z43.string().optional()
|
|
56727
56977
|
});
|
|
56728
56978
|
function parseStoredAgentRecord(value) {
|
|
56729
56979
|
return STORED_AGENT_SCHEMA.parse(value);
|
|
@@ -56967,7 +57217,7 @@ async function writeFileAtomically(targetPath, payload) {
|
|
|
56967
57217
|
|
|
56968
57218
|
// ../server/src/server/agent/mcp-server.ts
|
|
56969
57219
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
56970
|
-
import { z as
|
|
57220
|
+
import { z as z44 } from "zod";
|
|
56971
57221
|
|
|
56972
57222
|
// ../server/src/server/json-utils.ts
|
|
56973
57223
|
function ensureValidJson(value) {
|
|
@@ -57100,16 +57350,16 @@ function resolveChildAgentCwd(params) {
|
|
|
57100
57350
|
}
|
|
57101
57351
|
return resolvePathFromBase(params.parentCwd, requestedCwd);
|
|
57102
57352
|
}
|
|
57103
|
-
var TerminalSummarySchema =
|
|
57104
|
-
id:
|
|
57105
|
-
name:
|
|
57106
|
-
cwd:
|
|
57353
|
+
var TerminalSummarySchema = z44.object({
|
|
57354
|
+
id: z44.string(),
|
|
57355
|
+
name: z44.string(),
|
|
57356
|
+
cwd: z44.string()
|
|
57107
57357
|
});
|
|
57108
|
-
var WorktreeSummarySchema =
|
|
57109
|
-
path:
|
|
57110
|
-
createdAt:
|
|
57111
|
-
branchName:
|
|
57112
|
-
head:
|
|
57358
|
+
var WorktreeSummarySchema = z44.object({
|
|
57359
|
+
path: z44.string(),
|
|
57360
|
+
createdAt: z44.string(),
|
|
57361
|
+
branchName: z44.string().optional(),
|
|
57362
|
+
head: z44.string().optional()
|
|
57113
57363
|
});
|
|
57114
57364
|
function resolveTerminalKeyToken(key, literal) {
|
|
57115
57365
|
if (literal) {
|
|
@@ -57246,48 +57496,48 @@ async function createAgentMcpServer(options) {
|
|
|
57246
57496
|
};
|
|
57247
57497
|
};
|
|
57248
57498
|
const agentToAgentInputSchema = {
|
|
57249
|
-
cwd:
|
|
57250
|
-
title:
|
|
57499
|
+
cwd: z44.string().optional().describe("Optional working directory. Defaults to the caller agent working directory."),
|
|
57500
|
+
title: z44.string().trim().min(1, "Title is required").max(60, "Title must be 60 characters or fewer").describe("Short descriptive title (<= 60 chars) summarizing the agent's focus."),
|
|
57251
57501
|
provider: AgentProviderEnum.optional().describe(
|
|
57252
57502
|
"Optional agent implementation to spawn. Defaults to 'claude'."
|
|
57253
57503
|
),
|
|
57254
|
-
model:
|
|
57255
|
-
thinking:
|
|
57256
|
-
labels:
|
|
57257
|
-
initialPrompt:
|
|
57258
|
-
background:
|
|
57504
|
+
model: z44.string().optional().describe("Model to use (e.g. claude-sonnet-4-20250514)"),
|
|
57505
|
+
thinking: z44.string().optional().describe("Thinking option ID"),
|
|
57506
|
+
labels: z44.record(z44.string(), z44.string()).optional().describe("Labels to set on the agent"),
|
|
57507
|
+
initialPrompt: z44.string().trim().min(1, "initialPrompt is required").describe("Required first task to run immediately after creation."),
|
|
57508
|
+
background: z44.boolean().optional().default(false).describe(
|
|
57259
57509
|
"Run agent in background. If false (default), waits for completion or permission request. If true, returns immediately."
|
|
57260
57510
|
),
|
|
57261
|
-
notifyOnFinish:
|
|
57511
|
+
notifyOnFinish: z44.boolean().optional().default(false).describe(
|
|
57262
57512
|
"Send a notification prompt to the caller agent when this agent finishes, errors, or needs permission. Requires a caller agent context."
|
|
57263
57513
|
)
|
|
57264
57514
|
};
|
|
57265
57515
|
const topLevelInputSchema = {
|
|
57266
|
-
cwd:
|
|
57267
|
-
title:
|
|
57516
|
+
cwd: z44.string().describe("Required working directory for the agent (absolute, relative, or ~)."),
|
|
57517
|
+
title: z44.string().trim().min(1, "Title is required").max(60, "Title must be 60 characters or fewer").describe("Short descriptive title (<= 60 chars) summarizing the agent's focus."),
|
|
57268
57518
|
provider: AgentProviderEnum.optional().describe(
|
|
57269
57519
|
"Optional agent implementation to spawn. Defaults to 'claude'."
|
|
57270
57520
|
),
|
|
57271
|
-
model:
|
|
57272
|
-
thinking:
|
|
57273
|
-
labels:
|
|
57274
|
-
initialPrompt:
|
|
57275
|
-
mode:
|
|
57276
|
-
worktreeName:
|
|
57277
|
-
baseBranch:
|
|
57278
|
-
refName:
|
|
57279
|
-
action:
|
|
57280
|
-
githubPrNumber:
|
|
57281
|
-
background:
|
|
57521
|
+
model: z44.string().optional().describe("Model to use (e.g. claude-sonnet-4-20250514)"),
|
|
57522
|
+
thinking: z44.string().optional().describe("Thinking option ID"),
|
|
57523
|
+
labels: z44.record(z44.string(), z44.string()).optional().describe("Labels to set on the agent"),
|
|
57524
|
+
initialPrompt: z44.string().trim().min(1, "initialPrompt is required").describe("Required first task to run immediately after creation."),
|
|
57525
|
+
mode: z44.string().optional().describe("Optional session mode to configure before the first run."),
|
|
57526
|
+
worktreeName: z44.string().optional().describe("Optional git worktree branch name (lowercase alphanumerics + hyphen)."),
|
|
57527
|
+
baseBranch: z44.string().optional().describe("Required when worktreeName is set: the base branch to diff/merge against."),
|
|
57528
|
+
refName: z44.string().min(1).optional().describe("Optional source ref for worktree creation."),
|
|
57529
|
+
action: z44.enum(["branch-off", "checkout"]).optional().describe("Optional worktree creation action."),
|
|
57530
|
+
githubPrNumber: z44.number().int().positive().optional().describe("Optional GitHub pull request number to checkout."),
|
|
57531
|
+
background: z44.boolean().optional().default(false).describe(
|
|
57282
57532
|
"Run agent in background. If false (default), waits for completion or permission request. If true, returns immediately."
|
|
57283
57533
|
),
|
|
57284
|
-
notifyOnFinish:
|
|
57534
|
+
notifyOnFinish: z44.boolean().optional().default(false).describe(
|
|
57285
57535
|
"Send a notification prompt to the caller agent when this agent finishes, errors, or needs permission. Requires a caller agent context."
|
|
57286
57536
|
)
|
|
57287
57537
|
};
|
|
57288
57538
|
const createAgentInputSchema = callerAgentId ? agentToAgentInputSchema : topLevelInputSchema;
|
|
57289
|
-
const agentToAgentCreateAgentArgsSchema =
|
|
57290
|
-
const topLevelCreateAgentArgsSchema =
|
|
57539
|
+
const agentToAgentCreateAgentArgsSchema = z44.object(agentToAgentInputSchema);
|
|
57540
|
+
const topLevelCreateAgentArgsSchema = z44.object(topLevelInputSchema);
|
|
57291
57541
|
if (options.voiceOnly || options.enableVoiceTools || callerContext?.enableVoiceTools) {
|
|
57292
57542
|
server.registerTool(
|
|
57293
57543
|
"speak",
|
|
@@ -57295,10 +57545,10 @@ async function createAgentMcpServer(options) {
|
|
|
57295
57545
|
title: "Speak",
|
|
57296
57546
|
description: "Speak text to the user via daemon-managed voice output. Blocks until playback completes.",
|
|
57297
57547
|
inputSchema: {
|
|
57298
|
-
text:
|
|
57548
|
+
text: z44.string().trim().min(1, "text is required").max(4e3, "text must be 4000 characters or fewer")
|
|
57299
57549
|
},
|
|
57300
57550
|
outputSchema: {
|
|
57301
|
-
ok:
|
|
57551
|
+
ok: z44.boolean()
|
|
57302
57552
|
}
|
|
57303
57553
|
},
|
|
57304
57554
|
async (args, context) => {
|
|
@@ -57331,19 +57581,19 @@ async function createAgentMcpServer(options) {
|
|
|
57331
57581
|
description: "Create a new Claude or Codex agent tied to a working directory. Optionally run an initial prompt immediately or create a git worktree for the agent.",
|
|
57332
57582
|
inputSchema: createAgentInputSchema,
|
|
57333
57583
|
outputSchema: {
|
|
57334
|
-
agentId:
|
|
57584
|
+
agentId: z44.string(),
|
|
57335
57585
|
type: AgentProviderEnum,
|
|
57336
57586
|
status: AgentStatusEnum,
|
|
57337
|
-
cwd:
|
|
57338
|
-
currentModeId:
|
|
57339
|
-
availableModes:
|
|
57340
|
-
|
|
57341
|
-
id:
|
|
57342
|
-
label:
|
|
57343
|
-
description:
|
|
57587
|
+
cwd: z44.string(),
|
|
57588
|
+
currentModeId: z44.string().nullable(),
|
|
57589
|
+
availableModes: z44.array(
|
|
57590
|
+
z44.object({
|
|
57591
|
+
id: z44.string(),
|
|
57592
|
+
label: z44.string(),
|
|
57593
|
+
description: z44.string().nullable().optional()
|
|
57344
57594
|
})
|
|
57345
57595
|
),
|
|
57346
|
-
lastMessage:
|
|
57596
|
+
lastMessage: z44.string().nullable().optional(),
|
|
57347
57597
|
permission: AgentPermissionRequestPayloadSchema.nullable().optional()
|
|
57348
57598
|
}
|
|
57349
57599
|
},
|
|
@@ -57530,13 +57780,13 @@ async function createAgentMcpServer(options) {
|
|
|
57530
57780
|
title: "Wait for agent",
|
|
57531
57781
|
description: "Block until the agent requests permission or the current run completes. Returns the pending permission (if any) and recent activity summary.",
|
|
57532
57782
|
inputSchema: {
|
|
57533
|
-
agentId:
|
|
57783
|
+
agentId: z44.string().describe("Agent identifier returned by the create_agent tool")
|
|
57534
57784
|
},
|
|
57535
57785
|
outputSchema: {
|
|
57536
|
-
agentId:
|
|
57786
|
+
agentId: z44.string(),
|
|
57537
57787
|
status: AgentStatusEnum,
|
|
57538
57788
|
permission: AgentPermissionRequestPayloadSchema.nullable(),
|
|
57539
|
-
lastMessage:
|
|
57789
|
+
lastMessage: z44.string().nullable()
|
|
57540
57790
|
}
|
|
57541
57791
|
},
|
|
57542
57792
|
async ({ agentId }, { signal }) => {
|
|
@@ -57597,20 +57847,20 @@ async function createAgentMcpServer(options) {
|
|
|
57597
57847
|
title: "Send agent prompt",
|
|
57598
57848
|
description: "Send a task to a running agent. Returns immediately after the agent begins processing.",
|
|
57599
57849
|
inputSchema: {
|
|
57600
|
-
agentId:
|
|
57601
|
-
prompt:
|
|
57602
|
-
sessionMode:
|
|
57603
|
-
background:
|
|
57850
|
+
agentId: z44.string(),
|
|
57851
|
+
prompt: z44.string(),
|
|
57852
|
+
sessionMode: z44.string().optional().describe("Optional mode to set before running the prompt."),
|
|
57853
|
+
background: z44.boolean().optional().default(false).describe(
|
|
57604
57854
|
"Run agent in background. If false (default), waits for completion or permission request. If true, returns immediately."
|
|
57605
57855
|
),
|
|
57606
|
-
notifyOnFinish:
|
|
57856
|
+
notifyOnFinish: z44.boolean().optional().default(false).describe(
|
|
57607
57857
|
"Send a notification prompt to the caller agent when this agent finishes, errors, or needs permission."
|
|
57608
57858
|
)
|
|
57609
57859
|
},
|
|
57610
57860
|
outputSchema: {
|
|
57611
|
-
success:
|
|
57861
|
+
success: z44.boolean(),
|
|
57612
57862
|
status: AgentStatusEnum,
|
|
57613
|
-
lastMessage:
|
|
57863
|
+
lastMessage: z44.string().nullable().optional(),
|
|
57614
57864
|
permission: AgentPermissionRequestPayloadSchema.nullable().optional()
|
|
57615
57865
|
}
|
|
57616
57866
|
},
|
|
@@ -57674,7 +57924,7 @@ async function createAgentMcpServer(options) {
|
|
|
57674
57924
|
title: "Get agent status",
|
|
57675
57925
|
description: "Return the latest snapshot for an agent, including lifecycle state, capabilities, and pending permissions.",
|
|
57676
57926
|
inputSchema: {
|
|
57677
|
-
agentId:
|
|
57927
|
+
agentId: z44.string()
|
|
57678
57928
|
},
|
|
57679
57929
|
outputSchema: {
|
|
57680
57930
|
status: AgentStatusEnum,
|
|
@@ -57721,10 +57971,10 @@ async function createAgentMcpServer(options) {
|
|
|
57721
57971
|
title: "List agents",
|
|
57722
57972
|
description: "List all live agents managed by the server.",
|
|
57723
57973
|
inputSchema: {
|
|
57724
|
-
includeArchived:
|
|
57974
|
+
includeArchived: z44.boolean().optional().default(false)
|
|
57725
57975
|
},
|
|
57726
57976
|
outputSchema: {
|
|
57727
|
-
agents:
|
|
57977
|
+
agents: z44.array(AgentSnapshotPayloadSchema)
|
|
57728
57978
|
}
|
|
57729
57979
|
},
|
|
57730
57980
|
async ({ includeArchived }) => {
|
|
@@ -57749,10 +57999,10 @@ async function createAgentMcpServer(options) {
|
|
|
57749
57999
|
title: "Cancel agent run",
|
|
57750
58000
|
description: "Abort the agent's current run but keep the agent alive for future tasks.",
|
|
57751
58001
|
inputSchema: {
|
|
57752
|
-
agentId:
|
|
58002
|
+
agentId: z44.string()
|
|
57753
58003
|
},
|
|
57754
58004
|
outputSchema: {
|
|
57755
|
-
success:
|
|
58005
|
+
success: z44.boolean()
|
|
57756
58006
|
}
|
|
57757
58007
|
},
|
|
57758
58008
|
async ({ agentId }) => {
|
|
@@ -57772,10 +58022,10 @@ async function createAgentMcpServer(options) {
|
|
|
57772
58022
|
title: "Archive agent",
|
|
57773
58023
|
description: "Archive an agent (soft-delete). The agent is interrupted if running and removed from the active list.",
|
|
57774
58024
|
inputSchema: {
|
|
57775
|
-
agentId:
|
|
58025
|
+
agentId: z44.string()
|
|
57776
58026
|
},
|
|
57777
58027
|
outputSchema: {
|
|
57778
|
-
success:
|
|
58028
|
+
success: z44.boolean()
|
|
57779
58029
|
}
|
|
57780
58030
|
},
|
|
57781
58031
|
async ({ agentId }) => {
|
|
@@ -57793,10 +58043,10 @@ async function createAgentMcpServer(options) {
|
|
|
57793
58043
|
title: "Kill agent",
|
|
57794
58044
|
description: "Terminate an agent session permanently.",
|
|
57795
58045
|
inputSchema: {
|
|
57796
|
-
agentId:
|
|
58046
|
+
agentId: z44.string()
|
|
57797
58047
|
},
|
|
57798
58048
|
outputSchema: {
|
|
57799
|
-
success:
|
|
58049
|
+
success: z44.boolean()
|
|
57800
58050
|
}
|
|
57801
58051
|
},
|
|
57802
58052
|
async ({ agentId }) => {
|
|
@@ -57814,12 +58064,12 @@ async function createAgentMcpServer(options) {
|
|
|
57814
58064
|
title: "Update agent",
|
|
57815
58065
|
description: "Update an agent name and/or labels.",
|
|
57816
58066
|
inputSchema: {
|
|
57817
|
-
agentId:
|
|
57818
|
-
name:
|
|
57819
|
-
labels:
|
|
58067
|
+
agentId: z44.string(),
|
|
58068
|
+
name: z44.string().optional(),
|
|
58069
|
+
labels: z44.record(z44.string(), z44.string()).optional().describe("Labels to set on the agent")
|
|
57820
58070
|
},
|
|
57821
58071
|
outputSchema: {
|
|
57822
|
-
success:
|
|
58072
|
+
success: z44.boolean()
|
|
57823
58073
|
}
|
|
57824
58074
|
},
|
|
57825
58075
|
async ({ agentId, name, labels }) => {
|
|
@@ -57851,11 +58101,11 @@ async function createAgentMcpServer(options) {
|
|
|
57851
58101
|
title: "List terminals",
|
|
57852
58102
|
description: "List terminals for a working directory or across all working directories.",
|
|
57853
58103
|
inputSchema: {
|
|
57854
|
-
cwd:
|
|
57855
|
-
all:
|
|
58104
|
+
cwd: z44.string().optional().describe("Optional working directory. Defaults to the caller agent cwd."),
|
|
58105
|
+
all: z44.boolean().optional().describe("List terminals across all working directories.")
|
|
57856
58106
|
},
|
|
57857
58107
|
outputSchema: {
|
|
57858
|
-
terminals:
|
|
58108
|
+
terminals: z44.array(TerminalSummarySchema)
|
|
57859
58109
|
}
|
|
57860
58110
|
},
|
|
57861
58111
|
async ({ cwd, all }) => {
|
|
@@ -57889,8 +58139,8 @@ async function createAgentMcpServer(options) {
|
|
|
57889
58139
|
title: "Create terminal",
|
|
57890
58140
|
description: "Create a terminal session for a working directory.",
|
|
57891
58141
|
inputSchema: {
|
|
57892
|
-
cwd:
|
|
57893
|
-
name:
|
|
58142
|
+
cwd: z44.string().optional().describe("Optional working directory. Defaults to the caller agent cwd."),
|
|
58143
|
+
name: z44.string().optional().describe("Optional terminal name.")
|
|
57894
58144
|
},
|
|
57895
58145
|
outputSchema: TerminalSummarySchema.shape
|
|
57896
58146
|
},
|
|
@@ -57918,10 +58168,10 @@ async function createAgentMcpServer(options) {
|
|
|
57918
58168
|
title: "Kill terminal",
|
|
57919
58169
|
description: "Kill an existing terminal session.",
|
|
57920
58170
|
inputSchema: {
|
|
57921
|
-
terminalId:
|
|
58171
|
+
terminalId: z44.string()
|
|
57922
58172
|
},
|
|
57923
58173
|
outputSchema: {
|
|
57924
|
-
success:
|
|
58174
|
+
success: z44.boolean()
|
|
57925
58175
|
}
|
|
57926
58176
|
},
|
|
57927
58177
|
async ({ terminalId }) => {
|
|
@@ -57945,16 +58195,16 @@ async function createAgentMcpServer(options) {
|
|
|
57945
58195
|
title: "Capture terminal",
|
|
57946
58196
|
description: "Capture plain-text terminal output lines from a terminal session.",
|
|
57947
58197
|
inputSchema: {
|
|
57948
|
-
terminalId:
|
|
57949
|
-
start:
|
|
57950
|
-
end:
|
|
57951
|
-
scrollback:
|
|
57952
|
-
stripAnsi:
|
|
58198
|
+
terminalId: z44.string(),
|
|
58199
|
+
start: z44.number().optional(),
|
|
58200
|
+
end: z44.number().optional(),
|
|
58201
|
+
scrollback: z44.boolean().optional(),
|
|
58202
|
+
stripAnsi: z44.boolean().optional().default(true)
|
|
57953
58203
|
},
|
|
57954
58204
|
outputSchema: {
|
|
57955
|
-
terminalId:
|
|
57956
|
-
lines:
|
|
57957
|
-
totalLines:
|
|
58205
|
+
terminalId: z44.string(),
|
|
58206
|
+
lines: z44.array(z44.string()),
|
|
58207
|
+
totalLines: z44.number().int().nonnegative()
|
|
57958
58208
|
}
|
|
57959
58209
|
},
|
|
57960
58210
|
async ({ terminalId, start, end, scrollback, stripAnsi: stripAnsi3 = true }) => {
|
|
@@ -57986,12 +58236,12 @@ async function createAgentMcpServer(options) {
|
|
|
57986
58236
|
title: "Send terminal keys",
|
|
57987
58237
|
description: "Send literal text or special key tokens to a terminal session.",
|
|
57988
58238
|
inputSchema: {
|
|
57989
|
-
terminalId:
|
|
57990
|
-
keys:
|
|
57991
|
-
literal:
|
|
58239
|
+
terminalId: z44.string(),
|
|
58240
|
+
keys: z44.string(),
|
|
58241
|
+
literal: z44.boolean().optional()
|
|
57992
58242
|
},
|
|
57993
58243
|
outputSchema: {
|
|
57994
|
-
success:
|
|
58244
|
+
success: z44.boolean()
|
|
57995
58245
|
}
|
|
57996
58246
|
},
|
|
57997
58247
|
async ({ terminalId, keys, literal = false }) => {
|
|
@@ -58018,17 +58268,17 @@ async function createAgentMcpServer(options) {
|
|
|
58018
58268
|
title: "Create schedule",
|
|
58019
58269
|
description: "Create a recurring schedule that runs on an agent or a new agent.",
|
|
58020
58270
|
inputSchema: {
|
|
58021
|
-
prompt:
|
|
58022
|
-
every:
|
|
58023
|
-
cron:
|
|
58024
|
-
name:
|
|
58025
|
-
target:
|
|
58271
|
+
prompt: z44.string().trim().min(1, "prompt is required"),
|
|
58272
|
+
every: z44.string().optional(),
|
|
58273
|
+
cron: z44.string().optional(),
|
|
58274
|
+
name: z44.string().optional(),
|
|
58275
|
+
target: z44.enum(["self", "new-agent"]).optional(),
|
|
58026
58276
|
provider: AgentProviderEnum.optional().describe(
|
|
58027
58277
|
"Provider, or provider/model (for example: codex or codex/gpt-5.4)."
|
|
58028
58278
|
),
|
|
58029
|
-
cwd:
|
|
58030
|
-
maxRuns:
|
|
58031
|
-
expiresIn:
|
|
58279
|
+
cwd: z44.string().optional(),
|
|
58280
|
+
maxRuns: z44.number().int().positive().optional(),
|
|
58281
|
+
expiresIn: z44.string().optional()
|
|
58032
58282
|
},
|
|
58033
58283
|
outputSchema: ScheduleSummarySchema.shape
|
|
58034
58284
|
},
|
|
@@ -58070,7 +58320,7 @@ async function createAgentMcpServer(options) {
|
|
|
58070
58320
|
description: "List all schedules managed by the daemon.",
|
|
58071
58321
|
inputSchema: {},
|
|
58072
58322
|
outputSchema: {
|
|
58073
|
-
schedules:
|
|
58323
|
+
schedules: z44.array(ScheduleSummarySchema)
|
|
58074
58324
|
}
|
|
58075
58325
|
},
|
|
58076
58326
|
async () => {
|
|
@@ -58092,7 +58342,7 @@ async function createAgentMcpServer(options) {
|
|
|
58092
58342
|
title: "Inspect schedule",
|
|
58093
58343
|
description: "Inspect a schedule and its run history.",
|
|
58094
58344
|
inputSchema: {
|
|
58095
|
-
id:
|
|
58345
|
+
id: z44.string()
|
|
58096
58346
|
},
|
|
58097
58347
|
outputSchema: StoredScheduleSchema.shape
|
|
58098
58348
|
},
|
|
@@ -58113,10 +58363,10 @@ async function createAgentMcpServer(options) {
|
|
|
58113
58363
|
title: "Pause schedule",
|
|
58114
58364
|
description: "Pause an active schedule.",
|
|
58115
58365
|
inputSchema: {
|
|
58116
|
-
id:
|
|
58366
|
+
id: z44.string()
|
|
58117
58367
|
},
|
|
58118
58368
|
outputSchema: {
|
|
58119
|
-
success:
|
|
58369
|
+
success: z44.boolean()
|
|
58120
58370
|
}
|
|
58121
58371
|
},
|
|
58122
58372
|
async ({ id }) => {
|
|
@@ -58136,10 +58386,10 @@ async function createAgentMcpServer(options) {
|
|
|
58136
58386
|
title: "Resume schedule",
|
|
58137
58387
|
description: "Resume a paused schedule.",
|
|
58138
58388
|
inputSchema: {
|
|
58139
|
-
id:
|
|
58389
|
+
id: z44.string()
|
|
58140
58390
|
},
|
|
58141
58391
|
outputSchema: {
|
|
58142
|
-
success:
|
|
58392
|
+
success: z44.boolean()
|
|
58143
58393
|
}
|
|
58144
58394
|
},
|
|
58145
58395
|
async ({ id }) => {
|
|
@@ -58159,10 +58409,10 @@ async function createAgentMcpServer(options) {
|
|
|
58159
58409
|
title: "Delete schedule",
|
|
58160
58410
|
description: "Delete a schedule permanently.",
|
|
58161
58411
|
inputSchema: {
|
|
58162
|
-
id:
|
|
58412
|
+
id: z44.string()
|
|
58163
58413
|
},
|
|
58164
58414
|
outputSchema: {
|
|
58165
|
-
success:
|
|
58415
|
+
success: z44.boolean()
|
|
58166
58416
|
}
|
|
58167
58417
|
},
|
|
58168
58418
|
async ({ id }) => {
|
|
@@ -58183,7 +58433,7 @@ async function createAgentMcpServer(options) {
|
|
|
58183
58433
|
description: "List available agent providers and their modes.",
|
|
58184
58434
|
inputSchema: {},
|
|
58185
58435
|
outputSchema: {
|
|
58186
|
-
providers:
|
|
58436
|
+
providers: z44.array(ProviderSummarySchema)
|
|
58187
58437
|
}
|
|
58188
58438
|
},
|
|
58189
58439
|
async () => ({
|
|
@@ -58210,8 +58460,8 @@ async function createAgentMcpServer(options) {
|
|
|
58210
58460
|
provider: AgentProviderEnum
|
|
58211
58461
|
},
|
|
58212
58462
|
outputSchema: {
|
|
58213
|
-
provider:
|
|
58214
|
-
models:
|
|
58463
|
+
provider: z44.string(),
|
|
58464
|
+
models: z44.array(AgentModelSchema)
|
|
58215
58465
|
}
|
|
58216
58466
|
},
|
|
58217
58467
|
async ({ provider }) => {
|
|
@@ -58238,10 +58488,10 @@ async function createAgentMcpServer(options) {
|
|
|
58238
58488
|
title: "List worktrees",
|
|
58239
58489
|
description: "List Appostle-managed git worktrees for a repository.",
|
|
58240
58490
|
inputSchema: {
|
|
58241
|
-
cwd:
|
|
58491
|
+
cwd: z44.string().optional().describe("Optional repository cwd. Defaults to the caller agent cwd.")
|
|
58242
58492
|
},
|
|
58243
58493
|
outputSchema: {
|
|
58244
|
-
worktrees:
|
|
58494
|
+
worktrees: z44.array(WorktreeSummarySchema)
|
|
58245
58495
|
}
|
|
58246
58496
|
},
|
|
58247
58497
|
async ({ cwd }) => {
|
|
@@ -58262,16 +58512,16 @@ async function createAgentMcpServer(options) {
|
|
|
58262
58512
|
title: "Create worktree",
|
|
58263
58513
|
description: "Create a Appostle-managed git worktree.",
|
|
58264
58514
|
inputSchema: {
|
|
58265
|
-
cwd:
|
|
58266
|
-
branchName:
|
|
58267
|
-
baseBranch:
|
|
58268
|
-
refName:
|
|
58269
|
-
action:
|
|
58270
|
-
githubPrNumber:
|
|
58515
|
+
cwd: z44.string().optional().describe("Optional repository cwd. Defaults to the caller agent cwd."),
|
|
58516
|
+
branchName: z44.string().optional(),
|
|
58517
|
+
baseBranch: z44.string().optional(),
|
|
58518
|
+
refName: z44.string().min(1).optional(),
|
|
58519
|
+
action: z44.enum(["branch-off", "checkout"]).optional(),
|
|
58520
|
+
githubPrNumber: z44.number().int().positive().optional()
|
|
58271
58521
|
},
|
|
58272
58522
|
outputSchema: {
|
|
58273
|
-
branchName:
|
|
58274
|
-
worktreePath:
|
|
58523
|
+
branchName: z44.string(),
|
|
58524
|
+
worktreePath: z44.string()
|
|
58275
58525
|
}
|
|
58276
58526
|
},
|
|
58277
58527
|
async ({ cwd, branchName, baseBranch, refName, action, githubPrNumber }) => {
|
|
@@ -58308,12 +58558,12 @@ async function createAgentMcpServer(options) {
|
|
|
58308
58558
|
title: "Archive worktree",
|
|
58309
58559
|
description: "Delete a Appostle-managed git worktree.",
|
|
58310
58560
|
inputSchema: {
|
|
58311
|
-
cwd:
|
|
58312
|
-
worktreePath:
|
|
58313
|
-
worktreeSlug:
|
|
58561
|
+
cwd: z44.string().optional().describe("Optional repository cwd. Defaults to the caller agent cwd."),
|
|
58562
|
+
worktreePath: z44.string().optional(),
|
|
58563
|
+
worktreeSlug: z44.string().optional()
|
|
58314
58564
|
},
|
|
58315
58565
|
outputSchema: {
|
|
58316
|
-
success:
|
|
58566
|
+
success: z44.boolean()
|
|
58317
58567
|
}
|
|
58318
58568
|
},
|
|
58319
58569
|
async ({ cwd, worktreePath, worktreeSlug }) => {
|
|
@@ -58335,14 +58585,14 @@ async function createAgentMcpServer(options) {
|
|
|
58335
58585
|
title: "Get agent activity",
|
|
58336
58586
|
description: "Return recent agent timeline entries as a curated summary.",
|
|
58337
58587
|
inputSchema: {
|
|
58338
|
-
agentId:
|
|
58339
|
-
limit:
|
|
58588
|
+
agentId: z44.string(),
|
|
58589
|
+
limit: z44.number().optional().describe("Optional limit for number of activities to include (most recent first).")
|
|
58340
58590
|
},
|
|
58341
58591
|
outputSchema: {
|
|
58342
|
-
agentId:
|
|
58343
|
-
updateCount:
|
|
58344
|
-
currentModeId:
|
|
58345
|
-
content:
|
|
58592
|
+
agentId: z44.string(),
|
|
58593
|
+
updateCount: z44.number(),
|
|
58594
|
+
currentModeId: z44.string().nullable(),
|
|
58595
|
+
content: z44.string()
|
|
58346
58596
|
}
|
|
58347
58597
|
},
|
|
58348
58598
|
async ({ agentId, limit }) => {
|
|
@@ -58383,12 +58633,12 @@ ${curatedContent}`;
|
|
|
58383
58633
|
title: "Set agent session mode",
|
|
58384
58634
|
description: "Switch the agent's session mode (plan, bypassPermissions, read-only, auto, etc.).",
|
|
58385
58635
|
inputSchema: {
|
|
58386
|
-
agentId:
|
|
58387
|
-
modeId:
|
|
58636
|
+
agentId: z44.string(),
|
|
58637
|
+
modeId: z44.string()
|
|
58388
58638
|
},
|
|
58389
58639
|
outputSchema: {
|
|
58390
|
-
success:
|
|
58391
|
-
newMode:
|
|
58640
|
+
success: z44.boolean(),
|
|
58641
|
+
newMode: z44.string()
|
|
58392
58642
|
}
|
|
58393
58643
|
},
|
|
58394
58644
|
async ({ agentId, modeId }) => {
|
|
@@ -58406,9 +58656,9 @@ ${curatedContent}`;
|
|
|
58406
58656
|
description: "Return all pending permission requests across all agents with the normalized payloads.",
|
|
58407
58657
|
inputSchema: {},
|
|
58408
58658
|
outputSchema: {
|
|
58409
|
-
permissions:
|
|
58410
|
-
|
|
58411
|
-
agentId:
|
|
58659
|
+
permissions: z44.array(
|
|
58660
|
+
z44.object({
|
|
58661
|
+
agentId: z44.string(),
|
|
58412
58662
|
status: AgentStatusEnum,
|
|
58413
58663
|
request: AgentPermissionRequestPayloadSchema
|
|
58414
58664
|
})
|
|
@@ -58436,12 +58686,12 @@ ${curatedContent}`;
|
|
|
58436
58686
|
title: "Respond to permission",
|
|
58437
58687
|
description: "Approve or deny a pending permission request with an AgentManager-compatible response payload.",
|
|
58438
58688
|
inputSchema: {
|
|
58439
|
-
agentId:
|
|
58440
|
-
requestId:
|
|
58689
|
+
agentId: z44.string(),
|
|
58690
|
+
requestId: z44.string(),
|
|
58441
58691
|
response: AgentPermissionResponseSchema
|
|
58442
58692
|
},
|
|
58443
58693
|
outputSchema: {
|
|
58444
|
-
success:
|
|
58694
|
+
success: z44.boolean()
|
|
58445
58695
|
}
|
|
58446
58696
|
},
|
|
58447
58697
|
async ({ agentId, requestId, response }) => {
|
|
@@ -58764,81 +59014,81 @@ var CheckoutDiffManager = class {
|
|
|
58764
59014
|
import { randomUUID as randomUUID13 } from "node:crypto";
|
|
58765
59015
|
import { promises as fs17 } from "node:fs";
|
|
58766
59016
|
import path30 from "node:path";
|
|
58767
|
-
import { z as
|
|
59017
|
+
import { z as z45 } from "zod";
|
|
58768
59018
|
var LOOP_ID_LENGTH = 8;
|
|
58769
59019
|
var DEFAULT_LOOP_PROVIDER = "claude";
|
|
58770
59020
|
var MAX_VERIFY_OUTPUT_BYTES = 64 * 1024;
|
|
58771
|
-
var LoopVerifyPromptSchema =
|
|
58772
|
-
passed:
|
|
58773
|
-
reason:
|
|
58774
|
-
});
|
|
58775
|
-
var LoopLogEntrySchema2 =
|
|
58776
|
-
seq:
|
|
58777
|
-
timestamp:
|
|
58778
|
-
iteration:
|
|
58779
|
-
source:
|
|
58780
|
-
level:
|
|
58781
|
-
text:
|
|
58782
|
-
});
|
|
58783
|
-
var LoopVerifyCheckResultSchema2 =
|
|
58784
|
-
command:
|
|
58785
|
-
exitCode:
|
|
58786
|
-
passed:
|
|
58787
|
-
stdout:
|
|
58788
|
-
stderr:
|
|
58789
|
-
startedAt:
|
|
58790
|
-
completedAt:
|
|
58791
|
-
});
|
|
58792
|
-
var LoopVerifyPromptResultSchema2 =
|
|
58793
|
-
passed:
|
|
58794
|
-
reason:
|
|
58795
|
-
verifierAgentId:
|
|
58796
|
-
startedAt:
|
|
58797
|
-
completedAt:
|
|
58798
|
-
});
|
|
58799
|
-
var LoopIterationRecordSchema2 =
|
|
58800
|
-
index:
|
|
58801
|
-
workerAgentId:
|
|
58802
|
-
workerStartedAt:
|
|
58803
|
-
workerCompletedAt:
|
|
58804
|
-
verifierAgentId:
|
|
58805
|
-
status:
|
|
58806
|
-
workerOutcome:
|
|
58807
|
-
failureReason:
|
|
58808
|
-
verifyChecks:
|
|
59021
|
+
var LoopVerifyPromptSchema = z45.object({
|
|
59022
|
+
passed: z45.boolean(),
|
|
59023
|
+
reason: z45.string().min(1)
|
|
59024
|
+
});
|
|
59025
|
+
var LoopLogEntrySchema2 = z45.object({
|
|
59026
|
+
seq: z45.number().int().positive(),
|
|
59027
|
+
timestamp: z45.string(),
|
|
59028
|
+
iteration: z45.number().int().positive().nullable(),
|
|
59029
|
+
source: z45.enum(["loop", "worker", "verifier", "verify-check"]),
|
|
59030
|
+
level: z45.enum(["info", "error"]),
|
|
59031
|
+
text: z45.string()
|
|
59032
|
+
});
|
|
59033
|
+
var LoopVerifyCheckResultSchema2 = z45.object({
|
|
59034
|
+
command: z45.string(),
|
|
59035
|
+
exitCode: z45.number().int(),
|
|
59036
|
+
passed: z45.boolean(),
|
|
59037
|
+
stdout: z45.string(),
|
|
59038
|
+
stderr: z45.string(),
|
|
59039
|
+
startedAt: z45.string(),
|
|
59040
|
+
completedAt: z45.string()
|
|
59041
|
+
});
|
|
59042
|
+
var LoopVerifyPromptResultSchema2 = z45.object({
|
|
59043
|
+
passed: z45.boolean(),
|
|
59044
|
+
reason: z45.string(),
|
|
59045
|
+
verifierAgentId: z45.string().nullable(),
|
|
59046
|
+
startedAt: z45.string(),
|
|
59047
|
+
completedAt: z45.string()
|
|
59048
|
+
});
|
|
59049
|
+
var LoopIterationRecordSchema2 = z45.object({
|
|
59050
|
+
index: z45.number().int().positive(),
|
|
59051
|
+
workerAgentId: z45.string().nullable(),
|
|
59052
|
+
workerStartedAt: z45.string(),
|
|
59053
|
+
workerCompletedAt: z45.string().nullable(),
|
|
59054
|
+
verifierAgentId: z45.string().nullable(),
|
|
59055
|
+
status: z45.enum(["running", "succeeded", "failed", "stopped"]),
|
|
59056
|
+
workerOutcome: z45.enum(["completed", "failed", "canceled"]).nullable(),
|
|
59057
|
+
failureReason: z45.string().nullable(),
|
|
59058
|
+
verifyChecks: z45.array(LoopVerifyCheckResultSchema2),
|
|
58809
59059
|
verifyPrompt: LoopVerifyPromptResultSchema2.nullable()
|
|
58810
59060
|
});
|
|
58811
|
-
var LoopRecordSchema2 =
|
|
58812
|
-
id:
|
|
58813
|
-
name:
|
|
58814
|
-
prompt:
|
|
58815
|
-
cwd:
|
|
58816
|
-
provider:
|
|
58817
|
-
model:
|
|
58818
|
-
workerProvider:
|
|
58819
|
-
workerModel:
|
|
58820
|
-
verifierProvider:
|
|
58821
|
-
verifierModel:
|
|
58822
|
-
verifyPrompt:
|
|
58823
|
-
verifyChecks:
|
|
58824
|
-
archive:
|
|
58825
|
-
sleepMs:
|
|
58826
|
-
maxIterations:
|
|
58827
|
-
maxTimeMs:
|
|
58828
|
-
status:
|
|
58829
|
-
createdAt:
|
|
58830
|
-
updatedAt:
|
|
58831
|
-
startedAt:
|
|
58832
|
-
completedAt:
|
|
58833
|
-
stopRequestedAt:
|
|
58834
|
-
iterations:
|
|
58835
|
-
logs:
|
|
58836
|
-
nextLogSeq:
|
|
58837
|
-
activeIteration:
|
|
58838
|
-
activeWorkerAgentId:
|
|
58839
|
-
activeVerifierAgentId:
|
|
58840
|
-
});
|
|
58841
|
-
var StoredLoopsSchema =
|
|
59061
|
+
var LoopRecordSchema2 = z45.object({
|
|
59062
|
+
id: z45.string(),
|
|
59063
|
+
name: z45.string().nullable(),
|
|
59064
|
+
prompt: z45.string(),
|
|
59065
|
+
cwd: z45.string(),
|
|
59066
|
+
provider: z45.string(),
|
|
59067
|
+
model: z45.string().nullable(),
|
|
59068
|
+
workerProvider: z45.string().nullable(),
|
|
59069
|
+
workerModel: z45.string().nullable(),
|
|
59070
|
+
verifierProvider: z45.string().nullable(),
|
|
59071
|
+
verifierModel: z45.string().nullable(),
|
|
59072
|
+
verifyPrompt: z45.string().nullable(),
|
|
59073
|
+
verifyChecks: z45.array(z45.string()),
|
|
59074
|
+
archive: z45.boolean(),
|
|
59075
|
+
sleepMs: z45.number().int().nonnegative(),
|
|
59076
|
+
maxIterations: z45.number().int().positive().nullable(),
|
|
59077
|
+
maxTimeMs: z45.number().int().positive().nullable(),
|
|
59078
|
+
status: z45.enum(["running", "succeeded", "failed", "stopped"]),
|
|
59079
|
+
createdAt: z45.string(),
|
|
59080
|
+
updatedAt: z45.string(),
|
|
59081
|
+
startedAt: z45.string(),
|
|
59082
|
+
completedAt: z45.string().nullable(),
|
|
59083
|
+
stopRequestedAt: z45.string().nullable(),
|
|
59084
|
+
iterations: z45.array(LoopIterationRecordSchema2),
|
|
59085
|
+
logs: z45.array(LoopLogEntrySchema2),
|
|
59086
|
+
nextLogSeq: z45.number().int().positive(),
|
|
59087
|
+
activeIteration: z45.number().int().positive().nullable(),
|
|
59088
|
+
activeWorkerAgentId: z45.string().nullable(),
|
|
59089
|
+
activeVerifierAgentId: z45.string().nullable()
|
|
59090
|
+
});
|
|
59091
|
+
var StoredLoopsSchema = z45.array(LoopRecordSchema2);
|
|
58842
59092
|
function nowIso() {
|
|
58843
59093
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
58844
59094
|
}
|
|
@@ -60033,8 +60283,8 @@ import { randomUUID as randomUUID15 } from "node:crypto";
|
|
|
60033
60283
|
// ../server/src/server/quest/store.ts
|
|
60034
60284
|
import { promises as fs18 } from "node:fs";
|
|
60035
60285
|
import path31 from "node:path";
|
|
60036
|
-
import { z as
|
|
60037
|
-
var StoredQuestsSchema =
|
|
60286
|
+
import { z as z46 } from "zod";
|
|
60287
|
+
var StoredQuestsSchema = z46.array(QuestRecordSchema);
|
|
60038
60288
|
var QuestStore = class {
|
|
60039
60289
|
constructor(options) {
|
|
60040
60290
|
this.filePath = path31.join(options.appostleHome, "quests", "quests.json");
|
|
@@ -60138,7 +60388,7 @@ function getRulesForKind(kind) {
|
|
|
60138
60388
|
}
|
|
60139
60389
|
|
|
60140
60390
|
// ../server/src/server/quest/quest-metadata-generator.ts
|
|
60141
|
-
import { z as
|
|
60391
|
+
import { z as z47 } from "zod";
|
|
60142
60392
|
var MAX_AUTO_QUEST_NAME_CHARS = 40;
|
|
60143
60393
|
function hasExplicitName(name) {
|
|
60144
60394
|
return Boolean(name && name.trim().length > 0);
|
|
@@ -60150,7 +60400,7 @@ function normalizeAutoName(name) {
|
|
|
60150
60400
|
}
|
|
60151
60401
|
return normalized.slice(0, MAX_AUTO_QUEST_NAME_CHARS).trim() || null;
|
|
60152
60402
|
}
|
|
60153
|
-
function
|
|
60403
|
+
function buildPrompt4(prompt) {
|
|
60154
60404
|
return [
|
|
60155
60405
|
"Generate a short label for a multi-agent quest based on the user prompt.",
|
|
60156
60406
|
`Name: short descriptive label (<= ${MAX_AUTO_QUEST_NAME_CHARS} chars).`,
|
|
@@ -60168,8 +60418,8 @@ async function generateAndApplyQuestMetadata(options) {
|
|
|
60168
60418
|
if (hasExplicitName(options.explicitName)) {
|
|
60169
60419
|
return;
|
|
60170
60420
|
}
|
|
60171
|
-
const schema =
|
|
60172
|
-
name:
|
|
60421
|
+
const schema = z47.object({
|
|
60422
|
+
name: z47.string().min(1).max(MAX_AUTO_QUEST_NAME_CHARS)
|
|
60173
60423
|
});
|
|
60174
60424
|
const generator = options.deps?.generateStructuredAgentResponseWithFallback ?? generateStructuredAgentResponseWithFallback;
|
|
60175
60425
|
let result;
|
|
@@ -60177,7 +60427,7 @@ async function generateAndApplyQuestMetadata(options) {
|
|
|
60177
60427
|
result = await generator({
|
|
60178
60428
|
manager: options.questService.agentManager,
|
|
60179
60429
|
cwd: options.cwd,
|
|
60180
|
-
prompt:
|
|
60430
|
+
prompt: buildPrompt4(prompt),
|
|
60181
60431
|
schema,
|
|
60182
60432
|
schemaName: "QuestMetadata",
|
|
60183
60433
|
maxRetries: 2,
|
|
@@ -60849,12 +61099,12 @@ import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
|
60849
61099
|
|
|
60850
61100
|
// ../server/src/server/quest/orchestrator-mcp.ts
|
|
60851
61101
|
import { createSdkMcpServer as createSdkMcpServer2, tool as tool3 } from "@anthropic-ai/claude-agent-sdk";
|
|
60852
|
-
import { z as
|
|
61102
|
+
import { z as z48 } from "zod";
|
|
60853
61103
|
var HANDOFF_INPUT_SHAPE = {
|
|
60854
|
-
rolePath:
|
|
61104
|
+
rolePath: z48.string().min(1).describe(
|
|
60855
61105
|
"Absolute filesystem path to the role .md file the worker should adopt as its system prompt. Must be one of the role file paths listed in your team roster \u2014 do not invent paths."
|
|
60856
61106
|
),
|
|
60857
|
-
task:
|
|
61107
|
+
task: z48.string().min(1).describe(
|
|
60858
61108
|
"Concrete, self-contained instruction for the worker. The worker has its own toolbelt and reads the role at rolePath as its system prompt \u2014 write the task as a normal user message describing what to do, what inputs to read, and where to write outputs. Reference the hivemind doc by absolute path if relevant."
|
|
60859
61109
|
)
|
|
60860
61110
|
};
|
|
@@ -62576,13 +62826,13 @@ function createTerminalManager() {
|
|
|
62576
62826
|
}
|
|
62577
62827
|
|
|
62578
62828
|
// ../server/src/shared/connection-offer.ts
|
|
62579
|
-
import { z as
|
|
62580
|
-
var ConnectionOfferV2Schema =
|
|
62581
|
-
v:
|
|
62582
|
-
serverId:
|
|
62583
|
-
daemonPublicKeyB64:
|
|
62584
|
-
relay:
|
|
62585
|
-
endpoint:
|
|
62829
|
+
import { z as z49 } from "zod";
|
|
62830
|
+
var ConnectionOfferV2Schema = z49.object({
|
|
62831
|
+
v: z49.literal(2),
|
|
62832
|
+
serverId: z49.string().min(1),
|
|
62833
|
+
daemonPublicKeyB64: z49.string().min(1),
|
|
62834
|
+
relay: z49.object({
|
|
62835
|
+
endpoint: z49.string().min(1)
|
|
62586
62836
|
})
|
|
62587
62837
|
});
|
|
62588
62838
|
|
|
@@ -64212,21 +64462,21 @@ async function closeAllAgents(logger, agentManager) {
|
|
|
64212
64462
|
|
|
64213
64463
|
// ../server/src/server/config.ts
|
|
64214
64464
|
import path37 from "node:path";
|
|
64215
|
-
import { z as
|
|
64465
|
+
import { z as z53 } from "zod";
|
|
64216
64466
|
|
|
64217
64467
|
// ../server/src/server/speech/speech-config-resolver.ts
|
|
64218
|
-
import { z as
|
|
64468
|
+
import { z as z52 } from "zod";
|
|
64219
64469
|
|
|
64220
64470
|
// ../server/src/server/speech/providers/local/config.ts
|
|
64221
64471
|
import path36 from "node:path";
|
|
64222
|
-
import { z as
|
|
64472
|
+
import { z as z50 } from "zod";
|
|
64223
64473
|
var DEFAULT_LOCAL_MODELS_SUBDIR = path36.join("models", "local-speech");
|
|
64224
|
-
var NumberLikeSchema2 =
|
|
64225
|
-
var OptionalFiniteNumberSchema2 = NumberLikeSchema2.pipe(
|
|
64226
|
-
var OptionalIntegerSchema = NumberLikeSchema2.pipe(
|
|
64227
|
-
var LocalSpeechResolutionSchema =
|
|
64228
|
-
includeProviderConfig:
|
|
64229
|
-
modelsDir:
|
|
64474
|
+
var NumberLikeSchema2 = z50.union([z50.number(), z50.string().trim().min(1)]);
|
|
64475
|
+
var OptionalFiniteNumberSchema2 = NumberLikeSchema2.pipe(z50.coerce.number().finite()).optional();
|
|
64476
|
+
var OptionalIntegerSchema = NumberLikeSchema2.pipe(z50.coerce.number().int()).optional();
|
|
64477
|
+
var LocalSpeechResolutionSchema = z50.object({
|
|
64478
|
+
includeProviderConfig: z50.boolean(),
|
|
64479
|
+
modelsDir: z50.string().trim().min(1),
|
|
64230
64480
|
dictationLocalSttModel: LocalSttModelIdSchema.default(DEFAULT_LOCAL_STT_MODEL),
|
|
64231
64481
|
voiceLocalSttModel: LocalSttModelIdSchema.default(DEFAULT_LOCAL_STT_MODEL),
|
|
64232
64482
|
voiceLocalTtsModel: LocalTtsModelIdSchema.default(DEFAULT_LOCAL_TTS_MODEL),
|
|
@@ -64282,17 +64532,17 @@ function resolveLocalSpeechConfig(params) {
|
|
|
64282
64532
|
}
|
|
64283
64533
|
|
|
64284
64534
|
// ../server/src/server/speech/speech-types.ts
|
|
64285
|
-
import { z as
|
|
64286
|
-
var SpeechProviderIdSchema2 =
|
|
64287
|
-
var RequestedSpeechProviderSchema =
|
|
64535
|
+
import { z as z51 } from "zod";
|
|
64536
|
+
var SpeechProviderIdSchema2 = z51.enum(["openai", "local"]);
|
|
64537
|
+
var RequestedSpeechProviderSchema = z51.object({
|
|
64288
64538
|
provider: SpeechProviderIdSchema2,
|
|
64289
|
-
explicit:
|
|
64290
|
-
enabled:
|
|
64539
|
+
explicit: z51.boolean(),
|
|
64540
|
+
enabled: z51.boolean().optional()
|
|
64291
64541
|
});
|
|
64292
64542
|
|
|
64293
64543
|
// ../server/src/server/speech/speech-config-resolver.ts
|
|
64294
|
-
var OptionalSpeechProviderSchema =
|
|
64295
|
-
var OptionalBooleanFlagSchema =
|
|
64544
|
+
var OptionalSpeechProviderSchema = z52.string().trim().toLowerCase().pipe(SpeechProviderIdSchema2).optional();
|
|
64545
|
+
var OptionalBooleanFlagSchema = z52.union([z52.boolean(), z52.string().trim().toLowerCase()]).optional().transform((value) => {
|
|
64296
64546
|
if (typeof value === "boolean") {
|
|
64297
64547
|
return value;
|
|
64298
64548
|
}
|
|
@@ -64307,7 +64557,7 @@ var OptionalBooleanFlagSchema = z51.union([z51.boolean(), z51.string().trim().to
|
|
|
64307
64557
|
}
|
|
64308
64558
|
return void 0;
|
|
64309
64559
|
});
|
|
64310
|
-
var RequestedSpeechProvidersSchema =
|
|
64560
|
+
var RequestedSpeechProvidersSchema = z52.object({
|
|
64311
64561
|
dictationStt: OptionalSpeechProviderSchema.default("local"),
|
|
64312
64562
|
voiceTurnDetection: OptionalSpeechProviderSchema.default("local"),
|
|
64313
64563
|
voiceStt: OptionalSpeechProviderSchema.default("local"),
|
|
@@ -64416,9 +64666,9 @@ function parseBooleanEnv(value) {
|
|
|
64416
64666
|
}
|
|
64417
64667
|
return void 0;
|
|
64418
64668
|
}
|
|
64419
|
-
var OptionalVoiceLlmProviderSchema =
|
|
64669
|
+
var OptionalVoiceLlmProviderSchema = z53.union([z53.string(), z53.null(), z53.undefined()]).transform(
|
|
64420
64670
|
(value) => typeof value === "string" ? value.trim().toLowerCase() : null
|
|
64421
|
-
).pipe(
|
|
64671
|
+
).pipe(z53.union([AgentProviderSchema, z53.null()]));
|
|
64422
64672
|
function parseOptionalVoiceLlmProvider(value) {
|
|
64423
64673
|
const parsed = OptionalVoiceLlmProviderSchema.safeParse(value);
|
|
64424
64674
|
return parsed.success ? parsed.data : null;
|