@markjaquith/agency 2.42.0 → 2.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -51,7 +51,7 @@ workbase/
51
51
  .agency/
52
52
  AGENTS.md # managed Agency instructions
53
53
  .opencode/
54
- opencode.jsonc # managed instructions and whole-workbase reference
54
+ opencode.jsonc # managed @agency subagent, instructions, and reference
55
55
  agency.json # tracked config and portable repository declarations
56
56
  repos/ # ignored local materializations
57
57
  frontend/ # bare Git repository or symlink
@@ -90,13 +90,14 @@ Agency-managed root `AGENTS.md` to `.agency/AGENTS.md` once the OpenCode config
90
90
  can load the hidden file. A customized root file, including a symlink, is
91
91
  preserved as user-owned content.
92
92
 
93
- The OpenCode config loads Agency's hidden instructions in addition to any
94
- user-owned root `AGENTS.md`, advertises the complete workbase as one portable
95
- reference, and replaces the built-in Plan agent with `agency-plan`. That planning
96
- agent can update `TASK.md`, `PHASE.md`, and `EPIC.md` while other edits remain
97
- disabled. OpenCode discovers the config from task and epic launch directories.
98
- Agents receive whole-workbase visibility from that reference. Bash and Agency
99
- operations must still follow the write authority reported by `agency context`.
93
+ The OpenCode config defines an `@agency` subagent for delegated workbase
94
+ orchestration, loads Agency's hidden instructions in addition to any user-owned
95
+ root `AGENTS.md`, advertises the complete workbase as one portable reference,
96
+ and replaces the built-in Plan agent with `agency-plan`. That planning agent can
97
+ update `TASK.md`, `PHASE.md`, and `EPIC.md` while other edits remain disabled.
98
+ OpenCode discovers the config from task and epic launch directories. Agents
99
+ receive whole-workbase visibility from that reference. Bash and Agency operations
100
+ must still follow the write authority reported by `agency context`.
100
101
 
101
102
  OpenCode also discovers a managed `/agency` command. Use `/agency status` for a
102
103
  read-only current-work summary, `/agency start [target]` to begin or resume work
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markjaquith/agency",
3
- "version": "2.42.0",
3
+ "version": "2.43.0",
4
4
  "description": "Manage agentic work across repositories with durable workbases",
5
5
  "keywords": [
6
6
  "agents",
package/src/cli.test.ts CHANGED
@@ -1059,13 +1059,32 @@ status: open
1059
1059
  env: environment,
1060
1060
  })
1061
1061
  expect(configProbe.exitCode).toBe(0)
1062
- expect(JSON.parse(configProbe.stdout.toString()).references).toEqual({
1062
+ const effectiveConfig = JSON.parse(configProbe.stdout.toString())
1063
+ expect(effectiveConfig.agent.agency).toMatchObject({
1064
+ description: expect.stringContaining(
1065
+ "Agency workbase orchestration",
1066
+ ),
1067
+ mode: "subagent",
1068
+ })
1069
+ expect(effectiveConfig.references).toEqual({
1063
1070
  workbase: {
1064
1071
  path: "..",
1065
1072
  description:
1066
1073
  "Complete Agency workbase context; write authority still comes only from agency context",
1067
1074
  },
1068
1075
  })
1076
+ const agencyProbe = Bun.spawnSync(
1077
+ ["opencode", "debug", "agent", "agency"],
1078
+ { cwd: contract.cwd, env: environment },
1079
+ )
1080
+ expect(agencyProbe.exitCode).toBe(0)
1081
+ expect(JSON.parse(agencyProbe.stdout.toString())).toMatchObject({
1082
+ name: "agency",
1083
+ description: expect.stringContaining(
1084
+ "Agency workbase orchestration",
1085
+ ),
1086
+ mode: "subagent",
1087
+ })
1069
1088
  for (const document of documents) {
1070
1089
  const read = Bun.spawnSync(
1071
1090
  [
@@ -40,6 +40,11 @@ describe("init command", () => {
40
40
  ).text()
41
41
  const config = JSON.parse(opencode.slice(opencode.indexOf("\n\n") + 2))
42
42
  expect(config.instructions).toEqual([".agency/AGENTS.md"])
43
+ expect(config.agent.agency).toMatchObject({
44
+ description: expect.stringContaining("Agency workbase orchestration"),
45
+ mode: "subagent",
46
+ prompt: expect.stringContaining("agency context . --json"),
47
+ })
43
48
  expect(config.agent.plan).toEqual({ disable: true })
44
49
  expect(config.agent["agency-plan"]).toMatchObject({
45
50
  mode: "primary",
@@ -138,11 +138,17 @@ describe("IntegrationService", () => {
138
138
  expect(body).toContain(".opencode/command/agency.md")
139
139
  })
140
140
 
141
- test("configures Agency planning and complete workbase access", () => {
141
+ test("configures Agency agents with complete workbase access", () => {
142
142
  const config = JSON.parse(managedBody(managedWorkbaseOpencode))
143
143
 
144
144
  expect(config.instructions).toEqual([".agency/AGENTS.md"])
145
145
  expect(config.agent).toEqual({
146
+ agency: {
147
+ description:
148
+ "Handles Agency workbase orchestration and workflow operations with the Agency CLI",
149
+ mode: "subagent",
150
+ prompt: expect.stringContaining("agency context . --json"),
151
+ },
146
152
  plan: {
147
153
  disable: true,
148
154
  },
@@ -162,6 +168,10 @@ describe("IntegrationService", () => {
162
168
  },
163
169
  },
164
170
  })
171
+ expect(config.agent.agency.model).toBeUndefined()
172
+ expect(config.agent.agency.permission).toBeUndefined()
173
+ expect(config.agent.agency.hidden).toBeUndefined()
174
+ expect(config.agent.agency.steps).toBeUndefined()
165
175
  expect(config.references).toEqual({
166
176
  workbase: {
167
177
  path: "..",
@@ -16,6 +16,13 @@ const body = () =>
16
16
  $schema: "https://opencode.ai/config.json",
17
17
  instructions: [".agency/AGENTS.md"],
18
18
  agent: {
19
+ agency: {
20
+ description:
21
+ "Handles Agency workbase orchestration and workflow operations with the Agency CLI",
22
+ mode: "subagent",
23
+ prompt:
24
+ "You are the Agency workflow specialist. Use the Agency CLI to handle delegated workbase orchestration and workflow operations. Always start with `agency context . --json`, follow the managed Agency instructions and reported authority, use Agency commands for durable mutations, and report the resulting state concisely.",
25
+ },
19
26
  plan: {
20
27
  disable: true,
21
28
  },