Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -10211,6 +10211,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
2 changes: 1 addition & 1 deletion docs/computer-use-provider-evidence.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,7 +109,7 @@ The first qualifying run completed with:
- terminal status: `complete / end_turn`;
- fixture oracle: verification code matched and interaction count remained zero.

The direct E2E tool exposure is deliberate. The default deferred `load_tools`
The direct E2E tool exposure is deliberate. The default deferred `tool_search`
path remains a separate product contract; the launcher narrows provider
variables while still exercising the production tool implementation, permission
engine, Runtime, Desktop host, and executor backend.
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/cli/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -5196,6 +5196,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/agent-run.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,7 @@ export const AGENT_RUN_EVENT_TYPES = [
'model_stream_failed',
'send_diagnostics_recorded',
'tool_started',
'tool_searched',
'tool_completed',
'tool_failed',
'skill_catalog_built',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-args-identity.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,7 +163,7 @@ function canonicalizeMainlineV1(value: unknown, parentKey?: string): unknown {
* The cost of not doing this was total. The refused write marked the runtime
* event store unavailable, the turn's terminal write then threw, and every turn
* that called any tool died a tenth of a second after the tool returned —
* `load_tools` succeeded, reported the group loaded, and the turn ended there.
* `tool_search` succeeded, reported activated tools, and the turn ended there.
*
* Dropping the key is lossless in the only sense that matters: JSON cannot tell
* an absent property from one set to `undefined`, so this writes down what
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/tool-catalog.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
* Shared product tool vocabulary (#1099).
*
* Tool is the catalog atom. Surface is optional and only for jointly governed
* packs (deferred `load_tools` groups and/or a shared host product boundary).
* searchable groups and/or a shared host product boundary.
* Hosts own implementations; this module owns names and metadata. Derive
* HostCapabilities / ToolAvailability groups from catalog ∩ host binding.
*
Expand DownExpand Up@@ -53,8 +53,6 @@ export interface CatalogSurfaceDef {
readonly id: string;
readonly label: string;
readonly description: string;
/** v1 packs are deferred load groups only. */
readonly economy: 'deferred';
readonly toolNames: readonly string[];
readonly hosts: Readonly<Record<ToolHostId, ToolHostSupport>>;
}
Expand DownExpand Up@@ -88,7 +86,6 @@ function freezeSurface(surface: CatalogSurfaceDef): CatalogSurfaceDef {
id: surface.id,
label: surface.label,
description: surface.description,
economy: surface.economy,
toolNames: Object.freeze([...surface.toolNames]),
hosts: Object.freeze({ ...surface.hosts }),
});
Expand DownExpand Up@@ -157,7 +154,7 @@ export const MAKA_CATALOG_TOOLS: readonly CatalogToolDef[] = Object.freeze(
);

/**
* Jointly governed deferred packs. Id `agent` matches the runtime
* Jointly governed searchable packs. Id `agent` matches the runtime
* ToolAvailability group id (AGENT_TOOL_GROUP_ID), not a separate "subagent" id.
* Each surface gets its own hosts object so affinity cannot cross-contaminate.
*/
Expand All@@ -168,15 +165,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
label: 'Rive',
description:
'Durable multi-agent Rive workflows: validate/import/run/status, scheduler, retries.',
economy: 'deferred' as const,
toolNames: ['RiveWorkflow'],
hosts: desktopOnlyHosts(),
},
{
id: 'browser',
label: 'Browser',
description: 'Drive the embedded browser: navigate, snapshot, click, type, wait, extract.',
economy: 'deferred' as const,
toolNames: [
'browser_navigate',
'browser_snapshot',
Expand All@@ -191,15 +186,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
id: 'computer_use',
label: 'Computer',
description: 'Observe and operate an explicitly approved local application.',
economy: 'deferred' as const,
toolNames: ['maka_computer'],
hosts: desktopOnlyHosts(),
},
{
id: 'agent',
label: 'Agent',
description: 'Spawn, fan out, and inspect foreground child agents.',
economy: 'deferred' as const,
toolNames: [
'agent_spawn',
'agent_list',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-quiet-preview.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -323,7 +323,7 @@ export function formatQuietJsonValue(value: unknown, locale: UiLocale = 'zh'): Q
return { body: redactSecrets(String(value)) };
}

// Known list payloads (Grep/Glob/load_tools/…).
// Known list payloads (Grep/Glob/tool_search/…).
for (const key of LIST_KEYS) {
if (!Array.isArray(record[key])) continue;
const consumed = new Set<string>([key]);
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/usage-stats/types.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,16 +205,15 @@ export type ToolSchemaChangeReason =

/**
* Diagnostic shell describing the provider-visible (active) tool subset for a
* turn, produced by the unified `ToolAvailabilityRuntime`. A "source" id here is
* a catalog *group* id — the shell retains the historical `*SourceIds` field
* names while the config-side vocabulary is `groups`.
* turn, produced by `ToolAvailabilityRuntime`. A "source" id here is a catalog
* group id; the historical field names remain stable for telemetry readers.
*/
export interface ToolAvailabilityDiagnostic {
/**
* Always `'economy'`: a diagnostic is only produced when economy gates the
* tool surface. The full-surface case emits no diagnostic at all.
* `'search'` is the current provider-independent lazy-loading policy.
* `'economy'` remains readable for historical telemetry.
*/
mode: 'economy';
mode: 'economy' | 'search';
enabledSourceIds: ToolSourceId[];
availableSourceIds?: ToolSourceId[];
connectorToolName?: string;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -825,7 +825,7 @@ describe('Host Client Capability coordinator', () => {
await coordinator.close();
});

test('keeps load_tools group identity provider-independent and contract-sensitive', async () => {
test('keeps tool-search source identity provider-independent and contract-sensitive', async () => {
const coordinator = createCoordinator();
const first = coordinator.attachConnection(clientCapabilityConnectionIdentity('connection-a'), {
send: async () => {},
Expand Down
46 changes: 21 additions & 25 deletions packages/runtime-host/src/__tests__/client-capability-uds.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';
import { LOAD_TOOLS_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { TOOL_SEARCH_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { type MakaTool } from '@maka/runtime/tool-runtime';
import { mcpProxyToolName } from '@maka/runtime/mcp-tools';
import { resolveStorageRoot, tryAcquireInteractiveRootOwner } from '@maka/storage/root-authority';
Expand DownExpand Up@@ -133,7 +133,7 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
affinity: 'session',
hostPathAccess: 'cwd',
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
description: 'Schedule a calendar meeting through the fixture provider.',
tools: [
{
serverId: 'fixture_unknown',
Expand DownExpand Up@@ -203,37 +203,33 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
abortSignal: new AbortController().signal,
emitOutput: () => undefined,
};
const activeTools = new Map<string, MakaTool>();
const availability = new ToolAvailabilityRuntime(
snapshot.tools,
{ economy: true, groups: snapshot.groups },
{ groups: snapshot.groups },
invalidTool(),
).prepare([]);
assert.deepEqual(availability.activeTools, [LOAD_TOOLS_NAME]);
const loadTools = availability.providerTools.find(
(candidate) => candidate.name === LOAD_TOOLS_NAME,
).prepare(activeTools);
assert.deepEqual(availability.activeTools, [TOOL_SEARCH_NAME]);
const toolSearch = availability.providerTools.find(
(candidate) => candidate.name === TOOL_SEARCH_NAME,
);
assert.ok(toolSearch);
const searched = await toolSearch.impl(
{ query: 'schedule calendar meeting', limit: 20 },
toolContext,
);
assert.ok(loadTools);
const loaded = await loadTools.impl({ group: group.id }, toolContext);
const capabilityToolNames = [tool.name, rejectedTool.name].sort((left, right) =>
left.localeCompare(right),
);
assert.deepEqual(loaded, {
loaded: capabilityToolNames,
group: {
id: group.id,
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
},
});
assert.deepEqual(
availability.projectActiveTools?.({
completedSteps: [
{
toolCalls: [{ toolName: LOAD_TOOLS_NAME, input: { group: group.id } }],
},
],
}).activeTools,
[LOAD_TOOLS_NAME, ...capabilityToolNames],
[...(searched as { activated: string[] }).activated].sort((left, right) =>
left.localeCompare(right),
),
capabilityToolNames,
);
assert.deepEqual(
availability.projectActiveTools?.().activeTools,
[TOOL_SEARCH_NAME, ...capabilityToolNames].sort((left, right) => left.localeCompare(right)),
);

const result = await tool.impl({ prefix: 'from-uds' }, toolContext);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -644,7 +644,7 @@ test('production backend creation continues after a Session Client Capability is
}
});

test('production backend preserves coordinator Client Capability semantics across load_tools and T1', async () => {
test('production backend preserves coordinator Client Capability semantics across tool_search and T1', async () => {
const sessionId = 'backend-creation-session';
const turnId = 'client-capability-turn';
const runId = 'client-capability-run';
Expand DownExpand Up@@ -814,9 +814,9 @@ test('production backend preserves coordinator Client Capability semantics acros
.filter((request) => request.body.stream === true)
.map((request) => toolNames(request.body));
assert.equal(providerToolSets.length, 3);
assert.ok(providerToolSets[0]?.includes('load_tools'));
assert.ok(providerToolSets[0]?.includes('tool_search'));
assert.equal(providerToolSets[0]?.includes(tool.name), false);
assert.ok(providerToolSets[1]?.includes('load_tools'));
assert.ok(providerToolSets[1]?.includes('tool_search'));
assert.ok(providerToolSets[1]?.includes(tool.name));
assert.ok(providerToolSets[2]?.includes(tool.name));
} finally {
Expand DownExpand Up@@ -1218,14 +1218,14 @@ test('production Host executes a canonical ai-sdk Session against a real provide
'WebFetch',
'Write',
'WriteStdin',
'load_tools',
'memory_extract',
'memory_remember',
'request_sandbox_boundary',
'task_create',
'task_get',
'task_list',
'task_update',
'tool_search',
]);
assert.match(JSON.stringify(compactRequests[0]?.body), /context summarization assistant/);

Expand DownExpand Up@@ -1641,7 +1641,7 @@ test('production Host executes a durable runnable child with an exact tool ceili

const requests = provider.requests.filter((request) => request.body.stream === true);
assert.equal(requests.length, 4);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
// The same routed child surface removes web_research when Tavily cannot run.
Expand DownExpand Up@@ -1842,7 +1842,7 @@ test('production Host publishes and retires an implementation child patch', asyn
requests.length <= MAX_IMPLEMENTATION_CHILD_REQUESTS + 3,
JSON.stringify(providerRequestTrace(requests)),
);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
assert.deepEqual(toolParameterEnum(requests[1]?.body, 'agent_spawn', 'profile'), [
Expand DownExpand Up@@ -3706,9 +3706,11 @@ async function handleProviderRequest(
(flow.kind === 'child_agent' || flow.kind === 'implementation_child_agent') &&
streamRequestIndex === 1
) {
assert.ok(toolNames(body).includes('load_tools'));
assert.ok(toolNames(body).includes('tool_search'));
assert.equal(toolNames(body).includes('agent_spawn'), false);
respondProviderToolCall(response, streamRequestIndex, 'load_tools', { group: 'agent' });
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: 'agent_spawn',
});
return;
}
if (
Expand DownExpand Up@@ -3811,9 +3813,9 @@ async function handleProviderRequest(
return;
}
if (flow.kind === 'client_capability' && streamRequestIndex === 1) {
assert.ok(toolNames(body).includes('load_tools'));
respondProviderToolCall(response, streamRequestIndex, 'load_tools', {
group: flow.groupId,
assert.ok(toolNames(body).includes('tool_search'));
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: flow.toolName,
});
return;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/runtime-host/src/server/interactive-run-composer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,9 +186,6 @@ export function createInteractiveRunComposer(input: InteractiveRunComposerInput)
const productSurface = projectEffectiveProductToolSurface({
host: 'runtime-host',
tools: selectedTools,
policy: {
economy: hasToolCeiling ? false : !process.env.MAKA_DISABLE_DEFERRED_TOOLS,
},
});
// A bound tool list is an exact child/local activation ceiling. Dynamic
// capabilities must be included by the authority that constructs that list.
Expand DownExpand Up@@ -507,7 +504,6 @@ function mergeToolAvailability(
groupIds.add(group.id);
}
return {
economy: product.economy,
groups: [...(product.groups ?? []), ...clientGroups],
};
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@
"https-proxy-agent": "^9.1.0",
"image-dimensions": "^2.5.1",
"linkedom": "^0.18.13",
"minisearch": "7.2.0",
"node-pty": "^1.2.0-beta.15",
"qrcode": "^1.5.4",
"socks": "^2.8.9",
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -10211,6 +10211,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
2 changes: 1 addition & 1 deletion docs/computer-use-provider-evidence.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,7 +109,7 @@ The first qualifying run completed with:
- terminal status: `complete / end_turn`;
- fixture oracle: verification code matched and interaction count remained zero.

The direct E2E tool exposure is deliberate. The default deferred `load_tools`
The direct E2E tool exposure is deliberate. The default deferred `tool_search`
path remains a separate product contract; the launcher narrows provider
variables while still exercising the production tool implementation, permission
engine, Runtime, Desktop host, and executor backend.
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/cli/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -5196,6 +5196,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/agent-run.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,7 @@ export const AGENT_RUN_EVENT_TYPES = [
'model_stream_failed',
'send_diagnostics_recorded',
'tool_started',
'tool_searched',
'tool_completed',
'tool_failed',
'skill_catalog_built',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-args-identity.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,7 +163,7 @@ function canonicalizeMainlineV1(value: unknown, parentKey?: string): unknown {
* The cost of not doing this was total. The refused write marked the runtime
* event store unavailable, the turn's terminal write then threw, and every turn
* that called any tool died a tenth of a second after the tool returned —
* `load_tools` succeeded, reported the group loaded, and the turn ended there.
* `tool_search` succeeded, reported activated tools, and the turn ended there.
*
* Dropping the key is lossless in the only sense that matters: JSON cannot tell
* an absent property from one set to `undefined`, so this writes down what
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/tool-catalog.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
* Shared product tool vocabulary (#1099).
*
* Tool is the catalog atom. Surface is optional and only for jointly governed
* packs (deferred `load_tools` groups and/or a shared host product boundary).
* searchable groups and/or a shared host product boundary.
* Hosts own implementations; this module owns names and metadata. Derive
* HostCapabilities / ToolAvailability groups from catalog ∩ host binding.
*
Expand DownExpand Up@@ -53,8 +53,6 @@ export interface CatalogSurfaceDef {
readonly id: string;
readonly label: string;
readonly description: string;
/** v1 packs are deferred load groups only. */
readonly economy: 'deferred';
readonly toolNames: readonly string[];
readonly hosts: Readonly<Record<ToolHostId, ToolHostSupport>>;
}
Expand DownExpand Up@@ -88,7 +86,6 @@ function freezeSurface(surface: CatalogSurfaceDef): CatalogSurfaceDef {
id: surface.id,
label: surface.label,
description: surface.description,
economy: surface.economy,
toolNames: Object.freeze([...surface.toolNames]),
hosts: Object.freeze({ ...surface.hosts }),
});
Expand DownExpand Up@@ -157,7 +154,7 @@ export const MAKA_CATALOG_TOOLS: readonly CatalogToolDef[] = Object.freeze(
);

/**
* Jointly governed deferred packs. Id `agent` matches the runtime
* Jointly governed searchable packs. Id `agent` matches the runtime
* ToolAvailability group id (AGENT_TOOL_GROUP_ID), not a separate "subagent" id.
* Each surface gets its own hosts object so affinity cannot cross-contaminate.
*/
Expand All@@ -168,15 +165,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
label: 'Rive',
description:
'Durable multi-agent Rive workflows: validate/import/run/status, scheduler, retries.',
economy: 'deferred' as const,
toolNames: ['RiveWorkflow'],
hosts: desktopOnlyHosts(),
},
{
id: 'browser',
label: 'Browser',
description: 'Drive the embedded browser: navigate, snapshot, click, type, wait, extract.',
economy: 'deferred' as const,
toolNames: [
'browser_navigate',
'browser_snapshot',
Expand All@@ -191,15 +186,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
id: 'computer_use',
label: 'Computer',
description: 'Observe and operate an explicitly approved local application.',
economy: 'deferred' as const,
toolNames: ['maka_computer'],
hosts: desktopOnlyHosts(),
},
{
id: 'agent',
label: 'Agent',
description: 'Spawn, fan out, and inspect foreground child agents.',
economy: 'deferred' as const,
toolNames: [
'agent_spawn',
'agent_list',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-quiet-preview.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -323,7 +323,7 @@ export function formatQuietJsonValue(value: unknown, locale: UiLocale = 'zh'): Q
return { body: redactSecrets(String(value)) };
}

// Known list payloads (Grep/Glob/load_tools/…).
// Known list payloads (Grep/Glob/tool_search/…).
for (const key of LIST_KEYS) {
if (!Array.isArray(record[key])) continue;
const consumed = new Set<string>([key]);
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/usage-stats/types.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,16 +205,15 @@ export type ToolSchemaChangeReason =

/**
* Diagnostic shell describing the provider-visible (active) tool subset for a
* turn, produced by the unified `ToolAvailabilityRuntime`. A "source" id here is
* a catalog *group* id — the shell retains the historical `*SourceIds` field
* names while the config-side vocabulary is `groups`.
* turn, produced by `ToolAvailabilityRuntime`. A "source" id here is a catalog
* group id; the historical field names remain stable for telemetry readers.
*/
export interface ToolAvailabilityDiagnostic {
/**
* Always `'economy'`: a diagnostic is only produced when economy gates the
* tool surface. The full-surface case emits no diagnostic at all.
* `'search'` is the current provider-independent lazy-loading policy.
* `'economy'` remains readable for historical telemetry.
*/
mode: 'economy';
mode: 'economy' | 'search';
enabledSourceIds: ToolSourceId[];
availableSourceIds?: ToolSourceId[];
connectorToolName?: string;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -825,7 +825,7 @@ describe('Host Client Capability coordinator', () => {
await coordinator.close();
});

test('keeps load_tools group identity provider-independent and contract-sensitive', async () => {
test('keeps tool-search source identity provider-independent and contract-sensitive', async () => {
const coordinator = createCoordinator();
const first = coordinator.attachConnection(clientCapabilityConnectionIdentity('connection-a'), {
send: async () => {},
Expand Down
46 changes: 21 additions & 25 deletions packages/runtime-host/src/__tests__/client-capability-uds.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';
import { LOAD_TOOLS_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { TOOL_SEARCH_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { type MakaTool } from '@maka/runtime/tool-runtime';
import { mcpProxyToolName } from '@maka/runtime/mcp-tools';
import { resolveStorageRoot, tryAcquireInteractiveRootOwner } from '@maka/storage/root-authority';
Expand DownExpand Up@@ -133,7 +133,7 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
affinity: 'session',
hostPathAccess: 'cwd',
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
description: 'Schedule a calendar meeting through the fixture provider.',
tools: [
{
serverId: 'fixture_unknown',
Expand DownExpand Up@@ -203,37 +203,33 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
abortSignal: new AbortController().signal,
emitOutput: () => undefined,
};
const activeTools = new Map<string, MakaTool>();
const availability = new ToolAvailabilityRuntime(
snapshot.tools,
{ economy: true, groups: snapshot.groups },
{ groups: snapshot.groups },
invalidTool(),
).prepare([]);
assert.deepEqual(availability.activeTools, [LOAD_TOOLS_NAME]);
const loadTools = availability.providerTools.find(
(candidate) => candidate.name === LOAD_TOOLS_NAME,
).prepare(activeTools);
assert.deepEqual(availability.activeTools, [TOOL_SEARCH_NAME]);
const toolSearch = availability.providerTools.find(
(candidate) => candidate.name === TOOL_SEARCH_NAME,
);
assert.ok(toolSearch);
const searched = await toolSearch.impl(
{ query: 'schedule calendar meeting', limit: 20 },
toolContext,
);
assert.ok(loadTools);
const loaded = await loadTools.impl({ group: group.id }, toolContext);
const capabilityToolNames = [tool.name, rejectedTool.name].sort((left, right) =>
left.localeCompare(right),
);
assert.deepEqual(loaded, {
loaded: capabilityToolNames,
group: {
id: group.id,
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
},
});
assert.deepEqual(
availability.projectActiveTools?.({
completedSteps: [
{
toolCalls: [{ toolName: LOAD_TOOLS_NAME, input: { group: group.id } }],
},
],
}).activeTools,
[LOAD_TOOLS_NAME, ...capabilityToolNames],
[...(searched as { activated: string[] }).activated].sort((left, right) =>
left.localeCompare(right),
),
capabilityToolNames,
);
assert.deepEqual(
availability.projectActiveTools?.().activeTools,
[TOOL_SEARCH_NAME, ...capabilityToolNames].sort((left, right) => left.localeCompare(right)),
);

const result = await tool.impl({ prefix: 'from-uds' }, toolContext);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -644,7 +644,7 @@ test('production backend creation continues after a Session Client Capability is
}
});

test('production backend preserves coordinator Client Capability semantics across load_tools and T1', async () => {
test('production backend preserves coordinator Client Capability semantics across tool_search and T1', async () => {
const sessionId = 'backend-creation-session';
const turnId = 'client-capability-turn';
const runId = 'client-capability-run';
Expand DownExpand Up@@ -814,9 +814,9 @@ test('production backend preserves coordinator Client Capability semantics acros
.filter((request) => request.body.stream === true)
.map((request) => toolNames(request.body));
assert.equal(providerToolSets.length, 3);
assert.ok(providerToolSets[0]?.includes('load_tools'));
assert.ok(providerToolSets[0]?.includes('tool_search'));
assert.equal(providerToolSets[0]?.includes(tool.name), false);
assert.ok(providerToolSets[1]?.includes('load_tools'));
assert.ok(providerToolSets[1]?.includes('tool_search'));
assert.ok(providerToolSets[1]?.includes(tool.name));
assert.ok(providerToolSets[2]?.includes(tool.name));
} finally {
Expand DownExpand Up@@ -1218,14 +1218,14 @@ test('production Host executes a canonical ai-sdk Session against a real provide
'WebFetch',
'Write',
'WriteStdin',
'load_tools',
'memory_extract',
'memory_remember',
'request_sandbox_boundary',
'task_create',
'task_get',
'task_list',
'task_update',
'tool_search',
]);
assert.match(JSON.stringify(compactRequests[0]?.body), /context summarization assistant/);

Expand DownExpand Up@@ -1641,7 +1641,7 @@ test('production Host executes a durable runnable child with an exact tool ceili

const requests = provider.requests.filter((request) => request.body.stream === true);
assert.equal(requests.length, 4);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
// The same routed child surface removes web_research when Tavily cannot run.
Expand DownExpand Up@@ -1842,7 +1842,7 @@ test('production Host publishes and retires an implementation child patch', asyn
requests.length <= MAX_IMPLEMENTATION_CHILD_REQUESTS + 3,
JSON.stringify(providerRequestTrace(requests)),
);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
assert.deepEqual(toolParameterEnum(requests[1]?.body, 'agent_spawn', 'profile'), [
Expand DownExpand Up@@ -3706,9 +3706,11 @@ async function handleProviderRequest(
(flow.kind === 'child_agent' || flow.kind === 'implementation_child_agent') &&
streamRequestIndex === 1
) {
assert.ok(toolNames(body).includes('load_tools'));
assert.ok(toolNames(body).includes('tool_search'));
assert.equal(toolNames(body).includes('agent_spawn'), false);
respondProviderToolCall(response, streamRequestIndex, 'load_tools', { group: 'agent' });
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: 'agent_spawn',
});
return;
}
if (
Expand DownExpand Up@@ -3811,9 +3813,9 @@ async function handleProviderRequest(
return;
}
if (flow.kind === 'client_capability' && streamRequestIndex === 1) {
assert.ok(toolNames(body).includes('load_tools'));
respondProviderToolCall(response, streamRequestIndex, 'load_tools', {
group: flow.groupId,
assert.ok(toolNames(body).includes('tool_search'));
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: flow.toolName,
});
return;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/runtime-host/src/server/interactive-run-composer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,9 +186,6 @@ export function createInteractiveRunComposer(input: InteractiveRunComposerInput)
const productSurface = projectEffectiveProductToolSurface({
host: 'runtime-host',
tools: selectedTools,
policy: {
economy: hasToolCeiling ? false : !process.env.MAKA_DISABLE_DEFERRED_TOOLS,
},
});
// A bound tool list is an exact child/local activation ceiling. Dynamic
// capabilities must be included by the authority that constructs that list.
Expand DownExpand Up@@ -507,7 +504,6 @@ function mergeToolAvailability(
groupIds.add(group.id);
}
return {
economy: product.economy,
groups: [...(product.groups ?? []), ...clientGroups],
};
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@
"https-proxy-agent": "^9.1.0",
"image-dimensions": "^2.5.1",
"linkedom": "^0.18.13",
"minisearch": "7.2.0",
"node-pty": "^1.2.0-beta.15",
"qrcode": "^1.5.4",
"socks": "^2.8.9",
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -10211,6 +10211,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
2 changes: 1 addition & 1 deletion docs/computer-use-provider-evidence.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,7 +109,7 @@ The first qualifying run completed with:
- terminal status: `complete / end_turn`;
- fixture oracle: verification code matched and interaction count remained zero.

The direct E2E tool exposure is deliberate. The default deferred `load_tools`
The direct E2E tool exposure is deliberate. The default deferred `tool_search`
path remains a separate product contract; the launcher narrows provider
variables while still exercising the production tool implementation, permission
engine, Runtime, Desktop host, and executor backend.
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/cli/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -5196,6 +5196,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/agent-run.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,7 @@ export const AGENT_RUN_EVENT_TYPES = [
'model_stream_failed',
'send_diagnostics_recorded',
'tool_started',
'tool_searched',
'tool_completed',
'tool_failed',
'skill_catalog_built',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-args-identity.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,7 +163,7 @@ function canonicalizeMainlineV1(value: unknown, parentKey?: string): unknown {
* The cost of not doing this was total. The refused write marked the runtime
* event store unavailable, the turn's terminal write then threw, and every turn
* that called any tool died a tenth of a second after the tool returned —
* `load_tools` succeeded, reported the group loaded, and the turn ended there.
* `tool_search` succeeded, reported activated tools, and the turn ended there.
*
* Dropping the key is lossless in the only sense that matters: JSON cannot tell
* an absent property from one set to `undefined`, so this writes down what
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/tool-catalog.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
* Shared product tool vocabulary (#1099).
*
* Tool is the catalog atom. Surface is optional and only for jointly governed
* packs (deferred `load_tools` groups and/or a shared host product boundary).
* searchable groups and/or a shared host product boundary.
* Hosts own implementations; this module owns names and metadata. Derive
* HostCapabilities / ToolAvailability groups from catalog ∩ host binding.
*
Expand DownExpand Up@@ -53,8 +53,6 @@ export interface CatalogSurfaceDef {
readonly id: string;
readonly label: string;
readonly description: string;
/** v1 packs are deferred load groups only. */
readonly economy: 'deferred';
readonly toolNames: readonly string[];
readonly hosts: Readonly<Record<ToolHostId, ToolHostSupport>>;
}
Expand DownExpand Up@@ -88,7 +86,6 @@ function freezeSurface(surface: CatalogSurfaceDef): CatalogSurfaceDef {
id: surface.id,
label: surface.label,
description: surface.description,
economy: surface.economy,
toolNames: Object.freeze([...surface.toolNames]),
hosts: Object.freeze({ ...surface.hosts }),
});
Expand DownExpand Up@@ -157,7 +154,7 @@ export const MAKA_CATALOG_TOOLS: readonly CatalogToolDef[] = Object.freeze(
);

/**
* Jointly governed deferred packs. Id `agent` matches the runtime
* Jointly governed searchable packs. Id `agent` matches the runtime
* ToolAvailability group id (AGENT_TOOL_GROUP_ID), not a separate "subagent" id.
* Each surface gets its own hosts object so affinity cannot cross-contaminate.
*/
Expand All@@ -168,15 +165,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
label: 'Rive',
description:
'Durable multi-agent Rive workflows: validate/import/run/status, scheduler, retries.',
economy: 'deferred' as const,
toolNames: ['RiveWorkflow'],
hosts: desktopOnlyHosts(),
},
{
id: 'browser',
label: 'Browser',
description: 'Drive the embedded browser: navigate, snapshot, click, type, wait, extract.',
economy: 'deferred' as const,
toolNames: [
'browser_navigate',
'browser_snapshot',
Expand All@@ -191,15 +186,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
id: 'computer_use',
label: 'Computer',
description: 'Observe and operate an explicitly approved local application.',
economy: 'deferred' as const,
toolNames: ['maka_computer'],
hosts: desktopOnlyHosts(),
},
{
id: 'agent',
label: 'Agent',
description: 'Spawn, fan out, and inspect foreground child agents.',
economy: 'deferred' as const,
toolNames: [
'agent_spawn',
'agent_list',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-quiet-preview.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -323,7 +323,7 @@ export function formatQuietJsonValue(value: unknown, locale: UiLocale = 'zh'): Q
return { body: redactSecrets(String(value)) };
}

// Known list payloads (Grep/Glob/load_tools/…).
// Known list payloads (Grep/Glob/tool_search/…).
for (const key of LIST_KEYS) {
if (!Array.isArray(record[key])) continue;
const consumed = new Set<string>([key]);
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/usage-stats/types.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,16 +205,15 @@ export type ToolSchemaChangeReason =

/**
* Diagnostic shell describing the provider-visible (active) tool subset for a
* turn, produced by the unified `ToolAvailabilityRuntime`. A "source" id here is
* a catalog *group* id — the shell retains the historical `*SourceIds` field
* names while the config-side vocabulary is `groups`.
* turn, produced by `ToolAvailabilityRuntime`. A "source" id here is a catalog
* group id; the historical field names remain stable for telemetry readers.
*/
export interface ToolAvailabilityDiagnostic {
/**
* Always `'economy'`: a diagnostic is only produced when economy gates the
* tool surface. The full-surface case emits no diagnostic at all.
* `'search'` is the current provider-independent lazy-loading policy.
* `'economy'` remains readable for historical telemetry.
*/
mode: 'economy';
mode: 'economy' | 'search';
enabledSourceIds: ToolSourceId[];
availableSourceIds?: ToolSourceId[];
connectorToolName?: string;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -825,7 +825,7 @@ describe('Host Client Capability coordinator', () => {
await coordinator.close();
});

test('keeps load_tools group identity provider-independent and contract-sensitive', async () => {
test('keeps tool-search source identity provider-independent and contract-sensitive', async () => {
const coordinator = createCoordinator();
const first = coordinator.attachConnection(clientCapabilityConnectionIdentity('connection-a'), {
send: async () => {},
Expand Down
46 changes: 21 additions & 25 deletions packages/runtime-host/src/__tests__/client-capability-uds.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';
import { LOAD_TOOLS_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { TOOL_SEARCH_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { type MakaTool } from '@maka/runtime/tool-runtime';
import { mcpProxyToolName } from '@maka/runtime/mcp-tools';
import { resolveStorageRoot, tryAcquireInteractiveRootOwner } from '@maka/storage/root-authority';
Expand DownExpand Up@@ -133,7 +133,7 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
affinity: 'session',
hostPathAccess: 'cwd',
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
description: 'Schedule a calendar meeting through the fixture provider.',
tools: [
{
serverId: 'fixture_unknown',
Expand DownExpand Up@@ -203,37 +203,33 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
abortSignal: new AbortController().signal,
emitOutput: () => undefined,
};
const activeTools = new Map<string, MakaTool>();
const availability = new ToolAvailabilityRuntime(
snapshot.tools,
{ economy: true, groups: snapshot.groups },
{ groups: snapshot.groups },
invalidTool(),
).prepare([]);
assert.deepEqual(availability.activeTools, [LOAD_TOOLS_NAME]);
const loadTools = availability.providerTools.find(
(candidate) => candidate.name === LOAD_TOOLS_NAME,
).prepare(activeTools);
assert.deepEqual(availability.activeTools, [TOOL_SEARCH_NAME]);
const toolSearch = availability.providerTools.find(
(candidate) => candidate.name === TOOL_SEARCH_NAME,
);
assert.ok(toolSearch);
const searched = await toolSearch.impl(
{ query: 'schedule calendar meeting', limit: 20 },
toolContext,
);
assert.ok(loadTools);
const loaded = await loadTools.impl({ group: group.id }, toolContext);
const capabilityToolNames = [tool.name, rejectedTool.name].sort((left, right) =>
left.localeCompare(right),
);
assert.deepEqual(loaded, {
loaded: capabilityToolNames,
group: {
id: group.id,
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
},
});
assert.deepEqual(
availability.projectActiveTools?.({
completedSteps: [
{
toolCalls: [{ toolName: LOAD_TOOLS_NAME, input: { group: group.id } }],
},
],
}).activeTools,
[LOAD_TOOLS_NAME, ...capabilityToolNames],
[...(searched as { activated: string[] }).activated].sort((left, right) =>
left.localeCompare(right),
),
capabilityToolNames,
);
assert.deepEqual(
availability.projectActiveTools?.().activeTools,
[TOOL_SEARCH_NAME, ...capabilityToolNames].sort((left, right) => left.localeCompare(right)),
);

const result = await tool.impl({ prefix: 'from-uds' }, toolContext);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -644,7 +644,7 @@ test('production backend creation continues after a Session Client Capability is
}
});

test('production backend preserves coordinator Client Capability semantics across load_tools and T1', async () => {
test('production backend preserves coordinator Client Capability semantics across tool_search and T1', async () => {
const sessionId = 'backend-creation-session';
const turnId = 'client-capability-turn';
const runId = 'client-capability-run';
Expand DownExpand Up@@ -814,9 +814,9 @@ test('production backend preserves coordinator Client Capability semantics acros
.filter((request) => request.body.stream === true)
.map((request) => toolNames(request.body));
assert.equal(providerToolSets.length, 3);
assert.ok(providerToolSets[0]?.includes('load_tools'));
assert.ok(providerToolSets[0]?.includes('tool_search'));
assert.equal(providerToolSets[0]?.includes(tool.name), false);
assert.ok(providerToolSets[1]?.includes('load_tools'));
assert.ok(providerToolSets[1]?.includes('tool_search'));
assert.ok(providerToolSets[1]?.includes(tool.name));
assert.ok(providerToolSets[2]?.includes(tool.name));
} finally {
Expand DownExpand Up@@ -1218,14 +1218,14 @@ test('production Host executes a canonical ai-sdk Session against a real provide
'WebFetch',
'Write',
'WriteStdin',
'load_tools',
'memory_extract',
'memory_remember',
'request_sandbox_boundary',
'task_create',
'task_get',
'task_list',
'task_update',
'tool_search',
]);
assert.match(JSON.stringify(compactRequests[0]?.body), /context summarization assistant/);

Expand DownExpand Up@@ -1641,7 +1641,7 @@ test('production Host executes a durable runnable child with an exact tool ceili

const requests = provider.requests.filter((request) => request.body.stream === true);
assert.equal(requests.length, 4);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
// The same routed child surface removes web_research when Tavily cannot run.
Expand DownExpand Up@@ -1842,7 +1842,7 @@ test('production Host publishes and retires an implementation child patch', asyn
requests.length <= MAX_IMPLEMENTATION_CHILD_REQUESTS + 3,
JSON.stringify(providerRequestTrace(requests)),
);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
assert.deepEqual(toolParameterEnum(requests[1]?.body, 'agent_spawn', 'profile'), [
Expand DownExpand Up@@ -3706,9 +3706,11 @@ async function handleProviderRequest(
(flow.kind === 'child_agent' || flow.kind === 'implementation_child_agent') &&
streamRequestIndex === 1
) {
assert.ok(toolNames(body).includes('load_tools'));
assert.ok(toolNames(body).includes('tool_search'));
assert.equal(toolNames(body).includes('agent_spawn'), false);
respondProviderToolCall(response, streamRequestIndex, 'load_tools', { group: 'agent' });
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: 'agent_spawn',
});
return;
}
if (
Expand DownExpand Up@@ -3811,9 +3813,9 @@ async function handleProviderRequest(
return;
}
if (flow.kind === 'client_capability' && streamRequestIndex === 1) {
assert.ok(toolNames(body).includes('load_tools'));
respondProviderToolCall(response, streamRequestIndex, 'load_tools', {
group: flow.groupId,
assert.ok(toolNames(body).includes('tool_search'));
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: flow.toolName,
});
return;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/runtime-host/src/server/interactive-run-composer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,9 +186,6 @@ export function createInteractiveRunComposer(input: InteractiveRunComposerInput)
const productSurface = projectEffectiveProductToolSurface({
host: 'runtime-host',
tools: selectedTools,
policy: {
economy: hasToolCeiling ? false : !process.env.MAKA_DISABLE_DEFERRED_TOOLS,
},
});
// A bound tool list is an exact child/local activation ceiling. Dynamic
// capabilities must be included by the authority that constructs that list.
Expand DownExpand Up@@ -507,7 +504,6 @@ function mergeToolAvailability(
groupIds.add(group.id);
}
return {
economy: product.economy,
groups: [...(product.groups ?? []), ...clientGroups],
};
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@
"https-proxy-agent": "^9.1.0",
"image-dimensions": "^2.5.1",
"linkedom": "^0.18.13",
"minisearch": "7.2.0",
"node-pty": "^1.2.0-beta.15",
"qrcode": "^1.5.4",
"socks": "^2.8.9",
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -10211,6 +10211,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
2 changes: 1 addition & 1 deletion docs/computer-use-provider-evidence.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,7 +109,7 @@ The first qualifying run completed with:
- terminal status: `complete / end_turn`;
- fixture oracle: verification code matched and interaction count remained zero.

The direct E2E tool exposure is deliberate. The default deferred `load_tools`
The direct E2E tool exposure is deliberate. The default deferred `tool_search`
path remains a separate product contract; the launcher narrows provider
variables while still exercising the production tool implementation, permission
engine, Runtime, Desktop host, and executor backend.
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/cli/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -5196,6 +5196,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/agent-run.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,7 @@ export const AGENT_RUN_EVENT_TYPES = [
'model_stream_failed',
'send_diagnostics_recorded',
'tool_started',
'tool_searched',
'tool_completed',
'tool_failed',
'skill_catalog_built',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-args-identity.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,7 +163,7 @@ function canonicalizeMainlineV1(value: unknown, parentKey?: string): unknown {
* The cost of not doing this was total. The refused write marked the runtime
* event store unavailable, the turn's terminal write then threw, and every turn
* that called any tool died a tenth of a second after the tool returned —
* `load_tools` succeeded, reported the group loaded, and the turn ended there.
* `tool_search` succeeded, reported activated tools, and the turn ended there.
*
* Dropping the key is lossless in the only sense that matters: JSON cannot tell
* an absent property from one set to `undefined`, so this writes down what
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/tool-catalog.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
* Shared product tool vocabulary (#1099).
*
* Tool is the catalog atom. Surface is optional and only for jointly governed
* packs (deferred `load_tools` groups and/or a shared host product boundary).
* searchable groups and/or a shared host product boundary.
* Hosts own implementations; this module owns names and metadata. Derive
* HostCapabilities / ToolAvailability groups from catalog ∩ host binding.
*
Expand DownExpand Up@@ -53,8 +53,6 @@ export interface CatalogSurfaceDef {
readonly id: string;
readonly label: string;
readonly description: string;
/** v1 packs are deferred load groups only. */
readonly economy: 'deferred';
readonly toolNames: readonly string[];
readonly hosts: Readonly<Record<ToolHostId, ToolHostSupport>>;
}
Expand DownExpand Up@@ -88,7 +86,6 @@ function freezeSurface(surface: CatalogSurfaceDef): CatalogSurfaceDef {
id: surface.id,
label: surface.label,
description: surface.description,
economy: surface.economy,
toolNames: Object.freeze([...surface.toolNames]),
hosts: Object.freeze({ ...surface.hosts }),
});
Expand DownExpand Up@@ -157,7 +154,7 @@ export const MAKA_CATALOG_TOOLS: readonly CatalogToolDef[] = Object.freeze(
);

/**
* Jointly governed deferred packs. Id `agent` matches the runtime
* Jointly governed searchable packs. Id `agent` matches the runtime
* ToolAvailability group id (AGENT_TOOL_GROUP_ID), not a separate "subagent" id.
* Each surface gets its own hosts object so affinity cannot cross-contaminate.
*/
Expand All@@ -168,15 +165,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
label: 'Rive',
description:
'Durable multi-agent Rive workflows: validate/import/run/status, scheduler, retries.',
economy: 'deferred' as const,
toolNames: ['RiveWorkflow'],
hosts: desktopOnlyHosts(),
},
{
id: 'browser',
label: 'Browser',
description: 'Drive the embedded browser: navigate, snapshot, click, type, wait, extract.',
economy: 'deferred' as const,
toolNames: [
'browser_navigate',
'browser_snapshot',
Expand All@@ -191,15 +186,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
id: 'computer_use',
label: 'Computer',
description: 'Observe and operate an explicitly approved local application.',
economy: 'deferred' as const,
toolNames: ['maka_computer'],
hosts: desktopOnlyHosts(),
},
{
id: 'agent',
label: 'Agent',
description: 'Spawn, fan out, and inspect foreground child agents.',
economy: 'deferred' as const,
toolNames: [
'agent_spawn',
'agent_list',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-quiet-preview.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -323,7 +323,7 @@ export function formatQuietJsonValue(value: unknown, locale: UiLocale = 'zh'): Q
return { body: redactSecrets(String(value)) };
}

// Known list payloads (Grep/Glob/load_tools/…).
// Known list payloads (Grep/Glob/tool_search/…).
for (const key of LIST_KEYS) {
if (!Array.isArray(record[key])) continue;
const consumed = new Set<string>([key]);
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/usage-stats/types.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,16 +205,15 @@ export type ToolSchemaChangeReason =

/**
* Diagnostic shell describing the provider-visible (active) tool subset for a
* turn, produced by the unified `ToolAvailabilityRuntime`. A "source" id here is
* a catalog *group* id — the shell retains the historical `*SourceIds` field
* names while the config-side vocabulary is `groups`.
* turn, produced by `ToolAvailabilityRuntime`. A "source" id here is a catalog
* group id; the historical field names remain stable for telemetry readers.
*/
export interface ToolAvailabilityDiagnostic {
/**
* Always `'economy'`: a diagnostic is only produced when economy gates the
* tool surface. The full-surface case emits no diagnostic at all.
* `'search'` is the current provider-independent lazy-loading policy.
* `'economy'` remains readable for historical telemetry.
*/
mode: 'economy';
mode: 'economy' | 'search';
enabledSourceIds: ToolSourceId[];
availableSourceIds?: ToolSourceId[];
connectorToolName?: string;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -825,7 +825,7 @@ describe('Host Client Capability coordinator', () => {
await coordinator.close();
});

test('keeps load_tools group identity provider-independent and contract-sensitive', async () => {
test('keeps tool-search source identity provider-independent and contract-sensitive', async () => {
const coordinator = createCoordinator();
const first = coordinator.attachConnection(clientCapabilityConnectionIdentity('connection-a'), {
send: async () => {},
Expand Down
46 changes: 21 additions & 25 deletions packages/runtime-host/src/__tests__/client-capability-uds.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';
import { LOAD_TOOLS_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { TOOL_SEARCH_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { type MakaTool } from '@maka/runtime/tool-runtime';
import { mcpProxyToolName } from '@maka/runtime/mcp-tools';
import { resolveStorageRoot, tryAcquireInteractiveRootOwner } from '@maka/storage/root-authority';
Expand DownExpand Up@@ -133,7 +133,7 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
affinity: 'session',
hostPathAccess: 'cwd',
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
description: 'Schedule a calendar meeting through the fixture provider.',
tools: [
{
serverId: 'fixture_unknown',
Expand DownExpand Up@@ -203,37 +203,33 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
abortSignal: new AbortController().signal,
emitOutput: () => undefined,
};
const activeTools = new Map<string, MakaTool>();
const availability = new ToolAvailabilityRuntime(
snapshot.tools,
{ economy: true, groups: snapshot.groups },
{ groups: snapshot.groups },
invalidTool(),
).prepare([]);
assert.deepEqual(availability.activeTools, [LOAD_TOOLS_NAME]);
const loadTools = availability.providerTools.find(
(candidate) => candidate.name === LOAD_TOOLS_NAME,
).prepare(activeTools);
assert.deepEqual(availability.activeTools, [TOOL_SEARCH_NAME]);
const toolSearch = availability.providerTools.find(
(candidate) => candidate.name === TOOL_SEARCH_NAME,
);
assert.ok(toolSearch);
const searched = await toolSearch.impl(
{ query: 'schedule calendar meeting', limit: 20 },
toolContext,
);
assert.ok(loadTools);
const loaded = await loadTools.impl({ group: group.id }, toolContext);
const capabilityToolNames = [tool.name, rejectedTool.name].sort((left, right) =>
left.localeCompare(right),
);
assert.deepEqual(loaded, {
loaded: capabilityToolNames,
group: {
id: group.id,
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
},
});
assert.deepEqual(
availability.projectActiveTools?.({
completedSteps: [
{
toolCalls: [{ toolName: LOAD_TOOLS_NAME, input: { group: group.id } }],
},
],
}).activeTools,
[LOAD_TOOLS_NAME, ...capabilityToolNames],
[...(searched as { activated: string[] }).activated].sort((left, right) =>
left.localeCompare(right),
),
capabilityToolNames,
);
assert.deepEqual(
availability.projectActiveTools?.().activeTools,
[TOOL_SEARCH_NAME, ...capabilityToolNames].sort((left, right) => left.localeCompare(right)),
);

const result = await tool.impl({ prefix: 'from-uds' }, toolContext);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -644,7 +644,7 @@ test('production backend creation continues after a Session Client Capability is
}
});

test('production backend preserves coordinator Client Capability semantics across load_tools and T1', async () => {
test('production backend preserves coordinator Client Capability semantics across tool_search and T1', async () => {
const sessionId = 'backend-creation-session';
const turnId = 'client-capability-turn';
const runId = 'client-capability-run';
Expand DownExpand Up@@ -814,9 +814,9 @@ test('production backend preserves coordinator Client Capability semantics acros
.filter((request) => request.body.stream === true)
.map((request) => toolNames(request.body));
assert.equal(providerToolSets.length, 3);
assert.ok(providerToolSets[0]?.includes('load_tools'));
assert.ok(providerToolSets[0]?.includes('tool_search'));
assert.equal(providerToolSets[0]?.includes(tool.name), false);
assert.ok(providerToolSets[1]?.includes('load_tools'));
assert.ok(providerToolSets[1]?.includes('tool_search'));
assert.ok(providerToolSets[1]?.includes(tool.name));
assert.ok(providerToolSets[2]?.includes(tool.name));
} finally {
Expand DownExpand Up@@ -1218,14 +1218,14 @@ test('production Host executes a canonical ai-sdk Session against a real provide
'WebFetch',
'Write',
'WriteStdin',
'load_tools',
'memory_extract',
'memory_remember',
'request_sandbox_boundary',
'task_create',
'task_get',
'task_list',
'task_update',
'tool_search',
]);
assert.match(JSON.stringify(compactRequests[0]?.body), /context summarization assistant/);

Expand DownExpand Up@@ -1641,7 +1641,7 @@ test('production Host executes a durable runnable child with an exact tool ceili

const requests = provider.requests.filter((request) => request.body.stream === true);
assert.equal(requests.length, 4);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
// The same routed child surface removes web_research when Tavily cannot run.
Expand DownExpand Up@@ -1842,7 +1842,7 @@ test('production Host publishes and retires an implementation child patch', asyn
requests.length <= MAX_IMPLEMENTATION_CHILD_REQUESTS + 3,
JSON.stringify(providerRequestTrace(requests)),
);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
assert.deepEqual(toolParameterEnum(requests[1]?.body, 'agent_spawn', 'profile'), [
Expand DownExpand Up@@ -3706,9 +3706,11 @@ async function handleProviderRequest(
(flow.kind === 'child_agent' || flow.kind === 'implementation_child_agent') &&
streamRequestIndex === 1
) {
assert.ok(toolNames(body).includes('load_tools'));
assert.ok(toolNames(body).includes('tool_search'));
assert.equal(toolNames(body).includes('agent_spawn'), false);
respondProviderToolCall(response, streamRequestIndex, 'load_tools', { group: 'agent' });
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: 'agent_spawn',
});
return;
}
if (
Expand DownExpand Up@@ -3811,9 +3813,9 @@ async function handleProviderRequest(
return;
}
if (flow.kind === 'client_capability' && streamRequestIndex === 1) {
assert.ok(toolNames(body).includes('load_tools'));
respondProviderToolCall(response, streamRequestIndex, 'load_tools', {
group: flow.groupId,
assert.ok(toolNames(body).includes('tool_search'));
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: flow.toolName,
});
return;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/runtime-host/src/server/interactive-run-composer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,9 +186,6 @@ export function createInteractiveRunComposer(input: InteractiveRunComposerInput)
const productSurface = projectEffectiveProductToolSurface({
host: 'runtime-host',
tools: selectedTools,
policy: {
economy: hasToolCeiling ? false : !process.env.MAKA_DISABLE_DEFERRED_TOOLS,
},
});
// A bound tool list is an exact child/local activation ceiling. Dynamic
// capabilities must be included by the authority that constructs that list.
Expand DownExpand Up@@ -507,7 +504,6 @@ function mergeToolAvailability(
groupIds.add(group.id);
}
return {
economy: product.economy,
groups: [...(product.groups ?? []), ...clientGroups],
};
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@
"https-proxy-agent": "^9.1.0",
"image-dimensions": "^2.5.1",
"linkedom": "^0.18.13",
"minisearch": "7.2.0",
"node-pty": "^1.2.0-beta.15",
"qrcode": "^1.5.4",
"socks": "^2.8.9",
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -10211,6 +10211,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
2 changes: 1 addition & 1 deletion docs/computer-use-provider-evidence.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,7 +109,7 @@ The first qualifying run completed with:
- terminal status: `complete / end_turn`;
- fixture oracle: verification code matched and interaction count remained zero.

The direct E2E tool exposure is deliberate. The default deferred `load_tools`
The direct E2E tool exposure is deliberate. The default deferred `tool_search`
path remains a separate product contract; the launcher narrows provider
variables while still exercising the production tool implementation, permission
engine, Runtime, Desktop host, and executor backend.
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/cli/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -5196,6 +5196,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/agent-run.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,7 @@ export const AGENT_RUN_EVENT_TYPES = [
'model_stream_failed',
'send_diagnostics_recorded',
'tool_started',
'tool_searched',
'tool_completed',
'tool_failed',
'skill_catalog_built',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-args-identity.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,7 +163,7 @@ function canonicalizeMainlineV1(value: unknown, parentKey?: string): unknown {
* The cost of not doing this was total. The refused write marked the runtime
* event store unavailable, the turn's terminal write then threw, and every turn
* that called any tool died a tenth of a second after the tool returned —
* `load_tools` succeeded, reported the group loaded, and the turn ended there.
* `tool_search` succeeded, reported activated tools, and the turn ended there.
*
* Dropping the key is lossless in the only sense that matters: JSON cannot tell
* an absent property from one set to `undefined`, so this writes down what
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/tool-catalog.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
* Shared product tool vocabulary (#1099).
*
* Tool is the catalog atom. Surface is optional and only for jointly governed
* packs (deferred `load_tools` groups and/or a shared host product boundary).
* searchable groups and/or a shared host product boundary.
* Hosts own implementations; this module owns names and metadata. Derive
* HostCapabilities / ToolAvailability groups from catalog ∩ host binding.
*
Expand DownExpand Up@@ -53,8 +53,6 @@ export interface CatalogSurfaceDef {
readonly id: string;
readonly label: string;
readonly description: string;
/** v1 packs are deferred load groups only. */
readonly economy: 'deferred';
readonly toolNames: readonly string[];
readonly hosts: Readonly<Record<ToolHostId, ToolHostSupport>>;
}
Expand DownExpand Up@@ -88,7 +86,6 @@ function freezeSurface(surface: CatalogSurfaceDef): CatalogSurfaceDef {
id: surface.id,
label: surface.label,
description: surface.description,
economy: surface.economy,
toolNames: Object.freeze([...surface.toolNames]),
hosts: Object.freeze({ ...surface.hosts }),
});
Expand DownExpand Up@@ -157,7 +154,7 @@ export const MAKA_CATALOG_TOOLS: readonly CatalogToolDef[] = Object.freeze(
);

/**
* Jointly governed deferred packs. Id `agent` matches the runtime
* Jointly governed searchable packs. Id `agent` matches the runtime
* ToolAvailability group id (AGENT_TOOL_GROUP_ID), not a separate "subagent" id.
* Each surface gets its own hosts object so affinity cannot cross-contaminate.
*/
Expand All@@ -168,15 +165,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
label: 'Rive',
description:
'Durable multi-agent Rive workflows: validate/import/run/status, scheduler, retries.',
economy: 'deferred' as const,
toolNames: ['RiveWorkflow'],
hosts: desktopOnlyHosts(),
},
{
id: 'browser',
label: 'Browser',
description: 'Drive the embedded browser: navigate, snapshot, click, type, wait, extract.',
economy: 'deferred' as const,
toolNames: [
'browser_navigate',
'browser_snapshot',
Expand All@@ -191,15 +186,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
id: 'computer_use',
label: 'Computer',
description: 'Observe and operate an explicitly approved local application.',
economy: 'deferred' as const,
toolNames: ['maka_computer'],
hosts: desktopOnlyHosts(),
},
{
id: 'agent',
label: 'Agent',
description: 'Spawn, fan out, and inspect foreground child agents.',
economy: 'deferred' as const,
toolNames: [
'agent_spawn',
'agent_list',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-quiet-preview.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -323,7 +323,7 @@ export function formatQuietJsonValue(value: unknown, locale: UiLocale = 'zh'): Q
return { body: redactSecrets(String(value)) };
}

// Known list payloads (Grep/Glob/load_tools/…).
// Known list payloads (Grep/Glob/tool_search/…).
for (const key of LIST_KEYS) {
if (!Array.isArray(record[key])) continue;
const consumed = new Set<string>([key]);
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/usage-stats/types.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,16 +205,15 @@ export type ToolSchemaChangeReason =

/**
* Diagnostic shell describing the provider-visible (active) tool subset for a
* turn, produced by the unified `ToolAvailabilityRuntime`. A "source" id here is
* a catalog *group* id — the shell retains the historical `*SourceIds` field
* names while the config-side vocabulary is `groups`.
* turn, produced by `ToolAvailabilityRuntime`. A "source" id here is a catalog
* group id; the historical field names remain stable for telemetry readers.
*/
export interface ToolAvailabilityDiagnostic {
/**
* Always `'economy'`: a diagnostic is only produced when economy gates the
* tool surface. The full-surface case emits no diagnostic at all.
* `'search'` is the current provider-independent lazy-loading policy.
* `'economy'` remains readable for historical telemetry.
*/
mode: 'economy';
mode: 'economy' | 'search';
enabledSourceIds: ToolSourceId[];
availableSourceIds?: ToolSourceId[];
connectorToolName?: string;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -825,7 +825,7 @@ describe('Host Client Capability coordinator', () => {
await coordinator.close();
});

test('keeps load_tools group identity provider-independent and contract-sensitive', async () => {
test('keeps tool-search source identity provider-independent and contract-sensitive', async () => {
const coordinator = createCoordinator();
const first = coordinator.attachConnection(clientCapabilityConnectionIdentity('connection-a'), {
send: async () => {},
Expand Down
46 changes: 21 additions & 25 deletions packages/runtime-host/src/__tests__/client-capability-uds.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';
import { LOAD_TOOLS_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { TOOL_SEARCH_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { type MakaTool } from '@maka/runtime/tool-runtime';
import { mcpProxyToolName } from '@maka/runtime/mcp-tools';
import { resolveStorageRoot, tryAcquireInteractiveRootOwner } from '@maka/storage/root-authority';
Expand DownExpand Up@@ -133,7 +133,7 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
affinity: 'session',
hostPathAccess: 'cwd',
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
description: 'Schedule a calendar meeting through the fixture provider.',
tools: [
{
serverId: 'fixture_unknown',
Expand DownExpand Up@@ -203,37 +203,33 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
abortSignal: new AbortController().signal,
emitOutput: () => undefined,
};
const activeTools = new Map<string, MakaTool>();
const availability = new ToolAvailabilityRuntime(
snapshot.tools,
{ economy: true, groups: snapshot.groups },
{ groups: snapshot.groups },
invalidTool(),
).prepare([]);
assert.deepEqual(availability.activeTools, [LOAD_TOOLS_NAME]);
const loadTools = availability.providerTools.find(
(candidate) => candidate.name === LOAD_TOOLS_NAME,
).prepare(activeTools);
assert.deepEqual(availability.activeTools, [TOOL_SEARCH_NAME]);
const toolSearch = availability.providerTools.find(
(candidate) => candidate.name === TOOL_SEARCH_NAME,
);
assert.ok(toolSearch);
const searched = await toolSearch.impl(
{ query: 'schedule calendar meeting', limit: 20 },
toolContext,
);
assert.ok(loadTools);
const loaded = await loadTools.impl({ group: group.id }, toolContext);
const capabilityToolNames = [tool.name, rejectedTool.name].sort((left, right) =>
left.localeCompare(right),
);
assert.deepEqual(loaded, {
loaded: capabilityToolNames,
group: {
id: group.id,
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
},
});
assert.deepEqual(
availability.projectActiveTools?.({
completedSteps: [
{
toolCalls: [{ toolName: LOAD_TOOLS_NAME, input: { group: group.id } }],
},
],
}).activeTools,
[LOAD_TOOLS_NAME, ...capabilityToolNames],
[...(searched as { activated: string[] }).activated].sort((left, right) =>
left.localeCompare(right),
),
capabilityToolNames,
);
assert.deepEqual(
availability.projectActiveTools?.().activeTools,
[TOOL_SEARCH_NAME, ...capabilityToolNames].sort((left, right) => left.localeCompare(right)),
);

const result = await tool.impl({ prefix: 'from-uds' }, toolContext);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -644,7 +644,7 @@ test('production backend creation continues after a Session Client Capability is
}
});

test('production backend preserves coordinator Client Capability semantics across load_tools and T1', async () => {
test('production backend preserves coordinator Client Capability semantics across tool_search and T1', async () => {
const sessionId = 'backend-creation-session';
const turnId = 'client-capability-turn';
const runId = 'client-capability-run';
Expand DownExpand Up@@ -814,9 +814,9 @@ test('production backend preserves coordinator Client Capability semantics acros
.filter((request) => request.body.stream === true)
.map((request) => toolNames(request.body));
assert.equal(providerToolSets.length, 3);
assert.ok(providerToolSets[0]?.includes('load_tools'));
assert.ok(providerToolSets[0]?.includes('tool_search'));
assert.equal(providerToolSets[0]?.includes(tool.name), false);
assert.ok(providerToolSets[1]?.includes('load_tools'));
assert.ok(providerToolSets[1]?.includes('tool_search'));
assert.ok(providerToolSets[1]?.includes(tool.name));
assert.ok(providerToolSets[2]?.includes(tool.name));
} finally {
Expand DownExpand Up@@ -1218,14 +1218,14 @@ test('production Host executes a canonical ai-sdk Session against a real provide
'WebFetch',
'Write',
'WriteStdin',
'load_tools',
'memory_extract',
'memory_remember',
'request_sandbox_boundary',
'task_create',
'task_get',
'task_list',
'task_update',
'tool_search',
]);
assert.match(JSON.stringify(compactRequests[0]?.body), /context summarization assistant/);

Expand DownExpand Up@@ -1641,7 +1641,7 @@ test('production Host executes a durable runnable child with an exact tool ceili

const requests = provider.requests.filter((request) => request.body.stream === true);
assert.equal(requests.length, 4);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
// The same routed child surface removes web_research when Tavily cannot run.
Expand DownExpand Up@@ -1842,7 +1842,7 @@ test('production Host publishes and retires an implementation child patch', asyn
requests.length <= MAX_IMPLEMENTATION_CHILD_REQUESTS + 3,
JSON.stringify(providerRequestTrace(requests)),
);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
assert.deepEqual(toolParameterEnum(requests[1]?.body, 'agent_spawn', 'profile'), [
Expand DownExpand Up@@ -3706,9 +3706,11 @@ async function handleProviderRequest(
(flow.kind === 'child_agent' || flow.kind === 'implementation_child_agent') &&
streamRequestIndex === 1
) {
assert.ok(toolNames(body).includes('load_tools'));
assert.ok(toolNames(body).includes('tool_search'));
assert.equal(toolNames(body).includes('agent_spawn'), false);
respondProviderToolCall(response, streamRequestIndex, 'load_tools', { group: 'agent' });
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: 'agent_spawn',
});
return;
}
if (
Expand DownExpand Up@@ -3811,9 +3813,9 @@ async function handleProviderRequest(
return;
}
if (flow.kind === 'client_capability' && streamRequestIndex === 1) {
assert.ok(toolNames(body).includes('load_tools'));
respondProviderToolCall(response, streamRequestIndex, 'load_tools', {
group: flow.groupId,
assert.ok(toolNames(body).includes('tool_search'));
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: flow.toolName,
});
return;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/runtime-host/src/server/interactive-run-composer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,9 +186,6 @@ export function createInteractiveRunComposer(input: InteractiveRunComposerInput)
const productSurface = projectEffectiveProductToolSurface({
host: 'runtime-host',
tools: selectedTools,
policy: {
economy: hasToolCeiling ? false : !process.env.MAKA_DISABLE_DEFERRED_TOOLS,
},
});
// A bound tool list is an exact child/local activation ceiling. Dynamic
// capabilities must be included by the authority that constructs that list.
Expand DownExpand Up@@ -507,7 +504,6 @@ function mergeToolAvailability(
groupIds.add(group.id);
}
return {
economy: product.economy,
groups: [...(product.groups ?? []), ...clientGroups],
};
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@
"https-proxy-agent": "^9.1.0",
"image-dimensions": "^2.5.1",
"linkedom": "^0.18.13",
"minisearch": "7.2.0",
"node-pty": "^1.2.0-beta.15",
"qrcode": "^1.5.4",
"socks": "^2.8.9",
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -10211,6 +10211,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
2 changes: 1 addition & 1 deletion docs/computer-use-provider-evidence.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,7 +109,7 @@ The first qualifying run completed with:
- terminal status: `complete / end_turn`;
- fixture oracle: verification code matched and interaction count remained zero.

The direct E2E tool exposure is deliberate. The default deferred `load_tools`
The direct E2E tool exposure is deliberate. The default deferred `tool_search`
path remains a separate product contract; the launcher narrows provider
variables while still exercising the production tool implementation, permission
engine, Runtime, Desktop host, and executor backend.
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/cli/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -5196,6 +5196,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/agent-run.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,7 @@ export const AGENT_RUN_EVENT_TYPES = [
'model_stream_failed',
'send_diagnostics_recorded',
'tool_started',
'tool_searched',
'tool_completed',
'tool_failed',
'skill_catalog_built',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-args-identity.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,7 +163,7 @@ function canonicalizeMainlineV1(value: unknown, parentKey?: string): unknown {
* The cost of not doing this was total. The refused write marked the runtime
* event store unavailable, the turn's terminal write then threw, and every turn
* that called any tool died a tenth of a second after the tool returned —
* `load_tools` succeeded, reported the group loaded, and the turn ended there.
* `tool_search` succeeded, reported activated tools, and the turn ended there.
*
* Dropping the key is lossless in the only sense that matters: JSON cannot tell
* an absent property from one set to `undefined`, so this writes down what
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/tool-catalog.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
* Shared product tool vocabulary (#1099).
*
* Tool is the catalog atom. Surface is optional and only for jointly governed
* packs (deferred `load_tools` groups and/or a shared host product boundary).
* searchable groups and/or a shared host product boundary.
* Hosts own implementations; this module owns names and metadata. Derive
* HostCapabilities / ToolAvailability groups from catalog ∩ host binding.
*
Expand DownExpand Up@@ -53,8 +53,6 @@ export interface CatalogSurfaceDef {
readonly id: string;
readonly label: string;
readonly description: string;
/** v1 packs are deferred load groups only. */
readonly economy: 'deferred';
readonly toolNames: readonly string[];
readonly hosts: Readonly<Record<ToolHostId, ToolHostSupport>>;
}
Expand DownExpand Up@@ -88,7 +86,6 @@ function freezeSurface(surface: CatalogSurfaceDef): CatalogSurfaceDef {
id: surface.id,
label: surface.label,
description: surface.description,
economy: surface.economy,
toolNames: Object.freeze([...surface.toolNames]),
hosts: Object.freeze({ ...surface.hosts }),
});
Expand DownExpand Up@@ -157,7 +154,7 @@ export const MAKA_CATALOG_TOOLS: readonly CatalogToolDef[] = Object.freeze(
);

/**
* Jointly governed deferred packs. Id `agent` matches the runtime
* Jointly governed searchable packs. Id `agent` matches the runtime
* ToolAvailability group id (AGENT_TOOL_GROUP_ID), not a separate "subagent" id.
* Each surface gets its own hosts object so affinity cannot cross-contaminate.
*/
Expand All@@ -168,15 +165,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
label: 'Rive',
description:
'Durable multi-agent Rive workflows: validate/import/run/status, scheduler, retries.',
economy: 'deferred' as const,
toolNames: ['RiveWorkflow'],
hosts: desktopOnlyHosts(),
},
{
id: 'browser',
label: 'Browser',
description: 'Drive the embedded browser: navigate, snapshot, click, type, wait, extract.',
economy: 'deferred' as const,
toolNames: [
'browser_navigate',
'browser_snapshot',
Expand All@@ -191,15 +186,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
id: 'computer_use',
label: 'Computer',
description: 'Observe and operate an explicitly approved local application.',
economy: 'deferred' as const,
toolNames: ['maka_computer'],
hosts: desktopOnlyHosts(),
},
{
id: 'agent',
label: 'Agent',
description: 'Spawn, fan out, and inspect foreground child agents.',
economy: 'deferred' as const,
toolNames: [
'agent_spawn',
'agent_list',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-quiet-preview.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -323,7 +323,7 @@ export function formatQuietJsonValue(value: unknown, locale: UiLocale = 'zh'): Q
return { body: redactSecrets(String(value)) };
}

// Known list payloads (Grep/Glob/load_tools/…).
// Known list payloads (Grep/Glob/tool_search/…).
for (const key of LIST_KEYS) {
if (!Array.isArray(record[key])) continue;
const consumed = new Set<string>([key]);
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/usage-stats/types.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,16 +205,15 @@ export type ToolSchemaChangeReason =

/**
* Diagnostic shell describing the provider-visible (active) tool subset for a
* turn, produced by the unified `ToolAvailabilityRuntime`. A "source" id here is
* a catalog *group* id — the shell retains the historical `*SourceIds` field
* names while the config-side vocabulary is `groups`.
* turn, produced by `ToolAvailabilityRuntime`. A "source" id here is a catalog
* group id; the historical field names remain stable for telemetry readers.
*/
export interface ToolAvailabilityDiagnostic {
/**
* Always `'economy'`: a diagnostic is only produced when economy gates the
* tool surface. The full-surface case emits no diagnostic at all.
* `'search'` is the current provider-independent lazy-loading policy.
* `'economy'` remains readable for historical telemetry.
*/
mode: 'economy';
mode: 'economy' | 'search';
enabledSourceIds: ToolSourceId[];
availableSourceIds?: ToolSourceId[];
connectorToolName?: string;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -825,7 +825,7 @@ describe('Host Client Capability coordinator', () => {
await coordinator.close();
});

test('keeps load_tools group identity provider-independent and contract-sensitive', async () => {
test('keeps tool-search source identity provider-independent and contract-sensitive', async () => {
const coordinator = createCoordinator();
const first = coordinator.attachConnection(clientCapabilityConnectionIdentity('connection-a'), {
send: async () => {},
Expand Down
46 changes: 21 additions & 25 deletions packages/runtime-host/src/__tests__/client-capability-uds.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';
import { LOAD_TOOLS_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { TOOL_SEARCH_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { type MakaTool } from '@maka/runtime/tool-runtime';
import { mcpProxyToolName } from '@maka/runtime/mcp-tools';
import { resolveStorageRoot, tryAcquireInteractiveRootOwner } from '@maka/storage/root-authority';
Expand DownExpand Up@@ -133,7 +133,7 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
affinity: 'session',
hostPathAccess: 'cwd',
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
description: 'Schedule a calendar meeting through the fixture provider.',
tools: [
{
serverId: 'fixture_unknown',
Expand DownExpand Up@@ -203,37 +203,33 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
abortSignal: new AbortController().signal,
emitOutput: () => undefined,
};
const activeTools = new Map<string, MakaTool>();
const availability = new ToolAvailabilityRuntime(
snapshot.tools,
{ economy: true, groups: snapshot.groups },
{ groups: snapshot.groups },
invalidTool(),
).prepare([]);
assert.deepEqual(availability.activeTools, [LOAD_TOOLS_NAME]);
const loadTools = availability.providerTools.find(
(candidate) => candidate.name === LOAD_TOOLS_NAME,
).prepare(activeTools);
assert.deepEqual(availability.activeTools, [TOOL_SEARCH_NAME]);
const toolSearch = availability.providerTools.find(
(candidate) => candidate.name === TOOL_SEARCH_NAME,
);
assert.ok(toolSearch);
const searched = await toolSearch.impl(
{ query: 'schedule calendar meeting', limit: 20 },
toolContext,
);
assert.ok(loadTools);
const loaded = await loadTools.impl({ group: group.id }, toolContext);
const capabilityToolNames = [tool.name, rejectedTool.name].sort((left, right) =>
left.localeCompare(right),
);
assert.deepEqual(loaded, {
loaded: capabilityToolNames,
group: {
id: group.id,
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
},
});
assert.deepEqual(
availability.projectActiveTools?.({
completedSteps: [
{
toolCalls: [{ toolName: LOAD_TOOLS_NAME, input: { group: group.id } }],
},
],
}).activeTools,
[LOAD_TOOLS_NAME, ...capabilityToolNames],
[...(searched as { activated: string[] }).activated].sort((left, right) =>
left.localeCompare(right),
),
capabilityToolNames,
);
assert.deepEqual(
availability.projectActiveTools?.().activeTools,
[TOOL_SEARCH_NAME, ...capabilityToolNames].sort((left, right) => left.localeCompare(right)),
);

const result = await tool.impl({ prefix: 'from-uds' }, toolContext);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -644,7 +644,7 @@ test('production backend creation continues after a Session Client Capability is
}
});

test('production backend preserves coordinator Client Capability semantics across load_tools and T1', async () => {
test('production backend preserves coordinator Client Capability semantics across tool_search and T1', async () => {
const sessionId = 'backend-creation-session';
const turnId = 'client-capability-turn';
const runId = 'client-capability-run';
Expand DownExpand Up@@ -814,9 +814,9 @@ test('production backend preserves coordinator Client Capability semantics acros
.filter((request) => request.body.stream === true)
.map((request) => toolNames(request.body));
assert.equal(providerToolSets.length, 3);
assert.ok(providerToolSets[0]?.includes('load_tools'));
assert.ok(providerToolSets[0]?.includes('tool_search'));
assert.equal(providerToolSets[0]?.includes(tool.name), false);
assert.ok(providerToolSets[1]?.includes('load_tools'));
assert.ok(providerToolSets[1]?.includes('tool_search'));
assert.ok(providerToolSets[1]?.includes(tool.name));
assert.ok(providerToolSets[2]?.includes(tool.name));
} finally {
Expand DownExpand Up@@ -1218,14 +1218,14 @@ test('production Host executes a canonical ai-sdk Session against a real provide
'WebFetch',
'Write',
'WriteStdin',
'load_tools',
'memory_extract',
'memory_remember',
'request_sandbox_boundary',
'task_create',
'task_get',
'task_list',
'task_update',
'tool_search',
]);
assert.match(JSON.stringify(compactRequests[0]?.body), /context summarization assistant/);

Expand DownExpand Up@@ -1641,7 +1641,7 @@ test('production Host executes a durable runnable child with an exact tool ceili

const requests = provider.requests.filter((request) => request.body.stream === true);
assert.equal(requests.length, 4);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
// The same routed child surface removes web_research when Tavily cannot run.
Expand DownExpand Up@@ -1842,7 +1842,7 @@ test('production Host publishes and retires an implementation child patch', asyn
requests.length <= MAX_IMPLEMENTATION_CHILD_REQUESTS + 3,
JSON.stringify(providerRequestTrace(requests)),
);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
assert.deepEqual(toolParameterEnum(requests[1]?.body, 'agent_spawn', 'profile'), [
Expand DownExpand Up@@ -3706,9 +3706,11 @@ async function handleProviderRequest(
(flow.kind === 'child_agent' || flow.kind === 'implementation_child_agent') &&
streamRequestIndex === 1
) {
assert.ok(toolNames(body).includes('load_tools'));
assert.ok(toolNames(body).includes('tool_search'));
assert.equal(toolNames(body).includes('agent_spawn'), false);
respondProviderToolCall(response, streamRequestIndex, 'load_tools', { group: 'agent' });
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: 'agent_spawn',
});
return;
}
if (
Expand DownExpand Up@@ -3811,9 +3813,9 @@ async function handleProviderRequest(
return;
}
if (flow.kind === 'client_capability' && streamRequestIndex === 1) {
assert.ok(toolNames(body).includes('load_tools'));
respondProviderToolCall(response, streamRequestIndex, 'load_tools', {
group: flow.groupId,
assert.ok(toolNames(body).includes('tool_search'));
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: flow.toolName,
});
return;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/runtime-host/src/server/interactive-run-composer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,9 +186,6 @@ export function createInteractiveRunComposer(input: InteractiveRunComposerInput)
const productSurface = projectEffectiveProductToolSurface({
host: 'runtime-host',
tools: selectedTools,
policy: {
economy: hasToolCeiling ? false : !process.env.MAKA_DISABLE_DEFERRED_TOOLS,
},
});
// A bound tool list is an exact child/local activation ceiling. Dynamic
// capabilities must be included by the authority that constructs that list.
Expand DownExpand Up@@ -507,7 +504,6 @@ function mergeToolAvailability(
groupIds.add(group.id);
}
return {
economy: product.economy,
groups: [...(product.groups ?? []), ...clientGroups],
};
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@
"https-proxy-agent": "^9.1.0",
"image-dimensions": "^2.5.1",
"linkedom": "^0.18.13",
"minisearch": "7.2.0",
"node-pty": "^1.2.0-beta.15",
"qrcode": "^1.5.4",
"socks": "^2.8.9",
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -10211,6 +10211,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
2 changes: 1 addition & 1 deletion docs/computer-use-provider-evidence.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,7 +109,7 @@ The first qualifying run completed with:
- terminal status: `complete / end_turn`;
- fixture oracle: verification code matched and interaction count remained zero.

The direct E2E tool exposure is deliberate. The default deferred `load_tools`
The direct E2E tool exposure is deliberate. The default deferred `tool_search`
path remains a separate product contract; the launcher narrows provider
variables while still exercising the production tool implementation, permission
engine, Runtime, Desktop host, and executor backend.
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/cli/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -5196,6 +5196,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/agent-run.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,7 @@ export const AGENT_RUN_EVENT_TYPES = [
'model_stream_failed',
'send_diagnostics_recorded',
'tool_started',
'tool_searched',
'tool_completed',
'tool_failed',
'skill_catalog_built',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-args-identity.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,7 +163,7 @@ function canonicalizeMainlineV1(value: unknown, parentKey?: string): unknown {
* The cost of not doing this was total. The refused write marked the runtime
* event store unavailable, the turn's terminal write then threw, and every turn
* that called any tool died a tenth of a second after the tool returned —
* `load_tools` succeeded, reported the group loaded, and the turn ended there.
* `tool_search` succeeded, reported activated tools, and the turn ended there.
*
* Dropping the key is lossless in the only sense that matters: JSON cannot tell
* an absent property from one set to `undefined`, so this writes down what
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/tool-catalog.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
* Shared product tool vocabulary (#1099).
*
* Tool is the catalog atom. Surface is optional and only for jointly governed
* packs (deferred `load_tools` groups and/or a shared host product boundary).
* searchable groups and/or a shared host product boundary.
* Hosts own implementations; this module owns names and metadata. Derive
* HostCapabilities / ToolAvailability groups from catalog ∩ host binding.
*
Expand DownExpand Up@@ -53,8 +53,6 @@ export interface CatalogSurfaceDef {
readonly id: string;
readonly label: string;
readonly description: string;
/** v1 packs are deferred load groups only. */
readonly economy: 'deferred';
readonly toolNames: readonly string[];
readonly hosts: Readonly<Record<ToolHostId, ToolHostSupport>>;
}
Expand DownExpand Up@@ -88,7 +86,6 @@ function freezeSurface(surface: CatalogSurfaceDef): CatalogSurfaceDef {
id: surface.id,
label: surface.label,
description: surface.description,
economy: surface.economy,
toolNames: Object.freeze([...surface.toolNames]),
hosts: Object.freeze({ ...surface.hosts }),
});
Expand DownExpand Up@@ -157,7 +154,7 @@ export const MAKA_CATALOG_TOOLS: readonly CatalogToolDef[] = Object.freeze(
);

/**
* Jointly governed deferred packs. Id `agent` matches the runtime
* Jointly governed searchable packs. Id `agent` matches the runtime
* ToolAvailability group id (AGENT_TOOL_GROUP_ID), not a separate "subagent" id.
* Each surface gets its own hosts object so affinity cannot cross-contaminate.
*/
Expand All@@ -168,15 +165,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
label: 'Rive',
description:
'Durable multi-agent Rive workflows: validate/import/run/status, scheduler, retries.',
economy: 'deferred' as const,
toolNames: ['RiveWorkflow'],
hosts: desktopOnlyHosts(),
},
{
id: 'browser',
label: 'Browser',
description: 'Drive the embedded browser: navigate, snapshot, click, type, wait, extract.',
economy: 'deferred' as const,
toolNames: [
'browser_navigate',
'browser_snapshot',
Expand All@@ -191,15 +186,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
id: 'computer_use',
label: 'Computer',
description: 'Observe and operate an explicitly approved local application.',
economy: 'deferred' as const,
toolNames: ['maka_computer'],
hosts: desktopOnlyHosts(),
},
{
id: 'agent',
label: 'Agent',
description: 'Spawn, fan out, and inspect foreground child agents.',
economy: 'deferred' as const,
toolNames: [
'agent_spawn',
'agent_list',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-quiet-preview.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -323,7 +323,7 @@ export function formatQuietJsonValue(value: unknown, locale: UiLocale = 'zh'): Q
return { body: redactSecrets(String(value)) };
}

// Known list payloads (Grep/Glob/load_tools/…).
// Known list payloads (Grep/Glob/tool_search/…).
for (const key of LIST_KEYS) {
if (!Array.isArray(record[key])) continue;
const consumed = new Set<string>([key]);
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/usage-stats/types.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,16 +205,15 @@ export type ToolSchemaChangeReason =

/**
* Diagnostic shell describing the provider-visible (active) tool subset for a
* turn, produced by the unified `ToolAvailabilityRuntime`. A "source" id here is
* a catalog *group* id — the shell retains the historical `*SourceIds` field
* names while the config-side vocabulary is `groups`.
* turn, produced by `ToolAvailabilityRuntime`. A "source" id here is a catalog
* group id; the historical field names remain stable for telemetry readers.
*/
export interface ToolAvailabilityDiagnostic {
/**
* Always `'economy'`: a diagnostic is only produced when economy gates the
* tool surface. The full-surface case emits no diagnostic at all.
* `'search'` is the current provider-independent lazy-loading policy.
* `'economy'` remains readable for historical telemetry.
*/
mode: 'economy';
mode: 'economy' | 'search';
enabledSourceIds: ToolSourceId[];
availableSourceIds?: ToolSourceId[];
connectorToolName?: string;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -825,7 +825,7 @@ describe('Host Client Capability coordinator', () => {
await coordinator.close();
});

test('keeps load_tools group identity provider-independent and contract-sensitive', async () => {
test('keeps tool-search source identity provider-independent and contract-sensitive', async () => {
const coordinator = createCoordinator();
const first = coordinator.attachConnection(clientCapabilityConnectionIdentity('connection-a'), {
send: async () => {},
Expand Down
46 changes: 21 additions & 25 deletions packages/runtime-host/src/__tests__/client-capability-uds.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';
import { LOAD_TOOLS_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { TOOL_SEARCH_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { type MakaTool } from '@maka/runtime/tool-runtime';
import { mcpProxyToolName } from '@maka/runtime/mcp-tools';
import { resolveStorageRoot, tryAcquireInteractiveRootOwner } from '@maka/storage/root-authority';
Expand DownExpand Up@@ -133,7 +133,7 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
affinity: 'session',
hostPathAccess: 'cwd',
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
description: 'Schedule a calendar meeting through the fixture provider.',
tools: [
{
serverId: 'fixture_unknown',
Expand DownExpand Up@@ -203,37 +203,33 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
abortSignal: new AbortController().signal,
emitOutput: () => undefined,
};
const activeTools = new Map<string, MakaTool>();
const availability = new ToolAvailabilityRuntime(
snapshot.tools,
{ economy: true, groups: snapshot.groups },
{ groups: snapshot.groups },
invalidTool(),
).prepare([]);
assert.deepEqual(availability.activeTools, [LOAD_TOOLS_NAME]);
const loadTools = availability.providerTools.find(
(candidate) => candidate.name === LOAD_TOOLS_NAME,
).prepare(activeTools);
assert.deepEqual(availability.activeTools, [TOOL_SEARCH_NAME]);
const toolSearch = availability.providerTools.find(
(candidate) => candidate.name === TOOL_SEARCH_NAME,
);
assert.ok(toolSearch);
const searched = await toolSearch.impl(
{ query: 'schedule calendar meeting', limit: 20 },
toolContext,
);
assert.ok(loadTools);
const loaded = await loadTools.impl({ group: group.id }, toolContext);
const capabilityToolNames = [tool.name, rejectedTool.name].sort((left, right) =>
left.localeCompare(right),
);
assert.deepEqual(loaded, {
loaded: capabilityToolNames,
group: {
id: group.id,
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
},
});
assert.deepEqual(
availability.projectActiveTools?.({
completedSteps: [
{
toolCalls: [{ toolName: LOAD_TOOLS_NAME, input: { group: group.id } }],
},
],
}).activeTools,
[LOAD_TOOLS_NAME, ...capabilityToolNames],
[...(searched as { activated: string[] }).activated].sort((left, right) =>
left.localeCompare(right),
),
capabilityToolNames,
);
assert.deepEqual(
availability.projectActiveTools?.().activeTools,
[TOOL_SEARCH_NAME, ...capabilityToolNames].sort((left, right) => left.localeCompare(right)),
);

const result = await tool.impl({ prefix: 'from-uds' }, toolContext);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -644,7 +644,7 @@ test('production backend creation continues after a Session Client Capability is
}
});

test('production backend preserves coordinator Client Capability semantics across load_tools and T1', async () => {
test('production backend preserves coordinator Client Capability semantics across tool_search and T1', async () => {
const sessionId = 'backend-creation-session';
const turnId = 'client-capability-turn';
const runId = 'client-capability-run';
Expand DownExpand Up@@ -814,9 +814,9 @@ test('production backend preserves coordinator Client Capability semantics acros
.filter((request) => request.body.stream === true)
.map((request) => toolNames(request.body));
assert.equal(providerToolSets.length, 3);
assert.ok(providerToolSets[0]?.includes('load_tools'));
assert.ok(providerToolSets[0]?.includes('tool_search'));
assert.equal(providerToolSets[0]?.includes(tool.name), false);
assert.ok(providerToolSets[1]?.includes('load_tools'));
assert.ok(providerToolSets[1]?.includes('tool_search'));
assert.ok(providerToolSets[1]?.includes(tool.name));
assert.ok(providerToolSets[2]?.includes(tool.name));
} finally {
Expand DownExpand Up@@ -1218,14 +1218,14 @@ test('production Host executes a canonical ai-sdk Session against a real provide
'WebFetch',
'Write',
'WriteStdin',
'load_tools',
'memory_extract',
'memory_remember',
'request_sandbox_boundary',
'task_create',
'task_get',
'task_list',
'task_update',
'tool_search',
]);
assert.match(JSON.stringify(compactRequests[0]?.body), /context summarization assistant/);

Expand DownExpand Up@@ -1641,7 +1641,7 @@ test('production Host executes a durable runnable child with an exact tool ceili

const requests = provider.requests.filter((request) => request.body.stream === true);
assert.equal(requests.length, 4);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
// The same routed child surface removes web_research when Tavily cannot run.
Expand DownExpand Up@@ -1842,7 +1842,7 @@ test('production Host publishes and retires an implementation child patch', asyn
requests.length <= MAX_IMPLEMENTATION_CHILD_REQUESTS + 3,
JSON.stringify(providerRequestTrace(requests)),
);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
assert.deepEqual(toolParameterEnum(requests[1]?.body, 'agent_spawn', 'profile'), [
Expand DownExpand Up@@ -3706,9 +3706,11 @@ async function handleProviderRequest(
(flow.kind === 'child_agent' || flow.kind === 'implementation_child_agent') &&
streamRequestIndex === 1
) {
assert.ok(toolNames(body).includes('load_tools'));
assert.ok(toolNames(body).includes('tool_search'));
assert.equal(toolNames(body).includes('agent_spawn'), false);
respondProviderToolCall(response, streamRequestIndex, 'load_tools', { group: 'agent' });
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: 'agent_spawn',
});
return;
}
if (
Expand DownExpand Up@@ -3811,9 +3813,9 @@ async function handleProviderRequest(
return;
}
if (flow.kind === 'client_capability' && streamRequestIndex === 1) {
assert.ok(toolNames(body).includes('load_tools'));
respondProviderToolCall(response, streamRequestIndex, 'load_tools', {
group: flow.groupId,
assert.ok(toolNames(body).includes('tool_search'));
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: flow.toolName,
});
return;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/runtime-host/src/server/interactive-run-composer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,9 +186,6 @@ export function createInteractiveRunComposer(input: InteractiveRunComposerInput)
const productSurface = projectEffectiveProductToolSurface({
host: 'runtime-host',
tools: selectedTools,
policy: {
economy: hasToolCeiling ? false : !process.env.MAKA_DISABLE_DEFERRED_TOOLS,
},
});
// A bound tool list is an exact child/local activation ceiling. Dynamic
// capabilities must be included by the authority that constructs that list.
Expand DownExpand Up@@ -507,7 +504,6 @@ function mergeToolAvailability(
groupIds.add(group.id);
}
return {
economy: product.economy,
groups: [...(product.groups ?? []), ...clientGroups],
};
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@
"https-proxy-agent": "^9.1.0",
"image-dimensions": "^2.5.1",
"linkedom": "^0.18.13",
"minisearch": "7.2.0",
"node-pty": "^1.2.0-beta.15",
"qrcode": "^1.5.4",
"socks": "^2.8.9",
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -10211,6 +10211,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
2 changes: 1 addition & 1 deletion docs/computer-use-provider-evidence.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,7 +109,7 @@ The first qualifying run completed with:
- terminal status: `complete / end_turn`;
- fixture oracle: verification code matched and interaction count remained zero.

The direct E2E tool exposure is deliberate. The default deferred `load_tools`
The direct E2E tool exposure is deliberate. The default deferred `tool_search`
path remains a separate product contract; the launcher narrows provider
variables while still exercising the production tool implementation, permission
engine, Runtime, Desktop host, and executor backend.
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/cli/THIRD_PARTY_NOTICES.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -5196,6 +5196,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: minisearch@7.2.0
Declared license: MIT
Selected license: MIT
Repository: https://github.com/lucaong/minisearch.git

--- LICENSE.txt ---
Copyright 2022 Luca Ongaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================================================

Package: ms@2.1.3
Declared license: MIT
Selected license: MIT
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/agent-run.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,7 @@ export const AGENT_RUN_EVENT_TYPES = [
'model_stream_failed',
'send_diagnostics_recorded',
'tool_started',
'tool_searched',
'tool_completed',
'tool_failed',
'skill_catalog_built',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-args-identity.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,7 +163,7 @@ function canonicalizeMainlineV1(value: unknown, parentKey?: string): unknown {
* The cost of not doing this was total. The refused write marked the runtime
* event store unavailable, the turn's terminal write then threw, and every turn
* that called any tool died a tenth of a second after the tool returned —
* `load_tools` succeeded, reported the group loaded, and the turn ended there.
* `tool_search` succeeded, reported activated tools, and the turn ended there.
*
* Dropping the key is lossless in the only sense that matters: JSON cannot tell
* an absent property from one set to `undefined`, so this writes down what
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/tool-catalog.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
* Shared product tool vocabulary (#1099).
*
* Tool is the catalog atom. Surface is optional and only for jointly governed
* packs (deferred `load_tools` groups and/or a shared host product boundary).
* searchable groups and/or a shared host product boundary.
* Hosts own implementations; this module owns names and metadata. Derive
* HostCapabilities / ToolAvailability groups from catalog ∩ host binding.
*
Expand DownExpand Up@@ -53,8 +53,6 @@ export interface CatalogSurfaceDef {
readonly id: string;
readonly label: string;
readonly description: string;
/** v1 packs are deferred load groups only. */
readonly economy: 'deferred';
readonly toolNames: readonly string[];
readonly hosts: Readonly<Record<ToolHostId, ToolHostSupport>>;
}
Expand DownExpand Up@@ -88,7 +86,6 @@ function freezeSurface(surface: CatalogSurfaceDef): CatalogSurfaceDef {
id: surface.id,
label: surface.label,
description: surface.description,
economy: surface.economy,
toolNames: Object.freeze([...surface.toolNames]),
hosts: Object.freeze({ ...surface.hosts }),
});
Expand DownExpand Up@@ -157,7 +154,7 @@ export const MAKA_CATALOG_TOOLS: readonly CatalogToolDef[] = Object.freeze(
);

/**
* Jointly governed deferred packs. Id `agent` matches the runtime
* Jointly governed searchable packs. Id `agent` matches the runtime
* ToolAvailability group id (AGENT_TOOL_GROUP_ID), not a separate "subagent" id.
* Each surface gets its own hosts object so affinity cannot cross-contaminate.
*/
Expand All@@ -168,15 +165,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
label: 'Rive',
description:
'Durable multi-agent Rive workflows: validate/import/run/status, scheduler, retries.',
economy: 'deferred' as const,
toolNames: ['RiveWorkflow'],
hosts: desktopOnlyHosts(),
},
{
id: 'browser',
label: 'Browser',
description: 'Drive the embedded browser: navigate, snapshot, click, type, wait, extract.',
economy: 'deferred' as const,
toolNames: [
'browser_navigate',
'browser_snapshot',
Expand All@@ -191,15 +186,13 @@ export const MAKA_CATALOG_SURFACES: readonly CatalogSurfaceDef[] = Object.freeze
id: 'computer_use',
label: 'Computer',
description: 'Observe and operate an explicitly approved local application.',
economy: 'deferred' as const,
toolNames: ['maka_computer'],
hosts: desktopOnlyHosts(),
},
{
id: 'agent',
label: 'Agent',
description: 'Spawn, fan out, and inspect foreground child agents.',
economy: 'deferred' as const,
toolNames: [
'agent_spawn',
'agent_list',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tool-quiet-preview.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -323,7 +323,7 @@ export function formatQuietJsonValue(value: unknown, locale: UiLocale = 'zh'): Q
return { body: redactSecrets(String(value)) };
}

// Known list payloads (Grep/Glob/load_tools/…).
// Known list payloads (Grep/Glob/tool_search/…).
for (const key of LIST_KEYS) {
if (!Array.isArray(record[key])) continue;
const consumed = new Set<string>([key]);
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/usage-stats/types.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,16 +205,15 @@ export type ToolSchemaChangeReason =

/**
* Diagnostic shell describing the provider-visible (active) tool subset for a
* turn, produced by the unified `ToolAvailabilityRuntime`. A "source" id here is
* a catalog *group* id — the shell retains the historical `*SourceIds` field
* names while the config-side vocabulary is `groups`.
* turn, produced by `ToolAvailabilityRuntime`. A "source" id here is a catalog
* group id; the historical field names remain stable for telemetry readers.
*/
export interface ToolAvailabilityDiagnostic {
/**
* Always `'economy'`: a diagnostic is only produced when economy gates the
* tool surface. The full-surface case emits no diagnostic at all.
* `'search'` is the current provider-independent lazy-loading policy.
* `'economy'` remains readable for historical telemetry.
*/
mode: 'economy';
mode: 'economy' | 'search';
enabledSourceIds: ToolSourceId[];
availableSourceIds?: ToolSourceId[];
connectorToolName?: string;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -825,7 +825,7 @@ describe('Host Client Capability coordinator', () => {
await coordinator.close();
});

test('keeps load_tools group identity provider-independent and contract-sensitive', async () => {
test('keeps tool-search source identity provider-independent and contract-sensitive', async () => {
const coordinator = createCoordinator();
const first = coordinator.attachConnection(clientCapabilityConnectionIdentity('connection-a'), {
send: async () => {},
Expand Down
46 changes: 21 additions & 25 deletions packages/runtime-host/src/__tests__/client-capability-uds.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';
import { LOAD_TOOLS_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { TOOL_SEARCH_NAME, ToolAvailabilityRuntime } from '@maka/runtime/tool-availability';
import { type MakaTool } from '@maka/runtime/tool-runtime';
import { mcpProxyToolName } from '@maka/runtime/mcp-tools';
import { resolveStorageRoot, tryAcquireInteractiveRootOwner } from '@maka/storage/root-authority';
Expand DownExpand Up@@ -133,7 +133,7 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
affinity: 'session',
hostPathAccess: 'cwd',
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
description: 'Schedule a calendar meeting through the fixture provider.',
tools: [
{
serverId: 'fixture_unknown',
Expand DownExpand Up@@ -203,37 +203,33 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
abortSignal: new AbortController().signal,
emitOutput: () => undefined,
};
const activeTools = new Map<string, MakaTool>();
const availability = new ToolAvailabilityRuntime(
snapshot.tools,
{ economy: true, groups: snapshot.groups },
{ groups: snapshot.groups },
invalidTool(),
).prepare([]);
assert.deepEqual(availability.activeTools, [LOAD_TOOLS_NAME]);
const loadTools = availability.providerTools.find(
(candidate) => candidate.name === LOAD_TOOLS_NAME,
).prepare(activeTools);
assert.deepEqual(availability.activeTools, [TOOL_SEARCH_NAME]);
const toolSearch = availability.providerTools.find(
(candidate) => candidate.name === TOOL_SEARCH_NAME,
);
assert.ok(toolSearch);
const searched = await toolSearch.impl(
{ query: 'schedule calendar meeting', limit: 20 },
toolContext,
);
assert.ok(loadTools);
const loaded = await loadTools.impl({ group: group.id }, toolContext);
const capabilityToolNames = [tool.name, rejectedTool.name].sort((left, right) =>
left.localeCompare(right),
);
assert.deepEqual(loaded, {
loaded: capabilityToolNames,
group: {
id: group.id,
label: 'Unknown fixture',
description: 'A capability the Host source does not enumerate.',
},
});
assert.deepEqual(
availability.projectActiveTools?.({
completedSteps: [
{
toolCalls: [{ toolName: LOAD_TOOLS_NAME, input: { group: group.id } }],
},
],
}).activeTools,
[LOAD_TOOLS_NAME, ...capabilityToolNames],
[...(searched as { activated: string[] }).activated].sort((left, right) =>
left.localeCompare(right),
),
capabilityToolNames,
);
assert.deepEqual(
availability.projectActiveTools?.().activeTools,
[TOOL_SEARCH_NAME, ...capabilityToolNames].sort((left, right) => left.localeCompare(right)),
);

const result = await tool.impl({ prefix: 'from-uds' }, toolContext);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -644,7 +644,7 @@ test('production backend creation continues after a Session Client Capability is
}
});

test('production backend preserves coordinator Client Capability semantics across load_tools and T1', async () => {
test('production backend preserves coordinator Client Capability semantics across tool_search and T1', async () => {
const sessionId = 'backend-creation-session';
const turnId = 'client-capability-turn';
const runId = 'client-capability-run';
Expand DownExpand Up@@ -814,9 +814,9 @@ test('production backend preserves coordinator Client Capability semantics acros
.filter((request) => request.body.stream === true)
.map((request) => toolNames(request.body));
assert.equal(providerToolSets.length, 3);
assert.ok(providerToolSets[0]?.includes('load_tools'));
assert.ok(providerToolSets[0]?.includes('tool_search'));
assert.equal(providerToolSets[0]?.includes(tool.name), false);
assert.ok(providerToolSets[1]?.includes('load_tools'));
assert.ok(providerToolSets[1]?.includes('tool_search'));
assert.ok(providerToolSets[1]?.includes(tool.name));
assert.ok(providerToolSets[2]?.includes(tool.name));
} finally {
Expand DownExpand Up@@ -1218,14 +1218,14 @@ test('production Host executes a canonical ai-sdk Session against a real provide
'WebFetch',
'Write',
'WriteStdin',
'load_tools',
'memory_extract',
'memory_remember',
'request_sandbox_boundary',
'task_create',
'task_get',
'task_list',
'task_update',
'tool_search',
]);
assert.match(JSON.stringify(compactRequests[0]?.body), /context summarization assistant/);

Expand DownExpand Up@@ -1641,7 +1641,7 @@ test('production Host executes a durable runnable child with an exact tool ceili

const requests = provider.requests.filter((request) => request.body.stream === true);
assert.equal(requests.length, 4);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
// The same routed child surface removes web_research when Tavily cannot run.
Expand DownExpand Up@@ -1842,7 +1842,7 @@ test('production Host publishes and retires an implementation child patch', asyn
requests.length <= MAX_IMPLEMENTATION_CHILD_REQUESTS + 3,
JSON.stringify(providerRequestTrace(requests)),
);
assert.ok(toolNames(requests[0]?.body).includes('load_tools'));
assert.ok(toolNames(requests[0]?.body).includes('tool_search'));
assert.equal(toolNames(requests[0]?.body).includes('agent_spawn'), false);
assert.ok(toolNames(requests[1]?.body).includes('agent_spawn'));
assert.deepEqual(toolParameterEnum(requests[1]?.body, 'agent_spawn', 'profile'), [
Expand DownExpand Up@@ -3706,9 +3706,11 @@ async function handleProviderRequest(
(flow.kind === 'child_agent' || flow.kind === 'implementation_child_agent') &&
streamRequestIndex === 1
) {
assert.ok(toolNames(body).includes('load_tools'));
assert.ok(toolNames(body).includes('tool_search'));
assert.equal(toolNames(body).includes('agent_spawn'), false);
respondProviderToolCall(response, streamRequestIndex, 'load_tools', { group: 'agent' });
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: 'agent_spawn',
});
return;
}
if (
Expand DownExpand Up@@ -3811,9 +3813,9 @@ async function handleProviderRequest(
return;
}
if (flow.kind === 'client_capability' && streamRequestIndex === 1) {
assert.ok(toolNames(body).includes('load_tools'));
respondProviderToolCall(response, streamRequestIndex, 'load_tools', {
group: flow.groupId,
assert.ok(toolNames(body).includes('tool_search'));
respondProviderToolCall(response, streamRequestIndex, 'tool_search', {
query: flow.toolName,
});
return;
}
Expand Down
4 changes: 0 additions & 4 deletions packages/runtime-host/src/server/interactive-run-composer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -186,9 +186,6 @@ export function createInteractiveRunComposer(input: InteractiveRunComposerInput)
const productSurface = projectEffectiveProductToolSurface({
host: 'runtime-host',
tools: selectedTools,
policy: {
economy: hasToolCeiling ? false : !process.env.MAKA_DISABLE_DEFERRED_TOOLS,
},
});
// A bound tool list is an exact child/local activation ceiling. Dynamic
// capabilities must be included by the authority that constructs that list.
Expand DownExpand Up@@ -507,7 +504,6 @@ function mergeToolAvailability(
groupIds.add(group.id);
}
return {
economy: product.economy,
groups: [...(product.groups ?? []), ...clientGroups],
};
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@
"https-proxy-agent": "^9.1.0",
"image-dimensions": "^2.5.1",
"linkedom": "^0.18.13",
"minisearch": "7.2.0",
"node-pty": "^1.2.0-beta.15",
"qrcode": "^1.5.4",
"socks": "^2.8.9",
Expand Down
Loading