@dadado/agent-kit-cli 6.28.0 → 6.30.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/cursor-audit/cursor-3-features.md +57 -0
- package/cursor-audit/cursor-native-audit.md +292 -0
- package/dashboard/lib/guards.d.mts +16 -5
- package/dashboard/lib/guards.mjs +55 -7
- package/dashboard/serve.mjs +1 -0
- package/dashboard/start.mjs +8 -1
- package/dist/{add-WILYTGO7.js → add-CMQ3S2GH.js} +3 -3
- package/dist/build-stamp.json +2 -2
- package/dist/{chunk-TI7BX6JV.js → chunk-2JKKO7FF.js} +4 -4
- package/dist/{chunk-CHYROVQB.js → chunk-2PKJOMTI.js} +1 -1
- package/dist/{chunk-BDTB7AUO.js → chunk-37INM5QP.js} +3 -3
- package/dist/{chunk-VI4UEKRN.js → chunk-7HPYWUC7.js} +4 -4
- package/dist/{chunk-I3GF72CH.js → chunk-BM5RR7LT.js} +3 -2
- package/dist/{chunk-KXC6NCX2.js → chunk-CY4TDI4S.js} +9 -9
- package/dist/{chunk-Y575INEC.js → chunk-DA5VLMNL.js} +1 -1
- package/dist/{chunk-SOSU22LZ.js → chunk-DQD6KPWJ.js} +1 -1
- package/dist/{chunk-WMMFTZ6O.js → chunk-EJJET3CA.js} +6 -1
- package/dist/{chunk-RHP44DQQ.js → chunk-GSVUCEMH.js} +3 -1
- package/dist/{chunk-43JHKSN4.js → chunk-GSZ2WZYY.js} +2 -2
- package/dist/{chunk-KWQEY6OG.js → chunk-HO7VEYAD.js} +1 -1
- package/dist/{chunk-RX2ZWBQM.js → chunk-KNEVGAOO.js} +3 -3
- package/dist/{chunk-PIL4G5SI.js → chunk-N7L4ARYK.js} +1 -1
- package/dist/{chunk-XSNKZM3M.js → chunk-O3OEYLXW.js} +10 -10
- package/dist/{chunk-MCH3E46V.js → chunk-RPJA7Q2F.js} +94 -35
- package/dist/{chunk-5EJHIT2K.js → chunk-SXMGHRLU.js} +2 -2
- package/dist/{chunk-YFRG3CMS.js → chunk-SZMIKKSA.js} +1 -1
- package/dist/{commands-6LJACZME.js → commands-WGCC5YOR.js} +2 -2
- package/dist/{contribute-SGMAG35M.js → contribute-E5HOW57P.js} +4 -4
- package/dist/{cursor-awareness-TN5JXD2C.js → cursor-awareness-ANT44WHK.js} +1 -1
- package/dist/{dashboard-6V6PCNYF.js → dashboard-3RBOYKZW.js} +1 -1
- package/dist/{dashboard-broadcast-PMVQ7PXU.js → dashboard-broadcast-K3PAGFBO.js} +1 -1
- package/dist/{diff-WPNZDMB2.js → diff-D3S7D6RK.js} +5 -5
- package/dist/{doctor-SW42AH5D.js → doctor-QAWK3NHG.js} +9 -9
- package/dist/{dogfood-2JAHSYQA.js → dogfood-2SYGZFTJ.js} +49 -2
- package/dist/{engine-info-VM4VPGQM.js → engine-info-OTYCQUQB.js} +1 -1
- package/dist/{guard-CH4A7QIZ.js → guard-SSDUD7CH.js} +1 -1
- package/dist/{hook-ASKMJGBB.js → hook-DKX7CH6S.js} +8 -8
- package/dist/index.js +24 -24
- package/dist/{init-IJ53YMKS.js → init-ZQ56SONI.js} +13 -13
- package/dist/{install-BHOMUS2G.js → install-FY7337TL.js} +13 -13
- package/dist/{mission-control-IGOI3WHS.js → mission-control-3D46DA2Z.js} +2 -2
- package/dist/{paths-PSG64N6P.js → paths-YV6O6JFK.js} +2 -2
- package/dist/{promote-H5MIMVEB.js → promote-MAQ44EMD.js} +100 -9
- package/dist/{run-RGIY5JTX.js → run-2MN2HRUC.js} +3 -3
- package/dist/{run-plan-DHB3ZXJS.js → run-plan-MYAVTBY4.js} +3 -3
- package/dist/{session-start-RWPMRY6N.js → session-start-WNVFNJFF.js} +8 -8
- package/dist/{sessions-4IDYAFBL.js → sessions-OCJOE6HR.js} +1 -1
- package/dist/{setup-global-QEGG3OG2.js → setup-global-ZYLEOFLF.js} +6 -6
- package/dist/{status-A375W7ZU.js → status-6OEQTXJE.js} +6 -6
- package/dist/{update-B2I3VDIG.js → update-DJG3GR24.js} +11 -11
- package/dist/{update-all-PIEDQUGQ.js → update-all-TSF6GZFZ.js} +11 -11
- package/package.json +4 -3
- /package/dist/{chunk-LEVNLHH3.js → chunk-7Z2E2PWM.js} +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Cursor Native Features - How Mission Kit Uses Them
|
|
2
|
+
|
|
3
|
+
Mission Kit helps develop without losing context and uses native Cursor features as **complement**, not replacement. Install and CLI identifiers stay Agent Kit (`agent-kit`, `@dadado/agent-kit-cli`).
|
|
4
|
+
|
|
5
|
+
## Mission Kit position
|
|
6
|
+
|
|
7
|
+
File-based handoff (`.cursor/HANDOFF.md`) is the **source of truth** for continuity. No IDE guarantees infinite memory; context limits are real, and new sessions start from zero. That's why Mission Kit maintains state on disk: structured plans, progress, and suggested routines.
|
|
8
|
+
|
|
9
|
+
## Native features and how to use them
|
|
10
|
+
|
|
11
|
+
| Feature | What it does | How Mission Kit uses it |
|
|
12
|
+
|---------|-----------|----------------------|
|
|
13
|
+
| `/resume` | Resume previous conversation | Complement to HANDOFF - good for quick reference, doesn't replace file state |
|
|
14
|
+
| Summaries | Automatic summary of long sessions | Useful for revisiting decisions; handoff remains mandatory |
|
|
15
|
+
| Transcripts / @mentions | Search in previous chats | Cross-reference; doesn't replace plan with todos |
|
|
16
|
+
| Agents Window | Multiple agents in parallel | Each agent reads HANDOFF before acting; shared state is in file |
|
|
17
|
+
| `/worktree` | Isolated git worktree | For risky changes without dirtying the working tree |
|
|
18
|
+
| `/best-of-n` | Compare approaches side by side | For architecture decisions |
|
|
19
|
+
| Plans (Plan Mode) | Native Cursor plans in the host UI | Kit `.cursor/plans/*.plan.md` stay SoT for Gate A/B. Host Plan Mode does not replace those gates. If a native plan already exists, copy it into `.cursor/plans/` then run Gate A (ADR `2026-09-15_kit-plans-sot-over-host-plan-mode.md`). HANDOFF names the active kit plan. |
|
|
20
|
+
| Projects (beta, 2026-09-10) | Cloud-hosted coordinator agent that plans and delegates to implementing subagents, keeps synced project files across cloud/local machines, and can watch a Slack channel, run on a schedule, or follow PRs | No kit integration; Cursor-native surface the operator may use directly. ADR `2026-09-12_cursor-projects-thin-adapter.md`: no structural change. HANDOFF/plans stay the continuity SoT, `BackendId` stays `cursor-agent`/`claude` only, Mission Control stays local-only/copy-only, hooks stay thin adapters. |
|
|
21
|
+
| Custom modes | Pin a skill as an always-on chat mode | Cursor-native. Kit `agentPersona` stays chat chrome only. |
|
|
22
|
+
| `/goal` | Long-lived native objective until complete | Does not replace kit plan to-dos, Gate A/B, or `/run-plan`. |
|
|
23
|
+
| `/loop` | Recurring native check-ins | Distinct from kit `/run-plan` ticks. No kit `/loop` slash. |
|
|
24
|
+
| Steering | Follow-up waits for the next tool call (Send now / double Enter) | IDE input UX. No kit hook. |
|
|
25
|
+
| Origin | Origin Code Hosting / Origin Repos: Bring your GitHub repos, Pull requests, Agents in every repo, App extensions for Cursor repos. Includes start from scratch, without a repo; turn it into a real repo, whenever you want; a live preview, right in the browser; and publish your work | Not the kit git spine (`/git-staging` → staging → `/git-prod`). |
|
|
26
|
+
| Self-hosted machines | My Machines, team pools, dynamic pool scheduling, run on your sandboxes, computer use on Linux and Mac | Operator infra. Cloud Agents stay the opt-in audits reviewer only. |
|
|
27
|
+
| Subagents on their own machines | Isolated cloud VMs per subagent | Cursor cloud. Kit Task stays local IDE. |
|
|
28
|
+
| Automations | Desktop scheduled-agent UI (Cloud Agent subscriptions: PR / Slack thread / schedule) | Cursor-cloud automation. Kit scheduling was withdrawn 2026-09-10 and returned as a generic, local lane under ADR `2026-10-08_countdown-coming-home-generic-lane.md` (Accepted): one-shot `agent-kit countdown` run by your own timer, gate exit on a pushed branch (`--land-on-gate`, shipped in 6.1.0), `agent-kit ground-control` triage (`countdown` and `ground-control` in CHANGELOG `[6.2.0]`). Still no Cursor-cloud scheduling. |
|
|
29
|
+
|
|
30
|
+
## MCP, hooks and SDK
|
|
31
|
+
|
|
32
|
+
**Agent gateways parallel to Cursor are not part of the Mission Kit stack** - we don't document or version config for that.
|
|
33
|
+
|
|
34
|
+
For extensions and automation, use what Cursor itself offers:
|
|
35
|
+
|
|
36
|
+
- **MCP** - servers supported by Cursor (ex.: official integrations or documented in ecosystem; in IDE, prefer what comes enabled or project `mcp.json` for stable tools).
|
|
37
|
+
- **Hooks** - agent events in workspace (see `create-hook` skill in your Cursor installation, if applicable).
|
|
38
|
+
- **Cursor Cloud Agents / `@cursor/sdk`** - agents and flows outside the IDE. Cloud Agents and Cursor Harness improvements (subscriptions, custom modes, `/goal`, steering) stay Cursor-native. The kit uses Cloud Agents in exactly **one** place: the opt-in `externalPlanReview.backend: "cloud"` audits reviewer, driven over the Cloud Agents REST API (`https://api.cursor.com`) so the kit keeps zero runtime dependencies. See [`external-plan-review.md`](external-plan-review.md#cloud-agents-backend-backend-cloud) and ADR `2026-08-14_cursor-cloud-agents-sdk-audits-backend.md`.
|
|
39
|
+
- The SDK itself (`@cursor/sdk`, Node 22.13+; `cursor-sdk` for Python) is **not** a kit dependency. Scripting it directly outside the kit is supported and documented, not a gap: `Agent.prompt` (one-shot), `Agent.create` + `agent.send` (durable/stream), `Agent.resume` (re-attach by `bc-` id). Always set `local` or `cloud` explicitly.
|
|
40
|
+
- `CURSOR_API_KEY` is a secret: environment or gitignored `.env` only, empty placeholder in `.env.example`, never committed or logged.
|
|
41
|
+
- Kit-load (`CLAUDE.md` / `/agent-kit`), audits, and `agent-kit run-plan --backend` stay three separate surfaces. Cloud Agents are not a plan-loop tick backend.
|
|
42
|
+
|
|
43
|
+
This maintains a single source of truth for agent tools and avoids duplicating session control outside the native model.
|
|
44
|
+
|
|
45
|
+
## Practical rule
|
|
46
|
+
|
|
47
|
+
1. **Plan each task for ~50% of window** - leaves space for execution + handoff
|
|
48
|
+
2. **After each task**: record HANDOFF, update todos, suggest git staging
|
|
49
|
+
3. **New conversation**: `/continue-plan` reads HANDOFF and resumes
|
|
50
|
+
4. **Parallel agents**: each one reads HANDOFF before starting
|
|
51
|
+
|
|
52
|
+
## What NOT to trust
|
|
53
|
+
|
|
54
|
+
- **Infinite memory in same thread** - doesn't exist
|
|
55
|
+
- **Other agent knowing what you did** - contexts are separate
|
|
56
|
+
- **Automatic continuity between sessions** - summaries help but don't guarantee
|
|
57
|
+
- **`/resume` as handoff replacement** - good for remembering, not for resuming complex work
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Cursor-native audit - Agent Kit harness
|
|
2
|
+
|
|
3
|
+
Audit of Cursor-specific artifacts in the Agent Kit repository: what exists, what is missing, and how VS Code and Windsurf compare. Living audit; last refreshed **2026-09-16** (changelog keep-up: Aug 17–Sep 10 surfaces plus desktop 3.20.x classify; plugin pin 5.9.0). A6/A7 status lines re-verified true at HEAD.
|
|
4
|
+
|
|
5
|
+
**Awareness check (advisory):** `agent-kit cursor-awareness --check` and `/cursor-update-awareness` diff Cursor changelog signals against this inventory without mutating it. The check reports open Action items, a version-number delta, and a **feature-keyword digest** (changelog headings and slash commands missing from this file or `docs/cursor-3-features.md`). Version-prose and Marketplace packaging were refreshed on 2026-08-05; only the live submission stays on the Marketplace plan (publisher HITL). See [cursor-update-awareness.md](cursor-update-awareness.md).
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
|
|
9
|
+
| Area | Status | Notes |
|
|
10
|
+
|------|--------|-------|
|
|
11
|
+
| `.cursor/rules/` | Present (25 files) | 10 rules `alwaysApply: true` (8 structural + `hitl-ask-questions` + `git-secrets-safety`); stack rules use globs |
|
|
12
|
+
| `.cursor/skills/` | Present (12 `SKILL.md`) | Disk: `core/` 3 + `community/` 8 + `domain/` 1. Plugin discovery is `.cursor/skills/core` only. See Skills-on-demand |
|
|
13
|
+
| `.cursor/agents/` | Present (14 agents) | Mix of core and stack subagents; EN pack ids |
|
|
14
|
+
| `.cursor/commands/` | Present (30 commands) | DevOps spine + handoff + orchestration + backlog/dashboard + kit landing + public-issue-triage |
|
|
15
|
+
| `.cursor/hooks/` (shell) | Present | Git pre-commit + edit validators; not wired to Cursor agent events |
|
|
16
|
+
| `.cursor/hooks.json` | **Present (L0)** | 5 events (`sessionStart`, `preCompact`, `beforeShellExecution`, `afterFileEdit`, `beforeSubmitPrompt`); no `stop` hook |
|
|
17
|
+
| `.cursor-plugin/plugin.json` | Present | Marketplace-ready at **5.9.0**, aligned with `KIT_VERSION`; declares explicit component paths |
|
|
18
|
+
| Plan Mode | Absorbed (docs + HITL pointer) | Kit `.cursor/plans/*.plan.md` stay SoT. Copy a native plan, then Gate A. ADR `2026-09-15_kit-plans-sot-over-host-plan-mode.md` |
|
|
19
|
+
| Skills-on-demand | Complement (no kit loader) | Cursor loads `SKILL.md` when relevant. Kit does not wrap that loader. |
|
|
20
|
+
| `git-hooks/prepare-commit-msg` | Present | Strips coding-agent signatures and session links (Cursor, Claude Code, Copilot, peers); `--check` mode for the staging/prod gate |
|
|
21
|
+
| `AGENTS.md` (dogfood) | **Present** | Root cross-IDE contract; points at `.cursor/project-context.md` |
|
|
22
|
+
| `mcp.json` | Absent | No project-level MCP config in core |
|
|
23
|
+
| Cursor Projects (beta, 2026-09-10) | Not integrated (Cursor-native only) | Cloud coordinator + subagents, synced project files, Slack/schedule/PR subscriptions. ADR `2026-09-12_cursor-projects-thin-adapter.md`: no structural change. See [cursor-3-features.md](cursor-3-features.md) |
|
|
24
|
+
| Custom modes (2026-08-19) | Not integrated (thin-adapter) | Pin a skill as an always-on chat mode. Kit `agentPersona` stays chat chrome only. |
|
|
25
|
+
| `/goal` / `/loop` (2026-08-19) | Not integrated (thin-adapter) | Native long-lived objective and recurring check-ins. Do not replace kit plan to-dos or `/run-plan`. |
|
|
26
|
+
| Origin / start from scratch, without a repo (2026-08-17 / 2026-08-27) | Not integrated (Cursor-native only) | Origin Repos; Bring your GitHub repos; Pull requests; Agents in every repo; App extensions for Cursor repos; live preview; Vercel publish. Not the kit git spine. |
|
|
27
|
+
| Self-hosted machines (2026-09-02) | Not integrated (Cursor-native only) | My Machines, team pools, dynamic pool scheduling, run on your sandboxes, computer use on Linux and Mac. Operator infra. Cloud Agents stay audits-only. |
|
|
28
|
+
| Steering / Automations / subagents on their own machines | Not integrated (Cursor-native only) | IDE follow-up UX, scheduled-agent UI, cloud-isolated subagents. No kit hook or third `BackendId`. Kit scheduling: withdrawn 2026-09-10, returned as a generic local lane (one-shot `agent-kit countdown` on an external timer, `agent-kit ground-control` triage; CHANGELOG `[6.2.0]`) under ADR `2026-10-08_countdown-coming-home-generic-lane.md` (Accepted); still no Cursor-native scheduling integration. |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Plugin (`.cursor-plugin/`)
|
|
33
|
+
|
|
34
|
+
**File:** `.cursor-plugin/plugin.json`
|
|
35
|
+
|
|
36
|
+
| Field | Value |
|
|
37
|
+
|-------|-------|
|
|
38
|
+
| name | `agent-kit` |
|
|
39
|
+
| version | `5.9.0` (pinned to `KIT_VERSION` by `packages/cli/src/lifecycle/l0.test.ts`; verified 2026-09-15 against root `package.json`, `packages/cli/package.json`, and npm `dist-tags.latest`) |
|
|
40
|
+
| description | HITL framework for AI-assisted IDEs (plan, handoff, staging→prod, memory loop, anti-slop) |
|
|
41
|
+
| components | `rules`, `skills`, `agents`, `commands`, `hooks` declared explicitly |
|
|
42
|
+
|
|
43
|
+
**Findings:**
|
|
44
|
+
|
|
45
|
+
- Plugin manifest exists for Marketplace distribution path (install port A).
|
|
46
|
+
- Manifest is no longer metadata-only. The plugin root is the parent of `.cursor-plugin/`, and Cursor's default discovery reads `rules/`, `skills/`, `agents/`, `commands/`, `hooks/hooks.json` at that root - paths this repo does not use. Without explicit entries the plugin would list with **zero** components. Packaging contract: [marketplace.md](marketplace.md).
|
|
47
|
+
- `skills` points at `.cursor/skills/core`, not `.cursor/skills`: discovery matches direct children holding a `SKILL.md`, and `core/`/`community/` are one level too shallow. On 2026-09-15 that core tree has three skills (`clean-code`, `docs-repo`, `hitl-gates`). Community and domain stay off Marketplace discovery (`agent-kit add` / project-owned).
|
|
48
|
+
- CLI `init` does **not** write `.cursor-plugin/plugin.json` into target projects; no generator under `packages/cli/src/generator/` references it. (Corrected 2026-08-05; the earlier claim was stale.)
|
|
49
|
+
|
|
50
|
+
**Gap:** Plugin packaging and Marketplace submission flow are not documented end-to-end in `docs/getting-started.md`. See [marketplace.md](marketplace.md) and Phase B registry cutover plan. Live submission stays publisher HITL. This tree's manifest is **5.9.0**. Live Marketplace listing is publisher HITL and may lag the repo pin.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Rules - modes and coverage
|
|
55
|
+
|
|
56
|
+
**Location:** `.cursor/rules/*.mdc` (25 files)
|
|
57
|
+
|
|
58
|
+
### alwaysApply: true (core - structural)
|
|
59
|
+
|
|
60
|
+
These run on every agent turn in Cursor:
|
|
61
|
+
|
|
62
|
+
| Rule | Role |
|
|
63
|
+
|------|------|
|
|
64
|
+
| `agent-output-hygiene.mdc` | Chat ≠ repo; no meta-language in artifacts |
|
|
65
|
+
| `context-guardian.mdc` | Context window warning + handoff trigger |
|
|
66
|
+
| `cursor-plan-handoff.mdc` | Plan phases, HANDOFF.md, `/continue-plan` |
|
|
67
|
+
| `cursor-skills-general.mdc` | General coding + git flow conventions |
|
|
68
|
+
| `cursor-skills-git-workflow.mdc` | Staging → prod spine; blocks direct main |
|
|
69
|
+
| `docs-professional-standard.mdc` | Inheritable docs standard |
|
|
70
|
+
| `memory-loop.mdc` | `.cursor/memory/` errors and decisions |
|
|
71
|
+
| `ux-tone.mdc` | Chat tone only; `alwaysApply: true` (fixed 2026-07-19) |
|
|
72
|
+
| `hitl-ask-questions.mdc` | Kit-wide Ask questions; numbered fallback is path 1 |
|
|
73
|
+
| `git-secrets-safety.mdc` | Never stage `.env` or credential files |
|
|
74
|
+
|
|
75
|
+
### alwaysApply: false + globs (stack / language)
|
|
76
|
+
|
|
77
|
+
| Rule | Globs (summary) |
|
|
78
|
+
|------|-----------------|
|
|
79
|
+
| `cursor-skills-clickup.mdc` | agent-requestable only (no globs) |
|
|
80
|
+
| `cursor-skills-n8n.mdc` | n8n workflows, `*workflow*.json` |
|
|
81
|
+
| `cursor-skills-api.mdc` | api paths, OpenAPI, GraphQL |
|
|
82
|
+
| `cursor-skills-devops.mdc` | Docker, CI, k8s, Terraform |
|
|
83
|
+
| `cursor-skills-integrations.mdc` | integrations, webhooks |
|
|
84
|
+
| `cursor-skills-json.mdc` | `*.json` |
|
|
85
|
+
| `cursor-skills-mobile.mdc` | mobile paths |
|
|
86
|
+
| `cursor-skills-node.mdc` | JS/TS |
|
|
87
|
+
| `cursor-skills-php.mdc` | `*.php` |
|
|
88
|
+
| `cursor-skills-prompts.mdc` | prompt markdown |
|
|
89
|
+
| `cursor-skills-python.mdc` | `*.py` |
|
|
90
|
+
| `cursor-skills-sql.mdc` | `*.sql` |
|
|
91
|
+
| `cursor-skills-testing.mdc` | test/spec paths |
|
|
92
|
+
| `cursor-skills-webdesign.mdc` | HTML/CSS/Vue/Svelte |
|
|
93
|
+
|
|
94
|
+
### Anomalies (resolved)
|
|
95
|
+
|
|
96
|
+
| Rule | Was | Now |
|
|
97
|
+
|------|-----|-----|
|
|
98
|
+
| `ux-tone.mdc` | Missing YAML frontmatter | ✅ `alwaysApply: true` with description (2026-07-19) |
|
|
99
|
+
|
|
100
|
+
### Rule-mode compliance
|
|
101
|
+
|
|
102
|
+
- Stack/product rules (ClickUp, n8n) correctly use `alwaysApply: false` per decision `2026-07-09_structural-harness-vs-stack`.
|
|
103
|
+
- Language and stack rules (`cursor-skills-*`) are stack-on-demand via globs - acceptable for dev ergonomics; not structural core.
|
|
104
|
+
- CLI generator (`packages/cli/src/generator/cursor.ts`) produces a **minimal** rule set (3–4 files) for new projects; it does not copy the full 25-rule workspace. Intentional L0 subset; document parity gap in Phase B cutover.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Hooks - shell vs native
|
|
109
|
+
|
|
110
|
+
### Shell hooks (`.cursor/hooks/`)
|
|
111
|
+
|
|
112
|
+
| Path | Trigger | Class |
|
|
113
|
+
|------|---------|-------|
|
|
114
|
+
| `pre-commit/pre-commit` | Git pre-commit (manual install to `.git/hooks/`) | Core orchestrator |
|
|
115
|
+
| `pre-commit/check-secrets.sh` | Staged diff (added lines) | Core - security |
|
|
116
|
+
| `pre-commit/validate-all-json.sh` | Staged JSON | Core |
|
|
117
|
+
| `lib/json-validator.js` | Shared (pre-commit) | Core |
|
|
118
|
+
| `lib/n8n-checker.js` | Manual / stack skill | Stack |
|
|
119
|
+
|
|
120
|
+
**Removed:** unwired `pre-edit/validate-json.sh` and `post-edit/validate-n8n.sh` (never attached to Cursor agent events). JSON validation stays on git pre-commit; HANDOFF/plan schema is advisory via `afterFileEdit` → `agent-kit validate after-edit`.
|
|
121
|
+
|
|
122
|
+
**Install model:** Documented copy-to-`.git/hooks/pre-commit`. The CLI does not generate a pre-commit hook; the full `.cursor/hooks/pre-commit/` chain is the only secrets hook.
|
|
123
|
+
|
|
124
|
+
### Native Cursor hooks (`.cursor/hooks.json`)
|
|
125
|
+
|
|
126
|
+
**Status: present (L0).** Thin shell adapters shell out to `packages/cli` (SoT). No `python3` requirement for these events. No `stop` hook.
|
|
127
|
+
|
|
128
|
+
| Event | Adapter | CLI SoT |
|
|
129
|
+
|-------|---------|---------|
|
|
130
|
+
| `sessionStart` | `.cursor/hooks/agent/session-start.sh` | `agent-kit hook session-start` |
|
|
131
|
+
| `preCompact` | `.cursor/hooks/agent/pre-compact.sh` | `agent-kit hook pre-compact` |
|
|
132
|
+
| `beforeShellExecution` | `.cursor/hooks/agent/guard-shell.sh` | `agent-kit guard shell --json` |
|
|
133
|
+
| `afterFileEdit` | `.cursor/hooks/agent/after-edit-schema.sh` | `agent-kit validate after-edit` (advisory) |
|
|
134
|
+
| `beforeSubmitPrompt` | `.cursor/hooks/agent/secrets-prompt.sh` | `agent-kit guard prompt --json` (advisory fail-open) |
|
|
135
|
+
|
|
136
|
+
Hooks may deny or annotate only; they never speak or decide. `agent-kit doctor` reports `hooks: active | degraded`. Selection for bare `/plan-review-triage` is `agent-kit monitors --untriaged --json` (never newest-mtime-wins). ADR: `2026-07-29_cli-invariants-thin-hook-adapters`.
|
|
137
|
+
|
|
138
|
+
Shell git hooks and native hooks serve different layers: git hooks = commit time; native hooks = agent runtime.
|
|
139
|
+
|
|
140
|
+
### Repo-level git hook
|
|
141
|
+
|
|
142
|
+
| File | Purpose |
|
|
143
|
+
|------|---------|
|
|
144
|
+
| `git-hooks/prepare-commit-msg` | Remove coding-agent co-author trailers, session-link trailers and "Generated with <agent>" lines from commit messages (Cursor, Claude Code, Copilot, peers); human co-authors kept |
|
|
145
|
+
|
|
146
|
+
Separate from `.cursor/hooks/`; optional hygiene for teams that reject bot co-authorship.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Agents and commands (Cursor-native)
|
|
151
|
+
|
|
152
|
+
### Agents (`.cursor/agents/` - 14)
|
|
153
|
+
|
|
154
|
+
Cursor subagent definitions. Consumed via Task tool / Agents Window. Full classification in [coherence-inventory.md](coherence-inventory.md).
|
|
155
|
+
|
|
156
|
+
### Commands (`.cursor/commands/` - 31)
|
|
157
|
+
|
|
158
|
+
Slash commands in Cursor. Counted from `ls .cursor/commands/*.md` on 2026-09-17. Every file carries `name` + `description` frontmatter (required by the Marketplace submission checklist; `name` matches the filename slug, so nothing was renamed).
|
|
159
|
+
|
|
160
|
+
| Command | Spine |
|
|
161
|
+
|---------|-------|
|
|
162
|
+
| `/continue-plan` | Handoff resume |
|
|
163
|
+
| `/handoff` | Save HANDOFF |
|
|
164
|
+
| `/run-plan`, `/run-plan-all` | Continuous run / multi-plan queue (no `/git-prod`) |
|
|
165
|
+
| `/run-plan-loop`, `/run-plan-orchestrated` | Deprecated aliases forcing one strategy |
|
|
166
|
+
| `/git-staging`, `/git-prod` | DevOps spine |
|
|
167
|
+
| `/kit-staging`, `/kit-prod` | Factory files; not consumer L0. Landing wrap of native git |
|
|
168
|
+
| `/start-project`, `/agent-kit-onboard`, `/hotfix` | Bootstrap and narrow-change entry |
|
|
169
|
+
| `/backlog-add`, `/backlog-edit`, `/backlog-cancel`, `/backlog-delete`, `/archive-plan` | Plan queue management |
|
|
170
|
+
| `/plan-external-review`, `/plan-review-triage`, `/field-report-resolve` | Audits and residual triage |
|
|
171
|
+
| `/dashboard`, `/dashboard-broadcast` | Mission Control |
|
|
172
|
+
| `/context-status`, `/update`, `/cursor-update-awareness`, `/dogfood`, `/qa` | Lifecycle, awareness, and release/bug claim verification |
|
|
173
|
+
| `/public-issue-triage` | Public issue intake |
|
|
174
|
+
| `/summary`, `/tips` | UX helpers |
|
|
175
|
+
|
|
176
|
+
Commands are **Cursor-only**. VS Code/Windsurf have no equivalent slash-command files; parity relies on `AGENTS.md` and IDE-specific instruction files.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Plan Mode (host vs kit plans)
|
|
181
|
+
|
|
182
|
+
Cursor Plan Mode can hold a native plan in the host UI. That document is not Gate A.
|
|
183
|
+
|
|
184
|
+
| Rule | Behavior |
|
|
185
|
+
|------|----------|
|
|
186
|
+
| SoT | Kit `.cursor/plans/*.plan.md` (frontmatter to-dos) plus HANDOFF machine fields |
|
|
187
|
+
| Host Plan Mode | Does not replace Gate A or Gate B |
|
|
188
|
+
| Already in Plan Mode | Copy the native plan into `.cursor/plans/` as kit-shaped markdown, then run Gate A |
|
|
189
|
+
| L0 size | Pointers live in hitl-gates and `/start-project`. `/run-plan` procedure stays under 80 lines |
|
|
190
|
+
|
|
191
|
+
ADR: `2026-09-15_kit-plans-sot-over-host-plan-mode.md`. Do not reopen superseded Mission Control protocol-open (`2026-07-24_mission-control-cursor-native-open.md`) or the Projects thin-adapter (`2026-09-12_cursor-projects-thin-adapter.md`).
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Skills-on-demand
|
|
196
|
+
|
|
197
|
+
Cursor loads Agent Skills when a `SKILL.md` is in a discovered skills path and the turn matches. The kit does not wrap or replace that loader.
|
|
198
|
+
|
|
199
|
+
| Tree | Count (2026-09-15) | How it ships |
|
|
200
|
+
|------|--------------------|--------------|
|
|
201
|
+
| `.cursor/skills/core/` | 3 (`clean-code`, `docs-repo`, `hitl-gates`) | L0 overlay. Plugin `skills` points here |
|
|
202
|
+
| `.cursor/skills/community/` | 8 | `agent-kit add` |
|
|
203
|
+
| `.cursor/skills/domain/` | 1 (`llm-security-ops`) | Project-owned; not contributeable upstream |
|
|
204
|
+
| Manifest `skills[]` | 9 ids | Install index. Does not list L0 `hitl-gates` or domain `llm-security-ops` |
|
|
205
|
+
|
|
206
|
+
Total `SKILL.md` files on disk: 12. Registry `core/` used to be two skills; `hitl-gates` is the third (L0, 2026-09-15).
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## CLI generators - multi-IDE parity
|
|
211
|
+
|
|
212
|
+
**Entry:** `packages/cli/src/generator/personalization.ts` (`applyPersonalization`, called by `install`)
|
|
213
|
+
|
|
214
|
+
| IDE | Generator | Artifacts | Parity vs Cursor workspace |
|
|
215
|
+
|-----|-----------|-----------|----------------------------|
|
|
216
|
+
| Cursor | `cursor.ts` | `.cursor/rules/` (3–4 rules), optional agent, `/agent-kit-status` | Low - subset only |
|
|
217
|
+
| VS Code | `vscode.ts` | `.vscode/settings.json`, `.github/copilot-instructions.md`, optional `.agent.md` | Low - no handoff commands, no hooks |
|
|
218
|
+
| Windsurf | `windsurf.ts` | `.windsurfrules` (short bullet list) | Minimal |
|
|
219
|
+
| Cross-IDE | `personalization.ts` | `AGENTS.md` | Medium - flow summary, no full rule corpus |
|
|
220
|
+
|
|
221
|
+
**Templates:** `templates/cursor/`, `templates/vscode/`, `templates/windsurf/` - README stubs only; generators inline strings, not template files.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## VS Code - gaps
|
|
226
|
+
|
|
227
|
+
| Cursor capability | VS Code equivalent | Agent Kit today |
|
|
228
|
+
|-------------------|-------------------|-----------------|
|
|
229
|
+
| `.cursor/rules/*.mdc` | Copilot instructions, `.github/copilot-instructions.md` | Generated minimal copilot-instructions |
|
|
230
|
+
| Slash commands | None native | Not portable - document manual prompts |
|
|
231
|
+
| Subagents / Task | Copilot custom agents (`.agent.md`, Pro) | One optional `security-review.agent.md` |
|
|
232
|
+
| HANDOFF + plans | `AGENTS.md` + repo files | Generated `AGENTS.md` only |
|
|
233
|
+
| Native hooks | None | N/A |
|
|
234
|
+
| MCP | VS Code MCP (when supported) | Not generated |
|
|
235
|
+
| `/worktree`, `/best-of-n` | N/A | Mentioned in generated AGENTS.md (Cursor-centric) |
|
|
236
|
+
|
|
237
|
+
**Gap priority:** Expand `AGENTS.md` generator with handoff spine and git flow; add Windsurf/VS Code docs mirroring `docs/cursor-3-features.md`.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Windsurf - gaps
|
|
242
|
+
|
|
243
|
+
| Cursor capability | Windsurf equivalent | Agent Kit today |
|
|
244
|
+
|-------------------|---------------------|-----------------|
|
|
245
|
+
| Rules | `.windsurfrules` | Short generated file |
|
|
246
|
+
| Cascade modes | Windsurf-native | Not referenced in generator |
|
|
247
|
+
| Commands / agents | Limited | Not generated |
|
|
248
|
+
| HANDOFF | File-based (works) | Same as any IDE if user follows docs |
|
|
249
|
+
|
|
250
|
+
**Gap priority:** `.windsurfrules` should include handoff + git spine bullets; link to `AGENTS.md` for shared context.
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Dogfood gaps (this repository)
|
|
255
|
+
|
|
256
|
+
The Agent Kit repo uses the full Cursor workspace and **does**:
|
|
257
|
+
|
|
258
|
+
1. Version `.cursor/hooks.json` (`sessionStart` / `preCompact`)
|
|
259
|
+
2. Include root `AGENTS.md` (cross-IDE contract)
|
|
260
|
+
|
|
261
|
+
Still open dogfood gaps:
|
|
262
|
+
|
|
263
|
+
1. Auto-install git hooks on clone (documented manual copy)
|
|
264
|
+
2. Ship `mcp.json` for optional MCP servers
|
|
265
|
+
|
|
266
|
+
Acceptable for private SoT until Phase B registry cutover defines minimum dogfood before public sync.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Action items
|
|
271
|
+
|
|
272
|
+
| ID | Status | Action |
|
|
273
|
+
|----|--------|--------|
|
|
274
|
+
| A1 | ✅ Done | Fix `ux-tone.mdc` frontmatter |
|
|
275
|
+
| A2 | ✅ Done | Refresh [coherence-inventory.md](coherence-inventory.md) + [drift-inventory.md](drift-inventory.md) (2026-07-19) |
|
|
276
|
+
| A3 | ✅ Done | `.cursor/hooks.json` + agent scripts (`sessionStart` / `preCompact`) |
|
|
277
|
+
| A4 | ✅ Done | Factory tracked `git-hooks/pre-commit` chains main-guard first, then `.cursor/hooks/pre-commit/` JSON + secrets (`validate-all-json.sh` then `check-secrets.sh`) via `git rev-parse --show-toplevel`. Consumer clones without that directory still get the main-guard. Alternate Cursor-native copy lacks the main-guard. CLI generator still skips if a hook exists. Install/reinstall remains HITL. |
|
|
278
|
+
| A5 | ✅ Done | Root `AGENTS.md` present (dogfood cross-IDE contract) |
|
|
279
|
+
| A6 | Partial | Marketplace plugin path documented ([marketplace.md](marketplace.md) packaging contract, 2026-08-05); VS Code/Windsurf install still open |
|
|
280
|
+
| A7 | Open | Expand generators or template files for multi-IDE parity (scoped: Windsurf `.windsurfrules` handoff/git bullets + VS Code instruction parity with [cursor-3-features.md](cursor-3-features.md); not Marketplace submit). Claude CLI session kit-load (`CLAUDE.md` / `/agent-kit`) is a separate surface: [claude-cli-kit-load.md](claude-cli-kit-load.md). |
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## References
|
|
285
|
+
|
|
286
|
+
- [Cursor Native Features](cursor-3-features.md)
|
|
287
|
+
- [Cursor update awareness](cursor-update-awareness.md)
|
|
288
|
+
- [Coherence inventory](coherence-inventory.md)
|
|
289
|
+
- ADR `2026-09-12_cursor-projects-thin-adapter.md` (Cursor Projects study)
|
|
290
|
+
- Plan Mode vs kit plans: ADR `2026-09-15_kit-plans-sot-over-host-plan-mode.md`
|
|
291
|
+
- Mission Control protocol-open (superseded, do not reopen): ADR `2026-07-24_mission-control-cursor-native-open.md`
|
|
292
|
+
- Decision: structural harness vs stack (maintainers' decision log, private repo)
|
|
@@ -16,6 +16,7 @@ type GitStatusFile = {
|
|
|
16
16
|
|
|
17
17
|
export const DEFAULT_HOST: "127.0.0.1";
|
|
18
18
|
export const BROADCAST_TOKEN_ENV: "MISSION_CONTROL_TOKEN";
|
|
19
|
+
export const EDITOR_FORWARD_ENV: "MISSION_CONTROL_EDITOR_FORWARD";
|
|
19
20
|
export const REPO_ROOT_ENV: "MISSION_CONTROL_REPO_ROOT";
|
|
20
21
|
export const KIT_ROOT_ENV_KEYS: readonly ["MISSION_CONTROL_KIT_ROOT", "AGENT_KIT_HOME"];
|
|
21
22
|
export const BROADCAST_TOKEN_MIN_LEN: 16;
|
|
@@ -112,10 +113,15 @@ export function normalizeAuthToken(raw: unknown): string;
|
|
|
112
113
|
export function isValidBroadcastToken(token: unknown): boolean;
|
|
113
114
|
export function generateBroadcastToken(): string;
|
|
114
115
|
export function tokensMatch(a: unknown, b: unknown): boolean;
|
|
115
|
-
export function resolveBroadcastAuth(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
export function resolveBroadcastAuth(env?: ProcessEnvLike):
|
|
117
|
+
| {
|
|
118
|
+
ok: true;
|
|
119
|
+
host: string;
|
|
120
|
+
tokenRequired: boolean;
|
|
121
|
+
token: string | null;
|
|
122
|
+
broadcast: boolean;
|
|
123
|
+
editorForward: boolean;
|
|
124
|
+
}
|
|
119
125
|
| { ok: false; error: string };
|
|
120
126
|
export function extractRequestToken(req: GuardRequest, url: URL): string;
|
|
121
127
|
export function authorizeMissionControlRequest(
|
|
@@ -152,7 +158,12 @@ export function isAllowedOrigin(origin: unknown, port: unknown): boolean;
|
|
|
152
158
|
export function isAllowedHostHeader(
|
|
153
159
|
hostHeader: unknown,
|
|
154
160
|
port: unknown,
|
|
155
|
-
opts?: {
|
|
161
|
+
opts?: {
|
|
162
|
+
broadcast?: boolean;
|
|
163
|
+
editorForward?: boolean;
|
|
164
|
+
lanAddresses?: string[];
|
|
165
|
+
bindHost?: string;
|
|
166
|
+
},
|
|
156
167
|
): boolean;
|
|
157
168
|
export function applyCorsHeaders(
|
|
158
169
|
req: GuardRequest,
|
package/dashboard/lib/guards.mjs
CHANGED
|
@@ -8,6 +8,16 @@ import { resolve } from "node:path";
|
|
|
8
8
|
export const DEFAULT_HOST = "127.0.0.1";
|
|
9
9
|
/** Env key for the opt-in LAN broadcast session token. */
|
|
10
10
|
export const BROADCAST_TOKEN_ENV = "MISSION_CONTROL_TOKEN";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Opt-in editor-forward mode (ADR 2026-11-20_mission-control-cursor-extension-host,
|
|
14
|
+
* accepted 2026-11-29; local-only ADR amend 2026-11-26). Set only by the Cursor
|
|
15
|
+
* side panel extension's starter env and valid only with a loopback bind:
|
|
16
|
+
* the Host guard accepts a loopback-literal hostname on any port (the editor's
|
|
17
|
+
* asExternalUri forward may land on a different local port) and a session
|
|
18
|
+
* token becomes required on loopback. Everything else stays as it is.
|
|
19
|
+
*/
|
|
20
|
+
export const EDITOR_FORWARD_ENV = "MISSION_CONTROL_EDITOR_FORWARD";
|
|
11
21
|
/**
|
|
12
22
|
* Env key for the repo whose `.cursor/`, git, and plans Mission Control snapshots.
|
|
13
23
|
* Static assets still load from the kit tree that contains `dashboard/`.
|
|
@@ -400,25 +410,52 @@ export function tokensMatch(a, b) {
|
|
|
400
410
|
/**
|
|
401
411
|
* Resolve bind + token gate for Mission Control serve.
|
|
402
412
|
* Non-loopback bind requires a valid MISSION_CONTROL_TOKEN (no warn-only 0.0.0.0).
|
|
413
|
+
* Editor-forward mode (MISSION_CONTROL_EDITOR_FORWARD=1) is valid only with a
|
|
414
|
+
* loopback bind and makes the session token required on loopback: through the
|
|
415
|
+
* editor's forward every request arrives from 127.0.0.1, so a loopback socket
|
|
416
|
+
* stops identifying the operator (ADR 2026-11-20 point 4).
|
|
403
417
|
* @param {NodeJS.ProcessEnv | Record<string, string | undefined> | undefined} env - `undefined` falls back to `process.env`
|
|
404
418
|
* @returns
|
|
405
|
-
* | { ok: true, host: string, tokenRequired: boolean, token: string | null, broadcast: boolean }
|
|
419
|
+
* | { ok: true, host: string, tokenRequired: boolean, token: string | null, broadcast: boolean, editorForward: boolean }
|
|
406
420
|
* | { ok: false, error: string }
|
|
407
421
|
*/
|
|
408
422
|
export function resolveBroadcastAuth(env = process.env) {
|
|
409
423
|
const host = resolveBindHost(env?.HOST);
|
|
410
424
|
const loopback = isLoopbackBindHost(host);
|
|
411
425
|
const token = normalizeAuthToken(env?.[BROADCAST_TOKEN_ENV]);
|
|
426
|
+
const editorForward = env?.[EDITOR_FORWARD_ENV] === "1";
|
|
412
427
|
if (!loopback) {
|
|
428
|
+
if (editorForward) {
|
|
429
|
+
return {
|
|
430
|
+
ok: false,
|
|
431
|
+
error: `${EDITOR_FORWARD_ENV} requires a loopback bind (got ${host}); it only covers the editor's own asExternalUri forward.`,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
413
434
|
if (!isValidBroadcastToken(token)) {
|
|
414
435
|
return {
|
|
415
436
|
ok: false,
|
|
416
437
|
error: `Non-loopback bind (${host}) requires ${BROADCAST_TOKEN_ENV} (min ${BROADCAST_TOKEN_MIN_LEN} chars). Use /dashboard-broadcast or agent-kit dashboard-broadcast.`,
|
|
417
438
|
};
|
|
418
439
|
}
|
|
419
|
-
return { ok: true, host, tokenRequired: true, token, broadcast: true };
|
|
440
|
+
return { ok: true, host, tokenRequired: true, token, broadcast: true, editorForward: false };
|
|
420
441
|
}
|
|
421
|
-
|
|
442
|
+
if (editorForward) {
|
|
443
|
+
if (!isValidBroadcastToken(token)) {
|
|
444
|
+
return {
|
|
445
|
+
ok: false,
|
|
446
|
+
error: `Loopback bind with ${EDITOR_FORWARD_ENV}=1 requires ${BROADCAST_TOKEN_ENV} (min ${BROADCAST_TOKEN_MIN_LEN} chars); through the editor's forward a loopback socket no longer identifies the operator.`,
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
return { ok: true, host, tokenRequired: true, token, broadcast: false, editorForward: true };
|
|
450
|
+
}
|
|
451
|
+
return {
|
|
452
|
+
ok: true,
|
|
453
|
+
host,
|
|
454
|
+
tokenRequired: false,
|
|
455
|
+
token: null,
|
|
456
|
+
broadcast: false,
|
|
457
|
+
editorForward: false,
|
|
458
|
+
};
|
|
422
459
|
}
|
|
423
460
|
|
|
424
461
|
/**
|
|
@@ -1385,9 +1422,15 @@ export function isAllowedOrigin(origin, port) {
|
|
|
1385
1422
|
* loopback literal (`localhost`, `127.0.0.1`, `[::1]`) on `port`. In broadcast
|
|
1386
1423
|
* mode a LAN IPv4 literal of this machine (or the IPv4 bind host) on `port` is
|
|
1387
1424
|
* accepted too. A hostname that merely resolves here (rebinding) never is.
|
|
1425
|
+
* In editor-forward mode (ADR 2026-11-20 point 4, accepted 2026-11-29) the
|
|
1426
|
+
* loopback literals are accepted on any port, because the editor's
|
|
1427
|
+
* asExternalUri forward may land on a different local port; a hostname that is
|
|
1428
|
+
* not a loopback literal still answers 421, so the DNS-rebinding defence
|
|
1429
|
+
* (which rests on the name) holds. The token gate (tokenRequired on loopback
|
|
1430
|
+
* in that mode) covers the rest.
|
|
1388
1431
|
* @param {unknown} hostHeader
|
|
1389
1432
|
* @param {unknown} port
|
|
1390
|
-
* @param {{ broadcast?: boolean, lanAddresses?: string[], bindHost?: string }} [opts]
|
|
1433
|
+
* @param {{ broadcast?: boolean, editorForward?: boolean, lanAddresses?: string[], bindHost?: string }} [opts]
|
|
1391
1434
|
*/
|
|
1392
1435
|
export function isAllowedHostHeader(hostHeader, port, opts = {}) {
|
|
1393
1436
|
if (!hostHeader || typeof hostHeader !== "string") return false;
|
|
@@ -1398,10 +1441,15 @@ export function isAllowedHostHeader(hostHeader, port, opts = {}) {
|
|
|
1398
1441
|
return false;
|
|
1399
1442
|
}
|
|
1400
1443
|
if (url.username || url.password || url.pathname !== "/") return false;
|
|
1401
|
-
const resolvedPort = url.port || "80";
|
|
1402
|
-
if (resolvedPort !== String(port)) return false;
|
|
1403
1444
|
const name = url.hostname.toLowerCase();
|
|
1404
|
-
|
|
1445
|
+
const loopbackLiteral = name === "localhost" || name === "127.0.0.1" || name === "[::1]";
|
|
1446
|
+
const resolvedPort = url.port || "80";
|
|
1447
|
+
if (resolvedPort !== String(port)) {
|
|
1448
|
+
// Editor-forward mode: the editor's forward may land on a different
|
|
1449
|
+
// local port, but only a loopback literal is ever relaxed.
|
|
1450
|
+
return opts.editorForward === true && loopbackLiteral;
|
|
1451
|
+
}
|
|
1452
|
+
if (loopbackLiteral) return true;
|
|
1405
1453
|
if (!opts.broadcast) return false;
|
|
1406
1454
|
// The operator-chosen bind host (not a wildcard) names this server by definition.
|
|
1407
1455
|
const bind = typeof opts.bindHost === "string" ? opts.bindHost.trim().toLowerCase() : "";
|
package/dashboard/serve.mjs
CHANGED
|
@@ -452,6 +452,7 @@ const server = createServer((req, res) => {
|
|
|
452
452
|
if (
|
|
453
453
|
!isAllowedHostHeader(req.headers?.host, PORT, {
|
|
454
454
|
broadcast: authResolved.broadcast,
|
|
455
|
+
editorForward: authResolved.editorForward === true,
|
|
455
456
|
bindHost: HOST,
|
|
456
457
|
lanAddresses: LAN_ADDRESSES,
|
|
457
458
|
})
|
package/dashboard/start.mjs
CHANGED
|
@@ -21,6 +21,7 @@ import { existsSync, openSync, realpathSync } from "node:fs";
|
|
|
21
21
|
import { basename, dirname, join, resolve } from "node:path";
|
|
22
22
|
import { fileURLToPath } from "node:url";
|
|
23
23
|
import {
|
|
24
|
+
BROADCAST_TOKEN_ENV,
|
|
24
25
|
escapePerlDoubleQuoted,
|
|
25
26
|
REPO_ROOT_ENV,
|
|
26
27
|
repoRootLogId,
|
|
@@ -84,7 +85,13 @@ function listeningPids(port = PORT) {
|
|
|
84
85
|
|
|
85
86
|
/** @returns {string | null} */
|
|
86
87
|
function runningSnapshotRoot(port = PORT) {
|
|
87
|
-
|
|
88
|
+
// A listener in editor-forward mode (ADR 2026-11-20 point 4) requires the
|
|
89
|
+
// session token even from loopback; carry it so our own listener is not
|
|
90
|
+
// mistaken for a foreign one.
|
|
91
|
+
const token = process.env[BROADCAST_TOKEN_ENV];
|
|
92
|
+
const query =
|
|
93
|
+
typeof token === "string" && token.trim() ? `?token=${encodeURIComponent(token.trim())}` : "";
|
|
94
|
+
return probeListenerRoot(`http://${DISPLAY_HOST}:${port}`, query);
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
/**
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
REGISTRY_CLI_ARGS,
|
|
7
7
|
resolveRegistryFromCli
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BM5RR7LT.js";
|
|
9
9
|
import {
|
|
10
10
|
logger
|
|
11
11
|
} from "./chunk-ZB43YMHW.js";
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
resolveProtectedGlobs,
|
|
24
24
|
saveManifest,
|
|
25
25
|
upsertIdList
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-GSVUCEMH.js";
|
|
27
|
+
import "./chunk-EJJET3CA.js";
|
|
28
28
|
import "./chunk-IHVJTGYR.js";
|
|
29
29
|
import "./chunk-KMK4T4ZM.js";
|
|
30
30
|
import {
|
package/dist/build-stamp.json
CHANGED
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
compareSemver,
|
|
6
6
|
normalizeSemver,
|
|
7
7
|
readLocalKitVersion
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GSZ2WZYY.js";
|
|
9
9
|
import {
|
|
10
10
|
isRetiredSkillId,
|
|
11
11
|
retireManagedFiles
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SXMGHRLU.js";
|
|
13
13
|
import {
|
|
14
14
|
L0_ARTIFACTS
|
|
15
15
|
} from "./chunk-CGXLR77R.js";
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
mergeStats,
|
|
24
24
|
recordOutcome,
|
|
25
25
|
resolveProtectedGlobs
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GSVUCEMH.js";
|
|
27
27
|
import {
|
|
28
28
|
loadManagedHashLedger,
|
|
29
29
|
saveManagedHashLedger
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-EJJET3CA.js";
|
|
31
31
|
import {
|
|
32
32
|
KIT_PACKAGE_SPEC,
|
|
33
33
|
KIT_VERSION
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
managedPairs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SXMGHRLU.js";
|
|
4
4
|
import {
|
|
5
5
|
isProtectedPath,
|
|
6
6
|
resolveProtectedGlobs
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GSVUCEMH.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveContained
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EJJET3CA.js";
|
|
11
11
|
|
|
12
12
|
// src/lifecycle/diff.ts
|
|
13
13
|
import { readFile } from "fs/promises";
|