@codyswann/lisa 2.169.0 → 2.171.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/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/skills/harper-auth/SKILL.md +320 -0
- package/plugins/lisa-harper-fabric/skills/harper-auth/agents/openai.yaml +4 -0
- package/plugins/lisa-harper-fabric/skills/harper-caching/SKILL.md +265 -0
- package/plugins/lisa-harper-fabric/skills/harper-caching/agents/openai.yaml +4 -0
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/skills/harper-auth/SKILL.md +320 -0
- package/plugins/lisa-harper-fabric-agy/skills/harper-caching/SKILL.md +265 -0
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/skills/harper-auth/SKILL.md +320 -0
- package/plugins/lisa-harper-fabric-copilot/skills/harper-caching/SKILL.md +265 -0
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/skills/harper-auth/SKILL.md +320 -0
- package/plugins/lisa-harper-fabric-cursor/skills/harper-caching/SKILL.md +265 -0
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/src/harper-fabric/skills/harper-auth/SKILL.md +320 -0
- package/plugins/src/harper-fabric/skills/harper-caching/SKILL.md +265 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: harper-caching
|
|
3
|
+
description: This skill should be used when implementing Harper (HarperDB/Fabric) caching tables, external-source caches, TTL expiration, stale revalidation, invalidation, and cache verification. Use it when caching an upstream API, database, or expensive computation in Harper instead of hand-rolling in-memory maps. Pairs with harper-resources, harper-schema-graphql, harper-rest-queries, and harper-operations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Harper Caching
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Harper can use a local table as a durable cache for an external source. The table
|
|
11
|
+
stores records, enforces schema/index behavior, exposes normal REST/GraphQL
|
|
12
|
+
routes, and calls the source Resource only when a record is missing, expired, or
|
|
13
|
+
explicitly invalidated.
|
|
14
|
+
|
|
15
|
+
Use a caching table when the cached data should survive process restarts,
|
|
16
|
+
participate in Harper queries, or stay coherent across Fabric nodes. Do not keep
|
|
17
|
+
API responses in a module-level `Map` unless the data is deliberately
|
|
18
|
+
process-local, disposable, and not part of the application data model.
|
|
19
|
+
|
|
20
|
+
Cross-check the table declaration in [[harper-schema-graphql]] and the Resource
|
|
21
|
+
method conventions in [[harper-resources]] before editing. If cached records are
|
|
22
|
+
queried by filters, sort keys, or relationships, also align indexes and query
|
|
23
|
+
shape with [[harper-rest-queries]].
|
|
24
|
+
|
|
25
|
+
## Declare the cache table
|
|
26
|
+
|
|
27
|
+
Declare a normal `@table` and expose it with `@export` when callers should reach
|
|
28
|
+
the cache over REST or GraphQL. Use the `expiration` argument on `@table` for the
|
|
29
|
+
default time-to-live, in seconds:
|
|
30
|
+
|
|
31
|
+
```graphql
|
|
32
|
+
type WeatherSnapshot @table(expiration: 300) @export(name: "weather") {
|
|
33
|
+
locationId: String @primaryKey
|
|
34
|
+
city: String @indexed
|
|
35
|
+
temperatureF: Float
|
|
36
|
+
conditions: String
|
|
37
|
+
sourceUpdatedAt: Long
|
|
38
|
+
fetchedAt: Long
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Guidance:
|
|
43
|
+
|
|
44
|
+
- Keep the primary key stable and derived from the upstream identity. For an
|
|
45
|
+
external REST API, a normalized URL slug, vendor id, or compound key string is
|
|
46
|
+
usually better than an auto-generated id.
|
|
47
|
+
- Index attributes used by cache reads (`city`, `tenantId`, `category`, `status`)
|
|
48
|
+
so callers do not fetch broad collections and filter in JavaScript.
|
|
49
|
+
- Store upstream freshness metadata such as `sourceUpdatedAt`, `etag`, or
|
|
50
|
+
`fetchedAt` when verification, debugging, or conditional revalidation needs it.
|
|
51
|
+
- Keep TTL at the table level unless the upstream response controls freshness per
|
|
52
|
+
record. Per-record expiration belongs in the source Resource context.
|
|
53
|
+
|
|
54
|
+
## Wire `sourcedFrom`
|
|
55
|
+
|
|
56
|
+
Implement a source Resource that fetches the upstream record, then attach it to
|
|
57
|
+
the table with `sourcedFrom`. In Lisa template projects, write TypeScript under
|
|
58
|
+
`src/` and rebuild the generated Harper assets; do not edit `resources.js` by
|
|
59
|
+
hand.
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
export class WeatherApiSource extends Resource {
|
|
63
|
+
static loadAsInstance = false;
|
|
64
|
+
|
|
65
|
+
async get(target) {
|
|
66
|
+
const id = target.id;
|
|
67
|
+
const response = await fetch(
|
|
68
|
+
`https://api.example.com/weather/${encodeURIComponent(id)}`,
|
|
69
|
+
{
|
|
70
|
+
headers: { Accept: 'application/json' },
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
if (response.status === 404) {
|
|
75
|
+
const error = new Error(`Weather location not found: ${id}`);
|
|
76
|
+
error.statusCode = 404;
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (!response.ok) {
|
|
81
|
+
const error = new Error(`Weather upstream failed: ${response.status}`);
|
|
82
|
+
error.statusCode = 502;
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const data = await response.json();
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
locationId: id,
|
|
90
|
+
city: data.city,
|
|
91
|
+
temperatureF: data.temperatureF,
|
|
92
|
+
conditions: data.conditions,
|
|
93
|
+
sourceUpdatedAt: Date.parse(data.updatedAt),
|
|
94
|
+
fetchedAt: Date.now(),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
tables.WeatherSnapshot.sourcedFrom(WeatherApiSource);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
When a requested record is missing or stale, Harper calls the source `get()` and
|
|
103
|
+
caches the returned record in the local table. Concurrent requests for the same
|
|
104
|
+
missing or stale record share the same upstream load, which avoids a cache
|
|
105
|
+
stampede for a single key.
|
|
106
|
+
|
|
107
|
+
## TTL and eviction
|
|
108
|
+
|
|
109
|
+
Use `expiration` for the TTL: after that many seconds, the cached entry is stale
|
|
110
|
+
and the next read reloads it from the source. If a project cannot express the
|
|
111
|
+
default in schema, `sourcedFrom` can also receive options:
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
tables.WeatherSnapshot.sourcedFrom(WeatherApiSource, {
|
|
115
|
+
expiration: 300,
|
|
116
|
+
eviction: 3600,
|
|
117
|
+
scanInterval: 60,
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Option meanings:
|
|
122
|
+
|
|
123
|
+
| Option | Use |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| `expiration` | Default TTL in seconds before the cached record is stale. |
|
|
126
|
+
| `eviction` | Seconds after expiration before Harper may physically remove the record. |
|
|
127
|
+
| `scanInterval` | Seconds between scans for expired records. |
|
|
128
|
+
|
|
129
|
+
Prefer schema directives for stable application behavior because the data model
|
|
130
|
+
and default freshness policy stay together. Use `sourcedFrom` options when the
|
|
131
|
+
cache attachment is intentionally dynamic or the downstream Harper version lacks
|
|
132
|
+
the needed schema directive.
|
|
133
|
+
|
|
134
|
+
## Conditional revalidation
|
|
135
|
+
|
|
136
|
+
When the upstream provides `ETag`, `Last-Modified`, or `Cache-Control`, pass that
|
|
137
|
+
freshness model through the source Resource instead of overwriting good cached
|
|
138
|
+
data with every revalidation.
|
|
139
|
+
|
|
140
|
+
```javascript
|
|
141
|
+
export class WeatherApiSource extends Resource {
|
|
142
|
+
static loadAsInstance = false;
|
|
143
|
+
|
|
144
|
+
async get(target) {
|
|
145
|
+
const context = this.getContext();
|
|
146
|
+
const headers = new Headers({ Accept: 'application/json' });
|
|
147
|
+
|
|
148
|
+
if (context.replacingVersion) {
|
|
149
|
+
headers.set(
|
|
150
|
+
'If-Modified-Since',
|
|
151
|
+
new Date(context.replacingVersion).toUTCString(),
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const response = await fetch(
|
|
156
|
+
`https://api.example.com/weather/${encodeURIComponent(target.id)}`,
|
|
157
|
+
{ headers },
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
if (response.status === 304) {
|
|
161
|
+
return context.replacingRecord;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const maxAge = response.headers
|
|
165
|
+
.get('Cache-Control')
|
|
166
|
+
?.match(/max-age=(\d+)/)?.[1];
|
|
167
|
+
|
|
168
|
+
if (maxAge) {
|
|
169
|
+
context.expiresAt = Date.now() + Number(maxAge) * 1000;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
context.lastModified = response.headers.get('Last-Modified');
|
|
173
|
+
return response.json();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Use `allowStaleWhileRevalidate(entry, id)` on the cached table when stale data is
|
|
179
|
+
acceptable during refresh:
|
|
180
|
+
|
|
181
|
+
```javascript
|
|
182
|
+
export class WeatherSnapshot extends tables.WeatherSnapshot {
|
|
183
|
+
static loadAsInstance = false;
|
|
184
|
+
|
|
185
|
+
allowStaleWhileRevalidate(entry, id) {
|
|
186
|
+
return Date.now() - entry.expiresAt < 60_000;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Return `false` or omit the method when callers must wait for a fresh value.
|
|
192
|
+
|
|
193
|
+
## Explicit invalidation
|
|
194
|
+
|
|
195
|
+
Use invalidation when an admin action, webhook, scheduled refresh, or upstream
|
|
196
|
+
write makes the cached record stale before its TTL.
|
|
197
|
+
|
|
198
|
+
```javascript
|
|
199
|
+
await tables.WeatherSnapshot.invalidate('nyc');
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The next `get()` for that id reloads from the source. If the project Harper
|
|
203
|
+
version or resource shape does not expose `invalidate()`, use an explicit delete
|
|
204
|
+
or overwrite path and document the behavior:
|
|
205
|
+
|
|
206
|
+
```javascript
|
|
207
|
+
await tables.WeatherSnapshot.delete('nyc');
|
|
208
|
+
await tables.WeatherSnapshot.get('nyc');
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
For write-through caches, implement `put`, `patch`, or `delete` on the source
|
|
212
|
+
Resource only when those operations should update the upstream system. Otherwise,
|
|
213
|
+
reject writes or keep cache mutation behind an operator-only Resource so clients
|
|
214
|
+
do not accidentally diverge from the source of truth.
|
|
215
|
+
|
|
216
|
+
## Fabric coherence
|
|
217
|
+
|
|
218
|
+
In a Fabric deployment, treat every node as capable of serving a read while cache
|
|
219
|
+
state is replicating:
|
|
220
|
+
|
|
221
|
+
- Keep `get()` deterministic and idempotent. A second node may reload the same
|
|
222
|
+
stale key.
|
|
223
|
+
- Do not store request-local data, credentials, or tenant state in module-level
|
|
224
|
+
variables. Read identity from Resource context and pass context through when
|
|
225
|
+
calling other resources.
|
|
226
|
+
- Pick TTLs that tolerate replication delay. Very short TTLs can turn a cache
|
|
227
|
+
into repeated upstream traffic across nodes.
|
|
228
|
+
- After invalidation, verify from the route or node that matters for the caller.
|
|
229
|
+
Cross-node visibility may lag until replication catches up.
|
|
230
|
+
- Use Harper storage reclamation settings for disk-pressure eviction tuning, not
|
|
231
|
+
as a substitute for application freshness rules.
|
|
232
|
+
|
|
233
|
+
## Local verification recipe
|
|
234
|
+
|
|
235
|
+
Prove both cache fill and cache hit behavior against a running Harper app:
|
|
236
|
+
|
|
237
|
+
1. Add a temporary upstream counter, fixture server log, or test-only header that
|
|
238
|
+
shows how many times the source Resource fetched the upstream id.
|
|
239
|
+
2. Build and boot the app (`bun run build`, then the project Harper dev command).
|
|
240
|
+
3. Request the same id twice:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
curl -sS http://localhost:9926/weather/nyc | jq .
|
|
244
|
+
curl -sS http://localhost:9926/weather/nyc | jq .
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
4. Confirm the upstream was called once, the second response came from the table,
|
|
248
|
+
and the record contains `fetchedAt` or equivalent freshness evidence.
|
|
249
|
+
5. Invalidate or delete the id, request it again, and confirm the upstream count
|
|
250
|
+
increments:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
curl -sS -X DELETE http://localhost:9926/weather/nyc
|
|
254
|
+
curl -sS http://localhost:9926/weather/nyc | jq .
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
6. If TTL behavior matters, lower `expiration` in a local-only test fixture,
|
|
258
|
+
wait past the TTL, and verify either blocking refresh or stale-while-revalidate
|
|
259
|
+
behavior matches the Resource implementation.
|
|
260
|
+
|
|
261
|
+
## Sources
|
|
262
|
+
|
|
263
|
+
- [Harper v4 Resource API](https://docs.harperdb.io/reference/v4/resources/resource-api)
|
|
264
|
+
- [Harper v5 Resources overview](https://docs.harperdb.io/reference/v5/resources/overview)
|
|
265
|
+
- [Harper storage tuning](https://docs.harperdb.io/reference/v5/database/storage-tuning)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.171.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.171.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.171.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.171.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.171.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|