@wopr-network/defcon 0.2.0 → 0.2.2
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/src/execution/cli.js +0 -0
- package/package.json +3 -2
- package/dist/api/router.d.ts +0 -24
- package/dist/api/router.js +0 -44
- package/dist/api/server.d.ts +0 -13
- package/dist/api/server.js +0 -280
- package/dist/api/wire-types.d.ts +0 -46
- package/dist/api/wire-types.js +0 -5
- package/dist/config/db-path.d.ts +0 -1
- package/dist/config/db-path.js +0 -1
- package/dist/config/exporter.d.ts +0 -3
- package/dist/config/exporter.js +0 -87
- package/dist/config/index.d.ts +0 -4
- package/dist/config/index.js +0 -4
- package/dist/config/seed-loader.d.ts +0 -10
- package/dist/config/seed-loader.js +0 -108
- package/dist/config/zod-schemas.d.ts +0 -165
- package/dist/config/zod-schemas.js +0 -283
- package/dist/cors.d.ts +0 -8
- package/dist/cors.js +0 -21
- package/dist/engine/constants.d.ts +0 -1
- package/dist/engine/constants.js +0 -1
- package/dist/engine/engine.d.ts +0 -69
- package/dist/engine/engine.js +0 -485
- package/dist/engine/event-emitter.d.ts +0 -9
- package/dist/engine/event-emitter.js +0 -19
- package/dist/engine/event-types.d.ts +0 -105
- package/dist/engine/event-types.js +0 -1
- package/dist/engine/flow-spawner.d.ts +0 -8
- package/dist/engine/flow-spawner.js +0 -28
- package/dist/engine/gate-command-validator.d.ts +0 -6
- package/dist/engine/gate-command-validator.js +0 -46
- package/dist/engine/gate-evaluator.d.ts +0 -12
- package/dist/engine/gate-evaluator.js +0 -233
- package/dist/engine/handlebars.d.ts +0 -9
- package/dist/engine/handlebars.js +0 -51
- package/dist/engine/index.d.ts +0 -12
- package/dist/engine/index.js +0 -7
- package/dist/engine/invocation-builder.d.ts +0 -18
- package/dist/engine/invocation-builder.js +0 -58
- package/dist/engine/on-enter.d.ts +0 -8
- package/dist/engine/on-enter.js +0 -102
- package/dist/engine/ssrf-guard.d.ts +0 -22
- package/dist/engine/ssrf-guard.js +0 -159
- package/dist/engine/state-machine.d.ts +0 -12
- package/dist/engine/state-machine.js +0 -74
- package/dist/execution/active-runner.d.ts +0 -45
- package/dist/execution/active-runner.js +0 -165
- package/dist/execution/admin-schemas.d.ts +0 -116
- package/dist/execution/admin-schemas.js +0 -125
- package/dist/execution/cli.d.ts +0 -57
- package/dist/execution/cli.js +0 -498
- package/dist/execution/handlers/admin.d.ts +0 -67
- package/dist/execution/handlers/admin.js +0 -200
- package/dist/execution/handlers/flow.d.ts +0 -25
- package/dist/execution/handlers/flow.js +0 -289
- package/dist/execution/handlers/query.d.ts +0 -31
- package/dist/execution/handlers/query.js +0 -64
- package/dist/execution/index.d.ts +0 -4
- package/dist/execution/index.js +0 -3
- package/dist/execution/mcp-helpers.d.ts +0 -42
- package/dist/execution/mcp-helpers.js +0 -23
- package/dist/execution/mcp-server.d.ts +0 -33
- package/dist/execution/mcp-server.js +0 -1020
- package/dist/execution/provision-worktree.d.ts +0 -16
- package/dist/execution/provision-worktree.js +0 -123
- package/dist/execution/tool-schemas.d.ts +0 -40
- package/dist/execution/tool-schemas.js +0 -44
- package/dist/logger.d.ts +0 -8
- package/dist/logger.js +0 -12
- package/dist/main.d.ts +0 -14
- package/dist/main.js +0 -28
- package/dist/repositories/drizzle/entity.repo.d.ts +0 -27
- package/dist/repositories/drizzle/entity.repo.js +0 -190
- package/dist/repositories/drizzle/event.repo.d.ts +0 -12
- package/dist/repositories/drizzle/event.repo.js +0 -24
- package/dist/repositories/drizzle/flow.repo.d.ts +0 -22
- package/dist/repositories/drizzle/flow.repo.js +0 -364
- package/dist/repositories/drizzle/gate.repo.d.ts +0 -16
- package/dist/repositories/drizzle/gate.repo.js +0 -98
- package/dist/repositories/drizzle/index.d.ts +0 -6
- package/dist/repositories/drizzle/index.js +0 -7
- package/dist/repositories/drizzle/invocation.repo.d.ts +0 -23
- package/dist/repositories/drizzle/invocation.repo.js +0 -199
- package/dist/repositories/drizzle/schema.d.ts +0 -1932
- package/dist/repositories/drizzle/schema.js +0 -155
- package/dist/repositories/drizzle/transition-log.repo.d.ts +0 -11
- package/dist/repositories/drizzle/transition-log.repo.js +0 -42
- package/dist/repositories/interfaces.d.ts +0 -321
- package/dist/repositories/interfaces.js +0 -2
- package/dist/utils/redact.d.ts +0 -2
- package/dist/utils/redact.js +0 -62
- package/gates/blocking-graph.d.ts +0 -26
- package/gates/blocking-graph.js +0 -102
- package/gates/test/bad-return-gate.d.ts +0 -1
- package/gates/test/bad-return-gate.js +0 -4
- package/gates/test/passing-gate.d.ts +0 -2
- package/gates/test/passing-gate.js +0 -3
- package/gates/test/slow-gate.d.ts +0 -2
- package/gates/test/slow-gate.js +0 -5
- package/gates/test/throwing-gate.d.ts +0 -1
- package/gates/test/throwing-gate.js +0 -3
package/dist/execution/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Engine } from "../engine/engine.js";
|
|
2
|
-
import type { IEntityRepository, IEventRepository, IFlowRepository, IGateRepository, IInvocationRepository, ITransitionLogRepository } from "../repositories/interfaces.js";
|
|
3
|
-
export interface McpServerDeps {
|
|
4
|
-
entities: IEntityRepository;
|
|
5
|
-
flows: IFlowRepository;
|
|
6
|
-
invocations: IInvocationRepository;
|
|
7
|
-
gates: IGateRepository;
|
|
8
|
-
transitions: ITransitionLogRepository;
|
|
9
|
-
eventRepo: IEventRepository;
|
|
10
|
-
engine?: Engine;
|
|
11
|
-
}
|
|
12
|
-
export declare function jsonResult(data: unknown): {
|
|
13
|
-
content: {
|
|
14
|
-
type: "text";
|
|
15
|
-
text: string;
|
|
16
|
-
}[];
|
|
17
|
-
};
|
|
18
|
-
export declare function errorResult(message: string): {
|
|
19
|
-
content: {
|
|
20
|
-
type: "text";
|
|
21
|
-
text: string;
|
|
22
|
-
}[];
|
|
23
|
-
isError: boolean;
|
|
24
|
-
};
|
|
25
|
-
export declare function validateInput<T>(schema: {
|
|
26
|
-
safeParse: (data: unknown) => {
|
|
27
|
-
success: boolean;
|
|
28
|
-
data?: T;
|
|
29
|
-
error?: {
|
|
30
|
-
issues: unknown[];
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
}, args: Record<string, unknown>): {
|
|
34
|
-
ok: true;
|
|
35
|
-
data: T;
|
|
36
|
-
} | {
|
|
37
|
-
ok: false;
|
|
38
|
-
result: ReturnType<typeof errorResult>;
|
|
39
|
-
};
|
|
40
|
-
export declare function emitDefinitionChanged(eventRepo: IEventRepository, flowId: string | null, tool: string, payload: Record<string, unknown>, logger?: {
|
|
41
|
-
error: (...args: unknown[]) => void;
|
|
42
|
-
}): void;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export function jsonResult(data) {
|
|
2
|
-
return {
|
|
3
|
-
content: [{ type: "text", text: JSON.stringify(data) }],
|
|
4
|
-
};
|
|
5
|
-
}
|
|
6
|
-
export function errorResult(message) {
|
|
7
|
-
return {
|
|
8
|
-
content: [{ type: "text", text: message }],
|
|
9
|
-
isError: true,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export function validateInput(schema, args) {
|
|
13
|
-
const parsed = schema.safeParse(args);
|
|
14
|
-
if (!parsed.success) {
|
|
15
|
-
return { ok: false, result: errorResult(`Validation error: ${JSON.stringify(parsed.error?.issues)}`) };
|
|
16
|
-
}
|
|
17
|
-
return { ok: true, data: parsed.data };
|
|
18
|
-
}
|
|
19
|
-
export function emitDefinitionChanged(eventRepo, flowId, tool, payload, logger) {
|
|
20
|
-
eventRepo.emitDefinitionChanged(flowId, tool, payload).catch((err) => {
|
|
21
|
-
logger?.error("[mcp] emitDefinitionChanged error:", err);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
-
import type { Engine } from "../engine/engine.js";
|
|
3
|
-
import type { Logger } from "../logger.js";
|
|
4
|
-
import type { IEntityRepository, IEventRepository, IFlowRepository, IGateRepository, IInvocationRepository, ITransitionLogRepository } from "../repositories/interfaces.js";
|
|
5
|
-
export interface McpServerDeps {
|
|
6
|
-
entities: IEntityRepository;
|
|
7
|
-
flows: IFlowRepository;
|
|
8
|
-
invocations: IInvocationRepository;
|
|
9
|
-
gates: IGateRepository;
|
|
10
|
-
transitions: ITransitionLogRepository;
|
|
11
|
-
eventRepo: IEventRepository;
|
|
12
|
-
engine?: Engine;
|
|
13
|
-
logger?: Logger;
|
|
14
|
-
}
|
|
15
|
-
export interface McpServerOpts {
|
|
16
|
-
/** DEFCON_ADMIN_TOKEN — if set, admin.* tools require this token */
|
|
17
|
-
adminToken?: string;
|
|
18
|
-
/** DEFCON_WORKER_TOKEN — if set, flow.* tools require this token */
|
|
19
|
-
workerToken?: string;
|
|
20
|
-
/** Token provided by the caller (from HTTP Authorization header, or undefined for stdio) */
|
|
21
|
-
callerToken?: string;
|
|
22
|
-
/** When true, skip token validation (stdio is local-process-only and inherently trusted) */
|
|
23
|
-
stdioTrusted?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare function createMcpServer(deps: McpServerDeps, opts?: McpServerOpts): Server;
|
|
26
|
-
export declare function callToolHandler(deps: McpServerDeps, name: string, safeArgs: Record<string, unknown>, opts?: McpServerOpts): Promise<{
|
|
27
|
-
content: {
|
|
28
|
-
type: "text";
|
|
29
|
-
text: string;
|
|
30
|
-
}[];
|
|
31
|
-
}>;
|
|
32
|
-
/** Start the MCP server on stdio transport. */
|
|
33
|
-
export declare function startStdioServer(deps: McpServerDeps, opts?: McpServerOpts): Promise<void>;
|