@coffer-org/plugin-transit 5.0.0 → 7.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.
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ export default definePlugin({
14
14
  label: 'transit.library.label',
15
15
  icon: 'lucide:bus',
16
16
  agent: 'Local bus routes and their departure schedules (bus_route).',
17
+ starterHint: 'the next departures on the saved routes',
17
18
  }),
18
19
  shelves: [bus_route],
19
20
  },
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
@@ -8545,6 +8556,12 @@ function divider(o) {
8545
8556
  /**
8546
8557
  * Reference markdown block by i18n key.
8547
8558
  *
8559
+ * The key is resolved WITH the variables of the running instance, so the locale string
8560
+ * may name facts that are not constants: `{{origin}}` is this instance's own address
8561
+ * (`https://coffer.example`), which is how a block documents an endpoint without
8562
+ * freezing a developer's `localhost` into every translation. The set is fixed and
8563
+ * ambient — the block declares only its key. See `web-ui/src/render/info-text.ts`.
8564
+ *
8548
8565
  * @layer primitive
8549
8566
  * @prim —
8550
8567
  * @widget info
@@ -10159,10 +10176,11 @@ var field = new Proxy({}, {
10159
10176
  has: (_t, k) => k in composedField()
10160
10177
  });
10161
10178
  function toClient(field) {
10162
- const { kind, label, required, prim, hints, options, strict, relation, json, hidden, derived, parts, cache } = field;
10179
+ const { kind, label, agent, required, prim, hints, options, strict, relation, json, hidden, derived, parts, cache } = field;
10163
10180
  return {
10164
10181
  kind,
10165
10182
  label,
10183
+ ...agent !== void 0 && { agent },
10166
10184
  required,
10167
10185
  prim,
10168
10186
  hints,
@@ -10955,7 +10973,7 @@ function defineShelf(m) {
10955
10973
  const keys = fieldEntries(built.fields).map(([k]) => k);
10956
10974
  const dup = keys.find((k, i) => keys.indexOf(k) !== i);
10957
10975
  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`);
10976
+ if (built.single && !built.agent) throw new Error(`[shelf] ${built.library}/${built.shelf}: single shelf requires \`agent\` — the agent cannot find it otherwise`);
10959
10977
  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
10978
  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
10979
  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`);
@@ -11073,7 +11091,8 @@ var src_default = definePlugin({
11073
11091
  id: "transit",
11074
11092
  label: "transit.library.label",
11075
11093
  icon: "lucide:bus",
11076
- agent: "Local bus routes and their departure schedules (bus_route)."
11094
+ agent: "Local bus routes and their departure schedules (bus_route).",
11095
+ starterHint: "the next departures on the saved routes"
11077
11096
  }),
11078
11097
  shelves: [bus_route_default]
11079
11098
  }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffer-org/plugin-transit",
3
- "version": "5.0.0",
3
+ "version": "7.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": "^7.0.0",
30
+ "@coffer-org/server": "^7.0.0",
31
+ "@coffer-org/helper-dav": "^7.0.0"
32
32
  },
33
33
  "coffer": {
34
34
  "runtime": "node",