heyiam 0.2.23 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/llm/index.js +6 -15
- package/dist/mount.js +8 -1
- package/dist/public/assets/index-DDYlBh0H.js +21 -0
- package/dist/public/index.html +1 -1
- package/dist/render/liquid.js +1 -1
- package/dist/render/templates/project.liquid +5 -1
- package/dist/routes/settings.js +3 -3
- package/package.json +1 -1
- package/dist/llm/proxy-provider.js +0 -59
- package/dist/public/assets/index-B_d6DlEI.js +0 -21
package/dist/public/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>app</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DDYlBh0H.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-Dalqz2mC.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/dist/render/liquid.js
CHANGED
|
@@ -80,7 +80,7 @@ export function renderProject(data, extras) {
|
|
|
80
80
|
// Use full session data when available (charts need complete Session objects).
|
|
81
81
|
// Strip rawLog and turnTimeline — huge, unused by charts, and could break HTML attributes.
|
|
82
82
|
const chartSessions = (extras?.fullSessions ?? allSessions.map((s) => ({
|
|
83
|
-
id: s.token, title: s.title, date: s.recordedAt,
|
|
83
|
+
id: s.token, slug: s.slug, title: s.title, date: s.recordedAt,
|
|
84
84
|
durationMinutes: s.durationMinutes, turns: s.turns,
|
|
85
85
|
linesOfCode: s.locChanged, status: 'enhanced',
|
|
86
86
|
projectName: data.project.title, rawLog: [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="heyiam-project" data-render-version="2"{% if sessionBaseUrl %} data-session-base-url="{{ sessionBaseUrl }}"{% endif %}>
|
|
1
|
+
<div class="heyiam-project" data-render-version="2"{% if sessionBaseUrl %} data-session-base-url="{{ sessionBaseUrl }}"{% endif %} data-username="{{ user.username }}" data-project-slug="{{ project.slug }}">
|
|
2
2
|
|
|
3
3
|
{%- comment -%} Title {%- endcomment -%}
|
|
4
4
|
<h1 class="project-title">{{ project.title }}</h1>
|
|
@@ -219,7 +219,11 @@
|
|
|
219
219
|
|
|
220
220
|
{%- comment -%} Footer {%- endcomment -%}
|
|
221
221
|
<div class="export-footer">
|
|
222
|
+
{% if sessionBaseUrl %}
|
|
222
223
|
<span class="export-footer__text">exported from heyi.am</span>
|
|
224
|
+
{% else %}
|
|
225
|
+
<span class="export-footer__text">built with <a href="https://heyiam.com" target="_blank" rel="noopener noreferrer">heyiam.com</a></span>
|
|
226
|
+
{% endif %}
|
|
223
227
|
</div>
|
|
224
228
|
|
|
225
229
|
</div>
|
package/dist/routes/settings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
2
|
import { saveAnthropicApiKey, clearAnthropicApiKey, getAnthropicApiKey } from '../settings.js';
|
|
3
|
-
import {
|
|
3
|
+
import { hasApiKey } from '../llm/index.js';
|
|
4
4
|
export function createSettingsRouter(_ctx) {
|
|
5
5
|
const router = Router();
|
|
6
6
|
// Save or clear the Anthropic API key
|
|
@@ -9,12 +9,12 @@ export function createSettingsRouter(_ctx) {
|
|
|
9
9
|
if (apiKey && typeof apiKey === 'string' && apiKey.trim()) {
|
|
10
10
|
saveAnthropicApiKey(apiKey.trim());
|
|
11
11
|
console.log('[settings] API key saved');
|
|
12
|
-
res.json({ ok: true,
|
|
12
|
+
res.json({ ok: true, hasKey: hasApiKey() });
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
15
|
clearAnthropicApiKey();
|
|
16
16
|
console.log('[settings] API key cleared');
|
|
17
|
-
res.json({ ok: true,
|
|
17
|
+
res.json({ ok: true, hasKey: hasApiKey() });
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
// Get current API key status (masked)
|
package/package.json
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { getAuthToken } from '../auth.js';
|
|
2
|
-
import { API_URL } from '../config.js';
|
|
3
|
-
/**
|
|
4
|
-
* Proxy provider — sends session data to Phoenix backend for server-side enhancement.
|
|
5
|
-
* Used when user has no local ANTHROPIC_API_KEY but is authenticated.
|
|
6
|
-
*/
|
|
7
|
-
export class ProxyProvider {
|
|
8
|
-
name = 'proxy';
|
|
9
|
-
async enhance(session) {
|
|
10
|
-
const auth = getAuthToken();
|
|
11
|
-
if (!auth?.token) {
|
|
12
|
-
throw new ProxyError('AUTH_EXPIRED', 'Not authenticated. Run: heyiam login');
|
|
13
|
-
}
|
|
14
|
-
const response = await fetch(`${API_URL}/api/enhance`, {
|
|
15
|
-
method: 'POST',
|
|
16
|
-
headers: {
|
|
17
|
-
'Content-Type': 'application/json',
|
|
18
|
-
'Authorization': `Bearer ${auth.token}`,
|
|
19
|
-
},
|
|
20
|
-
body: JSON.stringify({ session: sessionToPayload(session) }),
|
|
21
|
-
});
|
|
22
|
-
if (!response.ok) {
|
|
23
|
-
const errorBody = await response.json().catch(() => ({
|
|
24
|
-
error: { code: 'PROXY_UNREACHABLE', message: 'Could not reach enhancement server' },
|
|
25
|
-
}));
|
|
26
|
-
throw new ProxyError(errorBody.error?.code ?? 'PROXY_ERROR', errorBody.error?.message ?? 'Enhancement failed', errorBody.error?.resets_at);
|
|
27
|
-
}
|
|
28
|
-
const data = await response.json();
|
|
29
|
-
return data.result;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export class ProxyError extends Error {
|
|
33
|
-
code;
|
|
34
|
-
resetsAt;
|
|
35
|
-
constructor(code, message, resetsAt) {
|
|
36
|
-
super(message);
|
|
37
|
-
this.name = 'ProxyError';
|
|
38
|
-
this.code = code;
|
|
39
|
-
this.resetsAt = resetsAt;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Extracts the session fields that Phoenix expects for enhancement.
|
|
44
|
-
*/
|
|
45
|
-
function sessionToPayload(session) {
|
|
46
|
-
return {
|
|
47
|
-
title: session.title,
|
|
48
|
-
projectName: session.projectName,
|
|
49
|
-
durationMinutes: session.durationMinutes,
|
|
50
|
-
turns: session.turns,
|
|
51
|
-
linesOfCode: session.linesOfCode,
|
|
52
|
-
skills: session.skills,
|
|
53
|
-
toolBreakdown: session.toolBreakdown,
|
|
54
|
-
filesChanged: session.filesChanged,
|
|
55
|
-
executionPath: session.executionPath,
|
|
56
|
-
turnTimeline: session.turnTimeline,
|
|
57
|
-
rawLog: session.rawLog,
|
|
58
|
-
};
|
|
59
|
-
}
|