@fractal-solutions/qflow 1.0.44 → 1.0.46

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.
@@ -1102,6 +1102,73 @@ export function getToolDefinitions() {
1102
1102
  },
1103
1103
  required: ["adapter", "connection", "action"]
1104
1104
  }
1105
+ },
1106
+ {
1107
+ name: "s3",
1108
+ description: "Interacts with an S3-compatible object storage service.",
1109
+ parameters: {
1110
+ type: "object",
1111
+ properties: {
1112
+ accessKeyId: {
1113
+ type: "string",
1114
+ description: "Your S3 access key ID."
1115
+ },
1116
+ secretAccessKey: {
1117
+ type: "string",
1118
+ description: "Your S3 secret access key."
1119
+ },
1120
+ bucket: {
1121
+ type: "string",
1122
+ description: "The name of your S3 bucket."
1123
+ },
1124
+ endpoint: {
1125
+ type: "string",
1126
+ description: "The S3 endpoint URL."
1127
+ },
1128
+ region: {
1129
+ type: "string",
1130
+ description: "The S3 region."
1131
+ },
1132
+ action: {
1133
+ type: "string",
1134
+ enum: ["upload", "download", "delete", "presign", "list"],
1135
+ description: "The action to perform."
1136
+ },
1137
+ key: {
1138
+ type: "string",
1139
+ description: "The key of the object to operate on."
1140
+ },
1141
+ content: {
1142
+ type: "string",
1143
+ description: "The content to upload."
1144
+ },
1145
+ acl: {
1146
+ type: "string",
1147
+ description: "The access control list for presigned URLs."
1148
+ },
1149
+ expiresIn: {
1150
+ type: "number",
1151
+ description: "The expiration time for presigned URLs."
1152
+ },
1153
+ method: {
1154
+ type: "string",
1155
+ description: "The HTTP method for presigned URLs."
1156
+ },
1157
+ prefix: {
1158
+ type: "string",
1159
+ description: "The prefix for listing files."
1160
+ },
1161
+ maxKeys: {
1162
+ type: "number",
1163
+ description: "The maximum number of keys to return when listing files."
1164
+ },
1165
+ startAfter: {
1166
+ type: "string",
1167
+ description: "The key to start after when listing files."
1168
+ }
1169
+ },
1170
+ required: ["accessKeyId", "secretAccessKey", "bucket", "endpoint", "action", "key"]
1171
+ }
1105
1172
  }
1106
1173
  ];
1107
1174
  }
@@ -37,3 +37,9 @@ export * from "./subflow.js";
37
37
  export * from "./iterator.js";
38
38
  export * from "./openrouter_llm.js";
39
39
  export * from "./database.js";
40
+ export * from "./s3.js";
41
+ export * from "../agent/base_agent.js";
42
+ export * from "../agent/raor_agent.js";
43
+ export * from "../agent/ooda_agent.js";
44
+ export * from "../agent/lpavrl_agent.js";
45
+ export * from "../agent/pema_agent.js";
@@ -37,3 +37,9 @@ export * from './subflow.js';
37
37
  export * from './iterator.js';
38
38
  export * from './openrouter_llm.js';
39
39
  export * from './database.js';
40
+ export * from './s3.js';
41
+ export * from '../agent/base_agent.js';
42
+ export * from '../agent/raor_agent.js';
43
+ export * from '../agent/ooda_agent.js';
44
+ export * from '../agent/lpavrl_agent.js';
45
+ export * from '../agent/pema_agent.js';
@@ -37,7 +37,7 @@ export class InteractiveInputNode extends AsyncNode {
37
37
  case 'win32': // Windows
38
38
  // PowerShell for input box
39
39
  // (New-Object -TypeName Microsoft.VisualBasic.Interaction).InputBox("PROMPT", "TITLE", "DEFAULT")
40
- command = `powershell -Command "(New-Object -TypeName Microsoft.VisualBasic.Interaction).InputBox(\"${prompt}\", \"${title}\", \"${defaultValue}\")"`;
40
+ command = `powershell -Command "(New-Object -TypeName Microsoft.VisualBasic.Interaction).InputBox('${prompt}', '${title}', '${defaultValue}')"`;
41
41
  break;
42
42
  default:
43
43
  throw new Error(`Unsupported platform for InteractiveInputNode: ${platform}`);
@@ -0,0 +1,6 @@
1
+ export class S3CloudStorageNode extends AsyncNode {
2
+ execAsync(prepRes: any, shared: any): Promise<any>;
3
+ postAsync(shared: any, prepRes: any, execRes: any): Promise<string>;
4
+ #private;
5
+ }
6
+ import { AsyncNode } from '../qflow.js';
@@ -0,0 +1,38 @@
1
+ import { AsyncNode } from '../qflow.js';
2
+ import { S3Client } from 'bun';
3
+ export class S3CloudStorageNode extends AsyncNode {
4
+ #s3 = null;
5
+ async prepAsync(shared) {
6
+ const { accessKeyId, secretAccessKey, bucket, endpoint, region } = this.params;
7
+ if (!this.#s3) {
8
+ this.#s3 = new S3Client({
9
+ accessKeyId,
10
+ secretAccessKey,
11
+ bucket,
12
+ endpoint,
13
+ region,
14
+ });
15
+ }
16
+ }
17
+ async execAsync(prepRes, shared) {
18
+ const { action, key, content, acl, expiresIn, method, prefix, maxKeys, startAfter } = this.params;
19
+ switch (action) {
20
+ case 'upload':
21
+ return this.#s3.file(key).write(content);
22
+ case 'download':
23
+ return this.#s3.file(key).json();
24
+ case 'delete':
25
+ return this.#s3.file(key).delete();
26
+ case 'presign':
27
+ return this.#s3.file(key).presign({ acl, expiresIn, method });
28
+ case 'list':
29
+ return this.#s3.list({ prefix, maxKeys, startAfter });
30
+ default:
31
+ throw new Error(`Unsupported S3 action: ${action}`);
32
+ }
33
+ }
34
+ async postAsync(shared, prepRes, execRes) {
35
+ shared.s3_result = execRes;
36
+ return 'default';
37
+ }
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fractal-solutions/qflow",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
4
4
  "description": "A lightweight and flexible JavaScript library for creating and managing workflows and agents.",
5
5
  "main": "dist/qflow.js",
6
6
  "types": "dist/qflow.d.ts",