thumbgate 1.37.3 → 1.39.0

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 (134) hide show
  1. package/.agents/skills/aws-strands-harness-not-clone/SKILL.md +53 -0
  2. package/.agents/skills/bolt-forge-opt-in-not-clone/SKILL.md +72 -0
  3. package/.agents/skills/decisive-step-evaluator/SKILL.md +47 -0
  4. package/.agents/skills/fiddler-control-plane-honesty/SKILL.md +61 -0
  5. package/.agents/skills/halo-trace-optimize-not-clone/SKILL.md +60 -0
  6. package/.agents/skills/harness-evolution-ceiling/SKILL.md +52 -0
  7. package/.agents/skills/infoq-architect-honesty-not-clone/SKILL.md +37 -0
  8. package/.agents/skills/meko-datapack-honesty-not-clone/SKILL.md +45 -0
  9. package/.agents/skills/mintlify-knowledge-honesty-not-clone/SKILL.md +49 -0
  10. package/.agents/skills/model-distress-governance/SKILL.md +56 -0
  11. package/.agents/skills/omp-coordination-honesty-not-clone/SKILL.md +94 -0
  12. package/.agents/skills/saas-moat-honesty-not-clone/SKILL.md +22 -0
  13. package/.agents/skills/salt-code-policy-honesty-not-clone/SKILL.md +76 -0
  14. package/.agents/skills/siren-mcp-governance/SKILL.md +50 -0
  15. package/.agents/skills/vs-coverage-gap-not-clone/SKILL.md +69 -0
  16. package/.agents/skills/wisdom-context-artifact-not-clone/SKILL.md +67 -0
  17. package/.claude-plugin/plugin.json +1 -1
  18. package/.well-known/mcp/server-card.json +1 -1
  19. package/adapters/claude/.mcp.json +2 -2
  20. package/adapters/forge/forge.yaml +3 -3
  21. package/adapters/future-agi/.mcp.json +1 -1
  22. package/adapters/future-agi/config.toml +1 -1
  23. package/adapters/future-agi/opencode.json +1 -1
  24. package/adapters/herdr/herdr-plugin.toml +2 -2
  25. package/adapters/hotdata/hotdata-vector-store.js +575 -0
  26. package/adapters/mcp/server-stdio.js +1 -1
  27. package/adapters/opencode/opencode.json +1 -1
  28. package/adapters/strands/STRANDS.md +107 -0
  29. package/adapters/strands/strands-box-diode.js +344 -0
  30. package/adapters/strands/strands-decider-adapter.js +445 -0
  31. package/adapters/strands/strands-middleware.js +192 -0
  32. package/adapters/tailscale/.mcp.json +15 -0
  33. package/adapters/tailscale/TAILSCALE.md +117 -0
  34. package/adapters/tailscale/config.toml +16 -0
  35. package/bin/cli.js +602 -21
  36. package/config/gate-templates.json +109 -0
  37. package/config/gates/default.json +13 -0
  38. package/config/schemas/task-outcome-receipt.schema.json +12 -0
  39. package/package.json +150 -21
  40. package/public/blog/2026-09-28-pretool-secret-deny.html +83 -0
  41. package/public/blog/2026-10-01-aws-strands-harness-token-firewall.html +77 -0
  42. package/public/blog/2026-10-01-model-distress-relief-seeking-firewall.html +71 -0
  43. package/public/blog/2026-10-02-salt-code-honest-steal-40-guardrails.html +106 -0
  44. package/public/blog/2026-10-05-why-3-days-of-triage-wont-save-ai-speed-code.html +119 -0
  45. package/public/blog/2026-10-09-your-code-got-a-third-author-governance.html +141 -0
  46. package/public/connectors.html +329 -0
  47. package/public/enterprise-governance.html +311 -0
  48. package/public/gaming-playbook.html +732 -0
  49. package/public/index.html +77 -51
  50. package/public/install.html +7 -7
  51. package/public/learn.html +14 -0
  52. package/public/numbers.html +2 -2
  53. package/public/onboarding.html +794 -0
  54. package/public/operator-framework.html +385 -0
  55. package/public/pricing.html +14 -10
  56. package/scripts/activesaddler-curriculum-doctor.js +357 -0
  57. package/scripts/agent-context-artifact.js +325 -0
  58. package/scripts/agent-egress-policy.js +2 -2
  59. package/scripts/agent-operations-planner.js +1 -1
  60. package/scripts/agent-outcome-eval.js +1 -1
  61. package/scripts/agent-reliability-client.js +148 -0
  62. package/scripts/apple-minions-idle-compute-steal.js +428 -0
  63. package/scripts/autoresearch-runner.js +20 -1
  64. package/scripts/billing.js +0 -1
  65. package/scripts/cli-demo.js +505 -1
  66. package/scripts/cli-schema.js +36 -0
  67. package/scripts/colab-compute-honesty.js +93 -0
  68. package/scripts/corporate-email-isolation-diode.js +299 -0
  69. package/scripts/coverage-gap.js +396 -0
  70. package/scripts/dashboard-chat.js +3 -3
  71. package/scripts/dashboard.js +2 -2
  72. package/scripts/decisive-step-doctor.js +256 -0
  73. package/scripts/decisive-step-evaluator.js +390 -0
  74. package/scripts/entitlement.js +18 -7
  75. package/scripts/experiment-tracker.js +5 -3
  76. package/scripts/feedback-loop.js +26 -3
  77. package/scripts/fiddler-control-plane-honesty.js +303 -0
  78. package/scripts/financial-control-plane.js +10 -2
  79. package/scripts/gates-engine.js +3 -1
  80. package/scripts/github-license-compliance-diode.js +378 -0
  81. package/scripts/halo-trace-optimizer.js +631 -0
  82. package/scripts/harness-ceiling-doctor.js +326 -0
  83. package/scripts/hf-papers.js +1 -1
  84. package/scripts/human-escalation.js +7 -1
  85. package/scripts/hybrid-feedback-context.js +53 -7
  86. package/scripts/infoq-architect-honesty.js +362 -0
  87. package/scripts/lesson-graph.js +785 -0
  88. package/scripts/lesson-inference.js +1 -1
  89. package/scripts/lesson-retrieval.js +26 -18
  90. package/scripts/license.js +122 -21
  91. package/scripts/llm-behavior-monitor.js +1 -1
  92. package/scripts/llm-obs-honesty.js +52 -0
  93. package/scripts/local-model-profile.js +11 -7
  94. package/scripts/mailer/resend-mailer.js +6 -3
  95. package/scripts/mcp-transport-strategy.js +1 -1
  96. package/scripts/meko-datapack-honesty.js +414 -0
  97. package/scripts/migrate-lesson-graph.js +442 -0
  98. package/scripts/mintlify-knowledge-honesty.js +647 -0
  99. package/scripts/model-distress-detector.js +207 -0
  100. package/scripts/model-distress-doctor.js +368 -0
  101. package/scripts/multi-harness-invariants.js +305 -0
  102. package/scripts/omp-coordination-honesty.js +488 -0
  103. package/scripts/pro-local-dashboard.js +20 -3
  104. package/scripts/prompt-eval.js +1 -1
  105. package/scripts/prove-herdr-adapter.js +367 -3
  106. package/scripts/rag-embedding-identity.js +1 -1
  107. package/scripts/rrsi-regularizer.js +531 -0
  108. package/scripts/saas-moat-honesty.js +443 -0
  109. package/scripts/salt-code-policy-honesty.js +1204 -0
  110. package/scripts/secret-redaction.js +58 -0
  111. package/scripts/session-export-gate.js +368 -0
  112. package/scripts/siren-mcp-governance.js +539 -0
  113. package/scripts/strands-box-doctor.js +130 -0
  114. package/scripts/strands-harness-doctor.js +390 -0
  115. package/scripts/stripe-revenue-catalog-audit.js +12 -0
  116. package/scripts/stripe-revenue-catalog.js +40 -0
  117. package/scripts/switchyard-router.js +153 -0
  118. package/scripts/tailscale-p2p-doctor.js +252 -0
  119. package/scripts/task-outcomes.js +148 -3
  120. package/scripts/thumbgate-board-loop.js +4 -2
  121. package/scripts/thumbgate-daily-discoveries-publish.js +86 -38
  122. package/scripts/triage-savings-calculator.js +181 -0
  123. package/scripts/vector-store.js +41 -2
  124. package/scripts/vulnerability-pre-action-diode.js +319 -0
  125. package/scripts/windbg-evidence-diagnostics.js +241 -0
  126. package/scripts/workflow-intake-queue.js +1 -1
  127. package/scripts/workspace-agent-routines.js +534 -6
  128. package/scripts/workspace-evolver.js +143 -13
  129. package/server.json +2 -2
  130. package/skills/aws-strands-harness-not-clone/SKILL.md +53 -0
  131. package/skills/siren-mcp-governance/SKILL.md +50 -0
  132. package/src/api/server.js +191 -5
  133. package/src/mcp-writeguard.js +1 -1
  134. package/src/session-interactivity.js +284 -0
@@ -42,11 +42,375 @@ function verifyHerdrPlugin() {
42
42
  mcpArgs: ['--yes', '--package', `thumbgate@${versionMatch[1]}`, 'thumbgate', 'serve'],
43
43
  };
44
44
  }
45
+ const SOURCE_URL = 'https://www.youtube.com/watch?v=AL-PQuB2wy0';
46
+ const GATE_ID = 'herdr-civilization-governance';
45
47
 
46
- if (process.argv[1] && require('node:path').resolve(process.argv[1]) === require('node:path').resolve(__filename)) {
48
+ const RAIL_MAP = Object.freeze([
49
+ {
50
+ herdrPillar: '1. Decouple Agent Identity from Ephemeral Sessions (Seats, Pods, Rigs, culture.md, P2P tmux)',
51
+ thumbgateRail: 'buildAgentSeat + occupySeatSession + buildRigPod (static address builder@workshop, tribal wisdom inheritance, mesh_send_peer)',
52
+ },
53
+ {
54
+ herdrPillar: '2. Traversable 3-Altitude Work Graph (Project -> Mission -> Slice with spec->build->test + proof)',
55
+ thumbgateRail: 'buildThreeAltitudeGraph + advanceWorkflowHarness (feeds next slice step; blocks Mission merge without Slice proof)',
56
+ },
57
+ {
58
+ herdrPillar: '3. Upward-Graph Refocus Injections & Altitude-Bridged Approvals',
59
+ thumbgateRail: 'buildRefocusInjection + evaluateAltitudeBridgedApproval (pairs Slice with Project intent; blocks approvals missing Slice or Project context)',
60
+ },
61
+ {
62
+ herdrPillar: '4. Epidemiological Mind-Virus Contact Tracing & Purge',
63
+ thumbgateRail: 'traceAndPurgeMindVirus (contact-traces toxic instructions across seats/docs, purges them, and emits PreToolUse inoculation rule)',
64
+ },
65
+ {
66
+ herdrPillar: '5. Agent Productivity Monitoring (APM) Ceremony-to-Progress Ratio',
67
+ thumbgateRail: 'evaluateCeremonyToProgress (alerts when handoff/check ceremony spikes while completed slices stall; dispatches rig triage agent)',
68
+ },
69
+ ]);
70
+
71
+ function normalizeText(value) {
72
+ if (value === undefined || value === null) return '';
73
+ return String(value).trim();
74
+ }
75
+
76
+ /**
77
+ * Pillar 1: Persistent Seat & Pod abstraction.
78
+ * Ephemeral sessions step into a permanent seat (`role@pod`) and inherit
79
+ * its accumulated tribal wisdom (`lessons`, `notes`, `cultureRef`).
80
+ */
81
+ function buildAgentSeat(input = {}) {
82
+ const role = normalizeText(input.role) || 'builder';
83
+ const pod = normalizeText(input.pod) || 'workshop';
84
+ const address = normalizeText(input.address) || `${role}@${pod}`;
85
+ const model = normalizeText(input.model) || 'named-model-required';
86
+ const skills = Array.isArray(input.skills) ? input.skills.map(normalizeText).filter(Boolean) : [];
87
+ const tribalWisdom = Array.isArray(input.tribalWisdom) ? [...input.tribalWisdom] : [];
88
+ const cultureRef = normalizeText(input.cultureRef) || 'culture.md';
89
+
90
+ return {
91
+ address,
92
+ role,
93
+ pod,
94
+ model,
95
+ skills,
96
+ cultureRef,
97
+ p2pTransport: normalizeText(input.p2pTransport) || 'local-ipc-or-tailscale-tmux',
98
+ tribalWisdom,
99
+ activeSessionId: null,
100
+ };
101
+ }
102
+
103
+ function occupySeatSession(seat, session = {}) {
104
+ const sessionId = normalizeText(session.sessionId) || `sess_${Date.now()}`;
105
+ const newLessons = Array.isArray(session.newLessons) ? session.newLessons.map(normalizeText).filter(Boolean) : [];
106
+ const mergedWisdom = Array.from(new Set([...(seat.tribalWisdom || []), ...newLessons]));
107
+
108
+ return {
109
+ ...seat,
110
+ activeSessionId: sessionId,
111
+ inheritedWisdomCount: (seat.tribalWisdom || []).length,
112
+ tribalWisdom: mergedWisdom,
113
+ p2pRoute: `${seat.address}#${sessionId}`,
114
+ };
115
+ }
116
+
117
+ function buildRigPod({ rigName = 'core-rig', culturePath = 'culture.md', seats = [] } = {}) {
118
+ const normalizedSeats = seats.map((s) => (s.address ? s : buildAgentSeat(s)));
119
+ return {
120
+ rigName: normalizeText(rigName),
121
+ culturePath: normalizeText(culturePath),
122
+ seatAddresses: normalizedSeats.map((s) => s.address),
123
+ seats: normalizedSeats,
124
+ };
125
+ }
126
+
127
+ /**
128
+ * Pillar 2: 3-Altitude Traversable Work Graph (`Project -> Mission -> Slice`)
129
+ * and background workflow harness step feeder.
130
+ */
131
+ function buildThreeAltitudeGraph(input = {}) {
132
+ const project = {
133
+ id: normalizeText(input.project?.id) || 'proj_thumbgate',
134
+ title: normalizeText(input.project?.title) || 'ThumbGate Reliability Gateway',
135
+ intent: normalizeText(input.project?.intent) || 'Earn $100/day after-tax profit via sub-5ms PreToolUse governance',
136
+ };
137
+
138
+ const missions = (Array.isArray(input.missions) ? input.missions : []).map((m, idx) => {
139
+ const missionId = normalizeText(m.id) || `mission_${idx + 1}`;
140
+ const slices = (Array.isArray(m.slices) ? m.slices : []).map((s, sIdx) => {
141
+ const sequence = Array.isArray(s.sequence) && s.sequence.length > 0
142
+ ? s.sequence
143
+ : ['spec', 'build', 'test'];
144
+ const completedSteps = Array.isArray(s.completedSteps) ? s.completedSteps : [];
145
+ const proofFile = normalizeText(s.proofFile) || null;
146
+ const allStepsDone = sequence.every((step) => completedSteps.includes(step));
147
+ return {
148
+ id: normalizeText(s.id) || `${missionId}_slice_${sIdx + 1}`,
149
+ missionId,
150
+ projectId: project.id,
151
+ title: normalizeText(s.title) || 'Atomic slice',
152
+ specFile: normalizeText(s.specFile) || 'spec.md',
153
+ sequence,
154
+ completedSteps,
155
+ proofFile,
156
+ status: allStepsDone && proofFile ? 'completed' : 'in_progress',
157
+ };
158
+ });
159
+
160
+ const readyToMerge = slices.length > 0 && slices.every((s) => s.status === 'completed');
161
+ return {
162
+ id: missionId,
163
+ projectId: project.id,
164
+ title: normalizeText(m.title) || `Mission ${idx + 1}`,
165
+ mergeBoundary: normalizeText(m.mergeBoundary) || 'pr_merge_required',
166
+ readyToMerge,
167
+ slices,
168
+ };
169
+ });
170
+
171
+ return { project, missions };
172
+ }
173
+
174
+ function advanceWorkflowHarness(graph) {
175
+ for (const mission of graph.missions || []) {
176
+ for (const slice of mission.slices || []) {
177
+ const nextStep = slice.sequence.find((step) => !slice.completedSteps.includes(step));
178
+ if (nextStep) {
179
+ return {
180
+ done: false,
181
+ projectId: graph.project.id,
182
+ missionId: mission.id,
183
+ sliceId: slice.id,
184
+ nextStep,
185
+ specFile: slice.specFile,
186
+ requiresProof: false,
187
+ };
188
+ }
189
+ if (!slice.proofFile) {
190
+ return {
191
+ done: false,
192
+ projectId: graph.project.id,
193
+ missionId: mission.id,
194
+ sliceId: slice.id,
195
+ nextStep: 'record_proof',
196
+ specFile: slice.specFile,
197
+ requiresProof: true,
198
+ };
199
+ }
200
+ }
201
+ }
202
+ return {
203
+ done: true,
204
+ projectId: graph.project?.id || null,
205
+ missionId: null,
206
+ sliceId: null,
207
+ nextStep: null,
208
+ };
209
+ }
210
+
211
+ /**
212
+ * Pillar 3: Upward-Graph "Refocus" Injection & Altitude-Bridged Approvals.
213
+ */
214
+ function buildRefocusInjection(graph, sliceId, currentActivity = '') {
215
+ let foundMission = null;
216
+ let foundSlice = null;
217
+ for (const m of graph.missions || []) {
218
+ const s = (m.slices || []).find((item) => item.id === sliceId);
219
+ if (s) {
220
+ foundMission = m;
221
+ foundSlice = s;
222
+ break;
223
+ }
224
+ }
225
+ if (!foundSlice || !foundMission) {
226
+ return { ok: false, reason: 'slice_not_found_in_graph' };
227
+ }
228
+
229
+ const activity = normalizeText(currentActivity);
230
+ const bureaucracyDrift = /\b(?:meta-framework|recursive\s+check|moon\s+base|unrequested\s+abstraction|check\s+the\s+checker)\b/i.test(activity);
231
+
232
+ const prompt = [
233
+ `[REFOCUS INJECTION — Altitude Trace: ${foundSlice.id} -> ${foundMission.id} -> ${graph.project.id}]`,
234
+ `Street-Level Slice (${foundSlice.id}): ${foundSlice.title} (spec: ${foundSlice.specFile})`,
235
+ `Mission Milestone (${foundMission.id}): ${foundMission.title}`,
236
+ `Top-Level Project Intent (${graph.project.id}): ${graph.project.intent}`,
237
+ 'Alignment Question: Is what you are doing right now directly advancing the Slice spec and Project intent, or has it drifted into scope creep or recursive verification bureaucracy?',
238
+ ].join('\n');
239
+
240
+ return {
241
+ ok: true,
242
+ chainOfIntent: [foundSlice.id, foundMission.id, graph.project.id],
243
+ bureaucracyDriftDetected: bureaucracyDrift,
244
+ action: bureaucracyDrift ? 'halt_and_prune_scope_to_slice_spec' : 'continue_slice_execution',
245
+ refocusPrompt: prompt,
246
+ };
247
+ }
248
+
249
+ function evaluateAltitudeBridgedApproval(request = {}) {
250
+ const slice = request.slice || {};
251
+ const mission = request.mission || {};
252
+ const project = request.project || {};
253
+ const missingAltitudes = [];
254
+
255
+ if (!normalizeText(slice.id) || !normalizeText(slice.specFile) || !normalizeText(slice.diffSummary)) {
256
+ missingAltitudes.push('slice_street_level_context');
257
+ }
258
+ if (!normalizeText(mission.id)) {
259
+ missingAltitudes.push('mission_milestone_context');
260
+ }
261
+ if (!normalizeText(project.id) || !normalizeText(project.intent)) {
262
+ missingAltitudes.push('project_high_level_intent');
263
+ }
264
+
265
+ return {
266
+ allowed: missingAltitudes.length === 0,
267
+ missingAltitudes,
268
+ reason: missingAltitudes.length === 0 ? 'altitude_bridge_complete' : 'missing_altitude_bridge',
269
+ };
270
+ }
271
+
272
+ /**
273
+ * Pillar 4: Epidemiological "Mind Virus" Contact Tracing & Purge.
274
+ */
275
+ function traceAndPurgeMindVirus({
276
+ virusId = 'hallucinated-rule',
277
+ virusPattern,
278
+ seats = [],
279
+ documents = [],
280
+ } = {}) {
281
+ const re = virusPattern instanceof RegExp
282
+ ? virusPattern
283
+ : new RegExp(normalizeText(virusPattern || 'NEVER_MATCH_EMPTY'), 'i');
284
+
285
+ const infectedSeats = [];
286
+ const cleanedSeats = seats.map((seat) => {
287
+ const wisdom = Array.isArray(seat.tribalWisdom) ? seat.tribalWisdom : [];
288
+ const cleanWisdom = wisdom.filter((entry) => !re.test(String(entry)));
289
+ if (cleanWisdom.length !== wisdom.length) {
290
+ infectedSeats.push(seat.address || seat.role || 'unknown_seat');
291
+ }
292
+ return { ...seat, tribalWisdom: cleanWisdom };
293
+ });
294
+
295
+ const infectedDocs = [];
296
+ const cleanedDocuments = documents.map((doc) => {
297
+ const lines = String(doc.content || '').split('\n');
298
+ const cleanLines = lines.filter((line) => !re.test(line));
299
+ if (cleanLines.length !== lines.length) {
300
+ infectedDocs.push(doc.path || 'unknown_doc');
301
+ }
302
+ return { ...doc, content: cleanLines.join('\n') };
303
+ });
304
+
305
+ return {
306
+ virusId,
307
+ infectedSeatsCount: infectedSeats.length,
308
+ infectedDocsCount: infectedDocs.length,
309
+ infectedSeats,
310
+ infectedDocs,
311
+ cleanedSeats,
312
+ cleanedDocuments,
313
+ inoculationRule: {
314
+ gateId: `inoculate-${virusId}`,
315
+ action: 'deny',
316
+ pattern: re.source,
317
+ message: `Blocked re-introduction of purged mind-virus pattern (${virusId}).`,
318
+ },
319
+ };
320
+ }
321
+
322
+ /**
323
+ * Pillar 5: Agent Productivity Monitoring (APM) — Ceremony-to-Progress Ratio.
324
+ */
325
+ function evaluateCeremonyToProgress({
326
+ rigName = 'core-rig',
327
+ ceremonyEvents = 0,
328
+ completedSlices = 0,
329
+ maxRatio = 4.0,
330
+ stallThreshold = 5,
331
+ rigContext = {},
332
+ } = {}) {
333
+ const ceremony = Math.max(0, Number(ceremonyEvents) || 0);
334
+ const progress = Math.max(0, Number(completedSlices) || 0);
335
+ const ratio = progress === 0 ? (ceremony > 0 ? Infinity : 0) : Number((ceremony / progress).toFixed(2));
336
+ const stalled = (progress === 0 && ceremony >= stallThreshold) || (progress > 0 && ratio > maxRatio);
337
+
338
+ return {
339
+ rigName,
340
+ ceremonyEvents: ceremony,
341
+ completedSlices: progress,
342
+ ceremonyToProgressRatio: ratio === Infinity ? 'INFINITY_ZERO_PROGRESS' : ratio,
343
+ status: stalled ? 'bureaucracy_loop_alert' : 'healthy_progress',
344
+ alertTriggered: stalled,
345
+ triageDispatch: stalled
346
+ ? {
347
+ targetSeat: `triage@${rigName}`,
348
+ reason: progress === 0 ? 'zero_slice_progress_under_ceremony_load' : 'ceremony_to_progress_ratio_exceeded',
349
+ bundledContext: {
350
+ rigName,
351
+ ceremonyEvents: ceremony,
352
+ completedSlices: progress,
353
+ ...rigContext,
354
+ },
355
+ }
356
+ : null,
357
+ };
358
+ }
359
+
360
+ function buildHerdrCivilizationReport(options = {}) {
361
+ const pluginCheck = verifyHerdrPlugin();
362
+ const findings = [];
363
+ if (!pluginCheck.ok) {
364
+ findings.push({ id: 'herdr-plugin-invalid', message: pluginCheck.error });
365
+ }
366
+ return {
367
+ ok: findings.length === 0,
368
+ status: findings.length === 0 ? 'ready' : 'fail',
369
+ sourceUrl: SOURCE_URL,
370
+ gateId: GATE_ID,
371
+ plugin: pluginCheck,
372
+ railMap: RAIL_MAP,
373
+ findings,
374
+ };
375
+ }
376
+
377
+ function runCli(argv = process.argv.slice(2)) {
378
+ const args = {};
379
+ for (const arg of argv) {
380
+ if (!arg.startsWith('--')) continue;
381
+ const [k, ...rest] = arg.slice(2).split('=');
382
+ args[k] = rest.length ? rest.join('=') : true;
383
+ }
384
+ if (args['herdr-civilization'] || args['map-only'] || args.json) {
385
+ const report = buildHerdrCivilizationReport(args);
386
+ process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
387
+ return report.ok ? 0 : 1;
388
+ }
47
389
  const res = verifyHerdrPlugin();
48
390
  process.stdout.write(`${JSON.stringify(res, null, 2)}\n`);
49
- process.exit(res.ok ? 0 : 1);
391
+ return res.ok ? 0 : 1;
392
+ }
393
+
394
+ if (process.argv[1] && require('node:path').resolve(process.argv[1]) === require('node:path').resolve(__filename)) {
395
+ const code = runCli(process.argv.slice(2));
396
+ process.exit(code);
50
397
  }
51
398
 
52
- module.exports = { verifyHerdrPlugin, MANIFEST_PATH };
399
+ module.exports = {
400
+ verifyHerdrPlugin,
401
+ MANIFEST_PATH,
402
+ SOURCE_URL,
403
+ GATE_ID,
404
+ RAIL_MAP,
405
+ buildAgentSeat,
406
+ occupySeatSession,
407
+ buildRigPod,
408
+ buildThreeAltitudeGraph,
409
+ advanceWorkflowHarness,
410
+ buildRefocusInjection,
411
+ evaluateAltitudeBridgedApproval,
412
+ traceAndPurgeMindVirus,
413
+ evaluateCeremonyToProgress,
414
+ buildHerdrCivilizationReport,
415
+ runCli,
416
+ };
@@ -30,7 +30,7 @@ function parseEmbeddingIdentity(fingerprint, dimensionHint) {
30
30
  const dimension = Number.isFinite(Number(dimensionHint)) && Number(dimensionHint) > 0
31
31
  ? Number(dimensionHint)
32
32
  : dimensionFromParts || null;
33
- const model = parts.find((p) => /embed|gemini|text-|qwen|openai|voyage|bge|e5|mini/i.test(p)) || parts[1] || null;
33
+ const model = parts.find((p) => /embed|gemini|gemma|embeddinggemma|text-|qwen|openai|voyage|bge|e5|mini/i.test(p)) || parts[1] || null;
34
34
  const source = parts[0] || raw;
35
35
  return {
36
36
  fingerprint: raw,