aiterm-mcp 0.63.10 → 0.63.11
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/CHANGELOG.md +7 -1
- package/README.ja.md +6 -1
- package/README.md +6 -1
- package/dist/agent-goal.js +4 -3
- package/dist/execution-dispatch.js +16 -13
- package/dist/execution-native-server.js +1 -1
- package/dist/execution-participant.js +2 -1
- package/dist/execution-wire.js +4 -3
- package/dist/host-controller.js +18 -0
- package/dist/index.js +7 -7
- package/dist/interim-words.js +13 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.63.11] - 2026-11-06
|
|
11
|
+
|
|
12
|
+
- Let any MCP client opt into existing host-controller routing with the initialize experimental capability `io.github.kitepon/aiterm-mcp/host-controller: {}`. The exact `bellteam` client name remains a backward-compatible alias; undeclared clients retain ordinary direct routing.
|
|
13
|
+
- Use the initialized controller name for interim/follow metadata opt-in, with a generic fallback and the existing `BellTeam` marker retained for compatibility. This is routing identity, not authentication; all generation/source/effect guards and resume-only wire contracts remain unchanged.
|
|
14
|
+
|
|
10
15
|
## [0.63.10] - 2026-11-06
|
|
11
16
|
|
|
12
17
|
- Resume a killed working Codex conversation whose native metadata has not yet bound its vendor ID, using only its unique launch-marked, cwd-matching, non-fork, complete retained root rollout and same-turn settings.
|
|
@@ -3053,7 +3058,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
|
|
|
3053
3058
|
`ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
|
|
3054
3059
|
provenance.
|
|
3055
3060
|
|
|
3056
|
-
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.
|
|
3061
|
+
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.11...HEAD
|
|
3062
|
+
[0.63.11]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.10...v0.63.11
|
|
3057
3063
|
[0.63.10]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.9...v0.63.10
|
|
3058
3064
|
[0.63.9]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.8...v0.63.9
|
|
3059
3065
|
[0.63.8]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.7...v0.63.8
|
package/README.ja.md
CHANGED
|
@@ -215,7 +215,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
|
|
|
215
215
|
場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
|
|
216
216
|
Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
|
|
217
217
|
|
|
218
|
-
**状態:** 開発継続中 · 現行公開版 **v0.63.
|
|
218
|
+
**状態:** 開発継続中 · 現行公開版 **v0.63.11** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
|
|
219
219
|
|
|
220
220
|
### 更新と巻き戻し
|
|
221
221
|
|
|
@@ -889,3 +889,8 @@ Grok 1.0.70のLinux読取は公式active_sessions.jsonのPID・開始tick・cwd
|
|
|
889
889
|
対象はLinux/Codex。明示した永続保存先 `AITERM_STATE_BASE`、同じUIDと絶対パス、元のCodex会話記録の保持が必要。呼出側は保存前に元runtimeの全書込processを停止し、再起動を防ぐ。復元は新runtimeの起動時排他を取得してから、通常の初期化やnative起動より前に行う。保存成功は全process停止の証明にはならない。
|
|
890
890
|
|
|
891
891
|
初回更新で既に失われた旧tmpfsの状態と、未配送の回答は復元しない。通常の初期化後に復元入力を再使用しない。復元した保存先を旧版へそのまま戻さず、互換性のある別の保存先と会話の控えを使うか、利用者が明示して状態を初期化する。詳細は[保存・復元の契約と図](https://github.com/kitepon/aiterm-mcp/blob/v0.63.3/docs/architecture/resume-checkpoint.md)と[更新・巻き戻し条件](CHANGELOG.md)を参照する。
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
### Host-controller clients
|
|
895
|
+
|
|
896
|
+
Any MCP client can opt into the existing host-orchestration routing by declaring `capabilities.experimental["io.github.kitepon/aiterm-mcp/host-controller"] = {}` during initialize. This is routing identity, not authentication; source, generation, native identity and effect guards still apply. Clients without that declaration stay on the ordinary direct path. The exact client name `bellteam` remains a backward-compatible alias. A declared controller requests interim/follow metadata with `_meta["aiterm/caller"]` equal to its initialized client name (blank/missing name: `MCP client`); the old `BellTeam` marker is also preserved for compatibility. See [function map and data flow](https://github.com/kitepon/aiterm-mcp/blob/main/docs/architecture/host-controller.md). BellTeam's own caller can adopt the capability later; that migration is separate from this release.
|
package/README.md
CHANGED
|
@@ -227,7 +227,7 @@ collection is off by default and performs no network I/O. It ships via
|
|
|
227
227
|
tag-triggered CI with npm provenance (OIDC Trusted Publishing); the GitHub
|
|
228
228
|
Release re-registers the Official MCP Registry entry.
|
|
229
229
|
|
|
230
|
-
**Status:** actively maintained · current public release **v0.63.
|
|
230
|
+
**Status:** actively maintained · current public release **v0.63.11** · runs on Linux · WSL2 · macOS · native Windows (tmux on POSIX, the tmux-CLI-compatible [psmux](https://github.com/psmux/psmux) on native Windows — no WSL required) · MIT · see the [CHANGELOG](CHANGELOG.md).
|
|
231
231
|
|
|
232
232
|
### Update and rollback
|
|
233
233
|
|
|
@@ -956,3 +956,8 @@ The Linux Grok 1.0.70 inspector binds the native current-session registry to the
|
|
|
956
956
|
### Offline resume checkpoint
|
|
957
957
|
|
|
958
958
|
`aiterm-resume-state checkpoint --session ID --launch LAUNCH` emits a private bundle on stdout and a safe receipt on stderr. `aiterm-resume-state restore --session ID --launch LAUNCH --sha256 SHA` reads that bundle on stdin and emits its receipt on stdout. This Linux/Codex scope requires the explicit persistent `AITERM_STATE_BASE`, the same UID/absolute paths and retained vendor rollout identity. The caller must stop all source writers and prevent restart before checkpoint; restore runs under startup admission before bootstrap or native startup. It does not recover already-lost legacy tmpfs state or migrate pending deliveries. The bundle is limited to 16 MiB including LF; the safe receipt is at most 512 bytes. Success exits 0; refusal exits 2 with `aiterm: RESUME_STATE_UNCONFIRMED` plus LF (33 bytes). See the [contract and diagram](https://github.com/kitepon/aiterm-mcp/blob/v0.63.3/docs/architecture/resume-checkpoint.md).
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
### Host-controller clients
|
|
962
|
+
|
|
963
|
+
Any MCP client can opt into the existing host-orchestration routing by declaring `capabilities.experimental["io.github.kitepon/aiterm-mcp/host-controller"] = {}` during initialize. This is routing identity, not authentication; source, generation, native identity and effect guards still apply. Clients without that declaration stay on the ordinary direct path. The exact client name `bellteam` remains a backward-compatible alias. A declared controller requests interim/follow metadata with `_meta["aiterm/caller"]` equal to its initialized client name (blank/missing name: `MCP client`); the old `BellTeam` marker is also preserved for compatibility. See [function map and data flow](https://github.com/kitepon/aiterm-mcp/blob/main/docs/architecture/host-controller.md). BellTeam's own caller can adopt the capability later; that migration is separate from this release.
|
package/dist/agent-goal.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isHostControllerClient } from "./host-controller.js";
|
|
1
2
|
// Goal state belongs to the CLI. This module holds no goal store or loop.
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { executionLaunchSchema } from "./execution-contract.js";
|
|
@@ -19,10 +20,10 @@ export const agentGoalInputSchema = agentGoalInputObject.superRefine((value, con
|
|
|
19
20
|
export const GOAL_HOST_META_KEY = "aiterm/goal";
|
|
20
21
|
const hostOrigin = z.object({ origin: z.literal("user") }).strict();
|
|
21
22
|
/** Host provenance on the existing local MCP channel, not authentication.
|
|
22
|
-
*
|
|
23
|
+
* The controller must authenticate the user and reject seat ingress before stamping
|
|
23
24
|
* this metadata. A model client's metadata never upgrades its origin. */
|
|
24
|
-
export function goalOriginFromHost(clientName, meta) {
|
|
25
|
-
if (clientName
|
|
25
|
+
export function goalOriginFromHost(clientName, meta, capabilities) {
|
|
26
|
+
if (!isHostControllerClient(clientName, capabilities) || !meta || typeof meta !== "object")
|
|
26
27
|
return "automatic";
|
|
27
28
|
return hostOrigin.safeParse(meta[GOAL_HOST_META_KEY]).success ? "user" : "automatic";
|
|
28
29
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isHostControllerClient } from "./host-controller.js";
|
|
1
2
|
// Request-local adapter for the serving stdio dispatcher. No live I/O, core
|
|
2
3
|
// imports or public mount at import. Uncovered ordinary/native/remote targets
|
|
3
4
|
// fail before the handler; they must acquire their own generation adapter.
|
|
@@ -124,9 +125,9 @@ export function createExecutionDispatcher(bindings) {
|
|
|
124
125
|
if (service !== bindings.service)
|
|
125
126
|
throw new ExecutionError("EXECUTION_UNSUPPORTED");
|
|
126
127
|
bindings.assertParticipant?.();
|
|
127
|
-
return { sourceContext: extra => executionHostSourceFromMeta(extra._meta, bindings.initializedClientName()),
|
|
128
|
+
return { sourceContext: extra => executionHostSourceFromMeta(extra._meta, bindings.initializedClientName(), bindings.initializedClientCapabilities?.()),
|
|
128
129
|
closeManagementRequest: (extra, session) => {
|
|
129
|
-
if (!registeredControls || !native || bindings.initializedClientName()
|
|
130
|
+
if (!registeredControls || !native || !isHostControllerClient(bindings.initializedClientName(), bindings.initializedClientCapabilities?.()))
|
|
130
131
|
throw new ExecutionError("EXECUTION_UNSUPPORTED");
|
|
131
132
|
return executionRequestSchema.options[4].parse({ kind: "mcp", process_pid: native.pid,
|
|
132
133
|
process_started_identity: native.started_identity, request_id: extra.requestId,
|
|
@@ -148,7 +149,7 @@ export function createExecutionDispatcher(bindings) {
|
|
|
148
149
|
throw new ExecutionError("EXECUTION_UNSUPPORTED");
|
|
149
150
|
// Only the same server's registered typed handlers run here. They
|
|
150
151
|
// already own metadata admission/stop; no synthetic send edge/frame.
|
|
151
|
-
executionHostSourceFromMeta(fixedExtra._meta, bindings.initializedClientName());
|
|
152
|
+
executionHostSourceFromMeta(fixedExtra._meta, bindings.initializedClientName(), bindings.initializedClientCapabilities?.());
|
|
152
153
|
return await body(args, fixedExtra);
|
|
153
154
|
}
|
|
154
155
|
if (name === "agent_auth" && (args.action !== "status" || args.session_id !== undefined) && !observeAuth)
|
|
@@ -162,7 +163,9 @@ export function createExecutionDispatcher(bindings) {
|
|
|
162
163
|
if (!route)
|
|
163
164
|
return await body(args, fixedExtra);
|
|
164
165
|
const client = bindings.initializedClientName();
|
|
165
|
-
const
|
|
166
|
+
const capabilities = bindings.initializedClientCapabilities?.();
|
|
167
|
+
const controller = isHostControllerClient(client, capabilities);
|
|
168
|
+
const host = executionHostSourceFromMeta(fixedExtra._meta, client, capabilities);
|
|
166
169
|
const source = host !== undefined ? host.source : directSource;
|
|
167
170
|
// Partial/mismatched stdio identity is not an independent operator.
|
|
168
171
|
if (host === undefined && sourceFieldsPresent && !source)
|
|
@@ -171,22 +174,22 @@ export function createExecutionDispatcher(bindings) {
|
|
|
171
174
|
const supplied = executionRefFromMeta(fixedExtra._meta);
|
|
172
175
|
// A host's explicit session close is a management RPC with its own
|
|
173
176
|
// existing process/request identity, not a delivery or resend.
|
|
174
|
-
const hostClose =
|
|
175
|
-
const hostLaunch =
|
|
177
|
+
const hostClose = controller && route.tool === "pty_close" && !supplied;
|
|
178
|
+
const hostLaunch = controller && route.tool === "agent_launch" && !supplied
|
|
176
179
|
&& args.prompt == null && args.throughline_source_session === undefined;
|
|
177
|
-
const hostConfigure =
|
|
180
|
+
const hostConfigure = controller && route.tool === "agent_configure" && !supplied;
|
|
178
181
|
const authOperation = name === "agent_auth";
|
|
179
182
|
const authInput = (route.tool === "pty_send" || route.tool === "pty_key") && !supplied
|
|
180
|
-
&&
|
|
181
|
-
const hostAuth =
|
|
182
|
-
const hostGoal =
|
|
183
|
+
&& controller ? authGeneration(route.target) : null;
|
|
184
|
+
const hostAuth = controller && !supplied && authOperation;
|
|
185
|
+
const hostGoal = controller && route.tool === "agent_goal" && !supplied;
|
|
183
186
|
const hostManagement = hostClose || hostLaunch || hostConfigure || hostGoal || hostAuth || !!authInput;
|
|
184
187
|
if (args.remote !== undefined && args.remote !== null)
|
|
185
188
|
throw new ExecutionError("EXECUTION_UNSUPPORTED");
|
|
186
189
|
let reference = supplied;
|
|
187
190
|
let directRequest = null;
|
|
188
191
|
let frozenParent = null;
|
|
189
|
-
if (!reference && (
|
|
192
|
+
if (!reference && (!controller || hostManagement) && native) {
|
|
190
193
|
directRequest = executionRequestSchema.options[4].parse({ kind: "mcp", process_pid: native.pid,
|
|
191
194
|
process_started_identity: native.started_identity, request_id: fixedExtra.requestId,
|
|
192
195
|
tool: route.tool, target_session_id: route.target });
|
|
@@ -207,7 +210,7 @@ export function createExecutionDispatcher(bindings) {
|
|
|
207
210
|
// External host refs are created by the real Bridge ingress. Direct
|
|
208
211
|
// model requests cannot borrow another call's reservation or choose
|
|
209
212
|
// a native control label to suppress an invocation edge.
|
|
210
|
-
if (
|
|
213
|
+
if (!controller || reference.request.kind === "mcp"
|
|
211
214
|
|| (route.tool !== "agent_launch" && route.tool !== "pty_send"))
|
|
212
215
|
throw new ExecutionError("EXECUTION_UNSUPPORTED");
|
|
213
216
|
const record = await bindings.service.execute({ action: "status", request: reference.request });
|
|
@@ -227,7 +230,7 @@ export function createExecutionDispatcher(bindings) {
|
|
|
227
230
|
}
|
|
228
231
|
else {
|
|
229
232
|
// BellTeam must retain its existing delivery/room/call reference.
|
|
230
|
-
if ((
|
|
233
|
+
if ((controller && !hostManagement) || !directRequest)
|
|
231
234
|
throw new ExecutionError("EXECUTION_UNSUPPORTED");
|
|
232
235
|
const current = await observe(route.target);
|
|
233
236
|
if (authOperation && route.tool !== "agent_auth.start") {
|
|
@@ -32,7 +32,7 @@ export function createNativeDeliveryServer(dependencies = {}) {
|
|
|
32
32
|
sendKey: dependencies.sendKey ?? core.interruptSessionNow,
|
|
33
33
|
};
|
|
34
34
|
const result = args.pause_goals
|
|
35
|
-
? await interruptKnownSessionsAndGoals(args, { ...stop, pauseGoal: dependencies.pauseGoal ?? core.pauseAgentGoalForStop }, dependencies.goalOrigin ? dependencies.goalOrigin(extra) : goalOriginFromHost(server.server.getClientVersion()?.name, extra._meta))
|
|
35
|
+
? await interruptKnownSessionsAndGoals(args, { ...stop, pauseGoal: dependencies.pauseGoal ?? core.pauseAgentGoalForStop }, dependencies.goalOrigin ? dependencies.goalOrigin(extra) : goalOriginFromHost(server.server.getClientVersion()?.name, extra._meta, server.server.getClientCapabilities()))
|
|
36
36
|
: interruptKnownSessions(args, stop);
|
|
37
37
|
return { content: [{ type: "text", text: JSON.stringify(result) }], structuredContent: result };
|
|
38
38
|
});
|
|
@@ -70,7 +70,8 @@ export function createExecutionParticipant(input) {
|
|
|
70
70
|
const server = createAitermServer({ execution: server => {
|
|
71
71
|
assertScope();
|
|
72
72
|
dispatcher = createExecutionDispatcher({ service: producer.service, nativeIdentity: actor, sourceEnvironment,
|
|
73
|
-
initializedClientName: () => server.server.getClientVersion()?.name,
|
|
73
|
+
initializedClientName: () => server.server.getClientVersion()?.name,
|
|
74
|
+
initializedClientCapabilities: () => server.server.getClientCapabilities(), observeSessionGeneration, assertParticipant: assertScope, captureNativeParent,
|
|
74
75
|
...(producer.startup.selectAuthSessionName ? { selectAuthSessionName: producer.startup.selectAuthSessionName } : {}),
|
|
75
76
|
...(producer.startup.observeAuthSessionGeneration ? { observeAuthSessionGeneration: producer.startup.observeAuthSessionGeneration } : {}) });
|
|
76
77
|
return { dispatcher, parentExecution: producer.execution, parentDependencies, parentStateRoot: producer.scope.state_root };
|
package/dist/execution-wire.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isHostControllerClient } from "./host-controller.js";
|
|
1
2
|
// Versioned Bridge/MCP contract. No dependency on core, PTY or the tool server.
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { executionLaunchSchema, executionPointSchema, executionRequestSchema, executionReservationSchema, executionRelationSchema, executionPhaseSchema, cascadeStopRequestSchema, cascadeStopResultSchema, executionNativeBindingSchema } from "./execution-contract.js";
|
|
@@ -10,12 +11,12 @@ export const executionTransportSourceSchema = z.object({
|
|
|
10
11
|
schema: z.literal("aiterm.execution-source.v1"), source: executionPointSchema.nullable(),
|
|
11
12
|
}).strict();
|
|
12
13
|
/** Local host correlation, not client authentication. The product mount calls
|
|
13
|
-
* this with
|
|
14
|
+
* this with initialized client identity/capabilities, never a tool argument. Direct CLI
|
|
14
15
|
* callers use their fixed stdio environment; they cannot override it here.
|
|
15
16
|
*/
|
|
16
|
-
export function executionHostSourceFromMeta(meta, clientName) {
|
|
17
|
+
export function executionHostSourceFromMeta(meta, clientName, capabilities) {
|
|
17
18
|
const value = meta && typeof meta === "object" ? meta[EXECUTION_SOURCE_META_KEY] : undefined;
|
|
18
|
-
if (clientName
|
|
19
|
+
if (!isHostControllerClient(clientName, capabilities)) {
|
|
19
20
|
if (value !== undefined)
|
|
20
21
|
throw new ExecutionError("EXECUTION_UNSUPPORTED");
|
|
21
22
|
return undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Initialize-time routing declaration, never authentication or native-effect proof. */
|
|
2
|
+
export const HOST_CONTROLLER_CAPABILITY = "io.github.kitepon/aiterm-mcp/host-controller";
|
|
3
|
+
export const LEGACY_HOST_CONTROLLER_NAME = "bellteam";
|
|
4
|
+
export const LEGACY_INTERIM_CALLER = "BellTeam";
|
|
5
|
+
export function isHostControllerClient(name, capabilities) {
|
|
6
|
+
if (name === LEGACY_HOST_CONTROLLER_NAME)
|
|
7
|
+
return true;
|
|
8
|
+
if (!capabilities || typeof capabilities !== "object")
|
|
9
|
+
return false;
|
|
10
|
+
const experimental = capabilities.experimental;
|
|
11
|
+
if (!experimental || typeof experimental !== "object")
|
|
12
|
+
return false;
|
|
13
|
+
const role = experimental[HOST_CONTROLLER_CAPABILITY];
|
|
14
|
+
return role !== null && typeof role === "object" && !Array.isArray(role);
|
|
15
|
+
}
|
|
16
|
+
export function hostControllerLabel(name) {
|
|
17
|
+
return name?.trim() ? name : "MCP client";
|
|
18
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -475,9 +475,9 @@ export function createAitermServer(options = {}) {
|
|
|
475
475
|
delivery = await deliveryForRequest(extra);
|
|
476
476
|
// BellTeamのため(ADR 0122): 差し込みになった時、その文を取った番の終わりを待つ手がかりを返す。印の無い呼び手には何も足さない。
|
|
477
477
|
const receipt = await core.sendAgentMessage(session_id, core.attachImages(text, image), { raw, before_send: delivery?.before_send, preface,
|
|
478
|
-
follow: interimCallerFromMeta(extra._meta) });
|
|
478
|
+
follow: interimCallerFromMeta(extra._meta, server.server.getClientVersion()?.name, server.server.getClientCapabilities()) });
|
|
479
479
|
if (receipt.schema === "aiterm.agent-steer.v1") {
|
|
480
|
-
const follow = interimCallerFromMeta(extra._meta) ? receipt.follow ?? null : null;
|
|
480
|
+
const follow = interimCallerFromMeta(extra._meta, server.server.getClientVersion()?.name, server.server.getClientCapabilities()) ? receipt.follow ?? null : null;
|
|
481
481
|
return {
|
|
482
482
|
content: [
|
|
483
483
|
{
|
|
@@ -748,10 +748,10 @@ export function createAitermServer(options = {}) {
|
|
|
748
748
|
return fail(e);
|
|
749
749
|
}
|
|
750
750
|
});
|
|
751
|
-
//
|
|
751
|
+
// Declared controller caller markers opt into current-turn metadata (ADR 0122).
|
|
752
752
|
// 説明と引数には出さない(steer-follow.ts の冒頭)。それ以外の呼び手には何も足さない。
|
|
753
753
|
function seatTurnsMeta(sessions, requestMeta) {
|
|
754
|
-
if (!interimCallerFromMeta(requestMeta))
|
|
754
|
+
if (!interimCallerFromMeta(requestMeta, server.server.getClientVersion()?.name, server.server.getClientCapabilities()))
|
|
755
755
|
return {};
|
|
756
756
|
try {
|
|
757
757
|
return { _meta: { [SEAT_TURNS_RESULT_META_KEY]: core.readSeatTurns(sessions.filter(session => session.harness !== null).map(session => session.session_id)) } };
|
|
@@ -795,10 +795,10 @@ export function createAitermServer(options = {}) {
|
|
|
795
795
|
return fail(e);
|
|
796
796
|
}
|
|
797
797
|
});
|
|
798
|
-
//
|
|
798
|
+
// Declared controller caller markers opt into interim words.
|
|
799
799
|
// 説明と引数には出さない(interim-words.ts の冒頭)。それ以外の呼び手には何も足さない。
|
|
800
800
|
function interimWordsMeta(sessionId, requestMeta) {
|
|
801
|
-
const request = interimRequestFromMeta(requestMeta);
|
|
801
|
+
const request = interimRequestFromMeta(requestMeta, server.server.getClientVersion()?.name, server.server.getClientCapabilities());
|
|
802
802
|
if (!request)
|
|
803
803
|
return {};
|
|
804
804
|
try {
|
|
@@ -989,7 +989,7 @@ export function createAitermServer(options = {}) {
|
|
|
989
989
|
outputSchema: agentGoalOutputSchema,
|
|
990
990
|
}, async (args, extra) => {
|
|
991
991
|
try {
|
|
992
|
-
const origin = goalOrigin ? goalOrigin(extra) : goalOriginFromHost(server.server.getClientVersion()?.name, extra._meta);
|
|
992
|
+
const origin = goalOrigin ? goalOrigin(extra) : goalOriginFromHost(server.server.getClientVersion()?.name, extra._meta, server.server.getClientCapabilities());
|
|
993
993
|
if (origin !== "user" && origin !== "automatic")
|
|
994
994
|
throw new Error("Invalid trusted goal provenance");
|
|
995
995
|
const result = agentGoalWireResultSchema.parse(await core.agentGoal(agentGoalInputSchema.parse(args), origin));
|
package/dist/interim-words.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// 利用者向けのツール説明と引数には出さない(BellTeam以外のAIに指定させないため)。要らないものと見て消さないこと。
|
|
5
|
-
//
|
|
6
|
-
// 最後の回答と思考は含めない。APIエラーやsession limitの知らせは、記録に書かれていれば含める。
|
|
1
|
+
import { isHostControllerClient, hostControllerLabel, LEGACY_INTERIM_CALLER } from "./host-controller.js";
|
|
2
|
+
// Controller-requested interim words; final answers and thinking are excluded.
|
|
3
|
+
// See docs/architecture/host-controller.md for the initialize role and caller marker.
|
|
7
4
|
// ハーネスごとの見分け方(2026-09-28 記録で確認):
|
|
8
5
|
// Claude Code: text block で message.stop_reason="tool_use"。isApiErrorMessage の行は知らせ。
|
|
9
6
|
// Codex: assistant message の phase="commentary"。task_complete の error はturnを終えた知らせ。
|
|
@@ -17,9 +14,8 @@ import { claudeSessionTranscriptPath } from "./harnesses/claude.js";
|
|
|
17
14
|
import { codexBoundTranscript, codexRootTranscript, codexResumeCursor, codexResumeTurnId, codexTurnError, codexTurnErrorLine } from "./harnesses/codex.js";
|
|
18
15
|
import { grokSessionDirectory } from "./harnesses/grok.js";
|
|
19
16
|
import { cursorTranscript } from "./harnesses/cursor.js";
|
|
20
|
-
/**
|
|
17
|
+
/** Controller caller label in request metadata; see host-controller.md. */
|
|
21
18
|
export const INTERIM_CALLER_META_KEY = "aiterm/caller";
|
|
22
|
-
export const INTERIM_CALLER = "BellTeam";
|
|
23
19
|
/** 前回受け取った最後のseq。これより後の言葉だけを返す。 */
|
|
24
20
|
export const INTERIM_AFTER_META_KEY = "aiterm/interim_after";
|
|
25
21
|
/** 結果の_metaで返すキー。 */
|
|
@@ -46,17 +42,20 @@ export function agentInterimBoundaryPath(name, launchId) {
|
|
|
46
42
|
throw new AitermError(`launch_id が不正です: ${launchId}`, 2);
|
|
47
43
|
return path.join(agentsDir(), `${name}.${launchId}.interim.json`);
|
|
48
44
|
}
|
|
49
|
-
/**
|
|
50
|
-
export function interimCallerFromMeta(meta) {
|
|
51
|
-
|
|
45
|
+
/** Controller name marker, with the historical marker retained for compatibility. */
|
|
46
|
+
export function interimCallerFromMeta(meta, clientName, capabilities) {
|
|
47
|
+
if (!meta || typeof meta !== "object")
|
|
48
|
+
return false;
|
|
49
|
+
const caller = meta[INTERIM_CALLER_META_KEY];
|
|
50
|
+
return caller === LEGACY_INTERIM_CALLER || (isHostControllerClient(clientName, capabilities) && caller === hostControllerLabel(clientName));
|
|
52
51
|
}
|
|
53
52
|
/**
|
|
54
|
-
* 要求の_metaが
|
|
53
|
+
* 要求の_metaがcontrollerの印を持つ時だけ、前回のseqを返す。それ以外はnull(何も足さない)。
|
|
55
54
|
* 読み始める位置(aiterm/interim_from)が付いていれば、fromに入れる。付いているのに読めない時はfromがnullでfrom_invalidがtrue
|
|
56
55
|
* (最後のdispatchの言葉を黙って返すと、呼び手は別の番の言葉を出してしまう)。
|
|
57
56
|
*/
|
|
58
|
-
export function interimRequestFromMeta(meta) {
|
|
59
|
-
if (!interimCallerFromMeta(meta))
|
|
57
|
+
export function interimRequestFromMeta(meta, clientName, capabilities) {
|
|
58
|
+
if (!interimCallerFromMeta(meta, clientName, capabilities))
|
|
60
59
|
return null;
|
|
61
60
|
const record = meta;
|
|
62
61
|
const raw = record[INTERIM_AFTER_META_KEY];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-mcp",
|
|
3
|
-
"version": "0.63.
|
|
3
|
+
"version": "0.63.11",
|
|
4
4
|
"mcpName": "io.github.kitepon/aiterm-mcp",
|
|
5
5
|
"description": "Persistent terminal MCP with one harness-based launcher for Claude Code, Codex CLI, Grok CLI, Cursor Agent CLI, and Antigravity CLI, plus durable PTYs for SSH, containers, and REPLs.",
|
|
6
6
|
"keywords": [
|