@timefly/opencode-plugin 0.2.9 → 0.2.10
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/install.d.ts.map +1 -1
- package/dist/install.js +5 -2
- package/package.json +2 -2
package/dist/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":";AA6JA,eAAO,MAAM,UAAU,GAAI,eAAe,MAAM,EAAE,KAAG,OAAO,CAAC,IAAI,CAGhE,CAAA"}
|
package/dist/install.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { resolveDefaultAuthFilePath } from '@timefly/ai-sdk';
|
|
5
|
+
import { resolveDefaultAuthFilePath, parseJsonText } from '@timefly/ai-sdk';
|
|
6
6
|
const PLUGIN_PACKAGE_LATEST = '@timefly/opencode-plugin@latest';
|
|
7
7
|
const TIMEFLY_PLUGIN_PATTERN = /^@timefly\/opencode-plugin(?:@|$)/;
|
|
8
8
|
const PRICING_URL = 'https://timefly.dev/pricing';
|
|
@@ -54,11 +54,14 @@ const clearOpenCodePluginCache = () => {
|
|
|
54
54
|
.catch(() => undefined);
|
|
55
55
|
};
|
|
56
56
|
const readConfigFile = (configPath) => readFile(configPath, 'utf8')
|
|
57
|
-
.then((configContent) =>
|
|
57
|
+
.then((configContent) => parseJsonText(configContent, {}))
|
|
58
58
|
.catch((error) => {
|
|
59
59
|
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
60
60
|
return {};
|
|
61
61
|
}
|
|
62
|
+
if (error instanceof SyntaxError) {
|
|
63
|
+
throw new Error(`Invalid OpenCode config at ${configPath}. If you edited it with PowerShell, remove the UTF-8 BOM or delete the file and run setup-opencode again.`);
|
|
64
|
+
}
|
|
62
65
|
throw error;
|
|
63
66
|
});
|
|
64
67
|
const resolvePluginEntry = (options) => options.useLocalPath ? localPluginPath.replaceAll('\\', '/') : PLUGIN_PACKAGE_LATEST;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timefly/opencode-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "TimeFly telemetry plugin for OpenCode — sessions, tokens, models, and tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/cli.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"license": "MIT",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@timefly/ai-sdk": "^0.2.
|
|
53
|
+
"@timefly/ai-sdk": "^0.2.3"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@opencode-ai/plugin": ">=1.0.0"
|