()
| 454 | export type AppStateStore = Store<AppState> |
| 455 | |
| 456 | export function getDefaultAppState(): AppState { |
| 457 | // Determine initial permission mode for teammates spawned with plan_mode_required |
| 458 | // Use lazy require to avoid circular dependency with teammate.ts |
| 459 | /* eslint-disable @typescript-eslint/no-require-imports */ |
| 460 | const teammateUtils = |
| 461 | require('../utils/teammate.js') as typeof import('../utils/teammate.js') |
| 462 | /* eslint-enable @typescript-eslint/no-require-imports */ |
| 463 | const initialMode: PermissionMode = |
| 464 | teammateUtils.isTeammate() && teammateUtils.isPlanModeRequired() |
| 465 | ? 'plan' |
| 466 | : 'default' |
| 467 | |
| 468 | return { |
| 469 | settings: getInitialSettings(), |
| 470 | tasks: {}, |
| 471 | agentNameRegistry: new Map(), |
| 472 | verbose: false, |
| 473 | mainLoopModel: null, // alias, full name (as with --model or env var), or null (default) |
| 474 | mainLoopModelForSession: null, |
| 475 | statusLineText: undefined, |
| 476 | expandedView: 'none', |
| 477 | isBriefOnly: false, |
| 478 | showTeammateMessagePreview: false, |
| 479 | selectedIPAgentIndex: -1, |
| 480 | coordinatorTaskIndex: -1, |
| 481 | viewSelectionMode: 'none', |
| 482 | footerSelection: null, |
| 483 | kairosEnabled: false, |
| 484 | remoteSessionUrl: undefined, |
| 485 | remoteConnectionStatus: 'connecting', |
| 486 | remoteBackgroundTaskCount: 0, |
| 487 | replBridgeEnabled: false, |
| 488 | replBridgeExplicit: false, |
| 489 | replBridgeOutboundOnly: false, |
| 490 | replBridgeConnected: false, |
| 491 | replBridgeSessionActive: false, |
| 492 | replBridgeReconnecting: false, |
| 493 | replBridgeConnectUrl: undefined, |
| 494 | replBridgeSessionUrl: undefined, |
| 495 | replBridgeEnvironmentId: undefined, |
| 496 | replBridgeSessionId: undefined, |
| 497 | replBridgeError: undefined, |
| 498 | replBridgeInitialName: undefined, |
| 499 | showRemoteCallout: false, |
| 500 | toolPermissionContext: { |
| 501 | ...getEmptyToolPermissionContext(), |
| 502 | mode: initialMode, |
| 503 | }, |
| 504 | agent: undefined, |
| 505 | agentDefinitions: { activeAgents: [], allAgents: [] }, |
| 506 | fileHistory: { |
| 507 | snapshots: [], |
| 508 | trackedFiles: new Set(), |
| 509 | snapshotSequence: 0, |
| 510 | }, |
| 511 | attribution: createEmptyAttributionState(), |
| 512 | mcp: { |
| 513 | clients: [], |
no test coverage detected