@borgee/agents-host 0.2.101 → 0.2.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +77 -5
  2. package/dist/agents-host.d.ts +8 -0
  3. package/dist/agents-host.js +355 -23
  4. package/dist/catalog-worker.js +21 -0
  5. package/dist/catalog-worker.js.map +7 -0
  6. package/dist/chat/chat-control-plane.d.ts +7 -2
  7. package/dist/chat/normalized-input.d.ts +9 -0
  8. package/dist/chat/normalized-input.js +24 -0
  9. package/dist/chat/sdk-chat-control-plane.d.ts +18 -3
  10. package/dist/chat/sdk-chat-control-plane.js +44 -9
  11. package/dist/cli-args.d.ts +1 -1
  12. package/dist/cli-args.js +13 -4
  13. package/dist/config.d.ts +3 -1
  14. package/dist/config.js +25 -0
  15. package/dist/context/injection.d.ts +16 -0
  16. package/dist/context/injection.js +37 -21
  17. package/dist/context/prompt.d.ts +12 -0
  18. package/dist/context/prompt.js +25 -0
  19. package/dist/context/turn-preparation.d.ts +2 -1
  20. package/dist/context/turn-preparation.js +15 -0
  21. package/dist/gateway/localhost-gateway.js +33 -8
  22. package/dist/hosted-turn-content.js +3 -2
  23. package/dist/local-config.js +34 -1
  24. package/dist/managed-daemon.js +15 -0
  25. package/dist/native-environment.d.ts +2 -0
  26. package/dist/native-environment.js +9 -0
  27. package/dist/native-protocol-types/codec.d.ts +49 -0
  28. package/dist/native-protocol-types/commands.d.ts +71 -0
  29. package/dist/native-protocol-types/compatibility.d.ts +5 -0
  30. package/dist/native-protocol-types/cursor.d.ts +7 -0
  31. package/dist/native-protocol-types/envelope.d.ts +1105 -0
  32. package/dist/native-protocol-types/file-changes.d.ts +20 -0
  33. package/dist/native-protocol-types/history.d.ts +487 -0
  34. package/dist/native-protocol-types/index.d.ts +18 -0
  35. package/dist/native-protocol-types/interactions.d.ts +619 -0
  36. package/dist/native-protocol-types/messages.d.ts +2482 -0
  37. package/dist/native-protocol-types/public-validation.d.ts +10 -0
  38. package/dist/native-protocol-types/remote-host-uplink.d.ts +67 -0
  39. package/dist/native-protocol-types/resources.d.ts +126 -0
  40. package/dist/native-protocol-types/session-settings.d.ts +22 -0
  41. package/dist/native-protocol-types/snapshot.d.ts +575 -0
  42. package/dist/native-protocol-types/timeline.d.ts +1503 -0
  43. package/dist/native-protocol-types/tool-result.d.ts +26 -0
  44. package/dist/native-protocol-types/uplink.d.ts +56 -0
  45. package/dist/native-protocol-types/version.d.ts +5 -0
  46. package/dist/native-provider-types/commands.d.ts +51 -0
  47. package/dist/native-provider-types/control.d.ts +192 -0
  48. package/dist/native-provider-types/file-changes.d.ts +9 -0
  49. package/dist/native-provider-types/index.d.ts +8 -0
  50. package/dist/native-provider-types/interactions.d.ts +7 -0
  51. package/dist/native-provider-types/observation.d.ts +209 -0
  52. package/dist/native-provider-types/provider.d.ts +124 -0
  53. package/dist/native-provider-types/session-settings.d.ts +17 -0
  54. package/dist/native-provider-types/testing.d.ts +27 -0
  55. package/dist/native-provider-types/tool-result.d.ts +21 -0
  56. package/dist/native-providers.d.ts +21 -0
  57. package/dist/native-providers.js +18402 -0
  58. package/dist/native-providers.js.map +7 -0
  59. package/dist/plugin-sdk.js +10640 -225
  60. package/dist/plugin-sdk.js.map +4 -4
  61. package/dist/policy/copilot-permission.js +1 -8
  62. package/dist/providers/copilot/sdk-session.js +8 -1
  63. package/dist/providers/create-provider.js +20 -0
  64. package/dist/providers/normalized/adapter.d.ts +107 -0
  65. package/dist/providers/normalized/adapter.js +1650 -0
  66. package/dist/providers/normalized/control-policy.d.ts +5 -0
  67. package/dist/providers/normalized/control-policy.js +12 -0
  68. package/dist/providers/normalized/interactions.d.ts +3 -0
  69. package/dist/providers/normalized/interactions.js +39 -0
  70. package/dist/providers/normalized/legacy-input-ownership.d.ts +34 -0
  71. package/dist/providers/normalized/legacy-input-ownership.js +123 -0
  72. package/dist/providers/normalized/session-management.d.ts +67 -0
  73. package/dist/providers/normalized/session-management.js +334 -0
  74. package/dist/providers/normalized/session-ownership.d.ts +3 -0
  75. package/dist/providers/normalized/session-ownership.js +90 -0
  76. package/dist/providers/provider-adapter.d.ts +43 -1
  77. package/dist/providers/provider-adapter.js +8 -0
  78. package/dist/types.d.ts +34 -9
  79. package/dist/vendor/agent-provider-codex/LICENSE +211 -0
  80. package/dist/vendor/agent-provider-codex/NOTICE +13 -0
  81. package/package.json +22 -13
  82. package/skills/borgee-agent/SKILL.md +1 -1
  83. package/skills/borgee-agent/scripts/borgee-agent.mjs +24 -3
  84. package/skills/borgee-agent/scripts/borgee-agent.py +28 -2
@@ -28,7 +28,7 @@ Commands:
28
28
  files
29
29
  Files visible in this channel.
30
30
  files cat <channel-path>
31
- Print one UTF-8 text file up to 64 KiB.
31
+ Print normalized UTF-8 text, or report extraction status and warnings.
32
32
  files download <channel-path> [--overwrite]
33
33
  Copy one file into execution.local_directory/.borgee/channel-files.
34
34
  files sync [<channel-path>] [--overwrite]
@@ -605,6 +605,32 @@ def call_gateway(credential: dict[str, str], request: dict[str, object]) -> obje
605
605
  return json.loads(body_text) if body_text else None
606
606
 
607
607
 
608
+ def require_extracted_text(result: object, path: str) -> str:
609
+ if isinstance(result, dict) and isinstance(result.get("text"), str):
610
+ return result["text"]
611
+ extraction = result.get("extraction") if isinstance(result, dict) else None
612
+ status = (
613
+ extraction.get("status")
614
+ if isinstance(extraction, dict) and isinstance(extraction.get("status"), str)
615
+ else "unavailable"
616
+ )
617
+ warnings = extraction.get("warnings") if isinstance(extraction, dict) else None
618
+ details = []
619
+ if isinstance(warnings, list):
620
+ for warning in warnings:
621
+ if not isinstance(warning, dict):
622
+ continue
623
+ code = warning.get("code") if isinstance(warning.get("code"), str) else "UNKNOWN"
624
+ message = (
625
+ warning.get("message")
626
+ if isinstance(warning.get("message"), str)
627
+ else "No details"
628
+ )
629
+ details.append(f"{code}: {message}")
630
+ detail = f"; {'; '.join(details)}" if details else ""
631
+ raise RuntimeError(f"Cannot print {path}: text extraction is {status}{detail}")
632
+
633
+
608
634
  def main() -> int:
609
635
  parsed = parse_args(sys.argv[1:])
610
636
  if parsed.get("help") is True:
@@ -617,7 +643,7 @@ def main() -> int:
617
643
  credential = read_gateway_credential(str(parsed["gateway_credential_path"]))
618
644
  result = call_gateway(credential, resolve_request(credential, parsed))
619
645
  if parsed["command"] == "files" and parsed["file_command"] == "cat":
620
- text = str(result["text"])
646
+ text = require_extracted_text(result, str(parsed["file_path"]))
621
647
  if not text.endswith("\n"):
622
648
  text += "\n"
623
649
  sys.stdout.buffer.write(text.encode("utf-8"))