@metaobjectsdev/sdk 0.20.15 → 0.20.16

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.
@@ -50,27 +50,22 @@ LLM tool-call envelope with no renderable text body (the body IS the
50
50
  `@format` attrs above). The vocabulary exists today; MCP exposure of declared
51
51
  prompts/tools is roadmap, not shipped — don't promise it.
52
52
 
53
- ## The payload is an `object.value` projection
54
-
55
- The payload is **not** an entity — it's an `object.value` whose every field carries
56
- an `origin.*` child saying where its value comes from. Three origin subtypes:
57
-
58
- | Origin | Behavior |
59
- |---|---|
60
- | `origin.passthrough @from "Entity.field"` | payload property matches the source field |
61
- | `origin.aggregate @agg <count\|sum\|avg\|min\|max>` | `count`→long, `avg`→double, others match source |
62
- | `origin.collection @via "Parent.rel"` | a list of a nested payload, assembled from a relationship |
63
-
64
- These are the **payload-assembly** origins — the vocabulary this skill covers.
65
- **Projection** read models (`object.projection` over an entity) carry a fuller origin
66
- vocabulary the `@agg` predicate quantifiers `any`/`all`, the `collect` array rollup,
67
- plus `origin.computed` (a closed `@expr` grammar) and `origin.first` (an argmax-style
68
- pick) those live in the `metaobjects-authoring` skill and
69
- `docs/features/source-kinds.md`, not here: don't reach for them on a payload VO.
70
-
71
- Declaring the payload as a projection is what makes payload bloat visible: adding a
72
- field to the prompt is a diff on the `object.value`, and a renamed source field
73
- breaks the build instead of silently degrading the prompt.
53
+ ## The payload is an `object.value` you declare
54
+
55
+ The payload is **not** an entity — it's an `object.value` whose DECLARED fields ARE
56
+ the prompt's typed shape. Every port's payload codegen is
57
+ **declared-type-authoritative (#270)**: a field's generated type comes only from its
58
+ declared `field.<subType>` + `isArray` + `@objectRef`, and a nested payload is a
59
+ declared `field.object @objectRef` to another `object.value` (`isArray: true` for a
60
+ list). The caller supplies the field values at render time. An `origin.*` child on a
61
+ payload field is IGNORED for typing never author assembly origins (`aggregate` /
62
+ `collection` / `computed` / `first`) on a payload VO. Derivation belongs to
63
+ **projection** read models (`object.projection` over an entity), covered by the
64
+ `metaobjects-authoring` skill and `docs/features/source-kinds.md`, not here.
65
+
66
+ Declaring the payload shape is what makes payload bloat visible: adding a field to
67
+ the prompt is a diff on the `object.value`, and `verify` catches template/payload
68
+ drift at build time instead of letting a prompt silently degrade.
74
69
 
75
70
  ```json
76
71
  {
@@ -81,12 +76,10 @@ breaks the build instead of silently degrading the prompt.
81
76
  "object.value": {
82
77
  "name": "WelcomePayload",
83
78
  "children": [
84
- { "field.string": { "name": "displayName",
85
- "children": [ { "origin.passthrough": { "@from": "Author.name" } } ] } },
86
- { "field.long": { "name": "postCount",
87
- "children": [ { "origin.aggregate": { "@agg": "count", "@of": "Post.id", "@via": "Author.posts" } } ] } },
79
+ { "field.string": { "name": "displayName" } },
80
+ { "field.long": { "name": "postCount" } },
88
81
  { "field.object": { "name": "posts", "@objectRef": "PostSummary",
89
- "children": [ { "origin.collection": { "@via": "Author.posts" } } ] } }
82
+ "isArray": true } }
90
83
  ]
91
84
  }
92
85
  },
@@ -94,8 +87,7 @@ breaks the build instead of silently degrading the prompt.
94
87
  "object.value": {
95
88
  "name": "PostSummary",
96
89
  "children": [
97
- { "field.string": { "name": "title",
98
- "children": [ { "origin.passthrough": { "@from": "Post.title" } } ] } }
90
+ { "field.string": { "name": "title" } }
99
91
  ]
100
92
  }
101
93
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metaobjectsdev/sdk",
3
- "version": "0.20.15",
3
+ "version": "0.20.16",
4
4
  "description": "Workspace helpers and agent-docs utilities for MetaObjects projects.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -56,7 +56,7 @@
56
56
  "access": "public"
57
57
  },
58
58
  "dependencies": {
59
- "@metaobjectsdev/metadata": "0.20.15",
59
+ "@metaobjectsdev/metadata": "0.20.16",
60
60
  "zod": "^3.23.0"
61
61
  },
62
62
  "devDependencies": {