@aspectlylabs/mikka 0.0.648 → 0.0.652

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.
@@ -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: 100_000_000, webm: 100_000_000 }
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
- "Attach a screenshot or screen recording you made (for example with Playwright) to this thread as evidence for the person. PNG, JPEG or WebP up to 10 MB; MP4 or WebM up to 100 MB. Pass a file inside the worktree or your temp directory.",
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": "2e9c04daba44caec091c927f23b3cb825d9c4e23",
3
+ "sourceSha": "69f071e0b39bad61cb617f495e04e7328cdd749e",
4
4
  "repository": "alexj11324/Mikka",
5
- "buildRunId": "43618071679",
5
+ "buildRunId": "43681583567",
6
6
  "buildKind": "github-actions-main",
7
- "sourceLockSha256": "1c03b52cbe2142ba42932f51ac717e5ef57e53a1b16f3642a251f61163227acb",
8
- "createdAt": "2026-11-14T16:57:07.615Z",
7
+ "sourceLockSha256": "ef566c7e7ffb23a605b6f4c0c5b715caba7afed70b6155251db2eead6b9c426b",
8
+ "createdAt": "2026-11-15T05:36:44.495Z",
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": 1059492,
39
- "sha256": "d07a5389c0172a26cb71e77fc8d2be77266d0715d90c5774d50d3e1a661923ad"
38
+ "size": 1086259,
39
+ "sha256": "30c78be5c90d2524f81d0d1c49cf8bed39d32791e50d90f3123aa92a90f9e403"
40
40
  },
41
41
  {
42
42
  "path": "client.js",
43
- "size": 209484,
44
- "sha256": "952bbd87d5fead2fca172530b3d95d35c785e0093c506ab17410508ff15167b8"
43
+ "size": 210939,
44
+ "sha256": "417f3ab9e6684083830e78eb785ded904af6dbce74b47446d0a8a6020c493bfe"
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": 304688,
164
- "sha256": "09d7d301c547bae5bbd6733b1aa81ebcb3157418680fc826917b0ec306517b19"
163
+ "size": 307782,
164
+ "sha256": "e7b60f82bdfbf10c66d66c4edc10bdca814ac6629f675373d19b51db8d90c458"
165
165
  },
166
166
  {
167
167
  "path": "log.js",
@@ -170,13 +170,13 @@
170
170
  },
171
171
  {
172
172
  "path": "login.js",
173
- "size": 264978,
174
- "sha256": "3b6196f63ac5c92b90dd5c8d48972fc92d1d9cbdcbe1b46a047eec28689c028a"
173
+ "size": 267759,
174
+ "sha256": "f74e0d7483a1050b8d9e22a00ab4660550bb951ae56806a3d70266b50d46c442"
175
175
  },
176
176
  {
177
177
  "path": "main.js",
178
- "size": 998709,
179
- "sha256": "c30bd4d04ecfed77516545c89fc2966aa0a7fa62fa4729756d405406a2033a64"
178
+ "size": 1025160,
179
+ "sha256": "3179864258943fd457bf44d0ebc6d7a5e3f693ed991870d227e34ca1aa5efe4d"
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": 55794,
189
- "sha256": "0a1c620aaff1b847a19fe7df944065062fa37267a650ef149d916b4730baab9d"
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": 1059508,
209
- "sha256": "f693f6dca18ca6530ddacb4f52b98bb917b7050dd68373f0a1020690ea49d055"
208
+ "size": 1086275,
209
+ "sha256": "238486c1ca482c9e53e5bae06137084a64453659a2583c921037687b18513b3d"
210
210
  },
211
211
  {
212
212
  "path": "npm-shrinkwrap.json",
213
213
  "size": 85262,
214
- "sha256": "cc8c4fc2179ae0c3d282d8f8d855ad20b2b6c002d59a0f31e06f40ce4304037d"
214
+ "sha256": "6a177cad30f2fd21cbd5664c9df06e9663b8cccf770c144e9773a6a242c3dd8e"
215
215
  },
216
216
  {
217
217
  "path": "package.json",
218
218
  "size": 1551,
219
- "sha256": "239a579e1c093748608b9ac5444fba042499e347e01b9d6eff8faa6378fe711b"
219
+ "sha256": "7f6a752fb91b42e3db6dfc3d6c20fac8269b4baa07421c9ce60afdafab6107c2"
220
220
  },
221
221
  {
222
222
  "path": "paths.js",
223
223
  "size": 4585,
224
- "sha256": "6fe0df3cdfe734f0bec4cda641ba7e53f2b65c1a53ceb9af49724acec4765552"
224
+ "sha256": "f141835946cde84aa5a8c87d74c8079f4d711cd52e38e6cdd2e50d4e4fd531d1"
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": "910e8ff536281eaedc1f37bebfef00546f498a60ed6ed9e6cb86f781dda05c49"
234
+ "sha256": "723bbad0a6fa4715b48bdf36e152611f0bc427233369763081c47ae8b5530579"
235
235
  }
236
236
  ]
237
237
  }