agentfootprint 1.1.1 → 1.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.
- package/AGENTS.md +2 -3
- package/CLAUDE.md +2 -3
- package/ai-instructions/claude-code/SKILL.md +2 -3
- package/ai-instructions/clinerules +0 -1
- package/ai-instructions/copilot-instructions.md +0 -1
- package/ai-instructions/cursor/agentfootprint.md +0 -1
- package/ai-instructions/kiro/agentfootprint.md +0 -1
- package/ai-instructions/windsurfrules +0 -1
- package/dist/esm/recorders/v2/CostRecorder.js.map +1 -1
- package/dist/recorders/v2/CostRecorder.js.map +1 -1
- package/dist/types/recorders/v2/CostRecorder.d.ts +2 -6
- package/dist/types/recorders/v2/CostRecorder.d.ts.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -22,11 +22,11 @@ src/
|
|
|
22
22
|
├── tools/ → ToolRegistry + defineTool
|
|
23
23
|
├── stages/ → Reusable flowchart stages (seedScope, callLLM, parseResponse, etc.)
|
|
24
24
|
├── scope/ → AgentScope paths + helpers
|
|
25
|
-
├── memory/ → Message utilities (appendMessage,
|
|
25
|
+
├── memory/ → Message utilities (appendMessage, lastMessage, lastAssistantMessage)
|
|
26
26
|
├── executor/ → agentLoop (core ReAct loop)
|
|
27
27
|
├── compositions/→ withRetry, withFallback, withCircuitBreaker
|
|
28
28
|
├── streaming/ → StreamEmitter, SSEFormatter, AgentStreamEvent
|
|
29
|
-
├── lib/ → Instructions (agentInstruction, InstructionsToLLM subflow), narrative (
|
|
29
|
+
├── lib/ → Instructions (agentInstruction, InstructionsToLLM subflow), narrative (agentRenderer), loop (buildAgentLoop), slots, call stages
|
|
30
30
|
└── types/ → All type definitions (messages, llm, tools, content blocks)
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -281,7 +281,6 @@ Collects during traversal via recorder hooks — no post-processing of narrative
|
|
|
281
281
|
## Anti-Patterns
|
|
282
282
|
|
|
283
283
|
- Never use the old functional API (`LLMCall({...})`, `Agent({...})`) — always use `LLMCall.create({...})` builder pattern
|
|
284
|
-
- Never use `CostRecorderV2` — use `CostRecorder` (V2 is a deprecated alias)
|
|
285
284
|
- Never pass recorders via constructor options — use `.recorder()` builder method
|
|
286
285
|
- Don't use `name`/`parameters` on `defineTool` — use `id`/`inputSchema`
|
|
287
286
|
- Don't use `tokens.stats()` — use `tokens.getStats()`
|
package/CLAUDE.md
CHANGED
|
@@ -22,11 +22,11 @@ src/
|
|
|
22
22
|
├── tools/ → ToolRegistry + defineTool
|
|
23
23
|
├── stages/ → Reusable flowchart stages (seedScope, callLLM, parseResponse, etc.)
|
|
24
24
|
├── scope/ → AgentScope paths + helpers
|
|
25
|
-
├── memory/ → Message utilities (appendMessage,
|
|
25
|
+
├── memory/ → Message utilities (appendMessage, lastMessage, lastAssistantMessage)
|
|
26
26
|
├── executor/ → agentLoop (core ReAct loop)
|
|
27
27
|
├── compositions/→ withRetry, withFallback, withCircuitBreaker
|
|
28
28
|
├── streaming/ → StreamEmitter, SSEFormatter, AgentStreamEvent
|
|
29
|
-
├── lib/ → Instructions (agentInstruction, InstructionsToLLM subflow), narrative (
|
|
29
|
+
├── lib/ → Instructions (agentInstruction, InstructionsToLLM subflow), narrative (agentRenderer), loop (buildAgentLoop), slots, call stages
|
|
30
30
|
└── types/ → All type definitions (messages, llm, tools, content blocks)
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -281,7 +281,6 @@ Collects during traversal via recorder hooks — no post-processing of narrative
|
|
|
281
281
|
## Anti-Patterns
|
|
282
282
|
|
|
283
283
|
- Never use the old functional API (`LLMCall({...})`, `Agent({...})`) — always use `LLMCall.create({...})` builder pattern
|
|
284
|
-
- Never use `CostRecorderV2` — use `CostRecorder` (V2 is a deprecated alias)
|
|
285
284
|
- Never pass recorders via constructor options — use `.recorder()` builder method
|
|
286
285
|
- Don't use `name`/`parameters` on `defineTool` — use `id`/`inputSchema`
|
|
287
286
|
- Don't use `tokens.stats()` — use `tokens.getStats()`
|
|
@@ -511,7 +511,7 @@ src/
|
|
|
511
511
|
├── models/ → Model configs (anthropic, openai, ollama, bedrock)
|
|
512
512
|
├── adapters/ → Mock, Anthropic, OpenAI, Bedrock, MCP, A2A, createProvider
|
|
513
513
|
├── tools/ → ToolRegistry, defineTool
|
|
514
|
-
├── memory/ → Message helpers (appendMessage,
|
|
514
|
+
├── memory/ → Message helpers (appendMessage, lastMessage, lastAssistantMessage)
|
|
515
515
|
├── scope/ → AgentScope (typed paths into footprintjs ScopeFacade)
|
|
516
516
|
├── stages/ → Reusable stage functions (seedScope, callLLM, parseResponse, etc.)
|
|
517
517
|
├── core/ → AgentRecorder, PromptProvider, ToolProvider, AgentLoopConfig
|
|
@@ -530,8 +530,7 @@ Single entry point: `import { ... } from 'agentfootprint'`
|
|
|
530
530
|
|
|
531
531
|
## Anti-Patterns to Avoid
|
|
532
532
|
|
|
533
|
-
1. **Never
|
|
534
|
-
2. **Never post-process the flowchart** — use recorders to collect data during traversal.
|
|
533
|
+
1. **Never post-process the flowchart** — use recorders to collect data during traversal.
|
|
535
534
|
3. **Never build agents without `mock()`** in tests — no API keys in test suites.
|
|
536
535
|
4. **Don't skip `.recorder(rec)`** — always attach recorders to observe execution.
|
|
537
536
|
5. **Don't use raw footprintjs stages** for agent logic — use concept builders (`Agent.create()`, `LLMCall.create()`, etc.).
|
|
@@ -101,7 +101,6 @@ runner.toFlowChart() // for subflow composition
|
|
|
101
101
|
|
|
102
102
|
## Rules
|
|
103
103
|
|
|
104
|
-
- Never use `CostRecorderV2` — use `CostRecorder`
|
|
105
104
|
- Never post-process — use recorders to collect data during traversal
|
|
106
105
|
- Always use `mock([...])` in tests — no API keys in test suites
|
|
107
106
|
- Use concept builders (`Agent.create()`, etc.) not raw stages
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostRecorder.js","sourceRoot":"","sources":["../../../../src/recorders/v2/CostRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|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SAAS,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,UAAU;QACR,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostRecorder.js","sourceRoot":"","sources":["../../../src/recorders/v2/CostRecorder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;
|
|
1
|
+
{"version":3,"file":"CostRecorder.js","sourceRoot":"","sources":["../../../src/recorders/v2/CostRecorder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAqBH,MAAa,YAAY;IACd,EAAE,CAAS;IACZ,OAAO,GAAgB,EAAE,CAAC;IAC1B,YAAY,CAA+B;IAEnD,YAAY,UAA+B,EAAE;QAC3C,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,IAAI,eAAe,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC;IACjD,CAAC;IAED,SAAS,CAAC,KAAmB;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC;QACvC,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,EAAE,WAAW,IAAI,CAAC,CAAC;QAClD,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,EAAE,YAAY,IAAI,CAAC,CAAC;QAEpD,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACzC,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7E,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YAChB,KAAK;YACL,WAAW;YACX,YAAY;YACZ,SAAS;YACT,UAAU;YACV,SAAS,EAAE,SAAS,GAAG,UAAU;SAClC,CAAC,CAAC;IACL,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,UAAU;QACR,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;CACF;AAxCD,oCAwCC"}
|
|
@@ -11,12 +11,8 @@
|
|
|
11
11
|
* console.log(`$${cost.getTotalCost().toFixed(4)}`);
|
|
12
12
|
*/
|
|
13
13
|
import type { AgentRecorder, LLMCallEvent } from '../../core';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readonly input: number;
|
|
17
|
-
/** Cost per 1M output tokens in USD. */
|
|
18
|
-
readonly output: number;
|
|
19
|
-
}
|
|
14
|
+
import type { ModelPricing } from '../../models/types';
|
|
15
|
+
export type { ModelPricing } from '../../models/types';
|
|
20
16
|
export interface CostEntry {
|
|
21
17
|
readonly model: string;
|
|
22
18
|
readonly inputTokens: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostRecorder.d.ts","sourceRoot":"","sources":["../../../../src/recorders/v2/CostRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"CostRecorder.d.ts","sourceRoot":"","sources":["../../../../src/recorders/v2/CostRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACtD;AAED,qBAAa,YAAa,YAAW,aAAa;IAChD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,YAAY,CAA+B;gBAEvC,OAAO,GAAE,mBAAwB;IAK7C,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAmBpC,YAAY,IAAI,MAAM;IAItB,UAAU,IAAI,SAAS,EAAE;IAIzB,KAAK,IAAI,IAAI;CAGd"}
|
package/package.json
CHANGED