vouchington-tooling 1.2.0 → 1.2.1
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/mcp-server/fake-blackboard.test-helpers.d.mts +2 -0
- package/dist/mcp-server/fake-blackboard.test-helpers.mjs +2 -0
- package/dist/mcp-server/handlers-session.mjs +22 -5
- package/dist/mcp-server/tools.mjs +2 -2
- package/package.json +1 -1
- package/scripts/__pycache__/run_bounded_process.cpython-314.pyc +0 -0
|
@@ -24,6 +24,8 @@ export type FakeOptions = {
|
|
|
24
24
|
agent: string;
|
|
25
25
|
version: string;
|
|
26
26
|
};
|
|
27
|
+
/** Makes every `ensure` reject with this error. */
|
|
28
|
+
ensureError?: unknown;
|
|
27
29
|
entries?: StoredEntry[];
|
|
28
30
|
entriesError?: unknown;
|
|
29
31
|
/** Fails the read of just these sessions, keyed by session id. */
|
|
@@ -26,6 +26,8 @@ export function fakeBlackboard(options = {}) {
|
|
|
26
26
|
calls.ensure.push(input);
|
|
27
27
|
if (typeof input.id !== 'string')
|
|
28
28
|
throw new Error('ensure requires id');
|
|
29
|
+
if (options.ensureError !== undefined)
|
|
30
|
+
throw options.ensureError;
|
|
29
31
|
if (options.conflictingSession &&
|
|
30
32
|
(options.conflictingSession.parentSessionId !== input.parentSessionId ||
|
|
31
33
|
options.conflictingSession.agent !== input.agent ||
|
|
@@ -24,11 +24,28 @@ function readSelection(args) {
|
|
|
24
24
|
...(inactiveForHours === undefined ? {} : { inactiveForHours }),
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
/** The blackboard client is loaded dynamically, so its error class is matched by shape. */
|
|
28
|
+
function isParentNotFound(error) {
|
|
29
|
+
if (!isObject(error) || error.status !== 404 || !isObject(error.body))
|
|
30
|
+
return false;
|
|
31
|
+
return error.body.code === 'parent_not_found';
|
|
32
|
+
}
|
|
33
|
+
export const sessionEnsure = async (args, context) => {
|
|
34
|
+
const identity = readIdentity(args, context.sessionId);
|
|
35
|
+
try {
|
|
36
|
+
return await ensureBlackboardSession({
|
|
37
|
+
...identity,
|
|
38
|
+
env: context.env,
|
|
39
|
+
dependencies: context.dependencies,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (identity.parentSessionId !== null && isParentNotFound(error))
|
|
44
|
+
throw new Error(`parent session ${identity.parentSessionId} does not exist on the blackboard; ` +
|
|
45
|
+
'ensure the parent session first (session_ensure with its own id) and retry', { cause: error });
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
32
49
|
export const sessionArchive = async (_args, context) => archiveBlackboardSession({
|
|
33
50
|
sessionId: context.sessionId,
|
|
34
51
|
env: context.env,
|
|
@@ -44,8 +44,8 @@ export const TOOLS = [
|
|
|
44
44
|
'records of the caller sessionId; worktreePendingCount covers every session. ' +
|
|
45
45
|
'A record with a permanent rejection moves to the rejected area and is listed in rejected ' +
|
|
46
46
|
'as sourceEventId and diagnostic.', IDEMPOTENT_ADDITIVE),
|
|
47
|
-
tool('session_ensure', 'Idempotently creates a session, or verifies
|
|
48
|
-
|
|
47
|
+
tool('session_ensure', 'Idempotently creates a session, or verifies an existing one has the same identity. Child or ' +
|
|
48
|
+
"worker sessions must pass their orchestrator's session id as parentSessionId.", IDEMPOTENT_ADDITIVE, IDENTITY, IDENTITY_REQUIRED),
|
|
49
49
|
...RETROSPECTIVE_TOOLS,
|
|
50
50
|
...PR_TOOLS,
|
|
51
51
|
tool('snapshot_export', 'Exports non-archived sessions into a private local JSONL file chosen by the blackboard ' +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vouchington-tooling",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Vouchington CLI and extractable tooling libraries.",
|
|
5
5
|
"homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
|
|
6
6
|
"bugs": {
|
|
Binary file
|