@oscharko-dev/keiko 0.3.11 → 0.3.12
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/ui/csp-hashes.json +11 -11
- package/dist/ui/static/404.html +1 -1
- package/dist/ui/static/__next.__PAGE__.txt +2 -2
- package/dist/ui/static/__next._full.txt +3 -3
- package/dist/ui/static/__next._head.txt +1 -1
- package/dist/ui/static/__next._index.txt +1 -1
- package/dist/ui/static/__next._tree.txt +1 -1
- package/dist/ui/static/_next/static/chunks/{2ksqufkg3ptp1.js → 07kp3rvh_lwpl.js} +1 -1
- package/dist/ui/static/_next/static/chunks/0spfmty-r-rqj.js +1 -0
- package/dist/ui/static/_next/static/chunks/{2b7g5wrm7slyv.js → 123hx5vnwghyp.js} +1 -1
- package/dist/ui/static/_next/static/chunks/1aad3wmm8b0h_.js +1 -0
- package/dist/ui/static/_next/static/chunks/1s1u4fx4mdurk.js +1 -0
- package/dist/ui/static/_next/static/chunks/2xgtm8mmbv8mx.js +1 -0
- package/dist/ui/static/_next/static/chunks/3od_e1_j5aq-u.js +1 -0
- package/dist/ui/static/_not-found/__next._full.txt +1 -1
- package/dist/ui/static/_not-found/__next._head.txt +1 -1
- package/dist/ui/static/_not-found/__next._index.txt +1 -1
- package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/ui/static/_not-found/__next._not-found.txt +1 -1
- package/dist/ui/static/_not-found/__next._tree.txt +1 -1
- package/dist/ui/static/_not-found.html +1 -1
- package/dist/ui/static/_not-found.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._full.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._head.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._index.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.txt +1 -1
- package/dist/ui/static/atlassian-connectors.html +1 -1
- package/dist/ui/static/atlassian-connectors.txt +1 -1
- package/dist/ui/static/index.html +1 -1
- package/dist/ui/static/index.txt +3 -3
- package/dist/ui/static/launch/__next._full.txt +3 -3
- package/dist/ui/static/launch/__next._head.txt +1 -1
- package/dist/ui/static/launch/__next._index.txt +1 -1
- package/dist/ui/static/launch/__next._tree.txt +1 -1
- package/dist/ui/static/launch/__next.launch.__PAGE__.txt +2 -2
- package/dist/ui/static/launch/__next.launch.txt +1 -1
- package/dist/ui/static/launch.html +1 -1
- package/dist/ui/static/launch.txt +3 -3
- package/dist/ui/static/local-knowledge/__next._full.txt +3 -3
- package/dist/ui/static/local-knowledge/__next._head.txt +1 -1
- package/dist/ui/static/local-knowledge/__next._index.txt +1 -1
- package/dist/ui/static/local-knowledge/__next._tree.txt +1 -1
- package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +2 -2
- package/dist/ui/static/local-knowledge/__next.local-knowledge.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._full.txt +5 -5
- package/dist/ui/static/local-knowledge/capsule/__next._head.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._index.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +2 -2
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.txt +2 -2
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule.html +1 -1
- package/dist/ui/static/local-knowledge/capsule.txt +5 -5
- package/dist/ui/static/local-knowledge.html +1 -1
- package/dist/ui/static/local-knowledge.txt +3 -3
- package/node_modules/@oscharko-dev/keiko-cli/package.json +13 -13
- package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/gateway.d.ts +36 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/gateway.js +69 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +4 -4
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +4 -4
- package/node_modules/@oscharko-dev/keiko-contracts/dist/local-knowledge-records.d.ts +10 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/local-knowledge-records.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/local-knowledge-records.js +8 -0
- package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
- package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/package.json +6 -6
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/discovery/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/discovery/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/discovery/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/discovery/persist.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/discovery/persist.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/discovery/persist.js +8 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/discovery/types.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/discovery/types.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/discovery/types.js +8 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/bounded-indexing.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/bounded-indexing.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/bounded-indexing.js +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.js +53 -14
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.js +163 -9
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/types.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/types.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-progress.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-progress.js +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/config.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/config.js +13 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.js +26 -6
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.js +28 -17
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts +18 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.js +18 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.js +80 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +12 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-handlers.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-handlers.js +132 -14
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation.js +5 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/read-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/read-handlers.js +13 -6
- package/node_modules/@oscharko-dev/keiko-server/package.json +21 -21
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/package.json +3 -3
- package/package.json +25 -25
- package/release-impact.catalog.json +59 -4
- package/vendor/{oscharko-dev-keiko-cli-0.3.11.tgz → oscharko-dev-keiko-cli-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-connectors-0.3.11.tgz → oscharko-dev-keiko-connectors-0.3.12.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-contracts-0.3.12.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-evaluations-0.3.11.tgz → oscharko-dev-keiko-evaluations-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-evidence-0.3.11.tgz → oscharko-dev-keiko-evidence-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-git-0.3.11.tgz → oscharko-dev-keiko-git-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-harness-0.3.11.tgz → oscharko-dev-keiko-harness-0.3.12.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-local-knowledge-0.3.12.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-memory-capture-0.3.11.tgz → oscharko-dev-keiko-memory-capture-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-consolidation-0.3.11.tgz → oscharko-dev-keiko-memory-consolidation-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-governance-0.3.11.tgz → oscharko-dev-keiko-memory-governance-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-retrieval-0.3.11.tgz → oscharko-dev-keiko-memory-retrieval-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-vault-0.3.11.tgz → oscharko-dev-keiko-memory-vault-0.3.12.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-0.3.12.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-quality-intelligence-0.3.11.tgz → oscharko-dev-keiko-quality-intelligence-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-sandbox-0.3.11.tgz → oscharko-dev-keiko-sandbox-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-sdk-0.3.11.tgz → oscharko-dev-keiko-sdk-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-security-0.3.11.tgz → oscharko-dev-keiko-security-0.3.12.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-server-0.3.12.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-tools-0.3.11.tgz → oscharko-dev-keiko-tools-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-verification-0.3.11.tgz → oscharko-dev-keiko-verification-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-workflows-0.3.11.tgz → oscharko-dev-keiko-workflows-0.3.12.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-workspace-0.3.11.tgz → oscharko-dev-keiko-workspace-0.3.12.tgz} +0 -0
- package/dist/ui/static/_next/static/chunks/08ix9sw49a3s7.js +0 -1
- package/dist/ui/static/_next/static/chunks/0w6kppo4hx2wx.js +0 -1
- package/dist/ui/static/_next/static/chunks/1kfsvai94yvr2.js +0 -1
- package/dist/ui/static/_next/static/chunks/1qio8iqevt0mg.js +0 -1
- package/dist/ui/static/_next/static/chunks/3r74c2jeognx2.js +0 -1
- package/vendor/oscharko-dev-keiko-contracts-0.3.11.tgz +0 -0
- package/vendor/oscharko-dev-keiko-local-knowledge-0.3.11.tgz +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-0.3.11.tgz +0 -0
- package/vendor/oscharko-dev-keiko-server-0.3.11.tgz +0 -0
- /package/dist/ui/static/_next/static/{TE3T4DCedlDBoFwpbxasE → B2yI3WR2eQz3OFEGkWCnI}/_buildManifest.js +0 -0
- /package/dist/ui/static/_next/static/{TE3T4DCedlDBoFwpbxasE → B2yI3WR2eQz3OFEGkWCnI}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/static/_next/static/{TE3T4DCedlDBoFwpbxasE → B2yI3WR2eQz3OFEGkWCnI}/_ssgManifest.js +0 -0
|
@@ -800,7 +800,7 @@
|
|
|
800
800
|
"remediation": "no-action-required",
|
|
801
801
|
"supportedFrom": ["0.2.0"],
|
|
802
802
|
"releaseNoteBullets": [
|
|
803
|
-
"Every save is a restore point
|
|
803
|
+
"Every save is a restore point — browse, compare, and restore file history locally."
|
|
804
804
|
],
|
|
805
805
|
"internalOnly": false,
|
|
806
806
|
"observableImpact": true,
|
|
@@ -1155,7 +1155,7 @@
|
|
|
1155
1155
|
"Windows failures are visible: incomplete installs, a damaged app bundle, or a runtime that cannot start now surface a native error dialog instead of exiting silently.",
|
|
1156
1156
|
"The Start Menu entry is a real shortcut; a legacy Keiko.bat from earlier releases is retired automatically during setup, repair, and the first start after an in-app update.",
|
|
1157
1157
|
"The Windows archive pipeline fails closed on symlinks, NTFS alternate-data-stream names, encryption-marked and mistyped entries, and installer cleanup retries correctly under silent installs.",
|
|
1158
|
-
"These builds carry evaluation signing, and the governed in-app updater does not offer them as a one-click update
|
|
1158
|
+
"These builds carry evaluation signing, and the governed in-app updater does not offer them as a one-click update — download 0.3.4 from this release page. On Windows, SmartScreen may warn on first run: choose “More info”, then “Run anyway”. On macOS, right-click the app and choose “Open” on first launch."
|
|
1159
1159
|
],
|
|
1160
1160
|
"review": {
|
|
1161
1161
|
"status": "reviewed",
|
|
@@ -1483,7 +1483,7 @@
|
|
|
1483
1483
|
"stateImpact": [],
|
|
1484
1484
|
"releaseNoteBullets": [
|
|
1485
1485
|
"Knowledge Pod indexing no longer dies silently when the pod is pinned to one of several gateway entries sharing a model id: the indexing job now runs with exactly the provider the request resolved (including alias-repaired pods), instead of re-deriving it with a strict first-match lookup that could miss and fail with an empty job id, no job history, and no diagnostics.",
|
|
1486
|
-
"The same repair unblocks full re-embed maintenance runs whose embedding model had rotated
|
|
1486
|
+
"The same repair unblocks full re-embed maintenance runs whose embedding model had rotated — the previous silent branch made exactly those runs fail without a trace."
|
|
1487
1487
|
],
|
|
1488
1488
|
"review": {
|
|
1489
1489
|
"status": "reviewed",
|
|
@@ -1529,7 +1529,7 @@
|
|
|
1529
1529
|
"releaseNoteCategory": "fixes",
|
|
1530
1530
|
"releaseNotePriority": "high",
|
|
1531
1531
|
"userVisibleChange": "observable",
|
|
1532
|
-
"userVisibleSummary": "Keiko 0.3.11 makes strict OpenAI-compatible gateways work end to end. Embedding requests now fall back to the minimal wire shape when a gateway answers HTTP 400 to optional extras (encoding_format, array input)
|
|
1532
|
+
"userVisibleSummary": "Keiko 0.3.11 makes strict OpenAI-compatible gateways work end to end. Embedding requests now fall back to the minimal wire shape when a gateway answers HTTP 400 to optional extras (encoding_format, array input) — the failure mode that blocked Knowledge Pod indexing on certain LiteLLM/TEI deployments while chat and a plain curl succeeded. The fallback remembers a gateway's strictness, keeps one absolute deadline over the whole compatibility ladder, and reports coherent error causes. A fresh install also no longer rejects the first chat: conversation readiness is verified on demand at chat creation and send instead of requiring a manual readiness check in settings.",
|
|
1533
1533
|
"affectedStateStores": [],
|
|
1534
1534
|
"stateImpact": [],
|
|
1535
1535
|
"releaseNoteBullets": [
|
|
@@ -1556,6 +1556,61 @@
|
|
|
1556
1556
|
"targets": ["windows-x64", "macos-arm64", "macos-x64"]
|
|
1557
1557
|
},
|
|
1558
1558
|
"traceability": null
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
"packageName": "@oscharko-dev/keiko",
|
|
1562
|
+
"packageVersion": "0.3.12",
|
|
1563
|
+
"distTag": "latest",
|
|
1564
|
+
"registry": "https://registry.npmjs.org/",
|
|
1565
|
+
"releaseTag": "v0.3.12",
|
|
1566
|
+
"supportedFrom": ["0.2.0"],
|
|
1567
|
+
"internalOnly": false,
|
|
1568
|
+
"observableImpact": true,
|
|
1569
|
+
"defaultPatchNotes": true,
|
|
1570
|
+
"oneClickEligible": false,
|
|
1571
|
+
"publishGates": [
|
|
1572
|
+
"version-consistency",
|
|
1573
|
+
"publish-manifests",
|
|
1574
|
+
"release-impact",
|
|
1575
|
+
"workspace-supply-chain",
|
|
1576
|
+
"package-surface",
|
|
1577
|
+
"qi-supply-chain",
|
|
1578
|
+
"install-smoke"
|
|
1579
|
+
],
|
|
1580
|
+
"id": "2026-08-20-keiko-0.3.12-readiness-walk-and-resilient-indexing",
|
|
1581
|
+
"releaseNoteCategory": "fixes",
|
|
1582
|
+
"releaseNotePriority": "high",
|
|
1583
|
+
"userVisibleChange": "observable",
|
|
1584
|
+
"userVisibleSummary": "Keiko 0.3.12 makes conversation-model selection and Knowledge Pod indexing robust on gateways whose first-listed model is a special-purpose engine (for example an OCR model) and on slow, CPU-served hardware. The conversation default and the contextual-retrieval fallback now prefer models whose gateway metadata declares a chat-compatible mode, so a warm OCR model can no longer capture new chats or chunk-context generation. A failed readiness probe heals after a short cooldown instead of pinning the model until a restart, grounded Knowledge Pod questions verify readiness on demand, and the model list reports never-probed models as unknown instead of unusable. Indexing no longer holds one HTTP request open for the whole run: the start answers immediately and the panel follows the persisted job, surviving reloads. A gateway outage trips a circuit breaker after five consecutive transient failures instead of grinding for hours, terminal job status is honest about majority failures, discovery limits are operator-raisable and loudly reported when hit, the embedding path honours the configured provider timeout, and interrupted embedding batches resume behind their completed work.",
|
|
1585
|
+
"affectedStateStores": [],
|
|
1586
|
+
"stateImpact": [],
|
|
1587
|
+
"releaseNoteBullets": [
|
|
1588
|
+
"New chats and the contextual-retrieval fallback default to a model whose gateway metadata declares a chat-compatible mode (LiteLLM /model/info); mode-less special-purpose ids (OCR, speech, reranking) rank last and cannot capture the default while warm — re-run the gateway verification once after updating so the mode metadata is stored.",
|
|
1589
|
+
"Conversation readiness self-heals: a failed probe retries after a 30s cooldown instead of pinning the model for the process lifetime; grounded Knowledge Pod questions verify readiness on demand (the first pod question after a restart answers without any manual probe); the models endpoint reports never-probed models as unknown/usable instead of unusable, so the picker no longer empties after every restart.",
|
|
1590
|
+
"Indexing runs detached: the start request answers immediately with the job id, the panel follows the persisted job (settling strictly on that job's identity), survives page reloads by re-attaching to the running job, and a duplicate start is refused instead of racing the in-flight run.",
|
|
1591
|
+
"Gateway outages stop runs early and honestly: five consecutive transient embedding failures trip EMBEDDING_GATEWAY_UNAVAILABLE instead of grinding through the corpus for hours; a run where most attempted documents failed reports MAJORITY_DOCUMENTS_FAILED; an intact partial index stays retrievable instead of being blacked out.",
|
|
1592
|
+
"Discovery bounds are operator-raisable via KEIKO_LOCAL_KNOWLEDGE_MAX_DISCOVERY_FILES / KEIKO_LOCAL_KNOWLEDGE_MAX_DISCOVERY_DEPTH (hard ceilings 100000 files / depth 64), and hitting a bound now surfaces a DISCOVERY_LIMIT_REACHED warning in capsule health instead of truncating silently.",
|
|
1593
|
+
"Indexing throughput on slow gateways: the embedding path honours the operator-configured provider timeoutMs (it was silently pinned at 30s), and an expired per-batch ladder deadline carries completed embeddings into the retry, which resumes behind them instead of re-embedding from item zero."
|
|
1594
|
+
],
|
|
1595
|
+
"review": {
|
|
1596
|
+
"status": "reviewed",
|
|
1597
|
+
"reviewer": "release-owner",
|
|
1598
|
+
"reviewedAt": "2026-08-20",
|
|
1599
|
+
"humanApproved": true,
|
|
1600
|
+
"approvalReference": "github-issue-comment:oscharko-dev/Keiko#3204#5351772246",
|
|
1601
|
+
"rationale": "The release owner directed this last-chance patch across the 2026-08-19/20 working sessions after the customer's dotsocr-first LiteLLM configuration on slow shared hardware surfaced default-model capture, restart-bricked grounded asks, non-convergent indexing, and multi-hour hangs on gateway outages. Ten repairs across PRs #3220 and #3221 were adversarially verified (two multi-agent passes), every behavioural change is red-proven, and the field configuration is covered end to end by twin journeys including a process-restart grounded ask and an OCR-first fallback election."
|
|
1602
|
+
},
|
|
1603
|
+
"userActionRequired": true,
|
|
1604
|
+
"remediation": "restart-required",
|
|
1605
|
+
"portableRuntimeArtifactContract": {
|
|
1606
|
+
"programEpic": 1944,
|
|
1607
|
+
"parentEpic": 1942,
|
|
1608
|
+
"issue": 1948,
|
|
1609
|
+
"stagingOnly": true,
|
|
1610
|
+
"signingScope": "evaluation",
|
|
1611
|
+
"targets": ["windows-x64", "macos-arm64", "macos-x64"]
|
|
1612
|
+
},
|
|
1613
|
+
"traceability": null
|
|
1559
1614
|
}
|
|
1560
1615
|
]
|
|
1561
1616
|
}
|
|
Binary file
|
package/vendor/{oscharko-dev-keiko-connectors-0.3.11.tgz → oscharko-dev-keiko-connectors-0.3.12.tgz}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/vendor/{oscharko-dev-keiko-evidence-0.3.11.tgz → oscharko-dev-keiko-evidence-0.3.12.tgz}
RENAMED
|
Binary file
|
|
Binary file
|
package/vendor/{oscharko-dev-keiko-harness-0.3.11.tgz → oscharko-dev-keiko-harness-0.3.12.tgz}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/vendor/{oscharko-dev-keiko-sandbox-0.3.11.tgz → oscharko-dev-keiko-sandbox-0.3.12.tgz}
RENAMED
|
Binary file
|
|
Binary file
|
package/vendor/{oscharko-dev-keiko-security-0.3.11.tgz → oscharko-dev-keiko-security-0.3.12.tgz}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/vendor/{oscharko-dev-keiko-workflows-0.3.11.tgz → oscharko-dev-keiko-workflows-0.3.12.tgz}
RENAMED
|
Binary file
|
package/vendor/{oscharko-dev-keiko-workspace-0.3.11.tgz → oscharko-dev-keiko-workspace-0.3.12.tgz}
RENAMED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24744,7340,e=>{"use strict";let l=Object.freeze({maxRawFileBytes:0x40000000,maxExtractedTextBytes:0x10000000,maxParserUnits:2e5,maxParserObjects:25e6,maxChunkCount:2e6,maxEmbeddingBatchCount:1e5,maxWallClockMs:36e5,cancellationDeadlineMs:15e3,maxRetryCount:3,maxPersistedStorageGrowthBytes:0x20000000,largeFileThresholdBytes:0x4000000,extractionWindowPages:16}),t=["complete","cancelled","failed"];Object.freeze({ocr:"unavailable",multimodal:"unavailable"}),Object.freeze({PARTIAL_COVERAGE:"PARTIAL_COVERAGE",OCR_CAPABILITY_UNAVAILABLE:"OCR_CAPABILITY_UNAVAILABLE",MULTIMODAL_CAPABILITY_UNAVAILABLE:"MULTIMODAL_CAPABILITY_UNAVAILABLE",CONVERTER_UNAVAILABLE:"CONVERTER_UNAVAILABLE",RESOURCE_POLICY_EXCEEDED:"RESOURCE_POLICY_EXCEEDED",CHECKPOINT_INCOMPATIBLE:"CHECKPOINT_INCOMPATIBLE",EXTRACTION_RESUMED:"EXTRACTION_RESUMED",EXTRACTION_PROGRESS:"EXTRACTION_PROGRESS"}),e.s(["DEFAULT_LARGE_DOCUMENT_RESOURCE_POLICY",0,l,"isTerminalExtractionPhase",0,function(e){return t.includes(e);}],24744);let a="keiko-html-manual-source-fingerprint:";function n(e){return`keiko-html-manual-source-kind:${e}`;}e.s(["parseHtmlManualSourceTagMetadata",0,function(e){let l,t;for(let o of e)o===n("html-manual-local")?l="html-manual-local":o===n("html-manual-http")?l="html-manual-http":o.startsWith(a)&&(t=o.slice(a.length));return{...(void 0!==l?{sourceKind:l}:{}),...(void 0!==t?{sourceFingerprint:t}:{})};}],7340);},96688,61774,e=>{"use strict";e.s(["STATUS_LABELS",0,{draft:"Draft",indexing:"Indexing",ready:"Indexed",stale:"Stale",deleting:"Deleting",error:"Failed"}],96688);var l=e.i(76055),t=e.i(10644);let a=(e,l)=>(0,t.translateLocalKnowledge)("en",e,l);e.s(["formatError",0,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return e instanceof l.ApiError?e.message.trim().length>0?`${e.message} (${e.code})`:t("localKnowledge.error.api",{code:e.code}):e instanceof Error&&e.message.trim().length>0?e.message:t("localKnowledge.error.unexpected");}],61774);},94891,e=>{e.v({advancedDisclosure:"capsule-detail-module__3nXTdq__advancedDisclosure",advancedStack:"capsule-detail-module__3nXTdq__advancedStack",backButton:"capsule-detail-module__3nXTdq__backButton",capsulePodGlyph:"capsule-detail-module__3nXTdq__capsulePodGlyph",capsuleRowInfo:"capsule-detail-module__3nXTdq__capsuleRowInfo",capsuleSetGlyph:"capsule-detail-module__3nXTdq__capsuleSetGlyph",detailContent:"capsule-detail-module__3nXTdq__detailContent",detailPage:"capsule-detail-module__3nXTdq__detailPage",disclosureIcon:"capsule-detail-module__3nXTdq__disclosureIcon",disclosureSummary:"capsule-detail-module__3nXTdq__disclosureSummary",explainable:"capsule-detail-module__3nXTdq__explainable",explainableBlock:"capsule-detail-module__3nXTdq__explainableBlock",helpTooltip:"capsule-detail-module__3nXTdq__helpTooltip",indexPrompt:"capsule-detail-module__3nXTdq__indexPrompt",maintenanceDisclosure:"capsule-detail-module__3nXTdq__maintenanceDisclosure",podHeader:"capsule-detail-module__3nXTdq__podHeader",podTitle:"capsule-detail-module__3nXTdq__podTitle",selectedSourceNote:"capsule-detail-module__3nXTdq__selectedSourceNote",sourcePickerActions:"capsule-detail-module__3nXTdq__sourcePickerActions",sourcePickerCopy:"capsule-detail-module__3nXTdq__sourcePickerCopy",sourcePickerDescription:"capsule-detail-module__3nXTdq__sourcePickerDescription",sourcePickerFormats:"capsule-detail-module__3nXTdq__sourcePickerFormats",sourcePickerPanel:"capsule-detail-module__3nXTdq__sourcePickerPanel",sourcePickerTitle:"capsule-detail-module__3nXTdq__sourcePickerTitle",sourceSetup:"capsule-detail-module__3nXTdq__sourceSetup",sourceSetupDescription:"capsule-detail-module__3nXTdq__sourceSetupDescription",sourceSetupHeader:"capsule-detail-module__3nXTdq__sourceSetupHeader",sourceSetupTitle:"capsule-detail-module__3nXTdq__sourceSetupTitle",specificFilesDisclosure:"capsule-detail-module__3nXTdq__specificFilesDisclosure",specificFilesSummary:"capsule-detail-module__3nXTdq__specificFilesSummary"});},69128,80814,30558,e=>{"use strict";var l=e.i(87032),t=e.i(61593),a=e.i(61774);e.s(["useCapsuleDetail",0,function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.fetchCapsuleDetail,[o,i]=(0,l.useState)(null),[s,d]=(0,l.useState)("loading"),[c,r]=(0,l.useState)(null),u=(0,l.useCallback)(async function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(""===e){i(null),r("No Knowledge Pod selected."),d("error");return;}!0!==l.quiet&&(d("loading"),r(null));try{let l=await n(e);i(l),d("ready");}catch(e){if(!0===l.quiet)return;r((0,a.formatError)(e)),d("error");}},[e,n]);return(0,l.useEffect)(()=>{u();},[u]),(0,l.useEffect)(()=>{let e=null==o?void 0:o.indexingJobs[0];if((null==o?void 0:o.capsule.lifecycleState)!=="indexing"&&(null==e?void 0:e.status)!=="queued"&&(null==e?void 0:e.status)!=="running")return;let l=null,t=()=>"u">typeof document&&"hidden"===document.visibilityState,a=()=>{null===l&&(l=window.setInterval(()=>{u({quiet:!0});},2e3));},n=()=>{null!==l&&(window.clearInterval(l),l=null);},i=()=>{t()?n():(u({quiet:!0}),a());};return t()||a(),document.addEventListener("visibilitychange",i),()=>{n(),document.removeEventListener("visibilitychange",i);};},[null==o?void 0:o.capsule.lifecycleState,null==o?void 0:o.indexingJobs,u]),{data:o,loadStatus:s,loadError:c,reload:function(){u();},replaceData:function(e){i(e),r(null),d("ready");}};}],69128);var n=e.i(10582),o=e.i(5353);let i=Object.freeze([...Object.freeze(["pdf"]),...Object.freeze(["docx"]),...Object.freeze(["xlsx"])]),s=Object.freeze([...Object.freeze(["json","jsonl","ndjson"]),...Object.freeze(["csv"]),...Object.freeze(["tsv","tab"])]),d=Object.freeze(["txt","log","md","markdown","rst","adoc","asciidoc"]),c=Object.freeze(["html","htm","xhtml"]),r=Object.freeze(["ts","tsx","js","jsx","mjs","cjs","py","rb","php","sh","bash","zsh","fish","ps1"]),u=Object.freeze(["go","rs","java","kt","swift","c","cc","cpp","h","hpp","cs"]),p=Object.freeze(["yaml","yml","toml","ini","cfg","conf","env","properties","sql","graphql","gql"]);Object.freeze([...d,...r,...u,...p]);let m=Object.freeze([Object.freeze({id:"documents",extensions:i}),Object.freeze({id:"structuredData",extensions:s}),Object.freeze({id:"textDocuments",extensions:d}),Object.freeze({id:"webDocuments",extensions:c}),Object.freeze({id:"scripts",extensions:r}),Object.freeze({id:"sourceCode",extensions:u}),Object.freeze({id:"configuration",extensions:p})]);var g=e.i(83449),h=e.i(24744);let x=h.DEFAULT_LARGE_DOCUMENT_RESOURCE_POLICY.maxRawFileBytes,b=h.DEFAULT_LARGE_DOCUMENT_RESOURCE_POLICY.maxParserObjects,v=h.DEFAULT_LARGE_DOCUMENT_RESOURCE_POLICY.maxWallClockMs;var f=e.i(8245),w=e.i(48268),k=e.i(64533),j=e.i(50850),K=e.i(10644),y=e.i(94891);function N(e){let t,{children:a,description:o,as:i="span",block:s=!1,className:d,placement:c="bottom"}=e,[r,u]=(0,l.useState)(!1),p=(0,l.useId)();return(0,n.jsxs)(i,{className:(t=[y.default.explainable],s&&t.push(y.default.explainableBlock),void 0!==d&&t.push(d),t.join(" ")),"data-placement":c,tabIndex:0,"aria-describedby":r?p:void 0,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onFocus:()=>u(!0),onBlur:()=>u(!1),onKeyDown:function(e){"Escape"===e.key&&u(!1);},children:[a,r?(0,n.jsx)("span",{id:p,role:"tooltip",className:y.default.helpTooltip,children:o}):null]});}function C(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%";}function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return{detail:null,startedAt:e,now:e,pollError:null};}function _(e){return null===e?e:{...e,now:Date.now()};}async function E(e,l,t,n,o){try{let t=await l(e);if(n())return;o(e=>null===e?{detail:t,startedAt:Date.now(),now:Date.now(),pollError:null}:{...e,detail:t,now:Date.now(),pollError:null});}catch(e){if(n())return;o(l=>{var n;return n=(0,a.formatError)(e,t),null===l?l:{...l,now:Date.now(),pollError:n};});}}e.s(["Explainable",0,N],80814);let D=Object.freeze({documents:"localKnowledge.detail.connect.filter.documents",structuredData:"localKnowledge.detail.connect.filter.structuredData",textDocuments:"localKnowledge.detail.connect.filter.textDocuments",webDocuments:"localKnowledge.detail.connect.filter.webDocuments",scripts:"localKnowledge.detail.connect.filter.scripts",sourceCode:"localKnowledge.detail.connect.filter.sourceCode",configuration:"localKnowledge.detail.connect.filter.configuration"});function I(e){return Array.from(new Set(e.split(/\r?\n/u).map(e=>e.trim()).filter(e=>e.length>0)));}function T(e,l,t,a){if("picked"===e.kind){l(e.paths),t(null);return;}"busy"===e.kind&&t(a("localKnowledge.nativeDialog.busy")),"unsupported"===e.kind&&t(a("localKnowledge.nativeDialog.unavailable")),"error"===e.kind&&t(e.message);}function R(e){let{locale:l,t}=e;return(0,n.jsxs)("div",{className:y.default.sourcePickerCopy,children:[(0,n.jsx)(N,{description:t("localKnowledge.detail.help.sourceSetup"),children:(0,n.jsx)("span",{className:y.default.sourcePickerTitle,children:t("localKnowledge.detail.connect.sourcePickerTitle")})}),(0,n.jsx)("span",{className:y.default.sourcePickerDescription,children:t("localKnowledge.detail.connect.sourcePickerDescription")}),(0,n.jsx)("span",{className:y.default.sourcePickerFormats,children:t("localKnowledge.detail.connect.supportedFormats",{size:(0,g.formatBytes)(x,l)})})]});}function P(e){let{picker:l,state:t,t:a}=e;return(0,n.jsxs)("div",{className:y.default.sourcePickerActions,children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:t.busy||!l.supported,"aria-describedby":l.supported?void 0:l.noteId,title:a("localKnowledge.detail.help.sourceSetup"),onClick:l.openFolder,children:a("localKnowledge.detail.connect.pickFolderSource")}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:t.busy||!l.supported||t.repositoryMode,"aria-describedby":l.supported?void 0:l.noteId,title:a(t.repositoryMode?"localKnowledge.detail.connect.repositoryFilesDisabledNote":"localKnowledge.detail.help.sourceSetup"),onClick:l.openFiles,children:a("localKnowledge.detail.connect.pickDocumentSource")})]});}function A(e){let{locale:l,picker:t,state:a,t:o}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:y.default.sourcePickerPanel,children:[(0,n.jsx)(R,{locale:l,t:o}),(0,n.jsx)(P,{picker:t,state:a,t:o})]}),t.supported?null:(0,n.jsx)("span",{id:t.noteId,className:"dlg-note",children:o("localKnowledge.nativeDialog.unavailable")})]});}function L(e){let{state:l,submission:t,t:a}=e;return(0,n.jsxs)("div",{className:"lkd-connect-row",children:[(0,n.jsx)("label",{htmlFor:"lkd-connect-path-input",className:"dlg-label",children:(0,n.jsx)(N,{description:a("localKnowledge.detail.help.sourcePath"),children:a("localKnowledge.detail.connect.sourcePath")})}),(0,n.jsxs)("div",{className:"lkd-connect-path-group",children:[(0,n.jsx)("input",{id:"lkd-connect-path-input",type:"text",className:"dlg-input lkd-connect-input",value:l.rootPath,disabled:l.busy,placeholder:"/absolute/path/to/source",autoComplete:"off",onChange:e=>l.setRootPath(e.target.value),onKeyDown:e=>{"Enter"===e.key&&t.connect();}}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:l.busy||null===t.scope,"aria-busy":l.busy,onClick:()=>{t.connect();},children:a(l.busy?"localKnowledge.detail.connect.connecting":"localKnowledge.detail.connect.connect")})]})]});}function M(e){let{state:l,submission:t,t:a}=e;return(0,n.jsxs)("div",{className:"lkd-connect-row",children:[(0,n.jsx)("label",{htmlFor:"lkd-connect-display-name-input",className:"dlg-label",children:(0,n.jsx)(N,{description:a("localKnowledge.detail.help.sourceDisplayName"),children:a("localKnowledge.detail.connect.displayName")})}),(0,n.jsx)("input",{id:"lkd-connect-display-name-input",type:"text",className:"dlg-input lkd-connect-input",value:l.displayName,disabled:l.busy,placeholder:a("localKnowledge.detail.connect.displayNamePlaceholder"),autoComplete:"off",onChange:e=>l.setDisplayName(e.target.value),onKeyDown:e=>{"Enter"===e.key&&t.connect();}})]});}function F(e){let{state:l,t}=e;return(0,n.jsx)("div",{className:"lkd-connect-row",children:(0,n.jsxs)("label",{htmlFor:"lkd-connect-repository-toggle",className:"dlg-label",children:[(0,n.jsx)("input",{id:"lkd-connect-repository-toggle",type:"checkbox",checked:l.repositoryMode,disabled:l.busy,onChange:e=>l.changeRepositoryMode(e.target.checked)})," ",(0,n.jsx)(N,{description:t("localKnowledge.detail.help.repositoryMode"),children:t("localKnowledge.detail.connect.repositoryMode")})]})});}function O(e){let{state:l,t}=e;return(0,n.jsxs)("details",{className:y.default.specificFilesDisclosure,"data-disabled":l.repositoryMode?"true":void 0,open:l.specificFilesExpanded&&!l.repositoryMode,onToggle:e=>{l.repositoryMode||l.setSpecificFilesExpanded(e.currentTarget.open);},children:[(0,n.jsxs)("summary",{className:y.default.specificFilesSummary,"aria-disabled":l.repositoryMode,title:l.repositoryMode?t("localKnowledge.detail.connect.repositoryFilesDisabledNote"):void 0,onClick:e=>{l.repositoryMode&&e.preventDefault();},children:[(0,n.jsx)("span",{children:(0,n.jsx)(N,{description:t("localKnowledge.detail.help.specificFiles"),children:t("localKnowledge.detail.connect.specificFiles")})}),(0,n.jsx)("span",{className:y.default.disclosureIcon,"aria-hidden":"true"})]}),(0,n.jsx)("label",{htmlFor:"lkd-connect-files-input",className:"dlg-label",children:t("localKnowledge.detail.connect.relativeFiles")}),(0,n.jsx)("textarea",{id:"lkd-connect-files-input",className:"dlg-input lkd-connect-input",value:l.filesInput,disabled:l.busy||l.repositoryMode,placeholder:"src/app.ts\nREADME.md",rows:4,onChange:e=>l.setFilesInput(e.target.value)})]});}function q(e){let{state:l,t}=e;return l.repositoryMode?(0,n.jsx)("p",{className:y.default.selectedSourceNote,children:t("localKnowledge.detail.connect.repositoryFilesDisabledNote")}):null;}function B(e){return(0,n.jsxs)("div",{className:"lkd-connect-form","aria-label":e.t("localKnowledge.detail.connect.region"),children:[(0,n.jsx)(A,{locale:e.locale,picker:e.picker,state:e.state,t:e.t}),null!==e.submission.selectedSource?(0,n.jsx)("p",{className:y.default.selectedSourceNote,children:e.submission.selectedSource}):null,(0,n.jsx)(L,{state:e.state,submission:e.submission,t:e.t}),(0,n.jsx)(M,{state:e.state,submission:e.submission,t:e.t}),(0,n.jsx)(F,{state:e.state,t:e.t}),(0,n.jsx)(O,{state:e.state,t:e.t}),(0,n.jsx)(q,{state:e.state,t:e.t}),null!==e.state.connectError?(0,n.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:e.state.connectError}):null]});}function X(e){let o,{capsuleId:i,onConnected:s,connectImpl:d=t.connectCapsuleSource}=e,c=(0,K.useLocalKnowledgeTranslate)(),r=(0,j.useLocale)(),u=function(){let[e,t]=(0,l.useState)(""),[a,n]=(0,l.useState)(""),[o,i]=(0,l.useState)(""),[s,d]=(0,l.useState)(!1),[c,r]=(0,l.useState)(!1),[u,p]=(0,l.useState)(!1),[m,g]=(0,l.useState)(null);return{rootPath:e,setRootPath:t,displayName:a,setDisplayName:n,filesInput:o,setFilesInput:i,specificFilesExpanded:s,setSpecificFilesExpanded:d,repositoryMode:c,busy:u,setBusy:p,connectError:m,setConnectError:g,changeRepositoryMode:function(e){r(e),e&&(i(""),d(!1));},reset:function(){t(""),n(""),i(""),d(!1),r(!1);}};}(),p=m.map(e=>({name:c(D[e.id]),extensions:e.extensions})),g=(o=(0,l.useId)(),{noteId:o,supported:(0,w.useNativeFileDialogCapability)(),openFolder:function(){(0,k.pickWithNativeDialog)({mode:"open-directory",title:c("localKnowledge.detail.connect.chooseFolder"),...(u.rootPath.trim().length>0?{defaultPath:u.rootPath.trim()}:{})}).then(e=>{T(e,e=>{let l=e[0];void 0!==l&&u.setRootPath(l),u.setFilesInput(""),u.setSpecificFilesExpanded(!1);},u.setConnectError,c);});},openFiles:function(){(0,k.pickWithNativeDialog)({mode:"open-files",title:c("localKnowledge.detail.connect.chooseFiles"),filters:p,...(u.rootPath.trim().length>0?{defaultPath:u.rootPath.trim()}:{})}).then(e=>{T(e,e=>{let l=(0,k.nativePathsToRootAndFiles)(e);u.setRootPath(l.rootPath),u.setFilesInput(l.files.join("\n")),u.setSpecificFilesExpanded(!0);},u.setConnectError,c);});}}),h=function(e,l,t,n,o){let i=function(e,l,t){let a=e.trim();if(""===a)return null;if(t)return{kind:"repository",repositoryRoot:a};let n=I(l);return 0===n.length?{kind:"folder",rootPath:a,recursive:!0}:{kind:"files",rootPath:a,files:n};}(n.rootPath,n.filesInput,n.repositoryMode);async function s(){if(null!==i&&!n.busy){n.setBusy(!0),n.setConnectError(null);try{let a=n.displayName.trim();""===a?await t(e,i):await t(e,i,a),n.reset(),l();}catch(e){n.setConnectError((0,a.formatError)(e,o));}finally{n.setBusy(!1);}}}return{scope:i,selectedSource:function(e,l,t,a){let n=e.trim();if(""===n)return null;if(t)return a("localKnowledge.detail.connect.selectedRepository",{path:n});let o=I(l).length;return o>0?a("localKnowledge.detail.connect.selectedDocuments",{count:o.toString(),root:n}):a("localKnowledge.detail.connect.selectedSource",{path:n});}(n.rootPath,n.filesInput,n.repositoryMode,o),connect:s};}(i,s,d,u,c);return(0,n.jsx)(B,{state:u,picker:g,submission:h,locale:r,t:c});}function U(e,t,a){(0,l.useEffect)(()=>{if(!t)return;let e=document.activeElement;return()=>{var l;return null==e||null==(l=e.focus)?void 0:l.call(e);};},[t]),(0,l.useEffect)(()=>{if(!t)return;let l=e.current;if(null===l)return;let n=l.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])");function o(e){if("Escape"===e.key){e.preventDefault(),a();return;}if("Tab"!==e.key)return;let t=Array.from(l.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===t.length)return void e.preventDefault();let n=t[0],o=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),o.focus()):e.shiftKey||document.activeElement!==o||(e.preventDefault(),n.focus());}return null==n||n.focus(),l.addEventListener("keydown",o),()=>l.removeEventListener("keydown",o);},[t,e,a]);}function $(e){var l,t,a,o,i,s;let{kind:d,progress:c,t:r}=e,u=c.detail,p=null==u?void 0:u.indexingJobs[0],m=null!=(l=null!=(t=null==p?void 0:p.totalDocuments)?t:null==u?void 0:u.health.documentCount)?l:0,h=void 0===p?0:p.processedDocuments+p.failedDocuments+p.skippedDocuments,x=m>0?h/m:0,b=null!=(a=null==u?void 0:u.health.chunkCount)?a:0,v=null!=(o=null==u?void 0:u.health.vectorCount)?o:0,f=b>0?v/b:0,w=c.now-c.startedAt,k=h>0?h/Math.max(w,1):0,j=k>0?Math.max(0,m-h)/k:0,K=null!=(i=null!=(s=null==p?void 0:p.status)?s:null==u?void 0:u.capsule.lifecycleState)?i:"starting",y=r("index"===d?"localKnowledge.detail.progress.indexing":"reembed"===d?"localKnowledge.detail.progress.reembedding":"refresh"===d?"localKnowledge.detail.progress.refreshing":"localKnowledge.detail.progress.repairing"),N=k>0&&m>h?r("localKnowledge.detail.progress.remaining",{duration:(0,g.formatDurationCompact)(j)}):r("localKnowledge.detail.progress.estimating");return(0,n.jsxs)("div",{className:"lkd-action-progress",role:"status","aria-live":"polite",title:r("localKnowledge.detail.help.actionProgress"),children:[(0,n.jsxs)("div",{className:"lkd-action-progress-head",children:[(0,n.jsx)("span",{children:y}),(0,n.jsx)("span",{children:K})]}),(0,n.jsx)("div",{className:"lkd-action-progress-note",children:r("localKnowledge.detail.progress.elapsed",{duration:(0,g.formatDurationCompact)(w),eta:N})}),(0,n.jsxs)("div",{className:"lkd-status-bars",children:[(0,n.jsxs)("div",{className:"lkd-status-bar-row",title:r("localKnowledge.detail.help.actionDocuments"),children:[(0,n.jsx)("span",{children:r("localKnowledge.detail.progress.documents")}),(0,n.jsx)(z,{value:x,label:r("localKnowledge.detail.progress.documentProgress")}),(0,n.jsxs)("span",{children:[h.toString()," / ",m.toString()]})]}),(0,n.jsxs)("div",{className:"lkd-status-bar-row",title:r("localKnowledge.detail.help.actionVectors"),children:[(0,n.jsx)("span",{children:r("localKnowledge.detail.progress.vectors")}),(0,n.jsx)(z,{value:f,label:r("localKnowledge.detail.progress.vectorProgress")}),(0,n.jsxs)("span",{children:[v.toString()," / ",b.toString()]})]})]}),null!==c.pollError?(0,n.jsx)("div",{className:"lkd-action-progress-note",children:r("localKnowledge.detail.progress.delayed",{error:c.pollError})}):null]});}function z(e){let{value:l,label:t}=e;return(0,n.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${t}: ${C(l)}`,children:(0,n.jsx)("span",{className:"lkd-progress-fill","data-tone":"ok",style:{width:C(l)}})});}function G(e){let{indexBusy:l,indexError:t,progress:a,onIndex:o,t:i}=e;return(0,n.jsxs)("div",{className:`lkd-index-row ${y.default.indexPrompt}`,children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary","aria-label":i("localKnowledge.detail.actions.index.aria"),"aria-busy":l,disabled:l,title:i("localKnowledge.detail.help.indexNow"),onClick:o,children:i(l?"localKnowledge.detail.actions.index.busy":"localKnowledge.detail.actions.index.button")}),null!==t?(0,n.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:t}):null,l&&null!==a?(0,n.jsx)($,{kind:"index",progress:a,t:i}):null]});}function V(e){let{capsuleDisplayName:l,showReembedButton:t,showRebuildButton:a,reembedRecommended:o,contextualRebuildRequired:i,actionDisabled:s,onReembed:d,onRebuild:c,onRefresh:r,onRepair:u,onDelete:p,t:m}=e;return(0,n.jsxs)("div",{role:"group","aria-label":m("localKnowledge.detail.actions.group",{name:l}),className:"lkd-actions-group",children:[t?(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","data-recommended":o?"true":"false","aria-label":m("localKnowledge.detail.actions.reembed.aria",{name:l}),title:m("localKnowledge.detail.help.actionReembed"),disabled:s,onClick:d,children:m("localKnowledge.detail.actions.reembed.button")}):null,a?(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","data-recommended":i?"true":"false","aria-label":m("localKnowledge.detail.actions.rebuild.aria",{name:l}),title:m("localKnowledge.detail.help.actionRebuild"),disabled:s,onClick:c,children:m("localKnowledge.detail.actions.rebuild.button")}):null,(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":m("localKnowledge.detail.actions.refresh.aria",{name:l}),title:m("localKnowledge.detail.help.actionRefresh"),disabled:s,onClick:r,children:m("localKnowledge.detail.actions.refresh.button")}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":m("localKnowledge.detail.actions.repair.aria",{name:l}),title:m("localKnowledge.detail.help.actionRepair"),disabled:s,onClick:u,children:m("localKnowledge.detail.actions.repair.button")}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger","aria-label":m("localKnowledge.detail.actions.delete.aria",{name:l}),title:m("localKnowledge.detail.help.actionDelete"),onClick:p,children:m("common.delete")})]});}function H(e){let{kind:t,capsuleDisplayName:a,nameInput:i,busy:s,error:d,progress:c,onNameChange:r,onConfirm:u,onCancel:p}=e,m=(0,K.useLocalKnowledgeTranslate)(),g=(0,l.useRef)(null),h=(0,l.useRef)(null);(0,f.useModalInteractionLock)(),U(g,!0,p),(0,l.useEffect)(()=>{"delete"===t&&null!==h.current&&h.current.focus();},[t]);let x=(0,l.useRef)(!1);(0,l.useEffect)(()=>{let e=g.current;if(null!==e){if(s)x.current=!0,e.focus();else if(x.current){var l;x.current=!1,null==(l=e.querySelector("button:not([disabled]),input:not([disabled])"))||l.focus();}}},[s]);let b="delete"===t,v=!s&&(!b||i===a),w="lkd-confirm-title",k="lkd-confirm-desc";return(0,o.createPortal)((0,n.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&p();},children:(0,n.jsxs)("div",{ref:g,role:"dialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":k,className:"dlg",tabIndex:-1,children:[(0,n.jsx)("div",{className:"dlg-head",children:(0,n.jsxs)("div",{className:"dlg-htext",children:[(0,n.jsx)("div",{id:w,className:"dlg-title",children:m("delete"===t?"localKnowledge.detail.actions.delete.title":"reembed"===t?"localKnowledge.detail.actions.reembed.title":"rebuild"===t?"localKnowledge.detail.actions.rebuild.title":"refresh"===t?"localKnowledge.detail.actions.refresh.title":"localKnowledge.detail.actions.repair.title")}),(0,n.jsx)("div",{id:k,className:"dlg-sub",children:"delete"===t?m("localKnowledge.detail.actions.delete.description",{name:a}):m("refresh"===t?"localKnowledge.detail.actions.refresh.description":"reembed"===t?"localKnowledge.detail.actions.reembed.description":"rebuild"===t?"localKnowledge.detail.actions.rebuild.description":"localKnowledge.detail.actions.repair.description")})]})}),b?(0,n.jsxs)("div",{className:"dlg-body",children:[(0,n.jsxs)("div",{className:"dlg-field",children:[(0,n.jsx)("label",{htmlFor:"lkd-confirm-name-input",className:"dlg-label",children:m("localKnowledge.detail.actions.delete.confirmName")}),(0,n.jsx)("input",{id:"lkd-confirm-name-input",type:"text",className:"dlg-input",value:i,autoComplete:"off",ref:h,disabled:s,placeholder:a,onChange:e=>r(e.target.value)})]}),null!==d?(0,n.jsx)("div",{role:"alert",className:"lk-alert",style:{marginTop:4},children:d}):null]}):(0,n.jsxs)("div",{className:"dlg-body",children:[s&&null!==c?(0,n.jsx)($,{kind:t,progress:c,t:m}):null,null!==d?(0,n.jsx)("div",{role:"alert",className:"lk-alert",children:d}):null]}),(0,n.jsxs)("div",{className:"dlg-foot",children:[(0,n.jsx)("button",{type:"button",className:"dlg-btn",disabled:s,onClick:p,children:m("common.cancel")}),(0,n.jsx)("button",{type:"button",className:"dlg-btn lkd-btn-destructive",disabled:!v,"aria-disabled":!v,onClick:u,children:m(s?"common.working":"delete"===t?"common.delete":"reembed"===t?"localKnowledge.detail.actions.reembed.confirm":"rebuild"===t?"localKnowledge.detail.actions.rebuild.confirm":"refresh"===t?"localKnowledge.detail.actions.refresh.confirm":"localKnowledge.detail.actions.repair.confirm")})]})]})}),document.body);}function J(e){let{affectedCapsuleSetCount:t,onContinue:a}=e,i=(0,K.useLocalKnowledgeTranslate)(),s=(0,l.useRef)(null);(0,f.useModalInteractionLock)(),U(s,!0,a);let d="lkd-affected-sets-title",c="lkd-affected-sets-desc";return(0,o.createPortal)((0,n.jsx)("div",{className:"dlg-overlay in",children:(0,n.jsxs)("div",{ref:s,role:"alertdialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":c,className:"dlg",tabIndex:-1,children:[(0,n.jsx)("div",{className:"dlg-head",children:(0,n.jsxs)("div",{className:"dlg-htext",children:[(0,n.jsx)("div",{id:d,className:"dlg-title",children:i("localKnowledge.detail.deleteAffectedSets.title")}),(0,n.jsx)("div",{id:c,className:"dlg-sub",children:i(1===t?"localKnowledge.detail.deleteAffectedSets.description.one":"localKnowledge.detail.deleteAffectedSets.description.many",{count:t})})]})}),(0,n.jsx)("div",{className:"dlg-foot",children:(0,n.jsx)("button",{type:"button",className:"dlg-btn",onClick:a,children:i("common.continue")})})]})}),document.body);}e.s(["CapsuleActions",0,function(e){var o,i;let{capsuleId:s,capsuleDisplayName:d,sourceCount:c,lifecycleState:r,vectorCompatible:u=!0,contextualRebuildRequired:p=!1,onActionComplete:m,onDeleted:h,connectCapsuleSourceImpl:f=t.connectCapsuleSource,deleteCapsuleImpl:w=t.deleteCapsule,refreshCapsuleImpl:k=t.refreshCapsuleChangedFiles,repairCapsuleImpl:C=t.repairCapsuleFailedFiles,reembedCapsuleImpl:D=t.reembedCapsuleForCurrentModel,rebuildCapsuleImpl:I=t.rebuildCapsuleIndex,startIndexingImpl:T=t.startIndexing,fetchCapsuleDetailImpl:R=t.fetchCapsuleDetail}=e,P=(0,K.useLocalKnowledgeTranslate)(),A=(0,j.useLocale)(),[L,M]=(0,l.useState)(null),[F,O]=(0,l.useState)(!1),[q,B]=(0,l.useState)(null),[U,$]=(0,l.useState)(null),[z,Y]=(0,l.useState)(!1),[W,Q]=(0,l.useState)(null),[Z,ee]=(0,l.useState)(null),el=null!==Z&&(!!z||F&&null!==L&&"delete"!==L.kind);async function et(){if(!z){ee(S()),Y(!0),Q(null);try{await T(s),ee(null),m();}catch(e){Q((0,a.formatError)(e,P));}finally{Y(!1);}}}function ea(e){B(null),ee(null),M({kind:e,nameInput:""});}async function en(e,l){"delete"!==e&&ee(S()),O(!0),B(null);try{let a=await l();if(ee(null),M(null),"delete"===e){var t,n;(null!=(t=null==(n=a.affectedCapsuleSetIds)?void 0:n.length)?t:0)>0?$(a):void 0!==h?h(a):m();}else m();}catch(e){B((0,a.formatError)(e,P));}finally{O(!1);}}(0,l.useEffect)(()=>{if(!el)return;let e=window.setInterval(()=>{ee(_);},1e3);return()=>window.clearInterval(e);},[el]),(0,l.useEffect)(()=>{if(!el)return;let e=!1;E(s,R,P,()=>e,ee);let l=window.setInterval(()=>{E(s,R,P,()=>e,ee);},2e3);return()=>{e=!0,window.clearInterval(l);};},[s,R,el,P]);let eo=F||z||"indexing"===r;return(0,n.jsxs)("section",{className:`lkd-tools ${y.default.sourceSetup}`,"aria-labelledby":"lkd-source-setup-heading",children:[(0,n.jsx)("div",{className:y.default.sourceSetupHeader,children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{id:"lkd-source-setup-heading",className:y.default.sourceSetupTitle,children:(0,n.jsx)(N,{description:P("localKnowledge.detail.help.sourceSetup"),children:P("localKnowledge.detail.connect.title")})}),(0,n.jsx)("p",{className:y.default.sourceSetupDescription,children:P("localKnowledge.detail.connect.description")})]})}),(0,n.jsx)(X,{capsuleId:s,onConnected:m,connectImpl:f}),c>0&&"ready"!==r?(0,n.jsx)(G,{indexBusy:z,indexError:W,progress:Z,onIndex:()=>void et(),t:P}):null,(0,n.jsxs)("details",{className:y.default.maintenanceDisclosure,children:[(0,n.jsxs)("summary",{className:y.default.disclosureSummary,children:[(0,n.jsx)("span",{children:(0,n.jsx)(N,{description:P("localKnowledge.detail.help.maintenance"),children:P("localKnowledge.detail.actions.maintenance")})}),(0,n.jsx)("span",{children:P("localKnowledge.detail.actions.maintenanceHint")}),(0,n.jsx)("span",{className:y.default.disclosureIcon,"aria-hidden":"true"})]}),(0,n.jsx)("p",{className:"lkd-limit-note",title:P("localKnowledge.detail.help.maintenanceLimits"),children:P("localKnowledge.detail.connect.limitSummary",{size:(0,g.formatBytes)(x,A),objects:b.toLocaleString(A),duration:function(e){let l=Math.round(e/6e4);if(l<60)return`${l.toString()} min`;let t=l/60;return`${t.toString()} h`;}(v)})}),(0,n.jsx)(V,{capsuleDisplayName:d,showReembedButton:c>0,showRebuildButton:c>0,reembedRecommended:c>0&&!u,contextualRebuildRequired:p,actionDisabled:eo,onReembed:()=>ea("reembed"),onRebuild:()=>ea("rebuild"),onRefresh:()=>ea("refresh"),onRepair:()=>ea("repair"),onDelete:()=>ea("delete"),t:P})]}),null!==L?(0,n.jsx)(H,{kind:L.kind,capsuleDisplayName:d,nameInput:L.nameInput,busy:F,error:q,progress:Z,onNameChange:function(e){M(l=>null!==l?{...l,nameInput:e}:null);},onConfirm:function(){var e;if(null===L||F)return;let{kind:l}=L;en(l,(e={deleteCapsuleImpl:w,refreshCapsuleImpl:k,reembedCapsuleImpl:D,rebuildCapsuleImpl:I,repairCapsuleImpl:C},"delete"===l?()=>e.deleteCapsuleImpl(s):"refresh"===l?()=>e.refreshCapsuleImpl(s):"reembed"===l?()=>e.reembedCapsuleImpl(s):"rebuild"===l?()=>e.rebuildCapsuleImpl(s):()=>e.repairCapsuleImpl(s)));},onCancel:function(){F||(M(null),B(null),ee(null));}}):null,null!==U?(0,n.jsx)(J,{affectedCapsuleSetCount:null!=(o=null==(i=U.affectedCapsuleSetIds)?void 0:i.length)?o:0,onContinue:function(){null===U||($(null),void 0!==h?h(U):m());}}):null]});}],30558);},10985,e=>{"use strict";var l=e.i(10582),t=e.i(87032),a=e.i(61774);function n(e){let{indexing:t,t:a}=e;return null===t||0===t.failedDocuments&&0===t.skippedDocuments?null:(0,l.jsx)("p",{children:a("manualPod.progress.gaps",{failed:String(t.failedDocuments),skipped:String(t.skippedDocuments)})});}function o(e){let{remediations:t,t:a}=e;return 0===t.length?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"lkd-action-progress-note",children:a("manualPod.progress.gapsTitle")}),(0,l.jsx)("ul",{className:"lkd-stale-reasons",children:t.map(e=>(0,l.jsx)("li",{children:e.guidance},e.reason))})]});}e.s(["ManualPodProgressView",0,function(e){let{job:t,t:a,labelKeys:i}=e;return(0,l.jsxs)("div",{className:"lkd-action-progress",role:"status","aria-live":"polite",children:[(0,l.jsx)("p",{children:a("running"===t.state?i.running:"succeeded"===t.state?i.succeeded:"partial"===t.state?i.partial:i.failed)}),(0,l.jsx)("p",{children:a("manualPod.progress.crawl",{accepted:String(t.crawl.accepted),denied:String(t.crawl.deniedCount)})}),null!==t.indexing?(0,l.jsx)("p",{children:a("manualPod.progress.index",{processed:String(t.indexing.processedDocuments),total:String(t.indexing.totalDocuments)})}):null,(0,l.jsx)(n,{indexing:t.indexing,t:a}),"running"===t.state?null:(0,l.jsx)(o,{remediations:t.remediations,t:a})]});},"useManualPodJobPolling",0,function(e){let{pollJobId:l,getJob:n,onJob:o,onError:i,onComplete:s,intervalMs:d}=e;(0,t.useEffect)(()=>{let e;if(void 0===l)return;let t=!1,c=()=>{n(l).then(l=>{t||(o(l),"running"===l.state?e=window.setTimeout(c,d):null==s||s());}).catch(e=>{t||i((0,a.formatError)(e));});};return e=window.setTimeout(c,d),()=>{t=!0,window.clearTimeout(e);};},[l,n,o,i,s,d]);}]);},80010,e=>{"use strict";var l=e.i(10582),t=e.i(87032),a=e.i(86796),n=e.i(24744),o=e.i(7340),i=e.i(61593),s=e.i(83449),d=e.i(10644),c=e.i(5909),r=e.i(96688),u=e.i(69128),p=e.i(30558),m=e.i(50850),g=e.i(61774),h=e.i(10985);let x={running:"manualPodRefresh.progress.running",succeeded:"manualPodRefresh.state.succeeded",partial:"manualPodRefresh.state.partial",failed:"manualPodRefresh.state.failed"};function b(e){var a,n,o;let s=(0,m.useTranslate)(),[d,c]=(0,t.useState)({kind:"idle"}),r=(0,t.useRef)(!1),u=null!=(a=e.startRefreshImpl)?a:i.startHtmlManualPodRefresh,p=null!=(n=e.getJobImpl)?n:i.getHtmlManualPodJob,b=(0,t.useCallback)(e=>c({kind:"active",job:e}),[]),f=(0,t.useCallback)(e=>c({kind:"error",message:e}),[]),w="active"===d.kind&&"running"===d.job.state?d.job.jobId:void 0;(0,h.useManualPodJobPolling)({pollJobId:w,getJob:p,onJob:b,onError:f,onComplete:e.onRefreshComplete,intervalMs:null!=(o=e.pollIntervalMs)?o:1500});let k=(0,t.useCallback)(()=>{r.current||(r.current=!0,u(e.capsuleId,e.sourceId).then(e=>c({kind:"active",job:e})).catch(e=>c({kind:"error",message:(0,g.formatError)(e)})).finally(()=>{r.current=!1;}));},[u,e.capsuleId,e.sourceId]);return"active"===d.kind?(0,l.jsx)(h.ManualPodProgressView,{job:d.job,t:s,labelKeys:x}):(0,l.jsxs)("div",{className:"lkd-manual-refresh-trigger",children:["error"===d.kind?(0,l.jsx)("p",{className:"lk-alert",role:"alert",children:d.message}):null,"confirm"===d.kind?(0,l.jsx)(v,{t:s,onConfirm:k,onCancel:()=>c({kind:"idle"})}):(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:()=>c({kind:"confirm"}),children:s("manualPodRefresh.button")})]});}function v(e){let{t,onConfirm:a,onCancel:n}=e;return(0,l.jsxs)("div",{className:"lkd-manual-refresh-confirm",children:[(0,l.jsx)("span",{children:t("manualPodRefresh.confirm.body")}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:n,children:t("manualPodRefresh.confirm.cancel")}),(0,l.jsx)("button",{type:"button",className:"lk-btn",onClick:a,children:t("manualPodRefresh.confirm.confirm")})]});}function f(e){let{name:a,description:n,busy:o,error:i,nameInputRef:s,onNameChange:c,onDescriptionChange:r,onCancel:u,onSubmit:p}=e,m=(0,d.useLocalKnowledgeTranslate)(),g=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let e=e=>{if("Escape"!==e.key||o)return;let l=g.current;(null==l?void 0:l.contains(document.activeElement))===!0&&u();};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e);};},[o,u]),(0,l.jsxs)("form",{className:"lkd-rename-form","aria-label":m("localKnowledge.detail.rename.formLabel"),onSubmit:p,ref:g,children:[(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-rename-name",className:"dlg-label",children:m("localKnowledge.detail.rename.displayName")}),(0,l.jsx)("input",{id:"lkd-rename-name",type:"text",className:"dlg-input",ref:s,value:a,disabled:o,autoComplete:"off",onChange:e=>c(e.target.value)})]}),(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-rename-desc",className:"dlg-label",children:m("localKnowledge.detail.rename.description")}),(0,l.jsx)("input",{id:"lkd-rename-desc",type:"text",className:"dlg-input",value:n,disabled:o,autoComplete:"off",onChange:e=>r(e.target.value)})]}),null!==i?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:i}):null,(0,l.jsxs)("div",{className:"lkd-rename-actions",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:o,onClick:u,children:m("common.cancel")}),(0,l.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:o,"aria-busy":o,children:m(o?"common.saving":"common.save")})]})]});}function w(e){let{capsuleId:a,displayName:n,description:o,onRenamed:s,renameImpl:c=i.renameCapsule}=e,r=(0,d.useLocalKnowledgeTranslate)(),[u,p]=(0,t.useState)(!1),[m,h]=(0,t.useState)(n),[x,b]=(0,t.useState)(null!=o?o:""),[v,w]=(0,t.useState)(!1),[k,j]=(0,t.useState)(null),K=(0,t.useRef)(null),y=(0,t.useRef)(null),N=(0,t.useRef)(!1);async function C(e){let l,t;e.preventDefault();let i=m.trim();if(0===i.length)return void j(r("localKnowledge.detail.rename.nameRequired"));let d=(l={},i!==n&&(l.displayName=i),((t=x.trim())!==(null!=o?o:"")&&(l.description=t),void 0===l.displayName&&void 0===l.description)?null:l);if(null===d)return void p(!1);w(!0),j(null);try{await c(a,d),p(!1),s();}catch(e){j((0,g.formatError)(e,r));}finally{w(!1);}}return(0,t.useEffect)(()=>{var e,l;u?null==(e=K.current)||e.focus():N.current&&(null==(l=y.current)||l.focus()),N.current=u;},[u]),u?(0,l.jsx)(f,{name:m,description:x,busy:v,error:k,nameInputRef:K,onNameChange:h,onDescriptionChange:b,onCancel:function(){v||(p(!1),j(null));},onSubmit:e=>void C(e)}):(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":r("localKnowledge.detail.rename.buttonFor",{name:n}),ref:y,onClick:function(){h(n),b(null!=o?o:""),j(null),p(!0);},children:r("localKnowledge.detail.rename.button")});}var k=e.i(48268),j=e.i(64533);function K(e){var a,n;let{capsuleId:o,source:s,onRebound:c,rebindImpl:r=i.rebindCapsuleSourceRoot}=e,u=(0,d.useLocalKnowledgeTranslate)(),p=(0,t.useId)(),m="repository"===(a=s.scope).kind?a.repositoryRoot:a.rootPath,[h,x]=(0,t.useState)(!1),[b,v]=(0,t.useState)(m),[f,w]=(0,t.useState)(!1),[K,y]=(0,t.useState)(null),N=(0,t.useId)(),C=(0,k.useNativeFileDialogCapability)(),S=b.trim();async function _(){if(0!==S.length&&!f){w(!0),y(null);try{await r(o,s.sourceId,S),x(!1),c();}catch(e){y((0,g.formatError)(e,u));}finally{w(!1);}}}return(0,l.jsx)("div",{className:"lkd-source-rebind",children:h?(0,l.jsxs)("div",{className:"lkd-rebind-form",children:[(0,l.jsx)("label",{htmlFor:p,className:"dlg-label",title:u("localKnowledge.detail.help.rebind"),children:(n=s.scope,"repository"===n.kind?u("localKnowledge.detail.rebind.repositoryRoot"):"files"===n.kind?u("localKnowledge.detail.rebind.sharedRoot"):u("localKnowledge.detail.rebind.folderRoot"))}),(0,l.jsxs)("div",{className:"lkd-connect-path-group",children:[(0,l.jsx)("input",{id:p,type:"text",className:"dlg-input lkd-connect-input",value:b,disabled:f,autoComplete:"off",onChange:e=>v(e.target.value),onKeyDown:e=>{"Enter"===e.key&&_();}}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:f||!C,"aria-describedby":C?void 0:N,onClick:function(){(0,j.pickWithNativeDialog)({mode:"open-directory",title:u("localKnowledge.detail.rebind.chooseRoot"),...(S.length>0?{defaultPath:S}:{})}).then(e=>{if("picked"===e.kind&&void 0!==e.paths[0]){v(e.paths[0]),y(null);return;}"busy"===e.kind&&y(u("localKnowledge.nativeDialog.busy")),"unsupported"===e.kind&&y(u("localKnowledge.nativeDialog.unavailable")),"error"===e.kind&&y(e.message);});},children:u("common.browse")})]}),C?null:(0,l.jsx)("span",{id:N,className:"dlg-note",children:u("localKnowledge.nativeDialog.unavailable")}),(0,l.jsxs)("div",{className:"lkd-rebind-actions",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:f,onClick:function(){f||(x(!1),y(null));},children:u("common.cancel")}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:f||0===S.length,"aria-busy":f,onClick:()=>void _(),children:f?u("localKnowledge.detail.rebind.saving"):u("localKnowledge.detail.rebind.save")})]}),null!==K?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:K}):null]}):(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",title:u("localKnowledge.detail.help.rebind"),onClick:function(){v(m),y(null),x(!0);},children:u("localKnowledge.detail.rebind.button")})});}var y=e.i(94891),N=e.i(80814),C=e.i(60865);function S(e){return new Date(e).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"});}function _(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%";}function E(e){return e.indexingJobs[0];}function D(e){return{width:_(e)};}function I(e){return`${e.provider} / ${e.modelId} (${e.vectorDimensions.toString()}d, ${e.vectorMetric})`;}function T(e){var l,t;return null!=(l=null==(t=e.health.embeddingCompatibility)?void 0:t.status)?l:e.health.vectorCompatible?"compatible":"incompatible";}function R(e,l){return l("compatible"===e?"localKnowledge.detail.compatibility.compatible":"unknown"===e?"localKnowledge.detail.compatibility.unknown":"localKnowledge.detail.compatibility.incompatible");}function P(e){return"ready"===e?"ok":"unavailable"===e?"danger":"rebuild-required"===e||"degraded"===e?"warn":"neutral";}function A(e,l){return l("ready"===e?"localKnowledge.detail.context.status.ready":"rebuild-required"===e?"localKnowledge.detail.context.status.rebuild":"degraded"===e?"localKnowledge.detail.context.status.degraded":"unavailable"===e?"localKnowledge.detail.context.status.unavailable":"localKnowledge.detail.context.status.disabled");}function L(e){let{children:t,help:a}=e;return(0,l.jsx)("h2",{className:"lk-section-head",children:void 0===a?t:(0,l.jsx)(N.Explainable,{description:a,children:t})});}function M(e){let[l,a]=(0,t.useState)(!1);return{visibleCount:l?e:Math.min(25,e),showAll:l,setShowAll:a};}function F(e){let{hiddenCount:t,showAll:a,onToggle:n,noun:o,t:i}=e;return!a&&t<=0?null:(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:n,children:a?i("localKnowledge.detail.rows.showFewer",{noun:o}):i("localKnowledge.detail.rows.showMore",{count:t,noun:o})});}function O(e){let{label:t,value:a,meta:n,help:o,tone:i="neutral"}=e,s=(0,l.jsxs)("div",{className:"lkd-metric-card","data-tone":i,children:[(0,l.jsx)("span",{className:"lkd-metric-label",children:t}),(0,l.jsx)("strong",{className:"lkd-metric-value",children:a}),(0,l.jsx)("span",{className:"lkd-metric-meta",children:n})]});return void 0===o?s:(0,l.jsx)(N.Explainable,{as:"div",block:!0,description:o,children:s});}function q(e){let{value:t,label:a,tone:n="ok"}=e;return(0,l.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${a}: ${_(t)}`,children:(0,l.jsx)("span",{className:"lkd-progress-fill","data-tone":n,style:D(t)})});}function B(e){let{label:t,value:a,help:n,tone:o="ok"}=e;return(0,l.jsx)(N.Explainable,{as:"div",block:!0,description:n,children:(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:t}),(0,l.jsx)(q,{value:a,label:t,tone:o}),(0,l.jsx)("span",{children:_(a)})]})});}function X(e){return e>0?"danger":"ok";}function U(e){var t,a;let n,{data:o}=e,i=(0,d.useLocalKnowledgeTranslate)(),c=E(o),r=null!=(t=null==c?void 0:c.totalDocuments)?t:o.health.documentCount,u=void 0===c?0:c.processedDocuments+c.failedDocuments+c.skippedDocuments,p=Math.max(0,o.health.documentCount-o.health.failedDocuments-o.health.skippedDocuments),m=r<=0?0:u/r,g=o.health.chunkCount<=0?0:o.health.vectorCount/o.health.chunkCount,h=Math.max(0,o.health.chunkCount-o.health.vectorCount),x=function(e,l,t,a){var n;if((null==e?void 0:e.status)==="running"&&l>0&&t>0){let n,o;return a("localKnowledge.detail.index.eta",{duration:(0,s.formatDurationCompact)((n=void 0===e?0:Math.max(Date.now()-e.startedAt,1),(o=t>0?t/n:0)<=0?0:Math.max(0,l-t)/o))});}return void 0===e?a("localKnowledge.detail.index.noJobRecorded"):(0,s.formatDurationCompact)((null!=(n=e.finishedAt)?n:Date.now())-e.startedAt);}(c,r,u,i),b=h<=0&&o.health.failedDocuments<=0?"ok":(null==c?void 0:c.lastError)!==void 0?"danger":"warn";return(0,l.jsxs)("section",{"aria-labelledby":"lkd-index-status-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(L,{help:i("localKnowledge.detail.help.indexStatus"),children:(0,l.jsx)("span",{id:"lkd-index-status-heading",children:i("localKnowledge.detail.index.title")})}),(0,l.jsx)("span",{className:"lkd-live-note","aria-live":"polite",children:i((null==c?void 0:c.status)==="running"?"localKnowledge.detail.index.updating":"localKnowledge.detail.index.latestRun")})]}),(0,l.jsxs)("div",{className:"lkd-metric-grid",children:[(0,l.jsx)(O,{label:i("localKnowledge.detail.index.indexedDocuments"),help:i("localKnowledge.detail.help.indexedDocuments"),value:`${p.toString()} / ${o.health.documentCount.toString()}`,meta:i("localKnowledge.detail.index.failedSkipped",{failed:o.health.failedDocuments,skipped:o.health.skippedDocuments}),tone:o.health.failedDocuments>0?"danger":o.health.skippedDocuments>0?"warn":"ok"}),(0,l.jsx)(O,{label:i("localKnowledge.detail.index.vectors"),help:i("localKnowledge.detail.help.vectors"),value:`${o.health.vectorCount.toString()} / ${o.health.chunkCount.toString()}`,meta:h>0?i("localKnowledge.detail.index.chunksMissingVectors",{count:h}):i("localKnowledge.detail.index.allChunksEmbedded"),tone:X(h)}),(0,l.jsx)(O,{label:i("localKnowledge.detail.index.latestJob"),help:i("localKnowledge.detail.help.latestJob"),value:void 0===c?i("localKnowledge.detail.index.notIndexed"):ea(c.status,i),meta:x,tone:(null==c?void 0:c.status)==="failed"?"danger":(null==c?void 0:c.status)==="running"?"warn":"neutral"})]}),(0,l.jsxs)("div",{className:"lkd-status-bars",children:[(0,l.jsx)(B,{label:i("localKnowledge.detail.index.discoveryProgress"),value:m,help:i("localKnowledge.detail.help.discoveryProgress")}),(0,l.jsx)(B,{label:i("localKnowledge.detail.index.retrievalCoverage"),value:g,help:i("localKnowledge.detail.help.retrievalCoverage"),tone:X(h)})]}),(0,l.jsx)(N.Explainable,{as:"div",block:!0,description:i("localKnowledge.detail.help.indexMessage"),children:(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":b,children:(n=o.health.chunkCount-o.health.vectorCount,(null==c||null==(a=c.lastError)?void 0:a.code)==="EMBEDDING_ADAPTER_FAILED"?i("localKnowledge.detail.index.embeddingStopped",{message:c.lastError.message,count:n}):n>0?i("localKnowledge.detail.index.missingVectors",{count:n}):o.health.unsupportedDocuments>0?i("localKnowledge.detail.index.unsupportedDocuments",{count:o.health.unsupportedDocuments}):i("localKnowledge.detail.index.aligned"))})})]});}function $(e){var t,a,n,o,i;let{data:s}=e,c=(0,d.useLocalKnowledgeTranslate)(),r=s.health.embeddingCompatibility,u=T(s),p="compatible"===u?"ok":"unknown"===u?"warn":"danger",m=void 0===r?I(s.health.embeddingIdentity):`${r.pinnedModelId} (${r.pinnedVectorDimensions.toString()}d, ${r.pinnedVectorMetric})`,g=null!=(t=null==r?void 0:r.pinnedProvider)?t:s.health.embeddingIdentity.provider,h=null!=(a=null==r?void 0:r.currentModelId)?a:c("localKnowledge.detail.compatibility.notConfigured"),x=null!=(n=null==r?void 0:r.currentProvider)?n:c("localKnowledge.detail.compatibility.noProvider"),b=null!=(o=null==r?void 0:r.message)?o:c(s.health.vectorCompatible?"localKnowledge.detail.compatibility.readyMessage":"localKnowledge.detail.compatibility.fixGatewayMessage");return(0,l.jsxs)("section",{"aria-labelledby":"lkd-embedding-compat-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(L,{help:c("localKnowledge.detail.help.embeddingSection"),children:(0,l.jsx)("span",{id:"lkd-embedding-compat-heading",children:c("localKnowledge.detail.compatibility.title")})}),(0,l.jsx)("span",{className:"lkd-live-note",children:R(u,c)})]}),(0,l.jsxs)("div",{className:"lkd-metric-grid",children:[(0,l.jsx)(O,{label:c("localKnowledge.detail.compatibility.pinnedModel"),help:c("localKnowledge.detail.help.pinnedModel"),value:m,meta:g}),(0,l.jsx)(O,{label:c("localKnowledge.detail.compatibility.currentModel"),help:c("localKnowledge.detail.help.currentModel"),value:h,meta:x}),(0,l.jsx)(O,{label:c("localKnowledge.detail.compatibility.metric"),help:c("localKnowledge.detail.help.compatibility"),value:R(u,c),meta:null!=(i=null==r?void 0:r.reason)?i:c("localKnowledge.detail.compatibility.legacyHealth"),tone:p})]}),(0,l.jsx)(N.Explainable,{as:"div",block:!0,description:c("localKnowledge.detail.help.embeddingMessage"),children:(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":p,children:b})})]});}function z(e){let{label:t,value:a,help:n}=e;return(0,l.jsxs)("div",{className:"lkd-row",children:[(0,l.jsx)("dt",{className:"lkd-label",children:void 0===n?t:(0,l.jsx)(N.Explainable,{description:n,children:t})}),(0,l.jsx)("dd",{className:"lkd-value",children:a})]});}function G(e){let{data:t}=e,a=(0,d.useLocalKnowledgeTranslate)(),{capsule:n,health:o}=t,i=n.embeddingModelIdentity,c=T(t);return(0,l.jsxs)("section",{"aria-labelledby":"lkd-overview-heading",children:[(0,l.jsx)(L,{help:a("localKnowledge.detail.help.overview"),children:(0,l.jsx)("span",{id:"lkd-overview-heading",children:a("localKnowledge.detail.overview.title")})}),(0,l.jsxs)("dl",{className:"lkd-dl",children:[(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.name"),value:n.displayName}),void 0!==n.description?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.description"),value:n.description}):null,n.tags.length>0?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.tags"),value:(0,l.jsx)("ul",{className:"lkd-tags","aria-label":a("localKnowledge.detail.overview.tags"),children:n.tags.map(e=>(0,l.jsx)("li",{className:"lkd-tag",children:e},e))})}):null,(0,l.jsx)(z,{label:a("common.status"),help:a("localKnowledge.detail.help.overviewStatus"),value:(0,l.jsx)("output",{className:"lk-badge","data-state":n.lifecycleState,"aria-label":a("localKnowledge.detail.overview.statusAria",{status:r.STATUS_LABELS[n.lifecycleState]}),children:r.STATUS_LABELS[n.lifecycleState]})}),(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.embeddingModel"),help:a("localKnowledge.detail.help.overviewEmbeddingModel"),value:I(i)}),(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.storageSize"),help:a("localKnowledge.detail.help.overviewStorage"),value:(0,s.formatBytes)(o.storageSizeBytes)}),(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.unsupportedDocuments"),help:a("localKnowledge.detail.help.overviewUnsupported"),value:o.unsupportedDocuments.toString()}),void 0!==o.lastIndexedAt?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.lastIndexed"),help:a("localKnowledge.detail.help.overviewLastIndexed"),value:S(o.lastIndexedAt)}):null,(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.vectorCompatible"),help:a("localKnowledge.detail.help.overviewVectorCompatible"),value:"compatible"===c?a("localKnowledge.detail.compatibility.compatible"):"unknown"===c?a("localKnowledge.detail.overview.vectorUnknown"):a("localKnowledge.detail.overview.vectorIncompatible")}),o.staleReasons.length>0?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.staleReasons"),help:a("localKnowledge.detail.help.overviewStaleReasons"),value:(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":a("localKnowledge.detail.overview.staleReasons"),children:o.staleReasons.map(e=>(0,l.jsx)("li",{children:e},e))})}):null,o.unsupportedGuidanceCodes.length>0?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.nextSteps"),help:a("localKnowledge.detail.help.overviewNextSteps"),value:(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":a("localKnowledge.detail.overview.unsupportedGuidance"),children:o.unsupportedGuidanceCodes.map(e=>(0,l.jsx)("li",{children:(0,d.unsupportedGuidanceText)(e,a)},e))})}):null]})]});}function V(e){let l=e.trim();if(0===l.length)return;let t=Number.parseInt(l,10);return Number.isSafeInteger(t)&&t>0?t:void 0;}function H(e){return void 0===e?"":e.toString();}function J(e){let{message:t,tone:a,live:n}=e;return n?(0,l.jsx)("output",{className:"lkd-status-callout",style:C.NATIVE_BLOCK_STYLE,"data-tone":a,children:t}):(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":a,children:t});}function Y(e){var a,n,o,s;let{data:c,onSaved:r,updateImpl:u=i.updateCapsuleContextualRetrieval}=e,p=(0,d.useLocalKnowledgeTranslate)(),m=c.capsule.contextualRetrieval,g=c.health.contextualRetrieval,[h,x]=(0,t.useState)(null!=(a=null==m?void 0:m.enabled)&&a),[b,v]=(0,t.useState)(null!=(n=null==m?void 0:m.modelId)?n:""),[f,w]=(0,t.useState)(null!=(o=null==m?void 0:m.strict)&&o),[k,j]=(0,t.useState)(H(null==m?void 0:m.maxContextChars)),[K,y]=(0,t.useState)(H(null==m?void 0:m.documentContextMaxChars)),[S,_]=(0,t.useState)(!1),[E,D]=(0,t.useState)(null),[I,T]=(0,t.useState)(null);async function R(){let e=V(k),l=V(K),t={enabled:h,...(b.trim().length>0?{modelId:b.trim()}:{}),strict:f,...(void 0!==e?{maxContextChars:e}:{}),...(void 0!==l?{documentContextMaxChars:l}:{})};_(!0),D(null),T(null);try{let e=await u(c.capsule.id,t);r(e),D(p("localKnowledge.detail.context.saved"));}catch(e){T(e instanceof Error?e.message:p("localKnowledge.detail.context.saveFailed"));}finally{_(!1);}}return(0,t.useEffect)(()=>{var e,l,t;x(null!=(e=null==m?void 0:m.enabled)&&e),v(null!=(l=null==m?void 0:m.modelId)?l:""),w(null!=(t=null==m?void 0:m.strict)&&t),j(H(null==m?void 0:m.maxContextChars)),y(H(null==m?void 0:m.documentContextMaxChars));},[m]),(0,l.jsxs)("section",{"aria-labelledby":"lkd-contextual-retrieval-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(L,{help:p("localKnowledge.detail.help.contextualRetrieval"),children:(0,l.jsx)("span",{id:"lkd-contextual-retrieval-heading",children:p("localKnowledge.detail.context.title")})}),(0,l.jsx)("span",{className:"lkd-live-note",children:A(null==g?void 0:g.status,p)})]}),(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":P(null==g?void 0:g.status),children:p("localKnowledge.detail.context.description")}),void 0!==g?(0,l.jsxs)("div",{className:"lkd-metric-grid",children:[(0,l.jsx)(O,{label:p("localKnowledge.detail.context.retrievalContext"),help:p("localKnowledge.detail.help.contextStatus"),value:A(g.status,p),meta:p("localKnowledge.detail.context.settingsSource",{source:g.source}),tone:P(g.status)}),(0,l.jsx)(O,{label:p("localKnowledge.detail.context.model"),help:p("localKnowledge.detail.help.contextModel"),value:null!=(s=g.modelId)?s:p("localKnowledge.detail.context.gatewayDefault"),meta:g.strict?p("localKnowledge.detail.context.strict"):p("localKnowledge.detail.context.nonStrict")}),(0,l.jsx)(O,{label:p("localKnowledge.detail.context.staleChunks"),help:p("localKnowledge.detail.help.contextStale"),value:g.staleChunkCount.toString(),meta:p("localKnowledge.detail.context.degradedChunks",{count:g.degradedChunkCount}),tone:g.rebuildRequired||g.degradedChunkCount>0?"warn":"ok"})]}):null,(null==g?void 0:g.message)!==void 0?(0,l.jsx)(J,{message:g.message,tone:P(g.status),live:g.rebuildRequired}):null,(0,l.jsx)("div",{className:"lkd-connect-row",children:(0,l.jsxs)("label",{className:"dlg-label",htmlFor:"lkd-context-enabled",title:p("localKnowledge.detail.help.contextEnable"),children:[(0,l.jsx)("input",{id:"lkd-context-enabled",type:"checkbox",checked:h,disabled:S,onChange:e=>x(e.target.checked)})," ",p("localKnowledge.detail.context.generateAtIndex")]})}),(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-context-model",className:"dlg-label",children:(0,l.jsx)(N.Explainable,{description:p("localKnowledge.detail.help.contextModelInput"),children:p("localKnowledge.detail.context.modelId")})}),(0,l.jsx)("input",{id:"lkd-context-model",type:"text",className:"dlg-input lkd-connect-input",value:b,disabled:S||!h,placeholder:p("localKnowledge.detail.context.defaultModelPlaceholder"),onChange:e=>v(e.target.value)})]}),(0,l.jsx)("div",{className:"lkd-connect-row",children:(0,l.jsxs)("label",{className:"dlg-label",htmlFor:"lkd-context-strict",title:p("localKnowledge.detail.help.contextStrict"),children:[(0,l.jsx)("input",{id:"lkd-context-strict",type:"checkbox",checked:f,disabled:S||!h,onChange:e=>w(e.target.checked)})," ",p("localKnowledge.detail.context.failOnError")]})}),(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-context-max",className:"dlg-label",children:(0,l.jsx)(N.Explainable,{description:p("localKnowledge.detail.help.contextGeneratedLimit"),children:p("localKnowledge.detail.context.generatedLimit")})}),(0,l.jsx)("input",{id:"lkd-context-max",type:"number",min:1,className:"dlg-input lkd-connect-input",value:k,disabled:S||!h,placeholder:"480",onChange:e=>j(e.target.value)})]}),(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-document-context-max",className:"dlg-label",children:(0,l.jsx)(N.Explainable,{description:p("localKnowledge.detail.help.contextDocumentLimit"),children:p("localKnowledge.detail.context.documentLimit")})}),(0,l.jsx)("input",{id:"lkd-document-context-max",type:"number",min:1,className:"dlg-input lkd-connect-input",value:K,disabled:S||!h,placeholder:"12000",onChange:e=>y(e.target.value)})]}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:S,"aria-busy":S,title:p("localKnowledge.detail.help.contextSave"),onClick:()=>void R(),children:S?p("common.saving"):p("localKnowledge.detail.context.save")}),null!==E?(0,l.jsx)("output",{className:"lkd-status-callout",style:C.NATIVE_BLOCK_STYLE,"data-tone":"warn",children:E}):null,null!==I?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:I}):null]});}function W(e){let{capsuleId:t,sources:a,onActionComplete:n}=e,o=(0,d.useLocalKnowledgeTranslate)();return 0===a.length?(0,l.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,l.jsx)(L,{help:o("localKnowledge.detail.help.sources"),children:(0,l.jsx)("span",{id:"lkd-sources-heading",children:o("localKnowledge.detail.sources.title")})}),(0,l.jsx)("p",{className:"lkd-empty-note",children:o("localKnowledge.detail.sources.empty")})]}):(0,l.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,l.jsx)(L,{help:o("localKnowledge.detail.help.sources"),children:(0,l.jsx)("span",{id:"lkd-sources-heading",children:o("localKnowledge.detail.sources.title")})}),(0,l.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":o("localKnowledge.detail.sources.list"),children:a.map(e=>{var a;let i=e.indexedCount+e.failedCount+e.skippedCount,s=(a=e.scope,"folder"===a.kind?a.rootPath:"repository"===a.kind?a.repositoryRoot:o(1===a.files.length?"localKnowledge.detail.sources.selectedFiles.one":"localKnowledge.detail.sources.selectedFiles.many",{root:a.rootPath,count:a.files.length}));return(0,l.jsxs)("li",{className:"lkd-source-card",title:o("localKnowledge.detail.help.sourceCard"),children:[(0,l.jsxs)("div",{className:"lkd-source-card-head",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"lkd-source-name",title:e.displayName,children:e.displayName}),(0,l.jsx)("div",{className:"lkd-source-path",title:s,children:s})]}),(0,l.jsxs)("div",{className:"lkd-source-card-actions",children:[(0,l.jsx)("span",{className:"lkd-source-scope",children:e.scope.kind}),(0,l.jsx)(K,{capsuleId:t,source:e,onRebound:n})]})]}),(0,l.jsxs)("div",{className:"lkd-source-coverage",role:"img",title:o("localKnowledge.detail.help.sourceCoverage"),"aria-label":o("localKnowledge.detail.sources.coverage",{indexed:e.indexedCount,failed:e.failedCount,skipped:e.skippedCount}),children:[(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-ok",style:D(i>0?e.indexedCount/i:0)}),(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-fail",style:D(i>0?e.failedCount/i:0)}),(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-skip",style:D(i>0?e.skippedCount/i:0)})]}),(0,l.jsxs)("div",{className:"lkd-source-counts","aria-label":o("localKnowledge.detail.documentCounts"),children:[(0,l.jsx)("span",{className:"lkd-count lkd-count-ok",children:o("localKnowledge.detail.counts.indexed",{count:e.indexedCount})}),(0,l.jsx)("span",{className:"lkd-count lkd-count-fail",children:o("localKnowledge.detail.counts.failed",{count:e.failedCount})}),(0,l.jsx)("span",{className:"lkd-count lkd-count-skip",children:o("localKnowledge.detail.counts.skipped",{count:e.skippedCount})})]})]},e.sourceId);})})]});}function Q(){let e=(0,d.useLocalKnowledgeTranslate)();return(0,l.jsxs)("section",{"aria-labelledby":"lkd-privacy-heading",children:[(0,l.jsx)(L,{help:e("localKnowledge.detail.help.privacy"),children:(0,l.jsx)("span",{id:"lkd-privacy-heading",children:e("localKnowledge.detail.privacy.title")})}),(0,l.jsxs)("ul",{className:"lkd-list","aria-label":e("localKnowledge.detail.privacy.details"),children:[(0,l.jsx)("li",{className:"lkd-source-row",children:e("localKnowledge.detail.privacy.localState")}),(0,l.jsx)("li",{className:"lkd-source-row",children:e("localKnowledge.detail.privacy.modelGateway")}),(0,l.jsx)("li",{className:"lkd-source-row",children:e("localKnowledge.detail.privacy.deletion")})]})]});}function Z(e,l){return l("info"===e?"localKnowledge.detail.diagnostics.severity.info":"warning"===e?"localKnowledge.detail.diagnostics.severity.warning":"localKnowledge.detail.diagnostics.severity.error");}function ee(e){let{group:t,t:a}=e,n=Z(t.severity,a);return(0,l.jsxs)("li",{className:"lkd-diag-group","data-severity":t.severity,title:a("localKnowledge.detail.help.diagnosticRow"),"aria-label":a("localKnowledge.detail.diagnostics.groupAria",{severity:n,code:t.code,count:t.count}),children:[(0,l.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:n}),(0,l.jsxs)("span",{className:"lkd-diag-group-count",children:[t.count.toString(),"x"]}),(0,l.jsx)("span",{className:"lkd-diag-code",children:t.code}),(0,l.jsx)("span",{className:"lkd-diag-message",children:t.message})]});}function el(e){let{diag:t,t:a}=e,n=Z(t.severity,a);return(0,l.jsxs)("li",{className:"lkd-diag-row","data-severity":t.severity,title:a("localKnowledge.detail.help.diagnosticRow"),"aria-label":a("localKnowledge.detail.diagnostics.rowAria",{severity:n,code:t.code}),children:[(0,l.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:n}),(0,l.jsx)("span",{className:"lkd-diag-code",children:t.code}),(0,l.jsx)("span",{className:"lkd-diag-message",children:t.message}),void 0!==t.pageNumber?(0,l.jsxs)("span",{className:"lkd-diag-page",children:["p.",t.pageNumber.toString()]}):null]});}function et(e){let{diagnostics:t}=e,a=(0,d.useLocalKnowledgeTranslate)(),{visibleCount:n,showAll:o,setShowAll:i}=M(t.length),s=t.slice(0,n),c=t.length-s.length,r=function(e){let l=new Map();for(let a of e){var t;let e=`${a.severity}\u0000${a.code}\u0000${a.message}`,n=l.get(e);l.set(e,{key:e,severity:a.severity,code:a.code,message:a.message,count:(null!=(t=null==n?void 0:n.count)?t:0)+1});}return[...l.values()].sort((e,l)=>l.count-e.count||e.code.localeCompare(l.code));}(t).slice(0,8);return(0,l.jsxs)("section",{"aria-labelledby":"lkd-diag-heading",children:[(0,l.jsx)(L,{help:a("localKnowledge.detail.help.diagnostics"),children:(0,l.jsx)("span",{id:"lkd-diag-heading",children:a("localKnowledge.detail.diagnostics.title")})}),0===t.length?(0,l.jsx)("p",{className:"lkd-empty-note","data-testid":"diag-empty",children:a("localKnowledge.detail.diagnostics.empty")}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("ul",{className:"lkd-list lkd-diag-group-list","aria-label":a("localKnowledge.detail.diagnostics.groupedList"),children:r.map(e=>(0,l.jsx)(ee,{group:e,t:a},e.key))}),(0,l.jsx)("ul",{className:"lkd-list lkd-diag-list","aria-label":a("localKnowledge.detail.diagnostics.list"),children:s.map((e,t)=>(0,l.jsx)(el,{diag:e,t:a},`${e.code}-${t.toString()}`))}),(0,l.jsx)(F,{hiddenCount:c,noun:a("localKnowledge.detail.rows.diagnostics"),showAll:o,onToggle:()=>i(!o),t:a})]})]});}function ea(e,l){return l("queued"===e?"localKnowledge.detail.jobs.status.queued":"running"===e?"localKnowledge.detail.jobs.status.running":"succeeded"===e?"localKnowledge.detail.jobs.status.succeeded":"failed"===e?"localKnowledge.detail.jobs.status.failed":"localKnowledge.detail.jobs.status.cancelled");}function en(e){let{epochMs:t}=e,a=(0,s.toSafeIsoString)(t);return(0,l.jsx)("time",{...(void 0===a?{}:{dateTime:a}),children:S(t)});}function eo(e){let{job:t,t:a}=e,n=void 0!==t.finishedAt?(0,s.formatDurationCompact)(t.finishedAt-t.startedAt):a("localKnowledge.detail.jobs.inProgress");return(0,l.jsxs)("li",{className:"lkd-job-row",title:a("localKnowledge.detail.help.jobRow"),"aria-label":a("localKnowledge.detail.jobs.rowAria",{id:t.id,status:ea(t.status,a)}),children:[(0,l.jsx)("span",{className:"lkd-job-status","data-status":t.status,children:ea(t.status,a)}),(0,l.jsxs)("span",{className:"lkd-job-dates",children:[(0,l.jsx)(en,{epochMs:t.startedAt}),void 0!==t.finishedAt?(0,l.jsxs)(l.Fragment,{children:[" — ",(0,l.jsx)(en,{epochMs:t.finishedAt})]}):null]}),(0,l.jsx)("span",{className:"lkd-job-duration",children:n}),(0,l.jsxs)("div",{className:"lkd-source-counts","aria-label":a("localKnowledge.detail.documentCounts"),children:[(0,l.jsx)("span",{className:"lkd-count lkd-count-ok",children:a("localKnowledge.detail.counts.processed",{count:t.processedDocuments})}),(0,l.jsx)("span",{className:"lkd-count lkd-count-fail",children:a("localKnowledge.detail.counts.failed",{count:t.failedDocuments})}),(0,l.jsx)("span",{className:"lkd-count lkd-count-skip",children:a("localKnowledge.detail.counts.skipped",{count:t.skippedDocuments})})]}),void 0!==t.lastError?(0,l.jsxs)("div",{className:"lkd-job-error",children:[(0,l.jsx)("span",{children:t.lastError.code}),(0,l.jsx)("span",{children:t.lastError.message})]}):null]});}function ei(e){let{jobs:t}=e,a=(0,d.useLocalKnowledgeTranslate)(),{visibleCount:n,showAll:o,setShowAll:i}=M(t.length),s=t.slice(0,n),c=t.length-s.length;return(0,l.jsxs)("section",{"aria-labelledby":"lkd-jobs-heading",children:[(0,l.jsx)(L,{help:a("localKnowledge.detail.help.jobs"),children:(0,l.jsx)("span",{id:"lkd-jobs-heading",children:a("localKnowledge.detail.jobs.title")})}),0===t.length?(0,l.jsx)("p",{className:"lkd-empty-note",children:a("localKnowledge.detail.jobs.empty")}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("ul",{className:"lkd-list","aria-label":a("localKnowledge.detail.jobs.list"),children:s.map(e=>(0,l.jsx)(eo,{job:e,t:a},e.id))}),(0,l.jsx)(F,{hiddenCount:c,noun:a("localKnowledge.detail.rows.jobs"),showAll:o,onToggle:()=>i(!o),t:a})]})]});}function es(e,l){return l("preflight"===e?"localKnowledge.detail.large.phase.preflight":"extracting"===e?"localKnowledge.detail.large.phase.extracting":"extracted"===e?"localKnowledge.detail.large.phase.extracted":"chunking"===e?"localKnowledge.detail.large.phase.chunking":"chunked"===e?"localKnowledge.detail.large.phase.chunked":"embedding"===e?"localKnowledge.detail.large.phase.embedding":"embedded"===e?"localKnowledge.detail.large.phase.embedded":"complete"===e?"localKnowledge.detail.large.phase.complete":"cancelled"===e?"localKnowledge.detail.large.phase.cancelled":"localKnowledge.detail.large.phase.failed");}function ed(e){let{capsuleId:a,recovery:n,onActionComplete:o,resumeImpl:s}=e,c=(0,d.useLocalKnowledgeTranslate)(),[r,u]=(0,t.useState)(!1),[p,m]=(0,t.useState)(null);async function g(){u(!0),m(null);try{await(null!=s?s:i.resumeCapsuleLargeDocuments)(a,n.jobId),o();}catch(e){m(e instanceof Error?e.message:c("localKnowledge.detail.recovery.failed"));}finally{u(!1);}}return(0,l.jsxs)("section",{className:"lkd-status-section","aria-labelledby":"lkd-indexing-recovery-heading",children:[(0,l.jsx)("h2",{id:"lkd-indexing-recovery-heading",children:c("localKnowledge.detail.recovery.title")}),(0,l.jsx)("p",{role:"status","aria-live":"polite",children:c(`localKnowledge.detail.recovery.${n.state}`,{sources:n.sourceCount,processed:n.processedDocuments})}),"resumable"===n.state?(0,l.jsx)("button",{type:"button",className:"lk-action-button",disabled:r,"aria-label":c("localKnowledge.detail.recovery.resumeAria"),onClick:()=>void g(),children:r?c("localKnowledge.detail.recovery.resuming"):c("localKnowledge.detail.recovery.resume")}):null,null!==p?(0,l.jsx)("div",{role:"alert",children:p}):null]});}function ec(e){var t;let{progress:a,t:n}=e;return(0,l.jsxs)("li",{className:"lkd-source-card",title:n("localKnowledge.detail.help.largeDocumentRow"),children:[(0,l.jsxs)("div",{className:"lkd-source-card-head",children:[(0,l.jsx)("div",{className:"lkd-source-name",title:a.safeDisplayName,children:a.safeDisplayName}),(0,l.jsx)("span",{className:"lkd-source-scope",children:es(a.phase,n)})]}),(0,l.jsxs)("div",{className:"lkd-metric-meta",children:[(0,l.jsx)("span",{"data-tone":"complete"===(t=a.coverage)?"ok":"none"===t?"danger":"warn",children:n("localKnowledge.detail.large.coverage",{coverage:a.coverage})})," · ",n("localKnowledge.detail.large.pages",{count:a.processedPages})," · ",n("localKnowledge.detail.large.chunksEmbedded",{embedded:a.embeddedChunkCount,chunks:a.chunkCount}),a.resumable?` \xb7 ${n("localKnowledge.detail.large.resumable")}`:""]})]});}function er(e){var a;let{capsuleId:o,health:s,onActionComplete:c,jobActive:r,resumeImpl:u}=e,p=(0,d.useLocalKnowledgeTranslate)(),[m,g]=(0,t.useState)(!1),[h,x]=(0,t.useState)(null);if(0===s.progress.length)return null;let b=s.progress.filter(e=>!(0,n.isTerminalExtractionPhase)(e.phase)).map(e=>es(e.phase,p));async function v(){g(!0),x(null);try{await(null!=u?u:i.resumeCapsuleLargeDocuments)(o),c();}catch(e){x(e instanceof Error?e.message:p("localKnowledge.detail.large.resumeFailed"));}finally{g(!1);}}return(0,l.jsxs)("section",{"aria-labelledby":"lkd-large-doc-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(L,{help:p("localKnowledge.detail.help.largeDocuments"),children:(0,l.jsx)("span",{id:"lkd-large-doc-heading",children:p("localKnowledge.detail.large.title")})}),(0,l.jsx)("span",{className:"lkd-live-note",role:"status","aria-live":"polite",children:b.length>0?p("localKnowledge.detail.large.inProgress",{phases:b.join(", ")}):p("localKnowledge.detail.large.idle")})]}),s.partialCoverageDocuments>0?(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":"warn",children:p(1===s.partialCoverageDocuments?"localKnowledge.detail.large.partialCoverage.one":"localKnowledge.detail.large.partialCoverage.many",{count:s.partialCoverageDocuments})}):null,(0,l.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":p("localKnowledge.detail.large.list"),children:s.progress.map(e=>(0,l.jsx)(ec,{progress:e,t:p},e.documentId))}),s.qualityWarnings.length>0?(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":p("localKnowledge.detail.large.qualityWarnings"),children:s.qualityWarnings.map(e=>(0,l.jsx)("li",{children:e},e))}):null,s.resumableDocuments.length>0?(0,l.jsx)("button",{type:"button",onClick:()=>{v();},disabled:m||r,"aria-label":p("localKnowledge.detail.large.resumeAria"),title:p("localKnowledge.detail.help.largeResume"),className:"lk-action-button",children:(a=s.resumableDocuments.length,m?p("localKnowledge.detail.large.resuming"):p(1===a?"localKnowledge.detail.large.resume.one":"localKnowledge.detail.large.resume.many",{count:a}))}):null,null!==h?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:h}):null]});}e.s(["CapsuleDetail",0,function(){var e,t,n,i,s,r,m,g;let h,{capsuleId:x,onDeleted:v,fetchDetailImpl:f,resumeImpl:k,updateContextualRetrievalImpl:j}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},K=(0,d.useLocalKnowledgeTranslate)(),C=(0,a.useSearchParams)(),S=(0,a.useRouter)(),_=null!=x?x:null!=(e=C.get("capsuleId"))?e:"",{data:D,loadStatus:I,loadError:T,reload:R,replaceData:P}=(0,u.useCapsuleDetail)(_,f),A=void 0===k?{}:{resumeImpl:k};return"loading"===I?(0,l.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:K("localKnowledge.detail.loading")}):"error"===I||null===D?""===_?(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[K("localKnowledge.detail.noSelection"),(0,l.jsx)(c.default,{href:"/local-knowledge",className:"lk-alert-retry",children:K("localKnowledge.detail.backToLocalKnowledge")})]}):(null==T?void 0:T.includes("NOT_FOUND"))===!0||(null==T?void 0:T.toLowerCase().includes("not found"))===!0?(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[K("localKnowledge.detail.notFound"),(0,l.jsx)(c.default,{href:"/local-knowledge",className:"lk-alert-retry",children:K("localKnowledge.overview.backToPods")})]}):(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[null!=T?T:K("localKnowledge.detail.loadFailed"),(0,l.jsx)("button",{type:"button",onClick:R,"aria-label":K("localKnowledge.detail.retryLoad"),className:"lk-alert-retry",children:K("common.retry")})]}):(0,l.jsxs)("div",{className:`lkd-content ${y.default.detailContent}`,children:[(0,l.jsxs)("header",{className:`lk-header ${y.default.podHeader}`,children:[(0,l.jsx)("h1",{className:`lk-title ${y.default.podTitle}`,children:D.capsule.displayName}),(0,l.jsx)(w,{capsuleId:_,displayName:D.capsule.displayName,...(void 0!==D.capsule.description?{description:D.capsule.description}:{}),onRenamed:R})]}),(0,l.jsx)(p.CapsuleActions,{capsuleId:_,capsuleDisplayName:D.capsule.displayName,sourceCount:D.sources.length,lifecycleState:D.capsule.lifecycleState,vectorCompatible:D.health.vectorCompatible,contextualRebuildRequired:null!=(t=null==(n=D.health.contextualRetrieval)?void 0:n.rebuildRequired)&&t,onActionComplete:R,onDeleted:function(e){void 0!==v?v(e):S.push("/local-knowledge");}}),(r=D.capsule.tags,m=D.sources,void 0===(h=void 0!==(0,o.parseHtmlManualSourceTagMetadata)(r)?null==(g=m[0])?void 0:g.sourceId:void 0)?null:(0,l.jsx)(b,{capsuleId:_,sourceId:h,onRefreshComplete:R})),(0,l.jsx)(U,{data:D}),void 0!==D.health.indexingRecovery?(0,l.jsx)(ed,{capsuleId:_,recovery:D.health.indexingRecovery,onActionComplete:R,...A}):null,(0,l.jsxs)("details",{className:y.default.advancedDisclosure,children:[(0,l.jsxs)("summary",{className:y.default.disclosureSummary,children:[(0,l.jsx)("span",{children:(0,l.jsx)(N.Explainable,{description:K("localKnowledge.detail.help.advanced"),children:K("localKnowledge.detail.advanced.summary")})}),(0,l.jsx)("span",{children:K("localKnowledge.detail.advanced.hint")}),(0,l.jsx)("span",{className:y.default.disclosureIcon,"aria-hidden":"true"})]}),(0,l.jsxs)("div",{className:y.default.advancedStack,children:[(0,l.jsx)($,{data:D}),(0,l.jsx)(Y,{data:D,onSaved:P,...(void 0!==j?{updateImpl:j}:{})}),void 0!==D.largeDocumentHealth?(0,l.jsx)(er,{capsuleId:_,health:D.largeDocumentHealth,onActionComplete:R,jobActive:"indexing"===D.capsule.lifecycleState||(null==(i=E(D))?void 0:i.status)==="running"||(null==(s=E(D))?void 0:s.status)==="queued",...A}):null,(0,l.jsx)(W,{capsuleId:_,sources:D.sources,onActionComplete:R}),(0,l.jsx)(G,{data:D}),(0,l.jsx)(Q,{}),(0,l.jsx)(et,{diagnostics:D.parserDiagnostics}),(0,l.jsx)(ei,{jobs:D.indexingJobs})]})]})]});}],80010);}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96688,61774,e=>{"use strict";e.s(["STATUS_LABELS",0,{draft:"Draft",indexing:"Indexing",ready:"Indexed",stale:"Stale",deleting:"Deleting",error:"Failed"}],96688);var l=e.i(76055),t=e.i(10644);let a=(e,l)=>(0,t.translateLocalKnowledge)("en",e,l);e.s(["formatError",0,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return e instanceof l.ApiError?e.message.trim().length>0?`${e.message} (${e.code})`:t("localKnowledge.error.api",{code:e.code}):e instanceof Error&&e.message.trim().length>0?e.message:t("localKnowledge.error.unexpected");}],61774);},10985,e=>{"use strict";var l=e.i(10582),t=e.i(87032),a=e.i(61774);function n(e){let{indexing:t,t:a}=e;return null===t||0===t.failedDocuments&&0===t.skippedDocuments?null:(0,l.jsx)("p",{children:a("manualPod.progress.gaps",{failed:String(t.failedDocuments),skipped:String(t.skippedDocuments)})});}function o(e){let{remediations:t,t:a}=e;return 0===t.length?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"lkd-action-progress-note",children:a("manualPod.progress.gapsTitle")}),(0,l.jsx)("ul",{className:"lkd-stale-reasons",children:t.map(e=>(0,l.jsx)("li",{children:e.guidance},e.reason))})]});}e.s(["ManualPodProgressView",0,function(e){let{job:t,t:a,labelKeys:i}=e;return(0,l.jsxs)("div",{className:"lkd-action-progress",role:"status","aria-live":"polite",children:[(0,l.jsx)("p",{children:a("running"===t.state?i.running:"succeeded"===t.state?i.succeeded:"partial"===t.state?i.partial:i.failed)}),(0,l.jsx)("p",{children:a("manualPod.progress.crawl",{accepted:String(t.crawl.accepted),denied:String(t.crawl.deniedCount)})}),null!==t.indexing?(0,l.jsx)("p",{children:a("manualPod.progress.index",{processed:String(t.indexing.processedDocuments),total:String(t.indexing.totalDocuments)})}):null,(0,l.jsx)(n,{indexing:t.indexing,t:a}),"running"===t.state?null:(0,l.jsx)(o,{remediations:t.remediations,t:a})]});},"useManualPodJobPolling",0,function(e){let{pollJobId:l,getJob:n,onJob:o,onError:i,onComplete:s,intervalMs:d}=e;(0,t.useEffect)(()=>{let e;if(void 0===l)return;let t=!1,c=()=>{n(l).then(l=>{t||(o(l),"running"===l.state?e=window.setTimeout(c,d):null==s||s());}).catch(e=>{t||i((0,a.formatError)(e));});};return e=window.setTimeout(c,d),()=>{t=!0,window.clearTimeout(e);};},[l,n,o,i,s,d]);}]);},24744,7340,e=>{"use strict";let l=Object.freeze({maxRawFileBytes:0x40000000,maxExtractedTextBytes:0x10000000,maxParserUnits:2e5,maxParserObjects:25e6,maxChunkCount:2e6,maxEmbeddingBatchCount:1e5,maxWallClockMs:36e5,cancellationDeadlineMs:15e3,maxRetryCount:3,maxPersistedStorageGrowthBytes:0x20000000,largeFileThresholdBytes:0x4000000,extractionWindowPages:16}),t=["complete","cancelled","failed"];Object.freeze({ocr:"unavailable",multimodal:"unavailable"}),Object.freeze({PARTIAL_COVERAGE:"PARTIAL_COVERAGE",OCR_CAPABILITY_UNAVAILABLE:"OCR_CAPABILITY_UNAVAILABLE",MULTIMODAL_CAPABILITY_UNAVAILABLE:"MULTIMODAL_CAPABILITY_UNAVAILABLE",CONVERTER_UNAVAILABLE:"CONVERTER_UNAVAILABLE",RESOURCE_POLICY_EXCEEDED:"RESOURCE_POLICY_EXCEEDED",CHECKPOINT_INCOMPATIBLE:"CHECKPOINT_INCOMPATIBLE",EXTRACTION_RESUMED:"EXTRACTION_RESUMED",EXTRACTION_PROGRESS:"EXTRACTION_PROGRESS"}),e.s(["DEFAULT_LARGE_DOCUMENT_RESOURCE_POLICY",0,l,"isTerminalExtractionPhase",0,function(e){return t.includes(e);}],24744);let a="keiko-html-manual-source-fingerprint:";function n(e){return`keiko-html-manual-source-kind:${e}`;}e.s(["parseHtmlManualSourceTagMetadata",0,function(e){let l,t;for(let o of e)o===n("html-manual-local")?l="html-manual-local":o===n("html-manual-http")?l="html-manual-http":o.startsWith(a)&&(t=o.slice(a.length));return{...(void 0!==l?{sourceKind:l}:{}),...(void 0!==t?{sourceFingerprint:t}:{})};}],7340);},94891,e=>{e.v({advancedDisclosure:"capsule-detail-module__3nXTdq__advancedDisclosure",advancedStack:"capsule-detail-module__3nXTdq__advancedStack",backButton:"capsule-detail-module__3nXTdq__backButton",capsulePodGlyph:"capsule-detail-module__3nXTdq__capsulePodGlyph",capsuleRowInfo:"capsule-detail-module__3nXTdq__capsuleRowInfo",capsuleSetGlyph:"capsule-detail-module__3nXTdq__capsuleSetGlyph",detailContent:"capsule-detail-module__3nXTdq__detailContent",detailPage:"capsule-detail-module__3nXTdq__detailPage",disclosureIcon:"capsule-detail-module__3nXTdq__disclosureIcon",disclosureSummary:"capsule-detail-module__3nXTdq__disclosureSummary",explainable:"capsule-detail-module__3nXTdq__explainable",explainableBlock:"capsule-detail-module__3nXTdq__explainableBlock",helpTooltip:"capsule-detail-module__3nXTdq__helpTooltip",indexPrompt:"capsule-detail-module__3nXTdq__indexPrompt",maintenanceDisclosure:"capsule-detail-module__3nXTdq__maintenanceDisclosure",podHeader:"capsule-detail-module__3nXTdq__podHeader",podTitle:"capsule-detail-module__3nXTdq__podTitle",selectedSourceNote:"capsule-detail-module__3nXTdq__selectedSourceNote",sourcePickerActions:"capsule-detail-module__3nXTdq__sourcePickerActions",sourcePickerCopy:"capsule-detail-module__3nXTdq__sourcePickerCopy",sourcePickerDescription:"capsule-detail-module__3nXTdq__sourcePickerDescription",sourcePickerFormats:"capsule-detail-module__3nXTdq__sourcePickerFormats",sourcePickerPanel:"capsule-detail-module__3nXTdq__sourcePickerPanel",sourcePickerTitle:"capsule-detail-module__3nXTdq__sourcePickerTitle",sourceSetup:"capsule-detail-module__3nXTdq__sourceSetup",sourceSetupDescription:"capsule-detail-module__3nXTdq__sourceSetupDescription",sourceSetupHeader:"capsule-detail-module__3nXTdq__sourceSetupHeader",sourceSetupTitle:"capsule-detail-module__3nXTdq__sourceSetupTitle",specificFilesDisclosure:"capsule-detail-module__3nXTdq__specificFilesDisclosure",specificFilesSummary:"capsule-detail-module__3nXTdq__specificFilesSummary"});},69128,80814,30558,e=>{"use strict";var l=e.i(87032),t=e.i(61593),a=e.i(61774);e.s(["useCapsuleDetail",0,function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.fetchCapsuleDetail,[o,i]=(0,l.useState)(null),[s,d]=(0,l.useState)("loading"),[c,r]=(0,l.useState)(null),u=(0,l.useCallback)(async function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(""===e){i(null),r("No Knowledge Pod selected."),d("error");return;}!0!==l.quiet&&(d("loading"),r(null));try{let l=await n(e);i(l),d("ready");}catch(e){if(!0===l.quiet)return;r((0,a.formatError)(e)),d("error");}},[e,n]);return(0,l.useEffect)(()=>{u();},[u]),(0,l.useEffect)(()=>{let e=null==o?void 0:o.indexingJobs[0];if((null==o?void 0:o.capsule.lifecycleState)!=="indexing"&&(null==e?void 0:e.status)!=="queued"&&(null==e?void 0:e.status)!=="running")return;let l=null,t=()=>"u">typeof document&&"hidden"===document.visibilityState,a=()=>{null===l&&(l=window.setInterval(()=>{u({quiet:!0});},2e3));},n=()=>{null!==l&&(window.clearInterval(l),l=null);},i=()=>{t()?n():(u({quiet:!0}),a());};return t()||a(),document.addEventListener("visibilitychange",i),()=>{n(),document.removeEventListener("visibilitychange",i);};},[null==o?void 0:o.capsule.lifecycleState,null==o?void 0:o.indexingJobs,u]),{data:o,loadStatus:s,loadError:c,reload:function(){u();},replaceData:function(e){i(e),r(null),d("ready");}};}],69128);var n=e.i(10582),o=e.i(5353);let i=Object.freeze([...Object.freeze(["pdf"]),...Object.freeze(["docx"]),...Object.freeze(["xlsx"])]),s=Object.freeze([...Object.freeze(["json","jsonl","ndjson"]),...Object.freeze(["csv"]),...Object.freeze(["tsv","tab"])]),d=Object.freeze(["txt","log","md","markdown","rst","adoc","asciidoc"]),c=Object.freeze(["html","htm","xhtml"]),r=Object.freeze(["ts","tsx","js","jsx","mjs","cjs","py","rb","php","sh","bash","zsh","fish","ps1"]),u=Object.freeze(["go","rs","java","kt","swift","c","cc","cpp","h","hpp","cs"]),p=Object.freeze(["yaml","yml","toml","ini","cfg","conf","env","properties","sql","graphql","gql"]);Object.freeze([...d,...r,...u,...p]);let m=Object.freeze([Object.freeze({id:"documents",extensions:i}),Object.freeze({id:"structuredData",extensions:s}),Object.freeze({id:"textDocuments",extensions:d}),Object.freeze({id:"webDocuments",extensions:c}),Object.freeze({id:"scripts",extensions:r}),Object.freeze({id:"sourceCode",extensions:u}),Object.freeze({id:"configuration",extensions:p})]);var g=e.i(83449),h=e.i(24744);let x=h.DEFAULT_LARGE_DOCUMENT_RESOURCE_POLICY.maxRawFileBytes,b=h.DEFAULT_LARGE_DOCUMENT_RESOURCE_POLICY.maxParserObjects,v=h.DEFAULT_LARGE_DOCUMENT_RESOURCE_POLICY.maxWallClockMs;var f=e.i(8245),w=e.i(48268),k=e.i(64533),j=e.i(50850),K=e.i(10644),y=e.i(94891);function N(e){let t,{children:a,description:o,as:i="span",block:s=!1,className:d,placement:c="bottom"}=e,[r,u]=(0,l.useState)(!1),p=(0,l.useId)();return(0,n.jsxs)(i,{className:(t=[y.default.explainable],s&&t.push(y.default.explainableBlock),void 0!==d&&t.push(d),t.join(" ")),"data-placement":c,tabIndex:0,"aria-describedby":r?p:void 0,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onFocus:()=>u(!0),onBlur:()=>u(!1),onKeyDown:function(e){"Escape"===e.key&&u(!1);},children:[a,r?(0,n.jsx)("span",{id:p,role:"tooltip",className:y.default.helpTooltip,children:o}):null]});}function C(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%";}function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return{detail:null,startedAt:e,now:e,pollError:null};}function _(e){return null===e?e:{...e,now:Date.now()};}async function E(e,l,t,n,o){try{let t=await l(e);if(n())return;o(e=>null===e?{detail:t,startedAt:Date.now(),now:Date.now(),pollError:null}:{...e,detail:t,now:Date.now(),pollError:null});}catch(e){if(n())return;o(l=>{var n;return n=(0,a.formatError)(e,t),null===l?l:{...l,now:Date.now(),pollError:n};});}}e.s(["Explainable",0,N],80814);let D=Object.freeze({documents:"localKnowledge.detail.connect.filter.documents",structuredData:"localKnowledge.detail.connect.filter.structuredData",textDocuments:"localKnowledge.detail.connect.filter.textDocuments",webDocuments:"localKnowledge.detail.connect.filter.webDocuments",scripts:"localKnowledge.detail.connect.filter.scripts",sourceCode:"localKnowledge.detail.connect.filter.sourceCode",configuration:"localKnowledge.detail.connect.filter.configuration"});function I(e){return Array.from(new Set(e.split(/\r?\n/u).map(e=>e.trim()).filter(e=>e.length>0)));}function T(e,l,t,a){if("picked"===e.kind){l(e.paths),t(null);return;}"busy"===e.kind&&t(a("localKnowledge.nativeDialog.busy")),"unsupported"===e.kind&&t(a("localKnowledge.nativeDialog.unavailable")),"error"===e.kind&&t(e.message);}function R(e){let{locale:l,t}=e;return(0,n.jsxs)("div",{className:y.default.sourcePickerCopy,children:[(0,n.jsx)(N,{description:t("localKnowledge.detail.help.sourceSetup"),children:(0,n.jsx)("span",{className:y.default.sourcePickerTitle,children:t("localKnowledge.detail.connect.sourcePickerTitle")})}),(0,n.jsx)("span",{className:y.default.sourcePickerDescription,children:t("localKnowledge.detail.connect.sourcePickerDescription")}),(0,n.jsx)("span",{className:y.default.sourcePickerFormats,children:t("localKnowledge.detail.connect.supportedFormats",{size:(0,g.formatBytes)(x,l)})})]});}function P(e){let{picker:l,state:t,t:a}=e;return(0,n.jsxs)("div",{className:y.default.sourcePickerActions,children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:t.busy||!l.supported,"aria-describedby":l.supported?void 0:l.noteId,title:a("localKnowledge.detail.help.sourceSetup"),onClick:l.openFolder,children:a("localKnowledge.detail.connect.pickFolderSource")}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:t.busy||!l.supported||t.repositoryMode,"aria-describedby":l.supported?void 0:l.noteId,title:a(t.repositoryMode?"localKnowledge.detail.connect.repositoryFilesDisabledNote":"localKnowledge.detail.help.sourceSetup"),onClick:l.openFiles,children:a("localKnowledge.detail.connect.pickDocumentSource")})]});}function A(e){let{locale:l,picker:t,state:a,t:o}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:y.default.sourcePickerPanel,children:[(0,n.jsx)(R,{locale:l,t:o}),(0,n.jsx)(P,{picker:t,state:a,t:o})]}),t.supported?null:(0,n.jsx)("span",{id:t.noteId,className:"dlg-note",children:o("localKnowledge.nativeDialog.unavailable")})]});}function L(e){let{state:l,submission:t,t:a}=e;return(0,n.jsxs)("div",{className:"lkd-connect-row",children:[(0,n.jsx)("label",{htmlFor:"lkd-connect-path-input",className:"dlg-label",children:(0,n.jsx)(N,{description:a("localKnowledge.detail.help.sourcePath"),children:a("localKnowledge.detail.connect.sourcePath")})}),(0,n.jsxs)("div",{className:"lkd-connect-path-group",children:[(0,n.jsx)("input",{id:"lkd-connect-path-input",type:"text",className:"dlg-input lkd-connect-input",value:l.rootPath,disabled:l.busy,placeholder:"/absolute/path/to/source",autoComplete:"off",onChange:e=>l.setRootPath(e.target.value),onKeyDown:e=>{"Enter"===e.key&&t.connect();}}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:l.busy||null===t.scope,"aria-busy":l.busy,onClick:()=>{t.connect();},children:a(l.busy?"localKnowledge.detail.connect.connecting":"localKnowledge.detail.connect.connect")})]})]});}function M(e){let{state:l,submission:t,t:a}=e;return(0,n.jsxs)("div",{className:"lkd-connect-row",children:[(0,n.jsx)("label",{htmlFor:"lkd-connect-display-name-input",className:"dlg-label",children:(0,n.jsx)(N,{description:a("localKnowledge.detail.help.sourceDisplayName"),children:a("localKnowledge.detail.connect.displayName")})}),(0,n.jsx)("input",{id:"lkd-connect-display-name-input",type:"text",className:"dlg-input lkd-connect-input",value:l.displayName,disabled:l.busy,placeholder:a("localKnowledge.detail.connect.displayNamePlaceholder"),autoComplete:"off",onChange:e=>l.setDisplayName(e.target.value),onKeyDown:e=>{"Enter"===e.key&&t.connect();}})]});}function F(e){let{state:l,t}=e;return(0,n.jsx)("div",{className:"lkd-connect-row",children:(0,n.jsxs)("label",{htmlFor:"lkd-connect-repository-toggle",className:"dlg-label",children:[(0,n.jsx)("input",{id:"lkd-connect-repository-toggle",type:"checkbox",checked:l.repositoryMode,disabled:l.busy,onChange:e=>l.changeRepositoryMode(e.target.checked)})," ",(0,n.jsx)(N,{description:t("localKnowledge.detail.help.repositoryMode"),children:t("localKnowledge.detail.connect.repositoryMode")})]})});}function O(e){let{state:l,t}=e;return(0,n.jsxs)("details",{className:y.default.specificFilesDisclosure,"data-disabled":l.repositoryMode?"true":void 0,open:l.specificFilesExpanded&&!l.repositoryMode,onToggle:e=>{l.repositoryMode||l.setSpecificFilesExpanded(e.currentTarget.open);},children:[(0,n.jsxs)("summary",{className:y.default.specificFilesSummary,"aria-disabled":l.repositoryMode,title:l.repositoryMode?t("localKnowledge.detail.connect.repositoryFilesDisabledNote"):void 0,onClick:e=>{l.repositoryMode&&e.preventDefault();},children:[(0,n.jsx)("span",{children:(0,n.jsx)(N,{description:t("localKnowledge.detail.help.specificFiles"),children:t("localKnowledge.detail.connect.specificFiles")})}),(0,n.jsx)("span",{className:y.default.disclosureIcon,"aria-hidden":"true"})]}),(0,n.jsx)("label",{htmlFor:"lkd-connect-files-input",className:"dlg-label",children:t("localKnowledge.detail.connect.relativeFiles")}),(0,n.jsx)("textarea",{id:"lkd-connect-files-input",className:"dlg-input lkd-connect-input",value:l.filesInput,disabled:l.busy||l.repositoryMode,placeholder:"src/app.ts\nREADME.md",rows:4,onChange:e=>l.setFilesInput(e.target.value)})]});}function q(e){let{state:l,t}=e;return l.repositoryMode?(0,n.jsx)("p",{className:y.default.selectedSourceNote,children:t("localKnowledge.detail.connect.repositoryFilesDisabledNote")}):null;}function B(e){return(0,n.jsxs)("div",{className:"lkd-connect-form","aria-label":e.t("localKnowledge.detail.connect.region"),children:[(0,n.jsx)(A,{locale:e.locale,picker:e.picker,state:e.state,t:e.t}),null!==e.submission.selectedSource?(0,n.jsx)("p",{className:y.default.selectedSourceNote,children:e.submission.selectedSource}):null,(0,n.jsx)(L,{state:e.state,submission:e.submission,t:e.t}),(0,n.jsx)(M,{state:e.state,submission:e.submission,t:e.t}),(0,n.jsx)(F,{state:e.state,t:e.t}),(0,n.jsx)(O,{state:e.state,t:e.t}),(0,n.jsx)(q,{state:e.state,t:e.t}),null!==e.state.connectError?(0,n.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:e.state.connectError}):null]});}function X(e){let o,{capsuleId:i,onConnected:s,connectImpl:d=t.connectCapsuleSource}=e,c=(0,K.useLocalKnowledgeTranslate)(),r=(0,j.useLocale)(),u=function(){let[e,t]=(0,l.useState)(""),[a,n]=(0,l.useState)(""),[o,i]=(0,l.useState)(""),[s,d]=(0,l.useState)(!1),[c,r]=(0,l.useState)(!1),[u,p]=(0,l.useState)(!1),[m,g]=(0,l.useState)(null);return{rootPath:e,setRootPath:t,displayName:a,setDisplayName:n,filesInput:o,setFilesInput:i,specificFilesExpanded:s,setSpecificFilesExpanded:d,repositoryMode:c,busy:u,setBusy:p,connectError:m,setConnectError:g,changeRepositoryMode:function(e){r(e),e&&(i(""),d(!1));},reset:function(){t(""),n(""),i(""),d(!1),r(!1);}};}(),p=m.map(e=>({name:c(D[e.id]),extensions:e.extensions})),g=(o=(0,l.useId)(),{noteId:o,supported:(0,w.useNativeFileDialogCapability)(),openFolder:function(){(0,k.pickWithNativeDialog)({mode:"open-directory",title:c("localKnowledge.detail.connect.chooseFolder"),...(u.rootPath.trim().length>0?{defaultPath:u.rootPath.trim()}:{})}).then(e=>{T(e,e=>{let l=e[0];void 0!==l&&u.setRootPath(l),u.setFilesInput(""),u.setSpecificFilesExpanded(!1);},u.setConnectError,c);});},openFiles:function(){(0,k.pickWithNativeDialog)({mode:"open-files",title:c("localKnowledge.detail.connect.chooseFiles"),filters:p,...(u.rootPath.trim().length>0?{defaultPath:u.rootPath.trim()}:{})}).then(e=>{T(e,e=>{let l=(0,k.nativePathsToRootAndFiles)(e);u.setRootPath(l.rootPath),u.setFilesInput(l.files.join("\n")),u.setSpecificFilesExpanded(!0);},u.setConnectError,c);});}}),h=function(e,l,t,n,o){let i=function(e,l,t){let a=e.trim();if(""===a)return null;if(t)return{kind:"repository",repositoryRoot:a};let n=I(l);return 0===n.length?{kind:"folder",rootPath:a,recursive:!0}:{kind:"files",rootPath:a,files:n};}(n.rootPath,n.filesInput,n.repositoryMode);async function s(){if(null!==i&&!n.busy){n.setBusy(!0),n.setConnectError(null);try{let a=n.displayName.trim();""===a?await t(e,i):await t(e,i,a),n.reset(),l();}catch(e){n.setConnectError((0,a.formatError)(e,o));}finally{n.setBusy(!1);}}}return{scope:i,selectedSource:function(e,l,t,a){let n=e.trim();if(""===n)return null;if(t)return a("localKnowledge.detail.connect.selectedRepository",{path:n});let o=I(l).length;return o>0?a("localKnowledge.detail.connect.selectedDocuments",{count:o.toString(),root:n}):a("localKnowledge.detail.connect.selectedSource",{path:n});}(n.rootPath,n.filesInput,n.repositoryMode,o),connect:s};}(i,s,d,u,c);return(0,n.jsx)(B,{state:u,picker:g,submission:h,locale:r,t:c});}function U(e,t,a){(0,l.useEffect)(()=>{if(!t)return;let e=document.activeElement;return()=>{var l;return null==e||null==(l=e.focus)?void 0:l.call(e);};},[t]),(0,l.useEffect)(()=>{if(!t)return;let l=e.current;if(null===l)return;let n=l.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])");function o(e){if("Escape"===e.key){e.preventDefault(),a();return;}if("Tab"!==e.key)return;let t=Array.from(l.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===t.length)return void e.preventDefault();let n=t[0],o=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),o.focus()):e.shiftKey||document.activeElement!==o||(e.preventDefault(),n.focus());}return null==n||n.focus(),l.addEventListener("keydown",o),()=>l.removeEventListener("keydown",o);},[t,e,a]);}function $(e){var l,t,a,o,i,s;let{kind:d,progress:c,t:r}=e,u=c.detail,p=null==u?void 0:u.indexingJobs[0],m=null!=(l=null!=(t=null==p?void 0:p.totalDocuments)?t:null==u?void 0:u.health.documentCount)?l:0,h=void 0===p?0:p.processedDocuments+p.failedDocuments+p.skippedDocuments,x=m>0?h/m:0,b=null!=(a=null==u?void 0:u.health.chunkCount)?a:0,v=null!=(o=null==u?void 0:u.health.vectorCount)?o:0,f=b>0?v/b:0,w=c.now-c.startedAt,k=h>0?h/Math.max(w,1):0,j=k>0?Math.max(0,m-h)/k:0,K=null!=(i=null!=(s=null==p?void 0:p.status)?s:null==u?void 0:u.capsule.lifecycleState)?i:"starting",y=r("index"===d?"localKnowledge.detail.progress.indexing":"reembed"===d?"localKnowledge.detail.progress.reembedding":"refresh"===d?"localKnowledge.detail.progress.refreshing":"localKnowledge.detail.progress.repairing"),N=k>0&&m>h?r("localKnowledge.detail.progress.remaining",{duration:(0,g.formatDurationCompact)(j)}):r("localKnowledge.detail.progress.estimating");return(0,n.jsxs)("div",{className:"lkd-action-progress",role:"status","aria-live":"polite",title:r("localKnowledge.detail.help.actionProgress"),children:[(0,n.jsxs)("div",{className:"lkd-action-progress-head",children:[(0,n.jsx)("span",{children:y}),(0,n.jsx)("span",{children:K})]}),(0,n.jsx)("div",{className:"lkd-action-progress-note",children:r("localKnowledge.detail.progress.elapsed",{duration:(0,g.formatDurationCompact)(w),eta:N})}),(0,n.jsxs)("div",{className:"lkd-status-bars",children:[(0,n.jsxs)("div",{className:"lkd-status-bar-row",title:r("localKnowledge.detail.help.actionDocuments"),children:[(0,n.jsx)("span",{children:r("localKnowledge.detail.progress.documents")}),(0,n.jsx)(z,{value:x,label:r("localKnowledge.detail.progress.documentProgress")}),(0,n.jsxs)("span",{children:[h.toString()," / ",m.toString()]})]}),(0,n.jsxs)("div",{className:"lkd-status-bar-row",title:r("localKnowledge.detail.help.actionVectors"),children:[(0,n.jsx)("span",{children:r("localKnowledge.detail.progress.vectors")}),(0,n.jsx)(z,{value:f,label:r("localKnowledge.detail.progress.vectorProgress")}),(0,n.jsxs)("span",{children:[v.toString()," / ",b.toString()]})]})]}),null!==c.pollError?(0,n.jsx)("div",{className:"lkd-action-progress-note",children:r("localKnowledge.detail.progress.delayed",{error:c.pollError})}):null]});}function z(e){let{value:l,label:t}=e;return(0,n.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${t}: ${C(l)}`,children:(0,n.jsx)("span",{className:"lkd-progress-fill","data-tone":"ok",style:{width:C(l)}})});}function G(e){let{indexBusy:l,indexError:t,progress:a,onIndex:o,t:i}=e;return(0,n.jsxs)("div",{className:`lkd-index-row ${y.default.indexPrompt}`,children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary","aria-label":i("localKnowledge.detail.actions.index.aria"),"aria-busy":l,disabled:l,title:i("localKnowledge.detail.help.indexNow"),onClick:o,children:i(l?"localKnowledge.detail.actions.index.busy":"localKnowledge.detail.actions.index.button")}),null!==t?(0,n.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:t}):null,l&&null!==a?(0,n.jsx)($,{kind:"index",progress:a,t:i}):null]});}function V(e){let{capsuleDisplayName:l,showReembedButton:t,showRebuildButton:a,reembedRecommended:o,contextualRebuildRequired:i,actionDisabled:s,onReembed:d,onRebuild:c,onRefresh:r,onRepair:u,onDelete:p,t:m}=e;return(0,n.jsxs)("div",{role:"group","aria-label":m("localKnowledge.detail.actions.group",{name:l}),className:"lkd-actions-group",children:[t?(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","data-recommended":o?"true":"false","aria-label":m("localKnowledge.detail.actions.reembed.aria",{name:l}),title:m("localKnowledge.detail.help.actionReembed"),disabled:s,onClick:d,children:m("localKnowledge.detail.actions.reembed.button")}):null,a?(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","data-recommended":i?"true":"false","aria-label":m("localKnowledge.detail.actions.rebuild.aria",{name:l}),title:m("localKnowledge.detail.help.actionRebuild"),disabled:s,onClick:c,children:m("localKnowledge.detail.actions.rebuild.button")}):null,(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":m("localKnowledge.detail.actions.refresh.aria",{name:l}),title:m("localKnowledge.detail.help.actionRefresh"),disabled:s,onClick:r,children:m("localKnowledge.detail.actions.refresh.button")}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":m("localKnowledge.detail.actions.repair.aria",{name:l}),title:m("localKnowledge.detail.help.actionRepair"),disabled:s,onClick:u,children:m("localKnowledge.detail.actions.repair.button")}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger","aria-label":m("localKnowledge.detail.actions.delete.aria",{name:l}),title:m("localKnowledge.detail.help.actionDelete"),onClick:p,children:m("common.delete")})]});}function H(e){let{kind:t,capsuleDisplayName:a,nameInput:i,busy:s,error:d,progress:c,onNameChange:r,onConfirm:u,onCancel:p}=e,m=(0,K.useLocalKnowledgeTranslate)(),g=(0,l.useRef)(null),h=(0,l.useRef)(null);(0,f.useModalInteractionLock)(),U(g,!0,p),(0,l.useEffect)(()=>{"delete"===t&&null!==h.current&&h.current.focus();},[t]);let x=(0,l.useRef)(!1);(0,l.useEffect)(()=>{let e=g.current;if(null!==e){if(s)x.current=!0,e.focus();else if(x.current){var l;x.current=!1,null==(l=e.querySelector("button:not([disabled]),input:not([disabled])"))||l.focus();}}},[s]);let b="delete"===t,v=!s&&(!b||i===a),w="lkd-confirm-title",k="lkd-confirm-desc";return(0,o.createPortal)((0,n.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&p();},children:(0,n.jsxs)("div",{ref:g,role:"dialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":k,className:"dlg",tabIndex:-1,children:[(0,n.jsx)("div",{className:"dlg-head",children:(0,n.jsxs)("div",{className:"dlg-htext",children:[(0,n.jsx)("div",{id:w,className:"dlg-title",children:m("delete"===t?"localKnowledge.detail.actions.delete.title":"reembed"===t?"localKnowledge.detail.actions.reembed.title":"rebuild"===t?"localKnowledge.detail.actions.rebuild.title":"refresh"===t?"localKnowledge.detail.actions.refresh.title":"localKnowledge.detail.actions.repair.title")}),(0,n.jsx)("div",{id:k,className:"dlg-sub",children:"delete"===t?m("localKnowledge.detail.actions.delete.description",{name:a}):m("refresh"===t?"localKnowledge.detail.actions.refresh.description":"reembed"===t?"localKnowledge.detail.actions.reembed.description":"rebuild"===t?"localKnowledge.detail.actions.rebuild.description":"localKnowledge.detail.actions.repair.description")})]})}),b?(0,n.jsxs)("div",{className:"dlg-body",children:[(0,n.jsxs)("div",{className:"dlg-field",children:[(0,n.jsx)("label",{htmlFor:"lkd-confirm-name-input",className:"dlg-label",children:m("localKnowledge.detail.actions.delete.confirmName")}),(0,n.jsx)("input",{id:"lkd-confirm-name-input",type:"text",className:"dlg-input",value:i,autoComplete:"off",ref:h,disabled:s,placeholder:a,onChange:e=>r(e.target.value)})]}),null!==d?(0,n.jsx)("div",{role:"alert",className:"lk-alert",style:{marginTop:4},children:d}):null]}):(0,n.jsxs)("div",{className:"dlg-body",children:[s&&null!==c?(0,n.jsx)($,{kind:t,progress:c,t:m}):null,null!==d?(0,n.jsx)("div",{role:"alert",className:"lk-alert",children:d}):null]}),(0,n.jsxs)("div",{className:"dlg-foot",children:[(0,n.jsx)("button",{type:"button",className:"dlg-btn",disabled:s,onClick:p,children:m("common.cancel")}),(0,n.jsx)("button",{type:"button",className:"dlg-btn lkd-btn-destructive",disabled:!v,"aria-disabled":!v,onClick:u,children:m(s?"common.working":"delete"===t?"common.delete":"reembed"===t?"localKnowledge.detail.actions.reembed.confirm":"rebuild"===t?"localKnowledge.detail.actions.rebuild.confirm":"refresh"===t?"localKnowledge.detail.actions.refresh.confirm":"localKnowledge.detail.actions.repair.confirm")})]})]})}),document.body);}function J(e){let{affectedCapsuleSetCount:t,onContinue:a}=e,i=(0,K.useLocalKnowledgeTranslate)(),s=(0,l.useRef)(null);(0,f.useModalInteractionLock)(),U(s,!0,a);let d="lkd-affected-sets-title",c="lkd-affected-sets-desc";return(0,o.createPortal)((0,n.jsx)("div",{className:"dlg-overlay in",children:(0,n.jsxs)("div",{ref:s,role:"alertdialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":c,className:"dlg",tabIndex:-1,children:[(0,n.jsx)("div",{className:"dlg-head",children:(0,n.jsxs)("div",{className:"dlg-htext",children:[(0,n.jsx)("div",{id:d,className:"dlg-title",children:i("localKnowledge.detail.deleteAffectedSets.title")}),(0,n.jsx)("div",{id:c,className:"dlg-sub",children:i(1===t?"localKnowledge.detail.deleteAffectedSets.description.one":"localKnowledge.detail.deleteAffectedSets.description.many",{count:t})})]})}),(0,n.jsx)("div",{className:"dlg-foot",children:(0,n.jsx)("button",{type:"button",className:"dlg-btn",onClick:a,children:i("common.continue")})})]})}),document.body);}e.s(["CapsuleActions",0,function(e){var o,i;let{capsuleId:s,capsuleDisplayName:d,sourceCount:c,lifecycleState:r,vectorCompatible:u=!0,contextualRebuildRequired:p=!1,onActionComplete:m,onDeleted:h,connectCapsuleSourceImpl:f=t.connectCapsuleSource,deleteCapsuleImpl:w=t.deleteCapsule,refreshCapsuleImpl:k=t.refreshCapsuleChangedFiles,repairCapsuleImpl:C=t.repairCapsuleFailedFiles,reembedCapsuleImpl:D=t.reembedCapsuleForCurrentModel,rebuildCapsuleImpl:I=t.rebuildCapsuleIndex,startIndexingImpl:T=t.startIndexing,fetchCapsuleDetailImpl:R=t.fetchCapsuleDetail}=e,P=(0,K.useLocalKnowledgeTranslate)(),A=(0,j.useLocale)(),[L,M]=(0,l.useState)(null),[F,O]=(0,l.useState)(!1),[q,B]=(0,l.useState)(null),[U,$]=(0,l.useState)(null),[z,Y]=(0,l.useState)(!1),[W,Q]=(0,l.useState)(null),[Z,ee]=(0,l.useState)(null),el=null!==Z&&(!!z||F&&null!==L&&"delete"!==L.kind);async function et(){if(!z){ee(S()),Y(!0),Q(null);try{await T(s),ee(null),m();}catch(e){Q((0,a.formatError)(e,P));}finally{Y(!1);}}}function ea(e){B(null),ee(null),M({kind:e,nameInput:""});}async function en(e,l){"delete"!==e&&ee(S()),O(!0),B(null);try{let a=await l();if(ee(null),M(null),"delete"===e){var t,n;(null!=(t=null==(n=a.affectedCapsuleSetIds)?void 0:n.length)?t:0)>0?$(a):void 0!==h?h(a):m();}else m();}catch(e){B((0,a.formatError)(e,P));}finally{O(!1);}}(0,l.useEffect)(()=>{if(!el)return;let e=window.setInterval(()=>{ee(_);},1e3);return()=>window.clearInterval(e);},[el]),(0,l.useEffect)(()=>{if(!el)return;let e=!1;E(s,R,P,()=>e,ee);let l=window.setInterval(()=>{E(s,R,P,()=>e,ee);},2e3);return()=>{e=!0,window.clearInterval(l);};},[s,R,el,P]);let eo=F||z||"indexing"===r;return(0,n.jsxs)("section",{className:`lkd-tools ${y.default.sourceSetup}`,"aria-labelledby":"lkd-source-setup-heading",children:[(0,n.jsx)("div",{className:y.default.sourceSetupHeader,children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{id:"lkd-source-setup-heading",className:y.default.sourceSetupTitle,children:(0,n.jsx)(N,{description:P("localKnowledge.detail.help.sourceSetup"),children:P("localKnowledge.detail.connect.title")})}),(0,n.jsx)("p",{className:y.default.sourceSetupDescription,children:P("localKnowledge.detail.connect.description")})]})}),(0,n.jsx)(X,{capsuleId:s,onConnected:m,connectImpl:f}),c>0&&"ready"!==r?(0,n.jsx)(G,{indexBusy:z,indexError:W,progress:Z,onIndex:()=>void et(),t:P}):null,(0,n.jsxs)("details",{className:y.default.maintenanceDisclosure,children:[(0,n.jsxs)("summary",{className:y.default.disclosureSummary,children:[(0,n.jsx)("span",{children:(0,n.jsx)(N,{description:P("localKnowledge.detail.help.maintenance"),children:P("localKnowledge.detail.actions.maintenance")})}),(0,n.jsx)("span",{children:P("localKnowledge.detail.actions.maintenanceHint")}),(0,n.jsx)("span",{className:y.default.disclosureIcon,"aria-hidden":"true"})]}),(0,n.jsx)("p",{className:"lkd-limit-note",title:P("localKnowledge.detail.help.maintenanceLimits"),children:P("localKnowledge.detail.connect.limitSummary",{size:(0,g.formatBytes)(x,A),objects:b.toLocaleString(A),duration:function(e){let l=Math.round(e/6e4);if(l<60)return`${l.toString()} min`;let t=l/60;return`${t.toString()} h`;}(v)})}),(0,n.jsx)(V,{capsuleDisplayName:d,showReembedButton:c>0,showRebuildButton:c>0,reembedRecommended:c>0&&!u,contextualRebuildRequired:p,actionDisabled:eo,onReembed:()=>ea("reembed"),onRebuild:()=>ea("rebuild"),onRefresh:()=>ea("refresh"),onRepair:()=>ea("repair"),onDelete:()=>ea("delete"),t:P})]}),null!==L?(0,n.jsx)(H,{kind:L.kind,capsuleDisplayName:d,nameInput:L.nameInput,busy:F,error:q,progress:Z,onNameChange:function(e){M(l=>null!==l?{...l,nameInput:e}:null);},onConfirm:function(){var e;if(null===L||F)return;let{kind:l}=L;en(l,(e={deleteCapsuleImpl:w,refreshCapsuleImpl:k,reembedCapsuleImpl:D,rebuildCapsuleImpl:I,repairCapsuleImpl:C},"delete"===l?()=>e.deleteCapsuleImpl(s):"refresh"===l?()=>e.refreshCapsuleImpl(s):"reembed"===l?()=>e.reembedCapsuleImpl(s):"rebuild"===l?()=>e.rebuildCapsuleImpl(s):()=>e.repairCapsuleImpl(s)));},onCancel:function(){F||(M(null),B(null),ee(null));}}):null,null!==U?(0,n.jsx)(J,{affectedCapsuleSetCount:null!=(o=null==(i=U.affectedCapsuleSetIds)?void 0:i.length)?o:0,onContinue:function(){null===U||($(null),void 0!==h?h(U):m());}}):null]});}],30558);},80010,e=>{"use strict";var l=e.i(10582),t=e.i(87032),a=e.i(86796),n=e.i(24744),o=e.i(7340),i=e.i(61593),s=e.i(83449),d=e.i(10644),c=e.i(5909),r=e.i(96688),u=e.i(69128),p=e.i(30558),m=e.i(50850),g=e.i(61774),h=e.i(10985);let x={running:"manualPodRefresh.progress.running",succeeded:"manualPodRefresh.state.succeeded",partial:"manualPodRefresh.state.partial",failed:"manualPodRefresh.state.failed"};function b(e){var a,n,o;let s=(0,m.useTranslate)(),[d,c]=(0,t.useState)({kind:"idle"}),r=(0,t.useRef)(!1),u=null!=(a=e.startRefreshImpl)?a:i.startHtmlManualPodRefresh,p=null!=(n=e.getJobImpl)?n:i.getHtmlManualPodJob,b=(0,t.useCallback)(e=>c({kind:"active",job:e}),[]),f=(0,t.useCallback)(e=>c({kind:"error",message:e}),[]),w="active"===d.kind&&"running"===d.job.state?d.job.jobId:void 0;(0,h.useManualPodJobPolling)({pollJobId:w,getJob:p,onJob:b,onError:f,onComplete:e.onRefreshComplete,intervalMs:null!=(o=e.pollIntervalMs)?o:1500});let k=(0,t.useCallback)(()=>{r.current||(r.current=!0,u(e.capsuleId,e.sourceId).then(e=>c({kind:"active",job:e})).catch(e=>c({kind:"error",message:(0,g.formatError)(e)})).finally(()=>{r.current=!1;}));},[u,e.capsuleId,e.sourceId]);return"active"===d.kind?(0,l.jsx)(h.ManualPodProgressView,{job:d.job,t:s,labelKeys:x}):(0,l.jsxs)("div",{className:"lkd-manual-refresh-trigger",children:["error"===d.kind?(0,l.jsx)("p",{className:"lk-alert",role:"alert",children:d.message}):null,"confirm"===d.kind?(0,l.jsx)(v,{t:s,onConfirm:k,onCancel:()=>c({kind:"idle"})}):(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:()=>c({kind:"confirm"}),children:s("manualPodRefresh.button")})]});}function v(e){let{t,onConfirm:a,onCancel:n}=e;return(0,l.jsxs)("div",{className:"lkd-manual-refresh-confirm",children:[(0,l.jsx)("span",{children:t("manualPodRefresh.confirm.body")}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:n,children:t("manualPodRefresh.confirm.cancel")}),(0,l.jsx)("button",{type:"button",className:"lk-btn",onClick:a,children:t("manualPodRefresh.confirm.confirm")})]});}function f(e){let{name:a,description:n,busy:o,error:i,nameInputRef:s,onNameChange:c,onDescriptionChange:r,onCancel:u,onSubmit:p}=e,m=(0,d.useLocalKnowledgeTranslate)(),g=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let e=e=>{if("Escape"!==e.key||o)return;let l=g.current;(null==l?void 0:l.contains(document.activeElement))===!0&&u();};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e);};},[o,u]),(0,l.jsxs)("form",{className:"lkd-rename-form","aria-label":m("localKnowledge.detail.rename.formLabel"),onSubmit:p,ref:g,children:[(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-rename-name",className:"dlg-label",children:m("localKnowledge.detail.rename.displayName")}),(0,l.jsx)("input",{id:"lkd-rename-name",type:"text",className:"dlg-input",ref:s,value:a,disabled:o,autoComplete:"off",onChange:e=>c(e.target.value)})]}),(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-rename-desc",className:"dlg-label",children:m("localKnowledge.detail.rename.description")}),(0,l.jsx)("input",{id:"lkd-rename-desc",type:"text",className:"dlg-input",value:n,disabled:o,autoComplete:"off",onChange:e=>r(e.target.value)})]}),null!==i?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:i}):null,(0,l.jsxs)("div",{className:"lkd-rename-actions",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:o,onClick:u,children:m("common.cancel")}),(0,l.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:o,"aria-busy":o,children:m(o?"common.saving":"common.save")})]})]});}function w(e){let{capsuleId:a,displayName:n,description:o,onRenamed:s,renameImpl:c=i.renameCapsule}=e,r=(0,d.useLocalKnowledgeTranslate)(),[u,p]=(0,t.useState)(!1),[m,h]=(0,t.useState)(n),[x,b]=(0,t.useState)(null!=o?o:""),[v,w]=(0,t.useState)(!1),[k,j]=(0,t.useState)(null),K=(0,t.useRef)(null),y=(0,t.useRef)(null),N=(0,t.useRef)(!1);async function C(e){let l,t;e.preventDefault();let i=m.trim();if(0===i.length)return void j(r("localKnowledge.detail.rename.nameRequired"));let d=(l={},i!==n&&(l.displayName=i),((t=x.trim())!==(null!=o?o:"")&&(l.description=t),void 0===l.displayName&&void 0===l.description)?null:l);if(null===d)return void p(!1);w(!0),j(null);try{await c(a,d),p(!1),s();}catch(e){j((0,g.formatError)(e,r));}finally{w(!1);}}return(0,t.useEffect)(()=>{var e,l;u?null==(e=K.current)||e.focus():N.current&&(null==(l=y.current)||l.focus()),N.current=u;},[u]),u?(0,l.jsx)(f,{name:m,description:x,busy:v,error:k,nameInputRef:K,onNameChange:h,onDescriptionChange:b,onCancel:function(){v||(p(!1),j(null));},onSubmit:e=>void C(e)}):(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":r("localKnowledge.detail.rename.buttonFor",{name:n}),ref:y,onClick:function(){h(n),b(null!=o?o:""),j(null),p(!0);},children:r("localKnowledge.detail.rename.button")});}var k=e.i(48268),j=e.i(64533);function K(e){var a,n;let{capsuleId:o,source:s,onRebound:c,rebindImpl:r=i.rebindCapsuleSourceRoot}=e,u=(0,d.useLocalKnowledgeTranslate)(),p=(0,t.useId)(),m="repository"===(a=s.scope).kind?a.repositoryRoot:a.rootPath,[h,x]=(0,t.useState)(!1),[b,v]=(0,t.useState)(m),[f,w]=(0,t.useState)(!1),[K,y]=(0,t.useState)(null),N=(0,t.useId)(),C=(0,k.useNativeFileDialogCapability)(),S=b.trim();async function _(){if(0!==S.length&&!f){w(!0),y(null);try{await r(o,s.sourceId,S),x(!1),c();}catch(e){y((0,g.formatError)(e,u));}finally{w(!1);}}}return(0,l.jsx)("div",{className:"lkd-source-rebind",children:h?(0,l.jsxs)("div",{className:"lkd-rebind-form",children:[(0,l.jsx)("label",{htmlFor:p,className:"dlg-label",title:u("localKnowledge.detail.help.rebind"),children:(n=s.scope,"repository"===n.kind?u("localKnowledge.detail.rebind.repositoryRoot"):"files"===n.kind?u("localKnowledge.detail.rebind.sharedRoot"):u("localKnowledge.detail.rebind.folderRoot"))}),(0,l.jsxs)("div",{className:"lkd-connect-path-group",children:[(0,l.jsx)("input",{id:p,type:"text",className:"dlg-input lkd-connect-input",value:b,disabled:f,autoComplete:"off",onChange:e=>v(e.target.value),onKeyDown:e=>{"Enter"===e.key&&_();}}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:f||!C,"aria-describedby":C?void 0:N,onClick:function(){(0,j.pickWithNativeDialog)({mode:"open-directory",title:u("localKnowledge.detail.rebind.chooseRoot"),...(S.length>0?{defaultPath:S}:{})}).then(e=>{if("picked"===e.kind&&void 0!==e.paths[0]){v(e.paths[0]),y(null);return;}"busy"===e.kind&&y(u("localKnowledge.nativeDialog.busy")),"unsupported"===e.kind&&y(u("localKnowledge.nativeDialog.unavailable")),"error"===e.kind&&y(e.message);});},children:u("common.browse")})]}),C?null:(0,l.jsx)("span",{id:N,className:"dlg-note",children:u("localKnowledge.nativeDialog.unavailable")}),(0,l.jsxs)("div",{className:"lkd-rebind-actions",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:f,onClick:function(){f||(x(!1),y(null));},children:u("common.cancel")}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:f||0===S.length,"aria-busy":f,onClick:()=>void _(),children:f?u("localKnowledge.detail.rebind.saving"):u("localKnowledge.detail.rebind.save")})]}),null!==K?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:K}):null]}):(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",title:u("localKnowledge.detail.help.rebind"),onClick:function(){v(m),y(null),x(!0);},children:u("localKnowledge.detail.rebind.button")})});}var y=e.i(94891),N=e.i(80814),C=e.i(60865);function S(e){return new Date(e).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"});}function _(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%";}function E(e){return e.indexingJobs[0];}function D(e){return{width:_(e)};}function I(e){return`${e.provider} / ${e.modelId} (${e.vectorDimensions.toString()}d, ${e.vectorMetric})`;}function T(e){var l,t;return null!=(l=null==(t=e.health.embeddingCompatibility)?void 0:t.status)?l:e.health.vectorCompatible?"compatible":"incompatible";}function R(e,l){return l("compatible"===e?"localKnowledge.detail.compatibility.compatible":"unknown"===e?"localKnowledge.detail.compatibility.unknown":"localKnowledge.detail.compatibility.incompatible");}function P(e){return"ready"===e?"ok":"unavailable"===e?"danger":"rebuild-required"===e||"degraded"===e?"warn":"neutral";}function A(e,l){return l("ready"===e?"localKnowledge.detail.context.status.ready":"rebuild-required"===e?"localKnowledge.detail.context.status.rebuild":"degraded"===e?"localKnowledge.detail.context.status.degraded":"unavailable"===e?"localKnowledge.detail.context.status.unavailable":"localKnowledge.detail.context.status.disabled");}function L(e){let{children:t,help:a}=e;return(0,l.jsx)("h2",{className:"lk-section-head",children:void 0===a?t:(0,l.jsx)(N.Explainable,{description:a,children:t})});}function M(e){let[l,a]=(0,t.useState)(!1);return{visibleCount:l?e:Math.min(25,e),showAll:l,setShowAll:a};}function F(e){let{hiddenCount:t,showAll:a,onToggle:n,noun:o,t:i}=e;return!a&&t<=0?null:(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:n,children:a?i("localKnowledge.detail.rows.showFewer",{noun:o}):i("localKnowledge.detail.rows.showMore",{count:t,noun:o})});}function O(e){let{label:t,value:a,meta:n,help:o,tone:i="neutral"}=e,s=(0,l.jsxs)("div",{className:"lkd-metric-card","data-tone":i,children:[(0,l.jsx)("span",{className:"lkd-metric-label",children:t}),(0,l.jsx)("strong",{className:"lkd-metric-value",children:a}),(0,l.jsx)("span",{className:"lkd-metric-meta",children:n})]});return void 0===o?s:(0,l.jsx)(N.Explainable,{as:"div",block:!0,description:o,children:s});}function q(e){let{value:t,label:a,tone:n="ok"}=e;return(0,l.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${a}: ${_(t)}`,children:(0,l.jsx)("span",{className:"lkd-progress-fill","data-tone":n,style:D(t)})});}function B(e){let{label:t,value:a,help:n,tone:o="ok"}=e;return(0,l.jsx)(N.Explainable,{as:"div",block:!0,description:n,children:(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:t}),(0,l.jsx)(q,{value:a,label:t,tone:o}),(0,l.jsx)("span",{children:_(a)})]})});}function X(e){return e>0?"danger":"ok";}function U(e){var t,a;let n,{data:o}=e,i=(0,d.useLocalKnowledgeTranslate)(),c=E(o),r=null!=(t=null==c?void 0:c.totalDocuments)?t:o.health.documentCount,u=void 0===c?0:c.processedDocuments+c.failedDocuments+c.skippedDocuments,p=Math.max(0,o.health.documentCount-o.health.failedDocuments-o.health.skippedDocuments),m=r<=0?0:u/r,g=o.health.chunkCount<=0?0:o.health.vectorCount/o.health.chunkCount,h=Math.max(0,o.health.chunkCount-o.health.vectorCount),x=function(e,l,t,a){var n;if((null==e?void 0:e.status)==="running"&&l>0&&t>0){let n,o;return a("localKnowledge.detail.index.eta",{duration:(0,s.formatDurationCompact)((n=void 0===e?0:Math.max(Date.now()-e.startedAt,1),(o=t>0?t/n:0)<=0?0:Math.max(0,l-t)/o))});}return void 0===e?a("localKnowledge.detail.index.noJobRecorded"):(0,s.formatDurationCompact)((null!=(n=e.finishedAt)?n:Date.now())-e.startedAt);}(c,r,u,i),b=h<=0&&o.health.failedDocuments<=0?"ok":(null==c?void 0:c.lastError)!==void 0?"danger":"warn";return(0,l.jsxs)("section",{"aria-labelledby":"lkd-index-status-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(L,{help:i("localKnowledge.detail.help.indexStatus"),children:(0,l.jsx)("span",{id:"lkd-index-status-heading",children:i("localKnowledge.detail.index.title")})}),(0,l.jsx)("span",{className:"lkd-live-note","aria-live":"polite",children:i((null==c?void 0:c.status)==="running"?"localKnowledge.detail.index.updating":"localKnowledge.detail.index.latestRun")})]}),(0,l.jsxs)("div",{className:"lkd-metric-grid",children:[(0,l.jsx)(O,{label:i("localKnowledge.detail.index.indexedDocuments"),help:i("localKnowledge.detail.help.indexedDocuments"),value:`${p.toString()} / ${o.health.documentCount.toString()}`,meta:i("localKnowledge.detail.index.failedSkipped",{failed:o.health.failedDocuments,skipped:o.health.skippedDocuments}),tone:o.health.failedDocuments>0?"danger":o.health.skippedDocuments>0?"warn":"ok"}),(0,l.jsx)(O,{label:i("localKnowledge.detail.index.vectors"),help:i("localKnowledge.detail.help.vectors"),value:`${o.health.vectorCount.toString()} / ${o.health.chunkCount.toString()}`,meta:h>0?i("localKnowledge.detail.index.chunksMissingVectors",{count:h}):i("localKnowledge.detail.index.allChunksEmbedded"),tone:X(h)}),(0,l.jsx)(O,{label:i("localKnowledge.detail.index.latestJob"),help:i("localKnowledge.detail.help.latestJob"),value:void 0===c?i("localKnowledge.detail.index.notIndexed"):ea(c.status,i),meta:x,tone:(null==c?void 0:c.status)==="failed"?"danger":(null==c?void 0:c.status)==="running"?"warn":"neutral"})]}),(0,l.jsxs)("div",{className:"lkd-status-bars",children:[(0,l.jsx)(B,{label:i("localKnowledge.detail.index.discoveryProgress"),value:m,help:i("localKnowledge.detail.help.discoveryProgress")}),(0,l.jsx)(B,{label:i("localKnowledge.detail.index.retrievalCoverage"),value:g,help:i("localKnowledge.detail.help.retrievalCoverage"),tone:X(h)})]}),(0,l.jsx)(N.Explainable,{as:"div",block:!0,description:i("localKnowledge.detail.help.indexMessage"),children:(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":b,children:(n=o.health.chunkCount-o.health.vectorCount,(null==c||null==(a=c.lastError)?void 0:a.code)==="EMBEDDING_ADAPTER_FAILED"?i("localKnowledge.detail.index.embeddingStopped",{message:c.lastError.message,count:n}):n>0?i("localKnowledge.detail.index.missingVectors",{count:n}):o.health.unsupportedDocuments>0?i("localKnowledge.detail.index.unsupportedDocuments",{count:o.health.unsupportedDocuments}):i("localKnowledge.detail.index.aligned"))})})]});}function $(e){var t,a,n,o,i;let{data:s}=e,c=(0,d.useLocalKnowledgeTranslate)(),r=s.health.embeddingCompatibility,u=T(s),p="compatible"===u?"ok":"unknown"===u?"warn":"danger",m=void 0===r?I(s.health.embeddingIdentity):`${r.pinnedModelId} (${r.pinnedVectorDimensions.toString()}d, ${r.pinnedVectorMetric})`,g=null!=(t=null==r?void 0:r.pinnedProvider)?t:s.health.embeddingIdentity.provider,h=null!=(a=null==r?void 0:r.currentModelId)?a:c("localKnowledge.detail.compatibility.notConfigured"),x=null!=(n=null==r?void 0:r.currentProvider)?n:c("localKnowledge.detail.compatibility.noProvider"),b=null!=(o=null==r?void 0:r.message)?o:c(s.health.vectorCompatible?"localKnowledge.detail.compatibility.readyMessage":"localKnowledge.detail.compatibility.fixGatewayMessage");return(0,l.jsxs)("section",{"aria-labelledby":"lkd-embedding-compat-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(L,{help:c("localKnowledge.detail.help.embeddingSection"),children:(0,l.jsx)("span",{id:"lkd-embedding-compat-heading",children:c("localKnowledge.detail.compatibility.title")})}),(0,l.jsx)("span",{className:"lkd-live-note",children:R(u,c)})]}),(0,l.jsxs)("div",{className:"lkd-metric-grid",children:[(0,l.jsx)(O,{label:c("localKnowledge.detail.compatibility.pinnedModel"),help:c("localKnowledge.detail.help.pinnedModel"),value:m,meta:g}),(0,l.jsx)(O,{label:c("localKnowledge.detail.compatibility.currentModel"),help:c("localKnowledge.detail.help.currentModel"),value:h,meta:x}),(0,l.jsx)(O,{label:c("localKnowledge.detail.compatibility.metric"),help:c("localKnowledge.detail.help.compatibility"),value:R(u,c),meta:null!=(i=null==r?void 0:r.reason)?i:c("localKnowledge.detail.compatibility.legacyHealth"),tone:p})]}),(0,l.jsx)(N.Explainable,{as:"div",block:!0,description:c("localKnowledge.detail.help.embeddingMessage"),children:(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":p,children:b})})]});}function z(e){let{label:t,value:a,help:n}=e;return(0,l.jsxs)("div",{className:"lkd-row",children:[(0,l.jsx)("dt",{className:"lkd-label",children:void 0===n?t:(0,l.jsx)(N.Explainable,{description:n,children:t})}),(0,l.jsx)("dd",{className:"lkd-value",children:a})]});}function G(e){let{data:t}=e,a=(0,d.useLocalKnowledgeTranslate)(),{capsule:n,health:o}=t,i=n.embeddingModelIdentity,c=T(t);return(0,l.jsxs)("section",{"aria-labelledby":"lkd-overview-heading",children:[(0,l.jsx)(L,{help:a("localKnowledge.detail.help.overview"),children:(0,l.jsx)("span",{id:"lkd-overview-heading",children:a("localKnowledge.detail.overview.title")})}),(0,l.jsxs)("dl",{className:"lkd-dl",children:[(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.name"),value:n.displayName}),void 0!==n.description?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.description"),value:n.description}):null,n.tags.length>0?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.tags"),value:(0,l.jsx)("ul",{className:"lkd-tags","aria-label":a("localKnowledge.detail.overview.tags"),children:n.tags.map(e=>(0,l.jsx)("li",{className:"lkd-tag",children:e},e))})}):null,(0,l.jsx)(z,{label:a("common.status"),help:a("localKnowledge.detail.help.overviewStatus"),value:(0,l.jsx)("output",{className:"lk-badge","data-state":n.lifecycleState,"aria-label":a("localKnowledge.detail.overview.statusAria",{status:r.STATUS_LABELS[n.lifecycleState]}),children:r.STATUS_LABELS[n.lifecycleState]})}),(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.embeddingModel"),help:a("localKnowledge.detail.help.overviewEmbeddingModel"),value:I(i)}),(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.storageSize"),help:a("localKnowledge.detail.help.overviewStorage"),value:(0,s.formatBytes)(o.storageSizeBytes)}),(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.unsupportedDocuments"),help:a("localKnowledge.detail.help.overviewUnsupported"),value:o.unsupportedDocuments.toString()}),void 0!==o.lastIndexedAt?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.lastIndexed"),help:a("localKnowledge.detail.help.overviewLastIndexed"),value:S(o.lastIndexedAt)}):null,(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.vectorCompatible"),help:a("localKnowledge.detail.help.overviewVectorCompatible"),value:"compatible"===c?a("localKnowledge.detail.compatibility.compatible"):"unknown"===c?a("localKnowledge.detail.overview.vectorUnknown"):a("localKnowledge.detail.overview.vectorIncompatible")}),o.staleReasons.length>0?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.staleReasons"),help:a("localKnowledge.detail.help.overviewStaleReasons"),value:(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":a("localKnowledge.detail.overview.staleReasons"),children:o.staleReasons.map(e=>(0,l.jsx)("li",{children:e},e))})}):null,o.unsupportedGuidanceCodes.length>0?(0,l.jsx)(z,{label:a("localKnowledge.detail.overview.nextSteps"),help:a("localKnowledge.detail.help.overviewNextSteps"),value:(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":a("localKnowledge.detail.overview.unsupportedGuidance"),children:o.unsupportedGuidanceCodes.map(e=>(0,l.jsx)("li",{children:(0,d.unsupportedGuidanceText)(e,a)},e))})}):null]})]});}function V(e){let l=e.trim();if(0===l.length)return;let t=Number.parseInt(l,10);return Number.isSafeInteger(t)&&t>0?t:void 0;}function H(e){return void 0===e?"":e.toString();}function J(e){let{message:t,tone:a,live:n}=e;return n?(0,l.jsx)("output",{className:"lkd-status-callout",style:C.NATIVE_BLOCK_STYLE,"data-tone":a,children:t}):(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":a,children:t});}function Y(e){var a,n,o,s;let{data:c,onSaved:r,updateImpl:u=i.updateCapsuleContextualRetrieval}=e,p=(0,d.useLocalKnowledgeTranslate)(),m=c.capsule.contextualRetrieval,g=c.health.contextualRetrieval,[h,x]=(0,t.useState)(null!=(a=null==m?void 0:m.enabled)&&a),[b,v]=(0,t.useState)(null!=(n=null==m?void 0:m.modelId)?n:""),[f,w]=(0,t.useState)(null!=(o=null==m?void 0:m.strict)&&o),[k,j]=(0,t.useState)(H(null==m?void 0:m.maxContextChars)),[K,y]=(0,t.useState)(H(null==m?void 0:m.documentContextMaxChars)),[S,_]=(0,t.useState)(!1),[E,D]=(0,t.useState)(null),[I,T]=(0,t.useState)(null);async function R(){let e=V(k),l=V(K),t={enabled:h,...(b.trim().length>0?{modelId:b.trim()}:{}),strict:f,...(void 0!==e?{maxContextChars:e}:{}),...(void 0!==l?{documentContextMaxChars:l}:{})};_(!0),D(null),T(null);try{let e=await u(c.capsule.id,t);r(e),D(p("localKnowledge.detail.context.saved"));}catch(e){T(e instanceof Error?e.message:p("localKnowledge.detail.context.saveFailed"));}finally{_(!1);}}return(0,t.useEffect)(()=>{var e,l,t;x(null!=(e=null==m?void 0:m.enabled)&&e),v(null!=(l=null==m?void 0:m.modelId)?l:""),w(null!=(t=null==m?void 0:m.strict)&&t),j(H(null==m?void 0:m.maxContextChars)),y(H(null==m?void 0:m.documentContextMaxChars));},[m]),(0,l.jsxs)("section",{"aria-labelledby":"lkd-contextual-retrieval-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(L,{help:p("localKnowledge.detail.help.contextualRetrieval"),children:(0,l.jsx)("span",{id:"lkd-contextual-retrieval-heading",children:p("localKnowledge.detail.context.title")})}),(0,l.jsx)("span",{className:"lkd-live-note",children:A(null==g?void 0:g.status,p)})]}),(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":P(null==g?void 0:g.status),children:p("localKnowledge.detail.context.description")}),void 0!==g?(0,l.jsxs)("div",{className:"lkd-metric-grid",children:[(0,l.jsx)(O,{label:p("localKnowledge.detail.context.retrievalContext"),help:p("localKnowledge.detail.help.contextStatus"),value:A(g.status,p),meta:p("localKnowledge.detail.context.settingsSource",{source:g.source}),tone:P(g.status)}),(0,l.jsx)(O,{label:p("localKnowledge.detail.context.model"),help:p("localKnowledge.detail.help.contextModel"),value:null!=(s=g.modelId)?s:p("localKnowledge.detail.context.gatewayDefault"),meta:g.strict?p("localKnowledge.detail.context.strict"):p("localKnowledge.detail.context.nonStrict")}),(0,l.jsx)(O,{label:p("localKnowledge.detail.context.staleChunks"),help:p("localKnowledge.detail.help.contextStale"),value:g.staleChunkCount.toString(),meta:p("localKnowledge.detail.context.degradedChunks",{count:g.degradedChunkCount}),tone:g.rebuildRequired||g.degradedChunkCount>0?"warn":"ok"})]}):null,(null==g?void 0:g.message)!==void 0?(0,l.jsx)(J,{message:g.message,tone:P(g.status),live:g.rebuildRequired}):null,(0,l.jsx)("div",{className:"lkd-connect-row",children:(0,l.jsxs)("label",{className:"dlg-label",htmlFor:"lkd-context-enabled",title:p("localKnowledge.detail.help.contextEnable"),children:[(0,l.jsx)("input",{id:"lkd-context-enabled",type:"checkbox",checked:h,disabled:S,onChange:e=>x(e.target.checked)})," ",p("localKnowledge.detail.context.generateAtIndex")]})}),(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-context-model",className:"dlg-label",children:(0,l.jsx)(N.Explainable,{description:p("localKnowledge.detail.help.contextModelInput"),children:p("localKnowledge.detail.context.modelId")})}),(0,l.jsx)("input",{id:"lkd-context-model",type:"text",className:"dlg-input lkd-connect-input",value:b,disabled:S||!h,placeholder:p("localKnowledge.detail.context.defaultModelPlaceholder"),onChange:e=>v(e.target.value)})]}),(0,l.jsx)("div",{className:"lkd-connect-row",children:(0,l.jsxs)("label",{className:"dlg-label",htmlFor:"lkd-context-strict",title:p("localKnowledge.detail.help.contextStrict"),children:[(0,l.jsx)("input",{id:"lkd-context-strict",type:"checkbox",checked:f,disabled:S||!h,onChange:e=>w(e.target.checked)})," ",p("localKnowledge.detail.context.failOnError")]})}),(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-context-max",className:"dlg-label",children:(0,l.jsx)(N.Explainable,{description:p("localKnowledge.detail.help.contextGeneratedLimit"),children:p("localKnowledge.detail.context.generatedLimit")})}),(0,l.jsx)("input",{id:"lkd-context-max",type:"number",min:1,className:"dlg-input lkd-connect-input",value:k,disabled:S||!h,placeholder:"480",onChange:e=>j(e.target.value)})]}),(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-document-context-max",className:"dlg-label",children:(0,l.jsx)(N.Explainable,{description:p("localKnowledge.detail.help.contextDocumentLimit"),children:p("localKnowledge.detail.context.documentLimit")})}),(0,l.jsx)("input",{id:"lkd-document-context-max",type:"number",min:1,className:"dlg-input lkd-connect-input",value:K,disabled:S||!h,placeholder:"12000",onChange:e=>y(e.target.value)})]}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:S,"aria-busy":S,title:p("localKnowledge.detail.help.contextSave"),onClick:()=>void R(),children:S?p("common.saving"):p("localKnowledge.detail.context.save")}),null!==E?(0,l.jsx)("output",{className:"lkd-status-callout",style:C.NATIVE_BLOCK_STYLE,"data-tone":"warn",children:E}):null,null!==I?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:I}):null]});}function W(e){let{capsuleId:t,sources:a,onActionComplete:n}=e,o=(0,d.useLocalKnowledgeTranslate)();return 0===a.length?(0,l.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,l.jsx)(L,{help:o("localKnowledge.detail.help.sources"),children:(0,l.jsx)("span",{id:"lkd-sources-heading",children:o("localKnowledge.detail.sources.title")})}),(0,l.jsx)("p",{className:"lkd-empty-note",children:o("localKnowledge.detail.sources.empty")})]}):(0,l.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,l.jsx)(L,{help:o("localKnowledge.detail.help.sources"),children:(0,l.jsx)("span",{id:"lkd-sources-heading",children:o("localKnowledge.detail.sources.title")})}),(0,l.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":o("localKnowledge.detail.sources.list"),children:a.map(e=>{var a;let i=e.indexedCount+e.failedCount+e.skippedCount,s=(a=e.scope,"folder"===a.kind?a.rootPath:"repository"===a.kind?a.repositoryRoot:o(1===a.files.length?"localKnowledge.detail.sources.selectedFiles.one":"localKnowledge.detail.sources.selectedFiles.many",{root:a.rootPath,count:a.files.length}));return(0,l.jsxs)("li",{className:"lkd-source-card",title:o("localKnowledge.detail.help.sourceCard"),children:[(0,l.jsxs)("div",{className:"lkd-source-card-head",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"lkd-source-name",title:e.displayName,children:e.displayName}),(0,l.jsx)("div",{className:"lkd-source-path",title:s,children:s})]}),(0,l.jsxs)("div",{className:"lkd-source-card-actions",children:[(0,l.jsx)("span",{className:"lkd-source-scope",children:e.scope.kind}),(0,l.jsx)(K,{capsuleId:t,source:e,onRebound:n})]})]}),(0,l.jsxs)("div",{className:"lkd-source-coverage",role:"img",title:o("localKnowledge.detail.help.sourceCoverage"),"aria-label":o("localKnowledge.detail.sources.coverage",{indexed:e.indexedCount,failed:e.failedCount,skipped:e.skippedCount}),children:[(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-ok",style:D(i>0?e.indexedCount/i:0)}),(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-fail",style:D(i>0?e.failedCount/i:0)}),(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-skip",style:D(i>0?e.skippedCount/i:0)})]}),(0,l.jsxs)("div",{className:"lkd-source-counts","aria-label":o("localKnowledge.detail.documentCounts"),children:[(0,l.jsx)("span",{className:"lkd-count lkd-count-ok",children:o("localKnowledge.detail.counts.indexed",{count:e.indexedCount})}),(0,l.jsx)("span",{className:"lkd-count lkd-count-fail",children:o("localKnowledge.detail.counts.failed",{count:e.failedCount})}),(0,l.jsx)("span",{className:"lkd-count lkd-count-skip",children:o("localKnowledge.detail.counts.skipped",{count:e.skippedCount})})]})]},e.sourceId);})})]});}function Q(){let e=(0,d.useLocalKnowledgeTranslate)();return(0,l.jsxs)("section",{"aria-labelledby":"lkd-privacy-heading",children:[(0,l.jsx)(L,{help:e("localKnowledge.detail.help.privacy"),children:(0,l.jsx)("span",{id:"lkd-privacy-heading",children:e("localKnowledge.detail.privacy.title")})}),(0,l.jsxs)("ul",{className:"lkd-list","aria-label":e("localKnowledge.detail.privacy.details"),children:[(0,l.jsx)("li",{className:"lkd-source-row",children:e("localKnowledge.detail.privacy.localState")}),(0,l.jsx)("li",{className:"lkd-source-row",children:e("localKnowledge.detail.privacy.modelGateway")}),(0,l.jsx)("li",{className:"lkd-source-row",children:e("localKnowledge.detail.privacy.deletion")})]})]});}function Z(e,l){return l("info"===e?"localKnowledge.detail.diagnostics.severity.info":"warning"===e?"localKnowledge.detail.diagnostics.severity.warning":"localKnowledge.detail.diagnostics.severity.error");}function ee(e){let{group:t,t:a}=e,n=Z(t.severity,a);return(0,l.jsxs)("li",{className:"lkd-diag-group","data-severity":t.severity,title:a("localKnowledge.detail.help.diagnosticRow"),"aria-label":a("localKnowledge.detail.diagnostics.groupAria",{severity:n,code:t.code,count:t.count}),children:[(0,l.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:n}),(0,l.jsxs)("span",{className:"lkd-diag-group-count",children:[t.count.toString(),"x"]}),(0,l.jsx)("span",{className:"lkd-diag-code",children:t.code}),(0,l.jsx)("span",{className:"lkd-diag-message",children:t.message})]});}function el(e){let{diag:t,t:a}=e,n=Z(t.severity,a);return(0,l.jsxs)("li",{className:"lkd-diag-row","data-severity":t.severity,title:a("localKnowledge.detail.help.diagnosticRow"),"aria-label":a("localKnowledge.detail.diagnostics.rowAria",{severity:n,code:t.code}),children:[(0,l.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:n}),(0,l.jsx)("span",{className:"lkd-diag-code",children:t.code}),(0,l.jsx)("span",{className:"lkd-diag-message",children:t.message}),void 0!==t.pageNumber?(0,l.jsxs)("span",{className:"lkd-diag-page",children:["p.",t.pageNumber.toString()]}):null]});}function et(e){let{diagnostics:t}=e,a=(0,d.useLocalKnowledgeTranslate)(),{visibleCount:n,showAll:o,setShowAll:i}=M(t.length),s=t.slice(0,n),c=t.length-s.length,r=function(e){let l=new Map();for(let a of e){var t;let e=`${a.severity}\u0000${a.code}\u0000${a.message}`,n=l.get(e);l.set(e,{key:e,severity:a.severity,code:a.code,message:a.message,count:(null!=(t=null==n?void 0:n.count)?t:0)+1});}return[...l.values()].sort((e,l)=>l.count-e.count||e.code.localeCompare(l.code));}(t).slice(0,8);return(0,l.jsxs)("section",{"aria-labelledby":"lkd-diag-heading",children:[(0,l.jsx)(L,{help:a("localKnowledge.detail.help.diagnostics"),children:(0,l.jsx)("span",{id:"lkd-diag-heading",children:a("localKnowledge.detail.diagnostics.title")})}),0===t.length?(0,l.jsx)("p",{className:"lkd-empty-note","data-testid":"diag-empty",children:a("localKnowledge.detail.diagnostics.empty")}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("ul",{className:"lkd-list lkd-diag-group-list","aria-label":a("localKnowledge.detail.diagnostics.groupedList"),children:r.map(e=>(0,l.jsx)(ee,{group:e,t:a},e.key))}),(0,l.jsx)("ul",{className:"lkd-list lkd-diag-list","aria-label":a("localKnowledge.detail.diagnostics.list"),children:s.map((e,t)=>(0,l.jsx)(el,{diag:e,t:a},`${e.code}-${t.toString()}`))}),(0,l.jsx)(F,{hiddenCount:c,noun:a("localKnowledge.detail.rows.diagnostics"),showAll:o,onToggle:()=>i(!o),t:a})]})]});}function ea(e,l){return l("queued"===e?"localKnowledge.detail.jobs.status.queued":"running"===e?"localKnowledge.detail.jobs.status.running":"succeeded"===e?"localKnowledge.detail.jobs.status.succeeded":"failed"===e?"localKnowledge.detail.jobs.status.failed":"localKnowledge.detail.jobs.status.cancelled");}function en(e){let{epochMs:t}=e,a=(0,s.toSafeIsoString)(t);return(0,l.jsx)("time",{...(void 0===a?{}:{dateTime:a}),children:S(t)});}function eo(e){let{job:t,t:a}=e,n=void 0!==t.finishedAt?(0,s.formatDurationCompact)(t.finishedAt-t.startedAt):a("localKnowledge.detail.jobs.inProgress");return(0,l.jsxs)("li",{className:"lkd-job-row",title:a("localKnowledge.detail.help.jobRow"),"aria-label":a("localKnowledge.detail.jobs.rowAria",{id:t.id,status:ea(t.status,a)}),children:[(0,l.jsx)("span",{className:"lkd-job-status","data-status":t.status,children:ea(t.status,a)}),(0,l.jsxs)("span",{className:"lkd-job-dates",children:[(0,l.jsx)(en,{epochMs:t.startedAt}),void 0!==t.finishedAt?(0,l.jsxs)(l.Fragment,{children:[" — ",(0,l.jsx)(en,{epochMs:t.finishedAt})]}):null]}),(0,l.jsx)("span",{className:"lkd-job-duration",children:n}),(0,l.jsxs)("div",{className:"lkd-source-counts","aria-label":a("localKnowledge.detail.documentCounts"),children:[(0,l.jsx)("span",{className:"lkd-count lkd-count-ok",children:a("localKnowledge.detail.counts.processed",{count:t.processedDocuments})}),(0,l.jsx)("span",{className:"lkd-count lkd-count-fail",children:a("localKnowledge.detail.counts.failed",{count:t.failedDocuments})}),(0,l.jsx)("span",{className:"lkd-count lkd-count-skip",children:a("localKnowledge.detail.counts.skipped",{count:t.skippedDocuments})})]}),void 0!==t.lastError?(0,l.jsxs)("div",{className:"lkd-job-error",children:[(0,l.jsx)("span",{children:t.lastError.code}),(0,l.jsx)("span",{children:t.lastError.message})]}):null]});}function ei(e){let{jobs:t}=e,a=(0,d.useLocalKnowledgeTranslate)(),{visibleCount:n,showAll:o,setShowAll:i}=M(t.length),s=t.slice(0,n),c=t.length-s.length;return(0,l.jsxs)("section",{"aria-labelledby":"lkd-jobs-heading",children:[(0,l.jsx)(L,{help:a("localKnowledge.detail.help.jobs"),children:(0,l.jsx)("span",{id:"lkd-jobs-heading",children:a("localKnowledge.detail.jobs.title")})}),0===t.length?(0,l.jsx)("p",{className:"lkd-empty-note",children:a("localKnowledge.detail.jobs.empty")}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("ul",{className:"lkd-list","aria-label":a("localKnowledge.detail.jobs.list"),children:s.map(e=>(0,l.jsx)(eo,{job:e,t:a},e.id))}),(0,l.jsx)(F,{hiddenCount:c,noun:a("localKnowledge.detail.rows.jobs"),showAll:o,onToggle:()=>i(!o),t:a})]})]});}function es(e,l){return l("preflight"===e?"localKnowledge.detail.large.phase.preflight":"extracting"===e?"localKnowledge.detail.large.phase.extracting":"extracted"===e?"localKnowledge.detail.large.phase.extracted":"chunking"===e?"localKnowledge.detail.large.phase.chunking":"chunked"===e?"localKnowledge.detail.large.phase.chunked":"embedding"===e?"localKnowledge.detail.large.phase.embedding":"embedded"===e?"localKnowledge.detail.large.phase.embedded":"complete"===e?"localKnowledge.detail.large.phase.complete":"cancelled"===e?"localKnowledge.detail.large.phase.cancelled":"localKnowledge.detail.large.phase.failed");}function ed(e){let{capsuleId:a,recovery:n,onActionComplete:o,resumeImpl:s}=e,c=(0,d.useLocalKnowledgeTranslate)(),[r,u]=(0,t.useState)(!1),[p,m]=(0,t.useState)(null);async function g(){u(!0),m(null);try{await(null!=s?s:i.resumeCapsuleLargeDocuments)(a,n.jobId),o();}catch(e){m(e instanceof Error?e.message:c("localKnowledge.detail.recovery.failed"));}finally{u(!1);}}return(0,l.jsxs)("section",{className:"lkd-status-section","aria-labelledby":"lkd-indexing-recovery-heading",children:[(0,l.jsx)("h2",{id:"lkd-indexing-recovery-heading",children:c("localKnowledge.detail.recovery.title")}),(0,l.jsx)("p",{role:"status","aria-live":"polite",children:c(`localKnowledge.detail.recovery.${n.state}`,{sources:n.sourceCount,processed:n.processedDocuments})}),"resumable"===n.state?(0,l.jsx)("button",{type:"button",className:"lk-action-button",disabled:r,"aria-label":c("localKnowledge.detail.recovery.resumeAria"),onClick:()=>void g(),children:r?c("localKnowledge.detail.recovery.resuming"):c("localKnowledge.detail.recovery.resume")}):null,null!==p?(0,l.jsx)("div",{role:"alert",children:p}):null]});}function ec(e){var t;let{progress:a,t:n}=e;return(0,l.jsxs)("li",{className:"lkd-source-card",title:n("localKnowledge.detail.help.largeDocumentRow"),children:[(0,l.jsxs)("div",{className:"lkd-source-card-head",children:[(0,l.jsx)("div",{className:"lkd-source-name",title:a.safeDisplayName,children:a.safeDisplayName}),(0,l.jsx)("span",{className:"lkd-source-scope",children:es(a.phase,n)})]}),(0,l.jsxs)("div",{className:"lkd-metric-meta",children:[(0,l.jsx)("span",{"data-tone":"complete"===(t=a.coverage)?"ok":"none"===t?"danger":"warn",children:n("localKnowledge.detail.large.coverage",{coverage:a.coverage})})," · ",n("localKnowledge.detail.large.pages",{count:a.processedPages})," · ",n("localKnowledge.detail.large.chunksEmbedded",{embedded:a.embeddedChunkCount,chunks:a.chunkCount}),a.resumable?` \xb7 ${n("localKnowledge.detail.large.resumable")}`:""]})]});}function er(e){var a;let{capsuleId:o,health:s,onActionComplete:c,jobActive:r,resumeImpl:u}=e,p=(0,d.useLocalKnowledgeTranslate)(),[m,g]=(0,t.useState)(!1),[h,x]=(0,t.useState)(null);if(0===s.progress.length)return null;let b=s.progress.filter(e=>!(0,n.isTerminalExtractionPhase)(e.phase)).map(e=>es(e.phase,p));async function v(){g(!0),x(null);try{await(null!=u?u:i.resumeCapsuleLargeDocuments)(o),c();}catch(e){x(e instanceof Error?e.message:p("localKnowledge.detail.large.resumeFailed"));}finally{g(!1);}}return(0,l.jsxs)("section",{"aria-labelledby":"lkd-large-doc-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(L,{help:p("localKnowledge.detail.help.largeDocuments"),children:(0,l.jsx)("span",{id:"lkd-large-doc-heading",children:p("localKnowledge.detail.large.title")})}),(0,l.jsx)("span",{className:"lkd-live-note",role:"status","aria-live":"polite",children:b.length>0?p("localKnowledge.detail.large.inProgress",{phases:b.join(", ")}):p("localKnowledge.detail.large.idle")})]}),s.partialCoverageDocuments>0?(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":"warn",children:p(1===s.partialCoverageDocuments?"localKnowledge.detail.large.partialCoverage.one":"localKnowledge.detail.large.partialCoverage.many",{count:s.partialCoverageDocuments})}):null,(0,l.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":p("localKnowledge.detail.large.list"),children:s.progress.map(e=>(0,l.jsx)(ec,{progress:e,t:p},e.documentId))}),s.qualityWarnings.length>0?(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":p("localKnowledge.detail.large.qualityWarnings"),children:s.qualityWarnings.map(e=>(0,l.jsx)("li",{children:e},e))}):null,s.resumableDocuments.length>0?(0,l.jsx)("button",{type:"button",onClick:()=>{v();},disabled:m||r,"aria-label":p("localKnowledge.detail.large.resumeAria"),title:p("localKnowledge.detail.help.largeResume"),className:"lk-action-button",children:(a=s.resumableDocuments.length,m?p("localKnowledge.detail.large.resuming"):p(1===a?"localKnowledge.detail.large.resume.one":"localKnowledge.detail.large.resume.many",{count:a}))}):null,null!==h?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:h}):null]});}e.s(["CapsuleDetail",0,function(){var e,t,n,i,s,r,m,g;let h,{capsuleId:x,onDeleted:v,fetchDetailImpl:f,resumeImpl:k,updateContextualRetrievalImpl:j}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},K=(0,d.useLocalKnowledgeTranslate)(),C=(0,a.useSearchParams)(),S=(0,a.useRouter)(),_=null!=x?x:null!=(e=C.get("capsuleId"))?e:"",{data:D,loadStatus:I,loadError:T,reload:R,replaceData:P}=(0,u.useCapsuleDetail)(_,f),A=void 0===k?{}:{resumeImpl:k};return"loading"===I?(0,l.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:K("localKnowledge.detail.loading")}):"error"===I||null===D?""===_?(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[K("localKnowledge.detail.noSelection"),(0,l.jsx)(c.default,{href:"/local-knowledge",className:"lk-alert-retry",children:K("localKnowledge.detail.backToLocalKnowledge")})]}):(null==T?void 0:T.includes("NOT_FOUND"))===!0||(null==T?void 0:T.toLowerCase().includes("not found"))===!0?(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[K("localKnowledge.detail.notFound"),(0,l.jsx)(c.default,{href:"/local-knowledge",className:"lk-alert-retry",children:K("localKnowledge.overview.backToPods")})]}):(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[null!=T?T:K("localKnowledge.detail.loadFailed"),(0,l.jsx)("button",{type:"button",onClick:R,"aria-label":K("localKnowledge.detail.retryLoad"),className:"lk-alert-retry",children:K("common.retry")})]}):(0,l.jsxs)("div",{className:`lkd-content ${y.default.detailContent}`,children:[(0,l.jsxs)("header",{className:`lk-header ${y.default.podHeader}`,children:[(0,l.jsx)("h1",{className:`lk-title ${y.default.podTitle}`,children:D.capsule.displayName}),(0,l.jsx)(w,{capsuleId:_,displayName:D.capsule.displayName,...(void 0!==D.capsule.description?{description:D.capsule.description}:{}),onRenamed:R})]}),(0,l.jsx)(p.CapsuleActions,{capsuleId:_,capsuleDisplayName:D.capsule.displayName,sourceCount:D.sources.length,lifecycleState:D.capsule.lifecycleState,vectorCompatible:D.health.vectorCompatible,contextualRebuildRequired:null!=(t=null==(n=D.health.contextualRetrieval)?void 0:n.rebuildRequired)&&t,onActionComplete:R,onDeleted:function(e){void 0!==v?v(e):S.push("/local-knowledge");}}),(r=D.capsule.tags,m=D.sources,void 0===(h=void 0!==(0,o.parseHtmlManualSourceTagMetadata)(r)?null==(g=m[0])?void 0:g.sourceId:void 0)?null:(0,l.jsx)(b,{capsuleId:_,sourceId:h,onRefreshComplete:R})),(0,l.jsx)(U,{data:D}),void 0!==D.health.indexingRecovery?(0,l.jsx)(ed,{capsuleId:_,recovery:D.health.indexingRecovery,onActionComplete:R,...A}):null,(0,l.jsxs)("details",{className:y.default.advancedDisclosure,children:[(0,l.jsxs)("summary",{className:y.default.disclosureSummary,children:[(0,l.jsx)("span",{children:(0,l.jsx)(N.Explainable,{description:K("localKnowledge.detail.help.advanced"),children:K("localKnowledge.detail.advanced.summary")})}),(0,l.jsx)("span",{children:K("localKnowledge.detail.advanced.hint")}),(0,l.jsx)("span",{className:y.default.disclosureIcon,"aria-hidden":"true"})]}),(0,l.jsxs)("div",{className:y.default.advancedStack,children:[(0,l.jsx)($,{data:D}),(0,l.jsx)(Y,{data:D,onSaved:P,...(void 0!==j?{updateImpl:j}:{})}),void 0!==D.largeDocumentHealth?(0,l.jsx)(er,{capsuleId:_,health:D.largeDocumentHealth,onActionComplete:R,jobActive:"indexing"===D.capsule.lifecycleState||(null==(i=E(D))?void 0:i.status)==="running"||(null==(s=E(D))?void 0:s.status)==="queued",...A}):null,(0,l.jsx)(W,{capsuleId:_,sources:D.sources,onActionComplete:R}),(0,l.jsx)(G,{data:D}),(0,l.jsx)(Q,{}),(0,l.jsx)(et,{diagnostics:D.parserDiagnostics}),(0,l.jsx)(ei,{jobs:D.indexingJobs})]})]})]});}],80010);}]);
|