breadboard icon indicating copy to clipboard operation
breadboard copied to clipboard

Re-add sync bgl TS files to bgl.json script.

Open jameszhao00 opened this issue 11 months ago • 1 comments

Also perfom one off sync of TS files to bgl.json files.

I updated a2's tsconfig.json to match as closely as possible the module-editor's compiler options


Gemini generated summary of .bgl.json changes

The changes across the *.bgl.json files primarily involve code cleanup within the embedded JavaScript modules and some minor formatting adjustments.

Key Change Types:

  1. Widespread Removal of JavaScript Import Statements:
    • This is the most common change. Numerous import statements were removed from the code property of modules across almost all *.bgl.json files.
    • Examples:
      • packages/a2/bgl/_connector-template.bgl.json: Removed imports like err, ok from "./a2/utils".
      • packages/a2/bgl/a2.bgl.json: Extensive removals in modules like entry, join, tool-manager, worker-worker, agent-main, researcher, image-generator, structured-response, template, audio-generator, text-entry, make-code, gemini-prompt, image-editor, introducer, html-generator, render-outputs, lists, connector-manager, and image-utils. Specific utilities like toLLMContent, err, ok, llm, and references to ./common were frequently removed.
      • packages/a2/bgl/audio-generator.bgl.json: Removed imports for gemini, various utils, Template, ToolManager, and common.
      • packages/a2/bgl/fetch-workbench.bgl.json: Removed @output and @query imports.
      • packages/a2/bgl/generate-text.bgl.json: Removed utils like llm and listPrompt.
      • packages/a2/bgl/generate.bgl.json: Removed import for ./a2/common.
      • packages/a2/bgl/gmail.bgl.json: Removed utils, read, and write imports from configurator, and @describe from get-emails.
      • packages/a2/bgl/go-over-list.bgl.json: Extensive removals across most modules, including GeminiPrompt, gemini, common, various utils, report, StructuredResponse, plannerPrompt, getPlan, and types.
      • packages/a2/bgl/google-drive.bgl.json: Removed utils from configurator, modified fetch import in api, and removed @describe and utils from connector-save and connector-load.
      • packages/a2/bgl/mcp.bgl.json: Removed utils, read, write from configurator, @query from mcp-client, and err from connector-tools.
      • packages/a2/bgl/notebooklm-connector.bgl.json: Removed utils, read, and write from configurator.
      • packages/a2/bgl/tools.bgl.json: Removed imports like gemini, ToolManager, GeminiPrompt, utils, and fetch from search-web. Removed err from get-weather-tool, tool-search-web, tool-search-maps, and tool-search-enterprise.
      • packages/a2/bgl/video-generator.bgl.json: Removed imports for gemini, defaultSafetySettings, utils like err, llm, and common.
    • Reason: This likely indicates a refactoring where these dependencies are either no longer needed, are being provided by the execution environment, or the functionality has been inlined.
  2. Specific Import Statement Modifications:
    • In a few instances, import statements were slightly altered rather than completely removed.
    • Example:
      • packages/a2/bgl/a2.bgl.json (gemini-client module): import invokeGemini, {} from "./gemini"; changed to import invokeGemini from "./gemini";.
      • packages/a2/bgl/a2.bgl.json (gemini-prompt module): import gemini, {} from "./gemini"; changed to import invokeGemini from "./gemini"; (this might be a correction or a change in how gemini module exports its functions).
      • packages/a2/bgl/a2.bgl.json (connector-manager module): import describeConnector, {} from "@describe"; changed to import describeConnector from "@describe";.
      • packages/a2/bgl/google-drive.bgl.json (api module): import fetch, {} from "@fetch"; changed to import fetch from "@fetch";.
  3. Formatting Changes:
    • The tags and exports arrays at the top level of some BGL files were changed from a single-line array to a multi-line array format for better readability.
    • Files Affected:
      • packages/a2/bgl/gmail.bgl.json
      • packages/a2/bgl/mcp.bgl.json
      • packages/a2/bgl/notebooklm-connector.bgl.json
  4. Removal of Trailing Newlines:
    • Some files had their trailing newline character removed.
    • Files Affected:
      • packages/a2/bgl/gmail.bgl.json
      • packages/a2/bgl/mcp.bgl.json
      • packages/a2/bgl/notebooklm-connector.bgl.json
  5. Updates to TypeScript Source in Metadata:
    • In packages/a2/bgl/tools.bgl.json, the metadata.source.code (which contains the original TypeScript) for the search-maps and get-weather modules was updated. These changes appear to be related to TypeScript type definitions within the source code.
      • search-maps: TypeScript source shows changes related to type definitions, removing SearchMapsOutputs.
      • get-weather: TypeScript source shows changes to type definitions.

Overall, the changes to the .bgl.json files suggest a cleanup and standardization effort, especially concerning the embedded JavaScript code and its dependencies, alongside minor formatting improvements. The introduction of the sync-boards.ts script (seen in other parts of the diff) likely drives the updates to the code and metadata.source.code fields.

jameszhao00 avatar May 07 '25 05:05 jameszhao00

Pausing work on this, since it introduces quite a few mysterious changes to bgl.json.

From dmitry

the big problem that I see is that there are diffs in text that I can't explain like why does the fileoverview changes in tools.bgl.json

jameszhao00 avatar May 09 '25 03:05 jameszhao00