@roackb2/heddle 0.0.7 → 0.0.9
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/README.md +207 -3
- package/dist/examples/cyberloop-observer.d.ts +3 -0
- package/dist/examples/cyberloop-observer.d.ts.map +1 -0
- package/dist/examples/cyberloop-observer.js +79 -0
- package/dist/examples/cyberloop-observer.js.map +1 -0
- package/dist/examples/heartbeat.d.ts +2 -0
- package/dist/examples/heartbeat.d.ts.map +1 -0
- package/dist/examples/heartbeat.js +61 -0
- package/dist/examples/heartbeat.js.map +1 -0
- package/dist/examples/host-events.d.ts +15 -0
- package/dist/examples/host-events.d.ts.map +1 -0
- package/dist/examples/host-events.js +233 -0
- package/dist/examples/host-events.js.map +1 -0
- package/dist/examples/programmatic-loop.d.ts +2 -0
- package/dist/examples/programmatic-loop.d.ts.map +1 -0
- package/dist/examples/programmatic-loop.js +128 -0
- package/dist/examples/programmatic-loop.js.map +1 -0
- package/dist/src/cli/ask.d.ts.map +1 -1
- package/dist/src/cli/ask.js +10 -41
- package/dist/src/cli/ask.js.map +1 -1
- package/dist/src/cli/chat/App.d.ts.map +1 -1
- package/dist/src/cli/chat/App.js +48 -0
- package/dist/src/cli/chat/App.js.map +1 -1
- package/dist/src/cli/chat/hooks/useAgentRun.d.ts +9 -0
- package/dist/src/cli/chat/hooks/useAgentRun.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/useAgentRun.js +47 -26
- package/dist/src/cli/chat/hooks/useAgentRun.js.map +1 -1
- package/dist/src/cli/chat/state/local-commands.d.ts +3 -0
- package/dist/src/cli/chat/state/local-commands.d.ts.map +1 -1
- package/dist/src/cli/chat/state/local-commands.js +21 -0
- package/dist/src/cli/chat/state/local-commands.js.map +1 -1
- package/dist/src/cli/chat/state/storage.d.ts.map +1 -1
- package/dist/src/cli/chat/state/storage.js +2 -0
- package/dist/src/cli/chat/state/storage.js.map +1 -1
- package/dist/src/cli/chat/state/types.d.ts +1 -0
- package/dist/src/cli/chat/state/types.d.ts.map +1 -1
- package/dist/src/cli/chat/submit.d.ts +3 -0
- package/dist/src/cli/chat/submit.d.ts.map +1 -1
- package/dist/src/cli/chat/submit.js +3 -0
- package/dist/src/cli/chat/submit.js.map +1 -1
- package/dist/src/cli/chat/utils/format.d.ts.map +1 -1
- package/dist/src/cli/chat/utils/format.js +6 -0
- package/dist/src/cli/chat/utils/format.js.map +1 -1
- package/dist/src/cli/chat/utils/runtime.d.ts.map +1 -1
- package/dist/src/cli/chat/utils/runtime.js +3 -19
- package/dist/src/cli/chat/utils/runtime.js.map +1 -1
- package/dist/src/cli/main.js +0 -0
- package/dist/src/index.d.ts +16 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/integrations/cyberloop-kinematics.d.ts +16 -0
- package/dist/src/integrations/cyberloop-kinematics.d.ts.map +1 -0
- package/dist/src/integrations/cyberloop-kinematics.js +77 -0
- package/dist/src/integrations/cyberloop-kinematics.js.map +1 -0
- package/dist/src/integrations/cyberloop.d.ts +88 -0
- package/dist/src/integrations/cyberloop.d.ts.map +1 -0
- package/dist/src/integrations/cyberloop.js +244 -0
- package/dist/src/integrations/cyberloop.js.map +1 -0
- package/dist/src/llm/factory.d.ts +1 -1
- package/dist/src/llm/factory.d.ts.map +1 -1
- package/dist/src/llm/factory.js +2 -19
- package/dist/src/llm/factory.js.map +1 -1
- package/dist/src/llm/providers.d.ts +3 -0
- package/dist/src/llm/providers.d.ts.map +1 -0
- package/dist/src/llm/providers.js +21 -0
- package/dist/src/llm/providers.js.map +1 -0
- package/dist/src/run-agent.d.ts +3 -1
- package/dist/src/run-agent.d.ts.map +1 -1
- package/dist/src/run-agent.js +10 -0
- package/dist/src/run-agent.js.map +1 -1
- package/dist/src/runtime/agent-loop.d.ts +42 -0
- package/dist/src/runtime/agent-loop.d.ts.map +1 -0
- package/dist/src/runtime/agent-loop.js +173 -0
- package/dist/src/runtime/agent-loop.js.map +1 -0
- package/dist/src/runtime/api-keys.d.ts +8 -0
- package/dist/src/runtime/api-keys.d.ts.map +1 -0
- package/dist/src/runtime/api-keys.js +25 -0
- package/dist/src/runtime/api-keys.js.map +1 -0
- package/dist/src/runtime/default-tools.d.ts +12 -0
- package/dist/src/runtime/default-tools.d.ts.map +1 -0
- package/dist/src/runtime/default-tools.js +40 -0
- package/dist/src/runtime/default-tools.js.map +1 -0
- package/dist/src/runtime/events.d.ts +128 -0
- package/dist/src/runtime/events.d.ts.map +1 -0
- package/dist/src/runtime/events.js +41 -0
- package/dist/src/runtime/events.js.map +1 -0
- package/dist/src/runtime/heartbeat-store.d.ts +20 -0
- package/dist/src/runtime/heartbeat-store.d.ts.map +1 -0
- package/dist/src/runtime/heartbeat-store.js +42 -0
- package/dist/src/runtime/heartbeat-store.js.map +1 -0
- package/dist/src/runtime/heartbeat.d.ts +39 -0
- package/dist/src/runtime/heartbeat.d.ts.map +1 -0
- package/dist/src/runtime/heartbeat.js +117 -0
- package/dist/src/runtime/heartbeat.js.map +1 -0
- package/dist/src/trace/format.d.ts.map +1 -1
- package/dist/src/trace/format.js +8 -0
- package/dist/src/trace/format.js.map +1 -1
- package/dist/src/types.d.ts +8 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/logger.d.ts.map +1 -1
- package/dist/src/utils/logger.js +2 -2
- package/dist/src/utils/logger.js.map +1 -1
- package/package.json +31 -2
- package/dist/src/__tests__/chat-activity-format.test.d.ts +0 -2
- package/dist/src/__tests__/chat-activity-format.test.d.ts.map +0 -1
- package/dist/src/__tests__/chat-activity-format.test.js +0 -41
- package/dist/src/__tests__/chat-activity-format.test.js.map +0 -1
- package/dist/src/__tests__/chat-compaction.test.d.ts +0 -2
- package/dist/src/__tests__/chat-compaction.test.d.ts.map +0 -1
- package/dist/src/__tests__/chat-compaction.test.js +0 -63
- package/dist/src/__tests__/chat-compaction.test.js.map +0 -1
- package/dist/src/__tests__/chat-format.test.d.ts +0 -2
- package/dist/src/__tests__/chat-format.test.d.ts.map +0 -1
- package/dist/src/__tests__/chat-format.test.js +0 -137
- package/dist/src/__tests__/chat-format.test.js.map +0 -1
- package/dist/src/__tests__/chat-runtime.test.d.ts +0 -2
- package/dist/src/__tests__/chat-runtime.test.d.ts.map +0 -1
- package/dist/src/__tests__/chat-runtime.test.js +0 -39
- package/dist/src/__tests__/chat-runtime.test.js.map +0 -1
- package/dist/src/__tests__/core-utils.test.d.ts +0 -2
- package/dist/src/__tests__/core-utils.test.d.ts.map +0 -1
- package/dist/src/__tests__/core-utils.test.js +0 -87
- package/dist/src/__tests__/core-utils.test.js.map +0 -1
- package/dist/src/__tests__/file-mentions.test.d.ts +0 -2
- package/dist/src/__tests__/file-mentions.test.d.ts.map +0 -1
- package/dist/src/__tests__/file-mentions.test.js +0 -29
- package/dist/src/__tests__/file-mentions.test.js.map +0 -1
- package/dist/src/__tests__/llm-factory.test.d.ts +0 -2
- package/dist/src/__tests__/llm-factory.test.d.ts.map +0 -1
- package/dist/src/__tests__/llm-factory.test.js +0 -45
- package/dist/src/__tests__/llm-factory.test.js.map +0 -1
- package/dist/src/__tests__/local-commands.test.d.ts +0 -2
- package/dist/src/__tests__/local-commands.test.d.ts.map +0 -1
- package/dist/src/__tests__/local-commands.test.js +0 -153
- package/dist/src/__tests__/local-commands.test.js.map +0 -1
- package/dist/src/__tests__/project-approval-rules.test.d.ts +0 -2
- package/dist/src/__tests__/project-approval-rules.test.d.ts.map +0 -1
- package/dist/src/__tests__/project-approval-rules.test.js +0 -135
- package/dist/src/__tests__/project-approval-rules.test.js.map +0 -1
- package/dist/src/__tests__/prompt-input.test.d.ts +0 -2
- package/dist/src/__tests__/prompt-input.test.d.ts.map +0 -1
- package/dist/src/__tests__/prompt-input.test.js +0 -57
- package/dist/src/__tests__/prompt-input.test.js.map +0 -1
- package/dist/src/__tests__/prompts.test.d.ts +0 -2
- package/dist/src/__tests__/prompts.test.d.ts.map +0 -1
- package/dist/src/__tests__/prompts.test.js +0 -46
- package/dist/src/__tests__/prompts.test.js.map +0 -1
- package/dist/src/__tests__/run-agent.test.d.ts +0 -2
- package/dist/src/__tests__/run-agent.test.d.ts.map +0 -1
- package/dist/src/__tests__/run-agent.test.js +0 -1276
- package/dist/src/__tests__/run-agent.test.js.map +0 -1
- package/dist/src/__tests__/run-shell.command.test.d.ts +0 -2
- package/dist/src/__tests__/run-shell.command.test.d.ts.map +0 -1
- package/dist/src/__tests__/run-shell.command.test.js +0 -188
- package/dist/src/__tests__/run-shell.command.test.js.map +0 -1
- package/dist/src/__tests__/smoke.test.d.ts +0 -2
- package/dist/src/__tests__/smoke.test.d.ts.map +0 -1
- package/dist/src/__tests__/smoke.test.js +0 -314
- package/dist/src/__tests__/smoke.test.js.map +0 -1
- package/dist/src/__tests__/tools.test.d.ts +0 -2
- package/dist/src/__tests__/tools.test.d.ts.map +0 -1
- package/dist/src/__tests__/tools.test.js +0 -698
- package/dist/src/__tests__/tools.test.js.map +0 -1
- package/dist/src/__tests__/trace-format.test.d.ts +0 -2
- package/dist/src/__tests__/trace-format.test.d.ts.map +0 -1
- package/dist/src/__tests__/trace-format.test.js +0 -148
- package/dist/src/__tests__/trace-format.test.js.map +0 -1
- package/dist/src/cli/chat/actions.d.ts +0 -47
- package/dist/src/cli/chat/actions.d.ts.map +0 -1
- package/dist/src/cli/chat/actions.js +0 -215
- package/dist/src/cli/chat/actions.js.map +0 -1
- package/dist/src/cli/chat/format.d.ts +0 -23
- package/dist/src/cli/chat/format.d.ts.map +0 -1
- package/dist/src/cli/chat/format.js +0 -243
- package/dist/src/cli/chat/format.js.map +0 -1
- package/dist/src/cli/chat/local-commands.d.ts +0 -17
- package/dist/src/cli/chat/local-commands.d.ts.map +0 -1
- package/dist/src/cli/chat/local-commands.js +0 -180
- package/dist/src/cli/chat/local-commands.js.map +0 -1
- package/dist/src/cli/chat/panels.d.ts +0 -37
- package/dist/src/cli/chat/panels.d.ts.map +0 -1
- package/dist/src/cli/chat/panels.js +0 -142
- package/dist/src/cli/chat/panels.js.map +0 -1
- package/dist/src/cli/chat/runtime.d.ts +0 -26
- package/dist/src/cli/chat/runtime.d.ts.map +0 -1
- package/dist/src/cli/chat/runtime.js +0 -28
- package/dist/src/cli/chat/runtime.js.map +0 -1
- package/dist/src/cli/chat/storage.d.ts +0 -13
- package/dist/src/cli/chat/storage.d.ts.map +0 -1
- package/dist/src/cli/chat/storage.js +0 -126
- package/dist/src/cli/chat/storage.js.map +0 -1
- package/dist/src/cli/chat/types.d.ts +0 -51
- package/dist/src/cli/chat/types.d.ts.map +0 -1
- package/dist/src/cli/chat/types.js +0 -2
- package/dist/src/cli/chat/types.js.map +0 -1
- package/dist/src/cli/chat/use-run-state.d.ts +0 -23
- package/dist/src/cli/chat/use-run-state.d.ts.map +0 -1
- package/dist/src/cli/chat/use-run-state.js +0 -118
- package/dist/src/cli/chat/use-run-state.js.map +0 -1
- package/dist/src/cli/chat/use-sessions.d.ts +0 -21
- package/dist/src/cli/chat/use-sessions.d.ts.map +0 -1
- package/dist/src/cli/chat/use-sessions.js +0 -111
- package/dist/src/cli/chat/use-sessions.js.map +0 -1
- package/dist/src/cli/chat-actions.d.ts +0 -47
- package/dist/src/cli/chat-actions.d.ts.map +0 -1
- package/dist/src/cli/chat-actions.js +0 -215
- package/dist/src/cli/chat-actions.js.map +0 -1
- package/dist/src/cli/chat-format.d.ts +0 -23
- package/dist/src/cli/chat-format.d.ts.map +0 -1
- package/dist/src/cli/chat-format.js +0 -243
- package/dist/src/cli/chat-format.js.map +0 -1
- package/dist/src/cli/chat-local-commands.d.ts +0 -17
- package/dist/src/cli/chat-local-commands.d.ts.map +0 -1
- package/dist/src/cli/chat-local-commands.js +0 -180
- package/dist/src/cli/chat-local-commands.js.map +0 -1
- package/dist/src/cli/chat-panels.d.ts +0 -37
- package/dist/src/cli/chat-panels.d.ts.map +0 -1
- package/dist/src/cli/chat-panels.js +0 -142
- package/dist/src/cli/chat-panels.js.map +0 -1
- package/dist/src/cli/chat-runtime.d.ts +0 -26
- package/dist/src/cli/chat-runtime.d.ts.map +0 -1
- package/dist/src/cli/chat-runtime.js +0 -28
- package/dist/src/cli/chat-runtime.js.map +0 -1
- package/dist/src/cli/chat-storage.d.ts +0 -13
- package/dist/src/cli/chat-storage.d.ts.map +0 -1
- package/dist/src/cli/chat-storage.js +0 -126
- package/dist/src/cli/chat-storage.js.map +0 -1
- package/dist/src/cli/chat-submit.d.ts +0 -28
- package/dist/src/cli/chat-submit.d.ts.map +0 -1
- package/dist/src/cli/chat-submit.js +0 -90
- package/dist/src/cli/chat-submit.js.map +0 -1
- package/dist/src/cli/chat-types.d.ts +0 -51
- package/dist/src/cli/chat-types.d.ts.map +0 -1
- package/dist/src/cli/chat-types.js +0 -2
- package/dist/src/cli/chat-types.js.map +0 -1
- package/dist/src/cli/chat.d.ts +0 -4
- package/dist/src/cli/chat.d.ts.map +0 -1
- package/dist/src/cli/chat.js +0 -153
- package/dist/src/cli/chat.js.map +0 -1
- package/dist/src/cli/useChatRunState.d.ts +0 -23
- package/dist/src/cli/useChatRunState.d.ts.map +0 -1
- package/dist/src/cli/useChatRunState.js +0 -118
- package/dist/src/cli/useChatRunState.js.map +0 -1
- package/dist/src/cli/useChatSessions.d.ts +0 -21
- package/dist/src/cli/useChatSessions.d.ts.map +0 -1
- package/dist/src/cli/useChatSessions.js +0 -111
- package/dist/src/cli/useChatSessions.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
# Heddle
|
|
2
2
|
|
|
3
|
-
Heddle is a terminal coding agent runtime and CLI.
|
|
3
|
+
Heddle is a terminal coding agent runtime and CLI with optional semantic drift detection.
|
|
4
4
|
|
|
5
5
|
It is built to feel like a terminal partner that understands your project, keeps continuity across real work, and becomes more useful over time.
|
|
6
6
|
|
|
7
|
-
It is open source, provider-agnostic, supports OpenAI and Anthropic models, and can build memory across sessions.
|
|
7
|
+
It is open source, provider-agnostic, supports OpenAI and Anthropic models, and can build memory across sessions. For agentic-system builders, Heddle also exposes heartbeat primitives for autonomous wake cycles, checkpointing, and long-running background work.
|
|
8
|
+
|
|
9
|
+
Heddle is designed to make live agent runs more observable, not just easier to launch. With optional semantic drift detection, Heddle can show whether an agent appears to be going off track based on its recent trajectory, surface `drift=unknown|low|medium|high` in chat, and write drift annotations into saved traces instead of leaving you to infer that only from token usage and tool calls.
|
|
10
|
+
|
|
11
|
+
If you are interested in the underlying methodology, Heddle's drift telemetry is powered by [CyberLoop on npm](https://www.npmjs.com/package/cyberloop). See the [CyberLoop repository](https://github.com/roackb2/cyberloop) and [paper](https://zenodo.org/records/18138161) for the geometric-control and trajectory-based details.
|
|
8
12
|
|
|
9
13
|
## How Heddle Helps
|
|
10
14
|
|
|
@@ -17,7 +21,12 @@ It is open source, provider-agnostic, supports OpenAI and Anthropic models, and
|
|
|
17
21
|
|
|
18
22
|
## Advanced Capabilities
|
|
19
23
|
|
|
24
|
+
- optional CyberLoop-powered semantic drift detection in chat and traces with `/drift on`
|
|
20
25
|
- provider-agnostic model support across OpenAI and Anthropic
|
|
26
|
+
- embeddable `runAgentLoop` API for building non-CLI agent hosts
|
|
27
|
+
- `runAgentHeartbeat` for scheduler-driven autonomous wake cycles without chat by default
|
|
28
|
+
- serializable checkpoints for resume, background execution, and hosted workers
|
|
29
|
+
- CyberLoop-compatible observer hooks for host-side runtime instrumentation
|
|
21
30
|
- provider-backed hosted web search through `web_search`
|
|
22
31
|
- local image viewing from referenced file paths through `view_image`
|
|
23
32
|
- inline `@file` mentions that tell the agent which workspace files to inspect first
|
|
@@ -44,6 +53,22 @@ npx @roackb2/heddle
|
|
|
44
53
|
|
|
45
54
|
The installed CLI command remains `heddle`.
|
|
46
55
|
|
|
56
|
+
If you want optional CyberLoop drift telemetry in chat with `/drift on`, or you want to import `cyberloop/advanced` in your own host, install `cyberloop` in the same environment as Heddle:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g cyberloop
|
|
60
|
+
# or for project-local usage
|
|
61
|
+
npm install cyberloop
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The plain `npx @roackb2/heddle` path does not include optional peer dependencies. For one-off drift-enabled usage, install both packages locally or run:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx -p @roackb2/heddle -p cyberloop heddle
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If you are developing inside the Heddle repo itself, `yarn install` also installs `cyberloop` through `devDependencies`, so `yarn chat:dev` can use the published package path without extra setup.
|
|
71
|
+
|
|
47
72
|
## Quick Start
|
|
48
73
|
|
|
49
74
|
1. Set an API key for a supported provider.
|
|
@@ -85,6 +110,10 @@ Heddle currently supports:
|
|
|
85
110
|
- automatic conversation compaction so longer chats preserve context instead of growing unbounded
|
|
86
111
|
- manual `/compact` to shrink the current session transcript on demand
|
|
87
112
|
- persistent workspace memory notes under `.heddle/memory/`
|
|
113
|
+
- autonomous heartbeat wake cycles through `runAgentHeartbeat`
|
|
114
|
+
- serializable run checkpoints for programmatic hosts and later continuation
|
|
115
|
+
- passive CyberLoop-compatible observation through `createCyberLoopObserver`
|
|
116
|
+
- optional chat-mode CyberLoop semantic drift telemetry with `/drift on`
|
|
88
117
|
- short working-plan support through `update_plan` for substantial multi-step tasks
|
|
89
118
|
- remembered per-project approvals for repeated commands and edits
|
|
90
119
|
- interrupt and resume support for longer-running coding workflows
|
|
@@ -98,6 +127,51 @@ The planning workflow is also intentionally lightweight: Heddle does not force a
|
|
|
98
127
|
|
|
99
128
|
The web-search workflow is provider-backed rather than crawler-backed: OpenAI models use OpenAI-hosted web search, and Anthropic models use Anthropic-hosted web search when available through the selected model/tool path.
|
|
100
129
|
|
|
130
|
+
The CyberLoop workflow is observe-only. When `/drift on` is enabled, Heddle loads real [CyberLoop](https://www.npmjs.com/package/cyberloop) kinematics middleware, embeds runtime frames with OpenAI embeddings, shows `drift=unknown|low|medium|high` in the footer, and writes `cyberloop.annotation` events into saved traces. The toggle is saved on the active chat session, and `/drift` reports the last unavailable reason if the middleware or embeddings fail. Heddle does not calculate semantic drift itself. For the underlying methodology, see the [CyberLoop repository](https://github.com/roackb2/cyberloop) and [paper](https://zenodo.org/records/18138161).
|
|
131
|
+
|
|
132
|
+
## Heartbeat
|
|
133
|
+
|
|
134
|
+
Heddle exposes `runAgentHeartbeat` for autonomous, scheduler-driven agent work.
|
|
135
|
+
|
|
136
|
+
Heartbeat is not an interactive chat mode. It is a host/runtime primitive for systems that want to wake an agent periodically, let it work within budget and approval limits, checkpoint the result, and decide what should happen next.
|
|
137
|
+
|
|
138
|
+
A heartbeat wake cycle:
|
|
139
|
+
|
|
140
|
+
- loads a durable task plus an optional checkpoint
|
|
141
|
+
- resumes prior transcript state if available
|
|
142
|
+
- lets the agent do bounded useful work without a human prompt
|
|
143
|
+
- checkpoints the new state
|
|
144
|
+
- returns a decision: `continue`, `pause`, `complete`, or `escalate`
|
|
145
|
+
|
|
146
|
+
This is intended for hosted workers, local schedulers, long-running agents, and systems like agent social platforms where agents need to keep working over time without staying in a live chat session.
|
|
147
|
+
|
|
148
|
+
Heartbeat uses a larger default step budget than ordinary short chat runs so a wake cycle has room to inspect, act, and checkpoint. Hosts can still pass `maxSteps` when they need stricter control.
|
|
149
|
+
|
|
150
|
+
Try a small local heartbeat example:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
export OPENAI_API_KEY=your_key_here
|
|
154
|
+
yarn example:heartbeat
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The example stores its checkpoint at `.heddle/examples/heartbeat-demo-checkpoint.json`, so running it again resumes from the previous wake cycle.
|
|
158
|
+
|
|
159
|
+
For hosts that want storage handled by Heddle, use `runStoredHeartbeat` with a checkpoint store:
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
import { createFileHeartbeatCheckpointStore, runStoredHeartbeat } from '@roackb2/heddle'
|
|
163
|
+
|
|
164
|
+
const result = await runStoredHeartbeat({
|
|
165
|
+
task: 'Keep this project moving when safe autonomous progress is available',
|
|
166
|
+
store: createFileHeartbeatCheckpointStore({
|
|
167
|
+
path: '.heddle/heartbeat/project-maintenance.json',
|
|
168
|
+
}),
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
// result.nextDelayMs is a scheduling hint. The host still owns the timer,
|
|
172
|
+
// cron job, queue, worker, or hosted scheduler that wakes the agent again.
|
|
173
|
+
```
|
|
174
|
+
|
|
101
175
|
## Knowledge Persistence
|
|
102
176
|
|
|
103
177
|
Heddle can maintain durable workspace knowledge under `.heddle/memory/`.
|
|
@@ -180,6 +254,9 @@ Useful chat commands:
|
|
|
180
254
|
- `/session close <id>`: remove a saved session
|
|
181
255
|
- `/clear`: clear the current transcript
|
|
182
256
|
- `/compact`: compact older session history immediately
|
|
257
|
+
- `/drift`: show CyberLoop semantic drift detection status
|
|
258
|
+
- `/drift on`: enable observe-only CyberLoop kinematics telemetry for chat runs
|
|
259
|
+
- `/drift off`: disable CyberLoop semantic drift detection
|
|
183
260
|
- `!<command>`: run a shell command directly in chat
|
|
184
261
|
|
|
185
262
|
Direct shell in chat:
|
|
@@ -194,6 +271,14 @@ Read-oriented commands stay in inspect mode when possible. Workspace-changing or
|
|
|
194
271
|
|
|
195
272
|
Chat state is stored under `.heddle/`, including saved sessions, traces, approvals, and memory notes. The footer context indicator is an estimate of total request input against the active model's context window, not only the raw chat history length.
|
|
196
273
|
|
|
274
|
+
For local development against the sibling CyberLoop repo, run chat with the middleware module path:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
HEDDLE_CYBERLOOP_ADVANCED_MODULE=/Users/roackb2/Studio/projects/CyberLoop/src/advanced/kinematics-middleware.ts yarn chat:dev:openai
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Then use `/drift on` before asking Heddle to do real work. For installed usage, install the optional `cyberloop` peer dependency in the same environment as Heddle so it can dynamically import `cyberloop/advanced`.
|
|
281
|
+
|
|
197
282
|
## CLI Usage
|
|
198
283
|
|
|
199
284
|
Supported commands:
|
|
@@ -274,9 +359,102 @@ Field notes:
|
|
|
274
359
|
|
|
275
360
|
## Programmatic Use
|
|
276
361
|
|
|
277
|
-
The npm package
|
|
362
|
+
The npm package exports a programmatic execution loop for building other agent hosts on top of Heddle.
|
|
363
|
+
|
|
364
|
+
Use `runAgentLoop` when you want Heddle to assemble the model adapter, default tool bundle, memory tools, and event stream:
|
|
365
|
+
|
|
366
|
+
```ts
|
|
367
|
+
import { runAgentLoop } from '@roackb2/heddle'
|
|
368
|
+
|
|
369
|
+
const result = await runAgentLoop({
|
|
370
|
+
goal: 'Inspect this repo and summarize the main architecture',
|
|
371
|
+
model: 'gpt-5.1-codex',
|
|
372
|
+
workspaceRoot: process.cwd(),
|
|
373
|
+
onEvent(event) {
|
|
374
|
+
// Render progress, persist traces, feed middleware, or bridge into another app.
|
|
375
|
+
console.log(event.type)
|
|
376
|
+
},
|
|
377
|
+
})
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Persist `result.state` or wrap it with `createAgentLoopCheckpoint(result.state)` when another host needs to continue later:
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
import { createAgentLoopCheckpoint, runAgentLoop } from '@roackb2/heddle'
|
|
384
|
+
|
|
385
|
+
const checkpoint = createAgentLoopCheckpoint(result.state)
|
|
386
|
+
|
|
387
|
+
await runAgentLoop({
|
|
388
|
+
goal: 'Continue from the prior run and identify the next action',
|
|
389
|
+
resumeFrom: checkpoint,
|
|
390
|
+
})
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
The loop emits structured events for:
|
|
394
|
+
|
|
395
|
+
- loop start and finish
|
|
396
|
+
- assistant streaming updates
|
|
397
|
+
- trace events such as tool calls, tool results, approvals, and final outcome
|
|
398
|
+
|
|
399
|
+
The returned result also includes a serializable `state` object with the model, provider, workspace root, outcome, transcript, trace, usage, and timestamps. This is the boundary future hosts can persist for background execution, dashboards, middleware, or heartbeat-style continuation.
|
|
400
|
+
|
|
401
|
+
For passive semantic-drift experiments, `createCyberLoopObserver` can consume Heddle's event stream and run CyberLoop-compatible middleware over normalized runtime frames:
|
|
402
|
+
|
|
403
|
+
```ts
|
|
404
|
+
import {
|
|
405
|
+
createCyberLoopObserver,
|
|
406
|
+
createRuntimeFrameEmbedder,
|
|
407
|
+
runAgentLoop,
|
|
408
|
+
} from '@roackb2/heddle'
|
|
409
|
+
import { kinematicsMiddleware } from 'cyberloop/advanced'
|
|
410
|
+
|
|
411
|
+
const frameEmbedder = createRuntimeFrameEmbedder({
|
|
412
|
+
async embedText(text) {
|
|
413
|
+
return embedWithYourProvider(text)
|
|
414
|
+
},
|
|
415
|
+
})
|
|
416
|
+
|
|
417
|
+
const observer = createCyberLoopObserver({
|
|
418
|
+
middleware: [
|
|
419
|
+
kinematicsMiddleware({
|
|
420
|
+
embedder: frameEmbedder,
|
|
421
|
+
goalEmbedding: await embedWithYourProvider('Investigate this repo'),
|
|
422
|
+
}),
|
|
423
|
+
],
|
|
424
|
+
onAnnotation(annotation) {
|
|
425
|
+
console.log(annotation.driftLevel, annotation.frame.kind)
|
|
426
|
+
},
|
|
427
|
+
})
|
|
428
|
+
|
|
429
|
+
await runAgentLoop({
|
|
430
|
+
goal: 'Investigate this repo',
|
|
431
|
+
onEvent: observer.handleEvent,
|
|
432
|
+
})
|
|
433
|
+
await observer.flush()
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
This is intentionally observe-only. Heddle still owns execution, tools, approvals, and checkpoints; CyberLoop-style middleware can annotate the run without steering or halting it. Heddle does not calculate semantic drift itself; actual drift signals should come from CyberLoop metadata such as kinematics, manifold, or Grassmannian channels.
|
|
437
|
+
|
|
438
|
+
For autonomous background work, `runAgentHeartbeat` runs one wake cycle from a durable task and optional checkpoint:
|
|
439
|
+
|
|
440
|
+
```ts
|
|
441
|
+
import { runAgentHeartbeat } from '@roackb2/heddle'
|
|
442
|
+
|
|
443
|
+
const heartbeat = await runAgentHeartbeat({
|
|
444
|
+
task: 'Check whether there is safe maintenance work to do for this project',
|
|
445
|
+
checkpoint,
|
|
446
|
+
maxSteps: 8,
|
|
447
|
+
})
|
|
448
|
+
|
|
449
|
+
// Persist heartbeat.checkpoint, then schedule the next wake based on heartbeat.decision.
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
Heartbeat is not chat by default. It is meant for scheduler-driven agents that wake up, reload state, do bounded autonomous work, checkpoint, and either continue, pause, complete, or escalate.
|
|
453
|
+
|
|
454
|
+
Lower-level pieces are still exported for custom hosts, including:
|
|
278
455
|
|
|
279
456
|
- `runAgent`
|
|
457
|
+
- `createDefaultAgentTools`
|
|
280
458
|
- LLM adapter helpers
|
|
281
459
|
- built-in tools
|
|
282
460
|
- trace utilities
|
|
@@ -287,6 +465,32 @@ Install as a dependency with:
|
|
|
287
465
|
npm install @roackb2/heddle
|
|
288
466
|
```
|
|
289
467
|
|
|
468
|
+
If you want CyberLoop middleware examples or chat drift telemetry, install the optional peer dependency in the same project:
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
npm install cyberloop
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
For a small real-LLM example of embedding the loop with a custom host tool:
|
|
475
|
+
|
|
476
|
+
```bash
|
|
477
|
+
export OPENAI_API_KEY=your_key_here
|
|
478
|
+
yarn example:programmatic
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
To try the same example with Claude:
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
export ANTHROPIC_API_KEY=your_key_here
|
|
485
|
+
HEDDLE_EXAMPLE_MODEL=claude-3-5-haiku-latest yarn example:programmatic
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
For a small no-network observer example:
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
yarn example:cyberloop-observer
|
|
492
|
+
```
|
|
493
|
+
|
|
290
494
|
The public API lives in [src/index.ts](/Users/roackb2/Studio/projects/ProjectHeddle/heddle/src/index.ts).
|
|
291
495
|
|
|
292
496
|
## Design Direction
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyberloop-observer.d.ts","sourceRoot":"","sources":["../../examples/cyberloop-observer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createCyberLoopObserver, runAgentLoop, } from '../src/index.js';
|
|
3
|
+
const createMockLlm = () => {
|
|
4
|
+
let turn = 0;
|
|
5
|
+
return {
|
|
6
|
+
info: {
|
|
7
|
+
provider: 'openai',
|
|
8
|
+
model: 'gpt-demo',
|
|
9
|
+
capabilities: {
|
|
10
|
+
toolCalls: true,
|
|
11
|
+
systemMessages: true,
|
|
12
|
+
reasoningSummaries: false,
|
|
13
|
+
parallelToolCalls: true,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
async chat() {
|
|
17
|
+
turn++;
|
|
18
|
+
if (turn === 1) {
|
|
19
|
+
return {
|
|
20
|
+
content: 'I will inspect the project before answering.',
|
|
21
|
+
toolCalls: [{ id: 'call-1', tool: 'inspect', input: { target: 'README.md' } }],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return { content: 'The project is a terminal coding agent runtime.' };
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const inspectTool = {
|
|
29
|
+
name: 'inspect',
|
|
30
|
+
description: 'Demo inspection tool.',
|
|
31
|
+
parameters: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: { target: { type: 'string' } },
|
|
34
|
+
required: ['target'],
|
|
35
|
+
},
|
|
36
|
+
async execute(input) {
|
|
37
|
+
return { ok: true, output: `inspected ${JSON.stringify(input)}` };
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* This is intentionally only CyberLoop-compatible. In a real integration,
|
|
42
|
+
* callers can pass actual middleware from `cyberloop` or `cyberloop/advanced`.
|
|
43
|
+
*/
|
|
44
|
+
const demoDriftMiddleware = {
|
|
45
|
+
name: 'demo-drift',
|
|
46
|
+
async beforeStep(ctx) {
|
|
47
|
+
const isToolFailure = ctx.state.kind === 'tool' && ctx.state.ok === false;
|
|
48
|
+
return {
|
|
49
|
+
...ctx,
|
|
50
|
+
metadata: {
|
|
51
|
+
...ctx.metadata,
|
|
52
|
+
kinematics: {
|
|
53
|
+
isStable: !isToolFailure,
|
|
54
|
+
correctionMagnitude: isToolFailure ? 1 : 0,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
async function main() {
|
|
61
|
+
const observer = createCyberLoopObserver({
|
|
62
|
+
middleware: [demoDriftMiddleware],
|
|
63
|
+
onAnnotation(annotation) {
|
|
64
|
+
console.log(`[cyberloop] step=${annotation.step} kind=${annotation.frame.kind} drift=${annotation.driftLevel}`);
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
const result = await runAgentLoop({
|
|
68
|
+
goal: 'What does this project do?',
|
|
69
|
+
llm: createMockLlm(),
|
|
70
|
+
tools: [inspectTool],
|
|
71
|
+
includeDefaultTools: false,
|
|
72
|
+
maxSteps: 3,
|
|
73
|
+
onEvent: observer.handleEvent,
|
|
74
|
+
});
|
|
75
|
+
await observer.flush();
|
|
76
|
+
console.log(`\nFinal answer:\n${result.summary}`);
|
|
77
|
+
}
|
|
78
|
+
await main();
|
|
79
|
+
//# sourceMappingURL=cyberloop-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyberloop-observer.js","sourceRoot":"","sources":["../../examples/cyberloop-observer.ts"],"names":[],"mappings":";AACA,OAAO,EACL,uBAAuB,EACvB,YAAY,GAMb,MAAM,iBAAiB,CAAC;AAEzB,MAAM,aAAa,GAAG,GAAe,EAAE;IACrC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,OAAO;QACL,IAAI,EAAE;YACJ,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,UAAU;YACjB,YAAY,EAAE;gBACZ,SAAS,EAAE,IAAI;gBACf,cAAc,EAAE,IAAI;gBACpB,kBAAkB,EAAE,KAAK;gBACzB,iBAAiB,EAAE,IAAI;aACxB;SACF;QACD,KAAK,CAAC,IAAI;YACR,IAAI,EAAE,CAAC;YACP,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,OAAO;oBACL,OAAO,EAAE,8CAA8C;oBACvD,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC;iBAC/E,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,iDAAiD,EAAE,CAAC;QACxE,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAmB;IAClC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,uBAAuB;IACpC,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QAC1C,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB;IACD,KAAK,CAAC,OAAO,CAAC,KAAK;QACjB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;IACpE,CAAC;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,mBAAmB,GAAsD;IAC7E,IAAI,EAAE,YAAY;IAClB,KAAK,CAAC,UAAU,CAAC,GAAG;QAClB,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC;QAC1E,OAAO;YACL,GAAG,GAAG;YACN,QAAQ,EAAE;gBACR,GAAG,GAAG,CAAC,QAAQ;gBACf,UAAU,EAAE;oBACV,QAAQ,EAAE,CAAC,aAAa;oBACxB,mBAAmB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC3C;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,QAAQ,GAAG,uBAAuB,CAAC;QACvC,UAAU,EAAE,CAAC,mBAAmB,CAAC;QACjC,YAAY,CAAC,UAAU;YACrB,OAAO,CAAC,GAAG,CAAC,oBAAoB,UAAU,CAAC,IAAI,SAAS,UAAU,CAAC,KAAK,CAAC,IAAI,UAAU,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;QAClH,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC;QAChC,IAAI,EAAE,4BAA4B;QAClC,GAAG,EAAE,aAAa,EAAE;QACpB,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,mBAAmB,EAAE,KAAK;QAC1B,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,QAAQ,CAAC,WAAW;KAC9B,CAAC,CAAC;IACH,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;IAEvB,OAAO,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"","sources":["../../examples/heartbeat.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Example: Heartbeat
|
|
3
|
+
//
|
|
4
|
+
// Usage:
|
|
5
|
+
// OPENAI_API_KEY=sk-... yarn example:heartbeat
|
|
6
|
+
//
|
|
7
|
+
// Optional:
|
|
8
|
+
// HEDDLE_EXAMPLE_MODEL=claude-3-5-haiku-latest ANTHROPIC_API_KEY=sk-ant-... yarn example:heartbeat
|
|
9
|
+
//
|
|
10
|
+
// This demonstrates one scheduler-style heartbeat wake cycle. It loads a local
|
|
11
|
+
// checkpoint if one exists, wakes the agent without a chat message, lets it work
|
|
12
|
+
// within a small step budget, then persists the next checkpoint.
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
import { join } from 'node:path';
|
|
15
|
+
import { inferProviderFromModel } from '../src/llm/providers.js';
|
|
16
|
+
import { resolveProviderApiKey } from '../src/runtime/api-keys.js';
|
|
17
|
+
import { createFileHeartbeatCheckpointStore, runStoredHeartbeat } from '../src/runtime/heartbeat-store.js';
|
|
18
|
+
const DEFAULT_EXAMPLE_MODEL = 'gpt-5.1-codex-mini';
|
|
19
|
+
const CHECKPOINT_PATH = join(process.cwd(), '.heddle', 'examples', 'heartbeat-demo-checkpoint.json');
|
|
20
|
+
async function main() {
|
|
21
|
+
const model = process.env.HEDDLE_EXAMPLE_MODEL ?? process.env.OPENAI_MODEL ?? DEFAULT_EXAMPLE_MODEL;
|
|
22
|
+
const provider = inferProviderFromModel(model);
|
|
23
|
+
const apiKey = resolveProviderApiKey(provider);
|
|
24
|
+
if (!apiKey) {
|
|
25
|
+
throw new Error(`Missing API key for ${provider}. ` +
|
|
26
|
+
'Set OPENAI_API_KEY for OpenAI models or ANTHROPIC_API_KEY for Claude models before running this example.');
|
|
27
|
+
}
|
|
28
|
+
const store = createFileHeartbeatCheckpointStore({ path: CHECKPOINT_PATH });
|
|
29
|
+
const result = await runStoredHeartbeat({
|
|
30
|
+
store,
|
|
31
|
+
task: 'Check whether there is useful autonomous work to do for this demo. No tools are available in this demo wake cycle. If no external task is available, explain that this wake cycle should pause.',
|
|
32
|
+
model,
|
|
33
|
+
apiKey,
|
|
34
|
+
tools: [],
|
|
35
|
+
includeDefaultTools: false,
|
|
36
|
+
workspaceRoot: process.cwd(),
|
|
37
|
+
onEvent(event) {
|
|
38
|
+
if (event.type === 'loop.started') {
|
|
39
|
+
console.log(`[event] heartbeat.started model=${event.model} provider=${event.provider}`);
|
|
40
|
+
}
|
|
41
|
+
if (event.type === 'trace' && event.event.type === 'tool.call') {
|
|
42
|
+
console.log(`[trace] tool.call step=${event.event.step} tool=${event.event.call.tool}`);
|
|
43
|
+
}
|
|
44
|
+
if (event.type === 'loop.finished') {
|
|
45
|
+
console.log(`[event] heartbeat.finished outcome=${event.outcome} trace=${event.state.trace.length}`);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
console.log('\nHeartbeat result:\n');
|
|
50
|
+
console.log(`loadedCheckpoint=${result.loadedCheckpoint}`);
|
|
51
|
+
console.log(`decision=${result.decision}`);
|
|
52
|
+
console.log(`nextDelayMs=${result.nextDelayMs ?? 'none'}`);
|
|
53
|
+
console.log(`summary=${result.summary}`);
|
|
54
|
+
console.log(`checkpoint=${CHECKPOINT_PATH}`);
|
|
55
|
+
process.exit(0);
|
|
56
|
+
}
|
|
57
|
+
main().catch((error) => {
|
|
58
|
+
console.error(error);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=heartbeat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat.js","sourceRoot":"","sources":["../../examples/heartbeat.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qBAAqB;AACrB,EAAE;AACF,SAAS;AACT,iDAAiD;AACjD,EAAE;AACF,YAAY;AACZ,qGAAqG;AACrG,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,iEAAiE;AACjE,8EAA8E;AAE9E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kCAAkC,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAE3G,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AACnD,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,gCAAgC,CAAC,CAAC;AAErG,KAAK,UAAU,IAAI;IACjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,qBAAqB,CAAC;IACpG,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,uBAAuB,QAAQ,IAAI;YACnC,0GAA0G,CAC3G,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,kCAAkC,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC;QACtC,KAAK;QACL,IAAI,EACF,iMAAiM;QACnM,KAAK;QACL,MAAM;QACN,KAAK,EAAE,EAAE;QACT,mBAAmB,EAAE,KAAK;QAC1B,aAAa,EAAE,OAAO,CAAC,GAAG,EAAE;QAC5B,OAAO,CAAC,KAAK;YACX,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;gBAClC,OAAO,CAAC,GAAG,CAAC,mCAAmC,KAAK,CAAC,KAAK,aAAa,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC3F,CAAC;YACD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBAC/D,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,CAAC,KAAK,CAAC,IAAI,SAAS,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAC1F,CAAC;YACD,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;gBACnC,OAAO,CAAC,GAAG,CAAC,sCAAsC,KAAK,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;YACvG,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,WAAW,IAAI,MAAM,EAAE,CAAC,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,cAAc,eAAe,EAAE,CAAC,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Host Events Example
|
|
4
|
+
*
|
|
5
|
+
* Demonstrates how to consume Heddle's structured event stream for:
|
|
6
|
+
* - Real-time progress monitoring
|
|
7
|
+
* - Tool execution tracking
|
|
8
|
+
* - Checkpoint persistence
|
|
9
|
+
* - Escalation routing (for CyberLoop/Lucid integration)
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* HEDDLE_EXAMPLE_MODEL=gpt-5.1-codex-mini npx tsx examples/host-events.ts
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=host-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-events.d.ts","sourceRoot":"","sources":["../../examples/host-events.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG"}
|