@harperfast/template-react-studio 1.6.3 → 1.6.4
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/.agents/skills/harper-best-practices/AGENTS.md +1425 -300
- package/.agents/skills/harper-best-practices/SKILL.md +24 -20
- package/.agents/skills/harper-best-practices/rules/adding-tables-with-schemas.md +2 -0
- package/.agents/skills/harper-best-practices/rules/automatic-apis.md +141 -18
- package/.agents/skills/harper-best-practices/rules/caching.md +134 -21
- package/.agents/skills/harper-best-practices/rules/checking-authentication.md +139 -148
- package/.agents/skills/harper-best-practices/rules/creating-a-fabric-account-and-cluster.md +2 -0
- package/.agents/skills/harper-best-practices/rules/creating-harper-apps.md +2 -0
- package/.agents/skills/harper-best-practices/rules/custom-resources.md +2 -0
- package/.agents/skills/harper-best-practices/rules/defining-relationships.md +2 -0
- package/.agents/skills/harper-best-practices/rules/deploying-to-harper-fabric.md +97 -77
- package/.agents/skills/harper-best-practices/rules/extending-tables.md +2 -0
- package/.agents/skills/harper-best-practices/rules/handling-binary-data.md +2 -0
- package/.agents/skills/harper-best-practices/rules/logging.md +154 -77
- package/.agents/skills/harper-best-practices/rules/programmatic-table-requests.md +32 -26
- package/.agents/skills/harper-best-practices/rules/querying-rest-apis.md +190 -15
- package/.agents/skills/harper-best-practices/rules/real-time-apps.md +80 -21
- package/.agents/skills/harper-best-practices/rules/schema-design-tooling.md +2 -0
- package/.agents/skills/harper-best-practices/rules/serving-web-content.md +2 -0
- package/.agents/skills/harper-best-practices/rules/typescript-type-stripping.md +2 -0
- package/.agents/skills/harper-best-practices/rules/using-blob-datatype.md +2 -0
- package/.agents/skills/harper-best-practices/rules/vector-indexing.md +85 -120
- package/.agents/skills/harper-best-practices/rules.manifest.yaml +258 -0
- package/package.json +1 -1
- package/skills-lock.json +1 -1
|
@@ -1,43 +1,102 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: real-time-apps
|
|
3
3
|
description: How to build real-time features in Harper using WebSockets and Pub/Sub.
|
|
4
|
+
metadata:
|
|
5
|
+
mode: generate
|
|
6
|
+
sources:
|
|
7
|
+
- reference/v5/rest/websockets.md
|
|
8
|
+
sourceCommit: b7fbddadd42eb4487190b650a9abc4bcfeef5819
|
|
9
|
+
inputHash: a8afd4d3a52f77ba
|
|
4
10
|
---
|
|
5
11
|
|
|
6
|
-
# Real-
|
|
12
|
+
# Real-Time Apps with WebSockets and Pub/Sub
|
|
7
13
|
|
|
8
|
-
Instructions for the agent to follow when building real-time
|
|
14
|
+
Instructions for the agent to follow when building real-time features in Harper using WebSockets and Pub/Sub.
|
|
9
15
|
|
|
10
16
|
## When to Use
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
Apply this rule when implementing any feature that requires real-time bidirectional communication, live data streaming, or push-based updates in a Harper application. This includes chat, live dashboards, sensor feeds, and any scenario where clients must receive resource changes as they happen.
|
|
13
19
|
|
|
14
20
|
## How It Works
|
|
15
21
|
|
|
16
|
-
1. **
|
|
17
|
-
2. **Implement `connect` in a Resource**: For custom bi-directional logic, implement the `connect` method.
|
|
18
|
-
3. **Use Pub/Sub**: Use `tables.TableName.subscribe(query)` to listen for specific data changes and stream them to the client.
|
|
19
|
-
4. **Handle SSE**: Ensure your `connect` method gracefully handles cases where `incomingMessages` is null (Server-Sent Events).
|
|
20
|
-
5. **Connect from Client**: Use standard WebSockets (`new WebSocket('wss://...')`) to connect to your resource endpoint. Ensure you use the appropriate scheme (`ws://` for HTTP, `wss://` for HTTPS).
|
|
22
|
+
1. **Enable WebSocket support**: WebSocket support is enabled automatically when the `rest` plugin is enabled. To explicitly disable it, set the following in your config:
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
```yaml
|
|
25
|
+
rest:
|
|
26
|
+
webSocket: false
|
|
27
|
+
```
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
2. **Connect a client to a resource**: A WebSocket connection to a resource URL automatically subscribes to that resource. When the record changes or a message is published to it, the connection receives the update.
|
|
25
30
|
|
|
26
|
-
```
|
|
27
|
-
|
|
31
|
+
```javascript
|
|
32
|
+
let ws = new WebSocket('wss://server/my-resource/341');
|
|
33
|
+
ws.onmessage = (event) => {
|
|
34
|
+
let data = JSON.parse(event.data);
|
|
35
|
+
};
|
|
36
|
+
```
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
`new WebSocket('wss://server/my-resource/341')` accesses the resource defined for `my-resource` with record id `341` and subscribes to it.
|
|
39
|
+
|
|
40
|
+
3. **Implement a custom `connect()` handler**: Override the `connect(incomingMessages)` method on a resource class to control WebSocket behavior. The method must return an async iterable (or generator) that produces messages to send to the client. See [automatic-apis.md](automatic-apis.md) for more on defining resource classes.
|
|
41
|
+
|
|
42
|
+
4. **Use the default `connect()` for event-style access**: Call `super.connect()` to get a streaming iterable that provides:
|
|
43
|
+
- A `send(message)` method for pushing outgoing messages
|
|
44
|
+
- A `close` event for cleanup on disconnect
|
|
45
|
+
|
|
46
|
+
5. **Handle message ordering in distributed environments**: Harper delivers messages to local subscribers immediately without inter-node coordination delay.
|
|
47
|
+
|
|
48
|
+
| Message Type | Behavior |
|
|
49
|
+
| -------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
50
|
+
| Non-retained (no `retain` flag) | Every message delivered in order received; suitable for chat |
|
|
51
|
+
| Retained (published with `retain`, or PUT/updated in DB) | Only the latest-timestamp message is kept; suitable for sensor readings |
|
|
36
52
|
|
|
37
|
-
|
|
53
|
+
6. **Use MQTT over WebSockets** when needed by setting the sub-protocol header:
|
|
54
|
+
```
|
|
55
|
+
Sec-WebSocket-Protocol: mqtt
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Examples
|
|
59
|
+
|
|
60
|
+
**Simple echo server** — override `connect(incomingMessages)` to yield each incoming message back to the client:
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
export class Echo extends Resource {
|
|
64
|
+
async *connect(incomingMessages) {
|
|
38
65
|
for await (let message of incomingMessages) {
|
|
39
|
-
yield
|
|
66
|
+
yield message; // echo each message back
|
|
40
67
|
}
|
|
41
68
|
}
|
|
42
69
|
}
|
|
43
70
|
```
|
|
71
|
+
|
|
72
|
+
**Custom connect with timer and event-style access** — use `super.connect()` to get the outgoing stream, push periodic messages, echo incoming messages, and clean up on disconnect:
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
export class Example extends Resource {
|
|
76
|
+
connect(incomingMessages) {
|
|
77
|
+
let outgoingMessages = super.connect();
|
|
78
|
+
|
|
79
|
+
let timer = setInterval(() => {
|
|
80
|
+
outgoingMessages.send({ greeting: 'hi again!' });
|
|
81
|
+
}, 1000);
|
|
82
|
+
|
|
83
|
+
incomingMessages.on('data', (message) => {
|
|
84
|
+
outgoingMessages.send(message); // echo incoming messages
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
outgoingMessages.on('close', () => {
|
|
88
|
+
clearInterval(timer);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return outgoingMessages;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Notes
|
|
97
|
+
|
|
98
|
+
- WebSocket connections target a resource URL path. By default, connecting to a resource subscribes to changes for that resource.
|
|
99
|
+
- The `connect(incomingMessages)` method **must** return an async iterable or generator; returning a plain value will not work.
|
|
100
|
+
- `super.connect()` returns a streaming iterable with `send(message)` and a `close` event — use this when you need to push messages outside of the incoming message loop.
|
|
101
|
+
- For one-way real-time streaming without bidirectional communication, consider Server-Sent Events instead.
|
|
102
|
+
- For full pub/sub capabilities, Harper also supports MQTT; set `Sec-WebSocket-Protocol: mqtt` to use MQTT over WebSockets.
|
|
@@ -1,40 +1,56 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vector-indexing
|
|
3
3
|
description: How to enable and query vector indexes for similarity search in Harper.
|
|
4
|
+
metadata:
|
|
5
|
+
mode: generate
|
|
6
|
+
sources:
|
|
7
|
+
- reference/v5/database/schema.md#Vector Indexing
|
|
8
|
+
sourceCommit: b7fbddadd42eb4487190b650a9abc4bcfeef5819
|
|
9
|
+
inputHash: 3732961c671aac00
|
|
4
10
|
---
|
|
5
11
|
|
|
6
12
|
# Vector Indexing
|
|
7
13
|
|
|
8
|
-
Instructions for the agent to follow when
|
|
14
|
+
Instructions for the agent to follow when enabling and querying vector indexes for similarity search in Harper using the HNSW algorithm.
|
|
9
15
|
|
|
10
16
|
## When to Use
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
Apply this rule when adding a vector index to a Harper table schema or writing similarity search queries against high-dimensional vector fields. Use it whenever you need approximate nearest-neighbor search, distance-threshold filtering, or distance-scored results.
|
|
13
19
|
|
|
14
20
|
## How It Works
|
|
15
21
|
|
|
16
|
-
1. **
|
|
22
|
+
1. **Declare the vector index on a `[Float]` field**: Add `@indexed(type: "HNSW")` to any `[Float]` attribute in a `@table` type. See [adding-tables-with-schemas.md](adding-tables-with-schemas.md) for general schema setup.
|
|
23
|
+
|
|
17
24
|
```graphql
|
|
18
|
-
type
|
|
19
|
-
id:
|
|
25
|
+
type Document @table {
|
|
26
|
+
id: Long @primaryKey
|
|
20
27
|
textEmbeddings: [Float] @indexed(type: "HNSW")
|
|
21
28
|
}
|
|
22
29
|
```
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
|
|
31
|
+
2. **Query by nearest neighbors using `sort`**: Call `Document.search()` with a `sort` object containing `attribute` (the indexed field name) and `target` (the query vector). Include `limit` to cap results.
|
|
32
|
+
|
|
25
33
|
```javascript
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
attribute: 'textEmbeddings',
|
|
30
|
-
target: [0.1, 0.2, ...], // query vector
|
|
31
|
-
},
|
|
32
|
-
limit: 5,
|
|
34
|
+
let results = Document.search({
|
|
35
|
+
sort: { attribute: 'textEmbeddings', target: searchVector },
|
|
36
|
+
limit: 5,
|
|
33
37
|
});
|
|
34
38
|
```
|
|
35
|
-
|
|
39
|
+
|
|
40
|
+
3. **Combine with filter conditions**: Add a `conditions` array alongside `sort` to pre-filter records before ranking by similarity.
|
|
41
|
+
|
|
36
42
|
```javascript
|
|
37
|
-
|
|
43
|
+
let results = Document.search({
|
|
44
|
+
conditions: [{ attribute: 'price', comparator: 'lt', value: 50 }],
|
|
45
|
+
sort: { attribute: 'textEmbeddings', target: searchVector },
|
|
46
|
+
limit: 5,
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
4. **Filter by distance threshold**: To return only records within a similarity cutoff (without ranking), place `target` directly on the condition alongside `comparator` and `value`. Omit `sort`.
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
let results = Document.search({
|
|
38
54
|
conditions: {
|
|
39
55
|
attribute: 'textEmbeddings',
|
|
40
56
|
comparator: 'lt',
|
|
@@ -43,117 +59,66 @@ Use this skill when you need to perform similarity searches on high-dimensional
|
|
|
43
59
|
},
|
|
44
60
|
});
|
|
45
61
|
```
|
|
46
|
-
5. **Generate Embeddings**: Use external services (OpenAI, Ollama) to generate the numeric vectors before storing or searching them in Harper.
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
import OpenAI from 'openai';
|
|
50
|
-
import ollama from 'ollama';
|
|
51
|
-
|
|
52
|
-
const { Product } = tables;
|
|
53
|
-
const openai = new OpenAI();
|
|
54
|
-
// the name of the OpenAI embedding model
|
|
55
|
-
const OPENAI_EMBEDDING_MODEL = 'text-embedding-3-small';
|
|
56
|
-
|
|
57
|
-
// the name of the Ollama embedding model
|
|
58
|
-
const OLLAMA_EMBEDDING_MODEL = 'llama3';
|
|
59
|
-
|
|
60
|
-
const SIMILARITY_THRESHOLD = 0.5;
|
|
61
|
-
|
|
62
|
-
export class ProductSearch extends Resource {
|
|
63
|
-
// based on env variable we choose the appropriate embedding generator
|
|
64
|
-
generateEmbedding =
|
|
65
|
-
process.env.EMBEDDING_GENERATOR === 'ollama'
|
|
66
|
-
? this._generateOllamaEmbedding
|
|
67
|
-
: this._generateOpenAIEmbedding;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Executes a search query using a generated text embedding and returns the matching products.
|
|
71
|
-
*
|
|
72
|
-
* @param {Object} data - The input data for the request.
|
|
73
|
-
* @param {string} data.prompt - The prompt to generate the text embedding from.
|
|
74
|
-
* @return {Promise<Array>} Returns a promise that resolves to an array of products matching the conditions,
|
|
75
|
-
* including fields: name, description, price, and $distance.
|
|
76
|
-
*/
|
|
77
|
-
async post(data) {
|
|
78
|
-
const embedding = await this.generateEmbedding(data.prompt);
|
|
79
|
-
|
|
80
|
-
return await Product.search({
|
|
81
|
-
select: ['name', 'description', 'price', '$distance'],
|
|
82
|
-
conditions: {
|
|
83
|
-
attribute: 'textEmbeddings',
|
|
84
|
-
comparator: 'lt',
|
|
85
|
-
value: SIMILARITY_THRESHOLD,
|
|
86
|
-
target: embedding[0],
|
|
87
|
-
},
|
|
88
|
-
limit: 5,
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Generates an embedding using the Ollama API.
|
|
94
|
-
*
|
|
95
|
-
* @param {string} promptData - The input data for which the embedding is to be generated.
|
|
96
|
-
* @return {Promise<number[][]>} A promise that resolves to the generated embedding as an array of numbers.
|
|
97
|
-
*/
|
|
98
|
-
async _generateOllamaEmbedding(promptData) {
|
|
99
|
-
const embedding = await ollama.embed({
|
|
100
|
-
model: OLLAMA_EMBEDDING_MODEL,
|
|
101
|
-
input: promptData,
|
|
102
|
-
});
|
|
103
|
-
return embedding?.embeddings;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Generates OpenAI embeddings based on the given prompt data.
|
|
108
|
-
*
|
|
109
|
-
* @param {string} promptData - The input data used for generating the embedding.
|
|
110
|
-
* @return {Promise<number[][]>} A promise that resolves to an array of embeddings, where each embedding is an array of floats.
|
|
111
|
-
*/
|
|
112
|
-
async _generateOpenAIEmbedding(promptData) {
|
|
113
|
-
const embedding = await openai.embeddings.create({
|
|
114
|
-
model: OPENAI_EMBEDDING_MODEL,
|
|
115
|
-
input: promptData,
|
|
116
|
-
encoding_format: 'float',
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
let embeddings = [];
|
|
120
|
-
embedding.data.forEach((embeddingData) => {
|
|
121
|
-
embeddings.push(embeddingData.embedding);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
return embeddings;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
62
|
|
|
129
|
-
|
|
63
|
+
5. **Include computed distance in results**: Use the special `$distance` field in `select` to return the distance from the target vector. Works with both `sort`-based and `conditions`-based queries.
|
|
130
64
|
|
|
131
|
-
|
|
65
|
+
```javascript
|
|
66
|
+
let results = Document.search({
|
|
67
|
+
select: ['name', '$distance'],
|
|
68
|
+
sort: { attribute: 'textEmbeddings', target: searchVector },
|
|
69
|
+
limit: 5,
|
|
70
|
+
});
|
|
71
|
+
```
|
|
132
72
|
|
|
133
|
-
|
|
134
|
-
curl -X POST "http://localhost:9926/ProductSearch/" \
|
|
135
|
-
-H "Accept: application/json" \
|
|
136
|
-
-H "Content-Type: application/json" \
|
|
137
|
-
-H "Authorization: Basic <YOUR_AUTH>" \
|
|
138
|
-
-d '{"prompt": "shorts for the gym"}'
|
|
139
|
-
```
|
|
73
|
+
6. **Tune HNSW parameters**: Pass additional parameters to `@indexed(type: "HNSW", ...)` to control index quality and performance.
|
|
140
74
|
|
|
141
|
-
|
|
75
|
+
| Parameter | Default | Description |
|
|
76
|
+
| ---------------------- | ----------------- | --------------------------------------------------------------------------------------------------- |
|
|
77
|
+
| `distance` | `"cosine"` | Distance function: `"euclidean"` or `"cosine"` (negative cosine similarity) |
|
|
78
|
+
| `efConstruction` | `100` | Max nodes explored during index construction. Higher = better recall, lower = better performance |
|
|
79
|
+
| `M` | `16` | Preferred connections per graph layer. Higher = more space, better recall for high-dimensional data |
|
|
80
|
+
| `optimizeRouting` | `0.5` | Heuristic aggressiveness for omitting redundant connections (0 = off, 1 = most aggressive) |
|
|
81
|
+
| `mL` | computed from `M` | Normalization factor for level generation |
|
|
82
|
+
| `efSearchConstruction` | `50` | Max nodes explored during search |
|
|
142
83
|
|
|
143
|
-
##
|
|
84
|
+
## Examples
|
|
144
85
|
|
|
145
|
-
|
|
86
|
+
**Schema with custom HNSW parameters:**
|
|
146
87
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
88
|
+
```graphql
|
|
89
|
+
type Document @table {
|
|
90
|
+
id: Long @primaryKey
|
|
91
|
+
textEmbeddings: [Float]
|
|
92
|
+
@indexed(type: "HNSW", distance: "euclidean", optimizeRouting: 0, efSearchConstruction: 100)
|
|
93
|
+
}
|
|
94
|
+
```
|
|
151
95
|
|
|
152
|
-
|
|
96
|
+
**Nearest-neighbor search with distance score:**
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
let results = Document.search({
|
|
100
|
+
select: ['name', '$distance'],
|
|
101
|
+
sort: { attribute: 'textEmbeddings', target: searchVector },
|
|
102
|
+
limit: 5,
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Distance-threshold filter (no ranking):**
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
let results = Document.search({
|
|
110
|
+
conditions: {
|
|
111
|
+
attribute: 'textEmbeddings',
|
|
112
|
+
comparator: 'lt',
|
|
113
|
+
value: 0.1,
|
|
114
|
+
target: searchVector,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
```
|
|
153
118
|
|
|
154
|
-
##
|
|
119
|
+
## Notes
|
|
155
120
|
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
121
|
+
- The default `distance` function is `cosine`. Pass `distance: "euclidean"` to switch.
|
|
122
|
+
- `efConstruction` controls index build quality; raising it improves recall at the cost of build time.
|
|
123
|
+
- `$distance` is available in both `sort`-based ranking and `conditions`-based threshold queries.
|
|
124
|
+
- Use the threshold (`conditions` + `target`) form when you want to bound result quality by a similarity cutoff rather than ranking by similarity.
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Rules manifest for the harper-best-practices skill.
|
|
2
|
+
#
|
|
3
|
+
# Declarative source of truth for rule taxonomy, sources, and generation mode.
|
|
4
|
+
# Owned by humans; the generator reads this file and writes derived artifacts
|
|
5
|
+
# (rule bodies, AGENTS.md). See docs/plans/docs-driven-skills.md for the
|
|
6
|
+
# full schema definition and Manifest ↔ frontmatter reconciliation semantics.
|
|
7
|
+
#
|
|
8
|
+
# Phase 2 flipped vector-indexing to mode: generate.
|
|
9
|
+
# Phase 3 flips 7 obvious 1:1 rules to mode: generate (automatic-apis,
|
|
10
|
+
# querying-rest-apis, real-time-apps, checking-authentication, logging,
|
|
11
|
+
# deploying-to-harper-fabric, caching). All others remain synthesized.
|
|
12
|
+
|
|
13
|
+
rules:
|
|
14
|
+
# ===========================================================================
|
|
15
|
+
# Schema & Data Design (priority 1 — HIGH)
|
|
16
|
+
# ===========================================================================
|
|
17
|
+
|
|
18
|
+
- rule: adding-tables-with-schemas
|
|
19
|
+
description: Guidelines for adding tables to a Harper database using GraphQL schemas.
|
|
20
|
+
category: schema
|
|
21
|
+
priority: 1
|
|
22
|
+
order: 1
|
|
23
|
+
mode: synthesized
|
|
24
|
+
|
|
25
|
+
- rule: schema-design-tooling
|
|
26
|
+
description: Best practices for Harper schema design, including core directives and GraphQL tooling configuration.
|
|
27
|
+
category: schema
|
|
28
|
+
priority: 1
|
|
29
|
+
order: 2
|
|
30
|
+
mode: synthesized
|
|
31
|
+
|
|
32
|
+
- rule: defining-relationships
|
|
33
|
+
description: How to define and use relationships between tables in Harper using GraphQL.
|
|
34
|
+
category: schema
|
|
35
|
+
priority: 1
|
|
36
|
+
order: 3
|
|
37
|
+
mode: synthesized
|
|
38
|
+
|
|
39
|
+
- rule: vector-indexing
|
|
40
|
+
description: How to enable and query vector indexes for similarity search in Harper.
|
|
41
|
+
category: schema
|
|
42
|
+
priority: 1
|
|
43
|
+
order: 4
|
|
44
|
+
mode: generate
|
|
45
|
+
sources:
|
|
46
|
+
- path: reference/v5/database/schema.md
|
|
47
|
+
section: 'Vector Indexing'
|
|
48
|
+
role: primary
|
|
49
|
+
must_cover:
|
|
50
|
+
- '@indexed(type: "HNSW")'
|
|
51
|
+
- 'sort'
|
|
52
|
+
- 'target'
|
|
53
|
+
- 'cosine'
|
|
54
|
+
- 'efConstruction'
|
|
55
|
+
cross_links:
|
|
56
|
+
- adding-tables-with-schemas
|
|
57
|
+
|
|
58
|
+
- rule: using-blob-datatype
|
|
59
|
+
description: How to use the Blob data type for efficient binary storage in Harper.
|
|
60
|
+
category: schema
|
|
61
|
+
priority: 1
|
|
62
|
+
order: 5
|
|
63
|
+
mode: synthesized
|
|
64
|
+
|
|
65
|
+
- rule: handling-binary-data
|
|
66
|
+
description: How to store and serve binary data like images or audio in Harper.
|
|
67
|
+
category: schema
|
|
68
|
+
priority: 1
|
|
69
|
+
order: 6
|
|
70
|
+
mode: synthesized
|
|
71
|
+
|
|
72
|
+
# ===========================================================================
|
|
73
|
+
# API & Communication (priority 2 — HIGH)
|
|
74
|
+
# ===========================================================================
|
|
75
|
+
|
|
76
|
+
- rule: automatic-apis
|
|
77
|
+
description: How to use Harper's automatically generated REST and WebSocket APIs.
|
|
78
|
+
category: api
|
|
79
|
+
priority: 2
|
|
80
|
+
order: 1
|
|
81
|
+
mode: generate
|
|
82
|
+
sources:
|
|
83
|
+
- path: reference/v5/rest/overview.md
|
|
84
|
+
role: primary
|
|
85
|
+
- path: reference/v5/rest/websockets.md
|
|
86
|
+
role: supplemental
|
|
87
|
+
must_cover:
|
|
88
|
+
- 'rest: true'
|
|
89
|
+
- '@export'
|
|
90
|
+
- 'WebSocket'
|
|
91
|
+
cross_links:
|
|
92
|
+
- querying-rest-apis
|
|
93
|
+
- real-time-apps
|
|
94
|
+
|
|
95
|
+
- rule: querying-rest-apis
|
|
96
|
+
description: How to use query parameters to filter, sort, and paginate Harper REST APIs.
|
|
97
|
+
category: api
|
|
98
|
+
priority: 2
|
|
99
|
+
order: 2
|
|
100
|
+
mode: generate
|
|
101
|
+
sources:
|
|
102
|
+
- path: reference/v5/rest/querying.md
|
|
103
|
+
role: primary
|
|
104
|
+
must_cover:
|
|
105
|
+
- '=gt='
|
|
106
|
+
- '=lt='
|
|
107
|
+
- 'select('
|
|
108
|
+
- 'sort('
|
|
109
|
+
- 'limit('
|
|
110
|
+
cross_links:
|
|
111
|
+
- automatic-apis
|
|
112
|
+
|
|
113
|
+
- rule: real-time-apps
|
|
114
|
+
description: How to build real-time features in Harper using WebSockets and Pub/Sub.
|
|
115
|
+
category: api
|
|
116
|
+
priority: 2
|
|
117
|
+
order: 3
|
|
118
|
+
mode: generate
|
|
119
|
+
sources:
|
|
120
|
+
- path: reference/v5/rest/websockets.md
|
|
121
|
+
role: primary
|
|
122
|
+
must_cover:
|
|
123
|
+
- 'WebSocket'
|
|
124
|
+
- 'connect('
|
|
125
|
+
cross_links:
|
|
126
|
+
- automatic-apis
|
|
127
|
+
|
|
128
|
+
- rule: checking-authentication
|
|
129
|
+
description: How to handle user authentication and sessions in Harper Resources.
|
|
130
|
+
category: api
|
|
131
|
+
priority: 2
|
|
132
|
+
order: 4
|
|
133
|
+
mode: generate
|
|
134
|
+
sources:
|
|
135
|
+
- path: reference/v5/resources/resource-api.md
|
|
136
|
+
section: '`getCurrentUser(): User | undefined`'
|
|
137
|
+
role: primary
|
|
138
|
+
- path: reference/v5/resources/resource-api.md
|
|
139
|
+
section: 'Session and Login from a Resource'
|
|
140
|
+
role: primary
|
|
141
|
+
- path: reference/v5/security/jwt-authentication.md
|
|
142
|
+
role: supplemental
|
|
143
|
+
must_cover:
|
|
144
|
+
- 'getCurrentUser()'
|
|
145
|
+
- 'getContext()'
|
|
146
|
+
- 'context.login'
|
|
147
|
+
- 'enableSessions'
|
|
148
|
+
cross_links:
|
|
149
|
+
- custom-resources
|
|
150
|
+
|
|
151
|
+
# ===========================================================================
|
|
152
|
+
# Logic & Extension (priority 3 — MEDIUM)
|
|
153
|
+
# ===========================================================================
|
|
154
|
+
|
|
155
|
+
- rule: custom-resources
|
|
156
|
+
description: How to define custom REST endpoints with JavaScript or TypeScript in Harper.
|
|
157
|
+
category: logic
|
|
158
|
+
priority: 3
|
|
159
|
+
order: 1
|
|
160
|
+
mode: synthesized
|
|
161
|
+
|
|
162
|
+
- rule: extending-tables
|
|
163
|
+
description: How to add custom logic to automatically generated table resources in Harper.
|
|
164
|
+
category: logic
|
|
165
|
+
priority: 3
|
|
166
|
+
order: 2
|
|
167
|
+
mode: synthesized
|
|
168
|
+
|
|
169
|
+
- rule: programmatic-table-requests
|
|
170
|
+
description: How to interact with Harper tables programmatically using the `tables` object.
|
|
171
|
+
category: logic
|
|
172
|
+
priority: 3
|
|
173
|
+
order: 3
|
|
174
|
+
mode: synthesized
|
|
175
|
+
|
|
176
|
+
- rule: typescript-type-stripping
|
|
177
|
+
description: How to run TypeScript files directly in Harper without a build step.
|
|
178
|
+
category: logic
|
|
179
|
+
priority: 3
|
|
180
|
+
order: 4
|
|
181
|
+
mode: synthesized
|
|
182
|
+
|
|
183
|
+
- rule: caching
|
|
184
|
+
description: How to implement integrated data caching in Harper from external sources.
|
|
185
|
+
category: logic
|
|
186
|
+
priority: 3
|
|
187
|
+
order: 5
|
|
188
|
+
mode: generate
|
|
189
|
+
sources:
|
|
190
|
+
- path: learn/developers/caching-with-harper.md
|
|
191
|
+
role: primary
|
|
192
|
+
must_cover:
|
|
193
|
+
- 'expiration'
|
|
194
|
+
- 'sourcedFrom'
|
|
195
|
+
- '@table'
|
|
196
|
+
cross_links:
|
|
197
|
+
- custom-resources
|
|
198
|
+
- automatic-apis
|
|
199
|
+
|
|
200
|
+
# ===========================================================================
|
|
201
|
+
# Infrastructure & Ops (priority 4 — MEDIUM)
|
|
202
|
+
# ===========================================================================
|
|
203
|
+
|
|
204
|
+
- rule: deploying-to-harper-fabric
|
|
205
|
+
description: How to deploy a Harper application to the Harper Fabric cloud.
|
|
206
|
+
category: ops
|
|
207
|
+
priority: 4
|
|
208
|
+
order: 1
|
|
209
|
+
mode: generate
|
|
210
|
+
sources:
|
|
211
|
+
- path: reference/v5/components/applications.md
|
|
212
|
+
section: 'Remote Management'
|
|
213
|
+
role: primary
|
|
214
|
+
- path: fabric/cluster-creation-management.md
|
|
215
|
+
section: 'Connecting the Harper CLI to a Cluster'
|
|
216
|
+
role: supplemental
|
|
217
|
+
must_cover:
|
|
218
|
+
- 'harper deploy'
|
|
219
|
+
- 'harper login'
|
|
220
|
+
cross_links:
|
|
221
|
+
- creating-a-fabric-account-and-cluster
|
|
222
|
+
|
|
223
|
+
- rule: creating-a-fabric-account-and-cluster
|
|
224
|
+
description: How to create a Harper Fabric account, organization, and cluster.
|
|
225
|
+
category: ops
|
|
226
|
+
priority: 4
|
|
227
|
+
order: 2
|
|
228
|
+
mode: synthesized
|
|
229
|
+
|
|
230
|
+
- rule: creating-harper-apps
|
|
231
|
+
description: How to initialize a new Harper application using the CLI.
|
|
232
|
+
category: ops
|
|
233
|
+
priority: 4
|
|
234
|
+
order: 3
|
|
235
|
+
mode: synthesized
|
|
236
|
+
|
|
237
|
+
- rule: serving-web-content
|
|
238
|
+
description: How to serve static files and integrated Vite/React applications in Harper.
|
|
239
|
+
category: ops
|
|
240
|
+
priority: 4
|
|
241
|
+
order: 4
|
|
242
|
+
mode: synthesized
|
|
243
|
+
|
|
244
|
+
- rule: logging
|
|
245
|
+
description: Best practices for logging in Harper, including console capture, the granular logger interface, and programmatic log retrieval.
|
|
246
|
+
category: ops
|
|
247
|
+
priority: 4
|
|
248
|
+
order: 5
|
|
249
|
+
mode: generate
|
|
250
|
+
sources:
|
|
251
|
+
- path: reference/v5/logging/overview.md
|
|
252
|
+
role: primary
|
|
253
|
+
- path: reference/v5/logging/api.md
|
|
254
|
+
role: primary
|
|
255
|
+
must_cover:
|
|
256
|
+
- 'console.log'
|
|
257
|
+
- 'logger'
|
|
258
|
+
- 'withTag('
|