@unieai/rabi-experimental-tool-worktree 0.0.0-stage → 0.2.1-rc.3
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/LICENSE +21 -0
- package/README.md +7 -2
- package/cordis.patch.yml +5 -0
- package/icon.svg +18 -0
- package/lib/index.js +66 -0
- package/lib/types/index.d.ts +12 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +42 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @unieai/rabi-experimental-tool-worktree
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Model tool that creates and enters a new Git worktree
|
|
4
|
+
|
|
5
|
+
Part of Rabi, the agent harness UnieAI Code runs on. Installed as a dependency of `@unieai/rabi`;
|
|
6
|
+
not meant to be used on its own.
|
|
7
|
+
|
|
8
|
+
See LICENSE for the license and copyright of this package.
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g transform="translate(1.8 1.8) scale(0.9)">
|
|
3
|
+
<path d="M11 12V24M11 19H16C20.4 19 25 16.4 25 12" stroke="url(#worktree-branches)" stroke-width="3" />
|
|
4
|
+
<rect x="7.5" y="7" width="7" height="7" rx="2" fill="#86B8F5" />
|
|
5
|
+
<rect x="7.5" y="22" width="7" height="7" rx="2" fill="#5269E1" />
|
|
6
|
+
<rect x="21.5" y="7" width="7" height="7" rx="2" fill="url(#worktree-leaf)" />
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<linearGradient id="worktree-branches" x1="11" y1="12" x2="18" y2="24" gradientUnits="userSpaceOnUse">
|
|
10
|
+
<stop stop-color="#86B8F5" />
|
|
11
|
+
<stop offset="1" stop-color="#5269E1" />
|
|
12
|
+
</linearGradient>
|
|
13
|
+
<linearGradient id="worktree-leaf" x1="22" y1="7" x2="28" y2="14" gradientUnits="userSpaceOnUse">
|
|
14
|
+
<stop stop-color="#51CFDB" />
|
|
15
|
+
<stop offset="1" stop-color="#108792" />
|
|
16
|
+
</linearGradient>
|
|
17
|
+
</defs>
|
|
18
|
+
</svg>
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineTool } from "@unieai/rabi-tools";
|
|
2
|
+
//#region lib/types/index.js
|
|
3
|
+
/** Model tool for creating and entering a new Git worktree through the shared runtime. */
|
|
4
|
+
/** Cordis plugin name. */
|
|
5
|
+
const name = "tool-worktree";
|
|
6
|
+
/** Services required to register and execute the worktree tool. */
|
|
7
|
+
const inject = ["tools", "worktrees"];
|
|
8
|
+
/**
|
|
9
|
+
* Register create_worktree for model and PTC callers.
|
|
10
|
+
* @param ctx - tool registry and worktree runtime.
|
|
11
|
+
*/
|
|
12
|
+
function apply(ctx) {
|
|
13
|
+
ctx.tools.register(defineTool({
|
|
14
|
+
name: "create_worktree",
|
|
15
|
+
description: "Create a new Git branch and worktree from a local commit, branch, or tag, then change this session's working directory to it. Defaults to HEAD and a generated name. Uncommitted files stay in the source checkout. Existing names fail. Use working_directory with cd to leave; the checkout and branch remain.",
|
|
16
|
+
parameters: {
|
|
17
|
+
name: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "New branch name, also used as the checkout directory. Omit to generate a unique name."
|
|
20
|
+
},
|
|
21
|
+
from: {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Local commit, branch, or tag to start from. Defaults to HEAD; no fetch is performed."
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
output: {
|
|
27
|
+
schema: {
|
|
28
|
+
type: "object",
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
properties: {
|
|
31
|
+
path: {
|
|
32
|
+
type: "string",
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
branch: {
|
|
36
|
+
type: "string",
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
baseCommit: {
|
|
40
|
+
type: "string",
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
43
|
+
repositoryRoot: {
|
|
44
|
+
type: "string",
|
|
45
|
+
required: true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
render: (_args, value) => [{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: JSON.stringify(value)
|
|
52
|
+
}]
|
|
53
|
+
},
|
|
54
|
+
async execute(args, exec) {
|
|
55
|
+
if (exec.agent === void 0) throw new Error("create_worktree requires a calling agent");
|
|
56
|
+
return ctx.worktrees.create(exec.agent, args, exec.signal);
|
|
57
|
+
},
|
|
58
|
+
presentCall: (args) => ({
|
|
59
|
+
card: "generic",
|
|
60
|
+
title: "create_worktree",
|
|
61
|
+
rawInput: args
|
|
62
|
+
})
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { apply, inject, name };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Model tool for creating and entering a new Git worktree through the shared runtime. */
|
|
2
|
+
import type { Context } from '@unieai/cordis';
|
|
3
|
+
/** Cordis plugin name. */
|
|
4
|
+
export declare const name = "tool-worktree";
|
|
5
|
+
/** Services required to register and execute the worktree tool. */
|
|
6
|
+
export declare const inject: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Register create_worktree for model and PTC callers.
|
|
9
|
+
* @param ctx - tool registry and worktree runtime.
|
|
10
|
+
*/
|
|
11
|
+
export declare function apply(ctx: Context): void;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unieai/rabi-experimental-tool-worktree",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"description": "Model tool that creates and enters a new Git worktree",
|
|
4
|
+
"version": "0.2.1-rc.3",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "lib/index.js",
|
|
10
|
+
"types": "lib/types/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/types/index.d.ts",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./src/*": "./src/*",
|
|
17
|
+
"./package.json": "./package.json",
|
|
18
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
19
|
+
"./locale/*.json": "./locale/*.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"icon.svg",
|
|
23
|
+
"locale/*.json",
|
|
24
|
+
"lib/index.js",
|
|
25
|
+
"cordis.patch.yml",
|
|
26
|
+
"lib/types/**/*.d.ts",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@unieai/cordis": "4.0.5",
|
|
32
|
+
"@unieai/rabi-tools": "0.2.1-rc.3",
|
|
33
|
+
"@unieai/rabi-experimental-worktree": "0.2.1-rc.3"
|
|
34
|
+
},
|
|
35
|
+
"icon": "./icon.svg",
|
|
36
|
+
"rabi": {
|
|
37
|
+
"bundle": {
|
|
38
|
+
"patch": "./cordis.patch.yml"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@unieai/rabi-experimental-worktree": "0.2.1-rc.3"
|
|
43
|
+
}
|
|
44
|
+
}
|