kijito-tools 0.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 (104) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +6 -0
  3. package/README.md +220 -0
  4. package/bin/cli.js +34 -0
  5. package/install.sh +161 -0
  6. package/package.json +50 -0
  7. package/providers/_shared/wake-core.mjs +358 -0
  8. package/providers/claude/CLAUDE.md.snippet +31 -0
  9. package/providers/claude/install.sh +186 -0
  10. package/providers/claude/scripts/arm-session.sh +66 -0
  11. package/providers/claude/scripts/claude-armed.sh +101 -0
  12. package/providers/claude/scripts/heartbeat-watchdog.sh +209 -0
  13. package/providers/claude/scripts/inbox-selftest.sh +277 -0
  14. package/providers/claude/scripts/kijito-persona-lib.sh +94 -0
  15. package/providers/claude/scripts/kijito-qa-pass.sh +12 -0
  16. package/providers/claude/scripts/lifecycle-lib.sh +167 -0
  17. package/providers/claude/scripts/myctx.sh +46 -0
  18. package/providers/claude/scripts/self-clear.sh +134 -0
  19. package/providers/claude/scripts/session-autosend.sh +85 -0
  20. package/providers/claude/scripts/session-catchup-hint.sh +330 -0
  21. package/providers/claude/scripts/statusline-context.sh +67 -0
  22. package/providers/claude/skills/kijito-qa-memory/SKILL.md +110 -0
  23. package/providers/claude/skills/kijito-recall/SKILL.md +53 -0
  24. package/providers/claude/skills/kijito-start/SKILL.md +122 -0
  25. package/providers/claude/wiring/README.md +93 -0
  26. package/providers/claude/wiring/kijito-heartbeat@.service +21 -0
  27. package/providers/codex/README.md +75 -0
  28. package/providers/codex/codex-kijito-parity-plan.md +265 -0
  29. package/providers/codex/docs-codex-setup.md +64 -0
  30. package/providers/codex/install.mjs +184 -0
  31. package/providers/codex/n0-capability-probe-protocol.md +472 -0
  32. package/providers/codex/n0-harness/README.md +57 -0
  33. package/providers/codex/n0-harness/cli.mjs +58 -0
  34. package/providers/codex/n0-harness/evidence-manifest.mjs +77 -0
  35. package/providers/codex/n0-harness/fixture.mjs +279 -0
  36. package/providers/codex/n0-harness/lib.mjs +141 -0
  37. package/providers/codex/n0-harness/manifest.mjs +36 -0
  38. package/providers/codex/n0-harness/oracle.mjs +464 -0
  39. package/providers/codex/n0-harness/parser.mjs +200 -0
  40. package/providers/codex/n0-harness/prompt.mjs +43 -0
  41. package/providers/codex/n0-harness/snapshot.mjs +120 -0
  42. package/providers/codex/n0-harness/specimen.mjs +37 -0
  43. package/providers/codex/notify/kijito-notify-count.mjs +117 -0
  44. package/providers/codex/notify/kijito-notify-count.test.mjs +76 -0
  45. package/providers/codex/plans/gate4-battery-log.md +184 -0
  46. package/providers/codex/plans/gate4-battery-protocol.md +43 -0
  47. package/providers/codex/plans/hive-user-first-plan-QA.md +34 -0
  48. package/providers/codex/plans/hive-user-first-plan.md +247 -0
  49. package/providers/codex/release-manifest.json +53 -0
  50. package/providers/codex/same-chat-continuation-plan-gate.md +235 -0
  51. package/providers/codex/same-chat-continuation-plan.md +458 -0
  52. package/providers/codex/skills/kijito-qa-memory/SKILL.md +193 -0
  53. package/providers/codex/skills/kijito-qa-memory/agents/openai.yaml +4 -0
  54. package/providers/codex/skills/kijito-recall/SKILL.md +53 -0
  55. package/providers/codex/skills/kijito-start/SKILL.md +173 -0
  56. package/providers/codex/skills/kijito-start/agents/openai.yaml +4 -0
  57. package/providers/codex/test/n0-cli-refusal.test.mjs +31 -0
  58. package/providers/codex/test/n0-counterexample-matrix.test.mjs +118 -0
  59. package/providers/codex/test/n0-guard-census-core.mjs +1372 -0
  60. package/providers/codex/test/n0-guard-census.json +35479 -0
  61. package/providers/codex/test/n0-guard-census.mjs +31 -0
  62. package/providers/codex/test/n0-guard-census.test.mjs +374 -0
  63. package/providers/codex/test/n0-guard-counterexamples.mjs +1068 -0
  64. package/providers/codex/test/n0-guard-independent-projection.mjs +70 -0
  65. package/providers/codex/test/n0-guard-independent-projection.test.mjs +53 -0
  66. package/providers/codex/test/n0-guard-manifest-author.mjs +424 -0
  67. package/providers/codex/test/n0-guard-mutation-operators.test.mjs +244 -0
  68. package/providers/codex/test/n0-guard-mutation-runner.mjs +599 -0
  69. package/providers/codex/test/n0-guard-remainder-classes.test.mjs +314 -0
  70. package/providers/codex/test/n0-guard-sanitizer-pairs.test.mjs +68 -0
  71. package/providers/codex/test/n0-guard-shared-context-predicates.test.mjs +84 -0
  72. package/providers/codex/test/n0-harness.test.mjs +553 -0
  73. package/providers/codex/test/n0-notable-regressions.test.mjs +70 -0
  74. package/providers/codex/test/n0-subject-boundary.mjs +97 -0
  75. package/providers/codex/test/n0-subject-boundary.test.mjs +72 -0
  76. package/providers/codex/test/same-chat-plan-preflight.sh +167 -0
  77. package/providers/codex/tools/refresh-manifest.mjs +81 -0
  78. package/providers/codex/wake-helper/TRANSPORT-NOTES.md +25 -0
  79. package/providers/codex/wake-helper/integration.test.mjs +285 -0
  80. package/providers/codex/wake-helper/kijito-wake-helper.mjs +488 -0
  81. package/providers/codex/wake-helper/kijito-wake-helper.test.mjs +128 -0
  82. package/providers/codex/wake-helper/mock-daemon.mjs +64 -0
  83. package/providers/codex/wake-helper/status-probe.mjs +45 -0
  84. package/providers/codex/wake-helper/ws-uds.mjs +153 -0
  85. package/providers/monitor/.github/workflows/publish-npm.yml +38 -0
  86. package/providers/monitor/.github/workflows/publish-pypi.yml +30 -0
  87. package/providers/monitor/CHANGELOG.md +465 -0
  88. package/providers/monitor/IMPORT-PROVENANCE.md +68 -0
  89. package/providers/monitor/LICENSE +202 -0
  90. package/providers/monitor/NOTICE +7 -0
  91. package/providers/monitor/OPAQUE-OUTPUT-ENFORCEMENT.md +45 -0
  92. package/providers/monitor/README.md +571 -0
  93. package/providers/monitor/RELEASING.md +125 -0
  94. package/providers/monitor/arm-hive-monitor.sh +13 -0
  95. package/providers/monitor/bin/cli.js +43 -0
  96. package/providers/monitor/com.kijito.inbox-monitor.plist.template +59 -0
  97. package/providers/monitor/docs/DESIGN.md +984 -0
  98. package/providers/monitor/kijito-inbox-monitor@.service.template +95 -0
  99. package/providers/monitor/kijito_inbox_monitor.py +3666 -0
  100. package/providers/monitor/package.json +35 -0
  101. package/providers/monitor/pyproject.toml +42 -0
  102. package/providers/monitor/scripts/mutation-check.py +399 -0
  103. package/providers/monitor/scripts/prepublish-gate.sh +284 -0
  104. package/providers/monitor/test_kijito_monitor.py +5609 -0
@@ -0,0 +1,95 @@
1
+ # Kijito Inbox Monitor - systemd USER unit template (Linux)
2
+ #
3
+ # The Linux counterpart to com.kijito.inbox-monitor.plist.template (macOS launchd).
4
+ # This is a TEMPLATE UNIT in systemd's own sense: the `@` means one unit file serves
5
+ # any number of personas, and `%i` expands to whatever follows the `@` when you
6
+ # enable it. You do NOT edit this file per persona.
7
+ #
8
+ # install: mkdir -p ~/.config/systemd/user
9
+ # cp kijito-inbox-monitor@.service.template \
10
+ # ~/.config/systemd/user/kijito-inbox-monitor@.service
11
+ # systemctl --user daemon-reload
12
+ # run: systemctl --user enable --now kijito-inbox-monitor@YOURPERSONA
13
+ # check: systemctl --user status kijito-inbox-monitor@YOURPERSONA
14
+ # logs: journalctl --user -u kijito-inbox-monitor@YOURPERSONA -f
15
+ #
16
+ # BEFORE IT WILL START, create the token file for that persona (0600):
17
+ # install -m600 /dev/null ~/.config/kijito-inbox-monitor/token.YOURPERSONA
18
+ # printf '%s' "$YOUR_KIJITO_API_TOKEN" > ~/.config/kijito-inbox-monitor/token.YOURPERSONA
19
+ # A missing token is FATAL and says so - the producer will not start half-configured.
20
+ #
21
+ # ⚠️ THIS CAPTURES; IT DOES NOT WAKE. The unit appends one JSON event per new message
22
+ # to ~/.local/state/kijito-inbox-monitor/events.<persona>.ndjson. Something must still
23
+ # turn those lines into an actual wake of your agent - see "Waking your agent" in the
24
+ # README. A running unit and a woken agent are different claims, and only the second
25
+ # one is the point.
26
+ #
27
+ # Uncomment the hardening block at the bottom only after reading it - ProtectHome
28
+ # would deny the writes this unit needs unless ReadWritePaths names them.
29
+ #
30
+ # ⚠️ IF YOU RUN SEVERAL PERSONAS, each gets its own instance and its own state file.
31
+ # Never point two instances at one --state-file: it is single-writer locked, and the
32
+ # second one will refuse to start rather than corrupt the cursor.
33
+ #
34
+ # ⚠️ A USER UNIT STOPS WHEN YOUR LAST SESSION ENDS, AND Restart=always DOES NOT SAVE IT.
35
+ # That directive restarts the SERVICE; it cannot restart the user manager that hosts it.
36
+ # `Linger=no` is the default on every machine, so this is opt-in:
37
+ # loginctl enable-linger "$USER" # check: loginctl show-user "$USER" -p Linger
38
+ # On a desktop you may never notice. On a server, or a VM you log out of, the producer
39
+ # just stops - and nothing reports it, because a watcher cannot report its own death.
40
+ # This is the same class as the warning above: a running unit and a woken agent are
41
+ # different claims, and so are an ENABLED unit and a unit that survives your logout.
42
+
43
+ [Unit]
44
+ Description=Kijito inbox monitor (persona: %i)
45
+ Documentation=https://github.com/KijitoAI/kijito-inbox-monitor
46
+ # Start after the network is genuinely up, not merely configured: the producer's first
47
+ # act is an HTTPS poll, and a DNS failure at boot is an avoidable alert.
48
+ After=network-online.target
49
+ Wants=network-online.target
50
+
51
+ [Service]
52
+ Type=simple
53
+ # --token-file, never an env var or an argument: it keeps the secret out of the unit
54
+ # file, out of `systemctl show`, and out of every process listing.
55
+ # ⚠️ THE STATE FILE IS DELIBERATELY *NOT* IN ~/.cache, AND THIS IS NOT PEDANTRY.
56
+ # XDG defines ~/.cache as non-essential data that anything may delete at any time,
57
+ # and cache cleaners do. But losing the state file is NOT a cache miss: with no
58
+ # state, the producer BASELINES to the newest visible id - so the unread backlog is
59
+ # SKIPPED, not re-fetched. Mail that would have woken you never does. (Since v0.4.x
60
+ # that skip is at least ANNOUNCED as a `baseline_skipped` diagnostic instead of
61
+ # happening in silence - but announced-and-skipped is still skipped.)
62
+ # ⇒ state lives under ~/.local/state (XDG_STATE_HOME: persists between restarts).
63
+ ExecStart=%h/.local/bin/kijito-inbox-monitor \
64
+ --persona %i \
65
+ --token-file %h/.config/kijito-inbox-monitor/token.%i \
66
+ --poll-seconds 30 \
67
+ --wait 60 \
68
+ --state-file %h/.local/state/kijito-inbox-monitor/%i.state \
69
+ --events-file %h/.local/state/kijito-inbox-monitor/events.%i.ndjson \
70
+ --no-content \
71
+ --heartbeat 900
72
+
73
+ # Create the state directory before the first start, 0700. systemd will not make it
74
+ # for you, and a missing parent is a startup failure rather than a silent skip.
75
+ ExecStartPre=/usr/bin/install -d -m 0700 %h/.local/state/kijito-inbox-monitor
76
+
77
+ # A watcher cannot report its own death, so something else must restart it.
78
+ Restart=always
79
+ RestartSec=15
80
+
81
+ # The producer warns when its state directory is group-writable, because the events
82
+ # file carries message bodies and the state file carries the cursor. 0077 keeps it
83
+ # both quiet and correct.
84
+ UMask=0077
85
+
86
+ # Optional hardening - uncomment if your distro's systemd supports these (v235+).
87
+ # The producer needs outbound HTTPS, its own $HOME paths, and nothing else.
88
+ # ProtectSystem=strict
89
+ # ProtectHome=read-only
90
+ # ReadWritePaths=%h/.local/state/kijito-inbox-monitor
91
+ # PrivateTmp=true
92
+ # NoNewPrivileges=true
93
+
94
+ [Install]
95
+ WantedBy=default.target