@owlmeans/resource 0.1.16-rc.0 → 0.1.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.
package/README.md
CHANGED
|
@@ -119,10 +119,9 @@ resource initialization** (app setup) — registering one is all an app ever doe
|
|
|
119
119
|
<!-- owlmeans:agent-guidance:start -->
|
|
120
120
|
## Agent guidance
|
|
121
121
|
|
|
122
|
-
This package ships embedded
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
(`.claude/skills/` and `.github/instructions/`):
|
|
122
|
+
This package ships embedded agent skills under `agent-meta/`. After installing your
|
|
123
|
+
`@owlmeans/*` packages, run the OwlMeans agent-skills installer to place them into
|
|
124
|
+
your project's skill store (`.agents/skills/`):
|
|
126
125
|
|
|
127
126
|
```sh
|
|
128
127
|
npx @owlmeans/agent-skills
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
2
|
+
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/resource",
|
|
4
|
-
"version": "0.1.16
|
|
5
|
-
"generatedAt": "2026-08-
|
|
4
|
+
"version": "0.1.16",
|
|
5
|
+
"generatedAt": "2026-08-14T10:14:48.847Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -10,14 +10,7 @@
|
|
|
10
10
|
"name": "resource",
|
|
11
11
|
"category": "package-specific",
|
|
12
12
|
"file": "skills/resource/SKILL.md",
|
|
13
|
-
"canonicalPath": ".
|
|
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"
|
|
13
|
+
"canonicalPath": ".agents/skills/resource/SKILL.md"
|
|
21
14
|
}
|
|
22
15
|
]
|
|
23
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/resource",
|
|
3
|
-
"version": "0.1.16
|
|
3
|
+
"version": "0.1.16",
|
|
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.16
|
|
26
|
-
"@owlmeans/error": "^0.1.16
|
|
25
|
+
"@owlmeans/context": "^0.1.16",
|
|
26
|
+
"@owlmeans/error": "^0.1.16",
|
|
27
27
|
"@scure/base": "^1.1.9"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "How to use @owlmeans/resource — generic resource abstraction (CRUD over records) plus the storage-agnostic migration framework (MigratableResource, registry/store/runner). Use when implementing a custom resource or adding migration support to a database backend."
|
|
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.16-rc.0"` in `dependencies`
|
|
11
|
-
|
|
12
|
-
## Key Exports
|
|
13
|
-
|
|
14
|
-
| Export | Description |
|
|
15
|
-
|--------|-------------|
|
|
16
|
-
| `Resource<T>` | Generic contract: get/load/list/save/create/update/delete/pick |
|
|
17
|
-
| `MigratableResource<Tx>` | Optional migration capability — `migration(name, apply, stage?)` + `migrations()`. Optional like pub/sub on redis: mongo/postgres extend it, others don't |
|
|
18
|
-
| `MigrationRegistry`, `MigrationStore`, `createMigrationRegistry`, `runMigrations`, `MigrationStage` | The framework: per-alias registry (declaration order = application order), the applied-tracking register a db implements, the storage-agnostic runner (`baseline` for fresh structures, strict checksums) |
|
|
19
|
-
| Errors | `UnknownRecordError`, `MisshapedRecord`, `RecordExists`, `RecordUpdateFailed`, `UnsupportedArgumentError`, `MigrationError`, `MigrationConflict` |
|
|
20
|
-
| `createDbService`, `prepareListOptions`, `DbConfig` | Service base, list helpers, `cfg.dbs` config type |
|
|
21
|
-
|
|
22
|
-
## Usage
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import type { Resource } from '@owlmeans/resource'
|
|
26
|
-
const projects = ctx.resource<Resource<Project>>('projects')
|
|
27
|
-
const { items } = await projects.list({ entityId: 'abc' })
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Migration framework rules
|
|
31
|
-
|
|
32
|
-
- Migrations run **automatically on app setup** inside resource `init()` — apps only register.
|
|
33
|
-
- Each migration self-checks: registry skips ledger-recorded names; `baseline: true` records
|
|
34
|
-
instead of running on just-created structures; bodies are written idempotent.
|
|
35
|
-
- New backend support: extend the concrete interface with `MigratableResource<YourTx>`; keep
|
|
36
|
-
registrations in a module-scope declaration keyed by alias (context rebuilds must not lose
|
|
37
|
-
them); implement `MigrationStore` over a durable ledger; in `init()` probe → baseline|Pre →
|
|
38
|
-
reconcile structure → Post; make `run` atomic with the ledger where the db allows
|
|
39
|
-
(postgres tx), claim-then-complete where it doesn't (mongo).
|
|
40
|
-
|
|
41
|
-
## Depends On
|
|
42
|
-
|
|
43
|
-
- `@owlmeans/context`, `@noble/hashes` (body checksums)
|