jaxon-agents 0.2.0 → 0.3.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.agent.md +203 -168
- package/README.md +15 -6
- package/README.zh-CN.md +16 -7
- package/dist/BUILD_INFO.json +3 -3
- package/dist/PACKAGE_MANIFEST.json +56 -41
- package/dist/RELEASE_META.json +3 -3
- package/dist/agents/directory-store.js +66 -11
- package/dist/agents/jaxon-admin.entry.js +5 -3
- package/dist/agents/session-switch.js +6 -0
- package/dist/api/mcp-tools.js +75 -45
- package/dist/console/activity-client.js +84 -60
- package/dist/console/activity-topics.js +82 -24
- package/dist/console/activity.js +4 -4
- package/dist/console/assets.js +219 -257
- package/dist/console/chat-library.js +685 -0
- package/dist/console/console-info.js +30 -0
- package/dist/console/icons.js +14 -0
- package/dist/console/pages.js +71 -29
- package/dist/console/server.js +8 -4
- package/dist/console/station-pages.js +53 -29
- package/dist/daemon/host.js +14 -3
- package/dist/index.js +87 -8
- package/dist/launcher.js +17 -26
- package/dist/ops/catalog.js +18 -15
- package/dist/ops/core.js +85 -59
- package/dist/pi-host/mcp-bridge.entry.js +41 -10
- package/dist/platform/index.js +22 -0
- package/dist/platform/linux.js +64 -0
- package/dist/release/handoff.js +6 -8
- package/dist/release/store.js +3 -13
- package/dist/sessions/supervisor.js +61 -32
- package/dist/stations/activity.js +24 -28
- package/dist/stations/boards.js +10 -5
- package/dist/stations/cues.js +14 -2
- package/dist/stations/member-instructions.js +4 -6
- package/dist/stations/station-member.entry.js +28 -11
- package/examples/README.md +23 -8
- package/examples/agents/README.md +93 -35
- package/examples/agents/coder/README.md +37 -0
- package/examples/agents/custom-gateway/README.md +42 -0
- package/examples/agents/local-qwen/README.md +46 -0
- package/examples/agents/planner/README.md +39 -0
- package/examples/agents/reviewer/README.md +42 -0
- package/examples/mcp-clients/README.md +35 -16
- package/examples/stations/README.md +98 -21
- package/examples/stations/dev-loop/README.md +40 -0
- package/examples/stations/parallel-coders/README.md +40 -0
- package/examples/stations/parallel-coders/STATION.md +2 -2
- package/examples/stations/research-writer/README.md +39 -0
- package/examples/stations/research-writer/STATION.md +1 -1
- package/examples/workflows/01-dev-loop-e2e.md +27 -5
- package/examples/workflows/02-human-auth-and-roster-switch.md +25 -3
- package/examples/workflows/README.md +17 -0
- package/package.json +3 -3
- package/runtime/provenance.json +3 -3
- package/runtime/runtime-lock.json +2 -2
- package/runtime/runtime-package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<h1>JaXon Agents</h1>
|
|
4
4
|
<p><strong>Your coding agent is the lead. JaXon runs the station.</strong></p>
|
|
5
5
|
<p>
|
|
6
|
-
🌐 <strong>English</strong> · <a href="./README.zh-CN.md"
|
|
6
|
+
🌐 <strong>English (current)</strong> · <a href="./README.zh-CN.md">简体中文版 (<code>README.zh-CN.md</code>)</a> · ⚡ <a href="#quick-start"><strong>Quick Start</strong></a> · 📦 <a href="./examples/"><strong>Examples</strong></a> · 🤖 <a href="./README.agent.md"><strong>Manual for Master Agents (<code>README.agent.md</code>)</strong></a>
|
|
7
7
|
</p>
|
|
8
8
|
</div>
|
|
9
9
|
|
|
@@ -20,6 +20,15 @@ Single-agent coding sessions degrade quickly when one context window has to plan
|
|
|
20
20
|
<sub><em><strong>Illustrative Demo</strong> (abstract animation, not a screen recording): Role-driven teamwork across the <strong>JaXon</strong> X-hub—<code>planner</code>, <code>coder</code>, a temporary coding helper joining mid-run and leaving cleanly when done, and <code>reviewer</code> hand off work on boards while your lead agent decides every move live. Shows one run's trajectory after the fact, not a user-definable workflow graph.</em></sub>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
+
### Key Concepts in 30 Seconds
|
|
24
|
+
|
|
25
|
+
- **Lead Agent / Master Agent (`master`)**: The coding CLI you already use (**Claude Code**, **Codex**, or **OpenCode**). *Lead Agent* and *Master Agent* refer to the same role: it posts goals on the `master` board, dispatches work to members, and decides every next step.
|
|
26
|
+
- **Daemon & `Pi` Sessions**: A singleton local background service (`127.0.0.1` Web Console) that runs each sub-agent inside an isolated **`Pi`** coding-agent session (`session.jsonl`), keeping member workspaces and history alive even if your CLI terminal restarts.
|
|
27
|
+
- **MCP (Model Context Protocol)**: The open protocol that connects your coding CLI to the JaXon daemon (and connects sub-agents to external tool servers).
|
|
28
|
+
- **Station & Seat**: A **Station** pairs plain-language team rules (`STATION.md`) with a role roster (`station.json`). Each role holds a continuing **Seat** session (`seat="claim"`) and can also run clean independent sessions in parallel (`seat="none"`).
|
|
29
|
+
- **Board vs. `cue`**: Each role (plus `master`) maintains a Markdown **Board** injected into `system` every turn—writing to a board passively records conclusions and never auto-triggers workflow steps. A **`cue`** is an explicit peer reminder a member sends after updating its board, waking an idle colleague to read and align on the new notes.
|
|
30
|
+
- **`JaXon` (`ask_jaxon`)**: The built-in quartermaster preset that creates and updates role presets and Stations from plain-language requests.
|
|
31
|
+
|
|
23
32
|
---
|
|
24
33
|
|
|
25
34
|
## Core Principles: Why JaXon Is Built This Way
|
|
@@ -35,7 +44,7 @@ Consider what happens when a **`reviewer`** raises an objection or a task uncove
|
|
|
35
44
|
3. **A sudden parallel module or heavy lift** → update the station roster to bring in a **temporary `coder` helper** mid-run, then remove the helper cleanly once active turns finish.
|
|
36
45
|
4. **An explainable convention or a newly exposed product ambiguity** → either clarify directly on the board and proceed, or pause and hand the decision to the **human**.
|
|
37
46
|
|
|
38
|
-
**JaXon** refuses predetermined pipeline topologies and hardwired arrows
|
|
47
|
+
**JaXon** refuses predetermined pipeline topologies and hardwired arrows: **writing to a Board only records conclusions and status without auto-triggering workflow steps**, while members can explicitly send a peer **`cue`** to wake an idle colleague to check updated board notes, and the lead agent stays focused on **understanding the goal, judging new developments, and adjusting course—which is what real intelligence is for**.
|
|
39
48
|
|
|
40
49
|

|
|
41
50
|
|
|
@@ -146,19 +155,19 @@ Act as the lead agent (master) and use the jaxon-agents MCP server to complete t
|
|
|
146
155
|
|
|
147
156
|
[Collaboration & Execution Guidelines]
|
|
148
157
|
1. Ask JaXon to assemble the roles and Station: Call `ask_jaxon` first with the requirement above so the built-in `JaXon` quartermaster can inspect available model connections, create or reuse fitting role presets (configuring each role's instructions, tools, and best-fit model and running readiness checks), and assemble a dedicated Station (defining clear role boundaries and acceptance criteria in `STATION.md` without hardcoding a rigid workflow graph).
|
|
149
|
-
2. Set the master board and delegate: Write the task goal, workspace path, hard boundaries, and current plan onto the Station's `master` board (`board_write`). Delegate with full autonomy—pass goals, boundaries, and board references rather than micromanaging implementation details,
|
|
158
|
+
2. Set the master board and delegate: Write the task goal, workspace path, hard boundaries, and current plan onto the Station's `master` board (`board_write`). Delegate with full autonomy—pass goals, boundaries, and board references rather than micromanaging implementation details, dispatch independent tracks in parallel (`session_start` / `session_send`), inspect overall status with `session_list`, and wait on a specific member turn via `session_read(after=cursor, wait_ms)`.
|
|
150
159
|
3. Coordinate via boards and adapt live: Track progress through member boards (`board_read`) and session outputs (`session_read`), decide every next move from the new findings that emerge during execution (routing back for fixes, revising plans, or calling `ask_jaxon` mid-run to adjust the Station roster when extra hands are needed), and report back once acceptance criteria are verified.
|
|
151
160
|
```
|
|
152
161
|
|
|
153
162
|
---
|
|
154
163
|
|
|
155
|
-
## Examples,
|
|
164
|
+
## Examples, Manual for Master Agents & Daily CLI
|
|
156
165
|
|
|
157
|
-
- **Runnable Examples ([`examples/`](./examples/))
|
|
166
|
+
- **Runnable Examples ([`examples/`](./examples/))** *(each example breaks down why the task maps to its team structure, why JaXon fits it, why each member is configured as it is, and what to watch for in practice)*:
|
|
158
167
|
- **Stations ([`examples/stations/`](./examples/stations/))**: [`dev-loop`](./examples/stations/dev-loop/) (Plan ⇄ Code ⇄ Review), [`parallel-coders`](./examples/stations/parallel-coders/) (parallel coding + review), [`research-writer`](./examples/stations/research-writer/) (research → writing → fact check).
|
|
159
168
|
- **Agent Presets ([`examples/agents/`](./examples/agents/))**: [`planner`](./examples/agents/planner/), [`coder`](./examples/agents/coder/), [`reviewer`](./examples/agents/reviewer/), [`local-qwen`](./examples/agents/local-qwen/) (zero-auth local Ollama/vLLM), [`custom-gateway`](./examples/agents/custom-gateway/) (enterprise `models.json`).
|
|
160
169
|
- **End-to-End Traces ([`examples/workflows/`](./examples/workflows/))**: [`01-dev-loop-e2e.md`](./examples/workflows/01-dev-loop-e2e.md) (board handoffs & review bounce-back) and [`02-human-auth-and-roster-switch.md`](./examples/workflows/02-human-auth-and-roster-switch.md) (`NEEDS_HUMAN_AUTH` resume & live `station_pending` roster cutover).
|
|
161
|
-
- **
|
|
170
|
+
- **[Manual for Master Agents](./README.agent.md) (`README.agent.md`)**: Authoritative specification for the MCP tool catalog & `jaxon://console` resource (`§2`), global invariants `I1–I9` (`§1.4`), session-switching policy (`session_switch`, `§7`), daemon/relay topology, state machines, live roster switching, and atomic `src/ -> dist/` hot upgrades.
|
|
162
171
|
|
|
163
172
|
```bash
|
|
164
173
|
node dist/index.js console # Ensure the background daemon is running and print the Web Console URL
|
package/README.zh-CN.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<h1>JaXon Agents</h1>
|
|
4
4
|
<p><strong>让你的编码 Agent 当主控,JaXon 为它坐镇整座协作站。</strong></p>
|
|
5
5
|
<p>
|
|
6
|
-
🌐 <a href="./README.md">English</a> · <strong
|
|
6
|
+
🌐 <a href="./README.md">English Version (<code>README.md</code>)</a> · <strong>简体中文(当前)</strong> · ⚡ <a href="#quick-start"><strong>立即试用</strong></a> · 📦 <a href="./examples/"><strong>实战示例</strong></a> · 🤖 <a href="./README.agent.md"><strong>Manual for Master Agents (<code>README.agent.md</code>)</strong></a>
|
|
7
7
|
</p>
|
|
8
8
|
</div>
|
|
9
9
|
|
|
@@ -20,6 +20,15 @@
|
|
|
20
20
|
<sub><em><strong>示意动画(Illustrative Demo,抽象角色叙事而非界面录屏)</strong>:围绕 <strong>JaXon</strong> 枢纽的角色协同——<code>planner</code>、<code>coder</code>、中途灵活加入协助并在收尾后移出名单的临时编码帮手,以及 <code>reviewer</code> 通过看板交接,由主控实时裁决每一步。动画呈现的是一轮执行事后浮现的轨迹,而非用户预定义的工作流图。</em></sub>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
+
### 核心概念速览(Key Concepts)
|
|
24
|
+
|
|
25
|
+
- **主控 Agent(Lead Agent / Master Agent / `master`)**:你日常使用的编码 CLI(**Claude Code**、**Codex** 或 **OpenCode**)。文档中的 *Lead Agent* 与 *Master Agent* 指同一角色——负责在 `master` 看板立项、向成员派单并裁决每一步走向。
|
|
26
|
+
- **常驻守护进程(Daemon)与 `Pi` 会话**:本机唯一的后台服务(含 `127.0.0.1` Web 控制台),使用 **`Pi`** 编码智能体运行时托管每个子智能体的隔离持久会话(`session.jsonl`),主控终端关闭或重连不会中断成员工作。
|
|
27
|
+
- **MCP(Model Context Protocol,模型上下文协议)**:将你的主控 CLI 接入 JaXon 守护进程(以及为子智能体挂载外部工具服务)的标准协议。
|
|
28
|
+
- **协作站(Station)与席位(Seat)**:一座 **Station** 由自然语言协作规则(`STATION.md`)与成员名单(`station.json`)组成;每个角色拥有延续上下文的主**席位会话**(`seat="claim"`),也可开启干净的独立并行会话(`seat="none"`)。
|
|
29
|
+
- **看板(Board)与同伴提醒(`cue`)**:`master` 与每个角色各有一块每轮自动注入 `system` 的 Markdown **看板**——写看板本身只被动保存结论与状态,绝不自动触发流程步骤;**`cue`** 则是成员更新看板后显式发出的平级提醒,用于唤醒空闲同伴查阅看板对齐进展。
|
|
30
|
+
- **内置管家 `JaXon`(`ask_jaxon`)**:系统内置的管理角色预设,可根据主控的自然语言请求自动创建或调整角色预设与 Station。
|
|
31
|
+
|
|
23
32
|
---
|
|
24
33
|
|
|
25
34
|
## 核心理念与架构展开
|
|
@@ -35,7 +44,7 @@
|
|
|
35
44
|
3. **中途浮现并行模块或重度攻坚** → 主控实时更新协作站名单,引入一名**临时 `coder` 帮手**协同实现,待在途轮次收尾后再将其干净移出编制;
|
|
36
45
|
4. **可当场澄清的约定或首次暴露的需求歧义** → 主控要么在看板直接拍板放行,要么立即停手交回**人类**裁决。
|
|
37
46
|
|
|
38
|
-
因此,**JaXon**
|
|
47
|
+
因此,**JaXon** 拒绝预设箭头指向,拥抱灵活变化——**写入看板(Board)本身只沉淀结论与状态、绝不自动触发流程步骤**;成员之间需要对齐看板时可显式发送平级 **`cue`** 提醒(唤醒空闲同伴查阅看板),而全局任务推进始终专注于**目标的理解、研判与调整,是谓智能**。
|
|
39
48
|
|
|
40
49
|

|
|
41
50
|
|
|
@@ -146,19 +155,19 @@ tool_timeout_sec = 1800
|
|
|
146
155
|
|
|
147
156
|
【协作与执行要求】
|
|
148
157
|
1. 找 JaXon 装配团队与协作站:先调用 `ask_jaxon`,把上述需求告诉内置管家 `JaXon`,让它结合当前已配置的模型连接,按需创建或复用合适的角色预设(分别配置好系统提示、工具集与契合的模型并通过就绪检测),并装配一座专属 Station(在 `STATION.md` 中写明各角色职责边界、交接与验收准则,不预设死板流程图)。
|
|
149
|
-
2. 主控立项与派单:在 Station 的 `master` 看板(`board_write`)写清本次任务的最终目标、工作区路径、硬边界与当前计划;彻底放权给各专业角色(派单只传目标、边界与看板引用,不替下级手写实现细节),能并行的工作优先并行派出(`
|
|
158
|
+
2. 主控立项与派单:在 Station 的 `master` 看板(`board_write`)写清本次任务的最终目标、工作区路径、硬边界与当前计划;彻底放权给各专业角色(派单只传目标、边界与看板引用,不替下级手写实现细节),能并行的工作优先并行派出(`session_start` / `session_send`),查看全体状态快照用 `session_list`,等待某个成员轮次收尾用 `session_read(after=cursor, wait_ms)`。
|
|
150
159
|
3. 看板协同与动态演进:每轮通过角色看板(`board_read`)和会话输出(`session_read`)跟进实际进展,根据工作推进中浮现的新情况实时决定下一步(如派回修复、调整方案,或在需要增援时再次调用 `ask_jaxon` 动态调整 Station 成员名单),直至完成独立验收后向我汇报最终交付结果。
|
|
151
160
|
```
|
|
152
161
|
|
|
153
162
|
---
|
|
154
163
|
|
|
155
|
-
##
|
|
164
|
+
## 实战示例、Manual for Master Agents 与日常 CLI
|
|
156
165
|
|
|
157
|
-
- **实战示例库([`examples/`](./examples/)
|
|
166
|
+
- **实战示例库([`examples/`](./examples/))**(每个示例均按「需求对应的团队结构 → JaXon 实现机制 → 成员身份与配置理由 → 具体设计与注意事项」展开):
|
|
158
167
|
- **协作站模板([`examples/stations/`](./examples/stations/))**:[`dev-loop`](./examples/stations/dev-loop/)(规划 ⇄ 编码 ⇄ 评审闭环)、[`parallel-coders`](./examples/stations/parallel-coders/)(双编码并行 + 汇合评审)、[`research-writer`](./examples/stations/research-writer/)(调研 → 主笔 → 事实审校)。
|
|
159
|
-
- **角色预设([`examples/agents/`](./examples/agents/))**:[`planner`](./examples/agents/planner/)
|
|
168
|
+
- **角色预设([`examples/agents/`](./examples/agents/))**:[`planner`](./examples/agents/planner/), [`coder`](./examples/agents/coder/), [`reviewer`](./examples/agents/reviewer/), [`local-qwen`](./examples/agents/local-qwen/)(本地免凭据 Ollama/vLLM)、[`custom-gateway`](./examples/agents/custom-gateway/)(企业自定义协议网关)。
|
|
160
169
|
- **端到端轨迹([`examples/workflows/`](./examples/workflows/))**:[`01-dev-loop-e2e.md`](./examples/workflows/01-dev-loop-e2e.md)(看板交接与评审返工实录)与 [`02-human-auth-and-roster-switch.md`](./examples/workflows/02-human-auth-and-roster-switch.md)(`NEEDS_HUMAN_AUTH` 原参续做与激活期 `station_pending` 排队一波切入)。
|
|
161
|
-
-
|
|
170
|
+
- **[Manual for Master Agents](./README.agent.md)(`README.agent.md`)**:权威承载前门 MCP 工具清单与 `jaxon://console` 资源(`§2`)、全局不变量 `I1–I9`(`§1.4`)、角色会话换用策略(`session_switch`,`§7`)、守护进程/薄中继拓扑、三大状态机、激活期排队切换与 `src/ -> dist/` 原子热升级规范。
|
|
162
171
|
|
|
163
172
|
```bash
|
|
164
173
|
node dist/index.js console # 确保后台守护进程运行,并在终端打印 Web 控制台 URL
|
package/dist/BUILD_INFO.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"build_id": "pkg-
|
|
3
|
-
"built_at": "2026-11-
|
|
4
|
-
"content_hash": "
|
|
2
|
+
"build_id": "pkg-f05715868da3a642",
|
|
3
|
+
"built_at": "2026-11-28T11:07:55.000Z",
|
|
4
|
+
"content_hash": "f05715868da3a642cceb729a63d5f208d050802e90f51a0780963f907148ef0a"
|
|
5
5
|
}
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"LICENSE": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
|
|
3
|
-
"README.agent.md": "
|
|
4
|
-
"README.md": "
|
|
5
|
-
"README.zh-CN.md": "
|
|
6
|
-
"dist/BUILD_INFO.json": "
|
|
7
|
-
"dist/RELEASE_META.json": "
|
|
3
|
+
"README.agent.md": "7e39becce3b2a80b6397881552aad3117f83d736fd50d941848a02ec4ae503f8",
|
|
4
|
+
"README.md": "bafd9f85acce62d8cf3491c6c5882badd9220d9d99df4bcaf8a6e58d931beb26",
|
|
5
|
+
"README.zh-CN.md": "2fa1a588e6917bc9bdc4a9924e0d726d0822eb8ef658649b8d1544890687ba81",
|
|
6
|
+
"dist/BUILD_INFO.json": "ebc7a685e7051133ed8f1ade9e8c5e9da1d301b336bca0e7361b616a52092f71",
|
|
7
|
+
"dist/RELEASE_META.json": "63baa0562a0464e2a2a64421e2345f9321102d7b32a55bfb1224c5ea2ac567bc",
|
|
8
8
|
"dist/agents/admin-scope.js": "70b617e88181a7252792ac29f0a913abad97b60b732d04f0712c1913d6623bba",
|
|
9
|
-
"dist/agents/directory-store.js": "
|
|
10
|
-
"dist/agents/jaxon-admin.entry.js": "
|
|
9
|
+
"dist/agents/directory-store.js": "79a0055647596e97d9af56fb7743f0c1b557cbd983275c5bb07c5d9283eca638",
|
|
10
|
+
"dist/agents/jaxon-admin.entry.js": "780b32927a629f8ba08980bcb6491d108e8849adcc7f5aae3f9672003cc4eff1",
|
|
11
11
|
"dist/agents/mcp-server-config.js": "20b7807d41917a120ad8843252d26da6d84d50636718a010165f6c4f1c68518d",
|
|
12
|
+
"dist/agents/session-switch.js": "3ac6697935b7edf531ec025c0d4ee3691cafd5d33e3dd41caf9bbc652ac9f750",
|
|
12
13
|
"dist/agents/skills-directory.js": "e9d56e64098be037f033154dcb48a76b664278ba4dd6e87752dd40632364ab52",
|
|
13
|
-
"dist/api/mcp-tools.js": "
|
|
14
|
+
"dist/api/mcp-tools.js": "68b8797dc69895c998cbb9dd6d2cb152e3cd04f4193e91c8b54e5ffebfcbc697",
|
|
14
15
|
"dist/connections/callback-landing.js": "0cf59ea1d7867e07520ea0ea57014ac185b01718d8207e97d59cf6179fb8402c",
|
|
15
16
|
"dist/connections/health.js": "f0678a679f412f3c3341ed2dad65f02ca0988c3294837c3949092916479b9e3a",
|
|
16
17
|
"dist/connections/manager.js": "4fe701df7992b76806006fa06874ad6be6f589820927394603a39926d5309c4a",
|
|
17
18
|
"dist/connections/types.js": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
18
|
-
"dist/console/activity-client.js": "
|
|
19
|
+
"dist/console/activity-client.js": "25a1e0e66e787ce15d58ef92531b273cafd3541b73a5ea3dcbcaee398450a3e5",
|
|
19
20
|
"dist/console/activity-page.js": "e58f989385d4fdda6ee6f3164393071eb48bbf3f66ec9546ceed2163c7398b64",
|
|
20
|
-
"dist/console/activity-topics.js": "
|
|
21
|
-
"dist/console/activity.js": "
|
|
22
|
-
"dist/console/assets.js": "
|
|
21
|
+
"dist/console/activity-topics.js": "a4ba12afde24ad0a1270ce2391d66f5e7d77e6cc17640032904403fd3d6667d0",
|
|
22
|
+
"dist/console/activity.js": "202d38f81dbaecd321308291ea18c9298deee6e499b4d3f95d8308d7ec447f47",
|
|
23
|
+
"dist/console/assets.js": "c978aff345055345f84eac64ff55ddeb24e8f7f58257c6cd5ca7b0c84beea208",
|
|
24
|
+
"dist/console/chat-library.js": "e574b20959f386b4af44c8de9043723f7397840d6632059c0685795accb05e21",
|
|
25
|
+
"dist/console/console-info.js": "e081420b1af65f2cf04f427dbbcfc47f4c971464ab457886d92ad52c096e0ac9",
|
|
26
|
+
"dist/console/icons.js": "6952faa68cdf2bf385402b829125af8eb540d1289799193ff7d9e54ae3410fcc",
|
|
23
27
|
"dist/console/jaxon-logo.svg": "4db7165d971023d4cf9008b828d9a33967d606ebe5ccc04211ebd9297dfb7cec",
|
|
24
|
-
"dist/console/pages.js": "
|
|
28
|
+
"dist/console/pages.js": "7c5dcc633f2b124d670c83f0ef1482aab4810944379d1a68b2c48796e0860094",
|
|
25
29
|
"dist/console/pagination.js": "399ddc6384076d6d57c0324b0347f8ff3ac915d7bdae9fc182c168838bd8d5d7",
|
|
26
|
-
"dist/console/server.js": "
|
|
27
|
-
"dist/console/station-pages.js": "
|
|
30
|
+
"dist/console/server.js": "f1077103861e37effbb2de522381112d5d073477b766cc1a465dcebb5db26b8e",
|
|
31
|
+
"dist/console/station-pages.js": "a86ceca4a0843bf17f347052337e7ae0a46bb549c73518040eec9114763b2e67",
|
|
28
32
|
"dist/console/usage-charts.js": "6634132e21fc507bba086ce2d6085215052c3b711ebf38aaff0e322fc7ae302c",
|
|
29
33
|
"dist/console/usage-page.js": "9cfeec8b47ea4940c0d6c9da7e8258ad73829012439ae0faff5211a21b250ed7",
|
|
30
34
|
"dist/console/usage-range.js": "22fd3ceb7db5019d574cd18f1657d6bffb2e9639bf955e64c33eb4e1a62ba669",
|
|
@@ -34,17 +38,17 @@
|
|
|
34
38
|
"dist/daemon/client.js": "bb2ce3d44313276fbfcd939e846f3d4551dee35449915ffa51604a4405b54080",
|
|
35
39
|
"dist/daemon/fingerprint.js": "621ec9e978563e54572fb2c394d9927429f73ea44f93f65628ac38f10c8172fd",
|
|
36
40
|
"dist/daemon/handoff-watchdog.js": "e8eb4ca65c49269f082ac9a3d588937e47476ab70f53c1c5a6c52a57350ab556",
|
|
37
|
-
"dist/daemon/host.js": "
|
|
41
|
+
"dist/daemon/host.js": "e768a1c9f6c04aab26c1edc3e2dabc3be226019835c76f52428f905ba90aade8",
|
|
38
42
|
"dist/daemon/main.js": "d56da742508262b4e0d86cac62e2118cc0a72c873344e0d153e00d81dcd36268",
|
|
39
43
|
"dist/daemon/paths.js": "9eb1161183b371a4abed0c597ed6ed48d49092692e91c8b7113960c12586991d",
|
|
40
44
|
"dist/daemon/preflight.js": "ba4929a1f96322ca85643bef425a1e352899a8fa28589b8e284b7235b3d2d865",
|
|
41
45
|
"dist/environment/local-model-endpoint.js": "830363a50ae39cb5e8cd672bfbd7169f8798c17b71dd79252389a1e335513d10",
|
|
42
46
|
"dist/environment/pi-launch-spec.js": "3b9dbf862d7676556d4fa0d6a58292ae4b93537a8cec987c0abb72e9f7878c44",
|
|
43
47
|
"dist/environment/runtime-binaries.js": "582497688638d891919b2dcafff7c891ef6e566efdc936aa2f68fa20a60eb45c",
|
|
44
|
-
"dist/index.js": "
|
|
45
|
-
"dist/launcher.js": "
|
|
46
|
-
"dist/ops/catalog.js": "
|
|
47
|
-
"dist/ops/core.js": "
|
|
48
|
+
"dist/index.js": "c7163a5ee16d01135839445ef6e602757d0ca5438c0d21a0360797ab7a69b5bb",
|
|
49
|
+
"dist/launcher.js": "dea4f1e25e8636923c3d731be5726a13c39e2103136873d6dd37e7569ccac083",
|
|
50
|
+
"dist/ops/catalog.js": "d51cfc1b6fff14429c27385cef10b2d3070c694ca792f68a8724c81e8e3ad084",
|
|
51
|
+
"dist/ops/core.js": "6e234781320b5b56c7aa5a611ca744dd8494648052bc44e165687cfd44c47cd4",
|
|
48
52
|
"dist/ops/errors.js": "a375d6c06f36e96aa73bbeaca452f6ef3671c0605ec8f35993d066536df83a49",
|
|
49
53
|
"dist/ops/idempotency.js": "989f0219a99483fb7f61c7260768c23ca68ef328ad6b1b5a6d5be74764460ca3",
|
|
50
54
|
"dist/ops/wait.js": "51ddd5f65af4ded333866a0086f0894954065421c8b9687174698f20af0d0fe8",
|
|
@@ -52,26 +56,28 @@
|
|
|
52
56
|
"dist/pi-host/event-tailer.js": "72d48cf2f798331693c69f5eaab0bb89bcb33dfe824c9627d87daf98315cbf7f",
|
|
53
57
|
"dist/pi-host/history-reader.js": "d32b65c0474dc9d3ab0e434952af95580344bbef7ada5337e1bd02e73e813703",
|
|
54
58
|
"dist/pi-host/interactive-client.js": "efc36cb046a44c75133669622831dcc74d8b1d1453be47c223ed5d6f9528eb15",
|
|
55
|
-
"dist/pi-host/mcp-bridge.entry.js": "
|
|
59
|
+
"dist/pi-host/mcp-bridge.entry.js": "64b7ed2f2a249b9f8b01b1b3d8a86d85fbcc630b0cbf7512d539a20ebcfeae74",
|
|
60
|
+
"dist/platform/index.js": "210b5c3c59811217c2de8f4dcbef6a6eddc697858a5414bedb7db160a64f6fc9",
|
|
61
|
+
"dist/platform/linux.js": "e7508becefcd98993086c81799bb83abb0dd44b07609efd97bd73cf6ca0c2842",
|
|
56
62
|
"dist/readiness/service.js": "03227937388ec338ec111f8641f7a7bfbfaa297e21d121375ff78aab0afb6642",
|
|
57
63
|
"dist/release/cli.js": "40718b4d2f66ecf695ccccc953d3f35f8fba2950bba91e9610773e0ce343ed1c",
|
|
58
64
|
"dist/release/cold-start.js": "576453fc880b47e808fa7f08dc0f4caeb5b21bca3be9456e84d6860dffc2d968",
|
|
59
65
|
"dist/release/download.js": "1fa0ffbfe8a919bd4ef04620c07e0f85291214ec29c82e105df9db0730bc53df",
|
|
60
|
-
"dist/release/handoff.js": "
|
|
66
|
+
"dist/release/handoff.js": "03a3f8ca9afa596f4fb1f389870b3a4f903d39215cc870ae827270cdf7e30ac7",
|
|
61
67
|
"dist/release/install-runtime.js": "cc7537c0b65b53650a53cef507c86c0a6c96a9459a476c0d2797a32fdad69ed0",
|
|
62
68
|
"dist/release/meta.js": "b091485ec75bedcbf8e54ea7bfa53fbb454501357e72595e9139d41e6e3b6ea2",
|
|
63
|
-
"dist/release/store.js": "
|
|
69
|
+
"dist/release/store.js": "64e43fdbb10c653d31411f5e61cac639aea6c46dfdab86c9543c4b4a673a2ef5",
|
|
64
70
|
"dist/release/update.js": "5ab4a0372a556a85e3c017096dceb29cfb24d1eb6c6ba9e38361f478bf6a9702",
|
|
65
71
|
"dist/root.js": "069be52213ae06f19d8b7b58d92ad34a94fd575ad47a9a923826dcbd69f626be",
|
|
66
72
|
"dist/sessions/dashboard-usage.js": "6171091f6c3a6564805cabd7cf80a4714c347fff1a6fcbb9fb1b80edce32b4ff",
|
|
67
|
-
"dist/sessions/supervisor.js": "
|
|
73
|
+
"dist/sessions/supervisor.js": "37abfa51dfb40efb2c8ce3b8947f1eba41af46672cfe08a0d4d8e20b990387d6",
|
|
68
74
|
"dist/sessions/usage-ledger.js": "364095eb0f55815c9630b54e0a88771997bf2b66a829e9677af88868bcb8cea3",
|
|
69
|
-
"dist/stations/activity.js": "
|
|
70
|
-
"dist/stations/boards.js": "
|
|
71
|
-
"dist/stations/cues.js": "
|
|
75
|
+
"dist/stations/activity.js": "f960900788c0402ab92b5b3ba15516d0a1aad9d92da0b8be1e27a255af98f2c2",
|
|
76
|
+
"dist/stations/boards.js": "fbfef76e8192bce5e30a393132e376131ad0750a088abc063fd4b7234040ed86",
|
|
77
|
+
"dist/stations/cues.js": "e078e85a3cc263056bbbea691c4d58e4dbeb77bebd1cfed898542e222970741e",
|
|
72
78
|
"dist/stations/interactions.js": "217fc2d4133e5dae325d3610c7012ba434c8410b6e8418fef5b68246345f5ad6",
|
|
73
|
-
"dist/stations/member-instructions.js": "
|
|
74
|
-
"dist/stations/station-member.entry.js": "
|
|
79
|
+
"dist/stations/member-instructions.js": "610406dd47344342195b0128eb5ec967a3c7214fddd08c9a04e48ad87520e48a",
|
|
80
|
+
"dist/stations/station-member.entry.js": "108cbb2293aa88c1ea3d5091abea0ca0b16cfc179ceb11299d20a304120cb6b4",
|
|
75
81
|
"dist/stations/station-store.js": "d0d609d07938b426297d0a284969aa9f5e06acc89b3f3e67742dc82733fae4d8",
|
|
76
82
|
"dist/templates/JaXon/APPEND_SYSTEM.md": "96d9e74dc371a025cf12142f86b67bc78eaf66af930d6619e0f86e12b6c601e5",
|
|
77
83
|
"dist/templates/JaXon/DESCRIPTION": "369f5e3b1508febdd1efd7479e2be360df7aab20b27cae49949293563dc82aa9",
|
|
@@ -79,46 +85,55 @@
|
|
|
79
85
|
"dist/upgrade/catalog.js": "bd23914b26d1e036f44a457274d8e519a61c48c0ea29c8f5e10813dd2f0607f3",
|
|
80
86
|
"dist/upgrade/graph.js": "bb37f81d2b604f506a195de0c8bad393a1a84ac1aea81b2d06d78768b162d1b1",
|
|
81
87
|
"dist/upgrade/semver.js": "37123c968577de197753d7d8f84e537a2b05e52735fc6edd515ad36a2f27e24b",
|
|
82
|
-
"examples/README.md": "
|
|
83
|
-
"examples/agents/README.md": "
|
|
88
|
+
"examples/README.md": "fb679b1f2a98accc5a57b2fa5a032a7287f068f9aadb82116f456fff794fb7d5",
|
|
89
|
+
"examples/agents/README.md": "b4692de6f7424613dcf568c07fc9024dc62fb98e40af0f15b97424ddfe269d44",
|
|
84
90
|
"examples/agents/coder/APPEND_SYSTEM.md": "0471f42e109083e1e24fc041ec918b34e026af19efc9b5fe5e77a27f94178ce7",
|
|
85
91
|
"examples/agents/coder/DESCRIPTION": "adc77c793a0f6c33c51d57fc01ce383173df0fc4ec40b3a09a14c63a7fe24dd6",
|
|
92
|
+
"examples/agents/coder/README.md": "b5ae4183bbd50bbf6be2bec3448699327baf1f142d2180f706cfdb3db7a18e67",
|
|
86
93
|
"examples/agents/coder/mcp.json": "14b1ca834d9867a3f382a7ebbf7d2f149e1b7ac0d2ae9deef5cdc030e670a546",
|
|
87
94
|
"examples/agents/coder/settings.json": "d1c127dcb16e0bc62827ce45c831a8f2911fa2e6f38036b3bb520b4c4a3f5710",
|
|
88
95
|
"examples/agents/custom-gateway/APPEND_SYSTEM.md": "bf22361f5099dc997c584f7157f76b98bc5477b384e7d663b950781d1f01d56c",
|
|
89
96
|
"examples/agents/custom-gateway/DESCRIPTION": "2294efd8e78741624c085a3718fde61e054abc8047214aebe6638ba831d4ba3e",
|
|
97
|
+
"examples/agents/custom-gateway/README.md": "b6f62f56812b58f856189297cb443c09afae5d28d4fa43fd723a1856fe9702bb",
|
|
90
98
|
"examples/agents/custom-gateway/models.json": "ac950c5dc99daa1cbc39561a864de0ed087ce29820f7d7f9617ef42e0d76d35f",
|
|
91
99
|
"examples/agents/custom-gateway/settings.json": "a5a859dbd61922406afb0e3d7e09268046d93ccae7dca3b1549590d9e7f6aed1",
|
|
92
100
|
"examples/agents/local-qwen/APPEND_SYSTEM.md": "a2fde0f1bd67e24cca5e723dab036d68ea42e4c3737cd91e2f6a3e0c464ed926",
|
|
93
101
|
"examples/agents/local-qwen/DESCRIPTION": "b2e4ade936257f7b2144016c3a0e240da2d0cb69cd75f5c20b97d9f0173a5f3f",
|
|
102
|
+
"examples/agents/local-qwen/README.md": "416e58a19e544c849be63a66229f9a9bf277a96491da04166ecaff1b008b75f6",
|
|
94
103
|
"examples/agents/local-qwen/models.json": "594cf6e537bf132fbc8a970523e2425faf2f4206e25d40079e1d12239667bd19",
|
|
95
104
|
"examples/agents/local-qwen/settings.json": "dd6f88c8767cfcb8336d9b1e67bd80863382ac76edf6d6da29ec6b2b4ec705f8",
|
|
96
105
|
"examples/agents/planner/APPEND_SYSTEM.md": "81397a7a26b0efb89c2e85873da163c69225927c26f1232bb616fb16cbde9f7d",
|
|
97
106
|
"examples/agents/planner/DESCRIPTION": "7031bbb4295d167c353fa2b5bb2be6de4aa9a200c14cc49565ac3d06e1f01687",
|
|
107
|
+
"examples/agents/planner/README.md": "8e6d622bb4c02aaac2a62f5f5e1186becf2ca2501cd25a439b72b5c32e209884",
|
|
98
108
|
"examples/agents/planner/mcp.json": "14b1ca834d9867a3f382a7ebbf7d2f149e1b7ac0d2ae9deef5cdc030e670a546",
|
|
99
109
|
"examples/agents/planner/settings.json": "d1c127dcb16e0bc62827ce45c831a8f2911fa2e6f38036b3bb520b4c4a3f5710",
|
|
100
110
|
"examples/agents/reviewer/APPEND_SYSTEM.md": "3ee7b94ff47b2f6f50766cae2e6c73b9b838686f0007a73d4b405fe648cb6b3b",
|
|
101
111
|
"examples/agents/reviewer/DESCRIPTION": "939dc67037f71003517c812845622f05f6bd0f62729d4bbbfc131fe10488adc8",
|
|
112
|
+
"examples/agents/reviewer/README.md": "e94971c6cd7d05e354e3b0af53aa10daf5d47ca7646e9cd30d7e5c3fb9bd4a0b",
|
|
102
113
|
"examples/agents/reviewer/mcp.json": "14b1ca834d9867a3f382a7ebbf7d2f149e1b7ac0d2ae9deef5cdc030e670a546",
|
|
103
114
|
"examples/agents/reviewer/settings.json": "eb8e50a11fda78e2c322a4e5e08a774441ed1e3526b7dcb6d14508511ae594ef",
|
|
104
|
-
"examples/mcp-clients/README.md": "
|
|
115
|
+
"examples/mcp-clients/README.md": "c2bb0fa16136e9b825b03f71f862cb4b2326e55980c1a028b3c09f91b6805a83",
|
|
105
116
|
"examples/mcp-clients/claude-code.json": "6a290beab7a9fc01240b9a8e9cfa5f8433ba13857360b678bdff79a8f6a048d8",
|
|
106
117
|
"examples/mcp-clients/codex.toml": "c31e2515c6f8c3ce330d3967d0a0bd0a6d8f6407393c60fd00b5b6c8052427ec",
|
|
107
118
|
"examples/mcp-clients/opencode.json": "d51b213ea179eed7d9773728a6a5e4f3e176b4943369900b7a4adb30dbaad8ef",
|
|
108
|
-
"examples/stations/README.md": "
|
|
119
|
+
"examples/stations/README.md": "a37ffd8ffa4545d420bc00816507cd8b43009d34e12c6e5a5a4e13965ad71517",
|
|
109
120
|
"examples/stations/dev-loop/DESCRIPTION": "873a1e56328d23a23256a18ad441914db3f0f4519f8260d0695027a67899f056",
|
|
121
|
+
"examples/stations/dev-loop/README.md": "cbca011f996651557663607c8c34e7669f8839d5359716ecf2ac31634782e924",
|
|
110
122
|
"examples/stations/dev-loop/STATION.md": "2ab4ba47d578674a84d3149a319b8c2cabc1de302662b90d8c5d1feba2769446",
|
|
111
123
|
"examples/stations/dev-loop/station.json": "ca668f63275397e142b10f6af68a1127b9886b34e89feff56f5ec1a4132a7ef2",
|
|
112
124
|
"examples/stations/parallel-coders/DESCRIPTION": "03cb44195de878ce7a29a086071de1447382adc881de4ff809642aea6921cc5b",
|
|
113
|
-
"examples/stations/parallel-coders/
|
|
125
|
+
"examples/stations/parallel-coders/README.md": "672186cc3ad23cb1025692c0774d86394cbec7bbc7be5360eb850e4119315d3c",
|
|
126
|
+
"examples/stations/parallel-coders/STATION.md": "9579aef543ab43cdc26b65f140c0a64e6232d451ce2eb90cd262cc9daaff20f1",
|
|
114
127
|
"examples/stations/parallel-coders/station.json": "ca668f63275397e142b10f6af68a1127b9886b34e89feff56f5ec1a4132a7ef2",
|
|
115
128
|
"examples/stations/research-writer/DESCRIPTION": "036d93dd3b9d599b4d3a65f913d5f86709f4742ab2df0b89859232ae4c70f634",
|
|
116
|
-
"examples/stations/research-writer/
|
|
129
|
+
"examples/stations/research-writer/README.md": "17d5e112f0c046d021ae6eb52ece3821f1d15b9c1294bc3530a151b59f4255ea",
|
|
130
|
+
"examples/stations/research-writer/STATION.md": "d94f02fb463e67bc562612cd25dc1cd40fd8bf1de2f74e589b0e06309f04332d",
|
|
117
131
|
"examples/stations/research-writer/station.json": "01d2552ce9ff60d7b76fb314463105c218fa9038b5e2c5494c13649c4f88b7f3",
|
|
118
|
-
"examples/workflows/01-dev-loop-e2e.md": "
|
|
119
|
-
"examples/workflows/02-human-auth-and-roster-switch.md": "
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"runtime/
|
|
123
|
-
"runtime/runtime-
|
|
132
|
+
"examples/workflows/01-dev-loop-e2e.md": "c1c8bc48957777e20af7cb8d614e033f1921d8fdbc77c6ecbf30a0a62e0cfbf3",
|
|
133
|
+
"examples/workflows/02-human-auth-and-roster-switch.md": "63a426fc90ee168f641090fa90c1bafd20007ab08d2bcec67fe1cfdd20c04ceb",
|
|
134
|
+
"examples/workflows/README.md": "d47fd6fc90b1c01ddc49a0402ce6b512aacf13e92d16d97c09b9e642c325acdc",
|
|
135
|
+
"package.json": "52247bd9e8cec45109d2da3da44f48b03c614fb3a5d4b297c621fb76bb5f2972",
|
|
136
|
+
"runtime/provenance.json": "dd08389796daf4a7eab05ed1d30194c51598227ff43e9b60bf1e3d89659f8372",
|
|
137
|
+
"runtime/runtime-lock.json": "27abc66dae8c5eef0d9ad6eacfd0cecfe3b54f9146959d1c69bffd93471ea0f3",
|
|
138
|
+
"runtime/runtime-package.json": "cab7ada5358cd44730d88356df446921b14cb4a2a5ec34b41df9447e75355207"
|
|
124
139
|
}
|
package/dist/RELEASE_META.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { copySkill, overlaySkills, skillEntries, skillsLocation, workingSkills } from "./skills-directory.js";
|
|
2
2
|
import { changeServer, serverChange } from "./mcp-server-config.js";
|
|
3
|
+
import { defaultSessionSwitch, isSessionSwitch, sessionSwitchKey, sessionSwitchValues } from "./session-switch.js";
|
|
3
4
|
import * as fs from "node:fs";
|
|
4
5
|
import * as net from "node:net";
|
|
5
6
|
import * as path from "node:path";
|
|
@@ -85,6 +86,22 @@ export function current(name, revision) {
|
|
|
85
86
|
return { presetId: read(path.join(dir, "PRESET_ID")), rev, dir: revDir };
|
|
86
87
|
}
|
|
87
88
|
export const settingsOf = (dir) => readJson(path.join(dir, "settings.json"), {});
|
|
89
|
+
export function sessionSwitchFields(name, dir) {
|
|
90
|
+
if (name === JAXON)
|
|
91
|
+
return {};
|
|
92
|
+
let source = dir;
|
|
93
|
+
if (!source) {
|
|
94
|
+
try {
|
|
95
|
+
source = current(name).dir;
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
if (error?.code !== "PRESET_NOT_FOUND")
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const value = source ? settingsOf(source)?.[sessionSwitchKey] : undefined;
|
|
103
|
+
return { session_switch: isSessionSwitch(value) ? value : defaultSessionSwitch };
|
|
104
|
+
}
|
|
88
105
|
export const harnessOf = (dir) => {
|
|
89
106
|
const h = readJson(path.join(dir, "harness.json"), {});
|
|
90
107
|
return { connection: typeof h.connection === "string" && h.connection ? h.connection : null };
|
|
@@ -185,7 +202,7 @@ export function getPresetRedacted(name, includeFiles = true) {
|
|
|
185
202
|
catch { }
|
|
186
203
|
return {
|
|
187
204
|
name, description: description(name), preset_id: presetId, revision: rev,
|
|
188
|
-
connection: harnessOf(dir).connection, files, mcp_credentials_configured: mcp,
|
|
205
|
+
connection: harnessOf(dir).connection, files, mcp_credentials_configured: mcp, ...sessionSwitchFields(name, dir),
|
|
189
206
|
revisions: fs.readdirSync(path.join(presetDir(name), "revisions")).filter((r) => /^rev_/.test(r)).sort(),
|
|
190
207
|
};
|
|
191
208
|
}
|
|
@@ -209,6 +226,34 @@ function applyPatch(revDir, patch) {
|
|
|
209
226
|
}
|
|
210
227
|
}
|
|
211
228
|
}
|
|
229
|
+
function validateSessionSwitch(name, value, present) {
|
|
230
|
+
if (!present)
|
|
231
|
+
return;
|
|
232
|
+
if (name === JAXON)
|
|
233
|
+
fail("INVALID_ARGUMENT", "Session switch policy does not apply to JaXon", { field: "session_switch" });
|
|
234
|
+
if (!isSessionSwitch(value))
|
|
235
|
+
fail("INVALID_ARGUMENT", `Session switch policy must be one of: ${sessionSwitchValues.join(", ")}`, { field: "session_switch" });
|
|
236
|
+
}
|
|
237
|
+
function applySessionSwitch(name, dir, value) {
|
|
238
|
+
const settings = settingsOf(dir);
|
|
239
|
+
const hasSetting = settings != null && Object.hasOwn(settings, sessionSwitchKey);
|
|
240
|
+
validateSessionSwitch(name, settings?.[sessionSwitchKey], hasSetting);
|
|
241
|
+
if (value === undefined)
|
|
242
|
+
return;
|
|
243
|
+
if (name === JAXON)
|
|
244
|
+
fail("INVALID_ARGUMENT", "Session switch policy does not apply to JaXon", { field: "session_switch" });
|
|
245
|
+
if (value === null && !hasSetting)
|
|
246
|
+
return;
|
|
247
|
+
if (!settings || typeof settings !== "object" || Array.isArray(settings))
|
|
248
|
+
fail("INVALID_ARGUMENT", "settings.json must be an object to set a session switch policy", { field: "session_switch" });
|
|
249
|
+
if (value === null)
|
|
250
|
+
delete settings[sessionSwitchKey];
|
|
251
|
+
else {
|
|
252
|
+
validateSessionSwitch(name, value, true);
|
|
253
|
+
settings[sessionSwitchKey] = value;
|
|
254
|
+
}
|
|
255
|
+
fs.writeFileSync(path.join(dir, "settings.json"), JSON.stringify(settings, null, 2) + "\n");
|
|
256
|
+
}
|
|
212
257
|
function validateRevision(dir) {
|
|
213
258
|
const settings = settingsOf(dir);
|
|
214
259
|
const { connection } = harnessOf(dir);
|
|
@@ -221,7 +266,7 @@ function validateRevision(dir) {
|
|
|
221
266
|
return fail("CONNECTION_PROVIDER_MISMATCH", `${connection} is ${meta.provider}, preset needs ${settings.defaultProvider}`, { connection_id: connection, expected_provider: settings.defaultProvider });
|
|
222
267
|
}
|
|
223
268
|
/** Builds a complete revision off to the side, validates it, then atomically switches CURRENT. */
|
|
224
|
-
function publish(name, fromDir, patch, revNo, populate) {
|
|
269
|
+
function publish(name, fromDir, patch, revNo, populate, sessionSwitch) {
|
|
225
270
|
const dir = presetDir(name);
|
|
226
271
|
const rev = `rev_${String(revNo).padStart(4, "0")}`;
|
|
227
272
|
const tmp = path.join(dir, `.tmp_${rev}_${process.pid}`);
|
|
@@ -237,6 +282,7 @@ function publish(name, fromDir, patch, revNo, populate) {
|
|
|
237
282
|
fs.mkdirSync(tmp, { recursive: true });
|
|
238
283
|
applyPatch(tmp, patch);
|
|
239
284
|
populate?.(tmp);
|
|
285
|
+
applySessionSwitch(name, tmp, sessionSwitch);
|
|
240
286
|
validateRevision(tmp);
|
|
241
287
|
}
|
|
242
288
|
catch (e) {
|
|
@@ -262,7 +308,7 @@ function publish(name, fromDir, patch, revNo, populate) {
|
|
|
262
308
|
}
|
|
263
309
|
return rev;
|
|
264
310
|
}
|
|
265
|
-
function createFrom(name, fromDir, patch, desc) {
|
|
311
|
+
function createFrom(name, fromDir, patch, desc, sessionSwitch) {
|
|
266
312
|
return withPresetLock(name, () => {
|
|
267
313
|
const dir = presetDir(name);
|
|
268
314
|
if (fs.existsSync(path.join(dir, "CURRENT")))
|
|
@@ -270,14 +316,14 @@ function createFrom(name, fromDir, patch, desc) {
|
|
|
270
316
|
const presetId = `pst_${randomUUID().replace(/-/g, "")}`;
|
|
271
317
|
fs.mkdirSync(dir, { recursive: true });
|
|
272
318
|
try {
|
|
273
|
-
const rev = publish(name, fromDir, patch, 1);
|
|
319
|
+
const rev = publish(name, fromDir, patch, 1, undefined, sessionSwitch);
|
|
274
320
|
fs.writeFileSync(path.join(dir, "PRESET_ID"), presetId + "\n");
|
|
275
321
|
fs.writeFileSync(descriptionFile(name), desc.trim() + "\n");
|
|
276
322
|
const cred = path.join(dir, "credentials");
|
|
277
323
|
fs.mkdirSync(cred, { recursive: true, mode: 0o700 });
|
|
278
324
|
if (!fs.existsSync(path.join(cred, "mcp-auth.json")))
|
|
279
325
|
fs.writeFileSync(path.join(cred, "mcp-auth.json"), "{}", { mode: 0o600 });
|
|
280
|
-
return { name, preset_id: presetId, revision: rev };
|
|
326
|
+
return { name, preset_id: presetId, revision: rev, ...sessionSwitchFields(name, path.join(dir, "revisions", rev)) };
|
|
281
327
|
}
|
|
282
328
|
catch (e) {
|
|
283
329
|
fs.rmSync(dir, { recursive: true, force: true });
|
|
@@ -285,8 +331,8 @@ function createFrom(name, fromDir, patch, desc) {
|
|
|
285
331
|
}
|
|
286
332
|
});
|
|
287
333
|
}
|
|
288
|
-
export function createPreset(name, patch, desc) {
|
|
289
|
-
return createFrom(name, null, patch, desc);
|
|
334
|
+
export function createPreset(name, patch, desc, sessionSwitch) {
|
|
335
|
+
return createFrom(name, null, patch, desc, sessionSwitch);
|
|
290
336
|
}
|
|
291
337
|
export async function duplicatePreset(source, name, o) {
|
|
292
338
|
const src = current(source, o.from_revision);
|
|
@@ -309,7 +355,7 @@ export async function duplicatePreset(source, name, o) {
|
|
|
309
355
|
if (custom.modelsJson && !patch["models.json"])
|
|
310
356
|
patch["models.json"] = custom.modelsJson;
|
|
311
357
|
}
|
|
312
|
-
const result = await createFrom(name, src.dir, patch, o.description ?? description(source));
|
|
358
|
+
const result = await createFrom(name, src.dir, patch, o.description ?? description(source), o.session_switch);
|
|
313
359
|
let mcpAuth = [];
|
|
314
360
|
try {
|
|
315
361
|
mcpAuth = Object.keys(readJson(path.join(mcpCredentialSource(source, src.presetId), "mcp-auth.json"), {}));
|
|
@@ -317,16 +363,17 @@ export async function duplicatePreset(source, name, o) {
|
|
|
317
363
|
catch { }
|
|
318
364
|
return { ...result, not_copied: { mcp_auth: mcpAuth } };
|
|
319
365
|
}
|
|
320
|
-
export function updatePresetRevision(name, patch, expectedRev, desc, fromRevision) {
|
|
366
|
+
export function updatePresetRevision(name, patch, expectedRev, desc, fromRevision, sessionSwitch) {
|
|
321
367
|
return withPresetLock(name, () => {
|
|
322
368
|
const cur = current(name);
|
|
323
369
|
if (expectedRev && expectedRev !== cur.rev)
|
|
324
370
|
fail("REVISION_CONFLICT", `current is ${cur.rev}`);
|
|
325
371
|
const base = fromRevision ? current(name, fromRevision) : cur;
|
|
372
|
+
const rev = Object.keys(patch).length || fromRevision || sessionSwitch !== undefined
|
|
373
|
+
? publish(name, base.dir, patch, Number(cur.rev.slice(4)) + 1, undefined, sessionSwitch) : cur.rev;
|
|
326
374
|
if (desc !== undefined)
|
|
327
375
|
writeAtomic(descriptionFile(name), desc.trim() + "\n");
|
|
328
|
-
|
|
329
|
-
return { name, preset_id: cur.presetId, revision: rev, description: description(name) };
|
|
376
|
+
return { name, preset_id: cur.presetId, revision: rev, description: description(name), ...sessionSwitchFields(name) };
|
|
330
377
|
});
|
|
331
378
|
}
|
|
332
379
|
export function listMcpServers(name, revision) {
|
|
@@ -433,6 +480,14 @@ export function snapshotRevision(name, targetDir, revision) {
|
|
|
433
480
|
const cur = current(name, revision);
|
|
434
481
|
fs.rmSync(targetDir, { recursive: true, force: true });
|
|
435
482
|
fs.cpSync(cur.dir, targetDir, { recursive: true, verbatimSymlinks: true });
|
|
483
|
+
// Only JaXon uses this key. Keep it out of Pi's runtime settings, including probe snapshots.
|
|
484
|
+
const settings = settingsOf(targetDir);
|
|
485
|
+
if (settings != null && Object.hasOwn(settings, sessionSwitchKey)) {
|
|
486
|
+
delete settings[sessionSwitchKey];
|
|
487
|
+
const file = path.join(targetDir, "settings.json");
|
|
488
|
+
fs.rmSync(file);
|
|
489
|
+
fs.writeFileSync(file, JSON.stringify(settings, null, 2) + "\n");
|
|
490
|
+
}
|
|
436
491
|
if (!revision || read(path.join(presetDir(name), "CURRENT")) === revision)
|
|
437
492
|
overlaySkills(cur.dir, targetDir);
|
|
438
493
|
const { connection } = harnessOf(cur.dir);
|
|
@@ -2,6 +2,7 @@ import { adminScope } from "./admin-scope.js";
|
|
|
2
2
|
import * as net from "node:net";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { Type } from "typebox";
|
|
5
|
+
import { sessionSwitchValues } from "./session-switch.js";
|
|
5
6
|
import { computeFingerprint } from "../daemon/fingerprint.js";
|
|
6
7
|
import { RELEASE } from "../root.js";
|
|
7
8
|
// Old daemons only check client fingerprints on MCP connections.
|
|
@@ -70,21 +71,22 @@ export default function jaxonAdmin(pi) {
|
|
|
70
71
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], details: {} };
|
|
71
72
|
},
|
|
72
73
|
});
|
|
74
|
+
const session_switch = Type.Optional(Type.Union([...sessionSwitchValues.map(value => Type.Literal(value)), Type.Null()], { description: "How much context redundancy this role tolerates. Null clears it to Balanced. Not applicable to JaXon." }));
|
|
73
75
|
tool("agent_list", "List presets with connections and readiness.", Type.Object({}));
|
|
74
76
|
tool("agent_get", "Get a preset's redacted files, revisions and readiness.", Type.Object({ name: Type.String() }));
|
|
75
77
|
tool("agent_create", "Create a preset. A connection is optional but required before it can become ready.", Type.Object({
|
|
76
78
|
name: Type.String(), description: Type.String(), provider: Type.Optional(Type.String()), model: Type.Optional(Type.String()),
|
|
77
79
|
connection: Type.Optional(Type.Union([Type.String(), Type.Null()])), thinking: Type.Optional(Type.String()),
|
|
78
|
-
tools: Type.Optional(Type.Array(Type.String())), instructions: Type.Optional(Type.String()), files: Type.Optional(Patch),
|
|
80
|
+
tools: Type.Optional(Type.Array(Type.String())), instructions: Type.Optional(Type.String()), files: Type.Optional(Patch), session_switch,
|
|
79
81
|
}));
|
|
80
82
|
tool("agent_duplicate", "Duplicate a preset with optional overrides. Shared model auth is reused; MCP auth is not copied.", Type.Object({
|
|
81
83
|
source: Type.String(), name: Type.String(), description: Type.Optional(Type.String()), from_revision: Type.Optional(Type.String()),
|
|
82
84
|
instructions: Type.Optional(Type.String()), tools: Type.Optional(Type.Array(Type.String())), thinking: Type.Optional(Type.String()),
|
|
83
|
-
model: Type.Optional(Type.String()), connection: Type.Optional(Type.Union([Type.String(), Type.Null()])), patch: Type.Optional(Patch),
|
|
85
|
+
model: Type.Optional(Type.String()), connection: Type.Optional(Type.Union([Type.String(), Type.Null()])), patch: Type.Optional(Patch), session_switch,
|
|
84
86
|
}));
|
|
85
87
|
tool("agent_update", "Publish a revision, change description/connection, or roll back from_revision.", Type.Object({
|
|
86
88
|
name: Type.String(), patch: Type.Optional(Patch), description: Type.Optional(Type.String()),
|
|
87
|
-
connection: Type.Optional(Type.Union([Type.String(), Type.Null()])), from_revision: Type.Optional(Type.String()), expected_rev: Type.Optional(Type.String()),
|
|
89
|
+
connection: Type.Optional(Type.Union([Type.String(), Type.Null()])), from_revision: Type.Optional(Type.String()), expected_rev: Type.Optional(Type.String()), session_switch,
|
|
88
90
|
}));
|
|
89
91
|
tool("agent_delete", "Delete a non-JaXon preset.", Type.Object({ name: Type.String(), expected_rev: Type.Optional(Type.String()) }));
|
|
90
92
|
tool("agent_test", "Run or await a real Pi readiness test.", Type.Object({ name: Type.String(), wait_ms: Type.Optional(Type.Number()) }));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const sessionSwitchKey = "jaxonSessionSwitch";
|
|
2
|
+
export const sessionSwitchValues = ["strictly_eager", "eager", "balanced", "conservative"];
|
|
3
|
+
export const defaultSessionSwitch = "balanced";
|
|
4
|
+
export function isSessionSwitch(value) {
|
|
5
|
+
return sessionSwitchValues.some(choice => choice === value);
|
|
6
|
+
}
|