@womp/spark-agent 9.5.0 → 10.1.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/dist/ui.d.ts CHANGED
@@ -3,8 +3,8 @@ export { sparkErrorDiagnostics, sparkErrorDiagnosticsSchema, type SparkErrorDiag
3
3
  import type { InferUIMessageChunk, UIMessage } from "ai";
4
4
  import type { SceneScreenshotOptions } from "./capabilities/scene.js";
5
5
  import { z } from "zod";
6
- export type { SparkGoal, SparkGoalCommand, SparkGoalCondition, SparkGoalDecision, SparkGoalOutcome, SparkGoalProposal, SparkGoalProposalPart, SparkGoalTry } from "./goals.js";
7
- import { type SparkGoalOutcome, type SparkGoalProposal, type SparkGoalProposalPart } from "./goals.js";
6
+ export type { SparkGoal, SparkGoalCommand, SparkGoalCondition, SparkGoalOutcome, SparkGoalRequest, SparkGoalResult, SparkGoalSummary, SparkGoalTry } from "./goals.js";
7
+ import type { SparkGoalRequest, SparkGoalResult } from "./goals.js";
8
8
  import type { ExecutionReceipt, SparkSkill } from "./capabilities.js";
9
9
  export { DEFAULT_MODEL_ID, getSparkModel, REASONING_EFFORT_LABELS, resolveReasoningEffort, SPARK_MODELS, } from "./models.js";
10
10
  export type { ModelProvider, ReasoningEffort, SparkModel } from "./models.js";
@@ -59,7 +59,16 @@ export type SparkStepCost = z.infer<typeof sparkStepCostSchema>;
59
59
  export type SparkStepMetricsData = {
60
60
  step: number;
61
61
  toolNames: string[];
62
+ /** Time waiting for the model's response. */
62
63
  responseTimeMs: number;
64
+ /** Time until the model's first output chunk; absent when the step did not stream one. */
65
+ timeToFirstOutputMs?: number;
66
+ /** The whole step: the model's response and the tools it called, after the request was prepared. */
67
+ stepTimeMs?: number;
68
+ /** Time running the step's tool calls, summed. */
69
+ toolExecutionMs?: number;
70
+ /** Time running each tool call, by tool call id. */
71
+ toolCallMs?: Record<string, number>;
63
72
  cost?: SparkStepCost;
64
73
  usage?: unknown;
65
74
  };
@@ -92,7 +101,6 @@ export type SparkDataParts = {
92
101
  };
93
102
  selection: SparkSelectionData;
94
103
  compaction: SparkCompaction;
95
- "goal-proposal": SparkGoalProposalPart;
96
104
  "flow-run-result": SparkFlowRunResult;
97
105
  };
98
106
  /** Editor node IDs selected when a user message was sent; never rendered as chat text. */
@@ -122,6 +130,8 @@ export type SparkCompaction = {
122
130
  tokensBefore: number;
123
131
  tokensAfter: number;
124
132
  createdAt: string;
133
+ /** How long the summary request took. */
134
+ durationMs?: number;
125
135
  };
126
136
  export type ExecuteJavaScriptInput = {
127
137
  purpose: string;
@@ -157,12 +167,10 @@ export type SparkUITools = {
157
167
  skills: SkillReadResult[];
158
168
  };
159
169
  };
160
- /** Offered only by hosts that can ask the user; see `SparkGoalOffer`. */
161
- propose_goal: {
162
- input: SparkGoalProposal;
163
- output: {
164
- goal: SparkGoalOutcome;
165
- };
170
+ /** Offered only by hosts that run goals; see `SparkGoalHandler`. */
171
+ goal: {
172
+ input: SparkGoalRequest;
173
+ output: SparkGoalResult;
166
174
  };
167
175
  };
168
176
  export type SkillReadResult = ({
@@ -197,9 +205,9 @@ export declare const sparkMessageMetadataSchema: z.ZodObject<{
197
205
  durationMs: z.ZodOptional<z.ZodNumber>;
198
206
  runId: z.ZodOptional<z.ZodString>;
199
207
  runStatus: z.ZodOptional<z.ZodEnum<{
208
+ running: "running";
200
209
  completed: "completed";
201
210
  queued: "queued";
202
- running: "running";
203
211
  requires_action: "requires_action";
204
212
  failed: "failed";
205
213
  cancelled: "cancelled";
@@ -322,9 +330,9 @@ export declare const sparkDataPartSchemas: {
322
330
  readonly "run-status": z.ZodObject<{
323
331
  runId: z.ZodString;
324
332
  status: z.ZodEnum<{
333
+ running: "running";
325
334
  completed: "completed";
326
335
  queued: "queued";
327
- running: "running";
328
336
  requires_action: "requires_action";
329
337
  failed: "failed";
330
338
  cancelled: "cancelled";
@@ -376,6 +384,10 @@ export declare const sparkDataPartSchemas: {
376
384
  step: z.ZodNumber;
377
385
  toolNames: z.ZodArray<z.ZodString>;
378
386
  responseTimeMs: z.ZodNumber;
387
+ timeToFirstOutputMs: z.ZodOptional<z.ZodNumber>;
388
+ stepTimeMs: z.ZodOptional<z.ZodNumber>;
389
+ toolExecutionMs: z.ZodOptional<z.ZodNumber>;
390
+ toolCallMs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
379
391
  cost: z.ZodOptional<z.ZodObject<{
380
392
  modelId: z.ZodString;
381
393
  pricingDate: z.ZodString;
@@ -407,25 +419,7 @@ export declare const sparkDataPartSchemas: {
407
419
  tokensBefore: z.ZodNumber;
408
420
  tokensAfter: z.ZodNumber;
409
421
  createdAt: z.ZodString;
410
- }, z.core.$strip>;
411
- /**
412
- * The goal the agent proposed in this message, for hosts to show: as the
413
- * confirmation while it waits, and as the goal once it started. The model
414
- * reads the proposal from its `propose_goal` call, not from this part.
415
- */
416
- readonly "goal-proposal": z.ZodObject<{
417
- title: z.ZodString;
418
- conditions: z.ZodArray<z.ZodObject<{
419
- text: z.ZodString;
420
- measurable: z.ZodBoolean;
421
- }, z.core.$strip>>;
422
- toolCallId: z.ZodString;
423
- outcome: z.ZodOptional<z.ZodEnum<{
424
- active: "active";
425
- unanswered: "unanswered";
426
- started: "started";
427
- declined: "declined";
428
- }>>;
422
+ durationMs: z.ZodOptional<z.ZodNumber>;
429
423
  }, z.core.$strip>;
430
424
  /**
431
425
  * A finished flow run, as an event. Hosts attach it to a user message, render
@@ -460,4 +454,4 @@ export declare const sparkDataPartSchemas: {
460
454
  }, z.core.$strip>;
461
455
  };
462
456
  export { parseWompifyCommand, WOMPIFY_PRESETS, wompifyPrompt, wompifyContextSchema, type WompifyRequest, type WompifyContext } from "./wompify.js";
463
- export { DEFAULT_GOAL_CREDITS, GOAL_CONFIRMATION_DEFAULTS, sparkGoalProposalPartSchema, sparkGoalProposalSchema } from "./goals.js";
457
+ export { DEFAULT_GOAL_CREDITS } from "./goals.js";
package/dist/ui.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { sparkErrorDiagnosticsSchema } from "./error-diagnostics.js";
2
2
  export { sparkErrorDiagnostics, sparkErrorDiagnosticsSchema, } from "./error-diagnostics.js";
3
3
  import { z } from "zod";
4
- import { sparkGoalProposalPartSchema } from "./goals.js";
5
4
  export { DEFAULT_MODEL_ID, getSparkModel, REASONING_EFFORT_LABELS, resolveReasoningEffort, SPARK_MODELS, } from "./models.js";
6
5
  export const SPARK_RUN_STATUSES = [
7
6
  "queued",
@@ -104,6 +103,10 @@ export const sparkDataPartSchemas = {
104
103
  step: z.number().int().nonnegative(),
105
104
  toolNames: z.array(z.string()),
106
105
  responseTimeMs: z.number().nonnegative(),
106
+ timeToFirstOutputMs: z.number().nonnegative().optional(),
107
+ stepTimeMs: z.number().nonnegative().optional(),
108
+ toolExecutionMs: z.number().nonnegative().optional(),
109
+ toolCallMs: z.record(z.string(), z.number().nonnegative()).optional(),
107
110
  cost: sparkStepCostSchema.optional(),
108
111
  usage: z.unknown().optional(),
109
112
  }),
@@ -122,13 +125,8 @@ export const sparkDataPartSchemas = {
122
125
  tokensBefore: z.number().int().nonnegative(),
123
126
  tokensAfter: z.number().int().nonnegative(),
124
127
  createdAt: z.string().datetime(),
128
+ durationMs: z.number().nonnegative().optional(),
125
129
  }),
126
- /**
127
- * The goal the agent proposed in this message, for hosts to show: as the
128
- * confirmation while it waits, and as the goal once it started. The model
129
- * reads the proposal from its `propose_goal` call, not from this part.
130
- */
131
- "goal-proposal": sparkGoalProposalPartSchema,
132
130
  /**
133
131
  * A finished flow run, as an event. Hosts attach it to a user message, render
134
132
  * it as an event and not as that user's text; the model reads it as text
@@ -137,4 +135,4 @@ export const sparkDataPartSchemas = {
137
135
  "flow-run-result": flowRunResultSchema,
138
136
  };
139
137
  export { parseWompifyCommand, WOMPIFY_PRESETS, wompifyPrompt, wompifyContextSchema } from "./wompify.js";
140
- export { DEFAULT_GOAL_CREDITS, GOAL_CONFIRMATION_DEFAULTS, sparkGoalProposalPartSchema, sparkGoalProposalSchema } from "./goals.js";
138
+ export { DEFAULT_GOAL_CREDITS } from "./goals.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@womp/spark-agent",
3
- "version": "9.5.0",
3
+ "version": "10.1.0",
4
4
  "description": "Portable skills-based AI agent with local and durable chat transports for Womp",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",