Skip to content

Conversation

@illume
Copy link
Contributor

@illume illume commented Nov 21, 2025

The main goal with this is to upgrade headlamp-plugin so we have better type checking and docs for things in the code.

But also to upgrade langchain and others so that building the next thing on top we can have the latest.

  • ai-assistant: .gitignore: Add missing things
  • ai-assistant: package.json: Add missing i18n script
  • ai-assistant ApiConfirmationDialog: Fix incorrect props used
  • ai-assistant ApiConfirmationDialog: Add todo for incorrect ts-ignore
  • ai-assistant ModelSelector: Fix incorrect label prop
  • ai-assistant: utils: Fix ConfigStore type
  • ai-assistant: textstream: Fix for custom theme attribute types
  • ai-assistant: index: utils: Fix event types and leave todos
  • ai-assistant: index: Fix ts error missing value attribute
  • ai-assistant: LangChainManager: Remove unused dangerouslyAllowBrowser prop
  • ai-assistant: LangChainManager: Remove unused tool_call_id prop
  • ai-assistant: LangChainManager: OutputParsers: Fix type issue
  • ai-assistant: ToolManager: Add ts-ignore for type issue for now
  • ai-assistant: Upgrade headlamp-plugin 0.13.0-alpha.14
  • ai-assistant: Upgrade langchain to 1.0.6
  • ai-assistant: Upgrade react-syntax-highlighter to 16.1.0
  • ai-assistant: Upgrade zod to 4.1.12

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Was using the wrong props for some labels.

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
@illume illume changed the title ai-assistant: Type fixing WIP: ai-assistant: Type fixing, upgrading headlamp-plugin Nov 21, 2025
@illume illume requested a review from joaquimrocha November 21, 2025 00:40
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
It was missing the required generic typing of the config.

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
@illume illume requested review from ashu8912 and removed request for joaquimrocha November 21, 2025 13:33
This code needs more fixing, but this is an improvement and
we can continue it later... and have the type checker work
for the rest of the code.

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
… prop

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Also fix a ts issue.

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
@illume illume force-pushed the ai-fixes branch 3 times, most recently from 9f289ad to 5251ef1 Compare November 21, 2025 18:50
@illume illume marked this pull request as ready for review November 21, 2025 19:01
@illume illume changed the title WIP: ai-assistant: Type fixing, upgrading headlamp-plugin WIP: ai-assistant: Type fixing, upgrading dependencies Nov 21, 2025
@illume illume changed the title WIP: ai-assistant: Type fixing, upgrading dependencies ai-assistant: Type fixing, upgrading dependencies Nov 21, 2025
@illume illume added the bug Something isn't working label Nov 21, 2025
Also need to change tsconfig so that langchain can work, because
it is no longer compatible with the other way of doing things.

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Also fix some issues related to the upgrade found with ts.

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
Copy link
Contributor

@skoeva skoeva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for all this work! left some comments

if (method.toUpperCase() === 'PUT' && showUpdateConfirm) {
return (
<ConfirmDialog
// @todo: open does exist on ConfirmDialog, but TS is not recognizing it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could handle this type issue within src/headlamp-plugin.d.ts

/// <reference types="@kinvolk/headlamp-plugin" />

import type { DialogProps as MuiDialogProps } from '@mui/material/Dialog';

declare module '@kinvolk/headlamp-plugin/lib/CommonComponents' {
  interface ConfirmDialogProps {
    /** Forwarded to the underlying MUI dialog */
    open: MuiDialogProps['open'];
  }
}

export const getSettingsURL = () => `/settings/plugins/${encodeURIComponent(PLUGIN_NAME)}`;

export const pluginStore = new ConfigStore(PLUGIN_NAME);
export const pluginStore = new ConfigStore<{ isUIPanelOpen?: boolean }>(PLUGIN_NAME);
Copy link
Contributor

@skoeva skoeva Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change gets overwritten by dadc8f7, maybe this commit can be dropped?

import ContentRenderer from './ContentRenderer';
import EditorDialog from './editordialog';

// declare module '@mui/material/styles' {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to include this commit with the commented-out block?

// };
// }
// }
declare module '@mui/material/styles' {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this needs to be moved to src/headlamp-plugin.d.ts, it's complaining about this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assistant bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants