shapewall 0.3.1 → 0.3.3
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/CHANGELOG.md +142 -0
- package/NOTICE +7 -0
- package/README.md +4 -2
- package/THIRD_PARTY.md +39 -0
- package/dist/agent/package-lock.json +2 -2
- package/dist/client/assets/BoardChat-DxehB761.js +27 -0
- package/dist/client/assets/BuzzDialog-Ix9qJvim.js +1 -0
- package/dist/client/assets/ChecksPanel-pA_ueIaJ.js +1 -0
- package/dist/client/assets/History-C9N32kCv.js +1 -0
- package/dist/client/assets/LocalSettings-DawtKnvi.js +1 -0
- package/dist/client/assets/{Management-BFcKFdbp.js → Management-NVFDtSZB.js} +1 -1
- package/dist/client/assets/QuickConnect-DO1TjS1t.js +1 -0
- package/dist/client/assets/ShareDialog-By0ETg6n.js +2 -0
- package/dist/client/assets/app-update-dialog-RGIw24iZ.js +1 -0
- package/dist/client/assets/{circle-x-PRxj7kPi.js → circle-x-B6KfScOE.js} +1 -1
- package/dist/client/assets/index-CsqLdqGx.css +2 -0
- package/dist/client/assets/index-DnZarJ3U.js +37 -0
- package/dist/client/assets/{refresh-cw-aeOBDuGQ.js → refresh-cw-vkgvCCfR.js} +1 -1
- package/dist/client/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/client/assets/{shield-check-DuPBJ6H_.js → shield-check-QzwGhz0t.js} +1 -1
- package/dist/client/assets/ui-DI-FGWWK.js +41 -0
- package/dist/client/build-info.json +1 -1
- package/dist/client/index.html +4 -3
- package/dist/client/sw.js +2 -2
- package/dist/console/assets/{LocalAccountsApp-lJjkhUcH.js → LocalAccountsApp-VOCZg8dg.js} +1 -1
- package/dist/console/assets/{LocalConsole-BZHqYKnt.js → LocalConsole-CMwAW-mF.js} +1 -1
- package/dist/console/assets/{app-update-dialog-DCM9sYE3.js → app-update-dialog-Cw6UDqNP.js} +1 -1
- package/dist/console/assets/console-DgfWmUEx.js +55 -0
- package/dist/console/assets/console-Lis0vvdL.css +2 -0
- package/dist/console/build-info.json +1 -1
- package/dist/console/console.html +2 -2
- package/docs/agent-workflow.md +19 -3
- package/docs/agents.md +62 -2
- package/docs/config.md +3 -3
- package/docs/deployment.md +2 -0
- package/docs/design-system.md +20 -15
- package/docs/hosted.md +19 -0
- package/docs/pull-requests.md +4 -1
- package/docs/where-to-run.md +88 -0
- package/package.json +2 -1
- package/src/agent/agent-logos.js +81 -0
- package/src/agent/composer.js +9 -5
- package/src/agent/config.js +27 -2
- package/src/agent/context.js +3 -1
- package/src/agent/icon-store.js +100 -0
- package/src/agent/identity.js +77 -0
- package/src/agent/owner-mcp.js +19 -3
- package/src/agent/routes.js +82 -21
- package/src/agent/run.js +3 -1
- package/src/agent/settings-routes.js +233 -14
- package/src/agent/test-timing.js +14 -0
- package/src/agent/tools.js +6 -3
- package/src/agent/user-settings.js +51 -3
- package/src/capture/capture.js +3 -1
- package/src/capture/element-map.js +73 -11
- package/src/ci/settings.js +3 -3
- package/src/ci/start.js +16 -0
- package/src/ci/summary.js +8 -1
- package/src/cli/args.js +1 -0
- package/src/cli/ci.js +2 -2
- package/src/cli/comments.js +5 -4
- package/src/cli/help.js +3 -1
- package/src/cli/init.js +2 -2
- package/src/comment-fields.js +45 -0
- package/src/comments-cli.js +100 -21
- package/src/discover.js +34 -1
- package/src/doctor.js +26 -1
- package/src/event-log.js +5 -2
- package/src/feedback.js +5 -2
- package/src/github.js +4 -2
- package/src/hosted/agent-presence.js +40 -0
- package/src/hosted/app.js +6 -0
- package/src/hosted/board-routes.js +9 -1
- package/src/hosted/comments.js +11 -11
- package/src/hosted/console-routes.js +47 -1
- package/src/hosted/events.js +6 -4
- package/src/hosted/import.js +7 -4
- package/src/hosted/presence.js +1 -1
- package/src/hosted/projects.js +32 -1
- package/src/hosted/token-api.js +5 -1
- package/src/hosted/token-events.js +5 -2
- package/src/hosted/tokens.js +3 -2
- package/src/mcp.js +10 -2
- package/src/notify/messages.js +6 -4
- package/src/store.js +19 -11
- package/dist/client/assets/BoardChat-V1BCXdDB.js +0 -27
- package/dist/client/assets/BuzzDialog-Ds7Thpfe.js +0 -1
- package/dist/client/assets/ChecksPanel-Cm22bCdQ.js +0 -1
- package/dist/client/assets/History-U0bD1BjA.js +0 -1
- package/dist/client/assets/LocalSettings-DOSuW7VC.js +0 -1
- package/dist/client/assets/QuickConnect-DyfPSWbV.js +0 -1
- package/dist/client/assets/ShareDialog-BouvNraR.js +0 -2
- package/dist/client/assets/app-update-dialog-DH2Mgby8.js +0 -1
- package/dist/client/assets/index-C9S7HL_o.js +0 -37
- package/dist/client/assets/index-CXtuJi1K.css +0 -2
- package/dist/client/assets/ui-Cg4TTrec.js +0 -41
- package/dist/console/assets/console-C2LsvEco.js +0 -55
- package/dist/console/assets/console-Fp4k9iyx.css +0 -2
package/src/notify/messages.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { splitMentions } from '../mentions.js'
|
|
7
7
|
import { DEFAULT_BOARD_URL, runningBoardUrl } from '../serve-state.js'
|
|
8
8
|
import { boardViewports } from '../config.js'
|
|
9
|
+
import { commentText } from '../comment-fields.js'
|
|
9
10
|
|
|
10
11
|
const QUOTE_MAX = 500
|
|
11
12
|
|
|
@@ -54,25 +55,26 @@ export function summarize(config, event, boardUrl) {
|
|
|
54
55
|
const who = (name) => clip(name || 'Someone', 60)
|
|
55
56
|
const n = `#${comment.id}`
|
|
56
57
|
let title
|
|
57
|
-
|
|
58
|
+
// No text: what the comment has instead ("(drawing)", "(2 images)").
|
|
59
|
+
let quote = commentText(comment)
|
|
58
60
|
switch (event.type) {
|
|
59
61
|
case 'comment.created':
|
|
60
62
|
title = `${who(comment.author)} commented on ${where}`
|
|
61
63
|
break
|
|
62
64
|
case 'comment.replied':
|
|
63
65
|
title = `${who(event.reply?.author)} replied to ${n} on ${where}`
|
|
64
|
-
quote = event.reply
|
|
66
|
+
quote = commentText(event.reply)
|
|
65
67
|
break
|
|
66
68
|
case 'comment.mentioned':
|
|
67
69
|
title = `@${event.handle}, you were mentioned on ${n}, ${where}`
|
|
68
|
-
quote = event.reply
|
|
70
|
+
quote = commentText(event.reply || comment)
|
|
69
71
|
break
|
|
70
72
|
case 'comment.status_changed':
|
|
71
73
|
title = `Agent status of ${n} on ${where}: ${event.previous?.agentStatus || 'none'} -> ${event.agentStatus || 'none'}`
|
|
72
74
|
break
|
|
73
75
|
case 'comment.resolved':
|
|
74
76
|
title = `${n} on ${where} was resolved`
|
|
75
|
-
if (comment.resolution) quote = `${
|
|
77
|
+
if (comment.resolution) quote = `${quote}\n\nResolution: ${comment.resolution}`
|
|
76
78
|
if (comment.fixRef) quote = `${quote}\nFix: ${comment.fixRef}`
|
|
77
79
|
break
|
|
78
80
|
case 'comment.reopened':
|
package/src/store.js
CHANGED
|
@@ -41,7 +41,10 @@ import {
|
|
|
41
41
|
CommentError,
|
|
42
42
|
FIX_REF_MAX,
|
|
43
43
|
STORED_AGENT_STATUSES,
|
|
44
|
+
agentStatusOnResolve,
|
|
45
|
+
cleanCommentBody,
|
|
44
46
|
cleanFixRef,
|
|
47
|
+
hasCommentMedia,
|
|
45
48
|
readImages,
|
|
46
49
|
validateAnchor,
|
|
47
50
|
} from './comment-fields.js'
|
|
@@ -573,14 +576,6 @@ export function commentCounts(config, boardId) {
|
|
|
573
576
|
return counts
|
|
574
577
|
}
|
|
575
578
|
|
|
576
|
-
function cleanBody(value) {
|
|
577
|
-
const body = typeof value === 'string' ? value.replace(/\r\n/g, '\n').trim() : ''
|
|
578
|
-
if (!body) throw new CommentError(400, 'empty_comment', 'Write something first.')
|
|
579
|
-
if (body.length > COMMENT_BODY_MAX)
|
|
580
|
-
throw new CommentError(400, 'comment_too_long', `Comments are limited to ${COMMENT_BODY_MAX} characters.`)
|
|
581
|
-
return body
|
|
582
|
-
}
|
|
583
|
-
|
|
584
579
|
function cleanAuthor(value) {
|
|
585
580
|
const author = typeof value === 'string' ? value.replace(/\s+/g, ' ').trim().slice(0, AUTHOR_MAX) : ''
|
|
586
581
|
return author || 'anonymous'
|
|
@@ -617,7 +612,9 @@ export function validateCommentInput(config, board, input) {
|
|
|
617
612
|
viewport,
|
|
618
613
|
x: Math.round(x * 100) / 100,
|
|
619
614
|
y: Math.round(y * 100) / 100,
|
|
620
|
-
|
|
615
|
+
// No text is fine when an image or a drawing comes with it (checked by
|
|
616
|
+
// validateCommentMedia, which refuses anything it does not keep).
|
|
617
|
+
body: cleanCommentBody(input?.body, { media: hasCommentMedia(input) }),
|
|
621
618
|
author: cleanAuthor(input?.author),
|
|
622
619
|
anchor: validateAnchor(input?.anchor),
|
|
623
620
|
}
|
|
@@ -686,7 +683,6 @@ export async function updateComment(config, boardId, commentId, changes, { now =
|
|
|
686
683
|
const id = Number(commentId)
|
|
687
684
|
if (!Number.isSafeInteger(id) || id <= 0) throw new CommentError(404, 'unknown_comment', 'That comment does not exist.')
|
|
688
685
|
if (!changes || typeof changes !== 'object') throw new CommentError(400, 'invalid_change', 'Nothing to change.')
|
|
689
|
-
const body = changes.body !== undefined ? cleanBody(changes.body) : undefined
|
|
690
686
|
if (changes.status !== undefined && !['open', 'resolved'].includes(changes.status)) {
|
|
691
687
|
throw new CommentError(400, 'invalid_status', 'Status must be open or resolved.')
|
|
692
688
|
}
|
|
@@ -703,6 +699,8 @@ export async function updateComment(config, boardId, commentId, changes, { now =
|
|
|
703
699
|
const comment = store.comments.find((item) => item.id === id)
|
|
704
700
|
if (!comment) throw new CommentError(404, 'unknown_comment', 'That comment does not exist.')
|
|
705
701
|
const before = withAgentFields(structuredClone(comment))
|
|
702
|
+
// The text may be emptied only on a comment that has an image or a drawing.
|
|
703
|
+
const body = changes.body !== undefined ? cleanCommentBody(changes.body, { media: hasCommentMedia(before) }) : undefined
|
|
706
704
|
if (body !== undefined && body !== comment.body) {
|
|
707
705
|
comment.body = body
|
|
708
706
|
// Shown as "edited" beside the time.
|
|
@@ -721,6 +719,10 @@ export async function updateComment(config, boardId, commentId, changes, { now =
|
|
|
721
719
|
comment.reopenCount = (Number.isSafeInteger(comment.reopenCount) ? comment.reopenCount : 0) + 1
|
|
722
720
|
comment.reopenedAt = now.toISOString()
|
|
723
721
|
if (agentStatus === undefined) setAgent(comment, null, now)
|
|
722
|
+
} else if (agentStatus === undefined && comment.agentStatus !== BRANCH_READY) {
|
|
723
|
+
// Resolved, however it happened (the board, the CLI, MCP): no agent
|
|
724
|
+
// is left "working" on it.
|
|
725
|
+
setAgent(comment, agentStatusOnResolve(before.agentStatus), now)
|
|
724
726
|
}
|
|
725
727
|
}
|
|
726
728
|
if (agentStatus !== undefined) setAgent(comment, agentStatus, now)
|
|
@@ -823,8 +825,9 @@ export function getComment(config, boardId, commentId) {
|
|
|
823
825
|
|
|
824
826
|
// Adds a reply. Returns { comment, reply }.
|
|
825
827
|
// `images` and `drawing` as on a new comment (validateCommentMedia).
|
|
828
|
+
// `agent: true` marks a reply the board's agent wrote under its own name.
|
|
826
829
|
export async function addReply(config, boardId, commentId, input, { now = new Date() } = {}) {
|
|
827
|
-
const body =
|
|
830
|
+
const body = cleanCommentBody(input?.body, { media: hasCommentMedia(input) })
|
|
828
831
|
const author = cleanAuthor(input?.author)
|
|
829
832
|
const media = validateCommentMedia(input)
|
|
830
833
|
const images = saveCommentImages(boardDir(config, boardId), media.images)
|
|
@@ -844,6 +847,10 @@ export async function addReply(config, boardId, commentId, input, { now = new Da
|
|
|
844
847
|
body,
|
|
845
848
|
createdAt: now.toISOString(),
|
|
846
849
|
}
|
|
850
|
+
// Written by the board's own agent under the name its owner gave it
|
|
851
|
+
// ("Harry"): the flag says it is an agent, since the name no longer
|
|
852
|
+
// does. Only the server's own agent tools set it, never a request body.
|
|
853
|
+
if (input?.agent === true) reply.agent = true
|
|
847
854
|
if (images.length) reply.images = images
|
|
848
855
|
if (media.drawing) {
|
|
849
856
|
const version = String(target.pageId).startsWith('variant:')
|
|
@@ -1037,6 +1044,7 @@ export async function recordGithubPull(config, boardId, commentId, pull, { via =
|
|
|
1037
1044
|
if (target.status === 'open') {
|
|
1038
1045
|
target.status = 'resolved'
|
|
1039
1046
|
target.resolvedAt = now.toISOString()
|
|
1047
|
+
if (target.agentStatus !== BRANCH_READY) setAgent(target, agentStatusOnResolve(before.agentStatus), now)
|
|
1040
1048
|
target.resolution = `Merged in ${label}.`.slice(0, COMMENT_BODY_MAX)
|
|
1041
1049
|
target.fixRef = next.url
|
|
1042
1050
|
} else if (!target.fixRef) {
|