agentfootprint 2.6.4 → 2.7.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/AGENTS.md CHANGED
@@ -426,7 +426,7 @@ agent.on('agentfootprint.agent.turn_end', (e) =>
426
426
  console.log(`[${e.payload.iterationCount} iter, ${e.payload.totalInputTokens}+${e.payload.totalOutputTokens} tokens]`));
427
427
  ```
428
428
 
429
- Wildcard `.on('agentfootprint.*', ...)` works. All events typed via `AgentfootprintEventMap`.
429
+ Wildcards: `.on('*', ...)` for every event, or `.on('agentfootprint.<domain>.*', ...)` per-domain (`agent`, `stream`, `context`, `tools`, `memory`, `cost`, `error`, …). `'agentfootprint.*'` is NOT a valid pattern — the dispatcher accepts `'*'` or `'agentfootprint.<DOMAIN>.*'` only. All events typed via `AgentfootprintEventMap`.
430
430
 
431
431
  Recorders (auto-attached when relevant builder method is called):
432
432
  - `ContextRecorder` — `context.evaluated` / `context.injected` / `context.slot_composed`
package/CLAUDE.md CHANGED
@@ -426,7 +426,7 @@ agent.on('agentfootprint.agent.turn_end', (e) =>
426
426
  console.log(`[${e.payload.iterationCount} iter, ${e.payload.totalInputTokens}+${e.payload.totalOutputTokens} tokens]`));
427
427
  ```
428
428
 
429
- Wildcard `.on('agentfootprint.*', ...)` works. All events typed via `AgentfootprintEventMap`.
429
+ Wildcards: `.on('*', ...)` for every event, or `.on('agentfootprint.<domain>.*', ...)` per-domain (`agent`, `stream`, `context`, `tools`, `memory`, `cost`, `error`, …). `'agentfootprint.*'` is NOT a valid pattern — the dispatcher accepts `'*'` or `'agentfootprint.<DOMAIN>.*'` only. All events typed via `AgentfootprintEventMap`.
430
430
 
431
431
  Recorders (auto-attached when relevant builder method is called):
432
432
  - `ContextRecorder` — `context.evaluated` / `context.injected` / `context.slot_composed`
@@ -367,8 +367,10 @@ agent.on('agentfootprint.stream.tool_start', (e) =>
367
367
  agent.on('agentfootprint.agent.turn_end', (e) =>
368
368
  console.log(`[${e.payload.iterationCount} iter, tokens=${e.payload.totalInputTokens}+${e.payload.totalOutputTokens}]`));
369
369
 
370
- // Wildcards work
371
- agent.on('agentfootprint.*', (e) => log(e));
370
+ // Wildcards: '*' for every event, or 'agentfootprint.<domain>.*' per-domain.
371
+ // 'agentfootprint.*' is NOT a valid pattern — silently matches nothing.
372
+ agent.on('*', (e) => log(e));
373
+ agent.on('agentfootprint.stream.*', (e) => log(e));
372
374
  ```
373
375
 
374
376
  ## Anti-patterns — Don't
@@ -0,0 +1,49 @@
1
+ /**
2
+ * agentfootprint/status — chat-bubble status surface.
3
+ *
4
+ * Pattern: pure projection. `selectThinkingState` walks the typed
5
+ * event log forward, tracking active pause / tool / LLM state,
6
+ * and returns the CURRENT thinking state (or null when the
7
+ * bubble should hide).
8
+ * Role: Outer ring. Consumers (Lens, custom chat UIs, embedded
9
+ * widgets) call this to drive a "what is the agent doing
10
+ * right now?" indicator. Output feeds `renderThinkingLine`
11
+ * which resolves a template + variables to a final string.
12
+ *
13
+ * Why a subpath:
14
+ * - Consistent with `agentfootprint/observe` and
15
+ * `agentfootprint/locales` — every observability surface gets its
16
+ * own entry point.
17
+ * - Self-documenting at the import line: `from 'agentfootprint/status'`
18
+ * vs an opaque main-export grab.
19
+ * - Future home for extended-thinking primitives (Anthropic
20
+ * `thinking_delta` / `redacted_thinking` blocks). Adding them here
21
+ * is non-breaking; consumers already importing from
22
+ * `agentfootprint/status` get the new state surface for free.
23
+ *
24
+ * Back-compat: every export here is also re-exported from the main
25
+ * `agentfootprint` entry. Migrating consumers is mechanical (rewrite
26
+ * the import path); both paths work.
27
+ *
28
+ * State machine (4 states + null):
29
+ *
30
+ * ┌──────────┐ llm.start, no tools yet
31
+ * ────┤ idle ├────────────────────────────► "Thinking…"
32
+ * └──────────┘
33
+ *
34
+ * ┌──────────┐ stream.token chunks accumulate
35
+ * ────┤streaming ├────────────────────────────► "{{partial}}"
36
+ * └──────────┘
37
+ *
38
+ * ┌──────────┐ tool.start, no tool.end yet
39
+ * ────┤ tool ├────────────────────────────► "Working on `weather`…"
40
+ * └──────────┘ (or per-tool override)
41
+ *
42
+ * ┌──────────┐ pause.request, no resume yet
43
+ * ────┤ paused ├────────────────────────────► "Waiting on you: …"
44
+ * └──────────┘
45
+ *
46
+ * (null) run done / between calls → bubble hidden
47
+ */
48
+ export { defaultThinkingTemplates, selectThinkingState, renderThinkingLine, } from './recorders/observability/thinking/thinkingTemplates.js';
49
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,GAKnB,MAAM,yDAAyD,CAAC"}
package/dist/status.js ADDED
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /**
3
+ * agentfootprint/status — chat-bubble status surface.
4
+ *
5
+ * Pattern: pure projection. `selectThinkingState` walks the typed
6
+ * event log forward, tracking active pause / tool / LLM state,
7
+ * and returns the CURRENT thinking state (or null when the
8
+ * bubble should hide).
9
+ * Role: Outer ring. Consumers (Lens, custom chat UIs, embedded
10
+ * widgets) call this to drive a "what is the agent doing
11
+ * right now?" indicator. Output feeds `renderThinkingLine`
12
+ * which resolves a template + variables to a final string.
13
+ *
14
+ * Why a subpath:
15
+ * - Consistent with `agentfootprint/observe` and
16
+ * `agentfootprint/locales` — every observability surface gets its
17
+ * own entry point.
18
+ * - Self-documenting at the import line: `from 'agentfootprint/status'`
19
+ * vs an opaque main-export grab.
20
+ * - Future home for extended-thinking primitives (Anthropic
21
+ * `thinking_delta` / `redacted_thinking` blocks). Adding them here
22
+ * is non-breaking; consumers already importing from
23
+ * `agentfootprint/status` get the new state surface for free.
24
+ *
25
+ * Back-compat: every export here is also re-exported from the main
26
+ * `agentfootprint` entry. Migrating consumers is mechanical (rewrite
27
+ * the import path); both paths work.
28
+ *
29
+ * State machine (4 states + null):
30
+ *
31
+ * ┌──────────┐ llm.start, no tools yet
32
+ * ────┤ idle ├────────────────────────────► "Thinking…"
33
+ * └──────────┘
34
+ *
35
+ * ┌──────────┐ stream.token chunks accumulate
36
+ * ────┤streaming ├────────────────────────────► "{{partial}}"
37
+ * └──────────┘
38
+ *
39
+ * ┌──────────┐ tool.start, no tool.end yet
40
+ * ────┤ tool ├────────────────────────────► "Working on `weather`…"
41
+ * └──────────┘ (or per-tool override)
42
+ *
43
+ * ┌──────────┐ pause.request, no resume yet
44
+ * ────┤ paused ├────────────────────────────► "Waiting on you: …"
45
+ * └──────────┘
46
+ *
47
+ * (null) run done / between calls → bubble hidden
48
+ */
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.renderThinkingLine = exports.selectThinkingState = exports.defaultThinkingTemplates = void 0;
51
+ var thinkingTemplates_js_1 = require("./recorders/observability/thinking/thinkingTemplates.js");
52
+ Object.defineProperty(exports, "defaultThinkingTemplates", { enumerable: true, get: function () { return thinkingTemplates_js_1.defaultThinkingTemplates; } });
53
+ Object.defineProperty(exports, "selectThinkingState", { enumerable: true, get: function () { return thinkingTemplates_js_1.selectThinkingState; } });
54
+ Object.defineProperty(exports, "renderThinkingLine", { enumerable: true, get: function () { return thinkingTemplates_js_1.renderThinkingLine; } });
55
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;;;AAEH,gGAQiE;AAP/D,gIAAA,wBAAwB,OAAA;AACxB,2HAAA,mBAAmB,OAAA;AACnB,0HAAA,kBAAkB,OAAA"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * agentfootprint/status — chat-bubble status surface.
3
+ *
4
+ * Pattern: pure projection. `selectThinkingState` walks the typed
5
+ * event log forward, tracking active pause / tool / LLM state,
6
+ * and returns the CURRENT thinking state (or null when the
7
+ * bubble should hide).
8
+ * Role: Outer ring. Consumers (Lens, custom chat UIs, embedded
9
+ * widgets) call this to drive a "what is the agent doing
10
+ * right now?" indicator. Output feeds `renderThinkingLine`
11
+ * which resolves a template + variables to a final string.
12
+ *
13
+ * Why a subpath:
14
+ * - Consistent with `agentfootprint/observe` and
15
+ * `agentfootprint/locales` — every observability surface gets its
16
+ * own entry point.
17
+ * - Self-documenting at the import line: `from 'agentfootprint/status'`
18
+ * vs an opaque main-export grab.
19
+ * - Future home for extended-thinking primitives (Anthropic
20
+ * `thinking_delta` / `redacted_thinking` blocks). Adding them here
21
+ * is non-breaking; consumers already importing from
22
+ * `agentfootprint/status` get the new state surface for free.
23
+ *
24
+ * Back-compat: every export here is also re-exported from the main
25
+ * `agentfootprint` entry. Migrating consumers is mechanical (rewrite
26
+ * the import path); both paths work.
27
+ *
28
+ * State machine (4 states + null):
29
+ *
30
+ * ┌──────────┐ llm.start, no tools yet
31
+ * ────┤ idle ├────────────────────────────► "Thinking…"
32
+ * └──────────┘
33
+ *
34
+ * ┌──────────┐ stream.token chunks accumulate
35
+ * ────┤streaming ├────────────────────────────► "{{partial}}"
36
+ * └──────────┘
37
+ *
38
+ * ┌──────────┐ tool.start, no tool.end yet
39
+ * ────┤ tool ├────────────────────────────► "Working on `weather`…"
40
+ * └──────────┘ (or per-tool override)
41
+ *
42
+ * ┌──────────┐ pause.request, no resume yet
43
+ * ────┤ paused ├────────────────────────────► "Waiting on you: …"
44
+ * └──────────┘
45
+ *
46
+ * (null) run done / between calls → bubble hidden
47
+ */
48
+ export { defaultThinkingTemplates, selectThinkingState, renderThinkingLine, type ThinkingState, type ThinkingStateKind, type ThinkingTemplates, type ThinkingContext, } from './recorders/observability/thinking/thinkingTemplates.js';
49
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,GACrB,MAAM,yDAAyD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentfootprint",
3
- "version": "2.6.4",
3
+ "version": "2.7.1",
4
4
  "description": "The explainable agent framework — build AI agents you can explain, audit, and trust. Built on footprintjs.",
5
5
  "license": "MIT",
6
6
  "author": "Sanjay Krishna Anbalagan",
@@ -153,6 +153,11 @@
153
153
  "types": "./dist/types/locales/index.d.ts",
154
154
  "import": "./dist/esm/locales/index.js",
155
155
  "require": "./dist/locales/index.js"
156
+ },
157
+ "./status": {
158
+ "types": "./dist/types/status.d.ts",
159
+ "import": "./dist/esm/status.js",
160
+ "require": "./dist/status.js"
156
161
  }
157
162
  },
158
163
  "sideEffects": false,