agentwrangler 0.1.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/LICENSE +191 -0
- package/README.md +116 -0
- package/dist/apply/jobs.js +429 -0
- package/dist/apply/open-terminal-child.mjs +98 -0
- package/dist/apply/open-terminal.js +221 -0
- package/dist/apply/settings-gen.js +35 -0
- package/dist/cli/agentwrangler.js +18 -0
- package/dist/daemon/config.js +51 -0
- package/dist/daemon/http.js +258 -0
- package/dist/daemon/index.js +372 -0
- package/dist/daemon/outcomes-pass.js +82 -0
- package/dist/daemon/readiness.js +15 -0
- package/dist/daemon/router.js +756 -0
- package/dist/daemon/static.js +146 -0
- package/dist/db/migrate.js +72 -0
- package/dist/db/migrations/001_observe.sql +196 -0
- package/dist/db/migrations/002_indexes.sql +6 -0
- package/dist/db/migrations/003_context_inventory_history.sql +20 -0
- package/dist/db/migrations/004_apply_jobs.sql +17 -0
- package/dist/db/migrations/005_tool_event_metadata.sql +17 -0
- package/dist/db/migrations/006_d7_query_indexes.sql +9 -0
- package/dist/db/migrations/007_work_item_branch_keys.sql +11 -0
- package/dist/db/migrations/008_thinking_tokens.sql +1 -0
- package/dist/db/migrations/009_user_turn_count.sql +1 -0
- package/dist/db/migrations/010_workspace_cwd.sql +1 -0
- package/dist/db/migrations/011_reports.sql +1 -0
- package/dist/db/migrations/012_reconcile_indexes.sql +2 -0
- package/dist/db/migrations/013_friction_fields.sql +5 -0
- package/dist/db/migrations/014_session_churn.sql +11 -0
- package/dist/db/migrations/015_gap_aggregates.sql +6 -0
- package/dist/db/open.js +30 -0
- package/dist/detector/benchmark-anchors.js +36 -0
- package/dist/detector/calibration.js +302 -0
- package/dist/detector/context-history-retention.js +312 -0
- package/dist/detector/context-probe.js +574 -0
- package/dist/detector/d1-source-identity.js +25 -0
- package/dist/detector/detectors/d10_catalog_footprint.js +146 -0
- package/dist/detector/detectors/d1_ctx_always_loaded.js +203 -0
- package/dist/detector/detectors/d2_session_long_full_context.js +119 -0
- package/dist/detector/detectors/d4_model_mismatch.js +258 -0
- package/dist/detector/detectors/d5_limit_burn_forecast.js +138 -0
- package/dist/detector/detectors/d6_tool_result_bloat.js +301 -0
- package/dist/detector/detectors/d7_loop_retry_waste.js +345 -0
- package/dist/detector/detectors/d8_cache_write_churn.js +201 -0
- package/dist/detector/detectors/d9_idle_background_session.js +101 -0
- package/dist/detector/engine.js +88 -0
- package/dist/detector/index.js +17 -0
- package/dist/detector/measurement.js +426 -0
- package/dist/detector/practice-registry.js +259 -0
- package/dist/detector/registry.js +32 -0
- package/dist/detector/savings.js +249 -0
- package/dist/detector/types.js +14 -0
- package/dist/evidence/common/approved-input.js +632 -0
- package/dist/evidence/common/boundary.js +84 -0
- package/dist/evidence/common/canonical.js +55 -0
- package/dist/evidence/common/redaction.js +321 -0
- package/dist/evidence/common/sqlite.js +25 -0
- package/dist/evidence/common/state.js +29 -0
- package/dist/evidence/cond1/cli.js +289 -0
- package/dist/evidence/cond1/packet.js +407 -0
- package/dist/evidence/cond1/prepare.js +295 -0
- package/dist/evidence/cond1/score.js +349 -0
- package/dist/evidence/cond1/types.js +1 -0
- package/dist/evidence/create-approval.js +365 -0
- package/dist/evidence/create-scratch.js +542 -0
- package/dist/evidence/d7/cli.js +113 -0
- package/dist/evidence/d7/measure.js +193 -0
- package/dist/evidence/d7/types.js +1 -0
- package/dist/evidence/discover-approval.js +492 -0
- package/dist/evidence/g2/adjudicate.js +20 -0
- package/dist/evidence/g2/cli.js +207 -0
- package/dist/evidence/g2/kappa.js +39 -0
- package/dist/evidence/g2/pipeline.js +92 -0
- package/dist/evidence/g2/store.js +14 -0
- package/dist/evidence/github/client.js +1 -0
- package/dist/evidence/github/gh-cli-client.js +301 -0
- package/dist/evidence/r3/cli.js +209 -0
- package/dist/evidence/r3/evaluate.js +417 -0
- package/dist/evidence/r3/packet.js +162 -0
- package/dist/evidence/r3/prepare.js +405 -0
- package/dist/evidence/r3/score.js +341 -0
- package/dist/evidence/r3/transcript.js +155 -0
- package/dist/evidence/r3/types.js +4 -0
- package/dist/hook/context-budget-hook.mjs +138 -0
- package/dist/hook/danger-guard-denylist.json +27 -0
- package/dist/hook/danger-guard-hook.mjs +167 -0
- package/dist/hook/install.js +0 -0
- package/dist/hook/limit-burn-hook.mjs +127 -0
- package/dist/hook/loop-guard-hook.mjs +104 -0
- package/dist/hook/precompact-checkpoint-hook.mjs +123 -0
- package/dist/ingest/churn-collector.js +122 -0
- package/dist/ingest/detector-hook.js +52 -0
- package/dist/ingest/discovery.js +207 -0
- package/dist/ingest/health.js +43 -0
- package/dist/ingest/index.js +28 -0
- package/dist/ingest/ingestor.js +509 -0
- package/dist/ingest/parser.js +344 -0
- package/dist/ingest/pricing.js +153 -0
- package/dist/ingest/reconcile.js +52 -0
- package/dist/ingest/tail.js +152 -0
- package/dist/ingest/types.js +24 -0
- package/dist/ingest/workspace-mapping.js +114 -0
- package/dist/oauth/anthropic-api-key.js +88 -0
- package/dist/oauth/count-tokens.js +86 -0
- package/dist/oauth/credentials.js +171 -0
- package/dist/oauth/judge-g2-client.js +154 -0
- package/dist/oauth/usage.js +167 -0
- package/dist/outcomes/branch-key.js +49 -0
- package/dist/outcomes/conclusions.js +45 -0
- package/dist/outcomes/derive.js +94 -0
- package/dist/outcomes/finding-extractors.js +131 -0
- package/dist/outcomes/findings.js +237 -0
- package/dist/outcomes/github/client.js +367 -0
- package/dist/outcomes/github/credential.js +195 -0
- package/dist/outcomes/github/gh-cli-client.js +340 -0
- package/dist/outcomes/linker.js +486 -0
- package/dist/outcomes/pool.js +24 -0
- package/dist/outcomes/sync.js +276 -0
- package/dist/query/api/agents-liveness.js +182 -0
- package/dist/query/api/burn-status.js +50 -0
- package/dist/query/api/context-budget.js +114 -0
- package/dist/query/api/context-composition.js +67 -0
- package/dist/query/api/cost-per-success.js +104 -0
- package/dist/query/api/delivery.js +92 -0
- package/dist/query/api/effectiveness.js +254 -0
- package/dist/query/api/efficiency-headroom.js +74 -0
- package/dist/query/api/headroom-trend.js +105 -0
- package/dist/query/api/hook-config.js +75 -0
- package/dist/query/api/hook-install.js +8 -0
- package/dist/query/api/hot-sessions.js +17 -0
- package/dist/query/api/idle-sessions.js +52 -0
- package/dist/query/api/index.js +40 -0
- package/dist/query/api/loop-guard.js +90 -0
- package/dist/query/api/offload-share.js +41 -0
- package/dist/query/api/outcomes.js +218 -0
- package/dist/query/api/overview.js +535 -0
- package/dist/query/api/rec-prompt.js +138 -0
- package/dist/query/api/recommendations-ledger.js +111 -0
- package/dist/query/api/recommendations.js +514 -0
- package/dist/query/api/reports.js +78 -0
- package/dist/query/api/self-churn.js +77 -0
- package/dist/query/api/self-percentiles.js +109 -0
- package/dist/query/api/session-drivers.js +153 -0
- package/dist/query/api/settings.js +85 -0
- package/dist/query/api/spend-flavor.js +234 -0
- package/dist/query/api/trends.js +155 -0
- package/dist/query/cap-weighted.js +119 -0
- package/dist/query/db-context.js +42 -0
- package/dist/query/envelope.js +71 -0
- package/dist/query/forecast.js +191 -0
- package/dist/query/settings-store.js +441 -0
- package/dist/query/spend.js +171 -0
- package/dist/query/trends.js +194 -0
- package/dist/ui/assets/index-DnRKgc21.css +1 -0
- package/dist/ui/assets/index-h1Q1wWq5.js +168 -0
- package/dist/ui/index.html +39 -0
- package/package.json +59 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='14' fill='%230b0f1a'/%3E%3Cpath d='M18 18h28v28H18z' fill='none' stroke='%2322d3ee' stroke-width='6'/%3E%3Cpath d='M38 18v12H26' fill='none' stroke='%23a78bfa' stroke-width='6'/%3E%3C/svg%3E" />
|
|
7
|
+
<title>AgentWrangler · Local Observability Dashboard</title>
|
|
8
|
+
<style>
|
|
9
|
+
html, body { margin: 0; min-height: 100%; background: #0b0f1a; color: #e2e8f0; }
|
|
10
|
+
#root { min-height: 100vh; }
|
|
11
|
+
</style>
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-h1Q1wWq5.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DnRKgc21.css">
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="root">
|
|
17
|
+
<div style="display:flex;min-height:100vh;background:#0b0f1a;color:#e2e8f0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif">
|
|
18
|
+
<aside style="width:224px;flex:0 0 224px;padding:24px 16px;border-right:1px solid rgba(255,255,255,.07);background:#0b0f1a;box-sizing:border-box">
|
|
19
|
+
<div style="width:116px;height:16px;margin:4px 0 34px;border-radius:5px;background:#1a2233"></div>
|
|
20
|
+
<div style="display:grid;gap:12px">
|
|
21
|
+
<div style="height:12px;border-radius:4px;background:#1a2233"></div>
|
|
22
|
+
<div style="height:12px;border-radius:4px;background:#1a2233"></div>
|
|
23
|
+
<div style="height:12px;border-radius:4px;background:#1a2233"></div>
|
|
24
|
+
<div style="height:12px;border-radius:4px;background:#1a2233"></div>
|
|
25
|
+
</div>
|
|
26
|
+
</aside>
|
|
27
|
+
<main style="flex:1;padding:32px;box-sizing:border-box">
|
|
28
|
+
<div style="width:180px;height:20px;margin-bottom:24px;border-radius:6px;background:#1a2233"></div>
|
|
29
|
+
<div style="display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px">
|
|
30
|
+
<div style="height:112px;border:1px solid rgba(255,255,255,.07);border-radius:10px;background:#111827"></div>
|
|
31
|
+
<div style="height:112px;border:1px solid rgba(255,255,255,.07);border-radius:10px;background:#111827"></div>
|
|
32
|
+
<div style="height:112px;border:1px solid rgba(255,255,255,.07);border-radius:10px;background:#111827"></div>
|
|
33
|
+
<div style="height:112px;border:1px solid rgba(255,255,255,.07);border-radius:10px;background:#111827"></div>
|
|
34
|
+
</div>
|
|
35
|
+
</main>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentwrangler",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"bin": { "agentwrangler": "dist/cli/agentwrangler.js" },
|
|
5
|
+
"description": "Local observability for Claude Code agent token spend and outcomes",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
9
|
+
"repository": { "type": "git", "url": "git+https://github.com/Doogit/AgentWrangler.git" },
|
|
10
|
+
"homepage": "https://github.com/Doogit/AgentWrangler#readme",
|
|
11
|
+
"bugs": { "url": "https://github.com/Doogit/AgentWrangler/issues" },
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=22 <25"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"lint": "biome check src test",
|
|
17
|
+
"typecheck": "tsc --noEmit --project tsconfig.node.json && tsc --noEmit --project tsconfig.ui.json",
|
|
18
|
+
"test": "vitest run && vitest run --config vitest.ui.config.ts",
|
|
19
|
+
"smoke": "node --import tsx/esm src/daemon/index.ts --smoke --no-open",
|
|
20
|
+
"daemon": "node --import tsx/esm src/daemon/index.ts",
|
|
21
|
+
"install-hook": "node --import tsx/esm src/daemon/index.ts --install-hook",
|
|
22
|
+
"uninstall-hook": "node --import tsx/esm src/daemon/index.ts --uninstall-hook",
|
|
23
|
+
"evidence:create-approval": "node --import tsx/esm src/evidence/create-approval.ts",
|
|
24
|
+
"evidence:discover-approval": "node --import tsx/esm src/evidence/discover-approval.ts",
|
|
25
|
+
"evidence:create-scratch": "node --import tsx/esm src/evidence/create-scratch.ts",
|
|
26
|
+
"evidence:cond1": "node --import tsx/esm src/evidence/cond1/cli.ts",
|
|
27
|
+
"evidence:r3-u4": "node --import tsx/esm src/evidence/r3/cli.ts",
|
|
28
|
+
"evidence:d7-coverage": "node --import tsx/esm src/evidence/d7/cli.ts",
|
|
29
|
+
"evidence:prepare-g2": "node --import tsx/esm scripts/evidence/prepare-g2.ts",
|
|
30
|
+
"evidence:prepare-b6": "node --import tsx/esm scripts/evidence/prepare-b6.ts",
|
|
31
|
+
"evidence:judge-g2": "node --import tsx/esm src/evidence/g2/cli.ts",
|
|
32
|
+
"build:daemon": "tsc -p tsconfig.build.json && node scripts/copy-assets.mjs",
|
|
33
|
+
"build:ui": "vite build",
|
|
34
|
+
"build": "npm run build:daemon && npm run build:ui",
|
|
35
|
+
"prepare": "npm run build",
|
|
36
|
+
"prepublishOnly": "npm run build && npm test"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"better-sqlite3": "^12.0.0",
|
|
40
|
+
"react": "^18.3.1",
|
|
41
|
+
"react-dom": "^18.3.1",
|
|
42
|
+
"recharts": "^3.10.1",
|
|
43
|
+
"sirv": "^3.0.2"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@biomejs/biome": "^1.9.4",
|
|
47
|
+
"@testing-library/react": "^14.3.1",
|
|
48
|
+
"@types/better-sqlite3": "^7.6.12",
|
|
49
|
+
"@types/node": "^22.10.0",
|
|
50
|
+
"@types/react": "^18.3.12",
|
|
51
|
+
"@types/react-dom": "^18.3.1",
|
|
52
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
53
|
+
"jsdom": "^25.0.1",
|
|
54
|
+
"tsx": "^4.19.2",
|
|
55
|
+
"typescript": "^5.7.2",
|
|
56
|
+
"vite": "^6.0.5",
|
|
57
|
+
"vitest": "^2.1.8"
|
|
58
|
+
}
|
|
59
|
+
}
|