@maintainer-pro/ai-cli 0.1.7 → 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 +7 -3
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -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
|
}
|
|
@@ -645,7 +649,7 @@ Only use those runtime tools for live state. Never invent runtime tools.` : "";
|
|
|
645
649
|
- Never touch paths that match this ignore list (relative to the workspace):
|
|
646
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)"}
|
|
647
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.` : "";
|
|
648
|
-
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.
|
|
649
653
|
|
|
650
654
|
${input.productDescription}
|
|
651
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
|
}
|
|
@@ -531,7 +535,7 @@ Only use those runtime tools for live state. Never invent runtime tools.` : "";
|
|
|
531
535
|
- Never touch paths that match this ignore list (relative to the workspace):
|
|
532
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)"}
|
|
533
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.` : "";
|
|
534
|
-
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.
|
|
535
539
|
|
|
536
540
|
${input.productDescription}
|
|
537
541
|
|