@stacksjs/defaults 0.75.542 → 0.75.544
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/ai/skills/stacks-ai/SKILL.md +7 -1
- package/ai/skills/stacks-deploy/SKILL.md +7 -0
- package/ai/skills/stacks-native/CATALOG.md +3 -3
- package/ai/skills/stacks-repl/SKILL.md +25 -0
- package/app/Actions/AI/CompleteAction.ts +1 -1
- package/app/Actions/AI/complete-request.ts +1 -1
- package/ide/vscode/package.json +1 -1
- package/package.json +3 -3
|
@@ -357,7 +357,7 @@ import { complete, completeStream } from '@stacksjs/ai'
|
|
|
357
357
|
const { completion } = await complete({
|
|
358
358
|
before: 'Remember to buy milk, eggs and ', // the last 2000 chars are sent
|
|
359
359
|
after: '', // the first 500 chars are sent
|
|
360
|
-
kind: 'todo', // 'note' | 'prompt' | 'todo' | 'text'
|
|
360
|
+
kind: 'todo', // 'note' | 'prompt' | 'todo' | 'text' | 'code'
|
|
361
361
|
context: 'Groceries', // note title, library description
|
|
362
362
|
maxTokens: 48, // default 48
|
|
363
363
|
signal: controller.signal, // abort: rejects with an AbortError
|
|
@@ -376,6 +376,12 @@ for await (const { completion } of completeStream({ before })) paint(completion)
|
|
|
376
376
|
OpenAI and Ollama it is the driver's configured model. Bedrock Claude needs the
|
|
377
377
|
account's Anthropic use-case form submitted, otherwise list a Nova model in
|
|
378
378
|
`ai.models` (or set `ai.completion.model`) and completions use that.
|
|
379
|
+
- `kind: 'code'` is its own mode, not a wording change. The instruction is for
|
|
380
|
+
code (continue the statement, close only what the code after the cursor does
|
|
381
|
+
not, use no name that is not in the code or the context), the budget is 128
|
|
382
|
+
tokens, and the cleanup keeps what prose cleanup removes: quotes, full stops,
|
|
383
|
+
a leading newline with its indentation, and up to twelve lines. Pass what the
|
|
384
|
+
model cannot see as `context`, such as model and column names.
|
|
379
385
|
- A small LRU keyed on the tail of `before` (plus kind, model and the head of
|
|
380
386
|
`after`) makes retyping free; `completionCache.clear()` empties it.
|
|
381
387
|
- Requests carry `maxRetries: 0` and the abort `signal` reaches the HTTP drivers
|
|
@@ -209,8 +209,15 @@ buddy cloud --diff # preview infrastructure changes before deploying
|
|
|
209
209
|
buddy cloud --ssh # SSH into deployed server
|
|
210
210
|
buddy cloud:remove # tear down infrastructure (alias: undeploy)
|
|
211
211
|
buddy cloud:cleanup # clean retained resources
|
|
212
|
+
buddy cloud:targets --json # each deployed site: host, SSH user and key, app path, env file
|
|
212
213
|
```
|
|
213
214
|
|
|
215
|
+
`cloud:targets` is read-only and answers "where does this app run, and how do I
|
|
216
|
+
get a shell in it?" from the stack's pinned state plus at most one provider
|
|
217
|
+
listing (`--no-remote` skips the listing). It is what a tool that opens a
|
|
218
|
+
session in a deployed app starts from, instead of asking for a host and a path.
|
|
219
|
+
It needs `@stacksjs/ts-cloud` 0.16.126 or newer and says so on an older one.
|
|
220
|
+
|
|
214
221
|
## Gotchas
|
|
215
222
|
- The API reachability guard recognises `serve:api`, source `serve/api.js`
|
|
216
223
|
entrypoints and compiled `storage/framework/runtime/production/api.js`
|
|
@@ -90,7 +90,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
|
|
|
90
90
|
| `@stacksjs/storage` | [`stacks-storage`](../stacks-storage/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/index.ts) | 50 |
|
|
91
91
|
| `@stacksjs/strings` | [`stacks-strings`](../stacks-strings/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/strings/src/index.ts) | 12 |
|
|
92
92
|
| `@stacksjs/testing` | [`stacks-testing`](../stacks-testing/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/index.ts) | 24 |
|
|
93
|
-
| `@stacksjs/tinker` | [`stacks-repl`](../stacks-repl/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/index.ts) |
|
|
93
|
+
| `@stacksjs/tinker` | [`stacks-repl`](../stacks-repl/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/index.ts) | 3 |
|
|
94
94
|
| `@stacksjs/tunnel` | [`stacks-tunnel`](../stacks-tunnel/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tunnel/src/index.ts) | 1 |
|
|
95
95
|
| `@stacksjs/types` | [`stacks-types`](../stacks-types/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/types/src/index.ts) | 2 |
|
|
96
96
|
| `@stacksjs/ui` | [`stacks-ui`](../stacks-ui/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ui/src/index.ts) | 6 |
|
|
@@ -882,9 +882,9 @@ Guidance: [`stacks-repl`](../stacks-repl/SKILL.md). Source: [storage/framework/c
|
|
|
882
882
|
|
|
883
883
|
Declared runtime exports: `appendHistory`, `clearHistory`, `getHistoryPath`, `isIncompleteSnippet`, `readHistory`, `renderValue`, `startTinker`, `tinkerEval`, `tinkerPrint`.
|
|
884
884
|
|
|
885
|
-
Local source modules: [src/protocol.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/protocol.ts), [src/serialize.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/serialize.ts), [src/session.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/session.ts).
|
|
885
|
+
Local source modules: [src/magic.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/magic.ts), [src/protocol.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/protocol.ts), [src/serialize.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/serialize.ts), [src/session.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/session.ts).
|
|
886
886
|
|
|
887
|
-
Evidence directory: [
|
|
887
|
+
Evidence directory: [3 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
|
|
888
888
|
|
|
889
889
|
### @stacksjs/tunnel
|
|
890
890
|
|
|
@@ -101,6 +101,31 @@ not a frame. Use `createFrameReader()` to split a stream. `--serve` with
|
|
|
101
101
|
`--eval` or `--print` evaluates once and exits, which suits `ssh -T`,
|
|
102
102
|
`docker exec -i` and `kubectl exec -i`.
|
|
103
103
|
|
|
104
|
+
## Magic comments
|
|
105
|
+
|
|
106
|
+
A comment that starts with a question mark shows a value where it is computed.
|
|
107
|
+
The run's result is unchanged, and no line moves.
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
const users = await User.all() //? the value of users
|
|
111
|
+
users.filter(u => u.active)/*?.length*/.map(u => u.name) //?
|
|
112
|
+
await rebuildIndex() //?. ms since the run began
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
- `//?` at the end of a line: the statement that ends there. A declaration
|
|
116
|
+
shows the names it binds; anything else shows the expression.
|
|
117
|
+
- A block form written hard against an expression (no space before it) shows
|
|
118
|
+
that expression mid-chain. Text after the question mark is read off the
|
|
119
|
+
value first: `.length`, `.count()`, `[0]`.
|
|
120
|
+
- `//?.` shows elapsed milliseconds.
|
|
121
|
+
|
|
122
|
+
Each one arrives as a `probe` frame carrying its zero-based line.
|
|
123
|
+
`instrumentMagicComments(code)` is the transform, exported for a tool that
|
|
124
|
+
wants to mark which lines have a probe. It works from tokens, not a syntax
|
|
125
|
+
tree: a comment it cannot place with certainty (after an `if` block, a loop, a
|
|
126
|
+
`throw`) stays an ordinary comment. `createTinkerSession({ magic: false })`
|
|
127
|
+
turns the feature off.
|
|
128
|
+
|
|
104
129
|
## Previews and the model list
|
|
105
130
|
|
|
106
131
|
`preview.mail('welcome', { name: 'Ada' })` renders a template from
|
|
@@ -12,7 +12,7 @@ import { COMPLETE_RATE_PER_MINUTE, handleCompleteRequest } from './complete-requ
|
|
|
12
12
|
/**
|
|
13
13
|
* `POST /ai/complete`: the ghost text behind an editor's Tab-to-accept.
|
|
14
14
|
*
|
|
15
|
-
* Body `{ before, after?, kind?: 'note' | 'prompt' | 'todo' | 'text', context? }`,
|
|
15
|
+
* Body `{ before, after?, kind?: 'note' | 'prompt' | 'todo' | 'text' | 'code', context? }`,
|
|
16
16
|
* answer `{ completion }`. `''` means "no suggestion", including when the app
|
|
17
17
|
* has no AI driver configured; a provider failure is a 502.
|
|
18
18
|
*
|
|
@@ -17,7 +17,7 @@ export const COMPLETE_MAX_CONTEXT = 2_000
|
|
|
17
17
|
/** Suggestions per user per minute. The client debounces; this is the backstop. */
|
|
18
18
|
export const COMPLETE_RATE_PER_MINUTE = 90
|
|
19
19
|
|
|
20
|
-
const KINDS: readonly CompletionKind[] = ['note', 'prompt', 'todo', 'text']
|
|
20
|
+
const KINDS: readonly CompletionKind[] = ['note', 'prompt', 'todo', 'text', 'code']
|
|
21
21
|
|
|
22
22
|
export interface CompleteRequestBody {
|
|
23
23
|
before?: unknown
|
package/ide/vscode/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"publisher": "Stacks",
|
|
3
3
|
"name": "vscode-stacks",
|
|
4
4
|
"displayName": "Stacks",
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.544",
|
|
6
6
|
"description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/defaults",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.544",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@iconify-json/f7": "^1.2.2",
|
|
47
47
|
"@iconify-json/hugeicons": "^1.2.35",
|
|
48
|
-
"@stacksjs/mobile": "0.75.
|
|
48
|
+
"@stacksjs/mobile": "0.75.544",
|
|
49
49
|
"@stacksjs/sanitizer": "^0.2.842",
|
|
50
50
|
"@stacksjs/stx": "^0.2.842",
|
|
51
|
-
"@stacksjs/strings": "0.75.
|
|
51
|
+
"@stacksjs/strings": "0.75.544",
|
|
52
52
|
"@xterm/addon-fit": "^0.11.0",
|
|
53
53
|
"@xterm/xterm": "^6.0.0",
|
|
54
54
|
"ts-qr-codes": "^0.1.8"
|