@poncho-ai/harness 0.7.0 → 0.7.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/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +25 -20
- package/dist/index.js +330 -246
- package/package.json +3 -3
- package/src/agent-parser.ts +70 -23
- package/src/config.ts +0 -2
- package/src/harness.ts +127 -75
- package/src/mcp.ts +5 -58
- package/src/skill-context.ts +86 -27
- package/src/skill-tools.ts +103 -60
- package/src/state.ts +6 -0
- package/src/tool-policy.ts +39 -0
- package/test/agent-parser.test.ts +26 -0
- package/test/harness.test.ts +113 -26
- package/test/mcp.test.ts +9 -24
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.7.
|
|
2
|
+
> @poncho-ai/harness@0.7.2 build /Users/cesar/Dev/latitude/poncho-ai/packages/harness
|
|
3
3
|
> tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Target: es2022
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m119.54 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 32ms
|
|
12
|
+
[34mDTS[39m Build start
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 3824ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m16.21 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ interface AgentFrontmatter {
|
|
|
22
22
|
mcp?: string[];
|
|
23
23
|
scripts?: string[];
|
|
24
24
|
};
|
|
25
|
+
approvalRequired?: {
|
|
26
|
+
mcp?: string[];
|
|
27
|
+
scripts?: string[];
|
|
28
|
+
};
|
|
25
29
|
}
|
|
26
30
|
interface ParsedAgent {
|
|
27
31
|
frontmatter: AgentFrontmatter;
|
|
@@ -55,6 +59,12 @@ interface Conversation {
|
|
|
55
59
|
title: string;
|
|
56
60
|
messages: Message[];
|
|
57
61
|
runtimeRunId?: string;
|
|
62
|
+
pendingApprovals?: Array<{
|
|
63
|
+
approvalId: string;
|
|
64
|
+
runId: string;
|
|
65
|
+
tool: string;
|
|
66
|
+
input: Record<string, unknown>;
|
|
67
|
+
}>;
|
|
58
68
|
ownerId: string;
|
|
59
69
|
tenantId: string | null;
|
|
60
70
|
createdAt: number;
|
|
@@ -134,19 +144,6 @@ declare const createMemoryTools: (store: MemoryStore, options?: {
|
|
|
134
144
|
maxRecallConversations?: number;
|
|
135
145
|
}) => ToolDefinition[];
|
|
136
146
|
|
|
137
|
-
type RuntimeEnvironment = "development" | "staging" | "production";
|
|
138
|
-
type ToolPolicyMode = "all" | "allowlist" | "denylist";
|
|
139
|
-
interface ToolPatternPolicy {
|
|
140
|
-
mode?: ToolPolicyMode;
|
|
141
|
-
include?: string[];
|
|
142
|
-
exclude?: string[];
|
|
143
|
-
byEnvironment?: {
|
|
144
|
-
development?: Omit<ToolPatternPolicy, "byEnvironment">;
|
|
145
|
-
staging?: Omit<ToolPatternPolicy, "byEnvironment">;
|
|
146
|
-
production?: Omit<ToolPatternPolicy, "byEnvironment">;
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
147
|
interface RemoteMcpServerConfig {
|
|
151
148
|
name?: string;
|
|
152
149
|
url: string;
|
|
@@ -155,7 +152,6 @@ interface RemoteMcpServerConfig {
|
|
|
155
152
|
type: "bearer";
|
|
156
153
|
tokenEnv?: string;
|
|
157
154
|
};
|
|
158
|
-
tools?: ToolPatternPolicy;
|
|
159
155
|
timeoutMs?: number;
|
|
160
156
|
reconnectAttempts?: number;
|
|
161
157
|
reconnectDelayMs?: number;
|
|
@@ -170,7 +166,6 @@ declare class LocalMcpBridge {
|
|
|
170
166
|
private readonly unavailableServers;
|
|
171
167
|
private readonly authFailedServers;
|
|
172
168
|
constructor(config: McpConfig | undefined);
|
|
173
|
-
private validatePolicy;
|
|
174
169
|
private getServerName;
|
|
175
170
|
private log;
|
|
176
171
|
discoverTools(): Promise<void>;
|
|
@@ -186,7 +181,7 @@ declare class LocalMcpBridge {
|
|
|
186
181
|
toSerializableConfig(): McpConfig;
|
|
187
182
|
getLocalServers(): never[];
|
|
188
183
|
listDiscoveredTools(serverName?: string): string[];
|
|
189
|
-
loadTools(requestedPatterns: string[]
|
|
184
|
+
loadTools(requestedPatterns: string[]): Promise<ToolDefinition[]>;
|
|
190
185
|
private toToolDefinitions;
|
|
191
186
|
}
|
|
192
187
|
|
|
@@ -245,7 +240,6 @@ interface PonchoConfig extends McpConfig {
|
|
|
245
240
|
handler?: (event: unknown) => Promise<void> | void;
|
|
246
241
|
};
|
|
247
242
|
skills?: Record<string, Record<string, unknown>>;
|
|
248
|
-
scripts?: ToolPatternPolicy;
|
|
249
243
|
/** Extra directories (relative to project root) to scan for skills.
|
|
250
244
|
* `skills/` and `.poncho/skills/` are always scanned. */
|
|
251
245
|
skillPaths?: string[];
|
|
@@ -311,15 +305,19 @@ declare class AgentHarness {
|
|
|
311
305
|
private registerConfiguredBuiltInTools;
|
|
312
306
|
private shouldEnableWriteTool;
|
|
313
307
|
constructor(options?: HarnessOptions);
|
|
314
|
-
private runtimeEnvironment;
|
|
315
308
|
private listActiveSkills;
|
|
316
309
|
private getAgentMcpIntent;
|
|
317
310
|
private getAgentScriptIntent;
|
|
311
|
+
private getAgentMcpApprovalPatterns;
|
|
312
|
+
private getAgentScriptApprovalPatterns;
|
|
318
313
|
private getRequestedMcpPatterns;
|
|
319
314
|
private getRequestedScriptPatterns;
|
|
315
|
+
private getRequestedMcpApprovalPatterns;
|
|
316
|
+
private getRequestedScriptApprovalPatterns;
|
|
320
317
|
private isScriptAllowedByPolicy;
|
|
318
|
+
private isRootScriptAllowedByPolicy;
|
|
319
|
+
private requiresApprovalForToolCall;
|
|
321
320
|
private refreshMcpTools;
|
|
322
|
-
private validateScriptPolicyConfig;
|
|
323
321
|
initialize(): Promise<void>;
|
|
324
322
|
shutdown(): Promise<void>;
|
|
325
323
|
listTools(): ToolDefinition[];
|
|
@@ -395,6 +393,10 @@ interface SkillMetadata {
|
|
|
395
393
|
mcp: string[];
|
|
396
394
|
scripts: string[];
|
|
397
395
|
};
|
|
396
|
+
approvalRequired: {
|
|
397
|
+
mcp: string[];
|
|
398
|
+
scripts: string[];
|
|
399
|
+
};
|
|
398
400
|
/** Absolute path to the skill directory. */
|
|
399
401
|
skillDir: string;
|
|
400
402
|
/** Absolute path to the SKILL.md file. */
|
|
@@ -422,11 +424,14 @@ declare const loadSkillContext: (workingDir: string) => Promise<SkillContextEntr
|
|
|
422
424
|
* - `run_skill_script` — executes a JavaScript/TypeScript module under scripts/
|
|
423
425
|
*/
|
|
424
426
|
declare const createSkillTools: (skills: SkillMetadata[], options?: {
|
|
427
|
+
workingDir?: string;
|
|
425
428
|
onActivateSkill?: (name: string) => Promise<string[]> | string[];
|
|
426
429
|
onDeactivateSkill?: (name: string) => Promise<string[]> | string[];
|
|
427
430
|
onListActiveSkills?: () => string[];
|
|
428
431
|
isScriptAllowed?: (skill: string, scriptPath: string) => boolean;
|
|
432
|
+
isRootScriptAllowed?: (scriptPath: string) => boolean;
|
|
429
433
|
}) => ToolDefinition[];
|
|
434
|
+
declare const normalizeScriptPolicyPath: (relativePath: string) => string;
|
|
430
435
|
|
|
431
436
|
interface TelemetryConfig {
|
|
432
437
|
enabled?: boolean;
|
|
@@ -470,4 +475,4 @@ declare class ToolDispatcher {
|
|
|
470
475
|
executeBatch(calls: ToolCall[], context: ToolContext): Promise<ToolExecutionResult[]>;
|
|
471
476
|
}
|
|
472
477
|
|
|
473
|
-
export { type AgentFrontmatter, AgentHarness, type AgentLimitsConfig, type AgentModelConfig, type BuiltInToolToggles, type Conversation, type ConversationState, type ConversationStore, type HarnessOptions, type HarnessRunOutput, InMemoryConversationStore, InMemoryStateStore, LatitudeCapture, type LatitudeCaptureConfig, LocalMcpBridge, type MainMemory, type McpConfig, type MemoryConfig, type MemoryStore, type ModelProviderFactory, type ParsedAgent, type PonchoConfig, type RemoteMcpServerConfig, type RuntimeRenderContext, type SkillContextEntry, type SkillMetadata, type StateConfig, type StateProviderName, type StateStore, type StorageConfig, type TelemetryConfig, TelemetryEmitter, type ToolCall, ToolDispatcher, type ToolExecutionResult, buildSkillContextWindow, createConversationStore, createDefaultTools, createMemoryStore, createMemoryTools, createModelProvider, createSkillTools, createStateStore, createWriteTool, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, parseAgentFile, parseAgentMarkdown, readSkillResource, renderAgentPrompt, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig };
|
|
478
|
+
export { type AgentFrontmatter, AgentHarness, type AgentLimitsConfig, type AgentModelConfig, type BuiltInToolToggles, type Conversation, type ConversationState, type ConversationStore, type HarnessOptions, type HarnessRunOutput, InMemoryConversationStore, InMemoryStateStore, LatitudeCapture, type LatitudeCaptureConfig, LocalMcpBridge, type MainMemory, type McpConfig, type MemoryConfig, type MemoryStore, type ModelProviderFactory, type ParsedAgent, type PonchoConfig, type RemoteMcpServerConfig, type RuntimeRenderContext, type SkillContextEntry, type SkillMetadata, type StateConfig, type StateProviderName, type StateStore, type StorageConfig, type TelemetryConfig, TelemetryEmitter, type ToolCall, ToolDispatcher, type ToolExecutionResult, buildSkillContextWindow, createConversationStore, createDefaultTools, createMemoryStore, createMemoryTools, createModelProvider, createSkillTools, createStateStore, createWriteTool, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, readSkillResource, renderAgentPrompt, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig };
|