@maintainer-pro/ai-cli 0.1.6 → 0.1.8
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/index.cjs +8 -3
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -164,9 +164,13 @@ function formatClientContext(context) {
|
|
|
164
164
|
if (!context) return "";
|
|
165
165
|
const lines = [
|
|
166
166
|
"Client context (live UI snapshot):",
|
|
167
|
-
|
|
168
|
-
`- Page title: ${context.pageTitle}`
|
|
167
|
+
"The user currently has this page open. Prefer changing this screen unless they clearly mean another."
|
|
169
168
|
];
|
|
169
|
+
if (context.pageUrl) {
|
|
170
|
+
lines.push(`- Page URL: ${context.pageUrl}`);
|
|
171
|
+
}
|
|
172
|
+
lines.push(`- Route: ${context.route}`);
|
|
173
|
+
lines.push(`- Page title: ${context.pageTitle}`);
|
|
170
174
|
if (context.visiblePanels?.length) {
|
|
171
175
|
lines.push(`- Visible panels: ${context.visiblePanels.join(", ")}`);
|
|
172
176
|
}
|
|
@@ -377,6 +381,7 @@ async function callClaudeCli(command, messages, context, options) {
|
|
|
377
381
|
resolved,
|
|
378
382
|
[
|
|
379
383
|
"--print",
|
|
384
|
+
"--dangerously-skip-permissions",
|
|
380
385
|
"--system-prompt",
|
|
381
386
|
options.systemPrompt,
|
|
382
387
|
"--no-session-persistence",
|
|
@@ -644,7 +649,7 @@ Only use those runtime tools for live state. Never invent runtime tools.` : "";
|
|
|
644
649
|
- Never touch paths that match this ignore list (relative to the workspace):
|
|
645
650
|
${(input.ignorePaths ?? []).filter((p) => !p.startsWith("!")).length ? (input.ignorePaths ?? []).filter((p) => !p.startsWith("!")).map((p) => `- ${p}`).join("\n") : "- (none beyond staying inside the workspace)"}
|
|
646
651
|
- If a request requires something outside the workspace or on the ignore list, refuse that part and explain you can only change allowed project files.` : "";
|
|
647
|
-
return `You are a helpful product assistant for an app the user is looking at right now.
|
|
652
|
+
return `You are a helpful product assistant for an app the user is looking at right now. The live UI snapshot (page URL / route) is the screen they have open \u2014 start there when they ask for a change.
|
|
648
653
|
|
|
649
654
|
${input.productDescription}
|
|
650
655
|
|
package/dist/index.d.cts
CHANGED
|
@@ -38,6 +38,8 @@ interface ChatUser {
|
|
|
38
38
|
/** Live UI / app snapshot sent with each chat request (host-defined). */
|
|
39
39
|
interface ClientContext {
|
|
40
40
|
route: string;
|
|
41
|
+
/** Full browser URL of the page the user currently has open. */
|
|
42
|
+
pageUrl?: string;
|
|
41
43
|
pageTitle: string;
|
|
42
44
|
visiblePanels?: string[];
|
|
43
45
|
focusedElement?: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ interface ChatUser {
|
|
|
38
38
|
/** Live UI / app snapshot sent with each chat request (host-defined). */
|
|
39
39
|
interface ClientContext {
|
|
40
40
|
route: string;
|
|
41
|
+
/** Full browser URL of the page the user currently has open. */
|
|
42
|
+
pageUrl?: string;
|
|
41
43
|
pageTitle: string;
|
|
42
44
|
visiblePanels?: string[];
|
|
43
45
|
focusedElement?: string | null;
|
package/dist/index.js
CHANGED
|
@@ -50,9 +50,13 @@ function formatClientContext(context) {
|
|
|
50
50
|
if (!context) return "";
|
|
51
51
|
const lines = [
|
|
52
52
|
"Client context (live UI snapshot):",
|
|
53
|
-
|
|
54
|
-
`- Page title: ${context.pageTitle}`
|
|
53
|
+
"The user currently has this page open. Prefer changing this screen unless they clearly mean another."
|
|
55
54
|
];
|
|
55
|
+
if (context.pageUrl) {
|
|
56
|
+
lines.push(`- Page URL: ${context.pageUrl}`);
|
|
57
|
+
}
|
|
58
|
+
lines.push(`- Route: ${context.route}`);
|
|
59
|
+
lines.push(`- Page title: ${context.pageTitle}`);
|
|
56
60
|
if (context.visiblePanels?.length) {
|
|
57
61
|
lines.push(`- Visible panels: ${context.visiblePanels.join(", ")}`);
|
|
58
62
|
}
|
|
@@ -263,6 +267,7 @@ async function callClaudeCli(command, messages, context, options) {
|
|
|
263
267
|
resolved,
|
|
264
268
|
[
|
|
265
269
|
"--print",
|
|
270
|
+
"--dangerously-skip-permissions",
|
|
266
271
|
"--system-prompt",
|
|
267
272
|
options.systemPrompt,
|
|
268
273
|
"--no-session-persistence",
|
|
@@ -530,7 +535,7 @@ Only use those runtime tools for live state. Never invent runtime tools.` : "";
|
|
|
530
535
|
- Never touch paths that match this ignore list (relative to the workspace):
|
|
531
536
|
${(input.ignorePaths ?? []).filter((p) => !p.startsWith("!")).length ? (input.ignorePaths ?? []).filter((p) => !p.startsWith("!")).map((p) => `- ${p}`).join("\n") : "- (none beyond staying inside the workspace)"}
|
|
532
537
|
- If a request requires something outside the workspace or on the ignore list, refuse that part and explain you can only change allowed project files.` : "";
|
|
533
|
-
return `You are a helpful product assistant for an app the user is looking at right now.
|
|
538
|
+
return `You are a helpful product assistant for an app the user is looking at right now. The live UI snapshot (page URL / route) is the screen they have open \u2014 start there when they ask for a change.
|
|
534
539
|
|
|
535
540
|
${input.productDescription}
|
|
536
541
|
|