aegisone 1.0.34 → 1.0.37
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/LICENSE +661 -0
- package/README.md +1 -1
- package/SOURCE-OFFER.txt +9 -0
- package/bin/aegis.js +1 -322
- package/package.json +4 -5
- package/scripts/bump.mjs +1 -211
- package/scripts/bundle.js +1 -129
- package/scripts/predist.mjs +1 -976
- package/src/child.js +1 -285
- package/src/dispatch.js +1 -269
- package/src/doctor.js +1 -639
- package/src/host.js +1 -111
- package/src/iface/paths.js +3 -0
- package/src/iface/pty.js +3 -0
- package/src/iface/update.js +3 -0
- package/src/iface/window.js +3 -0
- package/src/permissions.js +1 -383
- package/src/probes.js +1 -159
- package/src/protocol.js +3 -0
- package/src/release.js +1 -409
- package/src/selfhost.js +3 -0
- package/vendor/cli/package.json +3 -7
- package/vendor/cli/scripts/check.mjs +1 -52
- package/vendor/cli/scripts/demo.mjs +1 -94
- package/vendor/cli/scripts/predist.mjs +1 -75
- package/vendor/cli/scripts/runtests.mjs +1 -56
- package/vendor/cli/scripts/seal-gate.mjs +1 -74
- package/vendor/cli/src/agents.js +1 -139
- package/vendor/cli/src/app.js +1 -2957
- package/vendor/cli/src/art.js +1 -289
- package/vendor/cli/src/chatflow.js +1 -3023
- package/vendor/cli/src/checkpoint.js +1 -90
- package/vendor/cli/src/clipboard.js +1 -424
- package/vendor/cli/src/cloudsync.js +1 -528
- package/vendor/cli/src/commands.js +1 -4089
- package/vendor/cli/src/config.js +1 -581
- package/vendor/cli/src/connect.js +1 -349
- package/vendor/cli/src/credentials.js +1 -33
- package/vendor/cli/src/deps.js +1 -232
- package/vendor/cli/src/devrun.js +1 -187
- package/vendor/cli/src/diff.js +1 -333
- package/vendor/cli/src/diffview.js +1 -296
- package/vendor/cli/src/engine.js +1 -297
- package/vendor/cli/src/entitlement.js +1 -355
- package/vendor/cli/src/events.js +1 -707
- package/vendor/cli/src/export.js +1 -67
- package/vendor/cli/src/filepreview.js +1 -153
- package/vendor/cli/src/fingerprint.js +1 -592
- package/vendor/cli/src/format.js +1 -259
- package/vendor/cli/src/fuzzy.js +1 -119
- package/vendor/cli/src/history.js +1 -423
- package/vendor/cli/src/init.js +1 -175
- package/vendor/cli/src/input.js +1 -139
- package/vendor/cli/src/keys.js +1 -183
- package/vendor/cli/src/markdown.js +1 -306
- package/vendor/cli/src/models.js +1 -507
- package/vendor/cli/src/naming.js +1 -57
- package/vendor/cli/src/overlays.js +1 -462
- package/vendor/cli/src/panels.js +1 -1418
- package/vendor/cli/src/ping.js +1 -226
- package/vendor/cli/src/presence.js +1 -238
- package/vendor/cli/src/render.js +1 -516
- package/vendor/cli/src/screen.js +1 -518
- package/vendor/cli/src/screens.js +1 -896
- package/vendor/cli/src/secret.js +1 -59
- package/vendor/cli/src/securefs.js +1 -359
- package/vendor/cli/src/settings.js +1 -155
- package/vendor/cli/src/shared.js +1 -52
- package/vendor/cli/src/sharedpaths.js +1 -53
- package/vendor/cli/src/signup.js +1 -156
- package/vendor/cli/src/summarize.js +1 -95
- package/vendor/cli/src/sysdiag.js +1 -585
- package/vendor/cli/src/system.js +1 -40
- package/vendor/cli/src/theme.js +1 -570
- package/vendor/cli/src/title.js +1 -220
- package/vendor/cli/src/todos.js +1 -115
- package/vendor/cli/src/tokens.js +1 -263
- package/vendor/cli/src/topup.js +1 -210
- package/vendor/cli/src/update.js +1 -191
- package/vendor/cli/vendor/client/aegis.js +1 -2441
- package/vendor/cli/vendor/client/attest.js +1 -518
- package/vendor/cli/vendor/client/authorship-key.js +1 -410
- package/vendor/cli/vendor/client/auto-provision.js +1 -134
- package/vendor/cli/vendor/client/brain-catalog.js +1 -268
- package/vendor/cli/vendor/client/byok-catalog.js +1 -199
- package/vendor/cli/vendor/client/catalog-client.js +1 -487
- package/vendor/cli/vendor/client/conversation-export.js +1 -177
- package/vendor/cli/vendor/client/credentials.js +1 -494
- package/vendor/cli/vendor/client/device-fingerprint.js +1 -141
- package/vendor/cli/vendor/client/drive-connect.js +1 -110
- package/vendor/cli/vendor/client/drive-upload.js +1 -234
- package/vendor/cli/vendor/client/env-file.js +1 -1273
- package/vendor/cli/vendor/client/fingerprint.js +1 -1064
- package/vendor/cli/vendor/client/foreign-memory.js +1 -669
- package/vendor/cli/vendor/client/google-signin.js +1 -133
- package/vendor/cli/vendor/client/hooks.js +1 -430
- package/vendor/cli/vendor/client/model-discovery.js +1 -373
- package/vendor/cli/vendor/client/naming.js +1 -283
- package/vendor/cli/vendor/client/platform.js +1 -937
- package/vendor/cli/vendor/client/prefs.js +1 -351
- package/vendor/cli/vendor/client/presence-constants.js +1 -107
- package/vendor/cli/vendor/client/presence.js +1 -438
- package/vendor/cli/vendor/client/record-vault.js +3 -1055
- package/vendor/cli/vendor/client/session-store.js +1 -575
- package/vendor/cli/vendor/client/topup.js +1 -297
- package/vendor/cli/vendor/client/touch.js +1 -458
- package/vendor/cli/vendor/client/update.js +1 -763
- package/vendor/cli/vendor/client/user-models.js +1 -381
- package/vendor/cli/vendor/desktop/lib/local/agents.js +1 -105
- package/vendor/cli/vendor/desktop/lib/local/attachments.js +1 -276
- package/vendor/cli/vendor/desktop/lib/local/autonomous.js +1 -1045
- package/vendor/cli/vendor/desktop/lib/local/claude-pro.js +1 -1028
- package/vendor/cli/vendor/desktop/lib/local/context.js +1 -125
- package/vendor/cli/vendor/desktop/lib/local/engine.js +1 -3666
- package/vendor/cli/vendor/desktop/lib/local/entitlement.js +1 -660
- package/vendor/cli/vendor/desktop/lib/local/git-scope.js +1 -228
- package/vendor/cli/vendor/desktop/lib/local/integrity.js +1 -1
- package/vendor/cli/vendor/desktop/lib/local/local.js +1 -2145
- package/vendor/cli/vendor/desktop/lib/local/prompt.js +1 -280
- package/vendor/cli/vendor/desktop/lib/local/queue.js +1 -560
- package/vendor/cli/vendor/desktop/lib/local/session-rounds.js +1 -238
- package/vendor/cli/vendor/desktop/lib/local/spill.js +1 -75
- package/vendor/cli/vendor/desktop/lib/local/turn-guard.js +1 -300
- package/vendor/cli/vendor/desktop/lib/local/worktree-lock.js +1 -235
- package/vendor/cli/vendor/desktop/lib/settings.js +1 -890
- package/vendor/cli/vendor/desktop/main.js +67 -1
- package/vendor/cli/vendor/desktop/renderer/usage.js +1 -1239
- package/vendor/cli/vendor/hosts/install.js +1 -638
- package/vendor/cli/vendor/hosts/openai-shim.js +1 -515
- package/vendor/cli/vendor/hosts/spec.js +1 -164
- package/vendor/cli/vendor/hosts/targets.js +1 -346
- package/vendor/cli/vendor/mcp/server.js +1 -221
- package/vendor/cli/vendor/mcp/tools.js +1 -408
- package/vendor/cli/vendor/one/src/child.js +1 -285
- package/vendor/cli/vendor/one/src/permissions.js +1 -383
- package/vendor/cli/vendor/one/src/selfhost.js +3 -0
- package/vendor/desktop/bin/aegis.js +1 -32
- package/vendor/desktop/lib/account-key.js +1 -56
- package/vendor/desktop/lib/auto.js +1 -461
- package/vendor/desktop/lib/avatar/companion.js +1 -698
- package/vendor/desktop/lib/avatar/cosmetics.js +1 -532
- package/vendor/desktop/lib/avatar/events.js +1 -344
- package/vendor/desktop/lib/avatar/holder-turn.js +1 -350
- package/vendor/desktop/lib/avatar/holders.js +1 -612
- package/vendor/desktop/lib/avatar/identity.js +1 -641
- package/vendor/desktop/lib/avatar/level.js +1 -368
- package/vendor/desktop/lib/avatar/mirror.js +1 -524
- package/vendor/desktop/lib/avatar/persona.js +1 -388
- package/vendor/desktop/lib/avatar/profile.js +1 -977
- package/vendor/desktop/lib/avatar/register.js +1 -307
- package/vendor/desktop/lib/avatar/store.js +1 -472
- package/vendor/desktop/lib/avatar/tiers.js +1 -38
- package/vendor/desktop/lib/avatar/transfer.js +1 -415
- package/vendor/desktop/lib/avatar/turn.js +1 -216
- package/vendor/desktop/lib/avatar/voice.js +1 -328
- package/vendor/desktop/lib/avatar/xp.js +1 -404
- package/vendor/desktop/lib/deep-link.js +1 -120
- package/vendor/desktop/lib/fingerprint.js +2 -347
- package/vendor/desktop/lib/google-connect.js +1 -323
- package/vendor/desktop/lib/local/agents.js +1 -105
- package/vendor/desktop/lib/local/attachments.js +1 -276
- package/vendor/desktop/lib/local/autonomous.js +1 -1045
- package/vendor/desktop/lib/local/claude-pro.js +1 -1028
- package/vendor/desktop/lib/local/context.js +1 -125
- package/vendor/desktop/lib/local/engine.js +1 -3666
- package/vendor/desktop/lib/local/entitlement.js +1 -660
- package/vendor/desktop/lib/local/git-scope.js +1 -228
- package/vendor/desktop/lib/local/integrity.js +1 -1
- package/vendor/desktop/lib/local/local.js +1 -2145
- package/vendor/desktop/lib/local/prompt.js +1 -280
- package/vendor/desktop/lib/local/queue.js +1 -560
- package/vendor/desktop/lib/local/session-rounds.js +1 -238
- package/vendor/desktop/lib/local/spill.js +1 -75
- package/vendor/desktop/lib/local/telemetry.js +1 -470
- package/vendor/desktop/lib/local/turn-guard.js +1 -300
- package/vendor/desktop/lib/local/worktree-lock.js +1 -235
- package/vendor/desktop/lib/provider-key-mirror.js +1 -252
- package/vendor/desktop/lib/quick-launcher.js +1 -84
- package/vendor/desktop/lib/settings.js +1 -890
- package/vendor/desktop/lib/sync/memory-queue.js +1 -60
- package/vendor/desktop/lib/sync/persist-gate.js +1 -148
- package/vendor/desktop/lib/sync/sessions.js +1 -106
- package/vendor/desktop/lib/window-state.js +1 -66
- package/vendor/desktop/main.js +67 -1
- package/vendor/desktop/package.json +3 -5
- package/vendor/desktop/preload.js +1 -679
- package/vendor/desktop/renderer/app.js +1 -7250
- package/vendor/desktop/renderer/avatar/assemble.js +1 -335
- package/vendor/desktop/renderer/avatar/avatar.js +1 -380
- package/vendor/desktop/renderer/avatar/cards.js +1 -141
- package/vendor/desktop/renderer/avatar/hud.js +1 -206
- package/vendor/desktop/renderer/avatar/machine.js +1 -213
- package/vendor/desktop/renderer/avatar/pane.js +1 -439
- package/vendor/desktop/renderer/avatar/parts.js +1 -437
- package/vendor/desktop/renderer/budget.js +1 -172
- package/vendor/desktop/renderer/companion.js +1 -223
- package/vendor/desktop/renderer/diff.js +1 -359
- package/vendor/desktop/renderer/diffview.js +1 -336
- package/vendor/desktop/renderer/filepreview.js +1 -211
- package/vendor/desktop/renderer/fingerprint.js +3 -789
- package/vendor/desktop/renderer/markdown.js +1 -168
- package/vendor/desktop/renderer/provider-mark.js +1 -311
- package/vendor/desktop/renderer/provider-toolbar.js +1 -134
- package/vendor/desktop/renderer/providers.js +1 -259
- package/vendor/desktop/renderer/quick.js +1 -285
- package/vendor/desktop/renderer/stream-policy.js +1 -387
- package/vendor/desktop/renderer/transcript-view.js +1 -323
- package/vendor/desktop/renderer/usage.js +1 -1239
- package/vendor/desktop/vendor/aegis.js +1 -2441
- package/vendor/desktop/vendor/attest.js +1 -518
- package/vendor/desktop/vendor/authorship-key.js +1 -410
- package/vendor/desktop/vendor/auto-provision.js +1 -134
- package/vendor/desktop/vendor/brain-catalog.js +1 -268
- package/vendor/desktop/vendor/byok-catalog.js +1 -199
- package/vendor/desktop/vendor/catalog-client.js +1 -487
- package/vendor/desktop/vendor/conversation-export.js +1 -177
- package/vendor/desktop/vendor/credentials.js +1 -494
- package/vendor/desktop/vendor/device-fingerprint.js +1 -141
- package/vendor/desktop/vendor/drive-connect.js +1 -110
- package/vendor/desktop/vendor/drive-upload.js +1 -234
- package/vendor/desktop/vendor/env-file.js +1 -1273
- package/vendor/desktop/vendor/faces/cli/LICENSE +661 -0
- package/vendor/desktop/vendor/faces/cli/README.md +784 -0
- package/vendor/desktop/vendor/faces/cli/bin/aegiscode.js +20 -0
- package/vendor/desktop/vendor/faces/cli/package.json +44 -0
- package/vendor/desktop/vendor/faces/cli/scripts/check.mjs +4 -0
- package/vendor/desktop/vendor/faces/cli/scripts/demo.mjs +4 -0
- package/vendor/desktop/vendor/faces/cli/scripts/predist.mjs +4 -0
- package/vendor/desktop/vendor/faces/cli/scripts/runtests.mjs +4 -0
- package/vendor/desktop/vendor/faces/cli/scripts/seal-gate.mjs +3 -0
- package/vendor/desktop/vendor/faces/cli/src/agents.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/app.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/art.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/autonomous.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/caps.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/chatflow.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/checkpoint.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/clipboard.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/cloudsync.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/commands.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/config.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/connect.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/credentials.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/deps.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/devrun.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/diff.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/diffview.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/engine.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/entitlement.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/events.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/export.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/filepreview.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/fingerprint.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/format.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/fuzzy.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/gate.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/history.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/init.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/input.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/keys.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/limits.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/markdown.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/mcp.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/models.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/naming.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/overlays.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/panels.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/permissions.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/ping.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/presence.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/provenance.js +58 -0
- package/vendor/desktop/vendor/faces/cli/src/provenance.lock.json +36 -0
- package/vendor/desktop/vendor/faces/cli/src/render.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/screen.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/screens.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/secret.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/securefs.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/settings.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/shared.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/sharedpaths.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/signup.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/summarize.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/sysdiag.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/system.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/theme.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/title.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/todos.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/tokens.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/topup.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/update.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/aegis.js +4 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/attest.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/authorship-key.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/auto-provision.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/brain-catalog.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/byok-catalog.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/catalog-client.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/conversation-export.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/credentials.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/device-fingerprint.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/drive-connect.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/drive-upload.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/env-file.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/fingerprint.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/foreign-memory.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/google-signin.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/hooks.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/model-discovery.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/naming.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/platform.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/prefs.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/presence-constants.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/presence.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/record-vault.js +105 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/session-store.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/topup.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/touch.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/update.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/user-models.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/covenant/README.md +21 -0
- package/vendor/desktop/vendor/faces/cli/vendor/covenant/aegis.seal +177 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/aegis-seal.mjs +241 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/agents.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/attachments.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/autonomous.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/claude-pro.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/context.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/covenant.js +567 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/engine.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/entitlement.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/exec-plan.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/git-scope.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/integrity.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/local.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/prompt.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/queue.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/session-rounds.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/shell.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/spill.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/tools.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/turn-guard.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/worktree-lock.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/settings.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/main.js +4 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/renderer/usage.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/install.js +1 -0
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/openai-shim.js +2 -0
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/spec.js +1 -0
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/targets.js +1 -0
- package/vendor/desktop/vendor/faces/cli/vendor/mcp/server.js +4 -0
- package/vendor/desktop/vendor/faces/cli/vendor/mcp/tools.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/one/src/child.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/one/src/permissions.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/one/src/selfhost.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/tools/agent-gate.mjs +1203 -0
- package/vendor/desktop/vendor/fingerprint.js +1 -1064
- package/vendor/desktop/vendor/foreign-memory.js +1 -669
- package/vendor/desktop/vendor/google-signin.js +1 -133
- package/vendor/desktop/vendor/hooks.js +1 -430
- package/vendor/desktop/vendor/model-discovery.js +1 -373
- package/vendor/desktop/vendor/naming.js +1 -283
- package/vendor/desktop/vendor/platform.js +1 -937
- package/vendor/desktop/vendor/prefs.js +1 -351
- package/vendor/desktop/vendor/presence-constants.js +1 -107
- package/vendor/desktop/vendor/presence.js +1 -438
- package/vendor/desktop/vendor/record-vault.js +3 -1055
- package/vendor/desktop/vendor/selfhost.js +3 -0
- package/vendor/desktop/vendor/session-store.js +1 -575
- package/vendor/desktop/vendor/topup.js +1 -297
- package/vendor/desktop/vendor/touch.js +1 -458
- package/vendor/desktop/vendor/update.js +1 -763
- package/vendor/desktop/vendor/user-models.js +1 -381
package/src/probes.js
CHANGED
|
@@ -1,161 +1,3 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
2
|
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
3
|
-
|
|
4
|
-
// Conveying a modified copy, or running one as a network service, owes the
|
|
5
|
-
// corresponding source under this licence (§5/§13) — see LICENSING.md.
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The impure half of the dispatch, kept deliberately in its own file.
|
|
10
|
-
*
|
|
11
|
-
* `dispatch.js` is pure — it reads nothing, so every one of its branches is
|
|
12
|
-
* exercisable on a headless Linux CI box. This file is where the honesty
|
|
13
|
-
* happens instead: the real `process` facts are gathered in exactly one place
|
|
14
|
-
* (`collect()`), and every probe takes its inputs as parameters so the same
|
|
15
|
-
* functions can be driven from a test with a fake environment, a fake platform
|
|
16
|
-
* and a fake directory.
|
|
17
|
-
*
|
|
18
|
-
* The split is the whole point. If the reads lived inside the decision, the
|
|
19
|
-
* window face would be untestable wherever it was written — and therefore
|
|
20
|
-
* untested everywhere it shipped.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const fs = require('node:fs');
|
|
24
|
-
const path = require('node:path');
|
|
25
|
-
const { createRequire } = require('node:module');
|
|
26
|
-
const host = require('./host.js');
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Is a graphical session plausibly reachable?
|
|
30
|
-
*
|
|
31
|
-
* X11 and Wayland both announce themselves in the environment; macOS and
|
|
32
|
-
* Windows always have one (the check is not "is a screen attached", it is
|
|
33
|
-
* "would launching a window be a category error"). Mir and a couple of
|
|
34
|
-
* remote-desktop spellings are honoured because they are free and because a
|
|
35
|
-
* false negative here costs the user the window for no reason.
|
|
36
|
-
*/
|
|
37
|
-
function hasDisplay(env, platform) {
|
|
38
|
-
const e = env || {};
|
|
39
|
-
const p = platform || host.hostPlatform();
|
|
40
|
-
if (p === 'darwin' || p === 'win32') return true;
|
|
41
|
-
return Boolean(e.DISPLAY || e.WAYLAND_DISPLAY || e.MIR_SERVER_SOCKET);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** Resolve a module as if it were required from `dir`. Null if it cannot be. */
|
|
45
|
-
function resolveFrom(dir, spec) {
|
|
46
|
-
if (!dir) return null;
|
|
47
|
-
try {
|
|
48
|
-
return createRequire(path.join(dir, 'package.json')).resolve(spec);
|
|
49
|
-
} catch {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* The Electron *executable*, or null.
|
|
56
|
-
*
|
|
57
|
-
* `require('electron')` outside an Electron process exports the absolute path
|
|
58
|
-
* to the binary — that is the documented behaviour of the npm package, and it
|
|
59
|
-
* is the same call `desktop/bin/aegis.js` makes (where it throws when Electron
|
|
60
|
-
* is missing). Resolving it here means the dispatch probe and the eventual
|
|
61
|
-
* spawn agree on what "resolvable" means by construction.
|
|
62
|
-
*
|
|
63
|
-
* The string is returned rather than a boolean because the caller needs to
|
|
64
|
-
* spawn it.
|
|
65
|
-
*/
|
|
66
|
-
function electronExecutable(fromDirs) {
|
|
67
|
-
const dirs = Array.isArray(fromDirs) ? fromDirs : [fromDirs];
|
|
68
|
-
for (const dir of dirs) {
|
|
69
|
-
const entry = resolveFrom(dir, 'electron');
|
|
70
|
-
if (!entry) continue;
|
|
71
|
-
try {
|
|
72
|
-
const mod = createRequire(path.join(dir, 'package.json'))('electron');
|
|
73
|
-
if (typeof mod === 'string' && mod) return mod;
|
|
74
|
-
// Older package layouts export an object with a `path`/`default`.
|
|
75
|
-
if (mod && typeof mod.path === 'string' && mod.path) return mod.path;
|
|
76
|
-
if (mod && typeof mod.default === 'string' && mod.default) return mod.default;
|
|
77
|
-
} catch {
|
|
78
|
-
/* resolved but unloadable: treat as not installed */
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Both ends of stdio, as booleans. Unknown counts as "not a terminal". */
|
|
85
|
-
function stdioTty(stdin, stdout) {
|
|
86
|
-
const isatty = (s) => {
|
|
87
|
-
try {
|
|
88
|
-
return Boolean(s && s.isTTY);
|
|
89
|
-
} catch {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
return {
|
|
94
|
-
stdin: isatty(stdin === undefined ? process.stdin : stdin),
|
|
95
|
-
stdout: isatty(stdout === undefined ? process.stdout : stdout),
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/** Directories a sibling package might live in, repo layout first. */
|
|
100
|
-
function packageDirs(oneDir, name) {
|
|
101
|
-
const dirs = [path.join(oneDir, '..', name)];
|
|
102
|
-
const vendor = path.join(oneDir, 'vendor', name);
|
|
103
|
-
if (fs.existsSync(vendor)) dirs.push(vendor);
|
|
104
|
-
return dirs;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/** First existing file from a list of candidates. */
|
|
108
|
-
function firstFile(candidates) {
|
|
109
|
-
for (const c of candidates) {
|
|
110
|
-
if (c && fs.existsSync(c)) return c;
|
|
111
|
-
}
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Gather every fact `decide()` needs. This is the only function in AEGISONE
|
|
117
|
-
* that is allowed to read the process, and it reads nothing that a caller
|
|
118
|
-
* cannot override — which is what makes the tests below honest.
|
|
119
|
-
*
|
|
120
|
-
* @param {object} [opts] overrides, used by tests
|
|
121
|
-
*/
|
|
122
|
-
function collect(opts) {
|
|
123
|
-
const o = opts || {};
|
|
124
|
-
const oneDir = o.oneDir || path.resolve(__dirname, '..');
|
|
125
|
-
const env = o.env || process.env;
|
|
126
|
-
const platform = o.platform || host.hostPlatform();
|
|
127
|
-
const invokedAs = o.invokedAs || path.basename(process.argv[1] || 'aegis');
|
|
128
|
-
|
|
129
|
-
const cliBin =
|
|
130
|
-
env.AEGISONE_CLI_BIN ||
|
|
131
|
-
firstFile(packageDirs(oneDir, 'cli').map((d) => path.join(d, 'bin', 'aegiscode.js')));
|
|
132
|
-
const desktopMain =
|
|
133
|
-
env.AEGISONE_DESKTOP_BIN ||
|
|
134
|
-
firstFile(packageDirs(oneDir, 'desktop').map((d) => path.join(d, 'bin', 'aegis.js')));
|
|
135
|
-
|
|
136
|
-
const electron = o.electron !== undefined ? o.electron : electronExecutable(packageDirs(oneDir, 'desktop'));
|
|
137
|
-
|
|
138
|
-
return {
|
|
139
|
-
argv: o.argv || process.argv.slice(2),
|
|
140
|
-
env,
|
|
141
|
-
platform,
|
|
142
|
-
tty: o.tty || stdioTty(process.stdin, process.stdout),
|
|
143
|
-
hasDisplay: o.hasDisplay !== undefined ? Boolean(o.hasDisplay) : hasDisplay(env, platform),
|
|
144
|
-
electronResolvable: Boolean(electron),
|
|
145
|
-
invokedAs,
|
|
146
|
-
// Not read by decide(): the handoff needs the executables themselves.
|
|
147
|
-
_cliBin: cliBin,
|
|
148
|
-
_desktopMain: desktopMain,
|
|
149
|
-
_electron: electron,
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
module.exports = {
|
|
154
|
-
hasDisplay,
|
|
155
|
-
resolveFrom,
|
|
156
|
-
electronExecutable,
|
|
157
|
-
stdioTty,
|
|
158
|
-
packageDirs,
|
|
159
|
-
firstFile,
|
|
160
|
-
collect,
|
|
161
|
-
};
|
|
3
|
+
"use strict";const fs=require("node:fs"),path=require("node:path"),{createRequire:createRequire}=require("node:module"),host=require("./host.js");function hasDisplay(e,t){const r=e||{},o=t||host.hostPlatform();return"darwin"===o||"win32"===o||Boolean(r.DISPLAY||r.WAYLAND_DISPLAY||r.MIR_SERVER_SOCKET)}function resolveFrom(e,t){if(!e)return null;try{return createRequire(path.join(e,"package.json")).resolve(t)}catch{return null}}function electronExecutable(e){const t=Array.isArray(e)?e:[e];for(const e of t)if(resolveFrom(e,"electron"))try{const t=createRequire(path.join(e,"package.json"))("electron");if("string"==typeof t&&t)return t;if(t&&"string"==typeof t.path&&t.path)return t.path;if(t&&"string"==typeof t.default&&t.default)return t.default}catch{}return null}function stdioTty(e,t){const r=e=>{try{return Boolean(e&&e.isTTY)}catch{return!1}};return{stdin:r(void 0===e?process.stdin:e),stdout:r(void 0===t?process.stdout:t)}}function packageDirs(e,t){const r=[path.join(e,"..",t)],o=path.join(e,"vendor",t);return fs.existsSync(o)&&r.push(o),r}function firstFile(e){for(const t of e)if(t&&fs.existsSync(t))return t;return null}function collect(e){const t=e||{},r=t.oneDir||path.resolve(__dirname,".."),o=t.env||process.env,s=t.platform||host.hostPlatform(),n=t.invokedAs||path.basename(process.argv[1]||"aegis"),i=o.AEGISONE_CLI_BIN||firstFile(packageDirs(r,"cli").map((e=>path.join(e,"bin","aegiscode.js")))),a=o.AEGISONE_DESKTOP_BIN||firstFile(packageDirs(r,"desktop").map((e=>path.join(e,"bin","aegis.js")))),c=void 0!==t.electron?t.electron:electronExecutable(packageDirs(r,"desktop"));return{argv:t.argv||process.argv.slice(2),env:o,platform:s,tty:t.tty||stdioTty(process.stdin,process.stdout),hasDisplay:void 0!==t.hasDisplay?Boolean(t.hasDisplay):hasDisplay(o,s),electronResolvable:Boolean(c),invokedAs:n,_cliBin:i,_desktopMain:a,_electron:c}}module.exports={hasDisplay:hasDisplay,resolveFrom:resolveFrom,electronExecutable:electronExecutable,stdioTty:stdioTty,packageDirs:packageDirs,firstFile:firstFile,collect:collect};
|
package/src/protocol.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
3
|
+
"use strict";const PROTO=1,METHODS=Object.freeze(["hello","exec","event","cancel"]),CAPS=Object.freeze({EXEC:"exec",EVENT:"event",CANCEL:"cancel",PTY:"pty"}),CODE=Object.freeze({BAD_JSON:"bad_json",BAD_FRAME:"bad_frame",UNKNOWN_METHOD:"unknown_method",PROTO_MISMATCH:"proto_mismatch",HELLO_REQUIRED:"hello_required",CAPABILITY_MISSING:"capability_missing",UNSUPPORTED:"unsupported"});function request(e,o,t){return{id:e,m:String(o),p:t&&"object"==typeof t?t:{}}}function ok(e,o){return{id:e,ok:!0,r:o&&"object"==typeof o?o:{}}}function err(e,o,t){return{id:e,ok:!1,e:{code:String(o||CODE.UNSUPPORTED),msg:String(t||"")}}}function isObject(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}function validate(e){return isObject(e)?void 0===e.id||null===e.id?{ok:!1,code:CODE.BAD_FRAME,msg:"frame has no id"}:void 0!==e.ok?!0===e.ok?void 0!==e.e?{ok:!1,code:CODE.BAD_FRAME,msg:"reply carries both r and e"}:{ok:!0}:!1===e.ok?isObject(e.e)&&e.e.code?{ok:!0}:{ok:!1,code:CODE.BAD_FRAME,msg:"a failed reply must name a code"}:{ok:!1,code:CODE.BAD_FRAME,msg:"ok must be true or false"}:"string"==typeof e.m&&METHODS.includes(e.m)?void 0===e.p||isObject(e.p)?{ok:!0}:{ok:!1,code:CODE.BAD_FRAME,msg:"params must be an object"}:{ok:!1,code:CODE.UNKNOWN_METHOD,msg:`unknown method: ${String(e.m)}`}:{ok:!1,code:CODE.BAD_FRAME,msg:"frame must be an object"}}function negotiate(e,o){const t=o||{},r=validate(e);if(!r.ok)return{ok:!1,code:r.code,msg:r.msg};if("hello"!==e.m)return{ok:!1,code:CODE.HELLO_REQUIRED,msg:`the first frame must be hello, got ${String(e.m)}`};const n=e.p||{};if(1!==n.proto)return{ok:!1,code:CODE.PROTO_MISMATCH,msg:`peer speaks protocol ${String(n.proto)}, this build speaks 1`};const i=Array.isArray(n.caps)?n.caps.map(String):[],s=(Array.isArray(t.requireCaps)?t.requireCaps.map(String):[]).filter((e=>!i.includes(e)));return s.length?{ok:!1,code:CODE.CAPABILITY_MISSING,msg:`peer does not offer: ${s.join(", ")}`}:{ok:!0,proto:1,caps:i}}function hello(e){return request(void 0===e?0:e,"hello",{proto:1,caps:[CAPS.EXEC,CAPS.EVENT,CAPS.CANCEL]})}function encode(e){return`${JSON.stringify(e)}\n`}function decodeLine(e){const o=String(null==e?"":e).trim();if(!o)return{ok:!1,id:null,code:CODE.BAD_JSON,msg:"empty line"};let t;try{t=JSON.parse(o)}catch(e){return{ok:!1,id:null,code:CODE.BAD_JSON,msg:`not JSON: ${e.message}`}}const r=validate(t);return r.ok?{ok:!0,frame:t}:{ok:!1,id:isObject(t)&&void 0!==t.id?t.id:null,code:r.code,msg:r.msg}}function splitLines(e){const o=String(null==e?"":e).split("\n"),t=o.pop();return{lines:o.filter((e=>""!==e.trim())),rest:void 0===t?"":t}}module.exports={PROTO:1,METHODS:METHODS,CAPS:CAPS,CODE:CODE,request:request,ok:ok,err:err,hello:hello,validate:validate,negotiate:negotiate,encode:encode,decodeLine:decodeLine,splitLines:splitLines};
|
package/src/release.js
CHANGED
|
@@ -1,411 +1,3 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
2
|
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
3
|
-
|
|
4
|
-
// Conveying a modified copy, or running one as a network service, owes the
|
|
5
|
-
// corresponding source under this licence (§5/§13) — see LICENSING.md.
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* AEGISONE — one product version, two derived face versions (plan D4).
|
|
10
|
-
*
|
|
11
|
-
* The rule this file exists to enforce: **the product version is written down
|
|
12
|
-
* once, and every other version in the tree is computed from it.** Before ON3,
|
|
13
|
-
* a release was three hand-typed numbers in one commit (`chore(release):
|
|
14
|
-
* aegis-desktop 0.8.28, aegiscode 6.8.30`) held together by discipline, not by
|
|
15
|
-
* anything that could fail. This module is the arithmetic; `one/scripts/bump.mjs`
|
|
16
|
-
* is the only writer; `test/one-version.test.mjs` is the assertion that the
|
|
17
|
-
* manifests in the tree still equal what this file computes for the product
|
|
18
|
-
* version they carry.
|
|
19
|
-
*
|
|
20
|
-
* Two rules from D4 that constrain the derivation, both user-visible:
|
|
21
|
-
*
|
|
22
|
-
* 1. **The face LINES do not move.** `aegiscode` stays on `6.8.x` and
|
|
23
|
-
* `aegis-desktop` stays on `0.8.x`, because installed apps and their
|
|
24
|
-
* auto-update channels are pinned to those lines. The product version
|
|
25
|
-
* `1.0.0` therefore cannot simply BE the face version.
|
|
26
|
-
* 2. **No face may move backwards, and no product release may be reordered.**
|
|
27
|
-
* Each face's patch counter is anchored at its published version for the
|
|
28
|
-
* product's first release (`6.8.30` / `0.8.28` at product `1.0.0` — the
|
|
29
|
-
* versions the last hand-typed release commit shipped) and advances by the
|
|
30
|
-
* *flattened product counter*, one product patch == one face patch, one
|
|
31
|
-
* product minor == 100 face patches, one product major == 10000. So the
|
|
32
|
-
* face numbers stay recognisable AND the mapping is total and monotonic:
|
|
33
|
-
* two different product versions can never produce the same face version,
|
|
34
|
-
* and a bump can never publish a lower version than the registry has.
|
|
35
|
-
*
|
|
36
|
-
* Everything here is pure: it takes versions and file CONTENTS and returns
|
|
37
|
-
* values and new contents. No fs, no process, no clock — `bump.mjs` owns the
|
|
38
|
-
* IO, so the whole bump can be asserted without touching a file.
|
|
39
|
-
*
|
|
40
|
-
* Standing rule for `one/` (Phase 30.1): nothing at module scope touches the
|
|
41
|
-
* process, and nothing here branches on an OS. This file reads neither.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* The face packages, their unchanged lines, and their published anchor.
|
|
46
|
-
*
|
|
47
|
-
* `line` is the `major.minor` that must not move (D4 rule 1). `anchor` is the
|
|
48
|
-
* patch each face had published at `ANCHOR_PRODUCT` — the calibration point for
|
|
49
|
-
* the whole derivation.
|
|
50
|
-
*
|
|
51
|
-
* Re-anchored at product `1.0.8`: `aegiscode` graduates from the `6.8.x` line
|
|
52
|
-
* to `7.0.x` and `aegis-desktop` from `0.8.x` to `1.0.x`, both starting at
|
|
53
|
-
* patch 0 — a deliberate one-time line move, not a normal release. Nothing
|
|
54
|
-
* before this point is derivable under the new anchor (an older product
|
|
55
|
-
* version would compute a negative patch and `deriveFaceVersion` refuses it as
|
|
56
|
-
* "backwards"), which is correct: the old `6.8.x`/`0.8.x` history stays real,
|
|
57
|
-
* it is just not reachable through this formula anymore. A product version
|
|
58
|
-
* `>= 1.0.8` is unaffected either way, because the derivation only ever looks
|
|
59
|
-
* at the DELTA from the anchor, never at history before it.
|
|
60
|
-
*/
|
|
61
|
-
const FACE_LINES = Object.freeze([
|
|
62
|
-
Object.freeze({ dir: 'cli', package: 'aegiscode', line: Object.freeze([7, 0]), anchor: 0 }),
|
|
63
|
-
Object.freeze({ dir: 'desktop', package: 'aegis-desktop', line: Object.freeze([1, 0]), anchor: 0 })
|
|
64
|
-
]);
|
|
65
|
-
|
|
66
|
-
/** The product version the two anchors above were measured at. */
|
|
67
|
-
const ANCHOR_PRODUCT = '1.0.8';
|
|
68
|
-
|
|
69
|
-
/** One product minor reserves 100 face patches; one major reserves 10000. */
|
|
70
|
-
const MINOR_STRIDE = 100;
|
|
71
|
-
const MAJOR_STRIDE = 10000;
|
|
72
|
-
|
|
73
|
-
const VERSION_RE = /^(\d+)\.(\d+)\.(\d+)$/;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Parse a strict `X.Y.Z` version.
|
|
77
|
-
*
|
|
78
|
-
* A prerelease is REFUSED rather than carried: the face versions below have no
|
|
79
|
-
* honest spelling for one (`6.8.30-rc.1` would have to be invented per face and
|
|
80
|
-
* would land on the updater feeds of every installed app), so a prerelease
|
|
81
|
-
* product version fails here, loudly, instead of shipping a guess.
|
|
82
|
-
*
|
|
83
|
-
* @param {string} value
|
|
84
|
-
* @returns {{major: number, minor: number, patch: number, text: string}}
|
|
85
|
-
*/
|
|
86
|
-
function parseVersion(value) {
|
|
87
|
-
const text = String(value == null ? '' : value).trim();
|
|
88
|
-
const m = VERSION_RE.exec(text);
|
|
89
|
-
if (!m) {
|
|
90
|
-
throw new Error(
|
|
91
|
-
`${JSON.stringify(String(value))} is not a strict MAJOR.MINOR.PATCH version ` +
|
|
92
|
-
'(prereleases and ranges are refused on purpose — see release.js)'
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
const parts = { major: Number(m[1]), minor: Number(m[2]), patch: Number(m[3]), text };
|
|
96
|
-
// The flattening below is total only while minor and patch stay under their
|
|
97
|
-
// stride. Refusing the version is the fail-closed answer; silently colliding
|
|
98
|
-
// two releases onto one face version is not.
|
|
99
|
-
if (parts.minor >= MINOR_STRIDE || parts.patch >= MINOR_STRIDE) {
|
|
100
|
-
throw new Error(
|
|
101
|
-
`${text}: minor and patch must stay under ${MINOR_STRIDE} for the face derivation to stay injective`
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
return parts;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/** Does this look like a version at all? Never throws. */
|
|
108
|
-
function isVersion(value) {
|
|
109
|
-
return VERSION_RE.test(String(value == null ? '' : value).trim());
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* The product counter: a single strictly increasing integer for a version.
|
|
114
|
-
*
|
|
115
|
-
* `1.0.0` -> 10000, `1.0.1` -> 10001, `1.1.0` -> 10100, `2.0.0` -> 20000.
|
|
116
|
-
*/
|
|
117
|
-
function releaseCounter(value) {
|
|
118
|
-
const v = typeof value === 'string' ? parseVersion(value) : value;
|
|
119
|
-
return v.major * MAJOR_STRIDE + v.minor * MINOR_STRIDE + v.patch;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const ANCHOR_COUNTER = releaseCounter(ANCHOR_PRODUCT);
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The version a face must carry for a given product version.
|
|
126
|
-
*
|
|
127
|
-
* @param {string} productVersion
|
|
128
|
-
* @param {{dir: string, package: string, line: number[], anchor: number}} face
|
|
129
|
-
* @returns {string} e.g. `6.8.30` for `aegiscode` at product `1.0.0`
|
|
130
|
-
*/
|
|
131
|
-
function deriveFaceVersion(productVersion, face) {
|
|
132
|
-
const delta = releaseCounter(productVersion) - ANCHOR_COUNTER;
|
|
133
|
-
const patch = face.anchor + delta;
|
|
134
|
-
if (patch < face.anchor) {
|
|
135
|
-
throw new Error(
|
|
136
|
-
`product ${productVersion} would move ${face.package} backwards ` +
|
|
137
|
-
`(${face.line.join('.')}.${patch} < published ${face.line.join('.')}.${face.anchor})`
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
if (!Number.isSafeInteger(patch)) {
|
|
141
|
-
throw new Error(`product ${productVersion} overflows the ${face.package} patch counter`);
|
|
142
|
-
}
|
|
143
|
-
return `${face.line[0]}.${face.line[1]}.${patch}`;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Every face version for a product version, keyed by npm package name.
|
|
148
|
-
*
|
|
149
|
-
* @param {string} productVersion
|
|
150
|
-
* @returns {Object<string, {package: string, dir: string, version: string}>}
|
|
151
|
-
*/
|
|
152
|
-
function deriveFaceVersions(productVersion) {
|
|
153
|
-
const out = {};
|
|
154
|
-
for (const face of FACE_LINES) {
|
|
155
|
-
out[face.package] = Object.freeze({
|
|
156
|
-
package: face.package,
|
|
157
|
-
dir: face.dir,
|
|
158
|
-
version: deriveFaceVersion(productVersion, face)
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
return out;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/** The tag a product version ships as. */
|
|
165
|
-
function tagFor(productVersion) {
|
|
166
|
-
return 'v' + parseVersion(productVersion).text;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Read a version out of a tag or a GitHub ref.
|
|
171
|
-
*
|
|
172
|
-
* Accepts `v1.0.1` and `refs/tags/v1.0.1`; refuses `1.0.1` and `v1.0` — a
|
|
173
|
-
* release that cannot name its tag is a release that cannot be verified.
|
|
174
|
-
*/
|
|
175
|
-
function parseTag(tag) {
|
|
176
|
-
const raw = String(tag == null ? '' : tag).trim();
|
|
177
|
-
const stripped = raw.startsWith('refs/tags/') ? raw.slice('refs/tags/'.length) : raw;
|
|
178
|
-
if (!stripped.startsWith('v')) {
|
|
179
|
-
throw new Error(`${JSON.stringify(raw)} is not a release tag — expected vMAJOR.MINOR.PATCH`);
|
|
180
|
-
}
|
|
181
|
-
return parseVersion(stripped.slice(1)).text;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* The next product version.
|
|
186
|
-
*
|
|
187
|
-
* @param {string} current
|
|
188
|
-
* @param {string} kind `major` | `minor` | `patch` | an explicit `X.Y.Z`
|
|
189
|
-
* @returns {string}
|
|
190
|
-
*/
|
|
191
|
-
function nextVersion(current, kind) {
|
|
192
|
-
const from = parseVersion(current);
|
|
193
|
-
const word = String(kind == null ? '' : kind).trim();
|
|
194
|
-
if (word === 'major') return `${from.major + 1}.0.0`;
|
|
195
|
-
if (word === 'minor') return `${from.major}.${from.minor + 1}.0`;
|
|
196
|
-
if (word === 'patch') return `${from.major}.${from.minor}.${from.patch + 1}`;
|
|
197
|
-
const next = parseVersion(word).text;
|
|
198
|
-
if (releaseCounter(next) <= releaseCounter(from)) {
|
|
199
|
-
throw new Error(`${next} is not newer than ${from.text} — a released version is never rewritten`);
|
|
200
|
-
}
|
|
201
|
-
return next;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// ---------------------------------------------------------------------------
|
|
205
|
-
// The version request (`aegis --version`, `aegis --version --verbose`)
|
|
206
|
-
// ---------------------------------------------------------------------------
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Is this argv asking for the product version?
|
|
210
|
-
*
|
|
211
|
-
* Deliberately narrow: the ONLY accepted shapes are `--version` (or `-v`), with
|
|
212
|
-
* an optional `--verbose`. Anything else — a prompt, `-p`, a verb — returns
|
|
213
|
-
* null and takes the ordinary dispatch path, because `aegis --version` must not
|
|
214
|
-
* be able to swallow an argument somebody meant.
|
|
215
|
-
*
|
|
216
|
-
* @param {string[]} argv
|
|
217
|
-
* @returns {{verbose: boolean}|null}
|
|
218
|
-
*/
|
|
219
|
-
function versionRequest(argv) {
|
|
220
|
-
const args = (Array.isArray(argv) ? argv : []).map(String);
|
|
221
|
-
if (args.length === 0) return null;
|
|
222
|
-
const allowed = new Set(['--version', '-v', '--verbose']);
|
|
223
|
-
if (args.some((a) => !allowed.has(a))) return null;
|
|
224
|
-
if (!args.includes('--version') && !args.includes('-v')) return null;
|
|
225
|
-
return { verbose: args.includes('--verbose') };
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Render the version report.
|
|
230
|
-
*
|
|
231
|
-
* The first line is the bare product version, matching the terminal face's own
|
|
232
|
-
* `--version` (cli/bin/aegiscode.js writes `pkg.version` and nothing else), so
|
|
233
|
-
* `aegis --version` and `aegiscode --version` agree on line one and scripts
|
|
234
|
-
* that parse either keep working. `--verbose` adds one line per face; a face
|
|
235
|
-
* whose manifest is not beside the product is reported as unknown rather than
|
|
236
|
-
* guessed from the derivation, because this command reports facts.
|
|
237
|
-
*
|
|
238
|
-
* @param {{product: {name: string, version: string},
|
|
239
|
-
* faces?: Array<{package: string, version: string|null}>}} input
|
|
240
|
-
* @returns {string}
|
|
241
|
-
*/
|
|
242
|
-
function renderVersion(input) {
|
|
243
|
-
const src = input || {};
|
|
244
|
-
const product = src.product || {};
|
|
245
|
-
const lines = [parseVersion(product.version).text];
|
|
246
|
-
for (const face of src.faces || []) {
|
|
247
|
-
lines.push(
|
|
248
|
-
face && face.version
|
|
249
|
-
? `${face.package} ${face.version}`
|
|
250
|
-
: `${face && face.package} unknown (no manifest beside this package)`
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
return lines.join('\n') + '\n';
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// ---------------------------------------------------------------------------
|
|
257
|
-
// The bump plan: pure content in, new content out
|
|
258
|
-
// ---------------------------------------------------------------------------
|
|
259
|
-
|
|
260
|
-
/** The README line the product version is written on. */
|
|
261
|
-
const README_VERSION_RE = /^(Product version: \*\*)(\d+\.\d+\.\d+)(\*\*.*)$/m;
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Replace the `version` field of a package.json string, preserving everything
|
|
265
|
-
* else byte for byte (2-space indent, key order, trailing newline).
|
|
266
|
-
*
|
|
267
|
-
* @param {string} content
|
|
268
|
-
* @param {string} version
|
|
269
|
-
* @returns {string}
|
|
270
|
-
*/
|
|
271
|
-
function setManifestVersion(content, version) {
|
|
272
|
-
const parsed = JSON.parse(content);
|
|
273
|
-
if (typeof parsed.version !== 'string' || !isVersion(parsed.version)) {
|
|
274
|
-
throw new Error('that package.json has no usable `version` field');
|
|
275
|
-
}
|
|
276
|
-
parsed.version = parseVersion(version).text;
|
|
277
|
-
return JSON.stringify(parsed, null, 2) + '\n';
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/** Replace the README's version line, or fail loudly if it is not there. */
|
|
281
|
-
function setReadmeVersion(content, version) {
|
|
282
|
-
if (!README_VERSION_RE.test(content)) {
|
|
283
|
-
throw new Error(
|
|
284
|
-
'the product README has no "Product version: **X.Y.Z**" line for the bump to maintain'
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
return content.replace(README_VERSION_RE, (_, head, _old, tail) => head + parseVersion(version).text + tail);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* The whole bump, computed from file contents.
|
|
292
|
-
*
|
|
293
|
-
* Each document names its OWN target version. That is not a convenience: the
|
|
294
|
-
* product manifest and the README take the product version, and each face takes
|
|
295
|
-
* the version `deriveFaceVersions` computes for it — one version is the source
|
|
296
|
-
* of truth, and a plan that writes the product number into a face manifest is
|
|
297
|
-
* the exact bug the first dry run of this function caught (the faces went to
|
|
298
|
-
* `1.0.1`; the derivation says `6.8.31` / `0.8.29`).
|
|
299
|
-
*
|
|
300
|
-
* @param {{version: string, documents: Array<{file: string, kind: string,
|
|
301
|
-
* content: string, version?: string}>}} input
|
|
302
|
-
* `kind` is `json` (a package.json) or `readme` (the product README);
|
|
303
|
-
* `version` defaults to the product version.
|
|
304
|
-
* @returns {Array<{file: string, kind: string, from: string|null, to: string,
|
|
305
|
-
* before: string, content: string, unchanged: boolean}>}
|
|
306
|
-
*/
|
|
307
|
-
function planBump(input) {
|
|
308
|
-
const src = input || {};
|
|
309
|
-
const product = parseVersion(src.version).text;
|
|
310
|
-
return (src.documents || []).map((doc) => {
|
|
311
|
-
const version = parseVersion(doc.version || product).text;
|
|
312
|
-
const before = doc.content;
|
|
313
|
-
let after;
|
|
314
|
-
if (doc.kind === 'json') {
|
|
315
|
-
const current = JSON.parse(before).version;
|
|
316
|
-
if (current === version) {
|
|
317
|
-
return { file: doc.file, kind: doc.kind, from: current, to: version, before, content: before, unchanged: true };
|
|
318
|
-
}
|
|
319
|
-
after = setManifestVersion(before, version);
|
|
320
|
-
return { file: doc.file, kind: doc.kind, from: current, to: version, before, content: after, unchanged: false };
|
|
321
|
-
}
|
|
322
|
-
if (doc.kind === 'readme') {
|
|
323
|
-
const m = README_VERSION_RE.exec(before);
|
|
324
|
-
if (!m) throw new Error(`${doc.file} has no version line for the bump to maintain`);
|
|
325
|
-
const current = m[2];
|
|
326
|
-
if (current === version) {
|
|
327
|
-
return { file: doc.file, kind: doc.kind, from: current, to: version, before, content: before, unchanged: true };
|
|
328
|
-
}
|
|
329
|
-
return {
|
|
330
|
-
file: doc.file,
|
|
331
|
-
kind: doc.kind,
|
|
332
|
-
from: current,
|
|
333
|
-
to: version,
|
|
334
|
-
before,
|
|
335
|
-
content: setReadmeVersion(before, version),
|
|
336
|
-
unchanged: false
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
throw new Error(`${doc.file}: unknown document kind ${JSON.stringify(doc.kind)}`);
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* A unified diff of two texts, for `bump --dry-run`.
|
|
345
|
-
*
|
|
346
|
-
* One hunk per contiguous block of changed lines, with three lines of context —
|
|
347
|
-
* enough for a version bump, and small enough to read: the dry run exists to be
|
|
348
|
-
* pasted into a release review, not to be a diff engine.
|
|
349
|
-
*
|
|
350
|
-
* @param {string} before
|
|
351
|
-
* @param {string} after
|
|
352
|
-
* @param {string} file
|
|
353
|
-
* @returns {string} empty string when nothing changed
|
|
354
|
-
*/
|
|
355
|
-
function unifiedDiff(before, after, file) {
|
|
356
|
-
if (before === after) return '';
|
|
357
|
-
const a = before.split('\n');
|
|
358
|
-
const b = after.split('\n');
|
|
359
|
-
let head = 0;
|
|
360
|
-
while (head < a.length && head < b.length && a[head] === b[head]) head++;
|
|
361
|
-
let tail = 0;
|
|
362
|
-
while (
|
|
363
|
-
tail < a.length - head &&
|
|
364
|
-
tail < b.length - head &&
|
|
365
|
-
a[a.length - 1 - tail] === b[b.length - 1 - tail]
|
|
366
|
-
) {
|
|
367
|
-
tail++;
|
|
368
|
-
}
|
|
369
|
-
const aChanged = a.slice(head, a.length - tail);
|
|
370
|
-
const bChanged = b.slice(head, b.length - tail);
|
|
371
|
-
const context = 3;
|
|
372
|
-
const start = Math.max(0, head - context);
|
|
373
|
-
const aEnd = Math.min(a.length, a.length - tail + context);
|
|
374
|
-
const bEnd = Math.min(b.length, b.length - tail + context);
|
|
375
|
-
const aHunk = a.slice(start, aEnd);
|
|
376
|
-
const bHunk = b.slice(start, bEnd);
|
|
377
|
-
const aSpan = aEnd - start;
|
|
378
|
-
const bSpan = bEnd - start;
|
|
379
|
-
const out = [`--- a/${file}`, `+++ b/${file}`, `@@ -${start + 1},${aSpan} +${start + 1},${bSpan} @@`];
|
|
380
|
-
// Changed lines are emitted as a removal block then an addition block: a
|
|
381
|
-
// version bump rewrites lines, and a reviewer reading the dry run wants the
|
|
382
|
-
// before and the after plain, not interleaved.
|
|
383
|
-
for (const line of aHunk.slice(0, head - start)) out.push(' ' + line);
|
|
384
|
-
for (const line of aChanged) out.push('-' + line);
|
|
385
|
-
for (const line of bChanged) out.push('+' + line);
|
|
386
|
-
const trailing = aHunk.slice(head - start + aChanged.length);
|
|
387
|
-
for (const line of trailing) out.push(' ' + line);
|
|
388
|
-
return out.join('\n') + '\n';
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
module.exports = {
|
|
392
|
-
FACE_LINES,
|
|
393
|
-
ANCHOR_PRODUCT,
|
|
394
|
-
MINOR_STRIDE,
|
|
395
|
-
MAJOR_STRIDE,
|
|
396
|
-
parseVersion,
|
|
397
|
-
isVersion,
|
|
398
|
-
releaseCounter,
|
|
399
|
-
deriveFaceVersion,
|
|
400
|
-
deriveFaceVersions,
|
|
401
|
-
tagFor,
|
|
402
|
-
parseTag,
|
|
403
|
-
nextVersion,
|
|
404
|
-
versionRequest,
|
|
405
|
-
renderVersion,
|
|
406
|
-
planBump,
|
|
407
|
-
setManifestVersion,
|
|
408
|
-
setReadmeVersion,
|
|
409
|
-
unifiedDiff,
|
|
410
|
-
README_VERSION_RE
|
|
411
|
-
};
|
|
3
|
+
"use strict";const FACE_LINES=Object.freeze([Object.freeze({dir:"cli",package:"aegiscode",line:Object.freeze([7,0]),anchor:0}),Object.freeze({dir:"desktop",package:"aegis-desktop",line:Object.freeze([1,0]),anchor:0})]),ANCHOR_PRODUCT="1.0.8",MINOR_STRIDE=100,MAJOR_STRIDE=1e4,VERSION_RE=/^(\d+)\.(\d+)\.(\d+)$/;function parseVersion(e){const n=String(null==e?"":e).trim(),r=VERSION_RE.exec(n);if(!r)throw new Error(`${JSON.stringify(String(e))} is not a strict MAJOR.MINOR.PATCH version (prereleases and ranges are refused on purpose — see release.js)`);const t={major:Number(r[1]),minor:Number(r[2]),patch:Number(r[3]),text:n};if(t.minor>=MINOR_STRIDE||t.patch>=MINOR_STRIDE)throw new Error(`${n}: minor and patch must stay under ${MINOR_STRIDE} for the face derivation to stay injective`);return t}function isVersion(e){return VERSION_RE.test(String(null==e?"":e).trim())}function releaseCounter(e){const n="string"==typeof e?parseVersion(e):e;return n.major*MAJOR_STRIDE+n.minor*MINOR_STRIDE+n.patch}const ANCHOR_COUNTER=releaseCounter("1.0.8");function deriveFaceVersion(e,n){const r=releaseCounter(e)-ANCHOR_COUNTER,t=n.anchor+r;if(t<n.anchor)throw new Error(`product ${e} would move ${n.package} backwards (${n.line.join(".")}.${t} < published ${n.line.join(".")}.${n.anchor})`);if(!Number.isSafeInteger(t))throw new Error(`product ${e} overflows the ${n.package} patch counter`);return`${n.line[0]}.${n.line[1]}.${t}`}function deriveFaceVersions(e){const n={};for(const r of FACE_LINES)n[r.package]=Object.freeze({package:r.package,dir:r.dir,version:deriveFaceVersion(e,r)});return n}function tagFor(e){return"v"+parseVersion(e).text}function parseTag(e){const n=String(null==e?"":e).trim(),r=n.startsWith("refs/tags/")?n.slice(10):n;if(!r.startsWith("v"))throw new Error(`${JSON.stringify(n)} is not a release tag — expected vMAJOR.MINOR.PATCH`);return parseVersion(r.slice(1)).text}function nextVersion(e,n){const r=parseVersion(e),t=String(null==n?"":n).trim();if("major"===t)return`${r.major+1}.0.0`;if("minor"===t)return`${r.major}.${r.minor+1}.0`;if("patch"===t)return`${r.major}.${r.minor}.${r.patch+1}`;const o=parseVersion(t).text;if(releaseCounter(o)<=releaseCounter(r))throw new Error(`${o} is not newer than ${r.text} — a released version is never rewritten`);return o}function versionRequest(e){const n=(Array.isArray(e)?e:[]).map(String);if(0===n.length)return null;const r=new Set(["--version","-v","--verbose"]);return n.some((e=>!r.has(e)))?null:n.includes("--version")||n.includes("-v")?{verbose:n.includes("--verbose")}:null}function renderVersion(e){const n=e||{},r=[parseVersion((n.product||{}).version).text];for(const e of n.faces||[])r.push(e&&e.version?`${e.package} ${e.version}`:`${e&&e.package} unknown (no manifest beside this package)`);return r.join("\n")+"\n"}const README_VERSION_RE=/^(Product version: \*\*)(\d+\.\d+\.\d+)(\*\*.*)$/m;function setManifestVersion(e,n){const r=JSON.parse(e);if("string"!=typeof r.version||!isVersion(r.version))throw new Error("that package.json has no usable `version` field");return r.version=parseVersion(n).text,JSON.stringify(r,null,2)+"\n"}function setReadmeVersion(e,n){if(!README_VERSION_RE.test(e))throw new Error('the product README has no "Product version: **X.Y.Z**" line for the bump to maintain');return e.replace(README_VERSION_RE,((e,r,t,o)=>r+parseVersion(n).text+o))}function planBump(e){const n=e||{},r=parseVersion(n.version).text;return(n.documents||[]).map((e=>{const n=parseVersion(e.version||r).text,t=e.content;let o;if("json"===e.kind){const r=JSON.parse(t).version;return r===n?{file:e.file,kind:e.kind,from:r,to:n,before:t,content:t,unchanged:!0}:(o=setManifestVersion(t,n),{file:e.file,kind:e.kind,from:r,to:n,before:t,content:o,unchanged:!1})}if("readme"===e.kind){const r=README_VERSION_RE.exec(t);if(!r)throw new Error(`${e.file} has no version line for the bump to maintain`);const o=r[2];return o===n?{file:e.file,kind:e.kind,from:o,to:n,before:t,content:t,unchanged:!0}:{file:e.file,kind:e.kind,from:o,to:n,before:t,content:setReadmeVersion(t,n),unchanged:!1}}throw new Error(`${e.file}: unknown document kind ${JSON.stringify(e.kind)}`)}))}function unifiedDiff(e,n,r){if(e===n)return"";const t=e.split("\n"),o=n.split("\n");let i=0;for(;i<t.length&&i<o.length&&t[i]===o[i];)i++;let s=0;for(;s<t.length-i&&s<o.length-i&&t[t.length-1-s]===o[o.length-1-s];)s++;const a=t.slice(i,t.length-s),c=o.slice(i,o.length-s),f=Math.max(0,i-3),u=Math.min(t.length,t.length-s+3),l=Math.min(o.length,o.length-s+3),d=t.slice(f,u),p=(o.slice(f,l),[`--- a/${r}`,`+++ b/${r}`,`@@ -${f+1},${u-f} +${f+1},${l-f} @@`]);for(const e of d.slice(0,i-f))p.push(" "+e);for(const e of a)p.push("-"+e);for(const e of c)p.push("+"+e);const R=d.slice(i-f+a.length);for(const e of R)p.push(" "+e);return p.join("\n")+"\n"}module.exports={FACE_LINES:FACE_LINES,ANCHOR_PRODUCT:"1.0.8",MINOR_STRIDE:MINOR_STRIDE,MAJOR_STRIDE:MAJOR_STRIDE,parseVersion:parseVersion,isVersion:isVersion,releaseCounter:releaseCounter,deriveFaceVersion:deriveFaceVersion,deriveFaceVersions:deriveFaceVersions,tagFor:tagFor,parseTag:parseTag,nextVersion:nextVersion,versionRequest:versionRequest,renderVersion:renderVersion,planBump:planBump,setManifestVersion:setManifestVersion,setReadmeVersion:setReadmeVersion,unifiedDiff:unifiedDiff,README_VERSION_RE:README_VERSION_RE};
|
package/src/selfhost.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
3
|
+
"use strict";const path=require("node:path"),FACE=Object.freeze({TUI:"tui",GUI:"gui"}),RUN_AS_NODE="ELECTRON_RUN_AS_NODE",FORCE_TUI=["--tui","code"],COMPAT_BIN="aegiscode";function faceRoot(e,n){return path.join(e,"faces",n)}function cliEntry(e){return path.join(faceRoot(e,"cli"),"bin","aegiscode.js")}function binName(e){return path.basename(String(e||"aegis")).replace(/\.(exe|cmd|bat|AppImage)$/i,"").replace(/\.js$/,"")}function plan(e){const n=e||{};if(!n.packaged)return null;const t=n.execPath,a=n.resourcesPath,i=Array.isArray(n.argv)?n.argv.map(String):[];if(!t||!a)return null;const r=(e,n)=>({face:FACE.TUI,exec:t,args:[cliEntry(a),...e],env:{[RUN_AS_NODE]:"1"},reason:n});if(binName(n.invokedAs)===COMPAT_BIN)return r(i,"aegiscode is the compatibility bin");const c=i.find((e=>FORCE_TUI.includes(e)));return c?r(i.filter((e=>e!==c)),`${c} asks for the terminal face`):null}function spawnOptions(e,n){return e?{exec:e.exec,args:e.args,env:Object.assign({},n||{},e.env)}:null}module.exports={plan:plan,spawnOptions:spawnOptions,FACE:FACE,RUN_AS_NODE:RUN_AS_NODE,COMPAT_BIN:COMPAT_BIN,FORCE_TUI:FORCE_TUI,cliEntry:cliEntry,faceRoot:faceRoot,binName:binName};
|
package/vendor/cli/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aegiscode",
|
|
3
3
|
"productName": "AEGIS Code",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.29",
|
|
5
5
|
"description": "aegiscode — the command-line version of AEGIS Desktop. The shared tool surface in your shell, over the same thin transport and tool registry as the MCP plugin and the desktop app. Ships transport + UI only; no brain.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "AEGIS Code",
|
|
@@ -18,19 +18,15 @@
|
|
|
18
18
|
"src",
|
|
19
19
|
"scripts",
|
|
20
20
|
"vendor",
|
|
21
|
-
"README.md"
|
|
21
|
+
"README.md",
|
|
22
|
+
"SOURCE-OFFER.txt"
|
|
22
23
|
],
|
|
23
24
|
"engines": {
|
|
24
25
|
"node": ">=22.0.0"
|
|
25
26
|
},
|
|
26
27
|
"scripts": {
|
|
27
28
|
"start": "node bin/aegiscode.js",
|
|
28
|
-
"predist": "node scripts/predist.mjs",
|
|
29
|
-
"prepack": "node scripts/predist.mjs --quiet",
|
|
30
|
-
"prepublishOnly": "npm run predist",
|
|
31
|
-
"precheck": "node scripts/predist.mjs",
|
|
32
29
|
"check": "node scripts/check.mjs",
|
|
33
|
-
"pretest": "node scripts/predist.mjs",
|
|
34
30
|
"test": "node scripts/runtests.mjs"
|
|
35
31
|
},
|
|
36
32
|
"keywords": [
|