thinkpool-pair 0.7.387 → 0.7.388
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/lane-work-snapshot.mjs +1 -1
- package/package.json +1 -1
- package/publish-manifest.json +5 -5
package/lane-work-snapshot.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{execFileSync as e}from"node:child_process";const t=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/,n=/^[a-f0-9]{40}(?:[a-f0-9]{24})?$/,r=new Set(["claude","codex","hermes"]),
|
|
1
|
+
import{execFileSync as e}from"node:child_process";const t=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/,n=/^[a-f0-9]{40}(?:[a-f0-9]{24})?$/,r=new Set(["claude","codex","hermes"]),o=new Set(["default","acceptEdits","plan","review","bypassPermissions"]),i=new Set(["main","worker","side","flow-conductor","flow-builder","flow-reviewer","scheduled"]),a=new Set(["clean","dirty","unavailable"]),l=/(?:\r|\n|(?:^|[\\/])(?:Users|home|private|tmp|var|workspace)(?:[\\/]|$)|\.thinkpool[\\/]|(?:api[_-]?key|authorization|bearer|password|secret)\b)/i,u=1e5;function d(e){if("string"!=typeof e)return null;const n=e.trim();return t.test(n)?n:null}function s(e){if("string"!=typeof e)return null;const t=e.trim().toLowerCase();return n.test(t)?t:null}function c(e={}){return"conductor"===e.flowRole?"flow-conductor":"reviewer"===e.flowRole||"review"===e.sliceType?"flow-reviewer":e.flowSessionId||e.flowTaskKey||"builder"===e.flowRole?"flow-builder":e.scheduleRunId?"scheduled":e.sideParent?"side":e.spawnedBy?"worker":"main"}function f(e){return new Set(String(e||"").split("\0").filter(Boolean))}export function readLaneWorkGit(t,n=e,r=null){if("string"!=typeof t||!t.trim())return{worktreeState:"unavailable"};let o=null;try{o=s(n("git",["-C",t,"rev-parse","HEAD"],{encoding:"utf8",timeout:5e3,stdio:["ignore","pipe","ignore"]}))}catch{return{worktreeState:"unavailable"}}try{const e=n("git",["-C",t,"status","--porcelain=v1","--untracked-files=all"],{encoding:"utf8",timeout:5e3,stdio:["ignore","pipe","ignore"]}),i={...o?{headSha:o}:{},worktreeState:String(e||"").trim()?"dirty":"clean"},a="clean"===r?.worktreeState?s(r?.headSha):null;if(a){o&&(i.headChanged=o!==a);const e=function(e,t,n){try{const r=n("git",["-C",e,"diff","--name-only","-z","--no-renames",t,"--"],{encoding:"utf8",timeout:5e3,stdio:["ignore","pipe","ignore"]}),o=n("git",["-C",e,"ls-files","--others","--exclude-standard","-z"],{encoding:"utf8",timeout:5e3,stdio:["ignore","pipe","ignore"]}),i=f(r);for(const e of f(o))i.add(e);return Math.min(i.size,u)}catch{return null}}(t,a,n);null!==e&&(i.changedFileCount=e)}return i}catch{return{...o?{headSha:o}:{},worktreeState:"unavailable"}}}export function normalizeLaneWorkSnapshot(e){if(!e||"object"!=typeof e||Array.isArray(e)||![1,2].includes(e.version))return null;const t=d(e.terminalId),n=Number.isSafeInteger(e.turnRev)&&e.turnRev>0?e.turnRev:null,c="string"==typeof e.capturedAt&&Number.isFinite(Date.parse(e.capturedAt))?new Date(e.capturedAt).toISOString():null,f=e.identity,g=r.has(f?.runtime)?f.runtime:null,w=i.has(f?.laneRole)?f.laneRole:null,p=a.has(e.git?.worktreeState)?e.git.worktreeState:null;if(!(t&&n&&c&&g&&w&&p))return null;const h={runtime:g,laneRole:w},m=function(e,t=120){if("string"!=typeof e)return null;const n=e.replace(/\s+/g," ").trim();return!n||n.length>t||l.test(n)?null:n}(f.model),S=o.has(f.mode)?f.mode:null,y=d(f.parentTerminalId),k=d(f.flowId),v=d(f.flowTaskKey);m&&(h.model=m),S&&(h.mode=S),y&&(h.parentTerminalId=y),k&&(h.flowId=k),v&&(h.flowTaskKey=v);const b={worktreeState:p},I=s(e.git?.headSha),C="boolean"==typeof e.git?.headChanged?e.git.headChanged:null,R=Number.isSafeInteger(e.git?.changedFileCount)&&e.git.changedFileCount>=0&&e.git.changedFileCount<=u?e.git.changedFileCount:null;return I&&(b.headSha=I),null!==C&&(b.headChanged=C),null!==R&&(b.changedFileCount=R),{version:e.version,terminalId:t,turnRev:n,capturedAt:c,identity:h,git:b}}export function buildLaneWorkSnapshot(t,{now:n=Date.now(),gitFacts:r}={}){const o=t?.sideParent||("string"!=typeof t?.spawnedBy||t.spawnedBy.startsWith("flow:")?null:t.spawnedBy),i={runtime:t?.runtime,model:t?.model,mode:t?.mode,laneRole:c(t),parentTerminalId:o,flowId:t?.flowSessionId,flowTaskKey:t?.flowTaskKey};return normalizeLaneWorkSnapshot({version:2,terminalId:t?.id,turnRev:Number(t?._turnRev),capturedAt:new Date(n).toISOString(),identity:i,git:r||readLaneWorkGit(t?.cwd,e,t?._turnGitStart)})}
|
package/package.json
CHANGED
package/publish-manifest.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": 1,
|
|
3
3
|
"package": "thinkpool-pair",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.388",
|
|
5
5
|
"kind": "minified",
|
|
6
6
|
"minifiedModules": 118,
|
|
7
|
-
"sourceModuleBytes":
|
|
8
|
-
"artifactModuleBytes":
|
|
7
|
+
"sourceModuleBytes": 1723427,
|
|
8
|
+
"artifactModuleBytes": 775951,
|
|
9
9
|
"files": {
|
|
10
|
-
"package.json": "
|
|
10
|
+
"package.json": "8a883228c53d6e2ed642f902009192efb1f35a76d8277bcd7a2d8b019a309364",
|
|
11
11
|
"LICENSE": "8a030197ca1cad9669909ca14c9ad15cf48d9fe551da526ccaf1fca993eddb23",
|
|
12
12
|
"bridge.mjs": "9d71cfc27ff670d7a79f3afa015030fa33708167e9b213bb83547f46aba46c6d",
|
|
13
13
|
"bridge-service.sh": "b64f27c473ca8f3a49190fd08c23947ab14ca9958d70b6fa53c7bddc2be91403",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"codex-images.mjs": "31605d6d8b3dd6b73395da63d1b0c513445c95ffa2f4306ee466f201d633ffc0",
|
|
37
37
|
"codex-mcp-http.mjs": "7472543648a9bb575ce20dc3e3270c2da84174c6ea6e9faf87dfaafb95b6212a",
|
|
38
38
|
"lane-worktree.mjs": "37583757ab82843412ba565dfba3d7cab517e94782eb33115decd5438d092d8f",
|
|
39
|
-
"lane-work-snapshot.mjs": "
|
|
39
|
+
"lane-work-snapshot.mjs": "8b6fcc60264879914ed0faf1fa04831435f9e1ad4a1b765dc75f654cd77977a8",
|
|
40
40
|
"codex-event-mapper.mjs": "7e7b878b24cb9208af517a195cc4089de87eda68086355f9e8e3b7e308825dee",
|
|
41
41
|
"edit-diff.mjs": "9a1bef6bb2d853d630ad38aba374cb2a120dd75b9aa08ab42ffc83cb0e1c57b6",
|
|
42
42
|
"cumulative-event-relay.mjs": "cf6e6533e33b3c5bb0b462d15ccc86106f2b56f8b1e66fc1f4867dd8f44d7ae6",
|