@parcha/agentrun 0.1.0 → 0.2.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ ## 0.2.1
4
+
5
+ - Agent records from `getAgent` and `listAgents` expose `instructions`, `skills`, and `tools`, the names `new Agent()` takes. `system_prompt`, `skill_names`, and `mcp_tool_names` still hold the same values.
6
+ - `getBatchResults` rows are typed as the new `BatchResultRow`: `row_number`, `status`, `raw_status`, `run_id`, `headline`, `excerpt`, `report_link`, `structured_output`, `is_public`, and error fields. They no longer advertise `question` or `row_data`, which the results endpoint does not return; those are on `getBatch(id).rows`. The README batch examples now match.
7
+
8
+ ## 0.2.0 (unreleased)
9
+
10
+ Rewrite targeting the unified v2 API. Requires the unified v2 backend.
11
+
12
+ - Default base URL is `https://api.grep.ai/api/v2`. `AGENTRUN_API_KEY` and `AGENTRUN_BASE_URL` are read from the environment in Node.
13
+ - Package restructured into `errors`, `models`, `ops`, `http`, `client`, `agent`, and `batch`, mirroring the Python SDK.
14
+ - Requests are serialised to the v2 vocabulary (`question`, `expert_id`, `domain`, `json_schema`, `batch_name`, `questions`, `inputs`). Every record exposes `id` whatever the API calls it.
15
+ - Run, batch, and row statuses are mapped to a short SDK vocabulary; the original is in `raw_status`.
16
+ - One error class per HTTP status family. Errors read the API's `{"error": {...}}` envelope and carry `statusCode`, `body`, and `requestId`. Non-JSON bodies raise `InvalidResponseError`; local deadlines raise `PollTimeoutError`.
17
+ - Every method returns a promise, so validation failures reject instead of throwing.
18
+ - Request limits from the API contract (skill lengths, `maxCostUsd`, batch name, build context) are checked locally.
19
+ - `formInputs` on batches and loops, `records` on campaigns, `includeRows` on `getBatch`, `getUsage`, `iterRuns`, `Agent.save`, `Skill.read`.
20
+ - `outputSchema` accepts a JSON schema or any object with `toJSONSchema()`.
21
+ - `downloadCampaignArtifact` returns an `Artifact`, a `Blob` with the server's `filename`.
22
+ - Dual ESM and CommonJS build with type declarations. No runtime dependencies.
23
+ - `tests/fixtures/public-v2.json` carries the backend's OpenAPI contract; every request is validated against it in tests.
24
+
25
+ ## 0.1.0
26
+
27
+ Initial release against the pre-release website proxy.
package/README.md CHANGED
@@ -1,171 +1,199 @@
1
- # agentrun
1
+ # AgentRun TypeScript SDK
2
2
 
3
- A dependency-free Node.js client for agentrun's headless API.
3
+ Create agents, run them on your inputs, and collect the results. Typed, promise-based, no runtime dependencies. Node 20.9 or newer, or any runtime with `fetch`.
4
4
 
5
5
  ```sh
6
6
  npm install @parcha/agentrun
7
7
  ```
8
8
 
9
+ ## Quick start
10
+
11
+ Set `AGENTRUN_API_KEY` in your environment, then:
12
+
9
13
  ```ts
10
- import { Agent } from '@parcha/agentrun';
14
+ import { Agent } from "@parcha/agentrun";
15
+
11
16
  const agent = new Agent({
12
- apiKey: process.env.AGENTRUN_API_KEY!,
13
- name: 'Verifier',
14
- instructions: 'Verify the company and cite evidence.',
15
- // Set baseURL to your agentrun deployment while running locally.
17
+ name: "Company verifier",
18
+ instructions: "Verify the company and cite primary sources.",
16
19
  });
17
- const run = await agent.run('Verify acme.example', { idempotencyKey: 'acme-001' });
20
+ const run = await agent.run("Verify acme.example");
18
21
  const result = await agent.wait(run.id);
19
- console.log(result.status, result.report);
20
- ```
21
22
 
22
- `create()` saves an agent without starting a run. Reuse an existing agent with `id` instead of `name` and `instructions`. `getRun(id)` reads progress; `cancelRun(id)` requests cancellation. `wait(id)` returns completed, failed, blocked, or cancelled results; inspect `status` before using the report. Aborting a local request or polling deadline does not cancel an already accepted run.
23
+ console.log(result.status); // "completed", "failed", "cancelled", or "blocked"
24
+ console.log(result.report?.markdown); // the report, or undefined
25
+ ```
23
26
 
24
- Credentials belong in your server environment. The SDK never retries creation or execution automatically. Use stable idempotency keys for run retries. Recover the agent ID after an ambiguous create timeout instead of blindly creating it again.
27
+ `Agent` saves itself on the first call that needs it. Save `agent.id` and pass `new Agent({ id })` next time to reuse it. Two things to know about `wait`. It returns for every terminal status, so check `result.status` before using the report. It gives up after 10 minutes by default and throws `PollTimeoutError`, but the run keeps going on the server. Call `agent.getRun(run.id)` later to fetch it.
25
28
 
26
- Build and pack from the parent website with `npm run sdk:pack`. The generated tarball can be installed directly for local testing.
29
+ Outside Node, or to avoid environment variables, pass `apiKey` to the constructor.
27
30
 
28
- ## Discover skills and tools
31
+ ## Build an agent from a description
29
32
 
30
33
  ```ts
31
- import { AgentRun } from '@parcha/agentrun';
32
- const client = new AgentRun({ apiKey: process.env.AGENTRUN_API_KEY! });
33
- const skills = await client.listSkills({ query: 'company', limit: 500 });
34
- const tools = await client.listIntegrations({ query: 'company', limit: 500 });
35
- const agent = client.agent({
36
- name: 'Company verifier',
37
- instructions: 'Verify the company and cite evidence.',
38
- skills: skills.skills.map(skill => skill.name),
39
- tools: tools.tools.filter(tool => !tool.always_on).map(tool => tool.name),
40
- });
34
+ const agent = await Agent.create("Research companies and cite sources.");
35
+ // Save agent.buildId if this process might stop.
36
+ await agent.waitUntilReady(); // builds can take a few minutes
37
+ const run = await agent.run("Research acme.example");
41
38
  ```
42
39
 
43
- `listAgents()`, `getAgent(id)`, `updateAgent(id, definition)`, and `deleteAgent(id)` manage your definitions. `listRuns({cursor, limit})` reads run history. Run reports expose Markdown through `result.report?.markdown` and optional structured fields through `result.structured_output`.
44
-
45
- ## Build an agent from plain English
46
-
47
- ```ts
48
- const agent = await Agent.create({
49
- apiKey: process.env.AGENTRUN_API_KEY!,
50
- prompt: 'Research companies and cite sources.',
51
- });
52
- // Save agent.buildId to resume if this process stops.
53
- await agent.waitUntilReady();
54
- const run = await agent.run('Research acme.example');
55
- const result = await agent.wait(run.id);
56
- ```
40
+ Resume an unfinished build with `new Agent({ buildId })`. Any run method waits for the build first. A build that fails throws `BuildError`; read `error.build.error` for the reason.
57
41
 
58
- Creation can take a few minutes. `waitUntilReady({ timeoutMs, intervalMs, signal })` polls the build and activates its draft; its defaults are 20 minutes and one-second polling. `run()` also waits automatically. A failed build throws `AgentBuildError`. A timeout or abort stops local waiting, not the remote build. Resume with `new Agent({ apiKey, buildId })`; inspect with `client.getBuild(buildId)`. No creation request is retried automatically. Caller-defined agents still use `new Agent({name, instructions, apiKey})` and the instance `create()` method without a generation job.
42
+ ## Structured output
59
43
 
60
- ## Reusable skills
44
+ Pass a JSON schema, or any object with a `toJSONSchema()` method, as `outputSchema`. The result's `structured_output` is the parsed object.
61
45
 
62
46
  ```ts
63
- import { Skill } from '@parcha/agentrun';
64
- const skill = await Skill.create({
65
- apiKey: process.env.AGENTRUN_API_KEY!,
66
- name: 'source-check',
67
- description: 'Verify each claim against its primary source.',
68
- content: '# Source check\nFind a primary source for every claim. Cite evidence and flag any gaps.',
47
+ const run = await agent.run("Verify acme.example", {
48
+ outputSchema: { type: "object", properties: { verified: { type: "boolean" } } },
69
49
  });
50
+ const { structured_output } = await agent.wait(run.id);
70
51
  ```
71
52
 
72
- Attach `skill.name` in an agent definition's `skills` array. `client.createSkill(definition)` provides the same operation, and `client.getSkill(name)` reads its Markdown. Creating a skill with the same name updates your own existing skill (`created: false`); use a new name to preserve the previous one. Requires agent write permission.
53
+ ## Batches
73
54
 
74
- ## Batch lists and CSV inputs
55
+ Run up to 100 inputs at once. The SDK checks the limits before sending anything.
75
56
 
76
57
  ```ts
77
- const batch = await agent.batch(['Research acme.example', 'Research beta.example'], {
78
- name: 'Company checks', maxConcurrent: 2, idempotencyKey: 'checks-001',
58
+ const batch = await agent.batch(["Verify acme.example", "Verify beta.example"], {
59
+ name: "Q3 checks",
60
+ maxConcurrent: 5,
61
+ idempotencyKey: "q3-checks-001",
79
62
  });
80
- const status = await agent.waitBatch(batch.id);
81
- const results = await agent.getBatchResults(batch.id);
82
- // csv may be a string or an uploaded File/Blob; headers must be unique.
83
- const uploaded = await agent.batch({ csv, inputColumn: 'input' }, { name: 'CSV checks' });
63
+ const done = await agent.waitBatch(batch.id);
64
+ for (const row of (await agent.getBatchResults(batch.id)).results) {
65
+ console.log(row.row_number, row.status, row.run_id, row.headline);
66
+ }
84
67
  ```
85
68
 
86
- Each batch accepts 1–100 nonblank inputs (up to 8,000 characters each). CSV is limited to 1 MB and additional columns are retained as row data. Quotes, escaped quotes, commas, and embedded newlines are supported. Oversized batches are rejected before agent creation; the SDK never silently splits or retries paid work. Batch execution must be enabled for the upstream account.
87
-
88
- `getBatch`, `listBatches`, `getBatchResults`, `cancelBatch`, and `retryBatch` expose the lifecycle. `waitBatch` returns on completion, partial failure, failure, cancellation, or a pause reason that requires attention. Inspect row outcomes and follow each `run_id` with `getRun` for full reports. Cancellation stops new dispatches; running rows settle on their own. Explicit retries can consume more credits. Options support `maxCredits`, `maxConcurrent` (1–20), effort, output schema, language, and cancellation. Generated agents are awaited before batch submission. Use agent.loop() for recurring work.
89
-
90
- ## Campaigns
91
-
92
- Campaign endpoints require an upstream deployment with the public campaign adapter and campaign access enabled for the account. A configured agent can start its existing campaign template with `await agent.campaign({ sector: 'energy' }, { idempotencyKey: 'energy-001' })`. This immediately creates and approves work using that agent's template. Set run_mode, campaign_plan, and input_form in the agent definition to configure one.
69
+ Result rows carry each run's outcome: `headline`, `excerpt`, `report_link`, and `structured_output`. The inputs are on the batch itself: `(await agent.getBatch(batch.id)).rows` gives each row's `question` and `row_data`.
93
70
 
94
- For a caller-defined campaign plan, save and review before executing:
71
+ A CSV works too. Name the column that holds each input. The other columns come back as `row_data` on `getBatch(id).rows`.
95
72
 
96
73
  ```ts
97
- const draft = await client.createCampaign(plan, { idempotencyKey: 'discovery-001' });
98
- // Review draft.stages, draft.deliverables, and draft.objective first.
99
- const started = await client.approveCampaign(draft.id, draft.review_digest);
100
- const current = await client.getCampaign(started.id);
101
- // When an artifact is ready, use its deliverable_key:
102
- const file = await client.downloadCampaignArtifact(started.id, deliverableKey);
74
+ const batch = await agent.batch({ csv: csvText, inputColumn: "website" });
75
+ for (const row of (await agent.getBatch(batch.id)).rows) {
76
+ console.log(row.question, row.row_data);
77
+ }
103
78
  ```
104
79
 
105
- `listCampaigns` lists your campaigns; `cancelCampaign` stops pending work. Approval requires the digest of the exact reviewed plan; stale approval returns a conflict. Result downloads return a Blob containing the original artifact bytes. Requests are never retried automatically. MCP exposes `create_campaign`, `get_campaign`, `approve_campaign`, `cancel_campaign`, and `campaign_agent` with the same caller authorization and approval behavior.
80
+ `csv` may be a string or a `Blob`, up to 1 MB. `waitBatch` returns when the batch completes, fails, is cancelled, or pauses for attention; check `batch.paused_reason`. `cancelBatch` stops new rows; rows already running finish. `retryBatch` re-runs failed rows and spends credits. `getBatch(id, { includeRows: false })` skips per-row data on large batches.
106
81
 
107
- Automatic goal-to-plan generation is still planned. Campaign templates can be defined and updated entirely through the SDK.
82
+ ## Loops
108
83
 
109
- ## Scheduled loops
84
+ A loop is a batch that repeats on a schedule. The first run starts immediately.
110
85
 
111
86
  ```ts
112
- const loop = await agent.loop('Check acme.example', {
113
- frequency: 'weekly',
114
- schedule_config: { hour: 9, minute: 0, day_of_week: 1 },
115
- timezone: 'America/New_York',
116
- }, { name: 'Weekly checks', maxCredits: 20, idempotencyKey: 'weekly-checks-001' });
87
+ const loop = await agent.loop(
88
+ "Check acme.example for new filings",
89
+ { frequency: "weekly", schedule_config: { hour: 9, minute: 0, day_of_week: 0 }, timezone: "America/New_York" },
90
+ { name: "Weekly filings", maxCredits: 20 },
91
+ );
117
92
  const history = await agent.getLoop(loop.id);
118
- const results = await agent.getBatchResults(history.runs[0].id);
119
93
  await agent.pauseLoop(loop.id);
120
- await agent.resumeLoop(loop.id);
121
94
  await agent.deleteLoop(loop.id, { cancelActive: true });
122
95
  ```
123
96
 
124
- The first batch starts immediately; later occurrences follow the cadence. Inputs may be a string, a list of up to 100 inputs, or the same CSV object accepted by `batch`. Frequency is daily, weekly, or monthly; hour/minute are local to the IANA timezone (UTC by default). Weekly schedules accept day_of_week (0=Monday); monthly schedules use day_of_month (1–28).
97
+ `frequency` is `daily`, `weekly`, or `monthly`. Weekly uses `day_of_week` with 0 as Monday. Monthly uses `day_of_month` from 1 to 28. `maxCredits` caps each occurrence, not the lifetime total. Inputs are frozen at creation; `updateLoop` changes only the name and cadence.
98
+
99
+ ## Campaigns
125
100
 
126
- Each occurrence is billed as a batch. `maxCredits` limits each batch, not total lifetime spending. Pause or delete the loop to stop future work. Already running rows may finish; `deleteLoop({cancelActive:true})` also cancels pending rows in the latest batch. `updateLoop` changes the name or cadence but never the frozen inputs. `runLoopNow` starts an extra batch without shifting the cadence; overlapping active work returns a conflict. Reads include skip reasons and batch history, whose IDs work with `getBatch` and `getBatchResults`.
101
+ A campaign is a multi-stage plan. Save it as a draft, review it, then approve it with the digest of the plan you reviewed.
127
102
 
128
- The upstream deployment must include the public schedule-management adapter and enable recurring batch access for your account. MCP provides `loop_agent`, `get_loop`, `update_loop`, `pause_loop`, `resume_loop`, `delete_loop`, and `run_loop_now`.
103
+ ```ts
104
+ const draft = await agent.createCampaign(plan);
105
+ // read draft.stages and draft.deliverables
106
+ const started = await agent.approveCampaign(draft.id, draft.review_digest!);
107
+ const final = await agent.waitCampaign(started.id);
108
+ const artifact = await agent.downloadCampaignArtifact(final.id, "companies");
109
+ await writeFile(artifact.filename ?? "companies.xlsx", await artifact.bytes());
110
+ ```
129
111
 
130
- ## Define a campaign agent
112
+ `downloadCampaignArtifact` returns a `Blob` with an extra `filename`, so `arrayBuffer()`, `bytes()`, `text()`, and `type` all work. An agent configured with `run_mode: "campaign"` and a `campaign_plan` can start its template directly with `agent.campaign({ goal: "..." })`. That call starts work immediately. Approving with a stale digest throws `ConflictError`.
131
113
 
132
- Create an agent with `run_mode: 'campaign'`, a `campaign_plan`, and its `input_form`. Template strings use `{{field_label}}` to insert input values. The backend validates the template and refuses undeclared placeholders or a campaign mode without a plan. `getAgent` returns the configuration; `updateAgent` can replace it. To return to ordinary runs, update with `{ run_mode: 'job', campaign_plan: null }`.
114
+ ## Skills and integrations
133
115
 
134
116
  ```ts
117
+ import { AgentRun } from "@parcha/agentrun";
118
+
119
+ const client = new AgentRun();
120
+ const skills = await client.listSkills({ query: "company" });
121
+ const tools = await client.listIntegrations({ query: "company" });
122
+
135
123
  const agent = new Agent({
136
- apiKey: process.env.AGENTRUN_API_KEY!,
137
- name: 'Company discovery',
138
- instructions: 'Find verifiable company information and cite evidence.',
139
- run_mode: 'campaign',
140
- input_form: [{ label: 'goal', type: 'text', required: true }],
141
- campaign_plan: {
142
- name: 'Company discovery', objective: '{{goal}}',
143
- stages: [
144
- { key: 'discover', title: 'Find companies', op: 'agent',
145
- instruction: 'Find companies matching this goal: {{goal}}',
146
- entity_key_field: 'company_website', records_field: 'companies' },
147
- { key: 'inspect', title: 'Verify each company', op: 'agent',
148
- instruction: 'Verify this company against the goal: {{goal}}. Cite evidence.',
149
- fanout: 'per_entity', entity_key_field: 'company_website', depends_on: ['discover'],
150
- output_schema: { type: 'object', properties: { evidence: { type: 'string' } } } },
151
- { key: 'join', title: 'Combine findings', op: 'join', depends_on: ['discover', 'inspect'] },
152
- { key: 'export', title: 'Export results', op: 'export', depends_on: ['join'],
153
- filename: 'companies.xlsx', entity_key_field: 'company_website',
154
- columns: ['company_website', 'company', 'evidence'], requested: 10 },
155
- ],
156
- deliverables: [{ key: 'companies', title: 'Verified companies', kind: 'dataset', from_stage: 'export' }],
157
- },
158
- });
159
- await agent.create();
160
- const campaign = await agent.campaign({ goal: 'Find UK cloud infrastructure companies' }, {
161
- idempotencyKey: 'company-discovery-001',
124
+ name: "Company verifier",
125
+ instructions: "Verify the company and cite evidence.",
126
+ skills: skills.skills.map((s) => s.name),
127
+ tools: tools.tools.filter((t) => !t.always_on).map((t) => t.name),
162
128
  });
163
129
  ```
164
130
 
165
- This call renders and starts the configured campaign immediately. Use `getCampaign(campaign.id)` to inspect stage progress and download a ready artifact with `downloadCampaignArtifact(campaign.id, 'companies')`. The same configuration fields are accepted by MCP `create_agent`.
131
+ Save your own Markdown as a skill with `client.createSkill({ name, description, content })`. Creating a skill with an existing name updates it; the response has `created: false`.
132
+
133
+ ## Statuses
134
+
135
+ The API reports progress in its own vocabulary. The SDK maps it to a short list so your code stays simple. The original value is always in `raw_status`.
136
+
137
+ | `run.status` | Means | Done |
138
+ | --- | --- | --- |
139
+ | `queued` | Accepted, not started. | no |
140
+ | `moderation` | Content check in progress. | no |
141
+ | `running` | Working. | no |
142
+ | `blocked` | Needs your input, or content was rejected. | yes |
143
+ | `completed` | Report is ready. | yes |
144
+ | `failed` | Ran and failed, or never ran. | yes |
145
+ | `cancelled` | Cancelled, deleted, or superseded. | yes |
146
+
147
+ Batches use `queued`, `running`, `completed`, `completed_with_errors`, `failed`, and `cancelled`. Batch rows use `queued`, `running`, `completed`, and `failed`. A status the SDK does not recognise passes through unchanged.
148
+
149
+ ## Errors
150
+
151
+ Every method returns a promise, and every failure is a rejection with an error that extends `AgentRunError`.
152
+
153
+ | Error | When |
154
+ | --- | --- |
155
+ | `AuthenticationError` | 401. Bad or missing API key. |
156
+ | `PermissionDeniedError` | 403. The key lacks a scope or does not own the resource. |
157
+ | `NotFoundError` | 404. |
158
+ | `ConflictError` | 409. Stale review digest, or a loop already running. |
159
+ | `UnprocessableEntityError` | 422. `error.body.detail` lists the bad fields. |
160
+ | `RateLimitError` | 429. |
161
+ | `ServiceUnavailableError` | 503. Down, or the feature is not enabled for your account. |
162
+ | `APIConnectionError` | No HTTP response at all. `APITimeoutError` for a slow one. |
163
+ | `InvalidResponseError` | 2xx but not the JSON the SDK expects. Usually a wrong `baseURL`. |
164
+ | `BuildError` | An agent build failed. |
165
+ | `PollTimeoutError` | A `wait*` call hit its local deadline. |
166
166
 
167
- ## Campaign progress and result pages
167
+ `APIError` subclasses carry `statusCode`, `body`, and `requestId`. Include the request ID when you report a problem. The SDK checks the limits the API enforces before sending anything, such as skill content of at least 50 characters or `maxCostUsd` between 0.5 and 1000, and rejects with a plain `Error`. The SDK never retries a request on its own. Pass the same `idempotencyKey` to `run`, `batch`, `loop`, or `createCampaign` when you retry, so the server does not start the work twice.
168
+
169
+ Every method accepts `{ signal }` to cancel a request or a wait from your side. Aborting stops local waiting only; it never cancels remote work. Use `cancelRun`, `cancelBatch`, or `cancelCampaign` for that.
170
+
171
+ ## Configuration
172
+
173
+ | Setting | Option | Environment variable | Default |
174
+ | --- | --- | --- | --- |
175
+ | API key | `apiKey` | `AGENTRUN_API_KEY` | required |
176
+ | API root | `baseURL` | `AGENTRUN_BASE_URL` | `https://api.grep.ai/api/v2` |
177
+ | Per-request timeout | `timeoutMs` | | 30000 |
178
+ | Fetch implementation | `fetch` | | `globalThis.fetch` |
179
+
180
+ `baseURL` must use HTTPS. Plain HTTP is allowed only for localhost. Redirects are never followed. Environment variables are read only where `process.env` exists.
181
+
182
+ ## Types
183
+
184
+ The package ships ESM and CommonJS builds with declarations. Responses are plain objects typed as interfaces, so `run.status` and `batch.rows` have the types your editor shows. Records keep any field the server adds later, reachable as a property. `id` is always the record's ID, whatever the API calls it. Agent records from `getAgent` and `listAgents` expose `instructions`, `skills`, and `tools`, the names `new Agent()` takes; the API's `system_prompt`, `skill_names`, and `mcp_tool_names` hold the same values.
185
+
186
+ ## Development
187
+
188
+ ```sh
189
+ npm ci
190
+ npm run typecheck
191
+ npm run build
192
+ npm test
193
+ npm pack --dry-run
194
+ ```
168
195
 
169
- `await client.waitCampaign(id, { intervalMs, timeoutMs, signal })` waits for completion, cancellation, failure, or `needs_attention`. It returns a draft immediately so you can review it. The defaults are one-second polling and a 20-minute deadline. Timeout or abort stops only local waiting; it never approves, cancels, or retries remote work.
196
+ Tests run against a fake API behind a `fetch` function. Two tests tie the SDK to the backend:
170
197
 
171
- Use `client.getCampaignPortfolio(id, stageKey, { cursor, limit, status, search })` to read stage results. The response includes coverage, typed items, and `next_cursor`; pass that cursor to read subsequent pages. Each result preserves caller-authored content and exposes `run_id` for its full report. MCP offers `get_campaign_portfolio` with the same filters.
198
+ - `tests/contract.test.ts` validates every request the SDK sends, and every canned response, against `tests/fixtures/public-v2.json`, the backend's generated OpenAPI document. Refresh it with `python scripts/update_contract.py <path-or-url>` when the API changes.
199
+ - `tests/packaged.test.ts` starts a real local HTTP server and runs the same script the backend uses to verify packaged SDKs, against the built `dist/`.