@my-life-buddies/cli 0.2.0 → 0.4.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/README.md +70 -53
- package/dist/bin/core.js +936 -447
- package/dist/bin/core.js.map +4 -4
- package/dist/bin/preview.js +147 -12
- package/dist/bin/preview.js.map +3 -3
- package/dist/web/app.css +8 -0
- package/dist/web/app.js +7 -2
- package/dist/web/index.html +11 -3
- package/dist/web/widget-delivery.js +28 -0
- package/dist/web/widgets.css +31 -0
- package/dist/web/widgets.js +127 -0
- package/package.json +3 -3
- package/resources/README.md +3 -1
- package/resources/agent-template/package-lock.json +4 -4
- package/resources/agent-template/package.json +1 -1
- package/resources/buddy-creator/INSTALL.md +2 -2
- package/resources/buddy-creator/PATCHES.md +21 -1
- package/resources/buddy-creator/SKILL.md +16 -6
- package/resources/buddy-creator/agents/openai.yaml +1 -1
- package/resources/buddy-creator/assets/preview/index.html +2 -0
- package/resources/buddy-creator/assets/preview/widgets.css +1 -0
- package/resources/buddy-creator/assets/preview/widgets.js +168 -0
- package/resources/buddy-creator/assets/widget-reference/conversation.png +0 -0
- package/resources/buddy-creator/assets/widget-reference/expanded.png +0 -0
- package/resources/buddy-creator/assets/widget-v2/app.js +62 -0
- package/resources/buddy-creator/assets/widget-v2/style.css +1 -0
- package/resources/buddy-creator/assets/widget-v3/app.js +65 -0
- package/resources/buddy-creator/assets/widget-v3/style.css +103 -0
- package/resources/buddy-creator/assets/widget-v4/app.js +66 -0
- package/resources/buddy-creator/assets/widget-v4/style.css +187 -0
- package/resources/buddy-creator/references/artifact-schema.md +2 -0
- package/resources/buddy-creator/references/host-guide.md +12 -6
- package/resources/buddy-creator/references/recovery.md +6 -3
- package/resources/buddy-creator/references/service.md +2 -0
- package/resources/buddy-creator/references/widgets-protocol.md +83 -0
- package/resources/buddy-creator/references/widgets.md +99 -0
- package/resources/buddy-creator/scripts/buddy_core.py +75 -13
- package/resources/buddy-creator/scripts/completion.py +64 -8
- package/resources/buddy-creator/scripts/preview.py +46 -6
- package/resources/buddy-creator/scripts/widget_render.py +66 -0
- package/resources/buddy-creator/scripts/widget_render_v1.py +176 -0
- package/resources/buddy-creator/scripts/widget_render_v2.py +98 -0
- package/resources/buddy-creator/scripts/widget_render_v3.py +86 -0
- package/resources/buddy-creator/scripts/widget_render_v4.py +121 -0
- package/resources/buddy-creator/scripts/widgets.py +227 -0
- package/resources/buddy-creator/version.json +1 -1
- package/resources/buddy-creator.manifest.json +121 -26
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
* { box-sizing: border-box; }
|
|
2
|
+
html, body { margin: 0; width: 100%; height: 100%; background: #fff; }
|
|
3
|
+
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
|
|
4
|
+
button, summary { -webkit-tap-highlight-color: transparent; }
|
|
5
|
+
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
6
|
+
[hidden] { display: none !important; }
|
|
7
|
+
h1, h2, h3, p { margin: 0; }
|
|
8
|
+
h1, h2, h3 { font-size: var(--title-size, 16px); font-weight: 500; }
|
|
9
|
+
.screen { font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif; color: #202733; position: relative; width: 100%; height: 100%; overflow: hidden; background: #fff; --accent: #326BC4; --muted: #7C8490; --line: #E9EDF2; }
|
|
10
|
+
.icon { display: block; flex: none; width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
|
|
11
|
+
.statusbar { height: 40px; padding: 10px 25px 0; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; }
|
|
12
|
+
.device { display: flex; gap: 5px; }
|
|
13
|
+
.device .icon { width: 16px; height: 16px; }
|
|
14
|
+
.chat-header { height: 56px; padding: 0 20px 10px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
|
|
15
|
+
.chat-header strong { flex: 1; text-align: center; font-size: 16px; font-weight: 500; }
|
|
16
|
+
.back { font-size: 28px; line-height: 1; }
|
|
17
|
+
.chat-body { height: calc(100% - 176px); overflow-y: auto; padding: 20px 16px 28px; scrollbar-width: none; }
|
|
18
|
+
.chat-date { color: #9299A3; text-align: center; font-size: 11px; margin-bottom: 18px; }
|
|
19
|
+
.message { display: flex; gap: 9px; align-items: flex-start; margin: 14px 0; }
|
|
20
|
+
.avatar { flex: none; width: 26px; height: 26px; border-radius: 8px; background: #E9F0FB; color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 500; margin-top: 3px; }
|
|
21
|
+
.bubble { max-width: calc(100% - 38px); font-size: 16px; line-height: 1.65; padding: 12px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
22
|
+
.user { justify-content: flex-end; }
|
|
23
|
+
.user .bubble { background: #EAF1FB; border-top-right-radius: 3px; }
|
|
24
|
+
.assistant .bubble { background: #F4F5F7; border-top-left-radius: 3px; }
|
|
25
|
+
.chat-card { margin: 16px 0 0 35px; border: 1px solid #DFE5ED; border-radius: 14px; background: #fff; overflow: hidden; }
|
|
26
|
+
.card-content { padding: 17px 16px 18px; }
|
|
27
|
+
.card-kind { font-size: 12px; color: var(--accent); margin-bottom: 8px; }
|
|
28
|
+
.chat-card h1 { font-size: 16px; font-weight: 500; line-height: 1.45; }
|
|
29
|
+
.card-summary { font-size: 16px; line-height: 1.65; color: #66707E; margin-top: 9px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
30
|
+
.open-sheet { width: 100%; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); background: #fff; color: var(--accent); font-size: 14px; font-weight: 500; }
|
|
31
|
+
.open-sheet .icon { width: 17px; height: 17px; }
|
|
32
|
+
.open-sheet:hover { background: #F6F8FC; }
|
|
33
|
+
.composer { position: absolute; bottom: 19px; left: 16px; right: 16px; display: flex; align-items: center; gap: 10px; min-height: 49px; padding: 12px; border: 1px solid #E6E9EF; border-radius: 14px; background: #fff; color: #9299A3; font-size: 12px; }
|
|
34
|
+
.composer span { flex: 1; }
|
|
35
|
+
.home-indicator { position: absolute; bottom: 7px; left: 36%; right: 36%; height: 4px; border-radius: 8px; background: #252C37; }
|
|
36
|
+
.overlay { position: absolute; inset: 0; z-index: 2; background: #17243B45; display: grid; place-items: center; }
|
|
37
|
+
.sheet { width: calc(100% - 32px); height: 65%; border-radius: 22px; background: #fff; display: flex; flex-direction: column; overflow: hidden; position: relative; box-shadow: 0 12px 36px #192B4720; outline: none; }
|
|
38
|
+
.sheet-header { flex: none; height: 60px; display: flex; align-items: center; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); }
|
|
39
|
+
.sheet-header h2 { flex: 1; font-size: 16px; font-weight: 500; }
|
|
40
|
+
.close { width: 32px; height: 32px; background: transparent; color: #8490A0; border-radius: 8px; display: grid; place-items: center; flex: none; }
|
|
41
|
+
.close .icon { width: 20px; height: 20px; }
|
|
42
|
+
.close:hover { background: #F3F5F8; color: #26344C; }
|
|
43
|
+
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 20px; scrollbar-width: thin; scrollbar-color: #D5DBE5 transparent; }
|
|
44
|
+
.overview { padding: 22px 0 15px; }
|
|
45
|
+
.overview h3 { font-size: 20px; line-height: 1.4; font-weight: 500; letter-spacing: -.4px; }
|
|
46
|
+
.overview-subtitle { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.6; white-space: pre-wrap; }
|
|
47
|
+
.reading-meta { color: #606E81; font-size: 13px; margin-top: 12px; }
|
|
48
|
+
.overview-metrics { display: grid; grid-template-columns: repeat(var(--metric-count), 1fr); gap: 16px; margin-top: 22px; }
|
|
49
|
+
.metric-label { display: block; font-size: 12px; color: var(--muted); }
|
|
50
|
+
.metric-value { display: block; font-size: 20px; font-weight: 500; line-height: 1.4; margin-top: 4px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
|
|
51
|
+
.overview-metrics .metric:first-child .metric-value { color: var(--accent); }
|
|
52
|
+
.progress-track { height: 3px; overflow: hidden; background: #ECF0F5; margin-top: 16px; }
|
|
53
|
+
.progress-track > div { height: 100%; background: var(--accent); }
|
|
54
|
+
.progress-caption { font-size: 11px; color: var(--muted); margin-top: 7px; }
|
|
55
|
+
.reading-nav { position: sticky; top: 0; z-index: 1; display: flex; gap: 22px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
|
|
56
|
+
.reading-nav button { flex: none; position: relative; padding: 12px 0; font-size: 14px; background: transparent; color: #8A93A1; white-space: nowrap; }
|
|
57
|
+
.reading-nav button[aria-pressed=true] { color: var(--accent); font-weight: 500; }
|
|
58
|
+
.reading-nav button[aria-pressed=true]:after { position: absolute; content: ""; height: 2px; background: var(--accent); left: 0; right: 0; bottom: 0; }
|
|
59
|
+
.reading-nav button:hover { color: var(--accent); }
|
|
60
|
+
.section { margin: 20px 0 24px; }
|
|
61
|
+
.section-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: #8A93A1; font-size: 12px; font-weight: 400; line-height: 1.5; list-style: none; }
|
|
62
|
+
.section-heading::-webkit-details-marker { display: none; }
|
|
63
|
+
summary.section-heading { cursor: pointer; padding: 4px 0; }
|
|
64
|
+
.section-heading .icon { margin-left: auto; width: 13px; height: 13px; }
|
|
65
|
+
details[open] > summary .icon { transform: rotate(90deg); }
|
|
66
|
+
.row { display: flex; align-items: flex-start; gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--line); }
|
|
67
|
+
.row:last-child { border-bottom: none; }
|
|
68
|
+
.row-content { flex: 1; min-width: 0; }
|
|
69
|
+
.row-label { font-size: 16px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
|
|
70
|
+
.row-value { font-size: 16px; font-weight: 400; line-height: 1.6; margin-top: 4px; color: #263243; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
71
|
+
.row-caption { font-size: 13px; color: #87909D; line-height: 1.6; margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
72
|
+
.status { display: inline-block; font-size: 12px; line-height: 1.5; color: #8893A2; margin-top: 8px; }
|
|
73
|
+
.status.pending { color: #956B40; }
|
|
74
|
+
.status.changed { color: var(--accent); }
|
|
75
|
+
.detail-open { min-height: 38px; width: 26px; background: transparent; color: #9BA5B3; display: grid; place-items: center; padding: 0; flex: none; border-radius: 5px; }
|
|
76
|
+
.detail-open .icon { width: 15px; height: 15px; }
|
|
77
|
+
.timeline .row { position: relative; border: 0; gap: 21px; padding: 9px 0 23px; min-height: 82px; }
|
|
78
|
+
.timeline .time { flex: none; width: 36px; color: #738196; font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.6; padding-top: 3px; overflow-wrap: anywhere; }
|
|
79
|
+
.timeline .row:before { position: absolute; content: ""; left: 45px; top: 19px; bottom: -11px; width: 1px; background: #E2EAF6; }
|
|
80
|
+
.timeline .row:last-child:before { display: none; }
|
|
81
|
+
.timeline .row:after { position: absolute; content: ""; left: 43px; top: 17px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
|
|
82
|
+
.timeline .row-value { margin-top: 0; }
|
|
83
|
+
.cards .row { padding: 16px 0 18px; }
|
|
84
|
+
.cards .row-value { color: #68758A; }
|
|
85
|
+
.ledger .row-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; }
|
|
86
|
+
.ledger .row-label { font-size: 16px; font-weight: 400; }
|
|
87
|
+
.ledger .row-value { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
|
|
88
|
+
.ledger .row-caption, .ledger .status { grid-column: 1 / -1; }
|
|
89
|
+
.checklist .row-value { color: #718098; }
|
|
90
|
+
.note { border-top: 1px solid var(--line); padding-top: 14px; color: #A1A8B2; font-size: 11px; }
|
|
91
|
+
.detail-layer { position: absolute; inset: 0; z-index: 3; background: #17243B45; display: grid; place-items: center; }
|
|
92
|
+
.detail-box { width: calc(100% - 32px); max-height: 65%; overflow-y: auto; padding: 20px; border-radius: 22px; background: #fff; box-shadow: 0 12px 36px #192B4720; }
|
|
93
|
+
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
|
|
94
|
+
.detail-head h3 { flex: 1; font-size: 16px; }
|
|
95
|
+
.detail-text { font-size: 16px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
96
|
+
.detail-foot { color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 14px; }
|
|
97
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
98
|
+
button { transition: color .15s, background .15s; }
|
|
99
|
+
button:active { opacity: .7; }
|
|
100
|
+
.sheet, .detail-box { animation: enter .18s ease-out both; }
|
|
101
|
+
@keyframes enter { from { transform: translateY(6px); opacity: .5; } to { transform: none; opacity: 1; } }
|
|
102
|
+
}
|
|
103
|
+
.svg-export * { animation: none !important; transition: none !important; }
|
|
104
|
+
|
|
105
|
+
/* A calendar, travel slips, a receipt, a packing index and a change log. */
|
|
106
|
+
.calendar-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(55px, 1fr)); gap: 0; margin: 17px -16px 14px; padding: 12px 16px; background: #F0F5FD; }
|
|
107
|
+
.calendar-strip > div { padding: 0 8px; border-left: 1px solid #D6E2F4; min-width: 0; }
|
|
108
|
+
.calendar-strip > div:first-child { padding-left: 0; border-left: none; }
|
|
109
|
+
.calendar-strip span { display: block; color: var(--accent); font-size: 14px; font-weight: 500; }
|
|
110
|
+
.calendar-strip small { display: block; font-size: 11px; line-height: 1.5; margin-top: 5px; color: #8290A4; overflow-wrap: anywhere; }
|
|
111
|
+
.timeline .chat-card { border-top: 3px solid var(--accent); }
|
|
112
|
+
.timeline .overview { padding-bottom: 20px; }
|
|
113
|
+
.timeline .reading-nav { gap: 0; border: 1px solid #E0E9F6; background: #F7FAFE; border-radius: 9px; }
|
|
114
|
+
.timeline .reading-nav button { flex: 1; padding: 10px 14px; display: flex; align-items: center; gap: 8px; font-size: 12px; border-right: 1px solid #E0E9F6; }
|
|
115
|
+
.timeline .reading-nav button:last-child { border-right: none; }
|
|
116
|
+
.timeline .day-number { font-size: 20px; font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; }
|
|
117
|
+
.timeline .reading-nav button[aria-pressed=true] { background: #EAF2FE; }
|
|
118
|
+
.timeline .reading-nav button[aria-pressed=true]:after { left: 13px; right: 13px; }
|
|
119
|
+
.timeline .time { color: var(--accent); }
|
|
120
|
+
.timeline .row { min-height: 90px; }
|
|
121
|
+
|
|
122
|
+
.cards .chat-card { border-style: solid; border-color: #D6E2F2; border-radius: 5px 17px 17px 5px; }
|
|
123
|
+
.cards .card-kind { border-left: 3px solid var(--accent); padding-left: 9px; }
|
|
124
|
+
.booking-reference { display: flex; gap: 13px; align-items: center; border-top: 1px dashed #D3DDEC; margin-top: 16px; padding: 13px 0 5px; }
|
|
125
|
+
.booking-reference span { color: #8390A5; font-size: 12px; border-right: 1px solid #DFE5EF; padding-right: 12px; }
|
|
126
|
+
.booking-reference p { font-size: 16px; }
|
|
127
|
+
.cards .open-sheet { border-top-style: dashed; }
|
|
128
|
+
.cards .sheet-body { background: #F4F7FC; padding-left: 16px; padding-right: 16px; }
|
|
129
|
+
.cards .overview { padding-left: 4px; }
|
|
130
|
+
.cards .reading-nav { background: #F4F7FC; }
|
|
131
|
+
.cards .section { background: #fff; border: 1px solid #DDE5F0; border-radius: 5px 15px 15px 5px; margin-top: 16px; padding: 0 14px; }
|
|
132
|
+
.cards summary.section-heading, .cards h3.section-heading { color: var(--accent); font-size: 14px; font-weight: 500; padding: 12px 0; margin: 0; border-bottom: 1px dashed #D5DEEB; }
|
|
133
|
+
.cards details:not([open]) summary { border-bottom: none; }
|
|
134
|
+
.cards .row { padding: 13px 0; }
|
|
135
|
+
.cards .row-label { font-weight: 500; }
|
|
136
|
+
.cards .row-value { color: #6A788C; }
|
|
137
|
+
.cards .note { border: 0; }
|
|
138
|
+
|
|
139
|
+
.ledger .chat-card { border-radius: 3px; border: 1px solid #DDE4ED; border-top: 3px double var(--accent); }
|
|
140
|
+
.receipt-totals { display: grid; grid-template-columns: repeat(var(--metric-count), minmax(0, 1fr)); gap: 12px; margin: 16px 0 13px; border-block: 1px dashed #CCD7E8; padding: 13px 0; }
|
|
141
|
+
.receipt-totals .metric-value { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
|
|
142
|
+
.receipt-totals .metric:first-child .metric-value { color: var(--accent); }
|
|
143
|
+
.ledger .open-sheet { border-top: 1px dashed #CCD7E8; }
|
|
144
|
+
.ledger .overview { border-bottom: 1px dashed #C4D2E5; padding-bottom: 19px; }
|
|
145
|
+
.ledger .overview-metrics { margin-top: 18px; }
|
|
146
|
+
.ledger .reading-nav { margin-top: 8px; }
|
|
147
|
+
.ledger .section-heading { font-size: 12px; letter-spacing: .5px; color: #7C8EA9; }
|
|
148
|
+
.ledger .row { border-bottom: 1px dashed var(--line); }
|
|
149
|
+
.ledger .row:last-child { border-bottom: 0; }
|
|
150
|
+
.ledger .row-value { color: #234B83; font-variant-numeric: tabular-nums; }
|
|
151
|
+
.ledger .note { border-top-style: dashed; }
|
|
152
|
+
|
|
153
|
+
.checklist .chat-card { border-radius: 14px; background: #F8FAFE; }
|
|
154
|
+
.packing-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0 13px; border-top: 1px solid #DBE4F2; border-left: 1px solid #DBE4F2; }
|
|
155
|
+
.packing-index > div { border-right: 1px solid #DBE4F2; border-bottom: 1px solid #DBE4F2; padding: 10px; }
|
|
156
|
+
.packing-index small { display: block; color: var(--accent); font-size: 11px; }
|
|
157
|
+
.packing-index p { font-size: 16px; line-height: 1.5; margin-top: 5px; overflow-wrap: anywhere; }
|
|
158
|
+
.checklist .overview { position: relative; padding-left: 15px; border-left: 3px solid var(--accent); margin: 22px 0 15px; padding-top: 0; padding-bottom: 0; }
|
|
159
|
+
.checklist .progress-track { height: 3px; }
|
|
160
|
+
.checklist .section { position: relative; min-height: 65px; padding-left: 76px; margin: 24px 0; border-bottom: 1px solid #E3EAF3; padding-bottom: 20px; }
|
|
161
|
+
.checklist .section-heading { position: absolute; left: 0; top: 5px; width: 59px; flex-wrap: wrap; align-content: flex-start; color: var(--accent); font-size: 12px; line-height: 1.7; padding: 0; margin: 0; overflow-wrap: anywhere; }
|
|
162
|
+
.checklist .section-heading .icon { margin: 5px 0 0; width: 12px; height: 12px; }
|
|
163
|
+
.checklist .row { padding-top: 0; }
|
|
164
|
+
.checklist .row-label { font-weight: 500; }
|
|
165
|
+
.checklist .row:last-child { padding-bottom: 0; }
|
|
166
|
+
.checklist .note { border: 0; padding-top: 0; }
|
|
167
|
+
|
|
168
|
+
.changes .chat-card { border-radius: 13px; border-left: 3px solid var(--accent); }
|
|
169
|
+
.change-preview { margin-top: 16px; }
|
|
170
|
+
.change-preview-label { font-size: 12px; color: #7D8CA2; margin-bottom: 9px; }
|
|
171
|
+
.change-pair { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); align-items: stretch; gap: 8px; margin-top: 12px; }
|
|
172
|
+
.change-pair .before, .change-pair .after { padding: 10px; min-width: 0; }
|
|
173
|
+
.change-pair .before { background: #F4F5F7; color: #929AA7; }
|
|
174
|
+
.change-pair .after { background: #EDF3FC; color: #315D9B; border-left: 2px solid #7EAAE5; }
|
|
175
|
+
.change-pair small { font-size: 11px; display: block; margin-bottom: 4px; color: #8896AA; }
|
|
176
|
+
.change-pair p { font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
|
|
177
|
+
.change-arrow { font-size: 13px; color: #A1AEC0; align-self: center; }
|
|
178
|
+
.changes .card-summary { font-size: 16px; margin-top: 14px; }
|
|
179
|
+
.changes .overview { padding-bottom: 17px; border-bottom: 1px solid #E5EAF3; }
|
|
180
|
+
.changes .section { border-left: 2px solid #DCE6F5; padding-left: 13px; }
|
|
181
|
+
.changes .section-heading { color: #7C8FAC; }
|
|
182
|
+
.changes .row { position: relative; padding: 13px 0 20px; }
|
|
183
|
+
.changes .change-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
|
|
184
|
+
.change-time { font-size: 11px; color: #8A98AB; font-variant-numeric: tabular-nums; flex: none; }
|
|
185
|
+
.changes .row-caption { color: #8792A3; }
|
|
186
|
+
.changes .detail-open { position: absolute; right: -5px; bottom: 9px; min-height: 28px; }
|
|
187
|
+
.changes .status { margin-top: 10px; padding-right: 20px; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# 宿主调用协议 · Buddy Creator Skill 1.
|
|
1
|
+
# 宿主调用协议 · Buddy Creator Skill 1.4.0
|
|
2
2
|
|
|
3
|
-
采访始终在宿主主对话中进行。随附程序只负责保存、校验、预览与成果整理;不调用模型、不创建另一个采访 agent。此文件定义 1.
|
|
3
|
+
采访始终在宿主主对话中进行。随附程序只负责保存、校验、预览与成果整理;不调用模型、不创建另一个采访 agent。此文件定义 1.4.0 接口,不能混用旧 Node 0.x 版本的 sessionId、workToken、artifact_confirm 或 source_retry。新增小挂件接口见 [小挂件协议](widgets-protocol.md),不改变原四册计数和确认规则。
|
|
4
4
|
|
|
5
5
|
目标的 summary 和 interview.assessment.summary 仍需准确保存;它们是内容记录与判断结论,不是每轮对外话术模板。delivery.text 可以直接接着原话提问,不必把内部摘要先复述一遍。表达原则和连续示例分别见 [访谈规则](interview.md) 与 [对话示例](dialogue-examples.md)。本次表达调整不改变接口字段、回答计数或确认门槛。
|
|
6
6
|
|
|
@@ -196,18 +196,24 @@ hostResult:
|
|
|
196
196
|
|
|
197
197
|
## 6. 完成与恢复
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
新项目在四册和小挂件设计全部有效确认后,工具尝试生成本地成果;清单、原型和验收流程见 [widgets.md](widgets.md)。四册确认只是进入设计阶段,不能直接退出 Skill。未开启新阶段的旧项目沿用四册完成条件。根据 completion 的真实状态提供 manualPath,不说尚未生成的文件已完成。需要补生成时调用 `{operation:"finalize"}`;读取公开投影可用 `{operation:"snapshot"}`。
|
|
200
200
|
|
|
201
201
|
`open`、`status` 和 `call` 在返回时检查同一份完成状态,不要求宿主靠结束文案猜测下一步:
|
|
202
202
|
|
|
203
203
|
| directive | 条件 | 宿主接下来做什么 |
|
|
204
204
|
| --- | --- | --- |
|
|
205
|
-
| `creator_complete` |
|
|
206
|
-
| `finalize_required` |
|
|
205
|
+
| `creator_complete` | 四册、小挂件清单及各项当前原型和验收有效确认(旧项目沿用原门槛),未暂停、无待处理回合,且全部必需成果和原型资源校验通过 | 核对 `completion.status=ready`,读取 `completion.manualPath`;准确展示尚未展示的交付,然后退出 Skill,在完整创建任务中同一轮自动衔接开发 |
|
|
206
|
+
| `finalize_required` | 全部设计已确认,但当前成果或原型资源缺失、生成失败或被修改 | 保留原确认,原型资源问题先 widget_render 恢复,再 finalize;恢复成功前不进入调用方下一阶段 |
|
|
207
207
|
| 原采访 directive | 尚未满足完成条件 | 按原规则继续、恢复或暂停,不把旧成果当作当前完成状态 |
|
|
208
208
|
|
|
209
209
|
完成检查只读文件,不改写采访记录或生成新版本。恢复已完成的旧项目、重试成功的最后一轮,也会返回 `creator_complete` 和同一份有效手册;不重开采访、不重复创建作品。`delivery` 保留原内容,完成信号不会伪造一轮用户输入或新问题。
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
CLI 创建或其他已授权完整开发的任务中,当前宿主收到有效完成信号后,同一轮重新读取调用方接续说明、完整手册、小挂件说明、原型与验收记录,再检查现有工程并开始实现;只在工程缺失时按调用方说明初始化,复用已有搭子身份。不再询问“是否开始开发”,不只展示成果链接后结束,也不等待一次“继续”。四册确认、原型确认、页面显示“设计完成”或已有 manualPath 都不是单独的开发触发条件。
|
|
212
|
+
|
|
213
|
+
独立创作、仅测试设计流程、用户明确只需要设计或要求暂停时,遵守该范围。后续技术讨论不是 Creator 的 explanation,不再写入 turn_begin/turn_finish;只有影响实现的关键缺口才在开发阶段补问。Skill 负责校验与交付,自动衔接由当前宿主执行,不由 Python 工具自行启动开发、上传或发布。Booklet 页面说明这一交接规则,但没有真实工程进度时不能显示“开发中”或“开发完成”。
|
|
212
214
|
|
|
213
215
|
同一 workspace 再次 open 复用固定预览身份;地址与服务恢复见 [recovery.md](recovery.md)。宿主不得直接编辑 state.json 规避错误、改写旧原话或补造确认。
|
|
216
|
+
|
|
217
|
+
## 7. 小挂件交互设计
|
|
218
|
+
|
|
219
|
+
新项目用 context.widgetDesign 恢复清单、原型和验收进度;delivery.designQuestion 可承载一个设计缺口,不占原采访目标次数。patch.enableWidgetDesign 仅在旧作品明确追加时使用。小挂件三类产物均用 stage=interaction 与 object 确认。字段、两视图三态资源和实际展示要求见 [小挂件协议](widgets-protocol.md)。四册结构仍是 27 章,不更改 catalog。
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# 中断与恢复
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
升级后若返回 PREVIEW_UPGRADE_REQUIRED,旧版预览服务还占用原地址。宿主应核对返回错误所指作品的 preview-server.json、健康端点身份及实际进程后,仅重启这个作品专用的旧服务,再 open 原工作区。不能杀死未知进程、改固定地址或重置面板提醒;重启服务不表示自动重新打开开发者已关闭的面板。
|
|
4
|
+
|
|
5
|
+
此文件说明 Buddy Creator Skill 1.4.0 的 Python 项目恢复范围;不使用旧版 sessionId、workToken、LangGraph 检查点或 Node 启动器。
|
|
4
6
|
|
|
5
7
|
| 情况 | 处理方式 |
|
|
6
8
|
| --- | --- |
|
|
@@ -15,8 +17,9 @@
|
|
|
15
17
|
| 用户换宿主继续 | 使用同一个 workspace;先 open,再读取保存的 delivery、原话和目标。保留 gapId、缺口次数、无新增记录及目标总次数,不重置 |
|
|
16
18
|
| 已收口后主动补充 | 用有本轮原话依据的 interview.resolutions 解决具体缺口并修订;只有明确针对该目标的续谈要求才用 interview.reopen |
|
|
17
19
|
| 所有独立目标均无法推进 | 保存具体缺口及恢复条件,使用 delivery.blocked;不能假装用户暂停或重新盘问耗尽的细节 |
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
+
| 四册已确认、小挂件尚未完成 | 读取 context.widgetDesign.phase,继续当前清单、原型或设计验收,不重开四册 |
|
|
21
|
+
| 全部设计已确认但成果文件生成失败 | 保留确认,处理具体错误后 finalize;原型资源问题先 widget_render 恢复 |
|
|
22
|
+
| 重启时所有必需设计及成果均已完成 | open/status 返回 creator_complete;结束 Skill,按调用方说明继续下一阶段,不重问采访 |
|
|
20
23
|
| 已完成手册缺失、被修改或不对应当前确认版本 | 返回 finalize_required;先恢复真实成果,不直接交给下一阶段 |
|
|
21
24
|
| 手册交付后开始技术讨论 | 退出 Skill,按调用方流程处理;不登记成 Creator 的 explanation 或采访回合 |
|
|
22
25
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# 小挂件协议
|
|
2
|
+
|
|
3
|
+
仍用 host-guide 的 turn_begin → turn_finish → 实际展示 → presentation_record。共用 evidence、dependencies、unresolved 和确切版本确认。全部用户可见文字写“小挂件”。以下字段是宿主内部协议,不交给开发者填表。
|
|
4
|
+
|
|
5
|
+
新建工作区自动写 widgetDesignVersion:1;缺少该字段的旧项目不追加阶段。旧项目明确追加时,turn_finish 的 patch 可含 `enableWidgetDesign:{evidence:[本轮真实inputRef]}`。不能手写状态或批量补造确认。
|
|
6
|
+
|
|
7
|
+
context.widgetDesign.phase 为 booklets / catalog / prototype / acceptance / complete;旧项目为 legacy。stage 仍保持原四册阶段,不能修改 catalog.json 增加第五册。designQuestion 是 delivery 的非空字符串,记录当前一个设计缺口;只有四册已确认且启用新流程时有效,不占 D/K/M/S 等采访计数。question、designQuestion、confirmationObjectIds 三选一;纯 explanation 不携带三者。
|
|
8
|
+
|
|
9
|
+
## 共用产物结构
|
|
10
|
+
|
|
11
|
+
小挂件产物包含 id、stage:"interaction"、kind、title、markdown、data、evidence、dependencies、unresolved。不要传 hash,工具会计算。markdown 需与 data 一致,说明实际设计与待确认内容;unresolved 非空禁止确认。
|
|
12
|
+
|
|
13
|
+
### widget-catalog
|
|
14
|
+
|
|
15
|
+
固定 id=widget.catalog。data 为 `{widgets:[清单项],noWidgetsReason?:非空文本}`。空数组必须有理由并单独展示确认。
|
|
16
|
+
|
|
17
|
+
清单项的字段全部必需:
|
|
18
|
+
|
|
19
|
+
| 字段 | 形状 |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| id | 小写字母开头,后接小写字母/数字/连字符,不重复,最长 40 位 |
|
|
22
|
+
| name / purpose | 名称与具体用途,非空文本 |
|
|
23
|
+
| bookletRefs | 实际使用的已确认章节 Ref 数组(非空) |
|
|
24
|
+
| creationTrigger | 创建与出现在对话中的条件,非空文本 |
|
|
25
|
+
| initialContent | 初始数据与缺项提示,非空文本 |
|
|
26
|
+
| updateRules | 从对话补充/修改后如何更新展示,非空文本 |
|
|
27
|
+
| instancePolicy | 更新已有实例与新建实例的条件,非空文本 |
|
|
28
|
+
| conversationSummary | 对话摘要显示的信息及与展开页关系,非空文本 |
|
|
29
|
+
| fields | 非空数组,每项严格为 `{key,label,source,emptyText}`,四项非空字符串,key 不重复 |
|
|
30
|
+
| readInteractions | 不重复数组,值限 tabs / filter / collapse / detail,可空;对应预设切换、筛选、折叠、只读详情 |
|
|
31
|
+
|
|
32
|
+
清单 dependencies 引用实际使用的章节,至少一个章节 Ref;建议合并各项 bookletRefs。不要自动写入示例项目或默认业务字段。
|
|
33
|
+
|
|
34
|
+
### widget-prototype
|
|
35
|
+
|
|
36
|
+
固定 id=`widget.<清单项id>.prototype`。只能在当前清单有效确认后提交。
|
|
37
|
+
|
|
38
|
+
data 严格为:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
{
|
|
42
|
+
widgetId: 清单项 id,
|
|
43
|
+
itemHash: 从 context.widgetDesign.items 复制的当前单项 hash,
|
|
44
|
+
rendererVersion: 4,
|
|
45
|
+
design: {accent: 六位十六进制颜色, layout: list|cards|timeline|ledger|checklist|changes,
|
|
46
|
+
icon: 固定图标名, conversationTitle: 对话中的搭子名称,
|
|
47
|
+
titleSize: 16到20的整数, screenWidth: 320到500的整数,
|
|
48
|
+
screenHeight: 568到1100的整数},
|
|
49
|
+
states: [initial状态, partial状态, updated状态]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
三态按 initial、partial、updated 顺序。每态严格含 `id,label,userMessage,buddyMessage,summary,overview,sections`,文本均非空。overview 严格含 `eyebrow,title,subtitle,metrics`;metrics 为零到三项的数组,每项严格为 `{label,value}` 非空文本。可选 `overview.progress:{value,max,label}`,value、max 是有限数字(不能是布尔值),max > 0 且 0 ≤ value ≤ max,label 非空;仅在数据支持时使用。概览标题和指标最大 20pt,普通正文仍为 16pt。
|
|
54
|
+
|
|
55
|
+
sections 为非空数组,每项严格含 `id,title,rows`,分组 ID 不重复;rows 非空,每行含 `label,value` 非空文本,可附 `caption`、`icon`、`status`、`detail`。caption/detail 为非空文本,detail 仅在清单允许 detail 时可用。status 严格为 `{label,tone}`,label 非空,tone 限 neutral / pending / positive / changed,表达只读状态。design.icon 和行内 icon 均只能用固定图标:route / ticket / wallet / bag / activity / document / bed / train / coffee / pin / check / clock / info / arrow / chevron / close / signal / battery / plus。根据内容选择图标;不能附加事件或操作。缺项用可理解的提示,不编造数据。用多个 section 展示预设分类或日期;切换/筛选只在已提供分组间选择。
|
|
56
|
+
|
|
57
|
+
版本 4 的 changes 布局允许行带 `change:{before,after}`,两项均为非空文本,且该行必须有 status,tone 限 pending 或 changed。pending 显示原安排与建议调整,changed 显示调整前与调整后;这是只读对照,不允许附加 action、确认或采纳控件。其他布局、早期版本不能带 change。
|
|
58
|
+
|
|
59
|
+
rendererVersion 参与原型版本计算。新建或视觉改版使用 4;旧版 1、2、3 仍按原有模板逐字节渲染和恢复,不自动升级。版本 4 延续 3 的克制配色,增加各类专属卡片预览与展开结构:timeline 日期条、cards 凭条、ledger 账本、checklist 分类索引、changes 前后对照,list 保留普通列表。预览从同一份 states 提取,不生成额外业务事实。版本 3 沿用版本 2 数据结构,预算展示概览指标、物品用一行统计,其余直接进入内容;对话卡片不含指标区。版本 1 的 design 不含 icon/conversationTitle,layout 仅 list/cards/timeline,状态不含 overview,行仅 label/value 和可选 detail。维护已使用的渲染模板时如改变可见样式、交互或 SVG 表达,必须增加版本并要求重绘与重新确认,不能用资源修复悄悄改变旧设计。
|
|
60
|
+
|
|
61
|
+
dependencies 包含这一清单项的全部 bookletRefs,不引用 widget.catalog 整体 hash,以免无关清单变动使所有原型失效。渲染器由清单项读取标题与阅读控件;data 不允许 html、script、action、事件处理器或任意可执行代码。
|
|
62
|
+
|
|
63
|
+
turn_finish 成功提交原型时自动生成工作区 widget-assets/<原型hash>/ 下的 index.html、style.css、app.js,以及 chat-initial.svg、expanded-initial.svg 等六张示意图。Booklet 页面嵌入两视图并提供三态选择,卡片上的去查看可以打开展开页;阅读操作不写业务状态。
|
|
64
|
+
|
|
65
|
+
资源恢复用 `{operation:"widget_render",objectId:"widget.<id>.prototype"}`,只重新生成当前有效设计,不新增回合、不改变确认。只读 status 不自动修复文件。原型 HTML 可用 `?view=chat|expanded&state=initial|partial|updated` 查看具体视图;完整长内容以可滚动 H5 为准,SVG 是首屏示意。版本 2、3、4 的 SVG 使用内嵌 XHTML 与同一套组件样式,需在支持 foreignObject 的浏览器中查看;不要宣称它兼容所有矢量编辑器。
|
|
66
|
+
|
|
67
|
+
### widget-acceptance
|
|
68
|
+
|
|
69
|
+
固定 id=`widget.<清单项id>.acceptance`。当前原型已确认后才可提交。data 严格含 `widgetId,itemHash,prototypeHash,reviews`。prototypeHash 为当前原型 hash。
|
|
70
|
+
|
|
71
|
+
reviews 对象的五个键全部必需,值为非空观察记录:booklet-fit、reading-order、chat-consistency、conversation-update、read-only。分别描述需求覆盖、阅读体验、两视图一致性、数据从对话逐步更新、无输入及业务写操作的证据;不是布尔值打勾。实际问题写 unresolved,不能为通过门槛删除问题。
|
|
72
|
+
|
|
73
|
+
dependencies 保留本项全部 bookletRefs,并加入当前原型的准确 Ref。自动结构/资源检查由工具单独计算,不接受宿主伪造 pass;人工判断通过下一轮开发者真实确认登记。
|
|
74
|
+
|
|
75
|
+
## 确认顺序
|
|
76
|
+
|
|
77
|
+
1. 保存清单,delivery 使用 confirmationObjectIds:["widget.catalog"]、confirmationScope:"object";展示清单内容再登记实际展示。
|
|
78
|
+
2. 开发者回复后用本轮 inputRef 确认清单。可在同一轮生成原型并请求原型确认(这是不同对象)。未确认清单不能提交原型。
|
|
79
|
+
3. 实际打开/展示两视图三态和版本后再登记 presentation_record。开发者下一轮回复可确认原型;不能把清单的“ok”用于原型。
|
|
80
|
+
4. 整理验收记录,请求验收对象确认;原型确认的回复不能替代尚未展示的验收记录。
|
|
81
|
+
5. 所有当前对象有效确认后工具自动生成交付;finalize 不能绕过流程。开发者反馈设计修改时只更新相关产物并展示新版。
|
|
82
|
+
|
|
83
|
+
prototype / acceptance 请求确认与确认入库时都会检查真实原型资源。多个同阶段对象可合并确认,但只涵盖确实展示过且开发者认可的范围。设计讨论与答疑不改原采访计数。
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# 小挂件交互设计与验收
|
|
2
|
+
|
|
3
|
+
四册固定为定义、知识、方法、服务,共 27 章。四册全部有效确认后进入本阶段,不增加第五册,不重开已经完成的采访目标。所有面向开发者的表达统一为“小挂件”;协议字段和工程目录可保留 widget。
|
|
4
|
+
|
|
5
|
+
小挂件是开发者前置确定样式与框架的只读 H5。搭子在真实用户对话中创建实例、逐步补充和更新数据,复用已确认模板,作为对话 UI 的补充。Creator 在本阶段产出的是设计和示例原型,不接通生产数据,也不冒充已上线功能。
|
|
6
|
+
|
|
7
|
+
Booklet 页面集中展示清单、原型、验收与进度,不单独展示共用阅读规范卡片。只读、尺寸、字体等规范由 Skill 和渲染器执行,具体要求保留在本文与验收检查中。
|
|
8
|
+
|
|
9
|
+
## 1. 依据四册提出清单
|
|
10
|
+
|
|
11
|
+
读取四册已确认版本,尤其是核心任务、长期沉淀的内容、方法结果和服务交付。复用 S07 与 service.blueprint 中的 experienceMode、customComponentDescription;已说清的功能不重新询问。选择 conversation 也不能自动跳过本阶段;仍需提出有依据的建议,让开发者明确确认需要哪些小挂件,或明确不需要。
|
|
12
|
+
|
|
13
|
+
按阅读任务归类,避免每个内容字段都拆成一个小挂件,也不要套用固定的饮食或计划示例。每项说明:
|
|
14
|
+
|
|
15
|
+
- 名称、用途、对应 Booklet 章节;为什么需要集中展示。
|
|
16
|
+
- 何时创建、何时在对话里展示;首次生成时有哪些数据,哪些缺项需提示。
|
|
17
|
+
- H5 展示字段、数据来源、对话逐步补充和更新规则。
|
|
18
|
+
- 同一内容何时更新原实例、何时新建实例;摘要卡片与展开页如何同步。
|
|
19
|
+
- 可用的阅读操作及其作用;开发者可以补充、删除、合并或调整建议。
|
|
20
|
+
|
|
21
|
+
保存清单为 widget.catalog,在 Booklet 页面展示说明,主对话留下一个清单确认请求。没有明确回复不能视为确认。开发者确认不需要时,保存 widgets:[] 和实际 noWidgetsReason,同样先展示、再凭真实回复确认;不得因为未回应就跳过。
|
|
22
|
+
|
|
23
|
+
## 2. 清单确认后形成原型
|
|
24
|
+
|
|
25
|
+
以清单中各项的 itemHash 为版本依据,生成对应小挂件原型。新原型使用 rendererVersion:4,由随附渲染器输出,不要求开发者填写 JSON 或编写 H5。原型中的例子须来自已知需求或明确标成示例,不冒充真实用户数据。
|
|
26
|
+
|
|
27
|
+
先确定每项的阅读重点,再选择版式。不同小挂件保留共同的色彩与字体,但要在对话卡片和展开页形成可辨认的结构差异,不只换标题、图标或颜色:
|
|
28
|
+
|
|
29
|
+
| 阅读任务 / 布局 | 对话卡片 | 展开页 |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| 按日期阅读安排 / timeline | 日期预览条 | 编号日期导航与时间轴 |
|
|
32
|
+
| 核对独立事项 / cards | 关键事项与状态摘要 | 分组凭条或事项单,说明与主信息分开 |
|
|
33
|
+
| 看金额与明细 / ledger | 关键金额与预算口径 | 账本式金额对齐、分隔线和有依据的比例 |
|
|
34
|
+
| 按成员或类别找物品 / checklist | 分类索引 | 左侧分类,右侧物品与只读准备状态 |
|
|
35
|
+
| 看建议或变更前后 / changes | 一条明确标记状态的前后对照 | 变更前后并列,附时间、依据和待确认/生效状态 |
|
|
36
|
+
| 无以上特征的资料 / list | 简洁主题与摘要 | 普通分组列表 |
|
|
37
|
+
|
|
38
|
+
布局依实际任务选择,不将旅行案例内容套入其他搭子。changes 的 before/after 必须有原型内容依据;建议仍标待确认,不用视觉对照冒充已生效。交付前并排比较各项卡片与展开页:去掉标题后是否仍能看出阅读任务差异。若仍难分辨,先调整信息组织,而非堆叠装饰。
|
|
39
|
+
|
|
40
|
+
同一搭子使用一致的强调色、圆角和留白。默认用白底与单一强调色,依据开发者偏好调整;不要用渐变、图标底座、胶囊标签和阴影堆出设计感。展开页先呈现主题与必要背景,随后进入分组内容;预算可保留关键金额,其他任务不强行套三列指标。对话卡片以类型、主题、任务预览、简短摘要和轻量查看入口为主,不给所有类型都附加同一套指标。导航使用清楚的选中标识;状态优先直接写在内容旁,句子已经表达的状态不再重复加标签。待补充、估算、已核实、已更新须有实际依据。比例条只用于有明确数值和分母的场景,不为装饰编造进度。图标与准备状态仅供阅读,不能像待勾选的控件。
|
|
41
|
+
|
|
42
|
+
每个小挂件须展示:
|
|
43
|
+
|
|
44
|
+
1. **对话中的样式**:保留触发它的用户消息、搭子回复、摘要卡片、标题、关键信息、“去查看”入口。卡片跟随对话列宽度;摘要与展开页引用同一份数据。
|
|
45
|
+
2. **展开后的样式**:在对话背景上拉起带遮罩的圆角 H5 页,固定关闭与标题区,内容区纵向滚动;保留必要阅读导航。
|
|
46
|
+
3. **三种数据状态**:initial 首次生成(缺项可理解)、partial 逐步补充、updated 对话修改后的新内容。每态都有两视图;对话消息须说明数据怎么变来,不能用小挂件里的“保存/修改”触发。
|
|
47
|
+
|
|
48
|
+
视觉参考:用户提供的两张示意图分别代表“对话摘要卡片”和“展开阅读浮层”。保留两层关系、清晰标题、适当留白和内容分组。饮食内容、绿色、叶子装饰是参考案例,不是每个搭子的必选样式。技能包不依赖原作者本机的附件路径。
|
|
49
|
+
|
|
50
|
+
绘制前查看随包参考:[对话摘要卡片](../assets/widget-reference/conversation.png)、[展开阅读浮层](../assets/widget-reference/expanded.png)。图片中的内容只作视觉参考,不能写成当前项目默认数据。
|
|
51
|
+
|
|
52
|
+
### 统一只读边界
|
|
53
|
+
|
|
54
|
+
允许:预设条件筛选、日期/分类/标签切换、展开折叠、滚动/翻页、拉起和关闭只读详情浮层。这些操作只改变本地阅读视图,不修改任何业务数据;嵌套浮层同样遵守。
|
|
55
|
+
|
|
56
|
+
禁止:输入框(包括自由文本搜索)、表单、富文本编辑、添加/删除/替换记录、保存/提交、打卡/勾选完成、评分和其他业务写入。不得把写操作包装成筛选或确认按钮。需要修改时用提示“如需修改内容,请回到对话中告诉搭子”;由用户在对话中提出 → 搭子更新数据 → 原小挂件和摘要同步呈现。该提示不是自动发送消息的按钮。
|
|
57
|
+
|
|
58
|
+
Booklet 上的示例状态切换是开发者审阅工具,与真实用户 H5 的能力分开。Booklet 本身仍只读,所有创作确认在主对话登记。
|
|
59
|
+
|
|
60
|
+
### 尺寸与字体
|
|
61
|
+
|
|
62
|
+
采用屏幕逻辑尺寸;网页按 viewport 的 CSS px 与逻辑 pt 一一对齐,不按物理像素或 devicePixelRatio 再放大:
|
|
63
|
+
|
|
64
|
+
- 展开页宽度 = 屏幕宽度 − 32pt,左右各 16pt。
|
|
65
|
+
- 展开页高度 = 屏幕高度 × 65%,内容超出时在内部上下滚动。
|
|
66
|
+
- 标题建议 16pt / Medium,最大不超过 20pt;正文 16pt / Regular。
|
|
67
|
+
- 393 × 852 的示例画布对应 361 × 553.8 的展开页(图示可标约 554)。标题和关闭保持可见,正文不能被遮挡。
|
|
68
|
+
|
|
69
|
+
本版渲染器固定上述尺寸与字体约束,提供六类布局、任务相关的卡片预览、概览指标、前后对照、比例条与预设阅读控件。检查三态的空缺提示、长文本、摘要密度与类型辨识度,不能只检查信息最完整的一态。若需求超出当前原型能表达的范围,保留 unresolved,说明具体缺口并继续调整;不能把没有实际绘制的复杂图表或交互说成已实现。生产 H5 的文件封装和数据协议在后续工程阶段按平台实际约定实现。
|
|
70
|
+
|
|
71
|
+
在 Booklet 页面检查实际生成的 HTML 两视图三态及 SVG 示意图后,展示确切版本并请求原型确认。生成成功或自动检查通过不代表开发者已看过;只登记真实展示。开发者反馈修改时生成新版,重新展示受影响的小挂件;不要连带重做四册和其他未变化原型。
|
|
72
|
+
|
|
73
|
+
## 3. 设计验收与完成条件
|
|
74
|
+
|
|
75
|
+
原型有效确认后,整理逐项验收记录,写明检查现象和依据,不只写“通过”。页面分开展示:
|
|
76
|
+
|
|
77
|
+
| 检查类型 | 要求 |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| 自动检查 | 清单与数据结构、只读控件集合、逻辑尺寸与字体约束、两视图三态资源是否存在且与当前版本一致 |
|
|
80
|
+
| 需求与内容 | 是否覆盖 Booklet 中真正需要集中展示的内容,初始缺项是否清楚 |
|
|
81
|
+
| 阅读体验 | 分组、层级、长文本、滚动、折叠和详情是否易读;操作后能返回上下文 |
|
|
82
|
+
| 对话一致性 | 卡片与展开页含义一致,三态示例清楚展示逐步补充和修改结果 |
|
|
83
|
+
| 只读边界 | 小挂件及所有详情层没有输入、编辑、提交、打卡等业务动作;修改路径在对话中 |
|
|
84
|
+
|
|
85
|
+
将后三类及相关观察写入 widget-acceptance 的 reviews,未解决的问题留 unresolved。宿主自动检查不能替代开发者体验判断。先在页面和主对话展示验收记录,再根据开发者下一条真实回复确认该版本。发现问题回到原型修改,原验收随原型依赖失效;同一轮不能修改和确认同一对象。
|
|
86
|
+
|
|
87
|
+
新项目只有四册、当前清单、各项当前原型和验收都有效确认,原型资源和导出文件完整且校验一致,未暂停、没有待完成回合,才返回 creator_complete。已明确确认空清单时不制造多余原型或验收。四册在这之前可随时查看,页面不得称整个创作已完成。
|
|
88
|
+
|
|
89
|
+
交付包含 BUDDY_MANUAL.md、四册、服务模式图、WIDGET_DESIGN.md、widgets/catalog.json、各项原型数据、可阅读 HTML/CSS/JS、两视图三态 SVG、设计验收及来源/版本记录。设计验收通过不等于生产 H5 注册、会话数据接入或端到端功能验收通过。
|
|
90
|
+
|
|
91
|
+
## 4. 版本、恢复和面板
|
|
92
|
+
|
|
93
|
+
- context.widgetDesign 提供 phase、当前清单、每项 itemHash、原型、确认状态、验收和资源检查。按此恢复当前步骤,不重问全套内容。Booklet 内容版本独立使用 bookletRevision;主对话多了一条原话不代表四册变更。
|
|
94
|
+
- 原型按单个 itemHash 绑定清单项,不依赖整张清单 hash。清单变化先确认清单;未变的项保留原确认,变了的项需要新原型及验收。原型仍绑定实际使用的章节,Booklet 变化需重审相应设计;纯视觉调整不撤销四册。
|
|
95
|
+
- 没有 widgetDesignVersion 的旧作品沿用原流程,读取或升级不自动追加本阶段。开发者明确要求追加后,通过 enableWidgetDesign 和本轮原话证据开启,不直接编辑 state.json,也不能关闭新项目必需流程。
|
|
96
|
+
- 原型文件缺失或被改动时先 widget_render 重新生成同一声明版本,保留原话和确认,再 finalize;导出缺失用 finalize 恢复。若设计本身要变,提交新原型,不使用修复命令偷换已确认设计。
|
|
97
|
+
- 所有阶段沿用 [一次性面板提醒](preview-panel.md)。是否需要重开以真实界面查询为准,不因进入小挂件阶段重置提醒资格。未回应或拒绝后不再询问。
|
|
98
|
+
|
|
99
|
+
详细字段及调用顺序见 [小挂件协议](widgets-protocol.md)。
|