ocx 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +90 -11
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8533,14 +8533,19 @@ var targetPathSchema = exports_external.string().refine((path) => path.startsWit
|
|
|
8533
8533
|
}, {
|
|
8534
8534
|
message: 'Target must be in a valid directory: ".opencode/{agent|skill|plugin|command|tool|philosophy}/..."'
|
|
8535
8535
|
});
|
|
8536
|
+
var oauthConfigSchema = exports_external.object({
|
|
8537
|
+
clientId: exports_external.string().optional(),
|
|
8538
|
+
scopes: exports_external.array(exports_external.string()).optional(),
|
|
8539
|
+
authUrl: exports_external.string().optional(),
|
|
8540
|
+
tokenUrl: exports_external.string().optional()
|
|
8541
|
+
});
|
|
8536
8542
|
var mcpServerObjectSchema = exports_external.object({
|
|
8537
8543
|
type: exports_external.enum(["remote", "local"]),
|
|
8538
|
-
url: exports_external.string().
|
|
8539
|
-
command: exports_external.array(exports_external.string()).optional(),
|
|
8540
|
-
args: exports_external.array(exports_external.string()).optional(),
|
|
8544
|
+
url: exports_external.string().optional(),
|
|
8545
|
+
command: exports_external.union([exports_external.string(), exports_external.array(exports_external.string())]).optional(),
|
|
8541
8546
|
environment: exports_external.record(exports_external.string()).optional(),
|
|
8542
8547
|
headers: exports_external.record(exports_external.string()).optional(),
|
|
8543
|
-
oauth: exports_external.boolean().optional(),
|
|
8548
|
+
oauth: exports_external.union([exports_external.boolean(), oauthConfigSchema]).optional(),
|
|
8544
8549
|
enabled: exports_external.boolean().default(true)
|
|
8545
8550
|
}).refine((data) => {
|
|
8546
8551
|
if (data.type === "remote" && !data.url) {
|
|
@@ -8553,7 +8558,7 @@ var mcpServerObjectSchema = exports_external.object({
|
|
|
8553
8558
|
}, {
|
|
8554
8559
|
message: "Remote MCP servers require 'url', local servers require 'command'"
|
|
8555
8560
|
});
|
|
8556
|
-
var mcpServerRefSchema = exports_external.union([exports_external.string()
|
|
8561
|
+
var mcpServerRefSchema = exports_external.union([exports_external.string(), mcpServerObjectSchema]);
|
|
8557
8562
|
var componentFileObjectSchema = exports_external.object({
|
|
8558
8563
|
path: exports_external.string().min(1, "File path cannot be empty"),
|
|
8559
8564
|
target: targetPathSchema
|
|
@@ -8562,24 +8567,81 @@ var componentFileSchema = exports_external.union([
|
|
|
8562
8567
|
exports_external.string().min(1, "File path cannot be empty"),
|
|
8563
8568
|
componentFileObjectSchema
|
|
8564
8569
|
]);
|
|
8570
|
+
var providerConfigSchema = exports_external.object({
|
|
8571
|
+
api: exports_external.string().optional(),
|
|
8572
|
+
headers: exports_external.record(exports_external.string()).optional(),
|
|
8573
|
+
env: exports_external.record(exports_external.string()).optional(),
|
|
8574
|
+
enabled: exports_external.boolean().optional()
|
|
8575
|
+
}).passthrough();
|
|
8576
|
+
var lspConfigSchema = exports_external.object({
|
|
8577
|
+
command: exports_external.union([exports_external.string(), exports_external.array(exports_external.string())]).optional(),
|
|
8578
|
+
enabled: exports_external.boolean().optional()
|
|
8579
|
+
}).passthrough();
|
|
8580
|
+
var formatterConfigSchema = exports_external.object({
|
|
8581
|
+
command: exports_external.union([exports_external.string(), exports_external.array(exports_external.string())]).optional(),
|
|
8582
|
+
glob: exports_external.string().optional()
|
|
8583
|
+
}).passthrough();
|
|
8584
|
+
var commandConfigSchema = exports_external.object({
|
|
8585
|
+
description: exports_external.string().optional(),
|
|
8586
|
+
run: exports_external.string().optional()
|
|
8587
|
+
}).passthrough();
|
|
8588
|
+
var tuiConfigSchema = exports_external.object({
|
|
8589
|
+
disabled: exports_external.boolean().optional()
|
|
8590
|
+
}).passthrough();
|
|
8591
|
+
var serverConfigSchema = exports_external.object({
|
|
8592
|
+
host: exports_external.string().optional(),
|
|
8593
|
+
port: exports_external.number().optional()
|
|
8594
|
+
}).passthrough();
|
|
8595
|
+
var keybindConfigSchema = exports_external.record(exports_external.string());
|
|
8596
|
+
var watcherConfigSchema = exports_external.object({
|
|
8597
|
+
include: exports_external.array(exports_external.string()).optional(),
|
|
8598
|
+
exclude: exports_external.array(exports_external.string()).optional()
|
|
8599
|
+
}).passthrough();
|
|
8565
8600
|
var agentConfigSchema = exports_external.object({
|
|
8601
|
+
model: exports_external.string().optional(),
|
|
8602
|
+
description: exports_external.string().optional(),
|
|
8603
|
+
steps: exports_external.number().int().positive().optional(),
|
|
8604
|
+
maxSteps: exports_external.number().int().positive().optional(),
|
|
8605
|
+
mode: exports_external.enum(["primary", "subagent", "all"]).optional(),
|
|
8566
8606
|
tools: exports_external.record(exports_external.boolean()).optional(),
|
|
8567
|
-
temperature: exports_external.number().
|
|
8607
|
+
temperature: exports_external.number().optional(),
|
|
8608
|
+
top_p: exports_external.number().optional(),
|
|
8568
8609
|
prompt: exports_external.string().optional(),
|
|
8569
|
-
permission: exports_external.record(exports_external.enum(["allow", "deny"])).optional()
|
|
8610
|
+
permission: exports_external.record(exports_external.union([exports_external.enum(["ask", "allow", "deny"]), exports_external.record(exports_external.enum(["ask", "allow", "deny"]))])).optional(),
|
|
8611
|
+
color: exports_external.string().optional(),
|
|
8612
|
+
disable: exports_external.boolean().optional(),
|
|
8613
|
+
options: exports_external.record(exports_external.any()).optional()
|
|
8570
8614
|
});
|
|
8571
8615
|
var permissionConfigSchema = exports_external.object({
|
|
8572
8616
|
bash: exports_external.union([exports_external.enum(["ask", "allow", "deny"]), exports_external.record(exports_external.enum(["ask", "allow", "deny"]))]).optional(),
|
|
8573
8617
|
edit: exports_external.union([exports_external.enum(["ask", "allow", "deny"]), exports_external.record(exports_external.enum(["ask", "allow", "deny"]))]).optional(),
|
|
8574
8618
|
mcp: exports_external.record(exports_external.enum(["ask", "allow", "deny"])).optional()
|
|
8575
|
-
});
|
|
8619
|
+
}).catchall(exports_external.union([exports_external.enum(["ask", "allow", "deny"]), exports_external.record(exports_external.enum(["ask", "allow", "deny"]))]));
|
|
8576
8620
|
var opencodeConfigSchema = exports_external.object({
|
|
8621
|
+
$schema: exports_external.string().optional(),
|
|
8622
|
+
theme: exports_external.string().optional(),
|
|
8623
|
+
logLevel: exports_external.string().optional(),
|
|
8624
|
+
username: exports_external.string().optional(),
|
|
8625
|
+
model: exports_external.string().optional(),
|
|
8626
|
+
small_model: exports_external.string().optional(),
|
|
8627
|
+
default_agent: exports_external.string().optional(),
|
|
8577
8628
|
mcp: exports_external.record(mcpServerRefSchema).optional(),
|
|
8578
8629
|
plugin: exports_external.array(exports_external.string()).optional(),
|
|
8579
8630
|
tools: exports_external.record(exports_external.boolean()).optional(),
|
|
8580
8631
|
agent: exports_external.record(agentConfigSchema).optional(),
|
|
8581
8632
|
instructions: exports_external.array(exports_external.string()).optional(),
|
|
8582
|
-
permission: permissionConfigSchema.optional()
|
|
8633
|
+
permission: permissionConfigSchema.optional(),
|
|
8634
|
+
provider: exports_external.record(providerConfigSchema).optional(),
|
|
8635
|
+
lsp: exports_external.record(lspConfigSchema).optional(),
|
|
8636
|
+
formatter: exports_external.record(formatterConfigSchema).optional(),
|
|
8637
|
+
command: exports_external.record(commandConfigSchema).optional(),
|
|
8638
|
+
tui: tuiConfigSchema.optional(),
|
|
8639
|
+
server: serverConfigSchema.optional(),
|
|
8640
|
+
keybind: keybindConfigSchema.optional(),
|
|
8641
|
+
watcher: watcherConfigSchema.optional(),
|
|
8642
|
+
auto_update: exports_external.boolean().optional(),
|
|
8643
|
+
auto_compact: exports_external.boolean().optional(),
|
|
8644
|
+
share: exports_external.union([exports_external.boolean(), exports_external.string()]).optional()
|
|
8583
8645
|
});
|
|
8584
8646
|
var componentManifestSchema = exports_external.object({
|
|
8585
8647
|
name: openCodeNameSchema,
|
|
@@ -10348,11 +10410,28 @@ async function readOpencodeJsonConfig(cwd) {
|
|
|
10348
10410
|
async function writeOpencodeJsonConfig(path, content) {
|
|
10349
10411
|
await Bun.write(path, content);
|
|
10350
10412
|
}
|
|
10413
|
+
function getValueAtPath(content, path) {
|
|
10414
|
+
const parsed = parse2(content, [], { allowTrailingComma: true });
|
|
10415
|
+
let current = parsed;
|
|
10416
|
+
for (const segment of path) {
|
|
10417
|
+
if (current === null || current === undefined)
|
|
10418
|
+
return;
|
|
10419
|
+
if (typeof current !== "object")
|
|
10420
|
+
return;
|
|
10421
|
+
current = current[segment];
|
|
10422
|
+
}
|
|
10423
|
+
return current;
|
|
10424
|
+
}
|
|
10351
10425
|
function applyValueAtPath(content, path, value) {
|
|
10352
10426
|
if (value === null || value === undefined) {
|
|
10353
10427
|
return content;
|
|
10354
10428
|
}
|
|
10355
10429
|
if (typeof value === "object" && !Array.isArray(value)) {
|
|
10430
|
+
const existingValue = getValueAtPath(content, path);
|
|
10431
|
+
if (existingValue !== undefined && (existingValue === null || typeof existingValue !== "object")) {
|
|
10432
|
+
const edits2 = modify(content, path, value, JSONC_OPTIONS);
|
|
10433
|
+
return applyEdits(content, edits2);
|
|
10434
|
+
}
|
|
10356
10435
|
let updatedContent = content;
|
|
10357
10436
|
for (const [key, val] of Object.entries(value)) {
|
|
10358
10437
|
updatedContent = applyValueAtPath(updatedContent, [...path, key], val);
|
|
@@ -13924,7 +14003,7 @@ async function hashBundle2(files) {
|
|
|
13924
14003
|
`));
|
|
13925
14004
|
}
|
|
13926
14005
|
// src/index.ts
|
|
13927
|
-
var version = "1.0.
|
|
14006
|
+
var version = "1.0.16";
|
|
13928
14007
|
async function main2() {
|
|
13929
14008
|
const program2 = new Command().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(version);
|
|
13930
14009
|
registerInitCommand(program2);
|
|
@@ -13950,4 +14029,4 @@ export {
|
|
|
13950
14029
|
buildRegistry
|
|
13951
14030
|
};
|
|
13952
14031
|
|
|
13953
|
-
//# debugId=
|
|
14032
|
+
//# debugId=2706150244B1090964756E2164756E21
|