@ai-sdk/harness-opencode 1.0.176 → 1.0.177
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/CHANGELOG.md +21 -0
- package/dist/bridge/host-tool-mcp.mjs.map +1 -1
- package/dist/bridge/index.mjs +279 -37
- package/dist/bridge/index.mjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/bridge/index.ts +231 -33
- package/src/bridge/opencode-project-isolation.ts +71 -0
- package/src/bridge/permission-paths.ts +168 -0
- package/src/opencode-auth.ts +25 -7
- package/src/opencode-bridge-protocol.ts +1 -0
- package/src/opencode-harness.ts +6 -0
package/src/opencode-auth.ts
CHANGED
|
@@ -172,13 +172,31 @@ export function createOpenCodeRequestTransformations({
|
|
|
172
172
|
environmentVariableName: 'OPENCODE_API_KEY',
|
|
173
173
|
matchUrl: 'https://opencode.ai/zen/go/v1',
|
|
174
174
|
});
|
|
175
|
-
case 'gitlab':
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
175
|
+
case 'gitlab': {
|
|
176
|
+
const credential = environment.GITLAB_TOKEN;
|
|
177
|
+
const sandboxCredential = sandboxEnvironment.GITLAB_TOKEN;
|
|
178
|
+
if (credential == null || sandboxCredential == null) return [];
|
|
179
|
+
|
|
180
|
+
const requestUrl = new URL(
|
|
181
|
+
`${environment.GITLAB_INSTANCE_URL ?? 'https://gitlab.com'}/api/v4/ai/third_party_agents/direct_access`,
|
|
182
|
+
);
|
|
183
|
+
return [
|
|
184
|
+
{
|
|
185
|
+
match: {
|
|
186
|
+
host: requestUrl.hostname,
|
|
187
|
+
path: { exact: requestUrl.pathname },
|
|
188
|
+
method: ['POST'],
|
|
189
|
+
headers: [
|
|
190
|
+
{
|
|
191
|
+
key: { exact: 'Authorization' },
|
|
192
|
+
value: { exact: `Bearer ${sandboxCredential}` },
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
transform: { headers: { Authorization: `Bearer ${credential}` } },
|
|
197
|
+
},
|
|
198
|
+
];
|
|
199
|
+
}
|
|
182
200
|
}
|
|
183
201
|
}
|
|
184
202
|
|
|
@@ -33,6 +33,7 @@ export const startMessageSchema = harnessV1BridgeStartBaseSchema
|
|
|
33
33
|
.omit({ builtinToolFiltering: true })
|
|
34
34
|
.extend({
|
|
35
35
|
prompt: harnessPromptContentSchema,
|
|
36
|
+
readableSkillRoots: z.array(z.string()).optional(),
|
|
36
37
|
operation: z.enum(['prompt', 'compact']).optional(),
|
|
37
38
|
provider: z.string().optional(),
|
|
38
39
|
variant: z.string().optional(),
|
package/src/opencode-harness.ts
CHANGED
|
@@ -1026,6 +1026,9 @@ function createSession({
|
|
|
1026
1026
|
? { instructions: promptOpts.instructions }
|
|
1027
1027
|
: {}),
|
|
1028
1028
|
skillsChanged: skillWriteResult.changed,
|
|
1029
|
+
readableSkillRoots: promptOpts.skills.map(
|
|
1030
|
+
skill => `${sandboxHomeDir}/.agents/skills/${skill.name}`,
|
|
1031
|
+
),
|
|
1029
1032
|
...startBase(turnModel),
|
|
1030
1033
|
});
|
|
1031
1034
|
pendingResumeSessionId = undefined;
|
|
@@ -1055,6 +1058,9 @@ function createSession({
|
|
|
1055
1058
|
? { instructions: continueOpts.instructions }
|
|
1056
1059
|
: {}),
|
|
1057
1060
|
skillsChanged: skillWriteResult.changed,
|
|
1061
|
+
readableSkillRoots: continueOpts.skills.map(
|
|
1062
|
+
skill => `${sandboxHomeDir}/.agents/skills/${skill.name}`,
|
|
1063
|
+
),
|
|
1058
1064
|
...startBase(turnModel),
|
|
1059
1065
|
});
|
|
1060
1066
|
pendingResumeSessionId = undefined;
|