@code-yeongyu/senpi-agent-core 2026.11.18-3 → 2026.11.19
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/dist/execution/remote-executor.d.ts +2 -0
- package/dist/execution/remote-executor.js +1 -0
- package/dist/execution/remote-protocol.d.ts +5 -0
- package/dist/execution/remote-protocol.js +2 -1
- package/dist/execution/remote-tool-host.d.ts +2 -0
- package/dist/execution/remote-tool-host.js +2 -0
- package/package.json +3 -3
|
@@ -13,6 +13,8 @@ export interface HandCall {
|
|
|
13
13
|
readonly signal: AbortSignal;
|
|
14
14
|
/** Asks the brain that owns this call (a model-backed tool's completion, S31); fails once the call has ended. */
|
|
15
15
|
readonly nested: NestedRequest;
|
|
16
|
+
/** The issuing session's prompt surface, when it sent one (see `RemoteInvoke.promptSurface`). */
|
|
17
|
+
readonly promptSurface?: string;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* What a hand runs a scope's calls on. `run` owns the whole call: name resolution, argument preparation and
|
|
@@ -103,6 +103,7 @@ export function createRemoteExecutor(options) {
|
|
|
103
103
|
arguments: call.arguments,
|
|
104
104
|
signal: controller.signal,
|
|
105
105
|
nested: planes.requestFor(call.executionId, lane, controller.signal),
|
|
106
|
+
...(call.promptSurface === undefined ? {} : { promptSurface: call.promptSurface }),
|
|
106
107
|
})
|
|
107
108
|
: scope.file === undefined
|
|
108
109
|
? fileRefusal("unsupported", "this hand serves no file channel")
|
|
@@ -76,6 +76,11 @@ export interface RemoteInvoke {
|
|
|
76
76
|
readonly name: string;
|
|
77
77
|
readonly arguments: unknown;
|
|
78
78
|
readonly sessionRef?: string;
|
|
79
|
+
/**
|
|
80
|
+
* The prompt surface of the session that issued the call (`"terminal"`, `"app"`, `"chat"`), so a tool on the hand
|
|
81
|
+
* reports what the session's host does with its result rather than what the hand's own environment says (senpi#6921).
|
|
82
|
+
*/
|
|
83
|
+
readonly promptSurface?: string;
|
|
79
84
|
}
|
|
80
85
|
export interface RemoteAbort {
|
|
81
86
|
readonly kind: "abort";
|
|
@@ -78,7 +78,8 @@ export function decodeRemoteMessage(payload) {
|
|
|
78
78
|
typeof scope.root !== "string" ||
|
|
79
79
|
!isString(value.toolCallId) ||
|
|
80
80
|
!isString(value.name) ||
|
|
81
|
-
(value.sessionRef !== undefined && typeof value.sessionRef !== "string")
|
|
81
|
+
(value.sessionRef !== undefined && typeof value.sessionRef !== "string") ||
|
|
82
|
+
(value.promptSurface !== undefined && typeof value.promptSurface !== "string"))
|
|
82
83
|
throw new RemoteProtocolError("malformed invoke");
|
|
83
84
|
return value;
|
|
84
85
|
}
|
|
@@ -34,6 +34,8 @@ export interface RemoteToolHostOptions {
|
|
|
34
34
|
* Without it, nothing about epochs is sent (a session that never moves).
|
|
35
35
|
*/
|
|
36
36
|
readonly epoch?: number;
|
|
37
|
+
/** The session's prompt surface, read for each batch and sent with every call of it (senpi#6921). */
|
|
38
|
+
readonly promptSurface?: () => string | undefined;
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
41
|
* The ToolHost that runs a session's tool calls on a hand (brain/hand split, S27a). The hand resolves, prepares,
|
|
@@ -56,6 +56,7 @@ export function createRemoteToolHost(options) {
|
|
|
56
56
|
async execute(call, hostOptions) {
|
|
57
57
|
const { emit, signal } = hostOptions;
|
|
58
58
|
const batchId = mintId();
|
|
59
|
+
const promptSurface = options.promptSurface?.();
|
|
59
60
|
const invokeOf = (raw, index) => ({
|
|
60
61
|
kind: "invoke",
|
|
61
62
|
executionId: mintId(),
|
|
@@ -66,6 +67,7 @@ export function createRemoteToolHost(options) {
|
|
|
66
67
|
name: raw.name,
|
|
67
68
|
arguments: raw.arguments,
|
|
68
69
|
...(options.sessionRef === undefined ? {} : { sessionRef: options.sessionRef }),
|
|
70
|
+
...(promptSurface === undefined ? {} : { promptSurface }),
|
|
69
71
|
});
|
|
70
72
|
const finish = async (raw, result) => {
|
|
71
73
|
await emit({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-agent-core",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.19",
|
|
4
4
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@earendil-works/chord": "0.99.1",
|
|
79
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.
|
|
80
|
-
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.11.
|
|
79
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.19",
|
|
80
|
+
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.11.19",
|
|
81
81
|
"diff": "9.0.0",
|
|
82
82
|
"ignore": "7.0.9",
|
|
83
83
|
"typebox": "1.3.34",
|