@corenel/harness 0.7.0 → 0.7.1

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.
Files changed (42) hide show
  1. package/dist/core/loop.d.ts +21 -0
  2. package/dist/core/loop.d.ts.map +1 -1
  3. package/dist/core/loop.js +70 -5
  4. package/dist/core/loop.js.map +1 -1
  5. package/dist/guardrail/builtins.d.ts.map +1 -1
  6. package/dist/guardrail/builtins.js +5 -2
  7. package/dist/guardrail/builtins.js.map +1 -1
  8. package/dist/guardrail/permission-service.d.ts +16 -2
  9. package/dist/guardrail/permission-service.d.ts.map +1 -1
  10. package/dist/guardrail/permission-service.js +40 -2
  11. package/dist/guardrail/permission-service.js.map +1 -1
  12. package/dist/prompts/index.d.ts +6 -0
  13. package/dist/prompts/index.d.ts.map +1 -1
  14. package/dist/prompts/index.js +1 -1
  15. package/dist/prompts/index.js.map +1 -1
  16. package/dist/prompts/toolsMarker.d.ts +13 -1
  17. package/dist/prompts/toolsMarker.d.ts.map +1 -1
  18. package/dist/prompts/toolsMarker.js +14 -2
  19. package/dist/prompts/toolsMarker.js.map +1 -1
  20. package/dist/sidecar/host.d.ts +39 -0
  21. package/dist/sidecar/host.d.ts.map +1 -1
  22. package/dist/sidecar/host.js +110 -0
  23. package/dist/sidecar/host.js.map +1 -1
  24. package/dist/sidecar/server.d.ts +20 -0
  25. package/dist/sidecar/server.d.ts.map +1 -1
  26. package/dist/sidecar/server.js +66 -0
  27. package/dist/sidecar/server.js.map +1 -1
  28. package/dist/skills.d.ts +1 -1
  29. package/dist/skills.d.ts.map +1 -1
  30. package/dist/skills.js +9 -2
  31. package/dist/skills.js.map +1 -1
  32. package/dist/tools/builtins.d.ts.map +1 -1
  33. package/dist/tools/builtins.js +12 -0
  34. package/dist/tools/builtins.js.map +1 -1
  35. package/dist/tools/namespaces.d.ts.map +1 -1
  36. package/dist/tools/namespaces.js +3 -0
  37. package/dist/tools/namespaces.js.map +1 -1
  38. package/dist/tools/toolSearch.d.ts +50 -0
  39. package/dist/tools/toolSearch.d.ts.map +1 -0
  40. package/dist/tools/toolSearch.js +143 -0
  41. package/dist/tools/toolSearch.js.map +1 -0
  42. package/package.json +2 -2
@@ -0,0 +1,50 @@
1
+ import type { AgentTool } from '@corenel/protocol';
2
+ import { type NamespacedTool } from './namespaces';
3
+ export declare const TOOL_SEARCH_NAME = "tool_search";
4
+ /** Most tools one conversation keeps loaded. Least recently used goes first.
5
+ * Large enough for a real multi-service task, small enough that the loaded set
6
+ * can never approach the provider's per-request limit on its own. */
7
+ export declare const LOADED_TOOLS_CAP = 24;
8
+ /** Deferred = reached by search. Every MCP tool, and nothing else: builtins are
9
+ * the agent's own competence and are used on most turns. One rule rather than a
10
+ * size threshold, so there is one behaviour to reason about. */
11
+ export declare function isDeferredTool(tool: NamespacedTool): boolean;
12
+ /** The server a deferred tool belongs to, from its wire name. */
13
+ export declare function serverOf(tool: NamespacedTool): string;
14
+ /**
15
+ * Lexical ranking over name, description and server.
16
+ *
17
+ * No embeddings: offline, deterministic, testable, and a few hundred tools is
18
+ * small enough not to need them. A word in the tool's own name counts most --
19
+ * the name is the verb the model will call -- then the server, then the
20
+ * description.
21
+ *
22
+ * Naming a server always returns that server's best tools, even when no word
23
+ * matched: the worst failure here is invisible (the model concluding it cannot
24
+ * do something it can), and naming a server is the model saying it is in there.
25
+ */
26
+ export declare function rankTools(query: string, tools: AgentTool[], opts?: {
27
+ server?: string;
28
+ limit?: number;
29
+ }): AgentTool[];
30
+ /** One line per server the run can reach by search. Goes in the system prompt,
31
+ * so the model knows a capability exists before deciding it does not. */
32
+ export declare function serverIndex(deferred: AgentTool[]): string;
33
+ export interface ToolLoader {
34
+ /** The `tool_search` tool for this run. */
35
+ searchTool: AgentTool;
36
+ /** Loaded tools, least recently used first. */
37
+ loaded(): AgentTool[];
38
+ loadedNames(): string[];
39
+ /** Mark a loaded tool as just used, so eviction takes something else. */
40
+ touch(name: string): void;
41
+ }
42
+ export declare function createToolLoader(opts: {
43
+ deferred: AgentTool[];
44
+ /** What this conversation had loaded before this run. */
45
+ loaded?: string[];
46
+ cap?: number;
47
+ /** Called with the full loaded list whenever its membership changes. */
48
+ onChange?: (names: string[]) => void;
49
+ }): ToolLoader;
50
+ //# sourceMappingURL=toolSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolSearch.d.ts","sourceRoot":"","sources":["../../tools/toolSearch.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAErE,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C;;sEAEsE;AACtE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAKnC;;iEAEiE;AACjE,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAE5D;AAED,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAErD;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,SAAS,EAAE,EAClB,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,SAAS,EAAE,CAwBb;AAED;0EAC0E;AAC1E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAQzD;AAED,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,UAAU,EAAE,SAAS,CAAC;IACtB,+CAA+C;IAC/C,MAAM,IAAI,SAAS,EAAE,CAAC;IACtB,WAAW,IAAI,MAAM,EAAE,CAAC;IACxB,yEAAyE;IACzE,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACtC,GAAG,UAAU,CAgEb"}
@@ -0,0 +1,143 @@
1
+ import { parseMcpWireName } from '@corenel/protocol';
2
+ import { resolveNamespace } from './namespaces.js';
3
+ export const TOOL_SEARCH_NAME = 'tool_search';
4
+ /** Most tools one conversation keeps loaded. Least recently used goes first.
5
+ * Large enough for a real multi-service task, small enough that the loaded set
6
+ * can never approach the provider's per-request limit on its own. */
7
+ export const LOADED_TOOLS_CAP = 24;
8
+ const DEFAULT_LIMIT = 8;
9
+ const MAX_LIMIT = 20;
10
+ /** Deferred = reached by search. Every MCP tool, and nothing else: builtins are
11
+ * the agent's own competence and are used on most turns. One rule rather than a
12
+ * size threshold, so there is one behaviour to reason about. */
13
+ export function isDeferredTool(tool) {
14
+ return resolveNamespace(tool) === 'mcp';
15
+ }
16
+ /** The server a deferred tool belongs to, from its wire name. */
17
+ export function serverOf(tool) {
18
+ return parseMcpWireName(tool.name)?.server ?? 'mcp';
19
+ }
20
+ function words(s) {
21
+ return s.toLowerCase().split(/[^a-z0-9]+/).filter((w) => w.length > 1);
22
+ }
23
+ /**
24
+ * Lexical ranking over name, description and server.
25
+ *
26
+ * No embeddings: offline, deterministic, testable, and a few hundred tools is
27
+ * small enough not to need them. A word in the tool's own name counts most --
28
+ * the name is the verb the model will call -- then the server, then the
29
+ * description.
30
+ *
31
+ * Naming a server always returns that server's best tools, even when no word
32
+ * matched: the worst failure here is invisible (the model concluding it cannot
33
+ * do something it can), and naming a server is the model saying it is in there.
34
+ */
35
+ export function rankTools(query, tools, opts = {}) {
36
+ const limit = Math.min(MAX_LIMIT, Math.max(1, Math.floor(opts.limit ?? DEFAULT_LIMIT)));
37
+ const pool = opts.server ? tools.filter((t) => serverOf(t) === opts.server) : tools;
38
+ const q = words(query);
39
+ const scored = pool.map((tool, i) => {
40
+ const parsed = parseMcpWireName(tool.name);
41
+ const nameWords = words(parsed?.tool ?? tool.name);
42
+ const serverWords = words(parsed?.server ?? '');
43
+ const descWords = words(tool.description ?? '');
44
+ let score = 0;
45
+ for (const w of q) {
46
+ if (nameWords.includes(w))
47
+ score += 3;
48
+ else if (nameWords.some((n) => n.startsWith(w) || w.startsWith(n)))
49
+ score += 2;
50
+ if (serverWords.includes(w))
51
+ score += 2;
52
+ if (descWords.includes(w))
53
+ score += 1;
54
+ else if (descWords.some((d) => d.startsWith(w)))
55
+ score += 0.5;
56
+ }
57
+ return { tool, score, i };
58
+ });
59
+ return scored
60
+ .filter((s) => s.score > 0 || opts.server)
61
+ .sort((a, b) => b.score - a.score || a.i - b.i)
62
+ .slice(0, limit)
63
+ .map((s) => s.tool);
64
+ }
65
+ /** One line per server the run can reach by search. Goes in the system prompt,
66
+ * so the model knows a capability exists before deciding it does not. */
67
+ export function serverIndex(deferred) {
68
+ const counts = new Map();
69
+ for (const t of deferred)
70
+ counts.set(serverOf(t), (counts.get(serverOf(t)) ?? 0) + 1);
71
+ const lines = [...counts].map(([s, n]) => `- ${s} · ${n} tool${n === 1 ? '' : 's'}`);
72
+ return [
73
+ `Connected services. Their tools are not loaded until you find them: call \`${TOOL_SEARCH_NAME}\` with what you want to do (and optionally the server) before concluding something is unavailable. Tools it returns can be called directly from then on.`,
74
+ ...lines,
75
+ ].join('\n');
76
+ }
77
+ export function createToolLoader(opts) {
78
+ const cap = opts.cap ?? LOADED_TOOLS_CAP;
79
+ const byName = new Map(opts.deferred.map((t) => [t.name, t]));
80
+ const incoming = opts.loaded ?? [];
81
+ // A name no longer in the registry belongs to a server that disconnected or a
82
+ // tool switched off since: dropped here, before it can be advertised.
83
+ let order = incoming.filter((n, i) => byName.has(n) && incoming.indexOf(n) === i).slice(-cap);
84
+ if (order.length !== incoming.length)
85
+ opts.onChange?.([...order]);
86
+ const add = (names) => {
87
+ const before = new Set(order);
88
+ for (const n of names) {
89
+ order = order.filter((x) => x !== n);
90
+ order.push(n);
91
+ }
92
+ if (order.length > cap)
93
+ order = order.slice(order.length - cap);
94
+ const changed = order.length !== before.size || order.some((n) => !before.has(n));
95
+ if (changed)
96
+ opts.onChange?.([...order]);
97
+ };
98
+ const searchTool = {
99
+ name: TOOL_SEARCH_NAME,
100
+ namespace: 'agent',
101
+ description: 'Find tools on connected services (MCP servers) by what you want to do. Returns matching tools with their input schemas and makes them callable from your next step. Search before concluding a service cannot do something.',
102
+ parameters: {
103
+ type: 'object',
104
+ properties: {
105
+ query: { type: 'string', description: 'What you want to do, in plain words, e.g. "send an email" or "list calendar events".' },
106
+ server: { type: 'string', description: 'Only search this server (a name from the connected services list).' },
107
+ limit: { type: 'number', description: `Most results to return (default ${DEFAULT_LIMIT}, max ${MAX_LIMIT}).` },
108
+ },
109
+ required: ['query'],
110
+ },
111
+ mutates: false,
112
+ // The schemas ARE the answer; offloading them behind a pointer would hide
113
+ // exactly what the model searched for.
114
+ noOffload: true,
115
+ async run(args) {
116
+ const query = typeof args.query === 'string' ? args.query.trim() : '';
117
+ const server = typeof args.server === 'string' && args.server ? args.server : undefined;
118
+ if (!query && !server)
119
+ return 'Error: pass a query describing what you want to do.';
120
+ const limit = typeof args.limit === 'number' ? args.limit : undefined;
121
+ const found = rankTools(query, opts.deferred, { server, limit });
122
+ add(found.map((t) => t.name));
123
+ const servers = [...new Set(opts.deferred.map(serverOf))];
124
+ return JSON.stringify({
125
+ tools: found.map((t) => ({ name: t.name, server: serverOf(t), description: t.description, inputSchema: t.parameters })),
126
+ note: found.length
127
+ ? 'These tools are now loaded; call them directly.'
128
+ : `No tools matched. Connected servers: ${servers.join(', ') || '(none)'}. Try other words or name a server.`,
129
+ });
130
+ },
131
+ };
132
+ return {
133
+ searchTool,
134
+ loaded: () => order.map((n) => byName.get(n)).filter((t) => !!t),
135
+ loadedNames: () => [...order],
136
+ touch: (name) => {
137
+ if (!order.includes(name))
138
+ return;
139
+ order = [...order.filter((n) => n !== name), name];
140
+ },
141
+ };
142
+ }
143
+ //# sourceMappingURL=toolSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolSearch.js","sourceRoot":"","sources":["../../tools/toolSearch.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAuB,MAAM,cAAc,CAAC;AAErE,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE9C;;sEAEsE;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB;;iEAEiE;AACjE,MAAM,UAAU,cAAc,CAAC,IAAoB;IACjD,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC;AAC1C,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,QAAQ,CAAC,IAAoB;IAC3C,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,IAAI,KAAK,CAAC;AACtD,CAAC;AAED,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACzE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CACvB,KAAa,EACb,KAAkB,EAClB,OAA4C,EAAE;IAE9C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,aAAa,CAAC,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EAAE,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAAE,OAAO;YAClC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corenel/harness",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "description": "Corenel — host-agnostic agent harness (kernel). The app resolves it via the `corenel` path alias (bypasses these exports entirely); vitest aliases it to source too. Everything else — node consumers like @corenel/cli, @corenel/term, @corenel/sidecar — resolves it through this workspace package via the exports map below, which points at dist/ unconditionally (not just at publish) so in-repo and published resolution are identical: a bundle that treats @corenel/harness as external (see packages/term/build.mjs) must see the SAME module instance node sees when it later resolves this package at runtime, and plain node cannot execute the raw .ts sources at all. Run `pnpm build` here (or let a dependent's prebuild do it) before relying on this package outside the app/vitest. NOTE: @xyflow/react and dagre are NOT dependencies here at all — this package has no .tsx files and imports neither. `react` IS a real (small) runtime dependency: `todos.ts` uses `useSyncExternalStore`. It is declared below as an OPTIONAL peer, not a hard dependency, so node-only consumers (cli/term/sidecar) aren't forced to install react; node consumers hoist it today only because something else in the tree happens to pull it in. Do not add @xyflow/react or dagre as dependencies/peers without testing a packed install end to end — an earlier attempt at that (before this package had any .tsx files) failed npm's peer resolution with ERESOLVE.",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "openai": "^4.77.0",
31
31
  "yaml": "^2.8.3",
32
- "@corenel/protocol": "0.7.0"
32
+ "@corenel/protocol": "0.7.1"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^18.0.0 || ^19.0.0"