diff --git a/.serena/cache/typescript/document_symbols_cache_v23-06-25.pkl b/.serena/cache/typescript/document_symbols_cache_v23-06-25.pkl deleted file mode 100644 index c4186c2..0000000 Binary files a/.serena/cache/typescript/document_symbols_cache_v23-06-25.pkl and /dev/null differ diff --git a/.serena/project.yml b/.serena/project.yml deleted file mode 100644 index 53447cb..0000000 --- a/.serena/project.yml +++ /dev/null @@ -1,68 +0,0 @@ -# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby) -# * For C, use cpp -# * For JavaScript, use typescript -# Special requirements: -# * csharp: Requires the presence of a .sln file in the project folder. -language: typescript - -# whether to use the project's gitignore file to ignore files -# Added on 2025-04-07 -ignore_all_files_in_gitignore: true -# list of additional paths to ignore -# same syntax as gitignore, so you can use * and ** -# Was previously called `ignored_dirs`, please update your config if you are using that. -# Added (renamed) on 2025-04-07 -ignored_paths: [] - -# whether the project is in read-only mode -# If set to true, all editing tools will be disabled and attempts to use them will result in an error -# Added on 2025-04-18 -read_only: false - - -# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details. -# Below is the complete list of tools for convenience. -# To make sure you have the latest list of tools, and to view their descriptions, -# execute `uv run scripts/print_tool_overview.py`. -# -# * `activate_project`: Activates a project by name. -# * `check_onboarding_performed`: Checks whether project onboarding was already performed. -# * `create_text_file`: Creates/overwrites a file in the project directory. -# * `delete_lines`: Deletes a range of lines within a file. -# * `delete_memory`: Deletes a memory from Serena's project-specific memory store. -# * `execute_shell_command`: Executes a shell command. -# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced. -# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type). -# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type). -# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes. -# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file. -# * `initial_instructions`: Gets the initial instructions for the current project. -# Should only be used in settings where the system prompt cannot be set, -# e.g. in clients you have no control over, like Claude Desktop. -# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol. -# * `insert_at_line`: Inserts content at a given line in a file. -# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol. -# * `list_dir`: Lists files and directories in the given directory (optionally with recursion). -# * `list_memories`: Lists memories in Serena's project-specific memory store. -# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building). -# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context). -# * `read_file`: Reads a file within the project directory. -# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store. -# * `remove_project`: Removes a project from the Serena configuration. -# * `replace_lines`: Replaces a range of lines within a file with new content. -# * `replace_symbol_body`: Replaces the full definition of a symbol. -# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen. -# * `search_for_pattern`: Performs a search for a pattern in the project. -# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase. -# * `switch_modes`: Activates modes by providing a list of their names -# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information. -# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task. -# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed. -# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store. -excluded_tools: [] - -# initial prompt for the project. It will always be given to the LLM upon activating the project -# (contrary to the memories, which are loaded on demand). -initial_prompt: "" - -project_name: "docker" diff --git a/changelog.md b/changelog.md index 1362820..8ebf4b7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,14 @@ # Changelog +## 2025-11-17 - 1.3.6 - fix(streaming) +Convert smartrequest v5 web ReadableStreams to Node.js streams and update deps for streaming compatibility + +- Upgrade @push.rocks/smartrequest to ^5.0.1 and bump @git.zone dev tooling (@git.zone/tsbuild, tsrun, tstest). +- requestStreaming now uses response.stream() (web ReadableStream) and converts it to a Node.js Readable via plugins.smartstream.nodewebhelpers.convertWebReadableToNodeReadable for backward compatibility. +- Updated consumers of streaming responses (DockerHost.getEventObservable, DockerImage.createFromTarStream, DockerImage.exportToTarStream) to work with the converted Node.js stream and preserve event/backpressure semantics (.on, .pause, .resume). +- Added readme.hints.md documenting the smartrequest v5 migration, conversion approach, modified files, and test/build status (type errors resolved and Node.js tests passing). +- Removed project metadata file (.serena/project.yml) from the repository. + ## 2025-08-19 - 1.3.5 - fix(core) Stabilize CI/workflows and runtime: update CI images/metadata, improve streaming requests and image handling, and fix tests & package metadata diff --git a/deno.lock b/deno.lock index 30bc4f1..39f5152 100644 --- a/deno.lock +++ b/deno.lock @@ -1,9 +1,9 @@ { "version": "5", "specifiers": { - "npm:@git.zone/tsbuild@^2.7.1": "2.7.1", - "npm:@git.zone/tsrun@^1.6.2": "1.6.2", - "npm:@git.zone/tstest@^2.7.0": "2.7.0", + "npm:@git.zone/tsbuild@^3.1.0": "3.1.0", + "npm:@git.zone/tsrun@2": "2.0.0", + "npm:@git.zone/tstest@^2.8.2": "2.8.2", "npm:@push.rocks/lik@^6.2.2": "6.2.2", "npm:@push.rocks/qenv@^6.1.3": "6.1.3", "npm:@push.rocks/smartarchive@^4.2.2": "4.2.2", @@ -14,7 +14,7 @@ "npm:@push.rocks/smartnetwork@^4.4.0": "4.4.0", "npm:@push.rocks/smartpath@6": "6.0.0", "npm:@push.rocks/smartpromise@^4.2.3": "4.2.3", - "npm:@push.rocks/smartrequest@^4.4.0": "4.4.0", + "npm:@push.rocks/smartrequest@^5.0.1": "5.0.1", "npm:@push.rocks/smartstream@^3.2.5": "3.2.5", "npm:@push.rocks/smartstring@^4.1.0": "4.1.0", "npm:@push.rocks/smartunique@^3.0.9": "3.0.9", @@ -72,7 +72,7 @@ "@push.rocks/smartopen", "@push.rocks/smartpath@6.0.0", "@push.rocks/smartpromise", - "@push.rocks/smartrequest@4.4.0", + "@push.rocks/smartrequest@4.4.2", "@push.rocks/smartrx", "@push.rocks/smartsitemap", "@push.rocks/smartstream", @@ -690,9 +690,9 @@ "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", "tarball": "https://verdaccio.lossless.digital/@borewit/text-codec/-/text-codec-0.1.1.tgz" }, - "@cloudflare/workers-types@4.20251115.0": { - "integrity": "sha512-aM7jp7IfKhqKvfSaK1IhVTbSzxB6KQ4gX8e/W29tOuZk+YHlYXuRd/bMm4hWkfd7B1HWNWdsx1GTaEUoZIuVsw==", - "tarball": "https://verdaccio.lossless.digital/@cloudflare/workers-types/-/workers-types-4.20251115.0.tgz" + "@cloudflare/workers-types@4.20251117.0": { + "integrity": "sha512-4U6phQE/qbmWuJX/0cTk3iOx9KyhWmo34okKb2BSS09UMRWLCwML+P3dnHxCHnSQij8c0orvdzMr9hyqgJGNgw==", + "tarball": "https://verdaccio.lossless.digital/@cloudflare/workers-types/-/workers-types-4.20251117.0.tgz" }, "@colors/colors@1.6.0": { "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", @@ -936,8 +936,8 @@ "cpu": ["x64"], "tarball": "https://verdaccio.lossless.digital/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz" }, - "@git.zone/tsbuild@2.7.1": { - "integrity": "sha512-O8TTc+LBp8hYy5+zA6AdoqdQQtVXTAd1L0gS/Ihz+QXgXvMdQKVINwpDFu6LS5NdVrGXzxnB63NQpfg5COIPnQ==", + "@git.zone/tsbuild@3.1.0": { + "integrity": "sha512-j8lMd84pmzWiU6NG3e+pyu0o41oo6mQVfcZv8kDsCrQwZMhoQV9Jp87MlU0i/XI5IZkqDjelG8Kx1QhOmbK+iQ==", "dependencies": [ "@git.zone/tspublish", "@push.rocks/early", @@ -950,10 +950,10 @@ "typescript@5.9.3" ], "bin": true, - "tarball": "https://verdaccio.lossless.digital/@git.zone/tsbuild/-/tsbuild-2.7.1.tgz" + "tarball": "https://verdaccio.lossless.digital/@git.zone/tsbuild/-/tsbuild-3.1.0.tgz" }, - "@git.zone/tsbundle@2.5.1": { - "integrity": "sha512-gBskgM3ECy9FEmhCWnQahDyFCAjjw/7emjx/KYM/FOlPqGV+hmYzt368zwSlkzOGgYF8k9OZ+mp6vexDL/+f2w==", + "@git.zone/tsbundle@2.5.2": { + "integrity": "sha512-EYTCfunqoxhxkowREZ+cJnww6eDh9cL18HJbHbSZ+vxzNeyS9x8mT9aqRlWkI7zgpvgDlGIYlyRUlUISXkQO6Q==", "dependencies": [ "@push.rocks/early", "@push.rocks/smartcli", @@ -972,7 +972,7 @@ "typescript@5.8.3" ], "bin": true, - "tarball": "https://verdaccio.lossless.digital/@git.zone/tsbundle/-/tsbundle-2.5.1.tgz" + "tarball": "https://verdaccio.lossless.digital/@git.zone/tsbundle/-/tsbundle-2.5.2.tgz" }, "@git.zone/tspublish@1.10.3": { "integrity": "sha512-o2/jvNsdLC8SRdH1kQ7JjNOQNu9el0FpJ/QOW3mgiC5C9reuTp18iU4kijsVVLgvw4KZv6Z289SoKPh3HPsS0g==", @@ -984,7 +984,7 @@ "@push.rocks/smartlog", "@push.rocks/smartnpm", "@push.rocks/smartpath@6.0.0", - "@push.rocks/smartrequest@4.4.0", + "@push.rocks/smartrequest@4.4.2", "@push.rocks/smartshell" ], "bin": true, @@ -1000,12 +1000,22 @@ "bin": true, "tarball": "https://verdaccio.lossless.digital/@git.zone/tsrun/-/tsrun-1.6.2.tgz" }, - "@git.zone/tstest@2.7.0": { - "integrity": "sha512-ET532UpIAE86Ifw4P1Y2U7AJalKxM/Q88+kKN854dXSX+s5GgnRy0ysrPcSCUkJfENEvou1b0er1xcotUKx6hw==", + "@git.zone/tsrun@2.0.0": { + "integrity": "sha512-yA6zCjL+kn7xfZe6sL/m4K+zYqgkznG/pF6++i/E17iwzpG6dHmW+VZmYldHe86sW4DcLMvqM6CxM+KlgaEpKw==", + "dependencies": [ + "@push.rocks/smartfile", + "@push.rocks/smartshell", + "tsx" + ], + "bin": true, + "tarball": "https://verdaccio.lossless.digital/@git.zone/tsrun/-/tsrun-2.0.0.tgz" + }, + "@git.zone/tstest@2.8.2": { + "integrity": "sha512-qIZFor1mT4+Xth24jbqZtrh2B2Vz2n27OVY1R22zEg4TgFldjEUVwIKz27axqK1HUA1PIw0mYn+vOgd+yMWO4w==", "dependencies": [ "@api.global/typedserver", "@git.zone/tsbundle", - "@git.zone/tsrun", + "@git.zone/tsrun@1.6.2", "@push.rocks/consolecolor", "@push.rocks/qenv", "@push.rocks/smartbrowser", @@ -1021,7 +1031,7 @@ "@push.rocks/smartnetwork", "@push.rocks/smartpath@6.0.0", "@push.rocks/smartpromise", - "@push.rocks/smartrequest@4.4.0", + "@push.rocks/smartrequest@4.4.2", "@push.rocks/smarts3", "@push.rocks/smartshell", "@push.rocks/smarttime", @@ -1030,7 +1040,7 @@ "ws@8.18.3" ], "bin": true, - "tarball": "https://verdaccio.lossless.digital/@git.zone/tstest/-/tstest-2.7.0.tgz" + "tarball": "https://verdaccio.lossless.digital/@git.zone/tstest/-/tstest-2.8.2.tgz" }, "@happy-dom/global-registrator@15.11.7": { "integrity": "sha512-mfOoUlIw8VBiJYPrl5RZfMzkXC/z7gbSpi2ecycrj/gRWLq2CMV+Q+0G+JPjeOmuNFgg0skEIzkVFzVYFP6URw==", @@ -1443,7 +1453,7 @@ "@push.rocks/smartfile", "@push.rocks/smartpath@6.0.0", "@push.rocks/smartpromise", - "@push.rocks/smartrequest@4.4.0", + "@push.rocks/smartrequest@4.4.2", "@push.rocks/smartrx", "@push.rocks/smartstream", "@push.rocks/smartunique", @@ -1543,8 +1553,8 @@ ], "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartcrypto/-/smartcrypto-2.0.4.tgz" }, - "@push.rocks/smartdata@5.16.4": { - "integrity": "sha512-COiKw8yk9iAcLN44WmZHG8Gi0v+HGkgM8Osoq7Cns+UsOA+grPepqbN2r0XPG1fm5vOdJcaydi2ZU0xrnbGVvQ==", + "@push.rocks/smartdata@5.16.7": { + "integrity": "sha512-bu/YSIjQcwxWXkAsuhqE6zs7eT+bTIKV8+/H7TbbjpzeioLCyB3dZ/41cLZk37c/EYt4d4GHgZ0ww80OiKOUMg==", "dependencies": [ "@push.rocks/lik", "@push.rocks/smartdelay", @@ -1559,7 +1569,7 @@ "@tsclass/tsclass@9.3.0", "mongodb" ], - "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartdata/-/smartdata-5.16.4.tgz" + "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartdata/-/smartdata-5.16.7.tgz" }, "@push.rocks/smartdelay@3.0.5": { "integrity": "sha512-mUuI7kj2f7ztjpic96FvRIlf2RsKBa5arw81AHNsndbxO6asRcxuWL8dTVxouEIK8YsBUlj0AsrCkHhMbLQdHw==", @@ -1649,7 +1659,7 @@ "@push.rocks/smartmime", "@push.rocks/smartpath@6.0.0", "@push.rocks/smartpromise", - "@push.rocks/smartrequest@4.4.0", + "@push.rocks/smartrequest@4.4.2", "@push.rocks/smartstream", "@types/fs-extra", "@types/js-yaml@4.0.9", @@ -1764,8 +1774,8 @@ ], "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartmime/-/smartmime-2.0.4.tgz" }, - "@push.rocks/smartmongo@2.0.12": { - "integrity": "sha512-NglYiO14BikxnlvW6JF18FtopBtaWQEGAtPxHmmSCbyhU8Mi0aEFO7VgCasE9Kguba/wcR597qhcDEdcpBg1eQ==", + "@push.rocks/smartmongo@2.0.14": { + "integrity": "sha512-fvfPeCDDy5JaDBpVnsMKednsOoRzuYC0OszO8OoLOX/RaR755zIbRppCCK8Cez0hqd6eNkJGQeWdX/vXlJOPBA==", "dependencies": [ "@push.rocks/mongodump", "@push.rocks/smartdata", @@ -1773,7 +1783,7 @@ "@push.rocks/smartpromise", "mongodb-memory-server" ], - "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartmongo/-/smartmongo-2.0.12.tgz" + "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartmongo/-/smartmongo-2.0.14.tgz" }, "@push.rocks/smartnetwork@4.4.0": { "integrity": "sha512-OvFtz41cvQ7lcXwaIOhghNUUlNoMxvwKDctbDvMyuZyEH08SpLjhyv2FuKbKL/mgwA/WxakTbohoC8SW7t+kiw==", @@ -1796,7 +1806,7 @@ "@push.rocks/smartfile", "@push.rocks/smartpath@6.0.0", "@push.rocks/smartpromise", - "@push.rocks/smartrequest@4.4.0", + "@push.rocks/smartrequest@4.4.2", "@push.rocks/smarttime", "@push.rocks/smartversion", "package-json" @@ -1887,8 +1897,8 @@ ], "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartrequest/-/smartrequest-2.1.0.tgz" }, - "@push.rocks/smartrequest@4.4.0": { - "integrity": "sha512-lls++Ddwom3FwL88U8LOfgmtyzEwBg3Jx2T6+C/FUcYsjKJ3xoau04ob8YtCUcBarjJhDpIPGpCY7dD00f3KCQ==", + "@push.rocks/smartrequest@4.4.2": { + "integrity": "sha512-Om4y1Ce4YdSu8VoXREz2SgFz9pDxcFEm0+SC1YYa3RXd0AH2Mknaj/1XfvfMqojnK9L7N2z1fY4xX8tO1IwqFQ==", "dependencies": [ "@push.rocks/smartenv@6.0.0", "@push.rocks/smartpath@6.0.0", @@ -1897,7 +1907,19 @@ "agentkeepalive", "form-data" ], - "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartrequest/-/smartrequest-4.4.0.tgz" + "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartrequest/-/smartrequest-4.4.2.tgz" + }, + "@push.rocks/smartrequest@5.0.1": { + "integrity": "sha512-gZQQF6HVt3LwTBxaPh6hHObd4VF76PUYQcs5pHD7f0VXaEewmrNAQSnccoinOY7fi45+0dOf04PJOXu9MibPzQ==", + "dependencies": [ + "@push.rocks/smartenv@6.0.0", + "@push.rocks/smartpath@6.0.0", + "@push.rocks/smartpromise", + "@push.rocks/smarturl", + "agentkeepalive", + "form-data" + ], + "tarball": "https://verdaccio.lossless.digital/@push.rocks/smartrequest/-/smartrequest-5.0.1.tgz" }, "@push.rocks/smartrouter@1.3.3": { "integrity": "sha512-1+xZEnWlhzqLWAaJ1zFNhQ0zgbfCWQl1DBT72LygLxTs+P0K8AwJKgqo/IX6CT55kGCFnPAZIYSbVJlGsgrB0w==", @@ -4362,8 +4384,8 @@ "integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==", "tarball": "https://verdaccio.lossless.digital/form-data-encoder/-/form-data-encoder-2.1.4.tgz" }, - "form-data@4.0.4": { - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "form-data@4.0.5": { + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", "dependencies": [ "asynckit", "combined-stream", @@ -4371,7 +4393,7 @@ "hasown", "mime-types@2.1.35" ], - "tarball": "https://verdaccio.lossless.digital/form-data/-/form-data-4.0.4.tgz" + "tarball": "https://verdaccio.lossless.digital/form-data/-/form-data-4.0.5.tgz" }, "format@0.2.2": { "integrity": "d6170107e9efdc4ed30c9dc39016df942b5cb58b", @@ -7192,9 +7214,9 @@ "workspace": { "packageJson": { "dependencies": [ - "npm:@git.zone/tsbuild@^2.7.1", - "npm:@git.zone/tsrun@^1.6.2", - "npm:@git.zone/tstest@^2.7.0", + "npm:@git.zone/tsbuild@^3.1.0", + "npm:@git.zone/tsrun@2", + "npm:@git.zone/tstest@^2.8.2", "npm:@push.rocks/lik@^6.2.2", "npm:@push.rocks/qenv@^6.1.3", "npm:@push.rocks/smartarchive@^4.2.2", @@ -7205,7 +7227,7 @@ "npm:@push.rocks/smartnetwork@^4.4.0", "npm:@push.rocks/smartpath@6", "npm:@push.rocks/smartpromise@^4.2.3", - "npm:@push.rocks/smartrequest@^4.4.0", + "npm:@push.rocks/smartrequest@^5.0.1", "npm:@push.rocks/smartstream@^3.2.5", "npm:@push.rocks/smartstring@^4.1.0", "npm:@push.rocks/smartunique@^3.0.9", diff --git a/package.json b/package.json index a566c3f..183fd0e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@push.rocks/smartnetwork": "^4.4.0", "@push.rocks/smartpath": "^6.0.0", "@push.rocks/smartpromise": "^4.2.3", - "@push.rocks/smartrequest": "^4.4.0", + "@push.rocks/smartrequest": "^5.0.1", "@push.rocks/smartstream": "^3.2.5", "@push.rocks/smartstring": "^4.1.0", "@push.rocks/smartunique": "^3.0.9", @@ -51,9 +51,9 @@ "rxjs": "^7.8.2" }, "devDependencies": { - "@git.zone/tsbuild": "^2.7.1", - "@git.zone/tsrun": "^1.6.2", - "@git.zone/tstest": "^2.7.0", + "@git.zone/tsbuild": "^3.1.0", + "@git.zone/tsrun": "^2.0.0", + "@git.zone/tstest": "^2.8.2", "@push.rocks/qenv": "^6.1.3", "@types/node": "22.7.5" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2022d3b..b5e2b3b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ importers: specifier: ^4.2.3 version: 4.2.3 '@push.rocks/smartrequest': - specifier: ^4.4.0 - version: 4.4.0 + specifier: ^5.0.1 + version: 5.0.1 '@push.rocks/smartstream': specifier: ^3.2.5 version: 3.2.5 @@ -58,14 +58,14 @@ importers: version: 7.8.2 devDependencies: '@git.zone/tsbuild': - specifier: ^2.7.1 - version: 2.7.1 + specifier: ^3.1.0 + version: 3.1.0 '@git.zone/tsrun': - specifier: ^1.6.2 - version: 1.6.2 + specifier: ^2.0.0 + version: 2.0.0 '@git.zone/tstest': - specifier: ^2.7.0 - version: 2.7.0(socks@2.8.7)(typescript@5.9.3) + specifier: ^2.8.2 + version: 2.8.2(socks@2.8.7)(typescript@5.9.3) '@push.rocks/qenv': specifier: ^6.1.3 version: 6.1.3 @@ -256,8 +256,8 @@ packages: '@borewit/text-codec@0.1.1': resolution: {integrity: sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==} - '@cloudflare/workers-types@4.20251115.0': - resolution: {integrity: sha512-aM7jp7IfKhqKvfSaK1IhVTbSzxB6KQ4gX8e/W29tOuZk+YHlYXuRd/bMm4hWkfd7B1HWNWdsx1GTaEUoZIuVsw==} + '@cloudflare/workers-types@4.20251117.0': + resolution: {integrity: sha512-4U6phQE/qbmWuJX/0cTk3iOx9KyhWmo34okKb2BSS09UMRWLCwML+P3dnHxCHnSQij8c0orvdzMr9hyqgJGNgw==} '@colors/colors@1.6.0': resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} @@ -443,12 +443,12 @@ packages: cpu: [x64] os: [win32] - '@git.zone/tsbuild@2.7.1': - resolution: {integrity: sha512-O8TTc+LBp8hYy5+zA6AdoqdQQtVXTAd1L0gS/Ihz+QXgXvMdQKVINwpDFu6LS5NdVrGXzxnB63NQpfg5COIPnQ==} + '@git.zone/tsbuild@3.1.0': + resolution: {integrity: sha512-j8lMd84pmzWiU6NG3e+pyu0o41oo6mQVfcZv8kDsCrQwZMhoQV9Jp87MlU0i/XI5IZkqDjelG8Kx1QhOmbK+iQ==} hasBin: true - '@git.zone/tsbundle@2.5.1': - resolution: {integrity: sha512-gBskgM3ECy9FEmhCWnQahDyFCAjjw/7emjx/KYM/FOlPqGV+hmYzt368zwSlkzOGgYF8k9OZ+mp6vexDL/+f2w==} + '@git.zone/tsbundle@2.5.2': + resolution: {integrity: sha512-EYTCfunqoxhxkowREZ+cJnww6eDh9cL18HJbHbSZ+vxzNeyS9x8mT9aqRlWkI7zgpvgDlGIYlyRUlUISXkQO6Q==} hasBin: true '@git.zone/tspublish@1.10.3': @@ -459,8 +459,12 @@ packages: resolution: {integrity: sha512-SOHbQqBg3/769/jPQcdpPCmugdEtIJINiG0O6aWx+su91GvGhheha5dAhccsCutJYErr+aJcBqBYuUYfhOfkFQ==} hasBin: true - '@git.zone/tstest@2.7.0': - resolution: {integrity: sha512-ET532UpIAE86Ifw4P1Y2U7AJalKxM/Q88+kKN854dXSX+s5GgnRy0ysrPcSCUkJfENEvou1b0er1xcotUKx6hw==} + '@git.zone/tsrun@2.0.0': + resolution: {integrity: sha512-yA6zCjL+kn7xfZe6sL/m4K+zYqgkznG/pF6++i/E17iwzpG6dHmW+VZmYldHe86sW4DcLMvqM6CxM+KlgaEpKw==} + hasBin: true + + '@git.zone/tstest@2.8.2': + resolution: {integrity: sha512-qIZFor1mT4+Xth24jbqZtrh2B2Vz2n27OVY1R22zEg4TgFldjEUVwIKz27axqK1HUA1PIw0mYn+vOgd+yMWO4w==} hasBin: true '@happy-dom/global-registrator@15.11.7': @@ -646,8 +650,8 @@ packages: '@push.rocks/smartcrypto@2.0.4': resolution: {integrity: sha512-1+/5bsjyataf5uUkUNnnVXGRAt+gHVk1KDzozjTqgqJxHvQk1d9fVDohL6CxUhUucTPtu5VR5xNBiV8YCDuGyw==} - '@push.rocks/smartdata@5.16.4': - resolution: {integrity: sha512-COiKw8yk9iAcLN44WmZHG8Gi0v+HGkgM8Osoq7Cns+UsOA+grPepqbN2r0XPG1fm5vOdJcaydi2ZU0xrnbGVvQ==} + '@push.rocks/smartdata@5.16.7': + resolution: {integrity: sha512-bu/YSIjQcwxWXkAsuhqE6zs7eT+bTIKV8+/H7TbbjpzeioLCyB3dZ/41cLZk37c/EYt4d4GHgZ0ww80OiKOUMg==} '@push.rocks/smartdelay@3.0.5': resolution: {integrity: sha512-mUuI7kj2f7ztjpic96FvRIlf2RsKBa5arw81AHNsndbxO6asRcxuWL8dTVxouEIK8YsBUlj0AsrCkHhMbLQdHw==} @@ -715,8 +719,8 @@ packages: '@push.rocks/smartmime@2.0.4': resolution: {integrity: sha512-mG6lRBLr5nF+GLZmgCcdjhdDsmTtJWBFZDCa1eJ8Au9TvUzbPW0fY5aqJBb3UwfyZzH6St8Th9cJSXjagOQkYA==} - '@push.rocks/smartmongo@2.0.12': - resolution: {integrity: sha512-NglYiO14BikxnlvW6JF18FtopBtaWQEGAtPxHmmSCbyhU8Mi0aEFO7VgCasE9Kguba/wcR597qhcDEdcpBg1eQ==} + '@push.rocks/smartmongo@2.0.14': + resolution: {integrity: sha512-fvfPeCDDy5JaDBpVnsMKednsOoRzuYC0OszO8OoLOX/RaR755zIbRppCCK8Cez0hqd6eNkJGQeWdX/vXlJOPBA==} '@push.rocks/smartnetwork@4.4.0': resolution: {integrity: sha512-OvFtz41cvQ7lcXwaIOhghNUUlNoMxvwKDctbDvMyuZyEH08SpLjhyv2FuKbKL/mgwA/WxakTbohoC8SW7t+kiw==} @@ -754,8 +758,11 @@ packages: '@push.rocks/smartrequest@2.1.0': resolution: {integrity: sha512-3eHLTRInHA+u+W98TqJwgTES7rRimBAsJC4JxVNQC3UUezmblAhM5/TIQsEBQTsbjAY8SeQKy6NHzW6iTiaD8w==} - '@push.rocks/smartrequest@4.4.0': - resolution: {integrity: sha512-lls++Ddwom3FwL88U8LOfgmtyzEwBg3Jx2T6+C/FUcYsjKJ3xoau04ob8YtCUcBarjJhDpIPGpCY7dD00f3KCQ==} + '@push.rocks/smartrequest@4.4.2': + resolution: {integrity: sha512-Om4y1Ce4YdSu8VoXREz2SgFz9pDxcFEm0+SC1YYa3RXd0AH2Mknaj/1XfvfMqojnK9L7N2z1fY4xX8tO1IwqFQ==} + + '@push.rocks/smartrequest@5.0.1': + resolution: {integrity: sha512-gZQQF6HVt3LwTBxaPh6hHObd4VF76PUYQcs5pHD7f0VXaEewmrNAQSnccoinOY7fi45+0dOf04PJOXu9MibPzQ==} '@push.rocks/smartrouter@1.3.3': resolution: {integrity: sha512-1+xZEnWlhzqLWAaJ1zFNhQ0zgbfCWQl1DBT72LygLxTs+P0K8AwJKgqo/IX6CT55kGCFnPAZIYSbVJlGsgrB0w==} @@ -2105,6 +2112,10 @@ packages: resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==} engines: {node: '>= 6'} + form-data@4.0.5: + resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} + engines: {node: '>= 6'} + format@0.2.2: resolution: {integrity: sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs=} engines: {node: '>=0.4.x'} @@ -3681,7 +3692,7 @@ snapshots: '@api.global/typedrequest': 3.1.10 '@api.global/typedrequest-interfaces': 3.0.19 '@api.global/typedsocket': 3.0.1 - '@cloudflare/workers-types': 4.20251115.0 + '@cloudflare/workers-types': 4.20251117.0 '@design.estate/dees-comms': 1.0.27 '@push.rocks/lik': 6.2.2 '@push.rocks/smartchok': 1.1.1 @@ -3700,7 +3711,7 @@ snapshots: '@push.rocks/smartopen': 2.0.0 '@push.rocks/smartpath': 6.0.0 '@push.rocks/smartpromise': 4.2.3 - '@push.rocks/smartrequest': 4.4.0 + '@push.rocks/smartrequest': 4.4.2 '@push.rocks/smartrx': 3.0.10 '@push.rocks/smartsitemap': 2.0.3 '@push.rocks/smartstream': 3.2.5 @@ -4219,7 +4230,7 @@ snapshots: '@borewit/text-codec@0.1.1': {} - '@cloudflare/workers-types@4.20251115.0': {} + '@cloudflare/workers-types@4.20251117.0': {} '@colors/colors@1.6.0': {} @@ -4372,7 +4383,7 @@ snapshots: '@esbuild/win32-x64@0.25.12': optional: true - '@git.zone/tsbuild@2.7.1': + '@git.zone/tsbuild@3.1.0': dependencies: '@git.zone/tspublish': 1.10.3 '@push.rocks/early': 4.0.4 @@ -4390,7 +4401,7 @@ snapshots: - supports-color - vue - '@git.zone/tsbundle@2.5.1': + '@git.zone/tsbundle@2.5.2': dependencies: '@push.rocks/early': 4.0.4 '@push.rocks/smartcli': 4.0.19 @@ -4420,7 +4431,7 @@ snapshots: '@push.rocks/smartlog': 3.1.10 '@push.rocks/smartnpm': 2.0.6 '@push.rocks/smartpath': 6.0.0 - '@push.rocks/smartrequest': 4.4.0 + '@push.rocks/smartrequest': 4.4.2 '@push.rocks/smartshell': 3.3.0 transitivePeerDependencies: - '@nuxt/kit' @@ -4435,10 +4446,16 @@ snapshots: '@push.rocks/smartshell': 3.3.0 tsx: 4.20.6 - '@git.zone/tstest@2.7.0(socks@2.8.7)(typescript@5.9.3)': + '@git.zone/tsrun@2.0.0': + dependencies: + '@push.rocks/smartfile': 11.2.7 + '@push.rocks/smartshell': 3.3.0 + tsx: 4.20.6 + + '@git.zone/tstest@2.8.2(socks@2.8.7)(typescript@5.9.3)': dependencies: '@api.global/typedserver': 3.0.79 - '@git.zone/tsbundle': 2.5.1 + '@git.zone/tsbundle': 2.5.2 '@git.zone/tsrun': 1.6.2 '@push.rocks/consolecolor': 2.0.3 '@push.rocks/qenv': 6.1.3 @@ -4451,11 +4468,11 @@ snapshots: '@push.rocks/smartfile': 11.2.7 '@push.rocks/smartjson': 5.2.0 '@push.rocks/smartlog': 3.1.10 - '@push.rocks/smartmongo': 2.0.12(socks@2.8.7) + '@push.rocks/smartmongo': 2.0.14(socks@2.8.7) '@push.rocks/smartnetwork': 4.4.0 '@push.rocks/smartpath': 6.0.0 '@push.rocks/smartpromise': 4.2.3 - '@push.rocks/smartrequest': 4.4.0 + '@push.rocks/smartrequest': 4.4.2 '@push.rocks/smarts3': 2.2.6 '@push.rocks/smartshell': 3.3.0 '@push.rocks/smarttime': 4.1.1 @@ -4781,7 +4798,7 @@ snapshots: '@push.rocks/smartfile': 11.2.7 '@push.rocks/smartpath': 6.0.0 '@push.rocks/smartpromise': 4.2.3 - '@push.rocks/smartrequest': 4.4.0 + '@push.rocks/smartrequest': 4.4.2 '@push.rocks/smartrx': 3.0.10 '@push.rocks/smartstream': 3.2.5 '@push.rocks/smartunique': 3.0.9 @@ -4866,12 +4883,12 @@ snapshots: '@types/node-forge': 1.3.14 node-forge: 1.3.1 - '@push.rocks/smartdata@5.16.4(socks@2.8.7)': + '@push.rocks/smartdata@5.16.7(socks@2.8.7)': dependencies: '@push.rocks/lik': 6.2.2 '@push.rocks/smartdelay': 3.0.5 '@push.rocks/smartlog': 3.1.10 - '@push.rocks/smartmongo': 2.0.12(socks@2.8.7) + '@push.rocks/smartmongo': 2.0.14(socks@2.8.7) '@push.rocks/smartpromise': 4.2.3 '@push.rocks/smartrx': 3.0.10 '@push.rocks/smartstring': 4.1.0 @@ -4956,7 +4973,7 @@ snapshots: '@push.rocks/smartmime': 2.0.4 '@push.rocks/smartpath': 6.0.0 '@push.rocks/smartpromise': 4.2.3 - '@push.rocks/smartrequest': 4.4.0 + '@push.rocks/smartrequest': 4.4.2 '@push.rocks/smartstream': 3.2.5 '@types/fs-extra': 11.0.4 '@types/js-yaml': 4.0.9 @@ -5047,10 +5064,10 @@ snapshots: file-type: 19.6.0 mime: 4.0.7 - '@push.rocks/smartmongo@2.0.12(socks@2.8.7)': + '@push.rocks/smartmongo@2.0.14(socks@2.8.7)': dependencies: '@push.rocks/mongodump': 1.1.0(socks@2.8.7) - '@push.rocks/smartdata': 5.16.4(socks@2.8.7) + '@push.rocks/smartdata': 5.16.7(socks@2.8.7) '@push.rocks/smartpath': 5.1.0 '@push.rocks/smartpromise': 4.2.3 mongodb-memory-server: 10.3.0(socks@2.8.7) @@ -5086,7 +5103,7 @@ snapshots: '@push.rocks/smartfile': 11.2.7 '@push.rocks/smartpath': 6.0.0 '@push.rocks/smartpromise': 4.2.3 - '@push.rocks/smartrequest': 4.4.0 + '@push.rocks/smartrequest': 4.4.2 '@push.rocks/smarttime': 4.1.1 '@push.rocks/smartversion': 3.0.5 package-json: 8.1.1 @@ -5173,14 +5190,23 @@ snapshots: agentkeepalive: 4.5.0 form-data: 4.0.4 - '@push.rocks/smartrequest@4.4.0': + '@push.rocks/smartrequest@4.4.2': dependencies: '@push.rocks/smartenv': 6.0.0 '@push.rocks/smartpath': 6.0.0 '@push.rocks/smartpromise': 4.2.3 '@push.rocks/smarturl': 3.1.0 agentkeepalive: 4.6.0 - form-data: 4.0.4 + form-data: 4.0.5 + + '@push.rocks/smartrequest@5.0.1': + dependencies: + '@push.rocks/smartenv': 6.0.0 + '@push.rocks/smartpath': 6.0.0 + '@push.rocks/smartpromise': 4.2.3 + '@push.rocks/smarturl': 3.1.0 + agentkeepalive: 4.6.0 + form-data: 4.0.5 '@push.rocks/smartrouter@1.3.3': dependencies: @@ -6783,6 +6809,14 @@ snapshots: hasown: 2.0.2 mime-types: 2.1.35 + form-data@4.0.5: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + hasown: 2.0.2 + mime-types: 2.1.35 + format@0.2.2: {} forwarded@0.2.0: {} diff --git a/readme.hints.md b/readme.hints.md index e69de29..ed734f6 100644 --- a/readme.hints.md +++ b/readme.hints.md @@ -0,0 +1,29 @@ +# Docker Module - Development Hints + +## smartrequest v5+ Migration (2025-11-17) + +### Breaking Change +smartrequest v5.0.0+ returns web `ReadableStream` objects (Web Streams API) instead of Node.js streams. + +### Solution Implemented +All streaming methods now convert web ReadableStreams to Node.js streams using: +```typescript +plugins.smartstream.nodewebhelpers.convertWebReadableToNodeReadable(webStream) +``` + +### Files Modified +- `ts/classes.host.ts`: + - `requestStreaming()` - Converts web stream to Node.js stream before returning + - `getEventObservable()` - Works with converted Node.js stream + +- `ts/classes.image.ts`: + - `createFromTarStream()` - Uses converted Node.js stream for event handling + - `exportToTarStream()` - Uses converted Node.js stream for backpressure management + +### Testing +- Build:  All 11 type errors resolved +- Tests:  Node.js tests pass (DockerHost, DockerContainer, DockerImage, DockerImageStore) + +### Notes +- The conversion maintains backward compatibility with existing code expecting Node.js stream methods (`.on()`, `.emit()`, `.pause()`, `.resume()`) +- smartstream's `nodewebhelpers` module provides bidirectional conversion utilities between web and Node.js streams diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 768b215..296a4f8 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@apiclient.xyz/docker', - version: '1.3.5', + version: '1.3.6', description: 'Provides easy communication with Docker remote API from Node.js, with TypeScript support.' } diff --git a/ts/classes.host.ts b/ts/classes.host.ts index 41f9473..a584004 100644 --- a/ts/classes.host.ts +++ b/ts/classes.host.ts @@ -182,8 +182,12 @@ export class DockerHost { */ public async getEventObservable(): Promise> { const response = await this.requestStreaming('GET', '/events'); + + // requestStreaming now returns Node.js stream, not web stream + const nodeStream = response as plugins.smartstream.stream.Readable; + return plugins.rxjs.Observable.create((observer) => { - response.on('data', (data) => { + nodeStream.on('data', (data) => { const eventString = data.toString(); try { const eventObject = JSON.parse(eventString); @@ -193,7 +197,7 @@ export class DockerHost { } }); return () => { - response.emit('end'); + nodeStream.emit('end'); }; }); } @@ -347,7 +351,7 @@ export class DockerHost { } // Execute the request based on method - let response; + let response: plugins.smartrequest.ICoreResponse; switch (methodArg.toUpperCase()) { case 'GET': response = await smartRequest.get(); @@ -367,10 +371,10 @@ export class DockerHost { console.log(response.status); - // For streaming responses, get the Node.js stream - const nodeStream = response.streamNode(); + // For streaming responses, get the web stream + const webStream = response.stream(); - if (!nodeStream) { + if (!webStream) { // If no stream is available, consume the body as text const body = await response.text(); console.log(body); @@ -383,7 +387,10 @@ export class DockerHost { }; } - // For streaming responses, return the stream with added properties + // Convert web ReadableStream to Node.js stream for backward compatibility + const nodeStream = plugins.smartstream.nodewebhelpers.convertWebReadableToNodeReadable(webStream); + + // Add properties for compatibility (nodeStream as any).statusCode = response.status; (nodeStream as any).body = ''; // For compatibility diff --git a/ts/classes.image.ts b/ts/classes.image.ts index 8648615..e915ade 100644 --- a/ts/classes.image.ts +++ b/ts/classes.image.ts @@ -105,6 +105,9 @@ export class DockerImage { optionsArg.tarStream, ); + // requestStreaming now returns Node.js stream + const nodeStream = response as plugins.smartstream.stream.Readable; + /** * Docker typically returns lines like: * {"stream":"Loaded image: myrepo/myimage:latest"} @@ -112,16 +115,16 @@ export class DockerImage { * So we will collect those lines and parse out the final image name. */ let rawOutput = ''; - response.on('data', (chunk) => { + nodeStream.on('data', (chunk) => { rawOutput += chunk.toString(); }); // Wrap the end event in a Promise for easier async/await usage await new Promise((resolve, reject) => { - response.on('end', () => { + nodeStream.on('end', () => { resolve(); }); - response.on('error', (err) => { + nodeStream.on('error', (err) => { reject(err); }); }); @@ -260,10 +263,8 @@ export class DockerImage { `/images/${encodeURIComponent(this.RepoTags[0])}/get`, ); - // Check if response is a Node.js stream - if (!response || typeof response.on !== 'function') { - throw new Error('Failed to get streaming response for image export'); - } + // requestStreaming now returns Node.js stream + const nodeStream = response as plugins.smartstream.stream.Readable; let counter = 0; const webduplexStream = new plugins.smartstream.SmartDuplex({ @@ -274,20 +275,20 @@ export class DockerImage { }, }); - response.on('data', (chunk) => { + nodeStream.on('data', (chunk) => { if (!webduplexStream.write(chunk)) { - response.pause(); + nodeStream.pause(); webduplexStream.once('drain', () => { - response.resume(); + nodeStream.resume(); }); } }); - response.on('end', () => { + nodeStream.on('end', () => { webduplexStream.end(); }); - response.on('error', (error) => { + nodeStream.on('error', (error) => { logger.log('error', `Error during image export: ${error.message}`); webduplexStream.destroy(error); });