@agent-native/core 0.154.4 → 0.154.5

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 (34) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/content/.agents/skills/content/SKILL.md +2 -2
  3. package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +20 -4
  4. package/corpus/templates/content/actions/_database-row-mutation.ts +1490 -0
  5. package/corpus/templates/content/actions/_database-utils.ts +44 -0
  6. package/corpus/templates/content/actions/_property-utils.ts +4 -1
  7. package/corpus/templates/content/actions/add-database-item.ts +62 -240
  8. package/corpus/templates/content/actions/configure-document-property.ts +165 -1
  9. package/corpus/templates/content/actions/delete-document-property.ts +18 -0
  10. package/corpus/templates/content/actions/set-document-property.ts +78 -1
  11. package/corpus/templates/content/actions/update-database-item.ts +62 -0
  12. package/corpus/templates/content/actions/upsert-database-item-by-key.ts +43 -796
  13. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +10 -8
  14. package/corpus/templates/content/app/hooks/use-content-database.ts +33 -32
  15. package/corpus/templates/content/changelog/2026-08-10-database-row-actions-now-validate-exact-schemas-and-safe-ret.md +6 -0
  16. package/corpus/templates/content/parity/matrix.md +1 -1
  17. package/corpus/templates/content/parity/matrix.ts +2 -0
  18. package/corpus/templates/content/server/db/schema.ts +39 -3
  19. package/corpus/templates/content/server/plugins/db.ts +30 -0
  20. package/corpus/templates/content/shared/api.ts +75 -2
  21. package/dist/action.d.ts +22 -0
  22. package/dist/action.js +27 -0
  23. package/dist/collab/awareness.d.ts +2 -2
  24. package/dist/collab/routes.d.ts +1 -1
  25. package/dist/index.browser.d.ts +1 -1
  26. package/dist/index.browser.js +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/notifications/routes.d.ts +1 -1
  30. package/dist/observability/routes.d.ts +6 -6
  31. package/dist/secrets/routes.d.ts +3 -3
  32. package/dist/server/action-routes.js +10 -2
  33. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  34. package/package.json +1 -1
package/corpus/README.md CHANGED
@@ -31,4 +31,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
31
31
 
32
32
  ## Generated Counts
33
33
 
34
- - template files: 8212
34
+ - template files: 8215
@@ -121,8 +121,8 @@ For a named intake workflow:
121
121
  when the database has no form contract and all required values have already
122
122
  been confirmed.
123
123
  8. Treat submission as complete only when the successful result includes a
124
- `createdDocumentId` and verification. Return the exact `url` or `urlPath`
125
- from the result. The canonical Content row route is `/page/<createdDocumentId>`;
124
+ stable row IDs and verified read-back. Return the exact `url` or `urlPath`
125
+ from the result. The canonical Content row route is `/page/<documentId>`;
126
126
  never invent a different path, slug, ID, or host.
127
127
 
128
128
  When the user supplies a complete description in one message, do not force a
@@ -117,7 +117,9 @@ checkbox filters as initial property values, resolving option labels back to
117
117
  stable option IDs for select, status, and multi-select filters, so a row
118
118
  created under "Status is Published" remains visible instead of immediately
119
119
  disappearing. Agents can mirror that behavior by passing
120
- `--propertyValues '{"propertyId":"value"}'` to `add-database-item`. Filter
120
+ the discovered property IDs in `propertyValues` to `add-database-item`. The
121
+ action also requires the exact space/database/backing-page target, current
122
+ schema revision, and a caller-stable idempotency key. Filter
121
123
  controls are type-aware: option properties choose from their configured
122
124
  options, option value editors can search existing options or create a new
123
125
  option from the typed query, and property settings can rename option labels
@@ -168,8 +170,10 @@ memberships, but they are references: moving one never reparents, transfers,
168
170
  or changes access to the referenced page. Files sidebar Custom order is
169
171
  different again: persist it per user and per database view with
170
172
  `update-content-database-personal-view`, without changing the shared Files
171
- membership order. Creating a database row returns the created item IDs and
172
- opens the new row page in the side preview. Duplicating a database row
173
+ membership order. Creating a database row returns a receipt with stable item
174
+ and document IDs, row link, revisions, affected fields, idempotency outcome,
175
+ and verified read-back, then opens the new row page in the side preview.
176
+ Duplicating a database row
173
177
  returns the duplicate item IDs and opens the copied row in the side preview
174
178
  so users can continue editing the new page immediately, including from
175
179
  table, list, and gallery row action menus. Board, calendar, and timeline
@@ -227,13 +231,25 @@ property definition.
227
231
 
228
232
  Use `create-content-database`, `create-inline-content-database`,
229
233
  `get-content-database`, `list-trashed-content-databases`,
230
- `restore-content-database`, `add-database-item`, `duplicate-database-item`,
234
+ `restore-content-database`, `add-database-item`, `update-database-item`,
235
+ `upsert-database-item-by-key`, `duplicate-database-item`,
231
236
  `duplicate-database-items`, `remove-database-items`, `move-database-item`,
232
237
  `update-content-database-view`, `list-document-properties`,
233
238
  `configure-document-property`, `set-document-property`,
234
239
  `duplicate-document-property`, and `delete-document-property`; do not edit
235
240
  property rows or view config via raw SQL when an action can do it.
236
241
 
242
+ Read `get-content-database.mutationContract` immediately before a single-row
243
+ mutation. Pass its exact target and schema revision to create, exact item and
244
+ document IDs plus the current row revision to sparse update, and a fresh
245
+ idempotency key for each intended effect. Reusing the same key with the same
246
+ payload replays the durable receipt; reusing it with a different payload fails.
247
+ Configure at most one ordinary text property as the database's natural key,
248
+ then use `upsert-database-item-by-key` with that property. Natural-key upsert
249
+ never accepts an arbitrary property name or silently chooses a field. Blocks,
250
+ computed, system, source-managed, unknown, and relation properties are not
251
+ writable through these actions; use their owning surfaces instead.
252
+
237
253
  For a bounded migration that must rewrite every existing row body while adding
238
254
  new property definitions and values, use `migrate-content-database-rows` rather
239
255
  than looping the single-row actions. Its `validate` phase is read-only; `apply`