@lensmcp/protocol-types 1.25.79 → 1.26.1

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 (55) hide show
  1. package/index.d.ts +9 -1
  2. package/index.js +1 -1
  3. package/lib/ai-call-groups.js +2 -2
  4. package/lib/ai-call-row.js +3 -3
  5. package/lib/ai-call.js +9 -9
  6. package/lib/ai-context.js +6 -6
  7. package/lib/ai-origins.js +9 -9
  8. package/lib/attributes.d.ts +15 -0
  9. package/lib/attributes.js +1 -1
  10. package/lib/bounded-clone.js +1 -1
  11. package/lib/bounded-map.js +1 -1
  12. package/lib/bounded-writer.js +1 -1
  13. package/lib/capture-demand.js +1 -1
  14. package/lib/changes.d.ts +48 -0
  15. package/lib/dashboard-lint.d.ts +207 -0
  16. package/lib/dashboard-lint.js +1 -0
  17. package/lib/dashboard-path.d.ts +15 -0
  18. package/lib/dashboard-path.js +1 -0
  19. package/lib/dashboard.d.ts +198 -3
  20. package/lib/error-cause.d.ts +69 -0
  21. package/lib/error-cause.js +5 -0
  22. package/lib/error-dismissal.js +1 -1
  23. package/lib/event-loop.d.ts +57 -1
  24. package/lib/event-loop.js +1 -1
  25. package/lib/flood-guard.js +1 -1
  26. package/lib/follow-ups.d.ts +238 -0
  27. package/lib/follow-ups.js +1 -0
  28. package/lib/goal-design.d.ts +51 -0
  29. package/lib/goal-design.js +1 -1
  30. package/lib/goal-outcome.d.ts +12 -1
  31. package/lib/goal-retro.d.ts +21 -0
  32. package/lib/lint-coverage.d.ts +113 -0
  33. package/lib/lint-coverage.js +1 -0
  34. package/lib/log-query.js +1 -1
  35. package/lib/metrics-reset.js +1 -1
  36. package/lib/overseer-findings.js +1 -1
  37. package/lib/perf-rules.js +1 -1
  38. package/lib/pod-memory.d.ts +2 -0
  39. package/lib/pod-memory.js +1 -1
  40. package/lib/producer-health.js +1 -1
  41. package/lib/role-fidelity.d.ts +210 -0
  42. package/lib/role-fidelity.js +1 -0
  43. package/lib/sources.js +1 -1
  44. package/lib/system-report.js +1 -1
  45. package/lib/team-delivery.d.ts +38 -4
  46. package/lib/team-delivery.js +1 -1
  47. package/lib/team-design.d.ts +224 -0
  48. package/lib/team-design.js +1 -1
  49. package/lib/team-prompts.d.ts +16 -7
  50. package/lib/team-prompts.js +4 -47
  51. package/lib/team-skills.d.ts +355 -0
  52. package/lib/team-skills.js +1 -0
  53. package/lib/team.d.ts +95 -1
  54. package/lib/team.js +1 -1
  55. package/package.json +1 -1
package/lib/attributes.js CHANGED
@@ -1 +1 @@
1
- "use strict";import{z as e}from"zod";export const RenderPhaseSchema=e.enum(["mount","update"]),RenderWhySchema=e.discriminatedUnion("type",[e.object({type:e.literal("props"),changedKeys:e.array(e.string())}),e.object({type:e.literal("react-state"),hookIndex:e.number().int()}),e.object({type:e.literal("context"),contextName:e.string()}),e.object({type:e.literal("valtio-path"),path:e.string(),changedKeys:e.array(e.string())}),e.object({type:e.literal("parent-render"),parentRenderId:e.string()}),e.object({type:e.literal("hook-dep-changed"),hookInstanceId:e.string(),depsHashBefore:e.string(),depsHashAfter:e.string()}),e.object({type:e.literal("force"),reason:e.string()})]),RenderAttrsSchema=e.object({phase:RenderPhaseSchema,actualDurationMs:e.number().nonnegative(),baseDurationMs:e.number().nonnegative(),startTime:e.number().nonnegative(),commitTime:e.number().nonnegative(),why:e.array(RenderWhySchema)}),EffectRunAttrsSchema=e.object({hookInstanceId:e.string(),depsHash:e.string(),prevDepsHash:e.string().optional(),durationMs:e.number().nonnegative(),cleanupRan:e.boolean().optional()}),ValtioUpdateAttrsSchema=e.object({storeId:e.string(),path:e.string(),changedKeys:e.array(e.string()),beforeHash:e.string(),afterHash:e.string(),preview:e.unknown().optional()}),ServerRequestAttrsSchema=e.object({method:e.string(),route:e.string(),status:e.number().int().optional(),durationMs:e.number().nonnegative().optional(),traceparent:e.string().optional()}),LoopPatternSchema=e.enum(["N+1","sequential-await","growing-allocation"]),LoopAttrsSchema=e.object({iterations:e.number().int().nonnegative(),durationMs:e.number().nonnegative(),dbCallsInsideLoop:e.number().int().nonnegative(),dbBurst:e.number().int().nonnegative().optional(),stream:e.boolean().optional(),redisCallsInsideLoop:e.number().int().nonnegative(),awaitedOperationsInsideLoop:e.number().int().nonnegative(),slowestIterations:e.array(e.object({index:e.number().int().nonnegative(),durationMs:e.number().nonnegative(),childNodeIds:e.array(e.string())})).optional(),patterns:e.array(LoopPatternSchema).optional()}),MemoryContainerKindSchema=e.enum(["Map","Set","Array","EventEmitter","Queue","RxSubject","Timer","Interval","Custom"]),MemoryOwnerAttrsSchema=e.object({ownerInstanceId:e.string(),containerKind:MemoryContainerKindSchema,fieldName:e.string(),itemCount:e.number().int().nonnegative(),estimatedBytes:e.number().nonnegative(),retainedBytes:e.number().nonnegative().optional(),growthSinceStart:e.number()}),MemoryMutationOperationSchema=e.enum(["set","push","add","delete","clear","subscribe","listen","schedule"]),MemoryMutationAttrsSchema=e.object({ownerNodeId:e.string(),operation:MemoryMutationOperationSchema,beforeCount:e.number().int().nonnegative(),afterCount:e.number().int().nonnegative(),estimatedDeltaBytes:e.number(),keyPreview:e.string().optional(),valueType:e.string().optional()}),RectSchema=e.object({x:e.number(),y:e.number(),width:e.number().nonnegative(),height:e.number().nonnegative()}),VisualFrameCauseSchema=e.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]),VisualChangeKindSchema=e.enum(["computed-style","layout","paint-order"]),VisualFrameAttrsSchema=e.object({causedBy:VisualFrameCauseSchema,viewport:RectSchema,layoutSnapshotId:e.string(),styleSnapshotId:e.string(),screenshotId:e.string().optional(),changedNodes:e.array(e.object({uid:e.string(),component:e.string().optional(),change:VisualChangeKindSchema,property:e.string().optional(),before:e.unknown().optional(),after:e.unknown().optional()}))}),VisualRuleTypeSchema=e.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]),VisualRuleTimingSchema=e.enum(["always","after-animation","stable-only","during-animation"]),VisualViolationSeveritySchema=e.enum(["info","warning","error"]),VisualViolationAttrsSchema=e.object({ruleId:e.string(),ruleType:VisualRuleTypeSchema,severity:VisualViolationSeveritySchema,timing:VisualRuleTimingSchema,element:e.object({uid:e.string(),component:e.string().optional(),rect:RectSchema}),expected:e.record(e.string(),e.unknown()),actual:e.record(e.string(),e.unknown()),evidence:e.object({computedStyle:e.string().optional(),screenshotCrop:e.string().optional(),trace:e.string().optional(),cssCause:e.object({selector:e.string(),file:e.string().optional(),line:e.number().int().optional(),declaration:e.string().optional()}).optional()})});
1
+ "use strict";import{z as e}from"zod";export const RenderPhaseSchema=e.enum(["mount","update"]),RenderWhySchema=e.discriminatedUnion("type",[e.object({type:e.literal("props"),changedKeys:e.array(e.string())}),e.object({type:e.literal("react-state"),hookIndex:e.number().int()}),e.object({type:e.literal("context"),contextName:e.string()}),e.object({type:e.literal("valtio-path"),path:e.string(),changedKeys:e.array(e.string())}),e.object({type:e.literal("parent-render"),parentRenderId:e.string()}),e.object({type:e.literal("hook-dep-changed"),hookInstanceId:e.string(),depsHashBefore:e.string(),depsHashAfter:e.string()}),e.object({type:e.literal("force"),reason:e.string()})]),RenderAttrsSchema=e.object({phase:RenderPhaseSchema,actualDurationMs:e.number().nonnegative(),baseDurationMs:e.number().nonnegative(),startTime:e.number().nonnegative(),commitTime:e.number().nonnegative(),why:e.array(RenderWhySchema)}),EffectRunAttrsSchema=e.object({hookInstanceId:e.string(),depsHash:e.string(),prevDepsHash:e.string().optional(),durationMs:e.number().nonnegative(),cleanupRan:e.boolean().optional()}),ValtioUpdateAttrsSchema=e.object({storeId:e.string(),path:e.string(),changedKeys:e.array(e.string()),beforeHash:e.string(),afterHash:e.string(),preview:e.unknown().optional()}),ServerRequestAttrsSchema=e.object({method:e.string(),route:e.string(),status:e.number().int().optional(),durationMs:e.number().nonnegative().optional(),traceparent:e.string().optional()}),LoopPatternSchema=e.enum(["N+1","sequential-await","growing-allocation"]),LoopAttrsSchema=e.object({iterations:e.number().int().nonnegative(),durationMs:e.number().nonnegative(),dbCallsInsideLoop:e.number().int().nonnegative(),class:e.enum(["loop","repeated-read","sequential"]).optional(),sqlId:e.string().optional(),method:e.string().optional(),calls:e.number().int().nonnegative().optional(),distinctStatements:e.number().int().nonnegative().optional(),distinctValues:e.number().int().nonnegative().optional(),repeated:e.array(e.object({sqlId:e.string(),calls:e.number().int().nonnegative(),distinctValues:e.number().int().nonnegative().optional()})).optional(),dbBurst:e.number().int().nonnegative().optional(),stream:e.boolean().optional(),redisCallsInsideLoop:e.number().int().nonnegative(),awaitedOperationsInsideLoop:e.number().int().nonnegative(),slowestIterations:e.array(e.object({index:e.number().int().nonnegative(),durationMs:e.number().nonnegative(),childNodeIds:e.array(e.string())})).optional(),patterns:e.array(LoopPatternSchema).optional()}),MemoryContainerKindSchema=e.enum(["Map","Set","Array","EventEmitter","Queue","RxSubject","Timer","Interval","Custom"]),MemoryOwnerAttrsSchema=e.object({ownerInstanceId:e.string(),containerKind:MemoryContainerKindSchema,fieldName:e.string(),itemCount:e.number().int().nonnegative(),estimatedBytes:e.number().nonnegative(),retainedBytes:e.number().nonnegative().optional(),growthSinceStart:e.number()}),MemoryMutationOperationSchema=e.enum(["set","push","add","delete","clear","subscribe","listen","schedule"]),MemoryMutationAttrsSchema=e.object({ownerNodeId:e.string(),operation:MemoryMutationOperationSchema,beforeCount:e.number().int().nonnegative(),afterCount:e.number().int().nonnegative(),estimatedDeltaBytes:e.number(),keyPreview:e.string().optional(),valueType:e.string().optional()}),RectSchema=e.object({x:e.number(),y:e.number(),width:e.number().nonnegative(),height:e.number().nonnegative()}),VisualFrameCauseSchema=e.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]),VisualChangeKindSchema=e.enum(["computed-style","layout","paint-order"]),VisualFrameAttrsSchema=e.object({causedBy:VisualFrameCauseSchema,viewport:RectSchema,layoutSnapshotId:e.string(),styleSnapshotId:e.string(),screenshotId:e.string().optional(),changedNodes:e.array(e.object({uid:e.string(),component:e.string().optional(),change:VisualChangeKindSchema,property:e.string().optional(),before:e.unknown().optional(),after:e.unknown().optional()}))}),VisualRuleTypeSchema=e.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]),VisualRuleTimingSchema=e.enum(["always","after-animation","stable-only","during-animation"]),VisualViolationSeveritySchema=e.enum(["info","warning","error"]),VisualViolationAttrsSchema=e.object({ruleId:e.string(),ruleType:VisualRuleTypeSchema,severity:VisualViolationSeveritySchema,timing:VisualRuleTimingSchema,element:e.object({uid:e.string(),component:e.string().optional(),rect:RectSchema}),expected:e.record(e.string(),e.unknown()),actual:e.record(e.string(),e.unknown()),evidence:e.object({computedStyle:e.string().optional(),screenshotCrop:e.string().optional(),trace:e.string().optional(),cssCause:e.object({selector:e.string(),file:e.string().optional(),line:e.number().int().optional(),declaration:e.string().optional()}).optional()})});
@@ -1 +1 @@
1
- "use strict";var T=Object.defineProperty;var i=(e,t)=>T(e,"name",{value:t,configurable:!0});var h=Object.defineProperty,l=i((e,t)=>h(e,"name",{value:t,configurable:!0}),"_");export const DEFAULT_RAW_BYTE_LIMIT=32768,DEFAULT_MAX_STRING_BYTES=4096,DEFAULT_MAX_ARRAY_ITEMS=64,DEFAULT_MAX_DEPTH=12,CHEAP_ENTRY_BYTES=512,NOMINAL_DEEP_BYTES=32,DEEP_REPORT_DEPTH=64,SKELETON_STRING_BYTES=256,MAX_RECORDED_PATHS=20,TRUNCATION_MARKER_KEY="__lensmcpTruncation",TRUNCATED_VALUE_KEY="__lensmcpTruncated";export function estimateJsonBytes(e,t=Number.POSITIVE_INFINITY,r=12){return y(e,t,r,32)}i(estimateJsonBytes,"estimateJsonBytes"),l(estimateJsonBytes,"estimateJsonBytes");export function exceedsJsonByteBudget(e,t,r=12){return y(e,t,r,Number.POSITIVE_INFINITY)>t}i(exceedsJsonByteBudget,"exceedsJsonByteBudget"),l(exceedsJsonByteBudget,"exceedsJsonByteBudget");function y(e,t,r,a){switch(typeof e){case"undefined":case"function":case"symbol":return 0;case"boolean":return 5;case"number":return Number.isFinite(e)?8:4;case"bigint":return 20;case"string":return e.length+2;default:break}if(e===null)return 4;if(r<=0)return a;if(e instanceof Date)return 26;if(Array.isArray(e)){let n=2;for(let s=0;s<e.length;s++)if(n+=y(e[s],t-n,r-1,a)+1,n>t)return n;return n}let u=2;const o=e;for(const n in o){if(!Object.prototype.hasOwnProperty.call(o,n))continue;const s=y(o[n],t-u,r-1,a);if(s!==0&&(u+=n.length+4+s,u>t))return u}return u}i(y,"T"),l(y,"walk");function g(e,t){e.truncatedAnything=!0,e.paths.length<20&&e.paths.push(t||"<root>")}i(g,"A"),l(g,"record");function f(e,t,r){return g(e,r),{[TRUNCATED_VALUE_KEY]:!0,originalBytes:estimateJsonBytes(t,Number.POSITIVE_INFINITY,64)}}i(f,"I"),l(f,"stub");function p(e){if(e===null)return!0;const t=typeof e;return t==="number"||t==="boolean"||t==="string"||t==="bigint"}i(p,"y"),l(p,"isScalar");export function clampValue(e,t,r,a){if(typeof e=="string"){const u=t.budget<=0?256:t.maxStringBytes;if(e.length+2<=u)return t.budget-=e.length+2,e;const o=Math.max(0,u-64);return g(t,a),t.budget-=o,`${e.slice(0,o)}\u2026[lensmcp truncated: ${e.length-o} more chars]`}return e===null||typeof e!="object"?(t.budget-=y(e,Number.POSITIVE_INFINITY,1,32),e):r<=0?f(t,e,a):e instanceof Date?(t.budget-=26,e):Array.isArray(e)?m(e,t,r,a):b(e,t,r,a)}i(clampValue,"clampValue"),l(clampValue,"clampValue");function m(e,t,r,a){const u=[],o=Math.min(e.length,t.maxArrayItems);for(let n=0;n<o&&!(t.budget<=0);n++)u.push(clampValue(e[n],t,r-1,`${a}[${n}]`));return u.length<e.length&&g(t,`${a}[] (+${e.length-u.length} items dropped)`),u}i(m,"f"),l(m,"clampArray");function b(e,t,r,a){const u={};let o;const n=t.budget<=0;for(const s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;const c=e[s],I=y(c,512,r-1,Number.POSITIVE_INFINITY);if(I<=512&&(!n||p(c))){u[s]=c,t.budget-=s.length+4+I;continue}(o??=[]).push({key:s,bytes:I})}if(!o)return u;o.sort((s,c)=>s.bytes===c.bytes?0:s.bytes<c.bytes?-1:1);for(const{key:s}of o){const c=a?`${a}.${s}`:s;u[s]=clampValue(e[s],t,r-1,c)}return u}i(b,"m"),l(b,"clampObject");export function boundedClone(e,t={}){const r=t.rawByteLimit??32768,a=t.maxDepth??12;if(r<=0)return{value:void 0,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(e==null)return{value:e,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(!exceedsJsonByteBudget(e,r,a)){const c=estimateJsonBytes(e,r,a),I={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1};return{value:clampValue(e,I,a,""),truncated:!1,originalBytes:c,keptBytes:c,paths:[]}}const u=estimateJsonBytes(e,Number.POSITIVE_INFINITY,64),o={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1},n=clampValue(e,o,a,""),s=estimateJsonBytes(n,Number.POSITIVE_INFINITY,a);if(o.truncatedAnything&&n!==null&&typeof n=="object"&&!Array.isArray(n)){const c={truncated:!0,originalBytes:u,keptBytes:s,paths:o.paths};n[TRUNCATION_MARKER_KEY]=c}return{value:n,truncated:o.truncatedAnything,originalBytes:u,keptBytes:s,paths:o.paths}}i(boundedClone,"boundedClone"),l(boundedClone,"boundedClone");
1
+ "use strict";var T=Object.defineProperty;var c=(t,e)=>T(t,"name",{value:e,configurable:!0});var h=Object.defineProperty,l=c((t,e)=>h(t,"name",{value:e,configurable:!0}),"i"),_=Object.defineProperty,y=l((t,e)=>_(t,"name",{value:e,configurable:!0}),"_");export const DEFAULT_RAW_BYTE_LIMIT=32768,DEFAULT_MAX_STRING_BYTES=4096,DEFAULT_MAX_ARRAY_ITEMS=64,DEFAULT_MAX_DEPTH=12,CHEAP_ENTRY_BYTES=512,NOMINAL_DEEP_BYTES=32,DEEP_REPORT_DEPTH=64,SKELETON_STRING_BYTES=256,MAX_RECORDED_PATHS=20,TRUNCATION_MARKER_KEY="__lensmcpTruncation",TRUNCATED_VALUE_KEY="__lensmcpTruncated";export function estimateJsonBytes(t,e=Number.POSITIVE_INFINITY,n=12){return g(t,e,n,32)}c(estimateJsonBytes,"estimateJsonBytes"),l(estimateJsonBytes,"estimateJsonBytes"),y(estimateJsonBytes,"estimateJsonBytes");export function exceedsJsonByteBudget(t,e,n=12){return g(t,e,n,Number.POSITIVE_INFINITY)>e}c(exceedsJsonByteBudget,"exceedsJsonByteBudget"),l(exceedsJsonByteBudget,"exceedsJsonByteBudget"),y(exceedsJsonByteBudget,"exceedsJsonByteBudget");function g(t,e,n,a){switch(typeof t){case"undefined":case"function":case"symbol":return 0;case"boolean":return 5;case"number":return Number.isFinite(t)?8:4;case"bigint":return 20;case"string":return t.length+2;default:break}if(t===null)return 4;if(n<=0)return a;if(t instanceof Date)return 26;if(Array.isArray(t)){let r=2;for(let u=0;u<t.length;u++)if(r+=g(t[u],e-r,n-1,a)+1,r>e)return r;return r}let s=2;const o=t;for(const r in o){if(!Object.prototype.hasOwnProperty.call(o,r))continue;const u=g(o[r],e-s,n-1,a);if(u!==0&&(s+=r.length+4+u,s>e))return s}return s}c(g,"y"),l(g,"T"),y(g,"walk");function f(t,e){t.truncatedAnything=!0,t.paths.length<20&&t.paths.push(e||"<root>")}c(f,"g"),l(f,"A"),y(f,"record");function p(t,e,n){return f(t,n),{[TRUNCATED_VALUE_KEY]:!0,originalBytes:estimateJsonBytes(e,Number.POSITIVE_INFINITY,64)}}c(p,"f"),l(p,"I"),y(p,"stub");function m(t){if(t===null)return!0;const e=typeof t;return e==="number"||e==="boolean"||e==="string"||e==="bigint"}c(m,"p"),l(m,"y"),y(m,"isScalar");export function clampValue(t,e,n,a){if(typeof t=="string"){const s=e.budget<=0?256:e.maxStringBytes;if(t.length+2<=s)return e.budget-=t.length+2,t;const o=Math.max(0,s-64);return f(e,a),e.budget-=o,`${t.slice(0,o)}\u2026[lensmcp truncated: ${t.length-o} more chars]`}return t===null||typeof t!="object"?(e.budget-=g(t,Number.POSITIVE_INFINITY,1,32),t):n<=0?p(e,t,a):t instanceof Date?(e.budget-=26,t):Array.isArray(t)?b(t,e,n,a):d(t,e,n,a)}c(clampValue,"clampValue"),l(clampValue,"clampValue"),y(clampValue,"clampValue");function b(t,e,n,a){const s=[],o=Math.min(t.length,e.maxArrayItems);for(let r=0;r<o&&!(e.budget<=0);r++)s.push(clampValue(t[r],e,n-1,`${a}[${r}]`));return s.length<t.length&&f(e,`${a}[] (+${t.length-s.length} items dropped)`),s}c(b,"m"),l(b,"f"),y(b,"clampArray");function d(t,e,n,a){const s={};let o;const r=e.budget<=0;for(const u in t){if(!Object.prototype.hasOwnProperty.call(t,u))continue;const i=t[u],I=g(i,512,n-1,Number.POSITIVE_INFINITY);if(I<=512&&(!r||m(i))){s[u]=i,e.budget-=u.length+4+I;continue}(o??=[]).push({key:u,bytes:I})}if(!o)return s;o.sort((u,i)=>u.bytes===i.bytes?0:u.bytes<i.bytes?-1:1);for(const{key:u}of o){const i=a?`${a}.${u}`:u;s[u]=clampValue(t[u],e,n-1,i)}return s}c(d,"b"),l(d,"m"),y(d,"clampObject");export function boundedClone(t,e={}){const n=e.rawByteLimit??32768,a=e.maxDepth??12;if(n<=0)return{value:void 0,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(t==null)return{value:t,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(!exceedsJsonByteBudget(t,n,a)){const i=estimateJsonBytes(t,n,a),I={budget:n,maxStringBytes:e.maxStringBytes??4096,maxArrayItems:e.maxArrayItems??64,paths:[],truncatedAnything:!1};return{value:clampValue(t,I,a,""),truncated:!1,originalBytes:i,keptBytes:i,paths:[]}}const s=estimateJsonBytes(t,Number.POSITIVE_INFINITY,64),o={budget:n,maxStringBytes:e.maxStringBytes??4096,maxArrayItems:e.maxArrayItems??64,paths:[],truncatedAnything:!1},r=clampValue(t,o,a,""),u=estimateJsonBytes(r,Number.POSITIVE_INFINITY,a);if(o.truncatedAnything&&r!==null&&typeof r=="object"&&!Array.isArray(r)){const i={truncated:!0,originalBytes:s,keptBytes:u,paths:o.paths};r[TRUNCATION_MARKER_KEY]=i}return{value:r,truncated:o.truncatedAnything,originalBytes:s,keptBytes:u,paths:o.paths}}c(boundedClone,"boundedClone"),l(boundedClone,"boundedClone"),y(boundedClone,"boundedClone");
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var t=(e,r)=>c(e,"name",{value:r,configurable:!0});var i=Object.defineProperty,s=t((e,r)=>i(e,"name",{value:r,configurable:!0}),"o");export function capMap(e,r){if(e.size<=r)return 0;let n=0;const o=e.keys();for(;e.size>r;){const a=o.next();if(a.done)break;e.delete(a.value)&&(n+=1)}return n}t(capMap,"capMap"),s(capMap,"capMap");export const MAX_PRODUCER_KEYS=256;
1
+ "use strict";var i=Object.defineProperty;var t=(e,a)=>i(e,"name",{value:a,configurable:!0});var p=Object.defineProperty,o=t((e,a)=>p(e,"name",{value:a,configurable:!0}),"t"),s=Object.defineProperty,u=o((e,a)=>s(e,"name",{value:a,configurable:!0}),"o");export function capMap(e,a){if(e.size<=a)return 0;let r=0;const c=e.keys();for(;e.size>a;){const n=c.next();if(n.done)break;e.delete(n.value)&&(r+=1)}return r}t(capMap,"capMap"),o(capMap,"capMap"),u(capMap,"capMap");export const MAX_PRODUCER_KEYS=256;
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var r=(e,t)=>y(e,"name",{value:t,configurable:!0});var v=Object.defineProperty,o=r((e,t)=>v(e,"name",{value:t,configurable:!0}),"c");import{renameSync as l,statSync as f,unlinkSync as x}from"node:fs";export function eventMaxBytes(e=process.env){const t=Number(e.LENSMCP_EVENT_MAX_BYTES);return Number.isFinite(t)&&t>0?t:50*1024*1024}r(eventMaxBytes,"eventMaxBytes"),o(eventMaxBytes,"eventMaxBytes");export function eventMaxFiles(e=process.env){const t=Number(e.LENSMCP_EVENT_MAX_FILES);return Number.isFinite(t)&&t>=1&&t<=20?Math.floor(t):5}r(eventMaxFiles,"eventMaxFiles"),o(eventMaxFiles,"eventMaxFiles");const E=1024*1024,a=new Map;export function maybeRotateEventFile(e,t,i){const s=(a.get(e)??0)+t,c=i?.maxBytes??eventMaxBytes(),u=i?.maxFiles??eventMaxFiles(),m=Math.min(E,c);if(s<m){a.set(e,s);return}try{const n=f(e).size;if(a.set(e,0),n<=c)return}catch{a.set(e,s);return}try{x(`${e}.${u}`)}catch{}for(let n=u-1;n>=1;n--)try{l(`${e}.${n}`,`${e}.${n+1}`)}catch{}try{l(e,`${e}.1`)}catch{}}r(maybeRotateEventFile,"maybeRotateEventFile"),o(maybeRotateEventFile,"maybeRotateEventFile");export function resetRotationThrottle(e){e===void 0?a.clear():a.delete(e)}r(resetRotationThrottle,"resetRotationThrottle"),o(resetRotationThrottle,"resetRotationThrottle");
1
+ "use strict";var m=Object.defineProperty;var r=(t,e)=>m(t,"name",{value:e,configurable:!0});var f=Object.defineProperty,o=r((t,e)=>f(t,"name",{value:e,configurable:!0}),"r"),x=Object.defineProperty,s=o((t,e)=>x(t,"name",{value:e,configurable:!0}),"c");import{renameSync as v,statSync as M,unlinkSync as E}from"node:fs";export function eventMaxBytes(t=process.env){const e=Number(t.LENSMCP_EVENT_MAX_BYTES);return Number.isFinite(e)&&e>0?e:50*1024*1024}r(eventMaxBytes,"eventMaxBytes"),o(eventMaxBytes,"eventMaxBytes"),s(eventMaxBytes,"eventMaxBytes");export function eventMaxFiles(t=process.env){const e=Number(t.LENSMCP_EVENT_MAX_FILES);return Number.isFinite(e)&&e>=1&&e<=20?Math.floor(e):5}r(eventMaxFiles,"eventMaxFiles"),o(eventMaxFiles,"eventMaxFiles"),s(eventMaxFiles,"eventMaxFiles");const b=1024*1024,a=new Map;export function maybeRotateEventFile(t,e,c){const i=(a.get(t)??0)+e,l=c?.maxBytes??eventMaxBytes(),u=c?.maxFiles??eventMaxFiles(),y=Math.min(b,l);if(i<y){a.set(t,i);return}try{const n=M(t).size;if(a.set(t,0),n<=l)return}catch{a.set(t,i);return}try{E(`${t}.${u}`)}catch{}for(let n=u-1;n>=1;n--)try{v(`${t}.${n}`,`${t}.${n+1}`)}catch{}try{v(t,`${t}.1`)}catch{}}r(maybeRotateEventFile,"maybeRotateEventFile"),o(maybeRotateEventFile,"maybeRotateEventFile"),s(maybeRotateEventFile,"maybeRotateEventFile");export function resetRotationThrottle(t){t===void 0?a.clear():a.delete(t)}r(resetRotationThrottle,"resetRotationThrottle"),o(resetRotationThrottle,"resetRotationThrottle"),s(resetRotationThrottle,"resetRotationThrottle");
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var o=(t,e)=>c(t,"name",{value:e,configurable:!0});var s=Object.defineProperty,u=o((t,e)=>s(t,"name",{value:e,configurable:!0}),"s");export const CAPTURE_REQUEST_FILENAME="capture-request.json",CAPTURE_PRESENCE_FILENAME="capture-runner.json";export function appMatchesPage(t,e){const r=t.trim().toLowerCase();if(!r)return!1;if(e.project&&e.project.toLowerCase()===r)return!0;const n=e.url.toLowerCase();if(n===r||n.replace(/\/+$/,"")===r.replace(/\/+$/,""))return!0;try{const a=new URL(e.url);return/^\d+$/.test(r)?a.port===r:a.origin.toLowerCase()===r.replace(/\/+$/,"")}catch{return!1}}o(appMatchesPage,"appMatchesPage"),u(appMatchesPage,"appMatchesPage");export const CAPTURE_RULES_FILENAME="capture-rules.json";
1
+ "use strict";var s=Object.defineProperty;var a=(r,e)=>s(r,"name",{value:e,configurable:!0});var p=Object.defineProperty,c=a((r,e)=>p(r,"name",{value:e,configurable:!0}),"o"),u=Object.defineProperty,E=c((r,e)=>u(r,"name",{value:e,configurable:!0}),"s");export const CAPTURE_REQUEST_FILENAME="capture-request.json",CAPTURE_PRESENCE_FILENAME="capture-runner.json";export function appMatchesPage(r,e){const t=r.trim().toLowerCase();if(!t)return!1;if(e.project&&e.project.toLowerCase()===t)return!0;const o=e.url.toLowerCase();if(o===t||o.replace(/\/+$/,"")===t.replace(/\/+$/,""))return!0;try{const n=new URL(e.url);return/^\d+$/.test(t)?n.port===t:n.origin.toLowerCase()===t.replace(/\/+$/,"")}catch{return!1}}a(appMatchesPage,"appMatchesPage"),c(appMatchesPage,"appMatchesPage"),E(appMatchesPage,"appMatchesPage");export const CAPTURE_RULES_FILENAME="capture-rules.json";
package/lib/changes.d.ts CHANGED
@@ -126,6 +126,8 @@ export interface DashChangesDiff {
126
126
  key: string;
127
127
  path: string;
128
128
  sha?: string;
129
+ /** Against main: the merge base to its HEAD. */
130
+ against?: 'main';
129
131
  /** A unified patch of redacted copies; absent with `unavailable`. */
130
132
  text?: string;
131
133
  unavailable?: string;
@@ -134,3 +136,49 @@ export interface DashChangesDiff {
134
136
  /** Read with the whole file as context: no unchanged lines are hidden. */
135
137
  full?: true;
136
138
  }
139
+ /** A checkout against main (planning/changes «Later»): what it changed since it left main, and what main has it lacks. */
140
+ export interface DashChangesAgainst {
141
+ key: string;
142
+ at: number;
143
+ /** Where it left main: the merge base of its HEAD and main's. */
144
+ base: string;
145
+ head: string;
146
+ mainHead: string;
147
+ /** Its commits since the base, and main's since the base. */
148
+ ahead: number;
149
+ behind: number;
150
+ /** Files its commits changed since the base — the base to its HEAD; what is uncommitted is on its own tab. */
151
+ files: DashChangesFile[];
152
+ total: number;
153
+ truncated?: true;
154
+ /** Main's commits it lacks, newest first, at most 200. */
155
+ mainCommits: DashChangesCommit[];
156
+ }
157
+ /**
158
+ * A commit on main from the Changes page: every change on main (`all` — as `git add -A`: modified, deleted, renamed and
159
+ * new files, never ignored ones; refused if main's HEAD is no longer `head`), or the files chosen by hand, at most 1000.
160
+ */
161
+ export type DashChangesCommitRequest = {
162
+ key: string;
163
+ message: string;
164
+ all: true;
165
+ head?: string;
166
+ } | {
167
+ key: string;
168
+ message: string;
169
+ paths: string[];
170
+ };
171
+ /** What a write on the Changes page did. */
172
+ export interface DashChangesActed {
173
+ key: string;
174
+ action: 'commit' | 'push' | 'update';
175
+ outcome: 'committed' | 'pushed' | 'merged' | 'current' | 'conflicts' | 'asked';
176
+ /** One sentence for the person. */
177
+ said: string;
178
+ /** The commit a commit or a merge made. */
179
+ sha?: string;
180
+ /** The files a merge conflicted in (the merge was undone). */
181
+ conflicts?: string[];
182
+ /** Who was told: the goal's manager, by name or session. */
183
+ told?: string;
184
+ }
@@ -0,0 +1,207 @@
1
+ import type { LintCoverageKind } from './lint-coverage.js';
2
+ /**
3
+ * The dashboard's Lint page (Investigate › Lint, `GET /api/lint`): the ESLint findings `lint://errors` and
4
+ * `lint://warnings` hold, grouped and filtered on the server so the answer stays bounded, beside each lint run (when,
5
+ * how, what changed) and each project of the workspace — linted, or never linted.
6
+ */
7
+ /** A tab of the page: one severity. */
8
+ export type DashLintSeverity = 'error' | 'warning';
9
+ export type DashLintGroupBy = 'rule' | 'file' | 'project';
10
+ export declare const DASH_LINT_GROUP_BY: readonly DashLintGroupBy[];
11
+ export interface DashLintQuery {
12
+ severity: DashLintSeverity;
13
+ by: DashLintGroupBy;
14
+ /** Only the findings of this project (the one owning the file, else the run's scope). */
15
+ project?: string;
16
+ rule?: string;
17
+ /** Words in the rule, message, file or project. */
18
+ q?: string;
19
+ }
20
+ export interface DashLintFinding {
21
+ /** Its fingerprint — stable while it stays where it is. */
22
+ id: string;
23
+ severity: DashLintSeverity;
24
+ /** ESLint's rule id; `fatal` for a file ESLint could not parse. */
25
+ rule: string;
26
+ message: string;
27
+ /** Relative to the workspace when it is inside it. */
28
+ file?: string;
29
+ line?: number;
30
+ column?: number;
31
+ /** The project whose folder holds the file, else the run's scope. */
32
+ project: string;
33
+ /** The lint run that reported it (`lensmcp lint --project`, or its paths). */
34
+ scope: string;
35
+ /** When it was last seen: the time of the run that reported it. */
36
+ at: number;
37
+ /** ESLint offers a fix (`--fix`); absent when its run did not say. */
38
+ fixable?: boolean;
39
+ /** Not there when its file was linted before — absent the first time a file is linted. */
40
+ new?: true;
41
+ /** Found by the main checkout's lint, which this checkout's status started from — not by a run here. */
42
+ inherited?: true;
43
+ }
44
+ export interface DashLintGroup {
45
+ /** The rule id, the file or the project. */
46
+ key: string;
47
+ count: number;
48
+ newCount: number;
49
+ /** How many of them ESLint can fix, of the `fixKnown` whose run said. */
50
+ fixable: number;
51
+ fixKnown: number;
52
+ projects: string[];
53
+ projectCount: number;
54
+ files: number;
55
+ rules: number;
56
+ lastSeenAt: number;
57
+ findings: DashLintFinding[];
58
+ /** Its findings past `findings`. */
59
+ more: number;
60
+ }
61
+ export interface DashLintRunDiff {
62
+ newErrors: number;
63
+ newWarnings: number;
64
+ fixedErrors: number;
65
+ fixedWarnings: number;
66
+ /** A run held fewer messages than ESLint found: the ones past the cap were not compared. */
67
+ partial?: true;
68
+ }
69
+ export type DashLintRunState = 'running' | 'clean' | 'failing' | 'error';
70
+ /** What a run covered: it replaced the findings of these files and folders, and of no other. */
71
+ export interface DashLintCoverage {
72
+ kind: LintCoverageKind;
73
+ /** The folders and files it linted, relative to the workspace (`.` is the whole checkout) — the first few. */
74
+ paths: string[];
75
+ more?: number;
76
+ /** A changed run: the files it linted, the deleted ones it dropped, the ones git did not track, the ref it compared with (HEAD without). */
77
+ files?: number;
78
+ gone?: number;
79
+ untracked?: number;
80
+ base?: string;
81
+ /** Files ESLint linted, and the ones it was given that its config ignores. */
82
+ linted?: number;
83
+ notLinted?: number;
84
+ /** The commit it ran at (short), and whether the checkout had uncommitted changes then. */
85
+ head?: string;
86
+ dirty?: boolean;
87
+ /** A full lint of the workspace's projects: how many. A full lint with ESLint's cache off (`--full`). */
88
+ projects?: number;
89
+ fromZero?: boolean;
90
+ /** The caller passed ESLint its own arguments: only the files in its results count. */
91
+ narrowed?: boolean;
92
+ }
93
+ export interface DashLintWhole {
94
+ /** When it was last brought up to date, and the commit it is of (short). */
95
+ at: number;
96
+ sha?: string;
97
+ /** The last full lint — absent when the lens holds none. */
98
+ fullAt?: number;
99
+ fullSha?: string;
100
+ fromZero?: boolean;
101
+ updates: number;
102
+ /** It started from the main checkout's lint of that commit. */
103
+ inherited?: {
104
+ sha: string;
105
+ at: number;
106
+ };
107
+ /** The status is partial, and why — `lensmcp lint --full` lints everything again. */
108
+ partial?: string;
109
+ /** The full lint is of the workspace's projects: files outside every project are not linted by default. */
110
+ projects?: boolean;
111
+ }
112
+ /** One scope's last lint run. */
113
+ export interface DashLintRun {
114
+ scope: string;
115
+ tool: string;
116
+ state: DashLintRunState;
117
+ /** Its newest event — the end, else the start. */
118
+ at?: number;
119
+ /** When it last reached a verdict: earlier than `at` when its newest run failed to run. */
120
+ verdictAt?: number;
121
+ durationMs?: number;
122
+ /** ESLint's own counts at that verdict. */
123
+ found?: {
124
+ errors: number;
125
+ warnings: number;
126
+ };
127
+ /** What the lens holds of it — fewer than `found` when `truncated`. */
128
+ held: {
129
+ errors: number;
130
+ warnings: number;
131
+ };
132
+ truncated?: number;
133
+ /** How it ran: the command it recorded, else rebuilt from its paths. Absent from a run that recorded neither. */
134
+ how?: string;
135
+ cwd?: string;
136
+ targets?: string[];
137
+ error?: string;
138
+ diff?: DashLintRunDiff;
139
+ /** What it covered — absent from a run of a lensmcp from before runs said. */
140
+ coverage?: DashLintCoverage;
141
+ }
142
+ export type DashLintProjectState = 'linted' | 'never' | 'error' | 'running';
143
+ /** A project of the workspace (a `project.json` the lens found), and the lint runs that covered it. */
144
+ export interface DashLintProject {
145
+ name: string;
146
+ /** Its folder, relative to the workspace. */
147
+ root: string;
148
+ /** A service the lens runs. */
149
+ service?: true;
150
+ state: DashLintProjectState;
151
+ /** The findings held in its files — absent when no run covered it (never a fake 0). */
152
+ errors?: number;
153
+ warnings?: number;
154
+ /** Its newest covering run: when, which scope, how. */
155
+ at?: number;
156
+ by?: string;
157
+ how?: string;
158
+ /** No run linted its whole folder: only files in it, or a folder under it. */
159
+ partly?: true;
160
+ /** Runs that did not record their paths: one of them may have covered it. */
161
+ maybe?: string[];
162
+ error?: string;
163
+ }
164
+ export interface DashLintFacet {
165
+ name: string;
166
+ errors: number;
167
+ warnings: number;
168
+ }
169
+ export interface DashLint {
170
+ at: number;
171
+ /** False when this lens does not serve `lint://` (the feature is off). */
172
+ served: boolean;
173
+ status: 'unknown' | 'clean' | 'warning' | 'failing';
174
+ /** `none`: no lint run has ever reported here — unchecked, not passing. */
175
+ producer: 'none' | 'connected';
176
+ detail?: string;
177
+ stale?: boolean;
178
+ /** Distinct findings held, every project — what the tabs count. */
179
+ totals: {
180
+ errors: number;
181
+ warnings: number;
182
+ };
183
+ /** The same under the filters. */
184
+ matched: {
185
+ errors: number;
186
+ warnings: number;
187
+ };
188
+ /** The query as answered. */
189
+ query: DashLintQuery;
190
+ groups: DashLintGroup[];
191
+ moreGroups: number;
192
+ runs: DashLintRun[];
193
+ moreRuns: number;
194
+ projects: DashLintProject[];
195
+ moreProjects: number;
196
+ facets: {
197
+ projects: DashLintFacet[];
198
+ rules: DashLintFacet[];
199
+ };
200
+ /** The tab's findings the newest runs no longer report, against each scope's run before (filtered). */
201
+ fixed: DashLintFinding[];
202
+ fixedCount: number;
203
+ /** Some run was compared with the one before it: new and fixed say something only then. */
204
+ compared: boolean;
205
+ /** The saved lint of the whole checkout — absent before a full lint. */
206
+ whole?: DashLintWhole;
207
+ }
@@ -0,0 +1 @@
1
+ "use strict";export const DASH_LINT_GROUP_BY=["rule","file","project"];
@@ -0,0 +1,15 @@
1
+ /**
2
+ * An id as one segment of a dashboard path, and back — the ONE encoding every dashboard link uses (the SPA's router,
3
+ * the server's suggestion refs), so a link reloads, pastes and opens in a new tab.
4
+ *
5
+ * An id can hold `/` (a page `dashboard /companies/:id`, a route `assistant GET /v1/x`), and both gateways refuse a
6
+ * path holding `%2F`, `%2E`, `%5C`, `%00` or a backslash (ringwall canonical-path.ts, dev-gateway-11, prod-gateway-2) —
7
+ * so those never go out percent-encoded. `~` escapes them instead: `~s` a slash, `~b` a backslash, `~0` NUL, `~d` a
8
+ * dot of a `.` / `..` id (a dot segment the browser would resolve and the gateway refuse), `~~` a tilde. The rest is
9
+ * `encodeURIComponent`, with `:` and `@` left as they are to read: `dashboard%20~scompanies~s:id`.
10
+ *
11
+ * A link made before (`%2F` in the segment, saved in notes, an agent's prompt, the docs) still reads: such a segment
12
+ * is decoded as it was made, its `~` taken as written.
13
+ */
14
+ export declare function encodeSegment(id: string): string;
15
+ export declare function decodeSegment(segment: string): string;
@@ -0,0 +1 @@
1
+ "use strict";var d=Object.defineProperty;var t=(e,n)=>d(e,"name",{value:n,configurable:!0});var a=Object.defineProperty,c=t((e,n)=>a(e,"name",{value:n,configurable:!0}),"c"),g=Object.defineProperty,o=c((e,n)=>g(e,"name",{value:n,configurable:!0}),"t");const p={"~":"~~","/":"~s","\\":"~b","\0":"~0"},l={"~":"~",s:"/",b:"\\",0:"\0",d:"."},m=/%2f|%5c|%2e|%00/i;export function encodeSegment(e){return e==="."||e===".."?e.replace(/\./g,"~d"):encodeURIComponent(e.replace(/[~/\\\0]/g,n=>p[n])).replace(/%3A/g,":").replace(/%40/g,"@")}t(encodeSegment,"encodeSegment"),c(encodeSegment,"encodeSegment"),o(encodeSegment,"encodeSegment");export function decodeSegment(e){let n;try{n=decodeURIComponent(e)}catch{n=e}return m.test(e)?n:n.replace(/~([~sb0d])/g,(u,r)=>l[r])}t(decodeSegment,"decodeSegment"),c(decodeSegment,"decodeSegment"),o(decodeSegment,"decodeSegment");