@intentic/sandbox-contract 1.361.0 → 1.362.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/dist/events/land-conflict.d.ts +1 -0
- package/dist/events/land-conflict.d.ts.map +1 -1
- package/dist/events/land-conflict.js +18 -1
- package/dist/events/land-conflict.js.map +1 -1
- package/package.json +5 -5
- package/src/events/land-conflict.test.ts +23 -0
- package/src/events/land-conflict.ts +27 -1
|
@@ -10,4 +10,5 @@ export declare const blockersOf: (conflicts: readonly LandConflict[] | undefined
|
|
|
10
10
|
export declare const agentBlockers: (blockers: readonly Blocker[]) => readonly Blocker[];
|
|
11
11
|
export declare const userBlockers: (blockers: readonly Blocker[]) => readonly Blocker[];
|
|
12
12
|
export declare const landConflictPrompt: (conflicts: readonly LandConflict[] | undefined) => string;
|
|
13
|
+
export declare const keepDeletedPrompt: (deleted: readonly Blocker[], mainBranch: string | undefined) => string;
|
|
13
14
|
//# sourceMappingURL=land-conflict.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"land-conflict.d.ts","sourceRoot":"","sources":["../../src/events/land-conflict.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAS7E,eAAO,MAAM,qBAAqB,kRACiP,CAAC;AAGpR,eAAO,MAAM,cAAc,WAAY,MAAM,KAAG,OAA6E,CAAC;AAG9H,MAAM,WAAW,OAAO;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;CACvC;AAED,eAAO,MAAM,UAAU,cAAe,SAAS,YAAY,EAAE,GAAG,SAAS,KAAG,SAAS,OAAO,EACuD,CAAC;AAGpJ,eAAO,MAAM,aAAa,aAAc,SAAS,OAAO,EAAE,KAAG,SAAS,OAAO,EAAkE,CAAC;AAGhJ,eAAO,MAAM,YAAY,aAAc,SAAS,OAAO,EAAE,KAAG,SAAS,OAAO,EAAkE,CAAC;AAqC/I,eAAO,MAAM,kBAAkB,cAAe,SAAS,YAAY,EAAE,GAAG,SAAS,KAAG,MAoBnF,CAAC"}
|
|
1
|
+
{"version":3,"file":"land-conflict.d.ts","sourceRoot":"","sources":["../../src/events/land-conflict.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAS7E,eAAO,MAAM,qBAAqB,kRACiP,CAAC;AAGpR,eAAO,MAAM,cAAc,WAAY,MAAM,KAAG,OAA6E,CAAC;AAG9H,MAAM,WAAW,OAAO;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;CACvC;AAED,eAAO,MAAM,UAAU,cAAe,SAAS,YAAY,EAAE,GAAG,SAAS,KAAG,SAAS,OAAO,EACuD,CAAC;AAGpJ,eAAO,MAAM,aAAa,aAAc,SAAS,OAAO,EAAE,KAAG,SAAS,OAAO,EAAkE,CAAC;AAGhJ,eAAO,MAAM,YAAY,aAAc,SAAS,OAAO,EAAE,KAAG,SAAS,OAAO,EAAkE,CAAC;AAqC/I,eAAO,MAAM,kBAAkB,cAAe,SAAS,YAAY,EAAE,GAAG,SAAS,KAAG,MAoBnF,CAAC;AAWF,eAAO,MAAM,iBAAiB,YAAa,SAAS,OAAO,EAAE,cAAc,MAAM,GAAG,SAAS,KAAG,MAe/F,CAAC"}
|
|
@@ -45,7 +45,24 @@ export const landConflictPrompt = (conflicts) => {
|
|
|
45
45
|
...(theirs.length === 0
|
|
46
46
|
? []
|
|
47
47
|
: [`Leave these alone: the user has uncommitted edits on them, which only they can clear; rebasing will not unblock them:\n${listing(theirs, false)}`]),
|
|
48
|
-
|
|
48
|
+
STAY_INSIDE,
|
|
49
|
+
].join("\n\n");
|
|
50
|
+
};
|
|
51
|
+
const STAY_INSIDE = "Stay inside your own worktree: never edit, stage or commit in the user's checkout. The app re-lands automatically when your turn ends, stop once the rebase is clean.";
|
|
52
|
+
export const keepDeletedPrompt = (deleted, mainBranch) => {
|
|
53
|
+
const main = mainBranch === undefined || mainBranch === "" ? "<branch>" : mainBranch;
|
|
54
|
+
return [
|
|
55
|
+
LAND_CONFLICT_OPENING,
|
|
56
|
+
[
|
|
57
|
+
"1. `git add -A && git commit`: a rebase refuses to start on a dirty tree.",
|
|
58
|
+
mainBranch === undefined || mainBranch === ""
|
|
59
|
+
? "2. `git rebase <branch>`, where `<branch>` is the one in brackets on the FIRST line of `git worktree list`, the user's main line."
|
|
60
|
+
: `2. \`git rebase ${main}\`, that is the user's main line.`,
|
|
61
|
+
`3. Where it stops on one of the files below (deleted by them, modified by you): \`git rm\` it, then \`git rebase --continue\`. If the rebase gets away from you: \`git rebase --abort\`, \`git merge ${main}\`, and \`git rm\` them there instead.`,
|
|
62
|
+
"4. Resolve any other conflict keeping the intent of BOTH sides.",
|
|
63
|
+
].join("\n"),
|
|
64
|
+
`The user deleted these on purpose and the deletion is committed on their main line. Keep them deleted: do not re-create them, and do not move your changes to them into another file:\n${listing(deleted, false)}`,
|
|
65
|
+
STAY_INSIDE,
|
|
49
66
|
].join("\n\n");
|
|
50
67
|
};
|
|
51
68
|
//# sourceMappingURL=land-conflict.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"land-conflict.js","sourceRoot":"","sources":["../../src/events/land-conflict.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAQhD,MAAM,CAAC,MAAM,qBAAqB,GAC9B,+QAA+Q,CAAC;AAGpR,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAW,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAA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C,IAAI,CAAC,MAAM,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,WAAW,GACb,uKAAuK,CAAC;AAQ5K,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAA2B,EAAE,UAA8B,EAAU,EAAE;IACrG,MAAM,IAAI,GAAG,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;IACrF,OAAO;QACH,qBAAqB;QACrB;YACI,2EAA2E;YAC3E,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,EAAE;gBACzC,CAAC,CAAC,mIAAmI;gBACrI,CAAC,CAAC,mBAAmB,IAAI,mCAAmC;YAChE,wMAAwM,IAAI,wCAAwC;YACpP,iEAAiE;SACpE,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,0LAA0L,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;QACnN,WAAW;KACd,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACnB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/sandbox-contract",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.362.0",
|
|
4
4
|
"description": "oRPC wire contract for the intentic sandbox daemon, shared by the daemon and its browser client",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -362,10 +362,10 @@
|
|
|
362
362
|
}
|
|
363
363
|
},
|
|
364
364
|
"dependencies": {
|
|
365
|
-
"@intentic/base": "1.
|
|
366
|
-
"@intentic/constants": "1.
|
|
367
|
-
"@intentic/extension-manifest": "1.
|
|
368
|
-
"@intentic/registry": "1.
|
|
365
|
+
"@intentic/base": "1.362.0",
|
|
366
|
+
"@intentic/constants": "1.362.0",
|
|
367
|
+
"@intentic/extension-manifest": "1.362.0",
|
|
368
|
+
"@intentic/registry": "1.362.0",
|
|
369
369
|
"@orpc/contract": "1.16.1",
|
|
370
370
|
"zod": "4.6.7"
|
|
371
371
|
},
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isLandConflict, keepDeletedPrompt } from "./land-conflict.js";
|
|
2
|
+
|
|
3
|
+
// The turn a "Keep deleted" press sends: the same errand as a Resolve (the chat folds it as one), but with the answer
|
|
4
|
+
// to the modify/delete conflict already decided, since "keep both sides" would bring the owner's deleted file back.
|
|
5
|
+
it(`asks for the deleted files to stay gone, named per repo, on the named main line`, () => {
|
|
6
|
+
const prompt = keepDeletedPrompt(
|
|
7
|
+
[
|
|
8
|
+
{ repo: `root`, path: `docs/reports/a.md`, reason: `workspace` },
|
|
9
|
+
{ repo: `intentic`, path: `x.ts`, reason: `workspace` },
|
|
10
|
+
],
|
|
11
|
+
`main`,
|
|
12
|
+
);
|
|
13
|
+
expect(isLandConflict(prompt)).toBe(true);
|
|
14
|
+
expect(prompt).toContain("`git rebase main`");
|
|
15
|
+
expect(prompt).toContain("`git rm` it");
|
|
16
|
+
expect(prompt).toContain(`Keep them deleted: do not re-create them`);
|
|
17
|
+
expect(prompt).toContain(`root\n - docs/reports/a.md`);
|
|
18
|
+
expect(prompt).toContain(`intentic\n - x.ts`);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it(`falls back to the worktree list when no main line was named`, () => {
|
|
22
|
+
expect(keepDeletedPrompt([{ repo: `root`, path: `a.md`, reason: `workspace` }], undefined)).toContain("FIRST line of `git worktree list`");
|
|
23
|
+
});
|
|
@@ -82,6 +82,32 @@ export const landConflictPrompt = (conflicts: readonly LandConflict[] | undefine
|
|
|
82
82
|
...(theirs.length === 0
|
|
83
83
|
? []
|
|
84
84
|
: [`Leave these alone: the user has uncommitted edits on them, which only they can clear; rebasing will not unblock them:\n${listing(theirs, false)}`]),
|
|
85
|
-
|
|
85
|
+
STAY_INSIDE,
|
|
86
|
+
].join("\n\n");
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const STAY_INSIDE =
|
|
90
|
+
"Stay inside your own worktree: never edit, stage or commit in the user's checkout. The app re-lands automatically when your turn ends, stop once the rebase is clean.";
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The same turn for a land the user's own deletion held: they deleted files this conversation changed, chose to keep
|
|
94
|
+
* them deleted, and the app committed that deletion on their main line before sending this. So the rebase stops on a
|
|
95
|
+
* modify/delete conflict whose answer is already decided, and the generic "keep both sides" would bring the file back.
|
|
96
|
+
* Opens like `landConflictPrompt`, so the chat folds it as the same errand.
|
|
97
|
+
*/
|
|
98
|
+
export const keepDeletedPrompt = (deleted: readonly Blocker[], mainBranch: string | undefined): string => {
|
|
99
|
+
const main = mainBranch === undefined || mainBranch === "" ? "<branch>" : mainBranch;
|
|
100
|
+
return [
|
|
101
|
+
LAND_CONFLICT_OPENING,
|
|
102
|
+
[
|
|
103
|
+
"1. `git add -A && git commit`: a rebase refuses to start on a dirty tree.",
|
|
104
|
+
mainBranch === undefined || mainBranch === ""
|
|
105
|
+
? "2. `git rebase <branch>`, where `<branch>` is the one in brackets on the FIRST line of `git worktree list`, the user's main line."
|
|
106
|
+
: `2. \`git rebase ${main}\`, that is the user's main line.`,
|
|
107
|
+
`3. Where it stops on one of the files below (deleted by them, modified by you): \`git rm\` it, then \`git rebase --continue\`. If the rebase gets away from you: \`git rebase --abort\`, \`git merge ${main}\`, and \`git rm\` them there instead.`,
|
|
108
|
+
"4. Resolve any other conflict keeping the intent of BOTH sides.",
|
|
109
|
+
].join("\n"),
|
|
110
|
+
`The user deleted these on purpose and the deletion is committed on their main line. Keep them deleted: do not re-create them, and do not move your changes to them into another file:\n${listing(deleted, false)}`,
|
|
111
|
+
STAY_INSIDE,
|
|
86
112
|
].join("\n\n");
|
|
87
113
|
};
|