@minded-ai/mindedjs 2.0.25-beta.6 → 2.0.25

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 (58) hide show
  1. package/dist/browserTask/executeBrowserTask.d.ts.map +1 -1
  2. package/dist/browserTask/executeBrowserTask.js +128 -11
  3. package/dist/browserTask/executeBrowserTask.js.map +1 -1
  4. package/dist/browserTask/executeBrowserTask.py +293 -3
  5. package/dist/browserTask/localBrowserTask.d.ts +30 -3
  6. package/dist/browserTask/localBrowserTask.d.ts.map +1 -1
  7. package/dist/browserTask/localBrowserTask.js +190 -128
  8. package/dist/browserTask/localBrowserTask.js.map +1 -1
  9. package/dist/browserTask/types.d.ts +9 -0
  10. package/dist/browserTask/types.d.ts.map +1 -1
  11. package/dist/cli/index.js +0 -0
  12. package/dist/cli/localOperatorSetup.d.ts.map +1 -1
  13. package/dist/cli/localOperatorSetup.js +0 -5
  14. package/dist/cli/localOperatorSetup.js.map +1 -1
  15. package/dist/nodes/addAppToolNode.d.ts.map +1 -1
  16. package/dist/nodes/addAppToolNode.js +21 -1
  17. package/dist/nodes/addAppToolNode.js.map +1 -1
  18. package/dist/nodes/addBrowserTaskRunNode.d.ts.map +1 -1
  19. package/dist/nodes/addBrowserTaskRunNode.js +36 -0
  20. package/dist/nodes/addBrowserTaskRunNode.js.map +1 -1
  21. package/package.json +4 -2
  22. package/src/browserTask/CookieStore.ts +49 -0
  23. package/src/browserTask/executeBrowserTask.py +293 -3
  24. package/src/browserTask/executeBrowserTask.ts +138 -17
  25. package/src/browserTask/localBrowserTask.ts +219 -146
  26. package/src/browserTask/types.ts +11 -1
  27. package/src/cli/localOperatorSetup.ts +0 -5
  28. package/src/nodes/addAppToolNode.ts +22 -1
  29. package/src/nodes/addBrowserTaskRunNode.ts +44 -0
  30. package/dist/browserTask/cdp.d.ts +0 -23
  31. package/dist/browserTask/cdp.d.ts.map +0 -1
  32. package/dist/browserTask/cdp.js +0 -162
  33. package/dist/browserTask/cdp.js.map +0 -1
  34. package/dist/browserTask/cookieStore.py +0 -108
  35. package/dist/guidelines/guidelinesManager.d.ts +0 -37
  36. package/dist/guidelines/guidelinesManager.d.ts.map +0 -1
  37. package/dist/guidelines/guidelinesManager.js +0 -172
  38. package/dist/guidelines/guidelinesManager.js.map +0 -1
  39. package/dist/internalTools/retell.d.ts +0 -12
  40. package/dist/internalTools/retell.d.ts.map +0 -1
  41. package/dist/internalTools/retell.js +0 -54
  42. package/dist/internalTools/retell.js.map +0 -1
  43. package/dist/internalTools/sendPlaceholderMessage.d.ts +0 -14
  44. package/dist/internalTools/sendPlaceholderMessage.d.ts.map +0 -1
  45. package/dist/internalTools/sendPlaceholderMessage.js +0 -61
  46. package/dist/internalTools/sendPlaceholderMessage.js.map +0 -1
  47. package/dist/platform/mindedChatOpenAI.d.ts +0 -5
  48. package/dist/platform/mindedChatOpenAI.d.ts.map +0 -1
  49. package/dist/platform/mindedChatOpenAI.js +0 -23
  50. package/dist/platform/mindedChatOpenAI.js.map +0 -1
  51. package/dist/utils/extractStateMemoryResponse.d.ts +0 -5
  52. package/dist/utils/extractStateMemoryResponse.d.ts.map +0 -1
  53. package/dist/utils/extractStateMemoryResponse.js +0 -91
  54. package/dist/utils/extractStateMemoryResponse.js.map +0 -1
  55. package/dist/utils/extractToolMemoryResponse.d.ts +0 -4
  56. package/dist/utils/extractToolMemoryResponse.d.ts.map +0 -1
  57. package/dist/utils/extractToolMemoryResponse.js +0 -16
  58. package/dist/utils/extractToolMemoryResponse.js.map +0 -1
@@ -25,6 +25,14 @@ export type ToolSchema = {
25
25
  }>;
26
26
  };
27
27
 
28
+ export type ScreenshotConfig = {
29
+ enableScreenshotCaptureToS3?: boolean;
30
+ enableLogsCaptureToS3?: boolean;
31
+ s3_bucket?: string;
32
+ s3_prefix?: string;
33
+ aws_region?: string;
34
+ };
35
+
28
36
  export interface InvokeBrowserTaskOptions {
29
37
  sessionId: string;
30
38
  cdpUrl: string;
@@ -34,4 +42,6 @@ export interface InvokeBrowserTaskOptions {
34
42
  browserTaskMode: BrowserTaskMode;
35
43
  toolSchemas?: ToolSchema[];
36
44
  outputSchema?: OutputSchemaField[];
37
- }
45
+ screenshotConfig?: ScreenshotConfig;
46
+ toolCallId: string;
47
+ }
@@ -26,11 +26,6 @@ const REQUIRED_PACKAGES: SetupPackage[] = [
26
26
  command: 'python3.12 --version',
27
27
  checkCommand: 'python3.12 --version',
28
28
  },
29
- {
30
- name: 'browser-use',
31
- description: 'Browser automation library',
32
- command: 'uv pip install browser-use',
33
- },
34
29
  {
35
30
  name: 'Playwright',
36
31
  description: 'Python package for browser automation',
@@ -84,6 +84,27 @@ export const addAppToolNode = async ({
84
84
  // Compile the prompt if it exists to allow variable injection
85
85
  const compiledNodePrompt = node.prompt ? compilePrompt(node.prompt, compileContext) : null;
86
86
 
87
+ // Check if any compiled parameter is too long (>1000 characters)
88
+ const hasLongParameters = Object.values(compiledParameters).some((value) => typeof value === 'string' && value.length > 1000);
89
+
90
+ // Prepare parameters string for the system message
91
+ let parametersString: string;
92
+ if (hasLongParameters) {
93
+ logger.debug({
94
+ message: '[Node] Omitting parameters from system prompt due to length',
95
+ node: node.name,
96
+ parameterLengths: Object.entries(compiledParameters).reduce((acc, [key, value]) => {
97
+ if (typeof value === 'string') {
98
+ acc[key] = value.length;
99
+ }
100
+ return acc;
101
+ }, {} as Record<string, number>),
102
+ });
103
+ parametersString = '[Parameters omitted - one or more values exceed 1000 characters]';
104
+ } else {
105
+ parametersString = JSON.stringify(compiledParameters);
106
+ }
107
+
87
108
  const message = `${combinedPlaybooks ? combinedPlaybooks + '\n\n' : ''}
88
109
  Additional context:
89
110
  previous messages are available for context.
@@ -94,7 +115,7 @@ export const addAppToolNode = async ({
94
115
  - User instructions for choosing tool parameters that are not set by the user (if any)
95
116
  - Workflow memory
96
117
  Parameters manually configured by the user are:
97
- ${JSON.stringify(compiledParameters)}
118
+ ${parametersString}
98
119
  User instructions for choosing tool parameters are:
99
120
  ${compiledNodePrompt ? compiledNodePrompt : 'no instructions set by the user'}`;
100
121
 
@@ -8,6 +8,7 @@ import { createHistoryStep } from '../utils/history';
8
8
  import { HistoryStep } from '../types/Agent.types';
9
9
  import { v4 as uuidv4 } from 'uuid';
10
10
  import { invokeBrowserTask } from '../browserTask/executeBrowserTask';
11
+ import { ScreenshotConfig } from '../browserTask/types';
11
12
  import { zodSchemaToParams } from '../platform/utils/tools';
12
13
  import { getConfig } from '../platform/config';
13
14
  import { compilePrompt } from './compilePrompt';
@@ -55,6 +56,47 @@ export const addBrowserTaskRunNode = async ({ graph, browserTaskNode, attachedTo
55
56
  const promptCompiledWithEnv = compilePrompt(prompt, { env: process.env });
56
57
 
57
58
  const { browserTaskMode } = getConfig();
59
+
60
+ // Build screenshot config conditionally based on environment variables
61
+ const screenshotConfig = (() => {
62
+ // Check for screenshots and logs independently
63
+ const enableScreenshotCaptureToS3 = process.env.ENABLE_BROWSER_SCREENSHOTS === 'true' || !!process.env.SCREENSHOT_S3_BUCKET;
64
+ const enableLogsCaptureToS3 = process.env.ENABLE_BROWSER_LOGS === 'true';
65
+
66
+ // If neither is enabled, return undefined
67
+ if (!enableScreenshotCaptureToS3 && !enableLogsCaptureToS3) {
68
+ return undefined;
69
+ }
70
+
71
+ // Build config with separate flags
72
+ const config: ScreenshotConfig = {
73
+ enableScreenshotCaptureToS3,
74
+ enableLogsCaptureToS3,
75
+ };
76
+
77
+ // Add optional S3 configuration if provided
78
+ if (process.env.SCREENSHOT_S3_BUCKET) {
79
+ config.s3_bucket = process.env.SCREENSHOT_S3_BUCKET;
80
+ }
81
+ if (process.env.SCREENSHOT_S3_PREFIX) {
82
+ config.s3_prefix = process.env.SCREENSHOT_S3_PREFIX;
83
+ }
84
+ if (process.env.AWS_REGION) {
85
+ config.aws_region = process.env.AWS_REGION;
86
+ }
87
+
88
+ logger.debug({
89
+ msg: 'Browser task capture configuration',
90
+ screenshots: enableScreenshotCaptureToS3,
91
+ logs: enableLogsCaptureToS3,
92
+ bucket: config.s3_bucket || 'default',
93
+ prefix: config.s3_prefix || 'default',
94
+ region: config.aws_region || 'default',
95
+ });
96
+
97
+ return config;
98
+ })();
99
+
58
100
  // Invoke browser task via socket
59
101
  const result = await invokeBrowserTask({
60
102
  sessionId,
@@ -65,6 +107,8 @@ export const addBrowserTaskRunNode = async ({ graph, browserTaskNode, attachedTo
65
107
  browserTaskMode,
66
108
  toolSchemas,
67
109
  outputSchema,
110
+ screenshotConfig,
111
+ toolCallId: toolCall.id,
68
112
  });
69
113
 
70
114
  logger.debug({
@@ -1,23 +0,0 @@
1
- export type StartChromiumOptions = {
2
- /** Headless by default. Set to false to see a window. */
3
- headless?: boolean;
4
- /** Extra CLI flags to pass to Chromium. */
5
- extraArgs?: string[];
6
- /** Provide your own user-data-dir. If omitted, a temp dir is created and later removable via `kill()`. */
7
- userDataDir?: string;
8
- /** Extra env vars. */
9
- env?: NodeJS.ProcessEnv;
10
- /** How long to wait for the DevTools port to come up (ms). Default: 10000 */
11
- timeoutMs?: number;
12
- };
13
- export type StartedChromium = {
14
- /** DevTools CDP WebSocket URL, e.g. ws://127.0.0.1:12345/devtools/browser/<id> */
15
- cdpUrl: string;
16
- };
17
- /**
18
- * Launch Chromium with --remote-debugging-port=0 and return the CDP ws URL.
19
- * Works with Chrome/Chromium/Chrome for Testing.
20
- */
21
- export declare function startChromiumAndGetCDP(opts: StartChromiumOptions): Promise<StartedChromium>;
22
- export declare function kill(): Promise<void>;
23
- //# sourceMappingURL=cdp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cdp.d.ts","sourceRoot":"","sources":["../../src/browserTask/cdp.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,oBAAoB,GAAG;IACjC,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,0GAA0G;IAC1G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,eAAe,CAAC,CAmF1B;AA4DD,wBAAsB,IAAI,kBAMzB"}
@@ -1,162 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.startChromiumAndGetCDP = startChromiumAndGetCDP;
27
- exports.kill = kill;
28
- // startChromiumAndGetCDP.ts
29
- const child_process_1 = require("child_process");
30
- const fs = __importStar(require("fs/promises"));
31
- const fscb = __importStar(require("fs"));
32
- const path = __importStar(require("path"));
33
- const os = __importStar(require("os"));
34
- const http = __importStar(require("http"));
35
- const playwright_1 = require("playwright");
36
- let proc;
37
- /**
38
- * Launch Chromium with --remote-debugging-port=0 and return the CDP ws URL.
39
- * Works with Chrome/Chromium/Chrome for Testing.
40
- */
41
- async function startChromiumAndGetCDP(opts) {
42
- var _a;
43
- const { headless = true, extraArgs = [], env, timeoutMs = 10000, } = opts;
44
- const executablePath = playwright_1.chromium.executablePath();
45
- const userDataDir = (_a = opts.userDataDir) !== null && _a !== void 0 ? _a : (await fs.mkdtemp(path.join(os.tmpdir(), "chromium-profile-")));
46
- const args = [
47
- "--remote-debugging-port=0", // let Chrome choose a free port
48
- `--user-data-dir=${userDataDir}`,
49
- "--no-first-run",
50
- "--no-default-browser-check",
51
- ...(headless ? ["--headless=new", "--disable-gpu"] : []),
52
- // Add your own flags if needed (e.g., '--no-sandbox' in some containers)
53
- ...extraArgs,
54
- "about:blank",
55
- ];
56
- proc = (0, child_process_1.spawn)(executablePath, args, {
57
- stdio: ["ignore", "ignore", "pipe"], // stderr is useful for debugging
58
- env: { ...process.env, ...env },
59
- });
60
- // If Chromium dies early, surface the error.
61
- const earlyExit = new Promise((_, reject) => {
62
- proc.once("exit", (code, signal) => {
63
- reject(new Error(`Chromium exited prematurely (code=${code}, signal=${signal}).`));
64
- });
65
- });
66
- const devtoolsPortFile = path.join(userDataDir, "DevToolsActivePort");
67
- // Wait for DevToolsActivePort file to appear, then read it for port + browserId.
68
- const whenReady = (async () => {
69
- const startedAt = Date.now();
70
- while (Date.now() - startedAt < timeoutMs) {
71
- try {
72
- // Access succeeds once the file is written.
73
- await fs.access(devtoolsPortFile, fscb.constants.F_OK);
74
- break;
75
- }
76
- catch (_a) {
77
- await delay(50);
78
- }
79
- }
80
- // If still not there, bail.
81
- await fs.access(devtoolsPortFile, fscb.constants.F_OK).catch(() => {
82
- throw new Error(`Timed out after ${timeoutMs}ms waiting for DevToolsActivePort at ${devtoolsPortFile}`);
83
- });
84
- const raw = await fs.readFile(devtoolsPortFile, "utf8");
85
- const [portLine, browserIdLine] = raw.trim().split(/\r?\n/);
86
- const port = Number(portLine);
87
- if (!Number.isFinite(port)) {
88
- throw new Error(`Invalid DevTools port read from file: "${portLine}"`);
89
- }
90
- // Optional: ping /json/version to ensure the endpoint is responsive.
91
- await waitForHttpOk(`http://127.0.0.1:${port}/json/version`, timeoutMs);
92
- const browserId = (browserIdLine || "").trim();
93
- const cdpUrl = browserId.length > 0
94
- ? `ws://127.0.0.1:${port}/devtools/browser/${browserId}`
95
- : // Fallback: some builds don't include the second line; /json/version has the ws url too.
96
- await fetchWsFromVersionEndpoint(port, timeoutMs);
97
- return { port, cdpUrl };
98
- })();
99
- const { cdpUrl } = await Promise.race([whenReady, earlyExit]);
100
- return { cdpUrl };
101
- }
102
- // ---- helpers ----
103
- function delay(ms) {
104
- return new Promise((r) => setTimeout(r, ms));
105
- }
106
- async function waitForHttpOk(url, timeoutMs) {
107
- const startedAt = Date.now();
108
- while (Date.now() - startedAt < timeoutMs) {
109
- const ok = await httpGetOk(url).catch(() => false);
110
- if (ok)
111
- return;
112
- await delay(50);
113
- }
114
- throw new Error(`Timed out after ${timeoutMs}ms waiting for ${url}`);
115
- }
116
- function httpGetOk(urlStr) {
117
- return new Promise((resolve, reject) => {
118
- const req = http.get(urlStr, (res) => {
119
- // Drain data to allow socket reuse.
120
- res.resume();
121
- resolve(res.statusCode === 200);
122
- });
123
- req.on("error", reject);
124
- req.setTimeout(3000, () => {
125
- req.destroy(new Error("HTTP timeout"));
126
- });
127
- });
128
- }
129
- async function fetchWsFromVersionEndpoint(port, timeoutMs) {
130
- const urlStr = `http://127.0.0.1:${port}/json/version`;
131
- const body = await httpGetBody(urlStr, timeoutMs);
132
- const parsed = JSON.parse(body);
133
- if (!parsed.webSocketDebuggerUrl) {
134
- throw new Error(`No webSocketDebuggerUrl in ${urlStr} response`);
135
- }
136
- return parsed.webSocketDebuggerUrl;
137
- }
138
- function httpGetBody(urlStr, timeoutMs) {
139
- return new Promise((resolve, reject) => {
140
- const req = http.get(urlStr, (res) => {
141
- let data = "";
142
- res.setEncoding("utf8");
143
- res.on("data", (chunk) => (data += chunk));
144
- res.on("end", () => {
145
- if (res.statusCode === 200)
146
- resolve(data);
147
- else
148
- reject(new Error(`HTTP ${res.statusCode}: ${data}`));
149
- });
150
- });
151
- req.on("error", reject);
152
- req.setTimeout(timeoutMs, () => req.destroy(new Error("HTTP timeout")));
153
- });
154
- }
155
- async function kill() {
156
- if (proc) {
157
- proc.kill("SIGTERM");
158
- await delay(300);
159
- proc.kill("SIGKILL");
160
- }
161
- }
162
- //# sourceMappingURL=cdp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cdp.js","sourceRoot":"","sources":["../../src/browserTask/cdp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,wDAqFC;AA4DD,oBAMC;AAxLD,4BAA4B;AAC5B,iDAAoD;AACpD,gDAAkC;AAClC,yCAA2B;AAC3B,2CAA6B;AAC7B,uCAAyB;AACzB,2CAA6B;AAC7B,2CAAsC;AAEtC,IAAI,IAAkB,CAAC;AAoBvB;;;GAGG;AACI,KAAK,UAAU,sBAAsB,CAC1C,IAA0B;;IAE1B,MAAM,EACJ,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,GAAG,EACH,SAAS,GAAG,KAAM,GACnB,GAAG,IAAI,CAAC;IAET,MAAM,cAAc,GAAG,qBAAQ,CAAC,cAAc,EAAE,CAAC;IAEjD,MAAM,WAAW,GACf,MAAA,IAAI,CAAC,WAAW,mCAChB,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAElE,MAAM,IAAI,GAAG;QACX,2BAA2B,EAAE,gCAAgC;QAC7D,mBAAmB,WAAW,EAAE;QAChC,gBAAgB;QAChB,4BAA4B;QAC5B,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,eA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AC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrB,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
@@ -1,108 +0,0 @@
1
- """
2
- Cookie Store for Browser Sessions
3
-
4
- This module provides persistent cookie storage for browser sessions,
5
- allowing cookies to be saved and restored across different browser task executions.
6
- """
7
-
8
- import json
9
- import os
10
- import time
11
- from pathlib import Path
12
- from typing import List, Dict, Any, Optional
13
- import logging
14
-
15
- logger = logging.getLogger(__name__)
16
-
17
-
18
- class CookieStore:
19
- """Persistent storage for browser cookies"""
20
-
21
- def __init__(self, base_dir: str):
22
- """
23
- Initialize cookie store
24
-
25
- Args:
26
- base_dir: Base directory for storing cookie files
27
- """
28
- self.base_dir = Path(base_dir)
29
-
30
- def _file_for(self) -> Path:
31
- """Get the path to the cookie storage file"""
32
- return self.base_dir / "last-session.json"
33
-
34
- async def save(self, cookies: List[Dict[str, Any]]) -> None:
35
- """
36
- Save cookies to persistent storage
37
-
38
- Args:
39
- cookies: List of cookie dictionaries to save
40
- """
41
- tmp_path = None
42
- try:
43
- # Create directory if it doesn't exist
44
- self.base_dir.mkdir(parents=True, exist_ok=True)
45
-
46
- file_path = self._file_for()
47
- tmp_path = file_path.with_suffix(f".tmp.{os.getpid()}")
48
-
49
- # Filter out expired cookies
50
- now = int(time.time())
51
- to_persist = [
52
- c for c in cookies
53
- if not c.get('expires') or c.get('expires', 0) > now
54
- ]
55
-
56
- # Write to temporary file first, then atomic rename
57
- with open(tmp_path, 'w') as f:
58
- json.dump({
59
- 'version': 1,
60
- 'cookies': to_persist
61
- }, f, indent=2)
62
-
63
- # Set secure file permissions (owner read/write only)
64
- os.chmod(tmp_path, 0o600)
65
-
66
- # Atomic rename (on POSIX systems)
67
- tmp_path.replace(file_path)
68
-
69
- logger.info(f"🍪 Saved {len(to_persist)} cookies to storage")
70
-
71
- except Exception as e:
72
- logger.warning(f"Failed to save cookies: {e}")
73
- # Clean up temp file if it exists
74
- if tmp_path and tmp_path.exists():
75
- try:
76
- tmp_path.unlink()
77
- except Exception:
78
- pass
79
-
80
- async def load(self) -> Optional[List[Dict[str, Any]]]:
81
- """
82
- Load cookies from persistent storage
83
-
84
- Returns:
85
- List of cookie dictionaries, or None if no cookies found
86
- """
87
- try:
88
- file_path = self._file_for()
89
-
90
- if not file_path.exists():
91
- logger.info("No stored cookies found")
92
- return None
93
-
94
- with open(file_path, 'r') as f:
95
- data = json.load(f)
96
-
97
- if not data or not isinstance(data.get('cookies'), list):
98
- logger.warning("Invalid cookie file format")
99
- return None
100
-
101
- cookies = data['cookies']
102
- logger.info(f"🍪 Loaded {len(cookies)} cookies from storage")
103
- return cookies
104
-
105
- except Exception as e:
106
- logger.warning(f"Failed to load cookies: {e}")
107
- return None
108
-
@@ -1,37 +0,0 @@
1
- import { MindedConnection } from '../platform/mindedConnection';
2
- export interface Guideline {
3
- id: string;
4
- name: string;
5
- content: string;
6
- index?: number;
7
- }
8
- export declare class GuidelinesManager {
9
- private guidelines;
10
- private mindedConnection;
11
- constructor(mindedConnection: MindedConnection | null);
12
- /**
13
- * Load guidelines from directories or platform
14
- */
15
- loadGuidelines(guidelinesDirectories?: string[]): Promise<Guideline[]>;
16
- /**
17
- * Load guidelines from local directories
18
- */
19
- private loadGuidelinesFromDirectories;
20
- /**
21
- * Recursively get all YAML files in a directory
22
- */
23
- private getAllYamlFiles;
24
- /**
25
- * Compile guidelines into a single string with EJS and placeholders
26
- */
27
- compileGuidelines(params?: Record<string, any>): string;
28
- /**
29
- * Replace placeholders in {key} format
30
- */
31
- private replacePlaceholders;
32
- /**
33
- * Get raw guidelines without compilation
34
- */
35
- getGuidelines(): Guideline[];
36
- }
37
- //# sourceMappingURL=guidelinesManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guidelinesManager.d.ts","sourceRoot":"","sources":["../../src/guidelines/guidelinesManager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAKhE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,gBAAgB,CAA0B;gBAEtC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAIrD;;OAEG;IACU,cAAc,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IA+BnF;;OAEG;IACH,OAAO,CAAC,6BAA6B;IA+BrC;;OAEG;IACH,OAAO,CAAC,eAAe;IAgBvB;;OAEG;IACI,iBAAiB,CAAC,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,MAAM;IA0BlE;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAiB3B;;OAEG;IACI,aAAa,IAAI,SAAS,EAAE;CAGpC"}
@@ -1,172 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.GuidelinesManager = void 0;
37
- const fs = __importStar(require("fs"));
38
- const path = __importStar(require("path"));
39
- const yaml = __importStar(require("js-yaml"));
40
- const ejs = __importStar(require("ejs"));
41
- const mindedConnectionTypes_1 = require("../platform/mindedConnectionTypes");
42
- const config_1 = require("../platform/config");
43
- const logger_1 = require("../utils/logger");
44
- class GuidelinesManager {
45
- constructor(mindedConnection) {
46
- this.guidelines = [];
47
- this.mindedConnection = mindedConnection;
48
- }
49
- /**
50
- * Load guidelines from directories or platform
51
- */
52
- async loadGuidelines(guidelinesDirectories) {
53
- const { env, isDeployed } = (0, config_1.getConfig)();
54
- if (['sandbox-staging', 'sandbox'].includes(env) && isDeployed && this.mindedConnection) {
55
- // Load from platform
56
- const response = await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.GET_GUIDELINES, {});
57
- if (response === null || response === void 0 ? void 0 : response.error) {
58
- throw new Error(`Failed to load guidelines from platform: ${response.error}`);
59
- }
60
- this.guidelines = (response === null || response === void 0 ? void 0 : response.guidelines) || [];
61
- }
62
- else if (guidelinesDirectories) {
63
- // Load from directories
64
- this.guidelines = this.loadGuidelinesFromDirectories(guidelinesDirectories);
65
- }
66
- // Sort guidelines by index if available
67
- this.guidelines.sort((a, b) => {
68
- if (a.index !== undefined && b.index !== undefined) {
69
- return a.index - b.index;
70
- }
71
- return 0;
72
- });
73
- return this.guidelines;
74
- }
75
- /**
76
- * Load guidelines from local directories
77
- */
78
- loadGuidelinesFromDirectories(directories) {
79
- const guidelines = [];
80
- for (const directory of directories) {
81
- if (!fs.existsSync(directory)) {
82
- logger_1.logger.info(`Guidelines directory does not exist: ${directory}`);
83
- continue;
84
- }
85
- const files = this.getAllYamlFiles(directory);
86
- for (const file of files) {
87
- try {
88
- const fileContent = fs.readFileSync(file, 'utf8');
89
- const guideline = yaml.load(fileContent);
90
- if (guideline && guideline.name && guideline.content) {
91
- guidelines.push(guideline);
92
- logger_1.logger.info(`Loaded guideline: ${guideline.name} from ${file}`);
93
- }
94
- else {
95
- logger_1.logger.warn(`Invalid guideline structure in ${file}`);
96
- }
97
- }
98
- catch (error) {
99
- logger_1.logger.error(`Failed to load guideline file ${file}: ${error}`);
100
- }
101
- }
102
- }
103
- return guidelines;
104
- }
105
- /**
106
- * Recursively get all YAML files in a directory
107
- */
108
- getAllYamlFiles(dir) {
109
- const files = [];
110
- const entries = fs.readdirSync(dir, { withFileTypes: true });
111
- for (const entry of entries) {
112
- const fullPath = path.join(dir, entry.name);
113
- if (entry.isDirectory()) {
114
- files.push(...this.getAllYamlFiles(fullPath));
115
- }
116
- else if (entry.name.endsWith('.yaml') || entry.name.endsWith('.yml')) {
117
- files.push(fullPath);
118
- }
119
- }
120
- return files;
121
- }
122
- /**
123
- * Compile guidelines into a single string with EJS and placeholders
124
- */
125
- compileGuidelines(params = {}) {
126
- if (this.guidelines.length === 0) {
127
- return '';
128
- }
129
- // Combine all guidelines into sections
130
- const sections = this.guidelines.map((guideline) => {
131
- return `# ${guideline.name}\n${guideline.content}`;
132
- });
133
- const combinedGuidelines = sections.join('\n\n');
134
- try {
135
- // First, render with EJS
136
- let compiledGuidelines = ejs.render(combinedGuidelines, params);
137
- // Then, replace placeholders in {} format
138
- compiledGuidelines = this.replacePlaceholders(compiledGuidelines, params);
139
- return compiledGuidelines;
140
- }
141
- catch (error) {
142
- logger_1.logger.error({ message: 'Error compiling guidelines', error });
143
- return combinedGuidelines; // Return uncompiled if there's an error
144
- }
145
- }
146
- /**
147
- * Replace placeholders in {key} format
148
- */
149
- replacePlaceholders(text, params) {
150
- return text.replace(/\{([^}]+)\}/g, (match, key) => {
151
- const keys = key.split('.');
152
- let value = params;
153
- for (const k of keys) {
154
- if (value && typeof value === 'object' && k in value) {
155
- value = value[k];
156
- }
157
- else {
158
- return match; // Return original if key not found
159
- }
160
- }
161
- return String(value);
162
- });
163
- }
164
- /**
165
- * Get raw guidelines without compilation
166
- */
167
- getGuidelines() {
168
- return this.guidelines;
169
- }
170
- }
171
- exports.GuidelinesManager = GuidelinesManager;
172
- //# sourceMappingURL=guidelinesManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guidelinesManager.js","sourceRoot":"","sources":["../../src/guidelines/guidelinesManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,8CAAgC;AAChC,yCAA2B;AAE3B,6EAAsF;AACtF,+CAA+C;AAC/C,4CAAyC;AASzC,MAAa,iBAAiB;IAI5B,YAAY,gBAAyC;QAH7C,eAAU,GAAgB,EAAE,CAAC;QAInC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,cAAc,CAAC,qBAAgC;QAC1D,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;QAExC,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxF,qBAAqB;YACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CACpD,yDAAiC,CAAC,cAAc,EAChD,EAAE,CACH,CAAC;YAEF,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,EAAE,CAAC;gBACpB,MAAM,IAAI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