@buildlog/openclaw-skill 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +282 -0
- package/SKILL.md +122 -0
- package/dist/exporter.d.ts +110 -0
- package/dist/exporter.d.ts.map +1 -0
- package/dist/exporter.js +346 -0
- package/dist/exporter.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/recorder.d.ts +145 -0
- package/dist/recorder.d.ts.map +1 -0
- package/dist/recorder.js +286 -0
- package/dist/recorder.js.map +1 -0
- package/dist/skill.d.ts +75 -0
- package/dist/skill.d.ts.map +1 -0
- package/dist/skill.js +394 -0
- package/dist/skill.js.map +1 -0
- package/dist/types.d.ts +63 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/uploader.d.ts +97 -0
- package/dist/uploader.d.ts.map +1 -0
- package/dist/uploader.js +239 -0
- package/dist/uploader.js.map +1 -0
- package/package.json +53 -0
package/dist/skill.js
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BuildlogSkill = void 0;
|
|
4
|
+
exports.createBuildlogSkill = createBuildlogSkill;
|
|
5
|
+
const recorder_js_1 = require("./recorder.js");
|
|
6
|
+
const exporter_js_1 = require("./exporter.js");
|
|
7
|
+
const uploader_js_1 = require("./uploader.js");
|
|
8
|
+
/**
|
|
9
|
+
* BuildlogSkill - Main skill implementation for OpenClaw
|
|
10
|
+
*/
|
|
11
|
+
class BuildlogSkill {
|
|
12
|
+
recorder;
|
|
13
|
+
exporter;
|
|
14
|
+
uploader;
|
|
15
|
+
config;
|
|
16
|
+
lastBuildlog = null;
|
|
17
|
+
unsubscribers = [];
|
|
18
|
+
// Command patterns for natural language matching
|
|
19
|
+
commands = [
|
|
20
|
+
// Start recording
|
|
21
|
+
{
|
|
22
|
+
pattern: /^(start|begin|record)\s+(a\s+)?buildlog\s*[:\-]?\s*(.*)$/i,
|
|
23
|
+
handler: this.handleStart.bind(this),
|
|
24
|
+
},
|
|
25
|
+
// Stop recording
|
|
26
|
+
{
|
|
27
|
+
pattern: /^(stop|end|finish)\s+(the\s+)?buildlog$/i,
|
|
28
|
+
handler: this.handleStop.bind(this),
|
|
29
|
+
},
|
|
30
|
+
// Pause recording
|
|
31
|
+
{
|
|
32
|
+
pattern: /^pause\s+(the\s+)?buildlog$/i,
|
|
33
|
+
handler: this.handlePause.bind(this),
|
|
34
|
+
},
|
|
35
|
+
// Resume recording
|
|
36
|
+
{
|
|
37
|
+
pattern: /^resume\s+(the\s+)?buildlog$/i,
|
|
38
|
+
handler: this.handleResume.bind(this),
|
|
39
|
+
},
|
|
40
|
+
// Export session
|
|
41
|
+
{
|
|
42
|
+
pattern: /^export\s+(this\s+)?(session|conversation)\s+(as\s+)?(a\s+)?buildlog$/i,
|
|
43
|
+
handler: this.handleExport.bind(this),
|
|
44
|
+
},
|
|
45
|
+
// Export last N messages
|
|
46
|
+
{
|
|
47
|
+
pattern: /^export\s+(the\s+)?last\s+(\d+)\s+(messages?|exchanges?)(\s+as\s+(a\s+)?buildlog)?$/i,
|
|
48
|
+
handler: this.handleExportLastN.bind(this),
|
|
49
|
+
},
|
|
50
|
+
// Upload buildlog
|
|
51
|
+
{
|
|
52
|
+
pattern: /^(upload|push|publish)\s+(the\s+)?buildlog$/i,
|
|
53
|
+
handler: this.handleUpload.bind(this),
|
|
54
|
+
},
|
|
55
|
+
// Share buildlog (upload + get link)
|
|
56
|
+
{
|
|
57
|
+
pattern: /^share\s+(the\s+)?buildlog$/i,
|
|
58
|
+
handler: this.handleShare.bind(this),
|
|
59
|
+
},
|
|
60
|
+
// Add note
|
|
61
|
+
{
|
|
62
|
+
pattern: /^add\s+(a\s+)?note[:\-]?\s+(.+)$/i,
|
|
63
|
+
handler: this.handleAddNote.bind(this),
|
|
64
|
+
},
|
|
65
|
+
// Add chapter
|
|
66
|
+
{
|
|
67
|
+
pattern: /^add\s+(a\s+)?chapter[:\-]?\s+(.+)$/i,
|
|
68
|
+
handler: this.handleAddChapter.bind(this),
|
|
69
|
+
},
|
|
70
|
+
// Mark important
|
|
71
|
+
{
|
|
72
|
+
pattern: /^mark\s+(this\s+)?(as\s+)?important$/i,
|
|
73
|
+
handler: this.handleMarkImportant.bind(this),
|
|
74
|
+
},
|
|
75
|
+
// Check status
|
|
76
|
+
{
|
|
77
|
+
pattern: /^buildlog\s+status$/i,
|
|
78
|
+
handler: this.handleStatus.bind(this),
|
|
79
|
+
},
|
|
80
|
+
// Show info
|
|
81
|
+
{
|
|
82
|
+
pattern: /^(show\s+)?buildlog\s+info$/i,
|
|
83
|
+
handler: this.handleInfo.bind(this),
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
constructor(config = {}) {
|
|
87
|
+
this.config = config;
|
|
88
|
+
this.recorder = new recorder_js_1.BuildlogRecorder({
|
|
89
|
+
includeFileContents: config.includeFileContents ?? true,
|
|
90
|
+
maxFileSizeKb: config.maxFileSizeKb ?? 100,
|
|
91
|
+
});
|
|
92
|
+
this.exporter = new exporter_js_1.BuildlogExporter({
|
|
93
|
+
includeFileContents: config.includeFileContents ?? true,
|
|
94
|
+
maxFileSizeKb: config.maxFileSizeKb ?? 100,
|
|
95
|
+
});
|
|
96
|
+
this.uploader = new uploader_js_1.BuildlogUploader({
|
|
97
|
+
apiKey: config.apiKey,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Initialize the skill with OpenClaw context
|
|
102
|
+
*/
|
|
103
|
+
async initialize(ctx) {
|
|
104
|
+
// Update config from context
|
|
105
|
+
if (ctx.config.apiKey) {
|
|
106
|
+
this.uploader.setApiKey(ctx.config.apiKey);
|
|
107
|
+
}
|
|
108
|
+
// Subscribe to OpenClaw events for real-time recording
|
|
109
|
+
this.subscribeToEvents(ctx);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Handle a user message and check for commands
|
|
113
|
+
*/
|
|
114
|
+
async handleMessage(ctx, message) {
|
|
115
|
+
const trimmed = message.trim();
|
|
116
|
+
for (const command of this.commands) {
|
|
117
|
+
const match = trimmed.match(command.pattern);
|
|
118
|
+
if (match) {
|
|
119
|
+
await command.handler(ctx, match);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Cleanup when skill is unloaded
|
|
127
|
+
*/
|
|
128
|
+
dispose() {
|
|
129
|
+
for (const unsub of this.unsubscribers) {
|
|
130
|
+
unsub();
|
|
131
|
+
}
|
|
132
|
+
this.unsubscribers = [];
|
|
133
|
+
if (this.recorder.isRecording()) {
|
|
134
|
+
this.recorder.stop();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Command handlers
|
|
138
|
+
async handleStart(ctx, match) {
|
|
139
|
+
const title = match[3]?.trim() || 'Untitled Buildlog';
|
|
140
|
+
try {
|
|
141
|
+
this.recorder.start(title);
|
|
142
|
+
ctx.respond(`🔴 Recording started: "${title}"\n\nI'll capture this session. Say "stop the buildlog" when you're done.`);
|
|
143
|
+
ctx.events.emit('buildlog:started', { title });
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
ctx.respond(`❌ ${error instanceof Error ? error.message : 'Failed to start recording'}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
async handleStop(ctx, _match) {
|
|
150
|
+
try {
|
|
151
|
+
const session = this.recorder.stop();
|
|
152
|
+
if (!session) {
|
|
153
|
+
ctx.respond('❌ No recording to stop');
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
this.lastBuildlog = this.sessionToBuildlog(session);
|
|
157
|
+
const entryCount = this.lastBuildlog.entries.length;
|
|
158
|
+
ctx.events.emit('buildlog:stopped', { entryCount });
|
|
159
|
+
if (this.config.autoUpload) {
|
|
160
|
+
const result = await this.uploadBuildlog(ctx);
|
|
161
|
+
if (result.success) {
|
|
162
|
+
ctx.respond(`✅ Recording stopped. ${entryCount} exchanges captured and uploaded.\n\n🔗 ${result.url}`);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
ctx.respond(`✅ Recording stopped. ${entryCount} exchanges captured.\n\n❌ Upload failed: ${result.error}\n\nSay "upload the buildlog" to try again.`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
const shouldUpload = await ctx.confirm(`Recording stopped. ${entryCount} exchanges captured.\n\nWould you like to upload to buildlog.ai?`);
|
|
170
|
+
if (shouldUpload) {
|
|
171
|
+
await this.handleUpload(ctx, []);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
ctx.respond('Buildlog saved locally. Say "upload the buildlog" when ready.');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
ctx.respond(`❌ ${error instanceof Error ? error.message : 'Failed to stop recording'}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
async handlePause(ctx, _match) {
|
|
183
|
+
try {
|
|
184
|
+
this.recorder.pause();
|
|
185
|
+
ctx.respond('⏸️ Recording paused. Say "resume the buildlog" to continue.');
|
|
186
|
+
ctx.events.emit('buildlog:paused', {});
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
ctx.respond(`❌ ${error instanceof Error ? error.message : 'Failed to pause recording'}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async handleResume(ctx, _match) {
|
|
193
|
+
try {
|
|
194
|
+
this.recorder.resume();
|
|
195
|
+
ctx.respond('🔴 Recording resumed.');
|
|
196
|
+
ctx.events.emit('buildlog:resumed', {});
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
ctx.respond(`❌ ${error instanceof Error ? error.message : 'Failed to resume recording'}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
async handleExport(ctx, _match) {
|
|
203
|
+
try {
|
|
204
|
+
this.lastBuildlog = this.exporter.export(ctx.session.history);
|
|
205
|
+
const entryCount = this.lastBuildlog.entries.length;
|
|
206
|
+
const title = this.lastBuildlog.metadata.title;
|
|
207
|
+
ctx.respond(`✅ Exported ${entryCount} exchanges as buildlog.\n\n📝 Title: "${title}"\n\nSay "upload the buildlog" to share on buildlog.ai.`);
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
ctx.respond(`❌ Export failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
async handleExportLastN(ctx, match) {
|
|
214
|
+
const n = parseInt(match[2], 10);
|
|
215
|
+
try {
|
|
216
|
+
this.lastBuildlog = this.exporter.exportLastN(ctx.session.history, n);
|
|
217
|
+
const entryCount = this.lastBuildlog.entries.length;
|
|
218
|
+
ctx.respond(`✅ Exported last ${entryCount} exchanges as buildlog.\n\nSay "upload the buildlog" to share.`);
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
ctx.respond(`❌ Export failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
async handleUpload(ctx, _match) {
|
|
225
|
+
if (!this.lastBuildlog) {
|
|
226
|
+
// Try to get from current recording or export session
|
|
227
|
+
if (this.recorder.isRecording()) {
|
|
228
|
+
this.lastBuildlog = this.recorder.toBuildlog();
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
this.lastBuildlog = this.exporter.export(ctx.session.history);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (!this.lastBuildlog) {
|
|
235
|
+
ctx.respond('❌ No buildlog to upload. Try "export this session as a buildlog" first.');
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
const result = await this.uploadBuildlog(ctx);
|
|
239
|
+
if (result.success) {
|
|
240
|
+
ctx.respond(`✅ Uploaded to buildlog.ai!\n\n🔗 ${result.url}\n📋 Short link: ${result.shortUrl}`);
|
|
241
|
+
ctx.events.emit('buildlog:uploaded', { url: result.url, id: result.id });
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
ctx.respond(`❌ Upload failed: ${result.error}\n\nPlease check your API key and try again.`);
|
|
245
|
+
ctx.events.emit('buildlog:error', { error: result.error });
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
async handleShare(ctx, match) {
|
|
249
|
+
// Share is just upload with public visibility
|
|
250
|
+
await this.handleUpload(ctx, match);
|
|
251
|
+
}
|
|
252
|
+
async handleAddNote(ctx, match) {
|
|
253
|
+
const noteText = match[2]?.trim();
|
|
254
|
+
if (!noteText) {
|
|
255
|
+
ctx.respond('❌ Please provide note text. Example: "add a note: This is important"');
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
try {
|
|
259
|
+
this.recorder.addNote(noteText);
|
|
260
|
+
ctx.respond(`📝 Note added: "${noteText}"`);
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
ctx.respond(`❌ ${error instanceof Error ? error.message : 'Failed to add note'}`);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
async handleAddChapter(ctx, match) {
|
|
267
|
+
const title = match[2]?.trim();
|
|
268
|
+
if (!title) {
|
|
269
|
+
ctx.respond('❌ Please provide chapter title. Example: "add chapter: Setup"');
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
try {
|
|
273
|
+
this.recorder.addChapter(title);
|
|
274
|
+
ctx.respond(`📖 Chapter added: "${title}"`);
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
ctx.respond(`❌ ${error instanceof Error ? error.message : 'Failed to add chapter'}`);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
async handleMarkImportant(ctx, _match) {
|
|
281
|
+
try {
|
|
282
|
+
this.recorder.markImportant();
|
|
283
|
+
ctx.respond('⭐ Marked as important');
|
|
284
|
+
}
|
|
285
|
+
catch (error) {
|
|
286
|
+
ctx.respond(`❌ ${error instanceof Error ? error.message : 'Failed to mark important'}`);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
async handleStatus(ctx, _match) {
|
|
290
|
+
const status = this.recorder.getStatus();
|
|
291
|
+
const stateEmoji = {
|
|
292
|
+
idle: '⚪',
|
|
293
|
+
recording: '🔴',
|
|
294
|
+
paused: '⏸️',
|
|
295
|
+
};
|
|
296
|
+
let message = `${stateEmoji[status.state]} Buildlog Status: ${status.state.toUpperCase()}`;
|
|
297
|
+
if (status.state !== 'idle') {
|
|
298
|
+
const duration = Math.round(status.duration / 1000);
|
|
299
|
+
const minutes = Math.floor(duration / 60);
|
|
300
|
+
const seconds = duration % 60;
|
|
301
|
+
message += `\n\n📝 Title: "${status.title}"`;
|
|
302
|
+
message += `\n⏱️ Duration: ${minutes}m ${seconds}s`;
|
|
303
|
+
message += `\n💬 Exchanges: ${status.entryCount}`;
|
|
304
|
+
if (status.noteCount > 0)
|
|
305
|
+
message += `\n📝 Notes: ${status.noteCount}`;
|
|
306
|
+
if (status.chapterCount > 0)
|
|
307
|
+
message += `\n📖 Chapters: ${status.chapterCount}`;
|
|
308
|
+
}
|
|
309
|
+
if (this.lastBuildlog && status.state === 'idle') {
|
|
310
|
+
message += `\n\n📦 Last buildlog ready to upload (${this.lastBuildlog.entries.length} entries)`;
|
|
311
|
+
}
|
|
312
|
+
ctx.respond(message);
|
|
313
|
+
}
|
|
314
|
+
async handleInfo(ctx, _match) {
|
|
315
|
+
await this.handleStatus(ctx, []);
|
|
316
|
+
}
|
|
317
|
+
// Private helpers
|
|
318
|
+
subscribeToEvents(ctx) {
|
|
319
|
+
// Subscribe to user messages
|
|
320
|
+
const unsubUser = ctx.events.on('user_message', (data) => {
|
|
321
|
+
this.recorder.handleEvent({
|
|
322
|
+
type: 'user_message',
|
|
323
|
+
timestamp: Date.now(),
|
|
324
|
+
data,
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
this.unsubscribers.push(unsubUser);
|
|
328
|
+
// Subscribe to assistant messages
|
|
329
|
+
const unsubAssistant = ctx.events.on('assistant_message', (data) => {
|
|
330
|
+
this.recorder.handleEvent({
|
|
331
|
+
type: 'assistant_message',
|
|
332
|
+
timestamp: Date.now(),
|
|
333
|
+
data,
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
this.unsubscribers.push(unsubAssistant);
|
|
337
|
+
// Subscribe to file changes
|
|
338
|
+
const unsubFiles = ctx.events.on('file_change', (data) => {
|
|
339
|
+
this.recorder.handleEvent({
|
|
340
|
+
type: 'file_change',
|
|
341
|
+
timestamp: Date.now(),
|
|
342
|
+
data,
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
this.unsubscribers.push(unsubFiles);
|
|
346
|
+
// Subscribe to terminal commands
|
|
347
|
+
const unsubTerminal = ctx.events.on('terminal_command', (data) => {
|
|
348
|
+
this.recorder.handleEvent({
|
|
349
|
+
type: 'terminal_command',
|
|
350
|
+
timestamp: Date.now(),
|
|
351
|
+
data,
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
this.unsubscribers.push(unsubTerminal);
|
|
355
|
+
}
|
|
356
|
+
sessionToBuildlog(session) {
|
|
357
|
+
return {
|
|
358
|
+
version: '1.0.0',
|
|
359
|
+
metadata: {
|
|
360
|
+
id: session.id,
|
|
361
|
+
title: session.title,
|
|
362
|
+
createdAt: new Date(session.startedAt).toISOString(),
|
|
363
|
+
duration: Date.now() - session.startedAt,
|
|
364
|
+
entryCount: session.entries.length,
|
|
365
|
+
...session.metadata,
|
|
366
|
+
},
|
|
367
|
+
entries: session.entries,
|
|
368
|
+
chapters: session.chapters.map((ch) => ({
|
|
369
|
+
title: ch.title,
|
|
370
|
+
startIndex: ch.entryIndex,
|
|
371
|
+
})),
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
async uploadBuildlog(ctx) {
|
|
375
|
+
if (!this.lastBuildlog) {
|
|
376
|
+
return {
|
|
377
|
+
success: false,
|
|
378
|
+
error: 'No buildlog to upload',
|
|
379
|
+
errorCode: 'NO_BUILDLOG',
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
return this.uploader.upload(this.lastBuildlog, {
|
|
383
|
+
isPublic: this.config.defaultPublic ?? true,
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
exports.BuildlogSkill = BuildlogSkill;
|
|
388
|
+
/**
|
|
389
|
+
* Create and initialize skill instance
|
|
390
|
+
*/
|
|
391
|
+
function createBuildlogSkill(config = {}) {
|
|
392
|
+
return new BuildlogSkill(config);
|
|
393
|
+
}
|
|
394
|
+
//# sourceMappingURL=skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":";;;AA2cA,kDAEC;AA5cD,+CAA4F;AAC5F,+CAA0F;AAC1F,+CAA2G;AAiC3G;;GAEG;AACH,MAAa,aAAa;IAChB,QAAQ,CAAmB;IAC3B,QAAQ,CAAmB;IAC3B,QAAQ,CAAmB;IAC3B,MAAM,CAAc;IACpB,YAAY,GAAoB,IAAI,CAAC;IACrC,aAAa,GAAsB,EAAE,CAAC;IAE9C,iDAAiD;IACzC,QAAQ,GAAmB;QACjC,kBAAkB;QAClB;YACE,OAAO,EAAE,2DAA2D;YACpE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;SACrC;QACD,iBAAiB;QACjB;YACE,OAAO,EAAE,0CAA0C;YACnD,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;SACpC;QACD,kBAAkB;QAClB;YACE,OAAO,EAAE,8BAA8B;YACvC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC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
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for buildlog format
|
|
3
|
+
* These would normally come from @buildlog/types package
|
|
4
|
+
*/
|
|
5
|
+
export interface BuildlogMetadata {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
duration?: number;
|
|
12
|
+
entryCount: number;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
author?: string;
|
|
15
|
+
source?: string;
|
|
16
|
+
version?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BuildlogEntry {
|
|
19
|
+
type: 'user' | 'assistant' | 'file_change' | 'terminal' | 'system';
|
|
20
|
+
timestamp: number;
|
|
21
|
+
content?: string;
|
|
22
|
+
fileChange?: FileChange;
|
|
23
|
+
command?: TerminalCommand;
|
|
24
|
+
toolCalls?: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
arguments: Record<string, unknown>;
|
|
27
|
+
result?: unknown;
|
|
28
|
+
}>;
|
|
29
|
+
attachments?: Array<{
|
|
30
|
+
type: 'file' | 'image';
|
|
31
|
+
name: string;
|
|
32
|
+
content?: string;
|
|
33
|
+
}>;
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
export interface FileChange {
|
|
37
|
+
path: string;
|
|
38
|
+
action: 'create' | 'modify' | 'delete' | 'rename';
|
|
39
|
+
content?: string;
|
|
40
|
+
previousContent?: string;
|
|
41
|
+
diff?: string;
|
|
42
|
+
language?: string;
|
|
43
|
+
timestamp?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface TerminalCommand {
|
|
46
|
+
command: string;
|
|
47
|
+
cwd?: string;
|
|
48
|
+
output?: string;
|
|
49
|
+
exitCode?: number;
|
|
50
|
+
timestamp?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface BuildlogChapter {
|
|
53
|
+
title: string;
|
|
54
|
+
startIndex: number;
|
|
55
|
+
endIndex?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface Buildlog {
|
|
58
|
+
version: string;
|
|
59
|
+
metadata: BuildlogMetadata;
|
|
60
|
+
entries: BuildlogEntry[];
|
|
61
|
+
chapters?: BuildlogChapter[];
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACnC,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC,CAAC;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Buildlog } from './types.js';
|
|
2
|
+
export interface UploadConfig {
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface UploadOptions {
|
|
8
|
+
isPublic?: boolean;
|
|
9
|
+
allowComments?: boolean;
|
|
10
|
+
allowForks?: boolean;
|
|
11
|
+
expiresIn?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface UploadResult {
|
|
14
|
+
success: boolean;
|
|
15
|
+
id?: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
shortUrl?: string;
|
|
18
|
+
embedUrl?: string;
|
|
19
|
+
error?: string;
|
|
20
|
+
errorCode?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface BuildlogInfo {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
url: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
views: number;
|
|
28
|
+
isPublic: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* BuildlogUploader - Upload buildlogs to buildlog.ai
|
|
32
|
+
*/
|
|
33
|
+
export declare class BuildlogUploader {
|
|
34
|
+
private config;
|
|
35
|
+
constructor(config?: UploadConfig);
|
|
36
|
+
/**
|
|
37
|
+
* Set API key (can be updated after construction)
|
|
38
|
+
*/
|
|
39
|
+
setApiKey(apiKey: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Upload a buildlog
|
|
42
|
+
*/
|
|
43
|
+
upload(buildlog: Buildlog, options?: UploadOptions): Promise<UploadResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Update an existing buildlog
|
|
46
|
+
*/
|
|
47
|
+
update(id: string, buildlog: Partial<Buildlog>): Promise<UploadResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete a buildlog
|
|
50
|
+
*/
|
|
51
|
+
delete(id: string): Promise<{
|
|
52
|
+
success: boolean;
|
|
53
|
+
error?: string;
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Get buildlog info
|
|
57
|
+
*/
|
|
58
|
+
getInfo(id: string): Promise<BuildlogInfo | null>;
|
|
59
|
+
/**
|
|
60
|
+
* List user's buildlogs
|
|
61
|
+
*/
|
|
62
|
+
list(options?: {
|
|
63
|
+
limit?: number;
|
|
64
|
+
offset?: number;
|
|
65
|
+
sort?: 'created' | 'views' | 'title';
|
|
66
|
+
}): Promise<{
|
|
67
|
+
buildlogs: BuildlogInfo[];
|
|
68
|
+
total: number;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Generate a shareable link (for anonymous uploads)
|
|
72
|
+
*/
|
|
73
|
+
createShareLink(buildlog: Buildlog): Promise<UploadResult>;
|
|
74
|
+
/**
|
|
75
|
+
* Validate API key
|
|
76
|
+
*/
|
|
77
|
+
validateApiKey(): Promise<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Check if connected to buildlog.ai
|
|
80
|
+
*/
|
|
81
|
+
ping(): Promise<boolean>;
|
|
82
|
+
private request;
|
|
83
|
+
private handleError;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Custom error class for upload errors
|
|
87
|
+
*/
|
|
88
|
+
export declare class UploadError extends Error {
|
|
89
|
+
code: string;
|
|
90
|
+
status: number;
|
|
91
|
+
constructor(message: string, code: string, status: number);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Convenience function to upload a buildlog
|
|
95
|
+
*/
|
|
96
|
+
export declare function uploadBuildlog(buildlog: Buildlog, config?: UploadConfig, options?: UploadOptions): Promise<UploadResult>;
|
|
97
|
+
//# sourceMappingURL=uploader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../src/uploader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,M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