@benzotti/jedi 0.1.15 → 0.1.16
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/action/workflow-template.yml +19 -8
- package/dist/index.js +59 -25
- package/package.json +1 -1
|
@@ -88,17 +88,28 @@ jobs:
|
|
|
88
88
|
grep -qxF "$pattern" .git/info/exclude 2>/dev/null || echo "$pattern" >> .git/info/exclude
|
|
89
89
|
done
|
|
90
90
|
|
|
91
|
-
#
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
# Install Claude Code CLI (required by Jedi for AI invocations)
|
|
92
|
+
- name: Install Claude Code
|
|
93
|
+
run: bun install -g @anthropic-ai/claude-code
|
|
94
|
+
|
|
95
|
+
# Run Jedi CLI directly — full pipeline with routing, agents, and comment posting
|
|
94
96
|
- name: Run Jedi
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
run: |
|
|
98
|
+
COMMENT_BODY="${{ github.event.comment.body }}"
|
|
99
|
+
COMMENT_ID="${{ github.event.comment.id }}"
|
|
100
|
+
PR_NUMBER="${{ github.event.issue.pull_request && github.event.issue.number || '' }}"
|
|
101
|
+
ISSUE_NUMBER="${{ github.event.issue.number }}"
|
|
102
|
+
|
|
103
|
+
ARGS="--repo ${{ github.repository }}"
|
|
104
|
+
[ -n "$COMMENT_ID" ] && ARGS="$ARGS --comment-id $COMMENT_ID"
|
|
105
|
+
[ -n "$PR_NUMBER" ] && ARGS="$ARGS --pr-number $PR_NUMBER"
|
|
106
|
+
[ -n "$ISSUE_NUMBER" ] && ARGS="$ARGS --issue-number $ISSUE_NUMBER"
|
|
107
|
+
|
|
108
|
+
bunx @benzotti/jedi@latest action "$COMMENT_BODY" $ARGS
|
|
100
109
|
env:
|
|
110
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
101
111
|
CLICKUP_API_TOKEN: ${{ secrets.CLICKUP_API_TOKEN }}
|
|
112
|
+
GH_TOKEN: ${{ github.token }}
|
|
102
113
|
|
|
103
114
|
# Save Jedi state — framework, config, persistence all cached together
|
|
104
115
|
- name: Save Jedi state
|
package/dist/index.js
CHANGED
|
@@ -9604,6 +9604,7 @@ async function spawnClaude(prompt2, opts) {
|
|
|
9604
9604
|
const reader = proc.stdout.getReader();
|
|
9605
9605
|
const decoder = new TextDecoder;
|
|
9606
9606
|
let buffer = "";
|
|
9607
|
+
let lastTextResponse = "";
|
|
9607
9608
|
try {
|
|
9608
9609
|
while (true) {
|
|
9609
9610
|
const { done, value } = await reader.read();
|
|
@@ -9622,6 +9623,16 @@ async function spawnClaude(prompt2, opts) {
|
|
|
9622
9623
|
const output = formatStreamEvent(event);
|
|
9623
9624
|
if (output)
|
|
9624
9625
|
process.stdout.write(output);
|
|
9626
|
+
if (event.type === "assistant" && event.message?.content) {
|
|
9627
|
+
for (const block of event.message.content) {
|
|
9628
|
+
if (block.type === "text" && block.text) {
|
|
9629
|
+
lastTextResponse = block.text;
|
|
9630
|
+
}
|
|
9631
|
+
}
|
|
9632
|
+
}
|
|
9633
|
+
if (event.type === "result" && event.result) {
|
|
9634
|
+
lastTextResponse = event.result;
|
|
9635
|
+
}
|
|
9625
9636
|
} catch {}
|
|
9626
9637
|
}
|
|
9627
9638
|
}
|
|
@@ -9631,13 +9642,23 @@ async function spawnClaude(prompt2, opts) {
|
|
|
9631
9642
|
const output = formatStreamEvent(event);
|
|
9632
9643
|
if (output)
|
|
9633
9644
|
process.stdout.write(output);
|
|
9645
|
+
if (event.type === "assistant" && event.message?.content) {
|
|
9646
|
+
for (const block of event.message.content) {
|
|
9647
|
+
if (block.type === "text" && block.text) {
|
|
9648
|
+
lastTextResponse = block.text;
|
|
9649
|
+
}
|
|
9650
|
+
}
|
|
9651
|
+
}
|
|
9652
|
+
if (event.type === "result" && event.result) {
|
|
9653
|
+
lastTextResponse = event.result;
|
|
9654
|
+
}
|
|
9634
9655
|
} catch {}
|
|
9635
9656
|
}
|
|
9636
9657
|
} catch {}
|
|
9637
9658
|
const exitCode = await proc.exited;
|
|
9638
9659
|
process.stdout.write(`
|
|
9639
9660
|
`);
|
|
9640
|
-
return { exitCode };
|
|
9661
|
+
return { exitCode, response: lastTextResponse };
|
|
9641
9662
|
}
|
|
9642
9663
|
|
|
9643
9664
|
// src/storage/index.ts
|
|
@@ -11085,7 +11106,7 @@ async function fetchCommentThread(repo, issueNumber) {
|
|
|
11085
11106
|
author: parsed.author,
|
|
11086
11107
|
body: parsed.body,
|
|
11087
11108
|
createdAt: parsed.createdAt,
|
|
11088
|
-
isJedi: parsed.body.includes("
|
|
11109
|
+
isJedi: parsed.body.includes("### \u2694\uFE0F Jedi")
|
|
11089
11110
|
});
|
|
11090
11111
|
} catch {}
|
|
11091
11112
|
}
|
|
@@ -11126,21 +11147,19 @@ function buildConversationContext(thread, currentCommentId) {
|
|
|
11126
11147
|
return { history: lines.join(`
|
|
11127
11148
|
`), previousJediRuns, isFollowUp };
|
|
11128
11149
|
}
|
|
11129
|
-
function
|
|
11130
|
-
const status = success ? "Completed" : "Failed";
|
|
11131
|
-
const icon = success ? "white_check_mark" : "x";
|
|
11150
|
+
function formatJediComment(response) {
|
|
11132
11151
|
return [
|
|
11133
|
-
`###
|
|
11134
|
-
``,
|
|
11135
|
-
`<details>`,
|
|
11136
|
-
`<summary>Details</summary>`,
|
|
11137
|
-
``,
|
|
11138
|
-
summary,
|
|
11152
|
+
`### \u2694\uFE0F Jedi`,
|
|
11139
11153
|
``,
|
|
11140
|
-
|
|
11154
|
+
response
|
|
11155
|
+
].join(`
|
|
11156
|
+
`);
|
|
11157
|
+
}
|
|
11158
|
+
function formatErrorComment(command, summary) {
|
|
11159
|
+
return [
|
|
11160
|
+
`### \u2694\uFE0F Jedi`,
|
|
11141
11161
|
``,
|
|
11142
|
-
|
|
11143
|
-
`_Powered by [@benzotti/jedi](https://github.com/zottiben/jedi)_`
|
|
11162
|
+
`**${command} failed.** ${summary}`
|
|
11144
11163
|
].join(`
|
|
11145
11164
|
`);
|
|
11146
11165
|
}
|
|
@@ -11277,8 +11296,8 @@ var actionCommand = defineCommand({
|
|
|
11277
11296
|
version = pkg.version;
|
|
11278
11297
|
}
|
|
11279
11298
|
} catch {}
|
|
11280
|
-
const
|
|
11281
|
-
|
|
11299
|
+
const statusBody = [
|
|
11300
|
+
`**Framework Status**`,
|
|
11282
11301
|
``,
|
|
11283
11302
|
`| Component | Status |`,
|
|
11284
11303
|
`|-----------|--------|`,
|
|
@@ -11286,11 +11305,11 @@ var actionCommand = defineCommand({
|
|
|
11286
11305
|
`| CLAUDE.md | ${claudeMdExists ? "found" : "missing"} |`,
|
|
11287
11306
|
`| State config | ${stateExists ? "found" : "missing"} |`,
|
|
11288
11307
|
`| Learnings | ${learningsExists ? "found" : "missing"} |`,
|
|
11289
|
-
`| Version | \`${version}\`
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11308
|
+
`| Version | \`${version}\` |`
|
|
11309
|
+
].join(`
|
|
11310
|
+
`);
|
|
11311
|
+
const lines = formatJediComment(statusBody).split(`
|
|
11312
|
+
`);
|
|
11294
11313
|
if (repo && issueNumber) {
|
|
11295
11314
|
await postGitHubComment(repo, issueNumber, lines.join(`
|
|
11296
11315
|
`)).catch((err) => {
|
|
@@ -11447,11 +11466,13 @@ Use the ClickUp ticket above as the primary requirements source.` : ``,
|
|
|
11447
11466
|
}
|
|
11448
11467
|
}
|
|
11449
11468
|
let success = true;
|
|
11469
|
+
let fullResponse = "";
|
|
11450
11470
|
try {
|
|
11451
|
-
const { exitCode } = await spawnClaude(prompt2, {
|
|
11471
|
+
const { exitCode, response } = await spawnClaude(prompt2, {
|
|
11452
11472
|
cwd,
|
|
11453
11473
|
permissionMode: "bypassPermissions"
|
|
11454
11474
|
});
|
|
11475
|
+
fullResponse = response;
|
|
11455
11476
|
if (exitCode !== 0) {
|
|
11456
11477
|
success = false;
|
|
11457
11478
|
consola.error(`Claude exited with code ${exitCode}`);
|
|
@@ -11477,6 +11498,13 @@ Use the ClickUp ticket above as the primary requirements source.` : ``,
|
|
|
11477
11498
|
if (implResult.exitCode !== 0) {
|
|
11478
11499
|
success = false;
|
|
11479
11500
|
}
|
|
11501
|
+
if (implResult.response) {
|
|
11502
|
+
fullResponse += `
|
|
11503
|
+
|
|
11504
|
+
---
|
|
11505
|
+
|
|
11506
|
+
` + implResult.response;
|
|
11507
|
+
}
|
|
11480
11508
|
}
|
|
11481
11509
|
} catch (err) {
|
|
11482
11510
|
success = false;
|
|
@@ -11489,8 +11517,14 @@ Use the ClickUp ticket above as the primary requirements source.` : ``,
|
|
|
11489
11517
|
consola.info("Codebase index persisted to storage");
|
|
11490
11518
|
if (repo && issueNumber) {
|
|
11491
11519
|
const actionLabel = intent.isFeedback ? "feedback" : intent.command;
|
|
11492
|
-
|
|
11493
|
-
|
|
11520
|
+
let commentBody;
|
|
11521
|
+
if (success && fullResponse) {
|
|
11522
|
+
commentBody = formatJediComment(fullResponse);
|
|
11523
|
+
} else if (!success) {
|
|
11524
|
+
commentBody = formatErrorComment(actionLabel, "Check workflow logs for details.");
|
|
11525
|
+
} else {
|
|
11526
|
+
commentBody = formatJediComment(`Executed \`${actionLabel}\` successfully.`);
|
|
11527
|
+
}
|
|
11494
11528
|
await postGitHubComment(repo, issueNumber, commentBody).catch((err) => {
|
|
11495
11529
|
consola.error("Failed to post result comment:", err);
|
|
11496
11530
|
});
|
|
@@ -11565,7 +11599,7 @@ var setupActionCommand = defineCommand({
|
|
|
11565
11599
|
// package.json
|
|
11566
11600
|
var package_default = {
|
|
11567
11601
|
name: "@benzotti/jedi",
|
|
11568
|
-
version: "0.1.
|
|
11602
|
+
version: "0.1.16",
|
|
11569
11603
|
description: "JDI - Context-efficient AI development framework for Claude Code",
|
|
11570
11604
|
type: "module",
|
|
11571
11605
|
bin: {
|