melchizedek-agents 1.0.0 → 1.0.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/CHANGELOG.md +53 -0
- package/DOCUMENTATION.md +11 -9
- package/config/agents/examples/critic.yaml +12 -7
- package/config/agents/examples/image_production.yaml +2 -2
- package/config/agents/examples/librarian.yaml +1 -1
- package/config/agents/examples/pipeline.yaml +1 -1
- package/config/agents/examples/research.yaml +3 -2
- package/config/agents/examples/scribe.yaml +5 -4
- package/config/agents/examples/weather.yaml +2 -1
- package/config/agents/syndicateSchema.yaml +18 -15
- package/dist/lib/dispatch.d.ts +4 -4
- package/dist/lib/dispatch.js +4 -4
- package/dist/lib/syndicateSchema.js +6 -6
- package/package.json +2 -2
- package/skills/briefs/melchizedek-author.md +1 -1
- package/skills/melchizedek-author/SKILL.md +1 -1
- package/skills/melchizedek-author/assets/minimal.yaml +1 -1
- package/dist/lib/adkPeer.d.ts +0 -63
- package/dist/lib/adkPeer.js +0 -240
- package/dist/lib/compileAdk.d.ts +0 -32
- package/dist/lib/compileAdk.js +0 -142
- package/dist/lib/models/adkGeminiAdapter.d.ts +0 -90
- package/dist/lib/models/adkGeminiAdapter.js +0 -369
- package/dist/lib/models/adkShim.d.ts +0 -111
- package/dist/lib/models/adkShim.js +0 -136
- package/dist/lib/models/claudeLlm.d.ts +0 -79
- package/dist/lib/models/claudeLlm.js +0 -87
- package/dist/lib/models/fallback.d.ts +0 -48
- package/dist/lib/models/fallback.js +0 -116
- package/dist/lib/models/gatewayLlm.d.ts +0 -36
- package/dist/lib/models/gatewayLlm.js +0 -44
- package/dist/lib/models/gptLlm.d.ts +0 -99
- package/dist/lib/models/gptLlm.js +0 -129
- package/dist/lib/models/grokLlm.d.ts +0 -50
- package/dist/lib/models/grokLlm.js +0 -56
- package/dist/lib/models/kimiLlm.d.ts +0 -31
- package/dist/lib/models/kimiLlm.js +0 -35
- package/dist/lib/models/ollamaLlm.d.ts +0 -37
- package/dist/lib/models/ollamaLlm.js +0 -42
- package/dist/lib/models/openAiCompatibleLlm.d.ts +0 -96
- package/dist/lib/models/openAiCompatibleLlm.js +0 -156
- package/dist/lib/models/tracedGemini.d.ts +0 -41
- package/dist/lib/models/tracedGemini.js +0 -98
- package/dist/lib/runtime/adkMemoryBridge.d.ts +0 -46
- package/dist/lib/runtime/adkMemoryBridge.js +0 -68
- package/dist/lib/runtime/adkSessionBridge.d.ts +0 -78
- package/dist/lib/runtime/adkSessionBridge.js +0 -176
- package/dist/lib/tools/adkTool.d.ts +0 -81
- package/dist/lib/tools/adkTool.js +0 -268
- package/dist/lib/tools/collectionsSearchTool.d.ts +0 -56
- package/dist/lib/tools/collectionsSearchTool.js +0 -71
- package/dist/lib/tools/urlContextTool.d.ts +0 -32
- package/dist/lib/tools/urlContextTool.js +0 -43
- package/dist/lib/tools/webSearchTool.d.ts +0 -51
- package/dist/lib/tools/webSearchTool.js +0 -82
- package/dist/lib/tools/xSearchTool.d.ts +0 -59
- package/dist/lib/tools/xSearchTool.js +0 -74
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* lib/tools/xSearchTool.ts — xAI X (Twitter) search, sentinel-style.
|
|
3
|
-
*
|
|
4
|
-
* WHY this file exists:
|
|
5
|
-
* xAI's Agent Tools API exposes `x_search` — server-side live search over
|
|
6
|
-
* X posts — as a first-class tool alongside `web_search` (verified live
|
|
7
|
-
* against api.x.ai/v1/responses, 2026-07-24). It is the one search
|
|
8
|
-
* capability no other provider offers, and the reason to route a
|
|
9
|
-
* news/social agent to a grok-* model at all.
|
|
10
|
-
*
|
|
11
|
-
* HOW IT WORKS (mirrors webSearchTool.ts exactly):
|
|
12
|
-
* Declaring `x_search` in an agent's YAML tools list self-registers a
|
|
13
|
-
* sentinel in llmRequest.toolsDict. _getDeclaration() returns undefined so
|
|
14
|
-
* it is never sent as a client-side function tool; the GptLlm/GrokLlm
|
|
15
|
-
* request builder calls wantsXSearch(llmRequest) and appends
|
|
16
|
-
* { type: 'x_search' } to the provider tools.
|
|
17
|
-
*
|
|
18
|
-
* SCOPE: xAI-only. Declare it ONLY on grok-* agents — other Responses-API
|
|
19
|
-
* providers (OpenAI) reject the unknown tool type with a 400, and Gemini/
|
|
20
|
-
* Anthropic adapters ignore the sentinel entirely (the tool degrades to a
|
|
21
|
-
* no-op there rather than throwing, same non-throwing routing contract as
|
|
22
|
-
* web_search).
|
|
23
|
-
*
|
|
24
|
-
* WHICH CONSTRAINTS: xAI accepts server-side search constraints on the tool
|
|
25
|
-
* object itself (verified against docs.x.ai/developers/tools/x-search,
|
|
26
|
-
* 2026-08-02): from_date/to_date (YYYY-MM-DD) and allowed_x_handles/
|
|
27
|
-
* excluded_x_handles (≤20 each, mutually exclusive). They come from the
|
|
28
|
-
* environment, not YAML — XAI_X_SEARCH_FROM_DATE, XAI_X_SEARCH_TO_DATE,
|
|
29
|
-
* XAI_X_SEARCH_ALLOWED_HANDLES, XAI_X_SEARCH_EXCLUDED_HANDLES (handle
|
|
30
|
-
* lists comma-separated, leading @ tolerated) — the XAI_COLLECTION_IDS
|
|
31
|
-
* doctrine: constraints are deployment configuration, the YAML stays
|
|
32
|
-
* shareable. Misconfiguration degrades with a warning, never fatally:
|
|
33
|
-
* malformed dates are dropped, oversize handle lists truncate, and when
|
|
34
|
-
* both lists are set the allowlist wins.
|
|
35
|
-
*/
|
|
36
|
-
import { BaseTool } from '../adkPeer.js';
|
|
37
|
-
import { providerForModel } from '../models/providerMap.js';
|
|
38
|
-
import { X_SEARCH_MARKER } from './nativeTools.js';
|
|
39
|
-
import { NATIVE_TOOL, nativeToolMarkerOf } from './tool.js';
|
|
40
|
-
export const X_SEARCH_TOOL_NAME = 'x_search';
|
|
41
|
-
/** The ADK runtime's form of X_SEARCH_MARKER (lib/tools/nativeTools.ts), carrying its marker. */
|
|
42
|
-
export class XSearchTool extends BaseTool {
|
|
43
|
-
[NATIVE_TOOL] = X_SEARCH_MARKER[NATIVE_TOOL];
|
|
44
|
-
constructor() {
|
|
45
|
-
super({ name: X_SEARCH_TOOL_NAME, description: X_SEARCH_MARKER.description });
|
|
46
|
-
}
|
|
47
|
-
/** Never a client-side function tool — xAI runs the search server-side. */
|
|
48
|
-
_getDeclaration() {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
/** Server-side tool: nothing to execute locally. */
|
|
52
|
-
async runAsync() {
|
|
53
|
-
return Promise.resolve();
|
|
54
|
-
}
|
|
55
|
-
async processLlmRequest({ llmRequest }) {
|
|
56
|
-
if (!llmRequest.model)
|
|
57
|
-
return;
|
|
58
|
-
if (providerForModel(llmRequest.model) !== 'xai')
|
|
59
|
-
return; // no-op elsewhere
|
|
60
|
-
llmRequest.toolsDict[X_SEARCH_TOOL_NAME] = this;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/** Shared instance, mirroring WEB_SEARCH. */
|
|
64
|
-
export const X_SEARCH = new XSearchTool();
|
|
65
|
-
/** True when the agent requested X search (xAI sentinel path), by marker. */
|
|
66
|
-
export function wantsXSearch(llmRequest) {
|
|
67
|
-
return isXSearchSentinel(llmRequest.toolsDict?.[X_SEARCH_TOOL_NAME]);
|
|
68
|
-
}
|
|
69
|
-
/** Sentinel test used by the request builder to skip function-tool emission: the x_search marker, on either form. */
|
|
70
|
-
export function isXSearchSentinel(tool) {
|
|
71
|
-
return nativeToolMarkerOf(tool) === 'x_search';
|
|
72
|
-
}
|
|
73
|
-
/** The XAI_X_SEARCH_* reader lives in lib/tools/xaiSearchParams.ts (no @google/adk); re-exported here under its old name. */
|
|
74
|
-
export { xSearchParamsFromEnv } from './xaiSearchParams.js';
|