agentgraphed 0.3.1 → 0.3.3

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 (67) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +26 -26
  3. package/.next/standalone/.next/app-path-routes-manifest.json +6 -6
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/prerender-manifest.json +3 -3
  6. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  8. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  9. package/.next/standalone/.next/server/app/analytics/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/api/ingest-local/route_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/api/quota-probe/route_client-reference-manifest.js +1 -1
  12. package/.next/standalone/.next/server/app/api/share/dashboard/route_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/api/share/project/[id]/route_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/api/share/session/[id]/route_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/page.js +3 -3
  16. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/projects/[id]/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/sessions/[id]/page.js +3 -3
  20. package/.next/standalone/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/settings/page.js +3 -3
  23. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/timeline/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app-paths-manifest.json +6 -6
  26. package/.next/standalone/.next/server/functions-config-manifest.json +2 -2
  27. package/.next/standalone/.next/server/pages/404.html +1 -1
  28. package/.next/standalone/.next/server/pages/500.html +1 -1
  29. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  31. package/.next/standalone/.next/static/chunks/app/page-c48deeb5e00abe37.js +1 -0
  32. package/.next/standalone/.next/static/chunks/app/sessions/[id]/page-67a6219eb293120e.js +1 -0
  33. package/.next/standalone/.next/static/chunks/app/settings/page-14247a62a25a93c7.js +1 -0
  34. package/.next/standalone/package.json +1 -1
  35. package/.next/standalone/src/lib/pricing-data/litellm.meta.json +1 -1
  36. package/.next/static/chunks/app/page-c48deeb5e00abe37.js +1 -0
  37. package/.next/static/chunks/app/sessions/[id]/page-67a6219eb293120e.js +1 -0
  38. package/.next/static/chunks/app/settings/page-14247a62a25a93c7.js +1 -0
  39. package/CHANGELOG.md +10 -0
  40. package/README.md +4 -0
  41. package/package.json +1 -1
  42. package/src/lib/pricing-data/litellm.meta.json +1 -1
  43. package/.next/standalone/.next/static/chunks/app/page-a3c60158eb6e8a4c.js +0 -1
  44. package/.next/standalone/.next/static/chunks/app/sessions/[id]/page-bd098facac562ae1.js +0 -1
  45. package/.next/standalone/.next/static/chunks/app/settings/page-655af37dd2ec318b.js +0 -1
  46. package/.next/standalone/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  47. package/.next/standalone/node_modules/better-sqlite3/lib/database.js +0 -90
  48. package/.next/standalone/node_modules/better-sqlite3/lib/index.js +0 -3
  49. package/.next/standalone/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
  50. package/.next/standalone/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
  51. package/.next/standalone/node_modules/better-sqlite3/lib/methods/function.js +0 -31
  52. package/.next/standalone/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
  53. package/.next/standalone/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
  54. package/.next/standalone/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
  55. package/.next/standalone/node_modules/better-sqlite3/lib/methods/table.js +0 -189
  56. package/.next/standalone/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
  57. package/.next/standalone/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
  58. package/.next/standalone/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
  59. package/.next/standalone/node_modules/better-sqlite3/lib/util.js +0 -12
  60. package/.next/standalone/node_modules/better-sqlite3/package.json +0 -54
  61. package/.next/static/chunks/app/page-a3c60158eb6e8a4c.js +0 -1
  62. package/.next/static/chunks/app/sessions/[id]/page-bd098facac562ae1.js +0 -1
  63. package/.next/static/chunks/app/settings/page-655af37dd2ec318b.js +0 -1
  64. /package/.next/standalone/.next/static/{sgmNXxdNgpIfrW53A0qbg → M8f0qGBcpu_1RY2qRa9uE}/_buildManifest.js +0 -0
  65. /package/.next/standalone/.next/static/{sgmNXxdNgpIfrW53A0qbg → M8f0qGBcpu_1RY2qRa9uE}/_ssgManifest.js +0 -0
  66. /package/.next/static/{sgmNXxdNgpIfrW53A0qbg → M8f0qGBcpu_1RY2qRa9uE}/_buildManifest.js +0 -0
  67. /package/.next/static/{sgmNXxdNgpIfrW53A0qbg → M8f0qGBcpu_1RY2qRa9uE}/_ssgManifest.js +0 -0
@@ -1,67 +0,0 @@
1
- 'use strict';
2
- const fs = require('fs');
3
- const path = require('path');
4
- const { promisify } = require('util');
5
- const { cppdb } = require('../util');
6
- const fsAccess = promisify(fs.access);
7
-
8
- module.exports = async function backup(filename, options) {
9
- if (options == null) options = {};
10
-
11
- // Validate arguments
12
- if (typeof filename !== 'string') throw new TypeError('Expected first argument to be a string');
13
- if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');
14
-
15
- // Interpret options
16
- filename = filename.trim();
17
- const attachedName = 'attached' in options ? options.attached : 'main';
18
- const handler = 'progress' in options ? options.progress : null;
19
-
20
- // Validate interpreted options
21
- if (!filename) throw new TypeError('Backup filename cannot be an empty string');
22
- if (filename === ':memory:') throw new TypeError('Invalid backup filename ":memory:"');
23
- if (typeof attachedName !== 'string') throw new TypeError('Expected the "attached" option to be a string');
24
- if (!attachedName) throw new TypeError('The "attached" option cannot be an empty string');
25
- if (handler != null && typeof handler !== 'function') throw new TypeError('Expected the "progress" option to be a function');
26
-
27
- // Make sure the specified directory exists
28
- await fsAccess(path.dirname(filename)).catch(() => {
29
- throw new TypeError('Cannot save backup because the directory does not exist');
30
- });
31
-
32
- const isNewFile = await fsAccess(filename).then(() => false, () => true);
33
- return runBackup(this[cppdb].backup(this, attachedName, filename, isNewFile), handler || null);
34
- };
35
-
36
- const runBackup = (backup, handler) => {
37
- let rate = 0;
38
- let useDefault = true;
39
-
40
- return new Promise((resolve, reject) => {
41
- setImmediate(function step() {
42
- try {
43
- const progress = backup.transfer(rate);
44
- if (!progress.remainingPages) {
45
- backup.close();
46
- resolve(progress);
47
- return;
48
- }
49
- if (useDefault) {
50
- useDefault = false;
51
- rate = 100;
52
- }
53
- if (handler) {
54
- const ret = handler(progress);
55
- if (ret !== undefined) {
56
- if (typeof ret === 'number' && ret === ret) rate = Math.max(0, Math.min(0x7fffffff, Math.round(ret)));
57
- else throw new TypeError('Expected progress callback to return a number or undefined');
58
- }
59
- }
60
- setImmediate(step);
61
- } catch (err) {
62
- backup.close();
63
- reject(err);
64
- }
65
- });
66
- });
67
- };
@@ -1,31 +0,0 @@
1
- 'use strict';
2
- const { getBooleanOption, cppdb } = require('../util');
3
-
4
- module.exports = function defineFunction(name, options, fn) {
5
- // Apply defaults
6
- if (options == null) options = {};
7
- if (typeof options === 'function') { fn = options; options = {}; }
8
-
9
- // Validate arguments
10
- if (typeof name !== 'string') throw new TypeError('Expected first argument to be a string');
11
- if (typeof fn !== 'function') throw new TypeError('Expected last argument to be a function');
12
- if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');
13
- if (!name) throw new TypeError('User-defined function name cannot be an empty string');
14
-
15
- // Interpret options
16
- const safeIntegers = 'safeIntegers' in options ? +getBooleanOption(options, 'safeIntegers') : 2;
17
- const deterministic = getBooleanOption(options, 'deterministic');
18
- const directOnly = getBooleanOption(options, 'directOnly');
19
- const varargs = getBooleanOption(options, 'varargs');
20
- let argCount = -1;
21
-
22
- // Determine argument count
23
- if (!varargs) {
24
- argCount = fn.length;
25
- if (!Number.isInteger(argCount) || argCount < 0) throw new TypeError('Expected function.length to be a positive integer');
26
- if (argCount > 100) throw new RangeError('User-defined functions cannot have more than 100 arguments');
27
- }
28
-
29
- this[cppdb].function(fn, name, argCount, safeIntegers, deterministic, directOnly);
30
- return this;
31
- };
@@ -1,7 +0,0 @@
1
- 'use strict';
2
- const DatabaseInspection = function Database() {};
3
-
4
- module.exports = function inspect(depth, opts) {
5
- return Object.assign(new DatabaseInspection(), this);
6
- };
7
-
@@ -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],{15433:(e,t,r)=>{"use strict";r.d(t,{ClassifyChip:()=>a});var n=r(95155),o=r(12115),s=r(20063),i=r(96674);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})},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.max(0,Math.floor(.1*r.length)-1)],1)>50}(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)}},40250:(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))},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),[v,g]=(0,s.useState)(null),b=(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=b.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:b,onClick:()=>{if(!m&&b.current){let e=b.current.getBoundingClientRect();g({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&&v&&(0,i.createPortal)((0,n.jsxs)("div",{id:"project-filter-pop",style:{position:"fixed",top:v.top,left:v.left,minWidth:v.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),v=(0,s.useRef)(null);(0,s.useEffect)(()=>x(!0),[]);let g=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=v.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:v,onClick:()=>{if(!d&&v.current){let e=v.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:()=>g(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:()=>g(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))})}},96674:(e,t,r)=>{"use strict";r.d(t,{v:()=>o});var n=r(30926);let o=(0,n.createServerReference)("4086085619f2eb1832f13de02c11c03744ae709f78",n.callServer,void 0,n.findSourceMapURL,"classifyAction")}},e=>{e.O(0,[619,997,441,255,358],()=>e(e.s=40250)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[824],{17834:(e,t,n)=>{"use strict";n.d(t,{ShareButton:()=>o});var r=n(95155),i=n(12115);function o(e){let{imageUrl:t,className:n}=e,[o,l]=(0,i.useState)("idle"),[d,u]=(0,i.useState)(null),h=async()=>{l("busy"),u(null);try{var e;let n=await fetch(t);if(!n.ok)throw Error("HTTP ".concat(n.status));let r=await n.blob();if("undefined"==typeof ClipboardItem||!(null==(e=navigator.clipboard)?void 0:e.write))throw Error("clipboard image unsupported");let i=new ClipboardItem({"image/png":r});await navigator.clipboard.write([i]),l("done"),setTimeout(()=>l("idle"),2400)}catch(e){try{let e=await fetch(t),n=await e.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download="agentgraphed-stats.png",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>URL.revokeObjectURL(r),5e3),u("Saved to Downloads (clipboard image unsupported)"),l("err"),setTimeout(()=>l("idle"),4e3)}catch(t){u(t.message||e.message),l("err"),setTimeout(()=>l("idle"),3e3)}}};return(0,r.jsx)("button",{onClick:h,disabled:"busy"===o,"aria-label":"Share",title:"busy"===o?"Generating image…":"done"===o?"Image copied to clipboard":"err"===o?null!=d?d:"Try again":"Copy share image to clipboard",className:"btn-icon ".concat("done"===o?"text-secondary":""," ").concat(null!=n?n:""),children:"busy"===o?(0,r.jsx)(c,{}):"done"===o?(0,r.jsx)(s,{}):(0,r.jsx)(a,{})})}function a(){return(0,r.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),(0,r.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,r.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function s(){return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"20 6 9 17 4 12"})})}function c(){return(0,r.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,r.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}},30926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{callServer:function(){return r.callServer},createServerReference:function(){return o.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}});let r=n(41209),i=n(85153),o=n(77197)},40040:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,52619,23)),Promise.resolve().then(n.bind(n,44782)),Promise.resolve().then(n.bind(n,42158)),Promise.resolve().then(n.bind(n,17834))},42158:(e,t,n)=>{"use strict";n.d(t,{SessionActions:()=>l});var r=n(95155),i=n(12115),o=n(52619),a=n.n(o),s=n(30926);let c=(0,s.createServerReference)("4020868856f89c0984ab10caafdcdbed52da540a68",s.callServer,void 0,s.findSourceMapURL,"generateContextAction");function l(e){let{sessionId:t,hasLlmKey:n,cachedContext:o}=e,[s,l]=(0,i.useState)(o),[d,u]=(0,i.useState)(!1),[h,x]=(0,i.useState)(null),[m,p]=(0,i.useState)(null),[f,b]=(0,i.useTransition)();return(0,r.jsxs)("div",{className:"flex items-center gap-2 relative",children:[(0,r.jsx)("button",{onClick:()=>{x(null),b(async()=>{if(s){await navigator.clipboard.writeText(s),u(!0),setTimeout(()=>u(!1),1800);return}let e=await c(t);if(!e.ok)return void x(e.error);l(e.context),p(e.costUsd),await navigator.clipboard.writeText(e.context),u(!0),setTimeout(()=>u(!1),1800)})},disabled:!n||f,title:n?"Summarize this session so you can paste it into a fresh chat":"Add an API key in Settings to enable",className:"btn ".concat(n?"btn-primary":""," disabled:opacity-50 disabled:cursor-not-allowed"),children:f?"… summarizing":d?"✓ Copied":s?"Copy summary":"Summarize for new chat"}),(h||null!==m&&m>0||!n)&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 text-[11px] text-ink-mute flex items-center gap-2 whitespace-nowrap",children:[h&&(0,r.jsx)("span",{className:"text-error",children:h}),null!==m&&m>0&&(0,r.jsxs)("span",{className:"font-mono",children:["cost $",m.toFixed(4)]}),!n&&(0,r.jsxs)("span",{children:["summary needs ",(0,r.jsx)(a(),{href:"/settings",className:"text-primary hover:underline",children:"an API key"})]})]})]})}},44782:(e,t,n)=>{"use strict";n.d(t,{ResumePanel:()=>o});var r=n(95155),i=n(12115);function o(e){let{provider:t,cwd:n,sessionId:o}=e,[c,l]=(0,i.useState)(!1),d=function(e,t,n){let r='cd "'.concat(t,'"');return"claude"===e?"".concat(r," && claude --resume ").concat(n):"codex"===e?"".concat(r," && codex resume ").concat(n):r}(t,n,o),u=async()=>{await navigator.clipboard.writeText(d),l(!0),setTimeout(()=>l(!1),2e3)};return(0,r.jsxs)("div",{className:"card",children:[(0,r.jsxs)("div",{className:"card-header flex items-center justify-between",children:[(0,r.jsx)("span",{children:"Resume in your terminal"}),(0,r.jsxs)("span",{className:"normal-case tracking-normal font-normal text-ink-mute text-[11px]",children:["paste into ","claude"===t?"Claude Code":"codex"===t?"Codex CLI":t]})]}),(0,r.jsxs)("div",{className:"p-3 flex items-stretch gap-2",children:[(0,r.jsx)("code",{className:"flex-1 bg-canvas border border-surface-3 rounded px-3 py-2 font-mono text-code-sm text-ink-dim overflow-x-auto whitespace-nowrap leading-relaxed",title:d,children:d}),(0,r.jsx)("button",{onClick:u,className:"btn ".concat(c?"text-secondary":""," flex-shrink-0"),title:"Copy command to clipboard",children:c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s,{}),(0,r.jsx)("span",{children:"Copied"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a,{}),(0,r.jsx)("span",{children:"Copy"})]})})]})]})}function a(){return(0,r.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function s(){return(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"20 6 9 17 4 12"})})}}},e=>{e.O(0,[619,441,255,358],()=>e(e.s=40040)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{11957:(e,s,a)=>{"use strict";a.d(s,{LlmSection:()=>b});var t=a(95155),r=a(12115),n=a(30926);let i=(0,n.createServerReference)("40ef48e61358f0dcac4e4e14d67c2b519e4d7d0d5d",n.callServer,void 0,n.findSourceMapURL,"saveLlmAction"),o=(0,n.createServerReference)("40b08008dfa140fd4de90f9fc68735e9365a5b0af4",n.callServer,void 0,n.findSourceMapURL,"setAutoClassifyAction"),l=(0,n.createServerReference)("40d14b4547c8964e38fc79fc8a73a1cc677e6a0bd8",n.callServer,void 0,n.findSourceMapURL,"clearKeyAction"),c=(0,n.createServerReference)("4006197c7f39df910cea8635c5c22d0f12c7c42f35",n.callServer,void 0,n.findSourceMapURL,"estimateAction");var d=a(96674);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 x=e=>e?e.slice(0,8)+"…"+e.slice(-4):"";function b(e){let{provider:s,anthKey:a,oaiKey:n,classifierModel:m,summarizerModel:b,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:x(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:x(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:b}),(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})]})]})}},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)},66821:(e,s,a)=>{Promise.resolve().then(a.bind(a,11957))},96674:(e,s,a)=>{"use strict";a.d(s,{v:()=>r});var t=a(30926);let r=(0,t.createServerReference)("4086085619f2eb1832f13de02c11c03744ae709f78",t.callServer,void 0,t.findSourceMapURL,"classifyAction")}},e=>{e.O(0,[441,255,358],()=>e(e.s=66821)),_N_E=e.O()}]);