mastra 1.20.0-alpha.16 → 1.20.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/CHANGELOG.md +171 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/factory/assets/{core-Bh8AwAMZ.js → core-DO1SkHBf.js} +1 -1
- package/dist/factory/assets/{engine-compile-CoFXxfZy.js → engine-compile-DyPuh63K.js} +1 -1
- package/dist/factory/assets/{engine-javascript-B7QzNvkG.js → engine-javascript-BjMFzhB3.js} +1 -1
- package/dist/factory/assets/{index-1R_kuRX2.js → index-a18ZK3TF.js} +183 -183
- package/dist/factory/index.html +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/studio/assets/{core-yax3LwxC.js → core-CBT9ED6Q.js} +1 -1
- package/dist/studio/assets/{index-Dpb5e5hX.js → index-CORJOrgI.js} +2 -2
- package/dist/studio/assets/{main-BPHUvK0T.js → main-BYaOwSFl.js} +3 -3
- package/dist/studio/index.html +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,176 @@
|
|
|
1
1
|
# mastra
|
|
2
2
|
|
|
3
|
+
## 1.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added the `mastra factory dev` command to start a local development server for Agent Builder development. It uses the same dev runtime and flags as `mastra dev` and shares the same `.mastra` output directory and dev lock, so the two commands cannot run at the same time in the same project. ([#19946](https://github.com/mastra-ai/mastra/pull/19946))
|
|
8
|
+
|
|
9
|
+
- `mastra build` now deploys in one step for push-style deployers. Deployers can opt in with the new `deployOnBuild` flag on the deployer contract, and the build runs their `deploy()` right after bundling. `SandboxDeployer` from `@mastra/deployer-sandbox` opts in, so configuring it means `mastra build` bundles your project, deploys it into the sandbox, and prints the live URL. Existing platform deployers are unchanged. ([#19577](https://github.com/mastra-ai/mastra/pull/19577))
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
13
|
+
import { SandboxDeployer } from '@mastra/deployer-sandbox';
|
|
14
|
+
import { VercelSandbox } from '@mastra/vercel';
|
|
15
|
+
|
|
16
|
+
export const mastra = new Mastra({
|
|
17
|
+
deployer: new SandboxDeployer({
|
|
18
|
+
sandbox: new VercelSandbox({ sandboxName: 'my-preview', ports: [4111] }),
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
mastra build # bundles AND deploys — prints the live URL
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- Added automatic Factory UI packaging to `mastra build` and `mastra deploy`. When a Software Factory project is detected, the CLI copies its prebuilt Factory SPA into `.mastra/output/factory/`; projects no longer need to build the SPA separately. ([#19948](https://github.com/mastra-ai/mastra/pull/19948))
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npx mastra build --dir src/mastra
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The resulting deployment contains `.mastra/output/factory/index.html`.
|
|
34
|
+
|
|
35
|
+
- Deploy now offers to attach a managed database inline when preflight would otherwise block on a missing database env var (`TURSO_DATABASE_URL`, `DATABASE_URL`, ...). Previously the CLI errored out and told you to run `mastra env db create` yourself, then re-run `mastra deploy`. ([#19653](https://github.com/mastra-ai/mastra/pull/19653))
|
|
36
|
+
|
|
37
|
+
The new flow:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Preflight needs TURSO_DATABASE_URL for the production environment.
|
|
41
|
+
Create a managed turso database now and attach it? (Y/n)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Answer yes and the CLI provisions the database, attaches it to the target environment (scoped, not shared), and continues the deploy in the same run. Answer no, or run in a non-interactive shell (CI, `--yes`), and the CLI falls back to the previous behavior and prints the exact `mastra env db create --kind ...` command as remediation.
|
|
45
|
+
|
|
46
|
+
The prompt only appears in an interactive TTY. `--yes` never silently creates infrastructure — it just skips the prompt and leaves the original preflight error in place, so CI stays deterministic. Resolves the deploy-time papercut tracked in the deploy-experience issue on `create-mastra` auto-provisioning: no manual command, no CLI restart, no extra login step.
|
|
47
|
+
|
|
48
|
+
- Changed the default scope for `mastra env db create`. It now creates an **environment-scoped** database instead of a project-scoped one shared by every environment. This matches the more common case of isolating production and staging data. ([#19653](https://github.com/mastra-ai/mastra/pull/19653))
|
|
49
|
+
|
|
50
|
+
**How the default is picked**
|
|
51
|
+
|
|
52
|
+
- If the project has one environment, that environment is used automatically.
|
|
53
|
+
- If it has several and the terminal is interactive, the CLI prompts you to select one (production pre-selected when present).
|
|
54
|
+
- In non-interactive mode (CI, `--json`) with multiple environments, the CLI now errors and asks you to pass an environment name or `--shared`, instead of silently attaching a shared database.
|
|
55
|
+
|
|
56
|
+
**New `--shared` flag**
|
|
57
|
+
|
|
58
|
+
Opt in to the old project-scoped behavior explicitly:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Before (implicit shared scope)
|
|
62
|
+
mastra env db create --kind turso
|
|
63
|
+
|
|
64
|
+
# After (same effect)
|
|
65
|
+
mastra env db create --kind turso --shared
|
|
66
|
+
|
|
67
|
+
# Or scope to a specific environment
|
|
68
|
+
mastra env db create staging --kind turso
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- Improved project creation with a new default template, provider-native OpenAI, Anthropic, Google Gemini, and xAI setup, an empty scaffold mode, automatic skills, automatic git initialization, and interactive Mastra platform setup. ([#19825](https://github.com/mastra-ai/mastra/pull/19825))
|
|
72
|
+
|
|
73
|
+
**Breaking change**
|
|
74
|
+
|
|
75
|
+
The following `create-mastra`/`mastra create` flags and aliases were removed:
|
|
76
|
+
|
|
77
|
+
- `-p, --project-name`
|
|
78
|
+
- `--default`
|
|
79
|
+
- `-d, --dir`
|
|
80
|
+
- `-c, --components`
|
|
81
|
+
- `-e, --example` and `--no-example`
|
|
82
|
+
- `-m, --mcp`
|
|
83
|
+
- `--skills`
|
|
84
|
+
- `--observe`, `--no-observe`, `--observability`, `--no-observability`, and `--observability-project`
|
|
85
|
+
|
|
86
|
+
This removes the classic component and example scaffold controls, custom source-directory selection, MCP editor setup, interactive skills selection, and observability CLI flags from `create-mastra`/`mastra create`. Project names are now positional, managed projects use a new default template, skills are installed automatically for detected coding assistants, and git is initialized automatically. Interactive managed creation offers Mastra platform setup through a browser authentication prompt, creates a platform project with the local project name, and writes its credentials to `.env`. Prompt-free creation can add platform afterward with `mastra init`. Use `--empty` for a minimal project, `--no-skills` to skip skills installation, or `--no-git` to skip git initialization. The separate `mastra init` command retains its existing MCP, skills, and observability setup.
|
|
87
|
+
|
|
88
|
+
**Migration examples**
|
|
89
|
+
|
|
90
|
+
Create the default managed project:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Before
|
|
94
|
+
npx create-mastra@latest --project-name my-app --default
|
|
95
|
+
|
|
96
|
+
# After
|
|
97
|
+
npx create-mastra@latest my-app --llm openai
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Create a minimal project instead of configuring components or examples:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Before
|
|
104
|
+
npx create-mastra@latest --project-name my-app --components agents,tools --no-example
|
|
105
|
+
|
|
106
|
+
# After
|
|
107
|
+
npx create-mastra@latest my-app --empty
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Skip the new automatic post-create setup when needed:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npx create-mastra@latest my-app --llm openai --no-skills --no-git
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- Fixed a crash where `mastra start` could exit with `RangeError: Invalid string length`. The command retained every byte a running server wrote to stderr in an ever-growing buffer; on long-running or noisy servers this eventually exceeded the maximum string length and took down the process. The retained buffer is now capped at its most recent 1MB, which still contains the crash diagnostics it is inspected for ([#19581](https://github.com/mastra-ai/mastra/issues/19581)). ([#19604](https://github.com/mastra-ai/mastra/pull/19604))
|
|
119
|
+
|
|
120
|
+
- Fixed the CLI's deploy success message to print the correct URL for Software Factory projects. Factory deploys now show `https://<slug>.factory.mastra.cloud` and a `Factory:` label, instead of the generic `Server:` label pointing at `.server.mastra.cloud`. Non-factory projects are unchanged. ([#20065](https://github.com/mastra-ai/mastra/pull/20065))
|
|
121
|
+
|
|
122
|
+
- Fixed Babel 8 compatibility for build-time transforms. ([#19393](https://github.com/mastra-ai/mastra/pull/19393))
|
|
123
|
+
|
|
124
|
+
- Factory board now picks up new GitHub/Linear intake automatically (gentle 30s poll) and refreshes work-item positions immediately when the tab regains focus, instead of requiring a manual page reload ([#20071](https://github.com/mastra-ai/mastra/pull/20071))
|
|
125
|
+
|
|
126
|
+
- Serve the Factory UI during `mastra factory dev`. The prebuilt SPA bundled with the CLI was only copied into `public/factory` by `mastra build`, so in dev the SPA middleware never mounted and the browser fell back to the default Mastra Server page. Dev now points the server at the CLI-bundled UI via `MASTRACODE_UI_DIST`, unless the user set an explicit override or has a locally built UI at `public/factory`. ([#20048](https://github.com/mastra-ai/mastra/pull/20048))
|
|
127
|
+
|
|
128
|
+
- Fixed GitHub PATs saved in Settings not taking effect for the gh CLI in already-running Factory sessions until the server was restarted ([#20069](https://github.com/mastra-ai/mastra/pull/20069))
|
|
129
|
+
|
|
130
|
+
- Fixed `mastra init` writing corrupted API keys to `.env` on Windows, including values containing `=` or shell metacharacters. ([#19825](https://github.com/mastra-ai/mastra/pull/19825))
|
|
131
|
+
|
|
132
|
+
- Fixed a crash in mastra worker start when a worker subprocess writes a very large amount of stderr output. The output is now capped to the most recent 1MB instead of growing without limit. ([#19675](https://github.com/mastra-ai/mastra/pull/19675))
|
|
133
|
+
|
|
134
|
+
- dependencies updates: ([#19393](https://github.com/mastra-ai/mastra/pull/19393))
|
|
135
|
+
- Updated dependency [`@babel/parser@^8.0.4` ↗︎](https://www.npmjs.com/package/@babel/parser/v/8.0.4) (from `^7.29.7`, in `dependencies`)
|
|
136
|
+
- Updated dependency [`@babel/types@^8.0.4` ↗︎](https://www.npmjs.com/package/@babel/types/v/8.0.4) (from `^7.29.7`, in `dependencies`)
|
|
137
|
+
|
|
138
|
+
- Added an internal `mastra/internal/auth` subpath export used by `create-factory` to reuse the CLI's browser-auth flow, credential store, and platform HTTP client. Not part of the CLI's public API — external consumers should keep using `mastra auth login` and the documented commands. ([#19945](https://github.com/mastra-ai/mastra/pull/19945))
|
|
139
|
+
|
|
140
|
+
- Preflight remediation messages now scope `mastra env db create` to the target environment as a positional argument (`mastra env db create production --kind turso`) instead of the unscoped form. There is no `--env` flag — the environment is a positional arg on this command. After the earlier default-scope change, running the unscoped command in CI (where preflight failures land) errors out on projects with more than one environment because it cannot prompt. The scoped form is copy-pasteable and works everywhere. ([#19653](https://github.com/mastra-ai/mastra/pull/19653))
|
|
141
|
+
|
|
142
|
+
- Added request-scoped model overrides to agent execution and approvals, and fixed Studio model selection so each tab can use a different model without changing the agent's configured default. ([#19749](https://github.com/mastra-ai/mastra/pull/19749))
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
await agent.stream(messages, { model: 'google/gemini-2.5-flash' });
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
- Preflight remediation for missing DB env vars now renders as a step list — one arrow line per option (`Run mastra env db create <env> --kind <kind>` on line 1, `Or set <ENV_VAR> in your env file` on line 2) — instead of a single run-on sentence that squashed both options into a wall of text. ([#19653](https://github.com/mastra-ai/mastra/pull/19653))
|
|
149
|
+
|
|
150
|
+
- Removes the `Environment "production" doesn't exist. Create it?` confirmation on first deploy. It always fires on a fresh project, always gets 'yes', and the whole point of `mastra deploy` is 'ship this to production' — the extra keypress is pure noise. The confirmation still runs for non-standard environment names (typo protection against `--env prodcution`). ([#19653](https://github.com/mastra-ai/mastra/pull/19653))
|
|
151
|
+
|
|
152
|
+
- Fixed `mastra deploy` printing a dangling closing tick with no text after a successful deploy. The success message is now shown on the final line (below the Studio and Server URLs) instead of an empty outro. ([#19499](https://github.com/mastra-ai/mastra/pull/19499))
|
|
153
|
+
|
|
154
|
+
- Fixed web chat sessions getting stuck in a "Connection lost — reconnecting…" loop while the session workspace was still starting up ([#20067](https://github.com/mastra-ai/mastra/pull/20067))
|
|
155
|
+
|
|
156
|
+
- Updated dependencies [[`ec857fc`](https://github.com/mastra-ai/mastra/commit/ec857fc79c264b53b38e16478c789b7177f2ad59), [`d7385ad`](https://github.com/mastra-ai/mastra/commit/d7385ad9e88f9e4f33d15c0ec0bfebedde0cbc2e), [`41a5392`](https://github.com/mastra-ai/mastra/commit/41a5392d9f6c5e18d6b227f0fc0ddf49c50774e9), [`3b77e77`](https://github.com/mastra-ai/mastra/commit/3b77e7704936522e4769d29de1b5ea6901f302bd), [`3d6e539`](https://github.com/mastra-ai/mastra/commit/3d6e539272eb2ea0407034605ee1906b3be06b39), [`1426af2`](https://github.com/mastra-ai/mastra/commit/1426af24975879c000d13ac75673f630fcc970c1), [`a40adeb`](https://github.com/mastra-ai/mastra/commit/a40adeb222b961a56a58af56a106106525721b74), [`8a0d145`](https://github.com/mastra-ai/mastra/commit/8a0d145aadbdf7278665aceaaec364b35dd9bd94), [`bd2f1d2`](https://github.com/mastra-ai/mastra/commit/bd2f1d274d05e60e2366f005ea0d94d5cea0d5ff), [`e1f2fae`](https://github.com/mastra-ai/mastra/commit/e1f2faebaf048c3d4c2e2c01d293767c195d5794), [`63aa799`](https://github.com/mastra-ai/mastra/commit/63aa799c6b44eacc7806cda6846b7c5bbee06b37), [`b7e79c3`](https://github.com/mastra-ai/mastra/commit/b7e79c3c02ac5cd415db34ba0975ceafc1464333), [`675fbff`](https://github.com/mastra-ai/mastra/commit/675fbff84d3274391b33e852f76083c38a5514e5), [`da009e1`](https://github.com/mastra-ai/mastra/commit/da009e1aacd89ed94b8d1b2af09c9d4fe7c4db49), [`3b77e77`](https://github.com/mastra-ai/mastra/commit/3b77e7704936522e4769d29de1b5ea6901f302bd), [`c7d30cd`](https://github.com/mastra-ai/mastra/commit/c7d30cd86009c407df91105591f03cd6e3d2854d), [`21a0eb8`](https://github.com/mastra-ai/mastra/commit/21a0eb86746ba0b703acea360d4f84c6a5a493f2), [`8b20926`](https://github.com/mastra-ai/mastra/commit/8b20926cd59e2ba3d66458e062fa0e6e2ada3e68), [`975295d`](https://github.com/mastra-ai/mastra/commit/975295d418552f0d46a59edfef4c3ee555f9930a), [`73db8db`](https://github.com/mastra-ai/mastra/commit/73db8db90d69ab6153c7942749f624db0d96952d), [`6b1bf3b`](https://github.com/mastra-ai/mastra/commit/6b1bf3b9494bd51aa8f654c68c9355d6046fa2a1), [`35c2181`](https://github.com/mastra-ai/mastra/commit/35c2181e6a50e47c90ba36260db7c9723d54696f), [`0a2c22c`](https://github.com/mastra-ai/mastra/commit/0a2c22c902604439ec490319e14c17f331e0c84c), [`4cfdd64`](https://github.com/mastra-ai/mastra/commit/4cfdd645794feaea0c4ea711e70ecdfbef0c5b8e), [`0a50de7`](https://github.com/mastra-ai/mastra/commit/0a50de7024816171701e81ac3b69434cf5a302ea), [`b75d749`](https://github.com/mastra-ai/mastra/commit/b75d749621ff5d17e86bcb4ee809d301fb4f7cf3), [`821648b`](https://github.com/mastra-ai/mastra/commit/821648bf2871ef840100c7bacbecf676010bd12a), [`de86fd7`](https://github.com/mastra-ai/mastra/commit/de86fd7119f0438381d1a642e3d258143c0b9c29), [`2745031`](https://github.com/mastra-ai/mastra/commit/2745031d1d4a4978f037092da371428c32e2842a), [`b4b7ea8`](https://github.com/mastra-ai/mastra/commit/b4b7ea8733f033fc441ea47ed03f6afb17ec2248), [`3a8024c`](https://github.com/mastra-ai/mastra/commit/3a8024ce615f8aa89479c0d71fe61d10bb0040be), [`35865a5`](https://github.com/mastra-ai/mastra/commit/35865a53e194aa9634d6a70a97010e7a6b9d58b1), [`74faf8b`](https://github.com/mastra-ai/mastra/commit/74faf8bd9c1018f2492653c06b1e25fc8300e9e6), [`ef03fbc`](https://github.com/mastra-ai/mastra/commit/ef03fbcc556bcbc04c9b3d06fab88771ecaa043c), [`675fbff`](https://github.com/mastra-ai/mastra/commit/675fbff84d3274391b33e852f76083c38a5514e5), [`70687f7`](https://github.com/mastra-ai/mastra/commit/70687f7e495a322a02070b4a67cb0c77a5ca91ec), [`1fadac4`](https://github.com/mastra-ai/mastra/commit/1fadac44537caeefe81f9f775ae2f2f3d94e9069), [`73db8db`](https://github.com/mastra-ai/mastra/commit/73db8db90d69ab6153c7942749f624db0d96952d), [`76b7181`](https://github.com/mastra-ai/mastra/commit/76b71810366e6d90b9d3973149d1c7ba3659ffb9), [`792ec9a`](https://github.com/mastra-ai/mastra/commit/792ec9a0869bab8274cf5e0ed2840738737a1607), [`712b864`](https://github.com/mastra-ai/mastra/commit/712b864aa1ed12b14c54390ec17b69de163c37f7), [`85e4fb5`](https://github.com/mastra-ai/mastra/commit/85e4fb50087a81c74df3a762f53b56373db0b912), [`0c0e8d7`](https://github.com/mastra-ai/mastra/commit/0c0e8d7becd4d1445c656b78d5d845f606c1ff9d), [`53df41b`](https://github.com/mastra-ai/mastra/commit/53df41ba8b00438ebe5daee1b04613aa4239a5b2), [`a7bbe77`](https://github.com/mastra-ai/mastra/commit/a7bbe773577f60bc4761b534ef7ec6b476332dad), [`72e437c`](https://github.com/mastra-ai/mastra/commit/72e437c515942c80b9def5b026e0bdee61b469d9), [`8f7a5de`](https://github.com/mastra-ai/mastra/commit/8f7a5dedc246cdc938bb65516703cf9b27b03756), [`a7bbe77`](https://github.com/mastra-ai/mastra/commit/a7bbe773577f60bc4761b534ef7ec6b476332dad), [`11f6cd9`](https://github.com/mastra-ai/mastra/commit/11f6cd96fe42582403416608beb212cc1a2cc79e), [`ef03c0c`](https://github.com/mastra-ai/mastra/commit/ef03c0cfc62367a458e4cc56462e2148b35681c5), [`4fb4d88`](https://github.com/mastra-ai/mastra/commit/4fb4d881bc107acee13890ad4d78661016c510ed), [`eac4537`](https://github.com/mastra-ai/mastra/commit/eac453795531df0d5fe3729d80e93a91f8c1bc91), [`4e68363`](https://github.com/mastra-ai/mastra/commit/4e683634f94ebd062d26a3bb6093a8dfc7263d37), [`c328769`](https://github.com/mastra-ai/mastra/commit/c3287698ff8ef98dba86d415faa566fa3e5f4d56), [`9f7c67a`](https://github.com/mastra-ai/mastra/commit/9f7c67abeeb52c41c51a9b5edee60b62afe7cd8d), [`3b65e68`](https://github.com/mastra-ai/mastra/commit/3b65e68d7f1c771c7a70eea42d83fefdd28cad88), [`4eba27a`](https://github.com/mastra-ai/mastra/commit/4eba27adcf60f991df0e62f94b3e75b4e67f3b4b), [`c701be3`](https://github.com/mastra-ai/mastra/commit/c701be32d7d9aa94a66da8c6cc38dcac6856f464), [`b4b7ea8`](https://github.com/mastra-ai/mastra/commit/b4b7ea8733f033fc441ea47ed03f6afb17ec2248), [`db650ce`](https://github.com/mastra-ai/mastra/commit/db650ce490348914e85b93651d83acdf8f2a4c31), [`232fcbc`](https://github.com/mastra-ai/mastra/commit/232fcbc14fce625dd672ba043329c0b732c62be2), [`6354eeb`](https://github.com/mastra-ai/mastra/commit/6354eeb32efa9f5f68f51dda394e90e2ee76f1fb), [`a8799bb`](https://github.com/mastra-ai/mastra/commit/a8799bb8e44f4a60d01e4e2acd3448ff80bf14f8), [`3d6e539`](https://github.com/mastra-ai/mastra/commit/3d6e539272eb2ea0407034605ee1906b3be06b39), [`e3868e2`](https://github.com/mastra-ai/mastra/commit/e3868e22babfffd0133771669ca724501c2dd58e), [`9251370`](https://github.com/mastra-ai/mastra/commit/9251370ad413af464aa22d7566338bec5613e8de), [`3491666`](https://github.com/mastra-ai/mastra/commit/34916663c4fdd43b48c21f4ab2d5fb6dcccc94f9), [`c0bec73`](https://github.com/mastra-ai/mastra/commit/c0bec732c93d1a22ae5e51ed66cf8cacca8bd6a6)]:
|
|
157
|
+
- @mastra/core@1.52.0
|
|
158
|
+
- @mastra/deployer@1.52.0
|
|
159
|
+
|
|
160
|
+
## 1.20.0-alpha.18
|
|
161
|
+
|
|
162
|
+
### Patch Changes
|
|
163
|
+
|
|
164
|
+
- Factory board now picks up new GitHub/Linear intake automatically (gentle 30s poll) and refreshes work-item positions immediately when the tab regains focus, instead of requiring a manual page reload ([#20071](https://github.com/mastra-ai/mastra/pull/20071))
|
|
165
|
+
|
|
166
|
+
## 1.20.0-alpha.17
|
|
167
|
+
|
|
168
|
+
### Patch Changes
|
|
169
|
+
|
|
170
|
+
- Fixed GitHub PATs saved in Settings not taking effect for the gh CLI in already-running Factory sessions until the server was restarted ([#20069](https://github.com/mastra-ai/mastra/pull/20069))
|
|
171
|
+
|
|
172
|
+
- Fixed web chat sessions getting stuck in a "Connection lost — reconnecting…" loop while the session workspace was still starting up ([#20067](https://github.com/mastra-ai/mastra/pull/20067))
|
|
173
|
+
|
|
3
174
|
## 1.20.0-alpha.16
|
|
4
175
|
|
|
5
176
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ke=Object.defineProperty;var Qe=(r,n,e)=>n in r?Ke(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var L=(r,n,e)=>Qe(r,typeof n!="symbol"?n+"":n,e);import{s as M,w as le,a as Oe,f as Xe,b as Ze,c as et,d as Se,z as tt,h as nt,e as rt,F as j,I as ce,R as st,T as ot,E as _e}from"./index-1R_kuRX2.js";import{c as at,d as it}from"./engine-compile-CoFXxfZy.js";let B=class extends Error{constructor(n){super(n),this.name="ShikiError"}},fe=class extends Error{constructor(n){super(n),this.name="ShikiError"}};function ct(){return 2147483648}function lt(){return typeof performance<"u"?performance.now():Date.now()}const ft=(r,n)=>r+(n-r%n)%n;async function ut(r){let n,e;const t={};function s(f){e=f,t.HEAPU8=new Uint8Array(f),t.HEAPU32=new Uint32Array(f)}function o(f,m,w){t.HEAPU8.copyWithin(f,m,m+w)}function a(f){try{return n.grow(f-e.byteLength+65535>>>16),s(n.buffer),1}catch{}}function i(f){const m=t.HEAPU8.length;f=f>>>0;const w=ct();if(f>w)return!1;for(let p=1;p<=4;p*=2){let d=m*(1+.2/p);d=Math.min(d,f+100663296);const y=Math.min(w,ft(Math.max(f,d),65536));if(a(y))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function l(f,m,w=1024){const p=m+w;let d=m;for(;f[d]&&!(d>=p);)++d;if(d-m>16&&f.buffer&&c)return c.decode(f.subarray(m,d));let y="";for(;m<d;){let b=f[m++];if(!(b&128)){y+=String.fromCharCode(b);continue}const S=f[m++]&63;if((b&224)===192){y+=String.fromCharCode((b&31)<<6|S);continue}const v=f[m++]&63;if((b&240)===224?b=(b&15)<<12|S<<6|v:b=(b&7)<<18|S<<12|v<<6|f[m++]&63,b<65536)y+=String.fromCharCode(b);else{const E=b-65536;y+=String.fromCharCode(55296|E>>10,56320|E&1023)}}return y}function h(f,m){return f?l(t.HEAPU8,f,m):""}const u={emscripten_get_now:lt,emscripten_memcpy_big:o,emscripten_resize_heap:i,fd_write:()=>0};async function g(){const m=await r({env:u,wasi_snapshot_preview1:u});n=m.memory,s(n.buffer),Object.assign(t,m),t.UTF8ToString=h}return await g(),t}var gt=Object.defineProperty,ht=(r,n,e)=>n in r?gt(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e,_=(r,n,e)=>(ht(r,typeof n!="symbol"?n+"":n,e),e);let T=null;function mt(r){throw new fe(r.UTF8ToString(r.getLastOnigError()))}class Z{constructor(n){_(this,"utf16Length"),_(this,"utf8Length"),_(this,"utf16Value"),_(this,"utf8Value"),_(this,"utf16OffsetToUtf8"),_(this,"utf8OffsetToUtf16");const e=n.length,t=Z._utf8ByteLength(n),s=t!==e,o=s?new Uint32Array(e+1):null;s&&(o[e]=t);const a=s?new Uint32Array(t+1):null;s&&(a[t]=e);const i=new Uint8Array(t);let c=0;for(let l=0;l<e;l++){const h=n.charCodeAt(l);let u=h,g=!1;if(h>=55296&&h<=56319&&l+1<e){const f=n.charCodeAt(l+1);f>=56320&&f<=57343&&(u=(h-55296<<10)+65536|f-56320,g=!0)}s&&(o[l]=c,g&&(o[l+1]=c),u<=127?a[c+0]=l:u<=2047?(a[c+0]=l,a[c+1]=l):u<=65535?(a[c+0]=l,a[c+1]=l,a[c+2]=l):(a[c+0]=l,a[c+1]=l,a[c+2]=l,a[c+3]=l)),u<=127?i[c++]=u:u<=2047?(i[c++]=192|(u&1984)>>>6,i[c++]=128|(u&63)>>>0):u<=65535?(i[c++]=224|(u&61440)>>>12,i[c++]=128|(u&4032)>>>6,i[c++]=128|(u&63)>>>0):(i[c++]=240|(u&1835008)>>>18,i[c++]=128|(u&258048)>>>12,i[c++]=128|(u&4032)>>>6,i[c++]=128|(u&63)>>>0),g&&l++}this.utf16Length=e,this.utf8Length=t,this.utf16Value=n,this.utf8Value=i,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=a}static _utf8ByteLength(n){let e=0;for(let t=0,s=n.length;t<s;t++){const o=n.charCodeAt(t);let a=o,i=!1;if(o>=55296&&o<=56319&&t+1<s){const c=n.charCodeAt(t+1);c>=56320&&c<=57343&&(a=(o-55296<<10)+65536|c-56320,i=!0)}a<=127?e+=1:a<=2047?e+=2:a<=65535?e+=3:e+=4,i&&t++}return e}createString(n){const e=n.omalloc(this.utf8Length);return n.HEAPU8.set(this.utf8Value,e),e}}const O=class{constructor(r){if(_(this,"id",++O.LAST_ID),_(this,"_onigBinding"),_(this,"content"),_(this,"utf16Length"),_(this,"utf8Length"),_(this,"utf16OffsetToUtf8"),_(this,"utf8OffsetToUtf16"),_(this,"ptr"),!T)throw new fe("Must invoke loadWasm first.");this._onigBinding=T,this.content=r;const n=new Z(r);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!O._sharedPtrInUse?(O._sharedPtr||(O._sharedPtr=T.omalloc(1e4)),O._sharedPtrInUse=!0,T.HEAPU8.set(n.utf8Value,O._sharedPtr),this.ptr=O._sharedPtr):this.ptr=n.createString(T)}convertUtf8OffsetToUtf16(r){return this.utf8OffsetToUtf16?r<0?0:r>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[r]:r}convertUtf16OffsetToUtf8(r){return this.utf16OffsetToUtf8?r<0?0:r>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[r]:r}dispose(){this.ptr===O._sharedPtr?O._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};let z=O;_(z,"LAST_ID",0);_(z,"_sharedPtr",0);_(z,"_sharedPtrInUse",!1);class dt{constructor(n){if(_(this,"_onigBinding"),_(this,"_ptr"),!T)throw new fe("Must invoke loadWasm first.");const e=[],t=[];for(let i=0,c=n.length;i<c;i++){const l=new Z(n[i]);e[i]=l.createString(T),t[i]=l.utf8Length}const s=T.omalloc(4*n.length);T.HEAPU32.set(e,s/4);const o=T.omalloc(4*n.length);T.HEAPU32.set(t,o/4);const a=T.createOnigScanner(s,o,n.length);for(let i=0,c=n.length;i<c;i++)T.ofree(e[i]);T.ofree(o),T.ofree(s),a===0&&mt(T),this._onigBinding=T,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(n,e,t){let s=0;if(typeof t=="number"&&(s=t),typeof n=="string"){n=new z(n);const o=this._findNextMatchSync(n,e,!1,s);return n.dispose(),o}return this._findNextMatchSync(n,e,!1,s)}_findNextMatchSync(n,e,t,s){const o=this._onigBinding,a=o.findNextOnigScannerMatch(this._ptr,n.id,n.ptr,n.utf8Length,n.convertUtf16OffsetToUtf8(e),s);if(a===0)return null;const i=o.HEAPU32;let c=a/4;const l=i[c++],h=i[c++],u=[];for(let g=0;g<h;g++){const f=n.convertUtf8OffsetToUtf16(i[c++]),m=n.convertUtf8OffsetToUtf16(i[c++]);u[g]={start:f,end:m,length:m-f}}return{index:l,captureIndices:u}}}function pt(r){return typeof r.instantiator=="function"}function yt(r){return typeof r.default=="function"}function bt(r){return typeof r.data<"u"}function wt(r){return typeof Response<"u"&&r instanceof Response}function St(r){var n;return typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||ArrayBuffer.isView(r))||typeof Buffer<"u"&&((n=Buffer.isBuffer)==null?void 0:n.call(Buffer,r))||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&r instanceof Uint32Array}let q;function Ae(r){if(q)return q;async function n(){T=await ut(async e=>{let t=r;return t=await t,typeof t=="function"&&(t=await t(e)),typeof t=="function"&&(t=await t(e)),pt(t)?t=await t.instantiator(e):yt(t)?t=await t.default(e):(bt(t)&&(t=t.data),wt(t)?typeof WebAssembly.instantiateStreaming=="function"?t=await _t(t)(e):t=await kt(t)(e):St(t)?t=await oe(t)(e):t instanceof WebAssembly.Module?t=await oe(t)(e):"default"in t&&t.default instanceof WebAssembly.Module&&(t=await oe(t.default)(e))),"instance"in t&&(t=t.instance),"exports"in t&&(t=t.exports),t})}return q=n(),q}function oe(r){return n=>WebAssembly.instantiate(r,n)}function _t(r){return n=>WebAssembly.instantiateStreaming(r,n)}function kt(r){return async n=>{const e=await r.arrayBuffer();return WebAssembly.instantiate(e,n)}}let Tt;function Nt(){return Tt}async function ue(r){return r&&await Ae(r),{createScanner(n){return new dt(n.map(e=>typeof e=="string"?e:e.source))},createString(n){return new z(n)}}}let Y=!1,$e=!1;function Jn(r=!0,n=!1){Y=r,$e=n}function x(r,n=3){if(Y&&!(typeof Y=="number"&&n>Y)){if($e)throw new Error(`[SHIKI DEPRECATE]: ${r}`);console.trace(`[SHIKI DEPRECATE]: ${r}`)}}const Ct=/^>|^->|<!--|-->|--!>|<!-$/g,Lt=[">"],vt=["<",">"];function xt(r,n,e,t){return t.settings.bogusComments?"<?"+M(r.value,Object.assign({},t.settings.characterReferences,{subset:Lt}))+">":"<!--"+r.value.replace(Ct,s)+"-->";function s(o){return M(o,Object.assign({},t.settings.characterReferences,{subset:vt}))}}function Et(r,n,e,t){return"<!"+(t.settings.upperDoctype?"DOCTYPE":"doctype")+(t.settings.tightDoctype?"":" ")+"html>"}const k=je(1),Be=je(-1),Ot=[];function je(r){return n;function n(e,t,s){const o=e?e.children:Ot;let a=(t||0)+r,i=o[a];if(!s)for(;i&&le(i);)a+=r,i=o[a];return i}}const At={}.hasOwnProperty;function Ie(r){return n;function n(e,t,s){return At.call(r,e.tagName)&&r[e.tagName](e,t,s)}}const ge=Ie({body:Bt,caption:ae,colgroup:ae,dd:Pt,dt:Ut,head:ae,html:$t,li:It,optgroup:Mt,option:Rt,p:jt,rp:ke,rt:ke,tbody:Wt,td:Te,tfoot:Dt,th:Te,thead:Ht,tr:Gt});function ae(r,n,e){const t=k(e,n,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&le(t.value.charAt(0)))}function $t(r,n,e){const t=k(e,n);return!t||t.type!=="comment"}function Bt(r,n,e){const t=k(e,n);return!t||t.type!=="comment"}function jt(r,n,e){const t=k(e,n);return t?t.type==="element"&&(t.tagName==="address"||t.tagName==="article"||t.tagName==="aside"||t.tagName==="blockquote"||t.tagName==="details"||t.tagName==="div"||t.tagName==="dl"||t.tagName==="fieldset"||t.tagName==="figcaption"||t.tagName==="figure"||t.tagName==="footer"||t.tagName==="form"||t.tagName==="h1"||t.tagName==="h2"||t.tagName==="h3"||t.tagName==="h4"||t.tagName==="h5"||t.tagName==="h6"||t.tagName==="header"||t.tagName==="hgroup"||t.tagName==="hr"||t.tagName==="main"||t.tagName==="menu"||t.tagName==="nav"||t.tagName==="ol"||t.tagName==="p"||t.tagName==="pre"||t.tagName==="section"||t.tagName==="table"||t.tagName==="ul"):!e||!(e.type==="element"&&(e.tagName==="a"||e.tagName==="audio"||e.tagName==="del"||e.tagName==="ins"||e.tagName==="map"||e.tagName==="noscript"||e.tagName==="video"))}function It(r,n,e){const t=k(e,n);return!t||t.type==="element"&&t.tagName==="li"}function Ut(r,n,e){const t=k(e,n);return!!(t&&t.type==="element"&&(t.tagName==="dt"||t.tagName==="dd"))}function Pt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="dt"||t.tagName==="dd")}function ke(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="rp"||t.tagName==="rt")}function Mt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&t.tagName==="optgroup"}function Rt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="option"||t.tagName==="optgroup")}function Ht(r,n,e){const t=k(e,n);return!!(t&&t.type==="element"&&(t.tagName==="tbody"||t.tagName==="tfoot"))}function Wt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="tbody"||t.tagName==="tfoot")}function Dt(r,n,e){return!k(e,n)}function Gt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&t.tagName==="tr"}function Te(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="td"||t.tagName==="th")}const Ft=Ie({body:qt,colgroup:Jt,head:Vt,html:zt,tbody:Yt});function zt(r){const n=k(r,-1);return!n||n.type!=="comment"}function Vt(r){const n=new Set;for(const t of r.children)if(t.type==="element"&&(t.tagName==="base"||t.tagName==="title")){if(n.has(t.tagName))return!1;n.add(t.tagName)}const e=r.children[0];return!e||e.type==="element"}function qt(r){const n=k(r,-1,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&le(n.value.charAt(0)))&&!(n.type==="element"&&(n.tagName==="meta"||n.tagName==="link"||n.tagName==="script"||n.tagName==="style"||n.tagName==="template"))}function Jt(r,n,e){const t=Be(e,n),s=k(r,-1,!0);return e&&t&&t.type==="element"&&t.tagName==="colgroup"&&ge(t,e.children.indexOf(t),e)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function Yt(r,n,e){const t=Be(e,n),s=k(r,-1);return e&&t&&t.type==="element"&&(t.tagName==="thead"||t.tagName==="tbody")&&ge(t,e.children.indexOf(t),e)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const J={name:[[`
|
|
1
|
+
var Ke=Object.defineProperty;var Qe=(r,n,e)=>n in r?Ke(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var L=(r,n,e)=>Qe(r,typeof n!="symbol"?n+"":n,e);import{s as M,w as le,a as Oe,f as Xe,b as Ze,c as et,d as Se,z as tt,h as nt,e as rt,F as j,I as ce,R as st,T as ot,E as _e}from"./index-a18ZK3TF.js";import{c as at,d as it}from"./engine-compile-DyPuh63K.js";let B=class extends Error{constructor(n){super(n),this.name="ShikiError"}},fe=class extends Error{constructor(n){super(n),this.name="ShikiError"}};function ct(){return 2147483648}function lt(){return typeof performance<"u"?performance.now():Date.now()}const ft=(r,n)=>r+(n-r%n)%n;async function ut(r){let n,e;const t={};function s(f){e=f,t.HEAPU8=new Uint8Array(f),t.HEAPU32=new Uint32Array(f)}function o(f,m,w){t.HEAPU8.copyWithin(f,m,m+w)}function a(f){try{return n.grow(f-e.byteLength+65535>>>16),s(n.buffer),1}catch{}}function i(f){const m=t.HEAPU8.length;f=f>>>0;const w=ct();if(f>w)return!1;for(let p=1;p<=4;p*=2){let d=m*(1+.2/p);d=Math.min(d,f+100663296);const y=Math.min(w,ft(Math.max(f,d),65536));if(a(y))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function l(f,m,w=1024){const p=m+w;let d=m;for(;f[d]&&!(d>=p);)++d;if(d-m>16&&f.buffer&&c)return c.decode(f.subarray(m,d));let y="";for(;m<d;){let b=f[m++];if(!(b&128)){y+=String.fromCharCode(b);continue}const S=f[m++]&63;if((b&224)===192){y+=String.fromCharCode((b&31)<<6|S);continue}const v=f[m++]&63;if((b&240)===224?b=(b&15)<<12|S<<6|v:b=(b&7)<<18|S<<12|v<<6|f[m++]&63,b<65536)y+=String.fromCharCode(b);else{const E=b-65536;y+=String.fromCharCode(55296|E>>10,56320|E&1023)}}return y}function h(f,m){return f?l(t.HEAPU8,f,m):""}const u={emscripten_get_now:lt,emscripten_memcpy_big:o,emscripten_resize_heap:i,fd_write:()=>0};async function g(){const m=await r({env:u,wasi_snapshot_preview1:u});n=m.memory,s(n.buffer),Object.assign(t,m),t.UTF8ToString=h}return await g(),t}var gt=Object.defineProperty,ht=(r,n,e)=>n in r?gt(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e,_=(r,n,e)=>(ht(r,typeof n!="symbol"?n+"":n,e),e);let T=null;function mt(r){throw new fe(r.UTF8ToString(r.getLastOnigError()))}class Z{constructor(n){_(this,"utf16Length"),_(this,"utf8Length"),_(this,"utf16Value"),_(this,"utf8Value"),_(this,"utf16OffsetToUtf8"),_(this,"utf8OffsetToUtf16");const e=n.length,t=Z._utf8ByteLength(n),s=t!==e,o=s?new Uint32Array(e+1):null;s&&(o[e]=t);const a=s?new Uint32Array(t+1):null;s&&(a[t]=e);const i=new Uint8Array(t);let c=0;for(let l=0;l<e;l++){const h=n.charCodeAt(l);let u=h,g=!1;if(h>=55296&&h<=56319&&l+1<e){const f=n.charCodeAt(l+1);f>=56320&&f<=57343&&(u=(h-55296<<10)+65536|f-56320,g=!0)}s&&(o[l]=c,g&&(o[l+1]=c),u<=127?a[c+0]=l:u<=2047?(a[c+0]=l,a[c+1]=l):u<=65535?(a[c+0]=l,a[c+1]=l,a[c+2]=l):(a[c+0]=l,a[c+1]=l,a[c+2]=l,a[c+3]=l)),u<=127?i[c++]=u:u<=2047?(i[c++]=192|(u&1984)>>>6,i[c++]=128|(u&63)>>>0):u<=65535?(i[c++]=224|(u&61440)>>>12,i[c++]=128|(u&4032)>>>6,i[c++]=128|(u&63)>>>0):(i[c++]=240|(u&1835008)>>>18,i[c++]=128|(u&258048)>>>12,i[c++]=128|(u&4032)>>>6,i[c++]=128|(u&63)>>>0),g&&l++}this.utf16Length=e,this.utf8Length=t,this.utf16Value=n,this.utf8Value=i,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=a}static _utf8ByteLength(n){let e=0;for(let t=0,s=n.length;t<s;t++){const o=n.charCodeAt(t);let a=o,i=!1;if(o>=55296&&o<=56319&&t+1<s){const c=n.charCodeAt(t+1);c>=56320&&c<=57343&&(a=(o-55296<<10)+65536|c-56320,i=!0)}a<=127?e+=1:a<=2047?e+=2:a<=65535?e+=3:e+=4,i&&t++}return e}createString(n){const e=n.omalloc(this.utf8Length);return n.HEAPU8.set(this.utf8Value,e),e}}const O=class{constructor(r){if(_(this,"id",++O.LAST_ID),_(this,"_onigBinding"),_(this,"content"),_(this,"utf16Length"),_(this,"utf8Length"),_(this,"utf16OffsetToUtf8"),_(this,"utf8OffsetToUtf16"),_(this,"ptr"),!T)throw new fe("Must invoke loadWasm first.");this._onigBinding=T,this.content=r;const n=new Z(r);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!O._sharedPtrInUse?(O._sharedPtr||(O._sharedPtr=T.omalloc(1e4)),O._sharedPtrInUse=!0,T.HEAPU8.set(n.utf8Value,O._sharedPtr),this.ptr=O._sharedPtr):this.ptr=n.createString(T)}convertUtf8OffsetToUtf16(r){return this.utf8OffsetToUtf16?r<0?0:r>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[r]:r}convertUtf16OffsetToUtf8(r){return this.utf16OffsetToUtf8?r<0?0:r>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[r]:r}dispose(){this.ptr===O._sharedPtr?O._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};let z=O;_(z,"LAST_ID",0);_(z,"_sharedPtr",0);_(z,"_sharedPtrInUse",!1);class dt{constructor(n){if(_(this,"_onigBinding"),_(this,"_ptr"),!T)throw new fe("Must invoke loadWasm first.");const e=[],t=[];for(let i=0,c=n.length;i<c;i++){const l=new Z(n[i]);e[i]=l.createString(T),t[i]=l.utf8Length}const s=T.omalloc(4*n.length);T.HEAPU32.set(e,s/4);const o=T.omalloc(4*n.length);T.HEAPU32.set(t,o/4);const a=T.createOnigScanner(s,o,n.length);for(let i=0,c=n.length;i<c;i++)T.ofree(e[i]);T.ofree(o),T.ofree(s),a===0&&mt(T),this._onigBinding=T,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(n,e,t){let s=0;if(typeof t=="number"&&(s=t),typeof n=="string"){n=new z(n);const o=this._findNextMatchSync(n,e,!1,s);return n.dispose(),o}return this._findNextMatchSync(n,e,!1,s)}_findNextMatchSync(n,e,t,s){const o=this._onigBinding,a=o.findNextOnigScannerMatch(this._ptr,n.id,n.ptr,n.utf8Length,n.convertUtf16OffsetToUtf8(e),s);if(a===0)return null;const i=o.HEAPU32;let c=a/4;const l=i[c++],h=i[c++],u=[];for(let g=0;g<h;g++){const f=n.convertUtf8OffsetToUtf16(i[c++]),m=n.convertUtf8OffsetToUtf16(i[c++]);u[g]={start:f,end:m,length:m-f}}return{index:l,captureIndices:u}}}function pt(r){return typeof r.instantiator=="function"}function yt(r){return typeof r.default=="function"}function bt(r){return typeof r.data<"u"}function wt(r){return typeof Response<"u"&&r instanceof Response}function St(r){var n;return typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||ArrayBuffer.isView(r))||typeof Buffer<"u"&&((n=Buffer.isBuffer)==null?void 0:n.call(Buffer,r))||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&r instanceof Uint32Array}let q;function Ae(r){if(q)return q;async function n(){T=await ut(async e=>{let t=r;return t=await t,typeof t=="function"&&(t=await t(e)),typeof t=="function"&&(t=await t(e)),pt(t)?t=await t.instantiator(e):yt(t)?t=await t.default(e):(bt(t)&&(t=t.data),wt(t)?typeof WebAssembly.instantiateStreaming=="function"?t=await _t(t)(e):t=await kt(t)(e):St(t)?t=await oe(t)(e):t instanceof WebAssembly.Module?t=await oe(t)(e):"default"in t&&t.default instanceof WebAssembly.Module&&(t=await oe(t.default)(e))),"instance"in t&&(t=t.instance),"exports"in t&&(t=t.exports),t})}return q=n(),q}function oe(r){return n=>WebAssembly.instantiate(r,n)}function _t(r){return n=>WebAssembly.instantiateStreaming(r,n)}function kt(r){return async n=>{const e=await r.arrayBuffer();return WebAssembly.instantiate(e,n)}}let Tt;function Nt(){return Tt}async function ue(r){return r&&await Ae(r),{createScanner(n){return new dt(n.map(e=>typeof e=="string"?e:e.source))},createString(n){return new z(n)}}}let Y=!1,$e=!1;function Jn(r=!0,n=!1){Y=r,$e=n}function x(r,n=3){if(Y&&!(typeof Y=="number"&&n>Y)){if($e)throw new Error(`[SHIKI DEPRECATE]: ${r}`);console.trace(`[SHIKI DEPRECATE]: ${r}`)}}const Ct=/^>|^->|<!--|-->|--!>|<!-$/g,Lt=[">"],vt=["<",">"];function xt(r,n,e,t){return t.settings.bogusComments?"<?"+M(r.value,Object.assign({},t.settings.characterReferences,{subset:Lt}))+">":"<!--"+r.value.replace(Ct,s)+"-->";function s(o){return M(o,Object.assign({},t.settings.characterReferences,{subset:vt}))}}function Et(r,n,e,t){return"<!"+(t.settings.upperDoctype?"DOCTYPE":"doctype")+(t.settings.tightDoctype?"":" ")+"html>"}const k=je(1),Be=je(-1),Ot=[];function je(r){return n;function n(e,t,s){const o=e?e.children:Ot;let a=(t||0)+r,i=o[a];if(!s)for(;i&&le(i);)a+=r,i=o[a];return i}}const At={}.hasOwnProperty;function Ie(r){return n;function n(e,t,s){return At.call(r,e.tagName)&&r[e.tagName](e,t,s)}}const ge=Ie({body:Bt,caption:ae,colgroup:ae,dd:Pt,dt:Ut,head:ae,html:$t,li:It,optgroup:Mt,option:Rt,p:jt,rp:ke,rt:ke,tbody:Wt,td:Te,tfoot:Dt,th:Te,thead:Ht,tr:Gt});function ae(r,n,e){const t=k(e,n,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&le(t.value.charAt(0)))}function $t(r,n,e){const t=k(e,n);return!t||t.type!=="comment"}function Bt(r,n,e){const t=k(e,n);return!t||t.type!=="comment"}function jt(r,n,e){const t=k(e,n);return t?t.type==="element"&&(t.tagName==="address"||t.tagName==="article"||t.tagName==="aside"||t.tagName==="blockquote"||t.tagName==="details"||t.tagName==="div"||t.tagName==="dl"||t.tagName==="fieldset"||t.tagName==="figcaption"||t.tagName==="figure"||t.tagName==="footer"||t.tagName==="form"||t.tagName==="h1"||t.tagName==="h2"||t.tagName==="h3"||t.tagName==="h4"||t.tagName==="h5"||t.tagName==="h6"||t.tagName==="header"||t.tagName==="hgroup"||t.tagName==="hr"||t.tagName==="main"||t.tagName==="menu"||t.tagName==="nav"||t.tagName==="ol"||t.tagName==="p"||t.tagName==="pre"||t.tagName==="section"||t.tagName==="table"||t.tagName==="ul"):!e||!(e.type==="element"&&(e.tagName==="a"||e.tagName==="audio"||e.tagName==="del"||e.tagName==="ins"||e.tagName==="map"||e.tagName==="noscript"||e.tagName==="video"))}function It(r,n,e){const t=k(e,n);return!t||t.type==="element"&&t.tagName==="li"}function Ut(r,n,e){const t=k(e,n);return!!(t&&t.type==="element"&&(t.tagName==="dt"||t.tagName==="dd"))}function Pt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="dt"||t.tagName==="dd")}function ke(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="rp"||t.tagName==="rt")}function Mt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&t.tagName==="optgroup"}function Rt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="option"||t.tagName==="optgroup")}function Ht(r,n,e){const t=k(e,n);return!!(t&&t.type==="element"&&(t.tagName==="tbody"||t.tagName==="tfoot"))}function Wt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="tbody"||t.tagName==="tfoot")}function Dt(r,n,e){return!k(e,n)}function Gt(r,n,e){const t=k(e,n);return!t||t.type==="element"&&t.tagName==="tr"}function Te(r,n,e){const t=k(e,n);return!t||t.type==="element"&&(t.tagName==="td"||t.tagName==="th")}const Ft=Ie({body:qt,colgroup:Jt,head:Vt,html:zt,tbody:Yt});function zt(r){const n=k(r,-1);return!n||n.type!=="comment"}function Vt(r){const n=new Set;for(const t of r.children)if(t.type==="element"&&(t.tagName==="base"||t.tagName==="title")){if(n.has(t.tagName))return!1;n.add(t.tagName)}const e=r.children[0];return!e||e.type==="element"}function qt(r){const n=k(r,-1,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&le(n.value.charAt(0)))&&!(n.type==="element"&&(n.tagName==="meta"||n.tagName==="link"||n.tagName==="script"||n.tagName==="style"||n.tagName==="template"))}function Jt(r,n,e){const t=Be(e,n),s=k(r,-1,!0);return e&&t&&t.type==="element"&&t.tagName==="colgroup"&&ge(t,e.children.indexOf(t),e)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function Yt(r,n,e){const t=Be(e,n),s=k(r,-1);return e&&t&&t.type==="element"&&(t.tagName==="thead"||t.tagName==="tbody")&&ge(t,e.children.indexOf(t),e)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const J={name:[[`
|
|
2
2
|
\f\r &/=>`.split(""),`
|
|
3
3
|
\f\r "&'/=>\``.split("")],[`\0
|
|
4
4
|
\f\r "&'/<=>`.split(""),`\0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var x=(i,t,e)=>t in i?p(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var f=(i,t,e)=>x(i,typeof t!="symbol"?t+"":t,e);import{t as h}from"./index-
|
|
1
|
+
var p=Object.defineProperty;var x=(i,t,e)=>t in i?p(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var f=(i,t,e)=>x(i,typeof t!="symbol"?t+"":t,e);import{t as h}from"./index-a18ZK3TF.js";const l=4294967295;class d{constructor(t,e={}){f(this,"regexps");this.patterns=t,this.options=e;const{forgiving:g=!1,cache:s,regexConstructor:c}=e;if(!c)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(u=>{if(typeof u!="string")return u;const n=s==null?void 0:s.get(u);if(n){if(n instanceof RegExp)return n;if(g)return null;throw n}try{const r=c(u);return s==null||s.set(u,r),r}catch(r){if(s==null||s.set(u,r),g)return null;throw r}})}findNextMatchSync(t,e,g){const s=typeof t=="string"?t:t.content,c=[];function u(n,r,o=0){return{index:n,captureIndices:r.indices.map(a=>a==null?{start:l,end:l,length:0}:{start:a[0]+o,end:a[1]+o,length:a[1]-a[0]})}}for(let n=0;n<this.regexps.length;n++){const r=this.regexps[n];if(r)try{r.lastIndex=e;const o=r.exec(s);if(!o)continue;if(o.index===e)return u(n,o,0);c.push([n,o,0])}catch(o){if(this.options.forgiving)continue;throw o}}if(c.length){const n=Math.min(...c.map(r=>r[1].index));for(const[r,o,a]of c)if(o.index===n)return u(r,o,a)}return null}}function m(i,t){return h(i,{global:!0,hasIndices:!0,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function v(i={}){const t=Object.assign({target:"auto",cache:new Map},i);return t.regexConstructor||(t.regexConstructor=e=>m(e,{target:t.target})),{createScanner(e){return new d(e,t)},createString(e){return{content:e}}}}export{d as J,v as c,m as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as t}from"./engine-compile-
|
|
1
|
+
import{J as t}from"./engine-compile-DyPuh63K.js";import{c as i,d as g}from"./engine-compile-DyPuh63K.js";import"./index-a18ZK3TF.js";function c(){const e={cache:new Map,regexConstructor:()=>{throw new Error("JavaScriptRawEngine: only support precompiled grammar")}};return{createScanner(r){return new t(r,e)},createString(r){return{content:r}}}}export{t as JavaScriptScanner,c as createJavaScriptRawEngine,i as createJavaScriptRegexEngine,g as defaultJavaScriptRegexConstructor};
|