@womp/spark-agent 4.1.1 → 4.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.
Files changed (40) hide show
  1. package/.env.example +6 -0
  2. package/README.md +436 -406
  3. package/dist/agent-tools.js +7 -1
  4. package/dist/agent.js +11 -2
  5. package/dist/bounded-output.d.ts +37 -0
  6. package/dist/bounded-output.js +110 -0
  7. package/dist/capabilities/geometry.js +14 -14
  8. package/dist/capabilities/operations.js +38 -33
  9. package/dist/capabilities/scene.js +87 -66
  10. package/dist/color.d.ts +8 -0
  11. package/dist/color.js +29 -0
  12. package/dist/error-diagnostics.d.ts +32 -0
  13. package/dist/error-diagnostics.js +80 -0
  14. package/dist/generated/scene-declarations.d.ts +1 -1
  15. package/dist/generated/scene-declarations.js +1 -1
  16. package/dist/geometry/compiler.js +6 -4
  17. package/dist/geometry/diagnostics.d.ts +18 -0
  18. package/dist/geometry/diagnostics.js +70 -0
  19. package/dist/geometry/schemas/backend-schema.json +3393 -3393
  20. package/dist/geometry/schemas/flowir-dialect.json +1023 -1023
  21. package/dist/geometry.js +6 -6
  22. package/dist/prompt.js +70 -70
  23. package/dist/scene-environment.d.ts +1 -1
  24. package/dist/scene-environment.js +8 -4
  25. package/dist/scene-health.d.ts +23 -0
  26. package/dist/scene-health.js +71 -0
  27. package/dist/sdk-geometry-host.js +5 -3
  28. package/dist/sdk-scene-health-host.js +27 -5
  29. package/dist/sdk-scene-host.d.ts +5 -5
  30. package/dist/sdk-scene-host.js +7 -2
  31. package/dist/server/fixtures/materials/matte-blue.json +14 -14
  32. package/dist/server/fixtures/materials/polished-copper.json +14 -14
  33. package/dist/server/service.js +35 -10
  34. package/dist/server/sqlite-store.js +37 -37
  35. package/dist/server/types.d.ts +2 -0
  36. package/dist/ui.d.ts +46 -0
  37. package/dist/ui.js +9 -1
  38. package/dist/womp-scene-api.d.ts +11 -10
  39. package/dist/womp-scene-api.js +11 -9
  40. package/package.json +139 -139
@@ -17,36 +17,36 @@ export class SqliteSparkStore {
17
17
  this.database.close();
18
18
  throw new Error(`Unsupported Spark database version: ${version}`);
19
19
  }
20
- this.database.exec(`
21
- PRAGMA busy_timeout = 5000;
22
- PRAGMA journal_mode = WAL;
23
- PRAGMA synchronous = FULL;
24
- PRAGMA foreign_keys = ON;
25
- CREATE TABLE IF NOT EXISTS conversations (
26
- id TEXT PRIMARY KEY, owner_id TEXT NOT NULL, updated_at TEXT NOT NULL, data TEXT NOT NULL
27
- );
28
- CREATE INDEX IF NOT EXISTS conversation_owner ON conversations(owner_id, updated_at);
29
- CREATE TABLE IF NOT EXISTS runs (
30
- id TEXT PRIMARY KEY, conversation_id TEXT NOT NULL, data TEXT NOT NULL
31
- );
32
- CREATE TABLE IF NOT EXISTS chunks (
33
- run_id TEXT NOT NULL REFERENCES runs(id), sequence INTEGER NOT NULL, data TEXT NOT NULL,
34
- PRIMARY KEY (run_id, sequence)
35
- );
36
- CREATE TABLE IF NOT EXISTS artifacts (
37
- id TEXT PRIMARY KEY, owner_id TEXT NOT NULL, metadata TEXT NOT NULL, bytes BLOB NOT NULL
38
- );
39
- CREATE TABLE IF NOT EXISTS execution_owner (
40
- singleton INTEGER PRIMARY KEY CHECK (singleton = 1), pid INTEGER NOT NULL, token TEXT NOT NULL
41
- );
42
- CREATE TABLE IF NOT EXISTS scene_operations (
43
- target_key TEXT NOT NULL, id TEXT NOT NULL, revision INTEGER NOT NULL, data TEXT NOT NULL,
44
- PRIMARY KEY (target_key, id)
45
- );
46
- CREATE TABLE IF NOT EXISTS repair_states (
47
- target_key TEXT PRIMARY KEY, revision INTEGER NOT NULL, data TEXT NOT NULL
48
- );
49
- PRAGMA user_version = 4;
20
+ this.database.exec(`
21
+ PRAGMA busy_timeout = 5000;
22
+ PRAGMA journal_mode = WAL;
23
+ PRAGMA synchronous = FULL;
24
+ PRAGMA foreign_keys = ON;
25
+ CREATE TABLE IF NOT EXISTS conversations (
26
+ id TEXT PRIMARY KEY, owner_id TEXT NOT NULL, updated_at TEXT NOT NULL, data TEXT NOT NULL
27
+ );
28
+ CREATE INDEX IF NOT EXISTS conversation_owner ON conversations(owner_id, updated_at);
29
+ CREATE TABLE IF NOT EXISTS runs (
30
+ id TEXT PRIMARY KEY, conversation_id TEXT NOT NULL, data TEXT NOT NULL
31
+ );
32
+ CREATE TABLE IF NOT EXISTS chunks (
33
+ run_id TEXT NOT NULL REFERENCES runs(id), sequence INTEGER NOT NULL, data TEXT NOT NULL,
34
+ PRIMARY KEY (run_id, sequence)
35
+ );
36
+ CREATE TABLE IF NOT EXISTS artifacts (
37
+ id TEXT PRIMARY KEY, owner_id TEXT NOT NULL, metadata TEXT NOT NULL, bytes BLOB NOT NULL
38
+ );
39
+ CREATE TABLE IF NOT EXISTS execution_owner (
40
+ singleton INTEGER PRIMARY KEY CHECK (singleton = 1), pid INTEGER NOT NULL, token TEXT NOT NULL
41
+ );
42
+ CREATE TABLE IF NOT EXISTS scene_operations (
43
+ target_key TEXT NOT NULL, id TEXT NOT NULL, revision INTEGER NOT NULL, data TEXT NOT NULL,
44
+ PRIMARY KEY (target_key, id)
45
+ );
46
+ CREATE TABLE IF NOT EXISTS repair_states (
47
+ target_key TEXT PRIMARY KEY, revision INTEGER NOT NULL, data TEXT NOT NULL
48
+ );
49
+ PRAGMA user_version = 4;
50
50
  `);
51
51
  }
52
52
  repairStateStore(targetKey) {
@@ -127,13 +127,13 @@ export class SqliteSparkStore {
127
127
  if (result.changes !== 1)
128
128
  throw new Error("Scene operation changed concurrently or is missing");
129
129
  if (next.status === "committed" || next.status === "rolled_back") {
130
- this.database.prepare(`
131
- DELETE FROM scene_operations WHERE rowid IN (
132
- SELECT rowid FROM scene_operations
133
- WHERE target_key = ? AND json_extract(data, '$.status') IN ('committed', 'rolled_back')
134
- ORDER BY COALESCE(json_extract(data, '$.completedAt'), '') DESC
135
- LIMIT -1 OFFSET ?
136
- )
130
+ this.database.prepare(`
131
+ DELETE FROM scene_operations WHERE rowid IN (
132
+ SELECT rowid FROM scene_operations
133
+ WHERE target_key = ? AND json_extract(data, '$.status') IN ('committed', 'rolled_back')
134
+ ORDER BY COALESCE(json_extract(data, '$.completedAt'), '') DESC
135
+ LIMIT -1 OFFSET ?
136
+ )
137
137
  `).run(next.targetKey, completedSceneOperationLimit);
138
138
  }
139
139
  this.database.exec("COMMIT");
@@ -1,3 +1,4 @@
1
+ import type { SparkErrorDiagnostics } from "../error-diagnostics.js";
1
2
  import type { SparkAgentRun } from "../agent.js";
2
3
  import type { ReasoningEffort } from "../models.js";
3
4
  import type { SparkRunStatus, SparkUIMessage, StoredSparkChunk } from "../ui.js";
@@ -26,6 +27,7 @@ export type SparkRun = {
26
27
  status: SparkRunStatus;
27
28
  settings: SparkRunSettings;
28
29
  error?: string;
30
+ errorDiagnostics?: SparkErrorDiagnostics;
29
31
  createdAt: string;
30
32
  updatedAt: string;
31
33
  startedAt?: string;
package/dist/ui.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { type SparkErrorDiagnostics } from "./error-diagnostics.js";
2
+ export { sparkErrorDiagnostics, sparkErrorDiagnosticsSchema, type SparkErrorDiagnostics, } from "./error-diagnostics.js";
1
3
  import type { InferUIMessageChunk, UIMessage } from "ai";
2
4
  import type { SceneScreenshotOptions } from "./capabilities/scene.js";
3
5
  import { z } from "zod";
@@ -24,6 +26,7 @@ export type SparkMessageMetadata = {
24
26
  modelId?: string;
25
27
  usage?: unknown;
26
28
  error?: string;
29
+ errorDiagnostics?: SparkErrorDiagnostics;
27
30
  };
28
31
  export type SparkConsoleData = {
29
32
  stream: "stdout" | "stderr";
@@ -33,6 +36,7 @@ export type SparkRunStatusData = {
33
36
  runId: string;
34
37
  status: SparkRunStatus;
35
38
  error?: string;
39
+ errorDiagnostics?: SparkErrorDiagnostics;
36
40
  label?: string;
37
41
  };
38
42
  export declare const sparkStepCostSchema: z.ZodObject<{
@@ -157,6 +161,27 @@ export declare const sparkMessageMetadataSchema: z.ZodObject<{
157
161
  modelId: z.ZodOptional<z.ZodString>;
158
162
  usage: z.ZodOptional<z.ZodUnknown>;
159
163
  error: z.ZodOptional<z.ZodString>;
164
+ errorDiagnostics: z.ZodOptional<z.ZodObject<{
165
+ cause: z.ZodOptional<z.ZodObject<{
166
+ message: z.ZodString;
167
+ name: z.ZodOptional<z.ZodString>;
168
+ code: z.ZodOptional<z.ZodString>;
169
+ status: z.ZodOptional<z.ZodNumber>;
170
+ requestId: z.ZodOptional<z.ZodString>;
171
+ cause: z.ZodOptional<z.ZodObject<{
172
+ message: z.ZodString;
173
+ name: z.ZodOptional<z.ZodString>;
174
+ code: z.ZodOptional<z.ZodString>;
175
+ status: z.ZodOptional<z.ZodNumber>;
176
+ requestId: z.ZodOptional<z.ZodString>;
177
+ }, z.core.$strip>>;
178
+ }, z.core.$strip>>;
179
+ message: z.ZodString;
180
+ name: z.ZodOptional<z.ZodString>;
181
+ code: z.ZodOptional<z.ZodString>;
182
+ status: z.ZodOptional<z.ZodNumber>;
183
+ requestId: z.ZodOptional<z.ZodString>;
184
+ }, z.core.$strip>>;
160
185
  }, z.core.$strip>;
161
186
  export declare const sparkDataPartSchemas: {
162
187
  readonly "tool-input-label": z.ZodObject<{
@@ -211,6 +236,27 @@ export declare const sparkDataPartSchemas: {
211
236
  incomplete: "incomplete";
212
237
  }>;
213
238
  error: z.ZodOptional<z.ZodString>;
239
+ errorDiagnostics: z.ZodOptional<z.ZodObject<{
240
+ cause: z.ZodOptional<z.ZodObject<{
241
+ message: z.ZodString;
242
+ name: z.ZodOptional<z.ZodString>;
243
+ code: z.ZodOptional<z.ZodString>;
244
+ status: z.ZodOptional<z.ZodNumber>;
245
+ requestId: z.ZodOptional<z.ZodString>;
246
+ cause: z.ZodOptional<z.ZodObject<{
247
+ message: z.ZodString;
248
+ name: z.ZodOptional<z.ZodString>;
249
+ code: z.ZodOptional<z.ZodString>;
250
+ status: z.ZodOptional<z.ZodNumber>;
251
+ requestId: z.ZodOptional<z.ZodString>;
252
+ }, z.core.$strip>>;
253
+ }, z.core.$strip>>;
254
+ message: z.ZodString;
255
+ name: z.ZodOptional<z.ZodString>;
256
+ code: z.ZodOptional<z.ZodString>;
257
+ status: z.ZodOptional<z.ZodNumber>;
258
+ requestId: z.ZodOptional<z.ZodString>;
259
+ }, z.core.$strip>>;
214
260
  label: z.ZodOptional<z.ZodString>;
215
261
  }, z.core.$strip>;
216
262
  readonly "step-metrics": z.ZodObject<{
package/dist/ui.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { sparkErrorDiagnosticsSchema } from "./error-diagnostics.js";
2
+ export { sparkErrorDiagnostics, sparkErrorDiagnosticsSchema, } from "./error-diagnostics.js";
1
3
  import { z } from "zod";
2
4
  export { DEFAULT_MODEL_ID, getSparkModel, REASONING_EFFORT_LABELS, resolveReasoningEffort, SPARK_MODELS, } from "./models.js";
3
5
  export const SPARK_RUN_STATUSES = [
@@ -48,9 +50,14 @@ export const sparkMessageMetadataSchema = z.object({
48
50
  modelId: z.string().optional(),
49
51
  usage: z.unknown().optional(),
50
52
  error: z.string().optional(),
53
+ errorDiagnostics: sparkErrorDiagnosticsSchema.optional(),
51
54
  });
52
55
  export const sparkDataPartSchemas = {
53
- "tool-input-label": z.object({ toolCallId: z.string(), field: z.enum(["name", "purpose"]), value: z.string() }),
56
+ "tool-input-label": z.object({
57
+ toolCallId: z.string(),
58
+ field: z.enum(["name", "purpose"]),
59
+ value: z.string(),
60
+ }),
54
61
  "execution-receipt": z.object({ toolCallId: z.string(), receipt: sparkExecutionReceiptSchema }),
55
62
  console: z.object({
56
63
  stream: z.enum(["stdout", "stderr"]),
@@ -61,6 +68,7 @@ export const sparkDataPartSchemas = {
61
68
  runId: z.string().min(1),
62
69
  status: z.enum(SPARK_RUN_STATUSES),
63
70
  error: z.string().optional(),
71
+ errorDiagnostics: sparkErrorDiagnosticsSchema.optional(),
64
72
  label: z.string().optional(),
65
73
  }),
66
74
  "step-metrics": z.object({
@@ -34,7 +34,8 @@ export declare const LightTypeValue: {
34
34
  readonly Sphere: 1;
35
35
  readonly Distant: 2;
36
36
  };
37
- type Color3 = {
37
+ /** A color in the engine's 0-255 domain per channel, not 0-1. */
38
+ type Color255 = {
38
39
  r: number;
39
40
  g: number;
40
41
  b: number;
@@ -154,8 +155,8 @@ export declare function createWompSceneApi(context: WompSceneApiContext): {
154
155
  nodeSetBlend: (id: number, blend: number) => void;
155
156
  nodeGetRound: (id: number) => number;
156
157
  nodeSetRound: (id: number, round: number) => void;
157
- nodeGetColor: (id: number) => Color3;
158
- nodeSetColor: (id: number, color: Color3 | Vec3) => void;
158
+ nodeGetColor: (id: number) => Color255;
159
+ nodeSetColor: (id: number, rgb255: Color255 | Vec3) => void;
159
160
  nodeGetMaterialId: (id: number) => number | null;
160
161
  nodeSetMaterialId: (id: number, materialId: number) => void;
161
162
  nodeGetResolution: (id: number) => number;
@@ -225,12 +226,12 @@ export declare function createWompSceneApi(context: WompSceneApiContext): {
225
226
  materialSetName: (id: number, name: string) => void;
226
227
  materialGetTier: (id: number) => number;
227
228
  materialSetTier: (id: number, tier: number) => void;
228
- materialGetColor: (id: number) => Color3;
229
- materialSetColor: (id: number, color: Color3) => void;
230
- materialGetSecondaryColor: (id: number) => Color3;
231
- materialSetSecondaryColor: (id: number, color: Color3) => void;
232
- materialGetSubsurfaceColor: (id: number) => Color3;
233
- materialSetSubsurfaceColor: (id: number, color: Color3) => void;
229
+ materialGetColor: (id: number) => Color255;
230
+ materialSetColor: (id: number, rgb255: Color255) => void;
231
+ materialGetSecondaryColor: (id: number) => Color255;
232
+ materialSetSecondaryColor: (id: number, rgb255: Color255) => void;
233
+ materialGetSubsurfaceColor: (id: number) => Color255;
234
+ materialSetSubsurfaceColor: (id: number, rgb255: Color255) => void;
234
235
  materialGetRoughness: (id: number) => number;
235
236
  materialSetRoughness: (id: number, value: number) => void;
236
237
  materialGetMetalness: (id: number) => number;
@@ -285,7 +286,7 @@ export declare function createWompSceneApi(context: WompSceneApiContext): {
285
286
  setHdrName: (name: string) => void;
286
287
  setHdrMultiplier: (multiplier: number) => void;
287
288
  setHdrOrientation: (orientation: Vec2) => void;
288
- setBackgroundColor: (color: {
289
+ setBackgroundColor: (rgb255: {
289
290
  r: number;
290
291
  g: number;
291
292
  b: number;
@@ -1,6 +1,7 @@
1
1
  import { xyzRotationFromMatrix, MAX_BLEND_RADIUS_MM, MAX_MIRROR_BLEND_RADIUS_MM } from "@womp/kakapo-sdk";
2
2
  import { metadataObject, readMaterialMetadata, removeMaterialMetadata, shiftCurvePointMetadata, writeMaterialMetadata, } from "./scene-metadata.js";
3
3
  import { createSceneEnvironment } from "./scene-environment.js";
4
+ import { assertColor255 } from "./color.js";
4
5
  import { convertRotationBasis, sceneUnitMultiplier, fromEngineDimensions, fromEngineMirrorRotation, fromEnginePosition, toEngineDimensions, toEngineMirrorRotation, toEnginePosition, } from "./coordinates.js";
5
6
  export const NodeType = {
6
7
  Primitive: 0,
@@ -100,13 +101,14 @@ function color255(value) {
100
101
  b: Math.round(value.z * 255),
101
102
  };
102
103
  }
104
+ /** 0-255 per channel, refusing a 0-1 color rather than rounding it to black (./color.ts). */
103
105
  function color1(value) {
104
106
  const input = value;
105
- return {
106
- x: clamp(finite(input.r ?? input.x, "color.r"), 0, 255) / 255,
107
- y: clamp(finite(input.g ?? input.y, "color.g"), 0, 255) / 255,
108
- z: clamp(finite(input.b ?? input.z, "color.b"), 0, 255) / 255,
109
- };
107
+ const r = finite(input.r ?? input.x, "color.r");
108
+ const g = finite(input.g ?? input.y, "color.g");
109
+ const b = finite(input.b ?? input.z, "color.b");
110
+ assertColor255([r, g, b]);
111
+ return { x: clamp(r, 0, 255) / 255, y: clamp(g, 0, 255) / 255, z: clamp(b, 0, 255) / 255 };
110
112
  }
111
113
  function runtimeEnum(values) {
112
114
  const names = {};
@@ -677,7 +679,7 @@ export function createWompSceneApi(context) {
677
679
  const node = requireNode(id);
678
680
  return color255(node.kind === "primitive" || node.kind === "light" ? node.color : { x: 0, y: 0, z: 0 });
679
681
  },
680
- nodeSetColor: (id, color) => update(id, { color: color1(color) }),
682
+ nodeSetColor: (id, rgb255) => update(id, { color: color1(rgb255) }),
681
683
  nodeGetMaterialId: (id) => {
682
684
  const node = requireNode(id);
683
685
  return "materialId" in node ? node.materialId : null;
@@ -919,11 +921,11 @@ export function createWompSceneApi(context) {
919
921
  writeMaterialMetadata(scene, id, { tier: value });
920
922
  },
921
923
  materialGetColor: (id) => color255(material(id).data.color),
922
- materialSetColor: (id, color) => writeMaterial(id, { color: color1(color) }),
924
+ materialSetColor: (id, rgb255) => writeMaterial(id, { color: color1(rgb255) }),
923
925
  materialGetSecondaryColor: (id) => color255(material(id).data.secondaryColor),
924
- materialSetSecondaryColor: (id, color) => writeMaterial(id, { secondaryColor: color1(color) }),
926
+ materialSetSecondaryColor: (id, rgb255) => writeMaterial(id, { secondaryColor: color1(rgb255) }),
925
927
  materialGetSubsurfaceColor: (id) => color255(material(id).data.subsurface),
926
- materialSetSubsurfaceColor: (id, color) => writeMaterial(id, { subsurface: color1(color) }),
928
+ materialSetSubsurfaceColor: (id, rgb255) => writeMaterial(id, { subsurface: color1(rgb255) }),
927
929
  materialGetRoughness: (id) => material(id).data.roughness,
928
930
  materialSetRoughness: (id, value) => writeMaterial(id, { roughness: clamp(finite(value, "roughness"), 0, 1) }),
929
931
  materialGetMetalness: (id) => material(id).data.metalness,
package/package.json CHANGED
@@ -1,139 +1,139 @@
1
- {
2
- "name": "@womp/spark-agent",
3
- "version": "4.1.1",
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.4.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.2.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.4.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
+ }