@aspectlylabs/mikka 0.0.648 → 0.0.651
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/cli.js +1114 -563
- package/client.js +31 -3
- package/http-link.js +70 -17
- package/login.js +57 -6
- package/main.js +1096 -549
- package/mikka-mcp-backend.mjs +36 -5
- package/mikka-release-manifest.json +22 -22
- package/mikka.js +1114 -563
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
- package/paths.js +2 -2
- package/sbom.cdx.json +7 -7
package/mikka-mcp-backend.mjs
CHANGED
|
@@ -220,6 +220,13 @@ const TOOLS = [
|
|
|
220
220
|
previewDatabaseBranch: { type: "string", description: "Name of the preview database branch you actually created or used; omit when none." },
|
|
221
221
|
verificationCommand: { type: "object", description: "For a Factory verification with no frozen command: the command inferred from repository scripts, Makefile or CI and its concrete source. Run it and report its actual observations too. If no command can be inferred, mark that criterion unverified with its reason; do not invent a command or ask the person for one.", properties: { command: { type: "string" }, basis: { type: "string" } }, required: ["command", "basis"] },
|
|
222
222
|
reviewVerdict: { type: "string", enum: ["passed", "changes_requested", "needs_judgment"], description: "The task’s single review: clear defects require changes; ambiguous findings go to the person. An unverified observation is not an observed defect." },
|
|
223
|
+
visualEvidence: {
|
|
224
|
+
type: "array", maxItems: 40,
|
|
225
|
+
description: "Capture IDs from this task's real visual verification. Inspect every image/video before declaring publicSafe: no credentials, private account details or personal data may appear. This explicit declaration permits only these captures to be linked in the public PR. Never invent a capture ID or authorize an uninspected recording.",
|
|
226
|
+
items: { type: "object", additionalProperties: false, properties: {
|
|
227
|
+
captureId: { type: "string", format: "uuid" }, publicSafe: { type: "boolean", const: true },
|
|
228
|
+
}, required: ["captureId", "publicSafe"] },
|
|
229
|
+
},
|
|
223
230
|
criteria: {
|
|
224
231
|
type: "array",
|
|
225
232
|
description:
|
|
@@ -299,17 +306,22 @@ const TOOLS = [
|
|
|
299
306
|
]
|
|
300
307
|
|
|
301
308
|
// The same limits as @mikka/protocol/capture; this file has no dependencies.
|
|
302
|
-
const CAPTURE_LIMITS = { png: 10_000_000, jpg: 10_000_000, webp: 10_000_000, mp4:
|
|
309
|
+
const CAPTURE_LIMITS = { png: 10_000_000, jpg: 10_000_000, webp: 10_000_000, mp4: 1_000_000_000, webm: 1_000_000_000 }
|
|
303
310
|
const MAX_QUEUED_CAPTURES = 20
|
|
304
311
|
const CAPTURE_TOOL = {
|
|
305
312
|
name: "submit_capture",
|
|
306
313
|
description:
|
|
307
|
-
"
|
|
314
|
+
"Queue a screenshot or real screen recording you made (for example with Playwright) as evidence. Returns its captureId for submit.visualEvidence. Images: PNG/JPEG/WebP up to 10 MB. Raw MP4/WebM up to 1 GB is processed before upload into the existing 100 MB limit; processing failure leaves the task blocked. Prefer video. Pass a file inside the worktree or your temp directory. Include measured action steps to remove only the idle gaps between actions; omit guessed timings.",
|
|
308
315
|
inputSchema: {
|
|
309
316
|
type: "object",
|
|
310
317
|
properties: {
|
|
311
318
|
path: { type: "string", description: "The file's path." },
|
|
312
319
|
title: { type: "string", description: "What it shows, for the person." },
|
|
320
|
+
steps: { type: "array", maxItems: 200, description: "Optional real recording timeline. atMs is the action's end offset and durationMs its actual execution duration. Omit unknown duration; never guess a timing to remove footage.",
|
|
321
|
+
items: { type: "object", additionalProperties: false, properties: {
|
|
322
|
+
atMs: { type: "integer", minimum: 0, maximum: 300000 }, label: { type: "string", minLength: 1, maxLength: 200 },
|
|
323
|
+
source: { type: "string", enum: ["action", "mark"] }, durationMs: { type: "integer", minimum: 0, maximum: 300000 },
|
|
324
|
+
}, required: ["atMs", "label", "source"] } },
|
|
313
325
|
},
|
|
314
326
|
required: ["path", "title"],
|
|
315
327
|
},
|
|
@@ -637,6 +649,17 @@ export function createMikkaMcpBackend(config, { signal, assertLive } = {}) {
|
|
|
637
649
|
if (!capturesDir) throw new Error("Captures are not available in this run.")
|
|
638
650
|
const title = typeof args.title === "string" ? args.title.replace(/\s+/g, " ").trim().slice(0, 200) : ""
|
|
639
651
|
if (!title) throw new Error("A title is required.")
|
|
652
|
+
if (args.steps !== undefined && (!Array.isArray(args.steps) || args.steps.length > 200)) throw new Error('Invalid recording timeline.')
|
|
653
|
+
const steps = args.steps?.map(step => {
|
|
654
|
+
if (!step || typeof step !== 'object' || Array.isArray(step) ||
|
|
655
|
+
Object.keys(step).some(key => !['atMs', 'label', 'source', 'durationMs'].includes(key)) ||
|
|
656
|
+
!Number.isSafeInteger(step.atMs) || step.atMs < 0 || step.atMs > 300000 ||
|
|
657
|
+
typeof step.label !== 'string' || !step.label.trim() || step.label.length > 200 || !['action', 'mark'].includes(step.source) ||
|
|
658
|
+
(step.durationMs !== undefined && (step.source !== 'action' || !Number.isSafeInteger(step.durationMs) || step.durationMs < 0 || step.durationMs > step.atMs)))
|
|
659
|
+
throw new Error('Invalid recording timeline.')
|
|
660
|
+
return { atMs: step.atMs, label: step.label.replace(/\s+/g, ' ').trim(), source: step.source,
|
|
661
|
+
...(step.durationMs === undefined ? {} : { durationMs: step.durationMs }) }
|
|
662
|
+
})
|
|
640
663
|
if (typeof args.path !== "string" || !args.path) throw new Error("A path is required.")
|
|
641
664
|
const real = realpathSync(args.path)
|
|
642
665
|
if (!captureRoots.some((root) => real === root || real.startsWith(root + sep)))
|
|
@@ -649,6 +672,7 @@ export function createMikkaMcpBackend(config, { signal, assertLive } = {}) {
|
|
|
649
672
|
const head = Buffer.alloc(64)
|
|
650
673
|
ext = sniff(head.subarray(0, readSync(fd, head, 0, 64, 0)))
|
|
651
674
|
if (!ext) throw new Error("Not a PNG, JPEG or WebP image, or an MP4 or WebM video.")
|
|
675
|
+
if (steps?.length && !['mp4', 'webm'].includes(ext)) throw new Error('Only recordings have a timeline.')
|
|
652
676
|
if (stat.size === 0 || stat.size > CAPTURE_LIMITS[ext]) throw new Error(`At most ${CAPTURE_LIMITS[ext]} bytes for a .${ext} file.`)
|
|
653
677
|
if (readdirSync(capturesDir).filter((name) => name.endsWith(".json")).length >= MAX_QUEUED_CAPTURES)
|
|
654
678
|
throw new Error("Too many captures waiting to upload; try again shortly.")
|
|
@@ -659,8 +683,9 @@ export function createMikkaMcpBackend(config, { signal, assertLive } = {}) {
|
|
|
659
683
|
}
|
|
660
684
|
// The metadata lands last: the daemon only takes files that have one.
|
|
661
685
|
const meta = join(capturesDir, `${id}.json`)
|
|
662
|
-
writeFileSync(`${meta}.tmp`, JSON.stringify({ title, at: new Date().toISOString() }))
|
|
686
|
+
writeFileSync(`${meta}.tmp`, JSON.stringify({ title, ...(steps ? { steps } : {}), at: new Date().toISOString() }))
|
|
663
687
|
renameSync(`${meta}.tmp`, meta)
|
|
688
|
+
return id
|
|
664
689
|
}
|
|
665
690
|
|
|
666
691
|
|
|
@@ -713,6 +738,11 @@ export function createMikkaMcpBackend(config, { signal, assertLive } = {}) {
|
|
|
713
738
|
}
|
|
714
739
|
|
|
715
740
|
function record(kind, args, toolName) {
|
|
741
|
+
const visualEvidence = kind === 'submit' ? args.visualEvidence : undefined
|
|
742
|
+
if (visualEvidence !== undefined && (!Array.isArray(visualEvidence) || visualEvidence.length > 40 || visualEvidence.some(item =>
|
|
743
|
+
!item || typeof item !== 'object' || Array.isArray(item) || Object.keys(item).some(key => !['captureId', 'publicSafe'].includes(key)) ||
|
|
744
|
+
typeof item.captureId !== 'string' || !/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(item.captureId) || item.publicSafe !== true)))
|
|
745
|
+
throw new Error('Visual evidence must name inspected captures explicitly safe for public sharing.')
|
|
716
746
|
// A planning hand-in carries the spec and the split it proposes. The id is
|
|
717
747
|
// generated here, once, so the cards the daemon puts in the conversation
|
|
718
748
|
// and the row the server stores name the same spec.
|
|
@@ -781,6 +811,7 @@ export function createMikkaMcpBackend(config, { signal, assertLive } = {}) {
|
|
|
781
811
|
// Kept as sent; the daemon validates and trims each entry.
|
|
782
812
|
...(typeof args.previewDatabaseBranch === "string" ? { previewDatabaseBranch: args.previewDatabaseBranch } : {}),
|
|
783
813
|
...(Array.isArray(args.criteria) ? { criteria: args.criteria } : {}),
|
|
814
|
+
...(visualEvidence === undefined ? {} : { visualEvidence: visualEvidence.map(item => ({ captureId: item.captureId, publicSafe: true })) }),
|
|
784
815
|
...(typeof args.reviewVerdict === "string" ? { reviewVerdict: args.reviewVerdict } : {}),
|
|
785
816
|
...(args.verificationCommand ? { verificationCommand: args.verificationCommand } : {}),
|
|
786
817
|
...(args.repositorySelection ? { repositorySelection: args.repositorySelection } : {}),
|
|
@@ -838,11 +869,11 @@ export function createMikkaMcpBackend(config, { signal, assertLive } = {}) {
|
|
|
838
869
|
}
|
|
839
870
|
if (capturesDir && params?.name === CAPTURE_TOOL.name) {
|
|
840
871
|
try {
|
|
841
|
-
queueCapture(params.arguments ?? {})
|
|
872
|
+
const captureId = queueCapture(params.arguments ?? {})
|
|
873
|
+
return reply(id, { content: [{ type: "text", text: JSON.stringify({ captureId, status: 'queued' }) }] })
|
|
842
874
|
} catch (error) {
|
|
843
875
|
return reply(id, { isError: true, content: [{ type: "text", text: `Not attached: ${error instanceof Error ? error.message : error}` }] })
|
|
844
876
|
}
|
|
845
|
-
return reply(id, { content: [{ type: "text", text: "Attached to this thread. Keep working; it uploads in the background." }] })
|
|
846
877
|
}
|
|
847
878
|
const kind = KINDS[params?.name]
|
|
848
879
|
if (!kind) return fail(id, -32602, `Unknown tool: ${params?.name}`)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"sourceSha": "
|
|
3
|
+
"sourceSha": "1a57df9c1a1d8e475820afad14e3fa0e6429c60b",
|
|
4
4
|
"repository": "alexj11324/Mikka",
|
|
5
|
-
"buildRunId": "
|
|
5
|
+
"buildRunId": "43680162859",
|
|
6
6
|
"buildKind": "github-actions-main",
|
|
7
|
-
"sourceLockSha256": "
|
|
8
|
-
"createdAt": "2026-11-
|
|
7
|
+
"sourceLockSha256": "ef566c7e7ffb23a605b6f4c0c5b715caba7afed70b6155251db2eead6b9c426b",
|
|
8
|
+
"createdAt": "2026-11-15T05:18:03.809Z",
|
|
9
9
|
"sbom": "sbom.cdx.json",
|
|
10
10
|
"files": [
|
|
11
11
|
{
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"path": "cli.js",
|
|
38
|
-
"size":
|
|
39
|
-
"sha256": "
|
|
38
|
+
"size": 1086259,
|
|
39
|
+
"sha256": "ea56a7ceb5c35eba4f0271899897ef65659f0b75526015eef303e4ed0628130e"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"path": "client.js",
|
|
43
|
-
"size":
|
|
44
|
-
"sha256": "
|
|
43
|
+
"size": 210939,
|
|
44
|
+
"sha256": "c234f59a4d749088f10d53a30cced6b45651be5682377c2666ee9724bd0b4480"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"path": "computer/driver.mjs",
|
|
@@ -160,8 +160,8 @@
|
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
"path": "http-link.js",
|
|
163
|
-
"size":
|
|
164
|
-
"sha256": "
|
|
163
|
+
"size": 307782,
|
|
164
|
+
"sha256": "677cc92b0a37829a81acfb4f1f3853405f60d55f2533d77e972619671db9ccfa"
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
"path": "log.js",
|
|
@@ -170,13 +170,13 @@
|
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
"path": "login.js",
|
|
173
|
-
"size":
|
|
174
|
-
"sha256": "
|
|
173
|
+
"size": 267759,
|
|
174
|
+
"sha256": "5e681474072ee853605766b0f5bb32875ff3b649705eeb96751912119bc6153e"
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
"path": "main.js",
|
|
178
|
-
"size":
|
|
179
|
-
"sha256": "
|
|
178
|
+
"size": 1025160,
|
|
179
|
+
"sha256": "d9d85753fe50ed742646cb74af090563ee08bc44ec17f867f4bc7f0e5bbde16e"
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
"path": "mcp-stdio-launcher.mjs",
|
|
@@ -185,8 +185,8 @@
|
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
"path": "mikka-mcp-backend.mjs",
|
|
188
|
-
"size":
|
|
189
|
-
"sha256": "
|
|
188
|
+
"size": 59246,
|
|
189
|
+
"sha256": "98dc782eaf2b3808168101f405a40ef91f8c176d9eda4287b44ce07968fe7b64"
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
"path": "mikka-mcp-context.mjs",
|
|
@@ -205,23 +205,23 @@
|
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
"path": "mikka.js",
|
|
208
|
-
"size":
|
|
209
|
-
"sha256": "
|
|
208
|
+
"size": 1086275,
|
|
209
|
+
"sha256": "e42cbceb675332d849f8b06beed3274f3bcc817c03a3146d5cb5c780496cec82"
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
212
|
"path": "npm-shrinkwrap.json",
|
|
213
213
|
"size": 85262,
|
|
214
|
-
"sha256": "
|
|
214
|
+
"sha256": "ce85f2519ea4914b69ee9b0b269ddd14723e8987d42a35f221ab047967494eff"
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
217
|
"path": "package.json",
|
|
218
218
|
"size": 1551,
|
|
219
|
-
"sha256": "
|
|
219
|
+
"sha256": "2eb57842ead2f8da80bd60384ce5b645425105c36314d0a9f9c873f661423afa"
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
222
|
"path": "paths.js",
|
|
223
223
|
"size": 4585,
|
|
224
|
-
"sha256": "
|
|
224
|
+
"sha256": "a8758b27ab20c25d3529b8e5be698163a4236e6371bf7830a4136d15707b0c3b"
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
227
|
"path": "sandbox.js",
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
{
|
|
232
232
|
"path": "sbom.cdx.json",
|
|
233
233
|
"size": 155689,
|
|
234
|
-
"sha256": "
|
|
234
|
+
"sha256": "c41e717b577ac5a46fe086b3e65f1522b97ba75f20c1bbcc94578511da68d2a1"
|
|
235
235
|
}
|
|
236
236
|
]
|
|
237
237
|
}
|