@triflux/remote 10.1.0 → 10.25.1
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/hub/pipe.mjs +239 -121
- package/hub/public/dashboard.html +61 -0
- package/hub/server.mjs +2165 -708
- package/hub/store-adapter.mjs +59 -26
- package/hub/store.mjs +356 -153
- package/hub/team/agent-map.json +26 -7
- package/hub/team/ansi.mjs +245 -146
- package/hub/team/backend.mjs +84 -17
- package/hub/team/build-worker-prompt.mjs +42 -0
- package/hub/team/check-mcp-hub.mjs +49 -0
- package/hub/team/claude-daemon-control.mjs +219 -0
- package/hub/team/claude-native-bridge.mjs +784 -0
- package/hub/team/claude-session-projection.mjs +65 -0
- package/hub/team/cli/commands/attach.mjs +57 -37
- package/hub/team/cli/commands/control.mjs +29 -8
- package/hub/team/cli/commands/debug.mjs +95 -74
- package/hub/team/cli/commands/focus.mjs +80 -53
- package/hub/team/cli/commands/interrupt.mjs +18 -6
- package/hub/team/cli/commands/kill.mjs +16 -5
- package/hub/team/cli/commands/list.mjs +31 -24
- package/hub/team/cli/commands/send.mjs +19 -6
- package/hub/team/cli/commands/start/index.mjs +154 -33
- package/hub/team/cli/commands/start/parse-args.mjs +89 -12
- package/hub/team/cli/commands/start/start-headless.mjs +125 -37
- package/hub/team/cli/commands/start/start-in-process.mjs +50 -40
- package/hub/team/cli/commands/start/start-mux.mjs +122 -73
- package/hub/team/cli/commands/start/start-wt.mjs +86 -69
- package/hub/team/cli/commands/status.mjs +43 -14
- package/hub/team/cli/commands/stop.mjs +11 -4
- package/hub/team/cli/commands/task.mjs +8 -3
- package/hub/team/cli/commands/tasks.mjs +13 -13
- package/hub/team/cli/index.mjs +2 -2
- package/hub/team/cli/manifest.mjs +38 -8
- package/hub/team/cli/render.mjs +52 -30
- package/hub/team/cli/services/attach-fallback.mjs +74 -54
- package/hub/team/cli/services/hub-client.mjs +44 -16
- package/hub/team/cli/services/member-selector.mjs +37 -30
- package/hub/team/cli/services/native-control.mjs +144 -116
- package/hub/team/cli/services/runtime-mode.mjs +55 -1
- package/hub/team/cli/services/state-store.mjs +66 -9
- package/hub/team/cli/services/task-model.mjs +40 -30
- package/hub/team/codex-review.mjs +521 -0
- package/hub/team/conductor-mesh-bridge.mjs +25 -24
- package/hub/team/conductor-registry.mjs +121 -0
- package/hub/team/conductor.mjs +1379 -671
- package/hub/team/consensus-meta.mjs +176 -0
- package/hub/team/dashboard-anchor.mjs +4 -5
- package/hub/team/dashboard-layout.mjs +3 -1
- package/hub/team/dashboard-open.mjs +20 -118
- package/hub/team/dashboard.mjs +76 -28
- package/hub/team/event-log.mjs +18 -10
- package/hub/team/execution-mode.mjs +241 -0
- package/hub/team/extract-completion-payload.mjs +110 -0
- package/hub/team/git-preflight.mjs +286 -0
- package/hub/team/handoff.mjs +49 -18
- package/hub/team/headless-bridge-session.mjs +17 -0
- package/hub/team/headless.mjs +2065 -1156
- package/hub/team/health-probe.mjs +232 -69
- package/hub/team/launcher-template.mjs +23 -13
- package/hub/team/lead-control.mjs +91 -4
- package/hub/team/mcp-selector.mjs +145 -0
- package/hub/team/native-supervisor.mjs +90 -26
- package/hub/team/native.mjs +74 -35
- package/hub/team/nativeProxy.mjs +184 -113
- package/hub/team/notify.mjs +147 -78
- package/hub/team/orchestrator.mjs +173 -161
- package/hub/team/pane.mjs +43 -15
- package/hub/team/process-cleanup.mjs +69 -25
- package/hub/team/psmux.mjs +1020 -279
- package/hub/team/recovery-store.mjs +149 -0
- package/hub/team/remote-probe.mjs +68 -52
- package/hub/team/remote-session.mjs +131 -59
- package/hub/team/remote-watcher.mjs +61 -33
- package/hub/team/retry-state-machine.mjs +267 -0
- package/hub/team/routing.mjs +51 -25
- package/hub/team/runtime-strategy.mjs +200 -0
- package/hub/team/schemas/worker-completion.json +39 -0
- package/hub/team/sentinel-capture.mjs +127 -0
- package/hub/team/session-sync.mjs +153 -6
- package/hub/team/session.mjs +605 -611
- package/hub/team/shared.mjs +13 -13
- package/hub/team/staleState.mjs +72 -30
- package/hub/team/swarm-cli.mjs +390 -0
- package/hub/team/swarm-hypervisor.mjs +1522 -193
- package/hub/team/swarm-intent.mjs +216 -0
- package/hub/team/swarm-locks.mjs +140 -25
- package/hub/team/swarm-planner.mjs +121 -21
- package/hub/team/swarm-preflight.mjs +317 -0
- package/hub/team/swarm-reconciler.mjs +128 -23
- package/hub/team/synapse-cli.mjs +458 -0
- package/hub/team/synapse-http.mjs +60 -0
- package/hub/team/synapse-registry.mjs +329 -0
- package/hub/team/terminal-opener.mjs +216 -0
- package/hub/team/tui-core.mjs +288 -0
- package/hub/team/tui-lite.mjs +234 -146
- package/hub/team/tui-remote-adapter.mjs +18 -34
- package/hub/team/tui-synapse.mjs +223 -0
- package/hub/team/tui-viewer.mjs +104 -44
- package/hub/team/tui-widgets.mjs +262 -0
- package/hub/team/tui.mjs +927 -437
- package/hub/team/worker-completion-validator.mjs +84 -0
- package/hub/team/worker-sandbox.mjs +93 -0
- package/hub/team/worker-signal.mjs +263 -0
- package/hub/team/worker-signal.types.d.ts +52 -0
- package/hub/team/worktree-lifecycle.mjs +517 -63
- package/hub/team/wt-manager.mjs +297 -26
- package/hub/tools.mjs +474 -252
- package/hub/tray.mjs +411 -368
- package/hub/workers/claude-worker.mjs +162 -118
- package/hub/workers/codex-app-server-worker.mjs +1015 -0
- package/hub/workers/codex-mcp.mjs +724 -507
- package/hub/workers/delegator-mcp.mjs +662 -335
- package/hub/workers/factory.mjs +100 -21
- package/hub/workers/gemini-worker.mjs +179 -86
- package/hub/workers/interface.mjs +23 -2
- package/hub/workers/lib/jsonrpc-stdio.mjs +463 -0
- package/hub/workers/worker-utils.mjs +22 -16
- package/package.json +4 -3
- package/scripts/lib/agent-json.mjs +27 -0
- package/scripts/lib/async.mjs +174 -0
- package/scripts/lib/claudemd-scanner.mjs +223 -0
- package/scripts/lib/cli-agy.mjs +62 -0
- package/scripts/lib/cli-claude.mjs +78 -0
- package/scripts/lib/cli-codex.mjs +199 -0
- package/scripts/lib/cli-gemini.mjs +67 -0
- package/scripts/lib/codex-recovery.sh +50 -0
- package/scripts/lib/context.mjs +67 -0
- package/scripts/lib/cross-review-utils.mjs +59 -0
- package/scripts/lib/doctor-env-checks.mjs +121 -0
- package/scripts/lib/dynamic-route-cli.mjs +107 -0
- package/scripts/lib/env-probe.mjs +269 -0
- package/scripts/lib/env.mjs +14 -0
- package/scripts/lib/gemini-profiles.mjs +119 -0
- package/scripts/lib/handoff.mjs +187 -0
- package/scripts/lib/hook-utils.mjs +16 -0
- package/scripts/lib/hub.mjs +48 -0
- package/scripts/lib/keyword-rules.mjs +195 -0
- package/scripts/lib/logger.mjs +105 -0
- package/scripts/lib/mcp-filter.mjs +883 -0
- package/scripts/lib/mcp-gateway-servers.mjs +70 -0
- package/scripts/lib/mcp-guard-engine.mjs +2120 -0
- package/scripts/lib/mcp-health.mjs +773 -0
- package/scripts/lib/mcp-manifest.mjs +89 -0
- package/scripts/lib/mcp-server-catalog.mjs +355 -0
- package/scripts/lib/pid.mjs +63 -0
- package/scripts/lib/process-utils.mjs +26 -0
- package/scripts/lib/psmux-info.mjs +179 -0
- package/scripts/lib/quota.mjs +47 -0
- package/scripts/lib/remote-spawn-transfer.mjs +226 -0
- package/scripts/lib/skill-state.mjs +220 -0
- package/scripts/lib/skill-template.mjs +375 -0
- package/scripts/lib/team.mjs +75 -0
- package/scripts/lib/timeout.mjs +66 -0
- package/scripts/lib/tmp.mjs +26 -0
- package/scripts/lib/toml.mjs +113 -0
package/hub/store-adapter.mjs
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { createStore, importBetterSqlite3 } from './store.mjs';
|
|
2
1
|
import {
|
|
3
|
-
createMemoryStore,
|
|
4
|
-
clone,
|
|
5
2
|
buildAdaptiveRuleRow,
|
|
6
|
-
normalizeAdaptiveRuleIdentity,
|
|
7
3
|
clampConfidence,
|
|
8
4
|
clampHitIncrement,
|
|
9
|
-
coerceTimestamp,
|
|
10
5
|
clampRetentionMs,
|
|
11
|
-
|
|
6
|
+
clone,
|
|
7
|
+
coerceTimestamp,
|
|
8
|
+
createMemoryStore,
|
|
9
|
+
normalizeAdaptiveRuleIdentity,
|
|
10
|
+
} from "@triflux/core/hub/lib/memory-store.mjs";
|
|
11
|
+
import { createStore, importBetterSqlite3 } from "./store.mjs";
|
|
12
12
|
|
|
13
13
|
export { createMemoryStore };
|
|
14
14
|
|
|
15
15
|
function ensureAdaptiveRulesSchema(db) {
|
|
16
|
-
const schemaKey =
|
|
17
|
-
const currentVersion = db
|
|
18
|
-
|
|
16
|
+
const schemaKey = "adaptive_rules_schema_version";
|
|
17
|
+
const currentVersion = db
|
|
18
|
+
.prepare("SELECT value FROM _meta WHERE key = ?")
|
|
19
|
+
.pluck()
|
|
20
|
+
.get(schemaKey);
|
|
21
|
+
if (currentVersion === "2") return;
|
|
19
22
|
if (!currentVersion) {
|
|
20
23
|
// 신규 생성
|
|
21
24
|
db.exec(`
|
|
@@ -38,16 +41,22 @@ function ensureAdaptiveRulesSchema(db) {
|
|
|
38
41
|
`);
|
|
39
42
|
} else {
|
|
40
43
|
// v1 → v2 마이그레이션: 컬럼 추가
|
|
41
|
-
const cols = db.pragma(
|
|
42
|
-
if (!cols.includes(
|
|
43
|
-
|
|
44
|
-
if (!cols.includes(
|
|
44
|
+
const cols = db.pragma("table_info(adaptive_rules)").map((c) => c.name);
|
|
45
|
+
if (!cols.includes("error_message"))
|
|
46
|
+
db.exec("ALTER TABLE adaptive_rules ADD COLUMN error_message TEXT");
|
|
47
|
+
if (!cols.includes("solution"))
|
|
48
|
+
db.exec("ALTER TABLE adaptive_rules ADD COLUMN solution TEXT");
|
|
49
|
+
if (!cols.includes("context"))
|
|
50
|
+
db.exec("ALTER TABLE adaptive_rules ADD COLUMN context TEXT");
|
|
45
51
|
}
|
|
46
|
-
db.prepare(
|
|
52
|
+
db.prepare("INSERT OR REPLACE INTO _meta (key, value) VALUES (?, ?)").run(
|
|
53
|
+
schemaKey,
|
|
54
|
+
"2",
|
|
55
|
+
);
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
function attachAdaptiveRuleStore(store) {
|
|
50
|
-
if (store.type !==
|
|
59
|
+
if (store.type !== "sqlite" || !store.db) return store;
|
|
51
60
|
ensureAdaptiveRulesSchema(store.db);
|
|
52
61
|
const statements = {
|
|
53
62
|
upsertRule: store.db.prepare(`
|
|
@@ -66,7 +75,9 @@ function attachAdaptiveRuleStore(store) {
|
|
|
66
75
|
error_message = COALESCE(excluded.error_message, adaptive_rules.error_message),
|
|
67
76
|
solution = COALESCE(excluded.solution, adaptive_rules.solution),
|
|
68
77
|
context = COALESCE(excluded.context, adaptive_rules.context)`),
|
|
69
|
-
getRule: store.db.prepare(
|
|
78
|
+
getRule: store.db.prepare(
|
|
79
|
+
"SELECT * FROM adaptive_rules WHERE project_slug = ? AND pattern = ?",
|
|
80
|
+
),
|
|
70
81
|
updateRule: store.db.prepare(`
|
|
71
82
|
UPDATE adaptive_rules SET
|
|
72
83
|
confidence = ?,
|
|
@@ -88,13 +99,23 @@ function attachAdaptiveRuleStore(store) {
|
|
|
88
99
|
store.findAdaptiveRule = function findAdaptiveRule(projectSlug, pattern) {
|
|
89
100
|
const identity = normalizeAdaptiveRuleIdentity(projectSlug, pattern);
|
|
90
101
|
if (!identity) return null;
|
|
91
|
-
return clone(
|
|
102
|
+
return clone(
|
|
103
|
+
statements.getRule.get(identity.project_slug, identity.pattern) || null,
|
|
104
|
+
);
|
|
92
105
|
};
|
|
93
106
|
|
|
94
|
-
store.updateRuleConfidence = function updateRuleConfidence(
|
|
107
|
+
store.updateRuleConfidence = function updateRuleConfidence(
|
|
108
|
+
projectSlug,
|
|
109
|
+
pattern,
|
|
110
|
+
confidence,
|
|
111
|
+
options = {},
|
|
112
|
+
) {
|
|
95
113
|
const current = store.findAdaptiveRule(projectSlug, pattern);
|
|
96
114
|
if (!current) return null;
|
|
97
|
-
const updatedAt = Math.max(
|
|
115
|
+
const updatedAt = Math.max(
|
|
116
|
+
current.last_seen_ms,
|
|
117
|
+
coerceTimestamp(options.last_seen_ms, Date.now()),
|
|
118
|
+
);
|
|
98
119
|
statements.updateRule.run(
|
|
99
120
|
clampConfidence(confidence, current.confidence),
|
|
100
121
|
clampHitIncrement(options.hit_count_increment, 1),
|
|
@@ -105,15 +126,25 @@ function attachAdaptiveRuleStore(store) {
|
|
|
105
126
|
return store.findAdaptiveRule(current.project_slug, current.pattern);
|
|
106
127
|
};
|
|
107
128
|
|
|
108
|
-
store.pruneStaleRules = function pruneStaleRules(
|
|
109
|
-
|
|
129
|
+
store.pruneStaleRules = function pruneStaleRules(
|
|
130
|
+
maxAge_ms = 30 * 24 * 3600 * 1000,
|
|
131
|
+
minConfidence = 0.2,
|
|
132
|
+
) {
|
|
133
|
+
const cutoff =
|
|
134
|
+
Date.now() - clampRetentionMs(maxAge_ms, 30 * 24 * 3600 * 1000);
|
|
110
135
|
return statements.pruneRules.run(cutoff, minConfidence).changes;
|
|
111
136
|
};
|
|
112
137
|
|
|
113
138
|
// listAdaptiveRules: decayRules/getActiveAdaptiveRules에서 사용
|
|
114
|
-
const listStmt = store.db.prepare(
|
|
115
|
-
|
|
116
|
-
|
|
139
|
+
const listStmt = store.db.prepare(
|
|
140
|
+
"SELECT * FROM adaptive_rules WHERE project_slug = ? ORDER BY confidence DESC",
|
|
141
|
+
);
|
|
142
|
+
const listAllStmt = store.db.prepare(
|
|
143
|
+
"SELECT * FROM adaptive_rules ORDER BY confidence DESC",
|
|
144
|
+
);
|
|
145
|
+
const deleteRuleStmt = store.db.prepare(
|
|
146
|
+
"DELETE FROM adaptive_rules WHERE project_slug = ? AND pattern = ?",
|
|
147
|
+
);
|
|
117
148
|
|
|
118
149
|
store.listAdaptiveRules = function listAdaptiveRules(projectSlug) {
|
|
119
150
|
if (projectSlug) return listStmt.all(projectSlug).map(clone);
|
|
@@ -140,10 +171,12 @@ export async function createStoreAdapter(dbPath, options = {}) {
|
|
|
140
171
|
try {
|
|
141
172
|
const DatabaseCtor = await loadDatabase();
|
|
142
173
|
const store = createStore(dbPath, { DatabaseCtor });
|
|
143
|
-
store.type =
|
|
174
|
+
store.type = "sqlite";
|
|
144
175
|
return attachAdaptiveRuleStore(store);
|
|
145
176
|
} catch (error) {
|
|
146
|
-
console.warn(
|
|
177
|
+
console.warn(
|
|
178
|
+
`[store] SQLite unavailable (${error.message}), using in-memory fallback`,
|
|
179
|
+
);
|
|
147
180
|
return createMemoryStore();
|
|
148
181
|
}
|
|
149
182
|
}
|