@cohortapp/agent-sdk 2.18.28 → 2.18.29
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/lib/runtime/adapter.mjs +53 -5
- package/package.json +1 -1
package/lib/runtime/adapter.mjs
CHANGED
|
@@ -250,6 +250,14 @@ export function sessionArgs(i = {}) {
|
|
|
250
250
|
* @param {{model: string}} i - the lane input.
|
|
251
251
|
* @returns {string[]} the claude argv.
|
|
252
252
|
*/
|
|
253
|
+
/**
|
|
254
|
+
* The output style a daemon-spawned seat session runs in. "default" is Claude
|
|
255
|
+
* Code's own plain style — no decorative teaching blocks, and no instruction to
|
|
256
|
+
* hand work back to the reader. Overridable for an operator who genuinely wants
|
|
257
|
+
* a different one on their seat's sessions.
|
|
258
|
+
*/
|
|
259
|
+
const SEAT_OUTPUT_STYLE = process.env.MAESTRO_SEAT_OUTPUT_STYLE || "default";
|
|
260
|
+
|
|
253
261
|
const TEXT_ONLY_ARGV = (i) => ["--print", "--model", i.model, "--strict-mcp-config", "--tools", ""];
|
|
254
262
|
|
|
255
263
|
const LANES = Object.freeze({
|
|
@@ -460,11 +468,51 @@ export function buildSpawn(i = {}, deps = {}) {
|
|
|
460
468
|
if (!envResult.ok) return fail(envResult.error.code, envResult.error.message);
|
|
461
469
|
|
|
462
470
|
const perm = Array.isArray(i.permissions) ? i.permissions : (spec.defaultPermissions || []);
|
|
463
|
-
//
|
|
464
|
-
//
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
471
|
+
// A SEAT SESSION PINS ITS OWN OUTPUT STYLE.
|
|
472
|
+
//
|
|
473
|
+
// A seat writes to colleagues in a room, not to a developer at a terminal, so
|
|
474
|
+
// a teaching output style is wrong for it. `scripts/setup/init-agent.sh` used
|
|
475
|
+
// to enable explanatory-output-style and learning-output-style on every
|
|
476
|
+
// provisioned machine (fixed in 2.18.28), and enabling the plugin is what
|
|
477
|
+
// turns the style ON — so a seat ran in "learning" mode with no `outputStyle`
|
|
478
|
+
// key anywhere. Observed 2026-09-30 20:12:55Z: a seat posted a decorative
|
|
479
|
+
// teaching block, box-drawing rules and all, into a shared engineering
|
|
480
|
+
// channel mid status message. The learning style is worse in kind: it
|
|
481
|
+
// instructs the model to stop and ask the reader to write the code.
|
|
482
|
+
//
|
|
483
|
+
// Pinning it HERE rather than editing the machine is the point. The flags live
|
|
484
|
+
// in the operator's own global settings file, which also governs their
|
|
485
|
+
// interactive terminal; an upgrade has no business rewriting that, and an
|
|
486
|
+
// operator who wants explanatory mode for their own sessions keeps it. This
|
|
487
|
+
// only constrains sessions the daemon spawns.
|
|
488
|
+
//
|
|
489
|
+
// WHY THIS IS SAFE, ESTABLISHED RATHER THAN ASSUMED. `--settings` is documented
|
|
490
|
+
// as loading "additional settings", i.e. it MERGES into the precedence chain
|
|
491
|
+
// rather than replacing it — and the CLI distinguishes the two cases, since
|
|
492
|
+
// `--strict-mcp-config` exists precisely to make MCP config exclusive and
|
|
493
|
+
// `--settings` has no such counterpart. Verified live: a `--print` run carrying
|
|
494
|
+
// `--settings '{"outputStyle":"default"}'` exited 0 AND still fired the
|
|
495
|
+
// SessionEnd hook defined only in the machine's global settings, which proves
|
|
496
|
+
// the global file was still in effect. Had it replaced instead, passing this
|
|
497
|
+
// unconditionally would have stripped every seat's permissions and silenced
|
|
498
|
+
// the fleet, which is why it was not shipped on the documentation alone.
|
|
499
|
+
//
|
|
500
|
+
// Reaches the three lanes whose argv carries `x.settings` — dispatcher, resume
|
|
501
|
+
// and cadence — which are the full work sessions, and the dispatcher lane is
|
|
502
|
+
// the one whose end-of-turn text the silent-success rescue republishes. The
|
|
503
|
+
// short-text lanes (responder, classifier, ack) take no settings argument at
|
|
504
|
+
// all and are still governed by the machine; they run on an explicit
|
|
505
|
+
// `--append-system-prompt` and emit a line rather than a report, so they are a
|
|
506
|
+
// smaller surface, but they are NOT covered here.
|
|
507
|
+
//
|
|
508
|
+
// Path B: a cohort-llm retarget additionally authenticates through the
|
|
509
|
+
// seat-token helper, which Claude Code only reads from settings (child-env
|
|
510
|
+
// COHORT_HELPER_KEY). Merged into the same object, never a second --settings.
|
|
511
|
+
const sessionSettings = { outputStyle: SEAT_OUTPUT_STYLE };
|
|
512
|
+
if (envResult.retargeting && isCohortHelperRetarget(i.retarget)) {
|
|
513
|
+
sessionSettings.apiKeyHelper = i.retarget[COHORT_HELPER_KEY];
|
|
514
|
+
}
|
|
515
|
+
const settings = ["--settings", JSON.stringify(sessionSettings)];
|
|
468
516
|
const x = { perm, mcp: mcpArgs(i.mcp, d), knobs: knobArgs(i.knobs), settings };
|
|
469
517
|
const argv = spec.argv(input, x);
|
|
470
518
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cohortapp/agent-sdk",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.29",
|
|
4
4
|
"description": "Cohort Agent SDK — autonomous AI colleague runtime. Deploy senior AI colleagues on dedicated Mac minis, wired to the Cohort operating surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|