@nebulaos/core 0.1.1 → 0.2.0

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.
@@ -15,6 +15,11 @@ export declare class Instruction implements IInstruction {
15
15
  * Suporta caminhos absolutos ou relativos ao CWD.
16
16
  */
17
17
  static fromFile(filePath: string, variables?: InstructionVariables): Promise<Instruction>;
18
+ /**
19
+ * Cria uma instrução a partir de um arquivo de texto de forma síncrona.
20
+ * Suporta caminhos absolutos ou relativos ao CWD.
21
+ */
22
+ static fromFileSync(filePath: string, variables?: InstructionVariables): Instruction;
18
23
  /**
19
24
  * Cria uma instrução a partir de uma string direta.
20
25
  */
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Instruction = void 0;
37
37
  const fs = __importStar(require("fs/promises"));
38
+ const fsSync = __importStar(require("fs"));
38
39
  class Instruction {
39
40
  content;
40
41
  variables = {};
@@ -66,6 +67,19 @@ class Instruction {
66
67
  throw new Error(`Failed to load instruction from file: ${filePath}. Error: ${error}`);
67
68
  }
68
69
  }
70
+ /**
71
+ * Cria uma instrução a partir de um arquivo de texto de forma síncrona.
72
+ * Suporta caminhos absolutos ou relativos ao CWD.
73
+ */
74
+ static fromFileSync(filePath, variables = {}) {
75
+ try {
76
+ const content = fsSync.readFileSync(filePath, "utf-8");
77
+ return new Instruction(content, variables);
78
+ }
79
+ catch (error) {
80
+ throw new Error(`Failed to load instruction from file: ${filePath}. Error: ${error}`);
81
+ }
82
+ }
69
83
  /**
70
84
  * Cria uma instrução a partir de uma string direta.
71
85
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebulaos/core",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Core primitives for NebulaOS (Agent, Workflow, Providers)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "uuid": "^9.0.1",
34
34
  "zod": "^3.0.0",
35
35
  "zod-to-json-schema": "^3.0.0",
36
- "@nebulaos/types": "0.1.0"
36
+ "@nebulaos/types": "0.1.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/jest": "^30.0.0",
@@ -44,8 +44,8 @@
44
44
  "ts-jest": "^29.4.6",
45
45
  "typescript": "^5.0.0",
46
46
  "@nebulaos/google-gemini": "0.0.1",
47
- "@nebulaos/oci": "0.0.1",
48
- "@nebulaos/openai": "0.0.1"
47
+ "@nebulaos/openai": "0.1.0",
48
+ "@nebulaos/oci": "0.0.1"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsc",