@ai-sdk/harness-github-copilot 0.0.0 → 1.0.1
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 +20 -0
- package/LICENSE +13 -0
- package/README.md +41 -3
- package/dist/index.d.ts +11566 -0
- package/dist/index.js +420 -0
- package/dist/index.js.map +1 -0
- package/package.json +65 -11
- package/src/bridge/package.json +9 -0
- package/src/bridge/pnpm-lock.yaml +116 -0
- package/src/bridge/pnpm-workspace.yaml +2 -0
- package/src/github-copilot-harness.ts +467 -0
- package/src/index.ts +15 -0
- package/src/version.ts +5 -0
- package/index.js +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @ai-sdk/harness-github-copilot
|
|
2
|
+
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @ai-sdk/harness@1.0.106
|
|
8
|
+
- @ai-sdk/provider-utils@5.0.38
|
|
9
|
+
- @ai-sdk/harness-acp@1.0.44
|
|
10
|
+
|
|
11
|
+
## 1.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- 5ecd4f4: feat(harness-github-copilot): implement GitHub Copilot harness adapter
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- @ai-sdk/harness@1.0.105
|
|
20
|
+
- @ai-sdk/harness-acp@1.0.43
|
package/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2023 Vercel, Inc.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AI SDK - GitHub Copilot Harness
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The **[@ai-sdk/harness-github-copilot](https://www.npmjs.com/package/@ai-sdk/harness-github-copilot)** package runs GitHub Copilot CLI through its Agent Client Protocol server and the AI SDK harness abstraction.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @ai-sdk/harness @ai-sdk/harness-github-copilot @ai-sdk/sandbox-vercel
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { HarnessAgent } from '@ai-sdk/harness/agent';
|
|
15
|
+
import { githubCopilot } from '@ai-sdk/harness-github-copilot';
|
|
16
|
+
import { createVercelSandbox } from '@ai-sdk/sandbox-vercel';
|
|
17
|
+
|
|
18
|
+
const agent = new HarnessAgent({
|
|
19
|
+
harness: githubCopilot,
|
|
20
|
+
sandbox: createVercelSandbox({
|
|
21
|
+
runtime: 'node24',
|
|
22
|
+
ports: [4000],
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const session = await agent.createSession();
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
const result = await agent.generate({
|
|
30
|
+
session,
|
|
31
|
+
prompt: 'Inspect this project and summarize its purpose.',
|
|
32
|
+
});
|
|
33
|
+
console.log(result.text);
|
|
34
|
+
} finally {
|
|
35
|
+
await session.destroy();
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The adapter uses `@ai-sdk/harness-acp`, which installs the pinned GitHub Copilot CLI inside the sandbox. The sandbox must provide network access and at least one exposed TCP port.
|
|
40
|
+
|
|
41
|
+
Set one of `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, or `GITHUB_TOKEN` for direct authentication. Set `AI_GATEWAY_API_KEY` or `VERCEL_OIDC_TOKEN` to use AI Gateway instead, or pass an isolated authentication environment with `createGitHubCopilot({ auth: { AI_GATEWAY_API_KEY: token } })`.
|
|
42
|
+
|
|
43
|
+
See the [GitHub Copilot harness documentation](https://ai-sdk.dev/providers/ai-sdk-harnesses/github-copilot) for authentication security, settings, tools, and lifecycle support.
|