@provos/ironcurtain 0.9.0 → 0.10.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/README.md +20 -12
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/config/config-command.js +12 -3
- package/dist/config/config-command.js.map +1 -1
- package/dist/config/model-provider.d.ts +8 -2
- package/dist/config/model-provider.js +52 -9
- package/dist/config/model-provider.js.map +1 -1
- package/dist/config/paths.d.ts +6 -0
- package/dist/config/paths.js +18 -9
- package/dist/config/paths.js.map +1 -1
- package/dist/config/user-config.d.ts +9 -0
- package/dist/config/user-config.js +26 -5
- package/dist/config/user-config.js.map +1 -1
- package/dist/cron/compile-task-policy.js +1 -0
- package/dist/cron/compile-task-policy.js.map +1 -1
- package/dist/docker/adapters/claude-code.d.ts +2 -1
- package/dist/docker/adapters/claude-code.js +135 -120
- package/dist/docker/adapters/claude-code.js.map +1 -1
- package/dist/docker/agent-registry.js +3 -2
- package/dist/docker/agent-registry.js.map +1 -1
- package/dist/docker/container-lifecycle.d.ts +15 -0
- package/dist/docker/container-lifecycle.js +32 -0
- package/dist/docker/container-lifecycle.js.map +1 -0
- package/dist/docker/docker-agent-session.js +16 -23
- package/dist/docker/docker-agent-session.js.map +1 -1
- package/dist/docker/docker-infrastructure.d.ts +10 -0
- package/dist/docker/docker-infrastructure.js +71 -4
- package/dist/docker/docker-infrastructure.js.map +1 -1
- package/dist/docker/docker-manager.js +37 -0
- package/dist/docker/docker-manager.js.map +1 -1
- package/dist/docker/mitm-proxy.d.ts +6 -0
- package/dist/docker/mitm-proxy.js +343 -25
- package/dist/docker/mitm-proxy.js.map +1 -1
- package/dist/docker/oauth-credentials.d.ts +45 -6
- package/dist/docker/oauth-credentials.js +151 -24
- package/dist/docker/oauth-credentials.js.map +1 -1
- package/dist/docker/oauth-token-manager.d.ts +15 -16
- package/dist/docker/oauth-token-manager.js +23 -17
- package/dist/docker/oauth-token-manager.js.map +1 -1
- package/dist/docker/provider-config.d.ts +32 -0
- package/dist/docker/provider-config.js +20 -0
- package/dist/docker/provider-config.js.map +1 -1
- package/dist/docker/pty-session.js +14 -22
- package/dist/docker/pty-session.js.map +1 -1
- package/dist/docker/types.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/mux/mux-app.d.ts +2 -0
- package/dist/mux/mux-app.js +48 -37
- package/dist/mux/mux-app.js.map +1 -1
- package/dist/mux/mux-command.js +7 -1
- package/dist/mux/mux-command.js.map +1 -1
- package/dist/mux/mux-input-handler.d.ts +2 -0
- package/dist/mux/mux-input-handler.js +6 -4
- package/dist/mux/mux-input-handler.js.map +1 -1
- package/dist/mux/mux-renderer.js +20 -5
- package/dist/mux/mux-renderer.js.map +1 -1
- package/dist/mux/pty-bridge.d.ts +2 -0
- package/dist/mux/pty-bridge.js +3 -0
- package/dist/mux/pty-bridge.js.map +1 -1
- package/dist/mux/session-scanner.d.ts +7 -0
- package/dist/mux/session-scanner.js +21 -1
- package/dist/mux/session-scanner.js.map +1 -1
- package/dist/mux/types.d.ts +0 -4
- package/dist/mux/types.js.map +1 -1
- package/dist/persona/compile-persona-policy.js +1 -0
- package/dist/persona/compile-persona-policy.js.map +1 -1
- package/dist/pipeline/annotate.d.ts +7 -1
- package/dist/pipeline/annotate.js +92 -2
- package/dist/pipeline/annotate.js.map +1 -1
- package/dist/pipeline/compile.js +2 -0
- package/dist/pipeline/compile.js.map +1 -1
- package/dist/pipeline/llm-logger.d.ts +1 -0
- package/dist/pipeline/llm-logger.js +8 -1
- package/dist/pipeline/llm-logger.js.map +1 -1
- package/dist/pipeline/parallel-progress.d.ts +59 -0
- package/dist/pipeline/parallel-progress.js +263 -0
- package/dist/pipeline/parallel-progress.js.map +1 -0
- package/dist/pipeline/pipeline-runner.d.ts +49 -8
- package/dist/pipeline/pipeline-runner.js +375 -226
- package/dist/pipeline/pipeline-runner.js.map +1 -1
- package/dist/pipeline/pipeline-shared.d.ts +58 -0
- package/dist/pipeline/pipeline-shared.js +124 -1
- package/dist/pipeline/pipeline-shared.js.map +1 -1
- package/dist/pipeline/server-prefilter.d.ts +31 -0
- package/dist/pipeline/server-prefilter.js +115 -0
- package/dist/pipeline/server-prefilter.js.map +1 -0
- package/dist/pipeline/types.d.ts +5 -0
- package/dist/session/preflight.js +15 -16
- package/dist/session/preflight.js.map +1 -1
- package/dist/trusted-process/sandbox-integration.js +8 -0
- package/dist/trusted-process/sandbox-integration.js.map +1 -1
- package/docker/Dockerfile.base +3 -1
- package/docker/Dockerfile.base.arm64 +8 -1
- package/package.json +4 -1
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* cycle, then results are merged. This enables incremental recompilation and
|
|
11
11
|
* better per-server rule quality.
|
|
12
12
|
*/
|
|
13
|
+
import type { LanguageModelV3 } from '@ai-sdk/provider';
|
|
13
14
|
import type { LanguageModel } from 'ai';
|
|
14
15
|
import type { MCPServerConfig } from '../config/types.js';
|
|
15
|
-
import type { LlmLogContext } from './llm-logger.js';
|
|
16
16
|
import type { PromptCacheStrategy } from '../session/prompt-cache.js';
|
|
17
17
|
import type { CompiledPolicyFile, CompiledRule, DynamicListsFile, ListDefinition, StoredToolAnnotationsFile, TestScenario, ToolAnnotation } from './types.js';
|
|
18
18
|
/**
|
|
@@ -57,16 +57,28 @@ export interface PipelineRunConfig {
|
|
|
57
57
|
readonly preloadedStoredAnnotations?: StoredToolAnnotationsFile;
|
|
58
58
|
/** Compile only these servers (default: all servers in annotations). */
|
|
59
59
|
readonly serverFilter?: string[];
|
|
60
|
+
/**
|
|
61
|
+
* Text for the pre-filter to evaluate server relevance against.
|
|
62
|
+
* Caller provides the appropriate text for the compilation mode:
|
|
63
|
+
* - Constitution mode: user constitution only (without base principles)
|
|
64
|
+
* - Task-policy mode: task description
|
|
65
|
+
* - Persona mode: persona constitution
|
|
66
|
+
*
|
|
67
|
+
* When undefined, the pre-filter is skipped.
|
|
68
|
+
*/
|
|
69
|
+
readonly prefilterText?: string;
|
|
60
70
|
}
|
|
61
71
|
/**
|
|
62
72
|
* LLM model references shared across pipeline runs.
|
|
63
73
|
* Thin wrapper around PipelineLlm with a renamed field for clarity.
|
|
64
74
|
*/
|
|
65
75
|
export interface PipelineModels {
|
|
66
|
-
|
|
76
|
+
/** The unwrapped base model for creating per-server wrapped models. */
|
|
77
|
+
readonly baseLlm: LanguageModelV3;
|
|
67
78
|
readonly cacheStrategy: PromptCacheStrategy;
|
|
68
|
-
readonly logContext: LlmLogContext;
|
|
69
79
|
readonly logPath: string;
|
|
80
|
+
/** Cheap model for pre-filter classification (Haiku). */
|
|
81
|
+
readonly prefilterModel: LanguageModel;
|
|
70
82
|
}
|
|
71
83
|
/** Creates PipelineModels from user config. Delegates to shared createPipelineLlm. */
|
|
72
84
|
export declare function createPipelineModels(logDir?: string): Promise<PipelineModels>;
|
|
@@ -108,7 +120,10 @@ export declare function deduplicateListDefinitions(defs: ListDefinition[]): List
|
|
|
108
120
|
* Rules are concatenated in alphabetical server order for determinism.
|
|
109
121
|
* List definitions are deduplicated by name.
|
|
110
122
|
*/
|
|
111
|
-
export declare function mergeServerResults(results: ServerCompilationResult[], constitutionHash: string
|
|
123
|
+
export declare function mergeServerResults(results: ServerCompilationResult[], constitutionHash: string, skippedServers?: Array<{
|
|
124
|
+
serverName: string;
|
|
125
|
+
reason: string;
|
|
126
|
+
}>): CompiledPolicyFile;
|
|
112
127
|
/**
|
|
113
128
|
* Encapsulates the full policy compilation pipeline:
|
|
114
129
|
* compile rules -> generate scenarios -> verify -> repair loop.
|
|
@@ -118,9 +133,10 @@ export declare function mergeServerResults(results: ServerCompilationResult[], c
|
|
|
118
133
|
* (broad principles) and 'task-policy' (strict whitelist) modes.
|
|
119
134
|
*/
|
|
120
135
|
export declare class PipelineRunner {
|
|
121
|
-
private readonly
|
|
136
|
+
private readonly baseLlm;
|
|
122
137
|
private readonly cacheStrategy;
|
|
123
|
-
private readonly
|
|
138
|
+
private readonly logPath;
|
|
139
|
+
private readonly prefilterModel;
|
|
124
140
|
constructor(models: PipelineModels);
|
|
125
141
|
/**
|
|
126
142
|
* Runs the full pipeline. Returns the compiled policy on success.
|
|
@@ -141,15 +157,40 @@ export declare class PipelineRunner {
|
|
|
141
157
|
*/
|
|
142
158
|
private runPerServer;
|
|
143
159
|
/**
|
|
144
|
-
* Compiles rules for all servers
|
|
145
|
-
*
|
|
160
|
+
* Compiles rules for all servers, in parallel when multiple servers are present.
|
|
161
|
+
* Single-server compilation uses sequential spinner-based output.
|
|
162
|
+
* Multi-server compilation uses parallel execution with a multi-line progress display.
|
|
146
163
|
*/
|
|
147
164
|
private compileAllServers;
|
|
165
|
+
/** Creates a per-server model wrapped with LLM call throttling. */
|
|
166
|
+
private createServerModel;
|
|
167
|
+
private compileServersSequential;
|
|
168
|
+
private compileServersParallel;
|
|
169
|
+
private handleCompilationResults;
|
|
148
170
|
/**
|
|
149
171
|
* Compiles a single server: compile -> generate scenarios -> verify -> repair.
|
|
150
172
|
* Self-contained compile-verify-repair loop per server.
|
|
173
|
+
*
|
|
174
|
+
* Each server receives its own model (with per-server logging middleware),
|
|
175
|
+
* logContext (for step labeling), and reporter (for progress/warnings).
|
|
176
|
+
* This makes the method safe for concurrent execution.
|
|
151
177
|
*/
|
|
152
178
|
private compileServer;
|
|
179
|
+
/**
|
|
180
|
+
* Runs initial verification and the compile-verify-repair loop for a server.
|
|
181
|
+
* Returns the mutable compilation state after all repair attempts.
|
|
182
|
+
*/
|
|
183
|
+
private verifyAndRepairServer;
|
|
184
|
+
/**
|
|
185
|
+
* Filters structurally conflicting scenarios and generates replacements
|
|
186
|
+
* for discarded ones via LLM repair (pre-loop, one-time).
|
|
187
|
+
*/
|
|
188
|
+
private filterAndRepairDiscardedScenarios;
|
|
189
|
+
/**
|
|
190
|
+
* Compile-verify-repair loop (up to 2 repair attempts).
|
|
191
|
+
* Mutates `state` in place with updated rules, lists, and verification results.
|
|
192
|
+
*/
|
|
193
|
+
private runRepairLoop;
|
|
153
194
|
/**
|
|
154
195
|
* Compiles policy rules for a single server (initial compilation).
|
|
155
196
|
* Uses per-server schema with requireServer: true.
|