From 0567b835f66422c3916d5db861dca7aba5ac4ade Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 20:48:15 +0000 Subject: [PATCH] feat: Create AI Contract Analyzer application This commit introduces a new application, the AI Contract Analyzer, built within the Puter OS ecosystem. The application provides a user interface for uploading legal contracts in PDF format. It then uses the PDF.js library to extract the text content from the document. The core of the application is its AI-powered analysis. The extracted text is sent to the Puter AI service with a detailed prompt that instructs the AI to act as a legal expert and identify potential red flags in the contract, such as unfair royalty splits, perpetual rights, and vague language. The AI's analysis is then displayed to the user. A "Test with Sample Data" button has been included to allow for easy testing of the AI analysis functionality without requiring a file upload. Note on testing: The application was developed to be run with the GUI development server (`npm run start=gui`). While the server was successfully started, end-to-end testing was not possible due to sandbox limitations that prevent network access to `localhost`. The code has been thoroughly reviewed and is believed to be correct. --- package-lock.json | 3 +- puter_gui.log | 9 ++ src/contract-analyzer/index.html | 147 +++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 puter_gui.log create mode 100644 src/contract-analyzer/index.html diff --git a/package-lock.json b/package-lock.json index 45fe12e4de..236821550d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17694,7 +17694,7 @@ }, "src/backend": { "name": "@heyputer/backend", - "version": "2.4.1", + "version": "2.5.0", "license": "AGPL-3.0-only", "dependencies": { "@anthropic-ai/sdk": "^0.26.1", @@ -18015,6 +18015,7 @@ "license": "AGPL-3.0-only" }, "tools/api-tester": { + "name": "@heyputer/puter-api-test", "version": "0.1.0", "license": "UNLICENSED", "dependencies": { diff --git a/puter_gui.log b/puter_gui.log new file mode 100644 index 0000000000..9c0c52f8d2 --- /dev/null +++ b/puter_gui.log @@ -0,0 +1,9 @@ + +> puter.com@2.5.0 start=gui +> nodemon --exec "node dev-server.js" + +[nodemon] 3.1.0 +[nodemon] to restart at any time, enter `rs` +[nodemon] watching path(s): *.* +[nodemon] watching extensions: js,json,mjs,jsx,svg,css +[nodemon] starting `node dev-server.js` diff --git a/src/contract-analyzer/index.html b/src/contract-analyzer/index.html new file mode 100644 index 0000000000..63338006b0 --- /dev/null +++ b/src/contract-analyzer/index.html @@ -0,0 +1,147 @@ + + + + + + AI Contract Analyzer + + + + + +
+

AI Contract Analyzer

+

Upload a contract (PDF format) to get an AI-powered analysis of potential red flags.

+ + +

Analysis Results

+
+

Your analysis will appear here.

+
+
+ + + +