claude-code-extensions 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ast.d.ts +43 -0
- package/dist/ast.js +308 -0
- package/dist/ast.js.map +1 -0
- package/dist/cli-list.d.ts +5 -0
- package/dist/cli-list.js +33 -0
- package/dist/cli-list.js.map +1 -0
- package/dist/cli-reload.d.ts +7 -0
- package/dist/cli-reload.js +24 -0
- package/dist/cli-reload.js.map +1 -0
- package/dist/cli-setup.d.ts +14 -0
- package/dist/cli-setup.js +110 -0
- package/dist/cli-setup.js.map +1 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.js +183 -0
- package/dist/cli.js.map +1 -0
- package/dist/patch-worker.d.ts +6 -0
- package/dist/patch-worker.js +27 -0
- package/dist/patch-worker.js.map +1 -0
- package/dist/patches/always-show-context.d.ts +23 -0
- package/dist/patches/always-show-context.js +97 -0
- package/dist/patches/always-show-context.js.map +1 -0
- package/dist/patches/always-show-thinking.d.ts +18 -0
- package/dist/patches/always-show-thinking.js +55 -0
- package/dist/patches/always-show-thinking.js.map +1 -0
- package/dist/patches/banner.d.ts +10 -0
- package/dist/patches/banner.js +105 -0
- package/dist/patches/banner.js.map +1 -0
- package/dist/patches/cd-command.d.ts +16 -0
- package/dist/patches/cd-command.js +89 -0
- package/dist/patches/cd-command.js.map +1 -0
- package/dist/patches/cx-badge.d.ts +10 -0
- package/dist/patches/cx-badge.js +115 -0
- package/dist/patches/cx-badge.js.map +1 -0
- package/dist/patches/cx-resume-commands.d.ts +14 -0
- package/dist/patches/cx-resume-commands.js +53 -0
- package/dist/patches/cx-resume-commands.js.map +1 -0
- package/dist/patches/disable-paste-collapse.d.ts +16 -0
- package/dist/patches/disable-paste-collapse.js +49 -0
- package/dist/patches/disable-paste-collapse.js.map +1 -0
- package/dist/patches/disable-telemetry.d.ts +13 -0
- package/dist/patches/disable-telemetry.js +76 -0
- package/dist/patches/disable-telemetry.js.map +1 -0
- package/{patches/index.js → dist/patches/index.d.ts} +2 -0
- package/dist/patches/index.js +20 -0
- package/dist/patches/index.js.map +1 -0
- package/dist/patches/no-attribution.d.ts +15 -0
- package/dist/patches/no-attribution.js +42 -0
- package/dist/patches/no-attribution.js.map +1 -0
- package/dist/patches/no-feedback.d.ts +12 -0
- package/dist/patches/no-feedback.js +31 -0
- package/dist/patches/no-feedback.js.map +1 -0
- package/dist/patches/no-npm-warning.d.ts +9 -0
- package/dist/patches/no-npm-warning.js +31 -0
- package/dist/patches/no-npm-warning.js.map +1 -0
- package/dist/patches/no-tips.d.ts +10 -0
- package/dist/patches/no-tips.js +26 -0
- package/dist/patches/no-tips.js.map +1 -0
- package/dist/patches/persist-max-effort.d.ts +15 -0
- package/dist/patches/persist-max-effort.js +75 -0
- package/dist/patches/persist-max-effort.js.map +1 -0
- package/dist/patches/queue.d.ts +10 -0
- package/dist/patches/queue.js +202 -0
- package/dist/patches/queue.js.map +1 -0
- package/dist/patches/random-clawd.d.ts +9 -0
- package/dist/patches/random-clawd.js +49 -0
- package/dist/patches/random-clawd.js.map +1 -0
- package/dist/patches/reload.d.ts +10 -0
- package/dist/patches/reload.js +50 -0
- package/dist/patches/reload.js.map +1 -0
- package/dist/patches/show-file-in-collapsed-read.d.ts +17 -0
- package/dist/patches/show-file-in-collapsed-read.js +151 -0
- package/dist/patches/show-file-in-collapsed-read.js.map +1 -0
- package/dist/patches/simple-spinner.d.ts +12 -0
- package/dist/patches/simple-spinner.js +31 -0
- package/dist/patches/simple-spinner.js.map +1 -0
- package/dist/patches/swap-enter-submit.d.ts +26 -0
- package/dist/patches/swap-enter-submit.js +155 -0
- package/dist/patches/swap-enter-submit.js.map +1 -0
- package/dist/setup.d.ts +11 -0
- package/dist/setup.js +268 -0
- package/dist/setup.js.map +1 -0
- package/dist/transform-worker.d.ts +10 -0
- package/dist/transform-worker.js +35 -0
- package/dist/transform-worker.js.map +1 -0
- package/dist/transform.d.ts +12 -0
- package/dist/transform.js +83 -0
- package/dist/transform.js.map +1 -0
- package/dist/types.d.ts +105 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +19 -11
- package/ast.js +0 -276
- package/cx +0 -228
- package/cx-setup +0 -101
- package/patch-worker.js +0 -31
- package/patches/always-show-context.js +0 -123
- package/patches/always-show-thinking.js +0 -65
- package/patches/banner.js +0 -58
- package/patches/cd-command.js +0 -104
- package/patches/cx-badge.js +0 -112
- package/patches/cx-resume-commands.js +0 -58
- package/patches/disable-paste-collapse.js +0 -52
- package/patches/disable-telemetry.js +0 -84
- package/patches/no-attribution.js +0 -55
- package/patches/no-npm-warning.js +0 -32
- package/patches/no-tips.js +0 -29
- package/patches/persist-max-effort.js +0 -70
- package/patches/queue.js +0 -215
- package/patches/random-clawd.js +0 -52
- package/patches/reload.js +0 -68
- package/patches/show-file-in-collapsed-read.js +0 -178
- package/patches/swap-enter-submit.js +0 -188
- package/setup.js +0 -222
- package/transform-worker.js +0 -38
- package/transform.js +0 -99
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* No NPM Warning Patch
|
|
3
|
+
*
|
|
4
|
+
* Suppresses the "Claude Code has switched from npm to native installer"
|
|
5
|
+
* notification that appears on every startup for npm installs.
|
|
6
|
+
*/
|
|
7
|
+
import type { Patch } from '../types.js';
|
|
8
|
+
declare const patch: Patch;
|
|
9
|
+
export default patch;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* No NPM Warning Patch
|
|
3
|
+
*
|
|
4
|
+
* Suppresses the "Claude Code has switched from npm to native installer"
|
|
5
|
+
* notification that appears on every startup for npm installs.
|
|
6
|
+
*/
|
|
7
|
+
const patch = {
|
|
8
|
+
id: 'no-npm-warning',
|
|
9
|
+
name: 'No NPM Warning',
|
|
10
|
+
description: 'Suppress the "switched from npm to native installer" nag',
|
|
11
|
+
apply(ctx) {
|
|
12
|
+
const { ast, editor, find, assert } = ctx;
|
|
13
|
+
const { findFirst } = find;
|
|
14
|
+
// Find the ReturnStatement that returns {key:"npm-deprecation-warning",...}
|
|
15
|
+
const ret = findFirst(ast, (n) => {
|
|
16
|
+
if (n.type !== 'ReturnStatement')
|
|
17
|
+
return false;
|
|
18
|
+
const arg = n.argument;
|
|
19
|
+
if (!arg || arg.type !== 'ObjectExpression')
|
|
20
|
+
return false;
|
|
21
|
+
return arg.properties.some((p) => p.type === 'Property' &&
|
|
22
|
+
p.key?.type === 'Identifier' && p.key.name === 'key' &&
|
|
23
|
+
p.value?.type === 'Literal' && p.value.value === 'npm-deprecation-warning');
|
|
24
|
+
});
|
|
25
|
+
assert(ret, 'Could not find return with key:"npm-deprecation-warning"');
|
|
26
|
+
// Replace the entire return statement with `return null`
|
|
27
|
+
editor.replaceRange(ret.start, ret.end, 'return null');
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export default patch;
|
|
31
|
+
//# sourceMappingURL=no-npm-warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-npm-warning.js","sourceRoot":"","sources":["../../src/patches/no-npm-warning.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,KAAK,GAAU;IACnB,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,0DAA0D;IAEvE,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QAC1C,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAE3B,4EAA4E;QAC5E,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,CAAM,EAAE,EAAE;YACpC,IAAI,CAAC,CAAC,IAAI,KAAK,iBAAiB;gBAAE,OAAO,KAAK,CAAC;YAC/C,MAAM,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC;YACvB,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,kBAAkB;gBAAE,OAAO,KAAK,CAAC;YAC1D,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CACpC,CAAC,CAAC,IAAI,KAAK,UAAU;gBACrB,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK;gBACpD,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,yBAAyB,CAAC,CAAC;QAChF,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,EAAE,0DAA0D,CAAC,CAAC;QAExE,yDAAyD;QACzD,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACzD,CAAC;CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* No Tips Patch
|
|
3
|
+
*
|
|
4
|
+
* Removes the "Tip: ..." messages shown in the spinner while Claude
|
|
5
|
+
* is thinking. Neutralises the effectiveTip variable so neither the
|
|
6
|
+
* scheduled tips nor the time-based /clear and /btw tips appear.
|
|
7
|
+
*/
|
|
8
|
+
import type { Patch } from '../types.js';
|
|
9
|
+
declare const patch: Patch;
|
|
10
|
+
export default patch;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* No Tips Patch
|
|
3
|
+
*
|
|
4
|
+
* Removes the "Tip: ..." messages shown in the spinner while Claude
|
|
5
|
+
* is thinking. Neutralises the effectiveTip variable so neither the
|
|
6
|
+
* scheduled tips nor the time-based /clear and /btw tips appear.
|
|
7
|
+
*/
|
|
8
|
+
const patch = {
|
|
9
|
+
id: 'no-tips',
|
|
10
|
+
name: 'No Tips',
|
|
11
|
+
description: 'Hide spinner tips',
|
|
12
|
+
apply(ctx) {
|
|
13
|
+
const { index, editor, assert } = ctx;
|
|
14
|
+
// The effectiveTip computation contains this unique string literal.
|
|
15
|
+
// Find it and walk up to the VariableDeclarator to replace the init.
|
|
16
|
+
const marker = 'Use /clear to start fresh when switching topics and free up context';
|
|
17
|
+
const hits = index.literalsByValue.get(marker) || [];
|
|
18
|
+
assert(hits.length > 0, `Could not find "${marker}" literal`);
|
|
19
|
+
const lit = hits[0];
|
|
20
|
+
const decl = index.ancestor(lit, 'VariableDeclarator');
|
|
21
|
+
assert(decl && decl.init, 'Could not find enclosing VariableDeclarator');
|
|
22
|
+
editor.replaceRange(decl.init.start, decl.init.end, 'void 0');
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export default patch;
|
|
26
|
+
//# sourceMappingURL=no-tips.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-tips.js","sourceRoot":"","sources":["../../src/patches/no-tips.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,KAAK,GAAU;IACnB,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,mBAAmB;IAEhC,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QAEtC,oEAAoE;QACpE,qEAAqE;QACrE,MAAM,MAAM,GAAG,qEAAqE,CAAC;QACrF,MAAM,IAAI,GAAG,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrD,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,mBAAmB,MAAM,WAAW,CAAC,CAAC;QAE9D,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;QACvD,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,6CAA6C,CAAC,CAAC;QAEzE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAChE,CAAC;CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persist Max Effort Patch
|
|
3
|
+
*
|
|
4
|
+
* The public build strips "max" from toPersistableEffort(), so `/effort max`
|
|
5
|
+
* only lasts for the current session. This patch restores the "max" check
|
|
6
|
+
* so it persists to settings.json and survives restarts.
|
|
7
|
+
*
|
|
8
|
+
* Source (effort.ts):
|
|
9
|
+
* if (value === 'low' || value === 'medium' || value === 'high' || value === 'max')
|
|
10
|
+
* Bundle (stripped):
|
|
11
|
+
* if (q === "low" || q === "medium" || q === "high")
|
|
12
|
+
*/
|
|
13
|
+
import type { Patch } from '../types.js';
|
|
14
|
+
declare const patch: Patch;
|
|
15
|
+
export default patch;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persist Max Effort Patch
|
|
3
|
+
*
|
|
4
|
+
* The public build strips "max" from toPersistableEffort(), so `/effort max`
|
|
5
|
+
* only lasts for the current session. This patch restores the "max" check
|
|
6
|
+
* so it persists to settings.json and survives restarts.
|
|
7
|
+
*
|
|
8
|
+
* Source (effort.ts):
|
|
9
|
+
* if (value === 'low' || value === 'medium' || value === 'high' || value === 'max')
|
|
10
|
+
* Bundle (stripped):
|
|
11
|
+
* if (q === "low" || q === "medium" || q === "high")
|
|
12
|
+
*/
|
|
13
|
+
const patch = {
|
|
14
|
+
id: 'persist-max-effort',
|
|
15
|
+
name: 'Persist Max Effort',
|
|
16
|
+
description: 'Save "max" effort to settings so it survives restarts',
|
|
17
|
+
apply(ctx) {
|
|
18
|
+
const { ast, editor, find, src, assert } = ctx;
|
|
19
|
+
const { findFirst, findAll } = find;
|
|
20
|
+
// Find the toPersistableEffort function. It's a function whose body has
|
|
21
|
+
// exactly the pattern: q==="low"||q==="medium"||q==="high"
|
|
22
|
+
// This is a unique 3-way string comparison in the bundle.
|
|
23
|
+
const persistFn = findFirst(ast, (n) => {
|
|
24
|
+
if (n.type !== 'FunctionDeclaration' && n.type !== 'FunctionExpression' && n.type !== 'ArrowFunctionExpression')
|
|
25
|
+
return false;
|
|
26
|
+
// Find the LogicalExpression chain: q==="low" || q==="medium" || q==="high"
|
|
27
|
+
return findFirst(n, (inner) => {
|
|
28
|
+
if (inner.type !== 'LogicalExpression' || inner.operator !== '||')
|
|
29
|
+
return false;
|
|
30
|
+
// The rightmost comparison should be q==="high"
|
|
31
|
+
if (inner.right.type !== 'BinaryExpression')
|
|
32
|
+
return false;
|
|
33
|
+
if (inner.right.operator !== '===')
|
|
34
|
+
return false;
|
|
35
|
+
if (inner.right.right?.type !== 'Literal' || inner.right.right.value !== 'high')
|
|
36
|
+
return false;
|
|
37
|
+
// The left side should be another || with "medium"
|
|
38
|
+
if (inner.left.type !== 'LogicalExpression' || inner.left.operator !== '||')
|
|
39
|
+
return false;
|
|
40
|
+
if (inner.left.right?.type !== 'BinaryExpression')
|
|
41
|
+
return false;
|
|
42
|
+
if (inner.left.right.right?.type !== 'Literal' || inner.left.right.right.value !== 'medium')
|
|
43
|
+
return false;
|
|
44
|
+
return true;
|
|
45
|
+
}) !== null;
|
|
46
|
+
});
|
|
47
|
+
assert(persistFn, 'Could not find toPersistableEffort function (low||medium||high pattern)');
|
|
48
|
+
// Find the "high" literal in the comparison chain
|
|
49
|
+
const highLiteral = findFirst(persistFn, (n) => {
|
|
50
|
+
if (n.type !== 'BinaryExpression' || n.operator !== '===')
|
|
51
|
+
return false;
|
|
52
|
+
return n.right?.type === 'Literal' && n.right.value === 'high';
|
|
53
|
+
});
|
|
54
|
+
assert(highLiteral, 'Could not find q==="high" comparison');
|
|
55
|
+
// Get the parameter name (e.g., 'q') from the left side
|
|
56
|
+
const paramName = highLiteral.left.type === 'Identifier' ? highLiteral.left.name : src(highLiteral.left);
|
|
57
|
+
// Insert ||q==="max" after the q==="high" comparison
|
|
58
|
+
editor.insertAt(highLiteral.end, `||${paramName}==="max"`);
|
|
59
|
+
// Fix ["low","medium","high"] arrays (Zod schema + EFFORT_LEVELS) that also
|
|
60
|
+
// strip "max". Without this, settings.json validation silently drops "max"
|
|
61
|
+
// on read via .catch(undefined).
|
|
62
|
+
const effortArrays = findAll(ast, (n) => {
|
|
63
|
+
if (n.type !== 'ArrayExpression' || n.elements.length !== 3)
|
|
64
|
+
return false;
|
|
65
|
+
const vals = n.elements.map((e) => e?.type === 'Literal' ? e.value : null);
|
|
66
|
+
return vals[0] === 'low' && vals[1] === 'medium' && vals[2] === 'high';
|
|
67
|
+
});
|
|
68
|
+
assert(effortArrays.length > 0, 'Could not find ["low","medium","high"] arrays to patch');
|
|
69
|
+
for (const arr of effortArrays) {
|
|
70
|
+
editor.insertAt(arr.elements[2].end, ',"max"');
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
export default patch;
|
|
75
|
+
//# sourceMappingURL=persist-max-effort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-max-effort.js","sourceRoot":"","sources":["../../src/patches/persist-max-effort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,MAAM,KAAK,GAAU;IACnB,EAAE,EAAE,oBAAoB;IACxB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,uDAAuD;IAEpE,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QAC/C,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEpC,wEAAwE;QACxE,2DAA2D;QAC3D,0DAA0D;QAC1D,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,EA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CAAC,CAAC,KAAK,MAAM,CAAC;QACzE,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,wDAAwD,CAAC,CAAC;QAC1F,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;YAC/B,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ctrl+Q Message Queue Patch
|
|
3
|
+
*
|
|
4
|
+
* Adds a "queue" feature: pressing Ctrl+Q enqueues the current input
|
|
5
|
+
* with priority 'later', so it executes FIFO after the current turn
|
|
6
|
+
* completes (one queued command per turn).
|
|
7
|
+
*/
|
|
8
|
+
import type { Patch } from '../types.js';
|
|
9
|
+
declare const patch: Patch;
|
|
10
|
+
export default patch;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ctrl+Q Message Queue Patch
|
|
3
|
+
*
|
|
4
|
+
* Adds a "queue" feature: pressing Ctrl+Q enqueues the current input
|
|
5
|
+
* with priority 'later', so it executes FIFO after the current turn
|
|
6
|
+
* completes (one queued command per turn).
|
|
7
|
+
*/
|
|
8
|
+
const patch = {
|
|
9
|
+
id: 'queue',
|
|
10
|
+
name: 'Ctrl+Q Message Queue',
|
|
11
|
+
description: 'Queue messages with Ctrl+Q to run sequentially after current turn',
|
|
12
|
+
apply(ctx) {
|
|
13
|
+
const { ast, editor, find, query, src, assert } = ctx;
|
|
14
|
+
const { findFirst, findAll } = find;
|
|
15
|
+
const { findArrayWithConsecutiveStrings, findObjectWithStringProps, findHookCallWithObjectKeys, findFunctionsContainingStrings, getDestructuredName, } = query;
|
|
16
|
+
// ── Variable Discovery ────────────────────────────────────────────
|
|
17
|
+
// chatHandlers useMemo (by string keys in its object)
|
|
18
|
+
const chatHandlersMemo = findHookCallWithObjectKeys(ast, 'useMemo', [
|
|
19
|
+
'chat:undo', 'chat:newline', 'chat:stash', 'chat:imagePaste',
|
|
20
|
+
]);
|
|
21
|
+
assert(chatHandlersMemo, 'Could not find chatHandlers useMemo');
|
|
22
|
+
const R = src(chatHandlersMemo.callee.object); // React namespace
|
|
23
|
+
const handlersObject = findFirst(chatHandlersMemo.arguments[0], (n) => n.type === 'ObjectExpression' &&
|
|
24
|
+
n.properties.some((p) => p.type === 'Property' && p.key.type === 'Literal' && p.key.value === 'chat:undo'));
|
|
25
|
+
assert(handlersObject, 'Could not find handlers object in useMemo');
|
|
26
|
+
const depsArray = chatHandlersMemo.arguments[1];
|
|
27
|
+
assert(depsArray?.type === 'ArrayExpression', 'Could not find deps array');
|
|
28
|
+
// PromptInput function (by ObjectPattern param with known prop keys)
|
|
29
|
+
const promptInputFn = findFirst(ast, (node) => {
|
|
30
|
+
if (node.type !== 'FunctionDeclaration' && node.type !== 'FunctionExpression')
|
|
31
|
+
return false;
|
|
32
|
+
const p = node.params[0];
|
|
33
|
+
if (!p || p.type !== 'ObjectPattern')
|
|
34
|
+
return false;
|
|
35
|
+
return getDestructuredName(p, 'input') !== null &&
|
|
36
|
+
getDestructuredName(p, 'mode') !== null &&
|
|
37
|
+
getDestructuredName(p, 'pastedContents') !== null;
|
|
38
|
+
});
|
|
39
|
+
assert(promptInputFn, 'Could not find PromptInput component function');
|
|
40
|
+
const propsPattern = promptInputFn.params[0];
|
|
41
|
+
// Props from destructured parameter (keys preserved in minified code)
|
|
42
|
+
const v = {};
|
|
43
|
+
for (const name of ['input', 'mode', 'pastedContents', 'setPastedContents', 'onInputChange']) {
|
|
44
|
+
v[name] = getDestructuredName(propsPattern, name);
|
|
45
|
+
assert(v[name], `Could not find "${name}" in props destructuring`);
|
|
46
|
+
}
|
|
47
|
+
// setCursorOffset — from useState(input.length)
|
|
48
|
+
const useStateCandidates = findAll(promptInputFn, (node) => {
|
|
49
|
+
if (node.type !== 'VariableDeclarator' || node.id.type !== 'ArrayPattern' || node.id.elements.length < 2)
|
|
50
|
+
return false;
|
|
51
|
+
const init = node.init;
|
|
52
|
+
if (!init || init.type !== 'CallExpression' || init.callee.type !== 'MemberExpression' || init.callee.property.name !== 'useState')
|
|
53
|
+
return false;
|
|
54
|
+
const arg = init.arguments[0];
|
|
55
|
+
return arg?.type === 'MemberExpression' && arg.property.name === 'length' && arg.object.name === v.input;
|
|
56
|
+
});
|
|
57
|
+
assert(useStateCandidates.length === 1, `Expected 1 useState(${v.input}.length), found ${useStateCandidates.length}`);
|
|
58
|
+
v.setCursorOffset = useStateCandidates[0].id.elements[1].name;
|
|
59
|
+
// trackAndSetInput — useCallback with deps=[onInputChange]
|
|
60
|
+
const trackCandidates = findAll(promptInputFn, (node) => {
|
|
61
|
+
if (node.type !== 'VariableDeclarator' || node.id.type !== 'Identifier')
|
|
62
|
+
return false;
|
|
63
|
+
const init = node.init;
|
|
64
|
+
if (!init || init.type !== 'CallExpression' || init.callee.type !== 'MemberExpression' || init.callee.property.name !== 'useCallback')
|
|
65
|
+
return false;
|
|
66
|
+
const deps = init.arguments[1];
|
|
67
|
+
if (!deps || deps.type !== 'ArrayExpression' || deps.elements.length !== 1)
|
|
68
|
+
return false;
|
|
69
|
+
return deps.elements[0]?.name === v.onInputChange;
|
|
70
|
+
});
|
|
71
|
+
assert(trackCandidates.length === 1, `Expected 1 useCallback with deps=[${v.onInputChange}]`);
|
|
72
|
+
v.trackAndSetInput = trackCandidates[0].id.name;
|
|
73
|
+
// clearBuffer — from useInputBuffer destructuring (key preserved)
|
|
74
|
+
const clearBufDecls = findAll(promptInputFn, (node) => {
|
|
75
|
+
if (node.type !== 'VariableDeclarator' || node.id.type !== 'ObjectPattern')
|
|
76
|
+
return false;
|
|
77
|
+
return node.id.properties.some((p) => p.type === 'Property' &&
|
|
78
|
+
((p.key.type === 'Identifier' && p.key.name === 'clearBuffer') ||
|
|
79
|
+
(p.key.type === 'Literal' && p.key.value === 'clearBuffer')));
|
|
80
|
+
});
|
|
81
|
+
assert(clearBufDecls.length >= 1, 'Could not find clearBuffer destructuring');
|
|
82
|
+
v.clearBuffer = getDestructuredName(clearBufDecls[0].id, 'clearBuffer');
|
|
83
|
+
// enqueue — function with push({...spread, priority: ?? "next"}) + "enqueue" string
|
|
84
|
+
const enqueueCandidates = findFunctionsContainingStrings(ast, 'enqueue');
|
|
85
|
+
const enqueueMatches = enqueueCandidates.filter((fn) => findFirst(fn, (n) => {
|
|
86
|
+
if (n.type !== 'CallExpression' || n.callee.type !== 'MemberExpression' || n.callee.property.name !== 'push')
|
|
87
|
+
return false;
|
|
88
|
+
const arg = n.arguments[0];
|
|
89
|
+
if (!arg || arg.type !== 'ObjectExpression')
|
|
90
|
+
return false;
|
|
91
|
+
if (!arg.properties.some((p) => p.type === 'SpreadElement'))
|
|
92
|
+
return false;
|
|
93
|
+
const pp = arg.properties.find((p) => p.type === 'Property' && p.key.name === 'priority');
|
|
94
|
+
return pp?.value.type === 'LogicalExpression' && pp.value.operator === '??' &&
|
|
95
|
+
pp.value.right.type === 'Literal' && pp.value.right.value === 'next';
|
|
96
|
+
}) !== null);
|
|
97
|
+
assert(enqueueMatches.length === 1, `Expected 1 enqueue function, found ${enqueueMatches.length}`);
|
|
98
|
+
v.enqueue = ctx.getFunctionName(enqueueMatches[0]);
|
|
99
|
+
assert(v.enqueue, 'Could not determine enqueue function name');
|
|
100
|
+
// expandPastedTextRefs — backward loop + .slice + .type/"text" + .index + .match
|
|
101
|
+
const expandCandidates = findFunctionsContainingStrings(ast, 'text');
|
|
102
|
+
const expandMatches = expandCandidates.filter((fn) => {
|
|
103
|
+
if (fn.params.length !== 2)
|
|
104
|
+
return false;
|
|
105
|
+
if (!findFirst(fn, (n) => n.type === 'ForStatement' && n.update?.type === 'UpdateExpression' && n.update.operator === '--'))
|
|
106
|
+
return false;
|
|
107
|
+
if (findAll(fn, (n) => n.type === 'CallExpression' && n.callee.type === 'MemberExpression' && n.callee.property.name === 'slice').length < 2)
|
|
108
|
+
return false;
|
|
109
|
+
if (!findFirst(fn, (n) => n.type === 'MemberExpression' && n.property.name === 'index'))
|
|
110
|
+
return false;
|
|
111
|
+
if (!findFirst(fn, (n) => n.type === 'MemberExpression' && n.property.name === 'match'))
|
|
112
|
+
return false;
|
|
113
|
+
return findFirst(fn, (n) => {
|
|
114
|
+
if (n.type !== 'BinaryExpression' || (n.operator !== '!==' && n.operator !== '==='))
|
|
115
|
+
return false;
|
|
116
|
+
const unwrap = (x) => x.type === 'ChainExpression' ? x.expression : x;
|
|
117
|
+
const l = unwrap(n.left), r = unwrap(n.right);
|
|
118
|
+
return (l.type === 'MemberExpression' && l.property.name === 'type' && n.right.value === 'text') ||
|
|
119
|
+
(r.type === 'MemberExpression' && r.property.name === 'type' && n.left.value === 'text');
|
|
120
|
+
}) !== null;
|
|
121
|
+
});
|
|
122
|
+
assert(expandMatches.length === 1, `Expected 1 expandPastedTextRefs, found ${expandMatches.length}`);
|
|
123
|
+
v.expandPastedTextRefs = ctx.getFunctionName(expandMatches[0]);
|
|
124
|
+
assert(v.expandPastedTextRefs, 'Could not determine expandPastedTextRefs name');
|
|
125
|
+
// ── Patch 1: KEYBINDING_ACTIONS ───────────────────────────────────
|
|
126
|
+
const arr = findArrayWithConsecutiveStrings(ast, 'chat:submit', 'chat:newline');
|
|
127
|
+
assert(arr, 'Could not find KEYBINDING_ACTIONS array');
|
|
128
|
+
const el = arr.elements.find((e) => e.type === 'Literal' && e.value === 'chat:submit');
|
|
129
|
+
editor.insertAt(el.end, ',"chat:queue"');
|
|
130
|
+
// ── Patch 2: DEFAULT_BINDINGS ─────────────────────────────────────
|
|
131
|
+
const obj = findObjectWithStringProps(ast, [['enter', 'chat:submit'], ['up', 'history:previous']]);
|
|
132
|
+
assert(obj, 'Could not find DEFAULT_BINDINGS object');
|
|
133
|
+
const enterProp = obj.properties.find((p) => p.type === 'Property' &&
|
|
134
|
+
((p.key.type === 'Identifier' && p.key.name === 'enter') || (p.key.type === 'Literal' && p.key.value === 'enter')));
|
|
135
|
+
editor.insertAt(enterProp.end, ',"ctrl+q":"chat:queue"');
|
|
136
|
+
// ── Patch 3: handleQueue callback + chatHandlers ──────────────────
|
|
137
|
+
const qH = '__qH';
|
|
138
|
+
const code = `let ${qH}=${R}.useCallback(()=>{` +
|
|
139
|
+
`let __t=${v.input}.trimEnd();if(__t==="")return;` +
|
|
140
|
+
`let __f=${v.expandPastedTextRefs}(__t,${v.pastedContents});` +
|
|
141
|
+
`${v.enqueue}({value:__f,preExpansionValue:__t,mode:${v.mode},` +
|
|
142
|
+
`priority:"later",pastedContents:Object.values(${v.pastedContents})` +
|
|
143
|
+
`.some(c=>c.type==="image")?${v.pastedContents}:void 0});` +
|
|
144
|
+
`${v.trackAndSetInput}(""),${v.setCursorOffset}(0),` +
|
|
145
|
+
`${v.setPastedContents}({}),${v.clearBuffer}()` +
|
|
146
|
+
`},[${v.input},${v.pastedContents},${v.mode},${v.trackAndSetInput},` +
|
|
147
|
+
`${v.setCursorOffset},${v.setPastedContents},${v.clearBuffer}]);`;
|
|
148
|
+
const memoDecl = findFirst(ast, (n) => n.type === 'VariableDeclaration' && n.declarations.some((d) => d.init === chatHandlersMemo));
|
|
149
|
+
assert(memoDecl, 'Could not find VariableDeclaration for chatHandlers useMemo');
|
|
150
|
+
editor.insertAt(memoDecl.start, code);
|
|
151
|
+
const lastProp = handlersObject.properties[handlersObject.properties.length - 1];
|
|
152
|
+
editor.insertAt(lastProp.end, `,"chat:queue":${qH}`);
|
|
153
|
+
const lastDep = depsArray.elements[depsArray.elements.length - 1];
|
|
154
|
+
editor.insertAt(lastDep.end, `,${qH}`);
|
|
155
|
+
// ── Patch 4: processQueueIfReady ──────────────────────────────────
|
|
156
|
+
const processQueueFn = findFirst(ast, (node) => {
|
|
157
|
+
if (node.type !== 'FunctionDeclaration' && node.type !== 'FunctionExpression' && node.type !== 'ArrowFunctionExpression')
|
|
158
|
+
return false;
|
|
159
|
+
if (findAll(node, (n) => n.type === 'Property' && n.key.type === 'Identifier' && n.key.name === 'processed').length < 2)
|
|
160
|
+
return false;
|
|
161
|
+
return findFirst(node, (n) => n.type === 'BinaryExpression' && n.operator === '===' && n.right.type === 'Literal' && n.right.value === 'bash') !== null;
|
|
162
|
+
});
|
|
163
|
+
assert(processQueueFn, 'Could not find processQueueIfReady function');
|
|
164
|
+
const ifStmt = findFirst(processQueueFn, (node) => {
|
|
165
|
+
if (node.type !== 'IfStatement')
|
|
166
|
+
return false;
|
|
167
|
+
return findFirst(node.test, (n) => n.type === 'BinaryExpression' && n.operator === '===' &&
|
|
168
|
+
n.left.type === 'MemberExpression' && n.left.property.name === 'mode' &&
|
|
169
|
+
n.right.type === 'Literal' && n.right.value === 'bash') !== null;
|
|
170
|
+
});
|
|
171
|
+
assert(ifStmt, 'Could not find if-statement with .mode === "bash"');
|
|
172
|
+
const bashCheck = findFirst(ifStmt.test, (n) => n.type === 'BinaryExpression' && n.operator === '===' &&
|
|
173
|
+
n.left.type === 'MemberExpression' && n.left.property.name === 'mode' && n.right.value === 'bash');
|
|
174
|
+
const nextVar = src(bashCheck.left.object);
|
|
175
|
+
editor.insertAt(ifStmt.test.end, `||${nextVar}.priority==="later"`);
|
|
176
|
+
const targetModeDecl = findFirst(processQueueFn, (node) => {
|
|
177
|
+
if (node.type !== 'VariableDeclarator' || node.start <= ifStmt.end)
|
|
178
|
+
return false;
|
|
179
|
+
return node.init?.type === 'MemberExpression' && node.init.property.name === 'mode' && src(node.init.object) === nextVar;
|
|
180
|
+
});
|
|
181
|
+
assert(targetModeDecl, 'Could not find targetMode = next.mode');
|
|
182
|
+
const targetModeVar = targetModeDecl.id.name;
|
|
183
|
+
editor.insertAt(targetModeDecl.end, `,__p=${nextVar}.priority??"next"`);
|
|
184
|
+
const dqamCallback = findFirst(processQueueFn, (node) => {
|
|
185
|
+
if (node.type !== 'ArrowFunctionExpression' && node.type !== 'FunctionExpression')
|
|
186
|
+
return false;
|
|
187
|
+
if (node.start <= ifStmt.end)
|
|
188
|
+
return false;
|
|
189
|
+
return findFirst(node, (n) => n.type === 'BinaryExpression' && n.operator === '===' &&
|
|
190
|
+
n.left.type === 'MemberExpression' && n.left.property.name === 'mode' &&
|
|
191
|
+
n.right.type === 'Identifier' && n.right.name === targetModeVar) !== null;
|
|
192
|
+
});
|
|
193
|
+
assert(dqamCallback, 'Could not find dequeueAllMatching callback');
|
|
194
|
+
const modeComparison = findFirst(dqamCallback, (n) => n.type === 'BinaryExpression' && n.operator === '===' &&
|
|
195
|
+
n.left.type === 'MemberExpression' && n.left.property.name === 'mode' &&
|
|
196
|
+
n.right.type === 'Identifier' && n.right.name === targetModeVar);
|
|
197
|
+
const cbParam = dqamCallback.params[0].name;
|
|
198
|
+
editor.insertAt(modeComparison.end, `&&(${cbParam}.priority??"next")===__p`);
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
export default patch;
|
|
202
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/patches/queue.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,KAAK,GAAU;IACnB,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,mEAAmE;IAEhF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QACtD,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACpC,MAAM,EACJ,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,mBAAmB,GACpB,GAAG,KAAK,CAAC;QAEV,qEAAqE;QAErE,sDAAsD;QACtD,MAAM,gBAAgB,GAAG,0BAA0B,CAAC,GAAG,EAAE,SAAS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,KAAK,kBAAkB,IAAI,CAAC,CAAC,QAAQ,KAAK,KAAK;gBACtF,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,kBAAkB,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM;gBACrE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,aAAa,CAAC,KAAK,IAAI,CAAC;QAC9E,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,YAAY,EAAE,4CAA4C,CAAC,CAAC;QAEnE,MAAM,cAAc,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,kBAAkB,IAAI,CAAC,CAAC,QAAQ,KAAK,KAAK;YAC9G,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,kBAAkB,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM;YACrE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;QACnE,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5C,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,OAAO,0BAA0B,CAAC,CAAC;IAC/E,CAAC;CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Random Clawd Color Patch
|
|
3
|
+
*
|
|
4
|
+
* Picks a random color for the Clawd mascot on each startup
|
|
5
|
+
* instead of the default orange theme color.
|
|
6
|
+
*/
|
|
7
|
+
const patch = {
|
|
8
|
+
id: 'random-clawd',
|
|
9
|
+
name: 'Random Clawd Color',
|
|
10
|
+
description: 'Randomize the Clawd mascot color on each startup',
|
|
11
|
+
apply(ctx) {
|
|
12
|
+
const { ast, editor, find, assert } = ctx;
|
|
13
|
+
const { findFirst, findAll } = find;
|
|
14
|
+
// Find the Clawd component: function oM6(q) { ... }
|
|
15
|
+
// Identified by containing the strings "clawd_body" and "clawd_background"
|
|
16
|
+
// and the feet characters "▘▘ ▝▝".
|
|
17
|
+
const clawdFn = findFirst(ast, (n) => {
|
|
18
|
+
if (n.type !== 'FunctionDeclaration')
|
|
19
|
+
return false;
|
|
20
|
+
let hasClawd = false, hasFeet = false;
|
|
21
|
+
for (const child of find.walkAST(n.body)) {
|
|
22
|
+
if (child.type === 'Literal') {
|
|
23
|
+
if (child.value === 'clawd_body')
|
|
24
|
+
hasClawd = true;
|
|
25
|
+
if (child.value === '▘▘ ▝▝')
|
|
26
|
+
hasFeet = true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return hasClawd && hasFeet;
|
|
30
|
+
});
|
|
31
|
+
assert(clawdFn, 'Could not find Clawd component function');
|
|
32
|
+
// Inject a random color picker before the function
|
|
33
|
+
const colors = [
|
|
34
|
+
'#FF6B6B', '#4ECDC4', '#45B7D1', '#96CEB4', '#FFEAA7',
|
|
35
|
+
'#DDA0DD', '#98D8C8', '#F7DC6F', '#BB8FCE', '#85C1E9',
|
|
36
|
+
'#E74C3C', '#2ECC71', '#3498DB', '#E67E22', '#1ABC9C',
|
|
37
|
+
'#9B59B6', '#F39C12', '#00BCD4', '#FF5722', '#8BC34A',
|
|
38
|
+
];
|
|
39
|
+
const colorArray = JSON.stringify(colors);
|
|
40
|
+
editor.insertAt(clawdFn.start, `var __rc=${colorArray}[Math.floor(Math.random()*${colors.length})];`);
|
|
41
|
+
// Replace all "clawd_body" literals within the function with __rc
|
|
42
|
+
const clawdBodyLiterals = findAll(clawdFn, (n) => n.type === 'Literal' && n.value === 'clawd_body');
|
|
43
|
+
for (const lit of clawdBodyLiterals) {
|
|
44
|
+
editor.replaceRange(lit.start, lit.end, '__rc');
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export default patch;
|
|
49
|
+
//# sourceMappingURL=random-clawd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random-clawd.js","sourceRoot":"","sources":["../../src/patches/random-clawd.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,KAAK,GAAU;IACnB,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,kDAAkD;IAE/D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QAC1C,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEpC,oDAAoD;QACpD,2EAA2E;QAC3E,mCAAmC;QACnC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,CAAM,EAAE,EAAE;YACxC,IAAI,CAAC,CAAC,IAAI,KAAK,qBAAqB;gBAAE,OAAO,KAAK,CAAC;YACnD,IAAI,QAAQ,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK,CAAC;YACtC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;oBAC7B,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY;wBAAE,QAAQ,GAAG,IAAI,CAAC;oBAClD,IAAI,KAAK,CAAC,KAAK,KAAK,OAAO;wBAAE,OAAO,GAAG,IAAI,CAAC;gBAC9C,CAAC;YACH,CAAC;YACD,OAAO,QAAQ,IAAI,OAAO,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,OAAO,EAAE,yCAAyC,CAAC,CAAC;QAE3D,mDAAmD;QACnD,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;YACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;YACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;YACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;SACtD,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAC3B,YAAY,UAAU,6BAA6B,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC;QAEzE,kEAAkE;QAClE,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAM,EAAE,EAAE,CACpD,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC;QAEpD,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;YACpC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ctrl+X Ctrl+R Reload Patch
|
|
3
|
+
*
|
|
4
|
+
* Adds a "reload" keybinding: pressing Ctrl+X Ctrl+R exits Claude with
|
|
5
|
+
* exit code 75. The cx wrapper catches this and re-spawns with --continue,
|
|
6
|
+
* picking up any patch changes while preserving the conversation.
|
|
7
|
+
*/
|
|
8
|
+
import type { Patch } from '../types.js';
|
|
9
|
+
declare const patch: Patch;
|
|
10
|
+
export default patch;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ctrl+X Ctrl+R Reload Patch
|
|
3
|
+
*
|
|
4
|
+
* Adds a "reload" keybinding: pressing Ctrl+X Ctrl+R exits Claude with
|
|
5
|
+
* exit code 75. The cx wrapper catches this and re-spawns with --continue,
|
|
6
|
+
* picking up any patch changes while preserving the conversation.
|
|
7
|
+
*/
|
|
8
|
+
const patch = {
|
|
9
|
+
id: 'reload',
|
|
10
|
+
name: 'Ctrl+X Ctrl+R Reload',
|
|
11
|
+
description: 'Reload cx session with Ctrl+X Ctrl+R (re-applies patches, keeps conversation)',
|
|
12
|
+
apply(ctx) {
|
|
13
|
+
const { ast, editor, find, query, src, assert } = ctx;
|
|
14
|
+
const { findFirst } = find;
|
|
15
|
+
const { findArrayWithConsecutiveStrings, findObjectWithStringProps, findHookCallWithObjectKeys, } = query;
|
|
16
|
+
// ── 1. KEYBINDING_ACTIONS: register "chat:reload" ────────────────
|
|
17
|
+
const actionsArr = findArrayWithConsecutiveStrings(ast, 'chat:submit', 'chat:newline');
|
|
18
|
+
assert(actionsArr, 'Could not find KEYBINDING_ACTIONS array');
|
|
19
|
+
const newlineEl = actionsArr.elements.find((e) => e.type === 'Literal' && e.value === 'chat:newline');
|
|
20
|
+
editor.insertAt(newlineEl.end, ',"chat:reload"');
|
|
21
|
+
// ── 2. DEFAULT_BINDINGS: bind Ctrl+X Ctrl+R → chat:reload ────────
|
|
22
|
+
const bindingsObj = findObjectWithStringProps(ast, [['enter', 'chat:submit'], ['up', 'history:previous']]);
|
|
23
|
+
assert(bindingsObj, 'Could not find DEFAULT_BINDINGS Chat object');
|
|
24
|
+
const upProp = bindingsObj.properties.find((p) => p.type === 'Property' &&
|
|
25
|
+
((p.key.type === 'Identifier' && p.key.name === 'up') ||
|
|
26
|
+
(p.key.type === 'Literal' && p.key.value === 'up')));
|
|
27
|
+
editor.insertAt(upProp.end, ',"ctrl+x ctrl+r":"chat:reload"');
|
|
28
|
+
// ── 3. Handler: process.exit(75) in chatHandlers useMemo ─────────
|
|
29
|
+
const chatHandlersMemo = findHookCallWithObjectKeys(ast, 'useMemo', [
|
|
30
|
+
'chat:undo', 'chat:newline', 'chat:stash', 'chat:imagePaste',
|
|
31
|
+
]);
|
|
32
|
+
assert(chatHandlersMemo, 'Could not find chatHandlers useMemo');
|
|
33
|
+
const R = src(chatHandlersMemo.callee.object);
|
|
34
|
+
const handlersObject = findFirst(chatHandlersMemo.arguments[0], (n) => n.type === 'ObjectExpression' &&
|
|
35
|
+
n.properties.some((p) => p.type === 'Property' && p.key.type === 'Literal' && p.key.value === 'chat:undo'));
|
|
36
|
+
assert(handlersObject, 'Could not find handlers object in useMemo');
|
|
37
|
+
const depsArray = chatHandlersMemo.arguments[1];
|
|
38
|
+
assert(depsArray?.type === 'ArrayExpression', 'Could not find deps array');
|
|
39
|
+
const memoDecl = findFirst(ast, (n) => n.type === 'VariableDeclaration' && n.declarations.some((d) => d.init === chatHandlersMemo));
|
|
40
|
+
assert(memoDecl, 'Could not find VariableDeclaration for chatHandlers useMemo');
|
|
41
|
+
// useCallback with empty deps — process.exit(75) never changes
|
|
42
|
+
editor.insertAt(memoDecl.start, `let __rH=${R}.useCallback(()=>{process.exit(75)},[]);`);
|
|
43
|
+
const lastProp = handlersObject.properties[handlersObject.properties.length - 1];
|
|
44
|
+
editor.insertAt(lastProp.end, `,"chat:reload":__rH`);
|
|
45
|
+
const lastDep = depsArray.elements[depsArray.elements.length - 1];
|
|
46
|
+
editor.insertAt(lastDep.end, `,__rH`);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
export default patch;
|
|
50
|
+
//# sourceMappingURL=reload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload.js","sourceRoot":"","sources":["../../src/patches/reload.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,KAAK,GAAU;IACnB,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,+EAA+E;IAE5F,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE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MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjF,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC;QAErD,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAClE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Show File Paths in Collapsed Read/Search Display
|
|
3
|
+
*
|
|
4
|
+
* Instead of just "Read 3 files", shows the actual file paths:
|
|
5
|
+
* Read 3 files (src/foo.ts, src/bar.ts, src/baz.ts)
|
|
6
|
+
* Instead of just "Searched for 1 pattern", shows:
|
|
7
|
+
* Searched for 1 pattern ("handleSubmit")
|
|
8
|
+
*
|
|
9
|
+
* Addresses: https://github.com/anthropics/claude-code/issues/21151 (184 thumbs up)
|
|
10
|
+
*
|
|
11
|
+
* The data is already there — readFilePaths and searchArgs are extracted
|
|
12
|
+
* from the message but only shown during active execution as a hint.
|
|
13
|
+
* This patch adds them to the completed collapsed display.
|
|
14
|
+
*/
|
|
15
|
+
import type { Patch } from '../types.js';
|
|
16
|
+
declare const patch: Patch;
|
|
17
|
+
export default patch;
|