@hasna/instructions 0.4.8 → 0.4.10
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/README.md +35 -0
- package/dist/cli/index.js +513 -232
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +481 -200
- package/dist/lib/apply.d.ts +7 -0
- package/dist/lib/apply.d.ts.map +1 -1
- package/dist/lib/global-agent-rules-standard.d.ts +106 -0
- package/dist/lib/global-agent-rules-standard.d.ts.map +1 -1
- package/dist/lib/global-agent-rules-stored-content.test.d.ts +2 -0
- package/dist/lib/global-agent-rules-stored-content.test.d.ts.map +1 -0
- package/dist/lib/project-context-prepared-file.test.d.ts +2 -0
- package/dist/lib/project-context-prepared-file.test.d.ts.map +1 -0
- package/dist/lib/project-context.d.ts +10 -0
- package/dist/lib/project-context.d.ts.map +1 -1
- package/dist/lib/session-render-contract.d.ts +10 -0
- package/dist/lib/session-render-contract.d.ts.map +1 -1
- package/dist/lib/session-render-ownership.d.ts +23 -0
- package/dist/lib/session-render-ownership.d.ts.map +1 -0
- package/dist/lib/session-render-ownership.test.d.ts +2 -0
- package/dist/lib/session-render-ownership.test.d.ts.map +1 -0
- package/dist/lib/session-render.d.ts +24 -1
- package/dist/lib/session-render.d.ts.map +1 -1
- package/dist/lib/test-temp-root.d.ts +7 -0
- package/dist/lib/test-temp-root.d.ts.map +1 -0
- package/dist/mcp/index.js +214 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -192,6 +192,41 @@ manifests for drift, refuses unmanaged file conflicts unless `--force` is
|
|
|
192
192
|
passed, removes stale managed mirrors only when safe, and writes local snapshots
|
|
193
193
|
before mutating managed files.
|
|
194
194
|
|
|
195
|
+
### Session renderer ownership
|
|
196
|
+
|
|
197
|
+
Anything the session renderer writes is off limits to `instructions apply` and
|
|
198
|
+
`instructions sync --to-disk`; those rows are reported as `[owned]` and skipped
|
|
199
|
+
instead of overwriting rendered output. Ownership is decided from the renderer's
|
|
200
|
+
own definitions rather than a hand-maintained path list:
|
|
201
|
+
|
|
202
|
+
- **Managed directories** — every `managedDir` in `SESSION_TOOL_ADAPTERS`, matched
|
|
203
|
+
on whole path segments under any target home (`~/.claude/.hasna/instructions/…`,
|
|
204
|
+
`~/.hasna/accounts/profiles/claude/account003/.hasna/instructions/…`, …), plus
|
|
205
|
+
the renderer's `.hasna/session-render-manifest.json` and
|
|
206
|
+
`.hasna/session-render-snapshots/`.
|
|
207
|
+
- **Manifest claims** — any file listed in an ancestor target home's
|
|
208
|
+
`.hasna/session-render-manifest.json`. This covers provider-native output such
|
|
209
|
+
as `CLAUDE.md`, `AGENTS.md`, and `opencode.json` exactly where the renderer
|
|
210
|
+
actually rendered.
|
|
211
|
+
|
|
212
|
+
`~/.cursor/rules` is deliberately *not* statically reserved: the config fan-out
|
|
213
|
+
writes `cursor-mdc` transform outputs there too, so files in that directory are
|
|
214
|
+
owned only when a manifest claims them.
|
|
215
|
+
|
|
216
|
+
Renumbering a source (inserting a new lower-order source shifts `01-` → `02-`
|
|
217
|
+
and so on) orphans older `target_path` values that still point inside a managed
|
|
218
|
+
directory. The guard is what neutralises those orphans, so stale rows are inert
|
|
219
|
+
rather than destructive.
|
|
220
|
+
|
|
221
|
+
Applying a config into renderer-owned space requires the explicit opt-in flag:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
instructions apply <id> --allow-renderer-owned
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
It is separate from `--force` on purpose — "overwrite even if unchanged" must
|
|
228
|
+
never silently become "overwrite renderer-owned instruction files".
|
|
229
|
+
|
|
195
230
|
### Managed project context
|
|
196
231
|
|
|
197
232
|
`instructions project-context plan|apply` is the sole writer for the strict
|