acrylblends 0.0.0-stage → 0.2.0
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/bin/acrylblends.js +4 -0
- package/dist/index.d.ts +117 -0
- package/dist/index.js +434 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -4
- package/plugins/agent/agent.ts +152 -0
- package/plugins/agent/index.ts +20 -0
- package/plugins/agent/memory.ts +24 -0
- package/plugins/agent/model.ts +79 -0
- package/plugins/agent/plugin.json +10 -0
- package/plugins/agent/tools.ts +50 -0
- package/plugins/builder/index.ts +193 -0
- package/plugins/builder/plugin.json +11 -0
- package/plugins/builder/script.ts +162 -0
- package/plugins/events/index.ts +42 -0
- package/plugins/events/plugin.json +9 -0
- package/plugins/extensions/index.ts +738 -0
- package/plugins/extensions/ledger.ts +39 -0
- package/plugins/extensions/plugin.json +12 -0
- package/plugins/extensions/resolve.ts +30 -0
- package/plugins/extensions/stage.ts +44 -0
- package/plugins/http/index.ts +64 -0
- package/plugins/http/plugin.json +10 -0
- package/plugins/instance/index.ts +167 -0
- package/plugins/instance/plugin.json +10 -0
- package/plugins/manifest/index.ts +635 -0
- package/plugins/manifest/lock.ts +94 -0
- package/plugins/manifest/plugin.json +13 -0
- package/plugins/manifest/upgrade-cli.ts +70 -0
- package/plugins/manifest/upgrade.ts +97 -0
- package/plugins/openai/index.ts +159 -0
- package/plugins/openai/plugin.json +11 -0
- package/plugins/openai/prompt.ts +31 -0
- package/plugins/sandbox/index.ts +150 -0
- package/plugins/sandbox/plugin.json +8 -0
- package/plugins/sandbox/runner.mjs +18 -0
- package/plugins/save/cli.ts +19 -0
- package/plugins/save/index.ts +55 -0
- package/plugins/save/plugin.json +12 -0
- package/plugins/server/index.ts +138 -0
- package/plugins/server/plugin.json +10 -0
- package/plugins/settings/index.ts +270 -0
- package/plugins/settings/merge.ts +79 -0
- package/plugins/settings/plugin.json +13 -0
- package/plugins/tasks/index.ts +232 -0
- package/plugins/tasks/plugin.json +11 -0
- package/plugins/tasks/store.ts +86 -0
- package/plugins/tsconfig.json +19 -0
- package/templates/agent/Dockerfile +15 -0
- package/templates/agent/README.md +52 -0
- package/templates/agent/blend.yaml +58 -0
- package/templates/agent/dockerignore +3 -0
- package/templates/agent/gitignore +2 -0
- package/templates/agent/package.json +23 -0
- package/templates/agent/src/app.ts +98 -0
- package/templates/agent/src/main.ts +25 -0
- package/templates/agent/src/routes.ts +62 -0
- package/templates/agent/template.json +16 -0
- package/templates/agent/test/agent.test.ts +45 -0
- package/templates/agent/test/app.test.ts +46 -0
- package/templates/agent/test/builder.test.ts +186 -0
- package/templates/agent/test/model.test.ts +89 -0
- package/templates/agent/tsconfig.json +19 -0
- package/templates/app/README.md +26 -0
- package/templates/app/blend.yaml +23 -0
- package/templates/app/gitignore +2 -0
- package/templates/app/package.json +23 -0
- package/templates/app/src/app.ts +61 -0
- package/templates/app/src/main.ts +20 -0
- package/templates/app/src/routes.ts +14 -0
- package/templates/app/template.json +1 -0
- package/templates/app/test/app.test.ts +56 -0
- package/templates/app/tsconfig.json +19 -0
- package/README.md +0 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import assert from 'node:assert/strict'
|
|
2
|
+
import { mkdtemp, rm } from 'node:fs/promises'
|
|
3
|
+
import { tmpdir } from 'node:os'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
import { test } from 'node:test'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
import { type App, createApp } from '../src/app.ts'
|
|
8
|
+
import { pinnedInstance, withPort } from '../src/plugins/instance/index.ts'
|
|
9
|
+
import { APP_NAME } from '../src/routes.ts'
|
|
10
|
+
|
|
11
|
+
const projectRoot = fileURLToPath(new URL('..', import.meta.url))
|
|
12
|
+
|
|
13
|
+
/** Boot the app in a throwaway home on any free port, run the test, always stop it and remove the home. */
|
|
14
|
+
async function withApp(run: (app: App) => Promise<void>) {
|
|
15
|
+
const home = await mkdtemp(join(tmpdir(), 'app-test-'))
|
|
16
|
+
const app = await createApp(withPort(pinnedInstance(home, { root: projectRoot }), 0))
|
|
17
|
+
try {
|
|
18
|
+
await run(app)
|
|
19
|
+
} finally {
|
|
20
|
+
await app.stop()
|
|
21
|
+
await rm(home, { recursive: true, force: true })
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
test('serves the index route', () =>
|
|
26
|
+
withApp(async (app) => {
|
|
27
|
+
const response = await fetch(`${app.url}/`)
|
|
28
|
+
assert.equal(response.status, 200)
|
|
29
|
+
assert.deepEqual(await response.json(), { app: APP_NAME, ok: true })
|
|
30
|
+
}))
|
|
31
|
+
|
|
32
|
+
test('answers health checks and 404 for unknown paths', () =>
|
|
33
|
+
withApp(async (app) => {
|
|
34
|
+
assert.equal((await fetch(`${app.url}/health`)).status, 200)
|
|
35
|
+
const missing = await fetch(`${app.url}/nope`)
|
|
36
|
+
assert.equal(missing.status, 404)
|
|
37
|
+
await missing.body?.cancel()
|
|
38
|
+
}))
|
|
39
|
+
|
|
40
|
+
test('stops listening when stopped', async () => {
|
|
41
|
+
const home = await mkdtemp(join(tmpdir(), 'app-test-'))
|
|
42
|
+
const app = await createApp(withPort(pinnedInstance(home, { root: projectRoot }), 0))
|
|
43
|
+
await app.stop()
|
|
44
|
+
await assert.rejects(fetch(`${app.url}/health`))
|
|
45
|
+
await rm(home, { recursive: true, force: true })
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
test('the manifest decides what is mounted: a parameter changes the server, an unknown value is refused', async () => {
|
|
49
|
+
const { readManifest } = await import('../src/app.ts')
|
|
50
|
+
const manifest = readManifest()
|
|
51
|
+
assert.deepEqual(
|
|
52
|
+
manifest.plugins.map((row) => row.id),
|
|
53
|
+
['http', 'routes', 'server'],
|
|
54
|
+
)
|
|
55
|
+
assert.throws(() => readManifest({ nothing: 1 }), /parameter-override-unknown/)
|
|
56
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"lib": ["ES2023"],
|
|
5
|
+
"module": "NodeNext",
|
|
6
|
+
"moduleResolution": "NodeNext",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noUncheckedIndexedAccess": true,
|
|
9
|
+
"exactOptionalPropertyTypes": true,
|
|
10
|
+
"noImplicitOverride": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"erasableSyntaxOnly": true,
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"types": ["node"]
|
|
17
|
+
},
|
|
18
|
+
"include": ["src", "test"]
|
|
19
|
+
}
|
package/README.md
DELETED