@coffer-org/plugin-garden 1.1.0 → 1.2.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.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  declare const _default: import("@coffer-org/sdk/plugin").PluginManifest;
2
2
  export default _default;
3
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineVault } from '@coffer-org/sdk/vault';
2
2
  import { definePlugin } from '@coffer-org/sdk/plugin';
3
- import plant from './plant/index.js';
3
+ import plant from "./plant/index.js";
4
4
  export default definePlugin({
5
5
  id: 'garden',
6
6
  version: '1.0.0',
@@ -12,4 +12,3 @@ export default definePlugin({
12
12
  },
13
13
  ],
14
14
  });
15
- //# sourceMappingURL=index.js.map
@@ -1,3 +1,2 @@
1
1
  declare const _default: import("@coffer-org/sdk/module").ModuleDef;
2
2
  export default _default;
3
- //# sourceMappingURL=index.d.ts.map
@@ -12,17 +12,17 @@ export default defineModule({
12
12
  vault: 'garden',
13
13
  label: 'garden.plant.label',
14
14
  icon: 'lucide:sprout',
15
- claude: `Рослина в домі. title — назва. variety — сорт/підвид. location — де стоїть.
16
- wateringDays — інтервал поливу (дні). lastWatered — дата останнього поливу.
17
- fertilizerDays — інтервал підживлення. lastFertilized — остання дата.
18
- planted — дата посадки/придбання.`,
15
+ claude: `A houseplant. title — name. variety — cultivar/subspecies. location — where it stands.
16
+ wateringDays — watering interval (days). lastWatered — date of last watering.
17
+ fertilizerDays — fertilizing interval. lastFertilized — last date.
18
+ planted — date planted/acquired.`,
19
19
  views: {
20
20
  table: ['variety', 'location', 'wateringDays', 'lastWatered'],
21
21
  },
22
22
  fields: [
23
23
  field.title({ key: 'name', label: 'core.fields.name' }),
24
24
  field.image({ key: 'logo', label: 'garden.plant.fields.logo' }),
25
- field.string({ key: 'variety', label: 'garden.plant.fields.variety', config: { max: 100 } }),
25
+ field.string({ key: 'variety', label: 'garden.plant.fields.variety', rules: { max: 100 } }),
26
26
  field.select({ key: 'location', label: 'garden.plant.fields.location', options: LOCATIONS }),
27
27
  field.select({
28
28
  key: 'sunlight',
@@ -34,14 +34,17 @@ planted — дата посадки/придбання.`,
34
34
  { value: 'direct', title: 'garden.plant.options.sunlight.direct' },
35
35
  ],
36
36
  }),
37
- field.string({ key: 'pot', label: 'garden.plant.fields.pot', config: { max: 100 } }),
38
- field.date({ key: 'planted', label: 'garden.plant.fields.planted', min: '2000-01-01', max: 'today' }),
39
- field.int({ key: 'wateringDays', label: 'garden.plant.fields.wateringDays', config: { min: 1, max: 365 } }),
40
- field.date({ key: 'lastWatered', label: 'garden.plant.fields.lastWatered', max: 'today' }),
41
- field.int({ key: 'fertilizerDays', label: 'garden.plant.fields.fertilizerDays', config: { min: 1, max: 365 } }),
42
- field.date({ key: 'lastFertilized', label: 'garden.plant.fields.lastFertilized', max: 'today' }),
43
- field.text({ key: 'notes', label: 'garden.plant.fields.notes', max: 500 }),
37
+ field.string({ key: 'pot', label: 'garden.plant.fields.pot', rules: { max: 100 } }),
38
+ field.date({ key: 'planted', label: 'garden.plant.fields.planted', rules: { min: '2000-01-01', max: 'today' } }),
39
+ field.int({ key: 'wateringDays', label: 'garden.plant.fields.wateringDays', rules: { min: 1, max: 365 } }),
40
+ field.date({ key: 'lastWatered', label: 'garden.plant.fields.lastWatered', rules: { max: 'today' } }),
41
+ field.reminder({ key: 'nextWatering', label: 'garden.plant.fields.nextWatering', rules: { lead: 3 } }),
42
+ field.int({ key: 'fertilizerDays', label: 'garden.plant.fields.fertilizerDays', rules: { min: 1, max: 365 } }),
43
+ field.date({ key: 'lastFertilized', label: 'garden.plant.fields.lastFertilized', rules: { max: 'today' } }),
44
+ field.reminder({ key: 'nextFertilizing', label: 'garden.plant.fields.nextFertilizing', rules: { lead: 7 } }),
45
+ field.button({ label: 'garden.plant.actions.watered', value: 'garden.watered', icon: 'lucide:droplet' }),
46
+ field.button({ label: 'garden.plant.actions.fertilized', value: 'garden.fertilized', icon: 'lucide:flask-conical' }),
47
+ field.text({ key: 'notes', label: 'garden.plant.fields.notes', rules: { max: 500 } }),
44
48
  field.tags({ key: 'tags', label: 'garden.plant.fields.tags' }),
45
49
  ],
46
50
  });
47
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ import type { PluginHooks } from '@coffer-org/server/plugin-hooks';
2
+ export declare const serverHooks: PluginHooks;
@@ -0,0 +1,71 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { localPost } from '@coffer-org/server/local-api';
3
+ import { seedAsset } from '@coffer-org/server/uploads';
4
+ const asset = (rel) => fileURLToPath(new URL(`../../seed/assets/${rel}`, import.meta.url));
5
+ export const serverHooks = {
6
+ seed: [
7
+ {
8
+ name: 'demo-plants',
9
+ run: async () => {
10
+ const logo = seedAsset(asset('plant.svg'));
11
+ await localPost('garden', 'plant', {
12
+ name: 'Monstera',
13
+ logo,
14
+ variety: 'Monstera deliciosa',
15
+ location: 'floor',
16
+ sunlight: 'indirect',
17
+ pot: 'Ceramic pot 24 cm',
18
+ planted: '2023-03-15',
19
+ wateringDays: 7,
20
+ lastWatered: '2026-06-18',
21
+ nextWatering: '2026-06-25',
22
+ fertilizerDays: 30,
23
+ lastFertilized: '2026-06-01',
24
+ nextFertilizing: '2026-07-01',
25
+ notes: 'Large split leaves. Likes a support for its aerial roots.',
26
+ tags: ['tropical', 'large'],
27
+ });
28
+ await localPost('garden', 'plant', {
29
+ name: 'Weeping Fig',
30
+ logo,
31
+ variety: 'Ficus benjamina',
32
+ location: 'windowsill',
33
+ sunlight: 'partial',
34
+ pot: 'Plastic pot 18 cm',
35
+ planted: '2022-09-10',
36
+ wateringDays: 5,
37
+ lastWatered: '2026-06-20',
38
+ nextWatering: '2026-06-25',
39
+ fertilizerDays: 21,
40
+ lastFertilized: '2026-06-10',
41
+ nextFertilizing: '2026-07-01',
42
+ notes: 'Drops leaves when moved. Dislikes drafts.',
43
+ tags: ['trees'],
44
+ });
45
+ await localPost('garden', 'plant', {
46
+ name: 'Phalaenopsis Orchid',
47
+ logo,
48
+ variety: 'Phalaenopsis',
49
+ location: 'windowsill',
50
+ sunlight: 'indirect',
51
+ pot: 'Transparent pot 12 cm',
52
+ planted: '2024-01-20',
53
+ wateringDays: 10,
54
+ lastWatered: '2026-06-15',
55
+ nextWatering: '2026-06-25',
56
+ fertilizerDays: 14,
57
+ lastFertilized: '2026-06-12',
58
+ nextFertilizing: '2026-06-26',
59
+ notes: 'Water by soaking. Blooms in winter, needs cool temperatures to set buds.',
60
+ tags: ['flowering', 'delicate'],
61
+ });
62
+ },
63
+ },
64
+ ],
65
+ agent: {
66
+ instructions: 'Vault garden — plants (plant): variety, location, sunlight, pot, planted, ' +
67
+ 'wateringDays/lastWatered/nextWatering, fertilizerDays/lastFertilized/nextFertilizing (ISO dates). ' +
68
+ 'To find what needs watering — compare nextWatering with today.' +
69
+ ' When watered/fertilized — update lastWatered/lastFertilized via update_record (and nextWatering = lastWatered + wateringDays, if not automatic).',
70
+ },
71
+ };
package/package.json CHANGED
@@ -1,14 +1,22 @@
1
1
  {
2
2
  "name": "@coffer-org/plugin-garden",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
+ "engines": {
6
+ "node": ">=24"
7
+ },
5
8
  "files": [
6
- "dist"
9
+ "dist",
10
+ "seed"
7
11
  ],
8
12
  "exports": {
9
13
  ".": {
10
14
  "types": "./dist/index.d.ts",
11
15
  "default": "./dist/index.js"
16
+ },
17
+ "./runtime": {
18
+ "types": "./dist/runtime/index.d.ts",
19
+ "default": "./dist/runtime/index.js"
12
20
  }
13
21
  },
14
22
  "scripts": {
@@ -17,6 +25,7 @@
17
25
  "postpack": "node ../../scripts/swap-exports.mjs src"
18
26
  },
19
27
  "dependencies": {
20
- "@coffer-org/sdk": "^1.1.0"
28
+ "@coffer-org/sdk": "^1.2.0",
29
+ "@coffer-org/server": "^1.2.0"
21
30
  }
22
31
  }
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160" role="img" aria-label="demo plant">
2
+ <rect width="160" height="160" rx="16" fill="#dcfce7"/>
3
+ <path d="M80 132V72" stroke="#15803d" stroke-width="8" stroke-linecap="round"/>
4
+ <path d="M80 88C80 64 60 48 36 48c0 24 20 40 44 40z" fill="#22c55e"/>
5
+ <path d="M80 76c0-24 20-40 44-40 0 24-20 40-44 40z" fill="#16a34a"/>
6
+ <path d="M52 132h56l-8 16H60z" fill="#a16207"/>
7
+ </svg>
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAIA,wBAUG"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AAErC,eAAe,YAAY,CAAC;IAC1B,EAAE,EAAE,QAAQ;IACZ,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,EAAE;IACb,MAAM,EAAE;QACN;YACE,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,oBAAoB,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;YACvF,OAAO,EAAE,CAAC,KAAK,CAAC;SACjB;KACF;CACF,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plant/index.ts"],"names":[],"mappings":";AAWA,wBAoCG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EA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