agentgraphed 0.3.0 → 0.3.2

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.
Files changed (140) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +39 -39
  3. package/.next/standalone/.next/app-path-routes-manifest.json +6 -6
  4. package/.next/standalone/.next/build-manifest.json +3 -3
  5. package/.next/standalone/.next/prerender-manifest.json +3 -3
  6. package/.next/standalone/.next/required-server-files.json +6 -6
  7. package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
  8. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  9. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  11. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  12. package/.next/standalone/.next/server/app/analytics/page.js +2 -2
  13. package/.next/standalone/.next/server/app/analytics/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/analytics/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/api/ingest-local/route.js +1 -1
  16. package/.next/standalone/.next/server/app/api/ingest-local/route_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/api/quota-probe/route.js +2 -2
  18. package/.next/standalone/.next/server/app/api/quota-probe/route_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/api/share/dashboard/route.js +1 -1
  20. package/.next/standalone/.next/server/app/api/share/dashboard/route_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/api/share/project/[id]/route.js +1 -1
  22. package/.next/standalone/.next/server/app/api/share/project/[id]/route_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/api/share/session/[id]/route.js +1 -1
  24. package/.next/standalone/.next/server/app/api/share/session/[id]/route_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/page.js +3 -3
  26. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/projects/[id]/page.js +2 -2
  29. package/.next/standalone/.next/server/app/projects/[id]/page.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/projects/[id]/page_client-reference-manifest.js +1 -1
  31. package/.next/standalone/.next/server/app/projects/page.js +2 -44
  32. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/sessions/[id]/page.js +3 -3
  35. package/.next/standalone/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/sessions/page.js +2 -44
  38. package/.next/standalone/.next/server/app/sessions/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/settings/page.js +4 -4
  41. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/timeline/page.js +2 -44
  44. package/.next/standalone/.next/server/app/timeline/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/timeline/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app-paths-manifest.json +6 -6
  47. package/.next/standalone/.next/server/chunks/27.js +15 -3
  48. package/.next/standalone/.next/server/chunks/450.js +137 -0
  49. package/.next/standalone/.next/server/chunks/564.js +4 -4
  50. package/.next/standalone/.next/server/chunks/694.js +43 -0
  51. package/.next/standalone/.next/server/chunks/903.js +1 -0
  52. package/.next/standalone/.next/server/chunks/944.js +61 -25
  53. package/.next/standalone/.next/server/chunks/954.js +1 -0
  54. package/.next/standalone/.next/server/functions-config-manifest.json +1 -1
  55. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  56. package/.next/standalone/.next/server/pages/404.html +1 -1
  57. package/.next/standalone/.next/server/pages/500.html +1 -1
  58. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  60. package/.next/standalone/.next/static/chunks/app/_not-found/{page-dc1cbec20c205394.js → page-01ad39d2ead973c7.js} +1 -1
  61. package/.next/{static/chunks/app/analytics/page-42186370029f753c.js → standalone/.next/static/chunks/app/analytics/page-79a1781c3529dcb6.js} +1 -1
  62. package/.next/standalone/.next/static/chunks/app/{layout-4527370a1e451501.js → layout-bbab14e77aaeeb67.js} +1 -1
  63. package/.next/standalone/.next/static/chunks/app/page-d5393f25e2553a0c.js +1 -0
  64. package/.next/standalone/.next/static/chunks/app/projects/[id]/page-32fe8cf66558be7c.js +1 -0
  65. package/.next/standalone/.next/static/chunks/app/projects/page-dce207c2f75422be.js +1 -0
  66. package/.next/standalone/.next/static/chunks/app/sessions/[id]/{page-a887f742425eb49c.js → page-49542233907f7f6b.js} +1 -1
  67. package/.next/standalone/.next/static/chunks/app/sessions/page-aec145af506da55b.js +1 -0
  68. package/.next/standalone/.next/static/chunks/app/settings/page-b961ca195748ef3b.js +1 -0
  69. package/.next/standalone/.next/static/chunks/app/timeline/page-dce207c2f75422be.js +1 -0
  70. package/.next/standalone/.next/static/chunks/{main-app-c9ae70e5bb48ac77.js → main-app-27b331c894fe5037.js} +1 -1
  71. package/.next/standalone/node_modules/@img/{sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib → sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3} +0 -0
  72. package/.next/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/package.json +11 -5
  73. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
  74. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  75. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
  76. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  77. package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  78. package/.next/standalone/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/package.json +13 -7
  79. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/LICENSE +191 -0
  80. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  81. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
  82. package/.next/standalone/package.json +1 -1
  83. package/.next/standalone/server.js +1 -1
  84. package/.next/standalone/src/lib/pricing-data/litellm.json +615 -92
  85. package/.next/standalone/src/lib/pricing-data/litellm.meta.json +2 -2
  86. package/.next/static/chunks/app/_not-found/{page-dc1cbec20c205394.js → page-01ad39d2ead973c7.js} +1 -1
  87. package/.next/{standalone/.next/static/chunks/app/analytics/page-42186370029f753c.js → static/chunks/app/analytics/page-79a1781c3529dcb6.js} +1 -1
  88. package/.next/static/chunks/app/{layout-4527370a1e451501.js → layout-bbab14e77aaeeb67.js} +1 -1
  89. package/.next/static/chunks/app/page-d5393f25e2553a0c.js +1 -0
  90. package/.next/static/chunks/app/projects/[id]/page-32fe8cf66558be7c.js +1 -0
  91. package/.next/static/chunks/app/projects/page-dce207c2f75422be.js +1 -0
  92. package/.next/static/chunks/app/sessions/[id]/{page-a887f742425eb49c.js → page-49542233907f7f6b.js} +1 -1
  93. package/.next/static/chunks/app/sessions/page-aec145af506da55b.js +1 -0
  94. package/.next/static/chunks/app/settings/page-b961ca195748ef3b.js +1 -0
  95. package/.next/static/chunks/app/timeline/page-dce207c2f75422be.js +1 -0
  96. package/.next/static/chunks/{main-app-c9ae70e5bb48ac77.js → main-app-27b331c894fe5037.js} +1 -1
  97. package/CHANGELOG.md +22 -0
  98. package/README.md +52 -46
  99. package/package.json +1 -1
  100. package/src/lib/pricing-data/litellm.json +615 -92
  101. package/src/lib/pricing-data/litellm.meta.json +2 -2
  102. package/.next/standalone/.next/server/chunks/165.js +0 -109
  103. package/.next/standalone/.next/server/chunks/191.js +0 -1
  104. package/.next/standalone/.next/server/chunks/367.js +0 -43
  105. package/.next/standalone/.next/server/chunks/660.js +0 -1
  106. package/.next/standalone/.next/static/chunks/app/page-aa358006ddd29e91.js +0 -1
  107. package/.next/standalone/.next/static/chunks/app/projects/[id]/page-15f21aaacdacb59c.js +0 -1
  108. package/.next/standalone/.next/static/chunks/app/projects/page-d794cc35674274a4.js +0 -1
  109. package/.next/standalone/.next/static/chunks/app/sessions/page-35c503eef7e53742.js +0 -1
  110. package/.next/standalone/.next/static/chunks/app/settings/page-dc0bec0bd2577322.js +0 -1
  111. package/.next/standalone/.next/static/chunks/app/timeline/page-d794cc35674274a4.js +0 -1
  112. package/.next/standalone/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  113. package/.next/standalone/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  114. package/.next/standalone/node_modules/better-sqlite3/lib/database.js +0 -90
  115. package/.next/standalone/node_modules/better-sqlite3/lib/index.js +0 -3
  116. package/.next/standalone/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
  117. package/.next/standalone/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
  118. package/.next/standalone/node_modules/better-sqlite3/lib/methods/function.js +0 -31
  119. package/.next/standalone/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
  120. package/.next/standalone/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
  121. package/.next/standalone/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
  122. package/.next/standalone/node_modules/better-sqlite3/lib/methods/table.js +0 -189
  123. package/.next/standalone/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
  124. package/.next/standalone/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
  125. package/.next/standalone/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
  126. package/.next/standalone/node_modules/better-sqlite3/lib/util.js +0 -12
  127. package/.next/standalone/node_modules/better-sqlite3/package.json +0 -54
  128. package/.next/static/chunks/app/page-aa358006ddd29e91.js +0 -1
  129. package/.next/static/chunks/app/projects/[id]/page-15f21aaacdacb59c.js +0 -1
  130. package/.next/static/chunks/app/projects/page-d794cc35674274a4.js +0 -1
  131. package/.next/static/chunks/app/sessions/page-35c503eef7e53742.js +0 -1
  132. package/.next/static/chunks/app/settings/page-dc0bec0bd2577322.js +0 -1
  133. package/.next/static/chunks/app/timeline/page-d794cc35674274a4.js +0 -1
  134. /package/.next/standalone/.next/static/{A6dvfHR2KYz42pasM2hyV → hnOq_d-GplXbWU5EnSBzF}/_buildManifest.js +0 -0
  135. /package/.next/standalone/.next/static/{A6dvfHR2KYz42pasM2hyV → hnOq_d-GplXbWU5EnSBzF}/_ssgManifest.js +0 -0
  136. /package/.next/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/index.js +0 -0
  137. /package/.next/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/versions.json +0 -0
  138. /package/.next/standalone/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/LICENSE +0 -0
  139. /package/.next/static/{A6dvfHR2KYz42pasM2hyV → hnOq_d-GplXbWU5EnSBzF}/_buildManifest.js +0 -0
  140. /package/.next/static/{A6dvfHR2KYz42pasM2hyV → hnOq_d-GplXbWU5EnSBzF}/_ssgManifest.js +0 -0
@@ -1,12 +0,0 @@
1
- 'use strict';
2
- const { getBooleanOption, cppdb } = require('../util');
3
-
4
- module.exports = function pragma(source, options) {
5
- if (options == null) options = {};
6
- if (typeof source !== 'string') throw new TypeError('Expected first argument to be a string');
7
- if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');
8
- const simple = getBooleanOption(options, 'simple');
9
-
10
- const stmt = this[cppdb].prepare(`PRAGMA ${source}`, this, true);
11
- return simple ? stmt.pluck().get() : stmt.all();
12
- };
@@ -1,16 +0,0 @@
1
- 'use strict';
2
- const { cppdb } = require('../util');
3
-
4
- module.exports = function serialize(options) {
5
- if (options == null) options = {};
6
-
7
- // Validate arguments
8
- if (typeof options !== 'object') throw new TypeError('Expected first argument to be an options object');
9
-
10
- // Interpret and validate options
11
- const attachedName = 'attached' in options ? options.attached : 'main';
12
- if (typeof attachedName !== 'string') throw new TypeError('Expected the "attached" option to be a string');
13
- if (!attachedName) throw new TypeError('The "attached" option cannot be an empty string');
14
-
15
- return this[cppdb].serialize(attachedName);
16
- };
@@ -1,189 +0,0 @@
1
- 'use strict';
2
- const { cppdb } = require('../util');
3
-
4
- module.exports = function defineTable(name, factory) {
5
- // Validate arguments
6
- if (typeof name !== 'string') throw new TypeError('Expected first argument to be a string');
7
- if (!name) throw new TypeError('Virtual table module name cannot be an empty string');
8
-
9
- // Determine whether the module is eponymous-only or not
10
- let eponymous = false;
11
- if (typeof factory === 'object' && factory !== null) {
12
- eponymous = true;
13
- factory = defer(parseTableDefinition(factory, 'used', name));
14
- } else {
15
- if (typeof factory !== 'function') throw new TypeError('Expected second argument to be a function or a table definition object');
16
- factory = wrapFactory(factory);
17
- }
18
-
19
- this[cppdb].table(factory, name, eponymous);
20
- return this;
21
- };
22
-
23
- function wrapFactory(factory) {
24
- return function virtualTableFactory(moduleName, databaseName, tableName, ...args) {
25
- const thisObject = {
26
- module: moduleName,
27
- database: databaseName,
28
- table: tableName,
29
- };
30
-
31
- // Generate a new table definition by invoking the factory
32
- const def = apply.call(factory, thisObject, args);
33
- if (typeof def !== 'object' || def === null) {
34
- throw new TypeError(`Virtual table module "${moduleName}" did not return a table definition object`);
35
- }
36
-
37
- return parseTableDefinition(def, 'returned', moduleName);
38
- };
39
- }
40
-
41
- function parseTableDefinition(def, verb, moduleName) {
42
- // Validate required properties
43
- if (!hasOwnProperty.call(def, 'rows')) {
44
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition without a "rows" property`);
45
- }
46
- if (!hasOwnProperty.call(def, 'columns')) {
47
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition without a "columns" property`);
48
- }
49
-
50
- // Validate "rows" property
51
- const rows = def.rows;
52
- if (typeof rows !== 'function' || Object.getPrototypeOf(rows) !== GeneratorFunctionPrototype) {
53
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "rows" property (should be a generator function)`);
54
- }
55
-
56
- // Validate "columns" property
57
- let columns = def.columns;
58
- if (!Array.isArray(columns) || !(columns = [...columns]).every(x => typeof x === 'string')) {
59
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "columns" property (should be an array of strings)`);
60
- }
61
- if (columns.length !== new Set(columns).size) {
62
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with duplicate column names`);
63
- }
64
- if (!columns.length) {
65
- throw new RangeError(`Virtual table module "${moduleName}" ${verb} a table definition with zero columns`);
66
- }
67
-
68
- // Validate "parameters" property
69
- let parameters;
70
- if (hasOwnProperty.call(def, 'parameters')) {
71
- parameters = def.parameters;
72
- if (!Array.isArray(parameters) || !(parameters = [...parameters]).every(x => typeof x === 'string')) {
73
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "parameters" property (should be an array of strings)`);
74
- }
75
- } else {
76
- parameters = inferParameters(rows);
77
- }
78
- if (parameters.length !== new Set(parameters).size) {
79
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with duplicate parameter names`);
80
- }
81
- if (parameters.length > 32) {
82
- throw new RangeError(`Virtual table module "${moduleName}" ${verb} a table definition with more than the maximum number of 32 parameters`);
83
- }
84
- for (const parameter of parameters) {
85
- if (columns.includes(parameter)) {
86
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with column "${parameter}" which was ambiguously defined as both a column and parameter`);
87
- }
88
- }
89
-
90
- // Validate "safeIntegers" option
91
- let safeIntegers = 2;
92
- if (hasOwnProperty.call(def, 'safeIntegers')) {
93
- const bool = def.safeIntegers;
94
- if (typeof bool !== 'boolean') {
95
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "safeIntegers" property (should be a boolean)`);
96
- }
97
- safeIntegers = +bool;
98
- }
99
-
100
- // Validate "directOnly" option
101
- let directOnly = false;
102
- if (hasOwnProperty.call(def, 'directOnly')) {
103
- directOnly = def.directOnly;
104
- if (typeof directOnly !== 'boolean') {
105
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "directOnly" property (should be a boolean)`);
106
- }
107
- }
108
-
109
- // Generate SQL for the virtual table definition
110
- const columnDefinitions = [
111
- ...parameters.map(identifier).map(str => `${str} HIDDEN`),
112
- ...columns.map(identifier),
113
- ];
114
- return [
115
- `CREATE TABLE x(${columnDefinitions.join(', ')});`,
116
- wrapGenerator(rows, new Map(columns.map((x, i) => [x, parameters.length + i])), moduleName),
117
- parameters,
118
- safeIntegers,
119
- directOnly,
120
- ];
121
- }
122
-
123
- function wrapGenerator(generator, columnMap, moduleName) {
124
- return function* virtualTable(...args) {
125
- /*
126
- We must defensively clone any buffers in the arguments, because
127
- otherwise the generator could mutate one of them, which would cause
128
- us to return incorrect values for hidden columns, potentially
129
- corrupting the database.
130
- */
131
- const output = args.map(x => Buffer.isBuffer(x) ? Buffer.from(x) : x);
132
- for (let i = 0; i < columnMap.size; ++i) {
133
- output.push(null); // Fill with nulls to prevent gaps in array (v8 optimization)
134
- }
135
- for (const row of generator(...args)) {
136
- if (Array.isArray(row)) {
137
- extractRowArray(row, output, columnMap.size, moduleName);
138
- yield output;
139
- } else if (typeof row === 'object' && row !== null) {
140
- extractRowObject(row, output, columnMap, moduleName);
141
- yield output;
142
- } else {
143
- throw new TypeError(`Virtual table module "${moduleName}" yielded something that isn't a valid row object`);
144
- }
145
- }
146
- };
147
- }
148
-
149
- function extractRowArray(row, output, columnCount, moduleName) {
150
- if (row.length !== columnCount) {
151
- throw new TypeError(`Virtual table module "${moduleName}" yielded a row with an incorrect number of columns`);
152
- }
153
- const offset = output.length - columnCount;
154
- for (let i = 0; i < columnCount; ++i) {
155
- output[i + offset] = row[i];
156
- }
157
- }
158
-
159
- function extractRowObject(row, output, columnMap, moduleName) {
160
- let count = 0;
161
- for (const key of Object.keys(row)) {
162
- const index = columnMap.get(key);
163
- if (index === undefined) {
164
- throw new TypeError(`Virtual table module "${moduleName}" yielded a row with an undeclared column "${key}"`);
165
- }
166
- output[index] = row[key];
167
- count += 1;
168
- }
169
- if (count !== columnMap.size) {
170
- throw new TypeError(`Virtual table module "${moduleName}" yielded a row with missing columns`);
171
- }
172
- }
173
-
174
- function inferParameters({ length }) {
175
- if (!Number.isInteger(length) || length < 0) {
176
- throw new TypeError('Expected function.length to be a positive integer');
177
- }
178
- const params = [];
179
- for (let i = 0; i < length; ++i) {
180
- params.push(`$${i + 1}`);
181
- }
182
- return params;
183
- }
184
-
185
- const { hasOwnProperty } = Object.prototype;
186
- const { apply } = Function.prototype;
187
- const GeneratorFunctionPrototype = Object.getPrototypeOf(function*(){});
188
- const identifier = str => `"${str.replace(/"/g, '""')}"`;
189
- const defer = x => () => x;
@@ -1,78 +0,0 @@
1
- 'use strict';
2
- const { cppdb } = require('../util');
3
- const controllers = new WeakMap();
4
-
5
- module.exports = function transaction(fn) {
6
- if (typeof fn !== 'function') throw new TypeError('Expected first argument to be a function');
7
-
8
- const db = this[cppdb];
9
- const controller = getController(db, this);
10
- const { apply } = Function.prototype;
11
-
12
- // Each version of the transaction function has these same properties
13
- const properties = {
14
- default: { value: wrapTransaction(apply, fn, db, controller.default) },
15
- deferred: { value: wrapTransaction(apply, fn, db, controller.deferred) },
16
- immediate: { value: wrapTransaction(apply, fn, db, controller.immediate) },
17
- exclusive: { value: wrapTransaction(apply, fn, db, controller.exclusive) },
18
- database: { value: this, enumerable: true },
19
- };
20
-
21
- Object.defineProperties(properties.default.value, properties);
22
- Object.defineProperties(properties.deferred.value, properties);
23
- Object.defineProperties(properties.immediate.value, properties);
24
- Object.defineProperties(properties.exclusive.value, properties);
25
-
26
- // Return the default version of the transaction function
27
- return properties.default.value;
28
- };
29
-
30
- // Return the database's cached transaction controller, or create a new one
31
- const getController = (db, self) => {
32
- let controller = controllers.get(db);
33
- if (!controller) {
34
- const shared = {
35
- commit: db.prepare('COMMIT', self, false),
36
- rollback: db.prepare('ROLLBACK', self, false),
37
- savepoint: db.prepare('SAVEPOINT `\t_bs3.\t`', self, false),
38
- release: db.prepare('RELEASE `\t_bs3.\t`', self, false),
39
- rollbackTo: db.prepare('ROLLBACK TO `\t_bs3.\t`', self, false),
40
- };
41
- controllers.set(db, controller = {
42
- default: Object.assign({ begin: db.prepare('BEGIN', self, false) }, shared),
43
- deferred: Object.assign({ begin: db.prepare('BEGIN DEFERRED', self, false) }, shared),
44
- immediate: Object.assign({ begin: db.prepare('BEGIN IMMEDIATE', self, false) }, shared),
45
- exclusive: Object.assign({ begin: db.prepare('BEGIN EXCLUSIVE', self, false) }, shared),
46
- });
47
- }
48
- return controller;
49
- };
50
-
51
- // Return a new transaction function by wrapping the given function
52
- const wrapTransaction = (apply, fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function sqliteTransaction() {
53
- let before, after, undo;
54
- if (db.inTransaction) {
55
- before = savepoint;
56
- after = release;
57
- undo = rollbackTo;
58
- } else {
59
- before = begin;
60
- after = commit;
61
- undo = rollback;
62
- }
63
- before.run();
64
- try {
65
- const result = apply.call(fn, this, arguments);
66
- if (result && typeof result.then === 'function') {
67
- throw new TypeError('Transaction function cannot return a promise');
68
- }
69
- after.run();
70
- return result;
71
- } catch (ex) {
72
- if (db.inTransaction) {
73
- undo.run();
74
- if (undo !== rollback) after.run();
75
- }
76
- throw ex;
77
- }
78
- };
@@ -1,54 +0,0 @@
1
- 'use strict';
2
- const { cppdb } = require('../util');
3
-
4
- exports.prepare = function prepare(sql) {
5
- return this[cppdb].prepare(sql, this, false);
6
- };
7
-
8
- exports.exec = function exec(sql) {
9
- this[cppdb].exec(sql);
10
- return this;
11
- };
12
-
13
- exports.close = function close() {
14
- this[cppdb].close();
15
- return this;
16
- };
17
-
18
- exports.loadExtension = function loadExtension(...args) {
19
- this[cppdb].loadExtension(...args);
20
- return this;
21
- };
22
-
23
- exports.defaultSafeIntegers = function defaultSafeIntegers(...args) {
24
- this[cppdb].defaultSafeIntegers(...args);
25
- return this;
26
- };
27
-
28
- exports.unsafeMode = function unsafeMode(...args) {
29
- this[cppdb].unsafeMode(...args);
30
- return this;
31
- };
32
-
33
- exports.getters = {
34
- name: {
35
- get: function name() { return this[cppdb].name; },
36
- enumerable: true,
37
- },
38
- open: {
39
- get: function open() { return this[cppdb].open; },
40
- enumerable: true,
41
- },
42
- inTransaction: {
43
- get: function inTransaction() { return this[cppdb].inTransaction; },
44
- enumerable: true,
45
- },
46
- readonly: {
47
- get: function readonly() { return this[cppdb].readonly; },
48
- enumerable: true,
49
- },
50
- memory: {
51
- get: function memory() { return this[cppdb].memory; },
52
- enumerable: true,
53
- },
54
- };
@@ -1,20 +0,0 @@
1
- 'use strict';
2
- const descriptor = { value: 'SqliteError', writable: true, enumerable: false, configurable: true };
3
-
4
- function SqliteError(message, code) {
5
- if (new.target !== SqliteError) {
6
- return new SqliteError(message, code);
7
- }
8
- if (typeof code !== 'string') {
9
- throw new TypeError('Expected second argument to be a string');
10
- }
11
- Error.call(this, message);
12
- descriptor.value = '' + message;
13
- Object.defineProperty(this, 'message', descriptor);
14
- Error.captureStackTrace(this, SqliteError);
15
- this.code = code;
16
- }
17
- Object.setPrototypeOf(SqliteError, Error);
18
- Object.setPrototypeOf(SqliteError.prototype, Error.prototype);
19
- Object.defineProperty(SqliteError.prototype, 'name', descriptor);
20
- module.exports = SqliteError;
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- exports.getBooleanOption = (options, key) => {
4
- let value = false;
5
- if (key in options && typeof (value = options[key]) !== 'boolean') {
6
- throw new TypeError(`Expected the "${key}" option to be a boolean`);
7
- }
8
- return value;
9
- };
10
-
11
- exports.cppdb = Symbol();
12
- exports.inspect = Symbol.for('nodejs.util.inspect.custom');
@@ -1,54 +0,0 @@
1
- {
2
- "name": "better-sqlite3",
3
- "version": "11.10.0",
4
- "description": "The fastest and simplest library for SQLite in Node.js.",
5
- "homepage": "http://github.com/WiseLibs/better-sqlite3",
6
- "author": "Joshua Wise <joshuathomaswise@gmail.com>",
7
- "repository": {
8
- "type": "git",
9
- "url": "git://github.com/WiseLibs/better-sqlite3.git"
10
- },
11
- "main": "lib/index.js",
12
- "files": [
13
- "binding.gyp",
14
- "src/*.[ch]pp",
15
- "lib/**",
16
- "deps/**"
17
- ],
18
- "dependencies": {
19
- "bindings": "^1.5.0",
20
- "prebuild-install": "^7.1.1"
21
- },
22
- "devDependencies": {
23
- "chai": "^4.3.8",
24
- "cli-color": "^2.0.3",
25
- "fs-extra": "^11.1.1",
26
- "mocha": "^10.2.0",
27
- "nodemark": "^0.3.0",
28
- "prebuild": "^13.0.1",
29
- "sqlite": "^5.0.1",
30
- "sqlite3": "^5.1.6"
31
- },
32
- "scripts": {
33
- "install": "prebuild-install || node-gyp rebuild --release",
34
- "build-release": "node-gyp rebuild --release",
35
- "build-debug": "node-gyp rebuild --debug",
36
- "rebuild-release": "npm run lzz && npm run build-release",
37
- "rebuild-debug": "npm run lzz && npm run build-debug",
38
- "test": "mocha --exit --slow=75 --timeout=5000",
39
- "benchmark": "node benchmark",
40
- "download": "bash ./deps/download.sh",
41
- "lzz": "lzz -hx hpp -sx cpp -k BETTER_SQLITE3 -d -hl -sl -e ./src/better_sqlite3.lzz"
42
- },
43
- "license": "MIT",
44
- "keywords": [
45
- "sql",
46
- "sqlite",
47
- "sqlite3",
48
- "transactions",
49
- "user-defined functions",
50
- "aggregate functions",
51
- "window functions",
52
- "database"
53
- ]
54
- }
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{2278:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,52619,23)),Promise.resolve().then(r.bind(r,15433)),Promise.resolve().then(r.bind(r,34077)),Promise.resolve().then(r.bind(r,74050)),Promise.resolve().then(r.bind(r,61438)),Promise.resolve().then(r.bind(r,95925)),Promise.resolve().then(r.bind(r,17834)),Promise.resolve().then(r.bind(r,29366))},15433:(e,t,r)=>{"use strict";r.d(t,{ClassifyChip:()=>a});var n=r(95155),o=r(12115),s=r(20063),i=r(25511);function a(e){let{count:t,estimatedUsd:r}=e,a=(0,s.useRouter)(),[l,c]=(0,o.useState)("idle"),[d,u]=(0,o.useState)(null),[m,p]=(0,o.useState)(null),[h,x]=(0,o.useTransition)(),f=()=>{if("idle"===l)return void c("confirm");"confirm"===l&&x(async()=>{let e=await (0,i.v)("uncategorized");if(!e.ok){u(e.error),c("err"),setTimeout(()=>c("idle"),4e3);return}p({classified:e.classified,costUsd:e.costUsd}),c("done"),a.refresh(),setTimeout(()=>c("idle"),3e3)})};return"done"===l&&m?(0,n.jsxs)("div",{className:"text-[11px] font-mono px-2 py-0.5 rounded bg-secondary/10 text-secondary border border-secondary/30",children:["✓ classified ",m.classified," \xb7 $",m.costUsd.toFixed(4)]}):"err"===l?(0,n.jsx)("div",{className:"text-[11px] font-mono px-2 py-0.5 rounded bg-error/10 text-error border border-error/30",title:null!=d?d:"",children:"✗ failed"}):"confirm"===l?(0,n.jsx)("button",{onClick:f,disabled:h,className:"text-[11px] font-mono px-2 py-0.5 rounded bg-primary/15 text-primary border border-primary/40 hover:bg-primary/25 transition-colors disabled:opacity-60",title:"Click again to confirm — sends prompts to your configured provider",children:h?"… classifying":"confirm \xb7 run for ~$".concat(r.toFixed(4))}):(0,n.jsxs)("button",{onClick:f,className:"text-[11px] font-mono px-2 py-0.5 rounded text-ink-mute hover:text-primary hover:bg-surface-2 transition-colors",title:"Send their first prompts to your configured LLM to assign a title + category. ~$0.0001 per session.",children:[t," unclassified \xb7 classify"]})}},17834:(e,t,r)=>{"use strict";r.d(t,{ShareButton:()=>s});var n=r(95155),o=r(12115);function s(e){let{imageUrl:t,className:r}=e,[s,c]=(0,o.useState)("idle"),[d,u]=(0,o.useState)(null),m=async()=>{c("busy"),u(null);try{var e;let r=await fetch(t);if(!r.ok)throw Error("HTTP ".concat(r.status));let n=await r.blob();if("undefined"==typeof ClipboardItem||!(null==(e=navigator.clipboard)?void 0:e.write))throw Error("clipboard image unsupported");let o=new ClipboardItem({"image/png":n});await navigator.clipboard.write([o]),c("done"),setTimeout(()=>c("idle"),2400)}catch(e){try{let e=await fetch(t),r=await e.blob(),n=URL.createObjectURL(r),o=document.createElement("a");o.href=n,o.download="agentgraphed-stats.png",document.body.appendChild(o),o.click(),document.body.removeChild(o),setTimeout(()=>URL.revokeObjectURL(n),5e3),u("Saved to Downloads (clipboard image unsupported)"),c("err"),setTimeout(()=>c("idle"),4e3)}catch(t){u(t.message||e.message),c("err"),setTimeout(()=>c("idle"),3e3)}}};return(0,n.jsx)("button",{onClick:m,disabled:"busy"===s,"aria-label":"Share",title:"busy"===s?"Generating image…":"done"===s?"Image copied to clipboard":"err"===s?null!=d?d:"Try again":"Copy share image to clipboard",className:"btn-icon ".concat("done"===s?"text-secondary":""," ").concat(null!=r?r:""),children:"busy"===s?(0,n.jsx)(l,{}):"done"===s?(0,n.jsx)(a,{}):(0,n.jsx)(i,{})})}function i(){return(0,n.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),(0,n.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,n.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function a(){return(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"20 6 9 17 4 12"})})}function l(){return(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:(0,n.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}},20467:(e,t,r)=>{"use strict";function n(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"k"):e.toString()}function o(e){return e>=1e3?"$".concat(e.toFixed(0)):"$".concat(e.toFixed(2))}function s(e){let t=Math.floor(e/1e3);if(t<60)return"".concat(t,"s");let r=Math.floor(t/60);if(r<60)return"".concat(r,"m");let n=Math.floor(r/60);return"".concat(n,"h ").concat(r%60,"m")}r.d(t,{F0:()=>o,c5:()=>s,yj:()=>n})},25511:(e,t,r)=>{"use strict";r.d(t,{v:()=>o});var n=r(30926);let o=(0,n.createServerReference)("40ebbe581be2d6a1560853a1f470f6bef259ff3ce0",n.callServer,void 0,n.findSourceMapURL,"classifyAction")},29366:(e,t,r)=>{"use strict";r.d(t,{UsageChartCard:()=>x});var n=r(95155),o=r(12115),s=r(20063),i=r(26991),a=r(73850),l=r(68425),c=r(47734),d=r(73697),u=r(23508),m=r(77568),p=r(20467);function h(e){let{data:t,metric:r="tokens",scale:o="lin"}=e,s=t.map(e=>{let t=e[r];return{...e,label:e.day.slice(5),value:"log"===o&&t<=0?1:t,raw:t}}),h="cost"===r?"#00ffab":"#00f5ff";return(0,n.jsx)("div",{className:"h-64 -mx-1",children:(0,n.jsx)(i.u,{width:"100%",height:"100%",children:(0,n.jsxs)(a.Q,{data:s,margin:{top:8,right:8,bottom:0,left:-8},children:[(0,n.jsx)("defs",{children:(0,n.jsxs)("linearGradient",{id:"grad-".concat(r),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,n.jsx)("stop",{offset:"0%",stopColor:h,stopOpacity:.35}),(0,n.jsx)("stop",{offset:"100%",stopColor:h,stopOpacity:0})]})}),(0,n.jsx)(l.d,{stroke:"#262a31",strokeDasharray:"2 4",vertical:!1}),(0,n.jsx)(c.W,{dataKey:"label",tick:{fill:"#849495",fontSize:11,fontFamily:"JetBrains Mono"},axisLine:{stroke:"#262a31"},tickLine:!1,minTickGap:48}),(0,n.jsx)(d.h,{scale:"log"===o?"log":"auto",domain:"log"===o?[1,"auto"]:["auto","auto"],allowDataOverflow:!0,tick:{fill:"#849495",fontSize:11,fontFamily:"JetBrains Mono"},axisLine:!1,tickLine:!1,tickFormatter:e=>"cost"===r?"$".concat(Math.round(e)):(0,p.yj)(e)}),(0,n.jsx)(u.m,{cursor:{stroke:h,strokeOpacity:.3},contentStyle:{background:"#181c22",border:"1px solid ".concat(h),borderRadius:6,fontSize:12,color:"#dfe2eb"},formatter:(e,t,n)=>{var o,s;let i=null!=(s=null==n||null==(o=n.payload)?void 0:o.raw)?s:0;return"tokens"===r?[(0,p.yj)(i),"tokens"]:"sessions"===r?[i.toString(),"sessions"]:["$".concat(i.toFixed(2)),"cost"]},labelFormatter:e=>"Day ".concat(e)}),(0,n.jsx)(m.G,{type:"monotone",dataKey:"value",stroke:h,strokeWidth:2,fill:"url(#grad-".concat(r,")"),isAnimationActive:!1})]})})})}function x(e){let{data:t,label:r="last 30 days",metric:i,scale:a}=e,l=(0,s.useRouter)(),c=(0,s.usePathname)(),d=(0,s.useSearchParams)(),u=(0,o.useMemo)(()=>!function(e,t){let r=e.map(e=>e[t]).filter(e=>e>0);if(r.length<5)return!1;let n=[...r].sort((e,t)=>e-t);return n[n.length-1]/Math.max(n[Math.floor(n.length/2)],1)>10}(t,i)?"lin":"log",[t,i]),m=null!=a?a:u,p=(e,t,r)=>{let n=new URLSearchParams(d.toString());null===t||t===r?n.delete(e):n.set(e,t);let o=n.toString();l.push(o?"".concat(c,"?").concat(o):c,{scroll:!1})};return(0,n.jsxs)("div",{className:"card",children:[(0,n.jsxs)("div",{className:"card-header flex items-center justify-between",children:[(0,n.jsxs)("span",{children:["Usage — ",r]}),(0,n.jsxs)("div",{className:"flex items-center gap-3 normal-case tracking-normal",children:[(0,n.jsx)("div",{className:"flex items-center gap-0.5",children:[{id:"tokens",label:"Tokens"},{id:"sessions",label:"Sessions"},{id:"cost",label:"Est. Cost"}].map(e=>(0,n.jsx)("button",{onClick:()=>p("metric",e.id,"tokens"),className:"px-2 py-0.5 text-[11px] rounded transition-colors font-mono ".concat(i===e.id?"bg-primary/15 text-primary":"text-ink-mute hover:text-ink-dim"),children:e.label},e.id))}),(0,n.jsx)("div",{className:"w-px h-4 bg-surface-3"}),(0,n.jsx)("div",{className:"flex items-center gap-0.5",children:["lin","log"].map(e=>(0,n.jsxs)("button",{onClick:()=>p("scale",e,u),className:"px-1.5 py-0.5 text-[10px] rounded transition-colors font-mono uppercase relative ".concat(m===e?"bg-secondary/15 text-secondary":"text-ink-mute hover:text-ink-dim"),title:"log"===e?"Logarithmic scale — better when one day dwarfs the rest":"Linear scale",children:[e,null===a&&u===e&&(0,n.jsx)("span",{className:"absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full bg-secondary",title:"auto-selected based on data range"})]},e))})]})]}),(0,n.jsx)("div",{className:"p-4",children:(0,n.jsx)(h,{data:t,metric:i,scale:m})})]})}},30926:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return n.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}});let n=r(41209),o=r(85153),s=r(77197)},34077:(e,t,r)=>{"use strict";r.d(t,{FreshnessIndicator:()=>i});var n=r(95155),o=r(12115),s=r(20063);function i(e){let{lastIngestedAt:t}=e,[,r]=(0,o.useState)(0),[i,c]=(0,o.useState)(!1),[d,u]=(0,o.useTransition)(),m=(0,s.useRouter)();(0,o.useEffect)(()=>{let e=setInterval(()=>r(e=>e+1),5e3);return()=>clearInterval(e)},[]);let p=0===t?"never scanned":"updated ".concat(function(e){let t=Date.now()-e;return t<1e3?"just now":t<6e4?"".concat(l(Math.round(t/1e3)),"s"):t<36e5?"".concat(l(Math.round(t/6e4)),"m"):"".concat(l(Math.round(t/36e5)),"h")}(t)," ago"),h=0===t,x=i||d;return(0,n.jsxs)("button",{type:"button",onClick:function(){u(()=>m.refresh())},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1),disabled:h||d,title:"Re-scan local sessions and refresh",style:{width:"128px"},className:"text-[11px] font-mono tabular px-2 py-0.5 rounded transition-colors text-ink-mute hover:text-primary hover:bg-surface-2 focus-visible:text-primary focus-visible:bg-surface-2 outline-none disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-ink-mute disabled:cursor-not-allowed grid items-center",children:[(0,n.jsx)("span",{className:"col-start-1 row-start-1 transition-opacity flex items-center justify-center gap-1.5 whitespace-nowrap",style:{opacity:+!x},children:p}),(0,n.jsxs)("span",{"aria-hidden":!0,className:"col-start-1 row-start-1 transition-opacity flex items-center justify-center gap-1.5 whitespace-nowrap",style:{opacity:+!!x},children:[(0,n.jsx)(a,{spinning:d}),(0,n.jsx)("span",{children:"refresh"})]})]})}function a(e){let{spinning:t}=e;return(0,n.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:t?"animate-spin":"",children:[(0,n.jsx)("path",{d:"M3 12a9 9 0 0 1 15.5-6.4L21 8"}),(0,n.jsx)("path",{d:"M21 3v5h-5"}),(0,n.jsx)("path",{d:"M21 12a9 9 0 0 1-15.5 6.4L3 16"}),(0,n.jsx)("path",{d:"M3 21v-5h5"})]})}function l(e){return e<10?"0".concat(e):String(e)}},61438:(e,t,r)=>{"use strict";r.d(t,{ProjectFilter:()=>a});var n=r(95155),o=r(20063),s=r(12115),i=r(47650);function a(e){var t,r;let{projects:a,current:l}=e,c=(0,o.useRouter)(),d=(0,o.usePathname)(),u=(0,o.useSearchParams)(),[m,p]=(0,s.useState)(!1),[h,x]=(0,s.useTransition)(),[f,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(null),g=(0,s.useRef)(null);(0,s.useEffect)(()=>y(!0),[]);let k=e=>{let t=new URLSearchParams(u.toString());e?t.set("project",e):t.delete("project");let r=t.toString();p(!1),x(()=>c.push(r?"".concat(d,"?").concat(r):d,{scroll:!1}))},j=l?null!=(r=null==(t=a.find(e=>e.id===l))?void 0:t.name)?r:"project":null;return(0,s.useEffect)(()=>{if(!m)return;let e=e=>{var t;let r=e.target;if(null==(t=g.current)?void 0:t.contains(r))return;let n=document.getElementById("project-filter-pop");null!=n&&n.contains(r)||p(!1)},t=e=>{"Escape"===e.key&&p(!1)};return window.addEventListener("mousedown",e),window.addEventListener("keydown",t),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("keydown",t)}},[m]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{ref:g,onClick:()=>{if(!m&&g.current){let e=g.current.getBoundingClientRect();v({top:e.bottom+6,left:e.left,width:Math.max(e.width,220)})}p(e=>!e)},className:"text-[11px] font-mono px-2 py-0.5 rounded transition-colors flex items-center gap-1.5 ".concat(l?"bg-primary/15 text-primary":"text-ink-mute hover:text-ink-dim hover:bg-surface-2"," ").concat(h?"opacity-60":""),title:"Filter by project",children:[(0,n.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,n.jsx)("span",{className:"truncate max-w-[140px]",children:null!=j?j:"All projects"}),(0,n.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform ".concat(m?"rotate-180":""),children:(0,n.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),f&&m&&b&&(0,i.createPortal)((0,n.jsxs)("div",{id:"project-filter-pop",style:{position:"fixed",top:b.top,left:b.left,minWidth:b.width,backgroundColor:"#1c2026",zIndex:100,isolation:"isolate"},className:"border border-surface-3 rounded-md shadow-xl overflow-hidden text-[12px] font-mono max-h-[60vh] overflow-y-auto",children:[(0,n.jsx)("button",{onClick:()=>k(null),className:"w-full text-left px-3 py-2 transition-colors hover:bg-surface-2 ".concat(l?"text-ink-dim":"text-primary bg-primary/10"),children:"All projects"}),(0,n.jsx)("div",{className:"h-px bg-surface-3"}),a.map(e=>(0,n.jsx)("button",{onClick:()=>k(e.id),className:"w-full text-left px-3 py-2 transition-colors hover:bg-surface-2 truncate ".concat(l===e.id?"text-primary bg-primary/10":"text-ink-dim"),title:e.name,children:e.name},e.id)),0===a.length&&(0,n.jsx)("div",{className:"px-3 py-2 text-ink-mute",children:"No projects yet."})]}),document.body)]})}},74050:(e,t,r)=>{"use strict";r.d(t,{ModelFilter:()=>a});var n=r(95155),o=r(20063),s=r(12115),i=r(47650);function a(e){let{families:t,current:r}=e,a=(0,o.useRouter)(),l=(0,o.usePathname)(),c=(0,o.useSearchParams)(),[d,u]=(0,s.useState)(!1),[m,p]=(0,s.useTransition)(),[h,x]=(0,s.useState)(!1),[f,y]=(0,s.useState)(null),b=(0,s.useRef)(null);(0,s.useEffect)(()=>x(!0),[]);let v=e=>{let t=new URLSearchParams(c.toString());e?t.set("model",e):t.delete("model");let r=t.toString();u(!1),p(()=>a.push(r?"".concat(l,"?").concat(r):l,{scroll:!1}))};return(0,s.useEffect)(()=>{if(!d)return;let e=e=>{var t;let r=e.target;if(null==(t=b.current)?void 0:t.contains(r))return;let n=document.getElementById("model-filter-pop");null!=n&&n.contains(r)||u(!1)},t=e=>{"Escape"===e.key&&u(!1)};return window.addEventListener("mousedown",e),window.addEventListener("keydown",t),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("keydown",t)}},[d]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{ref:b,onClick:()=>{if(!d&&b.current){let e=b.current.getBoundingClientRect();y({top:e.bottom+6,left:e.left,width:Math.max(e.width,200)})}u(e=>!e)},className:"text-[11px] font-mono px-2 py-0.5 rounded transition-colors flex items-center gap-1.5 ".concat(r?"bg-primary/15 text-primary":"text-ink-mute hover:text-ink-dim hover:bg-surface-2"," ").concat(m?"opacity-60":""),title:"Filter by model",children:[(0,n.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),(0,n.jsx)("span",{className:"truncate max-w-[140px]",children:null!=r?r:"All models"}),(0,n.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform ".concat(d?"rotate-180":""),children:(0,n.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),h&&d&&f&&(0,i.createPortal)((0,n.jsxs)("div",{id:"model-filter-pop",style:{position:"fixed",top:f.top,left:f.left,minWidth:f.width,backgroundColor:"#1c2026",zIndex:100,isolation:"isolate"},className:"border border-surface-3 rounded-md shadow-xl overflow-hidden text-[12px] font-mono max-h-[60vh] overflow-y-auto",children:[(0,n.jsx)("button",{onClick:()=>v(null),className:"w-full text-left px-3 py-2 transition-colors hover:bg-surface-2 ".concat(r?"text-ink-dim":"text-primary bg-primary/10"),children:"All models"}),(0,n.jsx)("div",{className:"h-px bg-surface-3"}),t.map(e=>(0,n.jsxs)("button",{onClick:()=>v(e.family),className:"w-full text-left px-3 py-2 transition-colors hover:bg-surface-2 flex items-center justify-between gap-3 ".concat(r===e.family?"text-primary bg-primary/10":"text-ink-dim"),title:e.family,children:[(0,n.jsx)("span",{className:"truncate",children:e.family}),(0,n.jsx)("span",{className:"text-ink-mute text-[10px] tabular",children:e.sessions})]},e.family)),0===t.length&&(0,n.jsx)("div",{className:"px-3 py-2 text-ink-mute",children:"No models seen yet."})]}),document.body)]})}},95925:(e,t,r)=>{"use strict";r.d(t,{RangePicker:()=>a});var n=r(95155),o=r(20063),s=r(12115);let i=[{key:"7d",label:"Last 7 days",days:7},{key:"30d",label:"Last 30 days",days:30},{key:"90d",label:"Last 90 days",days:90},{key:"all",label:"All time",days:null}];function a(e){let{current:t}=e,r=(0,o.useRouter)(),a=(0,o.usePathname)(),l=(0,o.useSearchParams)(),[c,d]=(0,s.useTransition)();return(0,n.jsx)("div",{className:"flex items-center gap-0.5 normal-case tracking-normal transition-opacity ".concat(c?"opacity-50":""),children:i.map(e=>(0,n.jsx)("button",{onClick:()=>(e=>{let t=new URLSearchParams(l.toString());"30d"===e?t.delete("range"):t.set("range",e);let n=t.toString();d(()=>{r.push(n?"".concat(a,"?").concat(n):a)})})(e.key),className:"px-2 py-0.5 text-[11px] rounded transition-colors font-mono ".concat(t===e.key?"bg-primary/15 text-primary":"text-ink-mute hover:text-ink-dim"),children:"all"===e.key?"All":e.key},e.key))})}}},e=>{e.O(0,[619,997,441,255,358],()=>e(e.s=2278)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[801],{16500:(e,t,o)=>{Promise.resolve().then(o.t.bind(o,52619,23)),Promise.resolve().then(o.bind(o,17834))},17834:(e,t,o)=>{"use strict";o.d(t,{ShareButton:()=>r});var n=o(95155),i=o(12115);function r(e){let{imageUrl:t,className:o}=e,[r,d]=(0,i.useState)("idle"),[c,u]=(0,i.useState)(null),h=async()=>{d("busy"),u(null);try{var e;let o=await fetch(t);if(!o.ok)throw Error("HTTP ".concat(o.status));let n=await o.blob();if("undefined"==typeof ClipboardItem||!(null==(e=navigator.clipboard)?void 0:e.write))throw Error("clipboard image unsupported");let i=new ClipboardItem({"image/png":n});await navigator.clipboard.write([i]),d("done"),setTimeout(()=>d("idle"),2400)}catch(e){try{let e=await fetch(t),o=await e.blob(),n=URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download="agentgraphed-stats.png",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>URL.revokeObjectURL(n),5e3),u("Saved to Downloads (clipboard image unsupported)"),d("err"),setTimeout(()=>d("idle"),4e3)}catch(t){u(t.message||e.message),d("err"),setTimeout(()=>d("idle"),3e3)}}};return(0,n.jsx)("button",{onClick:h,disabled:"busy"===r,"aria-label":"Share",title:"busy"===r?"Generating image…":"done"===r?"Image copied to clipboard":"err"===r?null!=c?c:"Try again":"Copy share image to clipboard",className:"btn-icon ".concat("done"===r?"text-secondary":""," ").concat(null!=o?o:""),children:"busy"===r?(0,n.jsx)(l,{}):"done"===r?(0,n.jsx)(s,{}):(0,n.jsx)(a,{})})}function a(){return(0,n.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),(0,n.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,n.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function s(){return(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"20 6 9 17 4 12"})})}function l(){return(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:(0,n.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}}},e=>{e.O(0,[619,441,255,358],()=>e(e.s=16500)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[404,893],{8724:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,52619,23))}},e=>{e.O(0,[619,441,255,358],()=>e(e.s=8724)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[898],{20063:(e,t,r)=>{"use strict";var n=r(47260);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},20467:(e,t,r)=>{"use strict";function n(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"k"):e.toString()}function a(e){return e>=1e3?"$".concat(e.toFixed(0)):"$".concat(e.toFixed(2))}function s(e){let t=Math.floor(e/1e3);if(t<60)return"".concat(t,"s");let r=Math.floor(t/60);if(r<60)return"".concat(r,"m");let n=Math.floor(r/60);return"".concat(n,"h ").concat(r%60,"m")}r.d(t,{F0:()=>a,c5:()=>s,yj:()=>n})},38250:(e,t,r)=>{"use strict";r.d(t,{SessionRow:()=>i});var n=r(95155),a=r(20063),s=r(20467);let o={Planning:"bg-tertiary-soft text-ink-dim border-ink-mute/30",Debugging:"bg-error/15 text-error border-error/30",Refactor:"bg-primary/10 text-primary border-primary/30",Feature:"bg-secondary/10 text-secondary border-secondary/30",Styling:"bg-fuchsia-400/10 text-fuchsia-300 border-fuchsia-400/30","SEO/Content":"bg-amber-400/10 text-amber-300 border-amber-400/30",DevOps:"bg-orange-400/10 text-orange-300 border-orange-400/30",Data:"bg-sky-400/10 text-sky-300 border-sky-400/30",Payments:"bg-emerald-400/10 text-emerald-300 border-emerald-400/30",Docs:"bg-violet-400/10 text-violet-300 border-violet-400/30",Unknown:"bg-surface-3 text-ink-mute border-surface-4"};function c(e){let{category:t,size:r="sm"}=e,a=o[t]||o.Unknown;return(0,n.jsx)("span",{className:"inline-block ".concat("xs"===r?"text-[9px] px-1 py-0":"text-[10px] px-1.5 py-0.5"," rounded font-mono uppercase tracking-wider border ").concat(a," shrink-0"),children:t})}function i(e){let{session:t,zebra:r}=e,o=(0,a.useRouter)(),i="/sessions/".concat(t.id),u=t.input_tokens+t.output_tokens+t.cache_read_tokens+t.cache_write_tokens,l=t.summary?t.summary.split("\n")[0].trim():t.heuristic_title?t.heuristic_title:t.first_prompt?function(e){let t=e.trim(),r=(t=(t=(t=(t=(t=(t=(t=t.replace(/<[^>]+>/g," ")).replace(/^\/[a-z][a-z0-9-]*(\s|$)/i,"")).replace(/```[a-z]*\n?/gi," ").replace(/```/g," ").replace(/`/g,"")).replace(/\[([^\]]+)\]\([^)]*\)/g,"$1")).replace(/https?:\/\/\S+/g,"")).replace(/(^|\s)(\/|~\/)[\w./~-]+/g," ")).replace(/\s+/g," ").trim()).search(/[.!?](\s|$)/);if(r>8&&r<90&&(t=t.slice(0,r).trim()),0===t.length)return"(untitled session)";if((t=t.charAt(0).toUpperCase()+t.slice(1)).length<=90)return t;let n=t.lastIndexOf(" ",90);return(n>50?t.slice(0,n):t.slice(0,90))+"…"}(t.first_prompt):"(untitled session)",d=function(e){if(e.categories)try{let t=JSON.parse(e.categories);if(Array.isArray(t))return t.filter(e=>"string"==typeof e)}catch(e){}return e.category?[e.category]:[]}(t);return(0,n.jsxs)("tr",{onClick:()=>o.push(i),onAuxClick:e=>{1===e.button&&window.open(i,"_blank")},onKeyDown:e=>{"Enter"===e.key&&o.push(i)},tabIndex:0,role:"link",className:"border-t border-surface-2 cursor-pointer transition-colors hover:bg-surface-2/60 focus:outline-none focus:bg-surface-2/70 ".concat(r?"bg-surface-1/30":""),children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-code-sm text-ink-mute",children:new Date(t.started_at).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)("span",{className:"inline-block px-1.5 py-0.5 rounded text-[10px] font-mono uppercase tracking-wider ".concat("claude"===t.provider?"bg-primary/15 text-primary":"bg-secondary/15 text-secondary"),children:t.provider})}),(0,n.jsx)("td",{className:"px-3 py-2 text-ink-dim",children:t.project_name}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-code-sm text-ink-mute truncate max-w-[180px]",children:t.model||"—"}),(0,n.jsx)("td",{className:"px-3 py-2 max-w-[420px]",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,n.jsx)("span",{className:"text-ink truncate",children:l}),d.map(e=>(0,n.jsx)(c,{category:e},e))]})}),(0,n.jsx)("td",{className:"px-3 py-2 text-right font-mono tabular",children:(0,s.yj)(u)}),(0,n.jsx)("td",{className:"px-3 py-2 text-right font-mono tabular text-secondary",children:(0,s.F0)(t.est_cost_usd)}),(0,n.jsx)("td",{className:"px-3 py-2 text-right font-mono tabular text-ink-mute",children:(0,s.c5)(t.duration_ms)})]})}},99884:(e,t,r)=>{Promise.resolve().then(r.bind(r,38250))}},e=>{e.O(0,[441,255,358],()=>e(e.s=99884)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{25511:(e,s,a)=>{"use strict";a.d(s,{v:()=>r});var t=a(30926);let r=(0,t.createServerReference)("40ebbe581be2d6a1560853a1f470f6bef259ff3ce0",t.callServer,void 0,t.findSourceMapURL,"classifyAction")},30926:(e,s,a)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),!function(e,s){for(var a in s)Object.defineProperty(e,a,{enumerable:!0,get:s[a]})}(s,{callServer:function(){return t.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return r.findSourceMapURL}});let t=a(41209),r=a(85153),n=a(77197)},66700:(e,s,a)=>{Promise.resolve().then(a.bind(a,68566))},68566:(e,s,a)=>{"use strict";a.d(s,{LlmSection:()=>x});var t=a(95155),r=a(12115),n=a(30926);let i=(0,n.createServerReference)("40acb06b98d922bbaa705775c5e053590069080d2e",n.callServer,void 0,n.findSourceMapURL,"saveLlmAction"),o=(0,n.createServerReference)("403820812a9461424d17b14bf3b24acd13354c2523",n.callServer,void 0,n.findSourceMapURL,"setAutoClassifyAction"),l=(0,n.createServerReference)("40d6068a0e90cc763358acc206b8d68d79340910e7",n.callServer,void 0,n.findSourceMapURL,"clearKeyAction"),c=(0,n.createServerReference)("404e24f64e5bf12ba9bd1bba81003a96aa21b8f8f0",n.callServer,void 0,n.findSourceMapURL,"estimateAction");var d=a(25511);let m=[{id:"claude-haiku-4-5",label:"Claude Haiku 4.5 (cheapest)",provider:"anthropic",input:1,output:5},{id:"claude-sonnet-4-6",label:"Claude Sonnet 4.6 (smarter)",provider:"anthropic",input:3,output:15},{id:"gpt-5-mini",label:"GPT-5 Mini (cheapest)",provider:"openai",input:.5,output:2},{id:"gpt-4o-mini",label:"GPT-4o Mini (very cheap)",provider:"openai",input:.15,output:.6},{id:"gpt-5",label:"GPT-5 (smarter)",provider:"openai",input:2.5,output:10}];function p(e){return m.filter(s=>s.provider===e)}function u(e){return"openai"===e?"gpt-5-mini":"claude-haiku-4-5"}let b=e=>e?e.slice(0,8)+"…"+e.slice(-4):"";function x(e){let{provider:s,anthKey:a,oaiKey:n,classifierModel:m,summarizerModel:x,classified:f,total:h,autoClassify:v}=e,[y,k]=(0,r.useState)(s),[j,N]=(0,r.useState)(m),[g,w]=(0,r.useState)(null),[S,C]=(0,r.useState)(v),[L,R]=(0,r.useState)({kind:"idle"}),[U,A]=(0,r.useTransition)(),M=("openai"===y?n:a).length>0,_=p(y),O=_.some(e=>e.id===j)?j:u(y),P=e=>{R({kind:"idle"}),A(async()=>{let s=await c(e);s.ok?R({kind:"estimate",totalUsd:s.totalUsd,rowCount:s.rowCount,modelLabel:s.modelLabel,scope:e}):R({kind:"error",message:s.error})})};return(0,t.jsxs)("div",{className:"card",children:[(0,t.jsxs)("div",{className:"card-header flex items-center justify-between",children:[(0,t.jsx)("span",{children:"LLM provider"}),(0,t.jsxs)("span",{className:"normal-case tracking-normal text-ink-mute text-[11px] font-mono",children:[f,"/",h," sessions classified"]})]}),(0,t.jsxs)("form",{action:e=>{A(async()=>{await i(e),w(Date.now()),setTimeout(()=>w(null),2e3)})},className:"p-5 space-y-4 text-body-md",children:[(0,t.jsxs)("p",{className:"text-ink-dim text-body-sm",children:["Optional. Used to auto-title and categorize sessions, and to generate context primers when you click ",(0,t.jsx)("em",{children:"Copy context"})," on a session. Skip this and titles stay as the raw first prompt."]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-label-caps text-ink-mute block",children:"Provider"}),(0,t.jsxs)("select",{name:"provider",value:y,onChange:e=>{var s;k(s=e.target.value),p(s).some(e=>e.id===j)||N(u(s))},className:"bg-surface-1 border border-surface-3 rounded px-2 h-9 text-body-md w-full",children:[(0,t.jsx)("option",{value:"anthropic",children:"Anthropic"}),(0,t.jsx)("option",{value:"openai",children:"OpenAI"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-label-caps text-ink-mute block",children:"Model"}),(0,t.jsx)("select",{name:"classifier_model",value:O,onChange:e=>N(e.target.value),className:"bg-surface-1 border border-surface-3 rounded px-2 h-9 text-body-md font-mono w-full",children:_.map(e=>(0,t.jsx)("option",{value:e.id,children:e.label},e.id))})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("label",{className:"text-label-caps text-ink-mute block flex items-center justify-between",children:["Anthropic key",a&&(0,t.jsx)("button",{type:"button",onClick:()=>A(()=>l("anthropic")),className:"normal-case tracking-normal text-[10px] text-ink-mute hover:text-error",children:"clear"})]}),(0,t.jsx)("input",{type:"password",name:"anthropic_key",placeholder:b(a)||"sk-ant-…",className:"bg-surface-1 border border-surface-3 rounded px-3 h-9 text-body-md font-mono w-full focus:outline-none focus:border-primary"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("label",{className:"text-label-caps text-ink-mute block flex items-center justify-between",children:["OpenAI key",n&&(0,t.jsx)("button",{type:"button",onClick:()=>A(()=>l("openai")),className:"normal-case tracking-normal text-[10px] text-ink-mute hover:text-error",children:"clear"})]}),(0,t.jsx)("input",{type:"password",name:"openai_key",placeholder:b(n)||"sk-…",className:"bg-surface-1 border border-surface-3 rounded px-3 h-9 text-body-md font-mono w-full focus:outline-none focus:border-primary"})]})]}),(0,t.jsxs)("p",{className:"text-[11px] text-ink-mute leading-relaxed",children:["Keys are stored in plaintext in your local SQLite file — same threat model as"," ",(0,t.jsx)("span",{className:"font-mono",children:"~/.aws/credentials"})," or a ",(0,t.jsx)("span",{className:"font-mono",children:".env"}),". Never sent over the network. Any process that can read your home folder can read them."]}),(0,t.jsx)("input",{type:"hidden",name:"summarizer_model",value:x}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{className:"btn btn-primary",type:"submit",disabled:U,children:U?"Saving…":"Save"}),g&&(0,t.jsx)("span",{className:"text-body-sm text-secondary",children:"✓ saved"})]})]}),(0,t.jsxs)("div",{className:"px-5 pb-5 border-t border-surface-2 pt-4 space-y-3",children:[(0,t.jsxs)("label",{className:"flex items-start gap-3 text-body-sm ".concat(M?"cursor-pointer":"opacity-60 cursor-not-allowed"),children:[(0,t.jsx)("input",{type:"checkbox",checked:S,onChange:e=>{var s;C(s=e.target.checked),A(async()=>{await o(s)})},disabled:!M||U,className:"mt-1 accent-primary"}),(0,t.jsxs)("span",{className:"text-ink-dim",children:[(0,t.jsx)("span",{className:"text-ink font-medium",children:"Automatically classify new sessions"}),(0,t.jsx)("span",{className:"block text-ink-mute text-[11px] mt-0.5",children:"When a background scan finds unclassified sessions, batch them through the classifier. Costs ~$0.0001 per session."})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("button",{type:"button",disabled:!M||U,onClick:()=>P("uncategorized"),className:"btn disabled:opacity-50 disabled:cursor-not-allowed",children:"Classify uncategorized"}),(0,t.jsx)("button",{type:"button",disabled:!M||U,onClick:()=>P("all"),className:"btn disabled:opacity-50 disabled:cursor-not-allowed",children:"Re-classify all"}),!M&&(0,t.jsx)("span",{className:"text-body-sm text-ink-mute",children:"Save a key above to enable."})]}),"estimate"===L.kind&&(0,t.jsxs)("div",{className:"border border-primary/40 bg-primary/5 rounded p-3 text-body-sm",children:[(0,t.jsx)("div",{className:"text-ink mb-2",children:0===L.rowCount?"Nothing to classify.":(0,t.jsxs)(t.Fragment,{children:["About to classify ",(0,t.jsx)("span",{className:"font-mono text-primary",children:L.rowCount})," ","sessions with ",L.modelLabel," for an estimated"," ",(0,t.jsxs)("span",{className:"font-mono text-primary",children:["$",L.totalUsd.toFixed(4)]}),"."]})}),L.rowCount>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{var e;return e=L.scope,void A(async()=>{let s=await (0,d.v)(e);s.ok?R({kind:"done",classified:s.classified,costUsd:s.costUsd,warning:s.warning}):R({kind:"error",message:s.error})})},className:"btn btn-primary",disabled:U,children:U?"Classifying…":"Confirm"}),(0,t.jsx)("button",{type:"button",onClick:()=>R({kind:"idle"}),className:"btn",disabled:U,children:"Cancel"})]})]}),"done"===L.kind&&(0,t.jsxs)("div",{className:"border border-secondary/40 bg-secondary/5 rounded p-3 text-body-sm text-ink space-y-1",children:[(0,t.jsxs)("div",{children:["✓ Classified ",(0,t.jsx)("span",{className:"font-mono text-secondary",children:L.classified})," ","sessions for ",(0,t.jsxs)("span",{className:"font-mono",children:["$",L.costUsd.toFixed(4)]}),"."]}),L.warning&&(0,t.jsxs)("div",{className:"text-error text-[11px] border-l-2 border-error pl-2 font-mono break-words",children:["Warning: ",L.warning]})]}),"error"===L.kind&&(0,t.jsx)("div",{className:"text-body-sm text-error border-l-2 border-error pl-3",children:L.message})]})]})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=66700)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[404,893],{8724:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,52619,23))}},e=>{e.O(0,[619,441,255,358],()=>e(e.s=8724)),_N_E=e.O()}]);