@namzu/sdk 26.0.0 → 26.1.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/CHANGELOG.md +68 -0
- package/dist/connector/mcp/index.d.ts +1 -0
- package/dist/connector/mcp/index.d.ts.map +1 -1
- package/dist/connector/mcp/index.js +3 -0
- package/dist/connector/mcp/index.js.map +1 -1
- package/dist/connector/mcp/server-stdio.d.ts +62 -0
- package/dist/connector/mcp/server-stdio.d.ts.map +1 -0
- package/dist/connector/mcp/server-stdio.js +121 -0
- package/dist/connector/mcp/server-stdio.js.map +1 -0
- package/dist/session/workspace/git-worktree.d.ts +15 -0
- package/dist/session/workspace/git-worktree.d.ts.map +1 -1
- package/dist/session/workspace/git-worktree.js +55 -1
- package/dist/session/workspace/git-worktree.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +35 -0
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/coordinator/agent.d.ts.map +1 -1
- package/dist/tools/coordinator/agent.js +12 -0
- package/dist/tools/coordinator/agent.js.map +1 -1
- package/dist/tools/coordinator/index.d.ts.map +1 -1
- package/dist/tools/coordinator/index.js +134 -6
- package/dist/tools/coordinator/index.js.map +1 -1
- package/dist/types/sandbox/index.d.ts +23 -0
- package/dist/types/sandbox/index.d.ts.map +1 -1
- package/dist/types/sandbox/index.js.map +1 -1
- package/package.json +1 -1
- package/src/connector/mcp/index.ts +3 -0
- package/src/connector/mcp/server-stdio.ts +137 -0
- package/src/session/workspace/git-worktree.ts +55 -1
- package/src/tools/builtins/bash.ts +34 -0
- package/src/tools/coordinator/agent.ts +12 -0
- package/src/tools/coordinator/index.ts +144 -8
- package/src/types/sandbox/index.ts +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 26.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3f44f0d: A command running in a sandbox now reports progress while it runs
|
|
8
|
+
|
|
9
|
+
Both halves of this existed and neither was connected to the other.
|
|
10
|
+
|
|
11
|
+
Every container worker streams its output a chunk at a time — the wire has always carried `stdout_delta` and `stderr_delta` events — and every backend concatenated those chunks into a string and returned it when the process exited. Separately, `ToolContext.report` exists precisely to answer "is it still working?", is supplied per call by the executor, emits a `tool_progress` event, and is mapped onto the event stream for live consumers. It had **no caller anywhere in the tree**.
|
|
12
|
+
|
|
13
|
+
So a command that ran for eight minutes said nothing for eight minutes, over a transport that had been reporting the whole time.
|
|
14
|
+
|
|
15
|
+
**New:** `SandboxExecOptions.onOutput`, called as output arrives. Optional and additive — a backend that cannot stream never calls it, and `SandboxExecResult.stdout` still carries the complete output either way, so a caller that ignores it behaves exactly as before. Wired through the two container backends that carry the streaming worker protocol.
|
|
16
|
+
|
|
17
|
+
**The `bash` builtin now uses it**, sending the last non-empty line of each chunk to `context.report`. A progress slot renders one line and replaces it, so sending a whole chunk would put a wall of text in a space that shows one line of it.
|
|
18
|
+
|
|
19
|
+
Progress is ephemeral by design — `tool_progress` is excluded from the durable transcript so a tool reporting every file it compiles cannot write thousands of lines into the record. The model is still given `result.stdout`; this is a status signal, not a second copy of the output.
|
|
20
|
+
|
|
21
|
+
- 2737f74: The MCP server has a transport, and a failing post-checkout hook no longer discards a good worktree
|
|
22
|
+
|
|
23
|
+
Two independent gaps, both found by studying how a comparable product solves the same problems. Neither is a port: the code here is namzu's, and in both cases the missing piece was smaller than it looked because the machinery already existed.
|
|
24
|
+
|
|
25
|
+
**`MCPServer` had no way to run.** It is a complete implementation — `initialize`, `tools/list`, `tools/call`, resource and prompt providers — and nothing anywhere constructed one, because every transport in `connector/mcp/` is the _client_ side: they connect this process to somebody else's server. `ServerStdioTransport` is the other end, so somebody else's client can drive namzu.
|
|
26
|
+
|
|
27
|
+
Stdio first, deliberately. The client spawns the server as a child process, so there is no port, no bind address, and no inbound authentication question to answer wrongly. Note that stdout belongs to the protocol on this transport — a stray write corrupts the stream. This repository's logger writes to stderr, which is what makes it safe.
|
|
28
|
+
|
|
29
|
+
**`GitWorktreeDriver.create` trusted the exit code.** `git worktree add` runs the repository's post-checkout hook _after_ the checkout completes, so a hook that fails or is killed by a timeout reports failure over a worktree that is finished and usable. Trusting the status threw that worktree away and leaked it — the path stays registered, so the next attempt fails differently, with "already exists".
|
|
30
|
+
|
|
31
|
+
`create` now checks the repository when the command reports failure, and accepts only a worktree registered under this exact path carrying the branch this call asked for. A registered path alone proves nothing: it can be a half-finished checkout or one somebody else owns, and those two are indistinguishable from here. Any error while checking counts as a failure, because this runs on a path that has already gone wrong once.
|
|
32
|
+
|
|
33
|
+
No behaviour changes for a `create` that succeeds — the check runs only on the failure path.
|
|
34
|
+
|
|
35
|
+
- bac980a: `approve_plan` now advertises a closed model-facing input schema, and its
|
|
36
|
+
string fallback stops turning markup into steps.
|
|
37
|
+
|
|
38
|
+
A model that serialises `steps` instead of building it tends to reach for
|
|
39
|
+
XML. The fallback split that string on newlines, so `<steps>`, `<step>` and
|
|
40
|
+
`</step>` each became a step — and a host numbered them in its approval card
|
|
41
|
+
and asked a person to approve `</steps>`. Observed on a real run.
|
|
42
|
+
|
|
43
|
+
Two changes, in the order they matter:
|
|
44
|
+
|
|
45
|
+
- `modelInputSchema` + `enforceModelInput`, the same instrument
|
|
46
|
+
`ask_user_question` already carries for the same failure. A capable
|
|
47
|
+
provider now constrains generation to the closed shape, so the array is
|
|
48
|
+
not serialised in the first place. The schema stays inside the strict
|
|
49
|
+
subset (`assertStrictSchema` is what would refuse it).
|
|
50
|
+
- The fallback reads the `<description>` blocks the model named when there
|
|
51
|
+
are any, drops tag-only lines when there are not, and yields no steps at
|
|
52
|
+
all for a string carrying no words — rather than inventing one that reads
|
|
53
|
+
`<steps>`.
|
|
54
|
+
|
|
55
|
+
Nothing to do on upgrade. A host that renders `plan.steps` verbatim gets
|
|
56
|
+
sentences where it used to get fragments; a host that already worked around
|
|
57
|
+
this can drop the workaround.
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- fcc9a41: The `Agent` tool now bounds a delegated run by the hour, like its twin
|
|
62
|
+
|
|
63
|
+
`buildAgentTool` declared no `timeoutMs`, and declaring nothing is not "no deadline" — it is the executor's `DEFAULT_TOOL_TIMEOUT_MS`, 120 seconds. That is a reasonable bound for a tool call and an absurd one for a call that runs an entire agent to completion and blocks on it.
|
|
64
|
+
|
|
65
|
+
Its twin `create_task`, built by `buildCoordinatorTools` in the sibling module, has declared `DELEGATION_TIMEOUT_MS` (one hour) all along, and the measurement behind that number is recorded in its docblock: three delegated children took 4m21s, 5m58s and 8m04s, and all three parents gave up at 120 seconds. That fix reached one of the two delegation surfaces and never carried to the other.
|
|
66
|
+
|
|
67
|
+
**What changes for you.** A delegated run through the `Agent` tool that takes longer than two minutes now completes instead of being abandoned. If you were relying on the 120-second bound to catch a wedged child, note that the run budget and the iteration ceiling both still apply above this, and a wedged child is still caught — an hour later rather than two minutes later.
|
|
68
|
+
|
|
69
|
+
The two tools are now asserted to agree, so a future change to one deadline fails until it moves the other. That is the assertion, rather than each tool's number separately: drifting apart is the defect, and two independent assertions pass while it happens.
|
|
70
|
+
|
|
3
71
|
## 26.0.0
|
|
4
72
|
|
|
5
73
|
### Major Changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { StdioTransport } from './stdio.js';
|
|
2
2
|
export { HttpSseTransport } from './http-sse.js';
|
|
3
3
|
export { StreamableHttpTransport } from './streamable-http.js';
|
|
4
|
+
export { ServerStdioTransport } from './server-stdio.js';
|
|
4
5
|
export { MCPClient } from './client.js';
|
|
5
6
|
export { mcpToolToToolDefinition, toolDefinitionToMCPTool, mcpJsonSchemaToZod, zodToMCPJsonSchema, mcpToolResultToToolResult, toolResultToMCPToolResult, } from './adapter.js';
|
|
6
7
|
export { MCPToolDiscovery } from './discovery.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connector/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connector/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAG9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,GACzB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAErF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAA;AAE1E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC1D,YAAY,EACX,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,GACvB,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC9F,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export { StdioTransport } from './stdio.js';
|
|
2
2
|
export { HttpSseTransport } from './http-sse.js';
|
|
3
3
|
export { StreamableHttpTransport } from './streamable-http.js';
|
|
4
|
+
// The server half. The three above connect this process to somebody
|
|
5
|
+
// else's MCP server; this one lets somebody else's client drive ours.
|
|
6
|
+
export { ServerStdioTransport } from './server-stdio.js';
|
|
4
7
|
export { MCPClient } from './client.js';
|
|
5
8
|
export { mcpToolToToolDefinition, toolDefinitionToMCPTool, mcpJsonSchemaToZod, zodToMCPJsonSchema, mcpToolResultToToolResult, toolResultToMCPToolResult, } from './adapter.js';
|
|
6
9
|
export { MCPToolDiscovery } from './discovery.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connector/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connector/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,oEAAoE;AACpE,sEAAsE;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,GACzB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAErF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAA;AAE1E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAQ1D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Readable, Writable } from 'node:stream';
|
|
2
|
+
import type { MCPJsonRpcMessage, MCPTransport } from '../../types/connector/mcp.js';
|
|
3
|
+
/**
|
|
4
|
+
* The server half of stdio, so `MCPServer` has something to run on.
|
|
5
|
+
*
|
|
6
|
+
* `MCPServer` is a complete implementation — `initialize`, `tools/list`,
|
|
7
|
+
* `tools/call`, resource and prompt providers — and nothing anywhere
|
|
8
|
+
* constructed one, because every transport in this directory is the
|
|
9
|
+
* CLIENT side. `StdioTransport` spawns a child and talks to its streams;
|
|
10
|
+
* this reads the streams THIS process was given. Same interface, opposite
|
|
11
|
+
* end of the pipe.
|
|
12
|
+
*
|
|
13
|
+
* Stdio is the first transport rather than an afterthought: a client
|
|
14
|
+
* spawns the server as a child process, so there is no port, no bind
|
|
15
|
+
* address and no inbound authentication question to get wrong. The
|
|
16
|
+
* boundary is the process, and the process was started by the client.
|
|
17
|
+
*
|
|
18
|
+
* **stdout belongs to the protocol.** A single stray `console.log`
|
|
19
|
+
* anywhere in the process corrupts the message stream, and the symptom is
|
|
20
|
+
* a client that reports malformed JSON rather than anything naming the
|
|
21
|
+
* culprit. This repository's logger already writes to stderr, which is
|
|
22
|
+
* what makes this transport safe to add; keep it that way.
|
|
23
|
+
*/
|
|
24
|
+
export declare class ServerStdioTransport implements MCPTransport {
|
|
25
|
+
private readonly input;
|
|
26
|
+
private readonly output;
|
|
27
|
+
private buffer;
|
|
28
|
+
private connected;
|
|
29
|
+
private readonly log;
|
|
30
|
+
private messageHandler?;
|
|
31
|
+
private closeHandler?;
|
|
32
|
+
private errorHandler?;
|
|
33
|
+
private readonly onData;
|
|
34
|
+
private readonly onEnd;
|
|
35
|
+
private readonly onStreamError;
|
|
36
|
+
/**
|
|
37
|
+
* Streams are injected rather than read from `process` directly so a
|
|
38
|
+
* test can drive this without owning the process's own stdio — a test
|
|
39
|
+
* that replaced `process.stdin` would break every other test sharing
|
|
40
|
+
* the runner.
|
|
41
|
+
*/
|
|
42
|
+
constructor(streams?: {
|
|
43
|
+
input?: Readable;
|
|
44
|
+
output?: Writable;
|
|
45
|
+
});
|
|
46
|
+
connect(): Promise<void>;
|
|
47
|
+
close(): Promise<void>;
|
|
48
|
+
send(message: MCPJsonRpcMessage): Promise<void>;
|
|
49
|
+
onMessage(handler: (message: MCPJsonRpcMessage) => void): void;
|
|
50
|
+
onClose(handler: () => void): void;
|
|
51
|
+
onError(handler: (error: Error) => void): void;
|
|
52
|
+
isConnected(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* A chunk is not a message. Reads arrive at whatever size the pipe
|
|
55
|
+
* hands over, so one read can carry half a message, several messages,
|
|
56
|
+
* or the tail of one and the head of the next. Buffering until a
|
|
57
|
+
* newline is the whole protocol framing.
|
|
58
|
+
*/
|
|
59
|
+
private consume;
|
|
60
|
+
private deliver;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=server-stdio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-stdio.d.ts","sourceRoot":"","sources":["../../../src/connector/mcp/server-stdio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAGnF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,oBAAqB,YAAW,YAAY;IACxD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IACjC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAE5B,OAAO,CAAC,cAAc,CAAC,CAAsC;IAC7D,OAAO,CAAC,YAAY,CAAC,CAAY;IACjC,OAAO,CAAC,YAAY,CAAC,CAAwB;IAE7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwD;IAC/E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAGrB;IACD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiD;IAE/E;;;;;OAKG;gBACS,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,QAAQ,CAAC;QAAC,MAAM,CAAC,EAAE,QAAQ,CAAA;KAAE;IAMvD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAUxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrD,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI;IAI9D,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI;IAIlC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI;IAI9C,WAAW,IAAI,OAAO;IAItB;;;;;OAKG;IACH,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,OAAO;CAmBf"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { getRootLogger } from '../../utils/logger.js';
|
|
2
|
+
/**
|
|
3
|
+
* The server half of stdio, so `MCPServer` has something to run on.
|
|
4
|
+
*
|
|
5
|
+
* `MCPServer` is a complete implementation — `initialize`, `tools/list`,
|
|
6
|
+
* `tools/call`, resource and prompt providers — and nothing anywhere
|
|
7
|
+
* constructed one, because every transport in this directory is the
|
|
8
|
+
* CLIENT side. `StdioTransport` spawns a child and talks to its streams;
|
|
9
|
+
* this reads the streams THIS process was given. Same interface, opposite
|
|
10
|
+
* end of the pipe.
|
|
11
|
+
*
|
|
12
|
+
* Stdio is the first transport rather than an afterthought: a client
|
|
13
|
+
* spawns the server as a child process, so there is no port, no bind
|
|
14
|
+
* address and no inbound authentication question to get wrong. The
|
|
15
|
+
* boundary is the process, and the process was started by the client.
|
|
16
|
+
*
|
|
17
|
+
* **stdout belongs to the protocol.** A single stray `console.log`
|
|
18
|
+
* anywhere in the process corrupts the message stream, and the symptom is
|
|
19
|
+
* a client that reports malformed JSON rather than anything naming the
|
|
20
|
+
* culprit. This repository's logger already writes to stderr, which is
|
|
21
|
+
* what makes this transport safe to add; keep it that way.
|
|
22
|
+
*/
|
|
23
|
+
export class ServerStdioTransport {
|
|
24
|
+
input;
|
|
25
|
+
output;
|
|
26
|
+
buffer = '';
|
|
27
|
+
connected = false;
|
|
28
|
+
log;
|
|
29
|
+
messageHandler;
|
|
30
|
+
closeHandler;
|
|
31
|
+
errorHandler;
|
|
32
|
+
onData = (chunk) => this.consume(chunk);
|
|
33
|
+
onEnd = () => {
|
|
34
|
+
this.connected = false;
|
|
35
|
+
this.closeHandler?.();
|
|
36
|
+
};
|
|
37
|
+
onStreamError = (err) => this.errorHandler?.(err);
|
|
38
|
+
/**
|
|
39
|
+
* Streams are injected rather than read from `process` directly so a
|
|
40
|
+
* test can drive this without owning the process's own stdio — a test
|
|
41
|
+
* that replaced `process.stdin` would break every other test sharing
|
|
42
|
+
* the runner.
|
|
43
|
+
*/
|
|
44
|
+
constructor(streams) {
|
|
45
|
+
this.input = streams?.input ?? process.stdin;
|
|
46
|
+
this.output = streams?.output ?? process.stdout;
|
|
47
|
+
this.log = getRootLogger().child({ component: 'ServerStdioTransport' });
|
|
48
|
+
}
|
|
49
|
+
async connect() {
|
|
50
|
+
if (this.connected)
|
|
51
|
+
return;
|
|
52
|
+
this.input.setEncoding?.('utf8');
|
|
53
|
+
this.input.on('data', this.onData);
|
|
54
|
+
this.input.on('end', this.onEnd);
|
|
55
|
+
this.input.on('error', this.onStreamError);
|
|
56
|
+
this.connected = true;
|
|
57
|
+
this.log.info('MCP stdio server listening on this process');
|
|
58
|
+
}
|
|
59
|
+
async close() {
|
|
60
|
+
if (!this.connected)
|
|
61
|
+
return;
|
|
62
|
+
this.input.off('data', this.onData);
|
|
63
|
+
this.input.off('end', this.onEnd);
|
|
64
|
+
this.input.off('error', this.onStreamError);
|
|
65
|
+
this.connected = false;
|
|
66
|
+
this.closeHandler?.();
|
|
67
|
+
}
|
|
68
|
+
async send(message) {
|
|
69
|
+
// Newline-delimited JSON, one message per line. A message carrying a
|
|
70
|
+
// literal newline would split into two unparseable halves, so it is
|
|
71
|
+
// stripped by `JSON.stringify` escaping rather than by trusting the
|
|
72
|
+
// payload.
|
|
73
|
+
this.output.write(`${JSON.stringify(message)}\n`);
|
|
74
|
+
}
|
|
75
|
+
onMessage(handler) {
|
|
76
|
+
this.messageHandler = handler;
|
|
77
|
+
}
|
|
78
|
+
onClose(handler) {
|
|
79
|
+
this.closeHandler = handler;
|
|
80
|
+
}
|
|
81
|
+
onError(handler) {
|
|
82
|
+
this.errorHandler = handler;
|
|
83
|
+
}
|
|
84
|
+
isConnected() {
|
|
85
|
+
return this.connected;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A chunk is not a message. Reads arrive at whatever size the pipe
|
|
89
|
+
* hands over, so one read can carry half a message, several messages,
|
|
90
|
+
* or the tail of one and the head of the next. Buffering until a
|
|
91
|
+
* newline is the whole protocol framing.
|
|
92
|
+
*/
|
|
93
|
+
consume(chunk) {
|
|
94
|
+
this.buffer += typeof chunk === 'string' ? chunk : chunk.toString('utf8');
|
|
95
|
+
let newline = this.buffer.indexOf('\n');
|
|
96
|
+
while (newline !== -1) {
|
|
97
|
+
const line = this.buffer.slice(0, newline).trim();
|
|
98
|
+
this.buffer = this.buffer.slice(newline + 1);
|
|
99
|
+
if (line)
|
|
100
|
+
this.deliver(line);
|
|
101
|
+
newline = this.buffer.indexOf('\n');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
deliver(line) {
|
|
105
|
+
let message;
|
|
106
|
+
try {
|
|
107
|
+
message = JSON.parse(line);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
// Reported, not thrown, and not fatal. A client that sends one bad
|
|
111
|
+
// line has not ended the session, and killing the transport over it
|
|
112
|
+
// would take down every other conversation on this pipe. The
|
|
113
|
+
// alternative — silence — is worse: a request that vanishes looks
|
|
114
|
+
// to the client exactly like a server that hung.
|
|
115
|
+
this.errorHandler?.(new Error(`MCP stdio server could not parse a message: ${err instanceof Error ? err.message : String(err)}`));
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
this.messageHandler?.(message);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=server-stdio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-stdio.js","sourceRoot":"","sources":["../../../src/connector/mcp/server-stdio.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAElE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,oBAAoB;IACf,KAAK,CAAU;IACf,MAAM,CAAU;IACzB,MAAM,GAAG,EAAE,CAAA;IACX,SAAS,GAAG,KAAK,CAAA;IACR,GAAG,CAAQ;IAEpB,cAAc,CAAuC;IACrD,YAAY,CAAa;IACzB,YAAY,CAAyB;IAE5B,MAAM,GAAG,CAAC,KAAsB,EAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9D,KAAK,GAAG,GAAS,EAAE;QACnC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACtB,IAAI,CAAC,YAAY,EAAE,EA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,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACpC,CAAC;IACF,CAAC;IAEO,OAAO,CAAC,IAAY;QAC3B,IAAI,OAA0B,CAAA;QAC9B,IAAI,CAAC;YACJ,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAsB,CAAA;QAChD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,mEAAmE;YACnE,oEAAoE;YACpE,6DAA6D;YAC7D,kEAAkE;YAClE,iDAAiD;YACjD,IAAI,CAAC,YAAY,EAAE,CAClB,IAAI,KAAK,CACR,+CAA+C,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CACjG,CACD,CAAA;YACD,OAAM;QACP,CAAC;QACD,IAAI,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,CAAA;IAC/B,CAAC;CACD"}
|
|
@@ -51,6 +51,21 @@ export declare class GitWorktreeDriver implements WorkspaceBackendDriver {
|
|
|
51
51
|
create(params: CreateWorkspaceParams): Promise<WorkspaceRef>;
|
|
52
52
|
branch(source: WorkspaceRef, params: BranchWorkspaceParams): Promise<WorkspaceRef>;
|
|
53
53
|
dispose(ref: WorkspaceRef): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Did the worktree arrive despite the command reporting failure?
|
|
56
|
+
*
|
|
57
|
+
* Answers only for the branch this call created. A path registered
|
|
58
|
+
* without that branch is not this call's worktree — it is a leftover
|
|
59
|
+
* from a killed attempt, or a checkout somebody else owns, and the two
|
|
60
|
+
* are indistinguishable from here. Claiming either would mean handing
|
|
61
|
+
* a caller a workspace whose contents nobody vouched for, so both are
|
|
62
|
+
* left to surface as the failure they are.
|
|
63
|
+
*
|
|
64
|
+
* Any error while checking is itself a "no". This runs on a path that
|
|
65
|
+
* has already gone wrong once, and guessing optimistically there is how
|
|
66
|
+
* a recovery turns a bad situation into a wrong one.
|
|
67
|
+
*/
|
|
68
|
+
private createdDespite;
|
|
54
69
|
inspect(ref: WorkspaceRef): Promise<WorkspaceInspection>;
|
|
55
70
|
}
|
|
56
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-worktree.d.ts","sourceRoot":"","sources":["../../../src/session/workspace/git-worktree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAA0B,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAExF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,KAAK,EACX,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,MAAM,aAAa,CAAA;AAIpB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACd;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;AAIzF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACnB;AAED,qBAAa,iBAAkB,YAAW,sBAAsB;IAC/D,QAAQ,CAAC,IAAI,EAAG,cAAc,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAQ;IACrC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;gBAEnB,MAAM,EAAE,uBAAuB;IAOrC,M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CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC;IAMlF,OAAO,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B/C;;;;;;;;;;;;;OAaG;YACW,cAAc;IAqBtB,OAAO,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAkC9D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAqBzD"}
|
|
@@ -41,7 +41,26 @@ export class GitWorktreeDriver {
|
|
|
41
41
|
await this.exec('git', argv);
|
|
42
42
|
}
|
|
43
43
|
catch (cause) {
|
|
44
|
-
|
|
44
|
+
// A non-zero exit here does not mean the worktree was not created.
|
|
45
|
+
// `git worktree add` runs the repository's post-checkout hook AFTER
|
|
46
|
+
// the checkout has completed, so a hook that fails — or that a
|
|
47
|
+
// timeout kills — reports failure over a worktree that is finished
|
|
48
|
+
// and usable. Treating the status as the answer throws away a good
|
|
49
|
+
// checkout AND leaks it: the path stays registered, and the next
|
|
50
|
+
// attempt fails differently, with "already exists".
|
|
51
|
+
//
|
|
52
|
+
// So the exit code is a hint and the repository is the evidence.
|
|
53
|
+
// The bar is deliberately high: registered under this exact path
|
|
54
|
+
// AND carrying the branch this call asked for. A registered path
|
|
55
|
+
// alone can be a half-finished checkout, or somebody else's.
|
|
56
|
+
if (!(await this.createdDespite(worktreePath, branch))) {
|
|
57
|
+
throw new WorkspaceBackendError({ op: 'create', kind: this.kind, cause });
|
|
58
|
+
}
|
|
59
|
+
this.log.warn('git-worktree add reported failure but the worktree is present', {
|
|
60
|
+
branch,
|
|
61
|
+
worktreePath,
|
|
62
|
+
cause: cause instanceof Error ? cause.message : String(cause),
|
|
63
|
+
});
|
|
45
64
|
}
|
|
46
65
|
const meta = {
|
|
47
66
|
backend: 'git-worktree',
|
|
@@ -90,6 +109,41 @@ export class GitWorktreeDriver {
|
|
|
90
109
|
throw new WorkspaceBackendError({ op: 'dispose', kind: this.kind, cause });
|
|
91
110
|
}
|
|
92
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Did the worktree arrive despite the command reporting failure?
|
|
114
|
+
*
|
|
115
|
+
* Answers only for the branch this call created. A path registered
|
|
116
|
+
* without that branch is not this call's worktree — it is a leftover
|
|
117
|
+
* from a killed attempt, or a checkout somebody else owns, and the two
|
|
118
|
+
* are indistinguishable from here. Claiming either would mean handing
|
|
119
|
+
* a caller a workspace whose contents nobody vouched for, so both are
|
|
120
|
+
* left to surface as the failure they are.
|
|
121
|
+
*
|
|
122
|
+
* Any error while checking is itself a "no". This runs on a path that
|
|
123
|
+
* has already gone wrong once, and guessing optimistically there is how
|
|
124
|
+
* a recovery turns a bad situation into a wrong one.
|
|
125
|
+
*/
|
|
126
|
+
async createdDespite(worktreePath, branch) {
|
|
127
|
+
try {
|
|
128
|
+
const { stdout } = await this.exec('git', [
|
|
129
|
+
'-C',
|
|
130
|
+
this.repoRoot,
|
|
131
|
+
'worktree',
|
|
132
|
+
'list',
|
|
133
|
+
'--porcelain',
|
|
134
|
+
]);
|
|
135
|
+
const entry = parseWorktreeList(stdout, worktreePath);
|
|
136
|
+
// `--porcelain` writes the branch as a full ref (`refs/heads/x`),
|
|
137
|
+
// and `branch` here is the short name this call passed to `-b`.
|
|
138
|
+
// Comparing them directly is a check that can never pass, which
|
|
139
|
+
// would make this whole recovery path silently dead — the exact
|
|
140
|
+
// shape it exists to catch.
|
|
141
|
+
return entry?.branch === `refs/heads/${branch}`;
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
93
147
|
async inspect(ref) {
|
|
94
148
|
let listSt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,IAAI,KAAK,YAAY,EAAE,CAAC;YAC3B,OAAO;gBACN,IAAI;gBACJ,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC;gBACnC,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,CAAC;aACvC,CAAA;QACF,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAA;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/tools/builtins/bash.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/tools/builtins/bash.ts"],"names":[],"mappings":"AAuFA,eAAO,MAAM,QAAQ;;;EA0KnB,CAAA"}
|
|
@@ -44,6 +44,27 @@ const inputSchema = z.object({
|
|
|
44
44
|
.preprocess((v) => (typeof v === 'string' ? Number(v) : v), z.number().positive().max(MAX_BASH_TIMEOUT_MS).default(DEFAULT_BASH_TIMEOUT_MS))
|
|
45
45
|
.describe(`Command timeout in milliseconds. Default: ${DEFAULT_BASH_TIMEOUT_MS}, maximum: ${MAX_BASH_TIMEOUT_MS}. For work that legitimately runs longer than the maximum, start it in the background and poll, rather than holding the turn open.`),
|
|
46
46
|
});
|
|
47
|
+
/**
|
|
48
|
+
* The last line worth showing from one chunk of streamed output.
|
|
49
|
+
*
|
|
50
|
+
* A progress line is a status, not a log: the host renders one line and
|
|
51
|
+
* replaces it as the next arrives, so sending a whole chunk sends a wall
|
|
52
|
+
* of text into a slot that shows one line of it. A chunk usually ends
|
|
53
|
+
* mid-line and usually ends with a newline, so the last NON-EMPTY line is
|
|
54
|
+
* the most recent complete thing the command actually said.
|
|
55
|
+
*
|
|
56
|
+
* Progress is capped rather than truncated with an ellipsis: this is
|
|
57
|
+
* glanced at, and a marker in a line nobody reads to the end is noise.
|
|
58
|
+
*/
|
|
59
|
+
function lastNonEmptyLine(chunk) {
|
|
60
|
+
const lines = chunk.split('\n');
|
|
61
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
62
|
+
const line = lines[i]?.trim();
|
|
63
|
+
if (line)
|
|
64
|
+
return line.length > 160 ? line.slice(0, 160) : line;
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
47
68
|
function isDangerousCommand(command) {
|
|
48
69
|
return DANGEROUS_PATTERNS.some((pattern) => pattern.test(command));
|
|
49
70
|
}
|
|
@@ -94,6 +115,20 @@ export const BashTool = defineTool({
|
|
|
94
115
|
// Same reason as the host path below: a Stop must reach the
|
|
95
116
|
// process, not just the promise waiting on it.
|
|
96
117
|
signal: context.abortSignal,
|
|
118
|
+
// The worker has always streamed its output; nothing asked for
|
|
119
|
+
// it, so a command that ran for minutes said nothing until it
|
|
120
|
+
// exited. `report` is ephemeral by design — it answers "is it
|
|
121
|
+
// still working?" for a live view and is excluded from the
|
|
122
|
+
// durable transcript — so this is a progress signal, not a
|
|
123
|
+
// second copy of the output. `result.stdout` remains the
|
|
124
|
+
// answer the model is given.
|
|
125
|
+
onOutput: context.report
|
|
126
|
+
? ({ data }) => {
|
|
127
|
+
const line = lastNonEmptyLine(data);
|
|
128
|
+
if (line)
|
|
129
|
+
context.report?.(line);
|
|
130
|
+
}
|
|
131
|
+
: undefined,
|
|
97
132
|
});
|
|
98
133
|
if (result.timedOut) {
|
|
99
134
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/tools/builtins/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE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MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAC5B,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;AACtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/tools/coordinator/agent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/tools/coordinator/agent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAM/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,WAAW,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,CAAC,EAAE,mBAAmB,CAAA;IACpC,eAAe,EAAE,MAAM,EAAE,CAAA;IAEzB,cAAc,CAAC,EAAE,oBAAoB,CAAA;IAErC;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,cAAc,CA4LrE"}
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { defineTool } from '../defineTool.js';
|
|
3
3
|
import { wrapUntrusted } from '../untrusted-envelope.js';
|
|
4
4
|
import { failureLabel, taskSucceeded } from './outcome.js';
|
|
5
|
+
import { DELEGATION_TIMEOUT_MS } from './index.js';
|
|
5
6
|
export function buildAgentTool(opts) {
|
|
6
7
|
const { gateway, allowedAgentIds: agentIds, onTaskLaunched } = opts;
|
|
7
8
|
const cwd = opts.workingDirectory;
|
|
@@ -41,6 +42,17 @@ export function buildAgentTool(opts) {
|
|
|
41
42
|
readOnly: false,
|
|
42
43
|
destructive: false,
|
|
43
44
|
concurrencySafe: true,
|
|
45
|
+
// Declaring nothing here does not mean "no deadline"; it means the
|
|
46
|
+
// executor's 120-second default, which is a bound for a tool call and
|
|
47
|
+
// absurd for a whole agent run. `create_task` in the sibling module
|
|
48
|
+
// carries the same reasoning and the same hour, and the measurement
|
|
49
|
+
// behind that number is in its docblock: three delegated children took
|
|
50
|
+
// 4m21s, 5m58s and 8m04s, and all three parents gave up at 120s.
|
|
51
|
+
//
|
|
52
|
+
// This surface did not get that fix when its twin did, and the file's
|
|
53
|
+
// own note above records the pair doing exactly this before. The two
|
|
54
|
+
// tools are twins; a bound applied to one of them is not applied.
|
|
55
|
+
timeoutMs: DELEGATION_TIMEOUT_MS,
|
|
44
56
|
...(opts.terminal !== undefined ? { terminal: opts.terminal } : {}),
|
|
45
57
|
async execute({ description, prompt, subagent_type }, context) {
|
|
46
58
|
// With a single registered subagent the type is optional — default to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/tools/coordinator/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;
|
|
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