@hybridlabor-api/aos 4.0.2 → 4.2.0-beta.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.
Files changed (31) hide show
  1. package/.agents/agents.md +77 -0
  2. package/.agents/graph.md +43 -0
  3. package/.agents/state.schema.json +6 -0
  4. package/.claude/agents/database-reviewer.md +109 -0
  5. package/.claude/agents/go-build-resolver.md +112 -0
  6. package/.claude/agents/opensource-forker.md +216 -0
  7. package/.claude/agents/opensource-sanitizer.md +206 -0
  8. package/.claude/agents/security-reviewer.md +126 -0
  9. package/.claude/agents/silent-failure-hunter.md +68 -0
  10. package/.claude/workflows/startcycle-dispatch.mjs +126 -8
  11. package/CLAUDE.md +62 -0
  12. package/GEMINI.md +9 -1
  13. package/README.md +12 -19
  14. package/THIRD_PARTY_NOTICES.md +133 -0
  15. package/package.json +4 -2
  16. package/skills/basic/bdbmediastorm/SKILL.md +7 -1
  17. package/skills/basic/startcycle/SKILL.md +21 -0
  18. package/skills/basic/startcycle-graph/SKILL.md +27 -7
  19. package/skills/basic/startcycle-graph-user/SKILL.md +65 -11
  20. package/skills/bdbrainstorm/SKILL.md +1 -0
  21. package/skills/global_config/plan-canvas/SKILL.md +233 -0
  22. package/skills/global_config/plan-canvas/scripts/lib/loopback-guard.js +59 -0
  23. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/markdown.js +301 -0
  24. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/sdk.js +239 -0
  25. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/server.js +636 -0
  26. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/sessions.js +271 -0
  27. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/ui.js +630 -0
  28. package/skills/global_config/plan-canvas/scripts/plan-canvas.js +419 -0
  29. package/docs/sessions/AUDIT-HANDOVER-2026-08-28.md +0 -169
  30. package/docs/sessions/BDB_REMOTEOS_MCP_HANDOVER.md +0 -130
  31. package/docs/sessions/SESSION-HANDOVER-v3.13.md +0 -249
@@ -0,0 +1,239 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Plan Canvas artifact SDK — the script injected into the reviewed artifact.
5
+ *
6
+ * The artifact runs in a sandboxed iframe without allow-same-origin, so this
7
+ * script can only talk to the chrome via postMessage. It renders all of its
8
+ * own UI inside a shadow root so it never annotates itself and never leaks
9
+ * styles into the artifact.
10
+ *
11
+ * Source: affaan-m/ECC — MIT, see THIRD_PARTY_NOTICES.md
12
+ */
13
+
14
+ function artifactSdkJs() {
15
+ return `'use strict';
16
+ (() => {
17
+ if (window.parent === window) return; // only meaningful inside the canvas
18
+ if (window.__eccPlanCanvasSdk) return;
19
+ window.__eccPlanCanvasSdk = true;
20
+
21
+ let annotate = true;
22
+ let card = null;
23
+
24
+ const post = msg => window.parent.postMessage(msg, '*');
25
+
26
+ // --- shadow-root UI host --------------------------------------------
27
+ const host = document.createElement('div');
28
+ host.setAttribute('data-ecc-plan-canvas', 'ui');
29
+ host.style.cssText = 'position:absolute;top:0;left:0;width:0;height:0;z-index:2147483647';
30
+ const root = host.attachShadow({ mode: 'open' });
31
+ root.innerHTML = \`
32
+ <style>
33
+ :host{all:initial}
34
+ .hl{position:fixed;pointer-events:none;border:1.5px solid #6885e8;background:rgba(104,133,232,0.12);border-radius:4px;display:none;z-index:2147483646;transition:all .06s ease-out}
35
+ .selhint{position:absolute;display:none;z-index:2147483647;background:#101218;color:#dfe2e9;border:1px solid #272c3e;border-radius:6px;padding:4px 10px;font:600 11.5px -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;cursor:pointer;box-shadow:0 8px 32px rgba(0,0,0,0.6)}
36
+ .selhint:hover{border-color:#6885e8}
37
+ .card{position:absolute;display:none;z-index:2147483647;width:300px;background:#101218;border:1px solid #272c3e;border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,0.6);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#dfe2e9}
38
+ .card h4{margin:0;padding:10px 12px 0;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:#80859a}
39
+ .card .snippet{padding:4px 12px 0;font:10.5px 'SF Mono','Fira Code',monospace;color:#4acbbe;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
40
+ .card textarea{display:block;width:calc(100% - 24px);margin:8px 12px;min-height:56px;resize:vertical;background:#13161e;border:1px solid #1d2130;border-radius:6px;color:#dfe2e9;font:12.5px -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;padding:7px 9px;outline:none;box-sizing:border-box}
41
+ .card textarea:focus{border-color:#6885e8}
42
+ .card .row{display:flex;justify-content:flex-end;gap:8px;padding:0 12px 12px}
43
+ .card button{border-radius:6px;font:600 11.5px -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;padding:5px 12px;cursor:pointer}
44
+ .card .cancel{background:none;border:1px solid #1d2130;color:#80859a}
45
+ .card .cancel:hover{color:#dfe2e9;border-color:#272c3e}
46
+ .card .queue{background:#6885e8;border:1px solid #6885e8;color:#fff}
47
+ .card .queue:hover{background:#3d5ab8}
48
+ .card .keys{padding:0 12px 10px;font-size:9.5px;color:#4c5168}
49
+ </style>
50
+ <div class="hl"></div>
51
+ <button class="selhint" type="button">Annotate selection</button>
52
+ <div class="card">
53
+ <h4></h4>
54
+ <div class="snippet"></div>
55
+ <textarea placeholder="What should change here?"></textarea>
56
+ <div class="row">
57
+ <button class="cancel" type="button">Cancel</button>
58
+ <button class="queue" type="button">Queue</button>
59
+ </div>
60
+ <div class="keys">Enter to queue &middot; Cmd/Ctrl+Enter to queue &amp; send</div>
61
+ </div>\`;
62
+ const attach = () => document.body ? document.body.appendChild(host) : null;
63
+ if (document.body) attach();
64
+ else document.addEventListener('DOMContentLoaded', attach);
65
+
66
+ const hl = root.querySelector('.hl');
67
+ const selhint = root.querySelector('.selhint');
68
+ const cardEl = root.querySelector('.card');
69
+ const cardTitle = cardEl.querySelector('h4');
70
+ const cardSnippet = cardEl.querySelector('.snippet');
71
+ const cardText = cardEl.querySelector('textarea');
72
+
73
+ // --- selectors & context ---------------------------------------------
74
+ const esc = v => (window.CSS && CSS.escape) ? CSS.escape(v) : v.replace(/[^a-zA-Z0-9_-]/g, '\\\\$&');
75
+ function selectorFor(el) {
76
+ const parts = [];
77
+ let node = el;
78
+ for (let depth = 0; node && node.nodeType === 1 && depth < 6; depth++) {
79
+ if (node.id) { parts.unshift('#' + esc(node.id)); return parts.join(' > '); }
80
+ const tag = node.tagName.toLowerCase();
81
+ if (tag === 'body' || tag === 'html') { parts.unshift(tag); break; }
82
+ let nth = 1;
83
+ let sib = node;
84
+ while ((sib = sib.previousElementSibling)) if (sib.tagName === node.tagName) nth++;
85
+ parts.unshift(tag + ':nth-of-type(' + nth + ')');
86
+ node = node.parentElement;
87
+ }
88
+ return parts.join(' > ');
89
+ }
90
+ function snippetFor(el) {
91
+ return (el.innerText || el.textContent || '').replace(/\\s+/g, ' ').trim().slice(0, 200);
92
+ }
93
+ const INTERACTIVE = new Set(['button', 'input', 'select', 'textarea', 'option', 'label', 'summary', 'a']);
94
+ function isInteractive(el) {
95
+ let node = el;
96
+ while (node && node.nodeType === 1) {
97
+ if (INTERACTIVE.has(node.tagName.toLowerCase()) || node.isContentEditable) return true;
98
+ node = node.parentElement;
99
+ }
100
+ return false;
101
+ }
102
+ const isOurs = el => el === host || host.contains(el);
103
+
104
+ // --- annotation card ---------------------------------------------------
105
+ function openCard(target) {
106
+ card = target;
107
+ cardTitle.textContent = target.kindLabel;
108
+ cardSnippet.textContent = target.anchor.snippet || target.anchor.selector;
109
+ cardText.value = '';
110
+ cardEl.style.display = 'block';
111
+ const x = Math.min(target.x, window.innerWidth - 320) + window.scrollX;
112
+ const y = target.y + 12 + window.scrollY;
113
+ cardEl.style.left = Math.max(8, x) + 'px';
114
+ cardEl.style.top = y + 'px';
115
+ cardText.focus();
116
+ }
117
+ function closeCard() {
118
+ card = null;
119
+ cardEl.style.display = 'none';
120
+ }
121
+ function queueCard(sendNow) {
122
+ if (!card) return;
123
+ const text = cardText.value.trim();
124
+ if (!text) { cardText.focus(); return; }
125
+ post({
126
+ type: sendNow ? 'pc:queue-and-send' : 'pc:queue',
127
+ item: { kind: 'annotation', text, anchor: card.anchor }
128
+ });
129
+ closeCard();
130
+ }
131
+ cardEl.querySelector('.cancel').addEventListener('click', closeCard);
132
+ cardEl.querySelector('.queue').addEventListener('click', () => queueCard(false));
133
+ cardText.addEventListener('keydown', e => {
134
+ if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) { e.preventDefault(); queueCard(true); }
135
+ else if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); queueCard(false); }
136
+ else if (e.key === 'Escape') closeCard();
137
+ });
138
+
139
+ // --- element hover / click ---------------------------------------------
140
+ document.addEventListener('mousemove', e => {
141
+ if (!annotate || card) { hl.style.display = 'none'; return; }
142
+ const el = e.target;
143
+ if (!el || isOurs(el) || el === document.body || el === document.documentElement || isInteractive(el)) {
144
+ hl.style.display = 'none';
145
+ return;
146
+ }
147
+ const rect = el.getBoundingClientRect();
148
+ hl.style.display = 'block';
149
+ hl.style.left = rect.left - 2 + 'px';
150
+ hl.style.top = rect.top - 2 + 'px';
151
+ hl.style.width = rect.width + 'px';
152
+ hl.style.height = rect.height + 'px';
153
+ }, true);
154
+
155
+ document.addEventListener('click', e => {
156
+ if (!annotate) return;
157
+ const el = e.target;
158
+ if (isOurs(el)) return;
159
+ if (card) { if (!cardEl.contains(e.composedPath()[0])) closeCard(); return; }
160
+ if (isInteractive(el)) return; // let controls behave natively
161
+ const selection = window.getSelection();
162
+ if (selection && !selection.isCollapsed) return; // handled by selection flow
163
+ if (el === document.body || el === document.documentElement) return;
164
+ e.preventDefault();
165
+ e.stopPropagation();
166
+ hl.style.display = 'none';
167
+ openCard({
168
+ kindLabel: 'Annotate <' + el.tagName.toLowerCase() + '>',
169
+ anchor: { selector: selectorFor(el), tag: el.tagName.toLowerCase(), snippet: snippetFor(el) },
170
+ x: e.clientX,
171
+ y: e.clientY
172
+ });
173
+ }, true);
174
+
175
+ // --- text selection -------------------------------------------------------
176
+ document.addEventListener('mouseup', e => {
177
+ if (!annotate || card || isOurs(e.target)) return;
178
+ setTimeout(() => {
179
+ const selection = window.getSelection();
180
+ const text = selection ? String(selection).replace(/\\s+/g, ' ').trim() : '';
181
+ if (!text || !selection.rangeCount) { selhint.style.display = 'none'; return; }
182
+ const rect = selection.getRangeAt(0).getBoundingClientRect();
183
+ selhint.style.display = 'block';
184
+ selhint.style.left = rect.left + window.scrollX + 'px';
185
+ selhint.style.top = rect.bottom + 6 + window.scrollY + 'px';
186
+ selhint.onclick = () => {
187
+ selhint.style.display = 'none';
188
+ const anchorNode = selection.anchorNode;
189
+ const el = anchorNode && anchorNode.nodeType === 1 ? anchorNode : anchorNode && anchorNode.parentElement;
190
+ openCard({
191
+ kindLabel: 'Annotate selection',
192
+ anchor: {
193
+ selector: el ? selectorFor(el) : 'body',
194
+ tag: 'text',
195
+ snippet: text.slice(0, 200),
196
+ textRange: { text: text.slice(0, 1000) }
197
+ },
198
+ x: rect.left,
199
+ y: rect.bottom
200
+ });
201
+ };
202
+ }, 0);
203
+ }, true);
204
+ document.addEventListener('selectionchange', () => {
205
+ const selection = window.getSelection();
206
+ if (!selection || selection.isCollapsed) selhint.style.display = 'none';
207
+ });
208
+
209
+ // --- chrome bridge ---------------------------------------------------------
210
+ window.addEventListener('message', e => {
211
+ const msg = e.data || {};
212
+ if (msg.type === 'pc:set-mode') {
213
+ annotate = Boolean(msg.annotate);
214
+ if (!annotate) { hl.style.display = 'none'; selhint.style.display = 'none'; closeCard(); }
215
+ } else if (msg.type === 'pc:restore-scroll') {
216
+ window.scrollTo(msg.x || 0, msg.y || 0);
217
+ }
218
+ });
219
+ document.addEventListener('keydown', e => {
220
+ if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'i') {
221
+ e.preventDefault();
222
+ post({ type: 'pc:toggle-mode' });
223
+ } else if (e.key === 'Escape' && card) closeCard();
224
+ }, true);
225
+
226
+ let scrollTimer = null;
227
+ window.addEventListener('scroll', () => {
228
+ if (scrollTimer) return;
229
+ scrollTimer = setTimeout(() => {
230
+ scrollTimer = null;
231
+ post({ type: 'pc:scroll', x: window.scrollX, y: window.scrollY });
232
+ }, 150);
233
+ }, { passive: true });
234
+
235
+ post({ type: 'pc:ready' });
236
+ })();`;
237
+ }
238
+
239
+ module.exports = { artifactSdkJs };