@poncho-ai/harness 0.6.0 → 0.7.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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +10 -0
- package/dist/index.js +29 -8
- package/package.json +1 -1
- package/src/harness.ts +14 -6
- package/src/mcp.ts +9 -2
- package/src/tool-policy.ts +9 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.
|
|
2
|
+
> @poncho-ai/harness@0.7.0 build /Users/cesar/Dev/latitude/poncho-ai/packages/harness
|
|
3
3
|
> tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
CLI Building entry: src/index.ts
|
|
@@ -7,8 +7,8 @@ CLI Using tsconfig: tsconfig.json
|
|
|
7
7
|
CLI tsup v8.5.1
|
|
8
8
|
CLI Target: es2022
|
|
9
9
|
ESM Build start
|
|
10
|
-
ESM dist/index.js
|
|
11
|
-
ESM ⚡️ Build success in
|
|
10
|
+
ESM dist/index.js 115.52 KB
|
|
11
|
+
ESM ⚡️ Build success in 56ms
|
|
12
12
|
DTS Build start
|
|
13
|
-
DTS ⚡️ Build success in
|
|
13
|
+
DTS ⚡️ Build success in 2668ms
|
|
14
14
|
DTS dist/index.d.ts 16.10 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Simplify MCP tool patterns and improve auth UI
|
|
8
|
+
- Allow tool patterns without server prefix in poncho.config.js (e.g., `include: ['*']` instead of `include: ['linear/*']`)
|
|
9
|
+
- Fix auth screen button styling to be fully rounded with centered arrow
|
|
10
|
+
- Add self-extension capabilities section to development mode instructions
|
|
11
|
+
- Update documentation to clarify MCP pattern formats
|
|
12
|
+
|
|
3
13
|
## 0.6.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import YAML from "yaml";
|
|
|
7
7
|
|
|
8
8
|
// src/tool-policy.ts
|
|
9
9
|
var MCP_PATTERN = /^[^/*\s]+\/(\*|[^/*\s]+)$/;
|
|
10
|
+
var MCP_TOOL_PATTERN = /^(\*|[^/*\s]+)$/;
|
|
10
11
|
var SCRIPT_PATTERN = /^[^/*\s]+\/(\*|[^*\s]+)$/;
|
|
11
12
|
var validateMcpPattern = (pattern, path) => {
|
|
12
13
|
if (!MCP_PATTERN.test(pattern)) {
|
|
@@ -15,6 +16,13 @@ var validateMcpPattern = (pattern, path) => {
|
|
|
15
16
|
);
|
|
16
17
|
}
|
|
17
18
|
};
|
|
19
|
+
var validateMcpToolPattern = (pattern, path) => {
|
|
20
|
+
if (!MCP_TOOL_PATTERN.test(pattern)) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
`Invalid MCP tool pattern at ${path}: "${pattern}". Expected "tool" or "*".`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
18
26
|
var validateScriptPattern = (pattern, path) => {
|
|
19
27
|
if (!SCRIPT_PATTERN.test(pattern)) {
|
|
20
28
|
throw new Error(
|
|
@@ -1057,7 +1065,7 @@ var LocalMcpBridge = class {
|
|
|
1057
1065
|
const policy = server.tools;
|
|
1058
1066
|
const validateList = (values, path) => {
|
|
1059
1067
|
for (const [index, value] of (values ?? []).entries()) {
|
|
1060
|
-
|
|
1068
|
+
validateMcpToolPattern(value, `${path}[${index}]`);
|
|
1061
1069
|
}
|
|
1062
1070
|
};
|
|
1063
1071
|
validateList(policy?.include, `mcp.${serverName}.tools.include`);
|
|
@@ -1230,7 +1238,12 @@ var LocalMcpBridge = class {
|
|
|
1230
1238
|
const discovered = this.toolCatalog.get(serverName) ?? [];
|
|
1231
1239
|
const fullNames = discovered.map((tool) => `${serverName}/${tool.name}`);
|
|
1232
1240
|
const effectivePolicy = mergePolicyForEnvironment(server.tools, environment);
|
|
1233
|
-
const
|
|
1241
|
+
const fullPatternPolicy = effectivePolicy ? {
|
|
1242
|
+
...effectivePolicy,
|
|
1243
|
+
include: effectivePolicy.include?.map((p) => `${serverName}/${p}`),
|
|
1244
|
+
exclude: effectivePolicy.exclude?.map((p) => `${serverName}/${p}`)
|
|
1245
|
+
} : effectivePolicy;
|
|
1246
|
+
const policyDecision = applyToolPolicy(fullNames, fullPatternPolicy);
|
|
1234
1247
|
filteredByPolicy.push(...policyDecision.filteredOut);
|
|
1235
1248
|
const selectedFullNames = policyDecision.allowed.filter(
|
|
1236
1249
|
(toolName) => requestedPatterns.some((pattern) => matchesSlashPattern(toolName, pattern))
|
|
@@ -1962,6 +1975,15 @@ You are running locally in development mode. Treat this as an editable agent wor
|
|
|
1962
1975
|
- For setup/configuration/skills/MCP questions, proactively read \`README.md\` with \`read_file\` before answering
|
|
1963
1976
|
- Prefer concrete commands and examples from \`README.md\` over assumptions
|
|
1964
1977
|
|
|
1978
|
+
## Self-Extension Capabilities
|
|
1979
|
+
|
|
1980
|
+
You can extend your own capabilities by creating custom JavaScript/TypeScript scripts:
|
|
1981
|
+
|
|
1982
|
+
- Create scripts under \`skills/<skill-name>/scripts/\` to add new functionality
|
|
1983
|
+
- Scripts can perform any Node.js operations: API calls, file processing, data transformations, web scraping, etc.
|
|
1984
|
+
- Use the \`run_skill_script\` tool to execute these scripts and integrate results into your workflow
|
|
1985
|
+
- This allows you to dynamically add custom tools and capabilities as users need them, without requiring external dependencies or MCP servers
|
|
1986
|
+
|
|
1965
1987
|
## When users ask about customization:
|
|
1966
1988
|
|
|
1967
1989
|
- Explain and edit \`poncho.config.js\` for model/provider, storage+memory, auth, telemetry, and MCP settings.
|
|
@@ -1969,17 +1991,16 @@ You are running locally in development mode. Treat this as an editable agent wor
|
|
|
1969
1991
|
- For executable skills, add JavaScript/TypeScript scripts under \`skills/<skill-name>/scripts/\` and run them via \`run_skill_script\`.
|
|
1970
1992
|
- For MCP setup, default to direct \`poncho.config.js\` edits (\`mcp\` entries with URL, bearer token env, and tool policy).
|
|
1971
1993
|
- Keep MCP server connection details in \`poncho.config.js\` only (name/url/auth/tools policy). Do not move server definitions into \`SKILL.md\`.
|
|
1972
|
-
- In \`AGENT.md\`/\`SKILL.md
|
|
1973
|
-
- Never use nested MCP objects in skill frontmatter (for example \`mcp: [{ name, url, auth }]\`)
|
|
1974
|
-
- To scope tools to a skill: keep server config in \`poncho.config.js\`, add desired \`tools
|
|
1994
|
+
- In \`AGENT.md\`/\`SKILL.md\` frontmatter, declare MCP tools in \`allowed-tools\` array as \`mcp:server/pattern\` (for example \`mcp:linear/*\` or \`mcp:linear/list_issues\`).
|
|
1995
|
+
- Never use nested MCP objects in skill frontmatter (for example \`mcp: [{ name, url, auth }]\`).
|
|
1996
|
+
- To scope tools to a skill: keep server config in \`poncho.config.js\`, add desired \`allowed-tools\` patterns in that skill's \`SKILL.md\`, and remove global \`AGENT.md\` patterns if you do not want global availability.
|
|
1975
1997
|
- Do not invent unsupported top-level config keys (for example \`model\` in \`poncho.config.js\`). Keep existing config structure unless README/spec explicitly says otherwise.
|
|
1976
|
-
- In \`poncho.config.js\`, MCP tool
|
|
1998
|
+
- In \`poncho.config.js\`, MCP tool patterns are scoped within each server object, so use just the tool name (for example \`include: ["*"]\` or \`include: ["list_issues"]\`), not the full \`server/tool\` format.
|
|
1977
1999
|
- Keep \`poncho.config.js\` valid JavaScript and preserve existing imports/types/comments. If there is a JSDoc type import, do not rewrite it to a different package name.
|
|
1978
2000
|
- Preferred MCP config shape in \`poncho.config.js\`:
|
|
1979
|
-
\`mcp: [{ name: "linear", url: "https://mcp.linear.app/mcp", auth: { type: "bearer", tokenEnv: "LINEAR_TOKEN" }, tools: { mode: "allowlist", include: ["
|
|
2001
|
+
\`mcp: [{ name: "linear", url: "https://mcp.linear.app/mcp", auth: { type: "bearer", tokenEnv: "LINEAR_TOKEN" }, tools: { mode: "allowlist", include: ["*"] } }]\`
|
|
1980
2002
|
- If shell/CLI access exists, you can use \`poncho mcp add --url ... --name ... --auth-bearer-env ...\`, then \`poncho mcp tools list <server>\` and \`poncho mcp tools select <server>\`.
|
|
1981
2003
|
- If shell/CLI access is unavailable, ask the user to run needed commands and provide exact copy-paste commands.
|
|
1982
|
-
- Use strict slash patterns for MCP tool selections (\`server/tool\`, \`server/*\`) and verify by inspecting config/tool state.
|
|
1983
2004
|
- For setup, skills, MCP, auth, storage, telemetry, or "how do I..." questions, proactively read \`README.md\` with \`read_file\` before answering.
|
|
1984
2005
|
- Prefer quoting concrete commands and examples from \`README.md\` over guessing.
|
|
1985
2006
|
- Keep edits minimal, preserve unrelated settings/code, and summarize what changed.`;
|
package/package.json
CHANGED
package/src/harness.ts
CHANGED
|
@@ -108,6 +108,15 @@ You are running locally in development mode. Treat this as an editable agent wor
|
|
|
108
108
|
- For setup/configuration/skills/MCP questions, proactively read \`README.md\` with \`read_file\` before answering
|
|
109
109
|
- Prefer concrete commands and examples from \`README.md\` over assumptions
|
|
110
110
|
|
|
111
|
+
## Self-Extension Capabilities
|
|
112
|
+
|
|
113
|
+
You can extend your own capabilities by creating custom JavaScript/TypeScript scripts:
|
|
114
|
+
|
|
115
|
+
- Create scripts under \`skills/<skill-name>/scripts/\` to add new functionality
|
|
116
|
+
- Scripts can perform any Node.js operations: API calls, file processing, data transformations, web scraping, etc.
|
|
117
|
+
- Use the \`run_skill_script\` tool to execute these scripts and integrate results into your workflow
|
|
118
|
+
- This allows you to dynamically add custom tools and capabilities as users need them, without requiring external dependencies or MCP servers
|
|
119
|
+
|
|
111
120
|
## When users ask about customization:
|
|
112
121
|
|
|
113
122
|
- Explain and edit \`poncho.config.js\` for model/provider, storage+memory, auth, telemetry, and MCP settings.
|
|
@@ -115,17 +124,16 @@ You are running locally in development mode. Treat this as an editable agent wor
|
|
|
115
124
|
- For executable skills, add JavaScript/TypeScript scripts under \`skills/<skill-name>/scripts/\` and run them via \`run_skill_script\`.
|
|
116
125
|
- For MCP setup, default to direct \`poncho.config.js\` edits (\`mcp\` entries with URL, bearer token env, and tool policy).
|
|
117
126
|
- Keep MCP server connection details in \`poncho.config.js\` only (name/url/auth/tools policy). Do not move server definitions into \`SKILL.md\`.
|
|
118
|
-
- In \`AGENT.md\`/\`SKILL.md
|
|
119
|
-
- Never use nested MCP objects in skill frontmatter (for example \`mcp: [{ name, url, auth }]\`)
|
|
120
|
-
- To scope tools to a skill: keep server config in \`poncho.config.js\`, add desired \`tools
|
|
127
|
+
- In \`AGENT.md\`/\`SKILL.md\` frontmatter, declare MCP tools in \`allowed-tools\` array as \`mcp:server/pattern\` (for example \`mcp:linear/*\` or \`mcp:linear/list_issues\`).
|
|
128
|
+
- Never use nested MCP objects in skill frontmatter (for example \`mcp: [{ name, url, auth }]\`).
|
|
129
|
+
- To scope tools to a skill: keep server config in \`poncho.config.js\`, add desired \`allowed-tools\` patterns in that skill's \`SKILL.md\`, and remove global \`AGENT.md\` patterns if you do not want global availability.
|
|
121
130
|
- Do not invent unsupported top-level config keys (for example \`model\` in \`poncho.config.js\`). Keep existing config structure unless README/spec explicitly says otherwise.
|
|
122
|
-
- In \`poncho.config.js\`, MCP tool
|
|
131
|
+
- In \`poncho.config.js\`, MCP tool patterns are scoped within each server object, so use just the tool name (for example \`include: ["*"]\` or \`include: ["list_issues"]\`), not the full \`server/tool\` format.
|
|
123
132
|
- Keep \`poncho.config.js\` valid JavaScript and preserve existing imports/types/comments. If there is a JSDoc type import, do not rewrite it to a different package name.
|
|
124
133
|
- Preferred MCP config shape in \`poncho.config.js\`:
|
|
125
|
-
\`mcp: [{ name: "linear", url: "https://mcp.linear.app/mcp", auth: { type: "bearer", tokenEnv: "LINEAR_TOKEN" }, tools: { mode: "allowlist", include: ["
|
|
134
|
+
\`mcp: [{ name: "linear", url: "https://mcp.linear.app/mcp", auth: { type: "bearer", tokenEnv: "LINEAR_TOKEN" }, tools: { mode: "allowlist", include: ["*"] } }]\`
|
|
126
135
|
- If shell/CLI access exists, you can use \`poncho mcp add --url ... --name ... --auth-bearer-env ...\`, then \`poncho mcp tools list <server>\` and \`poncho mcp tools select <server>\`.
|
|
127
136
|
- If shell/CLI access is unavailable, ask the user to run needed commands and provide exact copy-paste commands.
|
|
128
|
-
- Use strict slash patterns for MCP tool selections (\`server/tool\`, \`server/*\`) and verify by inspecting config/tool state.
|
|
129
137
|
- For setup, skills, MCP, auth, storage, telemetry, or "how do I..." questions, proactively read \`README.md\` with \`read_file\` before answering.
|
|
130
138
|
- Prefer quoting concrete commands and examples from \`README.md\` over guessing.
|
|
131
139
|
- Keep edits minimal, preserve unrelated settings/code, and summarize what changed.`;
|
package/src/mcp.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
type RuntimeEnvironment,
|
|
7
7
|
type ToolPatternPolicy,
|
|
8
8
|
validateMcpPattern,
|
|
9
|
+
validateMcpToolPattern,
|
|
9
10
|
} from "./tool-policy.js";
|
|
10
11
|
|
|
11
12
|
export interface RemoteMcpServerConfig {
|
|
@@ -304,7 +305,7 @@ export class LocalMcpBridge {
|
|
|
304
305
|
const policy = server.tools;
|
|
305
306
|
const validateList = (values: string[] | undefined, path: string): void => {
|
|
306
307
|
for (const [index, value] of (values ?? []).entries()) {
|
|
307
|
-
|
|
308
|
+
validateMcpToolPattern(value, `${path}[${index}]`);
|
|
308
309
|
}
|
|
309
310
|
};
|
|
310
311
|
validateList(policy?.include, `mcp.${serverName}.tools.include`);
|
|
@@ -494,7 +495,13 @@ export class LocalMcpBridge {
|
|
|
494
495
|
const discovered = this.toolCatalog.get(serverName) ?? [];
|
|
495
496
|
const fullNames = discovered.map((tool) => `${serverName}/${tool.name}`);
|
|
496
497
|
const effectivePolicy = mergePolicyForEnvironment(server.tools, environment);
|
|
497
|
-
|
|
498
|
+
// Prepend server name to patterns for matching
|
|
499
|
+
const fullPatternPolicy = effectivePolicy ? {
|
|
500
|
+
...effectivePolicy,
|
|
501
|
+
include: effectivePolicy.include?.map((p) => `${serverName}/${p}`),
|
|
502
|
+
exclude: effectivePolicy.exclude?.map((p) => `${serverName}/${p}`),
|
|
503
|
+
} : effectivePolicy;
|
|
504
|
+
const policyDecision = applyToolPolicy(fullNames, fullPatternPolicy);
|
|
498
505
|
filteredByPolicy.push(...policyDecision.filteredOut);
|
|
499
506
|
const selectedFullNames = policyDecision.allowed.filter((toolName) =>
|
|
500
507
|
requestedPatterns.some((pattern) => matchesSlashPattern(toolName, pattern)),
|
package/src/tool-policy.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface ToolPatternPolicy {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const MCP_PATTERN = /^[^/*\s]+\/(\*|[^/*\s]+)$/;
|
|
17
|
+
const MCP_TOOL_PATTERN = /^(\*|[^/*\s]+)$/;
|
|
17
18
|
const SCRIPT_PATTERN = /^[^/*\s]+\/(\*|[^*\s]+)$/;
|
|
18
19
|
|
|
19
20
|
export const validateMcpPattern = (pattern: string, path: string): void => {
|
|
@@ -24,6 +25,14 @@ export const validateMcpPattern = (pattern: string, path: string): void => {
|
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
27
|
|
|
28
|
+
export const validateMcpToolPattern = (pattern: string, path: string): void => {
|
|
29
|
+
if (!MCP_TOOL_PATTERN.test(pattern)) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`Invalid MCP tool pattern at ${path}: "${pattern}". Expected "tool" or "*".`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
27
36
|
export const validateScriptPattern = (pattern: string, path: string): void => {
|
|
28
37
|
if (!SCRIPT_PATTERN.test(pattern)) {
|
|
29
38
|
throw new Error(
|