release: prepare v0.9.7

This commit is contained in:
BigBodyCobain
2026-05-01 22:56:50 -06:00
parent ea457f27da
commit 28b3bd5ebf
670 changed files with 187059 additions and 14005 deletions
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
import {
describeNativeControlError,
extractNativeGateResyncTarget,
extractGateTargetRef,
} from '../../lib/desktopControlContract';
@@ -22,6 +23,12 @@ describe('extractGateTargetRef', () => {
expect(extractGateTargetRef('wormhole.gate.proof', { gate_id: 'alpha' })).toBe('alpha');
});
it('extracts gate_id from gate state resync payload', () => {
expect(extractGateTargetRef('wormhole.gate.state.resync', { gate_id: 'alpha' })).toBe(
'alpha',
);
});
it('extracts gate_id from gate message post payload', () => {
expect(
extractGateTargetRef('wormhole.gate.message.post', { gate_id: 'ops', plaintext: 'hi' }),
@@ -86,9 +93,30 @@ describe('describeNativeControlError', () => {
expect(describeNativeControlError(undefined)).toBeNull();
});
it('describes native gate resync requirement errors', () => {
expect(
describeNativeControlError('native_gate_state_resync_required:ops'),
).toContain('gate resync');
});
it('handles plain string errors', () => {
expect(
describeNativeControlError('native_control_profile_mismatch:foo'),
).toContain('Denied');
});
});
describe('extractNativeGateResyncTarget', () => {
it('extracts the gate id from native resync-required errors', () => {
expect(extractNativeGateResyncTarget('native_gate_state_resync_required:ops')).toBe('ops');
expect(extractNativeGateResyncTarget(new Error('native_gate_state_resync_required:infonet'))).toBe(
'infonet',
);
});
it('returns null for unrelated errors', () => {
expect(extractNativeGateResyncTarget(new Error('network_error'))).toBeNull();
expect(extractNativeGateResyncTarget('native_control_profile_mismatch:foo')).toBeNull();
expect(extractNativeGateResyncTarget(null)).toBeNull();
});
});