teamshare-bridge 0.26.23 → 0.26.24

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 (81) hide show
  1. package/README.md +383 -383
  2. package/dist/bridge/install-verify.js +8 -8
  3. package/dist/lib/agent-scope.js +10 -10
  4. package/dist/lib/browser/browse-llm.js +44 -44
  5. package/dist/lib/browser/human-input-guard.js +106 -106
  6. package/dist/lib/browser/login.js +141 -141
  7. package/dist/lib/browser/otp.js +72 -72
  8. package/dist/lib/browser/page-context.js +592 -592
  9. package/dist/lib/browser/page-events.js +91 -91
  10. package/dist/lib/browser/refs.js +264 -264
  11. package/dist/lib/browser/screen-change.js +79 -79
  12. package/dist/lib/human-style.js +32 -32
  13. package/dist/lib/llm/usage-reader.js +4 -4
  14. package/dist/lib/orchestrator/worktree.js +118 -50
  15. package/dist/lib/orchestrator/worktree.js.map +1 -1
  16. package/dist/lib/workspace/mirror.d.ts +13 -0
  17. package/dist/lib/workspace/mirror.js +200 -43
  18. package/dist/lib/workspace/mirror.js.map +1 -1
  19. package/dist/lib/workspace/workspace-audit.d.ts +2 -2
  20. package/dist/lib/workspace/workspace-audit.js +27 -17
  21. package/dist/lib/workspace/workspace-audit.js.map +1 -1
  22. package/package.json +1 -1
  23. package/skills/THIRD_PARTY_NOTICES.md +26 -26
  24. package/skills/architect/LICENSE +21 -21
  25. package/skills/codebase-design/LICENSE +21 -21
  26. package/skills/diagnosing-bugs/LICENSE +21 -21
  27. package/skills/domain-modeling/LICENSE +21 -21
  28. package/skills/improve-codebase-architecture/LICENSE +21 -21
  29. package/skills/recover/LICENSE +21 -21
  30. package/skills/review/LICENSE +21 -21
  31. package/skills/tdd/LICENSE +21 -21
  32. package/skills/teamshare-auth-rbac/SKILL.md +78 -78
  33. package/skills/teamshare-cdd/SKILL.md +215 -215
  34. package/skills/teamshare-modularity/SKILL.md +146 -146
  35. package/skills/teamshare-orchestrator-ask/SKILL.md +77 -77
  36. package/skills/teamshare-scaffold/SKILL.md +116 -116
  37. package/templates/backend/.env.example.tpl +13 -13
  38. package/templates/backend/nest-cli.json.tpl +8 -8
  39. package/templates/backend/package.json.tpl +41 -41
  40. package/templates/backend/prisma/schema.prisma.tpl +39 -39
  41. package/templates/backend/src/app.module.ts.tpl +24 -24
  42. package/templates/backend/src/common/filters/all-exceptions.filter.ts.tpl +59 -59
  43. package/templates/backend/src/common/guards/jwt-auth.guard.ts.tpl +27 -27
  44. package/templates/backend/src/common/guards/rbac.guard.ts.tpl +48 -48
  45. package/templates/backend/src/common/interceptors/transform.interceptor.ts.tpl +44 -44
  46. package/templates/backend/src/common/pipes/zod-validation.pipe.ts.tpl +29 -29
  47. package/templates/backend/src/common/swagger/envelope.schemas.ts.tpl +53 -53
  48. package/templates/backend/src/common/swagger/error.schemas.ts.tpl +62 -62
  49. package/templates/backend/src/main.ts.tpl +27 -27
  50. package/templates/backend/src/modules/example/example.controller.ts.tpl +102 -102
  51. package/templates/backend/src/modules/example/example.dto.ts.tpl +14 -14
  52. package/templates/backend/src/modules/example/example.module.ts.tpl +10 -10
  53. package/templates/backend/src/modules/example/example.service.ts.tpl +45 -45
  54. package/templates/backend/tsconfig.json.tpl +26 -26
  55. package/templates/common/.gitignore.tpl +42 -42
  56. package/templates/common/AGENTS.md.tpl +58 -58
  57. package/templates/common/docs/adr/README.md +25 -25
  58. package/templates/common/docs/api-contract.md.tpl +72 -72
  59. package/templates/web/next.config.ts.tpl +7 -7
  60. package/templates/web/package.json.tpl +37 -37
  61. package/templates/web/src/app/globals.css.tpl +48 -48
  62. package/templates/web/src/app/layout.tsx.tpl +25 -25
  63. package/templates/web/src/components/shared/app-button.tsx.tpl +59 -59
  64. package/templates/web/src/components/shared/app-empty-state.tsx.tpl +39 -39
  65. package/templates/web/src/components/shared/app-list-toolbar.tsx.tpl +63 -63
  66. package/templates/web/src/components/shared/app-skeleton.tsx.tpl +14 -14
  67. package/templates/web/src/components/shared/app-table.tsx.tpl +128 -128
  68. package/templates/web/src/components/shared/index.ts.tpl +5 -5
  69. package/templates/web/src/hooks/use-list-state.ts.tpl +72 -72
  70. package/templates/web/src/hooks/use-url-tab.ts.tpl +25 -25
  71. package/templates/web/src/lib/api/client.ts.tpl +123 -123
  72. package/templates/web/src/lib/providers.tsx.tpl +35 -35
  73. package/templates/web/src/lib/query-keys.ts.tpl +21 -21
  74. package/templates/web/src/lib/utils.ts.tpl +7 -7
  75. package/templates/web/src/lib/validation/schemas.ts.tpl +15 -15
  76. package/templates/web/src/modules/example/views/example-list-view.tsx.tpl +97 -97
  77. package/templates/web/tsconfig.json.tpl +23 -23
  78. package/tools/workspace-arbitration-check.mjs +359 -359
  79. package/dist/lib/git/ensure-excludes.d.ts +0 -5
  80. package/dist/lib/git/ensure-excludes.js +0 -55
  81. package/dist/lib/git/ensure-excludes.js.map +0 -1
@@ -32,97 +32,97 @@ exports.PAGE_EVENT_LIMIT = 80;
32
32
  * gate found in another injected script).
33
33
  */
34
34
  function buildPageEventScript() {
35
- return `
36
- (() => {
37
- if (window.__tsEventInstalled) return 'already';
38
- window.__tsEventInstalled = true;
39
- const MAX = ${exports.PAGE_EVENT_LIMIT};
40
- const events = [];
41
- window.__tsPageEvents = events;
42
- const clean = (v) => String(v == null ? '' : v).replace(/\\s+/g, ' ').trim().slice(0, 500);
43
- const now = () => Date.now();
44
- const vis = (el) => {
45
- if (!el || el.nodeType !== 1) return false;
46
- const r = el.getBoundingClientRect();
47
- if (r.width === 0 || r.height === 0) return false;
48
- const cs = getComputedStyle(el);
49
- return cs.visibility !== 'hidden' && cs.display !== 'none' && cs.opacity !== '0';
50
- };
51
- const push = (type, text, extra) => {
52
- const t = clean(text);
53
- if (!t || t.length < 2) return;
54
- const last = events[events.length - 1];
55
- if (last && last.type === type && last.text === t && now() - last.at < 1200) return;
56
- const row = { type: type, text: t, at: now() };
57
- if (extra) { if (extra.role) row.role = extra.role; if (extra.count != null) row.count = extra.count; }
58
- events.push(row);
59
- if (events.length > MAX) events.splice(0, events.length - MAX);
60
- };
61
- const TOAST_SEL = '[role="alert"],[role="status"],[aria-live],[data-sonner-toast],' +
62
- '[class*="toast"],[class*="Toast"],[class*="snackbar"],[class*="Snackbar"],' +
63
- '[class*="notification"],[class*="Notification"],[class*="alert"],[class*="Alert"],' +
64
- '[class*="banner"],[class*="Banner"]';
65
- const kindOf = (el) => {
66
- const role = String((el.getAttribute && el.getAttribute('role')) || '').toLowerCase();
67
- const cls = String((el.className && typeof el.className === 'string') ? el.className : '') + ' ' + String(el.id || '');
68
- const live = String((el.getAttribute && el.getAttribute('aria-live')) || '').toLowerCase();
69
- if (role === 'alert' || /error|danger|invalid/i.test(cls)) return 'error';
70
- if (/toast|snackbar|notification/i.test(cls)) return 'toast';
71
- if (role === 'status' || live === 'polite' || live === 'assertive') return 'status';
72
- if (/alert|banner/i.test(cls)) return 'alert';
73
- return null;
74
- };
75
- const record = (el) => {
76
- if (!el || el.nodeType !== 1 || !vis(el)) return;
77
- // A container that holds a nested toast should not be recorded as a
78
- // second, duplicate event; use the deepest matching node.
79
- const nested = el.querySelector && el.querySelector(TOAST_SEL);
80
- if (nested && nested !== el) return;
81
- const kind = kindOf(el);
82
- if (!kind) return;
83
- const text = el.innerText || el.textContent || el.getAttribute('aria-label') || '';
84
- push(kind, text, { role: String((el.getAttribute && el.getAttribute('role')) || '') });
85
- };
86
- const scan = (root) => {
87
- if (!root || root.nodeType !== 1) return;
88
- if (root.matches && root.matches(TOAST_SEL)) record(root);
89
- if (root.querySelectorAll) {
90
- const nodes = root.querySelectorAll(TOAST_SEL);
91
- for (let i = 0; i < nodes.length && i < 12; i++) record(nodes[i]);
92
- }
93
- };
94
- const dialogs = () => [...document.querySelectorAll('dialog[open],[role="dialog"],[aria-modal="true"]')].filter(vis);
95
- let dialogCount = dialogs().length;
96
- const topDialogText = () => {
97
- const list = dialogs();
98
- const el = list[list.length - 1];
99
- return el ? clean(el.innerText || el.textContent || '') : '';
100
- };
101
- const obs = new MutationObserver((mutations) => {
102
- for (const m of mutations) {
103
- if (m.type === 'childList') {
104
- for (const n of m.addedNodes) if (n && n.nodeType === 1) scan(n);
105
- } else if (m.type === 'characterData') {
106
- const p = m.target && m.target.parentElement;
107
- if (p) scan(p);
108
- }
109
- }
110
- const count = dialogs().length;
111
- if (count !== dialogCount) {
112
- if (count > 0) push('dialog', topDialogText(), { count: count });
113
- else push('dialog-closed', 'dialog closed', { count: 0 });
114
- dialogCount = count;
115
- }
116
- });
117
- const root = document.documentElement || document.body;
118
- if (root) {
119
- obs.observe(root, { childList: true, subtree: true, characterData: true });
120
- // Record anything already on screen once (a login modal that opened
121
- // before this script ran).
122
- scan(document.body || root);
123
- }
124
- return 'ok';
125
- })()
35
+ return `
36
+ (() => {
37
+ if (window.__tsEventInstalled) return 'already';
38
+ window.__tsEventInstalled = true;
39
+ const MAX = ${exports.PAGE_EVENT_LIMIT};
40
+ const events = [];
41
+ window.__tsPageEvents = events;
42
+ const clean = (v) => String(v == null ? '' : v).replace(/\\s+/g, ' ').trim().slice(0, 500);
43
+ const now = () => Date.now();
44
+ const vis = (el) => {
45
+ if (!el || el.nodeType !== 1) return false;
46
+ const r = el.getBoundingClientRect();
47
+ if (r.width === 0 || r.height === 0) return false;
48
+ const cs = getComputedStyle(el);
49
+ return cs.visibility !== 'hidden' && cs.display !== 'none' && cs.opacity !== '0';
50
+ };
51
+ const push = (type, text, extra) => {
52
+ const t = clean(text);
53
+ if (!t || t.length < 2) return;
54
+ const last = events[events.length - 1];
55
+ if (last && last.type === type && last.text === t && now() - last.at < 1200) return;
56
+ const row = { type: type, text: t, at: now() };
57
+ if (extra) { if (extra.role) row.role = extra.role; if (extra.count != null) row.count = extra.count; }
58
+ events.push(row);
59
+ if (events.length > MAX) events.splice(0, events.length - MAX);
60
+ };
61
+ const TOAST_SEL = '[role="alert"],[role="status"],[aria-live],[data-sonner-toast],' +
62
+ '[class*="toast"],[class*="Toast"],[class*="snackbar"],[class*="Snackbar"],' +
63
+ '[class*="notification"],[class*="Notification"],[class*="alert"],[class*="Alert"],' +
64
+ '[class*="banner"],[class*="Banner"]';
65
+ const kindOf = (el) => {
66
+ const role = String((el.getAttribute && el.getAttribute('role')) || '').toLowerCase();
67
+ const cls = String((el.className && typeof el.className === 'string') ? el.className : '') + ' ' + String(el.id || '');
68
+ const live = String((el.getAttribute && el.getAttribute('aria-live')) || '').toLowerCase();
69
+ if (role === 'alert' || /error|danger|invalid/i.test(cls)) return 'error';
70
+ if (/toast|snackbar|notification/i.test(cls)) return 'toast';
71
+ if (role === 'status' || live === 'polite' || live === 'assertive') return 'status';
72
+ if (/alert|banner/i.test(cls)) return 'alert';
73
+ return null;
74
+ };
75
+ const record = (el) => {
76
+ if (!el || el.nodeType !== 1 || !vis(el)) return;
77
+ // A container that holds a nested toast should not be recorded as a
78
+ // second, duplicate event; use the deepest matching node.
79
+ const nested = el.querySelector && el.querySelector(TOAST_SEL);
80
+ if (nested && nested !== el) return;
81
+ const kind = kindOf(el);
82
+ if (!kind) return;
83
+ const text = el.innerText || el.textContent || el.getAttribute('aria-label') || '';
84
+ push(kind, text, { role: String((el.getAttribute && el.getAttribute('role')) || '') });
85
+ };
86
+ const scan = (root) => {
87
+ if (!root || root.nodeType !== 1) return;
88
+ if (root.matches && root.matches(TOAST_SEL)) record(root);
89
+ if (root.querySelectorAll) {
90
+ const nodes = root.querySelectorAll(TOAST_SEL);
91
+ for (let i = 0; i < nodes.length && i < 12; i++) record(nodes[i]);
92
+ }
93
+ };
94
+ const dialogs = () => [...document.querySelectorAll('dialog[open],[role="dialog"],[aria-modal="true"]')].filter(vis);
95
+ let dialogCount = dialogs().length;
96
+ const topDialogText = () => {
97
+ const list = dialogs();
98
+ const el = list[list.length - 1];
99
+ return el ? clean(el.innerText || el.textContent || '') : '';
100
+ };
101
+ const obs = new MutationObserver((mutations) => {
102
+ for (const m of mutations) {
103
+ if (m.type === 'childList') {
104
+ for (const n of m.addedNodes) if (n && n.nodeType === 1) scan(n);
105
+ } else if (m.type === 'characterData') {
106
+ const p = m.target && m.target.parentElement;
107
+ if (p) scan(p);
108
+ }
109
+ }
110
+ const count = dialogs().length;
111
+ if (count !== dialogCount) {
112
+ if (count > 0) push('dialog', topDialogText(), { count: count });
113
+ else push('dialog-closed', 'dialog closed', { count: 0 });
114
+ dialogCount = count;
115
+ }
116
+ });
117
+ const root = document.documentElement || document.body;
118
+ if (root) {
119
+ obs.observe(root, { childList: true, subtree: true, characterData: true });
120
+ // Record anything already on screen once (a login modal that opened
121
+ // before this script ran).
122
+ scan(document.body || root);
123
+ }
124
+ return 'ok';
125
+ })()
126
126
  `;
127
127
  }
128
128
  //# sourceMappingURL=page-events.js.map