fridayy 1.0.2 → 1.2.1

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 (41) hide show
  1. package/README.md +12 -0
  2. package/dist/adapters/nodejs/ast-scanner.d.ts +5 -3
  3. package/dist/adapters/nodejs/ast-scanner.d.ts.map +1 -1
  4. package/dist/adapters/nodejs/ast-scanner.js +104 -29
  5. package/dist/adapters/nodejs/ast-scanner.js.map +1 -1
  6. package/dist/adapters/rest/adapter.d.ts +1 -0
  7. package/dist/adapters/rest/adapter.d.ts.map +1 -1
  8. package/dist/adapters/rest/adapter.js +118 -2
  9. package/dist/adapters/rest/adapter.js.map +1 -1
  10. package/dist/cli/commands/doctor.d.ts.map +1 -1
  11. package/dist/cli/commands/doctor.js +45 -4
  12. package/dist/cli/commands/doctor.js.map +1 -1
  13. package/dist/cli/commands/generate.d.ts.map +1 -1
  14. package/dist/cli/commands/generate.js +11 -1
  15. package/dist/cli/commands/generate.js.map +1 -1
  16. package/dist/cli/commands/init.d.ts +1 -1
  17. package/dist/cli/commands/init.d.ts.map +1 -1
  18. package/dist/cli/commands/init.js +58 -8
  19. package/dist/cli/commands/init.js.map +1 -1
  20. package/dist/cli/commands/scan.d.ts.map +1 -1
  21. package/dist/cli/commands/scan.js +33 -17
  22. package/dist/cli/commands/scan.js.map +1 -1
  23. package/dist/cli/commands/use.d.ts +7 -0
  24. package/dist/cli/commands/use.d.ts.map +1 -0
  25. package/dist/cli/commands/use.js +89 -0
  26. package/dist/cli/commands/use.js.map +1 -0
  27. package/dist/cli/index.d.ts.map +1 -1
  28. package/dist/cli/index.js +4 -1
  29. package/dist/cli/index.js.map +1 -1
  30. package/dist/cli/ui/banner.js +1 -1
  31. package/dist/core/discovery/project-scanner.d.ts.map +1 -1
  32. package/dist/core/discovery/project-scanner.js +29 -19
  33. package/dist/core/discovery/project-scanner.js.map +1 -1
  34. package/dist/core/tool-generator/generator.d.ts +3 -1
  35. package/dist/core/tool-generator/generator.d.ts.map +1 -1
  36. package/dist/core/tool-generator/generator.js +33 -5
  37. package/dist/core/tool-generator/generator.js.map +1 -1
  38. package/package.json +2 -1
  39. package/point/AI_INSTRUCTIONS.md +130 -0
  40. package/point/PROJECT_CONTEXT.md +61 -0
  41. package/point/QUICK_START_PROMPT.md +27 -0
@@ -1,7 +1,11 @@
1
1
  /**
2
2
  * Fridayy - Tool Generator Engine
3
3
  * Coordinates adapters to generate, filter, and normalize candidate MCP tools.
4
+ * Features intelligent auto-fallback across adapters when files are missing.
4
5
  */
6
+ import fs from 'node:fs';
7
+ import path from 'node:path';
8
+ import chalk from 'chalk';
5
9
  import { defaultAdapterRegistry } from '../../adapters/registry.js';
6
10
  import { isToolAllowed } from '../../security/allowlist.js';
7
11
  export class ToolGenerator {
@@ -10,14 +14,38 @@ export class ToolGenerator {
10
14
  this.adapterRegistry = adapterRegistry;
11
15
  }
12
16
  /**
13
- * Generates MCP tools from the configured source adapter.
17
+ * Generates MCP tools with automated adapter fallback capabilities.
14
18
  */
15
19
  async generate(options) {
16
- const { config, rootDir = process.cwd(), preserveStatuses } = options;
17
- const sourceType = config.source.type || 'openapi';
18
- const adapter = this.adapterRegistry.get(sourceType);
20
+ const { config, rootDir = process.cwd(), preserveStatuses, sourceTypeOverride } = options;
21
+ let sourceType = sourceTypeOverride || config.source.type || 'openapi';
22
+ // Auto-fallback check if OpenAPI file does not exist
23
+ if (sourceType === 'openapi') {
24
+ const specPath = config.source.path ? path.resolve(rootDir, config.source.path) : null;
25
+ const specExists = specPath && fs.existsSync(specPath);
26
+ if (!specExists) {
27
+ // Check if Node.js project exists
28
+ const hasPkgJson = fs.existsSync(path.join(rootDir, 'package.json'));
29
+ if (hasPkgJson && this.adapterRegistry.has('nodejs')) {
30
+ console.warn(chalk.yellow(`⚠ OpenAPI specification not found at "${config.source.path || './openapi.yaml'}". Automatically switching to Node.js route discovery.`));
31
+ sourceType = 'nodejs';
32
+ }
33
+ else if (config.source.baseUrl && this.adapterRegistry.has('rest')) {
34
+ console.warn(chalk.yellow(`⚠ OpenAPI specification not found at "${config.source.path || './openapi.yaml'}". Automatically switching to REST adapter for ${config.source.baseUrl}.`));
35
+ sourceType = 'rest';
36
+ }
37
+ }
38
+ }
39
+ let adapter = this.adapterRegistry.get(sourceType);
19
40
  if (!adapter) {
20
- throw new Error(`Unsupported source adapter: "${sourceType}". Registered adapters: [${this.adapterRegistry.getAll().map(a => a.name).join(', ')}]`);
41
+ // Fallback to first available adapter
42
+ const allAdapters = this.adapterRegistry.getAll();
43
+ if (allAdapters.length > 0) {
44
+ adapter = allAdapters[0];
45
+ }
46
+ else {
47
+ throw new Error(`No compatible source adapters found for type "${sourceType}".`);
48
+ }
21
49
  }
22
50
  const generatedRawTools = await adapter.generateTools({
23
51
  rootDir,
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/core/tool-generator/generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAmB,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAQ5D,MAAM,OAAO,aAAa;IAChB,eAAe,CAAkB;IAEzC,YAAY,kBAAmC,sBAAsB;QACnE,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,QAAQ,CAAC,OAA0B;QAC9C,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;QACtE,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,SAAS,CAAC;QAEnD,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,gCAAgC,UAAU,4BAA4B,IAAI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C,IAAI,IAAI,EAAE,CAAC;gBACxC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7E,IAAI,WAAW;oBAAE,OAAO,KAAK,CAAC;YAChC,CAAC;YAED,0BAA0B;YAC1B,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE;gBAC9B,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS;gBACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ;aACpC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,mDAAmD;QACnD,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAClD,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;gBACjC,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACpC,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC;gBACjD,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,aAAa,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fridayy",
3
- "version": "1.0.2",
3
+ "version": "1.2.1",
4
4
  "description": "Universal Application-to-MCP Platform — Turn existing applications and APIs into AI-ready MCP tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,6 +11,7 @@
11
11
  "files": [
12
12
  "dist",
13
13
  "bin",
14
+ "point",
14
15
  "README.md",
15
16
  "LICENSE"
16
17
  ],
@@ -0,0 +1,130 @@
1
+ # AI Instructions & Autonomous Integration Guide
2
+
3
+ > **Directive for AI / LLM Agents**: When a developer points you to this file (`point/AI_INSTRUCTIONS.md` or `@point`), read these instructions to understand the project architecture, operational rules, and execute the necessary steps automatically to connect their application to MCP.
4
+
5
+ ---
6
+
7
+ ## 🎯 1. What is Fridayy?
8
+
9
+ **fridayy** is a developer-focused, local-first platform that converts existing APIs and applications (REST, OpenAPI, Node.js routes, Manual tools) into **Model Context Protocol (MCP)** tools.
10
+
11
+ ### Core Philosophy:
12
+ * **Build once, connect everywhere.**
13
+ * **Zero code rewriting**: Discovers endpoints from existing specifications or source code.
14
+ * **Zero-trust security**: Granular permission classification (`READ`, `WRITE`, `DESTRUCTIVE`) with destructive actions (`DELETE`, `drop`, `purge`) blocked by default until human developer approval.
15
+ * **Zero secret leakage**: Credentials load strictly from environment variables (`FRIDAYY_*`) at execution time and are never exposed to LLMs.
16
+
17
+ ---
18
+
19
+ ## 🤖 2. Autonomous Action Protocol for AI Assistants
20
+
21
+ When the developer asks you to set up, maintain, or connect their project using Fridayy, execute the following steps in order:
22
+
23
+ ```mermaid
24
+ graph TD
25
+ A[1. Workspace Analysis] --> B[2. Initialize Fridayy]
26
+ B --> C[3. Scan Capabilities]
27
+ C --> D[4. Generate Tool Definitions]
28
+ D --> E[5. Review & Classify Permissions]
29
+ E --> F[6. Run Diagnostics]
30
+ F --> G[7. Connect to MCP Client]
31
+ ```
32
+
33
+ ### Step 1: Analyze the Workspace
34
+ 1. Check if an OpenAPI specification exists (`openapi.yaml`, `openapi.json`, `swagger.yaml`).
35
+ 2. If no OpenAPI spec exists, check for Node.js route definitions (`Express`, `Fastify`, `Koa`).
36
+ 3. Check target backend URL and port (default is `http://localhost:3000` or `http://localhost:4000`).
37
+
38
+ ### Step 2: Initialize Configuration
39
+ Run:
40
+ ```bash
41
+ npx fridayy init --yes
42
+ ```
43
+ *Creates `fridayy.config.json` with detected settings.*
44
+
45
+ ### Step 3: Scan Capabilities & Endpoints
46
+ Run:
47
+ ```bash
48
+ npx fridayy scan
49
+ ```
50
+ *Identifies all candidate endpoints, HTTP methods, and authentication schemes.*
51
+
52
+ ### Step 4: Generate Candidate MCP Tools
53
+ Run:
54
+ ```bash
55
+ npx fridayy generate
56
+ ```
57
+ *Generates `fridayy.tools.json` containing standardized tool schemas, parameters, and risk classifications.*
58
+
59
+ ### Step 5: Review & Classify Permissions
60
+ * **READ Tools** (`GET`): Safe to auto-approve.
61
+ ```bash
62
+ npx fridayy review --approve-read
63
+ ```
64
+ * **WRITE Tools** (`POST`, `PUT`, `PATCH`): Approve based on user intent.
65
+ * **DESTRUCTIVE Tools** (`DELETE`, `purge`, `cancel`): **DO NOT** approve destructive tools without explicitly asking the developer for confirmation.
66
+
67
+ ### Step 6: Run Diagnostic Health Check
68
+ Run:
69
+ ```bash
70
+ npx fridayy doctor
71
+ ```
72
+ *Verifies schema integrity, environment variables, and target API connectivity.*
73
+
74
+ ### Step 7: Configure MCP Client
75
+ Configure the user's AI client (Claude Desktop, Cursor, or Gemini) as follows:
76
+
77
+ #### For Claude Desktop (`claude_desktop_config.json`):
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "fridayy": {
82
+ "command": "npx",
83
+ "args": ["fridayy", "start"],
84
+ "env": {
85
+ "FRIDAYY_API_KEY": "your_api_key_here"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ #### For Cursor IDE:
93
+ * **Settings** → **Features** → **MCP**
94
+ * **Type**: `command`
95
+ * **Command**: `npx fridayy start`
96
+
97
+ ---
98
+
99
+ ## 🏗️ 3. Architecture & Codebase Map
100
+
101
+ | Directory | Purpose | Key Files |
102
+ |---|---|---|
103
+ | `src/cli/` | Command line interface | `index.ts`, `commands/`, `ui/` |
104
+ | `src/core/schema/` | Schema converter & unifier | `types.ts`, `json-schema.ts` |
105
+ | `src/core/permissions/` | Permission classifier & gatekeeper | `classifier.ts`, `enforcer.ts` |
106
+ | `src/core/authentication/` | Secret isolation & token resolver | `manager.ts`, `secret-resolver.ts` |
107
+ | `src/core/validation/` | Parameter & schema validation | `validator.ts`, `config-schema.ts` |
108
+ | `src/adapters/` | Pluggable source adapters | `openapi/`, `nodejs/`, `rest/`, `manual/`, `registry.ts` |
109
+ | `src/mcp/` | Standards-compliant MCP Server | `server/fridayy-server.ts`, `tools/`, `resources/`, `prompts/` |
110
+ | `src/security/` | Rate limiting & audit logging | `rate-limiter.ts`, `audit-logger.ts`, `sanitizer.ts` |
111
+
112
+ ---
113
+
114
+ ## 🛡️ 4. Security Rules for AI Agents
115
+
116
+ 1. **Never Bypass Destructive Protection**: Never modify `fridayy.tools.json` to approve a `DESTRUCTIVE` tool unless the developer explicitly asked for that specific tool to be enabled.
117
+ 2. **Never Commit Secrets**: Ensure all API tokens, basic auth passwords, and JWTs are loaded through `process.env.FRIDAYY_*` and never written in plaintext into `fridayy.config.json` or committed to Git.
118
+ 3. **Validate Inputs**: Ensure tool arguments sent by models adhere to the JSON Schema generated by Fridayy.
119
+
120
+ ---
121
+
122
+ ## 🔧 5. Extending with New Adapters (AI Guidance)
123
+
124
+ To add a new adapter (e.g. GraphQL, PostgreSQL, Python FastAPI):
125
+ 1. Create `src/adapters/<name>/adapter.ts` extending `BaseAdapter` from `src/adapters/base.ts`.
126
+ 2. Implement:
127
+ - `detect(context)`: Boolean capability check.
128
+ - `generateTools(context)`: Returns `FridayyToolDefinition[]`.
129
+ - `executeTool(tool, input, context)`: Dispatches runtime execution.
130
+ 3. Register the new adapter instance in `src/adapters/registry.ts`.
@@ -0,0 +1,61 @@
1
+ # Fridayy Project Context & Machine-Readable Spec
2
+
3
+ This document provides structured context for AI agents reading the codebase.
4
+
5
+ ---
6
+
7
+ ## 📌 Project Metadata
8
+ * **Name**: `fridayy`
9
+ * **Version**: `1.2.0`
10
+ * **Author**: `Sabarivasan`
11
+ * **Protocol**: Model Context Protocol (MCP) v1.6+
12
+ * **Repository**: `https://github.com/Sabari-Vasan-SM/fridayy`
13
+ * **License**: MIT
14
+
15
+ ---
16
+
17
+ ## 🛠️ Data Model & Schemas
18
+
19
+ ### FridayyToolDefinition
20
+ ```typescript
21
+ interface FridayyToolDefinition {
22
+ id: string; // Unique ID (e.g. tool_get_products)
23
+ name: string; // Valid snake_case tool name (e.g. get_products)
24
+ description: string; // Human & AI-readable description
25
+ inputSchema: { // Unified JSON Schema Draft-7
26
+ type: 'object';
27
+ properties: Record<string, any>;
28
+ required: string[];
29
+ };
30
+ source: { // Source binding
31
+ type: 'openapi' | 'rest' | 'nodejs' | 'manual';
32
+ method?: string;
33
+ path?: string;
34
+ baseUrl?: string;
35
+ };
36
+ permissions: { // Permission classification
37
+ type: 'READ' | 'WRITE' | 'DESTRUCTIVE';
38
+ read: boolean;
39
+ write: boolean;
40
+ destructive: boolean;
41
+ };
42
+ risk: 'low' | 'medium' | 'high'; // Risk scoring
43
+ status: 'APPROVED' | 'PENDING' | 'BLOCKED' | 'REJECTED';
44
+ }
45
+ ```
46
+
47
+ ---
48
+
49
+ ## 🚦 Permission Matrix
50
+
51
+ | HTTP Method / Pattern | Classification | Risk Level | Default Status | Action Required |
52
+ |---|---|---|---|---|
53
+ | `GET`, `HEAD`, `OPTIONS` | `READ` | `low` | `APPROVED` | Ready for AI invocation |
54
+ | `POST`, `PUT`, `PATCH` | `WRITE` | `medium` | `PENDING` | Review before enabling |
55
+ | `DELETE`, `purge`, `erase`, `cancel` | `DESTRUCTIVE` | `high` | `BLOCKED` | Explicit human approval mandatory |
56
+
57
+ ---
58
+
59
+ ## 🔌 Available Transports
60
+ 1. **Stdio Transport**: Default standard I/O stream for local desktop AI clients (Claude Desktop, Cursor IDE).
61
+ 2. **SSE Transport**: Server-Sent Events over HTTP for remote AI agents and web hooks (`--transport sse --port 3000`).
@@ -0,0 +1,27 @@
1
+ # AI Agent Prompt Snippets
2
+
3
+ Copy-paste any of the prompts below into Claude, ChatGPT, Cursor, Gemini, or Antigravity to perform automatic Fridayy tasks:
4
+
5
+ ---
6
+
7
+ ### Prompt 1: Full Automatic API-to-MCP Setup
8
+ ```text
9
+ Please read @point/AI_INSTRUCTIONS.md and automatically analyze my current project.
10
+ Detect my OpenAPI / REST endpoints, generate Fridayy tool definitions, approve all safe read-only tools, verify project health with 'fridayy doctor', and guide me on how to start the MCP server.
11
+ ```
12
+
13
+ ---
14
+
15
+ ### Prompt 2: Safe Tool Review & Selective Approval
16
+ ```text
17
+ Please review @point/PROJECT_CONTEXT.md and my generated fridayy.tools.json.
18
+ List all candidate tools, highlight any WRITE or DESTRUCTIVE tools that require confirmation, and help me approve only the tools needed for my specific task.
19
+ ```
20
+
21
+ ---
22
+
23
+ ### Prompt 3: Add Custom Tool / Adapter Extension
24
+ ```text
25
+ I want to add a custom adapter/tool to Fridayy.
26
+ Please check @point/AI_INSTRUCTIONS.md Section 5 for adapter extension rules, and help me implement a new BaseAdapter subclass for my backend.
27
+ ```