triflux 10.18.1 → 10.18.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/hooks/hook-registry.json +4 -2
- package/package.json +1 -1
- package/scripts/setup.mjs +16 -2
- package/scripts/tfx-route.sh +2 -1
package/hooks/hook-registry.json
CHANGED
|
@@ -206,10 +206,11 @@
|
|
|
206
206
|
{
|
|
207
207
|
"id": "ext-session-vault-start",
|
|
208
208
|
"source": "session-vault",
|
|
209
|
+
"requires": "$HOME/Desktop/Projects/tools/session-vault",
|
|
209
210
|
"matcher": "*",
|
|
210
211
|
"command": "bash \"${HOME}/Desktop/Projects/tools/session-vault/scripts/start_hook.sh\"",
|
|
211
212
|
"priority": 100,
|
|
212
|
-
"enabled":
|
|
213
|
+
"enabled": false,
|
|
213
214
|
"timeout": 10,
|
|
214
215
|
"blocking": false,
|
|
215
216
|
"description": "세션 볼트 로깅 시작"
|
|
@@ -230,10 +231,11 @@
|
|
|
230
231
|
{
|
|
231
232
|
"id": "ext-session-vault-export",
|
|
232
233
|
"source": "session-vault",
|
|
234
|
+
"requires": "$HOME/Desktop/Projects/tools/session-vault",
|
|
233
235
|
"matcher": "*",
|
|
234
236
|
"command": "bash \"${HOME}/Desktop/Projects/tools/session-vault/scripts/export_hook.sh\"",
|
|
235
237
|
"priority": 100,
|
|
236
|
-
"enabled":
|
|
238
|
+
"enabled": false,
|
|
237
239
|
"timeout": 30,
|
|
238
240
|
"blocking": false,
|
|
239
241
|
"description": "세션 트랜스크립트 내보내기"
|
package/package.json
CHANGED
package/scripts/setup.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
writeFileSync,
|
|
19
19
|
} from "fs";
|
|
20
20
|
import { homedir } from "os";
|
|
21
|
-
import { dirname, join, relative } from "path";
|
|
21
|
+
import { dirname, join, relative, resolve } from "path";
|
|
22
22
|
import { fileURLToPath } from "url";
|
|
23
23
|
import {
|
|
24
24
|
ensureGlobalClaudeRoutingSection,
|
|
@@ -498,10 +498,22 @@ function extractManagedHookFilename(command) {
|
|
|
498
498
|
return match ? match[1] : null;
|
|
499
499
|
}
|
|
500
500
|
|
|
501
|
+
function expandRequiresPath(value) {
|
|
502
|
+
if (typeof value !== "string" || value.trim() === "") return null;
|
|
503
|
+
return resolve(
|
|
504
|
+
value.replace(/\$\{HOME\}/g, _TFX_HOME).replace(/\$HOME\b/g, _TFX_HOME),
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
function isRequiredPathAvailable(value) {
|
|
509
|
+
const expanded = expandRequiresPath(value);
|
|
510
|
+
return expanded ? existsSync(expanded) : true;
|
|
511
|
+
}
|
|
512
|
+
|
|
501
513
|
/**
|
|
502
514
|
* hook-registry.json에서 관리 대상 훅 목록을 플랫 배열로 반환한다.
|
|
503
515
|
* @param {string} registryPath - hook-registry.json 경로
|
|
504
|
-
* @returns {Array<{ event: string, id: string, fileName: string, matcher: string, command: string, priority: number, enabled: boolean }>}
|
|
516
|
+
* @returns {Array<{ event: string, id: string, fileName: string, matcher: string, command: string, priority: number, enabled: boolean, requires?: string }>}
|
|
505
517
|
*/
|
|
506
518
|
function getManagedRegistryHooks(registryPath) {
|
|
507
519
|
if (!existsSync(registryPath)) return [];
|
|
@@ -513,6 +525,7 @@ function getManagedRegistryHooks(registryPath) {
|
|
|
513
525
|
if (!Array.isArray(hooks)) continue;
|
|
514
526
|
for (const hook of hooks) {
|
|
515
527
|
if (!hook.enabled) continue;
|
|
528
|
+
if (!isRequiredPathAvailable(hook.requires)) continue;
|
|
516
529
|
const fileName = extractManagedHookFilename(hook.command);
|
|
517
530
|
result.push({
|
|
518
531
|
event,
|
|
@@ -522,6 +535,7 @@ function getManagedRegistryHooks(registryPath) {
|
|
|
522
535
|
command: hook.command || "",
|
|
523
536
|
priority: hook.priority ?? 100,
|
|
524
537
|
enabled: hook.enabled,
|
|
538
|
+
requires: hook.requires,
|
|
525
539
|
});
|
|
526
540
|
}
|
|
527
541
|
}
|
package/scripts/tfx-route.sh
CHANGED
|
@@ -365,7 +365,8 @@ mkdir -p "$TFX_PROBE_DIR" 2>/dev/null || true
|
|
|
365
365
|
|
|
366
366
|
estimate_expected_duration_sec() {
|
|
367
367
|
local agent="${1:-}" profile="${2:-}" prompt="${3:-}"
|
|
368
|
-
local text
|
|
368
|
+
local text
|
|
369
|
+
text=$(printf '%s' "$prompt" | tr '[:upper:]' '[:lower:]')
|
|
369
370
|
local expected=30
|
|
370
371
|
|
|
371
372
|
case "$agent" in
|