@jmanuelcorral/openteam 0.9.2 → 0.9.4

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.es.md CHANGED
@@ -819,7 +819,7 @@ Consulta [docs/compatibility.md](docs/compatibility.md). Resumen verificado el `
819
819
 
820
820
  | Superficie | Versión / contrato |
821
821
  | --- | --- |
822
- | openteam | `0.9.2`; versión actual del paquete |
822
+ | openteam | `0.9.4`; versión actual del paquete |
823
823
  | `@opencode-ai/plugin` | `1.18.19` |
824
824
  | `@opencode-ai/sdk` | `1.18.19` |
825
825
  | Hook de routing | `chat.message`; no `chat.params` para cambiar modelo |
package/README.md CHANGED
@@ -700,7 +700,7 @@ See [docs/compatibility.md](docs/compatibility.md). Verified summary as of `2026
700
700
 
701
701
  | Surface | Version / contract |
702
702
  | --- | --- |
703
- | openteam | `0.9.2`; current package version |
703
+ | openteam | `0.9.4`; current package version |
704
704
  | `@opencode-ai/plugin` | `1.18.19` |
705
705
  | `@opencode-ai/sdk` | `1.18.19` |
706
706
  | Routing hook | `chat.message`; not `chat.params` for model changes |
package/dist/cli.js CHANGED
@@ -8660,16 +8660,21 @@ function buildOrchestratorAgent(frontier, options = {}) {
8660
8660
  " `routing-cost` (plus the guaranteed `orchestrator`, `guardian`,",
8661
8661
  " `scribe`, `ralph`). The roleID space is open: use free-form project",
8662
8662
  " roleIDs only when no curated role fits.",
8663
- `5. **Register the cast** in \`${OPENTEAM_ROSTER_PATH}\` so the names persist`,
8664
- " across sessions. This file goes **outside** `.opencode/agent/` (otherwise",
8665
- " opencode would load it as a phantom agent). Always reuse the same cast;",
8666
- " do not re-cast without reason.",
8663
+ `5. **Register the cast** by calling the \`openteam-register-cast\` tool`,
8664
+ " with `{ universe, entries: [{ roleID, agentName }] }`. The tool validates",
8665
+ " the payload, re-asserts any missing guaranteed role, and persists the",
8666
+ ` roster to \`${OPENTEAM_ROSTER_PATH}\` outside \`.opencode/agent/\`,`,
8667
+ " which would otherwise load it as a phantom agent. Never write that file",
8668
+ " by hand: an invalid draft is rejected naming the offending field and",
8669
+ " nothing is written. Always reuse the same cast; do not re-cast without",
8670
+ " reason.",
8667
8671
  "",
8668
8672
  "## Roster file format",
8669
8673
  "",
8670
- "Write the roster as Markdown with exactly one fenced `json` block matching",
8671
- "`{ universe, entries: [{ roleID, agentName }] }`. Do not write a table.",
8672
- "Minimal parseable example:",
8674
+ "`openteam-register-cast` persists the roster as Markdown with exactly one",
8675
+ "fenced `json` block matching `{ universe, entries: [{ roleID, agentName }] }`,",
8676
+ "and preserves any prose already in the document. Never write a table: the",
8677
+ "parser reads only the fenced block. Minimal parseable example:",
8673
8678
  "",
8674
8679
  "# openteam roster",
8675
8680
  "",
@@ -8727,8 +8732,8 @@ function buildOrchestratorAgent(frontier, options = {}) {
8727
8732
  " frontier only for architecture, security or ambiguous debugging:",
8728
8733
  " openteam already routes cheapest-capable automatically.",
8729
8734
  " - A focused, actionable role prompt.",
8730
- `4. Register the cast in \`${OPENTEAM_ROSTER_PATH}\` and **hand out the`,
8731
- " tasks** to the newly created team with the `task` tool.",
8735
+ "4. Register the cast with the `openteam-register-cast` tool and **hand out",
8736
+ " the tasks** to the newly created team with the `task` tool.",
8732
8737
  "",
8733
8738
  "## Standard team roles",
8734
8739
  "",
@@ -10592,13 +10597,18 @@ function rosterHealthSection(audit, loadError, rosterRoleCount) {
10592
10597
  const missing = auditFindings.filter((finding) => finding.kind === "missing-guaranteed-role").map((finding) => finding.roleID);
10593
10598
  const misassigned = auditFindings.filter((finding) => finding.kind === "non-canonical-role-id");
10594
10599
  const unprofiled = auditFindings.filter((finding) => finding.kind === "unresolved-role-profile");
10595
- if (missing.length === 0 && misassigned.length === 0 && unprofiled.length === 0) {
10600
+ const hasErrorLevelFindings = missing.length > 0 || misassigned.length > 0;
10601
+ const hasFindings = hasErrorLevelFindings || unprofiled.length > 0;
10602
+ if (!hasFindings) {
10596
10603
  return rosterRoleCount === undefined ? [] : [
10597
10604
  " roster health:",
10598
10605
  ` ✓ ${OPENTEAM_ROSTER_PATH} read (${rosterRoleCount} roles); guaranteed roles present.`
10599
10606
  ];
10600
10607
  }
10601
10608
  const lines = [" roster health:"];
10609
+ if (!hasErrorLevelFindings && rosterRoleCount !== undefined) {
10610
+ lines.push(` ✓ ${OPENTEAM_ROSTER_PATH} read (${rosterRoleCount} roles); guaranteed roles present.`);
10611
+ }
10602
10612
  if (missing.length > 0) {
10603
10613
  lines.push(` ✗ missing guaranteed roleID(s): ${missing.join(", ")}`);
10604
10614
  lines.push(` remedy: edit ${OPENTEAM_ROSTER_PATH}'s JSON block to add these canonical roleIDs with their themed agentName values; keep roleID canonical, e.g. { "roleID": "scribe", "agentName": "c3po" }.`);
@@ -14651,16 +14661,18 @@ async function* linesFromReadable(readable) {
14651
14661
  }
14652
14662
 
14653
14663
  // src/orchestrator/rosterPersistence.ts
14654
- function serializeRoster(roster) {
14664
+ function rosterFence(roster) {
14655
14665
  const data = { universe: roster.universe, entries: roster.entries };
14656
- const json = JSON.stringify(data, null, 2);
14666
+ return `\`\`\`json
14667
+ ${JSON.stringify(data, null, 2)}
14668
+ \`\`\``;
14669
+ }
14670
+ function serializeRoster(roster) {
14657
14671
  return `# openteam roster
14658
14672
 
14659
14673
  Universe: ${roster.universe}
14660
14674
 
14661
- \`\`\`json
14662
- ${json}
14663
- \`\`\`
14675
+ ${rosterFence(roster)}
14664
14676
  `;
14665
14677
  }
14666
14678
  async function persistRoster(storage, roster, path4 = OPENTEAM_ROSTER_PATH) {
@@ -14953,7 +14965,7 @@ async function buildMemoryRuntimeFromConfig(config, deps, options = {}) {
14953
14965
  // package.json
14954
14966
  var package_default = {
14955
14967
  name: "@jmanuelcorral/openteam",
14956
- version: "0.9.2",
14968
+ version: "0.9.4",
14957
14969
  packageManager: "bun@1.3.14",
14958
14970
  description: "Cost-aware, local-first routing plugin for opencode with cheapest-capable frontier fallback and multi-agent orchestration.",
14959
14971
  license: "MIT",
@@ -1 +1 @@
1
- {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;AACvE,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,eAAe,GACvB,aAAa,CAmBf;AAuCD,wBAAgB,eAAe,CAC7B,UAAU,EAAE,OAAO,EACnB,OAAO,GAAE,eAAwD,EACjE,OAAO,GAAE;IACP,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,GACL,SAAS,CAiCX;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOrD;AA0CD,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,eAAe,EACzB,aAAa,EAAE,MAAM,EACrB,WAAW,GAAE,MAA6B,EAC1C,OAAO,GAAE,eAAwD,EACjE,cAAc,GAAE,YAAwB,EACxC,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CA+FT;AA2JD,eAAO,MAAM,MAAM,EAAE,MAiVpB,CAAC;AAEF,QAAA,MAAM,MAAM,EAAE,YAGb,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;eAE7B,MAAM"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
4
  // src/index.ts
5
5
  import { dirname as dirname4 } from "node:path";
6
6
  import {
7
- tool as tool5
7
+ tool as tool6
8
8
  } from "@opencode-ai/plugin";
9
9
 
10
10
  // src/cli/graphOperator.ts
@@ -3673,16 +3673,21 @@ function buildOrchestratorAgent(frontier, options = {}) {
3673
3673
  " `routing-cost` (plus the guaranteed `orchestrator`, `guardian`,",
3674
3674
  " `scribe`, `ralph`). The roleID space is open: use free-form project",
3675
3675
  " roleIDs only when no curated role fits.",
3676
- `5. **Register the cast** in \`${OPENTEAM_ROSTER_PATH}\` so the names persist`,
3677
- " across sessions. This file goes **outside** `.opencode/agent/` (otherwise",
3678
- " opencode would load it as a phantom agent). Always reuse the same cast;",
3679
- " do not re-cast without reason.",
3676
+ `5. **Register the cast** by calling the \`openteam-register-cast\` tool`,
3677
+ " with `{ universe, entries: [{ roleID, agentName }] }`. The tool validates",
3678
+ " the payload, re-asserts any missing guaranteed role, and persists the",
3679
+ ` roster to \`${OPENTEAM_ROSTER_PATH}\` outside \`.opencode/agent/\`,`,
3680
+ " which would otherwise load it as a phantom agent. Never write that file",
3681
+ " by hand: an invalid draft is rejected naming the offending field and",
3682
+ " nothing is written. Always reuse the same cast; do not re-cast without",
3683
+ " reason.",
3680
3684
  "",
3681
3685
  "## Roster file format",
3682
3686
  "",
3683
- "Write the roster as Markdown with exactly one fenced `json` block matching",
3684
- "`{ universe, entries: [{ roleID, agentName }] }`. Do not write a table.",
3685
- "Minimal parseable example:",
3687
+ "`openteam-register-cast` persists the roster as Markdown with exactly one",
3688
+ "fenced `json` block matching `{ universe, entries: [{ roleID, agentName }] }`,",
3689
+ "and preserves any prose already in the document. Never write a table: the",
3690
+ "parser reads only the fenced block. Minimal parseable example:",
3686
3691
  "",
3687
3692
  "# openteam roster",
3688
3693
  "",
@@ -3740,8 +3745,8 @@ function buildOrchestratorAgent(frontier, options = {}) {
3740
3745
  " frontier only for architecture, security or ambiguous debugging:",
3741
3746
  " openteam already routes cheapest-capable automatically.",
3742
3747
  " - A focused, actionable role prompt.",
3743
- `4. Register the cast in \`${OPENTEAM_ROSTER_PATH}\` and **hand out the`,
3744
- " tasks** to the newly created team with the `task` tool.",
3748
+ "4. Register the cast with the `openteam-register-cast` tool and **hand out",
3749
+ " the tasks** to the newly created team with the `task` tool.",
3745
3750
  "",
3746
3751
  "## Standard team roles",
3747
3752
  "",
@@ -6859,22 +6864,40 @@ async function dispatchGuaranteedRole(agentName, agentFileExists, dispatch) {
6859
6864
  }
6860
6865
 
6861
6866
  // src/orchestrator/rosterPersistence.ts
6862
- function serializeRoster(roster) {
6867
+ function rosterFence(roster) {
6863
6868
  const data = { universe: roster.universe, entries: roster.entries };
6864
- const json = JSON.stringify(data, null, 2);
6869
+ return `\`\`\`json
6870
+ ${JSON.stringify(data, null, 2)}
6871
+ \`\`\``;
6872
+ }
6873
+ function serializeRoster(roster) {
6865
6874
  return `# openteam roster
6866
6875
 
6867
6876
  Universe: ${roster.universe}
6868
6877
 
6869
- \`\`\`json
6870
- ${json}
6871
- \`\`\`
6878
+ ${rosterFence(roster)}
6872
6879
  `;
6873
6880
  }
6881
+ function replaceRosterFence(existing, roster) {
6882
+ if (existing === undefined || existing.trim() === "") {
6883
+ return serializeRoster(roster);
6884
+ }
6885
+ const fence = rosterFence(roster);
6886
+ if (ROSTER_JSON_FENCE.test(existing)) {
6887
+ return existing.replace(ROSTER_JSON_FENCE, () => fence);
6888
+ }
6889
+ return `${serializeRoster(roster)}
6890
+ ${existing}`;
6891
+ }
6874
6892
  async function persistRoster(storage, roster, path2 = OPENTEAM_ROSTER_PATH) {
6875
6893
  await storage.write(path2, serializeRoster(roster));
6876
6894
  return path2;
6877
6895
  }
6896
+ async function persistRosterPreservingProse(storage, roster, path2 = OPENTEAM_ROSTER_PATH) {
6897
+ const existing = await storage.read(path2);
6898
+ await storage.write(path2, replaceRosterFence(existing, roster));
6899
+ return path2;
6900
+ }
6878
6901
  async function loadRosterFile(storage, path2 = OPENTEAM_ROSTER_PATH) {
6879
6902
  const content = await storage.read(path2);
6880
6903
  if (content === undefined) {
@@ -8008,13 +8031,18 @@ function rosterHealthSection(audit, loadError, rosterRoleCount) {
8008
8031
  const missing = auditFindings.filter((finding) => finding.kind === "missing-guaranteed-role").map((finding) => finding.roleID);
8009
8032
  const misassigned = auditFindings.filter((finding) => finding.kind === "non-canonical-role-id");
8010
8033
  const unprofiled = auditFindings.filter((finding) => finding.kind === "unresolved-role-profile");
8011
- if (missing.length === 0 && misassigned.length === 0 && unprofiled.length === 0) {
8034
+ const hasErrorLevelFindings = missing.length > 0 || misassigned.length > 0;
8035
+ const hasFindings = hasErrorLevelFindings || unprofiled.length > 0;
8036
+ if (!hasFindings) {
8012
8037
  return rosterRoleCount === undefined ? [] : [
8013
8038
  " roster health:",
8014
8039
  ` ✓ ${OPENTEAM_ROSTER_PATH} read (${rosterRoleCount} roles); guaranteed roles present.`
8015
8040
  ];
8016
8041
  }
8017
8042
  const lines = [" roster health:"];
8043
+ if (!hasErrorLevelFindings && rosterRoleCount !== undefined) {
8044
+ lines.push(` ✓ ${OPENTEAM_ROSTER_PATH} read (${rosterRoleCount} roles); guaranteed roles present.`);
8045
+ }
8018
8046
  if (missing.length > 0) {
8019
8047
  lines.push(` ✗ missing guaranteed roleID(s): ${missing.join(", ")}`);
8020
8048
  lines.push(` remedy: edit ${OPENTEAM_ROSTER_PATH}'s JSON block to add these canonical roleIDs with their themed agentName values; keep roleID canonical, e.g. { "roleID": "scribe", "agentName": "c3po" }.`);
@@ -12536,6 +12564,65 @@ function createOrchestrateTool(deps) {
12536
12564
  });
12537
12565
  }
12538
12566
 
12567
+ // src/plugin/registerCastTool.ts
12568
+ import { tool as tool5 } from "@opencode-ai/plugin";
12569
+ import { z as z26 } from "zod";
12570
+ var CastEntrySchema = z26.object({
12571
+ roleID: z26.string().min(1).describe("Stable role identifier, e.g. scribe or guardian"),
12572
+ agentName: z26.string().min(1).describe("Themed character name assigned to the role")
12573
+ }).strict();
12574
+ var RegisterCastPayloadSchema = z26.object({
12575
+ universe: z26.string().min(1).describe("Casting universe for this roster"),
12576
+ entries: z26.array(CastEntrySchema).min(1).describe("Role-to-name mappings")
12577
+ }).strict();
12578
+ function offendingFields(error) {
12579
+ const fields = error.issues.flatMap((issue) => {
12580
+ const base = issue.path.map((segment) => String(segment));
12581
+ if (issue.code === "unrecognized_keys") {
12582
+ return issue.keys.map((key) => [...base, key].join("."));
12583
+ }
12584
+ return [base.join(".") || "(root)"];
12585
+ });
12586
+ return [...new Set(fields)];
12587
+ }
12588
+ async function registerCast(storage, draft, path4 = OPENTEAM_ROSTER_PATH) {
12589
+ const parsed = RegisterCastPayloadSchema.safeParse(draft);
12590
+ if (!parsed.success) {
12591
+ const fields = offendingFields(parsed.error);
12592
+ return {
12593
+ ok: false,
12594
+ error: `cast draft rejected — invalid field(s): ${fields.join(", ")}`,
12595
+ fields
12596
+ };
12597
+ }
12598
+ const roster = enforceGuaranteedRoles({
12599
+ universe: parsed.data.universe,
12600
+ entries: parsed.data.entries
12601
+ });
12602
+ const written = await persistRosterPreservingProse(storage, roster, path4);
12603
+ return { ok: true, path: written, roster };
12604
+ }
12605
+ function createRegisterCastTool(deps) {
12606
+ return tool5({
12607
+ description: "Registers the orchestrator's cast as the project roster. Use this " + "instead of writing the roster file directly: the payload is validated " + "before anything is persisted, guaranteed roles are added automatically, " + "and curated prose already in the document is preserved.",
12608
+ args: {
12609
+ universe: tool5.schema.string().describe("Casting universe for this roster"),
12610
+ entries: tool5.schema.array(tool5.schema.object({
12611
+ roleID: tool5.schema.string().describe("Stable role identifier, e.g. scribe or guardian"),
12612
+ agentName: tool5.schema.string().describe("Themed character name assigned to the role")
12613
+ })).describe("Role-to-name mappings")
12614
+ },
12615
+ async execute(args) {
12616
+ const result = await registerCast(deps.storage, args, deps.rosterPath ?? OPENTEAM_ROSTER_PATH);
12617
+ if (!result.ok) {
12618
+ return `validation error: ${result.error}`;
12619
+ }
12620
+ const roles = result.roster.entries.map((entry) => `${entry.roleID}=${entry.agentName}`).join(", ");
12621
+ return `registered ${result.roster.entries.length} roles in ${result.path} (${roles})`;
12622
+ }
12623
+ });
12624
+ }
12625
+
12539
12626
  // src/plugin/sessionTracker.ts
12540
12627
  function createSessionTracker() {
12541
12628
  const knownSessions = new Set;
@@ -12808,7 +12895,7 @@ var createOtlpSpanExporter = (connection, config) => {
12808
12895
  // package.json
12809
12896
  var package_default = {
12810
12897
  name: "@jmanuelcorral/openteam",
12811
- version: "0.9.2",
12898
+ version: "0.9.4",
12812
12899
  packageManager: "bun@1.3.14",
12813
12900
  description: "Cost-aware, local-first routing plugin for opencode with cheapest-capable frontier fallback and multi-agent orchestration.",
12814
12901
  license: "MIT",
@@ -13381,11 +13468,11 @@ function createLoopTool(deps) {
13381
13468
  const defaultRalphAgent = TEAM_ROLES[RALPH_ROLE_ID]?.opencodeAgent ?? RALPH_ROLE_ID;
13382
13469
  const agentDir = dirname4(ORCHESTRATOR_AGENT_PATH);
13383
13470
  const agentFileExists = (agentName) => deps.storage.exists(`${agentDir}/${agentName}.md`);
13384
- return tool5({
13471
+ return tool6({
13385
13472
  description: "Runs openteam's bounded Ralph-pattern loop: dispatches the guaranteed " + "ralph role repeatedly until done or the iteration cap. Ensures a roster " + "exists and fails closed when the ralph agent file is missing (run " + "`openteam setup`).",
13386
13473
  args: {
13387
- prompt: tool5.schema.string().describe("Work prompt for the ralph loop"),
13388
- maxIterations: tool5.schema.number().int().positive().optional().describe("Iteration cap (defaults to the ralph loop default)")
13474
+ prompt: tool6.schema.string().describe("Work prompt for the ralph loop"),
13475
+ maxIterations: tool6.schema.number().int().positive().optional().describe("Iteration cap (defaults to the ralph loop default)")
13389
13476
  },
13390
13477
  async execute(args) {
13391
13478
  const prompt = typeof args.prompt === "string" ? args.prompt : "";
@@ -13587,6 +13674,7 @@ var server = async (ctx, rawOptions) => {
13587
13674
  runtimeLimiter
13588
13675
  }
13589
13676
  });
13677
+ const registerCastTool = createRegisterCastTool({ storage });
13590
13678
  return {
13591
13679
  ...hooks,
13592
13680
  tool: {
@@ -13594,7 +13682,8 @@ var server = async (ctx, rawOptions) => {
13594
13682
  "openteam-graph": graphSurface.definition,
13595
13683
  "openteam-orchestrate": orchestrateTool,
13596
13684
  "openteam-memory": memoryTool,
13597
- "openteam-loop": loopTool
13685
+ "openteam-loop": loopTool,
13686
+ "openteam-register-cast": registerCastTool
13598
13687
  },
13599
13688
  "tool.execute.before": async (input) => {
13600
13689
  toolcalls.before(input);
@@ -1 +1 @@
1
- {"version":3,"file":"orchestratorAgent.d.ts","sourceRoot":"","sources":["../../src/opencodeArtifacts/orchestratorAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,iCAAiC,CAAC;AAInE;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAmRR"}
1
+ {"version":3,"file":"orchestratorAgent.d.ts","sourceRoot":"","sources":["../../src/opencodeArtifacts/orchestratorAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,iCAAiC,CAAC;AAInE;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAwRR"}
@@ -29,6 +29,12 @@ export declare const RosterSchema: z.ZodObject<{
29
29
  }, z.core.$strict>;
30
30
  export type RosterEntry = z.infer<typeof RosterEntrySchema>;
31
31
  export type Roster = z.infer<typeof RosterSchema>;
32
+ /**
33
+ * The fenced `json` block is the machine-owned region of the roster document.
34
+ * Exported so persistence repairs exactly the region this parser reads: a second
35
+ * copy of this pattern would silently drift from the parser it must match.
36
+ */
37
+ export declare const ROSTER_JSON_FENCE: RegExp;
32
38
  export type RosterParseErrorCode = "missing-json-block" | "malformed-json" | "invalid-roster-schema";
33
39
  export declare class RosterParseError extends Error {
34
40
  readonly code: RosterParseErrorCode;
@@ -139,8 +145,10 @@ export type RosterDraft = {
139
145
  };
140
146
  /**
141
147
  * Injected generation port (#172). Turns an initial prompt into a draft roster.
142
- * In production this wraps a model call; tests pass a deterministic fake, so the
143
- * generator's decision core never contacts a live LLM.
148
+ * Every current production call site passes a deterministic fallback source, and
149
+ * casts reach disk through the validated `openteam-register-cast` tool (#205) —
150
+ * not through a model writing the file. This port exists so a generated source
151
+ * can be injected without the decision core ever contacting a live LLM itself.
144
152
  */
145
153
  export type RosterSource = (prompt: string) => RosterDraft | Promise<RosterDraft>;
146
154
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"roster.d.ts","sourceRoot":"","sources":["../../src/orchestrator/roster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;GAaG;AAEH,mFAAmF;AACnF,eAAO,MAAM,iBAAiB;;;kBAKnB,CAAC;AAEZ,+DAA+D;AAC/D,eAAO,MAAM,YAAY;;;;;;kBAKd,CAAC;AAEZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAIlD,MAAM,MAAM,oBAAoB,GAC5B,oBAAoB,GACpB,gBAAgB,GAChB,uBAAuB,CAAC;AAE5B,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IAEpC,YAAY,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAItD;CACF;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAE7D,2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  import type { StorageProvider } from "../storage/provider";
2
2
  import { type Roster, type RosterParseError } from "./roster";
3
3
  export { parseRoster, parseRosterResult, RosterParseError } from "./roster";
4
+ /** Serialises a roster to the Markdown-with-JSON roster document. Pure. */
5
+ export declare function serializeRoster(roster: Roster): string;
4
6
  /**
5
- * W3 roster persistence (#173).
7
+ * Rewrites only the machine-owned JSON fence, preserving every other byte of an
8
+ * existing roster document. Pure.
6
9
  *
7
- * The roster round-trips through the git-tracked, portable `.opencode/openteam/`
8
- * directory (decision P15b) so a second session or a colleague who cloned the
9
- * repo reuses the same cast and the team travels with the repository. The file
10
- * lives OUTSIDE `.opencode/agent/` on purpose: opencode loads every `.md` there as
11
- * an agent, so a roster inside it would appear as a phantom agent.
12
- *
13
- * Serialisation embeds the structured roster as a JSON block inside a Markdown
14
- * document, so the write/parse round-trip is exact and Zod-validated while the file
15
- * stays human-readable. All disk access goes through the injected
16
- * {@link StorageProvider} boundary, so this module has no direct I/O.
10
+ * Curated prose the character table and `## Convenciones` a team writes around
11
+ * the fence is theirs, not ours: re-serialising the whole document on every cast
12
+ * registration would silently delete it (#205).
17
13
  */
18
- /** Serialises a roster to the Markdown-with-JSON roster document. Pure. */
19
- export declare function serializeRoster(roster: Roster): string;
14
+ export declare function replaceRosterFence(existing: string | undefined, roster: Roster): string;
20
15
  /** Writes the roster to the portable path; returns the path written. */
21
16
  export declare function persistRoster(storage: StorageProvider, roster: Roster, path?: string): Promise<string>;
17
+ /**
18
+ * Persists a roster while preserving any curated prose already on disk.
19
+ * Prefer this over {@link persistRoster} for writes that may hit a document a
20
+ * human has edited.
21
+ */
22
+ export declare function persistRosterPreservingProse(storage: StorageProvider, roster: Roster, path?: string): Promise<string>;
22
23
  export type RosterFileLoadResult = {
23
24
  readonly status: "absent";
24
25
  readonly path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"rosterPersistence.d.ts","sourceRoot":"","sources":["../../src/orchestrator/rosterPersistence.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,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M,CAAC;CACzB,GACD;IACE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;CAClC,CAAC;AAEN,wEAAwE;AACxE,wBAAsB,cAAc,CAClC,OAAO,EAAE,eAAe,EACxB,IAAI,GAAE,MAA6B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CAc/B;AAED,sFAAsF;AACtF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACjD,QAAQ,CAAC,2BAA2B,CAAC,EAAE,MAAM,CAAC;CAC/C,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EACxC,IAAI,GAAE,MAA6B,GAClC,OAAO,CAAC,gBAAgB,CAAC,CAoB3B"}
@@ -0,0 +1,33 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ import { z } from "zod";
3
+ import { type Roster } from "../orchestrator/roster";
4
+ import type { StorageProvider } from "../storage/provider";
5
+ export declare const RegisterCastPayloadSchema: z.ZodObject<{
6
+ universe: z.ZodString;
7
+ entries: z.ZodArray<z.ZodObject<{
8
+ roleID: z.ZodString;
9
+ agentName: z.ZodString;
10
+ }, z.core.$strict>>;
11
+ }, z.core.$strict>;
12
+ export type RegisterCastPayload = z.infer<typeof RegisterCastPayloadSchema>;
13
+ export type RegisterCastResult = {
14
+ readonly ok: true;
15
+ readonly path: string;
16
+ readonly roster: Roster;
17
+ } | {
18
+ readonly ok: false;
19
+ readonly error: string;
20
+ readonly fields: readonly string[];
21
+ };
22
+ /**
23
+ * Validates a cast draft and persists it, preserving curated prose.
24
+ * On rejection no write is attempted at all.
25
+ */
26
+ export declare function registerCast(storage: StorageProvider, draft: unknown, path?: string): Promise<RegisterCastResult>;
27
+ export type RegisterCastDeps = {
28
+ readonly storage: StorageProvider;
29
+ readonly rosterPath?: string;
30
+ };
31
+ /** Builds the `openteam-register-cast` tool definition. */
32
+ export declare function createRegisterCastTool(deps: RegisterCastDeps): ToolDefinition;
33
+ //# sourceMappingURL=registerCastTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerCastTool.d.ts","sourceRoot":"","sources":["../../src/plugin/registerCastTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA0B,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA0B3D,eAAO,MAAM,yBAAyB;;;;;;kBAK3B,CAAC;AAEZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACrE;IACE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,CAAC;AAoBN;;;GAGG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,OAAO,EACd,IAAI,GAAE,MAA6B,GAClC,OAAO,CAAC,kBAAkB,CAAC,CAiB7B;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,cAAc,CAuC7E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmanuelcorral/openteam",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "packageManager": "bun@1.3.14",
5
5
  "description": "Cost-aware, local-first routing plugin for opencode with cheapest-capable frontier fallback and multi-agent orchestration.",
6
6
  "license": "MIT",