heyiam 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.
- package/dist/auth.js +29 -3
- package/dist/db.js +1 -1
- package/dist/export.js +84 -2
- package/dist/github.js +381 -0
- package/dist/parsers/index.js +22 -3
- package/dist/public/assets/index-Coilyhtr.css +1 -0
- package/dist/public/assets/index-D0noVMFu.js +44 -0
- package/dist/public/index.html +2 -2
- package/dist/render/templates/aurora/portfolio.liquid +10 -22
- package/dist/render/templates/aurora/project.liquid +1 -1
- package/dist/render/templates/aurora/styles.css +6 -0
- package/dist/render/templates/bauhaus/portfolio.liquid +9 -19
- package/dist/render/templates/bauhaus/styles.css +4 -0
- package/dist/render/templates/blueprint/portfolio.liquid +10 -24
- package/dist/render/templates/blueprint/styles.css +4 -0
- package/dist/render/templates/canvas/portfolio.liquid +17 -29
- package/dist/render/templates/canvas/styles.css +4 -0
- package/dist/render/templates/carbon/portfolio.liquid +9 -19
- package/dist/render/templates/carbon/styles.css +6 -0
- package/dist/render/templates/chalk/portfolio.liquid +9 -19
- package/dist/render/templates/chalk/styles.css +4 -0
- package/dist/render/templates/circuit/portfolio.liquid +10 -20
- package/dist/render/templates/circuit/project.liquid +1 -1
- package/dist/render/templates/circuit/styles.css +6 -0
- package/dist/render/templates/cosmos/portfolio.liquid +10 -20
- package/dist/render/templates/cosmos/project.liquid +1 -1
- package/dist/render/templates/cosmos/styles.css +6 -0
- package/dist/render/templates/daylight/portfolio.liquid +10 -20
- package/dist/render/templates/daylight/project.liquid +1 -1
- package/dist/render/templates/daylight/styles.css +4 -0
- package/dist/render/templates/editorial/portfolio.liquid +11 -27
- package/dist/render/templates/editorial/styles.css +4 -0
- package/dist/render/templates/ember/portfolio.liquid +11 -23
- package/dist/render/templates/ember/project.liquid +1 -1
- package/dist/render/templates/ember/styles.css +6 -0
- package/dist/render/templates/glacier/portfolio.liquid +10 -20
- package/dist/render/templates/glacier/project.liquid +1 -1
- package/dist/render/templates/glacier/styles.css +4 -0
- package/dist/render/templates/grid/portfolio.liquid +9 -19
- package/dist/render/templates/grid/styles.css +4 -0
- package/dist/render/templates/kinetic/portfolio.liquid +10 -22
- package/dist/render/templates/kinetic/project.liquid +1 -1
- package/dist/render/templates/kinetic/styles.css +4 -0
- package/dist/render/templates/meridian/portfolio.liquid +11 -23
- package/dist/render/templates/meridian/styles.css +6 -0
- package/dist/render/templates/minimal/portfolio.liquid +10 -10
- package/dist/render/templates/minimal/styles.css +4 -0
- package/dist/render/templates/mono/portfolio.liquid +9 -19
- package/dist/render/templates/mono/styles.css +6 -0
- package/dist/render/templates/neon/portfolio.liquid +10 -20
- package/dist/render/templates/neon/project.liquid +1 -1
- package/dist/render/templates/neon/styles.css +6 -0
- package/dist/render/templates/noir/portfolio.liquid +5 -5
- package/dist/render/templates/noir/styles.css +6 -0
- package/dist/render/templates/obsidian/portfolio.liquid +9 -19
- package/dist/render/templates/obsidian/styles.css +6 -0
- package/dist/render/templates/paper/portfolio.liquid +9 -19
- package/dist/render/templates/paper/styles.css +4 -0
- package/dist/render/templates/parallax/portfolio.liquid +9 -19
- package/dist/render/templates/parallax/styles.css +6 -0
- package/dist/render/templates/parchment/portfolio.liquid +9 -19
- package/dist/render/templates/parchment/styles.css +4 -0
- package/dist/render/templates/radar/portfolio.liquid +9 -19
- package/dist/render/templates/radar/styles.css +6 -0
- package/dist/render/templates/showcase/portfolio.liquid +9 -19
- package/dist/render/templates/showcase/styles.css +5 -0
- package/dist/render/templates/signal/portfolio.liquid +9 -19
- package/dist/render/templates/signal/styles.css +6 -0
- package/dist/render/templates/strata/portfolio.liquid +10 -22
- package/dist/render/templates/strata/styles.css +4 -0
- package/dist/render/templates/terminal/portfolio.liquid +10 -26
- package/dist/render/templates/terminal/styles.css +5 -0
- package/dist/render/templates/verdant/portfolio.liquid +11 -23
- package/dist/render/templates/verdant/project.liquid +1 -1
- package/dist/render/templates/verdant/styles.css +4 -0
- package/dist/render/templates/zen/portfolio.liquid +10 -22
- package/dist/render/templates/zen/styles.css +4 -0
- package/dist/routes/auth.js +7 -3
- package/dist/routes/context.js +2 -0
- package/dist/routes/delete.js +195 -0
- package/dist/routes/enhance.js +40 -0
- package/dist/routes/github.js +254 -0
- package/dist/routes/index.js +2 -0
- package/dist/routes/portfolio-render-data.js +160 -0
- package/dist/routes/preview.js +85 -10
- package/dist/routes/projects.js +50 -5
- package/dist/routes/publish.js +306 -15
- package/dist/routes/settings.js +102 -2
- package/dist/search.js +6 -0
- package/dist/server.js +3 -1
- package/dist/settings.js +95 -0
- package/package.json +2 -1
- package/dist/public/assets/index-BZ65TU_Y.js +0 -40
- package/dist/public/assets/index-CqCaW2cb.css +0 -1
package/dist/settings.js
CHANGED
|
@@ -55,6 +55,34 @@ export function resetOnboarding(configDir) {
|
|
|
55
55
|
delete settings.onboardingCompletedAt;
|
|
56
56
|
writeConfig(SETTINGS_FILE, settings, configDir);
|
|
57
57
|
}
|
|
58
|
+
// ── Per-session transcript visibility ────────────────────────
|
|
59
|
+
/**
|
|
60
|
+
* Return whether the session transcript should be included at publish time.
|
|
61
|
+
* Default is `true` — users must opt out explicitly.
|
|
62
|
+
*/
|
|
63
|
+
export function isTranscriptIncluded(sessionId, configDir) {
|
|
64
|
+
const map = getSettings(configDir).transcriptIncluded ?? {};
|
|
65
|
+
const flag = map[sessionId];
|
|
66
|
+
return flag !== false;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Set the include-transcript flag for a single session. Persisted to the
|
|
70
|
+
* settings file alongside other user preferences.
|
|
71
|
+
*/
|
|
72
|
+
export function setTranscriptIncluded(sessionId, included, configDir) {
|
|
73
|
+
const settings = getSettings(configDir);
|
|
74
|
+
const map = { ...(settings.transcriptIncluded ?? {}) };
|
|
75
|
+
if (included) {
|
|
76
|
+
// Default is `true`, so a `true` value is the same as absent — keep
|
|
77
|
+
// the map clean by deleting rather than writing redundant entries.
|
|
78
|
+
delete map[sessionId];
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
map[sessionId] = false;
|
|
82
|
+
}
|
|
83
|
+
settings.transcriptIncluded = map;
|
|
84
|
+
writeConfig(SETTINGS_FILE, settings, configDir);
|
|
85
|
+
}
|
|
58
86
|
// ── Portfolio profile ────────────────────────────────────────
|
|
59
87
|
export function getPortfolioProfile(configDir) {
|
|
60
88
|
return getSettings(configDir).portfolio ?? {};
|
|
@@ -196,3 +224,70 @@ export function getUploadedState(projectDirName, configDir) {
|
|
|
196
224
|
return null;
|
|
197
225
|
}
|
|
198
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Remove the local uploaded-state record for a project. Used when the
|
|
229
|
+
* remote copy is deleted from heyi.am — clears the "Uploaded" badge and
|
|
230
|
+
* per-session `uploaded: true` flags so the UI reflects reality without
|
|
231
|
+
* requiring a new publish round-trip.
|
|
232
|
+
*/
|
|
233
|
+
export function clearUploadedState(projectDirName, configDir) {
|
|
234
|
+
const path = uploadedPath(projectDirName, configDir);
|
|
235
|
+
if (existsSync(path))
|
|
236
|
+
unlinkSync(path);
|
|
237
|
+
}
|
|
238
|
+
const PORTFOLIO_PUBLISH_FILE = 'portfolio-publish.json';
|
|
239
|
+
const DEFAULT_PORTFOLIO_TARGET = 'heyi.am';
|
|
240
|
+
function portfolioPublishPath(configDir = getDataDir()) {
|
|
241
|
+
return join(configDir, PORTFOLIO_PUBLISH_FILE);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Compute a stable hash of a portfolio profile snapshot. Keys are sorted
|
|
245
|
+
* recursively so logically-equal profiles always produce the same hash.
|
|
246
|
+
* Used for draft detection — no cryptographic guarantees required.
|
|
247
|
+
*/
|
|
248
|
+
export function hashPortfolioProfile(profile) {
|
|
249
|
+
const canonical = canonicalStringify(profile);
|
|
250
|
+
return createHash('sha256').update(canonical).digest('hex').slice(0, 16);
|
|
251
|
+
}
|
|
252
|
+
function canonicalStringify(value) {
|
|
253
|
+
if (value === null || typeof value !== 'object')
|
|
254
|
+
return JSON.stringify(value);
|
|
255
|
+
if (Array.isArray(value))
|
|
256
|
+
return `[${value.map(canonicalStringify).join(',')}]`;
|
|
257
|
+
const obj = value;
|
|
258
|
+
const keys = Object.keys(obj).filter((k) => obj[k] !== undefined).sort();
|
|
259
|
+
return `{${keys.map((k) => `${JSON.stringify(k)}:${canonicalStringify(obj[k])}`).join(',')}}`;
|
|
260
|
+
}
|
|
261
|
+
export function getPortfolioPublishState(configDir) {
|
|
262
|
+
const path = portfolioPublishPath(configDir);
|
|
263
|
+
if (!existsSync(path))
|
|
264
|
+
return { targets: {} };
|
|
265
|
+
try {
|
|
266
|
+
const parsed = JSON.parse(readFileSync(path, 'utf-8'));
|
|
267
|
+
return parsed && typeof parsed === 'object' && parsed.targets ? parsed : { targets: {} };
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
return { targets: {} };
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
export function savePortfolioPublishState(state, configDir) {
|
|
274
|
+
const dir = configDir ?? getDataDir();
|
|
275
|
+
mkdirSync(dir, { recursive: true });
|
|
276
|
+
writeFileSync(portfolioPublishPath(configDir), JSON.stringify(state, null, 2), { mode: 0o600 });
|
|
277
|
+
}
|
|
278
|
+
/** Update (or create) a single target entry in the publish state. */
|
|
279
|
+
export function updatePortfolioPublishTarget(target, patch, configDir) {
|
|
280
|
+
const state = getPortfolioPublishState(configDir);
|
|
281
|
+
const existing = state.targets[target];
|
|
282
|
+
const base = existing ?? {
|
|
283
|
+
lastPublishedAt: '',
|
|
284
|
+
lastPublishedProfileHash: '',
|
|
285
|
+
lastPublishedProfile: {},
|
|
286
|
+
config: {},
|
|
287
|
+
visibility: target === DEFAULT_PORTFOLIO_TARGET ? 'public' : undefined,
|
|
288
|
+
};
|
|
289
|
+
state.targets[target] = { ...base, ...patch };
|
|
290
|
+
savePortfolioPublishState(state, configDir);
|
|
291
|
+
return state;
|
|
292
|
+
}
|
|
293
|
+
export { DEFAULT_PORTFOLIO_TARGET };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heyiam",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Turn AI coding sessions into portfolio case studies",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"commander": "^13.1.0",
|
|
41
41
|
"cors": "^2.8.6",
|
|
42
42
|
"express": "^5.2.1",
|
|
43
|
+
"keytar": "^7.9.0",
|
|
43
44
|
"liquidjs": "^10.25.2",
|
|
44
45
|
"open": "^10.1.0"
|
|
45
46
|
},
|