Skip to content

Commit 315b38e

Browse files
committed
fix(types,tests): reconcile duplicate exports and remove obsolete header_store mocks
1 parent 55db91b commit 315b38e

8 files changed

Lines changed: 11 additions & 66 deletions

File tree

src/components/chat/Chat_Content.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { type DragControls, AnimatePresence, motion } from 'framer-motion';
1717
import clsx from 'clsx';
1818
import { type Voice_Status } from '../../services/voice_client';
1919
import { i18n } from '../../i18n';
20-
import { type Sovereign_Scope, type Chat_Message } from '../../stores/sovereign_store';
20+
import { type Sovereign_Scope, type Chat_Message, type SessionLeaf } from '../../stores/sovereign_store';
2121
import { type Mission_Cluster } from '../../stores/workspace_store';
2222
import type { Agent } from '../../types';
2323
import { Chat_Header } from './Chat_Header';
@@ -28,12 +28,7 @@ import { Chat_Input_Bar } from './Chat_Input_Bar';
2828
import { Buffered_Transcript_View } from '../transcript/Buffered_Transcript_View';
2929
import { ArtifactWorkspace } from './ArtifactWorkspace';
3030

31-
export interface SessionLeaf {
32-
id: string;
33-
role: string;
34-
content: string;
35-
created_at: string;
36-
}
31+
export type { SessionLeaf };
3732

3833
export interface Chat_Content_Props {
3934
is_detached: boolean;

src/components/chat/Chat_Message_List.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,14 @@ import React, { useMemo } from 'react';
1515
import { motion } from 'framer-motion';
1616
import { Bot, User, Zap, GitBranch } from 'lucide-react';
1717
import clsx from 'clsx';
18-
import { type Message_Part } from '../../stores/sovereign_store';
18+
import { type Chat_Message } from '../../stores/sovereign_store';
1919
import { i18n } from '../../i18n';
2020
import { ArtifactPromotionCard } from './ArtifactPromotionCard';
2121
import { get_safe_date } from '../../utils/date_utils';
2222

2323
const ARTIFACT_REGEX = /```(?:python|py|javascript|js|bash|sh|ps1)\n([\s\S]*?)```/g;
2424

25-
export interface Chat_Message {
26-
id: string;
27-
sender_id: string;
28-
sender_name: string;
29-
text: string;
30-
scope: string;
31-
target_node?: string;
32-
/** timestamp: Strictly epoch milliseconds or ISO string */
33-
timestamp: number | string | Date;
34-
parts?: Message_Part[];
35-
agent_id?: string;
36-
}
25+
export type { Chat_Message };
3726

3827
interface Chat_Message_Item_Props {
3928
msg: Chat_Message;

src/pages/Model_Manager.test.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,6 @@ vi.mock('../stores/provider_store', () => ({
101101
})
102102
}));
103103

104-
vi.mock('../stores/header_store', () => ({
105-
use_header_store: vi.fn((selector) => {
106-
const state = {
107-
set_header_actions: vi.fn(),
108-
clear_header_actions: vi.fn(),
109-
};
110-
return selector ? selector(state) : state;
111-
}),
112-
}));
113-
114104
vi.mock('../i18n', () => ({
115105
i18n: {
116106
t: (key: string) => key,

src/pages/Model_Manager_Hardening.test.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,6 @@ vi.mock('../stores/provider_store', () => ({
7575
})
7676
}));
7777

78-
vi.mock('../stores/header_store', () => ({
79-
use_header_store: vi.fn((selector) => {
80-
const state = {
81-
set_header_actions: vi.fn(),
82-
clear_header_actions: vi.fn(),
83-
};
84-
return selector ? selector(state) : state;
85-
}),
86-
}));
87-
8878
vi.mock('../i18n', () => ({
8979
i18n: {
9080
t: (key: string) => key,

src/pages/Ops_Dashboard.test.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,6 @@ vi.mock('../stores/workspace_store', () => ({
106106
})
107107
}));
108108

109-
vi.mock('../stores/header_store', () => ({
110-
use_header_store: vi.fn((selector) => {
111-
const state = {
112-
set_header_actions: vi.fn(),
113-
clear_header_actions: vi.fn(),
114-
};
115-
return selector ? selector(state) : state;
116-
}),
117-
}));
118-
119109
vi.mock('../stores/settings_store', () => ({
120110
use_settings_store: vi.fn((selector) => {
121111
const state = {

src/services/system_api_service.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,8 @@ import { model_manager_api_service } from './model_manager_api_service';
2727
import { oversight_api_service } from './oversight_api_service';
2828
import { continuity_api_service } from './continuity_api_service';
2929

30-
/** Quota_Details - Consumption metrics for budget governance. */
31-
export interface Quota_Details {
32-
entity_id: string;
33-
budget_usd: number;
34-
used_usd: number;
35-
reset_period: 'daily' | 'monthly' | 'never';
36-
last_reset_at: string;
37-
next_reset_at: string;
38-
}
30+
import type { Quota_Details } from '../contracts/governance';
31+
export type { Quota_Details };
3932

4033
export interface System_Defense {
4134
memory_pressure: number;

src/services/tadpoleos_service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export type {
134134
Swarm_Node,
135135
Store_Model
136136
} from './system_api_service';
137-
export type Connection_State = 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'error';
137+
export type { Connection_State } from './socket';
138138
export type { Skill_Manifest } from './mission_api_service';
139139

140140

src/stores/sovereign_store.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,17 @@ const TELEMETRY_SOURCE = '[SovereignStore]';
4343

4444
export type Sovereign_Scope = 'agent' | 'cluster' | 'swarm';
4545

46-
export type Message_Part =
47-
| { type: 'text', content: string }
48-
| { type: 'thought', content: string, status: 'thinking' | 'done' }
49-
| { type: 'tool', name: string, input: unknown, output?: unknown };
46+
import type { Message_Part } from '../types';
47+
export type { Message_Part };
5048

5149
export interface Chat_Message {
5250
id: string;
5351
sender_id: string;
5452
sender_name: string;
5553
text: string;
5654
parts?: Message_Part[];
57-
timestamp: string;
58-
scope: Sovereign_Scope;
55+
timestamp: string | number | Date;
56+
scope: Sovereign_Scope | string;
5957
agent_id?: string;
6058
is_sub_agent?: boolean;
6159
lineage?: string[];

0 commit comments

Comments
 (0)