@freesyntax/notch-cli 0.5.21 → 0.5.23
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/{apply-patch-D5PDUXUC.js → apply-patch-U6K67CMT.js} +1 -0
- package/dist/auth-UAMMP5IJ.js +29 -0
- package/dist/{chunk-TU465P2P.js → chunk-474TAHDN.js} +50 -8
- package/dist/{chunk-OSWUX6TC.js → chunk-4HPRBCSY.js} +1 -1
- package/dist/{chunk-QKM27RHS.js → chunk-6NKRMZTX.js} +1 -1
- package/dist/{chunk-443G6HCC.js → chunk-JVFOAPYV.js} +331 -79
- package/dist/chunk-KCAR5DOB.js +52 -0
- package/dist/chunk-KFQGP6VL.js +33 -0
- package/dist/chunk-O6AKZ4OH.js +0 -0
- package/dist/{chunk-FIFC4V2R.js → chunk-PPEBWOMJ.js} +91 -7
- package/dist/chunk-UHK6SI4H.js +206 -0
- package/dist/{chunk-MMBFNIKE.js → chunk-YNYVQ7ZI.js} +10 -8
- package/dist/{compression-SQAIQ2UU.js → compression-YJLWEHCC.js} +1 -0
- package/dist/config-set-5F4VK7IT.js +111 -0
- package/dist/{edit-JEFEK43H.js → edit-6QYAXVNU.js} +1 -0
- package/dist/{git-5T5TSQTX.js → git-DNQ5EELH.js} +1 -0
- package/dist/{github-DWRGWX6U.js → github-34T4QQIH.js} +1 -0
- package/dist/{glob-BI3P4C7Q.js → glob-XT43LEJ4.js} +1 -0
- package/dist/{grep-VZ3I5GNW.js → grep-T2CXYNRI.js} +1 -0
- package/dist/index.js +878 -428
- package/dist/{lsp-UPY6I3L7.js → lsp-JXQVU7NP.js} +1 -0
- package/dist/model-download-KCQJCEPW.js +176 -0
- package/dist/{notebook-FXJBTSPA.js → notebook-MFODW345.js} +1 -0
- package/dist/{ollama-bench-QQHBIG2D.js → ollama-bench-JLC5POG3.js} +8 -4
- package/dist/{ollama-launch-2ASVER3S.js → ollama-launch-3IKB2A3Z.js} +6 -2
- package/dist/{ollama-usage-2WPCZJJI.js → ollama-usage-3PROM2WC.js} +1 -0
- package/dist/{plugins-OG2P75K5.js → plugins-PNGRZLFW.js} +1 -0
- package/dist/{read-OVJG2XKW.js → read-B64XE7N3.js} +1 -0
- package/dist/server-GMF4WV67.js +187 -0
- package/dist/{session-index-SSGOOZXK.js → session-index-7FWEVP6E.js} +3 -2
- package/dist/{shell-4X545EVN.js → shell-BOZTHQUT.js} +1 -0
- package/dist/{task-OS3E5F3X.js → task-67G4KLYC.js} +1 -0
- package/dist/{tools-7WAWS6V4.js → tools-ABRZPCEJ.js} +6 -3
- package/dist/{web-fetch-KNIV3Z3W.js → web-fetch-OTNDICGJ.js} +1 -0
- package/dist/{write-NNHLOTYK.js → write-ZOSB7I4J.js} +1 -0
- package/package.json +60 -57
- package/dist/auth-JQX6MHJG.js +0 -16
- package/dist/server-7UQKCB2Z.js +0 -1477
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clearCredentials,
|
|
3
|
+
getByokSyncPath,
|
|
4
|
+
getConfigDir,
|
|
5
|
+
getCredentialsPath,
|
|
6
|
+
init_auth,
|
|
7
|
+
invalidateSyncedKeysCache,
|
|
8
|
+
loadCredentials,
|
|
9
|
+
loadSyncedByokKeys,
|
|
10
|
+
loadSyncedByokKeysSync,
|
|
11
|
+
login,
|
|
12
|
+
saveCredentials,
|
|
13
|
+
syncByokKeys
|
|
14
|
+
} from "./chunk-PPEBWOMJ.js";
|
|
15
|
+
import "./chunk-KFQGP6VL.js";
|
|
16
|
+
init_auth();
|
|
17
|
+
export {
|
|
18
|
+
clearCredentials,
|
|
19
|
+
getByokSyncPath,
|
|
20
|
+
getConfigDir,
|
|
21
|
+
getCredentialsPath,
|
|
22
|
+
invalidateSyncedKeysCache,
|
|
23
|
+
loadCredentials,
|
|
24
|
+
loadSyncedByokKeys,
|
|
25
|
+
loadSyncedByokKeysSync,
|
|
26
|
+
login,
|
|
27
|
+
saveCredentials,
|
|
28
|
+
syncByokKeys
|
|
29
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Rollout
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6NKRMZTX.js";
|
|
4
4
|
import {
|
|
5
5
|
grepTool
|
|
6
6
|
} from "./chunk-6CZCFY6H.js";
|
|
@@ -26,8 +26,9 @@ import {
|
|
|
26
26
|
pluginManager
|
|
27
27
|
} from "./chunk-3QUV4JEX.js";
|
|
28
28
|
import {
|
|
29
|
+
init_auth,
|
|
29
30
|
loadCredentials
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-PPEBWOMJ.js";
|
|
31
32
|
import {
|
|
32
33
|
readTool
|
|
33
34
|
} from "./chunk-CQMAVWLJ.js";
|
|
@@ -49,6 +50,7 @@ import {
|
|
|
49
50
|
|
|
50
51
|
// src/tools/index.ts
|
|
51
52
|
import { tool } from "ai";
|
|
53
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
52
54
|
|
|
53
55
|
// src/tools/code-mode.ts
|
|
54
56
|
import vm from "vm";
|
|
@@ -501,6 +503,7 @@ error: no running cell with that id (it may have already completed)`,
|
|
|
501
503
|
};
|
|
502
504
|
|
|
503
505
|
// src/tools/skill-manage.ts
|
|
506
|
+
init_auth();
|
|
504
507
|
import { z as z2 } from "zod";
|
|
505
508
|
var API_BASE_ENV = "NOTCH_API_URL";
|
|
506
509
|
var DEFAULT_API_BASE = "https://freesyntax.dev";
|
|
@@ -1694,6 +1697,7 @@ function mcpToolsToNotch(client, serverName) {
|
|
|
1694
1697
|
name: `mcp_${serverName}_${toolDef.name}`,
|
|
1695
1698
|
description: `[MCP/${serverName}] ${toolDef.description}`,
|
|
1696
1699
|
parameters: params,
|
|
1700
|
+
inputSchema: toolDef.inputSchema,
|
|
1697
1701
|
async execute(args, _ctx) {
|
|
1698
1702
|
try {
|
|
1699
1703
|
const result = await client.callTool(toolDef.name, args);
|
|
@@ -2316,8 +2320,7 @@ async function spawnSubagent(config) {
|
|
|
2316
2320
|
## Working Directory
|
|
2317
2321
|
${toolContext.cwd}
|
|
2318
2322
|
|
|
2319
|
-
|
|
2320
|
-
${Object.keys(tools).map((n) => `- ${n}`).join("\n")}`;
|
|
2323
|
+
${describeToolSchemas(subagentCtx, { includeNames: Object.keys(tools) })}`;
|
|
2321
2324
|
const messages = [
|
|
2322
2325
|
{ role: "user", content: prompt }
|
|
2323
2326
|
];
|
|
@@ -2452,8 +2455,7 @@ async function spawnBuiltinAgent(config) {
|
|
|
2452
2455
|
## Working Directory
|
|
2453
2456
|
${toolContext.cwd}
|
|
2454
2457
|
|
|
2455
|
-
|
|
2456
|
-
${Object.keys(tools).map((n) => `- ${n}`).join("\n")}`;
|
|
2458
|
+
${describeToolSchemas(subagentCtx, { includeNames: Object.keys(tools) })}`;
|
|
2457
2459
|
const messages = [{ role: "user", content: prompt }];
|
|
2458
2460
|
let iterations = 0;
|
|
2459
2461
|
let totalToolCalls = 0;
|
|
@@ -3079,11 +3081,50 @@ ${paramSummary}`
|
|
|
3079
3081
|
function listToolNames(ctx) {
|
|
3080
3082
|
return getAllTools(ctx).map((t) => t.name);
|
|
3081
3083
|
}
|
|
3082
|
-
function
|
|
3084
|
+
function describeTools(ctx) {
|
|
3083
3085
|
return getAllTools(ctx).map(
|
|
3084
3086
|
(t) => `- **${t.name}**: ${t.description}`
|
|
3085
3087
|
).join("\n");
|
|
3086
3088
|
}
|
|
3089
|
+
function describeToolSchemas(ctx, options = {}) {
|
|
3090
|
+
const include = options.includeNames ? new Set(options.includeNames) : null;
|
|
3091
|
+
const tools = getAllTools(ctx).filter((t) => !include || include.has(t.name));
|
|
3092
|
+
if (tools.length === 0) return "## Tool Schemas\nNo tools are available in this mode.";
|
|
3093
|
+
const lines = [
|
|
3094
|
+
"## Tool Schemas",
|
|
3095
|
+
"Native tool schemas are sent with every model request. They are repeated here so OpenAI-compatible routers and local models can reliably choose valid tools.",
|
|
3096
|
+
"When using a tool, call the native tool with exactly one listed name and a JSON object matching its parameters schema. Do not print tool-call JSON as normal text.",
|
|
3097
|
+
""
|
|
3098
|
+
];
|
|
3099
|
+
for (const t of tools) {
|
|
3100
|
+
const schema = toolPromptSchema(t);
|
|
3101
|
+
lines.push(`### ${t.name}`);
|
|
3102
|
+
lines.push(t.description);
|
|
3103
|
+
lines.push("Parameters JSON Schema:");
|
|
3104
|
+
lines.push("```json");
|
|
3105
|
+
lines.push(JSON.stringify(schema));
|
|
3106
|
+
lines.push("```");
|
|
3107
|
+
lines.push("");
|
|
3108
|
+
}
|
|
3109
|
+
return lines.join("\n").trimEnd();
|
|
3110
|
+
}
|
|
3111
|
+
function toolPromptSchema(t) {
|
|
3112
|
+
const schema = t.inputSchema ?? zodToJsonSchema(t.parameters, {
|
|
3113
|
+
target: "jsonSchema7",
|
|
3114
|
+
$refStrategy: "none"
|
|
3115
|
+
});
|
|
3116
|
+
return stripSchemaNoise(schema);
|
|
3117
|
+
}
|
|
3118
|
+
function stripSchemaNoise(value) {
|
|
3119
|
+
if (Array.isArray(value)) return value.map(stripSchemaNoise);
|
|
3120
|
+
if (!value || typeof value !== "object") return value;
|
|
3121
|
+
const out = {};
|
|
3122
|
+
for (const [key, raw] of Object.entries(value)) {
|
|
3123
|
+
if (key === "$schema" || key === "definitions" || key === "$defs") continue;
|
|
3124
|
+
out[key] = stripSchemaNoise(raw);
|
|
3125
|
+
}
|
|
3126
|
+
return out;
|
|
3127
|
+
}
|
|
3087
3128
|
function mcpToolCount() {
|
|
3088
3129
|
return mcpTools.length;
|
|
3089
3130
|
}
|
|
@@ -3101,6 +3142,7 @@ export {
|
|
|
3101
3142
|
disconnectMCPServers,
|
|
3102
3143
|
buildToolMap,
|
|
3103
3144
|
listToolNames,
|
|
3104
|
-
|
|
3145
|
+
describeTools,
|
|
3146
|
+
describeToolSchemas,
|
|
3105
3147
|
mcpToolCount
|
|
3106
3148
|
};
|
|
@@ -53,7 +53,7 @@ var Rollout = class {
|
|
|
53
53
|
this.fd = null;
|
|
54
54
|
}
|
|
55
55
|
try {
|
|
56
|
-
const { upsertSessionIndexEntry } = await import("./session-index-
|
|
56
|
+
const { upsertSessionIndexEntry } = await import("./session-index-7FWEVP6E.js");
|
|
57
57
|
await upsertSessionIndexEntry(this.id);
|
|
58
58
|
} catch {
|
|
59
59
|
}
|