@commonlyai/cli 0.1.358 → 0.1.360
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/package.json
CHANGED
package/src/lib/adapters/qwen.js
CHANGED
|
@@ -53,6 +53,11 @@ const EXCLUDED_TOOLS = [
|
|
|
53
53
|
// Qwen can read its own config directory. That directory also contains the
|
|
54
54
|
// per-spawn MCP credential file, so public turns cannot expose OS read tools.
|
|
55
55
|
const PUBLIC_READ_TOOLS = ['read_file', 'grep_search', 'search_file_content', 'glob', 'list_directory', 'lsp'];
|
|
56
|
+
// A public turn can never hold a Goal: setting one needs /goal or an approved
|
|
57
|
+
// propose_goal in a trusted folder, and QWEN_HOME is fresh every turn. Offered
|
|
58
|
+
// anyway, the two tools only show up in the seat's account of what it can do
|
|
59
|
+
// (F264; a public Codex seat turns goals off the same way, #3571).
|
|
60
|
+
const PUBLIC_GOAL_TOOLS = ['get_goal', 'update_goal'];
|
|
56
61
|
|
|
57
62
|
// What a public turn adds to --exclude-tools. Both spellings of a Commonly MCP
|
|
58
63
|
// tool, under the usual server name and any this turn declares, as with the
|
|
@@ -62,6 +67,7 @@ export const publicExcludedTools = (serverNames, ctx) => {
|
|
|
62
67
|
const names = [...new Set(['commonly', ...serverNames])];
|
|
63
68
|
return [
|
|
64
69
|
...PUBLIC_READ_TOOLS,
|
|
70
|
+
...PUBLIC_GOAL_TOOLS,
|
|
65
71
|
...publicSeatWithheldTools(ctx).flatMap((tool) => [tool, ...names.map((name) => `mcp__${name}__${tool}`)]),
|
|
66
72
|
];
|
|
67
73
|
};
|
|
@@ -73,7 +73,13 @@ export const publicCodexVersionError = ({ found, required, seat = 'public seat'
|
|
|
73
73
|
// `args` come before `--version`, for a launch that is an interpreter and a
|
|
74
74
|
// script (a Windows npm shim). The interpreter's path says nothing about which
|
|
75
75
|
// script it would run, so that probe is never cached.
|
|
76
|
+
//
|
|
77
|
+
// An entry also ages out after VERSION_CACHE_MAX_AGE_MS. A shim on PATH (asdf,
|
|
78
|
+
// mise, a wrapper script) keeps its mtime while the harness behind it changes,
|
|
79
|
+
// so an upgrade, or a downgrade under a version floor, would otherwise go
|
|
80
|
+
// unseen until the daemon restarted (F262).
|
|
76
81
|
const versionCache = new Map();
|
|
82
|
+
export const VERSION_CACHE_MAX_AGE_MS = 5 * 60 * 1000;
|
|
77
83
|
|
|
78
84
|
const resolveBinary = (binary, env) => {
|
|
79
85
|
const name = String(binary || '');
|
|
@@ -90,17 +96,18 @@ const resolveBinary = (binary, env) => {
|
|
|
90
96
|
|
|
91
97
|
export const probeVersion = async (binary, {
|
|
92
98
|
args = [], env, timeoutMs = 30000, parse, execFileImpl = childProcess.execFile, cache = versionCache,
|
|
99
|
+
now = Date.now,
|
|
93
100
|
} = {}) => {
|
|
94
101
|
const resolved = args.length ? null : resolveBinary(binary, env);
|
|
95
102
|
const key = resolved?.key || null;
|
|
96
103
|
const hit = key ? cache.get(key) : null;
|
|
97
|
-
if (hit && hit.mtimeMs === resolved.mtimeMs) return hit.version;
|
|
104
|
+
if (hit && hit.mtimeMs === resolved.mtimeMs && now() - hit.at < VERSION_CACHE_MAX_AGE_MS) return hit.version;
|
|
98
105
|
const stdout = await new Promise((resolve) => {
|
|
99
106
|
execFileImpl(key || binary, [...args, '--version'], { encoding: 'utf8', env, timeout: timeoutMs }, (error, out) => {
|
|
100
107
|
resolve(error ? null : out);
|
|
101
108
|
});
|
|
102
109
|
});
|
|
103
110
|
const version = stdout === null ? null : parse(stdout);
|
|
104
|
-
if (version && key) cache.set(key, { mtimeMs: resolved.mtimeMs, version });
|
|
111
|
+
if (version && key) cache.set(key, { mtimeMs: resolved.mtimeMs, version, at: now() });
|
|
105
112
|
return version;
|
|
106
113
|
};
|