@lsctech/polaris 0.3.13 → 0.3.14
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/cli/adopt-canon.js +26 -1
- package/package.json +1 -1
package/dist/cli/adopt-canon.js
CHANGED
|
@@ -98,6 +98,28 @@ function injectLinkedDocs(content, docs, summaryLines) {
|
|
|
98
98
|
: lines.slice(headingIdx + 1);
|
|
99
99
|
return [...before, ...yamlLines, ...after].join("\n");
|
|
100
100
|
}
|
|
101
|
+
// Strip flags that require worker permissions and aren't needed for reasoning-only calls.
|
|
102
|
+
function stripWorkerFlags(args) {
|
|
103
|
+
const stripped = [];
|
|
104
|
+
let i = 0;
|
|
105
|
+
while (i < args.length) {
|
|
106
|
+
const a = args[i];
|
|
107
|
+
if (a === "--permission-mode") {
|
|
108
|
+
i += 2; // skip flag + value
|
|
109
|
+
}
|
|
110
|
+
else if (a === "--allowedTools") {
|
|
111
|
+
i++;
|
|
112
|
+
// skip all following values until next flag or "--"
|
|
113
|
+
while (i < args.length && !args[i].startsWith("-") && args[i] !== "--")
|
|
114
|
+
i++;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
stripped.push(a);
|
|
118
|
+
i++;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return stripped;
|
|
122
|
+
}
|
|
101
123
|
function dispatchCanonAgent(options) {
|
|
102
124
|
const { repoRoot, routeFolder, doctrineDocs, providers, providerOrder } = options;
|
|
103
125
|
const providerName = (0, librarian_dispatch_js_1.resolveLibrarianProvider)(providers, providerOrder);
|
|
@@ -125,7 +147,10 @@ Respond with ONLY valid JSON on a single line:
|
|
|
125
147
|
{"relevant_docs":[{"path":"<doc path>","title":"<doc title>"}],"summary_lines":["line1","line2"],"polaris_lines":["line1","line2"]}
|
|
126
148
|
|
|
127
149
|
If no doctrine docs are relevant, return an empty array for relevant_docs.`;
|
|
128
|
-
|
|
150
|
+
// Canon dispatch is pure reasoning — strip worker-only flags (--permission-mode, --allowedTools)
|
|
151
|
+
// to avoid failures when the provider config is tuned for code-editing agents.
|
|
152
|
+
const rawArgs = (cfg.args ?? []).map((a) => (a === "{{worker_prompt}}" ? prompt : a));
|
|
153
|
+
const args = stripWorkerFlags(rawArgs);
|
|
129
154
|
const result = (0, node_child_process_1.spawnSync)(cfg.command, args, {
|
|
130
155
|
encoding: "utf-8",
|
|
131
156
|
timeout: 60000,
|