ework-web 0.10.98 → 0.10.100
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/package.json +1 -1
- package/src/render/layout.ts +2 -0
- package/src/upstream-sync.ts +8 -2
- package/src/views/issueThread.ts +3 -0
package/package.json
CHANGED
package/src/render/layout.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface LayoutProps {
|
|
|
5
5
|
issueTitle: string;
|
|
6
6
|
repoPath: string;
|
|
7
7
|
issueNumber: number;
|
|
8
|
+
upstreamUrl?: string;
|
|
8
9
|
state: string;
|
|
9
10
|
totalComments: number;
|
|
10
11
|
descriptionHtml: string;
|
|
@@ -236,6 +237,7 @@ export function renderLayout(props: LayoutProps, inner: string, initialItems: st
|
|
|
236
237
|
<span style="opacity:.5">/</span>
|
|
237
238
|
<a href="${escapeAttr(repoIssuesHref)}" style="color:var(--header-text)">${escapeHtml(props.repoPath)}</a>
|
|
238
239
|
<span class="num">#${props.issueNumber}</span>
|
|
240
|
+
${props.upstreamUrl ? `<a href="${escapeAttr(props.upstreamUrl)}" target="_blank" rel="noopener" title="upstream" style="color:var(--header-text);text-decoration:none;font-size:.85em">↗</a>` : ""}
|
|
239
241
|
</header>
|
|
240
242
|
<div class="meta-bar">
|
|
241
243
|
<h1>${escapeHtml(props.issueTitle)}</h1>
|
package/src/upstream-sync.ts
CHANGED
|
@@ -123,7 +123,10 @@ export class UpstreamSync {
|
|
|
123
123
|
upstreamIssueNumber: gi.number,
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
|
-
|
|
126
|
+
// PRs the sandbox agent opens itself carry the ework-agent-pr marker;
|
|
127
|
+
// announcing them would wake the agent on its own artifact (feedback loop)
|
|
128
|
+
const agentAuthored = !!gi.pull_request && /<!--\s*ework-agent-pr\s*-->/.test(gi.body ?? "");
|
|
129
|
+
if (emit && !agentAuthored) {
|
|
127
130
|
const created = await getIssueByUpstreamNumber(this.project.id, gi.number);
|
|
128
131
|
if (created) void emitIssueEvent(this.project.id, created.id, "opened", this.origin);
|
|
129
132
|
}
|
|
@@ -154,7 +157,10 @@ export class UpstreamSync {
|
|
|
154
157
|
const gcAuthor = gc.user?.login ?? "upstream";
|
|
155
158
|
// ensure the kind before postComment's internal user creation runs
|
|
156
159
|
await ensureUser(gcAuthor, fromGithubBot(gcAuthor) ? "bot" : "human");
|
|
157
|
-
|
|
160
|
+
// invisible provenance marker: ework-mirror skips events carrying it, so
|
|
161
|
+
// synced-in comments never echo back to the upstream thread
|
|
162
|
+
const body = (gc.body ?? "") + "\n\n<!-- upstream-sync -->";
|
|
163
|
+
const row = await postComment(local.id, body, gcAuthor, {
|
|
158
164
|
createdAt: gc.created_at,
|
|
159
165
|
updatedAt: gc.updated_at,
|
|
160
166
|
upstreamCommentId: gc.id,
|
package/src/views/issueThread.ts
CHANGED
|
@@ -157,6 +157,9 @@ export async function buildIssueThread(
|
|
|
157
157
|
{
|
|
158
158
|
title: `${issue.title} · ${owner}/${repo}#${number}`,
|
|
159
159
|
issueTitle: issue.title,
|
|
160
|
+
upstreamUrl: issue.upstream_issue_number && upstreamRefBase(project)
|
|
161
|
+
? `${upstreamRefBase(project)}/issues/${issue.upstream_issue_number}`
|
|
162
|
+
: undefined,
|
|
160
163
|
repoPath: `${owner}/${repo}`,
|
|
161
164
|
issueNumber: number,
|
|
162
165
|
state: issue.state,
|