@lsctech/polaris 0.3.13 → 0.3.15

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.
@@ -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,12 +147,22 @@ 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
- const args = (cfg.args ?? []).map((a) => (a === "{{worker_prompt}}" ? prompt : a));
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
- timeout: 60000,
156
+ timeout: 120000,
132
157
  cwd: repoRoot,
133
158
  });
159
+ if (result.error) {
160
+ console.log(` agent error: ${result.error.message}`);
161
+ return null;
162
+ }
163
+ if (result.stderr?.trim()) {
164
+ console.log(` agent stderr: ${result.stderr.trim().slice(0, 200)}`);
165
+ }
134
166
  const stdout = (result.stdout ?? "").trim();
135
167
  // Try single-line JSON first (ideal case)
136
168
  const jsonLine = stdout
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsctech/polaris",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "description": "Polaris — standalone taskchain orchestration framework for governed AI agent workflows",
5
5
  "bin": {
6
6
  "polaris-cli": "dist/cli/index.js"