@positronic/template-new-project 0.0.72 → 0.0.74
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/index.js
CHANGED
|
@@ -53,10 +53,10 @@ module.exports = {
|
|
|
53
53
|
],
|
|
54
54
|
setup: async ctx => {
|
|
55
55
|
const devRootPath = process.env.POSITRONIC_LOCAL_PATH;
|
|
56
|
-
let coreVersion = '^0.0.
|
|
57
|
-
let cloudflareVersion = '^0.0.
|
|
58
|
-
let clientVercelVersion = '^0.0.
|
|
59
|
-
let genUIComponentsVersion = '^0.0.
|
|
56
|
+
let coreVersion = '^0.0.74';
|
|
57
|
+
let cloudflareVersion = '^0.0.74';
|
|
58
|
+
let clientVercelVersion = '^0.0.74';
|
|
59
|
+
let genUIComponentsVersion = '^0.0.74';
|
|
60
60
|
|
|
61
61
|
// Map backend selection to package names
|
|
62
62
|
const backendPackageMap = {
|
package/package.json
CHANGED
package/template/CLAUDE.md
CHANGED
|
@@ -126,7 +126,7 @@ The optional `timeout` parameter accepts durations like `'30m'`, `'1h'`, `'24h'`
|
|
|
126
126
|
If your brain generates a custom HTML page with a form that submits to a webhook, you must include a CSRF token. Without a token, the server will reject the submission.
|
|
127
127
|
|
|
128
128
|
1. Generate a token with `generateFormToken()` from `@positronic/core`
|
|
129
|
-
2. Add `<input type="hidden" name="__positronic_token" value="${token}">` to the form
|
|
129
|
+
2. Add `<input type="hidden" name="__positronic_token" value="<%= '${token}' %>">` to the form
|
|
130
130
|
3. Pass the token when creating the webhook registration: `myWebhook(identifier, token)`
|
|
131
131
|
|
|
132
132
|
The `.ui()` step handles this automatically. See `/docs/brain-dsl-guide.md` for full examples.
|
package/template/brain.ts
CHANGED
|
@@ -81,7 +81,7 @@ import { components } from './components/index.js';
|
|
|
81
81
|
* const memoryTools = createMem0Tools();
|
|
82
82
|
* ```
|
|
83
83
|
*
|
|
84
|
-
* Memory is automatically scoped to the current user (via currentUser.
|
|
84
|
+
* Memory is automatically scoped to the current user (via currentUser.name)
|
|
85
85
|
* and the brain name. No need to pass userId manually.
|
|
86
86
|
*
|
|
87
87
|
* See docs/memory-guide.md for full details.
|
|
@@ -277,7 +277,7 @@ brain('sales-agent').withMemory(memory) // agentId = 'sales-agent'
|
|
|
277
277
|
|
|
278
278
|
### userId
|
|
279
279
|
|
|
280
|
-
Automatically set from `currentUser.
|
|
280
|
+
Automatically set from `currentUser.name` when the brain runs. All memory operations are automatically scoped to the current user — no need to pass userId manually:
|
|
281
281
|
|
|
282
282
|
```typescript
|
|
283
283
|
// userId is auto-bound from currentUser — just use memory directly
|
|
@@ -234,7 +234,7 @@ const api = {
|
|
|
234
234
|
|
|
235
235
|
## currentUser
|
|
236
236
|
|
|
237
|
-
Every brain run requires a `currentUser` — an object with at least
|
|
237
|
+
Every brain run requires a `currentUser` — an object with at least a `name` field that identifies who is running the brain. This identity is used to scope per-user data like memory and store fields.
|
|
238
238
|
|
|
239
239
|
### How currentUser Gets Set
|
|
240
240
|
|
|
@@ -251,7 +251,7 @@ import { runner } from './runner.js';
|
|
|
251
251
|
import myBrain from './brains/my-brain.js';
|
|
252
252
|
|
|
253
253
|
await runner.run(myBrain, {
|
|
254
|
-
currentUser: {
|
|
254
|
+
currentUser: { name: 'local-dev-user' },
|
|
255
255
|
});
|
|
256
256
|
```
|
|
257
257
|
|
|
@@ -261,7 +261,7 @@ await runner.run(myBrain, {
|
|
|
261
261
|
const events = await collectEvents(
|
|
262
262
|
testBrain.run({
|
|
263
263
|
client: mockClient,
|
|
264
|
-
currentUser: {
|
|
264
|
+
currentUser: { name: 'test-user' },
|
|
265
265
|
})
|
|
266
266
|
);
|
|
267
267
|
```
|
|
@@ -278,7 +278,7 @@ const events = await collectEvents(
|
|
|
278
278
|
```typescript
|
|
279
279
|
export default brain('greet')
|
|
280
280
|
.step('Hello', ({ currentUser }) => ({
|
|
281
|
-
greeting: 'Hello, user ' + currentUser.
|
|
281
|
+
greeting: 'Hello, user ' + currentUser.name,
|
|
282
282
|
}));
|
|
283
283
|
```
|
|
284
284
|
|