unbrowse 3.1.0 → 3.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 (107) hide show
  1. package/dist/cli.js +455 -96
  2. package/dist/index.js +2 -6
  3. package/dist/mcp.js +695 -46
  4. package/dist/server.js +25811 -0
  5. package/package.json +1 -2
  6. package/vendor/kuri/darwin-arm64/kuri +0 -0
  7. package/vendor/kuri/darwin-x64/kuri +0 -0
  8. package/vendor/kuri/linux-arm64/kuri +0 -0
  9. package/vendor/kuri/linux-x64/kuri +0 -0
  10. package/vendor/kuri/manifest.json +7 -10
  11. package/runtime-src/agent-outcome.ts +0 -166
  12. package/runtime-src/analytics-session.ts +0 -55
  13. package/runtime-src/api/browse-index.ts +0 -317
  14. package/runtime-src/api/browse-session.ts +0 -572
  15. package/runtime-src/api/browse-submit-prereqs.ts +0 -48
  16. package/runtime-src/api/browse-submit.ts +0 -1184
  17. package/runtime-src/api/routes.ts +0 -1823
  18. package/runtime-src/auth/browser-cookies.ts +0 -423
  19. package/runtime-src/auth/index.ts +0 -535
  20. package/runtime-src/auth/runtime.ts +0 -116
  21. package/runtime-src/browser/index.ts +0 -659
  22. package/runtime-src/browser/types.ts +0 -41
  23. package/runtime-src/build-info.generated.ts +0 -6
  24. package/runtime-src/capture/index.ts +0 -1794
  25. package/runtime-src/capture/prefetch.ts +0 -95
  26. package/runtime-src/capture/rsc.ts +0 -45
  27. package/runtime-src/cli/shortcuts.ts +0 -273
  28. package/runtime-src/cli.ts +0 -1572
  29. package/runtime-src/client/graph-client.ts +0 -100
  30. package/runtime-src/client/index.ts +0 -1425
  31. package/runtime-src/debug-trace.ts +0 -18
  32. package/runtime-src/domain.ts +0 -38
  33. package/runtime-src/execution/index.ts +0 -3397
  34. package/runtime-src/execution/retry.ts +0 -46
  35. package/runtime-src/execution/robots.ts +0 -167
  36. package/runtime-src/execution/search-forms.ts +0 -188
  37. package/runtime-src/extraction/index.ts +0 -1507
  38. package/runtime-src/foundry/publish-bundle.ts +0 -392
  39. package/runtime-src/graph/agent-augment.ts +0 -315
  40. package/runtime-src/graph/index.ts +0 -1524
  41. package/runtime-src/graph/local-fixtures.ts +0 -393
  42. package/runtime-src/graph/local-harness.ts +0 -646
  43. package/runtime-src/graph/planner.ts +0 -411
  44. package/runtime-src/graph/session.ts +0 -294
  45. package/runtime-src/graph/trace-store.ts +0 -136
  46. package/runtime-src/index.ts +0 -24
  47. package/runtime-src/indexer/index.ts +0 -465
  48. package/runtime-src/intent-match.ts +0 -1515
  49. package/runtime-src/kuri/client.ts +0 -1839
  50. package/runtime-src/logger.ts +0 -30
  51. package/runtime-src/marketplace/index.ts +0 -103
  52. package/runtime-src/mcp.ts +0 -1747
  53. package/runtime-src/orchestrator/browser-agent.ts +0 -374
  54. package/runtime-src/orchestrator/dag-advisor.ts +0 -59
  55. package/runtime-src/orchestrator/dag-feedback.ts +0 -257
  56. package/runtime-src/orchestrator/first-pass-action.ts +0 -403
  57. package/runtime-src/orchestrator/index.ts +0 -4480
  58. package/runtime-src/orchestrator/passive-publish.ts +0 -187
  59. package/runtime-src/orchestrator/timing-economics.ts +0 -80
  60. package/runtime-src/payments/cascade.ts +0 -137
  61. package/runtime-src/payments/index.ts +0 -270
  62. package/runtime-src/payments/lobster-pay.ts +0 -182
  63. package/runtime-src/payments/wallet.ts +0 -98
  64. package/runtime-src/publish/review-context.ts +0 -93
  65. package/runtime-src/publish/sanitize.ts +0 -197
  66. package/runtime-src/publish/schema-review.ts +0 -192
  67. package/runtime-src/publish-admission.ts +0 -388
  68. package/runtime-src/ratelimit/index.ts +0 -23
  69. package/runtime-src/reverse-engineer/bundle-scanner.ts +0 -127
  70. package/runtime-src/reverse-engineer/description-prompt.ts +0 -213
  71. package/runtime-src/reverse-engineer/index.ts +0 -1551
  72. package/runtime-src/router.ts +0 -17
  73. package/runtime-src/routing-telemetry.ts +0 -395
  74. package/runtime-src/runtime/browser-access.ts +0 -11
  75. package/runtime-src/runtime/browser-auth.ts +0 -12
  76. package/runtime-src/runtime/browser-host.ts +0 -48
  77. package/runtime-src/runtime/lifecycle.ts +0 -17
  78. package/runtime-src/runtime/local-server.ts +0 -311
  79. package/runtime-src/runtime/paths.ts +0 -99
  80. package/runtime-src/runtime/setup.ts +0 -251
  81. package/runtime-src/runtime/supervisor.ts +0 -69
  82. package/runtime-src/runtime/update-hints.ts +0 -351
  83. package/runtime-src/server.ts +0 -100
  84. package/runtime-src/session-logs.ts +0 -142
  85. package/runtime-src/settings.ts +0 -221
  86. package/runtime-src/single-binary.ts +0 -143
  87. package/runtime-src/site-policy.ts +0 -54
  88. package/runtime-src/stale-cleanup-runner.ts +0 -144
  89. package/runtime-src/stale-cleanup.ts +0 -133
  90. package/runtime-src/telemetry-attribution.ts +0 -120
  91. package/runtime-src/telemetry.ts +0 -253
  92. package/runtime-src/template-params.ts +0 -141
  93. package/runtime-src/transform/drift.ts +0 -60
  94. package/runtime-src/transform/index.ts +0 -277
  95. package/runtime-src/types/index.ts +0 -1
  96. package/runtime-src/types/skill.ts +0 -912
  97. package/runtime-src/vault/index.ts +0 -196
  98. package/runtime-src/verification/auth-gate.ts +0 -8
  99. package/runtime-src/verification/candidates.ts +0 -27
  100. package/runtime-src/verification/index.ts +0 -120
  101. package/runtime-src/verification/matrix.ts +0 -30
  102. package/runtime-src/version.ts +0 -148
  103. package/runtime-src/workflow/artifact.ts +0 -161
  104. package/runtime-src/workflow/compile.ts +0 -808
  105. package/runtime-src/workflow/publish.ts +0 -225
  106. package/runtime-src/workflow/runtime.ts +0 -213
  107. package/vendor/kuri/win-x64/kuri.exe +0 -0
@@ -1,912 +0,0 @@
1
- export type SkillLifecycle = "active" | "deprecated" | "disabled";
2
- export type OwnerType = "agent" | "marketplace" | "user";
3
- export type Idempotency = "safe" | "unsafe";
4
- export type VerificationStatus = "verified" | "unverified" | "failed" | "pending" | "disabled";
5
- export type GraphVisibility = "shadow" | "public";
6
-
7
- export interface SkillSubmissionProvenance {
8
- submitted_at: string;
9
- submitter_agent_id?: string;
10
- client_trace_version?: string;
11
- client_code_hash?: string;
12
- client_git_sha?: string;
13
- transport?: string;
14
- release_manifest_version?: string;
15
- release_manifest_verified?: boolean;
16
- release_manifest_reason?: string;
17
- }
18
-
19
- export interface SkillTrustMetadata {
20
- graph_visibility: GraphVisibility;
21
- promotion_reason: string;
22
- submission_count: number;
23
- unique_submitters: number;
24
- verified_release_submissions: number;
25
- unique_verified_submitters: number;
26
- verified_ratio: number;
27
- last_submission_at: string;
28
- }
29
-
30
- export interface EndpointCorroboration {
31
- submission_count: number;
32
- unique_submitters: number;
33
- verified_release_submissions: number;
34
- unique_verified_submitters: number;
35
- last_submission_at: string;
36
- submitter_agent_ids?: string[];
37
- verified_release_submitter_ids?: string[];
38
- }
39
-
40
- export interface AuthProfile {
41
- oauth_type?: string;
42
- csrf_sources: Array<"header" | "cookie" | "form">;
43
- refresh_policy: string;
44
- session_refresh_triggers: string[];
45
- rotation_policy?: string;
46
- storage_hint: string;
47
- }
48
-
49
- export interface CsrfPlan {
50
- source: "header" | "cookie" | "form";
51
- param_name: string;
52
- refresh_on_401: boolean;
53
- extractor_sequence: string[];
54
- }
55
-
56
- export interface OAuthPlan {
57
- grant_type: string;
58
- token_url?: string;
59
- scopes?: string[];
60
- refresh_path?: string;
61
- }
62
-
63
- export interface Transform {
64
- transform_id: string;
65
- version: string;
66
- request?: {
67
- sort_query_keys?: boolean;
68
- enforce_timezone_header?: boolean;
69
- sanitize_params?: string[];
70
- };
71
- response?: {
72
- flatten_arrays?: boolean;
73
- coerce_numeric_strings?: boolean;
74
- error_map?: Record<string, string>;
75
- strip_ephemeral_ids?: string[];
76
- };
77
- }
78
-
79
- export interface WsMessage {
80
- direction: "sent" | "received";
81
- data: string;
82
- timestamp: string;
83
- }
84
-
85
- export interface OperationBinding {
86
- key: string;
87
- description?: string;
88
- type?: string;
89
- semantic_type?: string;
90
- required?: boolean;
91
- source?: string;
92
- example_value?: string;
93
- }
94
-
95
- export interface EndpointSemanticDescriptor {
96
- action_kind: string;
97
- resource_kind: string;
98
- description_in?: string;
99
- description_out?: string;
100
- description_source?: "agent" | "auto" | "missing";
101
- description_needs_review?: boolean;
102
- description_warning?: string;
103
- response_summary?: string;
104
- example_request?: unknown;
105
- example_response_compact?: unknown;
106
- example_fields?: string[];
107
- requires?: OperationBinding[];
108
- provides?: OperationBinding[];
109
- negative_tags?: string[];
110
- confidence?: number;
111
- observed_at?: string;
112
- sample_request_url?: string;
113
- auth_required?: boolean;
114
- }
115
-
116
- export interface EndpointPolicyDescriptor {
117
- requires_third_party_terms_confirmation: boolean;
118
- policy_domain: string;
119
- reason: string;
120
- }
121
-
122
- export interface EndpointPathBindingCandidate {
123
- placeholder: string;
124
- observed_value: string;
125
- segment_index: number;
126
- source: "normalized_placeholder" | "file_basename" | "page_hint" | "context_diff" | "segment_pattern";
127
- placeholder_hint?: string;
128
- preceding_segment?: string;
129
- filename_suffix?: string;
130
- matched_page_hint?: boolean;
131
- }
132
-
133
- export interface EndpointDescriptor {
134
- endpoint_id: string;
135
- method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "WS";
136
- url_template: string;
137
- /** LLM-generated description of what this endpoint returns, for semantic matching */
138
- description?: string;
139
- ws_messages?: WsMessage[];
140
- headers_template?: Record<string, string>;
141
- query?: Record<string, unknown>;
142
- /** Default values for templatized path segments (e.g. {symbol} → "SPY,QQQ") */
143
- path_params?: Record<string, string>;
144
- /** Default values for templatized request-body placeholders */
145
- body_params?: Record<string, unknown>;
146
- body?: Record<string, unknown>;
147
- csrf_plan?: CsrfPlan;
148
- oauth_plan?: OAuthPlan;
149
- transform_ref?: string;
150
- idempotency: Idempotency;
151
- verification_status: VerificationStatus;
152
- reliability_score: number;
153
- last_verified_at?: string;
154
- signature?: string;
155
- response_schema?: ResponseSchema;
156
- /** When set, endpoint returns HTML — apply DOM extraction with this config */
157
- dom_extraction?: {
158
- extraction_method: string;
159
- confidence: number;
160
- selector?: string;
161
- };
162
- /** The page URL that triggered this API call during capture.
163
- * Used for trigger-and-intercept execution: navigate to this page,
164
- * let the site's own JS make the API call, and intercept the response. */
165
- trigger_url?: string;
166
- /** Learned execution strategy — set after first successful execution.
167
- * Skips doomed server-fetch on sites that need browser execution (e.g. LinkedIn). */
168
- exec_strategy?: "server" | "trigger-intercept" | "browser";
169
- /** Server-owned graph visibility. Shadow endpoints are persisted but not indexed. */
170
- graph_visibility?: GraphVisibility;
171
- /** Server-owned corroboration counters used for staged promotion. */
172
- corroboration?: EndpointCorroboration;
173
- /** Semantic v2 metadata for endpoint-level retrieval and DAG planning */
174
- semantic?: EndpointSemanticDescriptor;
175
- /** Path template inferred by batch mining (passive captures without a context page URL).
176
- * Internal annotation — not persisted to the skill manifest. */
177
- _minedTemplate?: string;
178
- /** Raw path binding evidence captured before semantic naming rewrites placeholders. */
179
- _path_binding_candidates?: EndpointPathBindingCandidate[];
180
- /** Structured search form spec — when present, indicates this endpoint can be driven
181
- * by filling a DOM form rather than a direct API call. Used by isStructuredSearchForm
182
- * to gate search-form execution paths. */
183
- search_form?: import("../execution/search-forms.js").SearchFormSpec;
184
- /** Optional third-party policy metadata surfaced to callers and enforced at execute time. */
185
- policy?: EndpointPolicyDescriptor;
186
- }
187
-
188
- export type ExecutionType = "http" | "browser-capture";
189
-
190
- /** Cost of the original live capture that discovered this skill */
191
- export interface DiscoveryCost {
192
- capture_ms: number;
193
- capture_tokens: number;
194
- response_bytes: number;
195
- captured_at: string;
196
- }
197
-
198
- export interface SkillOperationNode {
199
- operation_id: string;
200
- endpoint_id: string;
201
- method: EndpointDescriptor["method"];
202
- url_template: string;
203
- trigger_url?: string;
204
- action_kind: string;
205
- resource_kind: string;
206
- description_in?: string;
207
- description_out?: string;
208
- response_summary?: string;
209
- requires: OperationBinding[];
210
- provides: OperationBinding[];
211
- negative_tags?: string[];
212
- example_request?: unknown;
213
- example_response_compact?: unknown;
214
- example_fields?: string[];
215
- confidence: number;
216
- observed_at?: string;
217
- auth_required?: boolean;
218
- }
219
-
220
- export interface SkillOperationEdge {
221
- edge_id: string;
222
- from_operation_id: string;
223
- to_operation_id: string;
224
- binding_key: string;
225
- kind: "dependency" | "hint" | "parent_child" | "pagination" | "auth";
226
- confidence: number;
227
- }
228
-
229
- export interface SkillOperationGraph {
230
- generated_at: string;
231
- entry_operation_ids: string[];
232
- operations: SkillOperationNode[];
233
- edges: SkillOperationEdge[];
234
- }
235
-
236
- export interface SkillChunk {
237
- skill_id: string;
238
- intent?: string;
239
- available_operation_ids: string[];
240
- missing_bindings: string[];
241
- operations: SkillOperationNode[];
242
- edges: SkillOperationEdge[];
243
- }
244
-
245
- export interface AgentAvailableOperation {
246
- operation_id: string;
247
- method: EndpointDescriptor["method"];
248
- action_kind: string;
249
- resource_kind: string;
250
- title: string;
251
- why_available: string;
252
- url_template: string;
253
- requires: string[];
254
- yields: string[];
255
- example_request?: unknown;
256
- example_response_compact?: unknown;
257
- }
258
-
259
- export interface AgentPrefetchOperation {
260
- operation_id: string;
261
- endpoint_id: string;
262
- method: EndpointDescriptor["method"];
263
- action_kind: string;
264
- resource_kind: string;
265
- reason: string;
266
- binding_key: string;
267
- edge_kind: SkillOperationEdge["kind"];
268
- confidence: number;
269
- }
270
-
271
- export interface AgentWorkflowDagOperation {
272
- operation_id: string;
273
- endpoint_id: string;
274
- method: EndpointDescriptor["method"];
275
- action_kind: string;
276
- resource_kind: string;
277
- title: string;
278
- url_template: string;
279
- description_out?: string;
280
- requires: string[];
281
- yields: string[];
282
- runnable: boolean;
283
- prefetch_get_operations: AgentPrefetchOperation[];
284
- }
285
-
286
- export interface AgentWorkflowDagView {
287
- skill_id: string;
288
- intent?: string;
289
- missing_bindings: string[];
290
- suggested_next_operation_id?: string;
291
- operations: AgentWorkflowDagOperation[];
292
- edges: Array<{
293
- edge_id: string;
294
- from_operation_id: string;
295
- to_operation_id: string;
296
- binding_key: string;
297
- kind: SkillOperationEdge["kind"];
298
- confidence: number;
299
- }>;
300
- }
301
-
302
- export interface AgentSkillChunkView {
303
- skill_id: string;
304
- intent?: string;
305
- missing_bindings: string[];
306
- suggested_next_operation_id?: string;
307
- available_operations: AgentAvailableOperation[];
308
- }
309
-
310
- export interface SkillManifest {
311
- skill_id: string;
312
- version: string;
313
- schema_version: string;
314
- name: string;
315
- intent_signature: string;
316
- domain: string;
317
- subdomain?: string;
318
- description: string;
319
- owner_type: OwnerType;
320
- execution_type: ExecutionType;
321
- auth_profile_ref?: string;
322
- endpoints: EndpointDescriptor[];
323
- transform_ref?: string;
324
- lifecycle: SkillLifecycle;
325
- changelog?: string;
326
- created_at: string;
327
- updated_at: string;
328
- prev_version?: string;
329
- discovery_cost?: DiscoveryCost;
330
- /** Intent strings that contributed endpoints to this domain-level skill */
331
- intents?: string[];
332
- /** Agent ID of the indexer who published this skill - used for Tier 1 attribution */
333
- indexer_id?: string;
334
- /** All agents who contributed endpoints to this skill */
335
- contributors?: Array<{
336
- agent_id: string;
337
- wallet_address?: string;
338
- endpoints_contributed: number;
339
- cumulative_delta: number;
340
- share: number;
341
- first_contributed_at: string;
342
- last_contributed_at: string;
343
- }>;
344
- /** Cascade Split address — x402 payments route here for multi-contributor skills */
345
- split_config?: string;
346
- /** Graph v2: endpoint dependencies, semantic summaries, and dynamic availability */
347
- operation_graph?: SkillOperationGraph;
348
- /** Price in USD per execution; undefined or 0 = free */
349
- base_price_usd?: number;
350
- /** Whether the skill owner has opted into compensation */
351
- owner_compensation_opt_in?: boolean;
352
- /** Server-owned submission provenance for staged promotion and abuse analysis. */
353
- provenance_events?: SkillSubmissionProvenance[];
354
- /** Server-owned graph trust state. */
355
- trust?: SkillTrustMetadata;
356
- }
357
-
358
- export interface ExecutionTrace {
359
- trace_id: string;
360
- skill_id: string;
361
- endpoint_id: string;
362
- started_at: string;
363
- completed_at: string;
364
- success: boolean;
365
- session_id?: string;
366
- step_index?: number;
367
- state_hash?: string;
368
- candidate_count?: number;
369
- selected_operation_id?: string;
370
- reachable_operation_count?: number;
371
- api_call_count?: number;
372
- status_code?: number;
373
- error?: string;
374
- result?: unknown;
375
- har_lineage_id?: string;
376
- drift?: DriftResult;
377
- /** Set when response_schema was backfilled from this execution's response */
378
- schema_backfilled?: boolean;
379
- /** Estimated tokens consumed by the response */
380
- tokens_used?: number;
381
- /** Tokens saved vs original capture cost (0 for live captures) */
382
- tokens_saved?: number;
383
- /** Percentage tokens saved vs original capture cost */
384
- tokens_saved_pct?: number;
385
- /** Code version hash + git SHA — tracks which code produced this trace */
386
- trace_version?: string;
387
- }
388
-
389
- export interface DiscoveryCandidate {
390
- skill_id: string;
391
- score: number;
392
- confidence: "high" | "medium" | "low";
393
- predicted_risk: "safe" | "needs_confirmation";
394
- skill: SkillManifest;
395
- }
396
-
397
- // --- Response Schema & Projection Types ---
398
-
399
- export interface ResponseSchema {
400
- type: string;
401
- description?: string;
402
- enum_values?: Array<string | number | boolean>;
403
- properties?: Record<string, ResponseSchema>;
404
- items?: ResponseSchema;
405
- required?: string[];
406
- anyOf?: ResponseSchema[];
407
- inferred_from_samples: number;
408
- }
409
-
410
- export interface ProjectionOptions {
411
- fields?: string[];
412
- compact?: boolean;
413
- max_depth?: number;
414
- /** When true, skip server-side projection and return raw response data */
415
- raw?: boolean;
416
- }
417
-
418
- export interface DriftResult {
419
- drifted: boolean;
420
- added_fields: string[];
421
- removed_fields: string[];
422
- type_changes: Array<{ path: string; was: string; now: string }>;
423
- }
424
-
425
- export interface EndpointStats {
426
- total_executions: number;
427
- successful_executions: number;
428
- consecutive_failures: number;
429
- avg_latency_ms: number;
430
- feedback_sum: number;
431
- feedback_count: number;
432
- drift_count: number;
433
- last_execution_at?: string;
434
- last_success_at?: string;
435
- }
436
-
437
- export interface ExecutionOptions {
438
- confirm_unsafe?: boolean;
439
- /** Explicit user confirmation for domains/actions that may violate third-party site terms. */
440
- confirm_third_party_terms?: boolean;
441
- dry_run?: boolean;
442
- /** User's request intent — used for endpoint ranking instead of skill.intent_signature */
443
- intent?: string;
444
- /** The page URL the user is asking about — used to boost endpoints captured from that page */
445
- contextUrl?: string;
446
- /** Skip marketplace search and caches — go straight to browser capture */
447
- force_capture?: boolean;
448
- /** Request/client namespace for isolating local server state across concurrent CLI users */
449
- client_scope?: string;
450
- /** Set only when the caller has already completed payment verification for a paid run */
451
- payment_verified?: boolean;
452
- /** Skip robots.txt compliance check (e.g. for testing or trusted internal domains) */
453
- skip_robots_check?: boolean;
454
- }
455
-
456
- export interface ValidationResult {
457
- valid: boolean;
458
- hardErrors: string[];
459
- softWarnings: string[];
460
- }
461
-
462
- /** Orchestrator-level timing breakdown for a single resolve call */
463
- export interface OrchestrationTiming {
464
- search_ms: number;
465
- get_skill_ms: number;
466
- execute_ms: number;
467
- total_ms: number;
468
- source: "marketplace" | "live-capture" | "dom-fallback" | "route-cache" | "browser-action";
469
- cache_hit: boolean;
470
- candidates_found: number;
471
- candidates_tried: number;
472
- skill_id?: string;
473
- /** Estimated agent context tokens saved vs manual browsing */
474
- tokens_saved: number;
475
- /** Size of the structured response in bytes */
476
- response_bytes: number;
477
- /** Percentage time saved vs estimated live capture baseline */
478
- time_saved_pct: number;
479
- /** Percentage token saved vs estimated full-page browsing cost */
480
- tokens_saved_pct: number;
481
- /** Real capture baseline in ms when known */
482
- baseline_total_ms?: number;
483
- /** Actual runtime latency in ms for this resolve */
484
- actual_total_ms?: number;
485
- /** Real time saved in ms when baseline is known */
486
- time_saved_ms?: number;
487
- /** Real baseline cost in micro-cents when known */
488
- baseline_cost_uc?: number;
489
- /** Real amount charged for this run in micro-cents */
490
- actual_cost_uc?: number;
491
- /** Real cost saved in micro-cents when baseline is known */
492
- cost_saved_uc?: number;
493
- /** Tier 3 search fee charged during this resolve */
494
- paid_search_uc?: number;
495
- /** Paid execution fee charged during this resolve */
496
- paid_execution_uc?: number;
497
- /** Code version hash + git SHA — tracks which code produced this timing */
498
- trace_version?: string;
499
- }
500
-
501
- export type RoutingRunType = "single_shot" | "long_running";
502
- export type RoutingTelemetrySource =
503
- | "route-cache"
504
- | "marketplace"
505
- | "graph"
506
- | "live-capture"
507
- | "browser-action"
508
- | "defer";
509
- export type RoutingSessionOutcome = "success" | "failure" | "defer" | "abandon";
510
-
511
- export interface RoutingContextBuckets {
512
- role: "general" | "developer" | "researcher" | "analyst" | "operator" | "unknown";
513
- cost_sensitivity: "low" | "medium" | "high" | "unknown";
514
- latency_sensitivity: "low" | "medium" | "high" | "unknown";
515
- output_preference: "structured" | "raw" | "mixed" | "unknown";
516
- task_horizon: "short" | "long" | "unknown";
517
- has_prior_history: boolean;
518
- }
519
-
520
- export interface RoutingCandidateSnapshot {
521
- candidate_id: string;
522
- rank: number;
523
- skill_id?: string;
524
- endpoint_id: string;
525
- operation_id?: string;
526
- route_fingerprint: string;
527
- score: number;
528
- chosen: boolean;
529
- reachable: boolean;
530
- rejection_reason?: string;
531
- feature_snapshot: {
532
- method?: string;
533
- has_response_schema: boolean;
534
- dom_extraction: boolean;
535
- verification_status?: string;
536
- reliability_score?: number;
537
- unsafe_action_score?: number;
538
- };
539
- }
540
-
541
- export interface RoutingTelemetryBaseEvent {
542
- event_id: string;
543
- event_type:
544
- | "routing_session_started"
545
- | "routing_candidates_ranked"
546
- | "routing_step_executed"
547
- | "routing_session_completed";
548
- session_id: string;
549
- created_at: string;
550
- trace_version?: string;
551
- anonymized_agent_id?: string;
552
- top_level_intent: string;
553
- normalized_domains: string[];
554
- run_type: RoutingRunType;
555
- }
556
-
557
- export interface RoutingSessionEvent extends RoutingTelemetryBaseEvent {
558
- event_type: "routing_session_started";
559
- context_buckets: RoutingContextBuckets;
560
- }
561
-
562
- export interface RoutingCandidateEvent extends RoutingTelemetryBaseEvent {
563
- event_type: "routing_candidates_ranked";
564
- step_id: string;
565
- step_index: number;
566
- source: RoutingTelemetrySource;
567
- state_hash_before: string;
568
- candidate_count: number;
569
- reachable_operation_count?: number;
570
- available_binding_count?: number;
571
- missing_binding_count?: number;
572
- selected_endpoint_id?: string;
573
- selected_operation_id?: string;
574
- candidates: RoutingCandidateSnapshot[];
575
- }
576
-
577
- export interface RoutingStepEvent extends RoutingTelemetryBaseEvent {
578
- event_type: "routing_step_executed";
579
- step_id: string;
580
- step_index: number;
581
- source: RoutingTelemetrySource;
582
- state_hash_before: string;
583
- state_hash_after: string;
584
- selected_skill_id?: string;
585
- selected_endpoint_id?: string;
586
- selected_operation_id?: string;
587
- reachable_operation_count?: number;
588
- available_binding_count?: number;
589
- missing_binding_count?: number;
590
- candidate_count: number;
591
- execution_latency_ms?: number;
592
- status_code?: number;
593
- success?: boolean;
594
- failure_reason?: string;
595
- schema_fingerprint?: string;
596
- response_hash?: string;
597
- cross_domain_transition: boolean;
598
- retry_count: number;
599
- user_override: boolean;
600
- did_step_unlock_next_step: boolean;
601
- required_recovery: boolean;
602
- }
603
-
604
- export interface RoutingSessionCompletedEvent extends RoutingTelemetryBaseEvent {
605
- event_type: "routing_session_completed";
606
- completed_at: string;
607
- final_outcome: RoutingSessionOutcome;
608
- final_success: boolean;
609
- total_steps: number;
610
- total_candidates_ranked: number;
611
- total_api_calls: number;
612
- retry_count: number;
613
- user_override: boolean;
614
- required_recovery: boolean;
615
- }
616
-
617
- export type RoutingTelemetryEvent =
618
- | RoutingSessionEvent
619
- | RoutingCandidateEvent
620
- | RoutingStepEvent
621
- | RoutingSessionCompletedEvent;
622
-
623
- export type WorkflowStepStrategy = "server" | "trigger-intercept" | "browser-action" | "browser-fetch";
624
-
625
- export interface WorkflowActionStep {
626
- action: string;
627
- selector?: string;
628
- value?: string;
629
- ref?: string;
630
- step_index?: number;
631
- }
632
-
633
- export interface WorkflowTokenCandidate {
634
- source_kind: "cookie" | "request_header" | "response_header" | "request_body" | "hidden_input" | "meta" | "bootstrap_json";
635
- source_name: string;
636
- source_path?: string;
637
- observed_value?: string;
638
- confidence: number;
639
- }
640
-
641
- export interface TokenBinding {
642
- binding_id: string;
643
- target_location: "header" | "body";
644
- target_name: string;
645
- refresh_on_statuses: number[];
646
- candidates: WorkflowTokenCandidate[];
647
- selected_source_kind?: WorkflowTokenCandidate["source_kind"];
648
- selected_source_name?: string;
649
- }
650
-
651
- export interface MutationGuard {
652
- confirm_unsafe_required: boolean;
653
- provenance_backed: boolean;
654
- auth_required: boolean;
655
- parameter_mapping_confident: boolean;
656
- block_reason?: string;
657
- }
658
-
659
- export interface WorkflowStep {
660
- step_id: string;
661
- strategy: WorkflowStepStrategy;
662
- provenance: "observed-request" | "bundle-inferred" | "dom-form" | "trigger-url" | "learned-runtime";
663
- trigger_url?: string;
664
- action_sequence?: WorkflowActionStep[];
665
- success_count?: number;
666
- failure_count?: number;
667
- last_status?: number;
668
- last_error?: string;
669
- last_used_at?: string;
670
- }
671
-
672
- export interface WorkflowRecipe {
673
- recipe_id: string;
674
- endpoint_id: string;
675
- operation_id?: string;
676
- preferred: boolean;
677
- provenance_backed: boolean;
678
- steps: WorkflowStep[];
679
- token_bindings: TokenBinding[];
680
- mutation_guard: MutationGuard;
681
- replay_contract: WorkflowReplayContract;
682
- last_successful_strategy?: WorkflowStepStrategy;
683
- last_used_at?: string;
684
- }
685
-
686
- export interface WorkflowDomFieldHint {
687
- form_selector?: string;
688
- field_name: string;
689
- value?: string;
690
- field_type?: string;
691
- selector?: string;
692
- required?: boolean;
693
- pattern?: string;
694
- min?: string;
695
- max?: string;
696
- }
697
-
698
- export interface WorkflowMetaHint {
699
- key: string;
700
- value: string;
701
- }
702
-
703
- export interface WorkflowBootstrapHint {
704
- path: string;
705
- value: string;
706
- }
707
-
708
- export interface WorkflowDomOptionHint {
709
- form_selector?: string;
710
- field_name: string;
711
- values: string[];
712
- labels?: string[];
713
- field_type?: string;
714
- }
715
-
716
- export interface WorkflowParameterSourceHint {
717
- source_kind:
718
- | WorkflowTokenCandidate["source_kind"]
719
- | "path_template"
720
- | "query_default"
721
- | "body_default"
722
- | "observed_query"
723
- | "observed_body"
724
- | "semantic_requires";
725
- source_name: string;
726
- source_path?: string;
727
- confidence?: number;
728
- }
729
-
730
- export interface WorkflowParameterConstraint {
731
- kind: "enum" | "format" | "pattern" | "min" | "max";
732
- value?: string | number | boolean;
733
- description?: string;
734
- }
735
-
736
- export interface WorkflowParameterSpec {
737
- name: string;
738
- location: "path" | "query" | "body" | "header";
739
- description?: string;
740
- type: "string" | "number" | "integer" | "boolean" | "object" | "array";
741
- required: boolean;
742
- user_supplied: boolean;
743
- default_value?: unknown;
744
- example_value?: unknown;
745
- format?: string;
746
- enum_values?: Array<string | number | boolean>;
747
- derived_from?: string[];
748
- constraints?: WorkflowParameterConstraint[];
749
- source_hints: WorkflowParameterSourceHint[];
750
- }
751
-
752
- export interface EndpointParameterReview {
753
- name: string;
754
- location: "path" | "query" | "body" | "header";
755
- description?: string;
756
- type?: "string" | "number" | "integer" | "boolean" | "object" | "array";
757
- required?: boolean;
758
- user_supplied?: boolean;
759
- format?: string;
760
- enum_values?: Array<string | number | boolean>;
761
- derived_from?: string[];
762
- }
763
-
764
- export interface EndpointResponseFieldReview {
765
- path: string;
766
- description?: string;
767
- type?: string;
768
- enum_values?: Array<string | number | boolean>;
769
- }
770
-
771
- export interface EndpointReviewPayload {
772
- endpoint_id: string;
773
- description?: string;
774
- action_kind?: string;
775
- resource_kind?: string;
776
- example_request?: unknown;
777
- example_response?: unknown;
778
- parameter_reviews?: EndpointParameterReview[];
779
- response_reviews?: EndpointResponseFieldReview[];
780
- }
781
-
782
- export interface WorkflowPrerequisiteSpec {
783
- prerequisite_id: string;
784
- kind: "authenticated-session" | "token-binding" | "hidden-field" | "page-context" | "browser-action" | "submit-blocker";
785
- name: string;
786
- description?: string;
787
- required: boolean;
788
- selector?: string;
789
- source_kind?: string;
790
- source_name?: string;
791
- derived_from?: string;
792
- }
793
-
794
- export interface WorkflowNextStateSpec {
795
- kind: "page_url" | "response_schema" | "dom_selector";
796
- value: string;
797
- description?: string;
798
- }
799
-
800
- export interface WorkflowPaymentRequirementSpec {
801
- status: "free" | "x402_optional" | "x402_required";
802
- price_usd?: string;
803
- currency?: string;
804
- wallet_required: boolean;
805
- provider_hint?: string;
806
- confirmation_field?: "payment_verified";
807
- reason?: string;
808
- }
809
-
810
- export interface WorkflowReplayContract {
811
- explicit_replay_only: boolean;
812
- exposure_stage: "publish";
813
- dependency_bindings: string[];
814
- search_terms: string[];
815
- parameter_specs: WorkflowParameterSpec[];
816
- prerequisite_specs: WorkflowPrerequisiteSpec[];
817
- next_state: WorkflowNextStateSpec[];
818
- payment_requirement: WorkflowPaymentRequirementSpec;
819
- }
820
-
821
- export interface WorkflowEvidence {
822
- observed_request_count: number;
823
- observed_request_urls: string[];
824
- har_lineage_ids: Array<string | undefined>;
825
- trigger_urls: string[];
826
- js_bundle_urls: string[];
827
- dom_form_hints: WorkflowDomFieldHint[];
828
- dom_option_hints: WorkflowDomOptionHint[];
829
- meta_hints: WorkflowMetaHint[];
830
- bootstrap_hints: WorkflowBootstrapHint[];
831
- }
832
-
833
- export interface WorkflowArtifact {
834
- artifact_version: string;
835
- skill_id: string;
836
- domain: string;
837
- intent_signature: string;
838
- captured_at: string;
839
- final_url: string;
840
- auth_state: {
841
- auth_profile_ref?: string;
842
- cookie_names: string[];
843
- header_names: string[];
844
- authenticated: boolean;
845
- };
846
- evidence: WorkflowEvidence;
847
- recipes: WorkflowRecipe[];
848
- }
849
-
850
- export type WorkflowPublishStatus = "captured" | "indexed" | "blocked-validation" | "published";
851
-
852
- export interface WorkflowPublishBindingSource {
853
- source_kind: WorkflowTokenCandidate["source_kind"];
854
- source_name: string;
855
- source_path?: string;
856
- confidence: number;
857
- }
858
-
859
- export interface WorkflowPublishBinding {
860
- target_location: TokenBinding["target_location"];
861
- target_name: string;
862
- refresh_on_statuses: number[];
863
- selected_source_kind?: TokenBinding["selected_source_kind"];
864
- selected_source_name?: string;
865
- candidates: WorkflowPublishBindingSource[];
866
- }
867
-
868
- export interface WorkflowPublishRecipe {
869
- endpoint_id: string;
870
- operation_id?: string;
871
- preferred: boolean;
872
- provenance_backed: boolean;
873
- last_successful_strategy?: WorkflowStepStrategy;
874
- steps: Array<{
875
- strategy: WorkflowStepStrategy;
876
- provenance: WorkflowStep["provenance"];
877
- trigger_url?: string;
878
- action_count: number;
879
- }>;
880
- mutation_guard: MutationGuard;
881
- token_bindings: WorkflowPublishBinding[];
882
- replay_contract: WorkflowReplayContract;
883
- usage_notes: string[];
884
- }
885
-
886
- export interface WorkflowPublishArtifact {
887
- export_version: string;
888
- generated_at: string;
889
- publish_status: WorkflowPublishStatus;
890
- published_at?: string;
891
- validation_errors?: string[];
892
- skill_id: string;
893
- domain: string;
894
- intent_signature: string;
895
- sanitized_endpoints: EndpointDescriptor[];
896
- workflow_summary: {
897
- recipe_count: number;
898
- preferred_endpoint_ids: string[];
899
- authenticated_capture: boolean;
900
- token_binding_count: number;
901
- trigger_url_count: number;
902
- included_endpoint_count: number;
903
- root_endpoint_ids: string[];
904
- closure_added_count: number;
905
- };
906
- auth_summary: WorkflowArtifact["auth_state"];
907
- recipes: WorkflowPublishRecipe[];
908
- docs: {
909
- headline: string;
910
- bullets: string[];
911
- };
912
- }