@the-open-engine/zeroshot 5.4.0 → 6.0.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.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/config-validator.js +39 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -503,6 +503,6 @@ The TUI is not included in this release. Use `zeroshot logs -f`, `zeroshot logs
|
|
|
503
503
|
|
|
504
504
|
---
|
|
505
505
|
|
|
506
|
-
MIT - [
|
|
506
|
+
MIT - [The Open Engine Company](https://github.com/the-open-engine)
|
|
507
507
|
|
|
508
508
|
Built on [Claude Code](https://claude.com/product/claude-code) by Anthropic.
|
package/package.json
CHANGED
package/src/config-validator.js
CHANGED
|
@@ -17,6 +17,13 @@ const { getProvider } = require('./providers');
|
|
|
17
17
|
const { CAPABILITIES } = require('./providers/capabilities');
|
|
18
18
|
const { GUIDANCE_TOPICS } = require('./guidance-topics');
|
|
19
19
|
|
|
20
|
+
const HOOK_ACTION_TOPIC_CONTRACTS = Object.freeze({
|
|
21
|
+
verify_pull_request: Object.freeze([
|
|
22
|
+
{ topic: 'CLUSTER_COMPLETE', keys: null },
|
|
23
|
+
{ topic: 'PUSH_BLOCKED', keys: null },
|
|
24
|
+
]),
|
|
25
|
+
});
|
|
26
|
+
|
|
20
27
|
/**
|
|
21
28
|
* Check if config is a conductor-bootstrap style config
|
|
22
29
|
* Conductor configs dynamically spawn agents via CLUSTER_OPERATIONS
|
|
@@ -288,6 +295,25 @@ function ensureTopicList(map, topic) {
|
|
|
288
295
|
return map.get(topic);
|
|
289
296
|
}
|
|
290
297
|
|
|
298
|
+
function getHookActionTopicContracts(hook) {
|
|
299
|
+
if (!hook?.action) {
|
|
300
|
+
return [];
|
|
301
|
+
}
|
|
302
|
+
return HOOK_ACTION_TOPIC_CONTRACTS[hook.action] || [];
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function recordOutputTopic(agent, topic, topicProducers, agentOutputTopics, producerId = agent.id) {
|
|
306
|
+
const producers = ensureTopicList(topicProducers, topic);
|
|
307
|
+
if (!producers.includes(producerId)) {
|
|
308
|
+
producers.push(producerId);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const outputs = agentOutputTopics.get(agent.id);
|
|
312
|
+
if (!outputs.includes(topic)) {
|
|
313
|
+
outputs.push(topic);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
291
317
|
function recordAgentTriggers(agent, topicConsumers, agentInputTopics) {
|
|
292
318
|
for (const trigger of agent.triggers || []) {
|
|
293
319
|
const topic = trigger.topic;
|
|
@@ -321,16 +347,19 @@ function extractDynamicTopicsFromScript(script, ctx) {
|
|
|
321
347
|
}
|
|
322
348
|
|
|
323
349
|
function recordAgentOutputs(agent, topicProducers, agentOutputTopics) {
|
|
350
|
+
const hook = agent.hooks?.onComplete;
|
|
324
351
|
const outputTopic = agent.hooks?.onComplete?.config?.topic;
|
|
325
352
|
if (outputTopic) {
|
|
326
|
-
|
|
327
|
-
agentOutputTopics.get(agent.id).push(outputTopic);
|
|
353
|
+
recordOutputTopic(agent, outputTopic, topicProducers, agentOutputTopics);
|
|
328
354
|
}
|
|
329
355
|
|
|
330
356
|
const ctx = { outputTopic, agentId: agent.id, topicProducers, agentOutputTopics };
|
|
331
|
-
const hook = agent.hooks?.onComplete;
|
|
332
357
|
extractDynamicTopicsFromScript(hook?.logic?.script, ctx);
|
|
333
358
|
extractDynamicTopicsFromScript(hook?.transform?.script, ctx);
|
|
359
|
+
|
|
360
|
+
for (const contract of getHookActionTopicContracts(hook)) {
|
|
361
|
+
recordOutputTopic(agent, contract.topic, topicProducers, agentOutputTopics);
|
|
362
|
+
}
|
|
334
363
|
}
|
|
335
364
|
|
|
336
365
|
function buildMessageFlowGraph(config) {
|
|
@@ -683,6 +712,13 @@ function collectTopicContracts(config) {
|
|
|
683
712
|
addContract(topic, { agentId: agent.id, keys: null });
|
|
684
713
|
}
|
|
685
714
|
}
|
|
715
|
+
|
|
716
|
+
for (const contract of getHookActionTopicContracts(hook)) {
|
|
717
|
+
addContract(contract.topic, {
|
|
718
|
+
agentId: agent.id,
|
|
719
|
+
keys: contract.keys instanceof Set ? new Set(contract.keys) : contract.keys,
|
|
720
|
+
});
|
|
721
|
+
}
|
|
686
722
|
}
|
|
687
723
|
|
|
688
724
|
return contracts;
|