Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* Build a runtime tarball fixture (`<target>.tgz`) whose internal layout
* matches what `provisionRuntime` extracts and verifies. Set `omitCoreLib`
* to leave one required core library out (an incomplete/corrupt payload).
*/
async
function
makeTarball
(
:
string
,
?
:
{
?
:
boolean
}
)
:
Promise
<
string
>
{
const
=
join
(
,
`src-${key}`
)
;
.
mkdirSync
(
join
(
,
'prebuilds'
,
)
,
{
:
true
}
)
;
.
writeFileSync
(
join
(
,
'prebuilds'
,
,
'foundry_local_napi.node'
)
,
'addon'
)
;
const
=
join
(
,
'foundry-local-core'
,
)
;
.
mkdirSync
(
,
{
:
true
}
)
;
const
=
requiredCoreLibraryNames
(
)
;
for
(
const
of
?.
?
.
slice
(
1
)
:
)
{
.
writeFileSync
(
join
(
,
)
,
'lib'
)
;
}
const
=
join
(
,
`${key}.tgz`
)
;
await
.
c
(
{
:
,
:
,
:
true
}
,
[
'prebuilds'
,
'foundry-local-core'
]
)
;
return
;
}
/**
* Serve `/<name>` → the file at `files[name]` (200), everything else 404.
* Records requested paths so `{target}` substitution can be asserted.
*/
async
function
startServer
(
:
<
string
,
string
>
)
:
Promise
<
{
:
string
;
:
string
[
]
;
dispose
:
(
)
=>
Promise
<
void
>
}
>
{
const
=
await
import
(
'http'
)
;
const
:
string
[
]
=
[
]
;
const
=
.
createServer
(
(
,
)
=>
{
const
=
(
.
??
''
)
.
replace
(
/^\//
,
''
)
;
.
push
(
)
;
const
=
[
]
;
if
(
!
||
!
.
existsSync
(
)
)
{
.
=
404
;
.
end
(
'not found'
)
;
return
;
}
.
=
200
;
.
createReadStream
(
)
.
pipe
(
)
;
}
)
;
await
new
Promise<void>
(
=>
.
listen
(
0
,
'127.0.0.1'
,
)
)
;
const
=
(
.
address
(
)
as
)
.
;
return
{
:
`http://127.0.0.1:${port}`
,
,
dispose
:
(
)
=>
new
Promise<void>
(
=>
.
close
(
(
)
=>
resolve
(
)
)
)
,
}
;
}
test
(
'provisionRuntime: substitutes {target}, extracts the expected layout, writes the marker'
,
async
(
)
=>
{
const
=
await
makeTarball
(
)
;
const
=
await
startServer
(
{
[
`${platformKey}.tgz`
]
:
}
)
;
try
{
const
=
join
(
,
'1.2.3'
)
;
await
provisionRuntime
(
,
,
`${server.url}/{target}.tgz`
,
'1.2.3'
,
.
)
;
// {target} was substituted with the platform key in the request URL.
.
deepStrictEqual
(
.
,
[
`${platformKey}.tgz`
]
)
;
// Payload extracted into the cache layout + completion marker written.
.
strictEqual
(
.
existsSync
(
join
(
,
'prebuilds'
,
,
'foundry_local_napi.node'
)
)
,
true
)
;
for
(
const
of
requiredCoreLibraryNames
(
)
)
{
.
strictEqual
(
.
existsSync
(
join
(
,
'foundry-local-core'
,
,
)
)
,
true
)
;
}
.
strictEqual
(
isRuntimeProvisioned
(
,
)
,
true
)
;
}
finally
{
await
.
dispose
(
)
;
}
}
)
;
test
(
'provisionRuntime: rejects and writes no marker when the download 404s'
,
async
(
)
=>
{
const
=
await
startServer
(
{
}
)
;
try
{
const
=
join
(
,
'1.2.3'
)
;
await
.
rejects
(
provisionRuntime
(
,
,
`${server.url}/{target}.tgz`
,
'1.2.3'
,
.
)
,
/status 404/
,
)
;
.
strictEqual
(
isRuntimeProvisioned
(
,
)
,
false
)
;
}
finally
{
await
.
dispose
(
)
;
}
}
)
;
test
(
'provisionRuntime: rejects an incomplete payload (missing core library) and writes no marker'