auroq-os 2.5.1 → 2.5.4
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/.auroq-core/core-config.yaml +1 -1
- package/.claude/hooks/ahi-capture.cjs +58 -0
- package/.claude/settings.local.json +13 -0
- package/CHANGELOG.md +21 -0
- package/README.md +38 -0
- package/bin/auroq-os.js +263 -23
- package/installer/README.md +20 -0
- package/installer/install.ps1 +127 -3
- package/installer/install.sh +90 -2
- package/lib/ahi/historico.mjs +38 -0
- package/lib/synapse-hashes.json +110 -0
- package/lib/telemetry.mjs +238 -0
- package/package.json +3 -3
- package/scripts/synapse-hashes.mjs +60 -0
package/installer/install.ps1
CHANGED
|
@@ -41,6 +41,7 @@ try {
|
|
|
41
41
|
# codigo de saida continua valendo. A variavel abaixo guarda essa diferenca.
|
|
42
42
|
$script:AuroqRodaDeArquivo = [bool]$PSCommandPath
|
|
43
43
|
|
|
44
|
+
$script:AuroqRun = [Guid]::NewGuid().ToString()
|
|
44
45
|
$AuroqSuporte = '11 93621-4486'
|
|
45
46
|
$AuroqNodeMin = 20
|
|
46
47
|
# No Windows o Node 24+ morre ao encerrar logo depois de falar com a rede
|
|
@@ -60,6 +61,107 @@ function Get-AuroqHome {
|
|
|
60
61
|
return $HOME
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
# Private local metadata. No identity is inferred from a later login.
|
|
65
|
+
function Write-AuroqEvent([string]$Stage, [string]$Outcome) {
|
|
66
|
+
if ($env:ARCANE_TELEMETRY -eq '0' -or $env:AUROQ_INSTALL_DRY_RUN) { return }
|
|
67
|
+
if (@('startup','git','node','access','folder','framework','install') -notcontains $Stage) { return }
|
|
68
|
+
if (@('started','ok','error') -notcontains $Outcome) { return }
|
|
69
|
+
$gate = $null
|
|
70
|
+
try {
|
|
71
|
+
$root = Join-Path (Get-AuroqHome) '.arcane'
|
|
72
|
+
$dir = Join-Path $root 'installer-outbox'
|
|
73
|
+
foreach ($p in @($root,$dir)) {
|
|
74
|
+
if (Test-Path -LiteralPath $p) {
|
|
75
|
+
if ((Get-Item -LiteralPath $p -Force).Attributes -band [IO.FileAttributes]::ReparsePoint) { return }
|
|
76
|
+
} else { [IO.Directory]::CreateDirectory($p) | Out-Null }
|
|
77
|
+
$acl = New-Object Security.AccessControl.DirectorySecurity
|
|
78
|
+
$acl.SetAccessRuleProtection($true,$false)
|
|
79
|
+
$sid = [Security.Principal.WindowsIdentity]::GetCurrent().User
|
|
80
|
+
$rule = New-Object Security.AccessControl.FileSystemAccessRule($sid,'FullControl','ContainerInherit,ObjectInherit','None','Allow')
|
|
81
|
+
$acl.SetOwner($sid)
|
|
82
|
+
$acl.AddAccessRule($rule)
|
|
83
|
+
Set-Acl -LiteralPath $p -AclObject $acl -ErrorAction Stop
|
|
84
|
+
$verified = Get-Acl -LiteralPath $p -ErrorAction Stop
|
|
85
|
+
if (-not $verified.AreAccessRulesProtected -or $verified.GetOwner([Security.Principal.SecurityIdentifier]).Value -ne $sid.Value) { return }
|
|
86
|
+
$rules = $verified.GetAccessRules($true,$true,[Security.Principal.SecurityIdentifier])
|
|
87
|
+
if ($rules.Count -eq 0) { return }
|
|
88
|
+
foreach ($entry in $rules) {
|
|
89
|
+
if ($entry.IdentityReference.Value -ne $sid.Value -or $entry.AccessControlType -ne 'Allow') { return }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
# Persistent file, kernel-released exclusive handle: no ownerless recovery guard.
|
|
93
|
+
$gatePath = Join-Path $dir '.spool.lock'
|
|
94
|
+
if (Test-Path -LiteralPath $gatePath) {
|
|
95
|
+
if ((Get-Item -LiteralPath $gatePath -Force).Attributes -band [IO.FileAttributes]::ReparsePoint) { return }
|
|
96
|
+
}
|
|
97
|
+
$gate = [IO.File]::Open($gatePath,[IO.FileMode]::OpenOrCreate,[IO.FileAccess]::ReadWrite,[IO.FileShare]::None)
|
|
98
|
+
# Expire/reclaim only while holding the writer gate; active old writers keep
|
|
99
|
+
# their exclusive record handle and cannot be opened here.
|
|
100
|
+
for ($j=0; $j -lt 200; $j++) {
|
|
101
|
+
$old = Join-Path $dir ("ps-" + $j + '.json')
|
|
102
|
+
if (-not (Test-Path -LiteralPath $old)) { continue }
|
|
103
|
+
$item = Get-Item -LiteralPath $old -Force
|
|
104
|
+
if ($item.Attributes -band [IO.FileAttributes]::ReparsePoint -or $item.PSIsContainer -or $item.Length -gt 2048) { continue }
|
|
105
|
+
$probe = $null
|
|
106
|
+
try {
|
|
107
|
+
$probe = [IO.File]::Open($old,[IO.FileMode]::Open,[IO.FileAccess]::Read,[IO.FileShare]::None)
|
|
108
|
+
$reader = New-Object IO.StreamReader($probe)
|
|
109
|
+
$raw = $reader.ReadToEnd()
|
|
110
|
+
$expired = $item.LastWriteTimeUtc -le [DateTime]::UtcNow.AddDays(-7)
|
|
111
|
+
try { $parsed = $raw | ConvertFrom-Json -ErrorAction Stop; if (-not $parsed.occurred_at) { $expired = $true } } catch { $expired = $true }
|
|
112
|
+
$reader.Dispose(); $probe = $null
|
|
113
|
+
if ($expired) { [IO.File]::Delete($old) }
|
|
114
|
+
} catch { continue } finally { if ($probe) { $probe.Dispose() } }
|
|
115
|
+
}
|
|
116
|
+
# CreateNew atomically reserves one of 200 fixed files across processes.
|
|
117
|
+
for ($i=0; $i -lt 200; $i++) {
|
|
118
|
+
$file = Join-Path $dir ("ps-" + $i + '.json')
|
|
119
|
+
$fileAcl = New-Object Security.AccessControl.FileSecurity
|
|
120
|
+
$fileAcl.SetAccessRuleProtection($true,$false)
|
|
121
|
+
$fileAcl.SetOwner($sid)
|
|
122
|
+
$fileAcl.AddAccessRule((New-Object Security.AccessControl.FileSystemAccessRule($sid,'FullControl','Allow')))
|
|
123
|
+
try {
|
|
124
|
+
# Request ACL rights on this exclusive handle, including WRITE_OWNER.
|
|
125
|
+
if ($PSVersionTable.PSVersion.Major -lt 6) {
|
|
126
|
+
$stream = [IO.FileStream]::new($file,[IO.FileMode]::CreateNew,[Security.AccessControl.FileSystemRights]::FullControl,[IO.FileShare]::None,4096,[IO.FileOptions]::None,$fileAcl)
|
|
127
|
+
} else {
|
|
128
|
+
$stream = [IO.FileSystemAclExtensions]::Create([IO.FileInfo]::new($file),[IO.FileMode]::CreateNew,[Security.AccessControl.FileSystemRights]::FullControl,[IO.FileShare]::None,4096,[IO.FileOptions]::None,$fileAcl)
|
|
129
|
+
}
|
|
130
|
+
} catch { continue }
|
|
131
|
+
try {
|
|
132
|
+
# Harden and verify the same handle before writing any event bytes.
|
|
133
|
+
if ($PSVersionTable.PSVersion.Major -lt 6) {
|
|
134
|
+
$stream.SetAccessControl($fileAcl)
|
|
135
|
+
$verified = $stream.GetAccessControl()
|
|
136
|
+
} else {
|
|
137
|
+
[IO.FileSystemAclExtensions]::SetAccessControl($stream,$fileAcl)
|
|
138
|
+
$verified = [IO.FileSystemAclExtensions]::GetAccessControl($stream)
|
|
139
|
+
}
|
|
140
|
+
if (-not $verified.AreAccessRulesProtected -or $verified.GetOwner([Security.Principal.SecurityIdentifier]).Value -ne $sid.Value) { return }
|
|
141
|
+
$rules = $verified.GetAccessRules($true,$true,[Security.Principal.SecurityIdentifier])
|
|
142
|
+
if ($rules.Count -eq 0) { return }
|
|
143
|
+
foreach ($entry in $rules) {
|
|
144
|
+
if ($entry.IdentityReference.Value -ne $sid.Value -or $entry.AccessControlType -ne 'Allow') { return }
|
|
145
|
+
}
|
|
146
|
+
$row = @{owner=$null;run_id=$script:AuroqRun;stage=$Stage;outcome=$Outcome;occurred_at=[DateTime]::UtcNow.ToString('o');host='installer';os='win32';client_version='2.5.1'} | ConvertTo-Json -Compress
|
|
147
|
+
$bytes = [Text.Encoding]::UTF8.GetBytes($row)
|
|
148
|
+
$stream.Write($bytes,0,$bytes.Length)
|
|
149
|
+
$stream.Flush($true)
|
|
150
|
+
} finally { $stream.Dispose() }
|
|
151
|
+
return
|
|
152
|
+
}
|
|
153
|
+
} catch { return } finally { if ($gate) { $gate.Dispose() } }
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function Write-AuroqTerminal([int]$Code) {
|
|
157
|
+
if ($script:AuroqObservedTerminal) { return }
|
|
158
|
+
$script:AuroqObservedTerminal = $true
|
|
159
|
+
$outcome = 'ok'
|
|
160
|
+
if ($Code -ne 0) { $outcome = 'error' }
|
|
161
|
+
if ($script:AuroqStage -and $script:AuroqStage -ne 'startup') { Write-AuroqEvent $script:AuroqStage $outcome }
|
|
162
|
+
Write-AuroqEvent 'startup' $outcome
|
|
163
|
+
}
|
|
164
|
+
|
|
63
165
|
function Get-AuroqNodeDir {
|
|
64
166
|
$base = $env:LOCALAPPDATA
|
|
65
167
|
if (-not $base) { $base = Join-Path (Get-AuroqHome) 'AppData\Local' }
|
|
@@ -78,6 +180,7 @@ function Write-AuroqAviso { param([string]$Texto) Write-Host " ! $Texto" -Fore
|
|
|
78
180
|
# script roda de arquivo (CI e testes precisam do codigo de saida).
|
|
79
181
|
function Stop-AuroqInstalacao {
|
|
80
182
|
param([int]$Codigo = 0)
|
|
183
|
+
Write-AuroqTerminal $Codigo
|
|
81
184
|
if ($script:AuroqRodaDeArquivo) { exit $Codigo }
|
|
82
185
|
Write-Host ' (esta janela fica aberta pra voce ler com calma - nada mais vai rodar)' -ForegroundColor DarkGray
|
|
83
186
|
Write-Host ''
|
|
@@ -486,7 +589,7 @@ function Invoke-AuroqLogin {
|
|
|
486
589
|
# sucesso. Usado como pergunta de sim/nao, ele dizia "voce ja estava logado"
|
|
487
590
|
# pra quem nunca logou, pulava o portao e deixava a conta sem acesso chegar ate
|
|
488
591
|
# a criacao da pasta.
|
|
489
|
-
& (Get-AuroqNpx) -y auroq-os@2.5.
|
|
592
|
+
& (Get-AuroqNpx) -y auroq-os@2.5.2 check-access
|
|
490
593
|
if ($LASTEXITCODE -ne 0) {
|
|
491
594
|
Write-AuroqLog 'login' 'recusado'
|
|
492
595
|
Write-Host ''
|
|
@@ -574,7 +677,7 @@ function Invoke-AuroqInit {
|
|
|
574
677
|
if ($env:AUROQ_INSTALL_DRY_RUN) { Write-AuroqOk 'Sistema - seria montado aqui'; return }
|
|
575
678
|
|
|
576
679
|
Set-Location $script:AuroqPastaAlvo
|
|
577
|
-
& (Get-AuroqNpx) -y auroq-os@2.5.
|
|
680
|
+
& (Get-AuroqNpx) -y auroq-os@2.5.2 instalar
|
|
578
681
|
if ($LASTEXITCODE -ne 0) {
|
|
579
682
|
Write-AuroqLog 'init' 'falhou'
|
|
580
683
|
Write-AuroqErro 'A montagem do sistema parou no meio.' 'Rode o mesmo comando de novo. Se repetir, mande pro suporte o arquivo install.log da pasta .auroq.'
|
|
@@ -609,15 +712,35 @@ function Write-AuroqFecho {
|
|
|
609
712
|
# --- Fluxo --------------------------------------------------------------------
|
|
610
713
|
|
|
611
714
|
function Invoke-AuroqInstalacao {
|
|
715
|
+
$script:AuroqObservedTerminal = $false
|
|
716
|
+
Write-AuroqEvent 'startup' 'started'
|
|
717
|
+
$script:AuroqStage = 'startup'
|
|
612
718
|
Write-AuroqTitulo 'Auroq OS - instalacao'
|
|
613
719
|
Test-AuroqMaquina
|
|
614
720
|
Set-AuroqCaminhoDaFerramenta
|
|
721
|
+
$script:AuroqStage = 'git'
|
|
722
|
+
Write-AuroqEvent 'git' 'started'
|
|
615
723
|
Install-AuroqGit
|
|
724
|
+
Write-AuroqEvent 'git' 'ok'
|
|
725
|
+
$script:AuroqStage = 'node'
|
|
726
|
+
Write-AuroqEvent 'node' 'started'
|
|
616
727
|
Install-AuroqNode
|
|
728
|
+
Write-AuroqEvent 'node' 'ok'
|
|
729
|
+
$script:AuroqStage = 'access'
|
|
730
|
+
Write-AuroqEvent 'access' 'started'
|
|
617
731
|
Invoke-AuroqLogin
|
|
732
|
+
Write-AuroqEvent 'access' 'ok'
|
|
733
|
+
$script:AuroqStage = 'folder'
|
|
734
|
+
Write-AuroqEvent 'folder' 'started'
|
|
618
735
|
Get-AuroqPasta
|
|
736
|
+
Write-AuroqEvent 'folder' 'ok'
|
|
737
|
+
$script:AuroqStage = 'framework'
|
|
738
|
+
Write-AuroqEvent 'framework' 'started'
|
|
619
739
|
Invoke-AuroqInit
|
|
740
|
+
Write-AuroqEvent 'framework' 'ok'
|
|
620
741
|
Write-AuroqFecho
|
|
742
|
+
$script:AuroqStage = 'startup'
|
|
743
|
+
Write-AuroqTerminal 0
|
|
621
744
|
}
|
|
622
745
|
|
|
623
746
|
# Carregado pelos testes: so define as funcoes e sai.
|
|
@@ -626,10 +749,11 @@ if (-not $env:AUROQ_INSTALL_LIB) {
|
|
|
626
749
|
try {
|
|
627
750
|
Invoke-AuroqInstalacao
|
|
628
751
|
} catch {
|
|
752
|
+
Write-AuroqTerminal 1
|
|
629
753
|
if ("$_" -notmatch 'auroq-parou') {
|
|
630
754
|
# Falha que o catalogo nao previu: mostrar em vez de deixar a janela sumir.
|
|
631
755
|
Write-Host ''
|
|
632
|
-
Write-Host " Algo inesperado interrompeu a instalacao
|
|
756
|
+
Write-Host " Algo inesperado interrompeu a instalacao (INSTALL_FAILED)." -ForegroundColor Red
|
|
633
757
|
Write-Host ' Rode o mesmo comando de novo - nada fica instalado pela metade.' -ForegroundColor Cyan
|
|
634
758
|
Write-Host " Se repetir, chame o suporte: $AuroqSuporte" -ForegroundColor DarkGray
|
|
635
759
|
Write-Host ''
|
package/installer/install.sh
CHANGED
|
@@ -24,6 +24,74 @@ MACOS_MIN=13
|
|
|
24
24
|
DISCO_MIN_MB=2048
|
|
25
25
|
AUROQ_DIR="${HOME}/.auroq"
|
|
26
26
|
NODE_DIR="${AUROQ_DIR}/node"
|
|
27
|
+
AUROQ_RUN="$$-$(date -u +%s)-$RANDOM-$RANDOM"
|
|
28
|
+
|
|
29
|
+
# Metadata local, sem credenciais; 200 slots exclusivos limitam escritores concorrentes.
|
|
30
|
+
auroq_event() (
|
|
31
|
+
[ "${ARCANE_TELEMETRY:-1}" = 0 ] && return 0
|
|
32
|
+
[ -n "${AUROQ_INSTALL_DRY_RUN:-}" ] && return 0
|
|
33
|
+
case "$1" in startup|git|node|access|folder|framework|install) ;; *) return 0;; esac
|
|
34
|
+
case "$2" in started|ok|error) ;; *) return 0;; esac
|
|
35
|
+
# Perl already ships with macOS and is used below; no Node or network.
|
|
36
|
+
perl - "$1" "$2" "$AUROQ_RUN" <<'AUROQ_SPOOL'
|
|
37
|
+
use strict; use warnings; use Fcntl qw(:DEFAULT :mode); use Time::HiRes qw(time sleep); use JSON::PP ();
|
|
38
|
+
umask 0077;
|
|
39
|
+
my ($stage,$outcome,$run)=@ARGV;
|
|
40
|
+
my $root="$ENV{HOME}/.arcane"; my $dir="$root/installer-outbox";
|
|
41
|
+
for my $p ($root,$dir) {
|
|
42
|
+
mkdir($p,0700) unless -e $p;
|
|
43
|
+
my @st=lstat($p); exit 0 unless @st && S_ISDIR($st[2]) && !-l $p && $st[4]==$<;
|
|
44
|
+
chmod(0700,$p) or exit 0;
|
|
45
|
+
}
|
|
46
|
+
sub dead { my ($pid)=@_; return 0 if kill(0,$pid); return $!{ESRCH}; }
|
|
47
|
+
sub recover {
|
|
48
|
+
my ($lock)=@_; return if -l $lock || !-d $lock;
|
|
49
|
+
opendir(my $dh,$lock) or return; my @names=readdir($dh); closedir($dh);
|
|
50
|
+
for my $n (@names) { unlink("$lock/$n") if $n =~ /^owner-([1-9][0-9]{0,9})-[0-9a-f-]{36}$/ && dead($1); }
|
|
51
|
+
rmdir($lock); # Cannot remove a new nonempty lock.
|
|
52
|
+
}
|
|
53
|
+
my $nonce=substr(join('-',map {sprintf('%04x',int(rand(65536)))} 1..8),0,36);
|
|
54
|
+
my $owner="owner-$$-$nonce"; my $candidate="$dir/.candidate-$$-$nonce"; my $lock="$dir/.lock";
|
|
55
|
+
mkdir($candidate,0700) or exit 0;
|
|
56
|
+
sysopen(my $marker,"$candidate/$owner",O_WRONLY|O_CREAT|O_EXCL,0600) or exit 0; close($marker);
|
|
57
|
+
my $until=time()+0.25;
|
|
58
|
+
while(!rename($candidate,$lock)) {
|
|
59
|
+
if(time()>=$until) { unlink("$candidate/$owner"); rmdir($candidate); exit 0; }
|
|
60
|
+
recover($lock); sleep(0.005);
|
|
61
|
+
}
|
|
62
|
+
eval {
|
|
63
|
+
opendir(my $dh,$dir) or die; my @names=readdir($dh); closedir($dh); my $count=0;
|
|
64
|
+
for my $name (@names) {
|
|
65
|
+
my $p="$dir/$name";
|
|
66
|
+
if($name =~ /^\.candidate-([1-9][0-9]{0,9})-[0-9a-f-]{36}$/ && dead($1)){recover($p);next;}
|
|
67
|
+
next unless $name =~ /^(?:[0-9]{1,3}|ps-[0-9]{1,3}\.json|\.claim-[1-9][0-9]{0,9}-[0-9a-f-]{36}|\.retry-[0-9a-f-]{36})$/;
|
|
68
|
+
$count++;
|
|
69
|
+
next if -l $p;
|
|
70
|
+
next if $name =~ /^\.claim-([1-9][0-9]{0,9})-/ && !dead($1);
|
|
71
|
+
my $file=-d $p ? "$p/event.json" : $p;
|
|
72
|
+
my @st=lstat($file); my $remove=!@st;
|
|
73
|
+
# All new writers hold this lock: incomplete slots have no active writer.
|
|
74
|
+
if(@st && S_ISREG($st[2]) && !-l $file && $st[3]==1 && $st[4]==$< && $st[7]<=2048){
|
|
75
|
+
open(my $f,'<',$file) or next; local $/; my $raw=<$f>; close($f);
|
|
76
|
+
my $row=eval {JSON::PP::decode_json($raw)};
|
|
77
|
+
$remove=(!$row || ref($row) ne 'HASH' || time()-$st[9]>=7*86400);
|
|
78
|
+
}
|
|
79
|
+
if($remove){unlink($file) if @st; rmdir($p) if -d $p; $count-- unless -e $p;}
|
|
80
|
+
}
|
|
81
|
+
if($count<200){
|
|
82
|
+
for my $i (0..199){
|
|
83
|
+
my $slot="$dir/$i"; next unless mkdir($slot,0700);
|
|
84
|
+
my @t=gmtime(); my $stamp=sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$t[5]+1900,$t[4]+1,$t[3],$t[2],$t[1],$t[0]);
|
|
85
|
+
sysopen(my $f,"$slot/event.json",O_WRONLY|O_CREAT|O_EXCL,0600) or die;
|
|
86
|
+
print $f JSON::PP::encode_json({owner=>undef,run_id=>$run,stage=>$stage,outcome=>$outcome,occurred_at=>$stamp,host=>'installer',os=>'darwin',client_version=>'2.5.1'}); close($f) or die;
|
|
87
|
+
last;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
unlink("$lock/$owner"); rmdir($lock);
|
|
92
|
+
AUROQ_SPOOL
|
|
93
|
+
return 0
|
|
94
|
+
) 2>/dev/null
|
|
27
95
|
|
|
28
96
|
# Cores — desligadas quando a saida nao e um terminal (log de suporte fica limpo).
|
|
29
97
|
if [ -t 1 ]; then
|
|
@@ -151,9 +219,9 @@ auroq_tem_terminal() {
|
|
|
151
219
|
# recebem pedaco do script no lugar da resposta dele.
|
|
152
220
|
auroq_npx_aluno() {
|
|
153
221
|
if [ -t 0 ]; then
|
|
154
|
-
npx -y auroq-os@2.5.
|
|
222
|
+
npx -y auroq-os@2.5.2 "$@"
|
|
155
223
|
else
|
|
156
|
-
npx -y auroq-os@2.5.
|
|
224
|
+
npx -y auroq-os@2.5.2 "$@" < /dev/tty
|
|
157
225
|
fi
|
|
158
226
|
}
|
|
159
227
|
|
|
@@ -583,15 +651,35 @@ auroq_fecho() {
|
|
|
583
651
|
# ─── Fluxo ────────────────────────────────────────────────────────────────────
|
|
584
652
|
|
|
585
653
|
auroq_main() {
|
|
654
|
+
auroq_event startup started
|
|
655
|
+
AUROQ_FINISHED=0
|
|
656
|
+
trap 'rc=$?; if [ "${AUROQ_FINISHED:-0}" != 1 ]; then result=ok; [ "$rc" -ne 0 ] && result=error; auroq_event "${AUROQ_STAGE:-startup}" "$result"; if [ "${AUROQ_STAGE:-startup}" != startup ]; then auroq_event startup "$result"; fi; fi' EXIT
|
|
586
657
|
titulo "Auroq OS — instalacao"
|
|
587
658
|
auroq_diagnostico
|
|
588
659
|
auroq_publicar_ferramenta_no_path
|
|
660
|
+
AUROQ_STAGE=git
|
|
661
|
+
auroq_event git started
|
|
589
662
|
auroq_garantir_git
|
|
663
|
+
auroq_event git ok
|
|
664
|
+
AUROQ_STAGE=node
|
|
665
|
+
auroq_event node started
|
|
590
666
|
auroq_garantir_node
|
|
667
|
+
auroq_event node ok
|
|
668
|
+
AUROQ_STAGE=access
|
|
669
|
+
auroq_event access started
|
|
591
670
|
auroq_login_mentoria
|
|
671
|
+
auroq_event access ok
|
|
672
|
+
AUROQ_STAGE=folder
|
|
673
|
+
auroq_event folder started
|
|
592
674
|
auroq_escolher_pasta
|
|
675
|
+
auroq_event folder ok
|
|
676
|
+
AUROQ_STAGE=framework
|
|
677
|
+
auroq_event framework started
|
|
593
678
|
auroq_rodar_init
|
|
679
|
+
auroq_event framework ok
|
|
594
680
|
auroq_fecho
|
|
681
|
+
auroq_event startup ok
|
|
682
|
+
AUROQ_FINISHED=1
|
|
595
683
|
}
|
|
596
684
|
|
|
597
685
|
# Carregado pelos testes: so define as funcoes e sai.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `auroq-os historico` — estado da captura.
|
|
3
|
+
* Regra de produto: MCP Arcane neste negocio = historico ligado. Sem pause.
|
|
4
|
+
*/
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
|
|
8
|
+
function mcpLigado(cwd = process.cwd()) {
|
|
9
|
+
try {
|
|
10
|
+
const json = JSON.parse(fs.readFileSync(path.join(cwd, '.mcp.json'), 'utf8'));
|
|
11
|
+
return Boolean(json?.mcpServers?.arcane);
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function run(argv = [], cwd = process.cwd()) {
|
|
18
|
+
const command = argv[0] || 'status';
|
|
19
|
+
const mcp = mcpLigado(cwd);
|
|
20
|
+
if (command === 'pausar' || command === 'pause') {
|
|
21
|
+
return {
|
|
22
|
+
ok: false,
|
|
23
|
+
code: 'NO_PAUSE',
|
|
24
|
+
error: 'Nao ha pause. Historico e regra do MCP Arcane. Para parar, pare de usar o MCP.',
|
|
25
|
+
capture: mcp ? 'on' : 'off',
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
ok: true,
|
|
30
|
+
capture: mcp ? 'on' : 'off',
|
|
31
|
+
rule: 'mcp_implies_history',
|
|
32
|
+
pause: false,
|
|
33
|
+
hook: 'ahi-capture.cjs',
|
|
34
|
+
note: mcp
|
|
35
|
+
? 'MCP Arcane presente: o historico deste trabalho e registrado.'
|
|
36
|
+
: 'Sem MCP Arcane neste negocio: nada e capturado.',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"context/context-builder.js": [
|
|
3
|
+
"121cd0a1df8a44098831cd4335536e8facf4e65b8aec48f4ce9c2d432dc6252a"
|
|
4
|
+
],
|
|
5
|
+
"context/context-tracker.js": [
|
|
6
|
+
"48e94db7b1778dedecc8eae829139579ad7778ff47668597ebe766610696553f"
|
|
7
|
+
],
|
|
8
|
+
"diagnostics/collectors/consistency-collector.js": [
|
|
9
|
+
"65f4255f87c9900400649dc8b9aedaac4851b5939d93e127778bd93cee99db12"
|
|
10
|
+
],
|
|
11
|
+
"diagnostics/collectors/hook-collector.js": [
|
|
12
|
+
"c2cfa1b760bcb05decf5ad05f9159140cbe0cdc6b0f91581790e44d83dc6b660"
|
|
13
|
+
],
|
|
14
|
+
"diagnostics/collectors/manifest-collector.js": [
|
|
15
|
+
"3dc895eb94485320ecbaca3a1d29e3776cfb691dd7dcc71cf44b34af30e8ebb6"
|
|
16
|
+
],
|
|
17
|
+
"diagnostics/collectors/output-analyzer.js": [
|
|
18
|
+
"e6846b1aba0a6cba17c297a871861d4f8199d7500220bff296a6a3291e32493e"
|
|
19
|
+
],
|
|
20
|
+
"diagnostics/collectors/pipeline-collector.js": [
|
|
21
|
+
"8655b6240e2f54b70def1a8c2fae00d40e2615cb95fd7ca0d64c2e0a6dfe3b73"
|
|
22
|
+
],
|
|
23
|
+
"diagnostics/collectors/quality-collector.js": [
|
|
24
|
+
"30ae299eab6d569d09afe3530a5b2f1ff35ef75366a1ab56a9e2a57d39d3611c"
|
|
25
|
+
],
|
|
26
|
+
"diagnostics/collectors/relevance-matrix.js": [
|
|
27
|
+
"f92c4f7061dc82eed4310a27b69eade33d3015f9beb1bed688601a2dccbad22e"
|
|
28
|
+
],
|
|
29
|
+
"diagnostics/collectors/safe-read-json.js": [
|
|
30
|
+
"dc7bcd13779207ad67b1c3929b7e1e0ccfa3563f3458c20cad28cb1922e9a74c"
|
|
31
|
+
],
|
|
32
|
+
"diagnostics/collectors/session-collector.js": [
|
|
33
|
+
"a116d884d6947ddc8e5f3def012d93696576c584c4fde1639b8d895924fc09ea"
|
|
34
|
+
],
|
|
35
|
+
"diagnostics/collectors/timing-collector.js": [
|
|
36
|
+
"2523ce93f863a28f798d992c4f2fab041c91a09413b3186fd290e6035b391587"
|
|
37
|
+
],
|
|
38
|
+
"diagnostics/collectors/uap-collector.js": [
|
|
39
|
+
"dd025894f8f0d3bd22a147dbc0debef8b83e96f3c59483653404b3cd5a01d5aa"
|
|
40
|
+
],
|
|
41
|
+
"diagnostics/report-formatter.js": [
|
|
42
|
+
"1aa2853928df194b669ce32c3b050a90de1311739045074f699d10210ed8d381"
|
|
43
|
+
],
|
|
44
|
+
"diagnostics/synapse-diagnostics.js": [
|
|
45
|
+
"de9dffce0e380637027cbd64b062d3eeffc37e42a84a337e5758fbef39fe3a00"
|
|
46
|
+
],
|
|
47
|
+
"domain/domain-loader.js": [
|
|
48
|
+
"af788f9da956b89eef1e5eb4ef4efdf05ca758c8969a2c375f568119495ebc05"
|
|
49
|
+
],
|
|
50
|
+
"engine.js": [
|
|
51
|
+
"47bab93a2144edce875ee68cc2717fee1bd824c9affdd5964454f5141310b8e0",
|
|
52
|
+
"c061df38ec24956da9a752f13f9455c7cd69546adb330c7587b9d456e79b4aa1"
|
|
53
|
+
],
|
|
54
|
+
"layers/l0-constitution.js": [
|
|
55
|
+
"2123a6a44915aaac2a6bbd26c67c285c9d1e12b50fe42a8ada668306b07d1c4a"
|
|
56
|
+
],
|
|
57
|
+
"layers/l1-global.js": [
|
|
58
|
+
"21f6969e6d64e9a85c876be6799db4ca7d090f0009057f4a06ead8da12392d45"
|
|
59
|
+
],
|
|
60
|
+
"layers/l2-agent.js": [
|
|
61
|
+
"a8677dc58ae7927c5292a4b52883bbc905c8112573b8b8631f0b8bc01ea2b6e6"
|
|
62
|
+
],
|
|
63
|
+
"layers/l3-workflow.js": [
|
|
64
|
+
"496cbd71d7dac9c1daa534ffac45c622d0c032f334fedf493e9322a565b2b181"
|
|
65
|
+
],
|
|
66
|
+
"layers/l4-task.js": [
|
|
67
|
+
"30df70c04b16e3aff95899211ef6ae3d9f0a8097ebdc7de92599fc6cb792e5f0"
|
|
68
|
+
],
|
|
69
|
+
"layers/l5-squad.js": [
|
|
70
|
+
"d6d35cbf966deb5a7d2df2b09f5abe8da8c6d4e346b385418f8dc1fae3ddf830"
|
|
71
|
+
],
|
|
72
|
+
"layers/l6-keyword.js": [
|
|
73
|
+
"8e5405999a2ce2f3ca4e62e863cf702ba27448914241f5eb8f02760bc7477523"
|
|
74
|
+
],
|
|
75
|
+
"layers/l7-star-command.js": [
|
|
76
|
+
"3b8372ac1c51830c1ef560b1012b112a3559651b0750e42f2037f7fe9e6787d6"
|
|
77
|
+
],
|
|
78
|
+
"layers/layer-processor.js": [
|
|
79
|
+
"73cb0e5b4bada80d8e256009004679e483792077fac4358c6466cd77136f79fa"
|
|
80
|
+
],
|
|
81
|
+
"memory/memory-bridge.js": [
|
|
82
|
+
"820875f97ceea80fc6402c0dab1706cfe58de527897b22dea68db40b0d6ec368"
|
|
83
|
+
],
|
|
84
|
+
"memory/synapse-memory-provider.js": [
|
|
85
|
+
"5d613d1fac7ee82c49a3f03b38735fd3cabfe87dd868494672ddfef300ea3145"
|
|
86
|
+
],
|
|
87
|
+
"output/formatter.js": [
|
|
88
|
+
"fe4f6c2f6091defb6af66dad71db0640f919b983111087f8cc5821e3d44ca864",
|
|
89
|
+
"3e722c4736642ef96ec73a54cd2011eed7bd1074394a38eac66cb6f0af2c855b"
|
|
90
|
+
],
|
|
91
|
+
"runtime/hook-runtime.js": [
|
|
92
|
+
"5518692eeee7dcb570507c4bb96ef68a1ef51d6ad6c417e9d1f649cd8b21b199",
|
|
93
|
+
"7c34b84c5693045a007356081959c335493bbd3afc69822fb6661e19cc10d56c"
|
|
94
|
+
],
|
|
95
|
+
"scripts/generate-constitution.js": [
|
|
96
|
+
"e2f645d5de44e6b3721a5de9b19982bc7b8cf7eed3ca4d62bc53221649c59af1"
|
|
97
|
+
],
|
|
98
|
+
"session/session-manager.js": [
|
|
99
|
+
"98e8c8fa15b074b6102bcd51c6f91f101743338e8cde6de9c31d6b6eea5d6580"
|
|
100
|
+
],
|
|
101
|
+
"utils/atomic-write.js": [
|
|
102
|
+
"efeef0fbcebb184df5b79f4ba4b4b7fe274c3ba7d1c705ce1af92628e920bd8b"
|
|
103
|
+
],
|
|
104
|
+
"utils/paths.js": [
|
|
105
|
+
"bf8cf93c1a16295e7de055bee292e2778a152b6e7d6c648dbc054a4b04dffc10"
|
|
106
|
+
],
|
|
107
|
+
"utils/tokens.js": [
|
|
108
|
+
"3b927daec51d0a791f3fe4ef9aafc362773450e7cf50eb4b6d8ae9011d70df9a"
|
|
109
|
+
]
|
|
110
|
+
}
|