everything-dev 2.0.0-rc.7 → 2.0.0-rc.9
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/dist/api/auth-middleware.cjs +14 -1
- package/dist/api/auth-middleware.cjs.map +1 -1
- package/dist/api/auth-middleware.d.cts +9 -0
- package/dist/api/auth-middleware.d.mts +9 -0
- package/dist/api/auth-middleware.mjs +14 -1
- package/dist/api/auth-middleware.mjs.map +1 -1
- package/dist/apps/upload/src/client.cjs +7 -1
- package/dist/apps/upload/src/client.cjs.map +1 -1
- package/dist/apps/upload/src/client.mjs +7 -1
- package/dist/apps/upload/src/client.mjs.map +1 -1
- package/dist/auth-login.cjs +24 -1
- package/dist/auth-login.cjs.map +1 -1
- package/dist/auth-login.mjs +24 -1
- package/dist/auth-login.mjs.map +1 -1
- package/dist/auth-session.cjs +4 -2
- package/dist/auth-session.cjs.map +1 -1
- package/dist/auth-session.mjs +4 -2
- package/dist/auth-session.mjs.map +1 -1
- package/dist/cdn-deploy.cjs +11 -7
- package/dist/cdn-deploy.cjs.map +1 -1
- package/dist/cdn-deploy.mjs +11 -7
- package/dist/cdn-deploy.mjs.map +1 -1
- package/dist/cli/import.cjs +1140 -0
- package/dist/cli/import.cjs.map +1 -0
- package/dist/cli/import.mjs +1126 -0
- package/dist/cli/import.mjs.map +1 -0
- package/dist/cli/init.cjs +33 -14
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +8 -2
- package/dist/cli/init.d.mts +8 -2
- package/dist/cli/init.mjs +33 -15
- package/dist/cli/init.mjs.map +1 -1
- package/dist/cli.cjs +59 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +59 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/commands/import.cjs +49 -0
- package/dist/commands/import.cjs.map +1 -0
- package/dist/commands/import.mjs +46 -0
- package/dist/commands/import.mjs.map +1 -0
- package/dist/commands/keys.cjs +25 -4
- package/dist/commands/keys.cjs.map +1 -1
- package/dist/commands/keys.mjs +25 -4
- package/dist/commands/keys.mjs.map +1 -1
- package/dist/config.d.cts +1 -0
- package/dist/config.d.mts +1 -0
- package/dist/contract.cjs +89 -0
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +190 -1
- package/dist/contract.d.mts +190 -1
- package/dist/contract.meta.cjs +17 -1
- package/dist/contract.meta.cjs.map +1 -1
- package/dist/contract.meta.d.cts +27 -1
- package/dist/contract.meta.d.mts +27 -1
- package/dist/contract.meta.mjs +17 -1
- package/dist/contract.meta.mjs.map +1 -1
- package/dist/contract.mjs +84 -1
- package/dist/contract.mjs.map +1 -1
- package/dist/custody-signer.cjs +70 -0
- package/dist/custody-signer.cjs.map +1 -0
- package/dist/custody-signer.mjs +68 -0
- package/dist/custody-signer.mjs.map +1 -0
- package/dist/db/core.cjs +22 -4
- package/dist/db/core.cjs.map +1 -1
- package/dist/db/core.mjs +22 -4
- package/dist/db/core.mjs.map +1 -1
- package/dist/descriptor/schema.cjs +8 -5
- package/dist/descriptor/schema.cjs.map +1 -1
- package/dist/descriptor/schema.d.cts +1 -0
- package/dist/descriptor/schema.d.mts +1 -0
- package/dist/descriptor/schema.mjs +8 -5
- package/dist/descriptor/schema.mjs.map +1 -1
- package/dist/descriptor/serialize.cjs +1 -1
- package/dist/descriptor/serialize.cjs.map +1 -1
- package/dist/descriptor/serialize.mjs +1 -1
- package/dist/descriptor/serialize.mjs.map +1 -1
- package/dist/http-client.cjs +14 -4
- package/dist/http-client.cjs.map +1 -1
- package/dist/http-client.mjs +14 -4
- package/dist/http-client.mjs.map +1 -1
- package/dist/index.cjs +6 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/infra/planner.cjs +6 -2
- package/dist/infra/planner.cjs.map +1 -1
- package/dist/infra/planner.mjs +6 -2
- package/dist/infra/planner.mjs.map +1 -1
- package/dist/outlayer-login.cjs +54 -0
- package/dist/outlayer-login.cjs.map +1 -0
- package/dist/outlayer-login.mjs +54 -0
- package/dist/outlayer-login.mjs.map +1 -0
- package/dist/plugin.cjs +2 -0
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +74 -0
- package/dist/plugin.d.mts +74 -0
- package/dist/plugin.mjs +2 -0
- package/dist/plugin.mjs.map +1 -1
- package/dist/publish.cjs +145 -22
- package/dist/publish.cjs.map +1 -1
- package/dist/publish.mjs +147 -24
- package/dist/publish.mjs.map +1 -1
- package/dist/source-archive.cjs +51 -0
- package/dist/source-archive.cjs.map +1 -0
- package/dist/source-archive.mjs +50 -0
- package/dist/source-archive.mjs.map +1 -0
- package/dist/storage-upload.cjs +6 -1
- package/dist/storage-upload.cjs.map +1 -1
- package/dist/storage-upload.mjs +6 -1
- package/dist/storage-upload.mjs.map +1 -1
- package/dist/types.cjs +5 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +5 -1
- package/dist/types.mjs.map +1 -1
- package/dist/ui/auth.d.cts +217 -123
- package/dist/ui/auth.d.mts +217 -123
- package/dist/ui/router-client.cjs +2 -1
- package/dist/ui/router-client.cjs.map +1 -1
- package/dist/ui/router-client.mjs +2 -1
- package/dist/ui/router-client.mjs.map +1 -1
- package/dist/utils/workspace-subtree.cjs +37 -0
- package/dist/utils/workspace-subtree.cjs.map +1 -0
- package/dist/utils/workspace-subtree.mjs +36 -0
- package/dist/utils/workspace-subtree.mjs.map +1 -0
- package/dist/version-manifest-deploy.cjs +4 -2
- package/dist/version-manifest-deploy.cjs.map +1 -1
- package/dist/version-manifest-deploy.mjs +4 -2
- package/dist/version-manifest-deploy.mjs.map +1 -1
- package/dist/version-manifest-resolve.cjs +2 -1
- package/dist/version-manifest-resolve.cjs.map +1 -1
- package/dist/version-manifest-resolve.d.cts +3 -0
- package/dist/version-manifest-resolve.d.mts +3 -0
- package/dist/version-manifest-resolve.mjs +2 -1
- package/dist/version-manifest-resolve.mjs.map +1 -1
- package/package.json +11 -10
- package/skills/api-and-auth/SKILL.md +12 -9
- package/skills/api-and-auth/references/middleware.md +38 -0
- package/skills/cli-reference/SKILL.md +38 -6
- package/skills/init-upgrade/SKILL.md +76 -3
- package/skills/talk-to-the-app/SKILL.md +32 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: init-upgrade
|
|
3
|
-
description: bos init, bos sync, and bos upgrade workflows — template download, snapshot-based conflict detection, package version bumps, and how init/sync select and own files. Use when scaffolding new projects, syncing upstream changes, or upgrading framework packages.
|
|
3
|
+
description: bos init, bos sync, bos import, and bos upgrade workflows — template download, snapshot-based conflict detection, workspace import from upstream repos with divergence reporting, package version bumps, and how init/sync select and own files. Use when scaffolding new projects, syncing upstream changes, importing a workspace subtree from another repo, or upgrading framework packages.
|
|
4
4
|
metadata:
|
|
5
|
-
sources: "packages/everything-dev/src/cli/init.ts,packages/everything-dev/src/cli/sync.ts,packages/everything-dev/src/cli/upgrade.ts,packages/everything-dev/src/cli/snapshot.ts,packages/everything-dev/src/cli.ts,packages/everything-dev/src/merge.ts"
|
|
5
|
+
sources: "packages/everything-dev/src/cli/init.ts,packages/everything-dev/src/cli/sync.ts,packages/everything-dev/src/cli/import.ts,packages/everything-dev/src/commands/import.ts,packages/everything-dev/src/cli/upgrade.ts,packages/everything-dev/src/cli/snapshot.ts,packages/everything-dev/src/cli.ts,packages/everything-dev/src/merge.ts"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
> **Config form:** the authored config is `bos.app.ts` (canonical, preferred when both exist). A legacy `bos.config.json` is still supported for older children. Where this doc says `bos.config.json` for the *local authored file*, read "the authored config". The published artifact on FastKV keeps the key name `bos.config.json`.
|
|
9
9
|
|
|
10
|
-
# bos init, sync, upgrade
|
|
10
|
+
# bos init, sync, import, upgrade
|
|
11
11
|
|
|
12
12
|
## bos init
|
|
13
13
|
|
|
@@ -182,6 +182,76 @@ bos upgrade --dry-run # Preview without making changes
|
|
|
182
182
|
|
|
183
183
|
Workspace packages use `catalog:` refs so a single version bump in root catalog propagates everywhere. Skips `workspace:*` and `file:` refs.
|
|
184
184
|
|
|
185
|
+
## bos import
|
|
186
|
+
|
|
187
|
+
Imports a workspace subtree (e.g. `plugins/auth`) from an upstream GitHub repo or a local directory — no clone of the full history, just a tarball (or direct local read) of one ref. The upstream can also be resolved through the authored config's `extends` chain (a bos:// URL centric source — see below):
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
bos import plugins/auth # resolved through the extends chain
|
|
191
|
+
bos import plugins/auth --from bos://base.near/base
|
|
192
|
+
bos import plugins/auth --from NEARBuilders/everything-dev
|
|
193
|
+
bos import plugins/auth --from NEARBuilders/everything-dev@v2.1.0
|
|
194
|
+
bos import plugins/auth --from NEARBuilders/everything-dev@everything-dev@2.0.0-rc.8
|
|
195
|
+
bos import plugins/auth --from https://github.com/owner/repo@develop
|
|
196
|
+
bos import plugins/auth --from ./local-checkout --dry-run
|
|
197
|
+
bos import plugins/auth --from owner/repo --yes
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Flags:** `--from <bos://<account>/<gateway> | owner/repo[@ref] | url | dir>` (optional — resolve through the extends chain when omitted), `--yes`, `--dry-run`, `--no-install`, `--json`. The GitHub ref splits on the **first** `@`, so changesets-style tags keep their own `@`.
|
|
201
|
+
|
|
202
|
+
### Source resolution
|
|
203
|
+
|
|
204
|
+
`--from` takes three shapes:
|
|
205
|
+
|
|
206
|
+
- **`bos://<account>/<gateway>`** — the config published to FastKV by that runtime. The extends chain of that runtime is walked outward to the **nearest ancestor whose own config declares the workspace locally** (`local:<workspace-path>`); the tarball comes from that ancestor's `repository` field (continuing rootward when the declaring runtime itself lacks one).
|
|
207
|
+
- **omitted** — same chain walk, starting from the authored `bos.app.ts` (v2 config only). Errors when the workspace is declared locally in the child (you own it — nothing to import), when no runtime in the chain declares the workspace, or when no ancestor along the chain carries a `repository`.
|
|
208
|
+
- **`<owner/repo>[@ref]`, GitHub URL, or local dir** — explicit source, unchanged.
|
|
209
|
+
|
|
210
|
+
**Ref pinning:** the ancestor's published config pins each workspace to an immutable version manifest. When the ancestor publishes source archives (`publish.sourcePublish` on its authored config, ADR 0030), the import **byte-sources** from the pinned archive: the manifest itself is SRI-verified against the config slot pin, the archive URL + server SRI come from the manifest's `source` field, the bytes are SRI-verified and extracted (repo-root-relative — a drop-in for the GitHub tarball root), and no GitHub dependency exists (the parent's `repository` may be absent or private). If archive fetch fails or its SRI mismatches, the import falls back to the chain-resolved GitHub coordinate with a `Note:`. When the manifest records no `source`, GitHub remains the source: a recorded `git sha` pins the exact deployed commit; otherwise the import falls back to the **default branch (HEAD)** with a `Note:` line. The report's Source section shows both layers: the `bos:// …` extends ref, the source archive URL when used, and the dereferenced `repository @ ref`.
|
|
211
|
+
|
|
212
|
+
### Classification
|
|
213
|
+
|
|
214
|
+
Each file shared between the local workspace and the upstream subtree is classified against a baseline: `.bos/import-snapshot.json` (written by previous imports), falling back to `.bos/sync-snapshot.json`.
|
|
215
|
+
|
|
216
|
+
| Bucket | Meaning | Action |
|
|
217
|
+
|---|---|---|
|
|
218
|
+
| added | upstream-only | written |
|
|
219
|
+
| unchanged | identical content | nothing (baseline recorded) |
|
|
220
|
+
| updated | local matches baseline, upstream moved | overwritten with upstream (backed up first) |
|
|
221
|
+
| preserved-local | local-only, upstream lacks it | never deleted |
|
|
222
|
+
| preserved-local-edit | upstream matches baseline, local edited | local wins, untouched |
|
|
223
|
+
| merged | diverged `package.json` | structured merge — template wins shared keys, local-only keys and deps preserved |
|
|
224
|
+
| conflict | both changed since baseline, or no baseline exists | gated |
|
|
225
|
+
|
|
226
|
+
Local-only files are never deleted, even when upstream no longer carries them.
|
|
227
|
+
|
|
228
|
+
### Gating
|
|
229
|
+
|
|
230
|
+
Conflicts — and a migration chain that cannot be applied verbatim (next section) — gate the import:
|
|
231
|
+
|
|
232
|
+
- **Non-TTY without `--yes`:** nothing is written, the report is emitted, exit 1. `--yes` applies upstream over conflicting files (local copies backed up to `.bos/import-backup/<timestamp>/`) and proceeds.
|
|
233
|
+
- **TTY:** an interactive confirm (default No; declining exits 1).
|
|
234
|
+
|
|
235
|
+
A diverged `package.json` is never a conflict when both sides parse — it merges instead.
|
|
236
|
+
|
|
237
|
+
### Migration chain reconciliation
|
|
238
|
+
|
|
239
|
+
When both sides have `src/db/migrations/` journals, the chain is **reconciled** instead of overwritten:
|
|
240
|
+
|
|
241
|
+
- **Applied entries win.** Every local journal entry is presumed applied to the database and is kept verbatim — never renumbered or rehashed.
|
|
242
|
+
- **Colliding upstream migrations are renumbered and appended.** An upstream entry that shares an idx or lands below the local tail but is not present locally is renumbered after the local tail in upstream order: upstream `0011_team-member-role` with a local tail at idx 12 becomes `0013_team-member-role`. The `.sql` file is copied to the new name, `meta/<idx>_snapshot.json` is renamed to match, and the migration journal under `meta` (`_journal.json`) is rebuilt (local entries verbatim + appended entries carrying upstream's `when`/`version`).
|
|
243
|
+
- **Content matching keeps repeat imports convergent.** An upstream entry whose SQL content hash matches a local entry (e.g. one imported under a renumbered tag earlier) is treated as already imported — nothing is appended twice.
|
|
244
|
+
- **Report.** The import report and console output show the kept set (applied), the appended set (`fromTag → toTag`, new idx), and what the next boot will apply versus what is already applied. Renamed snapshots record upstream intermediate schema states — review `drizzle-kit generate` output against the merged chain before generating new migrations.
|
|
245
|
+
- **Held back.** Only unresolvable drift holds the chain now: a shared tag whose SQL content differs locally (already-applied hashes would drift), or an unreadable journal. Held chain files are not written; the rest of the workspace imports normally. A held chain gates the run even when no other file conflicts.
|
|
246
|
+
|
|
247
|
+
### Route-set delta
|
|
248
|
+
|
|
249
|
+
Both sides' contract surface is scanned for literal `.route({ method, path })` pairs — the monolithic `<workspace>/src/contract.ts` plus any split `<workspace>/src/contract/**` files, unioned per side (so a monolithic local contract compares correctly against a re-export + split-file upstream). The report lists ours-only and theirs-only `METHOD path` routes so API drift is visible before you port local routes onto the new upstream contract.
|
|
250
|
+
|
|
251
|
+
### Report and baselines
|
|
252
|
+
|
|
253
|
+
Every run — dry-run, refused, or applied — writes `.bos/import-report.md`: summary table, conflict checklist with reasons and held markers, the migration-chain reconciliation plan (kept/appended/held), route delta, bucket lists, and next steps. Written and unchanged files are recorded to `.bos/import-snapshot.json` (and merged into `.bos/sync-snapshot.json` when one exists) so the next import detects drift instead of starting from zero.
|
|
254
|
+
|
|
185
255
|
## bos publish
|
|
186
256
|
|
|
187
257
|
See `everything-dev#publish-sync` for the full publish workflow. A quick reference:
|
|
@@ -206,6 +276,8 @@ Unknown keys go after known keys. See `everything-dev#extends-config` for full o
|
|
|
206
276
|
|
|
207
277
|
**"Sync reports conflicted files."** Your local edits diverged from the snapshot; upgrade applies the template version and leaves your copy in `.bos/sync-backup/` — diff and merge back, or `bos sync --force` deliberately.
|
|
208
278
|
|
|
279
|
+
**"Import a workspace from the base platform."** `bos import <workspace> --dry-run` (defaults to the extends chain; or `--from <owner/repo>` for an explicit upstream) first, read `.bos/import-report.md` for the conflict/migration/route picture, then real-run: plain invoke prompts in a TTY, `--yes` applies upstream over conflicts (backed up), and a flagged migration chain stays held until reconciliation.
|
|
280
|
+
|
|
209
281
|
**"Upgrade framework packages."** `bos upgrade --dry-run` first, then `bos upgrade` — it bumps the root catalog, rewrites workspace refs to `catalog:`, syncs the template, and rewrites legacy imports.
|
|
210
282
|
|
|
211
283
|
## What comes back when it refuses
|
|
@@ -214,5 +286,6 @@ Unknown keys go after known keys. See `everything-dev#extends-config` for full o
|
|
|
214
286
|
|---|---|
|
|
215
287
|
| file listed as `conflicted` in sync results | local file modified since the snapshot AND the template changed — take the template version (your copy is backed up at `.bos/sync-backup/`) or re-apply your change on top |
|
|
216
288
|
| sync keeps skipping my file | app-owned files that diverged from the snapshot are skipped without `--force`; framework-owned files always update when the template changes |
|
|
289
|
+
| import exits 1 listing files | unresolvable conflicts (or a held migration chain) — read `.bos/import-report.md`, then re-run with `--yes` to apply upstream (local copies land in `.bos/import-backup/`), or port local changes manually first |
|
|
217
290
|
| `Circular extends detected while resolving upgrade source` | the upgrade source's extends chain loops — resolve from a non-cyclic parent |
|
|
218
291
|
| init copies fewer files than expected | `buildInitPatterns` filters to the selected plugins + their routes; pass `--overrides ui,api,host` to widen the scaffold |
|
|
@@ -36,19 +36,46 @@ There is no network parameter anywhere — the origin is the choice.
|
|
|
36
36
|
|
|
37
37
|
## Authentication
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Every API surface — `/api/*` (REST), `/api/rpc/*` (oRPC RPC), and `/api/mcp`
|
|
40
|
+
(MCP) — requires a session or an API key. Anonymous requests get `401` with a
|
|
41
|
+
`WWW-Authenticate` hint (this includes MCP `tools/list`: the tool catalog is
|
|
42
|
+
not disclosed to unauthenticated callers). Use an **API key**:
|
|
43
|
+
|
|
44
|
+
**Path A — create one in the app UI.**
|
|
40
45
|
|
|
41
46
|
1. Sign in with your NEAR wallet (SIWN) at the app.
|
|
42
47
|
2. Navigate to **Settings → API Keys** at `/settings/api-keys`.
|
|
43
48
|
3. Create a new key — the full secret (`api_...`) is shown once, copy it immediately.
|
|
44
|
-
|
|
49
|
+
|
|
50
|
+
**Path B — no UI needed: `bos login`** (for CLI sessions and agents with a
|
|
51
|
+
browser available):
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
bos login
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Opens a browser, you approve once (NEAR SIWN), and the CLI persists a
|
|
58
|
+
device-named API key in `.bos/session.json` (gitignored, 0600). Same key, same
|
|
59
|
+
header — pass it on every request:
|
|
45
60
|
|
|
46
61
|
```
|
|
47
62
|
x-api-key: api_your_key_here
|
|
48
63
|
```
|
|
49
64
|
|
|
50
|
-
|
|
51
|
-
(
|
|
65
|
+
Keys carry optional permissions; a call outside them refuses with 403. Keys
|
|
66
|
+
expire (90 days by default) and are revocable at `/settings/api-keys` —
|
|
67
|
+
re-run `bos login` (or create a fresh key in the UI) when a key dies.
|
|
68
|
+
|
|
69
|
+
**Other credentials:**
|
|
70
|
+
|
|
71
|
+
- `bos login --key` mints a publish-scoped function-call access key
|
|
72
|
+
(`~/.near-credentials`) for the publish path — not an API-key replacement.
|
|
73
|
+
- Device-link session tokens (`POST /device/token` +
|
|
74
|
+
`POST /device-link/claim`, one-time hashed claim) yield a real Better Auth
|
|
75
|
+
session that also passes the gate — cookie transport, no revocation UI.
|
|
76
|
+
For MCP and agent work, prefer the API key.
|
|
77
|
+
- For CI or a browser-less agent: create a key once (UI or `bos login` from a
|
|
78
|
+
machine with a browser) and pass it as `x-api-key` in the pipeline.
|
|
52
79
|
|
|
53
80
|
## MCP
|
|
54
81
|
|
|
@@ -128,7 +155,7 @@ with write permission.
|
|
|
128
155
|
|
|
129
156
|
| status | do |
|
|
130
157
|
|---|---|
|
|
131
|
-
| `401` | no
|
|
158
|
+
| `401` | no key sent, a bad/revoked key, or an anonymous caller — if you have a key, check the `x-api-key` header reached the request; if not, get one (Paths A/B above); MCP `tools/list` is also gated |
|
|
132
159
|
| `403` | the key lacks permission — the owner edits the key's permissions; do not retry unchanged |
|
|
133
160
|
| `404` | wrong surface or path — re-check `/api/spec.json`; plugin RPC mounts are `/api/rpc/<pluginKey>` |
|
|
134
161
|
| `429` | rate limited — wait as the response says, then once more |
|