dsh-hashline-edit 0.2.2 → 0.3.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/README.md +57 -45
- package/cordis.patch.yml +9 -3
- package/lib/client.js +231 -0
- package/lib/index.js +3298 -3957
- package/lib/types/dsh/contracts.d.ts +12 -3
- package/lib/types/dsh/fs.d.ts +3 -0
- package/lib/types/dsh/guidance.d.ts +12 -6
- package/lib/types/dsh/hide.d.ts +79 -0
- package/lib/types/dsh/host-compat.d.ts +7 -78
- package/lib/types/dsh/index.d.ts +53 -10
- package/lib/types/dsh/metrics/events.d.ts +1 -1
- package/lib/types/dsh/metrics/observer.d.ts +1 -1
- package/lib/types/dsh/sandbox.d.ts +2 -2
- package/lib/types/dsh/shell-hook.d.ts +1 -1
- package/lib/types/dsh/tools/apply-patch.d.ts +38 -0
- package/lib/types/dsh/tools/read.d.ts +3 -3
- package/lib/types/src/apply-patch/commit.d.ts +49 -0
- package/lib/types/src/apply-patch/grammar.d.ts +29 -0
- package/lib/types/src/apply-patch/lifecycle.d.ts +32 -0
- package/lib/types/src/apply-patch/plan.d.ts +50 -0
- package/lib/types/src/apply-patch/render.d.ts +51 -0
- package/lib/types/src/apply-patch/resolve.d.ts +129 -0
- package/lib/types/src/apply-patch/tool.d.ts +54 -0
- package/lib/types/src/apply-patch/types.d.ts +362 -0
- package/lib/types/src/domain-errors.d.ts +16 -2
- package/lib/types/src/edit-undo.d.ts +11 -2
- package/lib/types/src/file-content/index.d.ts +1 -1
- package/lib/types/src/file-content/preview.d.ts +1 -1
- package/lib/types/src/fs-lifecycle.d.ts +44 -0
- package/lib/types/src/hashline/alphabet.d.ts +4 -3
- package/lib/types/src/hashline/hash-identity.d.ts +12 -7
- package/lib/types/src/host-utils.d.ts +63 -0
- package/lib/types/src/mutation-engine/edit-request.d.ts +34 -0
- package/lib/types/src/mutation-engine/pipeline.d.ts +8 -1
- package/lib/types/src/mutation-engine/types.d.ts +40 -50
- package/lib/types/src/served-session/serve-render.d.ts +6 -0
- package/lib/types/src/undo-store.d.ts +17 -1
- package/package.json +37 -21
- package/prompts/apply-patch-guidelines.md +4 -0
- package/prompts/apply-patch.md +1 -0
- package/prompts/read-guidelines.md +6 -6
- package/prompts/read.md +1 -1
- package/prompts/undo-last-edit-guidelines.md +2 -2
- package/prompts/undo-last-edit-snippet.md +1 -1
- package/prompts/undo-last-edit.md +1 -1
- package/prompts/zh/apply-patch-guidelines.md +4 -0
- package/prompts/zh/apply-patch.md +1 -0
- package/prompts/zh/read-guidelines.md +6 -0
- package/prompts/zh/read-snippet.md +1 -0
- package/prompts/zh/read.md +1 -0
- package/prompts/zh/undo-last-edit-guidelines.md +2 -0
- package/prompts/zh/undo-last-edit-snippet.md +1 -0
- package/prompts/zh/undo-last-edit.md +1 -0
- package/src/apply-patch/commit.ts +190 -0
- package/src/apply-patch/grammar.ts +620 -0
- package/src/apply-patch/index.ts +17 -0
- package/src/apply-patch/lifecycle.ts +195 -0
- package/src/apply-patch/plan.ts +800 -0
- package/src/apply-patch/render.ts +137 -0
- package/src/apply-patch/resolve.ts +470 -0
- package/src/apply-patch/tool.ts +257 -0
- package/src/apply-patch/types.ts +387 -0
- package/src/cut-repair.ts +77 -11
- package/src/domain-errors.ts +35 -3
- package/src/edit-undo.ts +379 -25
- package/src/file-content/index.ts +1 -1
- package/src/file-content/preview.ts +1 -1
- package/src/file-content/served-header.ts +1 -1
- package/src/fs-lifecycle.ts +201 -0
- package/src/hash-store.ts +18 -1
- package/src/hashline/alphabet.ts +7 -7
- package/src/hashline/hash-identity.ts +12 -7
- package/src/host-utils.ts +224 -0
- package/src/mutation-engine/edit-request.ts +39 -0
- package/src/mutation-engine/pipeline.ts +198 -27
- package/src/mutation-engine/types.ts +39 -57
- package/src/mutation-queue.ts +1 -1
- package/src/prompts.ts +3 -30
- package/src/served-session/serve-render.ts +2 -2
- package/src/undo-store.ts +74 -5
- package/lib/types/dsh/tools/edit.d.ts +0 -10
- package/lib/types/src/edit-tool.d.ts +0 -41
- package/lib/types/src/mutation-engine/engine.d.ts +0 -31
- package/lib/types/src/payload-contract.d.ts +0 -135
- package/prompts/edit-guidelines.md +0 -10
- package/prompts/edit-snippet.md +0 -1
- package/prompts/edit.md +0 -1
- package/prompts/read-snippet.md +0 -1
- package/src/bash-classifier.ts +0 -1626
- package/src/bash-conversion/decide.ts +0 -812
- package/src/bash-display-transform.ts +0 -50
- package/src/bash-multifile-config.ts +0 -239
- package/src/bash-view-config.ts +0 -158
- package/src/edit-normalize.ts +0 -8
- package/src/edit-render.ts +0 -161
- package/src/edit-tool.ts +0 -118
- package/src/edit.ts +0 -136
- package/src/integrations/pi-lens/command.ts +0 -712
- package/src/integrations/pi-lens/config.ts +0 -148
- package/src/integrations/pi-lens/io-bridge-adapter.ts +0 -234
- package/src/integrations/pi-lens/io-bridge.ts +0 -112
- package/src/integrations/pi-lens/settings-overlay.ts +0 -272
- package/src/lifecycle-hooks/index.ts +0 -1992
- package/src/lifecycle-hooks/types.ts +0 -64
- package/src/mutated-files.ts +0 -75
- package/src/mutation-engine/engine.ts +0 -239
- package/src/mutation-engine/index.ts +0 -17
- package/src/payload-contract.ts +0 -685
- package/src/preview-controller.ts +0 -84
- package/src/read.ts +0 -865
- package/src/search-hook.ts +0 -41
- package/src/store-config.ts +0 -73
- package/src/store-janitor-warning.ts +0 -169
- package/src/store-janitor.ts +0 -539
- package/src/store-kernel/settings.ts +0 -233
- package/src/store.ts +0 -154
- package/src/tui-presenter.ts +0 -134
- package/src/write-hook.ts +0 -130
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** SAFETY: EditTool — deep module owning the edit Use Case seam.
|
|
2
|
-
*
|
|
3
|
-
* Graded surface: one narrow interface `EditTool { execute, preview }`
|
|
4
|
-
* hides pipeline delegation, warnings/drift stitching.
|
|
5
|
-
* Frameworks (pi TUI) never cross this seam — that lives in TuiPresenter.
|
|
6
|
-
* Clean Architecture: Use Cases depend inward only (mutation-engine),
|
|
7
|
-
* never outward to Frameworks.
|
|
8
|
-
*
|
|
9
|
-
* Typed boundaries: validate once at admission (payload-contract via normReq/assertReq),
|
|
10
|
-
* trust inside. Immutable state: never mutates caller-owned request.
|
|
11
|
-
*/
|
|
12
|
-
type EditToolContext = {
|
|
13
|
-
cwd: string;
|
|
14
|
-
sessionManager?: {
|
|
15
|
-
getSessionId(): string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type PreviewContext = {
|
|
19
|
-
sessionManager?: {
|
|
20
|
-
getSessionId(): string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
type PreviewResult = {
|
|
24
|
-
diff: string;
|
|
25
|
-
} | {
|
|
26
|
-
error: string;
|
|
27
|
-
};
|
|
28
|
-
export interface EditTool {
|
|
29
|
-
/** SAFETY: Execute a validated edit; returns pi tool_result or throws on failure. Admission: params validated by normReq/assertReq. */
|
|
30
|
-
execute(params: unknown, signal: AbortSignal | undefined, ctx: EditToolContext): Promise<{
|
|
31
|
-
content: Array<{
|
|
32
|
-
type: "text";
|
|
33
|
-
text: string;
|
|
34
|
-
}>;
|
|
35
|
-
details: unknown;
|
|
36
|
-
}>;
|
|
37
|
-
/** SAFETY: Preview without persisting — mirrors pi's compPreview(request, cwd, ctx). The ctx must carry the session whose serves the anchors came from (#165). */
|
|
38
|
-
preview(request: unknown, cwd: string, ctx: PreviewContext): Promise<PreviewResult>;
|
|
39
|
-
}
|
|
40
|
-
export declare function createEditTool(): EditTool;
|
|
41
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SAFETY: MutationEngine — deep module behind the mutation seam.
|
|
3
|
-
*
|
|
4
|
-
* Small interface: `execute` + `preview`. Deep implementation: load → parse
|
|
5
|
-
* → mutate → finalize → drift → persist → serve hidden inside the pipeline.
|
|
6
|
-
* Internal seams (validate, verify, mutate, guard, persist, record) stay
|
|
7
|
-
* private — not exported. The interface is the test surface.
|
|
8
|
-
*
|
|
9
|
-
* Typed boundaries: validate once at admission (edit.ts via payload-contract),
|
|
10
|
-
* trust inside. Errors fail loud with typed `MutationFailure`.
|
|
11
|
-
*/
|
|
12
|
-
import type { PipelineOptions } from "./types.js";
|
|
13
|
-
import type { MutationResult } from "./types.js";
|
|
14
|
-
import type { NormalizedEditRequest } from "../payload-contract.js";
|
|
15
|
-
declare function toFailure(error: unknown): MutationResult;
|
|
16
|
-
/**
|
|
17
|
-
* SAFETY: Execute a mutation against the file system (persist + undo + serve).
|
|
18
|
-
* Returns discriminated `MutationResult` — callers must switch on `ok`.
|
|
19
|
-
*
|
|
20
|
-
* No `any` threading: input is `NormalizedEditRequest` (validated at
|
|
21
|
-
* admission), output is typed. Failures are `ok:false` with `code`, not
|
|
22
|
-
* loose `isError` flags.
|
|
23
|
-
*/
|
|
24
|
-
export declare function execute(request: NormalizedEditRequest, cwd: string, options?: PipelineOptions): Promise<MutationResult>;
|
|
25
|
-
/**
|
|
26
|
-
* SAFETY: Preview a mutation without persisting (noPersist). Same seam as `execute`,
|
|
27
|
-
* same `MutationResult` — one interface, N call sites (preview + apply share
|
|
28
|
-
* the internal path via `runMutations` with `noPersist:true`).
|
|
29
|
-
*/
|
|
30
|
-
export declare function preview(request: NormalizedEditRequest, cwd: string, options?: Omit<PipelineOptions, "noPersist">): Promise<MutationResult>;
|
|
31
|
-
export { toFailure };
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { Type } from "typebox";
|
|
2
|
-
import type { EditPlacement } from "./hashline/resolve.js";
|
|
3
|
-
declare const normalizedEdit: unique symbol;
|
|
4
|
-
/** Width-appropriate illustrative anchor for prompt examples (width is a build-time setting, ADR-0020). */
|
|
5
|
-
export declare const ANCHOR_EXAMPLE: string;
|
|
6
|
-
/**
|
|
7
|
-
* The `text_ref` payload: two inclusive bare anchors bounding a served span, an optional serving
|
|
8
|
-
* `file`, and a REQUIRED `mode` — `"copy"` re-inserts the span bytes, `"cut"` additionally retires
|
|
9
|
-
* them. Both modes apply to this file AND to another served file (ticket-04b): a foreign-source
|
|
10
|
-
* `"cut"` commits the insert and the source retirement as one correlated transaction (ADR-0028).
|
|
11
|
-
*/
|
|
12
|
-
type SpanRef = {
|
|
13
|
-
anchor_from: string;
|
|
14
|
-
anchor_to: string;
|
|
15
|
-
file?: string;
|
|
16
|
-
mode: "copy" | "cut";
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Wire item (ticket-04): exactly one payload per item — `text` or `text_ref` — over the inclusive
|
|
20
|
-
* anchor pair, with optional `at` placement. There is no `op` field and no verbs: the key set IS
|
|
21
|
-
* the vocabulary (ADR-0007 line 26; content comes from the copy of another served file, which the
|
|
22
|
-
* wire expresses as `text_ref.file`).
|
|
23
|
-
*/
|
|
24
|
-
export type EditItem = {
|
|
25
|
-
anchor_from: string;
|
|
26
|
-
anchor_to: string;
|
|
27
|
-
at?: "in-place" | "before" | "after";
|
|
28
|
-
text?: string;
|
|
29
|
-
text_ref?: SpanRef;
|
|
30
|
-
/**
|
|
31
|
-
* The file this item edits; absent means the call's top-level `file`. One call may therefore
|
|
32
|
-
* cross files: each item resolves its anchors and its lease against the file it names.
|
|
33
|
-
*/
|
|
34
|
-
file?: string;
|
|
35
|
-
};
|
|
36
|
-
type EditMode = "general" | "literal";
|
|
37
|
-
/**
|
|
38
|
-
* Internal normalized vocabulary owned by the admission boundary (ticket-01, renamed ticket-04).
|
|
39
|
-
* The wire never names these shapes: `normReq` builds them once from the validated payload and
|
|
40
|
-
* everything downstream consumes the union — the engine switches on `payload.kind` exhaustively.
|
|
41
|
-
*/
|
|
42
|
-
export type Placement = "in-place" | "before" | "after";
|
|
43
|
-
/**
|
|
44
|
-
* @public Intentional surface (knip): the tuple type is the wire/engine
|
|
45
|
-
* vocabulary check, so the binding is never imported — its reason to exist
|
|
46
|
-
* is the typecheck failure it produces when the unions drift.
|
|
47
|
-
*/
|
|
48
|
-
export declare const _placementVocabularyAgreement: [
|
|
49
|
-
Placement extends EditPlacement ? true : never,
|
|
50
|
-
EditPlacement extends Placement ? true : never
|
|
51
|
-
];
|
|
52
|
-
/** The anchor pair an item targets — placement and payload are relative to its resolved span. */
|
|
53
|
-
type AnchorSpan = {
|
|
54
|
-
anchor_from: string;
|
|
55
|
-
anchor_to: string;
|
|
56
|
-
};
|
|
57
|
-
export type DesiredContent = {
|
|
58
|
-
kind: "literal";
|
|
59
|
-
text: string;
|
|
60
|
-
} | {
|
|
61
|
-
kind: "reference";
|
|
62
|
-
span: SpanRef;
|
|
63
|
-
mode: "copy" | "cut";
|
|
64
|
-
} | {
|
|
65
|
-
kind: "empty";
|
|
66
|
-
};
|
|
67
|
-
export type NormalizedEditItem = {
|
|
68
|
-
target: AnchorSpan;
|
|
69
|
-
at: Placement;
|
|
70
|
-
payload: DesiredContent;
|
|
71
|
-
/** The file this item edits, when the wire named one; absent means the request's `file`. */
|
|
72
|
-
file?: string;
|
|
73
|
-
};
|
|
74
|
-
export type NormalizedEditRequest = {
|
|
75
|
-
file: string;
|
|
76
|
-
edits: NormalizedEditItem[];
|
|
77
|
-
mode?: EditMode;
|
|
78
|
-
};
|
|
79
|
-
/** The wire-folded request (the admission analyzer's view): canonical keys, pre-union. */
|
|
80
|
-
type PreAdmissionRequest = {
|
|
81
|
-
file: string;
|
|
82
|
-
edits: EditItem[];
|
|
83
|
-
mode?: EditMode;
|
|
84
|
-
};
|
|
85
|
-
type NormalizedPayload = NormalizedEditRequest & {
|
|
86
|
-
readonly [normalizedEdit]: true;
|
|
87
|
-
};
|
|
88
|
-
type RawPayload = string | number | boolean | null | undefined | Record<string, unknown>;
|
|
89
|
-
export type NormReqResult = NormalizedPayload | RawPayload;
|
|
90
|
-
export declare const anchorFromSchema: Type.TString;
|
|
91
|
-
export declare const anchorToSchema: Type.TString;
|
|
92
|
-
export declare const editFileSchema: Type.TString;
|
|
93
|
-
export declare const editModeSchema: Type.TUnion<[Type.TLiteral<"general">, Type.TLiteral<"literal">]>;
|
|
94
|
-
export declare const editItemSchema: Type.TObject<{
|
|
95
|
-
anchor_from: Type.TString;
|
|
96
|
-
anchor_to: Type.TString;
|
|
97
|
-
at: Type.TOptional<Type.TUnion<[Type.TUnion<[Type.TLiteral<"in-place">, Type.TLiteral<"before">, Type.TLiteral<"after">]>, Type.TNull]>>;
|
|
98
|
-
file: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
99
|
-
text: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
100
|
-
text_ref: Type.TOptional<Type.TUnion<[Type.TObject<{
|
|
101
|
-
anchor_from: Type.TString;
|
|
102
|
-
anchor_to: Type.TString;
|
|
103
|
-
file: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
104
|
-
mode: Type.TUnion<[Type.TLiteral<"copy">, Type.TLiteral<"cut">]>;
|
|
105
|
-
}>, Type.TNull]>>;
|
|
106
|
-
}>;
|
|
107
|
-
export declare const editToolSchema: Type.TObject<{
|
|
108
|
-
file: Type.TString;
|
|
109
|
-
edits: Type.TArray<Type.TObject<{
|
|
110
|
-
anchor_from: Type.TString;
|
|
111
|
-
anchor_to: Type.TString;
|
|
112
|
-
at: Type.TOptional<Type.TUnion<[Type.TUnion<[Type.TLiteral<"in-place">, Type.TLiteral<"before">, Type.TLiteral<"after">]>, Type.TNull]>>;
|
|
113
|
-
file: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
114
|
-
text: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
115
|
-
text_ref: Type.TOptional<Type.TUnion<[Type.TObject<{
|
|
116
|
-
anchor_from: Type.TString;
|
|
117
|
-
anchor_to: Type.TString;
|
|
118
|
-
file: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
119
|
-
mode: Type.TUnion<[Type.TLiteral<"copy">, Type.TLiteral<"cut">]>;
|
|
120
|
-
}>, Type.TNull]>>;
|
|
121
|
-
}>>;
|
|
122
|
-
mode: Type.TOptional<Type.TUnion<[Type.TUnion<[Type.TLiteral<"general">, Type.TLiteral<"literal">]>, Type.TNull]>>;
|
|
123
|
-
}>;
|
|
124
|
-
export declare const EDIT_DESCRIPTION: string;
|
|
125
|
-
export declare const EDIT_SNIPPET: string;
|
|
126
|
-
export declare const EDIT_GUIDELINES: string[];
|
|
127
|
-
export declare function editRequestFrom(input: unknown): PreAdmissionRequest | undefined;
|
|
128
|
-
export declare function normReq(input: unknown): NormReqResult;
|
|
129
|
-
export declare function prepareEditArguments(args: unknown): Record<string, unknown>;
|
|
130
|
-
export declare function getPreviewInput(args: unknown): {
|
|
131
|
-
file: string;
|
|
132
|
-
edits: EditItem[];
|
|
133
|
-
} | null;
|
|
134
|
-
export declare function assertReq(request: unknown): asserts request is NormalizedEditRequest;
|
|
135
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
- edit: an `anchor` is the bare {{HASH_LEN}}-char hash (for example "{{ANCHOR_EXAMPLE}}"). A `HASH│content` line (for example `{{ANCHOR_EXAMPLE}}│ pass`) is a served row, and `│` separates the two. Copy only the {{HASH_LEN}} chars before `│` into `anchor_from`/`anchor_to`.
|
|
2
|
-
- edit: give each item two anchors and exactly one payload. `file` is the text file. One item is one edit. Several items batch to that one file. Choose one payload field: `text` or `text_ref`. `at` is optional. A null in an optional field (`text`, `text_ref`, `at`, the top-level `mode`, `text_ref.file`) reads as absent. A null in a required field (`file`, `edits`, any anchor, `text_ref.mode`) is refused.
|
|
3
|
-
- edit: `anchor_from`/`anchor_to` bound an inclusive range. In-place replaces both boundary lines. `before`/`after` insert at the boundary instead. Out-of-band writes (bash, scripts, formatters) bypass serve recording. When a served line changes, the refusal serves the current rows. Copy fresh anchors from it.
|
|
4
|
-
- edit: `text` is plain file content. Join lines with `\n`. Use `""` to delete the range. The tool refuses a line that copies a served hash echo. `text` is verbatim, so include the indentation you want.
|
|
5
|
-
- edit: place the payload with `at`. `"in-place"` (default) rewrites the range. `"before"`/`"after"` insert at its boundary and need a single-line resolved target. `text: ""` with before/after writes nothing (noop).
|
|
6
|
-
- edit: `text_ref` `{anchor_from, anchor_to, mode}` writes the bytes of a served span into the target. `mode: "copy"` keeps the source. `mode: "cut"` removes those lines from the source. When `file` names another served file, both modes apply to that file's rows. A `cut` then removes the span there in the same call. `mode` is required. Prefer `text_ref` to reproduce served bytes exactly or to move them. Use `text` for content you author.
|
|
7
|
-
- edit: an anchor is bound to the file that served it. The lease is (session, file, anchor). Copy `anchor_from`/`anchor_to` only from the served rows of the file the payload names. That is this file by default, or `text_ref.file` when it names another file.
|
|
8
|
-
- edit: after success the diff serves fresh `HASH│content` rows: context rows and `+` rows. Copy new anchors from the diff for your next call. Verify that the diff matches your intended mutation.
|
|
9
|
-
- edit: a `[MODEL] [W_*]` line in `content` is informational. The mutation was applied. A `[MODEL] [E_*]` line is your retry instruction or a rejection: follow it from the message alone. A `[MODEL]` line that presents `Current range (fresh read):` shows the current rows. Decide from them. A dimmed `[USER]` line in `details` is human info.
|
|
10
|
-
- edit: batch independent ranges in one `edits` array. Inside it, every edit validates BEFORE the first rename, and any failure there writes nothing. A foreign `cut` writes its files in a fixed order, and a defeated rollback restores captured bytes or is repaired on the next run.
|
package/prompts/edit-snippet.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Edit a file range via `edit`: `{"file":file,"edits":[{"anchor_from":a,"anchor_to":b,"text":text}]}` — anchors are bare {{HASH_LEN}}-char hashes copied from served `HASH│content` from rows this file served this session. One payload per item: `text` is bare content (`""` deletes) or `text_ref` writes a served span (`"copy"` keeps source, `"cut"` removes it from this file or `file`). `at`: "in-place" (default), "before", "after". Chain from diff anchors.
|
package/prompts/edit.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Edit a range of lines in a text file via `edit`: `{ "file": file, "edits": [{ "anchor_from": a, "anchor_to": b, "text": text }, ...] }` (one file per call, or one per item `file`). Use rows this session served for the file: `read`, a diff, or a bash view. `anchor_from`/`anchor_to` are bare {{HASH_LEN}}-char HASH anchors. Copy the {{HASH_LEN}} chars before `│` in this file's served rows (lease (session, file, anchor)). One payload per item: `text` (`\n` joins lines, `""` deletes) or `text_ref` `{anchor_from, anchor_to, mode (required), file?}`, the bytes of a served span (`mode` `"copy"` keeps it, `"cut"` removes it). `file` names another served file. `at`: "in-place" (default), "before", "after". A null optional field reads as absent. `[MODEL] [E_*]` is your retry instruction. `[W_*]` is informational.
|
package/prompts/read-snippet.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Read a file via `file`, `windows?`, `mode?`; default returns HASH│content rows for editing, `mode: "verbatim"` returns plain text when you will not edit; batch several ranges in one call via `windows`
|