@iinm/plain-agent 1.10.1 → 1.10.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/package.json +1 -1
- package/src/claudeCodePlugin.mjs +2 -2
- package/src/cliCommands.mjs +5 -5
- package/src/cliInteractive.mjs +4 -4
- package/src/config.mjs +1 -1
- package/src/context/loadAgentRoles.mjs +2 -2
- package/src/context/loadPrompts.mjs +2 -2
- package/src/context/loadUserMessageContext.mjs +1 -1
package/package.json
CHANGED
package/src/claudeCodePlugin.mjs
CHANGED
|
@@ -32,7 +32,7 @@ export function resolvePluginPaths(repos) {
|
|
|
32
32
|
for (const repo of repos) {
|
|
33
33
|
const ownerRepo = extractOwnerRepo(repo.source);
|
|
34
34
|
if (!ownerRepo) {
|
|
35
|
-
console.
|
|
35
|
+
console.error(`Invalid source URL: ${repo.source}`);
|
|
36
36
|
continue;
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -43,7 +43,7 @@ export function resolvePluginPaths(repos) {
|
|
|
43
43
|
try {
|
|
44
44
|
only = new RegExp(plugin.only);
|
|
45
45
|
} catch (err) {
|
|
46
|
-
console.
|
|
46
|
+
console.error(
|
|
47
47
|
`Invalid regex pattern "${plugin.only}" for plugin "${plugin.name}":`,
|
|
48
48
|
err instanceof Error ? err.message : String(err),
|
|
49
49
|
);
|
package/src/cliCommands.mjs
CHANGED
|
@@ -75,7 +75,7 @@ export function createCommandHandler({
|
|
|
75
75
|
const prompt = prompts.get(id);
|
|
76
76
|
|
|
77
77
|
if (!prompt) {
|
|
78
|
-
console.
|
|
78
|
+
console.error(styleText("red", `\nPrompt not found: ${id}`));
|
|
79
79
|
return "prompt";
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -116,13 +116,13 @@ export function createCommandHandler({
|
|
|
116
116
|
if (inputTrimmed.startsWith("!")) {
|
|
117
117
|
const fileRange = parseFileRange(inputTrimmed.slice(1));
|
|
118
118
|
if (fileRange instanceof Error) {
|
|
119
|
-
console.
|
|
119
|
+
console.error(styleText("red", `\n${fileRange.message}`));
|
|
120
120
|
return "prompt";
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
const fileContent = await readFileRange(fileRange);
|
|
124
124
|
if (fileContent instanceof Error) {
|
|
125
|
-
console.
|
|
125
|
+
console.error(styleText("red", `\n${fileContent.message}`));
|
|
126
126
|
return "prompt";
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -174,7 +174,7 @@ export function createCommandHandler({
|
|
|
174
174
|
if (inputTrimmed.startsWith("/agents:")) {
|
|
175
175
|
const match = inputTrimmed.match(/^\/agents:([^ ]+)(?:\s+(.*))?$/s);
|
|
176
176
|
if (!match) {
|
|
177
|
-
console.
|
|
177
|
+
console.error(styleText("red", "\nInvalid agent invocation format."));
|
|
178
178
|
return "prompt";
|
|
179
179
|
}
|
|
180
180
|
return await invokeAgent(match[1], match[2] || "");
|
|
@@ -204,7 +204,7 @@ export function createCommandHandler({
|
|
|
204
204
|
if (inputTrimmed.startsWith("/prompts:")) {
|
|
205
205
|
const match = inputTrimmed.match(/^\/prompts:([^ ]+)(?:\s+(.*))?$/s);
|
|
206
206
|
if (!match) {
|
|
207
|
-
console.
|
|
207
|
+
console.error(styleText("red", "\nInvalid prompt invocation format."));
|
|
208
208
|
return "prompt";
|
|
209
209
|
}
|
|
210
210
|
return await invokePrompt(
|
package/src/cliInteractive.mjs
CHANGED
|
@@ -281,7 +281,7 @@ export function startInteractiveSession({
|
|
|
281
281
|
// Agent turn: pause auto-approve; do not clear input.
|
|
282
282
|
if (!state.turn) {
|
|
283
283
|
agentCommands.pauseAutoApprove();
|
|
284
|
-
console.
|
|
284
|
+
console.error(
|
|
285
285
|
styleText(
|
|
286
286
|
"yellow",
|
|
287
287
|
"\n\n⚠️ Ctrl-C: Auto-approve paused. Finishing current tool...\nPress Ctrl-D twice to exit.\n",
|
|
@@ -328,7 +328,7 @@ export function startInteractiveSession({
|
|
|
328
328
|
);
|
|
329
329
|
cli.prompt();
|
|
330
330
|
} else {
|
|
331
|
-
console.
|
|
331
|
+
console.error(styleText("yellow", "\n\n⚠️ Press Ctrl-D again to exit.\n"));
|
|
332
332
|
}
|
|
333
333
|
};
|
|
334
334
|
|
|
@@ -418,7 +418,7 @@ export function startInteractiveSession({
|
|
|
418
418
|
|
|
419
419
|
cli.on("line", async (lineInput) => {
|
|
420
420
|
if (!state.turn) {
|
|
421
|
-
console.
|
|
421
|
+
console.error(
|
|
422
422
|
styleText(
|
|
423
423
|
"yellow",
|
|
424
424
|
`\nAgent is working. Ignore input: ${lineInput.trim()}`,
|
|
@@ -511,7 +511,7 @@ export function startInteractiveSession({
|
|
|
511
511
|
});
|
|
512
512
|
|
|
513
513
|
agentEventEmitter.on("error", (error) => {
|
|
514
|
-
console.
|
|
514
|
+
console.error(
|
|
515
515
|
styleText(
|
|
516
516
|
"red",
|
|
517
517
|
`\nError: message=${error.message}, stack=${error.stack}`,
|
package/src/config.mjs
CHANGED
|
@@ -128,7 +128,7 @@ export async function loadConfigFile(filePath, skipTrustCheck = false) {
|
|
|
128
128
|
|
|
129
129
|
if (!isTrusted) {
|
|
130
130
|
if (!process.stdout.isTTY) {
|
|
131
|
-
console.
|
|
131
|
+
console.error(
|
|
132
132
|
styleText(
|
|
133
133
|
"yellow",
|
|
134
134
|
`WARNING: Config file found at '${filePath}' but cannot ask for approval without a TTY. Skipping.`,
|
|
@@ -54,7 +54,7 @@ export async function loadAgentRoles(claudeCodePlugins) {
|
|
|
54
54
|
agentDirs.map(async ({ dir, idPrefix, only }) => {
|
|
55
55
|
const files = await getMarkdownFiles(dir).catch((err) => {
|
|
56
56
|
if (err.code !== "ENOENT") {
|
|
57
|
-
console.
|
|
57
|
+
console.error(`Failed to list agent roles in ${dir}:`, err);
|
|
58
58
|
}
|
|
59
59
|
return /** @type {string[]} */ ([]);
|
|
60
60
|
});
|
|
@@ -72,7 +72,7 @@ export async function loadAgentRoles(claudeCodePlugins) {
|
|
|
72
72
|
files.map(async ({ dir, file, idPrefix }) => {
|
|
73
73
|
const fullPath = path.join(dir, file);
|
|
74
74
|
const content = await fs.readFile(fullPath, "utf-8").catch((err) => {
|
|
75
|
-
console.
|
|
75
|
+
console.error(`Failed to read agent role file ${fullPath}:`, err);
|
|
76
76
|
return null;
|
|
77
77
|
});
|
|
78
78
|
|
|
@@ -69,7 +69,7 @@ export async function loadPrompts(claudeCodePlugins) {
|
|
|
69
69
|
promptDirs.map(async ({ dir, idPrefix, only }) => {
|
|
70
70
|
const files = await getMarkdownFiles(dir).catch((err) => {
|
|
71
71
|
if (err.code !== "ENOENT") {
|
|
72
|
-
console.
|
|
72
|
+
console.error(`Failed to list prompts in ${dir}:`, err);
|
|
73
73
|
}
|
|
74
74
|
return /** @type {string[]} */ ([]);
|
|
75
75
|
});
|
|
@@ -95,7 +95,7 @@ export async function loadPrompts(claudeCodePlugins) {
|
|
|
95
95
|
files.map(async ({ dir, file, idPrefix }) => {
|
|
96
96
|
const fullPath = path.join(dir, file);
|
|
97
97
|
const content = await fs.readFile(fullPath, "utf-8").catch((err) => {
|
|
98
|
-
console.
|
|
98
|
+
console.error(`Failed to read prompt file ${fullPath}:`, err);
|
|
99
99
|
return null;
|
|
100
100
|
});
|
|
101
101
|
|