sootsim 0.1.175 → 0.1.177
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/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/{agent-A4WFJEFV.js → agent-3BCITLIZ.js} +3 -3
- package/dist-cli/chunks/{agent-wrapper-EOZBE6UT.js → agent-wrapper-26RIZVGD.js} +2 -2
- package/dist-cli/chunks/{app-fonts-H2I7IV7N.js → app-fonts-JVDHATQE.js} +2 -2
- package/dist-cli/chunks/{assert-36QXQUCE.js → assert-IT2OXM4Y.js} +2 -2
- package/dist-cli/chunks/beta-SPH73CAA.js +2 -0
- package/dist-cli/chunks/{camera-7HK2Y3PY.js → camera-ZYVEUCIO.js} +2 -2
- package/dist-cli/chunks/{chunk-2QTAUBZX.js → chunk-3L6I2M2Z.js} +3 -3
- package/dist-cli/chunks/chunk-4INGTBO7.js +4 -0
- package/dist-cli/chunks/{chunk-EEIUS5AS.js → chunk-4JESO36F.js} +4 -4
- package/dist-cli/chunks/{chunk-HWUFW3IP.js → chunk-4YNKFN2A.js} +2 -2
- package/dist-cli/chunks/{chunk-V7AGBG2P.js → chunk-52O56BTW.js} +2 -2
- package/dist-cli/chunks/{chunk-ZZWAHZ37.js → chunk-64QAFSY7.js} +1 -1
- package/dist-cli/chunks/{chunk-OMJ2DTQJ.js → chunk-65ZBQDQM.js} +2 -2
- package/dist-cli/chunks/{chunk-DV6SWCY7.js → chunk-A2WASN2L.js} +1 -1
- package/dist-cli/chunks/{chunk-H2J4Z7LY.js → chunk-A3VHHWLU.js} +2 -2
- package/dist-cli/chunks/{chunk-UMJDCX2P.js → chunk-AN4DM7IB.js} +2 -2
- package/dist-cli/chunks/{chunk-5QLWXLML.js → chunk-ATVKVVHZ.js} +2 -2
- package/dist-cli/chunks/chunk-B6GISAUX.js +1 -0
- package/dist-cli/chunks/{chunk-P2WO5LMI.js → chunk-BTTZN2SN.js} +2 -2
- package/dist-cli/chunks/{chunk-LYZXARZO.js → chunk-C5QOGCVN.js} +2 -2
- package/dist-cli/chunks/{chunk-RCPMRHTK.js → chunk-CH3MWM5W.js} +1 -1
- package/dist-cli/chunks/{chunk-7F2LH7U5.js → chunk-CHTYIQLE.js} +2 -2
- package/dist-cli/chunks/{chunk-SV3SRWN5.js → chunk-CUO7F2JE.js} +1 -1
- package/dist-cli/chunks/{chunk-YMBQBKKA.js → chunk-D2BBJUEY.js} +1 -1
- package/dist-cli/chunks/chunk-DGDBEXXQ.js +1 -0
- package/dist-cli/chunks/{chunk-3SUIAUIY.js → chunk-IBSEFPPL.js} +1 -1
- package/dist-cli/chunks/{chunk-ZPQY5DBY.js → chunk-JFLNZGDS.js} +2 -2
- package/dist-cli/chunks/{chunk-4UATZVHM.js → chunk-JHYLPDCC.js} +2 -2
- package/dist-cli/chunks/{chunk-XDDO46ZW.js → chunk-JS3NH2SJ.js} +1 -1
- package/dist-cli/chunks/{chunk-UXZRHPX6.js → chunk-JS7SSYDG.js} +2 -2
- package/dist-cli/chunks/{chunk-HWJ52K4J.js → chunk-JXO6UPGI.js} +1 -1
- package/dist-cli/chunks/{chunk-MLLINRL2.js → chunk-LTZPVG65.js} +1 -1
- package/dist-cli/chunks/{chunk-GJQGKFLY.js → chunk-NOLQYF76.js} +1 -1
- package/dist-cli/chunks/{chunk-2J67UJXT.js → chunk-NYGESF6F.js} +1 -1
- package/dist-cli/chunks/{chunk-QK76RK6J.js → chunk-NZWTC6K6.js} +1 -1
- package/dist-cli/chunks/{chunk-NPZPBSZD.js → chunk-PAU64XFG.js} +1 -1
- package/dist-cli/chunks/{chunk-IKJSGKUB.js → chunk-PL3ALTWB.js} +2 -2
- package/dist-cli/chunks/{chunk-ZG2A6LCL.js → chunk-QWZFOMCI.js} +2 -2
- package/dist-cli/chunks/{chunk-Y3OHYOFS.js → chunk-SNLUVL3H.js} +2 -2
- package/dist-cli/chunks/{chunk-KSF72FPP.js → chunk-SU3JJ7ER.js} +2 -2
- package/dist-cli/chunks/{chunk-XBK3XAKL.js → chunk-TVFHGWTW.js} +2 -2
- package/dist-cli/chunks/{chunk-JCQEG4R6.js → chunk-UBJQDMDG.js} +2 -2
- package/dist-cli/chunks/{chunk-VW643HG5.js → chunk-UJN3FMEX.js} +2 -2
- package/dist-cli/chunks/chunk-WKG5J4RD.js +2 -0
- package/dist-cli/chunks/{chunk-IISA6UXR.js → chunk-WRHJEI7Y.js} +1 -1
- package/dist-cli/chunks/{chunk-4UGD4KJM.js → chunk-WUEKKZ7Z.js} +2 -2
- package/dist-cli/chunks/{chunk-5D4PHINP.js → chunk-Y2637KG7.js} +1 -1
- package/dist-cli/chunks/chunk-YU6CNUJD.js +2 -0
- package/dist-cli/chunks/{chunk-46S56FJJ.js → chunk-YVDSGGOT.js} +1 -1
- package/dist-cli/chunks/{chunk-WM73SGMM.js → chunk-Z4IMGLHM.js} +2 -2
- package/dist-cli/chunks/{chunk-4PQ36DTJ.js → chunk-ZUTVEJVA.js} +3 -3
- package/dist-cli/chunks/cli-version-HENS6BZI.js +2 -0
- package/dist-cli/chunks/{compat-KWM6HXJD.js → compat-MNTQH57R.js} +3 -3
- package/dist-cli/chunks/{control-PVZRPH57.js → control-WQ7XEPCI.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-3YLLRNVG.js → cpu-profile-P27HBXOI.js} +2 -2
- package/dist-cli/chunks/daemon-WUAZELEI.js +2 -0
- package/dist-cli/chunks/{debug-TD4EVFT7.js → debug-ES4A3SZQ.js} +3 -3
- package/dist-cli/chunks/{detox-S7M5WN3L.js → detox-Q36B2553.js} +2 -2
- package/dist-cli/chunks/{device-WR7GA4RN.js → device-NA7TB4E6.js} +2 -2
- package/dist-cli/chunks/{diagnose-JZMNR25X.js → diagnose-DKW5WI3X.js} +2 -2
- package/dist-cli/chunks/drivers-RFOOGIRC.js +2 -0
- package/dist-cli/chunks/{electron-V2YDDVKJ.js → electron-6C2VDAZW.js} +3 -3
- package/dist-cli/chunks/flow-GSHP52QS.js +2 -0
- package/dist-cli/chunks/help-J6PF4PZX.js +2 -0
- package/dist-cli/chunks/{hints-OK373YOJ.js → hints-W7ZZ6KZE.js} +2 -2
- package/dist-cli/chunks/{home-paths-IFY5UTLL.js → home-paths-K4347S7C.js} +2 -2
- package/dist-cli/chunks/{inspect-LRIJ7MQT.js → inspect-ZPHNFMEX.js} +4 -4
- package/dist-cli/chunks/{install-desktop-ESQL2Q2T.js → install-desktop-ZCCPJMOF.js} +3 -3
- package/dist-cli/chunks/{keys-IHG2YEL3.js → keys-XM67H4SM.js} +2 -2
- package/dist-cli/chunks/{login-CYIWYJGG.js → login-O4OGJKYL.js} +4 -4
- package/dist-cli/chunks/{logout-NALFLZWI.js → logout-DWCBRMLM.js} +2 -2
- package/dist-cli/chunks/{maestro-QKSXVPWG.js → maestro-MEWENIGQ.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-O3XS3WXJ.js +2 -0
- package/dist-cli/chunks/{preview-XCQGBN2I.js → preview-VPWG4462.js} +2 -2
- package/dist-cli/chunks/{profile-RDAPVU7K.js → profile-R4CSGXYJ.js} +2 -2
- package/dist-cli/chunks/{react-MM373YNE.js → react-5LFUOYV5.js} +2 -2
- package/dist-cli/chunks/{record-SQA376Z7.js → record-MHAAYOWF.js} +2 -2
- package/dist-cli/chunks/runtime-R2PRKIZM.js +2 -0
- package/dist-cli/chunks/{screenshot-FCKW6JV6.js → screenshot-XAEO7EBF.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-QVRUJXZ3.js → screenshot-mode-QNR5ESKN.js} +2 -2
- package/dist-cli/chunks/{screenshots-ITBCSBZS.js → screenshots-Z6OSENKY.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-H4EAYFH3.js → screenshots-capture-3DJPYJUD.js} +2 -2
- package/dist-cli/chunks/{serve-3GHYSGJR.js → serve-IVTQFOFI.js} +16 -16
- package/dist-cli/chunks/{setup-ME5SRHWD.js → setup-AMRSL4IK.js} +2 -2
- package/dist-cli/chunks/{skills-E5JE3SAI.js → skills-K4DG2CIH.js} +2 -2
- package/dist-cli/chunks/{slides-D37ML4LI.js → slides-UIH7KXFR.js} +2 -2
- package/dist-cli/chunks/store-2JY2VLVA.js +2 -0
- package/dist-cli/chunks/telemetry-KNKROOT5.js +2 -0
- package/dist-cli/chunks/{test-CWWQJG5K.js → test-XUJ2V5ZX.js} +3 -3
- package/dist-cli/chunks/{three-mode-WESGARG5.js → three-mode-P6HSLJMD.js} +2 -2
- package/dist-cli/chunks/{timeline-RUVZASG4.js → timeline-YSUY4PHV.js} +2 -2
- package/dist-cli/chunks/{upgrade-DKWD6TSY.js → upgrade-YZMDFQIH.js} +2 -2
- package/dist-cli/chunks/upload-TIH2LID6.js +2 -0
- package/dist-cli/chunks/{version-G45RLONC.js → version-5QAMZ5CK.js} +2 -2
- package/dist-cli/chunks/{web-X2HCJQQE.js → web-LM3JSBQF.js} +2 -2
- package/dist-cli/chunks/{what-happened-5DBVOXKC.js → what-happened-NYVQ7KER.js} +2 -2
- package/dist-cli/chunks/{whoami-ZDT3RQOC.js → whoami-AAHH72FM.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +10 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- 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 +7 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +126 -12
- 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 +237 -102
- package/dist-lib/vite.cjs +1 -1
- package/package.json +7 -1
- package/src/agent-daemon-client.ts +13 -0
- package/src/agent-identity.ts +21 -0
- package/src/agentbus-prompt.ts +80 -0
- package/src/bridge-constants.ts +9 -0
- package/src/host/agent-host.ts +42 -0
- package/src/host/bridge-host.ts +14 -1
- package/src/native-seam-manifest.ts +11 -0
- package/dist-cli/chunks/beta-7FRVMDBH.js +0 -2
- package/dist-cli/chunks/chunk-3G5EE3ST.js +0 -2
- package/dist-cli/chunks/chunk-HCKTFQLK.js +0 -2
- package/dist-cli/chunks/chunk-ODISDSXU.js +0 -1
- package/dist-cli/chunks/chunk-RAESCYIA.js +0 -4
- package/dist-cli/chunks/chunk-URQSBUTU.js +0 -1
- package/dist-cli/chunks/cli-version-HCYSKPJO.js +0 -2
- package/dist-cli/chunks/daemon-2DT4QAJ4.js +0 -2
- package/dist-cli/chunks/drivers-UMQTPEMU.js +0 -2
- package/dist-cli/chunks/flow-CKXTFJJ7.js +0 -2
- package/dist-cli/chunks/help-OEMLUQMD.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-CIEW2ET7.js +0 -2
- package/dist-cli/chunks/runtime-CUNVH66R.js +0 -2
- package/dist-cli/chunks/store-UW5HH6DW.js +0 -2
- package/dist-cli/chunks/telemetry-KSBNWXNE.js +0 -2
- package/dist-cli/chunks/upload-LYANGCPB.js +0 -2
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.177 | (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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sootsim",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.177",
|
|
4
4
|
"description": "sootsim CLI + vite/metro plugins + skills registry. bridge client for driving the proprietary sootsim-engine over WebSocket.",
|
|
5
5
|
"author": "Tamagui LLC",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,6 +66,12 @@
|
|
|
66
66
|
"source": "./src/agent-daemon-client.ts",
|
|
67
67
|
"default": "./dist-lib/agent-daemon-client.cjs"
|
|
68
68
|
},
|
|
69
|
+
"./agent-identity": {
|
|
70
|
+
"source": "./src/agent-identity.ts",
|
|
71
|
+
"bun": "./src/agent-identity.ts",
|
|
72
|
+
"import": "./src/agent-identity.ts",
|
|
73
|
+
"default": "./dist-lib/agent-identity.cjs"
|
|
74
|
+
},
|
|
69
75
|
"./attached-projects": {
|
|
70
76
|
"source": "./src/attached-projects.ts",
|
|
71
77
|
"default": "./dist-lib/attached-projects.cjs"
|
|
@@ -165,6 +165,19 @@ export class AgentDaemonClient {
|
|
|
165
165
|
})
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
async sendClaimedPrompt(
|
|
169
|
+
simId: string,
|
|
170
|
+
prompt: AgentPromptEnvelope,
|
|
171
|
+
): Promise<{ ok: true; routed: 'agentbus'; sessionId: string }> {
|
|
172
|
+
return this.send<{ ok: true; routed: 'agentbus'; sessionId: string }>(
|
|
173
|
+
'agent:send-claimed-prompt',
|
|
174
|
+
{
|
|
175
|
+
simId,
|
|
176
|
+
prompt,
|
|
177
|
+
},
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
168
181
|
async endSession(sessionId: string): Promise<{ ok: true }> {
|
|
169
182
|
return this.send<{ ok: true }>('agent:end-session', { sessionId })
|
|
170
183
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const AGENTBUS_SESSION_RE = /^[A-Za-z0-9._:-]{1,160}$/
|
|
2
|
+
|
|
3
|
+
export function agentSessionIdFromCliIdentity(identity: string | null): string | null {
|
|
4
|
+
if (!identity) return null
|
|
5
|
+
const colon = identity.indexOf(':')
|
|
6
|
+
if (colon < 0) return identity.trim() || null
|
|
7
|
+
const source = identity.slice(0, colon)
|
|
8
|
+
const value = identity.slice(colon + 1).trim()
|
|
9
|
+
return source === 'SOOTSIM_CLI_IDENTITY' && value ? value : null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function agentbusSessionIdFromCliIdentity(identity: string | null): string | null {
|
|
13
|
+
if (!identity?.startsWith('AGENTBUS_SESSION:')) return null
|
|
14
|
+
const sessionId = identity.slice('AGENTBUS_SESSION:'.length).trim()
|
|
15
|
+
if (!AGENTBUS_SESSION_RE.test(sessionId)) return null
|
|
16
|
+
return sessionId
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function isValidAgentbusSessionId(sessionId: string): boolean {
|
|
20
|
+
return AGENTBUS_SESSION_RE.test(sessionId)
|
|
21
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process'
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import os from 'node:os'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import {
|
|
6
|
+
agentbusSessionIdFromCliIdentity,
|
|
7
|
+
isValidAgentbusSessionId,
|
|
8
|
+
} from './agent-identity.ts'
|
|
9
|
+
import type { AgentPromptEnvelope } from './agent-prompt.ts'
|
|
10
|
+
|
|
11
|
+
export { agentbusSessionIdFromCliIdentity } from './agent-identity.ts'
|
|
12
|
+
|
|
13
|
+
export function formatAgentbusPromptText(prompt: AgentPromptEnvelope): string {
|
|
14
|
+
return typeof prompt.text === 'string' ? prompt.text.trim() : ''
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function resolveAgentbusCommand(explicit?: string): string {
|
|
18
|
+
const fromArg = explicit?.trim()
|
|
19
|
+
if (fromArg) return fromArg
|
|
20
|
+
const fromEnv = process.env.AGENTBUS_COMMAND?.trim()
|
|
21
|
+
if (fromEnv) return fromEnv
|
|
22
|
+
const localBin = path.join(os.homedir(), '.local', 'bin', 'agentbus')
|
|
23
|
+
if (fs.existsSync(localBin)) return localBin
|
|
24
|
+
return 'agentbus'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function sendPromptToAgentbusSession(input: {
|
|
28
|
+
sessionId: string
|
|
29
|
+
prompt: AgentPromptEnvelope
|
|
30
|
+
command?: string
|
|
31
|
+
timeoutMs?: number
|
|
32
|
+
}): Promise<void> {
|
|
33
|
+
const sessionId = input.sessionId.trim()
|
|
34
|
+
if (!isValidAgentbusSessionId(sessionId)) {
|
|
35
|
+
throw new Error(`invalid agentbus session id: ${sessionId || '<empty>'}`)
|
|
36
|
+
}
|
|
37
|
+
const text = formatAgentbusPromptText(input.prompt)
|
|
38
|
+
if (!text) {
|
|
39
|
+
throw new Error('prompt text is empty')
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const command = resolveAgentbusCommand(input.command)
|
|
43
|
+
const timeoutMs = input.timeoutMs ?? 15_000
|
|
44
|
+
await new Promise<void>((resolve, reject) => {
|
|
45
|
+
const child = spawn(command, ['send', sessionId, text], {
|
|
46
|
+
stdio: ['ignore', 'ignore', 'pipe'],
|
|
47
|
+
env: process.env,
|
|
48
|
+
})
|
|
49
|
+
let stderr = ''
|
|
50
|
+
const timer = setTimeout(() => {
|
|
51
|
+
try {
|
|
52
|
+
child.kill('SIGTERM')
|
|
53
|
+
} catch {}
|
|
54
|
+
reject(new Error(`agentbus send timed out after ${Math.round(timeoutMs / 1000)}s`))
|
|
55
|
+
}, timeoutMs)
|
|
56
|
+
|
|
57
|
+
child.stderr?.setEncoding('utf8')
|
|
58
|
+
child.stderr?.on('data', (chunk) => {
|
|
59
|
+
if (stderr.length < 4000) stderr += String(chunk)
|
|
60
|
+
})
|
|
61
|
+
child.on('error', (err) => {
|
|
62
|
+
clearTimeout(timer)
|
|
63
|
+
reject(err)
|
|
64
|
+
})
|
|
65
|
+
child.on('exit', (code, signal) => {
|
|
66
|
+
clearTimeout(timer)
|
|
67
|
+
if (code === 0) {
|
|
68
|
+
resolve()
|
|
69
|
+
return
|
|
70
|
+
}
|
|
71
|
+
const detail = stderr.trim()
|
|
72
|
+
reject(
|
|
73
|
+
new Error(
|
|
74
|
+
detail ||
|
|
75
|
+
`agentbus send exited with ${signal ? `signal ${signal}` : `code ${code ?? 'unknown'}`}`,
|
|
76
|
+
),
|
|
77
|
+
)
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
}
|
package/src/bridge-constants.ts
CHANGED
|
@@ -82,6 +82,15 @@ export function resolveSootsimBridgePortForRuntimeLocation(
|
|
|
82
82
|
const hrefUrl = parseHrefUrl(input.href)
|
|
83
83
|
const httpPort = parsePort(input.httpPort) ?? parsePort(hrefUrl?.port)
|
|
84
84
|
if (httpPort === null) return DEFAULT_SOOTSIM_BRIDGE_PORT
|
|
85
|
+
if (
|
|
86
|
+
hrefUrl?.pathname.startsWith('/sootsim') &&
|
|
87
|
+
(hrefUrl.searchParams.has('embed') || hrefUrl.searchParams.has('nativePreview'))
|
|
88
|
+
) {
|
|
89
|
+
return resolveSootsimBridgePortForHttpPort({
|
|
90
|
+
httpPort,
|
|
91
|
+
baseHttpPort: SOOTBEAN_DEV_HTTP_BASE_PORT,
|
|
92
|
+
})
|
|
93
|
+
}
|
|
85
94
|
if (
|
|
86
95
|
hrefUrl?.pathname.startsWith('/sootsim') &&
|
|
87
96
|
httpPort >= SOOTSIM_SITE_DEV_HTTP_BASE_PORT &&
|
package/src/host/agent-host.ts
CHANGED
|
@@ -28,6 +28,10 @@ import {
|
|
|
28
28
|
transcriptPath,
|
|
29
29
|
type Provider,
|
|
30
30
|
} from '../agent-sessions.ts'
|
|
31
|
+
import {
|
|
32
|
+
agentbusSessionIdFromCliIdentity,
|
|
33
|
+
sendPromptToAgentbusSession,
|
|
34
|
+
} from '../agentbus-prompt.ts'
|
|
31
35
|
import {
|
|
32
36
|
deleteProject,
|
|
33
37
|
findProjectById,
|
|
@@ -64,6 +68,15 @@ export interface AgentHostOptions {
|
|
|
64
68
|
* the rest of the repo uses, so `sootsim serve` standalone does the
|
|
65
69
|
* right thing. */
|
|
66
70
|
getExcludePorts?: () => number[]
|
|
71
|
+
/** returns the active CLI lease for a sim. used only for prompt routing to
|
|
72
|
+
* an external agentbus-wrapped agent that claimed the tab. */
|
|
73
|
+
resolveCliLease?: (simId: string) => AgentCliLeaseSnapshot | null
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface AgentCliLeaseSnapshot {
|
|
77
|
+
kind: 'cli' | 'user-active'
|
|
78
|
+
cliIdentityKey: string
|
|
79
|
+
expiresAt: number
|
|
67
80
|
}
|
|
68
81
|
|
|
69
82
|
/** default excludes keep the dev-server scanner from hitting soot's own
|
|
@@ -183,6 +196,8 @@ export class AgentHost {
|
|
|
183
196
|
return listSessions(msg.projectId ? String(msg.projectId) : undefined)
|
|
184
197
|
case 'agent:start-session':
|
|
185
198
|
return this.doStartSession(msg.input ?? {})
|
|
199
|
+
case 'agent:send-claimed-prompt':
|
|
200
|
+
return this.sendClaimedPrompt(msg)
|
|
186
201
|
case 'agent:send-prompt': {
|
|
187
202
|
const sessionId = String(msg.sessionId)
|
|
188
203
|
const session = findSessionById(sessionId)
|
|
@@ -216,6 +231,33 @@ export class AgentHost {
|
|
|
216
231
|
|
|
217
232
|
// --- operation impls ---
|
|
218
233
|
|
|
234
|
+
private async sendClaimedPrompt(msg: any): Promise<{
|
|
235
|
+
ok: true
|
|
236
|
+
routed: 'agentbus'
|
|
237
|
+
sessionId: string
|
|
238
|
+
}> {
|
|
239
|
+
const simId = typeof msg.simId === 'string' ? msg.simId.trim() : ''
|
|
240
|
+
if (!simId) {
|
|
241
|
+
throw new AgentSessionError('NO_SIM', 'agent:send-claimed-prompt requires simId')
|
|
242
|
+
}
|
|
243
|
+
const lease = this.opts.resolveCliLease?.(simId) ?? null
|
|
244
|
+
if (!lease || lease.kind !== 'cli' || lease.expiresAt <= Date.now()) {
|
|
245
|
+
throw new AgentSessionError('NO_CLAIM', `sim ${simId} has no active CLI claim`)
|
|
246
|
+
}
|
|
247
|
+
const sessionId = agentbusSessionIdFromCliIdentity(lease.cliIdentityKey)
|
|
248
|
+
if (!sessionId) {
|
|
249
|
+
throw new AgentSessionError(
|
|
250
|
+
'UNSUPPORTED_CLAIM',
|
|
251
|
+
`sim ${simId} is claimed by a CLI identity that is not promptable`,
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
await sendPromptToAgentbusSession({
|
|
255
|
+
sessionId,
|
|
256
|
+
prompt: this.normalizePromptEnvelope(msg),
|
|
257
|
+
})
|
|
258
|
+
return { ok: true, routed: 'agentbus', sessionId }
|
|
259
|
+
}
|
|
260
|
+
|
|
219
261
|
private async doStartSession(input: {
|
|
220
262
|
projectId: string
|
|
221
263
|
provider?: Provider
|
package/src/host/bridge-host.ts
CHANGED
|
@@ -439,7 +439,20 @@ export class SootSimBridgeHost {
|
|
|
439
439
|
// respawned it forever.
|
|
440
440
|
this.portFallbackCount = Math.max(1, opts.portFallbackCount ?? 10)
|
|
441
441
|
this.openUrlHandler = opts.openUrl
|
|
442
|
-
this.agentHost = new AgentHost({
|
|
442
|
+
this.agentHost = new AgentHost({
|
|
443
|
+
getExcludePorts: opts.agentScanExcludes,
|
|
444
|
+
resolveCliLease: (simId) => {
|
|
445
|
+
const sim = this.sims.get(simId)
|
|
446
|
+
const lease = sim ? this.getActiveLease(sim) : null
|
|
447
|
+
return lease
|
|
448
|
+
? {
|
|
449
|
+
kind: lease.kind,
|
|
450
|
+
cliIdentityKey: lease.cliIdentityKey,
|
|
451
|
+
expiresAt: lease.expiresAt,
|
|
452
|
+
}
|
|
453
|
+
: null
|
|
454
|
+
},
|
|
455
|
+
})
|
|
443
456
|
this.sootbeanOrigin = opts.sootbeanOrigin?.replace(/\/$/, '') || null
|
|
444
457
|
this.simIdleReapTtlMs =
|
|
445
458
|
opts.simIdleReapTtlMs ?? SootSimBridgeHost.SIM_IDLE_REAP_TTL_MS
|
|
@@ -320,4 +320,15 @@ export const NATIVE_SEAM_MANIFEST: NativeSeamEntry[] = [
|
|
|
320
320
|
notes:
|
|
321
321
|
'expo-notifications native modules — routes scheduling/badge/installation-id through engine NotificationBus; tap callbacks fan out via the bus event emitters',
|
|
322
322
|
},
|
|
323
|
+
{
|
|
324
|
+
pkg: 'react-native-enriched-markdown',
|
|
325
|
+
seamBasenames: [
|
|
326
|
+
'EnrichedMarkdownTextNativeComponent',
|
|
327
|
+
'EnrichedMarkdownNativeComponent',
|
|
328
|
+
'EnrichedMarkdownTextInputNativeComponent',
|
|
329
|
+
],
|
|
330
|
+
target: seamPath('react-native-enriched-markdown'),
|
|
331
|
+
notes:
|
|
332
|
+
'generated Fabric markdown host components; upstream Streamdown/enriched-markdown JS runs unchanged',
|
|
333
|
+
},
|
|
323
334
|
]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.175 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.175 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{existsSync as D,mkdirSync as O,readFileSync as g,rmSync as s,writeFileSync as P}from"fs";import{tmpdir as R}from"os";import{dirname as x,join as A,resolve as v}from"path";import{execFileSync as I}from"child_process";import{readFileSync as S}from"fs";import{createRequire as _}from"module";var o=null;function u(r){o||(o=b());try{return o(r)}catch{return null}}function b(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return y();if(process.platform==="darwin"){let n=T();return n||C()}return()=>null}function y(){return r=>{try{let n=S(`/proc/${r}/stat`,"utf8"),t=n.lastIndexOf(")");if(t<0)return null;let i=n.slice(t+1).trim().split(/\s+/),e=Number(i[1]);return Number.isFinite(e)&&e>0?e:null}catch{return null}}}var N=3,d=216,E=16;function T(){if(!process.versions?.bun)return null;try{let r=_(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),i=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),e=Buffer.alloc(d);return a=>{if(Number(i.symbols.proc_pidinfo(a,N,0n,e,d))<=0)return null;let p=e.readUInt32LE(E);return p>0?p:null}}catch{return null}}function C(){return r=>{try{let t=I("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
|
-
`)[1];if(!t)return null;let i=t.trim().split(/\s+/),e=Number(i[2]);return Number.isFinite(e)&&e>1?e:null}catch{return null}}}var c=1,f="SOOTSIM_CLI_CURRENT_SIM_PATH",F=["SOOTSIM_CLI_IDENTITY","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"];function m(r,n=20){let t=u(r);if(!t||t<=1)return null;for(let i=0;i<n;i++){let e=u(t);if(!e||e<=1)return t;t=e}return t}function k(){for(let n of F){let t=process.env[n];if(t&&t.trim())return{key:`${n}:${t.trim()}`,source:n,stable:!0}}let r=m(process.ppid);return r&&r>1?{key:`gppid-${r}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function L(){return k().key}function J(){return m(process.ppid)}function l(){if(process.env[f])return v(process.env[f]);let r=L();return A(R(),`sootsim-current-sim-${r}.json`)}function h(){let r=l();if(!D(r))return null;try{let n=JSON.parse(g(r,"utf8"));return n.version!==c||typeof n.simId!="string"||!n.simId.trim()||typeof n.updatedAt!="string"?(s(r,{force:!0}),null):{version:c,simId:n.simId.trim(),updatedAt:n.updatedAt}}catch{return s(r,{force:!0}),null}}function j(){return h()?.simId||null}function K(r){let n=r.trim();if(!n)return;let t=l();O(x(t),{recursive:!0}),P(t,JSON.stringify({version:c,simId:n,updatedAt:new Date().toISOString()},null,2)+`
|
|
4
|
-
`)}function X(){s(l(),{force:!0})}export{k as a,L as b,J as c,j as d,K as e,X as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.175 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.175 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-XBK3XAKL.js";import"./chunk-Y3OHYOFS.js";import"./chunk-JCQEG4R6.js";import"./chunk-5QLWXLML.js";import"./chunk-HWUFW3IP.js";import"./chunk-DV6SWCY7.js";import"./chunk-UMJDCX2P.js";import"./chunk-7F2LH7U5.js";import"./chunk-3G5EE3ST.js";import"./chunk-HCKTFQLK.js";import"./chunk-RAESCYIA.js";import"./chunk-3SUIAUIY.js";import"./chunk-SV3SRWN5.js";import"./chunk-XDDO46ZW.js";import"./chunk-QK76RK6J.js";import"./chunk-ZZWAHZ37.js";export{c as daemonInstall,b as getDaemonServiceStatus,a as runDaemon,d as teardownDaemonService,e as teardownSootsimHome};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.175 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import"./chunk-URQSBUTU.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-4UATZVHM.js";import"./chunk-NPZPBSZD.js";import"./chunk-VW643HG5.js";import"./chunk-HWJ52K4J.js";import"./chunk-RAESCYIA.js";import"./chunk-3SUIAUIY.js";import"./chunk-ZZWAHZ37.js";export{e as ALL_DRIVERS,i as buildDriverListRows,a as chromiumDriver,b as electronDriver,f as getAllDrivers,g as getDriver,c as playwrightDriver,h as resolveDriver,d as systemDriver};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.175 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a as c,b as d,c as e,d as f}from"./chunk-4PQ36DTJ.js";import"./chunk-ZPQY5DBY.js";import"./chunk-ODISDSXU.js";import"./chunk-UXZRHPX6.js";import{c as a,d as b}from"./chunk-4UGD4KJM.js";import"./chunk-EEIUS5AS.js";import"./chunk-KSF72FPP.js";import"./chunk-H2J4Z7LY.js";import"./chunk-YMBQBKKA.js";import"./chunk-46S56FJJ.js";import"./chunk-4UATZVHM.js";import"./chunk-NPZPBSZD.js";import"./chunk-VW643HG5.js";import"./chunk-LYZXARZO.js";import"./chunk-V7AGBG2P.js";import"./chunk-2J67UJXT.js";import"./chunk-RCPMRHTK.js";import"./chunk-OMJ2DTQJ.js";import"./chunk-HWJ52K4J.js";import"./chunk-Y3OHYOFS.js";import"./chunk-JCQEG4R6.js";import"./chunk-7F2LH7U5.js";import"./chunk-3G5EE3ST.js";import"./chunk-HCKTFQLK.js";import"./chunk-RAESCYIA.js";import"./chunk-3SUIAUIY.js";import"./chunk-P2WO5LMI.js";import"./chunk-QK76RK6J.js";import"./chunk-ZZWAHZ37.js";export{c as discoverSootsimUrl,e as hoistLeadingSimFlag,a as parseFlowFile,f as runFlow,d as runFlowPlayback,b as validateFlowFile};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.175 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c}from"./chunk-5QLWXLML.js";import"./chunk-HWUFW3IP.js";import"./chunk-DV6SWCY7.js";import"./chunk-UMJDCX2P.js";import"./chunk-7F2LH7U5.js";import"./chunk-3G5EE3ST.js";import"./chunk-HCKTFQLK.js";import"./chunk-RAESCYIA.js";import"./chunk-3SUIAUIY.js";import"./chunk-SV3SRWN5.js";import"./chunk-XDDO46ZW.js";import"./chunk-QK76RK6J.js";import"./chunk-ZZWAHZ37.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.175 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a}from"./chunk-2QTAUBZX.js";import"./chunk-ZG2A6LCL.js";import"./chunk-OMJ2DTQJ.js";import"./chunk-HCKTFQLK.js";import"./chunk-RAESCYIA.js";import"./chunk-3SUIAUIY.js";import"./chunk-ZZWAHZ37.js";export{a as runRuntime};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.175 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c}from"./chunk-LYZXARZO.js";import"./chunk-V7AGBG2P.js";import"./chunk-2J67UJXT.js";import"./chunk-RCPMRHTK.js";import"./chunk-OMJ2DTQJ.js";import"./chunk-HWJ52K4J.js";import"./chunk-Y3OHYOFS.js";import"./chunk-JCQEG4R6.js";import"./chunk-HCKTFQLK.js";import"./chunk-RAESCYIA.js";import"./chunk-3SUIAUIY.js";import"./chunk-ZZWAHZ37.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
|