Skip to content

Commit 0cfe8b9

Browse files
Nick Ficanoclaude
andcommitted
chore(lint): prettier format pass + lint fixes
- Reformat ~85 files with prettier - Drop unused eslint-disable in examples/subscribe/client.ts - Trim job-runner.ts back under max-lines: move forwardEventToSubscriber import in server-subscribe.ts to job-runner-helpers.js directly so the re-export from job-runner.ts can be removed - Include in-progress transport-error.ts split and decode-schema.ts test helper (already referenced by tracked sources) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f3962fc commit 0cfe8b9

92 files changed

Lines changed: 863 additions & 756 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ packages, all ESM, all strictly typed against TypeScript 5.6 with
2626
Full docs live in [`docs/`](./docs/). Start with
2727
[getting-started](./docs/getting-started.md) or jump to a guide:
2828

29-
| Guide | Spec | | Guide | Spec |
30-
| --- | --- | --- | --- | --- |
31-
| [Sessions](./docs/guides/sessions.md) | §6 | | [Delegation](./docs/guides/delegation.md) | §10 |
32-
| [Resume](./docs/guides/resume.md) | §6.3 | | [Observability](./docs/guides/observability.md) | §11 |
33-
| [Authentication](./docs/guides/auth.md) | §6.1 | | [Errors](./docs/guides/errors.md) | §12 |
34-
| [Jobs](./docs/guides/jobs.md) | §7 | | [Vendor extensions](./docs/guides/vendor-extensions.md) | §15 |
35-
| [Job events](./docs/guides/job-events.md) | §8 | | [Recipes](./docs/recipes.md) ||
36-
| [Leases](./docs/guides/leases.md) | §9 | | [Troubleshooting](./docs/troubleshooting.md) ||
29+
| Guide | Spec | | Guide | Spec |
30+
| ----------------------------------------- | ---- | --- | ------------------------------------------------------- | ---- |
31+
| [Sessions](./docs/guides/sessions.md) | §6 | | [Delegation](./docs/guides/delegation.md) | §10 |
32+
| [Resume](./docs/guides/resume.md) | §6.3 | | [Observability](./docs/guides/observability.md) | §11 |
33+
| [Authentication](./docs/guides/auth.md) | §6.1 | | [Errors](./docs/guides/errors.md) | §12 |
34+
| [Jobs](./docs/guides/jobs.md) | §7 | | [Vendor extensions](./docs/guides/vendor-extensions.md) | §15 |
35+
| [Job events](./docs/guides/job-events.md) | §8 | | [Recipes](./docs/recipes.md) | |
36+
| [Leases](./docs/guides/leases.md) | §9 | | [Troubleshooting](./docs/troubleshooting.md) | |
3737

3838
## Install
3939

@@ -180,16 +180,16 @@ Every event the runtime emits to the client is one `job.event` envelope
180180
whose `payload.kind` is one of eight reserved values or a vendor
181181
`x-vendor.*` extension:
182182

183-
| Kind | Body shape | Purpose |
184-
| -------------- | ------------------------------------------------ | --------------------------------------------------- |
185-
| `log` | `{ level, message, attributes? }` | Plain log line. |
186-
| `thought` | `{ text }` | Model reasoning / internal monologue. |
187-
| `tool_call` | `{ tool, args, call_id }` | Agent invoked a tool. |
188-
| `tool_result` | `{ call_id, result? \| error? }` | Result for a `tool_call`. |
189-
| `status` | `{ phase, message? }` | Lifecycle hint (e.g., `running`, `fetching`). |
190-
| `metric` | `{ name, value, unit?, attributes? }` | Numeric measurement. |
191-
| `artifact_ref` | `{ uri, content_type, byte_size?, sha256? }` | Reference to an artifact (storage is out of scope). |
192-
| `delegate` | `{ delegate_id, agent, input, lease_request? }` | Initiate a child job. |
183+
| Kind | Body shape | Purpose |
184+
| -------------- | ----------------------------------------------- | --------------------------------------------------- |
185+
| `log` | `{ level, message, attributes? }` | Plain log line. |
186+
| `thought` | `{ text }` | Model reasoning / internal monologue. |
187+
| `tool_call` | `{ tool, args, call_id }` | Agent invoked a tool. |
188+
| `tool_result` | `{ call_id, result? \| error? }` | Result for a `tool_call`. |
189+
| `status` | `{ phase, message? }` | Lifecycle hint (e.g., `running`, `fetching`). |
190+
| `metric` | `{ name, value, unit?, attributes? }` | Numeric measurement. |
191+
| `artifact_ref` | `{ uri, content_type, byte_size?, sha256? }` | Reference to an artifact (storage is out of scope). |
192+
| `delegate` | `{ delegate_id, agent, input, lease_request? }` | Initiate a child job. |
193193

194194
Sequence numbers are session-scoped (§8.3): one counter across all
195195
concurrent jobs in the session. Replay across a resume preserves
@@ -227,7 +227,9 @@ client re-issues `session.hello` carrying:
227227

228228
```ts
229229
{
230-
resume: { session_id, resume_token, last_event_seq }
230+
resume: {
231+
(session_id, resume_token, last_event_seq);
232+
}
231233
}
232234
```
233235

TYPESCRIPT_SDK_GUIDE.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
- **Mark stability**: `@public`, `@beta`, `@alpha`, `@internal`,
195195
`@deprecated <replacement>`.
196196
- **Never duplicate type info in prose** ("the string name of the
197-
user"). Document *meaning*, *invariants*, *side effects*.
197+
user"). Document _meaning_, _invariants_, _side effects_.
198198
- **Examples must compile.** Run them through `tsd` or
199199
`eslint-plugin-tsdoc` in CI.
200200

@@ -258,16 +258,16 @@
258258
These are **enforced limits**, not aspirations. Failing CI is the
259259
correct response.
260260

261-
| Metric | Max | Aspire |
262-
|------------------------------|----:|---------:|
263-
| Line length (chars) | 100 | 80 |
264-
| Function body (lines) | 40 | ≤ 20 |
265-
| File length (lines) | 300 | ≤ 150 |
266-
| Function parameters | 3 | ≤ 2 (use options object) |
267-
| Cyclomatic complexity | 10 | ≤ 5 |
268-
| Nesting depth | 3 | ≤ 2 |
269-
| Generic type parameters | 3 | ≤ 2 |
270-
| Public exports per barrel | 50 | split if more |
261+
| Metric | Max | Aspire |
262+
| ------------------------- | --: | -----------------------: |
263+
| Line length (chars) | 100 | 80 |
264+
| Function body (lines) | 40 | ≤ 20 |
265+
| File length (lines) | 300 | ≤ 150 |
266+
| Function parameters | 3 | ≤ 2 (use options object) |
267+
| Cyclomatic complexity | 10 | ≤ 5 |
268+
| Nesting depth | 3 | ≤ 2 |
269+
| Generic type parameters | 3 | ≤ 2 |
270+
| Public exports per barrel | 50 | split if more |
271271

272272
- **One function does one thing.** If you need "and" to name it,
273273
split it.
@@ -286,8 +286,14 @@ correct response.
286286
```jsonc
287287
{
288288
"rules": {
289-
"max-len": ["error", { "code": 100, "ignoreUrls": true, "ignoreStrings": true }],
290-
"max-lines": ["error", { "max": 300, "skipBlankLines": true, "skipComments": true }],
289+
"max-len": [
290+
"error",
291+
{ "code": 100, "ignoreUrls": true, "ignoreStrings": true },
292+
],
293+
"max-lines": [
294+
"error",
295+
{ "max": 300, "skipBlankLines": true, "skipComments": true },
296+
],
291297
"max-lines-per-function": ["error", { "max": 40, "skipBlankLines": true }],
292298
"max-params": ["error", 3],
293299
"max-depth": ["error", 3],
@@ -297,14 +303,17 @@ correct response.
297303
"@typescript-eslint/no-floating-promises": "error",
298304
"@typescript-eslint/no-misused-promises": "error",
299305
"@typescript-eslint/explicit-module-boundary-types": "error",
300-
"@typescript-eslint/consistent-type-imports": ["error", { "fixStyle": "inline-type-imports" }],
306+
"@typescript-eslint/consistent-type-imports": [
307+
"error",
308+
{ "fixStyle": "inline-type-imports" },
309+
],
301310
"@typescript-eslint/consistent-type-exports": "error",
302311
"@typescript-eslint/no-non-null-assertion": "error",
303312
"@typescript-eslint/prefer-readonly": "error",
304313
"@typescript-eslint/switch-exhaustiveness-check": "error",
305314
"import/no-default-export": "error",
306-
"import/no-cycle": "error"
307-
}
315+
"import/no-cycle": "error",
316+
},
308317
}
309318
```
310319

diagrams/README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ Hard constraints — do not violate:
4747

4848
## Files
4949

50-
| File | Role |
51-
| --- | --- |
52-
| `diagram-template-light.dot` | Starting point. Full style docs in the header. |
53-
| `diagram-template-dark.dot` | Dark companion. Structure must match the light variant. |
54-
| `arcp-light.dot` / `arcp-dark.dot` | Worked example shown above. |
50+
| File | Role |
51+
| ---------------------------------- | ------------------------------------------------------- |
52+
| `diagram-template-light.dot` | Starting point. Full style docs in the header. |
53+
| `diagram-template-dark.dot` | Dark companion. Structure must match the light variant. |
54+
| `arcp-light.dot` / `arcp-dark.dot` | Worked example shown above. |
5555

5656
The `.dot` files are the source you edit. The `.svg` files are rendered
5757
deliverables; you commit both and reference them from markdown.
@@ -99,24 +99,24 @@ background is active.
9999

100100
### Palette
101101

102-
| Role | Light | Dark |
103-
| --- | --- | --- |
104-
| canvas | transparent | transparent |
105-
| primary text | `#1F2937` ink-900 | `#F1F5F9` slate-100 |
106-
| cluster label | `#475569` ink-600 | `#94A3B8` slate-400 |
107-
| muted subtitle | `#94A3B8` ink-400 | `#64748B` slate-500 |
108-
| primary edge | `#64748B` ink-500 | `#94A3B8` slate-400 |
109-
| default edge | `#94A3B8` ink-400 | `#64748B` slate-500 |
110-
| secondary edge | `#CBD5E1` ink-300 | `#475569` slate-600 |
111-
| default node fill | white | `#334155` slate-700 |
112-
| default node border | `#CBD5E1` ink-300 | `#475569` slate-600 |
113-
| cluster border | `#E2E8F0` ink-200 | `#334155` slate-700 |
114-
| outer cluster fill | `#F1F5F9` ink-100 | `#0F172A` slate-900 |
115-
| inner cluster fill | `#F8FAFC` ink-50 | `#1E293B` slate-800 |
116-
| ENTRY fill / border | `#3B82F6` / `#2563EB` | unchanged |
117-
| HUB fill / border | `#F59E0B` / `#D97706` | unchanged |
118-
| feedback edge | `#F472B6` pink-400 | unchanged |
119-
| feedback label | `#DB2777` pink-600 | `#F472B6` pink-400 |
102+
| Role | Light | Dark |
103+
| ------------------- | --------------------- | ------------------- |
104+
| canvas | transparent | transparent |
105+
| primary text | `#1F2937` ink-900 | `#F1F5F9` slate-100 |
106+
| cluster label | `#475569` ink-600 | `#94A3B8` slate-400 |
107+
| muted subtitle | `#94A3B8` ink-400 | `#64748B` slate-500 |
108+
| primary edge | `#64748B` ink-500 | `#94A3B8` slate-400 |
109+
| default edge | `#94A3B8` ink-400 | `#64748B` slate-500 |
110+
| secondary edge | `#CBD5E1` ink-300 | `#475569` slate-600 |
111+
| default node fill | white | `#334155` slate-700 |
112+
| default node border | `#CBD5E1` ink-300 | `#475569` slate-600 |
113+
| cluster border | `#E2E8F0` ink-200 | `#334155` slate-700 |
114+
| outer cluster fill | `#F1F5F9` ink-100 | `#0F172A` slate-900 |
115+
| inner cluster fill | `#F8FAFC` ink-50 | `#1E293B` slate-800 |
116+
| ENTRY fill / border | `#3B82F6` / `#2563EB` | unchanged |
117+
| HUB fill / border | `#F59E0B` / `#D97706` | unchanged |
118+
| feedback edge | `#F472B6` pink-400 | unchanged |
119+
| feedback label | `#DB2777` pink-600 | `#F472B6` pink-400 |
120120

121121
### Node variants
122122

docs/README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@ go deeper into each subsystem.
1818

1919
## Guides (one per spec section)
2020

21-
| Page | Spec |
22-
| --- | --- |
23-
| [Sessions](./guides/sessions.md) | §6 |
24-
| [Resume](./guides/resume.md) | §6.3 |
25-
| [Authentication](./guides/auth.md) | §6.1 |
26-
| [Jobs](./guides/jobs.md) | §7 |
27-
| [Job events](./guides/job-events.md) | §8 |
28-
| [Leases](./guides/leases.md) | §9 |
29-
| [Delegation](./guides/delegation.md) | §10 |
30-
| [Observability](./guides/observability.md) | §11 |
31-
| [Errors](./guides/errors.md) | §12 |
32-
| [Vendor extensions](./guides/vendor-extensions.md) | §15 |
21+
| Page | Spec |
22+
| -------------------------------------------------- | ---- |
23+
| [Sessions](./guides/sessions.md) | §6 |
24+
| [Resume](./guides/resume.md) | §6.3 |
25+
| [Authentication](./guides/auth.md) | §6.1 |
26+
| [Jobs](./guides/jobs.md) | §7 |
27+
| [Job events](./guides/job-events.md) | §8 |
28+
| [Leases](./guides/leases.md) | §9 |
29+
| [Delegation](./guides/delegation.md) | §10 |
30+
| [Observability](./guides/observability.md) | §11 |
31+
| [Errors](./guides/errors.md) | §12 |
32+
| [Vendor extensions](./guides/vendor-extensions.md) | §15 |
3333

3434
## Packages
3535

36-
| Package | Page |
37-
| --- | --- |
38-
| `@arcp/sdk` | [packages/sdk](./packages/sdk.md) |
39-
| `@arcp/core` | [packages/core](./packages/core.md) |
40-
| `@arcp/client` | [packages/client](./packages/client.md) |
41-
| `@arcp/runtime` | [packages/runtime](./packages/runtime.md) |
42-
| `@arcp/node` | [packages/node](./packages/node.md) |
43-
| `@arcp/express` | [packages/express](./packages/express.md) |
44-
| `@arcp/fastify` | [packages/fastify](./packages/fastify.md) |
45-
| `@arcp/hono` | [packages/hono](./packages/hono.md) |
46-
| `@arcp/bun` | [packages/bun](./packages/bun.md) |
36+
| Package | Page |
37+
| ----------------------- | --------------------------------------------------------- |
38+
| `@arcp/sdk` | [packages/sdk](./packages/sdk.md) |
39+
| `@arcp/core` | [packages/core](./packages/core.md) |
40+
| `@arcp/client` | [packages/client](./packages/client.md) |
41+
| `@arcp/runtime` | [packages/runtime](./packages/runtime.md) |
42+
| `@arcp/node` | [packages/node](./packages/node.md) |
43+
| `@arcp/express` | [packages/express](./packages/express.md) |
44+
| `@arcp/fastify` | [packages/fastify](./packages/fastify.md) |
45+
| `@arcp/hono` | [packages/hono](./packages/hono.md) |
46+
| `@arcp/bun` | [packages/bun](./packages/bun.md) |
4747
| `@arcp/middleware-otel` | [packages/middleware-otel](./packages/middleware-otel.md) |
4848

4949
## Reference

docs/architecture.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ See [packages/](./packages/) for one page per middleware.
137137

138138
Every message is one JSON object with a small fixed envelope:
139139

140-
| Field | Required | Notes |
141-
| ------------ | -------- | ----- |
142-
| `arcp` | always | `"1"` for v1.0/v1.1 |
143-
| `id` | always | ULID or UUIDv7, unique per message |
144-
| `type` | always | discriminator (`"session.hello"`, `"job.submit"`, …) |
145-
| `payload` | always | type-specific body |
146-
| `session_id` | after handshake | absent on pre-session frames |
147-
| `job_id` | job-scoped envelopes | set on `job.*` types |
148-
| `event_seq` | `job.event` / `job.result` / `job.error` | strictly monotonic per session |
149-
| `trace_id` | optional | W3C 32-hex |
150-
| `extensions` | optional | `x-vendor.*`-keyed extension object |
140+
| Field | Required | Notes |
141+
| ------------ | ---------------------------------------- | ---------------------------------------------------- |
142+
| `arcp` | always | `"1"` for v1.0/v1.1 |
143+
| `id` | always | ULID or UUIDv7, unique per message |
144+
| `type` | always | discriminator (`"session.hello"`, `"job.submit"`, …) |
145+
| `payload` | always | type-specific body |
146+
| `session_id` | after handshake | absent on pre-session frames |
147+
| `job_id` | job-scoped envelopes | set on `job.*` types |
148+
| `event_seq` | `job.event` / `job.result` / `job.error` | strictly monotonic per session |
149+
| `trace_id` | optional | W3C 32-hex |
150+
| `extensions` | optional | `x-vendor.*`-keyed extension object |
151151

152152
Anything else on the wire is ignored. Unknown `x-vendor.*` types are
153153
round-tripped per §15 — see [vendor-extensions.md](./guides/vendor-extensions.md).

0 commit comments

Comments
 (0)