@aiwg/cli 2026.10.16 → 2026.10.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agentic/code/providers/capability-matrix.yaml +51 -0
- package/agentic/code/providers/flue/README.md +62 -0
- package/agentic/code/providers/flue/templates/aiwg/tools.ts +120 -0
- package/agentic/code/providers/model-capabilities.v1.json +23 -0
- package/agentic/code/providers/model-catalog.v1.json +9 -0
- package/dist/src/artifacts/corpus-tools/resolve.js +28 -6
- package/dist/src/artifacts/query-engine-corpus.js +217 -0
- package/dist/src/artifacts/query-engine-discover-output.js +229 -0
- package/dist/src/artifacts/query-engine-discover.js +285 -0
- package/dist/src/artifacts/query-engine-entries.js +188 -0
- package/dist/src/artifacts/query-engine-index.js +249 -0
- package/dist/src/artifacts/query-engine-matching.js +143 -0
- package/dist/src/artifacts/query-engine-options.js +2 -0
- package/dist/src/artifacts/query-engine-rules.js +202 -0
- package/dist/src/artifacts/query-engine-scoring.js +436 -0
- package/dist/src/artifacts/query-engine-show-card.js +194 -0
- package/dist/src/artifacts/query-engine-show-load.js +211 -0
- package/dist/src/artifacts/query-engine-show.js +300 -0
- package/dist/src/artifacts/query-engine.js +7 -2576
- package/dist/src/cli/handlers/help.js +1 -1
- package/dist/src/cli/handlers/init.js +1 -0
- package/dist/src/cli/handlers/mc-agents.js +111 -0
- package/dist/src/cli/handlers/mc-args.js +54 -0
- package/dist/src/cli/handlers/mc-control.js +227 -0
- package/dist/src/cli/handlers/mc-dispatch.js +203 -0
- package/dist/src/cli/handlers/mc-help.js +171 -0
- package/dist/src/cli/handlers/mc-run.js +343 -0
- package/dist/src/cli/handlers/mc-session.js +138 -0
- package/dist/src/cli/handlers/mc-status.js +258 -0
- package/dist/src/cli/handlers/mc-summary.js +43 -0
- package/dist/src/cli/handlers/mc-types.js +3 -0
- package/dist/src/cli/handlers/mc-worker.js +205 -0
- package/dist/src/cli/handlers/mc.js +12 -1665
- package/dist/src/cli/handlers/models-refusal.js +13 -0
- package/dist/src/cli/handlers/models.js +2 -1
- package/dist/src/cli/handlers/remove-bundled.js +133 -0
- package/dist/src/cli/handlers/remove-options.js +31 -0
- package/dist/src/cli/handlers/remove-user.js +174 -0
- package/dist/src/cli/handlers/remove.js +201 -0
- package/dist/src/cli/handlers/subcommands-bundles.js +257 -0
- package/dist/src/cli/handlers/subcommands-discovery.js +165 -0
- package/dist/src/cli/handlers/subcommands-list-format.js +129 -0
- package/dist/src/cli/handlers/subcommands-list.js +250 -0
- package/dist/src/cli/handlers/subcommands-plugins.js +213 -0
- package/dist/src/cli/handlers/subcommands-quickref.js +58 -0
- package/dist/src/cli/handlers/subcommands-rlm.js +113 -0
- package/dist/src/cli/handlers/subcommands-services.js +66 -0
- package/dist/src/cli/handlers/subcommands-storage.js +259 -0
- package/dist/src/cli/handlers/subcommands.js +18 -1984
- package/dist/src/cli/handlers/use.js +11 -5
- package/dist/src/cli/scope-resolver.js +1 -142
- package/dist/src/cli/services/deployment-verification.js +3 -0
- package/dist/src/cli/user-scope-mirror.js +173 -0
- package/dist/src/config/dispatch-host-thresholds.js +2 -0
- package/dist/src/config/dispatch-thresholds-runtime.mjs +4 -0
- package/dist/src/config/host-resource-report.d.mts +5 -0
- package/dist/src/config/host-resource-report.mjs +36 -6
- package/dist/src/config/host-resource-runtime.d.mts +3 -0
- package/dist/src/config/host-resource-runtime.mjs +9 -6
- package/dist/src/decision/ensemble-study/artifacts.js +7 -0
- package/dist/src/decision/ensemble-study/gate-policy.js +58 -0
- package/dist/src/decision/ensemble-study/gates.js +78 -0
- package/dist/src/decision/ensemble-study/protocol.js +18 -21
- package/dist/src/decision/ensemble-study/score.js +3 -2
- package/dist/src/decision/ensemble-study/statistics.js +7 -26
- package/dist/src/decision/sensitivity/comparative-gates.js +135 -0
- package/dist/src/decision/sensitivity/comparative.js +18 -41
- package/dist/src/extensions/claude-hooks-installer.js +18 -0
- package/dist/src/gates/evaluate.js +2 -358
- package/dist/src/gates/observations.js +363 -0
- package/dist/src/gates/pack-composition.js +270 -0
- package/dist/src/gates/pack-tightening.js +197 -0
- package/dist/src/gates/pack-validation.js +262 -0
- package/dist/src/gates/registry-error.js +5 -0
- package/dist/src/gates/registry.js +13 -685
- package/dist/src/mcp/json-document.mjs +29 -0
- package/dist/src/mcp/muse-native-config.mjs +1 -28
- package/dist/src/memory/provider-memory-adapter.js +1 -0
- package/dist/src/mission-protocol/worker-review-gate.js +7 -0
- package/dist/src/models/model-capabilities.v1.json +23 -0
- package/dist/src/models/model-catalog.v1.json +9 -0
- package/dist/src/models/policy-resources.js +1 -1
- package/dist/src/models/worker-plan.js +5 -5
- package/dist/src/plugin/command-ownership.js +34 -0
- package/dist/src/plugin/skill-command-frontmatter.js +197 -0
- package/dist/src/plugin/skill-command-translator.js +6 -232
- package/dist/src/providers/capability-matrix.yaml +51 -0
- package/dist/src/providers/context-output-ownership.js +26 -0
- package/dist/src/providers/deployment-ownership.d.mts +20 -0
- package/dist/src/providers/deployment-ownership.mjs +236 -0
- package/dist/src/providers/deployment-removal.js +222 -0
- package/dist/src/providers/provider-context-contracts.js +8 -0
- package/dist/src/providers/provider-definition-schema.js +1 -0
- package/dist/src/providers/provider-definitions.js +1 -0
- package/dist/src/providers/provider-seeds-3.js +18 -0
- package/dist/src/providers/removal-transaction.js +86 -0
- package/dist/src/providers/settings-document.d.mts +3 -0
- package/dist/src/providers/settings-document.mjs +47 -0
- package/dist/src/providers/settings-removal.js +190 -0
- package/dist/src/providers/skill-ownership.d.mts +20 -2
- package/dist/src/providers/skill-ownership.mjs +12 -4
- package/dist/src/providers/transformation-receipt-integration.js +15 -271
- package/dist/src/providers/transformation-receipt-outputs.js +99 -0
- package/dist/src/providers/transformation-receipt-source.js +194 -0
- package/dist/src/research/identity.js +8 -2
- package/dist/src/research/reference-match.js +66 -8
- package/dist/src/rules/activation.mjs +15 -6
- package/dist/src/rules/core-startup.mjs +2 -2
- package/dist/src/serve/mission-conductor.js +4 -0
- package/dist/src/serve/mission-summary.js +56 -0
- package/dist/src/skills/deployment-ownership.js +2 -2
- package/dist/src/skills/deployment-policy.js +9 -0
- package/dist/src/smiths/context-pipeline/aiwg-md.js +23 -0
- package/dist/src/smiths/context-pipeline/context-file-safety.js +3 -0
- package/dist/src/smiths/context-pipeline/flue-context.js +25 -0
- package/dist/src/smiths/context-pipeline/generator.js +7 -2
- package/dist/src/smiths/context-pipeline/workspace-bootstrap.js +9 -7
- package/dist/src/smiths/hook-bridge/index.js +9 -0
- package/package.json +5 -1
- package/schemas/decision/D17StudyProtocol.v1.schema.json +39 -67
- package/tools/agents/deploy-agents.mjs +21 -680
- package/tools/agents/deploy-command-mirrors.mjs +229 -0
- package/tools/agents/deploy-options.mjs +267 -0
- package/tools/agents/deploy-support.mjs +165 -0
- package/tools/agents/providers/base-addon-discovery.mjs +139 -0
- package/tools/agents/providers/base-behaviors.mjs +168 -0
- package/tools/agents/providers/base-context.mjs +205 -0
- package/tools/agents/providers/base-contract.mjs +116 -0
- package/tools/agents/providers/base-files.mjs +252 -0
- package/tools/agents/providers/base-flat-artifacts.mjs +233 -0
- package/tools/agents/providers/base-framework-discovery.mjs +309 -0
- package/tools/agents/providers/base-frontmatter.mjs +196 -0
- package/tools/agents/providers/base-inventory.mjs +269 -0
- package/tools/agents/providers/base-kernel-skills.mjs +354 -0
- package/tools/agents/providers/base-migrations.mjs +258 -0
- package/tools/agents/providers/base-models-platforms.mjs +273 -0
- package/tools/agents/providers/base-rule-index.mjs +450 -0
- package/tools/agents/providers/base-runtime.mjs +60 -0
- package/tools/agents/providers/base-skill-copy.mjs +273 -0
- package/tools/agents/providers/base.mjs +16 -3364
- package/tools/agents/providers/claude-post-deploy.mjs +10 -2
- package/tools/agents/providers/flue-project.mjs +79 -0
- package/tools/agents/providers/flue-specialists.mjs +64 -0
- package/tools/agents/providers/flue.mjs +50 -0
- package/tools/agents/providers/hermes-startup.mjs +0 -5
- package/tools/agents/providers/muse.mjs +7 -2
- package/tools/agents/providers/rule-delivery-surface.mjs +33 -5
- package/tools/agents/providers/rule-deployment-commit.mjs +19 -15
- package/tools/agents/providers/rule-deployment-prepare.mjs +13 -3
- package/tools/agents/providers/rule-projection.mjs +3 -0
- package/tools/agents/providers/rule-startup.mjs +3 -3
- package/tools/agents/use-rule-selection.mjs +17 -0
- package/tools/ralph-external/lib/worker-invocation-processes.mjs +4 -2
- package/tools/ralph-external/lib/worker-termination.mjs +15 -8
- package/vscode-extension/schemas/aiwg.config.v1.json +2 -4
|
@@ -934,6 +934,57 @@ providers:
|
|
|
934
934
|
deploy_target: project
|
|
935
935
|
aggregated_output: false
|
|
936
936
|
|
|
937
|
+
flue:
|
|
938
|
+
display_name: Flue (experimental)
|
|
939
|
+
status: experimental
|
|
940
|
+
route_feasibility:
|
|
941
|
+
scope: out
|
|
942
|
+
identity: unavailable
|
|
943
|
+
evidence: R
|
|
944
|
+
channel: "none - Flue 2.3.0 app target; no worker dispatch (#3120 D6)"
|
|
945
|
+
coverage:
|
|
946
|
+
profile_issue: null
|
|
947
|
+
source_date: "2026-10-30"
|
|
948
|
+
live_qualified: false
|
|
949
|
+
exclusion_gap: "Flue run accepts prompts in argv and lacks worker model/effort flags; app deployment only."
|
|
950
|
+
recheck: "Rechecked 2026-10-30 against installed Flue 2.3.0 source; #3120 D6 excludes worker dispatch."
|
|
951
|
+
sources:
|
|
952
|
+
- "tools/agents/providers/flue.mjs"
|
|
953
|
+
- "docs/providers/flue.md"
|
|
954
|
+
- "https://flueframework.com/docs/"
|
|
955
|
+
fanout: unknown
|
|
956
|
+
probe_budget: { status: proposed, calls: 0, tokens: 0 }
|
|
957
|
+
daemon_tier: unsupported
|
|
958
|
+
daemon_pty_adapter: false
|
|
959
|
+
artifact_paths:
|
|
960
|
+
agents: ""
|
|
961
|
+
commands: ""
|
|
962
|
+
skills: .agents/skills/
|
|
963
|
+
rules: AGENTS.md
|
|
964
|
+
behaviors: null
|
|
965
|
+
native_features:
|
|
966
|
+
cron: false
|
|
967
|
+
agent_teams: false
|
|
968
|
+
tasks: false
|
|
969
|
+
mcp: false
|
|
970
|
+
behaviors: false
|
|
971
|
+
mission_control: false
|
|
972
|
+
daemon: false
|
|
973
|
+
emulation:
|
|
974
|
+
cron: null
|
|
975
|
+
agent_teams: null
|
|
976
|
+
tasks: null
|
|
977
|
+
mcp: null
|
|
978
|
+
behaviors: null
|
|
979
|
+
mission_control: null
|
|
980
|
+
daemon: null
|
|
981
|
+
hook_wiring:
|
|
982
|
+
at_link_support: false
|
|
983
|
+
fallback: full-inject
|
|
984
|
+
context_file: AGENTS.md
|
|
985
|
+
deploy_target: project
|
|
986
|
+
aggregated_output: false
|
|
987
|
+
|
|
937
988
|
pi:
|
|
938
989
|
display_name: Pi Coding Agent
|
|
939
990
|
route_feasibility:
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Flue tools (2.3.0)
|
|
2
|
+
|
|
3
|
+
The provider deploy can copy `templates/aiwg/tools.ts` to the app's `src/aiwg/tools.ts`; `AIWG_TOOL_NAMES` lists its three tools for deployment consumers (#3121).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { useTool } from '@flue/runtime';
|
|
7
|
+
import { aiwg_discover, aiwg_show, aiwg_artifact_write } from './aiwg/tools';
|
|
8
|
+
|
|
9
|
+
// Inside the app's agent or specialist function:
|
|
10
|
+
useTool(aiwg_discover);
|
|
11
|
+
useTool(aiwg_show);
|
|
12
|
+
useTool(aiwg_artifact_write);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The default tools run the installed `aiwg mcp serve` in the app's launch directory.
|
|
16
|
+
For another trusted project or executable, call `createAiwgTools({ cwd, command, args, env })`
|
|
17
|
+
at app setup and mount the returned tools. Configuration belongs to the app,
|
|
18
|
+
never to model tool inputs. The app needs AIWG installed on PATH, Node 24+, and
|
|
19
|
+
the tested Flue 2.3.0 graph: Valibot, `@modelcontextprotocol/client` 2.0.0 and
|
|
20
|
+
its `/stdio` export. These are already present in the pinned lab graph; AIWG
|
|
21
|
+
does not install dependencies or provide model credentials.
|
|
22
|
+
|
|
23
|
+
Each call owns a stdio child and closes it on success or failure. Initialization
|
|
24
|
+
has a 10-second deadline and observes cancellation; transport cleanup can take
|
|
25
|
+
up to 4 more seconds to terminate a silent child. The child
|
|
26
|
+
inherits the SDK's safe process settings plus AIWG root/path settings; optional
|
|
27
|
+
subsystem toolsets are disabled. No HTTP listener, gateway, `local()` sandbox,
|
|
28
|
+
approval bridge or model invocation is involved. Artifact writes go through
|
|
29
|
+
AIWG's `artifact-write`; the server resolves the project's configured artifact
|
|
30
|
+
root, pins it and enforces containment. The caller cannot set `project_dir`.
|
|
31
|
+
This scope applies to these tools; other app code retains its own host access.
|
|
32
|
+
|
|
33
|
+
`aiwg_show` supports the four MCP card tools: skill, agent, command and rule.
|
|
34
|
+
It always fetches governing rule summaries and bodies, and maps an optional
|
|
35
|
+
single heading to MCP's section array. Discovery retains all eight MCP asset
|
|
36
|
+
types. Its `query` maps to `discover.phrase`; the MCP default limit remains in
|
|
37
|
+
effect. Schema parity compares those public projections with live `tools/list`
|
|
38
|
+
schemas; fixed arguments and the omitted project selector remain server-owned.
|
|
39
|
+
|
|
40
|
+
Transport decision (#3123/#3124): the SDK stdio client works. Flue's documented
|
|
41
|
+
trusted-code route (`@flue/runtime/dist/mcp-CYraeuuF.mjs:45-48,114-125`,
|
|
42
|
+
re-exported by `index.mjs:10`) calls `new URL` and constructs its own HTTP/SSE transport.
|
|
43
|
+
The spike supplies both stdio and a custom transport with a throwing fetch;
|
|
44
|
+
both reach the HTTP fetch instead of a custom transport. The SDK connects to
|
|
45
|
+
the existing `src/mcp/server.mjs` over stdio and directly calls all three tools.
|
|
46
|
+
SDK evidence: `@modelcontextprotocol/client/package.json` exports `./stdio`;
|
|
47
|
+
`dist/stdio.mjs:48-81` spawns the child with stdin/stdout pipes. No gateway is
|
|
48
|
+
needed. Sources are the installed Flue 2.3.0 lab, checked in a temporary copy.
|
|
49
|
+
|
|
50
|
+
Run the reproducible smoke without reading lab environment files or state:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
TMPDIR=/var/tmp node tools/testing/flue-lab-smoke.mjs --lab /path/to/flue-lab
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
It copies only the lab's package manifests and installed dependencies into
|
|
57
|
+
`os.tmpdir()` and deletes the copy afterward. It loads the actual TypeScript
|
|
58
|
+
template in Node, checks actual Valibot/MCP parity, and calls the tool functions
|
|
59
|
+
against a synthetic discovery CLI and the real AIWG MCP artifact server.
|
|
60
|
+
The default unit lane uses small Flue/Valibot builder doubles and the repository's
|
|
61
|
+
SDK 1.x client shim, keeping optional app dependencies out of AIWG itself;
|
|
62
|
+
the lab smoke verifies the full real Flue/Valibot/SDK 2.x boundary.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// App-owned Flue tools backed by AIWG's contained MCP operations.
|
|
2
|
+
import { defineTool } from '@flue/runtime';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
import { Client } from '@modelcontextprotocol/client';
|
|
5
|
+
import { StdioClientTransport, getDefaultEnvironment } from '@modelcontextprotocol/client/stdio';
|
|
6
|
+
|
|
7
|
+
/* Transport spike: Flue 2.3.0's documented trusted-code escape hatch
|
|
8
|
+
* (@flue/runtime/dist/mcp-CYraeuuF.mjs:45-48,114-125, re-exported by
|
|
9
|
+
* index.mjs:10) calls new URL(definition.url) and constructs HTTP/SSE internally.
|
|
10
|
+
* It accepts neither a custom transport nor stdio. SDK 2.0.0 Client plus
|
|
11
|
+
* StdioClientTransport works against src/mcp/server.mjs (SDK dist/stdio.mjs,
|
|
12
|
+
* package.json exports["./stdio"]). No listener, gateway, or model is needed.
|
|
13
|
+
* Each call owns and closes its child, including failures/cancellation.
|
|
14
|
+
* Verified with tools/testing/flue-lab-smoke.mjs against a read-only lab copy.
|
|
15
|
+
*
|
|
16
|
+
* MCP schemas remain authoritative: discovery.mjs discover.phrase -> query,
|
|
17
|
+
* discover.type -> type; *-show.name -> name, section.items -> section.
|
|
18
|
+
* Show fixes rules/with_rule_bodies=true. Artifact-write projects path/content,
|
|
19
|
+
* deliberately omitting project_dir so tool data cannot change project scope.
|
|
20
|
+
* test/unit/providers/flue-tools.test.ts compares these schema projections;
|
|
21
|
+
* the lab smoke also compares actual Valibot JSON Schema against tools/list.
|
|
22
|
+
*/
|
|
23
|
+
export const AIWG_TOOL_NAMES = Object.freeze([
|
|
24
|
+
'aiwg_discover', 'aiwg_show', 'aiwg_artifact_write',
|
|
25
|
+
] as const);
|
|
26
|
+
|
|
27
|
+
export interface AiwgToolOptions {
|
|
28
|
+
/** Trusted app configuration only; never populate these from tool inputs. */
|
|
29
|
+
command?: string;
|
|
30
|
+
args?: string[];
|
|
31
|
+
cwd?: string;
|
|
32
|
+
env?: Record<string, string>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Create an isolated set for an app/project; defaults use the installed aiwg. */
|
|
36
|
+
export function createAiwgTools(options: AiwgToolOptions = {}) {
|
|
37
|
+
const cwd = options.cwd ?? process.cwd();
|
|
38
|
+
// Inherit only SDK-safe process settings and AIWG path settings, not model keys.
|
|
39
|
+
const env = getDefaultEnvironment();
|
|
40
|
+
for (const key of ['AIWG_ROOT', 'AIWG_ARTIFACTS_PATH', 'AIWG_PROJECT_ARTIFACTS_PATH', 'AIWG_PROJECT_AIWG_DIR']) {
|
|
41
|
+
if (process.env[key]) env[key] = process.env[key];
|
|
42
|
+
}
|
|
43
|
+
Object.assign(env, options.env, { AIWG_MCP_TOOLSETS: '' });
|
|
44
|
+
|
|
45
|
+
async function call(name: string, args: Record<string, unknown>, signal?: AbortSignal) {
|
|
46
|
+
signal?.throwIfAborted();
|
|
47
|
+
// AIWG serves MCP 2025-11-25; avoid SDK 2's disposable newer-era probe child.
|
|
48
|
+
const client = new Client({ name: 'aiwg-flue', version: '1.0.0' }, {
|
|
49
|
+
versionNegotiation: { mode: 'legacy' },
|
|
50
|
+
});
|
|
51
|
+
const transport = new StdioClientTransport({
|
|
52
|
+
command: options.command ?? 'aiwg', args: options.args ?? ['mcp', 'serve'],
|
|
53
|
+
cwd, env, stderr: 'inherit',
|
|
54
|
+
});
|
|
55
|
+
try {
|
|
56
|
+
// Bound initialize to 10 seconds; transport.close also reaps a silent child
|
|
57
|
+
// on timeout/abort (SDK cleanup may take another 4 seconds to escalate).
|
|
58
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
59
|
+
let abortConnect = () => {};
|
|
60
|
+
try {
|
|
61
|
+
const interrupted = new Promise<never>((_, reject) => {
|
|
62
|
+
abortConnect = () => reject(signal?.reason ?? new Error('AIWG MCP connect aborted'));
|
|
63
|
+
signal?.addEventListener('abort', abortConnect, { once: true });
|
|
64
|
+
if (signal?.aborted) abortConnect();
|
|
65
|
+
timer = setTimeout(() => reject(new Error('AIWG MCP connect timed out after 10000 ms')), 10_000);
|
|
66
|
+
});
|
|
67
|
+
await Promise.race([client.connect(transport), interrupted]);
|
|
68
|
+
} finally {
|
|
69
|
+
clearTimeout(timer);
|
|
70
|
+
signal?.removeEventListener('abort', abortConnect);
|
|
71
|
+
}
|
|
72
|
+
signal?.throwIfAborted();
|
|
73
|
+
const result = await client.callTool({ name, arguments: args }, { signal, timeout: 180_000 });
|
|
74
|
+
const text = result.content.filter(item => item.type === 'text').map(item => item.text).join('\n');
|
|
75
|
+
const output = result.structuredContent === undefined ? text
|
|
76
|
+
: [text, JSON.stringify(result.structuredContent)].filter(Boolean).join('\n');
|
|
77
|
+
if (result.isError) throw new Error(output || `AIWG MCP tool ${name} failed`);
|
|
78
|
+
return { output };
|
|
79
|
+
} finally {
|
|
80
|
+
await transport.close();
|
|
81
|
+
await client.close();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const aiwg_discover = defineTool({
|
|
86
|
+
name: AIWG_TOOL_NAMES[0],
|
|
87
|
+
description: 'Find AIWG capabilities and their governing checks. Follow with aiwg_show.',
|
|
88
|
+
input: v.strictObject({
|
|
89
|
+
query: v.string(),
|
|
90
|
+
type: v.optional(v.picklist(['skill', 'agent', 'command', 'rule', 'flow', 'runbook', 'template', 'behavior'])),
|
|
91
|
+
}),
|
|
92
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
93
|
+
run: ({ data, signal }) => call('discover', {
|
|
94
|
+
phrase: data.query, ...(data.type === undefined ? {} : { type: data.type }),
|
|
95
|
+
}, signal),
|
|
96
|
+
});
|
|
97
|
+
const aiwg_show = defineTool({
|
|
98
|
+
name: AIWG_TOOL_NAMES[1],
|
|
99
|
+
description: 'Fetch an AIWG card plus governing rule bodies; optionally drill into one heading. Types: skill, agent, command, rule.',
|
|
100
|
+
input: v.strictObject({
|
|
101
|
+
type: v.picklist(['skill', 'agent', 'command', 'rule']),
|
|
102
|
+
name: v.string(), section: v.optional(v.string()),
|
|
103
|
+
}),
|
|
104
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
105
|
+
run: ({ data, signal }) => call(`${data.type}-show`, {
|
|
106
|
+
name: data.name, rules: true, with_rule_bodies: true,
|
|
107
|
+
...(data.section === undefined ? {} : { section: [data.section] }),
|
|
108
|
+
}, signal),
|
|
109
|
+
});
|
|
110
|
+
const aiwg_artifact_write = defineTool({
|
|
111
|
+
name: AIWG_TOOL_NAMES[2],
|
|
112
|
+
description: 'Write an artifact relative to this project’s configured artifact root. AIWG enforces containment.',
|
|
113
|
+
input: v.strictObject({ path: v.string(), content: v.string() }),
|
|
114
|
+
annotations: { readOnlyHint: false, openWorldHint: false },
|
|
115
|
+
run: ({ data, signal }) => call('artifact-write', { path: data.path, content: data.content }, signal),
|
|
116
|
+
});
|
|
117
|
+
return { aiwg_discover, aiwg_show, aiwg_artifact_write };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const { aiwg_discover, aiwg_show, aiwg_artifact_write } = createAiwgTools();
|
|
@@ -2533,6 +2533,29 @@
|
|
|
2533
2533
|
}
|
|
2534
2534
|
}
|
|
2535
2535
|
},
|
|
2536
|
+
"flue": {
|
|
2537
|
+
"sessionEnvAllowlist": [],
|
|
2538
|
+
"agent": "unsupported",
|
|
2539
|
+
"skill": "unsupported",
|
|
2540
|
+
"globalChild": "unsupported",
|
|
2541
|
+
"identifierSyntax": "App-owned Flue model configuration; no AIWG worker selector",
|
|
2542
|
+
"inheritance": "Application-owned; no worker dispatch",
|
|
2543
|
+
"invalidPinFallback": "Report unsupported",
|
|
2544
|
+
"configTarget": "Application-owned",
|
|
2545
|
+
"artifactFormat": "Kernel SKILL.md and composed AGENTS.md",
|
|
2546
|
+
"verification": "Flue 2.3.0 installed source; app deployment only (#3120 D6)",
|
|
2547
|
+
"sourceUrl": "https://flueframework.com/docs/",
|
|
2548
|
+
"verifiedAt": "2026-10-30",
|
|
2549
|
+
"workerHealthCoverage": {
|
|
2550
|
+
"scope": "out",
|
|
2551
|
+
"coverage": "unobserved",
|
|
2552
|
+
"handshake": "unobserved",
|
|
2553
|
+
"evidenceGrades": ["R"],
|
|
2554
|
+
"qualificationOwner": "B-OG-47",
|
|
2555
|
+
"provenance": ["tools/agents/providers/flue.mjs", "docs/providers/flue.md"],
|
|
2556
|
+
"reason": "Flue is an app target, with no worker invocation profile or adapter (#3120 D6)."
|
|
2557
|
+
}
|
|
2558
|
+
},
|
|
2536
2559
|
"grokbot": {
|
|
2537
2560
|
"sessionEnvAllowlist": [],
|
|
2538
2561
|
"agent": "unsupported",
|
|
@@ -327,6 +327,15 @@
|
|
|
327
327
|
"sourceUrl": "https://docs.openclaw.ai/tools/subagents",
|
|
328
328
|
"verifiedAt": "2026-07-20"
|
|
329
329
|
},
|
|
330
|
+
"flue": {
|
|
331
|
+
"roles": {
|
|
332
|
+
"reasoning": { "id": "app-owned", "status": "unverified", "observed": false },
|
|
333
|
+
"coding": { "id": "app-owned", "status": "unverified", "observed": false },
|
|
334
|
+
"efficiency": { "id": "app-owned", "status": "unverified", "observed": false }
|
|
335
|
+
},
|
|
336
|
+
"sourceUrl": "https://flueframework.com/docs/",
|
|
337
|
+
"verifiedAt": "2026-10-30"
|
|
338
|
+
},
|
|
330
339
|
"grokbot": {
|
|
331
340
|
"roles": {
|
|
332
341
|
"reasoning": {
|
|
@@ -3,7 +3,7 @@ import { ArxivClient } from '../../research/clients/arxiv.js';
|
|
|
3
3
|
import { CrossRefClient } from '../../research/clients/crossref.js';
|
|
4
4
|
import { SemanticScholarClient } from '../../research/clients/semantic-scholar.js';
|
|
5
5
|
import { identityKeys, normalizeIdentity, normalizeTitle } from '../../research/identity.js';
|
|
6
|
-
import { classifyCandidates, mergePapers, needsTitleDisambiguation, parsePartialReference, scorePaper } from '../../research/reference-match.js';
|
|
6
|
+
import { classifyCandidates, mergePapers, needsTitleDisambiguation, needsYearReview, parsePartialReference, scorePaper } from '../../research/reference-match.js';
|
|
7
7
|
import { ResearchError, ResearchErrorCode } from '../../research/types.js';
|
|
8
8
|
import { findInCorpus } from './resolve-corpus.js';
|
|
9
9
|
export function createResolverClients() {
|
|
@@ -37,7 +37,17 @@ export async function resolveReference(input, root, year, clients = createResolv
|
|
|
37
37
|
const identifier = reference.identifier;
|
|
38
38
|
async function attempt(source, method, query, run, byId = false) {
|
|
39
39
|
try {
|
|
40
|
-
const returned = (await run()).slice(0, 5).
|
|
40
|
+
const returned = (await run()).slice(0, 5).flatMap(paper => {
|
|
41
|
+
try {
|
|
42
|
+
return [canonicalPaper(paper)];
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
// Missing years are record quality, not a failed request; retain valid siblings.
|
|
46
|
+
if (error instanceof ResearchError && error.code === ResearchErrorCode.RF_301)
|
|
47
|
+
return [];
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
41
51
|
if (returned.some(paper => !paper.id || !normalizeTitle(paper.title))) {
|
|
42
52
|
throw new ResearchError(ResearchErrorCode.RF_301, 'Response lacks a paper identity or title');
|
|
43
53
|
}
|
|
@@ -65,8 +75,13 @@ export async function resolveReference(input, root, year, clients = createResolv
|
|
|
65
75
|
}
|
|
66
76
|
catch (error) {
|
|
67
77
|
const missing = error instanceof ResearchError && error.code === ResearchErrorCode.RF_300;
|
|
78
|
+
const retryable = error instanceof ResearchError && [
|
|
79
|
+
ResearchErrorCode.RF_103, ResearchErrorCode.RF_104, ResearchErrorCode.RF_200,
|
|
80
|
+
ResearchErrorCode.RF_201, ResearchErrorCode.RF_202, ResearchErrorCode.RF_500,
|
|
81
|
+
ResearchErrorCode.RF_501, ResearchErrorCode.RF_502,
|
|
82
|
+
].includes(error.code);
|
|
68
83
|
paths.push({ source, method, query, status: missing ? 'empty' : 'error', returned: [],
|
|
69
|
-
...(missing ? {} : { error: error instanceof Error ? error.message : String(error) }) });
|
|
84
|
+
...(missing ? {} : { error: error instanceof Error ? error.message : String(error), retryable }) });
|
|
70
85
|
}
|
|
71
86
|
}
|
|
72
87
|
if (identifier) {
|
|
@@ -104,13 +119,20 @@ export async function resolveReference(input, root, year, clients = createResolv
|
|
|
104
119
|
}
|
|
105
120
|
}
|
|
106
121
|
const classified = classifyCandidates(candidates);
|
|
107
|
-
const incomplete = paths.some(path => path.
|
|
122
|
+
const incomplete = paths.some(path => path.retryable);
|
|
108
123
|
const titleAmbiguous = needsTitleDisambiguation(reference, candidates, incomplete);
|
|
124
|
+
const yearConflict = needsYearReview(reference, candidates[0]);
|
|
125
|
+
if (classified !== 'unresolved' && candidates[0]?.score_parts.year === 0) {
|
|
126
|
+
findings.push({ type: yearConflict ? 'year_conflict' : 'year_mismatch',
|
|
127
|
+
supplied: String(reference.year), returned: String(candidates[0].paper.year), candidate: candidates[0].paper.id });
|
|
128
|
+
}
|
|
109
129
|
const status = classified === 'unresolved' && incomplete ? 'deferred'
|
|
110
|
-
: classified === 'resolved' && (identifierUnresolved || titleAmbiguous) ? 'ambiguous' : classified;
|
|
130
|
+
: classified === 'resolved' && (identifierUnresolved || titleAmbiguous || yearConflict) ? 'ambiguous' : classified;
|
|
111
131
|
if (titleAmbiguous && classified !== 'unresolved')
|
|
112
132
|
findings.push({ type: 'title_ambiguous',
|
|
113
|
-
supplied: reference.title, returned:
|
|
133
|
+
supplied: reference.title, returned: reference.year === undefined
|
|
134
|
+
? 'Supply a year, author, or verified identifier to disambiguate this title'
|
|
135
|
+
: 'Supply an author or verified identifier to disambiguate this title' });
|
|
114
136
|
const paper = status === 'resolved' ? candidates[0].paper : undefined;
|
|
115
137
|
const corpusMatches = paper ? findInCorpus(root, paper) : [];
|
|
116
138
|
return { input, reference, status, incomplete, candidates,
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// Find operational artifacts in the source corpus when indexes lack a match.
|
|
2
|
+
/**
|
|
3
|
+
* Scan bundle `gate-packs/` directories for a pack matching `needle` (#2830).
|
|
4
|
+
*
|
|
5
|
+
* Accepts the full namespaced id, the rest-path or the short pack name and
|
|
6
|
+
* probes `<bundle>/gate-packs/<pack>.gatepack.{yaml,yml,json}`. Never looks
|
|
7
|
+
* under `gates/`, which agent-persistence HITL owns.
|
|
8
|
+
*/
|
|
9
|
+
export async function findGatePackInCorpus(groups, needle) {
|
|
10
|
+
const path = await import('node:path');
|
|
11
|
+
const fsp = (await import('node:fs')).promises;
|
|
12
|
+
const trimmed = needle.trim();
|
|
13
|
+
const rest = trimmed.includes(':') ? trimmed.slice(trimmed.indexOf(':') + 1) : trimmed;
|
|
14
|
+
const slash = rest.indexOf('/');
|
|
15
|
+
const wantedBundle = slash >= 0 ? rest.slice(0, slash) : null;
|
|
16
|
+
const wantedPack = slash >= 0 ? rest.slice(slash + 1) : rest;
|
|
17
|
+
if (!wantedPack || /\s/.test(wantedPack) || wantedPack.includes(':') || wantedPack.includes('/'))
|
|
18
|
+
return null;
|
|
19
|
+
const extensions = ['.gatepack.yaml', '.gatepack.yml', '.gatepack.json'];
|
|
20
|
+
const ordered = wantedBundle
|
|
21
|
+
? groups.flatMap(group => [{ group, bundle: wantedBundle }])
|
|
22
|
+
: null;
|
|
23
|
+
const probe = async (group, bundle) => {
|
|
24
|
+
for (const extension of extensions) {
|
|
25
|
+
const candidate = path.join(group.dir, bundle, 'gate-packs', `${wantedPack}${extension}`);
|
|
26
|
+
try {
|
|
27
|
+
const stat = await fsp.stat(candidate);
|
|
28
|
+
if (stat.isFile())
|
|
29
|
+
return { path: candidate, bundleKind: group.kind, bundleId: bundle };
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// not present — continue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
37
|
+
if (ordered) {
|
|
38
|
+
for (const { group, bundle } of ordered) {
|
|
39
|
+
const found = await probe(group, bundle);
|
|
40
|
+
if (found)
|
|
41
|
+
return found;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
for (const group of groups) {
|
|
46
|
+
let bundles;
|
|
47
|
+
try {
|
|
48
|
+
bundles = (await fsp.readdir(group.dir, { withFileTypes: true }))
|
|
49
|
+
.filter(d => d.isDirectory())
|
|
50
|
+
.map(d => d.name)
|
|
51
|
+
.sort();
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
for (const bundle of bundles) {
|
|
57
|
+
const found = await probe(group, bundle);
|
|
58
|
+
if (found)
|
|
59
|
+
return found;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Scan the AIWG_ROOT corpus for an artifact matching `name` (#1221).
|
|
66
|
+
*
|
|
67
|
+
* Walks the well-known artifact layouts under
|
|
68
|
+
* `agentic/code/{frameworks,addons,extensions,plugins}/<bundle>/{skills,agents,commands,rules,templates,behaviors,flows}/`
|
|
69
|
+
* and returns the first match. Used as a fallback in `aiwg show` when an
|
|
70
|
+
* artifact isn't in any built index — either because the workspace hasn't
|
|
71
|
+
* been deployed to yet, or because the bundle hasn't been installed.
|
|
72
|
+
*
|
|
73
|
+
* Returns the resolved absolute path plus enough metadata for the caller
|
|
74
|
+
* to surface a useful install hint. Returns null if nothing matches.
|
|
75
|
+
*/
|
|
76
|
+
export async function findCorpusArtifact(aiwgRoot, name, typeFilter) {
|
|
77
|
+
const fs = await import('node:fs');
|
|
78
|
+
const path = await import('node:path');
|
|
79
|
+
const fsp = fs.promises;
|
|
80
|
+
const groups = [
|
|
81
|
+
{ kind: 'framework', dir: path.join(aiwgRoot, 'agentic/code/frameworks') },
|
|
82
|
+
{ kind: 'addon', dir: path.join(aiwgRoot, 'agentic/code/addons') },
|
|
83
|
+
{ kind: 'extension', dir: path.join(aiwgRoot, 'agentic/code/extensions') },
|
|
84
|
+
{ kind: 'plugin', dir: path.join(aiwgRoot, 'agentic/code/plugins') },
|
|
85
|
+
];
|
|
86
|
+
// (subdir, type, layout) — 'flat' = `<name>.md`, 'slug' = `<name>/SKILL.md`
|
|
87
|
+
const tries = [
|
|
88
|
+
{ sub: 'skills', type: 'skill', layout: 'slug' },
|
|
89
|
+
{ sub: 'skills', type: 'skill', layout: 'flat' },
|
|
90
|
+
{ sub: 'agents', type: 'agent', layout: 'flat' },
|
|
91
|
+
{ sub: 'commands', type: 'command', layout: 'flat' },
|
|
92
|
+
{ sub: 'rules', type: 'rule', layout: 'flat' },
|
|
93
|
+
{ sub: 'templates', type: 'template', layout: 'flat' },
|
|
94
|
+
{ sub: 'behaviors', type: 'behavior', layout: 'flat' },
|
|
95
|
+
{ sub: 'flows', type: 'flow', layout: 'flat' },
|
|
96
|
+
{ sub: 'runbooks', type: 'runbook', layout: 'flat' },
|
|
97
|
+
{ sub: 'decisions', type: 'decision-definition', layout: 'flat', extension: '.json' },
|
|
98
|
+
{ sub: 'rulesets', type: 'decision-ruleset', layout: 'flat', extension: '.json' },
|
|
99
|
+
{ sub: 'bindings', type: 'decision-binding', layout: 'flat', extension: '.json' },
|
|
100
|
+
];
|
|
101
|
+
for (const group of groups) {
|
|
102
|
+
let bundles;
|
|
103
|
+
try {
|
|
104
|
+
bundles = (await fsp.readdir(group.dir, { withFileTypes: true }))
|
|
105
|
+
.filter(d => d.isDirectory())
|
|
106
|
+
.map(d => d.name);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
for (const bundle of bundles) {
|
|
112
|
+
for (const t of tries) {
|
|
113
|
+
if (typeFilter.length > 0 && !typeFilter.includes(t.type))
|
|
114
|
+
continue;
|
|
115
|
+
const candidate = t.layout === 'slug'
|
|
116
|
+
? path.join(group.dir, bundle, t.sub, name, 'SKILL.md')
|
|
117
|
+
: path.join(group.dir, bundle, t.sub, `${name}${t.extension ?? '.md'}`);
|
|
118
|
+
try {
|
|
119
|
+
const stat = await fsp.stat(candidate);
|
|
120
|
+
if (stat.isFile()) {
|
|
121
|
+
return { path: candidate, type: t.type, bundleKind: group.kind, bundleId: bundle };
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// not present — continue
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Gate packs live in `<bundle>/gate-packs/*.gatepack.yaml|json` (never
|
|
131
|
+
// `gates/`, which agent-persistence HITL uses). The needle may be the full
|
|
132
|
+
// namespaced id (`aiwg:decision-engine/integrity-ceiling`), the rest-path
|
|
133
|
+
// (`decision-engine/integrity-ceiling`) or the short pack name
|
|
134
|
+
// (`integrity-ceiling`). (#2830)
|
|
135
|
+
if (typeFilter.length === 0 || typeFilter.includes('gate-pack')) {
|
|
136
|
+
const gateMatch = await findGatePackInCorpus(groups, name);
|
|
137
|
+
if (gateMatch)
|
|
138
|
+
return { ...gateMatch, type: 'gate-pack' };
|
|
139
|
+
}
|
|
140
|
+
// Top-level agents live at `agentic/code/agents/<category>/<name>.md`
|
|
141
|
+
// (e.g. `personas/aiwg-writer.md`) — a flat-under-category layout the
|
|
142
|
+
// bundle groups above do not cover. Scan it directly so persona/agent
|
|
143
|
+
// `show` survives un-indexed (or stale-framework-index) workspaces, where
|
|
144
|
+
// the corpus fallback is the only resolution path. (#1623 U5)
|
|
145
|
+
if (typeFilter.length === 0 || typeFilter.includes('agent')) {
|
|
146
|
+
const agentMatch = await findAgentInCorpus(path.join(aiwgRoot, 'agentic/code/agents'), name);
|
|
147
|
+
if (agentMatch) {
|
|
148
|
+
return { path: agentMatch, type: 'agent', bundleKind: null, bundleId: null };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Behaviors commonly use a slug layout: `behaviors/<name>/BEHAVIOR.md`.
|
|
152
|
+
if (typeFilter.length === 0 || typeFilter.includes('behavior')) {
|
|
153
|
+
for (const group of groups) {
|
|
154
|
+
let bundles;
|
|
155
|
+
try {
|
|
156
|
+
bundles = (await fsp.readdir(group.dir, { withFileTypes: true }))
|
|
157
|
+
.filter(d => d.isDirectory())
|
|
158
|
+
.map(d => d.name);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
for (const bundle of bundles) {
|
|
164
|
+
const candidate = path.join(group.dir, bundle, 'behaviors', name, 'BEHAVIOR.md');
|
|
165
|
+
try {
|
|
166
|
+
const stat = await fsp.stat(candidate);
|
|
167
|
+
if (stat.isFile()) {
|
|
168
|
+
return { path: candidate, type: 'behavior', bundleKind: group.kind, bundleId: bundle };
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
// not present — continue
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Recursively scan `agentic/code/agents` for a flat `<name>.md` agent file.
|
|
181
|
+
*
|
|
182
|
+
* Agents use an `agents/<category>/<name>.md` layout (e.g. `personas/`) that
|
|
183
|
+
* differs from the bundle `<dir>/<bundle>/<sub>/<name>.md` layout the generic
|
|
184
|
+
* corpus scan walks, so persona agents are otherwise missed. Bounded depth —
|
|
185
|
+
* the agents tree is shallow. Returns the first matching absolute path, or
|
|
186
|
+
* null. Direct files at each level take priority over subdirectories. (#1623)
|
|
187
|
+
*/
|
|
188
|
+
export async function findAgentInCorpus(agentsRoot, name, depth = 0) {
|
|
189
|
+
if (depth > 3)
|
|
190
|
+
return null;
|
|
191
|
+
const fs = await import('node:fs');
|
|
192
|
+
const path = await import('node:path');
|
|
193
|
+
const fsp = fs.promises;
|
|
194
|
+
let entries;
|
|
195
|
+
try {
|
|
196
|
+
entries = await fsp.readdir(agentsRoot, { withFileTypes: true });
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
// Prefer a direct `<name>.md` at this level before descending.
|
|
202
|
+
for (const entry of entries) {
|
|
203
|
+
if (entry.isFile() && entry.name === `${name}.md`) {
|
|
204
|
+
return path.join(agentsRoot, entry.name);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// Descend into category subdirectories (e.g. personas/).
|
|
208
|
+
for (const entry of entries) {
|
|
209
|
+
if (entry.isDirectory()) {
|
|
210
|
+
const found = await findAgentInCorpus(path.join(agentsRoot, entry.name), name, depth + 1);
|
|
211
|
+
if (found)
|
|
212
|
+
return found;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=query-engine-corpus.js.map
|