teamshare-bridge 0.26.22 → 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 (130) hide show
  1. package/README.md +383 -383
  2. package/dist/bridge/daemon.js +32 -0
  3. package/dist/bridge/daemon.js.map +1 -1
  4. package/dist/bridge/install-verify.js +8 -8
  5. package/dist/cli/commands/blog.js +31 -16
  6. package/dist/cli/commands/blog.js.map +1 -1
  7. package/dist/cli/commands/build.js +2 -2
  8. package/dist/cli/commands/build.js.map +1 -1
  9. package/dist/cli/commands/chat.js +2 -3
  10. package/dist/cli/commands/chat.js.map +1 -1
  11. package/dist/cli/commands/cleanup.js +98 -27
  12. package/dist/cli/commands/cleanup.js.map +1 -1
  13. package/dist/cli/commands/plan.d.ts +4 -0
  14. package/dist/cli/commands/plan.js +33 -10
  15. package/dist/cli/commands/plan.js.map +1 -1
  16. package/dist/cli/commands/planner.js +15 -5
  17. package/dist/cli/commands/planner.js.map +1 -1
  18. package/dist/cli/commands/research.js +26 -20
  19. package/dist/cli/commands/research.js.map +1 -1
  20. package/dist/cli/commands/run.js +2 -5
  21. package/dist/cli/commands/run.js.map +1 -1
  22. package/dist/cli/commands/worker.js +2 -3
  23. package/dist/cli/commands/worker.js.map +1 -1
  24. package/dist/cli/index.js +2 -0
  25. package/dist/cli/index.js.map +1 -1
  26. package/dist/lib/agent-scope.js +10 -10
  27. package/dist/lib/browser/browse-llm.js +44 -44
  28. package/dist/lib/browser/human-input-guard.js +106 -106
  29. package/dist/lib/browser/login.js +141 -141
  30. package/dist/lib/browser/otp.js +72 -72
  31. package/dist/lib/browser/page-context.js +592 -592
  32. package/dist/lib/browser/page-events.js +91 -91
  33. package/dist/lib/browser/refs.js +264 -264
  34. package/dist/lib/browser/screen-change.js +79 -79
  35. package/dist/lib/cache-cleaner.js +226 -205
  36. package/dist/lib/cache-cleaner.js.map +1 -1
  37. package/dist/lib/git/git-auto.js +46 -4
  38. package/dist/lib/git/git-auto.js.map +1 -1
  39. package/dist/lib/git/git-core.d.ts +11 -0
  40. package/dist/lib/git/git-core.js +14 -0
  41. package/dist/lib/git/git-core.js.map +1 -1
  42. package/dist/lib/git/git-finalize.d.ts +4 -0
  43. package/dist/lib/git/git-finalize.js +46 -10
  44. package/dist/lib/git/git-finalize.js.map +1 -1
  45. package/dist/lib/git/git-runner.js +2 -5
  46. package/dist/lib/git/git-runner.js.map +1 -1
  47. package/dist/lib/git/index.d.ts +2 -1
  48. package/dist/lib/git/index.js +5 -4
  49. package/dist/lib/git/index.js.map +1 -1
  50. package/dist/lib/git/pr-token.d.ts +29 -0
  51. package/dist/lib/git/pr-token.js +102 -0
  52. package/dist/lib/git/pr-token.js.map +1 -0
  53. package/dist/lib/harness/run-scope.d.ts +23 -4
  54. package/dist/lib/harness/run-scope.js +237 -48
  55. package/dist/lib/harness/run-scope.js.map +1 -1
  56. package/dist/lib/human-style.js +32 -32
  57. package/dist/lib/llm/usage-reader.js +6 -5
  58. package/dist/lib/llm/usage-reader.js.map +1 -1
  59. package/dist/lib/orchestrator/worktree.d.ts +7 -1
  60. package/dist/lib/orchestrator/worktree.js +136 -51
  61. package/dist/lib/orchestrator/worktree.js.map +1 -1
  62. package/dist/lib/workspace/mirror.d.ts +13 -0
  63. package/dist/lib/workspace/mirror.js +251 -48
  64. package/dist/lib/workspace/mirror.js.map +1 -1
  65. package/dist/lib/workspace/state-root.d.ts +44 -0
  66. package/dist/lib/workspace/state-root.js +266 -0
  67. package/dist/lib/workspace/state-root.js.map +1 -0
  68. package/dist/lib/workspace/workspace-audit.d.ts +20 -0
  69. package/dist/lib/workspace/workspace-audit.js +349 -0
  70. package/dist/lib/workspace/workspace-audit.js.map +1 -0
  71. package/package.json +1 -1
  72. package/skills/THIRD_PARTY_NOTICES.md +26 -26
  73. package/skills/architect/LICENSE +21 -21
  74. package/skills/codebase-design/LICENSE +21 -21
  75. package/skills/diagnosing-bugs/LICENSE +21 -21
  76. package/skills/domain-modeling/LICENSE +21 -21
  77. package/skills/improve-codebase-architecture/LICENSE +21 -21
  78. package/skills/recover/LICENSE +21 -21
  79. package/skills/review/LICENSE +21 -21
  80. package/skills/tdd/LICENSE +21 -21
  81. package/skills/teamshare-auth-rbac/SKILL.md +78 -78
  82. package/skills/teamshare-cdd/SKILL.md +215 -215
  83. package/skills/teamshare-modularity/SKILL.md +146 -146
  84. package/skills/teamshare-orchestrator-ask/SKILL.md +77 -77
  85. package/skills/teamshare-scaffold/SKILL.md +116 -116
  86. package/templates/backend/.env.example.tpl +13 -13
  87. package/templates/backend/nest-cli.json.tpl +8 -8
  88. package/templates/backend/package.json.tpl +41 -41
  89. package/templates/backend/prisma/schema.prisma.tpl +39 -39
  90. package/templates/backend/src/app.module.ts.tpl +24 -24
  91. package/templates/backend/src/common/filters/all-exceptions.filter.ts.tpl +59 -59
  92. package/templates/backend/src/common/guards/jwt-auth.guard.ts.tpl +27 -27
  93. package/templates/backend/src/common/guards/rbac.guard.ts.tpl +48 -48
  94. package/templates/backend/src/common/interceptors/transform.interceptor.ts.tpl +44 -44
  95. package/templates/backend/src/common/pipes/zod-validation.pipe.ts.tpl +29 -29
  96. package/templates/backend/src/common/swagger/envelope.schemas.ts.tpl +53 -53
  97. package/templates/backend/src/common/swagger/error.schemas.ts.tpl +62 -62
  98. package/templates/backend/src/main.ts.tpl +27 -27
  99. package/templates/backend/src/modules/example/example.controller.ts.tpl +102 -102
  100. package/templates/backend/src/modules/example/example.dto.ts.tpl +14 -14
  101. package/templates/backend/src/modules/example/example.module.ts.tpl +10 -10
  102. package/templates/backend/src/modules/example/example.service.ts.tpl +45 -45
  103. package/templates/backend/tsconfig.json.tpl +26 -26
  104. package/templates/common/.gitignore.tpl +42 -42
  105. package/templates/common/AGENTS.md.tpl +58 -58
  106. package/templates/common/docs/adr/README.md +25 -25
  107. package/templates/common/docs/api-contract.md.tpl +72 -72
  108. package/templates/web/next.config.ts.tpl +7 -7
  109. package/templates/web/package.json.tpl +37 -37
  110. package/templates/web/src/app/globals.css.tpl +48 -48
  111. package/templates/web/src/app/layout.tsx.tpl +25 -25
  112. package/templates/web/src/components/shared/app-button.tsx.tpl +59 -59
  113. package/templates/web/src/components/shared/app-empty-state.tsx.tpl +39 -39
  114. package/templates/web/src/components/shared/app-list-toolbar.tsx.tpl +63 -63
  115. package/templates/web/src/components/shared/app-skeleton.tsx.tpl +14 -14
  116. package/templates/web/src/components/shared/app-table.tsx.tpl +128 -128
  117. package/templates/web/src/components/shared/index.ts.tpl +5 -5
  118. package/templates/web/src/hooks/use-list-state.ts.tpl +72 -72
  119. package/templates/web/src/hooks/use-url-tab.ts.tpl +25 -25
  120. package/templates/web/src/lib/api/client.ts.tpl +123 -123
  121. package/templates/web/src/lib/providers.tsx.tpl +35 -35
  122. package/templates/web/src/lib/query-keys.ts.tpl +21 -21
  123. package/templates/web/src/lib/utils.ts.tpl +7 -7
  124. package/templates/web/src/lib/validation/schemas.ts.tpl +15 -15
  125. package/templates/web/src/modules/example/views/example-list-view.tsx.tpl +97 -97
  126. package/templates/web/tsconfig.json.tpl +23 -23
  127. package/tools/workspace-arbitration-check.mjs +359 -359
  128. package/dist/lib/git/ensure-excludes.d.ts +0 -5
  129. package/dist/lib/git/ensure-excludes.js +0 -55
  130. package/dist/lib/git/ensure-excludes.js.map +0 -1
@@ -67,85 +67,85 @@ function isMainFrameNavigation(params) {
67
67
  * signal exactly like a full load. The debug browser's settle waits on it.
68
68
  */
69
69
  function buildObserverScript() {
70
- return `
71
- (() => {
72
- const KEY = Symbol('__ts_obs');
73
- if (window[KEY]) return 'already attached';
74
- const IGNORE = /timer|countdown|elapsed|clock|animation|animate|transition|spinner|progress|loading|toast|notification|alert|banner|snackbar|cookie|consent|modal|overlay|popup|tooltip|badge|tag|avatar|icon|svg|img|video|audio|canvas|font|stylesheet|script|meta|link|head/i;
75
- const observerChangeScore = ${observerChangeScore.toString()};
76
- let timer = null;
77
- let lastText = '';
78
- function getText() {
79
- const els = document.querySelectorAll('input[type="radio"],input[type="checkbox"],input[type="text"],input[type="email"],input[type="password"],textarea,label,button');
80
- return [...els].map(e => {
81
- const t = (e.innerText || e.textContent || '').trim().replace(/\\s+/g, ' ').slice(0, 200);
82
- return e.type + '|' + t + '|' + (e.checked || false);
83
- }).join('\\n');
84
- }
85
- function check() {
86
- try {
87
- const curr = getText();
88
- if (curr === lastText) return;
89
- const prev = lastText;
90
- lastText = curr;
91
- if (observerChangeScore(prev, curr) >= ${exports.SCREEN_CHANGE_THRESHOLD}) {
92
- window[KEY].changed = Date.now();
93
- }
94
- } catch {}
95
- }
96
- function stampUrl() {
97
- try {
98
- const href = location.href;
99
- if (window[KEY].url !== href) {
100
- window[KEY].url = href;
101
- window[KEY].urlAt = Date.now();
102
- }
103
- } catch {}
104
- }
105
- const obs = new MutationObserver((mutations) => {
106
- let hasRelevant = false;
107
- for (const m of mutations) {
108
- if (m.target instanceof Element) {
109
- const tag = m.target.tagName;
110
- if (tag === 'SCRIPT' || tag === 'STYLE' || tag === 'HEAD') continue;
111
- const cls = m.target.className || '';
112
- if (typeof cls === 'string' && IGNORE.test(cls)) continue;
113
- const id = m.target.id || '';
114
- if (IGNORE.test(id)) continue;
115
- if (m.type === 'characterData' && m.target.parentElement) {
116
- const ptag = m.target.parentElement.tagName;
117
- if (ptag === 'SCRIPT' || ptag === 'STYLE') continue;
118
- }
119
- }
120
- hasRelevant = true;
121
- }
122
- if (hasRelevant) {
123
- // Raw "something relevant changed" stamp, set immediately (no
124
- // debounce, no score gate). Used to verify that a click had ANY
125
- // effect, including a selection that scores below the material
126
- // threshold - without waiting for a full question swap.
127
- window[KEY].mutated = Date.now();
128
- clearTimeout(timer);
129
- timer = setTimeout(check, 500);
130
- }
131
- });
132
- lastText = getText();
133
- window[KEY] = { observer: obs, changed: 0, mutated: 0, url: location.href, urlAt: 0, navAt: 0 };
134
- // String-addressable alias for OTHER injected scripts (the debug
135
- // browser's waitFor reads it; a Symbol is not reachable by name).
136
- window.__tsScreenObs = window[KEY];
137
- try {
138
- const origPush = history.pushState.bind(history);
139
- const origReplace = history.replaceState.bind(history);
140
- history.pushState = function () { const r = origPush(...arguments); stampUrl(); return r; };
141
- history.replaceState = function () { const r = origReplace(...arguments); stampUrl(); return r; };
142
- window.addEventListener('popstate', stampUrl);
143
- } catch {}
144
- obs.observe(document.body || document.documentElement, {
145
- childList: true, subtree: true, characterData: true
146
- });
147
- return 'ok';
148
- })()
70
+ return `
71
+ (() => {
72
+ const KEY = Symbol('__ts_obs');
73
+ if (window[KEY]) return 'already attached';
74
+ const IGNORE = /timer|countdown|elapsed|clock|animation|animate|transition|spinner|progress|loading|toast|notification|alert|banner|snackbar|cookie|consent|modal|overlay|popup|tooltip|badge|tag|avatar|icon|svg|img|video|audio|canvas|font|stylesheet|script|meta|link|head/i;
75
+ const observerChangeScore = ${observerChangeScore.toString()};
76
+ let timer = null;
77
+ let lastText = '';
78
+ function getText() {
79
+ const els = document.querySelectorAll('input[type="radio"],input[type="checkbox"],input[type="text"],input[type="email"],input[type="password"],textarea,label,button');
80
+ return [...els].map(e => {
81
+ const t = (e.innerText || e.textContent || '').trim().replace(/\\s+/g, ' ').slice(0, 200);
82
+ return e.type + '|' + t + '|' + (e.checked || false);
83
+ }).join('\\n');
84
+ }
85
+ function check() {
86
+ try {
87
+ const curr = getText();
88
+ if (curr === lastText) return;
89
+ const prev = lastText;
90
+ lastText = curr;
91
+ if (observerChangeScore(prev, curr) >= ${exports.SCREEN_CHANGE_THRESHOLD}) {
92
+ window[KEY].changed = Date.now();
93
+ }
94
+ } catch {}
95
+ }
96
+ function stampUrl() {
97
+ try {
98
+ const href = location.href;
99
+ if (window[KEY].url !== href) {
100
+ window[KEY].url = href;
101
+ window[KEY].urlAt = Date.now();
102
+ }
103
+ } catch {}
104
+ }
105
+ const obs = new MutationObserver((mutations) => {
106
+ let hasRelevant = false;
107
+ for (const m of mutations) {
108
+ if (m.target instanceof Element) {
109
+ const tag = m.target.tagName;
110
+ if (tag === 'SCRIPT' || tag === 'STYLE' || tag === 'HEAD') continue;
111
+ const cls = m.target.className || '';
112
+ if (typeof cls === 'string' && IGNORE.test(cls)) continue;
113
+ const id = m.target.id || '';
114
+ if (IGNORE.test(id)) continue;
115
+ if (m.type === 'characterData' && m.target.parentElement) {
116
+ const ptag = m.target.parentElement.tagName;
117
+ if (ptag === 'SCRIPT' || ptag === 'STYLE') continue;
118
+ }
119
+ }
120
+ hasRelevant = true;
121
+ }
122
+ if (hasRelevant) {
123
+ // Raw "something relevant changed" stamp, set immediately (no
124
+ // debounce, no score gate). Used to verify that a click had ANY
125
+ // effect, including a selection that scores below the material
126
+ // threshold - without waiting for a full question swap.
127
+ window[KEY].mutated = Date.now();
128
+ clearTimeout(timer);
129
+ timer = setTimeout(check, 500);
130
+ }
131
+ });
132
+ lastText = getText();
133
+ window[KEY] = { observer: obs, changed: 0, mutated: 0, url: location.href, urlAt: 0, navAt: 0 };
134
+ // String-addressable alias for OTHER injected scripts (the debug
135
+ // browser's waitFor reads it; a Symbol is not reachable by name).
136
+ window.__tsScreenObs = window[KEY];
137
+ try {
138
+ const origPush = history.pushState.bind(history);
139
+ const origReplace = history.replaceState.bind(history);
140
+ history.pushState = function () { const r = origPush(...arguments); stampUrl(); return r; };
141
+ history.replaceState = function () { const r = origReplace(...arguments); stampUrl(); return r; };
142
+ window.addEventListener('popstate', stampUrl);
143
+ } catch {}
144
+ obs.observe(document.body || document.documentElement, {
145
+ childList: true, subtree: true, characterData: true
146
+ });
147
+ return 'ok';
148
+ })()
149
149
  `;
150
150
  }
151
151
  //# sourceMappingURL=screen-change.js.map