Skip to content

Commit 68a8318

Browse files
os-zhuangclaude
andcommitted
fix(runtime): use single-string logger.error in auto-connect catch (DTS build)
The context logger interface types error(message, error?: Error) — passing a meta object {appId, error} tripped the tsup DTS build (TS2353) even though tsc --noEmit passed. Switch to a single interpolated message; the rethrow still surfaces the real cause to the kernel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent c89dcb4 commit 68a8318

17 files changed

Lines changed: 140 additions & 49 deletions

File tree

content/docs/references/ai/agent.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const result = AIKnowledge.parse(data);
7676
| **instructions** | `string` || System Prompt / Prime Directives |
7777
| **model** | `Object` | optional | |
7878
| **lifecycle** | `Object` | optional | State machine defining the agent conversation follow and constraints |
79+
| **surface** | `Enum<'ask' \| 'build'>` || Product surface this agent binds ('ask' | 'build') — ADR-0063 §1 |
7980
| **skills** | `string[]` | optional | Skill names to attach (Agent→Skill→Tool architecture) |
8081
| **tools** | `Object[]` | optional | Direct tool references (legacy fallback) |
8182
| **knowledge** | `Object` | optional | RAG access |

content/docs/references/ai/skill.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const result = Skill.parse(data);
3636
| **name** | `string` || Skill unique identifier (snake_case) |
3737
| **label** | `string` || Skill display name |
3838
| **description** | `string` | optional | Skill description |
39+
| **surface** | `Enum<'ask' \| 'build' \| 'both'>` || Agent surface this skill binds to ('ask' | 'build' | 'both') — ADR-0063 §3 |
3940
| **instructions** | `string` | optional | LLM instructions when skill is active |
4041
| **tools** | `string[]` || Tool names belonging to this skill (supports trailing wildcard, e.g. `action_*`) |
4142
| **triggerPhrases** | `string[]` | optional | Phrases that activate this skill |

content/docs/references/api/contract.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const result = ApiError.parse(data);
154154
| **having** | `[__schema2](./__schema2)` | optional | HAVING clause for aggregation filtering |
155155
| **windowFunctions** | `Object[]` | optional | Window functions with OVER clause |
156156
| **distinct** | `boolean` | optional | SELECT DISTINCT flag |
157-
| **expand** | `Record<string, [__schema0](./__schema0)>` | optional | Recursive relation loading map. Keys are lookup/master_detail field names; values are nested QueryAST objects that control select, filter, sort, and further expansion on the related object. The engine resolves expand via batch $in queries (driver-agnostic) with a default max depth of 3. |
157+
| **expand** | `Record<string, [__schema0](./__schema0)>` | optional | Recursive relation loading map. Keys are lookup/master_detail field names; values are nested QueryAST objects that control select (`fields`) and filter (`where`, AND-merged with the batch $in), plus further expansion on the related object. The engine resolves expand via batch $in queries (driver-agnostic) with a default max depth of 3; per-parent `limit`/`offset`/`orderBy` are NOT applied on this path. |
158158

159159

160160
---

content/docs/references/data/data-engine.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ QueryAST-aligned options for DataEngine.aggregate operations
481481
| **where** | `Record<string, any> \| [__schema0](./__schema0)` | optional | |
482482
| **groupBy** | `string[]` | optional | |
483483
| **aggregations** | `Object[]` | optional | |
484+
| **timezone** | `string` | optional | |
484485

485486

486487
---

content/docs/references/data/datasource.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const result = Datasource.parse(data);
4343
| **retryPolicy** | `Object` | optional | Connection retry policy for transient failures |
4444
| **description** | `string` | optional | Internal description |
4545
| **active** | `boolean` || Is datasource enabled |
46+
| **autoConnect** | `boolean` || Force a live driver connection at boot even when managed + unrouted (ADR-0062 D2). |
4647
| **schemaMode** | `Enum<'managed' \| 'external' \| 'validate-only'>` || Schema ownership mode |
4748
| **external** | `Object` | optional | External datasource federation settings (schemaMode != "managed") |
4849
| **origin** | `Enum<'code' \| 'runtime'>` || Datasource provenance (server-managed, read-only) |

content/docs/references/data/driver.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const result = DriverCapabilities.parse(data);
9595
| **skipCache** | `boolean` | optional | Bypass cache |
9696
| **traceContext** | `Record<string, string>` | optional | OpenTelemetry context or request ID |
9797
| **tenantId** | `string` | optional | Tenant Isolation identifier |
98+
| **timezone** | `string` | optional | Business reference timezone (IANA) for date-dependent generation, e.g. autonumber date tokens |
9899

99100

100101
---

content/docs/references/data/hook-body.mdx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ a capability it did not declare, the call throws at invocation time.
1515

1616
- `api.write``ctx.api.object(...).insert / update / delete`
1717

18+
- `api.transaction``ctx.api.transaction(async () => \{ … \})` — runs the
19+
20+
callback's `ctx.api` writes/reads inside one driver transaction, committed
21+
22+
on return and rolled back if the callback throws. Requires `api.write`
23+
24+
alongside it to be useful (the transaction body still needs write access).
25+
1826
- `crypto.uuid``ctx.crypto.randomUUID()`
1927

2028
- `crypto.hash``ctx.crypto.hash(algo, data)`
@@ -86,7 +94,7 @@ L2 sandboxed JS body — runs inside an isolated VM with declared capabilities
8694
| :--- | :--- | :--- | :--- |
8795
| **language** | `string` || |
8896
| **source** | `string` || Function body source |
89-
| **capabilities** | `Enum<'api.read' \| 'api.write' \| 'crypto.uuid' \| 'crypto.hash' \| 'log'>[]` || Granted capability tokens |
97+
| **capabilities** | `Enum<'api.read' \| 'api.write' \| 'api.transaction' \| 'crypto.uuid' \| 'crypto.hash' \| 'log'>[]` || Granted capability tokens |
9098
| **timeoutMs** | `integer` | optional | Per-invocation timeout (ms) |
9199
| **memoryMb** | `integer` | optional | Per-invocation memory cap (MB) |
92100

@@ -101,6 +109,7 @@ L2 sandboxed JS body — runs inside an isolated VM with declared capabilities
101109

102110
* `api.read`
103111
* `api.write`
112+
* `api.transaction`
104113
* `crypto.uuid`
105114
* `crypto.hash`
106115
* `log`
@@ -118,7 +127,7 @@ L2 sandboxed JS body — runs inside an isolated VM with declared capabilities
118127
| :--- | :--- | :--- | :--- |
119128
| **language** | `string` || |
120129
| **source** | `string` || Function body source |
121-
| **capabilities** | `Enum<'api.read' \| 'api.write' \| 'crypto.uuid' \| 'crypto.hash' \| 'log'>[]` || Granted capability tokens |
130+
| **capabilities** | `Enum<'api.read' \| 'api.write' \| 'api.transaction' \| 'crypto.uuid' \| 'crypto.hash' \| 'log'>[]` || Granted capability tokens |
122131
| **timeoutMs** | `integer` | optional | Per-invocation timeout (ms) |
123132
| **memoryMb** | `integer` | optional | Per-invocation memory cap (MB) |
124133

content/docs/references/data/object.mdx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ API Operations Enum
1414
## TypeScript Usage
1515

1616
```typescript
17-
import { ApiMethod, CDCConfig, Index, ObjectCapabilities, ObjectExternalBinding, ObjectOwnershipEnum, PartitioningConfig, SoftDeleteConfig, TenancyConfig, VersioningConfig } from '@objectstack/spec/data';
18-
import type { ApiMethod, CDCConfig, Index, ObjectCapabilities, ObjectExternalBinding, ObjectOwnershipEnum, PartitioningConfig, SoftDeleteConfig, TenancyConfig, VersioningConfig } from '@objectstack/spec/data';
17+
import { ApiMethod, Index, ObjectCapabilities, ObjectExternalBinding, ObjectOwnershipEnum, PartitioningConfig, SoftDeleteConfig, TenancyConfig, VersioningConfig } from '@objectstack/spec/data';
18+
import type { ApiMethod, Index, ObjectCapabilities, ObjectExternalBinding, ObjectOwnershipEnum, PartitioningConfig, SoftDeleteConfig, TenancyConfig, VersioningConfig } from '@objectstack/spec/data';
1919

2020
// Validate data
2121
const result = ApiMethod.parse(data);
@@ -43,19 +43,6 @@ const result = ApiMethod.parse(data);
4343
* `export`
4444

4545

46-
---
47-
48-
## CDCConfig
49-
50-
### Properties
51-
52-
| Property | Type | Required | Description |
53-
| :--- | :--- | :--- | :--- |
54-
| **enabled** | `boolean` || Enable Change Data Capture |
55-
| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` || Event types to capture |
56-
| **destination** | `string` || Destination endpoint (e.g., "kafka://topic", "webhook://url") |
57-
58-
5946
---
6047

6148
## Index

content/docs/references/data/query.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Type: `string`
202202
| **having** | `[__schema1](./__schema1)` | optional | HAVING clause for aggregation filtering |
203203
| **windowFunctions** | `Object[]` | optional | Window functions with OVER clause |
204204
| **distinct** | `boolean` | optional | SELECT DISTINCT flag |
205-
| **expand** | `Record<string, [#](./#)>` | optional | Recursive relation loading map. Keys are lookup/master_detail field names; values are nested QueryAST objects that control select, filter, sort, and further expansion on the related object. The engine resolves expand via batch $in queries (driver-agnostic) with a default max depth of 3. |
205+
| **expand** | `Record<string, [#](./#)>` | optional | Recursive relation loading map. Keys are lookup/master_detail field names; values are nested QueryAST objects that control select (`fields`) and filter (`where`, AND-merged with the batch $in), plus further expansion on the related object. The engine resolves expand via batch $in queries (driver-agnostic) with a default max depth of 3; per-parent `limit`/`offset`/`orderBy` are NOT applied on this path. |
206206

207207

208208
---

content/docs/references/kernel/execution-context.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,18 @@ const result = ExecutionContext.parse(data);
4848
| Property | Type | Required | Description |
4949
| :--- | :--- | :--- | :--- |
5050
| **userId** | `string` | optional | |
51+
| **actor** | `string` | optional | |
52+
| **email** | `string` | optional | |
5153
| **tenantId** | `string` | optional | |
54+
| **timezone** | `string` | optional | |
55+
| **locale** | `string` | optional | |
56+
| **currency** | `string` | optional | |
5257
| **roles** | `string[]` || |
5358
| **permissions** | `string[]` || |
5459
| **systemPermissions** | `string[]` | optional | |
5560
| **tabPermissions** | `Record<string, Enum<'visible' \| 'hidden' \| 'default_on' \| 'default_off'>>` | optional | |
5661
| **org_user_ids** | `string[]` | optional | |
62+
| **rlsMembership** | `Record<string, string[]>` | optional | |
5763
| **isSystem** | `boolean` || |
5864
| **accessToken** | `string` | optional | |
5965
| **transaction** | `any` | optional | |

0 commit comments

Comments
 (0)