@llblab/pi-kit 0.12.1 → 0.14.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.
- package/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/node_modules/@llblab/pi-state-flow/AGENTS.md +7 -7
- package/node_modules/@llblab/pi-state-flow/BACKLOG.md +8 -9
- package/node_modules/@llblab/pi-state-flow/CHANGELOG.md +26 -0
- package/node_modules/@llblab/pi-state-flow/README.md +1 -3
- package/node_modules/@llblab/pi-state-flow/dist/index.d.ts +21 -0
- package/node_modules/@llblab/pi-state-flow/dist/index.js +20 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/acquisition.d.ts +39 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/acquisition.js +78 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/artifact.d.ts +110 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/artifact.js +334 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/compaction.d.ts +49 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/compaction.js +67 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/config.d.ts +11 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/config.js +53 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/context.d.ts +23 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/context.js +109 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/continuation.d.ts +111 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/continuation.js +189 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/discovery.d.ts +21 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/discovery.js +125 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/durable.d.ts +102 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/durable.js +507 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/episode.d.ts +8 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/episode.js +27 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/extension.d.ts +22 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/extension.js +1263 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/git.d.ts +72 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/git.js +565 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/history.d.ts +22 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/history.js +79 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/json.d.ts +12 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/json.js +109 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/logging.d.ts +25 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/logging.js +24 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/maintenance.d.ts +36 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/maintenance.js +98 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/memory.d.ts +15 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/memory.js +42 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/migration.d.ts +13 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/migration.js +133 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/protocol.d.ts +7 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/protocol.js +59 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/publication.d.ts +69 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/publication.js +335 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/query.d.ts +27 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/query.js +35 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/recovery.d.ts +8 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/recovery.js +27 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/rehydration.d.ts +36 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/rehydration.js +38 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/runtime.d.ts +142 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/runtime.js +529 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/session.d.ts +21 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/session.js +44 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/skills.d.ts +25 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/skills.js +131 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/snapshot.d.ts +88 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/snapshot.js +255 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/state.d.ts +55 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/state.js +31 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/status.d.ts +38 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/status.js +79 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/storage.d.ts +46 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/storage.js +217 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/telegram.d.ts +98 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/telegram.js +231 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/temporal.d.ts +39 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/temporal.js +203 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/transition.d.ts +25 -0
- package/node_modules/@llblab/pi-state-flow/dist/lib/transition.js +204 -0
- package/node_modules/@llblab/pi-state-flow/dist/package.json +79 -0
- package/node_modules/@llblab/pi-state-flow/dist/pi-state-flow/index.js +1 -0
- package/node_modules/@llblab/pi-state-flow/dist/skills/state-flow-memory/SKILL.md +138 -0
- package/node_modules/@llblab/pi-state-flow/docs/architecture.md +11 -5
- package/node_modules/@llblab/pi-state-flow/docs/compatibility.md +5 -1
- package/node_modules/@llblab/pi-state-flow/docs/filesystem-recovery.md +3 -3
- package/node_modules/@llblab/pi-state-flow/docs/usage.md +6 -4
- package/node_modules/@llblab/pi-state-flow/index.ts +1 -0
- package/node_modules/@llblab/pi-state-flow/lib/compaction.ts +17 -1
- package/node_modules/@llblab/pi-state-flow/lib/config.ts +6 -1
- package/node_modules/@llblab/pi-state-flow/lib/durable.ts +88 -96
- package/node_modules/@llblab/pi-state-flow/lib/extension.ts +64 -12
- package/node_modules/@llblab/pi-state-flow/lib/git.ts +32 -188
- package/node_modules/@llblab/pi-state-flow/lib/migration.ts +84 -48
- package/node_modules/@llblab/pi-state-flow/lib/query.ts +40 -0
- package/node_modules/@llblab/pi-state-flow/lib/recovery.ts +7 -30
- package/node_modules/@llblab/pi-state-flow/lib/runtime.ts +48 -50
- package/node_modules/@llblab/pi-state-flow/lib/snapshot.ts +41 -97
- package/node_modules/@llblab/pi-state-flow/lib/storage.ts +17 -12
- package/node_modules/@llblab/pi-state-flow/lib/telegram.ts +4 -4
- package/node_modules/@llblab/pi-state-flow/package.json +23 -6
- package/node_modules/@llblab/pi-state-flow/skills/state-flow-memory/SKILL.md +3 -1
- package/node_modules/@llblab/pi-telegram/AGENTS.md +5 -3
- package/node_modules/@llblab/pi-telegram/BACKLOG.md +0 -6
- package/node_modules/@llblab/pi-telegram/CHANGELOG.md +22 -0
- package/node_modules/@llblab/pi-telegram/README.md +6 -3
- package/node_modules/@llblab/pi-telegram/dist/api/activity.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/activity.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/commands.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/commands.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/delivery.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/delivery.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/inbound.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/inbound.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/keyboard.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/keyboard.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/outbound.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/outbound.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/sections.d.ts +7 -0
- package/node_modules/@llblab/pi-telegram/dist/api/sections.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/status.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/status.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/updates.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/updates.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/voice.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/api/voice.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/index.d.ts +6 -0
- package/node_modules/@llblab/pi-telegram/dist/index.js +6 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/activity-verbosity.d.ts +52 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/activity-verbosity.js +596 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/activity.d.ts +220 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/activity.js +574 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/agent-messages.d.ts +28 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/agent-messages.js +86 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bindings.d.ts +250 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bindings.js +936 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-api.d.ts +18 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-api.js +254 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-follower.d.ts +464 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-follower.js +1689 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-leader.d.ts +292 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-leader.js +2242 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-transport.d.ts +64 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-transport.js +140 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus.d.ts +518 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/bus.js +2055 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/channel-posts.d.ts +170 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/channel-posts.js +611 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/command-templates.d.ts +70 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/command-templates.js +744 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/commands.d.ts +541 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/commands.js +1155 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/config.d.ts +252 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/config.js +889 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/delivery.d.ts +163 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/delivery.js +542 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/extension.d.ts +7 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/extension.js +1604 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/generative-app-worker.mjs +104 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/generative-apps.d.ts +212 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/generative-apps.js +1006 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/inbound.d.ts +91 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/inbound.js +502 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/journal.d.ts +665 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/journal.js +3701 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/keyboard.d.ts +23 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/keyboard.js +37 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/lifecycle.d.ts +157 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/lifecycle.js +395 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/locks.d.ts +164 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/locks.js +1208 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/logging.d.ts +50 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/logging.js +274 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/media.d.ts +181 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/media.js +602 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-model.d.ts +217 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-model.js +663 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-queue.d.ts +37 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-queue.js +408 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-settings.d.ts +115 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-settings.js +595 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-status.d.ts +32 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-status.js +112 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-thinking.d.ts +29 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-thinking.js +82 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu.d.ts +171 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu.js +323 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/model.d.ts +127 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/model.js +409 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-attachments.d.ts +241 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-attachments.js +639 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-buttons.d.ts +69 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-buttons.js +248 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-markup.d.ts +42 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-markup.js +678 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-voice.d.ts +55 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-voice.js +152 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound.d.ts +185 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound.js +516 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/ownership.d.ts +77 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/ownership.js +174 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/paths.d.ts +40 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/paths.js +94 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/pi.d.ts +72 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/pi.js +121 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/polling.d.ts +351 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/polling.js +1196 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/preview.d.ts +192 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/preview.js +614 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/prompt-templates.d.ts +24 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/prompt-templates.js +118 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/prompts.d.ts +57 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/prompts.js +167 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/queue.d.ts +766 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/queue.js +1965 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/recovery.d.ts +86 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/recovery.js +285 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/rendering.d.ts +20 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/rendering.js +983 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/replies.d.ts +214 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/replies.js +737 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/routing.d.ts +207 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/routing.js +2282 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/runtime.d.ts +172 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/runtime.js +402 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/sections.d.ts +165 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/sections.js +327 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/setup.d.ts +82 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/setup.js +150 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/skills.d.ts +8 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/skills.js +12 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/status.d.ts +442 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/status.js +1000 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/sync.d.ts +179 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/sync.js +782 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/target.d.ts +20 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/target.js +27 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/telegram-api.d.ts +541 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/telegram-api.js +1159 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/text-groups.d.ts +89 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/text-groups.js +317 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-cleanup-manager.d.ts +288 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-cleanup-manager.js +560 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-display.d.ts +46 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-display.js +257 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-naming.d.ts +46 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-naming.js +78 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-reconciler.d.ts +239 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-reconciler.js +644 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/threads.d.ts +621 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/threads.js +3679 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/time-injection.d.ts +15 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/time-injection.js +56 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/turns.d.ts +109 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/turns.js +500 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/updates.d.ts +1290 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/updates.js +3634 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/voice.d.ts +117 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/voice.js +174 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-admission.d.ts +264 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-admission.js +1136 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-retirement.d.ts +219 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-retirement.js +587 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-slots.d.ts +30 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-slots.js +54 -0
- package/node_modules/@llblab/pi-telegram/dist/package.json +126 -0
- package/node_modules/@llblab/pi-telegram/dist/pi-telegram/index.js +1 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/generated-control-surface/SKILL.md +107 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/generated-control-surface/references/capability-adapters.md +27 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/generated-control-surface/references/layout-and-state.md +37 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/generative-apps/SKILL.md +115 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/show-me/SKILL.md +166 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/show-me/references/telegram-surfaces.md +43 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/telegram-bridge/SKILL.md +129 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/telegram-bridge/references/configuration.md +15 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/telegram-bridge/references/delivery-and-threads.md +27 -0
- package/node_modules/@llblab/pi-telegram/dist/skills/telegram-bridge/references/diagnosis.md +18 -0
- package/node_modules/@llblab/pi-telegram/docs/README.md +2 -0
- package/node_modules/@llblab/pi-telegram/docs/architecture.md +4 -2
- package/node_modules/@llblab/pi-telegram/docs/compact-matrix-literal.md +10 -3
- package/node_modules/@llblab/pi-telegram/docs/generative-apps.md +15 -13
- package/node_modules/@llblab/pi-telegram/docs/multi-instance-bus.md +6 -4
- package/node_modules/@llblab/pi-telegram/docs/outbound.md +1 -1
- package/node_modules/@llblab/pi-telegram/docs/public-api.md +3 -3
- package/node_modules/@llblab/pi-telegram/lib/bindings.ts +89 -6
- package/node_modules/@llblab/pi-telegram/lib/bus-follower.ts +12 -5
- package/node_modules/@llblab/pi-telegram/lib/bus-leader.ts +44 -19
- package/node_modules/@llblab/pi-telegram/lib/bus.ts +4 -1
- package/node_modules/@llblab/pi-telegram/lib/commands.ts +2 -2
- package/node_modules/@llblab/pi-telegram/lib/config.ts +14 -7
- package/node_modules/@llblab/pi-telegram/lib/delivery.ts +38 -6
- package/node_modules/@llblab/pi-telegram/lib/extension.ts +7 -0
- package/node_modules/@llblab/pi-telegram/lib/generative-apps.ts +379 -13
- package/node_modules/@llblab/pi-telegram/lib/menu-settings.ts +20 -6
- package/node_modules/@llblab/pi-telegram/lib/outbound-markup.ts +16 -7
- package/node_modules/@llblab/pi-telegram/lib/status.ts +9 -15
- package/node_modules/@llblab/pi-telegram/lib/telegram-api.ts +12 -1
- package/node_modules/@llblab/pi-telegram/lib/thread-display.ts +96 -18
- package/node_modules/@llblab/pi-telegram/package.json +56 -13
- package/node_modules/@llblab/pi-telegram/scripts/build-dist.mjs +44 -0
- package/node_modules/@llblab/pi-telegram/scripts/measure-bus.mjs +8 -1
- package/node_modules/@llblab/pi-telegram/scripts/measure-workspace.mjs +8 -1
- package/node_modules/@llblab/pi-telegram/skills/generative-apps/SKILL.md +1 -1
- package/node_modules/@llblab/pi-telegram/skills/show-me/SKILL.md +1 -1
- package/node_modules/@llblab/pi-telegram/skills/show-me/references/telegram-surfaces.md +1 -1
- package/node_modules/@llblab/pi-telegram/skills/telegram-bridge/SKILL.md +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@llblab/pi-kit` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.14.0 - 2026-09-15
|
|
6
|
+
|
|
7
|
+
- `State Flow Semantic Runtime`: Advances the exact State Flow pin to `0.13.2`, adopting semantic-only checkpoint and patch storage with adjacent lineage metadata, compiled distributive runtime and Skills, clearer state inspection hierarchy, and guarded automatic compaction that avoids benign native `Nothing to compact` failures caused by system-prompt-only pressure. The package set and explicit load order remain unchanged.
|
|
8
|
+
|
|
9
|
+
## 0.13.0 - 2026-09-15
|
|
10
|
+
|
|
11
|
+
- `Telegram Runtime And Recovery`: Advances the exact Telegram pin to `0.48.2`, loading its compiled distributive runtime and Skills, adding unified activity plus adaptive Thread display, preserving truthful queue counts, and containing failed follower promotion as bounded recovery instead of a process-terminating exception. The package set and explicit load order remain unchanged.
|
|
12
|
+
|
|
5
13
|
## 0.12.1 - 2026-09-14
|
|
6
14
|
|
|
7
15
|
- `State Flow Navigation Hotfix`: Advances the exact State Flow pin to `0.11.2`, removing the duplicate chooser-owned Back button from Show state. The transport-owned `⬆️ Back` row is now the only navigation control and returns directly to the State Flow section; scope choices and read-only inspection remain unchanged.
|
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@ Package links lead to the owning repositories for usage, documentation, issues,
|
|
|
14
14
|
| [`@llblab/pi-clean-room`](https://github.com/llblab/pi-clean-room) | `0.1.1` | Isolated nested Pi TUI with explicitly selected extensions |
|
|
15
15
|
| [`@llblab/pi-codex-usage`](https://github.com/llblab/pi-codex-usage) | `0.9.4` | Compact Codex/Spark subscription-limit status |
|
|
16
16
|
| [`@llblab/pi-grow-loop`](https://github.com/llblab/pi-grow-loop) | `0.8.1` | Visible continuation scheduling and bounded worker Skills |
|
|
17
|
-
| [`@llblab/pi-state-flow`](https://github.com/llblab/pi-state-flow) | `0.
|
|
18
|
-
| [`@llblab/pi-telegram`](https://github.com/llblab/pi-telegram) | `0.
|
|
17
|
+
| [`@llblab/pi-state-flow`](https://github.com/llblab/pi-state-flow) | `0.13.2` | Incremental scoped state, context, and memory with semantic storage, compiled runtime delivery, safe compaction, exact publication, and hierarchical read-only Telegram inspection |
|
|
18
|
+
| [`@llblab/pi-telegram`](https://github.com/llblab/pi-telegram) | `0.48.2` | Telegram companion with built runtime delivery, resilient follower promotion, truthful terminal queue counts, adaptive Thread display, exact queues, files, voice, controls, and Generative Apps guidance |
|
|
19
19
|
| [`@llblab/skills`](https://github.com/llblab/skills) | `1.15.0` | Portable workflows for engineering, review, design, context maintenance, and other focused tasks |
|
|
20
20
|
|
|
21
21
|
Versions are exact by design. An upstream release does not change an installed kit until this repository explicitly advances the dependency and publishes a new kit version. Runtime defects and package-specific feature requests belong in the linked repository; package selection and kit installation issues belong here.
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
- Correlate successful exact-path reads with the current ordinary global invalidation plan. Require each acquired stale source to have a compact compiler output at the same path in a global transition, reject model-authored provenance fields, and record the runtime-observed source hash plus current ordinary compiler revision in the global provenance registry. Compile routing descriptions by default, never raw Markdown or a full-file summary; preserve uncertainty and reserve richer compilations for reusable operational semantics.
|
|
11
11
|
- Apply one materialized-first acquisition policy to every source: read only for a concrete relevant gap not covered by a sufficient compilation, an exact-source operation including edits, evidenced invalidation, contradiction/failure reconciliation, explicit request, or selection by bounded maintenance. New sessions, routine recall or activation, reassurance, and an index or description alone are not reasons to read. Changed hashes require rereading; prefer the smallest sufficient read.
|
|
12
12
|
- Keep artifact maintenance opt-in, low-frequency, and side-effect free until a selected source is acquired. Select only otherwise-fresh artifacts old enough for maintenance, rank missing/unparseable `compiled_at` first then oldest timestamp and path, and enforce strict per-cycle read-count and source-byte ceilings. Treat source bytes as the conservative source-token upper bound. Never let maintenance displace correctness invalidation; use explicit invalidation refresh for full rebuilds and never mutate source files.
|
|
13
|
-
- Load optional agent-level `state-flow.json` once per extension load/reload. Its `directory` selects the state store, `autoStart` defaults false for genuinely new sessions, and `remotePublication` selects `off`, `turn-end`, or compatibility `transition`. State Flow always owns durable memory while enabled and global semantic memory is always available; these are invariants, not configuration switches. Keep runtime configuration and provenance outside model-patchable semantic state.
|
|
14
|
-
- Keep runtime configuration and provenance separate from model-patchable semantic state. Persist session `config.json` for enablement/projection settings and `meta.json` for lineage, counters, branch identity, durable base, publication, migration metadata, and session-scope artifact provenance; global and CWD scopes own their artifact provenance in scope `meta.json`. Neither participates in scope overlay. New Pi checkpoints contain only a durable revision pointer, or `{disabled:true}` when no durable runtime exists on that branch. Preserve exact Git hashes for Git-backed revisions and give file-only current-cohort references an unambiguous distinct identity; file references use `file:<64 lowercase hex>`, bind the store root and complete scoped/runtime cohort, and must not pretend to provide arbitrary cold or branch history. Operationally unavailable references (including expired file cohorts, missing Git, and publication exclusion) retain selection rather than falling through to older disabled markers; malformed immutable targets remain a distinct recovery case; they are not a parallel authoritative semantic or config/meta store. Emit a disabled marker only from proven pre-runtime branch provenance; missing/invalid revisions and failed restoration do not establish that permission. Predecessor checkpoint
|
|
13
|
+
- Load optional agent-level `state-flow.json` once per extension load/reload. Its `directory` selects the state store, `autoStart` defaults false for genuinely new sessions, `showSuccessfulPatches` defaults true for interactive successful-call JSON rendering, and `remotePublication` selects `off`, `turn-end`, or compatibility `transition`. State Flow always owns durable memory while enabled and global semantic memory is always available; these are invariants, not configuration switches. Keep runtime configuration and provenance outside model-patchable semantic state.
|
|
14
|
+
- Keep runtime configuration and provenance separate from model-patchable semantic state. Persist session `config.json` for enablement/projection settings and `meta.json` for lineage, counters, branch identity, durable base, publication, migration metadata, and session-scope artifact provenance; global and CWD scopes own their artifact provenance in scope `meta.json`. Neither participates in scope overlay. New Pi checkpoints contain only a durable revision pointer, or `{disabled:true}` when no durable runtime exists on that branch. Preserve exact Git hashes for Git-backed revisions and give file-only current-cohort references an unambiguous distinct identity; file references use `file:<64 lowercase hex>`, bind the store root and complete scoped/runtime cohort, and must not pretend to provide arbitrary cold or branch history. Operationally unavailable references (including expired file cohorts, missing Git, and publication exclusion) retain selection rather than falling through to older disabled markers; malformed immutable targets remain a distinct recovery case; they are not a parallel authoritative semantic or config/meta store. Emit a disabled marker only from proven pre-runtime branch provenance; missing/invalid revisions and failed restoration do not establish that permission. Predecessor checkpoint/tail envelopes are read-only migration input, recognized only by their complete exact structure and converted explicitly through the normal lock/CAS publication path. Validate immutable pointer targets before acquiring the live publication basis; transient publication failures preserve the selected retry reference rather than choosing older semantic state. In Git mode, runtime `revision: "self"` resolves to the commit owning the config/meta pair, not an unrelated later repository commit. File publication uses explicit `publication: "files"` provenance and resolves the exact complete live cohort instead of claiming a Git owner. Use a distinct `meta.temporalRevision` when a runtime-only write selects older semantic scopes; restore their artifact provenance from that same revision and preserve live shared checkpoints, tails, and provenance during session config/meta writes. Persist publication intent as unconfirmed before pushing; reconcile that exact existing commit after restart rather than embedding an impossible self-hash or inventing semantic history.
|
|
15
15
|
- Overlay materialized state recursively in `global → cwd → session` order. Scope-local deletion removes only that scope's key so a lower-scope value becomes visible again; scope never changes instruction authority. Route branch/run-local continuation to session, project-local reusable state and Skill artifacts to CWD, and cross-project reusable state to global.
|
|
16
|
-
- Reserve `state` for the runtime materialized semantic view. For each scope, current state is exactly `materialize(checkpoint.json, patches.jsonl)`: an older anchored checkpoint plus its ordered tail of at most seven materially effective semantic patches. On overflow, apply the oldest patch into the checkpoint, advance its `through` boundary, remove it, and append the new patch. Never truncate unapplied replay records or replay patches over an already-current snapshot.
|
|
16
|
+
- Reserve `state` for the runtime materialized semantic view. `checkpoint.json` contains only the canonical materialized semantic state, each nonblank `patches.jsonl` line contains only one semantic patch, and adjacent `meta.json` owns their checkpoint/tail boundaries plus CWD identity. For each scope, current state is exactly `materialize(checkpoint.json, patches.jsonl, meta.json)`: an older anchored checkpoint plus its ordered tail of at most seven materially effective semantic patches. On overflow, apply the oldest patch into the checkpoint, advance its `through` boundary, remove it, and append the new patch. Never truncate unapplied replay records or replay patches over an already-current snapshot.
|
|
17
17
|
- Give every accepted semantic transition one opaque identity shared by all affected scope records, with explicit active causal lineage. A branch-local position can order identities but never acts as a global counter, substitutes for identity, or merges forks. Unchanged scopes contribute no record and remain unchanged at that boundary. Adopt revision-proven inherited streams at a new session origin without rewriting their checkpoints/tails; pre-origin coordinates are not one shared clock. A restored branch adopts current proven live shared streams it does not modify at a fresh origin while preserving its selected session layer; a shared scope the accepted transition actually changes must still match its selected basis or fail closed naming that scope. Reconciliation adoption is not a fabricated semantic transition, parent link, or retry loop. True semantic no-ops and origin adoption do not advance semantic history.
|
|
18
18
|
- Define `state[n]` and `state.global[n]`, `state.cwd[n]`, `state.session[n]` at the same nth previous accepted transition boundary in the active lineage, never the nth local patch of each scope. Guarantee offsets zero through seven once the lineage has seven proven transitions; report earlier-than-origin history as unavailable for new/migrated lineages and reject offsets beyond seven on the hot interface. Reconstruct scopes at one target before overlaying them.
|
|
19
|
-
- Keep historical reads lazy through the smallest runtime/model read interface. Normal inference gets only current effective state and useful bounded compact transition context, never eight full snapshots. `patch_state` is the sole semantic mutation tool. `read_state`
|
|
20
|
-
- Store runtime state in its own directory with optional Git durability, defaulting to `state-flow/` beneath Pi's configured agent directory (`~/.pi/agent/state-flow/` normally), independently from the Knowledge Markdown source root. Use exactly these owned paths: `checkpoint.json`, `patches.jsonl`, and `meta.json` for global; `<cwd-key>/checkpoint.json`, `<cwd-key>/patches.jsonl`, and `<cwd-key>/meta.json` for CWD; `<cwd-key>/<session-key>/checkpoint.json`, `patches.jsonl`, `config.json`, and `meta.json` for session. Do not create `.state-flow`, `scopes`, or another storage/history namespace. Mirror Pi's native CWD session-directory encoding and JSONL-basename session key (deriving `<header timestamp>_<UUID>` for in-memory sessions), while retaining separately verifiable canonical identity provenance in owned state. Keep the UUID authoritative, reject unsafe segments and mismatches rather than selecting another scope, and use CWD
|
|
19
|
+
- Keep historical reads lazy through the smallest runtime/model read interface. Normal inference gets only current effective state and useful bounded compact transition context, never eight full snapshots. `patch_state` is the sole semantic mutation tool. `read_state` resolves current-as-index-zero aliases for effective/scoped materializations and scope-local retained accepted patches; materialization indices share the composed causal lineage while `patches[n]` walks the selected scope's retained patch tail. The prior offset/scope form remains a compatibility input and cannot combine with `path`. Reads return the exact boundary and never publish, append a checkpoint, or advance history. Both tools follow branch enablement and host tool restrictions; the patch barrier blocks reader siblings too. Live/cached checkpoint plus tails own the hot path; use Git for branch restoration and explicit cold inspection, not to rebuild current state on every inference.
|
|
20
|
+
- Store runtime state in its own directory with optional Git durability, defaulting to `state-flow/` beneath Pi's configured agent directory (`~/.pi/agent/state-flow/` normally), independently from the Knowledge Markdown source root. Use exactly these owned paths: `checkpoint.json`, `patches.jsonl`, and `meta.json` for global; `<cwd-key>/checkpoint.json`, `<cwd-key>/patches.jsonl`, and `<cwd-key>/meta.json` for CWD; `<cwd-key>/<session-key>/checkpoint.json`, `patches.jsonl`, `config.json`, and `meta.json` for session. Do not create `.state-flow`, `scopes`, or another storage/history namespace. Mirror Pi's native CWD session-directory encoding and JSONL-basename session key (deriving `<header timestamp>_<UUID>` for in-memory sessions), while retaining separately verifiable canonical identity provenance in owned state. Keep the UUID authoritative, reject unsafe segments and mismatches rather than selecting another scope, and use CWD `meta.json` ownership to fail closed on Pi-name collisions.
|
|
21
21
|
- Classify every filesystem cohort before recovery: complete valid evidence is usable; total absence is recoverable only from an explicit semantic default or exact surviving authority; partial, malformed, contradictory, or authority-losing evidence fails closed at the smallest dependent capability. A wholly absent untouched global/CWD checkpoint-tail pair is current empty shared reality and must not resurrect selected cold values; a patch targeting that disappeared scope is stale and must fail for reinference. Missing provenance means unavailable freshness, not semantic corruption. Perform every repair through normal locked/CAS publication, never ad-hoc writes.
|
|
22
|
-
-
|
|
22
|
+
- Support exactly one storage migration: complete predecessor checkpoint/tail envelopes across every owner-proven session in the configured store convert into semantic-only checkpoint/tail files plus temporal `meta.json` through one normal locked/CAS publication. Replace a Git-backed store's history with one new root commit for the complete migrated tree; apply the same cohort without Git in file-only mode. `state.json`, pre-0.4 hashed layouts, and semantic Pi checkpoint envelopes are unsupported and never become recovery authority. Exercise migrations in temporary repositories rather than modifying the user's active data during development.
|
|
23
23
|
- Read and write only regular non-symlink State Flow-owned files at those exact paths, publish each file by same-directory atomic rename, preserve arbitrary repository contents, and classify ownership exactly. Git acceptance follows the complete-delta isolated-index contract below. Retain opaque source bytes for file identity and rollback, not decoded-text reconstructions. Use validated structural JSON equality for in-process semantic comparisons; reserve cryptographic hashes for compact identities that cross inference, persistence, process, or source-freshness boundaries. Serialize cooperating Git publications through a common-Git-directory publication lock; low-level file helpers require caller exclusion. Recheck prepared bases before each replacement/deletion and restore only bytes still matching the publisher's own output. Preserve detected concurrent changes and report unresolved rollback conflicts; do not claim kernel-atomic multi-file CAS against nonparticipating writers. Markdown discovery uses its independently configured source root, defaulting to `knowledge/` beneath Pi's agent directory; a storage-root override must not redirect source discovery.
|
|
24
24
|
- At instance initialization resolve the repository, CWD key, and session key; load each scope's anchored checkpoint and tail, materialize at the selected temporal boundary, then overlay `global → cwd → session`. Install cached view and publication basis atomically only after successful restoration/initialization; unavailable publication is an error, not a semantic no-op. Branch recovery may reuse one owner-bound, single-use inspection of the exact selected immutable Git revision, with a detached inspection snapshot and a freshly acquired live publication basis at installation. Revalidate mutable file cohorts, legacy snapshot fallbacks, and redirected runtime owners; never turn inspection into a long-lived revision or publication-basis cache. Preserve the selected revision across transient restore failure so an explicit start can retry it. A genuinely new session gets an empty session layer and inherits only global/CWD values; it must never reuse another same-CWD session layer. Explicit native fork adoption instead follows the [session-copy contract](docs/fork-contract.md): copy the proven source session checkpoint/tail and provenance into a distinct owner over current shared streams, without pruning shared provenance or modifying the parent. Use a fresh origin, preserve copied replay records, reject occupied live/HEAD targets, and publish/checkpoint the child only after CAS acceptance. Inherited parent pointers never authorize an empty reset; fence parent passive Stop projection across child reload.
|
|
25
25
|
- Bind every loaded scope and active Pi branch/checkpoint to the corresponding State Flow Git revision. Resume and tree restoration must recover branch-correct runtime config and semantic layers from that revision without blindly importing Git `HEAD`; reading an older revision must use object-level Git reads and never reset or check out the shared repository worktree.
|
|
@@ -50,4 +50,4 @@
|
|
|
50
50
|
- Activate State Flow model tools only while enabled on the selected branch; preserve every unrelated active tool when toggling them. Keep mutation confined to `patch_state` and historical observation read-only.
|
|
51
51
|
- Keep `.github/workflows/release.yml` as the sole version-tag release owner: it validates immutable tag identity, publishes through npm Trusted Publisher with provenance, verifies the public package, and only then creates the GitHub Release. Keep package, lockfile, tag, and changelog versions aligned; never add a long-lived npm token fallback.
|
|
52
52
|
- Keep opt-in performance executables and workers in top-level `benchmarks/`; their correctness regressions stay in `tests/`. Benchmark workloads may reuse synthetic test fixtures, remain excluded from runtime packaging, and retain source-bound measurement identities across relocations.
|
|
53
|
-
- Run `npm run validate` after retained code changes.
|
|
53
|
+
- Run `npm run validate` after retained code changes, then run the canonical ABCd context validator after context edits.
|
|
@@ -4,14 +4,13 @@ Completed release work belongs in [CHANGELOG.md](CHANGELOG.md).
|
|
|
4
4
|
|
|
5
5
|
## Candidate evolution
|
|
6
6
|
|
|
7
|
-
- [ ]
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
7
|
+
- [ ] `Default passive memory access`: Separate memory availability from the active State Flow episode lifecycle. A normal installation defaults to both passive state bootstrap and `read_state`/`patch_state` tools, while automatic terminal compaction, iteration continuation, and active episode semantics remain gated behind `/state-flow-start`.
|
|
8
|
+
- Configuration: control passive bootstrap and passive tools independently, yielding all four supported combinations: both off, bootstrap only, tools only, or both on (default). Fully off must add no state projection or tools to model context.
|
|
9
|
+
- Passive bootstrap: project existing effective durable state without creating scopes, migrating storage, publishing changes, starting an episode, or promising automatic continuation. Name this separately from active episode/bootstrap semantics.
|
|
10
|
+
- Passive tools: `read_state` remains read-only; an explicit `patch_state` may initialize or migrate the required durable runtime and publish only the requested semantic change, but must not activate terminal compaction or future automatic iterations.
|
|
11
|
+
- Lifecycle: `/state-flow-start` promotes passive access into the existing active episode behavior. `/state-flow-stop` returns to the configured passive combination rather than overriding it globally.
|
|
12
|
+
- Acceptance: cover all four configuration combinations, fresh and existing stores, explicit passive patch publication, unsupported-storage failure, start/stop transitions, tool/context visibility, and proof that passive turns never run terminal compaction.
|
|
13
|
+
- Status: accepted direction, not implemented. Requires a dedicated release contract.
|
|
14
|
+
- [ ] `Pi Telegram submenu state analyzer`: Extend the State Flow Telegram section with a read-only analyzer view over the same diagnostics `/state-flow-status` already reports (branch mode, temporal head and hot depth, scope keys, retained tails, artifact freshness, publication). The operator deliberately deferred this beyond the 0.9.0 control surface.
|
|
12
15
|
- Boundary: presentation only. Reuse existing status diagnostics; no new semantic mode, and never mutate state from the analyzer view.
|
|
13
16
|
- Status: candidate, not scheduled. Do not start without a dedicated release contract.
|
|
14
|
-
|
|
15
|
-
## Deferred host integration
|
|
16
|
-
|
|
17
|
-
- [ ] **Native default session continuation:** Integrate the existing read-only recommendation, exact-selection, and rehydration contracts before Pi creates `SessionManager`, while preserving explicit new/resume and native-picker precedence, truthful notices, and cross-process session ownership. Pi 0.84.4 exposes no suitable pre-session resolver hook, so this requires upstream support or an SDK/launcher integration. Reverify the host API before taking the item; it is not a release dependency.
|
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.13.2: Benign compaction readiness
|
|
8
|
+
|
|
9
|
+
- `Benign compaction readiness`: Automatic State Flow compaction now requires enough persisted message history as well as high total context usage, so a short session enlarged only by its system prompt remains a quiet non-action instead of surfacing Pi's native `Nothing to compact` failure.
|
|
10
|
+
- `Release automation`: The publish job now builds the compiled distribution before capturing its script-free local package inventory, so post-publication comparison uses the same manifest shape as the npm artifact.
|
|
11
|
+
|
|
12
|
+
## 0.13.1: Compiled package release verification
|
|
13
|
+
|
|
14
|
+
- `Release verification`: Public npm verification now checks the compiled Pi entrypoint and packaged Skill introduced in 0.13.0 instead of requiring the retired source entrypoint, with an invariant preventing the workflow from drifting back to source-package assumptions.
|
|
15
|
+
|
|
16
|
+
## 0.13.0: Semantic storage and compiled distribution
|
|
17
|
+
|
|
18
|
+
- `Semantic storage`: `checkpoint.json` and each `patches.jsonl` line now contain only semantic payloads; temporal boundaries and CWD ownership moved into `meta.json`. Explicit Start atomically converts global state, every owner-proven CWD, and every owned session in the configured store, preserving runtime/config/provenance and unknown metadata. Git-backed stores receive one new root commit; file-only stores receive the same migration without Git.
|
|
19
|
+
- `Compiled distribution`: Pi now executes a nested `dist/pi-state-flow/index.js` identity shim backed by compiled JavaScript and declarations. Builds also stage packaged Skills, while source entrypoints remain available for local development.
|
|
20
|
+
- `Versioned Telegram inspection`: State snapshots now use a less-prominent heading and include the matching monospaced `#N` State Flow step for Global, CWD, Session, and Effective views; the `State Flow: #N` button is unchanged.
|
|
21
|
+
- `Tool output spacing`: Successful visible `patch_state` rows and every failure path, including transport/WebSocket errors, now leave exactly one blank line between the tool heading and its output without changing patch or error semantics.
|
|
22
|
+
- `Patch readability`: Successful patch JSON now separates adjacent Global, CWD, and Session scopes, adjacent semantic sections such as `working` and `response`, and the final eligibility field with blank lines while remaining valid JSON.
|
|
23
|
+
|
|
24
|
+
## 0.12.1: Cleaner successful patch rendering
|
|
25
|
+
|
|
26
|
+
- `Successful patch rendering`: Successful visible `patch_state` rows now contain only valid pretty-printed JSON, without the redundant materialized-scope summary, and separate adjacent memory sections with blank lines.
|
|
27
|
+
|
|
28
|
+
## 0.12.0: Unified state reads and visible patches
|
|
29
|
+
|
|
30
|
+
- `Unified state reads`: `read_state` now resolves current-as-index-zero paths for effective/scoped materializations and retained scope patches while preserving the prior offset/scope input for compatibility. Materialization paths share the composed causal timeline; patch paths walk accepted records for their selected scope.
|
|
31
|
+
- `Successful patch visibility`: Interactive successful `patch_state` rows show the applied JSON arguments by default. Agent-level `showSuccessfulPatches: false` restores compact summaries; rejected calls and private validation payloads remain separate.
|
|
32
|
+
|
|
7
33
|
## 0.11.2: Single hierarchical Back control
|
|
8
34
|
|
|
9
35
|
- `Telegram inspection navigation`: Removes the chooser-owned `⬅️ Back` button from Show state. The section framework now supplies the only navigation row, `⬆️ Back`, which returns directly to the State Flow section; the four scope choices and read-only Rich state inspection are unchanged.
|
|
@@ -53,8 +53,6 @@ Continue working normally. The agent receives the state protocol and uses `patch
|
|
|
53
53
|
|
|
54
54
|
State Flow is **opt-in**. Starting in an existing conversation keeps its active context for one migration run. To enable genuinely new sessions automatically, set `"autoStart": true` in the optional [configuration](docs/usage.md#configuration).
|
|
55
55
|
|
|
56
|
-
With a compatible `pi-telegram` installed, its main menu exposes the same Start/Stop controls followed by `👁 Show state`. The chooser uses the transport-owned `⬆️ Back` row to return to State Flow, followed by 🌐 Global, 📂 CWD, 💬 Session, and 🧬 Effective as one vertical composition axis. Selecting a scope sends exactly that materialized slice as a standalone native Rich Message with a fixed scope heading and four top-level collapsible semantic fields; inspection is read-only and does not create a State Flow transition.
|
|
57
|
-
|
|
58
56
|
## What carries forward
|
|
59
57
|
|
|
60
58
|
The same four fields exist at every scope:
|
|
@@ -68,7 +66,7 @@ Memory overlays **global → project CWD → session**. Put reusable cross-proje
|
|
|
68
66
|
|
|
69
67
|
**Resuming an existing Pi session restores its selected State Flow state and enablement.** A genuinely new session starts with an empty session layer and inherits only shared global/CWD memory; it does not resume another session's private work. Tree navigation follows the selected branch, not whichever state happens to be at Git `HEAD`.
|
|
70
68
|
|
|
71
|
-
The agent can inspect `state[0]` through `state[7]`: now and up to seven prior accepted transitions.
|
|
69
|
+
The agent can inspect `state`/`state[0]` through `state[7]`: now and up to seven prior accepted transitions. Scoped paths such as `state.cwd[1]` use the same causal boundary; `state.global.patches[0]` reads the latest retained accepted patch for that scope. Git-backed stores retain older committed history separately.
|
|
72
70
|
|
|
73
71
|
## Boundaries worth knowing
|
|
74
72
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { ArtifactReadTracker, decideArtifactAcquisition, type ArtifactAcquisitionDecision, type ArtifactAcquisitionIntent, type ArtifactAcquisitionOptions, type ArtifactAcquisitionReason, type SuccessfulArtifactRead } from "./lib/acquisition.ts";
|
|
2
|
+
export { classifyArtifactFreshness, compileArtifact, hashArtifactSource, isArtifactHash, isArtifactMetadata, isArtifactRegistry, ORDINARY_ARTIFACT_COMPILER, parseArtifactProvenanceRegistry, planArtifactInvalidation, projectArtifactForModel, projectArtifactsForModel, pruneArtifactProvenance, selectArtifactsByTags, serializeArtifactProvenanceRegistry, updateArtifactProvenance, updateArtifactRegistry, validateArtifactMetadata, validateArtifactRegistry, type ArtifactCompilationUpdate, type ArtifactCompilerOutput, type ArtifactFreshness, type ArtifactInvalidationNotice, type ArtifactInvalidationOptions, type ArtifactInvalidationPlan, type ArtifactInvalidationReason, type ArtifactInvalidationRequest, type ArtifactMetadata, type ArtifactProvenance, type ArtifactProvenanceRegistry, type ArtifactRegistry, type ArtifactSourceIdentity, type CompiledArtifact } from "./lib/artifact.ts";
|
|
3
|
+
export { buildContinuationCandidates, discoverNativeSessionHeaders, inspectStateFlowContinuationProvenance, readNativeSessionHeader, recommendContinuationFromProvenance, resolveContinuationStartup, type ContinuationCandidateProvenance, type ContinuationCandidateSummary, type ContinuationHostContext, type ContinuationHostIntent, type ContinuationProjectIdentity, type ContinuationRecommendation, type ContinuationRecommender, type ContinuationSessionCandidate, type ContinuationStartupDecision, type ContinuationTransport, type NativeSessionHeader } from "./lib/continuation.ts";
|
|
4
|
+
export { discoverGlobalMarkdownSources, getKnowledgeRoot, GlobalMarkdownDiscovery, type ArtifactSourceCandidate, type GlobalMarkdownDiscoveryResult } from "./lib/discovery.ts";
|
|
5
|
+
export { captureTemporalFileBases, cwdScopeKey, getDurableRepositoryRoot, isStateFlowOwnedPath, loadScopeStream, parseScopeProvenance, parseScopeStream, serializeScopeProvenance, serializeScopeStream, sessionRuntimePaths, sessionScopeKey, sessionStorageKey, temporalScopePaths, temporalStateFileUpdates, type ScopeStreamSources, type TemporalScopePaths } from "./lib/durable.ts";
|
|
6
|
+
export { default, MAX_FALLBACK_ATTEMPTS, PATCH_STATE_TOOL_NAME, READ_STATE_TOOL_NAME, type StateFlowExtensionOptions } from "./lib/extension.ts";
|
|
7
|
+
export { captureTemporalGitBase, isGitCommitAncestor, loadTemporalRevision, migrateLegacyStorageToGit, publishTemporalStateToGit, pushGitCommit, resolveGitPushDestination, type GitPushResult, type TemporalGitBase, type TemporalRevisionLoad } from "./lib/git.ts";
|
|
8
|
+
export { createAcceptedTransition, projectRecentTransitionsWithLimit, RECENT_TRANSITION_LIMIT, validateRecentTransition, type AcceptedTransition, type RecentScopePatch, type RecentTransition, type RecentTransitionWindow } from "./lib/history.ts";
|
|
9
|
+
export { applyPatch, canonicalJson, hashJson, isObject, validatePatch } from "./lib/json.ts";
|
|
10
|
+
export type { JsonObject, JsonValue } from "./lib/json.ts";
|
|
11
|
+
export { appendStateFlowDiagnostic, projectDiagnosticContent, stateFlowLogPath, type StateFlowDiagnosticBlock, type StateFlowDiagnosticCategory, type StateFlowDiagnosticRecord } from "./lib/logging.ts";
|
|
12
|
+
export { DEFAULT_ARTIFACT_MAINTENANCE_MAX_READS, DEFAULT_ARTIFACT_MAINTENANCE_MAX_SOURCE_BYTES, DEFAULT_ARTIFACT_MAINTENANCE_MINIMUM_AGE_MS, planArtifactMaintenance, type ArtifactMaintenanceOptions, type ArtifactMaintenancePlan, type ArtifactMaintenanceRequest } from "./lib/maintenance.ts";
|
|
13
|
+
export { inspectMemoryPromotions, MEMORY_PROMOTION_STATUSES, MEMORY_PROMOTIONS_KEY, retainedMemoryScopes, type MemoryPromotionDiagnostic, type MemoryPromotionStatus } from "./lib/memory.ts";
|
|
14
|
+
export { acquirePublicationWorkerLease, beginPublicationAttempt, coalescePublicationTarget, confirmPublicationTarget, createPublicationQueue, failPublicationAttempt, loadPublicationQueue, parsePublicationQueue, parseRemotePublicationPolicyDocument, publicationQueuePath, recoverPublicationQueue, remotePublicationDestinationKey, removePublicationQueue, resolveRemotePublicationPolicy, runPublicationWorker, savePublicationQueue, serializePublicationQueue, serializeRemotePublicationPolicyDocument, validatePublicationQueue, type CommitAncestor, type PublicationPush, type PublicationQueueReceipt, type PublicationQueueState, type PublicationQueueStatus, type PublicationWorkerLease, type PublicationWorkerResult, type RemotePublicationDestination, type RemotePublicationMode, type RemotePublicationPolicy, type RemotePublicationPolicyDocument } from "./lib/publication.ts";
|
|
15
|
+
export { planKnowledgeRehydration, type RehydrationOptions, type RehydrationPhase, type RehydrationPlan, type RehydrationRead, type RehydrationRoute } from "./lib/rehydration.ts";
|
|
16
|
+
export { TemporalRuntime } from "./lib/runtime.ts";
|
|
17
|
+
export { hasCompiledSkillArtifact, hashSkillSource, migrateLegacySkillCompilations, SKILL_ARTIFACT_COMPILER, type SuccessfulSkillRead } from "./lib/skills.ts";
|
|
18
|
+
export { emptyState, isMaterializedState, isStateDocument, overlayStates, projectStateForModel, updateMaterializedArtifacts, type AtomicScopePatches, type MaterializedState, type ScopedPatch, type ScopedStates, type ScopePatch, type SemanticTransition, type StateDocument, type StatePatch, type StateScope, type TerminalTransition } from "./lib/state.ts";
|
|
19
|
+
export { buildStateFlowSectionView, createStateFlowTelegramAdapter, formatStateFlowSectionLabel, loadStateFlowTelegramModules, STATE_FLOW_TELEGRAM_ID, type StateFlowTelegramAdapter, type StateFlowTelegramButton, type StateFlowTelegramCallbackContext, type StateFlowTelegramControlResult, type StateFlowTelegramLoader, type StateFlowTelegramModules, type StateFlowTelegramPort, type StateFlowTelegramSectionContext, type StateFlowTelegramSectionModule, type StateFlowTelegramSnapshot, type StateFlowTelegramView } from "./lib/telegram.ts";
|
|
20
|
+
export { advanceTemporalState, readTemporalState, type TemporalState } from "./lib/temporal.ts";
|
|
21
|
+
export { parseStateReadPath, readStatePath, type StateReadQuery, type StateReadResult } from "./lib/query.ts";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { ArtifactReadTracker, decideArtifactAcquisition } from "./lib/acquisition.js";
|
|
2
|
+
export { classifyArtifactFreshness, compileArtifact, hashArtifactSource, isArtifactHash, isArtifactMetadata, isArtifactRegistry, ORDINARY_ARTIFACT_COMPILER, parseArtifactProvenanceRegistry, planArtifactInvalidation, projectArtifactForModel, projectArtifactsForModel, pruneArtifactProvenance, selectArtifactsByTags, serializeArtifactProvenanceRegistry, updateArtifactProvenance, updateArtifactRegistry, validateArtifactMetadata, validateArtifactRegistry } from "./lib/artifact.js";
|
|
3
|
+
export { buildContinuationCandidates, discoverNativeSessionHeaders, inspectStateFlowContinuationProvenance, readNativeSessionHeader, recommendContinuationFromProvenance, resolveContinuationStartup } from "./lib/continuation.js";
|
|
4
|
+
export { discoverGlobalMarkdownSources, getKnowledgeRoot, GlobalMarkdownDiscovery } from "./lib/discovery.js";
|
|
5
|
+
export { captureTemporalFileBases, cwdScopeKey, getDurableRepositoryRoot, isStateFlowOwnedPath, loadScopeStream, parseScopeProvenance, parseScopeStream, serializeScopeProvenance, serializeScopeStream, sessionRuntimePaths, sessionScopeKey, sessionStorageKey, temporalScopePaths, temporalStateFileUpdates } from "./lib/durable.js";
|
|
6
|
+
export { default, MAX_FALLBACK_ATTEMPTS, PATCH_STATE_TOOL_NAME, READ_STATE_TOOL_NAME } from "./lib/extension.js";
|
|
7
|
+
export { captureTemporalGitBase, isGitCommitAncestor, loadTemporalRevision, migrateLegacyStorageToGit, publishTemporalStateToGit, pushGitCommit, resolveGitPushDestination } from "./lib/git.js";
|
|
8
|
+
export { createAcceptedTransition, projectRecentTransitionsWithLimit, RECENT_TRANSITION_LIMIT, validateRecentTransition } from "./lib/history.js";
|
|
9
|
+
export { applyPatch, canonicalJson, hashJson, isObject, validatePatch } from "./lib/json.js";
|
|
10
|
+
export { appendStateFlowDiagnostic, projectDiagnosticContent, stateFlowLogPath } from "./lib/logging.js";
|
|
11
|
+
export { DEFAULT_ARTIFACT_MAINTENANCE_MAX_READS, DEFAULT_ARTIFACT_MAINTENANCE_MAX_SOURCE_BYTES, DEFAULT_ARTIFACT_MAINTENANCE_MINIMUM_AGE_MS, planArtifactMaintenance } from "./lib/maintenance.js";
|
|
12
|
+
export { inspectMemoryPromotions, MEMORY_PROMOTION_STATUSES, MEMORY_PROMOTIONS_KEY, retainedMemoryScopes } from "./lib/memory.js";
|
|
13
|
+
export { acquirePublicationWorkerLease, beginPublicationAttempt, coalescePublicationTarget, confirmPublicationTarget, createPublicationQueue, failPublicationAttempt, loadPublicationQueue, parsePublicationQueue, parseRemotePublicationPolicyDocument, publicationQueuePath, recoverPublicationQueue, remotePublicationDestinationKey, removePublicationQueue, resolveRemotePublicationPolicy, runPublicationWorker, savePublicationQueue, serializePublicationQueue, serializeRemotePublicationPolicyDocument, validatePublicationQueue } from "./lib/publication.js";
|
|
14
|
+
export { planKnowledgeRehydration } from "./lib/rehydration.js";
|
|
15
|
+
export { TemporalRuntime } from "./lib/runtime.js";
|
|
16
|
+
export { hasCompiledSkillArtifact, hashSkillSource, migrateLegacySkillCompilations, SKILL_ARTIFACT_COMPILER } from "./lib/skills.js";
|
|
17
|
+
export { emptyState, isMaterializedState, isStateDocument, overlayStates, projectStateForModel, updateMaterializedArtifacts } from "./lib/state.js";
|
|
18
|
+
export { buildStateFlowSectionView, createStateFlowTelegramAdapter, formatStateFlowSectionLabel, loadStateFlowTelegramModules, STATE_FLOW_TELEGRAM_ID } from "./lib/telegram.js";
|
|
19
|
+
export { advanceTemporalState, readTemporalState } from "./lib/temporal.js";
|
|
20
|
+
export { parseStateReadPath, readStatePath } from "./lib/query.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ArtifactInvalidationReason, type ArtifactInvalidationRequest, type ArtifactSourceIdentity } from "./artifact.ts";
|
|
2
|
+
/** Why the caller is considering source-body acquisition. */
|
|
3
|
+
export type ArtifactAcquisitionIntent = "routine" | "new-session" | "relevant-gap" | "exact-source" | "exact-edit" | "contradiction-or-failure" | "explicit-request" | "maintenance";
|
|
4
|
+
export type ArtifactAcquisitionReason = ArtifactInvalidationReason | "materialized-gap" | "exact-source" | "exact-edit" | "contradiction-or-failure" | "explicit-request" | "maintenance";
|
|
5
|
+
export type ArtifactAcquisitionDecision = {
|
|
6
|
+
kind: "use-materialized";
|
|
7
|
+
reason: "no-concrete-need" | "materialized-sufficient";
|
|
8
|
+
} | {
|
|
9
|
+
kind: "read-source";
|
|
10
|
+
reason: ArtifactAcquisitionReason;
|
|
11
|
+
};
|
|
12
|
+
export interface ArtifactAcquisitionOptions {
|
|
13
|
+
intent: ArtifactAcquisitionIntent;
|
|
14
|
+
/** Caller-assessed semantic sufficiency; only relevant to a concrete relevant gap. */
|
|
15
|
+
materializedSufficient?: boolean;
|
|
16
|
+
explicitRefresh?: boolean;
|
|
17
|
+
/** Runtime-owned freshness evidence retained beside the semantic artifact. */
|
|
18
|
+
provenance?: unknown;
|
|
19
|
+
}
|
|
20
|
+
/** A successful read correlated to a runtime-observed invalidation candidate. */
|
|
21
|
+
export interface SuccessfulArtifactRead extends ArtifactInvalidationRequest {
|
|
22
|
+
}
|
|
23
|
+
/** Correlate successful read-tool executions with the current ordinary artifact invalidation plan. */
|
|
24
|
+
export declare class ArtifactReadTracker {
|
|
25
|
+
#private;
|
|
26
|
+
readonly successful: Map<string, SuccessfulArtifactRead>;
|
|
27
|
+
setCandidates(candidates: Iterable<ArtifactInvalidationRequest>): void;
|
|
28
|
+
clear(): void;
|
|
29
|
+
recordStart(toolCallId: string, toolName: string, args: unknown): void;
|
|
30
|
+
recordCall(toolCallId: string, toolName: string, input: unknown): void;
|
|
31
|
+
recordEnd(toolCallId: string, toolName: string, isError: boolean): void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Apply one materialized-first source acquisition policy.
|
|
35
|
+
*
|
|
36
|
+
* Freshness invalidation always wins. Otherwise routine use and a new session
|
|
37
|
+
* stay on materialized state; only a concrete source need permits rereading.
|
|
38
|
+
*/
|
|
39
|
+
export declare function decideArtifactAcquisition(source: ArtifactSourceIdentity, metadata: unknown, compiler: string, options: ArtifactAcquisitionOptions): ArtifactAcquisitionDecision;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { classifyArtifactFreshness, } from "./artifact.js";
|
|
2
|
+
import { isObject } from "./json.js";
|
|
3
|
+
function readPath(toolName, args) {
|
|
4
|
+
return toolName === "read" && isObject(args) && typeof args.path === "string"
|
|
5
|
+
? args.path
|
|
6
|
+
: undefined;
|
|
7
|
+
}
|
|
8
|
+
/** Correlate successful read-tool executions with the current ordinary artifact invalidation plan. */
|
|
9
|
+
export class ArtifactReadTracker {
|
|
10
|
+
successful = new Map();
|
|
11
|
+
#pending = new Map();
|
|
12
|
+
#candidates = new Map();
|
|
13
|
+
setCandidates(candidates) {
|
|
14
|
+
this.#candidates.clear();
|
|
15
|
+
for (const candidate of candidates)
|
|
16
|
+
this.#candidates.set(candidate.path, structuredClone(candidate));
|
|
17
|
+
}
|
|
18
|
+
clear() {
|
|
19
|
+
this.successful.clear();
|
|
20
|
+
this.#pending.clear();
|
|
21
|
+
}
|
|
22
|
+
recordStart(toolCallId, toolName, args) {
|
|
23
|
+
this.#record(toolCallId, toolName, args);
|
|
24
|
+
}
|
|
25
|
+
recordCall(toolCallId, toolName, input) {
|
|
26
|
+
this.#record(toolCallId, toolName, input);
|
|
27
|
+
}
|
|
28
|
+
recordEnd(toolCallId, toolName, isError) {
|
|
29
|
+
const pending = this.#pending.get(toolCallId);
|
|
30
|
+
this.#pending.delete(toolCallId);
|
|
31
|
+
if (isError || !pending || toolName !== pending.toolName)
|
|
32
|
+
return;
|
|
33
|
+
const path = readPath(pending.toolName, pending.args);
|
|
34
|
+
if (path === undefined)
|
|
35
|
+
return;
|
|
36
|
+
const candidate = this.#candidates.get(path);
|
|
37
|
+
if (candidate !== undefined)
|
|
38
|
+
this.successful.set(path, structuredClone(candidate));
|
|
39
|
+
}
|
|
40
|
+
#record(toolCallId, toolName, args) {
|
|
41
|
+
if (toolName !== "read") {
|
|
42
|
+
this.#pending.delete(toolCallId);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.#pending.set(toolCallId, { toolName, args });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Apply one materialized-first source acquisition policy.
|
|
50
|
+
*
|
|
51
|
+
* Freshness invalidation always wins. Otherwise routine use and a new session
|
|
52
|
+
* stay on materialized state; only a concrete source need permits rereading.
|
|
53
|
+
*/
|
|
54
|
+
export function decideArtifactAcquisition(source, metadata, compiler, options) {
|
|
55
|
+
const freshness = classifyArtifactFreshness(source, metadata, compiler, options.explicitRefresh ?? false, options.provenance);
|
|
56
|
+
if (freshness.kind === "requires-compilation") {
|
|
57
|
+
return { kind: "read-source", reason: freshness.reason };
|
|
58
|
+
}
|
|
59
|
+
switch (options.intent) {
|
|
60
|
+
case "routine":
|
|
61
|
+
case "new-session":
|
|
62
|
+
return { kind: "use-materialized", reason: "no-concrete-need" };
|
|
63
|
+
case "relevant-gap":
|
|
64
|
+
return options.materializedSufficient === true
|
|
65
|
+
? { kind: "use-materialized", reason: "materialized-sufficient" }
|
|
66
|
+
: { kind: "read-source", reason: "materialized-gap" };
|
|
67
|
+
case "exact-source":
|
|
68
|
+
return { kind: "read-source", reason: "exact-source" };
|
|
69
|
+
case "exact-edit":
|
|
70
|
+
return { kind: "read-source", reason: "exact-edit" };
|
|
71
|
+
case "contradiction-or-failure":
|
|
72
|
+
return { kind: "read-source", reason: "contradiction-or-failure" };
|
|
73
|
+
case "explicit-request":
|
|
74
|
+
return { kind: "read-source", reason: "explicit-request" };
|
|
75
|
+
case "maintenance":
|
|
76
|
+
return { kind: "read-source", reason: "maintenance" };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type JsonObject } from "./json.ts";
|
|
2
|
+
/** Current compiler protocol for ordinary source artifacts such as Knowledge Markdown. */
|
|
3
|
+
export declare const ORDINARY_ARTIFACT_COMPILER = "artifact-v1";
|
|
4
|
+
/** Freshness fields that runtime-owned scope metadata may retain per artifact path. */
|
|
5
|
+
export interface ArtifactProvenance {
|
|
6
|
+
/** Retained value; absent means unavailable, malformed means fail closed. */
|
|
7
|
+
sourceHash?: unknown;
|
|
8
|
+
compilerRevision?: unknown;
|
|
9
|
+
compiledAt?: unknown;
|
|
10
|
+
/** Internal marker for an uninterpretable retained entry; every dependent capability fails closed. */
|
|
11
|
+
malformed?: true;
|
|
12
|
+
}
|
|
13
|
+
export type ArtifactProvenanceRegistry = Record<string, ArtifactProvenance>;
|
|
14
|
+
/**
|
|
15
|
+
* Model-visible artifact metadata retained per canonical source path.
|
|
16
|
+
*
|
|
17
|
+
* `hash`, `compiler`, and `compiled_at` remain accepted only as retired embedded
|
|
18
|
+
* provenance input from pre-0.7 state; they are consumed as compatibility evidence
|
|
19
|
+
* and stripped from model projection. New compilations keep semantic fields here and
|
|
20
|
+
* runtime-owned freshness in the scope `meta.json` provenance registry.
|
|
21
|
+
*/
|
|
22
|
+
export type ArtifactMetadata = JsonObject & {
|
|
23
|
+
description: string;
|
|
24
|
+
compilation?: JsonObject;
|
|
25
|
+
kind?: string;
|
|
26
|
+
tags?: string[];
|
|
27
|
+
hash?: string;
|
|
28
|
+
compiler?: string;
|
|
29
|
+
compiled_at?: string;
|
|
30
|
+
};
|
|
31
|
+
/** Artifact source paths are the canonical registry keys. */
|
|
32
|
+
export type ArtifactRegistry = JsonObject & Record<string, ArtifactMetadata>;
|
|
33
|
+
/** Source identity is sufficient for freshness decisions; it never contains the source body. */
|
|
34
|
+
export interface ArtifactSourceIdentity {
|
|
35
|
+
path: string;
|
|
36
|
+
hash: string;
|
|
37
|
+
}
|
|
38
|
+
export type ArtifactInvalidationReason = "new" | "source-changed" | "compiler-changed" | "invalid-metadata" | "explicit-refresh";
|
|
39
|
+
export type ArtifactFreshness = {
|
|
40
|
+
kind: "fresh";
|
|
41
|
+
} | {
|
|
42
|
+
kind: "requires-compilation";
|
|
43
|
+
reason: ArtifactInvalidationReason;
|
|
44
|
+
};
|
|
45
|
+
export interface ArtifactInvalidationRequest extends ArtifactSourceIdentity {
|
|
46
|
+
reason: ArtifactInvalidationReason;
|
|
47
|
+
}
|
|
48
|
+
/** Model-visible invalidation projection: paths and reasons only, never source identity. */
|
|
49
|
+
export interface ArtifactInvalidationNotice {
|
|
50
|
+
path: string;
|
|
51
|
+
reason: ArtifactInvalidationReason;
|
|
52
|
+
}
|
|
53
|
+
export interface ArtifactInvalidationPlan {
|
|
54
|
+
fresh: ArtifactSourceIdentity[];
|
|
55
|
+
requiresCompilation: ArtifactInvalidationRequest[];
|
|
56
|
+
removed: string[];
|
|
57
|
+
}
|
|
58
|
+
export interface ArtifactInvalidationOptions {
|
|
59
|
+
/** Refresh every source, or only paths in the supplied set. */
|
|
60
|
+
explicitRefresh?: boolean | ReadonlySet<string>;
|
|
61
|
+
/** Explicit absence evidence supplied by the source owner, not inferred from a partial candidate set. */
|
|
62
|
+
removed?: readonly string[];
|
|
63
|
+
}
|
|
64
|
+
/** Trusted compilation input; embedded timestamps are accepted here, but never in model patches. */
|
|
65
|
+
export type ArtifactCompilerOutput = JsonObject & {
|
|
66
|
+
description: string;
|
|
67
|
+
compiled_at?: string;
|
|
68
|
+
compilation?: JsonObject;
|
|
69
|
+
kind?: string;
|
|
70
|
+
tags?: string[];
|
|
71
|
+
};
|
|
72
|
+
export interface ArtifactCompilationUpdate {
|
|
73
|
+
source: ArtifactSourceIdentity;
|
|
74
|
+
compiler: string;
|
|
75
|
+
output: ArtifactCompilerOutput;
|
|
76
|
+
}
|
|
77
|
+
/** One compilation split into its model-visible and runtime-owned halves. */
|
|
78
|
+
export interface CompiledArtifact {
|
|
79
|
+
semantic: ArtifactMetadata;
|
|
80
|
+
provenance: ArtifactProvenance;
|
|
81
|
+
}
|
|
82
|
+
export declare function hashArtifactSource(source: string | Uint8Array): string;
|
|
83
|
+
export declare function isArtifactHash(value: unknown): value is string;
|
|
84
|
+
export declare function validateArtifactMetadata(value: unknown, path?: string): asserts value is ArtifactMetadata;
|
|
85
|
+
export declare function isArtifactMetadata(value: unknown): value is ArtifactMetadata;
|
|
86
|
+
export declare function validateArtifactRegistry(value: unknown): asserts value is ArtifactRegistry;
|
|
87
|
+
export declare function selectArtifactsByTags(registry: ArtifactRegistry, tags: readonly string[], match?: "all" | "any"): string[];
|
|
88
|
+
export declare function isArtifactRegistry(value: unknown): value is ArtifactRegistry;
|
|
89
|
+
/** Parse one scope `meta.json` provenance registry; missing input means no recorded evidence. */
|
|
90
|
+
export declare function parseArtifactProvenanceRegistry(value: unknown, context?: string): ArtifactProvenanceRegistry;
|
|
91
|
+
/** Canonical retained form; uninterpretable entries cannot round-trip and are omitted. */
|
|
92
|
+
export declare function serializeArtifactProvenanceRegistry(registry: Readonly<ArtifactProvenanceRegistry>): JsonObject;
|
|
93
|
+
/** Classify freshness from semantic state and runtime provenance without acquiring the source body. */
|
|
94
|
+
export declare function classifyArtifactFreshness(source: ArtifactSourceIdentity, metadata: unknown, compiler: string, explicitRefresh?: boolean, provenance?: unknown): ArtifactFreshness;
|
|
95
|
+
/** Produce a deterministic acquisition plan from path/hash candidates and retained evidence. */
|
|
96
|
+
export declare function planArtifactInvalidation(sources: readonly ArtifactSourceIdentity[], registry: Readonly<Record<string, unknown>>, compiler: string, options?: ArtifactInvalidationOptions, provenance?: Readonly<ArtifactProvenanceRegistry>): ArtifactInvalidationPlan;
|
|
97
|
+
/** Split one compiler output into model-visible semantics and runtime-owned provenance. */
|
|
98
|
+
export declare function compileArtifact(update: ArtifactCompilationUpdate): CompiledArtifact;
|
|
99
|
+
/** Merge one compilation/removal cohort into the runtime-owned provenance registry. */
|
|
100
|
+
export declare function updateArtifactProvenance(registry: Readonly<ArtifactProvenanceRegistry>, updates: readonly ArtifactCompilationUpdate[], removed?: readonly string[]): ArtifactProvenanceRegistry;
|
|
101
|
+
/** Keep only provenance whose artifact path still exists in the given semantic registry. */
|
|
102
|
+
export declare function pruneArtifactProvenance(registry: Readonly<ArtifactProvenanceRegistry>, semantic: Readonly<Record<string, unknown>>): ArtifactProvenanceRegistry;
|
|
103
|
+
/** Validate and apply a whole compilation/removal cohort of model-visible artifacts. */
|
|
104
|
+
export declare function updateArtifactRegistry(registry: ArtifactRegistry, updates: readonly ArtifactCompilationUpdate[], removed?: readonly string[]): ArtifactRegistry;
|
|
105
|
+
/** Validate authored fields only: legacy retained evidence stays readable but cannot be model-edited. */
|
|
106
|
+
export declare function validateModelArtifactPatch(patch: JsonObject): void;
|
|
107
|
+
/** Strip retained runtime bookkeeping from one model-visible artifact entry. */
|
|
108
|
+
export declare function projectArtifactForModel(entry: unknown): unknown;
|
|
109
|
+
/** Strip retained runtime bookkeeping from a model-visible artifact registry. */
|
|
110
|
+
export declare function projectArtifactsForModel(registry: Readonly<ArtifactRegistry>): ArtifactRegistry;
|