sootsim 0.1.268 → 0.1.270
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/README.md +7 -3
- package/detox/index.ts +5 -2
- package/dist-cli/bin.js +4 -4
- package/dist-cli/chunks/{agent-KQSZFG6R.js → agent-4YXUPSJ2.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-DLDQVS7O.js → agent-wrapper-BMJPWHWK.js} +2 -2
- package/dist-cli/chunks/{app-fonts-6XVNNHAB.js → app-fonts-EDRH6ETC.js} +2 -2
- package/dist-cli/chunks/{assert-DLGUW4JS.js → assert-CRDV324D.js} +2 -2
- package/dist-cli/chunks/{auth-MTSJWWMS.js → auth-WYRQIJEN.js} +2 -2
- package/dist-cli/chunks/beta-NBANSL2S.js +2 -0
- package/dist-cli/chunks/{camera-MGJUBHWZ.js → camera-5TO6IVBP.js} +3 -3
- package/dist-cli/chunks/{chunk-LJGOZ77E.js → chunk-2J3E5TPS.js} +1 -1
- package/dist-cli/chunks/{chunk-GUXMUE5A.js → chunk-3VIMSXQZ.js} +2 -2
- package/dist-cli/chunks/{chunk-YUDUKMJV.js → chunk-3ZOF2BTJ.js} +1 -1
- package/dist-cli/chunks/{chunk-RCU4A7LU.js → chunk-44ISBOEK.js} +3 -3
- package/dist-cli/chunks/{chunk-F7DMZRQX.js → chunk-4HPWZVBS.js} +1 -1
- package/dist-cli/chunks/{chunk-K5ZMEBMQ.js → chunk-557IYHPC.js} +1 -1
- package/dist-cli/chunks/{chunk-RG6QF6DY.js → chunk-5IHDZOMR.js} +1 -1
- package/dist-cli/chunks/{chunk-XIBSRCKK.js → chunk-6CI73D3X.js} +2 -2
- package/dist-cli/chunks/chunk-6JLIPPNB.js +2 -0
- package/dist-cli/chunks/{chunk-YMTVQA6W.js → chunk-74HIBIJQ.js} +4 -4
- package/dist-cli/chunks/{chunk-6TXGR4HK.js → chunk-ABSUFSOH.js} +2 -2
- package/dist-cli/chunks/{chunk-NPSDN7D7.js → chunk-AG563BSO.js} +2 -2
- package/dist-cli/chunks/{chunk-IWJTCFAE.js → chunk-AMA3YGJ5.js} +2 -2
- package/dist-cli/chunks/{chunk-EG3JCOGS.js → chunk-AMVYE3F4.js} +2 -2
- package/dist-cli/chunks/{chunk-LOOHTTDV.js → chunk-B5IBLYEO.js} +3 -3
- package/dist-cli/chunks/{chunk-M2LYCMW4.js → chunk-DCJXHSIA.js} +2 -2
- package/dist-cli/chunks/{chunk-ITQ7WKNC.js → chunk-ERXCR7NU.js} +2 -2
- package/dist-cli/chunks/{chunk-KR4LGQWN.js → chunk-FCMEOOQE.js} +2 -2
- package/dist-cli/chunks/{chunk-YNMYUJYR.js → chunk-FHPXOPMC.js} +2 -2
- package/dist-cli/chunks/{chunk-V27FSRID.js → chunk-FNBFRG64.js} +1 -1
- package/dist-cli/chunks/{chunk-5JH5F4TM.js → chunk-GAYG7AO4.js} +1 -1
- package/dist-cli/chunks/chunk-GQDQO3KU.js +5 -0
- package/dist-cli/chunks/{chunk-JERNRAFO.js → chunk-HWGKGIWE.js} +2 -2
- package/dist-cli/chunks/{chunk-YLMP3AEX.js → chunk-IIXRM6BB.js} +2 -2
- package/dist-cli/chunks/{chunk-EPKHW3XW.js → chunk-LHMVSKKD.js} +3 -3
- package/dist-cli/chunks/chunk-M32JVXHU.js +5 -0
- package/dist-cli/chunks/{chunk-FGKDYXO3.js → chunk-M5VURHXD.js} +1 -1
- package/dist-cli/chunks/{chunk-6YB3URLB.js → chunk-MD24VVKT.js} +2 -2
- package/dist-cli/chunks/{chunk-CWC7QMVM.js → chunk-MYBY7OHL.js} +1 -1
- package/dist-cli/chunks/{chunk-7XWLSCXZ.js → chunk-NTO6SKS5.js} +1 -1
- package/dist-cli/chunks/{chunk-H2WCONSC.js → chunk-OUKH6UGN.js} +1 -1
- package/dist-cli/chunks/{chunk-OOVGROTR.js → chunk-PDFKRVDC.js} +1 -1
- package/dist-cli/chunks/{chunk-74QJWGDX.js → chunk-SDKIUJUO.js} +2 -2
- package/dist-cli/chunks/chunk-SLR3HWMB.js +13 -0
- package/dist-cli/chunks/{chunk-WUOPQL2J.js → chunk-SW5HZ5LK.js} +1 -1
- package/dist-cli/chunks/{chunk-WT3OYHU7.js → chunk-TIONGRTA.js} +3 -3
- package/dist-cli/chunks/{chunk-EH3A54PO.js → chunk-TLNGREAA.js} +2 -2
- package/dist-cli/chunks/{chunk-5MIRQ65V.js → chunk-TMWNOQAA.js} +1 -1
- package/dist-cli/chunks/{chunk-3MZJ2KVR.js → chunk-TZH4VH32.js} +3 -3
- package/dist-cli/chunks/{chunk-FGY5ESGU.js → chunk-UPRCATUH.js} +2 -2
- package/dist-cli/chunks/chunk-XTTXSDDA.js +1 -0
- package/dist-cli/chunks/{chunk-ZTOWO5CK.js → chunk-YKK2QUGO.js} +1 -1
- package/dist-cli/chunks/{chunk-SV6D5FXN.js → chunk-ZTKDHPA6.js} +2 -2
- package/dist-cli/chunks/chunk-ZZH2AFPJ.js +1 -0
- package/dist-cli/chunks/cli-version-BLKUTVJ2.js +2 -0
- package/dist-cli/chunks/{compat-IVBKZVGH.js → compat-IZEDAAUW.js} +3 -3
- package/dist-cli/chunks/{config-PQ3KBTIM.js → config-I4CXZ6M7.js} +2 -2
- package/dist-cli/chunks/{control-BKTYM5XP.js → control-DVF7UL5D.js} +2 -2
- package/dist-cli/chunks/daemon-FPKQPSSY.js +2 -0
- package/dist-cli/chunks/{debug-HRR2LK2J.js → debug-5X2F2WRP.js} +3 -3
- package/dist-cli/chunks/{desktop-466O4AQA.js → desktop-JHEYQZGF.js} +3 -3
- package/dist-cli/chunks/{detox-UH44KHQJ.js → detox-W64UENQG.js} +2 -2
- package/dist-cli/chunks/{device-FZLXTC3W.js → device-ZBSW2EHS.js} +2 -2
- package/dist-cli/chunks/{diagnose-RJMRI27P.js → diagnose-WER4X3P5.js} +2 -2
- package/dist-cli/chunks/drivers-6P53DLMM.js +2 -0
- package/dist-cli/chunks/{film-VL66UAM3.js → film-TIXNUTR6.js} +3 -3
- package/dist-cli/chunks/flow-53XFDYLL.js +2 -0
- package/dist-cli/chunks/help-MPYJLD7I.js +2 -0
- package/dist-cli/chunks/{hidden-runtime-alias-3ZAR7GCH.js → hidden-runtime-alias-R3JH3INM.js} +2 -2
- package/dist-cli/chunks/{home-paths-S2GRJWV3.js → home-paths-CNNARPCT.js} +2 -2
- package/dist-cli/chunks/inspect-JBDDYUA5.js +2 -0
- package/dist-cli/chunks/install-desktop-BBP7AMK4.js +2 -0
- package/dist-cli/chunks/{login-TR3YAEA2.js → login-6NCCZ3CZ.js} +4 -4
- package/dist-cli/chunks/{logout-WPY2DOYZ.js → logout-C4VKXUH4.js} +2 -2
- package/dist-cli/chunks/{maestro-DSG7V2BA.js → maestro-ZRGFQ3MV.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-6KA7PCN5.js → maestro-generate-A5XZS5GC.js} +3 -3
- package/dist-cli/chunks/{mode-QUYGPNBW.js → mode-IFFZ55HM.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-TQZA65K3.js +2 -0
- package/dist-cli/chunks/{perf-ELBRUVVU.js → perf-44KZNTIV.js} +2 -2
- package/dist-cli/chunks/{record-6PDTULUN.js → record-GZLZNXYZ.js} +3 -3
- package/dist-cli/chunks/runtime-F4FCEPPB.js +2 -0
- package/dist-cli/chunks/{screenshot-command-E2A4VY6D.js → screenshot-command-GL3STSWK.js} +3 -3
- package/dist-cli/chunks/{screenshots-capture-TRCRHK2E.js → screenshots-capture-QSSBWHN6.js} +2 -2
- package/dist-cli/chunks/serve-AFK6X2Q3.js +42 -0
- package/dist-cli/chunks/{setup-5BHQNK2L.js → setup-DYSDNEUE.js} +3 -3
- package/dist-cli/chunks/{skills-NQLI6WXW.js → skills-YXWQ43PZ.js} +2 -2
- package/dist-cli/chunks/{storage-SKARYTYK.js → storage-C7IS5GTM.js} +2 -2
- package/dist-cli/chunks/store-LVF2C2XZ.js +2 -0
- package/dist-cli/chunks/telemetry-5V3OXY6C.js +2 -0
- package/dist-cli/chunks/{timeline-DYJ4GKGE.js → timeline-FDTIHQ5V.js} +2 -2
- package/dist-cli/chunks/{upgrade-PHUUE5QV.js → upgrade-VRQCFJEI.js} +2 -2
- package/dist-cli/chunks/upload-CRCPDN6G.js +2 -0
- package/dist-cli/chunks/{version-XQQSXS3E.js → version-MP6NKJ27.js} +2 -2
- package/dist-cli/chunks/web-XYPFJHKW.js +2 -0
- package/dist-cli/chunks/{what-happened-I2N3FFIV.js → what-happened-IM6UH24Q.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +10 -10
- package/dist-lib/agent-sessions.cjs +29 -13
- package/dist-lib/attached-projects.cjs +33 -13
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +23 -6
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +6 -4
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +110 -54
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +220 -148
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/agent-daemon-client.ts +2 -2
- package/src/agent-identity.ts +7 -5
- package/src/attached-projects.ts +35 -11
- package/src/bridge-constants.ts +23 -4
- package/src/host/agent-host.ts +63 -14
- package/src/{agentbus-prompt.ts → team-machine-prompt.ts} +13 -20
- package/dist-cli/chunks/beta-7R4DRB3R.js +0 -2
- package/dist-cli/chunks/chunk-2LWDKYJ3.js +0 -1
- package/dist-cli/chunks/chunk-346C7547.js +0 -2
- package/dist-cli/chunks/chunk-CD2GF6PV.js +0 -5
- package/dist-cli/chunks/chunk-PN2LR6T4.js +0 -5
- package/dist-cli/chunks/chunk-Y3IYHVEX.js +0 -13
- package/dist-cli/chunks/chunk-ZHSXFJ7W.js +0 -1
- package/dist-cli/chunks/cli-version-362THKXA.js +0 -2
- package/dist-cli/chunks/daemon-SCTA3HTZ.js +0 -2
- package/dist-cli/chunks/drivers-S7D5OZQN.js +0 -2
- package/dist-cli/chunks/flow-IM5OXO5S.js +0 -2
- package/dist-cli/chunks/help-G5CN3KXU.js +0 -2
- package/dist-cli/chunks/inspect-WI7GXOH5.js +0 -2
- package/dist-cli/chunks/install-desktop-PVBWQQHY.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-CROVHXTW.js +0 -2
- package/dist-cli/chunks/runtime-ITR3EUXS.js +0 -2
- package/dist-cli/chunks/serve-JLLSEZDN.js +0 -41
- package/dist-cli/chunks/store-VR5QRAYX.js +0 -2
- package/dist-cli/chunks/telemetry-PMYZDJGO.js +0 -2
- package/dist-cli/chunks/upload-OUKKXVNC.js +0 -2
- package/dist-cli/chunks/web-AZI3JODI.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -166,10 +166,10 @@ function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
166
166
|
sock.connect(port, "localhost");
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
function httpGet(port,
|
|
169
|
+
function httpGet(port, path9, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
170
170
|
return new Promise((resolve) => {
|
|
171
171
|
const req = import_http.default.request(
|
|
172
|
-
{ hostname: "localhost", port, path:
|
|
172
|
+
{ hostname: "localhost", port, path: path9, method, timeout, headers },
|
|
173
173
|
(res) => {
|
|
174
174
|
let body = "";
|
|
175
175
|
res.on("data", (c) => body += c.toString());
|
|
@@ -1172,8 +1172,8 @@ var SOOTSIM_RUNTIME_PRODUCT = {
|
|
|
1172
1172
|
var sootsimRuntime = createRuntimeDelivery(SOOTSIM_RUNTIME_PRODUCT);
|
|
1173
1173
|
|
|
1174
1174
|
// src/host/agent-host.ts
|
|
1175
|
-
var
|
|
1176
|
-
var
|
|
1175
|
+
var import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
1176
|
+
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
1177
1177
|
|
|
1178
1178
|
// src/agent-sessions.ts
|
|
1179
1179
|
var import_node_child_process2 = require("node:child_process");
|
|
@@ -1435,21 +1435,37 @@ function listSessions(projectId) {
|
|
|
1435
1435
|
const all = loadStore().agentSessions;
|
|
1436
1436
|
return projectId ? all.filter((s) => s.projectId === projectId) : all;
|
|
1437
1437
|
}
|
|
1438
|
-
function
|
|
1438
|
+
function applySessionStatusPatch(existing, patch, now = Date.now()) {
|
|
1439
|
+
return {
|
|
1440
|
+
...existing,
|
|
1441
|
+
...patch,
|
|
1442
|
+
id: existing.id,
|
|
1443
|
+
projectId: existing.projectId,
|
|
1444
|
+
createdAt: existing.createdAt,
|
|
1445
|
+
lastSeenAt: now
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
function updateSessionStatuses(updates) {
|
|
1449
|
+
if (updates.length === 0) return;
|
|
1439
1450
|
mutateStore((store) => {
|
|
1440
|
-
const
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
+
const now = Date.now();
|
|
1452
|
+
const indexById = new Map(
|
|
1453
|
+
store.agentSessions.map((session, index) => [session.id, index])
|
|
1454
|
+
);
|
|
1455
|
+
for (const { id, patch } of updates) {
|
|
1456
|
+
const idx = indexById.get(id);
|
|
1457
|
+
if (idx === void 0) continue;
|
|
1458
|
+
store.agentSessions[idx] = applySessionStatusPatch(
|
|
1459
|
+
store.agentSessions[idx],
|
|
1460
|
+
patch,
|
|
1461
|
+
now
|
|
1462
|
+
);
|
|
1463
|
+
}
|
|
1451
1464
|
});
|
|
1452
1465
|
}
|
|
1466
|
+
function updateSessionStatus(id, patch) {
|
|
1467
|
+
updateSessionStatuses([{ id, patch }]);
|
|
1468
|
+
}
|
|
1453
1469
|
async function seedFromDemoAppRegistry() {
|
|
1454
1470
|
const existing = loadStore().attachedProjects;
|
|
1455
1471
|
if (existing.length > 0) return;
|
|
@@ -1905,47 +1921,40 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
|
1905
1921
|
}
|
|
1906
1922
|
}
|
|
1907
1923
|
|
|
1908
|
-
// src/
|
|
1924
|
+
// src/team-machine-prompt.ts
|
|
1909
1925
|
var import_node_child_process3 = require("node:child_process");
|
|
1910
|
-
var import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
1911
|
-
var import_node_os2 = __toESM(require("node:os"), 1);
|
|
1912
|
-
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
1913
1926
|
|
|
1914
1927
|
// src/agent-identity.ts
|
|
1915
|
-
var
|
|
1916
|
-
function
|
|
1928
|
+
var TEAM_MACHINE_SESSION_RE = /^[A-Za-z0-9._:-]{1,160}$/;
|
|
1929
|
+
function teamMachineSessionIdFromCliIdentity(identity) {
|
|
1917
1930
|
if (!identity?.startsWith("AGENTBUS_SESSION:")) return null;
|
|
1918
1931
|
const sessionId = identity.slice("AGENTBUS_SESSION:".length).trim();
|
|
1919
|
-
if (!
|
|
1932
|
+
if (!TEAM_MACHINE_SESSION_RE.test(sessionId)) return null;
|
|
1920
1933
|
return sessionId;
|
|
1921
1934
|
}
|
|
1922
|
-
function
|
|
1923
|
-
return
|
|
1935
|
+
function isValidTeamMachineSessionId(sessionId) {
|
|
1936
|
+
return TEAM_MACHINE_SESSION_RE.test(sessionId);
|
|
1924
1937
|
}
|
|
1925
1938
|
|
|
1926
|
-
// src/
|
|
1927
|
-
function
|
|
1939
|
+
// src/team-machine-prompt.ts
|
|
1940
|
+
function formatTeamMachinePromptText(prompt) {
|
|
1928
1941
|
return typeof prompt.text === "string" ? prompt.text.trim() : "";
|
|
1929
1942
|
}
|
|
1930
|
-
function
|
|
1943
|
+
function resolveTeamMachineCommand(explicit) {
|
|
1931
1944
|
const fromArg = explicit?.trim();
|
|
1932
1945
|
if (fromArg) return fromArg;
|
|
1933
|
-
|
|
1934
|
-
if (fromEnv) return fromEnv;
|
|
1935
|
-
const localBin = import_node_path6.default.join(import_node_os2.default.homedir(), ".local", "bin", "agentbus");
|
|
1936
|
-
if (import_node_fs7.default.existsSync(localBin)) return localBin;
|
|
1937
|
-
return "agentbus";
|
|
1946
|
+
return "tm";
|
|
1938
1947
|
}
|
|
1939
|
-
async function
|
|
1948
|
+
async function sendPromptToTeamMachineSession(input) {
|
|
1940
1949
|
const sessionId = input.sessionId.trim();
|
|
1941
|
-
if (!
|
|
1942
|
-
throw new Error(`invalid
|
|
1950
|
+
if (!isValidTeamMachineSessionId(sessionId)) {
|
|
1951
|
+
throw new Error(`invalid Team Machine session id: ${sessionId || "<empty>"}`);
|
|
1943
1952
|
}
|
|
1944
|
-
const text =
|
|
1953
|
+
const text = formatTeamMachinePromptText(input.prompt);
|
|
1945
1954
|
if (!text) {
|
|
1946
1955
|
throw new Error("prompt text is empty");
|
|
1947
1956
|
}
|
|
1948
|
-
const command =
|
|
1957
|
+
const command = resolveTeamMachineCommand(input.command);
|
|
1949
1958
|
const timeoutMs = input.timeoutMs ?? 15e3;
|
|
1950
1959
|
await new Promise((resolve, reject) => {
|
|
1951
1960
|
const child = (0, import_node_child_process3.spawn)(command, ["send", sessionId, text], {
|
|
@@ -1958,7 +1967,7 @@ async function sendPromptToAgentbusSession(input) {
|
|
|
1958
1967
|
child.kill("SIGTERM");
|
|
1959
1968
|
} catch {
|
|
1960
1969
|
}
|
|
1961
|
-
reject(new Error(`
|
|
1970
|
+
reject(new Error(`tm send timed out after ${Math.round(timeoutMs / 1e3)}s`));
|
|
1962
1971
|
}, timeoutMs);
|
|
1963
1972
|
child.stderr?.setEncoding("utf8");
|
|
1964
1973
|
child.stderr?.on("data", (chunk) => {
|
|
@@ -1977,7 +1986,7 @@ async function sendPromptToAgentbusSession(input) {
|
|
|
1977
1986
|
const detail = stderr.trim();
|
|
1978
1987
|
reject(
|
|
1979
1988
|
new Error(
|
|
1980
|
-
detail || `
|
|
1989
|
+
detail || `tm send exited with ${signal ? `signal ${signal}` : `code ${code ?? "unknown"}`}`
|
|
1981
1990
|
)
|
|
1982
1991
|
);
|
|
1983
1992
|
});
|
|
@@ -1986,6 +1995,7 @@ async function sendPromptToAgentbusSession(input) {
|
|
|
1986
1995
|
|
|
1987
1996
|
// src/host/agent-host.ts
|
|
1988
1997
|
var WS_OPEN = 1;
|
|
1998
|
+
var SESSION_STATUS_PERSIST_DELAY_MS = 25;
|
|
1989
1999
|
function defaultExcludePorts() {
|
|
1990
2000
|
return [
|
|
1991
2001
|
Number(process.env.VITE_PORT_WEB || process.env.PORT || 3e3),
|
|
@@ -2014,6 +2024,12 @@ var AgentHost = class {
|
|
|
2014
2024
|
// in-memory count so session status stays `working` until that backlog
|
|
2015
2025
|
// truly drains.
|
|
2016
2026
|
pendingTurns = /* @__PURE__ */ new Map();
|
|
2027
|
+
// status fan-out is realtime state. keep the current value in memory and
|
|
2028
|
+
// batch its durable store write so an fsync cannot delay the websocket event
|
|
2029
|
+
// it describes. close() flushes the final batch synchronously.
|
|
2030
|
+
pendingSessionStates = /* @__PURE__ */ new Map();
|
|
2031
|
+
pendingSessionPatches = /* @__PURE__ */ new Map();
|
|
2032
|
+
sessionStatusPersistTimer = null;
|
|
2017
2033
|
opts;
|
|
2018
2034
|
constructor(opts = {}) {
|
|
2019
2035
|
this.opts = opts;
|
|
@@ -2064,6 +2080,11 @@ var AgentHost = class {
|
|
|
2064
2080
|
/** terminate every subscription and drop every socket reference. called
|
|
2065
2081
|
* by the bridge host during shutdown. */
|
|
2066
2082
|
close() {
|
|
2083
|
+
if (this.sessionStatusPersistTimer) {
|
|
2084
|
+
clearTimeout(this.sessionStatusPersistTimer);
|
|
2085
|
+
this.sessionStatusPersistTimer = null;
|
|
2086
|
+
}
|
|
2087
|
+
this.flushSessionStatuses();
|
|
2067
2088
|
for (const sub of this.subscriptions.values()) {
|
|
2068
2089
|
try {
|
|
2069
2090
|
sub.unsubscribe();
|
|
@@ -2132,18 +2153,18 @@ var AgentHost = class {
|
|
|
2132
2153
|
if (!lease || lease.kind !== "cli" || lease.expiresAt <= Date.now()) {
|
|
2133
2154
|
throw new AgentSessionError("NO_CLAIM", `sim ${simId} has no active CLI claim`);
|
|
2134
2155
|
}
|
|
2135
|
-
const sessionId =
|
|
2156
|
+
const sessionId = teamMachineSessionIdFromCliIdentity(lease.cliIdentityKey);
|
|
2136
2157
|
if (!sessionId) {
|
|
2137
2158
|
throw new AgentSessionError(
|
|
2138
2159
|
"UNSUPPORTED_CLAIM",
|
|
2139
2160
|
`sim ${simId} is claimed by a CLI identity that is not promptable`
|
|
2140
2161
|
);
|
|
2141
2162
|
}
|
|
2142
|
-
await
|
|
2163
|
+
await sendPromptToTeamMachineSession({
|
|
2143
2164
|
sessionId,
|
|
2144
2165
|
prompt: this.normalizePromptEnvelope(msg)
|
|
2145
2166
|
});
|
|
2146
|
-
return { ok: true, routed: "
|
|
2167
|
+
return { ok: true, routed: "team-machine", sessionId };
|
|
2147
2168
|
}
|
|
2148
2169
|
async doStartSession(input) {
|
|
2149
2170
|
const project = findProjectById(input.projectId);
|
|
@@ -2174,7 +2195,7 @@ var AgentHost = class {
|
|
|
2174
2195
|
);
|
|
2175
2196
|
const project = upsertProject({
|
|
2176
2197
|
cwd: match.cwd,
|
|
2177
|
-
name: match.projectName ??
|
|
2198
|
+
name: match.projectName ?? import_node_path6.default.basename(match.cwd),
|
|
2178
2199
|
preferredProvider: input.provider ?? existing?.preferredProvider,
|
|
2179
2200
|
sourceRoots: existing?.sourceRoots ?? [match.cwd],
|
|
2180
2201
|
knownBundleUrls,
|
|
@@ -2185,18 +2206,18 @@ var AgentHost = class {
|
|
|
2185
2206
|
}
|
|
2186
2207
|
getTranscript(sessionId) {
|
|
2187
2208
|
const p = transcriptPath(sessionId);
|
|
2188
|
-
if (!
|
|
2209
|
+
if (!import_node_fs7.default.existsSync(p)) {
|
|
2189
2210
|
return { error: "transcript not found", code: "NO_TRANSCRIPT" };
|
|
2190
2211
|
}
|
|
2191
|
-
return
|
|
2212
|
+
return import_node_fs7.default.readFileSync(p, "utf8");
|
|
2192
2213
|
}
|
|
2193
2214
|
getPaths() {
|
|
2194
2215
|
const dir = getUserDataDir();
|
|
2195
2216
|
return {
|
|
2196
2217
|
userDataDir: dir,
|
|
2197
|
-
storeFile:
|
|
2198
|
-
sessionsDir:
|
|
2199
|
-
transcriptsDir:
|
|
2218
|
+
storeFile: import_node_path6.default.join(dir, "attached-projects.json"),
|
|
2219
|
+
sessionsDir: import_node_path6.default.join(dir, "sessions"),
|
|
2220
|
+
transcriptsDir: import_node_path6.default.join(dir, "transcripts")
|
|
2200
2221
|
};
|
|
2201
2222
|
}
|
|
2202
2223
|
// --- subscription management ---
|
|
@@ -2376,10 +2397,45 @@ var AgentHost = class {
|
|
|
2376
2397
|
}
|
|
2377
2398
|
}
|
|
2378
2399
|
patchSession(sessionId, patch) {
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2400
|
+
const existing = this.pendingSessionStates.get(sessionId) ?? findSessionById(sessionId);
|
|
2401
|
+
if (!existing) return;
|
|
2402
|
+
const updated = applySessionStatusPatch(existing, patch);
|
|
2403
|
+
this.pendingSessionStates.set(sessionId, updated);
|
|
2404
|
+
this.pendingSessionPatches.set(sessionId, {
|
|
2405
|
+
...this.pendingSessionPatches.get(sessionId),
|
|
2406
|
+
...patch
|
|
2407
|
+
});
|
|
2408
|
+
this.broadcastSessionStatus(updated);
|
|
2409
|
+
if (this.sessionStatusPersistTimer) return;
|
|
2410
|
+
this.sessionStatusPersistTimer = setTimeout(() => {
|
|
2411
|
+
this.sessionStatusPersistTimer = null;
|
|
2412
|
+
this.flushSessionStatuses();
|
|
2413
|
+
}, SESSION_STATUS_PERSIST_DELAY_MS);
|
|
2414
|
+
}
|
|
2415
|
+
flushSessionStatuses() {
|
|
2416
|
+
if (this.pendingSessionPatches.size === 0) return;
|
|
2417
|
+
const pendingStates = this.pendingSessionStates;
|
|
2418
|
+
const pendingPatches = this.pendingSessionPatches;
|
|
2419
|
+
this.pendingSessionStates = /* @__PURE__ */ new Map();
|
|
2420
|
+
this.pendingSessionPatches = /* @__PURE__ */ new Map();
|
|
2421
|
+
try {
|
|
2422
|
+
updateSessionStatuses([...pendingPatches].map(([id, patch]) => ({ id, patch })));
|
|
2423
|
+
} catch (error) {
|
|
2424
|
+
for (const [id, session] of pendingStates) {
|
|
2425
|
+
if (!this.pendingSessionStates.has(id)) {
|
|
2426
|
+
this.pendingSessionStates.set(id, session);
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
for (const [id, patch] of pendingPatches) {
|
|
2430
|
+
this.pendingSessionPatches.set(id, {
|
|
2431
|
+
...patch,
|
|
2432
|
+
...this.pendingSessionPatches.get(id)
|
|
2433
|
+
});
|
|
2434
|
+
}
|
|
2435
|
+
process.stderr.write(
|
|
2436
|
+
`[sootsim-agent] session status persistence failed: ${error instanceof Error ? error.message : String(error)}
|
|
2437
|
+
`
|
|
2438
|
+
);
|
|
2383
2439
|
}
|
|
2384
2440
|
}
|
|
2385
2441
|
coalescePromptEcho(sessionId, event) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/host/fetch-proxy-overrides.ts
|
|
4
4
|
var FETCH_PROXY_BROWSER_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/menu.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/menu.mjs
CHANGED
package/dist-lib/metro.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/profiles.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/render-mode.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/sdk.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/sdk.mjs
CHANGED