predators-protocol 1.2.0 → 1.2.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.
- package/bin/predators-cli.js +70 -7
- package/bundle/.claude/commands/encarnar.md +3 -3
- package/bundle/QUICKSTART-SOCIO.md +3 -3
- package/bundle/docs/CANON/SELF-HEALING-LOG-CANON.json +638 -583
- package/bundle/predators/apex/aguia-pescadora/constitution.md +469 -0
- package/bundle/predators/apex/aguia-pescadora/predator.json +66 -0
- package/bundle/predators/apex/aguia-real/constitution.md +11 -0
- package/bundle/predators/builder/camaleao/constitution.md +8 -0
- package/bundle/predators/builder/polvo/constitution.md +8 -0
- package/bundle/predators/builder/tatu-bola/constitution.md +8 -0
- package/bundle/predators/intel/jiboia/predator.json +2 -1
- package/bundle/predators/intel/lobo-solitario/constitution.md +15 -0
- package/lib/access-token-client.js +8 -1
- package/lib/config.js +4 -3
- package/lib/gen-token-client.js +1 -1
- package/lib/invoke-client.js +138 -0
- package/package.json +1 -1
package/bin/predators-cli.js
CHANGED
|
@@ -102,6 +102,11 @@ COMANDOS canon vigentes (17 comandos):
|
|
|
102
102
|
gen-token Apex T7 gera token via CLI (PREDATORS_OWNER_KEY_BACKEND env)
|
|
103
103
|
Usage: gen-token --name "Nome" [--email x] [--list]
|
|
104
104
|
|
|
105
|
+
-- fase PRODUTO-DEV (2026-06-05 · Onda 4b · 1 comando novo) --
|
|
106
|
+
invoke <id> "..." Invoca um predador via API usando a sua chave Bearer (PREDATORS_API_KEY)
|
|
107
|
+
Crie a chave em https://predadores.online/settings (planos PRO/APEX)
|
|
108
|
+
Usage: invoke tubarao-branco "audite este contrato"
|
|
109
|
+
|
|
105
110
|
-- fase BRAIN (2026-05-28 · 1.0.0 STABLE · 1 comando novo) --
|
|
106
111
|
brain-status Snapshot canon estrutura cerebral · 11 daemons + 6 flags + Elefante (READ-only)
|
|
107
112
|
Runtime real exige Python + clonar repo + brain-on.cmd · ver caminho em docs
|
|
@@ -682,6 +687,8 @@ const command = process.argv[2] || "help";
|
|
|
682
687
|
const { runUnlock, requireValidAccess } = require("../lib/access-token-client.js");
|
|
683
688
|
// Lei #1 [ok1-ok4] gates · gen-token CLI canon 2026-05-27
|
|
684
689
|
const { runGenToken } = require("../lib/gen-token-client.js");
|
|
690
|
+
// ONDA-SAAS Onda 4b · invoke client (CLI vira cliente de API · chave Bearer self-serve)
|
|
691
|
+
const { runInvoke } = require("../lib/invoke-client.js");
|
|
685
692
|
|
|
686
693
|
async function runUnlockCommand() {
|
|
687
694
|
const token = process.argv[3];
|
|
@@ -692,9 +699,64 @@ async function runGenTokenCommand() {
|
|
|
692
699
|
await runGenToken();
|
|
693
700
|
}
|
|
694
701
|
|
|
695
|
-
|
|
696
|
-
|
|
702
|
+
async function runInvokeCommand() {
|
|
703
|
+
await runInvoke();
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// brain-status command · 1.2.0 · G6 (ONDA-CEREBRO-FIX-GERAL-OPCAO-A 2026-05-31)
|
|
707
|
+
// Snapshot canon + integração validate_daemon_canon runtime real (detecta FAKE-LIVE)
|
|
708
|
+
function tryLiveBrainStatus(cwd) {
|
|
709
|
+
// G6: tenta invocar validate_daemon_canon Python · canon-graceful se ausente
|
|
710
|
+
const { spawnSync } = require("child_process");
|
|
711
|
+
const repoRoot = cwd || process.cwd();
|
|
712
|
+
const helperPath = path.join(repoRoot, "scripts", "_brain_status_canon.py");
|
|
713
|
+
|
|
714
|
+
if (!fs.existsSync(helperPath)) {
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
const pyCandidates = [
|
|
719
|
+
process.env.PREDATORS_PYTHON,
|
|
720
|
+
path.join(repoRoot, ".venv", "Scripts", "python.exe"),
|
|
721
|
+
"py",
|
|
722
|
+
"python",
|
|
723
|
+
].filter(Boolean);
|
|
724
|
+
|
|
725
|
+
for (const pyExe of pyCandidates) {
|
|
726
|
+
try {
|
|
727
|
+
const args = pyExe === "py" ? ["-3", helperPath] : [helperPath];
|
|
728
|
+
const result = spawnSync(pyExe, args, {
|
|
729
|
+
cwd: repoRoot,
|
|
730
|
+
encoding: "utf-8",
|
|
731
|
+
env: { ...process.env, PYTHONIOENCODING: "utf-8" },
|
|
732
|
+
timeout: 10000,
|
|
733
|
+
});
|
|
734
|
+
if (result.status === 0 && result.stdout) {
|
|
735
|
+
return result.stdout;
|
|
736
|
+
}
|
|
737
|
+
} catch (err) {
|
|
738
|
+
// try next candidate
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return null;
|
|
742
|
+
}
|
|
743
|
+
|
|
697
744
|
async function runBrainStatusCommand() {
|
|
745
|
+
// G6: prioriza output LIVE runtime real se disponível
|
|
746
|
+
const liveOutput = tryLiveBrainStatus(process.cwd());
|
|
747
|
+
if (liveOutput && liveOutput.includes("TRULY ALIVE")) {
|
|
748
|
+
console.log("");
|
|
749
|
+
console.log("PREDADORES PROTOCOL · CEREBRO LIVE · runtime real (validate_daemon_canon)");
|
|
750
|
+
console.log("=========================================================================");
|
|
751
|
+
console.log(liveOutput);
|
|
752
|
+
console.log("Honest UPFRONT (Lei #11): output empírico runtime · NÃO snapshot");
|
|
753
|
+
console.log(" · TRULY-LIVE: heartbeat fresh + state-progresso fresh (canon-aligned)");
|
|
754
|
+
console.log(" · FAKE-LIVE: heartbeat fresh MAS state-progresso stale (daemon mente)");
|
|
755
|
+
console.log(" · DEAD: heartbeat ausente OU stale > 60s");
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
// Fallback canon-graceful: snapshot bundle (NPX read-only context)
|
|
698
760
|
const snapshotPath = bundlePath("docs/CANON/BRAIN-STATUS-SNAPSHOT.json");
|
|
699
761
|
if (!fs.existsSync(snapshotPath)) {
|
|
700
762
|
console.error("brain-status snapshot ausente no bundle · re-sync canon necessário");
|
|
@@ -708,18 +770,18 @@ async function runBrainStatusCommand() {
|
|
|
708
770
|
process.exit(1);
|
|
709
771
|
}
|
|
710
772
|
console.log("");
|
|
711
|
-
console.log("PREDADORES PROTOCOL · ESTRUTURA CEREBRAL · snapshot canon");
|
|
712
|
-
console.log("
|
|
773
|
+
console.log("PREDADORES PROTOCOL · ESTRUTURA CEREBRAL · snapshot canon (read-only)");
|
|
774
|
+
console.log("======================================================================");
|
|
713
775
|
console.log(`Snapshot cravado: ${snapshot.snapshot_at}`);
|
|
714
776
|
console.log(`Commit master: ${snapshot.commit_hash_short}`);
|
|
715
777
|
console.log(`Status agregado: ${snapshot.status_aggregate}`);
|
|
716
778
|
console.log("");
|
|
717
|
-
console.log("
|
|
779
|
+
console.log("Daemons cerebrais (runtime real · não-snapshot):");
|
|
718
780
|
for (const d of snapshot.daemons) {
|
|
719
781
|
console.log(` · ${d.name.padEnd(22)} ${d.role}`);
|
|
720
782
|
}
|
|
721
783
|
console.log("");
|
|
722
|
-
console.log("
|
|
784
|
+
console.log("Feature flags Híbrida (default canon vigente):");
|
|
723
785
|
for (const f of snapshot.feature_flags) {
|
|
724
786
|
const mark = f.default === "true" ? "LIVE" : "OPT-IN";
|
|
725
787
|
console.log(` · ${f.name.padEnd(28)} default=${f.default.padEnd(5)} ${mark}`);
|
|
@@ -733,7 +795,7 @@ async function runBrainStatusCommand() {
|
|
|
733
795
|
console.log("Honest UPFRONT (Lei #11):");
|
|
734
796
|
console.log(" · brain-status é READ-only snapshot · cravado no commit acima");
|
|
735
797
|
console.log(" · runtime real exige: clone repo + Python 3.11+ + brain-on.cmd");
|
|
736
|
-
console.log(" ·
|
|
798
|
+
console.log(" · LIVE detection (validate_daemon_canon) só roda em clone do repositório");
|
|
737
799
|
console.log(" · ver bundle/QUICKSTART-SOCIO.md para caminho completo");
|
|
738
800
|
}
|
|
739
801
|
|
|
@@ -798,6 +860,7 @@ const commandsCanon = {
|
|
|
798
860
|
tour: runTourCommand,
|
|
799
861
|
unlock: runUnlockCommand,
|
|
800
862
|
"gen-token": runGenTokenCommand,
|
|
863
|
+
invoke: runInvokeCommand,
|
|
801
864
|
"brain-status": runBrainStatusCommand,
|
|
802
865
|
"brand-status": runBrandStatusCommand,
|
|
803
866
|
help: printHelpCanon,
|
|
@@ -58,14 +58,14 @@ Estruturado · 5 garantias da Synapse:
|
|
|
58
58
|
|
|
59
59
|
---
|
|
60
60
|
|
|
61
|
-
## Lookup canon ·
|
|
61
|
+
## Lookup canon · 65 predadores invocáveis (Lei #10 literal · pós F5 Águia-pescadora 2026-06-05)
|
|
62
62
|
|
|
63
63
|
`<predador-id>` deve resolver contra `predators/<layer>/<id>/predator.json`.
|
|
64
64
|
|
|
65
|
-
**Fonte única canon:** `docs/CANON/PREDADORES-INVENTORY-CANON.md` (
|
|
65
|
+
**Fonte única canon:** `docs/CANON/PREDADORES-INVENTORY-CANON.md` (65 predadores · 10 camadas).
|
|
66
66
|
|
|
67
67
|
IDs válidos byte-canon (não-inventar):
|
|
68
|
-
- Apex (
|
|
68
|
+
- Apex (5): aguia-real · aguia-pescadora · leao · orca · tigre-siberiano
|
|
69
69
|
- Hunter (5): crocodilo · escorpiao · hiena · piranha · tubarao-branco
|
|
70
70
|
- Builder (9): camaleao · coruja · falcao-peregrino · gaviao · jaguar · onca-pintada · pantera-negra · polvo · tatu-bola
|
|
71
71
|
- Designer (8): aguia-harpia · aranha-tecela · baleia-cantora · borboleta-azul · cisne-negro · mantis · pavao · tucano-toco
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# QUICKSTART · PREDADORES PROTOCOL
|
|
2
2
|
|
|
3
|
-
**Bundle isolado** ·
|
|
3
|
+
**Bundle isolado** · 65 predadores · 10 camadas · canon vigente · FASE 7 COMPLETA · pós F5 Águia-pescadora 2026-06-05
|
|
4
4
|
|
|
5
5
|
> Marca canon bilíngue: **PREDADORES PROTOCOL** (pt-BR) ↔ **Predators Protocol** (EN · NPX/internacional)
|
|
6
|
-
> Os
|
|
6
|
+
> Os 65 predadores têm IDs em português (tubarao-branco · aguia-real · aguia-pescadora · escorpiao · hiena · etc).
|
|
7
7
|
> Propriedade intelectual de Alex Gonzaga (Tubarão-Apex).
|
|
8
8
|
|
|
9
9
|
---
|
|
@@ -28,7 +28,7 @@ No chat do Claude Code · digita:
|
|
|
28
28
|
/encarnar tubarao-branco
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
E o Claude Code encarna o Tubarão-branco · produz como o predador. Outros IDs: `aguia-real` · `hiena` · `polvo` · `elefante` · `dragao-ancestral` · etc (
|
|
31
|
+
E o Claude Code encarna o Tubarão-branco · produz como o predador. Outros IDs: `aguia-real` · `aguia-pescadora` · `hiena` · `polvo` · `elefante` · `dragao-ancestral` · etc (65 total · pós F5).
|
|
32
32
|
|
|
33
33
|
## Atualizações
|
|
34
34
|
|