@womp/spark-agent 4.2.2 → 4.4.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/README.md +457 -457
- package/dist/agent-run.d.ts +1 -1
- package/dist/capabilities/flow.js +3 -3
- package/dist/capabilities/geometry.js +14 -14
- package/dist/capabilities/openscad-instructions.d.ts +1 -1
- package/dist/capabilities/openscad-instructions.js +2 -1
- package/dist/capabilities/operations.js +33 -32
- package/dist/capabilities/scene.js +76 -71
- package/dist/client.js +8 -0
- package/dist/geometry/schemas/backend-schema.json +3393 -3393
- package/dist/geometry/schemas/flowir-dialect.json +1023 -1023
- package/dist/geometry.js +6 -6
- package/dist/models.d.ts +12 -5
- package/dist/models.js +16 -7
- package/dist/pricing.js +15 -0
- package/dist/prompt.d.ts +1 -1
- package/dist/prompt.js +65 -70
- package/dist/scene-metadata.js +8 -8
- package/dist/sdk-scene-host.js +1 -3
- package/dist/server/express.js +9 -1
- package/dist/server/fixtures/materials/matte-blue.json +14 -14
- package/dist/server/fixtures/materials/polished-copper.json +14 -14
- package/dist/server/message-fold.d.ts +59 -0
- package/dist/server/message-fold.js +345 -0
- package/dist/server/scene-initialization.d.ts +3 -0
- package/dist/server/scene-initialization.js +44 -0
- package/dist/server/service.d.ts +18 -1
- package/dist/server/service.js +25 -17
- package/dist/server/sqlite-store.js +37 -37
- package/dist/server/standalone.js +3 -0
- package/dist/womp-scene-api.d.ts +2 -2
- package/dist/womp-scene-api.js +6 -7
- package/package.json +139 -139
- package/.env.example +0 -6
package/dist/womp-scene-api.js
CHANGED
|
@@ -200,8 +200,7 @@ export function createWompSceneApi(context) {
|
|
|
200
200
|
const actualParent = (parentId) => (parentId === 0 ? context.rootId : parentId);
|
|
201
201
|
const publicParent = (parentId) => parentId === null || parentId === context.rootId ? 0 : parentId;
|
|
202
202
|
const requireNode = (id) => {
|
|
203
|
-
context.requireNode(id);
|
|
204
|
-
return scene.getNode(id);
|
|
203
|
+
return context.requireNode(id) ?? scene.getNode(id);
|
|
205
204
|
};
|
|
206
205
|
const requireEditableTransform = (id) => {
|
|
207
206
|
const node = requireNode(id);
|
|
@@ -336,7 +335,7 @@ export function createWompSceneApi(context) {
|
|
|
336
335
|
throw new Error("Name cannot be empty");
|
|
337
336
|
if (Array.from(normalized).length > 120)
|
|
338
337
|
throw new Error("Name is too long (max 120 characters)");
|
|
339
|
-
const curve = metadataObject(scene.getSceneExt()[String(curveId)]);
|
|
338
|
+
const curve = metadataObject(scene.getSceneExt([String(curveId)])[String(curveId)]);
|
|
340
339
|
const points = metadataObject(curve.pointsExt);
|
|
341
340
|
scene.patchSceneExt([{
|
|
342
341
|
op: "add",
|
|
@@ -348,7 +347,7 @@ export function createWompSceneApi(context) {
|
|
|
348
347
|
[index]: { ...metadataObject(points[String(index)]), name: normalized },
|
|
349
348
|
},
|
|
350
349
|
},
|
|
351
|
-
}]);
|
|
350
|
+
}], { returnScene: false });
|
|
352
351
|
};
|
|
353
352
|
const addCurvePoint = (curveId, point, pointIndex) => {
|
|
354
353
|
const curve = requireCurve(curveId);
|
|
@@ -605,11 +604,11 @@ export function createWompSceneApi(context) {
|
|
|
605
604
|
nodeGetPos: nodePosition,
|
|
606
605
|
nodeGetLock: (id) => {
|
|
607
606
|
requireNode(id);
|
|
608
|
-
return Boolean(metadataObject(scene.getSceneExt()[String(id)]).locked);
|
|
607
|
+
return Boolean(metadataObject(scene.getSceneExt([String(id)])[String(id)]).locked);
|
|
609
608
|
},
|
|
610
609
|
nodeSetLock: (id, locked) => {
|
|
611
610
|
requireNode(id);
|
|
612
|
-
const current = metadataObject(scene.getSceneExt()[String(id)]);
|
|
611
|
+
const current = metadataObject(scene.getSceneExt([String(id)])[String(id)]);
|
|
613
612
|
scene.patchSceneExt([{ op: "add", path: `/${id}`, value: { ...current, locked: Boolean(locked) } }]);
|
|
614
613
|
},
|
|
615
614
|
nodeSetPos: (id, position) => {
|
|
@@ -849,7 +848,7 @@ export function createWompSceneApi(context) {
|
|
|
849
848
|
},
|
|
850
849
|
curvePointGetName: (curveId, pointIndex) => {
|
|
851
850
|
const index = requirePoint(curveId, pointIndex);
|
|
852
|
-
const points = metadataObject(metadataObject(scene.getSceneExt()[String(curveId)]).pointsExt);
|
|
851
|
+
const points = metadataObject(metadataObject(scene.getSceneExt([String(curveId)])[String(curveId)]).pointsExt);
|
|
853
852
|
const name = metadataObject(points[String(index)]).name;
|
|
854
853
|
return typeof name === "string" ? name : `Point ${index + 1}`;
|
|
855
854
|
},
|
package/package.json
CHANGED
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@womp/spark-agent",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "Portable skills-based AI agent with local and durable chat transports for Womp",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"bin": {
|
|
9
|
-
"spark-agent": "dist/cli.js",
|
|
10
|
-
"simple-bench": "dist/simple-bench-cli.js",
|
|
11
|
-
"agent-run": "dist/agent-run-cli.js"
|
|
12
|
-
},
|
|
13
|
-
"exports": {
|
|
14
|
-
"./browser": {
|
|
15
|
-
"types": "./dist/browser.d.ts",
|
|
16
|
-
"import": "./dist/browser.js",
|
|
17
|
-
"default": "./dist/browser.js"
|
|
18
|
-
},
|
|
19
|
-
"./capabilities": {
|
|
20
|
-
"types": "./dist/capabilities.d.ts",
|
|
21
|
-
"import": "./dist/capabilities.js",
|
|
22
|
-
"default": "./dist/capabilities.js"
|
|
23
|
-
},
|
|
24
|
-
"./kakapo": {
|
|
25
|
-
"types": "./dist/kakapo.d.ts",
|
|
26
|
-
"import": "./dist/kakapo.js",
|
|
27
|
-
"default": "./dist/kakapo.js"
|
|
28
|
-
},
|
|
29
|
-
"./geometry": {
|
|
30
|
-
"types": "./dist/geometry.d.ts",
|
|
31
|
-
"import": "./dist/geometry.js",
|
|
32
|
-
"default": "./dist/geometry.js"
|
|
33
|
-
},
|
|
34
|
-
"./openscad": {
|
|
35
|
-
"types": "./dist/openscad.d.ts",
|
|
36
|
-
"import": "./dist/openscad.js",
|
|
37
|
-
"default": "./dist/openscad.js"
|
|
38
|
-
},
|
|
39
|
-
"./quickjs": {
|
|
40
|
-
"types": "./dist/quickjs-executor.d.ts",
|
|
41
|
-
"import": "./dist/quickjs-executor.js",
|
|
42
|
-
"default": "./dist/quickjs-executor.js"
|
|
43
|
-
},
|
|
44
|
-
".": {
|
|
45
|
-
"types": "./dist/index.d.ts",
|
|
46
|
-
"import": "./dist/index.js",
|
|
47
|
-
"default": "./dist/index.js"
|
|
48
|
-
},
|
|
49
|
-
"./ui": {
|
|
50
|
-
"types": "./dist/ui.d.ts",
|
|
51
|
-
"import": "./dist/ui.js",
|
|
52
|
-
"default": "./dist/ui.js"
|
|
53
|
-
},
|
|
54
|
-
"./client": {
|
|
55
|
-
"types": "./dist/client.d.ts",
|
|
56
|
-
"import": "./dist/client.js",
|
|
57
|
-
"default": "./dist/client.js"
|
|
58
|
-
},
|
|
59
|
-
"./server": {
|
|
60
|
-
"types": "./dist/server/index.d.ts",
|
|
61
|
-
"import": "./dist/server/index.js",
|
|
62
|
-
"default": "./dist/server/index.js"
|
|
63
|
-
},
|
|
64
|
-
"./express": {
|
|
65
|
-
"types": "./dist/server/express.d.ts",
|
|
66
|
-
"import": "./dist/server/express.js",
|
|
67
|
-
"default": "./dist/server/express.js"
|
|
68
|
-
},
|
|
69
|
-
"./package.json": "./package.json"
|
|
70
|
-
},
|
|
71
|
-
"files": [
|
|
72
|
-
"dist/**/*.js",
|
|
73
|
-
"dist/**/*.d.ts",
|
|
74
|
-
"dist/server/fixtures/**/*.json",
|
|
75
|
-
"dist/geometry/schemas/**/*.json",
|
|
76
|
-
"README.md"
|
|
77
|
-
],
|
|
78
|
-
"sideEffects": false,
|
|
79
|
-
"engines": {
|
|
80
|
-
"node": ">=22.13"
|
|
81
|
-
},
|
|
82
|
-
"repository": {
|
|
83
|
-
"type": "git",
|
|
84
|
-
"url": "git+https://github.com/wompxyz/spark-agent.git"
|
|
85
|
-
},
|
|
86
|
-
"publishConfig": {
|
|
87
|
-
"access": "public"
|
|
88
|
-
},
|
|
89
|
-
"license": "MIT",
|
|
90
|
-
"scripts": {
|
|
91
|
-
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
92
|
-
"build": "yarn clean && node scripts/generate-skill-declarations.mjs && tsc -p tsconfig.json && node scripts/copy-fixtures.mjs",
|
|
93
|
-
"typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p web/tsconfig.json",
|
|
94
|
-
"lint": "yarn typecheck",
|
|
95
|
-
"dev": "yarn build && concurrently --kill-others \"yarn dev:server\" \"yarn dev:web\"",
|
|
96
|
-
"dev:server": "tsx src/cli.ts",
|
|
97
|
-
"simple-bench": "tsx src/simple-bench-cli.ts",
|
|
98
|
-
"agent-run": "tsx src/agent-run-cli.ts",
|
|
99
|
-
"dev:demo-account": "yarn build && concurrently --kill-others \"yarn dev:server --profile demo-account\" \"yarn dev:web\"",
|
|
100
|
-
"dev:web": "vite --config web/vite.config.ts",
|
|
101
|
-
"start": "node dist/cli.js",
|
|
102
|
-
"web:build": "yarn build && tsc --noEmit -p web/tsconfig.json && vite build --config web/vite.config.ts",
|
|
103
|
-
"test": "yarn build && tsx --tsconfig tsconfig.json --test test/**/*.test.ts && node --input-type=module -e \"await Promise.all([import('@womp/spark-agent'), import('@womp/spark-agent/ui'), import('@womp/spark-agent/client'), import('@womp/spark-agent/server'), import('@womp/spark-agent/express'), import('@womp/spark-agent/kakapo'), import('@womp/spark-agent/geometry'), import('@womp/spark-agent/openscad')])\"",
|
|
104
|
-
"test:live": "tsx --tsconfig tsconfig.json test/womp-scene-api.live.ts",
|
|
105
|
-
"prepack": "yarn build"
|
|
106
|
-
},
|
|
107
|
-
"dependencies": {
|
|
108
|
-
"@ai-sdk/anthropic": "4.0.50",
|
|
109
|
-
"@ai-sdk/google": "4.0.69",
|
|
110
|
-
"@ai-sdk/openai": "4.0.63",
|
|
111
|
-
"@jitl/quickjs-wasmfile-release-sync": "0.32.0",
|
|
112
|
-
"@womp/flowir": "0.3.0",
|
|
113
|
-
"@womp/kakapo-sdk": "0.
|
|
114
|
-
"ai": "7.0.95",
|
|
115
|
-
"eventsource-parser": "^3.0.6",
|
|
116
|
-
"express": "^5.2.1",
|
|
117
|
-
"lodash": "4.18.1",
|
|
118
|
-
"quickjs-emscripten-core": "0.32.0",
|
|
119
|
-
"zod": "4.5.4"
|
|
120
|
-
},
|
|
121
|
-
"devDependencies": {
|
|
122
|
-
"@ai-sdk/react": "^4.0.77",
|
|
123
|
-
"@types/express": "^5.0.5",
|
|
124
|
-
"@types/lodash": "4.17.24",
|
|
125
|
-
"@types/node": "^24.0.0",
|
|
126
|
-
"@types/react": "^19.2.17",
|
|
127
|
-
"@types/react-dom": "^19.2.3",
|
|
128
|
-
"@vitejs/plugin-react": "^6.0.4",
|
|
129
|
-
"concurrently": "^9.2.1",
|
|
130
|
-
"lucide-react": "^1.26.0",
|
|
131
|
-
"react": "^19.2.8",
|
|
132
|
-
"react-dom": "^19.2.8",
|
|
133
|
-
"react-markdown": "^10.1.0",
|
|
134
|
-
"remark-gfm": "^4.0.1",
|
|
135
|
-
"tsx": "^4.23.1",
|
|
136
|
-
"typescript": "^5.9.3",
|
|
137
|
-
"vite": "^8.1.5"
|
|
138
|
-
}
|
|
139
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@womp/spark-agent",
|
|
3
|
+
"version": "4.4.0",
|
|
4
|
+
"description": "Portable skills-based AI agent with local and durable chat transports for Womp",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"spark-agent": "dist/cli.js",
|
|
10
|
+
"simple-bench": "dist/simple-bench-cli.js",
|
|
11
|
+
"agent-run": "dist/agent-run-cli.js"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
"./browser": {
|
|
15
|
+
"types": "./dist/browser.d.ts",
|
|
16
|
+
"import": "./dist/browser.js",
|
|
17
|
+
"default": "./dist/browser.js"
|
|
18
|
+
},
|
|
19
|
+
"./capabilities": {
|
|
20
|
+
"types": "./dist/capabilities.d.ts",
|
|
21
|
+
"import": "./dist/capabilities.js",
|
|
22
|
+
"default": "./dist/capabilities.js"
|
|
23
|
+
},
|
|
24
|
+
"./kakapo": {
|
|
25
|
+
"types": "./dist/kakapo.d.ts",
|
|
26
|
+
"import": "./dist/kakapo.js",
|
|
27
|
+
"default": "./dist/kakapo.js"
|
|
28
|
+
},
|
|
29
|
+
"./geometry": {
|
|
30
|
+
"types": "./dist/geometry.d.ts",
|
|
31
|
+
"import": "./dist/geometry.js",
|
|
32
|
+
"default": "./dist/geometry.js"
|
|
33
|
+
},
|
|
34
|
+
"./openscad": {
|
|
35
|
+
"types": "./dist/openscad.d.ts",
|
|
36
|
+
"import": "./dist/openscad.js",
|
|
37
|
+
"default": "./dist/openscad.js"
|
|
38
|
+
},
|
|
39
|
+
"./quickjs": {
|
|
40
|
+
"types": "./dist/quickjs-executor.d.ts",
|
|
41
|
+
"import": "./dist/quickjs-executor.js",
|
|
42
|
+
"default": "./dist/quickjs-executor.js"
|
|
43
|
+
},
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"import": "./dist/index.js",
|
|
47
|
+
"default": "./dist/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./ui": {
|
|
50
|
+
"types": "./dist/ui.d.ts",
|
|
51
|
+
"import": "./dist/ui.js",
|
|
52
|
+
"default": "./dist/ui.js"
|
|
53
|
+
},
|
|
54
|
+
"./client": {
|
|
55
|
+
"types": "./dist/client.d.ts",
|
|
56
|
+
"import": "./dist/client.js",
|
|
57
|
+
"default": "./dist/client.js"
|
|
58
|
+
},
|
|
59
|
+
"./server": {
|
|
60
|
+
"types": "./dist/server/index.d.ts",
|
|
61
|
+
"import": "./dist/server/index.js",
|
|
62
|
+
"default": "./dist/server/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./express": {
|
|
65
|
+
"types": "./dist/server/express.d.ts",
|
|
66
|
+
"import": "./dist/server/express.js",
|
|
67
|
+
"default": "./dist/server/express.js"
|
|
68
|
+
},
|
|
69
|
+
"./package.json": "./package.json"
|
|
70
|
+
},
|
|
71
|
+
"files": [
|
|
72
|
+
"dist/**/*.js",
|
|
73
|
+
"dist/**/*.d.ts",
|
|
74
|
+
"dist/server/fixtures/**/*.json",
|
|
75
|
+
"dist/geometry/schemas/**/*.json",
|
|
76
|
+
"README.md"
|
|
77
|
+
],
|
|
78
|
+
"sideEffects": false,
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">=22.13"
|
|
81
|
+
},
|
|
82
|
+
"repository": {
|
|
83
|
+
"type": "git",
|
|
84
|
+
"url": "git+https://github.com/wompxyz/spark-agent.git"
|
|
85
|
+
},
|
|
86
|
+
"publishConfig": {
|
|
87
|
+
"access": "public"
|
|
88
|
+
},
|
|
89
|
+
"license": "MIT",
|
|
90
|
+
"scripts": {
|
|
91
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
92
|
+
"build": "yarn clean && node scripts/generate-skill-declarations.mjs && tsc -p tsconfig.json && node scripts/copy-fixtures.mjs",
|
|
93
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p web/tsconfig.json",
|
|
94
|
+
"lint": "yarn typecheck",
|
|
95
|
+
"dev": "yarn build && concurrently --kill-others \"yarn dev:server\" \"yarn dev:web\"",
|
|
96
|
+
"dev:server": "tsx src/cli.ts",
|
|
97
|
+
"simple-bench": "tsx src/simple-bench-cli.ts",
|
|
98
|
+
"agent-run": "tsx src/agent-run-cli.ts",
|
|
99
|
+
"dev:demo-account": "yarn build && concurrently --kill-others \"yarn dev:server --profile demo-account\" \"yarn dev:web\"",
|
|
100
|
+
"dev:web": "vite --config web/vite.config.ts",
|
|
101
|
+
"start": "node dist/cli.js",
|
|
102
|
+
"web:build": "yarn build && tsc --noEmit -p web/tsconfig.json && vite build --config web/vite.config.ts",
|
|
103
|
+
"test": "yarn build && tsx --tsconfig tsconfig.json --test test/**/*.test.ts && node --input-type=module -e \"await Promise.all([import('@womp/spark-agent'), import('@womp/spark-agent/ui'), import('@womp/spark-agent/client'), import('@womp/spark-agent/server'), import('@womp/spark-agent/express'), import('@womp/spark-agent/kakapo'), import('@womp/spark-agent/geometry'), import('@womp/spark-agent/openscad')])\"",
|
|
104
|
+
"test:live": "tsx --tsconfig tsconfig.json test/womp-scene-api.live.ts",
|
|
105
|
+
"prepack": "yarn build"
|
|
106
|
+
},
|
|
107
|
+
"dependencies": {
|
|
108
|
+
"@ai-sdk/anthropic": "4.0.50",
|
|
109
|
+
"@ai-sdk/google": "4.0.69",
|
|
110
|
+
"@ai-sdk/openai": "4.0.63",
|
|
111
|
+
"@jitl/quickjs-wasmfile-release-sync": "0.32.0",
|
|
112
|
+
"@womp/flowir": "0.3.0",
|
|
113
|
+
"@womp/kakapo-sdk": "0.5.0",
|
|
114
|
+
"ai": "7.0.95",
|
|
115
|
+
"eventsource-parser": "^3.0.6",
|
|
116
|
+
"express": "^5.2.1",
|
|
117
|
+
"lodash": "4.18.1",
|
|
118
|
+
"quickjs-emscripten-core": "0.32.0",
|
|
119
|
+
"zod": "4.5.4"
|
|
120
|
+
},
|
|
121
|
+
"devDependencies": {
|
|
122
|
+
"@ai-sdk/react": "^4.0.77",
|
|
123
|
+
"@types/express": "^5.0.5",
|
|
124
|
+
"@types/lodash": "4.17.24",
|
|
125
|
+
"@types/node": "^24.0.0",
|
|
126
|
+
"@types/react": "^19.2.17",
|
|
127
|
+
"@types/react-dom": "^19.2.3",
|
|
128
|
+
"@vitejs/plugin-react": "^6.0.4",
|
|
129
|
+
"concurrently": "^9.2.1",
|
|
130
|
+
"lucide-react": "^1.26.0",
|
|
131
|
+
"react": "^19.2.8",
|
|
132
|
+
"react-dom": "^19.2.8",
|
|
133
|
+
"react-markdown": "^10.1.0",
|
|
134
|
+
"remark-gfm": "^4.0.1",
|
|
135
|
+
"tsx": "^4.23.1",
|
|
136
|
+
"typescript": "^5.9.3",
|
|
137
|
+
"vite": "^8.1.5"
|
|
138
|
+
}
|
|
139
|
+
}
|