@coffer-org/plugin-transit 5.0.0 → 6.0.0

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 (2) hide show
  1. package/dist/schema.js +15 -3
  2. package/package.json +4 -4
package/dist/schema.js CHANGED
@@ -4687,6 +4687,13 @@ function wrapKey(key, opts, meta) {
4687
4687
  editor: opts.editor
4688
4688
  }
4689
4689
  };
4690
+ if (opts.activate) m = {
4691
+ ...m,
4692
+ hints: {
4693
+ ...m.hints,
4694
+ activate: opts.activate
4695
+ }
4696
+ };
4690
4697
  if (opts.span !== void 0) m = {
4691
4698
  ...m,
4692
4699
  hints: {
@@ -4759,6 +4766,7 @@ function wrapKey(key, opts, meta) {
4759
4766
  function normalizeOpts(rawIn) {
4760
4767
  const raw = rawIn;
4761
4768
  if (raw["view"] !== void 0) throw new Error("[normalizeOpts] `view` is gone — presentational options live in `ui: {}` (see CLAUDE.md § field author options and the field-types skill).");
4769
+ if (raw.ui?.["agent"] !== void 0) throw new Error("[normalizeOpts] `agent` is not presentation — declare it at the top level of the field call, not in `ui: {}`.");
4762
4770
  const r = raw.rules ?? {};
4763
4771
  const v = raw.ui ?? {};
4764
4772
  const config = {};
@@ -4795,7 +4803,8 @@ function normalizeOpts(rawIn) {
4795
4803
  emphasis: v.emphasis,
4796
4804
  noLabel: v.noLabel,
4797
4805
  role: v.role,
4798
- editor: v.editor
4806
+ editor: v.editor,
4807
+ activate: v.activate
4799
4808
  };
4800
4809
  return Object.fromEntries(Object.entries(result).filter(([, val]) => val !== void 0));
4801
4810
  }
@@ -5030,6 +5039,7 @@ function materialize(decl, name) {
5030
5039
  const base = {
5031
5040
  kind: type.kind,
5032
5041
  label: opts.label ?? "",
5042
+ ...opts.agent !== void 0 && { agent: opts.agent },
5033
5043
  required,
5034
5044
  prim: type.prim,
5035
5045
  column: built.column,
@@ -5073,6 +5083,7 @@ function collectionGroup(key, opts, parts, collectionView) {
5073
5083
  multiple: true,
5074
5084
  required: opts.required ?? false,
5075
5085
  label: opts.label ?? key,
5086
+ ...opts.agent !== void 0 && { agent: opts.agent },
5076
5087
  display: "wrap",
5077
5088
  kind: collectionView,
5078
5089
  fields: rowFields
@@ -10159,10 +10170,11 @@ var field = new Proxy({}, {
10159
10170
  has: (_t, k) => k in composedField()
10160
10171
  });
10161
10172
  function toClient(field) {
10162
- const { kind, label, required, prim, hints, options, strict, relation, json, hidden, derived, parts, cache } = field;
10173
+ const { kind, label, agent, required, prim, hints, options, strict, relation, json, hidden, derived, parts, cache } = field;
10163
10174
  return {
10164
10175
  kind,
10165
10176
  label,
10177
+ ...agent !== void 0 && { agent },
10166
10178
  required,
10167
10179
  prim,
10168
10180
  hints,
@@ -10955,7 +10967,7 @@ function defineShelf(m) {
10955
10967
  const keys = fieldEntries(built.fields).map(([k]) => k);
10956
10968
  const dup = keys.find((k, i) => keys.indexOf(k) !== i);
10957
10969
  if (dup) throw new Error(`[shelf] ${built.library}/${built.shelf}: duplicate key '${dup}'`);
10958
- if (built.single && !built.claude) throw new Error(`[shelf] ${built.library}/${built.shelf}: single shelf requires \`claude\` — the agent cannot find it otherwise`);
10970
+ if (built.single && !built.agent) throw new Error(`[shelf] ${built.library}/${built.shelf}: single shelf requires \`agent\` — the agent cannot find it otherwise`);
10959
10971
  if (built.views?.list !== void 0 && !Array.isArray(built.views.list)) throw new Error(`[shelf] ${built.library}/${built.shelf}: views.list is a flat array of field keys — the { kind, fields } form is gone; use views.list: [...] plus views.listKind`);
10960
10972
  if (built.standalone !== false && !built.single && !built.views?.list?.length) console.warn(`[shelf] ${built.library}/${built.shelf}: standalone shelf without an explicit views.list`);
10961
10973
  if (built.views?.title && !ownFieldEntries(built.fields).some(([k]) => k === built.views.title)) throw new Error(`[shelf] ${built.library}/${built.shelf}: views.title '${built.views.title}' is not a field`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffer-org/plugin-transit",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24"
@@ -26,9 +26,9 @@
26
26
  "test": "node --import tsx/esm --test 'src/runtime/*.test.ts'"
27
27
  },
28
28
  "dependencies": {
29
- "@coffer-org/sdk": "^5.0.0",
30
- "@coffer-org/server": "^5.0.0",
31
- "@coffer-org/helper-dav": "^5.0.0"
29
+ "@coffer-org/sdk": "^6.0.0",
30
+ "@coffer-org/server": "^6.0.0",
31
+ "@coffer-org/helper-dav": "^6.0.0"
32
32
  },
33
33
  "coffer": {
34
34
  "runtime": "node",