@willh/subtitle-correction-agent 0.1.1 → 0.1.2
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/index.js +5 -1
- package/package.json +27 -27
package/dist/index.js
CHANGED
|
@@ -4616,7 +4616,8 @@ async function runSubtitleCorrectionAgent(config) {
|
|
|
4616
4616
|
if (eventLogPath) {
|
|
4617
4617
|
console.log(`偵錯: Copilot events 記錄到 ${eventLogPath}`);
|
|
4618
4618
|
}
|
|
4619
|
-
const client = new CopilotClient;
|
|
4619
|
+
const client = new CopilotClient({ cliArgs: ["--allow-all-paths"] });
|
|
4620
|
+
const autoApprovePermission = async () => ({ kind: "approved" });
|
|
4620
4621
|
try {
|
|
4621
4622
|
await client.start();
|
|
4622
4623
|
const azureEndpoint = process.env.AZURE_OPENAI_ENDPOINT;
|
|
@@ -4642,6 +4643,7 @@ async function runSubtitleCorrectionAgent(config) {
|
|
|
4642
4643
|
}
|
|
4643
4644
|
session = await client.createSession({
|
|
4644
4645
|
model: azureDeployment,
|
|
4646
|
+
onPermissionRequest: autoApprovePermission,
|
|
4645
4647
|
streaming: true,
|
|
4646
4648
|
provider: {
|
|
4647
4649
|
type: "azure",
|
|
@@ -4660,6 +4662,7 @@ async function runSubtitleCorrectionAgent(config) {
|
|
|
4660
4662
|
}
|
|
4661
4663
|
session = await client.createSession({
|
|
4662
4664
|
model: "gpt-4o",
|
|
4665
|
+
onPermissionRequest: autoApprovePermission,
|
|
4663
4666
|
streaming: true,
|
|
4664
4667
|
provider: {
|
|
4665
4668
|
type: "openai",
|
|
@@ -4671,6 +4674,7 @@ async function runSubtitleCorrectionAgent(config) {
|
|
|
4671
4674
|
} else {
|
|
4672
4675
|
console.log("使用 GitHub Copilot 作為模型提供者");
|
|
4673
4676
|
session = await client.createSession({
|
|
4677
|
+
onPermissionRequest: autoApprovePermission,
|
|
4674
4678
|
tools
|
|
4675
4679
|
});
|
|
4676
4680
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willh/subtitle-correction-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "影片字幕校正代理人 - 使用 GitHub Copilot SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -9,30 +9,30 @@
|
|
|
9
9
|
"bin": {
|
|
10
10
|
"subtitle-correction-agent": "dist/index.js"
|
|
11
11
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"bump": "npm version patch --no-git-tag-version && npm install --package-lock-only",
|
|
15
|
+
"build": "bun build src/index.ts --outdir dist --target node --format esm",
|
|
16
|
+
"start": "npm run build && bun run src/index.ts",
|
|
17
|
+
"dev": "npm run build && bun run src/index.ts",
|
|
18
|
+
"prepack": "npm run build",
|
|
19
|
+
"test": "bun test",
|
|
20
|
+
"typecheck": "tsc --noEmit"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"subtitle",
|
|
24
|
+
"vtt",
|
|
25
|
+
"correction",
|
|
26
|
+
"copilot-sdk",
|
|
27
|
+
"agent"
|
|
28
|
+
],
|
|
29
|
+
"author": "Will 保哥",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@github/copilot-sdk": "^0.1.32"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^20.11.0",
|
|
36
|
+
"typescript": "^5.3.3"
|
|
38
37
|
}
|
|
38
|
+
}
|