@smithers-orchestrator/cli 0.16.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/LICENSE +21 -0
- package/package.json +55 -0
- package/src/AgentAvailability.ts +13 -0
- package/src/AgentAvailabilityStatus.ts +5 -0
- package/src/AggregateNodeDetailParams.ts +5 -0
- package/src/AskOptions.ts +12 -0
- package/src/ChatAttemptMeta.ts +7 -0
- package/src/ChatAttemptRow.ts +12 -0
- package/src/ChatOutputEvent.ts +6 -0
- package/src/DiffBundleLike.ts +6 -0
- package/src/DiscoveredWorkflow.ts +9 -0
- package/src/EnrichedNodeDetail.ts +60 -0
- package/src/EventCategory.ts +18 -0
- package/src/FindDbWaitOptions.ts +4 -0
- package/src/FormatEventLineOptions.ts +4 -0
- package/src/HijackCandidate.ts +11 -0
- package/src/HijackLaunchSpec.ts +6 -0
- package/src/InitWorkflowPackOptions.ts +4 -0
- package/src/InitWorkflowPackResult.ts +6 -0
- package/src/NativeHijackEngine.ts +8 -0
- package/src/NodeDetailAttempt.ts +22 -0
- package/src/NodeDetailTokenUsage.ts +11 -0
- package/src/NodeDetailToolCall.ts +12 -0
- package/src/ParsedNodeOutputEvent.ts +9 -0
- package/src/RenderNodeDetailOptions.ts +4 -0
- package/src/RunAutoResumeSkipReason.ts +4 -0
- package/src/RunDiffCommandInput.ts +13 -0
- package/src/RunDiffCommandResult.ts +3 -0
- package/src/RunOutputCommandInput.ts +12 -0
- package/src/RunOutputCommandResult.ts +3 -0
- package/src/RunRewindCommandInput.ts +14 -0
- package/src/RunRewindCommandResult.ts +3 -0
- package/src/RunTreeCommandInput.ts +14 -0
- package/src/RunTreeCommandResult.ts +3 -0
- package/src/SmithersEventType.ts +3 -0
- package/src/SupervisorOptions.ts +33 -0
- package/src/SupervisorPollSummary.ts +6 -0
- package/src/TreeRenderOptions.ts +5 -0
- package/src/WatchLoopOptions.ts +9 -0
- package/src/WatchLoopResult.ts +8 -0
- package/src/WatchRenderContext.ts +4 -0
- package/src/WhyBlocker.ts +17 -0
- package/src/WhyBlockerKind.ts +9 -0
- package/src/WhyDiagnosis.ts +10 -0
- package/src/WorkflowCta.ts +4 -0
- package/src/WorkflowSourceType.ts +1 -0
- package/src/agent-detection.js +257 -0
- package/src/ask.js +491 -0
- package/src/chat.js +226 -0
- package/src/diff.js +221 -0
- package/src/event-categories.js +141 -0
- package/src/find-db.js +93 -0
- package/src/format.js +272 -0
- package/src/hijack-session.js +207 -0
- package/src/hijack.js +226 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +4868 -0
- package/src/mcp/SemanticMcpServerOptions.ts +4 -0
- package/src/mcp/SemanticToolCallResult.ts +14 -0
- package/src/mcp/SemanticToolContext.ts +6 -0
- package/src/mcp/SemanticToolDefinition.ts +13 -0
- package/src/mcp/SemanticToolError.ts +6 -0
- package/src/mcp/semantic-server.js +41 -0
- package/src/mcp/semantic-tools.js +1242 -0
- package/src/node-detail.js +682 -0
- package/src/output.js +111 -0
- package/src/resume-detached.js +37 -0
- package/src/rewind.js +88 -0
- package/src/scheduler.js +112 -0
- package/src/smithersRuntime.js +63 -0
- package/src/supervisor.js +418 -0
- package/src/tree.js +307 -0
- package/src/tui/app.jsx +139 -0
- package/src/tui/app.tsx +5 -0
- package/src/tui/components/AskModal.jsx +109 -0
- package/src/tui/components/AskModal.tsx +3 -0
- package/src/tui/components/AttentionPane.jsx +112 -0
- package/src/tui/components/AttentionPane.tsx +6 -0
- package/src/tui/components/ChatPane.jsx +57 -0
- package/src/tui/components/ChatPane.tsx +7 -0
- package/src/tui/components/CronList.jsx +87 -0
- package/src/tui/components/CronList.tsx +5 -0
- package/src/tui/components/DetailsPane.jsx +96 -0
- package/src/tui/components/DetailsPane.tsx +7 -0
- package/src/tui/components/FramesPane.jsx +147 -0
- package/src/tui/components/FramesPane.tsx +8 -0
- package/src/tui/components/LogsPane.jsx +46 -0
- package/src/tui/components/LogsPane.tsx +6 -0
- package/src/tui/components/MetricsPane.jsx +108 -0
- package/src/tui/components/MetricsPane.tsx +5 -0
- package/src/tui/components/NodeDetailView.jsx +284 -0
- package/src/tui/components/NodeDetailView.tsx +7 -0
- package/src/tui/components/NodeInspector.jsx +51 -0
- package/src/tui/components/NodeInspector.tsx +7 -0
- package/src/tui/components/RunDetailView.jsx +190 -0
- package/src/tui/components/RunDetailView.tsx +7 -0
- package/src/tui/components/RunsList.jsx +184 -0
- package/src/tui/components/RunsList.tsx +7 -0
- package/src/tui/components/SqliteBrowser.jsx +131 -0
- package/src/tui/components/SqliteBrowser.tsx +5 -0
- package/src/tui/components/WorkflowLauncher.jsx +63 -0
- package/src/tui/components/WorkflowLauncher.tsx +3 -0
- package/src/util/CliErrorMapping.ts +7 -0
- package/src/util/CliExitCode.ts +10 -0
- package/src/util/errorMessage.js +212 -0
- package/src/util/exitCodes.js +18 -0
- package/src/watch.js +128 -0
- package/src/why-diagnosis.js +1000 -0
- package/src/workflow-pack.js +2151 -0
- package/src/workflows.js +122 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SemanticToolError } from "./SemanticToolError.ts";
|
|
2
|
+
|
|
3
|
+
export type SemanticToolCallResult = {
|
|
4
|
+
content: Array<{
|
|
5
|
+
type: "text";
|
|
6
|
+
text: string;
|
|
7
|
+
}>;
|
|
8
|
+
structuredContent: {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
data?: unknown;
|
|
11
|
+
error?: SemanticToolError;
|
|
12
|
+
};
|
|
13
|
+
isError?: boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import type { SEMANTIC_TOOL_NAMES } from "./semantic-tools.js";
|
|
4
|
+
import type { SemanticToolCallResult } from "./SemanticToolCallResult.ts";
|
|
5
|
+
|
|
6
|
+
export type SemanticToolDefinition = {
|
|
7
|
+
name: (typeof SEMANTIC_TOOL_NAMES)[number];
|
|
8
|
+
description: string;
|
|
9
|
+
inputSchema: z.ZodTypeAny;
|
|
10
|
+
outputSchema: z.ZodTypeAny;
|
|
11
|
+
annotations: Record<string, boolean>;
|
|
12
|
+
handler: (input: any) => Promise<SemanticToolCallResult>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { createSemanticToolDefinitions, } from "./semantic-tools.js";
|
|
4
|
+
/** @typedef {import("./SemanticMcpServerOptions.ts").SemanticMcpServerOptions} SemanticMcpServerOptions */
|
|
5
|
+
/** @typedef {import("./SemanticToolDefinition.ts").SemanticToolDefinition} SemanticToolDefinition */
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param {McpServer} server
|
|
9
|
+
* @param {SemanticToolDefinition[]} [toolDefinitions]
|
|
10
|
+
*/
|
|
11
|
+
export function registerSemanticTools(server, toolDefinitions = createSemanticToolDefinitions()) {
|
|
12
|
+
for (const tool of toolDefinitions) {
|
|
13
|
+
server.registerTool(tool.name, {
|
|
14
|
+
description: tool.description,
|
|
15
|
+
inputSchema: tool.inputSchema,
|
|
16
|
+
outputSchema: tool.outputSchema,
|
|
17
|
+
annotations: tool.annotations,
|
|
18
|
+
}, async (input) => tool.handler(input));
|
|
19
|
+
}
|
|
20
|
+
return server;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @param {SemanticMcpServerOptions} [options]
|
|
24
|
+
*/
|
|
25
|
+
export function createSemanticMcpServer(options = {}) {
|
|
26
|
+
const server = new McpServer({
|
|
27
|
+
name: options.name ?? "smithers",
|
|
28
|
+
version: options.version ?? "0.0.0",
|
|
29
|
+
});
|
|
30
|
+
registerSemanticTools(server);
|
|
31
|
+
return server;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @param {SemanticMcpServerOptions} [options]
|
|
35
|
+
*/
|
|
36
|
+
export async function serveSemanticMcpServer(options = {}) {
|
|
37
|
+
const server = createSemanticMcpServer(options);
|
|
38
|
+
const transport = new StdioServerTransport(process.stdin, process.stdout);
|
|
39
|
+
await server.connect(transport);
|
|
40
|
+
return server;
|
|
41
|
+
}
|