@loopstack/agent-example-workflow 0.1.1 → 0.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"agent-example.workflow.d.ts","sourceRoot":"","sources":["../src/agent-example.workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,YAAY,EASb,MAAM,mBAAmB,CAAC;AAE3B,QAAA,MAAM,mBAAmB;;;;;;iBAEvB,CAAC;AAEH,KAAK,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAOzD,qBAGa,oBAAqB,SAAQ,YAAY;IAClC,OAAO,CAAC,KAAK,CAAgB;IAGzC,KAAK;IAsBL,aAAa,CAAC,OAAO,EAAE,aAAa;CAY3C"}
1
+ {"version":3,"file":"agent-example.workflow.d.ts","sourceRoot":"","sources":["../src/agent-example.workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,YAAY,EASb,MAAM,mBAAmB,CAAC;AAE3B,QAAA,MAAM,mBAAmB;;;;;;iBAEvB,CAAC;AAEH,KAAK,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEzD,qBAGa,oBAAqB,SAAQ,YAAY;IAClC,OAAO,CAAC,KAAK,CAAgB;IAGzC,KAAK;IAsBL,aAAa,CAAC,OAAO,EAAE,aAAa;CAY3C"}
@@ -16,15 +16,11 @@ const common_1 = require("@loopstack/common");
16
16
  const AgentCallbackSchema = common_1.CallbackSchema.extend({
17
17
  data: zod_1.z.object({ response: zod_1.z.string() }),
18
18
  });
19
- const SYSTEM_PROMPT = `You are a helpful assistant with access to a weather lookup tool and a calculator.
20
- When the user asks about weather, use the weatherLookup tool.
21
- When the user asks for calculations, use the calculator tool.
22
- Provide a concise, helpful response summarizing the results.`;
23
19
  let AgentExampleWorkflow = class AgentExampleWorkflow extends common_1.BaseWorkflow {
24
20
  agent;
25
21
  async start() {
26
22
  const result = await this.agent.run({
27
- system: SYSTEM_PROMPT,
23
+ system: this.render(__dirname + '/templates/system.md'),
28
24
  tools: ['weatherLookup', 'calculator'],
29
25
  userMessage: "What's the weather in Tokyo? Also, what is 42 * 17?",
30
26
  }, { alias: 'agent', callback: { transition: 'agentComplete' } });
@@ -1 +1 @@
1
- {"version":3,"file":"agent-example.workflow.js","sourceRoot":"","sources":["../src/agent-example.workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAAwB;AACxB,4CAAiD;AACjD,8CAU2B;AAE3B,MAAM,mBAAmB,GAAG,uBAAc,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC;CACzC,CAAC,CAAC;AAIH,MAAM,aAAa,GAAG;;;6DAGuC,CAAC;AAKvD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,qBAAY;IAC1B,KAAK,CAAgB;IAGzC,AAAN,KAAK,CAAC,KAAK;QACT,MAAM,MAAM,GAAgB,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAC9C;YACE,MAAM,EAAE,aAAa;YACrB,KAAK,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC;YACtC,WAAW,EAAE,qDAAqD;SACnE,EACD,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,EAAE,CAC9D,CAAC;QAEF,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACxB,qBAAY,EACZ,EAAE,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EACzF,EAAE,EAAE,EAAE,QAAQ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,CAAC;;;;iDAgB1B;AAOK;IALL,IAAA,cAAK,EAAC;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,mBAAmB;KAC5B,CAAC;;;;yDAYD;+BArCU,oBAAoB;IAHhC,IAAA,iBAAQ,EAAC;QACR,QAAQ,EAAE,SAAS,GAAG,wBAAwB;KAC/C,CAAC;GACW,oBAAoB,CAsChC"}
@@ -0,0 +1,4 @@
1
+ You are a helpful assistant with access to a weather lookup tool and a calculator.
2
+ When the user asks about weather, use the weatherLookup tool.
3
+ When the user asks for calculations, use the calculator tool.
4
+ Provide a concise, helpful response summarizing the results.
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "claude",
10
10
  "sub-workflow"
11
11
  ],
12
- "version": "0.1.1",
12
+ "version": "0.1.2",
13
13
  "license": "MIT",
14
14
  "author": {
15
15
  "name": "Jakob Klippel",
@@ -30,9 +30,9 @@
30
30
  "watch": "nest build --watch"
31
31
  },
32
32
  "dependencies": {
33
- "@loopstack/agent": "^0.2.0",
34
- "@loopstack/common": "^0.28.0",
35
- "@loopstack/core": "^0.28.0",
33
+ "@loopstack/agent": "^0.3.0",
34
+ "@loopstack/common": "^0.29.0",
35
+ "@loopstack/core": "^0.29.0",
36
36
  "@nestjs/common": "^11.1.19",
37
37
  "zod": "^4.3.6"
38
38
  },
@@ -18,11 +18,6 @@ const AgentCallbackSchema = CallbackSchema.extend({
18
18
 
19
19
  type AgentCallback = z.infer<typeof AgentCallbackSchema>;
20
20
 
21
- const SYSTEM_PROMPT = `You are a helpful assistant with access to a weather lookup tool and a calculator.
22
- When the user asks about weather, use the weatherLookup tool.
23
- When the user asks for calculations, use the calculator tool.
24
- Provide a concise, helpful response summarizing the results.`;
25
-
26
21
  @Workflow({
27
22
  uiConfig: __dirname + '/agent-example.ui.yaml',
28
23
  })
@@ -33,7 +28,7 @@ export class AgentExampleWorkflow extends BaseWorkflow {
33
28
  async start() {
34
29
  const result: QueueResult = await this.agent.run(
35
30
  {
36
- system: SYSTEM_PROMPT,
31
+ system: this.render(__dirname + '/templates/system.md'),
37
32
  tools: ['weatherLookup', 'calculator'],
38
33
  userMessage: "What's the weather in Tokyo? Also, what is 42 * 17?",
39
34
  },
@@ -0,0 +1,4 @@
1
+ You are a helpful assistant with access to a weather lookup tool and a calculator.
2
+ When the user asks about weather, use the weatherLookup tool.
3
+ When the user asks for calculations, use the calculator tool.
4
+ Provide a concise, helpful response summarizing the results.