@xenosystem/agent-sdk 0.10.7 → 0.10.9
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/dist/artifacts/index.cjs +10 -10
- package/dist/artifacts/index.js +10 -10
- package/dist/artifacts/metafile-cjs.json +1 -1
- package/dist/artifacts/metafile-esm.json +1 -1
- package/dist/automation/index.cjs +15 -15
- package/dist/automation/index.js +16 -16
- package/dist/automation/metafile-cjs.json +1 -1
- package/dist/automation/metafile-esm.json +1 -1
- package/dist/control-plane/index.cjs +1 -1
- package/dist/control-plane/index.js +1 -1
- package/dist/electron/index.cjs +2 -2
- package/dist/electron/index.js +2 -2
- package/dist/electron/metafile-cjs.json +1 -1
- package/dist/electron/metafile-esm.json +1 -1
- package/dist/index.cjs +306 -306
- package/dist/index.js +326 -326
- package/dist/intelligence/index.cjs +10 -10
- package/dist/intelligence/index.js +10 -10
- package/dist/intelligence/metafile-cjs.json +1 -1
- package/dist/intelligence/metafile-esm.json +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/providers/index.cjs +10 -10
- package/dist/providers/index.js +10 -10
- package/dist/providers/metafile-cjs.json +1 -1
- package/dist/providers/metafile-esm.json +1 -1
- package/dist/recipes/index.cjs +2 -2
- package/dist/recipes/index.js +2 -2
- package/dist/recipes/metafile-cjs.json +1 -1
- package/dist/recipes/metafile-esm.json +1 -1
- package/dist/research/index.cjs +3 -3
- package/dist/research/index.js +3 -3
- package/dist/research/metafile-cjs.json +1 -1
- package/dist/research/metafile-esm.json +1 -1
- package/dist/session/index.cjs +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/metafile-cjs.json +1 -1
- package/dist/session/metafile-esm.json +1 -1
- package/dist/sharing/index.cjs +4 -4
- package/dist/sharing/index.js +4 -4
- package/dist/sharing/metafile-cjs.json +1 -1
- package/dist/sharing/metafile-esm.json +1 -1
- package/dist/ui/index.cjs +2 -2
- package/dist/ui/index.js +2 -2
- package/dist/ui/metafile-cjs.json +1 -1
- package/dist/ui/metafile-esm.json +1 -1
- package/dist/utils/index.cjs +13 -13
- package/dist/utils/index.d.cts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/metafile-cjs.json +1 -1
- package/dist/utils/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/research/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{randomUUID as
|
|
2
|
-
`)}function
|
|
3
|
-
`).length!==e.endLine-e.startLine+1&&n.push(`excerpt ${e?.excerptId} line span does not match text`)}function L(e,t){
|
|
1
|
+
import{randomUUID as x}from"node:crypto";var w=["plan","requirements","design","task-graph","patch","diff","file","document","diagram","screenshot","recording","browser-snapshot","test-report","review-report","security-report","performance-report","release-report","sbom","provenance","attestation","page"],E=["draft","pending_review","approved","rejected","superseded","archived"],R=["public","internal","confidential","restricted"],X=["agent","tool","user","system","integration"],l=["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"],m=["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"];import{createHash as P}from"node:crypto";function s(e){return{algorithm:"sha256",value:P("sha256").update(e).digest("hex")}}function c(e){return JSON.stringify(g(e,new Set))}function d(e){return s(c(e))}function g(e,t){if(e===null||typeof e!="object"){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Artifact JSON cannot contain non-finite numbers");return e}if(t.has(e))throw new TypeError("Artifact JSON cannot contain cycles");if(t.add(e),Array.isArray(e)){let r=e.map(o=>g(o,t));return t.delete(e),r}let n={};for(let r of Object.keys(e).sort((o,i)=>o.localeCompare(i))){let o=e[r];if(o===void 0)throw new TypeError(`Artifact JSON property ${r} is undefined`);n[r]=g(o,t)}return t.delete(e),n}var $="[\\u0000-\\u001f\\u007f]",ee=new RegExp($);var te=new Set(E),ne=new Set(R),ie=new Set(X),re=new Set(w),oe=new Set(l),se=new Set(m);var pe=new Set(l),le=new Set(m);var Oe=64*1024*1024;var He=16*1024*1024;var ft=16*1024*1024;function S(e,t={}){for(let n of e){let r=n.codePointAt(0);if(r===127)return!0;if(!(r>31)&&!(r===9&&t.allowTab===!0)&&!((r===10||r===13)&&t.allowLineBreaks===!0))return!0}return!1}var k="xeno.source-research-report.v1",u=class extends Error{constructor(n){super(`XENO source-research report is invalid: ${n.join("; ")}`);this.issues=n;this.name="XenoSourceResearchValidationError"}issues;code="XENO_SOURCE_RESEARCH_INVALID"};function Tt(e){let t={schemaVersion:k,reportId:e.reportId??`research_${x()}`,runId:e.runId??`research_run_${x()}`,query:e.query.trim(),queryHash:N(e.query.trim()),repository:structuredClone(e.repository),collectedAt:e.collectedAt,completedAt:e.completedAt??new Date().toISOString(),model:structuredClone(e.model),files:structuredClone(e.files),excerpts:structuredClone(e.excerpts),answer:e.answer.trim(),answerExcerptIds:[...new Set(e.answerExcerptIds)],publicRationale:e.publicRationale.trim(),findings:structuredClone(e.findings),limitations:[...new Set((e.limitations??[]).map(n=>n.trim()).filter(Boolean))],usage:{inputTokens:T(e.usage?.inputTokens),outputTokens:T(e.usage?.outputTokens)}};return A(t),t}function kt(e){return{excerptId:e.excerptId,path:e.path,startLine:e.startLine,endLine:e.endLine,text:y(e.text),contentHash:N(y(e.text)),sourceContentHash:structuredClone(e.sourceContentHash)}}function A(e){let t=[];e?.schemaVersion!==k&&t.push("schemaVersion must be xeno.source-research-report.v1"),p(e?.reportId,"reportId",t),p(e?.runId,"runId",t),a(e?.query,"query",t,128e3),h(e?.queryHash,"queryHash",t),typeof e?.query=="string"&&e.queryHash?.value!==s(e.query).value&&t.push("queryHash does not match query"),V(e?.repository,t),_(e?.collectedAt,"collectedAt",t),_(e?.completedAt,"completedAt",t),Date.parse(e?.completedAt)<Date.parse(e?.collectedAt)&&t.push("completedAt cannot precede collectedAt"),L(e?.model,t),a(e?.answer,"answer",t,512e3),a(e?.publicRationale,"publicRationale",t,256e3),H(e?.usage,t),(!Array.isArray(e?.files)||e.files.length<1||e.files.length>256)&&t.push("files must contain 1 through 256 source records");let n=new Map;for(let i of e?.files??[])D(i,t),n.has(i.path)&&t.push(`duplicate source file ${i.path}`),n.set(i.path,i);(!Array.isArray(e?.excerpts)||e.excerpts.length>1024)&&t.push("excerpts must contain at most 1024 records");let r=new Map;for(let i of e?.excerpts??[])F(i,n,t),r.has(i.excerptId)&&t.push(`duplicate excerpt ${i.excerptId}`),r.set(i.excerptId,i);(!Array.isArray(e?.answerExcerptIds)||e.answerExcerptIds.length<1)&&t.push("answerExcerptIds must cite at least one source excerpt");for(let i of e?.answerExcerptIds??[])r.has(i)||t.push(`answer references unknown excerpt ${i}`);(!Array.isArray(e?.findings)||e.findings.length>512)&&t.push("findings must contain at most 512 records");let o=new Set;for(let i of e?.findings??[]){p(i?.findingId,"findingId",t),o.has(i.findingId)&&t.push(`duplicate finding ${i.findingId}`),o.add(i.findingId),a(i?.title,`finding ${i.findingId} title`,t,2e3),a(i?.summary,`finding ${i.findingId} summary`,t,64e3),J(i?.severity)||t.push(`finding ${i.findingId} severity is invalid`),q(i?.confidence)||t.push(`finding ${i.findingId} confidence must be between 0 and 1`),(!Array.isArray(i?.excerptIds)||i.excerptIds.length<1)&&t.push(`finding ${i.findingId} requires source excerpts`);for(let I of i?.excerptIds??[])r.has(I)||t.push(`finding ${i.findingId} references unknown excerpt ${I}`)}(!Array.isArray(e?.limitations)||e.limitations.length>256)&&t.push("limitations must contain at most 256 records");for(let i of e?.limitations??[])a(i,"limitation",t,16e3);if(t.length>0)throw new u([...new Set(t)])}function Ct(e,t){A(e);let n=t.createdAt??e.completedAt,r=c(e);return{schemaVersion:1,artifactId:t.artifactId??`research_${s(`${e.runId}:${e.repository.commit}:${e.queryHash.value}`).value.slice(0,24)}`,revision:1,kind:"custom:source-research-report",title:`Source research: ${e.repository.repository}`,description:e.answer.slice(0,1e3),state:"pending_review",createdAt:n,mediaType:"application/vnd.xeno.source-research-report+json",sensitivity:t.sensitivity??"internal",identity:{...t.identity,runId:t.identity?.runId??e.runId,repositoryId:t.identity?.repositoryId??`${e.repository.provider}:${e.repository.repository}`},content:{hash:d(e),sizeBytes:Buffer.byteLength(r,"utf8"),storage:{type:"inline",text:r},encoding:"utf8",redactedPreview:e.answer.slice(0,2e3)},provenance:{producer:structuredClone(t.producer),attributes:{"xeno.research.provider":e.repository.provider,"xeno.research.repository":e.repository.repository,"xeno.research.commit":e.repository.commit,"xeno.research.model":`${e.model.providerId}/${e.model.model}`,"xeno.research.fileCount":e.files.length,"xeno.research.findingCount":e.findings.length}},anchors:e.excerpts.map(o=>({kind:"source-line",path:o.path,startLine:o.startLine,endLine:o.endLine,repositoryId:`${e.repository.provider}:${e.repository.repository}`,commit:e.repository.commit}))}}function Nt(e){if(e.kind!=="custom:source-research-report"||e.mediaType!=="application/vnd.xeno.source-research-report+json")throw new u([`Artifact ${e.artifactId} is not a source-research report`]);if(e.content.storage.type!=="inline"||typeof e.content.storage.text!="string")throw new u(["Source-research reports require inline JSON content"]);let t;try{t=JSON.parse(e.content.storage.text)}catch{throw new u(["Source-research artifact content is invalid JSON"])}if(A(t),d(t).value!==e.content.hash.value)throw new u(["Source-research content hash does not match the artifact"]);return structuredClone(t)}function y(e){return e.replace(/\r\n?/gu,`
|
|
2
|
+
`)}function V(e,t){e?.provider!=="github"&&e?.provider!=="gitlab"&&t.push("repository provider must be github or gitlab"),M(e?.host,"repository host",t),j(e?.repository,t),a(e?.ref,"repository ref",t,512),(typeof e?.commit!="string"||!/^[a-f0-9]{7,64}$/u.test(e.commit))&&t.push("repository commit must be a lowercase hexadecimal object ID"),B(e?.url,"repository url",t)}function D(e,t){C(e?.path,"source file path",t),h(e?.contentHash,`source file ${e?.path} contentHash`,t),(!Number.isSafeInteger(e?.sizeBytes)||e.sizeBytes<0||e.sizeBytes>8*1024*1024)&&t.push(`source file ${e?.path} sizeBytes is invalid`),(!Number.isSafeInteger(e?.lineCount)||e.lineCount<1||e.lineCount>1e6)&&t.push(`source file ${e?.path} lineCount is invalid`),e?.blobId!==void 0&&a(e.blobId,`source file ${e.path} blobId`,t,256),e?.language!==void 0&&a(e.language,`source file ${e.path} language`,t,128)}function F(e,t,n){p(e?.excerptId,"excerptId",n),C(e?.path,`excerpt ${e?.excerptId} path`,n);let r=t.get(e?.path);r||n.push(`excerpt ${e?.excerptId} references unknown source file ${e?.path}`),(!Number.isSafeInteger(e?.startLine)||e.startLine<1)&&n.push(`excerpt ${e?.excerptId} startLine is invalid`),(!Number.isSafeInteger(e?.endLine)||e.endLine<e.startLine)&&n.push(`excerpt ${e?.excerptId} endLine is invalid`),r&&e.endLine>r.lineCount&&n.push(`excerpt ${e?.excerptId} exceeds source line count`),a(e?.text,`excerpt ${e?.excerptId} text`,n,256e3),h(e?.contentHash,`excerpt ${e?.excerptId} contentHash`,n),h(e?.sourceContentHash,`excerpt ${e?.excerptId} sourceContentHash`,n);let o=typeof e?.text=="string"?y(e.text):"";e?.contentHash?.value!==s(o).value&&n.push(`excerpt ${e?.excerptId} contentHash does not match text`),r&&e?.sourceContentHash?.value!==r.contentHash.value&&n.push(`excerpt ${e?.excerptId} is bound to a different source hash`),o&&o.split(`
|
|
3
|
+
`).length!==e.endLine-e.startLine+1&&n.push(`excerpt ${e?.excerptId} line span does not match text`)}function L(e,t){p(e?.providerId,"model providerId",t),a(e?.model,"model",t,512),e?.connectionId!==void 0&&p(e.connectionId,"model connectionId",t)}function H(e,t){(!Number.isSafeInteger(e?.inputTokens)||e.inputTokens<0)&&t.push("usage.inputTokens must be a non-negative integer"),(!Number.isSafeInteger(e?.outputTokens)||e.outputTokens<0)&&t.push("usage.outputTokens must be a non-negative integer")}function h(e,t,n){(e?.algorithm!=="sha256"||!/^[a-f0-9]{64}$/u.test(e?.value??""))&&n.push(`${t} must be a lowercase SHA-256 digest`)}function p(e,t,n){(typeof e!="string"||!/^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,255}$/u.test(e))&&n.push(`${t} is invalid`)}function a(e,t,n,r){(typeof e!="string"||!e.trim()||e.length>r||S(e,{allowTab:!0,allowLineBreaks:!0}))&&n.push(`${t} must be non-empty bounded text`)}function _(e,t,n){(typeof e!="string"||!Number.isFinite(Date.parse(e))||new Date(e).toISOString()!==e)&&n.push(`${t} must be an ISO-8601 UTC timestamp`)}function M(e,t,n){(typeof e!="string"||e.length>253||!/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/u.test(e))&&n.push(`${t} is invalid`)}function j(e,t){(typeof e!="string"||e.length>2048||e.startsWith("/")||e.endsWith("/")||e.split("/").some(n=>!n||n==="."||n===".."))&&t.push("repository name is invalid")}function C(e,t,n){(typeof e!="string"||e.length>4096||e.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(e)||e.includes("\\")||e.split("/").some(r=>!r||r==="."||r===".."))&&n.push(`${t} must be repository-relative`)}function B(e,t,n){try{let r=new URL(String(e));(r.protocol!=="https:"||r.username||r.password)&&n.push(`${t} must be credential-free HTTPS`)}catch{n.push(`${t} is invalid`)}}function T(e){return Number.isSafeInteger(e)&&(e??-1)>=0?e:0}function N(e){return{algorithm:"sha256",value:s(e).value}}function q(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1}function J(e){return e==="info"||e==="low"||e==="medium"||e==="high"||e==="critical"}export{k as XENO_SOURCE_RESEARCH_SCHEMA_VERSION,u as XenoSourceResearchValidationError,A as assertValidXenoSourceResearchReport,kt as createXenoSourceResearchExcerpt,Tt as createXenoSourceResearchReport,y as normalizeSourceText,Nt as xenoArtifactToSourceResearchReport,Ct as xenoSourceResearchReportToArtifact};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/artifacts/types.ts":{"bytes":11227,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":8778,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/artifacts/types.ts":{"bytes":11227,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":8778,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/utils/fs.ts":{"bytes":11685,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16401,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/diff-artifact.ts":{"bytes":17998,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/artifacts/review-service.ts":{"bytes":8672,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"}],"format":"esm"},"src/artifacts/spec-lifecycle.ts":{"bytes":31007,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/multi-agent-review.ts":{"bytes":30649,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/legacy-adapters.ts":{"bytes":10908,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"}],"format":"esm"},"src/artifacts/pages.ts":{"bytes":20179,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/index.ts":{"bytes":413,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/evidence-graph.ts","kind":"import-statement","original":"./evidence-graph.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"./file-repository.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/spec-lifecycle.ts","kind":"import-statement","original":"./spec-lifecycle.js"},{"path":"src/artifacts/multi-agent-review.ts","kind":"import-statement","original":"./multi-agent-review.js"},{"path":"src/artifacts/legacy-adapters.ts","kind":"import-statement","original":"./legacy-adapters.js"},{"path":"src/artifacts/pages.ts","kind":"import-statement","original":"./pages.js"}],"format":"esm"},"src/utils/text-security.ts":{"bytes":809,"imports":[],"format":"esm"},"src/research/source-research.ts":{"bytes":18957,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/index.ts","kind":"import-statement","original":"../artifacts/index.js"},{"path":"src/utils/text-security.ts","kind":"import-statement","original":"../utils/text-security.js"}],"format":"esm"},"src/research/index.ts":{"bytes":38,"imports":[{"path":"src/research/source-research.ts","kind":"import-statement","original":"./source-research.js"}],"format":"esm"}},"outputs":{"dist/research/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/research/index.ts","inputs":{"src/research/index.ts":{"bytesInOutput":346},"src/research/source-research.ts":{"bytesInOutput":9362},"src/artifacts/types.ts":{"bytesInOutput":819},"src/artifacts/index.ts":{"bytesInOutput":0},"src/artifacts/hash.ts":{"bytesInOutput":715},"src/artifacts/validation.ts":{"bytesInOutput":138},"src/artifacts/evidence-graph.ts":{"bytesInOutput":32},"src/artifacts/file-repository.ts":{"bytesInOutput":20},"src/artifacts/diff-artifact.ts":{"bytesInOutput":20},"src/artifacts/pages.ts":{"bytesInOutput":20},"src/utils/text-security.ts":{"bytesInOutput":179}},"bytes":12358}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/artifacts/types.ts":{"bytes":11227,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":8778,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/artifacts/types.ts":{"bytes":11227,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":8778,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/utils/fs.ts":{"bytes":11685,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16401,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/diff-artifact.ts":{"bytes":17998,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/artifacts/review-service.ts":{"bytes":8672,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"}],"format":"esm"},"src/artifacts/spec-lifecycle.ts":{"bytes":31007,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/multi-agent-review.ts":{"bytes":30649,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/legacy-adapters.ts":{"bytes":10908,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"}],"format":"esm"},"src/artifacts/pages.ts":{"bytes":20179,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/index.ts":{"bytes":413,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/evidence-graph.ts","kind":"import-statement","original":"./evidence-graph.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"./file-repository.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/spec-lifecycle.ts","kind":"import-statement","original":"./spec-lifecycle.js"},{"path":"src/artifacts/multi-agent-review.ts","kind":"import-statement","original":"./multi-agent-review.js"},{"path":"src/artifacts/legacy-adapters.ts","kind":"import-statement","original":"./legacy-adapters.js"},{"path":"src/artifacts/pages.ts","kind":"import-statement","original":"./pages.js"}],"format":"esm"},"src/utils/text-security.ts":{"bytes":809,"imports":[],"format":"esm"},"src/research/source-research.ts":{"bytes":18957,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/index.ts","kind":"import-statement","original":"../artifacts/index.js"},{"path":"src/utils/text-security.ts","kind":"import-statement","original":"../utils/text-security.js"}],"format":"esm"},"src/research/index.ts":{"bytes":38,"imports":[{"path":"src/research/source-research.ts","kind":"import-statement","original":"./source-research.js"}],"format":"esm"}},"outputs":{"dist/research/index.js":{"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"exports":["XENO_SOURCE_RESEARCH_SCHEMA_VERSION","XenoSourceResearchValidationError","assertValidXenoSourceResearchReport","createXenoSourceResearchExcerpt","createXenoSourceResearchReport","normalizeSourceText","xenoArtifactToSourceResearchReport","xenoSourceResearchReportToArtifact"],"entryPoint":"src/research/index.ts","inputs":{"src/research/source-research.ts":{"bytesInOutput":9342},"src/artifacts/types.ts":{"bytesInOutput":819},"src/artifacts/index.ts":{"bytesInOutput":0},"src/artifacts/hash.ts":{"bytesInOutput":712},"src/artifacts/validation.ts":{"bytesInOutput":138},"src/artifacts/evidence-graph.ts":{"bytesInOutput":32},"src/artifacts/file-repository.ts":{"bytesInOutput":20},"src/artifacts/diff-artifact.ts":{"bytesInOutput":20},"src/artifacts/pages.ts":{"bytesInOutput":20},"src/utils/text-security.ts":{"bytesInOutput":179},"src/research/index.ts":{"bytesInOutput":0}},"bytes":11594}}}
|
package/dist/session/index.cjs
CHANGED
|
@@ -48,7 +48,7 @@ ${this.stringify(e.data)}
|
|
|
48
48
|
`)+`
|
|
49
49
|
`;await k(this.transcriptPath,a);let l=this.buildMarkdownDocument(o,"session store");if(await k(this.markdownPath,l),!this.workspaceMirrorDisabled){let c=await this.resolveWorkspaceMarkdownPath();if(c)try{let u=this.buildMarkdownDocument(o,"workspace mirror");await k(c,u)}catch(u){this.workspaceMirrorDisabled=!0,B("Transcript workspace mirror disabled",u)}}}async truncateAfterMessageCount(e){let t=await x(this.transcriptPath);if(!t)return;let r=Z(t),s=Math.max(0,e),i=0,o=[];for(let c of r){if(c.type==="user_message"||c.type==="assistant_message"){if(i>=s)break;i+=1}o.push(c)}let a=o.length>0?o.map(c=>JSON.stringify(c)).join(`
|
|
50
50
|
`)+`
|
|
51
|
-
`:"";await k(this.transcriptPath,a);let l=this.buildMarkdownDocument(o,"session store");if(await k(this.markdownPath,l),!this.workspaceMirrorDisabled){let c=await this.resolveWorkspaceMarkdownPath();if(c)try{let u=this.buildMarkdownDocument(o,"workspace mirror");await k(c,u)}catch(u){this.workspaceMirrorDisabled=!0,B("Transcript workspace mirror disabled",u)}}}getSequence(){return this.sequence}async initialize(){try{let e=await x(this.transcriptPath);if(!e){this.sequence=0;return}let t=Z(e);if(t.length===0){this.sequence=0;return}let r=t[t.length-1];this.sequence=r.sequence+1}catch(e){let t=e instanceof Error?e.message:String(e);B(`Transcript initialization warning: ${t}. Starting with empty transcript.`),this.sequence=0}}async flush(){await this.writeQueue}};var ee=_(require("path"),1),lt=require("crypto"),ut=require("fs/promises");var qt={View:"Read",Replace:"Write",GlobTool:"Glob",GrepTool:"Grep",SQLiteAnalyze:"SqliteAnalyze",ReadNotebook:"NotebookRead",NotebookEditCell:"NotebookEdit",CoordinationSend:"Send",CoordinationQuery:"Receive"};function fe(n){return qt[n]??n}var I=class{sessionDir;checkpointsDir;autoInterval;lastCheckpointMessageCount=0;constructor(e,t){this.sessionDir=e,this.checkpointsDir=ee.join(e,"checkpoints"),this.autoInterval=t?.autoInterval??10}async initialize(){let e=await this.list();e.length>0&&(this.lastCheckpointMessageCount=e[0].messageCount)}async create(e){await N(this.checkpointsDir);let t=(0,lt.randomUUID)(),r={id:t,name:e.description,trigger:e.trigger,createdAt:new Date().toISOString(),messageCount:e.messages.length,tokenCount:this.estimateTokens(e.messages)},s={info:r,messages:e.messages},i=ee.join(this.checkpointsDir,`${t}.json`);return await k(i,JSON.stringify(s,null,2)),this.lastCheckpointMessageCount=e.messages.length,r}async list(){let e=await Ze(this.checkpointsDir,/\.json$/),t=[];for(let r of e){let s=await x(r);if(s){let i=E(s,null);if(i){let o=await(0,ut.stat)(r);t.push({info:i.info,modifiedAtMs:o.mtimeMs})}}}return t.sort((r,s)=>new Date(s.info.createdAt).getTime()-new Date(r.info.createdAt).getTime()||s.modifiedAtMs-r.modifiedAtMs).map(({info:r})=>r)}async restore(e){let t=ee.join(this.checkpointsDir,`${e}.json`),r;try{r=await x(t)}catch(i){let o=i instanceof Error?i.message:String(i);throw new Error(`Failed to read checkpoint ${e}: ${o}`)}if(!r)throw new Error(`Checkpoint not found: ${e} (path: ${t})`);let s=E(r,null);if(!s)throw new Error(`Invalid checkpoint data for ${e}: JSON parse failed`);if(!s.messages||!Array.isArray(s.messages))throw new Error(`Invalid checkpoint data for ${e}: missing or invalid messages array`);if(!s.info)throw new Error(`Invalid checkpoint data for ${e}: missing info object`);return{messages:s.messages,info:s.info}}shouldAutoCheckpoint(e){return e-this.lastCheckpointMessageCount>=this.autoInterval}static isDangerousOperation(e,t){if(e=fe(e),e==="Write")return!0;if(e==="Bash"){let s=t.command?.toLowerCase()||"";return["rm ","del ","git push","git reset","drop ","truncate"].some(o=>s.includes(o))}return!1}async delete(e){let t=ee.join(this.checkpointsDir,`${e}.json`);await $(t)}estimateTokens(e){let t=0;for(let r of e)if(typeof r.content=="string")t+=Math.ceil(r.content.length/4);else if(Array.isArray(r.content))for(let s of r.content)"text"in s&&(t+=Math.ceil(s.text.length/4));return t}};var j=_(require("path"),1),$e=_(require("os"),1),F=_(require("fs"),1);var Jt=Symbol.for("@xenosystem/agent-sdk/shutdown-registry"),Vt=globalThis,Oe=Vt[Jt]??={cleanups:new Set,exitHandlerRegistered:!1,signalHandlersInstalled:!1},Ne=Oe.cleanups;function zt(){for(let n of Ne)try{n()}catch{}}function dt(n){return Ne.add(n),!Oe.exitHandlerRegistered&&typeof process<"u"&&typeof process.on=="function"&&(Oe.exitHandlerRegistered=!0,process.on("exit",zt)),()=>{Ne.delete(n)}}var pt="0.10.
|
|
51
|
+
`:"";await k(this.transcriptPath,a);let l=this.buildMarkdownDocument(o,"session store");if(await k(this.markdownPath,l),!this.workspaceMirrorDisabled){let c=await this.resolveWorkspaceMarkdownPath();if(c)try{let u=this.buildMarkdownDocument(o,"workspace mirror");await k(c,u)}catch(u){this.workspaceMirrorDisabled=!0,B("Transcript workspace mirror disabled",u)}}}getSequence(){return this.sequence}async initialize(){try{let e=await x(this.transcriptPath);if(!e){this.sequence=0;return}let t=Z(e);if(t.length===0){this.sequence=0;return}let r=t[t.length-1];this.sequence=r.sequence+1}catch(e){let t=e instanceof Error?e.message:String(e);B(`Transcript initialization warning: ${t}. Starting with empty transcript.`),this.sequence=0}}async flush(){await this.writeQueue}};var ee=_(require("path"),1),lt=require("crypto"),ut=require("fs/promises");var qt={View:"Read",Replace:"Write",GlobTool:"Glob",GrepTool:"Grep",SQLiteAnalyze:"SqliteAnalyze",ReadNotebook:"NotebookRead",NotebookEditCell:"NotebookEdit",CoordinationSend:"Send",CoordinationQuery:"Receive"};function fe(n){return qt[n]??n}var I=class{sessionDir;checkpointsDir;autoInterval;lastCheckpointMessageCount=0;constructor(e,t){this.sessionDir=e,this.checkpointsDir=ee.join(e,"checkpoints"),this.autoInterval=t?.autoInterval??10}async initialize(){let e=await this.list();e.length>0&&(this.lastCheckpointMessageCount=e[0].messageCount)}async create(e){await N(this.checkpointsDir);let t=(0,lt.randomUUID)(),r={id:t,name:e.description,trigger:e.trigger,createdAt:new Date().toISOString(),messageCount:e.messages.length,tokenCount:this.estimateTokens(e.messages)},s={info:r,messages:e.messages},i=ee.join(this.checkpointsDir,`${t}.json`);return await k(i,JSON.stringify(s,null,2)),this.lastCheckpointMessageCount=e.messages.length,r}async list(){let e=await Ze(this.checkpointsDir,/\.json$/),t=[];for(let r of e){let s=await x(r);if(s){let i=E(s,null);if(i){let o=await(0,ut.stat)(r);t.push({info:i.info,modifiedAtMs:o.mtimeMs})}}}return t.sort((r,s)=>new Date(s.info.createdAt).getTime()-new Date(r.info.createdAt).getTime()||s.modifiedAtMs-r.modifiedAtMs).map(({info:r})=>r)}async restore(e){let t=ee.join(this.checkpointsDir,`${e}.json`),r;try{r=await x(t)}catch(i){let o=i instanceof Error?i.message:String(i);throw new Error(`Failed to read checkpoint ${e}: ${o}`)}if(!r)throw new Error(`Checkpoint not found: ${e} (path: ${t})`);let s=E(r,null);if(!s)throw new Error(`Invalid checkpoint data for ${e}: JSON parse failed`);if(!s.messages||!Array.isArray(s.messages))throw new Error(`Invalid checkpoint data for ${e}: missing or invalid messages array`);if(!s.info)throw new Error(`Invalid checkpoint data for ${e}: missing info object`);return{messages:s.messages,info:s.info}}shouldAutoCheckpoint(e){return e-this.lastCheckpointMessageCount>=this.autoInterval}static isDangerousOperation(e,t){if(e=fe(e),e==="Write")return!0;if(e==="Bash"){let s=t.command?.toLowerCase()||"";return["rm ","del ","git push","git reset","drop ","truncate"].some(o=>s.includes(o))}return!1}async delete(e){let t=ee.join(this.checkpointsDir,`${e}.json`);await $(t)}estimateTokens(e){let t=0;for(let r of e)if(typeof r.content=="string")t+=Math.ceil(r.content.length/4);else if(Array.isArray(r.content))for(let s of r.content)"text"in s&&(t+=Math.ceil(s.text.length/4));return t}};var j=_(require("path"),1),$e=_(require("os"),1),F=_(require("fs"),1);var Jt=Symbol.for("@xenosystem/agent-sdk/shutdown-registry"),Vt=globalThis,Oe=Vt[Jt]??={cleanups:new Set,exitHandlerRegistered:!1,signalHandlersInstalled:!1},Ne=Oe.cleanups;function zt(){for(let n of Ne)try{n()}catch{}}function dt(n){return Ne.add(n),!Oe.exitHandlerRegistered&&typeof process<"u"&&typeof process.on=="function"&&(Oe.exitHandlerRegistered=!0,process.on("exit",zt)),()=>{Ne.delete(n)}}var pt="0.10.9";var Xt=1e4,Kt=6e4,Yt="session.lock",Qt="lock.json",Q=new Map;function Le(n,e){return n!=null&&n.pid===e.pid&&n.hostname===e.hostname&&n.processStartedAt===e.processStartedAt&&n.acquiredAt===e.acquiredAt}function Zt(){for(let[n,e]of Q)try{let t=E(F.readFileSync(n,"utf8"),null);Le(t,e)&&F.unlinkSync(n)}catch{}Q.clear()}dt(Zt);var U=class n{sessionDir;lockPath;legacyLockPath;sessionId;heartbeatTimer;acquiredOwner;constructor(e){this.sessionDir=e,this.lockPath=j.join(e,Yt),this.legacyLockPath=j.join(e,Qt),this.sessionId=j.basename(e)}async acquire(){let e=new Date().toISOString(),t={schemaVersion:1,name:`session:${this.sessionId}`,sessionId:this.sessionId,pid:process.pid,hostname:$e.hostname(),processStartedAt:new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString(),version:pt,acquiredAt:e,updatedAt:e,heartbeat:e},r=j.dirname(this.lockPath);await F.promises.mkdir(r,{recursive:!0});let s=await this.findExistingLockPath();if(s){if(!await this.isStalePath(s)){let o=await this.readLockAt(s);throw new Error(`Session ${this.sessionId} is already locked by PID ${o?.pid} on ${o?.hostname}`)}await $(s)}try{await F.promises.writeFile(this.lockPath,JSON.stringify(t,null,2),{flag:"wx",encoding:"utf-8"}),this.acquiredOwner=t,Q.set(this.lockPath,t)}catch(i){if(i.code==="EEXIST"){if(!await this.isStalePath(this.lockPath)){let l=await this.readLockAt(this.lockPath);throw new Error(`Session ${this.sessionId} is already locked by PID ${l?.pid} on ${l?.hostname}`)}await $(this.lockPath);try{await F.promises.writeFile(this.lockPath,JSON.stringify(t,null,2),{flag:"wx",encoding:"utf-8"})}catch(l){throw l.code==="EEXIST"?new Error(`Session ${this.sessionId} lock was acquired by another process during stale recovery`):l}this.acquiredOwner=t,Q.set(this.lockPath,t)}else throw i}}async release(){this.stopHeartbeat();let e=this.acquiredOwner;if(this.acquiredOwner=void 0,!e)return;Q.delete(this.lockPath);let t=await this.readLockAt(this.lockPath);Le(t,e)&&await $(this.lockPath)}async isLocked(){let e=await this.findExistingLockPath();return e?!await this.isStalePath(e):!1}async isStale(){let e=await this.findExistingLockPath();return e?this.isStalePath(e):!1}async isStalePath(e){let t=await this.readLockAt(e);if(!t)return!1;if(t.hostname===$e.hostname())try{return process.kill(t.pid,0),!1}catch(i){return i.code!=="EPERM"}let r=new Date(t.heartbeat).getTime();return Date.now()-r>Kt}startHeartbeat(e=Xt){this.heartbeatTimer&&this.stopHeartbeat(),this.heartbeatTimer=setInterval(async()=>{try{await this.updateHeartbeat()}catch(t){let r=t instanceof Error?t.message:String(t);if(t?.code==="ENOENT"){W("SessionLock: Session directory removed, stopping heartbeat"),this.stopHeartbeat();return}W(`SessionLock: Failed to update heartbeat: ${r}`)}},e),this.heartbeatTimer.unref()}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0)}async updateHeartbeat(){let e=await this.readLockAt(this.lockPath),t=this.acquiredOwner;if(!(!e||!t)){if(!Le(e,t)){this.acquiredOwner=void 0,Q.delete(this.lockPath),this.stopHeartbeat();return}e.heartbeat=new Date().toISOString(),e.updatedAt=e.heartbeat,await k(this.lockPath,JSON.stringify(e,null,2))}}async readLock(){let e=await this.findExistingLockPath();return e?this.readLockAt(e):null}async readLockAt(e){let t=await x(e);return t?E(t,null):null}async findExistingLockPath(){return await x(this.lockPath)?this.lockPath:await x(this.legacyLockPath)?this.legacyLockPath:null}static async cleanStale(e){let t=await le(e),r=[];for(let s of t){let i=new n(s);if(await i.isStale()){let a=await i.findExistingLockPath();a&&await $(a),r.push(j.basename(s))}}return r}};var A=_(require("path"),1);var C=_(require("path"),1);function er(n,e){let t=C.resolve(n),r=C.resolve(n,e);return r===t?!0:t===C.parse(t).root?r.startsWith(t):r.startsWith(t+C.sep)}function q(n,e){if(C.isAbsolute(e))return C.resolve(e);if(!er(n,e))throw new Error(`PathSecurity: Path traversal attempt detected: ${e}`);return C.resolve(n,e)}function J(n){if(n!==void 0&&n!=="agent"&&n!=="chatOnly")throw new Error("Invalid session execution mode; expected agent or chatOnly.")}var T=_(require("path"),1),ye=_(require("os"),1),R=_(require("node:fs/promises"),1),we=require("node:crypto");var V=require("node:os");var Be=require("node:path"),Kr=(0,V.platform)();var Yr=(0,V.release)(),Qr=(0,V.homedir)();function me(){let n=process.env.XENO_AGENT_HOME?.trim();return n?(0,Be.resolve)(n):(0,Be.resolve)((0,V.homedir)(),".xeno-agent")}var gt=1,ft="recent.json",tr=".lock",ht=".entries",rr=3e4,Fe=6e4,yt=new Set(["EACCES","EBUSY","EPERM"]),nr=[5,10,20,40,80,160,320],he=new Map;function sr(n,e){let t=(0,we.createHash)("sha256").update(e).digest("hex");return T.join(`${n}${ht}`,`${t}.json`)}async function je(n,e,t){let r={schemaVersion:1,key:e,entry:t};await k(sr(n,e),JSON.stringify(r)+`
|
|
52
52
|
`)}async function ir(n,e){let t=`${n}${ht}`,r;try{r=await R.readdir(t)}catch(s){if(s.code==="ENOENT")return;throw s}await Promise.all(r.filter(s=>s.endsWith(".json")).map(async s=>{let i=await R.readFile(T.join(t,s),"utf8").catch(()=>""),o=E(i,null);if(!(!o||o.schemaVersion!==1||typeof o.key!="string")){if(o.entry===null){delete e[o.key];return}typeof o.entry.sessionId!="string"||typeof o.entry.endedAt!="string"||(e[o.key]=o.entry)}}))}function mt(n){if(!Number.isInteger(n)||n<=0)return!1;try{return process.kill(n,0),!0}catch(e){return e.code==="EPERM"}}async function or(n){try{let[e,t]=await Promise.all([R.readFile(T.join(n,"owner.json"),"utf8").catch(()=>""),R.stat(n)]),r=E(e,null);return r?.hostname===ye.hostname()&&mt(r.pid)?!1:r?.hostname&&r.hostname!==ye.hostname()||!r?Date.now()-t.mtimeMs>Fe:Date.now()-t.mtimeMs>Fe||!mt(r.pid)}catch{return!1}}async function wt(n){for(let e=0;;e+=1)try{await R.rm(n,{recursive:!0});return}catch(t){let r=t.code;if(r==="ENOENT")return;let s=nr[e];if(process.platform!=="win32"||!r||!yt.has(r)||s===void 0)throw t;await new Promise(i=>setTimeout(i,s))}}async function ar(n,e){try{let t=await R.readFile(T.join(n,"owner.json"),"utf8");E(t,null)?.token===e&&await wt(n)}catch(t){if(t.code!=="ENOENT")throw t}}async function He(n,e){let t=z(n),r=he.get(t)??Promise.resolve(),s,i=new Promise(o=>{s=o});he.set(t,i),await r;try{return await cr(t,e)}finally{s(),he.get(t)===i&&he.delete(t)}}async function cr(n,e){let t=`${n}${tr}`,r=(0,we.randomUUID)(),s=Date.now();await R.mkdir(T.dirname(n),{recursive:!0});for(let i=0;;i+=1){let o={schemaVersion:1,token:r,pid:process.pid,hostname:ye.hostname(),acquiredAt:new Date().toISOString()};try{await R.mkdir(t),await R.writeFile(T.join(t,"owner.json"),JSON.stringify(o),"utf8");break}catch(a){let l=a.code,c=process.platform==="win32"&&!!l&&yt.has(l);if(l!=="EEXIST"&&!c)throw a;if(await or(t)){await wt(t);continue}if(Date.now()-s>=rr)throw new Error(`Timed out waiting for recent-sessions index lock: ${t}`);let u=Math.min(100,5+i*5)+Math.floor(Math.random()*10);await new Promise(p=>setTimeout(p,u))}}try{return await e()}finally{await ar(t,r)}}function z(n){return n===void 0?T.join(me(),ft):T.join(n,".xeno-agent",ft)}function te(n){let e=T.normalize(n).replace(/[\\/]+$/,""),t=e.length>0?e:T.parse(T.normalize(n)).root;return process.platform==="win32"?t.toLowerCase():t}async function H(n){let e=z(n),t=ce(e)?await x(e):null,r=t?E(t,null):null,s=r&&typeof r=="object"?r:null,i={},o=s?.version===gt&&s.entries&&typeof s.entries=="object"?s.entries:{};for(let[a,l]of Object.entries(o)){if(!l||typeof l!="object")continue;let c=l;typeof c.sessionId!="string"||c.sessionId.length===0||typeof c.endedAt=="string"&&(i[a]={sessionId:c.sessionId,endedAt:c.endedAt,role:typeof c.role=="string"?c.role:void 0})}return await ir(e,i),{version:gt,entries:i}}async function Se(n,e={}){let t=await H(e.homeDir),r=te(n),s=t.entries[r];if(s&&!(e.role&&s.role&&s.role!==e.role))return s}async function ke(n,e={}){let t=te(n.cwd),r={sessionId:n.sessionId,role:n.role,endedAt:n.endedAt??new Date().toISOString()},s=z(e.homeDir);await je(s,t,r),await He(e.homeDir,async()=>{let i=await H(e.homeDir);i.entries[t]=r,await k(s,JSON.stringify(i,null,2)+`
|
|
53
53
|
`)})}async function St(n,e={}){let t=te(n),r=z(e.homeDir);(await H(e.homeDir)).entries[t]&&(await je(r,t,null),await He(e.homeDir,async()=>{let i=await H(e.homeDir);delete i.entries[t],await k(r,JSON.stringify(i,null,2)+`
|
|
54
54
|
`)}))}async function re(n,e={}){let t=await H(e.homeDir),r=Object.entries(t.entries).filter(([,i])=>i.sessionId===n).map(([i])=>i);if(r.length===0)return;let s=z(e.homeDir);await Promise.all(r.map(i=>je(s,i,null))),await He(e.homeDir,async()=>{let i=await H(e.homeDir);for(let[o,a]of Object.entries(i.entries))a.sessionId===n&&delete i.entries[o];await k(s,JSON.stringify(i,null,2)+`
|
package/dist/session/index.js
CHANGED
|
@@ -48,7 +48,7 @@ ${this.stringify(e.data)}
|
|
|
48
48
|
`)+`
|
|
49
49
|
`;await S(this.transcriptPath,a);let l=this.buildMarkdownDocument(o,"session store");if(await S(this.markdownPath,l),!this.workspaceMirrorDisabled){let c=await this.resolveWorkspaceMarkdownPath();if(c)try{let u=this.buildMarkdownDocument(o,"workspace mirror");await S(c,u)}catch(u){this.workspaceMirrorDisabled=!0,$("Transcript workspace mirror disabled",u)}}}async truncateAfterMessageCount(e){let t=await k(this.transcriptPath);if(!t)return;let r=K(t),s=Math.max(0,e),i=0,o=[];for(let c of r){if(c.type==="user_message"||c.type==="assistant_message"){if(i>=s)break;i+=1}o.push(c)}let a=o.length>0?o.map(c=>JSON.stringify(c)).join(`
|
|
50
50
|
`)+`
|
|
51
|
-
`:"";await S(this.transcriptPath,a);let l=this.buildMarkdownDocument(o,"session store");if(await S(this.markdownPath,l),!this.workspaceMirrorDisabled){let c=await this.resolveWorkspaceMarkdownPath();if(c)try{let u=this.buildMarkdownDocument(o,"workspace mirror");await S(c,u)}catch(u){this.workspaceMirrorDisabled=!0,$("Transcript workspace mirror disabled",u)}}}getSequence(){return this.sequence}async initialize(){try{let e=await k(this.transcriptPath);if(!e){this.sequence=0;return}let t=K(e);if(t.length===0){this.sequence=0;return}let r=t[t.length-1];this.sequence=r.sequence+1}catch(e){let t=e instanceof Error?e.message:String(e);$(`Transcript initialization warning: ${t}. Starting with empty transcript.`),this.sequence=0}}async flush(){await this.writeQueue}};import*as Y from"path";import{randomUUID as Lt}from"crypto";import{stat as Bt}from"fs/promises";var $t={View:"Read",Replace:"Write",GlobTool:"Glob",GrepTool:"Grep",SQLiteAnalyze:"SqliteAnalyze",ReadNotebook:"NotebookRead",NotebookEditCell:"NotebookEdit",CoordinationSend:"Send",CoordinationQuery:"Receive"};function ie(n){return $t[n]??n}var I=class{sessionDir;checkpointsDir;autoInterval;lastCheckpointMessageCount=0;constructor(e,t){this.sessionDir=e,this.checkpointsDir=Y.join(e,"checkpoints"),this.autoInterval=t?.autoInterval??10}async initialize(){let e=await this.list();e.length>0&&(this.lastCheckpointMessageCount=e[0].messageCount)}async create(e){await A(this.checkpointsDir);let t=Lt(),r={id:t,name:e.description,trigger:e.trigger,createdAt:new Date().toISOString(),messageCount:e.messages.length,tokenCount:this.estimateTokens(e.messages)},s={info:r,messages:e.messages},i=Y.join(this.checkpointsDir,`${t}.json`);return await S(i,JSON.stringify(s,null,2)),this.lastCheckpointMessageCount=e.messages.length,r}async list(){let e=await We(this.checkpointsDir,/\.json$/),t=[];for(let r of e){let s=await k(r);if(s){let i=P(s,null);if(i){let o=await Bt(r);t.push({info:i.info,modifiedAtMs:o.mtimeMs})}}}return t.sort((r,s)=>new Date(s.info.createdAt).getTime()-new Date(r.info.createdAt).getTime()||s.modifiedAtMs-r.modifiedAtMs).map(({info:r})=>r)}async restore(e){let t=Y.join(this.checkpointsDir,`${e}.json`),r;try{r=await k(t)}catch(i){let o=i instanceof Error?i.message:String(i);throw new Error(`Failed to read checkpoint ${e}: ${o}`)}if(!r)throw new Error(`Checkpoint not found: ${e} (path: ${t})`);let s=P(r,null);if(!s)throw new Error(`Invalid checkpoint data for ${e}: JSON parse failed`);if(!s.messages||!Array.isArray(s.messages))throw new Error(`Invalid checkpoint data for ${e}: missing or invalid messages array`);if(!s.info)throw new Error(`Invalid checkpoint data for ${e}: missing info object`);return{messages:s.messages,info:s.info}}shouldAutoCheckpoint(e){return e-this.lastCheckpointMessageCount>=this.autoInterval}static isDangerousOperation(e,t){if(e=ie(e),e==="Write")return!0;if(e==="Bash"){let s=t.command?.toLowerCase()||"";return["rm ","del ","git push","git reset","drop ","truncate"].some(o=>s.includes(o))}return!1}async delete(e){let t=Y.join(this.checkpointsDir,`${e}.json`);await O(t)}estimateTokens(e){let t=0;for(let r of e)if(typeof r.content=="string")t+=Math.ceil(r.content.length/4);else if(Array.isArray(r.content))for(let s of r.content)"text"in s&&(t+=Math.ceil(s.text.length/4));return t}};import*as B from"path";import*as Pe from"os";import*as L from"fs";var Ft=Symbol.for("@xenosystem/agent-sdk/shutdown-registry"),jt=globalThis,xe=jt[Ft]??={cleanups:new Set,exitHandlerRegistered:!1,signalHandlersInstalled:!1},ve=xe.cleanups;function Ht(){for(let n of ve)try{n()}catch{}}function Qe(n){return ve.add(n),!xe.exitHandlerRegistered&&typeof process<"u"&&typeof process.on=="function"&&(xe.exitHandlerRegistered=!0,process.on("exit",Ht)),()=>{ve.delete(n)}}var Ze="0.10.
|
|
51
|
+
`:"";await S(this.transcriptPath,a);let l=this.buildMarkdownDocument(o,"session store");if(await S(this.markdownPath,l),!this.workspaceMirrorDisabled){let c=await this.resolveWorkspaceMarkdownPath();if(c)try{let u=this.buildMarkdownDocument(o,"workspace mirror");await S(c,u)}catch(u){this.workspaceMirrorDisabled=!0,$("Transcript workspace mirror disabled",u)}}}getSequence(){return this.sequence}async initialize(){try{let e=await k(this.transcriptPath);if(!e){this.sequence=0;return}let t=K(e);if(t.length===0){this.sequence=0;return}let r=t[t.length-1];this.sequence=r.sequence+1}catch(e){let t=e instanceof Error?e.message:String(e);$(`Transcript initialization warning: ${t}. Starting with empty transcript.`),this.sequence=0}}async flush(){await this.writeQueue}};import*as Y from"path";import{randomUUID as Lt}from"crypto";import{stat as Bt}from"fs/promises";var $t={View:"Read",Replace:"Write",GlobTool:"Glob",GrepTool:"Grep",SQLiteAnalyze:"SqliteAnalyze",ReadNotebook:"NotebookRead",NotebookEditCell:"NotebookEdit",CoordinationSend:"Send",CoordinationQuery:"Receive"};function ie(n){return $t[n]??n}var I=class{sessionDir;checkpointsDir;autoInterval;lastCheckpointMessageCount=0;constructor(e,t){this.sessionDir=e,this.checkpointsDir=Y.join(e,"checkpoints"),this.autoInterval=t?.autoInterval??10}async initialize(){let e=await this.list();e.length>0&&(this.lastCheckpointMessageCount=e[0].messageCount)}async create(e){await A(this.checkpointsDir);let t=Lt(),r={id:t,name:e.description,trigger:e.trigger,createdAt:new Date().toISOString(),messageCount:e.messages.length,tokenCount:this.estimateTokens(e.messages)},s={info:r,messages:e.messages},i=Y.join(this.checkpointsDir,`${t}.json`);return await S(i,JSON.stringify(s,null,2)),this.lastCheckpointMessageCount=e.messages.length,r}async list(){let e=await We(this.checkpointsDir,/\.json$/),t=[];for(let r of e){let s=await k(r);if(s){let i=P(s,null);if(i){let o=await Bt(r);t.push({info:i.info,modifiedAtMs:o.mtimeMs})}}}return t.sort((r,s)=>new Date(s.info.createdAt).getTime()-new Date(r.info.createdAt).getTime()||s.modifiedAtMs-r.modifiedAtMs).map(({info:r})=>r)}async restore(e){let t=Y.join(this.checkpointsDir,`${e}.json`),r;try{r=await k(t)}catch(i){let o=i instanceof Error?i.message:String(i);throw new Error(`Failed to read checkpoint ${e}: ${o}`)}if(!r)throw new Error(`Checkpoint not found: ${e} (path: ${t})`);let s=P(r,null);if(!s)throw new Error(`Invalid checkpoint data for ${e}: JSON parse failed`);if(!s.messages||!Array.isArray(s.messages))throw new Error(`Invalid checkpoint data for ${e}: missing or invalid messages array`);if(!s.info)throw new Error(`Invalid checkpoint data for ${e}: missing info object`);return{messages:s.messages,info:s.info}}shouldAutoCheckpoint(e){return e-this.lastCheckpointMessageCount>=this.autoInterval}static isDangerousOperation(e,t){if(e=ie(e),e==="Write")return!0;if(e==="Bash"){let s=t.command?.toLowerCase()||"";return["rm ","del ","git push","git reset","drop ","truncate"].some(o=>s.includes(o))}return!1}async delete(e){let t=Y.join(this.checkpointsDir,`${e}.json`);await O(t)}estimateTokens(e){let t=0;for(let r of e)if(typeof r.content=="string")t+=Math.ceil(r.content.length/4);else if(Array.isArray(r.content))for(let s of r.content)"text"in s&&(t+=Math.ceil(s.text.length/4));return t}};import*as B from"path";import*as Pe from"os";import*as L from"fs";var Ft=Symbol.for("@xenosystem/agent-sdk/shutdown-registry"),jt=globalThis,xe=jt[Ft]??={cleanups:new Set,exitHandlerRegistered:!1,signalHandlersInstalled:!1},ve=xe.cleanups;function Ht(){for(let n of ve)try{n()}catch{}}function Qe(n){return ve.add(n),!xe.exitHandlerRegistered&&typeof process<"u"&&typeof process.on=="function"&&(xe.exitHandlerRegistered=!0,process.on("exit",Ht)),()=>{ve.delete(n)}}var Ze="0.10.9";var Wt=1e4,Gt=6e4,Ut="session.lock",qt="lock.json",q=new Map;function Ee(n,e){return n!=null&&n.pid===e.pid&&n.hostname===e.hostname&&n.processStartedAt===e.processStartedAt&&n.acquiredAt===e.acquiredAt}function Jt(){for(let[n,e]of q)try{let t=P(L.readFileSync(n,"utf8"),null);Ee(t,e)&&L.unlinkSync(n)}catch{}q.clear()}Qe(Jt);var J=class n{sessionDir;lockPath;legacyLockPath;sessionId;heartbeatTimer;acquiredOwner;constructor(e){this.sessionDir=e,this.lockPath=B.join(e,Ut),this.legacyLockPath=B.join(e,qt),this.sessionId=B.basename(e)}async acquire(){let e=new Date().toISOString(),t={schemaVersion:1,name:`session:${this.sessionId}`,sessionId:this.sessionId,pid:process.pid,hostname:Pe.hostname(),processStartedAt:new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString(),version:Ze,acquiredAt:e,updatedAt:e,heartbeat:e},r=B.dirname(this.lockPath);await L.promises.mkdir(r,{recursive:!0});let s=await this.findExistingLockPath();if(s){if(!await this.isStalePath(s)){let o=await this.readLockAt(s);throw new Error(`Session ${this.sessionId} is already locked by PID ${o?.pid} on ${o?.hostname}`)}await O(s)}try{await L.promises.writeFile(this.lockPath,JSON.stringify(t,null,2),{flag:"wx",encoding:"utf-8"}),this.acquiredOwner=t,q.set(this.lockPath,t)}catch(i){if(i.code==="EEXIST"){if(!await this.isStalePath(this.lockPath)){let l=await this.readLockAt(this.lockPath);throw new Error(`Session ${this.sessionId} is already locked by PID ${l?.pid} on ${l?.hostname}`)}await O(this.lockPath);try{await L.promises.writeFile(this.lockPath,JSON.stringify(t,null,2),{flag:"wx",encoding:"utf-8"})}catch(l){throw l.code==="EEXIST"?new Error(`Session ${this.sessionId} lock was acquired by another process during stale recovery`):l}this.acquiredOwner=t,q.set(this.lockPath,t)}else throw i}}async release(){this.stopHeartbeat();let e=this.acquiredOwner;if(this.acquiredOwner=void 0,!e)return;q.delete(this.lockPath);let t=await this.readLockAt(this.lockPath);Ee(t,e)&&await O(this.lockPath)}async isLocked(){let e=await this.findExistingLockPath();return e?!await this.isStalePath(e):!1}async isStale(){let e=await this.findExistingLockPath();return e?this.isStalePath(e):!1}async isStalePath(e){let t=await this.readLockAt(e);if(!t)return!1;if(t.hostname===Pe.hostname())try{return process.kill(t.pid,0),!1}catch(i){return i.code!=="EPERM"}let r=new Date(t.heartbeat).getTime();return Date.now()-r>Gt}startHeartbeat(e=Wt){this.heartbeatTimer&&this.stopHeartbeat(),this.heartbeatTimer=setInterval(async()=>{try{await this.updateHeartbeat()}catch(t){let r=t instanceof Error?t.message:String(t);if(t?.code==="ENOENT"){F("SessionLock: Session directory removed, stopping heartbeat"),this.stopHeartbeat();return}F(`SessionLock: Failed to update heartbeat: ${r}`)}},e),this.heartbeatTimer.unref()}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0)}async updateHeartbeat(){let e=await this.readLockAt(this.lockPath),t=this.acquiredOwner;if(!(!e||!t)){if(!Ee(e,t)){this.acquiredOwner=void 0,q.delete(this.lockPath),this.stopHeartbeat();return}e.heartbeat=new Date().toISOString(),e.updatedAt=e.heartbeat,await S(this.lockPath,JSON.stringify(e,null,2))}}async readLock(){let e=await this.findExistingLockPath();return e?this.readLockAt(e):null}async readLockAt(e){let t=await k(e);return t?P(t,null):null}async findExistingLockPath(){return await k(this.lockPath)?this.lockPath:await k(this.legacyLockPath)?this.legacyLockPath:null}static async cleanStale(e){let t=await ne(e),r=[];for(let s of t){let i=new n(s);if(await i.isStale()){let a=await i.findExistingLockPath();a&&await O(a),r.push(B.basename(s))}}return r}};import*as D from"path";import*as M from"path";function Vt(n,e){let t=M.resolve(n),r=M.resolve(n,e);return r===t?!0:t===M.parse(t).root?r.startsWith(t):r.startsWith(t+M.sep)}function H(n,e){if(M.isAbsolute(e))return M.resolve(e);if(!Vt(n,e))throw new Error(`PathSecurity: Path traversal attempt detected: ${e}`);return M.resolve(n,e)}function W(n){if(n!==void 0&&n!=="agent"&&n!=="chatOnly")throw new Error("Invalid session execution mode; expected agent or chatOnly.")}import*as b from"path";import*as ce from"os";import*as T from"node:fs/promises";import{createHash as Kt,randomUUID as Yt}from"node:crypto";import{homedir as tt,platform as zt,release as Xt}from"node:os";import{resolve as et}from"node:path";var cn=zt();var ln=Xt(),un=tt();function oe(){let n=process.env.XENO_AGENT_HOME?.trim();return n?et(n):et(tt(),".xeno-agent")}var rt=1,nt="recent.json",Qt=".lock",it=".entries",Zt=3e4,be=6e4,ot=new Set(["EACCES","EBUSY","EPERM"]),er=[5,10,20,40,80,160,320],ae=new Map;function tr(n,e){let t=Kt("sha256").update(e).digest("hex");return b.join(`${n}${it}`,`${t}.json`)}async function Te(n,e,t){let r={schemaVersion:1,key:e,entry:t};await S(tr(n,e),JSON.stringify(r)+`
|
|
52
52
|
`)}async function rr(n,e){let t=`${n}${it}`,r;try{r=await T.readdir(t)}catch(s){if(s.code==="ENOENT")return;throw s}await Promise.all(r.filter(s=>s.endsWith(".json")).map(async s=>{let i=await T.readFile(b.join(t,s),"utf8").catch(()=>""),o=P(i,null);if(!(!o||o.schemaVersion!==1||typeof o.key!="string")){if(o.entry===null){delete e[o.key];return}typeof o.entry.sessionId!="string"||typeof o.entry.endedAt!="string"||(e[o.key]=o.entry)}}))}function st(n){if(!Number.isInteger(n)||n<=0)return!1;try{return process.kill(n,0),!0}catch(e){return e.code==="EPERM"}}async function nr(n){try{let[e,t]=await Promise.all([T.readFile(b.join(n,"owner.json"),"utf8").catch(()=>""),T.stat(n)]),r=P(e,null);return r?.hostname===ce.hostname()&&st(r.pid)?!1:r?.hostname&&r.hostname!==ce.hostname()||!r?Date.now()-t.mtimeMs>be:Date.now()-t.mtimeMs>be||!st(r.pid)}catch{return!1}}async function at(n){for(let e=0;;e+=1)try{await T.rm(n,{recursive:!0});return}catch(t){let r=t.code;if(r==="ENOENT")return;let s=er[e];if(process.platform!=="win32"||!r||!ot.has(r)||s===void 0)throw t;await new Promise(i=>setTimeout(i,s))}}async function sr(n,e){try{let t=await T.readFile(b.join(n,"owner.json"),"utf8");P(t,null)?.token===e&&await at(n)}catch(t){if(t.code!=="ENOENT")throw t}}async function Re(n,e){let t=V(n),r=ae.get(t)??Promise.resolve(),s,i=new Promise(o=>{s=o});ae.set(t,i),await r;try{return await ir(t,e)}finally{s(),ae.get(t)===i&&ae.delete(t)}}async function ir(n,e){let t=`${n}${Qt}`,r=Yt(),s=Date.now();await T.mkdir(b.dirname(n),{recursive:!0});for(let i=0;;i+=1){let o={schemaVersion:1,token:r,pid:process.pid,hostname:ce.hostname(),acquiredAt:new Date().toISOString()};try{await T.mkdir(t),await T.writeFile(b.join(t,"owner.json"),JSON.stringify(o),"utf8");break}catch(a){let l=a.code,c=process.platform==="win32"&&!!l&&ot.has(l);if(l!=="EEXIST"&&!c)throw a;if(await nr(t)){await at(t);continue}if(Date.now()-s>=Zt)throw new Error(`Timed out waiting for recent-sessions index lock: ${t}`);let u=Math.min(100,5+i*5)+Math.floor(Math.random()*10);await new Promise(p=>setTimeout(p,u))}}try{return await e()}finally{await sr(t,r)}}function V(n){return n===void 0?b.join(oe(),nt):b.join(n,".xeno-agent",nt)}function le(n){let e=b.normalize(n).replace(/[\\/]+$/,""),t=e.length>0?e:b.parse(b.normalize(n)).root;return process.platform==="win32"?t.toLowerCase():t}async function G(n){let e=V(n),t=re(e)?await k(e):null,r=t?P(t,null):null,s=r&&typeof r=="object"?r:null,i={},o=s?.version===rt&&s.entries&&typeof s.entries=="object"?s.entries:{};for(let[a,l]of Object.entries(o)){if(!l||typeof l!="object")continue;let c=l;typeof c.sessionId!="string"||c.sessionId.length===0||typeof c.endedAt=="string"&&(i[a]={sessionId:c.sessionId,endedAt:c.endedAt,role:typeof c.role=="string"?c.role:void 0})}return await rr(e,i),{version:rt,entries:i}}async function _e(n,e={}){let t=await G(e.homeDir),r=le(n),s=t.entries[r];if(s&&!(e.role&&s.role&&s.role!==e.role))return s}async function Me(n,e={}){let t=le(n.cwd),r={sessionId:n.sessionId,role:n.role,endedAt:n.endedAt??new Date().toISOString()},s=V(e.homeDir);await Te(s,t,r),await Re(e.homeDir,async()=>{let i=await G(e.homeDir);i.entries[t]=r,await S(s,JSON.stringify(i,null,2)+`
|
|
53
53
|
`)})}async function or(n,e={}){let t=le(n),r=V(e.homeDir);(await G(e.homeDir)).entries[t]&&(await Te(r,t,null),await Re(e.homeDir,async()=>{let i=await G(e.homeDir);delete i.entries[t],await S(r,JSON.stringify(i,null,2)+`
|
|
54
54
|
`)}))}async function ue(n,e={}){let t=await G(e.homeDir),r=Object.entries(t.entries).filter(([,i])=>i.sessionId===n).map(([i])=>i);if(r.length===0)return;let s=V(e.homeDir);await Promise.all(r.map(i=>Te(s,i,null))),await Re(e.homeDir,async()=>{let i=await G(e.homeDir);for(let[o,a]of Object.entries(i.entries))a.sessionId===n&&delete i.entries[o];await S(s,JSON.stringify(i,null,2)+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/session/id-generator.ts":{"bytes":870,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/fs.ts":{"bytes":11386,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/json.ts":{"bytes":804,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":3719,"imports":[],"format":"esm"},"src/session/direct-shell.ts":{"bytes":2317,"imports":[],"format":"esm"},"src/session/transcript-pages.ts":{"bytes":9566,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/session/transcript.ts":{"bytes":18791,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/session/transcript-pages.ts","kind":"import-statement","original":"./transcript-pages.js"}],"format":"esm"},"src/tools/tool-names.ts":{"bytes":2779,"imports":[],"format":"esm"},"src/session/checkpoint.ts":{"bytes":5786,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"fs/promises","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/tools/tool-names.ts","kind":"import-statement","original":"../tools/tool-names.js"}],"format":"esm"},"src/runtime/shutdown.ts":{"bytes":7260,"imports":[],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/session/lock.ts":{"bytes":10975,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/runtime/shutdown.ts","kind":"import-statement","original":"../runtime/shutdown.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"}],"format":"esm"},"src/types.ts":{"bytes":27927,"imports":[],"format":"esm"},"src/utils/path-security.ts":{"bytes":993,"imports":[{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"src/session/execution-mode.ts":{"bytes":313,"imports":[],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/session/recent-sessions.ts":{"bytes":15374,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/session/registry.ts":{"bytes":15052,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"../utils/path-security.js"},{"path":"src/session/execution-mode.ts","kind":"import-statement","original":"./execution-mode.js"},{"path":"src/session/recent-sessions.ts","kind":"import-statement","original":"./recent-sessions.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"},{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"}],"format":"esm"},"src/session/recovery.ts":{"bytes":11638,"imports":[{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"}],"format":"esm"},"src/session/manager.ts":{"bytes":16015,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/session/registry.ts","kind":"import-statement","original":"./registry.js"},{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/session/recovery.ts","kind":"import-statement","original":"./recovery.js"},{"path":"src/session/execution-mode.ts","kind":"import-statement","original":"./execution-mode.js"}],"format":"esm"},"src/session/turn-restore.ts":{"bytes":30241,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/tools/tool-names.ts","kind":"import-statement","original":"../tools/tool-names.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"../utils/path-security.js"}],"format":"esm"},"src/session/index.ts":{"bytes":1570,"imports":[{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/session/registry.ts","kind":"import-statement","original":"./registry.js"},{"path":"src/session/manager.ts","kind":"import-statement","original":"./manager.js"},{"path":"src/session/recovery.ts","kind":"import-statement","original":"./recovery.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/session/recent-sessions.ts","kind":"import-statement","original":"./recent-sessions.js"},{"path":"src/session/turn-restore.ts","kind":"import-statement","original":"./turn-restore.js"}],"format":"esm"}},"outputs":{"dist/session/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"crypto","kind":"require-call","external":true},{"path":"fs/promises","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"os","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"os","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/session/index.ts","inputs":{"src/session/index.ts":{"bytesInOutput":755},"src/session/id-generator.ts":{"bytesInOutput":340},"src/session/transcript.ts":{"bytesInOutput":7906},"src/utils/fs.ts":{"bytesInOutput":1604},"src/utils/json.ts":{"bytesInOutput":170},"src/utils/logger.ts":{"bytesInOutput":489},"src/session/direct-shell.ts":{"bytesInOutput":1071},"src/session/transcript-pages.ts":{"bytesInOutput":3825},"src/session/checkpoint.ts":{"bytesInOutput":2307},"src/tools/tool-names.ts":{"bytesInOutput":242},"src/session/lock.ts":{"bytesInOutput":3733},"src/runtime/shutdown.ts":{"bytesInOutput":400},"src/version.ts":{"bytesInOutput":16},"src/session/registry.ts":{"bytesInOutput":4613},"src/utils/path-security.ts":{"bytesInOutput":314},"src/session/execution-mode.ts":{"bytesInOutput":136},"src/session/recent-sessions.ts":{"bytesInOutput":4302},"src/utils/platform.ts":{"bytesInOutput":244},"src/session/manager.ts":{"bytesInOutput":6022},"src/session/recovery.ts":{"bytesInOutput":4149},"src/session/turn-restore.ts":{"bytesInOutput":13502}},"bytes":57299}}}
|
|
1
|
+
{"inputs":{"src/session/id-generator.ts":{"bytes":870,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/fs.ts":{"bytes":11685,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/json.ts":{"bytes":804,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":3719,"imports":[],"format":"esm"},"src/session/direct-shell.ts":{"bytes":2317,"imports":[],"format":"esm"},"src/session/transcript-pages.ts":{"bytes":9566,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/session/transcript.ts":{"bytes":18791,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/session/transcript-pages.ts","kind":"import-statement","original":"./transcript-pages.js"}],"format":"esm"},"src/tools/tool-names.ts":{"bytes":2810,"imports":[],"format":"esm"},"src/session/checkpoint.ts":{"bytes":5786,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"fs/promises","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/tools/tool-names.ts","kind":"import-statement","original":"../tools/tool-names.js"}],"format":"esm"},"src/runtime/shutdown.ts":{"bytes":7260,"imports":[],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/session/lock.ts":{"bytes":10975,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/runtime/shutdown.ts","kind":"import-statement","original":"../runtime/shutdown.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"}],"format":"esm"},"src/types.ts":{"bytes":27927,"imports":[],"format":"esm"},"src/utils/path-security.ts":{"bytes":993,"imports":[{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"src/session/execution-mode.ts":{"bytes":313,"imports":[],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/session/recent-sessions.ts":{"bytes":15374,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/session/registry.ts":{"bytes":15052,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"../utils/path-security.js"},{"path":"src/session/execution-mode.ts","kind":"import-statement","original":"./execution-mode.js"},{"path":"src/session/recent-sessions.ts","kind":"import-statement","original":"./recent-sessions.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"},{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"}],"format":"esm"},"src/session/recovery.ts":{"bytes":11638,"imports":[{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"}],"format":"esm"},"src/session/manager.ts":{"bytes":16015,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/session/registry.ts","kind":"import-statement","original":"./registry.js"},{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/session/recovery.ts","kind":"import-statement","original":"./recovery.js"},{"path":"src/session/execution-mode.ts","kind":"import-statement","original":"./execution-mode.js"}],"format":"esm"},"src/session/turn-restore.ts":{"bytes":30241,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/tools/tool-names.ts","kind":"import-statement","original":"../tools/tool-names.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"../utils/path-security.js"}],"format":"esm"},"src/session/index.ts":{"bytes":1570,"imports":[{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/session/registry.ts","kind":"import-statement","original":"./registry.js"},{"path":"src/session/manager.ts","kind":"import-statement","original":"./manager.js"},{"path":"src/session/recovery.ts","kind":"import-statement","original":"./recovery.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/session/recent-sessions.ts","kind":"import-statement","original":"./recent-sessions.js"},{"path":"src/session/turn-restore.ts","kind":"import-statement","original":"./turn-restore.js"}],"format":"esm"}},"outputs":{"dist/session/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"crypto","kind":"require-call","external":true},{"path":"fs/promises","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"os","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"os","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/session/index.ts","inputs":{"src/session/index.ts":{"bytesInOutput":755},"src/session/id-generator.ts":{"bytesInOutput":340},"src/session/transcript.ts":{"bytesInOutput":7906},"src/utils/fs.ts":{"bytesInOutput":1604},"src/utils/json.ts":{"bytesInOutput":170},"src/utils/logger.ts":{"bytesInOutput":489},"src/session/direct-shell.ts":{"bytesInOutput":1071},"src/session/transcript-pages.ts":{"bytesInOutput":3825},"src/session/checkpoint.ts":{"bytesInOutput":2307},"src/tools/tool-names.ts":{"bytesInOutput":242},"src/session/lock.ts":{"bytesInOutput":3733},"src/runtime/shutdown.ts":{"bytesInOutput":400},"src/version.ts":{"bytesInOutput":16},"src/session/registry.ts":{"bytesInOutput":4613},"src/utils/path-security.ts":{"bytesInOutput":314},"src/session/execution-mode.ts":{"bytesInOutput":136},"src/session/recent-sessions.ts":{"bytesInOutput":4302},"src/utils/platform.ts":{"bytesInOutput":244},"src/session/manager.ts":{"bytesInOutput":6022},"src/session/recovery.ts":{"bytesInOutput":4149},"src/session/turn-restore.ts":{"bytesInOutput":13502}},"bytes":57299}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/session/id-generator.ts":{"bytes":870,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/fs.ts":{"bytes":11386,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/json.ts":{"bytes":804,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":3719,"imports":[],"format":"esm"},"src/session/direct-shell.ts":{"bytes":2317,"imports":[],"format":"esm"},"src/session/transcript-pages.ts":{"bytes":9566,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/session/transcript.ts":{"bytes":18791,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/session/transcript-pages.ts","kind":"import-statement","original":"./transcript-pages.js"}],"format":"esm"},"src/tools/tool-names.ts":{"bytes":2779,"imports":[],"format":"esm"},"src/session/checkpoint.ts":{"bytes":5786,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"fs/promises","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/tools/tool-names.ts","kind":"import-statement","original":"../tools/tool-names.js"}],"format":"esm"},"src/runtime/shutdown.ts":{"bytes":7260,"imports":[],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/session/lock.ts":{"bytes":10975,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/runtime/shutdown.ts","kind":"import-statement","original":"../runtime/shutdown.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"}],"format":"esm"},"src/types.ts":{"bytes":27927,"imports":[],"format":"esm"},"src/utils/path-security.ts":{"bytes":993,"imports":[{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"src/session/execution-mode.ts":{"bytes":313,"imports":[],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/session/recent-sessions.ts":{"bytes":15374,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/session/registry.ts":{"bytes":15052,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"../utils/path-security.js"},{"path":"src/session/execution-mode.ts","kind":"import-statement","original":"./execution-mode.js"},{"path":"src/session/recent-sessions.ts","kind":"import-statement","original":"./recent-sessions.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"},{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"}],"format":"esm"},"src/session/recovery.ts":{"bytes":11638,"imports":[{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"}],"format":"esm"},"src/session/manager.ts":{"bytes":16015,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/session/registry.ts","kind":"import-statement","original":"./registry.js"},{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/session/recovery.ts","kind":"import-statement","original":"./recovery.js"},{"path":"src/session/execution-mode.ts","kind":"import-statement","original":"./execution-mode.js"}],"format":"esm"},"src/session/turn-restore.ts":{"bytes":30241,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/tools/tool-names.ts","kind":"import-statement","original":"../tools/tool-names.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"../utils/path-security.js"}],"format":"esm"},"src/session/index.ts":{"bytes":1570,"imports":[{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/session/registry.ts","kind":"import-statement","original":"./registry.js"},{"path":"src/session/manager.ts","kind":"import-statement","original":"./manager.js"},{"path":"src/session/recovery.ts","kind":"import-statement","original":"./recovery.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/session/recent-sessions.ts","kind":"import-statement","original":"./recent-sessions.js"},{"path":"src/session/turn-restore.ts","kind":"import-statement","original":"./turn-restore.js"}],"format":"esm"}},"outputs":{"dist/session/index.js":{"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"fs/promises","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"exports":["CheckpointManager","DIRECT_SHELL_CONTEXT_WARNING","MAX_DIRECT_SHELL_OUTPUT_CHARS","SessionLock","SessionManager","SessionRegistry","TranscriptWriter","TurnRestoreManager","createDirectShellMessage","forgetRecentSession","forgetRecentSessionById","formatDirectShellContext","generateSessionId","getRecentSessionsIndexPath","isDirectShellMessage","isValidSessionId","loadRecentSessionsIndex","lookupRecentSession","normalizeDirectShellResultRecord","normalizeWorkingDirectory","parseSessionId","readSessionFormatVersion","recordRecentSession","recoverSessionMessages","repairInterruptedToolCalls"],"entryPoint":"src/session/index.ts","inputs":{"src/session/id-generator.ts":{"bytesInOutput":337},"src/session/index.ts":{"bytesInOutput":0},"src/session/transcript.ts":{"bytesInOutput":7903},"src/utils/fs.ts":{"bytesInOutput":1617},"src/utils/json.ts":{"bytesInOutput":170},"src/utils/logger.ts":{"bytesInOutput":489},"src/session/direct-shell.ts":{"bytesInOutput":1071},"src/session/transcript-pages.ts":{"bytesInOutput":3828},"src/session/checkpoint.ts":{"bytesInOutput":2301},"src/tools/tool-names.ts":{"bytesInOutput":242},"src/session/lock.ts":{"bytesInOutput":3729},"src/runtime/shutdown.ts":{"bytesInOutput":400},"src/version.ts":{"bytesInOutput":16},"src/session/registry.ts":{"bytesInOutput":4609},"src/utils/path-security.ts":{"bytesInOutput":310},"src/session/execution-mode.ts":{"bytesInOutput":136},"src/session/recent-sessions.ts":{"bytesInOutput":4301},"src/utils/platform.ts":{"bytesInOutput":227},"src/session/manager.ts":{"bytesInOutput":6018},"src/session/recovery.ts":{"bytesInOutput":4149},"src/session/turn-restore.ts":{"bytesInOutput":13088}},"bytes":55639}}}
|
|
1
|
+
{"inputs":{"src/session/id-generator.ts":{"bytes":870,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/fs.ts":{"bytes":11685,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/json.ts":{"bytes":804,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":3719,"imports":[],"format":"esm"},"src/session/direct-shell.ts":{"bytes":2317,"imports":[],"format":"esm"},"src/session/transcript-pages.ts":{"bytes":9566,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/session/transcript.ts":{"bytes":18791,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/session/transcript-pages.ts","kind":"import-statement","original":"./transcript-pages.js"}],"format":"esm"},"src/tools/tool-names.ts":{"bytes":2810,"imports":[],"format":"esm"},"src/session/checkpoint.ts":{"bytes":5786,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"fs/promises","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/tools/tool-names.ts","kind":"import-statement","original":"../tools/tool-names.js"}],"format":"esm"},"src/runtime/shutdown.ts":{"bytes":7260,"imports":[],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/session/lock.ts":{"bytes":10975,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/runtime/shutdown.ts","kind":"import-statement","original":"../runtime/shutdown.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"}],"format":"esm"},"src/types.ts":{"bytes":27927,"imports":[],"format":"esm"},"src/utils/path-security.ts":{"bytes":993,"imports":[{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"src/session/execution-mode.ts":{"bytes":313,"imports":[],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/session/recent-sessions.ts":{"bytes":15374,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/session/registry.ts":{"bytes":15052,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"../utils/path-security.js"},{"path":"src/session/execution-mode.ts","kind":"import-statement","original":"./execution-mode.js"},{"path":"src/session/recent-sessions.ts","kind":"import-statement","original":"./recent-sessions.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"},{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"}],"format":"esm"},"src/session/recovery.ts":{"bytes":11638,"imports":[{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"}],"format":"esm"},"src/session/manager.ts":{"bytes":16015,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"src/utils/fs.ts","kind":"import-statement","original":"../utils/fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"../utils/json.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/session/registry.ts","kind":"import-statement","original":"./registry.js"},{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"../utils/logger.js"},{"path":"src/session/recovery.ts","kind":"import-statement","original":"./recovery.js"},{"path":"src/session/execution-mode.ts","kind":"import-statement","original":"./execution-mode.js"}],"format":"esm"},"src/session/turn-restore.ts":{"bytes":30241,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/tools/tool-names.ts","kind":"import-statement","original":"../tools/tool-names.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"../utils/path-security.js"}],"format":"esm"},"src/session/index.ts":{"bytes":1570,"imports":[{"path":"src/session/id-generator.ts","kind":"import-statement","original":"./id-generator.js"},{"path":"src/session/transcript.ts","kind":"import-statement","original":"./transcript.js"},{"path":"src/session/checkpoint.ts","kind":"import-statement","original":"./checkpoint.js"},{"path":"src/session/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/session/registry.ts","kind":"import-statement","original":"./registry.js"},{"path":"src/session/manager.ts","kind":"import-statement","original":"./manager.js"},{"path":"src/session/recovery.ts","kind":"import-statement","original":"./recovery.js"},{"path":"src/session/direct-shell.ts","kind":"import-statement","original":"./direct-shell.js"},{"path":"src/session/recent-sessions.ts","kind":"import-statement","original":"./recent-sessions.js"},{"path":"src/session/turn-restore.ts","kind":"import-statement","original":"./turn-restore.js"}],"format":"esm"}},"outputs":{"dist/session/index.js":{"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"fs/promises","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"exports":["CheckpointManager","DIRECT_SHELL_CONTEXT_WARNING","MAX_DIRECT_SHELL_OUTPUT_CHARS","SessionLock","SessionManager","SessionRegistry","TranscriptWriter","TurnRestoreManager","createDirectShellMessage","forgetRecentSession","forgetRecentSessionById","formatDirectShellContext","generateSessionId","getRecentSessionsIndexPath","isDirectShellMessage","isValidSessionId","loadRecentSessionsIndex","lookupRecentSession","normalizeDirectShellResultRecord","normalizeWorkingDirectory","parseSessionId","readSessionFormatVersion","recordRecentSession","recoverSessionMessages","repairInterruptedToolCalls"],"entryPoint":"src/session/index.ts","inputs":{"src/session/id-generator.ts":{"bytesInOutput":337},"src/session/index.ts":{"bytesInOutput":0},"src/session/transcript.ts":{"bytesInOutput":7903},"src/utils/fs.ts":{"bytesInOutput":1617},"src/utils/json.ts":{"bytesInOutput":170},"src/utils/logger.ts":{"bytesInOutput":489},"src/session/direct-shell.ts":{"bytesInOutput":1071},"src/session/transcript-pages.ts":{"bytesInOutput":3828},"src/session/checkpoint.ts":{"bytesInOutput":2301},"src/tools/tool-names.ts":{"bytesInOutput":242},"src/session/lock.ts":{"bytesInOutput":3729},"src/runtime/shutdown.ts":{"bytesInOutput":400},"src/version.ts":{"bytesInOutput":16},"src/session/registry.ts":{"bytesInOutput":4609},"src/utils/path-security.ts":{"bytesInOutput":310},"src/session/execution-mode.ts":{"bytesInOutput":136},"src/session/recent-sessions.ts":{"bytesInOutput":4301},"src/utils/platform.ts":{"bytesInOutput":227},"src/session/manager.ts":{"bytesInOutput":6018},"src/session/recovery.ts":{"bytesInOutput":4149},"src/session/turn-restore.ts":{"bytesInOutput":13088}},"bytes":55639}}}
|