@stackwright-pro/otters 0.0.0-beta-20260417191149
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 +271 -0
- package/package.json +36 -0
- package/scripts/generate-checksums.js +53 -0
- package/scripts/install-agents.js +60 -0
- package/scripts/verify-checksums.js +61 -0
- package/src/checksums.json +15 -0
- package/src/python-bridge.ts +391 -0
- package/src/question-adapter.ts +296 -0
- package/src/stackwright-pro-api-otter.json +158 -0
- package/src/stackwright-pro-auth-otter.json +810 -0
- package/src/stackwright-pro-dashboard-otter.json +687 -0
- package/src/stackwright-pro-data-otter.json +554 -0
- package/src/stackwright-pro-designer-otter.json +34 -0
- package/src/stackwright-pro-foreman-otter.json +670 -0
- package/src/stackwright-pro-page-otter.json +28 -0
- package/src/stackwright-pro-theme-otter.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# @stackwright-pro/otters
|
|
2
|
+
|
|
3
|
+
š¦¦š¦¦ **Pro Otter Ecosystem** ā Enterprise features that emerge when Pro otters join the raft.
|
|
4
|
+
|
|
5
|
+
Pro otters don't replace the OSS raft ā they extend it. When a Pro otter joins, the entire ecosystem adapts. Page Otter discovers Dashboard Otter and offers live data. Theme Otter discovers CAC requirements and suggests secure variants. The raft self-organizes.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Dynamic Discovery
|
|
10
|
+
|
|
11
|
+
All Pro otters use `list_agents()` for dynamic discovery at startup. This pattern ensures:
|
|
12
|
+
|
|
13
|
+
- **Automatic coordination** ā Pro otters find each other and OSS counterparts
|
|
14
|
+
- **Graceful degradation** ā Fall back to MCP tools if an otter is missing
|
|
15
|
+
- **Context-aware behavior** ā Adapt based on available teammates
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
// Every Pro otter discovers at startup
|
|
19
|
+
const agents = await list_agents();
|
|
20
|
+
const proOtters = agents.filter((a) => a.name.includes('pro-'));
|
|
21
|
+
const ossOtters = agents.filter((a) => a.name.includes('-otter') && !a.name.includes('pro-'));
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Pro + OSS Integration
|
|
25
|
+
|
|
26
|
+
When Pro otters join an OSS raft, the following capabilities emerge:
|
|
27
|
+
|
|
28
|
+
| OSS Otter | Pro Enhancement | What Emerges |
|
|
29
|
+
| ------------- | --------------- | -------------------------------------- |
|
|
30
|
+
| Brand Otter | Pro Specs | Brand validation against approved APIs |
|
|
31
|
+
| Theme Otter | Pro Auth | CAC-enabled secure themes |
|
|
32
|
+
| Page Otter | Pro Dashboard | Live data page generation |
|
|
33
|
+
| Foreman Otter | Pro Delegation | Enterprise orchestration with fallback |
|
|
34
|
+
|
|
35
|
+
### How Pro Otters Discover the OSS Raft
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
39
|
+
ā DISCOVERY SEQUENCE ā
|
|
40
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
|
|
41
|
+
ā ā
|
|
42
|
+
ā code-puppy -i -a stackwright-pro-foreman-otter ā
|
|
43
|
+
ā ā
|
|
44
|
+
ā 1. Pro Foreman starts ā
|
|
45
|
+
ā ā
|
|
46
|
+
ā 2. list_agents() scans for otters: ā
|
|
47
|
+
ā āāāŗ OSS Foreman detected: stackwright-foreman-otter ā
|
|
48
|
+
ā āāāŗ Pro specialists detected: ā
|
|
49
|
+
ā ā āāāŗ stackwright-pro-api-otter ā
|
|
50
|
+
ā ā āāāŗ stackwright-pro-data-otter ā
|
|
51
|
+
ā ā āāāŗ stackwright-pro-dashboard-otter ā
|
|
52
|
+
ā āāāŗ OSS raft detected: ā
|
|
53
|
+
ā āāāŗ stackwright-brand-otter ā
|
|
54
|
+
ā āāāŗ stackwright-theme-otter ā
|
|
55
|
+
ā āāāŗ stackwright-page-otter ā
|
|
56
|
+
ā ā
|
|
57
|
+
ā 3. Pro Foreman delegates to OSS Foreman: ā
|
|
58
|
+
ā "Delegating Brand ā Theme ā Pages to OSS Foreman" ā
|
|
59
|
+
ā ā
|
|
60
|
+
ā 4. Pro capabilities available for addition: ā
|
|
61
|
+
ā "API dashboards, CAC auth, OIDC ready" ā
|
|
62
|
+
ā ā
|
|
63
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Install Pro otters
|
|
72
|
+
npm install @stackwright-pro/otters
|
|
73
|
+
|
|
74
|
+
# Or with pnpm
|
|
75
|
+
pnpm add @stackwright-pro/otters
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The postinstall script automatically installs Pro otters to `~/.code_puppy/agents/` for code-puppy discovery.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# User has OSS otters installed
|
|
82
|
+
code-puppy -i -a stackwright-foreman-otter
|
|
83
|
+
# Found: Brand ā, Theme ā, Page ā
|
|
84
|
+
|
|
85
|
+
# User installs Pro otters
|
|
86
|
+
npm install @stackwright-pro/otters
|
|
87
|
+
|
|
88
|
+
# Now with Pro discovery
|
|
89
|
+
code-puppy -i -a stackwright-foreman-otter
|
|
90
|
+
# Found: Brand ā, Theme ā, Page ā
|
|
91
|
+
# Pro detected: API Otter ā, Data Otter ā, Dashboard Otter ā
|
|
92
|
+
# "Live API dashboards now available - want some?"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The OSS Foreman Otter orchestrates the base pipeline. When Pro otters are present, they extend it silently ā offering capabilities without overwhelming users who don't need them.
|
|
96
|
+
|
|
97
|
+
If you need to re-run the installation:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
node node_modules/@stackwright-pro/otters/scripts/install-agents.js
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## The Pro + OSS Raft: What Emerges
|
|
106
|
+
|
|
107
|
+
When Pro otters combine with the OSS raft, these capabilities emerge:
|
|
108
|
+
|
|
109
|
+
| Combined Otters | Emergent Capability |
|
|
110
|
+
| ---------------------------- | --------------------------------------- |
|
|
111
|
+
| Page Otter + Dashboard Otter | "Add live data to this page?" |
|
|
112
|
+
| Theme Otter + Pro Auth | "Enable CAC on this theme?" |
|
|
113
|
+
| Brand Otter + Pro Specs | "Validate brand against approved APIs?" |
|
|
114
|
+
| Foreman + All Pro Otters | Enterprise orchestration |
|
|
115
|
+
| All Otters + Enterprise Mode | Security posture auto-detected |
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## The Pro Otter Raft
|
|
120
|
+
|
|
121
|
+
| Otter | Role | Output |
|
|
122
|
+
| ------------------------ | -------------------- | ------------------------------------------------------------- |
|
|
123
|
+
| š¦¦š¦¦ **Foreman Otter** | Project coordinator | Orchestrates full-stack builds (delegates to unified Foreman) |
|
|
124
|
+
| š¦¦š” **API Otter** | OpenAPI discovery | API entity types, endpoints |
|
|
125
|
+
| š¦¦š **Dashboard Otter** | Live data views | Typed API components |
|
|
126
|
+
| š¦¦š **Data Otter** | Endpoint integration | ISR config, filters |
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Pro vs OSS Integration
|
|
131
|
+
|
|
132
|
+
| Feature | OSS | Pro Integration |
|
|
133
|
+
| ---------------------- | ------------ | ------------------------------ |
|
|
134
|
+
| Brand discovery | ā
OSS Otter | ā
Pro can extend |
|
|
135
|
+
| Theme design | ā
OSS Otter | ā
Enterprise themes available |
|
|
136
|
+
| Page building | ā
OSS Otter | ā
Live data pages emerge |
|
|
137
|
+
| API dashboards | ā | ā
Discovered dynamically |
|
|
138
|
+
| CAC auth | ā | ā
Suggested when available |
|
|
139
|
+
| Static site generation | ā
| ā
Extended with ISR |
|
|
140
|
+
|
|
141
|
+
The key insight: **Pro doesn't replace OSS ā it amplifies it.** The OSS raft handles static content, SEO, and standard pages. Pro otters discover gaps in the raft and fill them with enterprise capabilities.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## How Pro Integrates
|
|
146
|
+
|
|
147
|
+
### The Discovery Flow
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
151
|
+
ā CODE-PUPPY DISCOVERY ā
|
|
152
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
|
|
153
|
+
ā ā
|
|
154
|
+
ā code-puppy -i -a stackwright-foreman-otter ā
|
|
155
|
+
ā ā
|
|
156
|
+
ā 1. Lists all available agents ā
|
|
157
|
+
ā ā
|
|
158
|
+
ā 2. Filters for OSS raft: ā
|
|
159
|
+
ā āāāŗ Brand Otter ā ā
|
|
160
|
+
ā āāāŗ Theme Otter ā ā
|
|
161
|
+
ā āāāŗ Page Otter ā ā
|
|
162
|
+
ā āāāŗ Foreman Otter ā ā
|
|
163
|
+
ā ā
|
|
164
|
+
ā 3. Pro Foreman extends OSS Foreman: ā
|
|
165
|
+
ā āāāŗ Adds API discovery hooks ā
|
|
166
|
+
ā āāāŗ Adds ISR configuration ā
|
|
167
|
+
ā āāāŗ Adds Dashboard Otter coordination ā
|
|
168
|
+
ā ā
|
|
169
|
+
ā 4. Emergent suggestions: ā
|
|
170
|
+
ā "API spec detected ā Generate dashboard?" ā
|
|
171
|
+
ā ā
|
|
172
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Invoking Pro Otters
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Full-stack API build (via Foreman delegation)
|
|
179
|
+
code-puppy -i -a stackwright-foreman-otter
|
|
180
|
+
|
|
181
|
+
# API entity discovery (Pro otters work alongside OSS)
|
|
182
|
+
code-puppy -i -a stackwright-pro-api-otter
|
|
183
|
+
|
|
184
|
+
# Live dashboard generation (extends Page Otter)
|
|
185
|
+
code-puppy -i -a stackwright-pro-dashboard-otter
|
|
186
|
+
|
|
187
|
+
# ISR configuration (extends Data layer)
|
|
188
|
+
code-puppy -i -a stackwright-pro-data-otter
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## The Pro Pipeline
|
|
194
|
+
|
|
195
|
+
When a Pro otter joins an active OSS build:
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
User Request (with OpenAPI spec)
|
|
199
|
+
ā
|
|
200
|
+
ā¼
|
|
201
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
202
|
+
ā OSS Foreman Otter ā āāā Base coordinator
|
|
203
|
+
ā (Pro-aware) ā
|
|
204
|
+
āāāāāāāāā¬āāāāāāāāāāāāāāāāā
|
|
205
|
+
ā discovers Pro capabilities
|
|
206
|
+
ā¼
|
|
207
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
208
|
+
ā Pro API Otter ā āāā OpenAPI ā typed client
|
|
209
|
+
ā (entity discovery) ā (extends OSS build)
|
|
210
|
+
āāāāāāāāā¬āāāāāāāāāāāāāāāāā
|
|
211
|
+
ā creates src/generated/*
|
|
212
|
+
ā¼
|
|
213
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
214
|
+
ā Pro Dashboard Otter ā āāā Live API data views
|
|
215
|
+
ā (emerges with data) ā
|
|
216
|
+
āāāāāāāāā¬āāāāāāāāāāāāāāāāā
|
|
217
|
+
ā creates pages/api/*
|
|
218
|
+
ā¼
|
|
219
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
220
|
+
ā Pro Data Otter ā āāā ISR + endpoint config
|
|
221
|
+
ā (configures refresh) ā
|
|
222
|
+
āāāāāāāāā¬āāāāāāāāāāāāāāāāā
|
|
223
|
+
ā¼
|
|
224
|
+
USER
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Package Structure
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
@stackwright-pro/otters/
|
|
233
|
+
āāā package.json
|
|
234
|
+
āāā README.md
|
|
235
|
+
āāā MCP_TOOLS.md # MCP tool documentation
|
|
236
|
+
āāā PRO_OTTER_ARCHITECTURE.md # Architecture details
|
|
237
|
+
āāā scripts/
|
|
238
|
+
ā āāā install-agents.js # Postinstall script
|
|
239
|
+
āāā stackwright-pro-foreman-otter.json
|
|
240
|
+
āāā stackwright-pro-api-otter.json
|
|
241
|
+
āāā stackwright-pro-dashboard-otter.json
|
|
242
|
+
āāā stackwright-pro-data-otter.json
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Dependencies
|
|
248
|
+
|
|
249
|
+
Pro otters require:
|
|
250
|
+
|
|
251
|
+
- **@stackwright-pro/mcp** ā MCP server for API tooling
|
|
252
|
+
- **@stackwright/otters** ā OSS otters (installed automatically)
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Emergent Capabilities
|
|
257
|
+
|
|
258
|
+
When Pro otters join the raft, unexpected capabilities emerge:
|
|
259
|
+
|
|
260
|
+
| Discovery | Emergent Feature |
|
|
261
|
+
| ---------------------------- | --------------------------------------- |
|
|
262
|
+
| Page Otter + Dashboard Otter | "Add live data to this page?" |
|
|
263
|
+
| Theme Otter + Pro Auth | "Enable CAC on this theme?" |
|
|
264
|
+
| Brand Otter + Pro Specs | "Validate brand against approved APIs?" |
|
|
265
|
+
| All otters + Enterprise | Security posture auto-detected |
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stackwright-pro/otters",
|
|
3
|
+
"version": "0.0.0-beta-20260417191149",
|
|
4
|
+
"description": "Stackwright Pro Otter Raft - AI agents for enterprise features (CAC auth, API dashboards, government use cases)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/Per-Aspera-LLC/stackwright-pro"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"vitest": "^4.0.18",
|
|
12
|
+
"zod": "^3.22.4"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
"./src": "./src",
|
|
16
|
+
"./pro-foreman": "./src/stackwright-pro-foreman-otter.json"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"scripts",
|
|
20
|
+
"src"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@stackwright-pro/mcp": "0.0.0-beta-20260417191149"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"generate-checksums": "node scripts/generate-checksums.js",
|
|
30
|
+
"verify-checksums": "node scripts/verify-checksums.js",
|
|
31
|
+
"postinstall": "node scripts/install-agents.js",
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:watch": "vitest",
|
|
34
|
+
"test:coverage": "vitest run --coverage"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* generate-checksums.js
|
|
4
|
+
* Computes SHA-256 for every *-otter.json in src/ and writes src/checksums.json
|
|
5
|
+
* Run: node scripts/generate-checksums.js
|
|
6
|
+
* Auto-run: npm prepare (before publish), npm pretest (before tests)
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const crypto = require('crypto');
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
|
|
15
|
+
const scriptDir = __dirname;
|
|
16
|
+
const packageRoot = path.resolve(scriptDir, '..');
|
|
17
|
+
const srcDir = path.join(packageRoot, 'src');
|
|
18
|
+
const outputFile = path.join(srcDir, 'checksums.json');
|
|
19
|
+
|
|
20
|
+
async function generateChecksums() {
|
|
21
|
+
const entries = await fs.promises.readdir(srcDir);
|
|
22
|
+
|
|
23
|
+
const otterFiles = entries
|
|
24
|
+
.filter((f) => f.endsWith('-otter.json'))
|
|
25
|
+
.sort(); // alphabetical ā deterministic output, no excuses
|
|
26
|
+
|
|
27
|
+
const files = {};
|
|
28
|
+
for (const filename of otterFiles) {
|
|
29
|
+
const filePath = path.join(srcDir, filename);
|
|
30
|
+
const raw = await fs.promises.readFile(filePath); // raw Buffer ā utf-8 bytes, no funny business
|
|
31
|
+
const digest = crypto.createHash('sha256').update(raw).digest('hex');
|
|
32
|
+
files[filename] = digest;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const manifest = {
|
|
36
|
+
version: '1.0',
|
|
37
|
+
algorithm: 'sha256',
|
|
38
|
+
generated: new Date().toISOString(),
|
|
39
|
+
files,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
await fs.promises.writeFile(outputFile, JSON.stringify(manifest, null, 2) + '\n', 'utf8');
|
|
43
|
+
|
|
44
|
+
console.log(`ā
checksums.json written with ${otterFiles.length} entr${otterFiles.length === 1 ? 'y' : 'ies'}:`);
|
|
45
|
+
for (const [name, hash] of Object.entries(files)) {
|
|
46
|
+
console.log(` ${name}: ${hash}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
generateChecksums().catch((err) => {
|
|
51
|
+
console.error('ā generate-checksums failed:', err.message);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Post-install script for @stackwright-pro/otters
|
|
4
|
+
* Copies Pro agent JSON files to ~/.code_puppy/agents/ for code-puppy discovery
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const os = require('os');
|
|
10
|
+
|
|
11
|
+
const AGENTS_DIR = path.join(os.homedir(), '.code_puppy', 'agents');
|
|
12
|
+
|
|
13
|
+
// Resolve package root relative to this script's location
|
|
14
|
+
const scriptDir = __dirname;
|
|
15
|
+
const packageRoot = path.resolve(scriptDir, '..');
|
|
16
|
+
|
|
17
|
+
// All Pro otters are in the src/ directory
|
|
18
|
+
const srcDir = path.join(packageRoot, 'src');
|
|
19
|
+
|
|
20
|
+
async function installAgents() {
|
|
21
|
+
try {
|
|
22
|
+
// Ensure ~/.code_puppy/agents/ exists
|
|
23
|
+
await fs.promises.mkdir(AGENTS_DIR, { recursive: true });
|
|
24
|
+
|
|
25
|
+
// Copy all JSON files from src/ to ~/.code_puppy/agents/
|
|
26
|
+
const files = await fs.promises.readdir(srcDir);
|
|
27
|
+
|
|
28
|
+
let installedCount = 0;
|
|
29
|
+
for (const file of files) {
|
|
30
|
+
if (file.endsWith('-otter.json')) {
|
|
31
|
+
const srcPath = path.join(srcDir, file);
|
|
32
|
+
const destPath = path.join(AGENTS_DIR, file);
|
|
33
|
+
|
|
34
|
+
await fs.promises.copyFile(srcPath, destPath);
|
|
35
|
+
console.log(`ā
Installed: ${file}`);
|
|
36
|
+
installedCount++;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Also install checksums manifest (informational ā Python coordinator uses hardcoded constants)
|
|
41
|
+
const checksumsSource = path.join(packageRoot, 'src', 'checksums.json');
|
|
42
|
+
const checksumsDest = path.join(AGENTS_DIR, 'otter-checksums.REFERENCE-ONLY.json');
|
|
43
|
+
if (fs.existsSync(checksumsSource)) {
|
|
44
|
+
await fs.promises.copyFile(checksumsSource, checksumsDest);
|
|
45
|
+
console.log('ā
Installed: otter-checksums.REFERENCE-ONLY.json');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (installedCount > 0) {
|
|
49
|
+
console.log(`Installing otters from: ${srcDir}`);
|
|
50
|
+
console.log(`\nš¦¦š¦¦ Pro otters installed to ${AGENTS_DIR}`);
|
|
51
|
+
} else {
|
|
52
|
+
console.log('ā ļø No Pro otter files found to install');
|
|
53
|
+
}
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error(`ā FATAL: Failed to install Pro otters: ${error.message}`);
|
|
56
|
+
process.exit(1); // Fail the npm install ā surface it early
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
installAgents();
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* verify-checksums.js
|
|
4
|
+
* Read-only: verifies that *-otter.json files match the committed checksums.json
|
|
5
|
+
* Does NOT regenerate. For regeneration: node scripts/generate-checksums.js
|
|
6
|
+
*
|
|
7
|
+
* Exit codes:
|
|
8
|
+
* 0 = all checksums match
|
|
9
|
+
* 1 = one or more mismatches detected (tamper detected or file missing)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
const crypto = require('crypto');
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
|
|
18
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
19
|
+
const srcDir = path.join(packageRoot, 'src');
|
|
20
|
+
const checksumsPath = path.join(srcDir, 'checksums.json');
|
|
21
|
+
|
|
22
|
+
// Read checksums manifest
|
|
23
|
+
let manifest;
|
|
24
|
+
try {
|
|
25
|
+
manifest = JSON.parse(fs.readFileSync(checksumsPath, 'utf8'));
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error(`ā Cannot read checksums.json: ${err.message}`);
|
|
28
|
+
console.error('Run: node scripts/generate-checksums.js');
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const expected = manifest.files || {};
|
|
33
|
+
let failures = 0;
|
|
34
|
+
let verified = 0;
|
|
35
|
+
|
|
36
|
+
for (const [filename, expectedHash] of Object.entries(expected)) {
|
|
37
|
+
const filePath = path.join(srcDir, filename);
|
|
38
|
+
try {
|
|
39
|
+
const raw = fs.readFileSync(filePath);
|
|
40
|
+
const actual = crypto.createHash('sha256').update(raw).digest('hex');
|
|
41
|
+
if (actual !== expectedHash) {
|
|
42
|
+
console.error(`ā MISMATCH: ${filename}`);
|
|
43
|
+
console.error(` Expected: ${expectedHash.substring(0, 16)}...`);
|
|
44
|
+
console.error(` Actual: ${actual.substring(0, 16)}...`);
|
|
45
|
+
failures++;
|
|
46
|
+
} else {
|
|
47
|
+
console.log(`ā
${filename}`);
|
|
48
|
+
verified++;
|
|
49
|
+
}
|
|
50
|
+
} catch (err) {
|
|
51
|
+
console.error(`ā MISSING: ${filename} ā ${err.message}`);
|
|
52
|
+
failures++;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (failures > 0) {
|
|
57
|
+
console.error(`\nšØ ${failures} checksum failure(s) detected. Run \`npm install @stackwright-pro/otters\` to restore.`);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
} else {
|
|
60
|
+
console.log(`\nā
All ${verified} otter checksums verified.`);
|
|
61
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"algorithm": "sha256",
|
|
4
|
+
"generated": "2026-04-16T15:32:31.051Z",
|
|
5
|
+
"files": {
|
|
6
|
+
"stackwright-pro-api-otter.json": "ad0c3694af41000420229edce4108f860eaa58ab321f8618565d03ebce80bcac",
|
|
7
|
+
"stackwright-pro-auth-otter.json": "e8e02ef1389e0d5e55bfa6d960a050ab976bf7960fda4ae805675020874ce4c6",
|
|
8
|
+
"stackwright-pro-dashboard-otter.json": "0b4100afef4946bae259f5759aea872d7b1a25a00af191e1ead32bf9ee304d08",
|
|
9
|
+
"stackwright-pro-data-otter.json": "38ae3a26f064499a5f9773dfea1e2c21f9f358207110224a8e94c19443d236f1",
|
|
10
|
+
"stackwright-pro-designer-otter.json": "46c9fd94a46f1a3f5267f4cb70c3db0adfc28dc7d4ac50256cbe40ea5363b4f0",
|
|
11
|
+
"stackwright-pro-foreman-otter.json": "73f0913de78dfd3da726d9a32c63d84961985109c3ffc5c7522f6c63559609e7",
|
|
12
|
+
"stackwright-pro-page-otter.json": "0973f1b75a481fd177c5ada1a965f8c32e07f97fc28bbbf03b51d9e6d2af2f74",
|
|
13
|
+
"stackwright-pro-theme-otter.json": "2cca6eab4d7ee226d3fca488e908be6ace28dbaea9dae1b111cb76608f0747e6"
|
|
14
|
+
}
|
|
15
|
+
}
|