@di-code/coding-agent 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +5 -0
  2. package/dist/core/session/session-manager.d.ts +18 -1
  3. package/dist/core/session/session-manager.d.ts.map +1 -1
  4. package/dist/core/session/session-manager.js +90 -1
  5. package/dist/core/session/session-manager.js.map +1 -1
  6. package/dist/core/session/session-storage.d.ts +2 -0
  7. package/dist/core/session/session-storage.d.ts.map +1 -1
  8. package/dist/core/session/session-storage.js +22 -1
  9. package/dist/core/session/session-storage.js.map +1 -1
  10. package/dist/core/session/types.d.ts +16 -1
  11. package/dist/core/session/types.d.ts.map +1 -1
  12. package/dist/core/session/types.js.map +1 -1
  13. package/dist/core/session.d.ts +27 -2
  14. package/dist/core/session.d.ts.map +1 -1
  15. package/dist/core/session.js +59 -0
  16. package/dist/core/session.js.map +1 -1
  17. package/dist/entry.js +1 -1
  18. package/dist/entry.js.map +1 -1
  19. package/dist/i18n.js +4 -4
  20. package/dist/i18n.js.map +1 -1
  21. package/dist/interactive-host-entry.d.ts.map +1 -1
  22. package/dist/interactive-host-entry.js +107 -12
  23. package/dist/interactive-host-entry.js.map +1 -1
  24. package/dist/main.d.ts.map +1 -1
  25. package/dist/main.js +3 -0
  26. package/dist/main.js.map +1 -1
  27. package/dist/modes/interactive-components.d.ts +8 -0
  28. package/dist/modes/interactive-components.d.ts.map +1 -1
  29. package/dist/modes/interactive-components.js +7 -2
  30. package/dist/modes/interactive-components.js.map +1 -1
  31. package/dist/modes/interactive.d.ts +4 -0
  32. package/dist/modes/interactive.d.ts.map +1 -1
  33. package/dist/modes/interactive.js +69 -0
  34. package/dist/modes/interactive.js.map +1 -1
  35. package/dist/modes/tree-selector.d.ts.map +1 -1
  36. package/dist/modes/tree-selector.js +4 -0
  37. package/dist/modes/tree-selector.js.map +1 -1
  38. package/dist/rpc/client.d.ts +2 -0
  39. package/dist/rpc/client.d.ts.map +1 -1
  40. package/dist/rpc/client.js +3 -0
  41. package/dist/rpc/client.js.map +1 -1
  42. package/dist/rpc/dispatcher.d.ts +14 -0
  43. package/dist/rpc/dispatcher.d.ts.map +1 -1
  44. package/dist/rpc/dispatcher.js +222 -7
  45. package/dist/rpc/dispatcher.js.map +1 -1
  46. package/dist/rpc/protocol.d.ts +12 -5
  47. package/dist/rpc/protocol.d.ts.map +1 -1
  48. package/dist/rpc/protocol.js +34 -0
  49. package/dist/rpc/protocol.js.map +1 -1
  50. package/dist/rpc/server.d.ts +5 -0
  51. package/dist/rpc/server.d.ts.map +1 -1
  52. package/dist/rpc/server.js +4 -0
  53. package/dist/rpc/server.js.map +1 -1
  54. package/dist/rpc-server-entry.d.ts.map +1 -1
  55. package/dist/rpc-server-entry.js +15 -1
  56. package/dist/rpc-server-entry.js.map +1 -1
  57. package/dist/runtime/product-host.d.ts +7 -0
  58. package/dist/runtime/product-host.d.ts.map +1 -1
  59. package/dist/runtime/product-host.js +29 -9
  60. package/dist/runtime/product-host.js.map +1 -1
  61. package/dist/runtime/session-factory.d.ts +18 -2
  62. package/dist/runtime/session-factory.d.ts.map +1 -1
  63. package/dist/runtime/session-factory.js +286 -24
  64. package/dist/runtime/session-factory.js.map +1 -1
  65. package/dist/runtime/session-host.d.ts +46 -1
  66. package/dist/runtime/session-host.d.ts.map +1 -1
  67. package/dist/runtime/session-host.js +38 -6
  68. package/dist/runtime/session-host.js.map +1 -1
  69. package/dist/ui-host.d.ts.map +1 -1
  70. package/dist/ui-host.js +3 -0
  71. package/dist/ui-host.js.map +1 -1
  72. package/dist/web/assets/index-C2SOU925.css +1 -0
  73. package/dist/web/assets/index-knXkInvO.js +41 -0
  74. package/dist/web/assets/index-knXkInvO.js.map +1 -0
  75. package/dist/web/index.html +2 -2
  76. package/dist/web-command.d.ts.map +1 -1
  77. package/dist/web-command.js +8 -1
  78. package/dist/web-command.js.map +1 -1
  79. package/dist/webui-entry.js +9 -1
  80. package/dist/webui-entry.js.map +1 -1
  81. package/dist/webui.d.ts +10 -0
  82. package/dist/webui.d.ts.map +1 -1
  83. package/dist/webui.js +21 -0
  84. package/dist/webui.js.map +1 -1
  85. package/package.json +11 -9
  86. package/dist/web/assets/index-C-NyCPxd.css +0 -1
  87. package/dist/web/assets/index-DgyxuNNG.js +0 -41
  88. package/dist/web/assets/index-DgyxuNNG.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ui-host.js","sourceRoot":"","sources":["../src/ui-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACpH,OAAO,EAAuC,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAA0B,eAAe,EAAiB,MAAM,cAAc,CAAC;AAEtF,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,EACN,iBAAiB,GAKjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE/E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAU,CAAC;AAkB9C,6EAA6E;AAC7E,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACrC,IAAI,GAAG,UAAmB,CAAC;IACpC;QACC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACpC,CAAC;CACD;AA0GD,SAAS,wBAAwB,CAAC,KAAc;IAC/C,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,SAAS,IAAI,KAAK;QAClB,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QACjC,KAAK,CAAC,OAAO,KAAK,IAAI;QACtB,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AC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAClH,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import { resolve } from \"node:path\";\nimport type { AssistantMessage, ImageContent, Message, Model, Provider, ThinkingLevel } from \"@di-code/ai\";\nimport { diagnosticsKey, hostCommandRegistryKey, keybindingRegistryKey, themeRegistryKey } from \"@di-code/builtins\";\nimport { type Context, type PluginDefinition, redactSensitiveText } from \"@di-code/plugin-runtime\";\nimport { type KeybindingsConfig, ProcessTerminal, type TuiTheme } from \"@di-code/tui\";\nimport type { Locale } from \"./i18n.ts\";\nimport { runProviderOnboarding, shouldStartProviderOnboarding } from \"./provider-onboarding.ts\";\nimport type { InteractiveHostRequest } from \"./runtime/interactive-host-service.ts\";\nimport {\n\tcreateSessionHost,\n\ttype PromptInput,\n\ttype SessionHost,\n\ttype SessionHostEvent,\n\ttype SessionInfo,\n} from \"./runtime/session-host.ts\";\nimport { loadStartupConfiguration, resolveStartupRuntime } from \"./startup.ts\";\n\n/** Version of the stable in-process custom TUI contract. */\nexport const UI_HOST_API_VERSION = 1 as const;\n\nexport type UiHostApiVersion = typeof UI_HOST_API_VERSION;\n\nexport type UiHostErrorCode =\n\t| \"INVALID_WORKSPACE\"\n\t| \"NOT_FOUND\"\n\t| \"BUSY\"\n\t| \"SESSION_IN_USE\"\n\t| \"DISPOSED\"\n\t| \"INVALID_INPUT\"\n\t| \"INTERNAL\";\n\n/** Errors from SessionHost-owned operations expose a stable code but not internal causes. */\nexport interface UiHostError extends Error {\n\treadonly code: UiHostErrorCode;\n}\n\n/** Thrown synchronously when a facade is used after host disposal begins. */\nexport class UiHostLifecycleError extends Error {\n\treadonly code = \"DISPOSED\" as const;\n\tconstructor() {\n\t\tsuper(\"UiHost has been disposed.\");\n\t\tthis.name = \"UiHostLifecycleError\";\n\t}\n}\n\nexport type UiHostEvent = SessionHostEvent;\n\nexport interface UiHostSessionSnapshot {\n\treadonly id: string;\n\treadonly label: string;\n\treadonly modifiedAt?: number;\n}\n\nexport type UiHostOperationKind = \"prompt\" | \"steer\" | \"retry\" | \"compact\" | \"tree\" | \"session\";\n\n/** Read-only Session state that intentionally omits managed paths and internal Session references. */\nexport interface UiHostSessionState {\n\treadonly disposed: false;\n\treadonly activeSession?: UiHostSessionSnapshot;\n\treadonly busy: boolean;\n\treadonly operations: readonly { readonly requestId: string; readonly kind: UiHostOperationKind }[];\n}\n\n/** Read-only resources selected by product bootstrap for this TUI lifetime. */\nexport interface UiHostResourceSnapshot {\n\treadonly models: readonly Model[];\n\treadonly skills: readonly { readonly name: string; readonly description: string; readonly scope: string }[];\n}\n\nexport interface UiHostDiagnostics {\n\t/** Writes redacted diagnostic text to the CLI diagnostic stream. */\n\treport(message: string): void;\n\t/** Returns a read-only snapshot of runtime diagnostics known when it is called. */\n\tsnapshot(): readonly { readonly type: string; readonly message?: string; readonly pluginName?: string }[];\n}\n\nexport interface UiHostThemeRegistry {\n\treadonly list: () => readonly { readonly name: string; readonly theme: TuiTheme }[];\n\t/** Registration belongs to the plugin Fiber and is removed during composition disposal. */\n\treadonly register: (name: string, theme: TuiTheme) => () => void;\n}\n\nexport interface UiHostKeybindingRegistry {\n\treadonly snapshot: () => KeybindingsConfig;\n\t/** Replaces the presentation keybinding snapshot for this composition scope. */\n\treadonly set: (bindings: KeybindingsConfig) => () => void;\n}\n\n/** Product-scoped facilities. It deliberately does not expose command execution or bootstrap service keys. */\nexport interface ProductHost {\n\treadonly apiVersion: UiHostApiVersion;\n\treadonly locale: Locale;\n\treadonly projectTrusted: boolean;\n\treadonly resources: () => UiHostResourceSnapshot;\n\treadonly themes: UiHostThemeRegistry;\n\treadonly keybindings: UiHostKeybindingRegistry;\n\treadonly diagnostics: UiHostDiagnostics;\n}\n\n/** A lifecycle-checked view over the current product Session, never an AgentSession instance. */\nexport interface UiSessionHost {\n\treadonly state: () => UiHostSessionState;\n\treadonly listSessions: () => Promise<readonly UiHostSessionSnapshot[]>;\n\treadonly createSession: () => Promise<UiHostSessionSnapshot>;\n\treadonly openSession: (sessionId: string) => Promise<UiHostSessionSnapshot>;\n\treadonly closeSession: () => Promise<void>;\n\treadonly prompt: (input: PromptInput | string, signal?: AbortSignal) => Promise<AssistantMessage>;\n\treadonly promptWithImages: (\n\t\ttext: string,\n\t\timages: readonly ImageContent[],\n\t\tsignal?: AbortSignal,\n\t) => Promise<AssistantMessage>;\n\treadonly steer: (input: PromptInput | string, signal?: AbortSignal) => Promise<void>;\n\treadonly steerWithImages: (text: string, images: readonly ImageContent[], signal?: AbortSignal) => Promise<void>;\n\treadonly retry: (signal?: AbortSignal) => Promise<AssistantMessage>;\n\treadonly cancel: (requestId: string) => boolean;\n\treadonly transcript: () => readonly Message[];\n\treadonly tree: SessionHost[\"tree\"];\n\treadonly navigateTree: SessionHost[\"navigateTree\"];\n\treadonly setModel: SessionHost[\"setModel\"];\n\treadonly setRuntime: (provider: Provider, model: Model) => Model;\n\treadonly cycleThinkingLevel: () => ThinkingLevel | undefined;\n\treadonly compact: SessionHost[\"compact\"];\n\treadonly setCompactionEnabled: SessionHost[\"setCompactionEnabled\"];\n\treadonly usage: SessionHost[\"usage\"];\n\treadonly subscribe: SessionHost[\"subscribe\"];\n}\n\n/** Stable facade passed to a custom TUI. It becomes unusable as soon as `dispose()` begins. */\nexport interface UiHost {\n\treadonly apiVersion: UiHostApiVersion;\n\treadonly signal: AbortSignal;\n\treadonly product: ProductHost;\n\treadonly session: UiSessionHost;\n\treadonly initialPrompt: string;\n\treadonly dispose: () => Promise<void>;\n}\n\nexport interface UiHostStartContext {\n\treadonly host: UiHost;\n\treadonly signal: AbortSignal;\n}\n\n/**\n * The only callback a replacement interactive host supplies. Resolve when its UI exits; reject to fail startup.\n * The product then aborts in-flight work, releases the Session/MCP resources, and invalidates the facade.\n */\nexport type UiHostStart = (context: UiHostStartContext) => void | Promise<void>;\n\nfunction isInteractiveHostRequest(value: unknown): value is InteractiveHostRequest {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"command\" in value &&\n\t\ttypeof value.command === \"object\" &&\n\t\tvalue.command !== null &&\n\t\t\"mode\" in value.command &&\n\t\tvalue.command.mode === \"interactive\" &&\n\t\t\"cwd\" in value &&\n\t\ttypeof value.cwd === \"string\" &&\n\t\t\"agentDir\" in value &&\n\t\ttypeof value.agentDir === \"string\" &&\n\t\t\"projectTrusted\" in value &&\n\t\ttypeof value.projectTrusted === \"boolean\" &&\n\t\t\"stderr\" in value &&\n\t\ttypeof value.stderr === \"function\"\n\t);\n}\n\nfunction snapshotSession(info: SessionInfo): UiHostSessionSnapshot {\n\treturn Object.freeze({\n\t\tid: info.id,\n\t\tlabel: info.label,\n\t\t...(info.modifiedAt === undefined ? {} : { modifiedAt: info.modifiedAt }),\n\t});\n}\n\nfunction createUiSession(host: SessionHost, isDisposed: () => boolean): UiSessionHost {\n\tconst assertLive = (): void => {\n\t\tif (isDisposed()) throw new UiHostLifecycleError();\n\t};\n\treturn {\n\t\tstate: () => {\n\t\t\tassertLive();\n\t\t\tconst state = host.state();\n\t\t\treturn Object.freeze({\n\t\t\t\tdisposed: false as const,\n\t\t\t\t...(state.activeSession ? { activeSession: snapshotSession(state.activeSession) } : {}),\n\t\t\t\tbusy: state.busy,\n\t\t\t\toperations: Object.freeze(\n\t\t\t\t\tstate.operations.map((operation) =>\n\t\t\t\t\t\tObject.freeze({ requestId: operation.requestId, kind: operation.kind as UiHostOperationKind }),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t});\n\t\t},\n\t\tlistSessions: async () => {\n\t\t\tassertLive();\n\t\t\treturn (await host.listSessions()).map(snapshotSession);\n\t\t},\n\t\tcreateSession: async () => {\n\t\t\tassertLive();\n\t\t\treturn snapshotSession(await host.createSession());\n\t\t},\n\t\topenSession: async (sessionId) => {\n\t\t\tassertLive();\n\t\t\treturn snapshotSession(await host.openSession(sessionId));\n\t\t},\n\t\tcloseSession: async () => {\n\t\t\tassertLive();\n\t\t\tawait host.closeSession();\n\t\t},\n\t\tprompt: (input, signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.prompt(input, signal);\n\t\t},\n\t\tpromptWithImages: (text, images, signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.promptWithImages(text, images, signal);\n\t\t},\n\t\tsteer: (input, signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.steer(input, signal);\n\t\t},\n\t\tsteerWithImages: (text, images, signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.steerWithImages(text, images, signal);\n\t\t},\n\t\tretry: (signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.retry(signal);\n\t\t},\n\t\tcancel: (requestId) => {\n\t\t\tassertLive();\n\t\t\treturn host.cancel(requestId);\n\t\t},\n\t\ttranscript: () => {\n\t\t\tassertLive();\n\t\t\treturn host.transcript();\n\t\t},\n\t\ttree: () => {\n\t\t\tassertLive();\n\t\t\treturn host.tree();\n\t\t},\n\t\tnavigateTree: (entryId) => {\n\t\t\tassertLive();\n\t\t\treturn host.navigateTree(entryId);\n\t\t},\n\t\tsetModel: (modelId) => {\n\t\t\tassertLive();\n\t\t\treturn host.setModel(modelId);\n\t\t},\n\t\tsetRuntime: (provider, model) => {\n\t\t\tassertLive();\n\t\t\treturn host.setRuntime(provider.id, model.id);\n\t\t},\n\t\tcycleThinkingLevel: () => {\n\t\t\tassertLive();\n\t\t\treturn host.cycleThinkingLevel();\n\t\t},\n\t\tcompact: (signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.compact(signal);\n\t\t},\n\t\tsetCompactionEnabled: (enabled) => {\n\t\t\tassertLive();\n\t\t\treturn host.setCompactionEnabled(enabled);\n\t\t},\n\t\tusage: () => {\n\t\t\tassertLive();\n\t\t\treturn host.usage();\n\t\t},\n\t\tsubscribe: (listener) => {\n\t\t\tassertLive();\n\t\t\treturn host.subscribe(listener);\n\t\t},\n\t};\n}\n\nfunction createUiHost(\n\tcontext: Context,\n\trequest: InteractiveHostRequest,\n\thost: SessionHost,\n\tsignal: AbortSignal,\n\tlocale: Locale,\n): UiHost {\n\tlet disposed = false;\n\tconst assertLive = (): void => {\n\t\tif (disposed) throw new UiHostLifecycleError();\n\t};\n\tconst product: ProductHost = {\n\t\tapiVersion: UI_HOST_API_VERSION,\n\t\tlocale,\n\t\tprojectTrusted: request.projectTrusted,\n\t\tresources: () => {\n\t\t\tassertLive();\n\t\t\tconst session = host.ui();\n\t\t\treturn Object.freeze({\n\t\t\t\tmodels: Object.freeze([...session.availableModels]),\n\t\t\t\tskills: Object.freeze(\n\t\t\t\t\tsession.availableSkills.map((skill) =>\n\t\t\t\t\t\tObject.freeze({ name: skill.name, description: skill.description, scope: skill.scope }),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t});\n\t\t},\n\t\tthemes: {\n\t\t\tlist: () => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(themeRegistryKey).list() as readonly {\n\t\t\t\t\treadonly name: string;\n\t\t\t\t\treadonly theme: TuiTheme;\n\t\t\t\t}[];\n\t\t\t},\n\t\t\tregister: (name, theme) => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(themeRegistryKey).register(name, theme);\n\t\t\t},\n\t\t},\n\t\tkeybindings: {\n\t\t\tsnapshot: () => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(keybindingRegistryKey).snapshot() as KeybindingsConfig;\n\t\t\t},\n\t\t\tset: (bindings) => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(keybindingRegistryKey).set(bindings);\n\t\t\t},\n\t\t},\n\t\tdiagnostics: {\n\t\t\treport: (message) => {\n\t\t\t\tassertLive();\n\t\t\t\trequest.stderr(`${redactSensitiveText(message)}\\n`);\n\t\t\t},\n\t\t\tsnapshot: () => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(diagnosticsKey).records.map((record) =>\n\t\t\t\t\tObject.freeze({\n\t\t\t\t\t\ttype: record.type,\n\t\t\t\t\t\t...(record.message ? { message: redactSensitiveText(record.message) } : {}),\n\t\t\t\t\t\t...(record.pluginName ? { pluginName: record.pluginName } : {}),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t};\n\tconst api: UiHost = {\n\t\tapiVersion: UI_HOST_API_VERSION,\n\t\tsignal,\n\t\tproduct,\n\t\tsession: createUiSession(host, () => disposed),\n\t\tinitialPrompt: request.command.prompt,\n\t\tdispose: async () => {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tawait host.dispose();\n\t\t},\n\t};\n\treturn api;\n}\n\nasync function runUiHost(context: Context, input: unknown, start: UiHostStart, signal?: AbortSignal): Promise<number> {\n\tif (!isInteractiveHostRequest(input)) throw new TypeError(\"Interactive host request is invalid\");\n\tconst request = input;\n\tconst configuration = await loadStartupConfiguration(request.cwd, process.env, request.agentDir);\n\tconst runtime = shouldStartProviderOnboarding(request.command, true, configuration)\n\t\t? await runProviderOnboarding({ configuration, terminal: new ProcessTerminal(), agentDir: request.agentDir })\n\t\t: resolveStartupRuntime(configuration.environment, configuration.providers, configuration.defaults);\n\tif (!runtime) return 0;\n\tconst host = await createSessionHost(context, {\n\t\tcwd: request.cwd,\n\t\tagentDir: request.agentDir,\n\t\tprojectTrusted: request.projectTrusted,\n\t\tnoSkills: request.command.noSkills,\n\t\tnoContextFiles: request.command.noContextFiles,\n\t\tskillPaths: request.command.skillPaths,\n\t\tprovider: runtime.provider,\n\t\tmodel: runtime.model,\n\t\tsignal,\n\t\t...(request.command.sessionPath ? { initialSessionPath: resolve(request.cwd, request.command.sessionPath) } : {}),\n\t});\n\tif (!host.state().activeSession) await host.createSession();\n\tconst ui = createUiHost(context, request, host, signal ?? new AbortController().signal, configuration.locale ?? \"en\");\n\ttry {\n\t\tconst started = Promise.resolve(start({ host: ui, signal: ui.signal }));\n\t\tif (signal === undefined) await started;\n\t\telse {\n\t\t\tlet onAbort: (() => void) | undefined;\n\t\t\tconst cancelled = new Promise<never>((_resolve, reject) => {\n\t\t\t\tonAbort = () => reject(signal.reason ?? new DOMException(\"The operation was aborted.\", \"AbortError\"));\n\t\t\t\tif (signal.aborted) {\n\t\t\t\t\tonAbort();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tawait Promise.race([started, cancelled]);\n\t\t\t} finally {\n\t\t\t\tif (onAbort) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t} finally {\n\t\tawait ui.dispose();\n\t}\n}\n\n/**\n * Creates a composition entry that replaces `interactive-host` without granting command-registry access.\n * The returned entry owns the product bootstrap and always disposes its UiHost after `start` settles.\n */\nexport function createUiHostEntry(start: UiHostStart): PluginDefinition {\n\treturn {\n\t\tapiVersion: UI_HOST_API_VERSION,\n\t\tname: \"ui-host\",\n\t\tapply: (context, _config, fiber) => {\n\t\t\tconst registry = context.require(hostCommandRegistryKey);\n\t\t\tfiber.addDisposer(registry.register(\"interactive\", (input, signal) => runUiHost(context, input, start, signal)));\n\t\t},\n\t};\n}\n"]}
1
+ {"version":3,"file":"ui-host.js","sourceRoot":"","sources":["../src/ui-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACpH,OAAO,EAAuC,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAA0B,eAAe,EAAiB,MAAM,cAAc,CAAC;AAEtF,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,EACN,iBAAiB,GAKjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAA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OAAO;oBAAE,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC3D,CAAC;QACF,CAAC;QACD,OAAO,CAAC,CAAC;IACV,CAAC;YAAS,CAAC;QACV,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAkB;IACnD,OAAO;QACN,UAAU,EAAE,mBAAmB;QAC/B,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;YAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;YACzD,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAClH,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import { resolve } from \"node:path\";\nimport type { AssistantMessage, ImageContent, Message, Model, Provider, ThinkingLevel } from \"@di-code/ai\";\nimport { diagnosticsKey, hostCommandRegistryKey, keybindingRegistryKey, themeRegistryKey } from \"@di-code/builtins\";\nimport { type Context, type PluginDefinition, redactSensitiveText } from \"@di-code/plugin-runtime\";\nimport { type KeybindingsConfig, ProcessTerminal, type TuiTheme } from \"@di-code/tui\";\nimport type { Locale } from \"./i18n.ts\";\nimport { runProviderOnboarding, shouldStartProviderOnboarding } from \"./provider-onboarding.ts\";\nimport type { InteractiveHostRequest } from \"./runtime/interactive-host-service.ts\";\nimport {\n\tcreateSessionHost,\n\ttype PromptInput,\n\ttype SessionHost,\n\ttype SessionHostEvent,\n\ttype SessionInfo,\n} from \"./runtime/session-host.ts\";\nimport { loadStartupConfiguration, resolveStartupRuntime } from \"./startup.ts\";\n\n/** Version of the stable in-process custom TUI contract. */\nexport const UI_HOST_API_VERSION = 1 as const;\n\nexport type UiHostApiVersion = typeof UI_HOST_API_VERSION;\n\nexport type UiHostErrorCode =\n\t| \"INVALID_WORKSPACE\"\n\t| \"NOT_FOUND\"\n\t| \"BUSY\"\n\t| \"SESSION_IN_USE\"\n\t| \"DISPOSED\"\n\t| \"INVALID_INPUT\"\n\t| \"INTERNAL\";\n\n/** Errors from SessionHost-owned operations expose a stable code but not internal causes. */\nexport interface UiHostError extends Error {\n\treadonly code: UiHostErrorCode;\n}\n\n/** Thrown synchronously when a facade is used after host disposal begins. */\nexport class UiHostLifecycleError extends Error {\n\treadonly code = \"DISPOSED\" as const;\n\tconstructor() {\n\t\tsuper(\"UiHost has been disposed.\");\n\t\tthis.name = \"UiHostLifecycleError\";\n\t}\n}\n\nexport type UiHostEvent = SessionHostEvent;\n\nexport interface UiHostSessionSnapshot {\n\treadonly id: string;\n\treadonly label: string;\n\treadonly modifiedAt?: number;\n}\n\nexport type UiHostOperationKind = \"prompt\" | \"steer\" | \"retry\" | \"compact\" | \"tree\" | \"session\";\n\n/** Read-only Session state that intentionally omits managed paths and internal Session references. */\nexport interface UiHostSessionState {\n\treadonly disposed: false;\n\treadonly activeSession?: UiHostSessionSnapshot;\n\treadonly busy: boolean;\n\treadonly operations: readonly { readonly requestId: string; readonly kind: UiHostOperationKind }[];\n}\n\n/** Read-only resources selected by product bootstrap for this TUI lifetime. */\nexport interface UiHostResourceSnapshot {\n\treadonly models: readonly Model[];\n\treadonly skills: readonly { readonly name: string; readonly description: string; readonly scope: string }[];\n}\n\nexport interface UiHostDiagnostics {\n\t/** Writes redacted diagnostic text to the CLI diagnostic stream. */\n\treport(message: string): void;\n\t/** Returns a read-only snapshot of runtime diagnostics known when it is called. */\n\tsnapshot(): readonly { readonly type: string; readonly message?: string; readonly pluginName?: string }[];\n}\n\nexport interface UiHostThemeRegistry {\n\treadonly list: () => readonly { readonly name: string; readonly theme: TuiTheme }[];\n\t/** Registration belongs to the plugin Fiber and is removed during composition disposal. */\n\treadonly register: (name: string, theme: TuiTheme) => () => void;\n}\n\nexport interface UiHostKeybindingRegistry {\n\treadonly snapshot: () => KeybindingsConfig;\n\t/** Replaces the presentation keybinding snapshot for this composition scope. */\n\treadonly set: (bindings: KeybindingsConfig) => () => void;\n}\n\n/** Product-scoped facilities. It deliberately does not expose command execution or bootstrap service keys. */\nexport interface ProductHost {\n\treadonly apiVersion: UiHostApiVersion;\n\treadonly locale: Locale;\n\treadonly projectTrusted: boolean;\n\treadonly resources: () => UiHostResourceSnapshot;\n\treadonly themes: UiHostThemeRegistry;\n\treadonly keybindings: UiHostKeybindingRegistry;\n\treadonly diagnostics: UiHostDiagnostics;\n}\n\n/** A lifecycle-checked view over the current product Session, never an AgentSession instance. */\nexport interface UiSessionHost {\n\treadonly state: () => UiHostSessionState;\n\treadonly listSessions: () => Promise<readonly UiHostSessionSnapshot[]>;\n\treadonly createSession: () => Promise<UiHostSessionSnapshot>;\n\treadonly openSession: (sessionId: string) => Promise<UiHostSessionSnapshot>;\n\treadonly closeSession: () => Promise<void>;\n\treadonly prompt: (input: PromptInput | string, signal?: AbortSignal) => Promise<AssistantMessage>;\n\treadonly promptWithImages: (\n\t\ttext: string,\n\t\timages: readonly ImageContent[],\n\t\tsignal?: AbortSignal,\n\t) => Promise<AssistantMessage>;\n\treadonly steer: (input: PromptInput | string, signal?: AbortSignal) => Promise<void>;\n\treadonly steerWithImages: (text: string, images: readonly ImageContent[], signal?: AbortSignal) => Promise<void>;\n\treadonly retry: (signal?: AbortSignal) => Promise<AssistantMessage>;\n\treadonly cancel: (requestId: string) => boolean;\n\treadonly transcript: () => readonly Message[];\n\treadonly tree: SessionHost[\"tree\"];\n\treadonly navigateTree: SessionHost[\"navigateTree\"];\n\treadonly setModel: SessionHost[\"setModel\"];\n\treadonly setRuntime: (provider: Provider, model: Model) => Model;\n\treadonly cycleThinkingLevel: () => ThinkingLevel | undefined;\n\treadonly compact: SessionHost[\"compact\"];\n\treadonly setCompactionEnabled: SessionHost[\"setCompactionEnabled\"];\n\treadonly usage: SessionHost[\"usage\"];\n\treadonly subscribe: SessionHost[\"subscribe\"];\n}\n\n/** Stable facade passed to a custom TUI. It becomes unusable as soon as `dispose()` begins. */\nexport interface UiHost {\n\treadonly apiVersion: UiHostApiVersion;\n\treadonly signal: AbortSignal;\n\treadonly product: ProductHost;\n\treadonly session: UiSessionHost;\n\treadonly initialPrompt: string;\n\treadonly dispose: () => Promise<void>;\n}\n\nexport interface UiHostStartContext {\n\treadonly host: UiHost;\n\treadonly signal: AbortSignal;\n}\n\n/**\n * The only callback a replacement interactive host supplies. Resolve when its UI exits; reject to fail startup.\n * The product then aborts in-flight work, releases the Session/MCP resources, and invalidates the facade.\n */\nexport type UiHostStart = (context: UiHostStartContext) => void | Promise<void>;\n\nfunction isInteractiveHostRequest(value: unknown): value is InteractiveHostRequest {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"command\" in value &&\n\t\ttypeof value.command === \"object\" &&\n\t\tvalue.command !== null &&\n\t\t\"mode\" in value.command &&\n\t\tvalue.command.mode === \"interactive\" &&\n\t\t\"cwd\" in value &&\n\t\ttypeof value.cwd === \"string\" &&\n\t\t\"agentDir\" in value &&\n\t\ttypeof value.agentDir === \"string\" &&\n\t\t\"projectTrusted\" in value &&\n\t\ttypeof value.projectTrusted === \"boolean\" &&\n\t\t\"stderr\" in value &&\n\t\ttypeof value.stderr === \"function\"\n\t);\n}\n\nfunction snapshotSession(info: SessionInfo): UiHostSessionSnapshot {\n\treturn Object.freeze({\n\t\tid: info.id,\n\t\tlabel: info.label,\n\t\t...(info.modifiedAt === undefined ? {} : { modifiedAt: info.modifiedAt }),\n\t});\n}\n\nfunction createUiSession(host: SessionHost, isDisposed: () => boolean): UiSessionHost {\n\tconst assertLive = (): void => {\n\t\tif (isDisposed()) throw new UiHostLifecycleError();\n\t};\n\treturn {\n\t\tstate: () => {\n\t\t\tassertLive();\n\t\t\tconst state = host.state();\n\t\t\treturn Object.freeze({\n\t\t\t\tdisposed: false as const,\n\t\t\t\t...(state.activeSession ? { activeSession: snapshotSession(state.activeSession) } : {}),\n\t\t\t\tbusy: state.busy,\n\t\t\t\toperations: Object.freeze(\n\t\t\t\t\tstate.operations.map((operation) =>\n\t\t\t\t\t\tObject.freeze({ requestId: operation.requestId, kind: operation.kind as UiHostOperationKind }),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t});\n\t\t},\n\t\tlistSessions: async () => {\n\t\t\tassertLive();\n\t\t\treturn (await host.listSessions()).map(snapshotSession);\n\t\t},\n\t\tcreateSession: async () => {\n\t\t\tassertLive();\n\t\t\treturn snapshotSession(await host.createSession());\n\t\t},\n\t\topenSession: async (sessionId) => {\n\t\t\tassertLive();\n\t\t\treturn snapshotSession(await host.openSession(sessionId));\n\t\t},\n\t\tcloseSession: async () => {\n\t\t\tassertLive();\n\t\t\tawait host.closeSession();\n\t\t},\n\t\tprompt: (input, signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.prompt(input, signal);\n\t\t},\n\t\tpromptWithImages: (text, images, signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.promptWithImages(text, images, signal);\n\t\t},\n\t\tsteer: (input, signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.steer(input, signal);\n\t\t},\n\t\tsteerWithImages: (text, images, signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.steerWithImages(text, images, signal);\n\t\t},\n\t\tretry: (signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.retry(signal);\n\t\t},\n\t\tcancel: (requestId) => {\n\t\t\tassertLive();\n\t\t\treturn host.cancel(requestId);\n\t\t},\n\t\ttranscript: () => {\n\t\t\tassertLive();\n\t\t\treturn host.transcript();\n\t\t},\n\t\ttree: () => {\n\t\t\tassertLive();\n\t\t\treturn host.tree();\n\t\t},\n\t\tnavigateTree: (entryId) => {\n\t\t\tassertLive();\n\t\t\treturn host.navigateTree(entryId);\n\t\t},\n\t\tsetModel: (modelId) => {\n\t\t\tassertLive();\n\t\t\treturn host.setModel(modelId);\n\t\t},\n\t\tsetRuntime: (provider, model) => {\n\t\t\tassertLive();\n\t\t\treturn host.setRuntime(provider.id, model.id);\n\t\t},\n\t\tcycleThinkingLevel: () => {\n\t\t\tassertLive();\n\t\t\treturn host.cycleThinkingLevel();\n\t\t},\n\t\tcompact: (signal) => {\n\t\t\tassertLive();\n\t\t\treturn host.compact(signal);\n\t\t},\n\t\tsetCompactionEnabled: (enabled) => {\n\t\t\tassertLive();\n\t\t\treturn host.setCompactionEnabled(enabled);\n\t\t},\n\t\tusage: () => {\n\t\t\tassertLive();\n\t\t\treturn host.usage();\n\t\t},\n\t\tsubscribe: (listener) => {\n\t\t\tassertLive();\n\t\t\treturn host.subscribe(listener);\n\t\t},\n\t};\n}\n\nfunction createUiHost(\n\tcontext: Context,\n\trequest: InteractiveHostRequest,\n\thost: SessionHost,\n\tsignal: AbortSignal,\n\tlocale: Locale,\n): UiHost {\n\tlet disposed = false;\n\tconst assertLive = (): void => {\n\t\tif (disposed) throw new UiHostLifecycleError();\n\t};\n\tconst product: ProductHost = {\n\t\tapiVersion: UI_HOST_API_VERSION,\n\t\tlocale,\n\t\tprojectTrusted: request.projectTrusted,\n\t\tresources: () => {\n\t\t\tassertLive();\n\t\t\tconst session = host.ui();\n\t\t\treturn Object.freeze({\n\t\t\t\tmodels: Object.freeze([...session.availableModels]),\n\t\t\t\tskills: Object.freeze(\n\t\t\t\t\tsession.availableSkills.map((skill) =>\n\t\t\t\t\t\tObject.freeze({ name: skill.name, description: skill.description, scope: skill.scope }),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t});\n\t\t},\n\t\tthemes: {\n\t\t\tlist: () => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(themeRegistryKey).list() as readonly {\n\t\t\t\t\treadonly name: string;\n\t\t\t\t\treadonly theme: TuiTheme;\n\t\t\t\t}[];\n\t\t\t},\n\t\t\tregister: (name, theme) => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(themeRegistryKey).register(name, theme);\n\t\t\t},\n\t\t},\n\t\tkeybindings: {\n\t\t\tsnapshot: () => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(keybindingRegistryKey).snapshot() as KeybindingsConfig;\n\t\t\t},\n\t\t\tset: (bindings) => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(keybindingRegistryKey).set(bindings);\n\t\t\t},\n\t\t},\n\t\tdiagnostics: {\n\t\t\treport: (message) => {\n\t\t\t\tassertLive();\n\t\t\t\trequest.stderr(`${redactSensitiveText(message)}\\n`);\n\t\t\t},\n\t\t\tsnapshot: () => {\n\t\t\t\tassertLive();\n\t\t\t\treturn context.require(diagnosticsKey).records.map((record) =>\n\t\t\t\t\tObject.freeze({\n\t\t\t\t\t\ttype: record.type,\n\t\t\t\t\t\t...(record.message ? { message: redactSensitiveText(record.message) } : {}),\n\t\t\t\t\t\t...(record.pluginName ? { pluginName: record.pluginName } : {}),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t};\n\tconst api: UiHost = {\n\t\tapiVersion: UI_HOST_API_VERSION,\n\t\tsignal,\n\t\tproduct,\n\t\tsession: createUiSession(host, () => disposed),\n\t\tinitialPrompt: request.command.prompt,\n\t\tdispose: async () => {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tawait host.dispose();\n\t\t},\n\t};\n\treturn api;\n}\n\nasync function runUiHost(context: Context, input: unknown, start: UiHostStart, signal?: AbortSignal): Promise<number> {\n\tif (!isInteractiveHostRequest(input)) throw new TypeError(\"Interactive host request is invalid\");\n\tconst request = input;\n\tconst configuration = await loadStartupConfiguration(request.cwd, process.env, request.agentDir);\n\tconst runtime = shouldStartProviderOnboarding(request.command, true, configuration)\n\t\t? await runProviderOnboarding({ configuration, terminal: new ProcessTerminal(), agentDir: request.agentDir })\n\t\t: resolveStartupRuntime(configuration.environment, configuration.providers, configuration.defaults);\n\tif (!runtime) return 0;\n\tconst host = await createSessionHost(context, {\n\t\tcwd: request.cwd,\n\t\tagentDir: request.agentDir,\n\t\tprojectTrusted: request.projectTrusted,\n\t\tnoSkills: request.command.noSkills,\n\t\tnoContextFiles: request.command.noContextFiles,\n\t\tskillPaths: request.command.skillPaths,\n\t\tprovider: runtime.provider,\n\t\tmodel: runtime.model,\n\t\tsignal,\n\t\tplanMode: {\n\t\t\tsection: \"You are in plan mode. Explore and design before presenting the complete plan through exit_plan_mode.\",\n\t\t},\n\t\t...(request.command.sessionPath ? { initialSessionPath: resolve(request.cwd, request.command.sessionPath) } : {}),\n\t});\n\tif (!host.state().activeSession) await host.createSession();\n\tconst ui = createUiHost(context, request, host, signal ?? new AbortController().signal, configuration.locale ?? \"en\");\n\ttry {\n\t\tconst started = Promise.resolve(start({ host: ui, signal: ui.signal }));\n\t\tif (signal === undefined) await started;\n\t\telse {\n\t\t\tlet onAbort: (() => void) | undefined;\n\t\t\tconst cancelled = new Promise<never>((_resolve, reject) => {\n\t\t\t\tonAbort = () => reject(signal.reason ?? new DOMException(\"The operation was aborted.\", \"AbortError\"));\n\t\t\t\tif (signal.aborted) {\n\t\t\t\t\tonAbort();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tawait Promise.race([started, cancelled]);\n\t\t\t} finally {\n\t\t\t\tif (onAbort) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t} finally {\n\t\tawait ui.dispose();\n\t}\n}\n\n/**\n * Creates a composition entry that replaces `interactive-host` without granting command-registry access.\n * The returned entry owns the product bootstrap and always disposes its UiHost after `start` settles.\n */\nexport function createUiHostEntry(start: UiHostStart): PluginDefinition {\n\treturn {\n\t\tapiVersion: UI_HOST_API_VERSION,\n\t\tname: \"ui-host\",\n\t\tapply: (context, _config, fiber) => {\n\t\t\tconst registry = context.require(hostCommandRegistryKey);\n\t\t\tfiber.addDisposer(registry.register(\"interactive\", (input, signal) => runUiHost(context, input, start, signal)));\n\t\t},\n\t};\n}\n"]}
@@ -0,0 +1 @@
1
+ :root{color:#18202a;font-synthesis:none;--ink:#18202a;--muted:#77808c;--line:#e6e8eb;--sidebar:#f1f3f5;--surface:#fff;--accent:#2957d6;--accent-soft:#e9efff;background:#f7f8fa;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}body{background:#f7f8fa;min-width:320px;min-height:100vh;margin:0;overflow:hidden}button,textarea,input{font:inherit}button{cursor:pointer;border:0}button:focus-visible,input:focus-visible,textarea:focus-visible{outline-offset:2px;outline:2px solid #5b7bea}.app-shell{grid-template-columns:264px minmax(0,1fr);height:100vh;min-height:0;display:grid;overflow:hidden}.app-shell.sidebar-collapsed{grid-template-columns:68px minmax(0,1fr)}.sidebar{background:var(--sidebar);border-right:1px solid var(--line);flex-direction:column;min-height:0;padding:16px 12px 12px;display:flex;overflow:hidden}.sidebar-topline{align-items:center;gap:9px;height:34px;padding:0 4px;display:flex}.mark{color:#fff;background:#1e2732;border-radius:7px;flex:none;place-items:center;width:26px;height:26px;display:grid}.wordmark{flex:1;font-size:15px;font-weight:700}.icon-button{color:#6f7884;background:0 0;border-radius:6px;flex:none;place-items:center;width:32px;height:32px;display:inline-grid}.icon-button:hover,.icon-button.is-active{color:var(--ink);background:#e4e7eb}.workspace-switcher{text-align:left;width:100%;color:var(--ink);background:0 0;border-radius:6px;align-items:center;gap:9px;margin-top:22px;padding:8px;font-size:13px;display:flex}.workspace-switcher:hover{background:#e7eaed}.workspace-avatar{color:#fff;background:#3c7b6e;border-radius:6px;place-items:center;width:23px;height:23px;font-size:11px;font-weight:700;display:grid}.workspace-name{min-width:0;color:inherit;appearance:none;cursor:pointer;background:0 0;border:0;outline:0;flex:1;font-weight:600}.workspace-switcher svg{pointer-events:none;flex:none}.new-session{color:#fff;background:#25303c;border-radius:6px;align-items:center;gap:9px;width:100%;margin-top:18px;padding:10px 9px;font-size:13px;display:flex}.new-session:hover{background:#344151}.shortcut{color:#aeb7c2;margin-left:auto;font-size:11px}.session-search{color:#8c949f;background:#e8ebee;border-radius:6px;align-items:center;gap:8px;height:34px;margin-top:12px;padding:0 9px;display:flex}.session-search input{width:100%;min-width:0;color:var(--ink);background:0 0;border:0;outline:0;font-size:12px}.session-search input::placeholder{color:#8c949f}.session-heading{color:#8b939e;text-transform:uppercase;letter-spacing:.06em;align-items:center;gap:7px;margin:24px 9px 8px;font-size:11px;font-weight:650;display:flex}.session-count{color:#9da4ad}.session-tree{flex:1;min-height:90px;overflow:auto}.tree-placeholder{color:#a0a8b1;margin:0;padding:12px 10px;font-size:12px;line-height:1.45}.session-item{color:#66707c;text-align:left;background:0 0;border-radius:5px;align-items:center;gap:8px;width:100%;padding:8px 9px;font-size:12px;display:flex}.session-item:hover{color:var(--ink);background:#e4e7ea}.session-item span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.sidebar-footer{border-top:1px solid #e1e4e7;gap:2px;padding-top:12px;display:grid}.footer-button{color:#6f7884;text-align:left;background:0 0;border-radius:5px;align-items:center;gap:9px;padding:9px;font-size:12px;display:flex}.footer-button:hover{color:var(--ink);background:#e5e8eb}.is-collapsed .sidebar-topline{justify-content:center}.is-collapsed .icon-button{display:none}.is-collapsed .sidebar-topline .icon-button{display:inline-grid}.collapsed-actions{justify-items:center;gap:8px;margin-top:20px;display:grid}.main-column{flex-direction:column;min-width:0;min-height:0;display:flex;overflow:hidden}.workspace-bar{border-bottom:1px solid var(--line);background:#ffffffc7;align-items:center;gap:10px;height:58px;padding:0 22px;display:flex}.workspace-bar>.icon-button{display:none}.bar-title{align-items:center;gap:8px;font-size:13px;font-weight:650;display:flex}.bar-title-dot{background:#3c7b6e;border-radius:50%;width:8px;height:8px}.bar-actions{align-items:center;gap:4px;margin-left:auto;display:flex}.bar-action{color:#6e7783;background:0 0;border-radius:5px;align-items:center;gap:7px;padding:7px 10px;font-size:12px;display:flex}.bar-action:hover{color:var(--ink);background:#f0f2f4}.main-content{flex-direction:column;flex:1;min-height:0;display:flex;position:relative;overflow-y:auto}.empty-state{text-align:center;width:min(560px,100% - 40px);margin:auto;transform:translateY(-6vh)}.empty-icon{color:#536273;background:#e9edf1;border:1px solid #dde2e7;border-radius:12px;place-items:center;width:46px;height:46px;margin:0 auto 18px;display:grid}.empty-state h1{margin:0;font-size:26px;font-weight:680;line-height:1.2}.empty-state p{max-width:420px;color:var(--muted);margin:12px auto 18px;font-size:14px;line-height:1.5}.example-link{color:var(--accent);background:var(--accent-soft);border-radius:5px;align-items:center;gap:6px;padding:7px 10px;font-size:12px;display:inline-flex}.composer-wrap{width:min(760px,100% - 40px);margin:auto auto 24px}.composer{background:var(--surface);border:1px solid #d9dde2;border-radius:9px;box-shadow:0 5px 20px #26303e0f}.composer textarea{resize:none;width:100%;min-height:58px;max-height:180px;color:var(--ink);background:0 0;border:0;outline:0;padding:15px 16px 8px;font-size:14px;display:block}.composer textarea::placeholder{color:#9aa2ad}.composer-toolbar{align-items:center;gap:3px;padding:7px 9px 9px;display:flex}.composer-tool{color:#788390;background:0 0;border-radius:5px;place-items:center;width:29px;height:29px;display:grid}.composer-spacer{flex:1}.model-select{color:#727c88;background:0 0;border-radius:5px;align-items:center;gap:6px;padding:6px 8px;font-size:11px;display:flex}.send-button{color:#fff;background:#25303c;border-radius:6px;place-items:center;width:30px;height:30px;display:grid}.send-button:disabled{color:#b7bec6;background:#e3e6e9}.composer-note{color:#a5acb5;text-align:center;margin:8px 0 0;font-size:10px}.loading-state{color:var(--muted);margin:auto;font-size:13px}.connection-banner{color:#90534f;background:#fff3f1;border:1px solid #f1d6d1;border-radius:6px;margin:16px auto 0;padding:9px 12px;font-size:12px}.session-item.is-active{color:var(--ink);background:#e4e7ea}.workspace-heading{color:#8b939e;text-transform:uppercase;letter-spacing:.06em;align-items:center;gap:7px;margin:22px 9px 8px;font-size:11px;font-weight:650;display:flex}.workspace-heading-actions{align-items:center;gap:1px;margin-left:auto;display:inline-flex}.workspace-heading-actions .icon-button{width:28px;height:28px}.workspace-add-overlay{z-index:30;background:#191f2640;place-items:center;padding:24px;display:grid;position:fixed;inset:0}.workspace-add-dialog{width:min(420px,100%);color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:18px;box-shadow:0 16px 48px #12192133}.workspace-pick-button{width:100%;color:var(--ink);border:1px solid var(--line);background:#f0f2f4;border-radius:5px;align-items:center;gap:7px;margin-top:18px;padding:10px 12px;font-size:12px;display:inline-flex}.workspace-pick-button:hover{background:#e7eaed}.workspace-drop-zone{color:var(--muted);text-align:center;border:1px dashed #b9c2cc;border-radius:6px;justify-items:center;gap:6px;margin-top:16px;padding:22px 12px;display:grid}.workspace-drop-zone svg{color:#5a789d}.workspace-drop-zone span{color:var(--ink);font-size:12px}.workspace-drop-zone small{font-size:11px}.workspace-add-header{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;padding-bottom:14px;display:flex}.workspace-add-header h2{margin:0;font-size:18px}.workspace-add-note{color:var(--muted);margin:16px 0 0;font-size:12px;line-height:1.5}.workspace-add-field{color:var(--muted);gap:7px;margin-top:18px;font-size:12px;display:grid}.workspace-add-field input{width:100%;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:9px 10px;font-size:13px}.workspace-add-error{color:#9b453e;margin:10px 0 0;font-size:12px}.workspace-add-actions{justify-content:flex-end;gap:8px;margin-top:18px;display:flex}.workspace-add-actions button{color:var(--muted);background:0 0;border-radius:5px;padding:7px 11px;font-size:12px}.workspace-add-actions button:hover{color:var(--ink);background:#f0f2f4}.workspace-add-actions .workspace-add-submit{color:#fff;background:#25303c}.workspace-add-actions .workspace-add-submit:disabled{color:#aab2bb;cursor:not-allowed;background:#e3e6e9}.workspace-search{margin-top:0}.workspace-list{flex:1;min-height:90px;padding:2px 0 10px;overflow:auto}.workspace-section{margin:2px 0}.workspace-section-header-wrap{border-radius:6px;align-items:center;min-width:0;display:flex;position:relative}.workspace-section-header-wrap:hover,.workspace-section.is-active>.workspace-section-header-wrap{background:#e4e7ea}.workspace-section-header{color:#5f6975;text-align:left;background:0 0;border-radius:6px;flex:1;align-items:center;gap:8px;min-width:0;padding:8px;font-size:13px;display:flex}.workspace-section-header-wrap:hover .workspace-section-header,.workspace-section.is-active>.workspace-section-header-wrap .workspace-section-header{color:var(--ink)}.workspace-folder-icon{color:#65717e;flex:none;place-items:center;width:17px;height:17px;display:grid;position:relative}.workspace-folder-icon>svg:last-child{display:none;position:absolute}.workspace-section-header-wrap:hover .workspace-folder-icon>svg:first-child{display:none}.workspace-section-header-wrap:hover .workspace-folder-icon>svg:last-child{display:block}.workspace-section.is-active>.workspace-section-header-wrap .workspace-folder-icon{color:#376fda}.workspace-section-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-weight:600;overflow:hidden}.workspace-session-count{color:#929aa5;font-size:11px}.workspace-row-actions{opacity:0;align-items:center;gap:1px;padding-right:4px;display:inline-flex}.workspace-section-header-wrap:hover .workspace-row-actions,.workspace-section.is-active>.workspace-section-header-wrap .workspace-row-actions,.workspace-row-actions:focus-within{opacity:1}.workspace-row-actions .icon-button{width:26px;height:26px}.workspace-menu-anchor{position:relative}.workspace-action-menu{z-index:9;min-width:132px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:6px;gap:2px;padding:5px;display:grid;position:absolute;top:calc(100% + 3px);right:0;box-shadow:0 10px 28px #17202b29}.workspace-action-menu button{color:inherit;text-align:left;background:0 0;border-radius:4px;padding:7px 8px;font-size:11px}.workspace-action-menu button:hover{background:#f0f2f4}.workspace-inline-name{border:1px solid var(--line);min-width:0;color:var(--ink);background:var(--surface);border-radius:4px;flex:1;padding:3px 5px;font-size:12px}.workspace-section-sessions{padding:0 0 4px 17px}.workspace-section-sessions .session-tree{min-height:0;overflow:visible}.workspace-section-sessions .session-item{padding-top:7px;padding-bottom:7px}.workspace-section-sessions .session-item-actions{margin-right:2px}.session-search svg{flex:none}.session-item-wrap{align-items:center;gap:2px;min-width:0;display:flex;position:relative}.session-item-wrap .session-item{flex:1;min-width:0}.session-item-actions{opacity:0;flex:none;display:flex;position:relative}.session-item-wrap:hover .session-item-actions,.session-item-wrap.is-active .session-item-actions,.session-item-actions:focus-within{opacity:1}.session-item-actions button{color:var(--muted);background:0 0;border:0;padding:4px}.session-more{border-radius:4px;place-items:center;display:grid}.session-more:hover,.session-more:focus-visible{color:var(--ink);background:#e4e7eb}.session-action-menu{z-index:9;background:var(--surface);border:1px solid var(--line);border-radius:6px;gap:2px;min-width:128px;padding:5px;display:grid;position:absolute;top:calc(100% + 3px);right:0;box-shadow:0 10px 28px #17202b29}.session-action-menu button{width:100%;color:var(--ink);text-align:left;border-radius:4px;align-items:center;gap:7px;padding:7px 8px;font-size:11px;display:flex}.session-action-menu button:hover{background:#f0f2f4}.session-filters{gap:4px;margin:6px 0;display:flex}.session-filters button{border:1px solid var(--line);color:var(--muted);background:0 0;border-radius:4px;padding:3px 7px;font-size:11px}.session-filters .is-selected{background:var(--accent-soft);color:var(--ink)}.session-inspect{z-index:20;background:var(--surface);border:1px solid var(--line);padding:18px;position:fixed;inset:12% 10%;overflow:auto;box-shadow:0 20px 60px #12192133}.session-inspect pre{white-space:pre-wrap;font-size:11px}.cancel-button{background:#9b453e}.attachment-input{display:none}.attachment-tray{flex-wrap:wrap;gap:6px;padding:10px 12px 0;display:flex}.attachment-chip{color:#536273;background:#edf0f3;border:1px solid #dfe4e8;border-radius:5px;align-items:center;gap:5px;max-width:100%;padding:5px 6px;font-size:11px;display:inline-flex}.attachment-chip span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.attachment-chip button{color:inherit;background:0 0;padding:1px;display:grid}.attachment-chip img{object-fit:cover;border-radius:3px;width:18px;height:18px}.connection-state{color:#5c6671;background:#eff2f5;border:1px solid #dbe0e5;border-radius:6px;align-self:center;margin-top:16px;padding:9px 12px;font-size:12px}.transcript{overflow-wrap:anywhere;gap:22px;width:min(760px,100% - 40px);margin:26px auto 16px;display:grid}.conversation-tabs{border-bottom:1px solid var(--line);gap:18px;width:min(760px,100% - 40px);margin:18px auto 0;display:flex}.conversation-tabs button{color:var(--muted);background:0 0;border-bottom:2px solid #0000;padding:9px 2px 10px;font-size:12px}.conversation-tabs button.is-selected{color:var(--ink);border-bottom-color:var(--accent);font-weight:650}.trajectory{gap:10px;width:min(760px,100% - 40px);min-height:180px;margin:18px auto 16px;display:grid;overflow:auto}.trajectory-row{color:var(--muted);grid-template-columns:18px minmax(0,1fr);align-items:start;gap:8px;font-size:12px;display:grid}.trajectory-row>svg{margin-top:10px}.trajectory-empty{color:var(--muted);font-size:13px}.trajectory-context,.trajectory-row.compaction-running,.trajectory-row.compaction-success,.trajectory-row.compaction-error{border:1px solid var(--line);background:var(--surface);border-radius:6px;padding:10px 12px}.trajectory-context summary{cursor:pointer;color:var(--ink);align-items:center;gap:7px;display:flex}.trajectory-context ul{gap:4px;margin:8px 0 0;padding-left:22px;display:grid}.trajectory-context li{color:var(--muted);justify-content:space-between;gap:8px;display:flex}.trajectory-context code{color:var(--ink);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.tool-card{border:1px solid var(--line);background:var(--surface);min-width:0;color:var(--ink);border-radius:7px;overflow:hidden}.tool-card-header{align-items:center;gap:7px;padding:10px 12px;display:flex}.tool-icon{color:#2f7a65;place-items:center;display:inline-grid}.tool-error .tool-icon,.tool-timeout .tool-icon,.tool-cancelled .tool-icon{color:#a04e48}.tool-status{color:var(--muted);margin-left:auto;font-size:11px}.tool-card-details,.tool-output,.tool-diff{border-top:1px solid var(--line);padding:8px 12px}.tool-card-details summary,.tool-output summary,.tool-diff summary{cursor:pointer;color:var(--muted);align-items:center;gap:5px;font-size:11px;display:flex}.tool-card pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;color:var(--ink);margin:8px 0 0;font:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;overflow:auto}.approval-bar{gap:6px;width:min(760px,100% - 40px);margin:0 auto 10px;display:grid}.approval-item{color:#77501f;background:#fff8e8;border:1px solid #ead9ad;border-radius:6px;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 12px;font-size:12px;display:flex}.approval-item button{color:var(--ink);background:var(--surface);border:1px solid #d8cda9;border-radius:4px;align-items:center;gap:4px;padding:5px 8px;font-size:11px;display:inline-flex}.approval-item button:first-of-type{margin-left:auto}.approval-item code{color:#9a8864;font-size:10px}.interaction-bar{gap:6px;width:min(760px,100% - 40px);margin:14px auto 0;display:grid}.interaction-item{color:#315b73;background:#eef8fc;border:1px solid #cce4ee;border-radius:6px;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 12px;font-size:12px;display:flex}.interaction-actions{flex-wrap:wrap;gap:5px;margin-left:auto;display:inline-flex}.interaction-actions button{color:var(--ink);background:var(--surface);border:1px solid #c3dbe5;border-radius:4px;align-items:center;gap:4px;padding:5px 8px;font-size:11px;display:inline-flex}.web-extension-badge{color:#315b73;background:#e9f5fa;border:1px solid #cce4ee;border-radius:4px;align-items:center;padding:3px 7px;font-size:11px;display:inline-flex}.web-review-panel{width:min(760px,100% - 40px);color:var(--ink);border:1px solid var(--line);background:#f7f8fa;border-radius:6px;align-items:center;gap:10px;margin:10px auto;padding:10px 12px;font-size:12px;display:flex}.web-review-panel button{color:var(--accent);background:var(--accent-soft);border-radius:4px;margin-left:auto;padding:5px 8px;font-size:11px}.web-composer-placeholder{color:var(--muted);font-size:11px}.spin{animation:.9s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.conversation-empty{color:var(--muted);margin:auto;font-size:13px}.message{gap:7px;display:grid}.message-user{background:#edf1f5;border-radius:7px;justify-self:end;max-width:min(88%,620px);padding:12px 14px}.message-label{color:var(--muted);font-size:11px;font-weight:700}.message-body{font-size:14px;line-height:1.65}.message-user .message-body{white-space:pre-wrap}.message-body>:first-child{margin-top:0}.message-body>:last-child{margin-bottom:0}.message-body p,.message-body ul,.message-body ol,.message-body blockquote,.message-body pre,.message-body table{margin:0 0 12px}.message-body h1,.message-body h2,.message-body h3,.message-body h4,.message-body h5,.message-body h6{color:var(--ink);margin:18px 0 8px;line-height:1.3}.message-body h1{font-size:22px}.message-body h2{font-size:19px}.message-body h3{font-size:16px}.message-body h4,.message-body h5,.message-body h6{font-size:14px}.message-body ul,.message-body ol{padding-left:24px}.message-body li+li{margin-top:4px}.message-body input[type=checkbox]{accent-color:var(--accent);margin:0 6px 0 0}.message-body a{color:var(--accent);text-underline-offset:2px;text-decoration:underline}.message-body a:hover{color:#1d45b5}.message-body :not(pre)>code{color:#4d5d70;background:#edf0f3;border:1px solid #e0e4e8;border-radius:4px;padding:2px 4px;font:.9em ui-monospace,SFMono-Regular,Consolas,monospace}.message-body pre{color:#dce5ee;background:#202a35;border-radius:6px;padding:12px;overflow:auto}.message-body pre code{font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace}.message-body blockquote{color:#566575;border-left:3px solid #aebdce;padding:2px 0 2px 12px}.message-body hr{background:var(--line);border:0;height:1px;margin:16px 0}.message-body table{border-spacing:0;border-collapse:collapse;max-width:100%;display:block;overflow-x:auto}.message-body th,.message-body td{border:1px solid var(--line);text-align:left;vertical-align:top;padding:7px 9px}.message-body th{background:#f2f4f6;font-weight:650}.message-skill{color:#536e9d;align-items:center;gap:6px;min-width:0;font-size:12px;display:inline-flex}.message-skill code{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:inherit;overflow:hidden}.message-images{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px;display:grid}.message-images img{object-fit:contain;background:#fff;border:1px solid #d8dde2;border-radius:5px;max-width:100%;max-height:360px;display:block}.tool-images{gap:8px;margin-top:8px;display:grid}.tool-images img{object-fit:contain;background:#fff;border:1px solid #d8dde2;border-radius:5px;max-width:100%;max-height:360px;display:block}.message-error{color:#8f3833;background:#fff2f0;border:1px solid #efcbc7;border-radius:6px;padding:10px 12px}.message-error .message-label{color:#9b453e}.thinking{color:#586574;background:#f3f5f7;border:1px solid #e1e5e8;border-radius:6px;padding:8px 10px;font-size:12px}.thinking summary{cursor:pointer;align-items:center;gap:6px;display:flex}.thinking pre{white-space:pre-wrap;font:inherit;margin:8px 0 0;line-height:1.55}.message-retry,.runtime-action{color:#55616e;background:#edf0f3;border-radius:5px;justify-content:center;align-items:center;gap:6px;width:fit-content;padding:6px 8px;font-size:11px;display:inline-flex}.runtime-controls{width:min(760px,100% - 40px);color:var(--muted);flex-wrap:wrap;align-items:center;gap:8px;margin:auto auto 10px;font-size:11px;display:flex}.usage{align-items:center;gap:6px;margin-right:auto;display:inline-flex}.usage span{border-left:1px solid var(--line);padding-left:6px}.runtime-action.danger,.runtime-error{color:#9b453e}.runtime-action.danger{background:#fff0ee}.overlay{z-index:10;background:#191f2642;place-items:center;padding:24px;display:grid;position:fixed;inset:0}.settings-panel{background:#fff;border:1px solid #dfe3e7;border-radius:10px;grid-template-columns:170px minmax(0,1fr);width:min(680px,100%);max-height:min(700px,100vh - 48px);display:grid;overflow:hidden;box-shadow:0 16px 50px #1219212e}.settings-header{border-bottom:1px solid var(--line);grid-column:1/-1;justify-content:space-between;align-items:flex-start;padding:22px;display:flex}.eyebrow{color:#9099a4;letter-spacing:.08em;text-transform:uppercase;margin:0 0 5px;font-size:10px;font-weight:700}.settings-header h2{margin:0;font-size:20px}.settings-nav{border-right:1px solid var(--line);background:#f7f8fa;padding:16px 10px}.settings-nav-item{color:#707a86;text-align:left;background:0 0;border-radius:5px;width:100%;padding:9px 10px;font-size:12px}.settings-nav-item.is-selected,.settings-nav-item:hover{color:var(--ink);background:#e8ecf2;font-weight:600}.settings-content{padding:16px 22px;overflow:auto}.setting-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:24px;padding:18px 0;display:flex}.setting-row>div:first-child{gap:5px;display:grid}.setting-row strong{font-size:13px}.setting-row span{color:var(--muted);font-size:11px}.setting-row code{color:#536273;background:#f1f3f5;border-radius:4px;padding:5px 7px;font-size:11px}.theme-options{gap:4px;display:flex!important}.theme-option{color:#78828e;background:#f3f5f7;border-radius:5px;align-items:center;gap:5px;padding:7px 8px;font-size:11px;display:inline-flex}.theme-option.is-selected{color:#254aab;background:#e7edff}@media (width<=800px){.app-shell,.app-shell.sidebar-collapsed{grid-template-columns:1fr}.sidebar{z-index:5;width:264px;transition:transform .18s;position:fixed;inset:0 auto 0 0;transform:translate(-101%);box-shadow:8px 0 24px #191f2614}.app-shell:not(.sidebar-collapsed) .sidebar{transform:translate(0)}.app-shell:not(.sidebar-collapsed):after{content:"";z-index:4;background:#191f262e;position:fixed;inset:0}.workspace-bar{padding:0 14px}.workspace-bar>.icon-button{display:inline-grid}.bar-actions .bar-action{display:none}.empty-state{transform:translateY(-4vh)}.composer-wrap{width:calc(100% - 24px);margin-bottom:14px}}@media (width<=480px){.workspace-bar{height:52px}.main-content{min-height:calc(100vh - 52px)}.empty-state{width:calc(100% - 32px)}.empty-state h1{font-size:22px}.empty-state p{font-size:13px}.composer textarea{min-height:52px}.settings-panel{grid-template-columns:1fr;max-height:calc(100vh - 24px)}.settings-nav{border-right:0;border-bottom:1px solid var(--line);gap:4px;display:flex;overflow-x:auto}.settings-nav-item{white-space:nowrap;width:auto}.settings-content{padding:8px 18px 18px}.setting-row{flex-direction:column;align-items:flex-start;gap:12px}.theme-options{flex-wrap:wrap}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@media (prefers-color-scheme:dark){:root{color:#e7ebf0;--ink:#e7ebf0;--muted:#9ca6b2;--line:#303842;--sidebar:#20262d;--surface:#242b33;--accent-soft:#283a6e;background:#1b2026}body{background:#1b2026}.workspace-bar{background:#1c2229e6}.mark,.new-session{background:#10161c}.session-search{background:#2b323a}.composer,.settings-panel{background:#242b33;border-color:#3a434e}.settings-nav{background:#20262d;border-color:#303842}.setting-row code,.theme-option{background:#303842}.empty-icon{color:#c5cfda;background:#303842;border-color:#3b4550}}[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-theme=light] body{background:#f7f8fa}[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--ink:#e7ebf0;--muted:#9ca6b2;--line:#303842;--sidebar:#20262d;--surface:#242b33;--accent-soft:#283a6e;background:#1b2026}[data-theme=dark] body{background:#1b2026}[data-theme=dark] .workspace-bar{background:#1c2229e6}[data-theme=dark] .sidebar{border-color:#303842}[data-theme=dark] .mark,[data-theme=dark] .new-session{background:#10161c}[data-theme=dark] .session-search{background:#2b323a}[data-theme=dark] .composer,[data-theme=dark] .settings-panel{background:#242b33;border-color:#3a434e}[data-theme=dark] .settings-nav{background:#20262d;border-color:#303842}[data-theme=dark] .setting-row code,[data-theme=dark] .theme-option{background:#303842}[data-theme=dark] .empty-icon{color:#c5cfda;background:#303842;border-color:#3b4550}.web-slot-sidebar,.web-slot-session-tree,.web-slot-settings{gap:6px;margin:8px 0;display:grid}.web-contribution-slot{max-width:100%;display:inline-flex}.web-contribution-badge,.web-contribution-tool{color:var(--muted);font-size:11px}.web-contribution-link{color:var(--accent);text-align:left;background:0 0;font-size:11px}.web-contribution-node{color:var(--muted);background:var(--surface);border-left:2px solid var(--accent);margin:6px 0;padding:6px 8px;font-size:11px}.app-shell.is-hero .main-column{background:var(--surface)}.app-shell.is-hero .main-content{overflow:hidden}.app-shell.is-hero .runtime-controls{display:none}.app-shell.is-hero .composer-wrap{margin:0 auto}.main-content.is-hero{justify-content:center}.main-content.is-hero .empty-state{margin:0 auto 18px;transform:none}.empty-brand{color:var(--ink);align-items:center;gap:8px;margin-bottom:18px;font-size:24px;font-weight:650;display:inline-flex}.empty-brand svg{color:#202936}.empty-brand small{color:#4770ba;background:#eaf0ff;border-radius:5px;padding:3px 6px;font-size:10px;font-weight:600}.hero-picker-row{justify-content:center;gap:18px;margin-top:30px;display:flex}.hero-picker{color:#596574;background:0 0;align-items:center;gap:6px;padding:5px 4px;font-size:12px;display:inline-flex}.hero-picker:hover{color:var(--ink)}.composer-hero{width:min(780px,100% - 40px);margin:0 auto}.composer-hero .composer{box-shadow:0 8px 32px #3657a01f}.composer-hero .composer-toolbar{padding-bottom:11px}.composer-hero textarea{min-height:68px;font-size:15px}.access-mode{color:#6e7783;background:0 0;border-radius:5px;align-items:center;gap:5px;padding:6px 7px;font-size:11px;display:inline-flex}.access-mode:hover,.model-select:hover,.context-meter:hover{color:var(--ink);background:#f0f2f4}.context-meter{color:#737e8a;background:0 0;border-radius:5px;min-width:31px;padding:6px;font-size:11px}.composer-menu-anchor{display:inline-flex;position:relative}.composer-menu{z-index:8;min-width:188px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:7px;gap:2px;padding:6px;display:grid;position:absolute;bottom:calc(100% + 8px);left:0;box-shadow:0 10px 28px #17202b24}.composer-menu-right{left:auto;right:0}.composer-menu button{width:100%;color:inherit;text-align:left;background:0 0;border-radius:4px;align-items:center;gap:8px;padding:8px;font-size:12px;display:flex}.composer-menu button:hover{background:#f0f2f4}.composer-command-menu button.is-selected{background:#e8ecf2}.composer-menu button:disabled{cursor:not-allowed;opacity:.48}.composer-command-menu{min-width:236px;max-height:min(380px,100vh - 140px);overflow-y:auto}.composer-command-menu .menu-item-copy strong{color:var(--ink);font-size:12px;font-weight:600}.composer-menu p,.composer-menu span,.composer-menu strong{margin:2px 4px;font-size:11px;line-height:1.45}.composer-menu p,.composer-menu span{color:var(--muted)}.menu-item-copy{flex:1;gap:1px;display:grid;color:var(--ink)!important;font-size:12px!important}.menu-item-copy small{color:var(--muted);font-size:10px}.menu-item-skill small{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.composer-model-menu{max-height:min(380px,100vh - 140px);overflow-y:auto}.composer-model-menu .menu-back{border-bottom:1px solid var(--line);border-radius:0;margin-bottom:4px}.model-group+.model-group{border-top:1px solid var(--line);margin-top:4px;padding-top:4px}.composer-menu .model-group>p{color:var(--muted);letter-spacing:.04em;text-transform:uppercase;margin:5px 8px 3px;font-size:10px;font-weight:700}.composer-menu .model-group button{justify-content:space-between}.composer-menu .model-group button[aria-checked=true]{color:#254aab;background:#eaf0ff}.composer-session-meta{min-height:34px;color:var(--muted);border-top:1px solid var(--line);align-items:center;gap:8px;padding:5px 12px 6px;font-size:11px;display:flex}.composer-plan-meta{color:#a35a13;background:#fff4e5;border:1px solid #f5d6ad;border-radius:999px;flex:none;align-items:center;gap:4px;min-height:29px;padding:4px 6px 4px 9px;font-size:11px;display:inline-flex}.composer-plan-meta.is-pending{color:#6d7480;background:#f2f4f6;border-color:#d9dde2}.composer-plan-meta button{width:18px;height:18px;color:inherit;border-radius:50%;place-items:center;display:grid}.composer-plan-meta button:hover{background:#00000014}.composer-loading{width:29px;height:29px;color:var(--muted);place-items:center;display:inline-grid}.composer-session-meta>span:not(.composer-spacer){align-items:center;gap:4px;display:inline-flex}.composer-session-meta>span:not(.composer-spacer)+span:not(.composer-spacer){border-left:1px solid var(--line);padding-left:8px}.composer-session-meta button{color:#55616e;background:#edf0f3;border-radius:5px;align-items:center;gap:5px;padding:5px 7px;font-size:11px;display:inline-flex}.composer-session-meta button:hover{color:var(--ink);background:#e5e9ed}.composer-runtime-error{color:#9b453e}.context-menu{min-width:174px}.bar-session-title{text-overflow:ellipsis;white-space:nowrap;max-width:min(38vw,280px);overflow:hidden}.bar-mode{color:var(--muted);align-items:center;gap:6px;font-size:12px;font-weight:400;display:inline-flex}.session-log{border:1px solid var(--line);border-radius:999px;padding-inline:12px}.session-log-panel{background:var(--surface);border:1px solid var(--line);border-radius:8px;width:min(430px,100%);padding:22px;box-shadow:0 16px 50px #1219212e}.session-log-panel header{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;padding-bottom:16px;display:flex}.session-log-panel h2{margin:0;font-size:19px}.session-log-panel dl{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0 0;display:grid}.session-log-panel dl div{background:#f4f6f8;border-radius:6px;padding:10px}.session-log-panel dt{color:var(--muted);font-size:11px}.session-log-panel dd{color:var(--ink);margin:4px 0 0;font-size:15px;font-weight:650}.conversation-tabs{margin-top:0;padding-top:10px}.main-content:not(.is-hero){background:var(--surface)}.main-content:not(.is-hero) .composer-wrap{z-index:3;background:linear-gradient(to bottom, transparent, var(--surface) 24px);margin-bottom:0;padding-top:24px;position:sticky;bottom:0}.main-content:not(.is-hero) .composer-note{padding-bottom:10px}.streaming-status{min-height:18px;color:var(--muted);align-items:center;gap:8px;font-size:12px;display:inline-flex}.turn-status{width:min(760px,100% - 40px);color:var(--muted);align-items:center;gap:8px;margin:0 auto 8px;font-size:12px;display:inline-flex}.compaction-status{width:min(760px,100% - 40px);color:var(--muted);align-items:center;gap:7px;margin:12px auto 8px;font-size:12px;display:flex}.streaming-dots{gap:3px;display:inline-flex}.streaming-dots i{background:currentColor;border-radius:50%;width:4px;height:4px;animation:1.1s ease-in-out infinite dot-bounce}.streaming-dots i:nth-child(2){animation-delay:.15s}.streaming-dots i:nth-child(3){animation-delay:.3s}@keyframes dot-bounce{0%,60%,to{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}.message{animation:.18s ease-out both message-in}@keyframes message-in{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}.message-actions{color:#9099a4;align-items:center;gap:4px;min-height:24px;display:flex}.message-actions button{width:26px;height:26px;color:inherit;background:0 0;border-radius:5px;place-items:center;display:inline-grid}.message-actions button:hover{color:var(--ink);background:#eef1f4}.message-complete{color:#6a7888;align-items:center;gap:4px;margin-left:5px;font-size:10px;display:inline-flex}.conversation-skeleton{gap:14px;width:min(760px,100% - 40px);margin:48px auto;display:grid}.skeleton-line,.skeleton-block{background:linear-gradient(90deg,#edf0f3 25%,#f7f8fa 50%,#edf0f3 75%) 0 0/200% 100%;border-radius:5px;animation:1.4s ease-in-out infinite skeleton-shimmer}.skeleton-line{height:12px}.skeleton-line-short{width:30%}.skeleton-line-medium{width:52%}.skeleton-line-long{width:70%}.skeleton-block{width:100%;height:92px}@keyframes skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.session-tree{min-width:0;overflow-x:hidden}.session-item-wrap{min-width:0}.session-item-actions,.session-item>svg{flex:none}.session-item span{flex:1;min-width:0}.activity-timeline{color:#788390;gap:4px;min-width:0;font-size:12px;display:grid}.activity-timeline-live{min-height:22px}.activity-row,.activity-row summary{grid-template-columns:16px auto auto minmax(0,1fr) auto;align-items:center;column-gap:6px;min-width:0;display:grid}.activity-row{min-height:22px}.activity-row summary{cursor:pointer;list-style:none}.activity-row summary::-webkit-details-marker{display:none}.activity-row strong{color:#687482;font-size:12px;font-weight:500}.activity-icon{color:#8a96a2;place-items:center;display:inline-grid}.activity-separator{color:#b1b8c0}.activity-summary{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.activity-status{color:#579178;place-items:center;display:inline-grid}.activity-loading .activity-status{color:#647cbb}.activity-error .activity-status,.activity-cancelled .activity-status,.activity-timeout .activity-status{color:#a4514a}.activity-thinking{display:block}.activity-thinking[open]{padding:5px 0 2px}.activity-thinking pre{max-height:220px;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere;background:#f4f6f8;border-left:2px solid #d9dfe5;margin:6px 0 0 22px;padding:8px 10px;font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;overflow:auto}.activity-row-live{animation:.22s ease-out both activity-in}@keyframes activity-in{0%{opacity:.35;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-color-scheme:dark){.activity-row strong{color:#bdc5cf}.activity-icon{color:#a5afbb}.activity-separator{color:#737e8a}.activity-thinking pre{background:#20262d;border-left-color:#3e4854}}[data-theme=dark] .activity-row strong{color:#bdc5cf}[data-theme=dark] .activity-icon{color:#a5afbb}[data-theme=dark] .activity-separator{color:#737e8a}[data-theme=dark] .activity-thinking pre{background:#20262d;border-left-color:#3e4854}@media (width<=800px){.main-content.is-hero{padding-bottom:12vh}.composer-hero{width:calc(100% - 24px)}.hero-picker-row{gap:10px;margin-top:22px}.empty-brand{font-size:20px}.main-content:not(.is-hero) .composer-wrap{padding-top:16px}.composer-menu{min-width:0;position:fixed;bottom:82px;left:12px;right:12px}.composer-menu-right{left:12px;right:12px}.composer-session-meta{flex-wrap:wrap;gap:6px;padding-inline:10px}.composer-session-meta .composer-spacer{display:none}}.settings-panel{grid-template-rows:auto minmax(0,1fr);height:min(700px,100dvh - 48px);max-height:min(700px,100dvh - 48px)}.settings-nav,.settings-content{min-height:0;overflow-y:auto}.toast{z-index:20;border:1px solid var(--line);border-radius:6px;align-items:flex-start;gap:10px;width:min(420px,100% - 32px);padding:10px 12px;font-size:12px;line-height:1.45;display:flex;position:fixed;bottom:24px;right:24px;box-shadow:0 12px 28px #12192129}.toast-error{color:#8d3d37;background:#fff4f2;border-color:#efcdc8}.toast span{overflow-wrap:anywhere;flex:1}.toast button{color:currentColor;background:0 0;border-radius:4px;flex:none;place-items:center;width:24px;height:24px;margin:-4px -5px -4px 0;display:inline-grid}.toast button:hover{background:#8d3d371a}.tree-overlay{z-index:14}.tree-dialog{width:min(760px,100%);max-height:min(680px,100dvh - 48px);color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:8px;grid-template-rows:auto minmax(0,1fr) auto;display:grid;overflow:hidden;box-shadow:0 16px 50px #1219212e}.tree-dialog-header,.tree-dialog-footer{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:16px 18px;display:flex}.tree-dialog-header h2{margin:0;font-size:16px}.tree-dialog-header .eyebrow{margin-bottom:3px}.tree-dialog-footer{border-top:1px solid var(--line);color:var(--muted);border-bottom:0;font-size:11px}.tree-dialog-list{min-height:160px;padding:8px;overflow:auto}.tree-dialog-node{width:100%;min-height:42px;color:var(--ink);text-align:left;background:0 0;border-radius:5px;grid-template-columns:auto 16px minmax(0,1fr);align-items:center;gap:7px;padding:6px 8px;display:grid}.tree-dialog-node:hover:not(:disabled),.tree-dialog-node.is-selected{background:#edf1f5}.tree-dialog-node:disabled{cursor:not-allowed;opacity:.54}.tree-dialog-branch{color:#a4adb7;white-space:pre;align-items:center;font:11px/1 ui-monospace,SFMono-Regular,Consolas,monospace;display:inline-flex}.tree-dialog-branch i{text-align:center;width:13px;font-style:normal;display:inline-block}.tree-dialog-branch b{font-weight:400}.tree-dialog-copy{gap:2px;min-width:0;display:grid}.tree-dialog-copy strong{color:#697582;font-size:10px;font-weight:650}.tree-dialog-copy span{color:var(--ink);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1.3;overflow:hidden}.tree-dialog-icon{color:#788390}.tree-dialog-you{color:#397eaa}.tree-dialog-assistant{color:#4b8f68}.tree-dialog-tool{color:#8d7b50}.tree-dialog-empty{color:var(--muted);margin:14px 10px;font-size:12px}.tree-continue{color:#fff;background:#25303c;border-radius:5px;align-items:center;gap:6px;padding:7px 9px;font-size:12px;display:inline-flex}.tree-continue:disabled{color:#aeb6c0;background:#e4e7ea}@media (width<=480px){.settings-panel{height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}.settings-nav{overflow:auto hidden}.toast{bottom:16px;right:16px}}.settings-section h3{margin:0 0 6px;font-size:16px}.settings-section-note{color:var(--muted);margin:0 0 12px;font-size:11px;line-height:1.45}.setting-row small{color:var(--muted);margin-top:4px;font-size:11px;display:block}.setting-row select,.model-controls select,.onboarding-panel select,.onboarding-panel input,.login-row input{min-width:150px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:7px 9px}.provider-list{gap:7px;display:grid}.provider-card{border:1px solid var(--line);border-radius:6px;align-items:center;gap:10px;padding:10px;display:flex}.provider-card.is-selected{background:var(--accent-soft);border-color:#7d9aee}.provider-card-main{color:var(--ink);text-align:left;background:0 0;flex:1;gap:3px;display:grid}.provider-card-main span,.provider-status,.readonly-note{color:var(--muted);font-size:11px}.status-settings{color:#3d6ca4}.status-environment{color:#5f6f61}.status-missing{color:#8c6c58}.model-controls{gap:12px;margin-top:14px;display:grid}.model-controls label,.onboarding-panel label{color:var(--muted);gap:6px;font-size:11px;display:grid}.login-row{flex-wrap:wrap;gap:7px;display:flex}.login-row button,.onboarding-panel button{color:#fff;background:#25303c;border-radius:5px;padding:8px 12px}.button-quiet{color:var(--ink)!important;background:#e9edf1!important}.settings-error{color:#90534f;background:#fff3f1;border:1px solid #f1d6d1;border-radius:5px;margin-bottom:10px;padding:8px 10px;font-size:11px}.settings-loading{color:var(--muted);font-size:12px}.onboarding-panel{background:var(--surface);border:1px solid var(--line);border-radius:8px;gap:12px;width:min(420px,100%);padding:24px;display:grid;box-shadow:0 16px 50px #1219212e}.onboarding-panel h2{margin:0;font-size:20px}.onboarding-panel p{color:var(--muted);margin:0;font-size:12px;line-height:1.45}.advanced-list{gap:6px;display:grid}.advanced-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:10px;padding:10px 0;display:flex}.advanced-row>div:first-child{gap:4px;min-width:0;display:grid}.advanced-row strong{overflow-wrap:anywhere;font-size:12px}.advanced-row span{color:var(--muted);overflow-wrap:anywhere;font-size:11px}.advanced-meta,.advanced-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px;display:flex}.advanced-meta code{color:#536273;background:#f1f3f5;border-radius:4px;padding:3px 5px;font-size:10px}.advanced-actions button,.inline-form button,.trust-toggle{color:var(--ink);border:1px solid var(--line);background:#edf0f3;border-radius:4px;padding:6px 8px;font-size:11px}.inline-form{flex-wrap:wrap;gap:6px;margin-top:14px;display:flex}.inline-form input,.inline-form select{min-width:0;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:5px;flex:1;padding:7px 8px;font-size:11px}.switch{color:var(--muted);white-space:nowrap;align-items:center;gap:6px;font-size:11px;display:inline-flex}.switch input{accent-color:var(--accent)}.trust-impact{background:var(--accent-soft);border:1px solid #cad6fa;border-radius:6px;gap:6px;margin:14px 0;padding:12px;display:grid}.trust-impact strong{font-size:13px}.trust-impact span,.trust-impact small{color:var(--muted);font-size:11px;line-height:1.4}.shortcut-list{color:var(--muted);gap:10px;font-size:12px;display:grid}.shortcut-list kbd{text-align:center;min-width:76px;color:var(--ink);border:1px solid var(--line);background:#edf0f3;border-bottom-width:2px;border-radius:4px;margin-right:8px;padding:4px 6px;font:11px ui-monospace,monospace;display:inline-block}.provider-selector{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;display:grid}.provider-choice{min-width:0;color:var(--ink);background:var(--surface);border:1px solid var(--line);text-align:left;border-radius:6px;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;padding:10px;display:grid}.provider-choice:hover{background:#f7f9fc;border-color:#b9c7df}.provider-choice.is-selected{background:var(--accent-soft);border-color:#6f8ee0}.provider-choice>span{gap:2px;min-width:0;display:grid}.provider-choice strong,.provider-choice small{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.provider-choice strong{font-size:12px}.provider-choice small{color:var(--muted);font-size:10px}.provider-choice em{white-space:nowrap;font-size:10px;font-style:normal}.provider-choice-custom{border-style:dashed;grid-column:span 2}.model-controls,.custom-provider-form{border-top:1px solid var(--line);gap:12px;margin-top:16px;padding-top:16px;display:grid}.model-controls h4,.custom-provider-heading h4{color:var(--ink);margin:0;font-size:13px}.custom-provider-heading{justify-content:space-between;align-items:center;gap:12px;display:flex}.custom-provider-heading>div{gap:3px;display:grid}.custom-provider-heading p{color:var(--muted);margin:0;font-size:11px}.custom-provider-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.custom-provider-grid label{min-width:0;color:var(--muted);gap:5px;font-size:11px;display:grid}.custom-provider-grid input,.custom-provider-grid select{width:100%;min-width:0;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:8px 9px}.custom-provider-wide{grid-column:1/-1}.custom-save{color:#fff;background:#25303c;border-radius:5px;justify-self:start;padding:8px 10px;font-size:12px}.custom-save:disabled{cursor:not-allowed;opacity:.48}.masked-key::placeholder{color:var(--ink);opacity:.72}.masked-key-indicator{color:var(--ink)}@media (width<=480px){.provider-selector,.custom-provider-grid{grid-template-columns:1fr}.provider-choice-custom,.custom-provider-wide{grid-column:auto}}.plugin-status{letter-spacing:.04em;text-transform:uppercase;border:1px solid;border-radius:999px;align-items:center;padding:3px 7px;font-size:10px;font-weight:700;display:inline-flex}.plugin-status-active{color:#2d7b55;background:#e8f5ee}.plugin-status-failed{color:#a4473f;background:#fff0ee}.plugin-status-skipped{color:#9a741e;background:#fff8df}.plugin-status-disabled{color:var(--muted);background:#f0f2f4}.plugin-error{color:#a4473f!important}.resource-trust-panel{max-width:500px}.resource-trust-actions{justify-content:flex-end;gap:8px;display:flex}