teamshare-bridge 0.22.6 → 0.22.7
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 +383 -383
- package/dist/bridge/install-verify.js +8 -8
- package/dist/lib/browser/human-input-guard.js +98 -98
- package/dist/lib/browser/screen-change.js +60 -60
- package/dist/lib/llm/usage-reader.js +4 -4
- package/package.json +70 -70
- package/skills/THIRD_PARTY_NOTICES.md +26 -26
- package/skills/architect/LICENSE +21 -21
- package/skills/codebase-design/LICENSE +21 -21
- package/skills/diagnosing-bugs/LICENSE +21 -21
- package/skills/domain-modeling/LICENSE +21 -21
- package/skills/improve-codebase-architecture/LICENSE +21 -21
- package/skills/recover/LICENSE +21 -21
- package/skills/review/LICENSE +21 -21
- package/skills/tdd/LICENSE +21 -21
- package/skills/teamshare-auth-rbac/SKILL.md +78 -78
- package/skills/teamshare-cdd/SKILL.md +205 -205
- package/skills/teamshare-modularity/SKILL.md +146 -146
- package/skills/teamshare-orchestrator-ask/SKILL.md +77 -77
- package/skills/teamshare-scaffold/SKILL.md +116 -116
- package/templates/backend/.env.example.tpl +13 -13
- package/templates/backend/nest-cli.json.tpl +8 -8
- package/templates/backend/package.json.tpl +41 -41
- package/templates/backend/prisma/schema.prisma.tpl +39 -39
- package/templates/backend/src/app.module.ts.tpl +24 -24
- package/templates/backend/src/common/filters/all-exceptions.filter.ts.tpl +59 -59
- package/templates/backend/src/common/guards/jwt-auth.guard.ts.tpl +27 -27
- package/templates/backend/src/common/guards/rbac.guard.ts.tpl +48 -48
- package/templates/backend/src/common/interceptors/transform.interceptor.ts.tpl +44 -44
- package/templates/backend/src/common/pipes/zod-validation.pipe.ts.tpl +29 -29
- package/templates/backend/src/common/swagger/envelope.schemas.ts.tpl +53 -53
- package/templates/backend/src/common/swagger/error.schemas.ts.tpl +62 -62
- package/templates/backend/src/main.ts.tpl +27 -27
- package/templates/backend/src/modules/example/example.controller.ts.tpl +102 -102
- package/templates/backend/src/modules/example/example.dto.ts.tpl +14 -14
- package/templates/backend/src/modules/example/example.module.ts.tpl +10 -10
- package/templates/backend/src/modules/example/example.service.ts.tpl +45 -45
- package/templates/backend/tsconfig.json.tpl +26 -26
- package/templates/common/.gitignore.tpl +42 -42
- package/templates/common/AGENTS.md.tpl +58 -58
- package/templates/common/docs/adr/README.md +25 -25
- package/templates/common/docs/api-contract.md.tpl +72 -72
- package/templates/web/next.config.ts.tpl +7 -7
- package/templates/web/package.json.tpl +37 -37
- package/templates/web/src/app/globals.css.tpl +48 -48
- package/templates/web/src/app/layout.tsx.tpl +25 -25
- package/templates/web/src/components/shared/app-button.tsx.tpl +59 -59
- package/templates/web/src/components/shared/app-empty-state.tsx.tpl +39 -39
- package/templates/web/src/components/shared/app-list-toolbar.tsx.tpl +63 -63
- package/templates/web/src/components/shared/app-skeleton.tsx.tpl +14 -14
- package/templates/web/src/components/shared/app-table.tsx.tpl +128 -128
- package/templates/web/src/components/shared/index.ts.tpl +5 -5
- package/templates/web/src/hooks/use-list-state.ts.tpl +72 -72
- package/templates/web/src/hooks/use-url-tab.ts.tpl +25 -25
- package/templates/web/src/lib/api/client.ts.tpl +123 -123
- package/templates/web/src/lib/providers.tsx.tpl +35 -35
- package/templates/web/src/lib/query-keys.ts.tpl +21 -21
- package/templates/web/src/lib/utils.ts.tpl +7 -7
- package/templates/web/src/lib/validation/schemas.ts.tpl +15 -15
- package/templates/web/src/modules/example/views/example-list-view.tsx.tpl +97 -97
- package/templates/web/tsconfig.json.tpl +23 -23
- package/tools/workspace-arbitration-check.mjs +389 -389
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Matt Pocock
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matt Pocock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Matt Pocock
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matt Pocock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Matt Pocock
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matt Pocock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Matt Pocock
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matt Pocock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/skills/recover/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 JavaScript Mastery
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 JavaScript Mastery
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/skills/review/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 JavaScript Mastery
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 JavaScript Mastery
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/skills/tdd/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Matt Pocock
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matt Pocock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: teamshare-auth-rbac
|
|
3
|
-
description: TeamShare auth & authorization rules for every endpoint you write or change. Pick the correct guard stack (@Permissions for human-only, @Public + AgentsDualAuthGuard + @ApiKeyScopes for agent+human surfaces, @Public for truly public, ApiKeyGuard + canUseTool for MCP). Enforce capability + key scope + project access (never less than two layers). Use envelope + zod validation + UPPER_SNAKE error codes, and write AgentLog rows for every agent action.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# TeamShare Auth & Authorization (RBAC)
|
|
7
|
-
|
|
8
|
-
Every endpoint in `teamshare-backend` must declare its access story. Use this
|
|
9
|
-
decision table; never leave an endpoint with default guards and no metadata.
|
|
10
|
-
|
|
11
|
-
## 1. Choose the guard stack
|
|
12
|
-
|
|
13
|
-
| Who calls it | What to use on the route |
|
|
14
|
-
|---|---|
|
|
15
|
-
| Human JWT only (company/team/env-var/roles/webhooks/invitations/attachments) | Leave global guards, add `@Permissions('<entity>.<action>')` (e.g. `document.create`) |
|
|
16
|
-
| Agents AND humans (tasks, comments, chat, documents, search, projects, agents self-service) | Class-level `@Public()` + `@UseGuards(AgentsDualAuthGuard)` + per-route `@ApiKeyScopes('<entity>:read' \| '<entity>:write')` |
|
|
17
|
-
| Truly public (auth, verify, reset, billing webhook, run-token redeem) | `@Public()` only |
|
|
18
|
-
| MCP tools (`/mcp`) | `ApiKeyGuard` + per-tool `canUseTool(capabilities, keyScopes, required)` |
|
|
19
|
-
|
|
20
|
-
`AgentsDualAuthGuard` accepts `X-Api-Key` (enforces `@ApiKeyScopes`) OR a
|
|
21
|
-
`Bearer` JWT. **Do not combine `@Permissions` with `AgentsDualAuthGuard` on the
|
|
22
|
-
same route** — global RbacGuard runs before the route guard can set
|
|
23
|
-
`request.user` for key callers. Dual-auth routes delegate access to the
|
|
24
|
-
service layer.
|
|
25
|
-
|
|
26
|
-
## 2. The three enforcement layers (never less than two)
|
|
27
|
-
|
|
28
|
-
For every agent action: **capability** (`Agent.capabilities`) + **API-key
|
|
29
|
-
scope** (`@ApiKeyScopes`, minted by `scopesForCapabilities`) + **project
|
|
30
|
-
access** (`assertProjectAccess`). Never gate access on env vars.
|
|
31
|
-
|
|
32
|
-
- MCP tool → `ctx.canUse('<capability>')` (capability + scope) then the shared
|
|
33
|
-
service runs `assertProjectAccess` as the agent user.
|
|
34
|
-
- Agent REST → `@ApiKeyScopes` (scope) then the service runs
|
|
35
|
-
`assertProjectAccess` (project role).
|
|
36
|
-
- Service layer helpers: `assertProjectAccess(prisma, projectId, userId,
|
|
37
|
-
minRole)`, `assertCompanyMembership`, `isCompanyOwnerOrAdmin`.
|
|
38
|
-
|
|
39
|
-
## 3. Permission vocabulary (CRUDL)
|
|
40
|
-
|
|
41
|
-
- `src/common/constants/rbac.ts`: `ENTITIES` (17) × `ACTIONS`
|
|
42
|
-
(`create | read | list | update | delete`) → `Permission = entity.action`
|
|
43
|
-
plus `SPECIAL_PERMISSIONS` (`env_var.reveal`, `env_var.export`, ...).
|
|
44
|
-
- Static role matrices: `COMPANY_ROLE_PERMISSIONS`
|
|
45
|
-
(owner/admin/member/secret_manager/viewer) and `PROJECT_ROLE_PERMISSIONS`
|
|
46
|
-
(owner/member/viewer). Dynamic roles add `companyPermissions` claims.
|
|
47
|
-
- Agent capabilities live in `src/common/constants/enums.ts`
|
|
48
|
-
(`AGENT_CAPABILITIES`, `CAPABILITY_SCOPES`). A key never exceeds its
|
|
49
|
-
agent's capabilities and a capability never exceeds the key's scopes.
|
|
50
|
-
- Add a new capability → add its scope in `API_KEY_SCOPES` + a mapping in
|
|
51
|
-
`CAPABILITY_SCOPES`, so `scopesForCapabilities` mints the right key.
|
|
52
|
-
|
|
53
|
-
## 4. Error codes & envelope
|
|
54
|
-
|
|
55
|
-
- Throw `new XxxException({ code: 'UPPER_SNAKE', message, details? })`
|
|
56
|
-
(`VALIDATION_ERROR`, `PROJECT_NOT_FOUND`, `INSUFFICIENT_PROJECT_ROLE`,
|
|
57
|
-
`API_KEY_SCOPE_MISSING`, `DOCUMENT_UPDATE_DENIED`, ...). Secrets never
|
|
58
|
-
appear in messages/logs.
|
|
59
|
-
- Responses: `{ success: true, data, pagination? }` /
|
|
60
|
-
`{ success: false, error: { code, message, details? } }` (global
|
|
61
|
-
interceptor/filter — your handler returns raw data).
|
|
62
|
-
|
|
63
|
-
## 5. AgentLog — never bypass
|
|
64
|
-
|
|
65
|
-
Every agent mutation logs an `AgentLog` row via the shared services:
|
|
66
|
-
`logAgentActionIfAgent(prisma, userId, { action, taskId?, detail })`
|
|
67
|
-
(best-effort; humans skipped). Actions are in `AGENT_LOG_ACTIONS`
|
|
68
|
-
(`task_created`, `comment_created`, `document_created`, `document_updated`,
|
|
69
|
-
`subtask_updated`, `wake_sent`, ...). If you add an agent-facing mutation,
|
|
70
|
-
wire the log in the service — never in the controller.
|
|
71
|
-
|
|
72
|
-
## 6. Checklist for a new endpoint
|
|
73
|
-
|
|
74
|
-
- [ ] Guard stack chosen from the table; metadata declared on the route.
|
|
75
|
-
- [ ] zod `ZodValidationPipe` on body/query/param; generated zod for enums.
|
|
76
|
-
- [ ] Service re-checks project/company access (guards are a first filter).
|
|
77
|
-
- [ ] Envelope-compliant return; UPPER_SNAKE error codes.
|
|
78
|
-
- [ ] Agent actions write `AgentLog` via `logAgentActionIfAgent`.
|
|
1
|
+
---
|
|
2
|
+
name: teamshare-auth-rbac
|
|
3
|
+
description: TeamShare auth & authorization rules for every endpoint you write or change. Pick the correct guard stack (@Permissions for human-only, @Public + AgentsDualAuthGuard + @ApiKeyScopes for agent+human surfaces, @Public for truly public, ApiKeyGuard + canUseTool for MCP). Enforce capability + key scope + project access (never less than two layers). Use envelope + zod validation + UPPER_SNAKE error codes, and write AgentLog rows for every agent action.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TeamShare Auth & Authorization (RBAC)
|
|
7
|
+
|
|
8
|
+
Every endpoint in `teamshare-backend` must declare its access story. Use this
|
|
9
|
+
decision table; never leave an endpoint with default guards and no metadata.
|
|
10
|
+
|
|
11
|
+
## 1. Choose the guard stack
|
|
12
|
+
|
|
13
|
+
| Who calls it | What to use on the route |
|
|
14
|
+
|---|---|
|
|
15
|
+
| Human JWT only (company/team/env-var/roles/webhooks/invitations/attachments) | Leave global guards, add `@Permissions('<entity>.<action>')` (e.g. `document.create`) |
|
|
16
|
+
| Agents AND humans (tasks, comments, chat, documents, search, projects, agents self-service) | Class-level `@Public()` + `@UseGuards(AgentsDualAuthGuard)` + per-route `@ApiKeyScopes('<entity>:read' \| '<entity>:write')` |
|
|
17
|
+
| Truly public (auth, verify, reset, billing webhook, run-token redeem) | `@Public()` only |
|
|
18
|
+
| MCP tools (`/mcp`) | `ApiKeyGuard` + per-tool `canUseTool(capabilities, keyScopes, required)` |
|
|
19
|
+
|
|
20
|
+
`AgentsDualAuthGuard` accepts `X-Api-Key` (enforces `@ApiKeyScopes`) OR a
|
|
21
|
+
`Bearer` JWT. **Do not combine `@Permissions` with `AgentsDualAuthGuard` on the
|
|
22
|
+
same route** — global RbacGuard runs before the route guard can set
|
|
23
|
+
`request.user` for key callers. Dual-auth routes delegate access to the
|
|
24
|
+
service layer.
|
|
25
|
+
|
|
26
|
+
## 2. The three enforcement layers (never less than two)
|
|
27
|
+
|
|
28
|
+
For every agent action: **capability** (`Agent.capabilities`) + **API-key
|
|
29
|
+
scope** (`@ApiKeyScopes`, minted by `scopesForCapabilities`) + **project
|
|
30
|
+
access** (`assertProjectAccess`). Never gate access on env vars.
|
|
31
|
+
|
|
32
|
+
- MCP tool → `ctx.canUse('<capability>')` (capability + scope) then the shared
|
|
33
|
+
service runs `assertProjectAccess` as the agent user.
|
|
34
|
+
- Agent REST → `@ApiKeyScopes` (scope) then the service runs
|
|
35
|
+
`assertProjectAccess` (project role).
|
|
36
|
+
- Service layer helpers: `assertProjectAccess(prisma, projectId, userId,
|
|
37
|
+
minRole)`, `assertCompanyMembership`, `isCompanyOwnerOrAdmin`.
|
|
38
|
+
|
|
39
|
+
## 3. Permission vocabulary (CRUDL)
|
|
40
|
+
|
|
41
|
+
- `src/common/constants/rbac.ts`: `ENTITIES` (17) × `ACTIONS`
|
|
42
|
+
(`create | read | list | update | delete`) → `Permission = entity.action`
|
|
43
|
+
plus `SPECIAL_PERMISSIONS` (`env_var.reveal`, `env_var.export`, ...).
|
|
44
|
+
- Static role matrices: `COMPANY_ROLE_PERMISSIONS`
|
|
45
|
+
(owner/admin/member/secret_manager/viewer) and `PROJECT_ROLE_PERMISSIONS`
|
|
46
|
+
(owner/member/viewer). Dynamic roles add `companyPermissions` claims.
|
|
47
|
+
- Agent capabilities live in `src/common/constants/enums.ts`
|
|
48
|
+
(`AGENT_CAPABILITIES`, `CAPABILITY_SCOPES`). A key never exceeds its
|
|
49
|
+
agent's capabilities and a capability never exceeds the key's scopes.
|
|
50
|
+
- Add a new capability → add its scope in `API_KEY_SCOPES` + a mapping in
|
|
51
|
+
`CAPABILITY_SCOPES`, so `scopesForCapabilities` mints the right key.
|
|
52
|
+
|
|
53
|
+
## 4. Error codes & envelope
|
|
54
|
+
|
|
55
|
+
- Throw `new XxxException({ code: 'UPPER_SNAKE', message, details? })`
|
|
56
|
+
(`VALIDATION_ERROR`, `PROJECT_NOT_FOUND`, `INSUFFICIENT_PROJECT_ROLE`,
|
|
57
|
+
`API_KEY_SCOPE_MISSING`, `DOCUMENT_UPDATE_DENIED`, ...). Secrets never
|
|
58
|
+
appear in messages/logs.
|
|
59
|
+
- Responses: `{ success: true, data, pagination? }` /
|
|
60
|
+
`{ success: false, error: { code, message, details? } }` (global
|
|
61
|
+
interceptor/filter — your handler returns raw data).
|
|
62
|
+
|
|
63
|
+
## 5. AgentLog — never bypass
|
|
64
|
+
|
|
65
|
+
Every agent mutation logs an `AgentLog` row via the shared services:
|
|
66
|
+
`logAgentActionIfAgent(prisma, userId, { action, taskId?, detail })`
|
|
67
|
+
(best-effort; humans skipped). Actions are in `AGENT_LOG_ACTIONS`
|
|
68
|
+
(`task_created`, `comment_created`, `document_created`, `document_updated`,
|
|
69
|
+
`subtask_updated`, `wake_sent`, ...). If you add an agent-facing mutation,
|
|
70
|
+
wire the log in the service — never in the controller.
|
|
71
|
+
|
|
72
|
+
## 6. Checklist for a new endpoint
|
|
73
|
+
|
|
74
|
+
- [ ] Guard stack chosen from the table; metadata declared on the route.
|
|
75
|
+
- [ ] zod `ZodValidationPipe` on body/query/param; generated zod for enums.
|
|
76
|
+
- [ ] Service re-checks project/company access (guards are a first filter).
|
|
77
|
+
- [ ] Envelope-compliant return; UPPER_SNAKE error codes.
|
|
78
|
+
- [ ] Agent actions write `AgentLog` via `logAgentActionIfAgent`.
|
|
79
79
|
- [ ] Swagger `@ApiOperation` mentions the RBAC; `@errs(...)` lists the codes.
|