@tangle-network/agent-app 0.60.143 → 0.60.144

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.
@@ -121,9 +121,9 @@ export declare function createPublicConsultation(options: PublicConsultationOpti
121
121
  executionBudget?: ChatTurnExecutionLimits;
122
122
  maxOutputTokens?: number;
123
123
  }) => Promise<{
124
+ start?: undefined;
124
125
  status: 'unsupported';
125
126
  reason: string;
126
- start?: undefined;
127
127
  } | {
128
128
  reason?: undefined;
129
129
  status: 'prepared';
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Network budget for the browser checks (`shell-alignment`, `surface-ladder`,
3
+ * `workspace-surface`) when they run against a live site.
4
+ *
5
+ * Every Tangle app sits behind one Cloudflare zone that allows 1000 requests per
6
+ * 10 s per IP, and the fleet's Beelinks and workstation share one egress IP. On
7
+ * 2026-10-12 a production sweep of these checks sent 1533-1782 requests a minute:
8
+ * each page load pulled every asset, and Cloudflare's speculation rules made
9
+ * Chromium prerender every rail link as a hidden full page. It blocked a
10
+ * production canary on another app. So the checks:
11
+ *
12
+ * - launch Chromium with prerender and speculative prefetch off, and abort the
13
+ * zone's `/cdn-cgi/speculation` rules;
14
+ * - count every request a context makes and wait before a navigation whenever
15
+ * the last 10 s already holds `REQUEST_BUDGET_PER_10S`;
16
+ * - report the total and the busiest 10 s, so a run can be checked against the
17
+ * edge's own count.
18
+ */
19
+ import type { BrowserContext } from 'playwright';
20
+ /** Chromium flags that stop prerender and speculative prefetch of linked pages. */
21
+ export declare const QUIET_CHROMIUM_ARGS: readonly string[];
22
+ /** Requests per 10 s a check may send; a quarter of the shared zone limit. */
23
+ export declare const REQUEST_BUDGET_PER_10S = 250;
24
+ export interface NetworkCount {
25
+ /** Requests the browser sent during the run. */
26
+ readonly requests: number;
27
+ /** The most requests inside any 10 s window. */
28
+ readonly peak10s: number;
29
+ }
30
+ export interface RequestMeter {
31
+ /** Count one request. */
32
+ record(now?: number): void;
33
+ /** Resolve once the last 10 s holds fewer than the budget. */
34
+ pace(): Promise<void>;
35
+ count(): NetworkCount;
36
+ }
37
+ export declare function createRequestMeter(budget?: number, sleep?: (ms: number) => Promise<void>): RequestMeter;
38
+ /** Abort the zone's speculation rules and count every request the context sends. */
39
+ export declare function meterContext(context: BrowserContext, meter: RequestMeter): Promise<void>;
40
+ export declare function formatNetworkCount(count: NetworkCount): string;
@@ -6,7 +6,7 @@ import {
6
6
  runSignoff,
7
7
  runSurfaceLadderCli,
8
8
  runWorkspaceSurfaceCli
9
- } from "../chunk-NK3ZVZPP.js";
9
+ } from "../chunk-XAU3UN32.js";
10
10
  import {
11
11
  invokedAsScript
12
12
  } from "../chunk-C3CAYGGQ.js";
@@ -59,5 +59,6 @@ export { checkSurfaceLadder, collectSurfaceLadder, composite, contrastRatio, for
59
59
  export { parseSurfaceLadderArgs, runSurfaceLadderCli } from './surface-ladder-cli';
60
60
  export { checkWorkspaceSurface, collectWorkspaceSurface, formatWorkspaceSurfaceReport, judgeWorkspaceSurface, HEADER_TOP_TOLERANCE_PX, type WorkspaceSurfaceFinding, type WorkspaceSurfaceOptions, type WorkspaceSurfaceReport, type WorkspaceSurfaceSample, } from './workspace-surface';
61
61
  export { runWorkspaceSurfaceCli } from './workspace-surface-cli';
62
+ export { createRequestMeter, formatNetworkCount, meterContext, QUIET_CHROMIUM_ARGS, REQUEST_BUDGET_PER_10S, type NetworkCount, type RequestMeter, } from './browser-budget';
62
63
  export { checkWorkerDefaults, formatWorkerDefaults, WORKER_COMPATIBILITY_DATE_FLOOR, type WorkerDefaultsFinding, type WorkerDefaultsResult, } from './worker-defaults';
63
64
  export type { LoadedSignoffConfig, SignoffAttempt, SignoffConfig, SignoffConfigOrigin, SignoffEvent, SignoffHostFacts, SignoffInstallResult, SignoffInstallSpec, SignoffRepoFacts, SignoffReport, SignoffShuffleSpec, SignoffSource, SignoffStepResult, SignoffStepSpec, SignoffStepStatus, } from './types';
@@ -1,5 +1,7 @@
1
1
  import {
2
2
  HEADER_TOP_TOLERANCE_PX,
3
+ QUIET_CHROMIUM_ARGS,
4
+ REQUEST_BUDGET_PER_10S,
3
5
  SHELL_ALIGNMENT_TOLERANCE_PX,
4
6
  SURFACE_LADDER_MAX_WORDS,
5
7
  SURFACE_LADDER_MIN_BORDER_CONTRAST,
@@ -14,6 +16,8 @@ import {
14
16
  collectWorkspaceSurface,
15
17
  composite,
16
18
  contrastRatio,
19
+ createRequestMeter,
20
+ formatNetworkCount,
17
21
  formatShellAlignmentReport,
18
22
  formatSignoffReport,
19
23
  formatSurfaceLadderReport,
@@ -23,6 +27,7 @@ import {
23
27
  judgeSurfaceLadder,
24
28
  judgeWorkspaceSurface,
25
29
  loadSignoffConfig,
30
+ meterContext,
26
31
  oklchL,
27
32
  parseShellAlignmentArgs,
28
33
  parseSurfaceLadderArgs,
@@ -32,9 +37,11 @@ import {
32
37
  runWorkspaceSurfaceCli,
33
38
  summarizeSurfacePage,
34
39
  surfaceDeltaL
35
- } from "../chunk-NK3ZVZPP.js";
40
+ } from "../chunk-XAU3UN32.js";
36
41
  export {
37
42
  HEADER_TOP_TOLERANCE_PX,
43
+ QUIET_CHROMIUM_ARGS,
44
+ REQUEST_BUDGET_PER_10S,
38
45
  SHELL_ALIGNMENT_TOLERANCE_PX,
39
46
  SURFACE_LADDER_MAX_WORDS,
40
47
  SURFACE_LADDER_MIN_BORDER_CONTRAST,
@@ -49,6 +56,8 @@ export {
49
56
  collectWorkspaceSurface,
50
57
  composite,
51
58
  contrastRatio,
59
+ createRequestMeter,
60
+ formatNetworkCount,
52
61
  formatShellAlignmentReport,
53
62
  formatSignoffReport,
54
63
  formatSurfaceLadderReport,
@@ -58,6 +67,7 @@ export {
58
67
  judgeSurfaceLadder,
59
68
  judgeWorkspaceSurface,
60
69
  loadSignoffConfig,
70
+ meterContext,
61
71
  oklchL,
62
72
  parseShellAlignmentArgs,
63
73
  parseSurfaceLadderArgs,
@@ -11,6 +11,7 @@
11
11
  * The browser half (`collectShellDividers`) only reads geometry; the decision
12
12
  * (`judgeShellAlignment`) is a pure function so it is unit-tested without a browser.
13
13
  */
14
+ import { type NetworkCount } from './browser-budget';
14
15
  /** A horizontal divider: the bottom border of a top-anchored row. Coordinates in CSS px. */
15
16
  export interface ShellDivider {
16
17
  readonly label: string;
@@ -73,6 +74,8 @@ export interface ShellAlignmentOptions {
73
74
  readonly readySelector?: string;
74
75
  }
75
76
  export interface ShellAlignmentReport {
77
+ /** Requests the run sent and its busiest 10 s (see browser-budget.ts). */
78
+ readonly network?: NetworkCount;
76
79
  readonly samples: readonly ShellDividerSample[];
77
80
  readonly findings: readonly ShellAlignmentFinding[];
78
81
  readonly maxOffsetPx: number;
@@ -24,6 +24,7 @@
24
24
  * the decision (`judgeSurfaceLadder`) and the color math are pure functions, so
25
25
  * they are unit-tested without a browser.
26
26
  */
27
+ import { type NetworkCount } from './browser-budget';
27
28
  /** sRGB channels 0–255. */
28
29
  export type Rgb = readonly [number, number, number];
29
30
  /** sRGB channels 0–255 plus alpha 0–1. */
@@ -130,6 +131,8 @@ export interface SurfacePageSummary {
130
131
  readonly medianCardWords: number | null;
131
132
  }
132
133
  export interface SurfaceLadderReport {
134
+ /** Requests the run sent and its busiest 10 s (see browser-budget.ts). */
135
+ readonly network?: NetworkCount;
133
136
  readonly samples: readonly SurfaceSample[];
134
137
  readonly pages: readonly SurfacePageSummary[];
135
138
  readonly findings: readonly SurfaceFinding[];
@@ -10,6 +10,7 @@
10
10
  * the rendered page, so a wrapper that only looks right in the source cannot
11
11
  * pass it.
12
12
  */
13
+ import { type NetworkCount } from './browser-budget';
13
14
  export interface WorkspaceSurfaceSample {
14
15
  readonly route: string;
15
16
  readonly width: number;
@@ -43,6 +44,8 @@ export interface WorkspaceSurfaceOptions {
43
44
  readonly readySelector?: string;
44
45
  }
45
46
  export interface WorkspaceSurfaceReport {
47
+ /** Requests the run sent and its busiest 10 s (see browser-budget.ts). */
48
+ readonly network?: NetworkCount;
46
49
  readonly samples: readonly WorkspaceSurfaceSample[];
47
50
  readonly findings: readonly WorkspaceSurfaceFinding[];
48
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "0.60.143",
3
+ "version": "0.60.144",
4
4
  "packageManager": "pnpm@11.24.0",
5
5
  "description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
6
6
  "keywords": [