@uselemma/opencode 0.1.1 → 0.1.3
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/README.md +3 -1
- package/package.json +12 -2
- package/runtime/lemma.mjs +1378 -236
- package/scripts/setup.mjs +71 -2
package/scripts/setup.mjs
CHANGED
|
@@ -107,6 +107,69 @@ async function writeDataDirLocation(dataDir, options = {}) {
|
|
|
107
107
|
await writeSecureJson(locationPath, { version: 1, dataDir: absolute });
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
// package.json
|
|
111
|
+
var package_default = {
|
|
112
|
+
name: "@uselemma/opencode",
|
|
113
|
+
version: "0.1.3",
|
|
114
|
+
description: "Lemma SDK tracing for OpenCode coding-agent sessions",
|
|
115
|
+
license: "MIT",
|
|
116
|
+
author: "Lemma",
|
|
117
|
+
repository: {
|
|
118
|
+
type: "git",
|
|
119
|
+
url: "https://github.com/uselemma/lemma",
|
|
120
|
+
directory: "plugins/lemma-opencode"
|
|
121
|
+
},
|
|
122
|
+
homepage: "https://github.com/uselemma/lemma/tree/main/plugins/lemma-opencode#readme",
|
|
123
|
+
bugs: {
|
|
124
|
+
url: "https://github.com/uselemma/lemma/issues"
|
|
125
|
+
},
|
|
126
|
+
type: "module",
|
|
127
|
+
main: "./runtime/lemma.mjs",
|
|
128
|
+
types: "./runtime/lemma.d.ts",
|
|
129
|
+
exports: {
|
|
130
|
+
".": {
|
|
131
|
+
types: "./runtime/lemma.d.ts",
|
|
132
|
+
import: "./runtime/lemma.mjs",
|
|
133
|
+
default: "./runtime/lemma.mjs"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
bin: {
|
|
137
|
+
"lemma-opencode": "./scripts/setup.mjs"
|
|
138
|
+
},
|
|
139
|
+
files: [
|
|
140
|
+
"runtime/lemma.mjs",
|
|
141
|
+
"runtime/lemma.d.ts",
|
|
142
|
+
"scripts/setup.mjs",
|
|
143
|
+
"README.md"
|
|
144
|
+
],
|
|
145
|
+
keywords: [
|
|
146
|
+
"opencode",
|
|
147
|
+
"observability",
|
|
148
|
+
"tracing"
|
|
149
|
+
],
|
|
150
|
+
scripts: {
|
|
151
|
+
build: "node build.mjs",
|
|
152
|
+
"type-check": "tsc --noEmit",
|
|
153
|
+
test: "vitest run",
|
|
154
|
+
"verify:local": "pnpm run build && node verify-local.mjs",
|
|
155
|
+
prepublishOnly: "pnpm run type-check && pnpm run build"
|
|
156
|
+
},
|
|
157
|
+
dependencies: {
|
|
158
|
+
"@opencode-ai/plugin": "1.18.19",
|
|
159
|
+
"@uselemma/tracing": "workspace:^"
|
|
160
|
+
},
|
|
161
|
+
devDependencies: {
|
|
162
|
+
"@opencode-ai/sdk": "1.18.19",
|
|
163
|
+
"@types/node": "^22.18.8",
|
|
164
|
+
esbuild: "^0.25.11",
|
|
165
|
+
typescript: "^5.9.3",
|
|
166
|
+
vitest: "^3.2.4"
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// src/user-agent.ts
|
|
171
|
+
var PLUGIN_USER_AGENT = `${package_default.name}/${package_default.version}`;
|
|
172
|
+
|
|
110
173
|
// src/setup.ts
|
|
111
174
|
var DEFAULT_API_URL = "https://api.uselemma.ai";
|
|
112
175
|
var MANAGED_PLUGIN_MARKER = "// @uselemma/opencode managed plugin";
|
|
@@ -137,7 +200,10 @@ async function startDeviceAuthorization(apiUrl, fetchImplementation) {
|
|
|
137
200
|
`${apiUrl}/coding-harness/device-authorizations`,
|
|
138
201
|
{
|
|
139
202
|
method: "POST",
|
|
140
|
-
headers: {
|
|
203
|
+
headers: {
|
|
204
|
+
"content-type": "application/json",
|
|
205
|
+
"user-agent": PLUGIN_USER_AGENT
|
|
206
|
+
},
|
|
141
207
|
body: JSON.stringify({ harness: "opencode" })
|
|
142
208
|
}
|
|
143
209
|
)
|
|
@@ -161,7 +227,10 @@ async function pollDeviceAuthorization(apiUrl, deviceCode, fetchImplementation)
|
|
|
161
227
|
`${apiUrl}/coding-harness/device-authorizations/token`,
|
|
162
228
|
{
|
|
163
229
|
method: "POST",
|
|
164
|
-
headers: {
|
|
230
|
+
headers: {
|
|
231
|
+
"content-type": "application/json",
|
|
232
|
+
"user-agent": PLUGIN_USER_AGENT
|
|
233
|
+
},
|
|
165
234
|
body: JSON.stringify({ device_code: deviceCode })
|
|
166
235
|
}
|
|
167
236
|
);
|