mirror of
https://github.com/iflytek/skillhub.git
synced 2026-11-18 09:41:56 +00:00
Some checks failed
Deploy Docs / build (push) Has been cancelled
Security / Dependency Review (push) Has been cancelled
Security / CodeQL (java-kotlin) (push) Has been cancelled
Security / CodeQL (javascript-typescript) (push) Has been cancelled
Security / CodeQL (python) (push) Has been cancelled
Deploy Docs / Deploy (push) Has been cancelled
Add the native SkillHub plugin for DeepSeek Harness with a scoped skill center, conversation search/install tools, exact-version installation and protected lifecycle management. Prepare the independently versioned 0.1.0 npm candidate with an empty default Registry and documented compatibility limits. Keep formal specifications and executable regression tests; remove archived development screenshots and runtime reports from the final tree. Review fixes cover independent scopes, installed references, pre-staging recovery and idempotent discovery. Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
30 lines
2.2 KiB
TypeScript
30 lines
2.2 KiB
TypeScript
import { expect, test } from 'bun:test';
|
|
// @ts-expect-error The development-only Node entry has no TypeScript declarations.
|
|
import { safeProbeFailure } from '../scripts/smoke-native-host.mjs';
|
|
|
|
test('probe diagnostics expose only fixed stage and code from the requested probe', () => {
|
|
const record = { passed: false, probe: 'runtime-baseline', stage: 'host-assertion',
|
|
failureCode: 'PROBE_FAILED', error: 'private-secret', report: '/private/path' };
|
|
expect(safeProbeFailure('private raw line\n' + JSON.stringify(record), 'runtime-baseline'))
|
|
.toEqual({ stage: 'host-assertion', code: 'PROBE_FAILED' });
|
|
expect(safeProbeFailure(JSON.stringify({ ...record, failureCode: 'HOST_RESULT_TIMEOUT' }), 'runtime-baseline'))
|
|
.toEqual({ stage: 'host-assertion', code: 'HOST_RESULT_TIMEOUT' });
|
|
expect(safeProbeFailure(JSON.stringify(record), 'plugin-lifecycle')).toBeUndefined();
|
|
for (const replacement of [{ stage: 'private-secret' }, { failureCode: 'private-secret' }, { passed: true }]) {
|
|
expect(safeProbeFailure(JSON.stringify({ ...record, ...replacement }), 'runtime-baseline')).toBeUndefined();
|
|
}
|
|
for (const input of ['null', '{}', 'raw secret', '[1,2]']) {
|
|
expect(safeProbeFailure(input, 'runtime-baseline')).toBeUndefined();
|
|
}
|
|
});
|
|
|
|
|
|
test('observer diagnostics whitelist states and exact dependency booleans', () => {
|
|
const base = { passed: false, probe: 'runtime-baseline', stage: 'host-result', failureCode: 'HOST_RESULT_TIMEOUT' };
|
|
expect(safeProbeFailure(JSON.stringify({ ...base, diagnostics: { observer: { stage: 'validation-failed', validation: 'home-identity', path: 'secret' },
|
|
dependencies: { loader: true, pluginPackages: false, clientModules: true, skillhub: false, secret: 'private' } } }), 'runtime-baseline'))
|
|
.toEqual({ stage: 'host-result', code: 'HOST_RESULT_TIMEOUT', observer: 'validation-failed', validation: 'home-identity',
|
|
dependencies: { loader: true, pluginPackages: false, clientModules: true, skillhub: false } });
|
|
expect(safeProbeFailure(JSON.stringify({ ...base, diagnostics: { observer: { stage: 'private', validation: 'private-path' }, dependencies: { skillhub: 'secret' } } }), 'runtime-baseline'))
|
|
.toEqual({ stage: 'host-result', code: 'HOST_RESULT_TIMEOUT', observer: 'not-observed', dependencies: {} });
|
|
});
|