aegisone 1.0.64 → 1.0.65
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/README.md +1 -1
- package/bin/aegis.js +1 -1
- package/package.json +1 -1
- package/scripts/bump.mjs +1 -1
- package/scripts/bundle.js +1 -1
- package/scripts/postinstall.mjs +1 -1
- package/scripts/predist.mjs +1 -1
- package/src/child.js +1 -1
- package/src/dispatch.js +1 -1
- package/src/doctor.js +1 -1
- package/src/probes.js +1 -1
- package/src/productupdate.js +1 -1
- package/src/protocol.js +1 -1
- package/src/release.js +1 -1
- package/src/selfhost.js +1 -1
- package/vendor/cli/package.json +1 -1
- package/vendor/cli/scripts/check.mjs +1 -1
- package/vendor/cli/scripts/demo.mjs +1 -1
- package/vendor/cli/scripts/postinstall.mjs +1 -1
- package/vendor/cli/scripts/predist.mjs +1 -1
- package/vendor/cli/scripts/runtests.mjs +1 -1
- package/vendor/cli/src/app.js +1 -1
- package/vendor/cli/src/art.js +1 -1
- package/vendor/cli/src/chatflow.js +1 -1
- package/vendor/cli/src/checkpoint.js +1 -1
- package/vendor/cli/src/clipboard.js +1 -1
- package/vendor/cli/src/cloudsync.js +1 -1
- package/vendor/cli/src/commands.js +2 -2
- package/vendor/cli/src/config.js +1 -1
- package/vendor/cli/src/connect.js +1 -1
- package/vendor/cli/src/devrun.js +1 -1
- package/vendor/cli/src/diff.js +1 -1
- package/vendor/cli/src/diffview.js +1 -1
- package/vendor/cli/src/dream.js +1 -1
- package/vendor/cli/src/engine.js +1 -1
- package/vendor/cli/src/events.js +1 -1
- package/vendor/cli/src/export.js +1 -1
- package/vendor/cli/src/fingerprint.js +1 -1
- package/vendor/cli/src/format.js +1 -1
- package/vendor/cli/src/fuzzy.js +1 -1
- package/vendor/cli/src/history.js +1 -1
- package/vendor/cli/src/init.js +1 -1
- package/vendor/cli/src/markdown.js +1 -1
- package/vendor/cli/src/models.js +1 -1
- package/vendor/cli/src/overlays.js +1 -1
- package/vendor/cli/src/panels.js +1 -1
- package/vendor/cli/src/ping.js +1 -1
- package/vendor/cli/src/presence.js +1 -1
- package/vendor/cli/src/render.js +1 -1
- package/vendor/cli/src/screen.js +1 -1
- package/vendor/cli/src/screens.js +1 -1
- package/vendor/cli/src/secret.js +1 -1
- package/vendor/cli/src/securefs.js +1 -1
- package/vendor/cli/src/settings.js +1 -1
- package/vendor/cli/src/signup.js +1 -1
- package/vendor/cli/src/summarize.js +1 -1
- package/vendor/cli/src/sysdiag.js +1 -1
- package/vendor/cli/src/theme.js +1 -1
- package/vendor/cli/src/title.js +1 -1
- package/vendor/cli/src/todos.js +1 -1
- package/vendor/cli/src/tokens.js +1 -1
- package/vendor/cli/src/topup.js +1 -1
- package/vendor/cli/src/update.js +1 -1
- package/vendor/cli/vendor/client/aegis.js +1 -1
- package/vendor/cli/vendor/client/attest.js +1 -1
- package/vendor/cli/vendor/client/authorship-key.js +1 -1
- package/vendor/cli/vendor/client/auto-provision.js +1 -1
- package/vendor/cli/vendor/client/brain-catalog.js +1 -1
- package/vendor/cli/vendor/client/byok-catalog.js +1 -1
- package/vendor/cli/vendor/client/catalog-client.js +1 -1
- package/vendor/cli/vendor/client/conversation-export.js +1 -1
- package/vendor/cli/vendor/client/credentials.js +1 -1
- package/vendor/cli/vendor/client/credits.js +1 -1
- package/vendor/cli/vendor/client/drive-connect.js +1 -1
- package/vendor/cli/vendor/client/env-file.js +1 -1
- package/vendor/cli/vendor/client/fingerprint.js +1 -1
- package/vendor/cli/vendor/client/foreign-memory.js +1 -1
- package/vendor/cli/vendor/client/foreign-sessions.js +1 -1
- package/vendor/cli/vendor/client/google-signin.js +1 -1
- package/vendor/cli/vendor/client/hooks.js +1 -1
- package/vendor/cli/vendor/client/model-discovery.js +1 -1
- package/vendor/cli/vendor/client/model-sync.js +1 -1
- package/vendor/cli/vendor/client/naming.js +1 -1
- package/vendor/cli/vendor/client/platform.js +1 -1
- package/vendor/cli/vendor/client/prefs.js +1 -1
- package/vendor/cli/vendor/client/presence.js +1 -1
- package/vendor/cli/vendor/client/record-vault.js +2 -2
- package/vendor/cli/vendor/client/session-search.js +1 -1
- package/vendor/cli/vendor/client/session-store.js +1 -1
- package/vendor/cli/vendor/client/skills.js +1 -1
- package/vendor/cli/vendor/client/topup.js +1 -1
- package/vendor/cli/vendor/client/touch.js +1 -1
- package/vendor/cli/vendor/client/update.js +1 -1
- package/vendor/cli/vendor/client/user-models.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/attachments.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/autonomous.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/claude-pro.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/context.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/engine.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/entitlement.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/integrity.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/local.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/perm-rules.js +5 -0
- package/vendor/cli/vendor/desktop/lib/local/perm-store.js +5 -0
- package/vendor/cli/vendor/desktop/lib/local/perm-write.js +5 -0
- package/vendor/cli/vendor/desktop/lib/local/pro-sessions.js +3 -1
- package/vendor/cli/vendor/desktop/lib/local/prompt.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/queue.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/repeat-guard.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/session-rounds.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/spill.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/turn-guard.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/verify-stop.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/worktree-lock.js +1 -1
- package/vendor/cli/vendor/desktop/lib/settings.js +1 -1
- package/vendor/cli/vendor/desktop/renderer/usage.js +1 -1
- package/vendor/cli/vendor/hosts/install.js +1 -1
- package/vendor/cli/vendor/hosts/openai-shim.js +1 -1
- package/vendor/cli/vendor/hosts/spec.js +1 -1
- package/vendor/cli/vendor/hosts/targets.js +1 -1
- package/vendor/cli/vendor/mcp/admission.js +1 -1
- package/vendor/cli/vendor/mcp/server.js +1 -1
- package/vendor/cli/vendor/mcp/tools.js +1 -1
- package/vendor/cli/vendor/one/src/child.js +1 -1
- package/vendor/cli/vendor/one/src/protocol.js +1 -1
- package/vendor/cli/vendor/one/src/selfhost.js +1 -1
- package/vendor/desktop/bin/aegis.js +1 -1
- package/vendor/desktop/lib/auto.js +1 -1
- package/vendor/desktop/lib/avatar/companion.js +1 -1
- package/vendor/desktop/lib/avatar/cosmetics.js +1 -1
- package/vendor/desktop/lib/avatar/holder-turn.js +1 -1
- package/vendor/desktop/lib/avatar/holders.js +1 -1
- package/vendor/desktop/lib/avatar/identity.js +1 -1
- package/vendor/desktop/lib/avatar/level.js +1 -1
- package/vendor/desktop/lib/avatar/mirror.js +1 -1
- package/vendor/desktop/lib/avatar/persona.js +1 -1
- package/vendor/desktop/lib/avatar/profile.js +1 -1
- package/vendor/desktop/lib/avatar/register.js +1 -1
- package/vendor/desktop/lib/avatar/store.js +1 -1
- package/vendor/desktop/lib/avatar/transfer.js +1 -1
- package/vendor/desktop/lib/avatar/turn.js +1 -1
- package/vendor/desktop/lib/avatar/voice.js +1 -1
- package/vendor/desktop/lib/avatar/xp.js +1 -1
- package/vendor/desktop/lib/deep-link.js +1 -1
- package/vendor/desktop/lib/local/attachments.js +1 -1
- package/vendor/desktop/lib/local/autonomous.js +1 -1
- package/vendor/desktop/lib/local/claude-pro.js +1 -1
- package/vendor/desktop/lib/local/cli-face.js +1 -1
- package/vendor/desktop/lib/local/context.js +1 -1
- package/vendor/desktop/lib/local/engine.js +1 -1
- package/vendor/desktop/lib/local/entitlement.js +1 -1
- package/vendor/desktop/lib/local/integrity.js +1 -1
- package/vendor/desktop/lib/local/local.js +1 -1
- package/vendor/desktop/lib/local/perm-rules.js +5 -0
- package/vendor/desktop/lib/local/perm-store.js +5 -0
- package/vendor/desktop/lib/local/perm-write.js +5 -0
- package/vendor/desktop/lib/local/pro-sessions.js +3 -1
- package/vendor/desktop/lib/local/prompt.js +1 -1
- package/vendor/desktop/lib/local/pty-host.js +1 -1
- package/vendor/desktop/lib/local/queue.js +1 -1
- package/vendor/desktop/lib/local/repeat-guard.js +1 -1
- package/vendor/desktop/lib/local/session-rounds.js +1 -1
- package/vendor/desktop/lib/local/spill.js +1 -1
- package/vendor/desktop/lib/local/telemetry.js +1 -1
- package/vendor/desktop/lib/local/turn-guard.js +1 -1
- package/vendor/desktop/lib/local/verify-stop.js +1 -1
- package/vendor/desktop/lib/local/worktree-lock.js +1 -1
- package/vendor/desktop/lib/provider-key-mirror.js +1 -1
- package/vendor/desktop/lib/quick-launcher.js +1 -1
- package/vendor/desktop/lib/settings.js +1 -1
- package/vendor/desktop/lib/skills-host.js +1 -1
- package/vendor/desktop/lib/speech-host.js +1 -1
- package/vendor/desktop/lib/sync/memory-store.js +1 -1
- package/vendor/desktop/lib/sync/persist-gate.js +1 -1
- package/vendor/desktop/lib/window-state.js +1 -1
- package/vendor/desktop/package.json +1 -1
- package/vendor/desktop/preload.js +3 -1
- package/vendor/desktop/renderer/app.js +3 -3
- package/vendor/desktop/renderer/avatar/assemble.js +1 -1
- package/vendor/desktop/renderer/avatar/avatar.js +1 -1
- package/vendor/desktop/renderer/avatar/cards.js +1 -1
- package/vendor/desktop/renderer/avatar/hud.js +1 -1
- package/vendor/desktop/renderer/avatar/pane.js +1 -1
- package/vendor/desktop/renderer/avatar/parts.js +1 -1
- package/vendor/desktop/renderer/commands.js +1 -1
- package/vendor/desktop/renderer/companion.js +1 -1
- package/vendor/desktop/renderer/composer-triggers.js +1 -1
- package/vendor/desktop/renderer/dictation.js +1 -1
- package/vendor/desktop/renderer/diff.js +1 -1
- package/vendor/desktop/renderer/diffview.js +1 -1
- package/vendor/desktop/renderer/fingerprint.js +2 -2
- package/vendor/desktop/renderer/index.html +10 -4
- package/vendor/desktop/renderer/library.js +1 -1
- package/vendor/desktop/renderer/markdown.js +1 -1
- package/vendor/desktop/renderer/palette-filter.js +1 -1
- package/vendor/desktop/renderer/provider-toolbar.js +1 -1
- package/vendor/desktop/renderer/providers.js +1 -1
- package/vendor/desktop/renderer/pty-frame.css +35 -0
- package/vendor/desktop/renderer/pty-frame.html +47 -0
- package/vendor/desktop/renderer/pty-panel.js +1 -1
- package/vendor/desktop/renderer/quick.js +1 -1
- package/vendor/desktop/renderer/settings-skills.js +1 -1
- package/vendor/desktop/renderer/shortcuts.js +1 -1
- package/vendor/desktop/renderer/stream-policy.js +1 -1
- package/vendor/desktop/renderer/style.css +22 -0
- package/vendor/desktop/renderer/transcript-view.js +1 -1
- package/vendor/desktop/renderer/usage.js +1 -1
- package/vendor/desktop/renderer/welcome-rows.js +1 -1
- package/vendor/desktop/vendor/aegis.js +1 -1
- package/vendor/desktop/vendor/attest.js +1 -1
- package/vendor/desktop/vendor/authorship-key.js +1 -1
- package/vendor/desktop/vendor/auto-provision.js +1 -1
- package/vendor/desktop/vendor/brain-catalog.js +1 -1
- package/vendor/desktop/vendor/byok-catalog.js +1 -1
- package/vendor/desktop/vendor/catalog-client.js +1 -1
- package/vendor/desktop/vendor/conversation-export.js +1 -1
- package/vendor/desktop/vendor/credentials.js +1 -1
- package/vendor/desktop/vendor/credits.js +1 -1
- package/vendor/desktop/vendor/drive-connect.js +1 -1
- package/vendor/desktop/vendor/env-file.js +1 -1
- package/vendor/desktop/vendor/faces/cli/bin/aegiscode.js +2 -2
- package/vendor/desktop/vendor/faces/cli/package.json +1 -1
- package/vendor/desktop/vendor/faces/cli/scripts/check.mjs +1 -1
- package/vendor/desktop/vendor/faces/cli/scripts/demo.mjs +1 -1
- package/vendor/desktop/vendor/faces/cli/scripts/postinstall.mjs +1 -1
- package/vendor/desktop/vendor/faces/cli/scripts/predist.mjs +1 -1
- package/vendor/desktop/vendor/faces/cli/scripts/runtests.mjs +1 -1
- package/vendor/desktop/vendor/faces/cli/src/app.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/art.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/autonomous.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/caps.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/chatflow.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/checkpoint.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/clipboard.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/cloudsync.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/commands.js +2 -2
- package/vendor/desktop/vendor/faces/cli/src/config.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/connect.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/devrun.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/diff.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/diffview.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/dream.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/engine.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/events.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/export.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/fingerprint.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/format.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/fuzzy.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/history.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/init.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/limits.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/markdown.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/mcp.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/models.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/overlays.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/panels.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/permissions.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/ping.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/presence.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/provenance.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/render.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/screen.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/screens.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/secret.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/securefs.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/settings.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/signup.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/summarize.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/sysdiag.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/theme.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/title.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/todos.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/tokens.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/topup.js +1 -1
- package/vendor/desktop/vendor/faces/cli/src/update.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/aegis.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/attest.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/authorship-key.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/auto-provision.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/brain-catalog.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/byok-catalog.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/catalog-client.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/conversation-export.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/credentials.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/credits.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/drive-connect.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/env-file.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/fingerprint.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/foreign-memory.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/foreign-sessions.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/google-signin.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/hooks.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/model-discovery.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/model-sync.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/naming.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/platform.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/prefs.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/presence.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/record-vault.js +2 -2
- package/vendor/desktop/vendor/faces/cli/vendor/client/session-search.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/session-store.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/skills.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/topup.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/touch.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/update.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/client/user-models.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/attachments.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/autonomous.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/claude-pro.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/context.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/engine.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/entitlement.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/exec-plan.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/integrity.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/local.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/perm-rules.js +2 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/perm-store.js +3 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/perm-write.js +2 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/pro-sessions.js +3 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/prompt.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/queue.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/repeat-guard.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/session-rounds.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/shell.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/spill.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/tools.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/turn-guard.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/verify-stop.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/worktree-lock.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/settings.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/main.js +3 -3
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/renderer/usage.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/install.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/openai-shim.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/spec.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/targets.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/mcp/admission.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/mcp/server.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/mcp/tools.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/one/src/child.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/one/src/protocol.js +1 -1
- package/vendor/desktop/vendor/faces/cli/vendor/one/src/selfhost.js +1 -1
- package/vendor/desktop/vendor/fingerprint.js +1 -1
- package/vendor/desktop/vendor/foreign-memory.js +1 -1
- package/vendor/desktop/vendor/foreign-sessions.js +1 -1
- package/vendor/desktop/vendor/google-signin.js +1 -1
- package/vendor/desktop/vendor/hooks.js +1 -1
- package/vendor/desktop/vendor/model-discovery.js +1 -1
- package/vendor/desktop/vendor/model-sync.js +1 -1
- package/vendor/desktop/vendor/naming.js +1 -1
- package/vendor/desktop/vendor/platform.js +1 -1
- package/vendor/desktop/vendor/prefs.js +1 -1
- package/vendor/desktop/vendor/presence.js +1 -1
- package/vendor/desktop/vendor/protocol.js +1 -1
- package/vendor/desktop/vendor/record-vault.js +2 -2
- package/vendor/desktop/vendor/selfhost.js +1 -1
- package/vendor/desktop/vendor/session-search.js +1 -1
- package/vendor/desktop/vendor/session-store.js +1 -1
- package/vendor/desktop/vendor/skills.js +1 -1
- package/vendor/desktop/vendor/topup.js +1 -1
- package/vendor/desktop/vendor/touch.js +1 -1
- package/vendor/desktop/vendor/update.js +1 -1
- package/vendor/desktop/vendor/user-models.js +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
2
|
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
3
|
-
"use strict";const{spawnSync:spawnSync}=require("node:child_process"),fs=require("node:fs"),path=require("node:path"),{aegisDir:aegisDir}=require("./config.js"),{writePrivateFile:writePrivateFile}=require("./securefs.js"),ESC="",realPlatform=()=>process.platform;function clipboardCandidates(e,{platform:t=realPlatform(),env:r=process.env}={}){const n="linux"===t,o="darwin"===t,i="win32"===t,a=!!(r||{}).WAYLAND_DISPLAY;return"write"===e?[o&&{name:"pbcopy",cmd:"pbcopy",args:[],env:"any"},i&&{name:"clip",cmd:"clip",args:[],env:"any"},...n?a?[{name:"wl-copy",cmd:"wl-copy",args:[],env:"wayland"},{name:"xclip",cmd:"xclip",args:["-selection","clipboard"],env:"x11"},{name:"xsel",cmd:"xsel",args:["--clipboard","--input"],env:"x11"}]:[{name:"xclip",cmd:"xclip",args:["-selection","clipboard"],env:"x11"},{name:"xsel",cmd:"xsel",args:["--clipboard","--input"],env:"x11"},{name:"wl-copy",cmd:"wl-copy",args:[],env:"wayland"}]:[]].filter(Boolean):"text"===e?[o&&{name:"pbpaste",cmd:"pbpaste",args:[],env:"any"},i&&{name:"powershell",cmd:"powershell",args:["-NoProfile","-Command","Get-Clipboard"],env:"any",winNewline:!0},...n?[{name:"wl-paste",cmd:"wl-paste",args:["--no-newline"],env:"wayland"},{name:"xclip",cmd:"xclip",args:["-selection","clipboard","-o"],env:"x11"},{name:"xsel",cmd:"xsel",args:["--clipboard","--output"],env:"x11"}]:[]].filter(Boolean):[o&&{name:"pngpaste",cmd:"pngpaste",args:["-"],env:"any"},...n?[{name:"wl-paste",cmd:"wl-paste",args:["--type","image/png"],env:"wayland",mime:"image/png"},{name:"wl-paste",cmd:"wl-paste",args:["--type","image/jpeg"],env:"wayland",mime:"image/jpeg"},{name:"xclip",cmd:"xclip",args:["-selection","clipboard","-t","image/png","-o"],env:"x11",mime:"image/png"}]:[]].filter(Boolean)}function dirIsTrusted(e,{platform:t=realPlatform()}={}){try{const r=fs.statSync(e);return!(!r.isDirectory()||"win32"!==t&&(18&r.mode||"function"==typeof process.getuid&&0!==r.uid&&r.uid!==process.getuid()))}catch{return!1}}const WIN_EXTS=["",".exe",".cmd",".bat",".com"];function joinFor(e,t,r){return r&&(/\\/.test(e)||/^[A-Za-z]:/.test(e))?path.win32.join(e,t):path.join(e,t)}function resolveTrustedTool(e,{platform:t=realPlatform(),env:r=process.env}={}){const n=r||{},o="0"!==n.AEGISCODE_TRUST_PATH,i="win32"===t,a=i?path.win32:path,s=String((null!=n.PATH?n.PATH:process.env.PATH)||"").split(i?";":path.delimiter),c=o||i;for(const r of s){const n=String(r).trim().replace(/^"|"$/g,"");if(n&&(i||a.isAbsolute(n))&&(!c||dirIsTrusted(n,{platform:t})))for(const r of i?WIN_EXTS:[""]){const o=joinFor(n,e+r,i);let a,s;try{a=fs.realpathSync(o)}catch{continue}try{s=fs.statSync(a)}catch{continue}if(s.isFile()){if(!i){if(!(73&s.mode))continue;if(c){if(18&s.mode)continue;if("function"==typeof process.getuid&&0!==s.uid&&s.uid!==process.getuid())continue;if(!dirIsTrusted(path.dirname(a),{platform:t}))continue}}return a}}}return null}const base64=e=>Buffer.from(String(e),"utf8").toString("base64"),OSC52_MAX=1e5;function osc52Sequence(e,t=process.env){const r
|
|
3
|
+
"use strict";const{spawnSync:spawnSync}=require("node:child_process"),fs=require("node:fs"),path=require("node:path"),{aegisDir:aegisDir}=require("./config.js"),{writePrivateFile:writePrivateFile}=require("./securefs.js"),ESC="",realPlatform=()=>process.platform;function clipboardCandidates(e,{platform:t=realPlatform(),env:r=process.env}={}){const n="linux"===t,o="darwin"===t,i="win32"===t,a=!!(r||{}).WAYLAND_DISPLAY;return"write"===e?[o&&{name:"pbcopy",cmd:"pbcopy",args:[],env:"any"},i&&{name:"clip",cmd:"clip",args:[],env:"any"},...n?a?[{name:"wl-copy",cmd:"wl-copy",args:[],env:"wayland"},{name:"xclip",cmd:"xclip",args:["-selection","clipboard"],env:"x11"},{name:"xsel",cmd:"xsel",args:["--clipboard","--input"],env:"x11"}]:[{name:"xclip",cmd:"xclip",args:["-selection","clipboard"],env:"x11"},{name:"xsel",cmd:"xsel",args:["--clipboard","--input"],env:"x11"},{name:"wl-copy",cmd:"wl-copy",args:[],env:"wayland"}]:[]].filter(Boolean):"text"===e?[o&&{name:"pbpaste",cmd:"pbpaste",args:[],env:"any"},i&&{name:"powershell",cmd:"powershell",args:["-NoProfile","-Command","Get-Clipboard"],env:"any",winNewline:!0},...n?[{name:"wl-paste",cmd:"wl-paste",args:["--no-newline"],env:"wayland"},{name:"xclip",cmd:"xclip",args:["-selection","clipboard","-o"],env:"x11"},{name:"xsel",cmd:"xsel",args:["--clipboard","--output"],env:"x11"}]:[]].filter(Boolean):[o&&{name:"pngpaste",cmd:"pngpaste",args:["-"],env:"any"},...n?[{name:"wl-paste",cmd:"wl-paste",args:["--type","image/png"],env:"wayland",mime:"image/png"},{name:"wl-paste",cmd:"wl-paste",args:["--type","image/jpeg"],env:"wayland",mime:"image/jpeg"},{name:"xclip",cmd:"xclip",args:["-selection","clipboard","-t","image/png","-o"],env:"x11",mime:"image/png"}]:[]].filter(Boolean)}function dirIsTrusted(e,{platform:t=realPlatform()}={}){try{const r=fs.statSync(e);return!(!r.isDirectory()||"win32"!==t&&(18&r.mode||"function"==typeof process.getuid&&0!==r.uid&&r.uid!==process.getuid()))}catch{return!1}}const WIN_EXTS=["",".exe",".cmd",".bat",".com"];function joinFor(e,t,r){return r&&(/\\/.test(e)||/^[A-Za-z]:/.test(e))?path.win32.join(e,t):path.join(e,t)}function resolveTrustedTool(e,{platform:t=realPlatform(),env:r=process.env}={}){const n=r||{},o="0"!==n.AEGISCODE_TRUST_PATH,i="win32"===t,a=i?path.win32:path,s=String((null!=n.PATH?n.PATH:process.env.PATH)||"").split(i?";":path.delimiter),c=o||i;for(const r of s){const n=String(r).trim().replace(/^"|"$/g,"");if(n&&(i||a.isAbsolute(n))&&(!c||dirIsTrusted(n,{platform:t})))for(const r of i?WIN_EXTS:[""]){const o=joinFor(n,e+r,i);let a,s;try{a=fs.realpathSync(o)}catch{continue}try{s=fs.statSync(a)}catch{continue}if(s.isFile()){if(!i){if(!(73&s.mode))continue;if(c){if(18&s.mode)continue;if("function"==typeof process.getuid&&0!==s.uid&&s.uid!==process.getuid())continue;if(!dirIsTrusted(path.dirname(a),{platform:t}))continue}}return a}}}return null}const base64=e=>Buffer.from(String(e),"utf8").toString("base64"),OSC52_MAX=1e5;function osc52Sequence(e,t=process.env){const r=`]52;c;${base64(e)}`,n=t||{};return n.TMUX?`Ptmux;${r.split("").join("")}\\`:n.STY?`P${r}\\`:r}function writeOsc52(e,{stdout:t=process.stdout,env:r=process.env}={}){const n=r||{};if("1"===n.AEGISCODE_NO_OSC52)return!1;if(!t||!t.isTTY||"function"!=typeof t.write)return!1;const o=String(e);if(!o||o.length>1e5)return!1;try{return t.write(osc52Sequence(o,n)),!0}catch{return!1}}function copyToClipboard(e,t={}){const{stdout:r=process.stdout,env:n=process.env,platform:o=realPlatform(),spawn:i=spawnSync}=t,a=n||{};if("1"!==a.AEGISCODE_NO_CLIPBOARD){for(const t of clipboardCandidates("write",{platform:o,env:a})){const r=resolveTrustedTool(t.cmd,{platform:o,env:a});if(!r)continue;const n=i(r,t.args,{input:String(e),encoding:"utf8",timeout:4e3,windowsHide:!0});if(!n.error&&0===n.status)return{ok:!0,via:`tool:${t.name}`}}if(writeOsc52(e,{stdout:r,env:a}))return{ok:!0,via:"osc52:"+(a.TMUX?"tmux":a.STY?"screen":"terminal")}}try{const t=path.join(aegisDir(),"clipboard.txt");return writePrivateFile(t,String(e),{atomic:!1}),{ok:!0,via:"file",path:t}}catch{return{ok:!1,via:"none"}}}function describeCopy(e,t="Copied"){if(!e||!e.ok)return"Clipboard unavailable; nothing copied.";if("file"===e.via)return`${t} — no clipboard tool on this host; the text is in ${e.path}`;const[r,n]=String(e.via).split(":");return"osc52"===r?"terminal"===n?`${t} to the clipboard via the terminal.`:`${t} to the clipboard (through ${n}).`:`${t} to the clipboard (${n}).`}const PNG_MAGIC=Buffer.from([137,80,78,71,13,10,26,10]),JPEG_MAGIC=Buffer.from([255,216,255]);function sniffImage(e){return!e||e.length<8?null:e.subarray(0,8).equals(PNG_MAGIC)?"image/png":e.subarray(0,3).equals(JPEG_MAGIC)?"image/jpeg":null}function readClipboardText(e={}){const{env:t=process.env,platform:r=realPlatform(),spawn:n=spawnSync}=e,o=t||{};if("1"===o.AEGISCODE_NO_CLIPBOARD)return{ok:!1,via:"none",error:"clipboard disabled"};for(const e of clipboardCandidates("text",{platform:r,env:o})){const t=resolveTrustedTool(e.cmd,{platform:r,env:o});if(!t)continue;const i=n(t,e.args,{encoding:"utf8",timeout:4e3,maxBuffer:16777216,windowsHide:!0});if(!i.error&&0===i.status&&null!=i.stdout)return{ok:!0,text:e.winNewline?String(i.stdout).replace(/\r\n/g,"\n").replace(/\n$/,""):String(i.stdout),via:`tool:${e.name}`}}return{ok:!1,via:"none",error:"no clipboard reader available"}}function readClipboardImage(e={}){const{env:t=process.env,platform:r=realPlatform(),spawn:n=spawnSync}=e,o=t||{};if("1"===o.AEGISCODE_NO_CLIPBOARD)return{ok:!1,via:"none",error:"clipboard disabled"};for(const e of clipboardCandidates("image",{platform:r,env:o})){const t=resolveTrustedTool(e.cmd,{platform:r,env:o});if(!t)continue;const i=n(t,e.args,{timeout:5e3,maxBuffer:67108864,windowsHide:!0});if(i.error||0!==i.status||!i.stdout)continue;const a=Buffer.isBuffer(i.stdout)?i.stdout:Buffer.from(String(i.stdout),"utf8"),s=sniffImage(a);if(s)return{ok:!0,data:a,mime:s,via:`tool:${e.name}`}}return{ok:!1,via:"none",error:"no image on the clipboard"}}function clipboardCapabilities({platform:e=realPlatform(),env:t=process.env}={}){const r=r=>clipboardCandidates(r,{platform:e,env:t}).some(r=>!!resolveTrustedTool(r.cmd,{platform:e,env:t}));return{canWrite:r("write"),canReadText:r("text"),canReadImage:r("image")}}module.exports={copyToClipboard:copyToClipboard,describeCopy:describeCopy,readClipboardText:readClipboardText,readClipboardImage:readClipboardImage,sniffImage:sniffImage,clipboardCandidates:clipboardCandidates,clipboardCapabilities:clipboardCapabilities,osc52Sequence:osc52Sequence,writeOsc52:writeOsc52,resolveTrustedTool:resolveTrustedTool,dirIsTrusted:dirIsTrusted};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
2
|
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
3
|
-
"use strict";const fs=require("node:fs"),path=require("node:path"),{aegisDir:aegisDir}=require("./config.js"),{historyPath:historyPath,appendHistoryEntries:appendHistoryEntries,readHistoryEntries:readHistoryEntries,readSessionTranscript:readSessionTranscript}=require("./history.js"),{estimateTokens:estimateTokens}=require("./tokens.js"),SOURCE="aegiscode-cli",SYNC_FILE="sync-state.json",DEFAULT_LIMIT=50;function syncStatePath(){return path.join(aegisDir(),SYNC_FILE)}function loadState(){try{const t=JSON.parse(fs.readFileSync(syncStatePath(),"utf8"));if(t&&"object"==typeof t)return{sessions:t.sessions&&"object"==typeof t.sessions?t.sessions:{},lastPushAt:t.lastPushAt||null,lastPullAt:t.lastPullAt||null,importedRemoteAt:t.importedRemoteAt||{},importedRemoteCount:t.importedRemoteCount||{},quota:t.quota&&"object"==typeof t.quota?t.quota:null}}catch{}return{sessions:{},lastPushAt:null,lastPullAt:null,importedRemoteAt:{},importedRemoteCount:{},quota:null}}function readQuota(t){if(!t||"object"!=typeof t)return null;const e=null!=t.tokensUsed?t.tokensUsed:t.tokens_used,s=null!=t.tokenLimit?t.tokenLimit:t.token_limit;if(null==e||null==s)return null;const n=Number(e),o=Number(s);return Number.isFinite(n)&&Number.isFinite(o)?{used:n,limit:o}:null}function recordQuota(t,e,s){const n=Number(e),o=Number(s);return!t||!Number.isFinite(n)||!Number.isFinite(o)||o<=0?null:(t.quota={used:n,limit:o,over:n>=o,at:Date.now()},t.quota)}function saveState(t){try{fs.mkdirSync(aegisDir(),{recursive:!0});const e=syncStatePath()+".tmp";return fs.writeFileSync(e,JSON.stringify(t,null,2)+"\n"),fs.renameSync(e,syncStatePath()),!0}catch(t){return process.env.AEGIS_HIST_DEBUG&&console.error("[cloudsync] write failed:",t),!1}}function localSessions({limit:t=
|
|
3
|
+
"use strict";const fs=require("node:fs"),path=require("node:path"),{aegisDir:aegisDir}=require("./config.js"),{historyPath:historyPath,appendHistoryEntries:appendHistoryEntries,readHistoryEntries:readHistoryEntries,readSessionTranscript:readSessionTranscript}=require("./history.js"),{estimateTokens:estimateTokens}=require("./tokens.js"),SOURCE="aegiscode-cli",SYNC_FILE="sync-state.json",DEFAULT_LIMIT=50;function syncStatePath(){return path.join(aegisDir(),SYNC_FILE)}function loadState(){try{const t=JSON.parse(fs.readFileSync(syncStatePath(),"utf8"));if(t&&"object"==typeof t)return{sessions:t.sessions&&"object"==typeof t.sessions?t.sessions:{},lastPushAt:t.lastPushAt||null,lastPullAt:t.lastPullAt||null,importedRemoteAt:t.importedRemoteAt||{},importedRemoteCount:t.importedRemoteCount||{},quota:t.quota&&"object"==typeof t.quota?t.quota:null}}catch{}return{sessions:{},lastPushAt:null,lastPullAt:null,importedRemoteAt:{},importedRemoteCount:{},quota:null}}function readQuota(t){if(!t||"object"!=typeof t)return null;const e=null!=t.tokensUsed?t.tokensUsed:t.tokens_used,s=null!=t.tokenLimit?t.tokenLimit:t.token_limit;if(null==e||null==s)return null;const n=Number(e),o=Number(s);return Number.isFinite(n)&&Number.isFinite(o)?{used:n,limit:o}:null}function recordQuota(t,e,s){const n=Number(e),o=Number(s);return!t||!Number.isFinite(n)||!Number.isFinite(o)||o<=0?null:(t.quota={used:n,limit:o,over:n>=o,at:Date.now()},t.quota)}function saveState(t){try{fs.mkdirSync(aegisDir(),{recursive:!0});const e=syncStatePath()+".tmp";return fs.writeFileSync(e,JSON.stringify(t,null,2)+"\n"),fs.renameSync(e,syncStatePath()),!0}catch(t){return process.env.AEGIS_HIST_DEBUG&&console.error("[cloudsync] write failed:",t),!1}}function localSessions({limit:t=50}={}){const e=new Map;for(const t of readHistoryEntries()){if(!t||!t.sessionId)continue;const s=e.get(t.sessionId)||{id:t.sessionId,cwd:t.cwd||"",firstPrompt:"",updatedAt:"",exchanges:0};s.exchanges+=1,!s.firstPrompt&&t.prompt&&(s.firstPrompt=String(t.prompt)),String(t.ts||"")>String(s.updatedAt||"")&&(s.updatedAt=t.ts||""),e.set(t.sessionId,s)}return[...e.values()].sort((t,e)=>String(t.updatedAt)<String(e.updatedAt)?1:-1).slice(0,Math.max(1,t))}function titleFor(t){return String(t&&t.firstPrompt||"").replace(/\s+/g," ").trim().slice(0,80)}function buildTranscript(t,e={}){const s=(e.transcript||readSessionTranscript(t.id)).filter(t=>t&&("user"===t.role||"assistant"===t.role)).map(t=>({role:t.role,content:String(null==t.text?"":t.text)}));return{session_id:t.id,title:null!=e.title?e.title:titleFor(t),messages:s,source:e.source||SOURCE}}function isPending(t,e){const s=e.sessions[t.id];return!s||!s.syncedAt||String(t.updatedAt||"")>String(s.localUpdatedAt||"")}function listPending(t={}){const e=t.state||loadState(),s=localSessions({...t,limit:Number.MAX_SAFE_INTEGER}).filter(t=>isPending(t,e)).reverse();return t.limit?s.slice(0,t.limit):s}function markSynced(t,e,s={}){const n=t.sessions[e]||{};return t.sessions[e]={...n,syncedAt:Date.now(),localUpdatedAt:s.localUpdatedAt||n.localUpdatedAt||"",remoteUpdatedAt:s.remoteUpdatedAt||n.remoteUpdatedAt||null,lastError:null},t.sessions[e]}function markFailed(t,e,s){const n=t.sessions[e]||{};return t.sessions[e]={...n,lastError:s,failedAt:Date.now()},t.sessions[e]}function entriesFromRemote(t,e,s=0){const n=[],o=Array.isArray(t.messages)?t.messages:[],i=s>0&&s<=o.length?o.slice(s):o;let r=null;const a=(s,o)=>{null==s&&null==o||n.push({ts:t.updated_at||e,sessionId:t.session_id,cwd:"",prompt:null==s?"":String(s),reply:null==o?"":String(o),status:"done",imported:!0,importedFrom:String(t.source||"cloud"),tokens:{input:estimateTokens(String(s||"")),output:estimateTokens(String(o||"")),cacheRead:0,cacheWrite:0,real:!1}})};for(const t of i){const e=t&&t.role,s=t&&(null!=t.content?t.content:t.text);"user"===e?(null!=r&&a(r,null),r=null==s?"":s):"assistant"!==e&&"system"!==e||(a(r,s),r=null)}return null!=r&&a(r,null),n}function describeError(t){const e=t&&(t.status||t.response&&t.response.status),s=t&&t.message||String(t);if(402===e){const n=t&&t.data||{},o=null!=n.tokensUsed?n.tokensUsed:n.sessionsUsed,i=null!=n.tokenLimit?n.tokenLimit:n.freeSessionLimit;return{kind:"quota",status:e,message:s,used:null!=o?Number(o):null,limit:null!=i?Number(i):null,hint:"the plan’s synced-token ceiling is reached — everything already stored stays readable, only NEW writes pause: /cloud memory shows the quota, /cloud memory off stops syncing"}}return 401===e?{kind:"auth",status:e,message:s,hint:"the memory token was refused — run /key <api_key> to re-exchange it"}:{kind:"error",status:e||null,message:s,hint:null}}async function push(t,e={}){const s=e.state||loadState(),n=e.limit||50,o=e.sessionIds?e.sessionIds.map(t=>localSessions({limit:Number.MAX_SAFE_INTEGER,state:s}).find(e=>e.id===t)).filter(Boolean):listPending({...e,limit:n,state:s}),i=[],r=[],a=[];for(const n of o){const o=buildTranscript(n,{});if(o.messages.length)try{const r=await t.conversationSyncPush(o),a=r&&(r.session_id||r.id)||n.id;markSynced(s,n.id,{localUpdatedAt:n.updatedAt,remoteUpdatedAt:r&&r.updated_at||(new Date).toISOString()});const l=readQuota(r);i.push({id:n.id,remoteId:a,messages:o.messages.length,title:o.title,quota:l}),l&&recordQuota(s,l.used,l.limit),"function"==typeof e.onProgress&&e.onProgress({phase:"push",id:n.id})}catch(t){const e=describeError(t);if(markFailed(s,n.id,e.message),r.push({id:n.id,...e}),"quota"!==e.kind||recordQuota(s,e.used,e.limit)||(s.quota={used:null,limit:null,over:!0,at:Date.now()}),"quota"===e.kind||"auth"===e.kind)break}else a.push({id:n.id,reason:"no messages"})}return i.length&&(s.lastPushAt=Date.now()),saveState(s),{pushed:i,failed:r,skipped:a,pending:listPending({state:s}).length}}async function pull(t,e={}){const s=e.state||loadState(),n=!1!==e.import;let o;try{o=await t.conversationSyncPull()}catch(t){return{ok:!1,sessions:[],imported:0,failed:[describeError(t)]}}const i=o&&o.sessions||[],r=[],a=(new Date).toISOString(),l=[];for(const t of i){const e=t&&t.session_id;if(!e)continue;const o=s.importedRemoteAt[e],i=Array.isArray(t.messages)?t.messages.length:0,u=Number((s.importedRemoteCount||{})[e]||0),d=!o||o!==t.updated_at||i!==u;if(n&&d){const n=entriesFromRemote(t,a,i>=u?u:0);n.length&&l.push(...n),s.importedRemoteAt[e]=t.updated_at||a,s.importedRemoteCount={...s.importedRemoteCount||{},[e]:i}}markSynced(s,e,{localUpdatedAt:t.updated_at||a,remoteUpdatedAt:t.updated_at||a}),r.push({id:e,title:t.title||"",messages:(t.messages||[]).length,source:t.source||"",updatedAt:t.updated_at||null,imported:n&&d})}const u=l.length?appendHistoryEntries(l):0;return s.lastPullAt=Date.now(),saveState(s),{ok:!0,sessions:r,remote:i.length,imported:u,failed:[]}}async function syncNow(t,e={}){const s=e.state||loadState(),n={ok:!0,push:null,pull:null};try{n.push=await push(t,{...e,state:s})}catch(t){n.ok=!1,n.push={pushed:[],failed:[describeError(t)],skipped:[]}}try{n.pull=await pull(t,{...e,state:s}),n.pull&&!1===n.pull.ok&&(n.ok=!1)}catch(t){n.ok=!1,n.pull={ok:!1,sessions:[],imported:0,failed:[describeError(t)]}}return n}function status(){const t=loadState(),e=localSessions({limit:Number.MAX_SAFE_INTEGER}),s=e.filter(e=>isPending(e,t)),n=e.filter(e=>t.sessions[e.id]&&t.sessions[e.id].lastError).map(e=>({id:e.id,error:t.sessions[e.id].lastError})),o=t.quota||null,i=Boolean(o&&o.over);return{local:e.length,pending:s.length,synced:e.length-s.length,lastPushAt:t.lastPushAt,lastPullAt:t.lastPullAt,importedRemote:Object.keys(t.importedRemoteAt||{}).length,errors:n,quota:o,overQuota:i,paused:i&&s.length>0,path:syncStatePath(),historyPath:historyPath()}}module.exports={SOURCE:SOURCE,syncStatePath:syncStatePath,loadState:loadState,saveState:saveState,localSessions:localSessions,titleFor:titleFor,buildTranscript:buildTranscript,isPending:isPending,listPending:listPending,markSynced:markSynced,markFailed:markFailed,entriesFromRemote:entriesFromRemote,describeError:describeError,recordQuota:recordQuota,readQuota:readQuota,push:push,pull:pull,syncNow:syncNow,status:status};
|