backup 2026-05-20T03:27:17.780508
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .opencode/.gitignore +5 -0
- .opencode/node_modules/.bin/download-msgpackr-prebuilds +13 -0
- .opencode/node_modules/.bin/node-gyp-build-optional-packages +82 -0
- .opencode/node_modules/.bin/node-gyp-build-optional-packages-optional +7 -0
- .opencode/node_modules/.bin/node-gyp-build-optional-packages-test +19 -0
- .opencode/node_modules/.bin/node-which +52 -0
- .opencode/node_modules/.bin/uuid +2 -0
- .opencode/node_modules/.bin/yaml +11 -0
- .opencode/node_modules/.package-lock.json +313 -0
- .opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/README.md +1 -0
- .opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/index.js +0 -0
- .opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.abi115.glibc.node +0 -0
- .opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.abi115.musl.node +0 -0
- .opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.napi.glibc.node +0 -0
- .opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.napi.musl.node +0 -0
- .opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/package.json +17 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/example-workspace.d.ts +3 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/example-workspace.js +30 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/example.d.ts +2 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/example.js +16 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/index.d.ts +316 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/index.js +1 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/shell.d.ts +109 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/shell.js +1 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/tool.d.ts +60 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/tool.js +5 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/tui.d.ts +508 -0
- .opencode/node_modules/@opencode-ai/plugin/dist/tui.js +7 -0
- .opencode/node_modules/@opencode-ai/plugin/package.json +58 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/client.d.ts +7 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/client.js +53 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/error-interceptor.d.ts +15 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/error-interceptor.js +43 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client.gen.d.ts +12 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client.gen.js +5 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client/client.gen.d.ts +2 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client/client.gen.js +165 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client/index.d.ts +7 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client/index.js +5 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client/types.gen.d.ts +127 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client/types.gen.js +2 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client/utils.gen.d.ts +38 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/client/utils.gen.js +226 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/core/auth.gen.d.ts +18 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/core/auth.gen.js +14 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/core/bodySerializer.gen.d.ts +17 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/core/bodySerializer.gen.js +57 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/core/params.gen.d.ts +33 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/core/params.gen.js +89 -0
- .opencode/node_modules/@opencode-ai/sdk/dist/gen/core/pathSerializer.gen.d.ts +33 -0
.opencode/.gitignore
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
node_modules
|
| 2 |
+
package.json
|
| 3 |
+
package-lock.json
|
| 4 |
+
bun.lock
|
| 5 |
+
.gitignore
|
.opencode/node_modules/.bin/download-msgpackr-prebuilds
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
|
| 3 |
+
const { dirname } = require('path');
|
| 4 |
+
const { fileURLToPath } = require('url');
|
| 5 |
+
const { exec } = require('child_process');
|
| 6 |
+
|
| 7 |
+
process.chdir(dirname(__dirname));
|
| 8 |
+
exec('prebuildify-ci download', (error, stdout, stderr) => {
|
| 9 |
+
console.error(stderr);
|
| 10 |
+
console.log(stdout);
|
| 11 |
+
if (error?.code)
|
| 12 |
+
process.exit(error.code);
|
| 13 |
+
});
|
.opencode/node_modules/.bin/node-gyp-build-optional-packages
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
|
| 3 |
+
var proc = require('child_process')
|
| 4 |
+
var os = require('os')
|
| 5 |
+
var path = require('path')
|
| 6 |
+
|
| 7 |
+
if (!buildFromSource()) {
|
| 8 |
+
proc.exec('node-gyp-build-optional-packages-test', function (err, stdout, stderr) {
|
| 9 |
+
if (err) {
|
| 10 |
+
console.error(stderr)
|
| 11 |
+
console.error('The failure above indicates the primary issue with the native builds which are included for all' +
|
| 12 |
+
' major platforms. Will now attempt to build the package locally in case this can be resolved by' +
|
| 13 |
+
' re-compiling.')
|
| 14 |
+
preinstall()
|
| 15 |
+
}
|
| 16 |
+
})
|
| 17 |
+
} else {
|
| 18 |
+
preinstall()
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
function build () {
|
| 22 |
+
var win32 = os.platform() === 'win32'
|
| 23 |
+
var args = [win32 ? 'node-gyp.cmd' : 'node-gyp', 'rebuild']
|
| 24 |
+
|
| 25 |
+
try {
|
| 26 |
+
var pkg = require('node-gyp/package.json')
|
| 27 |
+
args = [
|
| 28 |
+
process.execPath,
|
| 29 |
+
path.join(require.resolve('node-gyp/package.json'), '..', typeof pkg.bin === 'string' ? pkg.bin : pkg.bin['node-gyp']),
|
| 30 |
+
'rebuild'
|
| 31 |
+
]
|
| 32 |
+
} catch (_) {}
|
| 33 |
+
|
| 34 |
+
proc.spawn(args[0], args.slice(1), { stdio: 'inherit', shell: win32, windowsHide: true }).on('exit', function (code) {
|
| 35 |
+
if (code || !process.argv[3]) process.exit(code)
|
| 36 |
+
exec(process.argv[3]).on('exit', function (code) {
|
| 37 |
+
process.exit(code)
|
| 38 |
+
})
|
| 39 |
+
})
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
function preinstall () {
|
| 43 |
+
if (!process.argv[2]) return build()
|
| 44 |
+
exec(process.argv[2]).on('exit', function (code) {
|
| 45 |
+
if (code) process.exit(code)
|
| 46 |
+
build()
|
| 47 |
+
})
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
function exec (cmd) {
|
| 51 |
+
if (process.platform !== 'win32') {
|
| 52 |
+
var shell = os.platform() === 'android' ? 'sh' : true
|
| 53 |
+
return proc.spawn(cmd, [], {
|
| 54 |
+
shell,
|
| 55 |
+
stdio: 'inherit'
|
| 56 |
+
})
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
return proc.spawn(cmd, [], {
|
| 60 |
+
windowsVerbatimArguments: true,
|
| 61 |
+
stdio: 'inherit',
|
| 62 |
+
shell: true,
|
| 63 |
+
windowsHide: true
|
| 64 |
+
})
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
function buildFromSource () {
|
| 68 |
+
return hasFlag('--build-from-source') || process.env.npm_config_build_from_source === 'true'
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
// TODO (next major): remove in favor of env.npm_config_* which works since npm
|
| 73 |
+
// 0.1.8 while npm_config_argv will stop working in npm 7. See npm/rfcs#90
|
| 74 |
+
function hasFlag (flag) {
|
| 75 |
+
if (!process.env.npm_config_argv) return false
|
| 76 |
+
|
| 77 |
+
try {
|
| 78 |
+
return JSON.parse(process.env.npm_config_argv).original.indexOf(flag) !== -1
|
| 79 |
+
} catch (_) {
|
| 80 |
+
return false
|
| 81 |
+
}
|
| 82 |
+
}
|
.opencode/node_modules/.bin/node-gyp-build-optional-packages-optional
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
|
| 3 |
+
/*
|
| 4 |
+
I am only useful as an install script to make node-gyp not compile for purely optional native deps
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
process.exit(0)
|
.opencode/node_modules/.bin/node-gyp-build-optional-packages-test
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
|
| 3 |
+
process.env.NODE_ENV = 'test'
|
| 4 |
+
|
| 5 |
+
var path = require('path')
|
| 6 |
+
var test = null
|
| 7 |
+
|
| 8 |
+
try {
|
| 9 |
+
var pkg = require(path.join(process.cwd(), 'package.json'))
|
| 10 |
+
if (pkg.name && process.env[pkg.name.toUpperCase().replace(/-/g, '_')]) {
|
| 11 |
+
process.exit(0)
|
| 12 |
+
}
|
| 13 |
+
test = pkg.prebuild.test
|
| 14 |
+
} catch (err) {
|
| 15 |
+
// do nothing
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
if (test) require(path.join(process.cwd(), test))
|
| 19 |
+
else require('./')()
|
.opencode/node_modules/.bin/node-which
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
var which = require("../")
|
| 3 |
+
if (process.argv.length < 3)
|
| 4 |
+
usage()
|
| 5 |
+
|
| 6 |
+
function usage () {
|
| 7 |
+
console.error('usage: which [-as] program ...')
|
| 8 |
+
process.exit(1)
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
var all = false
|
| 12 |
+
var silent = false
|
| 13 |
+
var dashdash = false
|
| 14 |
+
var args = process.argv.slice(2).filter(function (arg) {
|
| 15 |
+
if (dashdash || !/^-/.test(arg))
|
| 16 |
+
return true
|
| 17 |
+
|
| 18 |
+
if (arg === '--') {
|
| 19 |
+
dashdash = true
|
| 20 |
+
return false
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
var flags = arg.substr(1).split('')
|
| 24 |
+
for (var f = 0; f < flags.length; f++) {
|
| 25 |
+
var flag = flags[f]
|
| 26 |
+
switch (flag) {
|
| 27 |
+
case 's':
|
| 28 |
+
silent = true
|
| 29 |
+
break
|
| 30 |
+
case 'a':
|
| 31 |
+
all = true
|
| 32 |
+
break
|
| 33 |
+
default:
|
| 34 |
+
console.error('which: illegal option -- ' + flag)
|
| 35 |
+
usage()
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
return false
|
| 39 |
+
})
|
| 40 |
+
|
| 41 |
+
process.exit(args.reduce(function (pv, current) {
|
| 42 |
+
try {
|
| 43 |
+
var f = which.sync(current, { all: all })
|
| 44 |
+
if (all)
|
| 45 |
+
f = f.join('\n')
|
| 46 |
+
if (!silent)
|
| 47 |
+
console.log(f)
|
| 48 |
+
return pv;
|
| 49 |
+
} catch (e) {
|
| 50 |
+
return 1;
|
| 51 |
+
}
|
| 52 |
+
}, 0))
|
.opencode/node_modules/.bin/uuid
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
import '../uuid-bin.js';
|
.opencode/node_modules/.bin/yaml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
|
| 3 |
+
import { UserError, cli, help } from './dist/cli.mjs'
|
| 4 |
+
|
| 5 |
+
cli(process.stdin, error => {
|
| 6 |
+
if (error instanceof UserError) {
|
| 7 |
+
if (error.code === UserError.ARGS) console.error(`${help}\n`)
|
| 8 |
+
console.error(error.message)
|
| 9 |
+
process.exitCode = error.code
|
| 10 |
+
} else if (error) throw error
|
| 11 |
+
})
|
.opencode/node_modules/.package-lock.json
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": ".opencode",
|
| 3 |
+
"version": "file:../../../data/.opencode",
|
| 4 |
+
"lockfileVersion": 3,
|
| 5 |
+
"requires": true,
|
| 6 |
+
"packages": {
|
| 7 |
+
"../../../data/.opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": {
|
| 8 |
+
"version": "3.0.3",
|
| 9 |
+
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz",
|
| 10 |
+
"integrity": "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg==",
|
| 11 |
+
"cpu": [
|
| 12 |
+
"x64"
|
| 13 |
+
],
|
| 14 |
+
"license": "MIT",
|
| 15 |
+
"optional": true,
|
| 16 |
+
"os": [
|
| 17 |
+
"linux"
|
| 18 |
+
]
|
| 19 |
+
},
|
| 20 |
+
"../../../data/.opencode/node_modules/@opencode-ai/plugin": {
|
| 21 |
+
"version": "1.15.5",
|
| 22 |
+
"resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.15.5.tgz",
|
| 23 |
+
"integrity": "sha512-QvhrDLlQuLeFGET1zB2crMWPvou6PpAzYtKrbun9akWvaskyAcXIAVn3lNYX/InMcut5VzL6ERbPgvM7ucHfLA==",
|
| 24 |
+
"license": "MIT",
|
| 25 |
+
"dependencies": {
|
| 26 |
+
"@opencode-ai/sdk": "1.15.5",
|
| 27 |
+
"effect": "4.0.0-beta.65",
|
| 28 |
+
"zod": "4.1.8"
|
| 29 |
+
},
|
| 30 |
+
"peerDependencies": {
|
| 31 |
+
"@opentui/core": ">=0.2.14",
|
| 32 |
+
"@opentui/keymap": ">=0.2.14",
|
| 33 |
+
"@opentui/solid": ">=0.2.14"
|
| 34 |
+
},
|
| 35 |
+
"peerDependenciesMeta": {
|
| 36 |
+
"@opentui/core": {
|
| 37 |
+
"optional": true
|
| 38 |
+
},
|
| 39 |
+
"@opentui/keymap": {
|
| 40 |
+
"optional": true
|
| 41 |
+
},
|
| 42 |
+
"@opentui/solid": {
|
| 43 |
+
"optional": true
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
},
|
| 47 |
+
"../../../data/.opencode/node_modules/@opencode-ai/sdk": {
|
| 48 |
+
"version": "1.15.5",
|
| 49 |
+
"resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.15.5.tgz",
|
| 50 |
+
"integrity": "sha512-ozJuEmXzrOvia5n0L1KAuvpyf9ESGmTk1FiPhn0RK5X1whbzjlTXL0NAxqNCEkqETxL35jS1KHArEiTpvtJ6FQ==",
|
| 51 |
+
"license": "MIT",
|
| 52 |
+
"dependencies": {
|
| 53 |
+
"cross-spawn": "7.0.6"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"../../../data/.opencode/node_modules/@standard-schema/spec": {
|
| 57 |
+
"version": "1.1.0",
|
| 58 |
+
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
|
| 59 |
+
"integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
|
| 60 |
+
"license": "MIT"
|
| 61 |
+
},
|
| 62 |
+
"../../../data/.opencode/node_modules/cross-spawn": {
|
| 63 |
+
"version": "7.0.6",
|
| 64 |
+
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
| 65 |
+
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
| 66 |
+
"license": "MIT",
|
| 67 |
+
"dependencies": {
|
| 68 |
+
"path-key": "^3.1.0",
|
| 69 |
+
"shebang-command": "^2.0.0",
|
| 70 |
+
"which": "^2.0.1"
|
| 71 |
+
},
|
| 72 |
+
"engines": {
|
| 73 |
+
"node": ">= 8"
|
| 74 |
+
}
|
| 75 |
+
},
|
| 76 |
+
"../../../data/.opencode/node_modules/detect-libc": {
|
| 77 |
+
"version": "2.1.2",
|
| 78 |
+
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
| 79 |
+
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
|
| 80 |
+
"license": "Apache-2.0",
|
| 81 |
+
"optional": true,
|
| 82 |
+
"engines": {
|
| 83 |
+
"node": ">=8"
|
| 84 |
+
}
|
| 85 |
+
},
|
| 86 |
+
"../../../data/.opencode/node_modules/effect": {
|
| 87 |
+
"version": "4.0.0-beta.65",
|
| 88 |
+
"resolved": "https://registry.npmjs.org/effect/-/effect-4.0.0-beta.65.tgz",
|
| 89 |
+
"integrity": "sha512-QYKvQPAj3CmtsvWkHQww15wX4KG2gNsszDWEcOO5sZCMknp66u6Si/Opmt3wwWCwsyvRmDAdIg+JIz5qzbbFIw==",
|
| 90 |
+
"license": "MIT",
|
| 91 |
+
"dependencies": {
|
| 92 |
+
"@standard-schema/spec": "^1.1.0",
|
| 93 |
+
"fast-check": "^4.6.0",
|
| 94 |
+
"find-my-way-ts": "^0.1.6",
|
| 95 |
+
"ini": "^6.0.0",
|
| 96 |
+
"kubernetes-types": "^1.30.0",
|
| 97 |
+
"msgpackr": "^1.11.9",
|
| 98 |
+
"multipasta": "^0.2.7",
|
| 99 |
+
"toml": "^4.1.1",
|
| 100 |
+
"uuid": "^13.0.0",
|
| 101 |
+
"yaml": "^2.8.3"
|
| 102 |
+
}
|
| 103 |
+
},
|
| 104 |
+
"../../../data/.opencode/node_modules/fast-check": {
|
| 105 |
+
"version": "4.8.0",
|
| 106 |
+
"resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.8.0.tgz",
|
| 107 |
+
"integrity": "sha512-GOJ158CUMnN6cSahsv4+ExARvIDuzzinFjkp0E9WtiBa5zcVeLozVkWaE4IzFcc+Y48Wp1EDlUZsXRyAztQcSg==",
|
| 108 |
+
"funding": [
|
| 109 |
+
{
|
| 110 |
+
"type": "individual",
|
| 111 |
+
"url": "https://github.com/sponsors/dubzzz"
|
| 112 |
+
},
|
| 113 |
+
{
|
| 114 |
+
"type": "opencollective",
|
| 115 |
+
"url": "https://opencollective.com/fast-check"
|
| 116 |
+
}
|
| 117 |
+
],
|
| 118 |
+
"license": "MIT",
|
| 119 |
+
"dependencies": {
|
| 120 |
+
"pure-rand": "^8.0.0"
|
| 121 |
+
},
|
| 122 |
+
"engines": {
|
| 123 |
+
"node": ">=12.17.0"
|
| 124 |
+
}
|
| 125 |
+
},
|
| 126 |
+
"../../../data/.opencode/node_modules/find-my-way-ts": {
|
| 127 |
+
"version": "0.1.6",
|
| 128 |
+
"resolved": "https://registry.npmjs.org/find-my-way-ts/-/find-my-way-ts-0.1.6.tgz",
|
| 129 |
+
"integrity": "sha512-a85L9ZoXtNAey3Y6Z+eBWW658kO/MwR7zIafkIUPUMf3isZG0NCs2pjW2wtjxAKuJPxMAsHUIP4ZPGv0o5gyTA==",
|
| 130 |
+
"license": "MIT"
|
| 131 |
+
},
|
| 132 |
+
"../../../data/.opencode/node_modules/ini": {
|
| 133 |
+
"version": "6.0.0",
|
| 134 |
+
"resolved": "https://registry.npmjs.org/ini/-/ini-6.0.0.tgz",
|
| 135 |
+
"integrity": "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==",
|
| 136 |
+
"license": "ISC",
|
| 137 |
+
"engines": {
|
| 138 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 139 |
+
}
|
| 140 |
+
},
|
| 141 |
+
"../../../data/.opencode/node_modules/isexe": {
|
| 142 |
+
"version": "2.0.0",
|
| 143 |
+
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
| 144 |
+
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
| 145 |
+
"license": "ISC"
|
| 146 |
+
},
|
| 147 |
+
"../../../data/.opencode/node_modules/kubernetes-types": {
|
| 148 |
+
"version": "1.30.0",
|
| 149 |
+
"resolved": "https://registry.npmjs.org/kubernetes-types/-/kubernetes-types-1.30.0.tgz",
|
| 150 |
+
"integrity": "sha512-Dew1okvhM/SQcIa2rcgujNndZwU8VnSapDgdxlYoB84ZlpAD43U6KLAFqYo17ykSFGHNPrg0qry0bP+GJd9v7Q==",
|
| 151 |
+
"license": "Apache-2.0"
|
| 152 |
+
},
|
| 153 |
+
"../../../data/.opencode/node_modules/msgpackr": {
|
| 154 |
+
"version": "1.11.12",
|
| 155 |
+
"resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.12.tgz",
|
| 156 |
+
"integrity": "sha512-RBdJ1Un7yGlXWajrkxcSa93nvQ0w4zBf60c0yYv7YtBelP8H2FA7XsfBbMHtXKXUMUxH7zV3Zuozh+kUQWhHvg==",
|
| 157 |
+
"license": "MIT",
|
| 158 |
+
"optionalDependencies": {
|
| 159 |
+
"msgpackr-extract": "^3.0.2"
|
| 160 |
+
}
|
| 161 |
+
},
|
| 162 |
+
"../../../data/.opencode/node_modules/msgpackr-extract": {
|
| 163 |
+
"version": "3.0.3",
|
| 164 |
+
"resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.3.tgz",
|
| 165 |
+
"integrity": "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==",
|
| 166 |
+
"hasInstallScript": true,
|
| 167 |
+
"license": "MIT",
|
| 168 |
+
"optional": true,
|
| 169 |
+
"dependencies": {
|
| 170 |
+
"node-gyp-build-optional-packages": "5.2.2"
|
| 171 |
+
},
|
| 172 |
+
"bin": {
|
| 173 |
+
"download-msgpackr-prebuilds": "bin/download-prebuilds.js"
|
| 174 |
+
},
|
| 175 |
+
"optionalDependencies": {
|
| 176 |
+
"@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3",
|
| 177 |
+
"@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3",
|
| 178 |
+
"@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3",
|
| 179 |
+
"@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3",
|
| 180 |
+
"@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3",
|
| 181 |
+
"@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3"
|
| 182 |
+
}
|
| 183 |
+
},
|
| 184 |
+
"../../../data/.opencode/node_modules/multipasta": {
|
| 185 |
+
"version": "0.2.7",
|
| 186 |
+
"resolved": "https://registry.npmjs.org/multipasta/-/multipasta-0.2.7.tgz",
|
| 187 |
+
"integrity": "sha512-KPA58d68KgGil15oDqXjkUBEBYc00XvbPj5/X+dyzeo/lWm9Nc25pQRlf1D+gv4OpK7NM0J1odrbu9JNNGvynA==",
|
| 188 |
+
"license": "MIT"
|
| 189 |
+
},
|
| 190 |
+
"../../../data/.opencode/node_modules/node-gyp-build-optional-packages": {
|
| 191 |
+
"version": "5.2.2",
|
| 192 |
+
"resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz",
|
| 193 |
+
"integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==",
|
| 194 |
+
"license": "MIT",
|
| 195 |
+
"optional": true,
|
| 196 |
+
"dependencies": {
|
| 197 |
+
"detect-libc": "^2.0.1"
|
| 198 |
+
},
|
| 199 |
+
"bin": {
|
| 200 |
+
"node-gyp-build-optional-packages": "bin.js",
|
| 201 |
+
"node-gyp-build-optional-packages-optional": "optional.js",
|
| 202 |
+
"node-gyp-build-optional-packages-test": "build-test.js"
|
| 203 |
+
}
|
| 204 |
+
},
|
| 205 |
+
"../../../data/.opencode/node_modules/path-key": {
|
| 206 |
+
"version": "3.1.1",
|
| 207 |
+
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
| 208 |
+
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
| 209 |
+
"license": "MIT",
|
| 210 |
+
"engines": {
|
| 211 |
+
"node": ">=8"
|
| 212 |
+
}
|
| 213 |
+
},
|
| 214 |
+
"../../../data/.opencode/node_modules/pure-rand": {
|
| 215 |
+
"version": "8.4.0",
|
| 216 |
+
"resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-8.4.0.tgz",
|
| 217 |
+
"integrity": "sha512-IoM8YF/jY0hiugFo/wOWqfmarlE6J0wc6fDK1PhftMk7MGhVZl88sZimmqBBFomLOCSmcCCpsfj7wXASCpvK9A==",
|
| 218 |
+
"funding": [
|
| 219 |
+
{
|
| 220 |
+
"type": "individual",
|
| 221 |
+
"url": "https://github.com/sponsors/dubzzz"
|
| 222 |
+
},
|
| 223 |
+
{
|
| 224 |
+
"type": "opencollective",
|
| 225 |
+
"url": "https://opencollective.com/fast-check"
|
| 226 |
+
}
|
| 227 |
+
],
|
| 228 |
+
"license": "MIT"
|
| 229 |
+
},
|
| 230 |
+
"../../../data/.opencode/node_modules/shebang-command": {
|
| 231 |
+
"version": "2.0.0",
|
| 232 |
+
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
| 233 |
+
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
| 234 |
+
"license": "MIT",
|
| 235 |
+
"dependencies": {
|
| 236 |
+
"shebang-regex": "^3.0.0"
|
| 237 |
+
},
|
| 238 |
+
"engines": {
|
| 239 |
+
"node": ">=8"
|
| 240 |
+
}
|
| 241 |
+
},
|
| 242 |
+
"../../../data/.opencode/node_modules/shebang-regex": {
|
| 243 |
+
"version": "3.0.0",
|
| 244 |
+
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
| 245 |
+
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
| 246 |
+
"license": "MIT",
|
| 247 |
+
"engines": {
|
| 248 |
+
"node": ">=8"
|
| 249 |
+
}
|
| 250 |
+
},
|
| 251 |
+
"../../../data/.opencode/node_modules/toml": {
|
| 252 |
+
"version": "4.1.1",
|
| 253 |
+
"resolved": "https://registry.npmjs.org/toml/-/toml-4.1.1.tgz",
|
| 254 |
+
"integrity": "sha512-EBJnVBr3dTXdA89WVFoAIPUqkBjxPMwRqsfuo1r240tKFHXv3zgca4+NJib/h6TyvGF7vOawz0jGuryJCdNHrw==",
|
| 255 |
+
"license": "MIT",
|
| 256 |
+
"engines": {
|
| 257 |
+
"node": ">=20"
|
| 258 |
+
}
|
| 259 |
+
},
|
| 260 |
+
"../../../data/.opencode/node_modules/uuid": {
|
| 261 |
+
"version": "13.0.2",
|
| 262 |
+
"resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.2.tgz",
|
| 263 |
+
"integrity": "sha512-vzi9uRZ926x4XV73S/4qQaTwPXM2JBj6/6lI/byHH1jOpCzb0zDbfytgA9LcN/hzb2l7WQSQnxITOVx5un/wGw==",
|
| 264 |
+
"funding": [
|
| 265 |
+
"https://github.com/sponsors/broofa",
|
| 266 |
+
"https://github.com/sponsors/ctavan"
|
| 267 |
+
],
|
| 268 |
+
"license": "MIT",
|
| 269 |
+
"bin": {
|
| 270 |
+
"uuid": "dist-node/bin/uuid"
|
| 271 |
+
}
|
| 272 |
+
},
|
| 273 |
+
"../../../data/.opencode/node_modules/which": {
|
| 274 |
+
"version": "2.0.2",
|
| 275 |
+
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
| 276 |
+
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
| 277 |
+
"license": "ISC",
|
| 278 |
+
"dependencies": {
|
| 279 |
+
"isexe": "^2.0.0"
|
| 280 |
+
},
|
| 281 |
+
"bin": {
|
| 282 |
+
"node-which": "bin/node-which"
|
| 283 |
+
},
|
| 284 |
+
"engines": {
|
| 285 |
+
"node": ">= 8"
|
| 286 |
+
}
|
| 287 |
+
},
|
| 288 |
+
"../../../data/.opencode/node_modules/yaml": {
|
| 289 |
+
"version": "2.9.0",
|
| 290 |
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
|
| 291 |
+
"integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
|
| 292 |
+
"license": "ISC",
|
| 293 |
+
"bin": {
|
| 294 |
+
"yaml": "bin.mjs"
|
| 295 |
+
},
|
| 296 |
+
"engines": {
|
| 297 |
+
"node": ">= 14.6"
|
| 298 |
+
},
|
| 299 |
+
"funding": {
|
| 300 |
+
"url": "https://github.com/sponsors/eemeli"
|
| 301 |
+
}
|
| 302 |
+
},
|
| 303 |
+
"../../../data/.opencode/node_modules/zod": {
|
| 304 |
+
"version": "4.1.8",
|
| 305 |
+
"resolved": "https://registry.npmjs.org/zod/-/zod-4.1.8.tgz",
|
| 306 |
+
"integrity": "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==",
|
| 307 |
+
"license": "MIT",
|
| 308 |
+
"funding": {
|
| 309 |
+
"url": "https://github.com/sponsors/colinhacks"
|
| 310 |
+
}
|
| 311 |
+
}
|
| 312 |
+
}
|
| 313 |
+
}
|
.opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Platform specific binary for msgpackr-extract on linux OS with x64 architecture
|
.opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/index.js
ADDED
|
File without changes
|
.opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.abi115.glibc.node
ADDED
|
Binary file (17.5 kB). View file
|
|
|
.opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.abi115.musl.node
ADDED
|
Binary file (13 kB). View file
|
|
|
.opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.napi.glibc.node
ADDED
|
Binary file (17.4 kB). View file
|
|
|
.opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.napi.musl.node
ADDED
|
Binary file (13 kB). View file
|
|
|
.opencode/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@msgpackr-extract/msgpackr-extract-linux-x64",
|
| 3 |
+
"version": "3.0.3",
|
| 4 |
+
"os": [
|
| 5 |
+
"linux"
|
| 6 |
+
],
|
| 7 |
+
"cpu": [
|
| 8 |
+
"x64"
|
| 9 |
+
],
|
| 10 |
+
"license": "MIT",
|
| 11 |
+
"author": "Kris Zyp",
|
| 12 |
+
"repository": {
|
| 13 |
+
"type": "git",
|
| 14 |
+
"url": "http://github.com/kriszyp/msgpackr-extract"
|
| 15 |
+
},
|
| 16 |
+
"description": "Platform specific binary for msgpackr-extract on linux OS with x64 architecture"
|
| 17 |
+
}
|
.opencode/node_modules/@opencode-ai/plugin/dist/example-workspace.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { Plugin } from "@opencode-ai/plugin";
|
| 2 |
+
export declare const FolderWorkspacePlugin: Plugin;
|
| 3 |
+
export default FolderWorkspacePlugin;
|
.opencode/node_modules/@opencode-ai/plugin/dist/example-workspace.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { mkdir, rm } from "node:fs/promises";
|
| 2 |
+
export const FolderWorkspacePlugin = async ({ experimental_workspace }) => {
|
| 3 |
+
experimental_workspace.register("folder", {
|
| 4 |
+
name: "Folder",
|
| 5 |
+
description: "Create a blank folder",
|
| 6 |
+
configure(config) {
|
| 7 |
+
const rand = "" + Math.random();
|
| 8 |
+
return {
|
| 9 |
+
...config,
|
| 10 |
+
directory: `/tmp/folder/folder-${rand}`,
|
| 11 |
+
};
|
| 12 |
+
},
|
| 13 |
+
async create(config) {
|
| 14 |
+
if (!config.directory)
|
| 15 |
+
return;
|
| 16 |
+
await mkdir(config.directory, { recursive: true });
|
| 17 |
+
},
|
| 18 |
+
async remove(config) {
|
| 19 |
+
await rm(config.directory, { recursive: true, force: true });
|
| 20 |
+
},
|
| 21 |
+
target(config) {
|
| 22 |
+
return {
|
| 23 |
+
type: "local",
|
| 24 |
+
directory: config.directory,
|
| 25 |
+
};
|
| 26 |
+
},
|
| 27 |
+
});
|
| 28 |
+
return {};
|
| 29 |
+
};
|
| 30 |
+
export default FolderWorkspacePlugin;
|
.opencode/node_modules/@opencode-ai/plugin/dist/example.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Plugin } from "./index.js";
|
| 2 |
+
export declare const ExamplePlugin: Plugin;
|
.opencode/node_modules/@opencode-ai/plugin/dist/example.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { tool } from "./tool.js";
|
| 2 |
+
export const ExamplePlugin = async (_ctx) => {
|
| 3 |
+
return {
|
| 4 |
+
tool: {
|
| 5 |
+
mytool: tool({
|
| 6 |
+
description: "This is a custom tool",
|
| 7 |
+
args: {
|
| 8 |
+
foo: tool.schema.string().describe("foo"),
|
| 9 |
+
},
|
| 10 |
+
async execute(args) {
|
| 11 |
+
return `Hello ${args.foo}!`;
|
| 12 |
+
},
|
| 13 |
+
}),
|
| 14 |
+
},
|
| 15 |
+
};
|
| 16 |
+
};
|
.opencode/node_modules/@opencode-ai/plugin/dist/index.d.ts
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { Event, createOpencodeClient, Project, Model, Provider, Permission, UserMessage, Message, Part, Config as SDKConfig } from "@opencode-ai/sdk";
|
| 2 |
+
import type { Provider as ProviderV2, Model as ModelV2, Auth } from "@opencode-ai/sdk/v2";
|
| 3 |
+
import type { BunShell } from "./shell.js";
|
| 4 |
+
import { type ToolDefinition } from "./tool.js";
|
| 5 |
+
export * from "./tool.js";
|
| 6 |
+
export type ProviderContext = {
|
| 7 |
+
source: "env" | "config" | "custom" | "api";
|
| 8 |
+
info: Provider;
|
| 9 |
+
options: Record<string, any>;
|
| 10 |
+
};
|
| 11 |
+
export type WorkspaceInfo = {
|
| 12 |
+
id: string;
|
| 13 |
+
type: string;
|
| 14 |
+
name: string;
|
| 15 |
+
branch: string | null;
|
| 16 |
+
directory: string | null;
|
| 17 |
+
extra: unknown | null;
|
| 18 |
+
projectID: string;
|
| 19 |
+
};
|
| 20 |
+
export type WorkspaceTarget = {
|
| 21 |
+
type: "local";
|
| 22 |
+
directory: string;
|
| 23 |
+
} | {
|
| 24 |
+
type: "remote";
|
| 25 |
+
url: string | URL;
|
| 26 |
+
headers?: HeadersInit;
|
| 27 |
+
};
|
| 28 |
+
export type WorkspaceAdapter = {
|
| 29 |
+
name: string;
|
| 30 |
+
description: string;
|
| 31 |
+
configure(config: WorkspaceInfo): WorkspaceInfo | Promise<WorkspaceInfo>;
|
| 32 |
+
create(config: WorkspaceInfo, env: Record<string, string | undefined>, from?: WorkspaceInfo): Promise<void>;
|
| 33 |
+
remove(config: WorkspaceInfo): Promise<void>;
|
| 34 |
+
target(config: WorkspaceInfo): WorkspaceTarget | Promise<WorkspaceTarget>;
|
| 35 |
+
};
|
| 36 |
+
export type PluginInput = {
|
| 37 |
+
client: ReturnType<typeof createOpencodeClient>;
|
| 38 |
+
project: Project;
|
| 39 |
+
directory: string;
|
| 40 |
+
worktree: string;
|
| 41 |
+
experimental_workspace: {
|
| 42 |
+
register(type: string, adapter: WorkspaceAdapter): void;
|
| 43 |
+
};
|
| 44 |
+
serverUrl: URL;
|
| 45 |
+
$: BunShell;
|
| 46 |
+
};
|
| 47 |
+
export type PluginOptions = Record<string, unknown>;
|
| 48 |
+
export type Config = Omit<SDKConfig, "plugin"> & {
|
| 49 |
+
plugin?: Array<string | [string, PluginOptions]>;
|
| 50 |
+
};
|
| 51 |
+
export type Plugin = (input: PluginInput, options?: PluginOptions) => Promise<Hooks>;
|
| 52 |
+
export type PluginModule = {
|
| 53 |
+
id?: string;
|
| 54 |
+
server: Plugin;
|
| 55 |
+
tui?: never;
|
| 56 |
+
};
|
| 57 |
+
type Rule = {
|
| 58 |
+
key: string;
|
| 59 |
+
op: "eq" | "neq";
|
| 60 |
+
value: string;
|
| 61 |
+
};
|
| 62 |
+
export type AuthHook = {
|
| 63 |
+
provider: string;
|
| 64 |
+
loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, any>>;
|
| 65 |
+
methods: ({
|
| 66 |
+
type: "oauth";
|
| 67 |
+
label: string;
|
| 68 |
+
prompts?: Array<{
|
| 69 |
+
type: "text";
|
| 70 |
+
key: string;
|
| 71 |
+
message: string;
|
| 72 |
+
placeholder?: string;
|
| 73 |
+
validate?: (value: string) => string | undefined;
|
| 74 |
+
/** @deprecated Use `when` instead */
|
| 75 |
+
condition?: (inputs: Record<string, string>) => boolean;
|
| 76 |
+
when?: Rule;
|
| 77 |
+
} | {
|
| 78 |
+
type: "select";
|
| 79 |
+
key: string;
|
| 80 |
+
message: string;
|
| 81 |
+
options: Array<{
|
| 82 |
+
label: string;
|
| 83 |
+
value: string;
|
| 84 |
+
hint?: string;
|
| 85 |
+
}>;
|
| 86 |
+
/** @deprecated Use `when` instead */
|
| 87 |
+
condition?: (inputs: Record<string, string>) => boolean;
|
| 88 |
+
when?: Rule;
|
| 89 |
+
}>;
|
| 90 |
+
authorize(inputs?: Record<string, string>): Promise<AuthOAuthResult>;
|
| 91 |
+
} | {
|
| 92 |
+
type: "api";
|
| 93 |
+
label: string;
|
| 94 |
+
prompts?: Array<{
|
| 95 |
+
type: "text";
|
| 96 |
+
key: string;
|
| 97 |
+
message: string;
|
| 98 |
+
placeholder?: string;
|
| 99 |
+
validate?: (value: string) => string | undefined;
|
| 100 |
+
/** @deprecated Use `when` instead */
|
| 101 |
+
condition?: (inputs: Record<string, string>) => boolean;
|
| 102 |
+
when?: Rule;
|
| 103 |
+
} | {
|
| 104 |
+
type: "select";
|
| 105 |
+
key: string;
|
| 106 |
+
message: string;
|
| 107 |
+
options: Array<{
|
| 108 |
+
label: string;
|
| 109 |
+
value: string;
|
| 110 |
+
hint?: string;
|
| 111 |
+
}>;
|
| 112 |
+
/** @deprecated Use `when` instead */
|
| 113 |
+
condition?: (inputs: Record<string, string>) => boolean;
|
| 114 |
+
when?: Rule;
|
| 115 |
+
}>;
|
| 116 |
+
authorize?(inputs?: Record<string, string>): Promise<{
|
| 117 |
+
type: "success";
|
| 118 |
+
key: string;
|
| 119 |
+
provider?: string;
|
| 120 |
+
metadata?: Record<string, string>;
|
| 121 |
+
} | {
|
| 122 |
+
type: "failed";
|
| 123 |
+
}>;
|
| 124 |
+
})[];
|
| 125 |
+
};
|
| 126 |
+
export type AuthOAuthResult = {
|
| 127 |
+
url: string;
|
| 128 |
+
instructions: string;
|
| 129 |
+
} & ({
|
| 130 |
+
method: "auto";
|
| 131 |
+
callback(): Promise<({
|
| 132 |
+
type: "success";
|
| 133 |
+
provider?: string;
|
| 134 |
+
} & ({
|
| 135 |
+
refresh: string;
|
| 136 |
+
access: string;
|
| 137 |
+
expires: number;
|
| 138 |
+
accountId?: string;
|
| 139 |
+
enterpriseUrl?: string;
|
| 140 |
+
} | {
|
| 141 |
+
key: string;
|
| 142 |
+
metadata?: Record<string, string>;
|
| 143 |
+
})) | {
|
| 144 |
+
type: "failed";
|
| 145 |
+
}>;
|
| 146 |
+
} | {
|
| 147 |
+
method: "code";
|
| 148 |
+
callback(code: string): Promise<({
|
| 149 |
+
type: "success";
|
| 150 |
+
provider?: string;
|
| 151 |
+
} & ({
|
| 152 |
+
refresh: string;
|
| 153 |
+
access: string;
|
| 154 |
+
expires: number;
|
| 155 |
+
accountId?: string;
|
| 156 |
+
enterpriseUrl?: string;
|
| 157 |
+
} | {
|
| 158 |
+
key: string;
|
| 159 |
+
metadata?: Record<string, string>;
|
| 160 |
+
})) | {
|
| 161 |
+
type: "failed";
|
| 162 |
+
}>;
|
| 163 |
+
});
|
| 164 |
+
export type ProviderHookContext = {
|
| 165 |
+
auth?: Auth;
|
| 166 |
+
};
|
| 167 |
+
export type ProviderHook = {
|
| 168 |
+
id: string;
|
| 169 |
+
models?: (provider: ProviderV2, ctx: ProviderHookContext) => Promise<Record<string, ModelV2>>;
|
| 170 |
+
};
|
| 171 |
+
/** @deprecated Use AuthOAuthResult instead. */
|
| 172 |
+
export type AuthOuathResult = AuthOAuthResult;
|
| 173 |
+
export interface Hooks {
|
| 174 |
+
event?: (input: {
|
| 175 |
+
event: Event;
|
| 176 |
+
}) => Promise<void>;
|
| 177 |
+
config?: (input: Config) => Promise<void>;
|
| 178 |
+
tool?: {
|
| 179 |
+
[key: string]: ToolDefinition;
|
| 180 |
+
};
|
| 181 |
+
auth?: AuthHook;
|
| 182 |
+
provider?: ProviderHook;
|
| 183 |
+
/**
|
| 184 |
+
* Called when a new message is received
|
| 185 |
+
*/
|
| 186 |
+
"chat.message"?: (input: {
|
| 187 |
+
sessionID: string;
|
| 188 |
+
agent?: string;
|
| 189 |
+
model?: {
|
| 190 |
+
providerID: string;
|
| 191 |
+
modelID: string;
|
| 192 |
+
};
|
| 193 |
+
messageID?: string;
|
| 194 |
+
variant?: string;
|
| 195 |
+
}, output: {
|
| 196 |
+
message: UserMessage;
|
| 197 |
+
parts: Part[];
|
| 198 |
+
}) => Promise<void>;
|
| 199 |
+
/**
|
| 200 |
+
* Modify parameters sent to LLM
|
| 201 |
+
*/
|
| 202 |
+
"chat.params"?: (input: {
|
| 203 |
+
sessionID: string;
|
| 204 |
+
agent: string;
|
| 205 |
+
model: Model;
|
| 206 |
+
provider: ProviderContext;
|
| 207 |
+
message: UserMessage;
|
| 208 |
+
}, output: {
|
| 209 |
+
temperature: number;
|
| 210 |
+
topP: number;
|
| 211 |
+
topK: number;
|
| 212 |
+
maxOutputTokens: number | undefined;
|
| 213 |
+
options: Record<string, any>;
|
| 214 |
+
}) => Promise<void>;
|
| 215 |
+
"chat.headers"?: (input: {
|
| 216 |
+
sessionID: string;
|
| 217 |
+
agent: string;
|
| 218 |
+
model: Model;
|
| 219 |
+
provider: ProviderContext;
|
| 220 |
+
message: UserMessage;
|
| 221 |
+
}, output: {
|
| 222 |
+
headers: Record<string, string>;
|
| 223 |
+
}) => Promise<void>;
|
| 224 |
+
"permission.ask"?: (input: Permission, output: {
|
| 225 |
+
status: "ask" | "deny" | "allow";
|
| 226 |
+
}) => Promise<void>;
|
| 227 |
+
"command.execute.before"?: (input: {
|
| 228 |
+
command: string;
|
| 229 |
+
sessionID: string;
|
| 230 |
+
arguments: string;
|
| 231 |
+
}, output: {
|
| 232 |
+
parts: Part[];
|
| 233 |
+
}) => Promise<void>;
|
| 234 |
+
"tool.execute.before"?: (input: {
|
| 235 |
+
tool: string;
|
| 236 |
+
sessionID: string;
|
| 237 |
+
callID: string;
|
| 238 |
+
}, output: {
|
| 239 |
+
args: any;
|
| 240 |
+
}) => Promise<void>;
|
| 241 |
+
"shell.env"?: (input: {
|
| 242 |
+
cwd: string;
|
| 243 |
+
sessionID?: string;
|
| 244 |
+
callID?: string;
|
| 245 |
+
}, output: {
|
| 246 |
+
env: Record<string, string>;
|
| 247 |
+
}) => Promise<void>;
|
| 248 |
+
"tool.execute.after"?: (input: {
|
| 249 |
+
tool: string;
|
| 250 |
+
sessionID: string;
|
| 251 |
+
callID: string;
|
| 252 |
+
args: any;
|
| 253 |
+
}, output: {
|
| 254 |
+
title: string;
|
| 255 |
+
output: string;
|
| 256 |
+
metadata: any;
|
| 257 |
+
}) => Promise<void>;
|
| 258 |
+
"experimental.chat.messages.transform"?: (input: {}, output: {
|
| 259 |
+
messages: {
|
| 260 |
+
info: Message;
|
| 261 |
+
parts: Part[];
|
| 262 |
+
}[];
|
| 263 |
+
}) => Promise<void>;
|
| 264 |
+
"experimental.chat.system.transform"?: (input: {
|
| 265 |
+
sessionID?: string;
|
| 266 |
+
model: Model;
|
| 267 |
+
}, output: {
|
| 268 |
+
system: string[];
|
| 269 |
+
}) => Promise<void>;
|
| 270 |
+
/**
|
| 271 |
+
* Called before session compaction starts. Allows plugins to customize
|
| 272 |
+
* the compaction prompt.
|
| 273 |
+
*
|
| 274 |
+
* - `context`: Additional context strings appended to the default prompt
|
| 275 |
+
* - `prompt`: If set, replaces the default compaction prompt entirely
|
| 276 |
+
*/
|
| 277 |
+
"experimental.session.compacting"?: (input: {
|
| 278 |
+
sessionID: string;
|
| 279 |
+
}, output: {
|
| 280 |
+
context: string[];
|
| 281 |
+
prompt?: string;
|
| 282 |
+
}) => Promise<void>;
|
| 283 |
+
/**
|
| 284 |
+
* Called after compaction succeeds and before a synthetic user
|
| 285 |
+
* auto-continue message is added.
|
| 286 |
+
*
|
| 287 |
+
* - `enabled`: Defaults to `true`. Set to `false` to skip the synthetic
|
| 288 |
+
* user "continue" turn.
|
| 289 |
+
*/
|
| 290 |
+
"experimental.compaction.autocontinue"?: (input: {
|
| 291 |
+
sessionID: string;
|
| 292 |
+
agent: string;
|
| 293 |
+
model: Model;
|
| 294 |
+
provider: ProviderContext;
|
| 295 |
+
message: UserMessage;
|
| 296 |
+
overflow: boolean;
|
| 297 |
+
}, output: {
|
| 298 |
+
enabled: boolean;
|
| 299 |
+
}) => Promise<void>;
|
| 300 |
+
"experimental.text.complete"?: (input: {
|
| 301 |
+
sessionID: string;
|
| 302 |
+
messageID: string;
|
| 303 |
+
partID: string;
|
| 304 |
+
}, output: {
|
| 305 |
+
text: string;
|
| 306 |
+
}) => Promise<void>;
|
| 307 |
+
/**
|
| 308 |
+
* Modify tool definitions (description and parameters) sent to LLM
|
| 309 |
+
*/
|
| 310 |
+
"tool.definition"?: (input: {
|
| 311 |
+
toolID: string;
|
| 312 |
+
}, output: {
|
| 313 |
+
description: string;
|
| 314 |
+
parameters: any;
|
| 315 |
+
}) => Promise<void>;
|
| 316 |
+
}
|
.opencode/node_modules/@opencode-ai/plugin/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from "./tool.js";
|
.opencode/node_modules/@opencode-ai/plugin/dist/shell.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export type ShellFunction = (input: Uint8Array) => Uint8Array;
|
| 2 |
+
export type ShellExpression = {
|
| 3 |
+
toString(): string;
|
| 4 |
+
} | Array<ShellExpression> | string | {
|
| 5 |
+
raw: string;
|
| 6 |
+
} | ReadableStream;
|
| 7 |
+
export interface BunShell {
|
| 8 |
+
(strings: TemplateStringsArray, ...expressions: ShellExpression[]): BunShellPromise;
|
| 9 |
+
/**
|
| 10 |
+
* Perform bash-like brace expansion on the given pattern.
|
| 11 |
+
* @param pattern - Brace pattern to expand
|
| 12 |
+
*/
|
| 13 |
+
braces(pattern: string): string[];
|
| 14 |
+
/**
|
| 15 |
+
* Escape strings for input into shell commands.
|
| 16 |
+
*/
|
| 17 |
+
escape(input: string): string;
|
| 18 |
+
/**
|
| 19 |
+
* Change the default environment variables for shells created by this instance.
|
| 20 |
+
*/
|
| 21 |
+
env(newEnv?: Record<string, string | undefined>): BunShell;
|
| 22 |
+
/**
|
| 23 |
+
* Default working directory to use for shells created by this instance.
|
| 24 |
+
*/
|
| 25 |
+
cwd(newCwd?: string): BunShell;
|
| 26 |
+
/**
|
| 27 |
+
* Configure the shell to not throw an exception on non-zero exit codes.
|
| 28 |
+
*/
|
| 29 |
+
nothrow(): BunShell;
|
| 30 |
+
/**
|
| 31 |
+
* Configure whether or not the shell should throw an exception on non-zero exit codes.
|
| 32 |
+
*/
|
| 33 |
+
throws(shouldThrow: boolean): BunShell;
|
| 34 |
+
}
|
| 35 |
+
export interface BunShellPromise extends Promise<BunShellOutput> {
|
| 36 |
+
readonly stdin: WritableStream;
|
| 37 |
+
/**
|
| 38 |
+
* Change the current working directory of the shell.
|
| 39 |
+
*/
|
| 40 |
+
cwd(newCwd: string): this;
|
| 41 |
+
/**
|
| 42 |
+
* Set environment variables for the shell.
|
| 43 |
+
*/
|
| 44 |
+
env(newEnv: Record<string, string> | undefined): this;
|
| 45 |
+
/**
|
| 46 |
+
* By default, the shell will write to the current process's stdout and stderr, as well as buffering that output.
|
| 47 |
+
* This configures the shell to only buffer the output.
|
| 48 |
+
*/
|
| 49 |
+
quiet(): this;
|
| 50 |
+
/**
|
| 51 |
+
* Read from stdout as a string, line by line
|
| 52 |
+
* Automatically calls quiet() to disable echoing to stdout.
|
| 53 |
+
*/
|
| 54 |
+
lines(): AsyncIterable<string>;
|
| 55 |
+
/**
|
| 56 |
+
* Read from stdout as a string.
|
| 57 |
+
* Automatically calls quiet() to disable echoing to stdout.
|
| 58 |
+
*/
|
| 59 |
+
text(encoding?: BufferEncoding): Promise<string>;
|
| 60 |
+
/**
|
| 61 |
+
* Read from stdout as a JSON object
|
| 62 |
+
* Automatically calls quiet()
|
| 63 |
+
*/
|
| 64 |
+
json(): Promise<any>;
|
| 65 |
+
/**
|
| 66 |
+
* Read from stdout as an ArrayBuffer
|
| 67 |
+
* Automatically calls quiet()
|
| 68 |
+
*/
|
| 69 |
+
arrayBuffer(): Promise<ArrayBuffer>;
|
| 70 |
+
/**
|
| 71 |
+
* Read from stdout as a Blob
|
| 72 |
+
* Automatically calls quiet()
|
| 73 |
+
*/
|
| 74 |
+
blob(): Promise<Blob>;
|
| 75 |
+
/**
|
| 76 |
+
* Configure the shell to not throw an exception on non-zero exit codes.
|
| 77 |
+
*/
|
| 78 |
+
nothrow(): this;
|
| 79 |
+
/**
|
| 80 |
+
* Configure whether or not the shell should throw an exception on non-zero exit codes.
|
| 81 |
+
*/
|
| 82 |
+
throws(shouldThrow: boolean): this;
|
| 83 |
+
}
|
| 84 |
+
export interface BunShellOutput {
|
| 85 |
+
readonly stdout: Buffer;
|
| 86 |
+
readonly stderr: Buffer;
|
| 87 |
+
readonly exitCode: number;
|
| 88 |
+
/**
|
| 89 |
+
* Read from stdout as a string
|
| 90 |
+
*/
|
| 91 |
+
text(encoding?: BufferEncoding): string;
|
| 92 |
+
/**
|
| 93 |
+
* Read from stdout as a JSON object
|
| 94 |
+
*/
|
| 95 |
+
json(): any;
|
| 96 |
+
/**
|
| 97 |
+
* Read from stdout as an ArrayBuffer
|
| 98 |
+
*/
|
| 99 |
+
arrayBuffer(): ArrayBuffer;
|
| 100 |
+
/**
|
| 101 |
+
* Read from stdout as an Uint8Array
|
| 102 |
+
*/
|
| 103 |
+
bytes(): Uint8Array;
|
| 104 |
+
/**
|
| 105 |
+
* Read from stdout as a Blob
|
| 106 |
+
*/
|
| 107 |
+
blob(): Blob;
|
| 108 |
+
}
|
| 109 |
+
export type BunShellError = Error & BunShellOutput;
|
.opencode/node_modules/@opencode-ai/plugin/dist/shell.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export {};
|
.opencode/node_modules/@opencode-ai/plugin/dist/tool.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { z } from "zod";
|
| 2 |
+
export type ToolContext = {
|
| 3 |
+
sessionID: string;
|
| 4 |
+
messageID: string;
|
| 5 |
+
agent: string;
|
| 6 |
+
/**
|
| 7 |
+
* Current project directory for this session.
|
| 8 |
+
* Prefer this over process.cwd() when resolving relative paths.
|
| 9 |
+
*/
|
| 10 |
+
directory: string;
|
| 11 |
+
/**
|
| 12 |
+
* Project worktree root for this session.
|
| 13 |
+
* Useful for generating stable relative paths (e.g. path.relative(worktree, absPath)).
|
| 14 |
+
*/
|
| 15 |
+
worktree: string;
|
| 16 |
+
abort: AbortSignal;
|
| 17 |
+
metadata(input: {
|
| 18 |
+
title?: string;
|
| 19 |
+
metadata?: {
|
| 20 |
+
[key: string]: any;
|
| 21 |
+
};
|
| 22 |
+
}): void;
|
| 23 |
+
ask(input: AskInput): Promise<void>;
|
| 24 |
+
};
|
| 25 |
+
type AskInput = {
|
| 26 |
+
permission: string;
|
| 27 |
+
patterns: string[];
|
| 28 |
+
always: string[];
|
| 29 |
+
metadata: {
|
| 30 |
+
[key: string]: any;
|
| 31 |
+
};
|
| 32 |
+
};
|
| 33 |
+
export type ToolAttachment = {
|
| 34 |
+
type: "file";
|
| 35 |
+
mime: string;
|
| 36 |
+
url: string;
|
| 37 |
+
filename?: string;
|
| 38 |
+
};
|
| 39 |
+
export type ToolResult = string | {
|
| 40 |
+
title?: string;
|
| 41 |
+
output: string;
|
| 42 |
+
metadata?: {
|
| 43 |
+
[key: string]: any;
|
| 44 |
+
};
|
| 45 |
+
attachments?: ToolAttachment[];
|
| 46 |
+
};
|
| 47 |
+
export declare function tool<Args extends z.ZodRawShape>(input: {
|
| 48 |
+
description: string;
|
| 49 |
+
args: Args;
|
| 50 |
+
execute(args: z.infer<z.ZodObject<Args>>, context: ToolContext): Promise<ToolResult>;
|
| 51 |
+
}): {
|
| 52 |
+
description: string;
|
| 53 |
+
args: Args;
|
| 54 |
+
execute(args: z.infer<z.ZodObject<Args>>, context: ToolContext): Promise<ToolResult>;
|
| 55 |
+
};
|
| 56 |
+
export declare namespace tool {
|
| 57 |
+
var schema: typeof z;
|
| 58 |
+
}
|
| 59 |
+
export type ToolDefinition = ReturnType<typeof tool>;
|
| 60 |
+
export {};
|
.opencode/node_modules/@opencode-ai/plugin/dist/tool.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { z } from "zod";
|
| 2 |
+
export function tool(input) {
|
| 3 |
+
return input;
|
| 4 |
+
}
|
| 5 |
+
tool.schema = z;
|
.opencode/node_modules/@opencode-ai/plugin/dist/tui.d.ts
ADDED
|
@@ -0,0 +1,508 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { AgentPart, OpencodeClient, Event, FilePart, LspStatus, McpStatus, Todo, Message, Part, Provider, PermissionRequest, QuestionRequest, Session, SessionStatus, TextPart, Config as SdkConfig } from "@opencode-ai/sdk/v2";
|
| 2 |
+
import type { CliRenderer, KeyEvent, RGBA, Renderable, SlotMode } from "@opentui/core";
|
| 3 |
+
import type { Binding, Keymap } from "@opentui/keymap";
|
| 4 |
+
import { type BindingConfig, type CreateBindingLookupOptions, type KeySequenceFormatPart, type SequenceBindingLike } from "@opentui/keymap/extras";
|
| 5 |
+
import type { JSX, SolidPlugin } from "@opentui/solid";
|
| 6 |
+
import type { Config as PluginConfig, PluginOptions } from "./index.js";
|
| 7 |
+
export type { CliRenderer, KeyEvent, Renderable, SlotMode } from "@opentui/core";
|
| 8 |
+
export { stringifyKeySequence, stringifyKeyStroke } from "@opentui/keymap";
|
| 9 |
+
export type { Binding, KeyLike, KeySequencePart, KeyStringifyInput, StringifyOptions } from "@opentui/keymap";
|
| 10 |
+
export { formatCommandBindings, formatKeySequence } from "@opentui/keymap/extras";
|
| 11 |
+
export type { BindingConfig, BindingLookup, BindingValue, CreateBindingLookupOptions, FormatCommandBindingsOptions, FormatKeySequenceOptions, KeySequenceFormatPart, SequenceBindingLike, } from "@opentui/keymap/extras";
|
| 12 |
+
export declare function createBindingLookup(config: BindingConfig<Renderable, KeyEvent> | undefined, options?: CreateBindingLookupOptions<Renderable, KeyEvent>): import("@opentui/keymap/extras").BindingLookup<Renderable, KeyEvent>;
|
| 13 |
+
export type TuiRouteCurrent = {
|
| 14 |
+
name: "home";
|
| 15 |
+
} | {
|
| 16 |
+
name: "session";
|
| 17 |
+
params: {
|
| 18 |
+
sessionID: string;
|
| 19 |
+
prompt?: unknown;
|
| 20 |
+
};
|
| 21 |
+
} | {
|
| 22 |
+
name: string;
|
| 23 |
+
params?: Record<string, unknown>;
|
| 24 |
+
};
|
| 25 |
+
export type TuiRouteDefinition = {
|
| 26 |
+
name: string;
|
| 27 |
+
render: (input: {
|
| 28 |
+
params?: Record<string, unknown>;
|
| 29 |
+
}) => JSX.Element;
|
| 30 |
+
};
|
| 31 |
+
export type TuiKeys = {
|
| 32 |
+
formatSequence: (parts: readonly KeySequenceFormatPart[] | undefined) => string;
|
| 33 |
+
formatBindings: (bindings: readonly SequenceBindingLike[] | undefined) => string | undefined;
|
| 34 |
+
};
|
| 35 |
+
export type TuiKeymap = Keymap<Renderable, KeyEvent>;
|
| 36 |
+
/**
|
| 37 |
+
* Legacy `api.command` shape kept so v1 plugins can initialize. Remove in v2.
|
| 38 |
+
*
|
| 39 |
+
* @deprecated Use `api.keymap.registerLayer({ commands, bindings })` instead.
|
| 40 |
+
*/
|
| 41 |
+
export type TuiCommand = {
|
| 42 |
+
title: string;
|
| 43 |
+
value: string;
|
| 44 |
+
description?: string;
|
| 45 |
+
category?: string;
|
| 46 |
+
keybind?: string;
|
| 47 |
+
suggested?: boolean;
|
| 48 |
+
hidden?: boolean;
|
| 49 |
+
enabled?: boolean;
|
| 50 |
+
slash?: {
|
| 51 |
+
name: string;
|
| 52 |
+
aliases?: string[];
|
| 53 |
+
};
|
| 54 |
+
onSelect?: (dialog?: TuiDialogStack) => void | Promise<void>;
|
| 55 |
+
};
|
| 56 |
+
/**
|
| 57 |
+
* Legacy `api.command` API kept so v1 plugins can initialize. Remove in v2.
|
| 58 |
+
*
|
| 59 |
+
* @deprecated Use `api.keymap.registerLayer`, `api.keymap.dispatchCommand`, and
|
| 60 |
+
* `api.keymap.dispatchCommand("command.palette.show")` instead.
|
| 61 |
+
*/
|
| 62 |
+
export type TuiCommandApi = {
|
| 63 |
+
/** @deprecated Use `api.keymap.registerLayer({ commands, bindings })` instead. */
|
| 64 |
+
register: (cb: () => TuiCommand[]) => () => void;
|
| 65 |
+
/** @deprecated Use `api.keymap.dispatchCommand(name)` instead. */
|
| 66 |
+
trigger: (value: string) => void;
|
| 67 |
+
/** @deprecated Use `api.keymap.dispatchCommand("command.palette.show")` instead. */
|
| 68 |
+
show: () => void;
|
| 69 |
+
};
|
| 70 |
+
export type TuiDialogProps = {
|
| 71 |
+
size?: "medium" | "large" | "xlarge";
|
| 72 |
+
onClose: () => void;
|
| 73 |
+
children?: JSX.Element;
|
| 74 |
+
};
|
| 75 |
+
export type TuiDialogStack = {
|
| 76 |
+
replace: (render: () => JSX.Element, onClose?: () => void) => void;
|
| 77 |
+
clear: () => void;
|
| 78 |
+
setSize: (size: "medium" | "large" | "xlarge") => void;
|
| 79 |
+
readonly size: "medium" | "large" | "xlarge";
|
| 80 |
+
readonly depth: number;
|
| 81 |
+
readonly open: boolean;
|
| 82 |
+
};
|
| 83 |
+
export type TuiDialogAlertProps = {
|
| 84 |
+
title: string;
|
| 85 |
+
message: string;
|
| 86 |
+
onConfirm?: () => void;
|
| 87 |
+
};
|
| 88 |
+
export type TuiDialogConfirmProps = {
|
| 89 |
+
title: string;
|
| 90 |
+
message: string;
|
| 91 |
+
onConfirm?: () => void;
|
| 92 |
+
onCancel?: () => void;
|
| 93 |
+
};
|
| 94 |
+
export type TuiDialogPromptProps = {
|
| 95 |
+
title: string;
|
| 96 |
+
description?: () => JSX.Element;
|
| 97 |
+
placeholder?: string;
|
| 98 |
+
value?: string;
|
| 99 |
+
busy?: boolean;
|
| 100 |
+
busyText?: string;
|
| 101 |
+
onConfirm?: (value: string) => void;
|
| 102 |
+
onCancel?: () => void;
|
| 103 |
+
};
|
| 104 |
+
export type TuiDialogSelectOption<Value = unknown> = {
|
| 105 |
+
title: string;
|
| 106 |
+
value: Value;
|
| 107 |
+
description?: string;
|
| 108 |
+
footer?: JSX.Element | string;
|
| 109 |
+
category?: string;
|
| 110 |
+
disabled?: boolean;
|
| 111 |
+
onSelect?: () => void;
|
| 112 |
+
};
|
| 113 |
+
export type TuiDialogSelectProps<Value = unknown> = {
|
| 114 |
+
title: string;
|
| 115 |
+
placeholder?: string;
|
| 116 |
+
options: TuiDialogSelectOption<Value>[];
|
| 117 |
+
flat?: boolean;
|
| 118 |
+
onMove?: (option: TuiDialogSelectOption<Value>) => void;
|
| 119 |
+
onFilter?: (query: string) => void;
|
| 120 |
+
onSelect?: (option: TuiDialogSelectOption<Value>) => void;
|
| 121 |
+
skipFilter?: boolean;
|
| 122 |
+
current?: Value;
|
| 123 |
+
};
|
| 124 |
+
export type TuiPromptInfo = {
|
| 125 |
+
input: string;
|
| 126 |
+
mode?: "normal" | "shell";
|
| 127 |
+
parts: (Omit<FilePart, "id" | "messageID" | "sessionID"> | Omit<AgentPart, "id" | "messageID" | "sessionID"> | (Omit<TextPart, "id" | "messageID" | "sessionID"> & {
|
| 128 |
+
source?: {
|
| 129 |
+
text: {
|
| 130 |
+
start: number;
|
| 131 |
+
end: number;
|
| 132 |
+
value: string;
|
| 133 |
+
};
|
| 134 |
+
};
|
| 135 |
+
}))[];
|
| 136 |
+
};
|
| 137 |
+
export type TuiPromptRef = {
|
| 138 |
+
focused: boolean;
|
| 139 |
+
current: TuiPromptInfo;
|
| 140 |
+
set(prompt: TuiPromptInfo): void;
|
| 141 |
+
reset(): void;
|
| 142 |
+
blur(): void;
|
| 143 |
+
focus(): void;
|
| 144 |
+
submit(): void;
|
| 145 |
+
};
|
| 146 |
+
export type TuiPromptProps = {
|
| 147 |
+
sessionID?: string;
|
| 148 |
+
workspaceID?: string;
|
| 149 |
+
visible?: boolean;
|
| 150 |
+
disabled?: boolean;
|
| 151 |
+
onSubmit?: () => void;
|
| 152 |
+
ref?: (ref: TuiPromptRef | undefined) => void;
|
| 153 |
+
hint?: JSX.Element;
|
| 154 |
+
right?: JSX.Element;
|
| 155 |
+
showPlaceholder?: boolean;
|
| 156 |
+
placeholders?: {
|
| 157 |
+
normal?: string[];
|
| 158 |
+
shell?: string[];
|
| 159 |
+
};
|
| 160 |
+
};
|
| 161 |
+
export type TuiToast = {
|
| 162 |
+
variant?: "info" | "success" | "warning" | "error";
|
| 163 |
+
title?: string;
|
| 164 |
+
message: string;
|
| 165 |
+
duration?: number;
|
| 166 |
+
};
|
| 167 |
+
export type TuiAttentionWhen = "always" | "focused" | "blurred";
|
| 168 |
+
export declare const TuiAttentionSoundNames: readonly ["default", "question", "permission", "error", "done", "subagent_done"];
|
| 169 |
+
export type TuiAttentionSoundName = (typeof TuiAttentionSoundNames)[number];
|
| 170 |
+
export type TuiAttentionSound = boolean | {
|
| 171 |
+
name?: TuiAttentionSoundName;
|
| 172 |
+
volume?: number;
|
| 173 |
+
when?: TuiAttentionWhen;
|
| 174 |
+
};
|
| 175 |
+
export type TuiAttentionNotification = boolean | {
|
| 176 |
+
when?: TuiAttentionWhen;
|
| 177 |
+
};
|
| 178 |
+
export type TuiAttentionSoundPack = {
|
| 179 |
+
id: string;
|
| 180 |
+
name?: string;
|
| 181 |
+
sounds: Partial<Record<TuiAttentionSoundName, string>>;
|
| 182 |
+
};
|
| 183 |
+
export type TuiAttentionSoundPackInfo = {
|
| 184 |
+
id: string;
|
| 185 |
+
name?: string;
|
| 186 |
+
active: boolean;
|
| 187 |
+
builtin: boolean;
|
| 188 |
+
};
|
| 189 |
+
export type TuiAttentionSoundboardActivateOptions = {
|
| 190 |
+
persist?: boolean;
|
| 191 |
+
};
|
| 192 |
+
export type TuiAttentionSoundboard = {
|
| 193 |
+
registerPack(pack: TuiAttentionSoundPack): () => void;
|
| 194 |
+
activate(id: string, options?: TuiAttentionSoundboardActivateOptions): boolean;
|
| 195 |
+
current(): string;
|
| 196 |
+
list(): ReadonlyArray<TuiAttentionSoundPackInfo>;
|
| 197 |
+
};
|
| 198 |
+
export type TuiAttentionNotifyInput = {
|
| 199 |
+
title?: string;
|
| 200 |
+
message: string;
|
| 201 |
+
notification?: TuiAttentionNotification;
|
| 202 |
+
sound?: TuiAttentionSound;
|
| 203 |
+
};
|
| 204 |
+
export type TuiAttentionNotifySkipReason = "attention_disabled" | "empty_message" | "blurred" | "focused" | "focus_unknown" | "renderer_destroyed";
|
| 205 |
+
export type TuiAttentionNotifyResult = {
|
| 206 |
+
ok: boolean;
|
| 207 |
+
notification: boolean;
|
| 208 |
+
sound: boolean;
|
| 209 |
+
skipped?: TuiAttentionNotifySkipReason;
|
| 210 |
+
};
|
| 211 |
+
export type TuiAttention = {
|
| 212 |
+
notify(input: TuiAttentionNotifyInput): Promise<TuiAttentionNotifyResult>;
|
| 213 |
+
soundboard: TuiAttentionSoundboard;
|
| 214 |
+
};
|
| 215 |
+
export type TuiThemeCurrent = {
|
| 216 |
+
readonly primary: RGBA;
|
| 217 |
+
readonly secondary: RGBA;
|
| 218 |
+
readonly accent: RGBA;
|
| 219 |
+
readonly error: RGBA;
|
| 220 |
+
readonly warning: RGBA;
|
| 221 |
+
readonly success: RGBA;
|
| 222 |
+
readonly info: RGBA;
|
| 223 |
+
readonly text: RGBA;
|
| 224 |
+
readonly textMuted: RGBA;
|
| 225 |
+
readonly selectedListItemText: RGBA;
|
| 226 |
+
readonly background: RGBA;
|
| 227 |
+
readonly backgroundPanel: RGBA;
|
| 228 |
+
readonly backgroundElement: RGBA;
|
| 229 |
+
readonly backgroundMenu: RGBA;
|
| 230 |
+
readonly border: RGBA;
|
| 231 |
+
readonly borderActive: RGBA;
|
| 232 |
+
readonly borderSubtle: RGBA;
|
| 233 |
+
readonly diffAdded: RGBA;
|
| 234 |
+
readonly diffRemoved: RGBA;
|
| 235 |
+
readonly diffContext: RGBA;
|
| 236 |
+
readonly diffHunkHeader: RGBA;
|
| 237 |
+
readonly diffHighlightAdded: RGBA;
|
| 238 |
+
readonly diffHighlightRemoved: RGBA;
|
| 239 |
+
readonly diffAddedBg: RGBA;
|
| 240 |
+
readonly diffRemovedBg: RGBA;
|
| 241 |
+
readonly diffContextBg: RGBA;
|
| 242 |
+
readonly diffLineNumber: RGBA;
|
| 243 |
+
readonly diffAddedLineNumberBg: RGBA;
|
| 244 |
+
readonly diffRemovedLineNumberBg: RGBA;
|
| 245 |
+
readonly markdownText: RGBA;
|
| 246 |
+
readonly markdownHeading: RGBA;
|
| 247 |
+
readonly markdownLink: RGBA;
|
| 248 |
+
readonly markdownLinkText: RGBA;
|
| 249 |
+
readonly markdownCode: RGBA;
|
| 250 |
+
readonly markdownBlockQuote: RGBA;
|
| 251 |
+
readonly markdownEmph: RGBA;
|
| 252 |
+
readonly markdownStrong: RGBA;
|
| 253 |
+
readonly markdownHorizontalRule: RGBA;
|
| 254 |
+
readonly markdownListItem: RGBA;
|
| 255 |
+
readonly markdownListEnumeration: RGBA;
|
| 256 |
+
readonly markdownImage: RGBA;
|
| 257 |
+
readonly markdownImageText: RGBA;
|
| 258 |
+
readonly markdownCodeBlock: RGBA;
|
| 259 |
+
readonly syntaxComment: RGBA;
|
| 260 |
+
readonly syntaxKeyword: RGBA;
|
| 261 |
+
readonly syntaxFunction: RGBA;
|
| 262 |
+
readonly syntaxVariable: RGBA;
|
| 263 |
+
readonly syntaxString: RGBA;
|
| 264 |
+
readonly syntaxNumber: RGBA;
|
| 265 |
+
readonly syntaxType: RGBA;
|
| 266 |
+
readonly syntaxOperator: RGBA;
|
| 267 |
+
readonly syntaxPunctuation: RGBA;
|
| 268 |
+
readonly thinkingOpacity: number;
|
| 269 |
+
};
|
| 270 |
+
export type TuiTheme = {
|
| 271 |
+
readonly current: TuiThemeCurrent;
|
| 272 |
+
readonly selected: string;
|
| 273 |
+
has: (name: string) => boolean;
|
| 274 |
+
set: (name: string) => boolean;
|
| 275 |
+
install: (jsonPath: string) => Promise<void>;
|
| 276 |
+
mode: () => "dark" | "light";
|
| 277 |
+
readonly ready: boolean;
|
| 278 |
+
};
|
| 279 |
+
export type TuiKV = {
|
| 280 |
+
get: <Value = unknown>(key: string, fallback?: Value) => Value;
|
| 281 |
+
set: (key: string, value: unknown) => void;
|
| 282 |
+
readonly ready: boolean;
|
| 283 |
+
};
|
| 284 |
+
export type TuiState = {
|
| 285 |
+
readonly ready: boolean;
|
| 286 |
+
readonly config: SdkConfig;
|
| 287 |
+
readonly provider: ReadonlyArray<Provider>;
|
| 288 |
+
readonly path: {
|
| 289 |
+
state: string;
|
| 290 |
+
config: string;
|
| 291 |
+
worktree: string;
|
| 292 |
+
directory: string;
|
| 293 |
+
};
|
| 294 |
+
readonly vcs: {
|
| 295 |
+
branch?: string;
|
| 296 |
+
} | undefined;
|
| 297 |
+
session: {
|
| 298 |
+
count: () => number;
|
| 299 |
+
get: (sessionID: string) => Session | undefined;
|
| 300 |
+
diff: (sessionID: string) => ReadonlyArray<TuiSidebarFileItem>;
|
| 301 |
+
todo: (sessionID: string) => ReadonlyArray<TuiSidebarTodoItem>;
|
| 302 |
+
messages: (sessionID: string) => ReadonlyArray<Message>;
|
| 303 |
+
status: (sessionID: string) => SessionStatus | undefined;
|
| 304 |
+
permission: (sessionID: string) => ReadonlyArray<PermissionRequest>;
|
| 305 |
+
question: (sessionID: string) => ReadonlyArray<QuestionRequest>;
|
| 306 |
+
};
|
| 307 |
+
part: (messageID: string) => ReadonlyArray<Part>;
|
| 308 |
+
lsp: () => ReadonlyArray<TuiSidebarLspItem>;
|
| 309 |
+
mcp: () => ReadonlyArray<TuiSidebarMcpItem>;
|
| 310 |
+
};
|
| 311 |
+
type TuiBindingLookupView = {
|
| 312 |
+
readonly bindings: ReadonlyArray<Binding<Renderable, KeyEvent>>;
|
| 313 |
+
get: (command: string) => ReadonlyArray<Binding<Renderable, KeyEvent>>;
|
| 314 |
+
has: (command: string) => boolean;
|
| 315 |
+
gather: (name: string, commands: readonly string[]) => ReadonlyArray<Binding<Renderable, KeyEvent>>;
|
| 316 |
+
pick: (name: string, commands: readonly string[]) => Binding<Renderable, KeyEvent>[];
|
| 317 |
+
omit: (name: string, commands: readonly string[]) => Binding<Renderable, KeyEvent>[];
|
| 318 |
+
};
|
| 319 |
+
type TuiAttentionConfigView = {
|
| 320 |
+
enabled: boolean;
|
| 321 |
+
notifications: boolean;
|
| 322 |
+
sound: boolean;
|
| 323 |
+
volume: number;
|
| 324 |
+
sound_pack: string;
|
| 325 |
+
sounds: Partial<Record<TuiAttentionSoundName, string>>;
|
| 326 |
+
};
|
| 327 |
+
type TuiConfigView = Pick<PluginConfig, "$schema" | "theme" | "plugin"> & NonNullable<PluginConfig["tui"]> & {
|
| 328 |
+
leader_timeout: number;
|
| 329 |
+
attention: TuiAttentionConfigView;
|
| 330 |
+
plugin_enabled?: Record<string, boolean>;
|
| 331 |
+
keybinds: TuiBindingLookupView;
|
| 332 |
+
};
|
| 333 |
+
export type TuiApp = {
|
| 334 |
+
readonly version: string;
|
| 335 |
+
};
|
| 336 |
+
type Frozen<Value> = Value extends (...args: never[]) => unknown ? Value : Value extends ReadonlyArray<infer Item> ? ReadonlyArray<Frozen<Item>> : Value extends object ? {
|
| 337 |
+
readonly [Key in keyof Value]: Frozen<Value[Key]>;
|
| 338 |
+
} : Value;
|
| 339 |
+
export type TuiSidebarMcpItem = {
|
| 340 |
+
name: string;
|
| 341 |
+
status: McpStatus["status"];
|
| 342 |
+
error?: string;
|
| 343 |
+
};
|
| 344 |
+
export type TuiSidebarLspItem = Pick<LspStatus, "id" | "root" | "status">;
|
| 345 |
+
export type TuiSidebarTodoItem = Pick<Todo, "content" | "status">;
|
| 346 |
+
export type TuiSidebarFileItem = {
|
| 347 |
+
file: string;
|
| 348 |
+
additions: number;
|
| 349 |
+
deletions: number;
|
| 350 |
+
};
|
| 351 |
+
export type TuiHostSlotMap = {
|
| 352 |
+
app: {};
|
| 353 |
+
app_bottom: {};
|
| 354 |
+
home_logo: {};
|
| 355 |
+
home_prompt: {
|
| 356 |
+
workspace_id?: string;
|
| 357 |
+
ref?: (ref: TuiPromptRef | undefined) => void;
|
| 358 |
+
};
|
| 359 |
+
home_prompt_right: {
|
| 360 |
+
workspace_id?: string;
|
| 361 |
+
};
|
| 362 |
+
session_prompt: {
|
| 363 |
+
session_id: string;
|
| 364 |
+
visible?: boolean;
|
| 365 |
+
disabled?: boolean;
|
| 366 |
+
on_submit?: () => void;
|
| 367 |
+
ref?: (ref: TuiPromptRef | undefined) => void;
|
| 368 |
+
};
|
| 369 |
+
session_prompt_right: {
|
| 370 |
+
session_id: string;
|
| 371 |
+
};
|
| 372 |
+
home_bottom: {};
|
| 373 |
+
home_footer: {};
|
| 374 |
+
sidebar_title: {
|
| 375 |
+
session_id: string;
|
| 376 |
+
title: string;
|
| 377 |
+
share_url?: string;
|
| 378 |
+
};
|
| 379 |
+
sidebar_content: {
|
| 380 |
+
session_id: string;
|
| 381 |
+
};
|
| 382 |
+
sidebar_footer: {
|
| 383 |
+
session_id: string;
|
| 384 |
+
};
|
| 385 |
+
};
|
| 386 |
+
export type TuiSlotMap<Slots extends Record<string, object> = {}> = TuiHostSlotMap & Slots;
|
| 387 |
+
type TuiSlotShape<Name extends string, Slots extends Record<string, object>> = Name extends keyof TuiHostSlotMap ? TuiHostSlotMap[Name] : Name extends keyof Slots ? Slots[Name] : Record<string, unknown>;
|
| 388 |
+
export type TuiSlotProps<Name extends string = string, Slots extends Record<string, object> = {}> = {
|
| 389 |
+
name: Name;
|
| 390 |
+
mode?: SlotMode;
|
| 391 |
+
children?: JSX.Element;
|
| 392 |
+
} & TuiSlotShape<Name, Slots>;
|
| 393 |
+
export type TuiSlotContext = {
|
| 394 |
+
theme: TuiTheme;
|
| 395 |
+
};
|
| 396 |
+
type SlotCore<Slots extends Record<string, object> = {}> = SolidPlugin<TuiSlotMap<Slots>, TuiSlotContext>;
|
| 397 |
+
export type TuiSlotPlugin<Slots extends Record<string, object> = {}> = Omit<SlotCore<Slots>, "id"> & {
|
| 398 |
+
id?: never;
|
| 399 |
+
};
|
| 400 |
+
export type TuiSlots = {
|
| 401 |
+
register: {
|
| 402 |
+
(plugin: TuiSlotPlugin): string;
|
| 403 |
+
<Slots extends Record<string, object>>(plugin: TuiSlotPlugin<Slots>): string;
|
| 404 |
+
};
|
| 405 |
+
};
|
| 406 |
+
export type TuiEventBus = {
|
| 407 |
+
on: <Type extends Event["type"]>(type: Type, handler: (event: Extract<Event, {
|
| 408 |
+
type: Type;
|
| 409 |
+
}>) => void) => () => void;
|
| 410 |
+
};
|
| 411 |
+
export type TuiDispose = () => void | Promise<void>;
|
| 412 |
+
export type TuiLifecycle = {
|
| 413 |
+
readonly signal: AbortSignal;
|
| 414 |
+
onDispose: (fn: TuiDispose) => () => void;
|
| 415 |
+
};
|
| 416 |
+
export type TuiPluginState = "first" | "updated" | "same";
|
| 417 |
+
export type TuiPluginEntry = {
|
| 418 |
+
id: string;
|
| 419 |
+
source: "file" | "npm" | "internal";
|
| 420 |
+
spec: string;
|
| 421 |
+
target: string;
|
| 422 |
+
requested?: string;
|
| 423 |
+
version?: string;
|
| 424 |
+
modified?: number;
|
| 425 |
+
first_time: number;
|
| 426 |
+
last_time: number;
|
| 427 |
+
time_changed: number;
|
| 428 |
+
load_count: number;
|
| 429 |
+
fingerprint: string;
|
| 430 |
+
};
|
| 431 |
+
export type TuiPluginMeta = TuiPluginEntry & {
|
| 432 |
+
state: TuiPluginState;
|
| 433 |
+
};
|
| 434 |
+
export type TuiPluginStatus = {
|
| 435 |
+
id: string;
|
| 436 |
+
source: TuiPluginEntry["source"];
|
| 437 |
+
spec: string;
|
| 438 |
+
target: string;
|
| 439 |
+
enabled: boolean;
|
| 440 |
+
active: boolean;
|
| 441 |
+
};
|
| 442 |
+
export type TuiPluginInstallOptions = {
|
| 443 |
+
global?: boolean;
|
| 444 |
+
};
|
| 445 |
+
export type TuiPluginInstallResult = {
|
| 446 |
+
ok: true;
|
| 447 |
+
dir: string;
|
| 448 |
+
tui: boolean;
|
| 449 |
+
} | {
|
| 450 |
+
ok: false;
|
| 451 |
+
message: string;
|
| 452 |
+
missing?: boolean;
|
| 453 |
+
};
|
| 454 |
+
export type TuiWorkspace = {
|
| 455 |
+
current: () => string | undefined;
|
| 456 |
+
set: (workspaceID?: string) => void;
|
| 457 |
+
};
|
| 458 |
+
export type TuiPluginApi = {
|
| 459 |
+
app: TuiApp;
|
| 460 |
+
attention: TuiAttention;
|
| 461 |
+
/**
|
| 462 |
+
* Legacy `api.command` API kept so v1 plugins can initialize. Remove in v2.
|
| 463 |
+
*
|
| 464 |
+
* @deprecated Use `api.keymap.registerLayer`, `api.keymap.dispatchCommand`, and
|
| 465 |
+
* `api.keymap.dispatchCommand("command.palette.show")` instead.
|
| 466 |
+
*/
|
| 467 |
+
command?: TuiCommandApi;
|
| 468 |
+
keys: TuiKeys;
|
| 469 |
+
keymap: TuiKeymap;
|
| 470 |
+
route: {
|
| 471 |
+
register: (routes: TuiRouteDefinition[]) => () => void;
|
| 472 |
+
navigate: (name: string, params?: Record<string, unknown>) => void;
|
| 473 |
+
readonly current: TuiRouteCurrent;
|
| 474 |
+
};
|
| 475 |
+
ui: {
|
| 476 |
+
Dialog: (props: TuiDialogProps) => JSX.Element;
|
| 477 |
+
DialogAlert: (props: TuiDialogAlertProps) => JSX.Element;
|
| 478 |
+
DialogConfirm: (props: TuiDialogConfirmProps) => JSX.Element;
|
| 479 |
+
DialogPrompt: (props: TuiDialogPromptProps) => JSX.Element;
|
| 480 |
+
DialogSelect: <Value = unknown>(props: TuiDialogSelectProps<Value>) => JSX.Element;
|
| 481 |
+
Slot: <Name extends string>(props: TuiSlotProps<Name>) => JSX.Element | null;
|
| 482 |
+
Prompt: (props: TuiPromptProps) => JSX.Element;
|
| 483 |
+
toast: (input: TuiToast) => void;
|
| 484 |
+
dialog: TuiDialogStack;
|
| 485 |
+
};
|
| 486 |
+
readonly tuiConfig: Frozen<TuiConfigView>;
|
| 487 |
+
kv: TuiKV;
|
| 488 |
+
state: TuiState;
|
| 489 |
+
theme: TuiTheme;
|
| 490 |
+
client: OpencodeClient;
|
| 491 |
+
event: TuiEventBus;
|
| 492 |
+
renderer: CliRenderer;
|
| 493 |
+
slots: TuiSlots;
|
| 494 |
+
plugins: {
|
| 495 |
+
list: () => ReadonlyArray<TuiPluginStatus>;
|
| 496 |
+
activate: (id: string) => Promise<boolean>;
|
| 497 |
+
deactivate: (id: string) => Promise<boolean>;
|
| 498 |
+
add: (spec: string) => Promise<boolean>;
|
| 499 |
+
install: (spec: string, options?: TuiPluginInstallOptions) => Promise<TuiPluginInstallResult>;
|
| 500 |
+
};
|
| 501 |
+
lifecycle: TuiLifecycle;
|
| 502 |
+
};
|
| 503 |
+
export type TuiPlugin = (api: TuiPluginApi, options: PluginOptions | undefined, meta: TuiPluginMeta) => Promise<void>;
|
| 504 |
+
export type TuiPluginModule = {
|
| 505 |
+
id?: string;
|
| 506 |
+
tui: TuiPlugin;
|
| 507 |
+
server?: never;
|
| 508 |
+
};
|
.opencode/node_modules/@opencode-ai/plugin/dist/tui.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { createBindingLookup as createKeymapBindingLookup, } from "@opentui/keymap/extras";
|
| 2 |
+
export { stringifyKeySequence, stringifyKeyStroke } from "@opentui/keymap";
|
| 3 |
+
export { formatCommandBindings, formatKeySequence } from "@opentui/keymap/extras";
|
| 4 |
+
export function createBindingLookup(config, options) {
|
| 5 |
+
return createKeymapBindingLookup(config ?? {}, options);
|
| 6 |
+
}
|
| 7 |
+
export const TuiAttentionSoundNames = ["default", "question", "permission", "error", "done", "subagent_done"];
|
.opencode/node_modules/@opencode-ai/plugin/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://json.schemastore.org/package.json",
|
| 3 |
+
"name": "@opencode-ai/plugin",
|
| 4 |
+
"version": "1.15.5",
|
| 5 |
+
"type": "module",
|
| 6 |
+
"license": "MIT",
|
| 7 |
+
"scripts": {
|
| 8 |
+
"typecheck": "tsgo --noEmit",
|
| 9 |
+
"build": "tsc"
|
| 10 |
+
},
|
| 11 |
+
"exports": {
|
| 12 |
+
".": {
|
| 13 |
+
"import": "./dist/index.js",
|
| 14 |
+
"types": "./dist/index.d.ts"
|
| 15 |
+
},
|
| 16 |
+
"./tool": {
|
| 17 |
+
"import": "./dist/tool.js",
|
| 18 |
+
"types": "./dist/tool.d.ts"
|
| 19 |
+
},
|
| 20 |
+
"./tui": {
|
| 21 |
+
"import": "./dist/tui.js",
|
| 22 |
+
"types": "./dist/tui.d.ts"
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
"files": [
|
| 26 |
+
"dist"
|
| 27 |
+
],
|
| 28 |
+
"dependencies": {
|
| 29 |
+
"@opencode-ai/sdk": "1.15.5",
|
| 30 |
+
"effect": "4.0.0-beta.65",
|
| 31 |
+
"zod": "4.1.8"
|
| 32 |
+
},
|
| 33 |
+
"peerDependencies": {
|
| 34 |
+
"@opentui/core": ">=0.2.14",
|
| 35 |
+
"@opentui/keymap": ">=0.2.14",
|
| 36 |
+
"@opentui/solid": ">=0.2.14"
|
| 37 |
+
},
|
| 38 |
+
"peerDependenciesMeta": {
|
| 39 |
+
"@opentui/core": {
|
| 40 |
+
"optional": true
|
| 41 |
+
},
|
| 42 |
+
"@opentui/keymap": {
|
| 43 |
+
"optional": true
|
| 44 |
+
},
|
| 45 |
+
"@opentui/solid": {
|
| 46 |
+
"optional": true
|
| 47 |
+
}
|
| 48 |
+
},
|
| 49 |
+
"devDependencies": {
|
| 50 |
+
"@opentui/core": "0.2.14",
|
| 51 |
+
"@opentui/keymap": "0.2.14",
|
| 52 |
+
"@opentui/solid": "0.2.14",
|
| 53 |
+
"@tsconfig/node22": "22.0.2",
|
| 54 |
+
"@types/node": "24.12.2",
|
| 55 |
+
"typescript": "5.8.2",
|
| 56 |
+
"@typescript/native-preview": "7.0.0-dev.20251207.1"
|
| 57 |
+
}
|
| 58 |
+
}
|
.opencode/node_modules/@opencode-ai/sdk/dist/client.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export * from "./gen/types.gen.js";
|
| 2 |
+
import { type Config } from "./gen/client/types.gen.js";
|
| 3 |
+
import { OpencodeClient } from "./gen/sdk.gen.js";
|
| 4 |
+
export { type Config as OpencodeClientConfig, OpencodeClient };
|
| 5 |
+
export declare function createOpencodeClient(config?: Config & {
|
| 6 |
+
directory?: string;
|
| 7 |
+
}): OpencodeClient;
|
.opencode/node_modules/@opencode-ai/sdk/dist/client.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export * from "./gen/types.gen.js";
|
| 2 |
+
import { createClient } from "./gen/client/client.gen.js";
|
| 3 |
+
import { OpencodeClient } from "./gen/sdk.gen.js";
|
| 4 |
+
import { wrapClientError } from "./error-interceptor.js";
|
| 5 |
+
export { OpencodeClient };
|
| 6 |
+
function pick(value, fallback) {
|
| 7 |
+
if (!value)
|
| 8 |
+
return;
|
| 9 |
+
if (!fallback)
|
| 10 |
+
return value;
|
| 11 |
+
if (value === fallback)
|
| 12 |
+
return fallback;
|
| 13 |
+
if (value === encodeURIComponent(fallback))
|
| 14 |
+
return fallback;
|
| 15 |
+
return value;
|
| 16 |
+
}
|
| 17 |
+
function rewrite(request, directory) {
|
| 18 |
+
if (request.method !== "GET" && request.method !== "HEAD")
|
| 19 |
+
return request;
|
| 20 |
+
const value = pick(request.headers.get("x-opencode-directory"), directory);
|
| 21 |
+
if (!value)
|
| 22 |
+
return request;
|
| 23 |
+
const url = new URL(request.url);
|
| 24 |
+
if (!url.searchParams.has("directory")) {
|
| 25 |
+
url.searchParams.set("directory", value);
|
| 26 |
+
}
|
| 27 |
+
const next = new Request(url, request);
|
| 28 |
+
next.headers.delete("x-opencode-directory");
|
| 29 |
+
return next;
|
| 30 |
+
}
|
| 31 |
+
export function createOpencodeClient(config) {
|
| 32 |
+
if (!config?.fetch) {
|
| 33 |
+
const customFetch = (req) => {
|
| 34 |
+
// @ts-ignore
|
| 35 |
+
req.timeout = false;
|
| 36 |
+
return fetch(req);
|
| 37 |
+
};
|
| 38 |
+
config = {
|
| 39 |
+
...config,
|
| 40 |
+
fetch: customFetch,
|
| 41 |
+
};
|
| 42 |
+
}
|
| 43 |
+
if (config?.directory) {
|
| 44 |
+
config.headers = {
|
| 45 |
+
...config.headers,
|
| 46 |
+
"x-opencode-directory": encodeURIComponent(config.directory),
|
| 47 |
+
};
|
| 48 |
+
}
|
| 49 |
+
const client = createClient(config);
|
| 50 |
+
client.interceptors.request.use((request) => rewrite(request, config?.directory));
|
| 51 |
+
client.interceptors.error.use(wrapClientError);
|
| 52 |
+
return new OpencodeClient({ client });
|
| 53 |
+
}
|
.opencode/node_modules/@opencode-ai/sdk/dist/error-interceptor.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Wrap whatever the generated client decoded from a non-2xx error body
|
| 3 |
+
* into a real `Error` so downstream formatters (TUI, plugins) get a
|
| 4 |
+
* useful `.message` instead of `[object Object]` or blank. The original
|
| 5 |
+
* parsed body and status live under `.cause` for callers that need
|
| 6 |
+
* structured fields.
|
| 7 |
+
*
|
| 8 |
+
* Only fires when the caller used `{ throwOnError: true }`. Callers that
|
| 9 |
+
* read `result.error` directly (the result-tuple path) get the parsed
|
| 10 |
+
* body unchanged so existing field-level reads (`.error.name`,
|
| 11 |
+
* `JSON.stringify(error)`, etc.) are byte-for-byte identical to before.
|
| 12 |
+
*/
|
| 13 |
+
export declare function wrapClientError(error: unknown, response: Response | undefined, request: Request | undefined, opts: {
|
| 14 |
+
throwOnError?: boolean;
|
| 15 |
+
} | undefined): unknown;
|
.opencode/node_modules/@opencode-ai/sdk/dist/error-interceptor.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Wrap whatever the generated client decoded from a non-2xx error body
|
| 3 |
+
* into a real `Error` so downstream formatters (TUI, plugins) get a
|
| 4 |
+
* useful `.message` instead of `[object Object]` or blank. The original
|
| 5 |
+
* parsed body and status live under `.cause` for callers that need
|
| 6 |
+
* structured fields.
|
| 7 |
+
*
|
| 8 |
+
* Only fires when the caller used `{ throwOnError: true }`. Callers that
|
| 9 |
+
* read `result.error` directly (the result-tuple path) get the parsed
|
| 10 |
+
* body unchanged so existing field-level reads (`.error.name`,
|
| 11 |
+
* `JSON.stringify(error)`, etc.) are byte-for-byte identical to before.
|
| 12 |
+
*/
|
| 13 |
+
export function wrapClientError(error, response, request, opts) {
|
| 14 |
+
if (!opts?.throwOnError)
|
| 15 |
+
return error;
|
| 16 |
+
if (error instanceof Error)
|
| 17 |
+
return error;
|
| 18 |
+
// NamedError-shaped responses (the common case for opencode 4xx) come
|
| 19 |
+
// through as POJOs — extract a useful message first, then wrap.
|
| 20 |
+
if (typeof error === "object" && error !== null && Object.keys(error).length > 0) {
|
| 21 |
+
const obj = error;
|
| 22 |
+
const message = (typeof obj.data?.message === "string" && obj.data.message) ||
|
| 23 |
+
(typeof obj.message === "string" && obj.message) ||
|
| 24 |
+
(typeof obj.name === "string" && obj.name) ||
|
| 25 |
+
describe(request, response);
|
| 26 |
+
return new Error(message, { cause: { body: error, status: response?.status } });
|
| 27 |
+
}
|
| 28 |
+
if (typeof error === "string" && error.length > 0) {
|
| 29 |
+
return new Error(error, { cause: { body: error, status: response?.status } });
|
| 30 |
+
}
|
| 31 |
+
// Empty body / network failure / undefined / null / empty object.
|
| 32 |
+
const reason = response ? "(empty response body)" : "network error (no response)";
|
| 33 |
+
return new Error(`opencode server ${describe(request, response)}: ${reason}`, {
|
| 34 |
+
cause: { body: error, status: response?.status },
|
| 35 |
+
});
|
| 36 |
+
}
|
| 37 |
+
function describe(request, response) {
|
| 38 |
+
const method = request?.method ?? "?";
|
| 39 |
+
const url = request?.url ?? "?";
|
| 40 |
+
const status = response?.status;
|
| 41 |
+
const statusText = response?.statusText;
|
| 42 |
+
return `${method} ${url}${status ? " → " + status : ""}${statusText ? " " + statusText : ""}`;
|
| 43 |
+
}
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client.gen.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { ClientOptions } from "./types.gen.js";
|
| 2 |
+
import { type Config, type ClientOptions as DefaultClientOptions } from "./client/index.js";
|
| 3 |
+
/**
|
| 4 |
+
* The `createClientConfig()` function will be called on client initialization
|
| 5 |
+
* and the returned object will become the client's initial configuration.
|
| 6 |
+
*
|
| 7 |
+
* You may want to initialize your client this way instead of calling
|
| 8 |
+
* `setConfig()`. This is useful for example if you're using Next.js
|
| 9 |
+
* to ensure your client always has the correct values.
|
| 10 |
+
*/
|
| 11 |
+
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
|
| 12 |
+
export declare const client: import("./client/types.gen.js").Client;
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client.gen.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by @hey-api/openapi-ts
|
| 2 |
+
import { createClient, createConfig } from "./client/index.js";
|
| 3 |
+
export const client = createClient(createConfig({
|
| 4 |
+
baseUrl: "http://localhost:4096",
|
| 5 |
+
}));
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/client.gen.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { Client, Config } from "./types.gen.js";
|
| 2 |
+
export declare const createClient: (config?: Config) => Client;
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/client.gen.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by @hey-api/openapi-ts
|
| 2 |
+
import { createSseClient } from "../core/serverSentEvents.gen.js";
|
| 3 |
+
import { buildUrl, createConfig, createInterceptors, getParseAs, mergeConfigs, mergeHeaders, setAuthParams, } from "./utils.gen.js";
|
| 4 |
+
export const createClient = (config = {}) => {
|
| 5 |
+
let _config = mergeConfigs(createConfig(), config);
|
| 6 |
+
const getConfig = () => ({ ..._config });
|
| 7 |
+
const setConfig = (config) => {
|
| 8 |
+
_config = mergeConfigs(_config, config);
|
| 9 |
+
return getConfig();
|
| 10 |
+
};
|
| 11 |
+
const interceptors = createInterceptors();
|
| 12 |
+
const beforeRequest = async (options) => {
|
| 13 |
+
const opts = {
|
| 14 |
+
..._config,
|
| 15 |
+
...options,
|
| 16 |
+
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
| 17 |
+
headers: mergeHeaders(_config.headers, options.headers),
|
| 18 |
+
serializedBody: undefined,
|
| 19 |
+
};
|
| 20 |
+
if (opts.security) {
|
| 21 |
+
await setAuthParams({
|
| 22 |
+
...opts,
|
| 23 |
+
security: opts.security,
|
| 24 |
+
});
|
| 25 |
+
}
|
| 26 |
+
if (opts.requestValidator) {
|
| 27 |
+
await opts.requestValidator(opts);
|
| 28 |
+
}
|
| 29 |
+
if (opts.body && opts.bodySerializer) {
|
| 30 |
+
opts.serializedBody = opts.bodySerializer(opts.body);
|
| 31 |
+
}
|
| 32 |
+
// remove Content-Type header if body is empty to avoid sending invalid requests
|
| 33 |
+
if (opts.serializedBody === undefined || opts.serializedBody === "") {
|
| 34 |
+
opts.headers.delete("Content-Type");
|
| 35 |
+
}
|
| 36 |
+
const url = buildUrl(opts);
|
| 37 |
+
return { opts, url };
|
| 38 |
+
};
|
| 39 |
+
const request = async (options) => {
|
| 40 |
+
// @ts-expect-error
|
| 41 |
+
const { opts, url } = await beforeRequest(options);
|
| 42 |
+
const requestInit = {
|
| 43 |
+
redirect: "follow",
|
| 44 |
+
...opts,
|
| 45 |
+
body: opts.serializedBody,
|
| 46 |
+
};
|
| 47 |
+
let request = new Request(url, requestInit);
|
| 48 |
+
for (const fn of interceptors.request._fns) {
|
| 49 |
+
if (fn) {
|
| 50 |
+
request = await fn(request, opts);
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
// fetch must be assigned here, otherwise it would throw the error:
|
| 54 |
+
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
| 55 |
+
const _fetch = opts.fetch;
|
| 56 |
+
let response = await _fetch(request);
|
| 57 |
+
for (const fn of interceptors.response._fns) {
|
| 58 |
+
if (fn) {
|
| 59 |
+
response = await fn(response, request, opts);
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
const result = {
|
| 63 |
+
request,
|
| 64 |
+
response,
|
| 65 |
+
};
|
| 66 |
+
if (response.ok) {
|
| 67 |
+
if (response.status === 204 || response.headers.get("Content-Length") === "0") {
|
| 68 |
+
return opts.responseStyle === "data"
|
| 69 |
+
? {}
|
| 70 |
+
: {
|
| 71 |
+
data: {},
|
| 72 |
+
...result,
|
| 73 |
+
};
|
| 74 |
+
}
|
| 75 |
+
const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
|
| 76 |
+
let data;
|
| 77 |
+
switch (parseAs) {
|
| 78 |
+
case "arrayBuffer":
|
| 79 |
+
case "blob":
|
| 80 |
+
case "formData":
|
| 81 |
+
case "json":
|
| 82 |
+
case "text":
|
| 83 |
+
data = await response[parseAs]();
|
| 84 |
+
break;
|
| 85 |
+
case "stream":
|
| 86 |
+
return opts.responseStyle === "data"
|
| 87 |
+
? response.body
|
| 88 |
+
: {
|
| 89 |
+
data: response.body,
|
| 90 |
+
...result,
|
| 91 |
+
};
|
| 92 |
+
}
|
| 93 |
+
if (parseAs === "json") {
|
| 94 |
+
if (opts.responseValidator) {
|
| 95 |
+
await opts.responseValidator(data);
|
| 96 |
+
}
|
| 97 |
+
if (opts.responseTransformer) {
|
| 98 |
+
data = await opts.responseTransformer(data);
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
return opts.responseStyle === "data"
|
| 102 |
+
? data
|
| 103 |
+
: {
|
| 104 |
+
data,
|
| 105 |
+
...result,
|
| 106 |
+
};
|
| 107 |
+
}
|
| 108 |
+
const textError = await response.text();
|
| 109 |
+
let jsonError;
|
| 110 |
+
try {
|
| 111 |
+
jsonError = JSON.parse(textError);
|
| 112 |
+
}
|
| 113 |
+
catch {
|
| 114 |
+
// noop
|
| 115 |
+
}
|
| 116 |
+
const error = jsonError ?? textError;
|
| 117 |
+
let finalError = error;
|
| 118 |
+
for (const fn of interceptors.error._fns) {
|
| 119 |
+
if (fn) {
|
| 120 |
+
finalError = (await fn(error, response, request, opts));
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
finalError = finalError || {};
|
| 124 |
+
if (opts.throwOnError) {
|
| 125 |
+
throw finalError;
|
| 126 |
+
}
|
| 127 |
+
// TODO: we probably want to return error and improve types
|
| 128 |
+
return opts.responseStyle === "data"
|
| 129 |
+
? undefined
|
| 130 |
+
: {
|
| 131 |
+
error: finalError,
|
| 132 |
+
...result,
|
| 133 |
+
};
|
| 134 |
+
};
|
| 135 |
+
const makeMethod = (method) => {
|
| 136 |
+
const fn = (options) => request({ ...options, method });
|
| 137 |
+
fn.sse = async (options) => {
|
| 138 |
+
const { opts, url } = await beforeRequest(options);
|
| 139 |
+
return createSseClient({
|
| 140 |
+
...opts,
|
| 141 |
+
body: opts.body,
|
| 142 |
+
headers: opts.headers,
|
| 143 |
+
method,
|
| 144 |
+
url,
|
| 145 |
+
});
|
| 146 |
+
};
|
| 147 |
+
return fn;
|
| 148 |
+
};
|
| 149 |
+
return {
|
| 150 |
+
buildUrl,
|
| 151 |
+
connect: makeMethod("CONNECT"),
|
| 152 |
+
delete: makeMethod("DELETE"),
|
| 153 |
+
get: makeMethod("GET"),
|
| 154 |
+
getConfig,
|
| 155 |
+
head: makeMethod("HEAD"),
|
| 156 |
+
interceptors,
|
| 157 |
+
options: makeMethod("OPTIONS"),
|
| 158 |
+
patch: makeMethod("PATCH"),
|
| 159 |
+
post: makeMethod("POST"),
|
| 160 |
+
put: makeMethod("PUT"),
|
| 161 |
+
request,
|
| 162 |
+
setConfig,
|
| 163 |
+
trace: makeMethod("TRACE"),
|
| 164 |
+
};
|
| 165 |
+
};
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export type { Auth } from "../core/auth.gen.js";
|
| 2 |
+
export type { QuerySerializerOptions } from "../core/bodySerializer.gen.js";
|
| 3 |
+
export { formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer, } from "../core/bodySerializer.gen.js";
|
| 4 |
+
export { buildClientParams } from "../core/params.gen.js";
|
| 5 |
+
export { createClient } from "./client.gen.js";
|
| 6 |
+
export type { Client, ClientOptions, Config, CreateClientConfig, Options, OptionsLegacyParser, RequestOptions, RequestResult, ResolvedRequestOptions, ResponseStyle, TDataShape, } from "./types.gen.js";
|
| 7 |
+
export { createConfig, mergeHeaders } from "./utils.gen.js";
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by @hey-api/openapi-ts
|
| 2 |
+
export { formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer, } from "../core/bodySerializer.gen.js";
|
| 3 |
+
export { buildClientParams } from "../core/params.gen.js";
|
| 4 |
+
export { createClient } from "./client.gen.js";
|
| 5 |
+
export { createConfig, mergeHeaders } from "./utils.gen.js";
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/types.gen.d.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { Auth } from "../core/auth.gen.js";
|
| 2 |
+
import type { ServerSentEventsOptions, ServerSentEventsResult } from "../core/serverSentEvents.gen.js";
|
| 3 |
+
import type { Client as CoreClient, Config as CoreConfig } from "../core/types.gen.js";
|
| 4 |
+
import type { Middleware } from "./utils.gen.js";
|
| 5 |
+
export type ResponseStyle = "data" | "fields";
|
| 6 |
+
export interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, "body" | "headers" | "method">, CoreConfig {
|
| 7 |
+
/**
|
| 8 |
+
* Base URL for all requests made by this client.
|
| 9 |
+
*/
|
| 10 |
+
baseUrl?: T["baseUrl"];
|
| 11 |
+
/**
|
| 12 |
+
* Fetch API implementation. You can use this option to provide a custom
|
| 13 |
+
* fetch instance.
|
| 14 |
+
*
|
| 15 |
+
* @default globalThis.fetch
|
| 16 |
+
*/
|
| 17 |
+
fetch?: (request: Request) => ReturnType<typeof fetch>;
|
| 18 |
+
/**
|
| 19 |
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
| 20 |
+
* options won't have any effect.
|
| 21 |
+
*
|
| 22 |
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
| 23 |
+
*/
|
| 24 |
+
next?: never;
|
| 25 |
+
/**
|
| 26 |
+
* Return the response data parsed in a specified format. By default, `auto`
|
| 27 |
+
* will infer the appropriate method from the `Content-Type` response header.
|
| 28 |
+
* You can override this behavior with any of the {@link Body} methods.
|
| 29 |
+
* Select `stream` if you don't want to parse response data at all.
|
| 30 |
+
*
|
| 31 |
+
* @default 'auto'
|
| 32 |
+
*/
|
| 33 |
+
parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text";
|
| 34 |
+
/**
|
| 35 |
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
| 36 |
+
*
|
| 37 |
+
* @default 'fields'
|
| 38 |
+
*/
|
| 39 |
+
responseStyle?: ResponseStyle;
|
| 40 |
+
/**
|
| 41 |
+
* Throw an error instead of returning it in the response?
|
| 42 |
+
*
|
| 43 |
+
* @default false
|
| 44 |
+
*/
|
| 45 |
+
throwOnError?: T["throwOnError"];
|
| 46 |
+
}
|
| 47 |
+
export interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
| 48 |
+
responseStyle: TResponseStyle;
|
| 49 |
+
throwOnError: ThrowOnError;
|
| 50 |
+
}>, Pick<ServerSentEventsOptions<TData>, "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> {
|
| 51 |
+
/**
|
| 52 |
+
* Any body that you want to add to your request.
|
| 53 |
+
*
|
| 54 |
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
| 55 |
+
*/
|
| 56 |
+
body?: unknown;
|
| 57 |
+
path?: Record<string, unknown>;
|
| 58 |
+
query?: Record<string, unknown>;
|
| 59 |
+
/**
|
| 60 |
+
* Security mechanism(s) to use for the request.
|
| 61 |
+
*/
|
| 62 |
+
security?: ReadonlyArray<Auth>;
|
| 63 |
+
url: Url;
|
| 64 |
+
}
|
| 65 |
+
export interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
| 66 |
+
serializedBody?: string;
|
| 67 |
+
}
|
| 68 |
+
export type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = ThrowOnError extends true ? Promise<TResponseStyle extends "data" ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
| 69 |
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
| 70 |
+
request: Request;
|
| 71 |
+
response: Response;
|
| 72 |
+
}> : Promise<TResponseStyle extends "data" ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
| 73 |
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
| 74 |
+
error: undefined;
|
| 75 |
+
} | {
|
| 76 |
+
data: undefined;
|
| 77 |
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
| 78 |
+
}) & {
|
| 79 |
+
request: Request;
|
| 80 |
+
response: Response;
|
| 81 |
+
}>;
|
| 82 |
+
export interface ClientOptions {
|
| 83 |
+
baseUrl?: string;
|
| 84 |
+
responseStyle?: ResponseStyle;
|
| 85 |
+
throwOnError?: boolean;
|
| 86 |
+
}
|
| 87 |
+
type MethodFnBase = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
| 88 |
+
type MethodFnServerSentEvents = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
|
| 89 |
+
type MethodFn = MethodFnBase & {
|
| 90 |
+
sse: MethodFnServerSentEvents;
|
| 91 |
+
};
|
| 92 |
+
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
| 93 |
+
type BuildUrlFn = <TData extends {
|
| 94 |
+
body?: unknown;
|
| 95 |
+
path?: Record<string, unknown>;
|
| 96 |
+
query?: Record<string, unknown>;
|
| 97 |
+
url: string;
|
| 98 |
+
}>(options: Pick<TData, "url"> & Options<TData>) => string;
|
| 99 |
+
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn> & {
|
| 100 |
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
| 101 |
+
};
|
| 102 |
+
/**
|
| 103 |
+
* The `createClientConfig()` function will be called on client initialization
|
| 104 |
+
* and the returned object will become the client's initial configuration.
|
| 105 |
+
*
|
| 106 |
+
* You may want to initialize your client this way instead of calling
|
| 107 |
+
* `setConfig()`. This is useful for example if you're using Next.js
|
| 108 |
+
* to ensure your client always has the correct values.
|
| 109 |
+
*/
|
| 110 |
+
export type CreateClientConfig<T extends ClientOptions = ClientOptions> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
|
| 111 |
+
export interface TDataShape {
|
| 112 |
+
body?: unknown;
|
| 113 |
+
headers?: unknown;
|
| 114 |
+
path?: unknown;
|
| 115 |
+
query?: unknown;
|
| 116 |
+
url: string;
|
| 117 |
+
}
|
| 118 |
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
| 119 |
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = "fields"> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> & Omit<TData, "url">;
|
| 120 |
+
export type OptionsLegacyParser<TData = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = TData extends {
|
| 121 |
+
body?: any;
|
| 122 |
+
} ? TData extends {
|
| 123 |
+
headers?: any;
|
| 124 |
+
} ? OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body" | "headers" | "url"> & TData : OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body" | "url"> & TData & Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "headers"> : TData extends {
|
| 125 |
+
headers?: any;
|
| 126 |
+
} ? OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "headers" | "url"> & TData & Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body"> : OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "url"> & TData;
|
| 127 |
+
export {};
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/types.gen.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by @hey-api/openapi-ts
|
| 2 |
+
export {};
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/utils.gen.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { QuerySerializerOptions } from "../core/bodySerializer.gen.js";
|
| 2 |
+
import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen.js";
|
| 3 |
+
export declare const createQuerySerializer: <T = unknown>({ allowReserved, array, object }?: QuerySerializerOptions) => (queryParams: T) => string;
|
| 4 |
+
/**
|
| 5 |
+
* Infers parseAs value from provided Content-Type header.
|
| 6 |
+
*/
|
| 7 |
+
export declare const getParseAs: (contentType: string | null) => Exclude<Config["parseAs"], "auto">;
|
| 8 |
+
export declare const setAuthParams: ({ security, ...options }: Pick<Required<RequestOptions>, "security"> & Pick<RequestOptions, "auth" | "query"> & {
|
| 9 |
+
headers: Headers;
|
| 10 |
+
}) => Promise<void>;
|
| 11 |
+
export declare const buildUrl: Client["buildUrl"];
|
| 12 |
+
export declare const mergeConfigs: (a: Config, b: Config) => Config;
|
| 13 |
+
export declare const mergeHeaders: (...headers: Array<Required<Config>["headers"] | undefined>) => Headers;
|
| 14 |
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
|
| 15 |
+
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
| 16 |
+
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
| 17 |
+
declare class Interceptors<Interceptor> {
|
| 18 |
+
_fns: (Interceptor | null)[];
|
| 19 |
+
constructor();
|
| 20 |
+
clear(): void;
|
| 21 |
+
getInterceptorIndex(id: number | Interceptor): number;
|
| 22 |
+
exists(id: number | Interceptor): boolean;
|
| 23 |
+
eject(id: number | Interceptor): void;
|
| 24 |
+
update(id: number | Interceptor, fn: Interceptor): number | false | Interceptor;
|
| 25 |
+
use(fn: Interceptor): number;
|
| 26 |
+
}
|
| 27 |
+
export interface Middleware<Req, Res, Err, Options> {
|
| 28 |
+
error: Pick<Interceptors<ErrInterceptor<Err, Res, Req, Options>>, "eject" | "use">;
|
| 29 |
+
request: Pick<Interceptors<ReqInterceptor<Req, Options>>, "eject" | "use">;
|
| 30 |
+
response: Pick<Interceptors<ResInterceptor<Res, Req, Options>>, "eject" | "use">;
|
| 31 |
+
}
|
| 32 |
+
export declare const createInterceptors: <Req, Res, Err, Options>() => {
|
| 33 |
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
| 34 |
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
| 35 |
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
| 36 |
+
};
|
| 37 |
+
export declare const createConfig: <T extends ClientOptions = ClientOptions>(override?: Config<Omit<ClientOptions, keyof T> & T>) => Config<Omit<ClientOptions, keyof T> & T>;
|
| 38 |
+
export {};
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/utils.gen.js
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by @hey-api/openapi-ts
|
| 2 |
+
import { getAuthToken } from "../core/auth.gen.js";
|
| 3 |
+
import { jsonBodySerializer } from "../core/bodySerializer.gen.js";
|
| 4 |
+
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } from "../core/pathSerializer.gen.js";
|
| 5 |
+
import { getUrl } from "../core/utils.gen.js";
|
| 6 |
+
export const createQuerySerializer = ({ allowReserved, array, object } = {}) => {
|
| 7 |
+
const querySerializer = (queryParams) => {
|
| 8 |
+
const search = [];
|
| 9 |
+
if (queryParams && typeof queryParams === "object") {
|
| 10 |
+
for (const name in queryParams) {
|
| 11 |
+
const value = queryParams[name];
|
| 12 |
+
if (value === undefined || value === null) {
|
| 13 |
+
continue;
|
| 14 |
+
}
|
| 15 |
+
if (Array.isArray(value)) {
|
| 16 |
+
const serializedArray = serializeArrayParam({
|
| 17 |
+
allowReserved,
|
| 18 |
+
explode: true,
|
| 19 |
+
name,
|
| 20 |
+
style: "form",
|
| 21 |
+
value,
|
| 22 |
+
...array,
|
| 23 |
+
});
|
| 24 |
+
if (serializedArray)
|
| 25 |
+
search.push(serializedArray);
|
| 26 |
+
}
|
| 27 |
+
else if (typeof value === "object") {
|
| 28 |
+
const serializedObject = serializeObjectParam({
|
| 29 |
+
allowReserved,
|
| 30 |
+
explode: true,
|
| 31 |
+
name,
|
| 32 |
+
style: "deepObject",
|
| 33 |
+
value: value,
|
| 34 |
+
...object,
|
| 35 |
+
});
|
| 36 |
+
if (serializedObject)
|
| 37 |
+
search.push(serializedObject);
|
| 38 |
+
}
|
| 39 |
+
else {
|
| 40 |
+
const serializedPrimitive = serializePrimitiveParam({
|
| 41 |
+
allowReserved,
|
| 42 |
+
name,
|
| 43 |
+
value: value,
|
| 44 |
+
});
|
| 45 |
+
if (serializedPrimitive)
|
| 46 |
+
search.push(serializedPrimitive);
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
return search.join("&");
|
| 51 |
+
};
|
| 52 |
+
return querySerializer;
|
| 53 |
+
};
|
| 54 |
+
/**
|
| 55 |
+
* Infers parseAs value from provided Content-Type header.
|
| 56 |
+
*/
|
| 57 |
+
export const getParseAs = (contentType) => {
|
| 58 |
+
if (!contentType) {
|
| 59 |
+
// If no Content-Type header is provided, the best we can do is return the raw response body,
|
| 60 |
+
// which is effectively the same as the 'stream' option.
|
| 61 |
+
return "stream";
|
| 62 |
+
}
|
| 63 |
+
const cleanContent = contentType.split(";")[0]?.trim();
|
| 64 |
+
if (!cleanContent) {
|
| 65 |
+
return;
|
| 66 |
+
}
|
| 67 |
+
if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) {
|
| 68 |
+
return "json";
|
| 69 |
+
}
|
| 70 |
+
if (cleanContent === "multipart/form-data") {
|
| 71 |
+
return "formData";
|
| 72 |
+
}
|
| 73 |
+
if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
|
| 74 |
+
return "blob";
|
| 75 |
+
}
|
| 76 |
+
if (cleanContent.startsWith("text/")) {
|
| 77 |
+
return "text";
|
| 78 |
+
}
|
| 79 |
+
return;
|
| 80 |
+
};
|
| 81 |
+
const checkForExistence = (options, name) => {
|
| 82 |
+
if (!name) {
|
| 83 |
+
return false;
|
| 84 |
+
}
|
| 85 |
+
if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
|
| 86 |
+
return true;
|
| 87 |
+
}
|
| 88 |
+
return false;
|
| 89 |
+
};
|
| 90 |
+
export const setAuthParams = async ({ security, ...options }) => {
|
| 91 |
+
for (const auth of security) {
|
| 92 |
+
if (checkForExistence(options, auth.name)) {
|
| 93 |
+
continue;
|
| 94 |
+
}
|
| 95 |
+
const token = await getAuthToken(auth, options.auth);
|
| 96 |
+
if (!token) {
|
| 97 |
+
continue;
|
| 98 |
+
}
|
| 99 |
+
const name = auth.name ?? "Authorization";
|
| 100 |
+
switch (auth.in) {
|
| 101 |
+
case "query":
|
| 102 |
+
if (!options.query) {
|
| 103 |
+
options.query = {};
|
| 104 |
+
}
|
| 105 |
+
options.query[name] = token;
|
| 106 |
+
break;
|
| 107 |
+
case "cookie":
|
| 108 |
+
options.headers.append("Cookie", `${name}=${token}`);
|
| 109 |
+
break;
|
| 110 |
+
case "header":
|
| 111 |
+
default:
|
| 112 |
+
options.headers.set(name, token);
|
| 113 |
+
break;
|
| 114 |
+
}
|
| 115 |
+
}
|
| 116 |
+
};
|
| 117 |
+
export const buildUrl = (options) => getUrl({
|
| 118 |
+
baseUrl: options.baseUrl,
|
| 119 |
+
path: options.path,
|
| 120 |
+
query: options.query,
|
| 121 |
+
querySerializer: typeof options.querySerializer === "function"
|
| 122 |
+
? options.querySerializer
|
| 123 |
+
: createQuerySerializer(options.querySerializer),
|
| 124 |
+
url: options.url,
|
| 125 |
+
});
|
| 126 |
+
export const mergeConfigs = (a, b) => {
|
| 127 |
+
const config = { ...a, ...b };
|
| 128 |
+
if (config.baseUrl?.endsWith("/")) {
|
| 129 |
+
config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
|
| 130 |
+
}
|
| 131 |
+
config.headers = mergeHeaders(a.headers, b.headers);
|
| 132 |
+
return config;
|
| 133 |
+
};
|
| 134 |
+
export const mergeHeaders = (...headers) => {
|
| 135 |
+
const mergedHeaders = new Headers();
|
| 136 |
+
for (const header of headers) {
|
| 137 |
+
if (!header || typeof header !== "object") {
|
| 138 |
+
continue;
|
| 139 |
+
}
|
| 140 |
+
const iterator = header instanceof Headers ? header.entries() : Object.entries(header);
|
| 141 |
+
for (const [key, value] of iterator) {
|
| 142 |
+
if (value === null) {
|
| 143 |
+
mergedHeaders.delete(key);
|
| 144 |
+
}
|
| 145 |
+
else if (Array.isArray(value)) {
|
| 146 |
+
for (const v of value) {
|
| 147 |
+
mergedHeaders.append(key, v);
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
else if (value !== undefined) {
|
| 151 |
+
// assume object headers are meant to be JSON stringified, i.e. their
|
| 152 |
+
// content value in OpenAPI specification is 'application/json'
|
| 153 |
+
mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : value);
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
return mergedHeaders;
|
| 158 |
+
};
|
| 159 |
+
class Interceptors {
|
| 160 |
+
_fns;
|
| 161 |
+
constructor() {
|
| 162 |
+
this._fns = [];
|
| 163 |
+
}
|
| 164 |
+
clear() {
|
| 165 |
+
this._fns = [];
|
| 166 |
+
}
|
| 167 |
+
getInterceptorIndex(id) {
|
| 168 |
+
if (typeof id === "number") {
|
| 169 |
+
return this._fns[id] ? id : -1;
|
| 170 |
+
}
|
| 171 |
+
else {
|
| 172 |
+
return this._fns.indexOf(id);
|
| 173 |
+
}
|
| 174 |
+
}
|
| 175 |
+
exists(id) {
|
| 176 |
+
const index = this.getInterceptorIndex(id);
|
| 177 |
+
return !!this._fns[index];
|
| 178 |
+
}
|
| 179 |
+
eject(id) {
|
| 180 |
+
const index = this.getInterceptorIndex(id);
|
| 181 |
+
if (this._fns[index]) {
|
| 182 |
+
this._fns[index] = null;
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
+
update(id, fn) {
|
| 186 |
+
const index = this.getInterceptorIndex(id);
|
| 187 |
+
if (this._fns[index]) {
|
| 188 |
+
this._fns[index] = fn;
|
| 189 |
+
return id;
|
| 190 |
+
}
|
| 191 |
+
else {
|
| 192 |
+
return false;
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
use(fn) {
|
| 196 |
+
this._fns = [...this._fns, fn];
|
| 197 |
+
return this._fns.length - 1;
|
| 198 |
+
}
|
| 199 |
+
}
|
| 200 |
+
// do not add `Middleware` as return type so we can use _fns internally
|
| 201 |
+
export const createInterceptors = () => ({
|
| 202 |
+
error: new Interceptors(),
|
| 203 |
+
request: new Interceptors(),
|
| 204 |
+
response: new Interceptors(),
|
| 205 |
+
});
|
| 206 |
+
const defaultQuerySerializer = createQuerySerializer({
|
| 207 |
+
allowReserved: false,
|
| 208 |
+
array: {
|
| 209 |
+
explode: true,
|
| 210 |
+
style: "form",
|
| 211 |
+
},
|
| 212 |
+
object: {
|
| 213 |
+
explode: true,
|
| 214 |
+
style: "deepObject",
|
| 215 |
+
},
|
| 216 |
+
});
|
| 217 |
+
const defaultHeaders = {
|
| 218 |
+
"Content-Type": "application/json",
|
| 219 |
+
};
|
| 220 |
+
export const createConfig = (override = {}) => ({
|
| 221 |
+
...jsonBodySerializer,
|
| 222 |
+
headers: defaultHeaders,
|
| 223 |
+
parseAs: "auto",
|
| 224 |
+
querySerializer: defaultQuerySerializer,
|
| 225 |
+
...override,
|
| 226 |
+
});
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/auth.gen.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export type AuthToken = string | undefined;
|
| 2 |
+
export interface Auth {
|
| 3 |
+
/**
|
| 4 |
+
* Which part of the request do we use to send the auth?
|
| 5 |
+
*
|
| 6 |
+
* @default 'header'
|
| 7 |
+
*/
|
| 8 |
+
in?: "header" | "query" | "cookie";
|
| 9 |
+
/**
|
| 10 |
+
* Header or query parameter name.
|
| 11 |
+
*
|
| 12 |
+
* @default 'Authorization'
|
| 13 |
+
*/
|
| 14 |
+
name?: string;
|
| 15 |
+
scheme?: "basic" | "bearer";
|
| 16 |
+
type: "apiKey" | "http";
|
| 17 |
+
}
|
| 18 |
+
export declare const getAuthToken: (auth: Auth, callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken) => Promise<string | undefined>;
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/auth.gen.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by @hey-api/openapi-ts
|
| 2 |
+
export const getAuthToken = async (auth, callback) => {
|
| 3 |
+
const token = typeof callback === "function" ? await callback(auth) : callback;
|
| 4 |
+
if (!token) {
|
| 5 |
+
return;
|
| 6 |
+
}
|
| 7 |
+
if (auth.scheme === "bearer") {
|
| 8 |
+
return `Bearer ${token}`;
|
| 9 |
+
}
|
| 10 |
+
if (auth.scheme === "basic") {
|
| 11 |
+
return `Basic ${btoa(token)}`;
|
| 12 |
+
}
|
| 13 |
+
return token;
|
| 14 |
+
};
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/bodySerializer.gen.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { ArrayStyle, ObjectStyle, SerializerOptions } from "./pathSerializer.gen.js";
|
| 2 |
+
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
| 3 |
+
export type BodySerializer = (body: any) => any;
|
| 4 |
+
export interface QuerySerializerOptions {
|
| 5 |
+
allowReserved?: boolean;
|
| 6 |
+
array?: SerializerOptions<ArrayStyle>;
|
| 7 |
+
object?: SerializerOptions<ObjectStyle>;
|
| 8 |
+
}
|
| 9 |
+
export declare const formDataBodySerializer: {
|
| 10 |
+
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T) => FormData;
|
| 11 |
+
};
|
| 12 |
+
export declare const jsonBodySerializer: {
|
| 13 |
+
bodySerializer: <T>(body: T) => string;
|
| 14 |
+
};
|
| 15 |
+
export declare const urlSearchParamsBodySerializer: {
|
| 16 |
+
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T) => string;
|
| 17 |
+
};
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/bodySerializer.gen.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by @hey-api/openapi-ts
|
| 2 |
+
const serializeFormDataPair = (data, key, value) => {
|
| 3 |
+
if (typeof value === "string" || value instanceof Blob) {
|
| 4 |
+
data.append(key, value);
|
| 5 |
+
}
|
| 6 |
+
else if (value instanceof Date) {
|
| 7 |
+
data.append(key, value.toISOString());
|
| 8 |
+
}
|
| 9 |
+
else {
|
| 10 |
+
data.append(key, JSON.stringify(value));
|
| 11 |
+
}
|
| 12 |
+
};
|
| 13 |
+
const serializeUrlSearchParamsPair = (data, key, value) => {
|
| 14 |
+
if (typeof value === "string") {
|
| 15 |
+
data.append(key, value);
|
| 16 |
+
}
|
| 17 |
+
else {
|
| 18 |
+
data.append(key, JSON.stringify(value));
|
| 19 |
+
}
|
| 20 |
+
};
|
| 21 |
+
export const formDataBodySerializer = {
|
| 22 |
+
bodySerializer: (body) => {
|
| 23 |
+
const data = new FormData();
|
| 24 |
+
Object.entries(body).forEach(([key, value]) => {
|
| 25 |
+
if (value === undefined || value === null) {
|
| 26 |
+
return;
|
| 27 |
+
}
|
| 28 |
+
if (Array.isArray(value)) {
|
| 29 |
+
value.forEach((v) => serializeFormDataPair(data, key, v));
|
| 30 |
+
}
|
| 31 |
+
else {
|
| 32 |
+
serializeFormDataPair(data, key, value);
|
| 33 |
+
}
|
| 34 |
+
});
|
| 35 |
+
return data;
|
| 36 |
+
},
|
| 37 |
+
};
|
| 38 |
+
export const jsonBodySerializer = {
|
| 39 |
+
bodySerializer: (body) => JSON.stringify(body, (_key, value) => (typeof value === "bigint" ? value.toString() : value)),
|
| 40 |
+
};
|
| 41 |
+
export const urlSearchParamsBodySerializer = {
|
| 42 |
+
bodySerializer: (body) => {
|
| 43 |
+
const data = new URLSearchParams();
|
| 44 |
+
Object.entries(body).forEach(([key, value]) => {
|
| 45 |
+
if (value === undefined || value === null) {
|
| 46 |
+
return;
|
| 47 |
+
}
|
| 48 |
+
if (Array.isArray(value)) {
|
| 49 |
+
value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));
|
| 50 |
+
}
|
| 51 |
+
else {
|
| 52 |
+
serializeUrlSearchParamsPair(data, key, value);
|
| 53 |
+
}
|
| 54 |
+
});
|
| 55 |
+
return data.toString();
|
| 56 |
+
},
|
| 57 |
+
};
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/params.gen.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
type Slot = "body" | "headers" | "path" | "query";
|
| 2 |
+
export type Field = {
|
| 3 |
+
in: Exclude<Slot, "body">;
|
| 4 |
+
/**
|
| 5 |
+
* Field name. This is the name we want the user to see and use.
|
| 6 |
+
*/
|
| 7 |
+
key: string;
|
| 8 |
+
/**
|
| 9 |
+
* Field mapped name. This is the name we want to use in the request.
|
| 10 |
+
* If omitted, we use the same value as `key`.
|
| 11 |
+
*/
|
| 12 |
+
map?: string;
|
| 13 |
+
} | {
|
| 14 |
+
in: Extract<Slot, "body">;
|
| 15 |
+
/**
|
| 16 |
+
* Key isn't required for bodies.
|
| 17 |
+
*/
|
| 18 |
+
key?: string;
|
| 19 |
+
map?: string;
|
| 20 |
+
};
|
| 21 |
+
export interface Fields {
|
| 22 |
+
allowExtra?: Partial<Record<Slot, boolean>>;
|
| 23 |
+
args?: ReadonlyArray<Field>;
|
| 24 |
+
}
|
| 25 |
+
export type FieldsConfig = ReadonlyArray<Field | Fields>;
|
| 26 |
+
interface Params {
|
| 27 |
+
body: unknown;
|
| 28 |
+
headers: Record<string, unknown>;
|
| 29 |
+
path: Record<string, unknown>;
|
| 30 |
+
query: Record<string, unknown>;
|
| 31 |
+
}
|
| 32 |
+
export declare const buildClientParams: (args: ReadonlyArray<unknown>, fields: FieldsConfig) => Params;
|
| 33 |
+
export {};
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/params.gen.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by @hey-api/openapi-ts
|
| 2 |
+
const extraPrefixesMap = {
|
| 3 |
+
$body_: "body",
|
| 4 |
+
$headers_: "headers",
|
| 5 |
+
$path_: "path",
|
| 6 |
+
$query_: "query",
|
| 7 |
+
};
|
| 8 |
+
const extraPrefixes = Object.entries(extraPrefixesMap);
|
| 9 |
+
const buildKeyMap = (fields, map) => {
|
| 10 |
+
if (!map) {
|
| 11 |
+
map = new Map();
|
| 12 |
+
}
|
| 13 |
+
for (const config of fields) {
|
| 14 |
+
if ("in" in config) {
|
| 15 |
+
if (config.key) {
|
| 16 |
+
map.set(config.key, {
|
| 17 |
+
in: config.in,
|
| 18 |
+
map: config.map,
|
| 19 |
+
});
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
else if (config.args) {
|
| 23 |
+
buildKeyMap(config.args, map);
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
return map;
|
| 27 |
+
};
|
| 28 |
+
const stripEmptySlots = (params) => {
|
| 29 |
+
for (const [slot, value] of Object.entries(params)) {
|
| 30 |
+
if (value && typeof value === "object" && !Object.keys(value).length) {
|
| 31 |
+
delete params[slot];
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
};
|
| 35 |
+
export const buildClientParams = (args, fields) => {
|
| 36 |
+
const params = {
|
| 37 |
+
body: {},
|
| 38 |
+
headers: {},
|
| 39 |
+
path: {},
|
| 40 |
+
query: {},
|
| 41 |
+
};
|
| 42 |
+
const map = buildKeyMap(fields);
|
| 43 |
+
let config;
|
| 44 |
+
for (const [index, arg] of args.entries()) {
|
| 45 |
+
if (fields[index]) {
|
| 46 |
+
config = fields[index];
|
| 47 |
+
}
|
| 48 |
+
if (!config) {
|
| 49 |
+
continue;
|
| 50 |
+
}
|
| 51 |
+
if ("in" in config) {
|
| 52 |
+
if (config.key) {
|
| 53 |
+
const field = map.get(config.key);
|
| 54 |
+
const name = field.map || config.key;
|
| 55 |
+
params[field.in][name] = arg;
|
| 56 |
+
}
|
| 57 |
+
else {
|
| 58 |
+
params.body = arg;
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
else {
|
| 62 |
+
for (const [key, value] of Object.entries(arg ?? {})) {
|
| 63 |
+
const field = map.get(key);
|
| 64 |
+
if (field) {
|
| 65 |
+
const name = field.map || key;
|
| 66 |
+
params[field.in][name] = value;
|
| 67 |
+
}
|
| 68 |
+
else {
|
| 69 |
+
const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
|
| 70 |
+
if (extra) {
|
| 71 |
+
const [prefix, slot] = extra;
|
| 72 |
+
params[slot][key.slice(prefix.length)] = value;
|
| 73 |
+
}
|
| 74 |
+
else {
|
| 75 |
+
for (const [slot, allowed] of Object.entries(config.allowExtra ?? {})) {
|
| 76 |
+
if (allowed) {
|
| 77 |
+
;
|
| 78 |
+
params[slot][key] = value;
|
| 79 |
+
break;
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
stripEmptySlots(params);
|
| 88 |
+
return params;
|
| 89 |
+
};
|
.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/pathSerializer.gen.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
interface SerializeOptions<T> extends SerializePrimitiveOptions, SerializerOptions<T> {
|
| 2 |
+
}
|
| 3 |
+
interface SerializePrimitiveOptions {
|
| 4 |
+
allowReserved?: boolean;
|
| 5 |
+
name: string;
|
| 6 |
+
}
|
| 7 |
+
export interface SerializerOptions<T> {
|
| 8 |
+
/**
|
| 9 |
+
* @default true
|
| 10 |
+
*/
|
| 11 |
+
explode: boolean;
|
| 12 |
+
style: T;
|
| 13 |
+
}
|
| 14 |
+
export type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited";
|
| 15 |
+
export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
|
| 16 |
+
type MatrixStyle = "label" | "matrix" | "simple";
|
| 17 |
+
export type ObjectStyle = "form" | "deepObject";
|
| 18 |
+
type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
|
| 19 |
+
interface SerializePrimitiveParam extends SerializePrimitiveOptions {
|
| 20 |
+
value: string;
|
| 21 |
+
}
|
| 22 |
+
export declare const separatorArrayExplode: (style: ArraySeparatorStyle) => "." | ";" | "," | "&";
|
| 23 |
+
export declare const separatorArrayNoExplode: (style: ArraySeparatorStyle) => "," | "|" | "%20";
|
| 24 |
+
export declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => "." | ";" | "," | "&";
|
| 25 |
+
export declare const serializeArrayParam: ({ allowReserved, explode, name, style, value, }: SerializeOptions<ArraySeparatorStyle> & {
|
| 26 |
+
value: unknown[];
|
| 27 |
+
}) => string;
|
| 28 |
+
export declare const serializePrimitiveParam: ({ allowReserved, name, value }: SerializePrimitiveParam) => string;
|
| 29 |
+
export declare const serializeObjectParam: ({ allowReserved, explode, name, style, value, valueOnly, }: SerializeOptions<ObjectSeparatorStyle> & {
|
| 30 |
+
value: Record<string, unknown> | Date;
|
| 31 |
+
valueOnly?: boolean;
|
| 32 |
+
}) => string;
|
| 33 |
+
export {};
|