@owlmeans/resource 0.1.6 → 0.1.8

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/README.md CHANGED
@@ -92,3 +92,20 @@ interface ResourceMaker<R extends ResourceRecord, T extends Resource<R> = Resour
92
92
  - [`@owlmeans/mongo-resource`](../mongo-resource) — MongoDB implementation
93
93
  - [`@owlmeans/redis-resource`](../redis-resource) — Redis implementation
94
94
  - [`@owlmeans/state`](../state) — in-memory implementation for client state
95
+
96
+ <!-- owlmeans:agent-guidance:start -->
97
+ ## Agent guidance
98
+
99
+ This package ships embedded Claude Code skills and GitHub Copilot instructions under
100
+ `agent-meta/`. After installing your `@owlmeans/*` packages, run the OwlMeans
101
+ agent-skills installer to place them into your project's native locations
102
+ (`.claude/skills/` and `.github/instructions/`):
103
+
104
+ ```sh
105
+ npx @owlmeans/agent-skills
106
+ ```
107
+
108
+ The embedded files are version-matched to this package release. Do not edit them
109
+ directly — they are regenerated on each publish. To contribute guidance edits,
110
+ open a PR against the source monorepo.
111
+ <!-- owlmeans:agent-guidance:end -->
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: "How to use @owlmeans/resource — generic resource abstraction (CRUD over a collection of records) used by mongo-resource, redis-resource, state, storage-resource. Use when implementing a custom resource."
3
+ applyTo: "**/*.ts, **/*.tsx"
4
+ ---
5
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
6
+
7
+ # @owlmeans/resource
8
+
9
+ **Layer:** Core
10
+ **Install:** `"@owlmeans/resource": "^0.1.8"` in `dependencies`
11
+
12
+ ## Key Exports
13
+
14
+ | Export | Description |
15
+ |--------|-------------|
16
+ | `Resource<T>` types | Generic resource interface (get/list/create/update/delete) |
17
+ | Errors | Typed resource errors (NotFound, AlreadyExists, etc.) |
18
+ | Constants | Default resource aliases |
19
+ | Service helpers | Wrap a resource as a context service |
20
+
21
+ ## Usage
22
+
23
+ ```typescript
24
+ import type { Resource } from '@owlmeans/resource'
25
+
26
+ interface Project { id: string; name: string; entityId: string }
27
+ const projects = ctx.getResource<Resource<Project>>('projects')
28
+ const { items } = await projects.list({ entityId: 'abc' })
29
+ ```
30
+
31
+ ## Depends On
32
+
33
+ - `@owlmeans/error`, `@owlmeans/i18n`
@@ -0,0 +1,23 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "package": "@owlmeans/resource",
4
+ "version": "0.1.8",
5
+ "generatedAt": "2026-06-11T16:30:27.164Z",
6
+ "canonicalRepo": "https://github.com/owlmeans/common",
7
+ "entries": [
8
+ {
9
+ "kind": "skill",
10
+ "name": "resource",
11
+ "category": "package-specific",
12
+ "file": "skills/resource/SKILL.md",
13
+ "canonicalPath": ".claude/skills/resource/SKILL.md"
14
+ },
15
+ {
16
+ "kind": "instruction",
17
+ "name": "resource",
18
+ "category": "package-specific",
19
+ "file": "instructions/resource.instructions.md",
20
+ "canonicalPath": ".github/instructions/resource.instructions.md"
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: resource
3
+ description: How to use @owlmeans/resource — generic resource abstraction (CRUD over a collection of records) used by mongo-resource, redis-resource, state, storage-resource, etc. Auto-invoked when importing from this package or implementing a custom resource type.
4
+ user-invocable: false
5
+ ---
6
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
7
+
8
+ # @owlmeans/resource
9
+
10
+ **Layer:** Core
11
+ **Install:** `"@owlmeans/resource": "^0.1.8"` in `dependencies`
12
+
13
+ ## Key Exports
14
+
15
+ | Export | Description |
16
+ |--------|-------------|
17
+ | `Resource<T>` types | Generic resource interface (get/list/create/update/delete) |
18
+ | Errors | Typed resource errors (NotFound, AlreadyExists, etc.) |
19
+ | Constants | Default resource aliases, operation names |
20
+ | Service helpers | Wrap a resource as a context service |
21
+
22
+ ## Usage
23
+
24
+ A resource is a typed CRUD-over-records abstraction. Concrete implementations come from `@owlmeans/mongo-resource`, `@owlmeans/redis-resource`, `@owlmeans/state`, etc. Consumers register a resource with the context and access it via `ctx.getResource<T>(alias)`.
25
+
26
+ ```typescript
27
+ import type { Resource } from '@owlmeans/resource'
28
+
29
+ interface Project { id: string; name: string; entityId: string }
30
+ const projects = ctx.getResource<Resource<Project>>('projects')
31
+ const { items } = await projects.list({ entityId: 'abc' })
32
+ ```
33
+
34
+ ## Depends On
35
+
36
+ - `@owlmeans/error` — for typed errors
37
+ - `@owlmeans/i18n` — error messages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/resource",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@noble/hashes": "^1.5.0",
25
- "@owlmeans/context": "^0.1.6",
26
- "@owlmeans/error": "^0.1.6",
25
+ "@owlmeans/context": "^0.1.8",
26
+ "@owlmeans/error": "^0.1.8",
27
27
  "@scure/base": "^1.1.9"
28
28
  },
29
29
  "peerDependencies": {