@uniqbit/mate-opencode-plugin 0.16.0 → 0.17.0-canary.11
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/package.json +3 -3
- package/src/companion.ts +13 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniqbit/mate-opencode-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0-canary.11",
|
|
4
4
|
"description": "OpenCode plugin integration for Mate.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"registry": "https://registry.npmjs.org/"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"test": "CI=1 bun test",
|
|
20
|
+
"test": "CI=1 bun ../../test/run-isolated.ts",
|
|
21
21
|
"lint": "oxlint src/",
|
|
22
22
|
"lint:fix": "oxlint src/ --fix",
|
|
23
23
|
"format": "oxfmt src/",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@opentui/core": "^0.4.5",
|
|
29
29
|
"@opentui/keymap": "^0.4.5",
|
|
30
30
|
"@opentui/solid": "^0.4.5",
|
|
31
|
-
"@uniqbit/mate-core": "0.
|
|
31
|
+
"@uniqbit/mate-core": "0.17.0-canary.11"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/bun": "^1.3.14",
|
package/src/companion.ts
CHANGED
|
@@ -65,7 +65,7 @@ function buildSystemPrompt(context: CompanionContext, guidance: MateGuidanceFile
|
|
|
65
65
|
|
|
66
66
|
export const CompanionPlugin: Plugin = async () => {
|
|
67
67
|
const context = readContext();
|
|
68
|
-
if (!context.companionPath
|
|
68
|
+
if (!context.companionPath) {
|
|
69
69
|
return {};
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -77,7 +77,7 @@ export const CompanionPlugin: Plugin = async () => {
|
|
|
77
77
|
return {
|
|
78
78
|
tool: {
|
|
79
79
|
companion_paths: tool({
|
|
80
|
-
description: `Return active ${context.frameworkName}
|
|
80
|
+
description: `Return active ${context.frameworkName} companion framework and working repository paths.`,
|
|
81
81
|
args: {},
|
|
82
82
|
async execute() {
|
|
83
83
|
return {
|
|
@@ -85,8 +85,9 @@ export const CompanionPlugin: Plugin = async () => {
|
|
|
85
85
|
{
|
|
86
86
|
companionFrameworkPath: context.companionPath,
|
|
87
87
|
wrapperBinPath,
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
...(context.repositoryPath
|
|
89
|
+
? { repositoryPath: context.repositoryPath, repositoryId: context.repositoryId }
|
|
90
|
+
: {}),
|
|
90
91
|
policy: JSON.parse(context.policyJson || "{}"),
|
|
91
92
|
},
|
|
92
93
|
null,
|
|
@@ -95,7 +96,7 @@ export const CompanionPlugin: Plugin = async () => {
|
|
|
95
96
|
metadata: {
|
|
96
97
|
companionPath: context.companionPath,
|
|
97
98
|
wrapperBinPath,
|
|
98
|
-
repositoryPath: context.repositoryPath,
|
|
99
|
+
...(context.repositoryPath ? { repositoryPath: context.repositoryPath } : {}),
|
|
99
100
|
},
|
|
100
101
|
};
|
|
101
102
|
},
|
|
@@ -133,8 +134,13 @@ export const CompanionPlugin: Plugin = async () => {
|
|
|
133
134
|
output.env.MATE_VERSION = process.env.MATE_VERSION ?? "unknown";
|
|
134
135
|
output.env.MATE_ARTIFACT_PATH = context.companionPath;
|
|
135
136
|
output.env.MATE_WRAPPER_BIN_PATH = wrapperBinPath;
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
if (context.repositoryPath) {
|
|
138
|
+
output.env.MATE_REPO_PATH = context.repositoryPath;
|
|
139
|
+
output.env.MATE_REPO_ID = context.repositoryId;
|
|
140
|
+
} else {
|
|
141
|
+
delete output.env.MATE_REPO_PATH;
|
|
142
|
+
delete output.env.MATE_REPO_ID;
|
|
143
|
+
}
|
|
138
144
|
output.env.MATE_POLICY_JSON = context.policyJson;
|
|
139
145
|
output.env.MATE_GRAPHIFY_ENABLED = context.graphifyEnabled ? "1" : "0";
|
|
140
146
|
output.env.MATE_GIT_AUTO_MODE = context.gitAutoModeEnabled ? "1" : "0";
|