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