toga-ai 1.0.575 → 1.0.577

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.575",
3
+ "version": "1.0.577",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",
@@ -68,12 +68,15 @@ function readPayload() {
68
68
  try { data.tool_input = JSON.parse(process.env.CLAUDE_TOOL_INPUT); } catch (e) {}
69
69
  }
70
70
  if (!data.prompt && process.env.CLAUDE_USER_PROMPT) data.prompt = process.env.CLAUDE_USER_PROMPT;
71
- if (!data.session_id && process.env.CLAUDE_SESSION_ID) data.session_id = process.env.CLAUDE_SESSION_ID;
71
+ if (!data.session_id) data.session_id = process.env.CLAUDE_SESSION_ID || process.env.CLAUDE_CODE_SESSION_ID;
72
72
  return data;
73
73
  }
74
74
 
75
75
  function lockPath() {
76
- return path.join(process.cwd(), '.claude', '.kickoff-gate.json');
76
+ // Anchor to the project dir (reliably provided by the harness) rather than the shell's
77
+ // cwd, so the hook and a manually-run `kickoff-primed` always agree on the lock location.
78
+ const base = process.env.CLAUDE_PROJECT_DIR || process.cwd();
79
+ return path.join(base, '.claude', '.kickoff-gate.json');
77
80
  }
78
81
 
79
82
  function readLock() {
@@ -250,10 +253,10 @@ function main() {
250
253
  // preflight ADVANCES to stage 2 (does NOT release) — the team KB is still unprimed.
251
254
  if (isPreflightBash(command)) { writeLock(lock.session, 'primer'); process.exit(0); }
252
255
  if (isPrimingBash(command)) process.exit(0); // other read-only priming step
253
- console.log(armedMessage());
256
+ console.error(armedMessage());
254
257
  process.exit(2);
255
258
  }
256
- if (BLOCKED_TOOLS.has(tool)) { console.log(armedMessage()); process.exit(2); }
259
+ if (BLOCKED_TOOLS.has(tool)) { console.error(armedMessage()); process.exit(2); }
257
260
  process.exit(0); // AskUserQuestion, Skill, TodoWrite, … — part of the interview
258
261
  }
259
262
 
@@ -263,7 +266,7 @@ function main() {
263
266
  // Priming must run in the MAIN session; delegating it (or fanning out other agents
264
267
  // alongside it) is exactly what this stage forbids.
265
268
  if (tool === 'Agent' || tool === 'Task') {
266
- console.log(primerMessage());
269
+ console.error(primerMessage());
267
270
  process.exit(2);
268
271
  }
269
272
  if (tool === 'Bash') {
@@ -271,22 +274,22 @@ function main() {
271
274
  // has read every resolved doc itself, in the main session.
272
275
  if (isPrimedSentinelBash(command)) { clearLock(); process.exit(0); }
273
276
  if (isPrimingBash(command)) process.exit(0); // knowledge.js search/get, version check, …
274
- console.log(primerMessage());
277
+ console.error(primerMessage());
275
278
  process.exit(2);
276
279
  }
277
280
  if (tool === 'Read') {
278
281
  const p = toolInput.file_path || toolInput.path;
279
282
  if (isMemoryReadPath(p)) process.exit(0); // repo-path lookup
280
283
  if (isTeamKbPath(p)) process.exit(0); // reading a team-KB doc IS the priming
281
- console.log(primerMessage()); // repo code — blocked until primed
284
+ console.error(primerMessage()); // repo code — blocked until primed
282
285
  process.exit(2);
283
286
  }
284
287
  if (tool === 'Grep' || tool === 'Glob') {
285
288
  if (isTeamKbSearch(toolInput)) process.exit(0); // locating a doc inside knowledge/
286
- console.log(primerMessage()); // searching repo code — blocked
289
+ console.error(primerMessage()); // searching repo code — blocked
287
290
  process.exit(2);
288
291
  }
289
- if (BLOCKED_TOOLS.has(tool)) { console.log(primerMessage()); process.exit(2); } // Edit/Write/…
292
+ if (BLOCKED_TOOLS.has(tool)) { console.error(primerMessage()); process.exit(2); } // Edit/Write/…
290
293
  process.exit(0); // AskUserQuestion (ask for a repo path), Skill, … — allowed
291
294
  }
292
295