3fe4721da6
The prior fix (sinceSeconds window anchored to lastLogReceivedAt) still caused duplicates: on reconnect, the K8s API re-streams N seconds of already-seen content and those bytes were forwarded to onLog verbatim. New approach: - First stream attempt: emit chunks to onLog in real-time as before. - Reconnect attempts: buffer all incoming chunks rather than emitting immediately, then call findNewLogContent() to strip any prefix of the buffered data that overlaps with content already sent, and forward only the genuinely new suffix. - findNewLogContent uses the KMP failure-function algorithm (O(N)) to find the longest prefix of the reconnect data that matches a suffix of the accumulated content, guaranteeing correct deduplication even for large sinceSeconds windows or rapidly repeated lines. Co-Authored-By: Paperclip <noreply@paperclip.ing>
50 lines
1.3 KiB
JSON
50 lines
1.3 KiB
JSON
{
|
|
"name": "@farhoodliquor/paperclip-adapter-claude-k8s",
|
|
"version": "0.1.26",
|
|
"description": "Paperclip adapter plugin that runs Claude Code agents as Kubernetes Jobs",
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/farhoodliquor/paperclip-adapter-claude-k8s"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/farhoodliquor/paperclip-adapter-claude-k8s/issues"
|
|
},
|
|
"homepage": "https://github.com/farhoodliquor/paperclip-adapter-claude-k8s#readme",
|
|
"type": "module",
|
|
"paperclip": {
|
|
"adapterUiParser": "1.0.0"
|
|
},
|
|
"exports": {
|
|
".": "./dist/index.js",
|
|
"./server": "./dist/server/index.js",
|
|
"./ui-parser": "./dist/ui-parser.js",
|
|
"./cli": "./dist/cli/index.js"
|
|
},
|
|
"files": [
|
|
"dist"
|
|
],
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"clean": "rm -rf dist",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"coverage": "vitest run --coverage"
|
|
},
|
|
"dependencies": {
|
|
"@kubernetes/client-node": "^1.0.0",
|
|
"picocolors": "^1.1.1"
|
|
},
|
|
"peerDependencies": {
|
|
"@paperclipai/adapter-utils": ">=2026.415.0-canary.7"
|
|
},
|
|
"devDependencies": {
|
|
"@paperclipai/adapter-utils": "2026.415.0-canary.7",
|
|
"@types/node": "^24.6.0",
|
|
"@vitest/coverage-v8": "^4.1.4",
|
|
"typescript": "^5.7.3",
|
|
"vitest": "^4.1.4"
|
|
}
|
|
}
|