返回 CodeWhale
module.mjs
1 // A built-in (tier 0) host module for the trust-tier tests. It is not a
2 // plugin: no manifest, no review. The test substitutes a builtin-module table
3 // pinning this file's SHA-256 and listing `zz_tier0_listed` as Auto; the other
4 // tool is not listed, so the core must treat it as Required.
5 export const name = 'tier0-module'
6 export const inject = ['tools']
7
8 export function apply(ctx) {
9 ctx.tools.register({
10 name: 'zz_tier0_listed',
11 description: 'Listed in the test table with Auto approval.',
12 parameters: { type: 'object', properties: {} },
13 execute: () => ({ tier: 'zero', listed: true }),
14 })
15 ctx.tools.register({
16 name: 'zz_tier0_unlisted',
17 description: 'Not listed in the test table: Required.',
18 parameters: { type: 'object', properties: {} },
19 execute: () => ({ tier: 'zero', listed: false }),
20 })
21 }
22
22 lines Plain Text