@funnycode/myclaude 0.1.276 → 0.1.280
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/myclaude.js +142 -18
- package/dist/myclaude.mjs +142 -18
- package/package.json +1 -1
package/dist/myclaude.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// MACRO - build-time constants (injected by build.ts)
|
|
5
5
|
// MACRO injected by build script
|
|
6
6
|
globalThis.MACRO = {
|
|
7
|
-
VERSION: "0.1.
|
|
8
|
-
BUILD_TIME: "2026-08-
|
|
7
|
+
VERSION: "0.1.280",
|
|
8
|
+
BUILD_TIME: "2026-08-19T00:59:52.123Z",
|
|
9
9
|
PACKAGE_URL: "@funnycode/myclaude",
|
|
10
10
|
NATIVE_PACKAGE_URL: "@funnycode/myclaude",
|
|
11
11
|
VERSION_CHANGELOG: '',
|
|
@@ -120027,7 +120027,7 @@ var package_default;
|
|
|
120027
120027
|
var init_package = __esm(() => {
|
|
120028
120028
|
package_default = {
|
|
120029
120029
|
name: "@funnycode/myclaude",
|
|
120030
|
-
version: "0.1.
|
|
120030
|
+
version: "0.1.280",
|
|
120031
120031
|
private: false,
|
|
120032
120032
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
120033
120033
|
license: "MIT",
|
|
@@ -282575,9 +282575,6 @@ __export(exports_sessionIdCompat, {
|
|
|
282575
282575
|
getCseShimGate: () => getCseShimGate
|
|
282576
282576
|
});
|
|
282577
282577
|
function setCseShimGate(gate) {
|
|
282578
|
-
if (_gateLocked)
|
|
282579
|
-
return;
|
|
282580
|
-
_gateLocked = true;
|
|
282581
282578
|
_isCseShimEnabled = gate;
|
|
282582
282579
|
}
|
|
282583
282580
|
function getCseShimGate() {
|
|
@@ -282585,7 +282582,6 @@ function getCseShimGate() {
|
|
|
282585
282582
|
}
|
|
282586
282583
|
function resetCseShimGateForTesting() {
|
|
282587
282584
|
_isCseShimEnabled = undefined;
|
|
282588
|
-
_gateLocked = false;
|
|
282589
282585
|
}
|
|
282590
282586
|
function toCompatSessionId(id) {
|
|
282591
282587
|
if (!id.startsWith("cse_"))
|
|
@@ -282601,7 +282597,7 @@ function toInfraSessionId(id) {
|
|
|
282601
282597
|
return id;
|
|
282602
282598
|
return "cse_" + id.slice("session_".length);
|
|
282603
282599
|
}
|
|
282604
|
-
var _isCseShimEnabled
|
|
282600
|
+
var _isCseShimEnabled;
|
|
282605
282601
|
|
|
282606
282602
|
// src/constants/product.ts
|
|
282607
282603
|
function isRemoteSessionStaging(sessionId, ingressUrl) {
|
|
@@ -480210,14 +480206,63 @@ function sanitizeCommand(command6) {
|
|
|
480210
480206
|
}
|
|
480211
480207
|
return argv;
|
|
480212
480208
|
}
|
|
480213
|
-
|
|
480209
|
+
function escapeCodeSpan(text2) {
|
|
480210
|
+
const maxRun = (text2.match(/`+/g) || []).reduce((m2, s) => Math.max(m2, s.length), 0);
|
|
480211
|
+
const delim = "`".repeat(maxRun + 1);
|
|
480212
|
+
const pad = text2.startsWith("`") || text2.endsWith("`") ? " " : "";
|
|
480213
|
+
return `${delim}${pad}${text2}${pad}${delim}`;
|
|
480214
|
+
}
|
|
480215
|
+
function escapeMarkdown(text2) {
|
|
480216
|
+
return text2.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\*/g, "\\*").replace(/_/g, "\\_").replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/#/g, "\\#").replace(/</g, "<").replace(/>/g, ">").replace(/!/g, "\\!").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
|
|
480217
|
+
}
|
|
480218
|
+
function generateDiffPreview(flow) {
|
|
480219
|
+
const lines2 = [];
|
|
480220
|
+
lines2.push(`## Diff Preview: ${escapeMarkdown(flow.name)}`);
|
|
480221
|
+
lines2.push(``);
|
|
480222
|
+
lines2.push(`**Description**: ${escapeMarkdown(flow.description)}`);
|
|
480223
|
+
lines2.push(``);
|
|
480224
|
+
lines2.push(`**Steps (${flow.steps.length}):**`);
|
|
480225
|
+
lines2.push(``);
|
|
480226
|
+
for (let i3 = 0;i3 < flow.steps.length; i3++) {
|
|
480227
|
+
const step = flow.steps[i3];
|
|
480228
|
+
lines2.push(`### Step ${i3 + 1}: ${escapeMarkdown(step.description)}`);
|
|
480229
|
+
if (step.reasoning) {
|
|
480230
|
+
lines2.push(`- **Reasoning**: ${escapeMarkdown(step.reasoning)}`);
|
|
480231
|
+
}
|
|
480232
|
+
if (step.command) {
|
|
480233
|
+
lines2.push(`- **Command**: ${escapeCodeSpan(step.command)}`);
|
|
480234
|
+
}
|
|
480235
|
+
if (step.files && step.files.length > 0) {
|
|
480236
|
+
lines2.push(`- **Files**: ${step.files.map((f2) => escapeCodeSpan(f2)).join(", ")}`);
|
|
480237
|
+
}
|
|
480238
|
+
lines2.push(``);
|
|
480239
|
+
}
|
|
480240
|
+
lines2.push(`---`);
|
|
480241
|
+
lines2.push(`Review the above changes carefully before approving.`);
|
|
480242
|
+
return lines2.join(`
|
|
480243
|
+
`);
|
|
480244
|
+
}
|
|
480245
|
+
async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFail, onComplete, options) {
|
|
480246
|
+
const ids = flow.steps.map((s) => s.id);
|
|
480247
|
+
if (new Set(ids).size !== ids.length) {
|
|
480248
|
+
throw new Error("Flow definition contains duplicate step IDs");
|
|
480249
|
+
}
|
|
480214
480250
|
const state = {
|
|
480215
480251
|
currentStepIndex: 0,
|
|
480216
480252
|
completedSteps: [],
|
|
480217
480253
|
failedSteps: [],
|
|
480218
480254
|
totalSteps: flow.steps.length,
|
|
480219
|
-
startTime: Date.now()
|
|
480255
|
+
startTime: Date.now(),
|
|
480256
|
+
aborted: false
|
|
480220
480257
|
};
|
|
480258
|
+
if (options?.preview && options?.onPreview) {
|
|
480259
|
+
const preview = generateDiffPreview(flow);
|
|
480260
|
+
const approved = await options.onPreview(preview);
|
|
480261
|
+
if (!approved) {
|
|
480262
|
+
state.aborted = true;
|
|
480263
|
+
return state;
|
|
480264
|
+
}
|
|
480265
|
+
}
|
|
480221
480266
|
for (let i3 = 0;i3 < flow.steps.length; i3++) {
|
|
480222
480267
|
const step = flow.steps[i3];
|
|
480223
480268
|
state.currentStepIndex = i3;
|
|
@@ -480252,6 +480297,7 @@ async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFa
|
|
|
480252
480297
|
}
|
|
480253
480298
|
const shouldContinue = await shouldContinueOnError(error52, step);
|
|
480254
480299
|
if (!shouldContinue) {
|
|
480300
|
+
state.aborted = true;
|
|
480255
480301
|
break;
|
|
480256
480302
|
}
|
|
480257
480303
|
}
|
|
@@ -480286,11 +480332,13 @@ async function shouldContinueOnError(error52, step) {
|
|
|
480286
480332
|
if (err2.code && transientCodes.includes(err2.code)) {
|
|
480287
480333
|
return true;
|
|
480288
480334
|
}
|
|
480289
|
-
|
|
480335
|
+
const ipv4Port = String.raw`\d{1,3}(?:\.\d{1,3}){3}:\d+`;
|
|
480336
|
+
const hostnamePort = String.raw`[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?){1,}:\d+`;
|
|
480337
|
+
if (transientCodes.some((code) => new RegExp(`(^|:\\s*)${code}\\b|\\b${code}\\s+(?:${ipv4Port}|${hostnamePort})`).test(error52.message))) {
|
|
480290
480338
|
return true;
|
|
480291
480339
|
}
|
|
480292
|
-
if (
|
|
480293
|
-
return
|
|
480340
|
+
if (/^No bridge\.(runCommand|editFile) available/.test(error52.message)) {
|
|
480341
|
+
return false;
|
|
480294
480342
|
}
|
|
480295
480343
|
return false;
|
|
480296
480344
|
}
|
|
@@ -480299,11 +480347,6 @@ var init_executor = __esm(() => {
|
|
|
480299
480347
|
import_shell_quote4 = __toESM(require_shell_quote(), 1);
|
|
480300
480348
|
ALLOWED_COMMANDS = new Set([
|
|
480301
480349
|
"npm",
|
|
480302
|
-
"npx",
|
|
480303
|
-
"node",
|
|
480304
|
-
"bun",
|
|
480305
|
-
"yarn",
|
|
480306
|
-
"pnpm",
|
|
480307
480350
|
"mkdir",
|
|
480308
480351
|
"touch",
|
|
480309
480352
|
"cp",
|
|
@@ -480395,6 +480438,22 @@ var init_flow = __esm(() => {
|
|
|
480395
480438
|
if (!flow) {
|
|
480396
480439
|
throw new Error(`Flow not found: ${args}`);
|
|
480397
480440
|
}
|
|
480441
|
+
if (context2?.preview !== false) {
|
|
480442
|
+
const preview = generateDiffPreview(flow);
|
|
480443
|
+
console.log(preview);
|
|
480444
|
+
const approved = context2?.onPreview ? await context2.onPreview(preview) : true;
|
|
480445
|
+
if (!approved) {
|
|
480446
|
+
console.log("Flow execution aborted by user.");
|
|
480447
|
+
return {
|
|
480448
|
+
currentStepIndex: 0,
|
|
480449
|
+
completedSteps: [],
|
|
480450
|
+
failedSteps: [],
|
|
480451
|
+
totalSteps: flow.steps.length,
|
|
480452
|
+
startTime: Date.now(),
|
|
480453
|
+
aborted: true
|
|
480454
|
+
};
|
|
480455
|
+
}
|
|
480456
|
+
}
|
|
480398
480457
|
const state = await executeFlow(flow, context2, async (step, state2) => {
|
|
480399
480458
|
console.log(`
|
|
480400
480459
|
▶️ Starting step ${state2.currentStepIndex + 1}/${state2.totalSteps}: ${step.description}`);
|
|
@@ -497326,6 +497385,69 @@ Wait for user confirmation before executing the first step.
|
|
|
497326
497385
|
agent_default = agent;
|
|
497327
497386
|
});
|
|
497328
497387
|
|
|
497388
|
+
// src/commands/composer.ts
|
|
497389
|
+
function getComposerPrompt(args) {
|
|
497390
|
+
const featureDesc = args.trim() || "(no description provided)";
|
|
497391
|
+
return `You are in **Composer Mode** — a multi-file editing workflow inspired by Cursor's Composer.
|
|
497392
|
+
|
|
497393
|
+
## User's Request
|
|
497394
|
+
|
|
497395
|
+
${featureDesc}
|
|
497396
|
+
|
|
497397
|
+
## Your Task
|
|
497398
|
+
|
|
497399
|
+
You will implement this feature across multiple files in a single turn. Follow this workflow:
|
|
497400
|
+
|
|
497401
|
+
### 1. Analyze & Plan
|
|
497402
|
+
- Understand the feature request and identify all files that need to be created or modified
|
|
497403
|
+
- Create a plan listing every file that will be touched, with a brief description of changes for each
|
|
497404
|
+
- Consider dependencies between files (imports, types, shared utilities)
|
|
497405
|
+
- Identify test files that need to be created or updated
|
|
497406
|
+
|
|
497407
|
+
### 2. Execute Multi-File Edits
|
|
497408
|
+
- Edit all necessary files to implement the feature
|
|
497409
|
+
- Work through files in dependency order (shared types/utils first, then consumers)
|
|
497410
|
+
- Ensure imports and exports are consistent across all files
|
|
497411
|
+
- Keep changes focused — only modify what's needed for this feature
|
|
497412
|
+
|
|
497413
|
+
### 3. Verify
|
|
497414
|
+
- Run the test suite to verify the implementation works
|
|
497415
|
+
- Run the build to ensure no type or compile errors
|
|
497416
|
+
- If tests fail, fix the issues and re-verify
|
|
497417
|
+
|
|
497418
|
+
## Multi-File Editing Guidelines
|
|
497419
|
+
|
|
497420
|
+
- **Coordinate changes**: When editing a shared type or utility, update all consumers in the same turn
|
|
497421
|
+
- **Consistent naming**: Follow existing project conventions for file names, exports, and patterns
|
|
497422
|
+
- **Minimal diffs**: Make surgical edits — avoid rewriting entire files when small changes suffice
|
|
497423
|
+
- **Test coverage**: Add or update tests for all new functionality
|
|
497424
|
+
- **Error handling**: Add appropriate error handling for new code paths
|
|
497425
|
+
|
|
497426
|
+
## Important Rules
|
|
497427
|
+
|
|
497428
|
+
- Edit all files needed to complete the feature in a single turn
|
|
497429
|
+
- Do not ask for confirmation between file edits — proceed autonomously
|
|
497430
|
+
- After all edits are complete, run tests and build to verify
|
|
497431
|
+
- If verification fails, fix issues and re-run until green
|
|
497432
|
+
- Report a summary of all files changed at the end`;
|
|
497433
|
+
}
|
|
497434
|
+
var composer, composer_default;
|
|
497435
|
+
var init_composer = __esm(() => {
|
|
497436
|
+
composer = {
|
|
497437
|
+
type: "prompt",
|
|
497438
|
+
name: "composer",
|
|
497439
|
+
description: "Composer mode — edit multiple files simultaneously to implement a feature across the codebase",
|
|
497440
|
+
argumentHint: "<feature description>",
|
|
497441
|
+
progressMessage: "composer mode executing",
|
|
497442
|
+
contentLength: 0,
|
|
497443
|
+
source: "builtin",
|
|
497444
|
+
async getPromptForCommand(args) {
|
|
497445
|
+
return [{ type: "text", text: getComposerPrompt(args) }];
|
|
497446
|
+
}
|
|
497447
|
+
};
|
|
497448
|
+
composer_default = composer;
|
|
497449
|
+
});
|
|
497450
|
+
|
|
497329
497451
|
// src/commands/remember.ts
|
|
497330
497452
|
import { appendFile as appendFile5, mkdir as mkdir36 } from "fs/promises";
|
|
497331
497453
|
import { join as join133 } from "path";
|
|
@@ -506039,6 +506161,7 @@ var init_commands2 = __esm(() => {
|
|
|
506039
506161
|
init_frontend_tdd();
|
|
506040
506162
|
init_agentic_tdd();
|
|
506041
506163
|
init_agent2();
|
|
506164
|
+
init_composer();
|
|
506042
506165
|
init_remember();
|
|
506043
506166
|
init_log3();
|
|
506044
506167
|
init_errors();
|
|
@@ -506172,6 +506295,7 @@ var init_commands2 = __esm(() => {
|
|
|
506172
506295
|
frontend_tdd_default,
|
|
506173
506296
|
agentic_tdd_default,
|
|
506174
506297
|
agent_default,
|
|
506298
|
+
composer_default,
|
|
506175
506299
|
tag_default,
|
|
506176
506300
|
theme_default,
|
|
506177
506301
|
feedback_default,
|
package/dist/myclaude.mjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// MACRO - build-time constants (injected by build.ts)
|
|
5
5
|
// MACRO injected by build script
|
|
6
6
|
globalThis.MACRO = {
|
|
7
|
-
VERSION: "0.1.
|
|
8
|
-
BUILD_TIME: "2026-08-
|
|
7
|
+
VERSION: "0.1.280",
|
|
8
|
+
BUILD_TIME: "2026-08-19T00:59:52.123Z",
|
|
9
9
|
PACKAGE_URL: "@funnycode/myclaude",
|
|
10
10
|
NATIVE_PACKAGE_URL: "@funnycode/myclaude",
|
|
11
11
|
VERSION_CHANGELOG: '',
|
|
@@ -120027,7 +120027,7 @@ var package_default;
|
|
|
120027
120027
|
var init_package = __esm(() => {
|
|
120028
120028
|
package_default = {
|
|
120029
120029
|
name: "@funnycode/myclaude",
|
|
120030
|
-
version: "0.1.
|
|
120030
|
+
version: "0.1.280",
|
|
120031
120031
|
private: false,
|
|
120032
120032
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
120033
120033
|
license: "MIT",
|
|
@@ -282575,9 +282575,6 @@ __export(exports_sessionIdCompat, {
|
|
|
282575
282575
|
getCseShimGate: () => getCseShimGate
|
|
282576
282576
|
});
|
|
282577
282577
|
function setCseShimGate(gate) {
|
|
282578
|
-
if (_gateLocked)
|
|
282579
|
-
return;
|
|
282580
|
-
_gateLocked = true;
|
|
282581
282578
|
_isCseShimEnabled = gate;
|
|
282582
282579
|
}
|
|
282583
282580
|
function getCseShimGate() {
|
|
@@ -282585,7 +282582,6 @@ function getCseShimGate() {
|
|
|
282585
282582
|
}
|
|
282586
282583
|
function resetCseShimGateForTesting() {
|
|
282587
282584
|
_isCseShimEnabled = undefined;
|
|
282588
|
-
_gateLocked = false;
|
|
282589
282585
|
}
|
|
282590
282586
|
function toCompatSessionId(id) {
|
|
282591
282587
|
if (!id.startsWith("cse_"))
|
|
@@ -282601,7 +282597,7 @@ function toInfraSessionId(id) {
|
|
|
282601
282597
|
return id;
|
|
282602
282598
|
return "cse_" + id.slice("session_".length);
|
|
282603
282599
|
}
|
|
282604
|
-
var _isCseShimEnabled
|
|
282600
|
+
var _isCseShimEnabled;
|
|
282605
282601
|
|
|
282606
282602
|
// src/constants/product.ts
|
|
282607
282603
|
function isRemoteSessionStaging(sessionId, ingressUrl) {
|
|
@@ -480210,14 +480206,63 @@ function sanitizeCommand(command6) {
|
|
|
480210
480206
|
}
|
|
480211
480207
|
return argv;
|
|
480212
480208
|
}
|
|
480213
|
-
|
|
480209
|
+
function escapeCodeSpan(text2) {
|
|
480210
|
+
const maxRun = (text2.match(/`+/g) || []).reduce((m2, s) => Math.max(m2, s.length), 0);
|
|
480211
|
+
const delim = "`".repeat(maxRun + 1);
|
|
480212
|
+
const pad = text2.startsWith("`") || text2.endsWith("`") ? " " : "";
|
|
480213
|
+
return `${delim}${pad}${text2}${pad}${delim}`;
|
|
480214
|
+
}
|
|
480215
|
+
function escapeMarkdown(text2) {
|
|
480216
|
+
return text2.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\*/g, "\\*").replace(/_/g, "\\_").replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/#/g, "\\#").replace(/</g, "<").replace(/>/g, ">").replace(/!/g, "\\!").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
|
|
480217
|
+
}
|
|
480218
|
+
function generateDiffPreview(flow) {
|
|
480219
|
+
const lines2 = [];
|
|
480220
|
+
lines2.push(`## Diff Preview: ${escapeMarkdown(flow.name)}`);
|
|
480221
|
+
lines2.push(``);
|
|
480222
|
+
lines2.push(`**Description**: ${escapeMarkdown(flow.description)}`);
|
|
480223
|
+
lines2.push(``);
|
|
480224
|
+
lines2.push(`**Steps (${flow.steps.length}):**`);
|
|
480225
|
+
lines2.push(``);
|
|
480226
|
+
for (let i3 = 0;i3 < flow.steps.length; i3++) {
|
|
480227
|
+
const step = flow.steps[i3];
|
|
480228
|
+
lines2.push(`### Step ${i3 + 1}: ${escapeMarkdown(step.description)}`);
|
|
480229
|
+
if (step.reasoning) {
|
|
480230
|
+
lines2.push(`- **Reasoning**: ${escapeMarkdown(step.reasoning)}`);
|
|
480231
|
+
}
|
|
480232
|
+
if (step.command) {
|
|
480233
|
+
lines2.push(`- **Command**: ${escapeCodeSpan(step.command)}`);
|
|
480234
|
+
}
|
|
480235
|
+
if (step.files && step.files.length > 0) {
|
|
480236
|
+
lines2.push(`- **Files**: ${step.files.map((f2) => escapeCodeSpan(f2)).join(", ")}`);
|
|
480237
|
+
}
|
|
480238
|
+
lines2.push(``);
|
|
480239
|
+
}
|
|
480240
|
+
lines2.push(`---`);
|
|
480241
|
+
lines2.push(`Review the above changes carefully before approving.`);
|
|
480242
|
+
return lines2.join(`
|
|
480243
|
+
`);
|
|
480244
|
+
}
|
|
480245
|
+
async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFail, onComplete, options) {
|
|
480246
|
+
const ids = flow.steps.map((s) => s.id);
|
|
480247
|
+
if (new Set(ids).size !== ids.length) {
|
|
480248
|
+
throw new Error("Flow definition contains duplicate step IDs");
|
|
480249
|
+
}
|
|
480214
480250
|
const state = {
|
|
480215
480251
|
currentStepIndex: 0,
|
|
480216
480252
|
completedSteps: [],
|
|
480217
480253
|
failedSteps: [],
|
|
480218
480254
|
totalSteps: flow.steps.length,
|
|
480219
|
-
startTime: Date.now()
|
|
480255
|
+
startTime: Date.now(),
|
|
480256
|
+
aborted: false
|
|
480220
480257
|
};
|
|
480258
|
+
if (options?.preview && options?.onPreview) {
|
|
480259
|
+
const preview = generateDiffPreview(flow);
|
|
480260
|
+
const approved = await options.onPreview(preview);
|
|
480261
|
+
if (!approved) {
|
|
480262
|
+
state.aborted = true;
|
|
480263
|
+
return state;
|
|
480264
|
+
}
|
|
480265
|
+
}
|
|
480221
480266
|
for (let i3 = 0;i3 < flow.steps.length; i3++) {
|
|
480222
480267
|
const step = flow.steps[i3];
|
|
480223
480268
|
state.currentStepIndex = i3;
|
|
@@ -480252,6 +480297,7 @@ async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFa
|
|
|
480252
480297
|
}
|
|
480253
480298
|
const shouldContinue = await shouldContinueOnError(error52, step);
|
|
480254
480299
|
if (!shouldContinue) {
|
|
480300
|
+
state.aborted = true;
|
|
480255
480301
|
break;
|
|
480256
480302
|
}
|
|
480257
480303
|
}
|
|
@@ -480286,11 +480332,13 @@ async function shouldContinueOnError(error52, step) {
|
|
|
480286
480332
|
if (err2.code && transientCodes.includes(err2.code)) {
|
|
480287
480333
|
return true;
|
|
480288
480334
|
}
|
|
480289
|
-
|
|
480335
|
+
const ipv4Port = String.raw`\d{1,3}(?:\.\d{1,3}){3}:\d+`;
|
|
480336
|
+
const hostnamePort = String.raw`[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?){1,}:\d+`;
|
|
480337
|
+
if (transientCodes.some((code) => new RegExp(`(^|:\\s*)${code}\\b|\\b${code}\\s+(?:${ipv4Port}|${hostnamePort})`).test(error52.message))) {
|
|
480290
480338
|
return true;
|
|
480291
480339
|
}
|
|
480292
|
-
if (
|
|
480293
|
-
return
|
|
480340
|
+
if (/^No bridge\.(runCommand|editFile) available/.test(error52.message)) {
|
|
480341
|
+
return false;
|
|
480294
480342
|
}
|
|
480295
480343
|
return false;
|
|
480296
480344
|
}
|
|
@@ -480299,11 +480347,6 @@ var init_executor = __esm(() => {
|
|
|
480299
480347
|
import_shell_quote4 = __toESM(require_shell_quote(), 1);
|
|
480300
480348
|
ALLOWED_COMMANDS = new Set([
|
|
480301
480349
|
"npm",
|
|
480302
|
-
"npx",
|
|
480303
|
-
"node",
|
|
480304
|
-
"bun",
|
|
480305
|
-
"yarn",
|
|
480306
|
-
"pnpm",
|
|
480307
480350
|
"mkdir",
|
|
480308
480351
|
"touch",
|
|
480309
480352
|
"cp",
|
|
@@ -480395,6 +480438,22 @@ var init_flow = __esm(() => {
|
|
|
480395
480438
|
if (!flow) {
|
|
480396
480439
|
throw new Error(`Flow not found: ${args}`);
|
|
480397
480440
|
}
|
|
480441
|
+
if (context2?.preview !== false) {
|
|
480442
|
+
const preview = generateDiffPreview(flow);
|
|
480443
|
+
console.log(preview);
|
|
480444
|
+
const approved = context2?.onPreview ? await context2.onPreview(preview) : true;
|
|
480445
|
+
if (!approved) {
|
|
480446
|
+
console.log("Flow execution aborted by user.");
|
|
480447
|
+
return {
|
|
480448
|
+
currentStepIndex: 0,
|
|
480449
|
+
completedSteps: [],
|
|
480450
|
+
failedSteps: [],
|
|
480451
|
+
totalSteps: flow.steps.length,
|
|
480452
|
+
startTime: Date.now(),
|
|
480453
|
+
aborted: true
|
|
480454
|
+
};
|
|
480455
|
+
}
|
|
480456
|
+
}
|
|
480398
480457
|
const state = await executeFlow(flow, context2, async (step, state2) => {
|
|
480399
480458
|
console.log(`
|
|
480400
480459
|
▶️ Starting step ${state2.currentStepIndex + 1}/${state2.totalSteps}: ${step.description}`);
|
|
@@ -497326,6 +497385,69 @@ Wait for user confirmation before executing the first step.
|
|
|
497326
497385
|
agent_default = agent;
|
|
497327
497386
|
});
|
|
497328
497387
|
|
|
497388
|
+
// src/commands/composer.ts
|
|
497389
|
+
function getComposerPrompt(args) {
|
|
497390
|
+
const featureDesc = args.trim() || "(no description provided)";
|
|
497391
|
+
return `You are in **Composer Mode** — a multi-file editing workflow inspired by Cursor's Composer.
|
|
497392
|
+
|
|
497393
|
+
## User's Request
|
|
497394
|
+
|
|
497395
|
+
${featureDesc}
|
|
497396
|
+
|
|
497397
|
+
## Your Task
|
|
497398
|
+
|
|
497399
|
+
You will implement this feature across multiple files in a single turn. Follow this workflow:
|
|
497400
|
+
|
|
497401
|
+
### 1. Analyze & Plan
|
|
497402
|
+
- Understand the feature request and identify all files that need to be created or modified
|
|
497403
|
+
- Create a plan listing every file that will be touched, with a brief description of changes for each
|
|
497404
|
+
- Consider dependencies between files (imports, types, shared utilities)
|
|
497405
|
+
- Identify test files that need to be created or updated
|
|
497406
|
+
|
|
497407
|
+
### 2. Execute Multi-File Edits
|
|
497408
|
+
- Edit all necessary files to implement the feature
|
|
497409
|
+
- Work through files in dependency order (shared types/utils first, then consumers)
|
|
497410
|
+
- Ensure imports and exports are consistent across all files
|
|
497411
|
+
- Keep changes focused — only modify what's needed for this feature
|
|
497412
|
+
|
|
497413
|
+
### 3. Verify
|
|
497414
|
+
- Run the test suite to verify the implementation works
|
|
497415
|
+
- Run the build to ensure no type or compile errors
|
|
497416
|
+
- If tests fail, fix the issues and re-verify
|
|
497417
|
+
|
|
497418
|
+
## Multi-File Editing Guidelines
|
|
497419
|
+
|
|
497420
|
+
- **Coordinate changes**: When editing a shared type or utility, update all consumers in the same turn
|
|
497421
|
+
- **Consistent naming**: Follow existing project conventions for file names, exports, and patterns
|
|
497422
|
+
- **Minimal diffs**: Make surgical edits — avoid rewriting entire files when small changes suffice
|
|
497423
|
+
- **Test coverage**: Add or update tests for all new functionality
|
|
497424
|
+
- **Error handling**: Add appropriate error handling for new code paths
|
|
497425
|
+
|
|
497426
|
+
## Important Rules
|
|
497427
|
+
|
|
497428
|
+
- Edit all files needed to complete the feature in a single turn
|
|
497429
|
+
- Do not ask for confirmation between file edits — proceed autonomously
|
|
497430
|
+
- After all edits are complete, run tests and build to verify
|
|
497431
|
+
- If verification fails, fix issues and re-run until green
|
|
497432
|
+
- Report a summary of all files changed at the end`;
|
|
497433
|
+
}
|
|
497434
|
+
var composer, composer_default;
|
|
497435
|
+
var init_composer = __esm(() => {
|
|
497436
|
+
composer = {
|
|
497437
|
+
type: "prompt",
|
|
497438
|
+
name: "composer",
|
|
497439
|
+
description: "Composer mode — edit multiple files simultaneously to implement a feature across the codebase",
|
|
497440
|
+
argumentHint: "<feature description>",
|
|
497441
|
+
progressMessage: "composer mode executing",
|
|
497442
|
+
contentLength: 0,
|
|
497443
|
+
source: "builtin",
|
|
497444
|
+
async getPromptForCommand(args) {
|
|
497445
|
+
return [{ type: "text", text: getComposerPrompt(args) }];
|
|
497446
|
+
}
|
|
497447
|
+
};
|
|
497448
|
+
composer_default = composer;
|
|
497449
|
+
});
|
|
497450
|
+
|
|
497329
497451
|
// src/commands/remember.ts
|
|
497330
497452
|
import { appendFile as appendFile5, mkdir as mkdir36 } from "fs/promises";
|
|
497331
497453
|
import { join as join133 } from "path";
|
|
@@ -506039,6 +506161,7 @@ var init_commands2 = __esm(() => {
|
|
|
506039
506161
|
init_frontend_tdd();
|
|
506040
506162
|
init_agentic_tdd();
|
|
506041
506163
|
init_agent2();
|
|
506164
|
+
init_composer();
|
|
506042
506165
|
init_remember();
|
|
506043
506166
|
init_log3();
|
|
506044
506167
|
init_errors();
|
|
@@ -506172,6 +506295,7 @@ var init_commands2 = __esm(() => {
|
|
|
506172
506295
|
frontend_tdd_default,
|
|
506173
506296
|
agentic_tdd_default,
|
|
506174
506297
|
agent_default,
|
|
506298
|
+
composer_default,
|
|
506175
506299
|
tag_default,
|
|
506176
506300
|
theme_default,
|
|
506177
506301
|
feedback_default,
|