@phigon/observer 8.0.2 → 8.2.0

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 (375) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +376 -303
  4. package/THIRD_PARTY_NOTICES.md +610 -0
  5. package/dist/bin/guardian-runner-darwin-amd64 +0 -0
  6. package/dist/bin/guardian-runner-darwin-arm64 +0 -0
  7. package/dist/bin/guardian-runner-linux-amd64 +0 -0
  8. package/dist/bin/guardian-runner-linux-arm64 +0 -0
  9. package/dist/bin/guardian-runner-windows-amd64.exe +0 -0
  10. package/dist/bin/guardian-runner-windows-arm64.exe +0 -0
  11. package/dist/src/action-policy.d.ts +0 -0
  12. package/dist/src/action-policy.d.ts.map +1 -1
  13. package/dist/src/action-policy.js +4 -2
  14. package/dist/src/action-policy.js.map +1 -1
  15. package/dist/src/activity/adapters/claude.d.ts +0 -0
  16. package/dist/src/activity/adapters/claude.d.ts.map +1 -1
  17. package/dist/src/activity/adapters/claude.js +19 -1
  18. package/dist/src/activity/adapters/claude.js.map +1 -1
  19. package/dist/src/activity/adapters/cline-task.d.ts +7 -0
  20. package/dist/src/activity/adapters/cline-task.d.ts.map +1 -0
  21. package/dist/src/activity/adapters/cline-task.js +197 -0
  22. package/dist/src/activity/adapters/cline-task.js.map +1 -0
  23. package/dist/src/activity/adapters/cline.d.ts +3 -0
  24. package/dist/src/activity/adapters/cline.d.ts.map +1 -0
  25. package/dist/src/activity/adapters/cline.js +102 -0
  26. package/dist/src/activity/adapters/cline.js.map +1 -0
  27. package/dist/src/activity/adapters/codex.d.ts +0 -0
  28. package/dist/src/activity/adapters/codex.d.ts.map +1 -1
  29. package/dist/src/activity/adapters/codex.js +76 -0
  30. package/dist/src/activity/adapters/codex.js.map +1 -1
  31. package/dist/src/activity/adapters/copilot-chat.d.ts +3 -0
  32. package/dist/src/activity/adapters/copilot-chat.d.ts.map +1 -0
  33. package/dist/src/activity/adapters/copilot-chat.js +176 -0
  34. package/dist/src/activity/adapters/copilot-chat.js.map +1 -0
  35. package/dist/src/activity/adapters/copilot.d.ts +2 -1
  36. package/dist/src/activity/adapters/copilot.d.ts.map +1 -1
  37. package/dist/src/activity/adapters/copilot.js +173 -2
  38. package/dist/src/activity/adapters/copilot.js.map +1 -1
  39. package/dist/src/activity/adapters/cursor.d.ts +3 -0
  40. package/dist/src/activity/adapters/cursor.d.ts.map +1 -0
  41. package/dist/src/activity/adapters/cursor.js +86 -0
  42. package/dist/src/activity/adapters/cursor.js.map +1 -0
  43. package/dist/src/activity/adapters/factory-droid.d.ts +3 -0
  44. package/dist/src/activity/adapters/factory-droid.d.ts.map +1 -0
  45. package/dist/src/activity/adapters/factory-droid.js +126 -0
  46. package/dist/src/activity/adapters/factory-droid.js.map +1 -0
  47. package/dist/src/activity/adapters/gemini.d.ts +3 -0
  48. package/dist/src/activity/adapters/gemini.d.ts.map +1 -0
  49. package/dist/src/activity/adapters/gemini.js +177 -0
  50. package/dist/src/activity/adapters/gemini.js.map +1 -0
  51. package/dist/src/activity/adapters/generic.d.ts +0 -0
  52. package/dist/src/activity/adapters/generic.d.ts.map +0 -0
  53. package/dist/src/activity/adapters/generic.js +0 -0
  54. package/dist/src/activity/adapters/generic.js.map +0 -0
  55. package/dist/src/activity/adapters/goose.d.ts +3 -0
  56. package/dist/src/activity/adapters/goose.d.ts.map +1 -0
  57. package/dist/src/activity/adapters/goose.js +116 -0
  58. package/dist/src/activity/adapters/goose.js.map +1 -0
  59. package/dist/src/activity/adapters/hermes.d.ts +0 -0
  60. package/dist/src/activity/adapters/hermes.d.ts.map +0 -0
  61. package/dist/src/activity/adapters/hermes.js +0 -0
  62. package/dist/src/activity/adapters/hermes.js.map +0 -0
  63. package/dist/src/activity/adapters/kiro.d.ts +3 -0
  64. package/dist/src/activity/adapters/kiro.d.ts.map +1 -0
  65. package/dist/src/activity/adapters/kiro.js +47 -0
  66. package/dist/src/activity/adapters/kiro.js.map +1 -0
  67. package/dist/src/activity/adapters/openai-compatible.d.ts +0 -0
  68. package/dist/src/activity/adapters/openai-compatible.d.ts.map +0 -0
  69. package/dist/src/activity/adapters/openai-compatible.js +0 -0
  70. package/dist/src/activity/adapters/openai-compatible.js.map +0 -0
  71. package/dist/src/activity/adapters/openclaw.d.ts +0 -0
  72. package/dist/src/activity/adapters/openclaw.d.ts.map +0 -0
  73. package/dist/src/activity/adapters/openclaw.js +0 -0
  74. package/dist/src/activity/adapters/openclaw.js.map +0 -0
  75. package/dist/src/activity/adapters/opencode.d.ts +0 -0
  76. package/dist/src/activity/adapters/opencode.d.ts.map +1 -1
  77. package/dist/src/activity/adapters/opencode.js +108 -1
  78. package/dist/src/activity/adapters/opencode.js.map +1 -1
  79. package/dist/src/activity/adapters/zed.d.ts +3 -0
  80. package/dist/src/activity/adapters/zed.d.ts.map +1 -0
  81. package/dist/src/activity/adapters/zed.js +134 -0
  82. package/dist/src/activity/adapters/zed.js.map +1 -0
  83. package/dist/src/activity/bridges.d.ts +0 -0
  84. package/dist/src/activity/bridges.d.ts.map +0 -0
  85. package/dist/src/activity/bridges.js +0 -0
  86. package/dist/src/activity/bridges.js.map +0 -0
  87. package/dist/src/activity/collector.d.ts +12 -0
  88. package/dist/src/activity/collector.d.ts.map +1 -1
  89. package/dist/src/activity/collector.js +156 -3
  90. package/dist/src/activity/collector.js.map +1 -1
  91. package/dist/src/activity/goose-sqlite-source.d.ts +33 -0
  92. package/dist/src/activity/goose-sqlite-source.d.ts.map +1 -0
  93. package/dist/src/activity/goose-sqlite-source.js +274 -0
  94. package/dist/src/activity/goose-sqlite-source.js.map +1 -0
  95. package/dist/src/activity/index.d.ts +3 -0
  96. package/dist/src/activity/index.d.ts.map +1 -1
  97. package/dist/src/activity/index.js +3 -0
  98. package/dist/src/activity/index.js.map +1 -1
  99. package/dist/src/activity/ingest.d.ts +0 -0
  100. package/dist/src/activity/ingest.d.ts.map +1 -1
  101. package/dist/src/activity/ingest.js +2 -1
  102. package/dist/src/activity/ingest.js.map +1 -1
  103. package/dist/src/activity/json-document-source.d.ts +136 -0
  104. package/dist/src/activity/json-document-source.d.ts.map +1 -0
  105. package/dist/src/activity/json-document-source.js +569 -0
  106. package/dist/src/activity/json-document-source.js.map +1 -0
  107. package/dist/src/activity/native-capabilities.d.ts +0 -0
  108. package/dist/src/activity/native-capabilities.d.ts.map +0 -0
  109. package/dist/src/activity/native-capabilities.js +0 -0
  110. package/dist/src/activity/native-capabilities.js.map +0 -0
  111. package/dist/src/activity/normalize.d.ts +0 -0
  112. package/dist/src/activity/normalize.d.ts.map +1 -1
  113. package/dist/src/activity/normalize.js +64 -6
  114. package/dist/src/activity/normalize.js.map +1 -1
  115. package/dist/src/activity/opencode-message-tables.d.ts +87 -0
  116. package/dist/src/activity/opencode-message-tables.d.ts.map +1 -0
  117. package/dist/src/activity/opencode-message-tables.js +546 -0
  118. package/dist/src/activity/opencode-message-tables.js.map +1 -0
  119. package/dist/src/activity/opencode-sqlite-source.d.ts +7 -0
  120. package/dist/src/activity/opencode-sqlite-source.d.ts.map +1 -1
  121. package/dist/src/activity/opencode-sqlite-source.js +153 -63
  122. package/dist/src/activity/opencode-sqlite-source.js.map +1 -1
  123. package/dist/src/activity/policy.d.ts +0 -0
  124. package/dist/src/activity/policy.d.ts.map +1 -1
  125. package/dist/src/activity/policy.js +2 -13
  126. package/dist/src/activity/policy.js.map +1 -1
  127. package/dist/src/activity/record.d.ts +0 -0
  128. package/dist/src/activity/record.d.ts.map +0 -0
  129. package/dist/src/activity/record.js +0 -0
  130. package/dist/src/activity/record.js.map +0 -0
  131. package/dist/src/activity/source-reader.d.ts +16 -1
  132. package/dist/src/activity/source-reader.d.ts.map +1 -1
  133. package/dist/src/activity/source-reader.js +308 -29
  134. package/dist/src/activity/source-reader.js.map +1 -1
  135. package/dist/src/activity/sqlite-connections.d.ts +77 -0
  136. package/dist/src/activity/sqlite-connections.d.ts.map +1 -0
  137. package/dist/src/activity/sqlite-connections.js +220 -0
  138. package/dist/src/activity/sqlite-connections.js.map +1 -0
  139. package/dist/src/activity/types.d.ts +0 -0
  140. package/dist/src/activity/types.d.ts.map +0 -0
  141. package/dist/src/activity/types.js +0 -0
  142. package/dist/src/activity/types.js.map +0 -0
  143. package/dist/src/activity/zed-sqlite-source.d.ts +65 -0
  144. package/dist/src/activity/zed-sqlite-source.d.ts.map +1 -0
  145. package/dist/src/activity/zed-sqlite-source.js +547 -0
  146. package/dist/src/activity/zed-sqlite-source.js.map +1 -0
  147. package/dist/src/agent-action-executor.d.ts +14 -1
  148. package/dist/src/agent-action-executor.d.ts.map +1 -1
  149. package/dist/src/agent-action-executor.js +114 -57
  150. package/dist/src/agent-action-executor.js.map +1 -1
  151. package/dist/src/agentic-guardian.d.ts +0 -0
  152. package/dist/src/agentic-guardian.d.ts.map +1 -1
  153. package/dist/src/agentic-guardian.js +6 -5
  154. package/dist/src/agentic-guardian.js.map +1 -1
  155. package/dist/src/atomic-replace.d.ts +0 -0
  156. package/dist/src/atomic-replace.d.ts.map +0 -0
  157. package/dist/src/atomic-replace.js +0 -0
  158. package/dist/src/atomic-replace.js.map +0 -0
  159. package/dist/src/cli.d.ts +0 -0
  160. package/dist/src/cli.d.ts.map +1 -1
  161. package/dist/src/cli.js +96 -13
  162. package/dist/src/cli.js.map +1 -1
  163. package/dist/src/config.d.ts +15 -0
  164. package/dist/src/config.d.ts.map +1 -1
  165. package/dist/src/config.js +105 -4
  166. package/dist/src/config.js.map +1 -1
  167. package/dist/src/connection-config.d.ts +3 -0
  168. package/dist/src/connection-config.d.ts.map +1 -0
  169. package/dist/src/connection-config.js +29 -0
  170. package/dist/src/connection-config.js.map +1 -0
  171. package/dist/src/content-redaction.d.ts +3 -0
  172. package/dist/src/content-redaction.d.ts.map +1 -0
  173. package/dist/src/content-redaction.js +19 -0
  174. package/dist/src/content-redaction.js.map +1 -0
  175. package/dist/src/credential-store.d.ts +1 -0
  176. package/dist/src/credential-store.d.ts.map +1 -1
  177. package/dist/src/credential-store.js +13 -2
  178. package/dist/src/credential-store.js.map +1 -1
  179. package/dist/src/custom-agent-registry.d.ts +0 -0
  180. package/dist/src/custom-agent-registry.d.ts.map +1 -1
  181. package/dist/src/custom-agent-registry.js +2 -1
  182. package/dist/src/custom-agent-registry.js.map +1 -1
  183. package/dist/src/discovery/adapters/claude.d.ts +0 -0
  184. package/dist/src/discovery/adapters/claude.d.ts.map +0 -0
  185. package/dist/src/discovery/adapters/claude.js +0 -0
  186. package/dist/src/discovery/adapters/claude.js.map +0 -0
  187. package/dist/src/discovery/adapters/codex.d.ts +0 -0
  188. package/dist/src/discovery/adapters/codex.d.ts.map +0 -0
  189. package/dist/src/discovery/adapters/codex.js +0 -0
  190. package/dist/src/discovery/adapters/codex.js.map +0 -0
  191. package/dist/src/discovery/adapters/custom.d.ts +0 -0
  192. package/dist/src/discovery/adapters/custom.d.ts.map +0 -0
  193. package/dist/src/discovery/adapters/custom.js +0 -0
  194. package/dist/src/discovery/adapters/custom.js.map +0 -0
  195. package/dist/src/discovery/adapters/generic.d.ts +0 -0
  196. package/dist/src/discovery/adapters/generic.d.ts.map +1 -1
  197. package/dist/src/discovery/adapters/generic.js +160 -2
  198. package/dist/src/discovery/adapters/generic.js.map +1 -1
  199. package/dist/src/discovery/adapters/hermes.d.ts +0 -0
  200. package/dist/src/discovery/adapters/hermes.d.ts.map +0 -0
  201. package/dist/src/discovery/adapters/hermes.js +0 -0
  202. package/dist/src/discovery/adapters/hermes.js.map +0 -0
  203. package/dist/src/discovery/adapters/openclaw.d.ts +0 -0
  204. package/dist/src/discovery/adapters/openclaw.d.ts.map +0 -0
  205. package/dist/src/discovery/adapters/openclaw.js +0 -0
  206. package/dist/src/discovery/adapters/openclaw.js.map +0 -0
  207. package/dist/src/discovery/engine.d.ts +7 -1
  208. package/dist/src/discovery/engine.d.ts.map +1 -1
  209. package/dist/src/discovery/engine.js +20 -5
  210. package/dist/src/discovery/engine.js.map +1 -1
  211. package/dist/src/discovery/evidence.d.ts +0 -0
  212. package/dist/src/discovery/evidence.d.ts.map +0 -0
  213. package/dist/src/discovery/evidence.js +0 -0
  214. package/dist/src/discovery/evidence.js.map +0 -0
  215. package/dist/src/discovery/index.d.ts +0 -0
  216. package/dist/src/discovery/index.d.ts.map +0 -0
  217. package/dist/src/discovery/index.js +0 -0
  218. package/dist/src/discovery/index.js.map +0 -0
  219. package/dist/src/discovery/known-agent.d.ts +7 -0
  220. package/dist/src/discovery/known-agent.d.ts.map +1 -1
  221. package/dist/src/discovery/known-agent.js +9 -4
  222. package/dist/src/discovery/known-agent.js.map +1 -1
  223. package/dist/src/discovery/process-identity.d.ts +0 -0
  224. package/dist/src/discovery/process-identity.d.ts.map +0 -0
  225. package/dist/src/discovery/process-identity.js +0 -0
  226. package/dist/src/discovery/process-identity.js.map +0 -0
  227. package/dist/src/discovery/system-evidence.d.ts +40 -1
  228. package/dist/src/discovery/system-evidence.d.ts.map +1 -1
  229. package/dist/src/discovery/system-evidence.js +189 -16
  230. package/dist/src/discovery/system-evidence.js.map +1 -1
  231. package/dist/src/discovery/types.d.ts +0 -0
  232. package/dist/src/discovery/types.d.ts.map +0 -0
  233. package/dist/src/discovery/types.js +0 -0
  234. package/dist/src/discovery/types.js.map +0 -0
  235. package/dist/src/event-queue.d.ts +0 -0
  236. package/dist/src/event-queue.d.ts.map +1 -1
  237. package/dist/src/event-queue.js +88 -38
  238. package/dist/src/event-queue.js.map +1 -1
  239. package/dist/src/event-spool.d.ts +0 -0
  240. package/dist/src/event-spool.d.ts.map +1 -1
  241. package/dist/src/event-spool.js +58 -10
  242. package/dist/src/event-spool.js.map +1 -1
  243. package/dist/src/generated/phigon/v1/action_pb.d.ts +0 -0
  244. package/dist/src/generated/phigon/v1/action_pb.d.ts.map +1 -1
  245. package/dist/src/generated/phigon/v1/action_pb.js +1 -1
  246. package/dist/src/generated/phigon/v1/action_pb.js.map +1 -1
  247. package/dist/src/generated/phigon/v1/common_pb.d.ts +0 -0
  248. package/dist/src/generated/phigon/v1/common_pb.d.ts.map +1 -1
  249. package/dist/src/generated/phigon/v1/common_pb.js +1 -1
  250. package/dist/src/generated/phigon/v1/common_pb.js.map +1 -1
  251. package/dist/src/generated/phigon/v1/history_sync_pb.d.ts +0 -0
  252. package/dist/src/generated/phigon/v1/history_sync_pb.d.ts.map +1 -1
  253. package/dist/src/generated/phigon/v1/history_sync_pb.js +1 -1
  254. package/dist/src/generated/phigon/v1/history_sync_pb.js.map +1 -1
  255. package/dist/src/generated/phigon/v1/identity_pb.d.ts +0 -0
  256. package/dist/src/generated/phigon/v1/identity_pb.d.ts.map +1 -1
  257. package/dist/src/generated/phigon/v1/identity_pb.js +1 -1
  258. package/dist/src/generated/phigon/v1/identity_pb.js.map +1 -1
  259. package/dist/src/generated/phigon/v1/observer_service_pb.d.ts +0 -0
  260. package/dist/src/generated/phigon/v1/observer_service_pb.d.ts.map +1 -1
  261. package/dist/src/generated/phigon/v1/observer_service_pb.js +1 -1
  262. package/dist/src/generated/phigon/v1/observer_service_pb.js.map +1 -1
  263. package/dist/src/generated/phigon/v1/policy_pb.d.ts +0 -0
  264. package/dist/src/generated/phigon/v1/policy_pb.d.ts.map +1 -1
  265. package/dist/src/generated/phigon/v1/policy_pb.js +1 -1
  266. package/dist/src/generated/phigon/v1/policy_pb.js.map +1 -1
  267. package/dist/src/generated/phigon/v1/supervision_pb.d.ts +0 -0
  268. package/dist/src/generated/phigon/v1/supervision_pb.d.ts.map +1 -1
  269. package/dist/src/generated/phigon/v1/supervision_pb.js +1 -1
  270. package/dist/src/generated/phigon/v1/supervision_pb.js.map +1 -1
  271. package/dist/src/generated/phigon/v1/telemetry_pb.d.ts +0 -0
  272. package/dist/src/generated/phigon/v1/telemetry_pb.d.ts.map +1 -1
  273. package/dist/src/generated/phigon/v1/telemetry_pb.js +1 -1
  274. package/dist/src/generated/phigon/v1/telemetry_pb.js.map +1 -1
  275. package/dist/src/guardian-containment.d.ts +2 -6
  276. package/dist/src/guardian-containment.d.ts.map +1 -1
  277. package/dist/src/guardian-containment.js +12 -63
  278. package/dist/src/guardian-containment.js.map +1 -1
  279. package/dist/src/guardian-decision-journal.d.ts +0 -0
  280. package/dist/src/guardian-decision-journal.d.ts.map +1 -1
  281. package/dist/src/guardian-decision-journal.js +2 -1
  282. package/dist/src/guardian-decision-journal.js.map +1 -1
  283. package/dist/src/guardian-execution-manifest.d.ts +0 -0
  284. package/dist/src/guardian-execution-manifest.d.ts.map +0 -0
  285. package/dist/src/guardian-execution-manifest.js +0 -0
  286. package/dist/src/guardian-execution-manifest.js.map +0 -0
  287. package/dist/src/guardian-hosted-client.d.ts +0 -0
  288. package/dist/src/guardian-hosted-client.d.ts.map +0 -0
  289. package/dist/src/guardian-hosted-client.js +0 -0
  290. package/dist/src/guardian-hosted-client.js.map +0 -0
  291. package/dist/src/guardian-managed-exec.d.ts +0 -0
  292. package/dist/src/guardian-managed-exec.d.ts.map +1 -1
  293. package/dist/src/guardian-managed-exec.js +2 -1
  294. package/dist/src/guardian-managed-exec.js.map +1 -1
  295. package/dist/src/guardian-model-bridge.d.ts +0 -0
  296. package/dist/src/guardian-model-bridge.d.ts.map +1 -1
  297. package/dist/src/guardian-model-bridge.js +2 -1
  298. package/dist/src/guardian-model-bridge.js.map +1 -1
  299. package/dist/src/guardian-native.d.ts +0 -1
  300. package/dist/src/guardian-native.d.ts.map +1 -1
  301. package/dist/src/guardian-native.js +0 -6
  302. package/dist/src/guardian-native.js.map +1 -1
  303. package/dist/src/guardian-process-monitor.d.ts +6 -1
  304. package/dist/src/guardian-process-monitor.d.ts.map +1 -1
  305. package/dist/src/guardian-process-monitor.js +64 -8
  306. package/dist/src/guardian-process-monitor.js.map +1 -1
  307. package/dist/src/health.d.ts +0 -0
  308. package/dist/src/health.d.ts.map +0 -0
  309. package/dist/src/health.js +0 -0
  310. package/dist/src/health.js.map +0 -0
  311. package/dist/src/historical-identity-store.d.ts +0 -0
  312. package/dist/src/historical-identity-store.d.ts.map +1 -1
  313. package/dist/src/historical-identity-store.js +2 -1
  314. package/dist/src/historical-identity-store.js.map +1 -1
  315. package/dist/src/index.d.ts +0 -0
  316. package/dist/src/index.d.ts.map +0 -0
  317. package/dist/src/index.js +0 -0
  318. package/dist/src/index.js.map +0 -0
  319. package/dist/src/installation.d.ts +0 -0
  320. package/dist/src/installation.d.ts.map +1 -1
  321. package/dist/src/installation.js +3 -2
  322. package/dist/src/installation.js.map +1 -1
  323. package/dist/src/machine-command-executor.d.ts +26 -7
  324. package/dist/src/machine-command-executor.d.ts.map +1 -1
  325. package/dist/src/machine-command-executor.js +123 -21
  326. package/dist/src/machine-command-executor.js.map +1 -1
  327. package/dist/src/pair.d.ts +0 -0
  328. package/dist/src/pair.d.ts.map +1 -1
  329. package/dist/src/pair.js +13 -3
  330. package/dist/src/pair.js.map +1 -1
  331. package/dist/src/private-directory.d.ts +4 -0
  332. package/dist/src/private-directory.d.ts.map +1 -0
  333. package/dist/src/private-directory.js +35 -0
  334. package/dist/src/private-directory.js.map +1 -0
  335. package/dist/src/process-tree.d.ts +73 -0
  336. package/dist/src/process-tree.d.ts.map +1 -0
  337. package/dist/src/process-tree.js +256 -0
  338. package/dist/src/process-tree.js.map +1 -0
  339. package/dist/src/remove-machine.d.ts +0 -0
  340. package/dist/src/remove-machine.d.ts.map +0 -0
  341. package/dist/src/remove-machine.js +0 -0
  342. package/dist/src/remove-machine.js.map +0 -0
  343. package/dist/src/server-authority.d.ts +26 -0
  344. package/dist/src/server-authority.d.ts.map +1 -0
  345. package/dist/src/server-authority.js +102 -0
  346. package/dist/src/server-authority.js.map +1 -0
  347. package/dist/src/stream-client.d.ts +6 -2
  348. package/dist/src/stream-client.d.ts.map +1 -1
  349. package/dist/src/stream-client.js +95 -16
  350. package/dist/src/stream-client.js.map +1 -1
  351. package/dist/src/stream-state.d.ts +0 -0
  352. package/dist/src/stream-state.d.ts.map +1 -1
  353. package/dist/src/stream-state.js +2 -1
  354. package/dist/src/stream-state.js.map +1 -1
  355. package/dist/src/system-inspection.d.ts +78 -0
  356. package/dist/src/system-inspection.d.ts.map +1 -0
  357. package/dist/src/system-inspection.js +281 -0
  358. package/dist/src/system-inspection.js.map +1 -0
  359. package/dist/src/update.d.ts +15 -0
  360. package/dist/src/update.d.ts.map +1 -0
  361. package/dist/src/update.js +93 -0
  362. package/dist/src/update.js.map +1 -0
  363. package/dist/src/user-notices.d.ts +53 -0
  364. package/dist/src/user-notices.d.ts.map +1 -0
  365. package/dist/src/user-notices.js +117 -0
  366. package/dist/src/user-notices.js.map +1 -0
  367. package/package.json +83 -78
  368. package/scripts/install.mjs +306 -306
  369. package/scripts/managed-service.mjs +0 -0
  370. package/scripts/verify-guardian-release.mjs +0 -0
  371. package/scripts/windows-app-control.mjs +0 -0
  372. package/dist/src/windows-process.d.ts +0 -7
  373. package/dist/src/windows-process.d.ts.map +0 -1
  374. package/dist/src/windows-process.js +0 -18
  375. package/dist/src/windows-process.js.map +0 -1
package/README.md CHANGED
@@ -1,303 +1,376 @@
1
- <p align="center">
2
- <a href="https://phigon.online">
3
- <picture>
4
- <source media="(prefers-color-scheme: dark)" srcset="https://phigon.online/brand/phigon-white.svg" />
5
- <img src="https://phigon.online/brand/phigon-black.svg" alt="Phigon" width="72" />
6
- </picture>
7
- </a>
8
- </p>
9
-
10
- # Phigon Observer
11
-
12
- Connect your AI coding agents to [Phigon](https://phigon.online), the
13
- consent-based supervision workspace for authorized AI activity.
14
-
15
- Phigon helps you see:
16
-
17
- - which approved machines are connected;
18
- - which AI agents are installed or running;
19
- - current activity and agent health;
20
- - saved agent threads and history when sharing is approved.
21
-
22
- Phigon is consent-based. The observer starts with privacy-safe metadata only,
23
- and sensitive activity remains protected unless the machine owner approves it.
24
-
25
- ## Install and connect
26
-
27
- Requires **Node.js 24 or newer** with npm. Releases include Guardian runners for
28
- Windows, macOS, and Linux on x64 and ARM64. Go is not required to install.
29
-
30
- ```sh
31
- npm install --global @phigon/observer
32
- ```
33
-
34
- 1. Sign in to [Phigon](https://phigon.online) and select **Connect machine**.
35
- 2. Choose **Metadata** or **Full activity**, then generate a one-time code.
36
- 3. Run the pairing and monitoring commands shown in the connection dialog on
37
- the machine you administer. The machine owner reviews and accepts the scope.
38
-
39
- For metadata-only monitoring:
40
-
41
- ```sh
42
- phigon-observer pair --code YOUR-CODE --consent-profile metadata
43
- phigon-observer run --profile metadata
44
- ```
45
-
46
- For supported conversations, commands, outputs, and past-history import, select
47
- Full activity in Phigon and use the matching profile:
48
-
49
- ```sh
50
- phigon-observer pair --code YOUR-CODE --consent-profile full
51
- phigon-observer run --profile full
52
- ```
53
-
54
- `YOUR-CODE` is the one-time code from your workspace. Keep the observer process
55
- running for live collection. Closing the dashboard does not stop capture;
56
- stopping the observer does. Full activity still requires matching workspace
57
- policy and local consent, and secrets are redacted before delivery.
58
-
59
- Check installation and connection health with:
60
-
61
- ```sh
62
- phigon-observer doctor --json
63
- ```
64
-
65
- ### Upgrade from the previous npm package
66
-
67
- The maintained package is now **`@phigon/observer`**, published under the
68
- `phigon` npm account. The executable is still **`phigon-observer`**.
69
- The old unscoped package will not automatically switch to the new package.
70
-
71
- Stop your observer process or managed service, then run:
72
-
73
- ```sh
74
- npm uninstall --global phigon-observer
75
- npm install --global @phigon/observer
76
- phigon-observer doctor --json
77
- ```
78
-
79
- Restart with the same collection profile and environment as before. Keep your
80
- existing Phigon data directory: npm package replacement does not require a new
81
- pairing or removal of machine credentials. Managed-service installations may
82
- need their executable path updated to the new global install location. To
83
- update future releases, run `npm install --global @phigon/observer@latest`.
84
-
85
- To monitor an agent that does not have a built-in adapter, register its local
86
- signals once. Definitions are reloaded on every discovery and activity scan:
87
-
88
- ```sh
89
- phigon-observer agent add \
90
- --id release-bot \
91
- --name "Release Bot" \
92
- --executable release-bot \
93
- --process release-bot-worker \
94
- --config-path ~/.release-bot \
95
- --activity-dir ~/.release-bot/sessions
96
- ```
97
-
98
- Use `phigon-observer agent list` to inspect the active definitions and
99
- `phigon-observer agent remove --id release-bot` to stop using one. Custom
100
- activity remains visibly source-isolated unless independent process-lifetime
101
- evidence proves one exact match. Activity directories accept bounded JSONL and
102
- expand `~/` against the current user's home directory. Paths must be absolute
103
- or home-relative, activity roots must be narrowly scoped, and overlapping
104
- identity or activity signals are rejected instead of guessed.
105
-
106
- To disconnect and unregister the paired machine from that machine itself:
107
-
108
- ```sh
109
- phigon-observer remove-machine
110
- ```
111
-
112
- The command requires local confirmation, revokes the machine credential, and
113
- clears it only after the control plane confirms removal. Workspace retention
114
- and administrator-managed historical data deletion remain separate controls.
115
-
116
- Return to [Phigon](https://phigon.online) to view the machine, grouped AI
117
- agents, live status, health, and available history.
118
-
119
- ## Past conversations and live capture
120
-
121
- When a machine owner pairs with Full activity consent and runs with `--profile
122
- full`, the observer automatically imports supported past conversations. It
123
- resumes that import after a restart. Past chats appear directly in Conversations;
124
- new prompts, replies, and tool activity are captured independently in real time.
125
- Administrators can request another archive scan through the authenticated
126
- `POST /v1/machines/{id}/history-syncs` API. A manual scan reports success only
127
- after the server acknowledges its final event. Only permitted, locally redacted
128
- source content is collected; private provider-encrypted reasoning is not decoded.
129
-
130
- The dashboard does not need to stay open. Normal live monitoring and queued
131
- history jobs are driven by the observer process. Local state is limited to
132
- source checkpoints and an encrypted delivery spool; hosted history remains on
133
- the server and duplicate source records are suppressed across retries.
134
-
135
- ## Optional agent actions
136
-
137
- Remote agent actions are disabled on every machine by default. A machine owner
138
- may opt in to the typed Action Center executor before starting the observer:
139
-
140
- ```sh
141
- PHIGON_REMOTE_ACTIONS_ENABLED=true phigon-observer run
142
- ```
143
-
144
- This capability accepts graceful stop and force stop for one exact reported
145
- agent process lifetime. An operator proposal and separate administrator
146
- confirmation are required, commands expire quickly, the observer refreshes
147
- local discovery before signaling, and it persists an idempotent terminal
148
- receipt. This setting does not enable shell commands, file access, screen or
149
- camera capture, or general remote control. Windows graceful stop uses
150
- `taskkill.exe /PID` without the force flag and never silently escalates;
151
- Unix-like systems use `SIGTERM`. Force stop remains a separately approved
152
- capability on every supported platform.
153
-
154
- To additionally enroll this machine for administrator-reviewed system operations,
155
- set `PHIGON_REMOTE_COMMANDS_ENABLED=true` before starting the observer. This
156
- separate capability enables executable/argument commands, current system
157
- inspection, and scheduled shutdown/restart through Actions and Cortex. Commands
158
- run as the observer account, require an exact administrator review, expire before
159
- dispatch, have a 1–120 second limit, and return at most 32 KB of redacted output.
160
- A durable execution journal prevents retrying a previously claimed command after
161
- a crash. A power receipt means a one-minute change was scheduled, not that the
162
- machine already powered off. See [the administration guide](https://github.com/imthegoodboy/Phigon/blob/imp/docs/admin-controls-upgrade.md).
163
-
164
- Managed agent integrations can request the hosted fail-closed Guardian decision
165
- before performing an action:
166
-
167
- ```sh
168
- phigon-observer authorize-action \
169
- --agent codex:worker-1 \
170
- --action command.execute \
171
- --resource "git status" \
172
- --context-file ./phigon-action-context.json \
173
- --json
174
- ```
175
-
176
- The optional context file is bounded JSON with `task_id`, `proposal_id`,
177
- `plan_step_id`, `user_prompt`, `agent_plan`, `justification`,
178
- `expected_effect`, and `recent_activity` fields. These are explicit integration
179
- evidence, not private model chain-of-thought. The gateway
180
- returns exit code 0 only for an allow. A deny, approval requirement, or
181
- unavailable semantic decision returns exit code 77, together with a message
182
- for the agent. A deny or approval also carries the exact authoritative
183
- administrator contract returned by the control plane. Every decision is appended
184
- to the observer's generic activity bridge so normal background telemetry can
185
- store it even when the dashboard is closed.
186
-
187
- For a running agent, integrations should also pass the discovered
188
- `--process-id` and `--process-started-at` together. The control plane binds that
189
- pair to fresh machine inventory before honoring agent-specific scope. Without
190
- that proof it evaluates conservatively across all potentially relevant
191
- agent-scoped contracts; a caller-supplied agent label cannot remove a policy.
192
-
193
- When a semantic contract requires approval, the hosted control plane creates a
194
- durable request bound to the exact policy digest, action, resource, contract,
195
- and evidence envelope. An administrator can approve or reject it in Guardian.
196
- Retrying the unchanged proposal after approval consumes a single-use grant;
197
- another execution requires a new `proposal_id`.
198
-
199
- For CLI agents, run commands through the managed execution boundary so the
200
- same pre-action decision is mandatory and command input, streamed output, and
201
- the final exit are captured by the normal background telemetry pipeline:
202
-
203
- ```sh
204
- phigon-observer guardian exec \
205
- --agent codex:worker-1 \
206
- --context-file ./phigon-action-context.json \
207
- -- npm test
208
- ```
209
-
210
- To govern the agent product and model before it starts, use the managed agent
211
- launcher:
212
-
213
- ```sh
214
- phigon-observer guardian launch \
215
- --agent claude-code:worker-1 \
216
- --model anthropic:claude-sonnet-4-5 \
217
- --context-file ./phigon-action-context.json \
218
- -- claude
219
- ```
220
-
221
- The launcher requires an explicit model claim and obtains one short-lived,
222
- single-use grant covering `agent.start`, `model.use`, and `command.execute`.
223
- The grant binds the executable and input file hashes, arguments, working
224
- directory, environment, and current company policy. The native supervisor
225
- contains the managed process tree and stops it if its online lease cannot renew.
226
- It renews directly with the control plane, so an observer event-loop stall does
227
- not disable policy revocation. Its private credential bootstrap is removed before
228
- the workload starts and is excluded from command arguments and activity journals.
229
- Pending administrator approval holds the complete launch; any denied or
230
- unavailable check prevents it from starting.
231
- `guardian exec` also checks `agent.start` when no model is declared. Before either
232
- launch mode creates its manifest, it retrieves the company's assigned OS profiles.
233
- Linux profiles enforce filesystem permissions and optional denial of all sockets
234
- through Landlock/seccomp; unsupported assigned protections block launch. Profiles
235
- also support Windows/Linux memory, CPU and process limits, runtime deadlines,
236
- and Linux workload UID/GID separation when the required protected launcher and
237
- cgroup are provisioned. macOS currently accepts runtime deadlines only. Profiles
238
- are checked again during grant consumption and online lease renewal. An all-socket
239
- deny profile also blocks the loopback model gateway.
240
-
241
- Compatible agents receive a temporary loopback model gateway credential and
242
- provider base URLs. The hosted gateway checks every forwarded model request,
243
- maps only administrator-approved models, and keeps company provider keys on
244
- the server. Direct provider traffic requires company network controls.
245
-
246
- The executable is launched directly without a shell. A held or blocked action
247
- never starts and returns exit code 77; an allowed command returns its own exit
248
- code. Programs launched outside this managed boundary still require their own
249
- Phigon integration or an operating-system application-control policy. A
250
- business that must prevent direct executable or API bypass also needs OS/MDM
251
- application control and a controlled model-provider proxy.
252
-
253
- Guardian is centrally managed. `phigon-observer guardian status` reports the
254
- management authority. Local on/off and containment switches have been removed;
255
- old `guardian-control.json` files are ignored. Administrator policies alone
256
- specify the allowed intervention, and the executor verifies the exact process
257
- lifetime before stopping it.
258
-
259
- While `phigon-observer run` is active, discovered running process instances are
260
- also submitted for periodic central review, including agents started outside
261
- `guardian launch`. A policy-authorized stop or force-stop is dispatched against
262
- that exact instance and its receipt enters hosted telemetry. Discovery is
263
- post-launch detection: it cannot undo activity before discovery or contain
264
- undetected agents. Block-only policies never become background process kills.
265
-
266
- For exact model/agent lists, central decision auditing, and enterprise rollout
267
- boundaries, see [Guardian runtime](https://github.com/imthegoodboy/Phigon/blob/imp/docs/guardian-runtime.md), the
268
- [business policy catalog](https://github.com/imthegoodboy/Phigon/blob/imp/docs/enterprise-guard-policies.md), and
269
- [deployment requirements](https://github.com/imthegoodboy/Phigon/blob/imp/docs/guardian-deployment.md).
270
- Deployment guidance includes the central Linux profile format and generated
271
- Windows AppLocker build/review/apply/verify/rollback package. Saving a plain-language
272
- rule does not automatically install machine-wide application controls.
273
-
274
- Building from source requires Node 24+ and Go 1.26. `npm run build` produces the
275
- current platform's native runner. `npm run build:platforms` adds Windows, Linux,
276
- and macOS x64/ARM64 binaries before release packaging. Installed releases include
277
- the runner; endpoint users do not need Go.
278
-
279
- Phigon includes optimized support for Codex, Claude Code, Cursor, GitHub
280
- Copilot, OpenCode, Gemini CLI, and more, while the dynamic registry and custom
281
- NDJSON bridge support locally authorized custom agents without a code change.
282
-
283
- ## Troubleshooting
284
-
285
- - **Command not found:** ensure npm's global executable directory is on `PATH`,
286
- then reopen your terminal.
287
- - **Expired pairing code:** generate another code in Connect machine and retry.
288
- - **No conversations:** metadata excludes content. Check the accepted profile,
289
- workspace policy, and adapter coverage with `doctor --profile full --json`.
290
- - **Disconnected machine:** keep the observer running and allow its configured
291
- HTTPS and telemetry endpoints. Already delivered history stays on the server;
292
- queued permitted activity is retried when connectivity returns.
293
- - **Unsupported source:** Phigon shows missing or limited evidence. It does not
294
- fabricate conversations or decrypt provider-private reasoning.
295
-
296
- [Setup guide](https://phigon.online/docs/get-started) ·
297
- [Documentation](https://phigon.online/docs) ·
298
- [Report an issue](https://github.com/imthegoodboy/Phigon/issues)
299
-
300
- ## License
301
-
302
- This package is proprietary (`UNLICENSED`). Public npm availability does not
303
- grant an open-source license.
1
+ <p align="center">
2
+ <a href="https://phigon.online">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://phigon.online/brand/phigon-white.svg" />
5
+ <img src="https://phigon.online/brand/phigon-black.svg" alt="Phigon" width="64" />
6
+ </picture>
7
+ </a>
8
+ </p>
9
+
10
+ <h1 align="center">Phigon Observer</h1>
11
+
12
+ <p align="center">
13
+ See what AI coding agents do on a computer, with the owner's consent.
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="https://www.npmjs.com/package/@phigon/observer"><img alt="npm" src="https://img.shields.io/npm/v/@phigon/observer?color=000000&label=npm"></a>
18
+ <a href="LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache%202.0-000000"></a>
19
+ <a href="https://github.com/phigonai/observer/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/phigonai/observer/actions/workflows/ci.yml/badge.svg"></a>
20
+ </p>
21
+
22
+ The Phigon Observer runs on a computer where people use AI coding agents such as
23
+ Claude Code, Codex, Cursor and GitHub Copilot. It finds the agents, records what
24
+ they do within the scope the computer's owner approves, removes secrets on the
25
+ machine, and streams the activity to a [Phigon](https://phigon.online)
26
+ workspace. It can also check your company's Guardian rules before an agent runs
27
+ a risky action.
28
+
29
+ It is open source under the [Apache License 2.0](LICENSE), so you can read
30
+ exactly what runs on your computers and what leaves them.
31
+
32
+ - **Consent first.** Nothing is collected until the computer's owner approves
33
+ the exact scope on that machine.
34
+ - **Metadata by default.** The default profile shares which agents run and the
35
+ kind of work they do, not prompts, replies, code or terminal output.
36
+ - **Secrets stay on the machine.** Passwords, tokens and API keys are redacted
37
+ before anything is sent. Local settings can only narrow what is shared.
38
+ - **Survives disconnects.** Activity waits in an encrypted local queue and is
39
+ delivered, in order and without duplicates, when the connection returns.
40
+
41
+ ## Supported agents
42
+
43
+ | | Agent | Detected | Activity and history |
44
+ | --- | --- | --- | --- |
45
+ | <img src="https://phigon.online/agents/claude-code.svg" width="20" alt=""> | Claude Code | Yes | Built in |
46
+ | <img src="https://phigon.online/agents/codex.svg" width="20" alt=""> | OpenAI Codex | Yes | Built in |
47
+ | <img src="https://phigon.online/agents/github-copilot.svg" width="20" alt=""> | GitHub Copilot CLI | Yes | Built in |
48
+ | <img src="https://phigon.online/agents/github-copilot.svg" width="20" alt=""> | GitHub Copilot in VS Code (chat and agent mode) | Yes | Built in |
49
+ | <img src="https://phigon.online/agents/opencode.svg" width="20" alt=""> | OpenCode | Yes | Built in |
50
+ | <img src="https://phigon.online/agents/openclaw.svg" width="20" alt=""> | OpenClaw | Yes | Built in |
51
+ | <img src="https://phigon.online/agents/hermes.svg" width="20" alt=""> | Hermes Agent | Yes | Built in |
52
+ | <img src="https://phigon.online/agents/cursor.svg" width="20" alt=""> | Cursor (editor agent and `cursor-agent` CLI) | Yes | Built in |
53
+ | <img src="https://phigon.online/agents/gemini-cli.svg" width="20" alt=""> | Gemini CLI | Yes | Built in |
54
+ | <img src="https://phigon.online/agents/amp.svg" width="20" alt=""> | Amp | Yes | Bridge |
55
+ | <img src="https://phigon.online/agents/goose.svg" width="20" alt=""> | Goose | Yes | Built in |
56
+ | <img src="https://phigon.online/agents/cline.svg" width="20" alt=""> | Cline (CLI and VS Code extension) | Yes | Built in |
57
+ | <img src="https://phigon.online/agents/openhands.svg" width="20" alt=""> | OpenHands | Yes | Bridge |
58
+ | | Kiro | Yes | Built in (chat; agent actions not yet) |
59
+ | | Antigravity | Yes | Not yet (no documented conversation format) |
60
+ | | Trae | Yes | Not yet (its history database is encrypted) |
61
+ | | Zed (its own agent) | Yes | Built in |
62
+ | | Factory Droid | Yes | Built in |
63
+ | | Roo Code | Yes | Built in |
64
+ | | Kilo Code | Yes | Built in |
65
+ | | Aider, Amazon Q Developer CLI, Continue | Yes | Bridge |
66
+ | | Any other agent | [Register it](#custom-agents) | Bridge |
67
+
68
+ *Built in* means the observer reads the agent's own records. *Bridge* means the
69
+ agent (or a small wrapper) pipes NDJSON to `phigon-observer ingest`.
70
+
71
+ ## How it works
72
+
73
+ ```
74
+ Your computer Phigon workspace
75
+ ┌──────────────────────────────────────────┐ ┌─────────────────────────┐
76
+ │ AI agents (Claude Code, Codex, ...) │ │ Control plane │
77
+ │ │ their own records and processes │ │ history and search │
78
+ │ ▼ │ TLS │ Guardian rules │
79
+ │ phigon-observer │ ────► │ the Phigon app │
80
+ │ discover → collect → redact │ gRPC └─────────────────────────┘
81
+ │ → encrypted queue → stream │
82
+ │ │
83
+ │ Guardian runner (managed launches) │
84
+ └──────────────────────────────────────────┘
85
+ ```
86
+
87
+ The observer never needs inbound connections. It talks to the control plane
88
+ over HTTPS for pairing and over a single authenticated gRPC stream for
89
+ telemetry. The wire protocol is in [`proto/`](proto).
90
+
91
+ ## Quick start
92
+
93
+ You need **Node.js 24 or newer** and a Phigon workspace. Installed releases
94
+ include the Guardian runner for Windows, macOS and Linux on x64 and Arm64; Go is
95
+ only needed to build from source.
96
+
97
+ ```sh
98
+ npm install --global @phigon/observer
99
+ ```
100
+
101
+ 1. In the Phigon app, choose **Connect machine**.
102
+ 2. Choose **Metadata** or **Full activity**, then generate a one-time code.
103
+ 3. On the computer, run the two commands the dialog shows. The computer's owner
104
+ reviews and accepts the scope.
105
+
106
+ Metadata only:
107
+
108
+ ```sh
109
+ phigon-observer pair --code YOUR-CODE --consent-profile metadata
110
+ phigon-observer run --profile metadata
111
+ ```
112
+
113
+ Full activity (supported conversations, commands, outputs and past history):
114
+
115
+ ```sh
116
+ phigon-observer pair --code YOUR-CODE --consent-profile full
117
+ phigon-observer run --profile full
118
+ ```
119
+
120
+ Keep `phigon-observer run` running for live collection; closing the Phigon app
121
+ does not stop it. Check the installation and connection at any time:
122
+
123
+ ```sh
124
+ phigon-observer doctor --json
125
+ ```
126
+
127
+ ## What is collected
128
+
129
+ What the observer sends is always the overlap of your workspace's policy and
130
+ the profile the computer's owner accepted.
131
+
132
+ | | Metadata (default) | Full activity |
133
+ | --- | --- | --- |
134
+ | Which agents are installed and running | Yes | Yes |
135
+ | Agent state, health and kind of activity | Yes | Yes |
136
+ | Prompts and replies | No | Supported agents |
137
+ | Commands, tool calls and their output | No | Supported agents, redacted |
138
+ | Past conversations | No | Imported once, then live |
139
+ | Passwords, tokens and API keys | Never | Never (redacted on the machine) |
140
+ | Provider-encrypted model reasoning | Never | Never decoded |
141
+
142
+ Individual categories can be narrowed further with `PHIGON_COLLECT_*`
143
+ settings. A full description is in
144
+ [privacy and security](https://phigon.online/docs/privacy-and-security/).
145
+
146
+ ## Commands
147
+
148
+ | Command | What it does |
149
+ | --- | --- |
150
+ | `pair --code <code> --consent-profile <metadata\|full>` | Connects this computer to a workspace after local consent. |
151
+ | `run [--profile <metadata\|full>]` | Discovers agents and streams permitted activity. |
152
+ | `doctor [--profile <...>] [--json]` | Checks the setup without sending any data. |
153
+ | `discover [--json]` | Prints a one-time, sanitized inventory of local agents. |
154
+ | `agent add \| list \| remove` | Manages custom agent definitions. |
155
+ | `ingest --agent <id\|custom> [--name <name>]` | Reads NDJSON activity from stdin (bridges). |
156
+ | `guardian status \| exec \| launch` | Guardian checks and managed execution. |
157
+ | `authorize-action --action <a> --resource <r>` | Asks Guardian whether one action may run. |
158
+ | `update [--check] [--yes]` | Checks for or installs a new release. |
159
+ | `remove-machine` | Unregisters this computer and revokes its credential. |
160
+
161
+ Run `phigon-observer help` for every flag.
162
+
163
+ ### A company's own Phigon server
164
+
165
+ The Phigon app can run a company's own server, and other computers on the
166
+ company network can connect to it. That server signs its HTTPS certificate
167
+ with an authority of its own, so the **Connect machine** command adds
168
+ `--server-ca-sha256 <fingerprint>`.
169
+
170
+ On first contact, pairing finds the authority in the server's certificate
171
+ chain whose SHA-256 matches the fingerprint. It saves that authority as
172
+ `server-ca.pem` in the data directory, and every later HTTPS and gRPC
173
+ connection trusts it. A server that presents another certificate is refused
174
+ before anything is sent. `remove-machine` deletes the file. This needs
175
+ Node.js 24.5 or newer.
176
+
177
+ ## Configuration
178
+
179
+ Settings are environment variables. The most common ones:
180
+
181
+ | Variable | Purpose |
182
+ | --- | --- |
183
+ | `PHIGON_DATA_DIR` | Where the credential, checkpoints and encrypted queue live. Use a separate directory per workspace. |
184
+ | `PHIGON_CONTROL_PLANE_URL`, `PHIGON_GRPC_URL` | Endpoints for a self-hosted workspace. Pairing saves them; the stream refuses to send credentials anywhere else. |
185
+ | `PHIGON_TLS_CA_FILE` | A private certificate authority for gRPC. Use `NODE_EXTRA_CA_CERTS` for HTTPS. Pairing with `--server-ca-sha256` sets up both for you. |
186
+ | `PHIGON_TLS_CLIENT_CERT_FILE`, `PHIGON_TLS_CLIENT_KEY_FILE` | Client certificate, when the workspace requires mutual TLS. |
187
+ | `PHIGON_COLLECT_*` | Turns individual content categories off (or on, within the workspace policy). |
188
+ | `PHIGON_REDACT_PATH_PATTERNS` | Extra file path patterns to redact. |
189
+ | `PHIGON_<AGENT>_ACTIVITY_DIRS` | Extra record folders for an agent, e.g. `PHIGON_CLAUDE_ACTIVITY_DIRS`. |
190
+ | `PHIGON_REMOTE_ACTIONS_ENABLED` | Opt in to administrator-approved agent stop and force stop. Off by default. |
191
+ | `PHIGON_REMOTE_COMMANDS_ENABLED` | Opt in to administrator-reviewed system operations. Off by default. |
192
+ | `PHIGON_USER_NOTICES` | Set to `false` to stop telling the person at the computer when Phigon stops an agent, runs a command or restarts it. On by default. |
193
+ | `PHIGON_UPDATE_CHECK` | Set to `false` to turn off the once-a-day update check. |
194
+ | `PHIGON_LOG_LEVEL` | Logging detail. |
195
+
196
+ Never disable certificate verification. Interactive `pair` and `run` sessions
197
+ check npm for a new release at most once a day and ask before updating;
198
+ background services and `--json` commands never prompt or update on their own.
199
+
200
+ ## Custom agents
201
+
202
+ To monitor an agent without a built-in adapter, register its local signals once:
203
+
204
+ ```sh
205
+ phigon-observer agent add \
206
+ --id release-bot \
207
+ --name "Release Bot" \
208
+ --executable release-bot \
209
+ --process release-bot-worker \
210
+ --config-path ~/.release-bot \
211
+ --activity-dir ~/.release-bot/sessions
212
+ ```
213
+
214
+ Definitions are reloaded on every scan. `agent list` shows them and
215
+ `agent remove --id release-bot` stops using one. Activity directories accept
216
+ bounded JSONL; paths must be absolute or start with `~/`, roots must be narrow,
217
+ and overlapping signals are rejected instead of guessed. Custom activity stays
218
+ labeled by its source unless independent process evidence proves an exact
219
+ match.
220
+
221
+ ## Optional agent actions
222
+
223
+ Remote actions are off on every computer by default.
224
+
225
+ - `PHIGON_REMOTE_ACTIONS_ENABLED=true` lets administrators stop or force-stop
226
+ one exact running agent process. Each stop needs an operator proposal and a
227
+ separate administrator confirmation, expires quickly, and leaves a receipt.
228
+ A stop acts on one exact process lifetime (process ID plus start time, checked
229
+ again just before anything is sent) and the child processes it started.
230
+ Graceful stop sends `SIGTERM` on Linux and macOS; on Windows it asks the
231
+ agent's windows to close, and for a console agent it presses Ctrl+C in its
232
+ terminal, but only when nothing else shares that terminal; otherwise it
233
+ sends nothing and reports `terminal_shared`.
234
+ Force stop is approved separately. Receipts say when the process had already
235
+ exited, access was denied, or the agent or a child is still running. It does
236
+ not enable shell access, file access, screen capture or general remote
237
+ control.
238
+ - `PHIGON_REMOTE_COMMANDS_ENABLED=true` additionally allows
239
+ administrator-reviewed commands (executable and arguments, no shell), system
240
+ inspection, and scheduled shutdown or restart. Commands run as the observer's
241
+ account, are limited to 1–120 seconds and return at most 32 KB of redacted
242
+ output. A durable journal prevents a command from running twice after a crash.
243
+ System inspection reports the operating system, memory, uptime, CPU load,
244
+ space on the main drive, the observer version, and each running agent's
245
+ name, process ID, CPU share, memory and run time, measured once over half a
246
+ second. It never includes file contents, environment values or command lines.
247
+
248
+ Whenever Phigon stops an agent on a computer, whether someone asked, Phigon AI
249
+ decided or the agent is blocked, the person at that computer sees a system
250
+ notification such as "Claude Code was stopped by Phigon", with the reason. The
251
+ same goes for commands Phigon runs and a scheduled restart or shutdown. It uses
252
+ the system's own notifications (a Windows toast, macOS Notification Center, or
253
+ `notify-send` on Linux) and shows nothing when the observer runs without a
254
+ desktop session, for example as a Windows service. `PHIGON_USER_NOTICES=false`
255
+ turns it off.
256
+
257
+ ## Guardian: checks before an agent acts
258
+
259
+ Guardian rules are set centrally by your administrators; the observer has no
260
+ local on/off switch. Three integration points are available.
261
+
262
+ **Ask before one action.** Returns exit code `0` only when the action is
263
+ allowed; a denial, a required approval or an unavailable decision returns `77`
264
+ with a message for the agent:
265
+
266
+ ```sh
267
+ phigon-observer authorize-action \
268
+ --agent codex:worker-1 \
269
+ --action command.execute \
270
+ --resource "git status" \
271
+ --context-file ./phigon-action-context.json \
272
+ --json
273
+ ```
274
+
275
+ The optional context file holds bounded `task_id`, `proposal_id`,
276
+ `plan_step_id`, `user_prompt`, `agent_plan`, `justification`,
277
+ `expected_effect` and `recent_activity` fields. Pass `--process-id` and
278
+ `--process-started-at` for a running agent so the decision is bound to that
279
+ exact process.
280
+
281
+ **Run a command through Guardian.** The check is mandatory, and the input,
282
+ output and exit code are recorded:
283
+
284
+ ```sh
285
+ phigon-observer guardian exec --agent codex:worker-1 -- npm test
286
+ ```
287
+
288
+ **Launch an agent through Guardian.** One short-lived grant covers starting the
289
+ agent, using the declared model and running the command. The Guardian runner
290
+ contains the process tree, renews its lease directly with the control plane and
291
+ stops the agent if the lease is revoked:
292
+
293
+ ```sh
294
+ phigon-observer guardian launch \
295
+ --agent claude-code:worker-1 \
296
+ --model anthropic:claude-sonnet-4-5 \
297
+ -- claude
298
+ ```
299
+
300
+ Assigned OS profiles are enforced at launch: on Linux, filesystem and network
301
+ rules through Landlock and seccomp, plus memory, CPU and process limits and
302
+ separate workload users when a cgroup is provisioned; on Windows, memory, CPU
303
+ and process limits; on macOS, runtime deadlines. Compatible agents receive a
304
+ temporary loopback model gateway, so company provider keys stay on the server.
305
+
306
+ While `run` is active, running agents are also reviewed periodically, including
307
+ ones started outside `guardian launch`. Discovery happens after launch, so it
308
+ cannot undo earlier activity. A company that must prevent bypass also needs
309
+ operating-system application control and a controlled model provider proxy.
310
+
311
+ ## Troubleshooting
312
+
313
+ - **Command not found:** put npm's global bin directory on `PATH` and reopen
314
+ the terminal.
315
+ - **Expired pairing code:** generate a new one in **Connect machine**.
316
+ - **No conversations:** the metadata profile excludes content. Check with
317
+ `phigon-observer doctor --profile full --json`.
318
+ - **Disconnected:** keep `run` running and allow its HTTPS and gRPC endpoints.
319
+ Queued activity is delivered when the connection returns.
320
+ - **Older self-hosted pairing without a saved stream endpoint:** pass
321
+ `run --grpc-url https://stream.your-company.example` or set `PHIGON_GRPC_URL`.
322
+ - **Unreadable pairing data:** keep the data directory and encrypted queue, and
323
+ restore the credential file from a trusted backup. Never paste it into a
324
+ support message.
325
+
326
+ More help: [setup guide](https://phigon.online/docs/get-started/),
327
+ [documentation](https://phigon.online/docs/) and
328
+ [troubleshooting](https://phigon.online/docs/troubleshooting/).
329
+
330
+ ## Building from source
331
+
332
+ You need Node.js 24+ and Go 1.26+.
333
+
334
+ ```sh
335
+ npm ci
336
+ npm run build # TypeScript and the Guardian runner for this platform
337
+ npm run check # lint, type check and tests
338
+ npm run build:platforms # Guardian runners for every platform, for releases
339
+ cd go && go test ./... # Go tests
340
+ ```
341
+
342
+ After changing the protocol in `proto/`, regenerate the code with
343
+ [Buf](https://buf.build) and record the new checksums:
344
+
345
+ ```sh
346
+ buf generate
347
+ sh scripts/check-generated.sh
348
+ ```
349
+
350
+ ### Repository layout
351
+
352
+ | Path | Contents |
353
+ | --- | --- |
354
+ | `src/` | The observer CLI (TypeScript): discovery, activity adapters, redaction, pairing, the stream client and Guardian integration. |
355
+ | `test/` | Tests for the CLI. |
356
+ | `go/` | Go module `github.com/phigonai/observer/go`: the Guardian runner, the Linux supervisor, OS sandbox profiles, and the generated protocol code. |
357
+ | `proto/` | The wire protocol between the observer and a Phigon control plane. |
358
+ | `scripts/` | Build, install and release helpers. |
359
+
360
+ ## Contributing
361
+
362
+ Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) first. This
363
+ repository is published from Phigon's main repository; a maintainer applies
364
+ accepted pull requests there, keeping you as the author, and they appear here
365
+ automatically.
366
+
367
+ ## Security
368
+
369
+ Please report vulnerabilities privately. See [SECURITY.md](SECURITY.md).
370
+
371
+ ## License
372
+
373
+ Licensed under the [Apache License, Version 2.0](LICENSE). See [NOTICE](NOTICE)
374
+ and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). The Phigon name and logo
375
+ are trademarks and are not covered by the license; see
376
+ [TRADEMARKS.md](TRADEMARKS.md).