@orchestrator-claude/definitions 3.37.0 → 3.37.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.
Files changed (73) hide show
  1. package/agents/adversarial-reviewer.md +6 -1
  2. package/agents/api-extractor.md +6 -0
  3. package/agents/azure-devops-engineer.md +1 -2
  4. package/agents/business-rule-miner.md +6 -0
  5. package/agents/cicd-platform-engineer.md +1 -2
  6. package/agents/ciclo-engineer.md +50 -21
  7. package/agents/code-archaeologist.md +6 -0
  8. package/agents/debug-sidecar.md +6 -0
  9. package/agents/doc-sidecar.md +6 -0
  10. package/agents/docs-guardian.md +9 -3
  11. package/agents/frontend-engineer.md +1 -2
  12. package/agents/{ai-architect.md → harness-architect.md} +8 -3
  13. package/agents/implementer.md +6 -1
  14. package/agents/legacy-discoverer.md +6 -0
  15. package/agents/legacy-synthesizer.md +6 -0
  16. package/agents/methodology-researcher.md +6 -1
  17. package/agents/operational-artifact-builder.md +6 -1
  18. package/agents/orchestrator.md +27 -87
  19. package/agents/planner.md +6 -1
  20. package/agents/presentation-engineer.md +29 -15
  21. package/agents/python-data-engineer.md +0 -1
  22. package/agents/researcher.md +6 -0
  23. package/agents/reviewer.md +6 -1
  24. package/agents/schema-extractor.md +6 -0
  25. package/agents/software-architect.md +10 -5
  26. package/agents/specifier.md +6 -1
  27. package/agents/task-generator.md +6 -1
  28. package/agents/test-sidecar.md +6 -0
  29. package/dist/scripts/generate-hooks-matcher.d.ts +106 -0
  30. package/dist/scripts/generate-hooks-matcher.d.ts.map +1 -0
  31. package/dist/scripts/generate-hooks-matcher.js +153 -0
  32. package/dist/scripts/generate-hooks-matcher.js.map +1 -0
  33. package/dist/scripts/generate-manifest.d.ts +22 -0
  34. package/dist/scripts/generate-manifest.d.ts.map +1 -1
  35. package/dist/scripts/generate-manifest.js +67 -2
  36. package/dist/scripts/generate-manifest.js.map +1 -1
  37. package/hooks/agent-git-guard.mjs +63 -11
  38. package/hooks/dangling-guard.mjs +42 -12
  39. package/hooks/gate-guardian.mjs +38 -8
  40. package/hooks/hooks.json +3 -9
  41. package/hooks/lib/api-client.ts +128 -9
  42. package/hooks/lib/capability-scanner.ts +462 -55
  43. package/hooks/lib/dispatch-marker.ts +214 -0
  44. package/hooks/lib/git-checkpoint.ts +34 -37
  45. package/hooks/lib/observations-helper.ts +14 -1
  46. package/hooks/lib/security-gate-core.ts +271 -0
  47. package/hooks/mailbox-listener.mjs +69 -17
  48. package/hooks/playwright-output-guard.mjs +40 -10
  49. package/hooks/post-implement.mjs +38 -8
  50. package/hooks/pre-agent-dispatch.mjs +137 -16
  51. package/hooks/pre-agent-dispatch.ts +82 -15
  52. package/hooks/security-gate-honest.mjs +302 -0
  53. package/hooks/security-gate-honest.ts +148 -0
  54. package/hooks/session-start.mjs +304 -106
  55. package/hooks/session-start.ts +317 -71
  56. package/hooks/subagent-start.mjs +7673 -22
  57. package/hooks/subagent-start.ts +367 -16
  58. package/hooks/subagent-stop.mjs +102 -62
  59. package/hooks/subagent-stop.ts +124 -28
  60. package/hooks/user-prompt.mjs +43 -13
  61. package/hooks/verification-before-completion.mjs +63 -11
  62. package/hooks/workflow-guard.mjs +45 -11
  63. package/hooks-settings-template.json +1 -7
  64. package/manifest.json +77 -61
  65. package/package.json +4 -2
  66. package/skills/checkpoint-protocol/SKILL.md +19 -4
  67. package/skills/ciclo-lane-dispatch/SKILL.md +117 -8
  68. package/skills/fase-1b-projecao/SKILL.md +150 -0
  69. package/skills/lane-1-entrevista/SKILL.md +173 -0
  70. package/skills/orchestrator/SKILL.md +11 -3
  71. package/skills/workflow-coordination/SKILL.md +3 -3
  72. package/hooks/post-compact.mjs +0 -7931
  73. package/hooks/post-compact.ts +0 -170
@@ -2,19 +2,71 @@ import { createRequire as __createRequireShim } from 'node:module'; const requir
2
2
 
3
3
  // hooks/lib/api-client.ts
4
4
  import { readFileSync, writeFileSync, mkdirSync, statSync, unlinkSync, readdirSync } from "node:fs";
5
- import { join, dirname } from "node:path";
6
- import { fileURLToPath } from "node:url";
7
- var __filename = fileURLToPath(import.meta.url);
8
- var __dirname = dirname(__filename);
9
- var PROJECT_ROOT = join(__dirname, "..", "..", "..");
10
- var STATE_DIR = join(PROJECT_ROOT, ".orchestrator", ".state");
11
- var JWT_CACHE = join(STATE_DIR, "jwt-token");
12
- var DEBUG_LOG = join(STATE_DIR, "hook-debug.log");
5
+ import { join as join2 } from "node:path";
6
+ import { tmpdir } from "node:os";
7
+ import { createHash } from "node:crypto";
8
+
9
+ // ../project-root-resolver/dist/index.js
10
+ import { existsSync } from "node:fs";
11
+ import { dirname, join } from "node:path";
12
+ function hasProjectRootMarker(candidate, sentinel) {
13
+ return existsSync(join(candidate, ".git")) || existsSync(join(candidate, "package.json")) || existsSync(join(candidate, sentinel, ".root"));
14
+ }
15
+ function resolveProjectRoot(cwd, sentinel = ".orchestrator") {
16
+ const candidates = [];
17
+ let currentDir = cwd;
18
+ for (; ; ) {
19
+ if (existsSync(join(currentDir, sentinel))) {
20
+ candidates.push(currentDir);
21
+ }
22
+ const parentDir = dirname(currentDir);
23
+ if (parentDir === currentDir) {
24
+ break;
25
+ }
26
+ currentDir = parentDir;
27
+ }
28
+ const [innermost] = candidates;
29
+ if (innermost === void 0) {
30
+ return null;
31
+ }
32
+ for (const candidate of candidates) {
33
+ if (hasProjectRootMarker(candidate, sentinel)) {
34
+ return candidate;
35
+ }
36
+ }
37
+ return innermost;
38
+ }
39
+
40
+ // hooks/lib/api-client.ts
41
+ function resolveFallbackStateDir(cwd) {
42
+ const cwdHash = createHash("sha256").update(cwd).digest("hex").slice(0, 16);
43
+ return join2(tmpdir(), "orchestrator-hook-fallback", cwdHash);
44
+ }
45
+ var PROJECT_ROOT = (() => {
46
+ const resolved = resolveHookProjectRoot(process.cwd());
47
+ if (resolved !== null && hasProjectRootMarker(resolved, ".orchestrator")) {
48
+ return resolved;
49
+ }
50
+ return null;
51
+ })();
52
+ var STATE_DIR_OVERRIDE = process.env.ORCHESTRATOR_STATE_DIR;
53
+ var STATE_DIR = STATE_DIR_OVERRIDE !== void 0 && STATE_DIR_OVERRIDE !== "" ? STATE_DIR_OVERRIDE : PROJECT_ROOT !== null ? join2(PROJECT_ROOT, ".orchestrator", ".state") : resolveFallbackStateDir(process.cwd());
54
+ var JWT_CACHE = join2(STATE_DIR, "jwt-token");
55
+ var DEBUG_LOG = join2(STATE_DIR, "hook-debug.log");
13
56
  mkdirSync(STATE_DIR, { recursive: true });
57
+ if ((STATE_DIR_OVERRIDE === void 0 || STATE_DIR_OVERRIDE === "") && PROJECT_ROOT === null) {
58
+ log(
59
+ "API-CLIENT",
60
+ `PROJECT_ROOT: no marker-verified ".orchestrator" project root found above ${process.cwd()} \u2014 falling back to isolated state dir ${STATE_DIR} (RF-003)`
61
+ );
62
+ }
14
63
  var API_URL = process.env.ORCHESTRATOR_API_URL || "http://localhost:3001";
15
64
  var AUTH_EMAIL = process.env.ORCHESTRATOR_ADMIN_EMAIL || process.env.ORCHESTRATOR_AUTH_EMAIL || "system@orchestrator.local";
16
65
  var AUTH_PASSWORD = process.env.ORCHESTRATOR_ADMIN_PASSWORD || process.env.ORCHESTRATOR_AUTH_PASSWORD || "system123";
17
66
  var PROJECT_ID = process.env.ORCHESTRATOR_PROJECT_ID || "";
67
+ function resolveHookProjectRoot(cwd) {
68
+ return resolveProjectRoot(cwd);
69
+ }
18
70
  function log(prefix, msg) {
19
71
  const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/\.\d+Z$/, "Z");
20
72
  try {
@@ -24,11 +76,11 @@ function log(prefix, msg) {
24
76
  } catch {
25
77
  }
26
78
  }
27
- var LAST_COMPLETED_FILE = join(STATE_DIR, "last-completed-workflow.json");
79
+ var LAST_COMPLETED_FILE = join2(STATE_DIR, "last-completed-workflow.json");
28
80
  var LAST_COMPLETED_TTL_MS = 60 * 60 * 1e3;
29
- var INVOCATIONS_DIR = join(STATE_DIR, "invocations");
81
+ var INVOCATIONS_DIR = join2(STATE_DIR, "invocations");
30
82
  var INVOCATION_STATE_TTL_MS = 4 * 60 * 60 * 1e3;
31
- var DISPATCH_INTENT_DIR = join(STATE_DIR, "dispatch-intent");
83
+ var DISPATCH_INTENT_DIR = join2(STATE_DIR, "dispatch-intent");
32
84
  async function readStdin() {
33
85
  const chunks = [];
34
86
  for await (const chunk of process.stdin) {
@@ -7321,39 +7321,69 @@ var require_dist = __commonJS({
7321
7321
  });
7322
7322
 
7323
7323
  // hooks/workflow-guard.ts
7324
- import { dirname as dirname3, join as join4 } from "node:path";
7324
+ import { dirname as dirname2, join as join4 } from "node:path";
7325
7325
  import { existsSync as existsSync3 } from "node:fs";
7326
7326
 
7327
7327
  // hooks/lib/api-client.ts
7328
7328
  import { readFileSync, writeFileSync, mkdirSync, statSync, unlinkSync, readdirSync } from "node:fs";
7329
- import { join as join2, dirname as dirname2 } from "node:path";
7330
- import { fileURLToPath } from "node:url";
7329
+ import { join as join2 } from "node:path";
7330
+ import { tmpdir } from "node:os";
7331
+ import { createHash } from "node:crypto";
7331
7332
 
7332
7333
  // ../project-root-resolver/dist/index.js
7333
7334
  import { existsSync } from "node:fs";
7334
7335
  import { dirname, join } from "node:path";
7336
+ function hasProjectRootMarker(candidate, sentinel) {
7337
+ return existsSync(join(candidate, ".git")) || existsSync(join(candidate, "package.json")) || existsSync(join(candidate, sentinel, ".root"));
7338
+ }
7335
7339
  function resolveProjectRoot(cwd, sentinel = ".orchestrator") {
7340
+ const candidates = [];
7336
7341
  let currentDir = cwd;
7337
7342
  for (; ; ) {
7338
7343
  if (existsSync(join(currentDir, sentinel))) {
7339
- return currentDir;
7344
+ candidates.push(currentDir);
7340
7345
  }
7341
7346
  const parentDir = dirname(currentDir);
7342
7347
  if (parentDir === currentDir) {
7343
- return null;
7348
+ break;
7344
7349
  }
7345
7350
  currentDir = parentDir;
7346
7351
  }
7352
+ const [innermost] = candidates;
7353
+ if (innermost === void 0) {
7354
+ return null;
7355
+ }
7356
+ for (const candidate of candidates) {
7357
+ if (hasProjectRootMarker(candidate, sentinel)) {
7358
+ return candidate;
7359
+ }
7360
+ }
7361
+ return innermost;
7347
7362
  }
7348
7363
 
7349
7364
  // hooks/lib/api-client.ts
7350
- var __filename = fileURLToPath(import.meta.url);
7351
- var __dirname = dirname2(__filename);
7352
- var PROJECT_ROOT = join2(__dirname, "..", "..", "..");
7353
- var STATE_DIR = join2(PROJECT_ROOT, ".orchestrator", ".state");
7365
+ function resolveFallbackStateDir(cwd) {
7366
+ const cwdHash = createHash("sha256").update(cwd).digest("hex").slice(0, 16);
7367
+ return join2(tmpdir(), "orchestrator-hook-fallback", cwdHash);
7368
+ }
7369
+ var PROJECT_ROOT = (() => {
7370
+ const resolved = resolveHookProjectRoot(process.cwd());
7371
+ if (resolved !== null && hasProjectRootMarker(resolved, ".orchestrator")) {
7372
+ return resolved;
7373
+ }
7374
+ return null;
7375
+ })();
7376
+ var STATE_DIR_OVERRIDE = process.env.ORCHESTRATOR_STATE_DIR;
7377
+ var STATE_DIR = STATE_DIR_OVERRIDE !== void 0 && STATE_DIR_OVERRIDE !== "" ? STATE_DIR_OVERRIDE : PROJECT_ROOT !== null ? join2(PROJECT_ROOT, ".orchestrator", ".state") : resolveFallbackStateDir(process.cwd());
7354
7378
  var JWT_CACHE = join2(STATE_DIR, "jwt-token");
7355
7379
  var DEBUG_LOG = join2(STATE_DIR, "hook-debug.log");
7356
7380
  mkdirSync(STATE_DIR, { recursive: true });
7381
+ if ((STATE_DIR_OVERRIDE === void 0 || STATE_DIR_OVERRIDE === "") && PROJECT_ROOT === null) {
7382
+ log(
7383
+ "API-CLIENT",
7384
+ `PROJECT_ROOT: no marker-verified ".orchestrator" project root found above ${process.cwd()} \u2014 falling back to isolated state dir ${STATE_DIR} (RF-003)`
7385
+ );
7386
+ }
7357
7387
  var API_URL = process.env.ORCHESTRATOR_API_URL || "http://localhost:3001";
7358
7388
  var AUTH_EMAIL = process.env.ORCHESTRATOR_ADMIN_EMAIL || process.env.ORCHESTRATOR_AUTH_EMAIL || "system@orchestrator.local";
7359
7389
  var AUTH_PASSWORD = process.env.ORCHESTRATOR_ADMIN_PASSWORD || process.env.ORCHESTRATOR_AUTH_PASSWORD || "system123";
@@ -7397,6 +7427,10 @@ async function ensureProjectIdResolved(token) {
7397
7427
  );
7398
7428
  }
7399
7429
  }
7430
+ function normalizeAgentName(subagentType) {
7431
+ const i = subagentType.lastIndexOf(":");
7432
+ return i === -1 ? subagentType : subagentType.slice(i + 1);
7433
+ }
7400
7434
  function log(prefix, msg) {
7401
7435
  const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/\.\d+Z$/, "Z");
7402
7436
  try {
@@ -7540,7 +7574,7 @@ var MAX_ENTRIES = 50;
7540
7574
  var MAX_SUMMARY_LENGTH = 200;
7541
7575
  function appendObservation(memoryDir, agent, entry) {
7542
7576
  try {
7543
- const agentDir = join3(memoryDir, agent);
7577
+ const agentDir = join3(memoryDir, normalizeAgentName(agent));
7544
7578
  const filePath = join3(agentDir, "observations.yaml");
7545
7579
  if (!existsSync2(agentDir)) {
7546
7580
  mkdirSync2(agentDir, { recursive: true });
@@ -7758,7 +7792,7 @@ async function main() {
7758
7792
  const skipSubagentGuard = process.env.SKIP_SUBAGENT_GUARD === "true";
7759
7793
  const agentId = getField(stdin, "agent_id");
7760
7794
  const agentType = getField(stdin, "agent_type");
7761
- const targetDir = filePath.length > 0 ? dirname3(filePath) : process.cwd();
7795
+ const targetDir = filePath.length > 0 ? dirname2(filePath) : process.cwd();
7762
7796
  const targetProjectRoot = resolveHookProjectRoot(targetDir);
7763
7797
  const isUnmanaged = targetProjectRoot !== null && existsSync3(join4(targetProjectRoot, ".orchestrator", ".unmanaged"));
7764
7798
  const baseInput = {
@@ -2,7 +2,7 @@
2
2
  "hooks": {
3
3
  "SessionStart": [
4
4
  {
5
- "matcher": "startup|resume",
5
+ "matcher": "startup|resume|clear|compact|fork",
6
6
  "hooks": [
7
7
  { "type": "command", "command": "hooks/session-start.mjs", "timeout": 10000 },
8
8
  { "type": "command", "command": "hooks/sprint-registry.mjs", "timeout": 5000 }
@@ -67,12 +67,6 @@
67
67
  "matcher": "mcp__(plugin_orchestrator_)?orchestrator-tools__advancePhase",
68
68
  "hooks": [{ "type": "command", "command": "hooks/post-implement.mjs", "timeout": 15000 }]
69
69
  }
70
- ],
71
- "PostCompact": [
72
- {
73
- "matcher": "",
74
- "hooks": [{ "type": "command", "command": "hooks/post-compact.mjs", "timeout": 5000 }]
75
- }
76
70
  ]
77
71
  }
78
72
  }