chore: generate
This commit is contained in:
@@ -91,6 +91,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@effect/platform-node": "catalog:",
|
"@effect/platform-node": "catalog:",
|
||||||
|
"@opencode-ai/core": "workspace:*",
|
||||||
"effect": "catalog:",
|
"effect": "catalog:",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -8,6 +8,12 @@ export const AgentsCommand = Command.make("agents", {}, () =>
|
|||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
yield* PluginBoot.Service.use((service) => service.wait())
|
yield* PluginBoot.Service.use((service) => service.wait())
|
||||||
const agents = yield* AgentV2.Service.use((service) => service.all())
|
const agents = yield* AgentV2.Service.use((service) => service.all())
|
||||||
process.stdout.write(JSON.stringify(agents.sort((a, b) => a.id.localeCompare(b.id)), null, 2) + EOL)
|
process.stdout.write(
|
||||||
|
JSON.stringify(
|
||||||
|
agents.sort((a, b) => a.id.localeCompare(b.id)),
|
||||||
|
null,
|
||||||
|
2,
|
||||||
|
) + EOL,
|
||||||
|
)
|
||||||
}),
|
}),
|
||||||
).pipe(Command.withDescription("List all agents"))
|
).pipe(Command.withDescription("List all agents"))
|
||||||
|
|||||||
@@ -105,7 +105,9 @@ export const Plugin = PluginV2.define({
|
|||||||
const whitelistedDirs = [TRUNCATION_GLOB, path.join(Global.Path.tmp, "*")]
|
const whitelistedDirs = [TRUNCATION_GLOB, path.join(Global.Path.tmp, "*")]
|
||||||
const readonlyExternalDirectory: PermissionV2.Ruleset = [
|
const readonlyExternalDirectory: PermissionV2.Ruleset = [
|
||||||
{ permission: "external_directory", pattern: "*", action: "ask" },
|
{ permission: "external_directory", pattern: "*", action: "ask" },
|
||||||
...whitelistedDirs.map((pattern): PermissionV2.Rule => ({ permission: "external_directory", pattern, action: "allow" })),
|
...whitelistedDirs.map(
|
||||||
|
(pattern): PermissionV2.Rule => ({ permission: "external_directory", pattern, action: "allow" }),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
const defaults: PermissionV2.Ruleset = [
|
const defaults: PermissionV2.Ruleset = [
|
||||||
{ permission: "*", pattern: "*", action: "allow" },
|
{ permission: "*", pattern: "*", action: "allow" },
|
||||||
@@ -137,21 +139,18 @@ export const Plugin = PluginV2.define({
|
|||||||
item.description = "Plan mode. Disallows all edit tools."
|
item.description = "Plan mode. Disallows all edit tools."
|
||||||
item.mode = "primary"
|
item.mode = "primary"
|
||||||
item.permissions.push(
|
item.permissions.push(
|
||||||
...PermissionV2.merge(
|
...PermissionV2.merge(defaults, [
|
||||||
defaults,
|
{ permission: "question", pattern: "*", action: "allow" },
|
||||||
[
|
{ permission: "plan_exit", pattern: "*", action: "allow" },
|
||||||
{ permission: "question", pattern: "*", action: "allow" },
|
{ permission: "external_directory", pattern: path.join(Global.Path.data, "plans", "*"), action: "allow" },
|
||||||
{ permission: "plan_exit", pattern: "*", action: "allow" },
|
{ permission: "edit", pattern: "*", action: "deny" },
|
||||||
{ permission: "external_directory", pattern: path.join(Global.Path.data, "plans", "*"), action: "allow" },
|
{ permission: "edit", pattern: path.join(".opencode", "plans", "*.md"), action: "allow" },
|
||||||
{ permission: "edit", pattern: "*", action: "deny" },
|
{
|
||||||
{ permission: "edit", pattern: path.join(".opencode", "plans", "*.md"), action: "allow" },
|
permission: "edit",
|
||||||
{
|
pattern: path.relative(worktree, path.join(Global.Path.data, "plans", "*.md")),
|
||||||
permission: "edit",
|
action: "allow",
|
||||||
pattern: path.relative(worktree, path.join(Global.Path.data, "plans", "*.md")),
|
},
|
||||||
action: "allow",
|
]),
|
||||||
},
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -159,7 +158,9 @@ export const Plugin = PluginV2.define({
|
|||||||
item.description =
|
item.description =
|
||||||
"General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel."
|
"General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel."
|
||||||
item.mode = "subagent"
|
item.mode = "subagent"
|
||||||
item.permissions.push(...PermissionV2.merge(defaults, [{ permission: "todowrite", pattern: "*", action: "deny" }]))
|
item.permissions.push(
|
||||||
|
...PermissionV2.merge(defaults, [{ permission: "todowrite", pattern: "*", action: "deny" }]),
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
editor.update(AgentV2.ID.make("explore"), (item) => {
|
editor.update(AgentV2.ID.make("explore"), (item) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user