skillhub/plugins/dsh/test/operation-diagnostic.test.ts
XiaoSeS 3560679793
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
feat(dsh): add native SkillHub plugin for DeepSeek Harness (#956)
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>
2026-10-16 19:22:26 +08:00

17 lines
986 B
TypeScript

import { expect, test } from 'bun:test';
import { operationDiagnostic } from '../src/host/operation-diagnostic.js';
import type { NativeOperation } from '../src/host/generated/native-contract.js';
const operation = { operationId: 'operation', kind: 'install' } as NativeOperation;
test('execution diagnostics expose only operation identity and allowlisted categories', () => {
for (const [error, expected] of [
[Object.assign(new Error('/private/token=secret'), { code: 'EPERM', path: '/private' }), 'EPERM'],
[{ code: 'ECONNRESET', url: 'https://secret@example.test' }, 'ECONNRESET'],
[{ exitCode: 6, details: { token: 'secret' } }, 'VALIDATION'],
[{ code: 'secret', exitCode: 4 }, 'FILESYSTEM'],
[{ code: 'secret', exitCode: 99 }, 'UNCLASSIFIED'],
[new Error('secret'), 'UNCLASSIFIED'], [null, 'UNCLASSIFIED'],
] as const) {
expect(operationDiagnostic(operation, error)).toEqual({ operationId: 'operation', kind: 'install', code: expected });
}
});